@dcl/auth-site 0.1.3-7359128689.commit-62bca57 → 0.1.3-7378840092.commit-24eec55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,182 +0,0 @@
1
- var Wce=Object.defineProperty;var Yce=(t,e,r)=>e in t?Wce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Fe=(t,e,r)=>(Yce(t,typeof e!="symbol"?e+"":e,r),r),LS=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var W=(t,e,r)=>(LS(t,e,"read from private field"),r?r.call(t):e.get(t)),Je=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Te=(t,e,r,n)=>(LS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Mm=(t,e,r,n)=>({set _(i){Te(t,e,i,r)},get _(){return W(t,e,n)}}),ut=(t,e,r)=>(LS(t,e,"access private method"),r);function Qce(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var $e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ia(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var nG={exports:{}},s1={};/*
2
- object-assign
3
- (c) Sindre Sorhus
4
- @license MIT
5
- */var y$=Object.getOwnPropertySymbols,Jce=Object.prototype.hasOwnProperty,Xce=Object.prototype.propertyIsEnumerable;function Zce(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function eue(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var iG=eue()?Object.assign:function(t,e){for(var r,n=Zce(t),i,s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var a in r)Jce.call(r,a)&&(n[a]=r[a]);if(y$){i=y$(r);for(var o=0;o<i.length;o++)Xce.call(r,i[o])&&(n[i[o]]=r[i[o]])}}return n},sG={exports:{}},fn={};/** @license React v17.0.2
6
- * react.production.min.js
7
- *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */var c8=iG,Wg=60103,aG=60106;fn.Fragment=60107;fn.StrictMode=60108;fn.Profiler=60114;var oG=60109,cG=60110,uG=60112;fn.Suspense=60113;var lG=60115,fG=60116;if(typeof Symbol=="function"&&Symbol.for){var Wo=Symbol.for;Wg=Wo("react.element"),aG=Wo("react.portal"),fn.Fragment=Wo("react.fragment"),fn.StrictMode=Wo("react.strict_mode"),fn.Profiler=Wo("react.profiler"),oG=Wo("react.provider"),cG=Wo("react.context"),uG=Wo("react.forward_ref"),fn.Suspense=Wo("react.suspense"),lG=Wo("react.memo"),fG=Wo("react.lazy")}var v$=typeof Symbol=="function"&&Symbol.iterator;function tue(t){return t===null||typeof t!="object"?null:(t=v$&&t[v$]||t["@@iterator"],typeof t=="function"?t:null)}function a1(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var dG={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hG={};function Yg(t,e,r){this.props=t,this.context=e,this.refs=hG,this.updater=r||dG}Yg.prototype.isReactComponent={};Yg.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error(a1(85));this.updater.enqueueSetState(this,t,e,"setState")};Yg.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function pG(){}pG.prototype=Yg.prototype;function u8(t,e,r){this.props=t,this.context=e,this.refs=hG,this.updater=r||dG}var l8=u8.prototype=new pG;l8.constructor=u8;c8(l8,Yg.prototype);l8.isPureReactComponent=!0;var f8={current:null},gG=Object.prototype.hasOwnProperty,mG={key:!0,ref:!0,__self:!0,__source:!0};function yG(t,e,r){var n,i={},s=null,a=null;if(e!=null)for(n in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(s=""+e.key),e)gG.call(e,n)&&!mG.hasOwnProperty(n)&&(i[n]=e[n]);var o=arguments.length-2;if(o===1)i.children=r;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)i[n]===void 0&&(i[n]=o[n]);return{$$typeof:Wg,type:t,key:s,ref:a,props:i,_owner:f8.current}}function rue(t,e){return{$$typeof:Wg,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function d8(t){return typeof t=="object"&&t!==null&&t.$$typeof===Wg}function nue(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var b$=/\/+/g;function US(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nue(""+t.key):e.toString(36)}function R_(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Wg:case aG:a=!0}}if(a)return a=t,i=i(a),t=n===""?"."+US(a,0):n,Array.isArray(i)?(r="",t!=null&&(r=t.replace(b$,"$&/")+"/"),R_(i,e,r,"",function(u){return u})):i!=null&&(d8(i)&&(i=rue(i,r+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(b$,"$&/")+"/")+t)),e.push(i)),1;if(a=0,n=n===""?".":n+":",Array.isArray(t))for(var o=0;o<t.length;o++){s=t[o];var c=n+US(s,o);a+=R_(s,e,r,c,i)}else if(c=tue(t),typeof c=="function")for(t=c.call(t),o=0;!(s=t.next()).done;)s=s.value,c=n+US(s,o++),a+=R_(s,e,r,c,i);else if(s==="object")throw e=""+t,Error(a1(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e));return a}function Pw(t,e,r){if(t==null)return t;var n=[],i=0;return R_(t,n,"","",function(s){return e.call(r,s,i++)}),n}function iue(t){if(t._status===-1){var e=t._result;e=e(),t._status=0,t._result=e,e.then(function(r){t._status===0&&(r=r.default,t._status=1,t._result=r)},function(r){t._status===0&&(t._status=2,t._result=r)})}if(t._status===1)return t._result;throw t._result}var vG={current:null};function vl(){var t=vG.current;if(t===null)throw Error(a1(321));return t}var sue={ReactCurrentDispatcher:vG,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:f8,IsSomeRendererActing:{current:!1},assign:c8};fn.Children={map:Pw,forEach:function(t,e,r){Pw(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Pw(t,function(){e++}),e},toArray:function(t){return Pw(t,function(e){return e})||[]},only:function(t){if(!d8(t))throw Error(a1(143));return t}};fn.Component=Yg;fn.PureComponent=u8;fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sue;fn.cloneElement=function(t,e,r){if(t==null)throw Error(a1(267,t));var n=c8({},t.props),i=t.key,s=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,a=f8.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(c in e)gG.call(e,c)&&!mG.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&o!==void 0?o[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:Wg,type:t.type,key:i,ref:s,props:n,_owner:a}};fn.createContext=function(t,e){return e===void 0&&(e=null),t={$$typeof:cG,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider={$$typeof:oG,_context:t},t.Consumer=t};fn.createElement=yG;fn.createFactory=function(t){var e=yG.bind(null,t);return e.type=t,e};fn.createRef=function(){return{current:null}};fn.forwardRef=function(t){return{$$typeof:uG,render:t}};fn.isValidElement=d8;fn.lazy=function(t){return{$$typeof:fG,_payload:{_status:-1,_result:t},_init:iue}};fn.memo=function(t,e){return{$$typeof:lG,type:t,compare:e===void 0?null:e}};fn.useCallback=function(t,e){return vl().useCallback(t,e)};fn.useContext=function(t,e){return vl().useContext(t,e)};fn.useDebugValue=function(){};fn.useEffect=function(t,e){return vl().useEffect(t,e)};fn.useImperativeHandle=function(t,e,r){return vl().useImperativeHandle(t,e,r)};fn.useLayoutEffect=function(t,e){return vl().useLayoutEffect(t,e)};fn.useMemo=function(t,e){return vl().useMemo(t,e)};fn.useReducer=function(t,e,r){return vl().useReducer(t,e,r)};fn.useRef=function(t){return vl().useRef(t)};fn.useState=function(t){return vl().useState(t)};fn.version="17.0.2";sG.exports=fn;var Ve=sG.exports;const bG=_c(Ve),aue=Qce({__proto__:null,default:bG},[Ve]);/** @license React v17.0.2
13
- * react-jsx-runtime.production.min.js
14
- *
15
- * Copyright (c) Facebook, Inc. and its affiliates.
16
- *
17
- * This source code is licensed under the MIT license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */var oue=Ve,wG=60103;s1.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var w$=Symbol.for;wG=w$("react.element"),s1.Fragment=w$("react.fragment")}var cue=oue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uue=Object.prototype.hasOwnProperty,lue={key:!0,ref:!0,__self:!0,__source:!0};function _G(t,e,r){var n,i={},s=null,a=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(a=e.ref);for(n in e)uue.call(e,n)&&!lue.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:wG,type:t,key:s,ref:a,props:i,_owner:cue.current}}s1.jsx=_G;s1.jsxs=_G;nG.exports=s1;var He=nG.exports;var EG={exports:{}},Lo={},xG={exports:{}},AG={};/** @license React v0.20.2
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */(function(t){var e,r,n,i;if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}if(typeof window>"u"||typeof MessageChannel!="function"){var c=null,u=null,f=function(){if(c!==null)try{var M=t.unstable_now();c(!0,M),c=null}catch(q){throw setTimeout(f,0),q}};e=function(M){c!==null?setTimeout(e,0,M):(c=M,setTimeout(f,0))},r=function(M,q){u=setTimeout(M,q)},n=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,m=window.clearTimeout;if(typeof console<"u"){var y=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof y!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var w=!1,v=null,g=-1,_=5,b=0;t.unstable_shouldYield=function(){return t.unstable_now()>=b},i=function(){},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<M?Math.floor(1e3/M):5};var S=new MessageChannel,A=S.port2;S.port1.onmessage=function(){if(v!==null){var M=t.unstable_now();b=M+_;try{v(!0,M)?A.postMessage(null):(w=!1,v=null)}catch(q){throw A.postMessage(null),q}}else w=!1},e=function(M){v=M,w||(w=!0,A.postMessage(null))},r=function(M,q){g=h(function(){M(t.unstable_now())},q)},n=function(){m(g),g=-1}}function O(M,q){var $=M.length;M.push(q);e:for(;;){var k=$-1>>>1,G=M[k];if(G!==void 0&&0<I(G,q))M[k]=q,M[$]=G,$=k;else break e}}function E(M){return M=M[0],M===void 0?null:M}function p(M){var q=M[0];if(q!==void 0){var $=M.pop();if($!==q){M[0]=$;e:for(var k=0,G=M.length;k<G;){var pe=2*(k+1)-1,Q=M[pe],te=pe+1,ce=M[te];if(Q!==void 0&&0>I(Q,$))ce!==void 0&&0>I(ce,Q)?(M[k]=ce,M[te]=$,k=te):(M[k]=Q,M[pe]=$,k=pe);else if(ce!==void 0&&0>I(ce,$))M[k]=ce,M[te]=$,k=te;else break e}}return q}return null}function I(M,q){var $=M.sortIndex-q.sortIndex;return $!==0?$:M.id-q.id}var N=[],B=[],V=1,de=null,ve=3,j=!1,L=!1,Y=!1;function ne(M){for(var q=E(B);q!==null;){if(q.callback===null)p(B);else if(q.startTime<=M)p(B),q.sortIndex=q.expirationTime,O(N,q);else break;q=E(B)}}function U(M){if(Y=!1,ne(M),!L)if(E(N)!==null)L=!0,e(F);else{var q=E(B);q!==null&&r(U,q.startTime-M)}}function F(M,q){L=!1,Y&&(Y=!1,n()),j=!0;var $=ve;try{for(ne(q),de=E(N);de!==null&&(!(de.expirationTime>q)||M&&!t.unstable_shouldYield());){var k=de.callback;if(typeof k=="function"){de.callback=null,ve=de.priorityLevel;var G=k(de.expirationTime<=q);q=t.unstable_now(),typeof G=="function"?de.callback=G:de===E(N)&&p(N),ne(q)}else p(N);de=E(N)}if(de!==null)var pe=!0;else{var Q=E(B);Q!==null&&r(U,Q.startTime-q),pe=!1}return pe}finally{de=null,ve=$,j=!1}}var H=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_continueExecution=function(){L||j||(L=!0,e(F))},t.unstable_getCurrentPriorityLevel=function(){return ve},t.unstable_getFirstCallbackNode=function(){return E(N)},t.unstable_next=function(M){switch(ve){case 1:case 2:case 3:var q=3;break;default:q=ve}var $=ve;ve=q;try{return M()}finally{ve=$}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(M,q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var $=ve;ve=M;try{return q()}finally{ve=$}},t.unstable_scheduleCallback=function(M,q,$){var k=t.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?k+$:k):$=k,M){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=$+G,M={id:V++,callback:q,priorityLevel:M,startTime:$,expirationTime:G,sortIndex:-1},$>k?(M.sortIndex=$,O(B,M),E(N)===null&&M===E(B)&&(Y?n():Y=!0,r(U,$-k))):(M.sortIndex=G,O(N,M),L||j||(L=!0,e(F))),M},t.unstable_wrapCallback=function(M){var q=ve;return function(){var $=ve;ve=q;try{return M.apply(this,arguments)}finally{ve=$}}}})(AG);xG.exports=AG;var fue=xG.exports;/** @license React v17.0.2
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Lx=Ve,ei=iG,Wi=fue;function bt(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Lx)throw Error(bt(227));var SG=new Set,Wv={};function Bh(t,e){xg(t,e),xg(t+"Capture",e)}function xg(t,e){for(Wv[t]=e,t=0;t<e.length;t++)SG.add(e[t])}var fl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),due=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_$=Object.prototype.hasOwnProperty,E$={},x$={};function hue(t){return _$.call(x$,t)?!0:_$.call(E$,t)?!1:due.test(t)?x$[t]=!0:(E$[t]=!0,!1)}function pue(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function gue(t,e,r,n){if(e===null||typeof e>"u"||pue(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ta(t,e,r,n,i,s,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=a}var hs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){hs[t]=new ta(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];hs[e]=new ta(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){hs[t]=new ta(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){hs[t]=new ta(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){hs[t]=new ta(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){hs[t]=new ta(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){hs[t]=new ta(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){hs[t]=new ta(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){hs[t]=new ta(t,5,!1,t.toLowerCase(),null,!1,!1)});var h8=/[\-:]([a-z])/g;function p8(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(h8,p8);hs[e]=new ta(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(h8,p8);hs[e]=new ta(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(h8,p8);hs[e]=new ta(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){hs[t]=new ta(t,1,!1,t.toLowerCase(),null,!1,!1)});hs.xlinkHref=new ta("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){hs[t]=new ta(t,1,!1,t.toLowerCase(),null,!0,!0)});function g8(t,e,r,n){var i=hs.hasOwnProperty(e)?hs[e]:null,s=i!==null?i.type===0:n?!1:!(!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N");s||(gue(e,r,i,n)&&(r=null),n||i===null?hue(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=r===null?i.type===3?!1:"":r:(e=i.attributeName,n=i.attributeNamespace,r===null?t.removeAttribute(e):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var Fh=Lx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Zy=60103,Hd=60106,ef=60107,m8=60108,_v=60114,y8=60109,v8=60110,Ux=60112,Ev=60113,bE=60120,jx=60115,b8=60116,w8=60121,_8=60128,OG=60129,E8=60130,KC=60131;if(typeof Symbol=="function"&&Symbol.for){var zi=Symbol.for;Zy=zi("react.element"),Hd=zi("react.portal"),ef=zi("react.fragment"),m8=zi("react.strict_mode"),_v=zi("react.profiler"),y8=zi("react.provider"),v8=zi("react.context"),Ux=zi("react.forward_ref"),Ev=zi("react.suspense"),bE=zi("react.suspense_list"),jx=zi("react.memo"),b8=zi("react.lazy"),w8=zi("react.block"),zi("react.scope"),_8=zi("react.opaque.id"),OG=zi("react.debug_trace_mode"),E8=zi("react.offscreen"),KC=zi("react.legacy_hidden")}var A$=typeof Symbol=="function"&&Symbol.iterator;function km(t){return t===null||typeof t!="object"?null:(t=A$&&t[A$]||t["@@iterator"],typeof t=="function"?t:null)}var jS;function ev(t){if(jS===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);jS=e&&e[1]||""}return`
34
- `+jS+t}var BS=!1;function Tw(t,e){if(!t||BS)return"";BS=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var n=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){n=c}t.call(e.prototype)}else{try{throw Error()}catch(c){n=c}t()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
- `),s=n.stack.split(`
36
- `),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o])return`
37
- `+i[a].replace(" at new "," at ");while(1<=a&&0<=o);break}}}finally{BS=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?ev(t):""}function mue(t){switch(t.tag){case 5:return ev(t.type);case 16:return ev("Lazy");case 13:return ev("Suspense");case 19:return ev("SuspenseList");case 0:case 2:case 15:return t=Tw(t.type,!1),t;case 11:return t=Tw(t.type.render,!1),t;case 22:return t=Tw(t.type._render,!1),t;case 1:return t=Tw(t.type,!0),t;default:return""}}function d0(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ef:return"Fragment";case Hd:return"Portal";case _v:return"Profiler";case m8:return"StrictMode";case Ev:return"Suspense";case bE:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case v8:return(t.displayName||"Context")+".Consumer";case y8:return(t._context.displayName||"Context")+".Provider";case Ux:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case jx:return d0(t.type);case w8:return d0(t._render);case b8:e=t._payload,t=t._init;try{return d0(t(e))}catch{}}return null}function kf(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function IG(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yue(t){var e=IG(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Cw(t){t._valueTracker||(t._valueTracker=yue(t))}function PG(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=IG(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function wE(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function WC(t,e){var r=e.checked;return ei({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function S$(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=kf(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function TG(t,e){e=e.checked,e!=null&&g8(t,"checked",e,!1)}function YC(t,e){TG(t,e);var r=kf(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?QC(t,e.type,r):e.hasOwnProperty("defaultValue")&&QC(t,e.type,kf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function O$(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function QC(t,e,r){(e!=="number"||wE(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}function vue(t){var e="";return Lx.Children.forEach(t,function(r){r!=null&&(e+=r)}),e}function JC(t,e){return t=ei({children:void 0},e),(e=vue(e.children))&&(t.children=e),t}function h0(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+kf(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function XC(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(bt(91));return ei({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function I$(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(bt(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(bt(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:kf(r)}}function CG(t,e){var r=kf(e.value),n=kf(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function P$(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var ZC={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function RG(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function eR(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?RG(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Rw,NG=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t}(function(t,e){if(t.namespaceURI!==ZC.svg||"innerHTML"in t)t.innerHTML=e;else{for(Rw=Rw||document.createElement("div"),Rw.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Rw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Yv(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var xv={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bue=["Webkit","ms","Moz","O"];Object.keys(xv).forEach(function(t){bue.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),xv[e]=xv[t]})});function DG(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||xv.hasOwnProperty(t)&&xv[t]?(""+e).trim():e+"px"}function MG(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=DG(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var wue=ei({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tR(t,e){if(e){if(wue[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(bt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(bt(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(bt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(bt(62))}}function rR(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function x8(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var nR=null,p0=null,g0=null;function T$(t){if(t=c1(t)){if(typeof nR!="function")throw Error(bt(280));var e=t.stateNode;e&&(e=Vx(e),nR(t.stateNode,t.type,e))}}function kG(t){p0?g0?g0.push(t):g0=[t]:p0=t}function $G(){if(p0){var t=p0,e=g0;if(g0=p0=null,T$(t),e)for(t=0;t<e.length;t++)T$(e[t])}}function A8(t,e){return t(e)}function LG(t,e,r,n,i){return t(e,r,n,i)}function S8(){}var UG=A8,zd=!1,FS=!1;function O8(){(p0!==null||g0!==null)&&(S8(),$G())}function _ue(t,e,r){if(FS)return t(e,r);FS=!0;try{return UG(t,e,r)}finally{FS=!1,O8()}}function Qv(t,e){var r=t.stateNode;if(r===null)return null;var n=Vx(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(bt(231,e,typeof r));return r}var iR=!1;if(fl)try{var $m={};Object.defineProperty($m,"passive",{get:function(){iR=!0}}),window.addEventListener("test",$m,$m),window.removeEventListener("test",$m,$m)}catch{iR=!1}function Eue(t,e,r,n,i,s,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(f){this.onError(f)}}var Av=!1,_E=null,EE=!1,sR=null,xue={onError:function(t){Av=!0,_E=t}};function Aue(t,e,r,n,i,s,a,o,c){Av=!1,_E=null,Eue.apply(xue,arguments)}function Sue(t,e,r,n,i,s,a,o,c){if(Aue.apply(this,arguments),Av){if(Av){var u=_E;Av=!1,_E=null}else throw Error(bt(198));EE||(EE=!0,sR=u)}}function qh(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&1026&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function jG(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function C$(t){if(qh(t)!==t)throw Error(bt(188))}function Oue(t){var e=t.alternate;if(!e){if(e=qh(t),e===null)throw Error(bt(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return C$(i),t;if(s===n)return C$(i),e;s=s.sibling}throw Error(bt(188))}if(r.return!==n.return)r=i,n=s;else{for(var a=!1,o=i.child;o;){if(o===r){a=!0,r=i,n=s;break}if(o===n){a=!0,n=i,r=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===r){a=!0,r=s,n=i;break}if(o===n){a=!0,n=s,r=i;break}o=o.sibling}if(!a)throw Error(bt(189))}}if(r.alternate!==n)throw Error(bt(190))}if(r.tag!==3)throw Error(bt(188));return r.stateNode.current===r?t:e}function BG(t){if(t=Oue(t),!t)return null;for(var e=t;;){if(e.tag===5||e.tag===6)return e;if(e.child)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}function R$(t,e){for(var r=t.alternate;e!==null;){if(e===t||e===r)return!0;e=e.return}return!1}var FG,I8,qG,HG,aR=!1,Wc=[],Af=null,Sf=null,Of=null,Jv=new Map,Xv=new Map,Lm=[],N$="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function oR(t,e,r,n,i){return{blockedOn:t,domEventName:e,eventSystemFlags:r|16,nativeEvent:i,targetContainers:[n]}}function D$(t,e){switch(t){case"focusin":case"focusout":Af=null;break;case"dragenter":case"dragleave":Sf=null;break;case"mouseover":case"mouseout":Of=null;break;case"pointerover":case"pointerout":Jv.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xv.delete(e.pointerId)}}function Um(t,e,r,n,i,s){return t===null||t.nativeEvent!==s?(t=oR(e,r,n,i,s),e!==null&&(e=c1(e),e!==null&&I8(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function Iue(t,e,r,n,i){switch(e){case"focusin":return Af=Um(Af,t,e,r,n,i),!0;case"dragenter":return Sf=Um(Sf,t,e,r,n,i),!0;case"mouseover":return Of=Um(Of,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return Jv.set(s,Um(Jv.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Xv.set(s,Um(Xv.get(s)||null,t,e,r,n,i)),!0}return!1}function Pue(t){var e=Vd(t.target);if(e!==null){var r=qh(e);if(r!==null){if(e=r.tag,e===13){if(e=jG(r),e!==null){t.blockedOn=e,HG(t.lanePriority,function(){Wi.unstable_runWithPriority(t.priority,function(){qG(r)})});return}}else if(e===3&&r.stateNode.hydrate){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function N_(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=R8(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r!==null)return e=c1(r),e!==null&&I8(e),t.blockedOn=r,!1;e.shift()}return!0}function M$(t,e,r){N_(t)&&r.delete(e)}function Tue(){for(aR=!1;0<Wc.length;){var t=Wc[0];if(t.blockedOn!==null){t=c1(t.blockedOn),t!==null&&FG(t);break}for(var e=t.targetContainers;0<e.length;){var r=R8(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r!==null){t.blockedOn=r;break}e.shift()}t.blockedOn===null&&Wc.shift()}Af!==null&&N_(Af)&&(Af=null),Sf!==null&&N_(Sf)&&(Sf=null),Of!==null&&N_(Of)&&(Of=null),Jv.forEach(M$),Xv.forEach(M$)}function jm(t,e){t.blockedOn===e&&(t.blockedOn=null,aR||(aR=!0,Wi.unstable_scheduleCallback(Wi.unstable_NormalPriority,Tue)))}function zG(t){function e(i){return jm(i,t)}if(0<Wc.length){jm(Wc[0],t);for(var r=1;r<Wc.length;r++){var n=Wc[r];n.blockedOn===t&&(n.blockedOn=null)}}for(Af!==null&&jm(Af,t),Sf!==null&&jm(Sf,t),Of!==null&&jm(Of,t),Jv.forEach(e),Xv.forEach(e),r=0;r<Lm.length;r++)n=Lm[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Lm.length&&(r=Lm[0],r.blockedOn===null);)Pue(r),r.blockedOn===null&&Lm.shift()}function Nw(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Qp={animationend:Nw("Animation","AnimationEnd"),animationiteration:Nw("Animation","AnimationIteration"),animationstart:Nw("Animation","AnimationStart"),transitionend:Nw("Transition","TransitionEnd")},qS={},VG={};fl&&(VG=document.createElement("div").style,"AnimationEvent"in window||(delete Qp.animationend.animation,delete Qp.animationiteration.animation,delete Qp.animationstart.animation),"TransitionEvent"in window||delete Qp.transitionend.transition);function Bx(t){if(qS[t])return qS[t];if(!Qp[t])return t;var e=Qp[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in VG)return qS[t]=e[r];return t}var GG=Bx("animationend"),KG=Bx("animationiteration"),WG=Bx("animationstart"),YG=Bx("transitionend"),QG=new Map,P8=new Map,Cue=["abort","abort",GG,"animationEnd",KG,"animationIteration",WG,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",YG,"transitionEnd","waiting","waiting"];function T8(t,e){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];i="on"+(i[0].toUpperCase()+i.slice(1)),P8.set(n,e),QG.set(n,i),Bh(i,[n])}}var Rue=Wi.unstable_now;Rue();var jn=8;function Up(t){if(1&t)return jn=15,1;if(2&t)return jn=14,2;if(4&t)return jn=13,4;var e=24&t;return e!==0?(jn=12,e):t&32?(jn=11,32):(e=192&t,e!==0?(jn=10,e):t&256?(jn=9,256):(e=3584&t,e!==0?(jn=8,e):t&4096?(jn=7,4096):(e=4186112&t,e!==0?(jn=6,e):(e=62914560&t,e!==0?(jn=5,e):t&67108864?(jn=4,67108864):t&134217728?(jn=3,134217728):(e=805306368&t,e!==0?(jn=2,e):1073741824&t?(jn=1,1073741824):(jn=8,t))))))}function Nue(t){switch(t){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function Due(t){switch(t){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(bt(358,t))}}function Zv(t,e){var r=t.pendingLanes;if(r===0)return jn=0;var n=0,i=0,s=t.expiredLanes,a=t.suspendedLanes,o=t.pingedLanes;if(s!==0)n=s,i=jn=15;else if(s=r&134217727,s!==0){var c=s&~a;c!==0?(n=Up(c),i=jn):(o&=s,o!==0&&(n=Up(o),i=jn))}else s=r&~a,s!==0?(n=Up(s),i=jn):o!==0&&(n=Up(o),i=jn);if(n===0)return 0;if(n=31-$f(n),n=r&((0>n?0:1<<n)<<1)-1,e!==0&&e!==n&&!(e&a)){if(Up(e),i<=jn)return e;jn=i}if(e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-$f(e),i=1<<r,n|=t[r],e&=~i;return n}function JG(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function xE(t,e){switch(t){case 15:return 1;case 14:return 2;case 12:return t=jp(24&~e),t===0?xE(10,e):t;case 10:return t=jp(192&~e),t===0?xE(8,e):t;case 8:return t=jp(3584&~e),t===0&&(t=jp(4186112&~e),t===0&&(t=512)),t;case 2:return e=jp(805306368&~e),e===0&&(e=268435456),e}throw Error(bt(358,t))}function jp(t){return t&-t}function HS(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Fx(t,e,r){t.pendingLanes|=e;var n=e-1;t.suspendedLanes&=n,t.pingedLanes&=n,t=t.eventTimes,e=31-$f(e),t[e]=r}var $f=Math.clz32?Math.clz32:$ue,Mue=Math.log,kue=Math.LN2;function $ue(t){return t===0?32:31-(Mue(t)/kue|0)|0}var Lue=Wi.unstable_UserBlockingPriority,Uue=Wi.unstable_runWithPriority,D_=!0;function jue(t,e,r,n){zd||S8();var i=C8,s=zd;zd=!0;try{LG(i,t,e,r,n)}finally{(zd=s)||O8()}}function Bue(t,e,r,n){Uue(Lue,C8.bind(null,t,e,r,n))}function C8(t,e,r,n){if(D_){var i;if((i=(e&4)===0)&&0<Wc.length&&-1<N$.indexOf(t))t=oR(null,t,e,r,n),Wc.push(t);else{var s=R8(t,e,r,n);if(s===null)i&&D$(t,n);else{if(i){if(-1<N$.indexOf(t)){t=oR(s,t,e,r,n),Wc.push(t);return}if(Iue(s,t,e,r,n))return;D$(t,n)}lK(t,e,n,null,r)}}}}function R8(t,e,r,n){var i=x8(n);if(i=Vd(i),i!==null){var s=qh(i);if(s===null)i=null;else{var a=s.tag;if(a===13){if(i=jG(s),i!==null)return i;i=null}else if(a===3){if(s.stateNode.hydrate)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return lK(t,e,n,i,r),null}var yf=null,N8=null,M_=null;function XG(){if(M_)return M_;var t,e=N8,r=e.length,n,i="value"in yf?yf.value:yf.textContent,s=i.length;for(t=0;t<r&&e[t]===i[t];t++);var a=r-t;for(n=1;n<=a&&e[r-n]===i[s-n];n++);return M_=i.slice(t,1<n?1-n:void 0)}function k_(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Dw(){return!0}function k$(){return!1}function Va(t){function e(r,n,i,s,a){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(r=t[o],this[o]=r?r(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Dw:k$,this.isPropagationStopped=k$,this}return ei(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Dw)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Dw)},persist:function(){},isPersistent:Dw}),e}var Qg={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},D8=Va(Qg),o1=ei({},Qg,{view:0,detail:0}),Fue=Va(o1),zS,VS,Bm,qx=ei({},o1,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:M8,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Bm&&(Bm&&t.type==="mousemove"?(zS=t.screenX-Bm.screenX,VS=t.screenY-Bm.screenY):VS=zS=0,Bm=t),zS)},movementY:function(t){return"movementY"in t?t.movementY:VS}}),$$=Va(qx),que=ei({},qx,{dataTransfer:0}),Hue=Va(que),zue=ei({},o1,{relatedTarget:0}),GS=Va(zue),Vue=ei({},Qg,{animationName:0,elapsedTime:0,pseudoElement:0}),Gue=Va(Vue),Kue=ei({},Qg,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Wue=Va(Kue),Yue=ei({},Qg,{data:0}),L$=Va(Yue),Que={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jue={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xue={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zue(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Xue[t])?!!e[t]:!1}function M8(){return Zue}var ele=ei({},o1,{key:function(t){if(t.key){var e=Que[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=k_(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Jue[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:M8,charCode:function(t){return t.type==="keypress"?k_(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?k_(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),tle=Va(ele),rle=ei({},qx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),U$=Va(rle),nle=ei({},o1,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:M8}),ile=Va(nle),sle=ei({},Qg,{propertyName:0,elapsedTime:0,pseudoElement:0}),ale=Va(sle),ole=ei({},qx,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),cle=Va(ole),ule=[9,13,27,32],k8=fl&&"CompositionEvent"in window,Sv=null;fl&&"documentMode"in document&&(Sv=document.documentMode);var lle=fl&&"TextEvent"in window&&!Sv,ZG=fl&&(!k8||Sv&&8<Sv&&11>=Sv),j$=String.fromCharCode(32),B$=!1;function eK(t,e){switch(t){case"keyup":return ule.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tK(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jp=!1;function fle(t,e){switch(t){case"compositionend":return tK(e);case"keypress":return e.which!==32?null:(B$=!0,j$);case"textInput":return t=e.data,t===j$&&B$?null:t;default:return null}}function dle(t,e){if(Jp)return t==="compositionend"||!k8&&eK(t,e)?(t=XG(),M_=N8=yf=null,Jp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return ZG&&e.locale!=="ko"?null:e.data;default:return null}}var hle={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function F$(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!hle[t.type]:e==="textarea"}function rK(t,e,r,n){kG(n),e=AE(e,"onChange"),0<e.length&&(r=new D8("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Ov=null,eb=null;function ple(t){oK(t,0)}function Hx(t){var e=Zp(t);if(PG(e))return t}function gle(t,e){if(t==="change")return e}var nK=!1;if(fl){var KS;if(fl){var WS="oninput"in document;if(!WS){var q$=document.createElement("div");q$.setAttribute("oninput","return;"),WS=typeof q$.oninput=="function"}KS=WS}else KS=!1;nK=KS&&(!document.documentMode||9<document.documentMode)}function H$(){Ov&&(Ov.detachEvent("onpropertychange",iK),eb=Ov=null)}function iK(t){if(t.propertyName==="value"&&Hx(eb)){var e=[];if(rK(e,eb,t,x8(t)),t=ple,zd)t(e);else{zd=!0;try{A8(t,e)}finally{zd=!1,O8()}}}}function mle(t,e,r){t==="focusin"?(H$(),Ov=e,eb=r,Ov.attachEvent("onpropertychange",iK)):t==="focusout"&&H$()}function yle(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Hx(eb)}function vle(t,e){if(t==="click")return Hx(e)}function ble(t,e){if(t==="input"||t==="change")return Hx(e)}function wle(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var xo=typeof Object.is=="function"?Object.is:wle,_le=Object.prototype.hasOwnProperty;function tb(t,e){if(xo(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!_le.call(e,r[n])||!xo(t[r[n]],e[r[n]]))return!1;return!0}function z$(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function V$(t,e){var r=z$(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=z$(r)}}function sK(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?sK(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function G$(){for(var t=window,e=wE();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=wE(t.document)}return e}function cR(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Ele=fl&&"documentMode"in document&&11>=document.documentMode,Xp=null,uR=null,Iv=null,lR=!1;function K$(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;lR||Xp==null||Xp!==wE(n)||(n=Xp,"selectionStart"in n&&cR(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Iv&&tb(Iv,n)||(Iv=n,n=AE(uR,"onSelect"),0<n.length&&(e=new D8("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Xp)))}T8("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0);T8("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1);T8(Cue,2);for(var W$="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),YS=0;YS<W$.length;YS++)P8.set(W$[YS],0);xg("onMouseEnter",["mouseout","mouseover"]);xg("onMouseLeave",["mouseout","mouseover"]);xg("onPointerEnter",["pointerout","pointerover"]);xg("onPointerLeave",["pointerout","pointerover"]);Bh("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bh("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bh("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bh("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bh("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bh("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tv="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),aK=new Set("cancel close invalid load scroll toggle".split(" ").concat(tv));function Y$(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,Sue(n,e,void 0,t),t.currentTarget=null}function oK(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var s=void 0;if(e)for(var a=n.length-1;0<=a;a--){var o=n[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==s&&i.isPropagationStopped())break e;Y$(i,o,u),s=c}else for(a=0;a<n.length;a++){if(o=n[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==s&&i.isPropagationStopped())break e;Y$(i,o,u),s=c}}}if(EE)throw t=sR,EE=!1,sR=null,t}function Vn(t,e){var r=dK(e),n=t+"__bubble";r.has(n)||(uK(e,t,2,!1),r.add(n))}var Q$="_reactListening"+Math.random().toString(36).slice(2);function cK(t){t[Q$]||(t[Q$]=!0,SG.forEach(function(e){aK.has(e)||J$(e,!1,t,null),J$(e,!0,t,null)}))}function J$(t,e,r,n){var i=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,s=r;if(t==="selectionchange"&&r.nodeType!==9&&(s=r.ownerDocument),n!==null&&!e&&aK.has(t)){if(t!=="scroll")return;i|=2,s=n}var a=dK(s),o=t+"__"+(e?"capture":"bubble");a.has(o)||(e&&(i|=4),uK(s,t,i,e),a.add(o))}function uK(t,e,r,n){var i=P8.get(e);switch(i===void 0?2:i){case 0:i=jue;break;case 1:i=Bue;break;default:i=C8}r=i.bind(null,e,r,t),i=void 0,!iR||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function lK(t,e,r,n,i){var s=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=n.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Vd(o),a===null)return;if(c=a.tag,c===5||c===6){n=s=a;continue e}o=o.parentNode}}n=n.return}_ue(function(){var u=s,f=x8(r),h=[];e:{var m=QG.get(t);if(m!==void 0){var y=D8,w=t;switch(t){case"keypress":if(k_(r)===0)break e;case"keydown":case"keyup":y=tle;break;case"focusin":w="focus",y=GS;break;case"focusout":w="blur",y=GS;break;case"beforeblur":case"afterblur":y=GS;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=$$;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Hue;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=ile;break;case GG:case KG:case WG:y=Gue;break;case YG:y=ale;break;case"scroll":y=Fue;break;case"wheel":y=cle;break;case"copy":case"cut":case"paste":y=Wue;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=U$}var v=(e&4)!==0,g=!v&&t==="scroll",_=v?m!==null?m+"Capture":null:m;v=[];for(var b=u,S;b!==null;){S=b;var A=S.stateNode;if(S.tag===5&&A!==null&&(S=A,_!==null&&(A=Qv(b,_),A!=null&&v.push(rb(b,A,S)))),g)break;b=b.return}0<v.length&&(m=new y(m,w,null,r,f),h.push({event:m,listeners:v}))}}if(!(e&7)){e:{if(m=t==="mouseover"||t==="pointerover",y=t==="mouseout"||t==="pointerout",m&&!(e&16)&&(w=r.relatedTarget||r.fromElement)&&(Vd(w)||w[Jg]))break e;if((y||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,y?(w=r.relatedTarget||r.toElement,y=u,w=w?Vd(w):null,w!==null&&(g=qh(w),w!==g||w.tag!==5&&w.tag!==6)&&(w=null)):(y=null,w=u),y!==w)){if(v=$$,A="onMouseLeave",_="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(v=U$,A="onPointerLeave",_="onPointerEnter",b="pointer"),g=y==null?m:Zp(y),S=w==null?m:Zp(w),m=new v(A,b+"leave",y,r,f),m.target=g,m.relatedTarget=S,A=null,Vd(f)===u&&(v=new v(_,b+"enter",w,r,f),v.target=S,v.relatedTarget=g,A=v),g=A,y&&w)t:{for(v=y,_=w,b=0,S=v;S;S=Ap(S))b++;for(S=0,A=_;A;A=Ap(A))S++;for(;0<b-S;)v=Ap(v),b--;for(;0<S-b;)_=Ap(_),S--;for(;b--;){if(v===_||_!==null&&v===_.alternate)break t;v=Ap(v),_=Ap(_)}v=null}else v=null;y!==null&&X$(h,m,y,v,!1),w!==null&&g!==null&&X$(h,g,w,v,!0)}}e:{if(m=u?Zp(u):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var O=gle;else if(F$(m))if(nK)O=ble;else{O=yle;var E=mle}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(O=vle);if(O&&(O=O(t,u))){rK(h,O,r,f);break e}E&&E(t,m,u),t==="focusout"&&(E=m._wrapperState)&&E.controlled&&m.type==="number"&&QC(m,"number",m.value)}switch(E=u?Zp(u):window,t){case"focusin":(F$(E)||E.contentEditable==="true")&&(Xp=E,uR=u,Iv=null);break;case"focusout":Iv=uR=Xp=null;break;case"mousedown":lR=!0;break;case"contextmenu":case"mouseup":case"dragend":lR=!1,K$(h,r,f);break;case"selectionchange":if(Ele)break;case"keydown":case"keyup":K$(h,r,f)}var p;if(k8)e:{switch(t){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else Jp?eK(t,r)&&(I="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(I="onCompositionStart");I&&(ZG&&r.locale!=="ko"&&(Jp||I!=="onCompositionStart"?I==="onCompositionEnd"&&Jp&&(p=XG()):(yf=f,N8="value"in yf?yf.value:yf.textContent,Jp=!0)),E=AE(u,I),0<E.length&&(I=new L$(I,t,null,r,f),h.push({event:I,listeners:E}),p?I.data=p:(p=tK(r),p!==null&&(I.data=p)))),(p=lle?fle(t,r):dle(t,r))&&(u=AE(u,"onBeforeInput"),0<u.length&&(f=new L$("onBeforeInput","beforeinput",null,r,f),h.push({event:f,listeners:u}),f.data=p))}oK(h,e)})}function rb(t,e,r){return{instance:t,listener:e,currentTarget:r}}function AE(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Qv(t,r),s!=null&&n.unshift(rb(t,s,i)),s=Qv(t,e),s!=null&&n.push(rb(t,s,i))),t=t.return}return n}function Ap(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function X$(t,e,r,n,i){for(var s=e._reactName,a=[];r!==null&&r!==n;){var o=r,c=o.alternate,u=o.stateNode;if(c!==null&&c===n)break;o.tag===5&&u!==null&&(o=u,i?(c=Qv(r,s),c!=null&&a.unshift(rb(r,c,o))):i||(c=Qv(r,s),c!=null&&a.push(rb(r,c,o)))),r=r.return}a.length!==0&&t.push({event:e,listeners:a})}function SE(){}var QS=null,JS=null;function fK(t,e){switch(t){case"button":case"input":case"select":case"textarea":return!!e.autoFocus}return!1}function fR(t,e){return t==="textarea"||t==="option"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Z$=typeof setTimeout=="function"?setTimeout:void 0,xle=typeof clearTimeout=="function"?clearTimeout:void 0;function $8(t){t.nodeType===1?t.textContent="":t.nodeType===9&&(t=t.body,t!=null&&(t.textContent=""))}function m0(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break}return t}function eL(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var XS=0;function Ale(t){return{$$typeof:_8,toString:t,valueOf:t}}var zx=Math.random().toString(36).slice(2),vf="__reactFiber$"+zx,OE="__reactProps$"+zx,Jg="__reactContainer$"+zx,tL="__reactEvents$"+zx;function Vd(t){var e=t[vf];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Jg]||r[vf]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=eL(t);t!==null;){if(r=t[vf])return r;t=eL(t)}return e}t=r,r=t.parentNode}return null}function c1(t){return t=t[vf]||t[Jg],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Zp(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(bt(33))}function Vx(t){return t[OE]||null}function dK(t){var e=t[tL];return e===void 0&&(e=t[tL]=new Set),e}var dR=[],e0=-1;function zf(t){return{current:t}}function Yn(t){0>e0||(t.current=dR[e0],dR[e0]=null,e0--)}function di(t,e){e0++,dR[e0]=t.current,t.current=e}var Lf={},$s=zf(Lf),_a=zf(!1),Ih=Lf;function Ag(t,e){var r=t.type.contextTypes;if(!r)return Lf;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ea(t){return t=t.childContextTypes,t!=null}function IE(){Yn(_a),Yn($s)}function rL(t,e,r){if($s.current!==Lf)throw Error(bt(168));di($s,e),di(_a,r)}function hK(t,e,r){var n=t.stateNode;if(t=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(bt(108,d0(e)||"Unknown",i));return ei({},r,n)}function $_(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Lf,Ih=$s.current,di($s,t),di(_a,_a.current),!0}function nL(t,e,r){var n=t.stateNode;if(!n)throw Error(bt(169));r?(t=hK(t,e,Ih),n.__reactInternalMemoizedMergedChildContext=t,Yn(_a),Yn($s),di($s,t)):Yn(_a),di(_a,r)}var L8=null,_h=null,Sle=Wi.unstable_runWithPriority,U8=Wi.unstable_scheduleCallback,hR=Wi.unstable_cancelCallback,Ole=Wi.unstable_shouldYield,iL=Wi.unstable_requestPaint,pR=Wi.unstable_now,Ile=Wi.unstable_getCurrentPriorityLevel,Gx=Wi.unstable_ImmediatePriority,pK=Wi.unstable_UserBlockingPriority,gK=Wi.unstable_NormalPriority,mK=Wi.unstable_LowPriority,yK=Wi.unstable_IdlePriority,ZS={},Ple=iL!==void 0?iL:function(){},$u=null,L_=null,eO=!1,sL=pR(),Ds=1e4>sL?pR:function(){return pR()-sL};function Sg(){switch(Ile()){case Gx:return 99;case pK:return 98;case gK:return 97;case mK:return 96;case yK:return 95;default:throw Error(bt(332))}}function vK(t){switch(t){case 99:return Gx;case 98:return pK;case 97:return gK;case 96:return mK;case 95:return yK;default:throw Error(bt(332))}}function Ph(t,e){return t=vK(t),Sle(t,e)}function nb(t,e,r){return t=vK(t),U8(t,e,r)}function uu(){if(L_!==null){var t=L_;L_=null,hR(t)}bK()}function bK(){if(!eO&&$u!==null){eO=!0;var t=0;try{var e=$u;Ph(99,function(){for(;t<e.length;t++){var r=e[t];do r=r(!0);while(r!==null)}}),$u=null}catch(r){throw $u!==null&&($u=$u.slice(t+1)),U8(Gx,uu),r}finally{eO=!1}}}var Tle=Fh.ReactCurrentBatchConfig;function tc(t,e){if(t&&t.defaultProps){e=ei({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}var PE=zf(null),TE=null,t0=null,CE=null;function j8(){CE=t0=TE=null}function B8(t){var e=PE.current;Yn(PE),t.type._context._currentValue=e}function wK(t,e){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)===e){if(r===null||(r.childLanes&e)===e)break;r.childLanes|=e}else t.childLanes|=e,r!==null&&(r.childLanes|=e);t=t.return}}function y0(t,e){TE=t,CE=t0=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(mc=!0),t.firstContext=null)}function Ro(t,e){if(CE!==t&&e!==!1&&e!==0)if((typeof e!="number"||e===1073741823)&&(CE=t,e=1073741823),e={context:t,observedBits:e,next:null},t0===null){if(TE===null)throw Error(bt(308));t0=e,TE.dependencies={lanes:0,firstContext:e,responders:null}}else t0=t0.next=e;return t._currentValue}var Ql=!1;function F8(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function _K(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function If(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Pf(t,e){if(t=t.updateQueue,t!==null){t=t.shared;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}}function aL(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=a:s=s.next=a,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function ib(t,e,r,n){var i=t.updateQueue;Ql=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?s=u:a.next=u,a=c;var f=t.alternate;if(f!==null){f=f.updateQueue;var h=f.lastBaseUpdate;h!==a&&(h===null?f.firstBaseUpdate=u:h.next=u,f.lastBaseUpdate=c)}}if(s!==null){h=i.baseState,a=0,f=u=c=null;do{o=s.lane;var m=s.eventTime;if((n&o)===o){f!==null&&(f=f.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=t,w=s;switch(o=e,m=r,w.tag){case 1:if(y=w.payload,typeof y=="function"){h=y.call(m,h,o);break e}h=y;break e;case 3:y.flags=y.flags&-4097|64;case 0:if(y=w.payload,o=typeof y=="function"?y.call(m,h,o):y,o==null)break e;h=ei({},h,o);break e;case 2:Ql=!0}}s.callback!==null&&(t.flags|=32,o=i.effects,o===null?i.effects=[s]:o.push(s))}else m={eventTime:m,lane:o,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=m,c=h):f=f.next=m,a|=o;if(s=s.next,s===null){if(o=i.shared.pending,o===null)break;s=o.next,o.next=null,i.lastBaseUpdate=o,i.shared.pending=null}}while(1);f===null&&(c=h),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=f,l1|=a,t.lanes=a,t.memoizedState=h}}function oL(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(bt(191,i));i.call(n)}}}var EK=new Lx.Component().refs;function RE(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:ei({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Kx={isMounted:function(t){return(t=t._reactInternals)?qh(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Ha(),i=Tf(t),s=If(n,i);s.payload=e,r!=null&&(s.callback=r),Pf(t,s),Cf(t,i,n)},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Ha(),i=Tf(t),s=If(n,i);s.tag=1,s.payload=e,r!=null&&(s.callback=r),Pf(t,s),Cf(t,i,n)},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Ha(),n=Tf(t),i=If(r,n);i.tag=2,e!=null&&(i.callback=e),Pf(t,i),Cf(t,n,r)}};function cL(t,e,r,n,i,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,a):e.prototype&&e.prototype.isPureReactComponent?!tb(r,n)||!tb(i,s):!0}function xK(t,e,r){var n=!1,i=Lf,s=e.contextType;return typeof s=="object"&&s!==null?s=Ro(s):(i=Ea(e)?Ih:$s.current,n=e.contextTypes,s=(n=n!=null)?Ag(t,i):Lf),e=new e(r,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Kx,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function uL(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&Kx.enqueueReplaceState(e,e.state,null)}function gR(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs=EK,F8(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Ro(s):(s=Ea(e)?Ih:$s.current,i.context=Ag(t,s)),ib(t,r,i,n),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(RE(t,e,s,r),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Kx.enqueueReplaceState(i,i.state,null),ib(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4)}var Mw=Array.isArray;function Fm(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(bt(309));var n=r.stateNode}if(!n)throw Error(bt(147,t));var i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(s){var a=n.refs;a===EK&&(a=n.refs={}),s===null?delete a[i]:a[i]=s},e._stringRef=i,e)}if(typeof t!="string")throw Error(bt(284));if(!r._owner)throw Error(bt(290,t))}return t}function kw(t,e){if(t.type!=="textarea")throw Error(bt(31,Object.prototype.toString.call(e)==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":e))}function AK(t){function e(g,_){if(t){var b=g.lastEffect;b!==null?(b.nextEffect=_,g.lastEffect=_):g.firstEffect=g.lastEffect=_,_.nextEffect=null,_.flags=8}}function r(g,_){if(!t)return null;for(;_!==null;)e(g,_),_=_.sibling;return null}function n(g,_){for(g=new Map;_!==null;)_.key!==null?g.set(_.key,_):g.set(_.index,_),_=_.sibling;return g}function i(g,_){return g=jf(g,_),g.index=0,g.sibling=null,g}function s(g,_,b){return g.index=b,t?(b=g.alternate,b!==null?(b=b.index,b<_?(g.flags=2,_):b):(g.flags=2,_)):_}function a(g){return t&&g.alternate===null&&(g.flags=2),g}function o(g,_,b,S){return _===null||_.tag!==6?(_=sO(b,g.mode,S),_.return=g,_):(_=i(_,b),_.return=g,_)}function c(g,_,b,S){return _!==null&&_.elementType===b.type?(S=i(_,b.props),S.ref=Fm(g,_,b),S.return=g,S):(S=F_(b.type,b.key,b.props,null,g.mode,S),S.ref=Fm(g,_,b),S.return=g,S)}function u(g,_,b,S){return _===null||_.tag!==4||_.stateNode.containerInfo!==b.containerInfo||_.stateNode.implementation!==b.implementation?(_=aO(b,g.mode,S),_.return=g,_):(_=i(_,b.children||[]),_.return=g,_)}function f(g,_,b,S,A){return _===null||_.tag!==7?(_=_0(b,g.mode,S,A),_.return=g,_):(_=i(_,b),_.return=g,_)}function h(g,_,b){if(typeof _=="string"||typeof _=="number")return _=sO(""+_,g.mode,b),_.return=g,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Zy:return b=F_(_.type,_.key,_.props,null,g.mode,b),b.ref=Fm(g,null,_),b.return=g,b;case Hd:return _=aO(_,g.mode,b),_.return=g,_}if(Mw(_)||km(_))return _=_0(_,g.mode,b,null),_.return=g,_;kw(g,_)}return null}function m(g,_,b,S){var A=_!==null?_.key:null;if(typeof b=="string"||typeof b=="number")return A!==null?null:o(g,_,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Zy:return b.key===A?b.type===ef?f(g,_,b.props.children,S,A):c(g,_,b,S):null;case Hd:return b.key===A?u(g,_,b,S):null}if(Mw(b)||km(b))return A!==null?null:f(g,_,b,S,null);kw(g,b)}return null}function y(g,_,b,S,A){if(typeof S=="string"||typeof S=="number")return g=g.get(b)||null,o(_,g,""+S,A);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Zy:return g=g.get(S.key===null?b:S.key)||null,S.type===ef?f(_,g,S.props.children,A,S.key):c(_,g,S,A);case Hd:return g=g.get(S.key===null?b:S.key)||null,u(_,g,S,A)}if(Mw(S)||km(S))return g=g.get(b)||null,f(_,g,S,A,null);kw(_,S)}return null}function w(g,_,b,S){for(var A=null,O=null,E=_,p=_=0,I=null;E!==null&&p<b.length;p++){E.index>p?(I=E,E=null):I=E.sibling;var N=m(g,E,b[p],S);if(N===null){E===null&&(E=I);break}t&&E&&N.alternate===null&&e(g,E),_=s(N,_,p),O===null?A=N:O.sibling=N,O=N,E=I}if(p===b.length)return r(g,E),A;if(E===null){for(;p<b.length;p++)E=h(g,b[p],S),E!==null&&(_=s(E,_,p),O===null?A=E:O.sibling=E,O=E);return A}for(E=n(g,E);p<b.length;p++)I=y(E,g,p,b[p],S),I!==null&&(t&&I.alternate!==null&&E.delete(I.key===null?p:I.key),_=s(I,_,p),O===null?A=I:O.sibling=I,O=I);return t&&E.forEach(function(B){return e(g,B)}),A}function v(g,_,b,S){var A=km(b);if(typeof A!="function")throw Error(bt(150));if(b=A.call(b),b==null)throw Error(bt(151));for(var O=A=null,E=_,p=_=0,I=null,N=b.next();E!==null&&!N.done;p++,N=b.next()){E.index>p?(I=E,E=null):I=E.sibling;var B=m(g,E,N.value,S);if(B===null){E===null&&(E=I);break}t&&E&&B.alternate===null&&e(g,E),_=s(B,_,p),O===null?A=B:O.sibling=B,O=B,E=I}if(N.done)return r(g,E),A;if(E===null){for(;!N.done;p++,N=b.next())N=h(g,N.value,S),N!==null&&(_=s(N,_,p),O===null?A=N:O.sibling=N,O=N);return A}for(E=n(g,E);!N.done;p++,N=b.next())N=y(E,g,p,N.value,S),N!==null&&(t&&N.alternate!==null&&E.delete(N.key===null?p:N.key),_=s(N,_,p),O===null?A=N:O.sibling=N,O=N);return t&&E.forEach(function(V){return e(g,V)}),A}return function(g,_,b,S){var A=typeof b=="object"&&b!==null&&b.type===ef&&b.key===null;A&&(b=b.props.children);var O=typeof b=="object"&&b!==null;if(O)switch(b.$$typeof){case Zy:e:{for(O=b.key,A=_;A!==null;){if(A.key===O){switch(A.tag){case 7:if(b.type===ef){r(g,A.sibling),_=i(A,b.props.children),_.return=g,g=_;break e}break;default:if(A.elementType===b.type){r(g,A.sibling),_=i(A,b.props),_.ref=Fm(g,A,b),_.return=g,g=_;break e}}r(g,A);break}else e(g,A);A=A.sibling}b.type===ef?(_=_0(b.props.children,g.mode,S,b.key),_.return=g,g=_):(S=F_(b.type,b.key,b.props,null,g.mode,S),S.ref=Fm(g,_,b),S.return=g,g=S)}return a(g);case Hd:e:{for(A=b.key;_!==null;){if(_.key===A)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){r(g,_.sibling),_=i(_,b.children||[]),_.return=g,g=_;break e}else{r(g,_);break}else e(g,_);_=_.sibling}_=aO(b,g.mode,S),_.return=g,g=_}return a(g)}if(typeof b=="string"||typeof b=="number")return b=""+b,_!==null&&_.tag===6?(r(g,_.sibling),_=i(_,b),_.return=g,g=_):(r(g,_),_=sO(b,g.mode,S),_.return=g,g=_),a(g);if(Mw(b))return w(g,_,b,S);if(km(b))return v(g,_,b,S);if(O&&kw(g,b),typeof b>"u"&&!A)switch(g.tag){case 1:case 22:case 0:case 11:case 15:throw Error(bt(152,d0(g.type)||"Component"))}return r(g,_)}}var NE=AK(!0),SK=AK(!1),u1={},Zc=zf(u1),sb=zf(u1),ab=zf(u1);function Gd(t){if(t===u1)throw Error(bt(174));return t}function mR(t,e){switch(di(ab,e),di(sb,t),di(Zc,u1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:eR(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=eR(e,t)}Yn(Zc),di(Zc,e)}function Og(){Yn(Zc),Yn(sb),Yn(ab)}function lL(t){Gd(ab.current);var e=Gd(Zc.current),r=eR(e,t.type);e!==r&&(di(sb,t),di(Zc,r))}function q8(t){sb.current===t&&(Yn(Zc),Yn(sb))}var fi=zf(0);function DE(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&64)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var el=null,bf=null,eu=!1;function OK(t,e){var r=Ao(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=e,r.return=t,r.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r}function fL(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function yR(t){if(eu){var e=bf;if(e){var r=e;if(!fL(t,e)){if(e=m0(r.nextSibling),!e||!fL(t,e)){t.flags=t.flags&-1025|2,eu=!1,el=t;return}OK(el,r)}el=t,bf=m0(e.firstChild)}else t.flags=t.flags&-1025|2,eu=!1,el=t}}function dL(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;el=t}function $w(t){if(t!==el)return!1;if(!eu)return dL(t),eu=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!fR(e,t.memoizedProps))for(e=bf;e;)OK(t,e),e=m0(e.nextSibling);if(dL(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(bt(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){bf=m0(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}bf=null}}else bf=el?m0(t.stateNode.nextSibling):null;return!0}function tO(){bf=el=null,eu=!1}var v0=[];function H8(){for(var t=0;t<v0.length;t++)v0[t]._workInProgressVersionPrimary=null;v0.length=0}var Pv=Fh.ReactCurrentDispatcher,Oo=Fh.ReactCurrentBatchConfig,ob=0,Ei=null,Is=null,ss=null,ME=!1,Tv=!1;function ca(){throw Error(bt(321))}function z8(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!xo(t[r],e[r]))return!1;return!0}function V8(t,e,r,n,i,s){if(ob=s,Ei=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Pv.current=t===null||t.memoizedState===null?Rle:Nle,t=r(n,i),Tv){s=0;do{if(Tv=!1,!(25>s))throw Error(bt(301));s+=1,ss=Is=null,e.updateQueue=null,Pv.current=Dle,t=r(n,i)}while(Tv)}if(Pv.current=UE,e=Is!==null&&Is.next!==null,ob=0,ss=Is=Ei=null,ME=!1,e)throw Error(bt(300));return t}function Kd(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ss===null?Ei.memoizedState=ss=t:ss=ss.next=t,ss}function Hh(){if(Is===null){var t=Ei.alternate;t=t!==null?t.memoizedState:null}else t=Is.next;var e=ss===null?Ei.memoizedState:ss.next;if(e!==null)ss=e,Is=t;else{if(t===null)throw Error(bt(310));Is=t,t={memoizedState:Is.memoizedState,baseState:Is.baseState,baseQueue:Is.baseQueue,queue:Is.queue,next:null},ss===null?Ei.memoizedState=ss=t:ss=ss.next=t}return ss}function Yc(t,e){return typeof e=="function"?e(t):e}function qm(t){var e=Hh(),r=e.queue;if(r===null)throw Error(bt(311));r.lastRenderedReducer=t;var n=Is,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}n.baseQueue=i=s,r.pending=null}if(i!==null){i=i.next,n=n.baseState;var o=a=s=null,c=i;do{var u=c.lane;if((ob&u)===u)o!==null&&(o=o.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),n=c.eagerReducer===t?c.eagerState:t(n,c.action);else{var f={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};o===null?(a=o=f,s=n):o=o.next=f,Ei.lanes|=u,l1|=u}c=c.next}while(c!==null&&c!==i);o===null?s=n:o.next=a,xo(n,e.memoizedState)||(mc=!0),e.memoizedState=n,e.baseState=s,e.baseQueue=o,r.lastRenderedState=n}return[e.memoizedState,r.dispatch]}function Hm(t){var e=Hh(),r=e.queue;if(r===null)throw Error(bt(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(i!==null){r.pending=null;var a=i=i.next;do s=t(s,a.action),a=a.next;while(a!==i);xo(s,e.memoizedState)||(mc=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function hL(t,e,r){var n=e._getVersion;n=n(e._source);var i=e._workInProgressVersionPrimary;if(i!==null?t=i===n:(t=t.mutableReadLanes,(t=(ob&t)===t)&&(e._workInProgressVersionPrimary=n,v0.push(e))),t)return r(e._source);throw v0.push(e),Error(bt(350))}function IK(t,e,r,n){var i=Js;if(i===null)throw Error(bt(349));var s=e._getVersion,a=s(e._source),o=Pv.current,c=o.useState(function(){return hL(i,e,r)}),u=c[1],f=c[0];c=ss;var h=t.memoizedState,m=h.refs,y=m.getSnapshot,w=h.source;h=h.subscribe;var v=Ei;return t.memoizedState={refs:m,source:e,subscribe:n},o.useEffect(function(){m.getSnapshot=r,m.setSnapshot=u;var g=s(e._source);if(!xo(a,g)){g=r(e._source),xo(f,g)||(u(g),g=Tf(v),i.mutableReadLanes|=g&i.pendingLanes),g=i.mutableReadLanes,i.entangledLanes|=g;for(var _=i.entanglements,b=g;0<b;){var S=31-$f(b),A=1<<S;_[S]|=g,b&=~A}}},[r,e,n]),o.useEffect(function(){return n(e._source,function(){var g=m.getSnapshot,_=m.setSnapshot;try{_(g(e._source));var b=Tf(v);i.mutableReadLanes|=b&i.pendingLanes}catch(S){_(function(){throw S})}})},[e,n]),xo(y,r)&&xo(w,e)&&xo(h,n)||(t={pending:null,dispatch:null,lastRenderedReducer:Yc,lastRenderedState:f},t.dispatch=u=W8.bind(null,Ei,t),c.queue=t,c.baseQueue=null,f=hL(i,e,r),c.memoizedState=c.baseState=f),f}function PK(t,e,r){var n=Hh();return IK(n,t,e,r)}function zm(t){var e=Kd();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t=e.queue={pending:null,dispatch:null,lastRenderedReducer:Yc,lastRenderedState:t},t=t.dispatch=W8.bind(null,Ei,t),[e.memoizedState,t]}function kE(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=Ei.updateQueue,e===null?(e={lastEffect:null},Ei.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function pL(t){var e=Kd();return t={current:t},e.memoizedState=t}function $E(){return Hh().memoizedState}function vR(t,e,r,n){var i=Kd();Ei.flags|=t,i.memoizedState=kE(1|e,r,void 0,n===void 0?null:n)}function G8(t,e,r,n){var i=Hh();n=n===void 0?null:n;var s=void 0;if(Is!==null){var a=Is.memoizedState;if(s=a.destroy,n!==null&&z8(n,a.deps)){kE(e,r,s,n);return}}Ei.flags|=t,i.memoizedState=kE(1|e,r,s,n)}function gL(t,e){return vR(516,4,t,e)}function LE(t,e){return G8(516,4,t,e)}function TK(t,e){return G8(4,2,t,e)}function CK(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function RK(t,e,r){return r=r!=null?r.concat([t]):null,G8(4,2,CK.bind(null,e,t),r)}function K8(){}function NK(t,e){var r=Hh();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&z8(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function DK(t,e){var r=Hh();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&z8(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function Cle(t,e){var r=Sg();Ph(98>r?98:r,function(){t(!0)}),Ph(97<r?97:r,function(){var n=Oo.transition;Oo.transition=1;try{t(!1),e()}finally{Oo.transition=n}})}function W8(t,e,r){var n=Ha(),i=Tf(t),s={lane:i,action:r,eagerReducer:null,eagerState:null,next:null},a=e.pending;if(a===null?s.next=s:(s.next=a.next,a.next=s),e.pending=s,a=t.alternate,t===Ei||a!==null&&a===Ei)Tv=ME=!0;else{if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,c=a(o,r);if(s.eagerReducer=a,s.eagerState=c,xo(c,o))return}catch{}finally{}Cf(t,i,n)}}var UE={readContext:Ro,useCallback:ca,useContext:ca,useEffect:ca,useImperativeHandle:ca,useLayoutEffect:ca,useMemo:ca,useReducer:ca,useRef:ca,useState:ca,useDebugValue:ca,useDeferredValue:ca,useTransition:ca,useMutableSource:ca,useOpaqueIdentifier:ca,unstable_isNewReconciler:!1},Rle={readContext:Ro,useCallback:function(t,e){return Kd().memoizedState=[t,e===void 0?null:e],t},useContext:Ro,useEffect:gL,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,vR(4,2,CK.bind(null,e,t),r)},useLayoutEffect:function(t,e){return vR(4,2,t,e)},useMemo:function(t,e){var r=Kd();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Kd();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t=n.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},t=t.dispatch=W8.bind(null,Ei,t),[n.memoizedState,t]},useRef:pL,useState:zm,useDebugValue:K8,useDeferredValue:function(t){var e=zm(t),r=e[0],n=e[1];return gL(function(){var i=Oo.transition;Oo.transition=1;try{n(t)}finally{Oo.transition=i}},[t]),r},useTransition:function(){var t=zm(!1),e=t[0];return t=Cle.bind(null,t[1]),pL(t),[t,e]},useMutableSource:function(t,e,r){var n=Kd();return n.memoizedState={refs:{getSnapshot:e,setSnapshot:null},source:t,subscribe:r},IK(n,t,e,r)},useOpaqueIdentifier:function(){if(eu){var t=!1,e=Ale(function(){throw t||(t=!0,r("r:"+(XS++).toString(36))),Error(bt(355))}),r=zm(e)[1];return!(Ei.mode&2)&&(Ei.flags|=516,kE(5,function(){r("r:"+(XS++).toString(36))},void 0,null)),e}return e="r:"+(XS++).toString(36),zm(e),e},unstable_isNewReconciler:!1},Nle={readContext:Ro,useCallback:NK,useContext:Ro,useEffect:LE,useImperativeHandle:RK,useLayoutEffect:TK,useMemo:DK,useReducer:qm,useRef:$E,useState:function(){return qm(Yc)},useDebugValue:K8,useDeferredValue:function(t){var e=qm(Yc),r=e[0],n=e[1];return LE(function(){var i=Oo.transition;Oo.transition=1;try{n(t)}finally{Oo.transition=i}},[t]),r},useTransition:function(){var t=qm(Yc)[0];return[$E().current,t]},useMutableSource:PK,useOpaqueIdentifier:function(){return qm(Yc)[0]},unstable_isNewReconciler:!1},Dle={readContext:Ro,useCallback:NK,useContext:Ro,useEffect:LE,useImperativeHandle:RK,useLayoutEffect:TK,useMemo:DK,useReducer:Hm,useRef:$E,useState:function(){return Hm(Yc)},useDebugValue:K8,useDeferredValue:function(t){var e=Hm(Yc),r=e[0],n=e[1];return LE(function(){var i=Oo.transition;Oo.transition=1;try{n(t)}finally{Oo.transition=i}},[t]),r},useTransition:function(){var t=Hm(Yc)[0];return[$E().current,t]},useMutableSource:PK,useOpaqueIdentifier:function(){return Hm(Yc)[0]},unstable_isNewReconciler:!1},Mle=Fh.ReactCurrentOwner,mc=!1;function pa(t,e,r,n){e.child=t===null?SK(e,null,r,n):NE(e,t.child,r,n)}function mL(t,e,r,n,i){r=r.render;var s=e.ref;return y0(e,i),n=V8(t,e,r,n,s,i),t!==null&&!mc?(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,tl(t,e,i)):(e.flags|=1,pa(t,e,n,i),e.child)}function yL(t,e,r,n,i,s){if(t===null){var a=r.type;return typeof a=="function"&&!e5(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=a,MK(t,e,a,n,i,s)):(t=F_(r.type,null,n,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}return a=t.child,!(i&s)&&(i=a.memoizedProps,r=r.compare,r=r!==null?r:tb,r(i,n)&&t.ref===e.ref)?tl(t,e,s):(e.flags|=1,t=jf(a,n),t.ref=e.ref,t.return=e,e.child=t)}function MK(t,e,r,n,i,s){if(t!==null&&tb(t.memoizedProps,n)&&t.ref===e.ref)if(mc=!1,(s&i)!==0)t.flags&16384&&(mc=!0);else return e.lanes=t.lanes,tl(t,e,s);return bR(t,e,r,n,s)}function rO(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden"||n.mode==="unstable-defer-without-hiding")if(!(e.mode&4))e.memoizedState={baseLanes:0},Uw(e,r);else if(r&1073741824)e.memoizedState={baseLanes:0},Uw(e,s!==null?s.baseLanes:r);else return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t},Uw(e,t),null;else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,Uw(e,n);return pa(t,e,i,r),e.child}function kK(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=128)}function bR(t,e,r,n,i){var s=Ea(r)?Ih:$s.current;return s=Ag(e,s),y0(e,i),r=V8(t,e,r,n,s,i),t!==null&&!mc?(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,tl(t,e,i)):(e.flags|=1,pa(t,e,r,i),e.child)}function vL(t,e,r,n,i){if(Ea(r)){var s=!0;$_(e)}else s=!1;if(y0(e,i),e.stateNode===null)t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),xK(e,r,n),gR(e,r,n,i),n=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var c=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=Ro(u):(u=Ea(r)?Ih:$s.current,u=Ag(e,u));var f=r.getDerivedStateFromProps,h=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==n||c!==u)&&uL(e,a,n,u),Ql=!1;var m=e.memoizedState;a.state=m,ib(e,n,a,i),c=e.memoizedState,o!==n||m!==c||_a.current||Ql?(typeof f=="function"&&(RE(e,r,f,n),c=e.memoizedState),(o=Ql||cL(e,r,o,n,m,c,u))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4)):(typeof a.componentDidMount=="function"&&(e.flags|=4),e.memoizedProps=n,e.memoizedState=c),a.props=n,a.state=c,a.context=u,n=o):(typeof a.componentDidMount=="function"&&(e.flags|=4),n=!1)}else{a=e.stateNode,_K(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:tc(e.type,o),a.props=u,h=e.pendingProps,m=a.context,c=r.contextType,typeof c=="object"&&c!==null?c=Ro(c):(c=Ea(r)?Ih:$s.current,c=Ag(e,c));var y=r.getDerivedStateFromProps;(f=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==h||m!==c)&&uL(e,a,n,c),Ql=!1,m=e.memoizedState,a.state=m,ib(e,n,a,i);var w=e.memoizedState;o!==h||m!==w||_a.current||Ql?(typeof y=="function"&&(RE(e,r,y,n),w=e.memoizedState),(u=Ql||cL(e,r,u,n,m,w,c))?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,w,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,w,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=256)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&m===t.memoizedState||(e.flags|=256),e.memoizedProps=n,e.memoizedState=w),a.props=n,a.state=w,a.context=c,n=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&m===t.memoizedState||(e.flags|=256),n=!1)}return wR(t,e,r,n,s,i)}function wR(t,e,r,n,i,s){kK(t,e);var a=(e.flags&64)!==0;if(!n&&!a)return i&&nL(e,r,!1),tl(t,e,s);n=e.stateNode,Mle.current=e;var o=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&a?(e.child=NE(e,t.child,null,s),e.child=NE(e,null,o,s)):pa(t,e,o,s),e.memoizedState=n.state,i&&nL(e,r,!0),e.child}function bL(t){var e=t.stateNode;e.pendingContext?rL(t,e.pendingContext,e.pendingContext!==e.context):e.context&&rL(t,e.context,!1),mR(t,e.containerInfo)}var Lw={dehydrated:null,retryLane:0};function wL(t,e,r){var n=e.pendingProps,i=fi.current,s=!1,a;return(a=(e.flags&64)!==0)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-65):t!==null&&t.memoizedState===null||n.fallback===void 0||n.unstable_avoidThisFallback===!0||(i|=1),di(fi,i&1),t===null?(n.fallback!==void 0&&yR(e),t=n.children,i=n.fallback,s?(t=_L(e,t,i,r),e.child.memoizedState={baseLanes:r},e.memoizedState=Lw,t):typeof n.unstable_expectedLoadTime=="number"?(t=_L(e,t,i,r),e.child.memoizedState={baseLanes:r},e.memoizedState=Lw,e.lanes=33554432,t):(r=t5({mode:"visible",children:t},e.mode,r,null),r.return=e,e.child=r)):t.memoizedState!==null?s?(n=xL(t,e,n.children,n.fallback,r),s=e.child,i=t.child.memoizedState,s.memoizedState=i===null?{baseLanes:r}:{baseLanes:i.baseLanes|r},s.childLanes=t.childLanes&~r,e.memoizedState=Lw,n):(r=EL(t,e,n.children,r),e.memoizedState=null,r):s?(n=xL(t,e,n.children,n.fallback,r),s=e.child,i=t.child.memoizedState,s.memoizedState=i===null?{baseLanes:r}:{baseLanes:i.baseLanes|r},s.childLanes=t.childLanes&~r,e.memoizedState=Lw,n):(r=EL(t,e,n.children,r),e.memoizedState=null,r)}function _L(t,e,r,n){var i=t.mode,s=t.child;return e={mode:"hidden",children:e},!(i&2)&&s!==null?(s.childLanes=0,s.pendingProps=e):s=t5(e,i,0,null),r=_0(r,i,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,r}function EL(t,e,r,n){var i=t.child;return t=i.sibling,r=jf(i,{mode:"visible",children:r}),!(e.mode&2)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(t.nextEffect=null,t.flags=8,e.firstEffect=e.lastEffect=t),e.child=r}function xL(t,e,r,n,i){var s=e.mode,a=t.child;t=a.sibling;var o={mode:"hidden",children:r};return!(s&2)&&e.child!==a?(r=e.child,r.childLanes=0,r.pendingProps=o,a=r.lastEffect,a!==null?(e.firstEffect=r.firstEffect,e.lastEffect=a,a.nextEffect=null):e.firstEffect=e.lastEffect=null):r=jf(a,o),t!==null?n=jf(t,n):(n=_0(n,s,i,null),n.flags|=2),n.return=e,r.return=e,r.sibling=n,e.child=r,n}function AL(t,e){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),wK(t.return,e)}function nO(t,e,r,n,i,s){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i,lastEffect:s}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i,a.lastEffect=s)}function SL(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(pa(t,e,n.children,r),n=fi.current,n&2)n=n&1|2,e.flags|=64;else{if(t!==null&&t.flags&64)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&AL(t,r);else if(t.tag===19)AL(t,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(di(fi,n),!(e.mode&2))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&DE(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),nO(e,!1,i,r,s,e.lastEffect);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&DE(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}nO(e,!0,r,null,s,e.lastEffect);break;case"together":nO(e,!1,null,null,void 0,e.lastEffect);break;default:e.memoizedState=null}return e.child}function tl(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),l1|=e.lanes,r&e.childLanes){if(t!==null&&e.child!==t.child)throw Error(bt(153));if(e.child!==null){for(t=e.child,r=jf(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=jf(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}return null}var $K,_R,LK,UK;$K=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};_R=function(){};LK=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Gd(Zc.current);var s=null;switch(r){case"input":i=WC(t,i),n=WC(t,n),s=[];break;case"option":i=JC(t,i),n=JC(t,n),s=[];break;case"select":i=ei({},i,{value:void 0}),n=ei({},n,{value:void 0}),s=[];break;case"textarea":i=XC(t,i),n=XC(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=SE)}tR(r,n);var a;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Wv.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var c=n[u];if(o=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(r||(r={}),r[a]=c[a])}else r||(s||(s=[]),s.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Wv.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Vn("scroll",t),s||o===c||(s=[])):typeof c=="object"&&c!==null&&c.$$typeof===_8?c.toString():(s=s||[]).push(u,c))}r&&(s=s||[]).push("style",r);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};UK=function(t,e,r,n){r!==n&&(e.flags|=4)};function Vm(t,e){if(!eu)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function kle(t,e,r){var n=e.pendingProps;switch(e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Ea(e.type)&&IE(),null;case 3:return Og(),Yn(_a),Yn($s),H8(),n=e.stateNode,n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&($w(e)?e.flags|=4:n.hydrate||(e.flags|=256)),_R(e),null;case 5:q8(e);var i=Gd(ab.current);if(r=e.type,t!==null&&e.stateNode!=null)LK(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=128);else{if(!n){if(e.stateNode===null)throw Error(bt(166));return null}if(t=Gd(Zc.current),$w(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[vf]=e,n[OE]=s,r){case"dialog":Vn("cancel",n),Vn("close",n);break;case"iframe":case"object":case"embed":Vn("load",n);break;case"video":case"audio":for(t=0;t<tv.length;t++)Vn(tv[t],n);break;case"source":Vn("error",n);break;case"img":case"image":case"link":Vn("error",n),Vn("load",n);break;case"details":Vn("toggle",n);break;case"input":S$(n,s),Vn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},Vn("invalid",n);break;case"textarea":I$(n,s),Vn("invalid",n)}tR(r,s),t=null;for(var a in s)s.hasOwnProperty(a)&&(i=s[a],a==="children"?typeof i=="string"?n.textContent!==i&&(t=["children",i]):typeof i=="number"&&n.textContent!==""+i&&(t=["children",""+i]):Wv.hasOwnProperty(a)&&i!=null&&a==="onScroll"&&Vn("scroll",n));switch(r){case"input":Cw(n),O$(n,s,!0);break;case"textarea":Cw(n),P$(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=SE)}n=t,e.updateQueue=n,n!==null&&(e.flags|=4)}else{switch(a=i.nodeType===9?i:i.ownerDocument,t===ZC.html&&(t=RG(r)),t===ZC.html?r==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[vf]=e,t[OE]=n,$K(t,e,!1,!1),e.stateNode=t,a=rR(r,n),r){case"dialog":Vn("cancel",t),Vn("close",t),i=n;break;case"iframe":case"object":case"embed":Vn("load",t),i=n;break;case"video":case"audio":for(i=0;i<tv.length;i++)Vn(tv[i],t);i=n;break;case"source":Vn("error",t),i=n;break;case"img":case"image":case"link":Vn("error",t),Vn("load",t),i=n;break;case"details":Vn("toggle",t),i=n;break;case"input":S$(t,n),i=WC(t,n),Vn("invalid",t);break;case"option":i=JC(t,n);break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=ei({},n,{value:void 0}),Vn("invalid",t);break;case"textarea":I$(t,n),i=XC(t,n),Vn("invalid",t);break;default:i=n}tR(r,i);var o=i;for(s in o)if(o.hasOwnProperty(s)){var c=o[s];s==="style"?MG(t,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&NG(t,c)):s==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Yv(t,c):typeof c=="number"&&Yv(t,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Wv.hasOwnProperty(s)?c!=null&&s==="onScroll"&&Vn("scroll",t):c!=null&&g8(t,s,c,a))}switch(r){case"input":Cw(t),O$(t,n,!1);break;case"textarea":Cw(t),P$(t);break;case"option":n.value!=null&&t.setAttribute("value",""+kf(n.value));break;case"select":t.multiple=!!n.multiple,s=n.value,s!=null?h0(t,!!n.multiple,s,!1):n.defaultValue!=null&&h0(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=SE)}fK(r,n)&&(e.flags|=4)}e.ref!==null&&(e.flags|=128)}return null;case 6:if(t&&e.stateNode!=null)UK(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(bt(166));r=Gd(ab.current),Gd(Zc.current),$w(e)?(n=e.stateNode,r=e.memoizedProps,n[vf]=e,n.nodeValue!==r&&(e.flags|=4)):(n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[vf]=e,e.stateNode=n)}return null;case 13:return Yn(fi),n=e.memoizedState,e.flags&64?(e.lanes=r,e):(n=n!==null,r=!1,t===null?e.memoizedProps.fallback!==void 0&&$w(e):r=t.memoizedState!==null,n&&!r&&e.mode&2&&(t===null&&e.memoizedProps.unstable_avoidThisFallback!==!0||fi.current&1?cs===0&&(cs=3):((cs===0||cs===3)&&(cs=4),Js===null||!(l1&134217727)&&!(Zg&134217727)||b0(Js,Ms))),(n||r)&&(e.flags|=4),null);case 4:return Og(),_R(e),t===null&&cK(e.stateNode.containerInfo),null;case 10:return B8(e),null;case 17:return Ea(e.type)&&IE(),null;case 19:if(Yn(fi),n=e.memoizedState,n===null)return null;if(s=(e.flags&64)!==0,a=n.rendering,a===null)if(s)Vm(n,!1);else{if(cs!==0||t!==null&&t.flags&64)for(t=e.child;t!==null;){if(a=DE(t),a!==null){for(e.flags|=64,Vm(n,!1),s=a.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),n.lastEffect===null&&(e.firstEffect=null),e.lastEffect=n.lastEffect,n=r,r=e.child;r!==null;)s=r,t=n,s.flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,a=s.alternate,a===null?(s.childLanes=0,s.lanes=t,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,t=a.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return di(fi,fi.current&1|2),e.child}t=t.sibling}n.tail!==null&&Ds()>IR&&(e.flags|=64,s=!0,Vm(n,!1),e.lanes=33554432)}else{if(!s)if(t=DE(a),t!==null){if(e.flags|=64,s=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Vm(n,!0),n.tail===null&&n.tailMode==="hidden"&&!a.alternate&&!eu)return e=e.lastEffect=n.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ds()-n.renderingStartTime>IR&&r!==1073741824&&(e.flags|=64,s=!0,Vm(n,!1),e.lanes=33554432);n.isBackwards?(a.sibling=e.child,e.child=a):(r=n.last,r!==null?r.sibling=a:e.child=a,n.last=a)}return n.tail!==null?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=e.lastEffect,n.renderingStartTime=Ds(),r.sibling=null,e=fi.current,di(fi,s?e&1|2:e&1),r):null;case 23:case 24:return Z8(),t!==null&&t.memoizedState!==null!=(e.memoizedState!==null)&&n.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(bt(156,e.tag))}function $le(t){switch(t.tag){case 1:Ea(t.type)&&IE();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(Og(),Yn(_a),Yn($s),H8(),e=t.flags,e&64)throw Error(bt(285));return t.flags=e&-4097|64,t;case 5:return q8(t),null;case 13:return Yn(fi),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return Yn(fi),null;case 4:return Og(),null;case 10:return B8(t),null;case 23:case 24:return Z8(),null;default:return null}}function Y8(t,e){try{var r="",n=e;do r+=mue(n),n=n.return;while(n);var i=r}catch(s){i=`
38
- Error generating stack: `+s.message+`
39
- `+s.stack}return{value:t,source:e,stack:i}}function ER(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Lle=typeof WeakMap=="function"?WeakMap:Map;function jK(t,e,r){r=If(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){BE||(BE=!0,PR=n),ER(t,e)},r}function BK(t,e,r){r=If(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return ER(t,e),n(i)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){typeof n!="function"&&(Qc===null?Qc=new Set([this]):Qc.add(this),ER(t,e));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),r}var Ule=typeof WeakSet=="function"?WeakSet:Set;function OL(t){var e=t.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(r){Rf(t,r)}else e.current=null}function jle(t,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(e.flags&256&&t!==null){var r=t.memoizedProps,n=t.memoizedState;t=e.stateNode,e=t.getSnapshotBeforeUpdate(e.elementType===e.type?r:tc(e.type,r),n),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&$8(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(bt(163))}function Ble(t,e,r){switch(r.tag){case 0:case 11:case 15:case 22:if(e=r.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{if((t.tag&3)===3){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}if(e=r.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{var i=t;n=i.next,i=i.tag,i&4&&i&1&&(YK(r,t),Wle(r,t)),t=n}while(t!==e)}return;case 1:t=r.stateNode,r.flags&4&&(e===null?t.componentDidMount():(n=r.elementType===r.type?e.memoizedProps:tc(r.type,e.memoizedProps),t.componentDidUpdate(n,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),e=r.updateQueue,e!==null&&oL(r,e,t);return;case 3:if(e=r.updateQueue,e!==null){if(t=null,r.child!==null)switch(r.child.tag){case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}oL(r,e,t)}return;case 5:t=r.stateNode,e===null&&r.flags&4&&fK(r.type,r.memoizedProps)&&t.focus();return;case 6:return;case 4:return;case 12:return;case 13:r.memoizedState===null&&(r=r.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&zG(r))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(bt(163))}function IL(t,e){for(var r=t;;){if(r.tag===5){var n=r.stateNode;if(e)n=n.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var i=r.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,n.style.display=DG("display",i)}}else if(r.tag===6)r.stateNode.nodeValue=e?"":r.memoizedProps;else if((r.tag!==23&&r.tag!==24||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function PL(t,e){if(_h&&typeof _h.onCommitFiberUnmount=="function")try{_h.onCommitFiberUnmount(L8,e)}catch{}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(t=e.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var r=t=t.next;do{var n=r,i=n.destroy;if(n=n.tag,i!==void 0)if(n&4)YK(e,r);else{n=e;try{i()}catch(s){Rf(n,s)}}r=r.next}while(r!==t)}break;case 1:if(OL(e),t=e.stateNode,typeof t.componentWillUnmount=="function")try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(s){Rf(e,s)}break;case 5:OL(e);break;case 4:FK(t,e)}}function TL(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function CL(t){return t.tag===5||t.tag===3||t.tag===4}function RL(t){e:{for(var e=t.return;e!==null;){if(CL(e))break e;e=e.return}throw Error(bt(160))}var r=e;switch(e=r.stateNode,r.tag){case 5:var n=!1;break;case 3:e=e.containerInfo,n=!0;break;case 4:e=e.containerInfo,n=!0;break;default:throw Error(bt(161))}r.flags&16&&(Yv(e,""),r.flags&=-17);e:t:for(r=t;;){for(;r.sibling===null;){if(r.return===null||CL(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2)){r=r.stateNode;break e}}n?xR(t,r,e):AR(t,r,e)}function xR(t,e,r){var n=t.tag,i=n===5||n===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=SE));else if(n!==4&&(t=t.child,t!==null))for(xR(t,e,r),t=t.sibling;t!==null;)xR(t,e,r),t=t.sibling}function AR(t,e,r){var n=t.tag,i=n===5||n===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(AR(t,e,r),t=t.sibling;t!==null;)AR(t,e,r),t=t.sibling}function FK(t,e){for(var r=e,n=!1,i,s;;){if(!n){n=r.return;e:for(;;){if(n===null)throw Error(bt(160));switch(i=n.stateNode,n.tag){case 5:s=!1;break e;case 3:i=i.containerInfo,s=!0;break e;case 4:i=i.containerInfo,s=!0;break e}n=n.return}n=!0}if(r.tag===5||r.tag===6){e:for(var a=t,o=r,c=o;;)if(PL(a,c),c.child!==null&&c.tag!==4)c.child.return=c,c=c.child;else{if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}s?(a=i,o=r.stateNode,a.nodeType===8?a.parentNode.removeChild(o):a.removeChild(o)):i.removeChild(r.stateNode)}else if(r.tag===4){if(r.child!==null){i=r.stateNode.containerInfo,s=!0,r.child.return=r,r=r.child;continue}}else if(PL(t,r),r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return,r.tag===4&&(n=!1)}r.sibling.return=r.return,r=r.sibling}}function iO(t,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do(n.tag&3)===3&&(t=n.destroy,n.destroy=void 0,t!==void 0&&t()),n=n.next;while(n!==r)}return;case 1:return;case 5:if(r=e.stateNode,r!=null){n=e.memoizedProps;var i=t!==null?t.memoizedProps:n;t=e.type;var s=e.updateQueue;if(e.updateQueue=null,s!==null){for(r[OE]=n,t==="input"&&n.type==="radio"&&n.name!=null&&TG(r,n),rR(t,i),e=rR(t,n),i=0;i<s.length;i+=2){var a=s[i],o=s[i+1];a==="style"?MG(r,o):a==="dangerouslySetInnerHTML"?NG(r,o):a==="children"?Yv(r,o):g8(r,a,o,e)}switch(t){case"input":YC(r,n);break;case"textarea":CG(r,n);break;case"select":t=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,s=n.value,s!=null?h0(r,!!n.multiple,s,!1):t!==!!n.multiple&&(n.defaultValue!=null?h0(r,!!n.multiple,n.defaultValue,!0):h0(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(e.stateNode===null)throw Error(bt(162));e.stateNode.nodeValue=e.memoizedProps;return;case 3:r=e.stateNode,r.hydrate&&(r.hydrate=!1,zG(r.containerInfo));return;case 12:return;case 13:e.memoizedState!==null&&(X8=Ds(),IL(e.child,!0)),NL(e);return;case 19:NL(e);return;case 17:return;case 23:case 24:IL(e,e.memoizedState!==null);return}throw Error(bt(163))}function NL(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Ule),e.forEach(function(n){var i=Jle.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Fle(t,e){return t!==null&&(t=t.memoizedState,t===null||t.dehydrated!==null)?(e=e.memoizedState,e!==null&&e.dehydrated===null):!1}var qle=Math.ceil,jE=Fh.ReactCurrentDispatcher,Q8=Fh.ReactCurrentOwner,Ar=0,Js=null,Ui=null,Ms=0,Th=0,SR=zf(0),cs=0,Wx=null,Xg=0,l1=0,Zg=0,J8=0,OR=null,X8=0,IR=1/0;function em(){IR=Ds()+500}var qt=null,BE=!1,PR=null,Qc=null,Uf=!1,Cv=null,rv=90,TR=[],CR=[],il=null,Rv=0,RR=null,U_=-1,Xu=0,j_=0,Nv=null,B_=!1;function Ha(){return Ar&48?Ds():U_!==-1?U_:U_=Ds()}function Tf(t){if(t=t.mode,!(t&2))return 1;if(!(t&4))return Sg()===99?1:2;if(Xu===0&&(Xu=Xg),Tle.transition!==0){j_!==0&&(j_=OR!==null?OR.pendingLanes:0),t=Xu;var e=4186112&~j_;return e&=-e,e===0&&(t=4186112&~t,e=t&-t,e===0&&(e=8192)),e}return t=Sg(),Ar&4&&t===98?t=xE(12,Xu):(t=Nue(t),t=xE(t,Xu)),t}function Cf(t,e,r){if(50<Rv)throw Rv=0,RR=null,Error(bt(185));if(t=Yx(t,e),t===null)return null;Fx(t,e,r),t===Js&&(Zg|=e,cs===4&&b0(t,Ms));var n=Sg();e===1?Ar&8&&!(Ar&48)?NR(t):(No(t,r),Ar===0&&(em(),uu())):(!(Ar&4)||n!==98&&n!==99||(il===null?il=new Set([t]):il.add(t)),No(t,r)),OR=t}function Yx(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}function No(t,e){for(var r=t.callbackNode,n=t.suspendedLanes,i=t.pingedLanes,s=t.expirationTimes,a=t.pendingLanes;0<a;){var o=31-$f(a),c=1<<o,u=s[o];if(u===-1){if(!(c&n)||c&i){u=e,Up(c);var f=jn;s[o]=10<=f?u+250:6<=f?u+5e3:-1}}else u<=e&&(t.expiredLanes|=c);a&=~c}if(n=Zv(t,t===Js?Ms:0),e=jn,n===0)r!==null&&(r!==ZS&&hR(r),t.callbackNode=null,t.callbackPriority=0);else{if(r!==null){if(t.callbackPriority===e)return;r!==ZS&&hR(r)}e===15?(r=NR.bind(null,t),$u===null?($u=[r],L_=U8(Gx,bK)):$u.push(r),r=ZS):e===14?r=nb(99,NR.bind(null,t)):(r=Due(e),r=nb(r,qK.bind(null,t))),t.callbackPriority=e,t.callbackNode=r}}function qK(t){if(U_=-1,j_=Xu=0,Ar&48)throw Error(bt(327));var e=t.callbackNode;if(Vf()&&t.callbackNode!==e)return null;var r=Zv(t,t===Js?Ms:0);if(r===0)return null;var n=r,i=Ar;Ar|=16;var s=GK();(Js!==t||Ms!==n)&&(em(),w0(t,n));do try{Vle();break}catch(o){VK(t,o)}while(1);if(j8(),jE.current=s,Ar=i,Ui!==null?n=0:(Js=null,Ms=0,n=cs),Xg&Zg)w0(t,0);else if(n!==0){if(n===2&&(Ar|=64,t.hydrate&&(t.hydrate=!1,$8(t.containerInfo)),r=JG(t),r!==0&&(n=nv(t,r))),n===1)throw e=Wx,w0(t,0),b0(t,r),No(t,Ds()),e;switch(t.finishedWork=t.current.alternate,t.finishedLanes=r,n){case 0:case 1:throw Error(bt(345));case 2:Md(t);break;case 3:if(b0(t,r),(r&62914560)===r&&(n=X8+500-Ds(),10<n)){if(Zv(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Ha(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Z$(Md.bind(null,t),n);break}Md(t);break;case 4:if(b0(t,r),(r&4186112)===r)break;for(n=t.eventTimes,i=-1;0<r;){var a=31-$f(r);s=1<<a,a=n[a],a>i&&(i=a),r&=~s}if(r=i,r=Ds()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qle(r/1960))-r,10<r){t.timeoutHandle=Z$(Md.bind(null,t),r);break}Md(t);break;case 5:Md(t);break;default:throw Error(bt(329))}}return No(t,Ds()),t.callbackNode===e?qK.bind(null,t):null}function b0(t,e){for(e&=~J8,e&=~Zg,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-$f(e),n=1<<r;t[r]=-1,e&=~n}}function NR(t){if(Ar&48)throw Error(bt(327));if(Vf(),t===Js&&t.expiredLanes&Ms){var e=Ms,r=nv(t,e);Xg&Zg&&(e=Zv(t,e),r=nv(t,e))}else e=Zv(t,0),r=nv(t,e);if(t.tag!==0&&r===2&&(Ar|=64,t.hydrate&&(t.hydrate=!1,$8(t.containerInfo)),e=JG(t),e!==0&&(r=nv(t,e))),r===1)throw r=Wx,w0(t,0),b0(t,e),No(t,Ds()),r;return t.finishedWork=t.current.alternate,t.finishedLanes=e,Md(t),No(t,Ds()),null}function Hle(){if(il!==null){var t=il;il=null,t.forEach(function(e){e.expiredLanes|=24&e.pendingLanes,No(e,Ds())})}uu()}function HK(t,e){var r=Ar;Ar|=1;try{return t(e)}finally{Ar=r,Ar===0&&(em(),uu())}}function zK(t,e){var r=Ar;Ar&=-2,Ar|=8;try{return t(e)}finally{Ar=r,Ar===0&&(em(),uu())}}function Uw(t,e){di(SR,Th),Th|=e,Xg|=e}function Z8(){Th=SR.current,Yn(SR)}function w0(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,xle(r)),Ui!==null)for(r=Ui.return;r!==null;){var n=r;switch(n.tag){case 1:n=n.type.childContextTypes,n!=null&&IE();break;case 3:Og(),Yn(_a),Yn($s),H8();break;case 5:q8(n);break;case 4:Og();break;case 13:Yn(fi);break;case 19:Yn(fi);break;case 10:B8(n);break;case 23:case 24:Z8()}r=r.return}Js=t,Ui=jf(t.current,null),Ms=Th=Xg=e,cs=0,Wx=null,J8=Zg=l1=0}function VK(t,e){do{var r=Ui;try{if(j8(),Pv.current=UE,ME){for(var n=Ei.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}ME=!1}if(ob=0,ss=Is=Ei=null,Tv=!1,Q8.current=null,r===null||r.return===null){cs=1,Wx=e,Ui=null;break}e:{var s=t,a=r.return,o=r,c=e;if(e=Ms,o.flags|=2048,o.firstEffect=o.lastEffect=null,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c;if(!(o.mode&2)){var f=o.alternate;f?(o.updateQueue=f.updateQueue,o.memoizedState=f.memoizedState,o.lanes=f.lanes):(o.updateQueue=null,o.memoizedState=null)}var h=(fi.current&1)!==0,m=a;do{var y;if(y=m.tag===13){var w=m.memoizedState;if(w!==null)y=w.dehydrated!==null;else{var v=m.memoizedProps;y=v.fallback===void 0?!1:v.unstable_avoidThisFallback!==!0?!0:!h}}if(y){var g=m.updateQueue;if(g===null){var _=new Set;_.add(u),m.updateQueue=_}else g.add(u);if(!(m.mode&2)){if(m.flags|=64,o.flags|=16384,o.flags&=-2981,o.tag===1)if(o.alternate===null)o.tag=17;else{var b=If(-1,1);b.tag=2,Pf(o,b)}o.lanes|=1;break e}c=void 0,o=e;var S=s.pingCache;if(S===null?(S=s.pingCache=new Lle,c=new Set,S.set(u,c)):(c=S.get(u),c===void 0&&(c=new Set,S.set(u,c))),!c.has(o)){c.add(o);var A=Qle.bind(null,s,u,o);u.then(A,A)}m.flags|=4096,m.lanes=e;break e}m=m.return}while(m!==null);c=Error((d0(o.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
40
-
41
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}cs!==5&&(cs=2),c=Y8(c,o),m=a;do{switch(m.tag){case 3:s=c,m.flags|=4096,e&=-e,m.lanes|=e;var O=jK(m,s,e);aL(m,O);break e;case 1:s=c;var E=m.type,p=m.stateNode;if(!(m.flags&64)&&(typeof E.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Qc===null||!Qc.has(p)))){m.flags|=4096,e&=-e,m.lanes|=e;var I=BK(m,s,e);aL(m,I);break e}}m=m.return}while(m!==null)}WK(r)}catch(N){e=N,Ui===r&&r!==null&&(Ui=r=r.return);continue}break}while(1)}function GK(){var t=jE.current;return jE.current=UE,t===null?UE:t}function nv(t,e){var r=Ar;Ar|=16;var n=GK();Js===t&&Ms===e||w0(t,e);do try{zle();break}catch(i){VK(t,i)}while(1);if(j8(),Ar=r,jE.current=n,Ui!==null)throw Error(bt(261));return Js=null,Ms=0,cs}function zle(){for(;Ui!==null;)KK(Ui)}function Vle(){for(;Ui!==null&&!Ole();)KK(Ui)}function KK(t){var e=QK(t.alternate,t,Th);t.memoizedProps=t.pendingProps,e===null?WK(t):Ui=e,Q8.current=null}function WK(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&2048){if(r=$le(e),r!==null){r.flags&=2047,Ui=r;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(r=kle(r,e,Th),r!==null){Ui=r;return}if(r=e,r.tag!==24&&r.tag!==23||r.memoizedState===null||Th&1073741824||!(r.mode&4)){for(var n=0,i=r.child;i!==null;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}t!==null&&!(t.flags&2048)&&(t.firstEffect===null&&(t.firstEffect=e.firstEffect),e.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1<e.flags&&(t.lastEffect!==null?t.lastEffect.nextEffect=e:t.firstEffect=e,t.lastEffect=e))}if(e=e.sibling,e!==null){Ui=e;return}Ui=e=t}while(e!==null);cs===0&&(cs=5)}function Md(t){var e=Sg();return Ph(99,Gle.bind(null,t,e)),null}function Gle(t,e){do Vf();while(Cv!==null);if(Ar&48)throw Error(bt(327));var r=t.finishedWork;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(bt(177));t.callbackNode=null;var n=r.lanes|r.childLanes,i=n,s=t.pendingLanes&~i;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=i,t.mutableReadLanes&=i,t.entangledLanes&=i,i=t.entanglements;for(var a=t.eventTimes,o=t.expirationTimes;0<s;){var c=31-$f(s),u=1<<c;i[c]=0,a[c]=-1,o[c]=-1,s&=~u}if(il!==null&&!(n&24)&&il.has(t)&&il.delete(t),t===Js&&(Ui=Js=null,Ms=0),1<r.flags?r.lastEffect!==null?(r.lastEffect.nextEffect=r,n=r.firstEffect):n=r:n=r.firstEffect,n!==null){if(i=Ar,Ar|=32,Q8.current=null,QS=D_,a=G$(),cR(a)){if("selectionStart"in a)o={start:a.selectionStart,end:a.selectionEnd};else e:if(o=(o=a.ownerDocument)&&o.defaultView||window,(u=o.getSelection&&o.getSelection())&&u.rangeCount!==0){o=u.anchorNode,s=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{o.nodeType,c.nodeType}catch{o=null;break e}var f=0,h=-1,m=-1,y=0,w=0,v=a,g=null;t:for(;;){for(var _;v!==o||s!==0&&v.nodeType!==3||(h=f+s),v!==c||u!==0&&v.nodeType!==3||(m=f+u),v.nodeType===3&&(f+=v.nodeValue.length),(_=v.firstChild)!==null;)g=v,v=_;for(;;){if(v===a)break t;if(g===o&&++y===s&&(h=f),g===c&&++w===u&&(m=f),(_=v.nextSibling)!==null)break;v=g,g=v.parentNode}v=_}o=h===-1||m===-1?null:{start:h,end:m}}else o=null;o=o||{start:0,end:0}}else o=null;JS={focusedElem:a,selectionRange:o},D_=!1,Nv=null,B_=!1,qt=n;do try{Kle()}catch(N){if(qt===null)throw Error(bt(330));Rf(qt,N),qt=qt.nextEffect}while(qt!==null);Nv=null,qt=n;do try{for(a=t;qt!==null;){var b=qt.flags;if(b&16&&Yv(qt.stateNode,""),b&128){var S=qt.alternate;if(S!==null){var A=S.ref;A!==null&&(typeof A=="function"?A(null):A.current=null)}}switch(b&1038){case 2:RL(qt),qt.flags&=-3;break;case 6:RL(qt),qt.flags&=-3,iO(qt.alternate,qt);break;case 1024:qt.flags&=-1025;break;case 1028:qt.flags&=-1025,iO(qt.alternate,qt);break;case 4:iO(qt.alternate,qt);break;case 8:o=qt,FK(a,o);var O=o.alternate;TL(o),O!==null&&TL(O)}qt=qt.nextEffect}}catch(N){if(qt===null)throw Error(bt(330));Rf(qt,N),qt=qt.nextEffect}while(qt!==null);if(A=JS,S=G$(),b=A.focusedElem,a=A.selectionRange,S!==b&&b&&b.ownerDocument&&sK(b.ownerDocument.documentElement,b)){for(a!==null&&cR(b)&&(S=a.start,A=a.end,A===void 0&&(A=S),"selectionStart"in b?(b.selectionStart=S,b.selectionEnd=Math.min(A,b.value.length)):(A=(S=b.ownerDocument||document)&&S.defaultView||window,A.getSelection&&(A=A.getSelection(),o=b.textContent.length,O=Math.min(a.start,o),a=a.end===void 0?O:Math.min(a.end,o),!A.extend&&O>a&&(o=a,a=O,O=o),o=V$(b,O),s=V$(b,a),o&&s&&(A.rangeCount!==1||A.anchorNode!==o.node||A.anchorOffset!==o.offset||A.focusNode!==s.node||A.focusOffset!==s.offset)&&(S=S.createRange(),S.setStart(o.node,o.offset),A.removeAllRanges(),O>a?(A.addRange(S),A.extend(s.node,s.offset)):(S.setEnd(s.node,s.offset),A.addRange(S)))))),S=[],A=b;A=A.parentNode;)A.nodeType===1&&S.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<S.length;b++)A=S[b],A.element.scrollLeft=A.left,A.element.scrollTop=A.top}D_=!!QS,JS=QS=null,t.current=r,qt=n;do try{for(b=t;qt!==null;){var E=qt.flags;if(E&36&&Ble(b,qt.alternate,qt),E&128){S=void 0;var p=qt.ref;if(p!==null){var I=qt.stateNode;switch(qt.tag){case 5:S=I;break;default:S=I}typeof p=="function"?p(S):p.current=S}}qt=qt.nextEffect}}catch(N){if(qt===null)throw Error(bt(330));Rf(qt,N),qt=qt.nextEffect}while(qt!==null);qt=null,Ple(),Ar=i}else t.current=r;if(Uf)Uf=!1,Cv=t,rv=e;else for(qt=n;qt!==null;)e=qt.nextEffect,qt.nextEffect=null,qt.flags&8&&(E=qt,E.sibling=null,E.stateNode=null),qt=e;if(n=t.pendingLanes,n===0&&(Qc=null),n===1?t===RR?Rv++:(Rv=0,RR=t):Rv=0,r=r.stateNode,_h&&typeof _h.onCommitFiberRoot=="function")try{_h.onCommitFiberRoot(L8,r,void 0,(r.current.flags&64)===64)}catch{}if(No(t,Ds()),BE)throw BE=!1,t=PR,PR=null,t;return Ar&8||uu(),null}function Kle(){for(;qt!==null;){var t=qt.alternate;B_||Nv===null||(qt.flags&8?R$(qt,Nv)&&(B_=!0):qt.tag===13&&Fle(t,qt)&&R$(qt,Nv)&&(B_=!0));var e=qt.flags;e&256&&jle(t,qt),!(e&512)||Uf||(Uf=!0,nb(97,function(){return Vf(),null})),qt=qt.nextEffect}}function Vf(){if(rv!==90){var t=97<rv?97:rv;return rv=90,Ph(t,Yle)}return!1}function Wle(t,e){TR.push(e,t),Uf||(Uf=!0,nb(97,function(){return Vf(),null}))}function YK(t,e){CR.push(e,t),Uf||(Uf=!0,nb(97,function(){return Vf(),null}))}function Yle(){if(Cv===null)return!1;var t=Cv;if(Cv=null,Ar&48)throw Error(bt(331));var e=Ar;Ar|=32;var r=CR;CR=[];for(var n=0;n<r.length;n+=2){var i=r[n],s=r[n+1],a=i.destroy;if(i.destroy=void 0,typeof a=="function")try{a()}catch(c){if(s===null)throw Error(bt(330));Rf(s,c)}}for(r=TR,TR=[],n=0;n<r.length;n+=2){i=r[n],s=r[n+1];try{var o=i.create;i.destroy=o()}catch(c){if(s===null)throw Error(bt(330));Rf(s,c)}}for(o=t.current.firstEffect;o!==null;)t=o.nextEffect,o.nextEffect=null,o.flags&8&&(o.sibling=null,o.stateNode=null),o=t;return Ar=e,uu(),!0}function DL(t,e,r){e=Y8(r,e),e=jK(t,e,1),Pf(t,e),e=Ha(),t=Yx(t,1),t!==null&&(Fx(t,1,e),No(t,e))}function Rf(t,e){if(t.tag===3)DL(t,t,e);else for(var r=t.return;r!==null;){if(r.tag===3){DL(r,t,e);break}else if(r.tag===1){var n=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Qc===null||!Qc.has(n))){t=Y8(e,t);var i=BK(r,t,1);if(Pf(r,i),i=Ha(),r=Yx(r,1),r!==null)Fx(r,1,i),No(r,i);else if(typeof n.componentDidCatch=="function"&&(Qc===null||!Qc.has(n)))try{n.componentDidCatch(e,t)}catch{}break}}r=r.return}}function Qle(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Ha(),t.pingedLanes|=t.suspendedLanes&r,Js===t&&(Ms&r)===r&&(cs===4||cs===3&&(Ms&62914560)===Ms&&500>Ds()-X8?w0(t,0):J8|=r),No(t,e)}function Jle(t,e){var r=t.stateNode;r!==null&&r.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?(Xu===0&&(Xu=Xg),e=jp(62914560&~Xu),e===0&&(e=4194304)):e=Sg()===99?1:2:e=1),r=Ha(),t=Yx(t,e),t!==null&&(Fx(t,e,r),No(t,r))}var QK;QK=function(t,e,r){var n=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||_a.current)mc=!0;else if(r&n)mc=!!(t.flags&16384);else{switch(mc=!1,e.tag){case 3:bL(e),tO();break;case 5:lL(e);break;case 1:Ea(e.type)&&$_(e);break;case 4:mR(e,e.stateNode.containerInfo);break;case 10:n=e.memoizedProps.value;var i=e.type._context;di(PE,i._currentValue),i._currentValue=n;break;case 13:if(e.memoizedState!==null)return r&e.child.childLanes?wL(t,e,r):(di(fi,fi.current&1),e=tl(t,e,r),e!==null?e.sibling:null);di(fi,fi.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&64){if(n)return SL(t,e,r);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),di(fi,fi.current),n)break;return null;case 23:case 24:return e.lanes=0,rO(t,e,r)}return tl(t,e,r)}else mc=!1;switch(e.lanes=0,e.tag){case 2:if(n=e.type,t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=Ag(e,$s.current),y0(e,r),i=V8(null,e,n,t,i,r),e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ea(n)){var s=!0;$_(e)}else s=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,F8(e);var a=n.getDerivedStateFromProps;typeof a=="function"&&RE(e,n,a,t),i.updater=Kx,e.stateNode=i,i._reactInternals=e,gR(e,n,t,r),e=wR(null,e,n,!0,s,r)}else e.tag=0,pa(null,e,i,r),e=e.child;return e;case 16:i=e.elementType;e:{switch(t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=Zle(i),t=tc(i,t),s){case 0:e=bR(null,e,i,t,r);break e;case 1:e=vL(null,e,i,t,r);break e;case 11:e=mL(null,e,i,t,r);break e;case 14:e=yL(null,e,i,tc(i.type,t),n,r);break e}throw Error(bt(306,i,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:tc(n,i),bR(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:tc(n,i),vL(t,e,n,i,r);case 3:if(bL(e),n=e.updateQueue,t===null||n===null)throw Error(bt(282));if(n=e.pendingProps,i=e.memoizedState,i=i!==null?i.element:null,_K(t,e),ib(e,n,null,r),n=e.memoizedState.element,n===i)tO(),e=tl(t,e,r);else{if(i=e.stateNode,(s=i.hydrate)&&(bf=m0(e.stateNode.containerInfo.firstChild),el=e,s=eu=!0),s){if(t=i.mutableSourceEagerHydrationData,t!=null)for(i=0;i<t.length;i+=2)s=t[i],s._workInProgressVersionPrimary=t[i+1],v0.push(s);for(r=SK(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|1024,r=r.sibling}else pa(t,e,n,r),tO();e=e.child}return e;case 5:return lL(e),t===null&&yR(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,a=i.children,fR(n,i)?a=null:s!==null&&fR(n,s)&&(e.flags|=16),kK(t,e),pa(t,e,a,r),e.child;case 6:return t===null&&yR(e),null;case 13:return wL(t,e,r);case 4:return mR(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=NE(e,null,n,r):pa(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:tc(n,i),mL(t,e,n,i,r);case 7:return pa(t,e,e.pendingProps,r),e.child;case 8:return pa(t,e,e.pendingProps.children,r),e.child;case 12:return pa(t,e,e.pendingProps.children,r),e.child;case 10:e:{n=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value;var o=e.type._context;if(di(PE,o._currentValue),o._currentValue=s,a!==null)if(o=a.value,s=xo(o,s)?0:(typeof n._calculateChangedBits=="function"?n._calculateChangedBits(o,s):1073741823)|0,s===0){if(a.children===i.children&&!_a.current){e=tl(t,e,r);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){a=o.child;for(var u=c.firstContext;u!==null;){if(u.context===n&&u.observedBits&s){o.tag===1&&(u=If(-1,r&-r),u.tag=2,Pf(o,u)),o.lanes|=r,u=o.alternate,u!==null&&(u.lanes|=r),wK(o.return,r),c.lanes|=r;break}u=u.next}}else a=o.tag===10&&o.type===e.type?null:o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}pa(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,s=e.pendingProps,n=s.children,y0(e,r),i=Ro(i,s.unstable_observedBits),n=n(i),e.flags|=1,pa(t,e,n,r),e.child;case 14:return i=e.type,s=tc(i,e.pendingProps),s=tc(i.type,s),yL(t,e,i,s,n,r);case 15:return MK(t,e,e.type,e.pendingProps,n,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:tc(n,i),t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),e.tag=1,Ea(n)?(t=!0,$_(e)):t=!1,y0(e,r),xK(e,n,i),gR(e,n,i,r),wR(null,e,n,!0,t,r);case 19:return SL(t,e,r);case 23:return rO(t,e,r);case 24:return rO(t,e,r)}throw Error(bt(156,e.tag))};function Xle(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Ao(t,e,r,n){return new Xle(t,e,r,n)}function e5(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Zle(t){if(typeof t=="function")return e5(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Ux)return 11;if(t===jx)return 14}return 2}function jf(t,e){var r=t.alternate;return r===null?(r=Ao(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function F_(t,e,r,n,i,s){var a=2;if(n=t,typeof t=="function")e5(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case ef:return _0(r.children,i,s,e);case OG:a=8,i|=16;break;case m8:a=8,i|=1;break;case _v:return t=Ao(12,r,e,i|8),t.elementType=_v,t.type=_v,t.lanes=s,t;case Ev:return t=Ao(13,r,e,i),t.type=Ev,t.elementType=Ev,t.lanes=s,t;case bE:return t=Ao(19,r,e,i),t.elementType=bE,t.lanes=s,t;case E8:return t5(r,i,s,e);case KC:return t=Ao(24,r,e,i),t.elementType=KC,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case y8:a=10;break e;case v8:a=9;break e;case Ux:a=11;break e;case jx:a=14;break e;case b8:a=16,n=null;break e;case w8:a=22;break e}throw Error(bt(130,t==null?t:typeof t,""))}return e=Ao(a,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function _0(t,e,r,n){return t=Ao(7,t,n,e),t.lanes=r,t}function t5(t,e,r,n){return t=Ao(23,t,n,e),t.elementType=E8,t.lanes=r,t}function sO(t,e,r){return t=Ao(6,t,null,e),t.lanes=r,t}function aO(t,e,r){return e=Ao(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function efe(t,e,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=HS(0),this.expirationTimes=HS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=HS(0),this.mutableSourceEagerHydrationData=null}function tfe(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Hd,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function FE(t,e,r,n){var i=e.current,s=Ha(),a=Tf(i);e:if(r){r=r._reactInternals;t:{if(qh(r)!==r||r.tag!==1)throw Error(bt(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break t;case 1:if(Ea(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break t}}o=o.return}while(o!==null);throw Error(bt(171))}if(r.tag===1){var c=r.type;if(Ea(c)){r=hK(r,c,o);break e}}r=o}else r=Lf;return e.context===null?e.context=r:e.pendingContext=r,e=If(s,a),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),Pf(i,e),Cf(i,a,s),a}function oO(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function ML(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function r5(t,e){ML(t,e),(t=t.alternate)&&ML(t,e)}function rfe(){return null}function n5(t,e,r){var n=r!=null&&r.hydrationOptions!=null&&r.hydrationOptions.mutableSources||null;if(r=new efe(t,e,r!=null&&r.hydrate===!0),e=Ao(3,null,null,e===2?7:e===1?3:0),r.current=e,e.stateNode=r,F8(e),t[Jg]=r.current,cK(t.nodeType===8?t.parentNode:t),n)for(t=0;t<n.length;t++){e=n[t];var i=e._getVersion;i=i(e._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[e,i]:r.mutableSourceEagerHydrationData.push(e,i)}this._internalRoot=r}n5.prototype.render=function(t){FE(t,this._internalRoot,null,null)};n5.prototype.unmount=function(){var t=this._internalRoot,e=t.containerInfo;FE(null,t,null,function(){e[Jg]=null})};function f1(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function nfe(t,e){if(e||(e=t?t.nodeType===9?t.documentElement:t.firstChild:null,e=!(!e||e.nodeType!==1||!e.hasAttribute("data-reactroot"))),!e)for(var r;r=t.lastChild;)t.removeChild(r);return new n5(t,0,e?{hydrate:!0}:void 0)}function Qx(t,e,r,n,i){var s=r._reactRootContainer;if(s){var a=s._internalRoot;if(typeof i=="function"){var o=i;i=function(){var u=oO(a);o.call(u)}}FE(e,a,t,i)}else{if(s=r._reactRootContainer=nfe(r,n),a=s._internalRoot,typeof i=="function"){var c=i;i=function(){var u=oO(a);c.call(u)}}zK(function(){FE(e,a,t,i)})}return oO(a)}FG=function(t){if(t.tag===13){var e=Ha();Cf(t,4,e),r5(t,4)}};I8=function(t){if(t.tag===13){var e=Ha();Cf(t,67108864,e),r5(t,67108864)}};qG=function(t){if(t.tag===13){var e=Ha(),r=Tf(t);Cf(t,r,e),r5(t,r)}};HG=function(t,e){return e()};nR=function(t,e,r){switch(e){case"input":if(YC(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=Vx(n);if(!i)throw Error(bt(90));PG(n),YC(n,i)}}}break;case"textarea":CG(t,r);break;case"select":e=r.value,e!=null&&h0(t,!!r.multiple,e,!1)}};A8=HK;LG=function(t,e,r,n,i){var s=Ar;Ar|=4;try{return Ph(98,t.bind(null,e,r,n,i))}finally{Ar=s,Ar===0&&(em(),uu())}};S8=function(){!(Ar&49)&&(Hle(),Vf())};UG=function(t,e){var r=Ar;Ar|=2;try{return t(e)}finally{Ar=r,Ar===0&&(em(),uu())}};function JK(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f1(e))throw Error(bt(200));return tfe(t,e,null,r)}var ife={Events:[c1,Zp,Vx,kG,$G,Vf,{current:!1}]},Gm={findFiberByHostInstance:Vd,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},sfe={bundleType:Gm.bundleType,version:Gm.version,rendererPackageName:Gm.rendererPackageName,rendererConfig:Gm.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fh.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=BG(t),t===null?null:t.stateNode},findFiberByHostInstance:Gm.findFiberByHostInstance||rfe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jw=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jw.isDisabled&&jw.supportsFiber)try{L8=jw.inject(sfe),_h=jw}catch{}}Lo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ife;Lo.createPortal=JK;Lo.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(bt(188)):Error(bt(268,Object.keys(t)));return t=BG(e),t=t===null?null:t.stateNode,t};Lo.flushSync=function(t,e){var r=Ar;if(r&48)return t(e);Ar|=1;try{if(t)return Ph(99,t.bind(null,e))}finally{Ar=r,uu()}};Lo.hydrate=function(t,e,r){if(!f1(e))throw Error(bt(200));return Qx(null,t,e,!0,r)};Lo.render=function(t,e,r){if(!f1(e))throw Error(bt(200));return Qx(null,t,e,!1,r)};Lo.unmountComponentAtNode=function(t){if(!f1(t))throw Error(bt(40));return t._reactRootContainer?(zK(function(){Qx(null,null,t,!1,function(){t._reactRootContainer=null,t[Jg]=null})}),!0):!1};Lo.unstable_batchedUpdates=HK;Lo.unstable_createPortal=function(t,e){return JK(t,e,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Lo.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!f1(r))throw Error(bt(200));if(t==null||t._reactInternals===void 0)throw Error(bt(38));return Qx(t,e,r,!1,n)};Lo.version="17.0.2";function XK(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(XK)}catch(t){console.error(t)}}XK(),EG.exports=Lo;var cb=EG.exports;const afe=_c(cb);/**
42
- * @remix-run/router v1.10.0
43
- *
44
- * Copyright (c) Remix Software Inc.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE.md file in the root directory of this source tree.
48
- *
49
- * @license MIT
50
- */function ub(){return ub=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ub.apply(this,arguments)}var wf;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(wf||(wf={}));const kL="popstate";function ofe(t){t===void 0&&(t={});function e(n,i){let{pathname:s,search:a,hash:o}=n.location;return DR("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:ZK(i)}return ufe(e,r,null,t)}function ji(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function i5(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function cfe(){return Math.random().toString(36).substr(2,8)}function $L(t,e){return{usr:t.state,key:t.key,idx:e}}function DR(t,e,r,n){return r===void 0&&(r=null),ub({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?tm(e):e,{state:r,key:e&&e.key||n||cfe()})}function ZK(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function tm(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function ufe(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,a=i.history,o=wf.Pop,c=null,u=f();u==null&&(u=0,a.replaceState(ub({},a.state,{idx:u}),""));function f(){return(a.state||{idx:null}).idx}function h(){o=wf.Pop;let g=f(),_=g==null?null:g-u;u=g,c&&c({action:o,location:v.location,delta:_})}function m(g,_){o=wf.Push;let b=DR(v.location,g,_);r&&r(b,g),u=f()+1;let S=$L(b,u),A=v.createHref(b);try{a.pushState(S,"",A)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(A)}s&&c&&c({action:o,location:v.location,delta:1})}function y(g,_){o=wf.Replace;let b=DR(v.location,g,_);r&&r(b,g),u=f();let S=$L(b,u),A=v.createHref(b);a.replaceState(S,"",A),s&&c&&c({action:o,location:v.location,delta:0})}function w(g){let _=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof g=="string"?g:ZK(g);return ji(_,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,_)}let v={get action(){return o},get location(){return t(i,a)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(kL,h),c=g,()=>{i.removeEventListener(kL,h),c=null}},createHref(g){return e(i,g)},createURL:w,encodeLocation(g){let _=w(g);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:y,go(g){return a.go(g)}};return v}var LL;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(LL||(LL={}));function lfe(t,e,r){r===void 0&&(r="/");let n=typeof e=="string"?tm(e):e,i=rW(n.pathname||"/",r);if(i==null)return null;let s=eW(t);ffe(s);let a=null;for(let o=0;a==null&&o<s.length;++o)a=wfe(s[o],xfe(i));return a}function eW(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(s,a,o)=>{let c={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(ji(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Eh([n,c.relativePath]),f=r.concat(c);s.children&&s.children.length>0&&(ji(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),eW(s.children,e,f,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:vfe(u,s.index),routesMeta:f})};return t.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let c of tW(s.path))i(s,a,c)}),e}function tW(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let a=tW(n.join("/")),o=[];return o.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&o.push(...a),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function ffe(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:bfe(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const dfe=/^:\w+$/,hfe=3,pfe=2,gfe=1,mfe=10,yfe=-2,UL=t=>t==="*";function vfe(t,e){let r=t.split("/"),n=r.length;return r.some(UL)&&(n+=yfe),e&&(n+=pfe),r.filter(i=>!UL(i)).reduce((i,s)=>i+(dfe.test(s)?hfe:s===""?gfe:mfe),n)}function bfe(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function wfe(t,e){let{routesMeta:r}=t,n={},i="/",s=[];for(let a=0;a<r.length;++a){let o=r[a],c=a===r.length-1,u=i==="/"?e:e.slice(i.length)||"/",f=_fe({path:o.relativePath,caseSensitive:o.caseSensitive,end:c},u);if(!f)return null;Object.assign(n,f.params);let h=o.route;s.push({params:n,pathname:Eh([i,f.pathname]),pathnameBase:Tfe(Eh([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Eh([i,f.pathnameBase]))}return s}function _fe(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=Efe(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce((u,f,h)=>{if(f==="*"){let m=o[h]||"";a=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}return u[f]=Afe(o[h]||"",f),u},{}),pathname:s,pathnameBase:a,pattern:t}}function Efe(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),i5(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,o)=>(n.push(o),"/([^\\/]+)"));return t.endsWith("*")?(n.push("*"),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function xfe(t){try{return decodeURI(t)}catch(e){return i5(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Afe(t,e){try{return decodeURIComponent(t)}catch(r){return i5(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),t}}function rW(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function Sfe(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?tm(t):t;return{pathname:r?r.startsWith("/")?r:Ofe(r,e):e,search:Cfe(n),hash:Rfe(i)}}function Ofe(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function cO(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ife(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Pfe(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=tm(t):(i=ub({},t),ji(!i.pathname||!i.pathname.includes("?"),cO("?","pathname","search",i)),ji(!i.pathname||!i.pathname.includes("#"),cO("#","pathname","hash",i)),ji(!i.search||!i.search.includes("#"),cO("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(n||a==null)o=r;else{let h=e.length-1;if(a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),h-=1;i.pathname=m.join("/")}o=h>=0?e[h]:"/"}let c=Sfe(i,o),u=a&&a!=="/"&&a.endsWith("/"),f=(s||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const Eh=t=>t.join("/").replace(/\/\/+/g,"/"),Tfe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Cfe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Rfe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Nfe(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const nW=["post","put","patch","delete"];new Set(nW);const Dfe=["get",...nW];new Set(Dfe);/**
51
- * React Router v6.17.0
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */function qE(){return qE=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},qE.apply(this,arguments)}const s5=Ve.createContext(null),Mfe=Ve.createContext(null),Jx=Ve.createContext(null),Xx=Ve.createContext(null),zh=Ve.createContext({outlet:null,matches:[],isDataRoute:!1}),iW=Ve.createContext(null);function Zx(){return Ve.useContext(Xx)!=null}function d1(){return Zx()||ji(!1),Ve.useContext(Xx).location}function sW(t){Ve.useContext(Jx).static||Ve.useLayoutEffect(t)}function h1(){let{isDataRoute:t}=Ve.useContext(zh);return t?Wfe():kfe()}function kfe(){Zx()||ji(!1);let t=Ve.useContext(s5),{basename:e,navigator:r}=Ve.useContext(Jx),{matches:n}=Ve.useContext(zh),{pathname:i}=d1(),s=JSON.stringify(Ife(n).map(c=>c.pathnameBase)),a=Ve.useRef(!1);return sW(()=>{a.current=!0}),Ve.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=Pfe(c,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:Eh([e,f.pathname])),(u.replace?r.replace:r.push)(f,u.state,u)},[e,r,s,i,t])}function $fe(){let{matches:t}=Ve.useContext(zh),e=t[t.length-1];return e?e.params:{}}function Lfe(t,e){return Ufe(t,e)}function Ufe(t,e,r){Zx()||ji(!1);let{navigator:n}=Ve.useContext(Jx),{matches:i}=Ve.useContext(zh),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let o=s?s.pathnameBase:"/";s&&s.route;let c=d1(),u;if(e){var f;let v=typeof e=="string"?tm(e):e;o==="/"||(f=v.pathname)!=null&&f.startsWith(o)||ji(!1),u=v}else u=c;let h=u.pathname||"/",m=o==="/"?h:h.slice(o.length)||"/",y=lfe(t,{pathname:m}),w=Hfe(y&&y.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Eh([o,n.encodeLocation?n.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?o:Eh([o,n.encodeLocation?n.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r);return e&&w?Ve.createElement(Xx.Provider,{value:{location:qE({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:wf.Pop}},w):w}function jfe(){let t=Kfe(),e=Nfe(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return Ve.createElement(Ve.Fragment,null,Ve.createElement("h2",null,"Unexpected Application Error!"),Ve.createElement("h3",{style:{fontStyle:"italic"}},e),r?Ve.createElement("pre",{style:i},r):null,s)}const Bfe=Ve.createElement(jfe,null);class Ffe extends Ve.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error?Ve.createElement(zh.Provider,{value:this.props.routeContext},Ve.createElement(iW.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qfe(t){let{routeContext:e,match:r,children:n}=t,i=Ve.useContext(s5);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),Ve.createElement(zh.Provider,{value:e},n)}function Hfe(t,e,r){var n;if(e===void 0&&(e=[]),r===void 0&&(r=null),t==null){var i;if((i=r)!=null&&i.errors)t=r.matches;else return null}let s=t,a=(n=r)==null?void 0:n.errors;if(a!=null){let o=s.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id]));o>=0||ji(!1),s=s.slice(0,Math.min(s.length,o+1))}return s.reduceRight((o,c,u)=>{let f=c.route.id?a==null?void 0:a[c.route.id]:null,h=null;r&&(h=c.route.errorElement||Bfe);let m=e.concat(s.slice(0,u+1)),y=()=>{let w;return f?w=h:c.route.Component?w=Ve.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=o,Ve.createElement(qfe,{match:c,routeContext:{outlet:o,matches:m,isDataRoute:r!=null},children:w})};return r&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?Ve.createElement(Ffe,{location:r.location,revalidation:r.revalidation,component:h,error:f,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):y()},null)}var aW=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(aW||{}),HE=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(HE||{});function zfe(t){let e=Ve.useContext(s5);return e||ji(!1),e}function Vfe(t){let e=Ve.useContext(Mfe);return e||ji(!1),e}function Gfe(t){let e=Ve.useContext(zh);return e||ji(!1),e}function oW(t){let e=Gfe(),r=e.matches[e.matches.length-1];return r.route.id||ji(!1),r.route.id}function Kfe(){var t;let e=Ve.useContext(iW),r=Vfe(HE.UseRouteError),n=oW(HE.UseRouteError);return e||((t=r.errors)==null?void 0:t[n])}function Wfe(){let{router:t}=zfe(aW.UseNavigateStable),e=oW(HE.UseNavigateStable),r=Ve.useRef(!1);return sW(()=>{r.current=!0}),Ve.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,qE({fromRouteId:e},s)))},[t,e])}function Bp(t){ji(!1)}function Yfe(t){let{basename:e="/",children:r=null,location:n,navigationType:i=wf.Pop,navigator:s,static:a=!1}=t;Zx()&&ji(!1);let o=e.replace(/^\/*/,"/"),c=Ve.useMemo(()=>({basename:o,navigator:s,static:a}),[o,s,a]);typeof n=="string"&&(n=tm(n));let{pathname:u="/",search:f="",hash:h="",state:m=null,key:y="default"}=n,w=Ve.useMemo(()=>{let v=rW(u,o);return v==null?null:{location:{pathname:v,search:f,hash:h,state:m,key:y},navigationType:i}},[o,u,f,h,m,y,i]);return w==null?null:Ve.createElement(Jx.Provider,{value:c},Ve.createElement(Xx.Provider,{children:r,value:w}))}function Qfe(t){let{children:e,location:r}=t;return Lfe(MR(e),r)}new Promise(()=>{});function MR(t,e){e===void 0&&(e=[]);let r=[];return Ve.Children.forEach(t,(n,i)=>{if(!Ve.isValidElement(n))return;let s=[...e,i];if(n.type===Ve.Fragment){r.push.apply(r,MR(n.props.children,s));return}n.type!==Bp&&ji(!1),!n.props.index||!n.props.children||ji(!1);let a={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=MR(n.props.children,s)),r.push(a)}),r}/**
60
- * React Router DOM v6.17.0
61
- *
62
- * Copyright (c) Remix Software Inc.
63
- *
64
- * This source code is licensed under the MIT license found in the
65
- * LICENSE.md file in the root directory of this source tree.
66
- *
67
- * @license MIT
68
- */function kR(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function Jfe(t,e){let r=kR(t);return e&&e.forEach((n,i)=>{r.has(i)||e.getAll(i).forEach(s=>{r.append(i,s)})}),r}const Xfe="startTransition",jL=aue[Xfe];function Zfe(t){let{basename:e,children:r,future:n,window:i}=t,s=Ve.useRef();s.current==null&&(s.current=ofe({window:i,v5Compat:!0}));let a=s.current,[o,c]=Ve.useState({action:a.action,location:a.location}),{v7_startTransition:u}=n||{},f=Ve.useCallback(h=>{u&&jL?jL(()=>c(h)):c(h)},[c,u]);return Ve.useLayoutEffect(()=>a.listen(f),[a,f]),Ve.createElement(Yfe,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:a})}var BL;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(BL||(BL={}));var FL;(function(t){t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(FL||(FL={}));function ede(t){let e=Ve.useRef(kR(t)),r=Ve.useRef(!1),n=d1(),i=Ve.useMemo(()=>Jfe(n.search,r.current?null:e.current),[n.search]),s=h1(),a=Ve.useCallback((o,c)=>{const u=kR(typeof o=="function"?o(i):o);r.current=!0,s("?"+u,c)},[s,i]);return[i,a]}const cW="6.8.0";function tde(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;s<n.length;s++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=t,i}async function Os(t){const e=Object.keys(t);return(await Promise.all(e.map(n=>Promise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function Qt(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&tde(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function r0(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(r0).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n<t.length;n++)r+=e[t[n]>>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return r0(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${r0(r)}: ${r0(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Io(t,e){return t&&t.code===e}function a5(t){return Io(t,"CALL_EXCEPTION")}function Li(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${r0(r)}`);for(const a in r){if(a==="shortMessage")continue;const o=r[a];s.push(a+"="+r0(o))}}s.push(`code=${e}`),s.push(`version=${cW}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Qt(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Qt(i,{shortMessage:n}),i}function st(t,e,r,n){if(!t)throw Li(e,r,n)}function Ne(t,e,r,n){st(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function uW(t,e,r){r==null&&(r=""),r&&(r=": "+r),st(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),st(t<=e,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const rde=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const r=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(r!==n)throw new Error("broken")}t.push(e)}catch{}return t},[]);function lW(t){st(rde.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Gf(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),st(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function fW(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s<n.length;s++)n[s]=parseInt(t.substring(i,i+2),16),i+=2;return n}Ne(!1,"invalid BytesLike value",e||"value",t)}function Ht(t,e){return fW(t,e,!1)}function Ns(t,e){return fW(t,e,!0)}function ci(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function dW(t){return ci(t,!0)||t instanceof Uint8Array}const qL="0123456789abcdef";function _t(t){const e=Ht(t);let r="0x";for(let n=0;n<e.length;n++){const i=e[n];r+=qL[(i&240)>>4]+qL[i&15]}return r}function Hn(t){return"0x"+t.map(e=>_t(e).substring(2)).join("")}function E0(t){return ci(t,!0)?(t.length-2)/2:Ht(t).length}function Kn(t,e,r){const n=Ht(t);return r!=null&&r>n.length&&st(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),_t(n.slice(e??0,r??n.length))}function hW(t,e,r){const n=Ht(t);st(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),_t(i)}function Ch(t,e){return hW(t,e,!0)}function nde(t,e){return hW(t,e,!1)}const e2=BigInt(0),hc=BigInt(1),n0=9007199254740991;function zE(t,e){const r=t2(t,"value"),n=BigInt(jr(e,"width"));if(st(r>>n===e2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-hc){const i=(hc<<n)-hc;return-((~r&i)+hc)}return r}function pW(t,e){let r=nr(t,"value");const n=BigInt(jr(e,"width")),i=hc<<n-hc;if(r<e2){r=-r,st(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const s=(hc<<n)-hc;return(~r&s)+hc}else st(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return r}function Wd(t,e){const r=t2(t,"value"),n=BigInt(jr(e,"bits"));return r&(hc<<n)-hc}function nr(t,e){switch(typeof t){case"bigint":return t;case"number":return Ne(Number.isInteger(t),"underflow",e||"value",t),Ne(t>=-n0&&t<=n0,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){Ne(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}Ne(!1,"invalid BigNumberish value",e||"value",t)}function t2(t,e){const r=nr(t,e);return st(r>=e2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const HL="0123456789abcdef";function p1(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=HL[r>>4],e+=HL[r&15];return BigInt(e)}return nr(t)}function jr(t,e){switch(typeof t){case"bigint":return Ne(t>=-n0&&t<=n0,"overflow",e||"value",t),Number(t);case"number":return Ne(Number.isInteger(t),"underflow",e||"value",t),Ne(t>=-n0&&t<=n0,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return jr(BigInt(t),e)}catch(r){Ne(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}Ne(!1,"invalid numeric value",e||"value",t)}function ide(t){return jr(p1(t))}function dl(t,e){let n=t2(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=jr(e,"width");for(st(i*2>=n.length,`value exceeds width (${i} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length<i*2;)n="0"+n}return"0x"+n}function ba(t){const e=t2(t,"value");if(e===e2)return new Uint8Array([]);let r=e.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let i=0;i<n.length;i++){const s=i*2;n[i]=parseInt(r.substring(s,s+2),16)}return n}function i0(t){let e=_t(dW(t)?t:ba(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const $R="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let Bw=null;function sde(t){if(Bw==null){Bw={};for(let r=0;r<$R.length;r++)Bw[$R[r]]=BigInt(r)}const e=Bw[t];return Ne(e!=null,"invalid base58 value","letter",t),e}const ade=BigInt(0),LR=BigInt(58);function gW(t){let e=p1(Ht(t)),r="";for(;e;)r=$R[Number(e%LR)]+r,e/=LR;return r}function ode(t){let e=ade;for(let r=0;r<t.length;r++)e*=LR,e+=sde(t[r]);return e}function cde(t){t=atob(t);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return Ht(e)}function ude(t){const e=Ht(t);let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}var k0;class mW{constructor(e,r,n){Fe(this,"filter");Fe(this,"emitter");Je(this,k0,void 0);Te(this,k0,r),Qt(this,{emitter:e,filter:n})}async removeListener(){W(this,k0)!=null&&await this.emitter.off(this.filter,W(this,k0))}}k0=new WeakMap;function lde(t,e,r,n,i){Ne(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function yW(t,e,r,n,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let s=0;for(let a=e+1;a<r.length&&r[a]>>6===2;a++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function fde(t,e,r,n,i){return t==="OVERLONG"?(Ne(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),yW(t,e,r))}const dde=Object.freeze({error:lde,ignore:yW,replace:fde});function hde(t,e){e==null&&(e=dde.error);const r=Ht(t,"bytes"),n=[];let i=0;for(;i<r.length;){const s=r[i++];if(!(s>>7)){n.push(s);continue}let a=null,o=null;if((s&224)===192)a=1,o=127;else if((s&240)===224)a=2,o=2047;else if((s&248)===240)a=3,o=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+a>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-a-1)-1;for(let u=0;u<a;u++){let f=r[i];if((f&192)!=128){i+=e("MISSING_CONTINUE",i,r,n),c=null;break}c=c<<6|f&63,i++}if(c!==null){if(c>1114111){i+=e("OUT_OF_RANGE",i-1-a,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-a,r,n,c);continue}if(c<=o){i+=e("OVERLONG",i-1-a,r,n,c);continue}n.push(c)}}return n}function Xs(t,e){e!=null&&(lW(e),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);Ne(n<t.length&&(s&64512)===56320,"invalid surrogate pair","str",t);const a=65536+((i&1023)<<10)+(s&1023);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function pde(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function o5(t,e){return pde(hde(t,e))}function vW(t){async function e(r,n){const i=r.url.split(":")[0].toLowerCase();st(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),st(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s;if(n){const h=new AbortController;s=h.signal,n.addListener(()=>{h.abort()})}const a={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:s},o=await fetch(r.url,a),c={};o.headers.forEach((h,m)=>{c[m.toLowerCase()]=h});const u=await o.arrayBuffer(),f=u==null?null:new Uint8Array(u);return{statusCode:o.status,statusMessage:o.statusText,headers:c,body:f}}return e}const gde=12,mde=250;let zL=vW();const yde=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),vde=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let uO=!1;async function bW(t,e){try{const r=t.match(yde);if(!r)throw new Error("invalid data");return new Nf(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?cde(r[3]):wde(r[3]))}catch{return new Nf(599,"BAD REQUEST (invalid data: URI)",{},null,new Bf(t))}}function wW(t){async function e(r,n){try{const i=r.match(vde);if(!i)throw new Error("invalid link");return new Bf(`${t}${i[2]}`)}catch{return new Nf(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Bf(r))}}return e}const Fw={data:bW,ipfs:wW("https://gateway.ipfs.io/ipfs/")},_W=new WeakMap;var eh,tf;class bde{constructor(e){Je(this,eh,void 0);Je(this,tf,void 0);Te(this,eh,[]),Te(this,tf,!1),_W.set(e,()=>{if(!W(this,tf)){Te(this,tf,!0);for(const r of W(this,eh))setTimeout(()=>{r()},0);Te(this,eh,[])}})}addListener(e){st(!W(this,tf),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),W(this,eh).push(e)}get cancelled(){return W(this,tf)}checkSignal(){st(!this.cancelled,"cancelled","CANCELLED",{})}}eh=new WeakMap,tf=new WeakMap;function qw(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var $0,L0,ic,Uu,U0,j0,Vi,La,ju,th,rh,nh,Uc,Bu,rf,ih,iv;const Tx=class Tx{constructor(e){Je(this,ih);Je(this,$0,void 0);Je(this,L0,void 0);Je(this,ic,void 0);Je(this,Uu,void 0);Je(this,U0,void 0);Je(this,j0,void 0);Je(this,Vi,void 0);Je(this,La,void 0);Je(this,ju,void 0);Je(this,th,void 0);Je(this,rh,void 0);Je(this,nh,void 0);Je(this,Uc,void 0);Je(this,Bu,void 0);Je(this,rf,void 0);Te(this,j0,String(e)),Te(this,$0,!1),Te(this,L0,!0),Te(this,ic,{}),Te(this,Uu,""),Te(this,U0,3e5),Te(this,Bu,{slotInterval:mde,maxAttempts:gde}),Te(this,rf,null)}get url(){return W(this,j0)}set url(e){Te(this,j0,String(e))}get body(){return W(this,Vi)==null?null:new Uint8Array(W(this,Vi))}set body(e){if(e==null)Te(this,Vi,void 0),Te(this,La,void 0);else if(typeof e=="string")Te(this,Vi,Xs(e)),Te(this,La,"text/plain");else if(e instanceof Uint8Array)Te(this,Vi,e),Te(this,La,"application/octet-stream");else if(typeof e=="object")Te(this,Vi,Xs(JSON.stringify(e))),Te(this,La,"application/json");else throw new Error("invalid body")}hasBody(){return W(this,Vi)!=null}get method(){return W(this,Uu)?W(this,Uu):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),Te(this,Uu,String(e).toUpperCase())}get headers(){const e=Object.assign({},W(this,ic));return W(this,ju)&&(e.authorization=`Basic ${ude(Xs(W(this,ju)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&W(this,La)&&(e["content-type"]=W(this,La)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){W(this,ic)[String(e).toLowerCase()]=String(r)}clearHeaders(){Te(this,ic,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return W(this,ju)||null}setCredentials(e,r){Ne(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Te(this,ju,`${e}:${r}`)}get allowGzip(){return W(this,L0)}set allowGzip(e){Te(this,L0,!!e)}get allowInsecureAuthentication(){return!!W(this,$0)}set allowInsecureAuthentication(e){Te(this,$0,!!e)}get timeout(){return W(this,U0)}set timeout(e){Ne(e>=0,"timeout must be non-zero","timeout",e),Te(this,U0,e)}get preflightFunc(){return W(this,th)||null}set preflightFunc(e){Te(this,th,e)}get processFunc(){return W(this,rh)||null}set processFunc(e){Te(this,rh,e)}get retryFunc(){return W(this,nh)||null}set retryFunc(e){Te(this,nh,e)}get getUrlFunc(){return W(this,rf)||zL}set getUrlFunc(e){Te(this,rf,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${W(this,Vi)?_t(W(this,Vi)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(W(this,Bu).slotInterval=e.slotInterval),e.maxAttempts!=null&&(W(this,Bu).maxAttempts=e.maxAttempts)}send(){return st(W(this,Uc)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Te(this,Uc,new bde(this)),ut(this,ih,iv).call(this,0,VL()+this.timeout,0,this,new Nf(0,"",{},null,this))}cancel(){st(W(this,Uc)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=_W.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();st(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Tx(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,Te(i,ic,Object.assign({},W(this,ic))),W(this,Vi)&&Te(i,Vi,new Uint8Array(W(this,Vi))),Te(i,La,W(this,La)),i}clone(){const e=new Tx(this.url);return Te(e,Uu,W(this,Uu)),W(this,Vi)&&Te(e,Vi,W(this,Vi)),Te(e,La,W(this,La)),Te(e,ic,Object.assign({},W(this,ic))),Te(e,ju,W(this,ju)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),Te(e,th,W(this,th)),Te(e,rh,W(this,rh)),Te(e,nh,W(this,nh)),Te(e,rf,W(this,rf)),e}static lockConfig(){uO=!0}static getGateway(e){return Fw[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(uO)throw new Error("gateways locked");Fw[e]=r}static registerGetUrl(e){if(uO)throw new Error("gateways locked");zL=e}static createGetUrlFunc(e){return vW()}static createDataGateway(){return bW}static createIpfsGatewayFunc(e){return wW(e)}};$0=new WeakMap,L0=new WeakMap,ic=new WeakMap,Uu=new WeakMap,U0=new WeakMap,j0=new WeakMap,Vi=new WeakMap,La=new WeakMap,ju=new WeakMap,th=new WeakMap,rh=new WeakMap,nh=new WeakMap,Uc=new WeakMap,Bu=new WeakMap,rf=new WeakMap,ih=new WeakSet,iv=async function(e,r,n,i,s){var f,h,m;if(e>=W(this,Bu).maxAttempts)return s.makeServerError("exceeded maximum retry limit");st(VL()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await _de(n);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in Fw){const y=await Fw[o](a.url,qw(W(i,Uc)));if(y instanceof Nf){let w=y;if(this.processFunc){qw(W(i,Uc));try{w=await this.processFunc(a,w)}catch(v){(v.throttle==null||typeof v.stall!="number")&&w.makeServerError("error in post-processing function",v).assertOk()}}return w}a=y}this.preflightFunc&&(a=await this.preflightFunc(a));const c=await this.getUrlFunc(a,qw(W(i,Uc)));let u=new Nf(c.statusCode,c.statusMessage,c.headers,c.body,i);if(u.statusCode===301||u.statusCode===302){try{const y=u.headers.location||"";return ut(f=a.redirect(y),ih,iv).call(f,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,u,e))){const y=u.headers["retry-after"];let w=W(this,Bu).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof y=="string"&&y.match(/^[1-9][0-9]*$/)&&(w=parseInt(y)),ut(h=a.clone(),ih,iv).call(h,e+1,r,w,i,u)}if(this.processFunc){qw(W(i,Uc));try{u=await this.processFunc(a,u)}catch(y){(y.throttle==null||typeof y.stall!="number")&&u.makeServerError("error in post-processing function",y).assertOk();let w=W(this,Bu).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return y.stall>=0&&(w=y.stall),ut(m=a.clone(),ih,iv).call(m,e+1,r,w,i,u)}}return u};let Bf=Tx;var Mb,kb,$b,sc,B0,sh;const xM=class xM{constructor(e,r,n,i,s){Je(this,Mb,void 0);Je(this,kb,void 0);Je(this,$b,void 0);Je(this,sc,void 0);Je(this,B0,void 0);Je(this,sh,void 0);Te(this,Mb,e),Te(this,kb,r),Te(this,$b,Object.keys(n).reduce((a,o)=>(a[o.toLowerCase()]=String(n[o]),a),{})),Te(this,sc,i==null?null:new Uint8Array(i)),Te(this,B0,s||null),Te(this,sh,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${W(this,sc)?_t(W(this,sc)):"null"}>`}get statusCode(){return W(this,Mb)}get statusMessage(){return W(this,kb)}get headers(){return Object.assign({},W(this,$b))}get body(){return W(this,sc)==null?null:new Uint8Array(W(this,sc))}get bodyText(){try{return W(this,sc)==null?"":o5(W(this,sc))}catch{st(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{st(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,r){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new xM(599,n,this.headers,this.body,W(this,B0)||void 0);return Te(i,sh,{message:e,error:r}),i}throwThrottleError(e,r){r==null?r=-1:Ne(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Qt(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return W(this,sc)!=null}get request(){return W(this,B0)}ok(){return W(this,sh).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=W(this,sh);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),st(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r})}};Mb=new WeakMap,kb=new WeakMap,$b=new WeakMap,sc=new WeakMap,B0=new WeakMap,sh=new WeakMap;let Nf=xM;function VL(){return new Date().getTime()}function wde(t){return Xs(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function _de(t){return new Promise(e=>setTimeout(e,t))}const Ede=BigInt(-1),Xo=BigInt(0),s0=BigInt(1),xde=BigInt(5),Sp={};let x0="0000";for(;x0.length<80;)x0+=x0;function Ed(t){let e=x0;for(;e.length<t;)e+=e;return BigInt("1"+e.substring(0,t))}function Km(t,e,r){const n=BigInt(e.width);if(e.signed){const i=s0<<n-s0;st(r==null||t>=-i&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t>Xo?t=zE(Wd(t,n),n):t=-zE(Wd(-t,n),n)}else{const i=s0<<n;st(r==null||t>=0&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t=(t%i+i)%i&i-s0}return t}function lO(t){typeof t=="number"&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")e=!1;else{const s=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Ne(s,"invalid fixed format","format",t),e=s[1]!=="u",r=parseInt(s[2]),n=parseInt(s[3])}}else if(t){const s=t,a=(o,c,u)=>s[o]==null?u:(Ne(typeof s[o]===c,"invalid fixed format ("+o+" not "+c+")","format."+o,s[o]),s[o]);e=a("signed","boolean",e),r=a("width","number",r),n=a("decimals","number",n)}Ne(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),Ne(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function Ade(t,e){let r="";t<Xo&&(r="-",t*=Ede);let n=t.toString();if(e===0)return r+n;for(;n.length<=e;)n=x0+n;const i=n.length-e;for(n=n.substring(0,i)+"."+n.substring(i);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return r+n}var ac,Cn,qs,Fu,kd,oc,Ru,Lb,jR,Ub,BR,jb,FR,Bb,qR;const Xl=class Xl{constructor(e,r,n){Je(this,Fu);Je(this,oc);Je(this,Lb);Je(this,Ub);Je(this,jb);Je(this,Bb);Fe(this,"format");Je(this,ac,void 0);Je(this,Cn,void 0);Je(this,qs,void 0);Fe(this,"_value");Gf(e,Sp,"FixedNumber"),Te(this,Cn,r),Te(this,ac,n);const i=Ade(r,n.decimals);Qt(this,{format:n.name,_value:i}),Te(this,qs,Ed(n.decimals))}get signed(){return W(this,ac).signed}get width(){return W(this,ac).width}get decimals(){return W(this,ac).decimals}get value(){return W(this,Cn)}addUnsafe(e){return ut(this,Lb,jR).call(this,e)}add(e){return ut(this,Lb,jR).call(this,e,"add")}subUnsafe(e){return ut(this,Ub,BR).call(this,e)}sub(e){return ut(this,Ub,BR).call(this,e,"sub")}mulUnsafe(e){return ut(this,jb,FR).call(this,e)}mul(e){return ut(this,jb,FR).call(this,e,"mul")}mulSignal(e){ut(this,Fu,kd).call(this,e);const r=W(this,Cn)*W(e,Cn);return st(r%W(this,qs)===Xo,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),ut(this,oc,Ru).call(this,r/W(this,qs),"mulSignal")}divUnsafe(e){return ut(this,Bb,qR).call(this,e)}div(e){return ut(this,Bb,qR).call(this,e,"div")}divSignal(e){st(W(e,Cn)!==Xo,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),ut(this,Fu,kd).call(this,e);const r=W(this,Cn)*W(this,qs);return st(r%W(e,Cn)===Xo,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),ut(this,oc,Ru).call(this,r/W(e,Cn),"divSignal")}cmp(e){let r=this.value,n=e.value;const i=this.decimals-e.decimals;return i>0?n*=Ed(i):i<0&&(r*=Ed(-i)),r<n?-1:r>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=W(this,Cn);return W(this,Cn)<Xo&&(e-=W(this,qs)-s0),e=W(this,Cn)/W(this,qs)*W(this,qs),ut(this,oc,Ru).call(this,e,"floor")}ceiling(){let e=W(this,Cn);return W(this,Cn)>Xo&&(e+=W(this,qs)-s0),e=W(this,Cn)/W(this,qs)*W(this,qs),ut(this,oc,Ru).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=xde*Ed(r-1);let i=this.value+n;const s=Ed(r);return i=i/s*s,Km(i,W(this,ac),"round"),new Xl(Sp,i,W(this,ac))}isZero(){return W(this,Cn)===Xo}isNegative(){return W(this,Cn)<Xo}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Xl.fromString(this.toString(),e)}static fromValue(e,r,n){const i=r==null?0:jr(r),s=lO(n);let a=nr(e,"value");const o=i-s.decimals;if(o>0){const c=Ed(o);st(a%c===Xo,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),a/=c}else o<0&&(a*=Ed(-o));return Km(a,s,"fromValue"),new Xl(Sp,a,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);Ne(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=lO(r);let s=n[2]||"0",a=n[3]||"";for(;a.length<i.decimals;)a+=x0;st(a.substring(i.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),a=a.substring(0,i.decimals);const o=BigInt(n[1]+s+a);return Km(o,i,"fromString"),new Xl(Sp,o,i)}static fromBytes(e,r){let n=p1(Ht(e,"value"));const i=lO(r);return i.signed&&(n=zE(n,i.width)),Km(n,i,"fromBytes"),new Xl(Sp,n,i)}};ac=new WeakMap,Cn=new WeakMap,qs=new WeakMap,Fu=new WeakSet,kd=function(e){Ne(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)},oc=new WeakSet,Ru=function(e,r){return e=Km(e,W(this,ac),r),new Xl(Sp,e,W(this,ac))},Lb=new WeakSet,jR=function(e,r){return ut(this,Fu,kd).call(this,e),ut(this,oc,Ru).call(this,W(this,Cn)+W(e,Cn),r)},Ub=new WeakSet,BR=function(e,r){return ut(this,Fu,kd).call(this,e),ut(this,oc,Ru).call(this,W(this,Cn)-W(e,Cn),r)},jb=new WeakSet,FR=function(e,r){return ut(this,Fu,kd).call(this,e),ut(this,oc,Ru).call(this,W(this,Cn)*W(e,Cn)/W(this,qs),r)},Bb=new WeakSet,qR=function(e,r){return st(W(e,Cn)!==Xo,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),ut(this,Fu,kd).call(this,e),ut(this,oc,Ru).call(this,W(this,Cn)*W(this,qs)/W(e,Cn),r)};let UR=Xl;function Sde(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function GL(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function KL(t,e,r,n){const i=[];for(;r<e+1+n;){const s=EW(t,r);i.push(s.result),r+=s.consumed,st(r<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:i}}function EW(t,e){st(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=n=>{st(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=GL(t,e+1,n);return r(e+1+n+i),KL(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),KL(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=GL(t,e+1,n);r(e+1+n+i);const s=_t(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=_t(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:Sde(t[e])}}function c5(t){const e=Ht(t,"data"),r=EW(e,0);return Ne(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function WL(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function xW(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(xW(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=WL(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(Ht(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=WL(e.length);return r.unshift(183+r.length),r.concat(e)}const YL="0123456789abcdef";function lb(t){let e="0x";for(const r of xW(t))e+=YL[r>>4],e+=YL[r&15];return e}const Ode=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Ide(t,e){let r=18;if(typeof e=="string"){const n=Ode.indexOf(e);Ne(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=jr(e,"unit"));return UR.fromValue(t,r,{decimals:r,width:512}).toString()}function Pde(t){return Ide(t,18)}function Tde(t){const e=Ht(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=_t(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Ys=32,HR=new Uint8Array(Ys),Cde=["then"],Hw={};function Wm(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}var nf;const Gv=class Gv extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),a=!0;n!==Hw&&(i=r,s=[],a=!1);super(i.length);Je(this,nf,void 0);i.forEach((c,u)=>{this[u]=c});const o=s.reduce((c,u)=>(typeof u=="string"&&c.set(u,(c.get(u)||0)+1),c),new Map);if(Te(this,nf,Object.freeze(i.map((c,u)=>{const f=s[u];return f!=null&&o.get(f)===1?f:null}))),!!a)return Object.freeze(this),new Proxy(this,{get:(c,u,f)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const m=jr(u,"%index");if(m<0||m>=this.length)throw new RangeError("out of result range");const y=c[m];return y instanceof Error&&Wm(`index ${m}`,y),y}if(Cde.indexOf(u)>=0)return Reflect.get(c,u,f);const h=c[u];if(h instanceof Function)return function(...m){return h.apply(this===f?c:this,m)};if(!(u in c))return c.getValue.apply(this===f?c:this,[u])}return Reflect.get(c,u,f)}})}toArray(){const r=[];return this.forEach((n,i)=>{n instanceof Error&&Wm(`index ${i}`,n),r.push(n)}),r}toObject(){return W(this,nf).reduce((r,n,i)=>(st(n!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),n in r||(r[n]=this.getValue(n)),r),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=[],s=[];for(let a=r;a<n;a++)i.push(this[a]),s.push(W(this,nf)[a]);return new Gv(Hw,i,s)}filter(r,n){const i=[],s=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&Wm(`index ${a}`,o),r.call(n,o,a,this)&&(i.push(o),s.push(W(this,nf)[a]))}return new Gv(Hw,i,s)}map(r,n){const i=[];for(let s=0;s<this.length;s++){const a=this[s];a instanceof Error&&Wm(`index ${s}`,a),i.push(r.call(n,a,s,this))}return i}getValue(r){const n=W(this,nf).indexOf(r);if(n===-1)return;const i=this[n];return i instanceof Error&&Wm(`property ${JSON.stringify(r)}`,i.error),i}static fromItems(r,n){return new Gv(Hw,r,n)}};nf=new WeakMap;let VE=Gv;function QL(t){let e=ba(t);return st(e.length<=Ys,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Ys,offset:e.length}),e.length!==Ys&&(e=Ns(Hn([HR.slice(e.length%Ys),e]))),e}class bl{constructor(e,r,n,i){Fe(this,"name");Fe(this,"type");Fe(this,"localName");Fe(this,"dynamic");Qt(this,{name:e,type:r,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,r){Ne(!1,e,this.localName,r)}}var qu,ah,F0,q_;class zR{constructor(){Je(this,F0);Je(this,qu,void 0);Je(this,ah,void 0);Te(this,qu,[]),Te(this,ah,0)}get data(){return Hn(W(this,qu))}get length(){return W(this,ah)}appendWriter(e){return ut(this,F0,q_).call(this,Ns(e.data))}writeBytes(e){let r=Ns(e);const n=r.length%Ys;return n&&(r=Ns(Hn([r,HR.slice(n)]))),ut(this,F0,q_).call(this,r)}writeValue(e){return ut(this,F0,q_).call(this,QL(e))}writeUpdatableValue(){const e=W(this,qu).length;return W(this,qu).push(HR),Te(this,ah,W(this,ah)+Ys),r=>{W(this,qu)[e]=QL(r)}}}qu=new WeakMap,ah=new WeakMap,F0=new WeakSet,q_=function(e){return W(this,qu).push(e),Te(this,ah,W(this,ah)+e.length),e.length};var Ua,mo,Cx,AW;const AM=class AM{constructor(e,r){Je(this,Cx);Fe(this,"allowLoose");Je(this,Ua,void 0);Je(this,mo,void 0);Qt(this,{allowLoose:!!r}),Te(this,Ua,Ns(e)),Te(this,mo,0)}get data(){return _t(W(this,Ua))}get dataLength(){return W(this,Ua).length}get consumed(){return W(this,mo)}get bytes(){return new Uint8Array(W(this,Ua))}subReader(e){return new AM(W(this,Ua).slice(W(this,mo)+e),this.allowLoose)}readBytes(e,r){let n=ut(this,Cx,AW).call(this,0,e,!!r);return Te(this,mo,W(this,mo)+n.length),n.slice(0,e)}readValue(){return p1(this.readBytes(Ys))}readIndex(){return ide(this.readBytes(Ys))}};Ua=new WeakMap,mo=new WeakMap,Cx=new WeakSet,AW=function(e,r,n){let i=Math.ceil(r/Ys)*Ys;return W(this,mo)+i>W(this,Ua).length&&(this.allowLoose&&n&&W(this,mo)+r<=W(this,Ua).length?i=r:st(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Ns(W(this,Ua)),length:W(this,Ua).length,offset:W(this,mo)+i})),W(this,Ua).slice(W(this,mo),W(this,mo)+i)};let VR=AM;function Ba(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function u5(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function SW(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ba(t.outputLen),Ba(t.blockLen)}function Ig(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function OW(t,e){u5(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const fO=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const IW=t=>t instanceof Uint8Array,H_=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),z_=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Rc=(t,e)=>t<<32-e|t>>>e,Rde=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Rde)throw new Error("Non little-endian hardware is not supported");const Nde=async()=>{};async function JL(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);const s=Date.now()-n;s>=0&&s<e||(await Nde(),n+=s)}}function Dde(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Pg(t){if(typeof t=="string"&&(t=Dde(t)),!IW(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Mde(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!IW(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}class l5{clone(){return this._cloneInto()}}const kde={}.toString;function PW(t,e){if(e!==void 0&&kde.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function r2(t){const e=n=>t().update(Pg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function $de(t=32){if(fO&&typeof fO.getRandomValues=="function")return fO.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}let TW=class extends l5{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,SW(e);const n=Pg(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(e){return Ig(this),this.iHash.update(e),this}digestInto(e){Ig(this),u5(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:a,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=o,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const n2=(t,e,r)=>new TW(t,e).update(r).digest();n2.create=(t,e)=>new TW(t,e);function Lde(t,e,r,n){SW(t);const i=PW({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:o}=i;if(Ba(s),Ba(a),Ba(o),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Pg(e),u=Pg(r),f=new Uint8Array(a),h=n2.create(t,c),m=h._cloneInto().update(u);return{c:s,dkLen:a,asyncTick:o,DK:f,PRF:h,PRFSalt:m}}function Ude(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function f5(t,e,r,n){const{c:i,dkLen:s,DK:a,PRF:o,PRFSalt:c}=Lde(t,e,r,n);let u;const f=new Uint8Array(4),h=z_(f),m=new Uint8Array(o.outputLen);for(let y=1,w=0;w<s;y++,w+=o.outputLen){const v=a.subarray(w,w+o.outputLen);h.setInt32(0,y,!1),(u=c._cloneInto(u)).update(f).digestInto(m),v.set(m.subarray(0,v.length));for(let g=1;g<i;g++){o._cloneInto(u).update(m).digestInto(m);for(let _=0;_<v.length;_++)v[_]^=m[_]}}return Ude(o,c,a,u,m)}function jde(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+u,o,n)}let d5=class extends l5{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=z_(this.buffer)}update(e){Ig(this);const{view:r,buffer:n,blockLen:i}=this;e=Pg(e);const s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const c=z_(e);for(;i<=s-a;a+=i)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ig(this),OW(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(n,0),a=0);for(let h=a;h<i;h++)r[h]=0;jde(n,i-8,BigInt(this.length*8),s),this.process(n,0);const o=z_(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)o.setUint32(4*h,f[h],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:a,pos:o}=this;return e.length=i,e.pos=o,e.finished=s,e.destroyed=a,i%r&&e.buffer.set(n),e}};const Bde=(t,e,r)=>t&e^~t&r,Fde=(t,e,r)=>t&e^t&r^e&r,qde=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),jl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Bl=new Uint32Array(64);let Hde=class extends d5{constructor(){super(64,32,8,!1),this.A=jl[0]|0,this.B=jl[1]|0,this.C=jl[2]|0,this.D=jl[3]|0,this.E=jl[4]|0,this.F=jl[5]|0,this.G=jl[6]|0,this.H=jl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:a,G:o,H:c}=this;return[e,r,n,i,s,a,o,c]}set(e,r,n,i,s,a,o,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Bl[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){const m=Bl[h-15],y=Bl[h-2],w=Rc(m,7)^Rc(m,18)^m>>>3,v=Rc(y,17)^Rc(y,19)^y>>>10;Bl[h]=v+Bl[h-7]+w+Bl[h-16]|0}let{A:n,B:i,C:s,D:a,E:o,F:c,G:u,H:f}=this;for(let h=0;h<64;h++){const m=Rc(o,6)^Rc(o,11)^Rc(o,25),y=f+m+Bde(o,c,u)+qde[h]+Bl[h]|0,v=(Rc(n,2)^Rc(n,13)^Rc(n,22))+Fde(n,i,s)|0;f=u,u=c,c=o,o=a+y|0,a=s,s=i,i=n,n=y+v|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,a,o,c,u,f)}roundClean(){Bl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const rm=r2(()=>new Hde),zw=BigInt(2**32-1),GR=BigInt(32);function CW(t,e=!1){return e?{h:Number(t&zw),l:Number(t>>GR&zw)}:{h:Number(t>>GR&zw)|0,l:Number(t&zw)|0}}function RW(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:a}=CW(t[i],e);[r[i],n[i]]=[s,a]}return[r,n]}const zde=(t,e)=>BigInt(t>>>0)<<GR|BigInt(e>>>0),Vde=(t,e,r)=>t>>>r,Gde=(t,e,r)=>t<<32-r|e>>>r,Kde=(t,e,r)=>t>>>r|e<<32-r,Wde=(t,e,r)=>t<<32-r|e>>>r,Yde=(t,e,r)=>t<<64-r|e>>>r-32,Qde=(t,e,r)=>t>>>r-32|e<<64-r,Jde=(t,e)=>e,Xde=(t,e)=>t,NW=(t,e,r)=>t<<r|e>>>32-r,DW=(t,e,r)=>e<<r|t>>>32-r,MW=(t,e,r)=>e<<r-32|t>>>64-r,kW=(t,e,r)=>t<<r-32|e>>>64-r;function Zde(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const ehe=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),the=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,rhe=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),nhe=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,ihe=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),she=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,ahe={fromBig:CW,split:RW,toBig:zde,shrSH:Vde,shrSL:Gde,rotrSH:Kde,rotrSL:Wde,rotrBH:Yde,rotrBL:Qde,rotr32H:Jde,rotr32L:Xde,rotlSH:NW,rotlSL:DW,rotlBH:MW,rotlBL:kW,add:Zde,add3L:ehe,add3H:the,add4L:rhe,add4H:nhe,add5H:she,add5L:ihe},zr=ahe,[ohe,che]=(()=>zr.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),Fl=new Uint32Array(80),ql=new Uint32Array(80);class uhe extends d5{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:a,Dh:o,Dl:c,Eh:u,El:f,Fh:h,Fl:m,Gh:y,Gl:w,Hh:v,Hl:g}=this;return[e,r,n,i,s,a,o,c,u,f,h,m,y,w,v,g]}set(e,r,n,i,s,a,o,c,u,f,h,m,y,w,v,g){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=u|0,this.El=f|0,this.Fh=h|0,this.Fl=m|0,this.Gh=y|0,this.Gl=w|0,this.Hh=v|0,this.Hl=g|0}process(e,r){for(let S=0;S<16;S++,r+=4)Fl[S]=e.getUint32(r),ql[S]=e.getUint32(r+=4);for(let S=16;S<80;S++){const A=Fl[S-15]|0,O=ql[S-15]|0,E=zr.rotrSH(A,O,1)^zr.rotrSH(A,O,8)^zr.shrSH(A,O,7),p=zr.rotrSL(A,O,1)^zr.rotrSL(A,O,8)^zr.shrSL(A,O,7),I=Fl[S-2]|0,N=ql[S-2]|0,B=zr.rotrSH(I,N,19)^zr.rotrBH(I,N,61)^zr.shrSH(I,N,6),V=zr.rotrSL(I,N,19)^zr.rotrBL(I,N,61)^zr.shrSL(I,N,6),de=zr.add4L(p,V,ql[S-7],ql[S-16]),ve=zr.add4H(de,E,B,Fl[S-7],Fl[S-16]);Fl[S]=ve|0,ql[S]=de|0}let{Ah:n,Al:i,Bh:s,Bl:a,Ch:o,Cl:c,Dh:u,Dl:f,Eh:h,El:m,Fh:y,Fl:w,Gh:v,Gl:g,Hh:_,Hl:b}=this;for(let S=0;S<80;S++){const A=zr.rotrSH(h,m,14)^zr.rotrSH(h,m,18)^zr.rotrBH(h,m,41),O=zr.rotrSL(h,m,14)^zr.rotrSL(h,m,18)^zr.rotrBL(h,m,41),E=h&y^~h&v,p=m&w^~m&g,I=zr.add5L(b,O,p,che[S],ql[S]),N=zr.add5H(I,_,A,E,ohe[S],Fl[S]),B=I|0,V=zr.rotrSH(n,i,28)^zr.rotrBH(n,i,34)^zr.rotrBH(n,i,39),de=zr.rotrSL(n,i,28)^zr.rotrBL(n,i,34)^zr.rotrBL(n,i,39),ve=n&s^n&o^s&o,j=i&a^i&c^a&c;_=v|0,b=g|0,v=y|0,g=w|0,y=h|0,w=m|0,{h,l:m}=zr.add(u|0,f|0,N|0,B|0),u=o|0,f=c|0,o=s|0,c=a|0,s=n|0,a=i|0;const L=zr.add3L(B,de,j);n=zr.add3H(L,N,V,ve),i=L|0}({h:n,l:i}=zr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:a}=zr.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:o,l:c}=zr.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:u,l:f}=zr.add(this.Dh|0,this.Dl|0,u|0,f|0),{h,l:m}=zr.add(this.Eh|0,this.El|0,h|0,m|0),{h:y,l:w}=zr.add(this.Fh|0,this.Fl|0,y|0,w|0),{h:v,l:g}=zr.add(this.Gh|0,this.Gl|0,v|0,g|0),{h:_,l:b}=zr.add(this.Hh|0,this.Hl|0,_|0,b|0),this.set(n,i,s,a,o,c,u,f,h,m,y,w,v,g,_,b)}roundClean(){Fl.fill(0),ql.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const h5=r2(()=>new uhe);function lhe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const XL=lhe(),ZL=XL.crypto||XL.msCrypto;function fhe(t){switch(t){case"sha256":return rm.create();case"sha512":return h5.create()}Ne(!1,"invalid hashing algorithm name","algorithm",t)}function dhe(t,e){const r={sha256:rm,sha512:h5}[t];return Ne(r!=null,"invalid hmac algorithm","algorithm",t),n2.create(r,e)}function hhe(t,e,r,n,i){const s={sha256:rm,sha512:h5}[i];return Ne(s!=null,"invalid pbkdf2 algorithm","algorithm",i),f5(s,t,e,{c:r,dkLen:n})}function phe(t){st(ZL!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),Ne(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return ZL.getRandomValues(e),e}let $W=!1;const LW=function(t,e,r){return dhe(t,e).update(r).digest()};let UW=LW;function nm(t,e,r){const n=Ht(e,"key"),i=Ht(r,"data");return _t(UW(t,n,i))}nm._=LW;nm.lock=function(){$W=!0};nm.register=function(t){if($W)throw new Error("computeHmac is locked");UW=t};Object.freeze(nm);const[jW,BW,FW]=[[],[],[]],ghe=BigInt(0),Ym=BigInt(1),mhe=BigInt(2),yhe=BigInt(7),vhe=BigInt(256),bhe=BigInt(113);for(let t=0,e=Ym,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],jW.push(2*(5*n+r)),BW.push((t+1)*(t+2)/2%64);let i=ghe;for(let s=0;s<7;s++)e=(e<<Ym^(e>>yhe)*bhe)%vhe,e&mhe&&(i^=Ym<<(Ym<<BigInt(s))-Ym);FW.push(i)}const[whe,_he]=RW(FW,!0),e9=(t,e,r)=>r>32?MW(t,e,r):NW(t,e,r),t9=(t,e,r)=>r>32?kW(t,e,r):DW(t,e,r);function Ehe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,c=(a+2)%10,u=r[c],f=r[c+1],h=e9(u,f,1)^r[o],m=t9(u,f,1)^r[o+1];for(let y=0;y<50;y+=10)t[a+y]^=h,t[a+y+1]^=m}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=BW[a],c=e9(i,s,o),u=t9(i,s,o),f=jW[a];i=t[f],s=t[f+1],t[f]=c,t[f+1]=u}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)r[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=whe[n],t[1]^=_he[n]}r.fill(0)}class p5 extends l5{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ba(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=H_(this.state)}keccak(){Ehe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Ig(this);const{blockLen:r,state:n}=this;e=Pg(e);const i=e.length;for(let s=0;s<i;){const a=Math.min(r-this.pos,i-s);for(let o=0;o<a;o++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Ig(this,!1),u5(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ba(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(OW(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new p5(r,n,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}}const xhe=(t,e,r)=>r2(()=>new p5(e,t,r)),Ahe=xhe(1,136,256/8);let qW=!1;const HW=function(t){return Ahe(t)};let zW=HW;function qn(t){const e=Ht(t,"data");return _t(zW(e))}qn._=HW;qn.lock=function(){qW=!0};qn.register=function(t){if(qW)throw new TypeError("keccak256 is locked");zW=t};Object.freeze(qn);const She=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),VW=Uint8Array.from({length:16},(t,e)=>e),Ohe=VW.map(t=>(9*t+5)%16);let g5=[VW],m5=[Ohe];for(let t=0;t<4;t++)for(let e of[g5,m5])e.push(e[t].map(r=>She[r]));const GW=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),Ihe=g5.map((t,e)=>t.map(r=>GW[e][r])),Phe=m5.map((t,e)=>t.map(r=>GW[e][r])),The=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Che=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Vw=(t,e)=>t<<e|t>>>32-e;function r9(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const Gw=new Uint32Array(16);class Rhe extends d5{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let y=0;y<16;y++,r+=4)Gw[y]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,a=s,o=this.h2|0,c=o,u=this.h3|0,f=u,h=this.h4|0,m=h;for(let y=0;y<5;y++){const w=4-y,v=The[y],g=Che[y],_=g5[y],b=m5[y],S=Ihe[y],A=Phe[y];for(let O=0;O<16;O++){const E=Vw(n+r9(y,s,o,u)+Gw[_[O]]+v,S[O])+h|0;n=h,h=u,u=Vw(o,10)|0,o=s,s=E}for(let O=0;O<16;O++){const E=Vw(i+r9(w,a,c,f)+Gw[b[O]]+g,A[O])+m|0;i=m,m=f,f=Vw(c,10)|0,c=a,a=E}}this.set(this.h1+o+f|0,this.h2+u+m|0,this.h3+h+i|0,this.h4+n+a|0,this.h0+s+c|0)}roundClean(){Gw.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Nhe=r2(()=>new Rhe);let KW=!1;const WW=function(t){return Nhe(t)};let YW=WW;function im(t){const e=Ht(t,"data");return _t(YW(e))}im._=WW;im.lock=function(){KW=!0};im.register=function(t){if(KW)throw new TypeError("ripemd160 is locked");YW=t};Object.freeze(im);let QW=!1;const JW=function(t,e,r,n,i){return hhe(t,e,r,n,i)};let XW=JW;function Kf(t,e,r,n,i){const s=Ht(t,"password"),a=Ht(e,"salt");return _t(XW(s,a,r,n,i))}Kf._=JW;Kf.lock=function(){QW=!0};Kf.register=function(t){if(QW)throw new Error("pbkdf2 is locked");XW=t};Object.freeze(Kf);let ZW=!1;const eY=function(t){return new Uint8Array(phe(t))};let tY=eY;function sl(t){return tY(t)}sl._=eY;sl.lock=function(){ZW=!0};sl.register=function(t){if(ZW)throw new Error("randomBytes is locked");tY=t};Object.freeze(sl);const gn=(t,e)=>t<<e|t>>>32-e;function n9(t,e,r,n,i,s){let a=t[e++]^r[n++],o=t[e++]^r[n++],c=t[e++]^r[n++],u=t[e++]^r[n++],f=t[e++]^r[n++],h=t[e++]^r[n++],m=t[e++]^r[n++],y=t[e++]^r[n++],w=t[e++]^r[n++],v=t[e++]^r[n++],g=t[e++]^r[n++],_=t[e++]^r[n++],b=t[e++]^r[n++],S=t[e++]^r[n++],A=t[e++]^r[n++],O=t[e++]^r[n++],E=a,p=o,I=c,N=u,B=f,V=h,de=m,ve=y,j=w,L=v,Y=g,ne=_,U=b,F=S,H=A,M=O;for(let q=0;q<8;q+=2)B^=gn(E+U|0,7),j^=gn(B+E|0,9),U^=gn(j+B|0,13),E^=gn(U+j|0,18),L^=gn(V+p|0,7),F^=gn(L+V|0,9),p^=gn(F+L|0,13),V^=gn(p+F|0,18),H^=gn(Y+de|0,7),I^=gn(H+Y|0,9),de^=gn(I+H|0,13),Y^=gn(de+I|0,18),N^=gn(M+ne|0,7),ve^=gn(N+M|0,9),ne^=gn(ve+N|0,13),M^=gn(ne+ve|0,18),p^=gn(E+N|0,7),I^=gn(p+E|0,9),N^=gn(I+p|0,13),E^=gn(N+I|0,18),de^=gn(V+B|0,7),ve^=gn(de+V|0,9),B^=gn(ve+de|0,13),V^=gn(B+ve|0,18),ne^=gn(Y+L|0,7),j^=gn(ne+Y|0,9),L^=gn(j+ne|0,13),Y^=gn(L+j|0,18),U^=gn(M+H|0,7),F^=gn(U+M|0,9),H^=gn(F+U|0,13),M^=gn(H+F|0,18);i[s++]=a+E|0,i[s++]=o+p|0,i[s++]=c+I|0,i[s++]=u+N|0,i[s++]=f+B|0,i[s++]=h+V|0,i[s++]=m+de|0,i[s++]=y+ve|0,i[s++]=w+j|0,i[s++]=v+L|0,i[s++]=g+Y|0,i[s++]=_+ne|0,i[s++]=b+U|0,i[s++]=S+F|0,i[s++]=A+H|0,i[s++]=O+M|0}function A0(t,e,r,n,i){let s=n+0,a=n+16*i;for(let o=0;o<16;o++)r[a+o]=t[e+(2*i-1)*16+o];for(let o=0;o<i;o++,s+=16,e+=16)n9(r,a,t,e,r,s),o>0&&(a+=16),n9(r,s,t,e+=16,r,a)}function rY(t,e,r){const n=PW({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:a,dkLen:o,asyncTick:c,maxmem:u,onProgress:f}=n;if(Ba(i),Ba(s),Ba(a),Ba(o),Ba(c),Ba(u),f!==void 0&&typeof f!="function")throw new Error("progressCb should be function");const h=128*s,m=h/4;if(i<=1||i&i-1||i>=2**(h/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/h)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(o<0||o>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const y=h*(i+a);if(y>u)throw new Error(`Scrypt: parameters too large, ${y} (128 * r * (N + p)) > ${u} (maxmem)`);const w=f5(rm,t,e,{c:1,dkLen:h*a}),v=H_(w),g=H_(new Uint8Array(h*i)),_=H_(new Uint8Array(h));let b=()=>{};if(f){const S=2*i*a,A=Math.max(Math.floor(S/1e4),1);let O=0;b=()=>{O++,f&&(!(O%A)||O===S)&&f(O/S)}}return{N:i,r:s,p:a,dkLen:o,blockSize32:m,V:g,B32:v,B:w,tmp:_,blockMixCb:b,asyncTick:c}}function nY(t,e,r,n,i){const s=f5(rm,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function Dhe(t,e,r){const{N:n,r:i,p:s,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:h,blockMixCb:m}=rY(t,e,r);for(let y=0;y<s;y++){const w=o*y;for(let v=0;v<o;v++)c[v]=u[w+v];for(let v=0,g=0;v<n-1;v++)A0(c,g,c,g+=o,i),m();A0(c,(n-1)*o,u,w,i),m();for(let v=0;v<n;v++){const g=u[w+o-16]%n;for(let _=0;_<o;_++)h[_]=u[w+_]^c[g*o+_];A0(h,0,u,w,i),m()}}return nY(t,a,f,c,h)}async function Mhe(t,e,r){const{N:n,r:i,p:s,dkLen:a,blockSize32:o,V:c,B32:u,B:f,tmp:h,blockMixCb:m,asyncTick:y}=rY(t,e,r);for(let w=0;w<s;w++){const v=o*w;for(let _=0;_<o;_++)c[_]=u[v+_];let g=0;await JL(n-1,y,()=>{A0(c,g,c,g+=o,i),m()}),A0(c,(n-1)*o,u,v,i),m(),await JL(n,y,()=>{const _=u[v+o-16]%n;for(let b=0;b<o;b++)h[b]=u[v+b]^c[_*o+b];A0(h,0,u,v,i),m()})}return nY(t,a,f,c,h)}let iY=!1,sY=!1;const aY=async function(t,e,r,n,i,s,a){return await Mhe(t,e,{N:r,r:n,p:i,dkLen:s,onProgress:a})},oY=function(t,e,r,n,i,s){return Dhe(t,e,{N:r,r:n,p:i,dkLen:s})};let cY=aY,uY=oY;async function sm(t,e,r,n,i,s,a){const o=Ht(t,"passwd"),c=Ht(e,"salt");return _t(await cY(o,c,r,n,i,s,a))}sm._=aY;sm.lock=function(){sY=!0};sm.register=function(t){if(sY)throw new Error("scrypt is locked");cY=t};Object.freeze(sm);function am(t,e,r,n,i,s){const a=Ht(t,"passwd"),o=Ht(e,"salt");return _t(uY(a,o,r,n,i,s))}am._=oY;am.lock=function(){iY=!0};am.register=function(t){if(iY)throw new Error("scryptSync is locked");uY=t};Object.freeze(am);const lY=function(t){return fhe("sha256").update(t).digest()};let fY=lY,dY=!1;function vc(t){const e=Ht(t,"data");return _t(fY(e))}vc._=lY;vc.lock=function(){dY=!0};vc.register=function(t){if(dY)throw new Error("sha256 is locked");fY=t};Object.freeze(vc);Object.freeze(vc);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hY=BigInt(0),i2=BigInt(1),khe=BigInt(2),s2=t=>t instanceof Uint8Array,$he=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Tg(t){if(!s2(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=$he[t[r]];return e}function pY(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function y5(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Cg(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let n=0;n<r.length;n++){const i=n*2,s=t.slice(i,i+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");r[n]=a}return r}function xh(t){return y5(Tg(t))}function v5(t){if(!s2(t))throw new Error("Uint8Array expected");return y5(Tg(Uint8Array.from(t).reverse()))}function Rg(t,e){return Cg(t.toString(16).padStart(e*2,"0"))}function b5(t,e){return Rg(t,e).reverse()}function Lhe(t){return Cg(pY(t))}function rc(t,e,r){let n;if(typeof e=="string")try{n=Cg(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(s2(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function fb(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!s2(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function Uhe(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function jhe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Bhe(t){let e;for(e=0;t>hY;t>>=i2,e+=1);return e}function Fhe(t,e){return t>>BigInt(e)&i2}const qhe=(t,e,r)=>t|(r?i2:hY)<<BigInt(e),w5=t=>(khe<<BigInt(t-1))-i2,dO=t=>new Uint8Array(t),i9=t=>Uint8Array.from(t);function gY(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=dO(t),i=dO(t),s=0;const a=()=>{n.fill(1),i.fill(0),s=0},o=(...h)=>r(i,n,...h),c=(h=dO())=>{i=o(i9([0]),h),n=o(),h.length!==0&&(i=o(i9([1]),h),n=o())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const m=[];for(;h<e;){n=o();const y=n.slice();m.push(y),h+=n.length}return fb(...m)};return(h,m)=>{a(),c(h);let y;for(;!(y=m(u()));)c();return a(),y}}const Hhe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function g1(t,e,r={}){const n=(i,s,a)=>{const o=Hhe[s];if(typeof o!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(a&&c===void 0)&&!o(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const zhe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Fhe,bitLen:Bhe,bitMask:w5,bitSet:qhe,bytesToHex:Tg,bytesToNumberBE:xh,bytesToNumberLE:v5,concatBytes:fb,createHmacDrbg:gY,ensureBytes:rc,equalBytes:Uhe,hexToBytes:Cg,hexToNumber:y5,numberToBytesBE:Rg,numberToBytesLE:b5,numberToHexUnpadded:pY,numberToVarBytesBE:Lhe,utf8ToBytes:jhe,validateObject:g1},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ki=BigInt(0),_i=BigInt(1),Ld=BigInt(2),Vhe=BigInt(3),KR=BigInt(4),s9=BigInt(5),a9=BigInt(8);BigInt(9);BigInt(16);function ga(t,e){const r=t%e;return r>=Ki?r:e+r}function Ghe(t,e,r){if(r<=Ki||e<Ki)throw new Error("Expected power/modulo > 0");if(r===_i)return Ki;let n=_i;for(;e>Ki;)e&_i&&(n=n*t%r),t=t*t%r,e>>=_i;return n}function io(t,e,r){let n=t;for(;e-- >Ki;)n*=n,n%=r;return n}function WR(t,e){if(t===Ki||e<=Ki)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=ga(t,e),n=e,i=Ki,s=_i;for(;r!==Ki;){const o=n/r,c=n%r,u=i-s*o;n=r,r=c,i=s,s=u}if(n!==_i)throw new Error("invert: does not exist");return ga(i,e)}function Khe(t){const e=(t-_i)/Ld;let r,n,i;for(r=t-_i,n=0;r%Ld===Ki;r/=Ld,n++);for(i=Ld;i<t&&Ghe(i,e,t)!==t-_i;i++);if(n===1){const a=(t+_i)/KR;return function(c,u){const f=c.pow(u,a);if(!c.eql(c.sqr(f),u))throw new Error("Cannot find square root");return f}}const s=(r+_i)/Ld;return function(o,c){if(o.pow(c,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let u=n,f=o.pow(o.mul(o.ONE,i),r),h=o.pow(c,s),m=o.pow(c,r);for(;!o.eql(m,o.ONE);){if(o.eql(m,o.ZERO))return o.ZERO;let y=1;for(let v=o.sqr(m);y<u&&!o.eql(v,o.ONE);y++)v=o.sqr(v);const w=o.pow(f,_i<<BigInt(u-y-1));f=o.sqr(w),h=o.mul(h,w),m=o.mul(m,f),u=y}return h}}function Whe(t){if(t%KR===Vhe){const e=(t+_i)/KR;return function(n,i){const s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%a9===s9){const e=(t-s9)/a9;return function(n,i){const s=n.mul(i,Ld),a=n.pow(s,e),o=n.mul(i,a),c=n.mul(n.mul(o,Ld),a),u=n.mul(o,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return Khe(t)}const Yhe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Qhe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Yhe.reduce((n,i)=>(n[i]="function",n),e);return g1(t,r)}function Jhe(t,e,r){if(r<Ki)throw new Error("Expected power > 0");if(r===Ki)return t.ONE;if(r===_i)return e;let n=t.ONE,i=e;for(;r>Ki;)r&_i&&(n=t.mul(n,i)),i=t.sqr(i),r>>=_i;return n}function Xhe(t,e){const r=new Array(e.length),n=e.reduce((s,a,o)=>t.is0(a)?s:(r[o]=s,t.mul(s,a)),t.ONE),i=t.inv(n);return e.reduceRight((s,a,o)=>t.is0(a)?s:(r[o]=t.mul(s,r[o]),t.mul(s,a)),i),r}function mY(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Zhe(t,e,r=!1,n={}){if(t<=Ki)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=mY(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Whe(t),o=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:w5(i),ZERO:Ki,ONE:_i,create:c=>ga(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ki<=c&&c<t},is0:c=>c===Ki,isOdd:c=>(c&_i)===_i,neg:c=>ga(-c,t),eql:(c,u)=>c===u,sqr:c=>ga(c*c,t),add:(c,u)=>ga(c+u,t),sub:(c,u)=>ga(c-u,t),mul:(c,u)=>ga(c*u,t),pow:(c,u)=>Jhe(o,c,u),div:(c,u)=>ga(c*WR(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>WR(c,t),sqrt:n.sqrt||(c=>a(o,c)),invertBatch:c=>Xhe(o,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>r?b5(c,s):Rg(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?v5(c):xh(c)}});return Object.freeze(o)}function yY(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function vY(t){const e=yY(t);return e+Math.ceil(e/2)}function epe(t,e,r=!1){const n=t.length,i=yY(e),s=vY(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const a=r?xh(t):v5(t),o=ga(a,e-_i)+_i;return r?b5(o,i):Rg(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tpe=BigInt(0),hO=BigInt(1);function rpe(t,e){const r=(i,s)=>{const a=s.negate();return i?a:s},n=i=>{const s=Math.ceil(e/i)+1,a=2**(i-1);return{windows:s,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,s){let a=t.ZERO,o=i;for(;s>tpe;)s&hO&&(a=a.add(o)),o=o.double(),s>>=hO;return a},precomputeWindow(i,s){const{windows:a,windowSize:o}=n(s),c=[];let u=i,f=u;for(let h=0;h<a;h++){f=u,c.push(f);for(let m=1;m<o;m++)f=f.add(u),c.push(f);u=f.double()}return c},wNAF(i,s,a){const{windows:o,windowSize:c}=n(i);let u=t.ZERO,f=t.BASE;const h=BigInt(2**i-1),m=2**i,y=BigInt(i);for(let w=0;w<o;w++){const v=w*c;let g=Number(a&h);a>>=y,g>c&&(g-=m,a+=hO);const _=v,b=v+Math.abs(g)-1,S=w%2!==0,A=g<0;g===0?f=f.add(r(S,s[_])):u=u.add(r(A,s[b]))}return{p:u,f}},wNAFCached(i,s,a,o){const c=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,o(u))),this.wNAF(c,u,a)}}}function bY(t){return Qhe(t.Fp),g1(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...mY(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function npe(t){const e=bY(t);g1(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:ipe,hexToBytes:spe}=zhe,Yd={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Yd;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:ipe(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=Yd,r=typeof t=="string"?spe(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Yd._parseInt(r.subarray(2)),{d:a,l:o}=Yd._parseInt(s);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const f=u.toString(16);return f.length&1?`0${f}`:f},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,a=i.length/2,o=r(s),c=r(a);return`30${r(a+s+4)}02${c}${i}02${o}${n}`}},Zu=BigInt(0),wo=BigInt(1);BigInt(2);const o9=BigInt(3);BigInt(4);function ape(t){const e=npe(t),{Fp:r}=e,n=e.toBytes||((w,v,g)=>{const _=v.toAffine();return fb(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),i=e.fromBytes||(w=>{const v=w.subarray(1),g=r.fromBytes(v.subarray(0,r.BYTES)),_=r.fromBytes(v.subarray(r.BYTES,2*r.BYTES));return{x:g,y:_}});function s(w){const{a:v,b:g}=e,_=r.sqr(w),b=r.mul(_,w);return r.add(r.add(b,r.mul(w,v)),g)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function a(w){return typeof w=="bigint"&&Zu<w&&w<e.n}function o(w){if(!a(w))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(w){const{allowedPrivateKeyLengths:v,nByteLength:g,wrapPrivateKey:_,n:b}=e;if(v&&typeof w!="bigint"){if(w instanceof Uint8Array&&(w=Tg(w)),typeof w!="string"||!v.includes(w.length))throw new Error("Invalid key");w=w.padStart(g*2,"0")}let S;try{S=typeof w=="bigint"?w:xh(rc("private key",w,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof w}`)}return _&&(S=ga(S,b)),o(S),S}const u=new Map;function f(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}class h{constructor(v,g,_){if(this.px=v,this.py=g,this.pz=_,v==null||!r.isValid(v))throw new Error("x required");if(g==null||!r.isValid(g))throw new Error("y required");if(_==null||!r.isValid(_))throw new Error("z required")}static fromAffine(v){const{x:g,y:_}=v||{};if(!v||!r.isValid(g)||!r.isValid(_))throw new Error("invalid affine point");if(v instanceof h)throw new Error("projective point not allowed");const b=S=>r.eql(S,r.ZERO);return b(g)&&b(_)?h.ZERO:new h(g,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(v){const g=r.invertBatch(v.map(_=>_.pz));return v.map((_,b)=>_.toAffine(g[b])).map(h.fromAffine)}static fromHex(v){const g=h.fromAffine(i(rc("pointHex",v)));return g.assertValidity(),g}static fromPrivateKey(v){return h.BASE.multiply(c(v))}_setWindowSize(v){this._WINDOW_SIZE=v,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:v,y:g}=this.toAffine();if(!r.isValid(v)||!r.isValid(g))throw new Error("bad point: x or y not FE");const _=r.sqr(g),b=s(v);if(!r.eql(_,b))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:v}=this.toAffine();if(r.isOdd)return!r.isOdd(v);throw new Error("Field doesn't support isOdd")}equals(v){f(v);const{px:g,py:_,pz:b}=this,{px:S,py:A,pz:O}=v,E=r.eql(r.mul(g,O),r.mul(S,b)),p=r.eql(r.mul(_,O),r.mul(A,b));return E&&p}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:v,b:g}=e,_=r.mul(g,o9),{px:b,py:S,pz:A}=this;let O=r.ZERO,E=r.ZERO,p=r.ZERO,I=r.mul(b,b),N=r.mul(S,S),B=r.mul(A,A),V=r.mul(b,S);return V=r.add(V,V),p=r.mul(b,A),p=r.add(p,p),O=r.mul(v,p),E=r.mul(_,B),E=r.add(O,E),O=r.sub(N,E),E=r.add(N,E),E=r.mul(O,E),O=r.mul(V,O),p=r.mul(_,p),B=r.mul(v,B),V=r.sub(I,B),V=r.mul(v,V),V=r.add(V,p),p=r.add(I,I),I=r.add(p,I),I=r.add(I,B),I=r.mul(I,V),E=r.add(E,I),B=r.mul(S,A),B=r.add(B,B),I=r.mul(B,V),O=r.sub(O,I),p=r.mul(B,N),p=r.add(p,p),p=r.add(p,p),new h(O,E,p)}add(v){f(v);const{px:g,py:_,pz:b}=this,{px:S,py:A,pz:O}=v;let E=r.ZERO,p=r.ZERO,I=r.ZERO;const N=e.a,B=r.mul(e.b,o9);let V=r.mul(g,S),de=r.mul(_,A),ve=r.mul(b,O),j=r.add(g,_),L=r.add(S,A);j=r.mul(j,L),L=r.add(V,de),j=r.sub(j,L),L=r.add(g,b);let Y=r.add(S,O);return L=r.mul(L,Y),Y=r.add(V,ve),L=r.sub(L,Y),Y=r.add(_,b),E=r.add(A,O),Y=r.mul(Y,E),E=r.add(de,ve),Y=r.sub(Y,E),I=r.mul(N,L),E=r.mul(B,ve),I=r.add(E,I),E=r.sub(de,I),I=r.add(de,I),p=r.mul(E,I),de=r.add(V,V),de=r.add(de,V),ve=r.mul(N,ve),L=r.mul(B,L),de=r.add(de,ve),ve=r.sub(V,ve),ve=r.mul(N,ve),L=r.add(L,ve),V=r.mul(de,L),p=r.add(p,V),V=r.mul(Y,L),E=r.mul(j,E),E=r.sub(E,V),V=r.mul(j,de),I=r.mul(Y,I),I=r.add(I,V),new h(E,p,I)}subtract(v){return this.add(v.negate())}is0(){return this.equals(h.ZERO)}wNAF(v){return y.wNAFCached(this,u,v,g=>{const _=r.invertBatch(g.map(b=>b.pz));return g.map((b,S)=>b.toAffine(_[S])).map(h.fromAffine)})}multiplyUnsafe(v){const g=h.ZERO;if(v===Zu)return g;if(o(v),v===wo)return this;const{endo:_}=e;if(!_)return y.unsafeLadder(this,v);let{k1neg:b,k1:S,k2neg:A,k2:O}=_.splitScalar(v),E=g,p=g,I=this;for(;S>Zu||O>Zu;)S&wo&&(E=E.add(I)),O&wo&&(p=p.add(I)),I=I.double(),S>>=wo,O>>=wo;return b&&(E=E.negate()),A&&(p=p.negate()),p=new h(r.mul(p.px,_.beta),p.py,p.pz),E.add(p)}multiply(v){o(v);let g=v,_,b;const{endo:S}=e;if(S){const{k1neg:A,k1:O,k2neg:E,k2:p}=S.splitScalar(g);let{p:I,f:N}=this.wNAF(O),{p:B,f:V}=this.wNAF(p);I=y.constTimeNegate(A,I),B=y.constTimeNegate(E,B),B=new h(r.mul(B.px,S.beta),B.py,B.pz),_=I.add(B),b=N.add(V)}else{const{p:A,f:O}=this.wNAF(g);_=A,b=O}return h.normalizeZ([_,b])[0]}multiplyAndAddUnsafe(v,g,_){const b=h.BASE,S=(O,E)=>E===Zu||E===wo||!O.equals(b)?O.multiplyUnsafe(E):O.multiply(E),A=S(this,g).add(S(v,_));return A.is0()?void 0:A}toAffine(v){const{px:g,py:_,pz:b}=this,S=this.is0();v==null&&(v=S?r.ONE:r.inv(b));const A=r.mul(g,v),O=r.mul(_,v),E=r.mul(b,v);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(E,r.ONE))throw new Error("invZ was invalid");return{x:A,y:O}}isTorsionFree(){const{h:v,isTorsionFree:g}=e;if(v===wo)return!0;if(g)return g(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:v,clearCofactor:g}=e;return v===wo?this:g?g(h,this):this.multiplyUnsafe(e.h)}toRawBytes(v=!0){return this.assertValidity(),n(h,this,v)}toHex(v=!0){return Tg(this.toRawBytes(v))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const m=e.nBitLength,y=rpe(h,e.endo?Math.ceil(m/2):m);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:a}}function ope(t){const e=bY(t);return g1(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function cpe(t){const e=ope(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function a(L){return Zu<L&&L<r.ORDER}function o(L){return ga(L,n)}function c(L){return WR(L,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:h,isWithinCurveOrder:m}=ape({...e,toBytes(L,Y,ne){const U=Y.toAffine(),F=r.toBytes(U.x),H=fb;return ne?H(Uint8Array.from([Y.hasEvenY()?2:3]),F):H(Uint8Array.from([4]),F,r.toBytes(U.y))},fromBytes(L){const Y=L.length,ne=L[0],U=L.subarray(1);if(Y===i&&(ne===2||ne===3)){const F=xh(U);if(!a(F))throw new Error("Point is not on curve");const H=h(F);let M=r.sqrt(H);const q=(M&wo)===wo;return(ne&1)===1!==q&&(M=r.neg(M)),{x:F,y:M}}else if(Y===s&&ne===4){const F=r.fromBytes(U.subarray(0,r.BYTES)),H=r.fromBytes(U.subarray(r.BYTES,2*r.BYTES));return{x:F,y:H}}else throw new Error(`Point of length ${Y} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),y=L=>Tg(Rg(L,e.nByteLength));function w(L){const Y=n>>wo;return L>Y}function v(L){return w(L)?o(-L):L}const g=(L,Y,ne)=>xh(L.slice(Y,ne));class _{constructor(Y,ne,U){this.r=Y,this.s=ne,this.recovery=U,this.assertValidity()}static fromCompact(Y){const ne=e.nByteLength;return Y=rc("compactSignature",Y,ne*2),new _(g(Y,0,ne),g(Y,ne,2*ne))}static fromDER(Y){const{r:ne,s:U}=Yd.toSig(rc("DER",Y));return new _(ne,U)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Y){return new _(this.r,this.s,Y)}recoverPublicKey(Y){const{r:ne,s:U,recovery:F}=this,H=p(rc("msgHash",Y));if(F==null||![0,1,2,3].includes(F))throw new Error("recovery id invalid");const M=F===2||F===3?ne+e.n:ne;if(M>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const q=F&1?"03":"02",$=u.fromHex(q+y(M)),k=c(M),G=o(-H*k),pe=o(U*k),Q=u.BASE.multiplyAndAddUnsafe($,G,pe);if(!Q)throw new Error("point at infinify");return Q.assertValidity(),Q}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Cg(this.toDERHex())}toDERHex(){return Yd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Cg(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const b={isValidPrivateKey(L){try{return f(L),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const L=vY(e.n);return epe(e.randomBytes(L),e.n)},precompute(L=8,Y=u.BASE){return Y._setWindowSize(L),Y.multiply(BigInt(3)),Y}};function S(L,Y=!0){return u.fromPrivateKey(L).toRawBytes(Y)}function A(L){const Y=L instanceof Uint8Array,ne=typeof L=="string",U=(Y||ne)&&L.length;return Y?U===i||U===s:ne?U===2*i||U===2*s:L instanceof u}function O(L,Y,ne=!0){if(A(L))throw new Error("first arg must be private key");if(!A(Y))throw new Error("second arg must be public key");return u.fromHex(Y).multiply(f(L)).toRawBytes(ne)}const E=e.bits2int||function(L){const Y=xh(L),ne=L.length*8-e.nBitLength;return ne>0?Y>>BigInt(ne):Y},p=e.bits2int_modN||function(L){return o(E(L))},I=w5(e.nBitLength);function N(L){if(typeof L!="bigint")throw new Error("bigint expected");if(!(Zu<=L&&L<I))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Rg(L,e.nByteLength)}function B(L,Y,ne=V){if(["recovered","canonical"].some(ce=>ce in ne))throw new Error("sign() legacy options not supported");const{hash:U,randomBytes:F}=e;let{lowS:H,prehash:M,extraEntropy:q}=ne;H==null&&(H=!0),L=rc("msgHash",L),M&&(L=rc("prehashed msgHash",U(L)));const $=p(L),k=f(Y),G=[N(k),N($)];if(q!=null){const ce=q===!0?F(r.BYTES):q;G.push(rc("extraEntropy",ce))}const pe=fb(...G),Q=$;function te(ce){const T=E(ce);if(!m(T))return;const le=c(T),Ge=u.BASE.multiply(T).toAffine(),tt=o(Ge.x);if(tt===Zu)return;const yt=o(le*o(Q+tt*k));if(yt===Zu)return;let vt=(Ge.x===tt?0:2)|Number(Ge.y&wo),gt=yt;return H&&w(yt)&&(gt=v(yt),vt^=1),new _(tt,gt,vt)}return{seed:pe,k2sig:te}}const V={lowS:e.lowS,prehash:!1},de={lowS:e.lowS,prehash:!1};function ve(L,Y,ne=V){const{seed:U,k2sig:F}=B(L,Y,ne),H=e;return gY(H.hash.outputLen,H.nByteLength,H.hmac)(U,F)}u.BASE._setWindowSize(8);function j(L,Y,ne,U=de){var Ge;const F=L;if(Y=rc("msgHash",Y),ne=rc("publicKey",ne),"strict"in U)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:M}=U;let q,$;try{if(typeof F=="string"||F instanceof Uint8Array)try{q=_.fromDER(F)}catch(tt){if(!(tt instanceof Yd.Err))throw tt;q=_.fromCompact(F)}else if(typeof F=="object"&&typeof F.r=="bigint"&&typeof F.s=="bigint"){const{r:tt,s:yt}=F;q=new _(tt,yt)}else throw new Error("PARSE");$=u.fromHex(ne)}catch(tt){if(tt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&q.hasHighS())return!1;M&&(Y=e.hash(Y));const{r:k,s:G}=q,pe=p(Y),Q=c(G),te=o(pe*Q),ce=o(k*Q),T=(Ge=u.BASE.multiplyAndAddUnsafe($,te,ce))==null?void 0:Ge.toAffine();return T?o(T.x)===k:!1}return{CURVE:e,getPublicKey:S,getSharedSecret:O,sign:ve,verify:j,ProjectivePoint:u,Signature:_,utils:b}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function upe(t){return{hash:t,hmac:(e,...r)=>n2(t,e,Mde(...r)),randomBytes:$de}}function lpe(t,e){const r=n=>cpe({...t,...upe(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wY=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),c9=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),fpe=BigInt(1),YR=BigInt(2),u9=(t,e)=>(t+e/YR)/e;function dpe(t){const e=wY,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,h=io(f,r,e)*f%e,m=io(h,r,e)*f%e,y=io(m,YR,e)*u%e,w=io(y,i,e)*y%e,v=io(w,s,e)*w%e,g=io(v,o,e)*v%e,_=io(g,c,e)*g%e,b=io(_,o,e)*v%e,S=io(b,r,e)*f%e,A=io(S,a,e)*w%e,O=io(A,n,e)*u%e,E=io(O,YR,e);if(!QR.eql(QR.sqr(E),t))throw new Error("Cannot find square root");return E}const QR=Zhe(wY,void 0,void 0,{sqrt:dpe}),Yl=lpe({a:BigInt(0),b:BigInt(7),Fp:QR,n:c9,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=c9,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-fpe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),o=u9(s*t,e),c=u9(-n*t,e);let u=ga(t-o*r-c*i,e),f=ga(-o*n-c*s,e);const h=u>a,m=f>a;if(h&&(u=e-u),m&&(f=e-f),u>a||f>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:m,k2:f}}}},rm);BigInt(0);Yl.ProjectivePoint;const JR="0x0000000000000000000000000000000000000000",l9="0x0000000000000000000000000000000000000000000000000000000000000000",hpe=`Ethereum Signed Message:
69
- `,f9=BigInt(0),d9=BigInt(1),h9=BigInt(2),p9=BigInt(27),g9=BigInt(28),Kw=BigInt(35),Op={};function m9(t){return Ch(ba(t),32)}var q0,H0,z0,oh;const Zo=class Zo{constructor(e,r,n,i){Je(this,q0,void 0);Je(this,H0,void 0);Je(this,z0,void 0);Je(this,oh,void 0);Gf(e,Op,"Signature"),Te(this,q0,r),Te(this,H0,n),Te(this,z0,i),Te(this,oh,null)}get r(){return W(this,q0)}set r(e){Ne(E0(e)===32,"invalid r","value",e),Te(this,q0,_t(e))}get s(){return W(this,H0)}set s(e){Ne(E0(e)===32,"invalid s","value",e);const r=_t(e);Ne(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),Te(this,H0,r)}get v(){return W(this,z0)}set v(e){const r=jr(e,"value");Ne(r===27||r===28,"invalid v","v",e),Te(this,z0,r)}get networkV(){return W(this,oh)}get legacyChainId(){const e=this.networkV;return e==null?null:Zo.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ht(this.s);return this.yParity&&(e[0]|=128),_t(e)}get compactSerialized(){return Hn([this.r,this.yParityAndS])}get serialized(){return Hn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Zo(Op,this.r,this.s,this.v);return this.networkV&&Te(e,oh,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=nr(e,"v");return r==p9||r==g9?f9:(Ne(r>=Kw,"invalid EIP-155 v","v",e),(r-Kw)/h9)}static getChainIdV(e,r){return nr(e)*h9+BigInt(35+r-27)}static getNormalizedV(e){const r=nr(e);return r===f9||r===p9?27:r===d9||r===g9?28:(Ne(r>=Kw,"invalid v","v",e),r&d9?27:28)}static from(e){function r(u,f){Ne(u,f,"signature",e)}if(e==null)return new Zo(Op,l9,l9,27);if(typeof e=="string"){const u=Ht(e,"signature");if(u.length===64){const f=_t(u.slice(0,32)),h=u.slice(32,64),m=h[0]&128?28:27;return h[0]&=127,new Zo(Op,f,_t(h),m)}if(u.length===65){const f=_t(u.slice(0,32)),h=u.slice(32,64);r((h[0]&128)===0,"non-canonical s");const m=Zo.getNormalizedV(u[64]);return new Zo(Op,f,_t(h),m)}r(!1,"invalid raw signature length")}if(e instanceof Zo)return e.clone();const n=e.r;r(n!=null,"missing r");const i=m9(n),s=function(u,f){if(u!=null)return m9(u);if(f!=null){r(ci(f,32),"invalid yParityAndS");const h=Ht(f);return h[0]&=127,_t(h)}r(!1,"missing s")}(e.s,e.yParityAndS);r((Ht(s)[0]&128)==0,"non-canonical s");const{networkV:a,v:o}=function(u,f,h){if(u!=null){const m=nr(u);return{networkV:m>=Kw?m:void 0,v:Zo.getNormalizedV(m)}}if(f!=null)return r(ci(f,32),"invalid yParityAndS"),{v:Ht(f)[0]&128?28:27};if(h!=null){switch(jr(h,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Zo(Op,i,s,o);return a&&Te(c,oh,a),r(e.yParity==null||jr(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};q0=new WeakMap,H0=new WeakMap,z0=new WeakMap,oh=new WeakMap;let bc=Zo;var Hu;const Fd=class Fd{constructor(e){Je(this,Hu,void 0);Ne(E0(e)===32,"invalid private key","privateKey","[REDACTED]"),Te(this,Hu,_t(e))}get privateKey(){return W(this,Hu)}get publicKey(){return Fd.computePublicKey(W(this,Hu))}get compressedPublicKey(){return Fd.computePublicKey(W(this,Hu),!0)}sign(e){Ne(E0(e)===32,"invalid digest length","digest",e);const r=Yl.sign(Ns(e),Ns(W(this,Hu)),{lowS:!0});return bc.from({r:dl(r.r,32),s:dl(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Fd.computePublicKey(e);return _t(Yl.getSharedSecret(Ns(W(this,Hu)),Ht(r),!1))}static computePublicKey(e,r){let n=Ht(e,"key");if(n.length===32){const s=Yl.getPublicKey(n,!!r);return _t(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=Yl.ProjectivePoint.fromHex(n);return _t(i.toRawBytes(r))}static recoverPublicKey(e,r){Ne(E0(e)===32,"invalid digest length","digest",e);const n=bc.from(r);let i=Yl.Signature.fromCompact(Ns(Hn([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Ns(e));return Ne(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=Yl.ProjectivePoint.fromHex(Fd.computePublicKey(e).substring(2)),s=Yl.ProjectivePoint.fromHex(Fd.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};Hu=new WeakMap;let tu=Fd;const ppe=BigInt(0),gpe=BigInt(36);function y9(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Ht(qn(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const _5={};for(let t=0;t<10;t++)_5[String(t)]=String(t);for(let t=0;t<26;t++)_5[String.fromCharCode(65+t)]=String(10+t);const v9=15;function mpe(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>_5[n]).join("");for(;e.length>=v9;){let n=e.substring(0,v9);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const ype=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function vpe(t){t=t.toLowerCase();let e=ppe;for(let r=0;r<t.length;r++)e=e*gpe+ype[t[r]];return e}function cn(t){if(Ne(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=y9(t);return Ne(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Ne(t.substring(2,4)===mpe(t),"bad icap checksum","address",t);let e=vpe(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return y9("0x"+e)}Ne(!1,"invalid address","address",t)}function bpe(t){const e=cn(t.from);let n=nr(t.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,cn(Kn(qn(lb([e,n])),12))}function _Y(t){return t&&typeof t.getAddress=="function"}async function pO(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(st(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),Ne(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),cn(r)}function fs(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?cn(t):(st(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),pO(t,e.resolveName(t)));if(_Y(t))return pO(t,t.getAddress());if(t&&typeof t.then=="function")return pO(t,t);Ne(!1,"unsupported addressable value","target",t)}const Du={};function Ut(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new ks(Du,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function mn(t,e){return new ks(Du,`bytes${e||""}`,t,{size:e})}const b9=Symbol.for("_ethers_typed");var ch;const ku=class ku{constructor(e,r,n,i){Fe(this,"type");Fe(this,"value");Je(this,ch,void 0);Fe(this,"_typedSymbol");i==null&&(i=null),Gf(Du,e,"Typed"),Qt(this,{_typedSymbol:b9,type:r,value:n}),Te(this,ch,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return W(this,ch)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return W(this,ch)===!0?-1:W(this,ch)===!1?this.value.length:null}static from(e,r){return new ku(Du,e,r)}static uint8(e){return Ut(e,8)}static uint16(e){return Ut(e,16)}static uint24(e){return Ut(e,24)}static uint32(e){return Ut(e,32)}static uint40(e){return Ut(e,40)}static uint48(e){return Ut(e,48)}static uint56(e){return Ut(e,56)}static uint64(e){return Ut(e,64)}static uint72(e){return Ut(e,72)}static uint80(e){return Ut(e,80)}static uint88(e){return Ut(e,88)}static uint96(e){return Ut(e,96)}static uint104(e){return Ut(e,104)}static uint112(e){return Ut(e,112)}static uint120(e){return Ut(e,120)}static uint128(e){return Ut(e,128)}static uint136(e){return Ut(e,136)}static uint144(e){return Ut(e,144)}static uint152(e){return Ut(e,152)}static uint160(e){return Ut(e,160)}static uint168(e){return Ut(e,168)}static uint176(e){return Ut(e,176)}static uint184(e){return Ut(e,184)}static uint192(e){return Ut(e,192)}static uint200(e){return Ut(e,200)}static uint208(e){return Ut(e,208)}static uint216(e){return Ut(e,216)}static uint224(e){return Ut(e,224)}static uint232(e){return Ut(e,232)}static uint240(e){return Ut(e,240)}static uint248(e){return Ut(e,248)}static uint256(e){return Ut(e,256)}static uint(e){return Ut(e,256)}static int8(e){return Ut(e,-8)}static int16(e){return Ut(e,-16)}static int24(e){return Ut(e,-24)}static int32(e){return Ut(e,-32)}static int40(e){return Ut(e,-40)}static int48(e){return Ut(e,-48)}static int56(e){return Ut(e,-56)}static int64(e){return Ut(e,-64)}static int72(e){return Ut(e,-72)}static int80(e){return Ut(e,-80)}static int88(e){return Ut(e,-88)}static int96(e){return Ut(e,-96)}static int104(e){return Ut(e,-104)}static int112(e){return Ut(e,-112)}static int120(e){return Ut(e,-120)}static int128(e){return Ut(e,-128)}static int136(e){return Ut(e,-136)}static int144(e){return Ut(e,-144)}static int152(e){return Ut(e,-152)}static int160(e){return Ut(e,-160)}static int168(e){return Ut(e,-168)}static int176(e){return Ut(e,-176)}static int184(e){return Ut(e,-184)}static int192(e){return Ut(e,-192)}static int200(e){return Ut(e,-200)}static int208(e){return Ut(e,-208)}static int216(e){return Ut(e,-216)}static int224(e){return Ut(e,-224)}static int232(e){return Ut(e,-232)}static int240(e){return Ut(e,-240)}static int248(e){return Ut(e,-248)}static int256(e){return Ut(e,-256)}static int(e){return Ut(e,-256)}static bytes1(e){return mn(e,1)}static bytes2(e){return mn(e,2)}static bytes3(e){return mn(e,3)}static bytes4(e){return mn(e,4)}static bytes5(e){return mn(e,5)}static bytes6(e){return mn(e,6)}static bytes7(e){return mn(e,7)}static bytes8(e){return mn(e,8)}static bytes9(e){return mn(e,9)}static bytes10(e){return mn(e,10)}static bytes11(e){return mn(e,11)}static bytes12(e){return mn(e,12)}static bytes13(e){return mn(e,13)}static bytes14(e){return mn(e,14)}static bytes15(e){return mn(e,15)}static bytes16(e){return mn(e,16)}static bytes17(e){return mn(e,17)}static bytes18(e){return mn(e,18)}static bytes19(e){return mn(e,19)}static bytes20(e){return mn(e,20)}static bytes21(e){return mn(e,21)}static bytes22(e){return mn(e,22)}static bytes23(e){return mn(e,23)}static bytes24(e){return mn(e,24)}static bytes25(e){return mn(e,25)}static bytes26(e){return mn(e,26)}static bytes27(e){return mn(e,27)}static bytes28(e){return mn(e,28)}static bytes29(e){return mn(e,29)}static bytes30(e){return mn(e,30)}static bytes31(e){return mn(e,31)}static bytes32(e){return mn(e,32)}static address(e){return new ku(Du,"address",e)}static bool(e){return new ku(Du,"bool",!!e)}static bytes(e){return new ku(Du,"bytes",e)}static string(e){return new ku(Du,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new ku(Du,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===b9}static dereference(e,r){if(ku.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};ch=new WeakMap;let ks=ku;class wpe extends bl{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=ks.dereference(r,"string");try{n=cn(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return cn(dl(e.readValue(),20))}}class _pe extends bl{constructor(r){super(r.name,r.type,"_",r.dynamic);Fe(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function EY(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(u=>{const f=u.localName;return st(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),st(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),c[f]=!0,r[f]})}else Ne(!1,"invalid tuple value","tuple",r);Ne(e.length===n.length,"types/value length mismatch","tuple",r);let i=new zR,s=new zR,a=[];e.forEach((c,u)=>{let f=n[u];if(c.dynamic){let h=s.length;c.encode(s,f);let m=i.writeUpdatableValue();a.push(y=>{m(y+h)})}else c.encode(i,f)}),a.forEach(c=>{c(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(s),o}function xY(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let a=null;if(s.dynamic){let o=t.readIndex(),c=i.subReader(o);try{a=s.decode(c)}catch(u){if(Io(u,"BUFFER_OVERRUN"))throw u;a=u,a.baseType=s.name,a.name=s.localName,a.type=s.type}}else try{a=s.decode(t)}catch(o){if(Io(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=s.name,a.name=s.localName,a.type=s.type}if(a==null)throw new Error("investigate");r.push(a),n.push(s.localName||null)}),VE.fromItems(r,n)}class Epe extends bl{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",a=n===-1||r.dynamic;super("array",s,i,a);Fe(this,"coder");Fe(this,"length");Qt(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;i<this.length;i++)n.push(r);return n}encode(r,n){const i=ks.dereference(n,"array");Array.isArray(i)||this._throwError("expected array value",i);let s=this.length;s===-1&&(s=i.length,r.writeValue(i.length)),uW(i.length,s,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<i.length;o++)a.push(this.coder);return EY(r,a,i)}decode(r){let n=this.length;n===-1&&(n=r.readIndex(),st(n*Ys<=r.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:r.bytes,offset:n*Ys,length:r.dataLength}));let i=[];for(let s=0;s<n;s++)i.push(new _pe(this.coder));return xY(r,i)}}class xpe extends bl{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=ks.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class AY extends bl{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Ns(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class Ape extends AY{constructor(e){super("bytes",e)}decode(e){return _t(super.decode(e))}}class Spe extends bl{constructor(r,n){let i="bytes"+String(r);super(i,i,n,!1);Fe(this,"size");Qt(this,{size:r},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(r,n){let i=Ns(ks.dereference(n,this.type));return i.length!==this.size&&this._throwError("incorrect data length",n),r.writeBytes(i)}decode(r){return _t(r.readBytes(this.size))}}const Ope=new Uint8Array([]);class Ipe extends bl{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(Ope)}decode(e){return e.readBytes(0),null}}const Ppe=BigInt(0),Tpe=BigInt(1),Cpe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Rpe extends bl{constructor(r,n,i){const s=(n?"int":"uint")+r*8;super(s,s,i,!1);Fe(this,"size");Fe(this,"signed");Qt(this,{size:r,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(r,n){let i=nr(ks.dereference(n,this.type)),s=Wd(Cpe,Ys*8);if(this.signed){let a=Wd(s,this.size*8-1);(i>a||i<-(a+Tpe))&&this._throwError("value out-of-bounds",n),i=pW(i,8*Ys)}else(i<Ppe||i>Wd(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=Wd(r.readValue(),this.size*8);return this.signed&&(n=zE(n,this.size*8)),n}}class Npe extends AY{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Xs(ks.dereference(r,"string")))}decode(e){return o5(super.decode(e))}}class Ww extends bl{constructor(r,n){let i=!1;const s=[];r.forEach(o=>{o.dynamic&&(i=!0),s.push(o.type)});const a="tuple("+s.join(",")+")";super("tuple",a,n,i);Fe(this,"coders");Qt(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const a=s.localName;return a&&(i[a]||(i[a]=0),i[a]++),i},{});return this.coders.forEach((i,s)=>{let a=i.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),r[a]==null&&(r[a]=r[s]))}),Object.freeze(r)}encode(r,n){const i=ks.dereference(n,"tuple");return EY(r,this.coders,i)}decode(r){return xY(r,this.coders)}}function hl(t){return qn(Xs(t))}var Dpe="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const w9=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),_9=4;function Mpe(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let O=1;O<n;O++)s.push(i+=r());let a=r(),o=e;e+=a;let c=0,u=0;function f(){return c==0&&(u=u<<8|t[e++],c=8),u>>--c&1}const h=31,m=2**h,y=m>>>1,w=y>>1,v=m-1;let g=0;for(let O=0;O<h;O++)g=g<<1|f();let _=[],b=0,S=m;for(;;){let O=Math.floor(((g-b+1)*i-1)/S),E=0,p=n;for(;p-E>1;){let B=E+p>>>1;O<s[B]?p=B:E=B}if(E==0)break;_.push(E);let I=b+Math.floor(S*s[E]/i),N=b+Math.floor(S*s[E+1]/i)-1;for(;!((I^N)&y);)g=g<<1&v|f(),I=I<<1&v,N=N<<1&v|1;for(;I&~N&w;)g=g&y|g<<1&v>>>1|f(),I=I<<1^y,N=(N^y)<<1|y|1;b=I,S=1+N-I}let A=n-4;return _.map(O=>{switch(O-A){case 3:return A+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return A+256+(t[o++]<<8|t[o++]);case 1:return A+t[o++];default:return O-1}})}function kpe(t){let e=0;return()=>t[e++]}function SY(t){return kpe(Mpe($pe(t)))}function $pe(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,a=0,o=0;i<r;i++)o=o<<6|e[t.charCodeAt(i)],a+=6,a>=8&&(n[s++]=o>>(a-=8));return n}function Lpe(t){return t&1?~t>>1:t>>1}function Upe(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=Lpe(e());return r}function db(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let s=0;s<i;s++)r.push(e+s);e+=i+1}return r}function OY(t){return hb(()=>{let e=db(t);if(e.length)return e})}function IY(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(jpe(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(Bpe(r,t))}return e.flat()}function hb(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function PY(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)Upe(t,r).forEach((s,a)=>n[a].push(s));return n}function jpe(t,e){let r=1+e(),n=e(),i=hb(e);return PY(i.length,1+t,e).flatMap((a,o)=>{let[c,...u]=a;return Array(i[o]).fill().map((f,h)=>{let m=h*n;return[c+h*r,u.map(y=>y+m)]})})}function Bpe(t,e){let r=1+e();return PY(r,1+t,e).map(i=>[i[0],i.slice(1)])}function Fpe(t){let e=[],r=db(t);return i(n([]),[]),e;function n(s){let a=t(),o=hb(()=>{let c=db(t).map(u=>r[u]);if(c.length)return n(c)});return{S:a,B:o,Q:s}}function i({S:s,B:a},o,c){if(!(s&4&&c===o[o.length-1])){s&2&&(c=o[o.length-1]),s&1&&e.push(o);for(let u of a)for(let f of u.Q)i(u,[...o,f],c)}}}function qpe(t){return t.toString(16).toUpperCase().padStart(2,"0")}function TY(t){return`{${qpe(t)}}`}function Hpe(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function Ng(t){let r=t.length;if(r<4096)return String.fromCodePoint(...t);let n=[];for(let i=0;i<r;)n.push(String.fromCodePoint(...t.slice(i,i+=4096)));return n.join("")}function zpe(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var Vpe="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const pb=44032,GE=4352,KE=4449,WE=4519,CY=19,RY=21,Dg=28,YE=RY*Dg,Gpe=CY*YE,Kpe=pb+Gpe,Wpe=GE+CY,Ype=KE+RY,Qpe=WE+Dg;function sv(t){return t>>24&255}function NY(t){return t&16777215}let XR,E9,ZR,V_;function Jpe(){let t=SY(Vpe);XR=new Map(OY(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),E9=new Set(db(t)),ZR=new Map,V_=new Map;for(let[e,r]of IY(t)){if(!E9.has(e)&&r.length==2){let[n,i]=r,s=V_.get(n);s||(s=new Map,V_.set(n,s)),s.set(i,e)}ZR.set(e,r.reverse())}}function DY(t){return t>=pb&&t<Kpe}function Xpe(t,e){if(t>=GE&&t<Wpe&&e>=KE&&e<Ype)return pb+(t-GE)*YE+(e-KE)*Dg;if(DY(t)&&e>WE&&e<Qpe&&(t-pb)%Dg==0)return t+(e-WE);{let r=V_.get(t);return r&&(r=r.get(e),r)?r:-1}}function MY(t){XR||Jpe();let e=[],r=[],n=!1;function i(s){let a=XR.get(s);a&&(n=!0,s|=a),e.push(s)}for(let s of t)for(;;){if(s<128)e.push(s);else if(DY(s)){let a=s-pb,o=a/YE|0,c=a%YE/Dg|0,u=a%Dg;i(GE+o),i(KE+c),u>0&&i(WE+u)}else{let a=ZR.get(s);a?r.push(...a):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=sv(e[0]);for(let a=1;a<e.length;a++){let o=sv(e[a]);if(o==0||s<=o){s=o;continue}let c=a-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(s=sv(e[--c]),s<=o))break}s=sv(e[a])}}return e}function Zpe(t){let e=[],r=[],n=-1,i=0;for(let s of t){let a=sv(s),o=NY(s);if(n==-1)a==0?n=o:e.push(o);else if(i>0&&i>=a)a==0?(e.push(n,...r),r.length=0,n=o):r.push(o),i=a;else{let c=Xpe(n,o);c>=0?n=c:i==0&&a==0?(e.push(n),n=o):(r.push(o),i=a)}}return n>=0&&e.push(n,...r),e}function kY(t){return MY(t).map(NY)}function e0e(t){return Zpe(MY(t))}const x9=45,$Y=".",LY=65039,UY=1,a0=t=>Array.from(t);function gb(t,e){return t.P.has(e)||t.Q.has(e)}class t0e extends Array{get is_emoji(){return!0}}let eN,jY,Qd,tN,BY,S0,gO,Fp,FY,A9,rN;function E5(){if(eN)return;let t=SY(Dpe);const e=()=>db(t),r=()=>new Set(e());eN=new Map(IY(t)),jY=r(),Qd=e(),tN=new Set(e().map(f=>Qd[f])),Qd=new Set(Qd),BY=r(),r();let n=OY(t),i=t();const s=()=>new Set(e().flatMap(f=>n[f]).concat(e()));S0=hb(f=>{let h=hb(t).map(m=>m+96);if(h.length){let m=f>=i;h[0]-=32,h=Ng(h),m&&(h=`Restricted[${h}]`);let y=s(),w=s(),v=!t();return{N:h,P:y,Q:w,M:v,R:m}}}),gO=r(),Fp=new Map;let a=e().concat(a0(gO)).sort((f,h)=>f-h);a.forEach((f,h)=>{let m=t(),y=a[h]=m?a[h-m]:{V:[],M:new Map};y.V.push(f),gO.has(f)||Fp.set(f,y)});for(let{V:f,M:h}of new Set(Fp.values())){let m=[];for(let w of f){let v=S0.filter(_=>gb(_,w)),g=m.find(({G:_})=>v.some(b=>_.has(b)));g||(g={G:new Set,V:[]},m.push(g)),g.V.push(w),v.forEach(_=>g.G.add(_))}let y=m.flatMap(w=>a0(w.G));for(let{G:w,V:v}of m){let g=new Set(y.filter(_=>!w.has(_)));for(let _ of v)h.set(_,g)}}let o=new Set,c=new Set;const u=f=>o.has(f)?c.add(f):o.add(f);for(let f of S0){for(let h of f.P)u(h);for(let h of f.Q)u(h)}for(let f of o)!Fp.has(f)&&!c.has(f)&&Fp.set(f,UY);FY=new Set(a0(o).concat(a0(kY(o)))),A9=Fpe(t).map(f=>t0e.from(f)).sort(zpe),rN=new Map;for(let f of A9){let h=[rN];for(let m of f){let y=h.map(w=>{let v=w.get(m);return v||(v=new Map,w.set(m,v)),v});m===LY?h.push(...y):h=y}for(let m of h)m.V=f}}function x5(t){return(qY(t)?"":`${A5(a2([t]))} `)+TY(t)}function A5(t){return`"${t}"‎`}function r0e(t){if(t.length>=4&&t[2]==x9&&t[3]==x9)throw new Error(`invalid label extension: "${Ng(t.slice(0,4))}"`)}function n0e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function i0e(t){let e=t[0],r=w9.get(e);if(r)throw Dv(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s<n;s++){e=t[s];let a=w9.get(e);if(a){if(i==s)throw Dv(`${r} + ${a}`);i=s+1,r=a}}if(i==n)throw Dv(`trailing ${r}`)}function a2(t,e=TY){let r=[];s0e(t[0])&&r.push("◌");let n=0,i=t.length;for(let s=0;s<i;s++){let a=t[s];qY(a)&&(r.push(Ng(t.slice(n,s))),r.push(e(a)),n=s+1)}return r.push(Ng(t.slice(n,i))),r.join("")}function s0e(t){return E5(),Qd.has(t)}function qY(t){return E5(),BY.has(t)}function a0e(t){return l0e(o0e(t,e0e,h0e))}function o0e(t,e,r){if(!t)return[];E5();let n=0;return t.split($Y).map(i=>{let s=Hpe(i),a={input:s,offset:n};n+=s.length+1;try{let o=a.tokens=d0e(s,e,r),c=o.length,u;if(!c)throw new Error("empty label");let f=a.output=o.flat();if(n0e(f),!(a.emoji=c>1||o[0].is_emoji)&&f.every(m=>m<128))r0e(f),u="ASCII";else{let m=o.flatMap(y=>y.is_emoji?[]:y);if(!m.length)u="Emoji";else{if(Qd.has(f[0]))throw Dv("leading combining mark");for(let v=1;v<c;v++){let g=o[v];if(!g.is_emoji&&Qd.has(g[0]))throw Dv(`emoji + combining mark: "${Ng(o[v-1])} + ${a2([g[0]])}"`)}i0e(f);let y=a0(new Set(m)),[w]=u0e(y);f0e(w,m),c0e(w,y),u=w.N}}a.type=u}catch(o){a.error=o}return a})}function c0e(t,e){let r,n=[];for(let i of e){let s=Fp.get(i);if(s===UY)return;if(s){let a=s.M.get(i);if(r=r?r.filter(o=>a.has(o)):a0(a),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>gb(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function u0e(t){let e=S0;for(let r of t){let n=e.filter(i=>gb(i,r));if(!n.length)throw S0.some(i=>gb(i,r))?zY(e[0],r):HY(r);if(e=n,n.length==1)break}return e}function l0e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${A5(a2(e))}: ${i}`)}return Ng(n)}).join($Y)}function HY(t){return new Error(`disallowed character: ${x5(t)}`)}function zY(t,e){let r=x5(e),n=S0.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Dv(t){return new Error(`illegal placement: ${t}`)}function f0e(t,e){for(let r of e)if(!gb(t,r))throw zY(t,r);if(t.M){let r=kY(e);for(let n=1,i=r.length;n<i;n++)if(tN.has(r[n])){let s=n+1;for(let a;s<i&&tN.has(a=r[s]);s++)for(let o=n;o<s;o++)if(r[o]==a)throw new Error(`duplicate non-spacing marks: ${x5(a)}`);if(s-n>_9)throw new Error(`excessive non-spacing marks: ${A5(a2(r.slice(n-1,s)))} (${s-n}/${_9})`);n=s}}}function d0e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=p0e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let a=t.pop();if(FY.has(a))i.push(a);else{let o=eN.get(a);if(o)i.push(...o);else if(!jY.has(a))throw HY(a)}}}return i.length&&n.push(e(i)),n}function h0e(t){return t.filter(e=>e!=LY)}function p0e(t,e){let r=rN,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,e&&e.push(...t.slice(i).reverse()),t.length=i)}return n}const VY=new Uint8Array(32);VY.fill(0);function S9(t){return Ne(t.length!==0,"invalid ENS name; empty component","comp",t),t}function GY(t){const e=Xs(g0e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(S9(e.slice(n,i))),n=i+1);return Ne(n<e.length,"invalid ENS name; empty component","name",t),r.push(S9(e.slice(n))),r}function g0e(t){try{if(t.length===0)throw new Error("empty label");return a0e(t)}catch(e){Ne(!1,`invalid ENS name (${e.message})`,"name",t)}}function nN(t){Ne(typeof t=="string","invalid ENS name; not a string","name",t),Ne(t.length,"invalid ENS name (empty label)","name",t);let e=VY;const r=GY(t);for(;r.length;)e=qn(Hn([e,qn(r.pop())]));return _t(e)}function m0e(t){return _t(Hn(GY(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}function mO(t,e){return{address:cn(t),storageKeys:e.map((r,n)=>(Ne(ci(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Vh(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(Ne(r.length===2,"invalid slot set",`value[${n}]`,r),mO(r[0],r[1])):(Ne(r!=null&&typeof r=="object","invalid address-slot set","value",t),mO(r.address,r.storageKeys)));Ne(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return mO(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function m1(t){let e;return typeof t=="string"?e=tu.computePublicKey(t,!1):e=t.publicKey,cn(qn("0x"+e.substring(4)).substring(26))}function y0e(t,e){return m1(tu.recoverPublicKey(t,e))}const ma=BigInt(0),v0e=BigInt(2),b0e=BigInt(27),w0e=BigInt(28),_0e=BigInt(35),E0e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function S5(t){return t==="0x"?null:cn(t)}function KY(t,e){try{return Vh(t)}catch(r){Ne(!1,r.message,e,t)}}function o2(t,e){return t==="0x"?0:jr(t,e)}function Gs(t,e){if(t==="0x")return ma;const r=nr(t,e);return Ne(r<=E0e,"value exceeds uint size",e,r),r}function os(t,e){const r=nr(t,"value"),n=ba(r);return Ne(n.length<=32,"value too large",`tx.${e}`,r),n}function WY(t){return Vh(t).map(e=>[e.address,e.storageKeys])}function x0e(t){const e=c5(t);Ne(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:o2(e[0],"nonce"),gasPrice:Gs(e[1],"gasPrice"),gasLimit:Gs(e[2],"gasLimit"),to:S5(e[3]),value:Gs(e[4],"value"),data:_t(e[5]),chainId:ma};if(e.length===6)return r;const n=Gs(e[6],"v"),i=Gs(e[7],"r"),s=Gs(e[8],"s");if(i===ma&&s===ma)r.chainId=n;else{let a=(n-_0e)/v0e;a<ma&&(a=ma),r.chainId=a,Ne(a!==ma||n===b0e||n===w0e,"non-canonical legacy v","v",e[6]),r.signature=bc.from({r:Ch(e[7],32),s:Ch(e[8],32),v:n}),r.hash=qn(t)}return r}function O9(t,e){const r=[os(t.nonce||0,"nonce"),os(t.gasPrice||0,"gasPrice"),os(t.gasLimit||0,"gasLimit"),t.to!=null?cn(t.to):"0x",os(t.value||0,"value"),t.data||"0x"];let n=ma;if(t.chainId!=ma)n=nr(t.chainId,"tx.chainId"),Ne(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const s=t.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==ma&&(r.push(ba(n)),r.push("0x"),r.push("0x")),lb(r);let i=BigInt(27+e.yParity);return n!==ma?i=bc.getChainIdV(n,e.v):BigInt(e.v)!==i&&Ne(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(ba(i)),r.push(ba(e.r)),r.push(ba(e.s)),lb(r)}function YY(t,e){let r;try{if(r=o2(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{Ne(!1,"invalid yParity","yParity",e[0])}const n=Ch(e[1],32),i=Ch(e[2],32),s=bc.from({r:n,s:i,yParity:r});t.signature=s}function A0e(t){const e=c5(Ht(t).slice(1));Ne(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",_t(t));const r=Gs(e[2],"maxPriorityFeePerGas"),n=Gs(e[3],"maxFeePerGas"),i={type:2,chainId:Gs(e[0],"chainId"),nonce:o2(e[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Gs(e[4],"gasLimit"),to:S5(e[5]),value:Gs(e[6],"value"),data:_t(e[7]),accessList:KY(e[8],"accessList")};return e.length===9||(i.hash=qn(t),YY(i,e.slice(9))),i}function I9(t,e){const r=[os(t.chainId||0,"chainId"),os(t.nonce||0,"nonce"),os(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),os(t.maxFeePerGas||0,"maxFeePerGas"),os(t.gasLimit||0,"gasLimit"),t.to!=null?cn(t.to):"0x",os(t.value||0,"value"),t.data||"0x",WY(t.accessList||[])];return e&&(r.push(os(e.yParity,"yParity")),r.push(ba(e.r)),r.push(ba(e.s))),Hn(["0x02",lb(r)])}function S0e(t){const e=c5(Ht(t).slice(1));Ne(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",_t(t));const r={type:1,chainId:Gs(e[0],"chainId"),nonce:o2(e[1],"nonce"),gasPrice:Gs(e[2],"gasPrice"),gasLimit:Gs(e[3],"gasLimit"),to:S5(e[4]),value:Gs(e[5],"value"),data:_t(e[6]),accessList:KY(e[7],"accessList")};return e.length===8||(r.hash=qn(t),YY(r,e.slice(8))),r}function P9(t,e){const r=[os(t.chainId||0,"chainId"),os(t.nonce||0,"nonce"),os(t.gasPrice||0,"gasPrice"),os(t.gasLimit||0,"gasLimit"),t.to!=null?cn(t.to):"0x",os(t.value||0,"value"),t.data||"0x",WY(t.accessList||[])];return e&&(r.push(os(e.yParity,"recoveryParam")),r.push(ba(e.r)),r.push(ba(e.s))),Hn(["0x01",lb(r)])}var zu,V0,G0,K0,W0,Y0,Q0,J0,X0,Z0,eg,tg;const Zl=class Zl{constructor(){Je(this,zu,void 0);Je(this,V0,void 0);Je(this,G0,void 0);Je(this,K0,void 0);Je(this,W0,void 0);Je(this,Y0,void 0);Je(this,Q0,void 0);Je(this,J0,void 0);Je(this,X0,void 0);Je(this,Z0,void 0);Je(this,eg,void 0);Je(this,tg,void 0);Te(this,zu,null),Te(this,V0,null),Te(this,K0,0),Te(this,W0,BigInt(0)),Te(this,Y0,null),Te(this,Q0,null),Te(this,J0,null),Te(this,G0,"0x"),Te(this,X0,BigInt(0)),Te(this,Z0,BigInt(0)),Te(this,eg,null),Te(this,tg,null)}get type(){return W(this,zu)}set type(e){switch(e){case null:Te(this,zu,null);break;case 0:case"legacy":Te(this,zu,0);break;case 1:case"berlin":case"eip-2930":Te(this,zu,1);break;case 2:case"london":case"eip-1559":Te(this,zu,2);break;default:Ne(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return W(this,V0)}set to(e){Te(this,V0,e==null?null:cn(e))}get nonce(){return W(this,K0)}set nonce(e){Te(this,K0,jr(e,"value"))}get gasLimit(){return W(this,W0)}set gasLimit(e){Te(this,W0,nr(e))}get gasPrice(){const e=W(this,Y0);return e==null&&(this.type===0||this.type===1)?ma:e}set gasPrice(e){Te(this,Y0,e==null?null:nr(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=W(this,Q0);return e??(this.type===2?ma:null)}set maxPriorityFeePerGas(e){Te(this,Q0,e==null?null:nr(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=W(this,J0);return e??(this.type===2?ma:null)}set maxFeePerGas(e){Te(this,J0,e==null?null:nr(e,"maxFeePerGas"))}get data(){return W(this,G0)}set data(e){Te(this,G0,_t(e))}get value(){return W(this,X0)}set value(e){Te(this,X0,nr(e,"value"))}get chainId(){return W(this,Z0)}set chainId(e){Te(this,Z0,nr(e))}get signature(){return W(this,eg)||null}set signature(e){Te(this,eg,e==null?null:bc.from(e))}get accessList(){const e=W(this,tg)||null;return e??(this.type===1||this.type===2?[]:null)}set accessList(e){Te(this,tg,e==null?null:Vh(e))}get hash(){return this.signature==null?null:qn(this.serialized)}get unsignedHash(){return qn(this.unsignedSerialized)}get from(){return this.signature==null?null:y0e(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:tu.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){switch(st(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return O9(this,this.signature);case 1:return P9(this,this.signature);case 2:return I9(this,this.signature)}st(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return O9(this);case 1:return P9(this);case 2:return I9(this)}st(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&st(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),st(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),st(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):r?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Zl.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Zl;if(typeof e=="string"){const n=Ht(e);if(n[0]>=127)return Zl.from(x0e(n));switch(n[0]){case 1:return Zl.from(S0e(n));case 2:return Zl.from(A0e(n))}st(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Zl;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=bc.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.hash!=null&&(Ne(r.isSigned(),"unsigned transaction cannot define hash","tx",e),Ne(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Ne(r.isSigned(),"unsigned transaction cannot define from","tx",e),Ne(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};zu=new WeakMap,V0=new WeakMap,G0=new WeakMap,K0=new WeakMap,W0=new WeakMap,Y0=new WeakMap,Q0=new WeakMap,J0=new WeakMap,X0=new WeakMap,Z0=new WeakMap,eg=new WeakMap,tg=new WeakMap;let mb=Zl;function O0e(t){return typeof t=="string"&&(t=Xs(t)),qn(Hn([Xs(hpe),Xs(String(t.length)),t]))}const QY=new Uint8Array(32);QY.fill(0);const I0e=BigInt(-1),JY=BigInt(0),XY=BigInt(1),P0e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function T0e(t){const e=Ht(t),r=e.length%32;return r?Hn([e,QY.slice(r)]):_t(e)}const C0e=dl(XY,32),R0e=dl(JY,32),T9={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},yO=["name","version","chainId","verifyingContract","salt"];function C9(t){return function(e){return Ne(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const N0e={name:C9("name"),version:C9("version"),chainId:function(t){const e=nr(t,"domain.chainId");return Ne(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):i0(e)},verifyingContract:function(t){try{return cn(t).toLowerCase()}catch{}Ne(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ht(t,"domain.salt");return Ne(e.length===32,'invalid domain value "salt"',"domain.salt",t),_t(e)}};function vO(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");Ne(n%8===0&&n!==0&&n<=256&&(e[2]==null||e[2]===String(n)),"invalid numeric width","type",t);const i=Wd(P0e,r?n-1:n),s=r?(i+XY)*I0e:JY;return function(a){const o=nr(a,"value");return Ne(o>=s&&o<=i,`value out-of-bounds for ${t}`,"value",o),dl(r?pW(o,256):o,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return Ne(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=Ht(n);return Ne(i.length===r,`invalid length for ${t}`,"value",n),T0e(n)}}}switch(t){case"address":return function(e){return Ch(cn(e),32)};case"bool":return function(e){return e?C0e:R0e};case"bytes":return function(e){return qn(e)};case"string":return function(e){return hl(e)}}return null}function R9(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}var Fb,Vu,rg,Rx,ZY;const po=class po{constructor(e){Je(this,Rx);Fe(this,"primaryType");Je(this,Fb,void 0);Je(this,Vu,void 0);Je(this,rg,void 0);Te(this,Fb,JSON.stringify(e)),Te(this,Vu,new Map),Te(this,rg,new Map);const r=new Map,n=new Map,i=new Map;Object.keys(e).forEach(o=>{r.set(o,new Set),n.set(o,[]),i.set(o,new Set)});for(const o in e){const c=new Set;for(const u of e[o]){Ne(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(o)}`,"types",e),c.add(u.name);const f=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Ne(f!==o,`circular type reference to ${JSON.stringify(f)}`,"types",e),!vO(f)&&(Ne(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(o),r.get(o).add(f))}}const s=Array.from(n.keys()).filter(o=>n.get(o).length===0);Ne(s.length!==0,"missing primary type","types",e),Ne(s.length===1,`ambiguous primary types or unused types: ${s.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),Qt(this,{primaryType:s[0]});function a(o,c){Ne(!c.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),c.add(o);for(const u of r.get(o))if(n.has(u)){a(u,c);for(const f of c)i.get(f).add(u)}c.delete(o)}a(this.primaryType,new Set);for(const[o,c]of i){const u=Array.from(c);u.sort(),W(this,Vu).set(o,R9(o,e[o])+u.map(f=>R9(f,e[f])).join(""))}}get types(){return JSON.parse(W(this,Fb))}getEncoder(e){let r=W(this,rg).get(e);return r||(r=ut(this,Rx,ZY).call(this,e),W(this,rg).set(e,r)),r}encodeType(e){const r=W(this,Vu).get(e);return Ne(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return qn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(vO(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Ne(!i[3]||parseInt(i[3])===r.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",r),r.map(a=>this._visit(i[1],a,n));const s=this.types[e];if(s)return s.reduce((a,{name:o,type:c})=>(a[o]=this._visit(c,r[o],n),a),{});Ne(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new po(e)}static getPrimaryType(e){return po.from(e).primaryType}static hashStruct(e,r,n){return po.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=T9[n];Ne(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>yO.indexOf(n.name)-yO.indexOf(i.name)),po.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Hn(["0x1901",po.hashDomain(e),po.from(r).hash(n)])}static hash(e,r,n){return qn(po.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const s={};e.verifyingContract&&!ci(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const a=po.from(r);a.visit(n,(o,c)=>(o==="address"&&!ci(c,20)&&(s[c]="0x"),c));for(const o in s)s[o]=await i(o);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=a.visit(n,(o,c)=>o==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){po.hashDomain(e);const i={},s=[];yO.forEach(c=>{const u=e[c];u!=null&&(i[c]=N0e[c](u),s.push({name:c,type:T9[c]}))});const a=po.from(r),o=Object.assign({},r);return Ne(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),o.EIP712Domain=s,a.encode(n),{types:o,domain:i,primaryType:a.primaryType,message:a.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return _t(Ht(u));if(c.match(/^u?int/))return nr(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return Ne(typeof u=="string","invalid string","value",u),u}Ne(!1,"unsupported type","type",c)})}}};Fb=new WeakMap,Vu=new WeakMap,rg=new WeakMap,Rx=new WeakSet,ZY=function(e){{const i=vO(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i);return a=>{Ne(!r[3]||parseInt(r[3])===a.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",a);let o=a.map(s);return W(this,Vu).has(i)&&(o=o.map(qn)),qn(Hn(o))}}const n=this.types[e];if(n){const i=hl(W(this,Vu).get(e));return s=>{const a=n.map(({name:o,type:c})=>{const u=this.getEncoder(c)(s[o]);return W(this,Vu).has(c)?qn(u):u});return a.unshift(i),Hn(a)}}Ne(!1,`unknown type: ${e}`,"type",e)};let Mg=po;function Qs(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const D0e="external public payable",M0e=Qs(D0e.split(" ")),eQ="constant external internal payable private public pure view",k0e=Qs(eQ.split(" ")),tQ="constructor error event fallback function receive struct",rQ=Qs(tQ.split(" ")),nQ="calldata memory storage payable indexed",$0e=Qs(nQ.split(" ")),L0e="tuple returns",U0e=[tQ,nQ,L0e,eQ].join(" "),j0e=Qs(U0e.split(" ")),B0e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},F0e=new RegExp("^(\\s*)"),q0e=new RegExp("^([0-9]+)"),H0e=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),iQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),sQ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ns,cc,qb,iN;const Nx=class Nx{constructor(e){Je(this,qb);Je(this,ns,void 0);Je(this,cc,void 0);Te(this,ns,0),Te(this,cc,e.slice())}get offset(){return W(this,ns)}get length(){return W(this,cc).length-W(this,ns)}clone(){return new Nx(W(this,cc))}reset(){Te(this,ns,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=ut(this,qb,iN).call(this,W(this,ns)+1,e.match+1);return Te(this,ns,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;W(this,ns)<e.match-1;){const n=this.peek().linkNext;r.push(ut(this,qb,iN).call(this,W(this,ns)+1,n)),Te(this,ns,n)}return Te(this,ns,e.match+1),r}peek(){if(W(this,ns)>=W(this,cc).length)throw new Error("out-of-bounds");return W(this,cc)[W(this,ns)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return Mm(this,ns)._++,e}toString(){const e=[];for(let r=W(this,ns);r<W(this,cc).length;r++){const n=W(this,cc)[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};ns=new WeakMap,cc=new WeakMap,qb=new WeakSet,iN=function(e=0,r=0){return new Nx(W(this,cc).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let wc=Nx;function Wf(t){const e=[],r=a=>{const o=s<t.length?JSON.stringify(t[s]):"$EOI";throw new Error(`invalid token ${o} at ${s}: ${a}`)};let n=[],i=[],s=0;for(;s<t.length;){let a=t.substring(s),o=a.match(F0e);o&&(s+=o[1].length,a=t.substring(s));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(c);let u=B0e[a[0]]||"";if(u){if(c.type=u,c.text=a[0],s++,u==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&r("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let f=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const h=e.pop().text;f=h+f,e[e.length-1].value=jr(h)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=f}continue}if(o=a.match(H0e),o){if(c.text=o[1],s+=c.text.length,j0e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(sQ)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(q0e),o){c.text=o[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${s}`)}return new wc(e.map(a=>Object.freeze(a)))}function N9(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function c2(t,e){if(e.peekKeyword(rQ)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function pl(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function aQ(t){let e=pl(t,k0e);return N9(e,Qs("constant payable nonpayable".split(" "))),N9(e,Qs("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function al(t,e){return t.popParams().map(r=>ds.from(r,e))}function oQ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return nr(t.pop().text);throw new Error("invalid gas")}return null}function Rh(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const z0e=new RegExp(/^(.*)\[([0-9]*)\]$/);function D9(t){const e=t.match(sQ);if(Ne(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);Ne(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);Ne(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const oi={},Oa=Symbol.for("_ethers_internal"),M9="_ParamTypeInternal",k9="_ErrorInternal",$9="_EventInternal",L9="_ConstructorInternal",U9="_FallbackInternal",j9="_FunctionInternal",B9="_StructInternal";var ng,G_;const go=class go{constructor(e,r,n,i,s,a,o,c){Je(this,ng);Fe(this,"name");Fe(this,"type");Fe(this,"baseType");Fe(this,"indexed");Fe(this,"components");Fe(this,"arrayLength");Fe(this,"arrayChildren");if(Gf(e,oi,"ParamType"),Object.defineProperty(this,Oa,{value:M9}),a&&(a=Object.freeze(a.slice())),i==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(i==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Qt(this,{name:r,type:n,baseType:i,indexed:s,components:a,arrayLength:o,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")"):r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return ut(this,ng,G_).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(go.isParamType(e))return e;if(typeof e=="string")try{return go.from(Wf(e),r)}catch{Ne(!1,"invalid param type","obj",e)}else if(e instanceof wc){let o="",c="",u=null;pl(e,Qs(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(v=>go.from(v)),o=`tuple(${u.map(v=>v.format()).join(",")})`):(o=D9(e.popType("TYPE")),c=o);let f=null,h=null;for(;e.length&&e.peekType("BRACKET");){const v=e.pop();f=new go(oi,"",o,c,null,u,h,f),h=v.value,o+=v.text,c="array",u=null}let m=null;if(pl(e,$0e).has("indexed")){if(!r)throw new Error("");m=!0}const w=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new go(oi,w,o,c,m,u,h,f)}const n=e.name;Ne(!n||typeof n=="string"&&n.match(iQ),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(Ne(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,a=s.match(z0e);if(a){const o=parseInt(a[2]||"-1"),c=go.from({type:a[1],components:e.components});return new go(oi,n||"",s,"array",i,null,o,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const o=e.components!=null?e.components.map(u=>go.from(u)):null;return new go(oi,n||"",s,"tuple",i,o,null,null)}return s=D9(e.type),new go(oi,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[Oa]===M9}};ng=new WeakSet,G_=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=r.slice();o.forEach((c,u)=>{var f;ut(f=a,ng,G_).call(f,e,c,n,h=>{o[u]=h})}),i(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(r))o=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,u)=>{var f;ut(f=a[u],ng,G_).call(f,e,c,n,h=>{o[u]=h})}),i(o);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let ds=go;class Nh{constructor(e,r,n){Fe(this,"type");Fe(this,"inputs");Gf(e,oi,"Fragment"),n=Object.freeze(n.slice()),Qt(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Nh.from(JSON.parse(e))}catch{}return Nh.from(Wf(e))}if(e instanceof wc)switch(e.peekKeyword(rQ)){case"constructor":return rl.from(e);case"error":return ya.from(e);case"event":return Vc.from(e);case"fallback":case"receive":return Lu.from(e);case"function":return Gc.from(e);case"struct":return Ah.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return rl.from(e);case"error":return ya.from(e);case"event":return Vc.from(e);case"fallback":case"receive":return Lu.from(e);case"function":return Gc.from(e);case"struct":return Ah.from(e)}st(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Ne(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return rl.isFragment(e)}static isError(e){return ya.isFragment(e)}static isEvent(e){return Vc.isFragment(e)}static isFunction(e){return Gc.isFragment(e)}static isStruct(e){return Ah.isFragment(e)}}class u2 extends Nh{constructor(r,n,i,s){super(r,n,s);Fe(this,"name");Ne(typeof i=="string"&&i.match(iQ),"invalid identifier","name",i),s=Object.freeze(s.slice()),Qt(this,{name:i})}}function yb(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class ya extends u2{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,Oa,{value:k9})}get selector(){return hl(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+yb(e,this.inputs)),r.join(" ")}static from(e){if(ya.isFragment(e))return e;if(typeof e=="string")return ya.from(Wf(e));if(e instanceof wc){const r=c2("error",e),n=al(e);return Rh(e),new ya(oi,r,n)}return new ya(oi,e.name,e.inputs?e.inputs.map(ds.from):[])}static isFragment(e){return e&&e[Oa]===k9}}class Vc extends u2{constructor(r,n,i,s){super(r,"event",n,i);Fe(this,"anonymous");Object.defineProperty(this,Oa,{value:$9}),Qt(this,{anonymous:s})}get topicHash(){return hl(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+yb(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>ds.from(s)),new Vc(oi,r,n,!1).topicHash}static from(r){if(Vc.isFragment(r))return r;if(typeof r=="string")try{return Vc.from(Wf(r))}catch{Ne(!1,"invalid event fragment","obj",r)}else if(r instanceof wc){const n=c2("event",r),i=al(r,!0),s=!!pl(r,Qs(["anonymous"])).has("anonymous");return Rh(r),new Vc(oi,n,i,s)}return new Vc(oi,r.name,r.inputs?r.inputs.map(n=>ds.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[Oa]===$9}}class rl extends Nh{constructor(r,n,i,s,a){super(r,n,i);Fe(this,"payable");Fe(this,"gas");Object.defineProperty(this,Oa,{value:L9}),Qt(this,{payable:s,gas:a})}format(r){if(st(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${yb(r,this.inputs)}`];return n.push(this.payable?"payable":"nonpayable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(rl.isFragment(r))return r;if(typeof r=="string")try{return rl.from(Wf(r))}catch{Ne(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof wc){pl(r,Qs(["constructor"]));const n=al(r),i=!!pl(r,M0e).has("payable"),s=oQ(r);return Rh(r),new rl(oi,"constructor",n,i,s)}return new rl(oi,"constructor",r.inputs?r.inputs.map(ds.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Oa]===L9}}class Lu extends Nh{constructor(r,n,i){super(r,"fallback",n);Fe(this,"payable");Object.defineProperty(this,Oa,{value:U9}),Qt(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Lu.isFragment(r))return r;if(typeof r=="string")try{return Lu.from(Wf(r))}catch{Ne(!1,"invalid fallback fragment","obj",r)}else if(r instanceof wc){const n=r.toString(),i=r.peekKeyword(Qs(["fallback","receive"]));if(Ne(i,"type must be fallback or receive","obj",n),r.popKeyword(Qs(["fallback","receive"]))==="receive"){const c=al(r);return Ne(c.length===0,"receive cannot have arguments","obj.inputs",c),pl(r,Qs(["payable"])),Rh(r),new Lu(oi,[],!0)}let a=al(r);a.length?Ne(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(c=>c.format("minimal")).join(", ")):a=[ds.from("bytes")];const o=aQ(r);if(Ne(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),pl(r,Qs(["returns"])).has("returns")){const c=al(r);Ne(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return Rh(r),new Lu(oi,a,o==="payable")}if(r.type==="receive")return new Lu(oi,[],!0);if(r.type==="fallback"){const n=[ds.from("bytes")],i=r.stateMutability==="payable";return new Lu(oi,n,i)}Ne(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[Oa]===U9}}class Gc extends u2{constructor(r,n,i,s,a,o){super(r,"function",n,s);Fe(this,"constant");Fe(this,"outputs");Fe(this,"stateMutability");Fe(this,"payable");Fe(this,"gas");Object.defineProperty(this,Oa,{value:j9}),a=Object.freeze(a.slice()),Qt(this,{constant:i==="view"||i==="pure",gas:o,outputs:a,payable:i==="payable",stateMutability:i})}get selector(){return hl(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+yb(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(yb(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>ds.from(s)),new Gc(oi,r,"view",n,[],null).selector}static from(r){if(Gc.isFragment(r))return r;if(typeof r=="string")try{return Gc.from(Wf(r))}catch{Ne(!1,"invalid function fragment","obj",r)}else if(r instanceof wc){const i=c2("function",r),s=al(r),a=aQ(r);let o=[];pl(r,Qs(["returns"])).has("returns")&&(o=al(r));const c=oQ(r);return Rh(r),new Gc(oi,i,a,s,o,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Gc(oi,r.name,n,r.inputs?r.inputs.map(ds.from):[],r.outputs?r.outputs.map(ds.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Oa]===j9}}class Ah extends u2{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,Oa,{value:B9})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Ah.from(Wf(e))}catch{Ne(!1,"invalid struct fragment","obj",e)}else if(e instanceof wc){const r=c2("struct",e),n=al(e);return Rh(e),new Ah(oi,r,n)}return new Ah(oi,e.name,e.inputs?e.inputs.map(ds.from):[])}static isFragment(e){return e&&e[Oa]===B9}}const Ec=new Map;Ec.set(0,"GENERIC_PANIC");Ec.set(1,"ASSERT_FALSE");Ec.set(17,"OVERFLOW");Ec.set(18,"DIVIDE_BY_ZERO");Ec.set(33,"ENUM_RANGE_ERROR");Ec.set(34,"BAD_STORAGE_DATA");Ec.set(49,"STACK_UNDERFLOW");Ec.set(50,"ARRAY_RANGE_ERROR");Ec.set(65,"OUT_OF_MEMORY");Ec.set(81,"UNINITIALIZED_FUNCTION_CALL");const V0e=new RegExp(/^bytes([0-9]*)$/),G0e=new RegExp(/^(u?int)([0-9]*)$/);let bO=null;function K0e(t,e,r,n){let i="missing revert data",s=null;const a=null;let o=null;if(r){i="execution reverted";const u=Ht(r);if(r=_t(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(_t(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(_t(u.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],u.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},s=`Panic due to ${Ec.get(f)||"UNKNOWN"}(${f})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?cn(e.to):null,data:e.data||"0x"};return e.from&&(c.from=cn(e.from)),Li(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:a,revert:o})}var sf,qp;const Dx=class Dx{constructor(){Je(this,sf)}getDefaultValue(e){const r=e.map(i=>ut(this,sf,qp).call(this,ds.from(i)));return new Ww(r,"_").defaultValue()}encode(e,r){uW(r.length,e.length,"types/values length mismatch");const n=e.map(a=>ut(this,sf,qp).call(this,ds.from(a))),i=new Ww(n,"_"),s=new zR;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(a=>ut(this,sf,qp).call(this,ds.from(a)));return new Ww(i,"_").decode(new VR(r,n))}static defaultAbiCoder(){return bO==null&&(bO=new Dx),bO}static getBuiltinCallException(e,r,n){return K0e(e,r,n,Dx.defaultAbiCoder())}};sf=new WeakSet,qp=function(e){if(e.isArray())return new Epe(ut(this,sf,qp).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ww(e.components.map(n=>ut(this,sf,qp).call(this,n)),e.name);switch(e.baseType){case"address":return new wpe(e.name);case"bool":return new xpe(e.name);case"string":return new Npe(e.name);case"bytes":return new Ape(e.name);case"":return new Ipe(e.name)}let r=e.type.match(G0e);if(r){let n=parseInt(r[2]||"256");return Ne(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new Rpe(n/8,r[1]==="int",e.name)}if(r=e.type.match(V0e),r){let n=parseInt(r[1]);return Ne(n!==0&&n<=32,"invalid bytes length","param",e),new Spe(n,e.name)}Ne(!1,"invalid type","type",e.type)};let vb=Dx;class W0e{constructor(e,r,n){Fe(this,"fragment");Fe(this,"name");Fe(this,"signature");Fe(this,"topic");Fe(this,"args");const i=e.name,s=e.format();Qt(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class Y0e{constructor(e,r,n,i){Fe(this,"fragment");Fe(this,"name");Fe(this,"args");Fe(this,"signature");Fe(this,"selector");Fe(this,"value");const s=e.name,a=e.format();Qt(this,{fragment:e,name:s,args:n,signature:a,selector:r,value:i})}}class Q0e{constructor(e,r,n){Fe(this,"fragment");Fe(this,"name");Fe(this,"args");Fe(this,"signature");Fe(this,"selector");const i=e.name,s=e.format();Qt(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class F9{constructor(e){Fe(this,"hash");Fe(this,"_isIndexed");Qt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const q9={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},H9={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&q9[t.toString()]&&(e=q9[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var jc,Bc,Fc,xs,ig,K_,sg,W_;const u0=class u0{constructor(e){Je(this,ig);Je(this,sg);Fe(this,"fragments");Fe(this,"deploy");Fe(this,"fallback");Fe(this,"receive");Je(this,jc,void 0);Je(this,Bc,void 0);Je(this,Fc,void 0);Je(this,xs,void 0);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Te(this,Fc,new Map),Te(this,jc,new Map),Te(this,Bc,new Map);const n=[];for(const a of r)try{n.push(Nh.from(a))}catch(o){console.log("EE",o)}Qt(this,{fragments:Object.freeze(n)});let i=null,s=!1;Te(this,xs,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Qt(this,{deploy:a});return;case"fallback":a.inputs.length===0?s=!0:(Ne(!i||a.payable!==i.payable,"conflicting fallback fragments",`fragments[${o}]`,a),i=a,s=i.payable);return;case"function":c=W(this,Fc);break;case"event":c=W(this,Bc);break;case"error":c=W(this,jc);break;default:return}const u=a.format();c.has(u)||c.set(u,a)}),this.deploy||Qt(this,{deploy:rl.from("constructor()")}),Qt(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return vb.defaultAbiCoder()}getFunctionName(e){const r=ut(this,ig,K_).call(this,e,null,!1);return Ne(r,"no matching function","key",e),r.name}hasFunction(e){return!!ut(this,ig,K_).call(this,e,null,!1)}getFunction(e,r){return ut(this,ig,K_).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(W(this,Fc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Fc).get(i),n)}}getEventName(e){const r=ut(this,sg,W_).call(this,e,null,!1);return Ne(r,"no matching event","key",e),r.name}hasEvent(e){return!!ut(this,sg,W_).call(this,e,null,!1)}getEvent(e,r){return ut(this,sg,W_).call(this,e,r||null,!0)}forEachEvent(e){const r=Array.from(W(this,Bc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,Bc).get(i),n)}}getError(e,r){if(ci(e)){const i=e.toLowerCase();if(H9[i])return ya.from(H9[i].signature);for(const s of W(this,jc).values())if(i===s.selector)return s;return null}if(e.indexOf("(")===-1){const i=[];for(const[s,a]of W(this,jc))s.split("(")[0]===e&&i.push(a);if(i.length===0)return e==="Error"?ya.from("error Error(string)"):e==="Panic"?ya.from("error Panic(uint256)"):null;if(i.length>1){const s=i.map(a=>JSON.stringify(a.format())).join(", ");Ne(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=ya.from(e).format(),e==="Error(string)")return ya.from("error Error(string)");if(e==="Panic(uint256)")return ya.from("error Panic(uint256)");const n=W(this,jc).get(e);return n||null}forEachError(e){const r=Array.from(W(this,jc).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(W(this,jc).get(i),n)}}_decodeParams(e,r){return W(this,xs).decode(e,r)}_encodeParams(e,r){return W(this,xs).encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);Ne(n,"unknown error","fragment",e),e=n}return Ne(Kn(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,Kn(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);Ne(n,"unknown error","fragment",e),e=n}return Hn([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return Ne(Kn(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,Kn(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return Hn([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const s=this.getFunction(e);Ne(s,"unknown function","fragment",e),e=s}let n="invalid length for result data";const i=Ns(r);if(i.length%32===0)try{return W(this,xs).decode(e.outputs,i)}catch{n="could not decode result data"}st(!1,n,"BAD_DATA",{value:_t(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=Ht(e,"data"),i=vb.getBuiltinCallException("call",r,n),s="execution reverted (unknown custom error)";if(i.message.startsWith(s)){const o=_t(n.slice(0,4)),c=this.getError(o);if(c)try{const u=W(this,xs).decode(c.inputs,n.slice(4));i.revert={name:c.name,signature:c.format(),args:u},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(r);return a&&(i.invocation={method:a.name,signature:a.signature,args:a.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);Ne(n,"unknown function","fragment",e),e=n}return _t(W(this,xs).encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const s=this.getEvent(e);Ne(s,"unknown event","eventFragment",e),e=s}st(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(s,a)=>s.type==="string"?hl(a):s.type==="bytes"?qn(_t(a)):(s.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":s.type.match(/^u?int/)?a=dl(a):s.type.match(/^bytes/)?a=nde(a,32):s.type==="address"&&W(this,xs).encode(["address"],[a]),Ch(_t(a),32));for(r.forEach((s,a)=>{const o=e.inputs[a];if(!o.indexed){Ne(s==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,s);return}s==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Ne(!1,"filtering with tuples or arrays not supported","contract."+o.name,s):Array.isArray(s)?n.push(s.map(c=>i(o,c))):n.push(i(o,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const a=this.getEvent(e);Ne(a,"unknown event","eventFragment",e),e=a}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),Ne(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((a,o)=>{const c=r[o];if(a.indexed)if(a.type==="string")n.push(hl(c));else if(a.type==="bytes")n.push(qn(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(W(this,xs).encode([a.type],[c]))}else i.push(a),s.push(c)}),{data:W(this,xs).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const y=this.getEvent(e);Ne(y,"unknown event","eventFragment",e),e=y}if(n!=null&&!e.anonymous){const y=e.topicHash;Ne(ci(n[0],32)&&n[0].toLowerCase()===y,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],a=[];e.inputs.forEach((y,w)=>{y.indexed?y.type==="string"||y.type==="bytes"||y.baseType==="tuple"||y.baseType==="array"?(i.push(ds.from({type:"bytes32",name:y.name})),a.push(!0)):(i.push(y),a.push(!1)):(s.push(y),a.push(!1))});const o=n!=null?W(this,xs).decode(i,Hn(n)):null,c=W(this,xs).decode(s,r,!0),u=[],f=[];let h=0,m=0;return e.inputs.forEach((y,w)=>{let v=null;if(y.indexed)if(o==null)v=new F9(null);else if(a[w])v=new F9(o[m++]);else try{v=o[m++]}catch(g){v=g}else try{v=c[h++]}catch(g){v=g}u.push(v),f.push(y.name||null)}),VE.fromItems(u,f)}parseTransaction(e){const r=Ht(e.data,"tx.data"),n=nr(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(_t(r.slice(0,4)));if(!i)return null;const s=W(this,xs).decode(i.inputs,r.slice(4));return new Y0e(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new W0e(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=_t(e),n=this.getError(Kn(r,0,4));if(!n)return null;const i=W(this,xs).decode(n.inputs,Kn(r,4));return new Q0e(n,n.selector,i)}static from(e){return e instanceof u0?e:typeof e=="string"?new u0(JSON.parse(e)):typeof e.format=="function"?new u0(e.format("json")):new u0(e)}};jc=new WeakMap,Bc=new WeakMap,Fc=new WeakMap,xs=new WeakMap,ig=new WeakSet,K_=function(e,r,n){if(ci(e)){const s=e.toLowerCase();for(const a of W(this,Fc).values())if(s===a.selector)return a;return null}if(e.indexOf("(")===-1){const s=[];for(const[a,o]of W(this,Fc))a.split("(")[0]===e&&s.push(o);if(r){const a=r.length>0?r[r.length-1]:null;let o=r.length,c=!0;ks.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let u=s.length-1;u>=0;u--){const f=s[u].inputs.length;f!==o&&(!c||f!==o-1)&&s.splice(u,1)}for(let u=s.length-1;u>=0;u--){const f=s[u].inputs;for(let h=0;h<r.length;h++)if(ks.isTyped(r[h])){if(h>=f.length){if(r[h].type==="overrides")continue;s.splice(u,1);break}if(r[h].type!==f[h].baseType){s.splice(u,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const a=r[r.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const a=s.map(o=>JSON.stringify(o.format())).join(", ");Ne(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return s[0]}const i=W(this,Fc).get(Gc.from(e).format());return i||null},sg=new WeakSet,W_=function(e,r,n){if(ci(e)){const s=e.toLowerCase();for(const a of W(this,Bc).values())if(s===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const s=[];for(const[a,o]of W(this,Bc))a.split("(")[0]===e&&s.push(o);if(r){for(let a=s.length-1;a>=0;a--)s[a].inputs.length<r.length&&s.splice(a,1);for(let a=s.length-1;a>=0;a--){const o=s[a].inputs;for(let c=0;c<r.length;c++)if(ks.isTyped(r[c])&&r[c].type!==o[c].baseType){s.splice(a,1);break}}}if(s.length===0)return null;if(s.length>1&&n){const a=s.map(o=>JSON.stringify(o.format())).join(", ");Ne(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return s[0]}const i=W(this,Bc).get(Vc.from(e).format());return i||null};let sN=u0;const cQ=BigInt(0);function Mv(t){return t??null}function Cs(t){return t==null?null:t.toString()}class z9{constructor(e,r,n){Fe(this,"gasPrice");Fe(this,"maxFeePerGas");Fe(this,"maxPriorityFeePerGas");Qt(this,{gasPrice:Mv(e),maxFeePerGas:Mv(r),maxPriorityFeePerGas:Mv(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Cs(e),maxFeePerGas:Cs(r),maxPriorityFeePerGas:Cs(n)}}}function QE(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=_t(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=nr(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=jr(t[i],`request.${i}`));return t.accessList&&(e.accessList=Vh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Gu;class J0e{constructor(e,r){Fe(this,"provider");Fe(this,"number");Fe(this,"hash");Fe(this,"timestamp");Fe(this,"parentHash");Fe(this,"nonce");Fe(this,"difficulty");Fe(this,"gasLimit");Fe(this,"gasUsed");Fe(this,"miner");Fe(this,"extraData");Fe(this,"baseFeePerGas");Je(this,Gu,void 0);Te(this,Gu,e.transactions.map(n=>typeof n!="string"?new bb(n,r):n)),Qt(this,{provider:r,hash:Mv(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:Mv(e.baseFeePerGas)})}get transactions(){return W(this,Gu).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=W(this,Gu).slice();return e.length===0?[]:(st(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:a,miner:o,nonce:c,number:u,parentHash:f,timestamp:h,transactions:m}=this;return{_type:"Block",baseFeePerGas:Cs(e),difficulty:Cs(r),extraData:n,gasLimit:Cs(i),gasUsed:Cs(s),hash:a,miner:o,nonce:c,number:u,parentHash:f,timestamp:h,transactions:m}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}get length(){return W(this,Gu).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let r;if(typeof e=="number")r=W(this,Gu)[e];else{const n=e.toLowerCase();for(const i of W(this,Gu))if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash===n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;Ne(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return X0e(this)}}Gu=new WeakMap;class y1{constructor(e,r){Fe(this,"provider");Fe(this,"transactionHash");Fe(this,"blockHash");Fe(this,"blockNumber");Fe(this,"removed");Fe(this,"address");Fe(this,"data");Fe(this,"topics");Fe(this,"index");Fe(this,"transactionIndex");this.provider=r;const n=Object.freeze(e.topics.slice());Qt(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:a,topics:o,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:a,topics:o,transactionHash:c,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return st(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return st(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return st(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return Z0e(this)}}var Hb;class uQ{constructor(e,r){Fe(this,"provider");Fe(this,"to");Fe(this,"from");Fe(this,"contractAddress");Fe(this,"hash");Fe(this,"index");Fe(this,"blockHash");Fe(this,"blockNumber");Fe(this,"logsBloom");Fe(this,"gasUsed");Fe(this,"cumulativeGasUsed");Fe(this,"gasPrice");Fe(this,"type");Fe(this,"status");Fe(this,"root");Je(this,Hb,void 0);Te(this,Hb,Object.freeze(e.logs.map(i=>new y1(i,r))));let n=cQ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Qt(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:n,type:e.type,status:e.status,root:e.root})}get logs(){return W(this,Hb)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:a,blockNumber:o,logsBloom:c,logs:u,status:f,root:h}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:Cs(this.cumulativeGasUsed),from:r,gasPrice:Cs(this.gasPrice),gasUsed:Cs(this.gasUsed),hash:i,index:s,logs:u,logsBloom:c,root:h,status:f,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return fQ(this)}reorderedEvent(e){return st(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),lQ(this,e)}}Hb=new WeakMap;var af;const SM=class SM{constructor(e,r){Fe(this,"provider");Fe(this,"blockNumber");Fe(this,"blockHash");Fe(this,"index");Fe(this,"hash");Fe(this,"type");Fe(this,"to");Fe(this,"from");Fe(this,"nonce");Fe(this,"gasLimit");Fe(this,"gasPrice");Fe(this,"maxPriorityFeePerGas");Fe(this,"maxFeePerGas");Fe(this,"data");Fe(this,"value");Fe(this,"chainId");Fe(this,"signature");Fe(this,"accessList");Je(this,af,void 0);this.provider=r,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,Te(this,af,-1)}toJSON(){const{blockNumber:e,blockHash:r,index:n,hash:i,type:s,to:a,from:o,nonce:c,data:u,signature:f,accessList:h}=this;return{_type:"TransactionReceipt",accessList:h,blockNumber:e,blockHash:r,chainId:Cs(this.chainId),data:u,from:o,gasLimit:Cs(this.gasLimit),gasPrice:Cs(this.gasPrice),hash:i,maxFeePerGas:Cs(this.maxFeePerGas),maxPriorityFeePerGas:Cs(this.maxPriorityFeePerGas),nonce:c,signature:f,to:a,index:n,type:s,value:Cs(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:r,blockNumber:n}=await Os({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return r==null||r.blockNumber==null?0:n-r.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let s=W(this,af),a=-1,o=s===-1;const c=async()=>{if(o)return null;const{blockNumber:m,nonce:y}=await Os({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(y<this.nonce){s=m;return}if(o)return null;const w=await this.getTransaction();if(!(w&&w.blockNumber!=null))for(a===-1&&(a=s-3,a<W(this,af)&&(a=W(this,af)));a<=m;){if(o)return null;const v=await this.provider.getBlock(a,!0);if(v==null)return;for(const g of v)if(g===this.hash)return;for(let g=0;g<v.length;g++){const _=await v.getTransaction(g);if(_.from===this.from&&_.nonce===this.nonce){if(o)return null;const b=await this.provider.getTransactionReceipt(_.hash);if(b==null||m-b.blockNumber+1<n)return;let S="replaced";_.data===this.data&&_.to===this.to&&_.value===this.value?S="repriced":_.data==="0x"&&_.from===_.to&&_.value===cQ&&(S="cancelled"),st(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:S==="replaced"||S==="cancelled",reason:S,replacement:_.replaceableTransaction(s),hash:_.hash,receipt:b})}}a++}},u=m=>{if(m==null||m.status!==0)return m;st(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:m.to,from:m.from,data:""},receipt:m})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(f);if(f){if(await f.confirmations()>=n)return u(f)}else if(await c(),n===0)return null;return await new Promise((m,y)=>{const w=[],v=()=>{w.forEach(_=>_())};if(w.push(()=>{o=!0}),i>0){const _=setTimeout(()=>{v(),y(Li("wait for transaction timeout","TIMEOUT"))},i);w.push(()=>{clearTimeout(_)})}const g=async _=>{if(await _.confirmations()>=n){v();try{m(u(_))}catch(b){y(b)}}};if(w.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),s>=0){const _=async()=>{try{await c()}catch(b){if(Io(b,"TRANSACTION_REPLACED")){v(),y(b);return}}o||this.provider.once("block",_)};w.push(()=>{this.provider.off("block",_)}),this.provider.once("block",_)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return st(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),fQ(this)}reorderedEvent(e){return st(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),st(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),lQ(this,e)}replaceableTransaction(e){Ne(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new SM(this,this.provider);return Te(r,af,e),r}};af=new WeakMap;let bb=SM;function X0e(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function lQ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function fQ(t){return{orphan:"drop-transaction",tx:t}}function Z0e(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class O5 extends y1{constructor(r,n,i){super(r,r.provider);Fe(this,"interface");Fe(this,"fragment");Fe(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);Qt(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class dQ extends y1{constructor(r,n){super(r,r.provider);Fe(this,"error");Qt(this,{error:n})}}var ag;class ege extends uQ{constructor(r,n,i){super(i,n);Je(this,ag,void 0);Te(this,ag,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?W(this,ag).getEvent(r.topics[0]):null;if(n)try{return new O5(r,W(this,ag),n)}catch(i){return new dQ(r,i)}return r})}}ag=new WeakMap;var zb;class I5 extends bb{constructor(r,n,i){super(i,n);Je(this,zb,void 0);Te(this,zb,r)}async wait(r){const n=await super.wait(r);return n==null?null:new ege(W(this,zb),this.provider,n)}}zb=new WeakMap;class hQ extends mW{constructor(r,n,i,s){super(r,n,i);Fe(this,"log");Qt(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class tge extends hQ{constructor(e,r,n,i,s){super(e,r,n,new O5(s,e.interface,i));const a=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Qt(this,{args:a,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const V9=BigInt(0);function pQ(t){return t&&typeof t.call=="function"}function gQ(t){return t&&typeof t.estimateGas=="function"}function l2(t){return t&&typeof t.resolveName=="function"}function mQ(t){return t&&typeof t.sendTransaction=="function"}function yQ(t){if(t!=null){if(l2(t))return t;if(t.provider)return t.provider}}var Vb;class rge{constructor(e,r,n){Je(this,Vb,void 0);Fe(this,"fragment");if(Qt(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=Dh(e.runner,"resolveName"),s=l2(i)?i:null;Te(this,Vb,async function(){const a=await Promise.all(r.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,h)=>f==="address"?Array.isArray(h)?Promise.all(h.map(m=>fs(m,s))):fs(h,s):h)));return e.interface.encodeFilterTopics(r,a)}())}getTopicFilter(){return W(this,Vb)}}Vb=new WeakMap;function Dh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Jd(t){return t==null?null:t.provider||null}async function vQ(t,e){const r=ks.dereference(t,"overrides");Ne(typeof r=="object","invalid overrides parameter","overrides",t);const n=QE(r);return Ne(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),Ne(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function nge(t,e,r){const n=Dh(t,"resolveName"),i=l2(n)?n:null;return await Promise.all(e.map((s,a)=>s.walkAsync(r[a],(o,c)=>(c=ks.dereference(c,o),o==="address"?fs(c,i):c))))}function ige(t){const e=async function(a){const o=await vQ(a,["data"]);o.to=await t.getAddress(),o.from&&(o.from=await fs(o.from,yQ(t.runner)));const c=t.interface,u=nr(o.value||V9,"overrides.value")===V9,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!u&&Ne(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),Ne(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);const h=c.receive||c.fallback&&c.fallback.payable;return Ne(h||u,"cannot send value to non-payable fallback","overrides.value",o.value),Ne(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},r=async function(a){const o=Dh(t.runner,"call");st(pQ(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(a);try{return await o.call(c)}catch(u){throw a5(u)&&u.data?t.interface.makeError(u.data,c):u}},n=async function(a){const o=t.runner;st(mQ(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await e(a)),u=Jd(t.runner);return new I5(t.interface,u,c)},i=async function(a){const o=Dh(t.runner,"estimateGas");return st(gQ(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},s=async a=>await n(a);return Qt(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function sge(t,e){const r=function(...u){const f=t.interface.getFunction(e,u);return st(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),f},n=async function(...u){const f=r(...u);let h={};if(f.inputs.length+1===u.length&&(h=await vQ(u.pop()),h.from&&(h.from=await fs(h.from,yQ(t.runner)))),f.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const m=await nge(t.runner,f.inputs,u);return Object.assign({},h,await Os({to:t.getAddress(),data:t.interface.encodeFunctionData(f,m)}))},i=async function(...u){const f=await o(...u);return f.length===1?f[0]:f},s=async function(...u){const f=t.runner;st(mQ(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const h=await f.sendTransaction(await n(...u)),m=Jd(t.runner);return new I5(t.interface,m,h)},a=async function(...u){const f=Dh(t.runner,"estimateGas");return st(gQ(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...u))},o=async function(...u){const f=Dh(t.runner,"call");st(pQ(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const h=await n(...u);let m="0x";try{m=await f.call(h)}catch(w){throw a5(w)&&w.data?t.interface.makeError(w.data,h):w}const y=r(...u);return t.interface.decodeFunctionResult(y,m)},c=async(...u)=>r(...u).constant?await i(...u):await s(...u);return Qt(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:a,populateTransaction:n,send:s,staticCall:i,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return st(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function age(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return st(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new rge(t,r(...i),i)};return Qt(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return st(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const JE=Symbol.for("_ethersInternal_contract"),bQ=new WeakMap;function oge(t,e){bQ.set(t[JE],e)}function $a(t){return bQ.get(t[JE])}function cge(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function P5(t,e){let r,n=null;if(Array.isArray(e)){const s=function(a){if(ci(a,32))return a;const o=t.interface.getEvent(a);return Ne(o,"unknown fragment","name",a),o.topicHash};r=e.map(a=>a==null?null:Array.isArray(a)?a.map(s):s(a))}else e==="*"?r=[null]:typeof e=="string"?ci(e,32)?r=[e]:(n=t.interface.getEvent(e),Ne(n,"unknown fragment","event",e),r=[n.topicHash]):cge(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):Ne(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const a=Array.from(new Set(s.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function av(t,e){const{subs:r}=$a(t);return r.get((await P5(t,e)).tag)||null}async function G9(t,e,r){const n=Jd(t.runner);st(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:a}=await P5(t,r),{addr:o,subs:c}=$a(t);let u=c.get(s);if(!u){const h={address:o||t,topics:a},m=g=>{let _=i;if(_==null)try{_=t.interface.getEvent(g.topics[0])}catch{}if(_){const b=_,S=i?t.interface.decodeEventLog(i,g.data,g.topics):[];oN(t,r,S,A=>new tge(t,A,r,b,g))}else oN(t,r,[],b=>new hQ(t,b,r,g))};let y=[];u={tag:s,listeners:[],start:()=>{y.length||y.push(n.on(h,m))},stop:async()=>{if(y.length==0)return;let g=y;y=[],await Promise.all(g),n.off(h,m)}},c.set(s,u)}return u}let aN=Promise.resolve();async function uge(t,e,r,n){await aN;const i=await av(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:a,once:o})=>{const c=Array.from(r);n&&c.push(n(o?null:a));try{a.call(t,...c)}catch{}return!o}),i.listeners.length===0&&(i.stop(),$a(t).subs.delete(i.tag)),s>0}async function oN(t,e,r,n){try{await aN}catch{}const i=uge(t,e,r,n);return aN=i,await i}const Yw=["then"];var e$e;const Kv=class Kv{constructor(e,r,n,i){Fe(this,"target");Fe(this,"interface");Fe(this,"runner");Fe(this,"filters");Fe(this,e$e);Fe(this,"fallback");Ne(typeof e=="string"||_Y(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=sN.from(r);Qt(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,JE,{value:{}});let a,o=null,c=null;if(i){const h=Jd(n);c=new I5(this.interface,h,i)}let u=new Map;if(typeof e=="string")if(ci(e))o=e,a=Promise.resolve(e);else{const h=Dh(n,"resolveName");if(!l2(h))throw Li("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=h.resolveName(e).then(m=>{if(m==null)throw Li("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return $a(this).addr=m,m})}else a=e.getAddress().then(h=>{if(h==null)throw new Error("TODO");return $a(this).addr=h,h});oge(this,{addrPromise:a,addr:o,deployTx:c,subs:u});const f=new Proxy({},{get:(h,m,y)=>{if(typeof m=="symbol"||Yw.indexOf(m)>=0)return Reflect.get(h,m,y);try{return this.getEvent(m)}catch(w){if(!Io(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(h,m)=>Yw.indexOf(m)>=0?Reflect.has(h,m):Reflect.has(h,m)||this.interface.hasEvent(String(m))});return Qt(this,{filters:f}),Qt(this,{fallback:s.receive||s.fallback?ige(this):null}),new Proxy(this,{get:(h,m,y)=>{if(typeof m=="symbol"||m in h||Yw.indexOf(m)>=0)return Reflect.get(h,m,y);try{return h.getFunction(m)}catch(w){if(!Io(w,"INVALID_ARGUMENT")||w.argument!=="key")throw w}},has:(h,m)=>typeof m=="symbol"||m in h||Yw.indexOf(m)>=0?Reflect.has(h,m):h.interface.hasFunction(m)})}connect(e){return new Kv(this.target,this.interface,e)}attach(e){return new Kv(e,this.interface,this.runner)}async getAddress(){return await $a(this).addrPromise}async getDeployedCode(){const e=Jd(this.runner);st(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Jd(this.runner);return st(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",a)}catch(o){s(o)}};a()})}deploymentTransaction(){return $a(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),sge(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),age(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=$a(this),a=i||await s,{fragment:o,topics:c}=await P5(this,e),u={address:a,topics:c,fromBlock:r,toBlock:n},f=Jd(this.runner);return st(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(u)).map(h=>{let m=o;if(m==null)try{m=this.interface.getEvent(h.topics[0])}catch{}if(m)try{return new O5(h,this.interface,m)}catch(y){return new dQ(h,y)}return new y1(h,f)})}async on(e,r){const n=await G9(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await G9(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await oN(this,e,r,null)}async listenerCount(e){if(e){const i=await av(this,e);return i?i.listeners.length:0}const{subs:r}=$a(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await av(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=$a(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await av(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),$a(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await av(this,e);if(!r)return this;r.stop(),$a(this).subs.delete(r.tag)}else{const{subs:r}=$a(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Kv{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};e$e=JE;let cN=Kv;function lge(){return cN}class kv extends lge(){}function wO(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ne(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class fge{constructor(e){Fe(this,"name");Qt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const wQ=new RegExp("^(ipfs)://(.*)$","i"),K9=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),wQ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var of,uh,cf,Hp,Mx,_Q;const l0=class l0{constructor(e,r,n){Je(this,cf);Fe(this,"provider");Fe(this,"address");Fe(this,"name");Je(this,of,void 0);Je(this,uh,void 0);Qt(this,{provider:e,address:r,name:n}),Te(this,of,null),Te(this,uh,new kv(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return W(this,of)==null&&Te(this,of,(async()=>{try{return await W(this,uh).supportsInterface("0x9061b923")}catch(e){if(Io(e,"CALL_EXCEPTION"))return!1;throw Te(this,of,null),e}})()),await W(this,of)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await ut(this,cf,Hp).call(this,"addr(bytes32)");return s==null||s===JR?null:s}catch(s){if(Io(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const a=await ut(this,cf,Hp).call(this,"addr(bytes32,uint)",[s]);if(ci(a,20))return cn(a)}let r=null;for(const s of this.provider.plugins)if(s instanceof fge&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await ut(this,cf,Hp).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;st(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await ut(this,cf,Hp).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await ut(this,cf,Hp).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${gW("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;st(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<K9.length;n++){const i=r.match(K9[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const a=wO(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:a}),{linkage:e,url:a}}case"erc721":case"erc1155":{const a=s==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:s,value:r});const o=await this.getAddress();if(o==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(i[2]||"").split("/");if(c.length!==2)return e.push({type:`!${s}caip`,value:i[2]||""}),{url:null,linkage:e};const u=c[1],f=new kv(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(s==="erc721"){const v=await f.ownerOf(u);if(o!==v)return e.push({type:"!owner",value:v}),{url:null,linkage:e};e.push({type:"owner",value:v})}else if(s==="erc1155"){const v=await f.balanceOf(o,u);if(!v)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:v.toString()})}let h=await f[a](u);if(h==null||h==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:h}),s==="erc1155"&&(h=h.replace("{id}",dl(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:h})),h.match(/^ipfs:/i)&&(h=wO(h)),e.push({type:"metadata-url",value:h});let m={};const y=await new Bf(h).send();y.assertOk();try{m=y.bodyJson}catch{try{e.push({type:"!metadata",value:y.bodyText})}catch{const _=y.body;return _&&e.push({type:"!metadata",value:_t(_)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!m)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(m)});let w=m.image;if(typeof w!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!w.match(/^(https:\/\/|data:)/i)){if(w.match(wQ)==null)return e.push({type:"!imageUrl-ipfs",value:w}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:w}),w=wO(w)}return e.push({type:"url",value:w}),{linkage:e,url:w}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return st(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async fromName(e,r){var i;let n=r;for(;;){if(n===""||n==="."||r!=="eth"&&n==="eth")return null;const s=await ut(i=l0,Mx,_Q).call(i,e,n);if(s!=null){const a=new l0(e,s,r);return n!==r&&!await a.supportsWildcard()?null:a}n=n.split(".").slice(1).join(".")}}};of=new WeakMap,uh=new WeakMap,cf=new WeakSet,Hp=async function(e,r){r=(r||[]).slice();const n=W(this,uh).interface;r.unshift(nN(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),st(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),r=[m0e(this.name),n.encodeFunctionData(i,r)],e="resolve(bytes,bytes)"),r.push({enableCcipRead:!0});try{const s=await W(this,uh)[e](...r);return i?n.decodeFunctionResult(i,s)[0]:s}catch(s){if(!Io(s,"CALL_EXCEPTION"))throw s}return null},Mx=new WeakSet,_Q=async function(e,r){const n=await l0.getEnsAddress(e);try{const s=await new kv(n,["function resolver(bytes32) view returns (address)"],e).resolver(nN(r),{enableCcipRead:!0});return s===JR?null:s}catch(i){throw i}return null},Je(l0,Mx);let XE=l0;const W9=BigInt(0);function ai(t,e){return function(r){return r==null?e:t(r)}}function T5(t){return e=>{if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>t(r))}}function v1(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const a of e[i])if(a in r){s=a;break}}try{const a=t[i](r[s]);a!==void 0&&(n[i]=a)}catch(a){const o=a instanceof Error?a.message:"not-an-error";st(!1,`invalid value for value.${i} (${o})`,"BAD_DATA",{value:r})}}return n}}function dge(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Ne(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function kg(t){return Ne(ci(t,!0),"invalid data","value",t),t}function Po(t){return Ne(ci(t,32),"invalid hash","value",t),t}const hge=v1({address:cn,blockHash:Po,blockNumber:jr,data:kg,index:jr,removed:ai(dge,!1),topics:T5(Po),transactionHash:Po,transactionIndex:jr},{index:["logIndex"]});function pge(t){return hge(t)}const gge=v1({hash:ai(Po),parentHash:Po,number:jr,timestamp:jr,nonce:ai(kg),difficulty:nr,gasLimit:nr,gasUsed:nr,miner:ai(cn),extraData:kg,baseFeePerGas:ai(nr)});function mge(t){const e=gge(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:EQ(r)),e}const yge=v1({transactionIndex:jr,blockNumber:jr,transactionHash:Po,address:cn,topics:T5(Po),data:kg,index:jr,blockHash:Po},{index:["logIndex"]});function vge(t){return yge(t)}const bge=v1({to:ai(cn,null),from:ai(cn,null),contractAddress:ai(cn,null),index:jr,root:ai(_t),gasUsed:nr,logsBloom:ai(kg),blockHash:Po,hash:Po,logs:T5(vge),blockNumber:jr,cumulativeGasUsed:nr,effectiveGasPrice:ai(nr),status:ai(jr),type:ai(jr,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function wge(t){return bge(t)}function EQ(t){t.to&&nr(t.to)===W9&&(t.to="0x0000000000000000000000000000000000000000");const e=v1({hash:Po,type:r=>r==="0x"||r==null?0:jr(r),accessList:ai(Vh,null),blockHash:ai(Po,null),blockNumber:ai(jr,null),transactionIndex:ai(jr,null),from:cn,gasPrice:ai(nr),maxPriorityFeePerGas:ai(nr),maxFeePerGas:ai(nr),gasLimit:nr,to:ai(cn,null),value:nr,nonce:jr,data:kg,creates:ai(cn,null),chainId:ai(nr,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=bpe(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=bc.from(t.signature):e.signature=bc.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&nr(e.blockHash)===W9&&(e.blockHash=null),e}const _ge="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class b1{constructor(e){Fe(this,"name");Qt(this,{name:e})}clone(){return new b1(this.name)}}class f2 extends b1{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);Fe(this,"effectiveBlock");Fe(this,"txBase");Fe(this,"txCreate");Fe(this,"txDataZero");Fe(this,"txDataNonzero");Fe(this,"txAccessListStorageKey");Fe(this,"txAccessListAddress");const i={effectiveBlock:r};function s(a,o){let c=(n||{})[a];c==null&&(c=o),Ne(typeof c=="number",`invalud value for ${a}`,"costs",n),i[a]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),Qt(this,i)}clone(){return new f2(this.effectiveBlock,this)}}class d2 extends b1{constructor(r,n){super("org.ethers.plugins.network.Ens");Fe(this,"address");Fe(this,"targetNetwork");Qt(this,{address:r||_ge,targetNetwork:n??1})}clone(){return new d2(this.address,this.targetNetwork)}}var Gb,Kb;class xQ extends b1{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Je(this,Gb,void 0);Je(this,Kb,void 0);Te(this,Gb,r),Te(this,Kb,n)}get url(){return W(this,Gb)}get processFunc(){return W(this,Kb)}clone(){return this}}Gb=new WeakMap,Kb=new WeakMap;const _O=new Map;var og,cg,uf;const f0=class f0{constructor(e,r){Je(this,og,void 0);Je(this,cg,void 0);Je(this,uf,void 0);Te(this,og,e),Te(this,cg,nr(r)),Te(this,uf,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return W(this,og)}set name(e){Te(this,og,e)}get chainId(){return W(this,cg)}set chainId(e){Te(this,cg,nr(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===nr(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===nr(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===nr(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(W(this,uf).values())}attachPlugin(e){if(W(this,uf).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return W(this,uf).set(e.name,e.clone()),this}getPlugin(e){return W(this,uf).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new f0(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new f2;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=Vh(e.accessList);for(const s in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[s].storageKeys.length}return n}static from(e){if(xge(),e==null)return f0.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=_O.get(e);if(r)return r();if(typeof e=="bigint")return new f0("unknown",e);Ne(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){Ne(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new f0(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new d2(e.ensAddress,e.ensNetwork)),r}Ne(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=_O.get(e);n&&Ne(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),_O.set(e,r)}};og=new WeakMap,cg=new WeakMap,uf=new WeakMap;let nl=f0;function Y9(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function Q9(t){return new xQ(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,a]=await Promise.all([n.send(),e()]);i=s;const o=i.bodyJson.standard;return{gasPrice:a.gasPrice,maxFeePerGas:Y9(o.maxFee,9),maxPriorityFeePerGas:Y9(o.maxPriorityFee,9)}}catch(s){st(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}function Ege(t){return new xQ("data:",async(e,r,n)=>{const i=await e();if(i.maxFeePerGas==null||i.maxPriorityFeePerGas==null)return i;const s=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:s+t,maxPriorityFeePerGas:t}})}let J9=!1;function xge(){if(J9)return;J9=!0;function t(e,r,n){const i=function(){const s=new nl(e,r);return n.ensNetwork!=null&&s.attachPlugin(new d2(null,n.ensNetwork)),s.attachPlugin(new f2),(n.plugins||[]).forEach(a=>{s.attachPlugin(a)}),s};nl.register(e,i),nl.register(r,i),n.altNames&&n.altNames.forEach(s=>{nl.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[Q9("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Q9("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[Ege(BigInt("1000000"))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function uN(t){return JSON.parse(JSON.stringify(t))}var Ku,yo,lf,qc,ug,Y_;class Age{constructor(e){Je(this,ug);Je(this,Ku,void 0);Je(this,yo,void 0);Je(this,lf,void 0);Je(this,qc,void 0);Te(this,Ku,e),Te(this,yo,null),Te(this,lf,4e3),Te(this,qc,-2)}get pollingInterval(){return W(this,lf)}set pollingInterval(e){Te(this,lf,e)}start(){W(this,yo)||(Te(this,yo,W(this,Ku)._setTimeout(ut(this,ug,Y_).bind(this),W(this,lf))),ut(this,ug,Y_).call(this))}stop(){W(this,yo)&&(W(this,Ku)._clearTimeout(W(this,yo)),Te(this,yo,null))}pause(e){this.stop(),e&&Te(this,qc,-2)}resume(){this.start()}}Ku=new WeakMap,yo=new WeakMap,lf=new WeakMap,qc=new WeakMap,ug=new WeakSet,Y_=async function(){try{const e=await W(this,Ku).getBlockNumber();if(W(this,qc)===-2){Te(this,qc,e);return}if(e!==W(this,qc)){for(let r=W(this,qc)+1;r<=e;r++){if(W(this,yo)==null)return;await W(this,Ku).emit("block",r)}Te(this,qc,e)}}catch{}W(this,yo)!=null&&Te(this,yo,W(this,Ku)._setTimeout(ut(this,ug,Y_).bind(this),W(this,lf)))};var lh,fh,ff;class AQ{constructor(e){Je(this,lh,void 0);Je(this,fh,void 0);Je(this,ff,void 0);Te(this,lh,e),Te(this,ff,!1),Te(this,fh,r=>{this._poll(r,W(this,lh))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){W(this,ff)||(Te(this,ff,!0),W(this,fh).call(this,-2),W(this,lh).on("block",W(this,fh)))}stop(){W(this,ff)&&(Te(this,ff,!1),W(this,lh).off("block",W(this,fh)))}pause(e){this.stop()}resume(){this.start()}}lh=new WeakMap,fh=new WeakMap,ff=new WeakMap;var kx;class Sge extends AQ{constructor(r,n){super(r);Je(this,kx,void 0);Te(this,kx,uN(n))}async _poll(r,n){throw new Error("@TODO")}}kx=new WeakMap;var lg;class Oge extends AQ{constructor(r,n){super(r);Je(this,lg,void 0);Te(this,lg,n)}async _poll(r,n){const i=await n.getTransactionReceipt(W(this,lg));i&&n.emit(W(this,lg),i)}}lg=new WeakMap;var Wu,fg,dg,df,vo,$x,SQ;class C5{constructor(e,r){Je(this,$x);Je(this,Wu,void 0);Je(this,fg,void 0);Je(this,dg,void 0);Je(this,df,void 0);Je(this,vo,void 0);Te(this,Wu,e),Te(this,fg,uN(r)),Te(this,dg,ut(this,$x,SQ).bind(this)),Te(this,df,!1),Te(this,vo,-2)}start(){W(this,df)||(Te(this,df,!0),W(this,vo)===-2&&W(this,Wu).getBlockNumber().then(e=>{Te(this,vo,e)}),W(this,Wu).on("block",W(this,dg)))}stop(){W(this,df)&&(Te(this,df,!1),W(this,Wu).off("block",W(this,dg)))}pause(e){this.stop(),e&&Te(this,vo,-2)}resume(){this.start()}}Wu=new WeakMap,fg=new WeakMap,dg=new WeakMap,df=new WeakMap,vo=new WeakMap,$x=new WeakSet,SQ=async function(e){if(W(this,vo)===-2)return;const r=uN(W(this,fg));r.fromBlock=W(this,vo)+1,r.toBlock=e;const n=await W(this,Wu).getLogs(r);if(n.length===0){W(this,vo)<e-60&&Te(this,vo,e-60);return}for(const i of n)W(this,Wu).emit(W(this,fg),i),Te(this,vo,i.blockNumber)};const Ige=BigInt(2),Pge=10;function Qw(t){return t&&typeof t.then=="function"}function Q_(t,e){return t+":"+JSON.stringify(e,(r,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,a)=>(s[a]=n[a],s),{})}return n})}class OQ{constructor(e){Fe(this,"name");Qt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Tge(t){return JSON.parse(JSON.stringify(t))}function lN(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function EO(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"pending":case"debug":case"error":case"network":return{type:t,tag:t}}if(ci(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:Q_("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:Q_("orphan",r),filter:Tge(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?lN(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],a=o=>{ci(o)?i.push(o):s.push((async()=>{i.push(await fs(o,e))})())};Array.isArray(r.address)?r.address.forEach(a):a(r.address),s.length&&await Promise.all(s),n.address=lN(i.map(o=>o.toLowerCase()))}return{filter:n,tag:Q_("event",n),type:"event"}}Ne(!1,"unknown ProviderEvent","event",t)}function xO(){return new Date().getTime()}const Cge={cacheTimeout:250,pollingInterval:4e3};var As,hf,Ss,hg,ja,dh,pf,Yu,Wb,bo,pg,gg,fa,oo,Yb,fN,Qb,dN,hh,ov,Jb,hN,ph,cv,mg,J_;class Rge{constructor(e,r){Je(this,fa);Je(this,Yb);Je(this,Qb);Je(this,hh);Je(this,Jb);Je(this,ph);Je(this,mg);Je(this,As,void 0);Je(this,hf,void 0);Je(this,Ss,void 0);Je(this,hg,void 0);Je(this,ja,void 0);Je(this,dh,void 0);Je(this,pf,void 0);Je(this,Yu,void 0);Je(this,Wb,void 0);Je(this,bo,void 0);Je(this,pg,void 0);Je(this,gg,void 0);if(Te(this,gg,Object.assign({},Cge,r||{})),e==="any")Te(this,dh,!0),Te(this,ja,null);else if(e){const n=nl.from(e);Te(this,dh,!1),Te(this,ja,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else Te(this,dh,!1),Te(this,ja,null);Te(this,Yu,-1),Te(this,pf,new Map),Te(this,As,new Map),Te(this,hf,new Map),Te(this,Ss,null),Te(this,hg,!1),Te(this,Wb,1),Te(this,bo,new Map),Te(this,pg,!1)}get pollingInterval(){return W(this,gg).pollingInterval}get provider(){return this}get plugins(){return Array.from(W(this,hf).values())}attachPlugin(e){if(W(this,hf).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return W(this,hf).set(e.name,e.connect(this)),this}getPlugin(e){return W(this,hf).get(e)||null}get disableCcipRead(){return W(this,pg)}set disableCcipRead(e){Te(this,pg,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),a=[];for(let o=0;o<n.length;o++){const c=n[o],u=c.replace("{sender}",i).replace("{data}",s),f=new Bf(u);c.indexOf("{data}")===-1&&(f.body={data:s,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:f,index:o,urls:n});let h="unknown error";const m=await f.send();try{const y=m.bodyJson;if(y.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:f,result:y}),y.data;y.message&&(h=y.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:f,result:y})}catch{}st(m.statusCode<400||m.statusCode>=500,`response not found during CCIP fetch: ${h}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:h}}),a.push(h)}st(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:a}})}_wrapBlock(e,r){return new J0e(mge(e),this)}_wrapLog(e,r){return new y1(pge(e),this)}_wrapTransactionReceipt(e,r){return new uQ(wge(e),this)}_wrapTransactionResponse(e,r){return new bb(EQ(e),this)}_detectNetwork(){st(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){st(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=jr(await ut(this,fa,oo).call(this,{method:"getBlockNumber"}),"%response");return W(this,Yu)>=0&&Te(this,Yu,e),e}_getAddress(e){return fs(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(ci(e))return ci(e,32)?e:i0(e);if(typeof e=="bigint"&&(e=jr(e,"blockTag")),typeof e=="number")return e>=0?i0(e):W(this,Yu)>=0?i0(W(this,Yu)+e):this.getBlockNumber().then(r=>i0(r+e));Ne(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?lN(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,u,f)=>{let h;switch(c.length){case 0:break;case 1:h=c[0];break;default:c.sort(),h=c}if(n&&(u!=null||f!=null))throw new Error("invalid filter");const m={};return h&&(m.address=h),r.length&&(m.topics=r),u&&(m.fromBlock=u),f&&(m.toBlock=f),n&&(m.blockHash=n),m};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(s),a,o]).then(c=>i(c[0],c[1],c[2])):i(s,a,o)}_getTransactionRequest(e){const r=QE(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=fs(r[i],this);Qw(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);Qw(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(W(this,ja)==null){const i=this._detectNetwork().then(s=>(this.emit("network",s,null),s),s=>{throw W(this,ja)===i&&Te(this,ja,null),s});return Te(this,ja,i),(await i).clone()}const e=W(this,ja),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(W(this,dh)?(this.emit("network",n,r),W(this,ja)===e&&Te(this,ja,Promise.resolve(n))):st(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s}=await Os({_block:ut(this,Jb,hN).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ut(this,fa,oo).call(this,{method:"getGasPrice"});return nr(u,"%response")}catch{}return null})()});let a=null,o=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(o=BigInt("1000000000"),a=c.baseFeePerGas*Ige+o),new z9(s,a,o)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new Bf(n.url),s=await n.processFunc(r,this,i);return new z9(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return Qw(r)&&(r=await r),nr(await ut(this,fa,oo).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await Os({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ut(this,Qb,dN).call(this,ut(this,Yb,fN).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return nr(await ut(this,hh,ov).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return jr(await ut(this,hh,ov).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return _t(await ut(this,hh,ov).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=nr(r,"position");return _t(await ut(this,hh,ov).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await Os({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=mb.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await Os({network:this.getNetwork(),params:ut(this,Jb,hN).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await Os({network:this.getNetwork(),params:ut(this,fa,oo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await Os({network:this.getNetwork(),params:ut(this,fa,oo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await ut(this,fa,oo).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await Os({network:this.getNetwork(),result:ut(this,fa,oo).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:_t(r)}async getLogs(e){let r=this._getFilter(e);Qw(r)&&(r=await r);const{network:n,params:i}=await Os({network:this.getNetwork(),params:ut(this,fa,oo).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){st(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await XE.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=cn(e);const r=nN(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await XE.getEnsAddress(this),s=await new kv(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===JR)return null;const o=await new kv(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(o)!==e?null:o}catch(n){if(Io(n,"BAD_DATA")&&n.value==="0x"||Io(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,a)=>{let o=null;const c=async u=>{try{const f=await this.getTransactionReceipt(e);if(f!=null&&u-f.blockNumber+1>=i){s(f),o&&(clearTimeout(o),o=null);return}}catch(f){console.log("EEE",f)}this.once("block",c)};n!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",c),a(Li("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){st(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=W(this,bo).get(e);r&&(r.timer&&clearTimeout(r.timer),W(this,bo).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=Mm(this,Wb)._++,i=()=>{W(this,bo).delete(n),e()};if(this.paused)W(this,bo).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);W(this,bo).set(n,{timer:s,func:i,time:xO()})}return n}_forEachSubscriber(e){for(const r of W(this,As).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new OQ(e.type);case"block":{const r=new Age(this);return r.pollingInterval=this.pollingInterval,r}case"event":return new C5(this,e.filter);case"transaction":return new Oge(this,e.hash);case"orphan":return new Sge(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of W(this,As).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),W(this,Ss)!=null&&r.pause(W(this,Ss));break}}async on(e,r){const n=await ut(this,mg,J_).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,W(this,Ss)!=null&&n.subscriber.pause(W(this,Ss))),this}async once(e,r){const n=await ut(this,mg,J_).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,W(this,Ss)!=null&&n.subscriber.pause(W(this,Ss))),this}async emit(e,...r){const n=await ut(this,ph,cv).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:a})=>{const o=new mW(this,a?null:s,e);try{s.call(this,...r,o)}catch{}return!a}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),W(this,As).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await ut(this,ph,cv).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of W(this,As).values())r+=n.length;return r}async listeners(e){if(e){const n=await ut(this,ph,cv).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of W(this,As).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await ut(this,ph,cv).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),W(this,As).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await ut(this,mg,J_).call(this,e);n&&i.stop(),W(this,As).delete(r)}else for(const[r,{started:n,subscriber:i}]of W(this,As))n&&i.stop(),W(this,As).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return W(this,hg)}destroy(){this.removeAllListeners();for(const e of W(this,bo).keys())this._clearTimeout(e);Te(this,hg,!0)}get paused(){return W(this,Ss)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(Te(this,Yu,-1),W(this,Ss)!=null){if(W(this,Ss)==!!e)return;st(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),Te(this,Ss,!!e);for(const r of W(this,bo).values())r.timer&&clearTimeout(r.timer),r.time=xO()-r.time}resume(){if(W(this,Ss)!=null){this._forEachSubscriber(e=>e.resume()),Te(this,Ss,null);for(const e of W(this,bo).values()){let r=e.time;r<0&&(r=0),e.time=xO(),setTimeout(e.func,r)}}}}As=new WeakMap,hf=new WeakMap,Ss=new WeakMap,hg=new WeakMap,ja=new WeakMap,dh=new WeakMap,pf=new WeakMap,Yu=new WeakMap,Wb=new WeakMap,bo=new WeakMap,pg=new WeakMap,gg=new WeakMap,fa=new WeakSet,oo=async function(e){const r=W(this,gg).cacheTimeout;if(r<0)return await this._perform(e);const n=Q_(e.method,e);let i=W(this,pf).get(n);return i||(i=this._perform(e),W(this,pf).set(n,i),setTimeout(()=>{W(this,pf).get(n)===i&&W(this,pf).delete(n)},r)),await i},Yb=new WeakSet,fN=async function(e,r,n){st(n<Pge,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const i=QE(e);try{return _t(await this._perform({method:"call",transaction:i,blockTag:r}))}catch(s){if(!this.disableCcipRead&&a5(s)&&s.data&&n>=0&&r==="latest"&&i.to!=null&&Kn(s.data,0,4)==="0x556f1830"){const a=s.data,o=await fs(i.to,this);let c;try{c=$ge(Kn(s.data,4))}catch(h){st(!1,h.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:a}})}st(c.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(i,c.calldata,c.urls);st(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});const f={to:o,data:Hn([c.selector,kge([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:f});try{const h=await ut(this,Yb,fN).call(this,f,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},f),result:h}),h}catch(h){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},f),error:h}),h}}throw s}},Qb=new WeakSet,dN=async function(e){const{value:r}=await Os({network:this.getNetwork(),value:e});return r},hh=new WeakSet,ov=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await ut(this,Qb,dN).call(this,ut(this,fa,oo).call(this,Object.assign(e,{address:i,blockTag:s})))},Jb=new WeakSet,hN=async function(e,r){if(ci(e,32))return await ut(this,fa,oo).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await ut(this,fa,oo).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},ph=new WeakSet,cv=async function(e,r){let n=await EO(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await EO({orphan:"drop-log",log:r[0]},this)),W(this,As).get(n.tag)||null},mg=new WeakSet,J_=async function(e){const r=await EO(e,this),n=r.tag;let i=W(this,As).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},W(this,As).set(n,i)),i};function Nge(t,e){try{const r=pN(t,e);if(r)return o5(r)}catch{}return null}function pN(t,e){if(t==="0x")return null;try{const r=jr(Kn(t,e,e+32)),n=jr(Kn(t,r,r+32));return Kn(t,r+32,r+32+n)}catch{}return null}function X9(t){const e=ba(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Dge(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Mge=new Uint8Array([]);function kge(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(Mge),r+=32;for(let n=0;n<t.length;n++){const i=Ht(t[n]);e[n]=X9(r),e.push(X9(i.length)),e.push(Dge(i)),r+=32+Math.ceil(i.length/32)*32}return Hn(e)}const Z9="0x0000000000000000000000000000000000000000000000000000000000000000";function $ge(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};st(E0(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=Kn(t,0,32);st(Kn(r,0,12)===Kn(Z9,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Kn(r,12);try{const n=[],i=jr(Kn(t,32,64)),s=jr(Kn(t,i,i+32)),a=Kn(t,i+32);for(let o=0;o<s;o++){const c=Nge(a,o*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{st(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=pN(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{st(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}st(Kn(t,100,128)===Kn(Z9,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Kn(t,96,100);try{const n=pN(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{st(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function Ip(t,e){if(t.provider)return t.provider;st(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function e7(t,e){let r=QE(e);if(r.to!=null&&(r.to=fs(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),fs(n,t)]).then(([i,s])=>(Ne(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await Os(r)}class R5{constructor(e){Fe(this,"provider");Qt(this,{provider:e||null})}async getNonce(e){return Ip(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await e7(this,e)}async populateTransaction(e){const r=Ip(this,"populateTransaction"),n=await e7(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const a=nr(n.chainId);Ne(a===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?Ne(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&Ne(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const a=await r.getFeeData();st(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice)}else{const a=await r.getFeeData();if(n.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const o=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=o,n.maxPriorityFeePerGas=o}else n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(st(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=a.gasPrice),n.type=0):st(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else n.type===2&&(n.maxFeePerGas==null&&(n.maxFeePerGas=a.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await Os(n)}async estimateGas(e){return Ip(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Ip(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Ip(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=Ip(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=mb.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var yg,X_;const OM=class OM extends R5{constructor(r,n){super(n);Je(this,yg);Fe(this,"address");Qt(this,{address:r})}async getAddress(){return this.address}connect(r){return new OM(this.address,r)}async signTransaction(r){ut(this,yg,X_).call(this,"transactions","signTransaction")}async signMessage(r){ut(this,yg,X_).call(this,"messages","signMessage")}async signTypedData(r,n,i){ut(this,yg,X_).call(this,"typed-data","signTypedData")}};yg=new WeakSet,X_=function(r,n){st(!1,`VoidSigner cannot sign ${r}`,"UNSUPPORTED_OPERATION",{operation:n})};let gN=OM;function Lge(t){return JSON.parse(JSON.stringify(t))}var da,Hc,gh,gf,mh,vg,Xb,mN,Zb,yN;class IQ{constructor(e){Je(this,Xb);Je(this,Zb);Je(this,da,void 0);Je(this,Hc,void 0);Je(this,gh,void 0);Je(this,gf,void 0);Je(this,mh,void 0);Je(this,vg,void 0);Te(this,da,e),Te(this,Hc,null),Te(this,gh,ut(this,Xb,mN).bind(this)),Te(this,gf,!1),Te(this,mh,null),Te(this,vg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){W(this,gf)||(Te(this,gf,!0),ut(this,Xb,mN).call(this,-2))}stop(){W(this,gf)&&(Te(this,gf,!1),Te(this,vg,!0),ut(this,Zb,yN).call(this),W(this,da).off("block",W(this,gh)))}pause(e){e&&ut(this,Zb,yN).call(this),W(this,da).off("block",W(this,gh))}resume(){this.start()}}da=new WeakMap,Hc=new WeakMap,gh=new WeakMap,gf=new WeakMap,mh=new WeakMap,vg=new WeakMap,Xb=new WeakSet,mN=async function(e){try{W(this,Hc)==null&&Te(this,Hc,this._subscribe(W(this,da)));let r=null;try{r=await W(this,Hc)}catch(s){if(!Io(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(r==null){Te(this,Hc,null),W(this,da)._recoverSubscriber(this,this._recover(W(this,da)));return}const n=await W(this,da).getNetwork();if(W(this,mh)||Te(this,mh,n),W(this,mh).chainId!==n.chainId)throw new Error("chaid changed");if(W(this,vg))return;const i=await W(this,da).send("eth_getFilterChanges",[r]);await this._emitResults(W(this,da),i)}catch(r){console.log("@TODO",r)}W(this,da).once("block",W(this,gh))},Zb=new WeakSet,yN=function(){const e=W(this,Hc);e&&(Te(this,Hc,null),e.then(r=>{W(this,da).send("eth_uninstallFilter",[r])}))};var yh;class Uge extends IQ{constructor(r,n){super(r);Je(this,yh,void 0);Te(this,yh,Lge(n))}_recover(r){return new C5(r,W(this,yh))}async _subscribe(r){return await r.send("eth_newFilter",[W(this,yh)])}async _emitResults(r,n){for(const i of n)r.emit(W(this,yh),r._wrapLog(i,r._network))}}yh=new WeakMap;class jge extends IQ{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const Bge="bigint,boolean,function,number,string,symbol".split(/,/g);function Z_(t){if(t==null||Bge.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(Z_);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Fge(t){return new Promise(e=>{setTimeout(e,t)})}function Pp(t){return t&&t.toLowerCase()}function t7(t){return t&&typeof t.pollingInterval=="number"}const qge={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class AO extends R5{constructor(r,n){super(r);Fe(this,"address");n=cn(n),Qt(this,{address:n})}connect(r){st(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=Z_(r),i=[];if(n.from){const a=n.from;i.push((async()=>{const o=await fs(a,this.provider);Ne(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=o})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const a=n.to;i.push((async()=>{n.to=await fs(a,this.provider)})())}i.length&&await Promise.all(i);const s=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((s,a)=>{const o=[1e3,100],c=async()=>{const u=await this.provider.getTransaction(i);if(u!=null){s(u.replaceableTransaction(n));return}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(r){const n=Z_(r);if(n.from){const s=await fs(n.from,this.provider);Ne(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=s}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Xs(r):r;return await this.provider.send("personal_sign",[_t(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const s=Z_(i),a=await Mg.resolveNames(r,n,s,async o=>{const c=await fs(o);return Ne(c!=null,"TypedData does not support null address","value",o),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Mg.getPayload(a.domain,n,a.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Xs(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),_t(n)])}}var vh,bg,Qu,zc,uc,Ju,e1,vN;class Hge extends Rge{constructor(r,n){super(r,n);Je(this,e1);Je(this,vh,void 0);Je(this,bg,void 0);Je(this,Qu,void 0);Je(this,zc,void 0);Je(this,uc,void 0);Je(this,Ju,void 0);Te(this,bg,1),Te(this,vh,Object.assign({},qge,n||{})),Te(this,Qu,[]),Te(this,zc,null),Te(this,Ju,null);{let s=null;const a=new Promise(o=>{s=o});Te(this,uc,{promise:a,resolve:s})}const i=this._getOption("staticNetwork");i&&(Ne(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),Te(this,Ju,i))}_getOption(r){return W(this,vh)[r]}get _network(){return st(W(this,Ju),"network is not available yet","NETWORK_ERROR"),W(this,Ju)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&nr(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)return r;if(this.ready)return nl.from(nr(await this.send("eth_chainId",[])));const n={id:Mm(this,bg)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0]}catch(s){throw this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return nl.from(nr(i.result));throw this.getRpcError(n,i)}_start(){W(this,uc)==null||W(this,uc).resolve==null||(W(this,uc).resolve(),Te(this,uc,null),(async()=>{for(;W(this,Ju)==null&&!this.destroyed;)try{Te(this,Ju,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Li("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await Fge(1e3)}ut(this,e1,vN).call(this)})())}async _waitUntilReady(){if(W(this,uc)!=null)return await W(this,uc).promise}_getSubscriber(r){return r.type==="pending"?new jge(this):r.type==="event"?this._getOption("polling")?new C5(this,r.filter):new Uge(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new OQ("orphan"):super._getSubscriber(r)}get ready(){return W(this,uc)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let s=i;i==="gasLimit"&&(s="gas"),n[s]=i0(nr(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=_t(r[i]))}),r.accessList&&(n.accessList=Vh(r.accessList)),n}getRpcRequest(r){switch(r.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Pp(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Pp(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[Pp(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Pp(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(Pp):r.filter.address=Pp(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:s}=n;if(i==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return Li("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:s}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=bN(s),u=vb.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return u.info={error:s,payload:r},u}const a=JSON.stringify(Vge(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return Li("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:s}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return Li("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(a.match(/nonce/i)&&a.match(/too low/i))return Li("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return Li("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(a.match(/only replay-protected/i))return Li("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:s}}})}let o=!!a.match(/the method .* does not exist/i);return o||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(o=!0),o?Li("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:s,payload:r}}):Li("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(Li("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=Mm(this,bg)._++,s=new Promise((a,o)=>{W(this,Qu).push({resolve:a,reject:o,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return ut(this,e1,vN).call(this),s}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const s=await n;if(r>=s.length)throw new Error("no such account");return new AO(this,s[r])}const{accounts:i}=await Os({network:this.getNetwork(),accounts:n});r=cn(r);for(const s of i)if(cn(s)===r)return new AO(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new AO(this,n))}destroy(){W(this,zc)&&(clearTimeout(W(this,zc)),Te(this,zc,null));for(const{payload:r,reject:n}of W(this,Qu))n(Li("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));Te(this,Qu,[]),super.destroy()}}vh=new WeakMap,bg=new WeakMap,Qu=new WeakMap,zc=new WeakMap,uc=new WeakMap,Ju=new WeakMap,e1=new WeakSet,vN=function(){if(W(this,zc))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Te(this,zc,setTimeout(()=>{Te(this,zc,null);const n=W(this,Qu);for(Te(this,Qu,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==W(this,vh).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(a=>a.payload)).length>W(this,vh).batchMaxSize){n.unshift(i.pop());break}(async()=>{const s=i.length===1?i[0].payload:i.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const a=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:a});for(const{resolve:o,reject:c,payload:u}of i){if(this.destroyed){c(Li("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const f=a.filter(h=>h.id===u.id)[0];if(f==null){const h=Li("missing response for request","BAD_DATA",{value:a,info:{payload:u}});this.emit("error",h),c(h);continue}if("error"in f){c(this.getRpcError(u,f));continue}o(f.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(const{reject:o}of i)o(a)}})()}},r))};var mf;class zge extends Hge{constructor(r,n){super(r,n);Je(this,mf,void 0);Te(this,mf,4e3)}_getSubscriber(r){const n=super._getSubscriber(r);return t7(n)&&(n.pollingInterval=W(this,mf)),n}get pollingInterval(){return W(this,mf)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");Te(this,mf,r),this._forEachSubscriber(n=>{t7(n)&&(n.pollingInterval=W(this,mf))})}}mf=new WeakMap;function bN(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&ci(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=bN(t[e]);if(r)return r}return null}if(typeof t=="string")try{return bN(JSON.parse(t))}catch{}return null}function wN(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)wN(t[r],e);if(typeof t=="string")try{return wN(JSON.parse(t),e)}catch{}}}function Vge(t){const e=[];return wN(t,e),e}var wg;class ZE extends zge{constructor(r,n){super(n,{batchMaxCount:1});Je(this,wg,void 0);Te(this,wg,async(i,s)=>{const a={method:i,params:s};this.emit("debug",{action:"sendEip1193Request",payload:a});try{const o=await r.request(a);return this.emit("debug",{action:"receiveEip1193Result",result:o}),o}catch(o){const c=new Error(o.message);throw c.code=o.code,c.data=o.data,c.payload=a,this.emit("debug",{action:"receiveEip1193Error",error:c}),c}})}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){Ne(!Array.isArray(r),"EIP-1193 does not support batch request","payload",r);try{const n=await W(this,wg).call(this,r.method,r.params||[]);return[{id:r.id,result:n}]}catch(n){return[{id:r.id,error:{code:n.code,data:n.data,message:n.message}}]}}getRpcError(r,n){switch(n=JSON.parse(JSON.stringify(n)),n.error.code||-1){case 4001:n.error.message=`ethers-user-denied: ${n.error.message}`;break;case 4200:n.error.message=`ethers-unsupported: ${n.error.message}`;break}return super.getRpcError(r,n)}async hasSigner(r){r==null&&(r=0);const n=await this.send("eth_accounts",[]);return typeof r=="number"?n.length>r:(r=r.toLowerCase(),n.filter(i=>i.toLowerCase()===r).length!==0)}async getSigner(r){if(r==null&&(r=0),!await this.hasSigner(r))try{await W(this,wg).call(this,"eth_requestAccounts",[])}catch(n){const i=n.payload;throw this.getRpcError(i,{id:i.id,error:n})}return await super.getSigner(r)}}wg=new WeakMap;var _g;const IM=class IM extends R5{constructor(r,n){super(n);Fe(this,"address");Je(this,_g,void 0);Ne(r&&typeof r.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Te(this,_g,r);const i=m1(this.signingKey.publicKey);Qt(this,{address:i})}get signingKey(){return W(this,_g)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(r){return new IM(W(this,_g),r)}async signTransaction(r){const{to:n,from:i}=await Os({to:r.to?fs(r.to,this.provider):void 0,from:r.from?fs(r.from,this.provider):void 0});n!=null&&(r.to=n),i!=null&&(r.from=i),r.from!=null&&(Ne(cn(r.from)===this.address,"transaction from address mismatch","tx.from",r.from),delete r.from);const s=mb.from(r);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(r){return this.signMessageSync(r)}signMessageSync(r){return this.signingKey.sign(O0e(r)).serialized}async signTypedData(r,n,i){const s=await Mg.resolveNames(r,n,i,async a=>{st(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:a}});const o=await this.provider.resolveName(a);return st(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:a}),o});return this.signingKey.sign(Mg.hash(s.domain,n,s.value)).serialized}};_g=new WeakMap;let ex=IM;const tx=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Gge=/^[a-z]*$/i;function r7(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(Gge)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function Kge(t,e){for(let i=tx.length-1;i>=0;i--)t=t.split(tx[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,a,o)=>{if(a)for(let c=parseInt(a);c>=0;c--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return r7(r7(r,";"),":")}function Wge(t){return Ne(t[0]==="0","unsupported auwl data","data",t),Kge(t.substring(1+2*tx.length),t.substring(1,1+2*tx.length))}class Yge{constructor(e){Fe(this,"locale");Qt(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var Eg,t1,bh,r1,_N;class Qge extends Yge{constructor(r,n,i){super(r);Je(this,r1);Je(this,Eg,void 0);Je(this,t1,void 0);Je(this,bh,void 0);Te(this,Eg,n),Te(this,t1,i),Te(this,bh,null)}get _data(){return W(this,Eg)}_decodeWords(){return Wge(W(this,Eg))}getWord(r){const n=ut(this,r1,_N).call(this);return Ne(r>=0&&r<n.length,`invalid word index: ${r}`,"index",r),n[r]}getWordIndex(r){return ut(this,r1,_N).call(this).indexOf(r)}}Eg=new WeakMap,t1=new WeakMap,bh=new WeakMap,r1=new WeakSet,_N=function(){if(W(this,bh)==null){const r=this._decodeWords();if(hl(r.join(`
70
- `)+`
71
- `)!==W(this,t1))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);Te(this,bh,r)}return W(this,bh)};const Jge="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",Xge="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let SO=null;class Mh extends Qge{constructor(){super("en",Jge,Xge)}static wordlist(){return SO==null&&(SO=new Mh),SO}}function PQ(t){return(1<<t)-1<<8-t&255}function Zge(t){return(1<<t)-1&255}function OO(t,e){lW("NFKD"),e==null&&(e=Mh.wordlist());const r=e.split(t);Ne(r.length%3===0&&r.length>=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let u=0;u<r.length;u++){let f=e.getWordIndex(r[u].normalize("NFKD"));Ne(f>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let h=0;h<11;h++)f&1<<10-h&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,a=r.length/3,o=PQ(a),c=Ht(vc(n.slice(0,s/8)))[0]&o;return Ne(c===(n[n.length-1]&o),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),_t(n.slice(0,s/8))}function IO(t,e){Ne(t.length%4===0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Mh.wordlist());const r=[0];let n=11;for(let a=0;a<t.length;a++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[a],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[a]>>8-n,r.push(t[a]&Zge(8-n)),n+=3);const i=t.length/4,s=parseInt(vc(t).substring(2,4),16)&PQ(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(a=>e.getWord(a)))}const PO={};class $g{constructor(e,r,n,i,s){Fe(this,"phrase");Fe(this,"password");Fe(this,"wordlist");Fe(this,"entropy");i==null&&(i=""),s==null&&(s=Mh.wordlist()),Gf(e,PO,"Mnemonic"),Qt(this,{phrase:n,password:i,wordlist:s,entropy:r})}computeSeed(){const e=Xs("mnemonic"+this.password,"NFKD");return Kf(Xs(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,n){const i=OO(e,n);return e=IO(Ht(i),n),new $g(PO,i,e,r,n)}static fromEntropy(e,r,n){const i=Ht(e,"entropy"),s=IO(i,n);return new $g(PO,_t(i),s,r,n)}static entropyToPhrase(e,r){const n=Ht(e,"entropy");return IO(n,r)}static phraseToEntropy(e,r){return OO(e,r)}static isValidMnemonic(e,r){try{return OO(e,r),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var Zi=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},TO=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},eE,co,$c;const eme={16:10,24:12,32:14},tme=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],so=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Jw=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],rme=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],nme=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],ime=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],sme=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],ame=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],ome=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],cme=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],ume=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],lme=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],fme=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],dme=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],hme=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function CO(t){const e=[];for(let r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}class N5{get key(){return Zi(this,eE,"f").slice()}constructor(e){if(eE.set(this,void 0),co.set(this,void 0),$c.set(this,void 0),!(this instanceof N5))throw Error("AES must be instanitated with `new`");TO(this,eE,new Uint8Array(e),"f");const r=eme[this.key.length];if(r==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");TO(this,$c,[],"f"),TO(this,co,[],"f");for(let f=0;f<=r;f++)Zi(this,$c,"f").push([0,0,0,0]),Zi(this,co,"f").push([0,0,0,0]);const n=(r+1)*4,i=this.key.length/4,s=CO(this.key);let a;for(let f=0;f<i;f++)a=f>>2,Zi(this,$c,"f")[a][f%4]=s[f],Zi(this,co,"f")[r-a][f%4]=s[f];let o=0,c=i,u;for(;c<n;){if(u=s[i-1],s[0]^=so[u>>16&255]<<24^so[u>>8&255]<<16^so[u&255]<<8^so[u>>24&255]^tme[o]<<24,o+=1,i!=8)for(let y=1;y<i;y++)s[y]^=s[y-1];else{for(let y=1;y<i/2;y++)s[y]^=s[y-1];u=s[i/2-1],s[i/2]^=so[u&255]^so[u>>8&255]<<8^so[u>>16&255]<<16^so[u>>24&255]<<24;for(let y=i/2+1;y<i;y++)s[y]^=s[y-1]}let f=0,h,m;for(;f<i&&c<n;)h=c>>2,m=c%4,Zi(this,$c,"f")[h][m]=s[f],Zi(this,co,"f")[r-h][m]=s[f++],c++}for(let f=1;f<r;f++)for(let h=0;h<4;h++)u=Zi(this,co,"f")[f][h],Zi(this,co,"f")[f][h]=lme[u>>24&255]^fme[u>>16&255]^dme[u>>8&255]^hme[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const r=Zi(this,$c,"f").length-1,n=[0,0,0,0];let i=CO(e);for(let o=0;o<4;o++)i[o]^=Zi(this,$c,"f")[0][o];for(let o=1;o<r;o++){for(let c=0;c<4;c++)n[c]=rme[i[c]>>24&255]^nme[i[(c+1)%4]>>16&255]^ime[i[(c+2)%4]>>8&255]^sme[i[(c+3)%4]&255]^Zi(this,$c,"f")[o][c];i=n.slice()}const s=new Uint8Array(16);let a=0;for(let o=0;o<4;o++)a=Zi(this,$c,"f")[r][o],s[4*o]=(so[i[o]>>24&255]^a>>24)&255,s[4*o+1]=(so[i[(o+1)%4]>>16&255]^a>>16)&255,s[4*o+2]=(so[i[(o+2)%4]>>8&255]^a>>8)&255,s[4*o+3]=(so[i[(o+3)%4]&255]^a)&255;return s}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const r=Zi(this,co,"f").length-1,n=[0,0,0,0];let i=CO(e);for(let o=0;o<4;o++)i[o]^=Zi(this,co,"f")[0][o];for(let o=1;o<r;o++){for(let c=0;c<4;c++)n[c]=ame[i[c]>>24&255]^ome[i[(c+3)%4]>>16&255]^cme[i[(c+2)%4]>>8&255]^ume[i[(c+1)%4]&255]^Zi(this,co,"f")[o][c];i=n.slice()}const s=new Uint8Array(16);let a=0;for(let o=0;o<4;o++)a=Zi(this,co,"f")[r][o],s[4*o]=(Jw[i[o]>>24&255]^a>>24)&255,s[4*o+1]=(Jw[i[(o+3)%4]>>16&255]^a>>16)&255,s[4*o+2]=(Jw[i[(o+2)%4]>>8&255]^a>>8)&255,s[4*o+3]=(Jw[i[(o+1)%4]&255]^a)&255;return s}}eE=new WeakMap,co=new WeakMap,$c=new WeakMap;class TQ{constructor(e,r,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new N5(r)},name:{enumerable:!0,value:e}})}}var Xw=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Tp=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},uv,Nu;class D5 extends TQ{constructor(e,r){if(super("ECC",e,D5),uv.set(this,void 0),Nu.set(this,void 0),r){if(r.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Xw(this,uv,new Uint8Array(r),"f")}else Xw(this,uv,new Uint8Array(16),"f");Xw(this,Nu,this.iv,"f")}get iv(){return new Uint8Array(Tp(this,uv,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let i=0;i<16;i++)Tp(this,Nu,"f")[i]^=e[n+i];Xw(this,Nu,this.aes.encrypt(Tp(this,Nu,"f")),"f"),r.set(Tp(this,Nu,"f"),n)}return r}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){const i=this.aes.decrypt(e.subarray(n,n+16));for(let s=0;s<16;s++)r[n+s]=i[s]^Tp(this,Nu,"f")[s],Tp(this,Nu,"f")[s]=e[n+s]}return r}}uv=new WeakMap,Nu=new WeakMap;var Cp=globalThis&&globalThis.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ao=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},lv,$d,uo;class Lg extends TQ{constructor(e,r){super("CTR",e,Lg),lv.set(this,void 0),$d.set(this,void 0),uo.set(this,void 0),Cp(this,uo,new Uint8Array(16),"f"),ao(this,uo,"f").fill(0),Cp(this,lv,ao(this,uo,"f"),"f"),Cp(this,$d,16,"f"),r==null&&(r=1),typeof r=="number"?this.setCounterValue(r):this.setCounterBytes(r)}get counter(){return new Uint8Array(ao(this,uo,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let r=15;r>=0;--r)ao(this,uo,"f")[r]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");ao(this,uo,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(ao(this,uo,"f")[e]===255)ao(this,uo,"f")[e]=0;else{ao(this,uo,"f")[e]++;break}}encrypt(e){var r,n;const i=new Uint8Array(e);for(let s=0;s<i.length;s++)ao(this,$d,"f")===16&&(Cp(this,lv,this.aes.encrypt(ao(this,uo,"f")),"f"),Cp(this,$d,0,"f"),this.increment()),i[s]^=ao(this,lv,"f")[Cp(this,$d,(n=ao(this,$d,"f"),r=n++,n),"f"),r];return i}decrypt(e){return this.encrypt(e)}}lv=new WeakMap,$d=new WeakMap,uo=new WeakMap;function pme(t){if(t.length<16)throw new TypeError("PKCS#7 invalid length");const e=t[t.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let n=0;n<e;n++)if(t[r+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(t.subarray(0,r))}function CQ(t){return typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t),Ns(t)}function Qm(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function w1(t){return typeof t=="string"?Xs(t,"NFKC"):Ns(t)}function bi(t,e){const r=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);Ne(r!=null,"invalid path","path",e);const n=r[1],i=r[3],s=r[4]==="!";let a=t;for(const o of n.toLowerCase().split(".")){if(Array.isArray(a)){if(!o.match(/^[0-9]+$/))break;a=a[parseInt(o)]}else if(typeof a=="object"){let c=null;for(const u in a)if(u.toLowerCase()===o){c=a[u];break}a=c}else a=null;if(a==null)break}if(Ne(!s||a!=null,"missing required value","path",n),i&&a!=null){if(i==="int"){if(typeof a=="string"&&a.match(/^-?[0-9]+$/))return parseInt(a);if(Number.isSafeInteger(a))return a}if(i==="number"&&typeof a=="string"&&a.match(/^-?[0-9.]*$/))return parseFloat(a);if(i==="data"&&typeof a=="string")return CQ(a);if(i==="array"&&Array.isArray(a)||i===typeof a)return a;Ne(!1,`wrong type found for ${i} `,"path",n)}return a}const RQ="m/44'/60'/0'/0/0";function n7(t){try{const e=JSON.parse(t);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}function gme(t,e,r){if(bi(t,"crypto.cipher:string")==="aes-128-ctr"){const i=bi(t,"crypto.cipherparams.iv:data!"),s=new Lg(e,i);return _t(s.decrypt(r))}st(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function rx(t,e){const r=Ht(e),n=bi(t,"crypto.ciphertext:data!"),i=_t(qn(Hn([r.slice(16,32),n]))).substring(2);Ne(i===bi(t,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const s=gme(t,r.slice(0,16),n),a=m1(s);if(t.address){let u=t.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),Ne(cn(u)===a,"keystore address/privateKey mismatch","address",t.address)}const o={address:a,privateKey:s};if(bi(t,"x-ethers.version:string")==="0.1"){const u=r.slice(32,64),f=bi(t,"x-ethers.mnemonicCiphertext:data!"),h=bi(t,"x-ethers.mnemonicCounter:data!"),m=new Lg(u,h);o.mnemonic={path:bi(t,"x-ethers.path:string")||RQ,locale:bi(t,"x-ethers.locale:string")||"en",entropy:_t(Ht(m.decrypt(f)))}}return o}function NQ(t){const e=bi(t,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){const r=bi(t,"crypto.kdfparams.salt:data!"),n=bi(t,"crypto.kdfparams.n:int!"),i=bi(t,"crypto.kdfparams.r:int!"),s=bi(t,"crypto.kdfparams.p:int!");Ne(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),Ne(i>0&&s>0,"invalid kdf","kdf",e);const a=bi(t,"crypto.kdfparams.dklen:int!");return Ne(a===32,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const r=bi(t,"crypto.kdfparams.salt:data!"),n=bi(t,"crypto.kdfparams.prf:string!"),i=n.split("-").pop();Ne(i==="sha256"||i==="sha512","invalid kdf.pdf","kdf.pdf",n);const s=bi(t,"crypto.kdfparams.c:int!"),a=bi(t,"crypto.kdfparams.dklen:int!");return Ne(a===32,"invalid kdf.dklen","kdf.dklen",a),{name:"pbkdf2",salt:r,count:s,dkLen:a,algorithm:i}}}Ne(!1,"unsupported key-derivation function","kdf",e)}function mme(t,e){const r=JSON.parse(t),n=w1(e),i=NQ(r);if(i.name==="pbkdf2"){const{salt:h,count:m,dkLen:y,algorithm:w}=i,v=Kf(n,h,m,y,w);return rx(r,v)}st(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:s,N:a,r:o,p:c,dkLen:u}=i,f=am(n,s,a,o,c,u);return rx(r,f)}function i7(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function yme(t,e,r){const n=JSON.parse(t),i=w1(e),s=NQ(n);if(s.name==="pbkdf2"){r&&(r(0),await i7(0));const{salt:m,count:y,dkLen:w,algorithm:v}=s,g=Kf(i,m,y,w,v);return r&&(r(1),await i7(0)),rx(n,g)}st(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:a,N:o,r:c,p:u,dkLen:f}=s,h=await sm(i,a,o,c,u,f,r);return rx(n,h)}function DQ(t){const e=t.salt!=null?Ht(t.salt,"options.salt"):sl(32);let r=1<<17,n=8,i=1;return t.scrypt&&(t.scrypt.N&&(r=t.scrypt.N),t.scrypt.r&&(n=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),Ne(typeof r=="number"&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),Ne(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),Ne(typeof i=="number"&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:r,r:n,p:i}}function MQ(t,e,r,n){const i=Ht(r.privateKey,"privateKey"),s=n.iv!=null?Ht(n.iv,"options.iv"):sl(16);Ne(s.length===16,"invalid options.iv length","options.iv",n.iv);const a=n.uuid!=null?Ht(n.uuid,"options.uuid"):sl(16);Ne(a.length===16,"invalid options.uuid length","options.uuid",n.iv);const o=t.slice(0,16),c=t.slice(16,32),u=new Lg(o,s),f=Ht(u.encrypt(i)),h=qn(Hn([c,f])),m={address:r.address.substring(2).toLowerCase(),id:Tde(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:_t(s).substring(2)},ciphertext:_t(f).substring(2),kdf:"scrypt",kdfparams:{salt:_t(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:h.substring(2)}};if(r.mnemonic){const y=n.client!=null?n.client:`ethers/${cW}`,w=r.mnemonic.path||RQ,v=r.mnemonic.locale||"en",g=t.slice(32,64),_=Ht(r.mnemonic.entropy,"account.mnemonic.entropy"),b=sl(16),S=new Lg(g,b),A=Ht(S.encrypt(_)),O=new Date,p="UTC--"+(O.getUTCFullYear()+"-"+Qm(O.getUTCMonth()+1,2)+"-"+Qm(O.getUTCDate(),2)+"T"+Qm(O.getUTCHours(),2)+"-"+Qm(O.getUTCMinutes(),2)+"-"+Qm(O.getUTCSeconds(),2)+".0Z")+"--"+m.address;m["x-ethers"]={client:y,gethFilename:p,path:w,locale:v,mnemonicCounter:_t(b).substring(2),mnemonicCiphertext:_t(A).substring(2),version:"0.1"}}return JSON.stringify(m)}function kQ(t,e,r){r==null&&(r={});const n=w1(e),i=DQ(r),s=am(n,i.salt,i.N,i.r,i.p,64);return MQ(Ht(s),i,t,r)}async function $Q(t,e,r){r==null&&(r={});const n=w1(e),i=DQ(r),s=await sm(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return MQ(Ht(s),i,t,r)}const RO="m/44'/60'/0'/0/0",vme=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Df=2147483648,bme=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),wme="0123456789abcdef";function nx(t,e){let r="";for(;t;)r=wme[t%16]+r,t=Math.trunc(t/16);for(;r.length<e*2;)r="0"+r;return"0x"+r}function EN(t){const e=Ht(t),r=Kn(vc(vc(e)),0,4),n=Hn([e,r]);return gW(n)}const Lc={};function LQ(t,e,r,n){const i=new Uint8Array(37);t&Df?(st(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(Ht(n),1)):i.set(Ht(r));for(let a=24;a>=0;a-=8)i[33+(a>>3)]=t>>24-a&255;const s=Ht(nm("sha512",e,i));return{IL:s.slice(0,32),IR:s.slice(32)}}function UQ(t,e){const r=e.split("/");Ne(r.length>0&&(r[0]==="m"||t.depth>0),"invalid path","path",e),r[0]==="m"&&r.shift();let n=t;for(let i=0;i<r.length;i++){const s=r[i];if(s.match(/^[0-9]+'$/)){const a=parseInt(s.substring(0,s.length-1));Ne(a<Df,"invalid path index",`path[${i}]`,s),n=n.deriveChild(Df+a)}else if(s.match(/^[0-9]+$/)){const a=parseInt(s);Ne(a<Df,"invalid path index",`path[${i}]`,s),n=n.deriveChild(a)}else Ne(!1,"invalid path component",`path[${i}]`,s)}return n}var n1,xN,wh,fv;const ec=class ec extends ex{constructor(r,n,i,s,a,o,c,u,f){super(n,f);Je(this,n1);Fe(this,"publicKey");Fe(this,"fingerprint");Fe(this,"parentFingerprint");Fe(this,"mnemonic");Fe(this,"chainCode");Fe(this,"path");Fe(this,"index");Fe(this,"depth");Gf(r,Lc,"HDNodeWallet"),Qt(this,{publicKey:n.compressedPublicKey});const h=Kn(im(vc(this.publicKey)),0,4);Qt(this,{parentFingerprint:i,fingerprint:h,chainCode:s,path:a,index:o,depth:c}),Qt(this,{mnemonic:u})}connect(r){return new ec(Lc,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,r)}async encrypt(r,n){return await $Q(ut(this,n1,xN).call(this),r,{progressCallback:n})}encryptSync(r){return kQ(ut(this,n1,xN).call(this),r)}get extendedKey(){return st(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),EN(Hn(["0x0488ADE4",nx(this.depth,1),this.parentFingerprint,nx(this.index,4),this.chainCode,Hn(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new wb(Lc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(r){const n=jr(r,"index");Ne(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~Df),n&Df&&(i+="'"));const{IR:s,IL:a}=LQ(n,this.chainCode,this.publicKey,this.privateKey),o=new tu(dl((p1(a)+BigInt(this.privateKey))%bme,32));return new ec(Lc,o,this.fingerprint,_t(s),i,n,this.depth+1,this.mnemonic,this.provider)}derivePath(r){return UQ(this,r)}static fromExtendedKey(r){const n=ba(ode(r));Ne(n.length===82||EN(n.slice(0,78))===r,"invalid extended key","extendedKey","[ REDACTED ]");const i=n[4],s=_t(n.slice(5,9)),a=parseInt(_t(n.slice(9,13)).substring(2),16),o=_t(n.slice(13,45)),c=n.slice(45,78);switch(_t(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const u=_t(c);return new wb(Lc,m1(u),u,s,o,null,a,i,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new ec(Lc,new tu(c.slice(1)),s,o,null,a,i,null,null)}Ne(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(r,n,i){var a;r==null&&(r=""),n==null&&(n=RO),i==null&&(i=Mh.wordlist());const s=$g.fromEntropy(sl(16),r,i);return ut(a=ec,wh,fv).call(a,s.computeSeed(),s).derivePath(n)}static fromMnemonic(r,n){var i;return n||(n=RO),ut(i=ec,wh,fv).call(i,r.computeSeed(),r).derivePath(n)}static fromPhrase(r,n,i,s){var o;n==null&&(n=""),i==null&&(i=RO),s==null&&(s=Mh.wordlist());const a=$g.fromPhrase(r,n,s);return ut(o=ec,wh,fv).call(o,a.computeSeed(),a).derivePath(i)}static fromSeed(r){var n;return ut(n=ec,wh,fv).call(n,r,null)}};n1=new WeakSet,xN=function(){const r={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(r.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),r},wh=new WeakSet,fv=function(r,n){Ne(dW(r),"invalid seed","seed","[REDACTED]");const i=Ht(r,"seed");Ne(i.length>=16&&i.length<=64,"invalid seed","seed","[REDACTED]");const s=Ht(nm("sha512",vme,i)),a=new tu(_t(s.slice(0,32)));return new ec(Lc,a,"0x00000000",_t(s.slice(32)),"m",0,0,n,null)},Je(ec,wh);let $v=ec;class wb extends gN{constructor(r,n,i,s,a,o,c,u,f){super(n,f);Fe(this,"publicKey");Fe(this,"fingerprint");Fe(this,"parentFingerprint");Fe(this,"chainCode");Fe(this,"path");Fe(this,"index");Fe(this,"depth");Gf(r,Lc,"HDNodeVoidWallet"),Qt(this,{publicKey:i});const h=Kn(im(vc(i)),0,4);Qt(this,{publicKey:i,fingerprint:h,parentFingerprint:s,chainCode:a,path:o,index:c,depth:u})}connect(r){return new wb(Lc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,r)}get extendedKey(){return st(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),EN(Hn(["0x0488B21E",nx(this.depth,1),this.parentFingerprint,nx(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(r){const n=jr(r,"index");Ne(n<=4294967295,"invalid index","index",n);let i=this.path;i&&(i+="/"+(n&~Df),n&Df&&(i+="'"));const{IR:s,IL:a}=LQ(n,this.chainCode,this.publicKey,null),o=tu.addPoints(a,this.publicKey,!0),c=m1(o);return new wb(Lc,c,o,this.fingerprint,_t(s),i,n,this.depth+1,this.provider)}derivePath(r){return UQ(this,r)}}function s7(t){try{if(JSON.parse(t).encseed)return!0}catch{}return!1}function a7(t,e){const r=JSON.parse(t),n=w1(e),i=cn(bi(r,"ethaddr:string!")),s=CQ(bi(r,"encseed:string!"));Ne(s&&s.length%16===0,"invalid encseed","json",t);const a=Ht(Kf(n,n,2e3,32,"sha256")).slice(0,16),o=s.slice(0,16),c=s.slice(16),u=new D5(a,o),f=pme(Ht(u.decrypt(c)));let h="";for(let m=0;m<f.length;m++)h+=String.fromCharCode(f[m]);return{address:i,privateKey:hl(h)}}function o7(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}var i1,SN;const qd=class qd extends ex{constructor(e,r){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new tu(e):e;super(n,r)}connect(e){return new qd(this.signingKey,e)}async encrypt(e,r){const n={address:this.address,privateKey:this.privateKey};return await $Q(n,e,{progressCallback:r})}encryptSync(e){const r={address:this.address,privateKey:this.privateKey};return kQ(r,e)}static async fromEncryptedJson(e,r,n){var s;let i=null;return n7(e)?i=await yme(e,r,n):s7(e)&&(n&&(n(0),await o7(0)),i=a7(e,r),n&&(n(1),await o7(0))),ut(s=qd,i1,SN).call(s,i)}static fromEncryptedJsonSync(e,r){var i;let n=null;return n7(e)?n=mme(e,r):s7(e)?n=a7(e,r):Ne(!1,"invalid JSON wallet","json","[ REDACTED ]"),ut(i=qd,i1,SN).call(i,n)}static createRandom(e){const r=$v.createRandom();return e?r.connect(e):r}static fromPhrase(e,r){const n=$v.fromPhrase(e);return r?n.connect(r):n}};i1=new WeakSet,SN=function(e){if(Ne(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const n=$g.fromEntropy(e.mnemonic.entropy),i=$v.fromMnemonic(n,e.mnemonic.path);if(i.address===e.address&&i.privateKey===e.privateKey)return i;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new qd(e.privateKey);return Ne(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r},Je(qd,i1);let AN=qd;var So={},Jm={},jQ={exports:{}},BQ={exports:{}};(function(t){function e(r){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(BQ);var M5=BQ.exports;(function(t){var e=M5.default;function r(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,a=new WeakMap;return(r=function(c){return c?a:s})(i)}function n(i,s){if(!s&&i&&i.__esModule)return i;if(i===null||e(i)!="object"&&typeof i!="function")return{default:i};var a=r(s);if(a&&a.has(i))return a.get(i);var o={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in i)if(u!=="default"&&Object.prototype.hasOwnProperty.call(i,u)){var f=c?Object.getOwnPropertyDescriptor(i,u):null;f&&(f.get||f.set)?Object.defineProperty(o,u,f):o[u]=i[u]}return o.default=i,a&&a.set(i,o),o}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(jQ);var Uo=jQ.exports,FQ={exports:{}};(function(t){function e(r){return r&&r.__esModule?r:{default:r}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(FQ);var vr=FQ.exports,NO={exports:{}},c7;function kn(){return c7||(c7=1,function(t){function e(){return t.exports=e=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])}return r},t.exports.__esModule=!0,t.exports.default=t.exports,e.apply(this,arguments)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(NO)),NO.exports}var DO={exports:{}},MO={exports:{}},u7;function _me(){return u7||(u7=1,function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,a){return s.__proto__=a,s},t.exports.__esModule=!0,t.exports.default=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(MO)),MO.exports}var l7;function xc(){return l7||(l7=1,function(t){var e=_me();function r(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,e(n,i)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(DO)),DO.exports}var kO,f7;function qQ(){if(f7)return kO;f7=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return kO=t,kO}var $O,d7;function Ri(){if(d7)return $O;d7=1;var t=Array.isArray;return $O=t,$O}var LO,h7;function HQ(){if(h7)return LO;h7=1;var t=typeof $e=="object"&&$e&&$e.Object===Object&&$e;return LO=t,LO}var UO,p7;function wl(){if(p7)return UO;p7=1;var t=HQ(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return UO=r,UO}var jO,g7;function _1(){if(g7)return jO;g7=1;var t=wl(),e=t.Symbol;return jO=e,jO}var BO,m7;function Eme(){if(m7)return BO;m7=1;var t=_1(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function s(a){var o=r.call(a,i),c=a[i];try{a[i]=void 0;var u=!0}catch{}var f=n.call(a);return u&&(o?a[i]=c:delete a[i]),f}return BO=s,BO}var FO,y7;function xme(){if(y7)return FO;y7=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return FO=r,FO}var qO,v7;function _l(){if(v7)return qO;v7=1;var t=_1(),e=Eme(),r=xme(),n="[object Null]",i="[object Undefined]",s=t?t.toStringTag:void 0;function a(o){return o==null?o===void 0?i:n:s&&s in Object(o)?e(o):r(o)}return qO=a,qO}var HO,b7;function Ac(){if(b7)return HO;b7=1;function t(e){return e!=null&&typeof e=="object"}return HO=t,HO}var zO,w7;function om(){if(w7)return zO;w7=1;var t=_l(),e=Ac(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return zO=n,zO}var VO,_7;function k5(){if(_7)return VO;_7=1;var t=Ri(),e=om(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(s,a){if(t(s))return!1;var o=typeof s;return o=="number"||o=="symbol"||o=="boolean"||s==null||e(s)?!0:n.test(s)||!r.test(s)||a!=null&&s in Object(a)}return VO=i,VO}var GO,E7;function El(){if(E7)return GO;E7=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return GO=t,GO}var KO,x7;function h2(){if(x7)return KO;x7=1;var t=_l(),e=El(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function a(o){if(!e(o))return!1;var c=t(o);return c==n||c==i||c==r||c==s}return KO=a,KO}var WO,A7;function Ame(){if(A7)return WO;A7=1;var t=wl(),e=t["__core-js_shared__"];return WO=e,WO}var YO,S7;function Sme(){if(S7)return YO;S7=1;var t=Ame(),e=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(n){return!!e&&e in n}return YO=r,YO}var QO,O7;function zQ(){if(O7)return QO;O7=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return QO=r,QO}var JO,I7;function Ome(){if(I7)return JO;I7=1;var t=h2(),e=Sme(),r=El(),n=zQ(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,a=Function.prototype,o=Object.prototype,c=a.toString,u=o.hasOwnProperty,f=RegExp("^"+c.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(m){if(!r(m)||e(m))return!1;var y=t(m)?f:s;return y.test(n(m))}return JO=h,JO}var XO,P7;function Ime(){if(P7)return XO;P7=1;function t(e,r){return e==null?void 0:e[r]}return XO=t,XO}var ZO,T7;function Gh(){if(T7)return ZO;T7=1;var t=Ome(),e=Ime();function r(n,i){var s=e(n,i);return t(s)?s:void 0}return ZO=r,ZO}var eI,C7;function p2(){if(C7)return eI;C7=1;var t=Gh(),e=t(Object,"create");return eI=e,eI}var tI,R7;function Pme(){if(R7)return tI;R7=1;var t=p2();function e(){this.__data__=t?t(null):{},this.size=0}return tI=e,tI}var rI,N7;function Tme(){if(N7)return rI;N7=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return rI=t,rI}var nI,D7;function Cme(){if(D7)return nI;D7=1;var t=p2(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(s){var a=this.__data__;if(t){var o=a[s];return o===e?void 0:o}return n.call(a,s)?a[s]:void 0}return nI=i,nI}var iI,M7;function Rme(){if(M7)return iI;M7=1;var t=p2(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var s=this.__data__;return t?s[i]!==void 0:r.call(s,i)}return iI=n,iI}var sI,k7;function Nme(){if(k7)return sI;k7=1;var t=p2(),e="__lodash_hash_undefined__";function r(n,i){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=t&&i===void 0?e:i,this}return sI=r,sI}var aI,$7;function Dme(){if($7)return aI;$7=1;var t=Pme(),e=Tme(),r=Cme(),n=Rme(),i=Nme();function s(a){var o=-1,c=a==null?0:a.length;for(this.clear();++o<c;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,aI=s,aI}var oI,L7;function Mme(){if(L7)return oI;L7=1;function t(){this.__data__=[],this.size=0}return oI=t,oI}var cI,U7;function g2(){if(U7)return cI;U7=1;function t(e,r){return e===r||e!==e&&r!==r}return cI=t,cI}var uI,j7;function m2(){if(j7)return uI;j7=1;var t=g2();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return uI=e,uI}var lI,B7;function kme(){if(B7)return lI;B7=1;var t=m2(),e=Array.prototype,r=e.splice;function n(i){var s=this.__data__,a=t(s,i);if(a<0)return!1;var o=s.length-1;return a==o?s.pop():r.call(s,a,1),--this.size,!0}return lI=n,lI}var fI,F7;function $me(){if(F7)return fI;F7=1;var t=m2();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return fI=e,fI}var dI,q7;function Lme(){if(q7)return dI;q7=1;var t=m2();function e(r){return t(this.__data__,r)>-1}return dI=e,dI}var hI,H7;function Ume(){if(H7)return hI;H7=1;var t=m2();function e(r,n){var i=this.__data__,s=t(i,r);return s<0?(++this.size,i.push([r,n])):i[s][1]=n,this}return hI=e,hI}var pI,z7;function y2(){if(z7)return pI;z7=1;var t=Mme(),e=kme(),r=$me(),n=Lme(),i=Ume();function s(a){var o=-1,c=a==null?0:a.length;for(this.clear();++o<c;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,pI=s,pI}var gI,V7;function $5(){if(V7)return gI;V7=1;var t=Gh(),e=wl(),r=t(e,"Map");return gI=r,gI}var mI,G7;function jme(){if(G7)return mI;G7=1;var t=Dme(),e=y2(),r=$5();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return mI=n,mI}var yI,K7;function Bme(){if(K7)return yI;K7=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return yI=t,yI}var vI,W7;function v2(){if(W7)return vI;W7=1;var t=Bme();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return vI=e,vI}var bI,Y7;function Fme(){if(Y7)return bI;Y7=1;var t=v2();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return bI=e,bI}var wI,Q7;function qme(){if(Q7)return wI;Q7=1;var t=v2();function e(r){return t(this,r).get(r)}return wI=e,wI}var _I,J7;function Hme(){if(J7)return _I;J7=1;var t=v2();function e(r){return t(this,r).has(r)}return _I=e,_I}var EI,X7;function zme(){if(X7)return EI;X7=1;var t=v2();function e(r,n){var i=t(this,r),s=i.size;return i.set(r,n),this.size+=i.size==s?0:1,this}return EI=e,EI}var xI,Z7;function L5(){if(Z7)return xI;Z7=1;var t=jme(),e=Fme(),r=qme(),n=Hme(),i=zme();function s(a){var o=-1,c=a==null?0:a.length;for(this.clear();++o<c;){var u=a[o];this.set(u[0],u[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,xI=s,xI}var AI,eU;function U5(){if(eU)return AI;eU=1;var t=L5(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var s=function(){var a=arguments,o=i?i.apply(this,a):a[0],c=s.cache;if(c.has(o))return c.get(o);var u=n.apply(this,a);return s.cache=c.set(o,u)||c,u};return s.cache=new(r.Cache||t),s}return r.Cache=t,AI=r,AI}var SI,tU;function Vme(){if(tU)return SI;tU=1;var t=U5(),e=500;function r(n){var i=t(n,function(a){return s.size===e&&s.clear(),a}),s=i.cache;return i}return SI=r,SI}var OI,rU;function Gme(){if(rU)return OI;rU=1;var t=Vme(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(e,function(a,o,c,u){s.push(c?u.replace(r,"$1"):o||a)}),s});return OI=n,OI}var II,nU;function Kh(){if(nU)return II;nU=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,s=Array(i);++n<i;)s[n]=r(e[n],n,e);return s}return II=t,II}var PI,iU;function j5(){if(iU)return PI;iU=1;var t=_1(),e=Kh(),r=Ri(),n=om(),i=1/0,s=t?t.prototype:void 0,a=s?s.toString:void 0;function o(c){if(typeof c=="string")return c;if(r(c))return e(c,o)+"";if(n(c))return a?a.call(c):"";var u=c+"";return u=="0"&&1/c==-i?"-0":u}return PI=o,PI}var TI,sU;function B5(){if(sU)return TI;sU=1;var t=j5();function e(r){return r==null?"":t(r)}return TI=e,TI}var CI,aU;function E1(){if(aU)return CI;aU=1;var t=Ri(),e=k5(),r=Gme(),n=B5();function i(s,a){return t(s)?s:e(s,a)?[s]:r(n(s))}return CI=i,CI}var RI,oU;function Kme(){if(oU)return RI;oU=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return RI=t,RI}var NI,cU;function cm(){if(cU)return NI;cU=1;var t=om(),e=1/0;function r(n){if(typeof n=="string"||t(n))return n;var i=n+"";return i=="0"&&1/n==-e?"-0":i}return NI=r,NI}var DI,uU;function x1(){if(uU)return DI;uU=1;var t=E1(),e=cm();function r(n,i){i=t(i,n);for(var s=0,a=i.length;n!=null&&s<a;)n=n[e(i[s++])];return s&&s==a?n:void 0}return DI=r,DI}var MI,lU;function F5(){if(lU)return MI;lU=1;function t(e,r,n){var i=-1,s=e.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var a=Array(s);++i<s;)a[i]=e[i+r];return a}return MI=t,MI}var kI,fU;function Wme(){if(fU)return kI;fU=1;var t=x1(),e=F5();function r(n,i){return i.length<2?n:t(n,e(i,0,-1))}return kI=r,kI}var $I,dU;function Yme(){if(dU)return $I;dU=1;var t=qQ(),e=E1(),r=Kme(),n=Wme(),i=cm();function s(a,o,c){o=e(o,a),a=n(a,o);var u=a==null?a:a[i(r(o))];return u==null?void 0:t(u,a,c)}return $I=s,$I}var LI,hU;function Yf(){if(hU)return LI;hU=1;function t(e){return e}return LI=t,LI}var UI,pU;function VQ(){if(pU)return UI;pU=1;var t=qQ(),e=Math.max;function r(n,i,s){return i=e(i===void 0?n.length-1:i,0),function(){for(var a=arguments,o=-1,c=e(a.length-i,0),u=Array(c);++o<c;)u[o]=a[i+o];o=-1;for(var f=Array(i+1);++o<i;)f[o]=a[o];return f[i]=s(u),t(n,this,f)}}return UI=r,UI}var jI,gU;function GQ(){if(gU)return jI;gU=1;function t(e){return function(){return e}}return jI=t,jI}var BI,mU;function KQ(){if(mU)return BI;mU=1;var t=Gh(),e=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return BI=e,BI}var FI,yU;function Qme(){if(yU)return FI;yU=1;var t=GQ(),e=KQ(),r=Yf(),n=e?function(i,s){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(s),writable:!0})}:r;return FI=n,FI}var qI,vU;function Jme(){if(vU)return qI;vU=1;var t=800,e=16,r=Date.now;function n(i){var s=0,a=0;return function(){var o=r(),c=e-(o-a);if(a=o,c>0){if(++s>=t)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return qI=n,qI}var HI,bU;function WQ(){if(bU)return HI;bU=1;var t=Qme(),e=Jme(),r=e(t);return HI=r,HI}var zI,wU;function A1(){if(wU)return zI;wU=1;var t=Yf(),e=VQ(),r=WQ();function n(i,s){return r(e(i,s,t),i+"")}return zI=n,zI}var VI,_U;function jo(){if(_U)return VI;_U=1;var t=Yme(),e=A1(),r=e(t);return VI=r,VI}var GI,EU;function xl(){if(EU)return GI;EU=1;function t(e){return e==null}return GI=t,GI}function Xme(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var YQ={exports:{}},Tn={};/** @license React v16.13.1
72
- * react-is.production.min.js
73
- *
74
- * Copyright (c) Facebook, Inc. and its affiliates.
75
- *
76
- * This source code is licensed under the MIT license found in the
77
- * LICENSE file in the root directory of this source tree.
78
- */var Yi=typeof Symbol=="function"&&Symbol.for,q5=Yi?Symbol.for("react.element"):60103,H5=Yi?Symbol.for("react.portal"):60106,b2=Yi?Symbol.for("react.fragment"):60107,w2=Yi?Symbol.for("react.strict_mode"):60108,_2=Yi?Symbol.for("react.profiler"):60114,E2=Yi?Symbol.for("react.provider"):60109,x2=Yi?Symbol.for("react.context"):60110,z5=Yi?Symbol.for("react.async_mode"):60111,A2=Yi?Symbol.for("react.concurrent_mode"):60111,S2=Yi?Symbol.for("react.forward_ref"):60112,O2=Yi?Symbol.for("react.suspense"):60113,Zme=Yi?Symbol.for("react.suspense_list"):60120,I2=Yi?Symbol.for("react.memo"):60115,P2=Yi?Symbol.for("react.lazy"):60116,eye=Yi?Symbol.for("react.block"):60121,tye=Yi?Symbol.for("react.fundamental"):60117,rye=Yi?Symbol.for("react.responder"):60118,nye=Yi?Symbol.for("react.scope"):60119;function Ga(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case q5:switch(t=t.type,t){case z5:case A2:case b2:case _2:case w2:case O2:return t;default:switch(t=t&&t.$$typeof,t){case x2:case S2:case P2:case I2:case E2:return t;default:return e}}case H5:return e}}}function QQ(t){return Ga(t)===A2}Tn.AsyncMode=z5;Tn.ConcurrentMode=A2;Tn.ContextConsumer=x2;Tn.ContextProvider=E2;Tn.Element=q5;Tn.ForwardRef=S2;Tn.Fragment=b2;Tn.Lazy=P2;Tn.Memo=I2;Tn.Portal=H5;Tn.Profiler=_2;Tn.StrictMode=w2;Tn.Suspense=O2;Tn.isAsyncMode=function(t){return QQ(t)||Ga(t)===z5};Tn.isConcurrentMode=QQ;Tn.isContextConsumer=function(t){return Ga(t)===x2};Tn.isContextProvider=function(t){return Ga(t)===E2};Tn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===q5};Tn.isForwardRef=function(t){return Ga(t)===S2};Tn.isFragment=function(t){return Ga(t)===b2};Tn.isLazy=function(t){return Ga(t)===P2};Tn.isMemo=function(t){return Ga(t)===I2};Tn.isPortal=function(t){return Ga(t)===H5};Tn.isProfiler=function(t){return Ga(t)===_2};Tn.isStrictMode=function(t){return Ga(t)===w2};Tn.isSuspense=function(t){return Ga(t)===O2};Tn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===b2||t===A2||t===_2||t===w2||t===O2||t===Zme||typeof t=="object"&&t!==null&&(t.$$typeof===P2||t.$$typeof===I2||t.$$typeof===E2||t.$$typeof===x2||t.$$typeof===S2||t.$$typeof===tye||t.$$typeof===rye||t.$$typeof===nye||t.$$typeof===eye)};Tn.typeOf=Ga;YQ.exports=Tn;var iye=YQ.exports;function ON(t,e){return ON=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ON(t,e)}function JQ(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ON(t,e)}var _f=function(e,r){if(typeof e=="function"){e(r);return}e!==null&&typeof e=="object"&&(e.current=r)},sye=function(e){return e!==null&&typeof e=="object"&&e.hasOwnProperty("current")},XQ=function(t){JQ(e,t);function e(){for(var n,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=t.call.apply(t,[this].concat(s))||this,n.prevNode=void 0,n}var r=e.prototype;return r.componentDidMount=function(){var i=cb.findDOMNode(this);this.prevNode=i,_f(this.props.innerRef,i)},r.componentDidUpdate=function(i){var s=cb.findDOMNode(this);this.prevNode!==s&&(this.prevNode=s,_f(this.props.innerRef,s)),i.innerRef!==this.props.innerRef&&_f(this.props.innerRef,s)},r.componentWillUnmount=function(){_f(this.props.innerRef,null),delete this.prevNode},r.render=function(){var i=this.props.children;return i},e}(Ve.Component),ZQ=function(t){JQ(e,t);function e(){for(var n,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=t.call.apply(t,[this].concat(s))||this,n.currentNode=void 0,n.handleRefOverride=function(o){var c=n.props,u=c.children,f=c.innerRef;_f(u.ref,o),_f(f,o),n.currentNode=o},n}var r=e.prototype;return r.componentDidUpdate=function(i){i.innerRef!==this.props.innerRef&&_f(this.props.innerRef,this.currentNode)},r.componentWillUnmount=function(){delete this.currentNode},r.render=function(){var i=this.props.children;return Ve.cloneElement(i,{ref:this.handleRefOverride})},e}(Ve.Component),aye=["children","innerRef"],oye=function(e){var r=e.children,n=e.innerRef,i=Xme(e,aye),s=Ve.Children.only(r),a=iye.isForwardRef(s)?ZQ:XQ,o=s&&i&&Object.keys(i).length>0?Ve.cloneElement(s,i):s;return Ve.createElement(a,{innerRef:n},o)};const cye=Object.freeze(Object.defineProperty({__proto__:null,Ref:oye,RefFindNode:XQ,RefForward:ZQ,handleRef:_f,isRefObject:sye},Symbol.toStringTag,{value:"Module"})),Qf=Ia(cye);function eJ(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=eJ(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function xU(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=eJ(t))&&(n&&(n+=" "),n+=e);return n}const uye=Object.freeze(Object.defineProperty({__proto__:null,clsx:xU,default:xU},Symbol.toStringTag,{value:"Module"})),ti=Ia(uye);var KI={exports:{}},WI,AU;function lye(){if(AU)return WI;AU=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return WI=t,WI}var YI,SU;function fye(){if(SU)return YI;SU=1;var t=lye();function e(){}function r(){}return r.resetWarningCache=e,YI=function(){function n(a,o,c,u,f,h){if(h!==t){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return s.PropTypes=s,s},YI}var OU;function Dn(){return OU||(OU=1,KI.exports=fye()()),KI.exports}var QI={},Xm={},JI={exports:{}},IU;function dye(){return IU||(IU=1,function(t){function e(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(JI)),JI.exports}var XI,PU;function V5(){if(PU)return XI;PU=1;function t(e){return e===void 0}return XI=t,XI}var ZI,TU;function hye(){if(TU)return ZI;TU=1;function t(e,r,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),r!==void 0&&(e=e>=r?e:r)),e}return ZI=t,ZI}var eP,CU;function pye(){if(CU)return eP;CU=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return eP=e,eP}var tP,RU;function tJ(){if(RU)return tP;RU=1;var t=pye(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return tP=r,tP}var rP,NU;function rJ(){if(NU)return rP;NU=1;var t=tJ(),e=El(),r=om(),n=0/0,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=e(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=t(u);var h=s.test(u);return h||a.test(u)?o(u.slice(2),h?2:8):i.test(u)?n:+u}return rP=c,rP}var nP,DU;function G5(){if(DU)return nP;DU=1;var t=rJ(),e=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=t(i),i===e||i===-e){var s=i<0?-1:1;return s*r}return i===i?i:0}return nP=n,nP}var iP,MU;function T2(){if(MU)return iP;MU=1;var t=G5();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return iP=e,iP}var sP,kU;function gye(){if(kU)return sP;kU=1;var t=hye(),e=j5(),r=T2(),n=B5();function i(s,a,o){return s=n(s),o=o==null?0:t(r(o),0,s.length),a=e(a),s.slice(o,o+a.length)==a}return sP=i,sP}var aP,$U;function nJ(){if($U)return aP;$U=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,s=0,a=[];++n<i;){var o=e[n];r(o,n,e)&&(a[s++]=o)}return a}return aP=t,aP}var oP,LU;function mye(){if(LU)return oP;LU=1;function t(e){return function(r,n,i){for(var s=-1,a=Object(r),o=i(r),c=o.length;c--;){var u=o[e?c:++s];if(n(a[u],u,a)===!1)break}return r}}return oP=t,oP}var cP,UU;function yye(){if(UU)return cP;UU=1;var t=mye(),e=t();return cP=e,cP}var uP,jU;function vye(){if(jU)return uP;jU=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return uP=t,uP}var lP,BU;function bye(){if(BU)return lP;BU=1;var t=_l(),e=Ac(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return lP=n,lP}var fP,FU;function C2(){if(FU)return fP;FU=1;var t=bye(),e=Ac(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,s=t(function(){return arguments}())?t:function(a){return e(a)&&n.call(a,"callee")&&!i.call(a,"callee")};return fP=s,fP}var dv={exports:{}},dP,qU;function wye(){if(qU)return dP;qU=1;function t(){return!1}return dP=t,dP}dv.exports;var HU;function R2(){return HU||(HU=1,function(t,e){var r=wl(),n=wye(),i=e&&!e.nodeType&&e,s=i&&!0&&t&&!t.nodeType&&t,a=s&&s.exports===i,o=a?r.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||n;t.exports=u}(dv,dv.exports)),dv.exports}var hP,zU;function N2(){if(zU)return hP;zU=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var s=typeof n;return i=i??t,!!i&&(s=="number"||s!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return hP=r,hP}var pP,VU;function K5(){if(VU)return pP;VU=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return pP=e,pP}var gP,GU;function _ye(){if(GU)return gP;GU=1;var t=_l(),e=K5(),r=Ac(),n="[object Arguments]",i="[object Array]",s="[object Boolean]",a="[object Date]",o="[object Error]",c="[object Function]",u="[object Map]",f="[object Number]",h="[object Object]",m="[object RegExp]",y="[object Set]",w="[object String]",v="[object WeakMap]",g="[object ArrayBuffer]",_="[object DataView]",b="[object Float32Array]",S="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",E="[object Int32Array]",p="[object Uint8Array]",I="[object Uint8ClampedArray]",N="[object Uint16Array]",B="[object Uint32Array]",V={};V[b]=V[S]=V[A]=V[O]=V[E]=V[p]=V[I]=V[N]=V[B]=!0,V[n]=V[i]=V[g]=V[s]=V[_]=V[a]=V[o]=V[c]=V[u]=V[f]=V[h]=V[m]=V[y]=V[w]=V[v]=!1;function de(ve){return r(ve)&&e(ve.length)&&!!V[t(ve)]}return gP=de,gP}var mP,KU;function D2(){if(KU)return mP;KU=1;function t(e){return function(r){return e(r)}}return mP=t,mP}var hv={exports:{}};hv.exports;var WU;function Eye(){return WU||(WU=1,function(t,e){var r=HQ(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,a=s&&r.process,o=function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();t.exports=o}(hv,hv.exports)),hv.exports}var yP,YU;function M2(){if(YU)return yP;YU=1;var t=_ye(),e=D2(),r=Eye(),n=r&&r.isTypedArray,i=n?e(n):t;return yP=i,yP}var vP,QU;function xye(){if(QU)return vP;QU=1;var t=vye(),e=C2(),r=Ri(),n=R2(),i=N2(),s=M2(),a=Object.prototype,o=a.hasOwnProperty;function c(u,f){var h=r(u),m=!h&&e(u),y=!h&&!m&&n(u),w=!h&&!m&&!y&&s(u),v=h||m||y||w,g=v?t(u.length,String):[],_=g.length;for(var b in u)(f||o.call(u,b))&&!(v&&(b=="length"||y&&(b=="offset"||b=="parent")||w&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||i(b,_)))&&g.push(b);return g}return vP=c,vP}var bP,JU;function iJ(){if(JU)return bP;JU=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return bP=e,bP}var wP,XU;function sJ(){if(XU)return wP;XU=1;function t(e,r){return function(n){return e(r(n))}}return wP=t,wP}var _P,ZU;function Aye(){if(ZU)return _P;ZU=1;var t=sJ(),e=t(Object.keys,Object);return _P=e,_P}var EP,ej;function aJ(){if(ej)return EP;ej=1;var t=iJ(),e=Aye(),r=Object.prototype,n=r.hasOwnProperty;function i(s){if(!t(s))return e(s);var a=[];for(var o in Object(s))n.call(s,o)&&o!="constructor"&&a.push(o);return a}return EP=i,EP}var xP,tj;function Jf(){if(tj)return xP;tj=1;var t=h2(),e=K5();function r(n){return n!=null&&e(n.length)&&!t(n)}return xP=r,xP}var AP,rj;function Al(){if(rj)return AP;rj=1;var t=xye(),e=aJ(),r=Jf();function n(i){return r(i)?t(i):e(i)}return AP=n,AP}var SP,nj;function W5(){if(nj)return SP;nj=1;var t=yye(),e=Al();function r(n,i){return n&&t(n,i,e)}return SP=r,SP}var OP,ij;function Sye(){if(ij)return OP;ij=1;var t=Jf();function e(r,n){return function(i,s){if(i==null)return i;if(!t(i))return r(i,s);for(var a=i.length,o=n?a:-1,c=Object(i);(n?o--:++o<a)&&s(c[o],o,c)!==!1;);return i}}return OP=e,OP}var IP,sj;function S1(){if(sj)return IP;sj=1;var t=W5(),e=Sye(),r=e(t);return IP=r,IP}var PP,aj;function Oye(){if(aj)return PP;aj=1;var t=S1();function e(r,n){var i=[];return t(r,function(s,a,o){n(s,a,o)&&i.push(s)}),i}return PP=e,PP}var TP,oj;function Iye(){if(oj)return TP;oj=1;var t=y2();function e(){this.__data__=new t,this.size=0}return TP=e,TP}var CP,cj;function Pye(){if(cj)return CP;cj=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return CP=t,CP}var RP,uj;function Tye(){if(uj)return RP;uj=1;function t(e){return this.__data__.get(e)}return RP=t,RP}var NP,lj;function Cye(){if(lj)return NP;lj=1;function t(e){return this.__data__.has(e)}return NP=t,NP}var DP,fj;function Rye(){if(fj)return DP;fj=1;var t=y2(),e=$5(),r=L5(),n=200;function i(s,a){var o=this.__data__;if(o instanceof t){var c=o.__data__;if(!e||c.length<n-1)return c.push([s,a]),this.size=++o.size,this;o=this.__data__=new r(c)}return o.set(s,a),this.size=o.size,this}return DP=i,DP}var MP,dj;function oJ(){if(dj)return MP;dj=1;var t=y2(),e=Iye(),r=Pye(),n=Tye(),i=Cye(),s=Rye();function a(o){var c=this.__data__=new t(o);this.size=c.size}return a.prototype.clear=e,a.prototype.delete=r,a.prototype.get=n,a.prototype.has=i,a.prototype.set=s,MP=a,MP}var kP,hj;function Nye(){if(hj)return kP;hj=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return kP=e,kP}var $P,pj;function Dye(){if(pj)return $P;pj=1;function t(e){return this.__data__.has(e)}return $P=t,$P}var LP,gj;function k2(){if(gj)return LP;gj=1;var t=L5(),e=Nye(),r=Dye();function n(i){var s=-1,a=i==null?0:i.length;for(this.__data__=new t;++s<a;)this.add(i[s])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,LP=n,LP}var UP,mj;function cJ(){if(mj)return UP;mj=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return UP=t,UP}var jP,yj;function $2(){if(yj)return jP;yj=1;function t(e,r){return e.has(r)}return jP=t,jP}var BP,vj;function uJ(){if(vj)return BP;vj=1;var t=k2(),e=cJ(),r=$2(),n=1,i=2;function s(a,o,c,u,f,h){var m=c&n,y=a.length,w=o.length;if(y!=w&&!(m&&w>y))return!1;var v=h.get(a),g=h.get(o);if(v&&g)return v==o&&g==a;var _=-1,b=!0,S=c&i?new t:void 0;for(h.set(a,o),h.set(o,a);++_<y;){var A=a[_],O=o[_];if(u)var E=m?u(O,A,_,o,a,h):u(A,O,_,a,o,h);if(E!==void 0){if(E)continue;b=!1;break}if(S){if(!e(o,function(p,I){if(!r(S,I)&&(A===p||f(A,p,c,u,h)))return S.push(I)})){b=!1;break}}else if(!(A===O||f(A,O,c,u,h))){b=!1;break}}return h.delete(a),h.delete(o),b}return BP=s,BP}var FP,bj;function Mye(){if(bj)return FP;bj=1;var t=wl(),e=t.Uint8Array;return FP=e,FP}var qP,wj;function kye(){if(wj)return qP;wj=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,s){n[++r]=[s,i]}),n}return qP=t,qP}var HP,_j;function Y5(){if(_j)return HP;_j=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return HP=t,HP}var zP,Ej;function $ye(){if(Ej)return zP;Ej=1;var t=_1(),e=Mye(),r=g2(),n=uJ(),i=kye(),s=Y5(),a=1,o=2,c="[object Boolean]",u="[object Date]",f="[object Error]",h="[object Map]",m="[object Number]",y="[object RegExp]",w="[object Set]",v="[object String]",g="[object Symbol]",_="[object ArrayBuffer]",b="[object DataView]",S=t?t.prototype:void 0,A=S?S.valueOf:void 0;function O(E,p,I,N,B,V,de){switch(I){case b:if(E.byteLength!=p.byteLength||E.byteOffset!=p.byteOffset)return!1;E=E.buffer,p=p.buffer;case _:return!(E.byteLength!=p.byteLength||!V(new e(E),new e(p)));case c:case u:case m:return r(+E,+p);case f:return E.name==p.name&&E.message==p.message;case y:case v:return E==p+"";case h:var ve=i;case w:var j=N&a;if(ve||(ve=s),E.size!=p.size&&!j)return!1;var L=de.get(E);if(L)return L==p;N|=o,de.set(E,p);var Y=n(ve(E),ve(p),N,B,V,de);return de.delete(E),Y;case g:if(A)return A.call(E)==A.call(p)}return!1}return zP=O,zP}var VP,xj;function lJ(){if(xj)return VP;xj=1;function t(e,r){for(var n=-1,i=r.length,s=e.length;++n<i;)e[s+n]=r[n];return e}return VP=t,VP}var GP,Aj;function Lye(){if(Aj)return GP;Aj=1;var t=lJ(),e=Ri();function r(n,i,s){var a=i(n);return e(n)?a:t(a,s(n))}return GP=r,GP}var KP,Sj;function Uye(){if(Sj)return KP;Sj=1;function t(){return[]}return KP=t,KP}var WP,Oj;function jye(){if(Oj)return WP;Oj=1;var t=nJ(),e=Uye(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(a){return a==null?[]:(a=Object(a),t(i(a),function(o){return n.call(a,o)}))}:e;return WP=s,WP}var YP,Ij;function Bye(){if(Ij)return YP;Ij=1;var t=Lye(),e=jye(),r=Al();function n(i){return t(i,r,e)}return YP=n,YP}var QP,Pj;function Fye(){if(Pj)return QP;Pj=1;var t=Bye(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(s,a,o,c,u,f){var h=o&e,m=t(s),y=m.length,w=t(a),v=w.length;if(y!=v&&!h)return!1;for(var g=y;g--;){var _=m[g];if(!(h?_ in a:n.call(a,_)))return!1}var b=f.get(s),S=f.get(a);if(b&&S)return b==a&&S==s;var A=!0;f.set(s,a),f.set(a,s);for(var O=h;++g<y;){_=m[g];var E=s[_],p=a[_];if(c)var I=h?c(p,E,_,a,s,f):c(E,p,_,s,a,f);if(!(I===void 0?E===p||u(E,p,o,c,f):I)){A=!1;break}O||(O=_=="constructor")}if(A&&!O){var N=s.constructor,B=a.constructor;N!=B&&"constructor"in s&&"constructor"in a&&!(typeof N=="function"&&N instanceof N&&typeof B=="function"&&B instanceof B)&&(A=!1)}return f.delete(s),f.delete(a),A}return QP=i,QP}var JP,Tj;function qye(){if(Tj)return JP;Tj=1;var t=Gh(),e=wl(),r=t(e,"DataView");return JP=r,JP}var XP,Cj;function Hye(){if(Cj)return XP;Cj=1;var t=Gh(),e=wl(),r=t(e,"Promise");return XP=r,XP}var ZP,Rj;function fJ(){if(Rj)return ZP;Rj=1;var t=Gh(),e=wl(),r=t(e,"Set");return ZP=r,ZP}var e3,Nj;function zye(){if(Nj)return e3;Nj=1;var t=Gh(),e=wl(),r=t(e,"WeakMap");return e3=r,e3}var t3,Dj;function dJ(){if(Dj)return t3;Dj=1;var t=qye(),e=$5(),r=Hye(),n=fJ(),i=zye(),s=_l(),a=zQ(),o="[object Map]",c="[object Object]",u="[object Promise]",f="[object Set]",h="[object WeakMap]",m="[object DataView]",y=a(t),w=a(e),v=a(r),g=a(n),_=a(i),b=s;return(t&&b(new t(new ArrayBuffer(1)))!=m||e&&b(new e)!=o||r&&b(r.resolve())!=u||n&&b(new n)!=f||i&&b(new i)!=h)&&(b=function(S){var A=s(S),O=A==c?S.constructor:void 0,E=O?a(O):"";if(E)switch(E){case y:return m;case w:return o;case v:return u;case g:return f;case _:return h}return A}),t3=b,t3}var r3,Mj;function Vye(){if(Mj)return r3;Mj=1;var t=oJ(),e=uJ(),r=$ye(),n=Fye(),i=dJ(),s=Ri(),a=R2(),o=M2(),c=1,u="[object Arguments]",f="[object Array]",h="[object Object]",m=Object.prototype,y=m.hasOwnProperty;function w(v,g,_,b,S,A){var O=s(v),E=s(g),p=O?f:i(v),I=E?f:i(g);p=p==u?h:p,I=I==u?h:I;var N=p==h,B=I==h,V=p==I;if(V&&a(v)){if(!a(g))return!1;O=!0,N=!1}if(V&&!N)return A||(A=new t),O||o(v)?e(v,g,_,b,S,A):r(v,g,p,_,b,S,A);if(!(_&c)){var de=N&&y.call(v,"__wrapped__"),ve=B&&y.call(g,"__wrapped__");if(de||ve){var j=de?v.value():v,L=ve?g.value():g;return A||(A=new t),S(j,L,_,b,A)}}return V?(A||(A=new t),n(v,g,_,b,S,A)):!1}return r3=w,r3}var n3,kj;function Q5(){if(kj)return n3;kj=1;var t=Vye(),e=Ac();function r(n,i,s,a,o){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,s,a,r,o)}return n3=r,n3}var i3,$j;function Gye(){if($j)return i3;$j=1;var t=oJ(),e=Q5(),r=1,n=2;function i(s,a,o,c){var u=o.length,f=u,h=!c;if(s==null)return!f;for(s=Object(s);u--;){var m=o[u];if(h&&m[2]?m[1]!==s[m[0]]:!(m[0]in s))return!1}for(;++u<f;){m=o[u];var y=m[0],w=s[y],v=m[1];if(h&&m[2]){if(w===void 0&&!(y in s))return!1}else{var g=new t;if(c)var _=c(w,v,y,s,a,g);if(!(_===void 0?e(v,w,r|n,c,g):_))return!1}}return!0}return i3=i,i3}var s3,Lj;function hJ(){if(Lj)return s3;Lj=1;var t=El();function e(r){return r===r&&!t(r)}return s3=e,s3}var a3,Uj;function Kye(){if(Uj)return a3;Uj=1;var t=hJ(),e=Al();function r(n){for(var i=e(n),s=i.length;s--;){var a=i[s],o=n[a];i[s]=[a,o,t(o)]}return i}return a3=r,a3}var o3,jj;function pJ(){if(jj)return o3;jj=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return o3=t,o3}var c3,Bj;function Wye(){if(Bj)return c3;Bj=1;var t=Gye(),e=Kye(),r=pJ();function n(i){var s=e(i);return s.length==1&&s[0][2]?r(s[0][0],s[0][1]):function(a){return a===i||t(a,i,s)}}return c3=n,c3}var u3,Fj;function Yye(){if(Fj)return u3;Fj=1;var t=x1();function e(r,n,i){var s=r==null?void 0:t(r,n);return s===void 0?i:s}return u3=e,u3}var l3,qj;function Qye(){if(qj)return l3;qj=1;function t(e,r){return e!=null&&r in Object(e)}return l3=t,l3}var f3,Hj;function gJ(){if(Hj)return f3;Hj=1;var t=E1(),e=C2(),r=Ri(),n=N2(),i=K5(),s=cm();function a(o,c,u){c=t(c,o);for(var f=-1,h=c.length,m=!1;++f<h;){var y=s(c[f]);if(!(m=o!=null&&u(o,y)))break;o=o[y]}return m||++f!=h?m:(h=o==null?0:o.length,!!h&&i(h)&&n(y,h)&&(r(o)||e(o)))}return f3=a,f3}var d3,zj;function mJ(){if(zj)return d3;zj=1;var t=Qye(),e=gJ();function r(n,i){return n!=null&&e(n,i,t)}return d3=r,d3}var h3,Vj;function Jye(){if(Vj)return h3;Vj=1;var t=Q5(),e=Yye(),r=mJ(),n=k5(),i=hJ(),s=pJ(),a=cm(),o=1,c=2;function u(f,h){return n(f)&&i(h)?s(a(f),h):function(m){var y=e(m,f);return y===void 0&&y===h?r(m,f):t(h,y,o|c)}}return h3=u,h3}var p3,Gj;function Xye(){if(Gj)return p3;Gj=1;function t(e){return function(r){return r==null?void 0:r[e]}}return p3=t,p3}var g3,Kj;function Zye(){if(Kj)return g3;Kj=1;var t=x1();function e(r){return function(n){return t(n,r)}}return g3=e,g3}var m3,Wj;function eve(){if(Wj)return m3;Wj=1;var t=Xye(),e=Zye(),r=k5(),n=cm();function i(s){return r(s)?t(n(s)):e(s)}return m3=i,m3}var y3,Yj;function Xf(){if(Yj)return y3;Yj=1;var t=Wye(),e=Jye(),r=Yf(),n=Ri(),i=eve();function s(a){return typeof a=="function"?a:a==null?r:typeof a=="object"?n(a)?e(a[0],a[1]):t(a):i(a)}return y3=s,y3}var v3,Qj;function tve(){if(Qj)return v3;Qj=1;var t=nJ(),e=Oye(),r=Xf(),n=Ri();function i(s,a){var o=n(s)?t:e;return o(s,r(a,3))}return v3=i,v3}var b3,Jj;function yJ(){if(Jj)return b3;Jj=1;var t=aJ(),e=dJ(),r=C2(),n=Ri(),i=Jf(),s=R2(),a=iJ(),o=M2(),c="[object Map]",u="[object Set]",f=Object.prototype,h=f.hasOwnProperty;function m(y){if(y==null)return!0;if(i(y)&&(n(y)||typeof y=="string"||typeof y.splice=="function"||s(y)||o(y)||r(y)))return!y.length;var w=e(y);if(w==c||w==u)return!y.size;if(a(y))return!t(y).length;for(var v in y)if(h.call(y,v))return!1;return!0}return b3=m,b3}var w3,Xj;function vJ(){if(Xj)return w3;Xj=1;function t(e,r,n,i){for(var s=e.length,a=n+(i?1:-1);i?a--:++a<s;)if(r(e[a],a,e))return a;return-1}return w3=t,w3}var _3,Zj;function rve(){if(Zj)return _3;Zj=1;function t(e){return e!==e}return _3=t,_3}var E3,eB;function nve(){if(eB)return E3;eB=1;function t(e,r,n){for(var i=n-1,s=e.length;++i<s;)if(e[i]===r)return i;return-1}return E3=t,E3}var x3,tB;function L2(){if(tB)return x3;tB=1;var t=vJ(),e=rve(),r=nve();function n(i,s,a){return s===s?r(i,s,a):t(i,e,a)}return x3=n,x3}var A3,rB;function J5(){if(rB)return A3;rB=1;var t=L2();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return A3=e,A3}var S3,nB;function X5(){if(nB)return S3;nB=1;function t(e,r,n){for(var i=-1,s=e==null?0:e.length;++i<s;)if(n(r,e[i]))return!0;return!1}return S3=t,S3}var O3,iB;function ive(){if(iB)return O3;iB=1;var t=k2(),e=J5(),r=X5(),n=Kh(),i=D2(),s=$2(),a=Math.min;function o(c,u,f){for(var h=f?r:e,m=c[0].length,y=c.length,w=y,v=Array(y),g=1/0,_=[];w--;){var b=c[w];w&&u&&(b=n(b,i(u))),g=a(b.length,g),v[w]=!f&&(u||m>=120&&b.length>=120)?new t(w&&b):void 0}b=c[0];var S=-1,A=v[0];e:for(;++S<m&&_.length<g;){var O=b[S],E=u?u(O):O;if(O=f||O!==0?O:0,!(A?s(A,E):h(_,E,f))){for(w=y;--w;){var p=v[w];if(!(p?s(p,E):h(c[w],E,f)))continue e}A&&A.push(E),_.push(O)}}return _}return O3=o,O3}var I3,sB;function Z5(){if(sB)return I3;sB=1;var t=Jf(),e=Ac();function r(n){return e(n)&&t(n)}return I3=r,I3}var P3,aB;function sve(){if(aB)return P3;aB=1;var t=Z5();function e(r){return t(r)?r:[]}return P3=e,P3}var T3,oB;function ave(){if(oB)return T3;oB=1;var t=Kh(),e=ive(),r=A1(),n=sve(),i=r(function(s){var a=t(s,n);return a.length&&a[0]===s[0]?e(a):[]});return T3=i,T3}var C3,cB;function ove(){if(cB)return C3;cB=1;var t=Object.prototype,e=t.hasOwnProperty;function r(n,i){return n!=null&&e.call(n,i)}return C3=r,C3}var R3,uB;function bJ(){if(uB)return R3;uB=1;var t=ove(),e=gJ();function r(n,i){return n!=null&&e(n,i,t)}return R3=r,R3}var N3,lB;function wJ(){if(lB)return N3;lB=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i&&r(e[n],n,e)!==!1;);return e}return N3=t,N3}var D3,fB;function cve(){if(fB)return D3;fB=1;var t=Yf();function e(r){return typeof r=="function"?r:t}return D3=e,D3}var M3,dB;function _J(){if(dB)return M3;dB=1;var t=wJ(),e=S1(),r=cve(),n=Ri();function i(s,a){var o=n(s)?t:e;return o(s,r(a))}return M3=i,M3}var k3,hB;function uve(){return hB||(hB=1,k3=_J()),k3}var pB;function lve(){if(pB)return Xm;pB=1;var t=vr;Xm.__esModule=!0,Xm.default=void 0;var e=t(kn()),r=t(dye()),n=t(xc()),i=t(V5());t(gye()),t(tve()),t(yJ()),t(Al()),t(ave()),t(bJ()),t(uve());var s=t(jo()),a=t(Ve),o=function(h){return"default"+(h[0].toUpperCase()+h.slice(1))},c=function(h,m,y,w){w===void 0&&(w=!1);var v=m[h];if(v!==void 0)return v;if(w){var g=m[o(h)];if(g!==void 0)return g;if(y){var _=y[h];if(_!==void 0)return _}}if(h==="checked")return!1;if(h==="value")return m.multiple?[]:""},u=function(f){(0,n.default)(h,f);function h(){for(var m,y=arguments.length,w=new Array(y),v=0;v<y;v++)w[v]=arguments[v];m=f.call.apply(f,[this].concat(w))||this;var g=m.constructor,_=g.autoControlledProps,b=g.getAutoControlledStateFromProps,S=(0,s.default)((0,r.default)(m),"getInitialAutoControlledState",m.props)||{},A=_.reduce(function(O,E){return O[E]=c(E,m.props,S,!0),O},{});return m.state=(0,e.default)({},S,A,{autoControlledProps:_,getAutoControlledStateFromProps:b}),m}return h.getDerivedStateFromProps=function(y,w){var v=w.autoControlledProps,g=w.getAutoControlledStateFromProps,_=v.reduce(function(S,A){var O=!(0,i.default)(y[A]);return O&&(S[A]=y[A]),S},{});if(g){var b=g(y,(0,e.default)({},w,_),w);return(0,e.default)({},_,b)}return _},h.getAutoControlledStateFromProps=function(){return null},h}(a.default.Component);return Xm.default=u,Xm}var Eu={},$3,gB;function fve(){if(gB)return $3;gB=1;var t=Xf(),e=Jf(),r=Al();function n(i){return function(s,a,o){var c=Object(s);if(!e(s)){var u=t(a,3);s=r(s),a=function(h){return u(c[h],h,c)}}var f=i(s,a,o);return f>-1?c[u?s[f]:f]:void 0}}return $3=n,$3}var L3,mB;function dve(){if(mB)return L3;mB=1;var t=vJ(),e=Xf(),r=T2(),n=Math.max;function i(s,a,o){var c=s==null?0:s.length;if(!c)return-1;var u=o==null?0:r(o);return u<0&&(u=n(c+u,0)),t(s,e(a,3),u)}return L3=i,L3}var U3,yB;function hve(){if(yB)return U3;yB=1;var t=fve(),e=dve(),r=t(e);return U3=r,U3}var j3,vB;function pve(){if(vB)return j3;vB=1;var t=S1();function e(r,n){var i;return t(r,function(s,a,o){return i=n(s,a,o),!i}),!!i}return j3=e,j3}var B3,bB;function e4(){if(bB)return B3;bB=1;var t=g2(),e=Jf(),r=N2(),n=El();function i(s,a,o){if(!n(o))return!1;var c=typeof a;return(c=="number"?e(o)&&r(a,o.length):c=="string"&&a in o)?t(o[a],s):!1}return B3=i,B3}var F3,wB;function EJ(){if(wB)return F3;wB=1;var t=cJ(),e=Xf(),r=pve(),n=Ri(),i=e4();function s(a,o,c){var u=n(a)?t:r;return c&&i(a,o,c)&&(o=void 0),u(a,e(o,3))}return F3=s,F3}var _B;function gve(){if(_B)return Eu;_B=1;var t=vr;Eu.__esModule=!0,Eu.isNil=Eu.findByType=Eu.someByType=void 0;var e=t(hve()),r=t(EJ()),n=Ve,i=function(c,u){return(0,r.default)(n.Children.toArray(c),{type:u})};Eu.someByType=i;var s=function(c,u){return(0,e.default)(n.Children.toArray(c),{type:u})};Eu.findByType=s;var a=function(c){return c==null||Array.isArray(c)&&c.length===0};return Eu.isNil=a,Eu}var es={},Rp={},EB;function t4(){if(EB)return Rp;EB=1,Rp.__esModule=!0,Rp.numberToWord=e,Rp.numberToWordMap=void 0;var t={1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven",8:"eight",9:"nine",10:"ten",11:"eleven",12:"twelve",13:"thirteen",14:"fourteen",15:"fifteen",16:"sixteen"};Rp.numberToWordMap=t;function e(r){var n=typeof r;return n==="string"||n==="number"?t[r]||r:""}return Rp}var xB;function mve(){if(xB)return es;xB=1,es.__esModule=!0,es.useWidthProp=es.useVerticalAlignProp=es.useTextAlignProp=es.useMultipleProp=es.useKeyOrValueAndKey=es.useValueAndKey=es.useKeyOnly=void 0;var t=t4(),e=function(u,f){return u&&f};es.useKeyOnly=e;var r=function(u,f){return u&&u!==!0&&u+" "+f};es.useValueAndKey=r;var n=function(u,f){return u&&(u===!0?f:u+" "+f)};es.useKeyOrValueAndKey=n;var i=function(u,f){return!u||u===!0?null:u.replace("large screen","large-screen").replace(/ vertically/g,"-vertically").split(" ").map(function(h){return h.replace("-"," ")+" "+f}).join(" ")};es.useMultipleProp=i;var s=function(u){return u==="justified"?"justified":r(u,"aligned")};es.useTextAlignProp=s;var a=function(u){return r(u,"aligned")};es.useVerticalAlignProp=a;var o=function(u,f,h){if(f===void 0&&(f=""),h===void 0&&(h=!1),h&&u==="equal")return"equal width";var m=typeof u;return(m==="string"||m==="number")&&f?(0,t.numberToWord)(u)+" "+f:(0,t.numberToWord)(u)};return es.useWidthProp=o,es}var In={},q3,AB;function xJ(){if(AB)return q3;AB=1;var t=k2(),e=J5(),r=X5(),n=Kh(),i=D2(),s=$2(),a=200;function o(c,u,f,h){var m=-1,y=e,w=!0,v=c.length,g=[],_=u.length;if(!v)return g;f&&(u=n(u,i(f))),h?(y=r,w=!1):u.length>=a&&(y=s,w=!1,u=new t(u));e:for(;++m<v;){var b=c[m],S=f==null?b:f(b);if(b=h||b!==0?b:0,w&&S===S){for(var A=_;A--;)if(u[A]===S)continue e;g.push(b)}else y(u,S,h)||g.push(b)}return g}return q3=o,q3}var H3,SB;function yve(){if(SB)return H3;SB=1;var t=_1(),e=C2(),r=Ri(),n=t?t.isConcatSpreadable:void 0;function i(s){return r(s)||e(s)||!!(n&&s&&s[n])}return H3=i,H3}var z3,OB;function r4(){if(OB)return z3;OB=1;var t=lJ(),e=yve();function r(n,i,s,a,o){var c=-1,u=n.length;for(s||(s=e),o||(o=[]);++c<u;){var f=n[c];i>0&&s(f)?i>1?r(f,i-1,s,a,o):t(o,f):a||(o[o.length]=f)}return o}return z3=r,z3}var V3,IB;function vve(){if(IB)return V3;IB=1;var t=xJ(),e=r4(),r=A1(),n=Z5(),i=r(function(s,a){return n(s)?t(s,e(a,1,n,!0)):[]});return V3=i,V3}var G3,PB;function bve(){if(PB)return G3;PB=1;var t=F5();function e(r,n,i){var s=r.length;return i=i===void 0?s:i,!n&&i>=s?r:t(r,n,i)}return G3=e,G3}var K3,TB;function wve(){if(TB)return K3;TB=1;var t=L2();function e(r,n){for(var i=r.length;i--&&t(n,r[i],0)>-1;);return i}return K3=e,K3}var W3,CB;function _ve(){if(CB)return W3;CB=1;var t=L2();function e(r,n){for(var i=-1,s=r.length;++i<s&&t(n,r[i],0)>-1;);return i}return W3=e,W3}var Y3,RB;function Eve(){if(RB)return Y3;RB=1;function t(e){return e.split("")}return Y3=t,Y3}var Q3,NB;function xve(){if(NB)return Q3;NB=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,s="\\ufe0e\\ufe0f",a="\\u200d",o=RegExp("["+a+t+i+s+"]");function c(u){return o.test(u)}return Q3=c,Q3}var J3,DB;function Ave(){if(DB)return J3;DB=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,s="\\ufe0e\\ufe0f",a="["+t+"]",o="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+o+"|"+c+")",f="[^"+t+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",w=u+"?",v="["+s+"]?",g="(?:"+y+"(?:"+[f,h,m].join("|")+")"+v+w+")*",_=v+w+g,b="(?:"+[f+o+"?",o,h,m,a].join("|")+")",S=RegExp(c+"(?="+c+")|"+b+_,"g");function A(O){return O.match(S)||[]}return J3=A,J3}var X3,MB;function Sve(){if(MB)return X3;MB=1;var t=Eve(),e=xve(),r=Ave();function n(i){return e(i)?r(i):t(i)}return X3=n,X3}var Z3,kB;function Ove(){if(kB)return Z3;kB=1;var t=j5(),e=tJ(),r=bve(),n=wve(),i=_ve(),s=Sve(),a=B5();function o(c,u,f){if(c=a(c),c&&(f||u===void 0))return e(c);if(!c||!(u=t(u)))return c;var h=s(c),m=s(u),y=i(h,m),w=n(h,m)+1;return r(h,y,w).join("")}return Z3=o,Z3}var eT,$B;function Ive(){if($B)return eT;$B=1;var t=KQ();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return eT=e,eT}var tT,LB;function Pve(){if(LB)return tT;LB=1;var t=Ive(),e=g2(),r=Object.prototype,n=r.hasOwnProperty;function i(s,a,o){var c=s[a];(!(n.call(s,a)&&e(c,o))||o===void 0&&!(a in s))&&t(s,a,o)}return tT=i,tT}var rT,UB;function Tve(){if(UB)return rT;UB=1;var t=Pve(),e=E1(),r=N2(),n=El(),i=cm();function s(a,o,c,u){if(!n(a))return a;o=e(o,a);for(var f=-1,h=o.length,m=h-1,y=a;y!=null&&++f<h;){var w=i(o[f]),v=c;if(w==="__proto__"||w==="constructor"||w==="prototype")return a;if(f!=m){var g=y[w];v=u?u(g,w,y):void 0,v===void 0&&(v=n(g)?g:r(o[f+1])?[]:{})}t(y,w,v),y=y[w]}return a}return rT=s,rT}var nT,jB;function Cve(){if(jB)return nT;jB=1;var t=x1(),e=Tve(),r=E1();function n(i,s,a){for(var o=-1,c=s.length,u={};++o<c;){var f=s[o],h=t(i,f);a(h,f)&&e(u,r(f,i),h)}return u}return nT=n,nT}var iT,BB;function Rve(){if(BB)return iT;BB=1;var t=Cve(),e=mJ();function r(n,i){return t(n,i,function(s,a){return e(n,a)})}return iT=r,iT}var sT,FB;function Nve(){if(FB)return sT;FB=1;var t=r4();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return sT=e,sT}var aT,qB;function Dve(){if(qB)return aT;qB=1;var t=Nve(),e=VQ(),r=WQ();function n(i){return r(e(i,void 0,t),i+"")}return aT=n,aT}var oT,HB;function n4(){if(HB)return oT;HB=1;var t=Rve(),e=Dve(),r=e(function(n,i){return n==null?{}:t(n,i)});return oT=r,oT}var cT,zB;function AJ(){if(zB)return cT;zB=1;var t=sJ(),e=t(Object.getPrototypeOf,Object);return cT=e,cT}var uT,VB;function U2(){if(VB)return uT;VB=1;var t=_l(),e=AJ(),r=Ac(),n="[object Object]",i=Function.prototype,s=Object.prototype,a=i.toString,o=s.hasOwnProperty,c=a.call(Object);function u(f){if(!r(f)||t(f)!=n)return!1;var h=e(f);if(h===null)return!0;var m=o.call(h,"constructor")&&h.constructor;return typeof m=="function"&&m instanceof m&&a.call(m)==c}return uT=u,uT}var lT,GB;function Mve(){if(GB)return lT;GB=1;var t=om();function e(r,n,i){for(var s=-1,a=r.length;++s<a;){var o=r[s],c=n(o);if(c!=null&&(u===void 0?c===c&&!t(c):i(c,u)))var u=c,f=o}return f}return lT=e,lT}var fT,KB;function kve(){if(KB)return fT;KB=1;function t(e,r){return e<r}return fT=t,fT}var dT,WB;function $ve(){if(WB)return dT;WB=1;var t=Mve(),e=kve(),r=Yf();function n(i){return i&&i.length?t(i,r,e):void 0}return dT=n,dT}var hT,YB;function Lve(){if(YB)return hT;YB=1;function t(e,r){for(var n,i=-1,s=e.length;++i<s;){var a=r(e[i]);a!==void 0&&(n=n===void 0?a:n+a)}return n}return hT=t,hT}var pT,QB;function Uve(){if(QB)return pT;QB=1;var t=Lve(),e=Yf();function r(n){return n&&n.length?t(n,e):0}return pT=r,pT}var gT,JB;function SJ(){if(JB)return gT;JB=1;var t=S1(),e=Jf();function r(n,i){var s=-1,a=e(n)?Array(n.length):[];return t(n,function(o,c,u){a[++s]=i(o,c,u)}),a}return gT=r,gT}var mT,XB;function j2(){if(XB)return mT;XB=1;var t=Kh(),e=Xf(),r=SJ(),n=Ri();function i(s,a){var o=n(s)?t:r;return o(s,e(a,3))}return mT=i,mT}var yT,ZB;function jve(){if(ZB)return yT;ZB=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return yT=t,yT}var vT,eF;function Bve(){if(eF)return vT;eF=1;var t=om();function e(r,n){if(r!==n){var i=r!==void 0,s=r===null,a=r===r,o=t(r),c=n!==void 0,u=n===null,f=n===n,h=t(n);if(!u&&!h&&!o&&r>n||o&&c&&f&&!u&&!h||s&&c&&f||!i&&f||!a)return 1;if(!s&&!o&&!h&&r<n||h&&i&&a&&!s&&!o||u&&i&&a||!c&&a||!f)return-1}return 0}return vT=e,vT}var bT,tF;function Fve(){if(tF)return bT;tF=1;var t=Bve();function e(r,n,i){for(var s=-1,a=r.criteria,o=n.criteria,c=a.length,u=i.length;++s<c;){var f=t(a[s],o[s]);if(f){if(s>=u)return f;var h=i[s];return f*(h=="desc"?-1:1)}}return r.index-n.index}return bT=e,bT}var wT,rF;function qve(){if(rF)return wT;rF=1;var t=Kh(),e=x1(),r=Xf(),n=SJ(),i=jve(),s=D2(),a=Fve(),o=Yf(),c=Ri();function u(f,h,m){h.length?h=t(h,function(v){return c(v)?function(g){return e(g,v.length===1?v[0]:v)}:v}):h=[o];var y=-1;h=t(h,s(r));var w=n(f,function(v,g,_){var b=t(h,function(S){return S(v)});return{criteria:b,index:++y,value:v}});return i(w,function(v,g){return a(v,g,m)})}return wT=u,wT}var _T,nF;function Hve(){if(nF)return _T;nF=1;var t=r4(),e=qve(),r=A1(),n=e4(),i=r(function(s,a){if(s==null)return[];var o=a.length;return o>1&&n(s,a[0],a[1])?a=[]:o>2&&n(a[0],a[1],a[2])&&(a=[a[0]]),e(s,t(a,1),[])});return _T=i,_T}var ET,iF;function zve(){if(iF)return ET;iF=1;var t=F5(),e=T2();function r(n,i,s){return n&&n.length?(i=s||i===void 0?1:e(i),t(n,0,i<0?0:i)):[]}return ET=r,ET}var Zm={},sF;function OJ(){if(sF)return Zm;sF=1,Zm.__esModule=!0,Zm.default=void 0;var t=function(){return 0},e=t;return Zm.default=e,Zm}var aF;function Vve(){if(aF)return In;aF=1;var t=vr;In.__esModule=!0,In.ref=In.refObject=In.deprecate=In.collectionShorthand=In.itemShorthand=In.contentShorthand=In.multipleProp=In.demand=In.givenProps=In.every=In.disallow=In.suggest=In.domNode=void 0;var e=t(vve()),r=t(Ove()),n=t(El()),i=t(n4()),s=t(Al()),a=t(U2()),o=t(xl()),c=t($ve()),u=t(Uve()),f=t(j2()),h=t(Hve()),m=t(zve()),y=t(U5()),w=t(Dn()),v=t(OJ()),g=function(){var L;return(L=Object.prototype.toString).call.apply(L,arguments)},_=function(L,Y){if(L[Y]!==void 0&&!(typeof Element>"u")&&!(L[Y]instanceof Element))return new Error('Invalid prop "'+Y+'" supplied, expected a DOM node.')};In.domNode=_;var b=function(L){if(!Array.isArray(L))throw new Error("Invalid argument supplied to suggest, expected an instance of array.");var Y=(0,y.default)(function(U){var F=U.split(" ");return(0,m.default)((0,h.default)((0,f.default)(L,function(H){var M=H.split(" "),q=(0,u.default)((0,f.default)((0,f.default)(F,function(k){return(0,f.default)(M,function(G){return(0,v.default)(k,G)})}),c.default)),$=(0,u.default)((0,f.default)((0,f.default)(M,function(k){return(0,f.default)(F,function(G){return(0,v.default)(k,G)})}),c.default));return{suggestion:H,score:q+$}}),["score","suggestion"]),3)}),ne=L.reduce(function(U,F){return U[F.split(" ").sort().join(" ")]=!0,U},{});return function(U,F,H){var M=U[F];if(!(!M||ne[M])){var q=M.split(" ").sort().join(" ");if(!ne[q]){var $=Y(M);if(!$.some(function(k){return k.score===0}))return new Error(["Invalid prop `"+F+"` of value `"+M+"` supplied to `"+H+"`.",`
79
-
80
- Instead of \``+M+"`, did you mean:",$.map(function(k){return`
81
- - `+k.suggestion}).join(""),`
82
- `].join(""))}}}};In.suggest=b;var S=function(L){return function(Y,ne,U){if(!Array.isArray(L))throw new Error(["Invalid argument supplied to disallow, expected an instance of array."," See `"+ne+"` prop in `"+U+"`."].join(""));if(!((0,o.default)(Y[ne])||Y[ne]===!1)){var F=L.reduce(function(H,M){return!(0,o.default)(Y[M])&&Y[M]!==!1?[].concat(H,[M]):H},[]);if(F.length>0)return new Error(["Prop `"+ne+"` in `"+U+"` conflicts with props: `"+F.join("`, `")+"`.","They cannot be defined together, choose one or the other."].join(" "))}}};In.disallow=S;var A=function(L){return function(Y,ne,U){for(var F=arguments.length,H=new Array(F>3?F-3:0),M=3;M<F;M++)H[M-3]=arguments[M];if(!Array.isArray(L))throw new Error(["Invalid argument supplied to every, expected an instance of array.","See `"+ne+"` prop in `"+U+"`."].join(" "));var q=[];return L.forEach(function($){if(typeof $!="function")throw new Error('every() argument "validators" should contain functions, found: '+g($)+".");var k=$.apply(void 0,[Y,ne,U].concat(H));k&&q.push(k)}),q[0]}};In.every=A;var O=function(L,Y){return function(ne,U,F){for(var H=arguments.length,M=new Array(H>3?H-3:0),q=3;q<H;q++)M[q-3]=arguments[q];if(!(0,a.default)(L))throw new Error(["Invalid argument supplied to givenProps, expected an object.","See `"+U+"` prop in `"+F+"`."].join(" "));if(typeof Y!="function")throw new Error(["Invalid argument supplied to givenProps, expected a function.","See `"+U+"` prop in `"+F+"`."].join(" "));var $=(0,s.default)(L).every(function(pe){var Q=L[pe];return typeof Q=="function"?!Q.apply(void 0,[ne,pe,F].concat(M)):Q===ne[U]});if($){var k=Y.apply(void 0,[ne,U,F].concat(M));if(k){var G="{ "+(0,s.default)((0,i.default)((0,s.default)(L),ne)).map(function(pe){var Q=ne[pe],te=Q;return typeof Q=="string"?te='"'+Q+'"':Array.isArray(Q)?te="["+Q.join(", ")+"]":(0,n.default)(Q)&&(te="{...}"),pe+": "+te}).join(", ")+" }";return k.message="Given props "+G+": "+k.message,k}}}};In.givenProps=O;var E=function(L){return function(Y,ne,U){if(!Array.isArray(L))throw new Error(["Invalid `requiredProps` argument supplied to require, expected an instance of array."," See `"+ne+"` prop in `"+U+"`."].join(""));if(Y[ne]!==void 0){var F=L.filter(function(H){return Y[H]===void 0});if(F.length>0)return new Error("`"+ne+"` prop in `"+U+"` requires props: `"+F.join("`, `")+"`.")}}};In.demand=E;var p=function(L){return function(Y,ne,U){if(!Array.isArray(L))throw new Error(["Invalid argument supplied to some, expected an instance of array.","See `"+ne+"` prop in `"+U+"`."].join(" "));var F=Y[ne];if(!((0,o.default)(F)||F===!1)){var H=F.replace("large screen","large-screen").replace(/ vertically/g,"-vertically").split(" ").map(function(q){return(0,r.default)(q).replace("-"," ")}),M=(0,e.default)(H,L);if(M.length>0)return new Error("`"+ne+"` prop in `"+U+"` has invalid values: `"+M.join("`, `")+"`.")}}};In.multipleProp=p;var I=function(){return A([S(["children"]),w.default.node]).apply(void 0,arguments)};In.contentShorthand=I;var N=function(){return A([S(["children"]),w.default.oneOfType([w.default.func,w.default.node,w.default.object,w.default.arrayOf(w.default.oneOfType([w.default.node,w.default.object]))])]).apply(void 0,arguments)};In.itemShorthand=N;var B=function(){return A([S(["children"]),w.default.arrayOf(N)]).apply(void 0,arguments)};In.collectionShorthand=B;var V=function(L,Y){return function(ne,U,F){if(typeof L!="string")throw new Error(["Invalid `help` argument supplied to deprecate, expected a string.","See `"+U+"` prop in `"+F+"`."].join(" "));if(ne[U]!==void 0){var H=new Error("The `"+U+"` prop in `"+F+"` is deprecated.");if(L&&(H.message+=" "+L),Y)if(typeof Y=="function"){for(var M=arguments.length,q=new Array(M>3?M-3:0),$=3;$<M;$++)q[$-3]=arguments[$];var k=Y.apply(void 0,[ne,U,F].concat(q));k&&(H.message=H.message+" "+k.message)}else throw new Error(["Invalid argument supplied to deprecate, expected a function.","See `"+U+"` prop in `"+F+"`."].join(" "));return H}}};In.deprecate=V;var de=w.default.shape({current:w.default.object});In.refObject=de;var ve=w.default.oneOfType([w.default.func,de]);return In.ref=ve,In}var ey={},Zw={exports:{}},ty={},xT={exports:{}};/*!
83
- Copyright (c) 2015 Jed Watson.
84
- Based on code that is Copyright 2013-2015, Facebook, Inc.
85
- All rights reserved.
86
- */var oF;function Gve(){return oF||(oF=1,function(t){(function(){var e=!!(typeof window<"u"&&window.document&&window.document.createElement),r={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen};t.exports?t.exports=r:window.ExecutionEnvironment=r})()}(xT)),xT.exports}var cF;function Kve(){if(cF)return ty;cF=1,Object.defineProperty(ty,"__esModule",{value:!0});var t=Gve();Dn();var e=Ve;function r(E){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(E)}function n(E,p){if(!(E instanceof p))throw new TypeError("Cannot call a class as a function")}function i(E,p){for(var I=0;I<p.length;I++){var N=p[I];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}function s(E,p,I){return p&&i(E.prototype,p),I&&i(E,I),E}function a(E,p,I){return p in E?Object.defineProperty(E,p,{value:I,enumerable:!0,configurable:!0,writable:!0}):E[p]=I,E}function o(E,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(p&&p.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),p&&u(E,p)}function c(E){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)})(E)}function u(E,p){return(u=Object.setPrototypeOf||function(I,N){return I.__proto__=N,I})(E,p)}function f(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function h(E,p){return!p||typeof p!="object"&&typeof p!="function"?f(E):p}var m=function(){function E(p){n(this,E),a(this,"handlers",void 0),this.handlers=p.slice(0)}return s(E,[{key:"addHandlers",value:function(p){for(var I=this.handlers.slice(0),N=p.length,B=0;B<N;B+=1)I.push(p[B]);return new E(I)}},{key:"dispatchEvent",value:function(p,I){var N=this.handlers.length-1;if(I){for(var B=N;B>=0;B-=1)this.handlers[B].called||(this.handlers[B].called=!0,this.handlers[B](p));for(var V=N;V>=0;V-=1)this.handlers[V].called=!1}else(0,this.handlers[N])(p)}},{key:"hasHandlers",value:function(){return this.handlers.length>0}},{key:"removeHandlers",value:function(p){for(var I=[],N=this.handlers.length,B=0;B<N;B+=1){var V=this.handlers[B];p.indexOf(V)===-1&&I.push(V)}return new E(I)}}]),E}();function y(E){var p=new Map;return E.forEach(function(I,N){p.set(N,I)}),p}function w(E){return Array.isArray(E)?E:[E]}var v=function(E){return E!==null&&r(E)==="object"&&E.hasOwnProperty("current")};function g(E){return E==="document"?document:E==="window"?window:v(E)?E.current||document:E||document}var _=function(){function E(p,I){n(this,E),a(this,"handlerSets",void 0),a(this,"poolName",void 0),this.handlerSets=I,this.poolName=p}return s(E,[{key:"addHandlers",value:function(p,I){var N=y(this.handlerSets);if(N.has(p)){var B=N.get(p);N.set(p,B.addHandlers(I))}else N.set(p,new m(I));return new E(this.poolName,N)}},{key:"dispatchEvent",value:function(p,I){var N=this.handlerSets.get(p),B=this.poolName==="default";N&&N.dispatchEvent(I,B)}},{key:"hasHandlers",value:function(p){if(!p)return this.handlerSets.size>0;var I=this.handlerSets.get(p);return!!I&&I.hasHandlers()}},{key:"removeHandlers",value:function(p,I){var N=y(this.handlerSets);if(!N.has(p))return new E(this.poolName,N);var B=N.get(p).removeHandlers(I);return B.hasHandlers()?N.set(p,B):N.delete(p),new E(this.poolName,N)}}]),E}();a(_,"createByType",function(E,p,I){var N=new Map;return N.set(p,new m(I)),new _(E,N)});var b=function(){function E(p){var I=this;n(this,E),a(this,"handlers",new Map),a(this,"pools",new Map),a(this,"target",void 0),a(this,"createEmitter",function(N){return function(B){I.pools.forEach(function(V){V.dispatchEvent(N,B)})}}),this.target=p}return s(E,[{key:"addHandlers",value:function(p,I,N){if(this.pools.has(p)){var B=this.pools.get(p);this.pools.set(p,B.addHandlers(I,N))}else this.pools.set(p,_.createByType(p,I,N));this.handlers.has(I)||this.addTargetHandler(I)}},{key:"hasHandlers",value:function(){return this.handlers.size>0}},{key:"removeHandlers",value:function(p,I,N){if(this.pools.has(p)){var B=this.pools.get(p).removeHandlers(I,N);B.hasHandlers()?this.pools.set(p,B):this.pools.delete(p);var V=!1;this.pools.forEach(function(de){return V=V||de.hasHandlers(I)}),V||this.removeTargetHandler(I)}}},{key:"addTargetHandler",value:function(p){var I=this.createEmitter(p);this.handlers.set(p,I),this.target.addEventListener(p,I,!0)}},{key:"removeTargetHandler",value:function(p){this.handlers.has(p)&&(this.target.removeEventListener(p,this.handlers.get(p),!0),this.handlers.delete(p))}}]),E}(),S=function(){function E(){var p=this;n(this,E),a(this,"targets",new Map),a(this,"getTarget",function(I){var N=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],B=g(I);if(p.targets.has(B))return p.targets.get(B);if(!N)return null;var V=new b(B);return p.targets.set(B,V),V}),a(this,"removeTarget",function(I){p.targets.delete(g(I))})}return s(E,[{key:"sub",value:function(p,I){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t.canUseDOM){var B=N.target,V=B===void 0?document:B,de=N.pool,ve=de===void 0?"default":de;this.getTarget(V).addHandlers(ve,p,w(I))}}},{key:"unsub",value:function(p,I){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t.canUseDOM){var B=N.target,V=B===void 0?document:B,de=N.pool,ve=de===void 0?"default":de,j=this.getTarget(V,!1);j&&(j.removeHandlers(ve,p,w(I)),j.hasHandlers()||this.removeTarget(V))}}}]),E}(),A=new S,O=function(E){function p(){return n(this,p),h(this,c(p).apply(this,arguments))}return o(p,e.PureComponent),s(p,[{key:"componentDidMount",value:function(){this.subscribe(this.props)}},{key:"componentDidUpdate",value:function(I){this.unsubscribe(I),this.subscribe(this.props)}},{key:"componentWillUnmount",value:function(){this.unsubscribe(this.props)}},{key:"subscribe",value:function(I){var N=I.name,B=I.on,V=I.pool,de=I.target;A.sub(N,B,{pool:V,target:de})}},{key:"unsubscribe",value:function(I){var N=I.name,B=I.on,V=I.pool,de=I.target;A.unsub(N,B,{pool:V,target:de})}},{key:"render",value:function(){return null}}]),p}();return a(O,"defaultProps",{pool:"default",target:"document"}),O.propTypes={},ty.instance=A,ty.default=O,ty}var uF;function i4(){if(uF)return Zw.exports;uF=1;var t;return t=Kve(),Zw.exports=t.default,Zw.exports.instance=t.instance,Zw.exports}var lF;function Wve(){if(lF)return ey;lF=1,ey.__esModule=!0,ey.default=void 0;var t=i4(),e=t.instance;return ey.default=e,ey}var ts={},AT,fF;function Yve(){if(fF)return AT;fF=1;function t(){}return AT=t,AT}var ST,dF;function Qve(){if(dF)return ST;dF=1;var t=fJ(),e=Yve(),r=Y5(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(s){return new t(s)}:e;return ST=i,ST}var OT,hF;function Jve(){if(hF)return OT;hF=1;var t=k2(),e=J5(),r=X5(),n=$2(),i=Qve(),s=Y5(),a=200;function o(c,u,f){var h=-1,m=e,y=c.length,w=!0,v=[],g=v;if(f)w=!1,m=r;else if(y>=a){var _=u?null:i(c);if(_)return s(_);w=!1,m=n,g=new t}else g=u?[]:v;e:for(;++h<y;){var b=c[h],S=u?u(b):b;if(b=f||b!==0?b:0,w&&S===S){for(var A=g.length;A--;)if(g[A]===S)continue e;u&&g.push(S),v.push(b)}else m(g,S,f)||(g!==v&&g.push(S),v.push(b))}return v}return OT=o,OT}var IT,pF;function IJ(){if(pF)return IT;pF=1;var t=Jve();function e(r){return r&&r.length?t(r):[]}return IT=e,IT}var PT,gF;function Xve(){if(gF)return PT;gF=1;var t=_l(),e=Ac(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return PT=n,PT}var TT,mF;function PJ(){if(mF)return TT;mF=1;var t=_l(),e=Ri(),r=Ac(),n="[object String]";function i(s){return typeof s=="string"||!e(s)&&r(s)&&t(s)==n}return TT=i,TT}var CT,yF;function Zve(){if(yF)return CT;yF=1;var t=_l(),e=Ac(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return CT=n,CT}var vF;function ebe(){if(vF)return ts;vF=1;var t=Uo,e=vr;ts.__esModule=!0,ts.createShorthand=y,ts.createShorthandFactory=w,ts.createHTMLParagraph=ts.createHTMLLabel=ts.createHTMLInput=ts.createHTMLImage=ts.createHTMLIframe=ts.createHTMLDivision=void 0;var r=e(kn()),n=e(IJ()),i=e(Ri()),s=e(U2()),a=e(h2()),o=e(Xve()),c=e(PJ()),u=e(Zve()),f=e(xl()),h=e(ti),m=t(Ve);function y(O,E,p,I){if(I===void 0&&(I={}),typeof O!="function"&&typeof O!="string")throw new Error("createShorthand() Component must be a string or function.");if((0,f.default)(p)||(0,u.default)(p))return null;var N=(0,c.default)(p),B=(0,o.default)(p),V=(0,a.default)(p),de=m.isValidElement(p),ve=(0,s.default)(p),j=N||B||(0,i.default)(p);if(!V&&!de&&!ve&&!j)return null;var L=I,Y=L.defaultProps,ne=Y===void 0?{}:Y,U=de&&p.props||ve&&p||j&&E(p),F=I,H=F.overrideProps,M=H===void 0?{}:H;M=(0,a.default)(M)?M((0,r.default)({},ne,U)):M;var q=(0,r.default)({},ne,U,M);if(ne.className||M.className||U.className){var $=(0,h.default)(ne.className,M.className,U.className);q.className=(0,n.default)($.split(" ")).join(" ")}if((ne.style||M.style||U.style)&&(q.style=(0,r.default)({},ne.style,U.style,M.style)),(0,f.default)(q.key)){var k=q.childKey,G=I,pe=G.autoGenerateKey,Q=pe===void 0?!0:pe;(0,f.default)(k)?Q&&(N||B)&&(q.key=p):(q.key=typeof k=="function"?k(q):k,delete q.childKey)}if(de)return m.cloneElement(p,q);if(typeof q.children=="function")return q.children(O,(0,r.default)({},q,{children:void 0}));if(j||ve)return m.createElement(O,q);if(V)return p(O,q,q.children)}function w(O,E){if(typeof O!="function"&&typeof O!="string")throw new Error("createShorthandFactory() Component must be a string or function.");return function(p,I){return y(O,E,p,I)}}var v=w("div",function(O){return{children:O}});ts.createHTMLDivision=v;var g=w("iframe",function(O){return{src:O}});ts.createHTMLIframe=g;var _=w("img",function(O){return{src:O}});ts.createHTMLImage=_;var b=w("input",function(O){return{type:O}});ts.createHTMLInput=b;var S=w("label",function(O){return{children:O}});ts.createHTMLLabel=S;var A=w("p",function(O){return{children:O}});return ts.createHTMLParagraph=A,ts}var ry={},bF;function tbe(){if(bF)return ry;bF=1,ry.__esModule=!0,ry.default=void 0;var t=function(n,i){var s=n.handledProps,a=s===void 0?[]:s;return Object.keys(i).reduce(function(o,c){return c==="childKey"||a.indexOf(c)===-1&&(o[c]=i[c]),o},{})},e=t;return ry.default=e,ry}var ny={},wF;function rbe(){if(wF)return ny;wF=1,ny.__esModule=!0,ny.default=void 0;function t(r,n,i){var s=r.defaultProps,a=s===void 0?{}:s;if(n.as&&n.as!==a.as)return n.as;if(i){var o=i();if(o)return o}return n.href?"a":a.as||"div"}var e=t;return ny.default=e,ny}var Ma={},RT,_F;function nbe(){if(_F)return RT;_F=1;var t=Kh();function e(r,n){return t(n,function(i){return r[i]})}return RT=e,RT}var NT,EF;function TJ(){if(EF)return NT;EF=1;var t=nbe(),e=Al();function r(n){return n==null?[]:t(n,e(n))}return NT=r,NT}var DT,xF;function s4(){if(xF)return DT;xF=1;var t=L2(),e=Jf(),r=PJ(),n=T2(),i=TJ(),s=Math.max;function a(o,c,u,f){o=e(o)?o:i(o),u=u&&!f?n(u):0;var h=o.length;return u<0&&(u=s(h+u,0)),r(o)?u<=h&&o.indexOf(c,u)>-1:!!h&&t(o,c,u)>-1}return DT=a,DT}var AF;function ibe(){if(AF)return Ma;AF=1;var t=vr;Ma.__esModule=!0,Ma.partitionHTMLProps=Ma.htmlImageProps=Ma.htmlInputProps=Ma.htmlInputEvents=Ma.htmlInputAttrs=void 0;var e=t(s4()),r=t(_J()),n=["selected","defaultValue","defaultChecked","accept","autoCapitalize","autoComplete","autoCorrect","autoFocus","checked","disabled","enterKeyHint","form","id","inputMode","lang","list","max","maxLength","min","minLength","multiple","name","pattern","placeholder","readOnly","required","step","title","type","value"];Ma.htmlInputAttrs=n;var i=["onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onClick","onContextMenu","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"];Ma.htmlInputEvents=i;var s=[].concat(n,i);Ma.htmlInputProps=s;var a=["alt","height","src","srcSet","width","loading"];Ma.htmlImageProps=a;var o=function(u,f){f===void 0&&(f={});var h=f,m=h.htmlProps,y=m===void 0?s:m,w=h.includeAria,v=w===void 0?!0:w,g={},_={};return(0,r.default)(u,function(b,S){var A=v&&(/^aria-.*$/.test(S)||S==="role"),O=(0,e.default)(y,S)||A?g:_;O[S]=b}),[g,_]};return Ma.partitionHTMLProps=o,Ma}var iy={},SF;function CJ(){if(SF)return iy;SF=1;var t=vr;iy.__esModule=!0,iy.default=void 0;var e=t(xl()),r=typeof document=="object"&&document!==null,n=typeof window=="object"&&window!==null&&window.self===window,i=function a(){return(0,e.default)(a.override)?r&&n:a.override},s=i;return iy.default=s,iy}var sy={},MT,OF;function sbe(){if(OF)return MT;OF=1;var t=Math.max,e=Math.min;function r(n,i,s){return n>=e(i,s)&&n<t(i,s)}return MT=r,MT}var kT,IF;function abe(){if(IF)return kT;IF=1;var t=sbe(),e=G5(),r=rJ();function n(i,s,a){return s=e(s),a===void 0?(a=s,s=0):a=e(a),i=r(i),t(i,s,a)}return kT=n,kT}var $T,PF;function obe(){if(PF)return $T;PF=1;function t(e){return e&&e.length?e[0]:void 0}return $T=t,$T}var LT,TF;function cbe(){return TF||(TF=1,LT=obe()),LT}var CF;function ube(){if(CF)return sy;CF=1;var t=vr;sy.__esModule=!0,sy.default=void 0;var e=t(abe()),r=t(cbe()),n=t(jo()),i=t(xl()),s=t(EJ()),a=function(u,f){if((0,s.default)([f,u],i.default))return!1;if(f.target&&((0,n.default)(f.target,"setAttribute","data-suir-click-target",!0),document.querySelector("[data-suir-click-target=true]")))return(0,n.default)(f.target,"removeAttribute","data-suir-click-target"),u.contains(f.target);var h=f.clientX,m=f.clientY;if((0,s.default)([h,m],i.default))return!1;var y=u.getClientRects();if(!u.offsetWidth||!u.offsetHeight||!y||!y.length)return!1;var w=(0,r.default)(y),v=w.top,g=w.bottom,_=w.left,b=w.right;return(0,s.default)([v,g,_,b],i.default)?!1:(0,e.default)(m,v,g+.001)&&(0,e.default)(h,_,b+.001)},o=a;return sy.default=o,sy}var e_={},ay={},Bs={},RF;function RJ(){if(RF)return Bs;RF=1,Bs.__esModule=!0,Bs.createLastItem=Bs.createNextItem=Bs.createPageFactory=Bs.createPrevItem=Bs.createFirstPage=Bs.createEllipsisItem=void 0;var t=function(o){return{active:!1,type:"ellipsisItem",value:o}};Bs.createEllipsisItem=t;var e=function(){return{active:!1,type:"firstItem",value:1}};Bs.createFirstPage=e;var r=function(o){return{active:!1,type:"prevItem",value:Math.max(1,o-1)}};Bs.createPrevItem=r;var n=function(o){return function(c){return{active:o===c,type:"pageItem",value:c}}};Bs.createPageFactory=n;var i=function(o,c){return{active:!1,type:"nextItem",value:Math.min(o+1,c)}};Bs.createNextItem=i;var s=function(o){return{active:!1,type:"lastItem",value:o}};return Bs.createLastItem=s,Bs}var xd={},UT,NF;function lbe(){if(NF)return UT;NF=1;var t=Math.ceil,e=Math.max;function r(n,i,s,a){for(var o=-1,c=e(t((i-n)/(s||1)),0),u=Array(c);c--;)u[a?c:++o]=n,n+=s;return u}return UT=r,UT}var jT,DF;function fbe(){if(DF)return jT;DF=1;var t=lbe(),e=e4(),r=G5();function n(i){return function(s,a,o){return o&&typeof o!="number"&&e(s,a,o)&&(a=o=void 0),s=r(s),a===void 0?(a=s,s=0):a=r(a),o=o===void 0?s<a?1:-1:r(o),t(s,a,o,i)}}return jT=n,jT}var BT,MF;function dbe(){if(MF)return BT;MF=1;var t=fbe(),e=t();return BT=e,BT}var Ad={},kF;function hbe(){if(kF)return Ad;kF=1,Ad.__esModule=!0,Ad.createInnerSuffix=Ad.createInnerPrefix=void 0;var t=RJ(),e=function(i,s,a){var o=s-1,c=o!==i+1,u=c?t.createEllipsisItem:a;return u(o)};Ad.createInnerPrefix=e;var r=function(i,s,a){var o=i+1,c=o!==s-1,u=c?t.createEllipsisItem:a;return u(o)};return Ad.createInnerSuffix=r,Ad}var $F;function pbe(){if($F)return xd;$F=1;var t=vr;xd.__esModule=!0,xd.createComplexRange=xd.createSimpleRange=void 0;var e=t(dbe()),r=t(j2()),n=hbe(),i=function(o,c,u){return(0,r.default)((0,e.default)(o,c+1),u)};xd.createSimpleRange=i;var s=function(o,c){var u=o.activePage,f=o.boundaryRange,h=o.hideEllipsis,m=o.siblingRange,y=o.totalPages,w=h?0:1,v=f,g=i(1,v,c),_=y+1-f,b=i(_,y,c),S=Math.min(Math.max(u-m,v+w+1),_-w-2*m-1),A=S+2*m,O=i(S,A,c);return[].concat(g,[!h&&(0,n.createInnerPrefix)(v,S,c)],O,[!h&&(0,n.createInnerSuffix)(A,_,c)],b).filter(Boolean)};return xd.createComplexRange=s,xd}var Sd={},LF;function gbe(){if(LF)return Sd;LF=1,Sd.__esModule=!0,Sd.typifyOptions=Sd.isSimplePagination=void 0;var t=function(n){var i=n.boundaryRange,s=n.hideEllipsis,a=n.siblingRange,o=n.totalPages,c=2*i,u=s?0:2,f=2*a;return 1+u+f+c>=o};Sd.isSimplePagination=t;var e=function(n){var i=n.activePage,s=n.boundaryRange,a=n.hideEllipsis,o=n.siblingRange,c=n.totalPages;return{activePage:+i,boundaryRange:+s,hideEllipsis:!!a,siblingRange:+o,totalPages:+c}};return Sd.typifyOptions=e,Sd}var UF;function mbe(){if(UF)return ay;UF=1,ay.__esModule=!0,ay.default=void 0;var t=RJ(),e=pbe(),r=gbe(),n=function(a){var o=(0,r.typifyOptions)(a),c=o.activePage,u=o.totalPages,f=(0,t.createPageFactory)(c),h=(0,r.isSimplePagination)(o)?(0,e.createSimpleRange)(1,u,f):(0,e.createComplexRange)(o,f);return[(0,t.createFirstPage)(),(0,t.createPrevItem)(c)].concat(h,[(0,t.createNextItem)(c,u),(0,t.createLastItem)(u)])},i=n;return ay.default=i,ay}var jF;function ybe(){if(jF)return e_;jF=1;var t=vr;e_.__esModule=!0;var e=t(mbe());return e_.default=e.default,e_}var mt={},BF;function vbe(){if(BF)return mt;BF=1;var t=vr;mt.__esModule=!0,mt.ALL_ICONS_IN_ALL_CONTEXTS=mt.COMPONENT_CONTEXT_SPECIFIC_ICONS=mt.ICONS_AND_ALIASES=mt.ICON_ALIASES=mt.ICONS=mt.BRANDS=mt.WRITING=mt.VEHICLES=mt.USERS_PEOPLE=mt.STATUS=mt.SPORTS=mt.SPINNERS=mt.SHAPES=mt.PAYMENTS_SHOPPING=mt.OBJECTS=mt.MEDICAL=mt.MAPS=mt.LOGISTICS=mt.INTERFACES=mt.IMAGES=mt.HEALTH=mt.HANDS_GESTURES=mt.GENDERS=mt.FILES=mt.EDITORS=mt.DESIGN=mt.DATE_TIME=mt.CURRENCY=mt.COMPUTERS=mt.COMMUNICATION=mt.CODE=mt.CHESS=mt.BUSINESS=mt.AUDIO_VIDEO=mt.ARROWS=mt.ACCESSIBILITY=mt.TRANSITIONS=mt.STATIC_TRANSITIONS=mt.DIRECTIONAL_TRANSITIONS=mt.WIDTHS=mt.VISIBILITY=mt.VERTICAL_ALIGNMENTS=mt.TEXT_ALIGNMENTS=mt.SIZES=mt.FLOATS=mt.COLORS=void 0;var e=t(IJ()),r=t(TJ()),n=t(Al()),i=t4(),s=["red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","black"];mt.COLORS=s;var a=["left","right"];mt.FLOATS=a;var o=["mini","tiny","small","medium","large","big","huge","massive"];mt.SIZES=o;var c=["left","center","right","justified"];mt.TEXT_ALIGNMENTS=c;var u=["bottom","middle","top"];mt.VERTICAL_ALIGNMENTS=u;var f=["mobile","tablet","computer","large screen","widescreen"];mt.VISIBILITY=f;var h=[].concat((0,n.default)(i.numberToWordMap),(0,n.default)(i.numberToWordMap).map(Number),(0,r.default)(i.numberToWordMap));mt.WIDTHS=h;var m=["browse","browse right","drop","fade","fade up","fade down","fade left","fade right","fly up","fly down","fly left","fly right","horizontal flip","vertical flip","scale","slide up","slide down","slide left","slide right","swing up","swing down","swing left","swing right","zoom"];mt.DIRECTIONAL_TRANSITIONS=m;var y=["jiggle","flash","shake","pulse","tada","bounce","glow"];mt.STATIC_TRANSITIONS=y;var w=[].concat(m,y);mt.TRANSITIONS=w;var v=["american sign language interpreting","assistive listening systems","audio description","blind","braille","closed captioning","closed captioning outline","deaf","low vision","phone volume","question circle","question circle outline","sign language","tty","universal access","wheelchair"];mt.ACCESSIBILITY=v;var g=["angle double down","angle double left","angle double right","angle double up","angle down","angle left","angle right","angle up","arrow alternate circle down","arrow alternate circle down outline","arrow alternate circle left","arrow alternate circle left outline","arrow alternate circle right","arrow alternate circle right outline","arrow alternate circle up","arrow alternate circle up outline","arrow circle down","arrow circle left","arrow circle right","arrow circle up","arrow down","arrow left","arrow right","arrow up","arrows alternate","arrows alternate horizontal","arrows alternate vertical","caret down","caret left","caret right","caret square down","caret square down outline","caret square left","caret square left outline","caret square right","caret square right outline","caret square up","caret square up outline","caret up","cart arrow down","chart line","chevron circle down","chevron circle left","chevron circle right","chevron circle up","chevron down","chevron left","chevron right","chevron up","cloud download","cloud upload","download","exchange","expand arrows alternate","external alternate","external square alternate","hand point down","hand point down outline","hand point left","hand point left outline","hand point right","hand point right outline","hand point up","hand point up outline","hand pointer","hand pointer outline","history","level down alternate","level up alternate","location arrow","long arrow alternate down","long arrow alternate left","long arrow alternate right","long arrow alternate up","mouse pointer","play","random","recycle","redo","redo alternate","reply","reply all","retweet","share","share square","share square outline","sign-in","sign-out","sign-in alternate","sign-out alternate","sort","sort alphabet down","sort alphabet up","sort amount down","sort amount up","sort down","sort numeric down","sort numeric up","sort up","sync","sync alternate","text height","text width","undo","undo alternate","upload","zoom-in","zoom-out"];mt.ARROWS=g;var _=["audio description","backward","circle","circle outline","closed captioning","closed captioning outline","compress","eject","expand","expand arrows alternate","fast backward","fast forward","file audio","file audio outline","file video","file video outline","film","forward","headphones","microphone","microphone slash","music","pause","pause circle","pause circle outline","phone volume","play","play circle","play circle outline","podcast","random","redo","redo alternate","rss","rss square","step backward","step forward","stop","stop circle","stop circle outline","sync","sync alternate","undo","undo alternate","video","volume down","volume off","volume up"];mt.AUDIO_VIDEO=_;var b=["address book","address book outline","address card","address card outline","archive","balance scale","birthday cake","book","briefcase","building","building outline","bullhorn","bullseye","calculator","calendar","calendar outline","calendar alternate","calendar alternate outline","certificate","chart area","chart bar","chart bar outline","chart line","chart pie","clipboard","clipboard outline","coffee","columns","compass","compass outline","copy","copy outline","copyright","copyright outline","cut","edit","edit outline","envelope","envelope outline","envelope open","envelope open outline","envelope square","eraser","fax","file","file outline","file alternate","file alternate outline","folder","folder outline","folder open","folder open outline","globe","industry","paperclip","paste","pen square","pencil alternate","percent","phone","phone square","phone volume","registered","registered outline","save","save outline","sitemap","sticky note","sticky note outline","suitcase","table","tag","tags","tasks","thumbtack","trademark"];mt.BUSINESS=b;var S=["chess","chess bishop","chess board","chess king","chess knight","chess pawn","chess queen","chess rook","square full"];mt.CHESS=S;var A=["archive","barcode","bath","bug","code","code branch","coffee","file","file outline","file alternate","file alternate outline","file code","file code outline","filter","fire extinguisher","folder","folder outline","folder open","folder open outline","keyboard","keyboard outline","microchip","qrcode","shield alternate","sitemap","terminal","user secret","window close","window close outline","window maximize","window maximize outline","window minimize","window minimize outline","window restore","window restore outline"];mt.CODE=A;var O=["address book","address book outline","address card","address card outline","american sign language interpreting","assistive listening systems","at","bell","bell outline","bell slash","bell slash outline","bullhorn","comment","comment outline","comment alternate","comment alternate outline","comments","comments outline","envelope","envelope outline","envelope open","envelope open outline","envelope square","fax","inbox","language","microphone","microphone slash","mobile","mobile alternate","paper plane","paper plane outline","phone","phone square","phone volume","rss","rss square","tty","wifi"];mt.COMMUNICATION=O;var E=["desktop","download","hdd","hdd outline","headphones","keyboard","keyboard outline","laptop","microchip","mobile","mobile alternate","plug","power off","print","save","save outline","server","tablet","tablet alternate","tv","upload"];mt.COMPUTERS=E;var p=["dollar sign","euro sign","lira sign","money bill alternate","money bill alternate outline","pound sign","ruble sign","rupee sign","shekel sign","won sign","yen sign"];mt.CURRENCY=p;var I=["bell","bell outline","bell slash","bell slash outline","calendar","calendar outline","calendar alternate","calendar alternate outline","calendar check","calendar check outline","calendar minus","calendar minus outline","calendar plus","calendar plus outline","calendar times","calendar times outline","clock","clock outline","hourglass","hourglass outline","hourglass end","hourglass half","hourglass start","stopwatch"];mt.DATE_TIME=I;var N=["adjust","clone","clone outline","copy","copy outline","crop","crosshairs","cut","edit","edit outline","eraser","eye","eye dropper","eye slash","eye slash outline","object group","object group outline","object ungroup","object ungroup outline","paint brush","paste","pencil alternate","save","save outline","tint"];mt.DESIGN=N;var B=["align center","align justify","align left","align right","bold","clipboard","clipboard outline","clone","clone outline","columns","copy","copy outline","cut","edit","edit outline","eraser","file","file outline","file alternate","file alternate outline","font","heading","i cursor","indent","italic","linkify","list","list alternate","list alternate outline","list ol","list ul","outdent","paper plane","paper plane outline","paperclip","paragraph","paste","pencil alternate","print","quote left","quote right","redo","redo alternate","reply","reply all","share","strikethrough","subscript","superscript","sync","sync alternate","table","tasks","text height","text width","th","th large","th list","trash","trash alternate","trash alternate outline","underline","undo","undo alternate","unlink"];mt.EDITORS=B;var V=["archive","clone","clone outline","copy","copy outline","cut","file","file outline","file alternate","file alternate outline","file archive","file archive outline","file audio","file audio outline","file code","file code outline","file excel","file excel outline","file image","file image outline","file pdf","file pdf outline","file powerpoint","file powerpoint outline","file video","file video outline","file word","file word outline","folder","folder outline","folder open","folder open outline","paste","save","save outline","sticky note","sticky note outline"];mt.FILES=V;var de=["genderless","mars","mars double","mars stroke","mars stroke horizontal","mars stroke vertical","mercury","neuter","transgender","transgender alternate","venus","venus double","venus mars"];mt.GENDERS=de;var ve=["hand lizard","hand lizard outline","hand paper","hand paper outline","hand peace","hand peace outline","hand point down","hand point down outline","hand point left","hand point left outline","hand point right","hand point right outline","hand point up","hand point up outline","hand pointer","hand pointer outline","hand rock","hand rock outline","hand scissors","hand scissors outline","hand spock","hand spock outline","handshake","handshake outline","thumbs down","thumbs down outline","thumbs up","thumbs up outline"];mt.HANDS_GESTURES=ve;var j=["ambulance","h square","heart","heart outline","heartbeat","hospital","hospital outline","medkit","plus square","plus square outline","stethoscope","user md","wheelchair"];mt.HEALTH=j;var L=["adjust","bolt","camera","camera retro","clone","clone outline","compress","expand","eye","eye dropper","eye slash","eye slash outline","file image","file image outline","film","id badge","id badge outline","id card","id card outline","image","image outline","images","images outline","sliders horizontal","tint"];mt.IMAGES=L;var Y=["ban","barcode","bars","beer","bell","bell outline","bell slash","bell slash outline","bug","bullhorn","bullseye","calculator","calendar","calendar outline","calendar alternate","calendar alternate outline","calendar check","calendar check outline","calendar minus","calendar minus outline","calendar plus","calendar plus outline","calendar times","calendar times outline","certificate","check","check circle","check circle outline","check square","check square outline","circle","circle outline","clipboard","clipboard outline","clone","clone outline","cloud","cloud download","cloud upload","coffee","cog","cogs","copy","copy outline","cut","database","dot circle","dot circle outline","download","edit","edit outline","ellipsis horizontal","ellipsis vertical","envelope","envelope outline","envelope open","envelope open outline","eraser","exclamation","exclamation circle","exclamation triangle","external alternate","external square alternate","eye","eye slash","eye slash outline","file","file outline","file alternate","file alternate outline","filter","flag","flag outline","flag checkered","folder","folder outline","folder open","folder open outline","frown","frown outline","hashtag","heart","heart outline","history","home","i cursor","info","info circle","language","magic","meh","meh outline","microphone","microphone slash","minus","minus circle","minus square","minus square outline","paste","pencil alternate","plus","plus circle","plus square","plus square outline","qrcode","question","question circle","question circle outline","quote left","quote right","redo","redo alternate","reply","reply all","rss","rss square","save","save outline","search","search minus","search plus","share","share alternate","share alternate square","share square","share square outline","shield alternate","sign-in","sign-out","signal","sitemap","sliders horizontal","smile","smile outline","sort","sort alphabet down","sort alphabet up","sort amount down","sort amount up","sort down","sort numeric down","sort numeric up","sort up","star","star outline","star half","star half outline","sync","sync alternate","thumbs down","thumbs down outline","thumbs up","thumbs up outline","times","times circle","times circle outline","toggle off","toggle on","trash","trash alternate","trash alternate outline","trophy","undo","undo alternate","upload","user","user outline","user circle","user circle outline","wifi"];mt.INTERFACES=Y;var ne=["box","boxes","clipboard check","clipboard list","dolly","dolly flatbed","pallet","shipping fast","truck","warehouse"];mt.LOGISTICS=ne;var U=["ambulance","anchor","balance scale","bath","bed","beer","bell","bell outline","bell slash","bell slash outline","bicycle","binoculars","birthday cake","blind","bomb","book","bookmark","bookmark outline","briefcase","building","building outline","car","coffee","crosshairs","dollar sign","eye","eye slash","eye slash outline","fighter jet","fire","fire extinguisher","flag","flag outline","flag checkered","flask","gamepad","gavel","gift","glass martini","globe","graduation cap","h square","heart","heart outline","heartbeat","home","hospital","hospital outline","image","image outline","images","images outline","industry","info","info circle","key","leaf","lemon","lemon outline","life ring","life ring outline","lightbulb","lightbulb outline","location arrow","low vision","magnet","male","map","map outline","map marker","map marker alternate","map pin","map signs","medkit","money bill alternate","money bill alternate outline","motorcycle","music","newspaper","newspaper outline","paw","phone","phone square","phone volume","plane","plug","plus","plus square","plus square outline","print","recycle","road","rocket","search","search minus","search plus","ship","shopping bag","shopping basket","shopping cart","shower","street view","subway","suitcase","tag","tags","taxi","thumbtack","ticket alternate","tint","train","tree","trophy","truck","tty","umbrella","university","utensil spoon","utensils","wheelchair","wifi","wrench"];mt.MAPS=U;var F=["ambulance","band aid","dna","first aid","heart","heart outline","heartbeat","hospital","hospital outline","hospital symbol","pills","plus","stethoscope","syringe","thermometer","user md","weight"];mt.MEDICAL=F;var H=["ambulance","anchor","archive","balance scale","bath","bed","beer","bell","bell outline","bicycle","binoculars","birthday cake","bomb","book","bookmark","bookmark outline","briefcase","bug","building","building outline","bullhorn","bullseye","bus","calculator","calendar","calendar outline","calendar alternate","calendar alternate outline","camera","camera retro","car","clipboard","clipboard outline","cloud","coffee","cog","cogs","compass","compass outline","copy","copy outline","cube","cubes","cut","envelope","envelope outline","envelope open","envelope open outline","eraser","eye","eye dropper","fax","fighter jet","file","file outline","file alternate","file alternate outline","film","fire","fire extinguisher","flag","flag outline","flag checkered","flask","futbol","futbol outline","gamepad","gavel","gem","gem outline","gift","glass martini","globe","graduation cap","hdd","hdd outline","headphones","heart","heart outline","home","hospital","hospital outline","hourglass","hourglass outline","image","image outline","images","images outline","industry","key","keyboard","keyboard outline","laptop","leaf","lemon","lemon outline","life ring","life ring outline","lightbulb","lightbulb outline","lock","lock open","magic","magnet","map","map outline","map marker","map marker alternate","map pin","map signs","medkit","microchip","microphone","mobile","mobile alternate","money bill alternate","money bill alternate outline","moon","moon outline","motorcycle","newspaper","newspaper outline","paint brush","paper plane","paper plane outline","paperclip","paste","paw","pencil alternate","phone","plane","plug","print","puzzle piece","road","rocket","save","save outline","search","shield alternate","shopping bag","shopping basket","shopping cart","shower","snowflake","snowflake outline","space shuttle","star","star outline","sticky note","sticky note outline","stopwatch","subway","suitcase","sun","sun outline","tablet","tablet alternate","tachometer alternate","tag","tags","taxi","thumbtack","ticket alternate","train","trash","trash alternate","trash alternate outline","tree","trophy","truck","tv","umbrella","university","unlock","unlock alternate","utensil spoon","utensils","wheelchair","wrench"];mt.OBJECTS=H;var M=["bell","bell outline","bookmark","bookmark outline","bullhorn","camera","camera retro","cart arrow down","cart plus","certificate","credit card","credit card outline","gem","gem outline","gift","handshake","handshake outline","heart","heart outline","key","shopping bag","shopping basket","shopping cart","star","star outline","tag","tags","thumbs down","thumbs down outline","thumbs up","thumbs up outline","trophy"];mt.PAYMENTS_SHOPPING=M;var q=["bookmark","bookmark outline","calendar","calendar outline","certificate","circle","circle outline","cloud","comment","comment outline","file","file outline","folder","folder outline","heart","heart outline","map marker","play","square","square outline","star","star outline"];mt.SHAPES=q;var $=["asterisk","certificate","circle notch","cog","compass","compass outline","crosshairs","life ring","life ring outline","snowflake","snowflake outline","spinner","sun","sun outline","sync"];mt.SPINNERS=$;var k=["baseball ball","basketball ball","bowling ball","football ball","futbol","futbol outline","golf ball","hockey puck","quidditch","table tennis","volleyball ball"];mt.SPORTS=k;var G=["ban","battery empty","battery full","battery half","battery quarter","battery three quarters","bell","bell outline","bell slash","bell slash outline","calendar","calendar outline","calendar alternate","calendar alternate outline","calendar check","calendar check outline","calendar minus","calendar minus outline","calendar plus","calendar plus outline","calendar times","calendar times outline","cart arrow down","cart plus","exclamation","exclamation circle","exclamation triangle","eye","eye slash","eye slash outline","file","file outline","file alternate","file alternate outline","folder","folder outline","folder open","folder open outline","info","info circle","lock","lock open","minus","minus circle","minus square","minus square outline","plus","plus circle","plus square","plus square outline","question","question circle","question circle outline","shield alternate","shopping cart","sign in alternate","sign out alternate","thermometer empty","thermometer full","thermometer half","thermometer quarter","thermometer three quarters","thumbs down","thumbs down outline","thumbs up","thumbs up outline","toggle off","toggle on","unlock","unlock alternate"];mt.STATUS=G;var pe=["address book","address book outline","address card","address card outline","bed","blind","child","female","frown","frown outline","id badge","id badge outline","id card","id card outline","male","meh","meh outline","power off","smile","smile outline","street view","user","user outline","user circle","user circle outline","user md","user plus","user secret","user times","users","wheelchair"];mt.USERS_PEOPLE=pe;var Q=["ambulance","bicycle","bus","car","fighter jet","motorcycle","paper plane","paper plane outline","plane","rocket","ship","shopping cart","space shuttle","subway","taxi","train","truck","wheelchair"];mt.VEHICLES=Q;var te=["archive","book","bookmark","bookmark outline","edit","edit outline","envelope","envelope outline","envelope open","envelope open outline","eraser","file","file outline","file alternate","file alternate outline","folder","folder outline","folder open","folder open outline","keyboard","keyboard outline","newspaper","newspaper outline","paper plane","paper plane outline","paperclip","paragraph","pen square","pencil alternate","quote left","quote right","sticky note","sticky note outline","thumbtack"];mt.WRITING=te;var ce=["500px","accessible","accusoft","adn","adversal","affiliatetheme","algolia","amazon","amazon pay","amilia","android","angellist","angrycreative","angular","app store","app store ios","apper","apple","apple pay","asymmetrik","audible","autoprefixer","avianex","aviato","aws","bandcamp","behance","behance square","bimobject","bitbucket","bitcoin","bity","black tie","blackberry","blogger","blogger b","bluetooth","bluetooth b","btc","buromobelexperte","buysellads","cc amazon pay","cc amex","cc apple pay","cc diners club","cc discover","cc jcb","cc mastercard","cc paypal","cc stripe","cc visa","centercode","chrome","cloudscale","cloudsmith","cloudversify","codepen","codiepie","connectdevelop","contao","cpanel","creative commons","css3","css3 alternate","cuttlefish","d and d","dashcube","delicious","deploydog","deskpro","deviantart","digg","digital ocean","discord","discourse","dochub","docker","draft2digital","dribbble","dribbble square","dropbox","drupal","dyalog","earlybirds","edge","elementor","ember","empire","envira","erlang","ethereum","etsy","expeditedssl","facebook","facebook f","facebook messenger","facebook square","firefox","first order","firstdraft","flickr","flipboard","fly","font awesome","font awesome alternate","font awesome flag","fonticons","fonticons fi","fort awesome","fort awesome alternate","forumbee","foursquare","free code camp","freebsd","get pocket","gg","gg circle","git","git square","github","github alternate","github square","gitkraken","gitlab","gitter","glide","glide g","gofore","goodreads","goodreads g","google","google drive","google play","google plus","google plus g","google plus square","google wallet","gratipay","grav","gripfire","grunt","gulp","hacker news","hacker news square","hips","hire a helper","hooli","hotjar","houzz","html5","hubspot","imdb","instagram","internet explorer","ioxhost","itunes","itunes note","jenkins","joget","joomla","js","js square","jsfiddle","keycdn","kickstarter","kickstarter k","korvue","laravel","lastfm","lastfm square","leanpub","less","linechat","linkedin","linkedin alternate","linode","linux","lyft","magento","maxcdn","medapps","medium","medium m","medrt","meetup","microsoft","mix","mixcloud","mizuni","modx","monero","napster","nintendo switch","node","node js","npm","ns8","nutritionix","odnoklassniki","odnoklassniki square","opencart","openid","opera","optin monster","osi","page4","pagelines","palfed","patreon","paypal","periscope","phabricator","phoenix framework","php","pied piper","pied piper alternate","pied piper pp","pinterest","pinterest p","pinterest square","playstation","product hunt","pushed","python","qq","quinscape","quora","ravelry","react","rebel","redriver","reddit","reddit alien","reddit square","rendact","renren","replyd","resolving","rocketchat","rockrms","safari","sass","schlix","scribd","searchengin","sellcast","sellsy","servicestack","shirtsinbulk","simplybuilt","sistrix","skyatlas","skype","slack","slack hash","slideshare","snapchat","snapchat ghost","snapchat square","soundcloud","speakap","spotify","stack exchange","stack overflow","staylinked","steam","steam square","steam symbol","sticker mule","strava","stripe","stripe s","studiovinari","stumbleupon","stumbleupon circle","superpowers","supple","telegram","telegram plane","tencent weibo","themeisle","trello","tripadvisor","tumblr","tumblr square","twitch","twitter","twitter square","typo3","uber","uikit","uniregistry","untappd","usb","ussunnah","vaadin","viacoin","viadeo","viadeo square","viber","vimeo","vimeo square","vimeo v","vine","vk","vnv","vuejs","wechat","weibo","weixin","whatsapp","whatsapp square","whmcs","wikipedia w","windows","wordpress","wordpress simple","wpbeginner","wpexplorer","wpforms","xbox","xing","xing square","y combinator","yahoo","yandex","yandex international","yelp","yoast","youtube","youtube square"];mt.BRANDS=ce;var T=(0,e.default)([].concat(v,g,_,b,S,A,O,E,p,I,N,B,V,de,ve,j,L,Y,ne,U,F,H,M,q,$,k,G,pe,Q,te,ce));mt.ICONS=T;var le=["chess rock","ordered list","unordered list","user doctor","shield","puzzle","add circle","add square","add to calendar","add to cart","add user","add","alarm mute","alarm","ald","als","announcement","area chart","area graph","arrow down cart","asexual","asl interpreting","asl","assistive listening devices","attach","attention","balance","bar","bathtub","battery four","battery high","battery low","battery one","battery three","battery two","battery zero","birthday","block layout","bluetooth alternative","broken chain","browser","call square","call","cancel","cart","cc","chain","chat","checked calendar","checkmark","circle notched","close","cny","cocktail","commenting","computer","configure","content","deafness","delete calendar","delete","detective","discussions","doctor","dollar","dont","drivers license","dropdown","emergency","envira gallery","erase","eur","euro","eyedropper","factory","favorite","feed","female homosexual","file text","file text outline","find","first aid","fork","game","gay","gbp","google plus circle","google plus official","grab","graduation","grid layout","group","h","hand victory","handicap","hard of hearing","header","help circle","help","heterosexual","hide","hotel","hourglass four","hourglass full","hourglass one","hourglass three","hourglass two","idea","ils","in cart","inr","intergender","intersex","jpy","krw","lab","law","legal","lesbian","lightning","like","line graph","linkedin square","linkify","lira","list layout","magnify","mail forward","mail outline","mail square","mail","male homosexual","man","marker","mars alternate","mars horizontal","mars vertical","microsoft edge","military","ms edge","mute","new pied piper","non binary transgender","numbered list","options","other gender horizontal","other gender vertical","other gender","payment","paypal card","pencil square","photo","picture","pie chart","pie graph","pied piper hat","pin","plus cart","point","pointing down","pointing left","pointing right","pointing up","pound","power cord","power","privacy","r circle","rain","record","refresh","remove circle","remove from calendar","remove user","remove","repeat","rmb","rouble","rub","ruble","rupee","s15","selected radio","send","setting","settings","shekel","sheqel","shipping","shop","shuffle","shutdown","sidebar","signing","signup","sliders","soccer","sort alphabet ascending","sort alphabet descending","sort ascending","sort content ascending","sort content descending","sort descending","sort numeric ascending","sort numeric descending","sound","spy","stripe card","student","talk","target","teletype","television","text cursor","text telephone","theme","thermometer","thumb tack","time","tm","toggle down","toggle left","toggle right","toggle up","translate","travel","treatment","triangle down","triangle left","triangle right","triangle up","try","unhide","unlinkify","unmute","usd","user cancel","user close","user delete","user x","vcard","video camera","video play","volume control phone","wait","warning circle","warning sign","warning","wi-fi","winner","wizard","woman","won","wordpress beginner","wordpress forms","world","write square","x","yen","zip","zoom in","zoom out","zoom","bitbucket square","checkmark box","circle thin","cloud download","cloud upload","compose","conversation","credit card alternative","currency","dashboard","diamond","disk","exchange","external share","external square","external","facebook official","food","hourglass zero","level down","level up","log out","meanpath","money","move","pencil","protect","radio","remove bookmark","resize horizontal","resize vertical","sign in","sign out","spoon","star half empty","star half full","ticket","times rectangle","write","youtube play"];mt.ICON_ALIASES=le;var Ge=(0,e.default)([].concat(T,le));mt.ICONS_AND_ALIASES=Ge;var tt=["left dropdown"];mt.COMPONENT_CONTEXT_SPECIFIC_ICONS=tt;var yt=(0,e.default)([].concat(Ge,tt));return mt.ALL_ICONS_IN_ALL_CONTEXTS=yt,mt}var oy={},FF;function bbe(){if(FF)return oy;FF=1,oy.__esModule=!0,oy.default=void 0;var t=function(r){return typeof r=="number"||typeof r=="string"?[r,r]:r};return oy.default=t,oy}var cy={},qF;function wbe(){if(qF)return cy;qF=1,cy.__esModule=!0,cy.default=void 0;var t=function(r,n){return typeof r=="number"||typeof r=="string"?r:r[n]};return cy.default=t,cy}var uy={},FT,HF;function _be(){if(HF)return FT;HF=1;var t=Q5();function e(r,n){return t(r,n)}return FT=e,FT}var qT,zF;function Ebe(){if(zF)return qT;zF=1;var t=El(),e=Object.create,r=function(){function n(){}return function(i){if(!t(i))return{};if(e)return e(i);n.prototype=i;var s=new n;return n.prototype=void 0,s}}();return qT=r,qT}var HT,VF;function xbe(){if(VF)return HT;VF=1;var t=wJ(),e=Ebe(),r=W5(),n=Xf(),i=AJ(),s=Ri(),a=R2(),o=h2(),c=El(),u=M2();function f(h,m,y){var w=s(h),v=w||a(h)||u(h);if(m=n(m,4),y==null){var g=h&&h.constructor;v?y=w?new g:[]:c(h)?y=o(g)?e(i(h)):{}:y={}}return(v?t:r)(h,function(_,b,S){return m(y,_,b,S)}),y}return HT=f,HT}var GF;function Abe(){if(GF)return uy;GF=1;var t=vr;uy.__esModule=!0,uy.default=void 0;var e=t(_be()),r=t(bJ()),n=t(xbe()),i=function(a,o){return(0,n.default)(a,function(c,u,f){(0,r.default)(o,f)?(0,e.default)(u,o[f])||(c[f]=o[f]):c[f]="[DELETED]"},{})};return uy.default=i,uy}var Nc={},ly={},KF;function Sbe(){if(KF)return ly;KF=1;var t=vr;ly.__esModule=!0,ly.default=void 0;var e=t(Ve),r=t(CJ()),n=(0,r.default)()?e.default.useLayoutEffect:e.default.useEffect,i=n;return ly.default=i,ly}var WF;function Obe(){if(WF)return Nc;WF=1;var t=vr;Nc.__esModule=!0,Nc.computeClassNames=s,Nc.computeClassNamesDifference=a,Nc.default=h,Nc.NodeRegistry=Nc.handleClassNamesChange=void 0;var e=Qf,r=t(Ve),n=t(Sbe()),i=/\s+/;function s(m){var y=[];return m?(m.forEach(function(w){if(typeof w.current=="string"){var v=w.current.split(i);v.forEach(function(g){y.push(g)})}}),y.filter(function(w,v,g){return w.length>0&&g.indexOf(w)===v})):[]}function a(m,y){return[y.filter(function(w){return m.indexOf(w)===-1}),m.filter(function(w){return y.indexOf(w)===-1})]}var o=new Map,c=function(y,w){var v=s(w),g=a(o.get(y)||[],v),_=g[0],b=g[1];y&&(_.forEach(function(S){return y.classList.add(S)}),b.forEach(function(S){return y.classList.remove(S)})),o.set(y,v)};Nc.handleClassNamesChange=c;var u=function(){var y=this;this.add=function(w,v){if(y.nodes.has(w)){var g=y.nodes.get(w);g.add(v);return}var _=new Set;_.add(v),y.nodes.set(w,_)},this.del=function(w,v){if(y.nodes.has(w)){var g=y.nodes.get(w);if(g.size===1){y.nodes.delete(w);return}g.delete(v)}},this.emit=function(w,v){v(w,y.nodes.get(w))},this.nodes=new Map};Nc.NodeRegistry=u;var f=new u;function h(m,y){var w=r.default.useRef(),v=r.default.useRef(!1);(0,n.default)(function(){if(w.current=y,v.current){var g=(0,e.isRefObject)(m)?m.current:m;f.emit(g,c)}v.current=!0},[y]),(0,n.default)(function(){var g=(0,e.isRefObject)(m)?m.current:m;return f.add(g,w),f.emit(g,c),function(){f.del(g,w),f.emit(g,c)}},[m])}return Nc}var YF;function zn(){return YF||(YF=1,function(t){var e=Uo,r=vr;t.__esModule=!0;var n={useKeyOnly:!0,useKeyOrValueAndKey:!0,useValueAndKey:!0,useMultipleProp:!0,useTextAlignProp:!0,useVerticalAlignProp:!0,useWidthProp:!0,htmlInputAttrs:!0,htmlInputEvents:!0,htmlInputProps:!0,htmlImageProps:!0,partitionHTMLProps:!0,numberToWordMap:!0,numberToWord:!0,ModernAutoControlledComponent:!0,childrenUtils:!0,customPropTypes:!0,eventStack:!0,getUnhandledProps:!0,getElementType:!0,isBrowser:!0,doesNodeContainClick:!0,leven:!0,createPaginationItems:!0,SUI:!0,normalizeOffset:!0,normalizeTransitionDuration:!0,objectDiff:!0,useClassNamesOnNode:!0};t.SUI=t.customPropTypes=t.childrenUtils=t.numberToWord=t.numberToWordMap=t.partitionHTMLProps=t.htmlImageProps=t.htmlInputProps=t.htmlInputEvents=t.htmlInputAttrs=t.useWidthProp=t.useVerticalAlignProp=t.useTextAlignProp=t.useMultipleProp=t.useValueAndKey=t.useKeyOrValueAndKey=t.useKeyOnly=void 0;var i=r(lve());t.ModernAutoControlledComponent=i.default;var s=e(gve());t.childrenUtils=s;var a=mve();t.useKeyOnly=a.useKeyOnly,t.useKeyOrValueAndKey=a.useKeyOrValueAndKey,t.useValueAndKey=a.useValueAndKey,t.useMultipleProp=a.useMultipleProp,t.useTextAlignProp=a.useTextAlignProp,t.useVerticalAlignProp=a.useVerticalAlignProp,t.useWidthProp=a.useWidthProp;var o=e(Vve());t.customPropTypes=o;var c=r(Wve());t.eventStack=c.default;var u=ebe();Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.prototype.hasOwnProperty.call(n,p)||(t[p]=u[p])});var f=r(tbe());t.getUnhandledProps=f.default;var h=r(rbe());t.getElementType=h.default;var m=ibe();t.htmlInputAttrs=m.htmlInputAttrs,t.htmlInputEvents=m.htmlInputEvents,t.htmlInputProps=m.htmlInputProps,t.htmlImageProps=m.htmlImageProps,t.partitionHTMLProps=m.partitionHTMLProps;var y=r(CJ());t.isBrowser=y.default;var w=r(ube());t.doesNodeContainClick=w.default;var v=r(OJ());t.leven=v.default;var g=r(ybe());t.createPaginationItems=g.default;var _=e(vbe());t.SUI=_;var b=t4();t.numberToWordMap=b.numberToWordMap,t.numberToWord=b.numberToWord;var S=r(bbe());t.normalizeOffset=S.default;var A=r(wbe());t.normalizeTransitionDuration=A.default;var O=r(Abe());t.objectDiff=O.default;var E=r(Obe());t.useClassNamesOnNode=E.default}(QI)),QI}var fy={},zT,QF;function a4(){if(QF)return zT;QF=1;var t=xJ(),e=A1(),r=Z5(),n=e(function(i,s){return r(i)?t(i,s):[]});return zT=n,zT}var dy={},JF;function Ibe(){if(JF)return dy;JF=1;var t=vr;dy.__esModule=!0,dy.default=void 0;var e=t(kn());t(a4());var r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.className,f=o.content,h=o.size,m=(0,r.default)(h,"icons",u),y=(0,i.getUnhandledProps)(s,o),w=(0,i.getElementType)(s,o);return n.default.createElement(w,(0,e.default)({},y,{className:m}),i.childrenUtils.isNil(c)?f:c)}s.handledProps=["as","children","className","content","size"],s.propTypes={},s.defaultProps={as:"i"};var a=s;return dy.default=a,dy}var XF;function B2(){if(XF)return fy;XF=1;var t=Uo,e=vr;fy.__esModule=!0,fy.default=void 0;var r=e(kn()),n=e(xc());e(a4());var i=e(jo()),s=e(xl()),a=e(ti);e(Dn());var o=t(Ve),c=zn(),u=e(Ibe()),f=function(m){(0,n.default)(y,m);function y(){for(var v,g=arguments.length,_=new Array(g),b=0;b<g;b++)_[b]=arguments[b];return v=m.call.apply(m,[this].concat(_))||this,v.handleClick=function(S){var A=v.props.disabled;if(A){S.preventDefault();return}(0,i.default)(v.props,"onClick",S,v.props)},v}var w=y.prototype;return w.getIconAriaOptions=function(){var g={},_=this.props,b=_["aria-label"],S=_["aria-hidden"];return(0,s.default)(b)?g["aria-hidden"]="true":g["aria-label"]=b,(0,s.default)(S)||(g["aria-hidden"]=S),g},w.render=function(){var g=this.props,_=g.bordered,b=g.circular,S=g.className,A=g.color,O=g.corner,E=g.disabled,p=g.fitted,I=g.flipped,N=g.inverted,B=g.link,V=g.loading,de=g.name,ve=g.rotated,j=g.size,L=(0,a.default)(A,de,j,(0,c.useKeyOnly)(_,"bordered"),(0,c.useKeyOnly)(b,"circular"),(0,c.useKeyOnly)(E,"disabled"),(0,c.useKeyOnly)(p,"fitted"),(0,c.useKeyOnly)(N,"inverted"),(0,c.useKeyOnly)(B,"link"),(0,c.useKeyOnly)(V,"loading"),(0,c.useKeyOrValueAndKey)(O,"corner"),(0,c.useValueAndKey)(I,"flipped"),(0,c.useValueAndKey)(ve,"rotated"),"icon",S),Y=(0,c.getUnhandledProps)(y,this.props),ne=(0,c.getElementType)(y,this.props),U=this.getIconAriaOptions();return o.default.createElement(ne,(0,r.default)({},Y,U,{className:L,onClick:this.handleClick}))},y}(o.PureComponent);f.handledProps=["aria-hidden","aria-label","as","bordered","circular","className","color","corner","disabled","fitted","flipped","inverted","link","loading","name","rotated","size"],f.propTypes={},f.defaultProps={as:"i"},f.Group=u.default,f.create=(0,c.createShorthandFactory)(f,function(m){return{name:m}});var h=f;return fy.default=h,fy}var hy={},py={},t_={},gy={},r_={},my={},VT,ZF;function Pbe(){if(ZF)return VT;ZF=1;for(var t=function(o){return o!==null&&!Array.isArray(o)&&typeof o=="object"},e={3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"},r=0;r<24;r+=1)e[112+r]="F"+(r+1);for(var n=0;n<26;n+=1){var i=n+65;e[i]=[String.fromCharCode(i+32),String.fromCharCode(i)]}var s={codes:e,getCode:function(o){return t(o)?o.keyCode||o.which||this[o.key]:this[o]},getKey:function(o){var c=t(o);if(c&&o.key)return o.key;var u=e[c?o.keyCode||o.which:o];return Array.isArray(u)&&(c?u=u[o.shiftKey?1:0]:u=u[0]),u},Cancel:3,Help:6,Backspace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Convert:28,NonConvert:29,Accept:30,ModeChange:31," ":32,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Select:41,Print:42,Execute:43,PrintScreen:44,Insert:45,Delete:46,0:48,")":48,1:49,"!":49,2:50,"@":50,3:51,"#":51,4:52,$:52,5:53,"%":53,6:54,"^":54,7:55,"&":55,8:56,"*":56,9:57,"(":57,a:65,A:65,b:66,B:66,c:67,C:67,d:68,D:68,e:69,E:69,f:70,F:70,g:71,G:71,h:72,H:72,i:73,I:73,j:74,J:74,k:75,K:75,l:76,L:76,m:77,M:77,n:78,N:78,o:79,O:79,p:80,P:80,q:81,Q:81,r:82,R:82,s:83,S:83,t:84,T:84,u:85,U:85,v:86,V:86,w:87,W:87,x:88,X:88,y:89,Y:89,z:90,Z:90,OS:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,F20:131,F21:132,F22:133,F23:134,F24:135,NumLock:144,ScrollLock:145,VolumeMute:181,VolumeDown:182,VolumeUp:183,";":186,":":186,"=":187,"+":187,",":188,"<":188,"-":189,_:189,".":190,">":190,"/":191,"?":191,"`":192,"~":192,"[":219,"{":219,"\\":220,"|":220,"]":221,"}":221,"'":222,'"':222,Meta:224,AltGraph:225,Attn:246,CrSel:247,ExSel:248,EraseEof:249,Play:250,ZoomOut:251};return s.Spacebar=s[" "],s.Digit0=s[0],s.Digit1=s[1],s.Digit2=s[2],s.Digit3=s[3],s.Digit4=s[4],s.Digit5=s[5],s.Digit6=s[6],s.Digit7=s[7],s.Digit8=s[8],s.Digit9=s[9],s.Tilde=s["~"],s.GraveAccent=s["`"],s.ExclamationPoint=s["!"],s.AtSign=s["@"],s.PoundSign=s["#"],s.PercentSign=s["%"],s.Caret=s["^"],s.Ampersand=s["&"],s.PlusSign=s["+"],s.MinusSign=s["-"],s.EqualsSign=s["="],s.DivisionSign=s["/"],s.MultiplicationSign=s["*"],s.Comma=s[","],s.Decimal=s["."],s.Colon=s[":"],s.Semicolon=s[";"],s.Pipe=s["|"],s.BackSlash=s["\\"],s.QuestionMark=s["?"],s.SingleQuote=s["'"],s.DoubleQuote=s['"'],s.LeftCurlyBrace=s["{"],s.RightCurlyBrace=s["}"],s.LeftParenthesis=s["("],s.RightParenthesis=s[")"],s.LeftAngleBracket=s["<"],s.RightAngleBracket=s[">"],s.LeftSquareBracket=s["["],s.RightSquareBracket=s["]"],VT=s,VT}var n_={},GT={exports:{}},xn={};/**
87
- * @license React
88
- * react-is.production.min.js
89
- *
90
- * Copyright (c) Facebook, Inc. and its affiliates.
91
- *
92
- * This source code is licensed under the MIT license found in the
93
- * LICENSE file in the root directory of this source tree.
94
- */var eq;function Tbe(){if(eq)return xn;eq=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function v(g){if(typeof g=="object"&&g!==null){var _=g.$$typeof;switch(_){case t:switch(g=g.type,g){case r:case i:case n:case u:case f:return g;default:switch(g=g&&g.$$typeof,g){case o:case a:case c:case m:case h:case s:return g;default:return _}}case e:return _}}}return xn.ContextConsumer=a,xn.ContextProvider=s,xn.Element=t,xn.ForwardRef=c,xn.Fragment=r,xn.Lazy=m,xn.Memo=h,xn.Portal=e,xn.Profiler=i,xn.StrictMode=n,xn.Suspense=u,xn.SuspenseList=f,xn.isAsyncMode=function(){return!1},xn.isConcurrentMode=function(){return!1},xn.isContextConsumer=function(g){return v(g)===a},xn.isContextProvider=function(g){return v(g)===s},xn.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},xn.isForwardRef=function(g){return v(g)===c},xn.isFragment=function(g){return v(g)===r},xn.isLazy=function(g){return v(g)===m},xn.isMemo=function(g){return v(g)===h},xn.isPortal=function(g){return v(g)===e},xn.isProfiler=function(g){return v(g)===i},xn.isStrictMode=function(g){return v(g)===n},xn.isSuspense=function(g){return v(g)===u},xn.isSuspenseList=function(g){return v(g)===f},xn.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===i||g===n||g===u||g===f||g===y||typeof g=="object"&&g!==null&&(g.$$typeof===m||g.$$typeof===h||g.$$typeof===s||g.$$typeof===a||g.$$typeof===c||g.$$typeof===w||g.getModuleId!==void 0)},xn.typeOf=v,xn}var tq;function Cbe(){return tq||(tq=1,GT.exports=Tbe()),GT.exports}var rq;function Rbe(){if(rq)return n_;rq=1;var t=Uo,e=vr;n_.__esModule=!0,n_.default=i;var r=e(Ve),n=t(Cbe());function i(s){if(s&&(r.default.Children.only(s),n.isFragment(s)))throw new Error('An "React.Fragment" cannot be used as a `trigger`.')}return n_}var yy={},nq;function Nbe(){if(nq)return yy;nq=1;var t=Uo,e=vr;yy.__esModule=!0,yy.default=void 0;var r=e(xc()),n=e(jo()),i=Qf;e(Dn());var s=t(Ve),a=cb,o=zn(),c=function(f){(0,r.default)(h,f);function h(){for(var y,w=arguments.length,v=new Array(w),g=0;g<w;g++)v[g]=arguments[g];return y=f.call.apply(f,[this].concat(v))||this,y.handleRef=function(_){(0,i.handleRef)(y.props.innerRef,_)},y}var m=h.prototype;return m.componentDidMount=function(){(0,n.default)(this.props,"onMount",null,this.props)},m.componentWillUnmount=function(){(0,n.default)(this.props,"onUnmount",null,this.props)},m.render=function(){if(!(0,o.isBrowser)())return null;var w=this.props,v=w.children,g=w.mountNode,_=g===void 0?document.body:g;return(0,a.createPortal)(s.default.createElement(i.Ref,{innerRef:this.handleRef},v),_)},h}(s.Component);c.handledProps=["children","innerRef","mountNode","onMount","onUnmount"],c.propTypes={};var u=c;return yy.default=u,yy}var iq;function Dbe(){if(iq)return my;iq=1;var t=vr;my.__esModule=!0,my.default=void 0;var e=t(kn()),r=t(xc()),n=t(jo()),i=t(i4()),s=Qf,a=t(Pbe());t(Dn());var o=t(Ve),c=zn();t(Rbe());var u=t(Nbe()),f=function(m){(0,r.default)(y,m);function y(){for(var v,g=arguments.length,_=new Array(g),b=0;b<g;b++)_[b]=arguments[b];return v=m.call.apply(m,[this].concat(_))||this,v.contentRef=o.default.createRef(),v.triggerRef=o.default.createRef(),v.latestDocumentMouseDownEvent=null,v.handleDocumentMouseDown=function(S){v.latestDocumentMouseDownEvent=S},v.handleDocumentClick=function(S){var A=v.props.closeOnDocumentClick,O=v.latestDocumentMouseDownEvent;v.latestDocumentMouseDownEvent=null,!(!v.contentRef.current||(0,c.doesNodeContainClick)(v.triggerRef.current,S)||O&&(0,c.doesNodeContainClick)(v.contentRef.current,O)||(0,c.doesNodeContainClick)(v.contentRef.current,S))&&A&&v.close(S)},v.handleEscape=function(S){v.props.closeOnEscape&&a.default.getCode(S)===a.default.Escape&&v.close(S)},v.handlePortalMouseLeave=function(S){var A=v.props,O=A.closeOnPortalMouseLeave,E=A.mouseLeaveDelay;O&&S.target===v.contentRef.current&&(v.mouseLeaveTimer=v.closeWithTimeout(S,E))},v.handlePortalMouseEnter=function(){var S=v.props.closeOnPortalMouseLeave;S&&clearTimeout(v.mouseLeaveTimer)},v.handleTriggerBlur=function(S){for(var A=v.props,O=A.trigger,E=A.closeOnTriggerBlur,p=arguments.length,I=new Array(p>1?p-1:0),N=1;N<p;N++)I[N-1]=arguments[N];n.default.apply(void 0,[O,"props.onBlur",S].concat(I));var B=S.relatedTarget||document.activeElement,V=(0,n.default)(v.contentRef.current,"contains",B);!E||V||v.close(S)},v.handleTriggerClick=function(S){for(var A=v.props,O=A.trigger,E=A.closeOnTriggerClick,p=A.openOnTriggerClick,I=v.state.open,N=arguments.length,B=new Array(N>1?N-1:0),V=1;V<N;V++)B[V-1]=arguments[V];n.default.apply(void 0,[O,"props.onClick",S].concat(B)),I&&E?v.close(S):!I&&p&&v.open(S)},v.handleTriggerFocus=function(S){for(var A=v.props,O=A.trigger,E=A.openOnTriggerFocus,p=arguments.length,I=new Array(p>1?p-1:0),N=1;N<p;N++)I[N-1]=arguments[N];n.default.apply(void 0,[O,"props.onFocus",S].concat(I)),E&&v.open(S)},v.handleTriggerMouseLeave=function(S){clearTimeout(v.mouseEnterTimer);for(var A=v.props,O=A.trigger,E=A.closeOnTriggerMouseLeave,p=A.mouseLeaveDelay,I=arguments.length,N=new Array(I>1?I-1:0),B=1;B<I;B++)N[B-1]=arguments[B];n.default.apply(void 0,[O,"props.onMouseLeave",S].concat(N)),E&&(v.mouseLeaveTimer=v.closeWithTimeout(S,p))},v.handleTriggerMouseEnter=function(S){clearTimeout(v.mouseLeaveTimer);for(var A=v.props,O=A.trigger,E=A.mouseEnterDelay,p=A.openOnTriggerMouseEnter,I=arguments.length,N=new Array(I>1?I-1:0),B=1;B<I;B++)N[B-1]=arguments[B];n.default.apply(void 0,[O,"props.onMouseEnter",S].concat(N)),p&&(v.mouseEnterTimer=v.openWithTimeout(S,E))},v.open=function(S){(0,n.default)(v.props,"onOpen",S,(0,e.default)({},v.props,{open:!0})),v.setState({open:!0})},v.openWithTimeout=function(S,A){var O=(0,e.default)({},S);return setTimeout(function(){return v.open(O)},A||0)},v.close=function(S){v.setState({open:!1}),(0,n.default)(v.props,"onClose",S,(0,e.default)({},v.props,{open:!1}))},v.closeWithTimeout=function(S,A){var O=(0,e.default)({},S);return setTimeout(function(){return v.close(O)},A||0)},v.handleMount=function(){(0,n.default)(v.props,"onMount",null,v.props)},v.handleUnmount=function(){(0,n.default)(v.props,"onUnmount",null,v.props)},v.handleTriggerRef=function(S){v.triggerRef.current=S,(0,s.handleRef)(v.props.triggerRef,S)},v}var w=y.prototype;return w.componentWillUnmount=function(){clearTimeout(this.mouseEnterTimer),clearTimeout(this.mouseLeaveTimer)},w.render=function(){var g=this.props,_=g.children,b=g.eventPool,S=g.mountNode,A=g.trigger,O=this.state.open;return o.default.createElement(o.default.Fragment,null,O&&o.default.createElement(o.default.Fragment,null,o.default.createElement(u.default,{innerRef:this.contentRef,mountNode:S,onMount:this.handleMount,onUnmount:this.handleUnmount},_),o.default.createElement(i.default,{name:"mouseleave",on:this.handlePortalMouseLeave,pool:b,target:this.contentRef}),o.default.createElement(i.default,{name:"mouseenter",on:this.handlePortalMouseEnter,pool:b,target:this.contentRef}),o.default.createElement(i.default,{name:"mousedown",on:this.handleDocumentMouseDown,pool:b}),o.default.createElement(i.default,{name:"click",on:this.handleDocumentClick,pool:b}),o.default.createElement(i.default,{name:"keydown",on:this.handleEscape,pool:b})),A&&o.default.createElement(s.Ref,{innerRef:this.handleTriggerRef},o.default.cloneElement(A,{onBlur:this.handleTriggerBlur,onClick:this.handleTriggerClick,onFocus:this.handleTriggerFocus,onMouseLeave:this.handleTriggerMouseLeave,onMouseEnter:this.handleTriggerMouseEnter})))},y}(c.ModernAutoControlledComponent);f.handledProps=["children","closeOnDocumentClick","closeOnEscape","closeOnPortalMouseLeave","closeOnTriggerBlur","closeOnTriggerClick","closeOnTriggerMouseLeave","defaultOpen","eventPool","mountNode","mouseEnterDelay","mouseLeaveDelay","onClose","onMount","onOpen","onUnmount","open","openOnTriggerClick","openOnTriggerFocus","openOnTriggerMouseEnter","trigger","triggerRef"],f.propTypes={},f.defaultProps={closeOnDocumentClick:!0,closeOnEscape:!0,eventPool:"default",openOnTriggerClick:!0},f.autoControlledProps=["open"],f.Inner=u.default;var h=f;return my.default=h,my}var sq;function o4(){if(sq)return r_;sq=1;var t=vr;r_.__esModule=!0;var e=t(Dbe());return r_.default=e.default,r_}var vy={},aq;function Mbe(){if(aq)return vy;aq=1;var t=vr;vy.__esModule=!0,vy.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.blurring,u=o.className,f=o.children,h=o.content,m=o.dimmed,y=(0,r.default)((0,i.useKeyOnly)(c,"blurring"),(0,i.useKeyOnly)(m,"dimmed"),"dimmable",u),w=(0,i.getUnhandledProps)(s,o),v=(0,i.getElementType)(s,o);return n.default.createElement(v,(0,e.default)({},w,{className:y}),i.childrenUtils.isNil(f)?h:f)}s.handledProps=["as","blurring","children","className","content","dimmed"],s.propTypes={};var a=s;return vy.default=a,vy}var by={},oq;function kbe(){if(oq)return by;oq=1;var t=Uo,e=vr;by.__esModule=!0,by.default=void 0;var r=e(kn()),n=e(xc()),i=e(jo()),s=Qf,a=e(ti);e(Dn());var o=t(Ve),c=zn(),u=function(f){(0,n.default)(h,f);function h(){for(var y,w=arguments.length,v=new Array(w),g=0;g<w;g++)v[g]=arguments[g];return y=f.call.apply(f,[this].concat(v))||this,y.containerRef=(0,o.createRef)(),y.contentRef=(0,o.createRef)(),y.handleClick=function(_){var b=y.contentRef.current;(0,i.default)(y.props,"onClick",_,y.props),!(b&&b!==_.target&&(0,c.doesNodeContainClick)(b,_))&&(0,i.default)(y.props,"onClickOutside",_,y.props)},y}var m=h.prototype;return m.componentDidMount=function(){var w=this.props.active;this.toggleStyles(w)},m.componentDidUpdate=function(w){var v=this.props.active,g=w.active;g!==v&&this.toggleStyles(v)},m.toggleStyles=function(w){var v=this.containerRef.current;!v||!v.style||(w?v.style.setProperty("display","flex","important"):v.style.removeProperty("display"))},m.render=function(){var w=this.props,v=w.active,g=w.children,_=w.className,b=w.content,S=w.disabled,A=w.inverted,O=w.page,E=w.simple,p=w.verticalAlign,I=(0,a.default)("ui",(0,c.useKeyOnly)(v,"active transition visible"),(0,c.useKeyOnly)(S,"disabled"),(0,c.useKeyOnly)(A,"inverted"),(0,c.useKeyOnly)(O,"page"),(0,c.useKeyOnly)(E,"simple"),(0,c.useVerticalAlignProp)(p),"dimmer",_),N=(0,c.getUnhandledProps)(h,this.props),B=(0,c.getElementType)(h,this.props),V=c.childrenUtils.isNil(g)?b:g;return o.default.createElement(s.Ref,{innerRef:this.containerRef},o.default.createElement(B,(0,r.default)({},N,{className:I,onClick:this.handleClick}),V&&o.default.createElement("div",{className:"content",ref:this.contentRef},V)))},h}(o.Component);return by.default=u,u.handledProps=["active","as","children","className","content","disabled","inverted","onClick","onClickOutside","page","simple","verticalAlign"],u.propTypes={},by}var cq;function $be(){if(cq)return gy;cq=1;var t=Uo,e=vr;gy.__esModule=!0,gy.default=void 0;var r=e(kn()),n=e(xc());e(Dn());var i=t(Ve),s=zn(),a=e(o4()),o=e(Mbe()),c=e(kbe()),u=function(f){(0,n.default)(h,f);function h(){for(var y,w=arguments.length,v=new Array(w),g=0;g<w;g++)v[g]=arguments[g];return y=f.call.apply(f,[this].concat(v))||this,y.handlePortalMount=function(){(0,s.isBrowser)()&&(document.body.classList.add("dimmed"),document.body.classList.add("dimmable"))},y.handlePortalUnmount=function(){(0,s.isBrowser)()&&(document.body.classList.remove("dimmed"),document.body.classList.remove("dimmable"))},y}var m=h.prototype;return m.render=function(){var w=this.props,v=w.active,g=w.page,_=(0,s.getUnhandledProps)(h,this.props);return g?i.default.createElement(a.default,{closeOnEscape:!1,closeOnDocumentClick:!1,onMount:this.handlePortalMount,onUnmount:this.handlePortalUnmount,open:v,openOnTriggerClick:!1},i.default.createElement(c.default,(0,r.default)({},_,{active:v,page:g}))):i.default.createElement(c.default,(0,r.default)({},_,{active:v,page:g}))},h}(i.Component);return gy.default=u,u.handledProps=["active","page"],u.propTypes={},u.Dimmable=o.default,u.Inner=c.default,u.create=(0,s.createShorthandFactory)(u,function(f){return{content:f}}),gy}var uq;function Lbe(){if(uq)return t_;uq=1;var t=vr;t_.__esModule=!0;var e=t($be());return t_.default=e.default,t_}var wy={},lq;function Ube(){if(lq)return wy;lq=1;var t=vr;wy.__esModule=!0,wy.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.className,f=o.content,h=o.size,m=(0,r.default)("ui",h,u,"images"),y=(0,i.getUnhandledProps)(s,o),w=(0,i.getElementType)(s,o);return n.default.createElement(w,(0,e.default)({},y,{className:m}),i.childrenUtils.isNil(c)?f:c)}s.handledProps=["as","children","className","content","size"],s.propTypes={};var a=s;return wy.default=a,wy}var fq;function jbe(){if(fq)return py;fq=1;var t=vr;py.__esModule=!0,py.default=void 0;var e=t(kn()),r=t(xl()),n=t(ti);t(Dn());var i=t(Ve),s=zn(),a=t(Lbe()),o=t(NJ()),c=t(Ube());function u(h){var m=h.avatar,y=h.bordered,w=h.centered,v=h.children,g=h.circular,_=h.className,b=h.content,S=h.dimmer,A=h.disabled,O=h.floated,E=h.fluid,p=h.hidden,I=h.href,N=h.inline,B=h.label,V=h.rounded,de=h.size,ve=h.spaced,j=h.verticalAlign,L=h.wrapped,Y=h.ui,ne=(0,n.default)((0,s.useKeyOnly)(Y,"ui"),de,(0,s.useKeyOnly)(m,"avatar"),(0,s.useKeyOnly)(y,"bordered"),(0,s.useKeyOnly)(g,"circular"),(0,s.useKeyOnly)(w,"centered"),(0,s.useKeyOnly)(A,"disabled"),(0,s.useKeyOnly)(E,"fluid"),(0,s.useKeyOnly)(p,"hidden"),(0,s.useKeyOnly)(N,"inline"),(0,s.useKeyOnly)(V,"rounded"),(0,s.useKeyOrValueAndKey)(ve,"spaced"),(0,s.useValueAndKey)(O,"floated"),(0,s.useVerticalAlignProp)(j,"aligned"),"image",_),U=(0,s.getUnhandledProps)(u,h),F=(0,s.partitionHTMLProps)(U,{htmlProps:s.htmlImageProps}),H=F[0],M=F[1],q=(0,s.getElementType)(u,h,function(){if(!(0,r.default)(S)||!(0,r.default)(B)||!(0,r.default)(L)||!s.childrenUtils.isNil(v))return"div"});return s.childrenUtils.isNil(v)?s.childrenUtils.isNil(b)?q==="img"?i.default.createElement(q,(0,e.default)({},M,H,{className:ne})):i.default.createElement(q,(0,e.default)({},M,{className:ne,href:I}),a.default.create(S,{autoGenerateKey:!1}),o.default.create(B,{autoGenerateKey:!1}),i.default.createElement("img",H)):i.default.createElement(q,(0,e.default)({},U,{className:ne}),b):i.default.createElement(q,(0,e.default)({},U,{className:ne}),v)}u.handledProps=["as","avatar","bordered","centered","children","circular","className","content","dimmer","disabled","floated","fluid","hidden","href","inline","label","rounded","size","spaced","ui","verticalAlign","wrapped"],u.Group=c.default,u.propTypes={},u.defaultProps={as:"img",ui:!0},u.create=(0,s.createShorthandFactory)(u,function(h){return{src:h}});var f=u;return py.default=f,py}var _y={},dq;function Bbe(){if(dq)return _y;dq=1;var t=vr;_y.__esModule=!0,_y.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.className,f=o.content,h=(0,r.default)("detail",u),m=(0,i.getUnhandledProps)(s,o),y=(0,i.getElementType)(s,o);return n.default.createElement(y,(0,e.default)({},m,{className:h}),i.childrenUtils.isNil(c)?f:c)}s.handledProps=["as","children","className","content"],s.propTypes={},s.create=(0,i.createShorthandFactory)(s,function(o){return{content:o}});var a=s;return _y.default=a,_y}var Ey={},hq;function Fbe(){if(hq)return Ey;hq=1;var t=vr;Ey.__esModule=!0,Ey.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.circular,f=o.className,h=o.color,m=o.content,y=o.size,w=o.tag,v=(0,r.default)("ui",h,y,(0,i.useKeyOnly)(u,"circular"),(0,i.useKeyOnly)(w,"tag"),"labels",f),g=(0,i.getUnhandledProps)(s,o),_=(0,i.getElementType)(s,o);return n.default.createElement(_,(0,e.default)({},g,{className:v}),i.childrenUtils.isNil(c)?m:c)}s.handledProps=["as","children","circular","className","color","content","size","tag"],s.propTypes={};var a=s;return Ey.default=a,Ey}var pq;function NJ(){if(pq)return hy;pq=1;var t=Uo,e=vr;hy.__esModule=!0,hy.default=void 0;var r=e(kn()),n=e(xc()),i=e(V5()),s=e(jo()),a=e(ti);e(Dn());var o=t(Ve),c=zn(),u=e(B2()),f=e(jbe()),h=e(Bbe()),m=e(Fbe()),y=function(w){(0,n.default)(v,w);function v(){for(var _,b=arguments.length,S=new Array(b),A=0;A<b;A++)S[A]=arguments[A];return _=w.call.apply(w,[this].concat(S))||this,_.handleClick=function(O){var E=_.props.onClick;E&&E(O,_.props)},_.handleIconOverrides=function(O){return{onClick:function(p){(0,s.default)(O,"onClick",p),(0,s.default)(_.props,"onRemove",p,_.props)}}},_}var g=v.prototype;return g.render=function(){var b=this.props,S=b.active,A=b.attached,O=b.basic,E=b.children,p=b.circular,I=b.className,N=b.color,B=b.content,V=b.corner,de=b.detail,ve=b.empty,j=b.floating,L=b.horizontal,Y=b.icon,ne=b.image,U=b.onRemove,F=b.pointing,H=b.prompt,M=b.removeIcon,q=b.ribbon,$=b.size,k=b.tag,G=F===!0&&"pointing"||(F==="left"||F==="right")&&F+" pointing"||(F==="above"||F==="below")&&"pointing "+F,pe=(0,a.default)("ui",N,G,$,(0,c.useKeyOnly)(S,"active"),(0,c.useKeyOnly)(O,"basic"),(0,c.useKeyOnly)(p,"circular"),(0,c.useKeyOnly)(ve,"empty"),(0,c.useKeyOnly)(j,"floating"),(0,c.useKeyOnly)(L,"horizontal"),(0,c.useKeyOnly)(ne===!0,"image"),(0,c.useKeyOnly)(H,"prompt"),(0,c.useKeyOnly)(k,"tag"),(0,c.useKeyOrValueAndKey)(V,"corner"),(0,c.useKeyOrValueAndKey)(q,"ribbon"),(0,c.useValueAndKey)(A,"attached"),"label",I),Q=(0,c.getUnhandledProps)(v,this.props),te=(0,c.getElementType)(v,this.props);if(!c.childrenUtils.isNil(E))return o.default.createElement(te,(0,r.default)({},Q,{className:pe,onClick:this.handleClick}),E);var ce=(0,i.default)(M)?"delete":M;return o.default.createElement(te,(0,r.default)({className:pe,onClick:this.handleClick},Q),u.default.create(Y,{autoGenerateKey:!1}),typeof ne!="boolean"&&f.default.create(ne,{autoGenerateKey:!1}),B,h.default.create(de,{autoGenerateKey:!1}),U&&u.default.create(ce,{autoGenerateKey:!1,overrideProps:this.handleIconOverrides}))},v}(o.Component);return hy.default=y,y.handledProps=["active","as","attached","basic","children","circular","className","color","content","corner","detail","empty","floating","horizontal","icon","image","onClick","onRemove","pointing","prompt","removeIcon","ribbon","size","tag"],y.propTypes={},y.Detail=h.default,y.Group=m.default,y.create=(0,c.createShorthandFactory)(y,function(w){return{content:w}}),hy}var xy={},gq;function qbe(){if(gq)return xy;gq=1;var t=vr;xy.__esModule=!0,xy.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.className,f=o.content,h=o.hidden,m=o.visible,y=(0,r.default)((0,i.useKeyOnly)(m,"visible"),(0,i.useKeyOnly)(h,"hidden"),"content",u),w=(0,i.getUnhandledProps)(s,o),v=(0,i.getElementType)(s,o);return n.default.createElement(v,(0,e.default)({},w,{className:y}),i.childrenUtils.isNil(c)?f:c)}s.handledProps=["as","children","className","content","hidden","visible"],s.propTypes={};var a=s;return xy.default=a,xy}var Ay={},mq;function Hbe(){if(mq)return Ay;mq=1;var t=vr;Ay.__esModule=!0,Ay.default=void 0;var e=t(kn()),r=t(j2()),n=t(xl()),i=t(ti);t(Dn());var s=t(Ve),a=zn(),o=t(c4());function c(f){var h=f.attached,m=f.basic,y=f.buttons,w=f.children,v=f.className,g=f.color,_=f.compact,b=f.content,S=f.floated,A=f.fluid,O=f.icon,E=f.inverted,p=f.labeled,I=f.negative,N=f.positive,B=f.primary,V=f.secondary,de=f.size,ve=f.toggle,j=f.vertical,L=f.widths,Y=(0,i.default)("ui",g,de,(0,a.useKeyOnly)(m,"basic"),(0,a.useKeyOnly)(_,"compact"),(0,a.useKeyOnly)(A,"fluid"),(0,a.useKeyOnly)(O,"icon"),(0,a.useKeyOnly)(E,"inverted"),(0,a.useKeyOnly)(p,"labeled"),(0,a.useKeyOnly)(I,"negative"),(0,a.useKeyOnly)(N,"positive"),(0,a.useKeyOnly)(B,"primary"),(0,a.useKeyOnly)(V,"secondary"),(0,a.useKeyOnly)(ve,"toggle"),(0,a.useKeyOnly)(j,"vertical"),(0,a.useKeyOrValueAndKey)(h,"attached"),(0,a.useValueAndKey)(S,"floated"),(0,a.useWidthProp)(L),"buttons",v),ne=(0,a.getUnhandledProps)(c,f),U=(0,a.getElementType)(c,f);return(0,n.default)(y)?s.default.createElement(U,(0,e.default)({},ne,{className:Y}),a.childrenUtils.isNil(w)?b:w):s.default.createElement(U,(0,e.default)({},ne,{className:Y}),(0,r.default)(y,function(F){return o.default.create(F)}))}c.handledProps=["as","attached","basic","buttons","children","className","color","compact","content","floated","fluid","icon","inverted","labeled","negative","positive","primary","secondary","size","toggle","vertical","widths"],c.propTypes={};var u=c;return Ay.default=u,Ay}var Sy={},yq;function zbe(){if(yq)return Sy;yq=1;var t=vr;Sy.__esModule=!0,Sy.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.className,u=o.text,f=(0,r.default)("or",c),h=(0,i.getUnhandledProps)(s,o),m=(0,i.getElementType)(s,o);return n.default.createElement(m,(0,e.default)({},h,{className:f,"data-text":u}))}s.handledProps=["as","className","text"],s.propTypes={};var a=s;return Sy.default=a,Sy}var vq;function c4(){if(vq)return Jm;vq=1;var t=Uo,e=vr;Jm.__esModule=!0,Jm.default=void 0;var r=e(kn()),n=e(xc()),i=e(jo()),s=e(xl()),a=Qf,o=e(ti);e(Dn());var c=t(Ve),u=zn(),f=e(B2()),h=e(NJ()),m=e(qbe()),y=e(Hbe()),w=e(zbe()),v=function(_){(0,n.default)(b,_);function b(){for(var A,O=arguments.length,E=new Array(O),p=0;p<O;p++)E[p]=arguments[p];return A=_.call.apply(_,[this].concat(E))||this,A.ref=(0,c.createRef)(),A.computeElementType=function(){var I=A.props,N=I.attached,B=I.label;if(!(0,s.default)(N)||!(0,s.default)(B))return"div"},A.computeTabIndex=function(I){var N=A.props,B=N.disabled,V=N.tabIndex;if(!(0,s.default)(V))return V;if(B)return-1;if(I==="div")return 0},A.focus=function(I){return(0,i.default)(A.ref.current,"focus",I)},A.handleClick=function(I){var N=A.props.disabled;if(N){I.preventDefault();return}(0,i.default)(A.props,"onClick",I,A.props)},A.hasIconClass=function(){var I=A.props,N=I.labelPosition,B=I.children,V=I.content,de=I.icon;return de===!0?!0:de&&(N||u.childrenUtils.isNil(B)&&(0,s.default)(V))},A}var S=b.prototype;return S.computeButtonAriaRole=function(O){var E=this.props.role;if(!(0,s.default)(E))return E;if(O!=="button")return"button"},S.render=function(){var O=this.props,E=O.active,p=O.animated,I=O.attached,N=O.basic,B=O.children,V=O.circular,de=O.className,ve=O.color,j=O.compact,L=O.content,Y=O.disabled,ne=O.floated,U=O.fluid,F=O.icon,H=O.inverted,M=O.label,q=O.labelPosition,$=O.loading,k=O.negative,G=O.positive,pe=O.primary,Q=O.secondary,te=O.size,ce=O.toggle,T=O.type,le=(0,o.default)(ve,te,(0,u.useKeyOnly)(E,"active"),(0,u.useKeyOnly)(N,"basic"),(0,u.useKeyOnly)(V,"circular"),(0,u.useKeyOnly)(j,"compact"),(0,u.useKeyOnly)(U,"fluid"),(0,u.useKeyOnly)(this.hasIconClass(),"icon"),(0,u.useKeyOnly)(H,"inverted"),(0,u.useKeyOnly)($,"loading"),(0,u.useKeyOnly)(k,"negative"),(0,u.useKeyOnly)(G,"positive"),(0,u.useKeyOnly)(pe,"primary"),(0,u.useKeyOnly)(Q,"secondary"),(0,u.useKeyOnly)(ce,"toggle"),(0,u.useKeyOrValueAndKey)(p,"animated"),(0,u.useKeyOrValueAndKey)(I,"attached")),Ge=(0,o.default)((0,u.useKeyOrValueAndKey)(q||!!M,"labeled")),tt=(0,o.default)((0,u.useKeyOnly)(Y,"disabled"),(0,u.useValueAndKey)(ne,"floated")),yt=(0,u.getUnhandledProps)(b,this.props),vt=(0,u.getElementType)(b,this.props,this.computeElementType),gt=this.computeTabIndex(vt);if(!(0,s.default)(M)){var Bt=(0,o.default)("ui",le,"button",de),Zt=(0,o.default)("ui",Ge,"button",de,tt),Or=h.default.create(M,{defaultProps:{basic:!0,pointing:q==="left"?"right":"left"},autoGenerateKey:!1});return c.default.createElement(vt,(0,r.default)({},yt,{className:Zt,onClick:this.handleClick}),q==="left"&&Or,c.default.createElement(a.Ref,{innerRef:this.ref},c.default.createElement("button",{className:Bt,"aria-pressed":ce?!!E:void 0,disabled:Y,type:T,tabIndex:gt},f.default.create(F,{autoGenerateKey:!1})," ",L)),(q==="right"||!q)&&Or)}var Ct=(0,o.default)("ui",le,tt,Ge,"button",de),Pt=!u.childrenUtils.isNil(B),$t=this.computeButtonAriaRole(vt);return c.default.createElement(a.Ref,{innerRef:this.ref},c.default.createElement(vt,(0,r.default)({},yt,{className:Ct,"aria-pressed":ce?!!E:void 0,disabled:Y&&vt==="button"||void 0,onClick:this.handleClick,role:$t,type:T,tabIndex:gt}),Pt&&B,!Pt&&f.default.create(F,{autoGenerateKey:!1}),!Pt&&L))},b}(c.Component);v.handledProps=["active","animated","as","attached","basic","children","circular","className","color","compact","content","disabled","floated","fluid","icon","inverted","label","labelPosition","loading","negative","onClick","positive","primary","role","secondary","size","tabIndex","toggle","type"],v.propTypes={},v.defaultProps={as:"button"},v.Content=m.default,v.Group=y.default,v.Or=w.default,v.create=(0,u.createShorthandFactory)(v,function(_){return{content:_}});var g=v;return Jm.default=g,Jm}(function(t){var e=$e&&$e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.Button=void 0;var r=c4();Object.defineProperty(t,"Button",{enumerable:!0,get:function(){return e(r).default}})})(So);var iu={},Ug={},KT={},Tt={},IN={exports:{}},DJ={},To={},jg={},um={},Sr={},Bg={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(b){if(super(),!t.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((S,A)=>`${S}${A}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((S,A)=>(A instanceof r&&(S[A.str]=(S[A.str]||0)+1),S),{})}}t._Code=n,t.nil=new n("");function i(_,...b){const S=[_[0]];let A=0;for(;A<b.length;)o(S,b[A]),S.push(_[++A]);return new n(S)}t._=i;const s=new n("+");function a(_,...b){const S=[y(_[0])];let A=0;for(;A<b.length;)S.push(s),o(S,b[A]),S.push(s,y(_[++A]));return c(S),new n(S)}t.str=a;function o(_,b){b instanceof n?_.push(...b._items):b instanceof r?_.push(b):_.push(h(b))}t.addCodeArg=o;function c(_){let b=1;for(;b<_.length-1;){if(_[b]===s){const S=u(_[b-1],_[b+1]);if(S!==void 0){_.splice(b-1,3,S);continue}_[b++]="+"}b++}}function u(_,b){if(b==='""')return _;if(_==='""')return b;if(typeof _=="string")return b instanceof r||_[_.length-1]!=='"'?void 0:typeof b!="string"?`${_.slice(0,-1)}${b}"`:b[0]==='"'?_.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(_ instanceof r))return`"${_}${b.slice(1)}`}function f(_,b){return b.emptyStr()?_:_.emptyStr()?b:a`${_}${b}`}t.strConcat=f;function h(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:y(Array.isArray(_)?_.join(","):_)}function m(_){return new n(y(_))}t.stringify=m;function y(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=y;function w(_){return typeof _=="string"&&t.IDENTIFIER.test(_)?new n(`.${_}`):i`[${_}]`}t.getProperty=w;function v(_){if(typeof _=="string"&&t.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}t.getEsmExportName=v;function g(_){return new n(_.toString())}t.regexpCode=g})(Bg);var PN={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=Bg;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class i{constructor({prefixes:u,parent:f}={}){this._names={},this._prefixes=u,this._parent=f}toName(u){return u instanceof e.Name?u:this.name(u)}name(u){return new e.Name(this._newName(u))}_newName(u){const f=this._names[u]||this._nameGroup(u);return`${u}${f.index++}`}_nameGroup(u){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}t.Scope=i;class s extends e.Name{constructor(u,f){super(f),this.prefix=u}setValue(u,{property:f,itemIndex:h}){this.value=u,this.scopePath=(0,e._)`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;const a=(0,e._)`\n`;class o extends i{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:e.nil}}get(){return this._scope}name(u){return new s(u,this._newName(u))}value(u,f){var h;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const m=this.toName(u),{prefix:y}=m,w=(h=f.key)!==null&&h!==void 0?h:f.ref;let v=this._values[y];if(v){const b=v.get(w);if(b)return b}else v=this._values[y]=new Map;v.set(w,m);const g=this._scope[y]||(this._scope[y]=[]),_=g.length;return g[_]=f.ref,m.setValue(f,{property:y,itemIndex:_}),m}getValue(u,f){const h=this._values[u];if(h)return h.get(f)}scopeRefs(u,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,e._)`${u}${h.scopePath}`})}scopeCode(u=this._values,f,h){return this._reduceValues(u,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(u,f,h={},m){let y=e.nil;for(const w in u){const v=u[w];if(!v)continue;const g=h[w]=h[w]||new Map;v.forEach(_=>{if(g.has(_))return;g.set(_,n.Started);let b=f(_);if(b){const S=this.opts.es5?t.varKinds.var:t.varKinds.const;y=(0,e._)`${y}${S} ${_} = ${b};${this.opts._n}`}else if(b=m==null?void 0:m(_))y=(0,e._)`${y}${b}${this.opts._n}`;else throw new r(_);g.set(_,n.Completed)})}return y}}t.ValueScope=o})(PN);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Bg,r=PN;var n=Bg;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var i=PN;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(k,G){return this}}class a extends s{constructor(k,G,pe){super(),this.varKind=k,this.name=G,this.rhs=pe}render({es5:k,_n:G}){const pe=k?r.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${pe} ${this.name}${Q};`+G}optimizeNames(k,G){if(k[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,k,G)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(k,G,pe){super(),this.lhs=k,this.rhs=G,this.sideEffects=pe}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,G){if(!(this.lhs instanceof e.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=j(this.rhs,k,G),this}get names(){const k=this.lhs instanceof e.Name?{}:{...this.lhs.names};return ve(k,this.rhs)}}class c extends o{constructor(k,G,pe,Q){super(k,pe,Q),this.op=G}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class u extends s{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class f extends s{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class h extends s{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class m extends s{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,G){return this.code=j(this.code,k,G),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class y extends s{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce((G,pe)=>G+pe.render(k),"")}optimizeNodes(){const{nodes:k}=this;let G=k.length;for(;G--;){const pe=k[G].optimizeNodes();Array.isArray(pe)?k.splice(G,1,...pe):pe?k[G]=pe:k.splice(G,1)}return k.length>0?this:void 0}optimizeNames(k,G){const{nodes:pe}=this;let Q=pe.length;for(;Q--;){const te=pe[Q];te.optimizeNames(k,G)||(L(k,te.names),pe.splice(Q,1))}return pe.length>0?this:void 0}get names(){return this.nodes.reduce((k,G)=>de(k,G.names),{})}}class w extends y{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class v extends y{}class g extends w{}g.kind="else";class _ extends w{constructor(k,G){super(G),this.condition=k}render(k){let G=`if(${this.condition})`+super.render(k);return this.else&&(G+="else "+this.else.render(k)),G}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let G=this.else;if(G){const pe=G.optimizeNodes();G=this.else=Array.isArray(pe)?new g(pe):pe}if(G)return k===!1?G instanceof _?G:G.nodes:this.nodes.length?this:new _(Y(k),G instanceof _?[G]:G.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,G){var pe;if(this.else=(pe=this.else)===null||pe===void 0?void 0:pe.optimizeNames(k,G),!!(super.optimizeNames(k,G)||this.else))return this.condition=j(this.condition,k,G),this}get names(){const k=super.names;return ve(k,this.condition),this.else&&de(k,this.else.names),k}}_.kind="if";class b extends w{}b.kind="for";class S extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,G){if(super.optimizeNames(k,G))return this.iteration=j(this.iteration,k,G),this}get names(){return de(super.names,this.iteration.names)}}class A extends b{constructor(k,G,pe,Q){super(),this.varKind=k,this.name=G,this.from=pe,this.to=Q}render(k){const G=k.es5?r.varKinds.var:this.varKind,{name:pe,from:Q,to:te}=this;return`for(${G} ${pe}=${Q}; ${pe}<${te}; ${pe}++)`+super.render(k)}get names(){const k=ve(super.names,this.from);return ve(k,this.to)}}class O extends b{constructor(k,G,pe,Q){super(),this.loop=k,this.varKind=G,this.name=pe,this.iterable=Q}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,G){if(super.optimizeNames(k,G))return this.iterable=j(this.iterable,k,G),this}get names(){return de(super.names,this.iterable.names)}}class E extends w{constructor(k,G,pe){super(),this.name=k,this.args=G,this.async=pe}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}E.kind="func";class p extends y{render(k){return"return "+super.render(k)}}p.kind="return";class I extends w{render(k){let G="try"+super.render(k);return this.catch&&(G+=this.catch.render(k)),this.finally&&(G+=this.finally.render(k)),G}optimizeNodes(){var k,G;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),(G=this.finally)===null||G===void 0||G.optimizeNodes(),this}optimizeNames(k,G){var pe,Q;return super.optimizeNames(k,G),(pe=this.catch)===null||pe===void 0||pe.optimizeNames(k,G),(Q=this.finally)===null||Q===void 0||Q.optimizeNames(k,G),this}get names(){const k=super.names;return this.catch&&de(k,this.catch.names),this.finally&&de(k,this.finally.names),k}}class N extends w{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}N.kind="catch";class B extends w{render(k){return"finally"+super.render(k)}}B.kind="finally";class V{constructor(k,G={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...G,_n:G.lines?`
95
- `:""},this._extScope=k,this._scope=new r.Scope({parent:k}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,G){const pe=this._extScope.value(k,G);return(this._values[pe.prefix]||(this._values[pe.prefix]=new Set)).add(pe),pe}getScopeValue(k,G){return this._extScope.getValue(k,G)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,G,pe,Q){const te=this._scope.toName(G);return pe!==void 0&&Q&&(this._constants[te.str]=pe),this._leafNode(new a(k,te,pe)),te}const(k,G,pe){return this._def(r.varKinds.const,k,G,pe)}let(k,G,pe){return this._def(r.varKinds.let,k,G,pe)}var(k,G,pe){return this._def(r.varKinds.var,k,G,pe)}assign(k,G,pe){return this._leafNode(new o(k,G,pe))}add(k,G){return this._leafNode(new c(k,t.operators.ADD,G))}code(k){return typeof k=="function"?k():k!==e.nil&&this._leafNode(new m(k)),this}object(...k){const G=["{"];for(const[pe,Q]of k)G.length>1&&G.push(","),G.push(pe),(pe!==Q||this.opts.es5)&&(G.push(":"),(0,e.addCodeArg)(G,Q));return G.push("}"),new e._Code(G)}if(k,G,pe){if(this._blockNode(new _(k)),G&&pe)this.code(G).else().code(pe).endIf();else if(G)this.code(G).endIf();else if(pe)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new _(k))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(k,G){return this._blockNode(k),G&&this.code(G).endFor(),this}for(k,G){return this._for(new S(k),G)}forRange(k,G,pe,Q,te=this.opts.es5?r.varKinds.var:r.varKinds.let){const ce=this._scope.toName(k);return this._for(new A(te,ce,G,pe),()=>Q(ce))}forOf(k,G,pe,Q=r.varKinds.const){const te=this._scope.toName(k);if(this.opts.es5){const ce=G instanceof e.Name?G:this.var("_arr",G);return this.forRange("_i",0,(0,e._)`${ce}.length`,T=>{this.var(te,(0,e._)`${ce}[${T}]`),pe(te)})}return this._for(new O("of",Q,te,G),()=>pe(te))}forIn(k,G,pe,Q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,e._)`Object.keys(${G})`,pe);const te=this._scope.toName(k);return this._for(new O("in",Q,te,G),()=>pe(te))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new u(k))}break(k){return this._leafNode(new f(k))}return(k){const G=new p;if(this._blockNode(G),this.code(k),G.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(p)}try(k,G,pe){if(!G&&!pe)throw new Error('CodeGen: "try" without "catch" and "finally"');const Q=new I;if(this._blockNode(Q),this.code(k),G){const te=this.name("e");this._currNode=Q.catch=new N(te),G(te)}return pe&&(this._currNode=Q.finally=new B,this.code(pe)),this._endBlockNode(N,B)}throw(k){return this._leafNode(new h(k))}block(k,G){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock(G),this}endBlock(k){const G=this._blockStarts.pop();if(G===void 0)throw new Error("CodeGen: not in self-balancing block");const pe=this._nodes.length-G;if(pe<0||k!==void 0&&pe!==k)throw new Error(`CodeGen: wrong number of nodes: ${pe} vs ${k} expected`);return this._nodes.length=G,this}func(k,G=e.nil,pe,Q){return this._blockNode(new E(k,G,pe)),Q&&this.code(Q).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,G){const pe=this._currNode;if(pe instanceof k||G&&pe instanceof G)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${G?`${k.kind}/${G.kind}`:k.kind}"`)}_elseNode(k){const G=this._currNode;if(!(G instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=G.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const G=this._nodes;G[G.length-1]=k}}t.CodeGen=V;function de($,k){for(const G in k)$[G]=($[G]||0)+(k[G]||0);return $}function ve($,k){return k instanceof e._CodeOrName?de($,k.names):$}function j($,k,G){if($ instanceof e.Name)return pe($);if(!Q($))return $;return new e._Code($._items.reduce((te,ce)=>(ce instanceof e.Name&&(ce=pe(ce)),ce instanceof e._Code?te.push(...ce._items):te.push(ce),te),[]));function pe(te){const ce=G[te.str];return ce===void 0||k[te.str]!==1?te:(delete k[te.str],ce)}function Q(te){return te instanceof e._Code&&te._items.some(ce=>ce instanceof e.Name&&k[ce.str]===1&&G[ce.str]!==void 0)}}function L($,k){for(const G in k)$[G]=($[G]||0)-(k[G]||0)}function Y($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,e._)`!${q($)}`}t.not=Y;const ne=M(t.operators.AND);function U(...$){return $.reduce(ne)}t.and=U;const F=M(t.operators.OR);function H(...$){return $.reduce(F)}t.or=H;function M($){return(k,G)=>k===e.nil?G:G===e.nil?k:(0,e._)`${q(k)} ${$} ${q(G)}`}function q($){return $ instanceof e.Name?$:(0,e._)`(${$})`}})(Sr);var dn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const e=Sr,r=Bg;function n(E){const p={};for(const I of E)p[I]=!0;return p}t.toHash=n;function i(E,p){return typeof p=="boolean"?p:Object.keys(p).length===0?!0:(s(E,p),!a(p,E.self.RULES.all))}t.alwaysValidSchema=i;function s(E,p=E.schema){const{opts:I,self:N}=E;if(!I.strictSchema||typeof p=="boolean")return;const B=N.RULES.keywords;for(const V in p)B[V]||O(E,`unknown keyword: "${V}"`)}t.checkUnknownRules=s;function a(E,p){if(typeof E=="boolean")return!E;for(const I in E)if(p[I])return!0;return!1}t.schemaHasRules=a;function o(E,p){if(typeof E=="boolean")return!E;for(const I in E)if(I!=="$ref"&&p.all[I])return!0;return!1}t.schemaHasRulesButRef=o;function c({topSchemaRef:E,schemaPath:p},I,N,B){if(!B){if(typeof I=="number"||typeof I=="boolean")return I;if(typeof I=="string")return(0,e._)`${I}`}return(0,e._)`${E}${p}${(0,e.getProperty)(N)}`}t.schemaRefOrVal=c;function u(E){return m(decodeURIComponent(E))}t.unescapeFragment=u;function f(E){return encodeURIComponent(h(E))}t.escapeFragment=f;function h(E){return typeof E=="number"?`${E}`:E.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=h;function m(E){return E.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=m;function y(E,p){if(Array.isArray(E))for(const I of E)p(I);else p(E)}t.eachItem=y;function w({mergeNames:E,mergeToName:p,mergeValues:I,resultToName:N}){return(B,V,de,ve)=>{const j=de===void 0?V:de instanceof e.Name?(V instanceof e.Name?E(B,V,de):p(B,V,de),de):V instanceof e.Name?(p(B,de,V),V):I(V,de);return ve===e.Name&&!(j instanceof e.Name)?N(B,j):j}}t.mergeEvaluated={props:w({mergeNames:(E,p,I)=>E.if((0,e._)`${I} !== true && ${p} !== undefined`,()=>{E.if((0,e._)`${p} === true`,()=>E.assign(I,!0),()=>E.assign(I,(0,e._)`${I} || {}`).code((0,e._)`Object.assign(${I}, ${p})`))}),mergeToName:(E,p,I)=>E.if((0,e._)`${I} !== true`,()=>{p===!0?E.assign(I,!0):(E.assign(I,(0,e._)`${I} || {}`),g(E,I,p))}),mergeValues:(E,p)=>E===!0?!0:{...E,...p},resultToName:v}),items:w({mergeNames:(E,p,I)=>E.if((0,e._)`${I} !== true && ${p} !== undefined`,()=>E.assign(I,(0,e._)`${p} === true ? true : ${I} > ${p} ? ${I} : ${p}`)),mergeToName:(E,p,I)=>E.if((0,e._)`${I} !== true`,()=>E.assign(I,p===!0?!0:(0,e._)`${I} > ${p} ? ${I} : ${p}`)),mergeValues:(E,p)=>E===!0?!0:Math.max(E,p),resultToName:(E,p)=>E.var("items",p)})};function v(E,p){if(p===!0)return E.var("props",!0);const I=E.var("props",(0,e._)`{}`);return p!==void 0&&g(E,I,p),I}t.evaluatedPropsToName=v;function g(E,p,I){Object.keys(I).forEach(N=>E.assign((0,e._)`${p}${(0,e.getProperty)(N)}`,!0))}t.setEvaluated=g;const _={};function b(E,p){return E.scopeValue("func",{ref:p,code:_[p.code]||(_[p.code]=new r._Code(p.code))})}t.useFunc=b;var S;(function(E){E[E.Num=0]="Num",E[E.Str=1]="Str"})(S=t.Type||(t.Type={}));function A(E,p,I){if(E instanceof e.Name){const N=p===S.Num;return I?N?(0,e._)`"[" + ${E} + "]"`:(0,e._)`"['" + ${E} + "']"`:N?(0,e._)`"/" + ${E}`:(0,e._)`"/" + ${E}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return I?(0,e.getProperty)(E).toString():"/"+h(E)}t.getErrorPath=A;function O(E,p,I=E.opts.strictSchema){if(I){if(p=`strict mode: ${p}`,I===!0)throw new Error(p);E.self.logger.warn(p)}}t.checkStrictMode=O})(dn);var Sc={};Object.defineProperty(Sc,"__esModule",{value:!0});const ws=Sr,Vbe={data:new ws.Name("data"),valCxt:new ws.Name("valCxt"),instancePath:new ws.Name("instancePath"),parentData:new ws.Name("parentData"),parentDataProperty:new ws.Name("parentDataProperty"),rootData:new ws.Name("rootData"),dynamicAnchors:new ws.Name("dynamicAnchors"),vErrors:new ws.Name("vErrors"),errors:new ws.Name("errors"),this:new ws.Name("this"),self:new ws.Name("self"),scope:new ws.Name("scope"),json:new ws.Name("json"),jsonPos:new ws.Name("jsonPos"),jsonLen:new ws.Name("jsonLen"),jsonPart:new ws.Name("jsonPart")};Sc.default=Vbe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=Sr,r=dn,n=Sc;t.keywordError={message:({keyword:g})=>(0,e.str)`must pass "${g}" keyword validation`},t.keyword$DataError={message:({keyword:g,schemaType:_})=>_?(0,e.str)`"${g}" keyword must be ${_} ($data)`:(0,e.str)`"${g}" keyword is invalid ($data)`};function i(g,_=t.keywordError,b,S){const{it:A}=g,{gen:O,compositeRule:E,allErrors:p}=A,I=h(g,_,b);S??(E||p)?c(O,I):u(A,(0,e._)`[${I}]`)}t.reportError=i;function s(g,_=t.keywordError,b){const{it:S}=g,{gen:A,compositeRule:O,allErrors:E}=S,p=h(g,_,b);c(A,p),O||E||u(S,n.default.vErrors)}t.reportExtraError=s;function a(g,_){g.assign(n.default.errors,_),g.if((0,e._)`${n.default.vErrors} !== null`,()=>g.if(_,()=>g.assign((0,e._)`${n.default.vErrors}.length`,_),()=>g.assign(n.default.vErrors,null)))}t.resetErrorsCount=a;function o({gen:g,keyword:_,schemaValue:b,data:S,errsCount:A,it:O}){if(A===void 0)throw new Error("ajv implementation error");const E=g.name("err");g.forRange("i",A,n.default.errors,p=>{g.const(E,(0,e._)`${n.default.vErrors}[${p}]`),g.if((0,e._)`${E}.instancePath === undefined`,()=>g.assign((0,e._)`${E}.instancePath`,(0,e.strConcat)(n.default.instancePath,O.errorPath))),g.assign((0,e._)`${E}.schemaPath`,(0,e.str)`${O.errSchemaPath}/${_}`),O.opts.verbose&&(g.assign((0,e._)`${E}.schema`,b),g.assign((0,e._)`${E}.data`,S))})}t.extendErrors=o;function c(g,_){const b=g.const("err",_);g.if((0,e._)`${n.default.vErrors} === null`,()=>g.assign(n.default.vErrors,(0,e._)`[${b}]`),(0,e._)`${n.default.vErrors}.push(${b})`),g.code((0,e._)`${n.default.errors}++`)}function u(g,_){const{gen:b,validateName:S,schemaEnv:A}=g;A.$async?b.throw((0,e._)`new ${g.ValidationError}(${_})`):(b.assign((0,e._)`${S}.errors`,_),b.return(!1))}const f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(g,_,b){const{createErrors:S}=g.it;return S===!1?(0,e._)`{}`:m(g,_,b)}function m(g,_,b={}){const{gen:S,it:A}=g,O=[y(A,b),w(g,b)];return v(g,_,O),S.object(...O)}function y({errorPath:g},{instancePath:_}){const b=_?(0,e.str)`${g}${(0,r.getErrorPath)(_,r.Type.Str)}`:g;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,b)]}function w({keyword:g,it:{errSchemaPath:_}},{schemaPath:b,parentSchema:S}){let A=S?_:(0,e.str)`${_}/${g}`;return b&&(A=(0,e.str)`${A}${(0,r.getErrorPath)(b,r.Type.Str)}`),[f.schemaPath,A]}function v(g,{params:_,message:b},S){const{keyword:A,data:O,schemaValue:E,it:p}=g,{opts:I,propertyName:N,topSchemaRef:B,schemaPath:V}=p;S.push([f.keyword,A],[f.params,typeof _=="function"?_(g):_||(0,e._)`{}`]),I.messages&&S.push([f.message,typeof b=="function"?b(g):b]),I.verbose&&S.push([f.schema,E],[f.parentSchema,(0,e._)`${B}${V}`],[n.default.data,O]),N&&S.push([f.propertyName,N])}})(um);Object.defineProperty(jg,"__esModule",{value:!0});jg.boolOrEmptySchema=jg.topBoolOrEmptySchema=void 0;const Gbe=um,Kbe=Sr,Wbe=Sc,Ybe={message:"boolean schema is false"};function Qbe(t){const{gen:e,schema:r,validateName:n}=t;r===!1?MJ(t,!1):typeof r=="object"&&r.$async===!0?e.return(Wbe.default.data):(e.assign((0,Kbe._)`${n}.errors`,null),e.return(!0))}jg.topBoolOrEmptySchema=Qbe;function Jbe(t,e){const{gen:r,schema:n}=t;n===!1?(r.var(e,!1),MJ(t)):r.var(e,!0)}jg.boolOrEmptySchema=Jbe;function MJ(t,e){const{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Gbe.reportError)(i,Ybe,void 0,e)}var O1={},kh={};Object.defineProperty(kh,"__esModule",{value:!0});kh.getRules=kh.isJSONType=void 0;const Xbe=["string","number","integer","boolean","null","object","array"],Zbe=new Set(Xbe);function e1e(t){return typeof t=="string"&&Zbe.has(t)}kh.isJSONType=e1e;function t1e(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}kh.getRules=t1e;var ol={};Object.defineProperty(ol,"__esModule",{value:!0});ol.shouldUseRule=ol.shouldUseGroup=ol.schemaHasRulesForType=void 0;function r1e({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==!0&&kJ(t,n)}ol.schemaHasRulesForType=r1e;function kJ(t,e){return e.rules.some(r=>$J(t,r))}ol.shouldUseGroup=kJ;function $J(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ol.shouldUseRule=$J;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const e=kh,r=ol,n=um,i=Sr,s=dn;var a;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(a=t.DataType||(t.DataType={}));function o(S){const A=c(S.type);if(A.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!A.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&A.push("null")}return A}t.getSchemaTypes=o;function c(S){const A=Array.isArray(S)?S:S?[S]:[];if(A.every(e.isJSONType))return A;throw new Error("type must be JSONType or JSONType[]: "+A.join(","))}t.getJSONTypes=c;function u(S,A){const{gen:O,data:E,opts:p}=S,I=h(A,p.coerceTypes),N=A.length>0&&!(I.length===0&&A.length===1&&(0,r.schemaHasRulesForType)(S,A[0]));if(N){const B=v(A,E,p.strictNumbers,a.Wrong);O.if(B,()=>{I.length?m(S,A,I):_(S)})}return N}t.coerceAndCheckDataType=u;const f=new Set(["string","number","integer","boolean","null"]);function h(S,A){return A?S.filter(O=>f.has(O)||A==="array"&&O==="array"):[]}function m(S,A,O){const{gen:E,data:p,opts:I}=S,N=E.let("dataType",(0,i._)`typeof ${p}`),B=E.let("coerced",(0,i._)`undefined`);I.coerceTypes==="array"&&E.if((0,i._)`${N} == 'object' && Array.isArray(${p}) && ${p}.length == 1`,()=>E.assign(p,(0,i._)`${p}[0]`).assign(N,(0,i._)`typeof ${p}`).if(v(A,p,I.strictNumbers),()=>E.assign(B,p))),E.if((0,i._)`${B} !== undefined`);for(const de of O)(f.has(de)||de==="array"&&I.coerceTypes==="array")&&V(de);E.else(),_(S),E.endIf(),E.if((0,i._)`${B} !== undefined`,()=>{E.assign(p,B),y(S,B)});function V(de){switch(de){case"string":E.elseIf((0,i._)`${N} == "number" || ${N} == "boolean"`).assign(B,(0,i._)`"" + ${p}`).elseIf((0,i._)`${p} === null`).assign(B,(0,i._)`""`);return;case"number":E.elseIf((0,i._)`${N} == "boolean" || ${p} === null
96
- || (${N} == "string" && ${p} && ${p} == +${p})`).assign(B,(0,i._)`+${p}`);return;case"integer":E.elseIf((0,i._)`${N} === "boolean" || ${p} === null
97
- || (${N} === "string" && ${p} && ${p} == +${p} && !(${p} % 1))`).assign(B,(0,i._)`+${p}`);return;case"boolean":E.elseIf((0,i._)`${p} === "false" || ${p} === 0 || ${p} === null`).assign(B,!1).elseIf((0,i._)`${p} === "true" || ${p} === 1`).assign(B,!0);return;case"null":E.elseIf((0,i._)`${p} === "" || ${p} === 0 || ${p} === false`),E.assign(B,null);return;case"array":E.elseIf((0,i._)`${N} === "string" || ${N} === "number"
98
- || ${N} === "boolean" || ${p} === null`).assign(B,(0,i._)`[${p}]`)}}}function y({gen:S,parentData:A,parentDataProperty:O},E){S.if((0,i._)`${A} !== undefined`,()=>S.assign((0,i._)`${A}[${O}]`,E))}function w(S,A,O,E=a.Correct){const p=E===a.Correct?i.operators.EQ:i.operators.NEQ;let I;switch(S){case"null":return(0,i._)`${A} ${p} null`;case"array":I=(0,i._)`Array.isArray(${A})`;break;case"object":I=(0,i._)`${A} && typeof ${A} == "object" && !Array.isArray(${A})`;break;case"integer":I=N((0,i._)`!(${A} % 1) && !isNaN(${A})`);break;case"number":I=N();break;default:return(0,i._)`typeof ${A} ${p} ${S}`}return E===a.Correct?I:(0,i.not)(I);function N(B=i.nil){return(0,i.and)((0,i._)`typeof ${A} == "number"`,B,O?(0,i._)`isFinite(${A})`:i.nil)}}t.checkDataType=w;function v(S,A,O,E){if(S.length===1)return w(S[0],A,O,E);let p;const I=(0,s.toHash)(S);if(I.array&&I.object){const N=(0,i._)`typeof ${A} != "object"`;p=I.null?N:(0,i._)`!${A} || ${N}`,delete I.null,delete I.array,delete I.object}else p=i.nil;I.number&&delete I.integer;for(const N in I)p=(0,i.and)(p,w(N,A,O,E));return p}t.checkDataTypes=v;const g={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:A})=>typeof S=="string"?(0,i._)`{type: ${S}}`:(0,i._)`{type: ${A}}`};function _(S){const A=b(S);(0,n.reportError)(A,g)}t.reportTypeError=_;function b(S){const{gen:A,data:O,schema:E}=S,p=(0,s.schemaRefOrVal)(S,E,"type");return{gen:A,keyword:"type",data:O,schema:E.type,schemaCode:p,schemaValue:p,parentSchema:E,params:{},it:S}}})(O1);var F2={};Object.defineProperty(F2,"__esModule",{value:!0});F2.assignDefaults=void 0;const Np=Sr,n1e=dn;function i1e(t,e){const{properties:r,items:n}=t.schema;if(e==="object"&&r)for(const i in r)bq(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>bq(t,s,i.default))}F2.assignDefaults=i1e;function bq(t,e,r){const{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;const o=(0,Np._)`${s}${(0,Np.getProperty)(e)}`;if(i){(0,n1e.checkStrictMode)(t,`default is ignored for: ${o}`);return}let c=(0,Np._)`${o} === undefined`;a.useDefaults==="empty"&&(c=(0,Np._)`${c} || ${o} === null || ${o} === ""`),n.if(c,(0,Np._)`${o} = ${(0,Np.stringify)(r)}`)}var Jc={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.validateUnion=Kr.validateArray=Kr.usePattern=Kr.callValidateCode=Kr.schemaProperties=Kr.allSchemaProperties=Kr.noPropertyInData=Kr.propertyInData=Kr.isOwnProperty=Kr.hasPropFunc=Kr.reportMissingProp=Kr.checkMissingProp=Kr.checkReportMissingProp=void 0;const Wn=Sr,u4=dn,Hl=Sc,s1e=dn;function a1e(t,e){const{gen:r,data:n,it:i}=t;r.if(f4(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Wn._)`${e}`},!0),t.error()})}Kr.checkReportMissingProp=a1e;function o1e({gen:t,data:e,it:{opts:r}},n,i){return(0,Wn.or)(...n.map(s=>(0,Wn.and)(f4(t,e,s,r.ownProperties),(0,Wn._)`${i} = ${s}`)))}Kr.checkMissingProp=o1e;function c1e(t,e){t.setParams({missingProperty:e},!0),t.error()}Kr.reportMissingProp=c1e;function LJ(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Wn._)`Object.prototype.hasOwnProperty`})}Kr.hasPropFunc=LJ;function l4(t,e,r){return(0,Wn._)`${LJ(t)}.call(${e}, ${r})`}Kr.isOwnProperty=l4;function u1e(t,e,r,n){const i=(0,Wn._)`${e}${(0,Wn.getProperty)(r)} !== undefined`;return n?(0,Wn._)`${i} && ${l4(t,e,r)}`:i}Kr.propertyInData=u1e;function f4(t,e,r,n){const i=(0,Wn._)`${e}${(0,Wn.getProperty)(r)} === undefined`;return n?(0,Wn.or)(i,(0,Wn.not)(l4(t,e,r))):i}Kr.noPropertyInData=f4;function UJ(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Kr.allSchemaProperties=UJ;function l1e(t,e){return UJ(e).filter(r=>!(0,u4.alwaysValidSchema)(t,e[r]))}Kr.schemaProperties=l1e;function f1e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},o,c,u){const f=u?(0,Wn._)`${t}, ${e}, ${n}${i}`:e,h=[[Hl.default.instancePath,(0,Wn.strConcat)(Hl.default.instancePath,s)],[Hl.default.parentData,a.parentData],[Hl.default.parentDataProperty,a.parentDataProperty],[Hl.default.rootData,Hl.default.rootData]];a.opts.dynamicRef&&h.push([Hl.default.dynamicAnchors,Hl.default.dynamicAnchors]);const m=(0,Wn._)`${f}, ${r.object(...h)}`;return c!==Wn.nil?(0,Wn._)`${o}.call(${c}, ${m})`:(0,Wn._)`${o}(${m})`}Kr.callValidateCode=f1e;const d1e=(0,Wn._)`new RegExp`;function h1e({gen:t,it:{opts:e}},r){const n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Wn._)`${i.code==="new RegExp"?d1e:(0,s1e.useFunc)(t,i)}(${r}, ${n})`})}Kr.usePattern=h1e;function p1e(t){const{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){const o=e.let("valid",!0);return a(()=>e.assign(o,!1)),o}return e.var(s,!0),a(()=>e.break()),s;function a(o){const c=e.const("len",(0,Wn._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:u4.Type.Num},s),e.if((0,Wn.not)(s),o)})}}Kr.validateArray=p1e;function g1e(t){const{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,u4.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;const a=e.let("valid",!1),o=e.name("_valid");e.block(()=>r.forEach((c,u)=>{const f=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},o);e.assign(a,(0,Wn._)`${a} || ${o}`),t.mergeValidEvaluated(f,o)||e.if((0,Wn.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}Kr.validateUnion=g1e;Object.defineProperty(Jc,"__esModule",{value:!0});Jc.validateKeywordUsage=Jc.validSchemaType=Jc.funcKeywordCode=Jc.macroKeywordCode=void 0;const zs=Sr,Ud=Sc,m1e=Kr,y1e=um;function v1e(t,e){const{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,o=e.macro.call(a.self,i,s,a),c=jJ(r,n,o);a.opts.validateSchema!==!1&&a.self.validateSchema(o,!0);const u=r.name("valid");t.subschema({schema:o,schemaPath:zs.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Jc.macroKeywordCode=v1e;function b1e(t,e){var r;const{gen:n,keyword:i,schema:s,parentSchema:a,$data:o,it:c}=t;_1e(c,e);const u=!o&&e.compile?e.compile.call(c.self,s,a,c):e.validate,f=jJ(n,i,u),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)v(),e.modifying&&wq(t),g(()=>t.error());else{const _=e.async?y():w();e.modifying&&wq(t),g(()=>w1e(t,_))}}function y(){const _=n.let("ruleErrs",null);return n.try(()=>v((0,zs._)`await `),b=>n.assign(h,!1).if((0,zs._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,zs._)`${b}.errors`),()=>n.throw(b))),_}function w(){const _=(0,zs._)`${f}.errors`;return n.assign(_,null),v(zs.nil),_}function v(_=e.async?(0,zs._)`await `:zs.nil){const b=c.opts.passContext?Ud.default.this:Ud.default.self,S=!("compile"in e&&!o||e.schema===!1);n.assign(h,(0,zs._)`${_}${(0,m1e.callValidateCode)(t,f,b,S)}`,e.modifying)}function g(_){var b;n.if((0,zs.not)((b=e.valid)!==null&&b!==void 0?b:h),_)}}Jc.funcKeywordCode=b1e;function wq(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,zs._)`${n.parentData}[${n.parentDataProperty}]`))}function w1e(t,e){const{gen:r}=t;r.if((0,zs._)`Array.isArray(${e})`,()=>{r.assign(Ud.default.vErrors,(0,zs._)`${Ud.default.vErrors} === null ? ${e} : ${Ud.default.vErrors}.concat(${e})`).assign(Ud.default.errors,(0,zs._)`${Ud.default.vErrors}.length`),(0,y1e.extendErrors)(t)},()=>t.error())}function _1e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function jJ(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,zs.stringify)(r)})}function E1e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Jc.validSchemaType=E1e;function x1e({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");const a=i.dependencies;if(a!=null&&a.some(o=>!Object.prototype.hasOwnProperty.call(t,o)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){const c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Jc.validateKeywordUsage=x1e;var Mf={};Object.defineProperty(Mf,"__esModule",{value:!0});Mf.extendSubschemaMode=Mf.extendSubschemaData=Mf.getSubschema=void 0;const Kc=Sr,BJ=dn;function A1e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const o=t.schema[e];return r===void 0?{schema:o,schemaPath:(0,Kc._)`${t.schemaPath}${(0,Kc.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:o[r],schemaPath:(0,Kc._)`${t.schemaPath}${(0,Kc.getProperty)(e)}${(0,Kc.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,BJ.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Mf.getSubschema=A1e;function S1e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:o}=e;if(r!==void 0){const{errorPath:u,dataPathArr:f,opts:h}=e,m=o.let("data",(0,Kc._)`${e.data}${(0,Kc.getProperty)(r)}`,!0);c(m),t.errorPath=(0,Kc.str)`${u}${(0,BJ.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Kc._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(i!==void 0){const u=i instanceof Kc.Name?i:o.let("data",i,!0);c(u),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Mf.extendSubschemaData=S1e;function O1e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Mf.extendSubschemaMode=O1e;var us={},d4=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},FJ={exports:{}},Ef=FJ.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};tE(e,n,i,t,"",t)};Ef.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ef.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ef.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ef.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tE(t,e,r,n,i,s,a,o,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,o,c,u);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in Ef.arrayKeywords)for(var m=0;m<h.length;m++)tE(t,e,r,h[m],i+"/"+f+"/"+m,s,i,f,n,m)}else if(f in Ef.propsKeywords){if(h&&typeof h=="object")for(var y in h)tE(t,e,r,h[y],i+"/"+f+"/"+I1e(y),s,i,f,n,y)}else(f in Ef.keywords||t.allKeys&&!(f in Ef.skipKeywords))&&tE(t,e,r,h,i+"/"+f,s,i,f,n)}r(n,i,s,a,o,c,u)}}function I1e(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var P1e=FJ.exports;Object.defineProperty(us,"__esModule",{value:!0});us.getSchemaRefs=us.resolveUrl=us.normalizeId=us._getFullPath=us.getFullPath=us.inlineRef=void 0;const T1e=dn,C1e=d4,R1e=P1e,N1e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function D1e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!TN(t):e?qJ(t)<=e:!1}us.inlineRef=D1e;const M1e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function TN(t){for(const e in t){if(M1e.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(TN)||typeof r=="object"&&TN(r))return!0}return!1}function qJ(t){let e=0;for(const r in t){if(r==="$ref")return 1/0;if(e++,!N1e.has(r)&&(typeof t[r]=="object"&&(0,T1e.eachItem)(t[r],n=>e+=qJ(n)),e===1/0))return 1/0}return e}function HJ(t,e="",r){r!==!1&&(e=O0(e));const n=t.parse(e);return zJ(t,n)}us.getFullPath=HJ;function zJ(t,e){return t.serialize(e).split("#")[0]+"#"}us._getFullPath=zJ;const k1e=/#\/?$/;function O0(t){return t?t.replace(k1e,""):""}us.normalizeId=O0;function $1e(t,e,r){return r=O0(r),t.resolve(e,r)}us.resolveUrl=$1e;const L1e=/^[a-z_][-a-z0-9._]*$/i;function U1e(t,e){if(typeof t=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,i=O0(t[r]||e),s={"":i},a=HJ(n,i,!1),o={},c=new Set;return R1e(t,{allKeys:!0},(h,m,y,w)=>{if(w===void 0)return;const v=a+m;let g=s[w];typeof h[r]=="string"&&(g=_.call(this,h[r])),b.call(this,h.$anchor),b.call(this,h.$dynamicAnchor),s[m]=g;function _(S){const A=this.opts.uriResolver.resolve;if(S=O0(g?A(g,S):S),c.has(S))throw f(S);c.add(S);let O=this.refs[S];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?u(h,O.schema,S):S!==O0(v)&&(S[0]==="#"?(u(h,o[S],S),o[S]=h):this.refs[S]=v),S}function b(S){if(typeof S=="string"){if(!L1e.test(S))throw new Error(`invalid anchor "${S}"`);_.call(this,`#${S}`)}}}),o;function u(h,m,y){if(m!==void 0&&!C1e(h,m))throw f(y)}function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}}us.getSchemaRefs=U1e;Object.defineProperty(To,"__esModule",{value:!0});To.getData=To.KeywordCxt=To.validateFunctionCode=void 0;const VJ=jg,_q=O1,h4=ol,ix=O1,j1e=F2,Lv=Jc,WT=Mf,er=Sr,xr=Sc,B1e=us,cl=dn,Oy=um;function F1e(t){if(WJ(t)&&(YJ(t),KJ(t))){z1e(t);return}GJ(t,()=>(0,VJ.topBoolOrEmptySchema)(t))}To.validateFunctionCode=F1e;function GJ({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,er._)`${xr.default.data}, ${xr.default.valCxt}`,n.$async,()=>{t.code((0,er._)`"use strict"; ${Eq(r,i)}`),H1e(t,i),t.code(s)}):t.func(e,(0,er._)`${xr.default.data}, ${q1e(i)}`,n.$async,()=>t.code(Eq(r,i)).code(s))}function q1e(t){return(0,er._)`{${xr.default.instancePath}="", ${xr.default.parentData}, ${xr.default.parentDataProperty}, ${xr.default.rootData}=${xr.default.data}${t.dynamicRef?(0,er._)`, ${xr.default.dynamicAnchors}={}`:er.nil}}={}`}function H1e(t,e){t.if(xr.default.valCxt,()=>{t.var(xr.default.instancePath,(0,er._)`${xr.default.valCxt}.${xr.default.instancePath}`),t.var(xr.default.parentData,(0,er._)`${xr.default.valCxt}.${xr.default.parentData}`),t.var(xr.default.parentDataProperty,(0,er._)`${xr.default.valCxt}.${xr.default.parentDataProperty}`),t.var(xr.default.rootData,(0,er._)`${xr.default.valCxt}.${xr.default.rootData}`),e.dynamicRef&&t.var(xr.default.dynamicAnchors,(0,er._)`${xr.default.valCxt}.${xr.default.dynamicAnchors}`)},()=>{t.var(xr.default.instancePath,(0,er._)`""`),t.var(xr.default.parentData,(0,er._)`undefined`),t.var(xr.default.parentDataProperty,(0,er._)`undefined`),t.var(xr.default.rootData,xr.default.data),e.dynamicRef&&t.var(xr.default.dynamicAnchors,(0,er._)`{}`)})}function z1e(t){const{schema:e,opts:r,gen:n}=t;GJ(t,()=>{r.$comment&&e.$comment&&JJ(t),Y1e(t),n.let(xr.default.vErrors,null),n.let(xr.default.errors,0),r.unevaluated&&V1e(t),QJ(t),X1e(t)})}function V1e(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,er._)`${r}.evaluated`),e.if((0,er._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,er._)`${t.evaluated}.props`,(0,er._)`undefined`)),e.if((0,er._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,er._)`${t.evaluated}.items`,(0,er._)`undefined`))}function Eq(t,e){const r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,er._)`/*# sourceURL=${r} */`:er.nil}function G1e(t,e){if(WJ(t)&&(YJ(t),KJ(t))){K1e(t,e);return}(0,VJ.boolOrEmptySchema)(t,e)}function KJ({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function WJ(t){return typeof t.schema!="boolean"}function K1e(t,e){const{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&JJ(t),Q1e(t),J1e(t);const s=n.const("_errs",xr.default.errors);QJ(t,s),n.var(e,(0,er._)`${s} === ${xr.default.errors}`)}function YJ(t){(0,cl.checkUnknownRules)(t),W1e(t)}function QJ(t,e){if(t.opts.jtd)return xq(t,[],!1,e);const r=(0,_q.getSchemaTypes)(t.schema),n=(0,_q.coerceAndCheckDataType)(t,r);xq(t,r,!n,e)}function W1e(t){const{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,cl.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Y1e(t){const{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,cl.checkStrictMode)(t,"default is ignored in the schema root")}function Q1e(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,B1e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function J1e(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function JJ({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){const s=r.$comment;if(i.$comment===!0)t.code((0,er._)`${xr.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){const a=(0,er.str)`${n}/$comment`,o=t.scopeValue("root",{ref:e.root});t.code((0,er._)`${xr.default.self}.opts.$comment(${s}, ${a}, ${o}.schema)`)}}function X1e(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,er._)`${xr.default.errors} === 0`,()=>e.return(xr.default.data),()=>e.throw((0,er._)`new ${i}(${xr.default.vErrors})`)):(e.assign((0,er._)`${n}.errors`,xr.default.vErrors),s.unevaluated&&Z1e(t),e.return((0,er._)`${xr.default.errors} === 0`))}function Z1e({gen:t,evaluated:e,props:r,items:n}){r instanceof er.Name&&t.assign((0,er._)`${e}.props`,r),n instanceof er.Name&&t.assign((0,er._)`${e}.items`,n)}function xq(t,e,r,n){const{gen:i,schema:s,data:a,allErrors:o,opts:c,self:u}=t,{RULES:f}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,cl.schemaHasRulesButRef)(s,f))){i.block(()=>eX(t,"$ref",f.all.$ref.definition));return}c.jtd||ewe(t,e),i.block(()=>{for(const m of f.rules)h(m);h(f.post)});function h(m){(0,h4.shouldUseGroup)(s,m)&&(m.type?(i.if((0,ix.checkDataType)(m.type,a,c.strictNumbers)),Aq(t,m),e.length===1&&e[0]===m.type&&r&&(i.else(),(0,ix.reportTypeError)(t)),i.endIf()):Aq(t,m),o||i.if((0,er._)`${xr.default.errors} === ${n||0}`))}}function Aq(t,e){const{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,j1e.assignDefaults)(t,e.type),r.block(()=>{for(const s of e.rules)(0,h4.shouldUseRule)(n,s)&&eX(t,s.keyword,s.definition,e.type)})}function ewe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(twe(t,e),t.opts.allowUnionTypes||rwe(t,e),nwe(t,t.dataTypes))}function twe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{XJ(t.dataTypes,r)||p4(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),swe(t,e)}}function rwe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&p4(t,"use allowUnionTypes to allow union type keyword")}function nwe(t,e){const r=t.self.RULES.all;for(const n in r){const i=r[n];if(typeof i=="object"&&(0,h4.shouldUseRule)(t.schema,i)){const{type:s}=i.definition;s.length&&!s.some(a=>iwe(e,a))&&p4(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function iwe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function XJ(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function swe(t,e){const r=[];for(const n of t.dataTypes)XJ(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function p4(t,e){const r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,cl.checkStrictMode)(t,e,t.opts.strictTypes)}class ZJ{constructor(e,r,n){if((0,Lv.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,cl.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",tX(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Lv.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",xr.default.errors))}result(e,r,n){this.failResult((0,er.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,er.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:r}=this;this.fail((0,er._)`${r} !== undefined && (${(0,er.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Oy.reportExtraError:Oy.reportError)(this,this.def.error,r)}$dataError(){(0,Oy.reportError)(this,this.def.$dataError||Oy.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Oy.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=er.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=er.nil,r=er.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,er.or)((0,er._)`${i} === undefined`,r)),e!==er.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==er.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,er.or)(a(),o());function a(){if(n.length){if(!(r instanceof er.Name))throw new Error("ajv implementation error");const c=Array.isArray(n)?n:[n];return(0,er._)`${(0,ix.checkDataTypes)(c,r,s.opts.strictNumbers,ix.DataType.Wrong)}`}return er.nil}function o(){if(i.validateSchema){const c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,er._)`!${c}(${r})`}return er.nil}}subschema(e,r){const n=(0,WT.getSubschema)(this.it,e);(0,WT.extendSubschemaData)(n,this.it,e),(0,WT.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};return G1e(i,r),i}mergeEvaluated(e,r){const{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=cl.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=cl.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,er.Name)),!0}}To.KeywordCxt=ZJ;function eX(t,e,r,n){const i=new ZJ(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Lv.funcKeywordCode)(i,r):"macro"in r?(0,Lv.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Lv.funcKeywordCode)(i,r)}const awe=/^\/(?:[^~]|~0|~1)*$/,owe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function tX(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return xr.default.rootData;if(t[0]==="/"){if(!awe.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=xr.default.rootData}else{const u=owe.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);const f=+u[1];if(i=u[2],i==="#"){if(f>=e)throw new Error(c("property/index",f));return n[e-f]}if(f>e)throw new Error(c("data",f));if(s=r[e-f],!i)return s}let a=s;const o=i.split("/");for(const u of o)u&&(s=(0,er._)`${s}${(0,er.getProperty)((0,cl.unescapeJsonPointer)(u))}`,a=(0,er._)`${a} && ${s}`);return a;function c(u,f){return`Cannot access ${u} ${f} levels up, current level is ${e}`}}To.getData=tX;var I1={};Object.defineProperty(I1,"__esModule",{value:!0});class cwe extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}I1.default=cwe;var P1={};Object.defineProperty(P1,"__esModule",{value:!0});const YT=us;class uwe extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,YT.resolveUrl)(e,r,n),this.missingSchema=(0,YT.normalizeId)((0,YT.getFullPath)(e,this.missingRef))}}P1.default=uwe;var va={};Object.defineProperty(va,"__esModule",{value:!0});va.resolveSchema=va.getCompilingSchema=va.resolveRef=va.compileSchema=va.SchemaEnv=void 0;const Yo=Sr,lwe=I1,Od=Sc,pc=us,Sq=dn,fwe=To;class q2{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,pc.normalizeId)(n==null?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}va.SchemaEnv=q2;function g4(t){const e=rX.call(this,t);if(e)return e;const r=(0,pc.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Yo.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s});let o;t.$async&&(o=a.scopeValue("Error",{ref:lwe.default,code:(0,Yo._)`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");t.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Od.default.data,parentData:Od.default.parentData,parentDataProperty:Od.default.parentDataProperty,dataNames:[Od.default.data],dataPathArr:[Yo.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Yo.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:o,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Yo.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Yo._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(t),(0,fwe.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const h=a.toString();f=`${a.scopeRefs(Od.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));const y=new Function(`${Od.default.self}`,`${Od.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:y}),y.errors=null,y.schema=t.schema,y.schemaEnv=t,t.$async&&(y.$async=!0),this.opts.code.source===!0&&(y.source={validateName:c,validateCode:h,scopeValues:a._values}),this.opts.unevaluated){const{props:w,items:v}=u;y.evaluated={props:w instanceof Yo.Name?void 0:w,items:v instanceof Yo.Name?void 0:v,dynamicProps:w instanceof Yo.Name,dynamicItems:v instanceof Yo.Name},y.source&&(y.source.evaluated=(0,Yo.stringify)(y.evaluated))}return t.validate=y,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}va.compileSchema=g4;function dwe(t,e,r){var n;r=(0,pc.resolveUrl)(this.opts.uriResolver,e,r);const i=t.refs[r];if(i)return i;let s=gwe.call(this,t,r);if(s===void 0){const a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:o}=this.opts;a&&(s=new q2({schema:a,schemaId:o,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=hwe.call(this,s)}va.resolveRef=dwe;function hwe(t){return(0,pc.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:g4.call(this,t)}function rX(t){for(const e of this._compilations)if(pwe(e,t))return e}va.getCompilingSchema=rX;function pwe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function gwe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||H2.call(this,t,e)}function H2(t,e){const r=this.opts.uriResolver.parse(e),n=(0,pc._getFullPath)(this.opts.uriResolver,r);let i=(0,pc.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return QT.call(this,r,t);const s=(0,pc.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){const o=H2.call(this,t,a);return typeof(o==null?void 0:o.schema)!="object"?void 0:QT.call(this,r,o)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||g4.call(this,a),s===(0,pc.normalizeId)(e)){const{schema:o}=a,{schemaId:c}=this.opts,u=o[c];return u&&(i=(0,pc.resolveUrl)(this.opts.uriResolver,i,u)),new q2({schema:o,schemaId:c,root:t,baseId:i})}return QT.call(this,r,a)}}va.resolveSchema=H2;const mwe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function QT(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const o of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const c=r[(0,Sq.unescapeFragment)(o)];if(c===void 0)return;r=c;const u=typeof r=="object"&&r[this.opts.schemaId];!mwe.has(o)&&u&&(e=(0,pc.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Sq.schemaHasRulesButRef)(r,this.RULES)){const o=(0,pc.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=H2.call(this,n,o)}const{schemaId:a}=this.opts;if(s=s||new q2({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}const ywe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",vwe="Meta-schema for $data reference (JSON AnySchema extension proposal)",bwe="object",wwe=["$data"],_we={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ewe=!1,xwe={$id:ywe,description:vwe,type:bwe,required:wwe,properties:_we,additionalProperties:Ewe};var m4={},CN={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,n){n(e)})($e,function(r){function n(){for(var ue=arguments.length,Z=Array(ue),ge=0;ge<ue;ge++)Z[ge]=arguments[ge];if(Z.length>1){Z[0]=Z[0].slice(0,-1);for(var Me=Z.length-1,Le=1;Le<Me;++Le)Z[Le]=Z[Le].slice(1,-1);return Z[Me]=Z[Me].slice(1),Z.join("")}else return Z[0]}function i(ue){return"(?:"+ue+")"}function s(ue){return ue===void 0?"undefined":ue===null?"null":Object.prototype.toString.call(ue).split(" ").pop().split("]").shift().toLowerCase()}function a(ue){return ue.toUpperCase()}function o(ue){return ue!=null?ue instanceof Array?ue:typeof ue.length!="number"||ue.split||ue.setInterval||ue.call?[ue]:Array.prototype.slice.call(ue):[]}function c(ue,Z){var ge=ue;if(Z)for(var Me in Z)ge[Me]=Z[Me];return ge}function u(ue){var Z="[A-Za-z]",ge="[0-9]",Me=n(ge,"[A-Fa-f]"),Le=i(i("%[EFef]"+Me+"%"+Me+Me+"%"+Me+Me)+"|"+i("%[89A-Fa-f]"+Me+"%"+Me+Me)+"|"+i("%"+Me+Me)),wt="[\\:\\/\\?\\#\\[\\]\\@]",St="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",pr=n(wt,St),lr=ue?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",Xr=ue?"[\\uE000-\\uF8FF]":"[]",gr=n(Z,ge,"[\\-\\.\\_\\~]",lr);i(Z+n(Z,ge,"[\\+\\-\\.]")+"*"),i(i(Le+"|"+n(gr,St,"[\\:]"))+"*");var br=i(i("25[0-5]")+"|"+i("2[0-4]"+ge)+"|"+i("1"+ge+ge)+"|"+i("0?[1-9]"+ge)+"|0?0?"+ge),nn=i(br+"\\."+br+"\\."+br+"\\."+br),or=i(Me+"{1,4}"),$r=i(i(or+"\\:"+or)+"|"+nn),hn=i(i(or+"\\:")+"{6}"+$r),Lr=i("\\:\\:"+i(or+"\\:")+"{5}"+$r),Qn=i(i(or)+"?\\:\\:"+i(or+"\\:")+"{4}"+$r),xi=i(i(i(or+"\\:")+"{0,1}"+or)+"?\\:\\:"+i(or+"\\:")+"{3}"+$r),Jn=i(i(i(or+"\\:")+"{0,2}"+or)+"?\\:\\:"+i(or+"\\:")+"{2}"+$r),Ai=i(i(i(or+"\\:")+"{0,3}"+or)+"?\\:\\:"+or+"\\:"+$r),Si=i(i(i(or+"\\:")+"{0,4}"+or)+"?\\:\\:"+$r),ni=i(i(i(or+"\\:")+"{0,5}"+or)+"?\\:\\:"+or),Un=i(i(i(or+"\\:")+"{0,6}"+or)+"?\\:\\:"),Ji=i([hn,Lr,Qn,xi,Jn,Ai,Si,ni,Un].join("|")),Ni=i(i(gr+"|"+Le)+"+");i("[vV]"+Me+"+\\."+n(gr,St,"[\\:]")+"+"),i(i(Le+"|"+n(gr,St))+"*");var ms=i(Le+"|"+n(gr,St,"[\\:\\@]"));return i(i(Le+"|"+n(gr,St,"[\\@]"))+"+"),i(i(ms+"|"+n("[\\/\\?]",Xr))+"*"),{NOT_SCHEME:new RegExp(n("[^]",Z,ge,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",gr,St),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",gr,St),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",gr,St),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",gr,St),"g"),NOT_QUERY:new RegExp(n("[^\\%]",gr,St,"[\\:\\@\\/\\?]",Xr),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",gr,St,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",gr,St),"g"),UNRESERVED:new RegExp(gr,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",gr,pr),"g"),PCT_ENCODED:new RegExp(Le,"g"),IPV4ADDRESS:new RegExp("^("+nn+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Ji+")"+i(i("\\%25|\\%(?!"+Me+"{2})")+"("+Ni+")")+"?\\]?$")}}var f=u(!1),h=u(!0),m=function(){function ue(Z,ge){var Me=[],Le=!0,wt=!1,St=void 0;try{for(var pr=Z[Symbol.iterator](),lr;!(Le=(lr=pr.next()).done)&&(Me.push(lr.value),!(ge&&Me.length===ge));Le=!0);}catch(Xr){wt=!0,St=Xr}finally{try{!Le&&pr.return&&pr.return()}finally{if(wt)throw St}}return Me}return function(Z,ge){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return ue(Z,ge);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=function(ue){if(Array.isArray(ue)){for(var Z=0,ge=Array(ue.length);Z<ue.length;Z++)ge[Z]=ue[Z];return ge}else return Array.from(ue)},w=2147483647,v=36,g=1,_=26,b=38,S=700,A=72,O=128,E="-",p=/^xn--/,I=/[^\0-\x7E]/,N=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=v-g,de=Math.floor,ve=String.fromCharCode;function j(ue){throw new RangeError(B[ue])}function L(ue,Z){for(var ge=[],Me=ue.length;Me--;)ge[Me]=Z(ue[Me]);return ge}function Y(ue,Z){var ge=ue.split("@"),Me="";ge.length>1&&(Me=ge[0]+"@",ue=ge[1]),ue=ue.replace(N,".");var Le=ue.split("."),wt=L(Le,Z).join(".");return Me+wt}function ne(ue){for(var Z=[],ge=0,Me=ue.length;ge<Me;){var Le=ue.charCodeAt(ge++);if(Le>=55296&&Le<=56319&&ge<Me){var wt=ue.charCodeAt(ge++);(wt&64512)==56320?Z.push(((Le&1023)<<10)+(wt&1023)+65536):(Z.push(Le),ge--)}else Z.push(Le)}return Z}var U=function(Z){return String.fromCodePoint.apply(String,y(Z))},F=function(Z){return Z-48<10?Z-22:Z-65<26?Z-65:Z-97<26?Z-97:v},H=function(Z,ge){return Z+22+75*(Z<26)-((ge!=0)<<5)},M=function(Z,ge,Me){var Le=0;for(Z=Me?de(Z/S):Z>>1,Z+=de(Z/ge);Z>V*_>>1;Le+=v)Z=de(Z/V);return de(Le+(V+1)*Z/(Z+b))},q=function(Z){var ge=[],Me=Z.length,Le=0,wt=O,St=A,pr=Z.lastIndexOf(E);pr<0&&(pr=0);for(var lr=0;lr<pr;++lr)Z.charCodeAt(lr)>=128&&j("not-basic"),ge.push(Z.charCodeAt(lr));for(var Xr=pr>0?pr+1:0;Xr<Me;){for(var gr=Le,br=1,nn=v;;nn+=v){Xr>=Me&&j("invalid-input");var or=F(Z.charCodeAt(Xr++));(or>=v||or>de((w-Le)/br))&&j("overflow"),Le+=or*br;var $r=nn<=St?g:nn>=St+_?_:nn-St;if(or<$r)break;var hn=v-$r;br>de(w/hn)&&j("overflow"),br*=hn}var Lr=ge.length+1;St=M(Le-gr,Lr,gr==0),de(Le/Lr)>w-wt&&j("overflow"),wt+=de(Le/Lr),Le%=Lr,ge.splice(Le++,0,wt)}return String.fromCodePoint.apply(String,ge)},$=function(Z){var ge=[];Z=ne(Z);var Me=Z.length,Le=O,wt=0,St=A,pr=!0,lr=!1,Xr=void 0;try{for(var gr=Z[Symbol.iterator](),br;!(pr=(br=gr.next()).done);pr=!0){var nn=br.value;nn<128&&ge.push(ve(nn))}}catch(Xe){lr=!0,Xr=Xe}finally{try{!pr&&gr.return&&gr.return()}finally{if(lr)throw Xr}}var or=ge.length,$r=or;for(or&&ge.push(E);$r<Me;){var hn=w,Lr=!0,Qn=!1,xi=void 0;try{for(var Jn=Z[Symbol.iterator](),Ai;!(Lr=(Ai=Jn.next()).done);Lr=!0){var Si=Ai.value;Si>=Le&&Si<hn&&(hn=Si)}}catch(Xe){Qn=!0,xi=Xe}finally{try{!Lr&&Jn.return&&Jn.return()}finally{if(Qn)throw xi}}var ni=$r+1;hn-Le>de((w-wt)/ni)&&j("overflow"),wt+=(hn-Le)*ni,Le=hn;var Un=!0,Ji=!1,Ni=void 0;try{for(var ms=Z[Symbol.iterator](),Ya;!(Un=(Ya=ms.next()).done);Un=!0){var X=Ya.value;if(X<Le&&++wt>w&&j("overflow"),X==Le){for(var me=wt,re=v;;re+=v){var Ee=re<=St?g:re>=St+_?_:re-St;if(me<Ee)break;var be=me-Ee,Oe=v-Ee;ge.push(ve(H(Ee+be%Oe,0))),me=de(be/Oe)}ge.push(ve(H(me,0))),St=M(wt,ni,$r==or),wt=0,++$r}}}catch(Xe){Ji=!0,Ni=Xe}finally{try{!Un&&ms.return&&ms.return()}finally{if(Ji)throw Ni}}++wt,++Le}return ge.join("")},k=function(Z){return Y(Z,function(ge){return p.test(ge)?q(ge.slice(4).toLowerCase()):ge})},G=function(Z){return Y(Z,function(ge){return I.test(ge)?"xn--"+$(ge):ge})},pe={version:"2.1.0",ucs2:{decode:ne,encode:U},decode:q,encode:$,toASCII:G,toUnicode:k},Q={};function te(ue){var Z=ue.charCodeAt(0),ge=void 0;return Z<16?ge="%0"+Z.toString(16).toUpperCase():Z<128?ge="%"+Z.toString(16).toUpperCase():Z<2048?ge="%"+(Z>>6|192).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase():ge="%"+(Z>>12|224).toString(16).toUpperCase()+"%"+(Z>>6&63|128).toString(16).toUpperCase()+"%"+(Z&63|128).toString(16).toUpperCase(),ge}function ce(ue){for(var Z="",ge=0,Me=ue.length;ge<Me;){var Le=parseInt(ue.substr(ge+1,2),16);if(Le<128)Z+=String.fromCharCode(Le),ge+=3;else if(Le>=194&&Le<224){if(Me-ge>=6){var wt=parseInt(ue.substr(ge+4,2),16);Z+=String.fromCharCode((Le&31)<<6|wt&63)}else Z+=ue.substr(ge,6);ge+=6}else if(Le>=224){if(Me-ge>=9){var St=parseInt(ue.substr(ge+4,2),16),pr=parseInt(ue.substr(ge+7,2),16);Z+=String.fromCharCode((Le&15)<<12|(St&63)<<6|pr&63)}else Z+=ue.substr(ge,9);ge+=9}else Z+=ue.substr(ge,3),ge+=3}return Z}function T(ue,Z){function ge(Me){var Le=ce(Me);return Le.match(Z.UNRESERVED)?Le:Me}return ue.scheme&&(ue.scheme=String(ue.scheme).replace(Z.PCT_ENCODED,ge).toLowerCase().replace(Z.NOT_SCHEME,"")),ue.userinfo!==void 0&&(ue.userinfo=String(ue.userinfo).replace(Z.PCT_ENCODED,ge).replace(Z.NOT_USERINFO,te).replace(Z.PCT_ENCODED,a)),ue.host!==void 0&&(ue.host=String(ue.host).replace(Z.PCT_ENCODED,ge).toLowerCase().replace(Z.NOT_HOST,te).replace(Z.PCT_ENCODED,a)),ue.path!==void 0&&(ue.path=String(ue.path).replace(Z.PCT_ENCODED,ge).replace(ue.scheme?Z.NOT_PATH:Z.NOT_PATH_NOSCHEME,te).replace(Z.PCT_ENCODED,a)),ue.query!==void 0&&(ue.query=String(ue.query).replace(Z.PCT_ENCODED,ge).replace(Z.NOT_QUERY,te).replace(Z.PCT_ENCODED,a)),ue.fragment!==void 0&&(ue.fragment=String(ue.fragment).replace(Z.PCT_ENCODED,ge).replace(Z.NOT_FRAGMENT,te).replace(Z.PCT_ENCODED,a)),ue}function le(ue){return ue.replace(/^0*(.*)/,"$1")||"0"}function Ge(ue,Z){var ge=ue.match(Z.IPV4ADDRESS)||[],Me=m(ge,2),Le=Me[1];return Le?Le.split(".").map(le).join("."):ue}function tt(ue,Z){var ge=ue.match(Z.IPV6ADDRESS)||[],Me=m(ge,3),Le=Me[1],wt=Me[2];if(Le){for(var St=Le.toLowerCase().split("::").reverse(),pr=m(St,2),lr=pr[0],Xr=pr[1],gr=Xr?Xr.split(":").map(le):[],br=lr.split(":").map(le),nn=Z.IPV4ADDRESS.test(br[br.length-1]),or=nn?7:8,$r=br.length-or,hn=Array(or),Lr=0;Lr<or;++Lr)hn[Lr]=gr[Lr]||br[$r+Lr]||"";nn&&(hn[or-1]=Ge(hn[or-1],Z));var Qn=hn.reduce(function(ni,Un,Ji){if(!Un||Un==="0"){var Ni=ni[ni.length-1];Ni&&Ni.index+Ni.length===Ji?Ni.length++:ni.push({index:Ji,length:1})}return ni},[]),xi=Qn.sort(function(ni,Un){return Un.length-ni.length})[0],Jn=void 0;if(xi&&xi.length>1){var Ai=hn.slice(0,xi.index),Si=hn.slice(xi.index+xi.length);Jn=Ai.join(":")+"::"+Si.join(":")}else Jn=hn.join(":");return wt&&(Jn+="%"+wt),Jn}else return ue}var yt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,vt="".match(/(){0}/)[1]===void 0;function gt(ue){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge={},Me=Z.iri!==!1?h:f;Z.reference==="suffix"&&(ue=(Z.scheme?Z.scheme+":":"")+"//"+ue);var Le=ue.match(yt);if(Le){vt?(ge.scheme=Le[1],ge.userinfo=Le[3],ge.host=Le[4],ge.port=parseInt(Le[5],10),ge.path=Le[6]||"",ge.query=Le[7],ge.fragment=Le[8],isNaN(ge.port)&&(ge.port=Le[5])):(ge.scheme=Le[1]||void 0,ge.userinfo=ue.indexOf("@")!==-1?Le[3]:void 0,ge.host=ue.indexOf("//")!==-1?Le[4]:void 0,ge.port=parseInt(Le[5],10),ge.path=Le[6]||"",ge.query=ue.indexOf("?")!==-1?Le[7]:void 0,ge.fragment=ue.indexOf("#")!==-1?Le[8]:void 0,isNaN(ge.port)&&(ge.port=ue.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?Le[4]:void 0)),ge.host&&(ge.host=tt(Ge(ge.host,Me),Me)),ge.scheme===void 0&&ge.userinfo===void 0&&ge.host===void 0&&ge.port===void 0&&!ge.path&&ge.query===void 0?ge.reference="same-document":ge.scheme===void 0?ge.reference="relative":ge.fragment===void 0?ge.reference="absolute":ge.reference="uri",Z.reference&&Z.reference!=="suffix"&&Z.reference!==ge.reference&&(ge.error=ge.error||"URI is not a "+Z.reference+" reference.");var wt=Q[(Z.scheme||ge.scheme||"").toLowerCase()];if(!Z.unicodeSupport&&(!wt||!wt.unicodeSupport)){if(ge.host&&(Z.domainHost||wt&&wt.domainHost))try{ge.host=pe.toASCII(ge.host.replace(Me.PCT_ENCODED,ce).toLowerCase())}catch(St){ge.error=ge.error||"Host's domain name can not be converted to ASCII via punycode: "+St}T(ge,f)}else T(ge,Me);wt&&wt.parse&&wt.parse(ge,Z)}else ge.error=ge.error||"URI can not be parsed.";return ge}function Bt(ue,Z){var ge=Z.iri!==!1?h:f,Me=[];return ue.userinfo!==void 0&&(Me.push(ue.userinfo),Me.push("@")),ue.host!==void 0&&Me.push(tt(Ge(String(ue.host),ge),ge).replace(ge.IPV6ADDRESS,function(Le,wt,St){return"["+wt+(St?"%25"+St:"")+"]"})),(typeof ue.port=="number"||typeof ue.port=="string")&&(Me.push(":"),Me.push(String(ue.port))),Me.length?Me.join(""):void 0}var Zt=/^\.\.?\//,Or=/^\/\.(\/|$)/,Ct=/^\/\.\.(\/|$)/,Pt=/^\/?(?:.|\n)*?(?=\/|$)/;function $t(ue){for(var Z=[];ue.length;)if(ue.match(Zt))ue=ue.replace(Zt,"");else if(ue.match(Or))ue=ue.replace(Or,"/");else if(ue.match(Ct))ue=ue.replace(Ct,"/"),Z.pop();else if(ue==="."||ue==="..")ue="";else{var ge=ue.match(Pt);if(ge){var Me=ge[0];ue=ue.slice(Me.length),Z.push(Me)}else throw new Error("Unexpected dot segment condition")}return Z.join("")}function Rt(ue){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=Z.iri?h:f,Me=[],Le=Q[(Z.scheme||ue.scheme||"").toLowerCase()];if(Le&&Le.serialize&&Le.serialize(ue,Z),ue.host&&!ge.IPV6ADDRESS.test(ue.host)){if(Z.domainHost||Le&&Le.domainHost)try{ue.host=Z.iri?pe.toUnicode(ue.host):pe.toASCII(ue.host.replace(ge.PCT_ENCODED,ce).toLowerCase())}catch(pr){ue.error=ue.error||"Host's domain name can not be converted to "+(Z.iri?"Unicode":"ASCII")+" via punycode: "+pr}}T(ue,ge),Z.reference!=="suffix"&&ue.scheme&&(Me.push(ue.scheme),Me.push(":"));var wt=Bt(ue,Z);if(wt!==void 0&&(Z.reference!=="suffix"&&Me.push("//"),Me.push(wt),ue.path&&ue.path.charAt(0)!=="/"&&Me.push("/")),ue.path!==void 0){var St=ue.path;!Z.absolutePath&&(!Le||!Le.absolutePath)&&(St=$t(St)),wt===void 0&&(St=St.replace(/^\/\//,"/%2F")),Me.push(St)}return ue.query!==void 0&&(Me.push("?"),Me.push(ue.query)),ue.fragment!==void 0&&(Me.push("#"),Me.push(ue.fragment)),Me.join("")}function Wt(ue,Z){var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Me=arguments[3],Le={};return Me||(ue=gt(Rt(ue,ge),ge),Z=gt(Rt(Z,ge),ge)),ge=ge||{},!ge.tolerant&&Z.scheme?(Le.scheme=Z.scheme,Le.userinfo=Z.userinfo,Le.host=Z.host,Le.port=Z.port,Le.path=$t(Z.path||""),Le.query=Z.query):(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0?(Le.userinfo=Z.userinfo,Le.host=Z.host,Le.port=Z.port,Le.path=$t(Z.path||""),Le.query=Z.query):(Z.path?(Z.path.charAt(0)==="/"?Le.path=$t(Z.path):((ue.userinfo!==void 0||ue.host!==void 0||ue.port!==void 0)&&!ue.path?Le.path="/"+Z.path:ue.path?Le.path=ue.path.slice(0,ue.path.lastIndexOf("/")+1)+Z.path:Le.path=Z.path,Le.path=$t(Le.path)),Le.query=Z.query):(Le.path=ue.path,Z.query!==void 0?Le.query=Z.query:Le.query=ue.query),Le.userinfo=ue.userinfo,Le.host=ue.host,Le.port=ue.port),Le.scheme=ue.scheme),Le.fragment=Z.fragment,Le}function Ft(ue,Z,ge){var Me=c({scheme:"null"},ge);return Rt(Wt(gt(ue,Me),gt(Z,Me),Me,!0),Me)}function Kt(ue,Z){return typeof ue=="string"?ue=Rt(gt(ue,Z),Z):s(ue)==="object"&&(ue=gt(Rt(ue,Z),Z)),ue}function Dt(ue,Z,ge){return typeof ue=="string"?ue=Rt(gt(ue,ge),ge):s(ue)==="object"&&(ue=Rt(ue,ge)),typeof Z=="string"?Z=Rt(gt(Z,ge),ge):s(Z)==="object"&&(Z=Rt(Z,ge)),ue===Z}function Nt(ue,Z){return ue&&ue.toString().replace(!Z||!Z.iri?f.ESCAPE:h.ESCAPE,te)}function Vt(ue,Z){return ue&&ue.toString().replace(!Z||!Z.iri?f.PCT_ENCODED:h.PCT_ENCODED,ce)}var Mt={scheme:"http",domainHost:!0,parse:function(Z,ge){return Z.host||(Z.error=Z.error||"HTTP URIs must have a host."),Z},serialize:function(Z,ge){var Me=String(Z.scheme).toLowerCase()==="https";return(Z.port===(Me?443:80)||Z.port==="")&&(Z.port=void 0),Z.path||(Z.path="/"),Z}},ur={scheme:"https",domainHost:Mt.domainHost,parse:Mt.parse,serialize:Mt.serialize};function rr(ue){return typeof ue.secure=="boolean"?ue.secure:String(ue.scheme).toLowerCase()==="wss"}var ar={scheme:"ws",domainHost:!0,parse:function(Z,ge){var Me=Z;return Me.secure=rr(Me),Me.resourceName=(Me.path||"/")+(Me.query?"?"+Me.query:""),Me.path=void 0,Me.query=void 0,Me},serialize:function(Z,ge){if((Z.port===(rr(Z)?443:80)||Z.port==="")&&(Z.port=void 0),typeof Z.secure=="boolean"&&(Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0),Z.resourceName){var Me=Z.resourceName.split("?"),Le=m(Me,2),wt=Le[0],St=Le[1];Z.path=wt&&wt!=="/"?wt:void 0,Z.query=St,Z.resourceName=void 0}return Z.fragment=void 0,Z}},ir={scheme:"wss",domainHost:ar.domainHost,parse:ar.parse,serialize:ar.serialize},wr={},An="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",rn="[0-9A-Fa-f]",hi=i(i("%[EFef]"+rn+"%"+rn+rn+"%"+rn+rn)+"|"+i("%[89A-Fa-f]"+rn+"%"+rn+rn)+"|"+i("%"+rn+rn)),$n="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ln="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ri=n(Ln,'[\\"\\\\]'),Cr="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Br=new RegExp(An,"g"),Ir=new RegExp(hi,"g"),_e=new RegExp(n("[^]",$n,"[\\.]",'[\\"]',ri),"g"),ee=new RegExp(n("[^]",An,Cr),"g"),ye=ee;function Re(ue){var Z=ce(ue);return Z.match(Br)?Z:ue}var ze={scheme:"mailto",parse:function(Z,ge){var Me=Z,Le=Me.to=Me.path?Me.path.split(","):[];if(Me.path=void 0,Me.query){for(var wt=!1,St={},pr=Me.query.split("&"),lr=0,Xr=pr.length;lr<Xr;++lr){var gr=pr[lr].split("=");switch(gr[0]){case"to":for(var br=gr[1].split(","),nn=0,or=br.length;nn<or;++nn)Le.push(br[nn]);break;case"subject":Me.subject=Vt(gr[1],ge);break;case"body":Me.body=Vt(gr[1],ge);break;default:wt=!0,St[Vt(gr[0],ge)]=Vt(gr[1],ge);break}}wt&&(Me.headers=St)}Me.query=void 0;for(var $r=0,hn=Le.length;$r<hn;++$r){var Lr=Le[$r].split("@");if(Lr[0]=Vt(Lr[0]),ge.unicodeSupport)Lr[1]=Vt(Lr[1],ge).toLowerCase();else try{Lr[1]=pe.toASCII(Vt(Lr[1],ge).toLowerCase())}catch(Qn){Me.error=Me.error||"Email address's domain name can not be converted to ASCII via punycode: "+Qn}Le[$r]=Lr.join("@")}return Me},serialize:function(Z,ge){var Me=Z,Le=o(Z.to);if(Le){for(var wt=0,St=Le.length;wt<St;++wt){var pr=String(Le[wt]),lr=pr.lastIndexOf("@"),Xr=pr.slice(0,lr).replace(Ir,Re).replace(Ir,a).replace(_e,te),gr=pr.slice(lr+1);try{gr=ge.iri?pe.toUnicode(gr):pe.toASCII(Vt(gr,ge).toLowerCase())}catch($r){Me.error=Me.error||"Email address's domain name can not be converted to "+(ge.iri?"Unicode":"ASCII")+" via punycode: "+$r}Le[wt]=Xr+"@"+gr}Me.path=Le.join(",")}var br=Z.headers=Z.headers||{};Z.subject&&(br.subject=Z.subject),Z.body&&(br.body=Z.body);var nn=[];for(var or in br)br[or]!==wr[or]&&nn.push(or.replace(Ir,Re).replace(Ir,a).replace(ee,te)+"="+br[or].replace(Ir,Re).replace(Ir,a).replace(ye,te));return nn.length&&(Me.query=nn.join("&")),Me}},Ze=/^([^\:]+)\:(.*)/,ct={scheme:"urn",parse:function(Z,ge){var Me=Z.path&&Z.path.match(Ze),Le=Z;if(Me){var wt=ge.scheme||Le.scheme||"urn",St=Me[1].toLowerCase(),pr=Me[2],lr=wt+":"+(ge.nid||St),Xr=Q[lr];Le.nid=St,Le.nss=pr,Le.path=void 0,Xr&&(Le=Xr.parse(Le,ge))}else Le.error=Le.error||"URN can not be parsed.";return Le},serialize:function(Z,ge){var Me=ge.scheme||Z.scheme||"urn",Le=Z.nid,wt=Me+":"+(ge.nid||Le),St=Q[wt];St&&(Z=St.serialize(Z,ge));var pr=Z,lr=Z.nss;return pr.path=(Le||ge.nid)+":"+lr,pr}},dt=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Et={scheme:"urn:uuid",parse:function(Z,ge){var Me=Z;return Me.uuid=Me.nss,Me.nss=void 0,!ge.tolerant&&(!Me.uuid||!Me.uuid.match(dt))&&(Me.error=Me.error||"UUID is not valid."),Me},serialize:function(Z,ge){var Me=Z;return Me.nss=(Z.uuid||"").toLowerCase(),Me}};Q[Mt.scheme]=Mt,Q[ur.scheme]=ur,Q[ar.scheme]=ar,Q[ir.scheme]=ir,Q[ze.scheme]=ze,Q[ct.scheme]=ct,Q[Et.scheme]=Et,r.SCHEMES=Q,r.pctEncChar=te,r.pctDecChars=ce,r.parse=gt,r.removeDotSegments=$t,r.serialize=Rt,r.resolveComponents=Wt,r.resolve=Ft,r.normalize=Kt,r.equal=Dt,r.escapeComponent=Nt,r.unescapeComponent=Vt,Object.defineProperty(r,"__esModule",{value:!0})})})(CN,CN.exports);var Awe=CN.exports;Object.defineProperty(m4,"__esModule",{value:!0});const nX=Awe;nX.code='require("ajv/dist/runtime/uri").default';m4.default=nX;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=To;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=Sr;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=I1,i=P1,s=kh,a=va,o=Sr,c=us,u=O1,f=dn,h=xwe,m=m4,y=(H,M)=>new RegExp(H,M);y.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function S(H){var M,q,$,k,G,pe,Q,te,ce,T,le,Ge,tt,yt,vt,gt,Bt,Zt,Or,Ct,Pt,$t,Rt,Wt,Ft;const Kt=H.strict,Dt=(M=H.code)===null||M===void 0?void 0:M.optimize,Nt=Dt===!0||Dt===void 0?1:Dt||0,Vt=($=(q=H.code)===null||q===void 0?void 0:q.regExp)!==null&&$!==void 0?$:y,Mt=(k=H.uriResolver)!==null&&k!==void 0?k:m.default;return{strictSchema:(pe=(G=H.strictSchema)!==null&&G!==void 0?G:Kt)!==null&&pe!==void 0?pe:!0,strictNumbers:(te=(Q=H.strictNumbers)!==null&&Q!==void 0?Q:Kt)!==null&&te!==void 0?te:!0,strictTypes:(T=(ce=H.strictTypes)!==null&&ce!==void 0?ce:Kt)!==null&&T!==void 0?T:"log",strictTuples:(Ge=(le=H.strictTuples)!==null&&le!==void 0?le:Kt)!==null&&Ge!==void 0?Ge:"log",strictRequired:(yt=(tt=H.strictRequired)!==null&&tt!==void 0?tt:Kt)!==null&&yt!==void 0?yt:!1,code:H.code?{...H.code,optimize:Nt,regExp:Vt}:{optimize:Nt,regExp:Vt},loopRequired:(vt=H.loopRequired)!==null&&vt!==void 0?vt:b,loopEnum:(gt=H.loopEnum)!==null&&gt!==void 0?gt:b,meta:(Bt=H.meta)!==null&&Bt!==void 0?Bt:!0,messages:(Zt=H.messages)!==null&&Zt!==void 0?Zt:!0,inlineRefs:(Or=H.inlineRefs)!==null&&Or!==void 0?Or:!0,schemaId:(Ct=H.schemaId)!==null&&Ct!==void 0?Ct:"$id",addUsedSchema:(Pt=H.addUsedSchema)!==null&&Pt!==void 0?Pt:!0,validateSchema:($t=H.validateSchema)!==null&&$t!==void 0?$t:!0,validateFormats:(Rt=H.validateFormats)!==null&&Rt!==void 0?Rt:!0,unicodeRegExp:(Wt=H.unicodeRegExp)!==null&&Wt!==void 0?Wt:!0,int32range:(Ft=H.int32range)!==null&&Ft!==void 0?Ft:!0,uriResolver:Mt}}class A{constructor(M={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,M=this.opts={...M,...S(M)};const{es5:q,lines:$}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:v,es5:q,lines:$}),this.logger=de(M.logger);const k=M.validateFormats;M.validateFormats=!1,this.RULES=(0,s.getRules)(),O.call(this,g,M,"NOT SUPPORTED"),O.call(this,_,M,"DEPRECATED","warn"),this._metaOpts=B.call(this),M.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),M.keywords&&N.call(this,M.keywords),typeof M.meta=="object"&&this.addMetaSchema(M.meta),p.call(this),M.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:M,meta:q,schemaId:$}=this.opts;let k=h;$==="id"&&(k={...h},k.id=k.$id,delete k.$id),q&&M&&this.addMetaSchema(k,k[$],!1)}defaultMeta(){const{meta:M,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof M=="object"?M[q]||M:void 0}validate(M,q){let $;if(typeof M=="string"){if($=this.getSchema(M),!$)throw new Error(`no schema with key or ref "${M}"`)}else $=this.compile(M);const k=$(q);return"$async"in $||(this.errors=$.errors),k}compile(M,q){const $=this._addSchema(M,q);return $.validate||this._compileSchemaEnv($)}compileAsync(M,q){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:$}=this.opts;return k.call(this,M,q);async function k(T,le){await G.call(this,T.$schema);const Ge=this._addSchema(T,le);return Ge.validate||pe.call(this,Ge)}async function G(T){T&&!this.getSchema(T)&&await k.call(this,{$ref:T},!0)}async function pe(T){try{return this._compileSchemaEnv(T)}catch(le){if(!(le instanceof i.default))throw le;return Q.call(this,le),await te.call(this,le.missingSchema),pe.call(this,T)}}function Q({missingSchema:T,missingRef:le}){if(this.refs[T])throw new Error(`AnySchema ${T} is loaded but ${le} cannot be resolved`)}async function te(T){const le=await ce.call(this,T);this.refs[T]||await G.call(this,le.$schema),this.refs[T]||this.addSchema(le,T,q)}async function ce(T){const le=this._loading[T];if(le)return le;try{return await(this._loading[T]=$(T))}finally{delete this._loading[T]}}}addSchema(M,q,$,k=this.opts.validateSchema){if(Array.isArray(M)){for(const pe of M)this.addSchema(pe,void 0,$,k);return this}let G;if(typeof M=="object"){const{schemaId:pe}=this.opts;if(G=M[pe],G!==void 0&&typeof G!="string")throw new Error(`schema ${pe} must be string`)}return q=(0,c.normalizeId)(q||G),this._checkUnique(q),this.schemas[q]=this._addSchema(M,$,q,k,!0),this}addMetaSchema(M,q,$=this.opts.validateSchema){return this.addSchema(M,q,!0,$),this}validateSchema(M,q){if(typeof M=="boolean")return!0;let $;if($=M.$schema,$!==void 0&&typeof $!="string")throw new Error("$schema must be a string");if($=$||this.opts.defaultMeta||this.defaultMeta(),!$)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate($,M);if(!k&&q){const G="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(G);else throw new Error(G)}return k}getSchema(M){let q;for(;typeof(q=E.call(this,M))=="string";)M=q;if(q===void 0){const{schemaId:$}=this.opts,k=new a.SchemaEnv({schema:{},schemaId:$});if(q=a.resolveSchema.call(this,k,M),!q)return;this.refs[M]=q}return q.validate||this._compileSchemaEnv(q)}removeSchema(M){if(M instanceof RegExp)return this._removeAllSchemas(this.schemas,M),this._removeAllSchemas(this.refs,M),this;switch(typeof M){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const q=E.call(this,M);return typeof q=="object"&&this._cache.delete(q.schema),delete this.schemas[M],delete this.refs[M],this}case"object":{const q=M;this._cache.delete(q);let $=M[this.opts.schemaId];return $&&($=(0,c.normalizeId)($),delete this.schemas[$],delete this.refs[$]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(M){for(const q of M)this.addKeyword(q);return this}addKeyword(M,q){let $;if(typeof M=="string")$=M,typeof q=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=$);else if(typeof M=="object"&&q===void 0){if(q=M,$=q.keyword,Array.isArray($)&&!$.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(j.call(this,$,q),!q)return(0,f.eachItem)($,G=>L.call(this,G)),this;ne.call(this,q);const k={...q,type:(0,u.getJSONTypes)(q.type),schemaType:(0,u.getJSONTypes)(q.schemaType)};return(0,f.eachItem)($,k.type.length===0?G=>L.call(this,G,k):G=>k.type.forEach(pe=>L.call(this,G,k,pe))),this}getKeyword(M){const q=this.RULES.all[M];return typeof q=="object"?q.definition:!!q}removeKeyword(M){const{RULES:q}=this;delete q.keywords[M],delete q.all[M];for(const $ of q.rules){const k=$.rules.findIndex(G=>G.keyword===M);k>=0&&$.rules.splice(k,1)}return this}addFormat(M,q){return typeof q=="string"&&(q=new RegExp(q)),this.formats[M]=q,this}errorsText(M=this.errors,{separator:q=", ",dataVar:$="data"}={}){return!M||M.length===0?"No errors":M.map(k=>`${$}${k.instancePath} ${k.message}`).reduce((k,G)=>k+q+G)}$dataMetaSchema(M,q){const $=this.RULES.all;M=JSON.parse(JSON.stringify(M));for(const k of q){const G=k.split("/").slice(1);let pe=M;for(const Q of G)pe=pe[Q];for(const Q in $){const te=$[Q];if(typeof te!="object")continue;const{$data:ce}=te.definition,T=pe[Q];ce&&T&&(pe[Q]=F(T))}}return M}_removeAllSchemas(M,q){for(const $ in M){const k=M[$];(!q||q.test($))&&(typeof k=="string"?delete M[$]:k&&!k.meta&&(this._cache.delete(k.schema),delete M[$]))}}_addSchema(M,q,$,k=this.opts.validateSchema,G=this.opts.addUsedSchema){let pe;const{schemaId:Q}=this.opts;if(typeof M=="object")pe=M[Q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof M!="boolean")throw new Error("schema must be object or boolean")}let te=this._cache.get(M);if(te!==void 0)return te;$=(0,c.normalizeId)(pe||$);const ce=c.getSchemaRefs.call(this,M,$);return te=new a.SchemaEnv({schema:M,schemaId:Q,meta:q,baseId:$,localRefs:ce}),this._cache.set(te.schema,te),G&&!$.startsWith("#")&&($&&this._checkUnique($),this.refs[$]=te),k&&this.validateSchema(M,!0),te}_checkUnique(M){if(this.schemas[M]||this.refs[M])throw new Error(`schema with key or id "${M}" already exists`)}_compileSchemaEnv(M){if(M.meta?this._compileMetaSchema(M):a.compileSchema.call(this,M),!M.validate)throw new Error("ajv implementation error");return M.validate}_compileMetaSchema(M){const q=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,M)}finally{this.opts=q}}}t.default=A,A.ValidationError=n.default,A.MissingRefError=i.default;function O(H,M,q,$="error"){for(const k in H){const G=k;G in M&&this.logger[$](`${q}: option ${k}. ${H[G]}`)}}function E(H){return H=(0,c.normalizeId)(H),this.schemas[H]||this.refs[H]}function p(){const H=this.opts.schemas;if(H)if(Array.isArray(H))this.addSchema(H);else for(const M in H)this.addSchema(H[M],M)}function I(){for(const H in this.opts.formats){const M=this.opts.formats[H];M&&this.addFormat(H,M)}}function N(H){if(Array.isArray(H)){this.addVocabulary(H);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const M in H){const q=H[M];q.keyword||(q.keyword=M),this.addKeyword(q)}}function B(){const H={...this.opts};for(const M of w)delete H[M];return H}const V={log(){},warn(){},error(){}};function de(H){if(H===!1)return V;if(H===void 0)return console;if(H.log&&H.warn&&H.error)return H;throw new Error("logger must implement log, warn and error methods")}const ve=/^[a-z_$][a-z0-9_$:-]*$/i;function j(H,M){const{RULES:q}=this;if((0,f.eachItem)(H,$=>{if(q.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!ve.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!M&&M.$data&&!("code"in M||"validate"in M))throw new Error('$data keyword must have "code" or "validate" function')}function L(H,M,q){var $;const k=M==null?void 0:M.post;if(q&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:G}=this;let pe=k?G.post:G.rules.find(({type:te})=>te===q);if(pe||(pe={type:q,rules:[]},G.rules.push(pe)),G.keywords[H]=!0,!M)return;const Q={keyword:H,definition:{...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)}};M.before?Y.call(this,pe,Q,M.before):pe.rules.push(Q),G.all[H]=Q,($=M.implements)===null||$===void 0||$.forEach(te=>this.addKeyword(te))}function Y(H,M,q){const $=H.rules.findIndex(k=>k.keyword===q);$>=0?H.rules.splice($,0,M):(H.rules.push(M),this.logger.warn(`rule ${q} is not defined`))}function ne(H){let{metaSchema:M}=H;M!==void 0&&(H.$data&&this.opts.$data&&(M=F(M)),H.validateSchema=this.compile(M,!0))}const U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function F(H){return{anyOf:[H,U]}}})(DJ);var y4={},v4={},b4={};Object.defineProperty(b4,"__esModule",{value:!0});const Swe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};b4.default=Swe;var $h={};Object.defineProperty($h,"__esModule",{value:!0});$h.callRef=$h.getValidate=void 0;const Owe=P1,Oq=Kr,ha=Sr,Dp=Sc,Iq=va,i_=dn,Iwe={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:o,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&i===u.baseId)return h();const f=Iq.resolveRef.call(c,u,i,r);if(f===void 0)throw new Owe.default(n.opts.uriResolver,i,r);if(f instanceof Iq.SchemaEnv)return m(f);return y(f);function h(){if(s===u)return rE(t,a,s,s.$async);const w=e.scopeValue("root",{ref:u});return rE(t,(0,ha._)`${w}.validate`,u,u.$async)}function m(w){const v=iX(t,w);rE(t,v,w,w.$async)}function y(w){const v=e.scopeValue("schema",o.code.source===!0?{ref:w,code:(0,ha.stringify)(w)}:{ref:w}),g=e.name("valid"),_=t.subschema({schema:w,dataTypes:[],schemaPath:ha.nil,topSchemaRef:v,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function iX(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ha._)`${r.scopeValue("wrapper",{ref:e})}.validate`}$h.getValidate=iX;function rE(t,e,r,n){const{gen:i,it:s}=t,{allErrors:a,schemaEnv:o,opts:c}=s,u=c.passContext?Dp.default.this:ha.nil;n?f():h();function f(){if(!o.$async)throw new Error("async schema referenced by sync schema");const w=i.let("valid");i.try(()=>{i.code((0,ha._)`await ${(0,Oq.callValidateCode)(t,e,u)}`),y(e),a||i.assign(w,!0)},v=>{i.if((0,ha._)`!(${v} instanceof ${s.ValidationError})`,()=>i.throw(v)),m(v),a||i.assign(w,!1)}),t.ok(w)}function h(){t.result((0,Oq.callValidateCode)(t,e,u),()=>y(e),()=>m(e))}function m(w){const v=(0,ha._)`${w}.errors`;i.assign(Dp.default.vErrors,(0,ha._)`${Dp.default.vErrors} === null ? ${v} : ${Dp.default.vErrors}.concat(${v})`),i.assign(Dp.default.errors,(0,ha._)`${Dp.default.vErrors}.length`)}function y(w){var v;if(!s.opts.unevaluated)return;const g=(v=r==null?void 0:r.validate)===null||v===void 0?void 0:v.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=i_.mergeEvaluated.props(i,g.props,s.props));else{const _=i.var("props",(0,ha._)`${w}.evaluated.props`);s.props=i_.mergeEvaluated.props(i,_,s.props,ha.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=i_.mergeEvaluated.items(i,g.items,s.items));else{const _=i.var("items",(0,ha._)`${w}.evaluated.items`);s.items=i_.mergeEvaluated.items(i,_,s.items,ha.Name)}}}$h.callRef=rE;$h.default=Iwe;Object.defineProperty(v4,"__esModule",{value:!0});const Pwe=b4,Twe=$h,Cwe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Pwe.default,Twe.default];v4.default=Cwe;var w4={},_4={};Object.defineProperty(_4,"__esModule",{value:!0});const sx=Sr,zl=sx.operators,ax={maximum:{okStr:"<=",ok:zl.LTE,fail:zl.GT},minimum:{okStr:">=",ok:zl.GTE,fail:zl.LT},exclusiveMaximum:{okStr:"<",ok:zl.LT,fail:zl.GTE},exclusiveMinimum:{okStr:">",ok:zl.GT,fail:zl.LTE}},Rwe={message:({keyword:t,schemaCode:e})=>(0,sx.str)`must be ${ax[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,sx._)`{comparison: ${ax[t].okStr}, limit: ${e}}`},Nwe={keyword:Object.keys(ax),type:"number",schemaType:"number",$data:!0,error:Rwe,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,sx._)`${r} ${ax[e].fail} ${n} || isNaN(${r})`)}};_4.default=Nwe;var E4={};Object.defineProperty(E4,"__esModule",{value:!0});const Uv=Sr,Dwe={message:({schemaCode:t})=>(0,Uv.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Uv._)`{multipleOf: ${t}}`},Mwe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Dwe,code(t){const{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),o=s?(0,Uv._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Uv._)`${a} !== parseInt(${a})`;t.fail$data((0,Uv._)`(${n} === 0 || (${a} = ${r}/${n}, ${o}))`)}};E4.default=Mwe;var x4={},A4={};Object.defineProperty(A4,"__esModule",{value:!0});function sX(t){const e=t.length;let r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}A4.default=sX;sX.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(x4,"__esModule",{value:!0});const jd=Sr,kwe=dn,$we=A4,Lwe={message({keyword:t,schemaCode:e}){const r=t==="maxLength"?"more":"fewer";return(0,jd.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,jd._)`{limit: ${t}}`},Uwe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Lwe,code(t){const{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?jd.operators.GT:jd.operators.LT,a=i.opts.unicode===!1?(0,jd._)`${r}.length`:(0,jd._)`${(0,kwe.useFunc)(t.gen,$we.default)}(${r})`;t.fail$data((0,jd._)`${a} ${s} ${n}`)}};x4.default=Uwe;var S4={};Object.defineProperty(S4,"__esModule",{value:!0});const jwe=Kr,ox=Sr,Bwe={message:({schemaCode:t})=>(0,ox.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ox._)`{pattern: ${t}}`},Fwe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Bwe,code(t){const{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"",o=r?(0,ox._)`(new RegExp(${i}, ${a}))`:(0,jwe.usePattern)(t,n);t.fail$data((0,ox._)`!${o}.test(${e})`)}};S4.default=Fwe;var O4={};Object.defineProperty(O4,"__esModule",{value:!0});const jv=Sr,qwe={message({keyword:t,schemaCode:e}){const r=t==="maxProperties"?"more":"fewer";return(0,jv.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,jv._)`{limit: ${t}}`},Hwe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qwe,code(t){const{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?jv.operators.GT:jv.operators.LT;t.fail$data((0,jv._)`Object.keys(${r}).length ${i} ${n}`)}};O4.default=Hwe;var I4={};Object.defineProperty(I4,"__esModule",{value:!0});const Iy=Kr,Bv=Sr,zwe=dn,Vwe={message:({params:{missingProperty:t}})=>(0,Bv.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Bv._)`{missingProperty: ${t}}`},Gwe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Vwe,code(t){const{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:o}=a;if(!s&&r.length===0)return;const c=r.length>=o.loopRequired;if(a.allErrors?u():f(),o.strictRequired){const y=t.parentSchema.properties,{definedProperties:w}=t.it;for(const v of r)if((y==null?void 0:y[v])===void 0&&!w.has(v)){const g=a.schemaEnv.baseId+a.errSchemaPath,_=`required property "${v}" is not defined at "${g}" (strictRequired)`;(0,zwe.checkStrictMode)(a,_,a.opts.strictRequired)}}function u(){if(c||s)t.block$data(Bv.nil,h);else for(const y of r)(0,Iy.checkReportMissingProp)(t,y)}function f(){const y=e.let("missing");if(c||s){const w=e.let("valid",!0);t.block$data(w,()=>m(y,w)),t.ok(w)}else e.if((0,Iy.checkMissingProp)(t,r,y)),(0,Iy.reportMissingProp)(t,y),e.else()}function h(){e.forOf("prop",n,y=>{t.setParams({missingProperty:y}),e.if((0,Iy.noPropertyInData)(e,i,y,o.ownProperties),()=>t.error())})}function m(y,w){t.setParams({missingProperty:y}),e.forOf(y,n,()=>{e.assign(w,(0,Iy.propertyInData)(e,i,y,o.ownProperties)),e.if((0,Bv.not)(w),()=>{t.error(),e.break()})},Bv.nil)}}};I4.default=Gwe;var P4={};Object.defineProperty(P4,"__esModule",{value:!0});const Fv=Sr,Kwe={message({keyword:t,schemaCode:e}){const r=t==="maxItems"?"more":"fewer";return(0,Fv.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Fv._)`{limit: ${t}}`},Wwe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Kwe,code(t){const{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Fv.operators.GT:Fv.operators.LT;t.fail$data((0,Fv._)`${r}.length ${i} ${n}`)}};P4.default=Wwe;var T4={},T1={};Object.defineProperty(T1,"__esModule",{value:!0});const aX=d4;aX.code='require("ajv/dist/runtime/equal").default';T1.default=aX;Object.defineProperty(T4,"__esModule",{value:!0});const JT=O1,rs=Sr,Ywe=dn,Qwe=T1,Jwe={message:({params:{i:t,j:e}})=>(0,rs.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,rs._)`{i: ${t}, j: ${e}}`},Xwe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Jwe,code(t){const{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:o}=t;if(!n&&!i)return;const c=e.let("valid"),u=s.items?(0,JT.getSchemaTypes)(s.items):[];t.block$data(c,f,(0,rs._)`${a} === false`),t.ok(c);function f(){const w=e.let("i",(0,rs._)`${r}.length`),v=e.let("j");t.setParams({i:w,j:v}),e.assign(c,!0),e.if((0,rs._)`${w} > 1`,()=>(h()?m:y)(w,v))}function h(){return u.length>0&&!u.some(w=>w==="object"||w==="array")}function m(w,v){const g=e.name("item"),_=(0,JT.checkDataTypes)(u,g,o.opts.strictNumbers,JT.DataType.Wrong),b=e.const("indices",(0,rs._)`{}`);e.for((0,rs._)`;${w}--;`,()=>{e.let(g,(0,rs._)`${r}[${w}]`),e.if(_,(0,rs._)`continue`),u.length>1&&e.if((0,rs._)`typeof ${g} == "string"`,(0,rs._)`${g} += "_"`),e.if((0,rs._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(v,(0,rs._)`${b}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,rs._)`${b}[${g}] = ${w}`)})}function y(w,v){const g=(0,Ywe.useFunc)(e,Qwe.default),_=e.name("outer");e.label(_).for((0,rs._)`;${w}--;`,()=>e.for((0,rs._)`${v} = ${w}; ${v}--;`,()=>e.if((0,rs._)`${g}(${r}[${w}], ${r}[${v}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};T4.default=Xwe;var C4={};Object.defineProperty(C4,"__esModule",{value:!0});const RN=Sr,Zwe=dn,e_e=T1,t_e={message:"must be equal to constant",params:({schemaCode:t})=>(0,RN._)`{allowedValue: ${t}}`},r_e={keyword:"const",$data:!0,error:t_e,code(t){const{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,RN._)`!${(0,Zwe.useFunc)(e,e_e.default)}(${r}, ${i})`):t.fail((0,RN._)`${s} !== ${r}`)}};C4.default=r_e;var R4={};Object.defineProperty(R4,"__esModule",{value:!0});const pv=Sr,n_e=dn,i_e=T1,s_e={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,pv._)`{allowedValues: ${t}}`},a_e={keyword:"enum",schemaType:"array",$data:!0,error:s_e,code(t){const{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");const o=i.length>=a.opts.loopEnum;let c;const u=()=>c??(c=(0,n_e.useFunc)(e,i_e.default));let f;if(o||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");const y=e.const("vSchema",s);f=(0,pv.or)(...i.map((w,v)=>m(y,v)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,y=>e.if((0,pv._)`${u()}(${r}, ${y})`,()=>e.assign(f,!0).break()))}function m(y,w){const v=i[w];return typeof v=="object"&&v!==null?(0,pv._)`${u()}(${r}, ${y}[${w}])`:(0,pv._)`${r} === ${v}`}}};R4.default=a_e;Object.defineProperty(w4,"__esModule",{value:!0});const o_e=_4,c_e=E4,u_e=x4,l_e=S4,f_e=O4,d_e=I4,h_e=P4,p_e=T4,g_e=C4,m_e=R4,y_e=[o_e.default,c_e.default,u_e.default,l_e.default,f_e.default,d_e.default,h_e.default,p_e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},g_e.default,m_e.default];w4.default=y_e;var N4={},lm={};Object.defineProperty(lm,"__esModule",{value:!0});lm.validateAdditionalItems=void 0;const Bd=Sr,NN=dn,v_e={message:({params:{len:t}})=>(0,Bd.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Bd._)`{limit: ${t}}`},b_e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:v_e,code(t){const{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,NN.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}oX(t,n)}};function oX(t,e){const{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;const o=r.const("len",(0,Bd._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Bd._)`${o} <= ${e.length}`);else if(typeof n=="object"&&!(0,NN.alwaysValidSchema)(a,n)){const u=r.var("valid",(0,Bd._)`${o} <= ${e.length}`);r.if((0,Bd.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,o,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:NN.Type.Num},u),a.allErrors||r.if((0,Bd.not)(u),()=>r.break())})}}lm.validateAdditionalItems=oX;lm.default=b_e;var D4={},fm={};Object.defineProperty(fm,"__esModule",{value:!0});fm.validateTuple=void 0;const Pq=Sr,nE=dn,w_e=Kr,__e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return cX(t,"additionalItems",e);r.items=!0,!(0,nE.alwaysValidSchema)(r,e)&&t.ok((0,w_e.validateArray)(t))}};function cX(t,e,r=t.schema){const{gen:n,parentSchema:i,data:s,keyword:a,it:o}=t;f(i),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=nE.mergeEvaluated.items(n,r.length,o.items));const c=n.name("valid"),u=n.const("len",(0,Pq._)`${s}.length`);r.forEach((h,m)=>{(0,nE.alwaysValidSchema)(o,h)||(n.if((0,Pq._)`${u} > ${m}`,()=>t.subschema({keyword:a,schemaProp:m,dataProp:m},c)),t.ok(c))});function f(h){const{opts:m,errSchemaPath:y}=o,w=r.length,v=w===h.minItems&&(w===h.maxItems||h[e]===!1);if(m.strictTuples&&!v){const g=`"${a}" is ${w}-tuple, but minItems or maxItems/${e} are not specified or different at path "${y}"`;(0,nE.checkStrictMode)(o,g,m.strictTuples)}}}fm.validateTuple=cX;fm.default=__e;Object.defineProperty(D4,"__esModule",{value:!0});const E_e=fm,x_e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,E_e.validateTuple)(t,"items")};D4.default=x_e;var M4={};Object.defineProperty(M4,"__esModule",{value:!0});const Tq=Sr,A_e=dn,S_e=Kr,O_e=lm,I_e={message:({params:{len:t}})=>(0,Tq.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Tq._)`{limit: ${t}}`},P_e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:I_e,code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,A_e.alwaysValidSchema)(n,e)&&(i?(0,O_e.validateAdditionalItems)(t,i):t.ok((0,S_e.validateArray)(t)))}};M4.default=P_e;var k4={};Object.defineProperty(k4,"__esModule",{value:!0});const _o=Sr,s_=dn,T_e={message:({params:{min:t,max:e}})=>e===void 0?(0,_o.str)`must contain at least ${t} valid item(s)`:(0,_o.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,_o._)`{minContains: ${t}}`:(0,_o._)`{minContains: ${t}, maxContains: ${e}}`},C_e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:T_e,code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;let a,o;const{minContains:c,maxContains:u}=n;s.opts.next?(a=c===void 0?1:c,o=u):a=1;const f=e.const("len",(0,_o._)`${i}.length`);if(t.setParams({min:a,max:o}),o===void 0&&a===0){(0,s_.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&a>o){(0,s_.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,s_.alwaysValidSchema)(s,r)){let v=(0,_o._)`${f} >= ${a}`;o!==void 0&&(v=(0,_o._)`${v} && ${f} <= ${o}`),t.pass(v);return}s.items=!0;const h=e.name("valid");o===void 0&&a===1?y(h,()=>e.if(h,()=>e.break())):a===0?(e.let(h,!0),o!==void 0&&e.if((0,_o._)`${i}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){const v=e.name("_valid"),g=e.let("count",0);y(v,()=>e.if(v,()=>w(g)))}function y(v,g){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:s_.Type.Num,compositeRule:!0},v),g()})}function w(v){e.code((0,_o._)`${v}++`),o===void 0?e.if((0,_o._)`${v} >= ${a}`,()=>e.assign(h,!0).break()):(e.if((0,_o._)`${v} > ${o}`,()=>e.assign(h,!1).break()),a===1?e.assign(h,!0):e.if((0,_o._)`${v} >= ${a}`,()=>e.assign(h,!0)))}}};k4.default=C_e;var uX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=Sr,r=dn,n=Kr;t.error={message:({params:{property:c,depsCount:u,deps:f}})=>{const h=u===1?"property":"properties";return(0,e.str)`must have ${h} ${f} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:f,missingProperty:h}})=>(0,e._)`{property: ${c},
99
- missingProperty: ${h},
100
- depsCount: ${u},
101
- deps: ${f}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){const[u,f]=s(c);a(c,u),o(c,f)}};function s({schema:c}){const u={},f={};for(const h in c){if(h==="__proto__")continue;const m=Array.isArray(c[h])?u:f;m[h]=c[h]}return[u,f]}function a(c,u=c.schema){const{gen:f,data:h,it:m}=c;if(Object.keys(u).length===0)return;const y=f.let("missing");for(const w in u){const v=u[w];if(v.length===0)continue;const g=(0,n.propertyInData)(f,h,w,m.opts.ownProperties);c.setParams({property:w,depsCount:v.length,deps:v.join(", ")}),m.allErrors?f.if(g,()=>{for(const _ of v)(0,n.checkReportMissingProp)(c,_)}):(f.if((0,e._)`${g} && (${(0,n.checkMissingProp)(c,v,y)})`),(0,n.reportMissingProp)(c,y),f.else())}}t.validatePropertyDeps=a;function o(c,u=c.schema){const{gen:f,data:h,keyword:m,it:y}=c,w=f.name("valid");for(const v in u)(0,r.alwaysValidSchema)(y,u[v])||(f.if((0,n.propertyInData)(f,h,v,y.opts.ownProperties),()=>{const g=c.subschema({keyword:m,schemaProp:v},w);c.mergeValidEvaluated(g,w)},()=>f.var(w,!0)),c.ok(w))}t.validateSchemaDeps=o,t.default=i})(uX);var $4={};Object.defineProperty($4,"__esModule",{value:!0});const lX=Sr,R_e=dn,N_e={message:"property name must be valid",params:({params:t})=>(0,lX._)`{propertyName: ${t.propertyName}}`},D_e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:N_e,code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,R_e.alwaysValidSchema)(i,r))return;const s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,lX.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};$4.default=D_e;var z2={};Object.defineProperty(z2,"__esModule",{value:!0});const a_=Kr,Jo=Sr,M_e=Sc,o_=dn,k_e={message:"must NOT have additional properties",params:({params:t})=>(0,Jo._)`{additionalProperty: ${t.additionalProperty}}`},$_e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:k_e,code(t){const{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");const{allErrors:o,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,o_.alwaysValidSchema)(a,r))return;const u=(0,a_.allSchemaProperties)(n.properties),f=(0,a_.allSchemaProperties)(n.patternProperties);h(),t.ok((0,Jo._)`${s} === ${M_e.default.errors}`);function h(){e.forIn("key",i,g=>{!u.length&&!f.length?w(g):e.if(m(g),()=>w(g))})}function m(g){let _;if(u.length>8){const b=(0,o_.schemaRefOrVal)(a,n.properties,"properties");_=(0,a_.isOwnProperty)(e,b,g)}else u.length?_=(0,Jo.or)(...u.map(b=>(0,Jo._)`${g} === ${b}`)):_=Jo.nil;return f.length&&(_=(0,Jo.or)(_,...f.map(b=>(0,Jo._)`${(0,a_.usePattern)(t,b)}.test(${g})`))),(0,Jo.not)(_)}function y(g){e.code((0,Jo._)`delete ${i}[${g}]`)}function w(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){y(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),o||e.break();return}if(typeof r=="object"&&!(0,o_.alwaysValidSchema)(a,r)){const _=e.name("valid");c.removeAdditional==="failing"?(v(g,_,!1),e.if((0,Jo.not)(_),()=>{t.reset(),y(g)})):(v(g,_),o||e.if((0,Jo.not)(_),()=>e.break()))}}function v(g,_,b){const S={keyword:"additionalProperties",dataProp:g,dataPropType:o_.Type.Str};b===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,_)}}};z2.default=$_e;var L4={};Object.defineProperty(L4,"__esModule",{value:!0});const L_e=To,Cq=Kr,XT=dn,Rq=z2,U_e={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Rq.default.code(new L_e.KeywordCxt(s,Rq.default,"additionalProperties"));const a=(0,Cq.allSchemaProperties)(r);for(const h of a)s.definedProperties.add(h);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=XT.mergeEvaluated.props(e,(0,XT.toHash)(a),s.props));const o=a.filter(h=>!(0,XT.alwaysValidSchema)(s,r[h]));if(o.length===0)return;const c=e.name("valid");for(const h of o)u(h)?f(h):(e.if((0,Cq.propertyInData)(e,i,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(c);function u(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},c)}}};L4.default=U_e;var U4={};Object.defineProperty(U4,"__esModule",{value:!0});const Nq=Kr,c_=Sr,Dq=dn,Mq=dn,j_e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,o=(0,Nq.allSchemaProperties)(r),c=o.filter(v=>(0,Dq.alwaysValidSchema)(s,r[v]));if(o.length===0||c.length===o.length&&(!s.opts.unevaluated||s.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof c_.Name)&&(s.props=(0,Mq.evaluatedPropsToName)(e,s.props));const{props:h}=s;m();function m(){for(const v of o)u&&y(v),s.allErrors?w(v):(e.var(f,!0),w(v),e.if(f))}function y(v){for(const g in u)new RegExp(v).test(g)&&(0,Dq.checkStrictMode)(s,`property ${g} matches pattern ${v} (use allowMatchingProperties)`)}function w(v){e.forIn("key",n,g=>{e.if((0,c_._)`${(0,Nq.usePattern)(t,v)}.test(${g})`,()=>{const _=c.includes(v);_||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:g,dataPropType:Mq.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,c_._)`${h}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,c_.not)(f),()=>e.break())})})}}};U4.default=j_e;var j4={};Object.defineProperty(j4,"__esModule",{value:!0});const B_e=dn,F_e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,B_e.alwaysValidSchema)(n,r)){t.fail();return}const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};j4.default=F_e;var B4={};Object.defineProperty(B4,"__esModule",{value:!0});const q_e=Kr,H_e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:q_e.validateUnion,error:{message:"must match a schema in anyOf"}};B4.default=H_e;var F4={};Object.defineProperty(F4,"__esModule",{value:!0});const iE=Sr,z_e=dn,V_e={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,iE._)`{passingSchemas: ${t.passing}}`},G_e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:V_e,code(t){const{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const s=r,a=e.let("valid",!1),o=e.let("passing",null),c=e.name("_valid");t.setParams({passing:o}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((f,h)=>{let m;(0,z_e.alwaysValidSchema)(i,f)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},c),h>0&&e.if((0,iE._)`${c} && ${a}`).assign(a,!1).assign(o,(0,iE._)`[${o}, ${h}]`).else(),e.if(c,()=>{e.assign(a,!0),e.assign(o,h),m&&t.mergeEvaluated(m,iE.Name)})})}}};F4.default=G_e;var q4={};Object.defineProperty(q4,"__esModule",{value:!0});const K_e=dn,W_e={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=e.name("valid");r.forEach((s,a)=>{if((0,K_e.alwaysValidSchema)(n,s))return;const o=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(o)})}};q4.default=W_e;var H4={};Object.defineProperty(H4,"__esModule",{value:!0});const cx=Sr,fX=dn,Y_e={message:({params:t})=>(0,cx.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,cx._)`{failingKeyword: ${t.ifClause}}`},Q_e={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Y_e,code(t){const{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,fX.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=kq(n,"then"),s=kq(n,"else");if(!i&&!s)return;const a=e.let("valid",!0),o=e.name("_valid");if(c(),t.reset(),i&&s){const f=e.let("ifClause");t.setParams({ifClause:f}),e.if(o,u("then",f),u("else",f))}else i?e.if(o,u("then")):e.if((0,cx.not)(o),u("else"));t.pass(a,()=>t.error(!0));function c(){const f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);t.mergeEvaluated(f)}function u(f,h){return()=>{const m=t.subschema({keyword:f},o);e.assign(a,o),t.mergeValidEvaluated(m,a),h?e.assign(h,(0,cx._)`${f}`):t.setParams({ifClause:f})}}}};function kq(t,e){const r=t.schema[e];return r!==void 0&&!(0,fX.alwaysValidSchema)(t,r)}H4.default=Q_e;var z4={};Object.defineProperty(z4,"__esModule",{value:!0});const J_e=dn,X_e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,J_e.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};z4.default=X_e;Object.defineProperty(N4,"__esModule",{value:!0});const Z_e=lm,eEe=D4,tEe=fm,rEe=M4,nEe=k4,iEe=uX,sEe=$4,aEe=z2,oEe=L4,cEe=U4,uEe=j4,lEe=B4,fEe=F4,dEe=q4,hEe=H4,pEe=z4;function gEe(t=!1){const e=[uEe.default,lEe.default,fEe.default,dEe.default,hEe.default,pEe.default,sEe.default,aEe.default,iEe.default,oEe.default,cEe.default];return t?e.push(eEe.default,rEe.default):e.push(Z_e.default,tEe.default),e.push(nEe.default),e}N4.default=gEe;var V4={},G4={};Object.defineProperty(G4,"__esModule",{value:!0});const vi=Sr,mEe={message:({schemaCode:t})=>(0,vi.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,vi._)`{format: ${t}}`},yEe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:mEe,code(t,e){const{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:o}=t,{opts:c,errSchemaPath:u,schemaEnv:f,self:h}=o;if(!c.validateFormats)return;i?m():y();function m(){const w=r.scopeValue("formats",{ref:h.formats,code:c.code.formats}),v=r.const("fDef",(0,vi._)`${w}[${a}]`),g=r.let("fType"),_=r.let("format");r.if((0,vi._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(g,(0,vi._)`${v}.type || "string"`).assign(_,(0,vi._)`${v}.validate`),()=>r.assign(g,(0,vi._)`"string"`).assign(_,v)),t.fail$data((0,vi.or)(b(),S()));function b(){return c.strictSchema===!1?vi.nil:(0,vi._)`${a} && !${_}`}function S(){const A=f.$async?(0,vi._)`(${v}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,vi._)`${_}(${n})`,O=(0,vi._)`(typeof ${_} == "function" ? ${A} : ${_}.test(${n}))`;return(0,vi._)`${_} && ${_} !== true && ${g} === ${e} && !${O}`}}function y(){const w=h.formats[s];if(!w){b();return}if(w===!0)return;const[v,g,_]=S(w);v===e&&t.pass(A());function b(){if(c.strictSchema===!1){h.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function S(O){const E=O instanceof RegExp?(0,vi.regexpCode)(O):c.code.formats?(0,vi._)`${c.code.formats}${(0,vi.getProperty)(s)}`:void 0,p=r.scopeValue("formats",{key:s,ref:O,code:E});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,vi._)`${p}.validate`]:["string",O,p]}function A(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!f.$async)throw new Error("async format in sync schema");return(0,vi._)`await ${_}(${n})`}return typeof g=="function"?(0,vi._)`${_}(${n})`:(0,vi._)`${_}.test(${n})`}}}};G4.default=yEe;Object.defineProperty(V4,"__esModule",{value:!0});const vEe=G4,bEe=[vEe.default];V4.default=bEe;var Fg={};Object.defineProperty(Fg,"__esModule",{value:!0});Fg.contentVocabulary=Fg.metadataVocabulary=void 0;Fg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Fg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(y4,"__esModule",{value:!0});const wEe=v4,_Ee=w4,EEe=N4,xEe=V4,$q=Fg,AEe=[wEe.default,_Ee.default,(0,EEe.default)(),xEe.default,$q.metadataVocabulary,$q.contentVocabulary];y4.default=AEe;var K4={},dX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(dX);Object.defineProperty(K4,"__esModule",{value:!0});const zp=Sr,DN=dX,Lq=va,SEe=dn,OEe={message:({params:{discrError:t,tagName:e}})=>t===DN.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,zp._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},IEe={keyword:"discriminator",type:"object",schemaType:"object",error:OEe,code(t){const{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");const o=n.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=e.let("valid",!1),u=e.const("tag",(0,zp._)`${r}${(0,zp.getProperty)(o)}`);e.if((0,zp._)`typeof ${u} == "string"`,()=>f(),()=>t.error(!1,{discrError:DN.DiscrError.Tag,tag:u,tagName:o})),t.ok(c);function f(){const y=m();e.if(!1);for(const w in y)e.elseIf((0,zp._)`${u} === ${w}`),e.assign(c,h(y[w]));e.else(),t.error(!1,{discrError:DN.DiscrError.Mapping,tag:u,tagName:o}),e.endIf()}function h(y){const w=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:y},w);return t.mergeEvaluated(v,zp.Name),w}function m(){var y;const w={},v=_(i);let g=!0;for(let A=0;A<a.length;A++){let O=a[A];O!=null&&O.$ref&&!(0,SEe.schemaHasRulesButRef)(O,s.self.RULES)&&(O=Lq.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,O==null?void 0:O.$ref),O instanceof Lq.SchemaEnv&&(O=O.schema));const E=(y=O==null?void 0:O.properties)===null||y===void 0?void 0:y[o];if(typeof E!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${o}"`);g=g&&(v||_(O)),b(E,A)}if(!g)throw new Error(`discriminator: "${o}" must be required`);return w;function _({required:A}){return Array.isArray(A)&&A.includes(o)}function b(A,O){if(A.const)S(A.const,O);else if(A.enum)for(const E of A.enum)S(E,O);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function S(A,O){if(typeof A!="string"||A in w)throw new Error(`discriminator: "${o}" values must be unique strings`);w[A]=O}}}};K4.default=IEe;const PEe="http://json-schema.org/draft-07/schema#",TEe="http://json-schema.org/draft-07/schema#",CEe="Core schema meta-schema",REe={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},NEe=["object","boolean"],DEe={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},MEe={$schema:PEe,$id:TEe,title:CEe,definitions:REe,type:NEe,properties:DEe,default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=DJ,n=y4,i=K4,s=MEe,a=["/properties"],o="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(w,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=To;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Sr;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=I1;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var m=P1;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(IN,IN.exports);var hX=IN.exports,MN={exports:{}},kN={exports:{}},$N={exports:{}},LN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Sr,n=["undefined","string","number","object","function","boolean","symbol"];function i(){return{keyword:"typeof",schemaType:["string","array"],code(s){const{data:a,schema:o,schemaValue:c}=s;s.fail(typeof o=="string"?(0,r._)`typeof ${a} != ${o}`:(0,r._)`${c}.indexOf(typeof ${a}) < 0`)},metaSchema:{anyOf:[{type:"string",enum:n},{type:"array",items:{type:"string",enum:n}}]}}}e.default=i,t.exports=i})(LN,LN.exports);var kEe=LN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(kEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})($N,$N.exports);var $Ee=$N.exports,UN={exports:{}},jN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r={Object,Array,Function,Number,String,Date,RegExp};typeof Buffer<"u"&&(r.Buffer=Buffer),typeof Promise<"u"&&(r.Promise=Promise);const n=Object.assign(i,{CONSTRUCTORS:r});function i(){return{keyword:"instanceof",schemaType:["string","array"],compile(a){if(typeof a=="string"){const o=s(a);return c=>c instanceof o}if(Array.isArray(a)){const o=a.map(s);return c=>{for(const u of o)if(c instanceof u)return!0;return!1}}throw new Error("ajv implementation error")},metaSchema:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}}function s(a){const o=r[a];if(o)return o;throw new Error(`invalid "instanceof" keyword value ${a}`)}e.default=n,t.exports=n})(jN,jN.exports);var LEe=jN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(LEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(UN,UN.exports);var UEe=UN.exports,BN={exports:{}},FN={exports:{}},V2={};Object.defineProperty(V2,"__esModule",{value:!0});function jEe(t){return()=>({keyword:t,type:"number",schemaType:"array",macro:function([r,n]){return e(r,n),t==="range"?{minimum:r,maximum:n}:{exclusiveMinimum:r,exclusiveMaximum:n}},metaSchema:{type:"array",minItems:2,maxItems:2,items:{type:"number"}}});function e(r,n){if(r>n||t==="exclusiveRange"&&r===n)throw new Error("There are no numbers in range")}}V2.default=jEe;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const i=(0,r(V2).default)("range");e.default=i,t.exports=i})(FN,FN.exports);var BEe=FN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(BEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(BN,BN.exports);var FEe=BN.exports,qN={exports:{}},HN={exports:{}};(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const i=(0,r(V2).default)("exclusiveRange");e.default=i,t.exports=i})(HN,HN.exports);var qEe=HN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(qEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(qN,qN.exports);var HEe=qN.exports,zN={exports:{}},VN={exports:{}},gl={};Object.defineProperty(gl,"__esModule",{value:!0});gl.usePattern=gl.metaSchemaRef=void 0;const zEe=Sr,VEe="http://json-schema.org/schema";function GEe({defaultMeta:t}={}){return t===!1?{}:{$ref:t||VEe}}gl.metaSchemaRef=GEe;function KEe({gen:t,it:{opts:e}},r,n=e.unicodeRegExp?"u":""){const i=new RegExp(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,zEe._)`new RegExp(${r}, ${n})`})}gl.usePattern=KEe;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Sr,n=gl,i={type:"object",properties:{pattern:{type:"string"},flags:{type:"string",nullable:!0}},required:["pattern"],additionalProperties:!1},s=/^\/(.*)\/([gimuy]*)$/;function a(){return{keyword:"regexp",type:"string",schemaType:["string","object"],code(o){const{data:c,schema:u}=o,f=h(u);o.pass((0,r._)`${f}.test(${c})`);function h(m){if(typeof m=="object")return(0,n.usePattern)(o,m.pattern,m.flags);const y=s.exec(m);if(y)return(0,n.usePattern)(o,y[1],y[2]);throw new Error("cannot parse string into RegExp")}},metaSchema:{anyOf:[{type:"string"},i]}}}e.default=a,t.exports=a})(VN,VN.exports);var WEe=VN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(WEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(zN,zN.exports);var YEe=zN.exports,GN={exports:{}},KN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Sr,n={trimStart:c=>c.trimStart(),trimEnd:c=>c.trimEnd(),trimLeft:c=>c.trimStart(),trimRight:c=>c.trimEnd(),trim:c=>c.trim(),toLowerCase:c=>c.toLowerCase(),toUpperCase:c=>c.toUpperCase(),toEnumCase:(c,u)=>(u==null?void 0:u.hash[o(c)])||c},i=Object.assign(s,{transform:n});function s(){return{keyword:"transform",schemaType:"array",before:"enum",code(c){const{gen:u,data:f,schema:h,parentSchema:m,it:y}=c,{parentData:w,parentDataProperty:v}=y,g=h;if(!g.length)return;let _;if(g.includes("toEnumCase")){const S=a(m);_=u.scopeValue("obj",{ref:S,code:(0,r.stringify)(S)})}u.if((0,r._)`typeof ${f} == "string" && ${w} !== undefined`,()=>{u.assign(f,b(g.slice())),u.assign((0,r._)`${w}[${v}]`,f)});function b(S){if(!S.length)return f;const A=S.pop();if(!(A in n))throw new Error(`transform: unknown transformation ${A}`);const O=u.scopeValue("func",{ref:n[A],code:(0,r._)`require("ajv-keywords/dist/definitions/transform").transform${(0,r.getProperty)(A)}`}),E=b(S);return _&&A==="toEnumCase"?(0,r._)`${O}(${E}, ${_})`:(0,r._)`${O}(${E})`}},metaSchema:{type:"array",items:{type:"string",enum:Object.keys(n)}}}}function a(c){const u={hash:{}};if(!c.enum)throw new Error('transform: "toEnumCase" requires "enum"');for(const f of c.enum){if(typeof f!="string")continue;const h=o(f);if(u.hash[h])throw new Error('transform: "toEnumCase" requires all lowercased "enum" values to be unique');u.hash[h]=f}return u}function o(c){return c.toLowerCase()}e.default=i,t.exports=i})(KN,KN.exports);var QEe=KN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(QEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(GN,GN.exports);var JEe=GN.exports,WN={exports:{}},YN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=d4,n=["number","integer","string","boolean","null"];function i(){return{keyword:"uniqueItemProperties",type:"array",schemaType:"array",compile(a,o){const c=s(a,o);return u=>{if(u.length<=1)return!0;for(let f=0;f<a.length;f++){const h=a[f];if(c[f]){const m={};for(const y of u){if(!y||typeof y!="object")continue;let w=y[h];if(!(w&&typeof w=="object")){if(typeof w=="string"&&(w='"'+w),m[w])return!1;m[w]=!0}}}else for(let m=u.length;m--;){const y=u[m];if(!(!y||typeof y!="object"))for(let w=m;w--;){const v=u[w];if(v&&typeof v=="object"&&r(y[h],v[h]))return!1}}}return!0}},metaSchema:{type:"array",items:{type:"string"}}}}e.default=i;function s(a,o){return a.map(c=>{var u,f,h;const m=(h=(f=(u=o.items)===null||u===void 0?void 0:u.properties)===null||f===void 0?void 0:f[c])===null||h===void 0?void 0:h.type;return Array.isArray(m)?!m.includes("object")&&!m.includes("array"):n.includes(m)})}t.exports=i})(YN,YN.exports);var XEe=YN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(XEe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(WN,WN.exports);var ZEe=WN.exports,QN={exports:{}},JN={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function r(){return{keyword:"allRequired",type:"object",schemaType:"boolean",macro(n,i){if(!n)return!0;const s=Object.keys(i.properties);return s.length===0?!0:{required:s}},dependencies:["properties"]}}e.default=r,t.exports=r})(JN,JN.exports);var exe=JN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(exe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(QN,QN.exports);var txe=QN.exports,XN={exports:{}},ZN={exports:{}},G2={};Object.defineProperty(G2,"__esModule",{value:!0});function rxe(t){return()=>({keyword:t,type:"object",schemaType:"array",macro(e){return e.length===0?!0:e.length===1?{required:e}:{[t==="anyRequired"?"anyOf":"oneOf"]:e.map(n=>({required:[n]}))}},metaSchema:{type:"array",items:{type:"string"}}})}G2.default=rxe;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const i=(0,r(G2).default)("anyRequired");e.default=i,t.exports=i})(ZN,ZN.exports);var nxe=ZN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(nxe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(XN,XN.exports);var ixe=XN.exports,e6={exports:{}},t6={exports:{}};(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const i=(0,r(G2).default)("oneRequired");e.default=i,t.exports=i})(t6,t6.exports);var sxe=t6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(sxe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(e6,e6.exports);var axe=e6.exports,r6={exports:{}},n6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Sr,n=gl,i={message:({params:{missingPattern:a}})=>(0,r.str)`should have property matching pattern '${a}'`,params:({params:{missingPattern:a}})=>(0,r._)`{missingPattern: ${a}}`};function s(){return{keyword:"patternRequired",type:"object",schemaType:"array",error:i,code(a){const{gen:o,schema:c,data:u}=a;if(c.length===0)return;const f=o.let("valid",!0);for(const m of c)h(m);function h(m){const y=o.let("matched",!1);o.forIn("key",u,w=>{o.assign(y,(0,r._)`${(0,n.usePattern)(a,m)}.test(${w})`),o.if(y,()=>o.break())}),a.setParams({missingPattern:m}),o.assign(f,(0,r.and)(f,y)),a.pass(f)}},metaSchema:{type:"array",items:{type:"string",format:"regex"},uniqueItems:!0}}}e.default=s,t.exports=s})(n6,n6.exports);var oxe=n6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(oxe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(r6,r6.exports);var cxe=r6.exports,i6={exports:{}},s6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function r(){return{keyword:"prohibited",type:"object",schemaType:"array",macro:function(n){return n.length===0?!0:n.length===1?{not:{required:n}}:{not:{anyOf:n.map(i=>({required:[i]}))}}},metaSchema:{type:"array",items:{type:"string"}}}}e.default=r,t.exports=r})(s6,s6.exports);var uxe=s6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(uxe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(i6,i6.exports);var lxe=i6.exports,a6={exports:{}},o6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=gl;function n(a){return{keyword:"deepProperties",type:"object",schemaType:"object",macro:function(o){const c=[];for(const u in o)c.push(i(u,o[u]));return{allOf:c}},metaSchema:{type:"object",propertyNames:{type:"string",format:"json-pointer"},additionalProperties:(0,r.metaSchemaRef)(a)}}}e.default=n;function i(a,o){const c=a.split("/"),u={};let f=u;for(let h=1;h<c.length;h++){let m=c[h];const y=h===c.length-1;m=s(m);const w=f.properties={};let v;if(/[0-9]+/.test(m)){let g=+m;for(v=f.items=[],f.type=["object","array"];g--;)v.push({})}else f.type="object";f=y?o:{},w[m]=f,v&&v.push(f)}return u}function s(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}t.exports=n})(o6,o6.exports);var fxe=o6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(fxe),i=(s,a)=>s.addKeyword((0,n.default)(a));e.default=i,t.exports=i})(a6,a6.exports);var dxe=a6.exports,c6={exports:{}},u6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Sr;function n(){return{keyword:"deepRequired",type:"object",schemaType:"array",code(s){const{schema:a,data:o}=s,c=a.map(f=>(0,r._)`(${u(f)}) === undefined`);s.fail((0,r.or)(...c));function u(f){if(f==="")throw new Error("empty JSON pointer not allowed");const h=f.split("/");let m=o;const y=h.map((w,v)=>v?m=(0,r._)`${m}${(0,r.getProperty)(i(w))}`:m);return(0,r.and)(...y)}},metaSchema:{type:"array",items:{type:"string",format:"json-pointer"}}}}e.default=n;function i(s){return s.replace(/~1/g,"/").replace(/~0/g,"~")}t.exports=n})(u6,u6.exports);var hxe=u6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(hxe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(c6,c6.exports);var pxe=c6.exports,l6={exports:{}},f6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r={},n={timestamp:()=>()=>Date.now(),datetime:()=>()=>new Date().toISOString(),date:()=>()=>new Date().toISOString().slice(0,10),time:()=>()=>new Date().toISOString().slice(11),random:()=>()=>Math.random(),randomint:f=>{var h;const m=(h=f==null?void 0:f.max)!==null&&h!==void 0?h:2;return()=>Math.floor(Math.random()*m)},seq:f=>{var h;const m=(h=f==null?void 0:f.name)!==null&&h!==void 0?h:"";return r[m]||(r[m]=0),()=>r[m]++}},i=Object.assign(s,{DEFAULTS:n});function s(){return{keyword:"dynamicDefaults",type:"object",schemaType:["string","object"],modifying:!0,valid:!0,compile(f,h,m){if(!m.opts.useDefaults||m.compositeRule)return()=>!0;const y={};for(const v in f)y[v]=a(f[v]);const w=m.opts.useDefaults==="empty";return v=>{for(const g in f)(v[g]===void 0||w&&(v[g]===null||v[g]===""))&&(v[g]=y[g]());return!0}},metaSchema:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",additionalProperties:!1,required:["func","args"],properties:{func:{type:"string"},args:{type:"object"}}}]}}}}function a(f){return typeof f=="object"?o(f):c(f)}function o({func:f,args:h}){const m=n[f];return u(f,m),m(h)}function c(f=""){const h=n[f];return u(f,h),h()}function u(f,h){if(!h)throw new Error(`invalid "dynamicDefaults" keyword property value: ${f}`)}e.default=i,t.exports=i})(f6,f6.exports);var gxe=f6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(gxe),i=s=>s.addKeyword((0,n.default)());e.default=i,t.exports=i})(l6,l6.exports);var mxe=l6.exports,d6={exports:{}},h6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=Sr,n=gl,i={message:({params:{schemaProp:a}})=>a?(0,r.str)`should match case "${a}" schema`:(0,r.str)`should match default case schema`,params:({params:{schemaProp:a}})=>a?(0,r._)`{failingCase: ${a}}`:(0,r._)`{failingDefault: true}`};function s(a){const o=(0,n.metaSchemaRef)(a);return[{keyword:"select",schemaType:["string","number","boolean","null"],$data:!0,error:i,dependencies:["selectCases"],code(c){const{gen:u,schemaCode:f,parentSchema:h}=c;c.block$data(r.nil,()=>{const m=u.let("valid",!0),y=u.name("_valid"),w=u.const("value",(0,r._)`${f} === null ? "null" : ${f}`);u.if(!1);for(const v in h.selectCases){c.setParams({schemaProp:v}),u.elseIf((0,r._)`"" + ${w} == ${v}`);const g=c.subschema({keyword:"selectCases",schemaProp:v},y);c.mergeEvaluated(g,r.Name),u.assign(m,y)}if(u.else(),h.selectDefault!==void 0){c.setParams({schemaProp:void 0});const v=c.subschema({keyword:"selectDefault"},y);c.mergeEvaluated(v,r.Name),u.assign(m,y)}u.endIf(),c.pass(m)})}},{keyword:"selectCases",dependencies:["select"],metaSchema:{type:"object",additionalProperties:o}},{keyword:"selectDefault",dependencies:["select","selectCases"],metaSchema:o}]}e.default=s,t.exports=s})(h6,h6.exports);var yxe=h6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(yxe),i=(s,a)=>((0,n.default)(a).forEach(o=>s.addKeyword(o)),s);e.default=i,t.exports=i})(d6,d6.exports);var vxe=d6.exports;(function(t,e){var r=$e&&$e.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0});const n=r($Ee),i=r(UEe),s=r(FEe),a=r(HEe),o=r(YEe),c=r(JEe),u=r(ZEe),f=r(txe),h=r(ixe),m=r(axe),y=r(cxe),w=r(lxe),v=r(dxe),g=r(pxe),_=r(mxe),b=r(vxe),S={typeof:n.default,instanceof:i.default,range:s.default,exclusiveRange:a.default,regexp:o.default,transform:c.default,uniqueItemProperties:u.default,allRequired:f.default,anyRequired:h.default,oneRequired:m.default,patternRequired:y.default,prohibited:w.default,deepProperties:v.default,deepRequired:g.default,dynamicDefaults:_.default,select:b.default};e.default=S,t.exports=S})(kN,kN.exports);var bxe=kN.exports;(function(t,e){var r=$e&&$e.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0});const n=r(bxe),i=(a,o)=>{if(Array.isArray(o)){for(const c of o)s(c)(a);return a}if(o)return s(o)(a),a;for(o in n.default)s(o)(a);return a};i.get=s;function s(a){const o=n.default[a];if(!o)throw new Error("Unknown keyword "+a);return o}e.default=i,t.exports=i,t.exports.default=i})(MN,MN.exports);var wxe=MN.exports,p6={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=hX,n=Sr,i=Bg,s=To,a=um,o=Sc,c="errorMessage",u=new r.Name("emUsed"),f={required:"missingProperty",dependencies:"property",dependentRequired:"property"},h=/\$\{[^}]+\}/,m=/\$\{([^}]+)\}/g,y=/^""\s*\+\s*|\s*\+\s*""$/g;function w(g){return{keyword:c,schemaType:["string","object"],post:!0,code(_){const{gen:b,data:S,schema:A,schemaValue:O,it:E}=_;if(E.createErrors===!1)return;const p=A,I=n.strConcat(o.default.instancePath,E.errorPath);b.if(r._`${o.default.errors} > 0`,()=>{if(typeof p=="object"){const[$,k]=B(p);k&&V(k),$&&de($),ve(N(p))}const q=typeof p=="string"?p:p._;q&&j(q),g.keepErrors||L()});function N({properties:q,items:$}){const k={};if(q){k.props={};for(const G in q)k.props[G]=[]}if($){k.items={};for(let G=0;G<$.length;G++)k.items[G]=[]}return k}function B(q){let $,k;for(const G in q){if(G==="properties"||G==="items")continue;const pe=q[G];if(typeof pe=="object"){$||($={});const Q=$[G]={};for(const te in pe)Q[te]=[]}else k||(k={}),k[G]=[]}return[$,k]}function V(q){const $=b.const("emErrors",r.stringify(q)),k=b.const("templates",F(q,A));b.forOf("err",o.default.vErrors,te=>b.if(Y(te,$),()=>b.code(r._`${$}[${te}.keyword].push(${te})`).assign(r._`${te}.${u}`,!0)));const{singleError:G}=g;if(G){const te=b.let("message",r._`""`),ce=b.let("paramsErrors",r._`[]`);pe(T=>{b.if(te,()=>b.code(r._`${te} += ${typeof G=="string"?G:";"}`)),b.code(r._`${te} += ${Q(T)}`),b.assign(ce,r._`${ce}.concat(${$}[${T}])`)}),a.reportError(_,{message:te,params:r._`{errors: ${ce}}`})}else pe(te=>a.reportError(_,{message:Q(te),params:r._`{errors: ${$}[${te}]}`}));function pe(te){b.forIn("key",$,ce=>b.if(r._`${$}[${ce}].length`,()=>te(ce)))}function Q(te){return r._`${te} in ${k} ? ${k}[${te}]() : ${O}[${te}]`}}function de(q){const $=b.const("emErrors",r.stringify(q)),k=[];for(const ce in q)k.push([ce,F(q[ce],A[ce])]);const G=b.const("templates",b.object(...k)),pe=b.scopeValue("obj",{ref:f,code:r.stringify(f)}),Q=b.let("emPropParams"),te=b.let("emParamsErrors");b.forOf("err",o.default.vErrors,ce=>b.if(Y(ce,$),()=>{b.assign(Q,r._`${pe}[${ce}.keyword]`),b.assign(te,r._`${$}[${ce}.keyword][${ce}.params[${Q}]]`),b.if(te,()=>b.code(r._`${te}.push(${ce})`).assign(r._`${ce}.${u}`,!0))})),b.forIn("key",$,ce=>b.forIn("keyProp",r._`${$}[${ce}]`,T=>{b.assign(te,r._`${$}[${ce}][${T}]`),b.if(r._`${te}.length`,()=>{const le=b.const("tmpl",r._`${G}[${ce}] && ${G}[${ce}][${T}]`);a.reportError(_,{message:r._`${le} ? ${le}() : ${O}[${ce}][${T}]`,params:r._`{errors: ${te}}`})})}))}function ve(q){const{props:$,items:k}=q;if(!$&&!k)return;const G=r._`typeof ${S} == "object"`,pe=r._`Array.isArray(${S})`,Q=b.let("emErrors");let te,ce;const T=b.let("templates");$&&k?(te=b.let("emChildKwd"),b.if(G),b.if(pe,()=>{le(k,A.items),b.assign(te,r.str`items`)},()=>{le($,A.properties),b.assign(te,r.str`properties`)}),ce=r._`[${te}]`):k?(b.if(pe),le(k,A.items),ce=r._`.items`):$&&(b.if(n.and(G,n.not(pe))),le($,A.properties),ce=r._`.properties`),b.forOf("err",o.default.vErrors,Ge=>ne(Ge,Q,tt=>b.code(r._`${Q}[${tt}].push(${Ge})`).assign(r._`${Ge}.${u}`,!0))),b.forIn("key",Q,Ge=>b.if(r._`${Q}[${Ge}].length`,()=>{a.reportError(_,{message:r._`${Ge} in ${T} ? ${T}[${Ge}]() : ${O}${ce}[${Ge}]`,params:r._`{errors: ${Q}[${Ge}]}`}),b.assign(r._`${o.default.vErrors}[${o.default.errors}-1].instancePath`,r._`${I} + "/" + ${Ge}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),b.endIf();function le(Ge,tt){b.assign(Q,r.stringify(Ge)),b.assign(T,F(Ge,tt))}}function j(q){const $=b.const("emErrs",r._`[]`);b.forOf("err",o.default.vErrors,k=>b.if(U(k),()=>b.code(r._`${$}.push(${k})`).assign(r._`${k}.${u}`,!0))),b.if(r._`${$}.length`,()=>a.reportError(_,{message:H(q),params:r._`{errors: ${$}}`}))}function L(){const q=b.const("emErrs",r._`[]`);b.forOf("err",o.default.vErrors,$=>b.if(r._`!${$}.${u}`,()=>b.code(r._`${q}.push(${$})`))),b.assign(o.default.vErrors,q).assign(o.default.errors,r._`${q}.length`)}function Y(q,$){return n.and(r._`${q}.keyword !== ${c}`,r._`!${q}.${u}`,r._`${q}.instancePath === ${I}`,r._`${q}.keyword in ${$}`,r._`${q}.schemaPath.indexOf(${E.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${q}.schemaPath.slice(${E.errSchemaPath.length}))`)}function ne(q,$,k){b.if(n.and(r._`${q}.keyword !== ${c}`,r._`!${q}.${u}`,r._`${q}.instancePath.indexOf(${I}) === 0`),()=>{const G=b.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),pe=b.const("emMatches",r._`${G}.exec(${q}.instancePath.slice(${I}.length))`),Q=b.const("emChild",r._`${pe} && ${pe}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);b.if(r._`${Q} !== undefined && ${Q} in ${$}`,()=>k(Q))})}function U(q){return n.and(r._`${q}.keyword !== ${c}`,r._`!${q}.${u}`,n.or(r._`${q}.instancePath === ${I}`,n.and(r._`${q}.instancePath.indexOf(${I}) === 0`,r._`${q}.instancePath[${I}.length] === "/"`)),r._`${q}.schemaPath.indexOf(${E.errSchemaPath}) === 0`,r._`${q}.schemaPath[${E.errSchemaPath}.length] === "/"`)}function F(q,$){const k=[];for(const G in q){const pe=$[G];h.test(pe)&&k.push([G,M(pe)])}return b.object(...k)}function H(q){return h.test(q)?new i._Code(i.safeStringify(q).replace(m,($,k)=>`" + JSON.stringify(${s.getData(k,E)}) + "`).replace(y,"")):r.stringify(q)}function M(q){return r._`function(){return ${H(q)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const v=(g,_={})=>{if(!g.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(g.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return g.addKeyword(w(_))};e.default=v,t.exports=v,t.exports.default=v})(p6,p6.exports);var _xe=p6.exports,W4=$e&&$e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.validateType=Tt.generateLazyValidator=Tt.Ajv=void 0;const pX=W4(hX);Tt.Ajv=pX.default;const Exe=W4(wxe),xxe=W4(_xe);function Axe(t,e){let r=null;const n=(i,s)=>{if(!r){const a=new pX.default({$data:!0,allErrors:!0});(0,Exe.default)(a),(0,xxe.default)(a,{singleError:!0}),e==null||e.forEach(o=>a.addKeyword(o)),r=a.compile(t),Object.defineProperty(n,"errors",{get(){return r==null?void 0:r.errors}})}return r(i,s)};return n}Tt.generateLazyValidator=Axe;function Sxe(t,e){return t.validate(e)}Tt.validateType=Sxe;var ZT={},Uq;function gX(){return Uq||(Uq=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getChainId=t.ChainName=void 0;const e=Tt,r=Ka();var n;(function(s){s.ETHEREUM_MAINNET="Ethereum Mainnet",s.ETHEREUM_ROPSTEN="Ropsten",s.ETHEREUM_RINKEBY="Rinkeby",s.ETHEREUM_GOERLI="Goerli",s.ETHEREUM_KOVAN="Kovan",s.ETHEREUM_SEPOLIA="Sepolia",s.MATIC_MAINNET="Polygon",s.MATIC_MUMBAI="Mumbai"})(n=t.ChainName||(t.ChainName={}));function i(s){switch(s){case n.ETHEREUM_MAINNET:return r.ChainId.ETHEREUM_MAINNET;case n.ETHEREUM_ROPSTEN:return r.ChainId.ETHEREUM_ROPSTEN;case n.ETHEREUM_RINKEBY:return r.ChainId.ETHEREUM_RINKEBY;case n.ETHEREUM_GOERLI:return r.ChainId.ETHEREUM_GOERLI;case n.ETHEREUM_KOVAN:return r.ChainId.ETHEREUM_KOVAN;case n.ETHEREUM_SEPOLIA:return r.ChainId.ETHEREUM_SEPOLIA;case n.MATIC_MAINNET:return r.ChainId.MATIC_MAINNET;case n.MATIC_MUMBAI:return r.ChainId.MATIC_MUMBAI;default:return null}}t.getChainId=i,function(s){s.schema={type:"string",enum:Object.values(s)},s.validate=(0,e.generateLazyValidator)(s.schema)}(n=t.ChainName||(t.ChainName={}))}(ZT)),ZT}var Bo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Network=void 0;const e=Tt;(function(r){r.ETHEREUM="ETHEREUM",r.MATIC="MATIC"})(t.Network||(t.Network={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.Network||(t.Network={}))})(Bo);var jq;function Ka(){return jq||(jq=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getNetwork=t.getNetworkMapping=t.getURNProtocol=t.getChainName=t.ChainId=void 0;const e=Tt,r=gX(),n=Bo;var i;(function(u){u[u.ETHEREUM_MAINNET=1]="ETHEREUM_MAINNET",u[u.ETHEREUM_ROPSTEN=3]="ETHEREUM_ROPSTEN",u[u.ETHEREUM_RINKEBY=4]="ETHEREUM_RINKEBY",u[u.ETHEREUM_GOERLI=5]="ETHEREUM_GOERLI",u[u.ETHEREUM_KOVAN=42]="ETHEREUM_KOVAN",u[u.ETHEREUM_SEPOLIA=11155111]="ETHEREUM_SEPOLIA",u[u.MATIC_MAINNET=137]="MATIC_MAINNET",u[u.MATIC_MUMBAI=80001]="MATIC_MUMBAI"})(i=t.ChainId||(t.ChainId={}));function s(u){switch(u){case i.ETHEREUM_MAINNET:return r.ChainName.ETHEREUM_MAINNET;case i.ETHEREUM_ROPSTEN:return r.ChainName.ETHEREUM_ROPSTEN;case i.ETHEREUM_RINKEBY:return r.ChainName.ETHEREUM_RINKEBY;case i.ETHEREUM_GOERLI:return r.ChainName.ETHEREUM_GOERLI;case i.ETHEREUM_KOVAN:return r.ChainName.ETHEREUM_KOVAN;case i.ETHEREUM_SEPOLIA:return r.ChainName.ETHEREUM_SEPOLIA;case i.MATIC_MAINNET:return r.ChainName.MATIC_MAINNET;case i.MATIC_MUMBAI:return r.ChainName.MATIC_MUMBAI;default:return null}}t.getChainName=s;function a(u){switch(u){case i.ETHEREUM_MAINNET:return"ethereum";case i.ETHEREUM_ROPSTEN:return"ropsten";case i.ETHEREUM_RINKEBY:return"rinkeby";case i.ETHEREUM_GOERLI:return"goerli";case i.ETHEREUM_KOVAN:return"kovan";case i.ETHEREUM_SEPOLIA:return"sepolia";case i.MATIC_MAINNET:return"matic";case i.MATIC_MUMBAI:return"mumbai"}}t.getURNProtocol=a;function o(u){switch(u){case i.ETHEREUM_MAINNET:return{[n.Network.ETHEREUM]:i.ETHEREUM_MAINNET,[n.Network.MATIC]:i.MATIC_MAINNET};case i.ETHEREUM_ROPSTEN:return{[n.Network.ETHEREUM]:i.ETHEREUM_ROPSTEN,[n.Network.MATIC]:i.MATIC_MUMBAI};case i.ETHEREUM_RINKEBY:return{[n.Network.ETHEREUM]:i.ETHEREUM_RINKEBY,[n.Network.MATIC]:i.MATIC_MUMBAI};case i.ETHEREUM_GOERLI:return{[n.Network.ETHEREUM]:i.ETHEREUM_GOERLI,[n.Network.MATIC]:i.MATIC_MUMBAI};case i.ETHEREUM_KOVAN:return{[n.Network.ETHEREUM]:i.ETHEREUM_KOVAN,[n.Network.MATIC]:i.MATIC_MUMBAI};case i.ETHEREUM_SEPOLIA:return{[n.Network.ETHEREUM]:i.ETHEREUM_SEPOLIA,[n.Network.MATIC]:i.MATIC_MUMBAI};case i.MATIC_MAINNET:return{[n.Network.ETHEREUM]:i.MATIC_MAINNET,[n.Network.MATIC]:i.MATIC_MAINNET};case i.MATIC_MUMBAI:return{[n.Network.ETHEREUM]:i.MATIC_MUMBAI,[n.Network.MATIC]:i.MATIC_MUMBAI}}}t.getNetworkMapping=o;function c(u){switch(u){case i.ETHEREUM_MAINNET:case i.ETHEREUM_ROPSTEN:case i.ETHEREUM_GOERLI:case i.ETHEREUM_KOVAN:case i.ETHEREUM_RINKEBY:case i.ETHEREUM_SEPOLIA:return n.Network.ETHEREUM;case i.MATIC_MAINNET:case i.MATIC_MUMBAI:return n.Network.MATIC}}t.getNetwork=c,function(u){u.schema={type:"number",enum:Object.values(u)},u.validate=(0,e.generateLazyValidator)(u.schema)}(i=t.ChainId||(t.ChainId={}))}(KT)),KT}var gc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=void 0;const e=Tt;(function(r){r.INJECTED="injected",r.MAGIC="magic",r.FORTMATIC="formatic",r.NETWORK="network",r.WALLET_CONNECT="wallet_connect",r.WALLET_CONNECT_V2="wallet_connect_v2",r.WALLET_LINK="wallet_link",r.METAMASK_MOBILE="metamask_mobile"})(t.ProviderType||(t.ProviderType={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.ProviderType||(t.ProviderType={}))})(gc);var I0;(function(t){t.Update="Web3ReactUpdate",t.Error="Web3ReactError",t.Deactivate="Web3ReactDeactivate"})(I0||(I0={}));const Oxe=Object.freeze(Object.defineProperty({__proto__:null,get ConnectorEvent(){return I0}},Symbol.toStringTag,{value:"Module"})),Ixe=Ia(Oxe);var Y4={},K2={},Q4={exports:{}},P0=typeof Reflect=="object"?Reflect:null,Bq=P0&&typeof P0.apply=="function"?P0.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},sE;P0&&typeof P0.ownKeys=="function"?sE=P0.ownKeys:Object.getOwnPropertySymbols?sE=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:sE=function(e){return Object.getOwnPropertyNames(e)};function Pxe(t){console&&console.warn&&console.warn(t)}var mX=Number.isNaN||function(e){return e!==e};function Nn(){Nn.init.call(this)}Q4.exports=Nn;Q4.exports.once=Nxe;Nn.EventEmitter=Nn;Nn.prototype._events=void 0;Nn.prototype._eventsCount=0;Nn.prototype._maxListeners=void 0;var Fq=10;function W2(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Nn,"defaultMaxListeners",{enumerable:!0,get:function(){return Fq},set:function(t){if(typeof t!="number"||t<0||mX(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Fq=t}});Nn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Nn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||mX(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function yX(t){return t._maxListeners===void 0?Nn.defaultMaxListeners:t._maxListeners}Nn.prototype.getMaxListeners=function(){return yX(this)};Nn.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Bq(c,this,r);else for(var u=c.length,f=EX(c,u),n=0;n<u;++n)Bq(f[n],this,r);return!0};function vX(t,e,r,n){var i,s,a;if(W2(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),a=s[e]),a===void 0)a=s[e]=r,++t._eventsCount;else if(typeof a=="function"?a=s[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),i=yX(t),i>0&&a.length>i&&!a.warned){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=t,o.type=e,o.count=a.length,Pxe(o)}return t}Nn.prototype.addListener=function(e,r){return vX(this,e,r,!1)};Nn.prototype.on=Nn.prototype.addListener;Nn.prototype.prependListener=function(e,r){return vX(this,e,r,!0)};function Txe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function bX(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Txe.bind(n);return i.listener=r,n.wrapFn=i,i}Nn.prototype.once=function(e,r){return W2(r),this.on(e,bX(this,e,r)),this};Nn.prototype.prependOnceListener=function(e,r){return W2(r),this.prependListener(e,bX(this,e,r)),this};Nn.prototype.removeListener=function(e,r){var n,i,s,a,o;if(W2(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){o=n[a].listener,s=a;break}if(s<0)return this;s===0?n.shift():Cxe(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,o||r)}return this};Nn.prototype.off=Nn.prototype.removeListener;Nn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),a;for(i=0;i<s.length;++i)a=s[i],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function wX(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Rxe(i):EX(i,i.length)}Nn.prototype.listeners=function(e){return wX(this,e,!0)};Nn.prototype.rawListeners=function(e){return wX(this,e,!1)};Nn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):_X.call(t,e)};Nn.prototype.listenerCount=_X;function _X(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Nn.prototype.eventNames=function(){return this._eventsCount>0?sE(this._events):[]};function EX(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Cxe(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Rxe(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Nxe(t,e){return new Promise(function(r,n){function i(a){t.removeListener(e,s),n(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}xX(t,e,s,{once:!0}),e!=="error"&&Dxe(t,i,{once:!0})})}function Dxe(t,e,r){typeof t.on=="function"&&xX(t,"error",e,r)}function xX(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var Pa=Q4.exports;const J4=_c(Pa);function Mxe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Y2=function(t){Mxe(e,t);function e(n){var i,s=n===void 0?{}:n,a=s.supportedChainIds;return i=t.call(this)||this,i.supportedChainIds=a,i}var r=e.prototype;return r.emitUpdate=function(i){this.emit(I0.Update,i)},r.emitError=function(i){this.emit(I0.Error,i)},r.emitDeactivate=function(){this.emit(I0.Deactivate)},e}(Pa.EventEmitter);const kxe=Object.freeze(Object.defineProperty({__proto__:null,AbstractConnector:Y2},Symbol.toStringTag,{value:"Module"})),AX=Ia(kxe);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractConnector=void 0;const e=AX;Object.defineProperty(t,"AbstractConnector",{enumerable:!0,get:function(){return e.AbstractConnector}})})(K2);var Q2={},ml={},SX={},OX={},IX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SceneUpdate=t.SCENE_UPDATE=void 0;const e=Tt;t.SCENE_UPDATE="SCENE_UPDATE",function(r){r.schema={type:"object",properties:{type:{type:"string",enum:[t.SCENE_UPDATE]},payload:{type:"object",properties:{sceneId:{type:"string"},sceneType:{type:"string"}},additionalProperties:!1,required:["sceneId","sceneType"]}},required:["payload","type"]},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.SceneUpdate||(t.SceneUpdate={}))})(IX);var PX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Update=t.UPDATE=void 0;const e=Tt;t.UPDATE="update",function(r){r.schema={type:"object",properties:{type:{type:"string",enum:[t.UPDATE]}},required:["type"]},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.Update||(t.Update={}))})(PX);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(IX,t),r(PX,t)})(OX);var TX={},CX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProjectType=void 0;const e=Tt;(function(r){r.SCENE="scene",r.SMART_ITEM="smart-item",r.PORTABLE_EXPERIENCE="portable-experience",r.LIBRARY="library"})(t.ProjectType||(t.ProjectType={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.ProjectType||(t.ProjectType={}))})(CX);var RX={},C1={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Rarity=void 0;const e=Tt;(function(r){r.UNIQUE="unique",r.MYTHIC="mythic",r.LEGENDARY="legendary",r.EPIC="epic",r.RARE="rare",r.UNCOMMON="uncommon",r.COMMON="common"})(t.Rarity||(t.Rarity={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema);const n={[r.UNIQUE]:1,[r.MYTHIC]:10,[r.LEGENDARY]:100,[r.EPIC]:1e3,[r.RARE]:5e3,[r.UNCOMMON]:1e4,[r.COMMON]:1e5},i={[r.UNIQUE]:"#FFE617",[r.MYTHIC]:"#FB7DE3",[r.LEGENDARY]:"#A657ED",[r.EPIC]:"#6397F2",[r.RARE]:"#3AD682",[r.UNCOMMON]:"#FF8563",[r.COMMON]:"#D4E0E0"},s={[r.UNIQUE]:"#FFB626",[r.MYTHIC]:"#FF63E1",[r.LEGENDARY]:"#842DDA",[r.EPIC]:"#3D85E6",[r.RARE]:"#36CF75",[r.UNCOMMON]:"#ED6D4F",[r.COMMON]:"#ABC1C1"};function a(u){return n[u]}r.getMaxSupply=a;function o(u){return s[u]}r.getColor=o;function c(u){return[i[u],s[u]]}r.getGradient=c}(t.Rarity||(t.Rarity={}))})(C1);var Zf={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WearableCategory=void 0;const e=Tt;(function(r){r.EYEBROWS="eyebrows",r.EYES="eyes",r.FACIAL_HAIR="facial_hair",r.HAIR="hair",r.BODY_SHAPE="body_shape",r.MOUTH="mouth",r.UPPER_BODY="upper_body",r.LOWER_BODY="lower_body",r.FEET="feet",r.EARRING="earring",r.EYEWEAR="eyewear",r.HAT="hat",r.HELMET="helmet",r.MASK="mask",r.TIARA="tiara",r.TOP_HEAD="top_head",r.SKIN="skin",r.HANDS_WEAR="hands_wear"})(t.WearableCategory||(t.WearableCategory={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.WearableCategory||(t.WearableCategory={}))})(Zf);var J2={},X2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BodyShape=void 0;const e=Tt;(function(r){r.MALE="urn:decentraland:off-chain:base-avatars:BaseMale",r.FEMALE="urn:decentraland:off-chain:base-avatars:BaseFemale"})(t.BodyShape||(t.BodyShape={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.BodyShape||(t.BodyShape={}))})(X2);var Z2={},X4={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BodyPartCategory=void 0;const e=Tt;(function(r){r.HEAD="head",r.HANDS="hands"})(t.BodyPartCategory||(t.BodyPartCategory={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.BodyPartCategory||(t.BodyPartCategory={}))})(X4);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.HideableWearableCategory=void 0;const e=Zf,r=Tt,n=X4;(function(i){i.schema={oneOf:[Object.assign({},e.WearableCategory.schema),Object.assign({},n.BodyPartCategory.schema)]},i.validate=(0,r.generateLazyValidator)(i.schema)})(t.HideableWearableCategory||(t.HideableWearableCategory={}))})(Z2);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WearableRepresentation=void 0;const e=Tt,r=X2,n=Z2;(function(i){i.schema={type:"object",properties:{bodyShapes:{type:"array",items:r.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}}},overrideHides:{type:"array",items:n.HideableWearableCategory.schema},overrideReplaces:{type:"array",items:n.HideableWearableCategory.schema}},required:["bodyShapes","mainFile","contents","overrideHides","overrideReplaces"]},i.validate=(0,e.generateLazyValidator)(i.schema)})(t.WearableRepresentation||(t.WearableRepresentation={}))})(J2);var eA={},NX={},Z4={},Wh={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IPFSv1=t.IPFSv2=t.EthAddress=t.Color3=void 0;const e=Tt;(function(r){r.schema={type:"object",required:["r","g","b"],properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}}};const n=(0,e.generateLazyValidator)(r.schema);r.validate=i=>n(i)})(t.Color3||(t.Color3={})),function(r){r.schema={type:"string",pattern:"^0x[a-fA-F0-9]{40}$"};const n=new RegExp(r.schema.pattern);r.validate=i=>n.test(i)}(t.EthAddress||(t.EthAddress={})),function(r){r.schema={type:"string",pattern:"^(ba)[a-zA-Z0-9]{57}$"};const n=new RegExp(r.schema.pattern);r.validate=i=>n.test(i)}(t.IPFSv2||(t.IPFSv2={})),function(r){r.schema={type:"string",pattern:"^(Qm)[a-zA-Z0-9]{44}$"};const n=new RegExp(r.schema.pattern);r.validate=i=>n.test(i)}(t.IPFSv1||(t.IPFSv1={}))})(Wh);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Avatar=t.Link=t.LinkUrl=t.AvatarInfo=t.Snapshots=void 0;const e=Zf,r=Wh,n=Tt;var i;(function(c){c.schema={type:"object",required:["face256","body"],properties:{face256:r.IPFSv2.schema,body:r.IPFSv2.schema}},c.validate=(0,n.generateLazyValidator)(c.schema)})(i=t.Snapshots||(t.Snapshots={}));var s;(function(c){c.schema={type:"object",required:["bodyShape","eyes","hair","skin"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:r.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:r.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:r.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:e.WearableCategory.schema},emotes:{type:"array",items:{type:"object",properties:{slot:{type:"number"},urn:{type:"string"}},required:["slot","urn"]},nullable:!0},snapshots:i.schema},additionalProperties:!0},c.validate=(0,n.generateLazyValidator)(c.schema)})(s=t.AvatarInfo||(t.AvatarInfo={}));var a;(function(c){c.schema={type:"string",pattern:"^[(http(s)?):\\/\\/(www\\.)?a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)$"};const u=new RegExp(c.schema.pattern,"i");c.validate=f=>u.test(f)})(a=t.LinkUrl||(t.LinkUrl={}));var o;(function(c){c.schema={type:"object",required:["title","url"],properties:{title:{type:"string"},url:a.schema}}})(o=t.Link||(t.Link={})),function(c){c.schema={type:"object",required:["name","description","ethAddress","version","tutorialStep","avatar","hasClaimedName"],properties:{userId:{type:"string"},name:{type:"string"},description:{type:"string"},links:{type:"array",maxItems:5,items:o.schema,nullable:!0},country:{nullable:!0,type:"string"},employmentStatus:{nullable:!0,type:"string"},gender:{nullable:!0,type:"string"},pronouns:{nullable:!0,type:"string"},relationshipStatus:{nullable:!0,type:"string"},sexualOrientation:{nullable:!0,type:"string"},language:{nullable:!0,type:"string"},profession:{nullable:!0,type:"string"},birthdate:{nullable:!0,type:"number"},realName:{nullable:!0,type:"string"},hobbies:{nullable:!0,type:"string"},ethAddress:r.EthAddress.schema,version:{type:"number"},tutorialStep:{type:"number"},email:{type:"string",nullable:!0},blocked:{type:"array",items:{type:"string"},nullable:!0},muted:{type:"array",items:{type:"string"},nullable:!0},interests:{type:"array",items:{type:"string"},nullable:!0},hasClaimedName:{type:"boolean"},hasConnectedWeb3:{type:"boolean",nullable:!0},avatar:s.schema},additionalProperties:!0},c.validate=(0,n.generateLazyValidator)(c.schema)}(t.Avatar||(t.Avatar={}))})(Z4);var DX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Profile=void 0;const e=Tt,r=Z4;(function(n){n.schema={type:"object",required:["avatars"],properties:{avatars:{type:"array",items:r.Avatar.schema}},additionalProperties:!0},n.validate=(0,e.generateLazyValidator)(n.schema)})(t.Profile||(t.Profile={}))})(DX);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Z4,t),r(DX,t)})(NX);var MX={},eD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FeatureToggles=t.portableExperiencesToggles=t.toggles=void 0;const e=Tt;t.toggles=["enabled","disabled"],t.portableExperiencesToggles=[...t.toggles,"hideUi"],function(r){r.schema={type:"object",properties:{voiceChat:{type:"string",enum:t.toggles,nullable:!0},portableExperiences:{type:"string",enum:t.portableExperiencesToggles,nullable:!0,errorMessage:`valid options are ${t.portableExperiencesToggles.join(", ")}`}},errorMessage:`valid options are ${t.toggles.join(", ")}`,required:[]},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.FeatureToggles||(t.FeatureToggles={}))})(eD);var tD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorldConfiguration=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{name:{type:"string",nullable:!0},skybox:{type:"number",nullable:!0},minimapVisible:{type:"boolean",nullable:!0},miniMapConfig:{type:"object",nullable:!0,properties:{visible:{type:"boolean",nullable:!0},dataImage:{type:"string",nullable:!0},estateImage:{type:"string",nullable:!0}}},skyboxConfig:{type:"object",nullable:!0,properties:{fixedTime:{type:"number",nullable:!0},textures:{type:"array",nullable:!0,items:{type:"string"},oneOf:[{minItems:0,maxItems:0},{minItems:1,maxItems:1},{minItems:6,maxItems:6}],errorMessage:"customSkybox must be an array of 0, 1 or 6 strings"}}},fixedAdapter:{type:"string",nullable:!0},placesConfig:{type:"object",nullable:!0,properties:{optOut:{type:"boolean",nullable:!0}}}},required:[]},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.WorldConfiguration||(t.WorldConfiguration={}))})(tD);var rD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SceneParcels=void 0;const e=Tt;(function(r){r.schema={description:'Describes a scene, a set of parcels whose content is treated as the same entity. A list of parcels is listed, for which one of them is considered the "base" for positioning purposes.',type:"object",properties:{base:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},parcels:{type:"array",items:{type:"string",pattern:"^-?[0-9]+,-?[0-9]+$"},minItems:1}},additionalProperties:!0,required:["base","parcels"]},r.schemaValidator=(0,e.generateLazyValidator)(r.schema),r.validate=n=>r.schemaValidator(n)&&n.parcels.includes(n.base)})(t.SceneParcels||(t.SceneParcels={}))})(rD);var kX={},dm={};Object.defineProperty(dm,"__esModule",{value:!0});dm.displayableProperties=void 0;dm.displayableProperties={menuBarIcon:{description:"Name of the file used as icon for the MenuBar",type:"string",nullable:!0}};var nD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{version:{type:"number",nullable:!0},origin:{type:"string"},projectId:{type:"string"},point:{type:"object",properties:{x:{type:"integer"},y:{type:"integer"}},nullable:!0,required:["x","y"]},rotation:{type:"string",enum:["north","east","south","west"],nullable:!0},layout:{type:"object",properties:{rows:{type:"integer"},cols:{type:"integer"}},nullable:!0,required:["rows","cols"]},isEmpty:{type:"boolean",nullable:!0}},additionalProperties:!0,required:["origin","projectId"]},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.Source||(t.Source={}))})(nD);var iD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpawnPoint=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{name:{type:"string",nullable:!0},position:{type:"object",oneOf:[{$ref:"#single-position"},{$ref:"#multi-position"}],required:["x","y","z"]},default:{type:"boolean",nullable:!0},cameraTarget:{type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],nullable:!0}},required:["position"],definitions:{"single-position":{$id:"#single-position",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"]},"multi-position":{$id:"#multi-position",type:"object",properties:{x:{type:"array",items:{type:"number"},minItems:1},y:{type:"array",items:{type:"number"},minItems:1},z:{type:"array",items:{type:"number"},minItems:1}},required:["x","y","z"]}}},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.SpawnPoint||(t.SpawnPoint={}))})(iD);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Scene=t.RequiredPermission=void 0;const e=Tt,r=dm,n=eD,i=rD,s=nD,a=iD,o=tD;var c;(function(u){u.ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE="ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE",u.ALLOW_TO_TRIGGER_AVATAR_EMOTE="ALLOW_TO_TRIGGER_AVATAR_EMOTE",u.ALLOW_MEDIA_HOSTNAMES="ALLOW_MEDIA_HOSTNAMES",u.USE_WEB3_API="USE_WEB3_API",u.USE_FETCH="USE_FETCH",u.USE_WEBSOCKET="USE_WEBSOCKET",u.OPEN_EXTERNAL_LINK="OPEN_EXTERNAL_LINK"})(c=t.RequiredPermission||(t.RequiredPermission={})),function(u){u.schema={type:"object",properties:Object.assign(Object.assign({isPortableExperience:{description:"Define the current scene as a Portable Experience",type:"boolean",nullable:!0},main:{description:"File that contains the entry point of the scene's code",type:"string",minLength:1},scene:i.SceneParcels.schema},r.displayableProperties),{display:{description:"Information related to how should this land be displayed apart from the normal rendering of the scene",type:"object",properties:{title:{description:"A name so other users can identify what the contents of this land should be",type:"string",nullable:!0},favicon:{description:"DEPRECATED. Allow the land owner to set up a favicon to this land",type:"string",nullable:!0},description:{description:"A description that will be shown on client's nav map when the scene is selected",type:"string",nullable:!0},navmapThumbnail:{type:"string",nullable:!0}},nullable:!0,required:[]},owner:{type:"string",nullable:!0},contact:{description:"Describe different ways of contacting the land owner",type:"object",properties:{name:{type:"string",nullable:!0},email:{type:"string",nullable:!0},im:{type:"string",nullable:!0},url:{type:"string",nullable:!0}},nullable:!0,required:[]},tags:{type:"array",items:{type:"string",minLength:1},nullable:!0},source:Object.assign(Object.assign({},s.Source.schema),{nullable:!0}),spawnPoints:{type:"array",items:a.SpawnPoint.schema,nullable:!0},requiredPermissions:{type:"array",items:{type:"string",enum:Object.values(c)},uniqueItems:!0,nullable:!0},featureToggles:Object.assign(Object.assign({},n.FeatureToggles.schema),{nullable:!0}),worldConfiguration:Object.assign(Object.assign({},o.WorldConfiguration.schema),{nullable:!0}),allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!0}}),additionalProperties:!0,required:["main","scene"],dependencies:{requiredPermissions:{if:{properties:{requiredPermissions:{type:"array",contains:{const:c.ALLOW_MEDIA_HOSTNAMES}}}},then:{properties:{allowedMediaHostnames:{type:"array",items:{type:"string"},nullable:!1,minItems:1}},required:["allowedMediaHostnames"]},else:{properties:{allowedMediaHostnames:{type:["null","array"],nullable:!0,maxItems:0}}}}}},u.validate=(0,e.generateLazyValidator)(u.schema)}(t.Scene||(t.Scene={}))})(kX);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpawnPoint=t.Source=t.RequiredPermission=t.Scene=t.SceneParcels=t.WorldConfiguration=t.FeatureToggles=void 0;var e=eD;Object.defineProperty(t,"FeatureToggles",{enumerable:!0,get:function(){return e.FeatureToggles}});var r=tD;Object.defineProperty(t,"WorldConfiguration",{enumerable:!0,get:function(){return r.WorldConfiguration}});var n=rD;Object.defineProperty(t,"SceneParcels",{enumerable:!0,get:function(){return n.SceneParcels}});var i=kX;Object.defineProperty(t,"Scene",{enumerable:!0,get:function(){return i.Scene}}),Object.defineProperty(t,"RequiredPermission",{enumerable:!0,get:function(){return i.RequiredPermission}});var s=nD;Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return s.Source}});var a=iD;Object.defineProperty(t,"SpawnPoint",{enumerable:!0,get:function(){return a.SpawnPoint}})})(MX);var eC={},sD={},aD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Locale=void 0;const e=Tt;(function(r){r.EN="en",r.ES="es"})(t.Locale||(t.Locale={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.Locale||(t.Locale={}))})(aD);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.I18N=void 0;const e=Tt,r=aD;(function(n){n.schema={type:"object",properties:{code:r.Locale.schema,text:{type:"string"}},additionalProperties:!0,required:["code","text"]},n.validate=(0,e.generateLazyValidator)(n.schema)})(t.I18N||(t.I18N={}))})(sD);var oD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Metrics=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{triangles:{type:"number"},materials:{type:"number"},textures:{type:"number"},meshes:{type:"number"},bodies:{type:"number"},entities:{type:"number"}},required:["triangles","materials","textures","meshes","bodies","entities"]},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.Metrics||(t.Metrics={}))})(oD);var tA={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isStandard=t.standardProperties=void 0;const e=C1,r=Tt;t.standardProperties={collectionAddress:{type:"string",nullable:!1},rarity:e.Rarity.schema};const n={type:"object",properties:Object.assign({},t.standardProperties),required:["collectionAddress","rarity"]},i=(0,r.generateLazyValidator)(n);function s(a){return i(a)}t.isStandard=s})(tA);var rA={},cD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleProof=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{proof:{type:"array",items:{type:"string"}},index:{type:"number"},hashingKeys:{type:"array",items:{type:"string"}},entityHash:{type:"string"}},required:["entityHash","hashingKeys","index","proof"],additionalProperties:!0},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.MerkleProof||(t.MerkleProof={}))})(cD);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isThirdParty=t.thirdPartyProps=void 0;const e=Tt,r=cD;t.thirdPartyProps={merkleProof:r.MerkleProof.schema,content:{type:"object",nullable:!1,additionalProperties:{type:"string"},required:[]}};const n={type:"object",properties:Object.assign({},t.thirdPartyProps),required:["merkleProof","content"],_containsHashingKeys:!0},i={keyword:"_containsHashingKeys",validate:(o,c)=>{var u;const f=c;return!((u=f==null?void 0:f.merkleProof)===null||u===void 0)&&u.hashingKeys?f.merkleProof.hashingKeys.every(h=>f.hasOwnProperty(h)):!1},errors:!1},s=(0,e.generateLazyValidator)(n,[i]);function a(o){return s(o)}t.isThirdParty=a})(rA);var $X={},LX={},ul={};Object.defineProperty(ul,"__esModule",{value:!0});ul.isBaseAvatar=ul.requiredBaseItemProps=ul.baseItemProperties=void 0;const $xe=sD,Lxe=oD,Uxe=dm;ul.baseItemProperties=Object.assign(Object.assign({},Uxe.displayableProperties),{id:{type:"string"},name:{type:"string"},description:{type:"string"},i18n:{type:"array",items:$xe.I18N.schema,minItems:1,uniqueItemProperties:["code"],errorMessage:'${0#} array should not have duplicates for "code"'},thumbnail:{type:"string"},image:{type:"string"},metrics:Object.assign(Object.assign({},Lxe.Metrics.schema),{nullable:!0})});ul.requiredBaseItemProps=["id","name","description","i18n","thumbnail","image"];function jxe(t){if(!t||!t.id)return!1;const e=t.id.split(":"),r=e[1]==="decentraland",n=e[3]==="base-avatars";return e.length===5&&r&&n}ul.isBaseAvatar=jxe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Wearable=void 0;const e=Tt,r=Zf,n=J2,i=ul,s=tA,a=rA,o=Z2;(function(c){c.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},i.baseItemProperties),s.standardProperties),a.thirdPartyProps),{data:{type:"object",properties:{replaces:{type:"array",items:o.HideableWearableCategory.schema},hides:{type:"array",items:o.HideableWearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:n.WearableRepresentation.schema,minItems:1},category:r.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:o.HideableWearableCategory.schema}},required:["replaces","hides","tags","representations","category"]}}),additionalProperties:!0,required:[],oneOf:[{required:["id","i18n"],prohibited:["merkleProof","content","collectionAddress","rarity"],_isBaseAvatar:!0},{required:[...i.requiredBaseItemProps,"data","collectionAddress","rarity"],prohibited:["merkleProof","content"]},{required:[...i.requiredBaseItemProps,"data","merkleProof","content"],prohibited:["collectionAddress","rarity"],_isThirdParty:!0}],errorMessage:{oneOf:"either standard XOR thirdparty properties conditions must be met"}};const u={keyword:"_isThirdParty",validate:(h,m)=>!h||(0,a.isThirdParty)(m),errors:!1},f={keyword:"_isBaseAvatar",validate:(h,m)=>!h||(0,i.isBaseAvatar)(m),errors:!1};c.validate=(0,e.generateLazyValidator)(c.schema,[u,f])})(t.Wearable||(t.Wearable={}))})(LX);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.HideableWearableCategory=t.BodyPartCategory=t.WearableCategory=t.Wearable=t.WearableRepresentation=void 0;var e=J2;Object.defineProperty(t,"WearableRepresentation",{enumerable:!0,get:function(){return e.WearableRepresentation}});var r=LX;Object.defineProperty(t,"Wearable",{enumerable:!0,get:function(){return r.Wearable}});var n=Zf;Object.defineProperty(t,"WearableCategory",{enumerable:!0,get:function(){return n.WearableCategory}});var i=X4;Object.defineProperty(t,"BodyPartCategory",{enumerable:!0,get:function(){return i.BodyPartCategory}});var s=Z2;Object.defineProperty(t,"HideableWearableCategory",{enumerable:!0,get:function(){return s.HideableWearableCategory}})})($X);var tC={},rC={},uD={},lD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmoteCategory=void 0;const e=Tt;(function(r){r.DANCE="dance",r.STUNT="stunt",r.GREETINGS="greetings",r.FUN="fun",r.POSES="poses",r.REACTIONS="reactions",r.HORROR="horror",r.MISCELLANEOUS="miscellaneous"})(t.EmoteCategory||(t.EmoteCategory={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.EmoteCategory||(t.EmoteCategory={}))})(lD);var fD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmoteRepresentationADR74=void 0;const e=Tt,r=X2;(function(n){n.schema={type:"object",properties:{bodyShapes:{type:"array",items:r.BodyShape.schema,minItems:1,uniqueItems:!0},mainFile:{type:"string",minLength:1},contents:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0,contains:{const:{$data:"2/mainFile"}},errorMessage:{contains:"contents should contain mainFile: ${1/mainFile}"}}},required:["bodyShapes","mainFile","contents"]},n.validate=(0,e.generateLazyValidator)(n.schema)})(t.EmoteRepresentationADR74||(t.EmoteRepresentationADR74={}))})(fD);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmoteDataADR74=void 0;const e=lD,r=Tt,n=fD;(function(i){i.schema={type:"object",properties:{tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:n.EmoteRepresentationADR74.schema,minItems:1},category:e.EmoteCategory.schema,loop:{type:"boolean"}},required:["category","tags","representations","loop"],additionalProperties:!0},i.validate=(0,r.generateLazyValidator)(i.schema)})(t.EmoteDataADR74||(t.EmoteDataADR74={}))})(uD);var qq;function Bxe(){return qq||(qq=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emote=void 0;const e=jX(),r=Tt,n=ul,i=tA,s=rA,a=uD;(function(o){o.schema={type:"object",properties:Object.assign(Object.assign(Object.assign(Object.assign({},n.baseItemProperties),i.standardProperties),s.thirdPartyProps),{emoteDataADR74:a.EmoteDataADR74.schema}),additionalProperties:!0,required:[...n.requiredBaseItemProps],oneOf:[{required:["emoteDataADR74"],oneOf:[{required:["collectionAddress","rarity"],prohibited:["merkleProof","content"],errorMessage:"standard properties conditions are not met"},{required:["merkleProof","content","id","name","description","i18n","image","thumbnail","emoteDataADR74"],_isThirdParty:!0,prohibited:["collectionAddress","rarity"],errorMessage:"thirdparty properties conditions are not met"}],errorMessage:{oneOf:"emote should have either standard or thirdparty properties"}}],errorMessage:{oneOf:'emote should have "emoteDataADR74" and match its schema'}};const c={keyword:"_isThirdParty",validate:(u,f)=>!u||(0,e.isThirdParty)(f),errors:!1};o.validate=(0,r.generateLazyValidator)(o.schema,[c])})(t.Emote||(t.Emote={}))}(rC)),rC}var UX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmotePlayMode=void 0;const e=Tt;(function(r){r.SIMPLE="simple",r.LOOP="loop"})(t.EmotePlayMode||(t.EmotePlayMode={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.EmotePlayMode||(t.EmotePlayMode={}))})(UX);var Hq;function Fxe(){return Hq||(Hq=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmotePlayMode=t.EmoteCategory=t.EmoteDataADR74=t.EmoteRepresentationADR74=t.Emote=void 0;var e=Bxe();Object.defineProperty(t,"Emote",{enumerable:!0,get:function(){return e.Emote}});var r=fD;Object.defineProperty(t,"EmoteRepresentationADR74",{enumerable:!0,get:function(){return r.EmoteRepresentationADR74}});var n=uD;Object.defineProperty(t,"EmoteDataADR74",{enumerable:!0,get:function(){return n.EmoteDataADR74}});var i=lD;Object.defineProperty(t,"EmoteCategory",{enumerable:!0,get:function(){return i.EmoteCategory}});var s=UX;Object.defineProperty(t,"EmotePlayMode",{enumerable:!0,get:function(){return s.EmotePlayMode}})}(tC)),tC}var zq;function jX(){return zq||(zq=1,function(t){var e=$e&&$e.__createBinding||(Object.create?function(u,f,h,m){m===void 0&&(m=h);var y=Object.getOwnPropertyDescriptor(f,h);(!y||("get"in y?!f.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return f[h]}}),Object.defineProperty(u,m,y)}:function(u,f,h,m){m===void 0&&(m=h),u[m]=f[h]}),r=$e&&$e.__exportStar||function(u,f){for(var h in u)h!=="default"&&!Object.prototype.hasOwnProperty.call(f,h)&&e(f,u,h)};Object.defineProperty(t,"__esModule",{value:!0}),t.isThirdParty=t.isStandard=t.BodyShape=t.Metrics=t.Locale=t.I18N=void 0;var n=sD;Object.defineProperty(t,"I18N",{enumerable:!0,get:function(){return n.I18N}});var i=aD;Object.defineProperty(t,"Locale",{enumerable:!0,get:function(){return i.Locale}});var s=oD;Object.defineProperty(t,"Metrics",{enumerable:!0,get:function(){return s.Metrics}});var a=X2;Object.defineProperty(t,"BodyShape",{enumerable:!0,get:function(){return a.BodyShape}});var o=tA;Object.defineProperty(t,"isStandard",{enumerable:!0,get:function(){return o.isStandard}});var c=rA;Object.defineProperty(t,"isThirdParty",{enumerable:!0,get:function(){return c.isThirdParty}}),r($X,t),r(Fxe(),t)}(eC)),eC}var BX={};(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(cD,t)})(BX);var FX={},nA={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthChain=t.AuthLink=t.AuthLinkType=void 0;const e=Tt;var r;(function(i){i.SIGNER="SIGNER",i.ECDSA_PERSONAL_EPHEMERAL="ECDSA_EPHEMERAL",i.ECDSA_PERSONAL_SIGNED_ENTITY="ECDSA_SIGNED_ENTITY",i.ECDSA_EIP_1654_EPHEMERAL="ECDSA_EIP_1654_EPHEMERAL",i.ECDSA_EIP_1654_SIGNED_ENTITY="ECDSA_EIP_1654_SIGNED_ENTITY"})(r=t.AuthLinkType||(t.AuthLinkType={}));var n;(function(i){i.schema={type:"object",properties:{type:{type:"string",enum:Object.values(r)},payload:{type:"string"},signature:{type:"string",nullable:!0}},required:["payload","type"],if:{properties:{type:{not:{const:r.SIGNER}}}},then:{required:["signature"]},else:{oneOf:[{properties:{signature:{type:"string",const:""}},required:["signature"]},{properties:{signature:{type:"null"}}}]}},i.validate=(0,e.generateLazyValidator)(i.schema)})(n=t.AuthLink||(t.AuthLink={})),function(i){i.schema={type:"array",items:n.schema,minItems:1},i.validate=(0,e.generateLazyValidator)(i.schema)}(t.AuthChain||(t.AuthChain={}))})(nA);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PointerChangesSyncDeployment=t.SnapshotSyncDeployment=void 0;const e=Wh,r=nA,n=Tt;(function(i){i.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:r.AuthChain.schema,entityTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:e.IPFSv1.schema}},{properties:{entityId:e.IPFSv2.schema}}],required:["entityId","entityType","pointers","entityTimestamp","authChain"]},i.validate=(0,n.generateLazyValidator)(i.schema)})(t.SnapshotSyncDeployment||(t.SnapshotSyncDeployment={})),function(i){i.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},authChain:r.AuthChain.schema,entityTimestamp:{type:"number",minimum:0},localTimestamp:{type:"number",minimum:0}},oneOf:[{properties:{entityId:e.IPFSv1.schema}},{properties:{entityId:e.IPFSv2.schema}}],required:["entityId","entityType","pointers","localTimestamp","entityTimestamp","authChain"]},i.validate=(0,n.generateLazyValidator)(i.schema)}(t.PointerChangesSyncDeployment||(t.PointerChangesSyncDeployment={}))})(FX);var qX={},dD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ContentMapping=void 0;const e=Wh,r=Tt;(function(n){n.schema={type:"object",properties:{file:{type:"string",minLength:1},hash:{type:"string",oneOf:[e.IPFSv1.schema,e.IPFSv2.schema]}},required:["file","hash"]},n.validate=(0,r.generateLazyValidator)(n.schema)})(t.ContentMapping||(t.ContentMapping={}))})(dD);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Entity=t.EntityType=void 0;const e=Wh,r=dD,n=Tt;(function(i){i.SCENE="scene",i.PROFILE="profile",i.WEARABLE="wearable",i.STORE="store",i.EMOTE="emote",i.OUTFITS="outfits"})(t.EntityType||(t.EntityType={})),function(i){i.schema={type:"object",properties:{version:{type:"string",enum:["v3"]},id:{type:"string",oneOf:[e.IPFSv1.schema,e.IPFSv2.schema]},type:{type:"string"},pointers:{type:"array",items:{type:"string",minLength:1}},timestamp:{type:"number",minimum:0},content:{type:"array",items:r.ContentMapping.schema},metadata:{type:"object",nullable:!0}},required:["version","id","type","pointers","timestamp","content"]},i.validate=(0,n.generateLazyValidator)(i.schema)}(t.Entity||(t.Entity={}))})(qX);var HX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeploymentWithAuthChain=void 0;const e=nA,r=Tt;(function(n){n.schema={type:"object",properties:{entityId:{type:"string"},entityType:{type:"string"},pointers:{type:"array",items:{type:"string"},minItems:1},localTimestamp:{type:"number",minimum:0},authChain:e.AuthChain.schema},required:["entityId","entityType","pointers","localTimestamp","authChain"]},n.validate=(0,r.generateLazyValidator)(n.schema)})(t.DeploymentWithAuthChain||(t.DeploymentWithAuthChain={}))})(HX);var zX={},VX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Outfits=t.Outfit=void 0;const e=Zf,r=Wh,n=Tt;var i;(function(s){s.schema={type:"object",required:["bodyShape","eyes","hair","skin","wearables"],properties:{bodyShape:{type:"string"},eyes:{type:"object",required:["color"],properties:{color:r.Color3.schema}},hair:{type:"object",required:["color"],properties:{color:r.Color3.schema}},skin:{type:"object",required:["color"],properties:{color:r.Color3.schema}},wearables:{type:"array",items:{type:"string"}},forceRender:{type:"array",nullable:!0,items:e.WearableCategory.schema}},additionalProperties:!0},s.validate=(0,n.generateLazyValidator)(s.schema)})(i=t.Outfit||(t.Outfit={})),function(s){s.schema={type:"object",required:["outfits","namesForExtraSlots"],properties:{outfits:{type:"array",items:{type:"object",required:["slot","outfit"],properties:{slot:{type:"number"},outfit:i.schema}}},namesForExtraSlots:{type:"array",uniqueItems:!0,items:{type:"string"}}},additionalProperties:!0},s.validate=(0,n.generateLazyValidator)(s.schema)}(t.Outfits||(t.Outfits={}))})(VX);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(VX,t)})(zX);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(NX,t),r(MX,t),r(jX(),t),r(dm,t),r(BX,t),r(FX,t),r(qX,t),r(HX,t),r(zX,t)})(eA);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WearableJson=void 0;const e=C1,r=Zf,n=J2,i=Tt,s=eA;(function(a){a.schema={type:"object",properties:{description:{type:"string"},rarity:Object.assign(Object.assign({},e.Rarity.schema),{nullable:!0}),name:{type:"string"},data:{type:"object",properties:{replaces:{type:"array",items:r.WearableCategory.schema},hides:{type:"array",items:r.WearableCategory.schema},tags:{type:"array",items:{type:"string",minLength:1}},representations:{type:"array",items:n.WearableRepresentation.schema,minItems:1},category:r.WearableCategory.schema,removesDefaultHiding:{type:"array",nullable:!0,items:s.HideableWearableCategory.schema}},required:["replaces","hides","tags","representations","category"]}},additionalProperties:!0,required:["description","name","data"]},a.validate=(0,i.generateLazyValidator)(a.schema)})(t.WearableJson||(t.WearableJson={}))})(RX);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(CX,t),r(RX,t)})(TX);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(OX,t),r(TX,t)})(SX);var GX={},iA={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ListingStatus=void 0;const e=Tt;(function(r){r.OPEN="open",r.SOLD="sold",r.CANCELLED="cancelled"})(t.ListingStatus||(t.ListingStatus={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.ListingStatus||(t.ListingStatus={}))})(iA);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Bid=t.BidSortBy=void 0;const e=Tt,r=Ka(),n=iA,i=Bo;(function(s){s.RECENTLY_OFFERED="recently_offered",s.RECENTLY_UPDATED="recently_updated",s.MOST_EXPENSIVE="most_expensive"})(t.BidSortBy||(t.BidSortBy={})),function(s){s.schema={type:"object",properties:{id:{type:"string"},bidAddress:{type:"string"},bidder:{type:"string"},seller:{type:"string"},price:{type:"string"},fingerprint:{type:"string"},status:n.ListingStatus.schema,blockchainId:{type:"string"},blockNumber:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},network:i.Network.schema,chainId:r.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"}},required:["id","bidAddress","bidder","seller","price","fingerprint","status","blockchainId","blockNumber","contractAddress","tokenId","network","chainId","expiresAt","createdAt","updatedAt"]},s.validate=(0,e.generateLazyValidator)(s.schema)}(t.Bid||(t.Bid={}))})(GX);var KX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Account=t.AccountSortBy=void 0;const e=Tt;(function(r){r.MOST_SALES="most_sales",r.MOST_PURCHASES="most_purchases",r.MOST_SPENT="most_spent",r.MOST_EARNED="most_earned",r.MOST_ROYALTIES="most_royalties",r.MOST_COLLECTIONS="most_collections"})(t.AccountSortBy||(t.AccountSortBy={})),function(r){r.schema={type:"object",properties:{id:{type:"string"},address:{type:"string"},sales:{type:"integer"},purchases:{type:"integer"},spent:{type:"string"},earned:{type:"string"},royalties:{type:"string"},collections:{type:"number"}},required:["id","address","sales","purchases","spent","earned","royalties","collections"]},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.Account||(t.Account={}))})(KX);var WX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=t.CollectionSortBy=void 0;const e=Tt,r=Ka(),n=Bo;(function(i){i.NEWEST="newest",i.NAME="name",i.RECENTLY_REVIEWED="recently_reviewed",i.RECENTLY_LISTED="recently_listed",i.SIZE="size"})(t.CollectionSortBy||(t.CollectionSortBy={})),function(i){i.schema={type:"object",properties:{urn:{type:"string"},creator:{type:"string"},name:{type:"string"},contractAddress:{type:"string"},size:{type:"integer"},isOnSale:{type:"boolean"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},network:n.Network.schema,chainId:r.ChainId.schema,firstListedAt:{type:"integer",nullable:!0}},required:["urn","creator","name","contractAddress","isOnSale","size","createdAt","updatedAt","reviewedAt","network","chainId"]},i.validate=(0,e.generateLazyValidator)(i.schema)}(t.Collection||(t.Collection={}))})(WX);var YX={},R1={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NFTCategory=void 0;const e=Tt;(function(r){r.PARCEL="parcel",r.ESTATE="estate",r.WEARABLE="wearable",r.ENS="ens",r.EMOTE="emote"})(t.NFTCategory||(t.NFTCategory={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.NFTCategory||(t.NFTCategory={}))})(R1);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=t.ContractSortBy=void 0;const e=Tt,r=Ka(),n=Bo,i=R1;(function(s){s.NAME="name"})(t.ContractSortBy||(t.ContractSortBy={})),function(s){s.schema={type:"object",properties:{name:{type:"string"},address:{type:"string"},category:i.NFTCategory.schema,network:n.Network.schema,chainId:r.ChainId.schema},required:["name","address","category","network","chainId"]},s.validate=(0,e.generateLazyValidator)(s.schema)}(t.Contract||(t.Contract={}))})(YX);var QX={},hD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NFT=t.NFTSortBy=void 0;const e=Tt,r=Ka(),n=eA,i=Bo,s=R1,a=C1,o=Zf;(function(c){c.NAME="name",c.NEWEST="newest",c.RECENTLY_LISTED="recently_listed",c.RECENTLY_SOLD="recently_sold",c.CHEAPEST="cheapest",c.RENTAL_LISTING_DATE="rental_listing_date",c.RENTAL_DATE="rented_date",c.MAX_RENTAL_PRICE="max_rental_price",c.MIN_RENTAL_PRICE="min_rental_price"})(t.NFTSortBy||(t.NFTSortBy={})),function(c){c.schema={type:"object",properties:{id:{type:"string"},tokenId:{type:"string"},contractAddress:{type:"string"},activeOrderId:{type:"string",nullable:!0},openRentalId:{type:"string",nullable:!0},owner:{type:"string"},name:{type:"string"},image:{type:"string"},url:{type:"string"},data:{type:"object",nullable:!1,properties:{parcel:{type:"object",properties:{description:{type:["string"],nullable:!0},x:{type:"string"},y:{type:"string"},estate:{type:"object",properties:{tokenId:{type:"string"},name:{type:"string"}},required:["tokenId","name"],nullable:!0}},required:["description","x","y","estate"],nullable:!0},estate:{type:"object",properties:{description:{type:["string"],nullable:!0},size:{type:"integer"},parcels:{type:"array",items:{type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"]}}},required:["description","size","parcels"],nullable:!0},wearable:{type:"object",properties:{bodyShapes:{type:"array",items:n.BodyShape.schema},category:o.WearableCategory.schema,description:{type:"string"},rarity:a.Rarity.schema,isSmart:{type:"boolean"}},required:["bodyShapes","category","description","rarity","isSmart"],nullable:!0},ens:{type:"object",properties:{subdomain:{type:"string"}},required:["subdomain"],nullable:!0},emote:{type:"object",properties:{bodyShapes:{type:"array",items:n.BodyShape.schema},category:n.EmoteCategory.schema,description:{type:"string"},rarity:a.Rarity.schema,loop:{type:"boolean"},hasSound:{type:"boolean"},hasGeometry:{type:"boolean"}},required:["bodyShapes","category","description","rarity","loop"],nullable:!0}},required:[]},issuedId:{type:"string",nullable:!0},itemId:{type:"string",nullable:!0},category:s.NFTCategory.schema,network:i.Network.schema,chainId:r.ChainId.schema,createdAt:{type:"integer"},updatedAt:{type:"integer"},soldAt:{type:"integer"},urn:{type:"string",nullable:!0}},required:["id","tokenId","contractAddress","activeOrderId","openRentalId","owner","name","image","url","data","issuedId","itemId","category","network","chainId","createdAt","updatedAt","soldAt"]},c.validate=(0,e.generateLazyValidator)(c.schema)}(t.NFT||(t.NFT={}))})(hD);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Item=t.ItemSortBy=void 0;const e=Tt,r=Ka(),n=Bo,i=hD,s=R1;(function(a){a.NAME="name",a.NEWEST="newest",a.RECENTLY_REVIEWED="recently_reviewed",a.RECENTLY_SOLD="recently_sold",a.RECENTLY_LISTED="recently_listed",a.CHEAPEST="cheapest"})(t.ItemSortBy||(t.ItemSortBy={})),function(a){a.schema={type:"object",properties:{id:{type:"string"},name:{type:"string"},thumbnail:{type:"string"},url:{type:"string"},category:s.NFTCategory.schema,contractAddress:{type:"string"},itemId:{type:"string"},rarity:{type:"string"},price:{type:"string"},available:{type:"integer"},isOnSale:{type:"boolean"},creator:{type:"string"},beneficiary:{type:"string",nullable:!0},data:i.NFT.schema.properties.data,network:n.Network.schema,chainId:r.ChainId.schema,urn:{type:"string"},createdAt:{type:"integer"},updatedAt:{type:"integer"},reviewedAt:{type:"integer"},soldAt:{type:"integer"},firstListedAt:{type:"integer",nullable:!0},picks:{type:"object",properties:{pickedByUser:{type:"boolean",nullable:!0},count:{type:"integer"}},required:["count"],nullable:!0},minPrice:{type:"string",nullable:!0},minListingPrice:{type:"string",nullable:!0},maxListingPrice:{type:"string",nullable:!0},listings:{type:"integer",nullable:!0},owners:{type:"integer",nullable:!0}},required:["id","name","thumbnail","url","category","contractAddress","itemId","rarity","price","available","isOnSale","creator","data","network","chainId","createdAt","updatedAt","soldAt"]},a.validate=(0,e.generateLazyValidator)(a.schema)}(t.Item||(t.Item={}))})(QX);var JX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MetaTransaction=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{from:{type:"string"},params:{type:"array",items:[{type:"string"},{type:"string"}],additionalItems:!1,minItems:2}},additionalProperties:!1,required:["from","params"]},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.MetaTransaction||(t.MetaTransaction={}))})(JX);var XX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Mint=t.MintSortBy=void 0;const e=Tt,r=Ka(),n=Bo;(function(i){i.RECENTLY_MINTED="recently_minted",i.MOST_EXPENSIVE="most_expensive"})(t.MintSortBy||(t.MintSortBy={})),function(i){i.schema={type:"object",properties:{id:{type:"string"},creator:{type:"string"},beneficiary:{type:"string"},minter:{type:"string"},price:{type:"string",nullable:!0},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},issuedId:{type:"string"},timestamp:{type:"integer"},network:n.Network.schema,chainId:r.ChainId.schema},required:["id","creator","beneficiary","minter","itemId","tokenId","issuedId","contractAddress","price","timestamp","network","chainId"]},i.validate=(0,e.generateLazyValidator)(i.schema)}(t.Mint||(t.Mint={}))})(XX);var ZX={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CatalogSortDirection=t.CatalogSortBy=void 0,function(e){e.NEWEST="newest",e.RECENTLY_SOLD="recently_sold",e.CHEAPEST="cheapest",e.MOST_EXPENSIVE="most_expensive",e.RECENTLY_LISTED="recently_listed"}(t.CatalogSortBy||(t.CatalogSortBy={})),function(e){e.ASC="asc",e.DESC="desc"}(t.CatalogSortDirection||(t.CatalogSortDirection={}))})(ZX);var eZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Order=t.OrderSortBy=void 0;const e=Tt,r=Ka(),n=iA,i=Bo;(function(s){s.RECENTLY_LISTED="recently_listed",s.RECENTLY_UPDATED="recently_updated",s.CHEAPEST="cheapest",s.ISSUED_ID_ASC="issued_id_asc",s.ISSUED_ID_DESC="issued_id_desc",s.OLDEST="oldest"})(t.OrderSortBy||(t.OrderSortBy={})),function(s){s.schema={type:"object",properties:{id:{type:"string"},marketplaceAddress:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},owner:{type:"string"},buyer:{type:["string"],nullable:!0},price:{type:"string"},status:n.ListingStatus.schema,network:i.Network.schema,chainId:r.ChainId.schema,expiresAt:{type:"integer"},createdAt:{type:"integer"},updatedAt:{type:"integer"},issuedId:{type:"string"}},required:["id","marketplaceAddress","contractAddress","tokenId","owner","buyer","price","status","network","chainId","expiresAt","createdAt","updatedAt"]},s.validate=(0,e.generateLazyValidator)(s.schema)}(t.Order||(t.Order={}))})(eZ);var pD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SaleType=void 0;const e=Tt;(function(r){r.ORDER="order",r.BID="bid",r.MINT="mint"})(t.SaleType||(t.SaleType={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.SaleType||(t.SaleType={}))})(pD);var tZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Sale=t.SaleSortBy=void 0;const e=Tt,r=Ka(),n=pD,i=Bo;(function(s){s.RECENTLY_SOLD="recently_sold",s.MOST_EXPENSIVE="most_expensive"})(t.SaleSortBy||(t.SaleSortBy={})),function(s){s.schema={type:"object",properties:{id:{type:"string"},type:n.SaleType.schema,buyer:{type:"string"},seller:{type:"string"},price:{type:"string"},contractAddress:{type:"string"},tokenId:{type:"string"},itemId:{type:"string"},txHash:{type:"string"},timestamp:{type:"integer"},network:i.Network.schema,chainId:r.ChainId.schema},required:["id","buyer","seller","itemId","tokenId","price","contractAddress","timestamp","txHash","network","chainId"]},s.validate=(0,e.generateLazyValidator)(s.schema)}(t.Sale||(t.Sale={}))})(tZ);var rZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RentalListingCreation=t.PeriodCreation=t.RentalsListingsSortBy=t.RentalsListingsFilterByCategory=t.RentalsListingSortDirection=t.RentalStatus=void 0;const e=Tt,r=Ka(),n=Bo;(function(s){s.OPEN="open",s.CANCELLED="cancelled",s.EXECUTED="executed",s.CLAIMED="claimed"})(t.RentalStatus||(t.RentalStatus={})),function(s){s.ASC="asc",s.DESC="desc"}(t.RentalsListingSortDirection||(t.RentalsListingSortDirection={})),function(s){s.PARCEL="parcel",s.ESTATE="estate"}(t.RentalsListingsFilterByCategory||(t.RentalsListingsFilterByCategory={})),function(s){s.LAND_CREATION_DATE="land_creation_date",s.RENTAL_LISTING_DATE="rental_listing_date",s.RENTAL_DATE="rented_date",s.NAME="name",s.MAX_RENTAL_PRICE="max_rental_price",s.MIN_RENTAL_PRICE="min_rental_price"}(t.RentalsListingsSortBy||(t.RentalsListingsSortBy={}));var i;(function(s){s.schema={type:"object",properties:{minDays:{type:"integer",minimum:0,maximum:2147483647},maxDays:{type:"integer",minimum:0,maximum:2147483647},pricePerDay:{type:"string",pattern:"^[0-9]+$"}},additionalProperties:!1,required:["minDays","maxDays","pricePerDay"]},s.validate=(0,e.generateLazyValidator)(s.schema)})(i=t.PeriodCreation||(t.PeriodCreation={})),function(s){s.schema={type:"object",properties:{network:n.Network.schema,chainId:r.ChainId.schema,expiration:{type:"number",minimum:0},signature:{type:"string",minLength:1},tokenId:{type:"string",minLength:1},nonces:{type:"array",minItems:3,maxItems:3,items:{minLength:1,type:"string",pattern:"^[0-9]+$"}},contractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},rentalContractAddress:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"},periods:{type:"array",minItems:1,maxItems:100,uniqueItems:!0,items:i.schema},target:{type:"string",pattern:"^0x[a-fA-F0-9]{40}$"}},additionalProperties:!1,required:["network","chainId","expiration","signature","nonces","tokenId","contractAddress","rentalContractAddress","periods","target"]},s.validate=(0,e.generateLazyValidator)(s.schema)}(t.RentalListingCreation||(t.RentalListingCreation={}))})(rZ);var nZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsDayDataSortBy=void 0,function(e){e.DATE="date",e.MOST_SALES="most_sales"}(t.AnalyticsDayDataSortBy||(t.AnalyticsDayDataSortBy={}))})(nZ);var iZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0;const e=Tt;(function(r){r.schema={type:"object",properties:{id:{type:"string"},version:{type:"number"},owner:{type:"string"},description:{type:"string"},links:{type:"array",items:{type:"object",properties:{name:{type:"string"},url:{type:"string"}},required:["name","url"]}},images:{type:"array",items:{type:"object",properties:{name:{type:"string"},file:{type:"string"}},required:["name","file"]}}},required:["id","version","owner","description","links","images"]},r.validate=(0,e.generateLazyValidator)(r.schema)})(t.Store||(t.Store={}))})(iZ);var sZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GenderFilterOption=t.WearableGender=void 0;const e=Tt;(function(r){r.MALE="male",r.FEMALE="female"})(t.WearableGender||(t.WearableGender={})),function(r){r.MALE="male",r.FEMALE="female",r.UNISEX="unisex"}(t.GenderFilterOption||(t.GenderFilterOption={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.WearableGender||(t.WearableGender={}))})(sZ);var aZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.World=t.isInsideWorldLimits=t.getWorld=void 0;const e=Tt;function r(){return{validWorldRanges:[{xMin:-150,yMin:-150,xMax:150,yMax:150},{xMin:62,yMin:151,xMax:162,yMax:158},{xMin:151,yMin:144,xMax:162,yMax:150},{xMin:151,yMin:59,xMax:163,yMax:143}]}}t.getWorld=r;function n(i,s){const a=r().validWorldRanges;for(const o of a)if(i>=o.xMin&&i<=o.xMax&&s>=o.yMin&&s<=o.yMax)return!0;return!1}t.isInsideWorldLimits=n,function(i){i.schema={type:"object",required:["validWorldRanges"],properties:{validWorldRanges:{type:"array",default:[{xMin:-150,yMin:-150,xMax:150,yMax:150}],items:{type:"object",required:["xMin","yMin","xMax","yMax"],properties:{xMin:{type:"integer"},yMin:{type:"integer"},xMax:{type:"integer"},yMax:{type:"integer"}}}}},additionalProperties:!1},i.validate=(0,e.generateLazyValidator)(i.schema)}(t.World||(t.World={}))})(aZ);var oZ={},cZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewCamera=void 0;const e=Tt;(function(r){r.STATIC="static",r.INTERACTIVE="interactive"})(t.PreviewCamera||(t.PreviewCamera={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.PreviewCamera||(t.PreviewCamera={}))})(cZ);var uZ={};Object.defineProperty(uZ,"__esModule",{value:!0});var lZ={};Object.defineProperty(lZ,"__esModule",{value:!0});var fZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewEmoteEventType=void 0;const e=Tt;(function(r){r.ANIMATION_PLAY="animation_play",r.ANIMATION_PAUSE="animation_pause",r.ANIMATION_LOOP="animation_loop",r.ANIMATION_END="animation_end",r.ANIMATION_PLAYING="animation_playing"})(t.PreviewEmoteEventType||(t.PreviewEmoteEventType={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.PreviewEmoteEventType||(t.PreviewEmoteEventType={}))})(fZ);var dZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewEmote=void 0;const e=Tt;(function(r){r.IDLE="idle",r.CLAP="clap",r.DAB="dab",r.DANCE="dance",r.FASHION="fashion",r.FASHION_2="fashion-2",r.FASHION_3="fashion-3",r.FASHION_4="fashion-4",r.LOVE="love",r.MONEY="money",r.FIST_PUMP="fist-pump",r.HEAD_EXPLODE="head-explode"})(t.PreviewEmote||(t.PreviewEmote={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.PreviewEmote||(t.PreviewEmote={}))})(dZ);var hZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessage=t.PreviewMessageType=void 0;const e=Tt;(function(n){n.READY="ready",n.LOAD="load",n.ERROR="error",n.UPDATE="update",n.CONTROLLER_REQUEST="controller_request",n.CONTROLLER_RESPONSE="controller_response",n.EMOTE_EVENT="emote_event"})(t.PreviewMessageType||(t.PreviewMessageType={})),function(n){n.schema={type:"string",enum:Object.values(n)},n.validate=(0,e.generateLazyValidator)(n.schema)}(t.PreviewMessageType||(t.PreviewMessageType={}));const r=(n,i,s,a="*")=>{const o={type:i,payload:s};n.postMessage(o,a)};t.sendMessage=r})(hZ);var pZ={};Object.defineProperty(pZ,"__esModule",{value:!0});var gZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewProjection=void 0;const e=Tt;(function(r){r.ORTHOGRAPHIC="orthographic",r.PERSPECTIVE="perspective"})(t.PreviewProjection||(t.PreviewProjection={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.PreviewProjection||(t.PreviewProjection={}))})(gZ);var mZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewType=void 0;const e=Tt;(function(r){r.TEXTURE="texture",r.WEARABLE="wearable",r.AVATAR="avatar"})(t.PreviewType||(t.PreviewType={})),function(r){r.schema={type:"string",enum:Object.values(r)},r.validate=(0,e.generateLazyValidator)(r.schema)}(t.PreviewType||(t.PreviewType={}))})(mZ);var yZ={};Object.defineProperty(yZ,"__esModule",{value:!0});var vZ={};Object.defineProperty(vZ,"__esModule",{value:!0});var bZ={};Object.defineProperty(bZ,"__esModule",{value:!0});var wZ={};Object.defineProperty(wZ,"__esModule",{value:!0});var _Z={};Object.defineProperty(_Z,"__esModule",{value:!0});var EZ={};Object.defineProperty(EZ,"__esModule",{value:!0});var xZ={};Object.defineProperty(xZ,"__esModule",{value:!0});var AZ={};Object.defineProperty(AZ,"__esModule",{value:!0});(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(cZ,t),r(uZ,t),r(lZ,t),r(fZ,t),r(dZ,t),r(hZ,t),r(pZ,t),r(gZ,t),r(mZ,t),r(yZ,t),r(vZ,t),r(bZ,t),r(wZ,t),r(_Z,t),r(EZ,t),r(xZ,t),r(AZ,t)})(oZ);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(j,L,Y,ne){ne===void 0&&(ne=Y);var U=Object.getOwnPropertyDescriptor(L,Y);(!U||("get"in U?!L.__esModule:U.writable||U.configurable))&&(U={enumerable:!0,get:function(){return L[Y]}}),Object.defineProperty(j,ne,U)}:function(j,L,Y,ne){ne===void 0&&(ne=Y),j[ne]=L[Y]}),r=$e&&$e.__setModuleDefault||(Object.create?function(j,L){Object.defineProperty(j,"default",{enumerable:!0,value:L})}:function(j,L){j.default=L}),n=$e&&$e.__importStar||function(j){if(j&&j.__esModule)return j;var L={};if(j!=null)for(var Y in j)Y!=="default"&&Object.prototype.hasOwnProperty.call(j,Y)&&e(L,j,Y);return r(L,j),L},i=$e&&$e.__exportStar||function(j,L){for(var Y in j)Y!=="default"&&!Object.prototype.hasOwnProperty.call(L,Y)&&e(L,j,Y)};Object.defineProperty(t,"__esModule",{value:!0}),t.sdk=t.isInsideWorldLimits=t.getWorld=t.World=t.GenderFilterOption=t.WearableGender=t.Store=t.AnalyticsDayDataSortBy=t.PeriodCreation=t.RentalListingCreation=t.RentalsListingsSortBy=t.RentalsListingsFilterByCategory=t.RentalsListingSortDirection=t.RentalStatus=t.SaleSortBy=t.Sale=t.SaleType=t.Rarity=t.ProviderType=t.OrderSortBy=t.Order=t.CatalogSortDirection=t.CatalogSortBy=t.NFTSortBy=t.NFT=t.NFTCategory=t.Network=t.MintSortBy=t.Mint=t.MetaTransaction=t.ListingStatus=t.ItemSortBy=t.Item=t.ContractSortBy=t.Contract=t.CollectionSortBy=t.Collection=t.getChainId=t.ChainName=t.getURNProtocol=t.getChainName=t.ChainId=t.AccountSortBy=t.Account=t.BidSortBy=t.Bid=void 0;const s=n(SX);t.sdk=s,i(Tt,t);var a=GX;Object.defineProperty(t,"Bid",{enumerable:!0,get:function(){return a.Bid}}),Object.defineProperty(t,"BidSortBy",{enumerable:!0,get:function(){return a.BidSortBy}});var o=KX;Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return o.Account}}),Object.defineProperty(t,"AccountSortBy",{enumerable:!0,get:function(){return o.AccountSortBy}});var c=Ka();Object.defineProperty(t,"ChainId",{enumerable:!0,get:function(){return c.ChainId}}),Object.defineProperty(t,"getChainName",{enumerable:!0,get:function(){return c.getChainName}}),Object.defineProperty(t,"getURNProtocol",{enumerable:!0,get:function(){return c.getURNProtocol}});var u=gX();Object.defineProperty(t,"ChainName",{enumerable:!0,get:function(){return u.ChainName}}),Object.defineProperty(t,"getChainId",{enumerable:!0,get:function(){return u.getChainId}});var f=WX;Object.defineProperty(t,"Collection",{enumerable:!0,get:function(){return f.Collection}}),Object.defineProperty(t,"CollectionSortBy",{enumerable:!0,get:function(){return f.CollectionSortBy}});var h=YX;Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return h.Contract}}),Object.defineProperty(t,"ContractSortBy",{enumerable:!0,get:function(){return h.ContractSortBy}});var m=QX;Object.defineProperty(t,"Item",{enumerable:!0,get:function(){return m.Item}}),Object.defineProperty(t,"ItemSortBy",{enumerable:!0,get:function(){return m.ItemSortBy}});var y=iA;Object.defineProperty(t,"ListingStatus",{enumerable:!0,get:function(){return y.ListingStatus}});var w=JX;Object.defineProperty(t,"MetaTransaction",{enumerable:!0,get:function(){return w.MetaTransaction}});var v=XX;Object.defineProperty(t,"Mint",{enumerable:!0,get:function(){return v.Mint}}),Object.defineProperty(t,"MintSortBy",{enumerable:!0,get:function(){return v.MintSortBy}});var g=Bo;Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return g.Network}});var _=R1;Object.defineProperty(t,"NFTCategory",{enumerable:!0,get:function(){return _.NFTCategory}});var b=hD;Object.defineProperty(t,"NFT",{enumerable:!0,get:function(){return b.NFT}}),Object.defineProperty(t,"NFTSortBy",{enumerable:!0,get:function(){return b.NFTSortBy}});var S=ZX;Object.defineProperty(t,"CatalogSortBy",{enumerable:!0,get:function(){return S.CatalogSortBy}}),Object.defineProperty(t,"CatalogSortDirection",{enumerable:!0,get:function(){return S.CatalogSortDirection}});var A=eZ;Object.defineProperty(t,"Order",{enumerable:!0,get:function(){return A.Order}}),Object.defineProperty(t,"OrderSortBy",{enumerable:!0,get:function(){return A.OrderSortBy}});var O=gc;Object.defineProperty(t,"ProviderType",{enumerable:!0,get:function(){return O.ProviderType}});var E=C1;Object.defineProperty(t,"Rarity",{enumerable:!0,get:function(){return E.Rarity}});var p=pD;Object.defineProperty(t,"SaleType",{enumerable:!0,get:function(){return p.SaleType}});var I=tZ;Object.defineProperty(t,"Sale",{enumerable:!0,get:function(){return I.Sale}}),Object.defineProperty(t,"SaleSortBy",{enumerable:!0,get:function(){return I.SaleSortBy}});var N=rZ;Object.defineProperty(t,"RentalStatus",{enumerable:!0,get:function(){return N.RentalStatus}}),Object.defineProperty(t,"RentalsListingSortDirection",{enumerable:!0,get:function(){return N.RentalsListingSortDirection}}),Object.defineProperty(t,"RentalsListingsFilterByCategory",{enumerable:!0,get:function(){return N.RentalsListingsFilterByCategory}}),Object.defineProperty(t,"RentalsListingsSortBy",{enumerable:!0,get:function(){return N.RentalsListingsSortBy}}),Object.defineProperty(t,"RentalListingCreation",{enumerable:!0,get:function(){return N.RentalListingCreation}}),Object.defineProperty(t,"PeriodCreation",{enumerable:!0,get:function(){return N.PeriodCreation}});var B=nZ;Object.defineProperty(t,"AnalyticsDayDataSortBy",{enumerable:!0,get:function(){return B.AnalyticsDayDataSortBy}});var V=iZ;Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return V.Store}});var de=sZ;Object.defineProperty(t,"WearableGender",{enumerable:!0,get:function(){return de.WearableGender}}),Object.defineProperty(t,"GenderFilterOption",{enumerable:!0,get:function(){return de.GenderFilterOption}});var ve=aZ;Object.defineProperty(t,"World",{enumerable:!0,get:function(){return ve.World}}),Object.defineProperty(t,"getWorld",{enumerable:!0,get:function(){return ve.getWorld}}),Object.defineProperty(t,"isInsideWorldLimits",{enumerable:!0,get:function(){return ve.isInsideWorldLimits}}),i(oZ,t),i(eA,t),i(Wh,t),i(nA,t),i(dD,t)})(ml);var Do={};Object.defineProperty(Do,"__esModule",{value:!0});Do.getRpcUrls=Do.getConfiguration=void 0;const Rn=Ka(),Hs=gc,qxe=Object.freeze({storageKey:"decentraland-connect-storage-key",[Hs.ProviderType.INJECTED]:{},[Hs.ProviderType.FORTMATIC]:{apiKeys:{[Rn.ChainId.ETHEREUM_MAINNET]:"pk_live_F8E24DF8DD5BCBC5",[Rn.ChainId.ETHEREUM_ROPSTEN]:"pk_test_5B728BEFE5C10911",[Rn.ChainId.ETHEREUM_RINKEBY]:"pk_test_5B728BEFE5C10911",[Rn.ChainId.ETHEREUM_KOVAN]:"pk_test_5B728BEFE5C10911",[Rn.ChainId.ETHEREUM_GOERLI]:"pk_test_5B728BEFE5C10911",[Rn.ChainId.ETHEREUM_SEPOLIA]:"pk_test_5B728BEFE5C10911"},urls:Vp(Hs.ProviderType.FORTMATIC)},[Hs.ProviderType.NETWORK]:{urls:Vp(Hs.ProviderType.NETWORK)},[Hs.ProviderType.WALLET_LINK]:{appName:"Decentraland",urls:Vp(Hs.ProviderType.WALLET_LINK)},[Hs.ProviderType.WALLET_CONNECT_V2]:{projectId:"61570c542c2d66c659492e5b24a41522",urls:Vp(Hs.ProviderType.WALLET_CONNECT_V2),chains:{[Rn.ChainId.ETHEREUM_MAINNET]:{chains:[Rn.ChainId.ETHEREUM_MAINNET],optionalChains:[Rn.ChainId.MATIC_MAINNET]},[Rn.ChainId.ETHEREUM_GOERLI]:{chains:[Rn.ChainId.ETHEREUM_GOERLI],optionalChains:[Rn.ChainId.MATIC_MUMBAI]},[Rn.ChainId.ETHEREUM_SEPOLIA]:{chains:[Rn.ChainId.ETHEREUM_SEPOLIA],optionalChains:[Rn.ChainId.MATIC_MUMBAI]}}},[Hs.ProviderType.MAGIC]:{apiKey:"pk_live_212568025B158355",urls:Vp(Hs.ProviderType.MAGIC),chains:[Rn.ChainId.ETHEREUM_MAINNET,Rn.ChainId.ETHEREUM_GOERLI,Rn.ChainId.ETHEREUM_SEPOLIA,Rn.ChainId.MATIC_MAINNET,Rn.ChainId.MATIC_MUMBAI]}});function Hxe(){return qxe}Do.getConfiguration=Hxe;function Vp(t){const e={[Rn.ChainId.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[Rn.ChainId.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[Rn.ChainId.ETHEREUM_ROPSTEN]:"https://rpc.decentraland.org/ropsten",[Rn.ChainId.ETHEREUM_RINKEBY]:"https://rpc.decentraland.org/rinkeby",[Rn.ChainId.ETHEREUM_GOERLI]:"https://rpc.decentraland.org/goerli",[Rn.ChainId.ETHEREUM_KOVAN]:"https://rpc.decentraland.org/kovan",[Rn.ChainId.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[Rn.ChainId.MATIC_MUMBAI]:"https://rpc.decentraland.org/mumbai"};let r="";switch(t){case Hs.ProviderType.WALLET_LINK:r="walletlink";break;case Hs.ProviderType.FORTMATIC:r="fortmatic";break;case Hs.ProviderType.MAGIC:r="magic";break;case Hs.ProviderType.WALLET_CONNECT_V2:r="walletconnect-v2";break}if(r)for(const n in e)e[n]+=`?project=${r}`;return e}Do.getRpcUrls=Vp;var nC,Vq;function zxe(){return Vq||(Vq=1,nC=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(n,i,s){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:s})},r.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(1&i&&(n=r(n)),8&i||4&i&&typeof n=="object"&&n&&n.__esModule)return n;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:n}),2&i&&typeof n!="string")for(var a in n)r.d(s,a,(function(o){return n[o]}).bind(null,a));return s},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="",r(r.s=3)}([function(t,e){t.exports=function(r){return r&&r.__esModule?r:{default:r}}},function(t,e){t.exports=function(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){function n(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(e,"__esModule",{value:!0}),e.sendAsyncWrapper=function(i,s){var a=this;return new Promise(function(o,c){a.sendAsync({jsonrpc:"2.0",id:n(),method:i,params:s||[]},function(u,f){u?c(u):o(f.result)})})},e.sendFortmaticAsyncWrapper=function(i){var s=this;return new Promise(function(a,o){s.getProvider().sendFortmaticAsync(i,function(c,u){c?o(c):a(u?u.result:{})})})},e.randomId=n,e.findExistingResponse=function(i,s){for(var a=0;a<i.length;a++)if(i[a].id===s)return i[a];return null}},function(t,e,r){t.exports=r(4)},function(t,e,r){var n=r(0),i=n(r(1)),s=n(r(5)),a=r(2),o="fm_composeSend",c="fm_logout",u="fm_get_balances",f="fm_get_transactions",h="fm_is_logged_in",m="fm_accountSettings",y="fm_deposit",w="fm_get_user",v="fm_configure",g={};t.exports=function b(S,A,O){var E=this;if((0,i.default)(this,b),this.fortmaticClient="https://x2.fortmatic.com",!S)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=S,this.options=O,this.ethNetwork=A,this.queryParams=btoa(JSON.stringify({API_KEY:S,ETH_NETWORK:A})),this.transactions={send:function(p,I){var N=new _(o,{to:p.to,value:p.amount});E.getProvider().sendFortmaticAsync(N,I)}},this.getProvider=function(){return g["fortmatic-".concat(E.queryParams)]||(g["fortmatic-".concat(E.queryParams)]=new s.default(E.fortmaticClient,{API_KEY:S,ETH_NETWORK:A})),g["fortmatic-".concat(E.queryParams)]},this.user={login:function(){return E.getProvider().enable()},logout:function(){E.getProvider().account=null,E.getProvider().network=null;var p=new _(c);return a.sendFortmaticAsyncWrapper.call(E,p)},getUser:function(){var p=new _(w);return a.sendFortmaticAsyncWrapper.call(E,p)},getBalances:function(){var p=new _(u);return a.sendFortmaticAsyncWrapper.call(E,p)},getTransactions:function(){var p=new _(f);return a.sendFortmaticAsyncWrapper.call(E,p)},isLoggedIn:function(){var p=new _(h);return a.sendFortmaticAsyncWrapper.call(E,p)},settings:function(){var p=new _(m);return a.sendFortmaticAsyncWrapper.call(E,p)},deposit:function(p){var I=new _(y,p);return a.sendFortmaticAsyncWrapper.call(E,I)}},this.configure=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=new _(v);return I.params=[p],a.sendFortmaticAsyncWrapper.call(E,I)}};var _=function b(S,A){(0,i.default)(this,b),this.id=(0,a.randomId)(),this.method=S,this.params=A?[A]:[{}]}},function(t,e,r){var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(6)),s=n(r(9)),a=n(r(1)),o=n(r(10)),c=r(11),u=n(r(12)),f=r(2),h=function(){function m(y,w){if((0,a.default)(this,m),this.fortmaticClient=y,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!w.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:w.API_KEY,ETH_NETWORK:w.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:c.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,o.default)(m,[{key:"constructPostMessage",value:function(){var y=this;Object.keys(this.postMessages).map(function(w){y.postMessages[w]+="-".concat(y.queryParams)})}},{key:"createOverlay",value:function(){var y=this;return new Promise(function(w,v){var g=function(){if(function(){var A=!0,O=!1,E=void 0;try{for(var p,I=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(A=(p=I.next()).done);A=!0)if(p.value.src.includes(y.queryParams))return!1}catch(N){O=!0,E=N}finally{try{A||I.return==null||I.return()}finally{if(O)throw E}}return!0}()){var _=document.createElement("style");_.innerHTML=u.default.css,_.type="text/css",document.head.appendChild(_);var b=document.createElement("iframe");b.className="fortmatic-iframe",b.src="".concat(y.fortmaticClient,"/send?params=").concat(y.queryParams),document.body.appendChild(b);var S=document.createElement("img");S.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(S),w({iframe:b})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?g():window.addEventListener("load",g.bind(y),!1)})}},{key:"showOverlay",value:function(){var y=(0,s.default)(i.default.mark(function w(){return i.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.overlay;case 2:v.sent.iframe.style.display="block";case 4:case"end":return v.stop()}},w,this)}));return function(){return y.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var y=(0,s.default)(i.default.mark(function w(){return i.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,this.overlay;case 2:v.sent.iframe.style.display="none";case 4:case"end":return v.stop()}},w,this)}));return function(){return y.apply(this,arguments)}}()},{key:"sendAsync",value:function(y,w){y.length>0?this.enqueue({payload:{id:(0,f.randomId)(),batch:y.map(function(v){return v.id=(0,f.randomId)(),v}),method:"eth_batchRequest"},cb:w}):this.enqueue({payload:y,cb:w})}},{key:"sendFortmaticAsync",value:function(y,w){this.enqueue({payload:y,cb:w,isNative:!0})}},{key:"send",value:function(y,w){if(typeof y=="string")return f.sendAsyncWrapper.call(this,y,w);if(!w){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(y,function(){});var v={};switch(y.method){case"eth_accounts":v=this.account?[this.account]:[];break;case"eth_coinbase":v=this.account;break;case"net_version":v=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":v=!0;break;default:v={}}return{id:y.id,jsonrpc:y.jsonrpc,result:v}}this.sendAsync(y,w)}},{key:"enqueue",value:function(y){this.queue.push(y),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var y=(0,s.default)(i.default.mark(function w(){var v,g,_,b=this;return i.default.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(this.queue.length!==0){S.next=2;break}return S.abrupt("return");case 2:if(!(v=this.queue.shift())){S.next=11;break}return g=v.payload,_=v.cb,g.id=(0,f.randomId)(),S.next=9,this.postMessage(v.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,v.payload);case 9:g.batch&&g.batch.length>0?(g.batch.forEach(function(A){b.requests[A.id]={parentId:g.id,payload:A,cb:function(O,E){var p=b.requests[g.id].batchResponse;if(O&&O.response&&!(0,f.findExistingResponse)(p,O.response.id))throw p.push({jsonrpc:"2.0",id:O.response.id,error:{code:O.response.code,message:O.response.message}}),b.requests[g.id].cb(null,p),O.response;if(E&&E.result&&!(0,f.findExistingResponse)(p,E.id))return p.push(E);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[g.id]={payload:g,cb:_,batchResponse:[]}):this.requests[g.id]={payload:g,cb:_},this.dequeue();case 11:case"end":return S.stop()}},w,this)}));return function(){return y.apply(this,arguments)}}()},{key:"postMessage",value:function(){var y=(0,s.default)(i.default.mark(function w(v,g){var _;return i.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,this.overlay;case 2:if(!(_=b.sent).iframe.contentWindow){b.next=7;break}_.iframe.contentWindow.postMessage({msgType:v,payload:g},"*"),b.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return b.stop()}},w,this)}));return function(w,v){return y.apply(this,arguments)}}()},{key:"enable",value:function(){return f.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var y=this;window.addEventListener("message",function(w){if(w.origin===y.fortmaticClient){var v=w.data.response?w.data.response.id:null;switch(w.data.msgType){case y.postMessages.FORTMATIC_OVERLAY_READY:y.overlayReady=!0,y.dequeue();break;case y.postMessages.FORTMATIC_HANDLE_RESPONSE:try{y.requests[v].cb(null,w.data.response);var g=y.requests[v].parentId;g&&y.requests[g].payload.batch.length===y.requests[g].batchResponse.length&&y.requests[g].cb(null,y.requests[g].batchResponse),y.requests[v].payload.method==="eth_accounts"?y.account=w.data.response.result[0]:y.requests[v].payload.method==="eth_coinbase"?y.account=w.data.response.result:y.requests[v].payload.method==="net_version"&&(y.network=w.data.response.result)}catch{}y.isLoggedIn=!0,y.dequeue();break;case y.postMessages.FORTMATIC_HIDE_OVERLAY:y.hideOverlay();break;case y.postMessages.FORTMATIC_SHOW_OVERLAY:y.showOverlay();break;case y.postMessages.FORTMATIC_USER_LOGOUT:y.account=null,y.network=null,y.isLoggedIn=!1;break;case y.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw y.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case y.postMessages.FORTMATIC_USER_DENIED:if(v){var _=w.data.response&&w.data.response.message?w.data.response.message:"Fortmatic: Modal was closed without executing action!",b=w.data.response&&w.data.response.code?w.data.response.code:1;y.requests[v].cb({message:_,code:b,response:w.data.response})}else y.queue.forEach(function(S){return S.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});y.dequeue()}}})}}]),m}();e.default=h},function(t,e,r){t.exports=r(7)},function(t,e,r){var n=function(){return this||typeof self=="object"&&self}()||Function("return this")(),i=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,s=i&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=r(8),i)n.regeneratorRuntime=s;else try{delete n.regeneratorRuntime}catch{n.regeneratorRuntime=void 0}},function(t,e){(function(r){var n,i=Object.prototype,s=i.hasOwnProperty,a=typeof Symbol=="function"?Symbol:{},o=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",f=typeof t=="object",h=r.regeneratorRuntime;if(h)f&&(t.exports=h);else{(h=r.regeneratorRuntime=f?t.exports:{}).wrap=O;var m="suspendedStart",y="suspendedYield",w="executing",v="completed",g={},_={};_[o]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(Y([])));S&&S!==i&&s.call(S,o)&&(_=S);var A=N.prototype=p.prototype=Object.create(_);I.prototype=A.constructor=N,N.constructor=I,N[u]=I.displayName="GeneratorFunction",h.isGeneratorFunction=function(U){var F=typeof U=="function"&&U.constructor;return!!F&&(F===I||(F.displayName||F.name)==="GeneratorFunction")},h.mark=function(U){return Object.setPrototypeOf?Object.setPrototypeOf(U,N):(U.__proto__=N,u in U||(U[u]="GeneratorFunction")),U.prototype=Object.create(A),U},h.awrap=function(U){return{__await:U}},B(V.prototype),V.prototype[c]=function(){return this},h.AsyncIterator=V,h.async=function(U,F,H,M){var q=new V(O(U,F,H,M));return h.isGeneratorFunction(F)?q:q.next().then(function($){return $.done?$.value:q.next()})},B(A),A[u]="Generator",A[o]=function(){return this},A.toString=function(){return"[object Generator]"},h.keys=function(U){var F=[];for(var H in U)F.push(H);return F.reverse(),function M(){for(;F.length;){var q=F.pop();if(q in U)return M.value=q,M.done=!1,M}return M.done=!0,M}},h.values=Y,L.prototype={constructor:L,reset:function(U){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(j),!U)for(var F in this)F.charAt(0)==="t"&&s.call(this,F)&&!isNaN(+F.slice(1))&&(this[F]=n)},stop:function(){this.done=!0;var U=this.tryEntries[0].completion;if(U.type==="throw")throw U.arg;return this.rval},dispatchException:function(U){if(this.done)throw U;var F=this;function H(pe,Q){return $.type="throw",$.arg=U,F.next=pe,Q&&(F.method="next",F.arg=n),!!Q}for(var M=this.tryEntries.length-1;M>=0;--M){var q=this.tryEntries[M],$=q.completion;if(q.tryLoc==="root")return H("end");if(q.tryLoc<=this.prev){var k=s.call(q,"catchLoc"),G=s.call(q,"finallyLoc");if(k&&G){if(this.prev<q.catchLoc)return H(q.catchLoc,!0);if(this.prev<q.finallyLoc)return H(q.finallyLoc)}else if(k){if(this.prev<q.catchLoc)return H(q.catchLoc,!0)}else{if(!G)throw new Error("try statement without catch or finally");if(this.prev<q.finallyLoc)return H(q.finallyLoc)}}}},abrupt:function(U,F){for(var H=this.tryEntries.length-1;H>=0;--H){var M=this.tryEntries[H];if(M.tryLoc<=this.prev&&s.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var q=M;break}}q&&(U==="break"||U==="continue")&&q.tryLoc<=F&&F<=q.finallyLoc&&(q=null);var $=q?q.completion:{};return $.type=U,$.arg=F,q?(this.method="next",this.next=q.finallyLoc,g):this.complete($)},complete:function(U,F){if(U.type==="throw")throw U.arg;return U.type==="break"||U.type==="continue"?this.next=U.arg:U.type==="return"?(this.rval=this.arg=U.arg,this.method="return",this.next="end"):U.type==="normal"&&F&&(this.next=F),g},finish:function(U){for(var F=this.tryEntries.length-1;F>=0;--F){var H=this.tryEntries[F];if(H.finallyLoc===U)return this.complete(H.completion,H.afterLoc),j(H),g}},catch:function(U){for(var F=this.tryEntries.length-1;F>=0;--F){var H=this.tryEntries[F];if(H.tryLoc===U){var M=H.completion;if(M.type==="throw"){var q=M.arg;j(H)}return q}}throw new Error("illegal catch attempt")},delegateYield:function(U,F,H){return this.delegate={iterator:Y(U),resultName:F,nextLoc:H},this.method==="next"&&(this.arg=n),g}}}function O(U,F,H,M){var q=F&&F.prototype instanceof p?F:p,$=Object.create(q.prototype),k=new L(M||[]);return $._invoke=function(G,pe,Q){var te=m;return function(ce,T){if(te===w)throw new Error("Generator is already running");if(te===v){if(ce==="throw")throw T;return ne()}for(Q.method=ce,Q.arg=T;;){var le=Q.delegate;if(le){var Ge=de(le,Q);if(Ge){if(Ge===g)continue;return Ge}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(te===m)throw te=v,Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);te=w;var tt=E(G,pe,Q);if(tt.type==="normal"){if(te=Q.done?v:y,tt.arg===g)continue;return{value:tt.arg,done:Q.done}}tt.type==="throw"&&(te=v,Q.method="throw",Q.arg=tt.arg)}}}(U,H,k),$}function E(U,F,H){try{return{type:"normal",arg:U.call(F,H)}}catch(M){return{type:"throw",arg:M}}}function p(){}function I(){}function N(){}function B(U){["next","throw","return"].forEach(function(F){U[F]=function(H){return this._invoke(F,H)}})}function V(U){var F;this._invoke=function(H,M){function q(){return new Promise(function($,k){(function G(pe,Q,te,ce){var T=E(U[pe],U,Q);if(T.type!=="throw"){var le=T.arg,Ge=le.value;return Ge&&typeof Ge=="object"&&s.call(Ge,"__await")?Promise.resolve(Ge.__await).then(function(tt){G("next",tt,te,ce)},function(tt){G("throw",tt,te,ce)}):Promise.resolve(Ge).then(function(tt){le.value=tt,te(le)},function(tt){return G("throw",tt,te,ce)})}ce(T.arg)})(H,M,$,k)})}return F=F?F.then(q,q):q()}}function de(U,F){var H=U.iterator[F.method];if(H===n){if(F.delegate=null,F.method==="throw"){if(U.iterator.return&&(F.method="return",F.arg=n,de(U,F),F.method==="throw"))return g;F.method="throw",F.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var M=E(H,U.iterator,F.arg);if(M.type==="throw")return F.method="throw",F.arg=M.arg,F.delegate=null,g;var q=M.arg;return q?q.done?(F[U.resultName]=q.value,F.next=U.nextLoc,F.method!=="return"&&(F.method="next",F.arg=n),F.delegate=null,g):q:(F.method="throw",F.arg=new TypeError("iterator result is not an object"),F.delegate=null,g)}function ve(U){var F={tryLoc:U[0]};1 in U&&(F.catchLoc=U[1]),2 in U&&(F.finallyLoc=U[2],F.afterLoc=U[3]),this.tryEntries.push(F)}function j(U){var F=U.completion||{};F.type="normal",delete F.arg,U.completion=F}function L(U){this.tryEntries=[{tryLoc:"root"}],U.forEach(ve,this),this.reset(!0)}function Y(U){if(U){var F=U[o];if(F)return F.call(U);if(typeof U.next=="function")return U;if(!isNaN(U.length)){var H=-1,M=function q(){for(;++H<U.length;)if(s.call(U,H))return q.value=U[H],q.done=!1,q;return q.value=n,q.done=!0,q};return M.next=M}}return{next:ne}}function ne(){return{value:n,done:!0}}})(function(){return this||typeof self=="object"&&self}()||Function("return this")())},function(t,e){function r(n,i,s,a,o,c,u){try{var f=n[c](u),h=f.value}catch(m){return void s(m)}f.done?i(h):Promise.resolve(h).then(a,o)}t.exports=function(n){return function(){var i=this,s=arguments;return new Promise(function(a,o){var c=n.apply(i,s);function u(h){r(c,a,o,u,f,"next",h)}function f(h){r(c,a,o,u,f,"throw",h)}u(void 0)})}}},function(t,e){function r(n,i){for(var s=0;s<i.length;s++){var a=i[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}t.exports=function(n,i,s){return i&&r(n.prototype,i),s&&r(n,s),n}},function(t){t.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(t,e,r){e.css=`
102
- .fortmatic-iframe {
103
- display: none;
104
- position: fixed;
105
- top: 0;
106
- right: 0;
107
- width: 100%;
108
- height: 100%;
109
- border: none;
110
- border-radius: 0;
111
- z-index: 2147483647;
112
- }
113
- `}])),nC}var Vxe=$e&&$e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Gxe=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kxe=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Vxe(e,t,r);return Gxe(e,t),e};Object.defineProperty(Q2,"__esModule",{value:!0});Q2.FortmaticConnector=void 0;const Wxe=AX,Yxe=ml,Qxe=Do;class Jxe extends Wxe.AbstractConnector{constructor(e){const r=Qxe.getConfiguration()[Yxe.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>Kxe(zxe()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}Q2.FortmaticConnector=Jxe;var sA={};function g6(){return g6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},g6.apply(this,arguments)}function gD(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function m6(t){return m6=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},m6(t)}function ux(t,e){return ux=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ux(t,e)}function Xxe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function aE(t,e,r){return Xxe()?aE=Reflect.construct:aE=function(i,s,a){var o=[null];o.push.apply(o,s);var c=Function.bind.apply(i,o),u=new c;return a&&ux(u,a.prototype),u},aE.apply(null,arguments)}function Zxe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function lx(t){var e=typeof Map=="function"?new Map:void 0;return lx=function(n){if(n===null||!Zxe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return aE(n,arguments,m6(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ux(i,n)},lx(t)}function u_(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function Mp(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function Dc(t){return t.hasOwnProperty("result")?t.result:t}var oE=function(t){gD(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(lx(Error)),SZ=function(t){gD(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(lx(Error)),e2e=function(t){gD(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(u_(i)),i.handleChainChanged=i.handleChainChanged.bind(u_(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(u_(i)),i.handleClose=i.handleClose.bind(u_(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,s){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(s)return f;function h(){return g6({provider:window.ethereum},o?{account:o}:{})}var m=function(){if(!o)return Promise.resolve(window.ethereum.enable().then(function(y){return y&&Dc(y)[0]})).then(function(y){o=y})}();return m&&m.then?m.then(h):h(m)},s=!1,a=this;if(!window.ethereum)throw new oE;window.ethereum.on&&(window.ethereum.on("chainChanged",a.handleChainChanged),window.ethereum.on("accountsChanged",a.handleAccountsChanged),window.ethereum.on("close",a.handleClose),window.ethereum.on("networkChanged",a.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var o,c=Mp(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return Dc(u)[0]})).then(function(u){o=u})},function(u){if(u.code===4001)throw new SZ});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!s)try{s=Dc(window.ethereum.send({method:"net_version"}))}catch{}return s||(window.ethereum.isDapper?s=Dc(window.ethereum.cachedResults.net_version):s=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),s}var u=function(){if(!s){var f=Mp(function(){return Promise.resolve(window.ethereum.send("net_version").then(Dc)).then(function(h){s=h})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new oE;var s,a=Mp(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(Dc)).then(function(o){s=o})},function(){});return Promise.resolve(a&&a.then?a.then(i):i(a))}catch(o){return Promise.reject(o)}},r.getAccount=function(){try{var i=function(){function c(){return s||(s=Dc(window.ethereum.send({method:"eth_accounts"}))[0]),s}var u=function(){if(!s){var f=Mp(function(){return Promise.resolve(window.ethereum.enable().then(function(h){return Dc(h)[0]})).then(function(h){s=h})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new oE;var s,a=Mp(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(o){return Dc(o)[0]})).then(function(o){s=o})},function(){});return Promise.resolve(a&&a.then?a.then(i):i(a))}catch(o){return Promise.reject(o)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(Mp(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return Dc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(Y2);const t2e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:e2e,NoEthereumProviderError:oE,UserRejectedRequestError:SZ},Symbol.toStringTag,{value:"Module"})),r2e=Ia(t2e);Object.defineProperty(sA,"__esModule",{value:!0});sA.InjectedConnector=void 0;const n2e=r2e;class i2e extends n2e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}sA.InjectedConnector=i2e;var aA={},s2e="Invariant failed";function Gq(t,e){if(!t)throw new Error(s2e)}function OZ(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_b(t,e)}function y6(t){return y6=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},y6(t)}function _b(t,e){return _b=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_b(t,e)}function a2e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function cE(t,e,r){return a2e()?cE=Reflect.construct:cE=function(i,s,a){var o=[null];o.push.apply(o,s);var c=Function.bind.apply(i,o),u=new c;return a&&_b(u,a.prototype),u},cE.apply(null,arguments)}function o2e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function v6(t){var e=typeof Map=="function"?new Map:void 0;return v6=function(n){if(n===null||!o2e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return cE(n,arguments,y6(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_b(i,n)},v6(t)}var uE=function(t){OZ(e,t);function e(r,n,i){var s;return s=t.call(this)||this,s.code=n,s.data=i,s.name=s.constructor.name,s.message=r,s}return e}(v6(Error)),c2e=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(a,o){console.log("sendAsync",a.method,a.params),i.request(a.method,a.params).then(function(c){return o(null,{jsonrpc:"2.0",id:a.id,result:c})}).catch(function(c){return o(c,null)})},this.request=function(a,o){try{return typeof a!="string"&&(o=a.params,a=a.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:a,params:o}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new uE(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,h,m;throw new uE(u==null||(f=u.error)==null?void 0:f.message,u==null||(h=u.error)==null?void 0:h.code,u==null||(m=u.error)==null?void 0:m.data)}else{if("result"in u)return u.result;throw new uE("Received unexpected JSON-RPC response to "+a+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var s=new URL(r);this.host=s.host,this.path=s.pathname},u2e=function(t){OZ(e,t);function e(n){var i,s=n.urls,a=n.defaultChainId;return a||Object.keys(s).length===1||Gq(!1),i=t.call(this,{supportedChainIds:Object.keys(s).map(function(o){return Number(o)})})||this,i.currentChainId=a||Number(Object.keys(s)[0]),i.providers=Object.keys(s).reduce(function(o,c){return o[Number(c)]=new c2e(Number(c),s[Number(c)]),o},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(s){return Promise.reject(s)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(s){return Promise.reject(s)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(s){return Promise.reject(s)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||Gq(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(Y2);const l2e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:u2e,RequestError:uE},Symbol.toStringTag,{value:"Module"})),f2e=Ia(l2e);Object.defineProperty(aA,"__esModule",{value:!0});aA.NetworkConnector=void 0;const d2e=gc,h2e=f2e,p2e=Do;class g2e extends h2e.NetworkConnector{constructor(e){super({urls:p2e.getConfiguration()[d2e.ProviderType.NETWORK].urls,defaultChainId:e})}}aA.NetworkConnector=g2e;var oA={};const m2e="modulepreload",y2e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7359128689.commit-62bca57/"+t},Kq={},Eb=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=y2e(s),s in Kq)return;Kq[s]=!0;const a=s.endsWith(".css"),o=a?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===s&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${o}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":m2e,a||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),a)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s})};function b6(){return b6=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},b6.apply(this,arguments)}function v2e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,w6(t,e)}function w6(t,e){return w6=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},w6(t,e)}function Wq(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var b2e=1,w2e=function(t){v2e(e,t);function e(n){var i,s=n.url,a=n.appName,o=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=s,i.appName=a,i.appLogoUrl=o,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(Wq(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(Wq(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,s=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},a=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var o=function(){if(!i.walletLink)return Promise.resolve(Eb(()=>import("./index-4a08d7f3.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(b6({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,b2e)})}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(a&&a.then?a.then(s):s(a))}catch(o){return Promise.reject(o)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(s){return Promise.reject(s)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(s){return Promise.reject(s)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(s){return s[0]})}catch(s){return Promise.reject(s)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(s){return Promise.reject(s)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(Y2);const _2e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:w2e},Symbol.toStringTag,{value:"Module"})),E2e=Ia(_2e);Object.defineProperty(oA,"__esModule",{value:!0});oA.WalletLinkConnector=void 0;const x2e=ml,A2e=E2e,S2e=Do;class O2e extends A2e.WalletLinkConnector{constructor(e){const r=S2e.getConfiguration()[x2e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}oA.WalletLinkConnector=O2e;var cA={},mD={},uA={},kr={},IZ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,c){var u=o>>>16&65535,f=o&65535,h=c>>>16&65535,m=c&65535;return f*m+(u*m+f*h<<16>>>0)|0}t.mul=Math.imul||e;function r(o,c){return o+c|0}t.add=r;function n(o,c){return o-c|0}t.sub=n;function i(o,c){return o<<c|o>>>32-c}t.rotl=i;function s(o,c){return o<<32-c|o>>>c}t.rotr=s;function a(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||a,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(IZ);Object.defineProperty(kr,"__esModule",{value:!0});var PZ=IZ;function I2e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}kr.readInt16BE=I2e;function P2e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}kr.readUint16BE=P2e;function T2e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}kr.readInt16LE=T2e;function C2e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}kr.readUint16LE=C2e;function TZ(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}kr.writeUint16BE=TZ;kr.writeInt16BE=TZ;function CZ(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}kr.writeUint16LE=CZ;kr.writeInt16LE=CZ;function _6(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}kr.readInt32BE=_6;function E6(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}kr.readUint32BE=E6;function x6(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}kr.readInt32LE=x6;function A6(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}kr.readUint32LE=A6;function fx(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}kr.writeUint32BE=fx;kr.writeInt32BE=fx;function dx(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}kr.writeUint32LE=dx;kr.writeInt32LE=dx;function R2e(t,e){e===void 0&&(e=0);var r=_6(t,e),n=_6(t,e+4);return r*4294967296+n-(n>>31)*4294967296}kr.readInt64BE=R2e;function N2e(t,e){e===void 0&&(e=0);var r=E6(t,e),n=E6(t,e+4);return r*4294967296+n}kr.readUint64BE=N2e;function D2e(t,e){e===void 0&&(e=0);var r=x6(t,e),n=x6(t,e+4);return n*4294967296+r-(r>>31)*4294967296}kr.readInt64LE=D2e;function M2e(t,e){e===void 0&&(e=0);var r=A6(t,e),n=A6(t,e+4);return n*4294967296+r}kr.readUint64LE=M2e;function RZ(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),fx(t/4294967296>>>0,e,r),fx(t>>>0,e,r+4),e}kr.writeUint64BE=RZ;kr.writeInt64BE=RZ;function NZ(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),dx(t>>>0,e,r),dx(t/4294967296>>>0,e,r+4),e}kr.writeUint64LE=NZ;kr.writeInt64LE=NZ;function k2e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}kr.readUintBE=k2e;function $2e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s<r+t/8;s++)n+=e[s]*i,i*=256;return n}kr.readUintLE=$2e;function L2e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!PZ.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,s=t/8+n-1;s>=n;s--)r[s]=e/i&255,i*=256;return r}kr.writeUintBE=L2e;function U2e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!PZ.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s<n+t/8;s++)r[s]=e/i&255,i*=256;return r}kr.writeUintLE=U2e;function j2e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}kr.readFloat32BE=j2e;function B2e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}kr.readFloat32LE=B2e;function F2e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}kr.readFloat64BE=F2e;function q2e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}kr.readFloat64LE=q2e;function H2e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}kr.writeFloat32BE=H2e;function z2e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}kr.writeFloat32LE=z2e;function V2e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}kr.writeFloat64BE=V2e;function G2e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}kr.writeFloat64LE=G2e;var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});function K2e(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Wa.wipe=K2e;Object.defineProperty(uA,"__esModule",{value:!0});var _s=kr,S6=Wa,W2e=20;function Y2e(t,e,r){for(var n=1634760805,i=857760878,s=2036477234,a=1797285236,o=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],h=r[19]<<24|r[18]<<16|r[17]<<8|r[16],m=r[23]<<24|r[22]<<16|r[21]<<8|r[20],y=r[27]<<24|r[26]<<16|r[25]<<8|r[24],w=r[31]<<24|r[30]<<16|r[29]<<8|r[28],v=e[3]<<24|e[2]<<16|e[1]<<8|e[0],g=e[7]<<24|e[6]<<16|e[5]<<8|e[4],_=e[11]<<24|e[10]<<16|e[9]<<8|e[8],b=e[15]<<24|e[14]<<16|e[13]<<8|e[12],S=n,A=i,O=s,E=a,p=o,I=c,N=u,B=f,V=h,de=m,ve=y,j=w,L=v,Y=g,ne=_,U=b,F=0;F<W2e;F+=2)S=S+p|0,L^=S,L=L>>>32-16|L<<16,V=V+L|0,p^=V,p=p>>>32-12|p<<12,A=A+I|0,Y^=A,Y=Y>>>32-16|Y<<16,de=de+Y|0,I^=de,I=I>>>32-12|I<<12,O=O+N|0,ne^=O,ne=ne>>>32-16|ne<<16,ve=ve+ne|0,N^=ve,N=N>>>32-12|N<<12,E=E+B|0,U^=E,U=U>>>32-16|U<<16,j=j+U|0,B^=j,B=B>>>32-12|B<<12,O=O+N|0,ne^=O,ne=ne>>>32-8|ne<<8,ve=ve+ne|0,N^=ve,N=N>>>32-7|N<<7,E=E+B|0,U^=E,U=U>>>32-8|U<<8,j=j+U|0,B^=j,B=B>>>32-7|B<<7,A=A+I|0,Y^=A,Y=Y>>>32-8|Y<<8,de=de+Y|0,I^=de,I=I>>>32-7|I<<7,S=S+p|0,L^=S,L=L>>>32-8|L<<8,V=V+L|0,p^=V,p=p>>>32-7|p<<7,S=S+I|0,U^=S,U=U>>>32-16|U<<16,ve=ve+U|0,I^=ve,I=I>>>32-12|I<<12,A=A+N|0,L^=A,L=L>>>32-16|L<<16,j=j+L|0,N^=j,N=N>>>32-12|N<<12,O=O+B|0,Y^=O,Y=Y>>>32-16|Y<<16,V=V+Y|0,B^=V,B=B>>>32-12|B<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,de=de+ne|0,p^=de,p=p>>>32-12|p<<12,O=O+B|0,Y^=O,Y=Y>>>32-8|Y<<8,V=V+Y|0,B^=V,B=B>>>32-7|B<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,de=de+ne|0,p^=de,p=p>>>32-7|p<<7,A=A+N|0,L^=A,L=L>>>32-8|L<<8,j=j+L|0,N^=j,N=N>>>32-7|N<<7,S=S+I|0,U^=S,U=U>>>32-8|U<<8,ve=ve+U|0,I^=ve,I=I>>>32-7|I<<7;_s.writeUint32LE(S+n|0,t,0),_s.writeUint32LE(A+i|0,t,4),_s.writeUint32LE(O+s|0,t,8),_s.writeUint32LE(E+a|0,t,12),_s.writeUint32LE(p+o|0,t,16),_s.writeUint32LE(I+c|0,t,20),_s.writeUint32LE(N+u|0,t,24),_s.writeUint32LE(B+f|0,t,28),_s.writeUint32LE(V+h|0,t,32),_s.writeUint32LE(de+m|0,t,36),_s.writeUint32LE(ve+y|0,t,40),_s.writeUint32LE(j+w|0,t,44),_s.writeUint32LE(L+v|0,t,48),_s.writeUint32LE(Y+g|0,t,52),_s.writeUint32LE(ne+_|0,t,56),_s.writeUint32LE(U+b|0,t,60)}function DZ(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=i}for(var o=new Uint8Array(64),c=0;c<r.length;c+=64){Y2e(o,s,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^o[u-c];J2e(s,0,a)}return S6.wipe(o),i===0&&S6.wipe(s),n}uA.streamXOR=DZ;function Q2e(t,e,r,n){return n===void 0&&(n=0),S6.wipe(r),DZ(t,e,r,r,n)}uA.stream=Q2e;function J2e(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var MZ={},ed={};Object.defineProperty(ed,"__esModule",{value:!0});function X2e(t,e,r){return~(t-1)&e|t-1&r}ed.select=X2e;function Z2e(t,e){return(t|0)-(e|0)-1>>>31&1}ed.lessOrEqual=Z2e;function kZ(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}ed.compare=kZ;function eAe(t,e){return t.length===0||e.length===0?!1:kZ(t,e)!==0}ed.equal=eAe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ed,r=Wa;t.DIGEST_LENGTH=16;var n=function(){function a(o){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=o[0]|o[1]<<8;this._r[0]=c&8191;var u=o[2]|o[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=o[4]|o[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var h=o[6]|o[7]<<8;this._r[3]=(f>>>7|h<<9)&8191;var m=o[8]|o[9]<<8;this._r[4]=(h>>>4|m<<12)&255,this._r[5]=m>>>1&8190;var y=o[10]|o[11]<<8;this._r[6]=(m>>>14|y<<2)&8191;var w=o[12]|o[13]<<8;this._r[7]=(y>>>11|w<<5)&8065;var v=o[14]|o[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=o[16]|o[17]<<8,this._pad[1]=o[18]|o[19]<<8,this._pad[2]=o[20]|o[21]<<8,this._pad[3]=o[22]|o[23]<<8,this._pad[4]=o[24]|o[25]<<8,this._pad[5]=o[26]|o[27]<<8,this._pad[6]=o[28]|o[29]<<8,this._pad[7]=o[30]|o[31]<<8}return a.prototype._blocks=function(o,c,u){for(var f=this._fin?0:2048,h=this._h[0],m=this._h[1],y=this._h[2],w=this._h[3],v=this._h[4],g=this._h[5],_=this._h[6],b=this._h[7],S=this._h[8],A=this._h[9],O=this._r[0],E=this._r[1],p=this._r[2],I=this._r[3],N=this._r[4],B=this._r[5],V=this._r[6],de=this._r[7],ve=this._r[8],j=this._r[9];u>=16;){var L=o[c+0]|o[c+1]<<8;h+=L&8191;var Y=o[c+2]|o[c+3]<<8;m+=(L>>>13|Y<<3)&8191;var ne=o[c+4]|o[c+5]<<8;y+=(Y>>>10|ne<<6)&8191;var U=o[c+6]|o[c+7]<<8;w+=(ne>>>7|U<<9)&8191;var F=o[c+8]|o[c+9]<<8;v+=(U>>>4|F<<12)&8191,g+=F>>>1&8191;var H=o[c+10]|o[c+11]<<8;_+=(F>>>14|H<<2)&8191;var M=o[c+12]|o[c+13]<<8;b+=(H>>>11|M<<5)&8191;var q=o[c+14]|o[c+15]<<8;S+=(M>>>8|q<<8)&8191,A+=q>>>5|f;var $=0,k=$;k+=h*O,k+=m*(5*j),k+=y*(5*ve),k+=w*(5*de),k+=v*(5*V),$=k>>>13,k&=8191,k+=g*(5*B),k+=_*(5*N),k+=b*(5*I),k+=S*(5*p),k+=A*(5*E),$+=k>>>13,k&=8191;var G=$;G+=h*E,G+=m*O,G+=y*(5*j),G+=w*(5*ve),G+=v*(5*de),$=G>>>13,G&=8191,G+=g*(5*V),G+=_*(5*B),G+=b*(5*N),G+=S*(5*I),G+=A*(5*p),$+=G>>>13,G&=8191;var pe=$;pe+=h*p,pe+=m*E,pe+=y*O,pe+=w*(5*j),pe+=v*(5*ve),$=pe>>>13,pe&=8191,pe+=g*(5*de),pe+=_*(5*V),pe+=b*(5*B),pe+=S*(5*N),pe+=A*(5*I),$+=pe>>>13,pe&=8191;var Q=$;Q+=h*I,Q+=m*p,Q+=y*E,Q+=w*O,Q+=v*(5*j),$=Q>>>13,Q&=8191,Q+=g*(5*ve),Q+=_*(5*de),Q+=b*(5*V),Q+=S*(5*B),Q+=A*(5*N),$+=Q>>>13,Q&=8191;var te=$;te+=h*N,te+=m*I,te+=y*p,te+=w*E,te+=v*O,$=te>>>13,te&=8191,te+=g*(5*j),te+=_*(5*ve),te+=b*(5*de),te+=S*(5*V),te+=A*(5*B),$+=te>>>13,te&=8191;var ce=$;ce+=h*B,ce+=m*N,ce+=y*I,ce+=w*p,ce+=v*E,$=ce>>>13,ce&=8191,ce+=g*O,ce+=_*(5*j),ce+=b*(5*ve),ce+=S*(5*de),ce+=A*(5*V),$+=ce>>>13,ce&=8191;var T=$;T+=h*V,T+=m*B,T+=y*N,T+=w*I,T+=v*p,$=T>>>13,T&=8191,T+=g*E,T+=_*O,T+=b*(5*j),T+=S*(5*ve),T+=A*(5*de),$+=T>>>13,T&=8191;var le=$;le+=h*de,le+=m*V,le+=y*B,le+=w*N,le+=v*I,$=le>>>13,le&=8191,le+=g*p,le+=_*E,le+=b*O,le+=S*(5*j),le+=A*(5*ve),$+=le>>>13,le&=8191;var Ge=$;Ge+=h*ve,Ge+=m*de,Ge+=y*V,Ge+=w*B,Ge+=v*N,$=Ge>>>13,Ge&=8191,Ge+=g*I,Ge+=_*p,Ge+=b*E,Ge+=S*O,Ge+=A*(5*j),$+=Ge>>>13,Ge&=8191;var tt=$;tt+=h*j,tt+=m*ve,tt+=y*de,tt+=w*V,tt+=v*B,$=tt>>>13,tt&=8191,tt+=g*N,tt+=_*I,tt+=b*p,tt+=S*E,tt+=A*O,$+=tt>>>13,tt&=8191,$=($<<2)+$|0,$=$+k|0,k=$&8191,$=$>>>13,G+=$,h=k,m=G,y=pe,w=Q,v=te,g=ce,_=T,b=le,S=Ge,A=tt,c+=16,u-=16}this._h[0]=h,this._h[1]=m,this._h[2]=y,this._h[3]=w,this._h[4]=v,this._h[5]=g,this._h[6]=_,this._h[7]=b,this._h[8]=S,this._h[9]=A},a.prototype.finish=function(o,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,h,m,y;if(this._leftover){for(y=this._leftover,this._buffer[y++]=1;y<16;y++)this._buffer[y]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,y=2;y<10;y++)this._h[y]+=f,f=this._h[y]>>>13,this._h[y]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,y=1;y<10;y++)u[y]=this._h[y]+f,f=u[y]>>>13,u[y]&=8191;for(u[9]-=8192,h=(f^1)-1,y=0;y<10;y++)u[y]&=h;for(h=~h,y=0;y<10;y++)this._h[y]=this._h[y]&h|u[y];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,m=this._h[0]+this._pad[0],this._h[0]=m&65535,y=1;y<8;y++)m=(this._h[y]+this._pad[y]|0)+(m>>>16)|0,this._h[y]=m&65535;return o[c+0]=this._h[0]>>>0,o[c+1]=this._h[0]>>>8,o[c+2]=this._h[1]>>>0,o[c+3]=this._h[1]>>>8,o[c+4]=this._h[2]>>>0,o[c+5]=this._h[2]>>>8,o[c+6]=this._h[3]>>>0,o[c+7]=this._h[3]>>>8,o[c+8]=this._h[4]>>>0,o[c+9]=this._h[4]>>>8,o[c+10]=this._h[5]>>>0,o[c+11]=this._h[5]>>>8,o[c+12]=this._h[6]>>>0,o[c+13]=this._h[6]>>>8,o[c+14]=this._h[7]>>>0,o[c+15]=this._h[7]>>>8,this._finished=!0,this},a.prototype.update=function(o){var c=0,u=o.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var h=0;h<f;h++)this._buffer[this._leftover+h]=o[c+h];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(o,c,f),c+=f,u-=f),u){for(var h=0;h<u;h++)this._buffer[this._leftover+h]=o[c+h];this._leftover+=u}return this},a.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var o=new Uint8Array(16);return this.finish(o),o},a.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},a}();t.Poly1305=n;function i(a,o){var c=new n(a);c.update(o);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function s(a,o){return a.length!==t.DIGEST_LENGTH||o.length!==t.DIGEST_LENGTH?!1:e.equal(a,o)}t.equal=s})(MZ);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=uA,r=MZ,n=Wa,i=kr,s=ed;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var a=new Uint8Array(16),o=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,h,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var y=new Uint8Array(16);y.set(u,y.length-u.length);var w=new Uint8Array(32);e.stream(this._key,y,w,4);var v=f.length+this.tagLength,g;if(m){if(m.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");g=m}else g=new Uint8Array(v);return e.streamXOR(this._key,y,f,g,4),this._authenticate(g.subarray(g.length-this.tagLength,g.length),w,g.subarray(0,g.length-this.tagLength),h),n.wipe(y),g},c.prototype.open=function(u,f,h,m){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var y=new Uint8Array(16);y.set(u,y.length-u.length);var w=new Uint8Array(32);e.stream(this._key,y,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),h),!s.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var g=f.length-this.tagLength,_;if(m){if(m.length!==g)throw new Error("ChaCha20Poly1305: incorrect destination length");_=m}else _=new Uint8Array(g);return e.streamXOR(this._key,y,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(y),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,h,m){var y=new r.Poly1305(f);m&&(y.update(m),m.length%16>0&&y.update(a.subarray(m.length%16))),y.update(h),h.length%16>0&&y.update(a.subarray(h.length%16));var w=new Uint8Array(8);m&&i.writeUint64LE(m.length,w),y.update(w),i.writeUint64LE(h.length,w),y.update(w);for(var v=y.digest(),g=0;g<v.length;g++)u[g]=v[g];y.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=o})(mD);var $Z={},N1={},yD={};Object.defineProperty(yD,"__esModule",{value:!0});function tAe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}yD.isSerializableHash=tAe;Object.defineProperty(N1,"__esModule",{value:!0});var Mc=yD,rAe=ed,nAe=Wa,LZ=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Mc.isSerializableHash(this._inner)&&Mc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),nAe.wipe(n)}return t.prototype.reset=function(){if(!Mc.isSerializableHash(this._inner)||!Mc.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Mc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Mc.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Mc.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Mc.isSerializableHash(this._inner)||!Mc.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Mc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();N1.HMAC=LZ;function iAe(t,e,r){var n=new LZ(t,e);n.update(r);var i=n.digest();return n.clean(),i}N1.hmac=iAe;N1.equal=rAe.equal;Object.defineProperty($Z,"__esModule",{value:!0});var Yq=N1,Qq=Wa,sAe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var s=Yq.hmac(this._hash,n,r);this._hmac=new Yq.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),Qq.wipe(this._buffer),Qq.wipe(this._counter),this._bufpos=0},t}(),aAe=$Z.HKDF=sAe,hm={},lA={},fA={};Object.defineProperty(fA,"__esModule",{value:!0});fA.BrowserRandomSource=void 0;const Jq=65536;class oAe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=Jq)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,Jq)));return r}}fA.BrowserRandomSource=oAe;function O6(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var dA={};const cAe={},uAe=Object.freeze(Object.defineProperty({__proto__:null,default:cAe},Symbol.toStringTag,{value:"Module"})),UZ=Ia(uAe);Object.defineProperty(dA,"__esModule",{value:!0});dA.NodeRandomSource=void 0;const lAe=Wa;class fAe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof O6<"u"){const e=UZ;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,lAe.wipe)(r),n}}dA.NodeRandomSource=fAe;Object.defineProperty(lA,"__esModule",{value:!0});lA.SystemRandomSource=void 0;const dAe=fA,hAe=dA;class pAe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new dAe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new hAe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}lA.SystemRandomSource=pAe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=lA,r=kr,n=Wa;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function s(u=t.defaultRandomSource){const f=i(4,u),h=(0,r.readUint32LE)(f);return(0,n.wipe)(f),h}t.randomUint32=s;const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function o(u,f=a,h=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let m="";const y=f.length,w=256-256%y;for(;u>0;){const v=i(Math.ceil(u*256/w),h);for(let g=0;g<v.length&&u>0;g++){const _=v[g];_<w&&(m+=f.charAt(_%y),u--)}(0,n.wipe)(v)}return m}t.randomString=o;function c(u,f=a,h=t.defaultRandomSource){const m=Math.ceil(u/(Math.log(f.length)/Math.LN2));return o(m,f,h)}t.randomStringForEntropy=c})(hm);var hA={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=kr,r=Wa;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function o(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},o.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},o.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},o.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=s(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},o.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,h=u/536870912|0,m=u<<3,y=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<y-8;w++)this._buffer[w]=0;e.writeUint32BE(h,this._buffer,y-8),e.writeUint32BE(m,this._buffer,y-4),s(this._temp,this._state,this._buffer,0,y),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},o.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},o.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},o}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(o,c,u,f,h){for(;h>=64;){for(var m=c[0],y=c[1],w=c[2],v=c[3],g=c[4],_=c[5],b=c[6],S=c[7],A=0;A<16;A++){var O=f+A*4;o[A]=e.readUint32BE(u,O)}for(var A=16;A<64;A++){var E=o[A-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=o[A-15];var I=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;o[A]=(p+o[A-7]|0)+(I+o[A-16]|0)}for(var A=0;A<64;A++){var p=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&_^~g&b)|0)+(S+(i[A]+o[A]|0)|0)|0,I=((m>>>2|m<<32-2)^(m>>>13|m<<32-13)^(m>>>22|m<<32-22))+(m&y^m&w^y&w)|0;S=b,b=_,_=g,g=v+p|0,v=w,w=y,y=m,m=p+I|0}c[0]+=m,c[1]+=y,c[2]+=w,c[3]+=v,c[4]+=g,c[5]+=_,c[6]+=b,c[7]+=S,f+=64,h-=64}return f}function a(o){var c=new n;c.update(o);var u=c.digest();return c.clean(),u}t.hash=a})(hA);var vD={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=hm,r=Wa;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(A){const O=new Float64Array(16);if(A)for(let E=0;E<A.length;E++)O[E]=A[E];return O}const i=new Uint8Array(32);i[0]=9;const s=n([56129,1]);function a(A){let O=1;for(let E=0;E<16;E++){let p=A[E]+O+65535;O=Math.floor(p/65536),A[E]=p-O*65536}A[0]+=O-1+37*(O-1)}function o(A,O,E){const p=~(E-1);for(let I=0;I<16;I++){const N=p&(A[I]^O[I]);A[I]^=N,O[I]^=N}}function c(A,O){const E=n(),p=n();for(let I=0;I<16;I++)p[I]=O[I];a(p),a(p),a(p);for(let I=0;I<2;I++){E[0]=p[0]-65517;for(let B=1;B<15;B++)E[B]=p[B]-65535-(E[B-1]>>16&1),E[B-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const N=E[15]>>16&1;E[14]&=65535,o(p,E,1-N)}for(let I=0;I<16;I++)A[2*I]=p[I]&255,A[2*I+1]=p[I]>>8}function u(A,O){for(let E=0;E<16;E++)A[E]=O[2*E]+(O[2*E+1]<<8);A[15]&=32767}function f(A,O,E){for(let p=0;p<16;p++)A[p]=O[p]+E[p]}function h(A,O,E){for(let p=0;p<16;p++)A[p]=O[p]-E[p]}function m(A,O,E){let p,I,N=0,B=0,V=0,de=0,ve=0,j=0,L=0,Y=0,ne=0,U=0,F=0,H=0,M=0,q=0,$=0,k=0,G=0,pe=0,Q=0,te=0,ce=0,T=0,le=0,Ge=0,tt=0,yt=0,vt=0,gt=0,Bt=0,Zt=0,Or=0,Ct=E[0],Pt=E[1],$t=E[2],Rt=E[3],Wt=E[4],Ft=E[5],Kt=E[6],Dt=E[7],Nt=E[8],Vt=E[9],Mt=E[10],ur=E[11],rr=E[12],ar=E[13],ir=E[14],wr=E[15];p=O[0],N+=p*Ct,B+=p*Pt,V+=p*$t,de+=p*Rt,ve+=p*Wt,j+=p*Ft,L+=p*Kt,Y+=p*Dt,ne+=p*Nt,U+=p*Vt,F+=p*Mt,H+=p*ur,M+=p*rr,q+=p*ar,$+=p*ir,k+=p*wr,p=O[1],B+=p*Ct,V+=p*Pt,de+=p*$t,ve+=p*Rt,j+=p*Wt,L+=p*Ft,Y+=p*Kt,ne+=p*Dt,U+=p*Nt,F+=p*Vt,H+=p*Mt,M+=p*ur,q+=p*rr,$+=p*ar,k+=p*ir,G+=p*wr,p=O[2],V+=p*Ct,de+=p*Pt,ve+=p*$t,j+=p*Rt,L+=p*Wt,Y+=p*Ft,ne+=p*Kt,U+=p*Dt,F+=p*Nt,H+=p*Vt,M+=p*Mt,q+=p*ur,$+=p*rr,k+=p*ar,G+=p*ir,pe+=p*wr,p=O[3],de+=p*Ct,ve+=p*Pt,j+=p*$t,L+=p*Rt,Y+=p*Wt,ne+=p*Ft,U+=p*Kt,F+=p*Dt,H+=p*Nt,M+=p*Vt,q+=p*Mt,$+=p*ur,k+=p*rr,G+=p*ar,pe+=p*ir,Q+=p*wr,p=O[4],ve+=p*Ct,j+=p*Pt,L+=p*$t,Y+=p*Rt,ne+=p*Wt,U+=p*Ft,F+=p*Kt,H+=p*Dt,M+=p*Nt,q+=p*Vt,$+=p*Mt,k+=p*ur,G+=p*rr,pe+=p*ar,Q+=p*ir,te+=p*wr,p=O[5],j+=p*Ct,L+=p*Pt,Y+=p*$t,ne+=p*Rt,U+=p*Wt,F+=p*Ft,H+=p*Kt,M+=p*Dt,q+=p*Nt,$+=p*Vt,k+=p*Mt,G+=p*ur,pe+=p*rr,Q+=p*ar,te+=p*ir,ce+=p*wr,p=O[6],L+=p*Ct,Y+=p*Pt,ne+=p*$t,U+=p*Rt,F+=p*Wt,H+=p*Ft,M+=p*Kt,q+=p*Dt,$+=p*Nt,k+=p*Vt,G+=p*Mt,pe+=p*ur,Q+=p*rr,te+=p*ar,ce+=p*ir,T+=p*wr,p=O[7],Y+=p*Ct,ne+=p*Pt,U+=p*$t,F+=p*Rt,H+=p*Wt,M+=p*Ft,q+=p*Kt,$+=p*Dt,k+=p*Nt,G+=p*Vt,pe+=p*Mt,Q+=p*ur,te+=p*rr,ce+=p*ar,T+=p*ir,le+=p*wr,p=O[8],ne+=p*Ct,U+=p*Pt,F+=p*$t,H+=p*Rt,M+=p*Wt,q+=p*Ft,$+=p*Kt,k+=p*Dt,G+=p*Nt,pe+=p*Vt,Q+=p*Mt,te+=p*ur,ce+=p*rr,T+=p*ar,le+=p*ir,Ge+=p*wr,p=O[9],U+=p*Ct,F+=p*Pt,H+=p*$t,M+=p*Rt,q+=p*Wt,$+=p*Ft,k+=p*Kt,G+=p*Dt,pe+=p*Nt,Q+=p*Vt,te+=p*Mt,ce+=p*ur,T+=p*rr,le+=p*ar,Ge+=p*ir,tt+=p*wr,p=O[10],F+=p*Ct,H+=p*Pt,M+=p*$t,q+=p*Rt,$+=p*Wt,k+=p*Ft,G+=p*Kt,pe+=p*Dt,Q+=p*Nt,te+=p*Vt,ce+=p*Mt,T+=p*ur,le+=p*rr,Ge+=p*ar,tt+=p*ir,yt+=p*wr,p=O[11],H+=p*Ct,M+=p*Pt,q+=p*$t,$+=p*Rt,k+=p*Wt,G+=p*Ft,pe+=p*Kt,Q+=p*Dt,te+=p*Nt,ce+=p*Vt,T+=p*Mt,le+=p*ur,Ge+=p*rr,tt+=p*ar,yt+=p*ir,vt+=p*wr,p=O[12],M+=p*Ct,q+=p*Pt,$+=p*$t,k+=p*Rt,G+=p*Wt,pe+=p*Ft,Q+=p*Kt,te+=p*Dt,ce+=p*Nt,T+=p*Vt,le+=p*Mt,Ge+=p*ur,tt+=p*rr,yt+=p*ar,vt+=p*ir,gt+=p*wr,p=O[13],q+=p*Ct,$+=p*Pt,k+=p*$t,G+=p*Rt,pe+=p*Wt,Q+=p*Ft,te+=p*Kt,ce+=p*Dt,T+=p*Nt,le+=p*Vt,Ge+=p*Mt,tt+=p*ur,yt+=p*rr,vt+=p*ar,gt+=p*ir,Bt+=p*wr,p=O[14],$+=p*Ct,k+=p*Pt,G+=p*$t,pe+=p*Rt,Q+=p*Wt,te+=p*Ft,ce+=p*Kt,T+=p*Dt,le+=p*Nt,Ge+=p*Vt,tt+=p*Mt,yt+=p*ur,vt+=p*rr,gt+=p*ar,Bt+=p*ir,Zt+=p*wr,p=O[15],k+=p*Ct,G+=p*Pt,pe+=p*$t,Q+=p*Rt,te+=p*Wt,ce+=p*Ft,T+=p*Kt,le+=p*Dt,Ge+=p*Nt,tt+=p*Vt,yt+=p*Mt,vt+=p*ur,gt+=p*rr,Bt+=p*ar,Zt+=p*ir,Or+=p*wr,N+=38*G,B+=38*pe,V+=38*Q,de+=38*te,ve+=38*ce,j+=38*T,L+=38*le,Y+=38*Ge,ne+=38*tt,U+=38*yt,F+=38*vt,H+=38*gt,M+=38*Bt,q+=38*Zt,$+=38*Or,I=1,p=N+I+65535,I=Math.floor(p/65536),N=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=V+I+65535,I=Math.floor(p/65536),V=p-I*65536,p=de+I+65535,I=Math.floor(p/65536),de=p-I*65536,p=ve+I+65535,I=Math.floor(p/65536),ve=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=Y+I+65535,I=Math.floor(p/65536),Y=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,N+=I-1+37*(I-1),I=1,p=N+I+65535,I=Math.floor(p/65536),N=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=V+I+65535,I=Math.floor(p/65536),V=p-I*65536,p=de+I+65535,I=Math.floor(p/65536),de=p-I*65536,p=ve+I+65535,I=Math.floor(p/65536),ve=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=Y+I+65535,I=Math.floor(p/65536),Y=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,N+=I-1+37*(I-1),A[0]=N,A[1]=B,A[2]=V,A[3]=de,A[4]=ve,A[5]=j,A[6]=L,A[7]=Y,A[8]=ne,A[9]=U,A[10]=F,A[11]=H,A[12]=M,A[13]=q,A[14]=$,A[15]=k}function y(A,O){m(A,O,O)}function w(A,O){const E=n();for(let p=0;p<16;p++)E[p]=O[p];for(let p=253;p>=0;p--)y(E,E),p!==2&&p!==4&&m(E,E,O);for(let p=0;p<16;p++)A[p]=E[p]}function v(A,O){const E=new Uint8Array(32),p=new Float64Array(80),I=n(),N=n(),B=n(),V=n(),de=n(),ve=n();for(let ne=0;ne<31;ne++)E[ne]=A[ne];E[31]=A[31]&127|64,E[0]&=248,u(p,O);for(let ne=0;ne<16;ne++)N[ne]=p[ne];I[0]=V[0]=1;for(let ne=254;ne>=0;--ne){const U=E[ne>>>3]>>>(ne&7)&1;o(I,N,U),o(B,V,U),f(de,I,B),h(I,I,B),f(B,N,V),h(N,N,V),y(V,de),y(ve,I),m(I,B,I),m(B,N,de),f(de,I,B),h(I,I,B),y(N,I),h(B,V,ve),m(I,B,s),f(I,I,V),m(B,B,I),m(I,V,ve),m(V,N,p),y(N,de),o(I,N,U),o(B,V,U)}for(let ne=0;ne<16;ne++)p[ne+16]=I[ne],p[ne+32]=B[ne],p[ne+48]=N[ne],p[ne+64]=V[ne];const j=p.subarray(32),L=p.subarray(16);w(j,j),m(L,L,j);const Y=new Uint8Array(32);return c(Y,L),Y}t.scalarMult=v;function g(A){return v(A,i)}t.scalarMultBase=g;function _(A){if(A.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const O=new Uint8Array(A);return{publicKey:g(O),secretKey:O}}t.generateKeyPairFromSeed=_;function b(A){const O=(0,e.randomBytes)(32,A),E=_(O);return(0,r.wipe)(O),E}t.generateKeyPair=b;function S(A,O,E=!1){if(A.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(O.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(A,O);if(E){let I=0;for(let N=0;N<p.length;N++)I|=p[N];if(I===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=S})(vD);function bD(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function jZ(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?bD(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function I6(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=jZ(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return bD(r)}function gAe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=i}var o=t.length,c=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function h(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,g=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var S=(b-_)*f+1>>>0,A=new Uint8Array(S);_!==b;){for(var O=w[_],E=0,p=S-1;(O!==0||E<g)&&p!==-1;p--,E++)O+=256*A[p]>>>0,A[p]=O%o>>>0,O=O/o>>>0;if(O!==0)throw new Error("Non-zero carry");g=E,_++}for(var I=S-g;I!==S&&A[I]===0;)I++;for(var N=c.repeat(v);I<S;++I)N+=t.charAt(A[I]);return N}function m(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var g=0,_=0;w[v]===c;)g++,v++;for(var b=(w.length-v)*u+1>>>0,S=new Uint8Array(b);w[v];){var A=r[w.charCodeAt(v)];if(A===255)return;for(var O=0,E=b-1;(A!==0||O<_)&&E!==-1;E--,O++)A+=o*S[E]>>>0,S[E]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");_=O,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var I=new Uint8Array(g+(b-p)),N=g;p!==b;)I[N++]=S[p++];return I}}}function y(w){var v=m(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:m,decode:y}}var mAe=gAe,yAe=mAe;const vAe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},bAe=t=>new TextEncoder().encode(t),wAe=t=>new TextDecoder().decode(t);let _Ae=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},EAe=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return BZ(this,e)}};class xAe{constructor(e){this.decoders=e}or(e){return BZ(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const BZ=(t,e)=>new xAe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class AAe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new _Ae(e,r,n),this.decoder=new EAe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const pA=({name:t,prefix:e,encode:r,decode:n})=>new AAe(t,e,r,n),D1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=yAe(r,e);return pA({prefix:t,name:e,encode:n,decode:s=>vAe(i(s))})},SAe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let o=0,c=0,u=0;for(let f=0;f<s;++f){const h=i[t[f]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,o+=r,o>=8&&(o-=8,a[u++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return a},OAe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",a=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],a+=8;a>r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s},ps=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>pA({prefix:e,name:t,encode(i){return OAe(i,n,r)},decode(i){return SAe(i,n,r,t)}}),IAe=pA({prefix:"\0",name:"identity",encode:t=>wAe(t),decode:t=>bAe(t)}),PAe=Object.freeze(Object.defineProperty({__proto__:null,identity:IAe},Symbol.toStringTag,{value:"Module"})),TAe=ps({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),CAe=Object.freeze(Object.defineProperty({__proto__:null,base2:TAe},Symbol.toStringTag,{value:"Module"})),RAe=ps({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),NAe=Object.freeze(Object.defineProperty({__proto__:null,base8:RAe},Symbol.toStringTag,{value:"Module"})),DAe=D1({prefix:"9",name:"base10",alphabet:"0123456789"}),MAe=Object.freeze(Object.defineProperty({__proto__:null,base10:DAe},Symbol.toStringTag,{value:"Module"})),kAe=ps({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),$Ae=ps({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),LAe=Object.freeze(Object.defineProperty({__proto__:null,base16:kAe,base16upper:$Ae},Symbol.toStringTag,{value:"Module"})),UAe=ps({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),jAe=ps({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),BAe=ps({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),FAe=ps({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),qAe=ps({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),HAe=ps({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),zAe=ps({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),VAe=ps({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),GAe=ps({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),KAe=Object.freeze(Object.defineProperty({__proto__:null,base32:UAe,base32hex:qAe,base32hexpad:zAe,base32hexpadupper:VAe,base32hexupper:HAe,base32pad:BAe,base32padupper:FAe,base32upper:jAe,base32z:GAe},Symbol.toStringTag,{value:"Module"})),WAe=D1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),YAe=D1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),QAe=Object.freeze(Object.defineProperty({__proto__:null,base36:WAe,base36upper:YAe},Symbol.toStringTag,{value:"Module"})),JAe=D1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),XAe=D1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ZAe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:JAe,base58flickr:XAe},Symbol.toStringTag,{value:"Module"})),eSe=ps({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),tSe=ps({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),rSe=ps({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nSe=ps({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),iSe=Object.freeze(Object.defineProperty({__proto__:null,base64:eSe,base64pad:tSe,base64url:rSe,base64urlpad:nSe},Symbol.toStringTag,{value:"Module"})),FZ=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),sSe=FZ.reduce((t,e,r)=>(t[r]=e,t),[]),aSe=FZ.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function oSe(t){return t.reduce((e,r)=>(e+=sSe[r],e),"")}function cSe(t){const e=[];for(const r of t){const n=aSe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const uSe=pA({prefix:"🚀",name:"base256emoji",encode:oSe,decode:cSe}),lSe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:uSe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Xq={...PAe,...CAe,...NAe,...MAe,...LAe,...KAe,...QAe,...ZAe,...iSe,...lSe};function qZ(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Zq=qZ("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),iC=qZ("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=jZ(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),HZ={utf8:Zq,"utf-8":Zq,hex:Xq.base16,latin1:iC,ascii:iC,binary:iC,...Xq};function wa(t,e="utf8"){const r=HZ[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?bD(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function ea(t,e="utf8"){const r=HZ[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var eH=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},fSe=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),dSe=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),hSe=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),pSe=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),gSe=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),mSe=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,ySe=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,tH=3,vSe=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",mSe]],rH=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function bSe(t){return t?nH(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new gSe:typeof navigator<"u"?nH(navigator.userAgent):ESe()}function wSe(t){return t!==""&&vSe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function nH(t){var e=wSe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new pSe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<tH&&(i=eH(eH([],i,!0),xSe(tH-i.length),!0)):i=[];var s=i.join("."),a=_Se(t),o=ySe.exec(t);return o&&o[1]?new hSe(r,s,a,o[1]):new fSe(r,s,a)}function _Se(t){for(var e=0,r=rH.length;e<r;e++){var n=rH[e],i=n[0],s=n[1],a=s.exec(t);if(a)return i}return null}function ESe(){var t=typeof process<"u"&&process.version;return t?new dSe(process.version.slice(1)):null}function xSe(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xt={};/*! *****************************************************************************
114
- Copyright (c) Microsoft Corporation.
115
-
116
- Permission to use, copy, modify, and/or distribute this software for any
117
- purpose with or without fee is hereby granted.
118
-
119
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
120
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
121
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
122
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
123
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
124
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
125
- PERFORMANCE OF THIS SOFTWARE.
126
- ***************************************************************************** */var P6=function(t,e){return P6=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},P6(t,e)};function ASe(t,e){P6(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var T6=function(){return T6=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},T6.apply(this,arguments)};function SSe(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function OSe(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function ISe(t,e){return function(r,n){e(r,n,t)}}function PSe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function TSe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(f){try{u(n.next(f))}catch(h){a(h)}}function c(f){try{u(n.throw(f))}catch(h){a(h)}}function u(f){f.done?s(f.value):i(f.value).then(o,c)}u((n=n.apply(t,e||[])).next())})}function CSe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function RSe(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function NSe(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function C6(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function zZ(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function DSe(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(zZ(arguments[e]));return t}function MSe(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function xb(t){return this instanceof xb?(this.v=t,this):new xb(t)}function kSe(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(m){n[m]&&(i[m]=function(y){return new Promise(function(w,v){s.push([m,y,w,v])>1||o(m,y)})})}function o(m,y){try{c(n[m](y))}catch(w){h(s[0][3],w)}}function c(m){m.value instanceof xb?Promise.resolve(m.value.v).then(u,f):h(s[0][2],m)}function u(m){o("next",m)}function f(m){o("throw",m)}function h(m,y){m(y),s.shift(),s.length&&o(s[0][0],s[0][1])}}function $Se(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(a){return(r=!r)?{value:xb(t[i](a)),done:i==="return"}:s?s(a):a}:s}}function LSe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof C6=="function"?C6(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(o,c){a=t[s](a),i(o,c,a.done,a.value)})}}function i(s,a,o,c){Promise.resolve(c).then(function(u){s({value:u,done:o})},a)}}function USe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function jSe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function BSe(t){return t&&t.__esModule?t:{default:t}}function FSe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function qSe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const HSe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return T6},__asyncDelegator:$Se,__asyncGenerator:kSe,__asyncValues:LSe,__await:xb,__awaiter:TSe,__classPrivateFieldGet:FSe,__classPrivateFieldSet:qSe,__createBinding:RSe,__decorate:OSe,__exportStar:NSe,__extends:ASe,__generator:CSe,__importDefault:BSe,__importStar:jSe,__makeTemplateObject:USe,__metadata:PSe,__param:ISe,__read:zZ,__rest:SSe,__spread:DSe,__spreadArrays:MSe,__values:C6},Symbol.toStringTag,{value:"Module"})),Fo=Ia(HSe);var sC={},Py={},iH;function zSe(){if(iH)return Py;iH=1,Object.defineProperty(Py,"__esModule",{value:!0}),Py.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Py.delay=t,Py}var Id={},aC={},Pd={},sH;function VSe(){return sH||(sH=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.ONE_THOUSAND=Pd.ONE_HUNDRED=void 0,Pd.ONE_HUNDRED=100,Pd.ONE_THOUSAND=1e3),Pd}var oC={},aH;function GSe(){return aH||(aH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(oC)),oC}var oH;function VZ(){return oH||(oH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Fo;e.__exportStar(VSe(),t),e.__exportStar(GSe(),t)}(aC)),aC}var cH;function KSe(){if(cH)return Id;cH=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.fromMiliseconds=Id.toMiliseconds=void 0;const t=VZ();function e(n){return n*t.ONE_THOUSAND}Id.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Id.fromMiliseconds=r,Id}var uH;function WSe(){return uH||(uH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Fo;e.__exportStar(zSe(),t),e.__exportStar(KSe(),t)}(sC)),sC}var kp={},lH;function YSe(){if(lH)return kp;lH=1,Object.defineProperty(kp,"__esModule",{value:!0}),kp.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return kp.Watch=t,kp.default=t,kp}var cC={},Ty={},fH;function QSe(){if(fH)return Ty;fH=1,Object.defineProperty(Ty,"__esModule",{value:!0}),Ty.IWatch=void 0;class t{}return Ty.IWatch=t,Ty}var dH;function JSe(){return dH||(dH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Fo.__exportStar(QSe(),t)}(cC)),cC}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Fo;e.__exportStar(WSe(),t),e.__exportStar(YSe(),t),e.__exportStar(JSe(),t),e.__exportStar(VZ(),t)})(Xt);var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.getLocalStorage=Bn.getLocalStorageOrThrow=Bn.getCrypto=Bn.getCryptoOrThrow=KZ=Bn.getLocation=Bn.getLocationOrThrow=wD=Bn.getNavigator=Bn.getNavigatorOrThrow=GZ=Bn.getDocument=Bn.getDocumentOrThrow=Bn.getFromWindowOrThrow=Bn.getFromWindow=void 0;function Yh(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Bn.getFromWindow=Yh;function pm(t){const e=Yh(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Bn.getFromWindowOrThrow=pm;function XSe(){return pm("document")}Bn.getDocumentOrThrow=XSe;function ZSe(){return Yh("document")}var GZ=Bn.getDocument=ZSe;function eOe(){return pm("navigator")}Bn.getNavigatorOrThrow=eOe;function tOe(){return Yh("navigator")}var wD=Bn.getNavigator=tOe;function rOe(){return pm("location")}Bn.getLocationOrThrow=rOe;function nOe(){return Yh("location")}var KZ=Bn.getLocation=nOe;function iOe(){return pm("crypto")}Bn.getCryptoOrThrow=iOe;function sOe(){return Yh("crypto")}Bn.getCrypto=sOe;function aOe(){return pm("localStorage")}Bn.getLocalStorageOrThrow=aOe;function oOe(){return Yh("localStorage")}Bn.getLocalStorage=oOe;var _D={};Object.defineProperty(_D,"__esModule",{value:!0});var WZ=_D.getWindowMetadata=void 0;const hH=Bn;function cOe(){let t,e;try{t=hH.getDocumentOrThrow(),e=hH.getLocationOrThrow()}catch{return null}function r(){const h=t.getElementsByTagName("link"),m=[];for(let y=0;y<h.length;y++){const w=h[y],v=w.getAttribute("rel");if(v&&v.toLowerCase().indexOf("icon")>-1){const g=w.getAttribute("href");if(g)if(g.toLowerCase().indexOf("https:")===-1&&g.toLowerCase().indexOf("http:")===-1&&g.indexOf("//")!==0){let _=e.protocol+"//"+e.host;if(g.indexOf("/")===0)_+=g;else{const b=e.pathname.split("/");b.pop();const S=b.join("/");_+=S+"/"+g}m.push(_)}else if(g.indexOf("//")===0){const _=e.protocol+g;m.push(_)}else m.push(g)}}return m}function n(...h){const m=t.getElementsByTagName("meta");for(let y=0;y<m.length;y++){const w=m[y],v=["itemprop","property","name"].map(g=>w.getAttribute(g)).filter(g=>g?h.includes(g):!1);if(v.length&&v){const g=w.getAttribute("content");if(g)return g}}return""}function i(){let h=n("name","og:site_name","og:title","twitter:title");return h||(h=t.title),h}function s(){return n("description","og:description","twitter:description","keywords")}const a=i(),o=s(),c=e.origin,u=r();return{description:o,url:c,icons:u,name:a}}WZ=_D.getWindowMetadata=cOe;var Ab={},uOe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),YZ="%[a-f0-9]{2}",pH=new RegExp("("+YZ+")|([^%]+?)","gi"),gH=new RegExp("("+YZ+")+","gi");function R6(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],R6(r),R6(n))}function lOe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(pH)||[],r=1;r<e.length;r++)t=R6(e,r).join(""),e=t.match(pH)||[];return t}}function fOe(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=gH.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=lOe(r[0]);n!==r[0]&&(e[r[0]]=n)}r=gH.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),s=0;s<i.length;s++){var a=i[s];t=t.replace(new RegExp(a,"g"),e[a])}return t}var dOe=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return fOe(t)}},hOe=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},pOe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;s<n.length;s++){var a=n[s],o=t[a];(i?e.indexOf(a)!==-1:e(a,o,t))&&(r[a]=o)}return r};(function(t){const e=uOe,r=dOe,n=hOe,i=pOe,s=b=>b==null,a=Symbol("encodeFragmentIdentifier");function o(b){switch(b.arrayFormat){case"index":return S=>(A,O)=>{const E=A.length;return O===void 0||b.skipNull&&O===null||b.skipEmptyString&&O===""?A:O===null?[...A,[f(S,b),"[",E,"]"].join("")]:[...A,[f(S,b),"[",f(E,b),"]=",f(O,b)].join("")]};case"bracket":return S=>(A,O)=>O===void 0||b.skipNull&&O===null||b.skipEmptyString&&O===""?A:O===null?[...A,[f(S,b),"[]"].join("")]:[...A,[f(S,b),"[]=",f(O,b)].join("")];case"colon-list-separator":return S=>(A,O)=>O===void 0||b.skipNull&&O===null||b.skipEmptyString&&O===""?A:O===null?[...A,[f(S,b),":list="].join("")]:[...A,[f(S,b),":list=",f(O,b)].join("")];case"comma":case"separator":case"bracket-separator":{const S=b.arrayFormat==="bracket-separator"?"[]=":"=";return A=>(O,E)=>E===void 0||b.skipNull&&E===null||b.skipEmptyString&&E===""?O:(E=E===null?"":E,O.length===0?[[f(A,b),S,f(E,b)].join("")]:[[O,f(E,b)].join(b.arrayFormatSeparator)])}default:return S=>(A,O)=>O===void 0||b.skipNull&&O===null||b.skipEmptyString&&O===""?A:O===null?[...A,f(S,b)]:[...A,[f(S,b),"=",f(O,b)].join("")]}}function c(b){let S;switch(b.arrayFormat){case"index":return(A,O,E)=>{if(S=/\[(\d*)\]$/.exec(A),A=A.replace(/\[\d*\]$/,""),!S){E[A]=O;return}E[A]===void 0&&(E[A]={}),E[A][S[1]]=O};case"bracket":return(A,O,E)=>{if(S=/(\[\])$/.exec(A),A=A.replace(/\[\]$/,""),!S){E[A]=O;return}if(E[A]===void 0){E[A]=[O];return}E[A]=[].concat(E[A],O)};case"colon-list-separator":return(A,O,E)=>{if(S=/(:list)$/.exec(A),A=A.replace(/:list$/,""),!S){E[A]=O;return}if(E[A]===void 0){E[A]=[O];return}E[A]=[].concat(E[A],O)};case"comma":case"separator":return(A,O,E)=>{const p=typeof O=="string"&&O.includes(b.arrayFormatSeparator),I=typeof O=="string"&&!p&&h(O,b).includes(b.arrayFormatSeparator);O=I?h(O,b):O;const N=p||I?O.split(b.arrayFormatSeparator).map(B=>h(B,b)):O===null?O:h(O,b);E[A]=N};case"bracket-separator":return(A,O,E)=>{const p=/(\[\])$/.test(A);if(A=A.replace(/\[\]$/,""),!p){E[A]=O&&h(O,b);return}const I=O===null?[]:O.split(b.arrayFormatSeparator).map(N=>h(N,b));if(E[A]===void 0){E[A]=I;return}E[A]=[].concat(E[A],I)};default:return(A,O,E)=>{if(E[A]===void 0){E[A]=O;return}E[A]=[].concat(E[A],O)}}}function u(b){if(typeof b!="string"||b.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(b,S){return S.encode?S.strict?e(b):encodeURIComponent(b):b}function h(b,S){return S.decode?r(b):b}function m(b){return Array.isArray(b)?b.sort():typeof b=="object"?m(Object.keys(b)).sort((S,A)=>Number(S)-Number(A)).map(S=>b[S]):b}function y(b){const S=b.indexOf("#");return S!==-1&&(b=b.slice(0,S)),b}function w(b){let S="";const A=b.indexOf("#");return A!==-1&&(S=b.slice(A)),S}function v(b){b=y(b);const S=b.indexOf("?");return S===-1?"":b.slice(S+1)}function g(b,S){return S.parseNumbers&&!Number.isNaN(Number(b))&&typeof b=="string"&&b.trim()!==""?b=Number(b):S.parseBooleans&&b!==null&&(b.toLowerCase()==="true"||b.toLowerCase()==="false")&&(b=b.toLowerCase()==="true"),b}function _(b,S){S=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},S),u(S.arrayFormatSeparator);const A=c(S),O=Object.create(null);if(typeof b!="string"||(b=b.trim().replace(/^[?#&]/,""),!b))return O;for(const E of b.split("&")){if(E==="")continue;let[p,I]=n(S.decode?E.replace(/\+/g," "):E,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(S.arrayFormat)?I:h(I,S),A(h(p,S),I,O)}for(const E of Object.keys(O)){const p=O[E];if(typeof p=="object"&&p!==null)for(const I of Object.keys(p))p[I]=g(p[I],S);else O[E]=g(p,S)}return S.sort===!1?O:(S.sort===!0?Object.keys(O).sort():Object.keys(O).sort(S.sort)).reduce((E,p)=>{const I=O[p];return I&&typeof I=="object"&&!Array.isArray(I)?E[p]=m(I):E[p]=I,E},Object.create(null))}t.extract=v,t.parse=_,t.stringify=(b,S)=>{if(!b)return"";S=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},S),u(S.arrayFormatSeparator);const A=I=>S.skipNull&&s(b[I])||S.skipEmptyString&&b[I]==="",O=o(S),E={};for(const I of Object.keys(b))A(I)||(E[I]=b[I]);const p=Object.keys(E);return S.sort!==!1&&p.sort(S.sort),p.map(I=>{const N=b[I];return N===void 0?"":N===null?f(I,S):Array.isArray(N)?N.length===0&&S.arrayFormat==="bracket-separator"?f(I,S)+"[]":N.reduce(O(I),[]).join("&"):f(I,S)+"="+f(N,S)}).filter(I=>I.length>0).join("&")},t.parseUrl=(b,S)=>{S=Object.assign({decode:!0},S);const[A,O]=n(b,"#");return Object.assign({url:A.split("?")[0]||"",query:_(v(b),S)},S&&S.parseFragmentIdentifier&&O?{fragmentIdentifier:h(O,S)}:{})},t.stringifyUrl=(b,S)=>{S=Object.assign({encode:!0,strict:!0,[a]:!0},S);const A=y(b.url).split("?")[0]||"",O=t.extract(b.url),E=t.parse(O,{sort:!1}),p=Object.assign(E,b.query);let I=t.stringify(p,S);I&&(I=`?${I}`);let N=w(b.url);return b.fragmentIdentifier&&(N=`#${S[a]?f(b.fragmentIdentifier,S):b.fragmentIdentifier}`),`${A}${I}${N}`},t.pick=(b,S,A)=>{A=Object.assign({parseFragmentIdentifier:!0,[a]:!1},A);const{url:O,query:E,fragmentIdentifier:p}=t.parseUrl(b,A);return t.stringifyUrl({url:O,query:i(E,S),fragmentIdentifier:p},A)},t.exclude=(b,S,A)=>{const O=Array.isArray(S)?E=>!S.includes(E):(E,p)=>!S(E,p);return t.pick(b,O,A)}})(Ab);const gOe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},mOe=":";function yOe(t){const[e,r]=t.split(mOe);return{namespace:e,reference:r}}function vOe(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function QZ(t,e){return t.includes(":")?[t]:e.chains||[]}const JZ="base10",Zs="base16",N6="base64pad",ED="utf8",XZ=0,Qh=1,bOe=0,mH=1,D6=12,xD=32;function wOe(){const t=vD.generateKeyPair();return{privateKey:ea(t.secretKey,Zs),publicKey:ea(t.publicKey,Zs)}}function M6(){const t=hm.randomBytes(xD);return ea(t,Zs)}function _Oe(t,e){const r=vD.sharedKey(wa(t,Zs),wa(e,Zs),!0),n=new aAe(hA.SHA256,r).expand(xD);return ea(n,Zs)}function EOe(t){const e=hA.hash(wa(t,Zs));return ea(e,Zs)}function T0(t){const e=hA.hash(wa(t,ED));return ea(e,Zs)}function xOe(t){return wa(`${t}`,JZ)}function M1(t){return Number(ea(t,JZ))}function AOe(t){const e=xOe(typeof t.type<"u"?t.type:XZ);if(M1(e)===Qh&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?wa(t.senderPublicKey,Zs):void 0,n=typeof t.iv<"u"?wa(t.iv,Zs):hm.randomBytes(D6),i=new mD.ChaCha20Poly1305(wa(t.symKey,Zs)).seal(n,wa(t.message,ED));return OOe({type:e,sealed:i,iv:n,senderPublicKey:r})}function SOe(t){const e=new mD.ChaCha20Poly1305(wa(t.symKey,Zs)),{sealed:r,iv:n}=hx(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return ea(i,ED)}function OOe(t){if(M1(t.type)===Qh){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ea(I6([t.type,t.senderPublicKey,t.iv,t.sealed]),N6)}return ea(I6([t.type,t.iv,t.sealed]),N6)}function hx(t){const e=wa(t,N6),r=e.slice(bOe,mH),n=mH;if(M1(r)===Qh){const o=n+xD,c=o+D6,u=e.slice(n,o),f=e.slice(o,c),h=e.slice(c);return{type:r,sealed:h,iv:f,senderPublicKey:u}}const i=n+D6,s=e.slice(n,i),a=e.slice(i);return{type:r,sealed:a,iv:s}}function IOe(t,e){const r=hx(t);return ZZ({type:M1(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ea(r.senderPublicKey,Zs):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function ZZ(t){const e=(t==null?void 0:t.type)||XZ;if(e===Qh){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function yH(t){return t.type===Qh&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var POe=Object.defineProperty,vH=Object.getOwnPropertySymbols,TOe=Object.prototype.hasOwnProperty,COe=Object.prototype.propertyIsEnumerable,bH=(t,e,r)=>e in t?POe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wH=(t,e)=>{for(var r in e||(e={}))TOe.call(e,r)&&bH(t,r,e[r]);if(vH)for(var r of vH(e))COe.call(e,r)&&bH(t,r,e[r]);return t};const ROe="ReactNative",qa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},NOe="js";function AD(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function k1(){return!GZ()&&!!wD()&&navigator.product===ROe}function $1(){return!AD()&&!!wD()}function L1(){return k1()?qa.reactNative:AD()?qa.node:$1()?qa.browser:qa.unknown}function DOe(t,e){let r=Ab.parse(t);return r=wH(wH({},r),e),t=Ab.stringify(r),t}function MOe(){return WZ()||{name:"",description:"",url:"",icons:[""]}}function kOe(){if(L1()===qa.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=bSe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function $Oe(){var t;const e=L1();return e===qa.browser?[e,((t=KZ())==null?void 0:t.host)||"unknown"].join(":"):e}function LOe(t,e,r){const n=kOe(),i=$Oe();return[[t,e].join("-"),[NOe,r].join("-"),n,i].join("/")}function UOe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:a}){const o=r.split("?"),c=LOe(t,e,n),u={auth:i,ua:c,projectId:s,useOnCloseEvent:a||void 0},f=DOe(o[1]||"",u);return o[0]+"?"+f}function Xd(t,e){return t.filter(r=>e.includes(r)).length===t.length}function eee(t){return Object.fromEntries(t.entries())}function tee(t){return new Map(Object.entries(t))}function Gp(t=Xt.FIVE_MINUTES,e){const r=Xt.toMiliseconds(t||Xt.FIVE_MINUTES);let n,i,s;return{resolve:a=>{s&&n&&(clearTimeout(s),n(a))},reject:a=>{s&&i&&(clearTimeout(s),i(a))},done:()=>new Promise((a,o)=>{s=setTimeout(()=>{o(new Error(e))},r),n=a,i=o})}}function Sb(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const a=await t;n(a)}catch(a){i(a)}clearTimeout(s)})}function ree(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function jOe(t){return ree("topic",t)}function BOe(t){return ree("id",t)}function nee(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function lc(t,e){return Xt.fromMiliseconds((e||Date.now())+Xt.toMiliseconds(t))}function Jl(t){return Date.now()>=Xt.toMiliseconds(t)}function Ii(t,e){return`${t}${e?`:${e}`:""}`}function uC(t=[],e=[]){return[...new Set([...t,...e])]}async function FOe({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n==null?void 0:n.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const s=`${i}/wc?requestId=${t}&sessionTopic=${e}`,a=L1();a===qa.browser?s.startsWith("https://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):a===qa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(n){console.error(n)}}const qOe="irn";function k6(t){return(t==null?void 0:t.relay)||{protocol:qOe}}function lE(t){const e=gOe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var HOe=Object.defineProperty,_H=Object.getOwnPropertySymbols,zOe=Object.prototype.hasOwnProperty,VOe=Object.prototype.propertyIsEnumerable,EH=(t,e,r)=>e in t?HOe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,GOe=(t,e)=>{for(var r in e||(e={}))zOe.call(e,r)&&EH(t,r,e[r]);if(_H)for(var r of _H(e))VOe.call(e,r)&&EH(t,r,e[r]);return t};function KOe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),a=t[i];r[s]=a}}),r}function WOe(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",a=Ab.parse(s);return{protocol:n,topic:YOe(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:KOe(a)}}function YOe(t){return t.startsWith("//")?t.substring(2):t}function QOe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function JOe(t){return`${t.protocol}:${t.topic}@${t.version}?`+Ab.stringify(GOe({symKey:t.symKey},QOe(t.relay)))}function gm(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function XOe(t){const e=[];return Object.values(t).forEach(r=>{e.push(...gm(r.accounts))}),e}function ZOe(t,e){const r=[];return Object.values(t).forEach(n=>{gm(n.accounts).includes(e)&&r.push(...n.methods)}),r}function eIe(t,e){const r=[];return Object.values(t).forEach(n=>{gm(n.accounts).includes(e)&&r.push(...n.events)}),r}function tIe(t,e){const r=fE(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(a=>`${a.split(":")[0]}:${a.split(":")[1]}`)};return n}function SD(t){return t.includes(":")}function gv(t){return SD(t)?t.split(":")[0]:t}const rIe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},nIe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function It(t,e){const{message:r,code:n}=nIe[t];return{message:e?`${r} ${e}`:r,code:n}}function wi(t,e){const{message:r,code:n}=rIe[t];return{message:e?`${r} ${e}`:r,code:n}}function su(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function C0(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ws(t){return typeof t>"u"}function Gi(t,e){return e&&Ws(t)?!0:typeof t=="string"&&!!t.trim().length}function OD(t,e){return e&&Ws(t)?!0:typeof t=="number"&&!isNaN(t)}function iIe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Xd(i,n)?(n.forEach(a=>{const{accounts:o,methods:c,events:u}=t.namespaces[a],f=gm(o),h=r[a];(!Xd(QZ(a,h),f)||!Xd(h.methods,c)||!Xd(h.events,u))&&(s=!1)}),s):!1}function px(t){return Gi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function sIe(t){if(Gi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&px(r)}}return!1}function aIe(t){if(Gi(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function oIe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function cIe(t){return t==null?void 0:t.topic}function uIe(t,e){let r=null;return Gi(t==null?void 0:t.publicKey,!1)||(r=It("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function xH(t){let e=!0;return su(t)?t.length&&(e=t.every(r=>Gi(r,!1))):e=!1,e}function lIe(t,e,r){let n=null;return su(e)&&e.length?e.forEach(i=>{n||px(i)||(n=wi("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):px(t)||(n=wi("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function fIe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const a=lIe(i,QZ(i,s),`${e} ${r}`);a&&(n=a)}),n}function dIe(t,e){let r=null;return su(t)?t.forEach(n=>{r||sIe(n)||(r=wi("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=wi("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function hIe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=dIe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function pIe(t,e){let r=null;return xH(t==null?void 0:t.methods)?xH(t==null?void 0:t.events)||(r=wi("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=wi("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function iee(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=pIe(n,`${e}, namespace`);i&&(r=i)}),r}function gIe(t,e,r){let n=null;if(t&&C0(t)){const i=iee(t,e);i&&(n=i);const s=fIe(t,e,r);s&&(n=s)}else n=It("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function fE(t,e){let r=null;if(t&&C0(t)){const n=iee(t,e);n&&(r=n);const i=hIe(t,e);i&&(r=i)}else r=It("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function see(t){return Gi(t.protocol,!0)}function mIe(t,e){let r=!1;return e&&!t?r=!0:t&&su(t)&&t.length&&t.forEach(n=>{r=see(n)}),r}function yIe(t){return typeof t=="number"}function la(t){return typeof t<"u"&&typeof t!==null}function vIe(t){return!(!t||typeof t!="object"||!t.code||!OD(t.code,!1)||!t.message||!Gi(t.message,!1))}function bIe(t){return!(Ws(t)||!Gi(t.method,!1))}function wIe(t){return!(Ws(t)||Ws(t.result)&&Ws(t.error)||!OD(t.id,!1)||!Gi(t.jsonrpc,!1))}function _Ie(t){return!(Ws(t)||!Gi(t.name,!1))}function AH(t,e){return!(!px(e)||!XOe(t).includes(e))}function EIe(t,e,r){return Gi(r,!1)?ZOe(t,e).includes(r):!1}function xIe(t,e,r){return Gi(r,!1)?eIe(t,e).includes(r):!1}function SH(t,e,r){let n=null;const i=AIe(t),s=SIe(e),a=Object.keys(i),o=Object.keys(s),c=OH(Object.keys(t)),u=OH(Object.keys(e)),f=c.filter(h=>!u.includes(h));return f.length&&(n=It("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
127
- Required: ${f.toString()}
128
- Received: ${Object.keys(e).toString()}`)),Xd(a,o)||(n=It("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
129
- Required: ${a.toString()}
130
- Approved: ${o.toString()}`)),Object.keys(e).forEach(h=>{if(!h.includes(":")||n)return;const m=gm(e[h].accounts);m.includes(h)||(n=It("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${h}
131
- Required: ${h}
132
- Approved: ${m.toString()}`))}),a.forEach(h=>{n||(Xd(i[h].methods,s[h].methods)?Xd(i[h].events,s[h].events)||(n=It("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${h}`)):n=It("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${h}`))}),n}function AIe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function OH(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function SIe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=gm(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function OIe(t,e){return OD(t,!1)&&t<=e.max&&t>=e.min}function IH(){const t=L1();return new Promise(e=>{switch(t){case qa.browser:e(IIe());break;case qa.reactNative:e(PIe());break;case qa.node:e(TIe());break;default:e(!0)}})}function IIe(){return $1()&&(navigator==null?void 0:navigator.onLine)}async function PIe(){if(k1()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function TIe(){return!0}function CIe(t){switch(L1()){case qa.browser:RIe(t);break;case qa.reactNative:NIe(t);break}}function RIe(t){!k1()&&$1()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function NIe(t){k1()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const lC={};let l_=class{static get(e){return lC[e]}static set(e,r){lC[e]=r}static delete(e){delete lC[e]}};var gA={},U1={};Object.defineProperty(U1,"__esModule",{value:!0});function DIe(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}U1.safeJsonParse=DIe;function MIe(t){return typeof t=="string"?t:JSON.stringify(t,(e,r)=>typeof r>"u"?null:r)}U1.safeJsonStringify=MIe;var Cy={exports:{}},PH;function kIe(){return PH||(PH=1,function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof $e<"u"&&$e.localStorage?Cy.exports=$e.localStorage:typeof window<"u"&&window.localStorage?Cy.exports=window.localStorage:Cy.exports=new e}()),Cy.exports}var fC={},Ry={},TH;function $Ie(){if(TH)return Ry;TH=1,Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.IKeyValueStorage=void 0;class t{}return Ry.IKeyValueStorage=t,Ry}var Ny={},CH;function LIe(){if(CH)return Ny;CH=1,Object.defineProperty(Ny,"__esModule",{value:!0}),Ny.parseEntry=void 0;const t=U1;function e(r){var n;return[r[0],t.safeJsonParse((n=r[1])!==null&&n!==void 0?n:"")]}return Ny.parseEntry=e,Ny}var RH;function UIe(){return RH||(RH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Fo;e.__exportStar($Ie(),t),e.__exportStar(LIe(),t)}(fC)),fC}Object.defineProperty(gA,"__esModule",{value:!0});gA.KeyValueStorage=void 0;const Kp=Fo,NH=U1,jIe=Kp.__importDefault(kIe()),BIe=UIe();class aee{constructor(){this.localStorage=jIe.default}getKeys(){return Kp.__awaiter(this,void 0,void 0,function*(){return Object.keys(this.localStorage)})}getEntries(){return Kp.__awaiter(this,void 0,void 0,function*(){return Object.entries(this.localStorage).map(BIe.parseEntry)})}getItem(e){return Kp.__awaiter(this,void 0,void 0,function*(){const r=this.localStorage.getItem(e);if(r!==null)return NH.safeJsonParse(r)})}setItem(e,r){return Kp.__awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(e,NH.safeJsonStringify(r))})}removeItem(e){return Kp.__awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}}gA.KeyValueStorage=aee;var FIe=gA.default=aee,mm={},Dy={},dC={},My={};let Jh=class{};const qIe=Object.freeze(Object.defineProperty({__proto__:null,IEvents:Jh},Symbol.toStringTag,{value:"Module"})),HIe=Ia(qIe);var DH;function zIe(){if(DH)return My;DH=1,Object.defineProperty(My,"__esModule",{value:!0}),My.IHeartBeat=void 0;const t=HIe;class e extends t.IEvents{constructor(n){super()}}return My.IHeartBeat=e,My}var MH;function oee(){return MH||(MH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Fo.__exportStar(zIe(),t)}(dC)),dC}var hC={},Td={},kH;function VIe(){if(kH)return Td;kH=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.HEARTBEAT_EVENTS=Td.HEARTBEAT_INTERVAL=void 0;const t=Xt;return Td.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,Td.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},Td}var $H;function cee(){return $H||($H=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Fo.__exportStar(VIe(),t)}(hC)),hC}var LH;function GIe(){if(LH)return Dy;LH=1,Object.defineProperty(Dy,"__esModule",{value:!0}),Dy.HeartBeat=void 0;const t=Fo,e=Pa,r=Xt,n=oee(),i=cee();class s extends n.IHeartBeat{constructor(o){super(o),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=(o==null?void 0:o.interval)||i.HEARTBEAT_INTERVAL}static init(o){return t.__awaiter(this,void 0,void 0,function*(){const c=new s(o);return yield c.init(),c})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(o,c){this.events.on(o,c)}once(o,c){this.events.once(o,c)}off(o,c){this.events.off(o,c)}removeListener(o,c){this.events.removeListener(o,c)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return Dy.HeartBeat=s,Dy}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Fo;e.__exportStar(GIe(),t),e.__exportStar(oee(),t),e.__exportStar(cee(),t)})(mm);var on={},pC,UH;function KIe(){if(UH)return pC;UH=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}pC=e;function e(r,n,i){var s=i&&i.stringify||t,a=1;if(typeof r=="object"&&r!==null){var o=n.length+a;if(o===1)return r;var c=new Array(o);c[0]=s(r);for(var u=1;u<o;u++)c[u]=s(n[u]);return c.join(" ")}if(typeof r!="string")return r;var f=n.length;if(f===0)return r;for(var h="",m=1-a,y=-1,w=r&&r.length||0,v=0;v<w;){if(r.charCodeAt(v)===37&&v+1<w){switch(y=y>-1?y:0,r.charCodeAt(v+1)){case 100:case 102:if(m>=f||n[m]==null)break;y<v&&(h+=r.slice(y,v)),h+=Number(n[m]),y=v+2,v++;break;case 105:if(m>=f||n[m]==null)break;y<v&&(h+=r.slice(y,v)),h+=Math.floor(Number(n[m])),y=v+2,v++;break;case 79:case 111:case 106:if(m>=f||n[m]===void 0)break;y<v&&(h+=r.slice(y,v));var g=typeof n[m];if(g==="string"){h+="'"+n[m]+"'",y=v+2,v++;break}if(g==="function"){h+=n[m].name||"<anonymous>",y=v+2,v++;break}h+=s(n[m]),y=v+2,v++;break;case 115:if(m>=f)break;y<v&&(h+=r.slice(y,v)),h+=String(n[m]),y=v+2,v++;break;case 37:y<v&&(h+=r.slice(y,v)),h+="%",y=v+2,v++,m--;break}++m}++v}return y===-1?r:(y<w&&(h+=r.slice(y)),h)}return pC}var gC,jH;function WIe(){if(jH)return gC;jH=1;const t=KIe();gC=i;const e=O().console||{},r={mapHttpRequest:w,mapHttpResponse:w,wrapRequestSerializer:v,wrapResponseSerializer:v,wrapErrorSerializer:v,req:w,res:w,err:m};function n(E,p){return Array.isArray(E)?E.filter(function(N){return N!=="!stdSerializers.err"}):E===!0?Object.keys(p):!1}function i(E){E=E||{},E.browser=E.browser||{};const p=E.browser.transmit;if(p&&typeof p.send!="function")throw Error("pino: transmit option must have a send function");const I=E.browser.write||e;E.browser.write&&(E.browser.asObject=!0);const N=E.serializers||{},B=n(E.browser.serialize,N);let V=E.browser.serialize;Array.isArray(E.browser.serialize)&&E.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const de=["error","fatal","warn","info","debug","trace"];typeof I=="function"&&(I.error=I.fatal=I.warn=I.info=I.debug=I.trace=I),E.enabled===!1&&(E.level="silent");const ve=E.level||"info",j=Object.create(I);j.log||(j.log=g),Object.defineProperty(j,"levelVal",{get:Y}),Object.defineProperty(j,"level",{get:ne,set:U});const L={transmit:p,serialize:B,asObject:E.browser.asObject,levels:de,timestamp:y(E)};j.levels=i.levels,j.level=ve,j.setMaxListeners=j.getMaxListeners=j.emit=j.addListener=j.on=j.prependListener=j.once=j.prependOnceListener=j.removeListener=j.removeAllListeners=j.listeners=j.listenerCount=j.eventNames=j.write=j.flush=g,j.serializers=N,j._serialize=B,j._stdErrSerialize=V,j.child=F,p&&(j._logEvent=h());function Y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ne(){return this._level}function U(H){if(H!=="silent"&&!this.levels.values[H])throw Error("unknown level "+H);this._level=H,s(L,j,"error","log"),s(L,j,"fatal","error"),s(L,j,"warn","error"),s(L,j,"info","log"),s(L,j,"debug","log"),s(L,j,"trace","log")}function F(H,M){if(!H)throw new Error("missing bindings for child Pino");M=M||{},B&&H.serializers&&(M.serializers=H.serializers);const q=M.serializers;if(B&&q){var $=Object.assign({},N,q),k=E.browser.serialize===!0?Object.keys($):B;delete H.serializers,c([H],k,$,this._stdErrSerialize)}function G(pe){this._childLevel=(pe._childLevel|0)+1,this.error=u(pe,H,"error"),this.fatal=u(pe,H,"fatal"),this.warn=u(pe,H,"warn"),this.info=u(pe,H,"info"),this.debug=u(pe,H,"debug"),this.trace=u(pe,H,"trace"),$&&(this.serializers=$,this._serialize=k),p&&(this._logEvent=h([].concat(pe._logEvent.bindings,H)))}return G.prototype=this,new G(this)}return j}i.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},i.stdSerializers=r,i.stdTimeFunctions=Object.assign({},{nullTime:_,epochTime:b,unixTime:S,isoTime:A});function s(E,p,I,N){const B=Object.getPrototypeOf(p);p[I]=p.levelVal>p.levels.values[I]?g:B[I]?B[I]:e[I]||e[N]||g,a(E,p,I)}function a(E,p,I){!E.transmit&&p[I]===g||(p[I]=function(N){return function(){const V=E.timestamp(),de=new Array(arguments.length),ve=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var j=0;j<de.length;j++)de[j]=arguments[j];if(E.serialize&&!E.asObject&&c(de,this._serialize,this.serializers,this._stdErrSerialize),E.asObject?N.call(ve,o(this,I,de,V)):N.apply(ve,de),E.transmit){const L=E.transmit.level||p.level,Y=i.levels.values[L],ne=i.levels.values[I];if(ne<Y)return;f(this,{ts:V,methodLevel:I,methodValue:ne,transmitLevel:L,transmitValue:i.levels.values[E.transmit.level||p.level],send:E.transmit.send,val:p.levelVal},de)}}}(p[I]))}function o(E,p,I,N){E._serialize&&c(I,E._serialize,E.serializers,E._stdErrSerialize);const B=I.slice();let V=B[0];const de={};N&&(de.time=N),de.level=i.levels.values[p];let ve=(E._childLevel|0)+1;if(ve<1&&(ve=1),V!==null&&typeof V=="object"){for(;ve--&&typeof B[0]=="object";)Object.assign(de,B.shift());V=B.length?t(B.shift(),B):void 0}else typeof V=="string"&&(V=t(B.shift(),B));return V!==void 0&&(de.msg=V),de}function c(E,p,I,N){for(const B in E)if(N&&E[B]instanceof Error)E[B]=i.stdSerializers.err(E[B]);else if(typeof E[B]=="object"&&!Array.isArray(E[B]))for(const V in E[B])p&&p.indexOf(V)>-1&&V in I&&(E[B][V]=I[V](E[B][V]))}function u(E,p,I){return function(){const N=new Array(1+arguments.length);N[0]=p;for(var B=1;B<N.length;B++)N[B]=arguments[B-1];return E[I].apply(this,N)}}function f(E,p,I){const N=p.send,B=p.ts,V=p.methodLevel,de=p.methodValue,ve=p.val,j=E._logEvent.bindings;c(I,E._serialize||Object.keys(E.serializers),E.serializers,E._stdErrSerialize===void 0?!0:E._stdErrSerialize),E._logEvent.ts=B,E._logEvent.messages=I.filter(function(L){return j.indexOf(L)===-1}),E._logEvent.level.label=V,E._logEvent.level.value=de,N(V,E._logEvent,ve),E._logEvent=h(j)}function h(E){return{ts:0,messages:[],bindings:E||[],level:{label:"",value:0}}}function m(E){const p={type:E.constructor.name,msg:E.message,stack:E.stack};for(const I in E)p[I]===void 0&&(p[I]=E[I]);return p}function y(E){return typeof E.timestamp=="function"?E.timestamp:E.timestamp===!1?_:b}function w(){return{}}function v(E){return E}function g(){}function _(){return!1}function b(){return Date.now()}function S(){return Math.round(Date.now()/1e3)}function A(){return new Date(Date.now()).toISOString()}function O(){function E(p){return typeof p<"u"&&p}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return E(self)||E(window)||E(this)||{}}}return gC}var Cd={},BH;function uee(){return BH||(BH=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.PINO_CUSTOM_CONTEXT_KEY=Cd.PINO_LOGGER_DEFAULTS=void 0,Cd.PINO_LOGGER_DEFAULTS={level:"info"},Cd.PINO_CUSTOM_CONTEXT_KEY="custom_context"),Cd}var Fs={},FH;function YIe(){if(FH)return Fs;FH=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.generateChildLogger=Fs.formatChildLoggerContext=Fs.getLoggerContext=Fs.setBrowserLoggerContext=Fs.getBrowserLoggerContext=Fs.getDefaultLoggerOptions=void 0;const t=uee();function e(o){return Object.assign(Object.assign({},o),{level:(o==null?void 0:o.level)||t.PINO_LOGGER_DEFAULTS.level})}Fs.getDefaultLoggerOptions=e;function r(o,c=t.PINO_CUSTOM_CONTEXT_KEY){return o[c]||""}Fs.getBrowserLoggerContext=r;function n(o,c,u=t.PINO_CUSTOM_CONTEXT_KEY){return o[u]=c,o}Fs.setBrowserLoggerContext=n;function i(o,c=t.PINO_CUSTOM_CONTEXT_KEY){let u="";return typeof o.bindings>"u"?u=r(o,c):u=o.bindings().context||"",u}Fs.getLoggerContext=i;function s(o,c,u=t.PINO_CUSTOM_CONTEXT_KEY){const f=i(o,u);return f.trim()?`${f}/${c}`:c}Fs.formatChildLoggerContext=s;function a(o,c,u=t.PINO_CUSTOM_CONTEXT_KEY){const f=s(o,c,u),h=o.child({context:f});return n(h,f,u)}return Fs.generateChildLogger=a,Fs}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=Fo,r=e.__importDefault(WIe());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(uee(),t),e.__exportStar(YIe(),t)})(on);class QIe extends Jh{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}let JIe=class extends Jh{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}};class XIe{constructor(e,r){this.logger=e,this.core=r}}let ZIe=class extends Jh{constructor(e,r){super(),this.relayer=e,this.logger=r}},ePe=class extends Jh{constructor(e){super()}},tPe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}};class rPe extends Jh{constructor(e,r){super(),this.relayer=e,this.logger=r}}let nPe=class extends Jh{constructor(e,r){super(),this.core=e,this.logger=r}},iPe=class{constructor(e,r){this.projectId=e,this.logger=r}},sPe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},aPe=class{constructor(e){this.client=e}};const oPe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),cPe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ID(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return cPe(t)}catch{return t}}function Ob(t){return typeof t=="string"?t:oPe(t)||""}var PD={},lee={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=kr,r=Wa;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function o(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return o.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},o.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},o.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},o.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},o.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,h=u/536870912|0,m=u<<3,y=u%128<112?128:256;this._buffer[f]=128;for(var w=f+1;w<y-8;w++)this._buffer[w]=0;e.writeUint32BE(h,this._buffer,y-8),e.writeUint32BE(m,this._buffer,y-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,y),this._finished=!0}for(var w=0;w<this.digestLength/8;w++)e.writeUint32BE(this._stateHi[w],c,w*8),e.writeUint32BE(this._stateLo[w],c,w*8+4);return this},o.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},o.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},o}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(o,c,u,f,h,m,y){for(var w=u[0],v=u[1],g=u[2],_=u[3],b=u[4],S=u[5],A=u[6],O=u[7],E=f[0],p=f[1],I=f[2],N=f[3],B=f[4],V=f[5],de=f[6],ve=f[7],j,L,Y,ne,U,F,H,M;y>=128;){for(var q=0;q<16;q++){var $=8*q+m;o[q]=e.readUint32BE(h,$),c[q]=e.readUint32BE(h,$+4)}for(var q=0;q<80;q++){var k=w,G=v,pe=g,Q=_,te=b,ce=S,T=A,le=O,Ge=E,tt=p,yt=I,vt=N,gt=B,Bt=V,Zt=de,Or=ve;if(j=O,L=ve,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=(b>>>14|B<<32-14)^(b>>>18|B<<32-18)^(B>>>41-32|b<<32-(41-32)),L=(B>>>14|b<<32-14)^(B>>>18|b<<32-18)^(b>>>41-32|B<<32-(41-32)),U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,j=b&S^~b&A,L=B&V^~B&de,U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,j=i[q*2],L=i[q*2+1],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,j=o[q%16],L=c[q%16],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,Y=H&65535|M<<16,ne=U&65535|F<<16,j=Y,L=ne,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=(w>>>28|E<<32-28)^(E>>>34-32|w<<32-(34-32))^(E>>>39-32|w<<32-(39-32)),L=(E>>>28|w<<32-28)^(w>>>34-32|E<<32-(34-32))^(w>>>39-32|E<<32-(39-32)),U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,j=w&v^w&g^v&g,L=E&p^E&I^p&I,U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,le=H&65535|M<<16,Or=U&65535|F<<16,j=Q,L=vt,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=Y,L=ne,U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,Q=H&65535|M<<16,vt=U&65535|F<<16,v=k,g=G,_=pe,b=Q,S=te,A=ce,O=T,w=le,p=Ge,I=tt,N=yt,B=vt,V=gt,de=Bt,ve=Zt,E=Or,q%16===15)for(var $=0;$<16;$++)j=o[$],L=c[$],U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=o[($+9)%16],L=c[($+9)%16],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,Y=o[($+1)%16],ne=c[($+1)%16],j=(Y>>>1|ne<<32-1)^(Y>>>8|ne<<32-8)^Y>>>7,L=(ne>>>1|Y<<32-1)^(ne>>>8|Y<<32-8)^(ne>>>7|Y<<32-7),U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,Y=o[($+14)%16],ne=c[($+14)%16],j=(Y>>>19|ne<<32-19)^(ne>>>61-32|Y<<32-(61-32))^Y>>>6,L=(ne>>>19|Y<<32-19)^(Y>>>61-32|ne<<32-(61-32))^(ne>>>6|Y<<32-6),U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,o[$]=H&65535|M<<16,c[$]=U&65535|F<<16}j=w,L=E,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[0],L=f[0],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[0]=w=H&65535|M<<16,f[0]=E=U&65535|F<<16,j=v,L=p,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[1],L=f[1],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[1]=v=H&65535|M<<16,f[1]=p=U&65535|F<<16,j=g,L=I,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[2],L=f[2],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[2]=g=H&65535|M<<16,f[2]=I=U&65535|F<<16,j=_,L=N,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[3],L=f[3],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[3]=_=H&65535|M<<16,f[3]=N=U&65535|F<<16,j=b,L=B,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[4],L=f[4],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[4]=b=H&65535|M<<16,f[4]=B=U&65535|F<<16,j=S,L=V,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[5],L=f[5],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[5]=S=H&65535|M<<16,f[5]=V=U&65535|F<<16,j=A,L=de,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[6],L=f[6],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[6]=A=H&65535|M<<16,f[6]=de=U&65535|F<<16,j=O,L=ve,U=L&65535,F=L>>>16,H=j&65535,M=j>>>16,j=u[7],L=f[7],U+=L&65535,F+=L>>>16,H+=j&65535,M+=j>>>16,F+=U>>>16,H+=F>>>16,M+=H>>>16,u[7]=O=H&65535|M<<16,f[7]=ve=U&65535|F<<16,m+=128,y-=128}return m}function a(o){var c=new n;c.update(o);var u=c.digest();return c.clean(),u}t.hash=a})(lee);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=hm,r=lee,n=Wa;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Q){const te=new Float64Array(16);if(Q)for(let ce=0;ce<Q.length;ce++)te[ce]=Q[ce];return te}const s=new Uint8Array(32);s[0]=9;const a=i(),o=i([1]),c=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),h=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y(Q,te){for(let ce=0;ce<16;ce++)Q[ce]=te[ce]|0}function w(Q){let te=1;for(let ce=0;ce<16;ce++){let T=Q[ce]+te+65535;te=Math.floor(T/65536),Q[ce]=T-te*65536}Q[0]+=te-1+37*(te-1)}function v(Q,te,ce){const T=~(ce-1);for(let le=0;le<16;le++){const Ge=T&(Q[le]^te[le]);Q[le]^=Ge,te[le]^=Ge}}function g(Q,te){const ce=i(),T=i();for(let le=0;le<16;le++)T[le]=te[le];w(T),w(T),w(T);for(let le=0;le<2;le++){ce[0]=T[0]-65517;for(let tt=1;tt<15;tt++)ce[tt]=T[tt]-65535-(ce[tt-1]>>16&1),ce[tt-1]&=65535;ce[15]=T[15]-32767-(ce[14]>>16&1);const Ge=ce[15]>>16&1;ce[14]&=65535,v(T,ce,1-Ge)}for(let le=0;le<16;le++)Q[2*le]=T[le]&255,Q[2*le+1]=T[le]>>8}function _(Q,te){let ce=0;for(let T=0;T<32;T++)ce|=Q[T]^te[T];return(1&ce-1>>>8)-1}function b(Q,te){const ce=new Uint8Array(32),T=new Uint8Array(32);return g(ce,Q),g(T,te),_(ce,T)}function S(Q){const te=new Uint8Array(32);return g(te,Q),te[0]&1}function A(Q,te){for(let ce=0;ce<16;ce++)Q[ce]=te[2*ce]+(te[2*ce+1]<<8);Q[15]&=32767}function O(Q,te,ce){for(let T=0;T<16;T++)Q[T]=te[T]+ce[T]}function E(Q,te,ce){for(let T=0;T<16;T++)Q[T]=te[T]-ce[T]}function p(Q,te,ce){let T,le,Ge=0,tt=0,yt=0,vt=0,gt=0,Bt=0,Zt=0,Or=0,Ct=0,Pt=0,$t=0,Rt=0,Wt=0,Ft=0,Kt=0,Dt=0,Nt=0,Vt=0,Mt=0,ur=0,rr=0,ar=0,ir=0,wr=0,An=0,rn=0,hi=0,$n=0,Ln=0,ri=0,Cr=0,Br=ce[0],Ir=ce[1],_e=ce[2],ee=ce[3],ye=ce[4],Re=ce[5],ze=ce[6],Ze=ce[7],ct=ce[8],dt=ce[9],Et=ce[10],ue=ce[11],Z=ce[12],ge=ce[13],Me=ce[14],Le=ce[15];T=te[0],Ge+=T*Br,tt+=T*Ir,yt+=T*_e,vt+=T*ee,gt+=T*ye,Bt+=T*Re,Zt+=T*ze,Or+=T*Ze,Ct+=T*ct,Pt+=T*dt,$t+=T*Et,Rt+=T*ue,Wt+=T*Z,Ft+=T*ge,Kt+=T*Me,Dt+=T*Le,T=te[1],tt+=T*Br,yt+=T*Ir,vt+=T*_e,gt+=T*ee,Bt+=T*ye,Zt+=T*Re,Or+=T*ze,Ct+=T*Ze,Pt+=T*ct,$t+=T*dt,Rt+=T*Et,Wt+=T*ue,Ft+=T*Z,Kt+=T*ge,Dt+=T*Me,Nt+=T*Le,T=te[2],yt+=T*Br,vt+=T*Ir,gt+=T*_e,Bt+=T*ee,Zt+=T*ye,Or+=T*Re,Ct+=T*ze,Pt+=T*Ze,$t+=T*ct,Rt+=T*dt,Wt+=T*Et,Ft+=T*ue,Kt+=T*Z,Dt+=T*ge,Nt+=T*Me,Vt+=T*Le,T=te[3],vt+=T*Br,gt+=T*Ir,Bt+=T*_e,Zt+=T*ee,Or+=T*ye,Ct+=T*Re,Pt+=T*ze,$t+=T*Ze,Rt+=T*ct,Wt+=T*dt,Ft+=T*Et,Kt+=T*ue,Dt+=T*Z,Nt+=T*ge,Vt+=T*Me,Mt+=T*Le,T=te[4],gt+=T*Br,Bt+=T*Ir,Zt+=T*_e,Or+=T*ee,Ct+=T*ye,Pt+=T*Re,$t+=T*ze,Rt+=T*Ze,Wt+=T*ct,Ft+=T*dt,Kt+=T*Et,Dt+=T*ue,Nt+=T*Z,Vt+=T*ge,Mt+=T*Me,ur+=T*Le,T=te[5],Bt+=T*Br,Zt+=T*Ir,Or+=T*_e,Ct+=T*ee,Pt+=T*ye,$t+=T*Re,Rt+=T*ze,Wt+=T*Ze,Ft+=T*ct,Kt+=T*dt,Dt+=T*Et,Nt+=T*ue,Vt+=T*Z,Mt+=T*ge,ur+=T*Me,rr+=T*Le,T=te[6],Zt+=T*Br,Or+=T*Ir,Ct+=T*_e,Pt+=T*ee,$t+=T*ye,Rt+=T*Re,Wt+=T*ze,Ft+=T*Ze,Kt+=T*ct,Dt+=T*dt,Nt+=T*Et,Vt+=T*ue,Mt+=T*Z,ur+=T*ge,rr+=T*Me,ar+=T*Le,T=te[7],Or+=T*Br,Ct+=T*Ir,Pt+=T*_e,$t+=T*ee,Rt+=T*ye,Wt+=T*Re,Ft+=T*ze,Kt+=T*Ze,Dt+=T*ct,Nt+=T*dt,Vt+=T*Et,Mt+=T*ue,ur+=T*Z,rr+=T*ge,ar+=T*Me,ir+=T*Le,T=te[8],Ct+=T*Br,Pt+=T*Ir,$t+=T*_e,Rt+=T*ee,Wt+=T*ye,Ft+=T*Re,Kt+=T*ze,Dt+=T*Ze,Nt+=T*ct,Vt+=T*dt,Mt+=T*Et,ur+=T*ue,rr+=T*Z,ar+=T*ge,ir+=T*Me,wr+=T*Le,T=te[9],Pt+=T*Br,$t+=T*Ir,Rt+=T*_e,Wt+=T*ee,Ft+=T*ye,Kt+=T*Re,Dt+=T*ze,Nt+=T*Ze,Vt+=T*ct,Mt+=T*dt,ur+=T*Et,rr+=T*ue,ar+=T*Z,ir+=T*ge,wr+=T*Me,An+=T*Le,T=te[10],$t+=T*Br,Rt+=T*Ir,Wt+=T*_e,Ft+=T*ee,Kt+=T*ye,Dt+=T*Re,Nt+=T*ze,Vt+=T*Ze,Mt+=T*ct,ur+=T*dt,rr+=T*Et,ar+=T*ue,ir+=T*Z,wr+=T*ge,An+=T*Me,rn+=T*Le,T=te[11],Rt+=T*Br,Wt+=T*Ir,Ft+=T*_e,Kt+=T*ee,Dt+=T*ye,Nt+=T*Re,Vt+=T*ze,Mt+=T*Ze,ur+=T*ct,rr+=T*dt,ar+=T*Et,ir+=T*ue,wr+=T*Z,An+=T*ge,rn+=T*Me,hi+=T*Le,T=te[12],Wt+=T*Br,Ft+=T*Ir,Kt+=T*_e,Dt+=T*ee,Nt+=T*ye,Vt+=T*Re,Mt+=T*ze,ur+=T*Ze,rr+=T*ct,ar+=T*dt,ir+=T*Et,wr+=T*ue,An+=T*Z,rn+=T*ge,hi+=T*Me,$n+=T*Le,T=te[13],Ft+=T*Br,Kt+=T*Ir,Dt+=T*_e,Nt+=T*ee,Vt+=T*ye,Mt+=T*Re,ur+=T*ze,rr+=T*Ze,ar+=T*ct,ir+=T*dt,wr+=T*Et,An+=T*ue,rn+=T*Z,hi+=T*ge,$n+=T*Me,Ln+=T*Le,T=te[14],Kt+=T*Br,Dt+=T*Ir,Nt+=T*_e,Vt+=T*ee,Mt+=T*ye,ur+=T*Re,rr+=T*ze,ar+=T*Ze,ir+=T*ct,wr+=T*dt,An+=T*Et,rn+=T*ue,hi+=T*Z,$n+=T*ge,Ln+=T*Me,ri+=T*Le,T=te[15],Dt+=T*Br,Nt+=T*Ir,Vt+=T*_e,Mt+=T*ee,ur+=T*ye,rr+=T*Re,ar+=T*ze,ir+=T*Ze,wr+=T*ct,An+=T*dt,rn+=T*Et,hi+=T*ue,$n+=T*Z,Ln+=T*ge,ri+=T*Me,Cr+=T*Le,Ge+=38*Nt,tt+=38*Vt,yt+=38*Mt,vt+=38*ur,gt+=38*rr,Bt+=38*ar,Zt+=38*ir,Or+=38*wr,Ct+=38*An,Pt+=38*rn,$t+=38*hi,Rt+=38*$n,Wt+=38*Ln,Ft+=38*ri,Kt+=38*Cr,le=1,T=Ge+le+65535,le=Math.floor(T/65536),Ge=T-le*65536,T=tt+le+65535,le=Math.floor(T/65536),tt=T-le*65536,T=yt+le+65535,le=Math.floor(T/65536),yt=T-le*65536,T=vt+le+65535,le=Math.floor(T/65536),vt=T-le*65536,T=gt+le+65535,le=Math.floor(T/65536),gt=T-le*65536,T=Bt+le+65535,le=Math.floor(T/65536),Bt=T-le*65536,T=Zt+le+65535,le=Math.floor(T/65536),Zt=T-le*65536,T=Or+le+65535,le=Math.floor(T/65536),Or=T-le*65536,T=Ct+le+65535,le=Math.floor(T/65536),Ct=T-le*65536,T=Pt+le+65535,le=Math.floor(T/65536),Pt=T-le*65536,T=$t+le+65535,le=Math.floor(T/65536),$t=T-le*65536,T=Rt+le+65535,le=Math.floor(T/65536),Rt=T-le*65536,T=Wt+le+65535,le=Math.floor(T/65536),Wt=T-le*65536,T=Ft+le+65535,le=Math.floor(T/65536),Ft=T-le*65536,T=Kt+le+65535,le=Math.floor(T/65536),Kt=T-le*65536,T=Dt+le+65535,le=Math.floor(T/65536),Dt=T-le*65536,Ge+=le-1+37*(le-1),le=1,T=Ge+le+65535,le=Math.floor(T/65536),Ge=T-le*65536,T=tt+le+65535,le=Math.floor(T/65536),tt=T-le*65536,T=yt+le+65535,le=Math.floor(T/65536),yt=T-le*65536,T=vt+le+65535,le=Math.floor(T/65536),vt=T-le*65536,T=gt+le+65535,le=Math.floor(T/65536),gt=T-le*65536,T=Bt+le+65535,le=Math.floor(T/65536),Bt=T-le*65536,T=Zt+le+65535,le=Math.floor(T/65536),Zt=T-le*65536,T=Or+le+65535,le=Math.floor(T/65536),Or=T-le*65536,T=Ct+le+65535,le=Math.floor(T/65536),Ct=T-le*65536,T=Pt+le+65535,le=Math.floor(T/65536),Pt=T-le*65536,T=$t+le+65535,le=Math.floor(T/65536),$t=T-le*65536,T=Rt+le+65535,le=Math.floor(T/65536),Rt=T-le*65536,T=Wt+le+65535,le=Math.floor(T/65536),Wt=T-le*65536,T=Ft+le+65535,le=Math.floor(T/65536),Ft=T-le*65536,T=Kt+le+65535,le=Math.floor(T/65536),Kt=T-le*65536,T=Dt+le+65535,le=Math.floor(T/65536),Dt=T-le*65536,Ge+=le-1+37*(le-1),Q[0]=Ge,Q[1]=tt,Q[2]=yt,Q[3]=vt,Q[4]=gt,Q[5]=Bt,Q[6]=Zt,Q[7]=Or,Q[8]=Ct,Q[9]=Pt,Q[10]=$t,Q[11]=Rt,Q[12]=Wt,Q[13]=Ft,Q[14]=Kt,Q[15]=Dt}function I(Q,te){p(Q,te,te)}function N(Q,te){const ce=i();let T;for(T=0;T<16;T++)ce[T]=te[T];for(T=253;T>=0;T--)I(ce,ce),T!==2&&T!==4&&p(ce,ce,te);for(T=0;T<16;T++)Q[T]=ce[T]}function B(Q,te){const ce=i();let T;for(T=0;T<16;T++)ce[T]=te[T];for(T=250;T>=0;T--)I(ce,ce),T!==1&&p(ce,ce,te);for(T=0;T<16;T++)Q[T]=ce[T]}function V(Q,te){const ce=i(),T=i(),le=i(),Ge=i(),tt=i(),yt=i(),vt=i(),gt=i(),Bt=i();E(ce,Q[1],Q[0]),E(Bt,te[1],te[0]),p(ce,ce,Bt),O(T,Q[0],Q[1]),O(Bt,te[0],te[1]),p(T,T,Bt),p(le,Q[3],te[3]),p(le,le,u),p(Ge,Q[2],te[2]),O(Ge,Ge,Ge),E(tt,T,ce),E(yt,Ge,le),O(vt,Ge,le),O(gt,T,ce),p(Q[0],tt,yt),p(Q[1],gt,vt),p(Q[2],vt,yt),p(Q[3],tt,gt)}function de(Q,te,ce){for(let T=0;T<4;T++)v(Q[T],te[T],ce)}function ve(Q,te){const ce=i(),T=i(),le=i();N(le,te[2]),p(ce,te[0],le),p(T,te[1],le),g(Q,T),Q[31]^=S(ce)<<7}function j(Q,te,ce){y(Q[0],a),y(Q[1],o),y(Q[2],o),y(Q[3],a);for(let T=255;T>=0;--T){const le=ce[T/8|0]>>(T&7)&1;de(Q,te,le),V(te,Q),V(Q,Q),de(Q,te,le)}}function L(Q,te){const ce=[i(),i(),i(),i()];y(ce[0],f),y(ce[1],h),y(ce[2],o),p(ce[3],f,h),j(Q,ce,te)}function Y(Q){if(Q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const te=(0,r.hash)(Q);te[0]&=248,te[31]&=127,te[31]|=64;const ce=new Uint8Array(32),T=[i(),i(),i(),i()];L(T,te),ve(ce,T);const le=new Uint8Array(64);return le.set(Q),le.set(ce,32),{publicKey:ce,secretKey:le}}t.generateKeyPairFromSeed=Y;function ne(Q){const te=(0,e.randomBytes)(32,Q),ce=Y(te);return(0,n.wipe)(te),ce}t.generateKeyPair=ne;function U(Q){if(Q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Q.subarray(32))}t.extractPublicKeyFromSecretKey=U;const F=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function H(Q,te){let ce,T,le,Ge;for(T=63;T>=32;--T){for(ce=0,le=T-32,Ge=T-12;le<Ge;++le)te[le]+=ce-16*te[T]*F[le-(T-32)],ce=Math.floor((te[le]+128)/256),te[le]-=ce*256;te[le]+=ce,te[T]=0}for(ce=0,le=0;le<32;le++)te[le]+=ce-(te[31]>>4)*F[le],ce=te[le]>>8,te[le]&=255;for(le=0;le<32;le++)te[le]-=ce*F[le];for(T=0;T<32;T++)te[T+1]+=te[T]>>8,Q[T]=te[T]&255}function M(Q){const te=new Float64Array(64);for(let ce=0;ce<64;ce++)te[ce]=Q[ce];for(let ce=0;ce<64;ce++)Q[ce]=0;H(Q,te)}function q(Q,te){const ce=new Float64Array(64),T=[i(),i(),i(),i()],le=(0,r.hash)(Q.subarray(0,32));le[0]&=248,le[31]&=127,le[31]|=64;const Ge=new Uint8Array(64);Ge.set(le.subarray(32),32);const tt=new r.SHA512;tt.update(Ge.subarray(32)),tt.update(te);const yt=tt.digest();tt.clean(),M(yt),L(T,yt),ve(Ge,T),tt.reset(),tt.update(Ge.subarray(0,32)),tt.update(Q.subarray(32)),tt.update(te);const vt=tt.digest();M(vt);for(let gt=0;gt<32;gt++)ce[gt]=yt[gt];for(let gt=0;gt<32;gt++)for(let Bt=0;Bt<32;Bt++)ce[gt+Bt]+=vt[gt]*le[Bt];return H(Ge.subarray(32),ce),Ge}t.sign=q;function $(Q,te){const ce=i(),T=i(),le=i(),Ge=i(),tt=i(),yt=i(),vt=i();return y(Q[2],o),A(Q[1],te),I(le,Q[1]),p(Ge,le,c),E(le,le,Q[2]),O(Ge,Q[2],Ge),I(tt,Ge),I(yt,tt),p(vt,yt,tt),p(ce,vt,le),p(ce,ce,Ge),B(ce,ce),p(ce,ce,le),p(ce,ce,Ge),p(ce,ce,Ge),p(Q[0],ce,Ge),I(T,Q[0]),p(T,T,Ge),b(T,le)&&p(Q[0],Q[0],m),I(T,Q[0]),p(T,T,Ge),b(T,le)?-1:(S(Q[0])===te[31]>>7&&E(Q[0],a,Q[0]),p(Q[3],Q[0],Q[1]),0)}function k(Q,te,ce){const T=new Uint8Array(32),le=[i(),i(),i(),i()],Ge=[i(),i(),i(),i()];if(ce.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if($(Ge,Q))return!1;const tt=new r.SHA512;tt.update(ce.subarray(0,32)),tt.update(Q),tt.update(te);const yt=tt.digest();return M(yt),j(le,Ge,yt),L(Ge,ce.subarray(32)),V(le,Ge),ve(T,le),!_(ce,T)}t.verify=k;function G(Q){let te=[i(),i(),i(),i()];if($(te,Q))throw new Error("Ed25519: invalid public key");let ce=i(),T=i(),le=te[1];O(ce,o,le),E(T,o,le),N(T,T),p(ce,ce,T);let Ge=new Uint8Array(32);return g(Ge,ce),Ge}t.convertPublicKeyToX25519=G;function pe(Q){const te=(0,r.hash)(Q.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const ce=new Uint8Array(te.subarray(0,32));return(0,n.wipe)(te),ce}t.convertSecretKeyToX25519=pe})(PD);const uPe="EdDSA",lPe="JWT",fee=".",dee="base64url",fPe="utf8",dPe="utf8",hPe=":",pPe="did",gPe="key",qH="base58btc",mPe="z",yPe="K36",vPe=32;function gx(t){return ea(wa(Ob(t),fPe),dee)}function hee(t){const e=wa(yPe,qH),r=mPe+ea(I6([e,t]),qH);return[pPe,gPe,r].join(hPe)}function bPe(t){return ea(t,dee)}function wPe(t){return wa([gx(t.header),gx(t.payload)].join(fee),dPe)}function _Pe(t){return[gx(t.header),gx(t.payload),bPe(t.signature)].join(fee)}function HH(t=hm.randomBytes(vPe)){return PD.generateKeyPairFromSeed(t)}async function EPe(t,e,r,n,i=Xt.fromMiliseconds(Date.now())){const s={alg:uPe,typ:lPe},a=hee(n.publicKey),o=i+r,c={iss:a,sub:t,aud:e,iat:i,exp:o},u=wPe({header:s,payload:c}),f=PD.sign(n.secretKey,u);return _Pe({header:s,payload:c,signature:f})}const xPe="PARSE_ERROR",APe="INVALID_REQUEST",SPe="METHOD_NOT_FOUND",OPe="INVALID_PARAMS",pee="INTERNAL_ERROR",TD="SERVER_ERROR",IPe=[-32700,-32600,-32601,-32602,-32603],qv={[xPe]:{code:-32700,message:"Parse error"},[APe]:{code:-32600,message:"Invalid Request"},[SPe]:{code:-32601,message:"Method not found"},[OPe]:{code:-32602,message:"Invalid params"},[pee]:{code:-32603,message:"Internal error"},[TD]:{code:-32e3,message:"Server error"}},gee=TD;function PPe(t){return IPe.includes(t)}function zH(t){return Object.keys(qv).includes(t)?qv[t]:qv[gee]}function TPe(t){const e=Object.values(qv).find(r=>r.code===t);return e||qv[gee]}function mee(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var yee={},xu={},VH;function CPe(){if(VH)return xu;VH=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.isBrowserCryptoAvailable=xu.getSubtleCrypto=xu.getBrowerCrypto=void 0;function t(){return($e==null?void 0:$e.crypto)||($e==null?void 0:$e.msCrypto)||{}}xu.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}xu.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return xu.isBrowserCryptoAvailable=r,xu}var Au={},GH;function RPe(){if(GH)return Au;GH=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.isBrowser=Au.isNode=Au.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Au.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Au.isNode=e;function r(){return!t()&&!e()}return Au.isBrowser=r,Au}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Fo;e.__exportStar(CPe(),t),e.__exportStar(RPe(),t)})(yee);function CD(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function vee(t=6){return BigInt(CD(t))}function R0(t,e,r){return{id:r||CD(),jsonrpc:"2.0",method:t,params:e}}function RD(t,e){return{id:t,jsonrpc:"2.0",result:e}}function mA(t,e,r){return{id:t,jsonrpc:"2.0",error:NPe(e,r)}}function NPe(t,e){return typeof t>"u"?zH(pee):(typeof t=="string"&&(t=Object.assign(Object.assign({},zH(TD)),{message:t})),typeof e<"u"&&(t.data=e),PPe(t.code)&&(t=TPe(t.code)),t)}class DPe{}class MPe extends DPe{constructor(){super()}}class kPe extends MPe{constructor(e){super()}}const $Pe="^https?:",LPe="^wss?:";function UPe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function bee(t,e){const r=UPe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function KH(t){return bee(t,$Pe)}function WH(t){return bee(t,LPe)}function jPe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function wee(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function ND(t){return wee(t)&&"method"in t}function yA(t){return wee(t)&&(Mu(t)||fc(t))}function Mu(t){return"result"in t}function fc(t){return"error"in t}class Sl extends kPe{constructor(e){super(e),this.events=new Pa.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(R0(e.method,e.params||[],e.id||vee().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{fc(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),yA(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const BPe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),FPe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",YH=t=>t.split("?")[0],QH=10,qPe=BPe();class HPe{constructor(e){if(this.url=e,this.events=new Pa.EventEmitter,this.registering=!1,!WH(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ob(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!WH(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=yee.isReactNative()?void 0:{rejectUnauthorized:!jPe(e)},s=new qPe(e,[],i);FPe()?s.onerror=a=>{const o=a;n(this.emitError(o.error))}:s.on("error",a=>{n(this.emitError(a))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ID(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=mA(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return mee(e,YH(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>QH&&this.events.setMaxListeners(QH)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${YH(this.url)}`));return this.events.emit("register_error",r),r}}var mx={exports:{}};mx.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,a=9007199254740991,o="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Function]",w="[object GeneratorFunction]",v="[object Map]",g="[object Number]",_="[object Null]",b="[object Object]",S="[object Promise]",A="[object Proxy]",O="[object RegExp]",E="[object Set]",p="[object String]",I="[object Symbol]",N="[object Undefined]",B="[object WeakMap]",V="[object ArrayBuffer]",de="[object DataView]",ve="[object Float32Array]",j="[object Float64Array]",L="[object Int8Array]",Y="[object Int16Array]",ne="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",H="[object Uint16Array]",M="[object Uint32Array]",q=/[\\^$.*+?()[\]{}|]/g,$=/^\[object .+?Constructor\]$/,k=/^(?:0|[1-9]\d*)$/,G={};G[ve]=G[j]=G[L]=G[Y]=G[ne]=G[U]=G[F]=G[H]=G[M]=!0,G[o]=G[c]=G[V]=G[f]=G[de]=G[h]=G[m]=G[y]=G[v]=G[g]=G[b]=G[O]=G[E]=G[p]=G[B]=!1;var pe=typeof $e=="object"&&$e&&$e.Object===Object&&$e,Q=typeof self=="object"&&self&&self.Object===Object&&self,te=pe||Q||Function("return this")(),ce=e&&!e.nodeType&&e,T=ce&&!0&&t&&!t.nodeType&&t,le=T&&T.exports===ce,Ge=le&&pe.process,tt=function(){try{return Ge&&Ge.binding&&Ge.binding("util")}catch{}}(),yt=tt&&tt.isTypedArray;function vt(fe,ke){for(var it=-1,We=fe==null?0:fe.length,Wr=0,fr=[];++it<We;){var pn=fe[it];ke(pn,it,fe)&&(fr[Wr++]=pn)}return fr}function gt(fe,ke){for(var it=-1,We=ke.length,Wr=fe.length;++it<We;)fe[Wr+it]=ke[it];return fe}function Bt(fe,ke){for(var it=-1,We=fe==null?0:fe.length;++it<We;)if(ke(fe[it],it,fe))return!0;return!1}function Zt(fe,ke){for(var it=-1,We=Array(fe);++it<fe;)We[it]=ke(it);return We}function Or(fe){return function(ke){return fe(ke)}}function Ct(fe,ke){return fe.has(ke)}function Pt(fe,ke){return fe==null?void 0:fe[ke]}function $t(fe){var ke=-1,it=Array(fe.size);return fe.forEach(function(We,Wr){it[++ke]=[Wr,We]}),it}function Rt(fe,ke){return function(it){return fe(ke(it))}}function Wt(fe){var ke=-1,it=Array(fe.size);return fe.forEach(function(We){it[++ke]=We}),it}var Ft=Array.prototype,Kt=Function.prototype,Dt=Object.prototype,Nt=te["__core-js_shared__"],Vt=Kt.toString,Mt=Dt.hasOwnProperty,ur=function(){var fe=/[^.]+$/.exec(Nt&&Nt.keys&&Nt.keys.IE_PROTO||"");return fe?"Symbol(src)_1."+fe:""}(),rr=Dt.toString,ar=RegExp("^"+Vt.call(Mt).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ir=le?te.Buffer:void 0,wr=te.Symbol,An=te.Uint8Array,rn=Dt.propertyIsEnumerable,hi=Ft.splice,$n=wr?wr.toStringTag:void 0,Ln=Object.getOwnPropertySymbols,ri=ir?ir.isBuffer:void 0,Cr=Rt(Object.keys,Object),Br=qr(te,"DataView"),Ir=qr(te,"Map"),_e=qr(te,"Promise"),ee=qr(te,"Set"),ye=qr(te,"WeakMap"),Re=qr(Object,"create"),ze=Lt(Br),Ze=Lt(Ir),ct=Lt(_e),dt=Lt(ee),Et=Lt(ye),ue=wr?wr.prototype:void 0,Z=ue?ue.valueOf:void 0;function ge(fe){var ke=-1,it=fe==null?0:fe.length;for(this.clear();++ke<it;){var We=fe[ke];this.set(We[0],We[1])}}function Me(){this.__data__=Re?Re(null):{},this.size=0}function Le(fe){var ke=this.has(fe)&&delete this.__data__[fe];return this.size-=ke?1:0,ke}function wt(fe){var ke=this.__data__;if(Re){var it=ke[fe];return it===n?void 0:it}return Mt.call(ke,fe)?ke[fe]:void 0}function St(fe){var ke=this.__data__;return Re?ke[fe]!==void 0:Mt.call(ke,fe)}function pr(fe,ke){var it=this.__data__;return this.size+=this.has(fe)?0:1,it[fe]=Re&&ke===void 0?n:ke,this}ge.prototype.clear=Me,ge.prototype.delete=Le,ge.prototype.get=wt,ge.prototype.has=St,ge.prototype.set=pr;function lr(fe){var ke=-1,it=fe==null?0:fe.length;for(this.clear();++ke<it;){var We=fe[ke];this.set(We[0],We[1])}}function Xr(){this.__data__=[],this.size=0}function gr(fe){var ke=this.__data__,it=re(ke,fe);if(it<0)return!1;var We=ke.length-1;return it==We?ke.pop():hi.call(ke,it,1),--this.size,!0}function br(fe){var ke=this.__data__,it=re(ke,fe);return it<0?void 0:ke[it][1]}function nn(fe){return re(this.__data__,fe)>-1}function or(fe,ke){var it=this.__data__,We=re(it,fe);return We<0?(++this.size,it.push([fe,ke])):it[We][1]=ke,this}lr.prototype.clear=Xr,lr.prototype.delete=gr,lr.prototype.get=br,lr.prototype.has=nn,lr.prototype.set=or;function $r(fe){var ke=-1,it=fe==null?0:fe.length;for(this.clear();++ke<it;){var We=fe[ke];this.set(We[0],We[1])}}function hn(){this.size=0,this.__data__={hash:new ge,map:new(Ir||lr),string:new ge}}function Lr(fe){var ke=yn(this,fe).delete(fe);return this.size-=ke?1:0,ke}function Qn(fe){return yn(this,fe).get(fe)}function xi(fe){return yn(this,fe).has(fe)}function Jn(fe,ke){var it=yn(this,fe),We=it.size;return it.set(fe,ke),this.size+=it.size==We?0:1,this}$r.prototype.clear=hn,$r.prototype.delete=Lr,$r.prototype.get=Qn,$r.prototype.has=xi,$r.prototype.set=Jn;function Ai(fe){var ke=-1,it=fe==null?0:fe.length;for(this.__data__=new $r;++ke<it;)this.add(fe[ke])}function Si(fe){return this.__data__.set(fe,n),this}function ni(fe){return this.__data__.has(fe)}Ai.prototype.add=Ai.prototype.push=Si,Ai.prototype.has=ni;function Un(fe){var ke=this.__data__=new lr(fe);this.size=ke.size}function Ji(){this.__data__=new lr,this.size=0}function Ni(fe){var ke=this.__data__,it=ke.delete(fe);return this.size=ke.size,it}function ms(fe){return this.__data__.get(fe)}function Ya(fe){return this.__data__.has(fe)}function X(fe,ke){var it=this.__data__;if(it instanceof lr){var We=it.__data__;if(!Ir||We.length<r-1)return We.push([fe,ke]),this.size=++it.size,this;it=this.__data__=new $r(We)}return it.set(fe,ke),this.size=it.size,this}Un.prototype.clear=Ji,Un.prototype.delete=Ni,Un.prototype.get=ms,Un.prototype.has=Ya,Un.prototype.set=X;function me(fe,ke){var it=bn(fe),We=!it&&Oi(fe),Wr=!it&&!We&&ii(fe),fr=!it&&!We&&!Wr&&gi(fe),pn=it||We||Wr||fr,sr=pn?Zt(fe.length,String):[],mr=sr.length;for(var ie in fe)(ke||Mt.call(fe,ie))&&!(pn&&(ie=="length"||Wr&&(ie=="offset"||ie=="parent")||fr&&(ie=="buffer"||ie=="byteLength"||ie=="byteOffset")||he(ie,mr)))&&sr.push(ie);return sr}function re(fe,ke){for(var it=fe.length;it--;)if(Jt(fe[it][0],ke))return it;return-1}function Ee(fe,ke,it){var We=ke(fe);return bn(fe)?We:gt(We,it(fe))}function be(fe){return fe==null?fe===void 0?N:_:$n&&$n in Object(fe)?P(fe):xt(fe)}function Oe(fe){return Bi(fe)&&be(fe)==o}function Xe(fe,ke,it,We,Wr){return fe===ke?!0:fe==null||ke==null||!Bi(fe)&&!Bi(ke)?fe!==fe&&ke!==ke:lt(fe,ke,it,We,Xe,Wr)}function lt(fe,ke,it,We,Wr,fr){var pn=bn(fe),sr=bn(ke),mr=pn?c:K(fe),ie=sr?c:K(ke);mr=mr==o?b:mr,ie=ie==o?b:ie;var C=mr==b,ae=ie==b,we=mr==ie;if(we&&ii(fe)){if(!ii(ke))return!1;pn=!0,C=!1}if(we&&!C)return fr||(fr=new Un),pn||gi(fe)?zt(fe,ke,it,We,Wr,fr):Pr(fe,ke,mr,it,We,Wr,fr);if(!(it&i)){var oe=C&&Mt.call(fe,"__wrapped__"),Ae=ae&&Mt.call(ke,"__wrapped__");if(oe||Ae){var Ie=oe?fe.value():fe,Pe=Ae?ke.value():ke;return fr||(fr=new Un),Wr(Ie,Pe,it,We,fr)}}return we?(fr||(fr=new Un),Gr(fe,ke,it,We,Wr,fr)):!1}function Qe(fe){if(!ra(fe)||Ce(fe))return!1;var ke=un(fe)?ar:$;return ke.test(Lt(fe))}function Ke(fe){return Bi(fe)&&pi(fe.length)&&!!G[be(fe)]}function ht(fe){if(!rt(fe))return Cr(fe);var ke=[];for(var it in Object(fe))Mt.call(fe,it)&&it!="constructor"&&ke.push(it);return ke}function zt(fe,ke,it,We,Wr,fr){var pn=it&i,sr=fe.length,mr=ke.length;if(sr!=mr&&!(pn&&mr>sr))return!1;var ie=fr.get(fe);if(ie&&fr.get(ke))return ie==ke;var C=-1,ae=!0,we=it&s?new Ai:void 0;for(fr.set(fe,ke),fr.set(ke,fe);++C<sr;){var oe=fe[C],Ae=ke[C];if(We)var Ie=pn?We(Ae,oe,C,ke,fe,fr):We(oe,Ae,C,fe,ke,fr);if(Ie!==void 0){if(Ie)continue;ae=!1;break}if(we){if(!Bt(ke,function(Pe,je){if(!Ct(we,je)&&(oe===Pe||Wr(oe,Pe,it,We,fr)))return we.push(je)})){ae=!1;break}}else if(!(oe===Ae||Wr(oe,Ae,it,We,fr))){ae=!1;break}}return fr.delete(fe),fr.delete(ke),ae}function Pr(fe,ke,it,We,Wr,fr,pn){switch(it){case de:if(fe.byteLength!=ke.byteLength||fe.byteOffset!=ke.byteOffset)return!1;fe=fe.buffer,ke=ke.buffer;case V:return!(fe.byteLength!=ke.byteLength||!fr(new An(fe),new An(ke)));case f:case h:case g:return Jt(+fe,+ke);case m:return fe.name==ke.name&&fe.message==ke.message;case O:case p:return fe==ke+"";case v:var sr=$t;case E:var mr=We&i;if(sr||(sr=Wt),fe.size!=ke.size&&!mr)return!1;var ie=pn.get(fe);if(ie)return ie==ke;We|=s,pn.set(fe,ke);var C=zt(sr(fe),sr(ke),We,Wr,fr,pn);return pn.delete(fe),C;case I:if(Z)return Z.call(fe)==Z.call(ke)}return!1}function Gr(fe,ke,it,We,Wr,fr){var pn=it&i,sr=Fr(fe),mr=sr.length,ie=Fr(ke),C=ie.length;if(mr!=C&&!pn)return!1;for(var ae=mr;ae--;){var we=sr[ae];if(!(pn?we in ke:Mt.call(ke,we)))return!1}var oe=fr.get(fe);if(oe&&fr.get(ke))return oe==ke;var Ae=!0;fr.set(fe,ke),fr.set(ke,fe);for(var Ie=pn;++ae<mr;){we=sr[ae];var Pe=fe[we],je=ke[we];if(We)var Ye=pn?We(je,Pe,we,ke,fe,fr):We(Pe,je,we,fe,ke,fr);if(!(Ye===void 0?Pe===je||Wr(Pe,je,it,We,fr):Ye)){Ae=!1;break}Ie||(Ie=we=="constructor")}if(Ae&&!Ie){var qe=fe.constructor,pt=ke.constructor;qe!=pt&&"constructor"in fe&&"constructor"in ke&&!(typeof qe=="function"&&qe instanceof qe&&typeof pt=="function"&&pt instanceof pt)&&(Ae=!1)}return fr.delete(fe),fr.delete(ke),Ae}function Fr(fe){return Ee(fe,na,D)}function yn(fe,ke){var it=fe.__data__;return Se(ke)?it[typeof ke=="string"?"string":"hash"]:it.map}function qr(fe,ke){var it=Pt(fe,ke);return Qe(it)?it:void 0}function P(fe){var ke=Mt.call(fe,$n),it=fe[$n];try{fe[$n]=void 0;var We=!0}catch{}var Wr=rr.call(fe);return We&&(ke?fe[$n]=it:delete fe[$n]),Wr}var D=Ln?function(fe){return fe==null?[]:(fe=Object(fe),vt(Ln(fe),function(ke){return rn.call(fe,ke)}))}:Zr,K=be;(Br&&K(new Br(new ArrayBuffer(1)))!=de||Ir&&K(new Ir)!=v||_e&&K(_e.resolve())!=S||ee&&K(new ee)!=E||ye&&K(new ye)!=B)&&(K=function(fe){var ke=be(fe),it=ke==b?fe.constructor:void 0,We=it?Lt(it):"";if(We)switch(We){case ze:return de;case Ze:return v;case ct:return S;case dt:return E;case Et:return B}return ke});function he(fe,ke){return ke=ke??a,!!ke&&(typeof fe=="number"||k.test(fe))&&fe>-1&&fe%1==0&&fe<ke}function Se(fe){var ke=typeof fe;return ke=="string"||ke=="number"||ke=="symbol"||ke=="boolean"?fe!=="__proto__":fe===null}function Ce(fe){return!!ur&&ur in fe}function rt(fe){var ke=fe&&fe.constructor,it=typeof ke=="function"&&ke.prototype||Dt;return fe===it}function xt(fe){return rr.call(fe)}function Lt(fe){if(fe!=null){try{return Vt.call(fe)}catch{}try{return fe+""}catch{}}return""}function Jt(fe,ke){return fe===ke||fe!==fe&&ke!==ke}var Oi=Oe(function(){return arguments}())?Oe:function(fe){return Bi(fe)&&Mt.call(fe,"callee")&&!rn.call(fe,"callee")},bn=Array.isArray;function At(fe){return fe!=null&&pi(fe.length)&&!un(fe)}var ii=ri||_r;function wn(fe,ke){return Xe(fe,ke)}function un(fe){if(!ra(fe))return!1;var ke=be(fe);return ke==y||ke==w||ke==u||ke==A}function pi(fe){return typeof fe=="number"&&fe>-1&&fe%1==0&&fe<=a}function ra(fe){var ke=typeof fe;return fe!=null&&(ke=="object"||ke=="function")}function Bi(fe){return fe!=null&&typeof fe=="object"}var gi=yt?Or(yt):Ke;function na(fe){return At(fe)?me(fe):ht(fe)}function Zr(){return[]}function _r(){return!1}t.exports=wn})(mx,mx.exports);var zPe=mx.exports;const VPe=_c(zPe);function GPe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=i}var o=t.length,c=t.charAt(0),u=Math.log(o)/Math.log(256),f=Math.log(256)/Math.log(o);function h(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,g=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var S=(b-_)*f+1>>>0,A=new Uint8Array(S);_!==b;){for(var O=w[_],E=0,p=S-1;(O!==0||E<g)&&p!==-1;p--,E++)O+=256*A[p]>>>0,A[p]=O%o>>>0,O=O/o>>>0;if(O!==0)throw new Error("Non-zero carry");g=E,_++}for(var I=S-g;I!==S&&A[I]===0;)I++;for(var N=c.repeat(v);I<S;++I)N+=t.charAt(A[I]);return N}function m(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var g=0,_=0;w[v]===c;)g++,v++;for(var b=(w.length-v)*u+1>>>0,S=new Uint8Array(b);w[v];){var A=r[w.charCodeAt(v)];if(A===255)return;for(var O=0,E=b-1;(A!==0||O<_)&&E!==-1;E--,O++)A+=o*S[E]>>>0,S[E]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");_=O,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&S[p]===0;)p++;for(var I=new Uint8Array(g+(b-p)),N=g;p!==b;)I[N++]=S[p++];return I}}}function y(w){var v=m(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:m,decode:y}}var KPe=GPe,WPe=KPe;const _ee=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},YPe=t=>new TextEncoder().encode(t),QPe=t=>new TextDecoder().decode(t);class JPe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class XPe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Eee(this,e)}}class ZPe{constructor(e){this.decoders=e}or(e){return Eee(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Eee=(t,e)=>new ZPe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let e3e=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new JPe(e,r,n),this.decoder=new XPe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const vA=({name:t,prefix:e,encode:r,decode:n})=>new e3e(t,e,r,n),j1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=WPe(r,e);return vA({prefix:t,name:e,encode:n,decode:s=>_ee(i(s))})},t3e=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let o=0,c=0,u=0;for(let f=0;f<s;++f){const h=i[t[f]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,o+=r,o>=8&&(o-=8,a[u++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return a},r3e=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",a=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],a+=8;a>r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s},gs=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>vA({prefix:e,name:t,encode(i){return r3e(i,n,r)},decode(i){return t3e(i,n,r,t)}}),n3e=vA({prefix:"\0",name:"identity",encode:t=>QPe(t),decode:t=>YPe(t)});var i3e=Object.freeze({__proto__:null,identity:n3e});const s3e=gs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var a3e=Object.freeze({__proto__:null,base2:s3e});const o3e=gs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var c3e=Object.freeze({__proto__:null,base8:o3e});const u3e=j1({prefix:"9",name:"base10",alphabet:"0123456789"});var l3e=Object.freeze({__proto__:null,base10:u3e});const f3e=gs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),d3e=gs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var h3e=Object.freeze({__proto__:null,base16:f3e,base16upper:d3e});const p3e=gs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),g3e=gs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),m3e=gs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),y3e=gs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),v3e=gs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),b3e=gs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),w3e=gs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),_3e=gs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),E3e=gs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var x3e=Object.freeze({__proto__:null,base32:p3e,base32upper:g3e,base32pad:m3e,base32padupper:y3e,base32hex:v3e,base32hexupper:b3e,base32hexpad:w3e,base32hexpadupper:_3e,base32z:E3e});const A3e=j1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),S3e=j1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var O3e=Object.freeze({__proto__:null,base36:A3e,base36upper:S3e});const I3e=j1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),P3e=j1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var T3e=Object.freeze({__proto__:null,base58btc:I3e,base58flickr:P3e});const C3e=gs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),R3e=gs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),N3e=gs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),D3e=gs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var M3e=Object.freeze({__proto__:null,base64:C3e,base64pad:R3e,base64url:N3e,base64urlpad:D3e});const xee=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),k3e=xee.reduce((t,e,r)=>(t[r]=e,t),[]),$3e=xee.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function L3e(t){return t.reduce((e,r)=>(e+=k3e[r],e),"")}function U3e(t){const e=[];for(const r of t){const n=$3e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const j3e=vA({prefix:"🚀",name:"base256emoji",encode:L3e,decode:U3e});var B3e=Object.freeze({__proto__:null,base256emoji:j3e}),F3e=Aee,JH=128,q3e=127,H3e=~q3e,z3e=Math.pow(2,31);function Aee(t,e,r){e=e||[],r=r||0;for(var n=r;t>=z3e;)e[r++]=t&255|JH,t/=128;for(;t&H3e;)e[r++]=t&255|JH,t>>>=7;return e[r]=t|0,Aee.bytes=r-n+1,e}var V3e=$6,G3e=128,XH=127;function $6(t,n){var r=0,n=n||0,i=0,s=n,a,o=t.length;do{if(s>=o)throw $6.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=i<28?(a&XH)<<i:(a&XH)*Math.pow(2,i),i+=7}while(a>=G3e);return $6.bytes=s-n,r}var K3e=Math.pow(2,7),W3e=Math.pow(2,14),Y3e=Math.pow(2,21),Q3e=Math.pow(2,28),J3e=Math.pow(2,35),X3e=Math.pow(2,42),Z3e=Math.pow(2,49),eTe=Math.pow(2,56),tTe=Math.pow(2,63),rTe=function(t){return t<K3e?1:t<W3e?2:t<Y3e?3:t<Q3e?4:t<J3e?5:t<X3e?6:t<Z3e?7:t<eTe?8:t<tTe?9:10},nTe={encode:F3e,decode:V3e,encodingLength:rTe},See=nTe;const ZH=(t,e,r=0)=>(See.encode(t,e,r),e),ez=t=>See.encodingLength(t),L6=(t,e)=>{const r=e.byteLength,n=ez(t),i=n+ez(r),s=new Uint8Array(i+r);return ZH(t,s,0),ZH(r,s,n),s.set(e,i),new iTe(t,r,e,s)};let iTe=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const Oee=({name:t,code:e,encode:r})=>new sTe(t,e,r);let sTe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?L6(this.code,r):r.then(n=>L6(this.code,n))}else throw Error("Unknown type, must be binary type")}};const Iee=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),aTe=Oee({name:"sha2-256",code:18,encode:Iee("SHA-256")}),oTe=Oee({name:"sha2-512",code:19,encode:Iee("SHA-512")});var cTe=Object.freeze({__proto__:null,sha256:aTe,sha512:oTe});const Pee=0,uTe="identity",Tee=_ee,lTe=t=>L6(Pee,Tee(t)),fTe={code:Pee,name:uTe,encode:Tee,digest:lTe};var dTe=Object.freeze({__proto__:null,identity:fTe});new TextEncoder,new TextDecoder;const tz={...i3e,...a3e,...c3e,...l3e,...h3e,...x3e,...O3e,...T3e,...M3e,...B3e};({...cTe,...dTe});function Cee(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function hTe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Cee(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function Ree(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const rz=Ree("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mC=Ree("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=hTe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),pTe={utf8:rz,"utf-8":rz,hex:tz.base16,latin1:mC,ascii:mC,binary:mC,...tz};function gTe(t,e="utf8"){const r=pTe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Cee(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const Nee="wc",mTe=2,DD="core",Ff=`${Nee}@2:${DD}:`,yTe={name:DD,logger:"error"},vTe={database:":memory:"},bTe="crypto",nz="client_ed25519_seed",wTe=Xt.ONE_DAY,_Te="keychain",ETe="0.3",xTe="messages",ATe="0.3",STe=Xt.SIX_HOURS,OTe="publisher",Dee="irn",ITe="error",Mee="wss://relay.walletconnect.com",iz="wss://relay.walletconnect.org",PTe="relayer",Rs={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},TTe="_subscription",Su={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},CTe=Xt.ONE_SECOND,RTe="2.10.4",NTe=1e4,DTe="0.3",MTe="WALLETCONNECT_CLIENT_ID",nc={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},kTe="subscription",$Te="0.3",LTe=Xt.FIVE_SECONDS*1e3,UTe="pairing",jTe="0.3",ky={wc_pairingDelete:{req:{ttl:Xt.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Xt.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Xt.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Xt.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Xt.ONE_DAY,prompt:!1,tag:0},res:{ttl:Xt.ONE_DAY,prompt:!1,tag:0}}},mv={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},kc={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},BTe="history",FTe="0.3",qTe="expirer",lo={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},HTe="0.3",yC="verify-api",o0="https://verify.walletconnect.com",U6="https://verify.walletconnect.org",zTe=[o0,U6];let VTe=class{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=_Te,this.version=ETe,this.initialized=!1,this.storagePrefix=Ff,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=It("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=on.generateChildLogger(r,this.name)}get context(){return on.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,eee(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?tee(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}},GTe=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=bTe,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=HH(i);return hee(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=wOe();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),a=HH(s),o=M6();return await EPe(o,i,wTe,a)},this.generateSharedKey=(i,s,a)=>{this.isInitialized();const o=this.getPrivateKey(i),c=_Oe(o,s);return this.setSymKey(c,a)},this.setSymKey=async(i,s)=>{this.isInitialized();const a=s||EOe(i);return await this.keychain.set(a,i),a},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,a)=>{this.isInitialized();const o=ZZ(a),c=Ob(s);if(yH(o)){const m=o.senderPublicKey,y=o.receiverPublicKey;i=await this.generateSharedKey(m,y)}const u=this.getSymKey(i),{type:f,senderPublicKey:h}=o;return AOe({type:f,symKey:u,message:c,senderPublicKey:h})},this.decode=async(i,s,a)=>{this.isInitialized();const o=IOe(s,a);if(yH(o)){const c=o.receiverPublicKey,u=o.senderPublicKey;i=await this.generateSharedKey(c,u)}try{const c=this.getSymKey(i),u=SOe({symKey:c,encoded:s});return ID(u)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=i=>{const s=hx(i);return M1(s.type)},this.getPayloadSenderPublicKey=i=>{const s=hx(i);return s.senderPublicKey?ea(s.senderPublicKey,Zs):void 0},this.core=e,this.logger=on.generateChildLogger(r,this.name),this.keychain=n||new VTe(this.core,this.logger)}get context(){return on.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(nz)}catch{e=M6(),await this.keychain.set(nz,e)}return gTe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}};class KTe extends XIe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=xTe,this.version=ATe,this.initialized=!1,this.storagePrefix=Ff,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=T0(i);let a=this.messages.get(n);return typeof a>"u"&&(a={}),typeof a[s]<"u"||(a[s]=i,this.messages.set(n,a),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),a=T0(i);return typeof s[a]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=on.generateChildLogger(e,this.name),this.core=r}get context(){return on.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,eee(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?tee(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}}let WTe=class extends ZIe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Pa.EventEmitter,this.name=OTe,this.queue=new Map,this.publishTimeout=Xt.toMiliseconds(Xt.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});try{const o=(s==null?void 0:s.ttl)||STe,c=k6(s),u=(s==null?void 0:s.prompt)||!1,f=(s==null?void 0:s.tag)||0,h=(s==null?void 0:s.id)||vee().toString(),m={topic:n,message:i,opts:{ttl:o,relay:c,prompt:u,tag:f,id:h}},y=setTimeout(()=>this.queue.set(h,m),this.publishTimeout);try{await await Sb(this.rpcPublish(n,i,o,c,u,f,h),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(h),this.relayer.events.emit(Rs.publish,m)}catch(w){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(a=s==null?void 0:s.internal)!=null&&a.throwOnFailedPublish)throw this.removeRequestFromQueue(h),w;return}finally{clearTimeout(y)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}})}catch(o){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(o),o}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=on.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return on.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,a,o){var c,u,f,h;const m={method:lE(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:a},id:o};return Ws((c=m.params)==null?void 0:c.prompt)&&((u=m.params)==null||delete u.prompt),Ws((f=m.params)==null?void 0:f.tag)&&((h=m.params)==null||delete h.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:m}),this.relayer.request(m)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(mm.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Rs.connection_stalled);return}this.checkQueue()}),this.relayer.on(Rs.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}},YTe=class{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}};var QTe=Object.defineProperty,JTe=Object.defineProperties,XTe=Object.getOwnPropertyDescriptors,sz=Object.getOwnPropertySymbols,ZTe=Object.prototype.hasOwnProperty,eCe=Object.prototype.propertyIsEnumerable,az=(t,e,r)=>e in t?QTe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$y=(t,e)=>{for(var r in e||(e={}))ZTe.call(e,r)&&az(t,r,e[r]);if(sz)for(var r of sz(e))eCe.call(e,r)&&az(t,r,e[r]);return t},vC=(t,e)=>JTe(t,XTe(e));let tCe=class extends rPe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new YTe,this.events=new Pa.EventEmitter,this.name=kTe,this.version=$Te,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Ff,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=k6(i),a={topic:n,relay:s};this.pending.set(n,a);const o=await this.rpcSubscribe(n,s);return this.onSubscribe(o,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),o}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const a=new Xt.Watch;a.start(this.pendingSubscriptionWatchLabel);const o=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(o),a.stop(this.pendingSubscriptionWatchLabel),i(!0)),a.elapsed(this.pendingSubscriptionWatchLabel)>=LTe&&(clearInterval(o),a.stop(this.pendingSubscriptionWatchLabel),s(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=on.generateChildLogger(r,this.name),this.clientId=""}get context(){return on.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=k6(n);await this.rpcUnsubscribe(e,r,i);const s=wi("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:lE(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Sb(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Rs.connection_stalled)}return T0(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:lE(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Sb(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Rs.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:lE(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,vC($y({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,$y({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,$y({},r)),this.topicMap.set(r.topic,e),this.events.emit(nc.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=It("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(nc.deleted,vC($y({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(nc.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const n=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(n)}}this.events.emit(nc.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=It("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);su(r)&&this.onBatchSubscribe(r.map((n,i)=>vC($y({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(mm.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Rs.connect,async()=>{await this.onConnect()}),this.relayer.on(Rs.disconnect,()=>{this.onDisconnect()}),this.events.on(nc.created,async e=>{const r=nc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(nc.deleted,async e=>{const r=nc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}};var rCe=Object.defineProperty,oz=Object.getOwnPropertySymbols,nCe=Object.prototype.hasOwnProperty,iCe=Object.prototype.propertyIsEnumerable,cz=(t,e,r)=>e in t?rCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sCe=(t,e)=>{for(var r in e||(e={}))nCe.call(e,r)&&cz(t,r,e[r]);if(oz)for(var r of oz(e))iCe.call(e,r)&&cz(t,r,e[r]);return t};let aCe=class extends ePe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Pa.EventEmitter,this.name=PTe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Rs.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Rs.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Su.payload,this.onPayloadHandler),this.provider.on(Su.connect,this.onConnectHandler),this.provider.on(Su.disconnect,this.onDisconnectHandler),this.provider.on(Su.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?on.generateChildLogger(e.logger,this.name):on.pino(on.getDefaultLoggerOptions({level:e.logger||ITe})),this.messages=new KTe(this.logger,e.core),this.subscriber=new tCe(this,this.logger),this.publisher=new WTe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Mee,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${iz}...`),await this.restartTransport(iz)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},NTe)}get context(){return on.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";if(i)return i;let s;const a=o=>{o.topic===e&&(this.subscriber.off(nc.created,a),s())};return await Promise.all([new Promise(o=>{s=o,this.subscriber.on(nc.created,a)}),new Promise(async o=>{i=await this.subscriber.subscribe(e,r),o()})]),i}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await Sb(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(nc.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await Sb(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(Su.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await IH())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Sl(new HPe(UOe({sdkVersion:RTe,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ND(e)){if(!e.method.endsWith(TTe))return;const r=e.params,{topic:n,message:i,publishedAt:s}=r.data,a={topic:n,message:i,publishedAt:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(sCe({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else yA(e)&&this.events.emit(Rs.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Rs.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=RD(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Su.payload,this.onPayloadHandler),this.provider.off(Su.connect,this.onConnectHandler),this.provider.off(Su.disconnect,this.onDisconnectHandler),this.provider.off(Su.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Rs.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await IH();CIe(async r=>{this.initialized&&e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Rs.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},Xt.toMiliseconds(CTe)))}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}};var oCe=Object.defineProperty,uz=Object.getOwnPropertySymbols,cCe=Object.prototype.hasOwnProperty,uCe=Object.prototype.propertyIsEnumerable,lz=(t,e,r)=>e in t?oCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fz=(t,e)=>{for(var r in e||(e={}))cCe.call(e,r)&&lz(t,r,e[r]);if(uz)for(var r of uz(e))uCe.call(e,r)&&lz(t,r,e[r]);return t};let bA=class extends tPe{constructor(e,r,n,i=Ff,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=DTe,this.cached=[],this.initialized=!1,this.storagePrefix=Ff,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!Ws(a)?this.map.set(this.getKey(a),a):oIe(a)?this.map.set(a.id,a):cIe(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)},this.set=async(a,o)=>{this.isInitialized(),this.map.has(a)?await this.update(a,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:o}),this.map.set(a,o),await this.persist())},this.get=a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a)),this.getAll=a=>(this.isInitialized(),a?this.values.filter(o=>Object.keys(a).every(c=>VPe(o[c],a[c]))):this.values),this.update=async(a,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:o});const c=fz(fz({},this.getData(a)),o);this.map.set(a,c),await this.persist()},this.delete=async(a,o)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:o}),this.map.delete(a),await this.persist())},this.logger=on.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return on.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=It("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=It("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}},lCe=class{constructor(e,r){this.core=e,this.logger=r,this.name=UTe,this.version=jTe,this.events=new J4,this.initialized=!1,this.storagePrefix=Ff,this.ignoredPayloadTypes=[Qh],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=M6(),i=await this.core.crypto.setSymKey(n),s=lc(Xt.FIVE_MINUTES),a={protocol:Dee},o={topic:i,expiry:s,relay:a,active:!1},c=JOe({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:a});return await this.pairings.set(i,o),await this.core.relayer.subscribe(i),this.core.expirer.set(i,s),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:s,relay:a}=WOe(n.uri);let o;if(this.pairings.keys.includes(i)&&(o=this.pairings.get(i),o.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(s,i),await this.core.relayer.subscribe(i,{relay:a}));const c=lc(Xt.FIVE_MINUTES),u={topic:i,relay:a,expiry:c,active:!1};return await this.pairings.set(i,u),this.core.expirer.set(i,c),n.activatePairing&&await this.activate({topic:i}),this.events.emit(mv.create,u),u},this.activate=async({topic:n})=>{this.isInitialized();const i=lc(Xt.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:a,resolve:o,reject:c}=Gp();this.events.once(Ii("pairing_ping",s),({error:u})=>{u?c(u):o()}),await a()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",wi("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const a=R0(i,s),o=await this.core.crypto.encode(n,a),c=ky[i].req;return this.core.history.set(n,a),this.core.relayer.publish(n,o,c),a.id},this.sendResult=async(n,i,s)=>{const a=RD(n,s),o=await this.core.crypto.encode(i,a),c=await this.core.history.get(i,n),u=ky[c.request.method].res;await this.core.relayer.publish(i,o,u),await this.core.history.resolve(a)},this.sendError=async(n,i,s)=>{const a=mA(n,s),o=await this.core.crypto.encode(i,a),c=await this.core.history.get(i,n),u=ky[c.request.method]?ky[c.request.method].res:ky.unregistered_method.res;await this.core.relayer.publish(i,o,u),await this.core.history.resolve(a)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,wi("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>Jl(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,a=(await this.core.history.get(i,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(a)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(mv.ping,{id:s,topic:n})}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{Mu(i)?this.events.emit(Ii("pairing_ping",s),{}):fc(i)&&this.events.emit(Ii("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(mv.delete,{id:s,topic:n})}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:a}=i;try{if(this.registeredMethods.includes(a))return;const o=wi("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,n,o),this.logger.error(o)}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(wi("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!la(n)){const{message:i}=It("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!aIe(n.uri)){const{message:i}=It("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!la(n)){const{message:s}=It("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!la(n)){const{message:s}=It("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Gi(n,!1)){const{message:i}=It("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=It("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(Jl(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=It("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=on.generateChildLogger(r,this.name),this.pairings=new bA(this.core,this.logger,this.name,this.storagePrefix)}get context(){return on.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Rs.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{ND(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):yA(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(lo.expired,async e=>{const{topic:r}=nee(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(mv.expire,{topic:r}))})}},fCe=class extends JIe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Pa.EventEmitter,this.name=BTe,this.version=FTe,this.cached=[],this.initialized=!1,this.storagePrefix=Ff,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const a={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:lc(Xt.THIRTY_DAYS)};this.records.set(a.id,a),this.events.emit(kc.created,a)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=fc(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(kc.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(kc.deleted,s)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=on.generateChildLogger(r,this.name)}get context(){return on.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:R0(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=It("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(kc.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=It("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(kc.created,e=>{const r=kc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(kc.updated,e=>{const r=kc.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(kc.deleted,e=>{const r=kc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(mm.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Xt.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}},dCe=class extends nPe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Pa.EventEmitter,this.name=qTe,this.version=HTe,this.cached=[],this.initialized=!1,this.storagePrefix=Ff,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),a={target:s,expiry:i};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(lo.created,{target:s,expiration:a})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(lo.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=on.generateChildLogger(r,this.name)}get context(){return on.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return jOe(e);if(typeof e=="number")return BOe(e);const{message:r}=It("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(lo.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=It("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=It("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Xt.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(lo.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(mm.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(lo.created,e=>{const r=lo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(lo.expired,e=>{const r=lo.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(lo.deleted,e=>{const r=lo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}}},hCe=class extends iPe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=yC,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||k1()||!$1())return;const i=this.getVerifyUrl(n==null?void 0:n.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(s){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(s)}if(!this.initialized){this.removeIframe(),this.verifyUrl=U6;try{await this.createIframe()}catch(s){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(s),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n==null?void 0:n.verifyUrl);let s;try{s=await this.fetchAttestation(n.attestationId,i)}catch(a){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(a),s=await this.fetchAttestation(n.attestationId,U6)}return s},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const s=this.startAbortTimer(Xt.ONE_SECOND*2),a=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(s),a.status===200?await a.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=s=>{s.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(s=>{if(document.getElementById(yC))return s();window.addEventListener("message",i);const a=document.createElement("iframe");a.id=yC,a.src=`${this.verifyUrl}/${this.projectId}`,a.style.display="none",document.body.append(a),this.iframe=a,n=s}),new Promise((s,a)=>setTimeout(()=>{window.removeEventListener("message",i),a("verify iframe load timeout")},Xt.toMiliseconds(Xt.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||o0;return zTe.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${o0}`),i=o0),i},this.logger=on.generateChildLogger(r,this.name),this.verifyUrl=o0,this.abortController=new AbortController,this.isDevEnv=AD()&&{}.IS_VITEST}get context(){return on.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Xt.toMiliseconds(e))}};var pCe=Object.defineProperty,dz=Object.getOwnPropertySymbols,gCe=Object.prototype.hasOwnProperty,mCe=Object.prototype.propertyIsEnumerable,hz=(t,e,r)=>e in t?pCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pz=(t,e)=>{for(var r in e||(e={}))gCe.call(e,r)&&hz(t,r,e[r]);if(dz)for(var r of dz(e))mCe.call(e,r)&&hz(t,r,e[r]);return t};let yCe=class kee extends QIe{constructor(e){super(e),this.protocol=Nee,this.version=mTe,this.name=DD,this.events=new Pa.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Mee,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:on.pino(on.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||yTe.logger}));this.logger=on.generateChildLogger(r,this.name),this.heartbeat=new mm.HeartBeat,this.crypto=new GTe(this,this.logger,e==null?void 0:e.keychain),this.history=new fCe(this,this.logger),this.expirer=new dCe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new FIe(pz(pz({},vTe),e==null?void 0:e.storageOptions)),this.relayer=new aCe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new lCe(this,this.logger),this.verify=new hCe(this.projectId||"",this.logger)}static async init(e){const r=new kee(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(MTe,n),r}get context(){return on.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const vCe=yCe,$ee="wc",Lee=2,Uee="client",MD=`${$ee}@${Lee}:${Uee}:`,bC={name:Uee,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},gz="WALLETCONNECT_DEEPLINK_CHOICE",bCe="proposal",jee="Proposal expired",wCe="session",f_=Xt.SEVEN_DAYS,_Ce="engine",Ly={wc_sessionPropose:{req:{ttl:Xt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Xt.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Xt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Xt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Xt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Xt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Xt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Xt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Xt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Xt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Xt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Xt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Xt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Xt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Xt.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Xt.THIRTY_SECONDS,prompt:!1,tag:1115}}},wC={min:Xt.FIVE_MINUTES,max:Xt.SEVEN_DAYS},Ou={idle:"IDLE",active:"ACTIVE"},ECe="request",xCe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var ACe=Object.defineProperty,SCe=Object.defineProperties,OCe=Object.getOwnPropertyDescriptors,mz=Object.getOwnPropertySymbols,ICe=Object.prototype.hasOwnProperty,PCe=Object.prototype.propertyIsEnumerable,yz=(t,e,r)=>e in t?ACe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ua=(t,e)=>{for(var r in e||(e={}))ICe.call(e,r)&&yz(t,r,e[r]);if(mz)for(var r of mz(e))PCe.call(e,r)&&yz(t,r,e[r]);return t},Uy=(t,e)=>SCe(t,OCe(e));class TCe extends aPe{constructor(e){super(e),this.name=_Ce,this.events=new J4,this.initialized=!1,this.ignoredPayloadTypes=[Qh],this.requestQueue={state:Ou.idle,queue:[]},this.sessionRequestQueue={state:Ou.idle,queue:[]},this.requestQueueDelay=Xt.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Ly)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Xt.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=Uy(ua({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:o,relays:c}=n;let u=i,f,h=!1;if(u&&(h=this.client.core.pairing.pairings.get(u).active),!u||!h){const{topic:S,uri:A}=await this.client.core.pairing.create();u=S,f=A}const m=await this.client.core.crypto.generateKeyPair(),y=ua({requiredNamespaces:s,optionalNamespaces:a,relays:c??[{protocol:Dee}],proposer:{publicKey:m,metadata:this.client.metadata}},o&&{sessionProperties:o}),{reject:w,resolve:v,done:g}=Gp(Xt.FIVE_MINUTES,jee);if(this.events.once(Ii("session_connect"),async({error:S,session:A})=>{if(S)w(S);else if(A){A.self.publicKey=m;const O=Uy(ua({},A),{requiredNamespaces:A.requiredNamespaces,optionalNamespaces:A.optionalNamespaces});await this.client.session.set(A.topic,O),await this.setExpiry(A.topic,A.expiry),u&&await this.client.core.pairing.updateMetadata({topic:u,metadata:A.peer.metadata}),v(O)}}),!u){const{message:S}=It("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(S)}const _=await this.sendRequest({topic:u,method:"wc_sessionPropose",params:y}),b=lc(Xt.FIVE_MINUTES);return await this.setProposal(_,ua({id:_,expiry:b},y)),{uri:f,approval:g}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:a}=r,o=this.client.proposal.get(n);let{pairingTopic:c,proposer:u,requiredNamespaces:f,optionalNamespaces:h}=o;c=c||"",C0(f)||(f=tIe(s,"approve()"));const m=await this.client.core.crypto.generateKeyPair(),y=u.publicKey,w=await this.client.core.crypto.generateSharedKey(m,y);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:u.metadata}),await this.sendResult({id:n,topic:c,result:{relay:{protocol:i??"irn"},responderPublicKey:m}}),await this.client.proposal.delete(n,wi("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const v=ua({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:f,optionalNamespaces:h,pairingTopic:c,controller:{publicKey:m,metadata:this.client.metadata},expiry:lc(f_)},a&&{sessionProperties:a});await this.client.core.relayer.subscribe(w),await this.sendRequest({topic:w,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0});const g=Uy(ua({},v),{topic:w,pairingTopic:c,acknowledged:!1,self:v.controller,peer:{publicKey:u.publicKey,metadata:u.metadata},controller:m});return await this.client.session.set(w,g),await this.setExpiry(w,lc(f_)),{topic:w,acknowledged:()=>new Promise(_=>setTimeout(()=>_(this.client.session.get(w)),500))}},this.reject=async r=>{await this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,wi("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:a,resolve:o,reject:c}=Gp();return this.events.once(Ii("session_update",s),({error:u})=>{u?c(u):o()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:a}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:s,resolve:a,reject:o}=Gp();return this.events.once(Ii("session_extend",i),({error:c})=>{c?o(c):a()}),await this.setExpiry(n,lc(f_)),{acknowledged:s}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:s,expiry:a}=r,o=CD(),{done:c,resolve:u,reject:f}=Gp(a,"Request expired. Please try again.");return this.events.once(Ii("session_request",o),({error:h,result:m})=>{h?f(h):u(m)}),await Promise.all([new Promise(async h=>{await this.sendRequest({clientRpcId:o,topic:s,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:a,throwOnFailedPublish:!0}).catch(m=>f(m)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:o}),h()}),new Promise(async h=>{const m=await this.client.core.storage.getItem(gz);FOe({id:o,topic:s,wcDeepLink:m}),h()}),c()]).then(h=>h[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;Mu(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0}):fc(i)&&await this.sendError(s,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:s,resolve:a,reject:o}=Gp();this.events.once(Ii("session_ping",i),({error:c})=>{c?o(c):a()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:wi("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>iIe(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var a,o;return((a=s.peerMetadata)==null?void 0:a.url)&&((o=s.peerMetadata)==null?void 0:o.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,wi("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(gz).catch(s=>this.client.logger.warn(s))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,wi("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=Ou.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=Ly.wc_sessionRequest.req.ttl,{id:i,topic:s,params:a,verifyContext:o}=r;await this.client.pendingRequest.set(i,{id:i,topic:s,params:a,verifyContext:o}),n&&this.client.core.expirer.set(i,lc(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:a,relayRpcId:o,clientRpcId:c,throwOnFailedPublish:u}=r,f=R0(i,s,c);if($1()&&xCe.includes(i)){const y=T0(JSON.stringify(f));this.client.core.verify.register({attestationId:y})}const h=await this.client.core.crypto.encode(n,f),m=Ly[i].req;return a&&(m.ttl=a),o&&(m.id=o),this.client.core.history.set(n,f),u?(m.internal=Uy(ua({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,m)):this.client.core.relayer.publish(n,h,m).catch(y=>this.client.logger.error(y)),f.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:a}=r,o=RD(n,s),c=await this.client.core.crypto.encode(i,o),u=await this.client.core.history.get(i,n),f=Ly[u.request.method].res;a?(f.internal=Uy(ua({},f.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,c,f)):this.client.core.relayer.publish(i,c,f).catch(h=>this.client.logger.error(h)),await this.client.core.history.resolve(o)},this.sendError=async(r,n,i)=>{const s=mA(r,i),a=await this.client.core.crypto.encode(n,s),o=await this.client.core.history.get(n,r),c=Ly[o.request.method].res;this.client.core.relayer.publish(n,a,c),await this.client.core.history.resolve(s)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{Jl(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Jl(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Ou.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Ou.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Ou.idle},this.processRequest=r=>{const{topic:n,payload:i}=r,s=i.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${s}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=It("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidConnect(ua({},n.params));const a=lc(Xt.FIVE_MINUTES),o=ua({id:s,pairingTopic:r,expiry:a},i);await this.setProposal(s,o);const c=T0(JSON.stringify(n)),u=await this.getVerifyContext(c,o.proposer.metadata);this.client.events.emit("session_proposal",{id:s,params:o,verifyContext:u})}catch(a){await this.sendError(s,r,a),this.client.logger.error(a)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Mu(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const a=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const o=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const u=await this.client.core.crypto.generateSharedKey(o,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});const f=await this.client.core.relayer.subscribe(u);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else fc(n)&&(await this.client.proposal.delete(i,wi("USER_DISCONNECTED")),this.events.emit(Ii("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:o,expiry:c,namespaces:u,requiredNamespaces:f,optionalNamespaces:h,sessionProperties:m,pairingTopic:y}=n.params,w=ua({topic:r,relay:a,expiry:c,namespaces:u,acknowledged:!0,pairingTopic:y,requiredNamespaces:f,optionalNamespaces:h,controller:o.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},m&&{sessionProperties:m});await this.sendResult({id:n.id,topic:r,result:!0}),this.events.emit(Ii("session_connect"),{session:w}),this.cleanupDuplicatePairings(w)}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Mu(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Ii("session_approve",i),{})):fc(n)&&(await this.client.session.delete(r,wi("USER_DISCONNECTED")),this.events.emit(Ii("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const a=`${r}_session_update`,o=l_.get(a);if(o&&this.isRequestOutOfSync(o,s)){this.client.logger.info(`Discarding out of sync request - ${s}`);return}this.isValidUpdate(ua({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0}),this.client.events.emit("session_update",{id:s,topic:r,params:i}),l_.set(a,s)}catch(a){await this.sendError(s,r,a),this.client.logger.error(a)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Mu(n)?this.events.emit(Ii("session_update",i),{}):fc(n)&&this.events.emit(Ii("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,lc(f_)),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Mu(n)?this.events.emit(Ii("session_extend",i),{}):fc(n)&&this.events.emit(Ii("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Mu(n)?this.events.emit(Ii("session_ping",i),{}):fc(n)&&this.events.emit(Ii("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(Rs.publish,async()=>{s(await this.deleteSession(r))})}),this.sendResult({id:i,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidRequest(ua({topic:r},s));const a=T0(JSON.stringify(R0("wc_sessionRequest",s,i))),o=this.client.session.get(r),c=await this.getVerifyContext(a,o.peer.metadata),u={id:i,topic:r,params:s,verifyContext:c};await this.setPendingSessionRequest(u),this.addSessionRequestToSessionRequestQueue(u),this.processSessionRequestQueue()}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Mu(n)?this.events.emit(Ii("session_request",i),{result:n.result}):fc(n)&&this.events.emit(Ii("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const a=`${r}_session_event_${s.event.name}`,o=l_.get(a);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(ua({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),l_.set(a,i)}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Ou.idle,this.processSessionRequestQueue()},Xt.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Ou.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Ou.active,this.client.events.emit("session_request",r)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=r=>{if(r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,R0("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer},n.id))},this.isValidConnect=async r=>{if(!la(r)){const{message:c}=It("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:a,relays:o}=r;if(Ws(n)||await this.isValidPairingTopic(n),!mIe(o,!0)){const{message:c}=It("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(c)}!Ws(i)&&C0(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Ws(s)&&C0(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ws(a)||this.validateSessionProps(a,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=gIe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!la(r))throw new Error(It("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:a}=r;await this.isValidProposalId(n);const o=this.client.proposal.get(n),c=fE(i,"approve()");if(c)throw new Error(c.message);const u=SH(o.requiredNamespaces,i,"approve()");if(u)throw new Error(u.message);if(!Gi(s,!0)){const{message:f}=It("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}Ws(a)||this.validateSessionProps(a,"sessionProperties")},this.isValidReject=async r=>{if(!la(r)){const{message:s}=It("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!vIe(i)){const{message:s}=It("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!la(r)){const{message:u}=It("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(u)}const{relay:n,controller:i,namespaces:s,expiry:a}=r;if(!see(n)){const{message:u}=It("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const o=uIe(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const c=fE(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Jl(a)){const{message:u}=It("EXPIRED","onSessionSettleRequest()");throw new Error(u)}},this.isValidUpdate=async r=>{if(!la(r)){const{message:c}=It("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const s=this.client.session.get(n),a=fE(i,"update()");if(a)throw new Error(a.message);const o=SH(s.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async r=>{if(!la(r)){const{message:i}=It("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!la(r)){const{message:c}=It("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:a}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!AH(o,s)){const{message:c}=It("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!bIe(i)){const{message:c}=It("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!EIe(o,s,i.method)){const{message:c}=It("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(a&&!OIe(a,wC)){const{message:c}=It("MISSING_OR_INVALID",`request() expiry: ${a}. Expiry must be a number (in seconds) between ${wC.min} and ${wC.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!la(r)){const{message:s}=It("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!wIe(i)){const{message:s}=It("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!la(r)){const{message:i}=It("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!la(r)){const{message:o}=It("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(o)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!AH(a,s)){const{message:o}=It("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(o)}if(!_Ie(i)){const{message:o}=It("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!xIe(a,s,i.name)){const{message:o}=It("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidDisconnect=async r=>{if(!la(r)){const{message:i}=It("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||o0,validation:"UNKNOWN",origin:n.url||""}};try{const s=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});s&&(i.verified.origin=s.origin,i.verified.isScam=s.isScam,i.verified.validation=s.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(s){this.client.logger.info(s)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!Gi(i,!1)){const{message:s}=It("MISSING_OR_INVALID",`${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}async isInitialized(){if(!this.initialized){const{message:e}=It("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Rs.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);try{ND(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):yA(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(s){this.client.logger.error(s)}})}registerExpirerEvents(){this.client.core.expirer.on(lo.expired,async e=>{const{topic:r,id:n}=nee(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,It("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(mv.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!Gi(e,!1)){const{message:r}=It("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=It("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(Jl(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=It("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Gi(e,!1)){const{message:r}=It("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=It("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(Jl(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=It("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Gi(e,!1)){const{message:r}=It("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=It("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!yIe(e)){const{message:r}=It("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=It("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(Jl(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=It("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class CCe extends bA{constructor(e,r){super(e,r,bCe,MD),this.core=e,this.logger=r}}class RCe extends bA{constructor(e,r){super(e,r,wCe,MD),this.core=e,this.logger=r}}class NCe extends bA{constructor(e,r){super(e,r,ECe,MD,n=>n.id),this.core=e,this.logger=r}}let DCe=class Bee extends sPe{constructor(e){super(e),this.protocol=$ee,this.version=Lee,this.name=bC.name,this.events=new Pa.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=(e==null?void 0:e.name)||bC.name,this.metadata=(e==null?void 0:e.metadata)||MOe();const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:on.pino(on.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||bC.logger}));this.core=(e==null?void 0:e.core)||new vCe(e),this.logger=on.generateChildLogger(r,this.name),this.session=new RCe(this.core,this.logger),this.proposal=new CCe(this.core,this.logger),this.pendingRequest=new NCe(this.core,this.logger),this.engine=new TCe(this)}static async init(e){const r=new Bee(e);return await r.initialize(),r}get context(){return on.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var j6={exports:{}};(function(t,e){var r=typeof self<"u"?self:$e,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(a){var o={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(j){return j&&DataView.prototype.isPrototypeOf(j)}if(o.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(j){return j&&u.indexOf(Object.prototype.toString.call(j))>-1};function h(j){if(typeof j!="string"&&(j=String(j)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(j))throw new TypeError("Invalid character in header field name");return j.toLowerCase()}function m(j){return typeof j!="string"&&(j=String(j)),j}function y(j){var L={next:function(){var Y=j.shift();return{done:Y===void 0,value:Y}}};return o.iterable&&(L[Symbol.iterator]=function(){return L}),L}function w(j){this.map={},j instanceof w?j.forEach(function(L,Y){this.append(Y,L)},this):Array.isArray(j)?j.forEach(function(L){this.append(L[0],L[1])},this):j&&Object.getOwnPropertyNames(j).forEach(function(L){this.append(L,j[L])},this)}w.prototype.append=function(j,L){j=h(j),L=m(L);var Y=this.map[j];this.map[j]=Y?Y+", "+L:L},w.prototype.delete=function(j){delete this.map[h(j)]},w.prototype.get=function(j){return j=h(j),this.has(j)?this.map[j]:null},w.prototype.has=function(j){return this.map.hasOwnProperty(h(j))},w.prototype.set=function(j,L){this.map[h(j)]=m(L)},w.prototype.forEach=function(j,L){for(var Y in this.map)this.map.hasOwnProperty(Y)&&j.call(L,this.map[Y],Y,this)},w.prototype.keys=function(){var j=[];return this.forEach(function(L,Y){j.push(Y)}),y(j)},w.prototype.values=function(){var j=[];return this.forEach(function(L){j.push(L)}),y(j)},w.prototype.entries=function(){var j=[];return this.forEach(function(L,Y){j.push([Y,L])}),y(j)},o.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function v(j){if(j.bodyUsed)return Promise.reject(new TypeError("Already read"));j.bodyUsed=!0}function g(j){return new Promise(function(L,Y){j.onload=function(){L(j.result)},j.onerror=function(){Y(j.error)}})}function _(j){var L=new FileReader,Y=g(L);return L.readAsArrayBuffer(j),Y}function b(j){var L=new FileReader,Y=g(L);return L.readAsText(j),Y}function S(j){for(var L=new Uint8Array(j),Y=new Array(L.length),ne=0;ne<L.length;ne++)Y[ne]=String.fromCharCode(L[ne]);return Y.join("")}function A(j){if(j.slice)return j.slice(0);var L=new Uint8Array(j.byteLength);return L.set(new Uint8Array(j)),L.buffer}function O(){return this.bodyUsed=!1,this._initBody=function(j){this._bodyInit=j,j?typeof j=="string"?this._bodyText=j:o.blob&&Blob.prototype.isPrototypeOf(j)?this._bodyBlob=j:o.formData&&FormData.prototype.isPrototypeOf(j)?this._bodyFormData=j:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(j)?this._bodyText=j.toString():o.arrayBuffer&&o.blob&&c(j)?(this._bodyArrayBuffer=A(j.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(j)||f(j))?this._bodyArrayBuffer=A(j):this._bodyText=j=Object.prototype.toString.call(j):this._bodyText="",this.headers.get("content-type")||(typeof j=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(j)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var j=v(this);if(j)return j;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?v(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var j=v(this);if(j)return j;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(S(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(N)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function p(j){var L=j.toUpperCase();return E.indexOf(L)>-1?L:j}function I(j,L){L=L||{};var Y=L.body;if(j instanceof I){if(j.bodyUsed)throw new TypeError("Already read");this.url=j.url,this.credentials=j.credentials,L.headers||(this.headers=new w(j.headers)),this.method=j.method,this.mode=j.mode,this.signal=j.signal,!Y&&j._bodyInit!=null&&(Y=j._bodyInit,j.bodyUsed=!0)}else this.url=String(j);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new w(L.headers)),this.method=p(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Y)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function N(j){var L=new FormData;return j.trim().split("&").forEach(function(Y){if(Y){var ne=Y.split("="),U=ne.shift().replace(/\+/g," "),F=ne.join("=").replace(/\+/g," ");L.append(decodeURIComponent(U),decodeURIComponent(F))}}),L}function B(j){var L=new w,Y=j.replace(/\r?\n[\t ]+/g," ");return Y.split(/\r?\n/).forEach(function(ne){var U=ne.split(":"),F=U.shift().trim();if(F){var H=U.join(":").trim();L.append(F,H)}}),L}O.call(I.prototype);function V(j,L){L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in L?L.statusText:"OK",this.headers=new w(L.headers),this.url=L.url||"",this._initBody(j)}O.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},V.error=function(){var j=new V(null,{status:0,statusText:""});return j.type="error",j};var de=[301,302,303,307,308];V.redirect=function(j,L){if(de.indexOf(L)===-1)throw new RangeError("Invalid status code");return new V(null,{status:L,headers:{location:j}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(L,Y){this.message=L,this.name=Y;var ne=Error(L);this.stack=ne.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function ve(j,L){return new Promise(function(Y,ne){var U=new I(j,L);if(U.signal&&U.signal.aborted)return ne(new a.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function H(){F.abort()}F.onload=function(){var M={status:F.status,statusText:F.statusText,headers:B(F.getAllResponseHeaders()||"")};M.url="responseURL"in F?F.responseURL:M.headers.get("X-Request-URL");var q="response"in F?F.response:F.responseText;Y(new V(q,M))},F.onerror=function(){ne(new TypeError("Network request failed"))},F.ontimeout=function(){ne(new TypeError("Network request failed"))},F.onabort=function(){ne(new a.DOMException("Aborted","AbortError"))},F.open(U.method,U.url,!0),U.credentials==="include"?F.withCredentials=!0:U.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&o.blob&&(F.responseType="blob"),U.headers.forEach(function(M,q){F.setRequestHeader(q,M)}),U.signal&&(U.signal.addEventListener("abort",H),F.onreadystatechange=function(){F.readyState===4&&U.signal.removeEventListener("abort",H)}),F.send(typeof U._bodyInit>"u"?null:U._bodyInit)})}return ve.polyfill=!0,s.fetch||(s.fetch=ve,s.Headers=w,s.Request=I,s.Response=V),a.Headers=w,a.Request=I,a.Response=V,a.fetch=ve,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(j6,j6.exports);var MCe=j6.exports;const vz=_c(MCe),kCe={Accept:"application/json","Content-Type":"application/json"},$Ce="POST",bz={headers:kCe,method:$Ce},wz=10;class td{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Pa.EventEmitter,this.isAvailable=!1,this.registering=!1,!KH(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,r){this.isAvailable||await this.register();try{const n=Ob(e),s=await(await vz(this.url,Object.assign(Object.assign({},bz),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!KH(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Ob({id:1,jsonrpc:"2.0",method:"test",params:[]});await vz(e,Object.assign(Object.assign({},bz),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?ID(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=mA(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return mee(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>wz&&this.events.setMaxListeners(wz)}}const _z="error",LCe="wss://relay.walletconnect.com",UCe="wc",jCe="universal_provider",Ez=`${UCe}@2:${jCe}:`,BCe="https://rpc.walletconnect.com/v1/",Ol={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var jy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B6={exports:{}};/**
133
- * @license
134
- * Lodash <https://lodash.com/>
135
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
136
- * Released under MIT license <https://lodash.com/license>
137
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
138
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
139
- */(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,m=2,y=4,w=1,v=2,g=1,_=2,b=4,S=8,A=16,O=32,E=64,p=128,I=256,N=512,B=30,V="...",de=800,ve=16,j=1,L=2,Y=3,ne=1/0,U=9007199254740991,F=17976931348623157e292,H=0/0,M=4294967295,q=M-1,$=M>>>1,k=[["ary",p],["bind",g],["bindKey",_],["curry",S],["curryRight",A],["flip",N],["partial",O],["partialRight",E],["rearg",I]],G="[object Arguments]",pe="[object Array]",Q="[object AsyncFunction]",te="[object Boolean]",ce="[object Date]",T="[object DOMException]",le="[object Error]",Ge="[object Function]",tt="[object GeneratorFunction]",yt="[object Map]",vt="[object Number]",gt="[object Null]",Bt="[object Object]",Zt="[object Promise]",Or="[object Proxy]",Ct="[object RegExp]",Pt="[object Set]",$t="[object String]",Rt="[object Symbol]",Wt="[object Undefined]",Ft="[object WeakMap]",Kt="[object WeakSet]",Dt="[object ArrayBuffer]",Nt="[object DataView]",Vt="[object Float32Array]",Mt="[object Float64Array]",ur="[object Int8Array]",rr="[object Int16Array]",ar="[object Int32Array]",ir="[object Uint8Array]",wr="[object Uint8ClampedArray]",An="[object Uint16Array]",rn="[object Uint32Array]",hi=/\b__p \+= '';/g,$n=/\b(__p \+=) '' \+/g,Ln=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ri=/&(?:amp|lt|gt|quot|#39);/g,Cr=/[&<>"']/g,Br=RegExp(ri.source),Ir=RegExp(Cr.source),_e=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,ye=/<%=([\s\S]+?)%>/g,Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ze=/^\w*$/,Ze=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ct=/[\\^$.*+?()[\]{}|]/g,dt=RegExp(ct.source),Et=/^\s+/,ue=/\s/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ge=/\{\n\/\* \[wrapped with (.+)\] \*/,Me=/,? & /,Le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wt=/[()=,{}\[\]\/\s]/,St=/\\(\\)?/g,pr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lr=/\w*$/,Xr=/^[-+]0x[0-9a-f]+$/i,gr=/^0b[01]+$/i,br=/^\[object .+?Constructor\]$/,nn=/^0o[0-7]+$/i,or=/^(?:0|[1-9]\d*)$/,$r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hn=/($^)/,Lr=/['\n\r\u2028\u2029\\]/g,Qn="\\ud800-\\udfff",xi="\\u0300-\\u036f",Jn="\\ufe20-\\ufe2f",Ai="\\u20d0-\\u20ff",Si=xi+Jn+Ai,ni="\\u2700-\\u27bf",Un="a-z\\xdf-\\xf6\\xf8-\\xff",Ji="\\xac\\xb1\\xd7\\xf7",Ni="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ms="\\u2000-\\u206f",Ya=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",X="A-Z\\xc0-\\xd6\\xd8-\\xde",me="\\ufe0e\\ufe0f",re=Ji+Ni+ms+Ya,Ee="['’]",be="["+Qn+"]",Oe="["+re+"]",Xe="["+Si+"]",lt="\\d+",Qe="["+ni+"]",Ke="["+Un+"]",ht="[^"+Qn+re+lt+ni+Un+X+"]",zt="\\ud83c[\\udffb-\\udfff]",Pr="(?:"+Xe+"|"+zt+")",Gr="[^"+Qn+"]",Fr="(?:\\ud83c[\\udde6-\\uddff]){2}",yn="[\\ud800-\\udbff][\\udc00-\\udfff]",qr="["+X+"]",P="\\u200d",D="(?:"+Ke+"|"+ht+")",K="(?:"+qr+"|"+ht+")",he="(?:"+Ee+"(?:d|ll|m|re|s|t|ve))?",Se="(?:"+Ee+"(?:D|LL|M|RE|S|T|VE))?",Ce=Pr+"?",rt="["+me+"]?",xt="(?:"+P+"(?:"+[Gr,Fr,yn].join("|")+")"+rt+Ce+")*",Lt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Oi=rt+Ce+xt,bn="(?:"+[Qe,Fr,yn].join("|")+")"+Oi,At="(?:"+[Gr+Xe+"?",Xe,Fr,yn,be].join("|")+")",ii=RegExp(Ee,"g"),wn=RegExp(Xe,"g"),un=RegExp(zt+"(?="+zt+")|"+At+Oi,"g"),pi=RegExp([qr+"?"+Ke+"+"+he+"(?="+[Oe,qr,"$"].join("|")+")",K+"+"+Se+"(?="+[Oe,qr+D,"$"].join("|")+")",qr+"?"+D+"+"+he,qr+"+"+Se,Jt,Lt,lt,bn].join("|"),"g"),ra=RegExp("["+P+Qn+Si+me+"]"),Bi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gi=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],na=-1,Zr={};Zr[Vt]=Zr[Mt]=Zr[ur]=Zr[rr]=Zr[ar]=Zr[ir]=Zr[wr]=Zr[An]=Zr[rn]=!0,Zr[G]=Zr[pe]=Zr[Dt]=Zr[te]=Zr[Nt]=Zr[ce]=Zr[le]=Zr[Ge]=Zr[yt]=Zr[vt]=Zr[Bt]=Zr[Ct]=Zr[Pt]=Zr[$t]=Zr[Ft]=!1;var _r={};_r[G]=_r[pe]=_r[Dt]=_r[Nt]=_r[te]=_r[ce]=_r[Vt]=_r[Mt]=_r[ur]=_r[rr]=_r[ar]=_r[yt]=_r[vt]=_r[Bt]=_r[Ct]=_r[Pt]=_r[$t]=_r[Rt]=_r[ir]=_r[wr]=_r[An]=_r[rn]=!0,_r[le]=_r[Ge]=_r[Ft]=!1;var fe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ke={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},it={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},We={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wr=parseFloat,fr=parseInt,pn=typeof jy=="object"&&jy&&jy.Object===Object&&jy,sr=typeof self=="object"&&self&&self.Object===Object&&self,mr=pn||sr||Function("return this")(),ie=e&&!e.nodeType&&e,C=ie&&!0&&t&&!t.nodeType&&t,ae=C&&C.exports===ie,we=ae&&pn.process,oe=function(){try{var Ue=C&&C.require&&C.require("util").types;return Ue||we&&we.binding&&we.binding("util")}catch{}}(),Ae=oe&&oe.isArrayBuffer,Ie=oe&&oe.isDate,Pe=oe&&oe.isMap,je=oe&&oe.isRegExp,Ye=oe&&oe.isSet,qe=oe&&oe.isTypedArray;function pt(Ue,nt,et){switch(et.length){case 0:return Ue.call(nt);case 1:return Ue.call(nt,et[0]);case 2:return Ue.call(nt,et[0],et[1]);case 3:return Ue.call(nt,et[0],et[1],et[2])}return Ue.apply(nt,et)}function tr(Ue,nt,et,kt){for(var Rr=-1,vn=Ue==null?0:Ue.length;++Rr<vn;){var ki=Ue[Rr];nt(kt,ki,et(ki),Ue)}return kt}function Gt(Ue,nt){for(var et=-1,kt=Ue==null?0:Ue.length;++et<kt&&nt(Ue[et],et,Ue)!==!1;);return Ue}function Yr(Ue,nt){for(var et=Ue==null?0:Ue.length;et--&&nt(Ue[et],et,Ue)!==!1;);return Ue}function Sn(Ue,nt){for(var et=-1,kt=Ue==null?0:Ue.length;++et<kt;)if(!nt(Ue[et],et,Ue))return!1;return!0}function ln(Ue,nt){for(var et=-1,kt=Ue==null?0:Ue.length,Rr=0,vn=[];++et<kt;){var ki=Ue[et];nt(ki,et,Ue)&&(vn[Rr++]=ki)}return vn}function Mr(Ue,nt){var et=Ue==null?0:Ue.length;return!!et&&qo(Ue,nt,0)>-1}function Qr(Ue,nt,et){for(var kt=-1,Rr=Ue==null?0:Ue.length;++kt<Rr;)if(et(nt,Ue[kt]))return!0;return!1}function Er(Ue,nt){for(var et=-1,kt=Ue==null?0:Ue.length,Rr=Array(kt);++et<kt;)Rr[et]=nt(Ue[et],et,Ue);return Rr}function Fi(Ue,nt){for(var et=-1,kt=nt.length,Rr=Ue.length;++et<kt;)Ue[Rr+et]=nt[et];return Ue}function Qa(Ue,nt,et,kt){var Rr=-1,vn=Ue==null?0:Ue.length;for(kt&&vn&&(et=Ue[++Rr]);++Rr<vn;)et=nt(et,Ue[Rr],Rr,Ue);return et}function Oc(Ue,nt,et,kt){var Rr=Ue==null?0:Ue.length;for(kt&&Rr&&(et=Ue[--Rr]);Rr--;)et=nt(et,Ue[Rr],Rr,Ue);return et}function Di(Ue,nt){for(var et=-1,kt=Ue==null?0:Ue.length;++et<kt;)if(nt(Ue[et],et,Ue))return!0;return!1}var Ja=Il("length");function Mi(Ue){return Ue.split("")}function ui(Ue){return Ue.match(Le)||[]}function _n(Ue,nt,et){var kt;return et(Ue,function(Rr,vn,ki){if(nt(Rr,vn,ki))return kt=vn,!1}),kt}function fu(Ue,nt,et,kt){for(var Rr=Ue.length,vn=et+(kt?1:-1);kt?vn--:++vn<Rr;)if(nt(Ue[vn],vn,Ue))return vn;return-1}function qo(Ue,nt,et){return nt===nt?fp(Ue,nt,et):fu(Ue,ad,et)}function ep(Ue,nt,et,kt){for(var Rr=et-1,vn=Ue.length;++Rr<vn;)if(kt(Ue[Rr],nt))return Rr;return-1}function ad(Ue){return Ue!==Ue}function od(Ue,nt){var et=Ue==null?0:Ue.length;return et?Tl(Ue,nt)/et:H}function Il(Ue){return function(nt){return nt==null?r:nt[Ue]}}function Pl(Ue){return function(nt){return Ue==null?r:Ue[nt]}}function cd(Ue,nt,et,kt,Rr){return Rr(Ue,function(vn,ki,Mn){et=kt?(kt=!1,vn):nt(et,vn,ki,Mn)}),et}function tp(Ue,nt){var et=Ue.length;for(Ue.sort(nt);et--;)Ue[et]=Ue[et].value;return Ue}function Tl(Ue,nt){for(var et,kt=-1,Rr=Ue.length;++kt<Rr;){var vn=nt(Ue[kt]);vn!==r&&(et=et===r?vn:et+vn)}return et}function Cl(Ue,nt){for(var et=-1,kt=Array(Ue);++et<Ue;)kt[et]=nt(et);return kt}function rp(Ue,nt){return Er(nt,function(et){return[et,Ue[et]]})}function ud(Ue){return Ue&&Ue.slice(0,hd(Ue)+1).replace(Et,"")}function qi(Ue){return function(nt){return Ue(nt)}}function Rl(Ue,nt){return Er(nt,function(et){return Ue[et]})}function Ic(Ue,nt){return Ue.has(nt)}function ld(Ue,nt){for(var et=-1,kt=Ue.length;++et<kt&&qo(nt,Ue[et],0)>-1;);return et}function fd(Ue,nt){for(var et=Ue.length;et--&&qo(nt,Ue[et],0)>-1;);return et}function np(Ue,nt){for(var et=Ue.length,kt=0;et--;)Ue[et]===nt&&++kt;return kt}var ip=Pl(fe),sp=Pl(ke);function ap(Ue){return"\\"+We[Ue]}function op(Ue,nt){return Ue==null?r:Ue[nt]}function Ho(Ue){return ra.test(Ue)}function cp(Ue){return Bi.test(Ue)}function up(Ue){for(var nt,et=[];!(nt=Ue.next()).done;)et.push(nt.value);return et}function Nl(Ue){var nt=-1,et=Array(Ue.size);return Ue.forEach(function(kt,Rr){et[++nt]=[Rr,kt]}),et}function dd(Ue,nt){return function(et){return Ue(nt(et))}}function Ta(Ue,nt){for(var et=-1,kt=Ue.length,Rr=0,vn=[];++et<kt;){var ki=Ue[et];(ki===nt||ki===f)&&(Ue[et]=f,vn[Rr++]=et)}return vn}function du(Ue){var nt=-1,et=Array(Ue.size);return Ue.forEach(function(kt){et[++nt]=kt}),et}function lp(Ue){var nt=-1,et=Array(Ue.size);return Ue.forEach(function(kt){et[++nt]=[kt,kt]}),et}function fp(Ue,nt,et){for(var kt=et-1,Rr=Ue.length;++kt<Rr;)if(Ue[kt]===nt)return kt;return-1}function dp(Ue,nt,et){for(var kt=et+1;kt--;)if(Ue[kt]===nt)return kt;return kt}function zo(Ue){return Ho(Ue)?Lre(Ue):Ja(Ue)}function ys(Ue){return Ho(Ue)?Ure(Ue):Mi(Ue)}function hd(Ue){for(var nt=Ue.length;nt--&&ue.test(Ue.charAt(nt)););return nt}var hp=Pl(it);function Lre(Ue){for(var nt=un.lastIndex=0;un.test(Ue);)++nt;return nt}function Ure(Ue){return Ue.match(un)||[]}function jre(Ue){return Ue.match(pi)||[]}var Bre=function Ue(nt){nt=nt==null?mr:pp.defaults(mr.Object(),nt,pp.pick(mr,gi));var et=nt.Array,kt=nt.Date,Rr=nt.Error,vn=nt.Function,ki=nt.Math,Mn=nt.Object,HA=nt.RegExp,Fre=nt.String,Xa=nt.TypeError,G1=et.prototype,qre=vn.prototype,gp=Mn.prototype,K1=nt["__core-js_shared__"],W1=qre.toString,On=gp.hasOwnProperty,Hre=0,PM=function(){var l=/[^.]+$/.exec(K1&&K1.keys&&K1.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Y1=gp.toString,zre=W1.call(Mn),Vre=mr._,Gre=HA("^"+W1.call(On).replace(ct,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Q1=ae?nt.Buffer:r,Dl=nt.Symbol,J1=nt.Uint8Array,TM=Q1?Q1.allocUnsafe:r,X1=dd(Mn.getPrototypeOf,Mn),CM=Mn.create,RM=gp.propertyIsEnumerable,Z1=G1.splice,NM=Dl?Dl.isConcatSpreadable:r,wm=Dl?Dl.iterator:r,pd=Dl?Dl.toStringTag:r,ew=function(){try{var l=bd(Mn,"defineProperty");return l({},"",{}),l}catch{}}(),Kre=nt.clearTimeout!==mr.clearTimeout&&nt.clearTimeout,Wre=kt&&kt.now!==mr.Date.now&&kt.now,Yre=nt.setTimeout!==mr.setTimeout&&nt.setTimeout,tw=ki.ceil,rw=ki.floor,zA=Mn.getOwnPropertySymbols,Qre=Q1?Q1.isBuffer:r,DM=nt.isFinite,Jre=G1.join,Xre=dd(Mn.keys,Mn),$i=ki.max,vs=ki.min,Zre=kt.now,ene=nt.parseInt,MM=ki.random,tne=G1.reverse,VA=bd(nt,"DataView"),_m=bd(nt,"Map"),GA=bd(nt,"Promise"),mp=bd(nt,"Set"),Em=bd(nt,"WeakMap"),xm=bd(Mn,"create"),nw=Em&&new Em,yp={},rne=wd(VA),nne=wd(_m),ine=wd(GA),sne=wd(mp),ane=wd(Em),iw=Dl?Dl.prototype:r,Am=iw?iw.valueOf:r,kM=iw?iw.toString:r;function J(l){if(li(l)&&!Dr(l)&&!(l instanceof en)){if(l instanceof Za)return l;if(On.call(l,"__wrapped__"))return $k(l)}return new Za(l)}var vp=function(){function l(){}return function(d){if(!si(d))return{};if(CM)return CM(d);l.prototype=d;var x=new l;return l.prototype=r,x}}();function sw(){}function Za(l,d){this.__wrapped__=l,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=r}J.templateSettings={escape:_e,evaluate:ee,interpolate:ye,variable:"",imports:{_:J}},J.prototype=sw.prototype,J.prototype.constructor=J,Za.prototype=vp(sw.prototype),Za.prototype.constructor=Za;function en(l){this.__wrapped__=l,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=M,this.__views__=[]}function one(){var l=new en(this.__wrapped__);return l.__actions__=ia(this.__actions__),l.__dir__=this.__dir__,l.__filtered__=this.__filtered__,l.__iteratees__=ia(this.__iteratees__),l.__takeCount__=this.__takeCount__,l.__views__=ia(this.__views__),l}function cne(){if(this.__filtered__){var l=new en(this);l.__dir__=-1,l.__filtered__=!0}else l=this.clone(),l.__dir__*=-1;return l}function une(){var l=this.__wrapped__.value(),d=this.__dir__,x=Dr(l),R=d<0,z=x?l.length:0,se=_ie(0,z,this.__views__),xe=se.start,De=se.end,Be=De-xe,at=R?De:xe-1,ot=this.__iteratees__,ft=ot.length,Ot=0,Yt=vs(Be,this.__takeCount__);if(!x||!R&&z==Be&&Yt==Be)return sk(l,this.__actions__);var dr=[];e:for(;Be--&&Ot<Yt;){at+=d;for(var Hr=-1,hr=l[at];++Hr<ft;){var Jr=ot[Hr],sn=Jr.iteratee,Na=Jr.type,js=sn(hr);if(Na==L)hr=js;else if(!js){if(Na==j)continue e;break e}}dr[Ot++]=hr}return dr}en.prototype=vp(sw.prototype),en.prototype.constructor=en;function gd(l){var d=-1,x=l==null?0:l.length;for(this.clear();++d<x;){var R=l[d];this.set(R[0],R[1])}}function lne(){this.__data__=xm?xm(null):{},this.size=0}function fne(l){var d=this.has(l)&&delete this.__data__[l];return this.size-=d?1:0,d}function dne(l){var d=this.__data__;if(xm){var x=d[l];return x===c?r:x}return On.call(d,l)?d[l]:r}function hne(l){var d=this.__data__;return xm?d[l]!==r:On.call(d,l)}function pne(l,d){var x=this.__data__;return this.size+=this.has(l)?0:1,x[l]=xm&&d===r?c:d,this}gd.prototype.clear=lne,gd.prototype.delete=fne,gd.prototype.get=dne,gd.prototype.has=hne,gd.prototype.set=pne;function hu(l){var d=-1,x=l==null?0:l.length;for(this.clear();++d<x;){var R=l[d];this.set(R[0],R[1])}}function gne(){this.__data__=[],this.size=0}function mne(l){var d=this.__data__,x=aw(d,l);if(x<0)return!1;var R=d.length-1;return x==R?d.pop():Z1.call(d,x,1),--this.size,!0}function yne(l){var d=this.__data__,x=aw(d,l);return x<0?r:d[x][1]}function vne(l){return aw(this.__data__,l)>-1}function bne(l,d){var x=this.__data__,R=aw(x,l);return R<0?(++this.size,x.push([l,d])):x[R][1]=d,this}hu.prototype.clear=gne,hu.prototype.delete=mne,hu.prototype.get=yne,hu.prototype.has=vne,hu.prototype.set=bne;function pu(l){var d=-1,x=l==null?0:l.length;for(this.clear();++d<x;){var R=l[d];this.set(R[0],R[1])}}function wne(){this.size=0,this.__data__={hash:new gd,map:new(_m||hu),string:new gd}}function _ne(l){var d=vw(this,l).delete(l);return this.size-=d?1:0,d}function Ene(l){return vw(this,l).get(l)}function xne(l){return vw(this,l).has(l)}function Ane(l,d){var x=vw(this,l),R=x.size;return x.set(l,d),this.size+=x.size==R?0:1,this}pu.prototype.clear=wne,pu.prototype.delete=_ne,pu.prototype.get=Ene,pu.prototype.has=xne,pu.prototype.set=Ane;function md(l){var d=-1,x=l==null?0:l.length;for(this.__data__=new pu;++d<x;)this.add(l[d])}function Sne(l){return this.__data__.set(l,c),this}function One(l){return this.__data__.has(l)}md.prototype.add=md.prototype.push=Sne,md.prototype.has=One;function Vo(l){var d=this.__data__=new hu(l);this.size=d.size}function Ine(){this.__data__=new hu,this.size=0}function Pne(l){var d=this.__data__,x=d.delete(l);return this.size=d.size,x}function Tne(l){return this.__data__.get(l)}function Cne(l){return this.__data__.has(l)}function Rne(l,d){var x=this.__data__;if(x instanceof hu){var R=x.__data__;if(!_m||R.length<i-1)return R.push([l,d]),this.size=++x.size,this;x=this.__data__=new pu(R)}return x.set(l,d),this.size=x.size,this}Vo.prototype.clear=Ine,Vo.prototype.delete=Pne,Vo.prototype.get=Tne,Vo.prototype.has=Cne,Vo.prototype.set=Rne;function $M(l,d){var x=Dr(l),R=!x&&_d(l),z=!x&&!R&&Ul(l),se=!x&&!R&&!z&&Ep(l),xe=x||R||z||se,De=xe?Cl(l.length,Fre):[],Be=De.length;for(var at in l)(d||On.call(l,at))&&!(xe&&(at=="length"||z&&(at=="offset"||at=="parent")||se&&(at=="buffer"||at=="byteLength"||at=="byteOffset")||vu(at,Be)))&&De.push(at);return De}function LM(l){var d=l.length;return d?l[nS(0,d-1)]:r}function Nne(l,d){return bw(ia(l),yd(d,0,l.length))}function Dne(l){return bw(ia(l))}function KA(l,d,x){(x!==r&&!Go(l[d],x)||x===r&&!(d in l))&&gu(l,d,x)}function Sm(l,d,x){var R=l[d];(!(On.call(l,d)&&Go(R,x))||x===r&&!(d in l))&&gu(l,d,x)}function aw(l,d){for(var x=l.length;x--;)if(Go(l[x][0],d))return x;return-1}function Mne(l,d,x,R){return Ml(l,function(z,se,xe){d(R,z,x(z),xe)}),R}function UM(l,d){return l&&Tc(d,Hi(d),l)}function kne(l,d){return l&&Tc(d,aa(d),l)}function gu(l,d,x){d=="__proto__"&&ew?ew(l,d,{configurable:!0,enumerable:!0,value:x,writable:!0}):l[d]=x}function WA(l,d){for(var x=-1,R=d.length,z=et(R),se=l==null;++x<R;)z[x]=se?r:PS(l,d[x]);return z}function yd(l,d,x){return l===l&&(x!==r&&(l=l<=x?l:x),d!==r&&(l=l>=d?l:d)),l}function eo(l,d,x,R,z,se){var xe,De=d&h,Be=d&m,at=d&y;if(x&&(xe=z?x(l,R,z,se):x(l)),xe!==r)return xe;if(!si(l))return l;var ot=Dr(l);if(ot){if(xe=xie(l),!De)return ia(l,xe)}else{var ft=bs(l),Ot=ft==Ge||ft==tt;if(Ul(l))return ck(l,De);if(ft==Bt||ft==G||Ot&&!z){if(xe=Be||Ot?{}:Ik(l),!De)return Be?die(l,kne(xe,l)):fie(l,UM(xe,l))}else{if(!_r[ft])return z?l:{};xe=Aie(l,ft,De)}}se||(se=new Vo);var Yt=se.get(l);if(Yt)return Yt;se.set(l,xe),r$(l)?l.forEach(function(hr){xe.add(eo(hr,d,x,hr,l,se))}):e$(l)&&l.forEach(function(hr,Jr){xe.set(Jr,eo(hr,d,x,Jr,l,se))});var dr=at?Be?pS:hS:Be?aa:Hi,Hr=ot?r:dr(l);return Gt(Hr||l,function(hr,Jr){Hr&&(Jr=hr,hr=l[Jr]),Sm(xe,Jr,eo(hr,d,x,Jr,l,se))}),xe}function $ne(l){var d=Hi(l);return function(x){return jM(x,l,d)}}function jM(l,d,x){var R=x.length;if(l==null)return!R;for(l=Mn(l);R--;){var z=x[R],se=d[z],xe=l[z];if(xe===r&&!(z in l)||!se(xe))return!1}return!0}function BM(l,d,x){if(typeof l!="function")throw new Xa(a);return Nm(function(){l.apply(r,x)},d)}function Om(l,d,x,R){var z=-1,se=Mr,xe=!0,De=l.length,Be=[],at=d.length;if(!De)return Be;x&&(d=Er(d,qi(x))),R?(se=Qr,xe=!1):d.length>=i&&(se=Ic,xe=!1,d=new md(d));e:for(;++z<De;){var ot=l[z],ft=x==null?ot:x(ot);if(ot=R||ot!==0?ot:0,xe&&ft===ft){for(var Ot=at;Ot--;)if(d[Ot]===ft)continue e;Be.push(ot)}else se(d,ft,R)||Be.push(ot)}return Be}var Ml=hk(Pc),FM=hk(QA,!0);function Lne(l,d){var x=!0;return Ml(l,function(R,z,se){return x=!!d(R,z,se),x}),x}function ow(l,d,x){for(var R=-1,z=l.length;++R<z;){var se=l[R],xe=d(se);if(xe!=null&&(De===r?xe===xe&&!Ra(xe):x(xe,De)))var De=xe,Be=se}return Be}function Une(l,d,x,R){var z=l.length;for(x=Ur(x),x<0&&(x=-x>z?0:z+x),R=R===r||R>z?z:Ur(R),R<0&&(R+=z),R=x>R?0:i$(R);x<R;)l[x++]=d;return l}function qM(l,d){var x=[];return Ml(l,function(R,z,se){d(R,z,se)&&x.push(R)}),x}function Xi(l,d,x,R,z){var se=-1,xe=l.length;for(x||(x=Oie),z||(z=[]);++se<xe;){var De=l[se];d>0&&x(De)?d>1?Xi(De,d-1,x,R,z):Fi(z,De):R||(z[z.length]=De)}return z}var YA=pk(),HM=pk(!0);function Pc(l,d){return l&&YA(l,d,Hi)}function QA(l,d){return l&&HM(l,d,Hi)}function cw(l,d){return ln(d,function(x){return bu(l[x])})}function vd(l,d){d=$l(d,l);for(var x=0,R=d.length;l!=null&&x<R;)l=l[Cc(d[x++])];return x&&x==R?l:r}function zM(l,d,x){var R=d(l);return Dr(l)?R:Fi(R,x(l))}function Ls(l){return l==null?l===r?Wt:gt:pd&&pd in Mn(l)?wie(l):Die(l)}function JA(l,d){return l>d}function jne(l,d){return l!=null&&On.call(l,d)}function Bne(l,d){return l!=null&&d in Mn(l)}function Fne(l,d,x){return l>=vs(d,x)&&l<$i(d,x)}function XA(l,d,x){for(var R=x?Qr:Mr,z=l[0].length,se=l.length,xe=se,De=et(se),Be=1/0,at=[];xe--;){var ot=l[xe];xe&&d&&(ot=Er(ot,qi(d))),Be=vs(ot.length,Be),De[xe]=!x&&(d||z>=120&&ot.length>=120)?new md(xe&&ot):r}ot=l[0];var ft=-1,Ot=De[0];e:for(;++ft<z&&at.length<Be;){var Yt=ot[ft],dr=d?d(Yt):Yt;if(Yt=x||Yt!==0?Yt:0,!(Ot?Ic(Ot,dr):R(at,dr,x))){for(xe=se;--xe;){var Hr=De[xe];if(!(Hr?Ic(Hr,dr):R(l[xe],dr,x)))continue e}Ot&&Ot.push(dr),at.push(Yt)}}return at}function qne(l,d,x,R){return Pc(l,function(z,se,xe){d(R,x(z),se,xe)}),R}function Im(l,d,x){d=$l(d,l),l=Rk(l,d);var R=l==null?l:l[Cc(ro(d))];return R==null?r:pt(R,l,x)}function VM(l){return li(l)&&Ls(l)==G}function Hne(l){return li(l)&&Ls(l)==Dt}function zne(l){return li(l)&&Ls(l)==ce}function Pm(l,d,x,R,z){return l===d?!0:l==null||d==null||!li(l)&&!li(d)?l!==l&&d!==d:Vne(l,d,x,R,Pm,z)}function Vne(l,d,x,R,z,se){var xe=Dr(l),De=Dr(d),Be=xe?pe:bs(l),at=De?pe:bs(d);Be=Be==G?Bt:Be,at=at==G?Bt:at;var ot=Be==Bt,ft=at==Bt,Ot=Be==at;if(Ot&&Ul(l)){if(!Ul(d))return!1;xe=!0,ot=!1}if(Ot&&!ot)return se||(se=new Vo),xe||Ep(l)?Ak(l,d,x,R,z,se):vie(l,d,Be,x,R,z,se);if(!(x&w)){var Yt=ot&&On.call(l,"__wrapped__"),dr=ft&&On.call(d,"__wrapped__");if(Yt||dr){var Hr=Yt?l.value():l,hr=dr?d.value():d;return se||(se=new Vo),z(Hr,hr,x,R,se)}}return Ot?(se||(se=new Vo),bie(l,d,x,R,z,se)):!1}function Gne(l){return li(l)&&bs(l)==yt}function ZA(l,d,x,R){var z=x.length,se=z,xe=!R;if(l==null)return!se;for(l=Mn(l);z--;){var De=x[z];if(xe&&De[2]?De[1]!==l[De[0]]:!(De[0]in l))return!1}for(;++z<se;){De=x[z];var Be=De[0],at=l[Be],ot=De[1];if(xe&&De[2]){if(at===r&&!(Be in l))return!1}else{var ft=new Vo;if(R)var Ot=R(at,ot,Be,l,d,ft);if(!(Ot===r?Pm(ot,at,w|v,R,ft):Ot))return!1}}return!0}function GM(l){if(!si(l)||Pie(l))return!1;var d=bu(l)?Gre:br;return d.test(wd(l))}function Kne(l){return li(l)&&Ls(l)==Ct}function Wne(l){return li(l)&&bs(l)==Pt}function Yne(l){return li(l)&&Sw(l.length)&&!!Zr[Ls(l)]}function KM(l){return typeof l=="function"?l:l==null?oa:typeof l=="object"?Dr(l)?QM(l[0],l[1]):YM(l):g$(l)}function eS(l){if(!Rm(l))return Xre(l);var d=[];for(var x in Mn(l))On.call(l,x)&&x!="constructor"&&d.push(x);return d}function Qne(l){if(!si(l))return Nie(l);var d=Rm(l),x=[];for(var R in l)R=="constructor"&&(d||!On.call(l,R))||x.push(R);return x}function tS(l,d){return l<d}function WM(l,d){var x=-1,R=sa(l)?et(l.length):[];return Ml(l,function(z,se,xe){R[++x]=d(z,se,xe)}),R}function YM(l){var d=mS(l);return d.length==1&&d[0][2]?Tk(d[0][0],d[0][1]):function(x){return x===l||ZA(x,l,d)}}function QM(l,d){return vS(l)&&Pk(d)?Tk(Cc(l),d):function(x){var R=PS(x,l);return R===r&&R===d?TS(x,l):Pm(d,R,w|v)}}function uw(l,d,x,R,z){l!==d&&YA(d,function(se,xe){if(z||(z=new Vo),si(se))Jne(l,d,xe,x,uw,R,z);else{var De=R?R(wS(l,xe),se,xe+"",l,d,z):r;De===r&&(De=se),KA(l,xe,De)}},aa)}function Jne(l,d,x,R,z,se,xe){var De=wS(l,x),Be=wS(d,x),at=xe.get(Be);if(at){KA(l,x,at);return}var ot=se?se(De,Be,x+"",l,d,xe):r,ft=ot===r;if(ft){var Ot=Dr(Be),Yt=!Ot&&Ul(Be),dr=!Ot&&!Yt&&Ep(Be);ot=Be,Ot||Yt||dr?Dr(De)?ot=De:mi(De)?ot=ia(De):Yt?(ft=!1,ot=ck(Be,!0)):dr?(ft=!1,ot=uk(Be,!0)):ot=[]:Dm(Be)||_d(Be)?(ot=De,_d(De)?ot=s$(De):(!si(De)||bu(De))&&(ot=Ik(Be))):ft=!1}ft&&(xe.set(Be,ot),z(ot,Be,R,se,xe),xe.delete(Be)),KA(l,x,ot)}function JM(l,d){var x=l.length;if(x)return d+=d<0?x:0,vu(d,x)?l[d]:r}function XM(l,d,x){d.length?d=Er(d,function(se){return Dr(se)?function(xe){return vd(xe,se.length===1?se[0]:se)}:se}):d=[oa];var R=-1;d=Er(d,qi(cr()));var z=WM(l,function(se,xe,De){var Be=Er(d,function(at){return at(se)});return{criteria:Be,index:++R,value:se}});return tp(z,function(se,xe){return lie(se,xe,x)})}function Xne(l,d){return ZM(l,d,function(x,R){return TS(l,R)})}function ZM(l,d,x){for(var R=-1,z=d.length,se={};++R<z;){var xe=d[R],De=vd(l,xe);x(De,xe)&&Tm(se,$l(xe,l),De)}return se}function Zne(l){return function(d){return vd(d,l)}}function rS(l,d,x,R){var z=R?ep:qo,se=-1,xe=d.length,De=l;for(l===d&&(d=ia(d)),x&&(De=Er(l,qi(x)));++se<xe;)for(var Be=0,at=d[se],ot=x?x(at):at;(Be=z(De,ot,Be,R))>-1;)De!==l&&Z1.call(De,Be,1),Z1.call(l,Be,1);return l}function ek(l,d){for(var x=l?d.length:0,R=x-1;x--;){var z=d[x];if(x==R||z!==se){var se=z;vu(z)?Z1.call(l,z,1):aS(l,z)}}return l}function nS(l,d){return l+rw(MM()*(d-l+1))}function eie(l,d,x,R){for(var z=-1,se=$i(tw((d-l)/(x||1)),0),xe=et(se);se--;)xe[R?se:++z]=l,l+=x;return xe}function iS(l,d){var x="";if(!l||d<1||d>U)return x;do d%2&&(x+=l),d=rw(d/2),d&&(l+=l);while(d);return x}function Vr(l,d){return _S(Ck(l,d,oa),l+"")}function tie(l){return LM(xp(l))}function rie(l,d){var x=xp(l);return bw(x,yd(d,0,x.length))}function Tm(l,d,x,R){if(!si(l))return l;d=$l(d,l);for(var z=-1,se=d.length,xe=se-1,De=l;De!=null&&++z<se;){var Be=Cc(d[z]),at=x;if(Be==="__proto__"||Be==="constructor"||Be==="prototype")return l;if(z!=xe){var ot=De[Be];at=R?R(ot,Be,De):r,at===r&&(at=si(ot)?ot:vu(d[z+1])?[]:{})}Sm(De,Be,at),De=De[Be]}return l}var tk=nw?function(l,d){return nw.set(l,d),l}:oa,nie=ew?function(l,d){return ew(l,"toString",{configurable:!0,enumerable:!1,value:RS(d),writable:!0})}:oa;function iie(l){return bw(xp(l))}function to(l,d,x){var R=-1,z=l.length;d<0&&(d=-d>z?0:z+d),x=x>z?z:x,x<0&&(x+=z),z=d>x?0:x-d>>>0,d>>>=0;for(var se=et(z);++R<z;)se[R]=l[R+d];return se}function sie(l,d){var x;return Ml(l,function(R,z,se){return x=d(R,z,se),!x}),!!x}function lw(l,d,x){var R=0,z=l==null?R:l.length;if(typeof d=="number"&&d===d&&z<=$){for(;R<z;){var se=R+z>>>1,xe=l[se];xe!==null&&!Ra(xe)&&(x?xe<=d:xe<d)?R=se+1:z=se}return z}return sS(l,d,oa,x)}function sS(l,d,x,R){var z=0,se=l==null?0:l.length;if(se===0)return 0;d=x(d);for(var xe=d!==d,De=d===null,Be=Ra(d),at=d===r;z<se;){var ot=rw((z+se)/2),ft=x(l[ot]),Ot=ft!==r,Yt=ft===null,dr=ft===ft,Hr=Ra(ft);if(xe)var hr=R||dr;else at?hr=dr&&(R||Ot):De?hr=dr&&Ot&&(R||!Yt):Be?hr=dr&&Ot&&!Yt&&(R||!Hr):Yt||Hr?hr=!1:hr=R?ft<=d:ft<d;hr?z=ot+1:se=ot}return vs(se,q)}function rk(l,d){for(var x=-1,R=l.length,z=0,se=[];++x<R;){var xe=l[x],De=d?d(xe):xe;if(!x||!Go(De,Be)){var Be=De;se[z++]=xe===0?0:xe}}return se}function nk(l){return typeof l=="number"?l:Ra(l)?H:+l}function Ca(l){if(typeof l=="string")return l;if(Dr(l))return Er(l,Ca)+"";if(Ra(l))return kM?kM.call(l):"";var d=l+"";return d=="0"&&1/l==-ne?"-0":d}function kl(l,d,x){var R=-1,z=Mr,se=l.length,xe=!0,De=[],Be=De;if(x)xe=!1,z=Qr;else if(se>=i){var at=d?null:mie(l);if(at)return du(at);xe=!1,z=Ic,Be=new md}else Be=d?[]:De;e:for(;++R<se;){var ot=l[R],ft=d?d(ot):ot;if(ot=x||ot!==0?ot:0,xe&&ft===ft){for(var Ot=Be.length;Ot--;)if(Be[Ot]===ft)continue e;d&&Be.push(ft),De.push(ot)}else z(Be,ft,x)||(Be!==De&&Be.push(ft),De.push(ot))}return De}function aS(l,d){return d=$l(d,l),l=Rk(l,d),l==null||delete l[Cc(ro(d))]}function ik(l,d,x,R){return Tm(l,d,x(vd(l,d)),R)}function fw(l,d,x,R){for(var z=l.length,se=R?z:-1;(R?se--:++se<z)&&d(l[se],se,l););return x?to(l,R?0:se,R?se+1:z):to(l,R?se+1:0,R?z:se)}function sk(l,d){var x=l;return x instanceof en&&(x=x.value()),Qa(d,function(R,z){return z.func.apply(z.thisArg,Fi([R],z.args))},x)}function oS(l,d,x){var R=l.length;if(R<2)return R?kl(l[0]):[];for(var z=-1,se=et(R);++z<R;)for(var xe=l[z],De=-1;++De<R;)De!=z&&(se[z]=Om(se[z]||xe,l[De],d,x));return kl(Xi(se,1),d,x)}function ak(l,d,x){for(var R=-1,z=l.length,se=d.length,xe={};++R<z;){var De=R<se?d[R]:r;x(xe,l[R],De)}return xe}function cS(l){return mi(l)?l:[]}function uS(l){return typeof l=="function"?l:oa}function $l(l,d){return Dr(l)?l:vS(l,d)?[l]:kk(En(l))}var aie=Vr;function Ll(l,d,x){var R=l.length;return x=x===r?R:x,!d&&x>=R?l:to(l,d,x)}var ok=Kre||function(l){return mr.clearTimeout(l)};function ck(l,d){if(d)return l.slice();var x=l.length,R=TM?TM(x):new l.constructor(x);return l.copy(R),R}function lS(l){var d=new l.constructor(l.byteLength);return new J1(d).set(new J1(l)),d}function oie(l,d){var x=d?lS(l.buffer):l.buffer;return new l.constructor(x,l.byteOffset,l.byteLength)}function cie(l){var d=new l.constructor(l.source,lr.exec(l));return d.lastIndex=l.lastIndex,d}function uie(l){return Am?Mn(Am.call(l)):{}}function uk(l,d){var x=d?lS(l.buffer):l.buffer;return new l.constructor(x,l.byteOffset,l.length)}function lk(l,d){if(l!==d){var x=l!==r,R=l===null,z=l===l,se=Ra(l),xe=d!==r,De=d===null,Be=d===d,at=Ra(d);if(!De&&!at&&!se&&l>d||se&&xe&&Be&&!De&&!at||R&&xe&&Be||!x&&Be||!z)return 1;if(!R&&!se&&!at&&l<d||at&&x&&z&&!R&&!se||De&&x&&z||!xe&&z||!Be)return-1}return 0}function lie(l,d,x){for(var R=-1,z=l.criteria,se=d.criteria,xe=z.length,De=x.length;++R<xe;){var Be=lk(z[R],se[R]);if(Be){if(R>=De)return Be;var at=x[R];return Be*(at=="desc"?-1:1)}}return l.index-d.index}function fk(l,d,x,R){for(var z=-1,se=l.length,xe=x.length,De=-1,Be=d.length,at=$i(se-xe,0),ot=et(Be+at),ft=!R;++De<Be;)ot[De]=d[De];for(;++z<xe;)(ft||z<se)&&(ot[x[z]]=l[z]);for(;at--;)ot[De++]=l[z++];return ot}function dk(l,d,x,R){for(var z=-1,se=l.length,xe=-1,De=x.length,Be=-1,at=d.length,ot=$i(se-De,0),ft=et(ot+at),Ot=!R;++z<ot;)ft[z]=l[z];for(var Yt=z;++Be<at;)ft[Yt+Be]=d[Be];for(;++xe<De;)(Ot||z<se)&&(ft[Yt+x[xe]]=l[z++]);return ft}function ia(l,d){var x=-1,R=l.length;for(d||(d=et(R));++x<R;)d[x]=l[x];return d}function Tc(l,d,x,R){var z=!x;x||(x={});for(var se=-1,xe=d.length;++se<xe;){var De=d[se],Be=R?R(x[De],l[De],De,x,l):r;Be===r&&(Be=l[De]),z?gu(x,De,Be):Sm(x,De,Be)}return x}function fie(l,d){return Tc(l,yS(l),d)}function die(l,d){return Tc(l,Sk(l),d)}function dw(l,d){return function(x,R){var z=Dr(x)?tr:Mne,se=d?d():{};return z(x,l,cr(R,2),se)}}function bp(l){return Vr(function(d,x){var R=-1,z=x.length,se=z>1?x[z-1]:r,xe=z>2?x[2]:r;for(se=l.length>3&&typeof se=="function"?(z--,se):r,xe&&Us(x[0],x[1],xe)&&(se=z<3?r:se,z=1),d=Mn(d);++R<z;){var De=x[R];De&&l(d,De,R,se)}return d})}function hk(l,d){return function(x,R){if(x==null)return x;if(!sa(x))return l(x,R);for(var z=x.length,se=d?z:-1,xe=Mn(x);(d?se--:++se<z)&&R(xe[se],se,xe)!==!1;);return x}}function pk(l){return function(d,x,R){for(var z=-1,se=Mn(d),xe=R(d),De=xe.length;De--;){var Be=xe[l?De:++z];if(x(se[Be],Be,se)===!1)break}return d}}function hie(l,d,x){var R=d&g,z=Cm(l);function se(){var xe=this&&this!==mr&&this instanceof se?z:l;return xe.apply(R?x:this,arguments)}return se}function gk(l){return function(d){d=En(d);var x=Ho(d)?ys(d):r,R=x?x[0]:d.charAt(0),z=x?Ll(x,1).join(""):d.slice(1);return R[l]()+z}}function wp(l){return function(d){return Qa(h$(d$(d).replace(ii,"")),l,"")}}function Cm(l){return function(){var d=arguments;switch(d.length){case 0:return new l;case 1:return new l(d[0]);case 2:return new l(d[0],d[1]);case 3:return new l(d[0],d[1],d[2]);case 4:return new l(d[0],d[1],d[2],d[3]);case 5:return new l(d[0],d[1],d[2],d[3],d[4]);case 6:return new l(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new l(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var x=vp(l.prototype),R=l.apply(x,d);return si(R)?R:x}}function pie(l,d,x){var R=Cm(l);function z(){for(var se=arguments.length,xe=et(se),De=se,Be=_p(z);De--;)xe[De]=arguments[De];var at=se<3&&xe[0]!==Be&&xe[se-1]!==Be?[]:Ta(xe,Be);if(se-=at.length,se<x)return wk(l,d,hw,z.placeholder,r,xe,at,r,r,x-se);var ot=this&&this!==mr&&this instanceof z?R:l;return pt(ot,this,xe)}return z}function mk(l){return function(d,x,R){var z=Mn(d);if(!sa(d)){var se=cr(x,3);d=Hi(d),x=function(De){return se(z[De],De,z)}}var xe=l(d,x,R);return xe>-1?z[se?d[xe]:xe]:r}}function yk(l){return yu(function(d){var x=d.length,R=x,z=Za.prototype.thru;for(l&&d.reverse();R--;){var se=d[R];if(typeof se!="function")throw new Xa(a);if(z&&!xe&&yw(se)=="wrapper")var xe=new Za([],!0)}for(R=xe?R:x;++R<x;){se=d[R];var De=yw(se),Be=De=="wrapper"?gS(se):r;Be&&bS(Be[0])&&Be[1]==(p|S|O|I)&&!Be[4].length&&Be[9]==1?xe=xe[yw(Be[0])].apply(xe,Be[3]):xe=se.length==1&&bS(se)?xe[De]():xe.thru(se)}return function(){var at=arguments,ot=at[0];if(xe&&at.length==1&&Dr(ot))return xe.plant(ot).value();for(var ft=0,Ot=x?d[ft].apply(this,at):ot;++ft<x;)Ot=d[ft].call(this,Ot);return Ot}})}function hw(l,d,x,R,z,se,xe,De,Be,at){var ot=d&p,ft=d&g,Ot=d&_,Yt=d&(S|A),dr=d&N,Hr=Ot?r:Cm(l);function hr(){for(var Jr=arguments.length,sn=et(Jr),Na=Jr;Na--;)sn[Na]=arguments[Na];if(Yt)var js=_p(hr),Da=np(sn,js);if(R&&(sn=fk(sn,R,z,Yt)),se&&(sn=dk(sn,se,xe,Yt)),Jr-=Da,Yt&&Jr<at){var yi=Ta(sn,js);return wk(l,d,hw,hr.placeholder,x,sn,yi,De,Be,at-Jr)}var Ko=ft?x:this,_u=Ot?Ko[l]:l;return Jr=sn.length,De?sn=Mie(sn,De):dr&&Jr>1&&sn.reverse(),ot&&Be<Jr&&(sn.length=Be),this&&this!==mr&&this instanceof hr&&(_u=Hr||Cm(_u)),_u.apply(Ko,sn)}return hr}function vk(l,d){return function(x,R){return qne(x,l,d(R),{})}}function pw(l,d){return function(x,R){var z;if(x===r&&R===r)return d;if(x!==r&&(z=x),R!==r){if(z===r)return R;typeof x=="string"||typeof R=="string"?(x=Ca(x),R=Ca(R)):(x=nk(x),R=nk(R)),z=l(x,R)}return z}}function fS(l){return yu(function(d){return d=Er(d,qi(cr())),Vr(function(x){var R=this;return l(d,function(z){return pt(z,R,x)})})})}function gw(l,d){d=d===r?" ":Ca(d);var x=d.length;if(x<2)return x?iS(d,l):d;var R=iS(d,tw(l/zo(d)));return Ho(d)?Ll(ys(R),0,l).join(""):R.slice(0,l)}function gie(l,d,x,R){var z=d&g,se=Cm(l);function xe(){for(var De=-1,Be=arguments.length,at=-1,ot=R.length,ft=et(ot+Be),Ot=this&&this!==mr&&this instanceof xe?se:l;++at<ot;)ft[at]=R[at];for(;Be--;)ft[at++]=arguments[++De];return pt(Ot,z?x:this,ft)}return xe}function bk(l){return function(d,x,R){return R&&typeof R!="number"&&Us(d,x,R)&&(x=R=r),d=wu(d),x===r?(x=d,d=0):x=wu(x),R=R===r?d<x?1:-1:wu(R),eie(d,x,R,l)}}function mw(l){return function(d,x){return typeof d=="string"&&typeof x=="string"||(d=no(d),x=no(x)),l(d,x)}}function wk(l,d,x,R,z,se,xe,De,Be,at){var ot=d&S,ft=ot?xe:r,Ot=ot?r:xe,Yt=ot?se:r,dr=ot?r:se;d|=ot?O:E,d&=~(ot?E:O),d&b||(d&=~(g|_));var Hr=[l,d,z,Yt,ft,dr,Ot,De,Be,at],hr=x.apply(r,Hr);return bS(l)&&Nk(hr,Hr),hr.placeholder=R,Dk(hr,l,d)}function dS(l){var d=ki[l];return function(x,R){if(x=no(x),R=R==null?0:vs(Ur(R),292),R&&DM(x)){var z=(En(x)+"e").split("e"),se=d(z[0]+"e"+(+z[1]+R));return z=(En(se)+"e").split("e"),+(z[0]+"e"+(+z[1]-R))}return d(x)}}var mie=mp&&1/du(new mp([,-0]))[1]==ne?function(l){return new mp(l)}:MS;function _k(l){return function(d){var x=bs(d);return x==yt?Nl(d):x==Pt?lp(d):rp(d,l(d))}}function mu(l,d,x,R,z,se,xe,De){var Be=d&_;if(!Be&&typeof l!="function")throw new Xa(a);var at=R?R.length:0;if(at||(d&=~(O|E),R=z=r),xe=xe===r?xe:$i(Ur(xe),0),De=De===r?De:Ur(De),at-=z?z.length:0,d&E){var ot=R,ft=z;R=z=r}var Ot=Be?r:gS(l),Yt=[l,d,x,R,z,ot,ft,se,xe,De];if(Ot&&Rie(Yt,Ot),l=Yt[0],d=Yt[1],x=Yt[2],R=Yt[3],z=Yt[4],De=Yt[9]=Yt[9]===r?Be?0:l.length:$i(Yt[9]-at,0),!De&&d&(S|A)&&(d&=~(S|A)),!d||d==g)var dr=hie(l,d,x);else d==S||d==A?dr=pie(l,d,De):(d==O||d==(g|O))&&!z.length?dr=gie(l,d,x,R):dr=hw.apply(r,Yt);var Hr=Ot?tk:Nk;return Dk(Hr(dr,Yt),l,d)}function Ek(l,d,x,R){return l===r||Go(l,gp[x])&&!On.call(R,x)?d:l}function xk(l,d,x,R,z,se){return si(l)&&si(d)&&(se.set(d,l),uw(l,d,r,xk,se),se.delete(d)),l}function yie(l){return Dm(l)?r:l}function Ak(l,d,x,R,z,se){var xe=x&w,De=l.length,Be=d.length;if(De!=Be&&!(xe&&Be>De))return!1;var at=se.get(l),ot=se.get(d);if(at&&ot)return at==d&&ot==l;var ft=-1,Ot=!0,Yt=x&v?new md:r;for(se.set(l,d),se.set(d,l);++ft<De;){var dr=l[ft],Hr=d[ft];if(R)var hr=xe?R(Hr,dr,ft,d,l,se):R(dr,Hr,ft,l,d,se);if(hr!==r){if(hr)continue;Ot=!1;break}if(Yt){if(!Di(d,function(Jr,sn){if(!Ic(Yt,sn)&&(dr===Jr||z(dr,Jr,x,R,se)))return Yt.push(sn)})){Ot=!1;break}}else if(!(dr===Hr||z(dr,Hr,x,R,se))){Ot=!1;break}}return se.delete(l),se.delete(d),Ot}function vie(l,d,x,R,z,se,xe){switch(x){case Nt:if(l.byteLength!=d.byteLength||l.byteOffset!=d.byteOffset)return!1;l=l.buffer,d=d.buffer;case Dt:return!(l.byteLength!=d.byteLength||!se(new J1(l),new J1(d)));case te:case ce:case vt:return Go(+l,+d);case le:return l.name==d.name&&l.message==d.message;case Ct:case $t:return l==d+"";case yt:var De=Nl;case Pt:var Be=R&w;if(De||(De=du),l.size!=d.size&&!Be)return!1;var at=xe.get(l);if(at)return at==d;R|=v,xe.set(l,d);var ot=Ak(De(l),De(d),R,z,se,xe);return xe.delete(l),ot;case Rt:if(Am)return Am.call(l)==Am.call(d)}return!1}function bie(l,d,x,R,z,se){var xe=x&w,De=hS(l),Be=De.length,at=hS(d),ot=at.length;if(Be!=ot&&!xe)return!1;for(var ft=Be;ft--;){var Ot=De[ft];if(!(xe?Ot in d:On.call(d,Ot)))return!1}var Yt=se.get(l),dr=se.get(d);if(Yt&&dr)return Yt==d&&dr==l;var Hr=!0;se.set(l,d),se.set(d,l);for(var hr=xe;++ft<Be;){Ot=De[ft];var Jr=l[Ot],sn=d[Ot];if(R)var Na=xe?R(sn,Jr,Ot,d,l,se):R(Jr,sn,Ot,l,d,se);if(!(Na===r?Jr===sn||z(Jr,sn,x,R,se):Na)){Hr=!1;break}hr||(hr=Ot=="constructor")}if(Hr&&!hr){var js=l.constructor,Da=d.constructor;js!=Da&&"constructor"in l&&"constructor"in d&&!(typeof js=="function"&&js instanceof js&&typeof Da=="function"&&Da instanceof Da)&&(Hr=!1)}return se.delete(l),se.delete(d),Hr}function yu(l){return _S(Ck(l,r,jk),l+"")}function hS(l){return zM(l,Hi,yS)}function pS(l){return zM(l,aa,Sk)}var gS=nw?function(l){return nw.get(l)}:MS;function yw(l){for(var d=l.name+"",x=yp[d],R=On.call(yp,d)?x.length:0;R--;){var z=x[R],se=z.func;if(se==null||se==l)return z.name}return d}function _p(l){var d=On.call(J,"placeholder")?J:l;return d.placeholder}function cr(){var l=J.iteratee||NS;return l=l===NS?KM:l,arguments.length?l(arguments[0],arguments[1]):l}function vw(l,d){var x=l.__data__;return Iie(d)?x[typeof d=="string"?"string":"hash"]:x.map}function mS(l){for(var d=Hi(l),x=d.length;x--;){var R=d[x],z=l[R];d[x]=[R,z,Pk(z)]}return d}function bd(l,d){var x=op(l,d);return GM(x)?x:r}function wie(l){var d=On.call(l,pd),x=l[pd];try{l[pd]=r;var R=!0}catch{}var z=Y1.call(l);return R&&(d?l[pd]=x:delete l[pd]),z}var yS=zA?function(l){return l==null?[]:(l=Mn(l),ln(zA(l),function(d){return RM.call(l,d)}))}:kS,Sk=zA?function(l){for(var d=[];l;)Fi(d,yS(l)),l=X1(l);return d}:kS,bs=Ls;(VA&&bs(new VA(new ArrayBuffer(1)))!=Nt||_m&&bs(new _m)!=yt||GA&&bs(GA.resolve())!=Zt||mp&&bs(new mp)!=Pt||Em&&bs(new Em)!=Ft)&&(bs=function(l){var d=Ls(l),x=d==Bt?l.constructor:r,R=x?wd(x):"";if(R)switch(R){case rne:return Nt;case nne:return yt;case ine:return Zt;case sne:return Pt;case ane:return Ft}return d});function _ie(l,d,x){for(var R=-1,z=x.length;++R<z;){var se=x[R],xe=se.size;switch(se.type){case"drop":l+=xe;break;case"dropRight":d-=xe;break;case"take":d=vs(d,l+xe);break;case"takeRight":l=$i(l,d-xe);break}}return{start:l,end:d}}function Eie(l){var d=l.match(ge);return d?d[1].split(Me):[]}function Ok(l,d,x){d=$l(d,l);for(var R=-1,z=d.length,se=!1;++R<z;){var xe=Cc(d[R]);if(!(se=l!=null&&x(l,xe)))break;l=l[xe]}return se||++R!=z?se:(z=l==null?0:l.length,!!z&&Sw(z)&&vu(xe,z)&&(Dr(l)||_d(l)))}function xie(l){var d=l.length,x=new l.constructor(d);return d&&typeof l[0]=="string"&&On.call(l,"index")&&(x.index=l.index,x.input=l.input),x}function Ik(l){return typeof l.constructor=="function"&&!Rm(l)?vp(X1(l)):{}}function Aie(l,d,x){var R=l.constructor;switch(d){case Dt:return lS(l);case te:case ce:return new R(+l);case Nt:return oie(l,x);case Vt:case Mt:case ur:case rr:case ar:case ir:case wr:case An:case rn:return uk(l,x);case yt:return new R;case vt:case $t:return new R(l);case Ct:return cie(l);case Pt:return new R;case Rt:return uie(l)}}function Sie(l,d){var x=d.length;if(!x)return l;var R=x-1;return d[R]=(x>1?"& ":"")+d[R],d=d.join(x>2?", ":" "),l.replace(Z,`{
140
- /* [wrapped with `+d+`] */
141
- `)}function Oie(l){return Dr(l)||_d(l)||!!(NM&&l&&l[NM])}function vu(l,d){var x=typeof l;return d=d??U,!!d&&(x=="number"||x!="symbol"&&or.test(l))&&l>-1&&l%1==0&&l<d}function Us(l,d,x){if(!si(x))return!1;var R=typeof d;return(R=="number"?sa(x)&&vu(d,x.length):R=="string"&&d in x)?Go(x[d],l):!1}function vS(l,d){if(Dr(l))return!1;var x=typeof l;return x=="number"||x=="symbol"||x=="boolean"||l==null||Ra(l)?!0:ze.test(l)||!Re.test(l)||d!=null&&l in Mn(d)}function Iie(l){var d=typeof l;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?l!=="__proto__":l===null}function bS(l){var d=yw(l),x=J[d];if(typeof x!="function"||!(d in en.prototype))return!1;if(l===x)return!0;var R=gS(x);return!!R&&l===R[0]}function Pie(l){return!!PM&&PM in l}var Tie=K1?bu:$S;function Rm(l){var d=l&&l.constructor,x=typeof d=="function"&&d.prototype||gp;return l===x}function Pk(l){return l===l&&!si(l)}function Tk(l,d){return function(x){return x==null?!1:x[l]===d&&(d!==r||l in Mn(x))}}function Cie(l){var d=xw(l,function(R){return x.size===u&&x.clear(),R}),x=d.cache;return d}function Rie(l,d){var x=l[1],R=d[1],z=x|R,se=z<(g|_|p),xe=R==p&&x==S||R==p&&x==I&&l[7].length<=d[8]||R==(p|I)&&d[7].length<=d[8]&&x==S;if(!(se||xe))return l;R&g&&(l[2]=d[2],z|=x&g?0:b);var De=d[3];if(De){var Be=l[3];l[3]=Be?fk(Be,De,d[4]):De,l[4]=Be?Ta(l[3],f):d[4]}return De=d[5],De&&(Be=l[5],l[5]=Be?dk(Be,De,d[6]):De,l[6]=Be?Ta(l[5],f):d[6]),De=d[7],De&&(l[7]=De),R&p&&(l[8]=l[8]==null?d[8]:vs(l[8],d[8])),l[9]==null&&(l[9]=d[9]),l[0]=d[0],l[1]=z,l}function Nie(l){var d=[];if(l!=null)for(var x in Mn(l))d.push(x);return d}function Die(l){return Y1.call(l)}function Ck(l,d,x){return d=$i(d===r?l.length-1:d,0),function(){for(var R=arguments,z=-1,se=$i(R.length-d,0),xe=et(se);++z<se;)xe[z]=R[d+z];z=-1;for(var De=et(d+1);++z<d;)De[z]=R[z];return De[d]=x(xe),pt(l,this,De)}}function Rk(l,d){return d.length<2?l:vd(l,to(d,0,-1))}function Mie(l,d){for(var x=l.length,R=vs(d.length,x),z=ia(l);R--;){var se=d[R];l[R]=vu(se,x)?z[se]:r}return l}function wS(l,d){if(!(d==="constructor"&&typeof l[d]=="function")&&d!="__proto__")return l[d]}var Nk=Mk(tk),Nm=Yre||function(l,d){return mr.setTimeout(l,d)},_S=Mk(nie);function Dk(l,d,x){var R=d+"";return _S(l,Sie(R,kie(Eie(R),x)))}function Mk(l){var d=0,x=0;return function(){var R=Zre(),z=ve-(R-x);if(x=R,z>0){if(++d>=de)return arguments[0]}else d=0;return l.apply(r,arguments)}}function bw(l,d){var x=-1,R=l.length,z=R-1;for(d=d===r?R:d;++x<d;){var se=nS(x,z),xe=l[se];l[se]=l[x],l[x]=xe}return l.length=d,l}var kk=Cie(function(l){var d=[];return l.charCodeAt(0)===46&&d.push(""),l.replace(Ze,function(x,R,z,se){d.push(z?se.replace(St,"$1"):R||x)}),d});function Cc(l){if(typeof l=="string"||Ra(l))return l;var d=l+"";return d=="0"&&1/l==-ne?"-0":d}function wd(l){if(l!=null){try{return W1.call(l)}catch{}try{return l+""}catch{}}return""}function kie(l,d){return Gt(k,function(x){var R="_."+x[0];d&x[1]&&!Mr(l,R)&&l.push(R)}),l.sort()}function $k(l){if(l instanceof en)return l.clone();var d=new Za(l.__wrapped__,l.__chain__);return d.__actions__=ia(l.__actions__),d.__index__=l.__index__,d.__values__=l.__values__,d}function $ie(l,d,x){(x?Us(l,d,x):d===r)?d=1:d=$i(Ur(d),0);var R=l==null?0:l.length;if(!R||d<1)return[];for(var z=0,se=0,xe=et(tw(R/d));z<R;)xe[se++]=to(l,z,z+=d);return xe}function Lie(l){for(var d=-1,x=l==null?0:l.length,R=0,z=[];++d<x;){var se=l[d];se&&(z[R++]=se)}return z}function Uie(){var l=arguments.length;if(!l)return[];for(var d=et(l-1),x=arguments[0],R=l;R--;)d[R-1]=arguments[R];return Fi(Dr(x)?ia(x):[x],Xi(d,1))}var jie=Vr(function(l,d){return mi(l)?Om(l,Xi(d,1,mi,!0)):[]}),Bie=Vr(function(l,d){var x=ro(d);return mi(x)&&(x=r),mi(l)?Om(l,Xi(d,1,mi,!0),cr(x,2)):[]}),Fie=Vr(function(l,d){var x=ro(d);return mi(x)&&(x=r),mi(l)?Om(l,Xi(d,1,mi,!0),r,x):[]});function qie(l,d,x){var R=l==null?0:l.length;return R?(d=x||d===r?1:Ur(d),to(l,d<0?0:d,R)):[]}function Hie(l,d,x){var R=l==null?0:l.length;return R?(d=x||d===r?1:Ur(d),d=R-d,to(l,0,d<0?0:d)):[]}function zie(l,d){return l&&l.length?fw(l,cr(d,3),!0,!0):[]}function Vie(l,d){return l&&l.length?fw(l,cr(d,3),!0):[]}function Gie(l,d,x,R){var z=l==null?0:l.length;return z?(x&&typeof x!="number"&&Us(l,d,x)&&(x=0,R=z),Une(l,d,x,R)):[]}function Lk(l,d,x){var R=l==null?0:l.length;if(!R)return-1;var z=x==null?0:Ur(x);return z<0&&(z=$i(R+z,0)),fu(l,cr(d,3),z)}function Uk(l,d,x){var R=l==null?0:l.length;if(!R)return-1;var z=R-1;return x!==r&&(z=Ur(x),z=x<0?$i(R+z,0):vs(z,R-1)),fu(l,cr(d,3),z,!0)}function jk(l){var d=l==null?0:l.length;return d?Xi(l,1):[]}function Kie(l){var d=l==null?0:l.length;return d?Xi(l,ne):[]}function Wie(l,d){var x=l==null?0:l.length;return x?(d=d===r?1:Ur(d),Xi(l,d)):[]}function Yie(l){for(var d=-1,x=l==null?0:l.length,R={};++d<x;){var z=l[d];R[z[0]]=z[1]}return R}function Bk(l){return l&&l.length?l[0]:r}function Qie(l,d,x){var R=l==null?0:l.length;if(!R)return-1;var z=x==null?0:Ur(x);return z<0&&(z=$i(R+z,0)),qo(l,d,z)}function Jie(l){var d=l==null?0:l.length;return d?to(l,0,-1):[]}var Xie=Vr(function(l){var d=Er(l,cS);return d.length&&d[0]===l[0]?XA(d):[]}),Zie=Vr(function(l){var d=ro(l),x=Er(l,cS);return d===ro(x)?d=r:x.pop(),x.length&&x[0]===l[0]?XA(x,cr(d,2)):[]}),ese=Vr(function(l){var d=ro(l),x=Er(l,cS);return d=typeof d=="function"?d:r,d&&x.pop(),x.length&&x[0]===l[0]?XA(x,r,d):[]});function tse(l,d){return l==null?"":Jre.call(l,d)}function ro(l){var d=l==null?0:l.length;return d?l[d-1]:r}function rse(l,d,x){var R=l==null?0:l.length;if(!R)return-1;var z=R;return x!==r&&(z=Ur(x),z=z<0?$i(R+z,0):vs(z,R-1)),d===d?dp(l,d,z):fu(l,ad,z,!0)}function nse(l,d){return l&&l.length?JM(l,Ur(d)):r}var ise=Vr(Fk);function Fk(l,d){return l&&l.length&&d&&d.length?rS(l,d):l}function sse(l,d,x){return l&&l.length&&d&&d.length?rS(l,d,cr(x,2)):l}function ase(l,d,x){return l&&l.length&&d&&d.length?rS(l,d,r,x):l}var ose=yu(function(l,d){var x=l==null?0:l.length,R=WA(l,d);return ek(l,Er(d,function(z){return vu(z,x)?+z:z}).sort(lk)),R});function cse(l,d){var x=[];if(!(l&&l.length))return x;var R=-1,z=[],se=l.length;for(d=cr(d,3);++R<se;){var xe=l[R];d(xe,R,l)&&(x.push(xe),z.push(R))}return ek(l,z),x}function ES(l){return l==null?l:tne.call(l)}function use(l,d,x){var R=l==null?0:l.length;return R?(x&&typeof x!="number"&&Us(l,d,x)?(d=0,x=R):(d=d==null?0:Ur(d),x=x===r?R:Ur(x)),to(l,d,x)):[]}function lse(l,d){return lw(l,d)}function fse(l,d,x){return sS(l,d,cr(x,2))}function dse(l,d){var x=l==null?0:l.length;if(x){var R=lw(l,d);if(R<x&&Go(l[R],d))return R}return-1}function hse(l,d){return lw(l,d,!0)}function pse(l,d,x){return sS(l,d,cr(x,2),!0)}function gse(l,d){var x=l==null?0:l.length;if(x){var R=lw(l,d,!0)-1;if(Go(l[R],d))return R}return-1}function mse(l){return l&&l.length?rk(l):[]}function yse(l,d){return l&&l.length?rk(l,cr(d,2)):[]}function vse(l){var d=l==null?0:l.length;return d?to(l,1,d):[]}function bse(l,d,x){return l&&l.length?(d=x||d===r?1:Ur(d),to(l,0,d<0?0:d)):[]}function wse(l,d,x){var R=l==null?0:l.length;return R?(d=x||d===r?1:Ur(d),d=R-d,to(l,d<0?0:d,R)):[]}function _se(l,d){return l&&l.length?fw(l,cr(d,3),!1,!0):[]}function Ese(l,d){return l&&l.length?fw(l,cr(d,3)):[]}var xse=Vr(function(l){return kl(Xi(l,1,mi,!0))}),Ase=Vr(function(l){var d=ro(l);return mi(d)&&(d=r),kl(Xi(l,1,mi,!0),cr(d,2))}),Sse=Vr(function(l){var d=ro(l);return d=typeof d=="function"?d:r,kl(Xi(l,1,mi,!0),r,d)});function Ose(l){return l&&l.length?kl(l):[]}function Ise(l,d){return l&&l.length?kl(l,cr(d,2)):[]}function Pse(l,d){return d=typeof d=="function"?d:r,l&&l.length?kl(l,r,d):[]}function xS(l){if(!(l&&l.length))return[];var d=0;return l=ln(l,function(x){if(mi(x))return d=$i(x.length,d),!0}),Cl(d,function(x){return Er(l,Il(x))})}function qk(l,d){if(!(l&&l.length))return[];var x=xS(l);return d==null?x:Er(x,function(R){return pt(d,r,R)})}var Tse=Vr(function(l,d){return mi(l)?Om(l,d):[]}),Cse=Vr(function(l){return oS(ln(l,mi))}),Rse=Vr(function(l){var d=ro(l);return mi(d)&&(d=r),oS(ln(l,mi),cr(d,2))}),Nse=Vr(function(l){var d=ro(l);return d=typeof d=="function"?d:r,oS(ln(l,mi),r,d)}),Dse=Vr(xS);function Mse(l,d){return ak(l||[],d||[],Sm)}function kse(l,d){return ak(l||[],d||[],Tm)}var $se=Vr(function(l){var d=l.length,x=d>1?l[d-1]:r;return x=typeof x=="function"?(l.pop(),x):r,qk(l,x)});function Hk(l){var d=J(l);return d.__chain__=!0,d}function Lse(l,d){return d(l),l}function ww(l,d){return d(l)}var Use=yu(function(l){var d=l.length,x=d?l[0]:0,R=this.__wrapped__,z=function(se){return WA(se,l)};return d>1||this.__actions__.length||!(R instanceof en)||!vu(x)?this.thru(z):(R=R.slice(x,+x+(d?1:0)),R.__actions__.push({func:ww,args:[z],thisArg:r}),new Za(R,this.__chain__).thru(function(se){return d&&!se.length&&se.push(r),se}))});function jse(){return Hk(this)}function Bse(){return new Za(this.value(),this.__chain__)}function Fse(){this.__values__===r&&(this.__values__=n$(this.value()));var l=this.__index__>=this.__values__.length,d=l?r:this.__values__[this.__index__++];return{done:l,value:d}}function qse(){return this}function Hse(l){for(var d,x=this;x instanceof sw;){var R=$k(x);R.__index__=0,R.__values__=r,d?z.__wrapped__=R:d=R;var z=R;x=x.__wrapped__}return z.__wrapped__=l,d}function zse(){var l=this.__wrapped__;if(l instanceof en){var d=l;return this.__actions__.length&&(d=new en(this)),d=d.reverse(),d.__actions__.push({func:ww,args:[ES],thisArg:r}),new Za(d,this.__chain__)}return this.thru(ES)}function Vse(){return sk(this.__wrapped__,this.__actions__)}var Gse=dw(function(l,d,x){On.call(l,x)?++l[x]:gu(l,x,1)});function Kse(l,d,x){var R=Dr(l)?Sn:Lne;return x&&Us(l,d,x)&&(d=r),R(l,cr(d,3))}function Wse(l,d){var x=Dr(l)?ln:qM;return x(l,cr(d,3))}var Yse=mk(Lk),Qse=mk(Uk);function Jse(l,d){return Xi(_w(l,d),1)}function Xse(l,d){return Xi(_w(l,d),ne)}function Zse(l,d,x){return x=x===r?1:Ur(x),Xi(_w(l,d),x)}function zk(l,d){var x=Dr(l)?Gt:Ml;return x(l,cr(d,3))}function Vk(l,d){var x=Dr(l)?Yr:FM;return x(l,cr(d,3))}var eae=dw(function(l,d,x){On.call(l,x)?l[x].push(d):gu(l,x,[d])});function tae(l,d,x,R){l=sa(l)?l:xp(l),x=x&&!R?Ur(x):0;var z=l.length;return x<0&&(x=$i(z+x,0)),Ow(l)?x<=z&&l.indexOf(d,x)>-1:!!z&&qo(l,d,x)>-1}var rae=Vr(function(l,d,x){var R=-1,z=typeof d=="function",se=sa(l)?et(l.length):[];return Ml(l,function(xe){se[++R]=z?pt(d,xe,x):Im(xe,d,x)}),se}),nae=dw(function(l,d,x){gu(l,x,d)});function _w(l,d){var x=Dr(l)?Er:WM;return x(l,cr(d,3))}function iae(l,d,x,R){return l==null?[]:(Dr(d)||(d=d==null?[]:[d]),x=R?r:x,Dr(x)||(x=x==null?[]:[x]),XM(l,d,x))}var sae=dw(function(l,d,x){l[x?0:1].push(d)},function(){return[[],[]]});function aae(l,d,x){var R=Dr(l)?Qa:cd,z=arguments.length<3;return R(l,cr(d,4),x,z,Ml)}function oae(l,d,x){var R=Dr(l)?Oc:cd,z=arguments.length<3;return R(l,cr(d,4),x,z,FM)}function cae(l,d){var x=Dr(l)?ln:qM;return x(l,Aw(cr(d,3)))}function uae(l){var d=Dr(l)?LM:tie;return d(l)}function lae(l,d,x){(x?Us(l,d,x):d===r)?d=1:d=Ur(d);var R=Dr(l)?Nne:rie;return R(l,d)}function fae(l){var d=Dr(l)?Dne:iie;return d(l)}function dae(l){if(l==null)return 0;if(sa(l))return Ow(l)?zo(l):l.length;var d=bs(l);return d==yt||d==Pt?l.size:eS(l).length}function hae(l,d,x){var R=Dr(l)?Di:sie;return x&&Us(l,d,x)&&(d=r),R(l,cr(d,3))}var pae=Vr(function(l,d){if(l==null)return[];var x=d.length;return x>1&&Us(l,d[0],d[1])?d=[]:x>2&&Us(d[0],d[1],d[2])&&(d=[d[0]]),XM(l,Xi(d,1),[])}),Ew=Wre||function(){return mr.Date.now()};function gae(l,d){if(typeof d!="function")throw new Xa(a);return l=Ur(l),function(){if(--l<1)return d.apply(this,arguments)}}function Gk(l,d,x){return d=x?r:d,d=l&&d==null?l.length:d,mu(l,p,r,r,r,r,d)}function Kk(l,d){var x;if(typeof d!="function")throw new Xa(a);return l=Ur(l),function(){return--l>0&&(x=d.apply(this,arguments)),l<=1&&(d=r),x}}var AS=Vr(function(l,d,x){var R=g;if(x.length){var z=Ta(x,_p(AS));R|=O}return mu(l,R,d,x,z)}),Wk=Vr(function(l,d,x){var R=g|_;if(x.length){var z=Ta(x,_p(Wk));R|=O}return mu(d,R,l,x,z)});function Yk(l,d,x){d=x?r:d;var R=mu(l,S,r,r,r,r,r,d);return R.placeholder=Yk.placeholder,R}function Qk(l,d,x){d=x?r:d;var R=mu(l,A,r,r,r,r,r,d);return R.placeholder=Qk.placeholder,R}function Jk(l,d,x){var R,z,se,xe,De,Be,at=0,ot=!1,ft=!1,Ot=!0;if(typeof l!="function")throw new Xa(a);d=no(d)||0,si(x)&&(ot=!!x.leading,ft="maxWait"in x,se=ft?$i(no(x.maxWait)||0,d):se,Ot="trailing"in x?!!x.trailing:Ot);function Yt(yi){var Ko=R,_u=z;return R=z=r,at=yi,xe=l.apply(_u,Ko),xe}function dr(yi){return at=yi,De=Nm(Jr,d),ot?Yt(yi):xe}function Hr(yi){var Ko=yi-Be,_u=yi-at,m$=d-Ko;return ft?vs(m$,se-_u):m$}function hr(yi){var Ko=yi-Be,_u=yi-at;return Be===r||Ko>=d||Ko<0||ft&&_u>=se}function Jr(){var yi=Ew();if(hr(yi))return sn(yi);De=Nm(Jr,Hr(yi))}function sn(yi){return De=r,Ot&&R?Yt(yi):(R=z=r,xe)}function Na(){De!==r&&ok(De),at=0,R=Be=z=De=r}function js(){return De===r?xe:sn(Ew())}function Da(){var yi=Ew(),Ko=hr(yi);if(R=arguments,z=this,Be=yi,Ko){if(De===r)return dr(Be);if(ft)return ok(De),De=Nm(Jr,d),Yt(Be)}return De===r&&(De=Nm(Jr,d)),xe}return Da.cancel=Na,Da.flush=js,Da}var mae=Vr(function(l,d){return BM(l,1,d)}),yae=Vr(function(l,d,x){return BM(l,no(d)||0,x)});function vae(l){return mu(l,N)}function xw(l,d){if(typeof l!="function"||d!=null&&typeof d!="function")throw new Xa(a);var x=function(){var R=arguments,z=d?d.apply(this,R):R[0],se=x.cache;if(se.has(z))return se.get(z);var xe=l.apply(this,R);return x.cache=se.set(z,xe)||se,xe};return x.cache=new(xw.Cache||pu),x}xw.Cache=pu;function Aw(l){if(typeof l!="function")throw new Xa(a);return function(){var d=arguments;switch(d.length){case 0:return!l.call(this);case 1:return!l.call(this,d[0]);case 2:return!l.call(this,d[0],d[1]);case 3:return!l.call(this,d[0],d[1],d[2])}return!l.apply(this,d)}}function bae(l){return Kk(2,l)}var wae=aie(function(l,d){d=d.length==1&&Dr(d[0])?Er(d[0],qi(cr())):Er(Xi(d,1),qi(cr()));var x=d.length;return Vr(function(R){for(var z=-1,se=vs(R.length,x);++z<se;)R[z]=d[z].call(this,R[z]);return pt(l,this,R)})}),SS=Vr(function(l,d){var x=Ta(d,_p(SS));return mu(l,O,r,d,x)}),Xk=Vr(function(l,d){var x=Ta(d,_p(Xk));return mu(l,E,r,d,x)}),_ae=yu(function(l,d){return mu(l,I,r,r,r,d)});function Eae(l,d){if(typeof l!="function")throw new Xa(a);return d=d===r?d:Ur(d),Vr(l,d)}function xae(l,d){if(typeof l!="function")throw new Xa(a);return d=d==null?0:$i(Ur(d),0),Vr(function(x){var R=x[d],z=Ll(x,0,d);return R&&Fi(z,R),pt(l,this,z)})}function Aae(l,d,x){var R=!0,z=!0;if(typeof l!="function")throw new Xa(a);return si(x)&&(R="leading"in x?!!x.leading:R,z="trailing"in x?!!x.trailing:z),Jk(l,d,{leading:R,maxWait:d,trailing:z})}function Sae(l){return Gk(l,1)}function Oae(l,d){return SS(uS(d),l)}function Iae(){if(!arguments.length)return[];var l=arguments[0];return Dr(l)?l:[l]}function Pae(l){return eo(l,y)}function Tae(l,d){return d=typeof d=="function"?d:r,eo(l,y,d)}function Cae(l){return eo(l,h|y)}function Rae(l,d){return d=typeof d=="function"?d:r,eo(l,h|y,d)}function Nae(l,d){return d==null||jM(l,d,Hi(d))}function Go(l,d){return l===d||l!==l&&d!==d}var Dae=mw(JA),Mae=mw(function(l,d){return l>=d}),_d=VM(function(){return arguments}())?VM:function(l){return li(l)&&On.call(l,"callee")&&!RM.call(l,"callee")},Dr=et.isArray,kae=Ae?qi(Ae):Hne;function sa(l){return l!=null&&Sw(l.length)&&!bu(l)}function mi(l){return li(l)&&sa(l)}function $ae(l){return l===!0||l===!1||li(l)&&Ls(l)==te}var Ul=Qre||$S,Lae=Ie?qi(Ie):zne;function Uae(l){return li(l)&&l.nodeType===1&&!Dm(l)}function jae(l){if(l==null)return!0;if(sa(l)&&(Dr(l)||typeof l=="string"||typeof l.splice=="function"||Ul(l)||Ep(l)||_d(l)))return!l.length;var d=bs(l);if(d==yt||d==Pt)return!l.size;if(Rm(l))return!eS(l).length;for(var x in l)if(On.call(l,x))return!1;return!0}function Bae(l,d){return Pm(l,d)}function Fae(l,d,x){x=typeof x=="function"?x:r;var R=x?x(l,d):r;return R===r?Pm(l,d,r,x):!!R}function OS(l){if(!li(l))return!1;var d=Ls(l);return d==le||d==T||typeof l.message=="string"&&typeof l.name=="string"&&!Dm(l)}function qae(l){return typeof l=="number"&&DM(l)}function bu(l){if(!si(l))return!1;var d=Ls(l);return d==Ge||d==tt||d==Q||d==Or}function Zk(l){return typeof l=="number"&&l==Ur(l)}function Sw(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=U}function si(l){var d=typeof l;return l!=null&&(d=="object"||d=="function")}function li(l){return l!=null&&typeof l=="object"}var e$=Pe?qi(Pe):Gne;function Hae(l,d){return l===d||ZA(l,d,mS(d))}function zae(l,d,x){return x=typeof x=="function"?x:r,ZA(l,d,mS(d),x)}function Vae(l){return t$(l)&&l!=+l}function Gae(l){if(Tie(l))throw new Rr(s);return GM(l)}function Kae(l){return l===null}function Wae(l){return l==null}function t$(l){return typeof l=="number"||li(l)&&Ls(l)==vt}function Dm(l){if(!li(l)||Ls(l)!=Bt)return!1;var d=X1(l);if(d===null)return!0;var x=On.call(d,"constructor")&&d.constructor;return typeof x=="function"&&x instanceof x&&W1.call(x)==zre}var IS=je?qi(je):Kne;function Yae(l){return Zk(l)&&l>=-U&&l<=U}var r$=Ye?qi(Ye):Wne;function Ow(l){return typeof l=="string"||!Dr(l)&&li(l)&&Ls(l)==$t}function Ra(l){return typeof l=="symbol"||li(l)&&Ls(l)==Rt}var Ep=qe?qi(qe):Yne;function Qae(l){return l===r}function Jae(l){return li(l)&&bs(l)==Ft}function Xae(l){return li(l)&&Ls(l)==Kt}var Zae=mw(tS),eoe=mw(function(l,d){return l<=d});function n$(l){if(!l)return[];if(sa(l))return Ow(l)?ys(l):ia(l);if(wm&&l[wm])return up(l[wm]());var d=bs(l),x=d==yt?Nl:d==Pt?du:xp;return x(l)}function wu(l){if(!l)return l===0?l:0;if(l=no(l),l===ne||l===-ne){var d=l<0?-1:1;return d*F}return l===l?l:0}function Ur(l){var d=wu(l),x=d%1;return d===d?x?d-x:d:0}function i$(l){return l?yd(Ur(l),0,M):0}function no(l){if(typeof l=="number")return l;if(Ra(l))return H;if(si(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=si(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=ud(l);var x=gr.test(l);return x||nn.test(l)?fr(l.slice(2),x?2:8):Xr.test(l)?H:+l}function s$(l){return Tc(l,aa(l))}function toe(l){return l?yd(Ur(l),-U,U):l===0?l:0}function En(l){return l==null?"":Ca(l)}var roe=bp(function(l,d){if(Rm(d)||sa(d)){Tc(d,Hi(d),l);return}for(var x in d)On.call(d,x)&&Sm(l,x,d[x])}),a$=bp(function(l,d){Tc(d,aa(d),l)}),Iw=bp(function(l,d,x,R){Tc(d,aa(d),l,R)}),noe=bp(function(l,d,x,R){Tc(d,Hi(d),l,R)}),ioe=yu(WA);function soe(l,d){var x=vp(l);return d==null?x:UM(x,d)}var aoe=Vr(function(l,d){l=Mn(l);var x=-1,R=d.length,z=R>2?d[2]:r;for(z&&Us(d[0],d[1],z)&&(R=1);++x<R;)for(var se=d[x],xe=aa(se),De=-1,Be=xe.length;++De<Be;){var at=xe[De],ot=l[at];(ot===r||Go(ot,gp[at])&&!On.call(l,at))&&(l[at]=se[at])}return l}),ooe=Vr(function(l){return l.push(r,xk),pt(o$,r,l)});function coe(l,d){return _n(l,cr(d,3),Pc)}function uoe(l,d){return _n(l,cr(d,3),QA)}function loe(l,d){return l==null?l:YA(l,cr(d,3),aa)}function foe(l,d){return l==null?l:HM(l,cr(d,3),aa)}function doe(l,d){return l&&Pc(l,cr(d,3))}function hoe(l,d){return l&&QA(l,cr(d,3))}function poe(l){return l==null?[]:cw(l,Hi(l))}function goe(l){return l==null?[]:cw(l,aa(l))}function PS(l,d,x){var R=l==null?r:vd(l,d);return R===r?x:R}function moe(l,d){return l!=null&&Ok(l,d,jne)}function TS(l,d){return l!=null&&Ok(l,d,Bne)}var yoe=vk(function(l,d,x){d!=null&&typeof d.toString!="function"&&(d=Y1.call(d)),l[d]=x},RS(oa)),voe=vk(function(l,d,x){d!=null&&typeof d.toString!="function"&&(d=Y1.call(d)),On.call(l,d)?l[d].push(x):l[d]=[x]},cr),boe=Vr(Im);function Hi(l){return sa(l)?$M(l):eS(l)}function aa(l){return sa(l)?$M(l,!0):Qne(l)}function woe(l,d){var x={};return d=cr(d,3),Pc(l,function(R,z,se){gu(x,d(R,z,se),R)}),x}function _oe(l,d){var x={};return d=cr(d,3),Pc(l,function(R,z,se){gu(x,z,d(R,z,se))}),x}var Eoe=bp(function(l,d,x){uw(l,d,x)}),o$=bp(function(l,d,x,R){uw(l,d,x,R)}),xoe=yu(function(l,d){var x={};if(l==null)return x;var R=!1;d=Er(d,function(se){return se=$l(se,l),R||(R=se.length>1),se}),Tc(l,pS(l),x),R&&(x=eo(x,h|m|y,yie));for(var z=d.length;z--;)aS(x,d[z]);return x});function Aoe(l,d){return c$(l,Aw(cr(d)))}var Soe=yu(function(l,d){return l==null?{}:Xne(l,d)});function c$(l,d){if(l==null)return{};var x=Er(pS(l),function(R){return[R]});return d=cr(d),ZM(l,x,function(R,z){return d(R,z[0])})}function Ooe(l,d,x){d=$l(d,l);var R=-1,z=d.length;for(z||(z=1,l=r);++R<z;){var se=l==null?r:l[Cc(d[R])];se===r&&(R=z,se=x),l=bu(se)?se.call(l):se}return l}function Ioe(l,d,x){return l==null?l:Tm(l,d,x)}function Poe(l,d,x,R){return R=typeof R=="function"?R:r,l==null?l:Tm(l,d,x,R)}var u$=_k(Hi),l$=_k(aa);function Toe(l,d,x){var R=Dr(l),z=R||Ul(l)||Ep(l);if(d=cr(d,4),x==null){var se=l&&l.constructor;z?x=R?new se:[]:si(l)?x=bu(se)?vp(X1(l)):{}:x={}}return(z?Gt:Pc)(l,function(xe,De,Be){return d(x,xe,De,Be)}),x}function Coe(l,d){return l==null?!0:aS(l,d)}function Roe(l,d,x){return l==null?l:ik(l,d,uS(x))}function Noe(l,d,x,R){return R=typeof R=="function"?R:r,l==null?l:ik(l,d,uS(x),R)}function xp(l){return l==null?[]:Rl(l,Hi(l))}function Doe(l){return l==null?[]:Rl(l,aa(l))}function Moe(l,d,x){return x===r&&(x=d,d=r),x!==r&&(x=no(x),x=x===x?x:0),d!==r&&(d=no(d),d=d===d?d:0),yd(no(l),d,x)}function koe(l,d,x){return d=wu(d),x===r?(x=d,d=0):x=wu(x),l=no(l),Fne(l,d,x)}function $oe(l,d,x){if(x&&typeof x!="boolean"&&Us(l,d,x)&&(d=x=r),x===r&&(typeof d=="boolean"?(x=d,d=r):typeof l=="boolean"&&(x=l,l=r)),l===r&&d===r?(l=0,d=1):(l=wu(l),d===r?(d=l,l=0):d=wu(d)),l>d){var R=l;l=d,d=R}if(x||l%1||d%1){var z=MM();return vs(l+z*(d-l+Wr("1e-"+((z+"").length-1))),d)}return nS(l,d)}var Loe=wp(function(l,d,x){return d=d.toLowerCase(),l+(x?f$(d):d)});function f$(l){return CS(En(l).toLowerCase())}function d$(l){return l=En(l),l&&l.replace($r,ip).replace(wn,"")}function Uoe(l,d,x){l=En(l),d=Ca(d);var R=l.length;x=x===r?R:yd(Ur(x),0,R);var z=x;return x-=d.length,x>=0&&l.slice(x,z)==d}function joe(l){return l=En(l),l&&Ir.test(l)?l.replace(Cr,sp):l}function Boe(l){return l=En(l),l&&dt.test(l)?l.replace(ct,"\\$&"):l}var Foe=wp(function(l,d,x){return l+(x?"-":"")+d.toLowerCase()}),qoe=wp(function(l,d,x){return l+(x?" ":"")+d.toLowerCase()}),Hoe=gk("toLowerCase");function zoe(l,d,x){l=En(l),d=Ur(d);var R=d?zo(l):0;if(!d||R>=d)return l;var z=(d-R)/2;return gw(rw(z),x)+l+gw(tw(z),x)}function Voe(l,d,x){l=En(l),d=Ur(d);var R=d?zo(l):0;return d&&R<d?l+gw(d-R,x):l}function Goe(l,d,x){l=En(l),d=Ur(d);var R=d?zo(l):0;return d&&R<d?gw(d-R,x)+l:l}function Koe(l,d,x){return x||d==null?d=0:d&&(d=+d),ene(En(l).replace(Et,""),d||0)}function Woe(l,d,x){return(x?Us(l,d,x):d===r)?d=1:d=Ur(d),iS(En(l),d)}function Yoe(){var l=arguments,d=En(l[0]);return l.length<3?d:d.replace(l[1],l[2])}var Qoe=wp(function(l,d,x){return l+(x?"_":"")+d.toLowerCase()});function Joe(l,d,x){return x&&typeof x!="number"&&Us(l,d,x)&&(d=x=r),x=x===r?M:x>>>0,x?(l=En(l),l&&(typeof d=="string"||d!=null&&!IS(d))&&(d=Ca(d),!d&&Ho(l))?Ll(ys(l),0,x):l.split(d,x)):[]}var Xoe=wp(function(l,d,x){return l+(x?" ":"")+CS(d)});function Zoe(l,d,x){return l=En(l),x=x==null?0:yd(Ur(x),0,l.length),d=Ca(d),l.slice(x,x+d.length)==d}function ece(l,d,x){var R=J.templateSettings;x&&Us(l,d,x)&&(d=r),l=En(l),d=Iw({},d,R,Ek);var z=Iw({},d.imports,R.imports,Ek),se=Hi(z),xe=Rl(z,se),De,Be,at=0,ot=d.interpolate||hn,ft="__p += '",Ot=HA((d.escape||hn).source+"|"+ot.source+"|"+(ot===ye?pr:hn).source+"|"+(d.evaluate||hn).source+"|$","g"),Yt="//# sourceURL="+(On.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++na+"]")+`
142
- `;l.replace(Ot,function(hr,Jr,sn,Na,js,Da){return sn||(sn=Na),ft+=l.slice(at,Da).replace(Lr,ap),Jr&&(De=!0,ft+=`' +
143
- __e(`+Jr+`) +
144
- '`),js&&(Be=!0,ft+=`';
145
- `+js+`;
146
- __p += '`),sn&&(ft+=`' +
147
- ((__t = (`+sn+`)) == null ? '' : __t) +
148
- '`),at=Da+hr.length,hr}),ft+=`';
149
- `;var dr=On.call(d,"variable")&&d.variable;if(!dr)ft=`with (obj) {
150
- `+ft+`
151
- }
152
- `;else if(wt.test(dr))throw new Rr(o);ft=(Be?ft.replace(hi,""):ft).replace($n,"$1").replace(Ln,"$1;"),ft="function("+(dr||"obj")+`) {
153
- `+(dr?"":`obj || (obj = {});
154
- `)+"var __t, __p = ''"+(De?", __e = _.escape":"")+(Be?`, __j = Array.prototype.join;
155
- function print() { __p += __j.call(arguments, '') }
156
- `:`;
157
- `)+ft+`return __p
158
- }`;var Hr=p$(function(){return vn(se,Yt+"return "+ft).apply(r,xe)});if(Hr.source=ft,OS(Hr))throw Hr;return Hr}function tce(l){return En(l).toLowerCase()}function rce(l){return En(l).toUpperCase()}function nce(l,d,x){if(l=En(l),l&&(x||d===r))return ud(l);if(!l||!(d=Ca(d)))return l;var R=ys(l),z=ys(d),se=ld(R,z),xe=fd(R,z)+1;return Ll(R,se,xe).join("")}function ice(l,d,x){if(l=En(l),l&&(x||d===r))return l.slice(0,hd(l)+1);if(!l||!(d=Ca(d)))return l;var R=ys(l),z=fd(R,ys(d))+1;return Ll(R,0,z).join("")}function sce(l,d,x){if(l=En(l),l&&(x||d===r))return l.replace(Et,"");if(!l||!(d=Ca(d)))return l;var R=ys(l),z=ld(R,ys(d));return Ll(R,z).join("")}function ace(l,d){var x=B,R=V;if(si(d)){var z="separator"in d?d.separator:z;x="length"in d?Ur(d.length):x,R="omission"in d?Ca(d.omission):R}l=En(l);var se=l.length;if(Ho(l)){var xe=ys(l);se=xe.length}if(x>=se)return l;var De=x-zo(R);if(De<1)return R;var Be=xe?Ll(xe,0,De).join(""):l.slice(0,De);if(z===r)return Be+R;if(xe&&(De+=Be.length-De),IS(z)){if(l.slice(De).search(z)){var at,ot=Be;for(z.global||(z=HA(z.source,En(lr.exec(z))+"g")),z.lastIndex=0;at=z.exec(ot);)var ft=at.index;Be=Be.slice(0,ft===r?De:ft)}}else if(l.indexOf(Ca(z),De)!=De){var Ot=Be.lastIndexOf(z);Ot>-1&&(Be=Be.slice(0,Ot))}return Be+R}function oce(l){return l=En(l),l&&Br.test(l)?l.replace(ri,hp):l}var cce=wp(function(l,d,x){return l+(x?" ":"")+d.toUpperCase()}),CS=gk("toUpperCase");function h$(l,d,x){return l=En(l),d=x?r:d,d===r?cp(l)?jre(l):ui(l):l.match(d)||[]}var p$=Vr(function(l,d){try{return pt(l,r,d)}catch(x){return OS(x)?x:new Rr(x)}}),uce=yu(function(l,d){return Gt(d,function(x){x=Cc(x),gu(l,x,AS(l[x],l))}),l});function lce(l){var d=l==null?0:l.length,x=cr();return l=d?Er(l,function(R){if(typeof R[1]!="function")throw new Xa(a);return[x(R[0]),R[1]]}):[],Vr(function(R){for(var z=-1;++z<d;){var se=l[z];if(pt(se[0],this,R))return pt(se[1],this,R)}})}function fce(l){return $ne(eo(l,h))}function RS(l){return function(){return l}}function dce(l,d){return l==null||l!==l?d:l}var hce=yk(),pce=yk(!0);function oa(l){return l}function NS(l){return KM(typeof l=="function"?l:eo(l,h))}function gce(l){return YM(eo(l,h))}function mce(l,d){return QM(l,eo(d,h))}var yce=Vr(function(l,d){return function(x){return Im(x,l,d)}}),vce=Vr(function(l,d){return function(x){return Im(l,x,d)}});function DS(l,d,x){var R=Hi(d),z=cw(d,R);x==null&&!(si(d)&&(z.length||!R.length))&&(x=d,d=l,l=this,z=cw(d,Hi(d)));var se=!(si(x)&&"chain"in x)||!!x.chain,xe=bu(l);return Gt(z,function(De){var Be=d[De];l[De]=Be,xe&&(l.prototype[De]=function(){var at=this.__chain__;if(se||at){var ot=l(this.__wrapped__),ft=ot.__actions__=ia(this.__actions__);return ft.push({func:Be,args:arguments,thisArg:l}),ot.__chain__=at,ot}return Be.apply(l,Fi([this.value()],arguments))})}),l}function bce(){return mr._===this&&(mr._=Vre),this}function MS(){}function wce(l){return l=Ur(l),Vr(function(d){return JM(d,l)})}var _ce=fS(Er),Ece=fS(Sn),xce=fS(Di);function g$(l){return vS(l)?Il(Cc(l)):Zne(l)}function Ace(l){return function(d){return l==null?r:vd(l,d)}}var Sce=bk(),Oce=bk(!0);function kS(){return[]}function $S(){return!1}function Ice(){return{}}function Pce(){return""}function Tce(){return!0}function Cce(l,d){if(l=Ur(l),l<1||l>U)return[];var x=M,R=vs(l,M);d=cr(d),l-=M;for(var z=Cl(R,d);++x<l;)d(x);return z}function Rce(l){return Dr(l)?Er(l,Cc):Ra(l)?[l]:ia(kk(En(l)))}function Nce(l){var d=++Hre;return En(l)+d}var Dce=pw(function(l,d){return l+d},0),Mce=dS("ceil"),kce=pw(function(l,d){return l/d},1),$ce=dS("floor");function Lce(l){return l&&l.length?ow(l,oa,JA):r}function Uce(l,d){return l&&l.length?ow(l,cr(d,2),JA):r}function jce(l){return od(l,oa)}function Bce(l,d){return od(l,cr(d,2))}function Fce(l){return l&&l.length?ow(l,oa,tS):r}function qce(l,d){return l&&l.length?ow(l,cr(d,2),tS):r}var Hce=pw(function(l,d){return l*d},1),zce=dS("round"),Vce=pw(function(l,d){return l-d},0);function Gce(l){return l&&l.length?Tl(l,oa):0}function Kce(l,d){return l&&l.length?Tl(l,cr(d,2)):0}return J.after=gae,J.ary=Gk,J.assign=roe,J.assignIn=a$,J.assignInWith=Iw,J.assignWith=noe,J.at=ioe,J.before=Kk,J.bind=AS,J.bindAll=uce,J.bindKey=Wk,J.castArray=Iae,J.chain=Hk,J.chunk=$ie,J.compact=Lie,J.concat=Uie,J.cond=lce,J.conforms=fce,J.constant=RS,J.countBy=Gse,J.create=soe,J.curry=Yk,J.curryRight=Qk,J.debounce=Jk,J.defaults=aoe,J.defaultsDeep=ooe,J.defer=mae,J.delay=yae,J.difference=jie,J.differenceBy=Bie,J.differenceWith=Fie,J.drop=qie,J.dropRight=Hie,J.dropRightWhile=zie,J.dropWhile=Vie,J.fill=Gie,J.filter=Wse,J.flatMap=Jse,J.flatMapDeep=Xse,J.flatMapDepth=Zse,J.flatten=jk,J.flattenDeep=Kie,J.flattenDepth=Wie,J.flip=vae,J.flow=hce,J.flowRight=pce,J.fromPairs=Yie,J.functions=poe,J.functionsIn=goe,J.groupBy=eae,J.initial=Jie,J.intersection=Xie,J.intersectionBy=Zie,J.intersectionWith=ese,J.invert=yoe,J.invertBy=voe,J.invokeMap=rae,J.iteratee=NS,J.keyBy=nae,J.keys=Hi,J.keysIn=aa,J.map=_w,J.mapKeys=woe,J.mapValues=_oe,J.matches=gce,J.matchesProperty=mce,J.memoize=xw,J.merge=Eoe,J.mergeWith=o$,J.method=yce,J.methodOf=vce,J.mixin=DS,J.negate=Aw,J.nthArg=wce,J.omit=xoe,J.omitBy=Aoe,J.once=bae,J.orderBy=iae,J.over=_ce,J.overArgs=wae,J.overEvery=Ece,J.overSome=xce,J.partial=SS,J.partialRight=Xk,J.partition=sae,J.pick=Soe,J.pickBy=c$,J.property=g$,J.propertyOf=Ace,J.pull=ise,J.pullAll=Fk,J.pullAllBy=sse,J.pullAllWith=ase,J.pullAt=ose,J.range=Sce,J.rangeRight=Oce,J.rearg=_ae,J.reject=cae,J.remove=cse,J.rest=Eae,J.reverse=ES,J.sampleSize=lae,J.set=Ioe,J.setWith=Poe,J.shuffle=fae,J.slice=use,J.sortBy=pae,J.sortedUniq=mse,J.sortedUniqBy=yse,J.split=Joe,J.spread=xae,J.tail=vse,J.take=bse,J.takeRight=wse,J.takeRightWhile=_se,J.takeWhile=Ese,J.tap=Lse,J.throttle=Aae,J.thru=ww,J.toArray=n$,J.toPairs=u$,J.toPairsIn=l$,J.toPath=Rce,J.toPlainObject=s$,J.transform=Toe,J.unary=Sae,J.union=xse,J.unionBy=Ase,J.unionWith=Sse,J.uniq=Ose,J.uniqBy=Ise,J.uniqWith=Pse,J.unset=Coe,J.unzip=xS,J.unzipWith=qk,J.update=Roe,J.updateWith=Noe,J.values=xp,J.valuesIn=Doe,J.without=Tse,J.words=h$,J.wrap=Oae,J.xor=Cse,J.xorBy=Rse,J.xorWith=Nse,J.zip=Dse,J.zipObject=Mse,J.zipObjectDeep=kse,J.zipWith=$se,J.entries=u$,J.entriesIn=l$,J.extend=a$,J.extendWith=Iw,DS(J,J),J.add=Dce,J.attempt=p$,J.camelCase=Loe,J.capitalize=f$,J.ceil=Mce,J.clamp=Moe,J.clone=Pae,J.cloneDeep=Cae,J.cloneDeepWith=Rae,J.cloneWith=Tae,J.conformsTo=Nae,J.deburr=d$,J.defaultTo=dce,J.divide=kce,J.endsWith=Uoe,J.eq=Go,J.escape=joe,J.escapeRegExp=Boe,J.every=Kse,J.find=Yse,J.findIndex=Lk,J.findKey=coe,J.findLast=Qse,J.findLastIndex=Uk,J.findLastKey=uoe,J.floor=$ce,J.forEach=zk,J.forEachRight=Vk,J.forIn=loe,J.forInRight=foe,J.forOwn=doe,J.forOwnRight=hoe,J.get=PS,J.gt=Dae,J.gte=Mae,J.has=moe,J.hasIn=TS,J.head=Bk,J.identity=oa,J.includes=tae,J.indexOf=Qie,J.inRange=koe,J.invoke=boe,J.isArguments=_d,J.isArray=Dr,J.isArrayBuffer=kae,J.isArrayLike=sa,J.isArrayLikeObject=mi,J.isBoolean=$ae,J.isBuffer=Ul,J.isDate=Lae,J.isElement=Uae,J.isEmpty=jae,J.isEqual=Bae,J.isEqualWith=Fae,J.isError=OS,J.isFinite=qae,J.isFunction=bu,J.isInteger=Zk,J.isLength=Sw,J.isMap=e$,J.isMatch=Hae,J.isMatchWith=zae,J.isNaN=Vae,J.isNative=Gae,J.isNil=Wae,J.isNull=Kae,J.isNumber=t$,J.isObject=si,J.isObjectLike=li,J.isPlainObject=Dm,J.isRegExp=IS,J.isSafeInteger=Yae,J.isSet=r$,J.isString=Ow,J.isSymbol=Ra,J.isTypedArray=Ep,J.isUndefined=Qae,J.isWeakMap=Jae,J.isWeakSet=Xae,J.join=tse,J.kebabCase=Foe,J.last=ro,J.lastIndexOf=rse,J.lowerCase=qoe,J.lowerFirst=Hoe,J.lt=Zae,J.lte=eoe,J.max=Lce,J.maxBy=Uce,J.mean=jce,J.meanBy=Bce,J.min=Fce,J.minBy=qce,J.stubArray=kS,J.stubFalse=$S,J.stubObject=Ice,J.stubString=Pce,J.stubTrue=Tce,J.multiply=Hce,J.nth=nse,J.noConflict=bce,J.noop=MS,J.now=Ew,J.pad=zoe,J.padEnd=Voe,J.padStart=Goe,J.parseInt=Koe,J.random=$oe,J.reduce=aae,J.reduceRight=oae,J.repeat=Woe,J.replace=Yoe,J.result=Ooe,J.round=zce,J.runInContext=Ue,J.sample=uae,J.size=dae,J.snakeCase=Qoe,J.some=hae,J.sortedIndex=lse,J.sortedIndexBy=fse,J.sortedIndexOf=dse,J.sortedLastIndex=hse,J.sortedLastIndexBy=pse,J.sortedLastIndexOf=gse,J.startCase=Xoe,J.startsWith=Zoe,J.subtract=Vce,J.sum=Gce,J.sumBy=Kce,J.template=ece,J.times=Cce,J.toFinite=wu,J.toInteger=Ur,J.toLength=i$,J.toLower=tce,J.toNumber=no,J.toSafeInteger=toe,J.toString=En,J.toUpper=rce,J.trim=nce,J.trimEnd=ice,J.trimStart=sce,J.truncate=ace,J.unescape=oce,J.uniqueId=Nce,J.upperCase=cce,J.upperFirst=CS,J.each=zk,J.eachRight=Vk,J.first=Bk,DS(J,function(){var l={};return Pc(J,function(d,x){On.call(J.prototype,x)||(l[x]=d)}),l}(),{chain:!1}),J.VERSION=n,Gt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){J[l].placeholder=J}),Gt(["drop","take"],function(l,d){en.prototype[l]=function(x){x=x===r?1:$i(Ur(x),0);var R=this.__filtered__&&!d?new en(this):this.clone();return R.__filtered__?R.__takeCount__=vs(x,R.__takeCount__):R.__views__.push({size:vs(x,M),type:l+(R.__dir__<0?"Right":"")}),R},en.prototype[l+"Right"]=function(x){return this.reverse()[l](x).reverse()}}),Gt(["filter","map","takeWhile"],function(l,d){var x=d+1,R=x==j||x==Y;en.prototype[l]=function(z){var se=this.clone();return se.__iteratees__.push({iteratee:cr(z,3),type:x}),se.__filtered__=se.__filtered__||R,se}}),Gt(["head","last"],function(l,d){var x="take"+(d?"Right":"");en.prototype[l]=function(){return this[x](1).value()[0]}}),Gt(["initial","tail"],function(l,d){var x="drop"+(d?"":"Right");en.prototype[l]=function(){return this.__filtered__?new en(this):this[x](1)}}),en.prototype.compact=function(){return this.filter(oa)},en.prototype.find=function(l){return this.filter(l).head()},en.prototype.findLast=function(l){return this.reverse().find(l)},en.prototype.invokeMap=Vr(function(l,d){return typeof l=="function"?new en(this):this.map(function(x){return Im(x,l,d)})}),en.prototype.reject=function(l){return this.filter(Aw(cr(l)))},en.prototype.slice=function(l,d){l=Ur(l);var x=this;return x.__filtered__&&(l>0||d<0)?new en(x):(l<0?x=x.takeRight(-l):l&&(x=x.drop(l)),d!==r&&(d=Ur(d),x=d<0?x.dropRight(-d):x.take(d-l)),x)},en.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},en.prototype.toArray=function(){return this.take(M)},Pc(en.prototype,function(l,d){var x=/^(?:filter|find|map|reject)|While$/.test(d),R=/^(?:head|last)$/.test(d),z=J[R?"take"+(d=="last"?"Right":""):d],se=R||/^find/.test(d);z&&(J.prototype[d]=function(){var xe=this.__wrapped__,De=R?[1]:arguments,Be=xe instanceof en,at=De[0],ot=Be||Dr(xe),ft=function(Jr){var sn=z.apply(J,Fi([Jr],De));return R&&Ot?sn[0]:sn};ot&&x&&typeof at=="function"&&at.length!=1&&(Be=ot=!1);var Ot=this.__chain__,Yt=!!this.__actions__.length,dr=se&&!Ot,Hr=Be&&!Yt;if(!se&&ot){xe=Hr?xe:new en(this);var hr=l.apply(xe,De);return hr.__actions__.push({func:ww,args:[ft],thisArg:r}),new Za(hr,Ot)}return dr&&Hr?l.apply(this,De):(hr=this.thru(ft),dr?R?hr.value()[0]:hr.value():hr)})}),Gt(["pop","push","shift","sort","splice","unshift"],function(l){var d=G1[l],x=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",R=/^(?:pop|shift)$/.test(l);J.prototype[l]=function(){var z=arguments;if(R&&!this.__chain__){var se=this.value();return d.apply(Dr(se)?se:[],z)}return this[x](function(xe){return d.apply(Dr(xe)?xe:[],z)})}}),Pc(en.prototype,function(l,d){var x=J[d];if(x){var R=x.name+"";On.call(yp,R)||(yp[R]=[]),yp[R].push({name:d,func:x})}}),yp[hw(r,_).name]=[{name:"wrapper",func:r}],en.prototype.clone=one,en.prototype.reverse=cne,en.prototype.value=une,J.prototype.at=Use,J.prototype.chain=jse,J.prototype.commit=Bse,J.prototype.next=Fse,J.prototype.plant=Hse,J.prototype.reverse=zse,J.prototype.toJSON=J.prototype.valueOf=J.prototype.value=Vse,J.prototype.first=J.prototype.head,wm&&(J.prototype[wm]=qse),J},pp=Bre();C?((C.exports=pp)._=pp,ie._=pp):mr._=pp}).call(jy)})(B6,B6.exports);var FCe=Object.defineProperty,qCe=Object.defineProperties,HCe=Object.getOwnPropertyDescriptors,xz=Object.getOwnPropertySymbols,zCe=Object.prototype.hasOwnProperty,VCe=Object.prototype.propertyIsEnumerable,Az=(t,e,r)=>e in t?FCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d_=(t,e)=>{for(var r in e||(e={}))zCe.call(e,r)&&Az(t,r,e[r]);if(xz)for(var r of xz(e))VCe.call(e,r)&&Az(t,r,e[r]);return t},GCe=(t,e)=>qCe(t,HCe(e));function qf(t,e,r){var n;const i=yOe(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${BCe}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Xh(t){return t.includes(":")?t.split(":")[1]:t}function Fee(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function KCe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function WCe(t={},e={}){const r=Sz(t),n=Sz(e);return B6.exports.merge(r,n)}function Sz(t){var e,r,n,i;const s={};if(!C0(t))return s;for(const[a,o]of Object.entries(t)){const c=SD(a)?[a]:o.chains,u=o.methods||[],f=o.events||[],h=o.rpcMap||{},m=gv(a);s[m]=GCe(d_(d_({},s[m]),o),{chains:uC(c,(e=s[m])==null?void 0:e.chains),methods:uC(u,(r=s[m])==null?void 0:r.methods),events:uC(f,(n=s[m])==null?void 0:n.events),rpcMap:d_(d_({},h),(i=s[m])==null?void 0:i.rpcMap)})}return s}function YCe(t){return t.includes(":")?t.split(":")[2]:t}function QCe(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],a=n.accounts||[],o=SD(r)?[r]:n.chains?n.chains:Fee(n.accounts);e[r]={chains:o,methods:i,events:s,accounts:a}}return e}function _C(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):t.includes(":")?Number(t.split(":")[1]):Number(t)}const qee={},Zn=t=>qee[t],EC=(t,e)=>{qee[t]=e};class JCe{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Xh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||qf(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}}class XCe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||qf(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(Xh(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class ZCe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Xh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||qf(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}}class eRe{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Xh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||qf(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}}class tRe{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=Xh(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}}class rRe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Xh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||qf(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}}class nRe{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Xh(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||qf(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new td(n,Zn("disableProviderPing")))}}class iRe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Zn("events"),this.client=Zn("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||qf(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Ol.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||qf(e,this.namespace);return typeof n>"u"?void 0:new Sl(new td(n,Zn("disableProviderPing")))}}var sRe=Object.defineProperty,aRe=Object.defineProperties,oRe=Object.getOwnPropertyDescriptors,Oz=Object.getOwnPropertySymbols,cRe=Object.prototype.hasOwnProperty,uRe=Object.prototype.propertyIsEnumerable,Iz=(t,e,r)=>e in t?sRe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,h_=(t,e)=>{for(var r in e||(e={}))cRe.call(e,r)&&Iz(t,r,e[r]);if(Oz)for(var r of Oz(e))uRe.call(e,r)&&Iz(t,r,e[r]);return t},xC=(t,e)=>aRe(t,oRe(e));let lRe=class Hee{constructor(e){this.events=new J4,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:on.pino(on.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||_z})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new Hee(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:h_({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){this.request(e,n).then(i=>r(null,i)).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:wi("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s,this.namespaces||(this.namespaces=QCe(s.namespaces),this.persist("namespaces",this.namespaces))}).catch(s=>{if(s.message!==jee)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(su(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await DCe.init({logger:this.providerOpts.logger||_z,relayUrl:this.providerOpts.relayUrl||LCe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>gv(r)))];EC("client",this.client),EC("events",this.events),EC("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=KCe(r,this.session),i=Fee(n),s=WCe(this.namespaces,this.optionalNamespaces),a=xC(h_({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new XCe({namespace:a});break;case"solana":this.rpcProviders[r]=new ZCe({namespace:a});break;case"cosmos":this.rpcProviders[r]=new eRe({namespace:a});break;case"polkadot":this.rpcProviders[r]=new JCe({namespace:a});break;case"cip34":this.rpcProviders[r]=new tRe({namespace:a});break;case"elrond":this.rpcProviders[r]=new rRe({namespace:a});break;case"multiversx":this.rpcProviders[r]=new nRe({namespace:a});break;case"near":this.rpcProviders[r]=new iRe({namespace:a});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&su(i)&&this.events.emit("accountsChanged",i.map(YCe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,a=gv(i),o=_C(i)!==_C(s)?`${a}:${_C(s)}`:i;this.onChainChanged(o)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=xC(h_({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",xC(h_({},wi("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ol.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(a=>gv(a)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=gv(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var n;if(!this.namespaces)return;const[i,s]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(s),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${s}`]).defaultChain=s,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${Ez}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Ez}/${e}`)}};const fRe=lRe,dRe="wc",hRe="ethereum_provider",pRe=`${dRe}@2:${hRe}:`,gRe="https://rpc.walletconnect.com/v1/",yx=["eth_sendTransaction","personal_sign"],zee=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],vx=["chainChanged","accountsChanged"],Vee=["chainChanged","accountsChanged","message","disconnect","connect"];var mRe=Object.defineProperty,yRe=Object.defineProperties,vRe=Object.getOwnPropertyDescriptors,Pz=Object.getOwnPropertySymbols,bRe=Object.prototype.hasOwnProperty,wRe=Object.prototype.propertyIsEnumerable,Tz=(t,e,r)=>e in t?mRe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yv=(t,e)=>{for(var r in e||(e={}))bRe.call(e,r)&&Tz(t,r,e[r]);if(Pz)for(var r of Pz(e))wRe.call(e,r)&&Tz(t,r,e[r]);return t},Cz=(t,e)=>yRe(t,vRe(e));function bx(t){return Number(t[0].split(":")[1])}function AC(t){return`0x${t.toString(16)}`}function _Re(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:a,rpcMap:o}=t;if(!su(e))throw new Error("Invalid chains");const c={chains:e,methods:n||yx,events:s||vx,rpcMap:yv({},e.length?{[bx(e)]:o[bx(e)]}:{})},u=s==null?void 0:s.filter(y=>!vx.includes(y)),f=n==null?void 0:n.filter(y=>!yx.includes(y));if(!r&&!a&&!i&&!(u!=null&&u.length)&&!(f!=null&&f.length))return{required:e.length?c:void 0};const h=(u==null?void 0:u.length)&&(f==null?void 0:f.length)||!r,m={chains:[...new Set(h?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:zee))],events:[...new Set(c.events.concat(a!=null&&a.length?a:Vee))],rpcMap:o};return{required:e.length?c:void 0,optional:r.length?m:void 0}}let Gee=class Kee{constructor(){this.events=new Pa.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=pRe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Kee;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=_Re(this.rpc);try{const i=await new Promise(async(a,o)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Cz(yv({namespaces:yv({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(u=>{a(u)}).catch(u=>{o(new Error(u.message))})});if(!i)return;const s=vOe(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:AC(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",AC(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Cz(yv({},wi("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",AC(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],a=i.concat(s);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(e==null?void 0:e.methods)||yx:[],c=i.length?(e==null?void 0:e.events)||vx:[],u=(e==null?void 0:e.optionalMethods)||[],f=(e==null?void 0:e.optionalEvents)||[],h=(e==null?void 0:e.rpcMap)||this.buildRpcMap(a,e.projectId),m=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(y=>this.formatChainId(y)),optionalChains:s.map(y=>this.formatChainId(y)),methods:o,events:c,optionalMethods:u,optionalEvents:f,rpcMap:h,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:m,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?bx(this.rpc.chains):bx(this.rpc.optionalChains),this.signer=await fRe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{r=require("@walletconnect/modal").WalletConnectModal}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(yv({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&su(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&su(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${gRe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};const ERe=Gee,xRe=Object.freeze(Object.defineProperty({__proto__:null,EthereumProvider:ERe,OPTIONAL_EVENTS:Vee,OPTIONAL_METHODS:zee,REQUIRED_EVENTS:vx,REQUIRED_METHODS:yx,default:Gee},Symbol.toStringTag,{value:"Module"})),ARe=Ia(xRe);var SRe=$e&&$e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ORe=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IRe=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&SRe(e,t,r);return ORe(e,t),e};Object.defineProperty(cA,"__esModule",{value:!0});cA.WalletConnectV2Connector=void 0;const PRe=K2,TRe=ml,CRe=Do;class xf extends PRe.AbstractConnector{constructor(e){super({supportedChainIds:(()=>{const{chains:r,optionalChains:n}=xf.configuration.chains[e];return[...r,...n]})()}),this.desiredChainId=e,this.activate=async()=>{const r=await Promise.resolve().then(()=>IRe(ARe)).then(i=>{const{chains:s,optionalChains:a}=xf.configuration.chains[this.desiredChainId];return i.default.init({projectId:xf.configuration.projectId,rpcMap:xf.configuration.urls,chains:s,optionalChains:a,showQrModal:!0,disableProviderPing:!0,qrModalOptions:{themeVariables:{"--wcm-z-index":"3000"}},methods:["eth_sendTransaction","personal_sign"],optionalMethods:["eth_accounts","eth_requestAccounts","eth_sign","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain"],events:["chainChanged","accountsChanged"],optionalEvents:["disconnect"]})}),n=await r.enable();return r.on("accountsChanged",this.handleAccountsChanged),r.on("chainChanged",this.handleChainChanged),r.on("disconnect",this.handleDisconnect),this.provider=r,{chainId:r.chainId,account:n[0],provider:r}},this.getProvider=async()=>{if(!this.provider)throw new Error("Provider is undefined");return this.provider},this.getChainId=async()=>{if(!this.provider)throw new Error("Provider is undefined");return this.provider.chainId},this.getAccount=async()=>{if(!this.provider)throw new Error("Provider is undefined");return this.provider.accounts[0]},this.getWalletName=()=>{var r,n;return(n=(r=this.provider)===null||r===void 0?void 0:r.session)===null||n===void 0?void 0:n.peer.metadata.name},this.deactivate=()=>{this.provider&&(this.emitDeactivate(),this.provider.removeListener("accountsChanged",this.handleAccountsChanged).removeListener("chainChanged",this.handleChainChanged).removeListener("disconnect",this.handleDisconnect).disconnect())},this.handleAccountsChanged=r=>{this.emitUpdate({account:r[0]})},this.handleChainChanged=r=>{this.emitUpdate({chainId:r})},this.handleDisconnect=()=>{if(!this.provider)throw new Error("Provider is undefined");this.deactivate()}}}cA.WalletConnectV2Connector=xf;xf.configuration=CRe.getConfiguration()[TRe.ProviderType.WALLET_CONNECT_V2];xf.clearStorage=t=>{t.removeRegExp(new RegExp("^wc@2:"))};var wA={},rd=(t=>(t.MissingApiKey="MISSING_API_KEY",t.ModalNotReady="MODAL_NOT_READY",t.MalformedResponse="MALFORMED_RESPONSE",t.InvalidArgument="INVALID_ARGUMENT",t.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",t.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",t))(rd||{}),ym=(t=>(t.SyncWeb3Method="SYNC_WEB3_METHOD",t.DuplicateIframe="DUPLICATE_IFRAME",t.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",t.DeprecationNotice="DEPRECATION_NOTICE",t))(ym||{}),_A=(t=>(t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",t[t.MagicLinkExpired=-10001]="MagicLinkExpired",t[t.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",t[t.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",t[t.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",t[t.UpdateEmailFailed=-10004]="UpdateEmailFailed",t[t.UserRequestEditEmail=-10005]="UserRequestEditEmail",t[t.InactiveRecipient=-10010]="InactiveRecipient",t[t.AccessDeniedToUser=-10011]="AccessDeniedToUser",t[t.RedirectLoginComplete=-10015]="RedirectLoginComplete",t))(_A||{}),fo=(t=>(t.MetaMask="metamask",t.CoinbaseWallet="coinbase_wallet",t))(fo||{}),Hv=(t=>(t.WalletSelected="wallet_selected",t.WalletConnected="wallet_connected",t.WalletRejected="wallet_rejected",t))(Hv||{}),yr=(t=>(t.LoginWithSms="magic_auth_login_with_sms",t.LoginWithEmailOTP="magic_auth_login_with_email_otp",t.LoginWithMagicLink="magic_auth_login_with_magic_link",t.LoginWithCredential="magic_auth_login_with_credential",t.SetAuthorizationToken="magic_auth_set_authorization_token",t.GetIdToken="magic_auth_get_id_token",t.GenerateIdToken="magic_auth_generate_id_token",t.GetMetadata="magic_auth_get_metadata",t.IsLoggedIn="magic_is_logged_in",t.Logout="magic_auth_logout",t.UpdateEmail="magic_auth_update_email",t.UserSettings="magic_auth_settings",t.UserSettingsTestMode="magic_auth_settings_testing_mode",t.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",t.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",t.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",t.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",t.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",t.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",t.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",t.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",t.LogoutTestMode="magic_auth_logout_testing_mode",t.UpdateEmailTestMode="magic_auth_update_email_testing_mode",t.IntermediaryEvent="magic_intermediary_event",t.RequestAccounts="eth_requestAccounts",t.GetInfo="magic_get_info",t.ShowUI="magic_wallet",t.NFTPurchase="magic_nft_purchase",t.NFTCheckout="magic_nft_checkout",t.NFTTransfer="magic_nft_transfer",t.RequestUserInfoWithUI="mc_request_user_info",t.Disconnect="mc_disconnect",t.RecoverAccount="magic_auth_recover_account",t.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",t.MagicBoxHeartBeat="magic_box_heart_beat",t.AutoConnect="mc_auto_connect",t.Login="mc_login",t.EncryptV1="magic_auth_encrypt_v1",t.DecryptV1="magic_auth_decrypt_v1",t.ShowNFTs="magic_show_nfts",t.ShowOnRamp="magic_show_fiat_onramp",t.ShowSendTokensUI="magic_show_send_tokens_ui",t.ShowAddress="magic_show_address",t.ShowBalances="magic_show_balances",t.SendGaslessTransaction="eth_sendGaslessTransaction",t))(yr||{}),Zd=(t=>(t.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",t.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",t.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",t.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",t.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",t.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",t))(Zd||{}),Ib=(t=>(t.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",t))(Ib||{}),Wee=(t=>(t.UpdateEmail="update-email",t.MFA="mfa",t.Recovery="recovery",t))(Wee||{}),Yee=(t=>(t.Retry="retry",t))(Yee||{}),Qee=(t=>(t.EmailSent="email-sent",t.EmailNotDeliverable="email-not-deliverable",t))(Qee||{}),c0=(t=>(t.VerifyEmailOtp="verify-email-otp",t.Cancel="cancel",t))(c0||{}),Jee=(t=>(t.EmailOTPSent="email-otp-sent",t.InvalidEmailOtp="invalid-email-otp",t.ExpiredEmailOtp="expired-email-otp",t))(Jee||{}),wx=(t=>(t.Retry="device-retry",t))(wx||{}),Xee=(t=>(t.DeviceApproved="device-approved",t.DeviceNeedsApproval="device-needs-approval",t.DeviceVerificationLinkExpired="device-verification-link-expired",t.DeviceVerificationEmailSent="device-verification-email-sent",t))(Xee||{}),Zee=(t=>(t.Harmony="HARMONY",t))(Zee||{}),ete=(t=>(t.PhoneNumber="phone_number",t))(ete||{}),RRe=Object.create,EA=Object.defineProperty,NRe=Object.defineProperties,DRe=Object.getOwnPropertyDescriptor,MRe=Object.getOwnPropertyDescriptors,kRe=Object.getOwnPropertyNames,Rz=Object.getOwnPropertySymbols,$Re=Object.getPrototypeOf,tte=Object.prototype.hasOwnProperty,LRe=Object.prototype.propertyIsEnumerable,Nz=(t,e,r)=>e in t?EA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kD=(t,e)=>{for(var r in e||(e={}))tte.call(e,r)&&Nz(t,r,e[r]);if(Rz)for(var r of Rz(e))LRe.call(e,r)&&Nz(t,r,e[r]);return t},rte=(t,e)=>NRe(t,MRe(e)),URe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jRe=(t,e)=>{for(var r in e)EA(t,r,{get:e[r],enumerable:!0})},BRe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kRe(e))!tte.call(t,i)&&i!==r&&EA(t,i,{get:()=>e[i],enumerable:!(n=DRe(e,i))||n.enumerable});return t},FRe=(t,e,r)=>(r=t!=null?RRe($Re(t)):{},BRe(e||!t||!t.__esModule?EA(r,"default",{value:t,enumerable:!0}):r,t)),Ti=(t,e,r)=>new Promise((n,i)=>{var s=c=>{try{o(r.next(c))}catch(u){i(u)}},a=c=>{try{o(r.throw(c))}catch(u){i(u)}},o=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);o((r=r.apply(t,e)).next())}),qRe=URe((t,e)=>{var r=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function s(u,f,h){this.fn=u,this.context=f,this.once=h||!1}function a(u,f,h,m,y){if(typeof h!="function")throw new TypeError("The listener must be a function");var w=new s(h,m||u,y),v=n?n+f:f;return u._events[v]?u._events[v].fn?u._events[v]=[u._events[v],w]:u._events[v].push(w):(u._events[v]=w,u._eventsCount++),u}function o(u,f){--u._eventsCount===0?u._events=new i:delete u._events[f]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)r.call(f,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},c.prototype.listeners=function(u){var f=n?n+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,y=h.length,w=new Array(y);m<y;m++)w[m]=h[m].fn;return w},c.prototype.listenerCount=function(u){var f=n?n+u:u,h=this._events[f];return h?h.fn?1:h.length:0},c.prototype.emit=function(u,f,h,m,y,w){var v=n?n+u:u;if(!this._events[v])return!1;var g=this._events[v],_=arguments.length,b,S;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),_){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,f),!0;case 3:return g.fn.call(g.context,f,h),!0;case 4:return g.fn.call(g.context,f,h,m),!0;case 5:return g.fn.call(g.context,f,h,m,y),!0;case 6:return g.fn.call(g.context,f,h,m,y,w),!0}for(S=1,b=new Array(_-1);S<_;S++)b[S-1]=arguments[S];g.fn.apply(g.context,b)}else{var A=g.length,O;for(S=0;S<A;S++)switch(g[S].once&&this.removeListener(u,g[S].fn,void 0,!0),_){case 1:g[S].fn.call(g[S].context);break;case 2:g[S].fn.call(g[S].context,f);break;case 3:g[S].fn.call(g[S].context,f,h);break;case 4:g[S].fn.call(g[S].context,f,h,m);break;default:if(!b)for(O=1,b=new Array(_-1);O<_;O++)b[O-1]=arguments[O];g[S].fn.apply(g[S].context,b)}}return!0},c.prototype.on=function(u,f,h){return a(this,u,f,h,!1)},c.prototype.once=function(u,f,h){return a(this,u,f,h,!0)},c.prototype.removeListener=function(u,f,h,m){var y=n?n+u:u;if(!this._events[y])return this;if(!f)return o(this,y),this;var w=this._events[y];if(w.fn)w.fn===f&&(!m||w.once)&&(!h||w.context===h)&&o(this,y);else{for(var v=0,g=[],_=w.length;v<_;v++)(w[v].fn!==f||m&&!w[v].once||h&&w[v].context!==h)&&g.push(w[v]);g.length?this._events[y]=g.length===1?g[0]:g:o(this,y)}return this},c.prototype.removeAllListeners=function(u){var f;return u?(f=n?n+u:u,this._events[f]&&o(this,f)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,typeof e<"u"&&(e.exports=c)});function HRe(t){let e={exports:{}};return t(e,e.exports),e.exports}var zRe=Number.MAX_SAFE_INTEGER||9007199254740991,$D={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:zRe,MAX_SAFE_COMPONENT_LENGTH:16},VRe=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{},Pn=VRe,B1=HRe(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r}=$D,n=(e=t.exports={}).re=[],i=e.src=[],s=e.t={},a=0,o=(c,u,f)=>{let h=a++;Pn(h,u),s[c]=h,i[h]=u,n[h]=new RegExp(u,f?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${i[s.NUMERICIDENTIFIER]}|${i[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${i[s.NUMERICIDENTIFIERLOOSE]}|${i[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${i[s.PRERELEASEIDENTIFIER]}(?:\\.${i[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${i[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${i[s.BUILDIDENTIFIER]}(?:\\.${i[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${i[s.MAINVERSION]}${i[s.PRERELEASE]}?${i[s.BUILD]}?`),o("FULL",`^${i[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${i[s.MAINVERSIONLOOSE]}${i[s.PRERELEASELOOSE]}?${i[s.BUILD]}?`),o("LOOSE",`^${i[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${i[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${i[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:${i[s.PRERELEASE]})?${i[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:${i[s.PRERELEASELOOSE]})?${i[s.BUILD]}?)?)?`),o("XRANGE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",i[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${i[s.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",o("TILDE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${i[s.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",o("CARET",`^${i[s.LONECARET]}${i[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${i[s.LONECARET]}${i[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${i[s.GTLT]}\\s*(${i[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]}|${i[s.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${i[s.XRANGEPLAIN]})\\s+-\\s+(${i[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${i[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Dz=/^[0-9]+$/,nte=(t,e)=>{let r=Dz.test(t),n=Dz.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},GRe=(t,e)=>nte(e,t),KRe={compareIdentifiers:nte,rcompareIdentifiers:GRe},{MAX_LENGTH:Mz,MAX_SAFE_INTEGER:p_}=$D,{re:kz,t:$z}=B1,{compareIdentifiers:By}=KRe,is=class{constructor(t,e){if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof is){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid Version: ${t}`);if(t.length>Mz)throw new TypeError(`version is longer than ${Mz} characters`);Pn("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;let r=t.trim().match(e.loose?kz[$z.LOOSE]:kz[$z.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>p_||this.major<0)throw new TypeError("Invalid major version");if(this.minor>p_||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>p_||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<p_)return i}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Pn("SemVer.compare",this.version,this.options,t),!(t instanceof is)){if(typeof t=="string"&&t===this.version)return 0;t=new is(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof is||(t=new is(t,this.options)),By(this.major,t.major)||By(this.minor,t.minor)||By(this.patch,t.patch)}comparePre(t){if(t instanceof is||(t=new is(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let e=0;do{let r=this.prerelease[e],n=t.prerelease[e];if(Pn("prerelease compare",e,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return By(r,n)}while(++e)}compareBuild(t){t instanceof is||(t=new is(t,this.options));let e=0;do{let r=this.build[e],n=t.build[e];if(Pn("prerelease compare",e,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return By(r,n)}while(++e)}inc(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",e),this.inc("pre",e);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}},WRe=(t,e,r)=>new is(t,r).compare(new is(e,r)),vm=WRe,YRe=(t,e,r)=>vm(t,e,r)===0,QRe=YRe,JRe=(t,e,r)=>vm(t,e,r)!==0,XRe=JRe,ZRe=(t,e,r)=>vm(t,e,r)>0,eNe=ZRe,tNe=(t,e,r)=>vm(t,e,r)>=0,rNe=tNe,nNe=(t,e,r)=>vm(t,e,r)<0,iNe=nNe,sNe=(t,e,r)=>vm(t,e,r)<=0,aNe=sNe,oNe=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return QRe(t,r,n);case"!=":return XRe(t,r,n);case">":return eNe(t,r,n);case">=":return rNe(t,r,n);case"<":return iNe(t,r,n);case"<=":return aNe(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},SC=oNe,Fy=Symbol("SemVer ANY"),Pb=class{static get ANY(){return Fy}constructor(e,r){if(r&&typeof r=="object"||(r={loose:!!r,includePrerelease:!1}),e instanceof Pb){if(e.loose===!!r.loose)return e;e=e.value}Pn("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Fy?this.value="":this.value=this.operator+this.semver.version,Pn("comp",this)}parse(e){let r=this.options.loose?Lz[Uz.COMPARATORLOOSE]:Lz[Uz.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new is(n[2],this.options.loose):this.semver=Fy}toString(){return this.value}test(e){if(Pn("Comparator.test",e,this.options.loose),this.semver===Fy||e===Fy)return!0;if(typeof e=="string")try{e=new is(e,this.options)}catch{return!1}return SC(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof Pb))throw new TypeError("a Comparator is required");if(r&&typeof r=="object"||(r={loose:!!r,includePrerelease:!1}),this.operator==="")return this.value===""||new N0(e.value,r).test(this.value);if(e.operator==="")return e.value===""||new N0(this.value,r).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,a=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),o=SC(this.semver,"<",e.semver,r)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=SC(this.semver,">",e.semver,r)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||i||s&&a||o||c}},{re:Lz,t:Uz}=B1,N0=class{constructor(t,e){if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof N0)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new N0(t.raw,e);if(t instanceof Pb)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let{loose:e}=this.options;t=t.trim();let r=e?Ps[as.HYPHENRANGELOOSE]:Ps[as.HYPHENRANGE];t=t.replace(r,wNe(this.options.includePrerelease)),Pn("hyphen replace",t),t=t.replace(Ps[as.COMPARATORTRIM],cNe),Pn("comparator trim",t,Ps[as.COMPARATORTRIM]),t=(t=(t=t.replace(Ps[as.TILDETRIM],uNe)).replace(Ps[as.CARETTRIM],lNe)).split(/\s+/).join(" ");let n=e?Ps[as.COMPARATORLOOSE]:Ps[as.COMPARATOR];return t.split(" ").map(i=>fNe(i,this.options)).join(" ").split(/\s+/).map(i=>bNe(i,this.options)).filter(this.options.loose?i=>!!i.match(n):()=>!0).map(i=>new Pb(i,this.options))}intersects(t,e){if(!(t instanceof N0))throw new TypeError("a Range is required");return this.set.some(r=>jz(r,e)&&t.set.some(n=>jz(n,e)&&r.every(i=>n.every(s=>i.intersects(s,e)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new is(t,this.options)}catch{return!1}for(let e=0;e<this.set.length;e++)if(_Ne(this.set[e],t,this.options))return!0;return!1}},{re:Ps,t:as,comparatorTrimReplace:cNe,tildeTrimReplace:uNe,caretTrimReplace:lNe}=B1,jz=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,e)),i=n.pop();return r},fNe=(t,e)=>(Pn("comp",t,e),t=pNe(t,e),Pn("caret",t),t=dNe(t,e),Pn("tildes",t),t=mNe(t,e),Pn("xrange",t),t=vNe(t,e),Pn("stars",t),t),Ks=t=>!t||t.toLowerCase()==="x"||t==="*",dNe=(t,e)=>t.trim().split(/\s+/).map(r=>hNe(r,e)).join(" "),hNe=(t,e)=>{let r=e.loose?Ps[as.TILDELOOSE]:Ps[as.TILDE];return t.replace(r,(n,i,s,a,o)=>{let c;return Pn("tilde",t,n,i,s,a,o),Ks(i)?c="":Ks(s)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:Ks(a)?c=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:o?(Pn("replaceTilde pr",o),c=`>=${i}.${s}.${a}-${o} <${i}.${+s+1}.0-0`):c=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`,Pn("tilde return",c),c})},pNe=(t,e)=>t.trim().split(/\s+/).map(r=>gNe(r,e)).join(" "),gNe=(t,e)=>{Pn("caret",t,e);let r=e.loose?Ps[as.CARETLOOSE]:Ps[as.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,s,a,o,c)=>{let u;return Pn("caret",t,i,s,a,o,c),Ks(s)?u="":Ks(a)?u=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ks(o)?u=s==="0"?`>=${s}.${a}.0${n} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${n} <${+s+1}.0.0-0`:c?(Pn("replaceCaret pr",c),u=s==="0"?a==="0"?`>=${s}.${a}.${o}-${c} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${c} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${c} <${+s+1}.0.0-0`):(Pn("no pr"),u=s==="0"?a==="0"?`>=${s}.${a}.${o}${n} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${n} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),Pn("caret return",u),u})},mNe=(t,e)=>(Pn("replaceXRanges",t,e),t.split(/\s+/).map(r=>yNe(r,e)).join(" ")),yNe=(t,e)=>{t=t.trim();let r=e.loose?Ps[as.XRANGELOOSE]:Ps[as.XRANGE];return t.replace(r,(n,i,s,a,o,c)=>{Pn("xRange",t,n,i,s,a,o,c);let u=Ks(s),f=u||Ks(a),h=f||Ks(o),m=h;return i==="="&&m&&(i=""),c=e.includePrerelease?"-0":"",u?n=i===">"||i==="<"?"<0.0.0-0":"*":i&&m?(f&&(a=0),o=0,i===">"?(i=">=",f?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",f?s=+s+1:a=+a+1),i==="<"&&(c="-0"),n=`${i+s}.${a}.${o}${c}`):f?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${a}.0${c} <${s}.${+a+1}.0-0`),Pn("xRange return",n),n})},vNe=(t,e)=>(Pn("replaceStars",t,e),t.trim().replace(Ps[as.STAR],"")),bNe=(t,e)=>(Pn("replaceGTE0",t,e),t.trim().replace(Ps[e.includePrerelease?as.GTE0PRE:as.GTE0],"")),wNe=t=>(e,r,n,i,s,a,o,c,u,f,h,m,y)=>`${r=Ks(n)?"":Ks(i)?`>=${n}.0.0${t?"-0":""}`:Ks(s)?`>=${n}.${i}.0${t?"-0":""}`:a?`>=${r}`:`>=${r}${t?"-0":""}`} ${c=Ks(u)?"":Ks(f)?`<${+u+1}.0.0-0`:Ks(h)?`<${u}.${+f+1}.0-0`:m?`<=${u}.${f}.${h}-${m}`:t?`<${u}.${f}.${+h+1}-0`:`<=${c}`}`.trim(),_Ne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Pn(t[n].semver),t[n].semver!==Pb.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0},ENe=(t,e,r)=>{try{e=new N0(e,r)}catch{return!1}return e.test(t)},{MAX_LENGTH:xNe}=$D,{re:Bz,t:Fz}=B1,ANe=(t,e)=>{if(e&&typeof e=="object"||(e={loose:!!e,includePrerelease:!1}),t instanceof is)return t;if(typeof t!="string"||t.length>xNe||!(e.loose?Bz[Fz.LOOSE]:Bz[Fz.FULL]).test(t))return null;try{return new is(t,e)}catch{return null}},SNe=ANe,{re:g_,t:m_}=B1,ONe=(t,e)=>{if(t instanceof is)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;let r=null;if((e=e||{}).rtl){let n;for(;(n=g_[m_.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),g_[m_.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;g_[m_.COERCERTL].lastIndex=-1}else r=t.match(g_[m_.COERCE]);return r===null?null:SNe(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};function INe(t){return String.fromCharCode(parseInt(t.slice(1),16))}function PNe(t){return`%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`}function TNe(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,INe))}function CNe(t){return decodeURIComponent(Array.from(atob(t),PNe).join(""))}function ite(t){return TNe(JSON.stringify(t))}function RNe(t){return JSON.parse(CNe(t))}function vv(t){return typeof t>"u"}function NNe(t){return t===null}function ste(t){return NNe(t)||vv(t)}function DNe(t){return ste(t)?!1:!vv(t.jsonrpc)&&!vv(t.id)&&(!vv(t.result)||!vv(t.error))}function MNe(t){return ste(t)?!1:typeof t=="number"&&Object.values(_A).includes(t)}function _x(t){if(!t)return!0;for(let e in t)if(Object.hasOwnProperty.call(t,e))return!1;return!0}var Fn={};function kNe(t,e){return Object.assign(Fn,e),t}var $Ne={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},nd=class extends Error{constructor(e,r){super(`Magic SDK Error: [${e}] ${r}`),this.code=e,this.rawMessage=r,this.__proto__=Error,Object.setPrototypeOf(this,nd.prototype)}},Tb=class extends Error{constructor(e){super(),this.__proto__=Error;let r=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=MNe(r)?r:_A.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,Tb.prototype)}},F1=class{constructor(t,e){this.code=t,this.rawMessage=e,this.message=`Magic SDK Warning: [${t}] ${e}`}log(){console.warn(this.message)}},LD=class extends Error{constructor(t,e,r,n){super(`Magic Extension Error (${t.name}): [${e}] ${r}`),this.code=e,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,LD.prototype)}},F6=class{constructor(t,e,r){this.code=e,this.rawMessage=r,this.message=`Magic Extension Warning (${t.name}): [${e}] ${r}`}log(){console.warn(this.message)}};function LNe(){return new nd(rd.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function ate(){return new nd(rd.ModalNotReady,"Modal is not ready.")}function UNe(){return new nd(rd.MalformedResponse,"Response from the Magic iframe is malformed.")}function jNe(t){return new nd(rd.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${t}\` can be accessed. Do not invoke \`Extension.${t}\` inside an extension constructor.`)}function BNe(t){let e=`Some extensions are incompatible with \`${Fn.sdkName}@${Fn.version}\`:`;return t.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let n=r.compat[Fn.sdkName];typeof n=="string"?e+=`
159
- - Extension \`${r.name}\` supports version(s) \`${n}\``:n||(e+=`
160
- - Extension \`${r.name}\` does not support ${Fn.platform} environments.`)}),new nd(rd.IncompatibleExtensions,e)}function FNe(t){let e=r=>{let n=r+1,i=n%10,s=n%100;return i===1&&s!==11?`${n}st`:i===2&&s!==12?`${n}nd`:i===3&&s!==13?`${n}rd`:`${n}th`};return new nd(rd.InvalidArgument,`Invalid ${e(t.argument)} argument given to \`${t.procedure}\`.
161
- Expected: \`${t.expected}\`
162
- Received: \`${t.received}\``)}function qNe(){return new F1(ym.DuplicateIframe,"Duplicate iframes found.")}function HNe(){return new F1(ym.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function zNe(){return new F1(ym.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${Fn.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function D0(t){let{method:e,removalVersions:r,useInstead:n}=t,i=r[Fn.sdkName],s=n?` Use \`${n}\` instead.`:"",a=`\`${e}\` will be removed from \`${Fn.sdkName}\` in version \`${i}\`.${s}`;return new F1(ym.DeprecationNotice,a)}function*VNe(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var GNe=VNe();function ote(){return GNe.next().value}var cte=Symbol("Payload pre-processed by Magic SDK");function ute(t){return Object.defineProperty(t,cte,{value:!0,enumerable:!1}),t}function KNe(t){return!!t[cte]}function Ex(t){var e,r,n;return KNe(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=ote(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],ute(t)),t}function tn(t,e=[]){return ute({params:e,method:t,jsonrpc:"2.0",id:ote()})}var UD=class{constructor(t){t instanceof UD?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):DNe(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}applyError(t){return this._error=t,this}applyResult(t){return this._result=t,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},WNe=FRe(qRe()),YNe=class extends WNe.default{};function lte(){let t=new YNe;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var fte=Symbol("isPromiEvent");function dte(t){return!!t[fte]}function jD(t){let e=hte(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=lte(),i=Symbol("Promise.then"),s=Symbol("Promise.catch"),a=Symbol("Promise.finally"),o=(f,h)=>(...m)=>{let y=h[f].apply(h,m);return c(y)},c=f=>Object.assign(f,{[fte]:!0,[i]:f[i]||f.then,[s]:f[s]||f.catch,[a]:f[a]||f.finally,then:o(i,f),catch:o(s,f),finally:o(a,f),on:n("on",f),once:n("once",f),addListener:n("addListener",f),off:n("off",f),removeListener:n("removeListener",f),removeAllListeners:n("removeAllListeners",f),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),u=c(e.then(f=>(u.emit("done",f),u.emit("settled"),f),f=>{throw u.emit("error",f),u.emit("settled"),f}));return u}function hte(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Zh=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(Ib.MAGIC_HANDLE_REQUEST,Ex(t)),r=jD((i,s)=>{e.then(a=>{if(n(),a.hasError)s(new Tb(a.payload.error));else if(a.hasResult)i(a.payload.result);else throw UNe()}).catch(a=>{n(),s(a)})}),n=this.overlay.on(Zd.MAGIC_HANDLE_EVENT,i=>{var s;let{response:a}=i.data;if(a.id===t.id&&((s=a.result)!=null&&s.event)){let{event:o,params:c=[]}=a.result;r.emit(o,...c)}});return r}createIntermediaryEvent(t,e){return r=>{let n=tn(yr.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function QNe(t,e){let[r]=t.split(".").map(Number);return r>=e}var M0={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},JNe=class extends Zh{loginWithMagicLink(t){let e=Fn.sdkName==="@magic-sdk/react-native"||Fn.sdkName==="@magic-sdk/react-native-bare"||Fn.sdkName==="@magic-sdk/react-native-expo";if(e&&QNe(Fn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&D0({method:"auth.loginWithMagicLink()",removalVersions:M0,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:s}=t,a=tn(this.sdk.testMode?yr.LoginWithMagicLinkTestMode:yr.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:s}]);return this.request(a)}loginWithSMS(t){let{phoneNumber:e}=t,r=tn(this.sdk.testMode?yr.LoginWithSmsTestMode:yr.LoginWithSms,[{phoneNumber:e,showUI:!0}]);return this.request(r)}loginWithEmailOTP(t){let{email:e,showUI:r,deviceCheckUI:n,overrides:i}=t,s=tn(this.sdk.testMode?yr.LoginWithEmailOTPTestMode:yr.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),a=this.request(s);return!n&&a&&a.on(wx.Retry,()=>{this.createIntermediaryEvent(wx.Retry,s.id)()}),!r&&a&&(a.on(c0.VerifyEmailOtp,o=>{this.createIntermediaryEvent(c0.VerifyEmailOtp,s.id)(o)}),a.on(c0.Cancel,()=>{this.createIntermediaryEvent(c0.Cancel,s.id)()})),a}loginWithCredential(t){let e=t??"";if(!t&&Fn.platform==="web"){e=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=tn(this.sdk.testMode?yr.LoginWithCredentialTestMode:yr.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=tn(yr.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=tn(this.sdk.testMode?yr.UpdateEmailTestMode:yr.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},pte={};jRe(pte,{clear:()=>XNe,getItem:()=>xa,iterate:()=>gte,key:()=>e6e,keys:()=>t6e,length:()=>ZNe,removeItem:()=>xA,setItem:()=>ll});var y_;function id(t){return(...e)=>Ti(this,null,function*(){return y_||(y_=yield Fn.configureStorage()),yield y_.ready(),y_[t](...e)})}var xa=id("getItem"),ll=id("setItem"),xA=id("removeItem"),XNe=id("clear"),ZNe=id("length"),e6e=id("key"),t6e=id("keys"),gte=id("iterate");function r6e(){let t=window.crypto.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&191|128;let e="";return e+=t[0].toString(16),e+=t[1].toString(16),e+=t[2].toString(16),e+=t[3].toString(16),e+="-",e+=t[4].toString(16),e+=t[5].toString(16),e+="-",e+=t[6].toString(16),e+=t[7].toString(16),e+="-",e+=t[8].toString(16),e+=t[9].toString(16),e+="-",e+=t[10].toString(16),e+=t[11].toString(16),e+=t[12].toString(16),e+=t[13].toString(16),e+=t[14].toString(16),e+=t[15].toString(16),e}var mte="STORE_KEY_PRIVATE_KEY",q6="STORE_KEY_PUBLIC_JWK",yte="ECDSA",n6e="P-256",i6e={name:yte,namedCurve:n6e};function AA(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function s6e(){return Ti(this,null,function*(){let t=yield a6e();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield xa(mte);if(!r||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:r6e()},i={typ:"dpop+jwt",alg:"ES256",jwk:t},s={protected:qz(JSON.stringify(i)),claims:qz(JSON.stringify(n))},a=c6e(`${s.protected}.${s.claims}`),o={name:yte,hash:{name:"SHA-256"}},c=l6e(new Uint8Array(yield e.sign(o,r,a)));return`${s.protected}.${s.claims}.${c}`})}function a6e(){return Ti(this,null,function*(){if(!AA()){console.info("webcrypto is not supported");return}return(yield xa(q6))||(yield o6e()),xa(q6)})}function o6e(){return Ti(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(i6e,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield ll(mte,e.privateKey),yield ll(q6,r)})}function qz(t){return vte(u6e(t))}function c6e(t){return new TextEncoder().encode(t)}function vte(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function u6e(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function l6e(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),vte(e)}var BD="ds",FD="ek",qD="iv",HD="AES-GCM",f6e=256;function zD(){return Ti(this,null,function*(){let t=[];yield gte((e,r,n)=>{r.startsWith(`${BD}_`)&&t.push(r)});for(let e of t)yield xA(e)})}function bte(t){let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return window.btoa(e)}function wte(t){let e=window.atob(t),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}function d6e(){return Ti(this,null,function*(){if(!AA()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield xa(qD))||t.getRandomValues(new Uint8Array(12))})}function h6e(){return Ti(this,null,function*(){if(!AA()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield xa(FD))||(yield t.generateKey({name:HD,length:f6e},!1,["encrypt","decrypt"]))})}function p6e(t,e){return Ti(this,null,function*(){let r=yield d6e(),n=yield h6e();if(!r||!n||!t)return;let i=wte(t),{subtle:s}=window.crypto,a=yield s.encrypt({name:HD,iv:r},n,i),o=bte(a);yield ll(`${BD}_${e}`,o),yield ll(FD,n),yield ll(qD,r)})}function g6e(t){return Ti(this,null,function*(){let e=yield xa(`${BD}_${t}`),r=yield xa(qD),n=yield xa(FD);if(!r||!e||!n||!AA())return;let{subtle:i}=window.crypto,s=yield i.decrypt({name:HD,iv:r},n,wte(e));return bte(s)})}var m6e=class extends Zh{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=tn(this.sdk.testMode?yr.GetIdTokenTestMode:yr.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=tn(this.sdk.testMode?yr.GenerateIdTokenTestMode:yr.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ti(this,null,function*(){let e=yield xa(this.localForageKey),r=tn(yr.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=tn(this.sdk.testMode?yr.IsLoggedInTestMode:yr.IsLoggedIn);return this.request(e)}logout(){xA(this.localForageKey),zD();let e=tn(this.sdk.testMode?yr.LogoutTestMode:yr.Logout);return this.request(e)}requestInfoWithUI(e){let r=tn(yr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=tn(this.sdk.testMode?yr.UserSettingsTestMode:yr.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=tn(this.sdk.testMode?yr.RecoverAccountTestMode:yr.RecoverAccount,[e]);return this.request(r)}getMetadata(){D0({method:"user.getMetadata()",removalVersions:M0,useInstead:"user.getInfo()"}).log();let e=tn(this.sdk.testMode?yr.GetMetadataTestMode:yr.GetMetadata);return this.request(e)}updateEmail(e){D0({method:"user.updateEmail()",removalVersions:M0,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=tn(this.sdk.testMode?yr.UpdateEmailTestMode:yr.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function xx(t,e){return e?new URL(t,e):new URL(t)}var y6e=class extends Zh{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=jD((r,n)=>Ti(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(fo.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(fo.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(fo.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(fo.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),s=tn(yr.Login,[i]),a=this.request(s);a.on(Hv.WalletSelected,c=>this.handleWalletSelected(rte(kD({},c),{payloadId:s.id}))),a.on("id-token-created",c=>{e.emit("id-token-created",c)});let o=yield a;o.error&&n(o),r(o)}catch(i){n(i)}}));return e}showUI(){return this.request(tn(yr.ShowUI))}showAddress(){return this.request(tn(yr.ShowAddress))}showSendTokensUI(){return this.request(tn(yr.ShowSendTokensUI))}showOnRamp(){return this.request(tn(yr.ShowOnRamp))}showNFTs(){return this.request(tn(yr.ShowNFTs))}showBalances(){return this.request(tn(yr.ShowBalances))}sendGaslessTransaction(e,r){return this.request(tn(yr.SendGaslessTransaction,[e,r]))}getInfo(){return Ti(this,null,function*(){D0({method:"wallet.getInfo()",removalVersions:M0,useInstead:"user.getInfo()"}).log();let e=yield xa(this.localForageKey),r=tn(yr.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){D0({method:"wallet.disconnect()",removalVersions:M0,useInstead:"user.logout()"}).log(),xA(this.localForageKey),zD();let e=tn(yr.Disconnect);return this.request(e)}requestUserInfoWithUI(e){D0({method:"wallet.requestUserInfoWithUI()",removalVersions:M0,useInstead:"user.requestUserInfoWithUI()"}).log();let r=tn(yr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ti(this,null,function*(){switch(yield xa(this.localForageKey)){case fo.MetaMask:return this.getMetaMaskProvider();case fo.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case fo.MetaMask:return this.connectToMetaMask();case fo.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let r=tn("mc_is_wallet_enabled",[{wallet:e}]);return this.request(r)}handleWalletSelected(e){return Ti(this,null,function*(){try{let r=yield this.connectToThirdPartyWallet(e.wallet);yield ll(this.localForageKey,e.wallet),this.createIntermediaryEvent(Hv.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Hv.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ti(this,null,function*(){let r;e===fo.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===fo.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield ll(this.localForageKey,e);let n=tn(yr.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:v_,createChainingEmitterMethod:$p}=lte(),v6e=class extends Zh{constructor(){super(...arguments),this.isMagic=!0,this.on=$p("on",this),this.once=$p("once",this),this.addListener=$p("addListener",this),this.off=$p("off",this),this.removeListener=$p("removeListener",this),this.removeAllListeners=$p("removeAllListeners",this),this.emit=v_("emit"),this.eventNames=v_("eventNames"),this.listeners=v_("listeners"),this.listenerCount=v_("listenerCount")}sendAsync(t,e){if(!e)throw FNe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(Ib.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=Ex(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>rte(kD({},n.payload),{error:n.hasError?new Tb(n.payload.error):null})))});else{let r=Ex(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(Ib.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new Tb(n.payload.error):null,n.payload)})}}send(t,e){if(typeof t=="string"){let n=tn(t,Array.isArray(e)?e:[]);return this.request(n)}if(Array.isArray(t)||e){this.sendAsync(t,e);return}let r=HNe();return r.log(),new UD(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=tn(yr.Login);return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let e="testMode/eth/";this.sdk.testMode&&(t.method=`${e}${t.method}`)}},Hz=["request","overlay","sdk"];function b6e(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Zh.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var _te=class extends Zh{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:jD,isPromiEvent:dte,encodeJSON:ite,decodeJSON:RNe,createJsonRpcRequestPayload:tn,standardizeJsonRpcRequestPayload:Ex,storage:pte};let t=[this,...b6e(this)];Hz.forEach(e=>{let r=t.map(a=>Object.getOwnPropertyDescriptor(a,e)),n=r.findIndex(a=>!!a),i=n>0,s=r[n];s&&(this.__sdk_access_field_descriptors__.set(e,{descriptor:s,isPrototypeField:i}),Object.defineProperty(this,e,{configurable:!0,get:()=>{throw jNe(e)}}))})}init(t){this.__is_initialized__||(Hz.forEach(e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,r)}}),this.sdk=t,this.__is_initialized__=!0)}createDeprecationWarning(t){let{method:e,removalVersion:r,useInstead:n}=t,i=n?` Use \`${n}\` instead.`:"",s=`\`${e}\` will be removed from this Extension in version \`${r}\`.${i}`;return new F6(this,"DEPRECATION_NOTICE",s)}createWarning(t,e){return new F6(this,t,e)}createError(t,e,r){return new LD(this,t,e,r)}},w6e=class extends _te{},Sh=class extends _te{};Sh.Internal=w6e,Sh.Anonymous="anonymous extension";var _6e=class extends Zh{purchase(t){let e=tn(yr.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=tn(yr.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=tn(yr.NFTTransfer,[t]);return this.request(e)}};function zz(t){return t.compat&&t.compat[Fn.sdkName]!=null?typeof t.compat[Fn.sdkName]=="string"?ENe(ONe(Fn.version),t.compat[Fn.sdkName]):!!t.compat[Fn.sdkName]:!0}function E6e(t,e,r){return!e&&!r?`${t}_eth_mainnet`:r?`${t}_${JSON.stringify(r)}`:e?typeof e=="string"?`${t}_eth_${e}`:`${t}_${e.rpcUrl}_${e.chainId}_${e.chainType}`:`${t}_unknown`}function x6e(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(s=>{zz(s)?(s.init(this),(s.name||s.name!==Sh.Anonymous)&&(this[s.name]=s),s instanceof Sh.Internal&&(_x(s.config)||(n[s.name]=s.config))):i.push(s)}):Object.keys(r).forEach(s=>{if(zz(r[s])){r[s].init(this);let a=r[s];this[s]=a,a instanceof Sh.Internal&&(_x(a.config)||(n[r[s].name]=a.config))}else i.push(r[s])}),i.length)throw BNe(i);return n}var dE=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw LNe();Fn.platform==="react-native"&&(e!=null&&e.endpoint)&&zNe().log();let{defaultEndpoint:n,version:i}=Fn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=xx((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new JNe(this),this.user=new m6e(this),this.wallet=new y6e(this),this.nft=new _6e(this),this.rpcProvider=new v6e(this);let s=x6e.call(this,e);this.parameters=ite(kD({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:xx(this.endpoint).host,sdk:$Ne[Fn.sdkName],version:i,ext:_x(s)?void 0:s,locale:(e==null?void 0:e.locale)||"en_US"},Fn.bundleId?{bundleId:Fn.bundleId}:{})),this.networkHash=E6e(this.apiKey,e==null?void 0:e.network,_x(s)?void 0:s),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!dE.__overlays__.has(this.parameters)){let t=new Fn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),dE.__overlays__.set(this.parameters,t)}return dE.__overlays__.get(this.parameters)}preload(){return Ti(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Ete=dE;Ete.__overlays__=new Map;function A6e(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function S6e(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=A6e(t,n);if(n&&i){let s=new UD(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:s}}return{}}function O6e(t,e,r){return Ti(this,null,function*(){var n;let i=yield xa("rt"),s;if(Fn.platform==="web")try{s=(n=yield xa("jwt"))!=null?n:yield s6e()}catch(c){console.error("webcrypto error",c)}let a={msgType:t,payload:e};s&&(a.jwt=s),s&&i&&(a.rt=i);let o=yield g6e(r);return o&&(a.deviceShare=o),a})}function I6e(t){return Ti(this,null,function*(){!t.data.rt||(yield ll("rt",t.data.rt))})}var P6e=class{constructor(t,e,r){this.endpoint=t,this.parameters=e,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(t,e){return Ti(this,null,function*(){return hte((r,n)=>Ti(this,null,function*(){if(!this.isConnectedToInternet){let u=ate();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],s=Array.isArray(e)?e.map(u=>u.id):[],a=yield O6e(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(a);let o=u=>f=>{var h;let{id:m,response:y}=S6e(e,f);if(I6e(f),((h=y==null?void 0:y.payload.error)==null?void 0:h.message)==="User denied account access.")zD();else if(f.data.deviceShare){let{deviceShare:w}=f.data;p6e(w,this.networkHash)}m&&y&&Array.isArray(e)&&s.includes(m)?(i.push(y),i.length===e.length&&(u(),r(i))):m&&y&&!Array.isArray(e)&&m===e.id&&(u(),r(y))},c=this.on(Zd.MAGIC_HANDLE_RESPONSE,o(()=>c()))}))})}on(t,e){let r=e.bind(window),n=i=>{i.data.msgType===`${t}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(t=>{let e=this.on(Zd.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Zd.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Zd.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},T6e=Object.create,xte=Object.defineProperty,C6e=Object.getOwnPropertyDescriptor,R6e=Object.getOwnPropertyNames,N6e=Object.getPrototypeOf,D6e=Object.prototype.hasOwnProperty,b_=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Ate=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),M6e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of R6e(e))!D6e.call(t,i)&&i!==r&&xte(t,i,{get:()=>e[i],enumerable:!(n=C6e(e,i))||n.enumerable});return t},Ste=(t,e,r)=>(r=t!=null?T6e(N6e(t)):{},M6e(e||!t||!t.__esModule?xte(r,"default",{value:t,enumerable:!0}):r,t)),hE=(t,e,r)=>new Promise((n,i)=>{var s=c=>{try{o(r.next(c))}catch(u){i(u)}},a=c=>{try{o(r.throw(c))}catch(u){i(u)}},o=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);o((r=r.apply(t,e)).next())}),k6e=Ate((t,e)=>{(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){return function r(n,i,s){function a(u,f){if(!i[u]){if(!n[u]){var h=typeof b_=="function"&&b_;if(!f&&h)return h(u,!0);if(o)return o(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var y=i[u]={exports:{}};n[u][0].call(y.exports,function(w){var v=n[u][1][w];return a(v||w)},y,y.exports,r,n,i,s)}return i[u].exports}for(var o=typeof b_=="function"&&b_,c=0;c<s.length;c++)a(s[c]);return a}({1:[function(r,n,i){(function(s){var a=s.MutationObserver||s.WebKitMutationObserver,o;if(a){var c=0,u=new a(w),f=s.document.createTextNode("");u.observe(f,{characterData:!0}),o=function(){f.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var h=new s.MessageChannel;h.port1.onmessage=w,o=function(){h.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?o=function(){var g=s.document.createElement("script");g.onreadystatechange=function(){w(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},s.document.documentElement.appendChild(g)}:o=function(){setTimeout(w,0)};var m,y=[];function w(){m=!0;for(var g,_,b=y.length;b;){for(_=y,y=[],g=-1;++g<b;)_[g]();b=y.length}m=!1}n.exports=v;function v(g){y.push(g)===1&&!m&&o()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var s=r(1);function a(){}var o={},c=["REJECTED"],u=["FULFILLED"],f=["PENDING"];n.exports=h;function h(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,O!==a&&v(this,O)}h.prototype.catch=function(O){return this.then(null,O)},h.prototype.then=function(O,E){if(typeof O!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(a);if(this.state!==f){var I=this.state===u?O:E;y(p,I,this.outcome)}else this.queue.push(new m(p,O,E));return p};function m(O,E,p){this.promise=O,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}m.prototype.callFulfilled=function(O){o.resolve(this.promise,O)},m.prototype.otherCallFulfilled=function(O){y(this.promise,this.onFulfilled,O)},m.prototype.callRejected=function(O){o.reject(this.promise,O)},m.prototype.otherCallRejected=function(O){y(this.promise,this.onRejected,O)};function y(O,E,p){s(function(){var I;try{I=E(p)}catch(N){return o.reject(O,N)}I===O?o.reject(O,new TypeError("Cannot resolve promise with itself")):o.resolve(O,I)})}o.resolve=function(O,E){var p=g(w,E);if(p.status==="error")return o.reject(O,p.value);var I=p.value;if(I)v(O,I);else{O.state=u,O.outcome=E;for(var N=-1,B=O.queue.length;++N<B;)O.queue[N].callFulfilled(E)}return O},o.reject=function(O,E){O.state=c,O.outcome=E;for(var p=-1,I=O.queue.length;++p<I;)O.queue[p].callRejected(E);return O};function w(O){var E=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof E=="function")return function(){E.apply(O,arguments)}}function v(O,E){var p=!1;function I(de){p||(p=!0,o.reject(O,de))}function N(de){p||(p=!0,o.resolve(O,de))}function B(){E(N,I)}var V=g(B);V.status==="error"&&I(V.value)}function g(O,E){var p={};try{p.value=O(E),p.status="success"}catch(I){p.status="error",p.value=I}return p}h.resolve=_;function _(O){return O instanceof this?O:o.resolve(new this(a),O)}h.reject=b;function b(O){var E=new this(a);return o.reject(E,O)}h.all=S;function S(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var N=new Array(p),B=0,V=-1,de=new this(a);++V<p;)ve(O[V],V);return de;function ve(j,L){E.resolve(j).then(Y,function(ne){I||(I=!0,o.reject(de,ne))});function Y(ne){N[L]=ne,++B===p&&!I&&(I=!0,o.resolve(de,N))}}}h.race=A;function A(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var N=-1,B=new this(a);++N<p;)V(O[N]);return B;function V(de){E.resolve(de).then(function(ve){I||(I=!0,o.resolve(B,ve))},function(ve){I||(I=!0,o.reject(B,ve))})}}},{1:1}],3:[function(r,n,i){(function(s){typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function a(X,me){if(!(X instanceof me))throw new TypeError("Cannot call a class as a function")}function o(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=o();function u(){try{if(!c||!c.open)return!1;var X=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),me=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!X||me)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(X,me){X=X||[],me=me||{};try{return new Blob(X,me)}catch(Oe){if(Oe.name!=="TypeError")throw Oe;for(var re=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Ee=new re,be=0;be<X.length;be+=1)Ee.append(X[be]);return Ee.getBlob(me.type)}}typeof Promise>"u"&&r(3);var h=Promise;function m(X,me){me&&X.then(function(re){me(null,re)},function(re){me(re)})}function y(X,me,re){typeof me=="function"&&X.then(me),typeof re=="function"&&X.catch(re)}function w(X){return typeof X!="string"&&(console.warn(X+" used as a key, but it is not a string."),X=String(X)),X}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var g="local-forage-detect-blob-support",_=void 0,b={},S=Object.prototype.toString,A="readonly",O="readwrite";function E(X){for(var me=X.length,re=new ArrayBuffer(me),Ee=new Uint8Array(re),be=0;be<me;be++)Ee[be]=X.charCodeAt(be);return re}function p(X){return new h(function(me){var re=X.transaction(g,O),Ee=f([""]);re.objectStore(g).put(Ee,"key"),re.onabort=function(be){be.preventDefault(),be.stopPropagation(),me(!1)},re.oncomplete=function(){var be=navigator.userAgent.match(/Chrome\/(\d+)/),Oe=navigator.userAgent.match(/Edge\//);me(Oe||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function I(X){return typeof _=="boolean"?h.resolve(_):p(X).then(function(me){return _=me,_})}function N(X){var me=b[X.name],re={};re.promise=new h(function(Ee,be){re.resolve=Ee,re.reject=be}),me.deferredOperations.push(re),me.dbReady?me.dbReady=me.dbReady.then(function(){return re.promise}):me.dbReady=re.promise}function B(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function V(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function de(X,me){return new h(function(re,Ee){if(b[X.name]=b[X.name]||q(),X.db)if(me)N(X),X.db.close();else return re(X.db);var be=[X.name];me&&be.push(X.version);var Oe=c.open.apply(c,be);me&&(Oe.onupgradeneeded=function(Xe){var lt=Oe.result;try{lt.createObjectStore(X.storeName),Xe.oldVersion<=1&&lt.createObjectStore(g)}catch(Qe){if(Qe.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Xe.oldVersion+" to version "+Xe.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Qe}}),Oe.onerror=function(Xe){Xe.preventDefault(),Ee(Oe.error)},Oe.onsuccess=function(){var Xe=Oe.result;Xe.onversionchange=function(lt){lt.target.close()},re(Xe),B(X)}})}function ve(X){return de(X,!1)}function j(X){return de(X,!0)}function L(X,me){if(!X.db)return!0;var re=!X.db.objectStoreNames.contains(X.storeName),Ee=X.version<X.db.version,be=X.version>X.db.version;if(Ee&&(X.version!==me&&console.warn('The database "'+X.name+`" can't be downgraded from version `+X.db.version+" to version "+X.version+"."),X.version=X.db.version),be||re){if(re){var Oe=X.db.version+1;Oe>X.version&&(X.version=Oe)}return!0}return!1}function Y(X){return new h(function(me,re){var Ee=new FileReader;Ee.onerror=re,Ee.onloadend=function(be){var Oe=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Oe,type:X.type})},Ee.readAsBinaryString(X)})}function ne(X){var me=E(atob(X.data));return f([me],{type:X.type})}function U(X){return X&&X.__local_forage_encoded_blob}function F(X){var me=this,re=me._initReady().then(function(){var Ee=b[me._dbInfo.name];if(Ee&&Ee.dbReady)return Ee.dbReady});return y(re,X,X),re}function H(X){N(X);for(var me=b[X.name],re=me.forages,Ee=0;Ee<re.length;Ee++){var be=re[Ee];be._dbInfo.db&&(be._dbInfo.db.close(),be._dbInfo.db=null)}return X.db=null,ve(X).then(function(Oe){return X.db=Oe,L(X)?j(X):Oe}).then(function(Oe){X.db=me.db=Oe;for(var Xe=0;Xe<re.length;Xe++)re[Xe]._dbInfo.db=Oe}).catch(function(Oe){throw V(X,Oe),Oe})}function M(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Oe){if(Ee>0&&(!X.db||Oe.name==="InvalidStateError"||Oe.name==="NotFoundError"))return h.resolve().then(function(){if(!X.db||Oe.name==="NotFoundError"&&!X.db.objectStoreNames.contains(X.storeName)&&X.version<=X.db.version)return X.db&&(X.version=X.db.version+1),j(X)}).then(function(){return H(X).then(function(){M(X,me,re,Ee-1)})}).catch(re);re(Oe)}}function q(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function $(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=X[Ee];var be=b[re.name];be||(be=q(),b[re.name]=be),be.forages.push(me),me._initReady||(me._initReady=me.ready,me.ready=F);var Oe=[];function Xe(){return h.resolve()}for(var lt=0;lt<be.forages.length;lt++){var Qe=be.forages[lt];Qe!==me&&Oe.push(Qe._initReady().catch(Xe))}var Ke=be.forages.slice(0);return h.all(Oe).then(function(){return re.db=be.db,ve(re)}).then(function(ht){return re.db=ht,L(re,me._defaultConfig.version)?j(re):ht}).then(function(ht){re.db=be.db=ht,me._dbInfo=re;for(var zt=0;zt<Ke.length;zt++){var Pr=Ke[zt];Pr!==me&&(Pr._dbInfo.db=re.db,Pr._dbInfo.version=re.version)}})}function k(X,me){var re=this;X=w(X);var Ee=new h(function(be,Oe){re.ready().then(function(){M(re._dbInfo,A,function(Xe,lt){if(Xe)return Oe(Xe);try{var Qe=lt.objectStore(re._dbInfo.storeName),Ke=Qe.get(X);Ke.onsuccess=function(){var ht=Ke.result;ht===void 0&&(ht=null),U(ht)&&(ht=ne(ht)),be(ht)},Ke.onerror=function(){Oe(Ke.error)}}catch(ht){Oe(ht)}})}).catch(Oe)});return m(Ee,me),Ee}function G(X,me){var re=this,Ee=new h(function(be,Oe){re.ready().then(function(){M(re._dbInfo,A,function(Xe,lt){if(Xe)return Oe(Xe);try{var Qe=lt.objectStore(re._dbInfo.storeName),Ke=Qe.openCursor(),ht=1;Ke.onsuccess=function(){var zt=Ke.result;if(zt){var Pr=zt.value;U(Pr)&&(Pr=ne(Pr));var Gr=X(Pr,zt.key,ht++);Gr!==void 0?be(Gr):zt.continue()}else be()},Ke.onerror=function(){Oe(Ke.error)}}catch(zt){Oe(zt)}})}).catch(Oe)});return m(Ee,me),Ee}function pe(X,me,re){var Ee=this;X=w(X);var be=new h(function(Oe,Xe){var lt;Ee.ready().then(function(){return lt=Ee._dbInfo,S.call(me)==="[object Blob]"?I(lt.db).then(function(Qe){return Qe?me:Y(me)}):me}).then(function(Qe){M(Ee._dbInfo,O,function(Ke,ht){if(Ke)return Xe(Ke);try{var zt=ht.objectStore(Ee._dbInfo.storeName);Qe===null&&(Qe=void 0);var Pr=zt.put(Qe,X);ht.oncomplete=function(){Qe===void 0&&(Qe=null),Oe(Qe)},ht.onabort=ht.onerror=function(){var Gr=Pr.error?Pr.error:Pr.transaction.error;Xe(Gr)}}catch(Gr){Xe(Gr)}})}).catch(Xe)});return m(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new h(function(be,Oe){re.ready().then(function(){M(re._dbInfo,O,function(Xe,lt){if(Xe)return Oe(Xe);try{var Qe=lt.objectStore(re._dbInfo.storeName),Ke=Qe.delete(X);lt.oncomplete=function(){be()},lt.onerror=function(){Oe(Ke.error)},lt.onabort=function(){var ht=Ke.error?Ke.error:Ke.transaction.error;Oe(ht)}}catch(ht){Oe(ht)}})}).catch(Oe)});return m(Ee,me),Ee}function te(X){var me=this,re=new h(function(Ee,be){me.ready().then(function(){M(me._dbInfo,O,function(Oe,Xe){if(Oe)return be(Oe);try{var lt=Xe.objectStore(me._dbInfo.storeName),Qe=lt.clear();Xe.oncomplete=function(){Ee()},Xe.onabort=Xe.onerror=function(){var Ke=Qe.error?Qe.error:Qe.transaction.error;be(Ke)}}catch(Ke){be(Ke)}})}).catch(be)});return m(re,X),re}function ce(X){var me=this,re=new h(function(Ee,be){me.ready().then(function(){M(me._dbInfo,A,function(Oe,Xe){if(Oe)return be(Oe);try{var lt=Xe.objectStore(me._dbInfo.storeName),Qe=lt.count();Qe.onsuccess=function(){Ee(Qe.result)},Qe.onerror=function(){be(Qe.error)}}catch(Ke){be(Ke)}})}).catch(be)});return m(re,X),re}function T(X,me){var re=this,Ee=new h(function(be,Oe){if(X<0){be(null);return}re.ready().then(function(){M(re._dbInfo,A,function(Xe,lt){if(Xe)return Oe(Xe);try{var Qe=lt.objectStore(re._dbInfo.storeName),Ke=!1,ht=Qe.openKeyCursor();ht.onsuccess=function(){var zt=ht.result;if(!zt){be(null);return}X===0||Ke?be(zt.key):(Ke=!0,zt.advance(X))},ht.onerror=function(){Oe(ht.error)}}catch(zt){Oe(zt)}})}).catch(Oe)});return m(Ee,me),Ee}function le(X){var me=this,re=new h(function(Ee,be){me.ready().then(function(){M(me._dbInfo,A,function(Oe,Xe){if(Oe)return be(Oe);try{var lt=Xe.objectStore(me._dbInfo.storeName),Qe=lt.openKeyCursor(),Ke=[];Qe.onsuccess=function(){var ht=Qe.result;if(!ht){Ee(Ke);return}Ke.push(ht.key),ht.continue()},Qe.onerror=function(){be(Qe.error)}}catch(ht){be(ht)}})}).catch(be)});return m(re,X),re}function Ge(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;if(!X.name)be=h.reject("Invalid arguments");else{var Oe=X.name===re.name&&Ee._dbInfo.db,Xe=Oe?h.resolve(Ee._dbInfo.db):ve(X).then(function(lt){var Qe=b[X.name],Ke=Qe.forages;Qe.db=lt;for(var ht=0;ht<Ke.length;ht++)Ke[ht]._dbInfo.db=lt;return lt});X.storeName?be=Xe.then(function(lt){if(lt.objectStoreNames.contains(X.storeName)){var Qe=lt.version+1;N(X);var Ke=b[X.name],ht=Ke.forages;lt.close();for(var zt=0;zt<ht.length;zt++){var Pr=ht[zt];Pr._dbInfo.db=null,Pr._dbInfo.version=Qe}var Gr=new h(function(Fr,yn){var qr=c.open(X.name,Qe);qr.onerror=function(P){var D=qr.result;D.close(),yn(P)},qr.onupgradeneeded=function(){var P=qr.result;P.deleteObjectStore(X.storeName)},qr.onsuccess=function(){var P=qr.result;P.close(),Fr(P)}});return Gr.then(function(Fr){Ke.db=Fr;for(var yn=0;yn<ht.length;yn++){var qr=ht[yn];qr._dbInfo.db=Fr,B(qr._dbInfo)}}).catch(function(Fr){throw(V(X,Fr)||h.resolve()).catch(function(){}),Fr})}}):be=Xe.then(function(lt){N(X);var Qe=b[X.name],Ke=Qe.forages;lt.close();for(var ht=0;ht<Ke.length;ht++){var zt=Ke[ht];zt._dbInfo.db=null}var Pr=new h(function(Gr,Fr){var yn=c.deleteDatabase(X.name);yn.onerror=function(){var qr=yn.result;qr&&qr.close(),Fr(yn.error)},yn.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},yn.onsuccess=function(){var qr=yn.result;qr&&qr.close(),Gr(qr)}});return Pr.then(function(Gr){Qe.db=Gr;for(var Fr=0;Fr<Ke.length;Fr++){var yn=Ke[Fr];B(yn._dbInfo)}}).catch(function(Gr){throw(V(X,Gr)||h.resolve()).catch(function(){}),Gr})})}return m(be,me),be}var tt={_driver:"asyncStorage",_initStorage:$,_support:u(),iterate:G,getItem:k,setItem:pe,removeItem:Q,clear:te,length:ce,key:T,keys:le,dropInstance:Ge};function yt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Bt=/^~~local_forage_type~([^~]+)~/,Zt="__lfsc__:",Or=Zt.length,Ct="arbf",Pt="blob",$t="si08",Rt="ui08",Wt="uic8",Ft="si16",Kt="si32",Dt="ur16",Nt="ui32",Vt="fl32",Mt="fl64",ur=Or+Ct.length,rr=Object.prototype.toString;function ar(X){var me=X.length*.75,re=X.length,Ee,be=0,Oe,Xe,lt,Qe;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var Ke=new ArrayBuffer(me),ht=new Uint8Array(Ke);for(Ee=0;Ee<re;Ee+=4)Oe=vt.indexOf(X[Ee]),Xe=vt.indexOf(X[Ee+1]),lt=vt.indexOf(X[Ee+2]),Qe=vt.indexOf(X[Ee+3]),ht[be++]=Oe<<2|Xe>>4,ht[be++]=(Xe&15)<<4|lt>>2,ht[be++]=(lt&3)<<6|Qe&63;return Ke}function ir(X){var me=new Uint8Array(X),re="",Ee;for(Ee=0;Ee<me.length;Ee+=3)re+=vt[me[Ee]>>2],re+=vt[(me[Ee]&3)<<4|me[Ee+1]>>4],re+=vt[(me[Ee+1]&15)<<2|me[Ee+2]>>6],re+=vt[me[Ee+2]&63];return me.length%3===2?re=re.substring(0,re.length-1)+"=":me.length%3===1&&(re=re.substring(0,re.length-2)+"=="),re}function wr(X,me){var re="";if(X&&(re=rr.call(X)),X&&(re==="[object ArrayBuffer]"||X.buffer&&rr.call(X.buffer)==="[object ArrayBuffer]")){var Ee,be=Zt;X instanceof ArrayBuffer?(Ee=X,be+=Ct):(Ee=X.buffer,re==="[object Int8Array]"?be+=$t:re==="[object Uint8Array]"?be+=Rt:re==="[object Uint8ClampedArray]"?be+=Wt:re==="[object Int16Array]"?be+=Ft:re==="[object Uint16Array]"?be+=Dt:re==="[object Int32Array]"?be+=Kt:re==="[object Uint32Array]"?be+=Nt:re==="[object Float32Array]"?be+=Vt:re==="[object Float64Array]"?be+=Mt:me(new Error("Failed to get type for BinaryArray"))),me(be+ir(Ee))}else if(re==="[object Blob]"){var Oe=new FileReader;Oe.onload=function(){var Xe=gt+X.type+"~"+ir(this.result);me(Zt+Pt+Xe)},Oe.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Xe){console.error("Couldn't convert value into a JSON string: ",X),me(null,Xe)}}function An(X){if(X.substring(0,Or)!==Zt)return JSON.parse(X);var me=X.substring(ur),re=X.substring(Or,ur),Ee;if(re===Pt&&Bt.test(me)){var be=me.match(Bt);Ee=be[1],me=me.substring(be[0].length)}var Oe=ar(me);switch(re){case Ct:return Oe;case Pt:return f([Oe],{type:Ee});case $t:return new Int8Array(Oe);case Rt:return new Uint8Array(Oe);case Wt:return new Uint8ClampedArray(Oe);case Ft:return new Int16Array(Oe);case Dt:return new Uint16Array(Oe);case Kt:return new Int32Array(Oe);case Nt:return new Uint32Array(Oe);case Vt:return new Float32Array(Oe);case Mt:return new Float64Array(Oe);default:throw new Error("Unkown type: "+re)}}var rn={serialize:wr,deserialize:An,stringToBuffer:ar,bufferToString:ir};function hi(X,me,re,Ee){X.executeSql("CREATE TABLE IF NOT EXISTS "+me.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],re,Ee)}function $n(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=typeof X[Ee]!="string"?X[Ee].toString():X[Ee];var be=new h(function(Oe,Xe){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(lt){return Xe(lt)}re.db.transaction(function(lt){hi(lt,re,function(){me._dbInfo=re,Oe()},function(Qe,Ke){Xe(Ke)})},Xe)});return re.serializer=rn,be}function Ln(X,me,re,Ee,be,Oe){X.executeSql(re,Ee,be,function(Xe,lt){lt.code===lt.SYNTAX_ERR?Xe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Qe,Ke){Ke.rows.length?Oe(Qe,lt):hi(Qe,me,function(){Qe.executeSql(re,Ee,be,Oe)},Oe)},Oe):Oe(Xe,lt)},Oe)}function ri(X,me){var re=this;X=w(X);var Ee=new h(function(be,Oe){re.ready().then(function(){var Xe=re._dbInfo;Xe.db.transaction(function(lt){Ln(lt,Xe,"SELECT * FROM "+Xe.storeName+" WHERE key = ? LIMIT 1",[X],function(Qe,Ke){var ht=Ke.rows.length?Ke.rows.item(0).value:null;ht&&(ht=Xe.serializer.deserialize(ht)),be(ht)},function(Qe,Ke){Oe(Ke)})})}).catch(Oe)});return m(Ee,me),Ee}function Cr(X,me){var re=this,Ee=new h(function(be,Oe){re.ready().then(function(){var Xe=re._dbInfo;Xe.db.transaction(function(lt){Ln(lt,Xe,"SELECT * FROM "+Xe.storeName,[],function(Qe,Ke){for(var ht=Ke.rows,zt=ht.length,Pr=0;Pr<zt;Pr++){var Gr=ht.item(Pr),Fr=Gr.value;if(Fr&&(Fr=Xe.serializer.deserialize(Fr)),Fr=X(Fr,Gr.key,Pr+1),Fr!==void 0){be(Fr);return}}be()},function(Qe,Ke){Oe(Ke)})})}).catch(Oe)});return m(Ee,me),Ee}function Br(X,me,re,Ee){var be=this;X=w(X);var Oe=new h(function(Xe,lt){be.ready().then(function(){me===void 0&&(me=null);var Qe=me,Ke=be._dbInfo;Ke.serializer.serialize(me,function(ht,zt){zt?lt(zt):Ke.db.transaction(function(Pr){Ln(Pr,Ke,"INSERT OR REPLACE INTO "+Ke.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Xe(Qe)},function(Gr,Fr){lt(Fr)})},function(Pr){if(Pr.code===Pr.QUOTA_ERR){if(Ee>0){Xe(Br.apply(be,[X,Qe,re,Ee-1]));return}lt(Pr)}})})}).catch(lt)});return m(Oe,re),Oe}function Ir(X,me,re){return Br.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new h(function(be,Oe){re.ready().then(function(){var Xe=re._dbInfo;Xe.db.transaction(function(lt){Ln(lt,Xe,"DELETE FROM "+Xe.storeName+" WHERE key = ?",[X],function(){be()},function(Qe,Ke){Oe(Ke)})})}).catch(Oe)});return m(Ee,me),Ee}function ee(X){var me=this,re=new h(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Xe){Ln(Xe,Oe,"DELETE FROM "+Oe.storeName,[],function(){Ee()},function(lt,Qe){be(Qe)})})}).catch(be)});return m(re,X),re}function ye(X){var me=this,re=new h(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Xe){Ln(Xe,Oe,"SELECT COUNT(key) as c FROM "+Oe.storeName,[],function(lt,Qe){var Ke=Qe.rows.item(0).c;Ee(Ke)},function(lt,Qe){be(Qe)})})}).catch(be)});return m(re,X),re}function Re(X,me){var re=this,Ee=new h(function(be,Oe){re.ready().then(function(){var Xe=re._dbInfo;Xe.db.transaction(function(lt){Ln(lt,Xe,"SELECT key FROM "+Xe.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Qe,Ke){var ht=Ke.rows.length?Ke.rows.item(0).key:null;be(ht)},function(Qe,Ke){Oe(Ke)})})}).catch(Oe)});return m(Ee,me),Ee}function ze(X){var me=this,re=new h(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Xe){Ln(Xe,Oe,"SELECT key FROM "+Oe.storeName,[],function(lt,Qe){for(var Ke=[],ht=0;ht<Qe.rows.length;ht++)Ke.push(Qe.rows.item(ht).key);Ee(Ke)},function(lt,Qe){be(Qe)})})}).catch(be)});return m(re,X),re}function Ze(X){return new h(function(me,re){X.transaction(function(Ee){Ee.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(be,Oe){for(var Xe=[],lt=0;lt<Oe.rows.length;lt++)Xe.push(Oe.rows.item(lt).name);me({db:X,storeNames:Xe})},function(be,Oe){re(Oe)})},function(Ee){re(Ee)})})}function ct(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;return X.name?be=new h(function(Oe){var Xe;X.name===re.name?Xe=Ee._dbInfo.db:Xe=openDatabase(X.name,"","",0),X.storeName?Oe({db:Xe,storeNames:[X.storeName]}):Oe(Ze(Xe))}).then(function(Oe){return new h(function(Xe,lt){Oe.db.transaction(function(Qe){function Ke(Gr){return new h(function(Fr,yn){Qe.executeSql("DROP TABLE IF EXISTS "+Gr,[],function(){Fr()},function(qr,P){yn(P)})})}for(var ht=[],zt=0,Pr=Oe.storeNames.length;zt<Pr;zt++)ht.push(Ke(Oe.storeNames[zt]));h.all(ht).then(function(){Xe()}).catch(function(Gr){lt(Gr)})},function(Qe){lt(Qe)})})}):be=h.reject("Invalid arguments"),m(be,me),be}var dt={_driver:"webSQLStorage",_initStorage:$n,_support:yt(),iterate:Cr,getItem:ri,setItem:Ir,removeItem:_e,clear:ee,length:ye,key:Re,keys:ze,dropInstance:ct};function Et(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ue(X,me){var re=X.name+"/";return X.storeName!==me.storeName&&(re+=X.storeName+"/"),re}function Z(){var X="_localforage_support_test";try{return localStorage.setItem(X,!0),localStorage.removeItem(X),!1}catch{return!0}}function ge(){return!Z()||localStorage.length>0}function Me(X){var me=this,re={};if(X)for(var Ee in X)re[Ee]=X[Ee];return re.keyPrefix=ue(X,me._defaultConfig),ge()?(me._dbInfo=re,re.serializer=rn,h.resolve()):h.reject()}function Le(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo.keyPrefix,be=localStorage.length-1;be>=0;be--){var Oe=localStorage.key(be);Oe.indexOf(Ee)===0&&localStorage.removeItem(Oe)}});return m(re,X),re}function wt(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo,Oe=localStorage.getItem(be.keyPrefix+X);return Oe&&(Oe=be.serializer.deserialize(Oe)),Oe});return m(Ee,me),Ee}function St(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Oe=be.keyPrefix,Xe=Oe.length,lt=localStorage.length,Qe=1,Ke=0;Ke<lt;Ke++){var ht=localStorage.key(Ke);if(ht.indexOf(Oe)===0){var zt=localStorage.getItem(ht);if(zt&&(zt=be.serializer.deserialize(zt)),zt=X(zt,ht.substring(Xe),Qe++),zt!==void 0)return zt}}});return m(Ee,me),Ee}function pr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Oe;try{Oe=localStorage.key(X)}catch{Oe=null}return Oe&&(Oe=Oe.substring(be.keyPrefix.length)),Oe});return m(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Oe=[],Xe=0;Xe<be;Xe++){var lt=localStorage.key(Xe);lt.indexOf(Ee.keyPrefix)===0&&Oe.push(lt.substring(Ee.keyPrefix.length))}return Oe});return m(re,X),re}function Xr(X){var me=this,re=me.keys().then(function(Ee){return Ee.length});return m(re,X),re}function gr(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo;localStorage.removeItem(be.keyPrefix+X)});return m(Ee,me),Ee}function br(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Oe=me;return new h(function(Xe,lt){var Qe=Ee._dbInfo;Qe.serializer.serialize(me,function(Ke,ht){if(ht)lt(ht);else try{localStorage.setItem(Qe.keyPrefix+X,Ke),Xe(Oe)}catch(zt){(zt.name==="QuotaExceededError"||zt.name==="NS_ERROR_DOM_QUOTA_REACHED")&&lt(zt),lt(zt)}})})});return m(be,re),be}function nn(X,me){if(me=v.apply(this,arguments),X=typeof X!="function"&&X||{},!X.name){var re=this.config();X.name=X.name||re.name,X.storeName=X.storeName||re.storeName}var Ee=this,be;return X.name?be=new h(function(Oe){X.storeName?Oe(ue(X,Ee._defaultConfig)):Oe(X.name+"/")}).then(function(Oe){for(var Xe=localStorage.length-1;Xe>=0;Xe--){var lt=localStorage.key(Xe);lt.indexOf(Oe)===0&&localStorage.removeItem(lt)}}):be=h.reject("Invalid arguments"),m(be,me),be}var or={_driver:"localStorageWrapper",_initStorage:Me,_support:Et(),iterate:St,getItem:wt,setItem:br,removeItem:gr,clear:Le,length:Xr,key:pr,keys:lr,dropInstance:nn},$r=function(X,me){return X===me||typeof X=="number"&&typeof me=="number"&&isNaN(X)&&isNaN(me)},hn=function(X,me){for(var re=X.length,Ee=0;Ee<re;){if($r(X[Ee],me))return!0;Ee++}return!1},Lr=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Qn={},xi={},Jn={INDEXEDDB:tt,WEBSQL:dt,LOCALSTORAGE:or},Ai=[Jn.INDEXEDDB._driver,Jn.WEBSQL._driver,Jn.LOCALSTORAGE._driver],Si=["dropInstance"],ni=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Si),Un={description:"",driver:Ai.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ji(X,me){X[me]=function(){var re=arguments;return X.ready().then(function(){return X[me].apply(X,re)})}}function Ni(){for(var X=1;X<arguments.length;X++){var me=arguments[X];if(me)for(var re in me)me.hasOwnProperty(re)&&(Lr(me[re])?arguments[0][re]=me[re].slice():arguments[0][re]=me[re])}return arguments[0]}var ms=function(){function X(me){a(this,X);for(var re in Jn)if(Jn.hasOwnProperty(re)){var Ee=Jn[re],be=Ee._driver;this[re]=be,Qn[be]||this.defineDriver(Ee)}this._defaultConfig=Ni({},Un),this._config=Ni({},this._defaultConfig,me),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return X.prototype.config=function(me){if((typeof me>"u"?"undefined":s(me))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var re in me){if(re==="storeName"&&(me[re]=me[re].replace(/\W/g,"_")),re==="version"&&typeof me[re]!="number")return new Error("Database version must be a number.");this._config[re]=me[re]}return"driver"in me&&me.driver?this.setDriver(this._config.driver):!0}else return typeof me=="string"?this._config[me]:this._config},X.prototype.defineDriver=function(me,re,Ee){var be=new h(function(Oe,Xe){try{var lt=me._driver,Qe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Xe(Qe);return}for(var Ke=ni.concat("_initStorage"),ht=0,zt=Ke.length;ht<zt;ht++){var Pr=Ke[ht],Gr=!hn(Si,Pr);if((Gr||me[Pr])&&typeof me[Pr]!="function"){Xe(Qe);return}}var Fr=function(){for(var qr=function(he){return function(){var Se=new Error("Method "+he+" is not implemented by the current driver"),Ce=h.reject(Se);return m(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Si.length;P<D;P++){var K=Si[P];me[K]||(me[K]=qr(K))}};Fr();var yn=function(qr){Qn[lt]&&console.info("Redefining LocalForage driver: "+lt),Qn[lt]=me,xi[lt]=qr,Oe()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(yn,Xe):yn(!!me._support):yn(!0)}catch(qr){Xe(qr)}});return y(be,re,Ee),be},X.prototype.driver=function(){return this._driver||null},X.prototype.getDriver=function(me,re,Ee){var be=Qn[me]?h.resolve(Qn[me]):h.reject(new Error("Driver not found."));return y(be,re,Ee),be},X.prototype.getSerializer=function(me){var re=h.resolve(rn);return y(re,me),re},X.prototype.ready=function(me){var re=this,Ee=re._driverSet.then(function(){return re._ready===null&&(re._ready=re._initDriver()),re._ready});return y(Ee,me,me),Ee},X.prototype.setDriver=function(me,re,Ee){var be=this;Lr(me)||(me=[me]);var Oe=this._getSupportedDrivers(me);function Xe(){be._config.driver=be.driver()}function lt(ht){return be._extend(ht),Xe(),be._ready=be._initStorage(be._config),be._ready}function Qe(ht){return function(){var zt=0;function Pr(){for(;zt<ht.length;){var Gr=ht[zt];return zt++,be._dbInfo=null,be._ready=null,be.getDriver(Gr).then(lt).catch(Pr)}Xe();var Fr=new Error("No available storage method found.");return be._driverSet=h.reject(Fr),be._driverSet}return Pr()}}var Ke=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=Ke.then(function(){var ht=Oe[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(zt){be._driver=zt._driver,Xe(),be._wrapLibraryMethodsWithReady(),be._initDriver=Qe(Oe)})}).catch(function(){Xe();var ht=new Error("No available storage method found.");return be._driverSet=h.reject(ht),be._driverSet}),y(this._driverSet,re,Ee),this._driverSet},X.prototype.supports=function(me){return!!xi[me]},X.prototype._extend=function(me){Ni(this,me)},X.prototype._getSupportedDrivers=function(me){for(var re=[],Ee=0,be=me.length;Ee<be;Ee++){var Oe=me[Ee];this.supports(Oe)&&re.push(Oe)}return re},X.prototype._wrapLibraryMethodsWithReady=function(){for(var me=0,re=ni.length;me<re;me++)Ji(this,ni[me])},X.prototype.createInstance=function(me){return new X(me)},X}(),Ya=new ms;n.exports=Ya},{3:3}]},{},[4])(4)})}),$6e=Ate((t,e)=>{(function(r,n){typeof t=="object"&&typeof e<"u"?n(t):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})})(typeof self<"u"?self:t,function(r){var n="localforage-driver-memory";function i(U){var F=typeof Symbol=="function"&&U[Symbol.iterator],H=0;return F?F.call(U):{next:function(){return U&&H>=U.length&&(U=void 0),{value:U&&U[H++],done:!U}}}}function s(U,F){U=U||[],F=F||{};try{return new Blob(U,F)}catch($){if($.name!=="TypeError")throw $;for(var H=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,M=new H,q=0;q<U.length;q+=1)M.append(U[q]);return M.getBlob(F.type)}}var a=/^~~local_forage_type~([^~]+)~/,o=9,c=o+4,u=Object.prototype.toString;function f(U){var F=U.length*.75,H=U.length;U[U.length-1]==="="&&(F--,U[U.length-2]==="="&&F--);for(var M=new ArrayBuffer(F),q=new Uint8Array(M),$=0,k=0;$<H;$+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(U[$]),pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(U[$+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(U[$+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(U[$+3]);q[k++]=G<<2|pe>>4,q[k++]=(pe&15)<<4|Q>>2,q[k++]=(Q&3)<<6|te&63}return M}function h(U){for(var F=new Uint8Array(U),H="",M=0;M<F.length;M+=3)H+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F[M]>>2],H+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(F[M]&3)<<4|F[M+1]>>4],H+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(F[M+1]&15)<<2|F[M+2]>>6],H+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[F[M+2]&63];return F.length%3===2?H=H.substring(0,H.length-1)+"=":F.length%3===1&&(H=H.substring(0,H.length-2)+"=="),H}function m(U,F){var H="";if(U&&(H=u.call(U)),U&&(H==="[object ArrayBuffer]"||U.buffer&&u.call(U.buffer)==="[object ArrayBuffer]")){var M=void 0,q="__lfsc__:";U instanceof ArrayBuffer?(M=U,q+="arbf"):(M=U.buffer,H==="[object Int8Array]"?q+="si08":H==="[object Uint8Array]"?q+="ui08":H==="[object Uint8ClampedArray]"?q+="uic8":H==="[object Int16Array]"?q+="si16":H==="[object Uint16Array]"?q+="ur16":H==="[object Int32Array]"?q+="si32":H==="[object Uint32Array]"?q+="ui32":H==="[object Float32Array]"?q+="fl32":H==="[object Float64Array]"?q+="fl64":F(new Error("Failed to get type for BinaryArray"))),F(q+h(M))}else if(H==="[object Blob]"){var $=new FileReader;$.onload=function(){var k="~~local_forage_type~"+U.type+"~"+h(this.result);F("__lfsc__:blob"+k)},$.readAsArrayBuffer(U)}else try{F(JSON.stringify(U))}catch(k){console.error("Couldn't convert value into a JSON string: ",U),F(null,k)}}function y(U){if(U.substring(0,o)!=="__lfsc__:")return JSON.parse(U);var F=U.substring(c),H=U.substring(o,c),M;if(H==="blob"&&a.test(F)){var q=F.match(a);M=q[1],F=F.substring(q[0].length)}var $=f(F);switch(H){case"arbf":return $;case"blob":return s([$],{type:M});case"si08":return new Int8Array($);case"ui08":return new Uint8Array($);case"uic8":return new Uint8ClampedArray($);case"si16":return new Int16Array($);case"ur16":return new Uint16Array($);case"si32":return new Int32Array($);case"ui32":return new Uint32Array($);case"fl32":return new Float32Array($);case"fl64":return new Float64Array($);default:throw new Error("Unkown type: "+H)}}function w(U){var F,H;if(U===null||typeof U!="object"||"isActiveClone"in U)return U;var M=U instanceof Date?new Date(U):U.constructor();try{for(var q=i(Object.keys(U)),$=q.next();!$.done;$=q.next()){var k=$.value;Object.prototype.hasOwnProperty.call(U,k)&&(U.isActiveClone=null,M[k]=w(U[k]),delete U.isActiveClone)}}catch(G){F={error:G}}finally{try{$&&!$.done&&(H=q.return)&&H.call(q)}finally{if(F)throw F.error}}return M}function v(U,F){return(U.name||F.name)+"/"+(U.storeName||F.storeName)+"/"}function g(U,F){F&&U.then(function(H){F(null,H)},function(H){F(H)})}function _(){for(var U=[],F=0;F<arguments.length;F++)U[F]=arguments[F];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(U,F){var H=this;if(F=_.apply(this,arguments),U=typeof U!="function"&&U||{},!U.name){var M=this.config();U.name=U.name||M.name,U.storeName=U.storeName||M.storeName}var q;return U.name?q=new Promise(function($){U.storeName?$(v(U,H._defaultConfig)):$(U.name+"/")}):q=Promise.reject("Invalid arguments"),{promise:q,callback:F}}function S(U){return typeof U!="string"&&(console.warn(U+" used as a key, but it is not a string."),U=String(U)),U}var A={bufferToString:h,deserialize:y,serialize:m,stringToBuffer:f},O={},E=function(){function U(F){this.kp=F,this.data={}}return U.resolve=function(F){return O[F]||(O[F]=new U(F)),O[F]},U.prototype.clear=function(){this.data={}},U.prototype.drop=function(){this.clear(),delete O[this.kp]},U.prototype.get=function(F){return this.data[F]},U.prototype.key=function(F){return this.keys()[F]},U.prototype.keys=function(){return Object.keys(this.data)},U.prototype.rm=function(F){delete this.data[F]},U.prototype.set=function(F,H){this.data[F]=H},U}();function p(U){var F=U?w(U):{},H=v(F,this._defaultConfig),M=E.resolve(H);return this._dbInfo=F,this._dbInfo.serializer=A,this._dbInfo.keyPrefix=H,this._dbInfo.mStore=M,Promise.resolve()}function I(U){var F=this,H=this.ready().then(function(){F._dbInfo.mStore.clear()});return g(H,U),H}function N(U,F){var H=b.apply(this,arguments),M=H.promise,q=H.callback,$=M.then(function(k){E.resolve(k).drop()});return g($,q),M}function B(U,F){var H=this;U=S(U);var M=this.ready().then(function(){var q=H._dbInfo.mStore.get(U);return q==null?null:H._dbInfo.serializer.deserialize(q)});return g(M,F),M}function V(U,F){var H=this,M=this.ready().then(function(){for(var q=H._dbInfo.mStore,$=q.keys(),k=0;k<$.length;k++){var G=q.get($[k]);if(G&&(G=H._dbInfo.serializer.deserialize(G)),G=U(G,$[k],k+1),G!==void 0)return G}});return g(M,F),M}function de(U,F){var H=this,M=this.ready().then(function(){var q;try{q=H._dbInfo.mStore.key(U),q===void 0&&(q=null)}catch{q=null}return q});return g(M,F),M}function ve(U){var F=this,H=this.ready().then(function(){return F._dbInfo.mStore.keys()});return g(H,U),H}function j(U){var F=this.keys().then(function(H){return H.length});return g(F,U),F}function L(U,F){var H=this;U=S(U);var M=this.ready().then(function(){H._dbInfo.mStore.rm(U)});return g(M,F),M}function Y(U,F,H){var M=this;U=S(U);var q=this.ready().then(function(){F===void 0&&(F=null);var $=F;return new Promise(function(k,G){M._dbInfo.serializer.serialize(F,function(pe,Q){if(Q)G(Q);else try{M._dbInfo.mStore.set(U,pe),k($)}catch(te){G(te)}})})});return g(q,H),q}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=I,r.dropInstance=N,r.getItem=B,r.iterate=V,r.key=de,r.keys=ve,r.length=j,r.removeItem=L,r.setItem=Y,Object.defineProperty(r,"__esModule",{value:!0})})}),OC=Ste(k6e()),Vz=Ste($6e()),L6e={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function U6e(t){for(let[e,r]of Object.entries(L6e))t.style[e]=r}function j6e(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var B6e=class extends P6e{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(j6e(encodeURIComponent(this.parameters)))qNe().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=xx(this.endpoint).host,r.title="Secure Modal",r.src=xx(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,U6e(r),document.body.appendChild(r),t(r)}};["loaded","interactive","complete"].includes(document.readyState)?e():window.addEventListener("load",e,!1)}),window.addEventListener("message",t=>{var e;if(t.origin===this.endpoint&&t.data&&t.data.msgType&&this.messageHandlers.size){t.data.response=(e=t.data.response)!=null?e:{};for(let r of this.messageHandlers.values())r(t)}})}showOverlay(){return hE(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return hE(this,null,function*(){var t;let e=yield this.iframe;e.style.display="none",(t=this.activeElement)!=null&&t.focus&&this.activeElement.focus(),this.activeElement=null})}_post(t){return hE(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw ate()})}},F6e=kNe(Ete,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:B6e,configureStorage:()=>hE(void 0,null,function*(){let t=OC.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(Vz),yield t.setDriver([OC.default.INDEXEDDB,OC.default.LOCALSTORAGE,Vz._driver]),t})});const VD=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:Wee,DeviceVerificationEventEmit:wx,DeviceVerificationEventOnReceived:Xee,EthChainType:Zee,Events:Hv,Extension:Sh,ExtensionError:LD,ExtensionWarning:F6,LoginWithEmailOTPEventEmit:c0,LoginWithEmailOTPEventOnReceived:Jee,LoginWithMagicLinkEventEmit:Yee,LoginWithMagicLinkEventOnReceived:Qee,Magic:F6e,MagicIncomingWindowMessage:Zd,MagicOutgoingWindowMessage:Ib,MagicPayloadMethod:yr,RPCError:Tb,RPCErrorCode:_A,RecoveryMethodType:ete,SDKError:nd,SDKErrorCode:rd,SDKWarning:F1,SDKWarningCode:ym,Wallets:fo,isPromiEvent:dte},Symbol.toStringTag,{value:"Module"})),q6e=Ia(VD);var Ote={exports:{}},IC={exports:{}},Gz;function Ite(){return Gz||(Gz=1,function(t,e){(function(r,n){t.exports=n()})($e,function(){var r=r||function(n,i){var s=Object.create||function(){function g(){}return function(_){var b;return g.prototype=_,b=new g,g.prototype=null,b}}(),a={},o=a.lib={},c=o.Base=function(){return{extend:function(g){var _=s(this);return g&&_.mixIn(g),(!_.hasOwnProperty("init")||this.init===_.init)&&(_.init=function(){_.$super.init.apply(this,arguments)}),_.init.prototype=_,_.$super=this,_},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var _ in g)g.hasOwnProperty(_)&&(this[_]=g[_]);g.hasOwnProperty("toString")&&(this.toString=g.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=o.WordArray=c.extend({init:function(g,_){g=this.words=g||[],_!=i?this.sigBytes=_:this.sigBytes=g.length*4},toString:function(g){return(g||h).stringify(this)},concat:function(g){var _=this.words,b=g.words,S=this.sigBytes,A=g.sigBytes;if(this.clamp(),S%4)for(var O=0;O<A;O++){var E=b[O>>>2]>>>24-O%4*8&255;_[S+O>>>2]|=E<<24-(S+O)%4*8}else for(var O=0;O<A;O+=4)_[S+O>>>2]=b[O>>>2];return this.sigBytes+=A,this},clamp:function(){var g=this.words,_=this.sigBytes;g[_>>>2]&=4294967295<<32-_%4*8,g.length=n.ceil(_/4)},clone:function(){var g=c.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var _=[],b=function(p){var p=p,I=987654321,N=4294967295;return function(){I=36969*(I&65535)+(I>>16)&N,p=18e3*(p&65535)+(p>>16)&N;var B=(I<<16)+p&N;return B/=4294967296,B+=.5,B*(n.random()>.5?1:-1)}},S=0,A;S<g;S+=4){var O=b((A||n.random())*4294967296);A=O()*987654071,_.push(O()*4294967296|0)}return new u.init(_,g)}}),f=a.enc={},h=f.Hex={stringify:function(g){for(var _=g.words,b=g.sigBytes,S=[],A=0;A<b;A++){var O=_[A>>>2]>>>24-A%4*8&255;S.push((O>>>4).toString(16)),S.push((O&15).toString(16))}return S.join("")},parse:function(g){for(var _=g.length,b=[],S=0;S<_;S+=2)b[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new u.init(b,_/2)}},m=f.Latin1={stringify:function(g){for(var _=g.words,b=g.sigBytes,S=[],A=0;A<b;A++){var O=_[A>>>2]>>>24-A%4*8&255;S.push(String.fromCharCode(O))}return S.join("")},parse:function(g){for(var _=g.length,b=[],S=0;S<_;S++)b[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new u.init(b,_)}},y=f.Utf8={stringify:function(g){try{return decodeURIComponent(escape(m.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return m.parse(unescape(encodeURIComponent(g)))}},w=o.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(g){typeof g=="string"&&(g=y.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes},_process:function(g){var _=this._data,b=_.words,S=_.sigBytes,A=this.blockSize,O=A*4,E=S/O;g?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*A,I=n.min(p*4,S);if(p){for(var N=0;N<p;N+=A)this._doProcessBlock(b,N);var B=b.splice(0,p);_.sigBytes-=I}return new u.init(B,I)},clone:function(){var g=c.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});o.Hasher=w.extend({cfg:c.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var _=this._doFinalize();return _},blockSize:16,_createHelper:function(g){return function(_,b){return new g.init(b).finalize(_)}},_createHmacHelper:function(g){return function(_,b){return new v.HMAC.init(g,b).finalize(_)}}});var v=a.algo={};return a}(Math);return r})}(IC)),IC.exports}(function(t,e){(function(r,n){t.exports=n(Ite())})($e,function(r){return function(n){var i=r,s=i.lib,a=s.WordArray,o=s.Hasher,c=i.algo,u=[],f=[];(function(){function y(_){for(var b=n.sqrt(_),S=2;S<=b;S++)if(!(_%S))return!1;return!0}function w(_){return(_-(_|0))*4294967296|0}for(var v=2,g=0;g<64;)y(v)&&(g<8&&(u[g]=w(n.pow(v,1/2))),f[g]=w(n.pow(v,1/3)),g++),v++})();var h=[],m=c.SHA256=o.extend({_doReset:function(){this._hash=new a.init(u.slice(0))},_doProcessBlock:function(y,w){for(var v=this._hash.words,g=v[0],_=v[1],b=v[2],S=v[3],A=v[4],O=v[5],E=v[6],p=v[7],I=0;I<64;I++){if(I<16)h[I]=y[w+I]|0;else{var N=h[I-15],B=(N<<25|N>>>7)^(N<<14|N>>>18)^N>>>3,V=h[I-2],de=(V<<15|V>>>17)^(V<<13|V>>>19)^V>>>10;h[I]=B+h[I-7]+de+h[I-16]}var ve=A&O^~A&E,j=g&_^g&b^_&b,L=(g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22),Y=(A<<26|A>>>6)^(A<<21|A>>>11)^(A<<7|A>>>25),ne=p+Y+ve+f[I]+h[I],U=L+j;p=E,E=O,O=A,A=S+ne|0,S=b,b=_,_=g,g=ne+U|0}v[0]=v[0]+g|0,v[1]=v[1]+_|0,v[2]=v[2]+b|0,v[3]=v[3]+S|0,v[4]=v[4]+A|0,v[5]=v[5]+O|0,v[6]=v[6]+E|0,v[7]=v[7]+p|0},_doFinalize:function(){var y=this._data,w=y.words,v=this._nDataBytes*8,g=y.sigBytes*8;return w[g>>>5]|=128<<24-g%32,w[(g+64>>>9<<4)+14]=n.floor(v/4294967296),w[(g+64>>>9<<4)+15]=v,y.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var y=o.clone.call(this);return y._hash=this._hash.clone(),y}});i.SHA256=o._createHelper(m),i.HmacSHA256=o._createHmacHelper(m)}(Math),r.SHA256})})(Ote);var H6e=Ote.exports;const z6e=_c(H6e);var Pte={exports:{}};(function(t,e){(function(r,n){t.exports=n(Ite())})($e,function(r){return function(){var n=r,i=n.lib,s=i.WordArray,a=n.enc;a.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,h=this._map;c.clamp();for(var m=[],y=0;y<f;y+=3)for(var w=u[y>>>2]>>>24-y%4*8&255,v=u[y+1>>>2]>>>24-(y+1)%4*8&255,g=u[y+2>>>2]>>>24-(y+2)%4*8&255,_=w<<16|v<<8|g,b=0;b<4&&y+b*.75<f;b++)m.push(h.charAt(_>>>6*(3-b)&63));var S=h.charAt(64);if(S)for(;m.length%4;)m.push(S);return m.join("")},parse:function(c){var u=c.length,f=this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m<f.length;m++)h[f.charCodeAt(m)]=m}var y=f.charAt(64);if(y){var w=c.indexOf(y);w!==-1&&(u=w)}return o(c,u,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(c,u,f){for(var h=[],m=0,y=0;y<u;y++)if(y%4){var w=f[c.charCodeAt(y-1)]<<y%4*2,v=f[c.charCodeAt(y)]>>>6-y%4*2;h[m>>>2]|=(w|v)<<24-m%4*8,m++}return s.create(h,m)}}(),r.enc.Base64})})(Pte);var V6e=Pte.exports;const G6e=_c(V6e);var q1=(t,e,r)=>new Promise((n,i)=>{var s=c=>{try{o(r.next(c))}catch(u){i(u)}},a=c=>{try{o(r.throw(c))}catch(u){i(u)}},o=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);o((r=r.apply(t,e)).next())}),Tte=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(Tte||{}),Cte=(t=>(t.InvalidRequest="invalid_request",t.InvalidClient="invalid_client",t.InvalidScope="invalid_scope",t.InvalidGrant="invalid_grant",t.UnauthorizedClient="unauthorized_client",t.UnsupportedResponseType="unsupported_response_type",t.UnsupportedGrantType="unsupported_grant_type",t.UnsupportedTokenType="unsupported_token_type",t.AccessDenied="access_denied",t.ServerError="server_error",t.TemporarilyUnavailable="temporarily_unavailable",t))(Cte||{}),Kz="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",Rte=typeof window<"u"&&!!window.crypto,K6e=Rte&&!!window.crypto.subtle;function W6e(t){return Array.from(t).map(e=>Kz[e%Kz.length]).join("")}function Wz(t){let e=r=>r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if(t instanceof ArrayBuffer){let r=new Uint8Array(t),n=Array.from(r).map(s=>String.fromCharCode(s)).join(""),i=btoa(n);return e(i)}return e(G6e.stringify(t))}function Y6e(t){return q1(this,null,function*(){if(K6e){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(Wz)}return Wz(z6e(t))})}function Yz(t){let e=new Uint8Array(t);if(Rte)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return W6e(e)}function Q6e(){return q1(this,null,function*(){let t=Yz(128),e=Yz(128),r=yield Y6e(e);return{verifier:e,challenge:r,state:t}})}var J6e=class extends Sh.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect(t){return this.utils.createPromiEvent(e=>q1(this,null,function*(){let{provider:r,query:n}=yield X6e.call(this,t);window.location.href=new URL(`/v1/oauth2/${r}/start?${n}`,this.sdk.endpoint).href,e()}))}getRedirectResult(){let t=window.location.search,e=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",e),Z6e.call(this,t)}},Ax="oauth_redirect_metadata";function X6e(t){return q1(this,null,function*(){yield this.utils.storage.removeItem(Ax);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:s,challenge:a,state:o}=yield Q6e(),c=JSON.stringify({verifier:s,state:o});return yield this.utils.storage.setItem(Ax,c),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(a)}`,`state=${encodeURIComponent(o)}`,`platform=${encodeURIComponent("web")}`,n&&`scope=${encodeURIComponent(n.join(" "))}`,r&&`redirect_uri=${encodeURIComponent(r)}`,i&&`login_hint=${encodeURIComponent(i)}`].reduce((u,f)=>f?`${u}&${f}`:u),provider:e,redirectURI:r}})}function Z6e(t){return this.utils.createPromiEvent((e,r)=>q1(this,null,function*(){var n;let i=yield this.utils.storage.getItem(Ax),{verifier:s,state:a}=JSON.parse(i);this.utils.storage.removeItem(Ax);let o=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[t,s,a]),c=yield this.request(o),u=c,f=c;f.error&&r(this.createError(f.error,(n=f.error_description)!=null?n:"An error occurred.",{errorURI:f.error_uri,provider:f.provider})),e(u)}))}const GD=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:Cte,OAuthExtension:J6e,OAuthPayloadMethods:Tte},Symbol.toStringTag,{value:"Module"})),e8e=Ia(GD);var t8e=$e&&$e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r8e=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qz=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&t8e(e,t,r);return r8e(e,t),e};Object.defineProperty(wA,"__esModule",{value:!0});wA.MagicConnector=void 0;const Jz=ml,Xz=Do,n8e=K2;class i8e extends n8e.AbstractConnector{constructor(e){super({supportedChainIds:Xz.getConfiguration()[Jz.ProviderType.MAGIC].chains}),this.activate=async()=>{var r;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const i=await this.getProvider(),s=await i.request({method:"eth_accounts"});return this.account=(r=s[0])!==null&&r!==void 0?r:null,{provider:i,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const r=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},r),{request:new Proxy(r.request,{apply:async(n,i,s)=>{var a,o,c;if(((a=s[0])===null||a===void 0?void 0:a.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(o=s[0])===null||o===void 0?void 0:o.params[0])===null||c===void 0?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return n.bind(r)(...s)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async r=>{const{Magic:n}=await Promise.resolve().then(()=>Qz(q6e)),{OAuthExtension:i}=await Promise.resolve().then(()=>Qz(e8e)),s=Xz.getConfiguration()[Jz.ProviderType.MAGIC];return new n(s.apiKey,{extensions:[new i],network:{rpcUrl:s.urls[r],chainId:r}})},this.chainId=e,this.account=null}}wA.MagicConnector=i8e;(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(K2,t),r(Q2,t),r(sA,t),r(aA,t),r(oA,t),r(cA,t),r(wA,t)})(Y4);var Nte={},H1={};Object.defineProperty(H1,"__esModule",{value:!0});H1.Storage=void 0;class s8e{}H1.Storage=s8e;var SA={};Object.defineProperty(SA,"__esModule",{value:!0});SA.LocalStorage=void 0;const a8e=H1;class o8e extends a8e.Storage{get(e){const r=window.localStorage.getItem(e);return r===null?void 0:r}set(e,r){window.localStorage.setItem(e,r)}remove(e){window.localStorage.removeItem(e)}removeRegExp(e){for(let r=localStorage.length-1;r>=0;r--){const n=localStorage.key(r);n&&e.test(n)&&localStorage.removeItem(n)}}}SA.LocalStorage=o8e;(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(H1,t),r(SA,t)})(Nte);var OA={};Object.defineProperty(OA,"__esModule",{value:!0});OA.ProviderAdapter=void 0;class KD{constructor(e){this.provider=e,this.id=0,this.on=(r,n)=>this.provider.on(r,n),this.emit=(r,...n)=>this.provider.emit(r,n),this.removeListener=(r,n)=>this.provider.removeListener(r,n),this.request=async({method:r,params:n})=>this.isModernProvider()?this.provider.request({method:r,params:n}):this.send(r,n),this.sendAsync=async(r,n)=>this.hasSendAsync()?this.provider.sendAsync(r,(i,s)=>{s&&!s.hasOwnProperty("result")?n(i,{id:0,jsonrpc:"2.0",result:s}):n(i,s)}):this.send(r,n)}static adapt(e){const r=new KD(e);return Object.assign(Object.assign({},e),{on:r.on,emit:r.emit,removeListener:r.removeListener,request:r.request,sendAsync:r.sendAsync,send:r.send.bind(r)})}async send(e,r){let n,i,s;const a=typeof r=="function";if(a){const o=e;i=o.params||[],n=o.method,s=r}else n=e,i=r||[],s=(o,c)=>{if(o)throw o;return c};if(this.isModernProvider()){const[o,c]=await this.provider.request({method:n,params:i}).then(f=>[null,f]).catch(f=>[f,void 0]);return s(o,a?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[o,c]=a?await new Promise(u=>this.provider.send(e,(f,h)=>{u([f,h])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:n,params:i},(f,h)=>{u([h&&h.hasOwnProperty("error")?h.error:f,h&&h.hasOwnProperty("result")?h.result:h])}));return s(o,c)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}OA.ProviderAdapter=KD;Object.defineProperty(Ug,"__esModule",{value:!0});Ug.connection=Ug.ConnectionManager=void 0;const Zz=Ka(),ka=gc,w_=Ixe,Vl=Y4,c8e=Nte,PC=Do,eV=OA;class Dte{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof Vl.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=PC.getConfiguration();this.storage.remove(r),Vl.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(w_.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(w_.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=Zz.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(w_.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===ka.ProviderType.MAGIC&&this.connector.on(w_.ConnectorEvent.Update,({chainId:s})=>{s&&this.setConnectionData(e,s)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:eV.ProviderAdapter.adapt(n),providerType:e,account:i||"",chainId:r}}async tryPreviousConnection(){const e=this.getConnectionData();if(!e)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const r=await this.connect(e.providerType,e.chainId);if(r.providerType===ka.ProviderType.INJECTED){const n=await r.provider.request({method:"eth_chainId"}),i=n?parseInt(n,16):null;i&&e.chainId!==i&&this.setConnectionData(e.providerType,i)}return Object.assign(Object.assign({},r),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const e=[ka.ProviderType.FORTMATIC,ka.ProviderType.WALLET_CONNECT,ka.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?e.unshift(ka.ProviderType.INJECTED):e.unshift(ka.ProviderType.METAMASK_MOBILE),e}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(e,r=Zz.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return eV.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case ka.ProviderType.INJECTED:return new Vl.InjectedConnector(r);case ka.ProviderType.FORTMATIC:return new Vl.FortmaticConnector(r);case ka.ProviderType.MAGIC:return new Vl.MagicConnector(r);case ka.ProviderType.WALLET_LINK:return new Vl.WalletLinkConnector(r);case ka.ProviderType.NETWORK:return new Vl.NetworkConnector(r);case ka.ProviderType.WALLET_CONNECT_V2:return new Vl.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=PC.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=PC.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Ug.ConnectionManager=Dte;Ug.connection=new Dte(new c8e.LocalStorage);var Mte={};Object.defineProperty(Mte,"__esModule",{value:!0});(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ug,t),r(Y4,t),r(Do,t),r(Mte,t)})(iu);function tV(t){return t!=null&&typeof t=="object"&&"message"in t}const u8e=()=>{const[t,e]=Ve.useState(),[r,n]=Ve.useState(),[i,s]=Ve.useState(),[a,o]=Ve.useState(),c=Ve.useCallback(async()=>{s(void 0),o(void 0);try{const f=await iu.connection.tryPreviousConnection(),y=await(await new ZE(f.provider).getSigner()).signMessage("Hello world");o(y)}catch(f){s(tV(f)?f.message:"Unknown error")}},[]),u=Ve.useCallback(async()=>{n(void 0),e(void 0);try{const f=await iu.connection.tryPreviousConnection(),m=await new ZE(f.provider).getBalance(f.account??"");e(Pde(m))}catch(f){n(tV(f)?f.message:"Unknown error")}},[]);return He.jsxs("div",{children:[He.jsx("h1",{children:"This is a simple test page"}),He.jsxs("div",{children:[He.jsx("p",{children:"Sign message test"}),He.jsx(So.Button,{primary:!0,size:"small",onClick:c,children:"Sign message"}),a?He.jsxs("p",{children:["Signed message: ",a]}):null,i?He.jsxs("p",{children:["Error: ",i]}):null]}),He.jsxs("div",{children:[He.jsx("br",{}),He.jsx("p",{children:"Get balance test"}),He.jsx(So.Button,{primary:!0,size:"small",onClick:u,children:"Get balance"}),t?He.jsxs("p",{children:["Balance: ",t]}):null,r?He.jsxs("p",{children:["Error: ",r]}):null]})]})},au=Object.create(null);au.open="0";au.close="1";au.ping="2";au.pong="3";au.message="4";au.upgrade="5";au.noop="6";const pE=Object.create(null);Object.keys(au).forEach(t=>{pE[au[t]]=t});const H6={type:"error",data:"parser error"},kte=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$te=typeof ArrayBuffer=="function",Lte=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,WD=({type:t,data:e},r,n)=>kte&&e instanceof Blob?r?n(e):rV(e,n):$te&&(e instanceof ArrayBuffer||Lte(e))?r?n(e):rV(new Blob([e]),n):n(au[t]+(e||"")),rV=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function nV(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let TC;function l8e(t,e){if(kte&&t.data instanceof Blob)return t.data.arrayBuffer().then(nV).then(e);if($te&&(t.data instanceof ArrayBuffer||Lte(t.data)))return e(nV(t.data));WD(t,!1,r=>{TC||(TC=new TextEncoder),e(TC.encode(r))})}const iV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bv=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<iV.length;t++)bv[iV.charCodeAt(t)]=t;const f8e=t=>{let e=t.length*.75,r=t.length,n,i=0,s,a,o,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const u=new ArrayBuffer(e),f=new Uint8Array(u);for(n=0;n<r;n+=4)s=bv[t.charCodeAt(n)],a=bv[t.charCodeAt(n+1)],o=bv[t.charCodeAt(n+2)],c=bv[t.charCodeAt(n+3)],f[i++]=s<<2|a>>4,f[i++]=(a&15)<<4|o>>2,f[i++]=(o&3)<<6|c&63;return u},d8e=typeof ArrayBuffer=="function",YD=(t,e)=>{if(typeof t!="string")return{type:"message",data:Ute(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:h8e(t.substring(1),e)}:pE[r]?t.length>1?{type:pE[r],data:t.substring(1)}:{type:pE[r]}:H6},h8e=(t,e)=>{if(d8e){const r=f8e(t);return Ute(r,e)}else return{base64:!0,data:t}},Ute=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},jte=String.fromCharCode(30),p8e=(t,e)=>{const r=t.length,n=new Array(r);let i=0;t.forEach((s,a)=>{WD(s,!1,o=>{n[a]=o,++i===r&&e(n.join(jte))})})},g8e=(t,e)=>{const r=t.split(jte),n=[];for(let i=0;i<r.length;i++){const s=YD(r[i],e);if(n.push(s),s.type==="error")break}return n};function m8e(){return new TransformStream({transform(t,e){l8e(t,r=>{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(r)})}})}let CC;function __(t){return t.reduce((e,r)=>e+r.length,0)}function E_(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)r[i]=t[0][n++],n===t[0].length&&(t.shift(),n=0);return t.length&&n<t[0].length&&(t[0]=t[0].slice(n)),r}function y8e(t,e){CC||(CC=new TextDecoder);const r=[];let n=0,i=-1,s=!1;return new TransformStream({transform(a,o){for(r.push(a);;){if(n===0){if(__(r)<1)break;const c=E_(r,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(__(r)<2)break;const c=E_(r,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(__(r)<8)break;const c=E_(r,8),u=new DataView(c.buffer,c.byteOffset,c.length),f=u.getUint32(0);if(f>Math.pow(2,53-32)-1){o.enqueue(H6);break}i=f*Math.pow(2,32)+u.getUint32(4),n=3}else{if(__(r)<i)break;const c=E_(r,i);o.enqueue(YD(s?c:CC.decode(c),e)),n=0}if(i===0||i>t){o.enqueue(H6);break}}}})}const Bte=4;function Ci(t){if(t)return v8e(t)}function v8e(t){for(var e in Ci.prototype)t[e]=Ci.prototype[e];return t}Ci.prototype.on=Ci.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Ci.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this};Ci.prototype.off=Ci.prototype.removeListener=Ci.prototype.removeAllListeners=Ci.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,i=0;i<r.length;i++)if(n=r[i],n===e||n.fn===e){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+t],this};Ci.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,e)}return this};Ci.prototype.emitReserved=Ci.prototype.emit;Ci.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Ci.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Eo=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Fte(t,...e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const b8e=Eo.setTimeout,w8e=Eo.clearTimeout;function IA(t,e){e.useNativeTimers?(t.setTimeoutFn=b8e.bind(Eo),t.clearTimeoutFn=w8e.bind(Eo)):(t.setTimeoutFn=Eo.setTimeout.bind(Eo),t.clearTimeoutFn=Eo.clearTimeout.bind(Eo))}const _8e=1.33;function E8e(t){return typeof t=="string"?x8e(t):Math.ceil((t.byteLength||t.size)*_8e)}function x8e(t){let e=0,r=0;for(let n=0,i=t.length;n<i;n++)e=t.charCodeAt(n),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(n++,r+=4);return r}function A8e(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function S8e(t){let e={},r=t.split("&");for(let n=0,i=r.length;n<i;n++){let s=r[n].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class O8e extends Error{constructor(e,r,n){super(e),this.description=r,this.context=n,this.type="TransportError"}}class QD extends Ci{constructor(e){super(),this.writable=!1,IA(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,r,n){return super.emitReserved("error",new O8e(e,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const r=YD(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,r={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const r=A8e(e);return r.length?"?"+r:""}}const qte="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),z6=64,I8e={};let sV=0,x_=0,aV;function oV(t){let e="";do e=qte[t%z6]+e,t=Math.floor(t/z6);while(t>0);return e}function Hte(){const t=oV(+new Date);return t!==aV?(sV=0,aV=t):t+"."+oV(sV++)}for(;x_<z6;x_++)I8e[qte[x_]]=x_;let zte=!1;try{zte=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const P8e=zte;function Vte(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||P8e))return new XMLHttpRequest}catch{}if(!e)try{return new Eo[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function T8e(){}const C8e=function(){return new Vte({xdomain:!1}).responseType!=null}();class R8e extends QD{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const n=location.protocol==="https:";let i=location.port;i||(i=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}const r=e&&e.forceBase64;this.supportsBinary=C8e&&!r,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};g8e(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,p8e(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Hte()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new ru(this.uri(),e)}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class ru extends Ci{constructor(e,r){super(),IA(this,r),this.opts=r,this.method=r.method||"GET",this.uri=e,this.data=r.data!==void 0?r.data:null,this.create()}create(){var e;const r=Fte(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.opts.xd;const n=this.xhr=new Vte(r);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(n)),n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=ru.requestsCount++,ru.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=T8e,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ru.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}ru.requestsCount=0;ru.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cV);else if(typeof addEventListener=="function"){const t="onpagehide"in Eo?"pagehide":"unload";addEventListener(t,cV,!1)}}function cV(){for(let t in ru.requests)ru.requests.hasOwnProperty(t)&&ru.requests[t].abort()}const JD=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0))(),A_=Eo.WebSocket||Eo.MozWebSocket,uV=!0,N8e="arraybuffer",lV=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class D8e extends QD{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),r=this.opts.protocols,n=lV?{}:Fte(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=uV&&!lV?r?new A_(e,r):new A_(e):new A_(e,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],i=r===e.length-1;WD(n,this.supportsBinary,s=>{const a={};try{uV&&this.ws.send(s)}catch{}i&&JD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Hte()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}check(){return!!A_}}class M8e extends QD{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const r=y8e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),i=m8e();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const s=()=>{n.read().then(({done:o,value:c})=>{o||(this.onPacket(c),s())}).catch(o=>{})};s();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const n=e[r],i=r===e.length-1;this.writer.write(n).then(()=>{i&&JD(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const k8e={websocket:D8e,webtransport:M8e,polling:R8e},$8e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,L8e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function V6(t){if(t.length>2e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let i=$8e.exec(t||""),s={},a=14;for(;a--;)s[L8e[a]]=i[a]||"";return r!=-1&&n!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=U8e(s,s.path),s.queryKey=j8e(s,s.query),s}function U8e(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function j8e(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}let Gte=class Wp extends Ci{constructor(e,r={}){super(),this.binaryType=N8e,this.writeBuffer=[],e&&typeof e=="object"&&(r=e,e=null),e?(e=V6(e),r.hostname=e.host,r.secure=e.protocol==="https"||e.protocol==="wss",r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=V6(r.host).host),IA(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=S8e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=Bte,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new k8e[e](n)}open(){let e;if(this.opts.rememberUpgrade&&Wp.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",r=>this.onClose("transport close",r))}probe(e){let r=this.createTransport(e),n=!1;Wp.priorWebsocketSuccess=!1;const i=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",h=>{if(!n)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Wp.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(f(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=r.name,this.emitReserved("upgradeError",m)}}))};function s(){n||(n=!0,f(),r.close(),r=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=r.name,s(),this.emitReserved("upgradeError",m)};function o(){a("transport closed")}function c(){a("socket closed")}function u(h){r&&h.name!==r.name&&s()}const f=()=>{r.removeListener("open",i),r.removeListener("error",a),r.removeListener("close",o),this.off("close",c),this.off("upgrading",u)};r.once("open",i),r.once("error",a),r.once("close",o),this.once("close",c),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onOpen(){if(this.readyState="open",Wp.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const r=this.upgrades.length;for(;e<r;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const r=new Error("server error");r.code=e.data,this.onError(r);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(r+=E8e(i)),n>0&&r>this.maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}write(e,r,n){return this.sendPacket("message",e,r,n),this}send(e,r,n){return this.sendPacket("message",e,r,n),this}sendPacket(e,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:e,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}onError(e){Wp.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const r=[];let n=0;const i=e.length;for(;n<i;n++)~this.transports.indexOf(e[n])&&r.push(e[n]);return r}};Gte.protocol=Bte;function B8e(t,e="",r){let n=t;r=r||typeof location<"u"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r<"u"?t=r.protocol+"//"+t:t="https://"+t),n=V6(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+e,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const F8e=typeof ArrayBuffer=="function",q8e=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Kte=Object.prototype.toString,H8e=typeof Blob=="function"||typeof Blob<"u"&&Kte.call(Blob)==="[object BlobConstructor]",z8e=typeof File=="function"||typeof File<"u"&&Kte.call(File)==="[object FileConstructor]";function XD(t){return F8e&&(t instanceof ArrayBuffer||q8e(t))||H8e&&t instanceof Blob||z8e&&t instanceof File}function gE(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(gE(t[r]))return!0;return!1}if(XD(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return gE(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&gE(t[r]))return!0;return!1}function V8e(t){const e=[],r=t.data,n=t;return n.data=G6(r,e),n.attachments=e.length,{packet:n,buffers:e}}function G6(t,e){if(!t)return t;if(XD(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=G6(t[n],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=G6(t[n],e));return r}return t}function G8e(t,e){return t.data=K6(t.data,e),delete t.attachments,t}function K6(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=K6(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=K6(t[r],e));return t}const K8e=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],W8e=5;var an;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(an||(an={}));class Y8e{constructor(e){this.replacer=e}encode(e){return(e.type===an.EVENT||e.type===an.ACK)&&gE(e)?this.encodeAsBinary({type:e.type===an.EVENT?an.BINARY_EVENT:an.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===an.BINARY_EVENT||e.type===an.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=V8e(e),n=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(n),i}}function fV(t){return Object.prototype.toString.call(t)==="[object Object]"}class ZD extends Ci{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(e);const n=r.type===an.BINARY_EVENT;n||r.type===an.BINARY_ACK?(r.type=n?an.EVENT:an.ACK,this.reconstructor=new Q8e(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(XD(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const n={type:Number(e.charAt(0))};if(an[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===an.BINARY_EVENT||n.type===an.BINARY_ACK){const s=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const a=e.substring(s,r);if(a!=Number(a)||e.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(r+1)==="/"){const s=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););n.nsp=e.substring(s,r)}else n.nsp="/";const i=e.charAt(r+1);if(i!==""&&Number(i)==i){const s=r+1;for(;++r;){const a=e.charAt(r);if(a==null||Number(a)!=a){--r;break}if(r===e.length)break}n.id=Number(e.substring(s,r+1))}if(e.charAt(++r)){const s=this.tryParse(e.substr(r));if(ZD.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case an.CONNECT:return fV(r);case an.DISCONNECT:return r===void 0;case an.CONNECT_ERROR:return typeof r=="string"||fV(r);case an.EVENT:case an.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&K8e.indexOf(r[0])===-1);case an.ACK:case an.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Q8e{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=G8e(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const J8e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ZD,Encoder:Y8e,get PacketType(){return an},protocol:W8e},Symbol.toStringTag,{value:"Module"}));function dc(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const X8e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Wte extends Ci{constructor(e,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[dc(e,"open",this.onopen.bind(this)),dc(e,"packet",this.onpacket.bind(this)),dc(e,"error",this.onerror.bind(this)),dc(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...r){if(X8e.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(r.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const n={type:an.EVENT,data:r};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const a=this.ids++,o=r.pop();this._registerAckCallback(a,o),n.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,r){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=r;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);r.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...a)=>{this.io.clearTimeoutFn(s),r.apply(this,[null,...a])}}emitWithAck(e,...r){const n=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,s)=>{r.push((a,o)=>n?a?s(a):i(o):i(a)),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:an.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case an.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case an.EVENT:case an.BINARY_EVENT:this.onevent(e);break;case an.ACK:case an.BINARY_ACK:this.onack(e);break;case an.DISCONNECT:this.ondisconnect();break;case an.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:an.ACK,id:e,data:i}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(r.apply(this,e.data),delete this.acks[e.id])}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:an.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(e===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,e.data)}}}function bm(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}bm.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+r:t-r}return Math.min(t,this.max)|0};bm.prototype.reset=function(){this.attempts=0};bm.prototype.setMin=function(t){this.ms=t};bm.prototype.setMax=function(t){this.max=t};bm.prototype.setJitter=function(t){this.jitter=t};let W6=class extends Ci{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,IA(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new bm({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const i=r.parser||J8e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Gte(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=dc(r,"open",function(){n.onopen(),e&&e()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},a=dc(r,"error",s);if(this._timeout!==!1){const o=this._timeout,c=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},o);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(dc(e,"ping",this.onping.bind(this)),dc(e,"data",this.ondata.bind(this)),dc(e,"error",this.onerror.bind(this)),dc(e,"close",this.onclose.bind(this)),dc(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){JD(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Wte(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;n<r.length;n++)this.engine.write(r[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};const qy={};function mE(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=B8e(t,e.path||"/socket.io"),n=r.source,i=r.id,s=r.path,a=qy[i]&&s in qy[i].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let c;return o?c=new W6(n,e):(qy[i]||(qy[i]=new W6(n,e)),c=qy[i]),r.query&&!e.query&&(e.query=r.queryKey),c.socket(r.path,e)}Object.assign(mE,{Manager:W6,Socket:Wte,io:mE,connect:mE});var eM={},PA={},TA=vr;PA.__esModule=!0;PA.default=void 0;var Z8e=TA(kn()),e5e=TA(ti);TA(Dn());var t5e=TA(Ve),Iu=zn();function Cb(t){var e=t.active,r=t.children,n=t.className,i=t.content,s=t.disabled,a=t.indeterminate,o=t.inline,c=t.inverted,u=t.size,f=(0,e5e.default)("ui",u,(0,Iu.useKeyOnly)(e,"active"),(0,Iu.useKeyOnly)(s,"disabled"),(0,Iu.useKeyOnly)(a,"indeterminate"),(0,Iu.useKeyOnly)(c,"inverted"),(0,Iu.useKeyOnly)(r||i,"text"),(0,Iu.useKeyOrValueAndKey)(o,"inline"),"loader",n),h=(0,Iu.getUnhandledProps)(Cb,t),m=(0,Iu.getElementType)(Cb,t);return t5e.default.createElement(m,(0,Z8e.default)({},h,{className:f}),Iu.childrenUtils.isNil(r)?i:r)}Cb.handledProps=["active","as","children","className","content","disabled","indeterminate","inline","inverted","size"];Cb.propTypes={};var r5e=Cb;PA.default=r5e;var n5e=$e&&$e.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Y6=$e&&$e.__assign||function(){return Y6=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Y6.apply(this,arguments)},i5e=$e&&$e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),s5e=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a5e=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&i5e(e,t,r);return s5e(e,t),e},o5e=$e&&$e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eM,"__esModule",{value:!0});var CA=eM.Loader=void 0,dV=a5e(Ve),c5e=o5e(PA),u5e=function(t){n5e(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getClassName=function(){return[this.props.className||"",this.props.provider||""].join(" ").trim()},e.prototype.render=function(){return dV.createElement(c5e.default,Y6({"aria-live":"polite","aria-label":"Loading",role:"status"},this.props,{className:this.getClassName()}))},e}(dV.PureComponent);CA=eM.Loader=u5e;var wv={},RA={},RC={},Rd={},hV;function l5e(){if(hV)return Rd;hV=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.getEnvFromQueryParam=Rd.getEnvFromTLD=void 0;const t=tM();function e(n){const{host:i}=n;return i.endsWith(".org")?t.Env.PRODUCTION:i.endsWith(".today")||i.endsWith(".net")?t.Env.STAGING:i.endsWith(".io")||i.endsWith(".zone")?t.Env.DEVELOPMENT:null}Rd.getEnvFromTLD=e;function r(n){const i=new URLSearchParams(n.search),s=i.get("ENV")||i.get("env");if(s){const a=s.toLowerCase();if((0,t.isEnv)(a))return a}return null}return Rd.getEnvFromQueryParam=r,Rd}var pV;function tM(){return pV||(pV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=t.getDefaultEnv=t.parseEnvVar=t.isEnv=t.getEnvList=t.Env=void 0;const e=l5e();var r;(function(c){c.DEVELOPMENT="dev",c.STAGING="stg",c.PRODUCTION="prod"})(r=t.Env||(t.Env={}));function n(){return Object.values(r)}t.getEnvList=n;function i(c){return n().includes(c)}t.isEnv=i;function s(c){if(i(c))return c;throw new Error(`Invalid value for DCL_DEFAULT_ENV. Found "${c}", possible values are ${n().map(u=>`"${u}"`).join(", ")}.`)}t.parseEnvVar=s;function a(c={}){const{DCL_DEFAULT_ENV:u,REACT_APP_DCL_DEFAULT_ENV:f,GATSBY_DCL_DEFAULT_ENV:h}=c;if(u&&f&&u!==f)throw new Error("You have defined both DCL_DEFAULT_ENV and REACT_APP_DCL_DEFAULT_ENV with different values");if(u&&h&&u!==h)throw new Error("You have defined both DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");if(f&&h&&f!==h)throw new Error("You have defined both REACT_APP_DCL_DEFAULT_ENV and GATSBY_DCL_DEFAULT_ENV with different values");return u?s(u):f?s(f):h?s(h):r.PRODUCTION}t.getDefaultEnv=a;function o(c=process.env){if(typeof window<"u"){const u=(0,e.getEnvFromQueryParam)(window.location);if(u)return u;const f=(0,e.getEnvFromTLD)(window.location);if(f)return f}return a(c)}t.getEnv=o}(RC)),RC}Object.defineProperty(RA,"__esModule",{value:!0});RA.createConfig=void 0;const f5e=tM();function d5e(t,e){const r=(0,f5e.getEnv)(e==null?void 0:e.systemEnvVariables),n=t[r];return{get:(i,s="")=>{if(!n)throw new Error(`Could not find a config for env=${r}`);return i in n?n[i]:s},is:i=>r===i,getEnv:()=>r}}RA.createConfig=d5e;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=t.Env=t.createConfig=void 0;var e=RA;Object.defineProperty(t,"createConfig",{enumerable:!0,get:function(){return e.createConfig}});var r=tM();Object.defineProperty(t,"Env",{enumerable:!0,get:function(){return r.Env}}),Object.defineProperty(t,"getEnv",{enumerable:!0,get:function(){return r.getEnv}})})(wv);const h5e="https://auth-api.decentraland.zone",p5e={AUTH_SERVER_URL:h5e},g5e="https://auth-api.decentraland.org",m5e={AUTH_SERVER_URL:g5e},y5e="https://auth-api.decentraland.today",v5e={AUTH_SERVER_URL:y5e},b5e=wv.createConfig({[wv.Env.DEVELOPMENT]:p5e,[wv.Env.STAGING]:v5e,[wv.Env.PRODUCTION]:m5e},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}}),w5e="_main_1ncyk_1",_5e="_left_1ncyk_22",E5e="_errorLogo_1ncyk_33",x5e="_errorTitle_1ncyk_42",A5e="_errorSubtitle_1ncyk_49",S5e="_errorValue_1ncyk_56",O5e="_logo_1ncyk_61",I5e="_title_1ncyk_67",P5e="_description_1ncyk_74",T5e="_code_1ncyk_81",C5e="_buttons_1ncyk_88",R5e="_noLogo_1ncyk_95",N5e="_yesLogo_1ncyk_105",D5e="_noButton_1ncyk_115",M5e="_yesButton_1ncyk_122",k5e="_closeWindow_1ncyk_129",jt={main:w5e,left:_5e,errorLogo:E5e,errorTitle:x5e,errorSubtitle:A5e,errorValue:S5e,logo:O5e,title:I5e,description:P5e,code:T5e,buttons:C5e,noLogo:R5e,yesLogo:N5e,noButton:D5e,yesButton:M5e,closeWindow:k5e},$5e=()=>{const t=$fe(),e=h1(),[r,n]=Ve.useState(2),i=Ve.useRef(),s=Ve.useRef(),a=Ve.useRef(),o=t.requestId??"",c=Ve.useCallback(async()=>new ZE(await iu.connection.getProvider()),[]),u=Ve.useCallback(()=>{e(`/login?redirectTo=/auth/requests/${o}&fromRequests=true`)},[]);Ve.useEffect(()=>((async()=>{try{await iu.connection.tryPreviousConnection()}catch{u();return}try{const w=await NC("recover",{requestId:o});i.current=w;const _=await(await(await c()).getSigner()).getAddress();if(w.sender&&w.sender!==_.toLowerCase()){n(1);return}a.current=setTimeout(()=>{n(0)},new Date(w.expiration).getTime()-Date.now()),w.method==="dcl_personal_sign"?n(4):n(8)}catch(w){s.current=w.message,n(3)}})(),()=>{clearTimeout(a.current)}),[]),Ve.useEffect(()=>{r!==4&&r!==8&&clearTimeout(a.current)},[r]);const f=Ve.useCallback(()=>{n(5)},[]),h=Ve.useCallback(async()=>{const v=await(await c()).getSigner(),g=await v.signMessage(i.current.params[0]),_=await NC("outcome",{requestId:o,sender:await v.getAddress(),result:g});_.error?(s.current=_.error,n(6)):n(7)},[c]),m=Ve.useCallback(()=>{n(9)},[]),y=Ve.useCallback(async()=>{const w=await c(),v=await w.getSigner(),g=await w.send(i.current.method,i.current.params),_=await NC("outcome",{requestId:o,sender:await v.getAddress(),result:g});_.error?(s.current=_.error,n(10)):n(11)},[c]);return r===0?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.errorLogo}),He.jsx("div",{className:jt.errorTitle,children:"Looks like you took too long and the request has expired"}),He.jsx("div",{className:jt.errorSubtitle,children:"Please return to Decentraland's Desktop App to try again."}),He.jsx(Nd,{})]})}):r===1?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.errorLogo}),He.jsx("div",{className:jt.errorTitle,children:"Looks like you are connected with a different account."}),He.jsx("div",{className:jt.errorSubtitle,children:"Please change your wallet account to the one connected to the Desktop App."}),He.jsx("div",{className:jt.buttons,children:He.jsx(So.Button,{className:jt.yesButton,onClick:u,children:"Change account"})})]})}):r===2?He.jsx("main",{className:jt.main,children:He.jsx("div",{className:jt.left,children:He.jsx(CA,{active:!0,size:"huge"})})}):r===3?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.errorLogo}),He.jsx("div",{className:jt.errorTitle,children:"There was an error recovering the request..."}),He.jsx("div",{className:jt.errorSubtitle,children:"The request is not available anymore. Feel free to create a new one and try again."}),He.jsx(Nd,{})]})}):r===4&&i.current?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.logo}),He.jsx("div",{className:jt.title,children:"Verify Sign In"}),He.jsx("div",{className:jt.description,children:"Do you see the same verification number on your Desktop App?"}),He.jsx("div",{className:jt.code,children:i.current.code}),He.jsxs("div",{className:jt.buttons,children:[He.jsxs(So.Button,{className:jt.noButton,onClick:f,children:[He.jsx("div",{className:jt.noLogo})," No"]}),He.jsxs(So.Button,{className:jt.yesButton,onClick:h,children:[He.jsx("div",{className:jt.yesLogo})," Yes, they are the same"]})]})]})}):r===5?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.errorLogo}),He.jsx("div",{className:jt.errorTitle,children:"Did the number not match, or was this action not taken by you?"}),He.jsx("div",{className:jt.errorSubtitle,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),He.jsx(Nd,{})]})}):r===7?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.logo}),He.jsx("div",{className:jt.title,children:"Your account is ready!"}),He.jsx("div",{className:jt.description,children:"Return to the Desktop App and enjoy Decentraland."}),He.jsx(Nd,{})]})}):r===8&&i.current?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.logo}),He.jsx("div",{className:jt.title,children:"The Desktop App wants to interact with your wallet."}),He.jsx("div",{className:jt.description,children:"Review the following data carefully on your wallet before approving it."}),He.jsxs("div",{className:jt.buttons,children:[He.jsxs(So.Button,{className:jt.noButton,onClick:m,children:[He.jsx("div",{className:jt.noLogo}),"Deny"]}),He.jsxs(So.Button,{className:jt.yesButton,onClick:y,children:[He.jsx("div",{className:jt.yesLogo}),"Allow"]})]})]})}):r===9?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.errorLogo}),He.jsx("div",{className:jt.errorTitle,children:"Was this action not initiated by you?"}),He.jsx("div",{className:jt.errorSubtitle,children:"If this action was not initiated by you, dismiss this message."}),He.jsx(Nd,{})]})}):r===11?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.logo}),He.jsx("div",{className:jt.title,children:"Wallet interaction complete"}),He.jsx("div",{className:jt.description,children:"The action has been executed successfuly."}),He.jsx(Nd,{})]})}):r===6||r===10?He.jsx("main",{className:jt.main,children:He.jsxs("div",{className:jt.left,children:[He.jsx("div",{className:jt.errorLogo}),He.jsx("div",{className:jt.errorTitle,children:"There was an error while trying to submit the request."}),He.jsx("div",{className:jt.errorSubtitle,children:"Return to the Desktop App to try again, or contant support if the error persists."}),He.jsx(Nd,{})]})}):null},Nd=()=>He.jsx("div",{className:jt.closeWindow,children:"You can close this window."}),NC=async(t,e)=>{const r=b5e.get("AUTH_SERVER_URL"),n=mE(r);await new Promise(s=>{n.on("connect",s)});const i=await n.emitWithAck(t,e);if(n.close(),i.error)throw new Error(i.error);return i},L5e=()=>{const t=h1(),e=d1(),r=Ve.useCallback(async()=>{try{const n=await iu.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return Ve.useEffect(()=>{r().then(n=>{t(n?"/user":{pathname:"/login",search:e.search})})},[r,t]),He.jsx(CA,{active:!0,size:"huge"})},Yte=()=>{const t=d1(),r=new URLSearchParams(t.search).get("redirectTo"),n=r?decodeURIComponent(r):null;if(n!==null)try{let i;return n.startsWith("/")?i=new URL(n,window.location.origin):i=new URL(n),i.hostname!==window.location.hostname?void 0:i.href}catch{console.error("Can't parse redirectTo URL");return}};var NA={},DA=vr;NA.__esModule=!0;var rM=NA.default=void 0,U5e=DA(kn()),j5e=DA(ti);DA(Dn());var B5e=DA(Ve),Yp=zn();function Lh(t){var e=t.children,r=t.className,n=t.content,i=t.image,s=t.scrolling,a=(0,j5e.default)(r,(0,Yp.useKeyOnly)(i,"image"),(0,Yp.useKeyOnly)(s,"scrolling"),"content"),o=(0,Yp.getUnhandledProps)(Lh,t),c=(0,Yp.getElementType)(Lh,t);return B5e.default.createElement(c,(0,U5e.default)({},o,{className:a}),Yp.childrenUtils.isNil(e)?n:e)}Lh.handledProps=["as","children","className","content","image","scrolling"];Lh.propTypes={};Lh.create=(0,Yp.createShorthandFactory)(Lh,function(t){return{content:t}});var F5e=Lh;rM=NA.default=F5e;var nM={},MA={},DC,gV;function q5e(){if(gV)return DC;gV=1;function t(e,r,n,i){var s=-1,a=e==null?0:e.length;for(i&&a&&(n=e[++s]);++s<a;)n=r(n,e[s],s,e);return n}return DC=t,DC}var MC,mV;function H5e(){if(mV)return MC;mV=1;function t(e,r,n,i,s){return s(e,function(a,o,c){n=i?(i=!1,a):r(n,a,o,c)}),n}return MC=t,MC}var kC,yV;function Qte(){if(yV)return kC;yV=1;var t=q5e(),e=S1(),r=Xf(),n=H5e(),i=Ri();function s(a,o,c){var u=i(a)?t:n,f=arguments.length<3;return u(a,r(o,4),c,f,e)}return kC=s,kC}var $C,vV;function Jte(){return vV||(vV=1,$C=function(e,r,n,i){var s=n?n.call(i,e,r):void 0;if(s!==void 0)return!!s;if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var a=Object.keys(e),o=Object.keys(r);if(a.length!==o.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<a.length;u++){var f=a[u];if(!c(f))return!1;var h=e[f],m=r[f];if(s=n?n.call(i,h,m,f):void 0,s===!1||s===void 0&&h!==m)return!1}return!0}),$C}var S_={},bV;function z5e(){if(bV)return S_;bV=1;var t=vr;S_.__esModule=!0;var e=t(B2());return S_.default=e.default,S_}var Hy={},O_={},wV;function V5e(){if(wV)return O_;wV=1;var t=vr;O_.__esModule=!0;var e=t(c4());return O_.default=e.default,O_}var _V;function G5e(){if(_V)return Hy;_V=1;var t=Uo,e=vr;Hy.__esModule=!0,Hy.default=void 0;var r=e(kn()),n=e(xc()),i=e(j2()),s=e(jo()),a=e(ti);e(Dn());var o=t(Ve),c=zn(),u=e(V5e()),f=function(h){(0,n.default)(m,h);function m(){for(var w,v=arguments.length,g=new Array(v),_=0;_<v;_++)g[_]=arguments[_];return w=h.call.apply(h,[this].concat(g))||this,w.handleButtonOverrides=function(b){return{onClick:function(A,O){(0,s.default)(b,"onClick",A,O),(0,s.default)(w.props,"onActionClick",A,O)}}},w}var y=m.prototype;return y.render=function(){var v=this,g=this.props,_=g.actions,b=g.children,S=g.className,A=g.content,O=(0,a.default)("actions",S),E=(0,c.getUnhandledProps)(m,this.props),p=(0,c.getElementType)(m,this.props);return c.childrenUtils.isNil(b)?c.childrenUtils.isNil(A)?o.default.createElement(p,(0,r.default)({},E,{className:O}),(0,i.default)(_,function(I){return u.default.create(I,{overrideProps:v.handleButtonOverrides})})):o.default.createElement(p,(0,r.default)({},E,{className:O}),A):o.default.createElement(p,(0,r.default)({},E,{className:O}),b)},m}(o.Component);return Hy.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(h){return{actions:h}}),Hy}var zy={},EV;function K5e(){if(EV)return zy;EV=1;var t=vr;zy.__esModule=!0,zy.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.className,f=o.content,h=(0,r.default)("description",u),m=(0,i.getUnhandledProps)(s,o),y=(0,i.getElementType)(s,o);return n.default.createElement(y,(0,e.default)({},m,{className:h}),i.childrenUtils.isNil(c)?f:c)}s.handledProps=["as","children","className","content"],s.propTypes={};var a=s;return zy.default=a,zy}var Vy={},xV;function W5e(){if(xV)return Vy;xV=1;var t=vr;Vy.__esModule=!0,Vy.default=void 0;var e=t(kn()),r=Qf,n=t(ti);t(Dn());var i=t(Ve),s=zn();function a(c){var u=c.blurring,f=c.children,h=c.className,m=c.centered,y=c.content,w=c.inverted,v=c.mountNode,g=c.scrolling,_=i.default.useRef(),b=(0,n.default)("ui",(0,s.useKeyOnly)(w,"inverted"),(0,s.useKeyOnly)(!m,"top aligned"),"page modals dimmer transition visible active",h),S=(0,n.default)("dimmable dimmed",(0,s.useKeyOnly)(u,"blurring"),(0,s.useKeyOnly)(g,"scrolling")),A=(0,s.getUnhandledProps)(a,c),O=(0,s.getElementType)(a,c);return(0,s.useClassNamesOnNode)(v,S),i.default.useEffect(function(){_.current&&_.current.style&&_.current.style.setProperty("display","flex","important")},[]),i.default.createElement(r.Ref,{innerRef:_},i.default.createElement(O,(0,e.default)({},A,{className:b}),s.childrenUtils.isNil(f)?y:f))}a.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],a.propTypes={},a.create=(0,s.createShorthandFactory)(a,function(c){return{content:c}});var o=a;return Vy.default=o,Vy}var Gy={},AV;function Y5e(){if(AV)return Gy;AV=1;var t=vr;Gy.__esModule=!0,Gy.default=void 0;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(o){var c=o.children,u=o.className,f=o.content,h=(0,r.default)("header",u),m=(0,i.getUnhandledProps)(s,o),y=(0,i.getElementType)(s,o);return n.default.createElement(y,(0,e.default)({},m,{className:h}),i.childrenUtils.isNil(c)?f:c)}s.handledProps=["as","children","className","content"],s.propTypes={},s.create=(0,i.createShorthandFactory)(s,function(o){return{content:o}});var a=s;return Gy.default=a,Gy}var Pu={},SV;function Q5e(){if(SV)return Pu;SV=1,Pu.__esModule=!0,Pu.isLegacy=Pu.getLegacyStyles=Pu.canFit=void 0;var t=0,e=50,r=function(a){var o=a.height+t,c=a.height+t,u=window.innerHeight,f=u/2,h=-(c/2),m=e,y=f+h;return y+o+m<u};Pu.canFit=r;var n=function(a,o,c){var u=o&&a?-(c.height/2):0,f=-(c.width/2);return{marginLeft:f,marginTop:u}};Pu.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Pu.isLegacy=i,Pu}var J5e=Uo,Qi=vr;MA.__esModule=!0;MA.default=void 0;var Lp=Qi(kn()),X5e=Qi(xc()),Z5e=Qi(U2()),e4e=Qi(n4()),t4e=Qi(s4()),r4e=Qi(Qte()),n4e=Qi(yJ()),Gl=Qi(jo()),OV=Qf,i4e=Qi(ti);Qi(Dn());var Tu=J5e(Ve),s4e=Qi(Jte()),Es=zn(),a4e=Qi(z5e()),IV=Qi(o4()),Xte=Qi(G5e()),Zte=Qi(NA),o4e=Qi(K5e()),ere=Qi(W5e()),tre=Qi(Y5e()),LC=Q5e(),lu=function(t){(0,X5e.default)(e,t);function e(){for(var n,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return n=t.call.apply(t,[this].concat(s))||this,n.legacy=(0,Es.isBrowser)()&&(0,LC.isLegacy)(),n.ref=(0,Tu.createRef)(),n.dimmerRef=(0,Tu.createRef)(),n.latestDocumentMouseDownEvent=null,n.getMountNode=function(){return(0,Es.isBrowser)()?n.props.mountNode||document.body:null},n.handleActionsOverrides=function(o){return{onActionClick:function(u,f){(0,Gl.default)(o,"onActionClick",u,f),(0,Gl.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(o){n.setState({open:!1}),(0,Gl.default)(n.props,"onClose",o,(0,Lp.default)({},n.props,{open:!1}))},n.handleDocumentMouseDown=function(o){n.latestDocumentMouseDownEvent=o},n.handleDocumentClick=function(o){var c=n.props.closeOnDimmerClick,u=n.latestDocumentMouseDownEvent;n.latestDocumentMouseDownEvent=null,!(!c||(0,Es.doesNodeContainClick)(n.ref.current,u)||(0,Es.doesNodeContainClick)(n.ref.current,o))&&(n.setState({open:!1}),(0,Gl.default)(n.props,"onClose",o,(0,Lp.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(o){return{onClick:function(u){(0,Gl.default)(o,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(o){(0,Gl.default)(n.props,"onOpen",o,(0,Lp.default)({},n.props,{open:!0})),n.setState({open:!0})},n.handlePortalMount=function(o){var c=n.props.eventPool;n.setState({scrolling:!1}),n.setPositionAndClassNames(),Es.eventStack.sub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Es.eventStack.sub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,Gl.default)(n.props,"onMount",o,n.props)},n.handlePortalUnmount=function(o){var c=n.props.eventPool;cancelAnimationFrame(n.animationRequestId),Es.eventStack.unsub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Es.eventStack.unsub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,Gl.default)(n.props,"onUnmount",o,n.props)},n.setPositionAndClassNames=function(){var o=n.props.centered,c,u={};if(n.ref.current){var f=n.ref.current.getBoundingClientRect(),h=(0,LC.canFit)(f);c=!h;var m=n.legacy?(0,LC.getLegacyStyles)(h,o,f):{};(0,s4e.default)(n.state.legacyStyles,m)||(u.legacyStyles=m),n.state.scrolling!==c&&(u.scrolling=c)}(0,n4e.default)(u)||n.setState(u),n.animationRequestId=requestAnimationFrame(n.setPositionAndClassNames)},n.renderContent=function(o){var c=n.props,u=c.actions,f=c.basic,h=c.children,m=c.className,y=c.closeIcon,w=c.content,v=c.header,g=c.size,_=c.style,b=n.state,S=b.legacyStyles,A=b.scrolling,O=(0,i4e.default)("ui",g,(0,Es.useKeyOnly)(f,"basic"),(0,Es.useKeyOnly)(n.legacy,"legacy"),(0,Es.useKeyOnly)(A,"scrolling"),"modal transition visible active",m),E=(0,Es.getElementType)(e,n.props),p=y===!0?"close":y,I=a4e.default.create(p,{overrideProps:n.handleIconOverrides});return Tu.default.createElement(OV.Ref,{innerRef:n.ref},Tu.default.createElement(E,(0,Lp.default)({},o,{className:O,style:(0,Lp.default)({},S,_)}),I,Es.childrenUtils.isNil(h)?Tu.default.createElement(Tu.default.Fragment,null,tre.default.create(v,{autoGenerateKey:!1}),Zte.default.create(w,{autoGenerateKey:!1}),Xte.default.create(u,{overrideProps:n.handleActionsOverrides})):h))},n}var r=e.prototype;return r.componentWillUnmount=function(){this.handlePortalUnmount()},r.render=function(){var i=this.props,s=i.centered,a=i.closeOnDocumentClick,o=i.dimmer,c=i.eventPool,u=i.trigger,f=this.state,h=f.open,m=f.scrolling,y=this.getMountNode();if(!(0,Es.isBrowser)())return(0,Tu.isValidElement)(u)?u:null;var w=(0,Es.getUnhandledProps)(e,this.props),v=IV.default.handledProps,g=(0,r4e.default)(w,function(b,S,A){return(0,t4e.default)(v,A)||(b[A]=S),b},{}),_=(0,e4e.default)(w,v);return Tu.default.createElement(IV.default,(0,Lp.default)({closeOnDocumentClick:a},_,{trigger:u,eventPool:c,mountNode:y,open:h,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Tu.default.createElement(OV.Ref,{innerRef:this.dimmerRef},ere.default.create((0,Z5e.default)(o)?o:{},{autoGenerateKey:!1,defaultProps:{blurring:o==="blurring",inverted:o==="inverted"},overrideProps:{children:this.renderContent(g),centered:s,mountNode:y,scrolling:m}})))},e}(Es.ModernAutoControlledComponent);lu.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];lu.propTypes={};lu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};lu.autoControlledProps=["open"];lu.Actions=Xte.default;lu.Content=Zte.default;lu.Description=o4e.default;lu.Dimmer=ere.default;lu.Header=tre.default;var c4e=lu;MA.default=c4e;(function(t){var e=$e&&$e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=void 0;var r=MA;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(nM);var iM={};var u4e=$e&&$e.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),l4e=$e&&$e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),f4e=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d4e=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&l4e(e,t,r);return f4e(e,t),e};Object.defineProperty(iM,"__esModule",{value:!0});var sM=iM.ModalNavigation=void 0,Dd=d4e(Ve),h4e=function(t){u4e(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var r=this.props,n=r.title,i=r.subtitle,s=r.onBack,a=r.onClose,o=r.onInfo;return Dd.createElement("div",{className:"dcl modal-navigation"},Dd.createElement("div",{className:"dcl modal-navigation-title"},n),i&&Dd.createElement("div",{className:"dcl modal-navigation-subtitle"},i),s&&Dd.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:s}),o&&Dd.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:o}),a&&Dd.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:a}))},e}(Dd.PureComponent);sM=iM.ModalNavigation=h4e;const p4e="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7359128689.commit-62bca57/assets/warning-057948e8.svg";var Pi=(t=>(t.CONNECTING_WALLET="CONNECTING_WALLET",t.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",t.ERROR="ERROR",t.LOADING_MAGIC="LOADING_MAGIC",t.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",t))(Pi||{});function g4e(t,e){switch(t){case Pi.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case Pi.CONNECTING_WALLET:case Pi.WAITING_FOR_SIGNATURE:return e===ml.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case Pi.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case Pi.LOADING_MAGIC:return"Redirecting..."}}const m4e="_main_1qx1l_1",y4e="_content_1qx1l_8",v4e="_errorImage_1qx1l_16",b4e="_message_1qx1l_22",w4e="_loader_1qx1l_29",Ky={main:m4e,content:y4e,errorImage:v4e,message:b4e,loader:w4e},rre=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:s}=t,a=r===Pi.CONNECTING_WALLET||r===Pi.WAITING_FOR_SIGNATURE||r===Pi.LOADING_MAGIC||r===Pi.VALIDATING_SIGN_IN;return He.jsxs(nM.Modal,{size:"tiny",open:e,children:[He.jsx(sM,{title:"",onClose:a?void 0:i}),He.jsx("div",{className:Ky.main,children:He.jsxs("div",{className:Ky.content,children:[r===Pi.ERROR&&He.jsx("img",{className:Ky.errorImage,src:p4e}),a&&He.jsx(CA,{className:Ky.loader,size:"huge",inline:!0}),He.jsx("p",{className:Ky.message,children:g4e(r,n)}),r===Pi.ERROR&&He.jsx(So.Button,{primary:!0,onClick:s,children:"Try again"})]})}),He.jsx(rM,{})]})};var nre={},ire={},Q6={exports:{}};/*! eth-connect {
163
- "date": "2023-07-25T16:54:29.183Z",
164
- "commit": "1f1f0dd8d57f20ba72bf396bb471e426da394e29",
165
- "ref": "refs/tags/6.2.1"
166
- } */(function(t,e){(function(r,n){n(e)})($e,function(r){function n(P){if(P.jsonrpc="2.0",!P.id||typeof P.id!="number"||Math.floor(P.id)!==P.id)throw new Error(`Invalid RPC message(invalid id) message: ${JSON.stringify(P)}`);if(!P.method||typeof P.method!="string"||P.method.trim().length===0)throw new Error(`Invalid RPC message(invalid method) message: ${JSON.stringify(P)}`);if(!P.params||typeof P.params!="object")throw new Error(`Invalid RPC message(invalid params) message: ${JSON.stringify(P)}`);return P}var i={};function s(){let P,D;const K=new Promise((he,Se)=>{P=Ce=>{he(Ce),K.isPending=!1},D=Ce=>{Se(Ce),K.isPending=!1}}).catch(he=>Promise.reject(he));return K.resolve=P,K.reject=D,"finally"in K||(K.finally=he=>{K.then(he),K.catch(he)}),K.isPending=!0,K}Object.defineProperty(i,"__esModule",{value:!0});var a=i.future=s;i.default=s;var o={exports:{}};/**
167
- * [js-sha3]{@link https://github.com/emn178/js-sha3}
168
- *
169
- * @version 0.8.0
170
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
171
- * @copyright Chen, Yi-Cyuan 2015-2018
172
- * @license MIT
173
- */(function(P){(function(){var D="input is invalid type",K=typeof window=="object",he=K?window:{};he.JS_SHA3_NO_WINDOW&&(K=!1);var Se=!K&&typeof self=="object";!he.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node?he=$e:Se&&(he=self);var Ce=!he.JS_SHA3_NO_COMMON_JS&&P.exports,rt=!he.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",xt="0123456789abcdef".split(""),Lt=[4,1024,262144,67108864],Jt=[0,8,16,24],Oi=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],bn=[224,256,384,512],At=[128,256],ii=["hex","buffer","arrayBuffer","array","digest"],wn={128:168,256:136};!he.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(C){return Object.prototype.toString.call(C)==="[object Array]"}),!rt||!he.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(C){return typeof C=="object"&&C.buffer&&C.buffer.constructor===ArrayBuffer});for(var un=function(C,ae,we){return function(oe){return new sr(C,ae,C).update(oe)[we]()}},pi=function(C,ae,we){return function(oe,Ae){return new sr(C,ae,Ae).update(oe)[we]()}},ra=function(C,ae,we){return function(oe,Ae,Ie,Pe){return _r["cshake"+C].update(oe,Ae,Ie,Pe)[we]()}},Bi=function(C,ae,we){return function(oe,Ae,Ie,Pe){return _r["kmac"+C].update(oe,Ae,Ie,Pe)[we]()}},gi=function(C,ae,we,oe){for(var Ae=0;Ae<ii.length;++Ae){var Ie=ii[Ae];C[Ie]=ae(we,oe,Ie)}return C},na=function(C,ae){var we=un(C,ae,"hex");return we.create=function(){return new sr(C,ae,C)},we.update=function(oe){return we.create().update(oe)},gi(we,un,C,ae)},Zr=[{name:"keccak",padding:[1,256,65536,16777216],bits:bn,createMethod:na},{name:"sha3",padding:[6,1536,393216,100663296],bits:bn,createMethod:na},{name:"shake",padding:[31,7936,2031616,520093696],bits:At,createMethod:function(C,ae){var we=pi(C,ae,"hex");return we.create=function(oe){return new sr(C,ae,oe)},we.update=function(oe,Ae){return we.create(Ae).update(oe)},gi(we,pi,C,ae)}},{name:"cshake",padding:Lt,bits:At,createMethod:function(C,ae){var we=wn[C],oe=ra(C,0,"hex");return oe.create=function(Ae,Ie,Pe){return Ie||Pe?new sr(C,ae,Ae).bytepad([Ie,Pe],we):_r["shake"+C].create(Ae)},oe.update=function(Ae,Ie,Pe,je){return oe.create(Ie,Pe,je).update(Ae)},gi(oe,ra,C,ae)}},{name:"kmac",padding:Lt,bits:At,createMethod:function(C,ae){var we=wn[C],oe=Bi(C,0,"hex");return oe.create=function(Ae,Ie,Pe){return new mr(C,ae,Ie).bytepad(["KMAC",Pe],we).bytepad([Ae],we)},oe.update=function(Ae,Ie,Pe,je){return oe.create(Ae,Pe,je).update(Ie)},gi(oe,Bi,C,ae)}}],_r={},fe=[],ke=0;ke<Zr.length;++ke)for(var it=Zr[ke],We=it.bits,Wr=0;Wr<We.length;++Wr){var fr=it.name+"_"+We[Wr];if(fe.push(fr),_r[fr]=it.createMethod(We[Wr],it.padding),it.name!=="sha3"){var pn=it.name+We[Wr];fe.push(pn),_r[pn]=_r[fr]}}function sr(C,ae,we){this.blocks=[],this.s=[],this.padding=ae,this.outputBits=we,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(C<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=we>>5,this.extraBytes=(31&we)>>3;for(var oe=0;oe<50;++oe)this.s[oe]=0}function mr(C,ae,we){sr.call(this,C,ae,we)}sr.prototype.update=function(C){if(this.finalized)throw new Error("finalize already called");var ae,we=typeof C;if(we!=="string"){if(we!=="object")throw new Error(D);if(C===null)throw new Error(D);if(rt&&C.constructor===ArrayBuffer)C=new Uint8Array(C);else if(!(Array.isArray(C)||rt&&ArrayBuffer.isView(C)))throw new Error(D);ae=!0}for(var oe,Ae,Ie=this.blocks,Pe=this.byteCount,je=C.length,Ye=this.blockCount,qe=0,pt=this.s;qe<je;){if(this.reset)for(this.reset=!1,Ie[0]=this.block,oe=1;oe<Ye+1;++oe)Ie[oe]=0;if(ae)for(oe=this.start;qe<je&&oe<Pe;++qe)Ie[oe>>2]|=C[qe]<<Jt[3&oe++];else for(oe=this.start;qe<je&&oe<Pe;++qe)(Ae=C.charCodeAt(qe))<128?Ie[oe>>2]|=Ae<<Jt[3&oe++]:Ae<2048?(Ie[oe>>2]|=(192|Ae>>6)<<Jt[3&oe++],Ie[oe>>2]|=(128|63&Ae)<<Jt[3&oe++]):Ae<55296||Ae>=57344?(Ie[oe>>2]|=(224|Ae>>12)<<Jt[3&oe++],Ie[oe>>2]|=(128|Ae>>6&63)<<Jt[3&oe++],Ie[oe>>2]|=(128|63&Ae)<<Jt[3&oe++]):(Ae=65536+((1023&Ae)<<10|1023&C.charCodeAt(++qe)),Ie[oe>>2]|=(240|Ae>>18)<<Jt[3&oe++],Ie[oe>>2]|=(128|Ae>>12&63)<<Jt[3&oe++],Ie[oe>>2]|=(128|Ae>>6&63)<<Jt[3&oe++],Ie[oe>>2]|=(128|63&Ae)<<Jt[3&oe++]);if(this.lastByteIndex=oe,oe>=Pe){for(this.start=oe-Pe,this.block=Ie[Ye],oe=0;oe<Ye;++oe)pt[oe]^=Ie[oe];ie(pt),this.reset=!0}else this.start=oe}return this},sr.prototype.encode=function(C,ae){var we=255&C,oe=1,Ae=[we];for(we=255&(C>>=8);we>0;)Ae.unshift(we),we=255&(C>>=8),++oe;return ae?Ae.push(oe):Ae.unshift(oe),this.update(Ae),Ae.length},sr.prototype.encodeString=function(C){var ae,we=typeof C;if(we!=="string"){if(we!=="object")throw new Error(D);if(C===null)throw new Error(D);if(rt&&C.constructor===ArrayBuffer)C=new Uint8Array(C);else if(!(Array.isArray(C)||rt&&ArrayBuffer.isView(C)))throw new Error(D);ae=!0}var oe=0,Ae=C.length;if(ae)oe=Ae;else for(var Ie=0;Ie<C.length;++Ie){var Pe=C.charCodeAt(Ie);Pe<128?oe+=1:Pe<2048?oe+=2:Pe<55296||Pe>=57344?oe+=3:(Pe=65536+((1023&Pe)<<10|1023&C.charCodeAt(++Ie)),oe+=4)}return oe+=this.encode(8*oe),this.update(C),oe},sr.prototype.bytepad=function(C,ae){for(var we=this.encode(ae),oe=0;oe<C.length;++oe)we+=this.encodeString(C[oe]);var Ae=ae-we%ae,Ie=[];return Ie.length=Ae,this.update(Ie),this},sr.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var C=this.blocks,ae=this.lastByteIndex,we=this.blockCount,oe=this.s;if(C[ae>>2]|=this.padding[3&ae],this.lastByteIndex===this.byteCount)for(C[0]=C[we],ae=1;ae<we+1;++ae)C[ae]=0;for(C[we-1]|=2147483648,ae=0;ae<we;++ae)oe[ae]^=C[ae];ie(oe)}},sr.prototype.toString=sr.prototype.hex=function(){this.finalize();for(var C,ae=this.blockCount,we=this.s,oe=this.outputBlocks,Ae=this.extraBytes,Ie=0,Pe=0,je="";Pe<oe;){for(Ie=0;Ie<ae&&Pe<oe;++Ie,++Pe)C=we[Ie],je+=xt[C>>4&15]+xt[15&C]+xt[C>>12&15]+xt[C>>8&15]+xt[C>>20&15]+xt[C>>16&15]+xt[C>>28&15]+xt[C>>24&15];Pe%ae==0&&(ie(we),Ie=0)}return Ae&&(C=we[Ie],je+=xt[C>>4&15]+xt[15&C],Ae>1&&(je+=xt[C>>12&15]+xt[C>>8&15]),Ae>2&&(je+=xt[C>>20&15]+xt[C>>16&15])),je},sr.prototype.arrayBuffer=function(){this.finalize();var C,ae=this.blockCount,we=this.s,oe=this.outputBlocks,Ae=this.extraBytes,Ie=0,Pe=0,je=this.outputBits>>3;C=Ae?new ArrayBuffer(oe+1<<2):new ArrayBuffer(je);for(var Ye=new Uint32Array(C);Pe<oe;){for(Ie=0;Ie<ae&&Pe<oe;++Ie,++Pe)Ye[Pe]=we[Ie];Pe%ae==0&&ie(we)}return Ae&&(Ye[Ie]=we[Ie],C=C.slice(0,je)),C},sr.prototype.buffer=sr.prototype.arrayBuffer,sr.prototype.digest=sr.prototype.array=function(){this.finalize();for(var C,ae,we=this.blockCount,oe=this.s,Ae=this.outputBlocks,Ie=this.extraBytes,Pe=0,je=0,Ye=[];je<Ae;){for(Pe=0;Pe<we&&je<Ae;++Pe,++je)C=je<<2,ae=oe[Pe],Ye[C]=255&ae,Ye[C+1]=ae>>8&255,Ye[C+2]=ae>>16&255,Ye[C+3]=ae>>24&255;je%we==0&&ie(oe)}return Ie&&(C=je<<2,ae=oe[Pe],Ye[C]=255&ae,Ie>1&&(Ye[C+1]=ae>>8&255),Ie>2&&(Ye[C+2]=ae>>16&255)),Ye},mr.prototype=new sr,mr.prototype.finalize=function(){return this.encode(this.outputBits,!0),sr.prototype.finalize.call(this)};var ie=function(C){var ae,we,oe,Ae,Ie,Pe,je,Ye,qe,pt,tr,Gt,Yr,Sn,ln,Mr,Qr,Er,Fi,Qa,Oc,Di,Ja,Mi,ui,_n,fu,qo,ep,ad,od,Il,Pl,cd,tp,Tl,Cl,rp,ud,qi,Rl,Ic,ld,fd,np,ip,sp,ap,op,Ho,cp,up,Nl,dd,Ta,du,lp,fp,dp,zo,ys,hd,hp;for(oe=0;oe<48;oe+=2)Ae=C[0]^C[10]^C[20]^C[30]^C[40],Ie=C[1]^C[11]^C[21]^C[31]^C[41],Pe=C[2]^C[12]^C[22]^C[32]^C[42],je=C[3]^C[13]^C[23]^C[33]^C[43],Ye=C[4]^C[14]^C[24]^C[34]^C[44],qe=C[5]^C[15]^C[25]^C[35]^C[45],pt=C[6]^C[16]^C[26]^C[36]^C[46],tr=C[7]^C[17]^C[27]^C[37]^C[47],ae=(Gt=C[8]^C[18]^C[28]^C[38]^C[48])^(Pe<<1|je>>>31),we=(Yr=C[9]^C[19]^C[29]^C[39]^C[49])^(je<<1|Pe>>>31),C[0]^=ae,C[1]^=we,C[10]^=ae,C[11]^=we,C[20]^=ae,C[21]^=we,C[30]^=ae,C[31]^=we,C[40]^=ae,C[41]^=we,ae=Ae^(Ye<<1|qe>>>31),we=Ie^(qe<<1|Ye>>>31),C[2]^=ae,C[3]^=we,C[12]^=ae,C[13]^=we,C[22]^=ae,C[23]^=we,C[32]^=ae,C[33]^=we,C[42]^=ae,C[43]^=we,ae=Pe^(pt<<1|tr>>>31),we=je^(tr<<1|pt>>>31),C[4]^=ae,C[5]^=we,C[14]^=ae,C[15]^=we,C[24]^=ae,C[25]^=we,C[34]^=ae,C[35]^=we,C[44]^=ae,C[45]^=we,ae=Ye^(Gt<<1|Yr>>>31),we=qe^(Yr<<1|Gt>>>31),C[6]^=ae,C[7]^=we,C[16]^=ae,C[17]^=we,C[26]^=ae,C[27]^=we,C[36]^=ae,C[37]^=we,C[46]^=ae,C[47]^=we,ae=pt^(Ae<<1|Ie>>>31),we=tr^(Ie<<1|Ae>>>31),C[8]^=ae,C[9]^=we,C[18]^=ae,C[19]^=we,C[28]^=ae,C[29]^=we,C[38]^=ae,C[39]^=we,C[48]^=ae,C[49]^=we,Sn=C[0],ln=C[1],ip=C[11]<<4|C[10]>>>28,sp=C[10]<<4|C[11]>>>28,qo=C[20]<<3|C[21]>>>29,ep=C[21]<<3|C[20]>>>29,zo=C[31]<<9|C[30]>>>23,ys=C[30]<<9|C[31]>>>23,Ic=C[40]<<18|C[41]>>>14,ld=C[41]<<18|C[40]>>>14,cd=C[2]<<1|C[3]>>>31,tp=C[3]<<1|C[2]>>>31,Mr=C[13]<<12|C[12]>>>20,Qr=C[12]<<12|C[13]>>>20,ap=C[22]<<10|C[23]>>>22,op=C[23]<<10|C[22]>>>22,ad=C[33]<<13|C[32]>>>19,od=C[32]<<13|C[33]>>>19,hd=C[42]<<2|C[43]>>>30,hp=C[43]<<2|C[42]>>>30,dd=C[5]<<30|C[4]>>>2,Ta=C[4]<<30|C[5]>>>2,Tl=C[14]<<6|C[15]>>>26,Cl=C[15]<<6|C[14]>>>26,Er=C[25]<<11|C[24]>>>21,Fi=C[24]<<11|C[25]>>>21,Ho=C[34]<<15|C[35]>>>17,cp=C[35]<<15|C[34]>>>17,Il=C[45]<<29|C[44]>>>3,Pl=C[44]<<29|C[45]>>>3,Mi=C[6]<<28|C[7]>>>4,ui=C[7]<<28|C[6]>>>4,du=C[17]<<23|C[16]>>>9,lp=C[16]<<23|C[17]>>>9,rp=C[26]<<25|C[27]>>>7,ud=C[27]<<25|C[26]>>>7,Qa=C[36]<<21|C[37]>>>11,Oc=C[37]<<21|C[36]>>>11,up=C[47]<<24|C[46]>>>8,Nl=C[46]<<24|C[47]>>>8,fd=C[8]<<27|C[9]>>>5,np=C[9]<<27|C[8]>>>5,_n=C[18]<<20|C[19]>>>12,fu=C[19]<<20|C[18]>>>12,fp=C[29]<<7|C[28]>>>25,dp=C[28]<<7|C[29]>>>25,qi=C[38]<<8|C[39]>>>24,Rl=C[39]<<8|C[38]>>>24,Di=C[48]<<14|C[49]>>>18,Ja=C[49]<<14|C[48]>>>18,C[0]=Sn^~Mr&Er,C[1]=ln^~Qr&Fi,C[10]=Mi^~_n&qo,C[11]=ui^~fu&ep,C[20]=cd^~Tl&rp,C[21]=tp^~Cl&ud,C[30]=fd^~ip&ap,C[31]=np^~sp&op,C[40]=dd^~du&fp,C[41]=Ta^~lp&dp,C[2]=Mr^~Er&Qa,C[3]=Qr^~Fi&Oc,C[12]=_n^~qo&ad,C[13]=fu^~ep&od,C[22]=Tl^~rp&qi,C[23]=Cl^~ud&Rl,C[32]=ip^~ap&Ho,C[33]=sp^~op&cp,C[42]=du^~fp&zo,C[43]=lp^~dp&ys,C[4]=Er^~Qa&Di,C[5]=Fi^~Oc&Ja,C[14]=qo^~ad&Il,C[15]=ep^~od&Pl,C[24]=rp^~qi&Ic,C[25]=ud^~Rl&ld,C[34]=ap^~Ho&up,C[35]=op^~cp&Nl,C[44]=fp^~zo&hd,C[45]=dp^~ys&hp,C[6]=Qa^~Di&Sn,C[7]=Oc^~Ja&ln,C[16]=ad^~Il&Mi,C[17]=od^~Pl&ui,C[26]=qi^~Ic&cd,C[27]=Rl^~ld&tp,C[36]=Ho^~up&fd,C[37]=cp^~Nl&np,C[46]=zo^~hd&dd,C[47]=ys^~hp&Ta,C[8]=Di^~Sn&Mr,C[9]=Ja^~ln&Qr,C[18]=Il^~Mi&_n,C[19]=Pl^~ui&fu,C[28]=Ic^~cd&Tl,C[29]=ld^~tp&Cl,C[38]=up^~fd&ip,C[39]=Nl^~np&sp,C[48]=hd^~dd&du,C[49]=hp^~Ta&lp,C[0]^=Oi[oe],C[1]^=Oi[oe+1]};if(Ce)P.exports=_r;else for(ke=0;ke<fe.length;++ke)he[fe[ke]]=_r[fe[ke]]})()})(o);var c=o.exports,u=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,f=Math.ceil,h=Math.floor,m="[BigNumber Error] ",y=m+"Number primitive has more than 15 significant digits: ",w=1e14,v=14,g=9007199254740991,_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,S=1e9;function A(P){var D=0|P;return P>0||P===D?D:D-1}function O(P){for(var D,K,he=1,Se=P.length,Ce=P[0]+"";he<Se;){for(D=P[he++]+"",K=v-D.length;K--;D="0"+D);Ce+=D}for(Se=Ce.length;Ce.charCodeAt(--Se)===48;);return Ce.slice(0,Se+1||1)}function E(P,D){var K,he,Se=P.c,Ce=D.c,rt=P.s,xt=D.s,Lt=P.e,Jt=D.e;if(!rt||!xt)return null;if(K=Se&&!Se[0],he=Ce&&!Ce[0],K||he)return K?he?0:-xt:rt;if(rt!=xt)return rt;if(K=rt<0,he=Lt==Jt,!Se||!Ce)return he?0:!Se^K?1:-1;if(!he)return Lt>Jt^K?1:-1;for(xt=(Lt=Se.length)<(Jt=Ce.length)?Lt:Jt,rt=0;rt<xt;rt++)if(Se[rt]!=Ce[rt])return Se[rt]>Ce[rt]^K?1:-1;return Lt==Jt?0:Lt>Jt^K?1:-1}function p(P,D,K,he){if(P<D||P>K||P!==h(P))throw Error(m+(he||"Argument")+(typeof P=="number"?P<D||P>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(P))}function I(P){var D=P.c.length-1;return A(P.e/v)==D&&P.c[D]%2!=0}function N(P,D){return(P.length>1?P.charAt(0)+"."+P.slice(1):P)+(D<0?"e":"e+")+D}function B(P,D,K){var he,Se;if(D<0){for(Se=K+".";++D;Se+=K);P=Se+P}else if(++D>(he=P.length)){for(Se=K,D-=he;--D;Se+=K);P+=Se}else D<he&&(P=P.slice(0,D)+"."+P.slice(D));return P}var V=function P(D){var K,he,Se,Ce,rt,xt,Lt,Jt,Oi,bn,At=We.prototype={constructor:We,toString:null,valueOf:null},ii=new We(1),wn=20,un=4,pi=-7,ra=21,Bi=-1e7,gi=1e7,na=!1,Zr=1,_r=0,fe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},ke="0123456789abcdefghijklmnopqrstuvwxyz",it=!0;function We(ie,C){var ae,we,oe,Ae,Ie,Pe,je,Ye,qe=this;if(!(qe instanceof We))return new We(ie,C);if(C==null){if(ie&&ie._isBigNumber===!0)return qe.s=ie.s,void(!ie.c||ie.e>gi?qe.c=qe.e=null:ie.e<Bi?qe.c=[qe.e=0]:(qe.e=ie.e,qe.c=ie.c.slice()));if((Pe=typeof ie=="number")&&0*ie==0){if(qe.s=1/ie<0?(ie=-ie,-1):1,ie===~~ie){for(Ae=0,Ie=ie;Ie>=10;Ie/=10,Ae++);return void(Ae>gi?qe.c=qe.e=null:(qe.e=Ae,qe.c=[ie]))}Ye=String(ie)}else{if(!u.test(Ye=String(ie)))return Se(qe,Ye,Pe);qe.s=Ye.charCodeAt(0)==45?(Ye=Ye.slice(1),-1):1}(Ae=Ye.indexOf("."))>-1&&(Ye=Ye.replace(".","")),(Ie=Ye.search(/e/i))>0?(Ae<0&&(Ae=Ie),Ae+=+Ye.slice(Ie+1),Ye=Ye.substring(0,Ie)):Ae<0&&(Ae=Ye.length)}else{if(p(C,2,ke.length,"Base"),C==10&&it)return sr(qe=new We(ie),wn+qe.e+1,un);if(Ye=String(ie),Pe=typeof ie=="number"){if(0*ie!=0)return Se(qe,Ye,Pe,C);if(qe.s=1/ie<0?(Ye=Ye.slice(1),-1):1,We.DEBUG&&Ye.replace(/^0\.0*|\./,"").length>15)throw Error(y+ie)}else qe.s=Ye.charCodeAt(0)===45?(Ye=Ye.slice(1),-1):1;for(ae=ke.slice(0,C),Ae=Ie=0,je=Ye.length;Ie<je;Ie++)if(ae.indexOf(we=Ye.charAt(Ie))<0){if(we=="."){if(Ie>Ae){Ae=je;continue}}else if(!oe&&(Ye==Ye.toUpperCase()&&(Ye=Ye.toLowerCase())||Ye==Ye.toLowerCase()&&(Ye=Ye.toUpperCase()))){oe=!0,Ie=-1,Ae=0;continue}return Se(qe,String(ie),Pe,C)}Pe=!1,(Ae=(Ye=he(Ye,C,10,qe.s)).indexOf("."))>-1?Ye=Ye.replace(".",""):Ae=Ye.length}for(Ie=0;Ye.charCodeAt(Ie)===48;Ie++);for(je=Ye.length;Ye.charCodeAt(--je)===48;);if(Ye=Ye.slice(Ie,++je)){if(je-=Ie,Pe&&We.DEBUG&&je>15&&(ie>g||ie!==h(ie)))throw Error(y+qe.s*ie);if((Ae=Ae-Ie-1)>gi)qe.c=qe.e=null;else if(Ae<Bi)qe.c=[qe.e=0];else{if(qe.e=Ae,qe.c=[],Ie=(Ae+1)%v,Ae<0&&(Ie+=v),Ie<je){for(Ie&&qe.c.push(+Ye.slice(0,Ie)),je-=v;Ie<je;)qe.c.push(+Ye.slice(Ie,Ie+=v));Ie=v-(Ye=Ye.slice(Ie)).length}else Ie-=je;for(;Ie--;Ye+="0");qe.c.push(+Ye)}}else qe.c=[qe.e=0]}function Wr(ie,C,ae,we){var oe,Ae,Ie,Pe,je;if(ae==null?ae=un:p(ae,0,8),!ie.c)return ie.toString();if(oe=ie.c[0],Ie=ie.e,C==null)je=O(ie.c),je=we==1||we==2&&(Ie<=pi||Ie>=ra)?N(je,Ie):B(je,Ie,"0");else if(Ae=(ie=sr(new We(ie),C,ae)).e,Pe=(je=O(ie.c)).length,we==1||we==2&&(C<=Ae||Ae<=pi)){for(;Pe<C;je+="0",Pe++);je=N(je,Ae)}else if(C-=Ie,je=B(je,Ae,"0"),Ae+1>Pe){if(--C>0)for(je+=".";C--;je+="0");}else if((C+=Ae-Pe)>0)for(Ae+1==Pe&&(je+=".");C--;je+="0");return ie.s<0&&oe?"-"+je:je}function fr(ie,C){for(var ae,we=1,oe=new We(ie[0]);we<ie.length;we++){if(!(ae=new We(ie[we])).s){oe=ae;break}C.call(oe,ae)&&(oe=ae)}return oe}function pn(ie,C,ae){for(var we=1,oe=C.length;!C[--oe];C.pop());for(oe=C[0];oe>=10;oe/=10,we++);return(ae=we+ae*v-1)>gi?ie.c=ie.e=null:ae<Bi?ie.c=[ie.e=0]:(ie.e=ae,ie.c=C),ie}function sr(ie,C,ae,we){var oe,Ae,Ie,Pe,je,Ye,qe,pt=ie.c,tr=_;if(pt){e:{for(oe=1,Pe=pt[0];Pe>=10;Pe/=10,oe++);if((Ae=C-oe)<0)Ae+=v,Ie=C,qe=(je=pt[Ye=0])/tr[oe-Ie-1]%10|0;else if((Ye=f((Ae+1)/v))>=pt.length){if(!we)break e;for(;pt.length<=Ye;pt.push(0));je=qe=0,oe=1,Ie=(Ae%=v)-v+1}else{for(je=Pe=pt[Ye],oe=1;Pe>=10;Pe/=10,oe++);qe=(Ie=(Ae%=v)-v+oe)<0?0:je/tr[oe-Ie-1]%10|0}if(we=we||C<0||pt[Ye+1]!=null||(Ie<0?je:je%tr[oe-Ie-1]),we=ae<4?(qe||we)&&(ae==0||ae==(ie.s<0?3:2)):qe>5||qe==5&&(ae==4||we||ae==6&&(Ae>0?Ie>0?je/tr[oe-Ie]:0:pt[Ye-1])%10&1||ae==(ie.s<0?8:7)),C<1||!pt[0])return pt.length=0,we?(C-=ie.e+1,pt[0]=tr[(v-C%v)%v],ie.e=-C||0):pt[0]=ie.e=0,ie;if(Ae==0?(pt.length=Ye,Pe=1,Ye--):(pt.length=Ye+1,Pe=tr[v-Ae],pt[Ye]=Ie>0?h(je/tr[oe-Ie]%tr[Ie])*Pe:0),we)for(;;){if(Ye==0){for(Ae=1,Ie=pt[0];Ie>=10;Ie/=10,Ae++);for(Ie=pt[0]+=Pe,Pe=1;Ie>=10;Ie/=10,Pe++);Ae!=Pe&&(ie.e++,pt[0]==w&&(pt[0]=1));break}if(pt[Ye]+=Pe,pt[Ye]!=w)break;pt[Ye--]=0,Pe=1}for(Ae=pt.length;pt[--Ae]===0;pt.pop());}ie.e>gi?ie.c=ie.e=null:ie.e<Bi&&(ie.c=[ie.e=0])}return ie}function mr(ie){var C,ae=ie.e;return ae===null?ie.toString():(C=O(ie.c),C=ae<=pi||ae>=ra?N(C,ae):B(C,ae,"0"),ie.s<0?"-"+C:C)}return We.clone=P,We.ROUND_UP=0,We.ROUND_DOWN=1,We.ROUND_CEIL=2,We.ROUND_FLOOR=3,We.ROUND_HALF_UP=4,We.ROUND_HALF_DOWN=5,We.ROUND_HALF_EVEN=6,We.ROUND_HALF_CEIL=7,We.ROUND_HALF_FLOOR=8,We.EUCLID=9,We.config=We.set=function(ie){var C,ae;if(ie!=null){if(typeof ie!="object")throw Error(m+"Object expected: "+ie);if(ie.hasOwnProperty(C="DECIMAL_PLACES")&&(p(ae=ie[C],0,S,C),wn=ae),ie.hasOwnProperty(C="ROUNDING_MODE")&&(p(ae=ie[C],0,8,C),un=ae),ie.hasOwnProperty(C="EXPONENTIAL_AT")&&((ae=ie[C])&&ae.pop?(p(ae[0],-S,0,C),p(ae[1],0,S,C),pi=ae[0],ra=ae[1]):(p(ae,-S,S,C),pi=-(ra=ae<0?-ae:ae))),ie.hasOwnProperty(C="RANGE"))if((ae=ie[C])&&ae.pop)p(ae[0],-S,-1,C),p(ae[1],1,S,C),Bi=ae[0],gi=ae[1];else{if(p(ae,-S,S,C),!ae)throw Error(m+C+" cannot be zero: "+ae);Bi=-(gi=ae<0?-ae:ae)}if(ie.hasOwnProperty(C="CRYPTO")){if((ae=ie[C])!==!!ae)throw Error(m+C+" not true or false: "+ae);if(ae){if(typeof crypto>"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw na=!ae,Error(m+"crypto unavailable");na=ae}else na=ae}if(ie.hasOwnProperty(C="MODULO_MODE")&&(p(ae=ie[C],0,9,C),Zr=ae),ie.hasOwnProperty(C="POW_PRECISION")&&(p(ae=ie[C],0,S,C),_r=ae),ie.hasOwnProperty(C="FORMAT")){if(typeof(ae=ie[C])!="object")throw Error(m+C+" not an object: "+ae);fe=ae}if(ie.hasOwnProperty(C="ALPHABET")){if(typeof(ae=ie[C])!="string"||/^.?$|[+\-.\s]|(.).*\1/.test(ae))throw Error(m+C+" invalid: "+ae);it=ae.slice(0,10)=="0123456789",ke=ae}}return{DECIMAL_PLACES:wn,ROUNDING_MODE:un,EXPONENTIAL_AT:[pi,ra],RANGE:[Bi,gi],CRYPTO:na,MODULO_MODE:Zr,POW_PRECISION:_r,FORMAT:fe,ALPHABET:ke}},We.isBigNumber=function(ie){if(!ie||ie._isBigNumber!==!0)return!1;if(!We.DEBUG)return!0;var C,ae,we=ie.c,oe=ie.e,Ae=ie.s;e:if({}.toString.call(we)=="[object Array]"){if((Ae===1||Ae===-1)&&oe>=-S&&oe<=S&&oe===h(oe)){if(we[0]===0){if(oe===0&&we.length===1)return!0;break e}if((C=(oe+1)%v)<1&&(C+=v),String(we[0]).length==C){for(C=0;C<we.length;C++)if((ae=we[C])<0||ae>=w||ae!==h(ae))break e;if(ae!==0)return!0}}}else if(we===null&&oe===null&&(Ae===null||Ae===1||Ae===-1))return!0;throw Error(m+"Invalid BigNumber: "+ie)},We.maximum=We.max=function(){return fr(arguments,At.lt)},We.minimum=We.min=function(){return fr(arguments,At.gt)},We.random=(Ce=9007199254740992,rt=Math.random()*Ce&2097151?function(){return h(Math.random()*Ce)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(ie){var C,ae,we,oe,Ae,Ie=0,Pe=[],je=new We(ii);if(ie==null?ie=wn:p(ie,0,S),oe=f(ie/v),na)if(crypto.getRandomValues){for(C=crypto.getRandomValues(new Uint32Array(oe*=2));Ie<oe;)(Ae=131072*C[Ie]+(C[Ie+1]>>>11))>=9e15?(ae=crypto.getRandomValues(new Uint32Array(2)),C[Ie]=ae[0],C[Ie+1]=ae[1]):(Pe.push(Ae%1e14),Ie+=2);Ie=oe/2}else{if(!crypto.randomBytes)throw na=!1,Error(m+"crypto unavailable");for(C=crypto.randomBytes(oe*=7);Ie<oe;)(Ae=281474976710656*(31&C[Ie])+1099511627776*C[Ie+1]+4294967296*C[Ie+2]+16777216*C[Ie+3]+(C[Ie+4]<<16)+(C[Ie+5]<<8)+C[Ie+6])>=9e15?crypto.randomBytes(7).copy(C,Ie):(Pe.push(Ae%1e14),Ie+=7);Ie=oe/7}if(!na)for(;Ie<oe;)(Ae=rt())<9e15&&(Pe[Ie++]=Ae%1e14);for(oe=Pe[--Ie],ie%=v,oe&&ie&&(Ae=_[v-ie],Pe[Ie]=h(oe/Ae)*Ae);Pe[Ie]===0;Pe.pop(),Ie--);if(Ie<0)Pe=[we=0];else{for(we=-1;Pe[0]===0;Pe.splice(0,1),we-=v);for(Ie=1,Ae=Pe[0];Ae>=10;Ae/=10,Ie++);Ie<v&&(we-=v-Ie)}return je.e=we,je.c=Pe,je}),We.sum=function(){for(var ie=1,C=arguments,ae=new We(C[0]);ie<C.length;)ae=ae.plus(C[ie++]);return ae},he=function(){var ie="0123456789";function C(ae,we,oe,Ae){for(var Ie,Pe,je=[0],Ye=0,qe=ae.length;Ye<qe;){for(Pe=je.length;Pe--;je[Pe]*=we);for(je[0]+=Ae.indexOf(ae.charAt(Ye++)),Ie=0;Ie<je.length;Ie++)je[Ie]>oe-1&&(je[Ie+1]==null&&(je[Ie+1]=0),je[Ie+1]+=je[Ie]/oe|0,je[Ie]%=oe)}return je.reverse()}return function(ae,we,oe,Ae,Ie){var Pe,je,Ye,qe,pt,tr,Gt,Yr,Sn=ae.indexOf("."),ln=wn,Mr=un;for(Sn>=0&&(qe=_r,_r=0,ae=ae.replace(".",""),tr=(Yr=new We(we)).pow(ae.length-Sn),_r=qe,Yr.c=C(B(O(tr.c),tr.e,"0"),10,oe,ie),Yr.e=Yr.c.length),Ye=qe=(Gt=C(ae,we,oe,Ie?(Pe=ke,ie):(Pe=ie,ke))).length;Gt[--qe]==0;Gt.pop());if(!Gt[0])return Pe.charAt(0);if(Sn<0?--Ye:(tr.c=Gt,tr.e=Ye,tr.s=Ae,Gt=(tr=K(tr,Yr,ln,Mr,oe)).c,pt=tr.r,Ye=tr.e),Sn=Gt[je=Ye+ln+1],qe=oe/2,pt=pt||je<0||Gt[je+1]!=null,pt=Mr<4?(Sn!=null||pt)&&(Mr==0||Mr==(tr.s<0?3:2)):Sn>qe||Sn==qe&&(Mr==4||pt||Mr==6&&1&Gt[je-1]||Mr==(tr.s<0?8:7)),je<1||!Gt[0])ae=pt?B(Pe.charAt(1),-ln,Pe.charAt(0)):Pe.charAt(0);else{if(Gt.length=je,pt)for(--oe;++Gt[--je]>oe;)Gt[je]=0,je||(++Ye,Gt=[1].concat(Gt));for(qe=Gt.length;!Gt[--qe];);for(Sn=0,ae="";Sn<=qe;ae+=Pe.charAt(Gt[Sn++]));ae=B(ae,Ye,Pe.charAt(0))}return ae}}(),K=function(){function ie(we,oe,Ae){var Ie,Pe,je,Ye,qe=0,pt=we.length,tr=oe%b,Gt=oe/b|0;for(we=we.slice();pt--;)qe=((Pe=tr*(je=we[pt]%b)+(Ie=Gt*je+(Ye=we[pt]/b|0)*tr)%b*b+qe)/Ae|0)+(Ie/b|0)+Gt*Ye,we[pt]=Pe%Ae;return qe&&(we=[qe].concat(we)),we}function C(we,oe,Ae,Ie){var Pe,je;if(Ae!=Ie)je=Ae>Ie?1:-1;else for(Pe=je=0;Pe<Ae;Pe++)if(we[Pe]!=oe[Pe]){je=we[Pe]>oe[Pe]?1:-1;break}return je}function ae(we,oe,Ae,Ie){for(var Pe=0;Ae--;)we[Ae]-=Pe,Pe=we[Ae]<oe[Ae]?1:0,we[Ae]=Pe*Ie+we[Ae]-oe[Ae];for(;!we[0]&&we.length>1;we.splice(0,1));}return function(we,oe,Ae,Ie,Pe){var je,Ye,qe,pt,tr,Gt,Yr,Sn,ln,Mr,Qr,Er,Fi,Qa,Oc,Di,Ja,Mi=we.s==oe.s?1:-1,ui=we.c,_n=oe.c;if(!(ui&&ui[0]&&_n&&_n[0]))return new We(we.s&&oe.s&&(ui?!_n||ui[0]!=_n[0]:_n)?ui&&ui[0]==0||!_n?0*Mi:Mi/0:NaN);for(ln=(Sn=new We(Mi)).c=[],Mi=Ae+(Ye=we.e-oe.e)+1,Pe||(Pe=w,Ye=A(we.e/v)-A(oe.e/v),Mi=Mi/v|0),qe=0;_n[qe]==(ui[qe]||0);qe++);if(_n[qe]>(ui[qe]||0)&&Ye--,Mi<0)ln.push(1),pt=!0;else{for(Qa=ui.length,Di=_n.length,qe=0,Mi+=2,(tr=h(Pe/(_n[0]+1)))>1&&(_n=ie(_n,tr,Pe),ui=ie(ui,tr,Pe),Di=_n.length,Qa=ui.length),Fi=Di,Qr=(Mr=ui.slice(0,Di)).length;Qr<Di;Mr[Qr++]=0);Ja=_n.slice(),Ja=[0].concat(Ja),Oc=_n[0],_n[1]>=Pe/2&&Oc++;do{if(tr=0,(je=C(_n,Mr,Di,Qr))<0){if(Er=Mr[0],Di!=Qr&&(Er=Er*Pe+(Mr[1]||0)),(tr=h(Er/Oc))>1)for(tr>=Pe&&(tr=Pe-1),Yr=(Gt=ie(_n,tr,Pe)).length,Qr=Mr.length;C(Gt,Mr,Yr,Qr)==1;)tr--,ae(Gt,Di<Yr?Ja:_n,Yr,Pe),Yr=Gt.length,je=1;else tr==0&&(je=tr=1),Yr=(Gt=_n.slice()).length;if(Yr<Qr&&(Gt=[0].concat(Gt)),ae(Mr,Gt,Qr,Pe),Qr=Mr.length,je==-1)for(;C(_n,Mr,Di,Qr)<1;)tr++,ae(Mr,Di<Qr?Ja:_n,Qr,Pe),Qr=Mr.length}else je===0&&(tr++,Mr=[0]);ln[qe++]=tr,Mr[0]?Mr[Qr++]=ui[Fi]||0:(Mr=[ui[Fi]],Qr=1)}while((Fi++<Qa||Mr[0]!=null)&&Mi--);pt=Mr[0]!=null,ln[0]||ln.splice(0,1)}if(Pe==w){for(qe=1,Mi=ln[0];Mi>=10;Mi/=10,qe++);sr(Sn,Ae+(Sn.e=qe+Ye*v-1)+1,Ie,pt)}else Sn.e=Ye,Sn.r=+pt;return Sn}}(),xt=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Lt=/^([^.]+)\.$/,Jt=/^\.([^.]+)$/,Oi=/^-?(Infinity|NaN)$/,bn=/^\s*\+(?=[\w.])|^\s+|\s+$/g,Se=function(ie,C,ae,we){var oe,Ae=ae?C:C.replace(bn,"");if(Oi.test(Ae))ie.s=isNaN(Ae)?null:Ae<0?-1:1;else{if(!ae&&(Ae=Ae.replace(xt,function(Ie,Pe,je){return oe=(je=je.toLowerCase())=="x"?16:je=="b"?2:8,we&&we!=oe?Ie:Pe}),we&&(oe=we,Ae=Ae.replace(Lt,"$1").replace(Jt,"0.$1")),C!=Ae))return new We(Ae,oe);if(We.DEBUG)throw Error(m+"Not a"+(we?" base "+we:"")+" number: "+C);ie.s=null}ie.c=ie.e=null},At.absoluteValue=At.abs=function(){var ie=new We(this);return ie.s<0&&(ie.s=1),ie},At.comparedTo=function(ie,C){return E(this,new We(ie,C))},At.decimalPlaces=At.dp=function(ie,C){var ae,we,oe,Ae=this;if(ie!=null)return p(ie,0,S),C==null?C=un:p(C,0,8),sr(new We(Ae),ie+Ae.e+1,C);if(!(ae=Ae.c))return null;if(we=((oe=ae.length-1)-A(this.e/v))*v,oe=ae[oe])for(;oe%10==0;oe/=10,we--);return we<0&&(we=0),we},At.dividedBy=At.div=function(ie,C){return K(this,new We(ie,C),wn,un)},At.dividedToIntegerBy=At.idiv=function(ie,C){return K(this,new We(ie,C),0,1)},At.exponentiatedBy=At.pow=function(ie,C){var ae,we,oe,Ae,Ie,Pe,je,Ye,qe=this;if((ie=new We(ie)).c&&!ie.isInteger())throw Error(m+"Exponent not an integer: "+mr(ie));if(C!=null&&(C=new We(C)),Ie=ie.e>14,!qe.c||!qe.c[0]||qe.c[0]==1&&!qe.e&&qe.c.length==1||!ie.c||!ie.c[0])return Ye=new We(Math.pow(+mr(qe),Ie?ie.s*(2-I(ie)):+mr(ie))),C?Ye.mod(C):Ye;if(Pe=ie.s<0,C){if(C.c?!C.c[0]:!C.s)return new We(NaN);(we=!Pe&&qe.isInteger()&&C.isInteger())&&(qe=qe.mod(C))}else{if(ie.e>9&&(qe.e>0||qe.e<-1||(qe.e==0?qe.c[0]>1||Ie&&qe.c[1]>=24e7:qe.c[0]<8e13||Ie&&qe.c[0]<=9999975e7)))return Ae=qe.s<0&&I(ie)?-0:0,qe.e>-1&&(Ae=1/Ae),new We(Pe?1/Ae:Ae);_r&&(Ae=f(_r/v+2))}for(Ie?(ae=new We(.5),Pe&&(ie.s=1),je=I(ie)):je=(oe=Math.abs(+mr(ie)))%2,Ye=new We(ii);;){if(je){if(!(Ye=Ye.times(qe)).c)break;Ae?Ye.c.length>Ae&&(Ye.c.length=Ae):we&&(Ye=Ye.mod(C))}if(oe){if((oe=h(oe/2))===0)break;je=oe%2}else if(sr(ie=ie.times(ae),ie.e+1,1),ie.e>14)je=I(ie);else{if((oe=+mr(ie))==0)break;je=oe%2}qe=qe.times(qe),Ae?qe.c&&qe.c.length>Ae&&(qe.c.length=Ae):we&&(qe=qe.mod(C))}return we?Ye:(Pe&&(Ye=ii.div(Ye)),C?Ye.mod(C):Ae?sr(Ye,_r,un,void 0):Ye)},At.integerValue=function(ie){var C=new We(this);return ie==null?ie=un:p(ie,0,8),sr(C,C.e+1,ie)},At.isEqualTo=At.eq=function(ie,C){return E(this,new We(ie,C))===0},At.isFinite=function(){return!!this.c},At.isGreaterThan=At.gt=function(ie,C){return E(this,new We(ie,C))>0},At.isGreaterThanOrEqualTo=At.gte=function(ie,C){return(C=E(this,new We(ie,C)))===1||C===0},At.isInteger=function(){return!!this.c&&A(this.e/v)>this.c.length-2},At.isLessThan=At.lt=function(ie,C){return E(this,new We(ie,C))<0},At.isLessThanOrEqualTo=At.lte=function(ie,C){return(C=E(this,new We(ie,C)))===-1||C===0},At.isNaN=function(){return!this.s},At.isNegative=function(){return this.s<0},At.isPositive=function(){return this.s>0},At.isZero=function(){return!!this.c&&this.c[0]==0},At.minus=function(ie,C){var ae,we,oe,Ae,Ie=this,Pe=Ie.s;if(C=(ie=new We(ie,C)).s,!Pe||!C)return new We(NaN);if(Pe!=C)return ie.s=-C,Ie.plus(ie);var je=Ie.e/v,Ye=ie.e/v,qe=Ie.c,pt=ie.c;if(!je||!Ye){if(!qe||!pt)return qe?(ie.s=-C,ie):new We(pt?Ie:NaN);if(!qe[0]||!pt[0])return pt[0]?(ie.s=-C,ie):new We(qe[0]?Ie:un==3?-0:0)}if(je=A(je),Ye=A(Ye),qe=qe.slice(),Pe=je-Ye){for((Ae=Pe<0)?(Pe=-Pe,oe=qe):(Ye=je,oe=pt),oe.reverse(),C=Pe;C--;oe.push(0));oe.reverse()}else for(we=(Ae=(Pe=qe.length)<(C=pt.length))?Pe:C,Pe=C=0;C<we;C++)if(qe[C]!=pt[C]){Ae=qe[C]<pt[C];break}if(Ae&&(oe=qe,qe=pt,pt=oe,ie.s=-ie.s),(C=(we=pt.length)-(ae=qe.length))>0)for(;C--;qe[ae++]=0);for(C=w-1;we>Pe;){if(qe[--we]<pt[we]){for(ae=we;ae&&!qe[--ae];qe[ae]=C);--qe[ae],qe[we]+=w}qe[we]-=pt[we]}for(;qe[0]==0;qe.splice(0,1),--Ye);return qe[0]?pn(ie,qe,Ye):(ie.s=un==3?-1:1,ie.c=[ie.e=0],ie)},At.modulo=At.mod=function(ie,C){var ae,we,oe=this;return ie=new We(ie,C),!oe.c||!ie.s||ie.c&&!ie.c[0]?new We(NaN):!ie.c||oe.c&&!oe.c[0]?new We(oe):(Zr==9?(we=ie.s,ie.s=1,ae=K(oe,ie,0,3),ie.s=we,ae.s*=we):ae=K(oe,ie,0,Zr),(ie=oe.minus(ae.times(ie))).c[0]||Zr!=1||(ie.s=oe.s),ie)},At.multipliedBy=At.times=function(ie,C){var ae,we,oe,Ae,Ie,Pe,je,Ye,qe,pt,tr,Gt,Yr,Sn,ln,Mr=this,Qr=Mr.c,Er=(ie=new We(ie,C)).c;if(!(Qr&&Er&&Qr[0]&&Er[0]))return!Mr.s||!ie.s||Qr&&!Qr[0]&&!Er||Er&&!Er[0]&&!Qr?ie.c=ie.e=ie.s=null:(ie.s*=Mr.s,Qr&&Er?(ie.c=[0],ie.e=0):ie.c=ie.e=null),ie;for(we=A(Mr.e/v)+A(ie.e/v),ie.s*=Mr.s,(je=Qr.length)<(pt=Er.length)&&(Yr=Qr,Qr=Er,Er=Yr,oe=je,je=pt,pt=oe),oe=je+pt,Yr=[];oe--;Yr.push(0));for(Sn=w,ln=b,oe=pt;--oe>=0;){for(ae=0,tr=Er[oe]%ln,Gt=Er[oe]/ln|0,Ae=oe+(Ie=je);Ae>oe;)ae=((Ye=tr*(Ye=Qr[--Ie]%ln)+(Pe=Gt*Ye+(qe=Qr[Ie]/ln|0)*tr)%ln*ln+Yr[Ae]+ae)/Sn|0)+(Pe/ln|0)+Gt*qe,Yr[Ae--]=Ye%Sn;Yr[Ae]=ae}return ae?++we:Yr.splice(0,1),pn(ie,Yr,we)},At.negated=function(){var ie=new We(this);return ie.s=-ie.s||null,ie},At.plus=function(ie,C){var ae,we=this,oe=we.s;if(C=(ie=new We(ie,C)).s,!oe||!C)return new We(NaN);if(oe!=C)return ie.s=-C,we.minus(ie);var Ae=we.e/v,Ie=ie.e/v,Pe=we.c,je=ie.c;if(!Ae||!Ie){if(!Pe||!je)return new We(oe/0);if(!Pe[0]||!je[0])return je[0]?ie:new We(Pe[0]?we:0*oe)}if(Ae=A(Ae),Ie=A(Ie),Pe=Pe.slice(),oe=Ae-Ie){for(oe>0?(Ie=Ae,ae=je):(oe=-oe,ae=Pe),ae.reverse();oe--;ae.push(0));ae.reverse()}for((oe=Pe.length)-(C=je.length)<0&&(ae=je,je=Pe,Pe=ae,C=oe),oe=0;C;)oe=(Pe[--C]=Pe[C]+je[C]+oe)/w|0,Pe[C]=w===Pe[C]?0:Pe[C]%w;return oe&&(Pe=[oe].concat(Pe),++Ie),pn(ie,Pe,Ie)},At.precision=At.sd=function(ie,C){var ae,we,oe,Ae=this;if(ie!=null&&ie!==!!ie)return p(ie,1,S),C==null?C=un:p(C,0,8),sr(new We(Ae),ie,C);if(!(ae=Ae.c))return null;if(we=(oe=ae.length-1)*v+1,oe=ae[oe]){for(;oe%10==0;oe/=10,we--);for(oe=ae[0];oe>=10;oe/=10,we++);}return ie&&Ae.e+1>we&&(we=Ae.e+1),we},At.shiftedBy=function(ie){return p(ie,-9007199254740991,g),this.times("1e"+ie)},At.squareRoot=At.sqrt=function(){var ie,C,ae,we,oe,Ae=this,Ie=Ae.c,Pe=Ae.s,je=Ae.e,Ye=wn+4,qe=new We("0.5");if(Pe!==1||!Ie||!Ie[0])return new We(!Pe||Pe<0&&(!Ie||Ie[0])?NaN:Ie?Ae:1/0);if((Pe=Math.sqrt(+mr(Ae)))==0||Pe==1/0?(((C=O(Ie)).length+je)%2==0&&(C+="0"),Pe=Math.sqrt(+C),je=A((je+1)/2)-(je<0||je%2),ae=new We(C=Pe==1/0?"5e"+je:(C=Pe.toExponential()).slice(0,C.indexOf("e")+1)+je)):ae=new We(Pe+""),ae.c[0]){for((Pe=(je=ae.e)+Ye)<3&&(Pe=0);;)if(oe=ae,ae=qe.times(oe.plus(K(Ae,oe,Ye,1))),O(oe.c).slice(0,Pe)===(C=O(ae.c)).slice(0,Pe)){if(ae.e<je&&--Pe,(C=C.slice(Pe-3,Pe+1))!="9999"&&(we||C!="4999")){+C&&(+C.slice(1)||C.charAt(0)!="5")||(sr(ae,ae.e+wn+2,1),ie=!ae.times(ae).eq(Ae));break}if(!we&&(sr(oe,oe.e+wn+2,0),oe.times(oe).eq(Ae))){ae=oe;break}Ye+=4,Pe+=4,we=1}}return sr(ae,ae.e+wn+1,un,ie)},At.toExponential=function(ie,C){return ie!=null&&(p(ie,0,S),ie++),Wr(this,ie,C,1)},At.toFixed=function(ie,C){return ie!=null&&(p(ie,0,S),ie=ie+this.e+1),Wr(this,ie,C)},At.toFormat=function(ie,C,ae){var we,oe=this;if(ae==null)ie!=null&&C&&typeof C=="object"?(ae=C,C=null):ie&&typeof ie=="object"?(ae=ie,ie=C=null):ae=fe;else if(typeof ae!="object")throw Error(m+"Argument not an object: "+ae);if(we=oe.toFixed(ie,C),oe.c){var Ae,Ie=we.split("."),Pe=+ae.groupSize,je=+ae.secondaryGroupSize,Ye=ae.groupSeparator||"",qe=Ie[0],pt=Ie[1],tr=oe.s<0,Gt=tr?qe.slice(1):qe,Yr=Gt.length;if(je&&(Ae=Pe,Pe=je,je=Ae,Yr-=Ae),Pe>0&&Yr>0){for(Ae=Yr%Pe||Pe,qe=Gt.substr(0,Ae);Ae<Yr;Ae+=Pe)qe+=Ye+Gt.substr(Ae,Pe);je>0&&(qe+=Ye+Gt.slice(Ae)),tr&&(qe="-"+qe)}we=pt?qe+(ae.decimalSeparator||"")+((je=+ae.fractionGroupSize)?pt.replace(new RegExp("\\d{"+je+"}\\B","g"),"$&"+(ae.fractionGroupSeparator||"")):pt):qe}return(ae.prefix||"")+we+(ae.suffix||"")},At.toFraction=function(ie){var C,ae,we,oe,Ae,Ie,Pe,je,Ye,qe,pt,tr,Gt=this,Yr=Gt.c;if(ie!=null&&(!(Pe=new We(ie)).isInteger()&&(Pe.c||Pe.s!==1)||Pe.lt(ii)))throw Error(m+"Argument "+(Pe.isInteger()?"out of range: ":"not an integer: ")+mr(Pe));if(!Yr)return new We(Gt);for(C=new We(ii),Ye=ae=new We(ii),we=je=new We(ii),tr=O(Yr),Ae=C.e=tr.length-Gt.e-1,C.c[0]=_[(Ie=Ae%v)<0?v+Ie:Ie],ie=!ie||Pe.comparedTo(C)>0?Ae>0?C:Ye:Pe,Ie=gi,gi=1/0,Pe=new We(tr),je.c[0]=0;qe=K(Pe,C,0,1),(oe=ae.plus(qe.times(we))).comparedTo(ie)!=1;)ae=we,we=oe,Ye=je.plus(qe.times(oe=Ye)),je=oe,C=Pe.minus(qe.times(oe=C)),Pe=oe;return oe=K(ie.minus(ae),we,0,1),je=je.plus(oe.times(Ye)),ae=ae.plus(oe.times(we)),je.s=Ye.s=Gt.s,pt=K(Ye,we,Ae*=2,un).minus(Gt).abs().comparedTo(K(je,ae,Ae,un).minus(Gt).abs())<1?[Ye,we]:[je,ae],gi=Ie,pt},At.toNumber=function(){return+mr(this)},At.toPrecision=function(ie,C){return ie!=null&&p(ie,1,S),Wr(this,ie,C,2)},At.toString=function(ie){var C,ae=this,we=ae.s,oe=ae.e;return oe===null?we?(C="Infinity",we<0&&(C="-"+C)):C="NaN":(ie==null?C=oe<=pi||oe>=ra?N(O(ae.c),oe):B(O(ae.c),oe,"0"):ie===10&&it?C=B(O((ae=sr(new We(ae),wn+oe+1,un)).c),ae.e,"0"):(p(ie,2,ke.length,"Base"),C=he(B(O(ae.c),oe,"0"),10,ie,we,!0)),we<0&&ae.c[0]&&(C="-"+C)),C},At.valueOf=At.toJSON=function(){return mr(this)},At._isBigNumber=!0,At[Symbol.toStringTag]="BigNumber",At[Symbol.for("nodejs.util.inspect.custom")]=At.valueOf,D!=null&&We.set(D),We}();const de={ROUNDING_MODE:V.ROUND_DOWN};function ve(P){return new TextEncoder().encode(P)}function j(P){return typeof P=="string"?j(U(P)):new TextDecoder().decode(P)}V.config(de);const L="UNKNOWN_ERROR",Y="INVALID_ARGUMENT";function ne(P,D=L,K={}){const he=[];Object.keys(K).forEach(rt=>{try{he.push(rt+"="+JSON.stringify(K[rt]))}catch{he.push(rt+"="+JSON.stringify(K[rt].toString()))}});const Se=P;he.length&&(P+=" ("+he.join(", ")+")");const Ce=new Error(P);return Ce.reason=Se,Ce.code=D,Object.keys(K).forEach(function(rt){Ce[rt]=K[rt]}),Ce}function U(P){if(typeof P!="string")throw new Error("hexToBytes only accept strings, got: "+typeof P);if(P.substr(0,2)==="0x")return U(P.substr(2));const D=new Uint8Array(Math.ceil(P.length/2));let K=0;for(let he=0;he<P.length;he+=2){const Se=parseInt(P.substr(he,2),16);if(isNaN(Se))throw new Error("Cannot read hex string:"+JSON.stringify(P));D[K]=Se,K++}return D}function F(P){return Array.from(P).map(D=>D.toString(16).padStart(2,"0")).join("")}function H(P,D){if(typeof P=="string"){if(D&&D.encoding==="hex"&&typeof P=="string"){let K=P;K.length>2&&K.substr(0,2)==="0x"&&(K=K.substr(2));const he=U(K);return c.keccak256(he)}return c.keccak256(ve(P))}return c.keccak256(P)}const M={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function q(P,D,K){return new Array(D-P.length+1).join(K||"0")+P}function $(P){let D="",K=0;const he=P.length;for(P.substring(0,2)==="0x"&&(K=2);K<he;K+=2){const Se=parseInt(P.substr(K,2),16);D+=String.fromCharCode(Se)}return D}function k(P){return rr(P)&&P.name&&P.name.indexOf("(")!==-1?P.name:P.name+"("+pe(!1,P.inputs||[]).join(",")+")"}function G(...P){const D=P.reduce((Se,Ce)=>Se+Ce.length,0),K=new Uint8Array(D);let he=0;for(const Se of P)K.set(Se,he),he+=Se.length;return K}function pe(P,D){const K=[];return D.forEach(function(he){if(typeof he.components=="object"){if(he.type.substring(0,5)!=="tuple")throw new Error("components found but type is not tuple; report on GitHub");let Se="";const Ce=he.type.indexOf("[");Ce>=0&&(Se=he.type.substring(Ce));const rt=pe(P,he.components);ir(rt)&&P?K.push("tuple("+rt.join(",")+")"+Se):P?K.push("("+rt+")"):K.push("("+rt.join(",")+")"+Se)}else K.push(he.type)}),K}function Q(P){const D=P.indexOf("("),K=P.indexOf(")");return D!==-1&&K!==-1?P.substr(0,D):P}function te(P){const D=P.indexOf("("),K=P.indexOf(")");return D!==-1&&K!==-1?P.substr(D+1,K-D-1).replace(" ",""):""}function ce(P){return P==null?P:Zt(P).toNumber()}function T(P){return Zt(P).toNumber()}function le(P){return Mt(P)?P.toString(10):""+P}function Ge(P){return typeof P=="string"&&!P.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(P)?"0x"+P:gt(P)}function tt(P){if(typeof P=="string")return P.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(P)?gt(P):"0x"+F(ve(P));if(P instanceof Uint8Array)return"0x"+F(P);throw new Error(`toStringData: Error trying to convert ${P} (${typeof P}) to a hex string.`)}function yt(P){return typeof P=="boolean"?P:Zt(P).toNumber()!==0}function vt(P){const D=Zt(P),K=D.toString(16);return D.isLessThan(0)?"-0x"+K.substr(1):"0x"+K}function gt(P){if(ar(P))return vt(+P);if(Mt(P))return vt(P);if(ur(P)){const D=P;if(D.indexOf("-0x")===0)return vt(D);if(D.indexOf("0x")===0)return D;if(!isFinite(D))return F(ve(D))}if(P instanceof Uint8Array)return"0x"+F(P);if(ir(P)||rr(P))throw new Error("toHex can only be called with scalar values, not objects or arrays");return vt(P)}function Bt(P){const D=P?P.toLowerCase():"ether",K=M[D];if(K===void 0)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(M,null,2));return new V(K,10)}function Zt(P){let D=P||0;return Mt(D)?D:(typeof D=="string"&&(D=D.trim()),typeof D!="string"||D.indexOf("0x")!==0&&D.indexOf("-0x")!==0?D instanceof Uint8Array?new V(F(D),16):new V(D,10):new V(D.replace("0x","").toLowerCase(),16))}function Or(P){return new V(new Array(P).fill("1").join(""),2)}function Ct(P,D=256){const K=Zt(P).integerValue();return K.isLessThan(0)?Or(D).plus(K).plus(1):K}function Pt(P,D){return q(P.toString(2),D,"0")[0]==="1"}function $t(P){if(typeof P!="string")throw ne("invalid address",Y,{arg:"address",value:P});if(P.trim().match(/^(0x)?[0-9a-fA-F]{40}$/))return P.trim().substring(0,2)!=="0x"&&(P="0x"+P),Dt(P);throw ne("invalid address",Y,{arg:"address",value:P})}function Rt(P,D=256){if(Pt(P,D)){const K=Or(D);return P.minus(K).minus(1)}return P}function Wt(P){return/^0x[0-9a-f]{40}$/i.test(P)}function Ft(P){return!!/^(0x)?[0-9a-f]{40}$/i.test(P)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(P)&&!/^(0x)?[0-9A-F]{40}$/.test(P))||Kt(P))}function Kt(P){const D=P.replace("0x",""),K=H(D.toLowerCase());for(let he=0;he<40;he++)if(parseInt(K[he],16)>7&&D[he].toUpperCase()!==D[he]||parseInt(K[he],16)<=7&&D[he].toLowerCase()!==D[he])return!1;return!0}function Dt(P){if(P===void 0)return"";const D=P.toLowerCase().replace("0x",""),K=H(D);let he="0x";for(let Se=0;Se<D.length;Se++)parseInt(K[Se],16)>7?he+=D[Se].toUpperCase():he+=D[Se];return he}function Nt(P){if(!Array.isArray(P))throw new Error(`Value was not an array: ${JSON.stringify(P)}`);return P}function Vt(P){return Wt(P)?P:/^[0-9a-f]{40}$/.test(P)?"0x"+P:"0x"+q(gt(P).substr(2),40)}function Mt(P){return P instanceof V}function ur(P){return typeof P=="string"||P&&P.constructor&&P.constructor.name==="String"}function rr(P){return P!==null&&!Array.isArray(P)&&typeof P=="object"}function ar(P){return typeof P=="boolean"}function ir(P){return Array.isArray(P)}var wr,An;function rn(P,D){if(!P)throw new Error("jsonrpc method should be specified!");if(typeof P!="string")throw new Error(`jsonrpc must be a string, got ${typeof P}!`);return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:P,params:D||[]}}function hi(P){return Array.isArray(P)?P.every(D):D(P);function D(K){return!!K&&!("error"in K)&&K.jsonrpc==="2.0"&&typeof K.id=="number"&&K.result!==void 0}}r.TransactionStatus=void 0,(wr=r.TransactionStatus||(r.TransactionStatus={})).pending="pending",wr.confirmed="confirmed",wr.failed="failed",r.TransactionType=void 0,(An=r.TransactionType||(r.TransactionType={})).queued="queued",An.dropped="dropped",An.replaced="replaced",An.pending="pending",An.reverted="reverted",An.confirmed="confirmed",r.messageId=0;function $n(P){return Zt(P)}function Ln(P){return P==="latest"||P==="pending"||P==="earliest"}function ri(P){return P===void 0?"latest":Cr(P)}function Cr(P){return P==null?null:Ln(P)?P:gt(P)}function Br(P){return P.from&&(P.from=Ze(P.from)),P.to&&(P.to=Ze(P.to)),P.gasPrice!==void 0&&(P.gasPrice=vt(P.gasPrice)),P.gas!==void 0&&(P.gas=vt(P.gas)),P.value!==void 0&&(P.value=vt(P.value)),P.nonce!==void 0&&(P.nonce=vt(P.nonce)),P.data&&!P.data.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(P.data)&&(P.data="0x"+P.data),P}function Ir(P){if(typeof P!="string")throw new Error("The provided input for transactionId is not a string, got: "+JSON.stringify(P));if(P.indexOf("0x")!==0)throw new Error("TransactionID must start with 0x, got: "+JSON.stringify(P));if(P.length!==66)throw new Error("TransactionID must be a 32 byte hex, got: "+JSON.stringify(P));return P}function _e(P){if(typeof P!="object")throw new Error("Did not provide transaction options");if(!P.from)throw new Error('Missing "from" in transaction options');return P.from=Ze(P.from),P.to&&(P.to=Ze(P.to)),P.gasPrice!==void 0&&(P.gasPrice=vt(P.gasPrice)),P.gas!==void 0&&(P.gas=vt(P.gas)),P.value!==void 0&&(P.value=vt(P.value)),P.nonce!==void 0&&(P.nonce=vt(P.nonce)),P.data&&!P.data.startsWith("0x")&&/^[A-Za-z0-9]+$/.test(P.data)&&(P.data="0x"+P.data),P}function ee(P){return P?(P.blockNumber!==null&&(P.blockNumber=T(P.blockNumber)),P.transactionIndex!==null&&(P.transactionIndex=T(P.transactionIndex)),P.nonce=T(P.nonce),P.gas=T(P.gas),P.gasPrice=Zt(P.gasPrice),P.value=Zt(P.value),P):null}function ye(P){return P?(P.blockNumber!==null&&(P.blockNumber=T(P.blockNumber)),P.transactionIndex!==null&&(P.transactionIndex=T(P.transactionIndex)),P.cumulativeGasUsed=T(P.cumulativeGasUsed),P.gasUsed=T(P.gasUsed),P.logs&&ir(P.logs)&&(P.logs=P.logs.map(function(D){return ze(D)})),P.status=T(P.status||""),P):null}function Re(P){return P?(P.gasLimit=T(P.gasLimit),P.gasUsed=T(P.gasUsed),P.size=T(P.size),P.timestamp=T(P.timestamp),P.number!==null&&(P.number=T(P.number)),P.difficulty=Zt(P.difficulty),P.totalDifficulty=Zt(P.totalDifficulty),ir(P.transactions)&&P.transactions.forEach(function(D,K){ur(D)||(P.transactions[K]=ee(D)||P.transactions[K])}),P):null}function ze(P){return P&&(P.blockNumber&&(P.blockNumber=T(P.blockNumber)),P.transactionIndex&&(P.transactionIndex=T(P.transactionIndex)),P.logIndex&&(P.logIndex=T(P.logIndex)),P)}function Ze(P){if(Wt(P))return P;if(Ft(P))return"0x"+P;throw new Error(`Invalid address: ${JSON.stringify(P)}`)}function ct(P){return P}function dt(P){return P&&(P.startingBlock=T(P.startingBlock),P.currentBlock=T(P.currentBlock),P.highestBlock=T(P.highestBlock),P.knownStates&&(P.knownStates=T(P.knownStates),P.pulledStates=T(P.pulledStates)),P)}function Et(P){if(P===null)throw ne("cannot convert null value to array",Y,{arg:"value",value:P});if(P instanceof Uint8Array)return new Uint8Array(P);if(typeof P=="string"){const D=P.match(/^(0x)?[0-9a-fA-F]*$/);if(!D)throw ne("invalid hexidecimal string",Y,{arg:"value",value:P});if(D[1]!=="0x")throw ne("hex string must have 0x prefix",Y,{arg:"value",value:P});(P=P.substring(2)).length%2&&(P="0"+P);const K=[];for(let he=0;he<P.length;he+=2)K.push(parseInt(P.substr(he,2),16));return new Uint8Array(K)}if(function(D){if(!D||parseInt(String(D.length))!==D.length||typeof D=="string")return!1;for(let K=0;K<D.length;K++){const he=D[K];if(he<0||he>=256||parseInt(String(he))!==he)return!1}return!0}(P))return new Uint8Array(P);throw ne("invalid arrayify value",void 0,{arg:"value",value:P,type:typeof P})}function ue(P,D,K){Object.defineProperty(P,D,{enumerable:!0,value:K,writable:!1})}const Z=new V(-1),ge=new V(0),Me=new V(1),Le=new V("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function wt(P){return function(D,K){function he(rt){return new Error('unexpected character "'+D[rt]+'" at position '+rt+' in "'+D+'"')}const Se={type:"",name:"",state:{allowType:!0}};let Ce=Se;for(let rt=0;rt<D.length;rt++){const xt=D[rt];switch(xt){case"(":if(!Ce.state.allowParams)throw he(rt);Ce.state.allowType=!1,Ce.type=St(Ce.type),Ce.components=[{type:"",name:"",parent:Ce,state:{allowType:!0}}],Ce=Ce.components[0];break;case")":delete Ce.state,K&&Ce.name==="indexed"&&(Ce.indexed=!0,Ce.name=""),Ce.type=St(Ce.type);const Lt=Ce;if(Ce=Ce.parent,!Ce)throw he(rt);delete Lt.parent,Ce.state.allowParams=!1,Ce.state.allowName=!0,Ce.state.allowArray=!0;break;case",":delete Ce.state,K&&Ce.name==="indexed"&&(Ce.indexed=!0,Ce.name=""),Ce.type=St(Ce.type);const Jt={type:"",name:"",parent:Ce.parent,state:{allowType:!0}};Ce.parent.components.push(Jt),delete Ce.parent,Ce=Jt;break;case" ":Ce.state.allowType&&Ce.type!==""&&(Ce.type=St(Ce.type),delete Ce.state.allowType,Ce.state.allowName=!0,Ce.state.allowParams=!0),Ce.state.allowName&&Ce.name!==""&&(K&&Ce.name==="indexed"?(Ce.indexed=!0,Ce.name=""):Ce.state.allowName=!1);break;case"[":if(!Ce.state.allowArray)throw he(rt);Ce.type+=xt,Ce.state.allowArray=!1,Ce.state.allowName=!1,Ce.state.readArray=!0;break;case"]":if(!Ce.state.readArray)throw he(rt);Ce.type+=xt,Ce.state.readArray=!1,Ce.state.allowArray=!0,Ce.state.allowName=!0;break;default:if(Ce.state.allowType)Ce.type+=xt,Ce.state.allowParams=!0,Ce.state.allowArray=!0;else if(Ce.state.allowName)Ce.name+=xt,delete Ce.state.allowArray;else{if(!Ce.state.readArray)throw he(rt);Ce.type+=xt}}}if(Ce.parent)throw new Error("unexpected eof");return delete Se.state,K&&Ce.name==="indexed"&&(Ce.indexed=!0,Ce.name=""),Se.type=St(Se.type),Se}(P,!0)}function St(P){return P.match(/^uint($|[^1-9])/)?P="uint256"+P.substring(4):P.match(/^int($|[^1-9])/)&&(P="int256"+P.substring(3)),P}const pr=new RegExp(/^bytes([0-9]*)$/),lr=new RegExp(/^(u?int)([0-9]*)$/),Xr=new RegExp(/^(.*)\[([0-9]*)\]$/),gr=function(P,D){const K=P.match(lr);return K&&parseInt(K[2])<=48?D.toNumber():D};class br{constructor(D,K,he,Se="",Ce){this.coerceFunc=D,this.name=K,this.type=he,this.localName=Se,this.dynamic=Ce}}class nn extends br{constructor(D){super(D.coerceFunc,D.name,D.type,void 0,D.dynamic),ue(this,"coder",D)}encode(D){return this.coder.encode(D)}decode(D,K){return this.coder.decode(D,K)}}class or extends br{constructor(D,K){super(D,"null","",K,!1)}encode(D){return Et([])}decode(D,K){if(K>D.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}}}function $r(P,D){return new V(P.toString(2).substr(-D),2)}class hn extends br{constructor(D,K,he,Se){const Ce=(he?"int":"uint")+8*K;super(D,Ce,Ce,Se,!1),this.size=K,this.signed=he}encode(D){try{let K=Zt(D);if(this.signed){let Se=$r(Le,8*this.size-1);if(K.gt(Se))throw new Error("out-of-bounds");if(Se=Se.plus(Me).multipliedBy(Z),K.lt(Se))throw new Error("out-of-bounds")}else if(K.lt(ge)||K.gt($r(Le,8*this.size)))throw new Error("out-of-bounds");K=$r(Ct(K,8*this.size),8*this.size),this.signed&&(K=Ct(Rt(K,8*this.size),256));const he=q(Ct(K).toString(16),64);if(he.indexOf("NaN")!==-1)throw ne("invalid number value, NaN",Y,{arg:this.localName,coderType:this.name,value:D,v:K,twosComplement:Ct(K),twosComplement16:Ct(K).toString(16),pad:q(Ct(K).toString(16),64),size:this.size});return U(he)}catch(K){throw ne("invalid number value",Y,{arg:this.localName,coderType:this.name,value:D,message:K.toString()})}}decode(D,K){if(D.length<K+32)throw ne("insufficient data for "+this.name+" type",Y,{arg:this.localName,coderType:this.name,value:gt(D.slice(K,K+32))});const he=32-this.size;let Se=new V(F(D.slice(K+he,K+32)),16);return Se=this.signed?Rt(Se,8*this.size):$r(Se,8*this.size),{consumed:32,value:this.coerceFunc(this.name,Se)}}}const Lr=new hn(function(P,D){return D},32,!1,"none");class Qn extends br{constructor(D,K,he){const Se="bytes"+K;super(D,Se,Se,he,!1),this.length=K}encode(D){const K=new Uint8Array(32);try{if(typeof D=="string"&&D.length%2!=0)throw new Error("hex string cannot be odd-length");const he=Et(D);if(he.length>this.length)throw new Error("incorrect data length");K.set(he)}catch(he){throw ne("invalid "+this.name+" value. Use hex strings or Uint8Array",Y,{arg:this.localName,coderType:this.name,value:he.value||D,details:he.message})}return K}decode(D,K){if(D.length<K+32)throw ne("insufficient data for "+this.name+" type",Y,{arg:this.localName,coderType:this.name,value:gt(D.slice(K,K+32))});return{consumed:32,value:this.coerceFunc(this.name,D.slice(K,K+this.length))}}}function xi(P){const D=32*Math.ceil(P.length/32),K=new Uint8Array(D-P.length);return G(Lr.encode(P.length),P,K)}function Jn(P,D,K){if(P.length<D+32)throw ne("insufficient data for dynamicBytes length",Y,{arg:K,coderType:"dynamicBytes",value:gt(P.slice(D,D+32))});let he=Lr.decode(P,D).value;try{he=he.toNumber()}catch(Se){throw Se("dynamic bytes count too large",Y,{arg:K,coderType:"dynamicBytes",value:he.toString()})}if(P.length<D+32+he)throw ne("insufficient data for dynamicBytes type",Y,{arg:K,coderType:"dynamicBytes",value:gt(P.slice(D,D+32+he))});return{consumed:32+32*Math.ceil(he/32),value:P.slice(D+32,D+32+he)}}function Ai(P){return 32*Math.ceil(P/32)}function Si(P,D){if(!Array.isArray(D)){if(!D||typeof D!="object")throw ne("invalid tuple value",Y,{coderType:"tuple",value:D});{const Lt=[];P.forEach(function(Jt){Lt.push(D[Jt.localName])}),D=Lt}}if(P.length!==D.length)throw ne("types/value length mismatch",Y,{coderType:"tuple",value:D});const K=[];P.forEach(function(Lt,Jt){K.push({dynamic:Lt.dynamic,value:Lt.encode(D[Jt])})});let he=0,Se=0;K.forEach(function(Lt){Lt.dynamic?(he+=32,Se+=Ai(Lt.value.length)):he+=Ai(Lt.value.length)});let Ce=0,rt=he;const xt=new Uint8Array(he+Se);return K.forEach(function(Lt){Lt.dynamic?(xt.set(Lr.encode(rt),Ce),Ce+=32,xt.set(Lt.value,rt),rt+=Ai(Lt.value.length)):(xt.set(Lt.value,Ce),Ce+=Ai(Lt.value.length))}),xt}class ni extends Array{}class Un extends br{constructor(D,K,he,Se){super(D,"array",K.type+"["+(he>=0?he:"")+"]",Se,he===-1||K.dynamic),this.coder=K,this.length=he}encode(D){if(!Array.isArray(D))throw ne("expected array value",Y,{arg:this.localName,coderType:"array",value:D});let K=this.length,he=new Uint8Array(0);K===-1&&(K=D.length,he=Lr.encode(K)),function(Ce,rt,xt){if(xt||(xt=""),Ce<rt)throw ne("missing argument"+xt,"MISSING_ARGUMENT",{count:Ce,expectedCount:rt});if(Ce>rt)throw ne("too many arguments"+xt,"UNEXPECTED_ARGUMENT",{count:Ce,expectedCount:rt})}(K,D.length,"in coder array"+(this.localName?" "+this.localName:""));const Se=[];for(let Ce=0;Ce<D.length;Ce++)Se.push(this.coder);return G(he,Si(Se,D))}decode(D,K){let he=0,Se=this.length;if(Se===-1){let xt;try{xt=Lr.decode(D,K)}catch(Lt){throw ne("insufficient data for dynamic array length",Y,{arg:this.localName,coderType:"array",value:Lt.value})}try{Se=xt.value.toNumber()}catch{throw ne("array count too large",Y,{arg:this.localName,coderType:"array",value:xt.value.toString()})}he+=xt.consumed,K+=xt.consumed}const Ce=[];for(let xt=0;xt<Se;xt++)Ce.push(new nn(this.coder));const rt=function(xt,Lt,Jt){const Oi=Jt;let bn=0;const At=[];return xt.forEach(function(ii){let wn;if(ii.dynamic){const un=Lr.decode(Lt,Jt);wn=ii.decode(Lt,Oi+un.value.toNumber()),wn.consumed=un.consumed}else wn=ii.decode(Lt,Jt);wn.value!==void 0&&At.push(wn.value),Jt+=wn.consumed,bn+=wn.consumed}),{value:At,consumed:bn}}(Ce,D,K);return rt.consumed+=he,rt.value=this.coerceFunc(this.type,rt.value),rt}}class Ji extends br{constructor(D,K,he){let Se=!1;const Ce=[];K.forEach(function(rt){rt.dynamic&&(Se=!0),Ce.push(rt.type)}),super(D,"tuple","tuple("+Ce.join(",")+")",he,Se),this.coders=K}encode(D){return Si(this.coders,D)}decode(D,K){const he=function(Se,Ce,rt){const xt=rt;let Lt=0;const Jt=new ni;return Se.forEach(function(Oi){let bn;if(Oi.dynamic){const At=Lr.decode(Ce,rt);bn=Oi.decode(Ce,xt+At.value.toNumber()),bn.consumed=At.consumed}else bn=Oi.decode(Ce,rt);bn.value!==void 0&&Jt.push(bn.value),rt+=bn.consumed,Lt+=bn.consumed}),Se.forEach(function(Oi,bn){let At=Oi.localName;At&&(At==="length"&&(At="_length"),Jt[At]!==null&&Jt[At]!==void 0||(Jt[At]=Jt[bn]))}),{value:Jt,consumed:Lt}}(this.coders,D,K);return he.value=this.coerceFunc(this.type,he.value),he}}const Ni={address:class extends br{constructor(P,D){super(P,"address","address",D,!1)}encode(P){const D=new Uint8Array(32),K=P.trim();if(!Ft(K))throw ne("invalid address format",Y,{arg:this.localName,coderType:"address",value:P});try{D.set(U(Ze(K)),12)}catch(he){throw ne(`invalid address (${he.message})`,Y,{arg:this.localName,coderType:"address",value:P})}return D}decode(P,D){if(P.length<D+32)throw ne("insufficuent data for address type",Y,{arg:this.localName,coderType:"address",value:gt(P.slice(D,D+32)),missingBytes:D+32-P.length});return{consumed:32,value:this.coerceFunc("address",$t(gt(P.slice(D+12,D+32))))}}},bool:class extends br{constructor(P,D){super(P,"bool","bool",D,!1)}encode(P){return Lr.encode(P?1:0)}decode(P,D){try{const K=Lr.decode(P,D);return{consumed:K.consumed,value:this.coerceFunc("bool",!K.value.isZero())}}catch(K){throw K.reason==="insufficient data for uint256 type"?ne("insufficient data for boolean type",Y,{arg:this.localName,coderType:"boolean",value:K.value}):K}}},string:class extends br{constructor(P,D){super(P,"string","string",D,!0)}encode(P){if(typeof P!="string")throw ne("invalid string value",Y,{arg:this.localName,coderType:"string",value:P});return xi(ve(P))}decode(P,D){const K=Jn(P,D,this.localName);return K.value=this.coerceFunc("string",j(K.value)),K}},bytes:class extends br{constructor(P,D){super(P,"bytes","bytes",D,!0)}encode(P){try{return xi(Et(P))}catch(D){throw D("invalid bytes value",Y,{arg:this.localName,coderType:"bytes",value:D.value})}}decode(P,D){const K=Jn(P,D,this.localName);return K.value=this.coerceFunc("bytes",K.value),K}},function:class extends Qn{constructor(P,D){super(P,24,D)}}};function ms(P,D){const K=Ni[D.type];if(K)return new K(P,D.name);let he=D.type.match(lr);if(he){const Se=parseInt(he[2]||"256");if(Se===0||Se>256||Se%8!=0)throw ne("invalid "+he[1]+" bit length",Y,{arg:"param",value:D});return new hn(P,Se/8,he[1]==="int",D.name)}if(he=D.type.match(pr),he){const Se=parseInt(he[1]);if(Se===0||Se>32)throw ne("invalid bytes length",Y,{arg:"param",value:D});return new Qn(P,Se,D.name)}if(he=D.type.match(Xr),he){const Se=Object.assign({},D),Ce=parseInt(he[2]||"-1");return Se.type=he[1],new Un(P,ms(P,Se),Ce,D.name)}if(D.type.substring(0,5)==="tuple")return function(Se,Ce,rt){Ce||(Ce=[]);const xt=Ce.map(Lt=>ms(Se,Lt));return new Ji(Se,xt,rt)}(P,D.components,D.name);if(D.type==="")return new or(P,D.name);throw ne("invalid type",Y,{arg:"type",value:D.type,fullType:D})}class Ya{constructor(D){(function(K,he){if(!(K instanceof he))throw ne("missing new","MISSING_NEW",{name:he.name})})(this,Ya),D||(D=gr),ue(this,"coerceFunc",D)}encode(D,K){if(D.length!==K.length)throw ne("types/values length mismatch",Y,{count:{types:D.length,values:K.length},value:{types:D,values:K}});const he=D.map(Se=>typeof Se=="string"?wt(Se):Se).map(Se=>ms(this.coerceFunc,Se));return new Ji(this.coerceFunc,he,"_").encode(K)}decode(D,K){const he=D.map(Se=>typeof Se=="string"?wt(Se):Se).map(Se=>ms(this.coerceFunc,Se));return new Ji(this.coerceFunc,he,"_").decode(K,0).value}}const X=new Ya;var me,re;function Ee(P,D,K,he){var Se,Ce=arguments.length,rt=Ce<3?D:he===null?he=Object.getOwnPropertyDescriptor(D,K):he;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")rt=Reflect.decorate(P,D,K,he);else for(var xt=P.length-1;xt>=0;xt--)(Se=P[xt])&&(rt=(Ce<3?Se(rt):Ce>3?Se(D,K,rt):Se(D,K))||rt);return Ce>3&&rt&&Object.defineProperty(D,K,rt),rt}function be(P,D){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(P,D)}r.coder=void 0,(me=r.coder||(r.coder={})).encodeParams=function(P,D){return F(X.encode(P,D))},me.decodeParams=function(P,D){if(P.length>0&&(!D||D==="0x"||D==="0X"))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return X.decode(P,U("0x"+D.replace(/0x/i,"")))},typeof SuppressedError=="function"&&SuppressedError;class Oe{constructor(D){this.callName=D.callName,this.params=D.params||0,this.inputFormatter=D.inputFormatter||null,this.outputFormatter=D.outputFormatter}validateArgs(D){if(D.length!==this.params)throw K=this.callName,he=D.length,Se=this.params,new Error(`Invalid number of input parameters to RPC method "${K}" given: ${he}, expected: ${Se}`);var K,he,Se}formatInput(D){return this.inputFormatter?this.inputFormatter.map(function(K,he){return K?K(D[he]):D[he]}):D}formatOutput(D){return D!==null?this.outputFormatter(D):null}toPayload(D){const K=this.formatInput(D);return this.validateArgs(K),{method:this.callName,params:K}}async execute(D,...K){const he=this.toPayload(K);if(!D)throw new Error("Missing RequestManager in method#exec");const Se=await D.sendAsync(he);return this.formatOutput(Se)}}class Xe{constructor(D){this.getter=D.getter,this.outputFormatter=D.outputFormatter}formatOutput(D){return this.outputFormatter(D)}async execute(D,...K){const he=await D.sendAsync({method:this.getter,params:[]});return this.formatOutput(he)}}function lt(P){return new Promise(D=>setTimeout(D,P))}r.eth=void 0,(re=r.eth||(r.eth={})).eth_getBalance=new Oe({callName:"eth_getBalance",params:2,inputFormatter:[Ze,ri],outputFormatter:$n}),re.eth_getStorageAt=new Oe({callName:"eth_getStorageAt",params:3,inputFormatter:[Ze,gt,ri],outputFormatter:Ge}),re.eth_getCode=new Oe({callName:"eth_getCode",params:2,inputFormatter:[Ze,ri],outputFormatter:Ge}),re.eth_getBlockByHash=new Oe({callName:"eth_getBlockByHash",params:2,inputFormatter:[Cr,function(P){return!!P}],outputFormatter:Re}),re.eth_getBlockByNumber=new Oe({callName:"eth_getBlockByNumber",params:2,inputFormatter:[Cr,function(P){return!!P}],outputFormatter:Re}),re.eth_getUncleByBlockHashAndIndex=new Oe({callName:"eth_getUncleByBlockHashAndIndex",params:2,inputFormatter:[Cr,gt],outputFormatter:Re}),re.eth_getUncleByBlockNumberAndIndex=new Oe({callName:"eth_getUncleByBlockNumberAndIndex",params:2,inputFormatter:[Cr,gt],outputFormatter:Re}),re.eth_getBlockTransactionCountByHash=new Oe({callName:"eth_getBlockTransactionCountByHash",params:1,inputFormatter:[Cr],outputFormatter:T}),re.eth_getBlockTransactionCountByNumber=new Oe({callName:"eth_getBlockTransactionCountByNumber",params:1,inputFormatter:[Cr],outputFormatter:T}),re.eth_getUncleCountByBlockHash=new Oe({callName:"eth_getUncleCountByBlockHash",params:1,inputFormatter:[Cr],outputFormatter:T}),re.eth_getUncleCountByBlockNumber=new Oe({callName:"eth_getUncleCountByBlockNumber",params:1,inputFormatter:[Cr],outputFormatter:T}),re.eth_getTransactionByHash=new Oe({callName:"eth_getTransactionByHash",params:1,inputFormatter:[Ir],outputFormatter:ee}),re.eth_getTransactionByBlockHashAndIndex=new Oe({callName:"eth_getTransactionByBlockHashAndIndex",params:2,inputFormatter:[Cr,gt],outputFormatter:ee}),re.eth_getTransactionByBlockNumberAndIndex=new Oe({callName:"eth_getTransactionByBlockNumberAndIndex",params:2,inputFormatter:[Cr,gt],outputFormatter:ee}),re.eth_getTransactionReceipt=new Oe({callName:"eth_getTransactionReceipt",params:1,inputFormatter:[Ir],outputFormatter:ye}),re.eth_getTransactionCount=new Oe({callName:"eth_getTransactionCount",params:2,inputFormatter:[Ze,ri],outputFormatter:T}),re.eth_sendRawTransaction=new Oe({callName:"eth_sendRawTransaction",params:1,inputFormatter:[null],outputFormatter:Ge}),re.web3_sha3=new Oe({callName:"web3_sha3",params:1,inputFormatter:[null],outputFormatter:Ge}),re.eth_sendTransaction=new Oe({callName:"eth_sendTransaction",params:1,inputFormatter:[_e],outputFormatter:Ge}),re.eth_sign=new Oe({callName:"eth_sign",params:2,inputFormatter:[Ze,null],outputFormatter:Ge}),re.eth_call=new Oe({callName:"eth_call",params:2,inputFormatter:[Br,ri],outputFormatter:Ge}),re.eth_estimateGas=new Oe({callName:"eth_estimateGas",params:1,inputFormatter:[Br],outputFormatter:T}),re.eth_submitWork=new Oe({callName:"eth_submitWork",params:3,inputFormatter:[null,null,null],outputFormatter:yt}),re.eth_getWork=new Oe({callName:"eth_getWork",params:0,inputFormatter:[],outputFormatter:Nt}),re.eth_coinbase=new Xe({getter:"eth_coinbase",outputFormatter:Vt}),re.eth_mining=new Xe({getter:"eth_mining",outputFormatter:yt}),re.eth_hashrate=new Xe({getter:"eth_hashrate",outputFormatter:T}),re.eth_syncing=new Xe({getter:"eth_syncing",outputFormatter:dt}),re.eth_gasPrice=new Xe({getter:"eth_gasPrice",outputFormatter:$n}),re.eth_accounts=new Xe({getter:"eth_accounts",outputFormatter:Nt}),re.eth_blockNumber=new Xe({getter:"eth_blockNumber",outputFormatter:T}),re.eth_protocolVersion=new Xe({getter:"eth_protocolVersion",outputFormatter:T}),re.web3_clientVersion=new Xe({getter:"web3_clientVersion",outputFormatter:le}),re.net_version=new Xe({getter:"net_version",outputFormatter:le}),re.shh_version=new Oe({callName:"shh_version",params:0,inputFormatter:[],outputFormatter:T}),re.shh_post=new Oe({callName:"shh_post",params:1,inputFormatter:[null],outputFormatter:yt}),re.personal_newAccount=new Oe({callName:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:Vt}),re.personal_importRawKey=new Oe({callName:"personal_importRawKey",params:2,inputFormatter:[null,null],outputFormatter:Vt}),re.personal_sign=new Oe({callName:"personal_sign",params:3,inputFormatter:[tt,Ze,null],outputFormatter:Ge}),re.personal_ecRecover=new Oe({callName:"personal_ecRecover",params:2,inputFormatter:[tt,null],outputFormatter:Vt}),re.personal_unlockAccount=new Oe({callName:"personal_unlockAccount",params:3,inputFormatter:[Ze,null,ce],outputFormatter:yt}),re.personal_sendTransaction=new Oe({callName:"personal_sendTransaction",params:2,inputFormatter:[_e,null],outputFormatter:Ge}),re.personal_lockAccount=new Oe({callName:"personal_lockAccount",params:1,inputFormatter:[Ze],outputFormatter:yt}),re.personal_listAccounts=new Xe({getter:"personal_listAccounts",outputFormatter:Nt}),re.net_listening=new Xe({getter:"net_listening",outputFormatter:yt}),re.net_peerCount=new Xe({getter:"net_peerCount",outputFormatter:T}),re.eth_newFilter=new Oe({callName:"eth_newFilter",params:1,inputFormatter:[ct],outputFormatter:gt}),re.eth_getLogs=new Oe({callName:"eth_getLogs",params:1,inputFormatter:[Nt],outputFormatter:Nt}),re.eth_newBlockFilter=new Oe({callName:"eth_newBlockFilter",params:0,inputFormatter:[],outputFormatter:gt}),re.eth_newPendingTransactionFilter=new Oe({callName:"eth_newPendingTransactionFilter",params:0,inputFormatter:[],outputFormatter:gt}),re.eth_uninstallFilter=new Oe({callName:"eth_uninstallFilter",params:1,inputFormatter:[gt],outputFormatter:yt}),re.eth_getFilterLogs=new Oe({callName:"eth_getFilterLogs",params:1,inputFormatter:[gt],outputFormatter:Nt}),re.eth_getFilterChanges=new Oe({callName:"eth_getFilterChanges",params:1,inputFormatter:[gt],outputFormatter:Nt}),re.eth_submitHashrate=new Oe({callName:"eth_submitHashrate",params:2,inputFormatter:[null,null],outputFormatter:yt}),re.shh_newIdentity=new Oe({callName:"shh_newIdentity",params:0,inputFormatter:[],outputFormatter:Ge}),re.shh_hasIdentity=new Oe({callName:"shh_hasIdentity",params:1,inputFormatter:[null],outputFormatter:yt}),re.shh_newGroup=new Oe({callName:"shh_newGroup",params:0,inputFormatter:[],outputFormatter:Ge}),re.shh_addToGroup=new Oe({callName:"shh_addToGroup",params:1,inputFormatter:[null],outputFormatter:yt}),re.shh_newFilter=new Oe({callName:"shh_newFilter",params:1,inputFormatter:[null],outputFormatter:gt}),re.shh_uninstallFilter=new Oe({callName:"shh_uninstallFilter",params:1,inputFormatter:[null],outputFormatter:yt}),re.shh_getLogs=new Oe({callName:"shh_getLogs",params:1,inputFormatter:[null],outputFormatter:Nt}),re.shh_getFilterMessages=new Oe({callName:"shh_getFilterMessages",params:1,inputFormatter:[null],outputFormatter:Nt}),re.shh_getFilterChanges=new Oe({callName:"shh_getFilterChanges",params:1,inputFormatter:[null],outputFormatter:Nt}),re.shh_getMessages=new Oe({callName:"shh_getMessages",params:1,inputFormatter:[null],outputFormatter:Nt});function Qe(P,D){const K=r.eth[D];if(!K)throw new Error(`Could not find the method/property named ${D.toString()}`);Object.defineProperty(P,D,{value:function(...he){return K.execute(this,...he)}})}class Ke{constructor(D){this.provider=D,this.requests=new Map}async sendAsync(D){const K=await this.provider;if(!K)throw new Error("Provider not set or invalid");const he=rn(D.method,D.params),Se=a();return this.requests.set(he.id,Se),K.sendAsync(he,(Ce,rt)=>{this.requests.delete(he.id),Ce?Se.reject(Ce):hi(rt)?Se.resolve(rt.result):Se.reject(function(xt){const Lt=xt&&xt.error&&xt.error.message?xt.error.message:"Invalid JSON RPC response: "+JSON.stringify(xt);return new Error(Lt)}(rt))}),Se}setProvider(D){this.provider=D}async getConfirmedTransaction(D){const K=await this.waitForCompletion(D);if(this.isFailure(K))throw new Error(`Transaction "${D}" failed`);return K}async waitForCompletion(D,K){const he=Ir(D);if(await this.isTxDropped(he,K)){const Se=await this.getTransactionAndReceipt(he);return Object.assign(Object.assign({},Se),{status:r.TransactionStatus.failed})}for(;;){const Se=await this.getTransactionAndReceipt(he);if(!this.isPending(Se)&&Se.receipt)return Object.assign(Object.assign({},Se),{status:this.isFailure(Se)?r.TransactionStatus.failed:r.TransactionStatus.confirmed});await lt(2e3)}}async getTransaction(D){let K,he=null;const Se=Ir(D);try{const rt=(await this.eth_accounts())[0];rt&&(he=await this.eth_getTransactionCount(rt,"latest"))}catch{he=null}try{if(K=await this.eth_getTransactionByHash(Se),K===null)return null}catch{return null}if(K.blockNumber===null){if(he!==null){if(K.nonce<he)return{hash:Se,type:r.TransactionType.replaced,nonce:K.nonce};if(K.nonce>he)return{hash:Se,type:r.TransactionType.queued,nonce:K.nonce}}return Object.assign({type:r.TransactionType.pending},K)}let Ce;try{if(Ce=await this.eth_getTransactionReceipt(Se),Ce===null||Ce.status===0)return Object.assign({type:r.TransactionType.reverted},K)}catch{return null}return Object.assign(Object.assign({type:r.TransactionType.confirmed},K),{receipt:Ce})}async isTxDropped(D,K=15){let he=K;for(;he>0;){if(await this.getTransactionAndReceipt(D)!==null)return!1;he-=1,await lt(2e3)}return!0}async getTransactionAndReceipt(D){D=Ir(D);const[K,he]=await Promise.all([this.eth_getTransactionByHash(D),this.eth_getTransactionReceipt(D)]);return Object.assign(Object.assign({},K),{receipt:he})}isPending(D){return D&&D.blockNumber===null}isFailure(D){return D&&(!D.receipt||D.receipt.status===0)}}Ee([Qe,be("design:type",Function)],Ke.prototype,"web3_clientVersion",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"web3_sha3",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"net_version",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"net_peerCount",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"net_listening",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_protocolVersion",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_syncing",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_coinbase",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_mining",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_hashrate",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_gasPrice",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_accounts",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_blockNumber",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getBalance",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getStorageAt",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getTransactionCount",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getBlockTransactionCountByHash",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getBlockTransactionCountByNumber",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getUncleCountByBlockHash",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getUncleCountByBlockNumber",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getCode",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_sign",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_sendTransaction",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_sendRawTransaction",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_call",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_estimateGas",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getBlockByHash",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getBlockByNumber",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getTransactionByHash",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getTransactionByBlockHashAndIndex",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getTransactionByBlockNumberAndIndex",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getTransactionReceipt",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getUncleByBlockHashAndIndex",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getUncleByBlockNumberAndIndex",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_newFilter",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_newBlockFilter",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_newPendingTransactionFilter",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_uninstallFilter",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getFilterChanges",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getFilterLogs",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getLogs",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_getWork",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_submitWork",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"eth_submitHashrate",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_post",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_version",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_newIdentity",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_hasIdentity",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_newGroup",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_addToGroup",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_newFilter",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_uninstallFilter",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_getFilterChanges",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"shh_getMessages",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_unlockAccount",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_newAccount",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_listAccounts",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_lockAccount",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_importRawKey",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_sendTransaction",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_sign",void 0),Ee([Qe,be("design:type",Function)],Ke.prototype,"personal_ecRecover",void 0);class ht{constructor(D){this.json=D,this._inputTypes=D.inputs||[],this._outputTypes=D.outputs||[],this._constant=!!D.constant,this._payable=!!D.payable||D.stateMutability==="payable",this.needsToBeTransaction=this._payable||"constant"in D&&!D.constant||D.stateMutability==="nonpayable",this._name=k(D)}extractDefaultBlock(D){return D.length>this._inputTypes.length&&!rr(D[D.length-1])&&ri(D.pop())||"latest"}validateArgs(D){if(D.some(Ce=>Ce===void 0))throw new Error("Invalid call, some arguments are undefined");const K=D.filter(function(Ce){return!(rr(Ce)===!0&&ir(Ce)===!1&&Mt(Ce)===!1&&!(Ce instanceof Uint8Array))});if(K.length!==this._inputTypes.length)throw he=K.length,Se=this._inputTypes.length,new Error(`Invalid number of arguments to Solidity function. given: ${he}, expected: ${Se}`);var he,Se}toPayload(D){let K={to:void 0,data:void 0,value:void 0,from:void 0};D.length>this._inputTypes.length&&rr(D[D.length-1])&&(K=D.pop()),this.validateArgs(D);const he=this.signature();let Se=r.coder.encodeParams(this._inputTypes,D);return Se.indexOf("0x")===0&&(Se=Se.substr(2)),K.data="0x"+he+Se,K}signature(){return H(this._name).slice(0,8)}unpackOutput(D){if(!D)return;const K=D.length>=2?D.slice(2):D,he=r.coder.decodeParams(this._outputTypes,K);return he.length===1?he[0]:he}async execute(D,K,...he){if(!D)throw new Error(`Cannot call function ${this.displayName()} because there is no requestManager`);if(this.needsToBeTransaction){const Se=this.toPayload(he);if(Se.to=K,Se.value>0&&!this._payable)throw new Error("Cannot send value to non-payable function");if(!Se.from)throw new Error('Missing "from" in transaction options');return await D.eth_sendTransaction(Se)}{const Se=this.extractDefaultBlock(he),Ce=this.toPayload(he);Ce.to=K;const rt=await D.eth_call(Ce,Se);return this.unpackOutput(rt)}}estimateGas(D,K,...he){if(!(D instanceof Ke))throw new Error("estimateGas needs to receive a RequestManager as first argument");const Se=this.toPayload(he);return Se.to=K,D.eth_estimateGas(Se)}displayName(){return Q(this._name)}typeName(){return te(this._name)||"void"}attachToContract(D){const K=this.displayName(),he=Object.assign((...Se)=>this.execute(D.requestManager,D.address,...Se),{estimateGas:this.estimateGas.bind(this,D.requestManager,D.address),toPayload:(...Se)=>this.toPayload(Se),toRPCMessage:(...Se)=>{const Ce=this.extractDefaultBlock(Se),rt=this.toPayload(Se);return rt.to=D.address,{method:"eth_call",params:[rt,Ce]}},unpackOutput:Se=>this.unpackOutput(Se)});D[K]||(D[K]=he),D[K][this.typeName()]=he}}function zt(P){if(P==null)return null;const D=String(P).toString();return D.indexOf("0x")===0?D:F(ve(D))}class Pr{constructor(D){this.requestManager=D,this.isStarted=!1,this.isDisposed=!1,this.formatter=K=>K,this.filterId=a(),this.callbacks=[],this.stopSemaphore=a()}async watch(D){if(this.isDisposed)throw new Error("The filter was disposed");D&&(this.callbacks.push(D),this.isStarted||await this.start())}async start(){if(this.isDisposed)throw new Error("The filter was disposed");if(!this.isStarted){this.isStarted=!0;try{const D=await this.getNewFilter();if(!D)throw new Error("Could not create a filter, response: "+JSON.stringify(D));this.filterId.resolve(D)}catch(D){throw D}this.stopSemaphore=a(),await this.poll()}}async stop(){if(!this.isStarted||this.isDisposed)return;this.isDisposed=!0;const D=await this.filterId;if(this.isStarted=!1,this.stopSemaphore&&await this.stopSemaphore,await this.uninstall()!==!0)throw new Error(`Couldn't stop the eth filter: ${D}`)}async poll(){if(this.isStarted){if(this.callbacks.length){const K=await this.getChanges();K&&this.callbacks.forEach(he=>{this.formatter?K.forEach(Se=>{he(this.formatter(Se))}):K.forEach(Se=>he(Se))})}this.stopSemaphore.resolve(1),this.isStarted&&(this.stopSemaphore=a(),setTimeout((D=()=>this.poll(),function(){D().catch(K=>console.error(K))}),500))}else this.stopSemaphore.resolve(1);var D}}class Gr extends Pr{constructor(D,K,he=Se=>Se){super(D),this.requestManager=D,this.options=K,this.formatter=he,this.options=this.options||{},this.options.topics=this.options.topics||[],this.options.topics=this.options.topics.map(function(Se){return zt(Se)}),this.options={topics:this.options.topics,address:this.options.address?this.options.address:void 0,fromBlock:typeof this.options.fromBlock=="number"||typeof this.options.fromBlock=="string"?Cr(this.options.fromBlock)||void 0:"latest",toBlock:typeof this.options.toBlock=="number"||typeof this.options.toBlock=="string"?Cr(this.options.toBlock)||void 0:"latest"}}async getLogs(){this.isStarted||await this.start();const D=await this.filterId;return this.requestManager.eth_getFilterLogs(D)}async getNewFilter(){return this.requestManager.eth_newFilter(this.options)}async getChanges(){const D=await this.filterId;return this.requestManager.eth_getFilterChanges(D)}async uninstall(){const D=await this.filterId;return this.requestManager.eth_uninstallFilter(D)}}class Fr{constructor(D,K,he){this.requestManager=D,this.address=he,this._anonymous=!1,this._params=K.inputs||[],this._name=k(K),this._anonymous=K.anonymous||!1}types(D){return this._params.filter(function(K){return K.indexed===D})}displayName(){return Q(this._name)}typeName(){return te(this._name)||"void"}signature(){return H(this._name)}encode(D={},K={}){const he={topics:[],address:this.address};K.fromBlock!==void 0&&(he.fromBlock=Cr(K.fromBlock)||void 0),K.toBlock!==void 0&&(he.toBlock=Cr(K.toBlock)||void 0),he.topics=he.topics||[],this._anonymous||he.topics.push("0x"+this.signature());const Se=this._params.filter(function(Ce){return Ce.indexed===!0}).map(function(Ce){const rt=D[Ce.name];return rt==null?null:ir(rt)?rt.map(function(xt){return"0x"+r.coder.encodeParams([Ce],[xt])}):"0x"+r.coder.encodeParams([Ce],[rt])});return he.topics=he.topics.concat(Se),he}decode(D){D.data=D.data||"",D.topics=D.topics||[];const K=(this._anonymous?D.topics:D.topics.slice(1)).map(function(xt){return xt.slice(2)}).join(""),he=r.coder.decodeParams(this.types(!0),K),Se=D.data.slice(2),Ce=r.coder.decodeParams(this.types(!1),Se),rt=this._params.reduce(function(xt,Lt){return xt[Lt.name]=Lt.indexed?he.shift():Ce.shift(),xt},{});return Object.assign(Object.assign({},ze(D)),{event:this.displayName(),address:D.address,args:rt})}async execute(D,K){const he=this.encode(D,K),Se=this.decode.bind(this);return new Gr(this.requestManager,he,Se)}attachToContract(D){const K=this.execute.bind(this),he=this.displayName();D.events[he]||(D.events[he]=K),D.events[he][this.typeName()]=this.execute.bind(this,D)}}class yn{constructor(D,K,he){this._requestManager=D,this._json=K,this._address=he}encode(D={}){const K={address:this._address};return D.fromBlock!==void 0&&(K.fromBlock=Cr(D.fromBlock)||void 0),D.toBlock!==void 0&&(K.toBlock=Cr(D.toBlock)||void 0),K}decode(D){D.data=D.data||"";const K=ir(D.topics)&&ur(D.topics[0])?D.topics[0].slice(2):"",he=this._json.filter(function(Se){return K===H(k(Se))})[0];return he?new Fr(this._requestManager,he,this._address).decode(D):ze(D)}async execute(D){const K=this.encode(D),he=this.decode.bind(this);return new Gr(this._requestManager,K,he)}getAllEventsFunction(){return this.execute.bind(this)}}class qr{constructor(D,K,he){var Se;this.requestManager=D,this.abi=K,this.address=he,this.events={},this.transactionHash=null,this.address=he,this.abi=K,(Se=this).abi.filter(function(Ce){return Ce.type==="function"}).map(function(Ce){return new ht(Ce)}).forEach(function(Ce){Ce.attachToContract(Se)}),this.allEvents=function(Ce){const rt=Ce.abi.filter(function(Lt){return Lt.type==="event"}),xt=new yn(Ce.requestManager,rt,Ce.address);return rt.map(function(Lt){return new Fr(Ce.requestManager,Lt,Ce.address)}).forEach(function(Lt){Lt.attachToContract(Ce)}),xt.getAllEventsFunction()}(this)}}r.AbstractFilter=Pr,r.BigNumber=V,r.Contract=qr,r.ContractFactory=class{constructor(P,D){this.requestManager=P,this.abi=D}async deploy(...P){let D;const K=P[P.length-1];if(rr(K)&&!ir(K)&&(D=P.pop()),!D)throw new Error("Missing options object");if(!D.data||typeof D.data!="string")throw new Error("Invalid options.data");if(T(D.value)>0&&!(this.abi.filter(function(Jt){return Jt.type==="constructor"&&Jt.inputs.length===P.length})[0]||{}).payable)throw new Error("Cannot send value to non-payable constructor");const he=(Se=this.abi,Ce=P,Se.filter(function(Jt){return Jt.type==="constructor"&&Jt.inputs&&Jt.inputs.length===Ce.length}).map(function(Jt){return Jt.inputs||[]}).map(function(Jt){return r.coder.encodeParams(Jt,Ce)})[0]||"");var Se,Ce;D.data+=he,D.gas||(D.gas=await this.requestManager.eth_estimateGas(D));const rt=await this.requestManager.eth_sendTransaction(D);if(!rt)throw new Error("Error while sending contract creation transaction. A TxHash was not retrieved");const xt=await async function(Jt,Oi){const bn=a();let At=0;const ii=()=>{At++,At>50?bn.reject(new Error("Contract transaction couldn't be found after 50 blocks")):Jt.eth_getTransactionReceipt(Oi).then(pi=>{pi&&pi.blockHash?bn.resolve(pi):setTimeout(ii,1e3)},pi=>bn.reject(pi))};ii();const wn=await bn,un=await Jt.eth_getCode(wn.contractAddress,"latest");if(un&&un.length>3)return wn.contractAddress;throw Object.assign(new Error("The contract code couldn't be stored, please check your gas amount."),{response:un,receipt:wn})}(this.requestManager,rt),Lt=await this.at(xt);return Lt.transactionHash=rt,Lt}async at(P){if(!Ft(P))throw new TypeError(`Invalid address ${JSON.stringify(P)}`);return new qr(this.requestManager,this.abi,P)}},r.EthBlockFilter=class extends Gr{constructor(P){super(P,{})}async getNewFilter(){return this.requestManager.eth_newBlockFilter()}},r.EthFilter=Gr,r.EthPendingTransactionFilter=class extends Gr{constructor(P){super(P,{})}async getNewFilter(){return this.requestManager.eth_newPendingTransactionFilter()}},r.HTTPProvider=class{constructor(P,D={}){this.host=P,this.options=D,this.debug=!1,this.host=P||"http://localhost:8545"}send(){throw new Error("Sync requests are deprecated")}sendAsync(P,D){try{let K=null;K=P instanceof Array?P.map(Ce=>n(Ce)):n(P);const he=this.options.fetch||globalThis.fetch;if(he===void 0)throw new Error("There is no global fetch object nor it was provided. Please install and import isomorphic-fetch");const Se={body:JSON.stringify(K),method:"POST",headers:Object.assign(Object.assign({},this.options.headers),{"Content-Type":"application/json"})};this.debug&&console.log("SEND >> "+Se.body),he(this.host,Se).then(async Ce=>{if(Ce.ok){const rt=await Ce.json();this.debug&&console.log("RECV << "+JSON.stringify(rt)),rt.error?D(Object.assign(new Error(rt.error.json||rt.error),rt.error)):D(null,rt)}else this.debug&&console.log("ERR << "+JSON.stringify(Ce)),D(new Error("External error. response code: "+Ce.status))},Ce=>{this.debug&&console.log("ERR << "+JSON.stringify(Ce)),D(Ce)})}catch(K){this.debug&&console.log("ERR << "+JSON.stringify(K)),D(K)}}},r.Method=Oe,r.Property=Xe,r.RequestManager=Ke,r.SHHFilter=class extends Pr{constructor(P,D){super(P),this.requestManager=P,this.options=D,this.options=this.options||{topics:[]},this.options.topics=this.options.topics||[],this.options.topics=this.options.topics.map(function(K){return zt(K)}),this.options={topics:this.options.topics,to:this.options.to}}async getMessages(){const P=await this.filterId;return this.requestManager.shh_getMessages(P)}async getNewFilter(){return this.requestManager.shh_newFilter(this.options)}async getChanges(){const P=await this.filterId;return this.requestManager.shh_getFilterChanges(P)}async uninstall(){const P=await this.filterId;return this.requestManager.shh_uninstallFilter(P)}},r.SolidityEvent=Fr,r.SolidityFunction=ht,r.WebSocketProvider=class{constructor(P,D={}){this.url=P,this.options=D,this.isDisposed=!1,this.responseCallbacks=new Map,this.notificationCallbacks=new Set,this.debug=!1,this.lastChunk="",this.connect()}dispose(){this.isDisposed=!0;const P=this.connection;this.timeout(new Error("Provider disposed.")),P.then(D=>D.close()).catch(D=>{this.debug&&console.error(D)})}send(){throw new Error("Sync requests are deprecated")}sendAsync(P,D){const K=[];let he;if(P instanceof Array)he=Promise.all(P.map(Se=>{const Ce=a();try{const rt=n(Se);K.push(rt),this.responseCallbacks.set(rt.id,Ce)}catch(rt){Ce.reject(rt)}return Ce}));else{const Se=a();try{const Ce=n(P);K.push(Ce),this.responseCallbacks.set(Ce.id,Se)}catch(Ce){Se.reject(Ce)}he=Se}he.then(Se=>D(null,Se),Se=>D(Se)),this.connection.then(Se=>{K.forEach(Ce=>{const rt=JSON.stringify(Ce);this.debug&&console.log("SEND >> "+rt),Se.send(rt)})},Se=>{D(Se)})}parseResponse(P){const D=[];return P.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(K=>{let he=K;this.lastChunk&&(he=this.lastChunk+he);let Se=null;try{Se=JSON.parse(he)}catch{return this.lastChunk=he,clearTimeout(this.lastChunkTimeout),void(this.lastChunkTimeout=setTimeout(()=>{this.timeout()},15e3))}clearTimeout(this.lastChunkTimeout),this.lastChunk="",Se&&D.push(Se)}),D}processMessage(P){if("id"in P){const D=P.id,K=this.responseCallbacks.get(D);if(!K)return void console.error("Error: Received a response for an unknown request",P);this.responseCallbacks.delete(D),"error"in P?K.reject(Object.assign(new Error(P.error.message||P.error),P.error)):"result"in P&&K.resolve(P)}else this.notificationCallbacks.forEach(D=>D(null,P))}timeout(P){this.connection&&this.connection.isPending||(this.connection=a());const D=P||new Error("Connection timeout");this.responseCallbacks.forEach(K=>K.reject(D)),this.responseCallbacks.clear(),this.isDisposed||setTimeout(()=>this.connect(),1e3)}connect(){this.connection&&!this.connection.isPending&&this.connection.then(K=>K.close()).catch(K=>{this.debug&&console.error(K)}),this.connection&&this.connection.isPending||(this.connection=a()),this.lastChunk="";const P=this.options.WebSocketConstructor||(typeof WebSocket<"u"?WebSocket:void 0);if(!P)throw new Error("Please provide a WebSocketConstructor");const D=new P(this.url,this.options.protocol);D.onopen=()=>{this.connection.resolve(D)},D.onerror=K=>{const he=new Error("Error in web socket");he.data=K,this.timeout(he)},D.onclose=K=>{this.timeout(new Error(`Connection closed (${K&&K.reason||"Unknown reason"})`))},D.onmessage=K=>{const he=typeof K.data=="string"?K.data:"";this.debug&&console.log("RECV << "+K.data),this.parseResponse(he).forEach(Se=>{Se instanceof Array?Se.forEach(Ce=>this.processMessage(Ce)):this.processMessage(Se)})}}},r.bytesToHex=F,r.bytesToUtf8String=j,r.concatBytes=G,r.default=Ke,r.extractDisplayName=Q,r.extractTypeName=te,r.fromAscii=function(P,D=0){let K="";for(let he=0;he<P.length;he++){const Se=P.charCodeAt(he).toString(16);K+=Se.length<2?"0"+Se:Se}return"0x"+K.padEnd(D,"0")},r.fromDecimal=vt,r.fromTwosComplement=Rt,r.fromWei=function(P,D){const K=Zt(P).dividedBy(Bt(D));return Mt(P)?K:K.toString(10)},r.getAddress=$t,r.getValueOfUnit=Bt,r.hexToBytes=U,r.inputAddressFormatter=Ze,r.inputBlockNumberFormatter=Cr,r.inputCallFormatter=Br,r.inputDefaultBlockNumberFormatter=ri,r.inputFilterOptions=ct,r.inputPostFormatter=function(P){return P?(P.ttl=vt(P.ttl),P.workToProve=vt(P.workToProve),P.priority=vt(P.priority),ir(P.topics)||(P.topics=P.topics?[P.topics]:[]),P.topics=P.topics.map(function(D){return D.indexOf("0x")===0?D:"0x"+F(ve(D))}),P):null},r.inputTransactionFormatter=_e,r.inputTransactionId=Ir,r.isAddress=Ft,r.isArray=ir,r.isBigNumber=Mt,r.isBloom=function(P){return!!/^(0x)?[0-9a-f]{512}$/i.test(P)&&!!/^(0x)?[0-9a-f]{512}$/i.test(P)},r.isBoolean=ar,r.isChecksumAddress=Kt,r.isFunction=function(P){return typeof P=="function"},r.isHex=function(P){return typeof P=="string"&&/^0x[0-9a-fA-F]+$/.test(P)},r.isJson=function(P){try{return!!JSON.parse(P)}catch{return!1}},r.isObject=rr,r.isPredefinedBlockNumber=Ln,r.isStrictAddress=Wt,r.isString=ur,r.isTopic=function(P){return!!/^(0x)?[0-9a-f]{64}$/i.test(P)&&!!/^(0x)?[0-9a-f]{64}$/i.test(P)},r.isValidResponse=hi,r.outputBigNumberFormatter=$n,r.outputBlockFormatter=Re,r.outputLogFormatter=ze,r.outputPostFormatter=function(P){return P?(P.expiry=T(P.expiry),P.sent=T(P.sent),P.ttl=T(P.ttl),P.workProved=T(P.workProved),P.topics||(P.topics=[]),P.topics=P.topics.map(function(D){return $(D)}),P):null},r.outputSyncingFormatter=dt,r.outputTransactionFormatter=ee,r.outputTransactionReceiptFormatter=ye,r.padLeft=q,r.padRight=function(P,D,K){return P+new Array(D-P.length+1).join(K||"0")},r.sha3=H,r.signedIsNegative=Pt,r.stringToUtf8Bytes=ve,r.toAddress=Vt,r.toArray=Nt,r.toAscii=$,r.toBatchPayload=function(P){return P.map(function(D){return rn(D.method,D.params)})},r.toBigNumber=Zt,r.toBoolean=yt,r.toChecksumAddress=Dt,r.toData=Ge,r.toDecimal=T,r.toHex=gt,r.toJsonRpcRequest=rn,r.toNullDecimal=ce,r.toString=le,r.toStringData=tt,r.toTwosComplement=Ct,r.toWei=function(P,D){const K=Zt(P).times(Bt(D));return Mt(P)?K:K.toString(10)},r.transformToFullName=k,Object.defineProperty(r,"__esModule",{value:!0})})})(Q6,Q6.exports);var kA=Q6.exports,$A={};Object.defineProperty($A,"__esModule",{value:!0});$A.SignatureValidator=void 0;const _4e=kA;async function E4e(t,e){const r=[{constant:!0,inputs:[{name:"hash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"magicValue",type:"bytes4"}],payable:!1,stateMutability:"view",type:"function"}];return await new _4e.ContractFactory(t,r).at(e)}$A.SignatureValidator=E4e;var aM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthLink=t.AuthLinkType=t.AuthChain=void 0;const e=ml;Object.defineProperty(t,"AuthChain",{enumerable:!0,get:function(){return e.AuthChain}}),Object.defineProperty(t,"AuthLinkType",{enumerable:!0,get:function(){return e.AuthLinkType}}),Object.defineProperty(t,"AuthLink",{enumerable:!0,get:function(){return e.AuthLink}})})(aM);var LA={};Object.defineProperty(LA,"__esModule",{value:!0});LA.moveMinutes=void 0;function x4e(t){const e=new Date;return e.setMinutes(e.getMinutes()+t),e}LA.moveMinutes=x4e;var oM={};Object.defineProperty(oM,"__esModule",{value:!0});const Wy=kA;class A4e{constructor(e,r=!0){this.requestManager=e,this.checkedBlocks={},this.saveBlocks=r,r&&(this.savedBlocks={}),this.requests=0}async fillBlockTime(){const e=await this.getBlockWrapper("latest"),r=await this.getBlockWrapper(1);this.blockTime=(e.timestamp-r.timestamp)/Number(e.number)-1,this.firstTimestamp=r.timestamp}async getDate(e,r=!0){const n=e/1e3,i=Date.now()/1e3;if((typeof this.firstTimestamp>"u"||typeof this.blockTime>"u")&&await this.fillBlockTime(),n<this.firstTimestamp)return{block:1,timestamp:n};if(n>=i||n>this.savedBlocks.latest.timestamp)return{block:(0,Wy.toBigNumber)(await this.requestManager.eth_blockNumber()).toNumber(),timestamp:n};this.checkedBlocks[n]=[];const s=await this.getBlockWrapper(Math.ceil((n-this.firstTimestamp/this.blockTime)/1e3));return{block:await this.findBetter(n,s,r),timestamp:n}}async findBetter(e,r,n,i=this.blockTime){if(await this.isBetterBlock(e,r,n))return r.number;const s=e-r.timestamp;let a=Math.ceil(s/i);a===0&&(a=s<0?-1:1);const o=await this.getBlockWrapper(this.getNextBlock(e,r.number,a));return i=Math.abs((r.timestamp-o.timestamp)/(r.number-o.number)),this.findBetter(e,o,n,i)}async isBetterBlock(e,r,n){const i=r.timestamp;if(n){if(i<e)return!1;const s=await this.getBlockWrapper(r.number-1);if(i>=e&&s.timestamp<e)return!0}else{if(i>=e)return!1;const s=await this.getBlockWrapper(r.number+1);if(i<e&&s.timestamp>=e)return!0}return!1}getNextBlock(e,r,n){const i=r+n;return this.checkedBlocks[e].includes(i)?this.getNextBlock(e,r,n<0?++n:--n):(this.checkedBlocks[e].push(i),i)}async getBlockWrapper(e){if(!this.saveBlocks){const n=await this.requestManager.eth_getBlockByNumber(e,!1);return{number:(0,Wy.toBigNumber)(n.number).toNumber(),timestamp:(0,Wy.toBigNumber)(n.timestamp).toNumber()}}if(this.savedBlocks[e.toString()])return this.savedBlocks[e];if(typeof e=="number"&&this.savedBlocks.latest&&this.savedBlocks.latest.number<=e)return this.savedBlocks.latest;const{timestamp:r}=await this.requestManager.eth_getBlockByNumber(e,!1);return this.savedBlocks[e.toString()]={number:(0,Wy.toBigNumber)(e==="latest"?await this.requestManager.eth_blockNumber():e).toNumber(),timestamp:(0,Wy.toBigNumber)(r).toNumber()},this.requests++,this.savedBlocks[e.toString()]}}oM.default=A4e;var Ts={},cM={},sre={},ls={};Object.defineProperty(ls,"__esModule",{value:!0});ls.output=ls.exists=ls.hash=ls.bytes=ls.bool=ls.number=void 0;function Sx(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}ls.number=Sx;function are(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}ls.bool=are;function uM(t,...e){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}ls.bytes=uM;function ore(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Sx(t.outputLen),Sx(t.blockLen)}ls.hash=ore;function cre(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}ls.exists=cre;function ure(t,e){uM(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}ls.output=ure;const S4e={number:Sx,bool:are,bytes:uM,hash:ore,exists:cre,output:ure};ls.default=S4e;var qg={},UA={};Object.defineProperty(UA,"__esModule",{value:!0});UA.crypto=void 0;UA.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0};(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const e=UA,r=A=>new Uint8Array(A.buffer,A.byteOffset,A.byteLength);t.u8=r;const n=A=>new Uint32Array(A.buffer,A.byteOffset,Math.floor(A.byteLength/4));t.u32=n;const i=A=>new DataView(A.buffer,A.byteOffset,A.byteLength);t.createView=i;const s=(A,O)=>A<<32-O|A>>>O;if(t.rotr=s,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!t.isLE)throw new Error("Non little-endian hardware is not supported");const a=Array.from({length:256},(A,O)=>O.toString(16).padStart(2,"0"));function o(A){if(!(A instanceof Uint8Array))throw new Error("Uint8Array expected");let O="";for(let E=0;E<A.length;E++)O+=a[A[E]];return O}t.bytesToHex=o;function c(A){if(typeof A!="string")throw new TypeError("hexToBytes: expected string, got "+typeof A);if(A.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const O=new Uint8Array(A.length/2);for(let E=0;E<O.length;E++){const p=E*2,I=A.slice(p,p+2),N=Number.parseInt(I,16);if(Number.isNaN(N)||N<0)throw new Error("Invalid byte sequence");O[E]=N}return O}t.hexToBytes=c;const u=async()=>{};t.nextTick=u;async function f(A,O,E){let p=Date.now();for(let I=0;I<A;I++){E(I);const N=Date.now()-p;N>=0&&N<O||(await(0,t.nextTick)(),p+=N)}}t.asyncLoop=f;function h(A){if(typeof A!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof A}`);return new TextEncoder().encode(A)}t.utf8ToBytes=h;function m(A){if(typeof A=="string"&&(A=h(A)),!(A instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof A})`);return A}t.toBytes=m;function y(...A){if(!A.every(p=>p instanceof Uint8Array))throw new Error("Uint8Array list expected");if(A.length===1)return A[0];const O=A.reduce((p,I)=>p+I.length,0),E=new Uint8Array(O);for(let p=0,I=0;p<A.length;p++){const N=A[p];E.set(N,I),I+=N.length}return E}t.concatBytes=y;class w{clone(){return this._cloneInto()}}t.Hash=w;const v=A=>Object.prototype.toString.call(A)==="[object Object]"&&A.constructor===Object;function g(A,O){if(O!==void 0&&(typeof O!="object"||!v(O)))throw new TypeError("Options should be object or undefined");return Object.assign(A,O)}t.checkOpts=g;function _(A){const O=p=>A().update(m(p)).digest(),E=A();return O.outputLen=E.outputLen,O.blockLen=E.blockLen,O.create=()=>A(),O}t.wrapConstructor=_;function b(A){const O=(p,I)=>A(I).update(m(p)).digest(),E=A({});return O.outputLen=E.outputLen,O.blockLen=E.blockLen,O.create=p=>A(p),O}t.wrapConstructorWithOpts=b;function S(A=32){if(e.crypto.web)return e.crypto.web.getRandomValues(new Uint8Array(A));if(e.crypto.node)return new Uint8Array(e.crypto.node.randomBytes(A).buffer);throw new Error("The environment doesn't have randomBytes function")}t.randomBytes=S})(qg);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;const e=ls,r=qg;class n extends r.Hash{constructor(a,o){super(),this.finished=!1,this.destroyed=!1,e.default.hash(a);const c=(0,r.toBytes)(o);if(this.iHash=a.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,f=new Uint8Array(u);f.set(c.length>u?a.create().update(c).digest():c);for(let h=0;h<f.length;h++)f[h]^=54;this.iHash.update(f),this.oHash=a.create();for(let h=0;h<f.length;h++)f[h]^=106;this.oHash.update(f),f.fill(0)}update(a){return e.default.exists(this),this.iHash.update(a),this}digestInto(a){e.default.exists(this),e.default.bytes(a,this.outputLen),this.finished=!0,this.iHash.digestInto(a),this.oHash.update(a),this.oHash.digestInto(a),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||(a=Object.create(Object.getPrototypeOf(this),{}));const{oHash:o,iHash:c,finished:u,destroyed:f,blockLen:h,outputLen:m}=this;return a=a,a.finished=u,a.destroyed=f,a.blockLen=h,a.outputLen=m,a.oHash=o._cloneInto(a.oHash),a.iHash=c._cloneInto(a.iHash),a}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const i=(s,a,o)=>new n(s,a).update(o).digest();t.hmac=i,t.hmac.create=(s,a)=>new n(s,a)})(sre);var Uh={},jA={};Object.defineProperty(jA,"__esModule",{value:!0});jA.SHA2=void 0;const UC=ls,Yy=qg;function O4e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+u,o,n)}class I4e extends Yy.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,Yy.createView)(this.buffer)}update(e){UC.default.exists(this);const{view:r,buffer:n,blockLen:i}=this;e=(0,Yy.toBytes)(e);const s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const c=(0,Yy.createView)(e);for(;i<=s-a;a+=i)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){UC.default.exists(this),UC.default.output(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(n,0),a=0);for(let h=a;h<i;h++)r[h]=0;O4e(n,i-8,BigInt(this.length*8),s),this.process(n,0);const o=(0,Yy.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)o.setUint32(4*h,f[h],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:a,pos:o}=this;return e.length=i,e.pos=o,e.finished=s,e.destroyed=a,i%r&&e.buffer.set(n),e}}jA.SHA2=I4e;Object.defineProperty(Uh,"__esModule",{value:!0});Uh.sha224=Uh.sha256=void 0;const P4e=jA,ho=qg,T4e=(t,e,r)=>t&e^~t&r,C4e=(t,e,r)=>t&e^t&r^e&r,R4e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Kl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Wl=new Uint32Array(64);class lre extends P4e.SHA2{constructor(){super(64,32,8,!1),this.A=Kl[0]|0,this.B=Kl[1]|0,this.C=Kl[2]|0,this.D=Kl[3]|0,this.E=Kl[4]|0,this.F=Kl[5]|0,this.G=Kl[6]|0,this.H=Kl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:a,G:o,H:c}=this;return[e,r,n,i,s,a,o,c]}set(e,r,n,i,s,a,o,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,r){for(let h=0;h<16;h++,r+=4)Wl[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){const m=Wl[h-15],y=Wl[h-2],w=(0,ho.rotr)(m,7)^(0,ho.rotr)(m,18)^m>>>3,v=(0,ho.rotr)(y,17)^(0,ho.rotr)(y,19)^y>>>10;Wl[h]=v+Wl[h-7]+w+Wl[h-16]|0}let{A:n,B:i,C:s,D:a,E:o,F:c,G:u,H:f}=this;for(let h=0;h<64;h++){const m=(0,ho.rotr)(o,6)^(0,ho.rotr)(o,11)^(0,ho.rotr)(o,25),y=f+m+T4e(o,c,u)+R4e[h]+Wl[h]|0,v=((0,ho.rotr)(n,2)^(0,ho.rotr)(n,13)^(0,ho.rotr)(n,22))+C4e(n,i,s)|0;f=u,u=c,c=o,o=a+y|0,a=s,s=i,i=n,n=y+v|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(n,i,s,a,o,c,u,f)}roundClean(){Wl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class N4e extends lre{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}Uh.sha256=(0,ho.wrapConstructor)(()=>new lre);Uh.sha224=(0,ho.wrapConstructor)(()=>new N4e);var J6={};(function(t){/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const e=UZ,r=BigInt(0),n=BigInt(1),i=BigInt(2),s=BigInt(3),a=BigInt(8),o=Object.freeze({a:r,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});t.CURVE=o;const c=(_e,ee)=>(_e+ee/i)/ee,u={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(_e){const{n:ee}=o,ye=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Re=-n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ze=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),Ze=ye,ct=BigInt("0x100000000000000000000000000000000"),dt=c(Ze*_e,ee),Et=c(-Re*_e,ee);let ue=$(_e-dt*ye-Et*ze,ee),Z=$(-dt*Re-Et*Ze,ee);const ge=ue>ct,Me=Z>ct;if(ge&&(ue=ee-ue),Me&&(Z=ee-Z),ue>ct||Z>ct)throw new Error("splitScalarEndo: Endomorphism failed, k="+_e);return{k1neg:ge,k1:ue,k2neg:Me,k2:Z}}},f=32,h=32,m=32,y=f+1,w=2*f+1;function v(_e){const{a:ee,b:ye}=o,Re=$(_e*_e),ze=$(Re*_e);return $(ze+ee*_e+ye)}const g=o.a===r;class _ extends Error{constructor(ee){super(ee)}}function b(_e){if(!(_e instanceof S))throw new TypeError("JacobianPoint expected")}class S{constructor(ee,ye,Re){this.x=ee,this.y=ye,this.z=Re}static fromAffine(ee){if(!(ee instanceof E))throw new TypeError("JacobianPoint#fromAffine: expected Point");return ee.equals(E.ZERO)?S.ZERO:new S(ee.x,ee.y,n)}static toAffineBatch(ee){const ye=Q(ee.map(Re=>Re.z));return ee.map((Re,ze)=>Re.toAffine(ye[ze]))}static normalizeZ(ee){return S.toAffineBatch(ee).map(S.fromAffine)}equals(ee){b(ee);const{x:ye,y:Re,z:ze}=this,{x:Ze,y:ct,z:dt}=ee,Et=$(ze*ze),ue=$(dt*dt),Z=$(ye*ue),ge=$(Ze*Et),Me=$($(Re*dt)*ue),Le=$($(ct*ze)*Et);return Z===ge&&Me===Le}negate(){return new S(this.x,$(-this.y),this.z)}double(){const{x:ee,y:ye,z:Re}=this,ze=$(ee*ee),Ze=$(ye*ye),ct=$(Ze*Ze),dt=ee+Ze,Et=$(i*($(dt*dt)-ze-ct)),ue=$(s*ze),Z=$(ue*ue),ge=$(Z-i*Et),Me=$(ue*(Et-ge)-a*ct),Le=$(i*ye*Re);return new S(ge,Me,Le)}add(ee){b(ee);const{x:ye,y:Re,z:ze}=this,{x:Ze,y:ct,z:dt}=ee;if(Ze===r||ct===r)return this;if(ye===r||Re===r)return ee;const Et=$(ze*ze),ue=$(dt*dt),Z=$(ye*ue),ge=$(Ze*Et),Me=$($(Re*dt)*ue),Le=$($(ct*ze)*Et),wt=$(ge-Z),St=$(Le-Me);if(wt===r)return St===r?this.double():S.ZERO;const pr=$(wt*wt),lr=$(wt*pr),Xr=$(Z*pr),gr=$(St*St-lr-i*Xr),br=$(St*(Xr-gr)-Me*lr),nn=$(ze*dt*wt);return new S(gr,br,nn)}subtract(ee){return this.add(ee.negate())}multiplyUnsafe(ee){const ye=S.ZERO;if(typeof ee=="bigint"&&ee===r)return ye;let Re=q(ee);if(Re===n)return this;if(!g){let ge=ye,Me=this;for(;Re>r;)Re&n&&(ge=ge.add(Me)),Me=Me.double(),Re>>=n;return ge}let{k1neg:ze,k1:Ze,k2neg:ct,k2:dt}=u.splitScalar(Re),Et=ye,ue=ye,Z=this;for(;Ze>r||dt>r;)Ze&n&&(Et=Et.add(Z)),dt&n&&(ue=ue.add(Z)),Z=Z.double(),Ze>>=n,dt>>=n;return ze&&(Et=Et.negate()),ct&&(ue=ue.negate()),ue=new S($(ue.x*u.beta),ue.y,ue.z),Et.add(ue)}precomputeWindow(ee){const ye=g?128/ee+1:256/ee+1,Re=[];let ze=this,Ze=ze;for(let ct=0;ct<ye;ct++){Ze=ze,Re.push(Ze);for(let dt=1;dt<2**(ee-1);dt++)Ze=Ze.add(ze),Re.push(Ze);ze=Ze.double()}return Re}wNAF(ee,ye){!ye&&this.equals(S.BASE)&&(ye=E.BASE);const Re=ye&&ye._WINDOW_SIZE||1;if(256%Re)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let ze=ye&&O.get(ye);ze||(ze=this.precomputeWindow(Re),ye&&Re!==1&&(ze=S.normalizeZ(ze),O.set(ye,ze)));let Ze=S.ZERO,ct=S.BASE;const dt=1+(g?128/Re:256/Re),Et=2**(Re-1),ue=BigInt(2**Re-1),Z=2**Re,ge=BigInt(Re);for(let Me=0;Me<dt;Me++){const Le=Me*Et;let wt=Number(ee&ue);ee>>=ge,wt>Et&&(wt-=Z,ee+=n);const St=Le,pr=Le+Math.abs(wt)-1,lr=Me%2!==0,Xr=wt<0;wt===0?ct=ct.add(A(lr,ze[St])):Ze=Ze.add(A(Xr,ze[pr]))}return{p:Ze,f:ct}}multiply(ee,ye){let Re=q(ee),ze,Ze;if(g){const{k1neg:ct,k1:dt,k2neg:Et,k2:ue}=u.splitScalar(Re);let{p:Z,f:ge}=this.wNAF(dt,ye),{p:Me,f:Le}=this.wNAF(ue,ye);Z=A(ct,Z),Me=A(Et,Me),Me=new S($(Me.x*u.beta),Me.y,Me.z),ze=Z.add(Me),Ze=ge.add(Le)}else{const{p:ct,f:dt}=this.wNAF(Re,ye);ze=ct,Ze=dt}return S.normalizeZ([ze,Ze])[0]}toAffine(ee){const{x:ye,y:Re,z:ze}=this,Ze=this.equals(S.ZERO);ee==null&&(ee=Ze?a:pe(ze));const ct=ee,dt=$(ct*ct),Et=$(dt*ct),ue=$(ye*dt),Z=$(Re*Et),ge=$(ze*ct);if(Ze)return E.ZERO;if(ge!==n)throw new Error("invZ was invalid");return new E(ue,Z)}}S.BASE=new S(o.Gx,o.Gy,n),S.ZERO=new S(r,n,r);function A(_e,ee){const ye=ee.negate();return _e?ye:ee}const O=new WeakMap;class E{constructor(ee,ye){this.x=ee,this.y=ye}_setWindowSize(ee){this._WINDOW_SIZE=ee,O.delete(this)}hasEvenY(){return this.y%i===r}static fromCompressedHex(ee){const ye=ee.length===32,Re=H(ye?ee:ee.subarray(1));if(!yt(Re))throw new Error("Point is not on curve");const ze=v(Re);let Ze=G(ze);const ct=(Ze&n)===n;ye?ct&&(Ze=$(-Ze)):(ee[0]&1)===1!==ct&&(Ze=$(-Ze));const dt=new E(Re,Ze);return dt.assertValidity(),dt}static fromUncompressedHex(ee){const ye=H(ee.subarray(1,f+1)),Re=H(ee.subarray(f+1,f*2+1)),ze=new E(ye,Re);return ze.assertValidity(),ze}static fromHex(ee){const ye=M(ee),Re=ye.length,ze=ye[0];if(Re===f)return this.fromCompressedHex(ye);if(Re===y&&(ze===2||ze===3))return this.fromCompressedHex(ye);if(Re===w&&ze===4)return this.fromUncompressedHex(ye);throw new Error(`Point.fromHex: received invalid point. Expected 32-${y} compressed bytes or ${w} uncompressed bytes, not ${Re}`)}static fromPrivateKey(ee){return E.BASE.multiply(gt(ee))}static fromSignature(ee,ye,Re){const{r:ze,s:Ze}=Zt(ye);if(![0,1,2,3].includes(Re))throw new Error("Cannot recover: invalid recovery bit");const ct=ce(M(ee)),{n:dt}=o,Et=Re===2||Re===3?ze+dt:ze,ue=pe(Et,dt),Z=$(-ct*ue,dt),ge=$(Ze*ue,dt),Me=Re&1?"03":"02",Le=E.fromHex(Me+L(Et)),wt=E.BASE.multiplyAndAddUnsafe(Le,Z,ge);if(!wt)throw new Error("Cannot recover signature: point at infinify");return wt.assertValidity(),wt}toRawBytes(ee=!1){return F(this.toHex(ee))}toHex(ee=!1){const ye=L(this.x);return ee?`${this.hasEvenY()?"02":"03"}${ye}`:`04${ye}${L(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const ee="Point is not on elliptic curve",{x:ye,y:Re}=this;if(!yt(ye)||!yt(Re))throw new Error(ee);const ze=$(Re*Re),Ze=v(ye);if($(ze-Ze)!==r)throw new Error(ee)}equals(ee){return this.x===ee.x&&this.y===ee.y}negate(){return new E(this.x,$(-this.y))}double(){return S.fromAffine(this).double().toAffine()}add(ee){return S.fromAffine(this).add(S.fromAffine(ee)).toAffine()}subtract(ee){return this.add(ee.negate())}multiply(ee){return S.fromAffine(this).multiply(ee,this).toAffine()}multiplyAndAddUnsafe(ee,ye,Re){const ze=S.fromAffine(this),Ze=ye===r||ye===n||this!==E.BASE?ze.multiplyUnsafe(ye):ze.multiply(ye),ct=S.fromAffine(ee).multiplyUnsafe(Re),dt=Ze.add(ct);return dt.equals(S.ZERO)?void 0:dt.toAffine()}}t.Point=E,E.BASE=new E(o.Gx,o.Gy),E.ZERO=new E(r,r);function p(_e){return Number.parseInt(_e[0],16)>=8?"00"+_e:_e}function I(_e){if(_e.length<2||_e[0]!==2)throw new Error(`Invalid signature integer tag: ${ve(_e)}`);const ee=_e[1],ye=_e.subarray(2,ee+2);if(!ee||ye.length!==ee)throw new Error("Invalid signature integer: wrong length");if(ye[0]===0&&ye[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:H(ye),left:_e.subarray(ee+2)}}function N(_e){if(_e.length<2||_e[0]!=48)throw new Error(`Invalid signature tag: ${ve(_e)}`);if(_e[1]!==_e.length-2)throw new Error("Invalid signature: incorrect length");const{data:ee,left:ye}=I(_e.subarray(2)),{data:Re,left:ze}=I(ye);if(ze.length)throw new Error(`Invalid signature: left bytes after parsing: ${ve(ze)}`);return{r:ee,s:Re}}class B{constructor(ee,ye){this.r=ee,this.s=ye,this.assertValidity()}static fromCompact(ee){const ye=ee instanceof Uint8Array,Re="Signature.fromCompact";if(typeof ee!="string"&&!ye)throw new TypeError(`${Re}: Expected string or Uint8Array`);const ze=ye?ve(ee):ee;if(ze.length!==128)throw new Error(`${Re}: Expected 64-byte hex`);return new B(U(ze.slice(0,64)),U(ze.slice(64,128)))}static fromDER(ee){const ye=ee instanceof Uint8Array;if(typeof ee!="string"&&!ye)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:Re,s:ze}=N(ye?ee:F(ee));return new B(Re,ze)}static fromHex(ee){return this.fromDER(ee)}assertValidity(){const{r:ee,s:ye}=this;if(!tt(ee))throw new Error("Invalid Signature: r must be 0 < r < n");if(!tt(ye))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const ee=o.n>>n;return this.s>ee}normalizeS(){return this.hasHighS()?new B(this.r,$(-this.s,o.n)):this}toDERRawBytes(){return F(this.toDERHex())}toDERHex(){const ee=p(ne(this.s)),ye=p(ne(this.r)),Re=ee.length/2,ze=ye.length/2,Ze=ne(Re),ct=ne(ze);return`30${ne(ze+Re+4)}02${ct}${ye}02${Ze}${ee}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return F(this.toCompactHex())}toCompactHex(){return L(this.r)+L(this.s)}}t.Signature=B;function V(..._e){if(!_e.every(Re=>Re instanceof Uint8Array))throw new Error("Uint8Array list expected");if(_e.length===1)return _e[0];const ee=_e.reduce((Re,ze)=>Re+ze.length,0),ye=new Uint8Array(ee);for(let Re=0,ze=0;Re<_e.length;Re++){const Ze=_e[Re];ye.set(Ze,ze),ze+=Ze.length}return ye}const de=Array.from({length:256},(_e,ee)=>ee.toString(16).padStart(2,"0"));function ve(_e){if(!(_e instanceof Uint8Array))throw new Error("Expected Uint8Array");let ee="";for(let ye=0;ye<_e.length;ye++)ee+=de[_e[ye]];return ee}const j=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function L(_e){if(typeof _e!="bigint")throw new Error("Expected bigint");if(!(r<=_e&&_e<j))throw new Error("Expected number 0 <= n < 2^256");return _e.toString(16).padStart(64,"0")}function Y(_e){const ee=F(L(_e));if(ee.length!==32)throw new Error("Error: expected 32 bytes");return ee}function ne(_e){const ee=_e.toString(16);return ee.length&1?`0${ee}`:ee}function U(_e){if(typeof _e!="string")throw new TypeError("hexToNumber: expected string, got "+typeof _e);return BigInt(`0x${_e}`)}function F(_e){if(typeof _e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof _e);if(_e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+_e.length);const ee=new Uint8Array(_e.length/2);for(let ye=0;ye<ee.length;ye++){const Re=ye*2,ze=_e.slice(Re,Re+2),Ze=Number.parseInt(ze,16);if(Number.isNaN(Ze)||Ze<0)throw new Error("Invalid byte sequence");ee[ye]=Ze}return ee}function H(_e){return U(ve(_e))}function M(_e){return _e instanceof Uint8Array?Uint8Array.from(_e):F(_e)}function q(_e){if(typeof _e=="number"&&Number.isSafeInteger(_e)&&_e>0)return BigInt(_e);if(typeof _e=="bigint"&&tt(_e))return _e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function $(_e,ee=o.P){const ye=_e%ee;return ye>=r?ye:ee+ye}function k(_e,ee){const{P:ye}=o;let Re=_e;for(;ee-- >r;)Re*=Re,Re%=ye;return Re}function G(_e){const{P:ee}=o,ye=BigInt(6),Re=BigInt(11),ze=BigInt(22),Ze=BigInt(23),ct=BigInt(44),dt=BigInt(88),Et=_e*_e*_e%ee,ue=Et*Et*_e%ee,Z=k(ue,s)*ue%ee,ge=k(Z,s)*ue%ee,Me=k(ge,i)*Et%ee,Le=k(Me,Re)*Me%ee,wt=k(Le,ze)*Le%ee,St=k(wt,ct)*wt%ee,pr=k(St,dt)*St%ee,lr=k(pr,ct)*wt%ee,Xr=k(lr,s)*ue%ee,gr=k(Xr,Ze)*Le%ee,br=k(gr,ye)*Et%ee,nn=k(br,i);if(nn*nn%ee!==_e)throw new Error("Cannot find square root");return nn}function pe(_e,ee=o.P){if(_e===r||ee<=r)throw new Error(`invert: expected positive integers, got n=${_e} mod=${ee}`);let ye=$(_e,ee),Re=ee,ze=r,Ze=n;for(;ye!==r;){const dt=Re/ye,Et=Re%ye,ue=ze-Ze*dt;Re=ye,ye=Et,ze=Ze,Ze=ue}if(Re!==n)throw new Error("invert: does not exist");return $(ze,ee)}function Q(_e,ee=o.P){const ye=new Array(_e.length),Re=_e.reduce((Ze,ct,dt)=>ct===r?Ze:(ye[dt]=Ze,$(Ze*ct,ee)),n),ze=pe(Re,ee);return _e.reduceRight((Ze,ct,dt)=>ct===r?Ze:(ye[dt]=$(Ze*ye[dt],ee),$(Ze*ct,ee)),ze),ye}function te(_e){const ee=_e.length*8-h*8,ye=H(_e);return ee>0?ye>>BigInt(ee):ye}function ce(_e,ee=!1){const ye=te(_e);if(ee)return ye;const{n:Re}=o;return ye>=Re?ye-Re:ye}let T,le;class Ge{constructor(ee,ye){if(this.hashLen=ee,this.qByteLen=ye,typeof ee!="number"||ee<2)throw new Error("hashLen must be a number");if(typeof ye!="number"||ye<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(ee).fill(1),this.k=new Uint8Array(ee).fill(0),this.counter=0}hmac(...ee){return t.utils.hmacSha256(this.k,...ee)}hmacSync(...ee){return le(this.k,...ee)}checkSync(){if(typeof le!="function")throw new _("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(ee=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),ee),this.v=await this.hmac(this.v),ee.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),ee),this.v=await this.hmac(this.v))}reseedSync(ee=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),ee),this.v=this.hmacSync(this.v),ee.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),ee),this.v=this.hmacSync(this.v))}async generate(){this.incr();let ee=0;const ye=[];for(;ee<this.qByteLen;){this.v=await this.hmac(this.v);const Re=this.v.slice();ye.push(Re),ee+=this.v.length}return V(...ye)}generateSync(){this.checkSync(),this.incr();let ee=0;const ye=[];for(;ee<this.qByteLen;){this.v=this.hmacSync(this.v);const Re=this.v.slice();ye.push(Re),ee+=this.v.length}return V(...ye)}}function tt(_e){return r<_e&&_e<o.n}function yt(_e){return r<_e&&_e<o.P}function vt(_e,ee,ye,Re=!0){const{n:ze}=o,Ze=ce(_e,!0);if(!tt(Ze))return;const ct=pe(Ze,ze),dt=E.BASE.multiply(Ze),Et=$(dt.x,ze);if(Et===r)return;const ue=$(ct*$(ee+ye*Et,ze),ze);if(ue===r)return;let Z=new B(Et,ue),ge=(dt.x===Z.r?0:2)|Number(dt.y&n);return Re&&Z.hasHighS()&&(Z=Z.normalizeS(),ge^=1),{sig:Z,recovery:ge}}function gt(_e){let ee;if(typeof _e=="bigint")ee=_e;else if(typeof _e=="number"&&Number.isSafeInteger(_e)&&_e>0)ee=BigInt(_e);else if(typeof _e=="string"){if(_e.length!==2*h)throw new Error("Expected 32 bytes of private key");ee=U(_e)}else if(_e instanceof Uint8Array){if(_e.length!==h)throw new Error("Expected 32 bytes of private key");ee=H(_e)}else throw new TypeError("Expected valid private key");if(!tt(ee))throw new Error("Expected private key: 0 < key < n");return ee}function Bt(_e){return _e instanceof E?(_e.assertValidity(),_e):E.fromHex(_e)}function Zt(_e){if(_e instanceof B)return _e.assertValidity(),_e;try{return B.fromDER(_e)}catch{return B.fromCompact(_e)}}function Or(_e,ee=!1){return E.fromPrivateKey(_e).toRawBytes(ee)}t.getPublicKey=Or;function Ct(_e,ee,ye,Re=!1){return E.fromSignature(_e,ee,ye).toRawBytes(Re)}t.recoverPublicKey=Ct;function Pt(_e){const ee=_e instanceof Uint8Array,ye=typeof _e=="string",Re=(ee||ye)&&_e.length;return ee?Re===y||Re===w:ye?Re===y*2||Re===w*2:_e instanceof E}function $t(_e,ee,ye=!1){if(Pt(_e))throw new TypeError("getSharedSecret: first arg must be private key");if(!Pt(ee))throw new TypeError("getSharedSecret: second arg must be public key");const Re=Bt(ee);return Re.assertValidity(),Re.multiply(gt(_e)).toRawBytes(ye)}t.getSharedSecret=$t;function Rt(_e){const ee=_e.length>f?_e.slice(0,f):_e;return H(ee)}function Wt(_e){const ee=Rt(_e),ye=$(ee,o.n);return Ft(ye<r?ee:ye)}function Ft(_e){return Y(_e)}function Kt(_e,ee,ye){if(_e==null)throw new Error(`sign: expected valid message hash, not "${_e}"`);const Re=M(_e),ze=gt(ee),Ze=[Ft(ze),Wt(Re)];if(ye!=null){ye===!0&&(ye=t.utils.randomBytes(f));const Et=M(ye);if(Et.length!==f)throw new Error(`sign: Expected ${f} bytes of extra data`);Ze.push(Et)}const ct=V(...Ze),dt=Rt(Re);return{seed:ct,m:dt,d:ze}}function Dt(_e,ee){const{sig:ye,recovery:Re}=_e,{der:ze,recovered:Ze}=Object.assign({canonical:!0,der:!0},ee),ct=ze?ye.toDERRawBytes():ye.toCompactRawBytes();return Ze?[ct,Re]:ct}async function Nt(_e,ee,ye={}){const{seed:Re,m:ze,d:Ze}=Kt(_e,ee,ye.extraEntropy),ct=new Ge(m,h);await ct.reseed(Re);let dt;for(;!(dt=vt(await ct.generate(),ze,Ze,ye.canonical));)await ct.reseed();return Dt(dt,ye)}t.sign=Nt;function Vt(_e,ee,ye={}){const{seed:Re,m:ze,d:Ze}=Kt(_e,ee,ye.extraEntropy),ct=new Ge(m,h);ct.reseedSync(Re);let dt;for(;!(dt=vt(ct.generateSync(),ze,Ze,ye.canonical));)ct.reseedSync();return Dt(dt,ye)}t.signSync=Vt;const Mt={strict:!0};function ur(_e,ee,ye,Re=Mt){let ze;try{ze=Zt(_e),ee=M(ee)}catch{return!1}const{r:Ze,s:ct}=ze;if(Re.strict&&ze.hasHighS())return!1;const dt=ce(ee);let Et;try{Et=Bt(ye)}catch{return!1}const{n:ue}=o,Z=pe(ct,ue),ge=$(dt*Z,ue),Me=$(Ze*Z,ue),Le=E.BASE.multiplyAndAddUnsafe(Et,ge,Me);return Le?$(Le.x,ue)===Ze:!1}t.verify=ur;function rr(_e){return $(H(_e),o.n)}class ar{constructor(ee,ye){this.r=ee,this.s=ye,this.assertValidity()}static fromHex(ee){const ye=M(ee);if(ye.length!==64)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${ye.length}`);const Re=H(ye.subarray(0,32)),ze=H(ye.subarray(32,64));return new ar(Re,ze)}assertValidity(){const{r:ee,s:ye}=this;if(!yt(ee)||!tt(ye))throw new Error("Invalid signature")}toHex(){return L(this.r)+L(this.s)}toRawBytes(){return F(this.toHex())}}function ir(_e){return E.fromPrivateKey(_e).toRawX()}class wr{constructor(ee,ye,Re=t.utils.randomBytes()){if(ee==null)throw new TypeError(`sign: Expected valid message, not "${ee}"`);this.m=M(ee);const{x:ze,scalar:Ze}=this.getScalar(gt(ye));if(this.px=ze,this.d=Ze,this.rand=M(Re),this.rand.length!==32)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(ee){const ye=E.fromPrivateKey(ee),Re=ye.hasEvenY()?ee:o.n-ee;return{point:ye,scalar:Re,x:ye.toRawX()}}initNonce(ee,ye){return Y(ee^H(ye))}finalizeNonce(ee){const ye=$(H(ee),o.n);if(ye===r)throw new Error("sign: Creation of signature failed. k is zero");const{point:Re,x:ze,scalar:Ze}=this.getScalar(ye);return{R:Re,rx:ze,k:Ze}}finalizeSig(ee,ye,Re,ze){return new ar(ee.x,$(ye+Re*ze,o.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:ee,d:ye,px:Re,rand:ze}=this,Ze=t.utils.taggedHash,ct=this.initNonce(ye,await Ze(Br.aux,ze)),{R:dt,rx:Et,k:ue}=this.finalizeNonce(await Ze(Br.nonce,ct,Re,ee)),Z=rr(await Ze(Br.challenge,Et,Re,ee)),ge=this.finalizeSig(dt,ue,Z,ye);return await Ln(ge,ee,Re)||this.error(),ge}calcSync(){const{m:ee,d:ye,px:Re,rand:ze}=this,Ze=t.utils.taggedHashSync,ct=this.initNonce(ye,Ze(Br.aux,ze)),{R:dt,rx:Et,k:ue}=this.finalizeNonce(Ze(Br.nonce,ct,Re,ee)),Z=rr(Ze(Br.challenge,Et,Re,ee)),ge=this.finalizeSig(dt,ue,Z,ye);return ri(ge,ee,Re)||this.error(),ge}}async function An(_e,ee,ye){return new wr(_e,ee,ye).calc()}function rn(_e,ee,ye){return new wr(_e,ee,ye).calcSync()}function hi(_e,ee,ye){const Re=_e instanceof ar,ze=Re?_e:ar.fromHex(_e);return Re&&ze.assertValidity(),{...ze,m:M(ee),P:Bt(ye)}}function $n(_e,ee,ye,Re){const ze=E.BASE.multiplyAndAddUnsafe(ee,gt(ye),$(-Re,o.n));return!(!ze||!ze.hasEvenY()||ze.x!==_e)}async function Ln(_e,ee,ye){try{const{r:Re,s:ze,m:Ze,P:ct}=hi(_e,ee,ye),dt=rr(await t.utils.taggedHash(Br.challenge,Y(Re),ct.toRawX(),Ze));return $n(Re,ct,ze,dt)}catch{return!1}}function ri(_e,ee,ye){try{const{r:Re,s:ze,m:Ze,P:ct}=hi(_e,ee,ye),dt=rr(t.utils.taggedHashSync(Br.challenge,Y(Re),ct.toRawX(),Ze));return $n(Re,ct,ze,dt)}catch(Re){if(Re instanceof _)throw Re;return!1}}t.schnorr={Signature:ar,getPublicKey:ir,sign:An,verify:Ln,signSync:rn,verifySync:ri},E.BASE._setWindowSize(8);const Cr={node:e,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Br={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},Ir={};t.utils={bytesToHex:ve,hexToBytes:F,concatBytes:V,mod:$,invert:pe,isValidPrivateKey(_e){try{return gt(_e),!0}catch{return!1}},_bigintTo32Bytes:Y,_normalizePrivateKey:gt,hashToPrivateKey:_e=>{_e=M(_e);const ee=h+8;if(_e.length<ee||_e.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const ye=$(H(_e),o.n-n)+n;return Y(ye)},randomBytes:(_e=32)=>{if(Cr.web)return Cr.web.getRandomValues(new Uint8Array(_e));if(Cr.node){const{randomBytes:ee}=Cr.node;return Uint8Array.from(ee(_e))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.hashToPrivateKey(t.utils.randomBytes(h+8)),precompute(_e=8,ee=E.BASE){const ye=ee===E.BASE?ee:new E(ee.x,ee.y);return ye._setWindowSize(_e),ye.multiply(s),ye},sha256:async(..._e)=>{if(Cr.web){const ee=await Cr.web.subtle.digest("SHA-256",V(..._e));return new Uint8Array(ee)}else if(Cr.node){const{createHash:ee}=Cr.node,ye=ee("sha256");return _e.forEach(Re=>ye.update(Re)),Uint8Array.from(ye.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(_e,...ee)=>{if(Cr.web){const ye=await Cr.web.subtle.importKey("raw",_e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Re=V(...ee),ze=await Cr.web.subtle.sign("HMAC",ye,Re);return new Uint8Array(ze)}else if(Cr.node){const{createHmac:ye}=Cr.node,Re=ye("sha256",_e);return ee.forEach(ze=>Re.update(ze)),Uint8Array.from(Re.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(_e,...ee)=>{let ye=Ir[_e];if(ye===void 0){const Re=await t.utils.sha256(Uint8Array.from(_e,ze=>ze.charCodeAt(0)));ye=V(Re,Re),Ir[_e]=ye}return t.utils.sha256(ye,...ee)},taggedHashSync:(_e,...ee)=>{if(typeof T!="function")throw new _("sha256Sync is undefined, you need to set it");let ye=Ir[_e];if(ye===void 0){const Re=T(Uint8Array.from(_e,ze=>ze.charCodeAt(0)));ye=V(Re,Re),Ir[_e]=ye}return T(ye,...ee)},_JacobianPoint:S},Object.defineProperties(t.utils,{sha256Sync:{configurable:!1,get(){return T},set(_e){T||(T=_e)}},hmacSha256Sync:{configurable:!1,get(){return le},set(_e){le||(le=_e)}}})})(J6);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.schnorr=t.Signature=t.Point=t.CURVE=t.utils=t.getSharedSecret=t.recoverPublicKey=t.verify=t.signSync=t.sign=t.getPublicKey=void 0;const e=sre,r=Uh,n=J6;var i=J6;Object.defineProperty(t,"getPublicKey",{enumerable:!0,get:function(){return i.getPublicKey}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return i.sign}}),Object.defineProperty(t,"signSync",{enumerable:!0,get:function(){return i.signSync}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return i.verify}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return i.recoverPublicKey}}),Object.defineProperty(t,"getSharedSecret",{enumerable:!0,get:function(){return i.getSharedSecret}}),Object.defineProperty(t,"utils",{enumerable:!0,get:function(){return i.utils}}),Object.defineProperty(t,"CURVE",{enumerable:!0,get:function(){return i.CURVE}}),Object.defineProperty(t,"Point",{enumerable:!0,get:function(){return i.Point}}),Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return i.Signature}}),Object.defineProperty(t,"schnorr",{enumerable:!0,get:function(){return i.schnorr}}),n.utils.hmacSha256Sync=(s,...a)=>{const o=e.hmac.create(r.sha256,s);return a.forEach(c=>o.update(c)),o.digest()}})(cM);var Nr={},Ox={exports:{}};Ox.exports;(function(t,e){var r=$e&&$e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.wrapHash=e.equalsBytes=e.hexToBytes=e.bytesToUtf8=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0;const n=r(ls),i=qg,s=n.default.bool;e.assertBool=s;const a=n.default.bytes;e.assertBytes=a;var o=qg;Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});function c(m){if(!(m instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof m}`);return new TextDecoder().decode(m)}e.bytesToUtf8=c;function u(m){const y=m.startsWith("0x")?m.substring(2):m;return(0,i.hexToBytes)(y)}e.hexToBytes=u;function f(m,y){if(m.length!==y.length)return!1;for(let w=0;w<m.length;w++)if(m[w]!==y[w])return!1;return!0}e.equalsBytes=f;function h(m){return y=>(n.default.bytes(y),m(y))}e.wrapHash=h,e.crypto=(()=>{const m=typeof self=="object"&&"crypto"in self?self.crypto:void 0,y=typeof O6=="function"&&O6.bind(t);return{node:y&&!m?y("crypto"):void 0,web:m}})()})(Ox,Ox.exports);var D4e=Ox.exports,M4e=$e&&$e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),k4e=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$4e=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&M4e(e,t,r);return k4e(e,t),e};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.contextRandomize=Nr.ecdh=Nr.signatureNormalize=Nr.signatureImport=Nr.signatureExport=Nr.privateKeyTweakMul=Nr.publicKeyTweakMul=Nr.publicKeyTweakAdd=Nr.publicKeyCombine=Nr.publicKeyNegate=Nr.privateKeyNegate=Nr.privateKeyTweakAdd=Nr.ecdsaVerify=Nr.ecdsaRecover=Nr.ecdsaSign=Nr.publicKeyConvert=Nr.publicKeyVerify=Nr.publicKeyCreate=Nr.privateKeyVerify=Nr.createPrivateKey=Nr.createPrivateKeySync=void 0;const L4e=Uh,Xn=$4e(cM),Tr=D4e;function U4e(t){if(typeof t!="string")throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}const Hf=t=>U4e((0,Tr.toHex)(t)),BA=t=>t.toString(16).padStart(64,"0"),X6=t=>(0,Tr.hexToBytes)(BA(t)),{mod:fre}=Xn.utils,yc=Xn.CURVE.n;function Mo(t=n=>new Uint8Array(n),e,r){return typeof t=="function"&&(t=t(e)),(0,Tr.assertBytes)(t,e),r&&t.set(r),t}function Rb(t){return(0,Tr.assertBytes)(t,64),Xn.Signature.fromCompact(t)}function dre(){return Xn.utils.randomPrivateKey()}Nr.createPrivateKeySync=dre;async function j4e(){return dre()}Nr.createPrivateKey=j4e;function B4e(t){return(0,Tr.assertBytes)(t,32),Xn.utils.isValidPrivateKey(t)}Nr.privateKeyVerify=B4e;function F4e(t,e=!0,r){(0,Tr.assertBytes)(t,32),(0,Tr.assertBool)(e);const n=Xn.getPublicKey(t,e);return Mo(r,e?33:65,n)}Nr.publicKeyCreate=F4e;function q4e(t){(0,Tr.assertBytes)(t,33,65);try{return Xn.Point.fromHex(t),!0}catch{return!1}}Nr.publicKeyVerify=q4e;function H4e(t,e=!0,r){(0,Tr.assertBytes)(t,33,65),(0,Tr.assertBool)(e);const n=Xn.Point.fromHex(t).toRawBytes(e);return Mo(r,e?33:65,n)}Nr.publicKeyConvert=H4e;function z4e(t,e,r={noncefn:void 0,data:void 0},n){if((0,Tr.assertBytes)(t,32),(0,Tr.assertBytes)(e,32),typeof r!="object"||r===null)throw new TypeError("secp256k1.ecdsaSign: options should be object");if(r&&(r.noncefn!==void 0||r.data!==void 0))throw new Error("Secp256k1: noncefn && data is unsupported");const[i,s]=Xn.signSync(t,e,{recovered:!0,der:!1});return{signature:Mo(n,64,i),recid:s}}Nr.ecdsaSign=z4e;function V4e(t,e,r,n=!0,i){(0,Tr.assertBytes)(r,32),(0,Tr.assertBool)(n);const s=Rb(t).toHex(),a=Xn.Point.fromSignature(r,s,e);return Mo(i,n?33:65,a.toRawBytes(n))}Nr.ecdsaRecover=V4e;function G4e(t,e,r){(0,Tr.assertBytes)(t,64),(0,Tr.assertBytes)(e,32),(0,Tr.assertBytes)(r,33,65),(0,Tr.assertBytes)(t,64);const n=Hf(t.slice(0,32)),i=Hf(t.slice(32,64));if(n>=yc||i>=yc)throw new Error("Cannot parse signature");const s=Xn.Point.fromHex(r);let a;try{a=Rb(t)}catch{return!1}return Xn.verify(a,e,s)}Nr.ecdsaVerify=G4e;function K4e(t,e){(0,Tr.assertBytes)(t,32),(0,Tr.assertBytes)(e,32);let r=Hf(e);if(r===0n)throw new Error("Tweak must not be zero");if(r>=yc)throw new Error("Tweak bigger than curve order");if(r+=Hf(t),r>=yc&&(r-=yc),r===0n)throw new Error("The tweak was out of range or the resulted private key is invalid");return t.set((0,Tr.hexToBytes)(BA(r))),t}Nr.privateKeyTweakAdd=K4e;function W4e(t){(0,Tr.assertBytes)(t,32);const e=fre(-Hf(t),yc);return t.set((0,Tr.hexToBytes)(BA(e))),t}Nr.privateKeyNegate=W4e;function Y4e(t,e=!0,r){(0,Tr.assertBytes)(t,33,65),(0,Tr.assertBool)(e);const n=Xn.Point.fromHex(t).negate();return Mo(r,e?33:65,n.toRawBytes(e))}Nr.publicKeyNegate=Y4e;function Q4e(t,e=!0,r){if(!Array.isArray(t)||!t.length)throw new TypeError(`Expected array with one or more items, not ${t}`);for(const i of t)(0,Tr.assertBytes)(i,33,65);(0,Tr.assertBool)(e);const n=t.map(i=>Xn.Point.fromHex(i)).reduce((i,s)=>i.add(s),Xn.Point.ZERO);if(n.equals(Xn.Point.ZERO))throw new Error("Combined result must not be zero");return Mo(r,e?33:65,n.toRawBytes(e))}Nr.publicKeyCombine=Q4e;function J4e(t,e,r=!0,n){(0,Tr.assertBytes)(t,33,65),(0,Tr.assertBytes)(e,32),(0,Tr.assertBool)(r);const i=Xn.Point.fromHex(t),s=Xn.Point.fromPrivateKey(e),a=i.add(s);if(s.equals(Xn.Point.ZERO)||a.equals(Xn.Point.ZERO))throw new Error("Tweak must not be zero");return Mo(n,r?33:65,a.toRawBytes(r))}Nr.publicKeyTweakAdd=J4e;function X4e(t,e,r=!0,n){(0,Tr.assertBytes)(t,33,65),(0,Tr.assertBytes)(e,32),(0,Tr.assertBool)(r);const i=Hf(e);if(i===0n)throw new Error("Tweak must not be zero");if(i<=1||i>=yc)throw new Error("Tweak is zero or bigger than curve order");const s=Xn.Point.fromHex(t).multiply(i);return Mo(n,r?33:65,s.toRawBytes(r))}Nr.publicKeyTweakMul=X4e;function Z4e(t,e){(0,Tr.assertBytes)(t,32),(0,Tr.assertBytes)(e,32);const r=Hf(e);if(r<=1||r>=yc)throw new Error("Tweak is zero or bigger than curve order");const n=fre(r*Hf(t),yc);if(n===0n)throw new Error("The tweak was out of range or the resulted private key is invalid");return t.set((0,Tr.hexToBytes)(BA(n))),t}Nr.privateKeyTweakMul=Z4e;function eDe(t,e){const r=Rb(t).toRawBytes();return Mo(e,72,Rb(t).toRawBytes()).slice(0,r.length)}Nr.signatureExport=eDe;function tDe(t,e){(0,Tr.assertBytes)(t);const r=Xn.Signature.fromDER(t);return Mo(e,64,(0,Tr.hexToBytes)(r.toCompactHex()))}Nr.signatureImport=tDe;function rDe(t){const e=Rb(t);return e.s>yc/2n&&t.set(X6(yc-e.s),32),t}Nr.signatureNormalize=rDe;function nDe(t,e,r={},n){if((0,Tr.assertBytes)(t,33,65),(0,Tr.assertBytes)(e,32),typeof r!="object"||r===null)throw new TypeError("secp256k1.ecdh: options should be object");r.data!==void 0&&(0,Tr.assertBytes)(r.data);const i=Xn.Point.fromHex(Xn.getSharedSecret(e,t));if(r.hashfn===void 0)return Mo(n,32,(0,L4e.sha256)(i.toRawBytes(!0)));if(typeof r.hashfn!="function")throw new TypeError("secp256k1.ecdh: options.hashfn should be function");r.xbuf!==void 0&&(0,Tr.assertBytes)(r.xbuf,32),r.ybuf!==void 0&&(0,Tr.assertBytes)(r.ybuf,32),(0,Tr.assertBytes)(n,32);const s=r.xbuf||new Uint8Array(32);s.set(X6(i.x));const a=r.ybuf||new Uint8Array(32);a.set(X6(i.y));const o=r.hashfn(s,a,r.data);if(!(o instanceof Uint8Array)||o.length!==32)throw new Error("secp256k1.ecdh: invalid options.hashfn output");return Mo(n,32,o)}Nr.ecdh=nDe;function iDe(t){t!==null&&(0,Tr.assertBytes)(t,32)}Nr.contextRandomize=iDe;Object.defineProperty(Ts,"__esModule",{value:!0});Ts.createUnsafeIdentity=Ts.computeAddress=Ts.ethSign=Ts.createEthereumMessageHash=Ts.sign=Ts.recoverAddressFromEthSignature=Ts.recoverPublicKey=void 0;const Fa=kA,PV=cM,hre=Nr;function pre(t,e){if(t.length!==65)throw new Error("Invalid signature length"+t.length);const r=t.slice(0,t.length-1),n=t[64]===28?1:0;return(0,hre.ecdsaRecover)(r,n,e,!1).slice(1)}Ts.recoverPublicKey=pre;function sDe(t){if(t.length!==65)throw new Error("Invalid ethereum signature");const e=t[64];if(e===0||e===1){const r=new Uint8Array(t);return r[64]=e+27,r}return t}function gre(t,e){if(typeof t=="string"){if((0,Fa.isHex)(t))return gre((0,Fa.hexToBytes)(t),e);throw new Error("String signatures must be encoded in hex")}return fM(pre(sDe(t),lM(e)))}Ts.recoverAddressFromEthSignature=gre;function mre(t,e){const r=(0,hre.ecdsaSign)(e,t),n=r.recid===1?"1c":"1b";return(0,Fa.toHex)(r.signature)+n}Ts.sign=mre;function lM(t){const e=typeof t=="string"?(0,Fa.stringToUtf8Bytes)(t):t,r=(0,Fa.concatBytes)((0,Fa.stringToUtf8Bytes)(`Ethereum Signed Message:
174
- `),(0,Fa.stringToUtf8Bytes)(String(e.length)),e);return(0,Fa.hexToBytes)((0,Fa.sha3)(r))}Ts.createEthereumMessageHash=lM;function aDe(t,e){return mre(t,lM(e))}Ts.ethSign=aDe;function fM(t){const e=t.length===65&&t[0]===4?t.slice(1):t;return(0,Fa.getAddress)((0,Fa.sha3)(e).substring(24))}Ts.computeAddress=fM;function oDe(){const t=PV.utils.randomPrivateKey(),e=(0,PV.getPublicKey)(t).slice(1),r=fM(e);return{privateKey:(0,Fa.bytesToHex)(t),publicKey:(0,Fa.bytesToHex)(e),address:r}}Ts.createUnsafeIdentity=oDe;(function(t){var e=$e&&$e.__createBinding||(Object.create?function(N,B,V,de){de===void 0&&(de=V);var ve=Object.getOwnPropertyDescriptor(B,V);(!ve||("get"in ve?!B.__esModule:ve.writable||ve.configurable))&&(ve={enumerable:!0,get:function(){return B[V]}}),Object.defineProperty(N,de,ve)}:function(N,B,V,de){de===void 0&&(de=V),N[de]=B[V]}),r=$e&&$e.__setModuleDefault||(Object.create?function(N,B){Object.defineProperty(N,"default",{enumerable:!0,value:B})}:function(N,B){N.default=B}),n=$e&&$e.__importStar||function(N){if(N&&N.__esModule)return N;var B={};if(N!=null)for(var V in N)V!=="default"&&Object.prototype.hasOwnProperty.call(N,V)&&e(B,N,V);return r(B,N),B},i=$e&&$e.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidEIP1271Signature=t.parseEmphemeralPayload=t.getSignedIdentitySignatureType=t.getEphemeralSignatureType=t.EIP_1654_SIGNED_ENTITY_VALIDATOR=t.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=t.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=t.ECDSA_SIGNED_ENTITY_VALIDATOR=t.SIGNER_VALIDATOR=t.Authenticator=t.ERC1654_MAGIC_VALUE=t.VALID_SIGNATURE=void 0;const s=n(kA),a=$A,o=aM,c=LA,u=i(oM),f=Ts;t.VALID_SIGNATURE="VALID_SIGNATURE",t.ERC1654_MAGIC_VALUE="1626ba7e";const h=132;var m;(function(N){async function B(H,M,q,$=Date.now()){let k="";if(!N.isValidAuthChain(M))return{ok:!1,message:"ERROR: Malformed authChain"};for(const pe of M){const Q=I(pe.type);try{const{nextAuthority:te}=await Q(k,pe,{provider:q,dateToValidateExpirationInMillis:$});k=te||""}catch(te){return{ok:!1,message:`ERROR. Link type: ${pe.type}. ${te.message}.`}}}const G=k===H;return{ok:G,message:G?void 0:`ERROR: Invalid final authority. Expected: ${H}. Current ${k}.`}}N.validateSignature=B;function V(H){for(const[M,q]of H.entries())if(M===0&&q.type!==o.AuthLinkType.SIGNER||q.type===o.AuthLinkType.SIGNER&&M!==0)return!1;return!0}N.isValidAuthChain=V;function de(H){return(0,s.hexToBytes)((0,s.sha3)((0,s.stringToUtf8Bytes)(H)))}N.createEIP1271MessageHash=de;function ve(H,M,q){return[{type:o.AuthLinkType.SIGNER,payload:M,signature:""},{type:A(q),payload:H,signature:q}]}N.createSimpleAuthChain=ve;function j(H,M,q,$){const k=(0,c.moveMinutes)(q),G=N.getEphemeralMessage(M.address,k),pe=N.createSignature(H,G),Q=N.createSignature(M,$);return[{type:o.AuthLinkType.SIGNER,payload:H.address,signature:""},{type:o.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL,payload:G,signature:pe},{type:o.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY,payload:$,signature:Q}]}N.createAuthChain=j;async function L(H,M,q,$){const k=new Date;k.setMinutes(k.getMinutes()+q);const G=N.getEphemeralMessage(M.address,k),pe=await $(G),Q=[{type:o.AuthLinkType.SIGNER,payload:H,signature:""},{type:S(pe),payload:G,signature:pe}];return{ephemeralIdentity:M,expiration:k,authChain:Q}}N.initializeAuthChain=L;function Y(H,M){const q=N.createSignature(H.ephemeralIdentity,M);return[...H.authChain,{type:o.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY,payload:M,signature:q}]}N.signPayload=Y,N.createEthereumMessageHash=f.createEthereumMessageHash;function ne(H,M){return(0,f.ethSign)((0,s.hexToBytes)(H.privateKey),M)}N.createSignature=ne;function U(H){return H.length>0&&H[0].type===o.AuthLinkType.SIGNER?H[0].payload:"Invalid-Owner-Address"}N.ownerAddress=U;function F(H,M){return`Decentraland Login
175
- Ephemeral address: ${H}
176
- Expiration: ${M.toISOString()}`}N.getEphemeralMessage=F})(m=t.Authenticator||(t.Authenticator={}));const y=async(N,B)=>({nextAuthority:B.payload});t.SIGNER_VALIDATOR=y;const w=async(N,B)=>{if(!B.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_SIGNED_ENTITY_VALIDATOR'");const V=(0,f.recoverAddressFromEthSignature)(B.signature,B.payload),de=N.toLocaleLowerCase(),ve=V.toLocaleLowerCase();if(de===ve)return{nextAuthority:B.payload};throw new Error(`Invalid signer address. Expected: ${de}. Actual: ${ve}`)};t.ECDSA_SIGNED_ENTITY_VALIDATOR=w;const v=async(N,B,V)=>{if(!B.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_PERSONAL_EPHEMERAL_VALIDATOR'");const{message:de,ephemeralAddress:ve,expiration:j}=O(B.payload),L=V.dateToValidateExpirationInMillis?V.dateToValidateExpirationInMillis:Date.now();if(j>L){const Y=(0,f.recoverAddressFromEthSignature)(B.signature,de),ne=N.toLocaleLowerCase(),U=Y.toLocaleLowerCase();if(ne===U)return{nextAuthority:ve};throw new Error(`Invalid signer address. Expected: ${ne}. Actual: ${U}`)}throw new Error(`Ephemeral key expired. Expiration: ${j}. Test: ${L}`)};t.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR=v;const g=async(N,B,V)=>{if(!B.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'ECDSA_EIP_1654_EPHEMERAL_VALIDATOR'");const{message:de,ephemeralAddress:ve,expiration:j}=O(B.payload),L=V!=null&&V.dateToValidateExpirationInMillis?V==null?void 0:V.dateToValidateExpirationInMillis:Date.now();if(j>L&&await p(V.provider,N,de,B.signature,L))return{nextAuthority:ve};throw new Error(`Ephemeral key expired. Expiration: ${j}. Test: ${L}`)};t.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR=g;const _=async(N,B,V)=>{if(!B.signature)throw new Error("Invalid AuthLink. 'signature' must be present for type 'EIP_1654_SIGNED_ENTITY_VALIDATOR'");if(await p(V.provider,N,B.payload,B.signature,V.dateToValidateExpirationInMillis))return{nextAuthority:B.payload};throw new Error("Invalid validation")};t.EIP_1654_SIGNED_ENTITY_VALIDATOR=_;const b=async(N,B)=>({error:"Error Validator."});function S(N){return N.length===h?o.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:o.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL}t.getEphemeralSignatureType=S;function A(N){return N.length===h?o.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:o.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY}t.getSignedIdentitySignatureType=A;function O(N){const B=N.replace(/\r/g,""),V=B.split(`
177
- `),de=V[1].substring(19),ve=V[2].substring(12),j=Date.parse(ve);return{message:B,ephemeralAddress:de,expiration:j}}t.parseEmphemeralPayload=O;async function E(N,B,V,de){const ve=m.createEIP1271MessageHash(B),j=(0,s.hexToBytes)(V);let L;try{L=(0,s.bytesToHex)(await N.isValidSignature(ve,j,de))}catch{}if(L===t.ERC1654_MAGIC_VALUE)return!0;const Y=(0,f.createEthereumMessageHash)(B);try{L=(0,s.bytesToHex)(await N.isValidSignature(Y,j,de))}catch{}return L===t.ERC1654_MAGIC_VALUE}t.isValidEIP1271Signature=E;async function p(N,B,V,de,ve){if(!N)throw new Error("Missing provider");const j=new s.default(N),L=await(0,a.SignatureValidator)(j,B);let Y=await E(L,V,de);if(Y)return!0;const ne=new u.default(j);try{const{block:U}=await ne.getDate(ve,!1);if(Y=await E(L,V,de,U),Y)return!0}catch(U){throw new Error(`Invalid validation. Error: ${U.message}`)}throw new Error(`Invalid validation. Expected: ${t.ERC1654_MAGIC_VALUE}. Actual: ${Y}`)}function I(N){switch(N){case o.AuthLinkType.SIGNER:return t.SIGNER_VALIDATOR;case o.AuthLinkType.ECDSA_PERSONAL_EPHEMERAL:return t.ECDSA_PERSONAL_EPHEMERAL_VALIDATOR;case o.AuthLinkType.ECDSA_PERSONAL_SIGNED_ENTITY:return t.ECDSA_SIGNED_ENTITY_VALIDATOR;case o.AuthLinkType.ECDSA_EIP_1654_EPHEMERAL:return t.ECDSA_EIP_1654_EPHEMERAL_VALIDATOR;case o.AuthLinkType.ECDSA_EIP_1654_SIGNED_ENTITY:return t.EIP_1654_SIGNED_ENTITY_VALIDATOR;default:return b}}})(ire);(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(ire,t),r(aM,t)})(nre);var Z6={},Xc={},e8={exports:{}},t8={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function r(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(a){return typeof a}:r=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r(i)}function n(i){var s=typeof i=="string"||i instanceof String;if(!s){var a=r(i);throw i===null?a="null":a==="object"&&(a=i.constructor.name),new TypeError("Expected a string but received a ".concat(a))}}t.exports=e.default,t.exports.default=e.default})(t8,t8.exports);var dM=t8.exports,r8={exports:{}},n8={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var s in i)typeof n[s]>"u"&&(n[s]=i[s]);return n}t.exports=e.default,t.exports.default=e.default})(n8,n8.exports);var yre=n8.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var r=i(dM),n=i(yre);function i(o){return o&&o.__esModule?o:{default:o}}var s={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function a(o,c){(0,r.default)(o),c=(0,n.default)(c,s),c.allow_trailing_dot&&o[o.length-1]==="."&&(o=o.substring(0,o.length-1)),c.allow_wildcard===!0&&o.indexOf("*.")===0&&(o=o.substring(2));var u=o.split("."),f=u[u.length-1];return c.require_tld&&(u.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(f)||/\s/.test(f))||!c.allow_numeric_tld&&/^\d+$/.test(f)?!1:u.every(function(h){return!(h.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(h)||/[\uff01-\uff5e]/.test(h)||/^-|-$/.test(h)||!c.allow_underscores&&/_/.test(h))})}t.exports=e.default,t.exports.default=e.default})(r8,r8.exports);var cDe=r8.exports,i8={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var r=n(dM);function n(f){return f&&f.__esModule?f:{default:f}}var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",s="(".concat(i,"[.]){3}").concat(i),a=new RegExp("^".concat(s,"$")),o="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(o,":){7}(?:").concat(o,"|:)|")+"(?:".concat(o,":){6}(?:").concat(s,"|:").concat(o,"|:)|")+"(?:".concat(o,":){5}(?::").concat(s,"|(:").concat(o,"){1,2}|:)|")+"(?:".concat(o,":){4}(?:(:").concat(o,"){0,1}:").concat(s,"|(:").concat(o,"){1,3}|:)|")+"(?:".concat(o,":){3}(?:(:").concat(o,"){0,2}:").concat(s,"|(:").concat(o,"){1,4}|:)|")+"(?:".concat(o,":){2}(?:(:").concat(o,"){0,3}:").concat(s,"|(:").concat(o,"){1,5}|:)|")+"(?:".concat(o,":){1}(?:(:").concat(o,"){0,4}:").concat(s,"|(:").concat(o,"){1,6}|:)|")+"(?::((?::".concat(o,"){0,5}:").concat(s,"|(?::").concat(o,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function u(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,r.default)(f),h=String(h),h?h==="4"?a.test(f):h==="6"?c.test(f):!1:u(f,4)||u(f,6)}t.exports=e.default,t.exports.default=e.default})(i8,i8.exports);var uDe=i8.exports;(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=_;var r=a(dM),n=a(cDe),i=a(uDe),s=a(yre);function a(b){return b&&b.__esModule?b:{default:b}}function o(b,S){return m(b)||h(b,S)||u(b,S)||c()}function c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
178
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(b,S){if(b){if(typeof b=="string")return f(b,S);var A=Object.prototype.toString.call(b).slice(8,-1);if(A==="Object"&&b.constructor&&(A=b.constructor.name),A==="Map"||A==="Set")return Array.from(b);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return f(b,S)}}function f(b,S){(S==null||S>b.length)&&(S=b.length);for(var A=0,O=new Array(S);A<S;A++)O[A]=b[A];return O}function h(b,S){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(b)))){var A=[],O=!0,E=!1,p=void 0;try{for(var I=b[Symbol.iterator](),N;!(O=(N=I.next()).done)&&(A.push(N.value),!(S&&A.length===S));O=!0);}catch(B){E=!0,p=B}finally{try{!O&&I.return!=null&&I.return()}finally{if(E)throw p}}return A}}function m(b){if(Array.isArray(b))return b}var y={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},w=/^\[([^\]]+)\](?::([0-9]+))?$/;function v(b){return Object.prototype.toString.call(b)==="[object RegExp]"}function g(b,S){for(var A=0;A<S.length;A++){var O=S[A];if(b===O||v(O)&&O.test(b))return!0}return!1}function _(b,S){if((0,r.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(S=(0,s.default)(S,y),S.validate_length&&b.length>=2083)||!S.allow_fragments&&b.includes("#")||!S.allow_query_components&&(b.includes("?")||b.includes("&")))return!1;var A,O,E,p,I,N,B,V;if(B=b.split("#"),b=B.shift(),B=b.split("?"),b=B.shift(),B=b.split("://"),B.length>1){if(A=B.shift().toLowerCase(),S.require_valid_protocol&&S.protocols.indexOf(A)===-1)return!1}else{if(S.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!S.allow_protocol_relative_urls)return!1;B[0]=b.slice(2)}}if(b=B.join("://"),b==="")return!1;if(B=b.split("/"),b=B.shift(),b===""&&!S.require_host)return!0;if(B=b.split("@"),B.length>1){if(S.disallow_auth||B[0]===""||(O=B.shift(),O.indexOf(":")>=0&&O.split(":").length>2))return!1;var de=O.split(":"),ve=o(de,2),j=ve[0],L=ve[1];if(j===""&&L==="")return!1}p=B.join("@"),N=null,V=null;var Y=p.match(w);if(Y?(E="",V=Y[1],N=Y[2]||null):(B=p.split(":"),E=B.shift(),B.length&&(N=B.join(":"))),N!==null&&N.length>0){if(I=parseInt(N,10),!/^[0-9]+$/.test(N)||I<=0||I>65535)return!1}else if(S.require_port)return!1;return S.host_whitelist?g(E,S.host_whitelist):E===""&&!S.require_host?!0:!(!(0,i.default)(E)&&!(0,n.default)(E,S)&&(!V||!(0,i.default)(V,6))||(E=E||V,S.host_blacklist&&g(E,S.host_blacklist)))}t.exports=e.default,t.exports.default=e.default})(e8,e8.exports);var lDe=e8.exports,hM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.localStorageClearIdentity=t.localStorageStoreIdentity=t.localStorageGetIdentity=t.createMessage=t.SINGLE_SIGN_ON_TARGET=t.Action=void 0;var e;(function(o){o.GET="get",o.STORE="store",o.CLEAR="clear",o.PING="ping"})(e||(t.Action=e={})),t.SINGLE_SIGN_ON_TARGET="single-sign-on";function r(o){return{target:t.SINGLE_SIGN_ON_TARGET,...o}}t.createMessage=r;function n(o){const c=localStorage.getItem(a(o));if(!c)return null;let u;try{u=JSON.parse(c)}catch{return s(o),null}return u.expiration=new Date(u.expiration),u.expiration.getTime()<=Date.now()?(s(o),null):u}t.localStorageGetIdentity=n;function i(o,c){new Date(c.expiration).getTime()>Date.now()&&localStorage.setItem(a(o),JSON.stringify(c))}t.localStorageStoreIdentity=i;function s(o){localStorage.removeItem(a(o))}t.localStorageClearIdentity=s;function a(o){if(!/^0x[a-fA-F0-9]{40}$/.test(o))throw new Error("User must be a valid ethereum address");return`single-sign-on-${o.toLowerCase()}`}})(hM);Object.defineProperty(Xc,"__esModule",{value:!0});Xc.clearIdentity=Xc.storeIdentity=Xc.getIdentity=Xc.init=void 0;const fDe=lDe,ou=hM,vre=ou.SINGLE_SIGN_ON_TARGET,TV=500,dDe=5;let CV=0,Ix="";const hDe={protocols:["https"],require_protocol:!0};function pDe(t,e={}){if(!(0,fDe.default)(t,{...hDe,...e}))throw new Error(`Invalid url: ${t}`);if(Ix)throw new Error("Already initialized");const r=document.createElement("iframe");r.id=vre,r.src=t,r.style.width="0",r.style.height="0",r.style.border="none",r.style.position="absolute",document.body.appendChild(r),Ix=t}Xc.init=pDe;async function gDe(t){let e;try{e=(await FA(await pM(),ou.Action.GET,{user:t})).identity??null}catch(r){gM(r),e=(0,ou.localStorageGetIdentity)(t)}return e}Xc.getIdentity=gDe;async function mDe(t,e){try{await FA(await pM(),ou.Action.STORE,{user:t,identity:e})}catch(r){gM(r),(0,ou.localStorageStoreIdentity)(t,e)}}Xc.storeIdentity=mDe;async function yDe(t){try{await FA(await pM(),ou.Action.CLEAR,{user:t})}catch(e){gM(e),(0,ou.localStorageClearIdentity)(t)}}Xc.clearIdentity=yDe;async function pM(){if(!Ix)throw new Error("Not initialized");for(let t=0;t<dDe;t++){const e=document.getElementById(vre),r=e==null?void 0:e.contentWindow;if(!r){await vDe(TV);continue}try{await FA(r,ou.Action.PING,{},TV)}catch{continue}return r}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function FA(t,e,r,n=0){CV++;const i=CV;let s=null;const a=new Promise((o,c)=>{s=({data:u})=>{!u||u.target!==ou.SINGLE_SIGN_ON_TARGET||u.id!==i||(u.error?c(new Error(u.error)):o(u))},window.addEventListener("message",s)});t.postMessage((0,ou.createMessage)({id:i,action:e,...r}),Ix);try{return await(n?Promise.race([a,new Promise((o,c)=>setTimeout(()=>c(new Error("Did not receive a response in time")),n))]):a)}catch(o){throw o}finally{s&&window.removeEventListener("message",s)}}function vDe(t){return new Promise(e=>setTimeout(e,t))}function gM(t){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",t.message)}(function(t){var e=$e&&$e.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=$e&&$e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Xc,t),r(hM,t)})(Z6);var bre={exports:{}};/*!
179
- Copyright (c) 2018 Jed Watson.
180
- Licensed under the MIT License (MIT), see
181
- http://jedwatson.github.io/classnames
182
- */(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i<arguments.length;i++){var s=arguments[i];if(s){var a=typeof s;if(a==="string"||a==="number")n.push(s);else if(Array.isArray(s)){if(s.length){var o=r.apply(null,s);o&&n.push(o)}}else if(a==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){n.push(s.toString());continue}for(var c in s)e.call(s,c)&&s[c]&&n.push(c)}}}return n.join(" ")}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(bre);var bDe=bre.exports;const Hg=_c(bDe);var wDe=B2();const _De=_c(wDe),EDe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7359128689.commit-62bca57/assets/logo-9a364aec.svg";var Qy={},jC,RV;function xDe(){if(RV)return jC;RV=1;var t=Ac(),e=U2();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return jC=r,jC}var wre=Ve.createContext(),_re=Ve.createContext();function ADe(t){var e=t.children,r=Ve.useState(null),n=r[0],i=r[1],s=Ve.useRef(!1);Ve.useEffect(function(){return function(){s.current=!0}},[]);var a=Ve.useCallback(function(o){s.current||i(o)},[]);return Ve.createElement(wre.Provider,{value:n},Ve.createElement(_re.Provider,{value:a},e))}var Ere=function(e){return Array.isArray(e)?e[0]:e},xre=function(e){if(typeof e=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e.apply(void 0,n)}},s8=function(e,r){if(typeof e=="function")return xre(e,r);e!=null&&(e.current=r)},NV=function(e){return e.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},DV=typeof window<"u"&&window.document&&window.document.createElement?Ve.useLayoutEffect:Ve.useEffect,Aa="top",ko="bottom",$o="right",Sa="left",mM="auto",z1=[Aa,ko,$o,Sa],zg="start",Nb="end",SDe="clippingParents",Are="viewport",Jy="popper",ODe="reference",MV=z1.reduce(function(t,e){return t.concat([e+"-"+zg,e+"-"+Nb])},[]),Sre=[].concat(z1,[mM]).reduce(function(t,e){return t.concat([e,e+"-"+zg,e+"-"+Nb])},[]),IDe="beforeRead",PDe="read",TDe="afterRead",CDe="beforeMain",RDe="main",NDe="afterMain",DDe="beforeWrite",MDe="write",kDe="afterWrite",$De=[IDe,PDe,TDe,CDe,RDe,NDe,DDe,MDe,kDe];function cu(t){return t?(t.nodeName||"").toLowerCase():null}function za(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function jh(t){var e=za(t).Element;return t instanceof e||t instanceof Element}function Co(t){var e=za(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function yM(t){if(typeof ShadowRoot>"u")return!1;var e=za(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function LDe(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},s=e.elements[r];!Co(s)||!cu(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(a){var o=i[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function UDe(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],s=e.attributes[n]||{},a=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),o=a.reduce(function(c,u){return c[u]="",c},{});!Co(i)||!cu(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(c){i.removeAttribute(c)}))})}}const jDe={name:"applyStyles",enabled:!0,phase:"write",fn:LDe,effect:UDe,requires:["computeStyles"]};function nu(t){return t.split("-")[0]}var Oh=Math.max,Px=Math.min,Vg=Math.round;function a8(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ore(){return!/^((?!chrome|android).)*safari/i.test(a8())}function Gg(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,s=1;e&&Co(t)&&(i=t.offsetWidth>0&&Vg(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Vg(n.height)/t.offsetHeight||1);var a=jh(t)?za(t):window,o=a.visualViewport,c=!Ore()&&r,u=(n.left+(c&&o?o.offsetLeft:0))/i,f=(n.top+(c&&o?o.offsetTop:0))/s,h=n.width/i,m=n.height/s;return{width:h,height:m,top:f,right:u+h,bottom:f+m,left:u,x:u,y:f}}function vM(t){var e=Gg(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Ire(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&yM(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function yl(t){return za(t).getComputedStyle(t)}function BDe(t){return["table","td","th"].indexOf(cu(t))>=0}function sd(t){return((jh(t)?t.ownerDocument:t.document)||window.document).documentElement}function qA(t){return cu(t)==="html"?t:t.assignedSlot||t.parentNode||(yM(t)?t.host:null)||sd(t)}function kV(t){return!Co(t)||yl(t).position==="fixed"?null:t.offsetParent}function FDe(t){var e=/firefox/i.test(a8()),r=/Trident/i.test(a8());if(r&&Co(t)){var n=yl(t);if(n.position==="fixed")return null}var i=qA(t);for(yM(i)&&(i=i.host);Co(i)&&["html","body"].indexOf(cu(i))<0;){var s=yl(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function V1(t){for(var e=za(t),r=kV(t);r&&BDe(r)&&yl(r).position==="static";)r=kV(r);return r&&(cu(r)==="html"||cu(r)==="body"&&yl(r).position==="static")?e:r||FDe(t)||e}function bM(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function zv(t,e,r){return Oh(t,Px(e,r))}function qDe(t,e,r){var n=zv(t,e,r);return n>r?r:n}function Pre(){return{top:0,right:0,bottom:0,left:0}}function Tre(t){return Object.assign({},Pre(),t)}function Cre(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var HDe=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Tre(typeof e!="number"?e:Cre(e,z1))};function zDe(t){var e,r=t.state,n=t.name,i=t.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=nu(r.placement),c=bM(o),u=[Sa,$o].indexOf(o)>=0,f=u?"height":"width";if(!(!s||!a)){var h=HDe(i.padding,r),m=vM(s),y=c==="y"?Aa:Sa,w=c==="y"?ko:$o,v=r.rects.reference[f]+r.rects.reference[c]-a[c]-r.rects.popper[f],g=a[c]-r.rects.reference[c],_=V1(s),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-g/2,A=h[y],O=b-m[f]-h[w],E=b/2-m[f]/2+S,p=zv(A,E,O),I=c;r.modifiersData[n]=(e={},e[I]=p,e.centerOffset=p-E,e)}}function VDe(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Ire(e.elements.popper,i)&&(e.elements.arrow=i))}const GDe={name:"arrow",enabled:!0,phase:"main",fn:zDe,effect:VDe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Kg(t){return t.split("-")[1]}var KDe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function WDe(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:Vg(r*i)/i||0,y:Vg(n*i)/i||0}}function $V(t){var e,r=t.popper,n=t.popperRect,i=t.placement,s=t.variation,a=t.offsets,o=t.position,c=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=a.x,y=m===void 0?0:m,w=a.y,v=w===void 0?0:w,g=typeof f=="function"?f({x:y,y:v}):{x:y,y:v};y=g.x,v=g.y;var _=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),S=Sa,A=Aa,O=window;if(u){var E=V1(r),p="clientHeight",I="clientWidth";if(E===za(r)&&(E=sd(r),yl(E).position!=="static"&&o==="absolute"&&(p="scrollHeight",I="scrollWidth")),E=E,i===Aa||(i===Sa||i===$o)&&s===Nb){A=ko;var N=h&&E===O&&O.visualViewport?O.visualViewport.height:E[p];v-=N-n.height,v*=c?1:-1}if(i===Sa||(i===Aa||i===ko)&&s===Nb){S=$o;var B=h&&E===O&&O.visualViewport?O.visualViewport.width:E[I];y-=B-n.width,y*=c?1:-1}}var V=Object.assign({position:o},u&&KDe),de=f===!0?WDe({x:y,y:v},za(r)):{x:y,y:v};if(y=de.x,v=de.y,c){var ve;return Object.assign({},V,(ve={},ve[A]=b?"0":"",ve[S]=_?"0":"",ve.transform=(O.devicePixelRatio||1)<=1?"translate("+y+"px, "+v+"px)":"translate3d("+y+"px, "+v+"px, 0)",ve))}return Object.assign({},V,(e={},e[A]=b?v+"px":"",e[S]=_?y+"px":"",e.transform="",e))}function YDe(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,s=r.adaptive,a=s===void 0?!0:s,o=r.roundOffsets,c=o===void 0?!0:o,u={placement:nu(e.placement),variation:Kg(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$V(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$V(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const QDe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:YDe,data:{}};var I_={passive:!0};function JDe(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,s=i===void 0?!0:i,a=n.resize,o=a===void 0?!0:a,c=za(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&u.forEach(function(f){f.addEventListener("scroll",r.update,I_)}),o&&c.addEventListener("resize",r.update,I_),function(){s&&u.forEach(function(f){f.removeEventListener("scroll",r.update,I_)}),o&&c.removeEventListener("resize",r.update,I_)}}const XDe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JDe,data:{}};var ZDe={left:"right",right:"left",bottom:"top",top:"bottom"};function yE(t){return t.replace(/left|right|bottom|top/g,function(e){return ZDe[e]})}var eMe={start:"end",end:"start"};function LV(t){return t.replace(/start|end/g,function(e){return eMe[e]})}function wM(t){var e=za(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function _M(t){return Gg(sd(t)).left+wM(t).scrollLeft}function tMe(t,e){var r=za(t),n=sd(t),i=r.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,c=0;if(i){s=i.width,a=i.height;var u=Ore();(u||!u&&e==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:s,height:a,x:o+_M(t),y:c}}function rMe(t){var e,r=sd(t),n=wM(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=Oh(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Oh(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-n.scrollLeft+_M(t),c=-n.scrollTop;return yl(i||r).direction==="rtl"&&(o+=Oh(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:o,y:c}}function EM(t){var e=yl(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Rre(t){return["html","body","#document"].indexOf(cu(t))>=0?t.ownerDocument.body:Co(t)&&EM(t)?t:Rre(qA(t))}function Vv(t,e){var r;e===void 0&&(e=[]);var n=Rre(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),s=za(n),a=i?[s].concat(s.visualViewport||[],EM(n)?n:[]):n,o=e.concat(a);return i?o:o.concat(Vv(qA(a)))}function o8(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function nMe(t,e){var r=Gg(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function UV(t,e,r){return e===Are?o8(tMe(t,r)):jh(e)?nMe(e,r):o8(rMe(sd(t)))}function iMe(t){var e=Vv(qA(t)),r=["absolute","fixed"].indexOf(yl(t).position)>=0,n=r&&Co(t)?V1(t):t;return jh(n)?e.filter(function(i){return jh(i)&&Ire(i,n)&&cu(i)!=="body"}):[]}function sMe(t,e,r,n){var i=e==="clippingParents"?iMe(t):[].concat(e),s=[].concat(i,[r]),a=s[0],o=s.reduce(function(c,u){var f=UV(t,u,n);return c.top=Oh(f.top,c.top),c.right=Px(f.right,c.right),c.bottom=Px(f.bottom,c.bottom),c.left=Oh(f.left,c.left),c},UV(t,a,n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Nre(t){var e=t.reference,r=t.element,n=t.placement,i=n?nu(n):null,s=n?Kg(n):null,a=e.x+e.width/2-r.width/2,o=e.y+e.height/2-r.height/2,c;switch(i){case Aa:c={x:a,y:e.y-r.height};break;case ko:c={x:a,y:e.y+e.height};break;case $o:c={x:e.x+e.width,y:o};break;case Sa:c={x:e.x-r.width,y:o};break;default:c={x:e.x,y:e.y}}var u=i?bM(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(s){case zg:c[u]=c[u]-(e[f]/2-r[f]/2);break;case Nb:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function Db(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,s=r.strategy,a=s===void 0?t.strategy:s,o=r.boundary,c=o===void 0?SDe:o,u=r.rootBoundary,f=u===void 0?Are:u,h=r.elementContext,m=h===void 0?Jy:h,y=r.altBoundary,w=y===void 0?!1:y,v=r.padding,g=v===void 0?0:v,_=Tre(typeof g!="number"?g:Cre(g,z1)),b=m===Jy?ODe:Jy,S=t.rects.popper,A=t.elements[w?b:m],O=sMe(jh(A)?A:A.contextElement||sd(t.elements.popper),c,f,a),E=Gg(t.elements.reference),p=Nre({reference:E,element:S,strategy:"absolute",placement:i}),I=o8(Object.assign({},S,p)),N=m===Jy?I:E,B={top:O.top-N.top+_.top,bottom:N.bottom-O.bottom+_.bottom,left:O.left-N.left+_.left,right:N.right-O.right+_.right},V=t.modifiersData.offset;if(m===Jy&&V){var de=V[i];Object.keys(B).forEach(function(ve){var j=[$o,ko].indexOf(ve)>=0?1:-1,L=[Aa,ko].indexOf(ve)>=0?"y":"x";B[ve]+=de[L]*j})}return B}function aMe(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,s=r.rootBoundary,a=r.padding,o=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?Sre:c,f=Kg(n),h=f?o?MV:MV.filter(function(w){return Kg(w)===f}):z1,m=h.filter(function(w){return u.indexOf(w)>=0});m.length===0&&(m=h);var y=m.reduce(function(w,v){return w[v]=Db(t,{placement:v,boundary:i,rootBoundary:s,padding:a})[nu(v)],w},{});return Object.keys(y).sort(function(w,v){return y[w]-y[v]})}function oMe(t){if(nu(t)===mM)return[];var e=yE(t);return[LV(t),e,LV(e)]}function cMe(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!0:a,c=r.fallbackPlacements,u=r.padding,f=r.boundary,h=r.rootBoundary,m=r.altBoundary,y=r.flipVariations,w=y===void 0?!0:y,v=r.allowedAutoPlacements,g=e.options.placement,_=nu(g),b=_===g,S=c||(b||!w?[yE(g)]:oMe(g)),A=[g].concat(S).reduce(function(k,G){return k.concat(nu(G)===mM?aMe(e,{placement:G,boundary:f,rootBoundary:h,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),O=e.rects.reference,E=e.rects.popper,p=new Map,I=!0,N=A[0],B=0;B<A.length;B++){var V=A[B],de=nu(V),ve=Kg(V)===zg,j=[Aa,ko].indexOf(de)>=0,L=j?"width":"height",Y=Db(e,{placement:V,boundary:f,rootBoundary:h,altBoundary:m,padding:u}),ne=j?ve?$o:Sa:ve?ko:Aa;O[L]>E[L]&&(ne=yE(ne));var U=yE(ne),F=[];if(s&&F.push(Y[de]<=0),o&&F.push(Y[ne]<=0,Y[U]<=0),F.every(function(k){return k})){N=V,I=!1;break}p.set(V,F)}if(I)for(var H=w?3:1,M=function(G){var pe=A.find(function(Q){var te=p.get(Q);if(te)return te.slice(0,G).every(function(ce){return ce})});if(pe)return N=pe,"break"},q=H;q>0;q--){var $=M(q);if($==="break")break}e.placement!==N&&(e.modifiersData[n]._skip=!0,e.placement=N,e.reset=!0)}}const uMe={name:"flip",enabled:!0,phase:"main",fn:cMe,requiresIfExists:["offset"],data:{_skip:!1}};function jV(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function BV(t){return[Aa,$o,ko,Sa].some(function(e){return t[e]>=0})}function lMe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,a=Db(e,{elementContext:"reference"}),o=Db(e,{altBoundary:!0}),c=jV(a,n),u=jV(o,i,s),f=BV(c),h=BV(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}const fMe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:lMe};function dMe(t,e,r){var n=nu(t),i=[Sa,Aa].indexOf(n)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,a=s[0],o=s[1];return a=a||0,o=(o||0)*i,[Sa,$o].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function hMe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,s=i===void 0?[0,0]:i,a=Sre.reduce(function(f,h){return f[h]=dMe(h,e.rects,s),f},{}),o=a[e.placement],c=o.x,u=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=a}const pMe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:hMe};function gMe(t){var e=t.state,r=t.name;e.modifiersData[r]=Nre({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const mMe={name:"popperOffsets",enabled:!0,phase:"read",fn:gMe,data:{}};function yMe(t){return t==="x"?"y":"x"}function vMe(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!1:a,c=r.boundary,u=r.rootBoundary,f=r.altBoundary,h=r.padding,m=r.tether,y=m===void 0?!0:m,w=r.tetherOffset,v=w===void 0?0:w,g=Db(e,{boundary:c,rootBoundary:u,padding:h,altBoundary:f}),_=nu(e.placement),b=Kg(e.placement),S=!b,A=bM(_),O=yMe(A),E=e.modifiersData.popperOffsets,p=e.rects.reference,I=e.rects.popper,N=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,B=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,de={x:0,y:0};if(E){if(s){var ve,j=A==="y"?Aa:Sa,L=A==="y"?ko:$o,Y=A==="y"?"height":"width",ne=E[A],U=ne+g[j],F=ne-g[L],H=y?-I[Y]/2:0,M=b===zg?p[Y]:I[Y],q=b===zg?-I[Y]:-p[Y],$=e.elements.arrow,k=y&&$?vM($):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Pre(),pe=G[j],Q=G[L],te=zv(0,p[Y],k[Y]),ce=S?p[Y]/2-H-te-pe-B.mainAxis:M-te-pe-B.mainAxis,T=S?-p[Y]/2+H+te+Q+B.mainAxis:q+te+Q+B.mainAxis,le=e.elements.arrow&&V1(e.elements.arrow),Ge=le?A==="y"?le.clientTop||0:le.clientLeft||0:0,tt=(ve=V==null?void 0:V[A])!=null?ve:0,yt=ne+ce-tt-Ge,vt=ne+T-tt,gt=zv(y?Px(U,yt):U,ne,y?Oh(F,vt):F);E[A]=gt,de[A]=gt-ne}if(o){var Bt,Zt=A==="x"?Aa:Sa,Or=A==="x"?ko:$o,Ct=E[O],Pt=O==="y"?"height":"width",$t=Ct+g[Zt],Rt=Ct-g[Or],Wt=[Aa,Sa].indexOf(_)!==-1,Ft=(Bt=V==null?void 0:V[O])!=null?Bt:0,Kt=Wt?$t:Ct-p[Pt]-I[Pt]-Ft+B.altAxis,Dt=Wt?Ct+p[Pt]+I[Pt]-Ft-B.altAxis:Rt,Nt=y&&Wt?qDe(Kt,Ct,Dt):zv(y?Kt:$t,Ct,y?Dt:Rt);E[O]=Nt,de[O]=Nt-Ct}e.modifiersData[n]=de}}const bMe={name:"preventOverflow",enabled:!0,phase:"main",fn:vMe,requiresIfExists:["offset"]};function wMe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _Me(t){return t===za(t)||!Co(t)?wM(t):wMe(t)}function EMe(t){var e=t.getBoundingClientRect(),r=Vg(e.width)/t.offsetWidth||1,n=Vg(e.height)/t.offsetHeight||1;return r!==1||n!==1}function xMe(t,e,r){r===void 0&&(r=!1);var n=Co(e),i=Co(e)&&EMe(e),s=sd(e),a=Gg(t,i,r),o={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((cu(e)!=="body"||EM(s))&&(o=_Me(e)),Co(e)?(c=Gg(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=_M(s))),{x:a.left+o.scrollLeft-c.x,y:a.top+o.scrollTop-c.y,width:a.width,height:a.height}}function AMe(t){var e=new Map,r=new Set,n=[];t.forEach(function(s){e.set(s.name,s)});function i(s){r.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var c=e.get(o);c&&i(c)}}),n.push(s)}return t.forEach(function(s){r.has(s.name)||i(s)}),n}function SMe(t){var e=AMe(t);return $De.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function OMe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function IMe(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var FV={placement:"bottom",modifiers:[],strategy:"absolute"};function qV(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function PMe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,s=i===void 0?FV:i;return function(o,c,u){u===void 0&&(u=s);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},FV,s),modifiersData:{},elements:{reference:o,popper:c},attributes:{},styles:{}},h=[],m=!1,y={state:f,setOptions:function(_){var b=typeof _=="function"?_(f.options):_;v(),f.options=Object.assign({},s,f.options,b),f.scrollParents={reference:jh(o)?Vv(o):o.contextElement?Vv(o.contextElement):[],popper:Vv(c)};var S=SMe(IMe([].concat(n,f.options.modifiers)));return f.orderedModifiers=S.filter(function(A){return A.enabled}),w(),y.update()},forceUpdate:function(){if(!m){var _=f.elements,b=_.reference,S=_.popper;if(qV(b,S)){f.rects={reference:xMe(b,V1(S),f.options.strategy==="fixed"),popper:vM(S)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(B){return f.modifiersData[B.name]=Object.assign({},B.data)});for(var A=0;A<f.orderedModifiers.length;A++){if(f.reset===!0){f.reset=!1,A=-1;continue}var O=f.orderedModifiers[A],E=O.fn,p=O.options,I=p===void 0?{}:p,N=O.name;typeof E=="function"&&(f=E({state:f,options:I,name:N,instance:y})||f)}}}},update:OMe(function(){return new Promise(function(g){y.forceUpdate(),g(f)})}),destroy:function(){v(),m=!0}};if(!qV(o,c))return y;y.setOptions(u).then(function(g){!m&&u.onFirstUpdate&&u.onFirstUpdate(g)});function w(){f.orderedModifiers.forEach(function(g){var _=g.name,b=g.options,S=b===void 0?{}:b,A=g.effect;if(typeof A=="function"){var O=A({state:f,name:_,instance:y,options:S}),E=function(){};h.push(O||E)}})}function v(){h.forEach(function(g){return g()}),h=[]}return y}}var TMe=[XDe,mMe,QDe,jDe,pMe,uMe,bMe,GDe,fMe],CMe=PMe({defaultModifiers:TMe}),RMe=typeof Element<"u",NMe=typeof Map=="function",DMe=typeof Set=="function",MMe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function vE(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!vE(t[n],e[n]))return!1;return!0}var s;if(NMe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s=t.entries();!(n=s.next()).done;)if(!e.has(n.value[0]))return!1;for(s=t.entries();!(n=s.next()).done;)if(!vE(n.value[1],e.get(n.value[0])))return!1;return!0}if(DMe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s=t.entries();!(n=s.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(MMe&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(RMe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!vE(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var kMe=function(e,r){try{return vE(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const $Me=_c(kMe);var LMe=[],Dre=function(e,r,n){n===void 0&&(n={});var i=Ve.useRef(null),s={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||LMe},a=Ve.useState({styles:{popper:{position:s.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],c=a[1],u=Ve.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(y){var w=y.state,v=Object.keys(w.elements);cb.flushSync(function(){c({styles:NV(v.map(function(g){return[g,w.styles[g]||{}]})),attributes:NV(v.map(function(g){return[g,w.attributes[g]]}))})})},requires:["computeStyles"]}},[]),f=Ve.useMemo(function(){var m={onFirstUpdate:s.onFirstUpdate,placement:s.placement,strategy:s.strategy,modifiers:[].concat(s.modifiers,[u,{name:"applyStyles",enabled:!1}])};return $Me(i.current,m)?i.current||m:(i.current=m,m)},[s.onFirstUpdate,s.placement,s.strategy,s.modifiers,u]),h=Ve.useRef();return DV(function(){h.current&&h.current.setOptions(f)},[f]),DV(function(){if(!(e==null||r==null)){var m=n.createPopper||CMe,y=m(e,r,f);return h.current=y,function(){y.destroy(),h.current=null}}},[e,r,n.createPopper]),{state:h.current?h.current.state:null,styles:o.styles,attributes:o.attributes,update:h.current?h.current.update:null,forceUpdate:h.current?h.current.forceUpdate:null}},UMe=function(){},jMe=function(){return Promise.resolve(null)},BMe=[];function FMe(t){var e=t.placement,r=e===void 0?"bottom":e,n=t.strategy,i=n===void 0?"absolute":n,s=t.modifiers,a=s===void 0?BMe:s,o=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,h=Ve.useContext(wre),m=Ve.useState(null),y=m[0],w=m[1],v=Ve.useState(null),g=v[0],_=v[1];Ve.useEffect(function(){s8(u,y)},[u,y]);var b=Ve.useMemo(function(){return{placement:r,strategy:i,onFirstUpdate:c,modifiers:[].concat(a,[{name:"arrow",enabled:g!=null,options:{element:g}}])}},[r,i,c,a,g]),S=Dre(o||h,y,b),A=S.state,O=S.styles,E=S.forceUpdate,p=S.update,I=Ve.useMemo(function(){return{ref:w,style:O.popper,placement:A?A.placement:r,hasPopperEscaped:A&&A.modifiersData.hide?A.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:A&&A.modifiersData.hide?A.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:_},forceUpdate:E||UMe,update:p||jMe}},[w,_,r,A,O,p,E]);return Ere(f)(I)}var qMe=function(){},HMe=qMe;const zMe=_c(HMe);function VMe(t){var e=t.children,r=t.innerRef,n=Ve.useContext(_re),i=Ve.useCallback(function(s){s8(r,s),xre(n,s)},[r,n]);return Ve.useEffect(function(){return function(){return s8(r,null)}},[]),Ve.useEffect(function(){zMe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),Ere(e)({ref:i})}const GMe=Object.freeze(Object.defineProperty({__proto__:null,Manager:ADe,Popper:FMe,Reference:VMe,usePopper:Dre},Symbol.toStringTag,{value:"Module"})),KMe=Ia(GMe);var Cu={},BC,HV;function WMe(){if(HV)return BC;HV=1;var t=W5();function e(r,n,i,s){return t(r,function(a,o,c){n(s,i(a),o,c)}),s}return BC=e,BC}var FC,zV;function YMe(){if(zV)return FC;zV=1;var t=WMe();function e(r,n){return function(i,s){return t(i,r,n(s),{})}}return FC=e,FC}var qC,VV;function QMe(){if(VV)return qC;VV=1;var t=GQ(),e=YMe(),r=Yf(),n=Object.prototype,i=n.toString,s=e(function(a,o,c){o!=null&&typeof o.toString!="function"&&(o=i.call(o)),a[o]=c},t(r));return qC=s,qC}var GV;function JMe(){if(GV)return Cu;GV=1;var t=vr;Cu.__esModule=!0,Cu.placementMapping=Cu.positions=Cu.positionsMapping=void 0;var e=t(QMe()),r=t(Al()),n={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};Cu.positionsMapping=n;var i=(0,r.default)(n);Cu.positions=i;var s=(0,e.default)(n);return Cu.placementMapping=s,Cu}var Xy={},HC={exports:{}},zC={exports:{}},VC={exports:{}},KV;function XMe(){return KV||(KV=1,function(t){var e=M5.default;function r(n,i){if(e(n)!=="object"||n===null)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var a=s.call(n,i||"default");if(e(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(VC)),VC.exports}var WV;function ZMe(){return WV||(WV=1,function(t){var e=M5.default,r=XMe();function n(i){var s=r(i,"string");return e(s)==="symbol"?s:String(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(zC)),zC.exports}var YV;function eke(){return YV||(YV=1,function(t){var e=ZMe();function r(i,s){for(var a=0;a<s.length;a++){var o=s[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(i,e(o.key),o)}}function n(i,s,a){return s&&r(i.prototype,s),a&&r(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(HC)),HC.exports}var QV;function tke(){if(QV)return Xy;QV=1;var t=vr;Xy.__esModule=!0,Xy.default=void 0;var e=t(eke()),r=t(U5()),n=t(jo()),i=Qf,s=function(){function c(f){this.ref=f}var u=c.prototype;return u.getBoundingClientRect=function(){return(0,n.default)(this.ref.current,"getBoundingClientRect")||{}},(0,e.default)(c,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),c}(),a=(0,r.default)(function(c){return new s((0,i.isRefObject)(c)?c:{current:c})}),o=a;return Xy.default=o,Xy}var P_={},JV;function rke(){if(JV)return P_;JV=1;var t=vr;P_.__esModule=!0,P_.default=s;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(a){var o=a.children,c=a.className,u=a.content,f=(0,r.default)("content",c),h=(0,i.getUnhandledProps)(s,a),m=(0,i.getElementType)(s,a);return n.default.createElement(m,(0,e.default)({},h,{className:f}),i.childrenUtils.isNil(o)?u:o)}return s.handledProps=["as","children","className","content"],s.propTypes={},s.create=(0,i.createShorthandFactory)(s,function(a){return{children:a}}),P_}var T_={},XV;function nke(){if(XV)return T_;XV=1;var t=vr;T_.__esModule=!0,T_.default=s;var e=t(kn()),r=t(ti);t(Dn());var n=t(Ve),i=zn();function s(a){var o=a.children,c=a.className,u=a.content,f=(0,r.default)("header",c),h=(0,i.getUnhandledProps)(s,a),m=(0,i.getElementType)(s,a);return n.default.createElement(m,(0,e.default)({},h,{className:f}),i.childrenUtils.isNil(o)?u:o)}return s.handledProps=["as","children","className","content"],s.propTypes={},s.create=(0,i.createShorthandFactory)(s,function(a){return{children:a}}),T_}var ZV;function ike(){if(ZV)return Qy;ZV=1;var t=Uo,e=vr;Qy.__esModule=!0,Qy.default=void 0;var r=e(kn()),n=e(xc());e(a4());var i=e(xl()),s=e(V5()),a=e(jo()),o=e(xDe()),c=e(Ri()),u=e(n4()),f=e(s4()),h=e(Qte()),m=e(i4()),y=e(ti);e(Dn());var w=t(Ve),v=KMe,g=e(Jte()),_=zn(),b=e(o4()),S=JMe(),A=e(tke()),O=e(rke()),E=e(nke()),p=function(I){(0,n.default)(N,I);function N(){for(var V,de=arguments.length,ve=new Array(de),j=0;j<de;j++)ve[j]=arguments[j];return V=I.call.apply(I,[this].concat(ve))||this,V.state={},V.open=!1,V.zIndexWasSynced=!1,V.triggerRef=w.default.createRef(),V.elementRef=w.default.createRef(),V.getPortalProps=function(){var L={},Y=V.props,ne=Y.on,U=Y.hoverable,F=(0,c.default)(ne)?ne:[ne];return U&&(L.closeOnPortalMouseLeave=!0,L.mouseLeaveDelay=300),(0,f.default)(F,"hover")&&(L.openOnTriggerClick=!1,L.closeOnTriggerClick=!1,L.openOnTriggerMouseEnter=!0,L.closeOnTriggerMouseLeave=!0,L.mouseLeaveDelay=70,L.mouseEnterDelay=50),(0,f.default)(F,"click")&&(L.openOnTriggerClick=!0,L.closeOnTriggerClick=!0,L.closeOnDocumentClick=!0),(0,f.default)(F,"focus")&&(L.openOnTriggerFocus=!0,L.closeOnTriggerBlur=!0),L},V.hideOnScroll=function(L){(0,o.default)(L.target)&&V.elementRef.current.contains(L.target)||(V.setState({closed:!0}),_.eventStack.unsub("scroll",V.hideOnScroll,{target:window}),V.timeoutId=setTimeout(function(){V.setState({closed:!1})},50),V.handleClose(L))},V.handleClose=function(L){(0,a.default)(V.props,"onClose",L,(0,r.default)({},V.props,{open:!1}))},V.handleOpen=function(L){(0,a.default)(V.props,"onOpen",L,(0,r.default)({},V.props,{open:!0}))},V.handlePortalMount=function(L){(0,a.default)(V.props,"onMount",L,V.props)},V.handlePortalUnmount=function(L){V.positionUpdate=null,(0,a.default)(V.props,"onUnmount",L,V.props)},V.renderContent=function(L){var Y=L.placement,ne=L.ref,U=L.update,F=L.style,H=V.props,M=H.basic,q=H.children,$=H.className,k=H.content,G=H.hideOnScroll,pe=H.flowing,Q=H.header,te=H.inverted,ce=H.popper,T=H.size,le=H.style,Ge=H.wide,tt=V.state.contentRestProps;V.positionUpdate=U;var yt=(0,y.default)("ui",S.placementMapping[Y],T,(0,_.useKeyOrValueAndKey)(Ge,"wide"),(0,_.useKeyOnly)(M,"basic"),(0,_.useKeyOnly)(pe,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",$),vt=(0,_.getElementType)(N,V.props),gt=(0,r.default)({left:"auto",right:"auto",position:"initial"},le),Bt=w.default.createElement(vt,(0,r.default)({},tt,{className:yt,style:gt,ref:V.elementRef}),_.childrenUtils.isNil(q)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),O.default.create(k,{autoGenerateKey:!1})):q,G&&w.default.createElement(m.default,{on:V.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ce||{},{overrideProps:{children:Bt,ref:ne,style:(0,r.default)({display:"flex"},F)}})},V}N.getDerivedStateFromProps=function(de,ve){if(ve.closed||ve.disabled)return{};var j=(0,_.getUnhandledProps)(N,de),L=(0,h.default)(j,function(ne,U,F){return(0,f.default)(b.default.handledProps,F)||(ne[F]=U),ne},{}),Y=(0,u.default)(j,b.default.handledProps);return{contentRestProps:L,portalRestProps:Y}};var B=N.prototype;return B.componentDidUpdate=function(de){var ve=(0,g.default)(this.props.popperDependencies,de.popperDependencies);ve||this.handleUpdate()},B.componentWillUnmount=function(){clearTimeout(this.timeoutId)},B.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},B.render=function(){var de=this,ve=this.props,j=ve.context,L=ve.disabled,Y=ve.eventsEnabled,ne=ve.offset,U=ve.pinned,F=ve.popper,H=ve.popperModifiers,M=ve.position,q=ve.positionFixed,$=ve.trigger,k=this.state,G=k.closed,pe=k.portalRestProps;if(G||L)return $;var Q=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!Y,resize:!!Y}},{name:"flip",enabled:!U},{name:"preventOverflow",enabled:!!ne},{name:"offset",enabled:!!ne,options:{offset:ne}}].concat(H,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(le){var Ge,tt=le.state;if(!de.zIndexWasSynced){var yt=F==null||(Ge=F.style)==null?void 0:Ge.zIndex;(0,s.default)(yt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),de.zIndexWasSynced=!0}},effect:function(){return function(){de.zIndexWasSynced=!1}}}]),te=(0,A.default)((0,i.default)(j)?this.triggerRef:j),ce=(0,r.default)({},this.getPortalProps(),pe);return w.default.createElement(b.default,(0,r.default)({},ce,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:$,triggerRef:this.triggerRef}),w.default.createElement(v.Popper,{modifiers:Q,placement:S.positionsMapping[M],strategy:q?"fixed":null,referenceElement:te},this.renderContent))},N}(w.Component);return Qy.default=p,p.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],p.propTypes={},p.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},p.Content=O.default,p.Header=E.default,Qy}var ske=vr,ake=ske(ike()),oke=ake.default;const cke="_icon_1dxv5_1",GC={icon:cke,"icon-metamask-mobile":"_icon-metamask-mobile_1dxv5_9","icon-metamask":"_icon-metamask_1dxv5_9","icon-dapper":"_icon-dapper_1dxv5_14","icon-fortmatic":"_icon-fortmatic_1dxv5_18","icon-wallet-connect":"_icon-wallet-connect_1dxv5_22","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1dxv5_26","icon-coinbase":"_icon-coinbase_1dxv5_30","icon-wallet-link":"_icon-wallet-link_1dxv5_31","icon-google":"_icon-google_1dxv5_35","icon-discord":"_icon-discord_1dxv5_39","icon-apple":"_icon-apple_1dxv5_43","icon-x":"_icon-x_1dxv5_47"},Mre=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:s,tooltipPosition:a,disabled:o,loading:c,onClick:u}=t;return He.jsx(oke,{position:s&&a?a:"top center",disabled:!s,trigger:He.jsxs(So.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:e,onClick:()=>u(n),disabled:o,loading:c,children:[He.jsx("div",{role:"img","aria-label":n,className:Hg(GC.icon,GC[`icon-${n}`],GC.primaryImage)}),r]},n),content:n,on:"hover"})},uke="social-primary-test-id",lke="social-secondary-test-id",fke="web3-primary-test-id",dke="web3-secondary-test-id",hke="show-more-button-test-id",pke="_connection_ge0tp_3",gke="_dclLogo_ge0tp_9",mke="_title_ge0tp_15",yke="_subtitle_ge0tp_20",vke="_primaryButton_ge0tp_29",bke="_primaryImage_ge0tp_38",wke="_primaryMessage_ge0tp_42",_ke="_primaryMagic_ge0tp_50",Eke="_primaryLearnMore_ge0tp_61",xke="_primary_ge0tp_29",Ake="_showMore_ge0tp_76",Ske="_showMoreButton_ge0tp_80",Oke="_showMoreSecondaryOptions_ge0tp_89",Ike="_primaryOption_ge0tp_103",Pke="_secondaryOptionButton_ge0tp_107",Vs={connection:pke,dclLogo:gke,title:mke,subtitle:yke,primaryButton:vke,primaryImage:bke,primaryMessage:wke,primaryMagic:_ke,primaryLearnMore:Eke,primary:xke,showMore:Ake,showMoreButton:Ske,showMoreSecondaryOptions:Oke,primaryOption:Ike,secondaryOptionButton:Pke},eG=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:s})=>He.jsxs("div",{className:Vs.primary,"data-testid":n,children:[He.jsx("div",{className:Vs.primaryMessage,children:t}),He.jsx(Mre,{disabled:!!i,loading:i===r,type:r,onClick:s,className:Hg(Vs.primaryButton,Vs.primaryOption),testId:n,children:e})]}),tG=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>He.jsx("div",{className:Vs.showMoreSecondaryOptions,"data-testid":r,children:t.map(s=>He.jsx(Mre,{className:Hg(Vs.primaryButton,Vs.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:s,onClick:i,testId:r,loading:n===s,disabled:!!n},s))}),Tke={i18n:{title:"Unlock Your Virtual World.",subtitle:"Access and start exploring.",accessWith:t=>`Access with ${t}`,connectWith:t=>`Connect with ${t}`,moreOptions:"More Options",socialMessage:t=>He.jsxs(He.Fragment,{children:["Access secured by ",t]}),web3Message:t=>He.jsxs(He.Fragment,{children:["Curious about wallets? ",t("Learn More")]})}},Cke=t=>{const{i18n:e=Tke.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:s,className:a,loadingOption:o}=t,[c,u]=Ve.useState(!1),f=Ve.useCallback(()=>{u(!c)},[c]),h=i&&i.secondary&&i.secondary.length>0,m=s&&s.secondary&&s.secondary.length>0;return He.jsxs("div",{className:Hg(a,Vs.connection),children:[He.jsx("img",{className:Vs.dclLogo,src:EDe,alt:"Decentraland logo"}),He.jsxs("div",{children:[He.jsx("h1",{className:Vs.title,children:e.title}),He.jsx("h2",{className:Vs.subtitle,children:e.subtitle}),i?He.jsx(eG,{onConnect:r,testId:uke,option:i==null?void 0:i.primary,loadingOption:o,message:He.jsx(He.Fragment,{children:e.socialMessage(He.jsx("div",{className:Vs.primaryMagic,role:"img","aria-label":"Magic"}))}),children:He.jsx(He.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,s?He.jsx(eG,{onConnect:r,testId:fke,option:s==null?void 0:s.primary,loadingOption:o,message:e.web3Message(y=>He.jsx("span",{className:Vs.primaryLearnMore,role:"button",onClick:n,children:y})),children:He.jsx(He.Fragment,{children:e.connectWith(s==null?void 0:s.primary)})}):null]}),He.jsxs("div",{className:Vs.showMore,children:[(m||h)&&He.jsxs(So.Button,{"data-testid":hke,basic:!0,size:"medium",fluid:!0,className:Vs.showMoreButton,onClick:f,children:[e.moreOptions,He.jsx(_De,{name:c?"chevron up":"chevron down"})]}),c&&h&&He.jsx(tG,{testId:lke,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:o}),c&&m&&He.jsx(tG,{testId:dke,options:s.secondary,onConnect:r,tooltipDirection:"bottom center",loadingOption:o})]})]})};var Gn=(t=>(t.METAMASK="metamask",t.DAPPER="dapper",t.FORTMATIC="fortmatic",t.COINBASE="coinbase",t.SAMSUNG="samsung-blockchain-wallet",t.WALLET_CONNECT="wallet-connect",t.WALLET_LINK="wallet-link",t.METAMASK_MOBILE="metamask-mobile",t.GOOGLE="google",t.APPLE="apple",t.DISCORD="discord",t.X="x",t))(Gn||{});const Rke=60*24*30,Nke=iu.getConfiguration().magic.apiKey;function kre(t){switch(t){case Gn.DISCORD:case Gn.X:case Gn.GOOGLE:case Gn.APPLE:return gc.ProviderType.MAGIC;case Gn.WALLET_CONNECT:case Gn.METAMASK_MOBILE:return gc.ProviderType.WALLET_CONNECT_V2;case Gn.COINBASE:case Gn.WALLET_LINK:return gc.ProviderType.WALLET_LINK;case Gn.FORTMATIC:return gc.ProviderType.FORTMATIC;case Gn.METAMASK:case Gn.DAPPER:case Gn.SAMSUNG:return gc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function Dke(t,e){const r=new ZE(e),n=AN.createRandom(),i={address:n.address.toString(),publicKey:_t(n.publicKey),privateKey:_t(n.privateKey)},s=await r.getSigner();return nre.Authenticator.initializeAuthChain(t,i,Rke,a=>s.signMessage(a))}async function rG(t){const e=kre(t);if(gc.ProviderType.MAGIC===e){const{Magic:n}=await Eb(()=>Promise.resolve().then(()=>VD),void 0),{OAuthExtension:i}=await Eb(()=>Promise.resolve().then(()=>GD),void 0),s=new n(Nke,{extensions:[new i]}),a=new URL(window.location.href);a.pathname="/auth/callback",await s.oauth.loginWithRedirect({provider:t,redirectURI:a.href})}const r=await iu.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function Mke(t){return[Gn.APPLE,Gn.GOOGLE,Gn.X,Gn.DISCORD].includes(t)}async function $re(t,e){let r;const n=Z6.localStorageGetIdentity(t);return n?r=n:(r=await Dke(t,e),Z6.localStorageStoreIdentity(t,r)),r}const kke=iu.getConfiguration().magic.apiKey,$ke=()=>{const t=Yte(),e=h1(),[r,n]=Ve.useState(!0),i=Ve.useCallback(async()=>{var o;const a=await iu.connection.connect(ml.ProviderType.MAGIC);await $re(((o=a.account)==null?void 0:o.toLowerCase())??"",a.provider)},[]),s=Ve.useCallback(async()=>{const{Magic:a}=await Eb(()=>Promise.resolve().then(()=>VD),void 0),{OAuthExtension:o}=await Eb(()=>Promise.resolve().then(()=>GD),void 0),c=new a(kke,{extensions:[new o]});try{await(c==null?void 0:c.oauth.getRedirectResult()),n(!1),await i(),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[e]);return Ve.useEffect(()=>{s()},[]),He.jsx(rre,{open:!0,state:r?Pi.VALIDATING_SIGN_IN:Pi.WAITING_FOR_SIGNATURE,onTryAgain:i,providerType:ml.ProviderType.MAGIC})},Lke="_main_1c8le_1",Uke="_infoModal_1c8le_11",jke="_infoContent_1c8le_15",Bke="_info_1c8le_11",Fke="_infoImage_1c8le_26",qke="_assets_1c8le_34",Hke="_login_1c8le_38",zke="_goBackButton_1c8le_42",Qo={main:Lke,infoModal:Uke,infoContent:jke,info:Bke,infoImage:Fke,assets:qke,login:Hke,goBackButton:zke},Vke={i18n:{title:"What is a wallet?",assets:{title:"A home for your digital assets",text:"Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, just connect your wallet."},goBack:"Return to log in page"}},Gke=t=>{const{i18n:e=Vke.i18n,onClose:r,open:n}=t;return He.jsxs(nM.Modal,{size:"tiny",open:n,className:Qo.infoModal,children:[He.jsx(sM,{title:"",onClose:r}),He.jsx(rM,{className:Qo.infoContent,children:He.jsxs("div",{className:Qo.main,children:[He.jsx("h1",{className:Qo.title,children:e==null?void 0:e.title}),He.jsxs("article",{className:Qo.info,children:[He.jsx("div",{className:Hg(Qo.infoImage,Qo.assets)}),He.jsx("h3",{children:e==null?void 0:e.assets.title}),He.jsx("p",{children:e==null?void 0:e.assets.text})]}),He.jsxs("article",{className:Qo.info,children:[He.jsx("div",{className:Hg(Qo.infoImage,Qo.login)}),He.jsx("h3",{children:e==null?void 0:e.logIn.title}),He.jsx("p",{children:e==null?void 0:e.logIn.text})]}),He.jsx(So.Button,{className:Qo.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},Kke="_main_1vyd9_1",Wke="_left_1vyd9_22",Yke="_leftInfo_1vyd9_32",Qke="_right_1vyd9_41",Jke="_footer_1vyd9_50",Xke="_guestInfo_1vyd9_69",C_={main:Kke,left:Wke,leftInfo:Yke,right:Qke,footer:Jke,guestInfo:Xke},Zke=()=>{const[t]=ede(),[e,r]=Ve.useState(Pi.CONNECTING_WALLET),[n,i]=Ve.useState(!1),[s,a]=Ve.useState(!1),[o,c]=Ve.useState(),u=Yte(),f=h1(),h=u&&new URL(u).pathname==="/play",m=Ve.useCallback(()=>{i(!n)},[i,n]),y=Ve.useMemo(()=>{if(u){const _=new URL(u);return _.searchParams.append("guest","true"),_.toString()}return""},[u]),w=Ve.useCallback(async _=>{var b;if(c(_),Mke(_))r(Pi.LOADING_MAGIC),await rG(_);else try{a(!0),r(Pi.CONNECTING_WALLET);const S=await rG(_);t.get("fromRequests")!=="true"&&(r(Pi.WAITING_FOR_SIGNATURE),await $re(((b=S.account)==null?void 0:b.toLowerCase())??"",S.provider)),u?window.location.href=decodeURIComponent(u):f("/user"),a(!1)}catch{r(Pi.ERROR)}},[r,a,c,u,t]),v=Ve.useCallback(()=>{a(!1),c(void 0),r(Pi.CONNECTING_WALLET)},[a]),g=Ve.useCallback(()=>{o&&w(o)},[o]);return He.jsxs("main",{className:C_.main,children:[He.jsx(Gke,{open:n,onClose:m}),He.jsx(rre,{open:s,state:e,onClose:v,onTryAgain:g,providerType:o?kre(o):null}),He.jsx("div",{className:C_.left,children:He.jsxs("div",{className:C_.leftInfo,children:[He.jsx(Cke,{onLearnMore:m,onConnect:w,loadingOption:o,socialOptions:{primary:Gn.GOOGLE,secondary:[Gn.DISCORD,Gn.APPLE,Gn.X]},web3Options:{primary:Gn.METAMASK,secondary:[Gn.FORTMATIC,Gn.COINBASE,Gn.WALLET_CONNECT]}}),h&&He.jsxs("div",{className:C_.guestInfo,children:["Quick dive? ",He.jsx("a",{href:y,children:"Explore as a guest"})]})]})})]})};afe.render(He.jsx(bG.StrictMode,{children:He.jsx(Zfe,{basename:"/auth",children:He.jsxs(Qfe,{children:[He.jsx(Bp,{path:"/login",element:He.jsx(Zke,{})}),He.jsx(Bp,{path:"/callback",element:He.jsx($ke,{})}),He.jsx(Bp,{path:"/user",element:He.jsx(u8e,{})}),He.jsx(Bp,{path:"/requests/:requestId",element:He.jsx($5e,{})}),He.jsx(Bp,{path:"*",element:He.jsx(L5e,{})})]})})}),document.getElementById("root"));export{ASe as _,ti as a,_c as b,$e as c,Pa as e,Ia as g,UZ as r};