@edgex-web/components 0.2.0-beta.23 → 0.2.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ccip-cE03OOC_.mjs → ccip-BXwsG5ON.mjs} +2 -2
- package/dist/{ccip-cE03OOC_.mjs.map → ccip-BXwsG5ON.mjs.map} +1 -1
- package/dist/hooks/useTranslation.d.ts +1 -1
- package/dist/{index-CsFAoL0Y.mjs → index-e_Rs_tZh.mjs} +5781 -5489
- package/dist/index-e_Rs_tZh.mjs.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +79 -71
- package/dist/index.umd.js.map +1 -1
- package/dist/locales/de-DE.d.ts +70 -0
- package/dist/locales/de-DE.d.ts.map +1 -0
- package/dist/locales/es-LA.d.ts +70 -0
- package/dist/locales/es-LA.d.ts.map +1 -0
- package/dist/locales/fr-FR.d.ts +70 -0
- package/dist/locales/fr-FR.d.ts.map +1 -0
- package/dist/locales/index.d.ts +7 -3
- package/dist/locales/index.d.ts.map +1 -1
- package/dist/locales/it-IT.d.ts +70 -0
- package/dist/locales/it-IT.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/index-CsFAoL0Y.mjs.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(re,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(re=typeof globalThis<"u"?globalThis:re||self,x(re.EdgeXComponents={},re.React,re.ReactDOM))})(this,function(re,x,je){"use strict";var
|
|
1
|
+
(function(re,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(re=typeof globalThis<"u"?globalThis:re||self,x(re.EdgeXComponents={},re.React,re.ReactDOM))})(this,function(re,x,je){"use strict";var dP=Object.defineProperty;var pP=(re,x,je)=>x in re?dP(re,x,{enumerable:!0,configurable:!0,writable:!0,value:je}):re[x]=je;var Go=(re,x,je)=>pP(re,typeof x!="symbol"?x+"":x,je);function Ol(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const z=Ol(x),Mr=Ol(je);function Lm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mi={exports:{}},Lr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Il;function Bm(){if(Il)return Lr;Il=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(c,a,l){var u,f={},p=null,d=null;l!==void 0&&(p=""+l),a.key!==void 0&&(p=""+a.key),a.ref!==void 0&&(d=a.ref);for(u in a)r.call(a,u)&&!s.hasOwnProperty(u)&&(f[u]=a[u]);if(c&&c.defaultProps)for(u in a=c.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:c,key:p,ref:d,props:f,_owner:o.current}}return Lr.Fragment=n,Lr.jsx=i,Lr.jsxs=i,Lr}var Br={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,101 +14,109 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+Z+R}}var oe=!1,me;{var ge=typeof WeakMap=="function"?WeakMap:Map;me=new ge}function de(R,q){if(!R||oe)return"";{var
|
|
17
|
+
*/var kl;function Fm(){return kl||(kl=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator";function v(R){if(R===null||typeof R!="object")return null;var q=h&&R[h]||R[m];return typeof q=="function"?q:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(R){{for(var q=arguments.length,K=new Array(q>1?q-1:0),te=1;te<q;te++)K[te-1]=arguments[te];S("error",R,K)}}function S(R,q,K){{var te=T.ReactDebugCurrentFrame,he=te.getStackAddendum();he!==""&&(q+="%s",K=K.concat([he]));var be=K.map(function(le){return String(le)});be.unshift("Warning: "+q),Function.prototype.apply.call(console[R],console,be)}}var C=!1,M=!1,B=!1,F=!1,b=!1,g;g=Symbol.for("react.module.reference");function w(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||b||R===o||R===l||R===u||F||R===d||C||M||B||typeof R=="object"&&R!==null&&(R.$$typeof===p||R.$$typeof===f||R.$$typeof===i||R.$$typeof===c||R.$$typeof===a||R.$$typeof===g||R.getModuleId!==void 0))}function O(R,q,K){var te=R.displayName;if(te)return te;var he=q.displayName||q.name||"";return he!==""?K+"("+he+")":K}function N(R){return R.displayName||"Context"}function I(R){if(R==null)return null;if(typeof R.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof R=="function")return R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof R=="object")switch(R.$$typeof){case c:var q=R;return N(q)+".Consumer";case i:var K=R;return N(K._context)+".Provider";case a:return O(R,R.render,"ForwardRef");case f:var te=R.displayName||null;return te!==null?te:I(R.type)||"Memo";case p:{var he=R,be=he._payload,le=he._init;try{return I(le(be))}catch{return null}}}return null}var k=Object.assign,y=0,$,A,P,L,j,U,_;function H(){}H.__reactDisabledLog=!0;function Y(){{if(y===0){$=console.log,A=console.info,P=console.warn,L=console.error,j=console.group,U=console.groupCollapsed,_=console.groupEnd;var R={configurable:!0,enumerable:!0,value:H,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}y++}}function G(){{if(y--,y===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},R,{value:$}),info:k({},R,{value:A}),warn:k({},R,{value:P}),error:k({},R,{value:L}),group:k({},R,{value:j}),groupCollapsed:k({},R,{value:U}),groupEnd:k({},R,{value:_})})}y<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var W=T.ReactCurrentDispatcher,Z;function J(R,q,K){{if(Z===void 0)try{throw Error()}catch(he){var te=he.stack.trim().match(/\n( *(at )?)/);Z=te&&te[1]||""}return`
|
|
18
|
+
`+Z+R}}var oe=!1,me;{var ge=typeof WeakMap=="function"?WeakMap:Map;me=new ge}function de(R,q){if(!R||oe)return"";{var K=me.get(R);if(K!==void 0)return K}var te;oe=!0;var he=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=W.current,W.current=null,Y();try{if(q){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(Xe){te=Xe}Reflect.construct(R,[],le)}else{try{le.call()}catch(Xe){te=Xe}R.call(le.prototype)}}else{try{throw Error()}catch(Xe){te=Xe}R()}}catch(Xe){if(Xe&&te&&typeof Xe.stack=="string"){for(var ce=Xe.stack.split(`
|
|
19
19
|
`),Re=te.stack.split(`
|
|
20
|
-
`),Pe=ce.length-1
|
|
21
|
-
`+ce[Pe].replace(" at new "," at ");return R.displayName&&yt.includes("<anonymous>")&&(yt=yt.replace("<anonymous>",R.displayName)),typeof R=="function"&&me.set(R,yt),yt}while(Pe>=1
|
|
20
|
+
`),Pe=ce.length-1,Te=Re.length-1;Pe>=1&&Te>=0&&ce[Pe]!==Re[Te];)Te--;for(;Pe>=1&&Te>=0;Pe--,Te--)if(ce[Pe]!==Re[Te]){if(Pe!==1||Te!==1)do if(Pe--,Te--,Te<0||ce[Pe]!==Re[Te]){var yt=`
|
|
21
|
+
`+ce[Pe].replace(" at new "," at ");return R.displayName&&yt.includes("<anonymous>")&&(yt=yt.replace("<anonymous>",R.displayName)),typeof R=="function"&&me.set(R,yt),yt}while(Pe>=1&&Te>=0);break}}}finally{oe=!1,W.current=be,G(),Error.prepareStackTrace=he}var Dr=R?R.displayName||R.name:"",Jn=Dr?J(Dr):"";return typeof R=="function"&&me.set(R,Jn),Jn}function se(R,q,K){return de(R,!1)}function pe(R){var q=R.prototype;return!!(q&&q.isReactComponent)}function ee(R,q,K){if(R==null)return"";if(typeof R=="function")return de(R,pe(R));if(typeof R=="string")return J(R);switch(R){case l:return J("Suspense");case u:return J("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case a:return se(R.render);case f:return ee(R.type,q,K);case p:{var te=R,he=te._payload,be=te._init;try{return ee(be(he),q,K)}catch{}}}return""}var Se=Object.prototype.hasOwnProperty,Cn={},gt=T.ReactDebugCurrentFrame;function hi(R){if(R){var q=R._owner,K=ee(R.type,R._source,q?q.type:null);gt.setExtraStackFrame(K)}else gt.setExtraStackFrame(null)}function HS(R,q,K,te,he){{var be=Function.call.bind(Se);for(var le in R)if(be(R,le)){var ce=void 0;try{if(typeof R[le]!="function"){var Re=Error((te||"React class")+": "+K+" type `"+le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[le]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Re.name="Invariant Violation",Re}ce=R[le](q,le,te,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pe){ce=Pe}ce&&!(ce instanceof Error)&&(hi(he),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",te||"React class",K,le,typeof ce),hi(null)),ce instanceof Error&&!(ce.message in Cn)&&(Cn[ce.message]=!0,hi(he),E("Failed %s type: %s",K,ce.message),hi(null))}}}var VS=Array.isArray;function Sl(R){return VS(R)}function GS(R){{var q=typeof Symbol=="function"&&Symbol.toStringTag,K=q&&R[Symbol.toStringTag]||R.constructor.name||"Object";return K}}function qS(R){try{return Em(R),!1}catch{return!0}}function Em(R){return""+R}function Sm(R){if(qS(R))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",GS(R)),Em(R)}var Pm=T.ReactCurrentOwner,ZS={key:!0,ref:!0,__self:!0,__source:!0},Tm,Am;function KS(R){if(Se.call(R,"ref")){var q=Object.getOwnPropertyDescriptor(R,"ref").get;if(q&&q.isReactWarning)return!1}return R.ref!==void 0}function YS(R){if(Se.call(R,"key")){var q=Object.getOwnPropertyDescriptor(R,"key").get;if(q&&q.isReactWarning)return!1}return R.key!==void 0}function XS(R,q){typeof R.ref=="string"&&Pm.current}function QS(R,q){{var K=function(){Tm||(Tm=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};K.isReactWarning=!0,Object.defineProperty(R,"key",{get:K,configurable:!0})}}function JS(R,q){{var K=function(){Am||(Am=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};K.isReactWarning=!0,Object.defineProperty(R,"ref",{get:K,configurable:!0})}}var eP=function(R,q,K,te,he,be,le){var ce={$$typeof:t,type:R,key:q,ref:K,props:le,_owner:be};return ce._store={},Object.defineProperty(ce._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ce,"_self",{configurable:!1,enumerable:!1,writable:!1,value:te}),Object.defineProperty(ce,"_source",{configurable:!1,enumerable:!1,writable:!1,value:he}),Object.freeze&&(Object.freeze(ce.props),Object.freeze(ce)),ce};function tP(R,q,K,te,he){{var be,le={},ce=null,Re=null;K!==void 0&&(Sm(K),ce=""+K),YS(q)&&(Sm(q.key),ce=""+q.key),KS(q)&&(Re=q.ref,XS(q,he));for(be in q)Se.call(q,be)&&!ZS.hasOwnProperty(be)&&(le[be]=q[be]);if(R&&R.defaultProps){var Pe=R.defaultProps;for(be in Pe)le[be]===void 0&&(le[be]=Pe[be])}if(ce||Re){var Te=typeof R=="function"?R.displayName||R.name||"Unknown":R;ce&&QS(le,Te),Re&&JS(le,Te)}return eP(R,ce,Re,he,te,Pm.current,le)}}var Pl=T.ReactCurrentOwner,$m=T.ReactDebugCurrentFrame;function kr(R){if(R){var q=R._owner,K=ee(R.type,R._source,q?q.type:null);$m.setExtraStackFrame(K)}else $m.setExtraStackFrame(null)}var Tl;Tl=!1;function Al(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Nm(){{if(Pl.current){var R=I(Pl.current.type);if(R)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+R+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+R+"`."}return""}}function nP(R){return""}var Cm={};function rP(R){{var q=Nm();if(!q){var K=typeof R=="string"?R:R.displayName||R.name;K&&(q=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+K+">.")}return q}}function Om(R,q){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var K=rP(q);if(Cm[K])return;Cm[K]=!0;var te="";R&&R._owner&&R._owner!==Pl.current&&(te=" It was passed a child from "+I(R._owner.type)+"."),kr(R),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,te),kr(null)}}function Im(R,q){{if(typeof R!="object")return;if(Sl(R))for(var K=0;K<R.length;K++){var te=R[K];Al(te)&&Om(te,q)}else if(Al(R))R._store&&(R._store.validated=!0);else if(R){var he=v(R);if(typeof he=="function"&&he!==R.entries)for(var be=he.call(R),le;!(le=be.next()).done;)Al(le.value)&&Om(le.value,q)}}}function oP(R){{var q=R.type;if(q==null||typeof q=="string")return;var K;if(typeof q=="function")K=q.propTypes;else if(typeof q=="object"&&(q.$$typeof===a||q.$$typeof===f))K=q.propTypes;else return;if(K){var te=I(q);HS(K,R.props,"prop",te,R)}else if(q.PropTypes!==void 0&&!Tl){Tl=!0;var he=I(q);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",he||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sP(R){{for(var q=Object.keys(R.props),K=0;K<q.length;K++){var te=q[K];if(te!=="children"&&te!=="key"){kr(R),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",te),kr(null);break}}R.ref!==null&&(kr(R),E("Invalid attribute `ref` supplied to `React.Fragment`."),kr(null))}}var km={};function Dm(R,q,K,te,he,be){{var le=w(R);if(!le){var ce="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(ce+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Re=nP();Re?ce+=Re:ce+=Nm();var Pe;R===null?Pe="null":Sl(R)?Pe="array":R!==void 0&&R.$$typeof===t?(Pe="<"+(I(R.type)||"Unknown")+" />",ce=" Did you accidentally export a JSX literal instead of a component?"):Pe=typeof R,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Pe,ce)}var Te=tP(R,q,K,he,be);if(Te==null)return Te;if(le){var yt=q.children;if(yt!==void 0)if(te)if(Sl(yt)){for(var Dr=0;Dr<yt.length;Dr++)Im(yt[Dr],R);Object.freeze&&Object.freeze(yt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Im(yt,R)}if(Se.call(q,"key")){var Jn=I(R),Xe=Object.keys(q).filter(function(fP){return fP!=="key"}),$l=Xe.length>0?"{key: someKey, "+Xe.join(": ..., ")+": ...}":"{key: someKey}";if(!km[Jn+$l]){var uP=Xe.length>0?"{"+Xe.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props}
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
<%s key={someKey} {...props} />`,$l,Jn,uP,Jn),km[Jn+$l]=!0}}return R===r?sP(Te):oP(Te),Te}}function iP(R,q,K){return Dm(R,q,K,!0)}function aP(R,q,K){return Dm(R,q,K,!1)}var cP=aP,lP=iP;Br.Fragment=r,Br.jsx=cP,Br.jsxs=lP}()),Br}process.env.NODE_ENV==="production"?mi.exports=Bm():mi.exports=Fm();var D=mi.exports;const Rm={deposit:{title:"Einzahlen",chain:"Chain",asset:"Asset",amount:"Betrag",available:"Verfügbar",equity:"Eigenkapital",confirmDeposit:"Einzahlung bestätigen",switchNetwork:"Netzwerk wechseln",max:"Max.",arrivalTime:"Ankunftszeit",ethCrossChainDepositInitiated:"ETH-Cross-Chain-Einzahlung initiiert. Voraussichtliche Ankunft in 2 bis 5 Minuten.",minDeposit:"Mindestbetrag der Einzahlung",minDepositParsed:"Min. {{amount}} {{token}} einzahlen",maxDeposit:"Maximaler Einzahlungsbetrag",depositTipFor25w:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Wenn deine Einzahlung 200.000 übersteigt, verwende bitte die Ethereum-Chain.",depositAllTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
|
|
31
|
+
Wenn der Einzahlungsbetrag 200.000 übersteigt, kann es zu einer Verzögerung der Ankunftszeit kommen. Bitte hab etwas Geduld.`,maxDepositSplitTip:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Falls du mehr als 200.000 einzahlen musst, teile den Betrag bitte in mehrere Einzahlungen auf.",spotDepositNotSupportedTip:"Einzahlungen werden nicht unterstützt. Bitte zahle auf das Perpetual-Konto ein und überweise den Betrag anschließend.",crossChainDepositFeeTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
|
|
32
|
+
Bei Chain-übergreifenden Einzahlungen musst du die Edge-Gas-Gebühr zahlen. Der gutgeschriebene Betrag wird etwas geringer sein als dein Einzahlungsbetrag.`,addressUpdatedNotice:"Hinweis: Deine Einzahlungsadresse wurde aktualisiert. Verwende die neue Adresse. Die alte Adresse funktioniert nur während der Übergangszeit und wird dann deaktiviert. Wenn sie an einem anderen Ort gespeichert wurde, aktualisiere sie umgehend.",enableSystemProWithToken:"{{token}} auf {{network}} aktivieren",enableTokenDesc:"Bei der ersten Einzahlung auf {{network}} musst du {{token}} aktivieren.",enableWithToken:"{{token}} aktivieren",arrivaltimeTooltip1:"Die Gelder kommen in etwa {{v}} Minuten an (nach Erreichen von {{v1}} Blockbestätigungen).",arrivaltimeTooltip2:"Die geschätzte Zeit wird auf der Grundlage historischer Daten berechnet und dient nur als Referenz. Eine Überlastung des Netzwerks kann zu längeren tatsächlichen Ankunftszeiten führen.",arrivalEstimated:"≈ {{v}} Minuten",availableDesc:"Der maximale Betrag, den du einzahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Einzahlungen vorgenommen werden.",noPrivateKeyWalletWarning:"Verwende für Einzahlungen keine schlüssellosen Wallets. Einzahlungen mit einer schlüssellosen Wallet können zu einem unwiderruflichen Verlust der Gelder führen.",layerZeroDepositTip:"Das System wird deine Einzahlung über LayerZero auf Basis der tatsächlichen Einzahlungsbedingungen abschließen.",layerZeroDepositTipExceedPool:"Da der Einzahlungsbetrag den Pool übersteigt, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositTipGte200k:"Da der Einzahlungsbetrag größer als oder gleich 200.000 USDT ist, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositButton:"Mit LayerZero einzahlen",defaultSpotNotice:"Standardeinzahlungen werden dem Spot-Konto gutgeschrieben.",defaultSpotToPerpNotice:"Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt. Standardeinzahlungen werden dem Spot-Konto gutgeschrieben. Überweise Gelder vom Spot-Konto auf das Futures-Konto, um das Futures-Konto zu finanzieren."},withdraw:{noticeDesc:"Normale Auszahlungen erfolgen in zwei Schritten. Im aktuellen Schritt wird dein Auszahlungsantrag eingeleitet und auf Layer 2 bearbeitet. Sobald deine Gelder zur Verfügung stehen (dies kann bis zu 4 Stunden dauern), erhältst du eine Benachrichtigung, um deine Gelder in deine Wallet auszuzahlen. Aufgrund der Chain-Synchronisierung und anderer Faktoren kann die Dauer bis zu 48 Stunden betragen. Du bist für alle Gas-Gebühren der Transaktion verantwortlich.",crossChainTips:"Bei Chain-übergreifenden Auszahlungen ist eine Verifizierung über L2 (über ZK-Proofs) erforderlich. Die Auszahlung kann bis zu 2 Stunden dauern. Für die Abwicklung von Chain-übergreifenden Auszahlungen sind ausreichende Mittel im Asset-Pool der entsprechenden Chain erforderlich. Außerdem fallen Gas-Gebühren an. edgeX erhebt eine Gebühr zur Deckung dieser Kosten.",commonWithdraw:"FAQ zu Auszahlungen",withdraw:"Auszahlen",speed:"Geschwindigkeit",confirmWithdraw:"Auszahlung bestätigen",speedNote:"Bearbeitungszeiten:",speedNoteSpeed1:"Ca. 8 Minuten",speedNoteSpeed2:"Ca. 2-4 Stunden",speedNoteSpeed3:"Ca. 4 Stunden",receiverAddress:"Empfängeradresse",fee:"Gebühr",feeRate:"Gebührensatz",withdrawlAmount:"Auszahlungsbetrag",amountToReceive:"Zu erhaltender Betrag",minWithdraw:"Mindestauszahlungsbetrag",minWithdrawParsed:"Min. Auszahlung {{amount}} {{token}}",invalidReceiverAddress:"Die Adresse darf nicht leer sein.",availableDesc:"Der maximale Betrag, den du auszahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Auszahlungen vorgenommen werden.",feeCalculationTip:"Die Auszahlungsgebühren werden berechnet, indem der Auszahlungsbetrag mit dem Gebührensatz multipliziert wird. Der Mindestbetrag liegt bei 1 USDT/USDC. Der Gebührensatz kann auf Basis der tatsächlichen On-chain-Bedingungen angepasst werden.",crossChainPoolBalance:"Guthaben des Cross-Chain-Pools",poolBalance:"Pool-Guthaben",poolBalanceInsufficientTip:"Da der Auszahlungsbetrag das Pool-Guthaben übersteigt, kann die Auszahlung nicht bearbeitet werden. Bitte wähle eine Option mit ausreichendem Pool-Guthaben."},account:{title:"Konto",perpetual:"Perpetual-Konto",spot:"Spot-Konto"}},jm={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",arrivalTime:"Arrival Time",ethCrossChainDepositInitiated:"ETH cross-chain deposit initiated. Estimated arrival in 2–5 minutes.",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
|
|
33
33
|
If the deposit amount exceeds 200,000, there may be a delay in the arrival time. Please be patient.`,maxDepositSplitTip:"The maximum amount per deposit is 200,000. If you need to deposit more than 200,000, please split it into multiple deposits.",spotDepositNotSupportedTip:"Deposits aren't supported. Please deposit to perpetual account, then transfer.",crossChainDepositFeeTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
|
|
34
|
-
Cross-chain deposits require you to pay the Edge gas fee. The credited amount will be slightly less than your deposit amount.`,addressUpdatedNotice:"Notice: Your deposit address has been updated. Use the new address. The old one works only during the transition and will be disabled. If saved elsewhere, update it promptly.",enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"The funds will arrive in approximately {{v}} minutes (after reaching {{v1}} block confirmations).",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"The maximum amount you can deposit. When the available balance is 0 or negative, deposits cannot be made.",noPrivateKeyWalletWarning:"Do not use keyless wallets to make deposits. Depositing with a keyless wallet may result in irreversible loss of funds.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositTipExceedPool:"Since the deposit amount exceeds the pool, your deposit will be completed via LayerZero.",layerZeroDepositTipGte200k:"Since the deposit amount is greater than or equal to 200,000 USDT, your deposit will be completed via LayerZero.",layerZeroDepositButton:"Deposit with LayerZero",defaultSpotNotice:"Default deposits go to the spot account.",defaultSpotToPerpNotice:"Only {{coin}} ({{v}}) is supported for deposits to this address. Default deposits go to the spot account. To fund the futures account, transfer from the spot account to the futures account."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",feeRate:"Fee Rate",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",minWithdraw:"Minimum Withdrawal Amount",minWithdrawParsed:"Min. Withdrawal {{amount}} {{token}}",invalidReceiverAddress:"Address cannot be empty",availableDesc:"The maximum amount you can withdraw. When the available balance is 0 or negative, withdrawals cannot be made.",feeCalculationTip:"Withdrawal fees are calculated by multiplying the withdrawal amount by the fee rate, with a minimum of 1 USDT/USDC. The fee rate may be adjusted based on actual on-chain conditions.",crossChainPoolBalance:"Cross-chain pool balance",poolBalance:"Pool balance",poolBalanceInsufficientTip:"The withdrawal amount exceeds the fund pool balance, and the withdrawal cannot be processed. Please select an option with a sufficient fund pool balance."},account:{title:"Account",perpetual:"Perpetual Account",spot:"Spot Account"}},_m={deposit:{title:"
|
|
34
|
+
Cross-chain deposits require you to pay the Edge gas fee. The credited amount will be slightly less than your deposit amount.`,addressUpdatedNotice:"Notice: Your deposit address has been updated. Use the new address. The old one works only during the transition and will be disabled. If saved elsewhere, update it promptly.",enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"The funds will arrive in approximately {{v}} minutes (after reaching {{v1}} block confirmations).",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"The maximum amount you can deposit. When the available balance is 0 or negative, deposits cannot be made.",noPrivateKeyWalletWarning:"Do not use keyless wallets to make deposits. Depositing with a keyless wallet may result in irreversible loss of funds.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositTipExceedPool:"Since the deposit amount exceeds the pool, your deposit will be completed via LayerZero.",layerZeroDepositTipGte200k:"Since the deposit amount is greater than or equal to 200,000 USDT, your deposit will be completed via LayerZero.",layerZeroDepositButton:"Deposit with LayerZero",defaultSpotNotice:"Default deposits go to the spot account.",defaultSpotToPerpNotice:"Only {{coin}} ({{v}}) is supported for deposits to this address. Default deposits go to the spot account. To fund the futures account, transfer from the spot account to the futures account."},withdraw:{noticeDesc:"Normal withdrawals are a two-step process. The current step initiates your withdrawal request and will be processed on Layer 2. Once your funds are ready (can take up to 4 hours), you will receive a notification to withdraw funds to your wallet. Due to chain synchronization and other factors, the duration may take up to 48 hours. You are responsible for any transaction gas fees.",crossChainTips:"Cross-chain withdrawals require verification at L2 (via ZK proofs) and the withdrawal process may take up to 2 hours. Sufficient funds in the corresponding chain's asset pool are required to process cross-chain withdrawals. Gas fees will also be incurred. edgeX will charge a fee to cover this.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",feeRate:"Fee Rate",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",minWithdraw:"Minimum Withdrawal Amount",minWithdrawParsed:"Min. Withdrawal {{amount}} {{token}}",invalidReceiverAddress:"Address cannot be empty",availableDesc:"The maximum amount you can withdraw. When the available balance is 0 or negative, withdrawals cannot be made.",feeCalculationTip:"Withdrawal fees are calculated by multiplying the withdrawal amount by the fee rate, with a minimum of 1 USDT/USDC. The fee rate may be adjusted based on actual on-chain conditions.",crossChainPoolBalance:"Cross-chain pool balance",poolBalance:"Pool balance",poolBalanceInsufficientTip:"The withdrawal amount exceeds the fund pool balance, and the withdrawal cannot be processed. Please select an option with a sufficient fund pool balance."},account:{title:"Account",perpetual:"Perpetual Account",spot:"Spot Account"}},_m={deposit:{title:"Depósito",chain:"Cadena",asset:"Activo",amount:"Monto",available:"Disponible",equity:"Capital",confirmDeposit:"Confirmar depósito",switchNetwork:"Cambiar de red",max:"Máx.",arrivalTime:"Hora de llegada",ethCrossChainDepositInitiated:"Se inició el depósito entre cadenas de ETH. Llegada estimada en 2 a 5 minutos.",minDeposit:"Monto mínimo de depósito",minDepositParsed:"Mín. de depósito: {{amount}} {{token}}",maxDeposit:"Monto máximo de depósito",depositTipFor25w:"El monto máximo por depósito es de 200,000. Si tu depósito supera los 200,000, usa la cadena Ethereum.",depositAllTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
|
|
35
|
+
Si el monto del depósito supera los 200,000, puede haber un retraso en la hora de llegada. Ten paciencia.`,maxDepositSplitTip:"El monto máximo por depósito es de 200,000. Si necesitas depositar más de 200,000, divídelo en varios depósitos.",spotDepositNotSupportedTip:"No se admiten depósitos. Deposita en la cuenta de perpetuos y luego haz la transferencia.",crossChainDepositFeeTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
|
|
36
|
+
Los depósitos entre cadenas requieren el pago de la comisión de gas de Edge. El monto acreditado será ligeramente inferior al monto depositado.`,addressUpdatedNotice:"Aviso: Se actualizó tu dirección de depósito. Usa esta nueva dirección. La anterior solo funciona durante la transición y pronto se desactivará. Si la tienes guardada en otros dispositivos, actualízala lo antes posible.",enableSystemProWithToken:"Habilitar {{token}} en {{network}}",enableTokenDesc:"Debes habilitar {{token}} la primera vez que deposites en {{network}}.",enableWithToken:"Habilitar {{token}}",arrivaltimeTooltip1:"Los fondos se acreditarán en aproximadamente {{v}} minutos (tras obtener {{v1}} confirmaciones de bloque).",arrivaltimeTooltip2:"El tiempo estimado se calcula a partir de datos históricos y es solo de referencia. La congestión de la red puede ocasionar tiempos de acreditación más largos.",arrivalEstimated:"Aprox. {{v}} minutos",availableDesc:"Lo máximo que puedes depositar. Si el saldo disponible es 0 o negativo, los depósitos no están permitidos.",noPrivateKeyWalletWarning:"No uses billeteras sin clave para realizar depósitos. Existe el riesgo de una pérdida irreversible de los fondos.",layerZeroDepositTip:"El sistema completará tu depósito a través de LayerZero según las condiciones de depósito reales.",layerZeroDepositTipExceedPool:"Dado que el importe del depósito supera el pool, tu depósito se completará a través de LayerZero.",layerZeroDepositTipGte200k:"El depósito es de 200,000 USDT o más. Se completará a través de LayerZero.",layerZeroDepositButton:"Depositar con LayerZero",defaultSpotNotice:"Los depósitos predeterminados van a la cuenta spot.",defaultSpotToPerpNotice:"Esta dirección solo admite depósitos en {{coin}} ({{v}}) Los depósitos predeterminados van a la cuenta spot. Para agregar fondos a la cuenta de futuros, transfiere desde la cuenta spot a la cuenta de futuros."},withdraw:{noticeDesc:"Los retiros normales son un proceso de dos pasos. Este paso inicia tu solicitud de retiro, que se procesará en la capa 2. Una vez que tus fondos estén listos (puede tardar hasta 4 horas), recibirás una notificación para retirar fondos a tu billetera. Debido a la sincronización de la cadena y a otros factores, el proceso puede llevar hasta 48 horas. Las comisiones de gas de las transacciones corren por tu cuenta.",crossChainTips:"Los retiros entre cadenas requieren verificación en la capa 2 (mediante pruebas ZK) y el proceso de retiro puede tardar hasta 2 horas. Para procesar retiros entre cadenas, se requieren fondos suficientes en el pool de activos de la cadena correspondiente. También se incurrirá en comisiones de gas. edgeX cobrará una tarifa para cubrirlos.",commonWithdraw:"Preguntas frecuentes sobre los retiros",withdraw:"Retirar",speed:"Velocidad",confirmWithdraw:"Confirmar el retiro",speedNote:"Plazos de procesamiento:",speedNoteSpeed1:"Aprox. 8 minutos",speedNoteSpeed2:"Aprox. 2-4 horas",speedNoteSpeed3:"Aprox. 4 horas",receiverAddress:"Dirección del destinatario",fee:"Comisión",feeRate:"Tasa de comisión",withdrawlAmount:"Monto del retiro",amountToReceive:"Monto a recibir",minWithdraw:"Monto mínimo de retiro",minWithdrawParsed:"Min. de retiro: {{amount}} {{token}}",invalidReceiverAddress:"La dirección no puede estar vacía",availableDesc:"Lo máximo que puedes retirar. Si el saldo disponible es 0 o negativo, los retiros no están permitidos.",feeCalculationTip:"Las comisiones de retiro se calculan multiplicando el monto de retiro por la tasa de comisión, con un mínimo de 1 USDT/USDC. La tasa de la comisión puede modificarse en función de las condiciones reales de la cadena.",crossChainPoolBalance:"Saldo del pool cross-chain",poolBalance:"Saldo del pool",poolBalanceInsufficientTip:"El monto a retirar excede el saldo del pool. El retiro no se puede procesar. Selecciona una opción con un saldo suficiente en el pool."},account:{title:"Cuenta",perpetual:"Cuenta de perpetuos",spot:"Cuenta spot"}},zm={deposit:{title:"Dépôt",chain:"Blockchain",asset:"Actif",amount:"Montant",available:"Disponible",equity:"Actif net",confirmDeposit:"Confirmer le dépôt",switchNetwork:"Changer de réseau",max:"Max.",arrivalTime:"Heure d’arrivée",ethCrossChainDepositInitiated:"Dépôt ETH inter-blockchains initié. Arrivée estimée dans 2 à 5 minutes.",minDeposit:"Montant minimum de dépôt",minDepositParsed:"Dépôt min. {{amount}} {{token}}",maxDeposit:"Montant maximum de dépôt",depositTipFor25w:"Le montant maximum par dépôt est de 200 000. Si votre dépôt dépasse 200 000, utilisez la blockchain Ethereum.",depositAllTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
|
|
37
|
+
Si le montant du dépôt dépasse 200 000, l’heure d’arrivée peut être retardée. Merci de patienter.`,maxDepositSplitTip:"Le montant maximum par dépôt est de 200 000. Si vous devez déposer plus de 200 000, veuillez effectuer plusieurs dépôts.",spotDepositNotSupportedTip:"Les dépôts ne sont pas pris en charge. Veuillez effectuer le dépôt sur le compte perpétuel, puis transférer les fonds.",crossChainDepositFeeTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
|
|
38
|
+
Les dépôts inter-blockchains nécessitent le paiement des frais de gas Edge. Le montant crédité sera légèrement inférieur au montant déposé.`,addressUpdatedNotice:"Avis : Votre adresse de dépôt a été mise à jour. Utilisez la nouvelle adresse. L’ancienne ne fonctionne que pendant la transition et sera désactivée. Si vous l’avez enregistrée ailleurs, modifiez-la sans tarder.",enableSystemProWithToken:"Activer {{token}} sur {{network}}",enableTokenDesc:"Vous devez activer {{token}} lors de votre premier dépôt sur {{network}}.",enableWithToken:"Activer {{token}}",arrivaltimeTooltip1:"Les fonds arriveront dans environ {{v}} minutes (après {{v1}} confirmations de bloc).",arrivaltimeTooltip2:"La durée estimée est calculée sur la base de données historiques et n’est donnée qu’à titre indicatif. L’encombrement du réseau peut rallonger l’heure d’arrivée réelle.",arrivalEstimated:"≈ {{v}} minutes",availableDesc:"Montant maximal que vous pouvez déposer. Lorsque le solde disponible est nul ou négatif, aucun dépôt ne peut être effectué.",noPrivateKeyWalletWarning:"N’utilisez pas de wallets sans clé pour effectuer des dépôts. Un dépôt effectué depuis un wallet sans clé peut entraîner une perte irréversible des fonds.",layerZeroDepositTip:"Le système effectuera votre dépôt via LayerZero en fonction des conditions réelles du dépôt.",layerZeroDepositTipExceedPool:"Comme le montant du dépôt est supérieur au pool, votre dépôt sera effectué via LayerZero.",layerZeroDepositTipGte200k:"Comme le montant du dépôt est supérieur ou égal à 200 000 USDT, votre dépôt sera effectué via LayerZero.",layerZeroDepositButton:"Déposer via LayerZero",defaultSpotNotice:"Par défaut, les dépôts sont crédités sur le compte spot.",defaultSpotToPerpNotice:"Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse. Par défaut, les dépôts sont crédités sur le compte spot. Pour alimenter le compte futures, transférez des fonds du compte spot vers le compte futures."},withdraw:{noticeDesc:"Les retraits classiques s’effectuent en deux étapes. Cette étape initie votre demande de retrait et sera traitée sur la Layer 2. Une fois vos fonds prêts (cela peut prendre jusqu’à 4 heures), vous recevrez une notification pour retirer les fonds vers votre wallet. En raison de la synchronisation de la chaîne et d’autres facteurs, le délai peut atteindre 48 heures. Vous êtes responsable de tous les frais de gas liés aux transactions.",crossChainTips:"Les retraits inter-blockchains nécessitent une vérification sur L2 (via des preuves ZK) et le processus de retrait peut prendre jusqu’à 2 heures. Des fonds suffisants dans le pool d’actifs de la chaîne concernée sont nécessaires pour traiter les retraits inter-blockchains. Des frais de gas seront également appliqués. edgeX facturera des frais pour les couvrir.",commonWithdraw:"FAQ sur les retraits",withdraw:"Retrait",speed:"Vitesse",confirmWithdraw:"Confirmer le retrait",speedNote:"Délais de traitement :",speedNoteSpeed1:"Env. 8 minutes",speedNoteSpeed2:"Env. 2 à 4 heures",speedNoteSpeed3:"Env. 4 heures",receiverAddress:"Adresse de réception",fee:"Frais",feeRate:"Taux de frais",withdrawlAmount:"Montant du retrait",amountToReceive:"Montant à recevoir",minWithdraw:"Montant minimum de retrait",minWithdrawParsed:"Retrait min. {{amount}} {{token}}",invalidReceiverAddress:"L’adresse ne peut pas être vide",availableDesc:"Montant maximal que vous pouvez retirer. Lorsque le solde disponible est nul ou négatif, aucun retrait ne peut être effectué.",feeCalculationTip:"Les frais de retrait sont calculés en multipliant le montant du retrait par le taux de frais, avec un minimum de 1 USDT/USDC. Le taux de frais peut être ajusté en fonction des conditions réelles on-chain.",crossChainPoolBalance:"Solde du pool inter-blockchains",poolBalance:"Solde du pool",poolBalanceInsufficientTip:"Le montant du retrait dépasse le solde du pool de fonds ; le retrait ne peut pas être traité. Sélectionnez une option disposant d’un solde de pool de fonds suffisant."},account:{title:"Compte",perpetual:"Compte perpétuel",spot:"Compte spot"}},Um={deposit:{title:"Deposita",chain:"Blockchain",asset:"Asset",amount:"Importo",available:"Disponibile",equity:"Equity",confirmDeposit:"Conferma il deposito",switchNetwork:"Cambia rete",max:"Max",arrivalTime:"Orario di arrivo",ethCrossChainDepositInitiated:"Deposito cross-chain di ETH avviato. Il deposito arriverà tra 2-5 minuti.",minDeposit:"Importo minimo del deposito",minDepositParsed:"Deposito min. {{amount}} {{token}}",maxDeposit:"Importo massimo del deposito",depositTipFor25w:"L'importo massimo per deposito è 200.000. Se il tuo deposito supera i 200.000, utilizza la catena Ethereum.",depositAllTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
|
|
39
|
+
Se l'importo del deposito supera i 200.000, l'orario di arrivo potrebbe subire ritardi. Sii paziente.`,maxDepositSplitTip:"L'importo massimo per deposito è 200.000. Se devi depositare più di 200.000, dividi l'importo in più depositi.",spotDepositNotSupportedTip:"I depositi non sono supportati. Prima deposita sul conto perpetuo, quindi effettua il trasferimento.",crossChainDepositFeeTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
|
|
40
|
+
Per i depositi cross-chain è necessario pagare la gas fee Edge. L'importo accreditato sarà leggermente inferiore all'importo del deposito.`,addressUpdatedNotice:"Avviso: il tuo indirizzo di deposito è stato aggiornato. Utilizza il nuovo indirizzo. L'indirizzo precedente funzionerà solo durante la transizione, quindi verrà disattivato. Se l'hai salvato altrove, aggiornarlo il prima possibile.",enableSystemProWithToken:"Abilita {{token}} su {{network}}",enableTokenDesc:"Devi abilitare {{token}} la prima volta che depositi su {{network}}.",enableWithToken:"Abilita {{token}}",arrivaltimeTooltip1:"I fondi arriveranno entro circa {{v}} minuti (dopo{{v1}} conferme di blocco).",arrivaltimeTooltip2:"Il tempo stimato è calcolato in base ai dati storici ed solo per riferimento. Se la rete è congestionata, potrebbero esserci dei ritardi.",arrivalEstimated:"≈ {{v}} minuti",availableDesc:"L'importo massimo che puoi depositare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare depositi.",noPrivateKeyWalletWarning:"Non effettuare depositi con wallet senza chiavi. Se effettui un deposito tramite un wallet senza chiave rischi di perdere i tuoi fondi per sempre.",layerZeroDepositTip:"Il sistema completerà il tuo deposito tramite LayerZero in base alle condizioni effettive di deposito.",layerZeroDepositTipExceedPool:"Poiché l'importo del deposito supera il pool, il deposito sarà completato tramite LayerZero.",layerZeroDepositTipGte200k:"Poiché l'importo del deposito è maggiore o uguale a 200.000 USDT, il deposito verrà completato tramite LayerZero.",layerZeroDepositButton:"Deposita con LayerZero",defaultSpotNotice:"I depositi predefiniti vanno sul conto spot.",defaultSpotToPerpNotice:"I depositi a questo indirizzo supportano solo {{coin}} ({{v}}). I depositi predefiniti vanno sul conto spot. Per finanziare il conto futures, effettua un trasferimento dal conto spot al conto futures."},withdraw:{noticeDesc:"I prelievi normali avvengono in due fasi. La fase attuale dà il via alla richiesta di prelievo, che verrà elaborata nel Layer 2. Non appena i fondi saranno pronti (possono volerci fino a 4 ore), riceverai una notifica per prelevarli nel tuo portafoglio. A causa della sincronizzazione della blockchain e di altri fattori, l'operazione potrebbe richiedere fino a 48 ore. Sei responsabile di eventuali gas fee per la transazione.",crossChainTips:"I prelievi cross-chain richiedono una verifica sul L2 (tramite prove ZK) e l'elaborazione del prelievo può richiedere fino a 2 ore. Per elaborare i prelievi cross-chain, il pool degli asset della blockchain corrispondente deve disporre di fondi a sufficienza. Inoltre, è necessario pagare delle gas fee. edgeX addebiterà una commissione per coprire tale costo.",commonWithdraw:"Domande frequenti sui prelievi",withdraw:"Preleva",speed:"Velocità",confirmWithdraw:"Conferma prelievo",speedNote:"Tempi di elaborazione:",speedNoteSpeed1:"Circa 8 minuti",speedNoteSpeed2:"Circa 2-4 ore",speedNoteSpeed3:"Circa 4 ore",receiverAddress:"Indirizzo del destinatario",fee:"Commissione",feeRate:"Tariffa",withdrawlAmount:"Importo del prelievo",amountToReceive:"Importo da ricevere",minWithdraw:"Importo minimo di prelievo",minWithdrawParsed:"Prelievo min. {{amount}} {{token}}",invalidReceiverAddress:"L'indirizzo non può essere vuoto",availableDesc:"L'importo massimo che puoi prelevare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare prelievi.",feeCalculationTip:"Le commissioni di prelievo vengono calcolate moltiplicando l'importo del prelievo per il tasso di commissione, con un minimo di 1 USDT/USDC. La tariffa può essere modificata in base alle condizioni effettive on-chain.",crossChainPoolBalance:"Equilibrio del pool cross-chain",poolBalance:"Equilibrio della piscina",poolBalanceInsufficientTip:"L'importo del prelievo supera il saldo del fondo e il prelievo non può essere elaborato. Selezionare un'opzione con un saldo di fondi sufficiente."},account:{title:"Account",perpetual:"Conto perpetuo",spot:"Conto Spot"}},Wm={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",arrivalTime:"着金予定時間",ethCrossChainDepositInitiated:"ETH のクロスチェーン入金を開始しました。到着まで約2〜5分です。",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
|
|
35
41
|
入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,maxDepositSplitTip:"1回の入金上限は200,000です。200,000を超える金額を入金する場合は、複数回に分けて行ってください。",spotDepositNotSupportedTip:"入金非対応。先に契約アカウント入金後、振替。",crossChainDepositFeeTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
|
|
36
|
-
クロスチェーン入金では Edge ネットワーク手数料はお客様負担となります。入金額はご入金額よりわずかに少なくなります。`,addressUpdatedNotice:"注意:入金アドレスが更新されました。新しいアドレスをご利用ください。旧アドレスは移行期間のみ有効で、その後無効になります。他のサービスに保存している場合は早急に更新してください。",enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"資金は約 {{v}} 分以内({{v1}} 回のブロック確認が完了後)に到账します。",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"入金可能な最大金額。利用可能残高が0または負の数の場合、入金はできません。",noPrivateKeyWalletWarning:"秘密鍵のないウォレットでの入金は行わないでください。そのような入金は資金を失い、取り戻すことができません。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositTipExceedPool:"入金額がプールを超えているため、LayerZero を通じて入金が完了します。",layerZeroDepositTipGte200k:"入金額が 200,000 USDT 以上のため、LayerZero を通じて入金が完了します。",layerZeroDepositButton:"LayerZeroで入金",defaultSpotNotice:"デフォルトでは現物口座に入金されます",defaultSpotToPerpNotice:"このアドレスは {{coin}} ({{v}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",feeRate:"手数料率",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",minWithdraw:"最低出金額",minWithdrawParsed:"最低出金 {{amount}} {{token}}",invalidReceiverAddress:"ウォレットアドレスは必須です",availableDesc:"引き出し可能な最大金額。利用可能残高が0または負の数の場合、引き出しはできません。",feeCalculationTip:"出金手数料は、出金金額に料率を乗じて計算され、最低1 USDT/USDCとなります。料率は、ブロックチェーンの実際の状況に基づいて調整される場合があります。",crossChainPoolBalance:"クロスチェーンプール残高",poolBalance:"プール残高",poolBalanceInsufficientTip:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。"},account:{title:"アカウント",perpetual:"パーペチュアルアカウント",spot:"スポットアカウント"}},
|
|
42
|
+
クロスチェーン入金では Edge ネットワーク手数料はお客様負担となります。入金額はご入金額よりわずかに少なくなります。`,addressUpdatedNotice:"注意:入金アドレスが更新されました。新しいアドレスをご利用ください。旧アドレスは移行期間のみ有効で、その後無効になります。他のサービスに保存している場合は早急に更新してください。",enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"資金は約 {{v}} 分以内({{v1}} 回のブロック確認が完了後)に到账します。",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",availableDesc:"入金可能な最大金額。利用可能残高が0または負の数の場合、入金はできません。",noPrivateKeyWalletWarning:"秘密鍵のないウォレットでの入金は行わないでください。そのような入金は資金を失い、取り戻すことができません。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositTipExceedPool:"入金額がプールを超えているため、LayerZero を通じて入金が完了します。",layerZeroDepositTipGte200k:"入金額が 200,000 USDT 以上のため、LayerZero を通じて入金が完了します。",layerZeroDepositButton:"LayerZeroで入金",defaultSpotNotice:"デフォルトでは現物口座に入金されます",defaultSpotToPerpNotice:"このアドレスは {{coin}} ({{v}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。"},withdraw:{noticeDesc:"通常出金は2ステップで行われます。このステップで出金リクエストを送信し、Layer2で処理されます。資金の準備が完了すると(最大4時間かかる場合があります)、出金の通知が届きます。チェーンの同期などの影響により、所要時間は最長で48時間かかる場合があります。ガス代はユーザー負担です。",crossChainTips:"クロスチェーン出金はL2上(ゼロ知識証明経由)で検証が必要です。出金処理には最大2時間ほどかかる場合があります。対応するチェーンの資産プールに十分な流動性が必要であり、ガス代も発生します。edgeXはそのコストを補うため、一定の手数料を徴収します。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",feeRate:"手数料率",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",minWithdraw:"最低出金額",minWithdrawParsed:"最低出金 {{amount}} {{token}}",invalidReceiverAddress:"ウォレットアドレスは必須です",availableDesc:"引き出し可能な最大金額。利用可能残高が0または負の数の場合、引き出しはできません。",feeCalculationTip:"出金手数料は、出金金額に料率を乗じて計算され、最低1 USDT/USDCとなります。料率は、ブロックチェーンの実際の状況に基づいて調整される場合があります。",crossChainPoolBalance:"クロスチェーンプール残高",poolBalance:"プール残高",poolBalanceInsufficientTip:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。"},account:{title:"アカウント",perpetual:"パーペチュアルアカウント",spot:"スポットアカウント"}},Hm={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",arrivalTime:"Время поступления",ethCrossChainDepositInitiated:"Кроссчейн‑депозит ETH запущен. Ожидаемое зачисление: 2–5 минут.",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
37
43
|
Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,maxDepositSplitTip:"Максимальная сумма одного пополнения — 200 000. Если вам нужно пополнить на сумму более 200 000, выполните несколько пополнений.",spotDepositNotSupportedTip:"Пополнение недоступно. Сначала контрактный счёт, затем перевод.",crossChainDepositFeeTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
38
44
|
За кроссчейн‑депозит вы оплачиваете комиссию сети Edge. Зачисленная сумма будет немного меньше суммы вашего депозита.`,addressUpdatedNotice:"Внимание: ваш адрес пополнения обновлён. Используйте новый адрес. Старый действует только в переходный период и будет отключён. Если он сохранён где‑то ещё, срочно обновите.",enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Средства поступят в течение примерно {{v}} минут (после достижения {{v1}} подтверждений блоков).",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма, которую вы можете пополнить. Если доступный баланс равен 0 или отрицательный, пополнение невозможно.",noPrivateKeyWalletWarning:`Не используйте кошельки без приватных ключей для пополнения. Пополнение с такого кошелька может привести к безвозвратной потере средств.
|
|
39
45
|
|
|
40
|
-
Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",feeRate:"Тариф",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",minWithdraw:"Минимальная сумма вывода",minWithdrawParsed:"Мин. вывод {{amount}} {{token}}",invalidReceiverAddress:"Укажите адрес кошелька",availableDesc:"Максимальная сумма, которую вы можете вывести. Если доступный баланс равен 0 или отрицательный, вывод средств невозможен.",feeCalculationTip:"Комиссия за вывод средств рассчитывается путем умножения суммы вывода на ставку комиссии, минимальная комиссия составляет 1 USDT/USDC. Ставка комиссии может быть скорректирована в зависимости от фактической ситуации в сети блокчейн.",crossChainPoolBalance:"Баланс кросс-чейн пула",poolBalance:"Баланс пула",poolBalanceInsufficientTip:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств."},account:{title:"Аккаунт",perpetual:"Перпетуальный счет",spot:"Спотовый счет"}},
|
|
46
|
+
Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный."},withdraw:{noticeDesc:"Вывод средств происходит в два этапа: сначала подаётся заявка на вывод (обрабатывается на Layer 2), затем - перевод на кошелёк после подготовки средств (до 14 часов). Из-за синхронизации цепочки и других факторов процесс может занять до 48 часов. За gas-комиссии отвечает пользователь.",crossChainTips:"• Кроссчейн выводы требуют проверки на L2 (через ZK доказательства) и могут занять до 2 часов. Для вывода нужны средства в пуле соответствующей цепи. Также взимается комиссия за газ. edgeX взимает плату за обслуживание.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",feeRate:"Тариф",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",minWithdraw:"Минимальная сумма вывода",minWithdrawParsed:"Мин. вывод {{amount}} {{token}}",invalidReceiverAddress:"Укажите адрес кошелька",availableDesc:"Максимальная сумма, которую вы можете вывести. Если доступный баланс равен 0 или отрицательный, вывод средств невозможен.",feeCalculationTip:"Комиссия за вывод средств рассчитывается путем умножения суммы вывода на ставку комиссии, минимальная комиссия составляет 1 USDT/USDC. Ставка комиссии может быть скорректирована в зависимости от фактической ситуации в сети блокчейн.",crossChainPoolBalance:"Баланс кросс-чейн пула",poolBalance:"Баланс пула",poolBalanceInsufficientTip:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств."},account:{title:"Аккаунт",perpetual:"Перпетуальный счет",spot:"Спотовый счет"}},Vm={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",arrivalTime:"到账时间",ethCrossChainDepositInitiated:"ETH 跨链充值已发起,预计 2–5 分钟到账。",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
|
|
47
|
+
充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,maxDepositSplitTip:"单笔充值金额上限为200,000。若需要充值金额大于200,000,请分多笔进行操作。",spotDepositNotSupportedTip:"不支持充值,请先充入合约账户再划转。",crossChainDepositFeeTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
|
|
48
|
+
跨链充值需由您承担 Edge 网络手续费。到账金额会略小于您的充值金额。`,addressUpdatedNotice:"注意:充值地址已更新,请改用新地址。原地址仅在过渡期可用,随后停用。若旧地址已存于其他平台,请尽快更新。",enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"资金约在 {{v}} 分钟 内 (达到 {{v1}} 个区块确认后) 到账。",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",availableDesc:"您可以充值的最大金额。当可用为0或负数时,无法进行充值。",noPrivateKeyWalletWarning:"请勿使用无私钥钱包进行充值,无私钥钱包充值会导致资金损失且无法追回。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositTipExceedPool:"由于充值资金大于资金池,将通过LayerZero完成您的充值。",layerZeroDepositTipGte200k:"由于充值资金大于等于200,000 USDT,将通过LayerZero完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"默认充值至现货账户",defaultSpotToPerpNotice:"仅支持发送 {{coin}} ({{v}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。"},withdraw:{noticeDesc:"普通提现是一个两步过程。 此步骤将发起您的提现请求,并将在 Layer2 进行处理。 一旦资金准备就绪(可能需要最多 4 小时),您将收到一条将资金提现到钱包的通知。受链同步等情况影响下,时长可能到 48 小时。您需要自行承担交易 gas 费用。",crossChainTips:"跨链提币需在 L2(通过零知识证明)进行验证。提币过程最多约需2小时。相关链的资产池中需有充足的资金来处理跨链提币,其间还将产生矿工费。 edgeX 将收取一定的手续费作为矿工费。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",feeRate:"费率",withdrawlAmount:"提现金额",amountToReceive:"到账金额",minWithdraw:"最小提现金额",minWithdrawParsed:"最小提现 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能为空",availableDesc:"您可以提现的最大金额。当可用为0或负数时,无法进行提现。",feeCalculationTip:"提现手续费按照提现金额乘以费率计算,最低为1 USDT/USDC。费率会根据链上实际情况进行调整。",crossChainPoolBalance:"跨链资金池余额",poolBalance:"资金池余额",poolBalanceInsufficientTip:"提现金额大于资金池余额,无法进行提现。请选择资金池余额充足的选项。"},account:{title:"账户",perpetual:"合约账户",spot:"现货账户"}},Gm={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",arrivalTime:"到帳時間",ethCrossChainDepositInitiated:"ETH 跨鏈充值已發起 ,預計 2–5 分鐘到賬。",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
41
49
|
充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,maxDepositSplitTip:"單筆充值金額上限為 200,000。若需要充值金額大於 200,000,請分多筆進行操作。",spotDepositNotSupportedTip:"不支援充值,請先充入合約帳戶再劃轉。",crossChainDepositFeeTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
42
|
-
跨鏈充值需由您承擔 Edge 網路手續費。到帳金額會略小於您的充值金額。`,addressUpdatedNotice:"注意:充值地址已更新,請改用新地址。原地址僅在過渡期內有效,之後將停用。若已在其他平台儲存,請儘速更新。",enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"資金約在 {{v}} 分鐘內(達到 {{v1}} 個區塊確認後)到賬。",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以充值的最大金額。當可用餘額為0或負數時,無法進行充值。",noPrivateKeyWalletWarning:"請勿使用無私鑰錢包進行充值,無私鑰錢包充值會導致資金損失且無法追回。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositTipExceedPool:"由於充值資金大於資金池,將透過 LayerZero 完成您的充值。",layerZeroDepositTipGte200k:"由於充值資金大於等於 200,000 USDT,將透過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"預設充值至現貨帳戶",defaultSpotToPerpNotice:"僅支援發送 {{coin}} ({{v}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",feeRate:"費率",withdrawlAmount:"提現金額",amountToReceive:"到账金額",minWithdraw:"最小提現金額",minWithdrawParsed:"最小提現 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能為空",availableDesc:"您可以提現的最大金額。當可用餘額為0或負數時,無法進行提現。",feeCalculationTip:"提現手續費按照提現金額乘以費率計算,最低為 1 USDT/USDC。費率會根據鏈上實際情況進行調整。",crossChainPoolBalance:"跨鏈資金池餘額",poolBalance:"資金池餘額",poolBalanceInsufficientTip:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。"},account:{title:"帳戶",perpetual:"合約帳戶",spot:"現貨帳戶"}},bi=["en-US","ja-JP","ru-RU","zh-CN","zh-TW"],ku={"en-US":jm,"ja-JP":_m,"ru-RU":Um,"zh-CN":Rm,"zh-TW":zm},qo="en-US",Hm={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский"},Wm=e=>bi.includes(e)?ku[e]:ku[qo],Vm=e=>bi.includes(e),Bu=x.createContext(null),Gm=({config:e,children:t})=>{const n=x.useMemo(()=>{const r=e.locale||qo,o=Vm(r)?r:qo,s=Wm(o);return{...e,currentLocale:o,translations:s}},[e]);return k.jsx(Bu.Provider,{value:n,children:t})},Lu=()=>{const e=x.useContext(Bu);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var qm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,gi=Math.ceil,ot=Math.floor,_e="[BigNumber Error] ",Fu=_e+"Number primitive has more than 15 significant digits: ",wt=1e14,ne=14,yi=9007199254740991,wi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],fn=1e7,Oe=1e9;function Du(e){var t,n,r,o=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),i=20,c=4,a=-7,u=21,l=-1e7,f=1e7,p=!1,d=1,h=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},w="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function E(b,g){var v,C,O,I,M,y,A,T,P=this;if(!(P instanceof E))return new E(b,g);if(g==null){if(b&&b._isBigNumber===!0){P.s=b.s,!b.c||b.e>f?P.c=P.e=null:b.e<l?P.c=[P.e=0]:(P.e=b.e,P.c=b.c.slice());return}if((y=typeof b=="number")&&b*0==0){if(P.s=1/b<0?(b=-b,-1):1,b===~~b){for(I=0,M=b;M>=10;M/=10,I++);I>f?P.c=P.e=null:(P.e=I,P.c=[b]);return}T=String(b)}else{if(!qm.test(T=String(b)))return r(P,T,y);P.s=T.charCodeAt(0)==45?(T=T.slice(1),-1):1}(I=T.indexOf("."))>-1&&(T=T.replace(".","")),(M=T.search(/e/i))>0?(I<0&&(I=M),I+=+T.slice(M+1),T=T.substring(0,M)):I<0&&(I=T.length)}else{if(ye(g,2,w.length,"Base"),g==10&&$)return P=new E(b),F(P,i+P.e+1,c);if(T=String(b),y=typeof b=="number"){if(b*0!=0)return r(P,T,y,g);if(P.s=1/b<0?(T=T.slice(1),-1):1,E.DEBUG&&T.replace(/^0\.0*|\./,"").length>15)throw Error(Fu+b)}else P.s=T.charCodeAt(0)===45?(T=T.slice(1),-1):1;for(v=w.slice(0,g),I=M=0,A=T.length;M<A;M++)if(v.indexOf(C=T.charAt(M))<0){if(C=="."){if(M>I){I=A;continue}}else if(!O&&(T==T.toUpperCase()&&(T=T.toLowerCase())||T==T.toLowerCase()&&(T=T.toUpperCase()))){O=!0,M=-1,I=0;continue}return r(P,String(b),y,g)}y=!1,T=n(T,g,10,P.s),(I=T.indexOf("."))>-1?T=T.replace(".",""):I=T.length}for(M=0;T.charCodeAt(M)===48;M++);for(A=T.length;T.charCodeAt(--A)===48;);if(T=T.slice(M,++A)){if(A-=M,y&&E.DEBUG&&A>15&&(b>yi||b!==ot(b)))throw Error(Fu+P.s*b);if((I=I-M-1)>f)P.c=P.e=null;else if(I<l)P.c=[P.e=0];else{if(P.e=I,P.c=[],M=(I+1)%ne,I<0&&(M+=ne),M<A){for(M&&P.c.push(+T.slice(0,M)),A-=ne;M<A;)P.c.push(+T.slice(M,M+=ne));M=ne-(T=T.slice(M)).length}else M-=A;for(;M--;T+="0");P.c.push(+T)}}else P.c=[P.e=0]}E.clone=Du,E.ROUND_UP=0,E.ROUND_DOWN=1,E.ROUND_CEIL=2,E.ROUND_FLOOR=3,E.ROUND_HALF_UP=4,E.ROUND_HALF_DOWN=5,E.ROUND_HALF_EVEN=6,E.ROUND_HALF_CEIL=7,E.ROUND_HALF_FLOOR=8,E.EUCLID=9,E.config=E.set=function(b){var g,v;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(g="DECIMAL_PLACES")&&(v=b[g],ye(v,0,Oe,g),i=v),b.hasOwnProperty(g="ROUNDING_MODE")&&(v=b[g],ye(v,0,8,g),c=v),b.hasOwnProperty(g="EXPONENTIAL_AT")&&(v=b[g],v&&v.pop?(ye(v[0],-Oe,0,g),ye(v[1],0,Oe,g),a=v[0],u=v[1]):(ye(v,-Oe,Oe,g),a=-(u=v<0?-v:v))),b.hasOwnProperty(g="RANGE"))if(v=b[g],v&&v.pop)ye(v[0],-Oe,-1,g),ye(v[1],1,Oe,g),l=v[0],f=v[1];else if(ye(v,-Oe,Oe,g),v)l=-(f=v<0?-v:v);else throw Error(_e+g+" cannot be zero: "+v);if(b.hasOwnProperty(g="CRYPTO"))if(v=b[g],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=v;else throw p=!v,Error(_e+"crypto unavailable");else p=v;else throw Error(_e+g+" not true or false: "+v);if(b.hasOwnProperty(g="MODULO_MODE")&&(v=b[g],ye(v,0,9,g),d=v),b.hasOwnProperty(g="POW_PRECISION")&&(v=b[g],ye(v,0,Oe,g),h=v),b.hasOwnProperty(g="FORMAT"))if(v=b[g],typeof v=="object")m=v;else throw Error(_e+g+" not an object: "+v);if(b.hasOwnProperty(g="ALPHABET"))if(v=b[g],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))$=v.slice(0,10)=="0123456789",w=v;else throw Error(_e+g+" invalid: "+v)}else throw Error(_e+"Object expected: "+b);return{DECIMAL_PLACES:i,ROUNDING_MODE:c,EXPONENTIAL_AT:[a,u],RANGE:[l,f],CRYPTO:p,MODULO_MODE:d,POW_PRECISION:h,FORMAT:m,ALPHABET:w}},E.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!E.DEBUG)return!0;var g,v,C=b.c,O=b.e,I=b.s;e:if({}.toString.call(C)=="[object Array]"){if((I===1||I===-1)&&O>=-Oe&&O<=Oe&&O===ot(O)){if(C[0]===0){if(O===0&&C.length===1)return!0;break e}if(g=(O+1)%ne,g<1&&(g+=ne),String(C[0]).length==g){for(g=0;g<C.length;g++)if(v=C[g],v<0||v>=wt||v!==ot(v))break e;if(v!==0)return!0}}}else if(C===null&&O===null&&(I===null||I===1||I===-1))return!0;throw Error(_e+"Invalid BigNumber: "+b)},E.maximum=E.max=function(){return N(arguments,-1)},E.minimum=E.min=function(){return N(arguments,1)},E.random=function(){var b=9007199254740992,g=Math.random()*b&2097151?function(){return ot(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(v){var C,O,I,M,y,A=0,T=[],P=new E(s);if(v==null?v=i:ye(v,0,Oe),M=gi(v/ne),p)if(crypto.getRandomValues){for(C=crypto.getRandomValues(new Uint32Array(M*=2));A<M;)y=C[A]*131072+(C[A+1]>>>11),y>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),C[A]=O[0],C[A+1]=O[1]):(T.push(y%1e14),A+=2);A=M/2}else if(crypto.randomBytes){for(C=crypto.randomBytes(M*=7);A<M;)y=(C[A]&31)*281474976710656+C[A+1]*1099511627776+C[A+2]*4294967296+C[A+3]*16777216+(C[A+4]<<16)+(C[A+5]<<8)+C[A+6],y>=9e15?crypto.randomBytes(7).copy(C,A):(T.push(y%1e14),A+=7);A=M/7}else throw p=!1,Error(_e+"crypto unavailable");if(!p)for(;A<M;)y=g(),y<9e15&&(T[A++]=y%1e14);for(M=T[--A],v%=ne,M&&v&&(y=wi[ne-v],T[A]=ot(M/y)*y);T[A]===0;T.pop(),A--);if(A<0)T=[I=0];else{for(I=-1;T[0]===0;T.splice(0,1),I-=ne);for(A=1,y=T[0];y>=10;y/=10,A++);A<ne&&(I-=ne-A)}return P.e=I,P.c=T,P}}(),E.sum=function(){for(var b=1,g=arguments,v=new E(g[0]);b<g.length;)v=v.plus(g[b++]);return v},n=function(){var b="0123456789";function g(v,C,O,I){for(var M,y=[0],A,T=0,P=v.length;T<P;){for(A=y.length;A--;y[A]*=C);for(y[0]+=I.indexOf(v.charAt(T++)),M=0;M<y.length;M++)y[M]>O-1&&(y[M+1]==null&&(y[M+1]=0),y[M+1]+=y[M]/O|0,y[M]%=O)}return y.reverse()}return function(v,C,O,I,M){var y,A,T,P,L,j,z,_,W=v.indexOf("."),K=i,G=c;for(W>=0&&(P=h,h=0,v=v.replace(".",""),_=new E(C),j=_.pow(v.length-W),h=P,_.c=g(Vt(it(j.c),j.e,"0"),10,O,b),_.e=_.c.length),z=g(v,C,O,M?(y=w,b):(y=b,w)),T=P=z.length;z[--P]==0;z.pop());if(!z[0])return y.charAt(0);if(W<0?--T:(j.c=z,j.e=T,j.s=I,j=t(j,_,K,G,O),z=j.c,L=j.r,T=j.e),A=T+K+1,W=z[A],P=O/2,L=L||A<0||z[A+1]!=null,L=G<4?(W!=null||L)&&(G==0||G==(j.s<0?3:2)):W>P||W==P&&(G==4||L||G==6&&z[A-1]&1||G==(j.s<0?8:7)),A<1||!z[0])v=L?Vt(y.charAt(1),-K,y.charAt(0)):y.charAt(0);else{if(z.length=A,L)for(--O;++z[--A]>O;)z[A]=0,A||(++T,z=[1].concat(z));for(P=z.length;!z[--P];);for(W=0,v="";W<=P;v+=y.charAt(z[W++]));v=Vt(v,T,y.charAt(0))}return v}}(),t=function(){function b(C,O,I){var M,y,A,T,P=0,L=C.length,j=O%fn,z=O/fn|0;for(C=C.slice();L--;)A=C[L]%fn,T=C[L]/fn|0,M=z*A+T*j,y=j*A+M%fn*fn+P,P=(y/I|0)+(M/fn|0)+z*T,C[L]=y%I;return P&&(C=[P].concat(C)),C}function g(C,O,I,M){var y,A;if(I!=M)A=I>M?1:-1;else for(y=A=0;y<I;y++)if(C[y]!=O[y]){A=C[y]>O[y]?1:-1;break}return A}function v(C,O,I,M){for(var y=0;I--;)C[I]-=y,y=C[I]<O[I]?1:0,C[I]=y*M+C[I]-O[I];for(;!C[0]&&C.length>1;C.splice(0,1));}return function(C,O,I,M,y){var A,T,P,L,j,z,_,W,K,G,H,Z,J,oe,me,ge,de,se=C.s==O.s?1:-1,pe=C.c,ee=O.c;if(!pe||!pe[0]||!ee||!ee[0])return new E(!C.s||!O.s||(pe?ee&&pe[0]==ee[0]:!ee)?NaN:pe&&pe[0]==0||!ee?se*0:se/0);for(W=new E(se),K=W.c=[],T=C.e-O.e,se=I+T+1,y||(y=wt,T=st(C.e/ne)-st(O.e/ne),se=se/ne|0),P=0;ee[P]==(pe[P]||0);P++);if(ee[P]>(pe[P]||0)&&T--,se<0)K.push(1),L=!0;else{for(oe=pe.length,ge=ee.length,P=0,se+=2,j=ot(y/(ee[0]+1)),j>1&&(ee=b(ee,j,y),pe=b(pe,j,y),ge=ee.length,oe=pe.length),J=ge,G=pe.slice(0,ge),H=G.length;H<ge;G[H++]=0);de=ee.slice(),de=[0].concat(de),me=ee[0],ee[1]>=y/2&&me++;do{if(j=0,A=g(ee,G,ge,H),A<0){if(Z=G[0],ge!=H&&(Z=Z*y+(G[1]||0)),j=ot(Z/me),j>1)for(j>=y&&(j=y-1),z=b(ee,j,y),_=z.length,H=G.length;g(z,G,_,H)==1;)j--,v(z,ge<_?de:ee,_,y),_=z.length,A=1;else j==0&&(A=j=1),z=ee.slice(),_=z.length;if(_<H&&(z=[0].concat(z)),v(G,z,H,y),H=G.length,A==-1)for(;g(ee,G,ge,H)<1;)j++,v(G,ge<H?de:ee,H,y),H=G.length}else A===0&&(j++,G=[0]);K[P++]=j,G[0]?G[H++]=pe[J]||0:(G=[pe[J]],H=1)}while((J++<oe||G[0]!=null)&&se--);L=G[0]!=null,K[0]||K.splice(0,1)}if(y==wt){for(P=1,se=K[0];se>=10;se/=10,P++);F(W,I+(W.e=P+T*ne-1)+1,M,L)}else W.e=T,W.r=+L;return W}}();function S(b,g,v,C){var O,I,M,y,A;if(v==null?v=c:ye(v,0,8),!b.c)return b.toString();if(O=b.c[0],M=b.e,g==null)A=it(b.c),A=C==1||C==2&&(M<=a||M>=u)?Yo(A,M):Vt(A,M,"0");else if(b=F(new E(b),g,v),I=b.e,A=it(b.c),y=A.length,C==1||C==2&&(g<=I||I<=a)){for(;y<g;A+="0",y++);A=Yo(A,I)}else if(g-=M+(C===2&&I>M),A=Vt(A,I,"0"),I+1>y){if(--g>0)for(A+=".";g--;A+="0");}else if(g+=I-y,g>0)for(I+1==y&&(A+=".");g--;A+="0");return b.s<0&&O?"-"+A:A}function N(b,g){for(var v,C,O=1,I=new E(b[0]);O<b.length;O++)C=new E(b[O]),(!C.s||(v=Cn(I,C))===g||v===0&&I.s===g)&&(I=C);return I}function B(b,g,v){for(var C=1,O=g.length;!g[--O];g.pop());for(O=g[0];O>=10;O/=10,C++);return(v=C+v*ne-1)>f?b.c=b.e=null:v<l?b.c=[b.e=0]:(b.e=v,b.c=g),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,v=/^\.([^.]+)$/,C=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(I,M,y,A){var T,P=y?M:M.replace(O,"");if(C.test(P))I.s=isNaN(P)?null:P<0?-1:1;else{if(!y&&(P=P.replace(b,function(L,j,z){return T=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!A||A==T?j:L}),A&&(T=A,P=P.replace(g,"$1").replace(v,"0.$1")),M!=P))return new E(P,T);if(E.DEBUG)throw Error(_e+"Not a"+(A?" base "+A:"")+" number: "+M);I.s=null}I.c=I.e=null}}();function F(b,g,v,C){var O,I,M,y,A,T,P,L=b.c,j=wi;if(L){e:{for(O=1,y=L[0];y>=10;y/=10,O++);if(I=g-O,I<0)I+=ne,M=g,A=L[T=0],P=ot(A/j[O-M-1]%10);else if(T=gi((I+1)/ne),T>=L.length)if(C){for(;L.length<=T;L.push(0));A=P=0,O=1,I%=ne,M=I-ne+1}else break e;else{for(A=y=L[T],O=1;y>=10;y/=10,O++);I%=ne,M=I-ne+O,P=M<0?0:ot(A/j[O-M-1]%10)}if(C=C||g<0||L[T+1]!=null||(M<0?A:A%j[O-M-1]),C=v<4?(P||C)&&(v==0||v==(b.s<0?3:2)):P>5||P==5&&(v==4||C||v==6&&(I>0?M>0?A/j[O-M]:0:L[T-1])%10&1||v==(b.s<0?8:7)),g<1||!L[0])return L.length=0,C?(g-=b.e+1,L[0]=j[(ne-g%ne)%ne],b.e=-g||0):L[0]=b.e=0,b;if(I==0?(L.length=T,y=1,T--):(L.length=T+1,y=j[ne-I],L[T]=M>0?ot(A/j[O-M]%j[M])*y:0),C)for(;;)if(T==0){for(I=1,M=L[0];M>=10;M/=10,I++);for(M=L[0]+=y,y=1;M>=10;M/=10,y++);I!=y&&(b.e++,L[0]==wt&&(L[0]=1));break}else{if(L[T]+=y,L[T]!=wt)break;L[T--]=0,y=1}for(I=L.length;L[--I]===0;L.pop());}b.e>f?b.c=b.e=null:b.e<l&&(b.c=[b.e=0])}return b}function D(b){var g,v=b.e;return v===null?b.toString():(g=it(b.c),g=v<=a||v>=u?Yo(g,v):Vt(g,v,"0"),b.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var b=new E(this);return b.s<0&&(b.s=1),b},o.comparedTo=function(b,g){return Cn(this,new E(b,g))},o.decimalPlaces=o.dp=function(b,g){var v,C,O,I=this;if(b!=null)return ye(b,0,Oe),g==null?g=c:ye(g,0,8),F(new E(I),b+I.e+1,g);if(!(v=I.c))return null;if(C=((O=v.length-1)-st(this.e/ne))*ne,O=v[O])for(;O%10==0;O/=10,C--);return C<0&&(C=0),C},o.dividedBy=o.div=function(b,g){return t(this,new E(b,g),i,c)},o.dividedToIntegerBy=o.idiv=function(b,g){return t(this,new E(b,g),0,1)},o.exponentiatedBy=o.pow=function(b,g){var v,C,O,I,M,y,A,T,P,L=this;if(b=new E(b),b.c&&!b.isInteger())throw Error(_e+"Exponent not an integer: "+D(b));if(g!=null&&(g=new E(g)),y=b.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!b.c||!b.c[0])return P=new E(Math.pow(+D(L),y?b.s*(2-Zo(b)):+D(b))),g?P.mod(g):P;if(A=b.s<0,g){if(g.c?!g.c[0]:!g.s)return new E(NaN);C=!A&&L.isInteger()&&g.isInteger(),C&&(L=L.mod(g))}else{if(b.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||y&&L.c[1]>=24e7:L.c[0]<8e13||y&&L.c[0]<=9999975e7)))return I=L.s<0&&Zo(b)?-0:0,L.e>-1&&(I=1/I),new E(A?1/I:I);h&&(I=gi(h/ne+2))}for(y?(v=new E(.5),A&&(b.s=1),T=Zo(b)):(O=Math.abs(+D(b)),T=O%2),P=new E(s);;){if(T){if(P=P.times(L),!P.c)break;I?P.c.length>I&&(P.c.length=I):C&&(P=P.mod(g))}if(O){if(O=ot(O/2),O===0)break;T=O%2}else if(b=b.times(v),F(b,b.e+1,1),b.e>14)T=Zo(b);else{if(O=+D(b),O===0)break;T=O%2}L=L.times(L),I?L.c&&L.c.length>I&&(L.c.length=I):C&&(L=L.mod(g))}return C?P:(A&&(P=s.div(P)),g?P.mod(g):I?F(P,h,c,M):P)},o.integerValue=function(b){var g=new E(this);return b==null?b=c:ye(b,0,8),F(g,g.e+1,b)},o.isEqualTo=o.eq=function(b,g){return Cn(this,new E(b,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,g){return Cn(this,new E(b,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,g){return(g=Cn(this,new E(b,g)))===1||g===0},o.isInteger=function(){return!!this.c&&st(this.e/ne)>this.c.length-2},o.isLessThan=o.lt=function(b,g){return Cn(this,new E(b,g))<0},o.isLessThanOrEqualTo=o.lte=function(b,g){return(g=Cn(this,new E(b,g)))===-1||g===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(b,g){var v,C,O,I,M=this,y=M.s;if(b=new E(b,g),g=b.s,!y||!g)return new E(NaN);if(y!=g)return b.s=-g,M.plus(b);var A=M.e/ne,T=b.e/ne,P=M.c,L=b.c;if(!A||!T){if(!P||!L)return P?(b.s=-g,b):new E(L?M:NaN);if(!P[0]||!L[0])return L[0]?(b.s=-g,b):new E(P[0]?M:c==3?-0:0)}if(A=st(A),T=st(T),P=P.slice(),y=A-T){for((I=y<0)?(y=-y,O=P):(T=A,O=L),O.reverse(),g=y;g--;O.push(0));O.reverse()}else for(C=(I=(y=P.length)<(g=L.length))?y:g,y=g=0;g<C;g++)if(P[g]!=L[g]){I=P[g]<L[g];break}if(I&&(O=P,P=L,L=O,b.s=-b.s),g=(C=L.length)-(v=P.length),g>0)for(;g--;P[v++]=0);for(g=wt-1;C>y;){if(P[--C]<L[C]){for(v=C;v&&!P[--v];P[v]=g);--P[v],P[C]+=wt}P[C]-=L[C]}for(;P[0]==0;P.splice(0,1),--T);return P[0]?B(b,P,T):(b.s=c==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,g){var v,C,O=this;return b=new E(b,g),!O.c||!b.s||b.c&&!b.c[0]?new E(NaN):!b.c||O.c&&!O.c[0]?new E(O):(d==9?(C=b.s,b.s=1,v=t(O,b,0,3),b.s=C,v.s*=C):v=t(O,b,0,d),b=O.minus(v.times(b)),!b.c[0]&&d==1&&(b.s=O.s),b)},o.multipliedBy=o.times=function(b,g){var v,C,O,I,M,y,A,T,P,L,j,z,_,W,K,G=this,H=G.c,Z=(b=new E(b,g)).c;if(!H||!Z||!H[0]||!Z[0])return!G.s||!b.s||H&&!H[0]&&!Z||Z&&!Z[0]&&!H?b.c=b.e=b.s=null:(b.s*=G.s,!H||!Z?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(C=st(G.e/ne)+st(b.e/ne),b.s*=G.s,A=H.length,L=Z.length,A<L&&(_=H,H=Z,Z=_,O=A,A=L,L=O),O=A+L,_=[];O--;_.push(0));for(W=wt,K=fn,O=L;--O>=0;){for(v=0,j=Z[O]%K,z=Z[O]/K|0,M=A,I=O+M;I>O;)T=H[--M]%K,P=H[M]/K|0,y=z*T+P*j,T=j*T+y%K*K+_[I]+v,v=(T/W|0)+(y/K|0)+z*P,_[I--]=T%W;_[I]=v}return v?++C:_.splice(0,1),B(b,_,C)},o.negated=function(){var b=new E(this);return b.s=-b.s||null,b},o.plus=function(b,g){var v,C=this,O=C.s;if(b=new E(b,g),g=b.s,!O||!g)return new E(NaN);if(O!=g)return b.s=-g,C.minus(b);var I=C.e/ne,M=b.e/ne,y=C.c,A=b.c;if(!I||!M){if(!y||!A)return new E(O/0);if(!y[0]||!A[0])return A[0]?b:new E(y[0]?C:O*0)}if(I=st(I),M=st(M),y=y.slice(),O=I-M){for(O>0?(M=I,v=A):(O=-O,v=y),v.reverse();O--;v.push(0));v.reverse()}for(O=y.length,g=A.length,O-g<0&&(v=A,A=y,y=v,g=O),O=0;g;)O=(y[--g]=y[g]+A[g]+O)/wt|0,y[g]=wt===y[g]?0:y[g]%wt;return O&&(y=[O].concat(y),++M),B(b,y,M)},o.precision=o.sd=function(b,g){var v,C,O,I=this;if(b!=null&&b!==!!b)return ye(b,1,Oe),g==null?g=c:ye(g,0,8),F(new E(I),b,g);if(!(v=I.c))return null;if(O=v.length-1,C=O*ne+1,O=v[O]){for(;O%10==0;O/=10,C--);for(O=v[0];O>=10;O/=10,C++);}return b&&I.e+1>C&&(C=I.e+1),C},o.shiftedBy=function(b){return ye(b,-yi,yi),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,g,v,C,O,I=this,M=I.c,y=I.s,A=I.e,T=i+4,P=new E("0.5");if(y!==1||!M||!M[0])return new E(!y||y<0&&(!M||M[0])?NaN:M?I:1/0);if(y=Math.sqrt(+D(I)),y==0||y==1/0?(g=it(M),(g.length+A)%2==0&&(g+="0"),y=Math.sqrt(+g),A=st((A+1)/2)-(A<0||A%2),y==1/0?g="5e"+A:(g=y.toExponential(),g=g.slice(0,g.indexOf("e")+1)+A),v=new E(g)):v=new E(y+""),v.c[0]){for(A=v.e,y=A+T,y<3&&(y=0);;)if(O=v,v=P.times(O.plus(t(I,O,T,1))),it(O.c).slice(0,y)===(g=it(v.c)).slice(0,y))if(v.e<A&&--y,g=g.slice(y-3,y+1),g=="9999"||!C&&g=="4999"){if(!C&&(F(O,O.e+i+2,0),O.times(O).eq(I))){v=O;break}T+=4,y+=4,C=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(F(v,v.e+i+2,1),b=!v.times(v).eq(I));break}}return F(v,v.e+i+1,c,b)},o.toExponential=function(b,g){return b!=null&&(ye(b,0,Oe),b++),S(this,b,g,1)},o.toFixed=function(b,g){return b!=null&&(ye(b,0,Oe),b=b+this.e+1),S(this,b,g)},o.toFormat=function(b,g,v){var C,O=this;if(v==null)b!=null&&g&&typeof g=="object"?(v=g,g=null):b&&typeof b=="object"?(v=b,b=g=null):v=m;else if(typeof v!="object")throw Error(_e+"Argument not an object: "+v);if(C=O.toFixed(b,g),O.c){var I,M=C.split("."),y=+v.groupSize,A=+v.secondaryGroupSize,T=v.groupSeparator||"",P=M[0],L=M[1],j=O.s<0,z=j?P.slice(1):P,_=z.length;if(A&&(I=y,y=A,A=I,_-=I),y>0&&_>0){for(I=_%y||y,P=z.substr(0,I);I<_;I+=y)P+=T+z.substr(I,y);A>0&&(P+=T+z.slice(I)),j&&(P="-"+P)}C=L?P+(v.decimalSeparator||"")+((A=+v.fractionGroupSize)?L.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(v.fractionGroupSeparator||"")):L):P}return(v.prefix||"")+C+(v.suffix||"")},o.toFraction=function(b){var g,v,C,O,I,M,y,A,T,P,L,j,z=this,_=z.c;if(b!=null&&(y=new E(b),!y.isInteger()&&(y.c||y.s!==1)||y.lt(s)))throw Error(_e+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+D(y));if(!_)return new E(z);for(g=new E(s),T=v=new E(s),C=A=new E(s),j=it(_),I=g.e=j.length-z.e-1,g.c[0]=wi[(M=I%ne)<0?ne+M:M],b=!b||y.comparedTo(g)>0?I>0?g:T:y,M=f,f=1/0,y=new E(j),A.c[0]=0;P=t(y,g,0,1),O=v.plus(P.times(C)),O.comparedTo(b)!=1;)v=C,C=O,T=A.plus(P.times(O=T)),A=O,g=y.minus(P.times(O=g)),y=O;return O=t(b.minus(v),C,0,1),A=A.plus(O.times(T)),v=v.plus(O.times(C)),A.s=T.s=z.s,I=I*2,L=t(T,C,I,c).minus(z).abs().comparedTo(t(A,v,I,c).minus(z).abs())<1?[T,C]:[A,v],f=M,L},o.toNumber=function(){return+D(this)},o.toPrecision=function(b,g){return b!=null&&ye(b,1,Oe),S(this,b,g,2)},o.toString=function(b){var g,v=this,C=v.s,O=v.e;return O===null?C?(g="Infinity",C<0&&(g="-"+g)):g="NaN":(b==null?g=O<=a||O>=u?Yo(it(v.c),O):Vt(it(v.c),O,"0"):b===10&&$?(v=F(new E(v),i+O+1,c),g=Vt(it(v.c),v.e,"0")):(ye(b,2,w.length,"Base"),g=n(Vt(it(v.c),O,"0"),10,b,C,!0)),C<0&&v.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return D(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&E.set(e),E}function st(e){var t=e|0;return e>0||e===t?t:t-1}function it(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ne-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Cn(e,t){var n,r,o=e.c,s=t.c,i=e.s,c=t.s,a=e.e,u=t.e;if(!i||!c)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-c:i;if(i!=c)return i;if(n=i<0,r=a==u,!o||!s)return r?0:!o^n?1:-1;if(!r)return a>u^n?1:-1;for(c=(a=o.length)<(u=s.length)?a:u,i=0;i<c;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return a==u?0:a>u^n?1:-1}function ye(e,t,n,r){if(e<t||e>n||e!==ot(e))throw Error(_e+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Zo(e){var t=e.c.length-1;return st(e.e/ne)==t&&e.c[t]%2!=0}function Yo(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Vt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Ie=Du();const Zm=(e,t=6)=>{try{const n=new Ie(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Ie.ROUND_DOWN),[o,s=""]=r.toString().split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const c=(s||"").padEnd(t,"0");return`${i}.${c}`}return i}catch(n){return console.warn("formatThousands error:",n),"0"}},vt=()=>{const{translations:e,currentLocale:t}=Lu();return{t:(s,i)=>{try{const c=s.split(".");let a=e;for(const l of c)if(a&&typeof a=="object"&&l in a)a=a[l];else return s;let u=typeof a=="string"?a:s;return i&&typeof u=="string"&&Object.keys(i).forEach(l=>{const f=`{{${l}}}`;u=u.replace(new RegExp(f,"g"),String(i[l]))}),u}catch(c){return console.warn(`Translation error for key "${s}":`,c),s}},translations:e,locale:t,getTranslationObject:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return{};return typeof c=="object"?c:{}}catch(i){return console.warn(`Translation object error for key "${s}":`,i),{}}},hasTranslation:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return!1;return typeof c=="string"}catch{return!1}}}},Ym="1.1.0";let Ue=class Ou extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Ou?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Ou&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Ym}`].join(`
|
|
43
|
-
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Gt(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Ru=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,ju=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,_u=/^\(.+?\).*?$/,Uu=/^tuple(?<array>(\[(\d*)\])*)$/;function vi(e){let t=e.type;if(Uu.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=vi(s),o<n-1&&(t+=", ")}const r=Gt(Uu,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,vi({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function er(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=vi(o),r!==n-1&&(t+=", ")}return t}function Ko(e){var t;return e.type==="function"?`function ${e.name}(${er(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${er(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${er(e.inputs)})`:e.type==="error"?`error ${e.name}(${er(e.inputs)})`:e.type==="constructor"?`constructor(${er(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const zu=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Km(e){return zu.test(e)}function Xm(e){return Gt(zu,e)}const Hu=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Qm(e){return Hu.test(e)}function Jm(e){return Gt(Hu,e)}const Wu=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function eb(e){return Wu.test(e)}function tb(e){return Gt(Wu,e)}const Vu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Xo(e){return Vu.test(e)}function nb(e){return Gt(Vu,e)}const Gu=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function rb(e){return Gu.test(e)}function ob(e){return Gt(Gu,e)}const qu=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function sb(e){return qu.test(e)}function ib(e){return Gt(qu,e)}const ab=/^receive\(\) external payable$/;function cb(e){return ab.test(e)}const Zu=new Set(["memory","indexed","storage","calldata"]),ub=new Set(["indexed"]),xi=new Set(["calldata","memory","storage"]);class lb extends Ue{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class fb extends Ue{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class db extends Ue{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class pb extends Ue{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class hb extends Ue{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class mb extends Ue{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class bb extends Ue{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class gb extends Ue{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class yb extends Ue{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class tr extends Ue{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class wb extends Ue{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class vb extends Ue{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class xb extends Ue{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Eb extends Ue{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Sb(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:e}const Ei=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Si(e,t={}){if(eb(e))return Pb(e,t);if(Qm(e))return $b(e,t);if(Km(e))return Tb(e,t);if(rb(e))return Ab(e,t);if(sb(e))return Ob(e);if(cb(e))return{type:"receive",stateMutability:"payable"};throw new wb({signature:e})}function Pb(e,t={}){const n=tb(e);if(!n)throw new tr({signature:e,type:"function"});const r=Qe(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(qt(r[c],{modifiers:xi,structs:t,type:"function"}));const i=[];if(n.returns){const c=Qe(n.returns),a=c.length;for(let u=0;u<a;u++)i.push(qt(c[u],{modifiers:xi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function $b(e,t={}){const n=Jm(e);if(!n)throw new tr({signature:e,type:"event"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{modifiers:ub,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Tb(e,t={}){const n=Xm(e);if(!n)throw new tr({signature:e,type:"error"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Ab(e,t={}){const n=ob(e);if(!n)throw new tr({signature:e,type:"constructor"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function Ob(e){const t=ib(e);if(!t)throw new tr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Nb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Cb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ib=/^u?int$/;function qt(e,t){var f,p;const n=Sb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Ei.has(n))return Ei.get(n);const r=_u.test(e),o=Gt(r?Cb:Nb,e);if(!o)throw new hb({param:e});if(o.name&&kb(o.name))throw new mb({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},c=(t==null?void 0:t.structs)??{};let a,u={};if(r){a="tuple";const d=Qe(o.type),h=[],m=d.length;for(let w=0;w<m;w++)h.push(qt(d[w],{structs:c}));u={components:h}}else if(o.type in c)a="tuple",u={components:c[o.type]};else if(Ib.test(o.type))a=`${o.type}256`;else if(o.type==="address payable")a="address";else if(a=o.type,(t==null?void 0:t.type)!=="struct"&&!Yu(a))throw new db({type:a});if(o.modifier){if(!((p=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&p.call(f,o.modifier)))throw new bb({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(xi.has(o.modifier)&&!Bb(a,!!o.array))throw new gb({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const l={type:`${a}${o.array??""}`,...s,...i,...u};return Ei.set(n,l),l}function Qe(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],c=e.slice(s+1);switch(i){case",":return r===0?Qe(c,[...t,n.trim()]):Qe(c,t,`${n}${i}`,r);case"(":return Qe(c,t,`${n}${i}`,r+1);case")":return Qe(c,t,`${n}${i}`,r-1);default:return Qe(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Eb({current:n,depth:r});return t.push(n.trim()),t}function Yu(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Ru.test(e)||ju.test(e)}const Mb=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function kb(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Ru.test(e)||ju.test(e)||Mb.test(e)}function Bb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Pi(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!Xo(c))continue;const a=nb(c);if(!a)throw new tr({signature:c,type:"struct"});const u=a.properties.split(";"),l=[],f=u.length;for(let p=0;p<f;p++){const h=u[p].trim();if(!h)continue;const m=qt(h,{type:"struct"});l.push(m)}if(!l.length)throw new vb({signature:c});t[a.name]=l}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[c,a]=o[i];r[c]=Ku(a,t)}return r}const Lb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Ku(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(_u.test(i.type))r.push(i);else{const a=Gt(Lb,i.type);if(!(a!=null&&a.type))throw new yb({abiParameter:i});const{array:u,type:l}=a;if(l in t){if(n.has(l))throw new xb({type:l});r.push({...i,type:`tuple${u??""}`,components:Ku(t[l]??[],t,new Set([...n,l]))})}else if(Yu(l))r.push(i);else throw new fb({type:l})}}return r}function Xu(e){const t=Pi(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];Xo(s)||n.push(Si(s,t))}return n}function Qu(e){let t;if(typeof e=="string")t=Si(e);else{const n=Pi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!Xo(s)){t=Si(s,n);break}}}if(!t)throw new lb({signature:e});return t}function Ju(e){const t=[];if(typeof e=="string"){const n=Qe(e),r=n.length;for(let o=0;o<r;o++)t.push(qt(n[o],{modifiers:Zu}))}else{const n=Pi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(Xo(s))continue;const i=Qe(s),c=i.length;for(let a=0;a<c;a++)t.push(qt(i[a],{modifiers:Zu,structs:n}))}}if(t.length===0)throw new pb({params:e});return t}function X(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}function xt(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Yb(e.type);return`${e.name}(${Qo(e.inputs,{includeName:t})})`}function Qo(e,{includeName:t=!1}={}){return e?e.map(n=>Fb(n,{includeName:t})).join(t?", ":","):""}function Fb(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Qo(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Et(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function we(e){return Et(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const el="2.42.1";let Dr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${el}`},V=class Nu extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof Nu?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Nu&&n.cause.docsPath||n.docsPath,s=(c=Dr.getDocsUrl)==null?void 0:c.call(Dr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Dr.version?[`Version: ${Dr.version}`]:[]].join(`
|
|
44
|
-
`);super(i,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=
|
|
45
|
-
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class
|
|
46
|
-
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class
|
|
47
|
-
`),{metaMessages:[`Params: (${Qo(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Rr extends V{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class
|
|
48
|
-
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class
|
|
49
|
-
`),{name:"AbiEncodingLengthMismatchError"})}}class
|
|
50
|
-
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class
|
|
51
|
-
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class
|
|
52
|
-
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class
|
|
53
|
-
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class
|
|
50
|
+
跨鏈充值需由您承擔 Edge 網路手續費。到帳金額會略小於您的充值金額。`,addressUpdatedNotice:"注意:充值地址已更新,請改用新地址。原地址僅在過渡期內有效,之後將停用。若已在其他平台儲存,請儘速更新。",enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"資金約在 {{v}} 分鐘內(達到 {{v1}} 個區塊確認後)到賬。",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",availableDesc:"您可以充值的最大金額。當可用餘額為0或負數時,無法進行充值。",noPrivateKeyWalletWarning:"請勿使用無私鑰錢包進行充值,無私鑰錢包充值會導致資金損失且無法追回。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositTipExceedPool:"由於充值資金大於資金池,將透過 LayerZero 完成您的充值。",layerZeroDepositTipGte200k:"由於充值資金大於等於 200,000 USDT,將透過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"預設充值至現貨帳戶",defaultSpotToPerpNotice:"僅支援發送 {{coin}} ({{v}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。"},withdraw:{noticeDesc:"普通提現是一個兩步過程。此步驟將發起您的提現請求,並將在 Layer2 進行處理。一旦資金準備就緒(可能需要最多 4 小時),您將收到一條將資金提現到錢包的通知。受鏈同步等情況影響下,時長可能需要長達 48 小時。您需要自行承擔交易 gas 費用。",crossChainTips:"跨鏈提幣需在 L2(通過零知識證明)進行驗證。提幣過程最多約需2小時。相關鏈的資產池中需有充足的資金來處理跨鏈提幣,其間還將產生礦工費。 edgeX 將收取一定的手續費作爲礦工費。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",feeRate:"費率",withdrawlAmount:"提現金額",amountToReceive:"到账金額",minWithdraw:"最小提現金額",minWithdrawParsed:"最小提現 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能為空",availableDesc:"您可以提現的最大金額。當可用餘額為0或負數時,無法進行提現。",feeCalculationTip:"提現手續費按照提現金額乘以費率計算,最低為 1 USDT/USDC。費率會根據鏈上實際情況進行調整。",crossChainPoolBalance:"跨鏈資金池餘額",poolBalance:"資金池餘額",poolBalanceInsufficientTip:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。"},account:{title:"帳戶",perpetual:"合約帳戶",spot:"現貨帳戶"}},bi=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],Dl={"en-US":jm,"ja-JP":Wm,"ru-RU":Hm,"zh-CN":Vm,"zh-TW":Gm,"de-DE":Rm,"es-LA":_m,"fr-FR":zm,"it-IT":Um},qo="en-US",qm={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский","de-DE":"Deutsch","es-LA":"Español (Latinoamérica)","fr-FR":"Français","it-IT":"Italiano"},Zm=e=>bi.includes(e)?Dl[e]:Dl[qo],Km=e=>bi.includes(e),Ml=x.createContext(null),Ym=({config:e,children:t})=>{const n=x.useMemo(()=>{const r=e.locale||qo,o=Km(r)?r:qo,s=Zm(o);return{...e,currentLocale:o,translations:s}},[e]);return D.jsx(Ml.Provider,{value:n,children:t})},Ll=()=>{const e=x.useContext(Ml);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var Xm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,gi=Math.ceil,ot=Math.floor,_e="[BigNumber Error] ",Bl=_e+"Number primitive has more than 15 significant digits: ",vt=1e14,ne=14,yi=9007199254740991,vi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],fn=1e7,Ne=1e9;function Fl(e){var t,n,r,o=E.prototype={constructor:E,toString:null,valueOf:null},s=new E(1),i=20,c=4,a=-7,l=21,u=-1e7,f=1e7,p=!1,d=1,h=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},v="0123456789abcdefghijklmnopqrstuvwxyz",T=!0;function E(b,g){var w,O,N,I,k,y,$,A,P=this;if(!(P instanceof E))return new E(b,g);if(g==null){if(b&&b._isBigNumber===!0){P.s=b.s,!b.c||b.e>f?P.c=P.e=null:b.e<u?P.c=[P.e=0]:(P.e=b.e,P.c=b.c.slice());return}if((y=typeof b=="number")&&b*0==0){if(P.s=1/b<0?(b=-b,-1):1,b===~~b){for(I=0,k=b;k>=10;k/=10,I++);I>f?P.c=P.e=null:(P.e=I,P.c=[b]);return}A=String(b)}else{if(!Xm.test(A=String(b)))return r(P,A,y);P.s=A.charCodeAt(0)==45?(A=A.slice(1),-1):1}(I=A.indexOf("."))>-1&&(A=A.replace(".","")),(k=A.search(/e/i))>0?(I<0&&(I=k),I+=+A.slice(k+1),A=A.substring(0,k)):I<0&&(I=A.length)}else{if(ye(g,2,v.length,"Base"),g==10&&T)return P=new E(b),B(P,i+P.e+1,c);if(A=String(b),y=typeof b=="number"){if(b*0!=0)return r(P,A,y,g);if(P.s=1/b<0?(A=A.slice(1),-1):1,E.DEBUG&&A.replace(/^0\.0*|\./,"").length>15)throw Error(Bl+b)}else P.s=A.charCodeAt(0)===45?(A=A.slice(1),-1):1;for(w=v.slice(0,g),I=k=0,$=A.length;k<$;k++)if(w.indexOf(O=A.charAt(k))<0){if(O=="."){if(k>I){I=$;continue}}else if(!N&&(A==A.toUpperCase()&&(A=A.toLowerCase())||A==A.toLowerCase()&&(A=A.toUpperCase()))){N=!0,k=-1,I=0;continue}return r(P,String(b),y,g)}y=!1,A=n(A,g,10,P.s),(I=A.indexOf("."))>-1?A=A.replace(".",""):I=A.length}for(k=0;A.charCodeAt(k)===48;k++);for($=A.length;A.charCodeAt(--$)===48;);if(A=A.slice(k,++$)){if($-=k,y&&E.DEBUG&&$>15&&(b>yi||b!==ot(b)))throw Error(Bl+P.s*b);if((I=I-k-1)>f)P.c=P.e=null;else if(I<u)P.c=[P.e=0];else{if(P.e=I,P.c=[],k=(I+1)%ne,I<0&&(k+=ne),k<$){for(k&&P.c.push(+A.slice(0,k)),$-=ne;k<$;)P.c.push(+A.slice(k,k+=ne));k=ne-(A=A.slice(k)).length}else k-=$;for(;k--;A+="0");P.c.push(+A)}}else P.c=[P.e=0]}E.clone=Fl,E.ROUND_UP=0,E.ROUND_DOWN=1,E.ROUND_CEIL=2,E.ROUND_FLOOR=3,E.ROUND_HALF_UP=4,E.ROUND_HALF_DOWN=5,E.ROUND_HALF_EVEN=6,E.ROUND_HALF_CEIL=7,E.ROUND_HALF_FLOOR=8,E.EUCLID=9,E.config=E.set=function(b){var g,w;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(g="DECIMAL_PLACES")&&(w=b[g],ye(w,0,Ne,g),i=w),b.hasOwnProperty(g="ROUNDING_MODE")&&(w=b[g],ye(w,0,8,g),c=w),b.hasOwnProperty(g="EXPONENTIAL_AT")&&(w=b[g],w&&w.pop?(ye(w[0],-Ne,0,g),ye(w[1],0,Ne,g),a=w[0],l=w[1]):(ye(w,-Ne,Ne,g),a=-(l=w<0?-w:w))),b.hasOwnProperty(g="RANGE"))if(w=b[g],w&&w.pop)ye(w[0],-Ne,-1,g),ye(w[1],1,Ne,g),u=w[0],f=w[1];else if(ye(w,-Ne,Ne,g),w)u=-(f=w<0?-w:w);else throw Error(_e+g+" cannot be zero: "+w);if(b.hasOwnProperty(g="CRYPTO"))if(w=b[g],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=w;else throw p=!w,Error(_e+"crypto unavailable");else p=w;else throw Error(_e+g+" not true or false: "+w);if(b.hasOwnProperty(g="MODULO_MODE")&&(w=b[g],ye(w,0,9,g),d=w),b.hasOwnProperty(g="POW_PRECISION")&&(w=b[g],ye(w,0,Ne,g),h=w),b.hasOwnProperty(g="FORMAT"))if(w=b[g],typeof w=="object")m=w;else throw Error(_e+g+" not an object: "+w);if(b.hasOwnProperty(g="ALPHABET"))if(w=b[g],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))T=w.slice(0,10)=="0123456789",v=w;else throw Error(_e+g+" invalid: "+w)}else throw Error(_e+"Object expected: "+b);return{DECIMAL_PLACES:i,ROUNDING_MODE:c,EXPONENTIAL_AT:[a,l],RANGE:[u,f],CRYPTO:p,MODULO_MODE:d,POW_PRECISION:h,FORMAT:m,ALPHABET:v}},E.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!E.DEBUG)return!0;var g,w,O=b.c,N=b.e,I=b.s;e:if({}.toString.call(O)=="[object Array]"){if((I===1||I===-1)&&N>=-Ne&&N<=Ne&&N===ot(N)){if(O[0]===0){if(N===0&&O.length===1)return!0;break e}if(g=(N+1)%ne,g<1&&(g+=ne),String(O[0]).length==g){for(g=0;g<O.length;g++)if(w=O[g],w<0||w>=vt||w!==ot(w))break e;if(w!==0)return!0}}}else if(O===null&&N===null&&(I===null||I===1||I===-1))return!0;throw Error(_e+"Invalid BigNumber: "+b)},E.maximum=E.max=function(){return C(arguments,-1)},E.minimum=E.min=function(){return C(arguments,1)},E.random=function(){var b=9007199254740992,g=Math.random()*b&2097151?function(){return ot(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var O,N,I,k,y,$=0,A=[],P=new E(s);if(w==null?w=i:ye(w,0,Ne),k=gi(w/ne),p)if(crypto.getRandomValues){for(O=crypto.getRandomValues(new Uint32Array(k*=2));$<k;)y=O[$]*131072+(O[$+1]>>>11),y>=9e15?(N=crypto.getRandomValues(new Uint32Array(2)),O[$]=N[0],O[$+1]=N[1]):(A.push(y%1e14),$+=2);$=k/2}else if(crypto.randomBytes){for(O=crypto.randomBytes(k*=7);$<k;)y=(O[$]&31)*281474976710656+O[$+1]*1099511627776+O[$+2]*4294967296+O[$+3]*16777216+(O[$+4]<<16)+(O[$+5]<<8)+O[$+6],y>=9e15?crypto.randomBytes(7).copy(O,$):(A.push(y%1e14),$+=7);$=k/7}else throw p=!1,Error(_e+"crypto unavailable");if(!p)for(;$<k;)y=g(),y<9e15&&(A[$++]=y%1e14);for(k=A[--$],w%=ne,k&&w&&(y=vi[ne-w],A[$]=ot(k/y)*y);A[$]===0;A.pop(),$--);if($<0)A=[I=0];else{for(I=-1;A[0]===0;A.splice(0,1),I-=ne);for($=1,y=A[0];y>=10;y/=10,$++);$<ne&&(I-=ne-$)}return P.e=I,P.c=A,P}}(),E.sum=function(){for(var b=1,g=arguments,w=new E(g[0]);b<g.length;)w=w.plus(g[b++]);return w},n=function(){var b="0123456789";function g(w,O,N,I){for(var k,y=[0],$,A=0,P=w.length;A<P;){for($=y.length;$--;y[$]*=O);for(y[0]+=I.indexOf(w.charAt(A++)),k=0;k<y.length;k++)y[k]>N-1&&(y[k+1]==null&&(y[k+1]=0),y[k+1]+=y[k]/N|0,y[k]%=N)}return y.reverse()}return function(w,O,N,I,k){var y,$,A,P,L,j,U,_,H=w.indexOf("."),Y=i,G=c;for(H>=0&&(P=h,h=0,w=w.replace(".",""),_=new E(O),j=_.pow(w.length-H),h=P,_.c=g(Vt(it(j.c),j.e,"0"),10,N,b),_.e=_.c.length),U=g(w,O,N,k?(y=v,b):(y=b,v)),A=P=U.length;U[--P]==0;U.pop());if(!U[0])return y.charAt(0);if(H<0?--A:(j.c=U,j.e=A,j.s=I,j=t(j,_,Y,G,N),U=j.c,L=j.r,A=j.e),$=A+Y+1,H=U[$],P=N/2,L=L||$<0||U[$+1]!=null,L=G<4?(H!=null||L)&&(G==0||G==(j.s<0?3:2)):H>P||H==P&&(G==4||L||G==6&&U[$-1]&1||G==(j.s<0?8:7)),$<1||!U[0])w=L?Vt(y.charAt(1),-Y,y.charAt(0)):y.charAt(0);else{if(U.length=$,L)for(--N;++U[--$]>N;)U[$]=0,$||(++A,U=[1].concat(U));for(P=U.length;!U[--P];);for(H=0,w="";H<=P;w+=y.charAt(U[H++]));w=Vt(w,A,y.charAt(0))}return w}}(),t=function(){function b(O,N,I){var k,y,$,A,P=0,L=O.length,j=N%fn,U=N/fn|0;for(O=O.slice();L--;)$=O[L]%fn,A=O[L]/fn|0,k=U*$+A*j,y=j*$+k%fn*fn+P,P=(y/I|0)+(k/fn|0)+U*A,O[L]=y%I;return P&&(O=[P].concat(O)),O}function g(O,N,I,k){var y,$;if(I!=k)$=I>k?1:-1;else for(y=$=0;y<I;y++)if(O[y]!=N[y]){$=O[y]>N[y]?1:-1;break}return $}function w(O,N,I,k){for(var y=0;I--;)O[I]-=y,y=O[I]<N[I]?1:0,O[I]=y*k+O[I]-N[I];for(;!O[0]&&O.length>1;O.splice(0,1));}return function(O,N,I,k,y){var $,A,P,L,j,U,_,H,Y,G,W,Z,J,oe,me,ge,de,se=O.s==N.s?1:-1,pe=O.c,ee=N.c;if(!pe||!pe[0]||!ee||!ee[0])return new E(!O.s||!N.s||(pe?ee&&pe[0]==ee[0]:!ee)?NaN:pe&&pe[0]==0||!ee?se*0:se/0);for(H=new E(se),Y=H.c=[],A=O.e-N.e,se=I+A+1,y||(y=vt,A=st(O.e/ne)-st(N.e/ne),se=se/ne|0),P=0;ee[P]==(pe[P]||0);P++);if(ee[P]>(pe[P]||0)&&A--,se<0)Y.push(1),L=!0;else{for(oe=pe.length,ge=ee.length,P=0,se+=2,j=ot(y/(ee[0]+1)),j>1&&(ee=b(ee,j,y),pe=b(pe,j,y),ge=ee.length,oe=pe.length),J=ge,G=pe.slice(0,ge),W=G.length;W<ge;G[W++]=0);de=ee.slice(),de=[0].concat(de),me=ee[0],ee[1]>=y/2&&me++;do{if(j=0,$=g(ee,G,ge,W),$<0){if(Z=G[0],ge!=W&&(Z=Z*y+(G[1]||0)),j=ot(Z/me),j>1)for(j>=y&&(j=y-1),U=b(ee,j,y),_=U.length,W=G.length;g(U,G,_,W)==1;)j--,w(U,ge<_?de:ee,_,y),_=U.length,$=1;else j==0&&($=j=1),U=ee.slice(),_=U.length;if(_<W&&(U=[0].concat(U)),w(G,U,W,y),W=G.length,$==-1)for(;g(ee,G,ge,W)<1;)j++,w(G,ge<W?de:ee,W,y),W=G.length}else $===0&&(j++,G=[0]);Y[P++]=j,G[0]?G[W++]=pe[J]||0:(G=[pe[J]],W=1)}while((J++<oe||G[0]!=null)&&se--);L=G[0]!=null,Y[0]||Y.splice(0,1)}if(y==vt){for(P=1,se=Y[0];se>=10;se/=10,P++);B(H,I+(H.e=P+A*ne-1)+1,k,L)}else H.e=A,H.r=+L;return H}}();function S(b,g,w,O){var N,I,k,y,$;if(w==null?w=c:ye(w,0,8),!b.c)return b.toString();if(N=b.c[0],k=b.e,g==null)$=it(b.c),$=O==1||O==2&&(k<=a||k>=l)?Ko($,k):Vt($,k,"0");else if(b=B(new E(b),g,w),I=b.e,$=it(b.c),y=$.length,O==1||O==2&&(g<=I||I<=a)){for(;y<g;$+="0",y++);$=Ko($,I)}else if(g-=k+(O===2&&I>k),$=Vt($,I,"0"),I+1>y){if(--g>0)for($+=".";g--;$+="0");}else if(g+=I-y,g>0)for(I+1==y&&($+=".");g--;$+="0");return b.s<0&&N?"-"+$:$}function C(b,g){for(var w,O,N=1,I=new E(b[0]);N<b.length;N++)O=new E(b[N]),(!O.s||(w=On(I,O))===g||w===0&&I.s===g)&&(I=O);return I}function M(b,g,w){for(var O=1,N=g.length;!g[--N];g.pop());for(N=g[0];N>=10;N/=10,O++);return(w=O+w*ne-1)>f?b.c=b.e=null:w<u?b.c=[b.e=0]:(b.e=w,b.c=g),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,w=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(I,k,y,$){var A,P=y?k:k.replace(N,"");if(O.test(P))I.s=isNaN(P)?null:P<0?-1:1;else{if(!y&&(P=P.replace(b,function(L,j,U){return A=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!$||$==A?j:L}),$&&(A=$,P=P.replace(g,"$1").replace(w,"0.$1")),k!=P))return new E(P,A);if(E.DEBUG)throw Error(_e+"Not a"+($?" base "+$:"")+" number: "+k);I.s=null}I.c=I.e=null}}();function B(b,g,w,O){var N,I,k,y,$,A,P,L=b.c,j=vi;if(L){e:{for(N=1,y=L[0];y>=10;y/=10,N++);if(I=g-N,I<0)I+=ne,k=g,$=L[A=0],P=ot($/j[N-k-1]%10);else if(A=gi((I+1)/ne),A>=L.length)if(O){for(;L.length<=A;L.push(0));$=P=0,N=1,I%=ne,k=I-ne+1}else break e;else{for($=y=L[A],N=1;y>=10;y/=10,N++);I%=ne,k=I-ne+N,P=k<0?0:ot($/j[N-k-1]%10)}if(O=O||g<0||L[A+1]!=null||(k<0?$:$%j[N-k-1]),O=w<4?(P||O)&&(w==0||w==(b.s<0?3:2)):P>5||P==5&&(w==4||O||w==6&&(I>0?k>0?$/j[N-k]:0:L[A-1])%10&1||w==(b.s<0?8:7)),g<1||!L[0])return L.length=0,O?(g-=b.e+1,L[0]=j[(ne-g%ne)%ne],b.e=-g||0):L[0]=b.e=0,b;if(I==0?(L.length=A,y=1,A--):(L.length=A+1,y=j[ne-I],L[A]=k>0?ot($/j[N-k]%j[k])*y:0),O)for(;;)if(A==0){for(I=1,k=L[0];k>=10;k/=10,I++);for(k=L[0]+=y,y=1;k>=10;k/=10,y++);I!=y&&(b.e++,L[0]==vt&&(L[0]=1));break}else{if(L[A]+=y,L[A]!=vt)break;L[A--]=0,y=1}for(I=L.length;L[--I]===0;L.pop());}b.e>f?b.c=b.e=null:b.e<u&&(b.c=[b.e=0])}return b}function F(b){var g,w=b.e;return w===null?b.toString():(g=it(b.c),g=w<=a||w>=l?Ko(g,w):Vt(g,w,"0"),b.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var b=new E(this);return b.s<0&&(b.s=1),b},o.comparedTo=function(b,g){return On(this,new E(b,g))},o.decimalPlaces=o.dp=function(b,g){var w,O,N,I=this;if(b!=null)return ye(b,0,Ne),g==null?g=c:ye(g,0,8),B(new E(I),b+I.e+1,g);if(!(w=I.c))return null;if(O=((N=w.length-1)-st(this.e/ne))*ne,N=w[N])for(;N%10==0;N/=10,O--);return O<0&&(O=0),O},o.dividedBy=o.div=function(b,g){return t(this,new E(b,g),i,c)},o.dividedToIntegerBy=o.idiv=function(b,g){return t(this,new E(b,g),0,1)},o.exponentiatedBy=o.pow=function(b,g){var w,O,N,I,k,y,$,A,P,L=this;if(b=new E(b),b.c&&!b.isInteger())throw Error(_e+"Exponent not an integer: "+F(b));if(g!=null&&(g=new E(g)),y=b.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!b.c||!b.c[0])return P=new E(Math.pow(+F(L),y?b.s*(2-Zo(b)):+F(b))),g?P.mod(g):P;if($=b.s<0,g){if(g.c?!g.c[0]:!g.s)return new E(NaN);O=!$&&L.isInteger()&&g.isInteger(),O&&(L=L.mod(g))}else{if(b.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||y&&L.c[1]>=24e7:L.c[0]<8e13||y&&L.c[0]<=9999975e7)))return I=L.s<0&&Zo(b)?-0:0,L.e>-1&&(I=1/I),new E($?1/I:I);h&&(I=gi(h/ne+2))}for(y?(w=new E(.5),$&&(b.s=1),A=Zo(b)):(N=Math.abs(+F(b)),A=N%2),P=new E(s);;){if(A){if(P=P.times(L),!P.c)break;I?P.c.length>I&&(P.c.length=I):O&&(P=P.mod(g))}if(N){if(N=ot(N/2),N===0)break;A=N%2}else if(b=b.times(w),B(b,b.e+1,1),b.e>14)A=Zo(b);else{if(N=+F(b),N===0)break;A=N%2}L=L.times(L),I?L.c&&L.c.length>I&&(L.c.length=I):O&&(L=L.mod(g))}return O?P:($&&(P=s.div(P)),g?P.mod(g):I?B(P,h,c,k):P)},o.integerValue=function(b){var g=new E(this);return b==null?b=c:ye(b,0,8),B(g,g.e+1,b)},o.isEqualTo=o.eq=function(b,g){return On(this,new E(b,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,g){return On(this,new E(b,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,g){return(g=On(this,new E(b,g)))===1||g===0},o.isInteger=function(){return!!this.c&&st(this.e/ne)>this.c.length-2},o.isLessThan=o.lt=function(b,g){return On(this,new E(b,g))<0},o.isLessThanOrEqualTo=o.lte=function(b,g){return(g=On(this,new E(b,g)))===-1||g===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(b,g){var w,O,N,I,k=this,y=k.s;if(b=new E(b,g),g=b.s,!y||!g)return new E(NaN);if(y!=g)return b.s=-g,k.plus(b);var $=k.e/ne,A=b.e/ne,P=k.c,L=b.c;if(!$||!A){if(!P||!L)return P?(b.s=-g,b):new E(L?k:NaN);if(!P[0]||!L[0])return L[0]?(b.s=-g,b):new E(P[0]?k:c==3?-0:0)}if($=st($),A=st(A),P=P.slice(),y=$-A){for((I=y<0)?(y=-y,N=P):(A=$,N=L),N.reverse(),g=y;g--;N.push(0));N.reverse()}else for(O=(I=(y=P.length)<(g=L.length))?y:g,y=g=0;g<O;g++)if(P[g]!=L[g]){I=P[g]<L[g];break}if(I&&(N=P,P=L,L=N,b.s=-b.s),g=(O=L.length)-(w=P.length),g>0)for(;g--;P[w++]=0);for(g=vt-1;O>y;){if(P[--O]<L[O]){for(w=O;w&&!P[--w];P[w]=g);--P[w],P[O]+=vt}P[O]-=L[O]}for(;P[0]==0;P.splice(0,1),--A);return P[0]?M(b,P,A):(b.s=c==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,g){var w,O,N=this;return b=new E(b,g),!N.c||!b.s||b.c&&!b.c[0]?new E(NaN):!b.c||N.c&&!N.c[0]?new E(N):(d==9?(O=b.s,b.s=1,w=t(N,b,0,3),b.s=O,w.s*=O):w=t(N,b,0,d),b=N.minus(w.times(b)),!b.c[0]&&d==1&&(b.s=N.s),b)},o.multipliedBy=o.times=function(b,g){var w,O,N,I,k,y,$,A,P,L,j,U,_,H,Y,G=this,W=G.c,Z=(b=new E(b,g)).c;if(!W||!Z||!W[0]||!Z[0])return!G.s||!b.s||W&&!W[0]&&!Z||Z&&!Z[0]&&!W?b.c=b.e=b.s=null:(b.s*=G.s,!W||!Z?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(O=st(G.e/ne)+st(b.e/ne),b.s*=G.s,$=W.length,L=Z.length,$<L&&(_=W,W=Z,Z=_,N=$,$=L,L=N),N=$+L,_=[];N--;_.push(0));for(H=vt,Y=fn,N=L;--N>=0;){for(w=0,j=Z[N]%Y,U=Z[N]/Y|0,k=$,I=N+k;I>N;)A=W[--k]%Y,P=W[k]/Y|0,y=U*A+P*j,A=j*A+y%Y*Y+_[I]+w,w=(A/H|0)+(y/Y|0)+U*P,_[I--]=A%H;_[I]=w}return w?++O:_.splice(0,1),M(b,_,O)},o.negated=function(){var b=new E(this);return b.s=-b.s||null,b},o.plus=function(b,g){var w,O=this,N=O.s;if(b=new E(b,g),g=b.s,!N||!g)return new E(NaN);if(N!=g)return b.s=-g,O.minus(b);var I=O.e/ne,k=b.e/ne,y=O.c,$=b.c;if(!I||!k){if(!y||!$)return new E(N/0);if(!y[0]||!$[0])return $[0]?b:new E(y[0]?O:N*0)}if(I=st(I),k=st(k),y=y.slice(),N=I-k){for(N>0?(k=I,w=$):(N=-N,w=y),w.reverse();N--;w.push(0));w.reverse()}for(N=y.length,g=$.length,N-g<0&&(w=$,$=y,y=w,g=N),N=0;g;)N=(y[--g]=y[g]+$[g]+N)/vt|0,y[g]=vt===y[g]?0:y[g]%vt;return N&&(y=[N].concat(y),++k),M(b,y,k)},o.precision=o.sd=function(b,g){var w,O,N,I=this;if(b!=null&&b!==!!b)return ye(b,1,Ne),g==null?g=c:ye(g,0,8),B(new E(I),b,g);if(!(w=I.c))return null;if(N=w.length-1,O=N*ne+1,N=w[N]){for(;N%10==0;N/=10,O--);for(N=w[0];N>=10;N/=10,O++);}return b&&I.e+1>O&&(O=I.e+1),O},o.shiftedBy=function(b){return ye(b,-yi,yi),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,g,w,O,N,I=this,k=I.c,y=I.s,$=I.e,A=i+4,P=new E("0.5");if(y!==1||!k||!k[0])return new E(!y||y<0&&(!k||k[0])?NaN:k?I:1/0);if(y=Math.sqrt(+F(I)),y==0||y==1/0?(g=it(k),(g.length+$)%2==0&&(g+="0"),y=Math.sqrt(+g),$=st(($+1)/2)-($<0||$%2),y==1/0?g="5e"+$:(g=y.toExponential(),g=g.slice(0,g.indexOf("e")+1)+$),w=new E(g)):w=new E(y+""),w.c[0]){for($=w.e,y=$+A,y<3&&(y=0);;)if(N=w,w=P.times(N.plus(t(I,N,A,1))),it(N.c).slice(0,y)===(g=it(w.c)).slice(0,y))if(w.e<$&&--y,g=g.slice(y-3,y+1),g=="9999"||!O&&g=="4999"){if(!O&&(B(N,N.e+i+2,0),N.times(N).eq(I))){w=N;break}A+=4,y+=4,O=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(B(w,w.e+i+2,1),b=!w.times(w).eq(I));break}}return B(w,w.e+i+1,c,b)},o.toExponential=function(b,g){return b!=null&&(ye(b,0,Ne),b++),S(this,b,g,1)},o.toFixed=function(b,g){return b!=null&&(ye(b,0,Ne),b=b+this.e+1),S(this,b,g)},o.toFormat=function(b,g,w){var O,N=this;if(w==null)b!=null&&g&&typeof g=="object"?(w=g,g=null):b&&typeof b=="object"?(w=b,b=g=null):w=m;else if(typeof w!="object")throw Error(_e+"Argument not an object: "+w);if(O=N.toFixed(b,g),N.c){var I,k=O.split("."),y=+w.groupSize,$=+w.secondaryGroupSize,A=w.groupSeparator||"",P=k[0],L=k[1],j=N.s<0,U=j?P.slice(1):P,_=U.length;if($&&(I=y,y=$,$=I,_-=I),y>0&&_>0){for(I=_%y||y,P=U.substr(0,I);I<_;I+=y)P+=A+U.substr(I,y);$>0&&(P+=A+U.slice(I)),j&&(P="-"+P)}O=L?P+(w.decimalSeparator||"")+(($=+w.fractionGroupSize)?L.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):L):P}return(w.prefix||"")+O+(w.suffix||"")},o.toFraction=function(b){var g,w,O,N,I,k,y,$,A,P,L,j,U=this,_=U.c;if(b!=null&&(y=new E(b),!y.isInteger()&&(y.c||y.s!==1)||y.lt(s)))throw Error(_e+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+F(y));if(!_)return new E(U);for(g=new E(s),A=w=new E(s),O=$=new E(s),j=it(_),I=g.e=j.length-U.e-1,g.c[0]=vi[(k=I%ne)<0?ne+k:k],b=!b||y.comparedTo(g)>0?I>0?g:A:y,k=f,f=1/0,y=new E(j),$.c[0]=0;P=t(y,g,0,1),N=w.plus(P.times(O)),N.comparedTo(b)!=1;)w=O,O=N,A=$.plus(P.times(N=A)),$=N,g=y.minus(P.times(N=g)),y=N;return N=t(b.minus(w),O,0,1),$=$.plus(N.times(A)),w=w.plus(N.times(O)),$.s=A.s=U.s,I=I*2,L=t(A,O,I,c).minus(U).abs().comparedTo(t($,w,I,c).minus(U).abs())<1?[A,O]:[$,w],f=k,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(b,g){return b!=null&&ye(b,1,Ne),S(this,b,g,2)},o.toString=function(b){var g,w=this,O=w.s,N=w.e;return N===null?O?(g="Infinity",O<0&&(g="-"+g)):g="NaN":(b==null?g=N<=a||N>=l?Ko(it(w.c),N):Vt(it(w.c),N,"0"):b===10&&T?(w=B(new E(w),i+N+1,c),g=Vt(it(w.c),w.e,"0")):(ye(b,2,v.length,"Base"),g=n(Vt(it(w.c),N,"0"),10,b,O,!0)),O<0&&w.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return F(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&E.set(e),E}function st(e){var t=e|0;return e>0||e===t?t:t-1}function it(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ne-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function On(e,t){var n,r,o=e.c,s=t.c,i=e.s,c=t.s,a=e.e,l=t.e;if(!i||!c)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-c:i;if(i!=c)return i;if(n=i<0,r=a==l,!o||!s)return r?0:!o^n?1:-1;if(!r)return a>l^n?1:-1;for(c=(a=o.length)<(l=s.length)?a:l,i=0;i<c;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return a==l?0:a>l^n?1:-1}function ye(e,t,n,r){if(e<t||e>n||e!==ot(e))throw Error(_e+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Zo(e){var t=e.c.length-1;return st(e.e/ne)==t&&e.c[t]%2!=0}function Ko(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Vt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Ie=Fl();const Qm=(e,t=6)=>{try{const n=new Ie(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Ie.ROUND_DOWN),[o,s=""]=r.toString().split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const c=(s||"").padEnd(t,"0");return`${i}.${c}`}return i}catch(n){return console.warn("formatThousands error:",n),"0"}},wt=()=>{const{translations:e,currentLocale:t}=Ll();return{t:(s,i)=>{try{const c=s.split(".");let a=e;for(const u of c)if(a&&typeof a=="object"&&u in a)a=a[u];else return s;let l=typeof a=="string"?a:s;return i&&typeof l=="string"&&Object.keys(i).forEach(u=>{const f=`{{${u}}}`;l=l.replace(new RegExp(f,"g"),String(i[u]))}),l}catch(c){return console.warn(`Translation error for key "${s}":`,c),s}},translations:e,locale:t,getTranslationObject:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return{};return typeof c=="object"?c:{}}catch(i){return console.warn(`Translation object error for key "${s}":`,i),{}}},hasTranslation:s=>{try{const i=s.split(".");let c=e;for(const a of i)if(c&&typeof c=="object"&&a in c)c=c[a];else return!1;return typeof c=="string"}catch{return!1}}}},Jm="1.1.0";let ze=class Nl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Nl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Nl&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Jm}`].join(`
|
|
51
|
+
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Gt(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Rl=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,jl=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,_l=/^\(.+?\).*?$/,zl=/^tuple(?<array>(\[(\d*)\])*)$/;function wi(e){let t=e.type;if(zl.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=wi(s),o<n-1&&(t+=", ")}const r=Gt(zl,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,wi({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function er(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=wi(o),r!==n-1&&(t+=", ")}return t}function Yo(e){var t;return e.type==="function"?`function ${e.name}(${er(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${er(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${er(e.inputs)})`:e.type==="error"?`error ${e.name}(${er(e.inputs)})`:e.type==="constructor"?`constructor(${er(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ul=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function eb(e){return Ul.test(e)}function tb(e){return Gt(Ul,e)}const Wl=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function nb(e){return Wl.test(e)}function rb(e){return Gt(Wl,e)}const Hl=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function ob(e){return Hl.test(e)}function sb(e){return Gt(Hl,e)}const Vl=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Xo(e){return Vl.test(e)}function ib(e){return Gt(Vl,e)}const Gl=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function ab(e){return Gl.test(e)}function cb(e){return Gt(Gl,e)}const ql=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function lb(e){return ql.test(e)}function ub(e){return Gt(ql,e)}const fb=/^receive\(\) external payable$/;function db(e){return fb.test(e)}const Zl=new Set(["memory","indexed","storage","calldata"]),pb=new Set(["indexed"]),xi=new Set(["calldata","memory","storage"]);class hb extends ze{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class mb extends ze{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class bb extends ze{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class gb extends ze{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class yb extends ze{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class vb extends ze{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class wb extends ze{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class xb extends ze{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Eb extends ze{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class tr extends ze{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Sb extends ze{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Pb extends ze{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Tb extends ze{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Ab extends ze{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function $b(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:e}const Ei=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Si(e,t={}){if(ob(e))return Nb(e,t);if(nb(e))return Cb(e,t);if(eb(e))return Ob(e,t);if(ab(e))return Ib(e,t);if(lb(e))return kb(e);if(db(e))return{type:"receive",stateMutability:"payable"};throw new Sb({signature:e})}function Nb(e,t={}){const n=sb(e);if(!n)throw new tr({signature:e,type:"function"});const r=Qe(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(qt(r[c],{modifiers:xi,structs:t,type:"function"}));const i=[];if(n.returns){const c=Qe(n.returns),a=c.length;for(let l=0;l<a;l++)i.push(qt(c[l],{modifiers:xi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Cb(e,t={}){const n=rb(e);if(!n)throw new tr({signature:e,type:"event"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{modifiers:pb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Ob(e,t={}){const n=tb(e);if(!n)throw new tr({signature:e,type:"error"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Ib(e,t={}){const n=cb(e);if(!n)throw new tr({signature:e,type:"constructor"});const r=Qe(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(qt(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function kb(e){const t=ub(e);if(!t)throw new tr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Db=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Mb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Lb=/^u?int$/;function qt(e,t){var f,p;const n=$b(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Ei.has(n))return Ei.get(n);const r=_l.test(e),o=Gt(r?Mb:Db,e);if(!o)throw new yb({param:e});if(o.name&&Fb(o.name))throw new vb({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},c=(t==null?void 0:t.structs)??{};let a,l={};if(r){a="tuple";const d=Qe(o.type),h=[],m=d.length;for(let v=0;v<m;v++)h.push(qt(d[v],{structs:c}));l={components:h}}else if(o.type in c)a="tuple",l={components:c[o.type]};else if(Lb.test(o.type))a=`${o.type}256`;else if(o.type==="address payable")a="address";else if(a=o.type,(t==null?void 0:t.type)!=="struct"&&!Kl(a))throw new bb({type:a});if(o.modifier){if(!((p=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&p.call(f,o.modifier)))throw new wb({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(xi.has(o.modifier)&&!Rb(a,!!o.array))throw new xb({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...l};return Ei.set(n,u),u}function Qe(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],c=e.slice(s+1);switch(i){case",":return r===0?Qe(c,[...t,n.trim()]):Qe(c,t,`${n}${i}`,r);case"(":return Qe(c,t,`${n}${i}`,r+1);case")":return Qe(c,t,`${n}${i}`,r-1);default:return Qe(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Ab({current:n,depth:r});return t.push(n.trim()),t}function Kl(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Rl.test(e)||jl.test(e)}const Bb=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Fb(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Rl.test(e)||jl.test(e)||Bb.test(e)}function Rb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Pi(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!Xo(c))continue;const a=ib(c);if(!a)throw new tr({signature:c,type:"struct"});const l=a.properties.split(";"),u=[],f=l.length;for(let p=0;p<f;p++){const h=l[p].trim();if(!h)continue;const m=qt(h,{type:"struct"});u.push(m)}if(!u.length)throw new Pb({signature:c});t[a.name]=u}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[c,a]=o[i];r[c]=Yl(a,t)}return r}const jb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Yl(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(_l.test(i.type))r.push(i);else{const a=Gt(jb,i.type);if(!(a!=null&&a.type))throw new Eb({abiParameter:i});const{array:l,type:u}=a;if(u in t){if(n.has(u))throw new Tb({type:u});r.push({...i,type:`tuple${l??""}`,components:Yl(t[u]??[],t,new Set([...n,u]))})}else if(Kl(u))r.push(i);else throw new mb({type:u})}}return r}function Xl(e){const t=Pi(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];Xo(s)||n.push(Si(s,t))}return n}function Ql(e){let t;if(typeof e=="string")t=Si(e);else{const n=Pi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!Xo(s)){t=Si(s,n);break}}}if(!t)throw new hb({signature:e});return t}function Jl(e){const t=[];if(typeof e=="string"){const n=Qe(e),r=n.length;for(let o=0;o<r;o++)t.push(qt(n[o],{modifiers:Zl}))}else{const n=Pi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(Xo(s))continue;const i=Qe(s),c=i.length;for(let a=0;a<c;a++)t.push(qt(i[a],{modifiers:Zl,structs:n}))}}if(t.length===0)throw new gb({params:e});return t}function X(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}function xt(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Jb(e.type);return`${e.name}(${Qo(e.inputs,{includeName:t})})`}function Qo(e,{includeName:t=!1}={}){return e?e.map(n=>_b(n,{includeName:t})).join(t?", ":","):""}function _b(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Qo(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Et(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ve(e){return Et(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const eu="2.42.1";let Fr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${eu}`},V=class Cl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof Cl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Cl&&n.cause.docsPath||n.docsPath,s=(c=Fr.getDocsUrl)==null?void 0:c.call(Fr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Fr.version?[`Version: ${Fr.version}`]:[]].join(`
|
|
52
|
+
`);super(i,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=eu}walk(t){return tu(this,t)}};function tu(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?tu(e.cause,t):t?null:e}class zb extends V{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
53
|
+
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class nu extends V{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
54
|
+
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class ru extends V{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
55
|
+
`),{metaMessages:[`Params: (${Qo(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Rr extends V{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class Ub extends V{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
|
|
56
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class Wb extends V{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ve(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Hb extends V{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
|
|
57
|
+
`),{name:"AbiEncodingLengthMismatchError"})}}class Vb extends V{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
58
|
+
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class ou extends V{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
59
|
+
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class su extends V{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
|
|
60
|
+
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Gb extends V{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class qb extends V{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
|
|
61
|
+
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class iu extends V{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
|
|
54
62
|
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class nr extends V{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
55
|
-
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class
|
|
56
|
-
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class
|
|
57
|
-
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class
|
|
58
|
-
`),{metaMessages:[`Params: (${Qo(r,{includeName:!0})})`,`Data: ${n} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=o}}class
|
|
59
|
-
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class
|
|
60
|
-
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class
|
|
61
|
-
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let
|
|
62
|
-
`),{name:"InvalidArrayError"})}};class
|
|
63
|
-
`),{name:"InvalidDefinitionTypeError"})}}class Kb extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let ul=class extends V{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},ll=class extends V{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class fl extends V{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function rr(e,{dir:t,size:n=32}={}){return typeof e=="string"?dn(e,{dir:t,size:n}):Xb(e,{dir:t,size:n})}function dn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new ll({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Xb(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ll({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let dl=class extends V{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Qb=class extends V{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class Jb extends V{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let e1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function In(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function St(e,{size:t}){if(we(e)>t)throw new e1({givenSize:we(e),maxSize:t})}function kt(e,t={}){const{signed:n}=t;t.size&&St(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function t1(e,t={}){let n=e;if(t.size&&(St(n,{size:t.size}),n=In(n)),In(n)==="0x00")return!1;if(In(n)==="0x01")return!0;throw new Jb(n)}function Zt(e,t={}){return Number(kt(e,t))}const n1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Q(e,t):typeof e=="string"?jr(e,t):typeof e=="boolean"?pl(e,t):Te(e,t)}function pl(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{size:t.size})):n}function Te(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=n1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(St(r,{size:t.size}),rr(r,{dir:"right",size:t.size})):r}function Q(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const a=typeof e=="bigint"?"n":"";throw new dl({max:s?`${s}${a}`:void 0,min:`${i}${a}`,signed:n,size:r,value:`${e}${a}`})}const c=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?rr(c,{size:r}):c}const r1=new TextEncoder;function jr(e,t={}){const n=r1.encode(e);return Te(n,t)}const o1=new TextEncoder;function or(e,t={}){return typeof e=="number"||typeof e=="bigint"?i1(e,t):typeof e=="boolean"?s1(e,t):Et(e)?Bt(e,t):Mn(e,t)}function s1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{size:t.size})):n}const Yt={zero:48,nine:57,A:65,F:70,a:97,f:102};function hl(e){if(e>=Yt.zero&&e<=Yt.nine)return e-Yt.zero;if(e>=Yt.A&&e<=Yt.F)return e-(Yt.A-10);if(e>=Yt.a&&e<=Yt.f)return e-(Yt.a-10)}function Bt(e,t={}){let n=e;t.size&&(St(n,{size:t.size}),n=rr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,c=0;i<o;i++){const a=hl(r.charCodeAt(c++)),u=hl(r.charCodeAt(c++));if(a===void 0||u===void 0)throw new V(`Invalid byte sequence ("${r[c-2]}${r[c-1]}" in "${r}").`);s[i]=a*16+u}return s}function i1(e,t){const n=Q(e,t);return Bt(n)}function Mn(e,t={}){const n=o1.encode(e);return typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{dir:"right",size:t.size})):n}const es=BigInt(2**32-1),ml=BigInt(32);function a1(e,t=!1){return t?{h:Number(e&es),l:Number(e>>ml&es)}:{h:Number(e>>ml&es)|0,l:Number(e&es)|0}}function c1(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l:c}=a1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const u1=(e,t,n)=>e<<n|t>>>32-n,l1=(e,t,n)=>t<<n|e>>>32-n,f1=(e,t,n)=>t<<n-32|e>>>64-n,d1=(e,t,n)=>e<<n-32|t>>>64-n,sr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function p1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function _r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function kn(e,...t){if(!p1(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function h1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");_r(e.outputLen),_r(e.blockLen)}function ir(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bl(e,t){kn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function m1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ar(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ti(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Lt(e,t){return e<<32-t|e>>>t}const b1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function g1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function y1(e){for(let t=0;t<e.length;t++)e[t]=g1(e[t]);return e}const gl=b1?e=>e:y1;function w1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ts(e){return typeof e=="string"&&(e=w1(e)),kn(e),e}function v1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];kn(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class Ai{}function yl(e){const t=r=>e().update(ts(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function x1(e=32){if(sr&&typeof sr.getRandomValues=="function")return sr.getRandomValues(new Uint8Array(e));if(sr&&typeof sr.randomBytes=="function")return Uint8Array.from(sr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const E1=BigInt(0),Ur=BigInt(1),S1=BigInt(2),P1=BigInt(7),$1=BigInt(256),T1=BigInt(113),wl=[],vl=[],xl=[];for(let e=0,t=Ur,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],wl.push(2*(5*r+n)),vl.push((e+1)*(e+2)/2%64);let o=E1;for(let s=0;s<7;s++)t=(t<<Ur^(t>>P1)*T1)%$1,t&S1&&(o^=Ur<<(Ur<<BigInt(s))-Ur);xl.push(o)}const El=c1(xl,!0),A1=El[0],O1=El[1],Sl=(e,t,n)=>n>32?f1(e,t,n):u1(e,t,n),Pl=(e,t,n)=>n>32?d1(e,t,n):l1(e,t,n);function N1(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,a=(i+2)%10,u=n[a],l=n[a+1],f=Sl(u,l,1)^n[c],p=Pl(u,l,1)^n[c+1];for(let d=0;d<50;d+=10)e[i+d]^=f,e[i+d+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){const c=vl[i],a=Sl(o,s,c),u=Pl(o,s,c),l=wl[i];o=e[l],s=e[l+1],e[l]=a,e[l+1]=u}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=A1[r],e[1]^=O1[r]}ar(n)}class Oi extends Ai{constructor(t,n,r,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,_r(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=m1(this.state)}clone(){return this._cloneInto()}keccak(){gl(this.state32),N1(this.state32,this.rounds),gl(this.state32),this.posOut=0,this.pos=0}update(t){ir(this),t=ts(t),kn(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let c=0;c<i;c++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ir(this,!1),kn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return _r(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(bl(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ar(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new Oi(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const C1=(e,t,n)=>yl(()=>new Oi(t,e,n)),$l=C1(1,136,256/8);function Me(e,t){const n=t||"hex",r=$l(Et(e,{strict:!1})?or(e):e);return n==="bytes"?r:pn(r)}const I1=e=>Me(or(e));function M1(e){return I1(e)}function k1(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new V("Unable to normalize signature.");return o}const B1=e=>{const t=typeof e=="string"?e:Ko(e);return k1(t)};function Tl(e){return M1(B1(e))}const ns=Tl;let hn=class extends V{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},rs=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const Ni=new rs(8192);function os(e,t){if(Ni.has(`${e}.${t}`))return Ni.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Me(Mn(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return Ni.set(`${e}.${t}`,s),s}function mn(e,t){if(!at(e,{strict:!1}))throw new hn({address:e});return os(e,t)}const L1=/^0x[a-fA-F0-9]{40}$/,Ci=new rs(8192);function at(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Ci.has(r))return Ci.get(r);const o=L1.test(e)?e.toLowerCase()===e?!0:n?os(e)===e:!0:!1;return Ci.set(r,o),o}function Pt(e){return typeof e[0]=="string"?cr(e):F1(e)}function F1(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function cr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function ur(e,t,n,{strict:r}={}){return Et(e,{strict:!1})?D1(e,t,n,{strict:r}):Nl(e,t,n,{strict:r})}function Al(e,t){if(typeof t=="number"&&t>0&&t>we(e)-1)throw new ul({offset:t,position:"start",size:we(e)})}function Ol(e,t,n){if(typeof t=="number"&&typeof n=="number"&&we(e)!==n-t)throw new ul({offset:n,position:"end",size:we(e)})}function Nl(e,t,n,{strict:r}={}){Al(e,t);const o=e.slice(t,n);return r&&Ol(o,t,n),o}function D1(e,t,n,{strict:r}={}){Al(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Ol(o,t,n),o}const R1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Cl=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function bn(e,t){if(e.length!==t.length)throw new _b({expectedLength:e.length,givenLength:t.length});const n=j1({params:e,values:t}),r=Mi(n);return r.length===0?"0x":r}function j1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Ii({param:e[r],value:t[r]}));return n}function Ii({param:e,value:t}){const n=ki(e.type);if(n){const[r,o]=n;return U1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return G1(t,{param:e});if(e.type==="address")return _1(t);if(e.type==="bool")return H1(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Cl.exec(e.type)??[];return W1(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return z1(t,{param:e});if(e.type==="string")return V1(t);throw new qb(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Mi(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=we(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Q(t+o,{size:32})),r.push(c),o+=we(c)):n.push(c)}return Pt([...n,...r])}function _1(e){if(!at(e))throw new hn({address:e});return{dynamic:!1,encoded:dn(e.toLowerCase())}}function U1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new cl(e);if(!r&&e.length!==t)throw new Rb({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Ii({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=Mi(s);if(r){const c=Q(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Pt([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Pt(s.map(({encoded:i})=>i))}}function z1(e,{param:t}){const[,n]=t.type.split("bytes"),r=we(e);if(!n){let o=e;return r%32!==0&&(o=dn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Pt([dn(Q(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new jb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:dn(e,{dir:"right"})}}function H1(e){if(typeof e!="boolean")throw new V(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:dn(pl(e))}}function W1(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new dl({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Q(e,{size:32,signed:t})}}function V1(e){const t=jr(e),n=Math.ceil(we(t)/32),r=[];for(let o=0;o<n;o++)r.push(dn(ur(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Pt([dn(Q(we(t),{size:32})),...r])}}function G1(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,c=Ii({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Mi(r):Pt(r.map(({encoded:o})=>o))}}function ki(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const zr=e=>ur(Tl(e),0,4);function Bn(e){const{abi:t,args:n=[],name:r}=e,o=Et(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?zr(c)===r:c.type==="event"?ns(c)===r:!1:"name"in c&&c.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const c of s){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((u,l)=>{const f="inputs"in c&&c.inputs[l];return f?Bi(u,f):!1})){if(i&&"inputs"in i&&i.inputs){const u=Il(c.inputs,i.inputs,n);if(u)throw new Vb({abiItem:c,type:u[0]},{abiItem:i,type:u[1]})}i=c}}return i||s[0]}function Bi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return at(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>Bi(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Bi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Il(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return Il(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?at(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?at(n[r],{strict:!1}):!1)return i}}const Ml="/docs/contract/encodeEventTopics";function Hr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const u=Bn({abi:t,name:n});if(!u)throw new il(n,{docsPath:Ml});o=u}if(o.type!=="event")throw new il(void 0,{docsPath:Ml});const s=xt(o),i=ns(s);let c=[];if(r&&"inputs"in o){const u=(a=o.inputs)==null?void 0:a.filter(f=>"indexed"in f&&f.indexed),l=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];l.length>0&&(c=(u==null?void 0:u.map((f,p)=>Array.isArray(l[p])?l[p].map((d,h)=>kl({param:f,value:l[p][h]})):typeof l[p]<"u"&&l[p]!==null?kl({param:f,value:l[p]}):null))??[])}return[i,...c]}function kl({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Me(or(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Kb(e.type);return bn([e],[t])}function ss(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:c,transport:a})=>{c==="success"&&t===s&&(n[i]=a.request)})),s=>n[s]||e.request}async function Bl(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,u=ss(e,{method:"eth_newFilter"}),l=s?Hr({abi:r,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?Q(i):i,toBlock:typeof a=="bigint"?Q(a):a,topics:l}]});return{abi:r,args:o,eventName:s,id:f,request:u(f),strict:!!c,type:"event"}}function Je(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Ll="/docs/contract/encodeFunctionData";function q1(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Bn({abi:t,args:n,name:r});if(!s)throw new nr(r,{docsPath:Ll});o=s}if(o.type!=="function")throw new nr(void 0,{docsPath:Ll});return{abi:[o],functionName:zr(xt(o))}}function $t(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:q1(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?bn(o.inputs,t??[]):void 0;return cr([s,i??"0x"])}const Z1={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Fl={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Y1={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Dl=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Rl=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},K1=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const X1={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new K1({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Rl({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Dl({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Dl({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Li(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(X1);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Q1(e,t={}){typeof t.size<"u"&&St(e,{size:t.size});const n=Te(e,t);return kt(n,t)}function J1(e,t={}){let n=e;if(typeof t.size<"u"&&(St(n,{size:t.size}),n=In(n)),n.length>1||n[0]>1)throw new Qb(n);return!!n[0]}function Kt(e,t={}){typeof t.size<"u"&&St(e,{size:t.size});const n=Te(e,t);return Zt(n,t)}function eg(e,t={}){let n=e;return typeof t.size<"u"&&(St(n,{size:t.size}),n=In(n,{dir:"right"})),new TextDecoder().decode(n)}function Wr(e,t){const n=typeof t=="string"?Bt(t):t,r=Li(n);if(we(n)===0&&e.length>0)throw new Rr;if(we(t)&&we(t)<32)throw new rl({data:typeof t=="string"?t:Te(t),params:e,size:we(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const c=e[i];r.setPosition(o);const[a,u]=lr(r,c,{staticPosition:0});o+=u,s.push(a)}return s}function lr(e,t,{staticPosition:n}){const r=ki(t.type);if(r){const[o,s]=r;return ng(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return ig(e,t,{staticPosition:n});if(t.type==="address")return tg(e);if(t.type==="bool")return rg(e);if(t.type.startsWith("bytes"))return og(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return sg(e,t);if(t.type==="string")return ag(e,{staticPosition:n});throw new Zb(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const jl=32,Fi=32;function tg(e){const t=e.readBytes(32);return[os(Te(Nl(t,-20))),32]}function ng(e,t,{length:n,staticPosition:r}){if(!n){const i=Kt(e.readBytes(Fi)),c=r+i,a=c+jl;e.setPosition(c);const u=Kt(e.readBytes(jl)),l=Vr(t);let f=0;const p=[];for(let d=0;d<u;++d){e.setPosition(a+(l?d*32:f));const[h,m]=lr(e,t,{staticPosition:a});f+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(Vr(t)){const i=Kt(e.readBytes(Fi)),c=r+i,a=[];for(let u=0;u<n;++u){e.setPosition(c+u*32);const[l]=lr(e,t,{staticPosition:c});a.push(l)}return e.setPosition(r+32),[a,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[c,a]=lr(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function rg(e){return[J1(e.readBytes(32),{size:32}),32]}function og(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=Kt(e.readBytes(32));e.setPosition(n+i);const c=Kt(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Te(a),32]}return[Te(e.readBytes(Number.parseInt(o,10),32)),32]}function sg(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?Q1(o,{signed:n}):Kt(o,{signed:n}),32]}function ig(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(Vr(t)){const i=Kt(e.readBytes(Fi)),c=n+i;for(let a=0;a<t.components.length;++a){const u=t.components[a];e.setPosition(c+s);const[l,f]=lr(e,u,{staticPosition:c});s+=f,o[r?a:u==null?void 0:u.name]=l}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const c=t.components[i],[a,u]=lr(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=u}return[o,s]}function ag(e,{staticPosition:t}){const n=Kt(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Kt(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=eg(In(s));return e.setPosition(t+32),[i,32]}function Vr(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(Vr);const n=ki(e.type);return!!(n&&Vr({...e,type:n[1]}))}function _l(e){const{abi:t,data:n}=e,r=ur(n,0,4);if(r==="0x")throw new Rr;const s=[...t||[],Fl,Y1].find(i=>i.type==="error"&&r===zr(xt(i)));if(!s)throw new sl(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Wr(s.inputs,ur(n,4)):void 0,errorName:s.name}}const Ae=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function Ul({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?Ae(t[s]):t[s]}`).join(", ")})`}const cg={gwei:9,wei:18},ug={ether:-9,wei:9};function Di(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function Ri(e,t="wei"){return Di(e,cg[t])}function ze(e,t="wei"){return Di(e,ug[t])}class lg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class fg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function zl(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
64
|
-
`,"")}function
|
|
63
|
+
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class au extends V{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
64
|
+
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class Zb extends V{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
|
|
65
|
+
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class Kb extends V{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${xt(t.abiItem)}\`, and`,`\`${n.type}\` in \`${xt(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let Yb=class extends V{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class Jo extends V{constructor({abiItem:t,data:n,params:r,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
|
|
66
|
+
`),{metaMessages:[`Params: (${Qo(r,{includeName:!0})})`,`Data: ${n} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=o}}class Ti extends V{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${xt(t,{includeName:!0})}".`].join(`
|
|
67
|
+
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Xb extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
68
|
+
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Qb extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
69
|
+
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let cu=class extends V{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
70
|
+
`),{name:"InvalidArrayError"})}};class Jb extends V{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
71
|
+
`),{name:"InvalidDefinitionTypeError"})}}class e1 extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let lu=class extends V{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},uu=class extends V{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class fu extends V{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function rr(e,{dir:t,size:n=32}={}){return typeof e=="string"?dn(e,{dir:t,size:n}):t1(e,{dir:t,size:n})}function dn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new uu({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function t1(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new uu({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let du=class extends V{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},n1=class extends V{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class r1 extends V{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let o1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function In(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function St(e,{size:t}){if(ve(e)>t)throw new o1({givenSize:ve(e),maxSize:t})}function Dt(e,t={}){const{signed:n}=t;t.size&&St(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function s1(e,t={}){let n=e;if(t.size&&(St(n,{size:t.size}),n=In(n)),In(n)==="0x00")return!1;if(In(n)==="0x01")return!0;throw new r1(n)}function Zt(e,t={}){return Number(Dt(e,t))}const i1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Q(e,t):typeof e=="string"?jr(e,t):typeof e=="boolean"?pu(e,t):Ae(e,t)}function pu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{size:t.size})):n}function Ae(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=i1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(St(r,{size:t.size}),rr(r,{dir:"right",size:t.size})):r}function Q(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const a=typeof e=="bigint"?"n":"";throw new du({max:s?`${s}${a}`:void 0,min:`${i}${a}`,signed:n,size:r,value:`${e}${a}`})}const c=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?rr(c,{size:r}):c}const a1=new TextEncoder;function jr(e,t={}){const n=a1.encode(e);return Ae(n,t)}const c1=new TextEncoder;function or(e,t={}){return typeof e=="number"||typeof e=="bigint"?u1(e,t):typeof e=="boolean"?l1(e,t):Et(e)?Mt(e,t):kn(e,t)}function l1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{size:t.size})):n}const Kt={zero:48,nine:57,A:65,F:70,a:97,f:102};function hu(e){if(e>=Kt.zero&&e<=Kt.nine)return e-Kt.zero;if(e>=Kt.A&&e<=Kt.F)return e-(Kt.A-10);if(e>=Kt.a&&e<=Kt.f)return e-(Kt.a-10)}function Mt(e,t={}){let n=e;t.size&&(St(n,{size:t.size}),n=rr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,c=0;i<o;i++){const a=hu(r.charCodeAt(c++)),l=hu(r.charCodeAt(c++));if(a===void 0||l===void 0)throw new V(`Invalid byte sequence ("${r[c-2]}${r[c-1]}" in "${r}").`);s[i]=a*16+l}return s}function u1(e,t){const n=Q(e,t);return Mt(n)}function kn(e,t={}){const n=c1.encode(e);return typeof t.size=="number"?(St(n,{size:t.size}),rr(n,{dir:"right",size:t.size})):n}const es=BigInt(2**32-1),mu=BigInt(32);function f1(e,t=!1){return t?{h:Number(e&es),l:Number(e>>mu&es)}:{h:Number(e>>mu&es)|0,l:Number(e&es)|0}}function d1(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l:c}=f1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const p1=(e,t,n)=>e<<n|t>>>32-n,h1=(e,t,n)=>t<<n|e>>>32-n,m1=(e,t,n)=>t<<n-32|e>>>64-n,b1=(e,t,n)=>e<<n-32|t>>>64-n,sr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function g1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function _r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Dn(e,...t){if(!g1(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function y1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");_r(e.outputLen),_r(e.blockLen)}function ir(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bu(e,t){Dn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function v1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ar(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ai(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Lt(e,t){return e<<32-t|e>>>t}const w1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function x1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function E1(e){for(let t=0;t<e.length;t++)e[t]=x1(e[t]);return e}const gu=w1?e=>e:E1;function S1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ts(e){return typeof e=="string"&&(e=S1(e)),Dn(e),e}function P1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Dn(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class $i{}function yu(e){const t=r=>e().update(ts(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function T1(e=32){if(sr&&typeof sr.getRandomValues=="function")return sr.getRandomValues(new Uint8Array(e));if(sr&&typeof sr.randomBytes=="function")return Uint8Array.from(sr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const A1=BigInt(0),zr=BigInt(1),$1=BigInt(2),N1=BigInt(7),C1=BigInt(256),O1=BigInt(113),vu=[],wu=[],xu=[];for(let e=0,t=zr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],vu.push(2*(5*r+n)),wu.push((e+1)*(e+2)/2%64);let o=A1;for(let s=0;s<7;s++)t=(t<<zr^(t>>N1)*O1)%C1,t&$1&&(o^=zr<<(zr<<BigInt(s))-zr);xu.push(o)}const Eu=d1(xu,!0),I1=Eu[0],k1=Eu[1],Su=(e,t,n)=>n>32?m1(e,t,n):p1(e,t,n),Pu=(e,t,n)=>n>32?b1(e,t,n):h1(e,t,n);function D1(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const c=(i+8)%10,a=(i+2)%10,l=n[a],u=n[a+1],f=Su(l,u,1)^n[c],p=Pu(l,u,1)^n[c+1];for(let d=0;d<50;d+=10)e[i+d]^=f,e[i+d+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){const c=wu[i],a=Su(o,s,c),l=Pu(o,s,c),u=vu[i];o=e[u],s=e[u+1],e[u]=a,e[u+1]=l}for(let i=0;i<50;i+=10){for(let c=0;c<10;c++)n[c]=e[i+c];for(let c=0;c<10;c++)e[i+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=I1[r],e[1]^=k1[r]}ar(n)}class Ni extends $i{constructor(t,n,r,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,_r(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=v1(this.state)}clone(){return this._cloneInto()}keccak(){gu(this.state32),D1(this.state32,this.rounds),gu(this.state32),this.posOut=0,this.pos=0}update(t){ir(this),t=ts(t),Dn(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let c=0;c<i;c++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ir(this,!1),Dn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return _r(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(bu(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ar(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new Ni(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const M1=(e,t,n)=>yu(()=>new Ni(t,e,n)),Tu=M1(1,136,256/8);function ke(e,t){const n=t||"hex",r=Tu(Et(e,{strict:!1})?or(e):e);return n==="bytes"?r:pn(r)}const L1=e=>ke(or(e));function B1(e){return L1(e)}function F1(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new V("Unable to normalize signature.");return o}const R1=e=>{const t=typeof e=="string"?e:Yo(e);return F1(t)};function Au(e){return B1(R1(e))}const ns=Au;let hn=class extends V{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},rs=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const Ci=new rs(8192);function os(e,t){if(Ci.has(`${e}.${t}`))return Ci.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=ke(kn(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return Ci.set(`${e}.${t}`,s),s}function mn(e,t){if(!at(e,{strict:!1}))throw new hn({address:e});return os(e,t)}const j1=/^0x[a-fA-F0-9]{40}$/,Oi=new rs(8192);function at(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Oi.has(r))return Oi.get(r);const o=j1.test(e)?e.toLowerCase()===e?!0:n?os(e)===e:!0:!1;return Oi.set(r,o),o}function Pt(e){return typeof e[0]=="string"?cr(e):_1(e)}function _1(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function cr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function lr(e,t,n,{strict:r}={}){return Et(e,{strict:!1})?z1(e,t,n,{strict:r}):Cu(e,t,n,{strict:r})}function $u(e,t){if(typeof t=="number"&&t>0&&t>ve(e)-1)throw new lu({offset:t,position:"start",size:ve(e)})}function Nu(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ve(e)!==n-t)throw new lu({offset:n,position:"end",size:ve(e)})}function Cu(e,t,n,{strict:r}={}){$u(e,t);const o=e.slice(t,n);return r&&Nu(o,t,n),o}function z1(e,t,n,{strict:r}={}){$u(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Nu(o,t,n),o}const U1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ou=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function bn(e,t){if(e.length!==t.length)throw new Hb({expectedLength:e.length,givenLength:t.length});const n=W1({params:e,values:t}),r=ki(n);return r.length===0?"0x":r}function W1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Ii({param:e[r],value:t[r]}));return n}function Ii({param:e,value:t}){const n=Di(e.type);if(n){const[r,o]=n;return V1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Y1(t,{param:e});if(e.type==="address")return H1(t);if(e.type==="bool")return q1(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Ou.exec(e.type)??[];return Z1(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return G1(t,{param:e});if(e.type==="string")return K1(t);throw new Xb(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function ki(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=ve(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Q(t+o,{size:32})),r.push(c),o+=ve(c)):n.push(c)}return Pt([...n,...r])}function H1(e){if(!at(e))throw new hn({address:e});return{dynamic:!1,encoded:dn(e.toLowerCase())}}function V1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new cu(e);if(!r&&e.length!==t)throw new Ub({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Ii({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=ki(s);if(r){const c=Q(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Pt([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Pt(s.map(({encoded:i})=>i))}}function G1(e,{param:t}){const[,n]=t.type.split("bytes"),r=ve(e);if(!n){let o=e;return r%32!==0&&(o=dn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Pt([dn(Q(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new Wb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:dn(e,{dir:"right"})}}function q1(e){if(typeof e!="boolean")throw new V(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:dn(pu(e))}}function Z1(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new du({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Q(e,{size:32,signed:t})}}function K1(e){const t=jr(e),n=Math.ceil(ve(t)/32),r=[];for(let o=0;o<n;o++)r.push(dn(lr(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Pt([dn(Q(ve(t),{size:32})),...r])}}function Y1(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,c=Ii({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?ki(r):Pt(r.map(({encoded:o})=>o))}}function Di(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Ur=e=>lr(Au(e),0,4);function Mn(e){const{abi:t,args:n=[],name:r}=e,o=Et(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Ur(c)===r:c.type==="event"?ns(c)===r:!1:"name"in c&&c.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const c of s){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((l,u)=>{const f="inputs"in c&&c.inputs[u];return f?Mi(l,f):!1})){if(i&&"inputs"in i&&i.inputs){const l=Iu(c.inputs,i.inputs,n);if(l)throw new Kb({abiItem:c,type:l[0]},{abiItem:i,type:l[1]})}i=c}}return i||s[0]}function Mi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return at(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>Mi(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Mi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Iu(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return Iu(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?at(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?at(n[r],{strict:!1}):!1)return i}}const ku="/docs/contract/encodeEventTopics";function Wr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=Mn({abi:t,name:n});if(!l)throw new iu(n,{docsPath:ku});o=l}if(o.type!=="event")throw new iu(void 0,{docsPath:ku});const s=xt(o),i=ns(s);let c=[];if(r&&"inputs"in o){const l=(a=o.inputs)==null?void 0:a.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(l==null?void 0:l.map(f=>r[f.name]))??[]:[];u.length>0&&(c=(l==null?void 0:l.map((f,p)=>Array.isArray(u[p])?u[p].map((d,h)=>Du({param:f,value:u[p][h]})):typeof u[p]<"u"&&u[p]!==null?Du({param:f,value:u[p]}):null))??[])}return[i,...c]}function Du({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return ke(or(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new e1(e.type);return bn([e],[t])}function ss(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:c,transport:a})=>{c==="success"&&t===s&&(n[i]=a.request)})),s=>n[s]||e.request}async function Mu(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,l=ss(e,{method:"eth_newFilter"}),u=s?Wr({abi:r,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?Q(i):i,toBlock:typeof a=="bigint"?Q(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:f,request:l(f),strict:!!c,type:"event"}}function Je(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Lu="/docs/contract/encodeFunctionData";function X1(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Mn({abi:t,args:n,name:r});if(!s)throw new nr(r,{docsPath:Lu});o=s}if(o.type!=="function")throw new nr(void 0,{docsPath:Lu});return{abi:[o],functionName:Ur(xt(o))}}function Tt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:X1(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?bn(o.inputs,t??[]):void 0;return cr([s,i??"0x"])}const Q1={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Bu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},J1={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Fu=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Ru=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},eg=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const tg={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new eg({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Ru({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Fu({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Fu({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Li(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(tg);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function ng(e,t={}){typeof t.size<"u"&&St(e,{size:t.size});const n=Ae(e,t);return Dt(n,t)}function rg(e,t={}){let n=e;if(typeof t.size<"u"&&(St(n,{size:t.size}),n=In(n)),n.length>1||n[0]>1)throw new n1(n);return!!n[0]}function Yt(e,t={}){typeof t.size<"u"&&St(e,{size:t.size});const n=Ae(e,t);return Zt(n,t)}function og(e,t={}){let n=e;return typeof t.size<"u"&&(St(n,{size:t.size}),n=In(n,{dir:"right"})),new TextDecoder().decode(n)}function Hr(e,t){const n=typeof t=="string"?Mt(t):t,r=Li(n);if(ve(n)===0&&e.length>0)throw new Rr;if(ve(t)&&ve(t)<32)throw new ru({data:typeof t=="string"?t:Ae(t),params:e,size:ve(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const c=e[i];r.setPosition(o);const[a,l]=ur(r,c,{staticPosition:0});o+=l,s.push(a)}return s}function ur(e,t,{staticPosition:n}){const r=Di(t.type);if(r){const[o,s]=r;return ig(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return ug(e,t,{staticPosition:n});if(t.type==="address")return sg(e);if(t.type==="bool")return ag(e);if(t.type.startsWith("bytes"))return cg(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return lg(e,t);if(t.type==="string")return fg(e,{staticPosition:n});throw new Qb(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ju=32,Bi=32;function sg(e){const t=e.readBytes(32);return[os(Ae(Cu(t,-20))),32]}function ig(e,t,{length:n,staticPosition:r}){if(!n){const i=Yt(e.readBytes(Bi)),c=r+i,a=c+ju;e.setPosition(c);const l=Yt(e.readBytes(ju)),u=Vr(t);let f=0;const p=[];for(let d=0;d<l;++d){e.setPosition(a+(u?d*32:f));const[h,m]=ur(e,t,{staticPosition:a});f+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(Vr(t)){const i=Yt(e.readBytes(Bi)),c=r+i,a=[];for(let l=0;l<n;++l){e.setPosition(c+l*32);const[u]=ur(e,t,{staticPosition:c});a.push(u)}return e.setPosition(r+32),[a,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[c,a]=ur(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function ag(e){return[rg(e.readBytes(32),{size:32}),32]}function cg(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=Yt(e.readBytes(32));e.setPosition(n+i);const c=Yt(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ae(a),32]}return[Ae(e.readBytes(Number.parseInt(o,10),32)),32]}function lg(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?ng(o,{signed:n}):Yt(o,{signed:n}),32]}function ug(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(Vr(t)){const i=Yt(e.readBytes(Bi)),c=n+i;for(let a=0;a<t.components.length;++a){const l=t.components[a];e.setPosition(c+s);const[u,f]=ur(e,l,{staticPosition:c});s+=f,o[r?a:l==null?void 0:l.name]=u}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const c=t.components[i],[a,l]=ur(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=l}return[o,s]}function fg(e,{staticPosition:t}){const n=Yt(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Yt(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=og(In(s));return e.setPosition(t+32),[i,32]}function Vr(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(Vr);const n=Di(e.type);return!!(n&&Vr({...e,type:n[1]}))}function _u(e){const{abi:t,data:n}=e,r=lr(n,0,4);if(r==="0x")throw new Rr;const s=[...t||[],Bu,J1].find(i=>i.type==="error"&&r===Ur(xt(i)));if(!s)throw new su(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Hr(s.inputs,lr(n,4)):void 0,errorName:s.name}}const $e=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function zu({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?$e(t[s]):t[s]}`).join(", ")})`}const dg={gwei:9,wei:18},pg={ether:-9,wei:9};function Fi(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function Ri(e,t="wei"){return Fi(e,dg[t])}function Ue(e,t="wei"){return Fi(e,pg[t])}class hg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class mg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Uu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
72
|
+
`,"")}function bg(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
|
|
65
73
|
`;return r.nonce&&(o+=` nonce: ${r.nonce}
|
|
66
74
|
`),r.balance&&(o+=` balance: ${r.balance}
|
|
67
75
|
`),r.code&&(o+=` code: ${r.code}
|
|
68
76
|
`),r.state&&(o+=` state:
|
|
69
|
-
`,o+=
|
|
70
|
-
`,o+=
|
|
77
|
+
`,o+=Uu(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
78
|
+
`,o+=Uu(r.stateDiff)),o},` State Override:
|
|
71
79
|
`).slice(0,-1)}function Gr(e){const t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
|
|
72
|
-
`)}class
|
|
73
|
-
${
|
|
74
|
-
`):`The contract function "${r}" reverted.`,{cause:s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=n,this.reason=a,this.signature=
|
|
75
|
-
`)})}}Object.defineProperty(Xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class
|
|
76
|
-
`)})}}Object.defineProperty(gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Qr extends He{constructor(t){super(t,{code:Qr.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Qr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Jr extends He{constructor(t){super(t,{code:Jr.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Jr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class eo extends He{constructor(t){super(t,{code:eo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Dn extends He{constructor(t,{method:n}={}){super(t,{code:Dn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Dn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class fr extends He{constructor(t){super(t,{code:fr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(fr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class to extends He{constructor(t){super(t,{code:to.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class dr extends et{constructor(t){super(t,{code:dr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(dr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class no extends et{constructor(t){super(t,{code:no.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(no,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ro extends et{constructor(t,{method:n}={}){super(t,{code:ro.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class oo extends et{constructor(t){super(t,{code:oo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class so extends et{constructor(t){super(t,{code:so.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class io extends et{constructor(t){super(t,{code:io.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class ao extends et{constructor(t){super(t,{code:ao.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class co extends et{constructor(t){super(t,{code:co.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class uo extends et{constructor(t){super(t,{code:uo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class lo extends et{constructor(t){super(t,{code:lo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class fo extends et{constructor(t){super(t,{code:fo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class po extends et{constructor(t){super(t,{code:po.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class ho extends et{constructor(t){super(t,{code:ho.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class xg extends He{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Eg=3;function pr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof is?e:e instanceof V?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:u,details:l,message:f,shortMessage:p}=c,d=e instanceof Rr?new yg({functionName:s}):[Eg,Fn.code].includes(a)&&(u||l||f||p)||a===gn.code&&l==="execution reverted"&&u?new ji({abi:t,data:typeof u=="object"?u.data:u,functionName:s,message:c instanceof _i?l:p??f}):e;return new Gl(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function Sg(e){const t=Me(`0x${e.substring(4)}`).substring(26);return os(`0x${t}`)}async function Pg({hash:e,signature:t}){const n=Et(e)?e:pn(e),{secp256k1:r}=await Promise.resolve().then(()=>r6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:l,v:f,yParity:p}=t,d=Number(p??f),h=Zl(d);return new r.Signature(kt(u),kt(l)).addRecoveryBit(h)}const i=Et(t)?t:pn(t);if(we(i)!==65)throw new Error("invalid signature length");const c=Zt(`0x${i.slice(130)}`),a=Zl(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Zl(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Yl({hash:e,signature:t}){return Sg(await Pg({hash:e,signature:t}))}function $g(e,t="hex"){const n=Kl(e),r=Li(new Uint8Array(n.length));return n.encode(r),t==="hex"?Te(r.bytes):r.bytes}function Kl(e){return Array.isArray(e)?Tg(e.map(t=>Kl(t))):Ag(e)}function Tg(e){const t=e.reduce((o,s)=>o+s.length,0),n=Xl(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function Ag(e){const t=typeof e=="string"?Bt(e):e,n=Xl(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function Xl(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new V("Length is too large.")}function Og(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=Me(cr(["0x05",$g([t?Q(t):"0x",o,n?Q(n):"0x"])]));return r==="bytes"?Bt(s):s}async function Ql(e){const{authorization:t,signature:n}=e;return Yl({hash:Og(t),signature:n??t})}class Ng extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:u,nonce:l,to:f,value:p}){var h;const d=Gr({from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${ze(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${ze(a)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${ze(u)} gwei`,nonce:l});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",d].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class hr extends V{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(hr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(hr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class as extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ze(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(as,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Ui extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${ze(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Ui,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class zi extends V{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(zi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Hi extends V{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
77
|
-
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(
|
|
78
|
-
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Vi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Gi extends V{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Gi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class qi extends V{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(qi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Zi extends V{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Zi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class cs extends V{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${
|
|
79
|
-
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(cs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class mo extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function us(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===hr.code):e;return r instanceof V?new hr({cause:e,message:r.details}):hr.nodeMessage.test(n)?new hr({cause:e,message:e.details}):as.nodeMessage.test(n)?new as({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Ui.nodeMessage.test(n)?new Ui({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):zi.nodeMessage.test(n)?new zi({cause:e,nonce:t==null?void 0:t.nonce}):Hi.nodeMessage.test(n)?new Hi({cause:e,nonce:t==null?void 0:t.nonce}):Wi.nodeMessage.test(n)?new Wi({cause:e,nonce:t==null?void 0:t.nonce}):Vi.nodeMessage.test(n)?new Vi({cause:e}):Gi.nodeMessage.test(n)?new Gi({cause:e,gas:t==null?void 0:t.gas}):qi.nodeMessage.test(n)?new qi({cause:e,gas:t==null?void 0:t.gas}):Zi.nodeMessage.test(n)?new Zi({cause:e}):cs.nodeMessage.test(n)?new cs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new mo({cause:e})}function Cg(e,{docsPath:t,...n}){const r=(()=>{const o=us(e,n);return o instanceof mo?e:o})();return new Ng(r,{docsPath:t,...n})}function ls(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const c of i)c in e&&(n[c]=e[c]),s[c]&&typeof s[c]=="object"&&!Array.isArray(s[c])&&r(s[c])}const o=t(e||{});return r(o),n}const Ig={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function bo(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Mg(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Te(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=Q(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=Q(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=Q(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=Q(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=Q(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=Q(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Ig[e.type]),typeof e.value<"u"&&(n.value=Q(e.value)),n}function Mg(e){return e.map(t=>({address:t.address,r:t.r?Q(BigInt(t.r)):t.r,s:t.s?Q(BigInt(t.s)):t.s,chainId:Q(t.chainId),nonce:Q(t.nonce),...typeof t.yParity<"u"?{yParity:Q(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Q(t.v)}:{}}))}function Jl(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new fl({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new fl({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function kg(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=Q(t)),n!==void 0&&(i.nonce=Q(n)),r!==void 0&&(i.state=Jl(r)),o!==void 0){if(i.state)throw new fg;i.stateDiff=Jl(o)}return i}function Yi(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!at(n,{strict:!1}))throw new hn({address:n});if(t[n])throw new lg({address:n});t[n]=kg(r)}return t}const ef=2n**256n-1n;function mr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?Je(t):void 0;if(s&&!at(s.address))throw new hn({address:s.address});if(o&&!at(o))throw new hn({address:o});if(n&&n>ef)throw new as({maxFeePerGas:n});if(r&&n&&r>n)throw new cs({maxFeePerGas:n,maxPriorityFeePerGas:r})}class tf extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Ki extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Bg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ze(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class nf extends V{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const rf={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Xi(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Zt(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Zt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?rf[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Lg(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function Lg(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function of(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Xi(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Tt(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var u,l,f;const s=o??!1,i=n!==void 0?Q(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!c)throw new nf({blockHash:t,blockNumber:n});return(((f=(l=(u=e.chain)==null?void 0:u.formatters)==null?void 0:l.block)==null?void 0:f.format)||of)(c,"getBlock")}async function Qi(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Fg(e,t){return sf(e,t)}async function sf(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const c=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof c=="function"){const u=n||await X(e,Tt,"getBlock")({}),l=await c({block:u,client:e,request:o});if(l===null)throw new Error;return l}if(typeof c<"u")return c;const a=await e.request({method:"eth_maxPriorityFeePerGas"});return kt(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):X(e,Tt,"getBlock")({}),X(e,Qi,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Ki;const u=a-c.baseFeePerGas;return u<0n?0n:u}}async function Dg(e,t){return Ji(e,t)}async function Ji(e,t){var p,d;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,m;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(i<1)throw new tf;const a=10**(((p=i.toString().split(".")[1])==null?void 0:p.length)??0),u=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),l=n||await X(e,Tt,"getBlock")({});if(typeof((d=r==null?void 0:r.fees)==null?void 0:d.estimateFeesPerGas)=="function"){const h=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:o,type:s});if(h!==null)return h}if(s==="eip1559"){if(typeof l.baseFeePerGas!="bigint")throw new Ki;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await sf(e,{block:l,chain:r,request:o}),m=u(l.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??u(await X(e,Qi,"getGasPrice")({}))}}async function af(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?Q(r):n]},{dedupe:!!r});return Zt(o)}function cf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>Bt(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Te(s))}function uf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Bt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>Bt(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const c=r[i],a=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(c,a)))}return n==="bytes"?s:s.map(i=>Te(i))}function Rg(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),c=Number(n&s),a=r?4:0,u=r?0:4;e.setUint32(t+a,i,r),e.setUint32(t+u,c,r)}function jg(e,t,n){return e&t^~e&n}function _g(e,t,n){return e&t^e&n^t&n}class Ug extends Ai{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ti(this.buffer)}update(t){ir(this),t=ts(t),kn(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const c=Math.min(o-this.pos,s-i);if(c===o){const a=Ti(t);for(;o<=s-i;i+=o)this.process(a,i);continue}r.set(t.subarray(i,i+c),this.pos),this.pos+=c,i+=c,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ir(this),bl(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,ar(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;Rg(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Ti(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=a/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)c.setUint32(4*f,l[f],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:i,pos:c}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=c,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const yn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),zg=Uint32Array.from([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]),wn=new Uint32Array(64);class Hg extends Ug{constructor(t=32){super(64,t,8,!1),this.A=yn[0]|0,this.B=yn[1]|0,this.C=yn[2]|0,this.D=yn[3]|0,this.E=yn[4]|0,this.F=yn[5]|0,this.G=yn[6]|0,this.H=yn[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:c,H:a}=this;return[t,n,r,o,s,i,c,a]}set(t,n,r,o,s,i,c,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=c|0,this.H=a|0}process(t,n){for(let f=0;f<16;f++,n+=4)wn[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=wn[f-15],d=wn[f-2],h=Lt(p,7)^Lt(p,18)^p>>>3,m=Lt(d,17)^Lt(d,19)^d>>>10;wn[f]=m+wn[f-7]+h+wn[f-16]|0}let{A:r,B:o,C:s,D:i,E:c,F:a,G:u,H:l}=this;for(let f=0;f<64;f++){const p=Lt(c,6)^Lt(c,11)^Lt(c,25),d=l+p+jg(c,a,u)+zg[f]+wn[f]|0,m=(Lt(r,2)^Lt(r,13)^Lt(r,22))+_g(r,o,s)|0;l=u,u=a,a=c,c=i+d|0,i=s,s=o,o=r,r=d+m|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,c=c+this.E|0,a=a+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(r,o,s,i,c,a,u,l)}roundClean(){ar(wn)}destroy(){this.set(0,0,0,0,0,0,0,0),ar(this.buffer)}}const lf=yl(()=>new Hg),Wg=lf;function Vg(e,t){return Wg(Et(e,{strict:!1})?or(e):e)}function Gg(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=Vg(t);return o.set([n],0),r==="bytes"?o:Te(o)}function qg(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(Gg({commitment:s,to:r,version:n}));return o}const ff=6,df=32,ea=4096,pf=df*ea,hf=pf*ff-1-1*ea*ff;class Zg extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Yg extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function Kg(e){const t=typeof e.data=="string"?Bt(e.data):e.data,n=we(t);if(!n)throw new Yg;if(n>hf)throw new Zg({maxSize:hf,size:n});const r=[];let o=!0,s=0;for(;o;){const i=Li(new Uint8Array(pf));let c=0;for(;c<ea;){const a=t.slice(s,s+(df-1));if(i.pushByte(0),i.pushBytes(a),a.length<31){i.pushByte(128),o=!1;break}c++,s+=31}r.push(i)}return r.map(i=>Te(i.bytes))}function Xg(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??Kg({data:t}),s=e.commitments??cf({blobs:o,kzg:n,to:r}),i=e.proofs??uf({blobs:o,commitments:s,kzg:n,to:r}),c=[];for(let a=0;a<o.length;a++)c.push({blob:o[a],commitment:s[a],proof:i[a]});return c}function Qg(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new pg({transaction:e})}function Jg(e,{docsPath:t,...n}){const r=(()=>{const o=us(e,n);return o instanceof mo?e:o})();return new hg(r,{docsPath:t,...n})}async function ta(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Zt(t)}async function mf(e,t){var b,g,v,C,O;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:c,data:a,gas:u,gasPrice:l,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:h,nonceManager:m,to:w,type:$,value:E,...S}=t,N=await(async()=>{if(!n||!m||typeof h<"u")return h;const I=Je(n),M=s?s.id:await X(e,ta,"getChainId")({});return await m.consume({address:I.address,chainId:M,client:e})})();mr(t);const B=(g=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:g.format,D=(B||bo)({...ls(S,{format:B}),account:n?Je(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:u,gasPrice:l,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:N,to:w,type:$,value:E},"fillTransaction");try{const I=await e.request({method:"eth_fillTransaction",params:[D]}),y=(((C=(v=s==null?void 0:s.formatters)==null?void 0:v.transaction)==null?void 0:C.format)||Xi)(I.tx);delete y.blockHash,delete y.blockNumber,delete y.r,delete y.s,delete y.transactionIndex,delete y.v,delete y.yParity,y.data=y.input,y.gas&&(y.gas=t.gas??y.gas),y.gasPrice&&(y.gasPrice=t.gasPrice??y.gasPrice),y.maxFeePerBlobGas&&(y.maxFeePerBlobGas=t.maxFeePerBlobGas??y.maxFeePerBlobGas),y.maxFeePerGas&&(y.maxFeePerGas=t.maxFeePerGas??y.maxFeePerGas),y.maxPriorityFeePerGas&&(y.maxPriorityFeePerGas=t.maxPriorityFeePerGas??y.maxPriorityFeePerGas),y.nonce&&(y.nonce=t.nonce??y.nonce);const A=await(async()=>{var j,z;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await X(e,Tt,"getBlock")({});return s.fees.baseFeeMultiplier({block:_,client:e,request:t})}return((z=s==null?void 0:s.fees)==null?void 0:z.baseFeeMultiplier)??1.2})();if(A<1)throw new tf;const P=10**(((O=A.toString().split(".")[1])==null?void 0:O.length)??0),L=j=>j*BigInt(Math.ceil(A*P))/BigInt(P);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:I.raw,transaction:{from:D.from,...y}}}catch(I){throw Jg(I,{...t,chain:e.chain})}}const ey=["blobVersionedHashes","chainId","fees","gas","nonce","type"],bf=new Map,na=new rs(128);async function gf(e,t){var N,B,F;let n=t;const{account:r=e.account,chain:o=e.chain,nonceManager:s,parameters:i=ey}=n,c=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let a;async function u(){return a||(typeof n.chainId<"u"?n.chainId:o?o.id:(a=await X(e,ta,"getChainId")({}),a))}const l=r&&Je(r);let f=n.nonce;if(i.includes("nonce")&&typeof f>"u"&&l&&s){const D=await u();f=await s.consume({address:l.address,chainId:D,client:e})}c!=null&&c.fn&&((N=c.runAt)!=null&&N.includes("beforeFillTransaction"))&&(n=await c.fn(n,{phase:"beforeFillTransaction"}),f??(f=n.nonce));const d=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||na.get(e.uid)===!1||!["fees","gas"].some(b=>i.includes(b))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof f!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await X(e,mf,"fillTransaction")({...n,nonce:f}).then(D=>{const{chainId:b,from:g,gas:v,gasPrice:C,nonce:O,maxFeePerBlobGas:I,maxFeePerGas:M,maxPriorityFeePerGas:y,type:A,...T}=D.transaction;return na.set(e.uid,!0),{...n,...g?{from:g}:{},...A?{type:A}:{},...typeof b<"u"?{chainId:b}:{},...typeof v<"u"?{gas:v}:{},...typeof C<"u"?{gasPrice:C}:{},...typeof O<"u"?{nonce:O}:{},...typeof I<"u"?{maxFeePerBlobGas:I}:{},...typeof M<"u"?{maxFeePerGas:M}:{},...typeof y<"u"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in T&&typeof T.nonceKey<"u"?{nonceKey:T.nonceKey}:{}}}).catch(D=>{var v;const b=D;return((v=b.walk)==null?void 0:v.call(b,C=>{const O=C;return O.name==="MethodNotFoundRpcError"||O.name==="MethodNotSupportedRpcError"}))&&na.set(e.uid,!1),n}):n;f??(f=d.nonce),n={...d,...l?{from:l==null?void 0:l.address}:{},...f?{nonce:f}:{}};const{blobs:h,gas:m,kzg:w,type:$}=n;c!=null&&c.fn&&((B=c.runAt)!=null&&B.includes("beforeFillParameters"))&&(n=await c.fn(n,{phase:"beforeFillParameters"}));let E;async function S(){return E||(E=await X(e,Tt,"getBlock")({blockTag:"latest"}),E)}if(i.includes("nonce")&&typeof f>"u"&&l&&!s&&(n.nonce=await X(e,af,"getTransactionCount")({address:l.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&w){const D=cf({blobs:h,kzg:w});if(i.includes("blobVersionedHashes")){const b=qg({commitments:D,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=uf({blobs:h,commitments:D,kzg:w}),g=Xg({blobs:h,commitments:D,proofs:b,to:"hex"});n.sidecars=g}}if(i.includes("chainId")&&(n.chainId=await u()),(i.includes("fees")||i.includes("type"))&&typeof $>"u")try{n.type=Qg(n)}catch{let D=bf.get(e.uid);if(typeof D>"u"){const b=await S();D=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",bf.set(e.uid,D)}n.type=D?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const D=await S(),{maxFeePerGas:b,maxPriorityFeePerGas:g}=await Ji(e,{block:D,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new Bg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Ki;if(typeof n.gasPrice>"u"){const D=await S(),{gasPrice:b}=await Ji(e,{block:D,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await X(e,ra,"estimateGas")({...n,account:l,prepare:(l==null?void 0:l.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((F=c.runAt)!=null&&F.includes("afterFillParameters"))&&(n=await c.fn(n,{phase:"afterFillParameters"})),mr(n),delete n.parameters,n}async function ra(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?Je(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const u=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Ql({authorization:t.authorizationList[0]}).catch(()=>{throw new V("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:l,authorizationList:f,blobs:p,blobVersionedHashes:d,blockNumber:h,blockTag:m,data:w,gas:$,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:N,maxPriorityFeePerGas:B,nonce:F,value:D,stateOverride:b,...g}=r?await gf(e,{...t,parameters:s,to:u}):t;if($&&t.gas!==$)return $;const C=(typeof h=="bigint"?Q(h):void 0)||m,O=Yi(b);mr(t);const I=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,y=(I||bo)({...ls(g,{format:I}),account:o,accessList:l,authorizationList:f,blobs:p,blobVersionedHashes:d,data:w,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:N,maxPriorityFeePerGas:B,nonce:F,to:u,value:D},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:O?[y,C??e.experimental_blockTag??"latest",O]:C?[y,C]:[y]}))}catch(u){throw Cg(u,{...t,account:o,chain:e.chain})}}async function ty(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:i,...c}=t,a=$t({abi:n,args:o,functionName:s});try{return await X(e,ra,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(u){const l=c.account?Je(c.account):void 0;throw pr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:l==null?void 0:l.address})}}function go(e,t){if(!at(e,{strict:!1}))throw new hn({address:e});if(!at(t,{strict:!1}))throw new hn({address:t});return e.toLowerCase()===t.toLowerCase()}const yf="/docs/contract/decodeEventLog";function fs(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new zb({docsPath:yf});const a=t.find(m=>m.type==="event"&&i===ns(xt(m)));if(!(a&&"name"in a)||a.type!=="event")throw new Hb(i,{docsPath:yf});const{name:u,inputs:l}=a,f=l==null?void 0:l.some(m=>!("name"in m&&m.name)),p=f?[]:{},d=l.map((m,w)=>[m,w]).filter(([m])=>"indexed"in m&&m.indexed);for(let m=0;m<d.length;m++){const[w,$]=d[m],E=c[m];if(!E)throw new $i({abiItem:a,param:w});p[f?$:w.name||$]=ny({param:w,value:E})}const h=l.filter(m=>!("indexed"in m&&m.indexed));if(h.length>0){if(n&&n!=="0x")try{const m=Wr(h,n);if(m)if(f)for(let w=0;w<l.length;w++)p[w]=p[w]??m.shift();else for(let w=0;w<h.length;w++)p[h[w].name]=m[w]}catch(m){if(s)throw m instanceof rl||m instanceof Rl?new Jo({abiItem:a,data:n,params:h,size:we(n)}):m}else if(s)throw new Jo({abiItem:a,data:"0x",params:h,size:0})}return{eventName:u,args:Object.values(p).length>0?p:void 0}}function ny({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Wr([e],t)||[])[0]}function oa(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(i=>{var l;const c=t.filter(f=>f.type==="event"&&i.topics[0]===ns(f));if(c.length===0)return null;let a,u;for(const f of c)try{a=fs({...i,abi:[f],strict:!0}),u=f;break}catch{}if(!a&&!o){u=c[0];try{a=fs({...i,abi:[u],strict:!1})}catch{const f=(l=u.inputs)==null?void 0:l.some(p=>!("name"in p&&p.name));return{...i,args:f?[]:{},eventName:u.name}}}return!a||!u||s&&!s.includes(a.eventName)||!ry({args:a.args,inputs:u.inputs,matchArgs:n})?null:{...a,...i}}).filter(Boolean)}function ry(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,c){try{return s.type==="address"?go(i,c):s.type==="string"||s.type==="bytes"?Me(or(i))===c:i===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const c=n[i];return c?(Array.isArray(s)?s:[s]).some(u=>o(c,u,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const c=n.find(u=>u.name===s);return c?(Array.isArray(i)?i:[i]).some(u=>o(c,u,t[s])):!1}):!1}function Xt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function sa(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:c,strict:a}={}){const u=a??!1,l=i??(s?[s]:void 0);let f=[];l&&(f=[l.flatMap(m=>Hr({abi:[m],eventName:m.name,args:i?void 0:c}))],s&&(f=f[0]));let p;n?p=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):p=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?Q(r):r,toBlock:typeof o=="bigint"?Q(o):o}]});const d=p.map(h=>Xt(h));return l?oa({abi:l,args:c,logs:d,strict:u}):d}async function wf(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:u}=t,l=i?Bn({abi:n,name:i}):void 0,f=l?void 0:n.filter(p=>p.type==="event");return X(e,sa,"getLogs")({address:r,args:o,blockHash:s,event:l,events:f,fromBlock:c,toBlock:a,strict:u})}const ia="/docs/contract/decodeFunctionResult";function Rn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Bn({abi:t,args:n,name:r});if(!c)throw new nr(r,{docsPath:ia});s=c}if(s.type!=="function")throw new nr(void 0,{docsPath:ia});if(!s.outputs)throw new al(s.name,{docsPath:ia});const i=Wr(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const aa=BigInt(0),ca=BigInt(1);function yo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ua(e){if(!yo(e))throw new Error("Uint8Array expected")}function wo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function ds(e){const t=e.toString(16);return t.length&1?"0"+t:t}function vf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?aa:BigInt("0x"+e)}const xf=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",oy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function vo(e){if(ua(e),xf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=oy[e[n]];return t}const Qt={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ef(e){if(e>=Qt._0&&e<=Qt._9)return e-Qt._0;if(e>=Qt.A&&e<=Qt.F)return e-(Qt.A-10);if(e>=Qt.a&&e<=Qt.f)return e-(Qt.a-10)}function ps(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(xf)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const i=Ef(e.charCodeAt(s)),c=Ef(e.charCodeAt(s+1));if(i===void 0||c===void 0){const a=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+s)}r[o]=i*16+c}return r}function jn(e){return vf(vo(e))}function Sf(e){return ua(e),vf(vo(Uint8Array.from(e).reverse()))}function xo(e,t){return ps(e.toString(16).padStart(t*2,"0"))}function Pf(e,t){return xo(e,t).reverse()}function ct(e,t,n){let r;if(typeof t=="string")try{r=ps(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(yo(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function hs(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];ua(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const la=e=>typeof e=="bigint"&&aa<=e;function fa(e,t,n){return la(e)&&la(t)&&la(n)&&t<=e&&e<n}function br(e,t,n,r){if(!fa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function sy(e){let t;for(t=0;e>aa;e>>=ca,t+=1);return t}const ms=e=>(ca<<BigInt(e))-ca,da=e=>new Uint8Array(e),$f=e=>Uint8Array.from(e);function iy(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=da(e),o=da(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=da(0))=>{o=c($f([0]),f),r=c(),f.length!==0&&(o=c($f([1]),f),r=c())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const p=[];for(;f<t;){r=c();const d=r.slice();p.push(d),f+=r.length}return hs(...p)};return(f,p)=>{i(),a(f);let d;for(;!(d=p(u()));)a();return i(),d}}const ay={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||yo(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function bs(e,t,n={}){const r=(o,s,i)=>{const c=ay[s];if(typeof c!="function")throw new Error("invalid validator function");const a=e[o];if(!(i&&a===void 0)&&!c(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+a)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function Tf(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const cy="0.1.1";function uy(){return cy}class ie extends Error{constructor(t,n={}){const r=(()=>{var a;if(n.cause instanceof ie){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof ie&&n.cause.docsPath||n.docsPath,i=`https://oxlib.sh${o??""}`,c=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0]:[]].filter(a=>typeof a=="string").join(`
|
|
80
|
-
`);super(c,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${uy()}`}),this.cause=n.cause,this.details=r,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return Af(this,t)}}function Af(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Af(e.cause,t):t?null:e}function Eo(e,t){if(gr(e)>t)throw new Ty({givenSize:gr(e),maxSize:t})}const Jt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Of(e){if(e>=Jt.zero&&e<=Jt.nine)return e-Jt.zero;if(e>=Jt.A&&e<=Jt.F)return e-(Jt.A-10);if(e>=Jt.a&&e<=Jt.f)return e-(Jt.a-10)}function ly(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Ay({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function Nf(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function gs(e,t){if(tt(e)>t)throw new ky({givenSize:tt(e),maxSize:t})}function fy(e,t){if(typeof t=="number"&&t>0&&t>tt(e)-1)throw new _f({offset:t,position:"start",size:tt(e)})}function dy(e,t,n){if(typeof t=="number"&&typeof n=="number"&&tt(e)!==n-t)throw new _f({offset:n,position:"end",size:tt(e)})}function Cf(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new By({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const py="#__bigint";function If(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+py:o,n)}const hy=new TextDecoder,my=new TextEncoder;function by(e){return e instanceof Uint8Array?e:typeof e=="string"?Mf(e):gy(e)}function gy(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Mf(e,t={}){const{size:n}=t;let r=e;n&&(gs(e,n),r=Un(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let c=0,a=0;c<s;c++){const u=Of(o.charCodeAt(a++)),l=Of(o.charCodeAt(a++));if(u===void 0||l===void 0)throw new ie(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=u*16+l}return i}function yy(e,t={}){const{size:n}=t,r=my.encode(e);return typeof n=="number"?(Eo(r,n),wy(r,n)):r}function wy(e,t){return ly(e,{dir:"right",size:t})}function gr(e){return e.length}function vy(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function xy(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Ot(e,t);return Lf(r,t)}function Ey(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Eo(r,n),r=kf(r)),r.length>1||r[0]>1)throw new $y(r);return!!r[0]}function en(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Ot(e,t);return Ff(r,t)}function Sy(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Eo(r,n),r=Py(r)),hy.decode(r)}function kf(e){return Nf(e,{dir:"left"})}function Py(e){return Nf(e,{dir:"right"})}class $y extends ie{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let Ty=class extends ie{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Ay=class extends ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const Oy=new TextEncoder,Ny=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Cy(e,t={}){const{strict:n=!1}=t;if(!e)throw new Rf(e);if(typeof e!="string")throw new Rf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new jf(e);if(!e.startsWith("0x"))throw new jf(e)}function At(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Iy(e){return e instanceof Uint8Array?Ot(e):Array.isArray(e)?Ot(new Uint8Array(e)):e}function Bf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(gs(n,t.size),_n(n,t.size)):n}function Ot(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Ny[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(gs(r,t.size),Un(r,t.size)):r}function Le(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const u=typeof e=="bigint"?"n":"";throw new Df({max:s?`${s}${u}`:void 0,min:`${i}${u}`,signed:n,size:r,value:`${e}${u}`})}const a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?_n(a,r):a}function pa(e,t={}){return Ot(Oy.encode(e),t)}function _n(e,t){return Cf(e,{dir:"left",size:t})}function Un(e,t){return Cf(e,{dir:"right",size:t})}function Ft(e,t,n,r={}){const{strict:o}=r;fy(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&dy(s,t,n),s}function tt(e){return Math.ceil((e.length-2)/2)}function Lf(e,t={}){const{signed:n}=t;t.size&&gs(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function Ff(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Lf(e,t))}function My(e,t={}){const{strict:n=!1}=t;try{return Cy(e,{strict:n}),!0}catch{return!1}}class Df extends ie{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class Rf extends ie{constructor(t){super(`Value \`${typeof t=="object"?If(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class jf extends ie{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class ky extends ie{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class _f extends ie{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class By extends ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function Ly(e){return{address:e.address,amount:Le(e.amount),index:Le(e.index),validatorIndex:Le(e.validatorIndex)}}function Uf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Le(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Le(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Le(e.gasLimit)},...typeof e.number=="bigint"&&{number:Le(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Le(e.prevRandao)},...typeof e.time=="bigint"&&{time:Le(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Ly)}}}const ys=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ha=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],zf=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Hf=[...zf,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Fy=[...zf,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],Wf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Vf=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Gf=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],qf=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],yr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],Dy="0x82ad56cb",Zf="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Ry="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",jy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",ma="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class ba extends V{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class Yf extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const ga="/docs/contract/encodeDeployData";function ya(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new Db({docsPath:ga});if(!("inputs"in o))throw new nl({docsPath:ga});if(!o.inputs||o.inputs.length===0)throw new nl({docsPath:ga});const s=bn(o.inputs,n);return cr([r,s])}function wr({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new ba({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new ba({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Kf(e,{docsPath:t,...n}){const r=(()=>{const o=us(e,n);return o instanceof mo?e:o})();return new Vl(r,{docsPath:t,...n})}function Xf(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const wa=new Map;function Qf({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const l=a();i();const f=l.map(({args:p})=>p);f.length!==0&&e(f).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let d=0;d<l.length;d++){const{resolve:h}=l[d];h==null||h([p[d],p])}}).catch(p=>{for(let d=0;d<l.length;d++){const{reject:h}=l[d];h==null||h(p)}})},i=()=>wa.delete(t),c=()=>a().map(({args:l})=>l),a=()=>wa.get(t)||[],u=l=>wa.set(t,[...a(),l]);return{flush:i,async schedule(l){const{promise:f,resolve:p,reject:d}=Xf();return(n==null?void 0:n([...c(),l]))&&s(),a().length>0?(u({args:l,resolve:p,reject:d}),f):(u({args:l,resolve:p,reject:d}),setTimeout(s,r),f)}}}async function So(e,t){var I,M,y,A;const{account:n=e.account,authorizationList:r,batch:o=!!((I=e.batch)!=null&&I.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:c,blobs:a,blockOverrides:u,code:l,data:f,factory:p,factoryData:d,gas:h,gasPrice:m,maxFeePerBlobGas:w,maxFeePerGas:$,maxPriorityFeePerGas:E,nonce:S,to:N,value:B,stateOverride:F,...D}=t,b=n?Je(n):void 0;if(l&&(p||d))throw new V("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&N)throw new V("Cannot provide both `code` & `to` as parameters.");const g=l&&f,v=p&&d&&N&&f,C=g||v,O=g?Jf({code:l,data:f}):v?zy({data:f,factory:p,factoryData:d,to:N}):f;try{mr(t);const P=(typeof s=="bigint"?Q(s):void 0)||i,L=u?Uf(u):void 0,j=Yi(F),z=(A=(y=(M=e.chain)==null?void 0:M.formatters)==null?void 0:y.transactionRequest)==null?void 0:A.format,W=(z||bo)({...ls(D,{format:z}),accessList:c,account:b,authorizationList:r,blobs:a,data:O,gas:h,gasPrice:m,maxFeePerBlobGas:w,maxFeePerGas:$,maxPriorityFeePerGas:E,nonce:S,to:C?void 0:N,value:B},"call");if(o&&_y({request:W})&&!j&&!L)try{return await Uy(e,{...W,blockNumber:s,blockTag:i})}catch(H){if(!(H instanceof Yf)&&!(H instanceof ba))throw H}const K=(()=>{const H=[W,P];return j&&L?[...H,j,L]:j?[...H,j]:L?[...H,{},L]:H})(),G=await e.request({method:"eth_call",params:K});return G==="0x"?{data:void 0}:{data:G}}catch(T){const P=Hy(T),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>Uw);if(e.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===j&&N)return{data:await L(e,{data:P,to:N})};throw C&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new wg({factory:p}):Kf(T,{...t,account:b,chain:e.chain})}}function _y({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Dy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Uy(e,t){var m;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((m=e.batch)==null?void 0:m.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",data:c,to:a}=t,u=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return wr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Yf})(),f=(typeof s=="bigint"?Q(s):void 0)||i,{schedule:p}=Qf({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch(w){return w.reduce((E,{data:S})=>E+(S.length-2),0)>n*2},fn:async w=>{const $=w.map(N=>({allowFailure:!0,callData:N.data,target:N.to})),E=$t({abi:ys,args:[$],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...u===null?{data:Jf({code:ma,data:E})}:{to:u,data:E}},f]});return Rn({abi:ys,args:[$],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:d,success:h}]=await p({data:c,to:a});if(!h)throw new is({data:d});return d==="0x"?{data:void 0}:{data:d}}function Jf(e){const{code:t,data:n}=e;return ya({abi:Xu(["constructor(bytes, bytes)"]),bytecode:Zf,args:[t,n]})}function zy(e){const{data:t,factory:n,factoryData:r,to:o}=e;return ya({abi:Xu(["constructor(address, bytes, address, bytes)"]),bytecode:Ry,args:[o,t,n,r]})}function Hy(e){var n;if(!(e instanceof V))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Nt(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=$t({abi:n,args:o,functionName:s});try{const{data:a}=await X(e,So,"call")({...i,data:c,to:r});return Rn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw pr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function Wy(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:i,...c}=t,a=c.account?Je(c.account):e.account,u=$t({abi:n,args:o,functionName:i});try{const{data:l}=await X(e,So,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...c,account:a}),f=Rn({abi:n,args:o,functionName:i,data:l||"0x"}),p=n.filter(d=>"name"in d&&d.name===t.functionName);return{result:f,request:{abi:p,address:r,args:o,dataSuffix:s,functionName:i,...c,account:a}}}catch(l){throw pr(l,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:a==null?void 0:a.address})}}const va=new Map,ed=new Map;let Vy=0;function vn(e,t,n){const r=++Vy,o=()=>va.get(e)||[],s=()=>{const l=o();va.set(e,l.filter(f=>f.id!==r))},i=()=>{const l=o();if(!l.some(p=>p.id===r))return;const f=ed.get(e);if(l.length===1&&f){const p=f();p instanceof Promise&&p.catch(()=>{})}s()},c=o();if(va.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return i;const a={};for(const l in t)a[l]=(...f)=>{var d,h;const p=o();if(p.length!==0)for(const m of p)(h=(d=m.fns)[l])==null||h.call(d,...f)};const u=n(a);return typeof u=="function"&&ed.set(e,u),i}async function xa(e){return new Promise(t=>setTimeout(t,e))}function Po(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let c;t&&(c=await e({unpoll:s}));const a=await(n==null?void 0:n(c))??r;await xa(a);const u=async()=>{o&&(await e({unpoll:s}),await xa(r),u())};u()})(),s}const Gy=new Map,qy=new Map;function Zy(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,Gy),r=t(e,qy);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function Yy(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Zy(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const Ky=e=>`blockNumber.${e}`;async function $o(e,{cacheTime:t=e.cacheTime}={}){const n=await Yy(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Ky(e.uid),cacheTime:t});return BigInt(n)}async function ws(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const o=r.map(s=>Xt(s));return!("abi"in t)||!t.abi?o:oa({abi:t.abi,logs:o,strict:n})}async function vs(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function Xy(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:c,onError:a,onLogs:u,poll:l,pollingInterval:f=e.pollingInterval,strict:p}=t;return(typeof l<"u"?l:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const w=p??!1,$=Ae(["watchContractEvent",r,o,s,e.uid,i,f,w,c]);return vn($,{onLogs:u,onError:a},E=>{let S;c!==void 0&&(S=c-1n);let N,B=!1;const F=Po(async()=>{var D;if(!B){try{N=await X(e,Bl,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:w,fromBlock:c})}catch{}B=!0;return}try{let b;if(N)b=await X(e,ws,"getFilterChanges")({filter:N});else{const g=await X(e,$o,"getBlockNumber")({});S&&S<g?b=await X(e,wf,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:S+1n,toBlock:g,strict:w}):b=[],S=g}if(b.length===0)return;if(s)E.onLogs(b);else for(const g of b)E.onLogs([g])}catch(b){N&&b instanceof gn&&(B=!1),(D=E.onError)==null||D.call(E,b)}},{emitOnBegin:!0,interval:f});return async()=>{N&&await X(e,vs,"uninstallFilter")({filter:N}),F()}})})():(()=>{const w=p??!1,$=Ae(["watchContractEvent",r,o,s,e.uid,i,f,w]);let E=!0,S=()=>E=!1;return vn($,{onLogs:u,onError:a},N=>((async()=>{try{const B=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),F=i?Hr({abi:n,eventName:i,args:o}):[],{unsubscribe:D}=await B.subscribe({params:["logs",{address:r,topics:F}],onData(b){var v;if(!E)return;const g=b.result;try{const{eventName:C,args:O}=fs({abi:n,data:g.data,topics:g.topics,strict:p}),I=Xt(g,{args:O,eventName:C});N.onLogs([I])}catch(C){let O,I;if(C instanceof Jo||C instanceof $i){if(p)return;O=C.abiItem.name,I=(v=C.abiItem.inputs)==null?void 0:v.some(y=>!("name"in y&&y.name))}const M=Xt(g,{args:I?[]:{},eventName:O});N.onLogs([M])}},onError(b){var g;(g=N.onError)==null||g.call(N,b)}});S=D,E||S()}catch(B){a==null||a(B)}})(),()=>S()))})()}async function Qy(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Ea(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:c=0}={})=>{const a=async({error:u})=>{const l=typeof t=="function"?t({count:c,error:u}):t;l&&await xa(l),i({count:c+1})};try{const u=await e();o(u)}catch(u){if(c<n&&await r({count:c,error:u}))return a({error:u});s(u)}};i()})}const Jy={"0x0":"reverted","0x1":"success"};function td(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>Xt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Zt(e.transactionIndex):null,status:e.status?Jy[e.status]:null,type:e.type?rf[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Sa=256;let xs=Sa,Es;function nd(e=11){if(!Es||xs+e>Sa*2){Es="",xs=0;for(let t=0;t<Sa;t++)Es+=(256+Math.random()*256|0).toString(16).substring(1)}return Es.substring(xs,xs+++e)}function ew(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:i="base"}=e,c=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),a=(n==null?void 0:n.blockTime)??12e3,u=Math.min(Math.max(Math.floor(a/2),500),4e3),l=e.pollingInterval??u,f=e.cacheTime??l,p=e.account?Je(e.account):void 0,{config:d,request:h,value:m}=e.transport({account:p,chain:n,pollingInterval:l}),w={...d,...m},$={account:p,batch:t,cacheTime:f,ccipRead:r,chain:n,key:o,name:s,pollingInterval:l,request:h,transport:w,type:i,uid:nd(),...c?{experimental_blockTag:c}:{}};function E(S){return N=>{const B=N(S);for(const D in $)delete B[D];const F={...S,...B};return Object.assign(F,{extend:E(F)})}}return Object.assign($,{extend:E($)})}function Pa(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof ji);return t instanceof ji?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((c=t.data)==null?void 0:c.errorName)==="UnsupportedResolverProfile":!1}function tw(e){const{abi:t,data:n}=e,r=ur(n,0,4),o=t.find(s=>s.type==="function"&&r===zr(xt(s)));if(!o)throw new Wb(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Wr(o.inputs,ur(n,4)):void 0}}const $a="/docs/contract/encodeErrorResult";function rd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Bn({abi:t,args:r,name:n});if(!a)throw new ol(n,{docsPath:$a});o=a}if(o.type!=="error")throw new ol(void 0,{docsPath:$a});const s=xt(o),i=zr(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new Ub(o.name,{docsPath:$a});c=bn(o.inputs,r)}return cr([i,c])}const Ta="/docs/contract/encodeFunctionResult";function nw(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Bn({abi:t,name:n});if(!i)throw new nr(n,{docsPath:Ta});o=i}if(o.type!=="function")throw new nr(void 0,{docsPath:Ta});if(!o.outputs)throw new al(o.name,{docsPath:Ta});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new cl(r)})();return bn(o.outputs,s)}const To="x-batch-gateway:true";async function od(e){const{data:t,ccipRequest:n}=e,{args:[r]}=tw({abi:ha,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(To)?await od({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=rw(a)}})),nw({abi:ha,functionName:"query",result:[o,s]})}function rw(e){return e.name==="HttpRequestError"&&e.status?rd({abi:ha,errorName:"HttpError",args:[e.status,e.shortMessage]}):rd({abi:[Fl],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function sd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Et(t)?t:null}function Aa(e){let t=new Uint8Array(32).fill(0);if(!e)return Te(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=sd(n[r]),s=o?or(o):Me(Mn(n[r]),"bytes");t=Me(Pt([t,s]),"bytes")}return Te(t)}function ow(e){return`[${e.slice(2)}]`}function sw(e){const t=new Uint8Array(32).fill(0);return e?sd(e)||Me(Mn(e)):Te(t)}function Oa(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Mn(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=Mn(o[s]);i.byteLength>255&&(i=Mn(ow(sw(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function iw(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return wr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),l=a==null?void 0:a.ensTlds;if(l&&!l.some(p=>s.endsWith(p)))return null;const f=o!=null?[Aa(s),BigInt(o)]:[Aa(s)];try{const p=$t({abi:Vf,functionName:"addr",args:f}),d={address:u,abi:Hf,functionName:"resolveWithGateways",args:[pn(Oa(s)),p,i??[To]],blockNumber:n,blockTag:r},m=await X(e,Nt,"readContract")(d);if(m[0]==="0x")return null;const w=Rn({abi:Vf,args:f,functionName:"addr",data:m[0]});return w==="0x"||In(w)==="0x00"?null:w}catch(p){if(c)throw p;if(Pa(p))return null;throw p}}class aw extends V{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Ao extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Na extends V{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class cw extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const uw=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,lw=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,fw=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dw=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function pw(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function id(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function ad({uri:e,gatewayUrls:t}){const n=fw.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=id(t==null?void 0:t.ipfs,"https://ipfs.io"),o=id(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(uw),{protocol:i,subpath:c,target:a,subtarget:u=""}=(s==null?void 0:s.groups)||{},l=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||lw.test(e);if(e.startsWith("http")&&!l&&!f){let d=e;return t!=null&&t.arweave&&(d=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:d,isOnChain:!1,isEncoded:!1}}if((l||f)&&a)return{uri:`${r}/${l?"ipns":"ipfs"}/${a}${u}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&a)return{uri:`${o}/${a}${u||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(dw,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new Na({uri:e})}function cd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new aw({data:e});return e.image||e.image_url||e.image_data}async function hw({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await Ca({gatewayUrls:e,uri:cd(n)})}catch{throw new Na({uri:t})}}async function Ca({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=ad({uri:t,gatewayUrls:e});if(r||await pw(n))return n;throw new Na({uri:t})}function mw(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[c,a]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Ao({reason:"Only EIP-155 supported"});if(!i)throw new Ao({reason:"Chain ID not found"});if(!a)throw new Ao({reason:"Contract address not found"});if(!o)throw new Ao({reason:"Token ID not found"});if(!c)throw new Ao({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function bw(e,{nft:t}){if(t.namespace==="erc721")return Nt(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Nt(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new cw({namespace:t.namespace})}async function gw(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?yw(e,{gatewayUrls:t,record:n}):Ca({uri:n,gatewayUrls:t})}async function yw(e,{gatewayUrls:t,record:n}){const r=mw(n),o=await bw(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=ad({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const u=c?atob(s.replace("data:application/json;base64,","")):s,l=JSON.parse(u);return Ca({uri:cd(l),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),hw({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function ud(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return wr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),l=a==null?void 0:a.ensTlds;if(l&&!l.some(f=>s.endsWith(f)))return null;try{const f={address:u,abi:Hf,args:[pn(Oa(s)),$t({abi:Wf,functionName:"text",args:[Aa(s),o]}),i??[To]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},d=await X(e,Nt,"readContract")(f);if(d[0]==="0x")return null;const h=Rn({abi:Wf,functionName:"text",data:d[0]});return h===""?null:h}catch(f){if(c)throw f;if(Pa(f))return null;throw f}}async function ww(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await X(e,ud,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await gw(e,{record:a,gatewayUrls:r})}catch{return null}}async function vw(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:c}=t,{chain:a}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return wr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const l={address:u,abi:Fy,args:[n,s,i??[To]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=X(e,Nt,"readContract"),[p]=await f(l);return p||null}catch(l){if(c)throw l;if(Pa(l))return null;throw l}}async function xw(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return wr({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),c=s==null?void 0:s.ensTlds;if(c&&!c.some(u=>o.endsWith(u)))throw new Error(`${o} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[a]=await X(e,Nt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[pn(Oa(o))],blockNumber:n,blockTag:r});return a}async function ld(e,t){var w,$,E;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:u,maxFeePerGas:l,maxPriorityFeePerGas:f,to:p,value:d,...h}=t,m=n?Je(n):void 0;try{mr(t);const N=(typeof r=="bigint"?Q(r):void 0)||o,B=(E=($=(w=e.chain)==null?void 0:w.formatters)==null?void 0:$.transactionRequest)==null?void 0:E.format,D=(B||bo)({...ls(h,{format:B}),account:m,blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:u,maxFeePerGas:l,maxPriorityFeePerGas:f,to:p,value:d},"createAccessList"),b=await e.request({method:"eth_createAccessList",params:[D,N]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(S){throw Kf(S,{...t,account:m,chain:e.chain})}}async function Ew(e){const t=ss(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function fd(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),u=ss(e,{method:"eth_newFilter"});let l=[];a&&(l=[a.flatMap(d=>Hr({abi:[d],eventName:d.name,args:n}))],r&&(l=l[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?Q(s):s,toBlock:typeof c=="bigint"?Q(c):c,...l.length?{topics:l}:{}}]});return{abi:a,args:n,eventName:r?r.name:void 0,fromBlock:s,id:f,request:u(f),strict:!!i,toBlock:c,type:"event"}}async function dd(e){const t=ss(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Sw(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o=typeof n=="bigint"?Q(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Pw(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function $w(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?Q(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),Zt(s)}async function Ia(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?Q(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}class Tw extends V{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Aw(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,u,l,f]=await X(e,Nt,"readContract")({abi:Ow,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:c,chainId:Number(a),verifyingContract:u,salt:l},extensions:f,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Tw({address:n}):i}}const Ow=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function Nw(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function Cw(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?Q(n):void 0,i=await e.request({method:"eth_feeHistory",params:[Q(t),s||r,o]},{dedupe:!!s});return Nw(i)}async function Iw(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Xt(s));return t.abi?oa({abi:t.abi,logs:o,strict:n}):o}async function Mw({address:e,authorization:t,signature:n}){return go(mn(e),await Ql({authorization:t,signature:n}))}const Ss=new rs(8192);function kw(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ss.get(n))return Ss.get(n);const r=e().finally(()=>Ss.delete(n));return Ss.set(n,r),r}function Bw(e,t={}){return async(n,r={})=>{var f;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:c=3,uid:a}={...t,...r},{method:u}=n;if((f=s==null?void 0:s.exclude)!=null&&f.includes(u))throw new Dn(new Error("method not supported"),{method:u});if(s!=null&&s.include&&!s.include.includes(u))throw new Dn(new Error("method not supported"),{method:u});const l=o?jr(`${a}.${Ae(n)}`):void 0;return kw(()=>Ea(async()=>{try{return await e(n)}catch(p){const d=p;switch(d.code){case Zr.code:throw new Zr(d);case Yr.code:throw new Yr(d);case Kr.code:throw new Kr(d,{method:n.method});case Xr.code:throw new Xr(d);case Fn.code:throw new Fn(d);case gn.code:throw new gn(d);case Qr.code:throw new Qr(d);case Jr.code:throw new Jr(d);case eo.code:throw new eo(d);case Dn.code:throw new Dn(d,{method:n.method});case fr.code:throw new fr(d);case to.code:throw new to(d);case dr.code:throw new dr(d);case no.code:throw new no(d);case ro.code:throw new ro(d);case oo.code:throw new oo(d);case so.code:throw new so(d);case io.code:throw new io(d);case ao.code:throw new ao(d);case co.code:throw new co(d);case uo.code:throw new uo(d);case lo.code:throw new lo(d);case fo.code:throw new fo(d);case po.code:throw new po(d);case ho.code:throw new ho(d);case 5e3:throw new dr(d);default:throw p instanceof V?p:new xg(d)}}},{delay:({count:p,error:d})=>{var h;if(d&&d instanceof Ln){const m=(h=d==null?void 0:d.headers)==null?void 0:h.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<p)*i},retryCount:c,shouldRetry:({error:p})=>Lw(p)}),{enabled:o,id:l})}}function Lw(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===fr.code||e.code===Fn.code:e instanceof Ln&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class Fw extends V{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var c;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(c=n.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(a=>` ${qr(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class Dw extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${qr(n)}`,`Response: ${Ae(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Rw extends V{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const jw="0x556f1830",pd={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function _w(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=_l({data:r,abi:[pd]}),[i,c,a,u,l]=s,{ccipRead:f}=e,p=f&&typeof(f==null?void 0:f.request)=="function"?f.request:hd;try{if(!go(o,i))throw new Rw({sender:i,to:o});const d=c.includes(To)?await od({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:c}),{data:h}=await So(e,{blockNumber:t,blockTag:n,data:Pt([u,bn([{type:"bytes"},{type:"bytes"}],[d,l])]),to:o});return h}catch(d){throw new Fw({callbackSelector:u,cause:d,data:r,extraData:l,sender:i,urls:c})}}async function hd({data:e,sender:t,urls:n}){var o;let r=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],c=i.includes("{data}")?"GET":"POST",a=c==="POST"?{data:e,sender:t}:void 0,u=c==="POST"?{"Content-Type":"application/json"}:{};try{const l=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:u,method:c});let f;if((o=l.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?f=(await l.json()).data:f=await l.text(),!l.ok){r=new Ln({body:a,details:f!=null&&f.error?Ae(f.error):l.statusText,headers:l.headers,status:l.status,url:i});continue}if(!Et(f)){r=new Dw({result:f,url:i});continue}return f}catch(l){r=new Ln({body:a,details:l.message,url:i})}}throw r}const Uw=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:hd,offchainLookup:_w,offchainLookupAbiItem:pd,offchainLookupSignature:jw},Symbol.toStringTag,{value:"Module"}));function zw(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Hw(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const c=new AbortController;n>0&&(i=setTimeout(()=>{r&&c.abort()},n)),o(await e({signal:(c==null?void 0:c.signal)||null}))}catch(c){(c==null?void 0:c.name)==="AbortError"&&s(t),s(c)}finally{clearTimeout(i)}})()})}function Ww(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const md=Ww();function Vw(e,t={}){return{async request(n){var p;const{body:r,fetchFn:o=t.fetchFn??fetch,onRequest:s=t.onRequest,onResponse:i=t.onResponse,timeout:c=t.timeout??1e4}=n,a={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:u,method:l,signal:f}=a;try{const d=await Hw(async({signal:m})=>{const w={...a,body:Array.isArray(r)?Ae(r.map(N=>({jsonrpc:"2.0",id:N.id??md.take(),...N}))):Ae({jsonrpc:"2.0",id:r.id??md.take(),...r}),headers:{"Content-Type":"application/json",...u},method:l||"POST",signal:f||(c>0?m:null)},$=new Request(e,w),E=await(s==null?void 0:s($,w))??{...w,url:e};return await o(E.url??e,E)},{errorInstance:new ql({body:r,url:e}),timeout:c,signal:!0});i&&await i(d);let h;if((p=d.headers.get("Content-Type"))!=null&&p.startsWith("application/json"))h=await d.json();else{h=await d.text();try{h=JSON.parse(h||"{}")}catch(m){if(d.ok)throw m;h={error:h}}}if(!d.ok)throw new Ln({body:r,details:Ae(h.error)||d.statusText,headers:d.headers,status:d.status,url:e});return h}catch(d){throw d instanceof Ln||d instanceof ql?d:new Ln({body:r,cause:d,url:e})}}}}const Gw=`Ethereum Signed Message:
|
|
81
|
-
`;function qw(e){const t=typeof e=="string"?jr(e):typeof e.raw=="string"?e.raw:Te(e.raw),n=jr(`${Gw}${we(t)}`);return Pt([n,t])}function bd(e,t){return Me(qw(e),t)}class Zw extends V{constructor({domain:t}){super(`Invalid domain "${Ae(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Yw extends V{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Kw extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Xw(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,c)=>{for(const a of i){const{name:u,type:l}=a,f=c[u],p=l.match(Cl);if(p&&(typeof f=="number"||typeof f=="bigint")){const[m,w,$]=p;Q(f,{signed:w==="int",size:Number.parseInt($,10)/8})}if(l==="address"&&typeof f=="string"&&!at(f))throw new hn({address:f});const d=l.match(R1);if(d){const[m,w]=d;if(w&&we(f)!==Number.parseInt(w,10))throw new Gb({expectedSize:Number.parseInt(w,10),givenSize:we(f)})}const h=o[l];h&&(Jw(l),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new Zw({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new Yw({primaryType:r,types:o})}function Qw({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Jw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Kw({type:e})}function ev(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:Qw({domain:t}),...e.types};Xw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(tv({domain:t,types:o})),r!=="EIP712Domain"&&s.push(gd({data:n,primaryType:r,types:o})),Me(Pt(s))}function tv({domain:e,types:t}){return gd({data:e,primaryType:"EIP712Domain",types:t})}function gd({data:e,primaryType:t,types:n}){const r=yd({data:e,primaryType:t,types:n});return Me(r)}function yd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[nv({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=vd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return bn(r,o)}function nv({primaryType:e,types:t}){const n=pn(rv({primaryType:e,types:t}));return Me(n)}function rv({primaryType:e,types:t}){let n="";const r=wd({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:c})=>`${c} ${i}`).join(",")})`;return n}function wd({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])wd({primaryType:s.type,types:t},n);return n}function vd({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Me(yd({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},Me(r)];if(n==="string")return[{type:"bytes32"},Me(pn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>vd({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},Me(bn(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class ov extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Ma={checksum:new ov(8192)}.checksum;function xd(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=$l(by(e));return n==="Bytes"?r:Ot(r)}const sv=/^0x[a-fA-F0-9]{40}$/;function Ps(e,t={}){const{strict:n=!0}=t;if(!sv.test(e))throw new Sd({address:e,cause:new iv});if(n){if(e.toLowerCase()===e)return;if(Ed(e)!==e)throw new Sd({address:e,cause:new av})}}function Ed(e){if(Ma.has(e))return Ma.get(e);Ps(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=xd(yy(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return Ma.set(e,o),o}function ka(e,t={}){const{strict:n=!0}=t??{};try{return Ps(e,{strict:n}),!0}catch{return!1}}class Sd extends ie{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class iv extends ie{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class av extends ie{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const cv=/^(.*)\[([0-9]*)\]$/,uv=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Pd=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,$d=2n**256n-1n;function vr(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=Da(t.type);if(s){const[i,c]=s;return fv(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return mv(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return lv(e,{checksum:r});if(t.type==="bool")return dv(e);if(t.type.startsWith("bytes"))return pv(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return hv(e,t);if(t.type==="string")return bv(e,{staticPosition:o});throw new _a(t.type)}const Td=32,Ba=32;function lv(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Ed(s):s)(Ot(vy(r,-20))),32]}function fv(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=en(e.readBytes(Ba)),u=s+a,l=u+Td;e.setPosition(u);const f=en(e.readBytes(Td)),p=Oo(t);let d=0;const h=[];for(let m=0;m<f;++m){e.setPosition(l+(p?m*32:d));const[w,$]=vr(e,t,{checksumAddress:r,staticPosition:l});d+=$,h.push(w)}return e.setPosition(s+32),[h,32]}if(Oo(t)){const a=en(e.readBytes(Ba)),u=s+a,l=[];for(let f=0;f<o;++f){e.setPosition(u+f*32);const[p]=vr(e,t,{checksumAddress:r,staticPosition:u});l.push(p)}return e.setPosition(s+32),[l,32]}let i=0;const c=[];for(let a=0;a<o;++a){const[u,l]=vr(e,t,{checksumAddress:r,staticPosition:s+i});i+=l,c.push(u)}return[c,i]}function dv(e){return[Ey(e.readBytes(32),{size:32}),32]}function pv(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=en(e.readBytes(32));e.setPosition(n+i);const c=en(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ot(a),32]}return[Ot(e.readBytes(Number.parseInt(o,10),32)),32]}function hv(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?xy(o,{signed:n}):en(o,{signed:n}),32]}function mv(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:a})=>!a),i=s?[]:{};let c=0;if(Oo(t)){const a=en(e.readBytes(Ba)),u=o+a;for(let l=0;l<t.components.length;++l){const f=t.components[l];e.setPosition(u+c);const[p,d]=vr(e,f,{checksumAddress:r,staticPosition:u});c+=d,i[s?l:f==null?void 0:f.name]=p}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const u=t.components[a],[l,f]=vr(e,u,{checksumAddress:r,staticPosition:o});i[s?a:u==null?void 0:u.name]=l,c+=f}return[i,c]}function bv(e,{staticPosition:t}){const n=en(e.readBytes(32)),r=t+n;e.setPosition(r);const o=en(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=Sy(kf(s));return e.setPosition(t+32),[i,32]}function gv({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(La({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function La({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=Da(r.type);if(o){const[s,i]=o;return wv(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Pv(n,{checksumAddress:e,parameter:r});if(r.type==="address")return yv(n,{checksum:e});if(r.type==="bool")return xv(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Pd.exec(r.type)??[];return Ev(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return vv(n,{type:r.type});if(r.type==="string")return Sv(n);throw new _a(r.type)}function Fa(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=tt(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Le(t+o,{size:32})),r.push(c),o+=tt(c)):n.push(c)}return At(...n,...r)}function yv(e,t){const{checksum:n=!1}=t;return Ps(e,{strict:n}),{dynamic:!1,encoded:_n(e.toLowerCase())}}function wv(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new kv(e);if(!s&&e.length!==r)throw new Mv({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const u=La({checksumAddress:n,parameter:o,value:e[a]});u.dynamic&&(i=!0),c.push(u)}if(s||i){const a=Fa(c);if(s){const u=Le(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?At(u,a):u}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:At(...c.map(({encoded:a})=>a))}}function vv(e,{type:t}){const[,n]=t.split("bytes"),r=tt(e);if(!n){let o=e;return r%32!==0&&(o=Un(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:At(_n(Le(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new Nd({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Un(e)}}function xv(e){if(typeof e!="boolean")throw new ie(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:_n(Bf(e))}}function Ev(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Df({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Le(e,{size:32,signed:t})}}function Sv(e){const t=pa(e),n=Math.ceil(tt(t)/32),r=[];for(let o=0;o<n;o++)r.push(Un(Ft(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:At(Un(Le(tt(t),{size:32})),...r)}}function Pv(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const c=r.components[i],a=Array.isArray(e)?i:c.name,u=La({checksumAddress:n,parameter:c,value:e[a]});s.push(u),u.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Fa(s):At(...s.map(({encoded:i})=>i))}}function Da(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Oo(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(Oo);const n=Da(e.type);return!!(n&&Oo({...e,type:n[1]}))}const $v={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Ov({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Av({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ad({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Ad({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Tv(e,{recursiveReadLimit:t=8192}={}){const n=Object.create($v);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Ad extends ie{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Av extends ie{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class Ov extends ie{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Nv(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?Mf(t):t,i=Tv(s);if(gr(s)===0&&e.length>0)throw new Iv;if(gr(s)&&gr(s)<32)throw new Cv({data:typeof t=="string"?t:Ot(t),parameters:e,size:gr(s)});let c=0;const a=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const l=e[u];i.setPosition(c);const[f,p]=vr(i,l,{checksumAddress:o,staticPosition:0});c+=p,r==="Array"?a.push(f):a[l.name??u]=f}return a}function Ra(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Cd({expectedLength:e.length,givenLength:t.length});const o=gv({checksumAddress:r,parameters:e,values:t}),s=Fa(o);return s.length===0?"0x":s}function ja(e,t){if(e.length!==t.length)throw new Cd({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push(ja.encode(o,s))}return At(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return Ps(a),_n(a.toLowerCase(),o?32:0)}if(n==="string")return pa(r);if(n==="bytes")return r;if(n==="bool")return _n(Bf(r),o?32:1);const s=n.match(Pd);if(s){const[a,u,l="256"]=s,f=Number.parseInt(l,10)/8;return Le(r,{size:o?32:f,signed:u==="int"})}const i=n.match(uv);if(i){const[a,u]=i;if(Number.parseInt(u,10)!==(r.length-2)/2)throw new Nd({expectedSize:Number.parseInt(u,10),value:r});return Un(r,o?32:0)}const c=n.match(cv);if(c&&Array.isArray(r)){const[a,u]=c,l=[];for(let f=0;f<r.length;f++)l.push(t(u,r[f],!0));return l.length===0?"0x":At(...l)}throw new _a(n)}e.encode=t})(ja||(ja={}));function Od(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Ju(e):e}class Cv extends ie{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${er(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Iv extends ie{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Mv extends ie{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class Nd extends ie{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${tt(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Cd extends ie{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
82
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class kv extends ie{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class _a extends ie{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}class Id extends Ai{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,h1(t);const r=ts(n);if(this.iHash=t.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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),ar(s)}update(t){return ir(this),this.iHash.update(t),this}digestInto(t){ir(this),kn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:i,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Md=(e,t,n)=>new Id(e,t).update(n).digest();Md.create=(e,t)=>new Id(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const We=BigInt(0),Fe=BigInt(1),zn=BigInt(2),Bv=BigInt(3),kd=BigInt(4),Bd=BigInt(5),Ld=BigInt(8);function Ve(e,t){const n=e%t;return n>=We?n:t+n}function ut(e,t,n){let r=e;for(;t-- >We;)r*=r,r%=n;return r}function Ua(e,t){if(e===We)throw new Error("invert: expected non-zero number");if(t<=We)throw new Error("invert: expected positive modulus, got "+t);let n=Ve(e,t),r=t,o=We,s=Fe;for(;n!==We;){const c=r/n,a=r%n,u=o-s*c;r=n,n=a,o=s,s=u}if(r!==Fe)throw new Error("invert: does not exist");return Ve(o,t)}function Fd(e,t){const n=(e.ORDER+Fe)/kd,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function Lv(e,t){const n=(e.ORDER-Bd)/Ld,r=e.mul(t,zn),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,zn),o),c=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function Fv(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Fe,n=0;for(;t%zn===We;)t/=zn,n++;let r=zn;const o=za(e);for(;Rd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Fd;let s=o.pow(r,t);const i=(t+Fe)/zn;return function(a,u){if(a.is0(u))return u;if(Rd(a,u)!==1)throw new Error("Cannot find square root");let l=n,f=a.mul(a.ONE,s),p=a.pow(u,t),d=a.pow(u,i);for(;!a.eql(p,a.ONE);){if(a.is0(p))return a.ZERO;let h=1,m=a.sqr(p);for(;!a.eql(m,a.ONE);)if(h++,m=a.sqr(m),h===l)throw new Error("Cannot find square root");const w=Fe<<BigInt(l-h-1),$=a.pow(f,w);l=h,f=a.sqr($),p=a.mul(p,f),d=a.mul(d,$)}return d}}function Dv(e){return e%kd===Bv?Fd:e%Ld===Bd?Lv:Fv(e)}const Rv=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function jv(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Rv.reduce((r,o)=>(r[o]="function",r),t);return bs(e,n)}function _v(e,t,n){if(n<We)throw new Error("invalid exponent, negatives unsupported");if(n===We)return e.ONE;if(n===Fe)return t;let r=e.ONE,o=t;for(;n>We;)n&Fe&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Fe;return r}function Dd(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,c,a)=>e.is0(c)?i:(r[a]=i,e.mul(i,c)),e.ONE),s=e.inv(o);return t.reduceRight((i,c,a)=>e.is0(c)?i:(r[a]=e.mul(i,r[a]),e.mul(i,c)),s),r}function Rd(e,t){const n=(e.ORDER-Fe)/zn,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function jd(e,t){t!==void 0&&_r(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function za(e,t,n=!1,r={}){if(e<=We)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=jd(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const c=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:ms(o),ZERO:We,ONE:Fe,create:a=>Ve(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return We<=a&&a<e},is0:a=>a===We,isOdd:a=>(a&Fe)===Fe,neg:a=>Ve(-a,e),eql:(a,u)=>a===u,sqr:a=>Ve(a*a,e),add:(a,u)=>Ve(a+u,e),sub:(a,u)=>Ve(a-u,e),mul:(a,u)=>Ve(a*u,e),pow:(a,u)=>_v(c,a,u),div:(a,u)=>Ve(a*Ua(u,e),e),sqrN:a=>a*a,addN:(a,u)=>a+u,subN:(a,u)=>a-u,mulN:(a,u)=>a*u,inv:a=>Ua(a,e),sqrt:r.sqrt||(a=>(i||(i=Dv(e)),i(c,a))),toBytes:a=>n?Pf(a,s):xo(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Sf(a):jn(a)},invertBatch:a=>Dd(c,a),cmov:(a,u,l)=>l?u:a});return Object.freeze(c)}function _d(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Ud(e){const t=_d(e);return t+Math.ceil(t/2)}function Uv(e,t,n=!1){const r=e.length,o=_d(t),s=Ud(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Sf(e):jn(e),c=Ve(i,t-Fe)+Fe;return n?Pf(c,o):xo(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zd=BigInt(0),Ha=BigInt(1);function Wa(e,t){const n=t.negate();return e?n:t}function Hd(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Va(e,t){Hd(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=ms(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function Wd(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let c=Number(e&o),a=e>>i;c>r&&(c-=s,a+=Ha);const u=t*r,l=u+Math.abs(c)-1,f=c===0,p=c<0,d=t%2!==0;return{nextN:a,offset:l,isZero:f,isNeg:p,isNegF:d,offsetF:u}}function zv(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function Hv(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const Ga=new WeakMap,Vd=new WeakMap;function qa(e){return Vd.get(e)||1}function Wv(e,t){return{constTimeNegate:Wa,hasPrecomputes(n){return qa(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>zd;)r&Ha&&(o=o.add(s)),s=s.double(),r>>=Ha;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=Va(r,t),i=[];let c=n,a=c;for(let u=0;u<o;u++){a=c,i.push(a);for(let l=1;l<s;l++)a=a.add(c),i.push(a);c=a.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const c=Va(n,t);for(let a=0;a<c.windows;a++){const{nextN:u,offset:l,isZero:f,isNeg:p,isNegF:d,offsetF:h}=Wd(o,a,c);o=u,f?i=i.add(Wa(d,r[h])):s=s.add(Wa(p,r[l]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=Va(n,t);for(let c=0;c<i.windows&&o!==zd;c++){const{nextN:a,offset:u,isZero:l,isNeg:f}=Wd(o,c,i);if(o=a,!l){const p=r[u];s=s.add(f?p.negate():p)}}return s},getPrecomputes(n,r,o){let s=Ga.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&Ga.set(r,o(s))),s},wNAFCached(n,r,o){const s=qa(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=qa(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){Hd(r,t),Vd.set(n,r),Ga.delete(n)}}}function Vv(e,t,n,r){zv(n,e),Hv(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,c=sy(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const u=ms(a),l=new Array(Number(u)+1).fill(i),f=Math.floor((t.BITS-1)/a)*a;let p=i;for(let d=f;d>=0;d-=a){l.fill(i);for(let m=0;m<s;m++){const w=r[m],$=Number(w>>BigInt(d)&u);l[$]=l[$].add(n[m])}let h=i;for(let m=l.length-1,w=i;m>0;m--)w=w.add(l[m]),h=h.add(w);if(p=p.add(h),d!==0)for(let m=0;m<a;m++)p=p.double()}return p}function Gd(e){return jv(e.Fp),bs(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...jd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qd(e){e.lowS!==void 0&&wo("lowS",e.lowS),e.prehash!==void 0&&wo("prehash",e.prehash)}function Gv(e){const t=Gd(e);bs(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class qv extends Error{constructor(t=""){super(t)}}const tn={Err:qv,_tlv:{encode:(e,t)=>{const{Err:n}=tn;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=ds(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?ds(o.length/2|128):"";return ds(e)+s+o+t},decode(e,t){const{Err:n}=tn;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const a=o&127;if(!a)throw new n("tlv.decode(long): indefinite length not supported");if(a>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+a);if(u.length!==a)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const l of u)i=i<<8|l;if(r+=a,i<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(r,r+i);if(c.length!==i)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=tn;if(e<nn)throw new t("integer: negative integers are not allowed");let n=ds(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=tn;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return jn(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=tn,o=ct("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l:a}=r.decode(2,s),{v:u,l}=r.decode(2,a);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=tn,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function Za(e,t){return vo(xo(e,t))}const nn=BigInt(0),Ne=BigInt(1);BigInt(2);const Ya=BigInt(3),Zv=BigInt(4);function Yv(e){const t=Gv(e),{Fp:n}=t,r=za(t.n,t.nBitLength),o=t.toBytes||((S,N,B)=>{const F=N.toAffine();return hs(Uint8Array.from([4]),n.toBytes(F.x),n.toBytes(F.y))}),s=t.fromBytes||(S=>{const N=S.subarray(1),B=n.fromBytes(N.subarray(0,n.BYTES)),F=n.fromBytes(N.subarray(n.BYTES,2*n.BYTES));return{x:B,y:F}});function i(S){const{a:N,b:B}=t,F=n.sqr(S),D=n.mul(F,S);return n.add(n.add(D,n.mul(S,N)),B)}function c(S,N){const B=n.sqr(N),F=i(S);return n.eql(B,F)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,Ya),Zv),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(a,u)))throw new Error("bad curve params: a or b");function l(S){return fa(S,Ne,t.n)}function f(S){const{allowedPrivateKeyLengths:N,nByteLength:B,wrapPrivateKey:F,n:D}=t;if(N&&typeof S!="bigint"){if(yo(S)&&(S=vo(S)),typeof S!="string"||!N.includes(S.length))throw new Error("invalid private key");S=S.padStart(B*2,"0")}let b;try{b=typeof S=="bigint"?S:jn(ct("private key",S,B))}catch{throw new Error("invalid private key, expected hex or "+B+" bytes, got "+typeof S)}return F&&(b=Ve(b,D)),br("private key",b,Ne,D),b}function p(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const d=Tf((S,N)=>{const{px:B,py:F,pz:D}=S;if(n.eql(D,n.ONE))return{x:B,y:F};const b=S.is0();N==null&&(N=b?n.ONE:n.inv(D));const g=n.mul(B,N),v=n.mul(F,N),C=n.mul(D,N);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql(C,n.ONE))throw new Error("invZ was invalid");return{x:g,y:v}}),h=Tf(S=>{if(S.is0()){if(t.allowInfinityPoint&&!n.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:N,y:B}=S.toAffine();if(!n.isValid(N)||!n.isValid(B))throw new Error("bad point: x or y not FE");if(!c(N,B))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(N,B,F){if(N==null||!n.isValid(N))throw new Error("x required");if(B==null||!n.isValid(B)||n.is0(B))throw new Error("y required");if(F==null||!n.isValid(F))throw new Error("z required");this.px=N,this.py=B,this.pz=F,Object.freeze(this)}static fromAffine(N){const{x:B,y:F}=N||{};if(!N||!n.isValid(B)||!n.isValid(F))throw new Error("invalid affine point");if(N instanceof m)throw new Error("projective point not allowed");const D=b=>n.eql(b,n.ZERO);return D(B)&&D(F)?m.ZERO:new m(B,F,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(N){const B=Dd(n,N.map(F=>F.pz));return N.map((F,D)=>F.toAffine(B[D])).map(m.fromAffine)}static fromHex(N){const B=m.fromAffine(s(ct("pointHex",N)));return B.assertValidity(),B}static fromPrivateKey(N){return m.BASE.multiply(f(N))}static msm(N,B){return Vv(m,r,N,B)}_setWindowSize(N){E.setWindowSize(this,N)}assertValidity(){h(this)}hasEvenY(){const{y:N}=this.toAffine();if(n.isOdd)return!n.isOdd(N);throw new Error("Field doesn't support isOdd")}equals(N){p(N);const{px:B,py:F,pz:D}=this,{px:b,py:g,pz:v}=N,C=n.eql(n.mul(B,v),n.mul(b,D)),O=n.eql(n.mul(F,v),n.mul(g,D));return C&&O}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:N,b:B}=t,F=n.mul(B,Ya),{px:D,py:b,pz:g}=this;let v=n.ZERO,C=n.ZERO,O=n.ZERO,I=n.mul(D,D),M=n.mul(b,b),y=n.mul(g,g),A=n.mul(D,b);return A=n.add(A,A),O=n.mul(D,g),O=n.add(O,O),v=n.mul(N,O),C=n.mul(F,y),C=n.add(v,C),v=n.sub(M,C),C=n.add(M,C),C=n.mul(v,C),v=n.mul(A,v),O=n.mul(F,O),y=n.mul(N,y),A=n.sub(I,y),A=n.mul(N,A),A=n.add(A,O),O=n.add(I,I),I=n.add(O,I),I=n.add(I,y),I=n.mul(I,A),C=n.add(C,I),y=n.mul(b,g),y=n.add(y,y),I=n.mul(y,A),v=n.sub(v,I),O=n.mul(y,M),O=n.add(O,O),O=n.add(O,O),new m(v,C,O)}add(N){p(N);const{px:B,py:F,pz:D}=this,{px:b,py:g,pz:v}=N;let C=n.ZERO,O=n.ZERO,I=n.ZERO;const M=t.a,y=n.mul(t.b,Ya);let A=n.mul(B,b),T=n.mul(F,g),P=n.mul(D,v),L=n.add(B,F),j=n.add(b,g);L=n.mul(L,j),j=n.add(A,T),L=n.sub(L,j),j=n.add(B,D);let z=n.add(b,v);return j=n.mul(j,z),z=n.add(A,P),j=n.sub(j,z),z=n.add(F,D),C=n.add(g,v),z=n.mul(z,C),C=n.add(T,P),z=n.sub(z,C),I=n.mul(M,j),C=n.mul(y,P),I=n.add(C,I),C=n.sub(T,I),I=n.add(T,I),O=n.mul(C,I),T=n.add(A,A),T=n.add(T,A),P=n.mul(M,P),j=n.mul(y,j),T=n.add(T,P),P=n.sub(A,P),P=n.mul(M,P),j=n.add(j,P),A=n.mul(T,j),O=n.add(O,A),A=n.mul(z,j),C=n.mul(L,C),C=n.sub(C,A),A=n.mul(L,T),I=n.mul(z,I),I=n.add(I,A),new m(C,O,I)}subtract(N){return this.add(N.negate())}is0(){return this.equals(m.ZERO)}wNAF(N){return E.wNAFCached(this,N,m.normalizeZ)}multiplyUnsafe(N){const{endo:B,n:F}=t;br("scalar",N,nn,F);const D=m.ZERO;if(N===nn)return D;if(this.is0()||N===Ne)return this;if(!B||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,N,m.normalizeZ);let{k1neg:b,k1:g,k2neg:v,k2:C}=B.splitScalar(N),O=D,I=D,M=this;for(;g>nn||C>nn;)g&Ne&&(O=O.add(M)),C&Ne&&(I=I.add(M)),M=M.double(),g>>=Ne,C>>=Ne;return b&&(O=O.negate()),v&&(I=I.negate()),I=new m(n.mul(I.px,B.beta),I.py,I.pz),O.add(I)}multiply(N){const{endo:B,n:F}=t;br("scalar",N,Ne,F);let D,b;if(B){const{k1neg:g,k1:v,k2neg:C,k2:O}=B.splitScalar(N);let{p:I,f:M}=this.wNAF(v),{p:y,f:A}=this.wNAF(O);I=E.constTimeNegate(g,I),y=E.constTimeNegate(C,y),y=new m(n.mul(y.px,B.beta),y.py,y.pz),D=I.add(y),b=M.add(A)}else{const{p:g,f:v}=this.wNAF(N);D=g,b=v}return m.normalizeZ([D,b])[0]}multiplyAndAddUnsafe(N,B,F){const D=m.BASE,b=(v,C)=>C===nn||C===Ne||!v.equals(D)?v.multiplyUnsafe(C):v.multiply(C),g=b(this,B).add(b(N,F));return g.is0()?void 0:g}toAffine(N){return d(this,N)}isTorsionFree(){const{h:N,isTorsionFree:B}=t;if(N===Ne)return!0;if(B)return B(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:B}=t;return N===Ne?this:B?B(m,this):this.multiplyUnsafe(t.h)}toRawBytes(N=!0){return wo("isCompressed",N),this.assertValidity(),o(m,this,N)}toHex(N=!0){return wo("isCompressed",N),vo(this.toRawBytes(N))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:$}=t,E=Wv(m,w?Math.ceil($/2):$);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:l}}function Kv(e){const t=Gd(e);return bs(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Xv(e){const t=Kv(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(y){return Ve(y,r)}function u(y){return Ua(y,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:f,weierstrassEquation:p,isWithinCurveOrder:d}=Yv({...t,toBytes(y,A,T){const P=A.toAffine(),L=n.toBytes(P.x),j=hs;return wo("isCompressed",T),T?j(Uint8Array.from([A.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(P.y))},fromBytes(y){const A=y.length,T=y[0],P=y.subarray(1);if(A===i&&(T===2||T===3)){const L=jn(P);if(!fa(L,Ne,n.ORDER))throw new Error("Point is not on curve");const j=p(L);let z;try{z=n.sqrt(j)}catch(K){const G=K instanceof Error?": "+K.message:"";throw new Error("Point is not on curve"+G)}const _=(z&Ne)===Ne;return(T&1)===1!==_&&(z=n.neg(z)),{x:L,y:z}}else if(A===c&&T===4){const L=n.fromBytes(P.subarray(0,n.BYTES)),j=n.fromBytes(P.subarray(n.BYTES,2*n.BYTES));return{x:L,y:j}}else{const L=i,j=c;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+j+", got "+A)}}});function h(y){const A=r>>Ne;return y>A}function m(y){return h(y)?a(-y):y}const w=(y,A,T)=>jn(y.slice(A,T));class ${constructor(A,T,P){br("r",A,Ne,r),br("s",T,Ne,r),this.r=A,this.s=T,P!=null&&(this.recovery=P),Object.freeze(this)}static fromCompact(A){const T=o;return A=ct("compactSignature",A,T*2),new $(w(A,0,T),w(A,T,2*T))}static fromDER(A){const{r:T,s:P}=tn.toSig(ct("DER",A));return new $(T,P)}assertValidity(){}addRecoveryBit(A){return new $(this.r,this.s,A)}recoverPublicKey(A){const{r:T,s:P,recovery:L}=this,j=D(ct("msgHash",A));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?T+t.n:T;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=L&1?"03":"02",W=l.fromHex(_+Za(z,n.BYTES)),K=u(z),G=a(-j*K),H=a(P*K),Z=l.BASE.multiplyAndAddUnsafe(W,G,H);if(!Z)throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new $(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ps(this.toDERHex())}toDERHex(){return tn.hexFromSig(this)}toCompactRawBytes(){return ps(this.toCompactHex())}toCompactHex(){const A=o;return Za(this.r,A)+Za(this.s,A)}}const E={isValidPrivateKey(y){try{return f(y),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const y=Ud(t.n);return Uv(t.randomBytes(y),t.n)},precompute(y=8,A=l.BASE){return A._setWindowSize(y),A.multiply(BigInt(3)),A}};function S(y,A=!0){return l.fromPrivateKey(y).toRawBytes(A)}function N(y){if(typeof y=="bigint")return!1;if(y instanceof l)return!0;const T=ct("key",y).length,P=n.BYTES,L=P+1,j=2*P+1;if(!(t.allowedPrivateKeyLengths||o===L))return T===L||T===j}function B(y,A,T=!0){if(N(y)===!0)throw new Error("first arg must be private key");if(N(A)===!1)throw new Error("second arg must be public key");return l.fromHex(A).multiply(f(y)).toRawBytes(T)}const F=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const A=jn(y),T=y.length*8-s;return T>0?A>>BigInt(T):A},D=t.bits2int_modN||function(y){return a(F(y))},b=ms(s);function g(y){return br("num < 2^"+s,y,nn,b),xo(y,o)}function v(y,A,T=C){if(["recovered","canonical"].some(oe=>oe in T))throw new Error("sign() legacy options not supported");const{hash:P,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:_}=T;j==null&&(j=!0),y=ct("msgHash",y),qd(T),z&&(y=ct("prehashed msgHash",P(y)));const W=D(y),K=f(A),G=[g(K),g(W)];if(_!=null&&_!==!1){const oe=_===!0?L(n.BYTES):_;G.push(ct("extraEntropy",oe))}const H=hs(...G),Z=W;function J(oe){const me=F(oe);if(!d(me))return;const ge=u(me),de=l.BASE.multiply(me).toAffine(),se=a(de.x);if(se===nn)return;const pe=a(ge*a(Z+se*K));if(pe===nn)return;let ee=(de.x===se?0:2)|Number(de.y&Ne),Se=pe;return j&&h(pe)&&(Se=m(pe),ee^=1),new $(se,Se,ee)}return{seed:H,k2sig:J}}const C={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function I(y,A,T=C){const{seed:P,k2sig:L}=v(y,A,T),j=t;return iy(j.hash.outputLen,j.nByteLength,j.hmac)(P,L)}l.BASE._setWindowSize(8);function M(y,A,T,P=O){var ee;const L=y;A=ct("msgHash",A),T=ct("publicKey",T);const{lowS:j,prehash:z,format:_}=P;if(qd(P),"strict"in P)throw new Error("options.strict was renamed to lowS");if(_!==void 0&&_!=="compact"&&_!=="der")throw new Error("format must be compact or der");const W=typeof L=="string"||yo(L),K=!W&&!_&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!W&&!K)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let G,H;try{if(K&&(G=new $(L.r,L.s)),W){try{_!=="compact"&&(G=$.fromDER(L))}catch(Se){if(!(Se instanceof tn.Err))throw Se}!G&&_!=="der"&&(G=$.fromCompact(L))}H=l.fromHex(T)}catch{return!1}if(!G||j&&G.hasHighS())return!1;z&&(A=t.hash(A));const{r:Z,s:J}=G,oe=D(A),me=u(J),ge=a(oe*me),de=a(Z*me),se=(ee=l.BASE.multiplyAndAddUnsafe(H,ge,de))==null?void 0:ee.toAffine();return se?a(se.x)===Z:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:B,sign:I,verify:M,ProjectivePoint:l,Signature:$,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Qv(e){return{hash:e,hmac:(t,...n)=>Md(e,t,v1(...n)),randomBytes:x1}}function Jv(e,t){const n=r=>Xv({...e,...Qv(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Zd=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Yd=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),e6=BigInt(0),t6=BigInt(1),Ka=BigInt(2),Kd=(e,t)=>(e+t/Ka)/t;function n6(e){const t=Zd,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),c=BigInt(44),a=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=ut(l,n,t)*l%t,p=ut(f,n,t)*l%t,d=ut(p,Ka,t)*u%t,h=ut(d,o,t)*d%t,m=ut(h,s,t)*h%t,w=ut(m,c,t)*m%t,$=ut(w,a,t)*w%t,E=ut($,c,t)*m%t,S=ut(E,n,t)*l%t,N=ut(S,i,t)*h%t,B=ut(N,r,t)*u%t,F=ut(B,Ka,t);if(!Xa.eql(Xa.sqr(F),e))throw new Error("Cannot find square root");return F}const Xa=za(Zd,void 0,void 0,{sqrt:n6}),Xd=Jv({a:e6,b:BigInt(7),Fp:Xa,n:Yd,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Yd,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-t6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=Kd(s*e,t),a=Kd(-r*e,t);let u=Ve(e-c*n-a*o,t),l=Ve(-c*r-a*s,t);const f=u>i,p=l>i;if(f&&(u=t-u),p&&(l=t-l),u>i||l>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:p,k2:l}}}},lf),r6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Xd},Symbol.toStringTag,{value:"Module"}));function Qd(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Ja({signature:e});if(typeof e.s>"u")throw new Ja({signature:e});if(n&&typeof e.yParity>"u")throw new Ja({signature:e});if(e.r<0n||e.r>$d)throw new l6({value:e.r});if(e.s<0n||e.s>$d)throw new f6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new ec({value:e.yParity})}function o6(e){return Jd(Ot(e))}function Jd(e){if(e.length!==130&&e.length!==132)throw new u6({signature:e});const t=BigInt(Ft(e,0,32)),n=BigInt(Ft(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return Qa(o)}catch{throw new ec({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function s6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return i6(e)}function i6(e){const t=typeof e=="string"?Jd(e):e instanceof Uint8Array?o6(e):typeof e.r=="string"?c6(e):e.v?a6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Qd(t),t}function a6(e){return{r:e.r,s:e.s,yParity:Qa(e.v)}}function c6(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Qa(n)),typeof r!="number")throw new ec({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Qa(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new d6({value:e})}class u6 extends ie{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${tt(Iy(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Ja extends ie{constructor({signature:t}){super(`Signature \`${If(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class l6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class f6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class ec extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class d6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function p6(e,t={}){return typeof e.chainId=="string"?h6(e):{...e,...t.signature}}function h6(e){const{address:t,chainId:n,nonce:r}=e,o=s6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const m6="0x8010801080108010801080108010801080108010801080108010801080108010",b6=Od("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function e0(e){if(typeof e=="string"){if(Ft(e,-32)!==m6)throw new w6(e)}else Qd(e.authorization)}function g6(e){e0(e);const t=Ff(Ft(e,-64,-32)),n=Ft(e,-t-64,-64),r=Ft(e,0,-t-64),[o,s,i]=Nv(b6,n);return{authorization:p6({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function y6(e){try{return e0(e),!0}catch{return!1}}let w6=class extends ie{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class v6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function x6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new v6({value:e});let[n,r="0"]=e.split(".");const o=n.startsWith("-");if(o&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[s,i,c]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(+`${i}.${c}`);a>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function E6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function S6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Zt(e.nonce):void 0,storageProof:e.storageProof?E6(e.storageProof):void 0}}async function P6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?Q(n):void 0,c=await e.request({method:"eth_getProof",params:[t,o,i||s]});return S6(c)}async function $6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?Q(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function tc(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:c}){var p,d,h;const a=r||"latest",u=n!==void 0?Q(n):void 0;let l=null;if(o?l=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?l=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Q(s)]},{dedupe:!0}):typeof s=="number"?l=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||a,Q(s)]},{dedupe:!!u}):i&&typeof c=="number"&&(l=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,Q(c)]},{dedupe:!0})),!l)throw new Hl({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(d=(p=e.chain)==null?void 0:p.formatters)==null?void 0:d.transaction)==null?void 0:h.format)||Xi)(l,"getTransaction")}async function T6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([X(e,$o,"getBlockNumber")({}),t?X(e,tc,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function $s(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Wl({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||td)(n,"getTransactionReceipt")}async function A6(e,t){var E;const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:i,blockTag:c,stateOverride:a}=t,u=t.contracts,{batchSize:l=t.batchSize??1024,deployless:f=t.deployless??!1}=typeof((E=e.batch)==null?void 0:E.multicall)=="object"?e.batch.multicall:{},p=(()=>{if(t.multicallAddress)return t.multicallAddress;if(f)return null;if(e.chain)return wr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),d=[[]];let h=0,m=0;for(let S=0;S<u.length;S++){const{abi:N,address:B,args:F,functionName:D}=u[S];try{const b=$t({abi:N,args:F,functionName:D});m+=(b.length-2)/2,l>0&&m>l&&d[h].length>0&&(h++,m=(b.length-2)/2,d[h]=[]),d[h]=[...d[h],{allowFailure:!0,callData:b,target:B}]}catch(b){const g=pr(b,{abi:N,address:B,args:F,docsPath:"/docs/contract/multicall",functionName:D,sender:n});if(!o)throw g;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:B}]}}const w=await Promise.allSettled(d.map(S=>X(e,Nt,"readContract")({...p===null?{code:ma}:{address:p},abi:ys,account:n,args:[S],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:c,functionName:"aggregate3",stateOverride:a}))),$=[];for(let S=0;S<w.length;S++){const N=w[S];if(N.status==="rejected"){if(!o)throw N.reason;for(let F=0;F<d[S].length;F++)$.push({status:"failure",error:N.reason,result:void 0});continue}const B=N.value;for(let F=0;F<B.length;F++){const{returnData:D,success:b}=B[F],{callData:g}=d[S][F],{abi:v,address:C,functionName:O,args:I}=u[$.length];try{if(g==="0x")throw new Rr;if(!b)throw new is({data:D});const M=Rn({abi:v,args:I,data:D,functionName:O});$.push(o?{result:M,status:"success"}:M)}catch(M){const y=pr(M,{abi:v,address:C,args:I,docsPath:"/docs/contract/multicall",functionName:O});if(!o)throw y;$.push({error:y,result:void 0,status:"failure"})}}}if($.length!==u.length)throw new V("multicall results mismatch");return $}async function nc(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:c}=t;try{const a=[];for(const p of o){const d=p.blockOverrides?Uf(p.blockOverrides):void 0,h=p.calls.map(w=>{const $=w,E=$.account?Je($.account):void 0,S=$.abi?$t($):$.data,N={...$,account:E,data:$.dataSuffix?Pt([S||"0x",$.dataSuffix]):S,from:$.from??(E==null?void 0:E.address)};return mr(N),bo(N)}),m=p.stateOverrides?Yi(p.stateOverrides):void 0;a.push({blockOverrides:d,calls:h,stateOverrides:m})}const l=(typeof n=="bigint"?Q(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:c},l]})).map((p,d)=>({...of(p),calls:p.calls.map((h,m)=>{var v,C;const{abi:w,args:$,functionName:E,to:S}=o[d].calls[m],N=((v=h.error)==null?void 0:v.data)??h.returnData,B=BigInt(h.gasUsed),F=(C=h.logs)==null?void 0:C.map(O=>Xt(O)),D=h.status==="0x1"?"success":"failure",b=w&&D==="success"&&N!=="0x"?Rn({abi:w,data:N,functionName:E}):null,g=(()=>{var I;if(D==="success")return;let O;if(((I=h.error)==null?void 0:I.data)==="0x"?O=new Rr:h.error&&(O=new is(h.error)),!!O)return pr(O,{abi:w??[],address:S??"0x",args:$,functionName:E??"<unknown>"})})();return{data:N,gasUsed:B,logs:F,status:D,...D==="success"?{result:b}:{error:g}}})}))}catch(a){const u=a,l=us(u,{});throw l instanceof mo?u:l}}function rc(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new ie("Unable to normalize signature.");return o}function oc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ka(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>oc(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>oc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function t0(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return t0(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?ka(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ka(n[r],{strict:!1}):!1)return i}}function n0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Qu(e):e;return{...r,...n?{hash:xr(r)}:{}}}function Ts(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=My(t,{strict:!1}),i=e.filter(u=>s?u.type==="function"||u.type==="error"?r0(u)===Ft(t,0,4):u.type==="event"?xr(u)===t:!1:"name"in u&&u.name===t);if(i.length===0)throw new As({name:t});if(i.length===1)return{...i[0],...o?{hash:xr(i[0])}:{}};let c;for(const u of i){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...o?{hash:xr(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,p)=>{const d="inputs"in u&&u.inputs[p];return d?oc(f,d):!1})){if(c&&"inputs"in c&&c.inputs){const f=t0(u.inputs,c.inputs,r);if(f)throw new N6({abiItem:u,type:f[0]},{abiItem:c,type:f[1]})}c=u}}const a=(()=>{if(c)return c;const[u,...l]=i;return{...u,overloads:l}})();if(!a)throw new As({name:t});return{...a,...o?{hash:xr(a)}:{}}}function r0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ts(n,r)}return e[0]})();return Ft(xr(t),0,4)}function O6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Ts(r,o)}return e[0]})(),n=typeof t=="string"?t:Ko(t);return rc(n)}function xr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ts(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:xd(pa(O6(t)))}class N6 extends ie{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${rc(Ko(t.abiItem))}\`, and`,`\`${n.type}\` in \`${rc(Ko(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class As extends ie{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function C6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[M6(i),c]}return e})(),{bytecode:r,args:o}=n;return At(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Ra(t.inputs,o):"0x")}function I6(e){return n0(e)}function M6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new As({name:"constructor"});return t}function k6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[u,l,f]=e;return[o0(u,l,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?o0([t,...r],t.name,{args:n}):t,s=B6(o),i=n.length>0?Ra(o.inputs,n):void 0;return i?At(s,i):s}function Er(e,t={}){return n0(e,t)}function o0(e,t,n){const r=Ts(e,t,n);if(r.type!=="function")throw new As({name:t,type:"function"});return r}function B6(e){return r0(e)}const L6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Dt="0x0000000000000000000000000000000000000000",F6="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function D6(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:c,validation:a}=t,u=t.account?Je(t.account):void 0;if(i&&!u)throw new V("`account` is required when `traceAssetChanges` is true");const l=u?C6(I6("constructor(bytes, bytes)"),{bytecode:Zf,args:[F6,k6(Er("function getBalance(address)"),[u.address])]}):void 0,f=i?await Promise.all(t.calls.map(async P=>{if(!P.data&&!P.abi)return;const{accessList:L}=await ld(e,{account:u.address,...P,data:P.abi?$t(P):P.data});return L.map(({address:j,storageKeys:z})=>z.length>0?j:null)})).then(P=>P.flat().filter(Boolean)):[],p=await nc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:l}],stateOverrides:s},{calls:f.map((P,L)=>({abi:[Er("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:P,from:Dt,nonce:L})),stateOverrides:[{address:Dt,nonce:0}]}]:[],{calls:[...o,{}].map(P=>({...P,from:u==null?void 0:u.address})),stateOverrides:s},...i?[{calls:[{data:l}]},{calls:f.map((P,L)=>({abi:[Er("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:P,from:Dt,nonce:L})),stateOverrides:[{address:Dt,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function decimals() returns (uint256)")],functionName:"decimals",from:Dt,nonce:L})),stateOverrides:[{address:Dt,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Dt,nonce:L})),stateOverrides:[{address:Dt,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function symbol() returns (string)")],functionName:"symbol",from:Dt,nonce:L})),stateOverrides:[{address:Dt,nonce:0}]}]:[]],traceTransfers:c,validation:a}),d=i?p[2]:p[0],[h,m,,w,$,E,S,N]=i?p:[],{calls:B,...F}=d,D=B.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],g=(m==null?void 0:m.calls)??[],v=[...b,...g].map(P=>P.status==="success"?kt(P.data):null),C=(w==null?void 0:w.calls)??[],O=($==null?void 0:$.calls)??[],I=[...C,...O].map(P=>P.status==="success"?kt(P.data):null),M=((E==null?void 0:E.calls)??[]).map(P=>P.status==="success"?P.result:null),y=((N==null?void 0:N.calls)??[]).map(P=>P.status==="success"?P.result:null),A=((S==null?void 0:S.calls)??[]).map(P=>P.status==="success"?P.result:null),T=[];for(const[P,L]of I.entries()){const j=v[P];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=M[P-1],_=y[P-1],W=A[P-1],K=P===0?{address:L6,decimals:18,symbol:"ETH"}:{address:f[P-1],decimals:W||z?Number(z??1):void 0,symbol:_??void 0};T.some(G=>G.token.address===K.address)||T.push({token:K,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:T,block:F,results:D}}const s0="0x6492649264926492649264926492649264926492649264926492649264926492";function R6(e){if(Ft(e,-32)!==s0)throw new U6(e)}function j6(e){const{data:t,signature:n,to:r}=e;return At(Ra(Od("address, bytes, bytes"),[r,t,n]),s0)}function _6(e){try{return R6(e),!0}catch{return!1}}class U6 extends ie{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function z6({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new Xd.Signature(kt(e),kt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:Bt(i)}async function Os(e,t){var c,a,u,l,f,p;const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??((u=(a=(c=e.chain)==null?void 0:c.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:u.address),multicallAddress:s=t.multicallAddress??((p=(f=(l=e.chain)==null?void 0:l.contracts)==null?void 0:f.multicall3)==null?void 0:p.address)}=t,i=(()=>{const d=t.signature;return Et(d)?d:typeof d=="object"&&"r"in d&&"s"in d?z6(d):Te(d)})();try{return y6(i)?await H6(e,{...t,multicallAddress:s,signature:i}):await W6(e,{...t,verifierAddress:o,signature:i})}catch(d){try{if(go(mn(n),await Yl({hash:r,signature:i})))return!0}catch{}if(d instanceof Hn)return!1;throw d}}async function H6(e,t){var w;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:u,to:l}=g6(t.signature);if(await Ia(e,{address:n,blockNumber:r,blockTag:o})===cr(["0xef0100",c.address]))return await V6(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:u});const p={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:Q(c.r,{size:32}),s:Q(c.s,{size:32}),yParity:c.yParity};if(!await Mw({address:n,authorization:p}))throw new Hn;const h=await X(e,Nt,"readContract")({...i?{address:i}:{code:ma},authorizationList:[p],abi:ys,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:l??n,callData:a}]:[],{allowFailure:!0,target:n,callData:$t({abi:Gf,functionName:"isValidSignature",args:[s,u]})}]]}),m=(w=h[h.length-1])==null?void 0:w.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new Hn}async function W6(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,u=await(async()=>!r&&!o||_6(i)?i:j6({data:o,signature:i,to:r}))(),l=c?{to:c,data:$t({abi:qf,functionName:"isValidSig",args:[n,s,u]}),...a}:{data:ya({abi:qf,args:[n,s,u],bytecode:jy}),...a},{data:f}=await X(e,So,"call")(l).catch(p=>{throw p instanceof Vl?new Hn:p});if(t1(f??"0x0"))return!0;throw new Hn}async function V6(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await X(e,Nt,"readContract")({address:n,abi:Gf,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof Gl?new Hn:a})).startsWith("0x1626ba7e"))return!0;throw new Hn}class Hn extends Error{}async function G6(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=bd(n);return X(e,Os,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function q6(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:u,...l}=t,f=ev({message:i,primaryType:c,types:a,domain:u});return X(e,Os,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...l})}function i0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const c=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let a;return c?(()=>{const f=Ae(["watchBlockNumber",e.uid,t,n,i]);return vn(f,{onBlockNumber:r,onError:o},p=>Po(async()=>{var d;try{const h=await X(e,$o,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let m=a+1n;m<h;m++)p.onBlockNumber(m,a),a=m}(a===void 0||h>a)&&(p.onBlockNumber(h,a),a=h)}catch(h){(d=p.onError)==null||d.call(p,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const f=Ae(["watchBlockNumber",e.uid,t,n]);return vn(f,{onBlockNumber:r,onError:o},p=>{let d=!0,h=()=>d=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const $=e.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return $?$.value:e.transport}return e.transport})(),{unsubscribe:w}=await m.subscribe({params:["newHeads"],onData($){var S;if(!d)return;const E=kt((S=$.result)==null?void 0:S.number);p.onBlockNumber(E,a),a=E},onError($){var E;(E=p.onError)==null||E.call(p,$)}});h=w,d||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function Z6(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:c=({count:B})=>~~(1<<B)*200,timeout:a=18e4}=t,u=Ae(["waitForTransactionReceipt",e.uid,o]),l=(()=>{var B;return t.pollingInterval?t.pollingInterval:(B=e.chain)!=null&&B.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,p,d,h=!1,m,w;const{promise:$,resolve:E,reject:S}=Xf(),N=a?setTimeout(()=>{w==null||w(),m==null||m(),S(new bg({hash:o}))},a):void 0;return m=vn(u,{onReplaced:s,resolve:E,reject:S},async B=>{if(d=await X(e,$s,"getTransactionReceipt")({hash:o}).catch(()=>{}),d&&r<=1){clearTimeout(N),B.resolve(d),m==null||m();return}w=X(e,i0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:l,async onBlockNumber(F){const D=g=>{clearTimeout(N),w==null||w(),g(),m==null||m()};let b=F;if(!h)try{if(d){if(r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;D(()=>B.resolve(d));return}if(n&&!f&&(h=!0,await Ea(async()=>{f=await X(e,tc,"getTransaction")({hash:o}),f.blockNumber&&(b=f.blockNumber)},{delay:c,retryCount:i}),h=!1),d=await X(e,$s,"getTransactionReceipt")({hash:o}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;D(()=>B.resolve(d))}catch(g){if(g instanceof Hl||g instanceof Wl){if(!f){h=!1;return}try{p=f,h=!0;const v=await Ea(()=>X(e,Tt,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:I})=>I instanceof nf});h=!1;const C=v.transactions.find(({from:I,nonce:M})=>I===p.from&&M===p.nonce);if(!C||(d=await X(e,$s,"getTransactionReceipt")({hash:C.hash}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r)))return;let O="replaced";C.to===p.to&&C.value===p.value&&C.input===p.input?O="repriced":C.from===C.to&&C.value===0n&&(O="cancelled"),D(()=>{var I;(I=B.onReplaced)==null||I.call(B,{reason:O,replacedTransaction:p,transaction:C,transactionReceipt:d}),B.resolve(d)})}catch(v){D(()=>B.reject(v))}}else D(()=>B.reject(g))}}})}),$}function Y6(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:c,pollingInterval:a=e.pollingInterval}){const u=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),l=i??!1;let f;return u?(()=>{const h=Ae(["watchBlocks",e.uid,t,n,r,l,a]);return vn(h,{onBlock:o,onError:s},m=>Po(async()=>{var w;try{const $=await X(e,Tt,"getBlock")({blockTag:t,includeTransactions:l});if($.number!==null&&(f==null?void 0:f.number)!=null){if($.number===f.number)return;if($.number-f.number>1&&n)for(let E=(f==null?void 0:f.number)+1n;E<$.number;E++){const S=await X(e,Tt,"getBlock")({blockNumber:E,includeTransactions:l});m.onBlock(S,f),f=S}}((f==null?void 0:f.number)==null||t==="pending"&&($==null?void 0:$.number)==null||$.number!==null&&$.number>f.number)&&(m.onBlock($,f),f=$)}catch($){(w=m.onError)==null||w.call(m,$)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,m=!0,w=()=>h=!1;return(async()=>{try{r&&X(e,Tt,"getBlock")({blockTag:t,includeTransactions:l}).then(S=>{h&&m&&(o(S,void 0),m=!1)}).catch(s);const $=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(N=>N.config.type==="webSocket"||N.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:E}=await $.subscribe({params:["newHeads"],async onData(S){var B;if(!h)return;const N=await X(e,Tt,"getBlock")({blockNumber:(B=S.result)==null?void 0:B.number,includeTransactions:l}).catch(()=>{});h&&(o(N,f),m=!1,f=N)},onError(S){s==null||s(S)}});w=E,h||w()}catch($){s==null||s($)}})(),()=>w()})()}function K6(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:c,onLogs:a,poll:u,pollingInterval:l=e.pollingInterval,strict:f}){const p=typeof u<"u"?u:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),d=f??!1;return p?(()=>{const w=Ae(["watchEvent",t,n,r,e.uid,o,l,i]);return vn(w,{onLogs:a,onError:c},$=>{let E;i!==void 0&&(E=i-1n);let S,N=!1;const B=Po(async()=>{var F;if(!N){try{S=await X(e,fd,"createEventFilter")({address:t,args:n,event:o,events:s,strict:d,fromBlock:i})}catch{}N=!0;return}try{let D;if(S)D=await X(e,ws,"getFilterChanges")({filter:S});else{const b=await X(e,$o,"getBlockNumber")({});E&&E!==b?D=await X(e,sa,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:E+1n,toBlock:b}):D=[],E=b}if(D.length===0)return;if(r)$.onLogs(D);else for(const b of D)$.onLogs([b])}catch(D){S&&D instanceof gn&&(N=!1),(F=$.onError)==null||F.call($,D)}},{emitOnBegin:!0,interval:l});return async()=>{S&&await X(e,vs,"uninstallFilter")({filter:S}),B()}})})():(()=>{let w=!0,$=()=>w=!1;return(async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const F=e.transport.transports.find(D=>D.config.type==="webSocket"||D.config.type==="ipc");return F?F.value:e.transport}return e.transport})(),S=s??(o?[o]:void 0);let N=[];S&&(N=[S.flatMap(D=>Hr({abi:[D],eventName:D.name,args:n}))],o&&(N=N[0]));const{unsubscribe:B}=await E.subscribe({params:["logs",{address:t,topics:N}],onData(F){var b;if(!w)return;const D=F.result;try{const{eventName:g,args:v}=fs({abi:S??[],data:D.data,topics:D.topics,strict:d}),C=Xt(D,{args:v,eventName:g});a([C])}catch(g){let v,C;if(g instanceof Jo||g instanceof $i){if(f)return;v=g.abiItem.name,C=(b=g.abiItem.inputs)==null?void 0:b.some(I=>!("name"in I&&I.name))}const O=Xt(D,{args:C?[]:{},eventName:v});a([O])}},onError(F){c==null||c(F)}});$=B,w||$()}catch(E){c==null||c(E)}})(),()=>$()})()}function X6(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const u=Ae(["watchPendingTransactions",e.uid,t,s]);return vn(u,{onTransactions:r,onError:n},l=>{let f;const p=Po(async()=>{var d;try{if(!f)try{f=await X(e,dd,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await X(e,ws,"getFilterChanges")({filter:f});if(h.length===0)return;if(t)l.onTransactions(h);else for(const m of h)l.onTransactions([m])}catch(h){(d=l.onError)==null||d.call(l,h)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await X(e,vs,"uninstallFilter")({filter:f}),p()}})})():(()=>{let u=!0,l=()=>u=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(p){if(!u)return;const d=p.result;r([d])},onError(p){n==null||n(p)}});l=f,u||l()}catch(f){n==null||n(f)}})(),()=>l()})()}function Q6(e){var f,p,d;const{scheme:t,statement:n,...r}=((f=e.match(J6))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...u}=((p=e.match(e5))==null?void 0:p.groups)??{},l=(d=e.split("Resources:")[1])==null?void 0:d.split(`
|
|
83
|
-
- `).slice(1);return{...r,...
|
|
80
|
+
`)}class gg extends V{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Gr(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class yg extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p}){var h;const d=Gr({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",d].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Wu extends V{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){let i="Transaction";r&&s!==void 0&&(i=`Transaction at block time "${r}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),n&&s!==void 0&&(i=`Transaction at block number "${n}" at index "${s}"`),o&&(i=`Transaction with hash "${o}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class Hu extends V{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class vg extends V{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class wg extends V{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const xg=e=>e,qr=e=>e;class Vu extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p,stateOverride:d}){var v;const h=n?Je(n):void 0;let m=Gr({from:h==null?void 0:h.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((v=o==null?void 0:o.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});d&&(m+=`
|
|
81
|
+
${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Gu extends V{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:c}){const a=Mn({abi:n,args:r,name:i}),l=a?zu({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?xt(a,{includeName:!0}):void 0,f=Gr({address:o&&xg(o),function:u,args:l&&l!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:c});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=o,this.functionName=i,this.sender=c}}class ji extends V{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,c,a;if(n&&n!=="0x")try{i=_u({abi:t,data:n});const{abiItem:u,errorName:f,args:p}=i;if(f==="Error")a=p[0];else if(f==="Panic"){const[d]=p;a=Q1[d]}else{const d=u?xt(u,{includeName:!0}):void 0,h=u&&p?zu({abiItem:u,args:p,includeFunctionName:!1,includeName:!1}):void 0;c=[d?`Error: ${d}`:"",h&&h!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(u){s=u}else o&&(a=o);let l;s instanceof su&&(l=s.signature,c=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(a&&a!=="execution reverted"||l?[`The contract function "${r}" reverted with the following ${l?"signature":"reason"}:`,a||l].join(`
|
|
82
|
+
`):`The contract function "${r}" reverted.`,{cause:s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=n,this.reason=a,this.signature=l}}class Eg extends V{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class Sg extends V{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class is extends V{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class Ln extends V{constructor({body:t,cause:n,details:r,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${qr(i)}`,t&&`Request body: ${$e(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=s,this.url=i}}class _i extends V{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${qr(r)}`,`Request body: ${$e(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class qu extends V{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${qr(n)}`,`Request body: ${$e(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Pg=-1;class We extends V{constructor(t,{code:n,docsPath:r,metaMessages:o,name:s,shortMessage:i}){super(i,{cause:t,docsPath:r,metaMessages:o||(t==null?void 0:t.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof _i?t.code:n??Pg}}class et extends We{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Zr extends We{constructor(t){super(t,{code:Zr.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Zr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Kr extends We{constructor(t){super(t,{code:Kr.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Kr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Yr extends We{constructor(t,{method:n}={}){super(t,{code:Yr.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Yr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Xr extends We{constructor(t){super(t,{code:Xr.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
83
|
+
`)})}}Object.defineProperty(Xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Bn extends We{constructor(t){super(t,{code:Bn.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Bn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class gn extends We{constructor(t){super(t,{code:gn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
84
|
+
`)})}}Object.defineProperty(gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Qr extends We{constructor(t){super(t,{code:Qr.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Qr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Jr extends We{constructor(t){super(t,{code:Jr.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Jr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class eo extends We{constructor(t){super(t,{code:eo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Fn extends We{constructor(t,{method:n}={}){super(t,{code:Fn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Fn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class fr extends We{constructor(t){super(t,{code:fr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(fr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class to extends We{constructor(t){super(t,{code:to.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class dr extends et{constructor(t){super(t,{code:dr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(dr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class no extends et{constructor(t){super(t,{code:no.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(no,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ro extends et{constructor(t,{method:n}={}){super(t,{code:ro.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class oo extends et{constructor(t){super(t,{code:oo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class so extends et{constructor(t){super(t,{code:so.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class io extends et{constructor(t){super(t,{code:io.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class ao extends et{constructor(t){super(t,{code:ao.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class co extends et{constructor(t){super(t,{code:co.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class lo extends et{constructor(t){super(t,{code:lo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class uo extends et{constructor(t){super(t,{code:uo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class fo extends et{constructor(t){super(t,{code:fo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class po extends et{constructor(t){super(t,{code:po.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class ho extends et{constructor(t){super(t,{code:ho.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Tg extends We{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Ag=3;function pr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof is?e:e instanceof V?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:l,details:u,message:f,shortMessage:p}=c,d=e instanceof Rr?new Eg({functionName:s}):[Ag,Bn.code].includes(a)&&(l||u||f||p)||a===gn.code&&u==="execution reverted"&&l?new ji({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c instanceof _i?u:p??f}):e;return new Gu(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function $g(e){const t=ke(`0x${e.substring(4)}`).substring(26);return os(`0x${t}`)}async function Ng({hash:e,signature:t}){const n=Et(e)?e:pn(e),{secp256k1:r}=await Promise.resolve().then(()=>a6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:f,yParity:p}=t,d=Number(p??f),h=Zu(d);return new r.Signature(Dt(l),Dt(u)).addRecoveryBit(h)}const i=Et(t)?t:pn(t);if(ve(i)!==65)throw new Error("invalid signature length");const c=Zt(`0x${i.slice(130)}`),a=Zu(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Zu(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Ku({hash:e,signature:t}){return $g(await Ng({hash:e,signature:t}))}function Cg(e,t="hex"){const n=Yu(e),r=Li(new Uint8Array(n.length));return n.encode(r),t==="hex"?Ae(r.bytes):r.bytes}function Yu(e){return Array.isArray(e)?Og(e.map(t=>Yu(t))):Ig(e)}function Og(e){const t=e.reduce((o,s)=>o+s.length,0),n=Xu(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function Ig(e){const t=typeof e=="string"?Mt(e):e,n=Xu(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function Xu(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new V("Length is too large.")}function kg(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=ke(cr(["0x05",Cg([t?Q(t):"0x",o,n?Q(n):"0x"])]));return r==="bytes"?Mt(s):s}async function Qu(e){const{authorization:t,signature:n}=e;return Ku({hash:kg(t),signature:n??t})}class Dg extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p}){var h;const d=Gr({from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Ri(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ue(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ue(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ue(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",d].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class hr extends V{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(hr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(hr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class as extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ue(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(as,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class zi extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ue(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(zi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Ui extends V{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Ui,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Wi extends V{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
85
|
+
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(Wi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Hi extends V{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(Hi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Vi extends V{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
86
|
+
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Vi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Gi extends V{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Gi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class qi extends V{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(qi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Zi extends V{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Zi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class cs extends V{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Ue(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Ue(r)} gwei`:""}).`].join(`
|
|
87
|
+
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(cs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class mo extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ls(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===hr.code):e;return r instanceof V?new hr({cause:e,message:r.details}):hr.nodeMessage.test(n)?new hr({cause:e,message:e.details}):as.nodeMessage.test(n)?new as({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):zi.nodeMessage.test(n)?new zi({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Ui.nodeMessage.test(n)?new Ui({cause:e,nonce:t==null?void 0:t.nonce}):Wi.nodeMessage.test(n)?new Wi({cause:e,nonce:t==null?void 0:t.nonce}):Hi.nodeMessage.test(n)?new Hi({cause:e,nonce:t==null?void 0:t.nonce}):Vi.nodeMessage.test(n)?new Vi({cause:e}):Gi.nodeMessage.test(n)?new Gi({cause:e,gas:t==null?void 0:t.gas}):qi.nodeMessage.test(n)?new qi({cause:e,gas:t==null?void 0:t.gas}):Zi.nodeMessage.test(n)?new Zi({cause:e}):cs.nodeMessage.test(n)?new cs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new mo({cause:e})}function Mg(e,{docsPath:t,...n}){const r=(()=>{const o=ls(e,n);return o instanceof mo?e:o})();return new Dg(r,{docsPath:t,...n})}function us(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const c of i)c in e&&(n[c]=e[c]),s[c]&&typeof s[c]=="object"&&!Array.isArray(s[c])&&r(s[c])}const o=t(e||{});return r(o),n}const Lg={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function bo(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Bg(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Ae(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=Q(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=Q(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=Q(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=Q(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=Q(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=Q(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Lg[e.type]),typeof e.value<"u"&&(n.value=Q(e.value)),n}function Bg(e){return e.map(t=>({address:t.address,r:t.r?Q(BigInt(t.r)):t.r,s:t.s?Q(BigInt(t.s)):t.s,chainId:Q(t.chainId),nonce:Q(t.nonce),...typeof t.yParity<"u"?{yParity:Q(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Q(t.v)}:{}}))}function Ju(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new fu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new fu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Fg(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=Q(t)),n!==void 0&&(i.nonce=Q(n)),r!==void 0&&(i.state=Ju(r)),o!==void 0){if(i.state)throw new mg;i.stateDiff=Ju(o)}return i}function Ki(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!at(n,{strict:!1}))throw new hn({address:n});if(t[n])throw new hg({address:n});t[n]=Fg(r)}return t}const ef=2n**256n-1n;function mr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?Je(t):void 0;if(s&&!at(s.address))throw new hn({address:s.address});if(o&&!at(o))throw new hn({address:o});if(n&&n>ef)throw new as({maxFeePerGas:n});if(r&&n&&r>n)throw new cs({maxFeePerGas:n,maxPriorityFeePerGas:r})}class tf extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Yi extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Rg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ue(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class nf extends V{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const rf={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Xi(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Zt(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Zt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?rf[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=jg(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function jg(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function of(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Xi(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function At(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var l,u,f;const s=o??!1,i=n!==void 0?Q(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!c)throw new nf({blockHash:t,blockNumber:n});return(((f=(u=(l=e.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:f.format)||of)(c,"getBlock")}async function Qi(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function _g(e,t){return sf(e,t)}async function sf(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const c=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof c=="function"){const l=n||await X(e,At,"getBlock")({}),u=await c({block:l,client:e,request:o});if(u===null)throw new Error;return u}if(typeof c<"u")return c;const a=await e.request({method:"eth_maxPriorityFeePerGas"});return Dt(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):X(e,At,"getBlock")({}),X(e,Qi,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Yi;const l=a-c.baseFeePerGas;return l<0n?0n:l}}async function zg(e,t){return Ji(e,t)}async function Ji(e,t){var p,d;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,m;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(i<1)throw new tf;const a=10**(((p=i.toString().split(".")[1])==null?void 0:p.length)??0),l=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),u=n||await X(e,At,"getBlock")({});if(typeof((d=r==null?void 0:r.fees)==null?void 0:d.estimateFeesPerGas)=="function"){const h=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:l,request:o,type:s});if(h!==null)return h}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Yi;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await sf(e,{block:u,chain:r,request:o}),m=l(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??l(await X(e,Qi,"getGasPrice")({}))}}async function af(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?Q(r):n]},{dedupe:!!r});return Zt(o)}function cf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>Mt(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Ae(s))}function lf(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Mt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>Mt(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const c=r[i],a=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(c,a)))}return n==="bytes"?s:s.map(i=>Ae(i))}function Ug(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),c=Number(n&s),a=r?4:0,l=r?0:4;e.setUint32(t+a,i,r),e.setUint32(t+l,c,r)}function Wg(e,t,n){return e&t^~e&n}function Hg(e,t,n){return e&t^e&n^t&n}class Vg extends $i{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ai(this.buffer)}update(t){ir(this),t=ts(t),Dn(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const c=Math.min(o-this.pos,s-i);if(c===o){const a=Ai(t);for(;o<=s-i;i+=o)this.process(a,i);continue}r.set(t.subarray(i,i+c),this.pos),this.pos+=c,i+=c,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ir(this),bu(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,ar(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;Ug(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Ai(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=a/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)c.setUint32(4*f,u[f],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:i,pos:c}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=c,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const yn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Gg=Uint32Array.from([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]),vn=new Uint32Array(64);class qg extends Vg{constructor(t=32){super(64,t,8,!1),this.A=yn[0]|0,this.B=yn[1]|0,this.C=yn[2]|0,this.D=yn[3]|0,this.E=yn[4]|0,this.F=yn[5]|0,this.G=yn[6]|0,this.H=yn[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:c,H:a}=this;return[t,n,r,o,s,i,c,a]}set(t,n,r,o,s,i,c,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=c|0,this.H=a|0}process(t,n){for(let f=0;f<16;f++,n+=4)vn[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=vn[f-15],d=vn[f-2],h=Lt(p,7)^Lt(p,18)^p>>>3,m=Lt(d,17)^Lt(d,19)^d>>>10;vn[f]=m+vn[f-7]+h+vn[f-16]|0}let{A:r,B:o,C:s,D:i,E:c,F:a,G:l,H:u}=this;for(let f=0;f<64;f++){const p=Lt(c,6)^Lt(c,11)^Lt(c,25),d=u+p+Wg(c,a,l)+Gg[f]+vn[f]|0,m=(Lt(r,2)^Lt(r,13)^Lt(r,22))+Hg(r,o,s)|0;u=l,l=a,a=c,c=i+d|0,i=s,s=o,o=r,r=d+m|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,c=c+this.E|0,a=a+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,o,s,i,c,a,l,u)}roundClean(){ar(vn)}destroy(){this.set(0,0,0,0,0,0,0,0),ar(this.buffer)}}const uf=yu(()=>new qg),Zg=uf;function Kg(e,t){return Zg(Et(e,{strict:!1})?or(e):e)}function Yg(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=Kg(t);return o.set([n],0),r==="bytes"?o:Ae(o)}function Xg(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(Yg({commitment:s,to:r,version:n}));return o}const ff=6,df=32,ea=4096,pf=df*ea,hf=pf*ff-1-1*ea*ff;class Qg extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Jg extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function ey(e){const t=typeof e.data=="string"?Mt(e.data):e.data,n=ve(t);if(!n)throw new Jg;if(n>hf)throw new Qg({maxSize:hf,size:n});const r=[];let o=!0,s=0;for(;o;){const i=Li(new Uint8Array(pf));let c=0;for(;c<ea;){const a=t.slice(s,s+(df-1));if(i.pushByte(0),i.pushBytes(a),a.length<31){i.pushByte(128),o=!1;break}c++,s+=31}r.push(i)}return r.map(i=>Ae(i.bytes))}function ty(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??ey({data:t}),s=e.commitments??cf({blobs:o,kzg:n,to:r}),i=e.proofs??lf({blobs:o,commitments:s,kzg:n,to:r}),c=[];for(let a=0;a<o.length;a++)c.push({blob:o[a],commitment:s[a],proof:i[a]});return c}function ny(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new gg({transaction:e})}function ry(e,{docsPath:t,...n}){const r=(()=>{const o=ls(e,n);return o instanceof mo?e:o})();return new yg(r,{docsPath:t,...n})}async function ta(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Zt(t)}async function mf(e,t){var b,g,w,O,N;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:c,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:h,nonceManager:m,to:v,type:T,value:E,...S}=t,C=await(async()=>{if(!n||!m||typeof h<"u")return h;const I=Je(n),k=s?s.id:await X(e,ta,"getChainId")({});return await m.consume({address:I.address,chainId:k,client:e})})();mr(t);const M=(g=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:g.format,F=(M||bo)({...us(S,{format:M}),account:n?Je(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:C,to:v,type:T,value:E},"fillTransaction");try{const I=await e.request({method:"eth_fillTransaction",params:[F]}),y=(((O=(w=s==null?void 0:s.formatters)==null?void 0:w.transaction)==null?void 0:O.format)||Xi)(I.tx);delete y.blockHash,delete y.blockNumber,delete y.r,delete y.s,delete y.transactionIndex,delete y.v,delete y.yParity,y.data=y.input,y.gas&&(y.gas=t.gas??y.gas),y.gasPrice&&(y.gasPrice=t.gasPrice??y.gasPrice),y.maxFeePerBlobGas&&(y.maxFeePerBlobGas=t.maxFeePerBlobGas??y.maxFeePerBlobGas),y.maxFeePerGas&&(y.maxFeePerGas=t.maxFeePerGas??y.maxFeePerGas),y.maxPriorityFeePerGas&&(y.maxPriorityFeePerGas=t.maxPriorityFeePerGas??y.maxPriorityFeePerGas),y.nonce&&(y.nonce=t.nonce??y.nonce);const $=await(async()=>{var j,U;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await X(e,At,"getBlock")({});return s.fees.baseFeeMultiplier({block:_,client:e,request:t})}return((U=s==null?void 0:s.fees)==null?void 0:U.baseFeeMultiplier)??1.2})();if($<1)throw new tf;const P=10**(((N=$.toString().split(".")[1])==null?void 0:N.length)??0),L=j=>j*BigInt(Math.ceil($*P))/BigInt(P);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:I.raw,transaction:{from:F.from,...y}}}catch(I){throw ry(I,{...t,chain:e.chain})}}const oy=["blobVersionedHashes","chainId","fees","gas","nonce","type"],bf=new Map,na=new rs(128);async function gf(e,t){var C,M,B;let n=t;const{account:r=e.account,chain:o=e.chain,nonceManager:s,parameters:i=oy}=n,c=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let a;async function l(){return a||(typeof n.chainId<"u"?n.chainId:o?o.id:(a=await X(e,ta,"getChainId")({}),a))}const u=r&&Je(r);let f=n.nonce;if(i.includes("nonce")&&typeof f>"u"&&u&&s){const F=await l();f=await s.consume({address:u.address,chainId:F,client:e})}c!=null&&c.fn&&((C=c.runAt)!=null&&C.includes("beforeFillTransaction"))&&(n=await c.fn(n,{phase:"beforeFillTransaction"}),f??(f=n.nonce));const d=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||na.get(e.uid)===!1||!["fees","gas"].some(b=>i.includes(b))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof f!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await X(e,mf,"fillTransaction")({...n,nonce:f}).then(F=>{const{chainId:b,from:g,gas:w,gasPrice:O,nonce:N,maxFeePerBlobGas:I,maxFeePerGas:k,maxPriorityFeePerGas:y,type:$,...A}=F.transaction;return na.set(e.uid,!0),{...n,...g?{from:g}:{},...$?{type:$}:{},...typeof b<"u"?{chainId:b}:{},...typeof w<"u"?{gas:w}:{},...typeof O<"u"?{gasPrice:O}:{},...typeof N<"u"?{nonce:N}:{},...typeof I<"u"?{maxFeePerBlobGas:I}:{},...typeof k<"u"?{maxFeePerGas:k}:{},...typeof y<"u"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in A&&typeof A.nonceKey<"u"?{nonceKey:A.nonceKey}:{}}}).catch(F=>{var w;const b=F;return((w=b.walk)==null?void 0:w.call(b,O=>{const N=O;return N.name==="MethodNotFoundRpcError"||N.name==="MethodNotSupportedRpcError"}))&&na.set(e.uid,!1),n}):n;f??(f=d.nonce),n={...d,...u?{from:u==null?void 0:u.address}:{},...f?{nonce:f}:{}};const{blobs:h,gas:m,kzg:v,type:T}=n;c!=null&&c.fn&&((M=c.runAt)!=null&&M.includes("beforeFillParameters"))&&(n=await c.fn(n,{phase:"beforeFillParameters"}));let E;async function S(){return E||(E=await X(e,At,"getBlock")({blockTag:"latest"}),E)}if(i.includes("nonce")&&typeof f>"u"&&u&&!s&&(n.nonce=await X(e,af,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&v){const F=cf({blobs:h,kzg:v});if(i.includes("blobVersionedHashes")){const b=Xg({commitments:F,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=lf({blobs:h,commitments:F,kzg:v}),g=ty({blobs:h,commitments:F,proofs:b,to:"hex"});n.sidecars=g}}if(i.includes("chainId")&&(n.chainId=await l()),(i.includes("fees")||i.includes("type"))&&typeof T>"u")try{n.type=ny(n)}catch{let F=bf.get(e.uid);if(typeof F>"u"){const b=await S();F=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",bf.set(e.uid,F)}n.type=F?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const F=await S(),{maxFeePerGas:b,maxPriorityFeePerGas:g}=await Ji(e,{block:F,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new Rg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Yi;if(typeof n.gasPrice>"u"){const F=await S(),{gasPrice:b}=await Ji(e,{block:F,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await X(e,ra,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((B=c.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await c.fn(n,{phase:"afterFillParameters"})),mr(n),delete n.parameters,n}async function ra(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?Je(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Qu({authorization:t.authorizationList[0]}).catch(()=>{throw new V("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,blockNumber:h,blockTag:m,data:v,gas:T,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:C,maxPriorityFeePerGas:M,nonce:B,value:F,stateOverride:b,...g}=r?await gf(e,{...t,parameters:s,to:l}):t;if(T&&t.gas!==T)return T;const O=(typeof h=="bigint"?Q(h):void 0)||m,N=Ki(b);mr(t);const I=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,y=(I||bo)({...us(g,{format:I}),account:o,accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,data:v,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:C,maxPriorityFeePerGas:M,nonce:B,to:l,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:N?[y,O??e.experimental_blockTag??"latest",N]:O?[y,O]:[y]}))}catch(l){throw Mg(l,{...t,account:o,chain:e.chain})}}async function sy(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:i,...c}=t,a=Tt({abi:n,args:o,functionName:s});try{return await X(e,ra,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(l){const u=c.account?Je(c.account):void 0;throw pr(l,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}function go(e,t){if(!at(e,{strict:!1}))throw new hn({address:e});if(!at(t,{strict:!1}))throw new hn({address:t});return e.toLowerCase()===t.toLowerCase()}const yf="/docs/contract/decodeEventLog";function fs(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new Gb({docsPath:yf});const a=t.find(m=>m.type==="event"&&i===ns(xt(m)));if(!(a&&"name"in a)||a.type!=="event")throw new qb(i,{docsPath:yf});const{name:l,inputs:u}=a,f=u==null?void 0:u.some(m=>!("name"in m&&m.name)),p=f?[]:{},d=u.map((m,v)=>[m,v]).filter(([m])=>"indexed"in m&&m.indexed);for(let m=0;m<d.length;m++){const[v,T]=d[m],E=c[m];if(!E)throw new Ti({abiItem:a,param:v});p[f?T:v.name||T]=iy({param:v,value:E})}const h=u.filter(m=>!("indexed"in m&&m.indexed));if(h.length>0){if(n&&n!=="0x")try{const m=Hr(h,n);if(m)if(f)for(let v=0;v<u.length;v++)p[v]=p[v]??m.shift();else for(let v=0;v<h.length;v++)p[h[v].name]=m[v]}catch(m){if(s)throw m instanceof ru||m instanceof Ru?new Jo({abiItem:a,data:n,params:h,size:ve(n)}):m}else if(s)throw new Jo({abiItem:a,data:"0x",params:h,size:0})}return{eventName:l,args:Object.values(p).length>0?p:void 0}}function iy({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Hr([e],t)||[])[0]}function oa(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(i=>{var u;const c=t.filter(f=>f.type==="event"&&i.topics[0]===ns(f));if(c.length===0)return null;let a,l;for(const f of c)try{a=fs({...i,abi:[f],strict:!0}),l=f;break}catch{}if(!a&&!o){l=c[0];try{a=fs({...i,abi:[l],strict:!1})}catch{const f=(u=l.inputs)==null?void 0:u.some(p=>!("name"in p&&p.name));return{...i,args:f?[]:{},eventName:l.name}}}return!a||!l||s&&!s.includes(a.eventName)||!ay({args:a.args,inputs:l.inputs,matchArgs:n})?null:{...a,...i}}).filter(Boolean)}function ay(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,c){try{return s.type==="address"?go(i,c):s.type==="string"||s.type==="bytes"?ke(or(i))===c:i===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const c=n[i];return c?(Array.isArray(s)?s:[s]).some(l=>o(c,l,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const c=n.find(l=>l.name===s);return c?(Array.isArray(i)?i:[i]).some(l=>o(c,l,t[s])):!1}):!1}function Xt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function sa(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:c,strict:a}={}){const l=a??!1,u=i??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(m=>Wr({abi:[m],eventName:m.name,args:i?void 0:c}))],s&&(f=f[0]));let p;n?p=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):p=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?Q(r):r,toBlock:typeof o=="bigint"?Q(o):o}]});const d=p.map(h=>Xt(h));return u?oa({abi:u,args:c,logs:d,strict:l}):d}async function vf(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:l}=t,u=i?Mn({abi:n,name:i}):void 0,f=u?void 0:n.filter(p=>p.type==="event");return X(e,sa,"getLogs")({address:r,args:o,blockHash:s,event:u,events:f,fromBlock:c,toBlock:a,strict:l})}const ia="/docs/contract/decodeFunctionResult";function Rn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Mn({abi:t,args:n,name:r});if(!c)throw new nr(r,{docsPath:ia});s=c}if(s.type!=="function")throw new nr(void 0,{docsPath:ia});if(!s.outputs)throw new au(s.name,{docsPath:ia});const i=Hr(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const aa=BigInt(0),ca=BigInt(1);function yo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function la(e){if(!yo(e))throw new Error("Uint8Array expected")}function vo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function ds(e){const t=e.toString(16);return t.length&1?"0"+t:t}function wf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?aa:BigInt("0x"+e)}const xf=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",cy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wo(e){if(la(e),xf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=cy[e[n]];return t}const Qt={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ef(e){if(e>=Qt._0&&e<=Qt._9)return e-Qt._0;if(e>=Qt.A&&e<=Qt.F)return e-(Qt.A-10);if(e>=Qt.a&&e<=Qt.f)return e-(Qt.a-10)}function ps(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(xf)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const i=Ef(e.charCodeAt(s)),c=Ef(e.charCodeAt(s+1));if(i===void 0||c===void 0){const a=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+s)}r[o]=i*16+c}return r}function jn(e){return wf(wo(e))}function Sf(e){return la(e),wf(wo(Uint8Array.from(e).reverse()))}function xo(e,t){return ps(e.toString(16).padStart(t*2,"0"))}function Pf(e,t){return xo(e,t).reverse()}function ct(e,t,n){let r;if(typeof t=="string")try{r=ps(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(yo(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function hs(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];la(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const ua=e=>typeof e=="bigint"&&aa<=e;function fa(e,t,n){return ua(e)&&ua(t)&&ua(n)&&t<=e&&e<n}function br(e,t,n,r){if(!fa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function ly(e){let t;for(t=0;e>aa;e>>=ca,t+=1);return t}const ms=e=>(ca<<BigInt(e))-ca,da=e=>new Uint8Array(e),Tf=e=>Uint8Array.from(e);function uy(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=da(e),o=da(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=da(0))=>{o=c(Tf([0]),f),r=c(),f.length!==0&&(o=c(Tf([1]),f),r=c())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const p=[];for(;f<t;){r=c();const d=r.slice();p.push(d),f+=r.length}return hs(...p)};return(f,p)=>{i(),a(f);let d;for(;!(d=p(l()));)a();return i(),d}}const fy={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||yo(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function bs(e,t,n={}){const r=(o,s,i)=>{const c=fy[s];if(typeof c!="function")throw new Error("invalid validator function");const a=e[o];if(!(i&&a===void 0)&&!c(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+a)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function Af(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const dy="0.1.1";function py(){return dy}class ie extends Error{constructor(t,n={}){const r=(()=>{var a;if(n.cause instanceof ie){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof ie&&n.cause.docsPath||n.docsPath,i=`https://oxlib.sh${o??""}`,c=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0]:[]].filter(a=>typeof a=="string").join(`
|
|
88
|
+
`);super(c,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${py()}`}),this.cause=n.cause,this.details=r,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return $f(this,t)}}function $f(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?$f(e.cause,t):t?null:e}function Eo(e,t){if(gr(e)>t)throw new Oy({givenSize:gr(e),maxSize:t})}const Jt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Nf(e){if(e>=Jt.zero&&e<=Jt.nine)return e-Jt.zero;if(e>=Jt.A&&e<=Jt.F)return e-(Jt.A-10);if(e>=Jt.a&&e<=Jt.f)return e-(Jt.a-10)}function hy(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Iy({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function Cf(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function gs(e,t){if(tt(e)>t)throw new Fy({givenSize:tt(e),maxSize:t})}function my(e,t){if(typeof t=="number"&&t>0&&t>tt(e)-1)throw new _f({offset:t,position:"start",size:tt(e)})}function by(e,t,n){if(typeof t=="number"&&typeof n=="number"&&tt(e)!==n-t)throw new _f({offset:n,position:"end",size:tt(e)})}function Of(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new Ry({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const gy="#__bigint";function If(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+gy:o,n)}const yy=new TextDecoder,vy=new TextEncoder;function wy(e){return e instanceof Uint8Array?e:typeof e=="string"?kf(e):xy(e)}function xy(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function kf(e,t={}){const{size:n}=t;let r=e;n&&(gs(e,n),r=zn(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let c=0,a=0;c<s;c++){const l=Nf(o.charCodeAt(a++)),u=Nf(o.charCodeAt(a++));if(l===void 0||u===void 0)throw new ie(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=l*16+u}return i}function Ey(e,t={}){const{size:n}=t,r=vy.encode(e);return typeof n=="number"?(Eo(r,n),Sy(r,n)):r}function Sy(e,t){return hy(e,{dir:"right",size:t})}function gr(e){return e.length}function Py(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Ty(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Nt(e,t);return Lf(r,t)}function Ay(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Eo(r,n),r=Df(r)),r.length>1||r[0]>1)throw new Cy(r);return!!r[0]}function en(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Nt(e,t);return Bf(r,t)}function $y(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Eo(r,n),r=Ny(r)),yy.decode(r)}function Df(e){return Cf(e,{dir:"left"})}function Ny(e){return Cf(e,{dir:"right"})}class Cy extends ie{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let Oy=class extends ie{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Iy=class extends ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const ky=new TextEncoder,Dy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function My(e,t={}){const{strict:n=!1}=t;if(!e)throw new Rf(e);if(typeof e!="string")throw new Rf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new jf(e);if(!e.startsWith("0x"))throw new jf(e)}function $t(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Ly(e){return e instanceof Uint8Array?Nt(e):Array.isArray(e)?Nt(new Uint8Array(e)):e}function Mf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(gs(n,t.size),_n(n,t.size)):n}function Nt(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Dy[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(gs(r,t.size),zn(r,t.size)):r}function Le(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const l=typeof e=="bigint"?"n":"";throw new Ff({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:n,size:r,value:`${e}${l}`})}const a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?_n(a,r):a}function pa(e,t={}){return Nt(ky.encode(e),t)}function _n(e,t){return Of(e,{dir:"left",size:t})}function zn(e,t){return Of(e,{dir:"right",size:t})}function Bt(e,t,n,r={}){const{strict:o}=r;my(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&by(s,t,n),s}function tt(e){return Math.ceil((e.length-2)/2)}function Lf(e,t={}){const{signed:n}=t;t.size&&gs(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function Bf(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Lf(e,t))}function By(e,t={}){const{strict:n=!1}=t;try{return My(e,{strict:n}),!0}catch{return!1}}class Ff extends ie{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class Rf extends ie{constructor(t){super(`Value \`${typeof t=="object"?If(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class jf extends ie{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class Fy extends ie{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class _f extends ie{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class Ry extends ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function jy(e){return{address:e.address,amount:Le(e.amount),index:Le(e.index),validatorIndex:Le(e.validatorIndex)}}function zf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Le(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Le(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Le(e.gasLimit)},...typeof e.number=="bigint"&&{number:Le(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Le(e.prevRandao)},...typeof e.time=="bigint"&&{time:Le(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(jy)}}}const ys=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ha=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],Uf=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],Wf=[...Uf,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],_y=[...Uf,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],Hf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Vf=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Gf=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],qf=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],yr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],zy="0x82ad56cb",Zf="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Uy="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Wy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",ma="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class ba extends V{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class Kf extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const ga="/docs/contract/encodeDeployData";function ya(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new zb({docsPath:ga});if(!("inputs"in o))throw new nu({docsPath:ga});if(!o.inputs||o.inputs.length===0)throw new nu({docsPath:ga});const s=bn(o.inputs,n);return cr([r,s])}function vr({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new ba({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new ba({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Yf(e,{docsPath:t,...n}){const r=(()=>{const o=ls(e,n);return o instanceof mo?e:o})();return new Vu(r,{docsPath:t,...n})}function Xf(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const va=new Map;function Qf({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=a();i();const f=u.map(({args:p})=>p);f.length!==0&&e(f).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let d=0;d<u.length;d++){const{resolve:h}=u[d];h==null||h([p[d],p])}}).catch(p=>{for(let d=0;d<u.length;d++){const{reject:h}=u[d];h==null||h(p)}})},i=()=>va.delete(t),c=()=>a().map(({args:u})=>u),a=()=>va.get(t)||[],l=u=>va.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:f,resolve:p,reject:d}=Xf();return(n==null?void 0:n([...c(),u]))&&s(),a().length>0?(l({args:u,resolve:p,reject:d}),f):(l({args:u,resolve:p,reject:d}),setTimeout(s,r),f)}}}async function So(e,t){var I,k,y,$;const{account:n=e.account,authorizationList:r,batch:o=!!((I=e.batch)!=null&&I.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:c,blobs:a,blockOverrides:l,code:u,data:f,factory:p,factoryData:d,gas:h,gasPrice:m,maxFeePerBlobGas:v,maxFeePerGas:T,maxPriorityFeePerGas:E,nonce:S,to:C,value:M,stateOverride:B,...F}=t,b=n?Je(n):void 0;if(u&&(p||d))throw new V("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&C)throw new V("Cannot provide both `code` & `to` as parameters.");const g=u&&f,w=p&&d&&C&&f,O=g||w,N=g?Jf({code:u,data:f}):w?Gy({data:f,factory:p,factoryData:d,to:C}):f;try{mr(t);const P=(typeof s=="bigint"?Q(s):void 0)||i,L=l?zf(l):void 0,j=Ki(B),U=($=(y=(k=e.chain)==null?void 0:k.formatters)==null?void 0:y.transactionRequest)==null?void 0:$.format,H=(U||bo)({...us(F,{format:U}),accessList:c,account:b,authorizationList:r,blobs:a,data:N,gas:h,gasPrice:m,maxFeePerBlobGas:v,maxFeePerGas:T,maxPriorityFeePerGas:E,nonce:S,to:O?void 0:C,value:M},"call");if(o&&Hy({request:H})&&!j&&!L)try{return await Vy(e,{...H,blockNumber:s,blockTag:i})}catch(W){if(!(W instanceof Kf)&&!(W instanceof ba))throw W}const Y=(()=>{const W=[H,P];return j&&L?[...W,j,L]:j?[...W,j]:L?[...W,{},L]:W})(),G=await e.request({method:"eth_call",params:Y});return G==="0x"?{data:void 0}:{data:G}}catch(A){const P=qy(A),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>Vv);if(e.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===j&&C)return{data:await L(e,{data:P,to:C})};throw O&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new Sg({factory:p}):Yf(A,{...t,account:b,chain:e.chain})}}function Hy({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(zy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Vy(e,t){var m;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((m=e.batch)==null?void 0:m.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",data:c,to:a}=t,l=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return vr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Kf})(),f=(typeof s=="bigint"?Q(s):void 0)||i,{schedule:p}=Qf({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch(v){return v.reduce((E,{data:S})=>E+(S.length-2),0)>n*2},fn:async v=>{const T=v.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),E=Tt({abi:ys,args:[T],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...l===null?{data:Jf({code:ma,data:E})}:{to:l,data:E}},f]});return Rn({abi:ys,args:[T],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:d,success:h}]=await p({data:c,to:a});if(!h)throw new is({data:d});return d==="0x"?{data:void 0}:{data:d}}function Jf(e){const{code:t,data:n}=e;return ya({abi:Xl(["constructor(bytes, bytes)"]),bytecode:Zf,args:[t,n]})}function Gy(e){const{data:t,factory:n,factoryData:r,to:o}=e;return ya({abi:Xl(["constructor(address, bytes, address, bytes)"]),bytecode:Uy,args:[o,t,n,r]})}function qy(e){var n;if(!(e instanceof V))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function Ct(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=Tt({abi:n,args:o,functionName:s});try{const{data:a}=await X(e,So,"call")({...i,data:c,to:r});return Rn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw pr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function Zy(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:i,...c}=t,a=c.account?Je(c.account):e.account,l=Tt({abi:n,args:o,functionName:i});try{const{data:u}=await X(e,So,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...c,account:a}),f=Rn({abi:n,args:o,functionName:i,data:u||"0x"}),p=n.filter(d=>"name"in d&&d.name===t.functionName);return{result:f,request:{abi:p,address:r,args:o,dataSuffix:s,functionName:i,...c,account:a}}}catch(u){throw pr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:a==null?void 0:a.address})}}const wa=new Map,ed=new Map;let Ky=0;function wn(e,t,n){const r=++Ky,o=()=>wa.get(e)||[],s=()=>{const u=o();wa.set(e,u.filter(f=>f.id!==r))},i=()=>{const u=o();if(!u.some(p=>p.id===r))return;const f=ed.get(e);if(u.length===1&&f){const p=f();p instanceof Promise&&p.catch(()=>{})}s()},c=o();if(wa.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return i;const a={};for(const u in t)a[u]=(...f)=>{var d,h;const p=o();if(p.length!==0)for(const m of p)(h=(d=m.fns)[u])==null||h.call(d,...f)};const l=n(a);return typeof l=="function"&&ed.set(e,l),i}async function xa(e){return new Promise(t=>setTimeout(t,e))}function Po(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let c;t&&(c=await e({unpoll:s}));const a=await(n==null?void 0:n(c))??r;await xa(a);const l=async()=>{o&&(await e({unpoll:s}),await xa(r),l())};l()})(),s}const Yy=new Map,Xy=new Map;function Qy(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,Yy),r=t(e,Xy);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function Jy(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Qy(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const ev=e=>`blockNumber.${e}`;async function To(e,{cacheTime:t=e.cacheTime}={}){const n=await Jy(()=>e.request({method:"eth_blockNumber"}),{cacheKey:ev(e.uid),cacheTime:t});return BigInt(n)}async function vs(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const o=r.map(s=>Xt(s));return!("abi"in t)||!t.abi?o:oa({abi:t.abi,logs:o,strict:n})}async function ws(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function tv(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:c,onError:a,onLogs:l,poll:u,pollingInterval:f=e.pollingInterval,strict:p}=t;return(typeof u<"u"?u:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const v=p??!1,T=$e(["watchContractEvent",r,o,s,e.uid,i,f,v,c]);return wn(T,{onLogs:l,onError:a},E=>{let S;c!==void 0&&(S=c-1n);let C,M=!1;const B=Po(async()=>{var F;if(!M){try{C=await X(e,Mu,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:v,fromBlock:c})}catch{}M=!0;return}try{let b;if(C)b=await X(e,vs,"getFilterChanges")({filter:C});else{const g=await X(e,To,"getBlockNumber")({});S&&S<g?b=await X(e,vf,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:S+1n,toBlock:g,strict:v}):b=[],S=g}if(b.length===0)return;if(s)E.onLogs(b);else for(const g of b)E.onLogs([g])}catch(b){C&&b instanceof gn&&(M=!1),(F=E.onError)==null||F.call(E,b)}},{emitOnBegin:!0,interval:f});return async()=>{C&&await X(e,ws,"uninstallFilter")({filter:C}),B()}})})():(()=>{const v=p??!1,T=$e(["watchContractEvent",r,o,s,e.uid,i,f,v]);let E=!0,S=()=>E=!1;return wn(T,{onLogs:l,onError:a},C=>((async()=>{try{const M=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),B=i?Wr({abi:n,eventName:i,args:o}):[],{unsubscribe:F}=await M.subscribe({params:["logs",{address:r,topics:B}],onData(b){var w;if(!E)return;const g=b.result;try{const{eventName:O,args:N}=fs({abi:n,data:g.data,topics:g.topics,strict:p}),I=Xt(g,{args:N,eventName:O});C.onLogs([I])}catch(O){let N,I;if(O instanceof Jo||O instanceof Ti){if(p)return;N=O.abiItem.name,I=(w=O.abiItem.inputs)==null?void 0:w.some(y=>!("name"in y&&y.name))}const k=Xt(g,{args:I?[]:{},eventName:N});C.onLogs([k])}},onError(b){var g;(g=C.onError)==null||g.call(C,b)}});S=F,E||S()}catch(M){a==null||a(M)}})(),()=>S()))})()}async function nv(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Ea(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:c=0}={})=>{const a=async({error:l})=>{const u=typeof t=="function"?t({count:c,error:l}):t;u&&await xa(u),i({count:c+1})};try{const l=await e();o(l)}catch(l){if(c<n&&await r({count:c,error:l}))return a({error:l});s(l)}};i()})}const rv={"0x0":"reverted","0x1":"success"};function td(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>Xt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Zt(e.transactionIndex):null,status:e.status?rv[e.status]:null,type:e.type?rf[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Sa=256;let xs=Sa,Es;function nd(e=11){if(!Es||xs+e>Sa*2){Es="",xs=0;for(let t=0;t<Sa;t++)Es+=(256+Math.random()*256|0).toString(16).substring(1)}return Es.substring(xs,xs+++e)}function ov(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:i="base"}=e,c=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),a=(n==null?void 0:n.blockTime)??12e3,l=Math.min(Math.max(Math.floor(a/2),500),4e3),u=e.pollingInterval??l,f=e.cacheTime??u,p=e.account?Je(e.account):void 0,{config:d,request:h,value:m}=e.transport({account:p,chain:n,pollingInterval:u}),v={...d,...m},T={account:p,batch:t,cacheTime:f,ccipRead:r,chain:n,key:o,name:s,pollingInterval:u,request:h,transport:v,type:i,uid:nd(),...c?{experimental_blockTag:c}:{}};function E(S){return C=>{const M=C(S);for(const F in T)delete M[F];const B={...S,...M};return Object.assign(B,{extend:E(B)})}}return Object.assign(T,{extend:E(T)})}function Pa(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof ji);return t instanceof ji?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((c=t.data)==null?void 0:c.errorName)==="UnsupportedResolverProfile":!1}function sv(e){const{abi:t,data:n}=e,r=lr(n,0,4),o=t.find(s=>s.type==="function"&&r===Ur(xt(s)));if(!o)throw new Zb(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Hr(o.inputs,lr(n,4)):void 0}}const Ta="/docs/contract/encodeErrorResult";function rd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Mn({abi:t,args:r,name:n});if(!a)throw new ou(n,{docsPath:Ta});o=a}if(o.type!=="error")throw new ou(void 0,{docsPath:Ta});const s=xt(o),i=Ur(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new Vb(o.name,{docsPath:Ta});c=bn(o.inputs,r)}return cr([i,c])}const Aa="/docs/contract/encodeFunctionResult";function iv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Mn({abi:t,name:n});if(!i)throw new nr(n,{docsPath:Aa});o=i}if(o.type!=="function")throw new nr(void 0,{docsPath:Aa});if(!o.outputs)throw new au(o.name,{docsPath:Aa});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new cu(r)})();return bn(o.outputs,s)}const Ao="x-batch-gateway:true";async function od(e){const{data:t,ccipRequest:n}=e,{args:[r]}=sv({abi:ha,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(Ao)?await od({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=av(a)}})),iv({abi:ha,functionName:"query",result:[o,s]})}function av(e){return e.name==="HttpRequestError"&&e.status?rd({abi:ha,errorName:"HttpError",args:[e.status,e.shortMessage]}):rd({abi:[Bu],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function sd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Et(t)?t:null}function $a(e){let t=new Uint8Array(32).fill(0);if(!e)return Ae(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=sd(n[r]),s=o?or(o):ke(kn(n[r]),"bytes");t=ke(Pt([t,s]),"bytes")}return Ae(t)}function cv(e){return`[${e.slice(2)}]`}function lv(e){const t=new Uint8Array(32).fill(0);return e?sd(e)||ke(kn(e)):Ae(t)}function Na(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(kn(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=kn(o[s]);i.byteLength>255&&(i=kn(cv(lv(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function uv(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(p=>s.endsWith(p)))return null;const f=o!=null?[$a(s),BigInt(o)]:[$a(s)];try{const p=Tt({abi:Vf,functionName:"addr",args:f}),d={address:l,abi:Wf,functionName:"resolveWithGateways",args:[pn(Na(s)),p,i??[Ao]],blockNumber:n,blockTag:r},m=await X(e,Ct,"readContract")(d);if(m[0]==="0x")return null;const v=Rn({abi:Vf,args:f,functionName:"addr",data:m[0]});return v==="0x"||In(v)==="0x00"?null:v}catch(p){if(c)throw p;if(Pa(p))return null;throw p}}class fv extends V{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class $o extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Ca extends V{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class dv extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const pv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,hv=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,mv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,bv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function gv(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function id(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function ad({uri:e,gatewayUrls:t}){const n=mv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=id(t==null?void 0:t.ipfs,"https://ipfs.io"),o=id(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(pv),{protocol:i,subpath:c,target:a,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||hv.test(e);if(e.startsWith("http")&&!u&&!f){let d=e;return t!=null&&t.arweave&&(d=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:d,isOnChain:!1,isEncoded:!1}}if((u||f)&&a)return{uri:`${r}/${u?"ipns":"ipfs"}/${a}${l}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&a)return{uri:`${o}/${a}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(bv,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new Ca({uri:e})}function cd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new fv({data:e});return e.image||e.image_url||e.image_data}async function yv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await Oa({gatewayUrls:e,uri:cd(n)})}catch{throw new Ca({uri:t})}}async function Oa({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=ad({uri:t,gatewayUrls:e});if(r||await gv(n))return n;throw new Ca({uri:t})}function vv(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[c,a]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new $o({reason:"Only EIP-155 supported"});if(!i)throw new $o({reason:"Chain ID not found"});if(!a)throw new $o({reason:"Contract address not found"});if(!o)throw new $o({reason:"Token ID not found"});if(!c)throw new $o({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function wv(e,{nft:t}){if(t.namespace==="erc721")return Ct(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return Ct(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new dv({namespace:t.namespace})}async function xv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Ev(e,{gatewayUrls:t,record:n}):Oa({uri:n,gatewayUrls:t})}async function Ev(e,{gatewayUrls:t,record:n}){const r=vv(n),o=await wv(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=ad({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=c?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return Oa({uri:cd(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),yv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function ld(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(f=>s.endsWith(f)))return null;try{const f={address:l,abi:Wf,args:[pn(Na(s)),Tt({abi:Hf,functionName:"text",args:[$a(s),o]}),i??[Ao]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},d=await X(e,Ct,"readContract")(f);if(d[0]==="0x")return null;const h=Rn({abi:Hf,functionName:"text",data:d[0]});return h===""?null:h}catch(f){if(c)throw f;if(Pa(f))return null;throw f}}async function Sv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await X(e,ld,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await xv(e,{record:a,gatewayUrls:r})}catch{return null}}async function Pv(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:c}=t,{chain:a}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:_y,args:[n,s,i??[Ao]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=X(e,Ct,"readContract"),[p]=await f(u);return p||null}catch(u){if(c)throw u;if(Pa(u))return null;throw u}}async function Tv(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return vr({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),c=s==null?void 0:s.ensTlds;if(c&&!c.some(l=>o.endsWith(l)))throw new Error(`${o} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[a]=await X(e,Ct,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[pn(Na(o))],blockNumber:n,blockTag:r});return a}async function ud(e,t){var v,T,E;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:p,value:d,...h}=t,m=n?Je(n):void 0;try{mr(t);const C=(typeof r=="bigint"?Q(r):void 0)||o,M=(E=(T=(v=e.chain)==null?void 0:v.formatters)==null?void 0:T.transactionRequest)==null?void 0:E.format,F=(M||bo)({...us(h,{format:M}),account:m,blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:p,value:d},"createAccessList"),b=await e.request({method:"eth_createAccessList",params:[F,C]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(S){throw Yf(S,{...t,account:m,chain:e.chain})}}async function Av(e){const t=ss(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function fd(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),l=ss(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(d=>Wr({abi:[d],eventName:d.name,args:n}))],r&&(u=u[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?Q(s):s,toBlock:typeof c=="bigint"?Q(c):c,...u.length?{topics:u}:{}}]});return{abi:a,args:n,eventName:r?r.name:void 0,fromBlock:s,id:f,request:l(f),strict:!!i,toBlock:c,type:"event"}}async function dd(e){const t=ss(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function $v(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o=typeof n=="bigint"?Q(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Nv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Cv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?Q(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),Zt(s)}async function Ia(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?Q(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}class Ov extends V{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Iv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,l,u,f]=await X(e,Ct,"readContract")({abi:kv,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:c,chainId:Number(a),verifyingContract:l,salt:u},extensions:f,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Ov({address:n}):i}}const kv=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function Dv(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function Mv(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?Q(n):void 0,i=await e.request({method:"eth_feeHistory",params:[Q(t),s||r,o]},{dedupe:!!s});return Dv(i)}async function Lv(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Xt(s));return t.abi?oa({abi:t.abi,logs:o,strict:n}):o}async function Bv({address:e,authorization:t,signature:n}){return go(mn(e),await Qu({authorization:t,signature:n}))}const Ss=new rs(8192);function Fv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ss.get(n))return Ss.get(n);const r=e().finally(()=>Ss.delete(n));return Ss.set(n,r),r}function Rv(e,t={}){return async(n,r={})=>{var f;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:c=3,uid:a}={...t,...r},{method:l}=n;if((f=s==null?void 0:s.exclude)!=null&&f.includes(l))throw new Fn(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new Fn(new Error("method not supported"),{method:l});const u=o?jr(`${a}.${$e(n)}`):void 0;return Fv(()=>Ea(async()=>{try{return await e(n)}catch(p){const d=p;switch(d.code){case Zr.code:throw new Zr(d);case Kr.code:throw new Kr(d);case Yr.code:throw new Yr(d,{method:n.method});case Xr.code:throw new Xr(d);case Bn.code:throw new Bn(d);case gn.code:throw new gn(d);case Qr.code:throw new Qr(d);case Jr.code:throw new Jr(d);case eo.code:throw new eo(d);case Fn.code:throw new Fn(d,{method:n.method});case fr.code:throw new fr(d);case to.code:throw new to(d);case dr.code:throw new dr(d);case no.code:throw new no(d);case ro.code:throw new ro(d);case oo.code:throw new oo(d);case so.code:throw new so(d);case io.code:throw new io(d);case ao.code:throw new ao(d);case co.code:throw new co(d);case lo.code:throw new lo(d);case uo.code:throw new uo(d);case fo.code:throw new fo(d);case po.code:throw new po(d);case ho.code:throw new ho(d);case 5e3:throw new dr(d);default:throw p instanceof V?p:new Tg(d)}}},{delay:({count:p,error:d})=>{var h;if(d&&d instanceof Ln){const m=(h=d==null?void 0:d.headers)==null?void 0:h.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<p)*i},retryCount:c,shouldRetry:({error:p})=>jv(p)}),{enabled:o,id:u})}}function jv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===fr.code||e.code===Bn.code:e instanceof Ln&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class _v extends V{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var c;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(c=n.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(a=>` ${qr(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class zv extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${qr(n)}`,`Response: ${$e(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Uv extends V{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const Wv="0x556f1830",pd={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Hv(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=_u({data:r,abi:[pd]}),[i,c,a,l,u]=s,{ccipRead:f}=e,p=f&&typeof(f==null?void 0:f.request)=="function"?f.request:hd;try{if(!go(o,i))throw new Uv({sender:i,to:o});const d=c.includes(Ao)?await od({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:c}),{data:h}=await So(e,{blockNumber:t,blockTag:n,data:Pt([l,bn([{type:"bytes"},{type:"bytes"}],[d,u])]),to:o});return h}catch(d){throw new _v({callbackSelector:l,cause:d,data:r,extraData:u,sender:i,urls:c})}}async function hd({data:e,sender:t,urls:n}){var o;let r=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],c=i.includes("{data}")?"GET":"POST",a=c==="POST"?{data:e,sender:t}:void 0,l=c==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:l,method:c});let f;if((o=u.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?f=(await u.json()).data:f=await u.text(),!u.ok){r=new Ln({body:a,details:f!=null&&f.error?$e(f.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Et(f)){r=new zv({result:f,url:i});continue}return f}catch(u){r=new Ln({body:a,details:u.message,url:i})}}throw r}const Vv=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:hd,offchainLookup:Hv,offchainLookupAbiItem:pd,offchainLookupSignature:Wv},Symbol.toStringTag,{value:"Module"}));function Gv(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function qv(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const c=new AbortController;n>0&&(i=setTimeout(()=>{r&&c.abort()},n)),o(await e({signal:(c==null?void 0:c.signal)||null}))}catch(c){(c==null?void 0:c.name)==="AbortError"&&s(t),s(c)}finally{clearTimeout(i)}})()})}function Zv(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const md=Zv();function Kv(e,t={}){return{async request(n){var p;const{body:r,fetchFn:o=t.fetchFn??fetch,onRequest:s=t.onRequest,onResponse:i=t.onResponse,timeout:c=t.timeout??1e4}=n,a={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:l,method:u,signal:f}=a;try{const d=await qv(async({signal:m})=>{const v={...a,body:Array.isArray(r)?$e(r.map(C=>({jsonrpc:"2.0",id:C.id??md.take(),...C}))):$e({jsonrpc:"2.0",id:r.id??md.take(),...r}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:f||(c>0?m:null)},T=new Request(e,v),E=await(s==null?void 0:s(T,v))??{...v,url:e};return await o(E.url??e,E)},{errorInstance:new qu({body:r,url:e}),timeout:c,signal:!0});i&&await i(d);let h;if((p=d.headers.get("Content-Type"))!=null&&p.startsWith("application/json"))h=await d.json();else{h=await d.text();try{h=JSON.parse(h||"{}")}catch(m){if(d.ok)throw m;h={error:h}}}if(!d.ok)throw new Ln({body:r,details:$e(h.error)||d.statusText,headers:d.headers,status:d.status,url:e});return h}catch(d){throw d instanceof Ln||d instanceof qu?d:new Ln({body:r,cause:d,url:e})}}}}const Yv=`Ethereum Signed Message:
|
|
89
|
+
`;function Xv(e){const t=typeof e=="string"?jr(e):typeof e.raw=="string"?e.raw:Ae(e.raw),n=jr(`${Yv}${ve(t)}`);return Pt([n,t])}function bd(e,t){return ke(Xv(e),t)}class Qv extends V{constructor({domain:t}){super(`Invalid domain "${$e(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Jv extends V{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class ew extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function tw(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,c)=>{for(const a of i){const{name:l,type:u}=a,f=c[l],p=u.match(Ou);if(p&&(typeof f=="number"||typeof f=="bigint")){const[m,v,T]=p;Q(f,{signed:v==="int",size:Number.parseInt(T,10)/8})}if(u==="address"&&typeof f=="string"&&!at(f))throw new hn({address:f});const d=u.match(U1);if(d){const[m,v]=d;if(v&&ve(f)!==Number.parseInt(v,10))throw new Yb({expectedSize:Number.parseInt(v,10),givenSize:ve(f)})}const h=o[u];h&&(rw(u),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new Qv({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new Jv({primaryType:r,types:o})}function nw({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function rw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new ew({type:e})}function ow(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:nw({domain:t}),...e.types};tw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(sw({domain:t,types:o})),r!=="EIP712Domain"&&s.push(gd({data:n,primaryType:r,types:o})),ke(Pt(s))}function sw({domain:e,types:t}){return gd({data:e,primaryType:"EIP712Domain",types:t})}function gd({data:e,primaryType:t,types:n}){const r=yd({data:e,primaryType:t,types:n});return ke(r)}function yd({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[iw({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=wd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return bn(r,o)}function iw({primaryType:e,types:t}){const n=pn(aw({primaryType:e,types:t}));return ke(n)}function aw({primaryType:e,types:t}){let n="";const r=vd({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:c})=>`${c} ${i}`).join(",")})`;return n}function vd({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])vd({primaryType:s.type,types:t},n);return n}function wd({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},ke(yd({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},ke(r)];if(n==="string")return[{type:"bytes32"},ke(pn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>wd({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},ke(bn(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class cw extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const ka={checksum:new cw(8192)}.checksum;function xd(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Tu(wy(e));return n==="Bytes"?r:Nt(r)}const lw=/^0x[a-fA-F0-9]{40}$/;function Ps(e,t={}){const{strict:n=!0}=t;if(!lw.test(e))throw new Sd({address:e,cause:new uw});if(n){if(e.toLowerCase()===e)return;if(Ed(e)!==e)throw new Sd({address:e,cause:new fw})}}function Ed(e){if(ka.has(e))return ka.get(e);Ps(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=xd(Ey(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return ka.set(e,o),o}function Da(e,t={}){const{strict:n=!0}=t??{};try{return Ps(e,{strict:n}),!0}catch{return!1}}class Sd extends ie{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class uw extends ie{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class fw extends ie{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const dw=/^(.*)\[([0-9]*)\]$/,pw=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Pd=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Td=2n**256n-1n;function wr(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=Fa(t.type);if(s){const[i,c]=s;return mw(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return vw(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return hw(e,{checksum:r});if(t.type==="bool")return bw(e);if(t.type.startsWith("bytes"))return gw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return yw(e,t);if(t.type==="string")return ww(e,{staticPosition:o});throw new _a(t.type)}const Ad=32,Ma=32;function hw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Ed(s):s)(Nt(Py(r,-20))),32]}function mw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=en(e.readBytes(Ma)),l=s+a,u=l+Ad;e.setPosition(l);const f=en(e.readBytes(Ad)),p=No(t);let d=0;const h=[];for(let m=0;m<f;++m){e.setPosition(u+(p?m*32:d));const[v,T]=wr(e,t,{checksumAddress:r,staticPosition:u});d+=T,h.push(v)}return e.setPosition(s+32),[h,32]}if(No(t)){const a=en(e.readBytes(Ma)),l=s+a,u=[];for(let f=0;f<o;++f){e.setPosition(l+f*32);const[p]=wr(e,t,{checksumAddress:r,staticPosition:l});u.push(p)}return e.setPosition(s+32),[u,32]}let i=0;const c=[];for(let a=0;a<o;++a){const[l,u]=wr(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,c.push(l)}return[c,i]}function bw(e){return[Ay(e.readBytes(32),{size:32}),32]}function gw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=en(e.readBytes(32));e.setPosition(n+i);const c=en(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Nt(a),32]}return[Nt(e.readBytes(Number.parseInt(o,10),32)),32]}function yw(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?Ty(o,{signed:n}):en(o,{signed:n}),32]}function vw(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:a})=>!a),i=s?[]:{};let c=0;if(No(t)){const a=en(e.readBytes(Ma)),l=o+a;for(let u=0;u<t.components.length;++u){const f=t.components[u];e.setPosition(l+c);const[p,d]=wr(e,f,{checksumAddress:r,staticPosition:l});c+=d,i[s?u:f==null?void 0:f.name]=p}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const l=t.components[a],[u,f]=wr(e,l,{checksumAddress:r,staticPosition:o});i[s?a:l==null?void 0:l.name]=u,c+=f}return[i,c]}function ww(e,{staticPosition:t}){const n=en(e.readBytes(32)),r=t+n;e.setPosition(r);const o=en(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=$y(Df(s));return e.setPosition(t+32),[i,32]}function xw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(La({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function La({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=Fa(r.type);if(o){const[s,i]=o;return Sw(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Nw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Ew(n,{checksum:e});if(r.type==="bool")return Tw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Pd.exec(r.type)??[];return Aw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Pw(n,{type:r.type});if(r.type==="string")return $w(n);throw new _a(r.type)}function Ba(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=tt(c)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?(n.push(Le(t+o,{size:32})),r.push(c),o+=tt(c)):n.push(c)}return $t(...n,...r)}function Ew(e,t){const{checksum:n=!1}=t;return Ps(e,{strict:n}),{dynamic:!1,encoded:_n(e.toLowerCase())}}function Sw(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new Fw(e);if(!s&&e.length!==r)throw new Bw({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const l=La({checksumAddress:n,parameter:o,value:e[a]});l.dynamic&&(i=!0),c.push(l)}if(s||i){const a=Ba(c);if(s){const l=Le(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?$t(l,a):l}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:$t(...c.map(({encoded:a})=>a))}}function Pw(e,{type:t}){const[,n]=t.split("bytes"),r=tt(e);if(!n){let o=e;return r%32!==0&&(o=zn(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:$t(_n(Le(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new Cd({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:zn(e)}}function Tw(e){if(typeof e!="boolean")throw new ie(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:_n(Mf(e))}}function Aw(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Ff({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Le(e,{size:32,signed:t})}}function $w(e){const t=pa(e),n=Math.ceil(tt(t)/32),r=[];for(let o=0;o<n;o++)r.push(zn(Bt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:$t(zn(Le(tt(t),{size:32})),...r)}}function Nw(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const c=r.components[i],a=Array.isArray(e)?i:c.name,l=La({checksumAddress:n,parameter:c,value:e[a]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ba(s):$t(...s.map(({encoded:i})=>i))}}function Fa(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function No(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(No);const n=Fa(e.type);return!!(n&&No({...e,type:n[1]}))}const Cw={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new kw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Iw({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new $d({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new $d({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Ow(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Cw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class $d extends ie{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Iw extends ie{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class kw extends ie{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Dw(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?kf(t):t,i=Ow(s);if(gr(s)===0&&e.length>0)throw new Lw;if(gr(s)&&gr(s)<32)throw new Mw({data:typeof t=="string"?t:Nt(t),parameters:e,size:gr(s)});let c=0;const a=r==="Array"?[]:{};for(let l=0;l<e.length;++l){const u=e[l];i.setPosition(c);const[f,p]=wr(i,u,{checksumAddress:o,staticPosition:0});c+=p,r==="Array"?a.push(f):a[u.name??l]=f}return a}function Ra(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Od({expectedLength:e.length,givenLength:t.length});const o=xw({checksumAddress:r,parameters:e,values:t}),s=Ba(o);return s.length===0?"0x":s}function ja(e,t){if(e.length!==t.length)throw new Od({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push(ja.encode(o,s))}return $t(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return Ps(a),_n(a.toLowerCase(),o?32:0)}if(n==="string")return pa(r);if(n==="bytes")return r;if(n==="bool")return _n(Mf(r),o?32:1);const s=n.match(Pd);if(s){const[a,l,u="256"]=s,f=Number.parseInt(u,10)/8;return Le(r,{size:o?32:f,signed:l==="int"})}const i=n.match(pw);if(i){const[a,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new Cd({expectedSize:Number.parseInt(l,10),value:r});return zn(r,o?32:0)}const c=n.match(dw);if(c&&Array.isArray(r)){const[a,l]=c,u=[];for(let f=0;f<r.length;f++)u.push(t(l,r[f],!0));return u.length===0?"0x":$t(...u)}throw new _a(n)}e.encode=t})(ja||(ja={}));function Nd(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Jl(e):e}class Mw extends ie{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${er(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Lw extends ie{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Bw extends ie{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class Cd extends ie{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${tt(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Od extends ie{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
90
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class Fw extends ie{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class _a extends ie{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}class Id extends $i{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,y1(t);const r=ts(n);if(this.iHash=t.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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),ar(s)}update(t){return ir(this),this.iHash.update(t),this}digestInto(t){ir(this),Dn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:i,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const kd=(e,t,n)=>new Id(e,t).update(n).digest();kd.create=(e,t)=>new Id(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const He=BigInt(0),Be=BigInt(1),Un=BigInt(2),Rw=BigInt(3),Dd=BigInt(4),Md=BigInt(5),Ld=BigInt(8);function Ve(e,t){const n=e%t;return n>=He?n:t+n}function lt(e,t,n){let r=e;for(;t-- >He;)r*=r,r%=n;return r}function za(e,t){if(e===He)throw new Error("invert: expected non-zero number");if(t<=He)throw new Error("invert: expected positive modulus, got "+t);let n=Ve(e,t),r=t,o=He,s=Be;for(;n!==He;){const c=r/n,a=r%n,l=o-s*c;r=n,n=a,o=s,s=l}if(r!==Be)throw new Error("invert: does not exist");return Ve(o,t)}function Bd(e,t){const n=(e.ORDER+Be)/Dd,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function jw(e,t){const n=(e.ORDER-Md)/Ld,r=e.mul(t,Un),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Un),o),c=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function _w(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Be,n=0;for(;t%Un===He;)t/=Un,n++;let r=Un;const o=Ua(e);for(;Rd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Bd;let s=o.pow(r,t);const i=(t+Be)/Un;return function(a,l){if(a.is0(l))return l;if(Rd(a,l)!==1)throw new Error("Cannot find square root");let u=n,f=a.mul(a.ONE,s),p=a.pow(l,t),d=a.pow(l,i);for(;!a.eql(p,a.ONE);){if(a.is0(p))return a.ZERO;let h=1,m=a.sqr(p);for(;!a.eql(m,a.ONE);)if(h++,m=a.sqr(m),h===u)throw new Error("Cannot find square root");const v=Be<<BigInt(u-h-1),T=a.pow(f,v);u=h,f=a.sqr(T),p=a.mul(p,f),d=a.mul(d,T)}return d}}function zw(e){return e%Dd===Rw?Bd:e%Ld===Md?jw:_w(e)}const Uw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ww(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Uw.reduce((r,o)=>(r[o]="function",r),t);return bs(e,n)}function Hw(e,t,n){if(n<He)throw new Error("invalid exponent, negatives unsupported");if(n===He)return e.ONE;if(n===Be)return t;let r=e.ONE,o=t;for(;n>He;)n&Be&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Be;return r}function Fd(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,c,a)=>e.is0(c)?i:(r[a]=i,e.mul(i,c)),e.ONE),s=e.inv(o);return t.reduceRight((i,c,a)=>e.is0(c)?i:(r[a]=e.mul(i,r[a]),e.mul(i,c)),s),r}function Rd(e,t){const n=(e.ORDER-Be)/Un,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function jd(e,t){t!==void 0&&_r(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Ua(e,t,n=!1,r={}){if(e<=He)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=jd(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const c=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:ms(o),ZERO:He,ONE:Be,create:a=>Ve(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return He<=a&&a<e},is0:a=>a===He,isOdd:a=>(a&Be)===Be,neg:a=>Ve(-a,e),eql:(a,l)=>a===l,sqr:a=>Ve(a*a,e),add:(a,l)=>Ve(a+l,e),sub:(a,l)=>Ve(a-l,e),mul:(a,l)=>Ve(a*l,e),pow:(a,l)=>Hw(c,a,l),div:(a,l)=>Ve(a*za(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>za(a,e),sqrt:r.sqrt||(a=>(i||(i=zw(e)),i(c,a))),toBytes:a=>n?Pf(a,s):xo(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Sf(a):jn(a)},invertBatch:a=>Fd(c,a),cmov:(a,l,u)=>u?l:a});return Object.freeze(c)}function _d(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function zd(e){const t=_d(e);return t+Math.ceil(t/2)}function Vw(e,t,n=!1){const r=e.length,o=_d(t),s=zd(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Sf(e):jn(e),c=Ve(i,t-Be)+Be;return n?Pf(c,o):xo(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ud=BigInt(0),Wa=BigInt(1);function Ha(e,t){const n=t.negate();return e?n:t}function Wd(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Va(e,t){Wd(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=ms(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function Hd(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let c=Number(e&o),a=e>>i;c>r&&(c-=s,a+=Wa);const l=t*r,u=l+Math.abs(c)-1,f=c===0,p=c<0,d=t%2!==0;return{nextN:a,offset:u,isZero:f,isNeg:p,isNegF:d,offsetF:l}}function Gw(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function qw(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const Ga=new WeakMap,Vd=new WeakMap;function qa(e){return Vd.get(e)||1}function Zw(e,t){return{constTimeNegate:Ha,hasPrecomputes(n){return qa(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Ud;)r&Wa&&(o=o.add(s)),s=s.double(),r>>=Wa;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=Va(r,t),i=[];let c=n,a=c;for(let l=0;l<o;l++){a=c,i.push(a);for(let u=1;u<s;u++)a=a.add(c),i.push(a);c=a.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const c=Va(n,t);for(let a=0;a<c.windows;a++){const{nextN:l,offset:u,isZero:f,isNeg:p,isNegF:d,offsetF:h}=Hd(o,a,c);o=l,f?i=i.add(Ha(d,r[h])):s=s.add(Ha(p,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=Va(n,t);for(let c=0;c<i.windows&&o!==Ud;c++){const{nextN:a,offset:l,isZero:u,isNeg:f}=Hd(o,c,i);if(o=a,!u){const p=r[l];s=s.add(f?p.negate():p)}}return s},getPrecomputes(n,r,o){let s=Ga.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&Ga.set(r,o(s))),s},wNAFCached(n,r,o){const s=qa(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=qa(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){Wd(r,t),Vd.set(n,r),Ga.delete(n)}}}function Kw(e,t,n,r){Gw(n,e),qw(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,c=ly(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const l=ms(a),u=new Array(Number(l)+1).fill(i),f=Math.floor((t.BITS-1)/a)*a;let p=i;for(let d=f;d>=0;d-=a){u.fill(i);for(let m=0;m<s;m++){const v=r[m],T=Number(v>>BigInt(d)&l);u[T]=u[T].add(n[m])}let h=i;for(let m=u.length-1,v=i;m>0;m--)v=v.add(u[m]),h=h.add(v);if(p=p.add(h),d!==0)for(let m=0;m<a;m++)p=p.double()}return p}function Gd(e){return Ww(e.Fp),bs(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...jd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function qd(e){e.lowS!==void 0&&vo("lowS",e.lowS),e.prehash!==void 0&&vo("prehash",e.prehash)}function Yw(e){const t=Gd(e);bs(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class Xw extends Error{constructor(t=""){super(t)}}const tn={Err:Xw,_tlv:{encode:(e,t)=>{const{Err:n}=tn;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=ds(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?ds(o.length/2|128):"";return ds(e)+s+o+t},decode(e,t){const{Err:n}=tn;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const a=o&127;if(!a)throw new n("tlv.decode(long): indefinite length not supported");if(a>4)throw new n("tlv.decode(long): byte length is too big");const l=t.subarray(r,r+a);if(l.length!==a)throw new n("tlv.decode: length bytes not complete");if(l[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of l)i=i<<8|u;if(r+=a,i<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(r,r+i);if(c.length!==i)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=tn;if(e<nn)throw new t("integer: negative integers are not allowed");let n=ds(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=tn;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return jn(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=tn,o=ct("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l:a}=r.decode(2,s),{v:l,l:u}=r.decode(2,a);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=tn,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function Za(e,t){return wo(xo(e,t))}const nn=BigInt(0),Ce=BigInt(1);BigInt(2);const Ka=BigInt(3),Qw=BigInt(4);function Jw(e){const t=Yw(e),{Fp:n}=t,r=Ua(t.n,t.nBitLength),o=t.toBytes||((S,C,M)=>{const B=C.toAffine();return hs(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(S=>{const C=S.subarray(1),M=n.fromBytes(C.subarray(0,n.BYTES)),B=n.fromBytes(C.subarray(n.BYTES,2*n.BYTES));return{x:M,y:B}});function i(S){const{a:C,b:M}=t,B=n.sqr(S),F=n.mul(B,S);return n.add(n.add(F,n.mul(S,C)),M)}function c(S,C){const M=n.sqr(C),B=i(S);return n.eql(M,B)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,Ka),Qw),l=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(a,l)))throw new Error("bad curve params: a or b");function u(S){return fa(S,Ce,t.n)}function f(S){const{allowedPrivateKeyLengths:C,nByteLength:M,wrapPrivateKey:B,n:F}=t;if(C&&typeof S!="bigint"){if(yo(S)&&(S=wo(S)),typeof S!="string"||!C.includes(S.length))throw new Error("invalid private key");S=S.padStart(M*2,"0")}let b;try{b=typeof S=="bigint"?S:jn(ct("private key",S,M))}catch{throw new Error("invalid private key, expected hex or "+M+" bytes, got "+typeof S)}return B&&(b=Ve(b,F)),br("private key",b,Ce,F),b}function p(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const d=Af((S,C)=>{const{px:M,py:B,pz:F}=S;if(n.eql(F,n.ONE))return{x:M,y:B};const b=S.is0();C==null&&(C=b?n.ONE:n.inv(F));const g=n.mul(M,C),w=n.mul(B,C),O=n.mul(F,C);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql(O,n.ONE))throw new Error("invZ was invalid");return{x:g,y:w}}),h=Af(S=>{if(S.is0()){if(t.allowInfinityPoint&&!n.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:C,y:M}=S.toAffine();if(!n.isValid(C)||!n.isValid(M))throw new Error("bad point: x or y not FE");if(!c(C,M))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(C,M,B){if(C==null||!n.isValid(C))throw new Error("x required");if(M==null||!n.isValid(M)||n.is0(M))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required");this.px=C,this.py=M,this.pz=B,Object.freeze(this)}static fromAffine(C){const{x:M,y:B}=C||{};if(!C||!n.isValid(M)||!n.isValid(B))throw new Error("invalid affine point");if(C instanceof m)throw new Error("projective point not allowed");const F=b=>n.eql(b,n.ZERO);return F(M)&&F(B)?m.ZERO:new m(M,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const M=Fd(n,C.map(B=>B.pz));return C.map((B,F)=>B.toAffine(M[F])).map(m.fromAffine)}static fromHex(C){const M=m.fromAffine(s(ct("pointHex",C)));return M.assertValidity(),M}static fromPrivateKey(C){return m.BASE.multiply(f(C))}static msm(C,M){return Kw(m,r,C,M)}_setWindowSize(C){E.setWindowSize(this,C)}assertValidity(){h(this)}hasEvenY(){const{y:C}=this.toAffine();if(n.isOdd)return!n.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){p(C);const{px:M,py:B,pz:F}=this,{px:b,py:g,pz:w}=C,O=n.eql(n.mul(M,w),n.mul(b,F)),N=n.eql(n.mul(B,w),n.mul(g,F));return O&&N}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:C,b:M}=t,B=n.mul(M,Ka),{px:F,py:b,pz:g}=this;let w=n.ZERO,O=n.ZERO,N=n.ZERO,I=n.mul(F,F),k=n.mul(b,b),y=n.mul(g,g),$=n.mul(F,b);return $=n.add($,$),N=n.mul(F,g),N=n.add(N,N),w=n.mul(C,N),O=n.mul(B,y),O=n.add(w,O),w=n.sub(k,O),O=n.add(k,O),O=n.mul(w,O),w=n.mul($,w),N=n.mul(B,N),y=n.mul(C,y),$=n.sub(I,y),$=n.mul(C,$),$=n.add($,N),N=n.add(I,I),I=n.add(N,I),I=n.add(I,y),I=n.mul(I,$),O=n.add(O,I),y=n.mul(b,g),y=n.add(y,y),I=n.mul(y,$),w=n.sub(w,I),N=n.mul(y,k),N=n.add(N,N),N=n.add(N,N),new m(w,O,N)}add(C){p(C);const{px:M,py:B,pz:F}=this,{px:b,py:g,pz:w}=C;let O=n.ZERO,N=n.ZERO,I=n.ZERO;const k=t.a,y=n.mul(t.b,Ka);let $=n.mul(M,b),A=n.mul(B,g),P=n.mul(F,w),L=n.add(M,B),j=n.add(b,g);L=n.mul(L,j),j=n.add($,A),L=n.sub(L,j),j=n.add(M,F);let U=n.add(b,w);return j=n.mul(j,U),U=n.add($,P),j=n.sub(j,U),U=n.add(B,F),O=n.add(g,w),U=n.mul(U,O),O=n.add(A,P),U=n.sub(U,O),I=n.mul(k,j),O=n.mul(y,P),I=n.add(O,I),O=n.sub(A,I),I=n.add(A,I),N=n.mul(O,I),A=n.add($,$),A=n.add(A,$),P=n.mul(k,P),j=n.mul(y,j),A=n.add(A,P),P=n.sub($,P),P=n.mul(k,P),j=n.add(j,P),$=n.mul(A,j),N=n.add(N,$),$=n.mul(U,j),O=n.mul(L,O),O=n.sub(O,$),$=n.mul(L,A),I=n.mul(U,I),I=n.add(I,$),new m(O,N,I)}subtract(C){return this.add(C.negate())}is0(){return this.equals(m.ZERO)}wNAF(C){return E.wNAFCached(this,C,m.normalizeZ)}multiplyUnsafe(C){const{endo:M,n:B}=t;br("scalar",C,nn,B);const F=m.ZERO;if(C===nn)return F;if(this.is0()||C===Ce)return this;if(!M||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,C,m.normalizeZ);let{k1neg:b,k1:g,k2neg:w,k2:O}=M.splitScalar(C),N=F,I=F,k=this;for(;g>nn||O>nn;)g&Ce&&(N=N.add(k)),O&Ce&&(I=I.add(k)),k=k.double(),g>>=Ce,O>>=Ce;return b&&(N=N.negate()),w&&(I=I.negate()),I=new m(n.mul(I.px,M.beta),I.py,I.pz),N.add(I)}multiply(C){const{endo:M,n:B}=t;br("scalar",C,Ce,B);let F,b;if(M){const{k1neg:g,k1:w,k2neg:O,k2:N}=M.splitScalar(C);let{p:I,f:k}=this.wNAF(w),{p:y,f:$}=this.wNAF(N);I=E.constTimeNegate(g,I),y=E.constTimeNegate(O,y),y=new m(n.mul(y.px,M.beta),y.py,y.pz),F=I.add(y),b=k.add($)}else{const{p:g,f:w}=this.wNAF(C);F=g,b=w}return m.normalizeZ([F,b])[0]}multiplyAndAddUnsafe(C,M,B){const F=m.BASE,b=(w,O)=>O===nn||O===Ce||!w.equals(F)?w.multiplyUnsafe(O):w.multiply(O),g=b(this,M).add(b(C,B));return g.is0()?void 0:g}toAffine(C){return d(this,C)}isTorsionFree(){const{h:C,isTorsionFree:M}=t;if(C===Ce)return!0;if(M)return M(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:M}=t;return C===Ce?this:M?M(m,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return vo("isCompressed",C),this.assertValidity(),o(m,this,C)}toHex(C=!0){return vo("isCompressed",C),wo(this.toRawBytes(C))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:v,nBitLength:T}=t,E=Zw(m,v?Math.ceil(T/2):T);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:u}}function e6(e){const t=Gd(e);return bs(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function t6(e){const t=e6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(y){return Ve(y,r)}function l(y){return za(y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:p,isWithinCurveOrder:d}=Jw({...t,toBytes(y,$,A){const P=$.toAffine(),L=n.toBytes(P.x),j=hs;return vo("isCompressed",A),A?j(Uint8Array.from([$.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(P.y))},fromBytes(y){const $=y.length,A=y[0],P=y.subarray(1);if($===i&&(A===2||A===3)){const L=jn(P);if(!fa(L,Ce,n.ORDER))throw new Error("Point is not on curve");const j=p(L);let U;try{U=n.sqrt(j)}catch(Y){const G=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+G)}const _=(U&Ce)===Ce;return(A&1)===1!==_&&(U=n.neg(U)),{x:L,y:U}}else if($===c&&A===4){const L=n.fromBytes(P.subarray(0,n.BYTES)),j=n.fromBytes(P.subarray(n.BYTES,2*n.BYTES));return{x:L,y:j}}else{const L=i,j=c;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+j+", got "+$)}}});function h(y){const $=r>>Ce;return y>$}function m(y){return h(y)?a(-y):y}const v=(y,$,A)=>jn(y.slice($,A));class T{constructor($,A,P){br("r",$,Ce,r),br("s",A,Ce,r),this.r=$,this.s=A,P!=null&&(this.recovery=P),Object.freeze(this)}static fromCompact($){const A=o;return $=ct("compactSignature",$,A*2),new T(v($,0,A),v($,A,2*A))}static fromDER($){const{r:A,s:P}=tn.toSig(ct("DER",$));return new T(A,P)}assertValidity(){}addRecoveryBit($){return new T(this.r,this.s,$)}recoverPublicKey($){const{r:A,s:P,recovery:L}=this,j=F(ct("msgHash",$));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const U=L===2||L===3?A+t.n:A;if(U>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=L&1?"03":"02",H=u.fromHex(_+Za(U,n.BYTES)),Y=l(U),G=a(-j*Y),W=a(P*Y),Z=u.BASE.multiplyAndAddUnsafe(H,G,W);if(!Z)throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ps(this.toDERHex())}toDERHex(){return tn.hexFromSig(this)}toCompactRawBytes(){return ps(this.toCompactHex())}toCompactHex(){const $=o;return Za(this.r,$)+Za(this.s,$)}}const E={isValidPrivateKey(y){try{return f(y),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const y=zd(t.n);return Vw(t.randomBytes(y),t.n)},precompute(y=8,$=u.BASE){return $._setWindowSize(y),$.multiply(BigInt(3)),$}};function S(y,$=!0){return u.fromPrivateKey(y).toRawBytes($)}function C(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const A=ct("key",y).length,P=n.BYTES,L=P+1,j=2*P+1;if(!(t.allowedPrivateKeyLengths||o===L))return A===L||A===j}function M(y,$,A=!0){if(C(y)===!0)throw new Error("first arg must be private key");if(C($)===!1)throw new Error("second arg must be public key");return u.fromHex($).multiply(f(y)).toRawBytes(A)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const $=jn(y),A=y.length*8-s;return A>0?$>>BigInt(A):$},F=t.bits2int_modN||function(y){return a(B(y))},b=ms(s);function g(y){return br("num < 2^"+s,y,nn,b),xo(y,o)}function w(y,$,A=O){if(["recovered","canonical"].some(oe=>oe in A))throw new Error("sign() legacy options not supported");const{hash:P,randomBytes:L}=t;let{lowS:j,prehash:U,extraEntropy:_}=A;j==null&&(j=!0),y=ct("msgHash",y),qd(A),U&&(y=ct("prehashed msgHash",P(y)));const H=F(y),Y=f($),G=[g(Y),g(H)];if(_!=null&&_!==!1){const oe=_===!0?L(n.BYTES):_;G.push(ct("extraEntropy",oe))}const W=hs(...G),Z=H;function J(oe){const me=B(oe);if(!d(me))return;const ge=l(me),de=u.BASE.multiply(me).toAffine(),se=a(de.x);if(se===nn)return;const pe=a(ge*a(Z+se*Y));if(pe===nn)return;let ee=(de.x===se?0:2)|Number(de.y&Ce),Se=pe;return j&&h(pe)&&(Se=m(pe),ee^=1),new T(se,Se,ee)}return{seed:W,k2sig:J}}const O={lowS:t.lowS,prehash:!1},N={lowS:t.lowS,prehash:!1};function I(y,$,A=O){const{seed:P,k2sig:L}=w(y,$,A),j=t;return uy(j.hash.outputLen,j.nByteLength,j.hmac)(P,L)}u.BASE._setWindowSize(8);function k(y,$,A,P=N){var ee;const L=y;$=ct("msgHash",$),A=ct("publicKey",A);const{lowS:j,prehash:U,format:_}=P;if(qd(P),"strict"in P)throw new Error("options.strict was renamed to lowS");if(_!==void 0&&_!=="compact"&&_!=="der")throw new Error("format must be compact or der");const H=typeof L=="string"||yo(L),Y=!H&&!_&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!H&&!Y)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let G,W;try{if(Y&&(G=new T(L.r,L.s)),H){try{_!=="compact"&&(G=T.fromDER(L))}catch(Se){if(!(Se instanceof tn.Err))throw Se}!G&&_!=="der"&&(G=T.fromCompact(L))}W=u.fromHex(A)}catch{return!1}if(!G||j&&G.hasHighS())return!1;U&&($=t.hash($));const{r:Z,s:J}=G,oe=F($),me=l(J),ge=a(oe*me),de=a(Z*me),se=(ee=u.BASE.multiplyAndAddUnsafe(W,ge,de))==null?void 0:ee.toAffine();return se?a(se.x)===Z:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:M,sign:I,verify:k,ProjectivePoint:u,Signature:T,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function n6(e){return{hash:e,hmac:(t,...n)=>kd(e,t,P1(...n)),randomBytes:T1}}function r6(e,t){const n=r=>t6({...e,...n6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Zd=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Kd=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),o6=BigInt(0),s6=BigInt(1),Ya=BigInt(2),Yd=(e,t)=>(e+t/Ya)/t;function i6(e){const t=Zd,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),c=BigInt(44),a=BigInt(88),l=e*e*e%t,u=l*l*e%t,f=lt(u,n,t)*u%t,p=lt(f,n,t)*u%t,d=lt(p,Ya,t)*l%t,h=lt(d,o,t)*d%t,m=lt(h,s,t)*h%t,v=lt(m,c,t)*m%t,T=lt(v,a,t)*v%t,E=lt(T,c,t)*m%t,S=lt(E,n,t)*u%t,C=lt(S,i,t)*h%t,M=lt(C,r,t)*l%t,B=lt(M,Ya,t);if(!Xa.eql(Xa.sqr(B),e))throw new Error("Cannot find square root");return B}const Xa=Ua(Zd,void 0,void 0,{sqrt:i6}),Xd=r6({a:o6,b:BigInt(7),Fp:Xa,n:Kd,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Kd,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-s6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=Yd(s*e,t),a=Yd(-r*e,t);let l=Ve(e-c*n-a*o,t),u=Ve(-c*r-a*s,t);const f=l>i,p=u>i;if(f&&(l=t-l),p&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:l,k2neg:p,k2:u}}}},uf),a6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Xd},Symbol.toStringTag,{value:"Module"}));function Qd(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Ja({signature:e});if(typeof e.s>"u")throw new Ja({signature:e});if(n&&typeof e.yParity>"u")throw new Ja({signature:e});if(e.r<0n||e.r>Td)throw new h6({value:e.r});if(e.s<0n||e.s>Td)throw new m6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new ec({value:e.yParity})}function c6(e){return Jd(Nt(e))}function Jd(e){if(e.length!==130&&e.length!==132)throw new p6({signature:e});const t=BigInt(Bt(e,0,32)),n=BigInt(Bt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return Qa(o)}catch{throw new ec({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function l6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return u6(e)}function u6(e){const t=typeof e=="string"?Jd(e):e instanceof Uint8Array?c6(e):typeof e.r=="string"?d6(e):e.v?f6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return Qd(t),t}function f6(e){return{r:e.r,s:e.s,yParity:Qa(e.v)}}function d6(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Qa(n)),typeof r!="number")throw new ec({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Qa(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new b6({value:e})}class p6 extends ie{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${tt(Ly(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Ja extends ie{constructor({signature:t}){super(`Signature \`${If(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class h6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class m6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class ec extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class b6 extends ie{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function g6(e,t={}){return typeof e.chainId=="string"?y6(e):{...e,...t.signature}}function y6(e){const{address:t,chainId:n,nonce:r}=e,o=l6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const v6="0x8010801080108010801080108010801080108010801080108010801080108010",w6=Nd("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function e0(e){if(typeof e=="string"){if(Bt(e,-32)!==v6)throw new S6(e)}else Qd(e.authorization)}function x6(e){e0(e);const t=Bf(Bt(e,-64,-32)),n=Bt(e,-t-64,-64),r=Bt(e,0,-t-64),[o,s,i]=Dw(w6,n);return{authorization:g6({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function E6(e){try{return e0(e),!0}catch{return!1}}let S6=class extends ie{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class P6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function T6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new P6({value:e});let[n,r="0"]=e.split(".");const o=n.startsWith("-");if(o&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[s,i,c]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(+`${i}.${c}`);a>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function A6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function $6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Zt(e.nonce):void 0,storageProof:e.storageProof?A6(e.storageProof):void 0}}async function N6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?Q(n):void 0,c=await e.request({method:"eth_getProof",params:[t,o,i||s]});return $6(c)}async function C6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?Q(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function tc(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:c}){var p,d,h;const a=r||"latest",l=n!==void 0?Q(n):void 0;let u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Q(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||a,Q(s)]},{dedupe:!!l}):i&&typeof c=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,Q(c)]},{dedupe:!0})),!u)throw new Wu({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(d=(p=e.chain)==null?void 0:p.formatters)==null?void 0:d.transaction)==null?void 0:h.format)||Xi)(u,"getTransaction")}async function O6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([X(e,To,"getBlockNumber")({}),t?X(e,tc,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function Ts(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Hu({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||td)(n,"getTransactionReceipt")}async function I6(e,t){var E;const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:i,blockTag:c,stateOverride:a}=t,l=t.contracts,{batchSize:u=t.batchSize??1024,deployless:f=t.deployless??!1}=typeof((E=e.batch)==null?void 0:E.multicall)=="object"?e.batch.multicall:{},p=(()=>{if(t.multicallAddress)return t.multicallAddress;if(f)return null;if(e.chain)return vr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),d=[[]];let h=0,m=0;for(let S=0;S<l.length;S++){const{abi:C,address:M,args:B,functionName:F}=l[S];try{const b=Tt({abi:C,args:B,functionName:F});m+=(b.length-2)/2,u>0&&m>u&&d[h].length>0&&(h++,m=(b.length-2)/2,d[h]=[]),d[h]=[...d[h],{allowFailure:!0,callData:b,target:M}]}catch(b){const g=pr(b,{abi:C,address:M,args:B,docsPath:"/docs/contract/multicall",functionName:F,sender:n});if(!o)throw g;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:M}]}}const v=await Promise.allSettled(d.map(S=>X(e,Ct,"readContract")({...p===null?{code:ma}:{address:p},abi:ys,account:n,args:[S],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:c,functionName:"aggregate3",stateOverride:a}))),T=[];for(let S=0;S<v.length;S++){const C=v[S];if(C.status==="rejected"){if(!o)throw C.reason;for(let B=0;B<d[S].length;B++)T.push({status:"failure",error:C.reason,result:void 0});continue}const M=C.value;for(let B=0;B<M.length;B++){const{returnData:F,success:b}=M[B],{callData:g}=d[S][B],{abi:w,address:O,functionName:N,args:I}=l[T.length];try{if(g==="0x")throw new Rr;if(!b)throw new is({data:F});const k=Rn({abi:w,args:I,data:F,functionName:N});T.push(o?{result:k,status:"success"}:k)}catch(k){const y=pr(k,{abi:w,address:O,args:I,docsPath:"/docs/contract/multicall",functionName:N});if(!o)throw y;T.push({error:y,result:void 0,status:"failure"})}}}if(T.length!==l.length)throw new V("multicall results mismatch");return T}async function nc(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:c}=t;try{const a=[];for(const p of o){const d=p.blockOverrides?zf(p.blockOverrides):void 0,h=p.calls.map(v=>{const T=v,E=T.account?Je(T.account):void 0,S=T.abi?Tt(T):T.data,C={...T,account:E,data:T.dataSuffix?Pt([S||"0x",T.dataSuffix]):S,from:T.from??(E==null?void 0:E.address)};return mr(C),bo(C)}),m=p.stateOverrides?Ki(p.stateOverrides):void 0;a.push({blockOverrides:d,calls:h,stateOverrides:m})}const u=(typeof n=="bigint"?Q(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:c},u]})).map((p,d)=>({...of(p),calls:p.calls.map((h,m)=>{var w,O;const{abi:v,args:T,functionName:E,to:S}=o[d].calls[m],C=((w=h.error)==null?void 0:w.data)??h.returnData,M=BigInt(h.gasUsed),B=(O=h.logs)==null?void 0:O.map(N=>Xt(N)),F=h.status==="0x1"?"success":"failure",b=v&&F==="success"&&C!=="0x"?Rn({abi:v,data:C,functionName:E}):null,g=(()=>{var I;if(F==="success")return;let N;if(((I=h.error)==null?void 0:I.data)==="0x"?N=new Rr:h.error&&(N=new is(h.error)),!!N)return pr(N,{abi:v??[],address:S??"0x",args:T,functionName:E??"<unknown>"})})();return{data:C,gasUsed:M,logs:B,status:F,...F==="success"?{result:b}:{error:g}}})}))}catch(a){const l=a,u=ls(l,{});throw u instanceof mo?l:u}}function rc(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const c=e[i];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=c,n+=c}}if(!s)throw new ie("Unable to normalize signature.");return o}function oc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Da(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>oc(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>oc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function t0(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return t0(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?Da(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Da(n[r],{strict:!1}):!1)return i}}function n0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Ql(e):e;return{...r,...n?{hash:xr(r)}:{}}}function As(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=By(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?r0(l)===Bt(t,0,4):l.type==="event"?xr(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new $s({name:t});if(i.length===1)return{...i[0],...o?{hash:xr(i[0])}:{}};let c;for(const l of i){if(!("inputs"in l))continue;if(!r||r.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...o?{hash:xr(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==r.length)continue;if(r.every((f,p)=>{const d="inputs"in l&&l.inputs[p];return d?oc(f,d):!1})){if(c&&"inputs"in c&&c.inputs){const f=t0(l.inputs,c.inputs,r);if(f)throw new D6({abiItem:l,type:f[0]},{abiItem:c,type:f[1]})}c=l}}const a=(()=>{if(c)return c;const[l,...u]=i;return{...l,overloads:u}})();if(!a)throw new $s({name:t});return{...a,...o?{hash:xr(a)}:{}}}function r0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return As(n,r)}return e[0]})();return Bt(xr(t),0,4)}function k6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return As(r,o)}return e[0]})(),n=typeof t=="string"?t:Yo(t);return rc(n)}function xr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return As(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:xd(pa(k6(t)))}class D6 extends ie{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${rc(Yo(t.abiItem))}\`, and`,`\`${n.type}\` in \`${rc(Yo(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class $s extends ie{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function M6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[B6(i),c]}return e})(),{bytecode:r,args:o}=n;return $t(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Ra(t.inputs,o):"0x")}function L6(e){return n0(e)}function B6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new $s({name:"constructor"});return t}function F6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,f]=e;return[o0(l,u,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?o0([t,...r],t.name,{args:n}):t,s=R6(o),i=n.length>0?Ra(o.inputs,n):void 0;return i?$t(s,i):s}function Er(e,t={}){return n0(e,t)}function o0(e,t,n){const r=As(e,t,n);if(r.type!=="function")throw new $s({name:t,type:"function"});return r}function R6(e){return r0(e)}const j6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ft="0x0000000000000000000000000000000000000000",_6="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function z6(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:c,validation:a}=t,l=t.account?Je(t.account):void 0;if(i&&!l)throw new V("`account` is required when `traceAssetChanges` is true");const u=l?M6(L6("constructor(bytes, bytes)"),{bytecode:Zf,args:[_6,F6(Er("function getBalance(address)"),[l.address])]}):void 0,f=i?await Promise.all(t.calls.map(async P=>{if(!P.data&&!P.abi)return;const{accessList:L}=await ud(e,{account:l.address,...P,data:P.abi?Tt(P):P.data});return L.map(({address:j,storageKeys:U})=>U.length>0?j:null)})).then(P=>P.flat().filter(Boolean)):[],p=await nc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:f.map((P,L)=>({abi:[Er("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]}]:[],{calls:[...o,{}].map(P=>({...P,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:f.map((P,L)=>({abi:[Er("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function decimals() returns (uint256)")],functionName:"decimals",from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]},{calls:f.map((P,L)=>({to:P,abi:[Er("function symbol() returns (string)")],functionName:"symbol",from:Ft,nonce:L})),stateOverrides:[{address:Ft,nonce:0}]}]:[]],traceTransfers:c,validation:a}),d=i?p[2]:p[0],[h,m,,v,T,E,S,C]=i?p:[],{calls:M,...B}=d,F=M.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],g=(m==null?void 0:m.calls)??[],w=[...b,...g].map(P=>P.status==="success"?Dt(P.data):null),O=(v==null?void 0:v.calls)??[],N=(T==null?void 0:T.calls)??[],I=[...O,...N].map(P=>P.status==="success"?Dt(P.data):null),k=((E==null?void 0:E.calls)??[]).map(P=>P.status==="success"?P.result:null),y=((C==null?void 0:C.calls)??[]).map(P=>P.status==="success"?P.result:null),$=((S==null?void 0:S.calls)??[]).map(P=>P.status==="success"?P.result:null),A=[];for(const[P,L]of I.entries()){const j=w[P];if(typeof L!="bigint"||typeof j!="bigint")continue;const U=k[P-1],_=y[P-1],H=$[P-1],Y=P===0?{address:j6,decimals:18,symbol:"ETH"}:{address:f[P-1],decimals:H||U?Number(U??1):void 0,symbol:_??void 0};A.some(G=>G.token.address===Y.address)||A.push({token:Y,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:A,block:B,results:F}}const s0="0x6492649264926492649264926492649264926492649264926492649264926492";function U6(e){if(Bt(e,-32)!==s0)throw new V6(e)}function W6(e){const{data:t,signature:n,to:r}=e;return $t(Ra(Nd("address, bytes, bytes"),[r,t,n]),s0)}function H6(e){try{return U6(e),!0}catch{return!1}}class V6 extends ie{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function G6({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new Xd.Signature(Dt(e),Dt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:Mt(i)}async function Ns(e,t){var c,a,l,u,f,p;const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??((l=(a=(c=e.chain)==null?void 0:c.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:l.address),multicallAddress:s=t.multicallAddress??((p=(f=(u=e.chain)==null?void 0:u.contracts)==null?void 0:f.multicall3)==null?void 0:p.address)}=t,i=(()=>{const d=t.signature;return Et(d)?d:typeof d=="object"&&"r"in d&&"s"in d?G6(d):Ae(d)})();try{return E6(i)?await q6(e,{...t,multicallAddress:s,signature:i}):await Z6(e,{...t,verifierAddress:o,signature:i})}catch(d){try{if(go(mn(n),await Ku({hash:r,signature:i})))return!0}catch{}if(d instanceof Wn)return!1;throw d}}async function q6(e,t){var v;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:l,to:u}=x6(t.signature);if(await Ia(e,{address:n,blockNumber:r,blockTag:o})===cr(["0xef0100",c.address]))return await K6(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:l});const p={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:Q(c.r,{size:32}),s:Q(c.s,{size:32}),yParity:c.yParity};if(!await Bv({address:n,authorization:p}))throw new Wn;const h=await X(e,Ct,"readContract")({...i?{address:i}:{code:ma},authorizationList:[p],abi:ys,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:Tt({abi:Gf,functionName:"isValidSignature",args:[s,l]})}]]}),m=(v=h[h.length-1])==null?void 0:v.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new Wn}async function Z6(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,l=await(async()=>!r&&!o||H6(i)?i:W6({data:o,signature:i,to:r}))(),u=c?{to:c,data:Tt({abi:qf,functionName:"isValidSig",args:[n,s,l]}),...a}:{data:ya({abi:qf,args:[n,s,l],bytecode:Wy}),...a},{data:f}=await X(e,So,"call")(u).catch(p=>{throw p instanceof Vu?new Wn:p});if(s1(f??"0x0"))return!0;throw new Wn}async function K6(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await X(e,Ct,"readContract")({address:n,abi:Gf,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof Gu?new Wn:a})).startsWith("0x1626ba7e"))return!0;throw new Wn}class Wn extends Error{}async function Y6(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=bd(n);return X(e,Ns,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function X6(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:l,...u}=t,f=ow({message:i,primaryType:c,types:a,domain:l});return X(e,Ns,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...u})}function i0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const c=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let a;return c?(()=>{const f=$e(["watchBlockNumber",e.uid,t,n,i]);return wn(f,{onBlockNumber:r,onError:o},p=>Po(async()=>{var d;try{const h=await X(e,To,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let m=a+1n;m<h;m++)p.onBlockNumber(m,a),a=m}(a===void 0||h>a)&&(p.onBlockNumber(h,a),a=h)}catch(h){(d=p.onError)==null||d.call(p,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const f=$e(["watchBlockNumber",e.uid,t,n]);return wn(f,{onBlockNumber:r,onError:o},p=>{let d=!0,h=()=>d=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const T=e.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return T?T.value:e.transport}return e.transport})(),{unsubscribe:v}=await m.subscribe({params:["newHeads"],onData(T){var S;if(!d)return;const E=Dt((S=T.result)==null?void 0:S.number);p.onBlockNumber(E,a),a=E},onError(T){var E;(E=p.onError)==null||E.call(p,T)}});h=v,d||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function Q6(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:c=({count:M})=>~~(1<<M)*200,timeout:a=18e4}=t,l=$e(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var M;return t.pollingInterval?t.pollingInterval:(M=e.chain)!=null&&M.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,p,d,h=!1,m,v;const{promise:T,resolve:E,reject:S}=Xf(),C=a?setTimeout(()=>{v==null||v(),m==null||m(),S(new wg({hash:o}))},a):void 0;return m=wn(l,{onReplaced:s,resolve:E,reject:S},async M=>{if(d=await X(e,Ts,"getTransactionReceipt")({hash:o}).catch(()=>{}),d&&r<=1){clearTimeout(C),M.resolve(d),m==null||m();return}v=X(e,i0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(B){const F=g=>{clearTimeout(C),v==null||v(),g(),m==null||m()};let b=B;if(!h)try{if(d){if(r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;F(()=>M.resolve(d));return}if(n&&!f&&(h=!0,await Ea(async()=>{f=await X(e,tc,"getTransaction")({hash:o}),f.blockNumber&&(b=f.blockNumber)},{delay:c,retryCount:i}),h=!1),d=await X(e,Ts,"getTransactionReceipt")({hash:o}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;F(()=>M.resolve(d))}catch(g){if(g instanceof Wu||g instanceof Hu){if(!f){h=!1;return}try{p=f,h=!0;const w=await Ea(()=>X(e,At,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:I})=>I instanceof nf});h=!1;const O=w.transactions.find(({from:I,nonce:k})=>I===p.from&&k===p.nonce);if(!O||(d=await X(e,Ts,"getTransactionReceipt")({hash:O.hash}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r)))return;let N="replaced";O.to===p.to&&O.value===p.value&&O.input===p.input?N="repriced":O.from===O.to&&O.value===0n&&(N="cancelled"),F(()=>{var I;(I=M.onReplaced)==null||I.call(M,{reason:N,replacedTransaction:p,transaction:O,transactionReceipt:d}),M.resolve(d)})}catch(w){F(()=>M.reject(w))}}else F(()=>M.reject(g))}}})}),T}function J6(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:c,pollingInterval:a=e.pollingInterval}){const l=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1;let f;return l?(()=>{const h=$e(["watchBlocks",e.uid,t,n,r,u,a]);return wn(h,{onBlock:o,onError:s},m=>Po(async()=>{var v;try{const T=await X(e,At,"getBlock")({blockTag:t,includeTransactions:u});if(T.number!==null&&(f==null?void 0:f.number)!=null){if(T.number===f.number)return;if(T.number-f.number>1&&n)for(let E=(f==null?void 0:f.number)+1n;E<T.number;E++){const S=await X(e,At,"getBlock")({blockNumber:E,includeTransactions:u});m.onBlock(S,f),f=S}}((f==null?void 0:f.number)==null||t==="pending"&&(T==null?void 0:T.number)==null||T.number!==null&&T.number>f.number)&&(m.onBlock(T,f),f=T)}catch(T){(v=m.onError)==null||v.call(m,T)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,m=!0,v=()=>h=!1;return(async()=>{try{r&&X(e,At,"getBlock")({blockTag:t,includeTransactions:u}).then(S=>{h&&m&&(o(S,void 0),m=!1)}).catch(s);const T=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(C=>C.config.type==="webSocket"||C.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:E}=await T.subscribe({params:["newHeads"],async onData(S){var M;if(!h)return;const C=await X(e,At,"getBlock")({blockNumber:(M=S.result)==null?void 0:M.number,includeTransactions:u}).catch(()=>{});h&&(o(C,f),m=!1,f=C)},onError(S){s==null||s(S)}});v=E,h||v()}catch(T){s==null||s(T)}})(),()=>v()})()}function e5(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:c,onLogs:a,poll:l,pollingInterval:u=e.pollingInterval,strict:f}){const p=typeof l<"u"?l:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),d=f??!1;return p?(()=>{const v=$e(["watchEvent",t,n,r,e.uid,o,u,i]);return wn(v,{onLogs:a,onError:c},T=>{let E;i!==void 0&&(E=i-1n);let S,C=!1;const M=Po(async()=>{var B;if(!C){try{S=await X(e,fd,"createEventFilter")({address:t,args:n,event:o,events:s,strict:d,fromBlock:i})}catch{}C=!0;return}try{let F;if(S)F=await X(e,vs,"getFilterChanges")({filter:S});else{const b=await X(e,To,"getBlockNumber")({});E&&E!==b?F=await X(e,sa,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:E+1n,toBlock:b}):F=[],E=b}if(F.length===0)return;if(r)T.onLogs(F);else for(const b of F)T.onLogs([b])}catch(F){S&&F instanceof gn&&(C=!1),(B=T.onError)==null||B.call(T,F)}},{emitOnBegin:!0,interval:u});return async()=>{S&&await X(e,ws,"uninstallFilter")({filter:S}),M()}})})():(()=>{let v=!0,T=()=>v=!1;return(async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const B=e.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return B?B.value:e.transport}return e.transport})(),S=s??(o?[o]:void 0);let C=[];S&&(C=[S.flatMap(F=>Wr({abi:[F],eventName:F.name,args:n}))],o&&(C=C[0]));const{unsubscribe:M}=await E.subscribe({params:["logs",{address:t,topics:C}],onData(B){var b;if(!v)return;const F=B.result;try{const{eventName:g,args:w}=fs({abi:S??[],data:F.data,topics:F.topics,strict:d}),O=Xt(F,{args:w,eventName:g});a([O])}catch(g){let w,O;if(g instanceof Jo||g instanceof Ti){if(f)return;w=g.abiItem.name,O=(b=g.abiItem.inputs)==null?void 0:b.some(I=>!("name"in I&&I.name))}const N=Xt(F,{args:O?[]:{},eventName:w});a([N])}},onError(B){c==null||c(B)}});T=M,v||T()}catch(E){c==null||c(E)}})(),()=>T()})()}function t5(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const l=$e(["watchPendingTransactions",e.uid,t,s]);return wn(l,{onTransactions:r,onError:n},u=>{let f;const p=Po(async()=>{var d;try{if(!f)try{f=await X(e,dd,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await X(e,vs,"getFilterChanges")({filter:f});if(h.length===0)return;if(t)u.onTransactions(h);else for(const m of h)u.onTransactions([m])}catch(h){(d=u.onError)==null||d.call(u,h)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await X(e,ws,"uninstallFilter")({filter:f}),p()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(p){if(!l)return;const d=p.result;r([d])},onError(p){n==null||n(p)}});u=f,l||u()}catch(f){n==null||n(f)}})(),()=>u()})()}function n5(e){var f,p,d;const{scheme:t,statement:n,...r}=((f=e.match(r5))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...l}=((p=e.match(o5))==null?void 0:p.groups)??{},u=(d=e.split("Resources:")[1])==null?void 0:d.split(`
|
|
91
|
+
- `).slice(1);return{...r,...l,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...c?{notBefore:new Date(c)}:{},...a?{requestId:a}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const r5=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,o5=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function s5(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:i=new Date}=e;if(n&&r.domain!==n||o&&r.nonce!==o||s&&r.scheme!==s||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!at(r.address,{strict:!1})||t&&!go(r.address,t))return!1}catch{return!1}return!0}async function i5(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:c,time:a=new Date,...l}=t,u=n5(o);if(!u.address||!s5({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const p=bd(o);return Ns(e,{address:u.address,hash:p,signature:c,...l})}async function a5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,a,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,Q(r)]:[t]},{retryCount:0}),i=(((l=(a=(c=e.chain)==null?void 0:c.formatters)==null?void 0:a.transactionReceipt)==null?void 0:l.format)||td)(o);if(i.status==="reverted"&&n)throw new vg({receipt:i});return i}function c5(e){return{call:t=>So(e,t),createAccessList:t=>ud(e,t),createBlockFilter:()=>Av(e),createContractEventFilter:t=>Mu(e,t),createEventFilter:t=>fd(e,t),createPendingTransactionFilter:()=>dd(e),estimateContractGas:t=>sy(e,t),estimateGas:t=>ra(e,t),getBalance:t=>$v(e,t),getBlobBaseFee:()=>Nv(e),getBlock:t=>At(e,t),getBlockNumber:t=>To(e,t),getBlockTransactionCount:t=>Cv(e,t),getBytecode:t=>Ia(e,t),getChainId:()=>ta(e),getCode:t=>Ia(e,t),getContractEvents:t=>vf(e,t),getEip712Domain:t=>Iv(e,t),getEnsAddress:t=>uv(e,t),getEnsAvatar:t=>Sv(e,t),getEnsName:t=>Pv(e,t),getEnsResolver:t=>Tv(e,t),getEnsText:t=>ld(e,t),getFeeHistory:t=>Mv(e,t),estimateFeesPerGas:t=>zg(e,t),getFilterChanges:t=>vs(e,t),getFilterLogs:t=>Lv(e,t),getGasPrice:()=>Qi(e),getLogs:t=>sa(e,t),getProof:t=>N6(e,t),estimateMaxPriorityFeePerGas:t=>_g(e,t),fillTransaction:t=>mf(e,t),getStorageAt:t=>C6(e,t),getTransaction:t=>tc(e,t),getTransactionConfirmations:t=>O6(e,t),getTransactionCount:t=>af(e,t),getTransactionReceipt:t=>Ts(e,t),multicall:t=>I6(e,t),prepareTransactionRequest:t=>gf(e,t),readContract:t=>Ct(e,t),sendRawTransaction:t=>nv(e,t),sendRawTransactionSync:t=>a5(e,t),simulate:t=>nc(e,t),simulateBlocks:t=>nc(e,t),simulateCalls:t=>z6(e,t),simulateContract:t=>Zy(e,t),verifyHash:t=>Ns(e,t),verifyMessage:t=>Y6(e,t),verifySiweMessage:t=>i5(e,t),verifyTypedData:t=>X6(e,t),uninstallFilter:t=>ws(e,t),waitForTransactionReceipt:t=>Q6(e,t),watchBlocks:t=>J6(e,t),watchBlockNumber:t=>i0(e,t),watchContractEvent:t=>tv(e,t),watchEvent:t=>e5(e,t),watchPendingTransactions:t=>t5(e,t)}}function l5(e){const{key:t="public",name:n="Public Client"}=e;return ov({...e,key:t,name:n,type:"publicClient"}).extend(c5)}function u5({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:c},a){const l=nd();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:c},request:Rv(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:a}}class f5 extends V{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function d5(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:i,name:c="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:l,retryDelay:u,raw:f}=t;return({chain:p,retryCount:d,timeout:h})=>{const{batchSize:m=1e3,wait:v=0}=typeof n=="object"?n:{},T=t.retryCount??d,E=h??t.timeout??1e4,S=e||(p==null?void 0:p.rpcUrls.default.http[0]);if(!S)throw new f5;const C=Kv(S,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:l,timeout:E});return u5({key:s,methods:i,name:c,async request({method:M,params:B}){const F={method:M,params:B},{schedule:b}=Qf({id:S,wait:v,shouldSplitBatch(N){return N.length>m},fn:N=>C.request({body:N}),sort:(N,I)=>N.id-I.id}),g=async N=>n?b(N):[await C.request({body:N})],[{error:w,result:O}]=await g(F);if(f)return{error:w,result:O};if(w)throw new _i({body:F,error:w,url:S});return O},retryCount:T,retryDelay:u,timeout:E,type:"http"},{fetchOptions:o,url:S})}}const p5=Gv({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}});function h5({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,c]=x.useState(null),[a,l]=x.useState(o);return x.useEffect(()=>{let u,f;const p=async()=>{try{const d=await e.readContract({address:t,abi:yr,functionName:"balanceOf",args:[n]});c(d),l(Fi(d,r))}catch{l(o)}};p();try{u=e.watchContractEvent({address:t,abi:yr,eventName:"Transfer",args:{to:n},onLogs:()=>{p()},poll:!0,pollingInterval:s}),f=e.watchContractEvent({address:t,abi:yr,eventName:"Transfer",args:{from:n},onLogs:()=>{p()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),f==null||f()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const m5=()=>({openDeposit:x.useCallback(t=>{},[])}),b5=()=>({openWithdraw:x.useCallback(t=>{},[])}),xn="MPC",sc="EVM",g5="spot",a0="perpetual";/**
|
|
84
92
|
* @license lucide-react v0.540.0 - ISC
|
|
85
93
|
*
|
|
86
94
|
* This source code is licensed under the ISC license.
|
|
87
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const
|
|
96
|
+
*/const y5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),v5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),c0=e=>{const t=v5(e);return t.charAt(0).toUpperCase()+t.slice(1)},l0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),w5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
89
97
|
* @license lucide-react v0.540.0 - ISC
|
|
90
98
|
*
|
|
91
99
|
* This source code is licensed under the ISC license.
|
|
92
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/var
|
|
101
|
+
*/var x5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
94
102
|
* @license lucide-react v0.540.0 - ISC
|
|
95
103
|
*
|
|
96
104
|
* This source code is licensed under the ISC license.
|
|
97
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const
|
|
106
|
+
*/const E5=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},a)=>x.createElement("svg",{ref:a,...x5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:l0("lucide",o),...!s&&!w5(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,u])=>x.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
|
|
99
107
|
* @license lucide-react v0.540.0 - ISC
|
|
100
108
|
*
|
|
101
109
|
* This source code is licensed under the ISC license.
|
|
102
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const
|
|
111
|
+
*/const S5=(e,t)=>{const n=x.forwardRef(({className:r,...o},s)=>x.createElement(E5,{ref:s,iconNode:t,className:l0(`lucide-${y5(c0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=c0(e),n};/**
|
|
104
112
|
* @license lucide-react v0.540.0 - ISC
|
|
105
113
|
*
|
|
106
114
|
* This source code is licensed under the ISC license.
|
|
107
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const l0=w5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),f0=typeof document<"u"?x.useLayoutEffect:()=>{};var ic;const v5=(ic=x.useInsertionEffect)!==null&&ic!==void 0?ic:f0;function x5(e){const t=x.useRef(null);return v5(()=>{t.current=e},[e]),x.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const En=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Wn=e=>e&&"window"in e&&e.window===e?e:En(e).defaultView||window;function E5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function S5(e){return E5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let P5=!1;function ac(){return P5}function d0(e,t){if(!ac())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:S5(n)?n=n.host:n=n.parentNode}return!1}const cc=(e=document)=>{var t;if(!ac())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function p0(e){return ac()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Ns(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function uc(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function rn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const lc=rn(function(){return uc(/^Mac/i)}),$5=rn(function(){return uc(/^iPhone/i)}),T5=rn(function(){return uc(/^iPad/i)||lc()&&navigator.maxTouchPoints>1}),A5=rn(function(){return $5()||T5()});rn(function(){return lc()||A5()}),rn(function(){return Ns(/AppleWebKit/i)&&!O5()});const O5=rn(function(){return Ns(/Chrome/i)}),N5=rn(function(){return Ns(/Android/i)});rn(function(){return Ns(/Firefox/i)});function h0(){let e=x.useRef(new Map),t=x.useCallback((o,s,i,c)=>{let a=c!=null&&c.once?(...u)=>{e.current.delete(i),i(...u)}:i;e.current.set(i,{type:s,eventTarget:o,fn:a,options:c}),o.addEventListener(s,a,c)},[]),n=x.useCallback((o,s,i,c)=>{var a;let u=((a=e.current.get(i))===null||a===void 0?void 0:a.fn)||i;o.removeEventListener(s,u,c),e.current.delete(i)},[]),r=x.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return x.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function C5(e){return e.pointerType===""&&e.isTrusted?!0:N5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function m0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function I5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function b0(e){let t=x.useRef({isFocused:!1,observer:null});f0(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=x5(r=>{e==null||e(r)});return x.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let c=m0(i);n(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let c=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let M5=!1,No=null,fc=new Set,Co=new Map,Vn=!1,dc=!1;const k5={Tab:!0,Escape:!0};function pc(e,t){for(let n of fc)n(e,t)}function B5(e){return!(e.metaKey||!lc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Cs(e){Vn=!0,B5(e)&&(No="keyboard",pc("keyboard",e))}function lt(e){No="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Vn=!0,pc("pointer",e))}function g0(e){C5(e)&&(Vn=!0,No="virtual")}function y0(e){e.target===window||e.target===document||M5||!e.isTrusted||(!Vn&&!dc&&(No="virtual",pc("virtual",e)),Vn=!1,dc=!1)}function w0(){Vn=!1,dc=!0}function hc(e){if(typeof window>"u"||typeof document>"u"||Co.get(Wn(e)))return;const t=Wn(e),n=En(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Vn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Cs,!0),n.addEventListener("keyup",Cs,!0),n.addEventListener("click",g0,!0),t.addEventListener("focus",y0,!0),t.addEventListener("blur",w0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",lt,!0),n.addEventListener("pointermove",lt,!0),n.addEventListener("pointerup",lt,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",lt,!0),n.addEventListener("mousemove",lt,!0),n.addEventListener("mouseup",lt,!0)),t.addEventListener("beforeunload",()=>{v0(e)},{once:!0}),Co.set(t,{focus:r})}const v0=(e,t)=>{const n=Wn(e),r=En(e);t&&r.removeEventListener("DOMContentLoaded",t),Co.has(n)&&(n.HTMLElement.prototype.focus=Co.get(n).focus,r.removeEventListener("keydown",Cs,!0),r.removeEventListener("keyup",Cs,!0),r.removeEventListener("click",g0,!0),n.removeEventListener("focus",y0,!0),n.removeEventListener("blur",w0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",lt,!0),r.removeEventListener("pointermove",lt,!0),r.removeEventListener("pointerup",lt,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",lt,!0),r.removeEventListener("mousemove",lt,!0),r.removeEventListener("mouseup",lt,!0)),Co.delete(n))};function L5(e){const t=En(e);let n;return t.readyState!=="loading"?hc(e):(n=()=>{hc(e)},t.addEventListener("DOMContentLoaded",n)),()=>v0(e,n)}typeof document<"u"&&L5();function x0(){return No!=="pointer"}const F5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function D5(e,t,n){let r=En(n==null?void 0:n.target);const o=typeof window<"u"?Wn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Wn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Wn(n==null?void 0:n.target).HTMLElement:HTMLElement,c=typeof window<"u"?Wn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!F5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!k5[n.key])}function R5(e,t,n){hc(),x.useEffect(()=>{let r=(o,s)=>{D5(!!(n!=null&&n.isTextInput),o,s)&&e(x0())};return fc.add(r),()=>{fc.delete(r)}},t)}function j5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=x.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=b0(s),c=x.useCallback(a=>{const u=En(a.target),l=u?cc(u):cc();a.target===a.currentTarget&&l===p0(a.nativeEvent)&&(n&&n(a),o&&o(!0),i(a))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?c:void 0,onBlur:!t&&(r||o)?s:void 0}}}function _5(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=x.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=h0(),a=x.useCallback(f=>{f.currentTarget.contains(f.target)&&s.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(f),o&&o(!1))},[n,o,s,c]),u=b0(a),l=x.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const p=En(f.target),d=cc(p);if(!s.current.isFocusWithin&&d===p0(f.nativeEvent)){r&&r(f),o&&o(!0),s.current.isFocusWithin=!0,u(f);let h=f.currentTarget;i(p,"focus",m=>{if(s.current.isFocusWithin&&!d0(h,m.target)){let w=new p.defaultView.FocusEvent("blur",{relatedTarget:m.target});I5(w,h);let $=m0(w);a($)}},{capture:!0})}},[r,o,u,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:a}}}let Is=!1,Ms=0;function mc(){Is=!0,setTimeout(()=>{Is=!1},50)}function E0(e){e.pointerType==="touch"&&mc()}function U5(){if(!(typeof document>"u"))return Ms===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",E0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",mc)),Ms++,()=>{Ms--,!(Ms>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",E0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",mc))}}function z5(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=x.useState(!1),c=x.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;x.useEffect(U5,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=h0(),{hoverProps:l,triggerHoverEnd:f}=x.useMemo(()=>{let p=(m,w)=>{if(c.pointerType=w,o||w==="touch"||c.isHovered||!m.currentTarget.contains(m.target))return;c.isHovered=!0;let $=m.currentTarget;c.target=$,a(En(m.target),"pointerover",E=>{c.isHovered&&c.target&&!d0(c.target,E.target)&&d(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:$,pointerType:w}),n&&n(!0),i(!0)},d=(m,w)=>{let $=c.target;c.pointerType="",c.target=null,!(w==="touch"||!c.isHovered||!$)&&(c.isHovered=!1,u(),r&&r({type:"hoverend",target:$,pointerType:w}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{Is&&m.pointerType==="mouse"||p(m,m.pointerType)},h.onPointerLeave=m=>{!o&&m.currentTarget.contains(m.target)&&d(m,m.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{c.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!c.ignoreEmulatedMouseEvents&&!Is&&p(m,"mouse"),c.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&m.currentTarget.contains(m.target)&&d(m,"mouse")}),{hoverProps:h,triggerHoverEnd:d}},[t,n,r,o,c,a,u]);return x.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:l,isHovered:s}}function H5(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=x.useRef({isFocused:!1,isFocusVisible:t||x0()}),[s,i]=x.useState(!1),[c,a]=x.useState(()=>o.current.isFocused&&o.current.isFocusVisible),u=x.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),l=x.useCallback(d=>{o.current.isFocused=d,i(d),u()},[u]);R5(d=>{o.current.isFocusVisible=d,u()},[],{isTextInput:n});let{focusProps:f}=j5({isDisabled:r,onFocusChange:l}),{focusWithinProps:p}=_5({isDisabled:!r,onFocusWithinChange:l});return{isFocused:s,isFocusVisible:c,focusProps:r?p:f}}var W5=Object.defineProperty,V5=(e,t,n)=>t in e?W5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bc=(e,t,n)=>(V5(e,typeof t!="symbol"?t+"":t,n),n);let G5=class{constructor(){bc(this,"current",this.detect()),bc(this,"handoffState","pending"),bc(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Rt=new G5;function ks(e){var t;return Rt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Bs(e){var t,n;return Rt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function S0(e){var t,n;return(n=(t=Bs(e))==null?void 0:t.activeElement)!=null?n:null}function q5(e){return S0(e)===e}function P0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function nt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return P0(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=nt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Gn(){let[e]=x.useState(nt);return x.useEffect(()=>()=>e.dispose(),[e]),e}let Ee=(e,t)=>{Rt.isServer?x.useEffect(e,t):x.useLayoutEffect(e,t)};function qn(e){let t=x.useRef(e);return Ee(()=>{t.current=e},[e]),t}let le=function(e){let t=qn(e);return x.useCallback((...n)=>t.current(...n),[t])};function Z5(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Y5(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function K5({disabled:e=!1}={}){let t=x.useRef(null),[n,r]=x.useState(!1),o=Gn(),s=le(()=>{t.current=null,r(!1),o.dispose()}),i=le(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let a=ks(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",u=>{if(t.current){let l=Z5(u);r(Y5(l,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function Sn(e){return x.useMemo(()=>e,Object.values(e))}let X5=x.createContext(void 0);function gc(){return x.useContext(X5)}function yc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ft(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ft),r}var Ls=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ls||{}),Pn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Pn||{});function rt(){let e=J5();return x.useCallback(t=>Q5({mergeRefs:e,...t}),[e])}function Q5({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??ex;let a=$0(t,e);if(s)return Fs(a,n,r,i,c);let u=o??0;if(u&2){let{static:l=!1,...f}=a;if(l)return Fs(f,n,r,i,c)}if(u&1){let{unmount:l=!0,...f}=a;return ft(l?0:1,{0(){return null},1(){return Fs({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return Fs(a,n,r,i,c)}function Fs(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=wc(e,["unmount","static"]),u=e.ref!==void 0?{[c]:e.ref}:{},l=typeof i=="function"?i(t):i;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let f={};if(t){let p=!1,d=[];for(let[h,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&d.push(h.replace(/([A-Z])/g,w=>`-${w.toLowerCase()}`));if(p){f["data-headlessui-state"]=d.join(" ");for(let h of d)f[`data-${h}`]=""}}if(Io(s)&&(Object.keys($n(a)).length>0||Object.keys($n(f)).length>0))if(!x.isValidElement(l)||Array.isArray(l)&&l.length>1||nx(l)){if(Object.keys($n(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys($n(a)).concat(Object.keys($n(f))).map(p=>` - ${p}`).join(`
|
|
116
|
+
*/const u0=S5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),f0=typeof document<"u"?x.useLayoutEffect:()=>{};var ic;const P5=(ic=x.useInsertionEffect)!==null&&ic!==void 0?ic:f0;function T5(e){const t=x.useRef(null);return P5(()=>{t.current=e},[e]),x.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const En=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Hn=e=>e&&"window"in e&&e.window===e?e:En(e).defaultView||window;function A5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function $5(e){return A5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let N5=!1;function ac(){return N5}function d0(e,t){if(!ac())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:$5(n)?n=n.host:n=n.parentNode}return!1}const cc=(e=document)=>{var t;if(!ac())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function p0(e){return ac()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Cs(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function lc(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function rn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const uc=rn(function(){return lc(/^Mac/i)}),C5=rn(function(){return lc(/^iPhone/i)}),O5=rn(function(){return lc(/^iPad/i)||uc()&&navigator.maxTouchPoints>1}),I5=rn(function(){return C5()||O5()});rn(function(){return uc()||I5()}),rn(function(){return Cs(/AppleWebKit/i)&&!k5()});const k5=rn(function(){return Cs(/Chrome/i)}),D5=rn(function(){return Cs(/Android/i)});rn(function(){return Cs(/Firefox/i)});function h0(){let e=x.useRef(new Map),t=x.useCallback((o,s,i,c)=>{let a=c!=null&&c.once?(...l)=>{e.current.delete(i),i(...l)}:i;e.current.set(i,{type:s,eventTarget:o,fn:a,options:c}),o.addEventListener(s,a,c)},[]),n=x.useCallback((o,s,i,c)=>{var a;let l=((a=e.current.get(i))===null||a===void 0?void 0:a.fn)||i;o.removeEventListener(s,l,c),e.current.delete(i)},[]),r=x.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return x.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function M5(e){return e.pointerType===""&&e.isTrusted?!0:D5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function m0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function L5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function b0(e){let t=x.useRef({isFocused:!1,observer:null});f0(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=T5(r=>{e==null||e(r)});return x.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let c=m0(i);n(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let c=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let B5=!1,Co=null,fc=new Set,Oo=new Map,Vn=!1,dc=!1;const F5={Tab:!0,Escape:!0};function pc(e,t){for(let n of fc)n(e,t)}function R5(e){return!(e.metaKey||!uc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Os(e){Vn=!0,R5(e)&&(Co="keyboard",pc("keyboard",e))}function ut(e){Co="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Vn=!0,pc("pointer",e))}function g0(e){M5(e)&&(Vn=!0,Co="virtual")}function y0(e){e.target===window||e.target===document||B5||!e.isTrusted||(!Vn&&!dc&&(Co="virtual",pc("virtual",e)),Vn=!1,dc=!1)}function v0(){Vn=!1,dc=!0}function hc(e){if(typeof window>"u"||typeof document>"u"||Oo.get(Hn(e)))return;const t=Hn(e),n=En(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Vn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Os,!0),n.addEventListener("keyup",Os,!0),n.addEventListener("click",g0,!0),t.addEventListener("focus",y0,!0),t.addEventListener("blur",v0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ut,!0),n.addEventListener("pointermove",ut,!0),n.addEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ut,!0),n.addEventListener("mousemove",ut,!0),n.addEventListener("mouseup",ut,!0)),t.addEventListener("beforeunload",()=>{w0(e)},{once:!0}),Oo.set(t,{focus:r})}const w0=(e,t)=>{const n=Hn(e),r=En(e);t&&r.removeEventListener("DOMContentLoaded",t),Oo.has(n)&&(n.HTMLElement.prototype.focus=Oo.get(n).focus,r.removeEventListener("keydown",Os,!0),r.removeEventListener("keyup",Os,!0),r.removeEventListener("click",g0,!0),n.removeEventListener("focus",y0,!0),n.removeEventListener("blur",v0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ut,!0),r.removeEventListener("pointermove",ut,!0),r.removeEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",ut,!0),r.removeEventListener("mousemove",ut,!0),r.removeEventListener("mouseup",ut,!0)),Oo.delete(n))};function j5(e){const t=En(e);let n;return t.readyState!=="loading"?hc(e):(n=()=>{hc(e)},t.addEventListener("DOMContentLoaded",n)),()=>w0(e,n)}typeof document<"u"&&j5();function x0(){return Co!=="pointer"}const _5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function z5(e,t,n){let r=En(n==null?void 0:n.target);const o=typeof window<"u"?Hn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Hn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Hn(n==null?void 0:n.target).HTMLElement:HTMLElement,c=typeof window<"u"?Hn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!_5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!F5[n.key])}function U5(e,t,n){hc(),x.useEffect(()=>{let r=(o,s)=>{z5(!!(n!=null&&n.isTextInput),o,s)&&e(x0())};return fc.add(r),()=>{fc.delete(r)}},t)}function W5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=x.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=b0(s),c=x.useCallback(a=>{const l=En(a.target),u=l?cc(l):cc();a.target===a.currentTarget&&u===p0(a.nativeEvent)&&(n&&n(a),o&&o(!0),i(a))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?c:void 0,onBlur:!t&&(r||o)?s:void 0}}}function H5(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=x.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=h0(),a=x.useCallback(f=>{f.currentTarget.contains(f.target)&&s.current.isFocusWithin&&!f.currentTarget.contains(f.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(f),o&&o(!1))},[n,o,s,c]),l=b0(a),u=x.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const p=En(f.target),d=cc(p);if(!s.current.isFocusWithin&&d===p0(f.nativeEvent)){r&&r(f),o&&o(!0),s.current.isFocusWithin=!0,l(f);let h=f.currentTarget;i(p,"focus",m=>{if(s.current.isFocusWithin&&!d0(h,m.target)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:m.target});L5(v,h);let T=m0(v);a(T)}},{capture:!0})}},[r,o,l,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let Is=!1,ks=0;function mc(){Is=!0,setTimeout(()=>{Is=!1},50)}function E0(e){e.pointerType==="touch"&&mc()}function V5(){if(!(typeof document>"u"))return ks===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",E0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",mc)),ks++,()=>{ks--,!(ks>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",E0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",mc))}}function G5(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=x.useState(!1),c=x.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;x.useEffect(V5,[]);let{addGlobalListener:a,removeAllGlobalListeners:l}=h0(),{hoverProps:u,triggerHoverEnd:f}=x.useMemo(()=>{let p=(m,v)=>{if(c.pointerType=v,o||v==="touch"||c.isHovered||!m.currentTarget.contains(m.target))return;c.isHovered=!0;let T=m.currentTarget;c.target=T,a(En(m.target),"pointerover",E=>{c.isHovered&&c.target&&!d0(c.target,E.target)&&d(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:T,pointerType:v}),n&&n(!0),i(!0)},d=(m,v)=>{let T=c.target;c.pointerType="",c.target=null,!(v==="touch"||!c.isHovered||!T)&&(c.isHovered=!1,l(),r&&r({type:"hoverend",target:T,pointerType:v}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{Is&&m.pointerType==="mouse"||p(m,m.pointerType)},h.onPointerLeave=m=>{!o&&m.currentTarget.contains(m.target)&&d(m,m.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{c.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!c.ignoreEmulatedMouseEvents&&!Is&&p(m,"mouse"),c.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&m.currentTarget.contains(m.target)&&d(m,"mouse")}),{hoverProps:h,triggerHoverEnd:d}},[t,n,r,o,c,a,l]);return x.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:u,isHovered:s}}function q5(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=x.useRef({isFocused:!1,isFocusVisible:t||x0()}),[s,i]=x.useState(!1),[c,a]=x.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=x.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=x.useCallback(d=>{o.current.isFocused=d,i(d),l()},[l]);U5(d=>{o.current.isFocusVisible=d,l()},[],{isTextInput:n});let{focusProps:f}=W5({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=H5({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:c,focusProps:r?p:f}}var Z5=Object.defineProperty,K5=(e,t,n)=>t in e?Z5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bc=(e,t,n)=>(K5(e,typeof t!="symbol"?t+"":t,n),n);let Y5=class{constructor(){bc(this,"current",this.detect()),bc(this,"handoffState","pending"),bc(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Rt=new Y5;function Ds(e){var t;return Rt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Ms(e){var t,n;return Rt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function S0(e){var t,n;return(n=(t=Ms(e))==null?void 0:t.activeElement)!=null?n:null}function X5(e){return S0(e)===e}function P0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function nt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return P0(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=nt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Gn(){let[e]=x.useState(nt);return x.useEffect(()=>()=>e.dispose(),[e]),e}let Ee=(e,t)=>{Rt.isServer?x.useEffect(e,t):x.useLayoutEffect(e,t)};function qn(e){let t=x.useRef(e);return Ee(()=>{t.current=e},[e]),t}let ue=function(e){let t=qn(e);return x.useCallback((...n)=>t.current(...n),[t])};function Q5(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function J5(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ex({disabled:e=!1}={}){let t=x.useRef(null),[n,r]=x.useState(!1),o=Gn(),s=ue(()=>{t.current=null,r(!1),o.dispose()}),i=ue(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let a=Ds(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",l=>{if(t.current){let u=Q5(l);r(J5(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function Sn(e){return x.useMemo(()=>e,Object.values(e))}let tx=x.createContext(void 0);function gc(){return x.useContext(tx)}function yc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ft(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ft),r}var Ls=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ls||{}),Pn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Pn||{});function rt(){let e=rx();return x.useCallback(t=>nx({mergeRefs:e,...t}),[e])}function nx({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??ox;let a=T0(t,e);if(s)return Bs(a,n,r,i,c);let l=o??0;if(l&2){let{static:u=!1,...f}=a;if(u)return Bs(f,n,r,i,c)}if(l&1){let{unmount:u=!0,...f}=a;return ft(u?0:1,{0(){return null},1(){return Bs({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return Bs(a,n,r,i,c)}function Bs(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=vc(e,["unmount","static"]),l=e.ref!==void 0?{[c]:e.ref}:{},u=typeof i=="function"?i(t):i;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let f={};if(t){let p=!1,d=[];for(let[h,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&d.push(h.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){f["data-headlessui-state"]=d.join(" ");for(let h of d)f[`data-${h}`]=""}}if(Io(s)&&(Object.keys(Tn(a)).length>0||Object.keys(Tn(f)).length>0))if(!x.isValidElement(u)||Array.isArray(u)&&u.length>1||ix(u)){if(Object.keys(Tn(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Tn(a)).concat(Object.keys(Tn(f))).map(p=>` - ${p}`).join(`
|
|
109
117
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
|
|
110
118
|
`)].join(`
|
|
111
|
-
`))}else{let p=l.props,d=p==null?void 0:p.className,h=typeof d=="function"?(...$)=>yc(d(...$),a.className):yc(d,a.className),m=h?{className:h}:{},w=$0(l.props,$n(wc(a,["ref"])));for(let $ in f)$ in w&&delete f[$];return x.cloneElement(l,Object.assign({},w,f,u,{ref:o(tx(l),u.ref)},m))}return x.createElement(s,Object.assign({},wc(a,["ref"]),!Io(s)&&u,!Io(s)&&f),l)}function J5(){let e=x.useRef([]),t=x.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function ex(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function $0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let c of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;c(o,...s)}}});return t}function T0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function Ge(e){var t;return Object.assign(x.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function $n(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function wc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function tx(e){return x.version.split(".")[0]>="19"?e.props.ref:e.ref}function Io(e){return e===x.Fragment||e===Symbol.for("react.fragment")}function nx(e){return Io(e.type)}function rx(e,t,n){let[r,o]=x.useState(n),s=e!==void 0,i=x.useRef(s),c=x.useRef(!1),a=x.useRef(!1);return s&&!i.current&&!c.current?(c.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!a.current&&(a.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,le(u=>(s||je.flushSync(()=>o(u)),t==null?void 0:t(u)))]}function ox(e){let[t]=x.useState(e);return t}function A0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))N0(n,O0(t,r),o);return n}function O0(e,t){return e?e+"["+t+"]":t}function N0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())N0(e,O0(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ix(n)&&!x.isValidElement(n)&&A0(n,t,e)}function sx(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function ix(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let ax="span";var vc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(vc||{});function cx(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return rt()({ourProps:s,theirProps:o,slot:{},defaultTag:ax,name:"Hidden"})}let C0=Ge(cx),ux=x.createContext(null);function lx({children:e}){let t=x.useContext(ux);if(!t)return x.createElement(x.Fragment,null,e);let{target:n}=t;return n?je.createPortal(x.createElement(x.Fragment,null,e),n):null}function fx({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=x.useState(null),c=Gn();return x.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),x.createElement(lx,null,x.createElement(dx,{setForm:i,formId:t}),A0(e).map(([a,u])=>x.createElement(C0,{features:vc.Hidden,...$n({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:u,...o})})))}function dx({setForm:e,formId:t}){return x.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:x.createElement(C0,{features:vc.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let px=x.createContext(void 0);function I0(){return x.useContext(px)}function M0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Ds(e){return M0(e)&&"tagName"in e}function on(e){return Ds(e)&&"accessKey"in e}function Sr(e){return Ds(e)&&"tabIndex"in e}function hx(e){return Ds(e)&&"style"in e}function mx(e){return on(e)&&e.nodeName==="IFRAME"}function k0(e){return on(e)&&e.nodeName==="INPUT"}function B0(e){return on(e)&&e.nodeName==="LABEL"}function bx(e){return on(e)&&e.nodeName==="FIELDSET"}function L0(e){return on(e)&&e.nodeName==="LEGEND"}function gx(e){return Ds(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function F0(e){let t=e.parentElement,n=null;for(;t&&!bx(t);)L0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&yx(n)?!1:r}function yx(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(L0(t))return!1;t=t.previousElementSibling}return!0}let D0=Symbol();function wx(e,t=!0){return Object.assign(e,{[D0]:t})}function dt(...e){let t=x.useRef(e);x.useEffect(()=>{t.current=e},[e]);let n=le(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[D0]))?void 0:n}let xc=x.createContext(null);xc.displayName="DescriptionContext";function R0(){let e=x.useContext(xc);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,R0),t}return e}function vx(){var e,t;return(t=(e=x.useContext(xc))==null?void 0:e.value)!=null?t:void 0}let xx="p";function Ex(e,t){let n=x.useId(),r=gc(),{id:o=`headlessui-description-${n}`,...s}=e,i=R0(),c=dt(t);Ee(()=>i.register(o),[o,i.register]);let a=Sn({...i.slot,disabled:r||!1}),u={ref:c,...i.props,id:o};return rt()({ourProps:u,theirProps:s,slot:a,defaultTag:xx,name:i.name||"Description"})}let Sx=Ge(Ex);Object.assign(Sx,{});var Ce=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ce||{});let Rs=x.createContext(null);Rs.displayName="LabelContext";function j0(){let e=x.useContext(Rs);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,j0),t}return e}function _0(e){var t,n,r;let o=(n=(t=x.useContext(Rs))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Px({inherit:e=!1}={}){let t=_0(),[n,r]=x.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,x.useMemo(()=>function(s){let i=le(a=>(r(u=>[...u,a]),()=>r(u=>{let l=u.slice(),f=l.indexOf(a);return f!==-1&&l.splice(f,1),l}))),c=x.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return x.createElement(Rs.Provider,{value:c},s.children)},[r])]}let $x="label";function Tx(e,t){var n;let r=x.useId(),o=j0(),s=I0(),i=gc(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:u=!1,...l}=e,f=dt(t);Ee(()=>o.register(c),[c,o.register]);let p=le(m=>{let w=m.currentTarget;if(!(m.target!==m.currentTarget&&gx(m.target))&&(B0(w)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),B0(w))){let $=document.getElementById(w.htmlFor);if($){let E=$.getAttribute("disabled");if(E==="true"||E==="")return;let S=$.getAttribute("aria-disabled");if(S==="true"||S==="")return;(k0($)&&($.type==="file"||$.type==="radio"||$.type==="checkbox")||$.role==="radio"||$.role==="checkbox"||$.role==="switch")&&$.click(),$.focus({preventScroll:!0})}}}),d=Sn({...o.slot,disabled:i||!1}),h={ref:f,...o.props,id:c,htmlFor:a,onClick:p};return u&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in l&&delete l.onClick),rt()({ourProps:h,theirProps:l,slot:d,defaultTag:a?$x:"div",name:o.name||"Label"})}let Ax=Ge(Tx),Ox=Object.assign(Ax,{});function Nx(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Cx(e=Nx){return x.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function U0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Ix(e,t,n=!1){let[r,o]=x.useState(()=>U0(t));return Ee(()=>{if(!t||!e)return;let s=nt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=U0(t);return a.width===c.width&&a.height===c.height?c:a})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var z0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(z0||{});function Mx(e){let t=x.useRef(null),n=le(o=>{t.current=o.pointerType,!F0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===z0.Left&&(o.preventDefault(),e(o))}),r=le(o=>{t.current!=="mouse"&&(F0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let H0=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var kx=Object.defineProperty,Bx=(e,t,n)=>t in e?kx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lx=(e,t,n)=>(Bx(e,t+"",n),n),W0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},pt=(e,t,n)=>(W0(e,t,"read from private field"),n?n.call(e):t.get(e)),Ec=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},V0=(e,t,n,r)=>(W0(e,t,"write to private field"),t.set(e,n),n),jt,Mo,ko;let G0=class{constructor(t){Ec(this,jt,{}),Ec(this,Mo,new H0(()=>new Set)),Ec(this,ko,new Set),Lx(this,"disposables",nt()),V0(this,jt,t),Rt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return pt(this,jt)}subscribe(t,n){if(Rt.isServer)return()=>{};let r={selector:t,callback:n,current:t(pt(this,jt))};return pt(this,ko).add(r),this.disposables.add(()=>{pt(this,ko).delete(r)})}on(t,n){return Rt.isServer?()=>{}:(pt(this,Mo).get(t).add(n),this.disposables.add(()=>{pt(this,Mo).get(t).delete(n)}))}send(t){let n=this.reduce(pt(this,jt),t);if(n!==pt(this,jt)){V0(this,jt,n);for(let r of pt(this,ko)){let o=r.selector(pt(this,jt));q0(r.current,o)||(r.current=o,r.callback(o))}for(let r of pt(this,Mo).get(t.type))r(pt(this,jt),t)}}};jt=new WeakMap,Mo=new WeakMap,ko=new WeakMap;function q0(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Sc(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Sc(e.entries(),t.entries()):Z0(e)&&Z0(t)?Sc(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Sc(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Z0(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Pc(e){let[t,n]=e(),r=nt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Fx=Object.defineProperty,Dx=(e,t,n)=>t in e?Fx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Y0=(e,t,n)=>(Dx(e,typeof t!="symbol"?t+"":t,n),n),K0=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(K0||{});let Rx={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},jx=class Bm extends G0{constructor(){super(...arguments),Y0(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Y0(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Bm({stack:[]})}reduce(t,n){return ft(n.type,Rx,t,n)}};const $c=new H0(()=>jx.new());var Tc={exports:{}},Ac={};/**
|
|
119
|
+
`))}else{let p=u.props,d=p==null?void 0:p.className,h=typeof d=="function"?(...T)=>yc(d(...T),a.className):yc(d,a.className),m=h?{className:h}:{},v=T0(u.props,Tn(vc(a,["ref"])));for(let T in f)T in v&&delete f[T];return x.cloneElement(u,Object.assign({},v,f,l,{ref:o(sx(u),l.ref)},m))}return x.createElement(s,Object.assign({},vc(a,["ref"]),!Io(s)&&l,!Io(s)&&f),u)}function rx(){let e=x.useRef([]),t=x.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function ox(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function T0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let c of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;c(o,...s)}}});return t}function A0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function Ge(e){var t;return Object.assign(x.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Tn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function vc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function sx(e){return x.version.split(".")[0]>="19"?e.props.ref:e.ref}function Io(e){return e===x.Fragment||e===Symbol.for("react.fragment")}function ix(e){return Io(e.type)}function ax(e,t,n){let[r,o]=x.useState(n),s=e!==void 0,i=x.useRef(s),c=x.useRef(!1),a=x.useRef(!1);return s&&!i.current&&!c.current?(c.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!a.current&&(a.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,ue(l=>(s||je.flushSync(()=>o(l)),t==null?void 0:t(l)))]}function cx(e){let[t]=x.useState(e);return t}function $0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))C0(n,N0(t,r),o);return n}function N0(e,t){return e?e+"["+t+"]":t}function C0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())C0(e,N0(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ux(n)&&!x.isValidElement(n)&&$0(n,t,e)}function lx(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function ux(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let fx="span";var wc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(wc||{});function dx(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return rt()({ourProps:s,theirProps:o,slot:{},defaultTag:fx,name:"Hidden"})}let O0=Ge(dx),px=x.createContext(null);function hx({children:e}){let t=x.useContext(px);if(!t)return x.createElement(x.Fragment,null,e);let{target:n}=t;return n?je.createPortal(x.createElement(x.Fragment,null,e),n):null}function mx({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=x.useState(null),c=Gn();return x.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),x.createElement(hx,null,x.createElement(bx,{setForm:i,formId:t}),$0(e).map(([a,l])=>x.createElement(O0,{features:wc.Hidden,...Tn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:l,...o})})))}function bx({setForm:e,formId:t}){return x.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:x.createElement(O0,{features:wc.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let gx=x.createContext(void 0);function I0(){return x.useContext(gx)}function k0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Fs(e){return k0(e)&&"tagName"in e}function on(e){return Fs(e)&&"accessKey"in e}function Sr(e){return Fs(e)&&"tabIndex"in e}function yx(e){return Fs(e)&&"style"in e}function vx(e){return on(e)&&e.nodeName==="IFRAME"}function D0(e){return on(e)&&e.nodeName==="INPUT"}function M0(e){return on(e)&&e.nodeName==="LABEL"}function wx(e){return on(e)&&e.nodeName==="FIELDSET"}function L0(e){return on(e)&&e.nodeName==="LEGEND"}function xx(e){return Fs(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function B0(e){let t=e.parentElement,n=null;for(;t&&!wx(t);)L0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ex(n)?!1:r}function Ex(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(L0(t))return!1;t=t.previousElementSibling}return!0}let F0=Symbol();function Sx(e,t=!0){return Object.assign(e,{[F0]:t})}function dt(...e){let t=x.useRef(e);x.useEffect(()=>{t.current=e},[e]);let n=ue(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[F0]))?void 0:n}let xc=x.createContext(null);xc.displayName="DescriptionContext";function R0(){let e=x.useContext(xc);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,R0),t}return e}function Px(){var e,t;return(t=(e=x.useContext(xc))==null?void 0:e.value)!=null?t:void 0}let Tx="p";function Ax(e,t){let n=x.useId(),r=gc(),{id:o=`headlessui-description-${n}`,...s}=e,i=R0(),c=dt(t);Ee(()=>i.register(o),[o,i.register]);let a=Sn({...i.slot,disabled:r||!1}),l={ref:c,...i.props,id:o};return rt()({ourProps:l,theirProps:s,slot:a,defaultTag:Tx,name:i.name||"Description"})}let $x=Ge(Ax);Object.assign($x,{});var Oe=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Oe||{});let Rs=x.createContext(null);Rs.displayName="LabelContext";function j0(){let e=x.useContext(Rs);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,j0),t}return e}function _0(e){var t,n,r;let o=(n=(t=x.useContext(Rs))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Nx({inherit:e=!1}={}){let t=_0(),[n,r]=x.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,x.useMemo(()=>function(s){let i=ue(a=>(r(l=>[...l,a]),()=>r(l=>{let u=l.slice(),f=u.indexOf(a);return f!==-1&&u.splice(f,1),u}))),c=x.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return x.createElement(Rs.Provider,{value:c},s.children)},[r])]}let Cx="label";function Ox(e,t){var n;let r=x.useId(),o=j0(),s=I0(),i=gc(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=e,f=dt(t);Ee(()=>o.register(c),[c,o.register]);let p=ue(m=>{let v=m.currentTarget;if(!(m.target!==m.currentTarget&&xx(m.target))&&(M0(v)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),M0(v))){let T=document.getElementById(v.htmlFor);if(T){let E=T.getAttribute("disabled");if(E==="true"||E==="")return;let S=T.getAttribute("aria-disabled");if(S==="true"||S==="")return;(D0(T)&&(T.type==="file"||T.type==="radio"||T.type==="checkbox")||T.role==="radio"||T.role==="checkbox"||T.role==="switch")&&T.click(),T.focus({preventScroll:!0})}}}),d=Sn({...o.slot,disabled:i||!1}),h={ref:f,...o.props,id:c,htmlFor:a,onClick:p};return l&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in u&&delete u.onClick),rt()({ourProps:h,theirProps:u,slot:d,defaultTag:a?Cx:"div",name:o.name||"Label"})}let Ix=Ge(Ox),kx=Object.assign(Ix,{});function Dx(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Mx(e=Dx){return x.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function z0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Lx(e,t,n=!1){let[r,o]=x.useState(()=>z0(t));return Ee(()=>{if(!t||!e)return;let s=nt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=z0(t);return a.width===c.width&&a.height===c.height?c:a})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var U0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(U0||{});function Bx(e){let t=x.useRef(null),n=ue(o=>{t.current=o.pointerType,!B0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===U0.Left&&(o.preventDefault(),e(o))}),r=ue(o=>{t.current!=="mouse"&&(B0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let W0=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var Fx=Object.defineProperty,Rx=(e,t,n)=>t in e?Fx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jx=(e,t,n)=>(Rx(e,t+"",n),n),H0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},pt=(e,t,n)=>(H0(e,t,"read from private field"),n?n.call(e):t.get(e)),Ec=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},V0=(e,t,n,r)=>(H0(e,t,"write to private field"),t.set(e,n),n),jt,ko,Do;let G0=class{constructor(t){Ec(this,jt,{}),Ec(this,ko,new W0(()=>new Set)),Ec(this,Do,new Set),jx(this,"disposables",nt()),V0(this,jt,t),Rt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return pt(this,jt)}subscribe(t,n){if(Rt.isServer)return()=>{};let r={selector:t,callback:n,current:t(pt(this,jt))};return pt(this,Do).add(r),this.disposables.add(()=>{pt(this,Do).delete(r)})}on(t,n){return Rt.isServer?()=>{}:(pt(this,ko).get(t).add(n),this.disposables.add(()=>{pt(this,ko).get(t).delete(n)}))}send(t){let n=this.reduce(pt(this,jt),t);if(n!==pt(this,jt)){V0(this,jt,n);for(let r of pt(this,Do)){let o=r.selector(pt(this,jt));q0(r.current,o)||(r.current=o,r.callback(o))}for(let r of pt(this,ko).get(t.type))r(pt(this,jt),t)}}};jt=new WeakMap,ko=new WeakMap,Do=new WeakMap;function q0(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Sc(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Sc(e.entries(),t.entries()):Z0(e)&&Z0(t)?Sc(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Sc(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Z0(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Pc(e){let[t,n]=e(),r=nt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var _x=Object.defineProperty,zx=(e,t,n)=>t in e?_x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K0=(e,t,n)=>(zx(e,typeof t!="symbol"?t+"":t,n),n),Y0=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Y0||{});let Ux={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Wx=class Mm extends G0{constructor(){super(...arguments),K0(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),K0(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Mm({stack:[]})}reduce(t,n){return ft(n.type,Ux,t,n)}};const Tc=new W0(()=>Wx.new());var Ac={exports:{}},$c={};/**
|
|
112
120
|
* @license React
|
|
113
121
|
* use-sync-external-store-with-selector.production.js
|
|
114
122
|
*
|
|
@@ -116,7 +124,7 @@ ${dg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
116
124
|
*
|
|
117
125
|
* This source code is licensed under the MIT license found in the
|
|
118
126
|
* LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/var X0;function
|
|
127
|
+
*/var X0;function Hx(){if(X0)return $c;X0=1;var e=x;function t(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,c=e.useDebugValue;return $c.useSyncExternalStoreWithSelector=function(a,l,u,f,p){var d=o(null);if(d.current===null){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=i(function(){function v(M){if(!T){if(T=!0,E=M,M=f(M),p!==void 0&&h.hasValue){var B=h.value;if(p(B,M))return S=B}return S=M}if(B=S,n(E,M))return B;var F=f(M);return p!==void 0&&p(B,F)?(E=M,B):(E=M,S=F)}var T=!1,E,S,C=u===void 0?null:u;return[function(){return v(l())},C===null?void 0:function(){return v(C())}]},[l,u,f,p]);var m=r(a,d[0],d[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),c(m),m},$c}var Nc={};/**
|
|
120
128
|
* @license React
|
|
121
129
|
* use-sync-external-store-with-selector.development.js
|
|
122
130
|
*
|
|
@@ -124,49 +132,49 @@ ${dg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
124
132
|
*
|
|
125
133
|
* This source code is licensed under the MIT license found in the
|
|
126
134
|
* LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/var Q0;function Ux(){return Q0||(Q0=1,process.env.NODE_ENV!=="production"&&function(){function e(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=x,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;Oc.useSyncExternalStoreWithSelector=function(a,u,l,f,p){var d=o(null);if(d.current===null){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=i(function(){function w(B){if(!$){if($=!0,E=B,B=f(B),p!==void 0&&h.hasValue){var F=h.value;if(p(F,B))return S=F}return S=B}if(F=S,n(E,B))return F;var D=f(B);return p!==void 0&&p(F,D)?(E=B,F):(E=B,S=D)}var $=!1,E,S,N=l===void 0?null:l;return[function(){return w(u())},N===null?void 0:function(){return w(N())}]},[u,l,f,p]);var m=r(a,d[0],d[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),c(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Oc}process.env.NODE_ENV==="production"?Tc.exports=_x():Tc.exports=Ux();var zx=Tc.exports;function qe(e,t,n=q0){return zx.useSyncExternalStoreWithSelector(le(r=>e.subscribe(Hx,r)),le(()=>e.state),le(()=>e.state),le(t),n)}function Hx(e){return e}function J0(e,t){let n=x.useId(),r=$c.get(t),[o,s]=qe(r,x.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Ee(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Nc=new Map,Bo=new Map;function ep(e){var t;let n=(t=Bo.get(e))!=null?t:0;return Bo.set(e,n+1),n!==0?()=>tp(e):(Nc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>tp(e))}function tp(e){var t;let n=(t=Bo.get(e))!=null?t:1;if(n===1?Bo.delete(e):Bo.set(e,n-1),n!==1)return;let r=Nc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Nc.delete(e))}function Wx(e,{allowed:t,disallowed:n}={}){let r=J0(e,"inert-others");Ee(()=>{var o,s;if(!r)return;let i=nt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(ep(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let u=ks(a);if(!u)continue;let l=a.parentElement;for(;l&&l!==u.body;){for(let f of l.children)c.some(p=>f.contains(p))||i.add(ep(f));l=l.parentElement}}return i.dispose},[r,t,n])}function Vx(e,t,n){let r=qn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});x.useEffect(()=>{if(!e)return;let o=t===null?null:on(t)?t:t.current;if(!o)return;let s=nt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let Cc=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Gx=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ic=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Ic||{}),qx=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(qx||{}),Zx=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Zx||{});function np(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Cc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Yx(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Gx)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Mc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Mc||{});function rp(e,t=0){var n;return e===((n=ks(e))==null?void 0:n.body)?!1:ft(t,{0(){return e.matches(Cc)},1(){let r=e;for(;r!==null;){if(r.matches(Cc))return!0;r=r.parentElement}return!1}})}var Kx=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Kx||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Xx=["textarea","input"].join(",");function Qx(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Xx))!=null?n:!1}function op(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Jx(e,t,n=e===null?document.body:Bs(e)){return e2(np(n),t,{relativeTo:e})}function e2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Bs(e[0]):document:Bs(e),i=Array.isArray(e)?n?op(e):e:t&64?Yx(e):np(e);o.length>0&&i.length>1&&(i=i.filter(d=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===d:h===d))),r=r??(s==null?void 0:s.activeElement);let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},l=0,f=i.length,p;do{if(l>=f||l+f<=0)return 0;let d=a+l;if(t&16)d=(d+f)%f;else{if(d<0)return 3;if(d>=f)return 1}p=i[d],p==null||p.focus(u),l+=c}while(p!==S0(p));return t&6&&Qx(p)&&p.select(),2}function sp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function t2(){return/Android/gi.test(window.navigator.userAgent)}function ip(){return sp()||t2()}function Pr(e,t,n,r){let o=qn(n);x.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function n2(e,t,n,r){let o=qn(n);x.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const ap=30;function r2(e,t,n){let r=qn(n),o=x.useCallback(function(c,a){if(c.defaultPrevented)return;let u=a(c);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let l=function f(p){return typeof p=="function"?f(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let f of l)if(f!==null&&(f.contains(u)||c.composed&&c.composedPath().includes(f)))return;return!rp(u,Mc.Loose)&&u.tabIndex!==-1&&c.preventDefault(),r.current(c,u)},[r,t]),s=x.useRef(null);Pr(e,"pointerdown",c=>{var a,u;ip()||(s.current=((u=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:u[0])||c.target)},!0),Pr(e,"pointerup",c=>{if(ip()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=x.useRef({x:0,y:0});Pr(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Pr(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=ap||Math.abs(a.y-i.current.y)>=ap))return o(c,()=>Sr(c.target)?c.target:null)},!0),n2(e,"blur",c=>o(c,()=>mx(window.document.activeElement)?window.document.activeElement:null),!0)}function kc(...e){return x.useMemo(()=>ks(...e),[...e])}var o2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(o2||{});const js={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},s2=200,cp=5;function i2(e,{trigger:t,action:n,close:r,select:o}){let s=x.useRef(null),i=x.useRef(null),c=x.useRef(null);Pr(e&&t!==null,"pointerdown",a=>{M0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Pr(e&&t!==null,"pointerup",a=>{var u,l;let f=s.current;if(f===null||(s.current=null,!Sr(a.target))||Math.abs(a.x-((u=i.current)!=null?u:a.x))<cp&&Math.abs(a.y-((l=c.current)!=null?l:a.y))<cp)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-f>s2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function a2(e,t){return x.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function c2(e){return x.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function u2(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(c=>c()))}}}function l2(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function f2(){return sp()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let c=nt();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",c=>{if(Sr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:u}=new URL(a.href),l=e.querySelector(u);Sr(l)&&!r(l)&&(i=l)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Sr(a.target)&&hx(a.target))if(r(a.target)){let u=a.target;for(;u.parentElement&&r(u.parentElement);)u=u.parentElement;c.style(u,"overscrollBehavior","contain")}else c.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",c=>{if(Sr(c.target)){if(k0(c.target))return;if(r(c.target)){let a=c.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()}},{passive:!1}),t.add(()=>{var c;let a=(c=window.scrollY)!=null?c:window.pageYOffset;s!==a&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function d2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function up(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Zn=u2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:nt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=up(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=up(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[f2(),l2(),d2()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Zn.subscribe(()=>{let e=Zn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Zn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Zn.dispatch("TEARDOWN",n)}});function p2(e,t,n=()=>({containers:[]})){let r=c2(Zn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Ee(()=>{if(!(!t||!e))return Zn.dispatch("PUSH",t,n),()=>Zn.dispatch("POP",t,n)},[e,t]),s}function h2(e,t,n=()=>[document.body]){let r=J0(e,"scroll-lock");p2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function lp(e){return[e.screenX,e.screenY]}function m2(){let e=x.useRef([-1,-1]);return{wasMoved(t){let n=lp(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=lp(t)}}}function b2(e=0){let[t,n]=x.useState(e),r=x.useCallback(a=>n(a),[]),o=x.useCallback(a=>n(u=>u|a),[]),s=x.useCallback(a=>(t&a)===a,[t]),i=x.useCallback(a=>n(u=>u&~a),[]),c=x.useCallback(a=>n(u=>u^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var fp,dp;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((fp=process==null?void 0:process.env)==null?void 0:fp.NODE_ENV)==="test"&&typeof((dp=Element==null?void 0:Element.prototype)==null?void 0:dp.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
128
|
-
`)),[]});var
|
|
135
|
+
*/var Q0;function Vx(){return Q0||(Q0=1,process.env.NODE_ENV!=="production"&&function(){function e(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=x,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;Nc.useSyncExternalStoreWithSelector=function(a,l,u,f,p){var d=o(null);if(d.current===null){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=i(function(){function v(M){if(!T){if(T=!0,E=M,M=f(M),p!==void 0&&h.hasValue){var B=h.value;if(p(B,M))return S=B}return S=M}if(B=S,n(E,M))return B;var F=f(M);return p!==void 0&&p(B,F)?(E=M,B):(E=M,S=F)}var T=!1,E,S,C=u===void 0?null:u;return[function(){return v(l())},C===null?void 0:function(){return v(C())}]},[l,u,f,p]);var m=r(a,d[0],d[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),c(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Nc}process.env.NODE_ENV==="production"?Ac.exports=Hx():Ac.exports=Vx();var Gx=Ac.exports;function qe(e,t,n=q0){return Gx.useSyncExternalStoreWithSelector(ue(r=>e.subscribe(qx,r)),ue(()=>e.state),ue(()=>e.state),ue(t),n)}function qx(e){return e}function J0(e,t){let n=x.useId(),r=Tc.get(t),[o,s]=qe(r,x.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Ee(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Cc=new Map,Mo=new Map;function ep(e){var t;let n=(t=Mo.get(e))!=null?t:0;return Mo.set(e,n+1),n!==0?()=>tp(e):(Cc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>tp(e))}function tp(e){var t;let n=(t=Mo.get(e))!=null?t:1;if(n===1?Mo.delete(e):Mo.set(e,n-1),n!==1)return;let r=Cc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Cc.delete(e))}function Zx(e,{allowed:t,disallowed:n}={}){let r=J0(e,"inert-others");Ee(()=>{var o,s;if(!r)return;let i=nt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(ep(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let l=Ds(a);if(!l)continue;let u=a.parentElement;for(;u&&u!==l.body;){for(let f of u.children)c.some(p=>f.contains(p))||i.add(ep(f));u=u.parentElement}}return i.dispose},[r,t,n])}function Kx(e,t,n){let r=qn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});x.useEffect(()=>{if(!e)return;let o=t===null?null:on(t)?t:t.current;if(!o)return;let s=nt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let Oc=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Yx=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ic=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Ic||{}),Xx=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Xx||{}),Qx=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Qx||{});function np(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Oc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Jx(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Yx)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var kc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(kc||{});function rp(e,t=0){var n;return e===((n=Ds(e))==null?void 0:n.body)?!1:ft(t,{0(){return e.matches(Oc)},1(){let r=e;for(;r!==null;){if(r.matches(Oc))return!0;r=r.parentElement}return!1}})}var e2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(e2||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let t2=["textarea","input"].join(",");function n2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,t2))!=null?n:!1}function op(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function r2(e,t,n=e===null?document.body:Ms(e)){return o2(np(n),t,{relativeTo:e})}function o2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Ms(e[0]):document:Ms(e),i=Array.isArray(e)?n?op(e):e:t&64?Jx(e):np(e);o.length>0&&i.length>1&&(i=i.filter(d=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===d:h===d))),r=r??(s==null?void 0:s.activeElement);let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},u=0,f=i.length,p;do{if(u>=f||u+f<=0)return 0;let d=a+u;if(t&16)d=(d+f)%f;else{if(d<0)return 3;if(d>=f)return 1}p=i[d],p==null||p.focus(l),u+=c}while(p!==S0(p));return t&6&&n2(p)&&p.select(),2}function sp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function s2(){return/Android/gi.test(window.navigator.userAgent)}function ip(){return sp()||s2()}function Pr(e,t,n,r){let o=qn(n);x.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function i2(e,t,n,r){let o=qn(n);x.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const ap=30;function a2(e,t,n){let r=qn(n),o=x.useCallback(function(c,a){if(c.defaultPrevented)return;let l=a(c);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=function f(p){return typeof p=="function"?f(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let f of u)if(f!==null&&(f.contains(l)||c.composed&&c.composedPath().includes(f)))return;return!rp(l,kc.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),s=x.useRef(null);Pr(e,"pointerdown",c=>{var a,l;ip()||(s.current=((l=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:l[0])||c.target)},!0),Pr(e,"pointerup",c=>{if(ip()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=x.useRef({x:0,y:0});Pr(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Pr(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=ap||Math.abs(a.y-i.current.y)>=ap))return o(c,()=>Sr(c.target)?c.target:null)},!0),i2(e,"blur",c=>o(c,()=>vx(window.document.activeElement)?window.document.activeElement:null),!0)}function Dc(...e){return x.useMemo(()=>Ds(...e),[...e])}var c2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(c2||{});const js={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},l2=200,cp=5;function u2(e,{trigger:t,action:n,close:r,select:o}){let s=x.useRef(null),i=x.useRef(null),c=x.useRef(null);Pr(e&&t!==null,"pointerdown",a=>{k0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Pr(e&&t!==null,"pointerup",a=>{var l,u;let f=s.current;if(f===null||(s.current=null,!Sr(a.target))||Math.abs(a.x-((l=i.current)!=null?l:a.x))<cp&&Math.abs(a.y-((u=c.current)!=null?u:a.y))<cp)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-f>l2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function f2(e,t){return x.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function d2(e){return x.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function p2(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(c=>c()))}}}function h2(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function m2(){return sp()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let c=nt();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",c=>{if(Sr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),u=e.querySelector(l);Sr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Sr(a.target)&&yx(a.target))if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;c.style(l,"overscrollBehavior","contain")}else c.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",c=>{if(Sr(c.target)){if(D0(c.target))return;if(r(c.target)){let a=c.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()}},{passive:!1}),t.add(()=>{var c;let a=(c=window.scrollY)!=null?c:window.pageYOffset;s!==a&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function b2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function lp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Zn=p2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:nt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=lp(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=lp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[m2(),h2(),b2()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Zn.subscribe(()=>{let e=Zn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Zn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Zn.dispatch("TEARDOWN",n)}});function g2(e,t,n=()=>({containers:[]})){let r=d2(Zn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Ee(()=>{if(!(!t||!e))return Zn.dispatch("PUSH",t,n),()=>Zn.dispatch("POP",t,n)},[e,t]),s}function y2(e,t,n=()=>[document.body]){let r=J0(e,"scroll-lock");g2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function up(e){return[e.screenX,e.screenY]}function v2(){let e=x.useRef([-1,-1]);return{wasMoved(t){let n=up(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=up(t)}}}function w2(e=0){let[t,n]=x.useState(e),r=x.useCallback(a=>n(a),[]),o=x.useCallback(a=>n(l=>l|a),[]),s=x.useCallback(a=>(t&a)===a,[t]),i=x.useCallback(a=>n(l=>l&~a),[]),c=x.useCallback(a=>n(l=>l^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var fp,dp;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((fp=process==null?void 0:process.env)==null?void 0:fp.NODE_ENV)==="test"&&typeof((dp=Element==null?void 0:Element.prototype)==null?void 0:dp.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
136
|
+
`)),[]});var x2=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(x2||{});function pp(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function hp(e,t,n,r){let[o,s]=x.useState(n),{hasFlag:i,addFlag:c,removeFlag:a}=w2(e&&o?3:0),l=x.useRef(!1),u=x.useRef(!1),f=Gn();return Ee(()=>{var p;if(e){if(n&&s(!0),!t){n&&c(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),E2(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(c(3),a(4)):(c(4),a(2)))},run(){u.current?n?(a(3),c(4)):(a(4),c(3)):n?a(1):c(1)},done(){var d;u.current&&T2(t)||(l.current=!1,a(7),n||s(!1),(d=r==null?void 0:r.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function E2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=nt();return P2(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(S2(e,r))})}),s.dispose}function S2(e,t){var n,r;let o=nt();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(c=>c instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(c=>c.finished)).then(()=>{s||t()}),o.dispose)}function P2(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function T2(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function _s(){return typeof window<"u"}function Tr(e){return Mc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _t(e){var t;return(t=(Mc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mc(e){return _s()?e instanceof Node||e instanceof Ze(e).Node:!1}function fe(e){return _s()?e instanceof Element||e instanceof Ze(e).Element:!1}function Fe(e){return _s()?e instanceof HTMLElement||e instanceof Ze(e).HTMLElement:!1}function Lc(e){return!_s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ze(e).ShadowRoot}const A2=new Set(["inline","contents"]);function Lo(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!A2.has(o)}const $2=new Set(["table","td","th"]);function N2(e){return $2.has(Tr(e))}const C2=[":popover-open",":modal"];function zs(e){return C2.some(t=>{try{return e.matches(t)}catch{return!1}})}const O2=["transform","translate","scale","rotate","perspective"],I2=["transform","translate","scale","rotate","perspective","filter"],k2=["paint","layout","strict","content"];function Bc(e){const t=Us(),n=fe(e)?ht(e):e;return O2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||I2.some(r=>(n.willChange||"").includes(r))||k2.some(r=>(n.contain||"").includes(r))}function D2(e){let t=an(e);for(;Fe(t)&&!sn(t);){if(Bc(t))return t;if(zs(t))return null;t=an(t)}return null}function Us(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const M2=new Set(["html","body","#document"]);function sn(e){return M2.has(Tr(e))}function ht(e){return Ze(e).getComputedStyle(e)}function Ws(e){return fe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function an(e){if(Tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lc(e)&&e.host||_t(e);return Lc(t)?t.host:t}function mp(e){const t=an(e);return sn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fe(t)&&Lo(t)?t:mp(t)}function An(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=mp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ze(o);if(s){const c=Fc(i);return t.concat(i,i.visualViewport||[],Lo(o)?o:[],c&&n?An(c):[])}return t.concat(o,An(o,[],n))}function Fc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function L2(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const cn=Math.min,De=Math.max,Bo=Math.round,Hs=Math.floor,zt=e=>({x:e,y:e}),B2={left:"right",right:"left",bottom:"top",top:"bottom"},F2={start:"end",end:"start"};function Rc(e,t,n){return De(e,cn(t,n))}function Kn(e,t){return typeof e=="function"?e(t):e}function $n(e){return e.split("-")[0]}function Ar(e){return e.split("-")[1]}function bp(e){return e==="x"?"y":"x"}function jc(e){return e==="y"?"height":"width"}const R2=new Set(["top","bottom"]);function ln(e){return R2.has($n(e))?"y":"x"}function _c(e){return bp(ln(e))}function j2(e,t,n){n===void 0&&(n=!1);const r=Ar(e),o=_c(e),s=jc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Vs(i)),[i,Vs(i)]}function _2(e){const t=Vs(e);return[zc(e),t,zc(t)]}function zc(e){return e.replace(/start|end/g,t=>F2[t])}const gp=["left","right"],yp=["right","left"],z2=["top","bottom"],U2=["bottom","top"];function W2(e,t,n){switch(e){case"top":case"bottom":return n?t?yp:gp:t?gp:yp;case"left":case"right":return t?z2:U2;default:return[]}}function H2(e,t,n,r){const o=Ar(e);let s=W2($n(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(zc)))),s}function Vs(e){return e.replace(/left|right|bottom|top/g,t=>B2[t])}function V2(e){return{top:0,right:0,bottom:0,left:0,...e}}function vp(e){return typeof e!="number"?V2(e):{top:e,right:e,bottom:e,left:e}}function Gs(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
129
137
|
* tabbable 6.3.0
|
|
130
138
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
131
|
-
*/var z2=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],zc=z2.join(","),vp=typeof Element>"u",Do=vp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qs=!vp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ro=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&Ro(t.parentNode);return i},H2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},W2=function(t,n,r){if(Ro(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(zc));return n&&Do.call(t,zc)&&o.unshift(t),o=o.filter(r),o},Hc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ro(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,u=Hc(a,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else{var l=Do.call(i,zc);l&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Ro(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var d=Hc(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},xp=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ep=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||H2(t))&&!xp(t)?0:t.tabIndex},V2=function(t,n){var r=Ep(t);return r<0&&n&&!xp(t)?0:r},G2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sp=function(t){return t.tagName==="INPUT"},q2=function(t){return Sp(t)&&t.type==="hidden"},Z2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Y2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},K2=function(t){if(!t.name)return!0;var n=t.form||qs(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Y2(o,t.form);return!s||s===t},X2=function(t){return Sp(t)&&t.type==="radio"},Q2=function(t){return X2(t)&&!K2(t)},J2=function(t){var n,r=t&&qs(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,c,a;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var u,l,f;r=qs(o),o=(u=r)===null||u===void 0?void 0:u.host,s=!!((l=o)!==null&&l!==void 0&&(f=l.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},Pp=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},eE=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Do.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Do.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var u=t.parentElement,l=qs(t);if(u&&!u.shadowRoot&&o(u)===!0)return Pp(t);t.assignedSlot?t=t.assignedSlot:!u&&l!==t.ownerDocument?t=l.host:t=u}t=a}if(J2(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Pp(t);return!1},tE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Do.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},nE=function(t,n){return!(n.disabled||Ro(n)||q2(n)||eE(n,t)||Z2(n)||tE(n))},$p=function(t,n){return!(Q2(n)||Ep(n)<0||!nE(t,n))},rE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Tp=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=V2(c,i),u=i?Tp(o.candidates):c;a===0?i?n.push.apply(n,u):n.push(c):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:u})}),r.sort(G2).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ap=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Hc([t],n.includeContainer,{filter:$p.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:rE}):r=W2(t,n.includeContainer,$p.bind(null,n)),Tp(r)};function Op(e,t,n){let{reference:r,floating:o}=e;const s=un(t),i=_c(t),c=jc(i),a=An(t),u=s==="y",l=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let d;switch(a){case"top":d={x:l,y:r.y-o.height};break;case"bottom":d={x:l,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Tr(t)){case"start":d[i]-=p*(n&&u?-1:1);break;case"end":d[i]+=p*(n&&u?-1:1);break}return d}const oE=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:f}=Op(u,r,a),p=r,d={},h=0;for(let m=0;m<c.length;m++){const{name:w,fn:$}=c[m],{x:E,y:S,data:N,reset:B}=await $({x:l,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:u,platform:i,elements:{reference:e,floating:t}});l=E??l,f=S??f,d={...d,[w]:{...d[w],...N}},B&&h<=50&&(h++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(u=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):B.rects),{x:l,y:f}=Op(u,p,a)),m=-1)}return{x:l,y:f,placement:p,strategy:o,middlewareData:d}};async function Zs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=Yn(t,e),h=wp(d),w=c[p?f==="floating"?"reference":"floating":f],$=Gs(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:l,strategy:a})),E=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),N=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},B=Gs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:S,strategy:a}):E);return{top:($.top-B.top+h.top)/N.y,bottom:(B.bottom-$.bottom+h.bottom)/N.y,left:($.left-B.left+h.left)/N.x,right:(B.right-$.right+h.right)/N.x}}const sE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:u,padding:l=0}=Yn(e,t)||{};if(u==null)return{};const f=wp(l),p={x:n,y:r},d=_c(o),h=jc(d),m=await i.getDimensions(u),w=d==="y",$=w?"top":"left",E=w?"bottom":"right",S=w?"clientHeight":"clientWidth",N=s.reference[h]+s.reference[d]-p[d]-s.floating[h],B=p[d]-s.reference[d],F=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let D=F?F[S]:0;(!D||!await(i.isElement==null?void 0:i.isElement(F)))&&(D=c.floating[S]||s.floating[h]);const b=N/2-B/2,g=D/2-m[h]/2-1,v=cn(f[$],g),C=cn(f[E],g),O=v,I=D-m[h]-C,M=D/2-m[h]/2+b,y=Rc(O,M,I),A=!a.arrow&&Tr(o)!=null&&M!==y&&s.reference[h]/2-(M<O?v:C)-m[h]/2<0,T=A?M<O?M-O:M-I:0;return{[d]:p[d]+T,data:{[d]:y,centerOffset:M-y-T,...A&&{alignmentOffset:T}},reset:A}}}),iE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:u}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...w}=Yn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const $=An(o),E=un(c),S=An(c)===c,N=await(a.isRTL==null?void 0:a.isRTL(u.floating)),B=p||(S||!m?[Vs(c)]:F2(c)),F=h!=="none";!p&&F&&B.push(..._2(c,m,h,N));const D=[c,...B],b=await Zs(t,w),g=[];let v=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&g.push(b[$]),f){const M=L2(o,i,N);g.push(b[M[0]],b[M[1]])}if(v=[...v,{placement:o,overflows:g}],!g.every(M=>M<=0)){var C,O;const M=(((C=s.flip)==null?void 0:C.index)||0)+1,y=D[M];if(y&&(!(f==="alignment"?E!==un(y):!1)||v.every(P=>un(P.placement)===E?P.overflows[0]>0:!0)))return{data:{index:M,overflows:v},reset:{placement:y}};let A=(O=v.filter(T=>T.overflows[0]<=0).sort((T,P)=>T.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!A)switch(d){case"bestFit":{var I;const T=(I=v.filter(P=>{if(F){const L=un(P.placement);return L===E||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:I[0];T&&(A=T);break}case"initialPlacement":A=c;break}if(o!==A)return{reset:{placement:A}}}return{}}}},aE=new Set(["left","top"]);async function cE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=An(n),c=Tr(n),a=un(n)==="y",u=aE.has(i)?-1:1,l=s&&a?-1:1,f=Yn(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),a?{x:d*l,y:p*u}:{x:p*u,y:d*l}}const uE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,a=await cE(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},lE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:w=>{let{x:$,y:E}=w;return{x:$,y:E}}},...a}=Yn(e,t),u={x:n,y:r},l=await Zs(t,a),f=un(An(o)),p=bp(f);let d=u[p],h=u[f];if(s){const w=p==="y"?"top":"left",$=p==="y"?"bottom":"right",E=d+l[w],S=d-l[$];d=Rc(E,d,S)}if(i){const w=f==="y"?"top":"left",$=f==="y"?"bottom":"right",E=h+l[w],S=h-l[$];h=Rc(E,h,S)}const m=c.fn({...t,[p]:d,[f]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:s,[f]:i}}}}}},fE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...u}=Yn(e,t),l=await Zs(t,u),f=An(o),p=Tr(o),d=un(o)==="y",{width:h,height:m}=s.floating;let w,$;f==="top"||f==="bottom"?(w=f,$=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):($=f,w=p==="end"?"top":"bottom");const E=m-l.top-l.bottom,S=h-l.left-l.right,N=cn(m-l[w],E),B=cn(h-l[$],S),F=!t.middlewareData.shift;let D=N,b=B;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=E),F&&!p){const v=ke(l.left,0),C=ke(l.right,0),O=ke(l.top,0),I=ke(l.bottom,0);d?b=h-2*(v!==0||C!==0?v+C:ke(l.left,l.right)):D=m-2*(O!==0||I!==0?O+I:ke(l.top,l.bottom))}await a({...t,availableWidth:b,availableHeight:D});const g=await i.getDimensions(c.floating);return h!==g.width||m!==g.height?{reset:{rects:!0}}:{}}}};function Np(e){const t=ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=De(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Fo(n)!==s||Fo(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Wc(e){return fe(e)?e:e.contextElement}function Ar(e){const t=Wc(e);if(!De(t))return Ut(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Np(t);let i=(s?Fo(n.width):n.width)/r,c=(s?Fo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const dE=Ut(0);function Cp(e){const t=Ze(e);return!zs()||!t.visualViewport?dE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ze(e)?!1:t}function Kn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Wc(e);let i=Ut(1);t&&(r?fe(r)&&(i=Ar(r)):i=Ar(e));const c=pE(s,n,r)?Cp(s):Ut(0);let a=(o.left+c.x)/i.x,u=(o.top+c.y)/i.y,l=o.width/i.x,f=o.height/i.y;if(s){const p=Ze(s),d=r&&fe(r)?Ze(r):r;let h=p,m=Dc(h);for(;m&&r&&d!==h;){const w=Ar(m),$=m.getBoundingClientRect(),E=ht(m),S=$.left+(m.clientLeft+parseFloat(E.paddingLeft))*w.x,N=$.top+(m.clientTop+parseFloat(E.paddingTop))*w.y;a*=w.x,u*=w.y,l*=w.x,f*=w.y,a+=S,u+=N,h=Ze(m),m=Dc(h)}}return Gs({width:l,height:f,x:a,y:u})}function Ys(e,t){const n=Hs(e).scrollLeft;return t?t.left+n:Kn(_t(e)).left+n}function Ip(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ys(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function hE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=_t(r),c=t?Us(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},u=Ut(1);const l=Ut(0),f=De(r);if((f||!f&&!s)&&(($r(r)!=="body"||Lo(i))&&(a=Hs(r)),De(r))){const d=Kn(r);u=Ar(r),l.x=d.x+r.clientLeft,l.y=d.y+r.clientTop}const p=i&&!f&&!s?Ip(i,a):Ut(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+l.x+p.x,y:n.y*u.y-a.scrollTop*u.y+l.y+p.y}}function mE(e){return Array.from(e.getClientRects())}function bE(e){const t=_t(e),n=Hs(e),r=e.ownerDocument.body,o=ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ys(e);const c=-n.scrollTop;return ht(r).direction==="rtl"&&(i+=ke(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Mp=25;function gE(e,t){const n=Ze(e),r=_t(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,a=0;if(o){s=o.width,i=o.height;const l=zs();(!l||l&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const u=Ys(r);if(u<=0){const l=r.ownerDocument,f=l.body,p=getComputedStyle(f),d=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-d);h<=Mp&&(s-=h)}else u<=Mp&&(s+=u);return{width:s,height:i,x:c,y:a}}const yE=new Set(["absolute","fixed"]);function wE(e,t){const n=Kn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=De(e)?Ar(e):Ut(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,u=r*s.y;return{width:i,height:c,x:a,y:u}}function kp(e,t,n){let r;if(t==="viewport")r=gE(e,n);else if(t==="document")r=bE(_t(e));else if(fe(t))r=wE(t,n);else{const o=Cp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gs(r)}function Bp(e,t){const n=an(e);return n===t||!fe(n)||sn(n)?!1:ht(n).position==="fixed"||Bp(n,t)}function vE(e,t){const n=t.get(e);if(n)return n;let r=Tn(e,[],!1).filter(c=>fe(c)&&$r(c)!=="body"),o=null;const s=ht(e).position==="fixed";let i=s?an(e):e;for(;fe(i)&&!sn(i);){const c=ht(i),a=Fc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&yE.has(o.position)||Lo(i)&&!a&&Bp(e,i))?r=r.filter(l=>l!==i):o=c,i=an(i)}return t.set(e,r),r}function xE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Us(t)?[]:vE(t,this._c):[].concat(n),r],c=i[0],a=i.reduce((u,l)=>{const f=kp(t,l,o);return u.top=ke(f.top,u.top),u.right=cn(f.right,u.right),u.bottom=cn(f.bottom,u.bottom),u.left=ke(f.left,u.left),u},kp(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function EE(e){const{width:t,height:n}=Np(e);return{width:t,height:n}}function SE(e,t,n){const r=De(t),o=_t(t),s=n==="fixed",i=Kn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Ut(0);function u(){a.x=Ys(o)}if(r||!r&&!s)if(($r(t)!=="body"||Lo(o))&&(c=Hs(t)),r){const d=Kn(t,!0,s,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else o&&u();s&&!r&&o&&u();const l=o&&!r&&!s?Ip(o,c):Ut(0),f=i.left+c.scrollLeft-a.x-l.x,p=i.top+c.scrollTop-a.y-l.y;return{x:f,y:p,width:i.width,height:i.height}}function Vc(e){return ht(e).position==="static"}function Lp(e,t){if(!De(e)||ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _t(e)===n&&(n=n.ownerDocument.body),n}function Fp(e,t){const n=Ze(e);if(Us(e))return n;if(!De(e)){let o=an(e);for(;o&&!sn(o);){if(fe(o)&&!Vc(o))return o;o=an(o)}return n}let r=Lp(e,t);for(;r&&P2(r)&&Vc(r);)r=Lp(r,t);return r&&sn(r)&&Vc(r)&&!Fc(r)?n:r||N2(e)||n}const PE=async function(e){const t=this.getOffsetParent||Fp,n=this.getDimensions,r=await n(e.floating);return{reference:SE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $E(e){return ht(e).direction==="rtl"}const TE={convertOffsetParentRelativeRectToViewportRelativeRect:hE,getDocumentElement:_t,getClippingRect:xE,getOffsetParent:Fp,getElementRects:PE,getClientRects:mE,getDimensions:EE,getScale:Ar,isElement:fe,isRTL:$E};function Dp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function AE(e,t){let n=null,r;const o=_t(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const u=e.getBoundingClientRect(),{left:l,top:f,width:p,height:d}=u;if(c||t(),!p||!d)return;const h=Ws(f),m=Ws(o.clientWidth-(l+p)),w=Ws(o.clientHeight-(f+d)),$=Ws(l),S={rootMargin:-h+"px "+-m+"px "+-w+"px "+-$+"px",threshold:ke(0,cn(1,a))||1};let N=!0;function B(F){const D=F[0].intersectionRatio;if(D!==a){if(!N)return i();D?i(!1,D):r=setTimeout(()=>{i(!1,1e-7)},1e3)}D===1&&!Dp(u,e.getBoundingClientRect())&&i(),N=!1}try{n=new IntersectionObserver(B,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(B,S)}n.observe(e)}return i(!0),s}function Rp(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Wc(e),l=o||s?[...u?Tn(u):[],...Tn(t)]:[];l.forEach($=>{o&&$.addEventListener("scroll",n,{passive:!0}),s&&$.addEventListener("resize",n)});const f=u&&c?AE(u,n):null;let p=-1,d=null;i&&(d=new ResizeObserver($=>{let[E]=$;E&&E.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=d)==null||S.observe(t)})),n()}),u&&!a&&d.observe(u),d.observe(t));let h,m=a?Kn(e):null;a&&w();function w(){const $=Kn(e);m&&!Dp(m,$)&&n(),m=$,h=requestAnimationFrame(w)}return n(),()=>{var $;l.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f==null||f(),($=d)==null||$.disconnect(),d=null,a&&cancelAnimationFrame(h)}}const Gc=Zs,OE=uE,NE=lE,CE=iE,IE=fE,jp=sE,ME=(e,t,n)=>{const r=new Map,o={platform:TE,...n},s={...o.platform,_c:r};return oE(e,t,{...o,platform:s})};var kE=typeof document<"u",BE=function(){},Ks=kE?x.useLayoutEffect:BE;function Xs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Xs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _p(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Up(e,t){const n=_p(e);return Math.round(t*n)/n}function qc(e){const t=U.useRef(e);return Ks(()=>{t.current=e}),t}function zp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:u}=e,[l,f]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=U.useState(r);Xs(p,r)||d(r);const[h,m]=U.useState(null),[w,$]=U.useState(null),E=U.useCallback(P=>{P!==F.current&&(F.current=P,m(P))},[]),S=U.useCallback(P=>{P!==D.current&&(D.current=P,$(P))},[]),N=s||h,B=i||w,F=U.useRef(null),D=U.useRef(null),b=U.useRef(l),g=a!=null,v=qc(a),C=qc(o),O=qc(u),I=U.useCallback(()=>{if(!F.current||!D.current)return;const P={placement:t,strategy:n,middleware:p};C.current&&(P.platform=C.current),ME(F.current,D.current,P).then(L=>{const j={...L,isPositioned:O.current!==!1};M.current&&!Xs(b.current,j)&&(b.current=j,Br.flushSync(()=>{f(j)}))})},[p,t,n,C,O]);Ks(()=>{u===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[u]);const M=U.useRef(!1);Ks(()=>(M.current=!0,()=>{M.current=!1}),[]),Ks(()=>{if(N&&(F.current=N),B&&(D.current=B),N&&B){if(v.current)return v.current(N,B,I);I()}},[N,B,I,v,g]);const y=U.useMemo(()=>({reference:F,floating:D,setReference:E,setFloating:S}),[E,S]),A=U.useMemo(()=>({reference:N,floating:B}),[N,B]),T=U.useMemo(()=>{const P={position:n,left:0,top:0};if(!A.floating)return P;const L=Up(A.floating,l.x),j=Up(A.floating,l.y);return c?{...P,transform:"translate("+L+"px, "+j+"px)",..._p(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,c,A.floating,l.x,l.y]);return U.useMemo(()=>({...l,update:I,refs:y,elements:A,floatingStyles:T}),[l,I,y,A,T])}const LE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jp({element:r.current,padding:o}).fn(n):{}:r?jp({element:r,padding:o}).fn(n):{}}}},Zc=(e,t)=>({...OE(e),options:[e,t]}),Hp=(e,t)=>({...NE(e),options:[e,t]}),Wp=(e,t)=>({...CE(e),options:[e,t]}),FE=(e,t)=>({...IE(e),options:[e,t]}),DE=(e,t)=>({...LE(e),options:[e,t]}),Vp={...U},RE=Vp.useInsertionEffect||(e=>e());function Gp(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return RE(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Yc=typeof document<"u"?x.useLayoutEffect:x.useEffect;let qp=!1,jE=0;const Zp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+jE++;function _E(){const[e,t]=U.useState(()=>qp?Zp():void 0);return Yc(()=>{e==null&&t(Zp())},[]),U.useEffect(()=>{qp=!0},[]),e}const UE=Vp.useId||_E;let jo;process.env.NODE_ENV!=="production"&&(jo=new Set);function zE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=jo)!=null&&e.has(o))){var s;(s=jo)==null||s.add(o),console.warn(o)}}function HE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=jo)!=null&&e.has(o))){var s;(s=jo)==null||s.add(o),console.error(o)}}function WE(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const VE=U.createContext(null),GE=U.createContext(null),qE=()=>{var e;return((e=U.useContext(VE))==null?void 0:e.id)||null},ZE=()=>U.useContext(GE),YE="data-floating-ui-focusable";function KE(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=UE(),s=U.useRef({}),[i]=U.useState(()=>WE()),c=qE()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!fe(d)&&HE("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,u]=U.useState(r.reference),l=Gp((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=U.useMemo(()=>({setPositionReference:u}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:l,elements:p,events:i,floatingId:o,refs:f}),[t,l,p,i,o,f])}function XE(e){e===void 0&&(e={});const{nodeId:t}=e,n=KE({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[c,a]=U.useState(null),l=(o==null?void 0:o.domReference)||s,f=U.useRef(null),p=ZE();Yc(()=>{l&&(f.current=l)},[l]);const d=zp({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(S=>{const N=fe(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;a(N),d.refs.setReference(N)},[d.refs]),m=U.useCallback(S=>{(fe(S)||S===null)&&(f.current=S,i(S)),(fe(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!fe(S))&&d.refs.setReference(S)},[d.refs]),w=U.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),$=U.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),E=U.useMemo(()=>({...d,...r,refs:w,elements:$,nodeId:t}),[d,w,$,t,r]);return Yc(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(N=>N.id===t);S&&(S.context=E)}),U.useMemo(()=>({...d,context:E,refs:w,elements:$}),[d,w,$,E])}const Yp="active",Kp="selected";function Kc(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Yp]:i,[Kp]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[YE]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[u,l]=a;if(!(o&&[Yp,Kp].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof l=="function"){var f;(f=r.get(u))==null||f.push(l),i[u]=function(){for(var p,d=arguments.length,h=new Array(d),m=0;m<d;m++)h[m]=arguments[m];return(p=r.get(u))==null?void 0:p.map(w=>w(...h)).find(w=>w!==void 0)}}}else i[u]=l}),i),{})}}function QE(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=U.useCallback(c=>Kc(c,e,"reference"),t),s=U.useCallback(c=>Kc(c,e,"floating"),n),i=U.useCallback(c=>Kc(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function Xp(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const JE=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:c=4,referenceOverflowThreshold:a=0,scrollRef:u,...l}=Yn(e,t),{rects:f,elements:{floating:p}}=t,d=n.current[i],h=(u==null?void 0:u.current)||p,m=p.clientTop||h.clientTop,w=p.clientTop!==0,$=h.clientTop!==0,E=p===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||zE('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const S={...t,...await Zc(-d.offsetTop-p.clientTop-f.reference.height/2-d.offsetHeight/2-s).fn(t)},N=await Gc(Xp(S,h.scrollHeight+m+p.clientTop),l),B=await Gc(S,{...l,elementContext:"reference"}),F=ke(0,N.top),D=S.y+F,v=(h.scrollHeight>h.clientHeight?C=>C:Fo)(ke(0,h.scrollHeight+(w&&E||$?m*2:0)-F-ke(0,N.bottom)));if(h.style.maxHeight=v+"px",h.scrollTop=F,o){const C=h.offsetHeight<d.offsetHeight*cn(c,n.current.length)-1||B.top>=-a||B.bottom>=-a;Br.flushSync(()=>o(C))}return r&&(r.current=await Gc(Xp({...S,y:D},h.offsetHeight+m+p.clientTop),l)),{y:D}}});function e8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=Gp(c),u=U.useRef(!1),l=U.useRef(null),f=U.useRef(null);U.useEffect(()=>{if(!o)return;function d(m){if(m.ctrlKey||!h||s.current==null)return;const w=m.deltaY,$=s.current.top>=-.5,E=s.current.bottom>=-.5,S=h.scrollHeight-h.clientHeight,N=w<0?-1:1,B=w<0?"max":"min";h.scrollHeight<=h.clientHeight||(!$&&w>0||!E&&w<0?(m.preventDefault(),Br.flushSync(()=>{a(F=>F+Math[B](w,S*N))})):/firefox/i.test(I2())&&(h.scrollTop+=w))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",d),requestAnimationFrame(()=>{l.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{l.current=null,f.current=null,h.removeEventListener("wheel",d)}},[o,n,r.floating,s,i,a]);const p=U.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const d=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!d||!u.current)){if(l.current!==null){const h=d.scrollTop-l.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Br.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{l.current=d.scrollTop})}}}),[r.floating,a,s,i]);return U.useMemo(()=>o?{floating:p}:{},[o,p])}let Or=x.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Or.displayName="FloatingContext";let Xc=x.createContext(null);Xc.displayName="PlacementContext";function t8(e){return x.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function n8(){return x.useContext(Or).setReference}function r8(){return x.useContext(Or).getReferenceProps}function o8(){let{getFloatingProps:e,slot:t}=x.useContext(Or);return x.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function s8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=x.useContext(Xc),n=x.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Ee(()=>{t==null||t(n??null)},[t,n]);let r=x.useContext(Or);return x.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Qp=4;function i8({children:e,enabled:t=!0}){let[n,r]=x.useState(null),[o,s]=x.useState(0),i=x.useRef(null),[c,a]=x.useState(null);a8(c);let u=t&&n!==null&&c!==null,{to:l="bottom",gap:f=0,offset:p=0,padding:d=0,inner:h}=c8(n,c),[m,w="center"]=l.split(" ");Ee(()=>{u&&s(0)},[u]);let{refs:$,floatingStyles:E,context:S}=XE({open:u,placement:m==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${m}`:`${m}-${w}`,strategy:"absolute",transform:!1,middleware:[Zc({mainAxis:m==="selection"?0:f,crossAxis:p}),Hp({padding:d}),m!=="selection"&&Wp({padding:d}),m==="selection"&&h?JE({...h,padding:d,overflowRef:i,offset:o,minItemsVisible:Qp,referenceOverflowThreshold:d,onFallbackChange(C){var O,I;if(!C)return;let M=S.elements.floating;if(!M)return;let y=parseFloat(getComputedStyle(M).scrollPaddingBottom)||0,A=Math.min(Qp,M.childElementCount),T=0,P=0;for(let L of(I=(O=S.elements.floating)==null?void 0:O.childNodes)!=null?I:[])if(on(L)){let j=L.offsetTop,z=j+L.clientHeight+y,_=M.scrollTop,W=_+M.clientHeight;if(j>=_&&z<=W)A--;else{P=Math.max(0,Math.min(z,W)-Math.max(j,_)),T=L.clientHeight;break}}A>=1&&s(L=>{let j=T*A-P+y;return L>=j?L:j})}}):null,FE({padding:d,apply({availableWidth:C,availableHeight:O,elements:I}){Object.assign(I.floating.style,{overflow:"auto",maxWidth:`${C}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${O}px)`})}})].filter(Boolean),whileElementsMounted:Rp}),[N=m,B=w]=S.placement.split("-");m==="selection"&&(N="selection");let F=x.useMemo(()=>({anchor:[N,B].filter(Boolean).join(" ")}),[N,B]),D=e8(S,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:g}=QE([D]),v=le(C=>{a(C),$.setFloating(C)});return U.createElement(Xc.Provider,{value:r},U.createElement(Or.Provider,{value:{setFloating:v,setReference:$.setReference,styles:E,getReferenceProps:b,getFloatingProps:g,slot:F}},e))}function a8(e){Ee(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function c8(e,t){var n,r,o;let s=Qc((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=Qc((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=Qc((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function Qc(e,t,n=void 0){let r=Gn(),o=le((a,u)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!u)return[n,null];let l=eh(a,u);return[l,f=>{let p=Jp(a);{let d=p.map(h=>window.getComputedStyle(u).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[$,E]of p.entries()){let S=window.getComputedStyle(u).getPropertyValue(E);if(d[$]!==S){d[$]=S,m=!0;break}}if(!m)return;let w=eh(a,u);l!==w&&(f(w),l=w)})}return r.dispose}]}return[n,null]}),s=x.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=x.useState();return Ee(()=>{let[a,u]=o(e,t);if(c(a),!!u)return u(c)},[e,t]),i}function Jp(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...Jp(o)]:[r]}return[]}function eh(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function u8({children:e,freeze:t},n){let r=th(t,e);return x.isValidElement(r)?x.cloneElement(r,{ref:n}):x.createElement(x.Fragment,null,r)}x.forwardRef(u8);function th(e,t){let[n,r]=x.useState(t);return!e&&n!==t&&r(t),e?n:t}let Jc=x.createContext(null);Jc.displayName="OpenClosedContext";var Ct=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ct||{});function eu(){return x.useContext(Jc)}function nh({value:e,children:t}){return x.createElement(Jc.Provider,{value:e},t)}function l8(e){throw new Error("Unexpected object: "+e)}var ve=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ve||{});function Qs(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:l8(e)}}function rh(e){let t=le(e),n=x.useRef(!1);x.useEffect(()=>(n.current=!1,()=>{n.current=!0,P0(()=>{n.current&&t()})}),[t])}let f8=x.createContext(!1);function d8(){return x.useContext(f8)}function p8(e){let t=d8(),n=x.useContext(sh),[r,o]=x.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Rt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let c=e.createElement("div");return c.setAttribute("id","headlessui-portal-root"),e.body.appendChild(c)});return x.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),x.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let oh=x.Fragment,h8=Ge(function(e,t){let{ownerDocument:n=null,...r}=e,o=x.useRef(null),s=dt(wx(p=>{o.current=p}),t),i=kc(o.current),c=n??i,a=p8(c),u=x.useContext(y8),l=Gn(),f=rt();return rh(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?je.createPortal(x.createElement("div",{"data-headlessui-portal":"",ref:p=>{l.dispose(),u&&p&&l.add(u.register(p))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:oh,name:"Portal"})),a):null});function m8(e,t){let n=dt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=rt();return r?x.createElement(h8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:oh,name:"Portal"})}let b8=x.Fragment,sh=x.createContext(null);function g8(e,t){let{target:n,...r}=e,o={ref:dt(t)},s=rt();return x.createElement(sh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:b8,name:"Popover.Group"}))}let y8=x.createContext(null),w8=Ge(m8),v8=Ge(g8),x8=Object.assign(w8,{Group:v8});const Js={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ih(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function E8(e,t,n){let r=nt();if(t.kind==="Tracked"){let o=function(){s!==ih(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function S8(){let e=typeof document>"u";return"useSyncExternalStore"in U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function ah(){let e=S8(),[t,n]=U.useState(Rt.isHandoffComplete);return t&&Rt.isHandoffComplete===!1&&n(!1),U.useEffect(()=>{t!==!0&&n(!0)},[t]),U.useEffect(()=>Rt.handoff(),[]),e?!1:t}function P8(){let e=x.useRef(!1);return Ee(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ch(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Io((t=e.as)!=null?t:lh)||x.Children.count(e.children)===1}let ei=x.createContext(null);ei.displayName="TransitionContext";var $8=(e=>(e.Visible="visible",e.Hidden="hidden",e))($8||{});function T8(){let e=x.useContext(ei);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function A8(){let e=x.useContext(ti);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let ti=x.createContext(null);ti.displayName="NestingContext";function ni(e){return"children"in e?ni(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function uh(e,t){let n=qn(e),r=x.useRef([]),o=P8(),s=Gn(),i=le((d,h=Pn.Hidden)=>{let m=r.current.findIndex(({el:w})=>w===d);m!==-1&&(ft(h,{[Pn.Unmount](){r.current.splice(m,1)},[Pn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var w;!ni(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),c=le(d=>{let h=r.current.find(({el:m})=>m===d);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:d,state:"visible"}),()=>i(d,Pn.Unmount)}),a=x.useRef([]),u=x.useRef(Promise.resolve()),l=x.useRef({enter:[],leave:[]}),f=le((d,h,m)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([w])=>w!==d)),t==null||t.chains.current[h].push([d,new Promise(w=>{a.current.push(w)})]),t==null||t.chains.current[h].push([d,new Promise(w=>{Promise.all(l.current[h].map(([$,E])=>E)).then(()=>w())})]),h==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=le((d,h,m)=>{Promise.all(l.current[h].splice(0).map(([w,$])=>$)).then(()=>{var w;(w=a.current.shift())==null||w()}).then(()=>m(h))});return x.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:p,wait:u,chains:l}),[c,i,r,f,p,l,u])}let lh=x.Fragment,fh=Ls.RenderStrategy;function O8(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:c,afterLeave:a,enter:u,enterFrom:l,enterTo:f,entered:p,leave:d,leaveFrom:h,leaveTo:m,...w}=e,[$,E]=x.useState(null),S=x.useRef(null),N=ch(e),B=dt(...N?[S,t,E]:t===null?[]:[t]),F=(n=w.unmount)==null||n?Pn.Unmount:Pn.Hidden,{show:D,appear:b,initial:g}=T8(),[v,C]=x.useState(D?"visible":"hidden"),O=A8(),{register:I,unregister:M}=O;Ee(()=>I(S),[I,S]),Ee(()=>{if(F===Pn.Hidden&&S.current){if(D&&v!=="visible"){C("visible");return}return ft(v,{hidden:()=>M(S),visible:()=>I(S)})}},[v,S,I,M,D,F]);let y=ah();Ee(()=>{if(N&&y&&v==="visible"&&S.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[S,v,y,N]);let A=g&&!b,T=b&&D&&g,P=x.useRef(!1),L=uh(()=>{P.current||(C("hidden"),M(S))},O),j=le(Z=>{P.current=!0;let J=Z?"enter":"leave";L.onStart(S,J,oe=>{oe==="enter"?s==null||s():oe==="leave"&&(c==null||c())})}),z=le(Z=>{let J=Z?"enter":"leave";P.current=!1,L.onStop(S,J,oe=>{oe==="enter"?i==null||i():oe==="leave"&&(a==null||a())}),J==="leave"&&!ni(L)&&(C("hidden"),M(S))});x.useEffect(()=>{N&&o||(j(D),z(D))},[D,N,o]);let _=!(!o||!N||!y||A),[,W]=hp(_,$,D,{start:j,end:z}),K=$n({ref:B,className:((r=yc(w.className,T&&u,T&&l,W.enter&&u,W.enter&&W.closed&&l,W.enter&&!W.closed&&f,W.leave&&d,W.leave&&!W.closed&&h,W.leave&&W.closed&&m,!W.transition&&D&&p))==null?void 0:r.trim())||void 0,...pp(W)}),G=0;v==="visible"&&(G|=Ct.Open),v==="hidden"&&(G|=Ct.Closed),D&&v==="hidden"&&(G|=Ct.Opening),!D&&v==="visible"&&(G|=Ct.Closing);let H=rt();return x.createElement(ti.Provider,{value:L},x.createElement(nh,{value:G},H({ourProps:K,theirProps:w,defaultTag:lh,features:fh,visible:v==="visible",name:"Transition.Child"})))}function N8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=x.useRef(null),c=ch(e),a=dt(...c?[i,t]:t===null?[]:[t]);ah();let u=eu();if(n===void 0&&u!==null&&(n=(u&Ct.Open)===Ct.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,f]=x.useState(n?"visible":"hidden"),p=uh(()=>{n||f("hidden")}),[d,h]=x.useState(!0),m=x.useRef([n]);Ee(()=>{d!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let w=x.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);Ee(()=>{n?f("visible"):!ni(p)&&i.current!==null&&f("hidden")},[n,p]);let $={unmount:o},E=le(()=>{var B;d&&h(!1),(B=e.beforeEnter)==null||B.call(e)}),S=le(()=>{var B;d&&h(!1),(B=e.beforeLeave)==null||B.call(e)}),N=rt();return x.createElement(ti.Provider,{value:p},x.createElement(ei.Provider,{value:w},N({ourProps:{...$,as:x.Fragment,children:x.createElement(dh,{ref:a,...$,...s,beforeEnter:E,beforeLeave:S})},theirProps:{},defaultTag:x.Fragment,features:fh,visible:l==="visible",name:"Transition"})))}function C8(e,t){let n=x.useContext(ei)!==null,r=eu()!==null;return x.createElement(x.Fragment,null,!n&&r?x.createElement(tu,{ref:t,...e}):x.createElement(dh,{ref:t,...e}))}let tu=Ge(N8),dh=Ge(O8),I8=Ge(C8),nu=Object.assign(tu,{Child:I8,Root:tu}),ph=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function hh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!on(o))return r;let s=!1;for(let c of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))c.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return ph.test(i)&&(i=i.replace(ph,"")),i}function M8(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():hh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return hh(e).trim()}function k8(e){let t=x.useRef(""),n=x.useRef("");return le(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=M8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var B8=Object.defineProperty,L8=(e,t,n)=>t in e?B8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mh=(e,t,n)=>(L8(e,typeof t!="symbol"?t+"":t,n),n),Be=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Be||{}),On=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(On||{}),ri=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ri||{}),bh=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(bh||{});function gh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=op(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let F8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Js.Tracked(ih(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:ve.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Js.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let c={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ve.Nothing)return{...c,activeOptionIndex:null};if(t.focus===ve.Specific)return{...c,activeOptionIndex:e.options.findIndex(l=>l.id===t.id)};if(t.focus===ve.Previous){let l=e.activeOptionIndex;if(l!==null){let f=e.options[l].dataRef.current.domRef,p=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===d.current||((o=d.current)==null?void 0:o.previousElementSibling)===null)return{...c,activeOptionIndex:p}}}}else if(t.focus===ve.Next){let l=e.activeOptionIndex;if(l!==null){let f=e.options[l].dataRef.current.domRef,p=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===d.current||((i=d.current)==null?void 0:i.nextElementSibling)===null)return{...c,activeOptionIndex:p}}}}let a=gh(e),u=Qs(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:l=>l.id,resolveDisabled:l=>l.dataRef.current.disabled});return{...c,...a,activeOptionIndex:u}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var c;return!i.dataRef.current.disabled&&((c=i.dataRef.current.textValue)==null?void 0:c.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==ve.Nothing&&(r=Qs(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:ve.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...gh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Js.Moved}}};class ru extends G0{constructor(t){super(t),mh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return ft(s,{0:()=>r==null?void 0:r(n),1:()=>{let c=i.slice(),a=c.findIndex(u=>o(u,n));return a===-1?c.push(n):c.splice(a,1),r==null?void 0:r(c)}})},registerOption:Pc(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Pc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Pc(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),mh(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=$c.get(null);this.disposables.add(r.on(K0.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(E8(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new ru({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ve.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Js.Idle})}reduce(t,n){return ft(n.type,F8,t,n)}}const yh=x.createContext(null);function ou(e){let t=x.useContext(yh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wh),n}return t}function wh({id:e,__demoMode:t=!1}){let n=x.useMemo(()=>ru.new({id:e,__demoMode:t}),[]);return rh(()=>n.dispose()),n}let oi=x.createContext(null);oi.displayName="ListboxDataContext";function _o(e){let t=x.useContext(oi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,_o),n}return t}let D8=x.Fragment;function R8(e,t){let n=x.useId(),r=gc(),{value:o,defaultValue:s,form:i,name:c,onChange:a,by:u,invalid:l=!1,disabled:f=r||!1,horizontal:p=!1,multiple:d=!1,__demoMode:h=!1,...m}=e;const w=p?"horizontal":"vertical";let $=dt(t),E=ox(s),[S=d?[]:void 0,N]=rx(o,a,E),B=wh({id:n,__demoMode:h}),F=x.useRef({static:!1,hold:!1}),D=x.useRef(new Map),b=Cx(u),g=x.useCallback(_=>ft(v.mode,{[On.Multi]:()=>S.some(W=>b(W,_)),[On.Single]:()=>b(S,_)}),[S]),v=Sn({value:S,disabled:f,invalid:l,mode:d?On.Multi:On.Single,orientation:w,onChange:N,compare:b,isSelected:g,optionsPropsRef:F,listRef:D});Ee(()=>{B.state.dataRef.current=v},[v]);let C=qe(B,_=>_.listboxState),O=$c.get(null),I=qe(O,x.useCallback(_=>O.selectors.isTop(_,n),[O,n])),[M,y]=qe(B,_=>[_.buttonElement,_.optionsElement]);r2(I,[M,y],(_,W)=>{B.send({type:bh.CloseListbox}),rp(W,Mc.Loose)||(_.preventDefault(),M==null||M.focus())});let A=Sn({open:C===Be.Open,disabled:f,invalid:l,value:S}),[T,P]=Px({inherit:!0}),L={ref:$},j=x.useCallback(()=>{if(E!==void 0)return N==null?void 0:N(E)},[N,E]),z=rt();return x.createElement(P,{value:T,props:{htmlFor:M==null?void 0:M.id},slot:{open:C===Be.Open,disabled:f}},x.createElement(i8,null,x.createElement(yh.Provider,{value:B},x.createElement(oi.Provider,{value:v},x.createElement(nh,{value:ft(C,{[Be.Open]:Ct.Open,[Be.Closed]:Ct.Closed})},c!=null&&S!=null&&x.createElement(fx,{disabled:f,data:{[c]:S},form:i,onReset:j}),z({ourProps:L,theirProps:m,slot:A,defaultTag:D8,name:"Listbox"}))))))}let j8="button";function _8(e,t){let n=x.useId(),r=I0(),o=_o("Listbox.Button"),s=ou("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...u}=e,l=dt(t,n8(),s.actions.setButtonElement),f=r8(),[p,d,h]=qe(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),m=p===Be.Open;i2(m,{trigger:d,action:x.useCallback(y=>{if(d!=null&&d.contains(y.target))return js.Ignore;let A=y.target.closest('[role="option"]:not([data-disabled])');return on(A)?js.Select(A):h!=null&&h.contains(y.target)?js.Ignore:js.Close},[d,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let w=le(y=>{switch(y.key){case Ce.Enter:sx(y.currentTarget);break;case Ce.Space:case Ce.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?ve.Nothing:ve.First});break;case Ce.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?ve.Nothing:ve.Last});break}}),$=le(y=>{switch(y.key){case Ce.Space:y.preventDefault();break}}),E=Mx(y=>{var A;s.state.listboxState===Be.Open?(je.flushSync(()=>s.actions.closeListbox()),(A=s.state.buttonElement)==null||A.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:ve.Nothing}))}),S=le(y=>y.preventDefault()),N=_0([i]),B=vx(),{isFocusVisible:F,focusProps:D}=H5({autoFocus:a}),{isHovered:b,hoverProps:g}=z5({isDisabled:c}),{pressed:v,pressProps:C}=K5({disabled:c}),O=Sn({open:p===Be.Open,active:v||p===Be.Open,disabled:c,invalid:o.invalid,value:o.value,hover:b,focus:F,autofocus:a}),I=qe(s,y=>y.listboxState===Be.Open),M=T0(f(),{ref:l,id:i,type:a2(e,d),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":I,"aria-labelledby":N,"aria-describedby":B,disabled:c||void 0,autoFocus:a,onKeyDown:w,onKeyUp:$,onKeyPress:S},E,D,g,C);return rt()({ourProps:M,theirProps:u,slot:O,defaultTag:j8,name:"Listbox.Button"})}let vh=x.createContext(!1),U8="div",z8=Ls.RenderStrategy|Ls.Static;function H8(e,t){let n=x.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,u=t8(o),[l,f]=x.useState(null);u&&(s=!0);let p=_o("Listbox.Options"),d=ou("Listbox.Options"),[h,m,w,$]=qe(d,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),E=kc(m),S=kc(w),N=eu(),[B,F]=hp(c,l,N!==null?(N&Ct.Open)===Ct.Open:h===Be.Open);Vx(B,m,d.actions.closeListbox);let D=$?!1:i&&h===Be.Open;h2(D,S);let b=$?!1:i&&h===Be.Open;Wx(b,{allowed:x.useCallback(()=>[m,w],[m,w])});let g=qe(d,d.selectors.didButtonMove)?!1:B,v=qe(d,d.selectors.hasFrozenValue)&&!e.static,C=th(v,p.value),O=x.useCallback(H=>p.compare(C,H),[p.compare,C]),I=qe(d,H=>{var Z;if(u==null||!((Z=u==null?void 0:u.to)!=null&&Z.includes("selection")))return null;let J=H.options.findIndex(oe=>O(oe.dataRef.current.value));return J===-1&&(J=0),J}),M=(()=>{if(u==null)return;if(I===null)return{...u,inner:void 0};let H=Array.from(p.listRef.current.values());return{...u,inner:{listRef:{current:H},index:I}}})(),[y,A]=s8(M),T=o8(),P=dt(t,u?y:null,d.actions.setOptionsElement,f),L=Gn();x.useEffect(()=>{let H=w;H&&h===Be.Open&&(q5(H)||H==null||H.focus({preventScroll:!0}))},[h,w]);let j=le(H=>{var Z;switch(L.dispose(),H.key){case Ce.Space:if(d.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),d.actions.search(H.key);case Ce.Enter:H.preventDefault(),H.stopPropagation(),d.actions.selectActiveOption();break;case ft(p.orientation,{vertical:Ce.ArrowDown,horizontal:Ce.ArrowRight}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:ve.Next});case ft(p.orientation,{vertical:Ce.ArrowUp,horizontal:Ce.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:ve.Previous});case Ce.Home:case Ce.PageUp:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:ve.First});case Ce.End:case Ce.PageDown:return H.preventDefault(),H.stopPropagation(),d.actions.goToOption({focus:ve.Last});case Ce.Escape:H.preventDefault(),H.stopPropagation(),je.flushSync(()=>d.actions.closeListbox()),(Z=d.state.buttonElement)==null||Z.focus({preventScroll:!0});return;case Ce.Tab:H.preventDefault(),H.stopPropagation(),je.flushSync(()=>d.actions.closeListbox()),Jx(d.state.buttonElement,H.shiftKey?Ic.Previous:Ic.Next);break;default:H.key.length===1&&(d.actions.search(H.key),L.setTimeout(()=>d.actions.clearSearch(),350));break}}),z=qe(d,H=>{var Z;return(Z=H.buttonElement)==null?void 0:Z.id}),_=Sn({open:h===Be.Open}),W=T0(u?T():{},{id:r,ref:P,"aria-activedescendant":qe(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===On.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===Be.Open?0:void 0,style:{...a.style,...A,"--button-width":Ix(B,m,!0).width},...pp(F)}),K=rt(),G=x.useMemo(()=>p.mode===On.Multi?p:{...p,isSelected:O},[p,O]);return x.createElement(x8,{enabled:s?e.static||B:!1,ownerDocument:E},x.createElement(oi.Provider,{value:G},K({ourProps:W,theirProps:a,slot:_,defaultTag:U8,features:z8,visible:g,name:"Listbox.Options"})))}let W8="div";function V8(e,t){let n=x.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=x.useContext(vh)===!0,a=_o("Listbox.Option"),u=ou("Listbox.Option"),l=qe(u,v=>u.selectors.isActive(v,r)),f=a.isSelected(s),p=x.useRef(null),d=k8(p),h=qn({disabled:o,value:s,domRef:p,get textValue(){return d()}}),m=dt(t,p,v=>{v?a.listRef.current.set(r,v):a.listRef.current.delete(r)}),w=qe(u,v=>u.selectors.shouldScrollIntoView(v,r));Ee(()=>{if(w)return nt().requestAnimationFrame(()=>{var v,C;(C=(v=p.current)==null?void 0:v.scrollIntoView)==null||C.call(v,{block:"nearest"})})},[w,p]),Ee(()=>{if(!c)return u.actions.registerOption(r,h),()=>u.actions.unregisterOption(r)},[h,r,c]);let $=le(v=>{if(o)return v.preventDefault();u.actions.selectOption(s)}),E=le(()=>{if(o)return u.actions.goToOption({focus:ve.Nothing});u.actions.goToOption({focus:ve.Specific,id:r})}),S=m2(),N=le(v=>S.update(v)),B=le(v=>{S.wasMoved(v)&&(o||l&&u.state.activationTrigger===ri.Pointer||u.actions.goToOption({focus:ve.Specific,id:r},ri.Pointer))}),F=le(v=>{S.wasMoved(v)&&(o||l&&u.state.activationTrigger===ri.Pointer&&u.actions.goToOption({focus:ve.Nothing}))}),D=Sn({active:l,focus:l,selected:f,disabled:o,selectedOption:f&&c}),b=c?{}:{id:r,ref:m,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:$,onFocus:E,onPointerEnter:N,onMouseEnter:N,onPointerMove:B,onMouseMove:B,onPointerLeave:F,onMouseLeave:F},g=rt();return!f&&c?null:g({ourProps:b,theirProps:i,slot:D,defaultTag:W8,name:"Listbox.Option"})}let G8=x.Fragment;function q8(e,t){let{options:n,placeholder:r,...o}=e,s={ref:dt(t)},i=_o("ListboxSelectedOption"),c=Sn({}),a=i.value===void 0||i.value===null||i.mode===On.Multi&&Array.isArray(i.value)&&i.value.length===0,u=rt();return x.createElement(vh.Provider,{value:!0},u({ourProps:s,theirProps:{...o,children:x.createElement(x.Fragment,null,r&&a?r:n)},slot:c,defaultTag:G8,name:"ListboxSelectedOption"}))}let Z8=Ge(R8),Y8=Ge(_8),K8=Ox,X8=Ge(H8),Q8=Ge(V8),J8=Ge(q8),mt=Object.assign(Z8,{Button:Y8,Label:K8,Options:X8,Option:Q8,SelectedOption:J8});const e3=()=>k.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[k.jsx("g",{clipPath:"url(#clip0_active)",children:k.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),k.jsx("defs",{children:k.jsx("clipPath",{id:"clip0_active",children:k.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),t3=()=>k.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[k.jsx("g",{clipPath:"url(#clip0_inactive)",children:k.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),k.jsx("defs",{children:k.jsx("clipPath",{id:"clip0_inactive",children:k.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Uo=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return k.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>k.jsx("div",{className:"flex items-center justify-center",children:o>t-e?k.jsx(e3,{}):k.jsx(t3,{})},o))})};class It{}Go(It,"FAST",3),Go(It,"Medium",2),Go(It,"SLOW",1),Go(It,"NONE",0);const n3=Object.values({MAINNET:1,SEPOLIA:11155111}),ln=e=>{const t=typeof e=="string"?parseInt(e,10):e;return n3.includes(t)},r3={USDT:!0},xh=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!r3[t.toUpperCase()]:!0},o3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=vt();return k.jsx("div",{className:`relative ${o}`,children:k.jsx(mt,{value:t,onChange:n,disabled:r,children:({open:c})=>k.jsxs(k.Fragment,{children:[k.jsxs(mt.Button,{className:`
|
|
139
|
+
*/var G2=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Uc=G2.join(","),wp=typeof Element>"u",Fo=wp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qs=!wp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ro=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&Ro(t.parentNode);return i},q2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Z2=function(t,n,r){if(Ro(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Uc));return n&&Fo.call(t,Uc)&&o.unshift(t),o=o.filter(r),o},Wc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ro(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=Wc(a,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=Fo.call(i,Uc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Ro(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var d=Wc(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else s.unshift.apply(s,i.children)}}return o},xp=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ep=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||q2(t))&&!xp(t)?0:t.tabIndex},K2=function(t,n){var r=Ep(t);return r<0&&n&&!xp(t)?0:r},Y2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sp=function(t){return t.tagName==="INPUT"},X2=function(t){return Sp(t)&&t.type==="hidden"},Q2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},J2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},eE=function(t){if(!t.name)return!0;var n=t.form||qs(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=J2(o,t.form);return!s||s===t},tE=function(t){return Sp(t)&&t.type==="radio"},nE=function(t){return tE(t)&&!eE(t)},rE=function(t){var n,r=t&&qs(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,c,a;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var l,u,f;r=qs(o),o=(l=r)===null||l===void 0?void 0:l.host,s=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},Pp=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},oE=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Fo.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Fo.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=qs(t);if(l&&!l.shadowRoot&&o(l)===!0)return Pp(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(rE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Pp(t);return!1},sE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Fo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},iE=function(t,n){return!(n.disabled||Ro(n)||X2(n)||oE(n,t)||Q2(n)||sE(n))},Tp=function(t,n){return!(nE(n)||Ep(n)<0||!iE(t,n))},aE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ap=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=K2(c,i),l=i?Ap(o.candidates):c;a===0?i?n.push.apply(n,l):n.push(c):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:l})}),r.sort(Y2).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},$p=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Wc([t],n.includeContainer,{filter:Tp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:aE}):r=Z2(t,n.includeContainer,Tp.bind(null,n)),Ap(r)};function Np(e,t,n){let{reference:r,floating:o}=e;const s=ln(t),i=_c(t),c=jc(i),a=$n(t),l=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let d;switch(a){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(Ar(t)){case"start":d[i]-=p*(n&&l?-1:1);break;case"end":d[i]+=p*(n&&l?-1:1);break}return d}const cE=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Np(l,r,a),p=r,d={},h=0;for(let m=0;m<c.length;m++){const{name:v,fn:T}=c[m],{x:E,y:S,data:C,reset:M}=await T({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:l,platform:i,elements:{reference:e,floating:t}});u=E??u,f=S??f,d={...d,[v]:{...d[v],...C}},M&&h<=50&&(h++,typeof M=="object"&&(M.placement&&(p=M.placement),M.rects&&(l=M.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:u,y:f}=Np(l,p,a)),m=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}};async function Zs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=Kn(t,e),h=vp(d),v=c[p?f==="floating"?"reference":"floating":f],T=Gs(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),E=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},M=Gs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:S,strategy:a}):E);return{top:(T.top-M.top+h.top)/C.y,bottom:(M.bottom-T.bottom+h.bottom)/C.y,left:(T.left-M.left+h.left)/C.x,right:(M.right-T.right+h.right)/C.x}}const lE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:l,padding:u=0}=Kn(e,t)||{};if(l==null)return{};const f=vp(u),p={x:n,y:r},d=_c(o),h=jc(d),m=await i.getDimensions(l),v=d==="y",T=v?"top":"left",E=v?"bottom":"right",S=v?"clientHeight":"clientWidth",C=s.reference[h]+s.reference[d]-p[d]-s.floating[h],M=p[d]-s.reference[d],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let F=B?B[S]:0;(!F||!await(i.isElement==null?void 0:i.isElement(B)))&&(F=c.floating[S]||s.floating[h]);const b=C/2-M/2,g=F/2-m[h]/2-1,w=cn(f[T],g),O=cn(f[E],g),N=w,I=F-m[h]-O,k=F/2-m[h]/2+b,y=Rc(N,k,I),$=!a.arrow&&Ar(o)!=null&&k!==y&&s.reference[h]/2-(k<N?w:O)-m[h]/2<0,A=$?k<N?k-N:k-I:0;return{[d]:p[d]+A,data:{[d]:y,centerOffset:k-y-A,...$&&{alignmentOffset:A}},reset:$}}}),uE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=Kn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=$n(o),E=ln(c),S=$n(c)===c,C=await(a.isRTL==null?void 0:a.isRTL(l.floating)),M=p||(S||!m?[Vs(c)]:_2(c)),B=h!=="none";!p&&B&&M.push(...H2(c,m,h,C));const F=[c,...M],b=await Zs(t,v),g=[];let w=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&g.push(b[T]),f){const k=j2(o,i,C);g.push(b[k[0]],b[k[1]])}if(w=[...w,{placement:o,overflows:g}],!g.every(k=>k<=0)){var O,N;const k=(((O=s.flip)==null?void 0:O.index)||0)+1,y=F[k];if(y&&(!(f==="alignment"?E!==ln(y):!1)||w.every(P=>ln(P.placement)===E?P.overflows[0]>0:!0)))return{data:{index:k,overflows:w},reset:{placement:y}};let $=(N=w.filter(A=>A.overflows[0]<=0).sort((A,P)=>A.overflows[1]-P.overflows[1])[0])==null?void 0:N.placement;if(!$)switch(d){case"bestFit":{var I;const A=(I=w.filter(P=>{if(B){const L=ln(P.placement);return L===E||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:I[0];A&&($=A);break}case"initialPlacement":$=c;break}if(o!==$)return{reset:{placement:$}}}return{}}}},fE=new Set(["left","top"]);async function dE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=$n(n),c=Ar(n),a=ln(n)==="y",l=fE.has(i)?-1:1,u=s&&a?-1:1,f=Kn(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),a?{x:d*u,y:p*l}:{x:p*l,y:d*u}}const pE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,a=await dE(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},hE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:v=>{let{x:T,y:E}=v;return{x:T,y:E}}},...a}=Kn(e,t),l={x:n,y:r},u=await Zs(t,a),f=ln($n(o)),p=bp(f);let d=l[p],h=l[f];if(s){const v=p==="y"?"top":"left",T=p==="y"?"bottom":"right",E=d+u[v],S=d-u[T];d=Rc(E,d,S)}if(i){const v=f==="y"?"top":"left",T=f==="y"?"bottom":"right",E=h+u[v],S=h-u[T];h=Rc(E,h,S)}const m=c.fn({...t,[p]:d,[f]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:s,[f]:i}}}}}},mE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=Kn(e,t),u=await Zs(t,l),f=$n(o),p=Ar(o),d=ln(o)==="y",{width:h,height:m}=s.floating;let v,T;f==="top"||f==="bottom"?(v=f,T=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(T=f,v=p==="end"?"top":"bottom");const E=m-u.top-u.bottom,S=h-u.left-u.right,C=cn(m-u[v],E),M=cn(h-u[T],S),B=!t.middlewareData.shift;let F=C,b=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=E),B&&!p){const w=De(u.left,0),O=De(u.right,0),N=De(u.top,0),I=De(u.bottom,0);d?b=h-2*(w!==0||O!==0?w+O:De(u.left,u.right)):F=m-2*(N!==0||I!==0?N+I:De(u.top,u.bottom))}await a({...t,availableWidth:b,availableHeight:F});const g=await i.getDimensions(c.floating);return h!==g.width||m!==g.height?{reset:{rects:!0}}:{}}}};function Cp(e){const t=ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Fe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Bo(n)!==s||Bo(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Hc(e){return fe(e)?e:e.contextElement}function $r(e){const t=Hc(e);if(!Fe(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Cp(t);let i=(s?Bo(n.width):n.width)/r,c=(s?Bo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const bE=zt(0);function Op(e){const t=Ze(e);return!Us()||!t.visualViewport?bE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ze(e)?!1:t}function Yn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Hc(e);let i=zt(1);t&&(r?fe(r)&&(i=$r(r)):i=$r(e));const c=gE(s,n,r)?Op(s):zt(0);let a=(o.left+c.x)/i.x,l=(o.top+c.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){const p=Ze(s),d=r&&fe(r)?Ze(r):r;let h=p,m=Fc(h);for(;m&&r&&d!==h;){const v=$r(m),T=m.getBoundingClientRect(),E=ht(m),S=T.left+(m.clientLeft+parseFloat(E.paddingLeft))*v.x,C=T.top+(m.clientTop+parseFloat(E.paddingTop))*v.y;a*=v.x,l*=v.y,u*=v.x,f*=v.y,a+=S,l+=C,h=Ze(m),m=Fc(h)}}return Gs({width:u,height:f,x:a,y:l})}function Ks(e,t){const n=Ws(e).scrollLeft;return t?t.left+n:Yn(_t(e)).left+n}function Ip(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ks(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function yE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=_t(r),c=t?zs(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=zt(1);const u=zt(0),f=Fe(r);if((f||!f&&!s)&&((Tr(r)!=="body"||Lo(i))&&(a=Ws(r)),Fe(r))){const d=Yn(r);l=$r(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=i&&!f&&!s?Ip(i,a):zt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-a.scrollTop*l.y+u.y+p.y}}function vE(e){return Array.from(e.getClientRects())}function wE(e){const t=_t(e),n=Ws(e),r=e.ownerDocument.body,o=De(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=De(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ks(e);const c=-n.scrollTop;return ht(r).direction==="rtl"&&(i+=De(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const kp=25;function xE(e,t){const n=Ze(e),r=_t(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,a=0;if(o){s=o.width,i=o.height;const u=Us();(!u||u&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const l=Ks(r);if(l<=0){const u=r.ownerDocument,f=u.body,p=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-d);h<=kp&&(s-=h)}else l<=kp&&(s+=l);return{width:s,height:i,x:c,y:a}}const EE=new Set(["absolute","fixed"]);function SE(e,t){const n=Yn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Fe(e)?$r(e):zt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,l=r*s.y;return{width:i,height:c,x:a,y:l}}function Dp(e,t,n){let r;if(t==="viewport")r=xE(e,n);else if(t==="document")r=wE(_t(e));else if(fe(t))r=SE(t,n);else{const o=Op(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gs(r)}function Mp(e,t){const n=an(e);return n===t||!fe(n)||sn(n)?!1:ht(n).position==="fixed"||Mp(n,t)}function PE(e,t){const n=t.get(e);if(n)return n;let r=An(e,[],!1).filter(c=>fe(c)&&Tr(c)!=="body"),o=null;const s=ht(e).position==="fixed";let i=s?an(e):e;for(;fe(i)&&!sn(i);){const c=ht(i),a=Bc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&EE.has(o.position)||Lo(i)&&!a&&Mp(e,i))?r=r.filter(u=>u!==i):o=c,i=an(i)}return t.set(e,r),r}function TE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?zs(t)?[]:PE(t,this._c):[].concat(n),r],c=i[0],a=i.reduce((l,u)=>{const f=Dp(t,u,o);return l.top=De(f.top,l.top),l.right=cn(f.right,l.right),l.bottom=cn(f.bottom,l.bottom),l.left=De(f.left,l.left),l},Dp(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function AE(e){const{width:t,height:n}=Cp(e);return{width:t,height:n}}function $E(e,t,n){const r=Fe(t),o=_t(t),s=n==="fixed",i=Yn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=zt(0);function l(){a.x=Ks(o)}if(r||!r&&!s)if((Tr(t)!=="body"||Lo(o))&&(c=Ws(t)),r){const d=Yn(t,!0,s,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Ip(o,c):zt(0),f=i.left+c.scrollLeft-a.x-u.x,p=i.top+c.scrollTop-a.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function Vc(e){return ht(e).position==="static"}function Lp(e,t){if(!Fe(e)||ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _t(e)===n&&(n=n.ownerDocument.body),n}function Bp(e,t){const n=Ze(e);if(zs(e))return n;if(!Fe(e)){let o=an(e);for(;o&&!sn(o);){if(fe(o)&&!Vc(o))return o;o=an(o)}return n}let r=Lp(e,t);for(;r&&N2(r)&&Vc(r);)r=Lp(r,t);return r&&sn(r)&&Vc(r)&&!Bc(r)?n:r||D2(e)||n}const NE=async function(e){const t=this.getOffsetParent||Bp,n=this.getDimensions,r=await n(e.floating);return{reference:$E(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CE(e){return ht(e).direction==="rtl"}const OE={convertOffsetParentRelativeRectToViewportRelativeRect:yE,getDocumentElement:_t,getClippingRect:TE,getOffsetParent:Bp,getElementRects:NE,getClientRects:vE,getDimensions:AE,getScale:$r,isElement:fe,isRTL:CE};function Fp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IE(e,t){let n=null,r;const o=_t(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:d}=l;if(c||t(),!p||!d)return;const h=Hs(f),m=Hs(o.clientWidth-(u+p)),v=Hs(o.clientHeight-(f+d)),T=Hs(u),S={rootMargin:-h+"px "+-m+"px "+-v+"px "+-T+"px",threshold:De(0,cn(1,a))||1};let C=!0;function M(B){const F=B[0].intersectionRatio;if(F!==a){if(!C)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!Fp(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(M,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,S)}n.observe(e)}return i(!0),s}function Rp(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,l=Hc(e),u=o||s?[...l?An(l):[],...An(t)]:[];u.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const f=l&&c?IE(l,n):null;let p=-1,d=null;i&&(d=new ResizeObserver(T=>{let[E]=T;E&&E.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=d)==null||S.observe(t)})),n()}),l&&!a&&d.observe(l),d.observe(t));let h,m=a?Yn(e):null;a&&v();function v(){const T=Yn(e);m&&!Fp(m,T)&&n(),m=T,h=requestAnimationFrame(v)}return n(),()=>{var T;u.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f==null||f(),(T=d)==null||T.disconnect(),d=null,a&&cancelAnimationFrame(h)}}const Gc=Zs,kE=pE,DE=hE,ME=uE,LE=mE,jp=lE,BE=(e,t,n)=>{const r=new Map,o={platform:OE,...n},s={...o.platform,_c:r};return cE(e,t,{...o,platform:s})};var FE=typeof document<"u",RE=function(){},Ys=FE?x.useLayoutEffect:RE;function Xs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xs(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Xs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _p(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zp(e,t){const n=_p(e);return Math.round(t*n)/n}function qc(e){const t=z.useRef(e);return Ys(()=>{t.current=e}),t}function Up(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,f]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=z.useState(r);Xs(p,r)||d(r);const[h,m]=z.useState(null),[v,T]=z.useState(null),E=z.useCallback(P=>{P!==B.current&&(B.current=P,m(P))},[]),S=z.useCallback(P=>{P!==F.current&&(F.current=P,T(P))},[]),C=s||h,M=i||v,B=z.useRef(null),F=z.useRef(null),b=z.useRef(u),g=a!=null,w=qc(a),O=qc(o),N=qc(l),I=z.useCallback(()=>{if(!B.current||!F.current)return;const P={placement:t,strategy:n,middleware:p};O.current&&(P.platform=O.current),BE(B.current,F.current,P).then(L=>{const j={...L,isPositioned:N.current!==!1};k.current&&!Xs(b.current,j)&&(b.current=j,Mr.flushSync(()=>{f(j)}))})},[p,t,n,O,N]);Ys(()=>{l===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const k=z.useRef(!1);Ys(()=>(k.current=!0,()=>{k.current=!1}),[]),Ys(()=>{if(C&&(B.current=C),M&&(F.current=M),C&&M){if(w.current)return w.current(C,M,I);I()}},[C,M,I,w,g]);const y=z.useMemo(()=>({reference:B,floating:F,setReference:E,setFloating:S}),[E,S]),$=z.useMemo(()=>({reference:C,floating:M}),[C,M]),A=z.useMemo(()=>{const P={position:n,left:0,top:0};if(!$.floating)return P;const L=zp($.floating,u.x),j=zp($.floating,u.y);return c?{...P,transform:"translate("+L+"px, "+j+"px)",..._p($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,c,$.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:I,refs:y,elements:$,floatingStyles:A}),[u,I,y,$,A])}const jE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?jp({element:r.current,padding:o}).fn(n):{}:r?jp({element:r,padding:o}).fn(n):{}}}},Zc=(e,t)=>({...kE(e),options:[e,t]}),Wp=(e,t)=>({...DE(e),options:[e,t]}),Hp=(e,t)=>({...ME(e),options:[e,t]}),_E=(e,t)=>({...LE(e),options:[e,t]}),zE=(e,t)=>({...jE(e),options:[e,t]}),Vp={...z},UE=Vp.useInsertionEffect||(e=>e());function Gp(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return UE(()=>{t.current=e}),z.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Kc=typeof document<"u"?x.useLayoutEffect:x.useEffect;let qp=!1,WE=0;const Zp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+WE++;function HE(){const[e,t]=z.useState(()=>qp?Zp():void 0);return Kc(()=>{e==null&&t(Zp())},[]),z.useEffect(()=>{qp=!0},[]),e}const VE=Vp.useId||HE;let jo;process.env.NODE_ENV!=="production"&&(jo=new Set);function GE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=jo)!=null&&e.has(o))){var s;(s=jo)==null||s.add(o),console.warn(o)}}function qE(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=jo)!=null&&e.has(o))){var s;(s=jo)==null||s.add(o),console.error(o)}}function ZE(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const KE=z.createContext(null),YE=z.createContext(null),XE=()=>{var e;return((e=z.useContext(KE))==null?void 0:e.id)||null},QE=()=>z.useContext(YE),JE="data-floating-ui-focusable";function e8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=VE(),s=z.useRef({}),[i]=z.useState(()=>ZE()),c=XE()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!fe(d)&&qE("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=z.useState(r.reference),u=Gp((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=z.useMemo(()=>({setPositionReference:l}),[]),p=z.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function t8(e){e===void 0&&(e={});const{nodeId:t}=e,n=e8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=z.useState(null),[c,a]=z.useState(null),u=(o==null?void 0:o.domReference)||s,f=z.useRef(null),p=QE();Kc(()=>{u&&(f.current=u)},[u]);const d=Up({...e,elements:{...o,...c&&{reference:c}}}),h=z.useCallback(S=>{const C=fe(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;a(C),d.refs.setReference(C)},[d.refs]),m=z.useCallback(S=>{(fe(S)||S===null)&&(f.current=S,i(S)),(fe(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!fe(S))&&d.refs.setReference(S)},[d.refs]),v=z.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=z.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=z.useMemo(()=>({...d,...r,refs:v,elements:T,nodeId:t}),[d,v,T,t,r]);return Kc(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(C=>C.id===t);S&&(S.context=E)}),z.useMemo(()=>({...d,context:E,refs:v,elements:T}),[d,v,T,E])}const Kp="active",Yp="selected";function Yc(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Kp]:i,[Yp]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[JE]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[l,u]=a;if(!(o&&[Kp,Yp].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),i[l]=function(){for(var p,d=arguments.length,h=new Array(d),m=0;m<d;m++)h[m]=arguments[m];return(p=r.get(l))==null?void 0:p.map(v=>v(...h)).find(v=>v!==void 0)}}}else i[l]=u}),i),{})}}function n8(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=z.useCallback(c=>Yc(c,e,"reference"),t),s=z.useCallback(c=>Yc(c,e,"floating"),n),i=z.useCallback(c=>Yc(c,e,"item"),r);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function Xp(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const r8=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:c=4,referenceOverflowThreshold:a=0,scrollRef:l,...u}=Kn(e,t),{rects:f,elements:{floating:p}}=t,d=n.current[i],h=(l==null?void 0:l.current)||p,m=p.clientTop||h.clientTop,v=p.clientTop!==0,T=h.clientTop!==0,E=p===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||GE('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const S={...t,...await Zc(-d.offsetTop-p.clientTop-f.reference.height/2-d.offsetHeight/2-s).fn(t)},C=await Gc(Xp(S,h.scrollHeight+m+p.clientTop),u),M=await Gc(S,{...u,elementContext:"reference"}),B=De(0,C.top),F=S.y+B,w=(h.scrollHeight>h.clientHeight?O=>O:Bo)(De(0,h.scrollHeight+(v&&E||T?m*2:0)-B-De(0,C.bottom)));if(h.style.maxHeight=w+"px",h.scrollTop=B,o){const O=h.offsetHeight<d.offsetHeight*cn(c,n.current.length)-1||M.top>=-a||M.bottom>=-a;Mr.flushSync(()=>o(O))}return r&&(r.current=await Gc(Xp({...S,y:F},h.offsetHeight+m+p.clientTop),u)),{y:F}}});function o8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=Gp(c),l=z.useRef(!1),u=z.useRef(null),f=z.useRef(null);z.useEffect(()=>{if(!o)return;function d(m){if(m.ctrlKey||!h||s.current==null)return;const v=m.deltaY,T=s.current.top>=-.5,E=s.current.bottom>=-.5,S=h.scrollHeight-h.clientHeight,C=v<0?-1:1,M=v<0?"max":"min";h.scrollHeight<=h.clientHeight||(!T&&v>0||!E&&v<0?(m.preventDefault(),Mr.flushSync(()=>{a(B=>B+Math[M](v,S*C))})):/firefox/i.test(L2())&&(h.scrollTop+=v))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",d),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{u.current=null,f.current=null,h.removeEventListener("wheel",d)}},[o,n,r.floating,s,i,a]);const p=z.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const d=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!d||!l.current)){if(u.current!==null){const h=d.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Mr.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{u.current=d.scrollTop})}}}),[r.floating,a,s,i]);return z.useMemo(()=>o?{floating:p}:{},[o,p])}let Nr=x.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Nr.displayName="FloatingContext";let Xc=x.createContext(null);Xc.displayName="PlacementContext";function s8(e){return x.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function i8(){return x.useContext(Nr).setReference}function a8(){return x.useContext(Nr).getReferenceProps}function c8(){let{getFloatingProps:e,slot:t}=x.useContext(Nr);return x.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function l8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=x.useContext(Xc),n=x.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Ee(()=>{t==null||t(n??null)},[t,n]);let r=x.useContext(Nr);return x.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Qp=4;function u8({children:e,enabled:t=!0}){let[n,r]=x.useState(null),[o,s]=x.useState(0),i=x.useRef(null),[c,a]=x.useState(null);f8(c);let l=t&&n!==null&&c!==null,{to:u="bottom",gap:f=0,offset:p=0,padding:d=0,inner:h}=d8(n,c),[m,v="center"]=u.split(" ");Ee(()=>{l&&s(0)},[l]);let{refs:T,floatingStyles:E,context:S}=t8({open:l,placement:m==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${m}`:`${m}-${v}`,strategy:"absolute",transform:!1,middleware:[Zc({mainAxis:m==="selection"?0:f,crossAxis:p}),Wp({padding:d}),m!=="selection"&&Hp({padding:d}),m==="selection"&&h?r8({...h,padding:d,overflowRef:i,offset:o,minItemsVisible:Qp,referenceOverflowThreshold:d,onFallbackChange(O){var N,I;if(!O)return;let k=S.elements.floating;if(!k)return;let y=parseFloat(getComputedStyle(k).scrollPaddingBottom)||0,$=Math.min(Qp,k.childElementCount),A=0,P=0;for(let L of(I=(N=S.elements.floating)==null?void 0:N.childNodes)!=null?I:[])if(on(L)){let j=L.offsetTop,U=j+L.clientHeight+y,_=k.scrollTop,H=_+k.clientHeight;if(j>=_&&U<=H)$--;else{P=Math.max(0,Math.min(U,H)-Math.max(j,_)),A=L.clientHeight;break}}$>=1&&s(L=>{let j=A*$-P+y;return L>=j?L:j})}}):null,_E({padding:d,apply({availableWidth:O,availableHeight:N,elements:I}){Object.assign(I.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${N}px)`})}})].filter(Boolean),whileElementsMounted:Rp}),[C=m,M=v]=S.placement.split("-");m==="selection"&&(C="selection");let B=x.useMemo(()=>({anchor:[C,M].filter(Boolean).join(" ")}),[C,M]),F=o8(S,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:g}=n8([F]),w=ue(O=>{a(O),T.setFloating(O)});return z.createElement(Xc.Provider,{value:r},z.createElement(Nr.Provider,{value:{setFloating:w,setReference:T.setReference,styles:E,getReferenceProps:b,getFloatingProps:g,slot:B}},e))}function f8(e){Ee(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function d8(e,t){var n,r,o;let s=Qc((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=Qc((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=Qc((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function Qc(e,t,n=void 0){let r=Gn(),o=ue((a,l)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!l)return[n,null];let u=eh(a,l);return[u,f=>{let p=Jp(a);{let d=p.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[T,E]of p.entries()){let S=window.getComputedStyle(l).getPropertyValue(E);if(d[T]!==S){d[T]=S,m=!0;break}}if(!m)return;let v=eh(a,l);u!==v&&(f(v),u=v)})}return r.dispose}]}return[n,null]}),s=x.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=x.useState();return Ee(()=>{let[a,l]=o(e,t);if(c(a),!!l)return l(c)},[e,t]),i}function Jp(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...Jp(o)]:[r]}return[]}function eh(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function p8({children:e,freeze:t},n){let r=th(t,e);return x.isValidElement(r)?x.cloneElement(r,{ref:n}):x.createElement(x.Fragment,null,r)}x.forwardRef(p8);function th(e,t){let[n,r]=x.useState(t);return!e&&n!==t&&r(t),e?n:t}let Jc=x.createContext(null);Jc.displayName="OpenClosedContext";var Ot=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ot||{});function el(){return x.useContext(Jc)}function nh({value:e,children:t}){return x.createElement(Jc.Provider,{value:e},t)}function h8(e){throw new Error("Unexpected object: "+e)}var we=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(we||{});function Qs(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:h8(e)}}function rh(e){let t=ue(e),n=x.useRef(!1);x.useEffect(()=>(n.current=!1,()=>{n.current=!0,P0(()=>{n.current&&t()})}),[t])}let m8=x.createContext(!1);function b8(){return x.useContext(m8)}function g8(e){let t=b8(),n=x.useContext(sh),[r,o]=x.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Rt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let c=e.createElement("div");return c.setAttribute("id","headlessui-portal-root"),e.body.appendChild(c)});return x.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),x.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let oh=x.Fragment,y8=Ge(function(e,t){let{ownerDocument:n=null,...r}=e,o=x.useRef(null),s=dt(Sx(p=>{o.current=p}),t),i=Dc(o.current),c=n??i,a=g8(c),l=x.useContext(E8),u=Gn(),f=rt();return rh(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?je.createPortal(x.createElement("div",{"data-headlessui-portal":"",ref:p=>{u.dispose(),l&&p&&u.add(l.register(p))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:oh,name:"Portal"})),a):null});function v8(e,t){let n=dt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=rt();return r?x.createElement(y8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:oh,name:"Portal"})}let w8=x.Fragment,sh=x.createContext(null);function x8(e,t){let{target:n,...r}=e,o={ref:dt(t)},s=rt();return x.createElement(sh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:w8,name:"Popover.Group"}))}let E8=x.createContext(null),S8=Ge(v8),P8=Ge(x8),T8=Object.assign(S8,{Group:P8});const Js={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function ih(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function A8(e,t,n){let r=nt();if(t.kind==="Tracked"){let o=function(){s!==ih(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function $8(){let e=typeof document>"u";return"useSyncExternalStore"in z?(t=>t.useSyncExternalStore)(z)(()=>()=>{},()=>!1,()=>!e):!1}function ah(){let e=$8(),[t,n]=z.useState(Rt.isHandoffComplete);return t&&Rt.isHandoffComplete===!1&&n(!1),z.useEffect(()=>{t!==!0&&n(!0)},[t]),z.useEffect(()=>Rt.handoff(),[]),e?!1:t}function N8(){let e=x.useRef(!1);return Ee(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ch(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Io((t=e.as)!=null?t:uh)||x.Children.count(e.children)===1}let ei=x.createContext(null);ei.displayName="TransitionContext";var C8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(C8||{});function O8(){let e=x.useContext(ei);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function I8(){let e=x.useContext(ti);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let ti=x.createContext(null);ti.displayName="NestingContext";function ni(e){return"children"in e?ni(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function lh(e,t){let n=qn(e),r=x.useRef([]),o=N8(),s=Gn(),i=ue((d,h=Pn.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===d);m!==-1&&(ft(h,{[Pn.Unmount](){r.current.splice(m,1)},[Pn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var v;!ni(r)&&o.current&&((v=n.current)==null||v.call(n))}))}),c=ue(d=>{let h=r.current.find(({el:m})=>m===d);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:d,state:"visible"}),()=>i(d,Pn.Unmount)}),a=x.useRef([]),l=x.useRef(Promise.resolve()),u=x.useRef({enter:[],leave:[]}),f=ue((d,h,m)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([v])=>v!==d)),t==null||t.chains.current[h].push([d,new Promise(v=>{a.current.push(v)})]),t==null||t.chains.current[h].push([d,new Promise(v=>{Promise.all(u.current[h].map(([T,E])=>E)).then(()=>v())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=ue((d,h,m)=>{Promise.all(u.current[h].splice(0).map(([v,T])=>T)).then(()=>{var v;(v=a.current.shift())==null||v()}).then(()=>m(h))});return x.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:p,wait:l,chains:u}),[c,i,r,f,p,u,l])}let uh=x.Fragment,fh=Ls.RenderStrategy;function k8(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:c,afterLeave:a,enter:l,enterFrom:u,enterTo:f,entered:p,leave:d,leaveFrom:h,leaveTo:m,...v}=e,[T,E]=x.useState(null),S=x.useRef(null),C=ch(e),M=dt(...C?[S,t,E]:t===null?[]:[t]),B=(n=v.unmount)==null||n?Pn.Unmount:Pn.Hidden,{show:F,appear:b,initial:g}=O8(),[w,O]=x.useState(F?"visible":"hidden"),N=I8(),{register:I,unregister:k}=N;Ee(()=>I(S),[I,S]),Ee(()=>{if(B===Pn.Hidden&&S.current){if(F&&w!=="visible"){O("visible");return}return ft(w,{hidden:()=>k(S),visible:()=>I(S)})}},[w,S,I,k,F,B]);let y=ah();Ee(()=>{if(C&&y&&w==="visible"&&S.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[S,w,y,C]);let $=g&&!b,A=b&&F&&g,P=x.useRef(!1),L=lh(()=>{P.current||(O("hidden"),k(S))},N),j=ue(Z=>{P.current=!0;let J=Z?"enter":"leave";L.onStart(S,J,oe=>{oe==="enter"?s==null||s():oe==="leave"&&(c==null||c())})}),U=ue(Z=>{let J=Z?"enter":"leave";P.current=!1,L.onStop(S,J,oe=>{oe==="enter"?i==null||i():oe==="leave"&&(a==null||a())}),J==="leave"&&!ni(L)&&(O("hidden"),k(S))});x.useEffect(()=>{C&&o||(j(F),U(F))},[F,C,o]);let _=!(!o||!C||!y||$),[,H]=hp(_,T,F,{start:j,end:U}),Y=Tn({ref:M,className:((r=yc(v.className,A&&l,A&&u,H.enter&&l,H.enter&&H.closed&&u,H.enter&&!H.closed&&f,H.leave&&d,H.leave&&!H.closed&&h,H.leave&&H.closed&&m,!H.transition&&F&&p))==null?void 0:r.trim())||void 0,...pp(H)}),G=0;w==="visible"&&(G|=Ot.Open),w==="hidden"&&(G|=Ot.Closed),F&&w==="hidden"&&(G|=Ot.Opening),!F&&w==="visible"&&(G|=Ot.Closing);let W=rt();return x.createElement(ti.Provider,{value:L},x.createElement(nh,{value:G},W({ourProps:Y,theirProps:v,defaultTag:uh,features:fh,visible:w==="visible",name:"Transition.Child"})))}function D8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=x.useRef(null),c=ch(e),a=dt(...c?[i,t]:t===null?[]:[t]);ah();let l=el();if(n===void 0&&l!==null&&(n=(l&Ot.Open)===Ot.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=x.useState(n?"visible":"hidden"),p=lh(()=>{n||f("hidden")}),[d,h]=x.useState(!0),m=x.useRef([n]);Ee(()=>{d!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let v=x.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);Ee(()=>{n?f("visible"):!ni(p)&&i.current!==null&&f("hidden")},[n,p]);let T={unmount:o},E=ue(()=>{var M;d&&h(!1),(M=e.beforeEnter)==null||M.call(e)}),S=ue(()=>{var M;d&&h(!1),(M=e.beforeLeave)==null||M.call(e)}),C=rt();return x.createElement(ti.Provider,{value:p},x.createElement(ei.Provider,{value:v},C({ourProps:{...T,as:x.Fragment,children:x.createElement(dh,{ref:a,...T,...s,beforeEnter:E,beforeLeave:S})},theirProps:{},defaultTag:x.Fragment,features:fh,visible:u==="visible",name:"Transition"})))}function M8(e,t){let n=x.useContext(ei)!==null,r=el()!==null;return x.createElement(x.Fragment,null,!n&&r?x.createElement(tl,{ref:t,...e}):x.createElement(dh,{ref:t,...e}))}let tl=Ge(D8),dh=Ge(k8),L8=Ge(M8),nl=Object.assign(tl,{Child:L8,Root:tl}),ph=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function hh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!on(o))return r;let s=!1;for(let c of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))c.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return ph.test(i)&&(i=i.replace(ph,"")),i}function B8(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():hh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return hh(e).trim()}function F8(e){let t=x.useRef(""),n=x.useRef("");return ue(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=B8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var R8=Object.defineProperty,j8=(e,t,n)=>t in e?R8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mh=(e,t,n)=>(j8(e,typeof t!="symbol"?t+"":t,n),n),Me=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Me||{}),Nn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Nn||{}),ri=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ri||{}),bh=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(bh||{});function gh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=op(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let _8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Js.Tracked(ih(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:we.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Js.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let c={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===we.Nothing)return{...c,activeOptionIndex:null};if(t.focus===we.Specific)return{...c,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===we.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===d.current||((o=d.current)==null?void 0:o.previousElementSibling)===null)return{...c,activeOptionIndex:p}}}}else if(t.focus===we.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=Qs(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});if(p!==null){let d=e.options[p].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===d.current||((i=d.current)==null?void 0:i.nextElementSibling)===null)return{...c,activeOptionIndex:p}}}}let a=gh(e),l=Qs(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...c,...a,activeOptionIndex:l}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var c;return!i.dataRef.current.disabled&&((c=i.dataRef.current.textValue)==null?void 0:c.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==we.Nothing&&(r=Qs(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:we.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...gh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Js.Moved}}};class rl extends G0{constructor(t){super(t),mh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return ft(s,{0:()=>r==null?void 0:r(n),1:()=>{let c=i.slice(),a=c.findIndex(l=>o(l,n));return a===-1?c.push(n):c.splice(a,1),r==null?void 0:r(c)}})},registerOption:Pc(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Pc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Pc(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),mh(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=Tc.get(null);this.disposables.add(r.on(Y0.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(A8(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new rl({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:we.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Js.Idle})}reduce(t,n){return ft(n.type,_8,t,n)}}const yh=x.createContext(null);function ol(e){let t=x.useContext(yh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,vh),n}return t}function vh({id:e,__demoMode:t=!1}){let n=x.useMemo(()=>rl.new({id:e,__demoMode:t}),[]);return rh(()=>n.dispose()),n}let oi=x.createContext(null);oi.displayName="ListboxDataContext";function _o(e){let t=x.useContext(oi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,_o),n}return t}let z8=x.Fragment;function U8(e,t){let n=x.useId(),r=gc(),{value:o,defaultValue:s,form:i,name:c,onChange:a,by:l,invalid:u=!1,disabled:f=r||!1,horizontal:p=!1,multiple:d=!1,__demoMode:h=!1,...m}=e;const v=p?"horizontal":"vertical";let T=dt(t),E=cx(s),[S=d?[]:void 0,C]=ax(o,a,E),M=vh({id:n,__demoMode:h}),B=x.useRef({static:!1,hold:!1}),F=x.useRef(new Map),b=Mx(l),g=x.useCallback(_=>ft(w.mode,{[Nn.Multi]:()=>S.some(H=>b(H,_)),[Nn.Single]:()=>b(S,_)}),[S]),w=Sn({value:S,disabled:f,invalid:u,mode:d?Nn.Multi:Nn.Single,orientation:v,onChange:C,compare:b,isSelected:g,optionsPropsRef:B,listRef:F});Ee(()=>{M.state.dataRef.current=w},[w]);let O=qe(M,_=>_.listboxState),N=Tc.get(null),I=qe(N,x.useCallback(_=>N.selectors.isTop(_,n),[N,n])),[k,y]=qe(M,_=>[_.buttonElement,_.optionsElement]);a2(I,[k,y],(_,H)=>{M.send({type:bh.CloseListbox}),rp(H,kc.Loose)||(_.preventDefault(),k==null||k.focus())});let $=Sn({open:O===Me.Open,disabled:f,invalid:u,value:S}),[A,P]=Nx({inherit:!0}),L={ref:T},j=x.useCallback(()=>{if(E!==void 0)return C==null?void 0:C(E)},[C,E]),U=rt();return x.createElement(P,{value:A,props:{htmlFor:k==null?void 0:k.id},slot:{open:O===Me.Open,disabled:f}},x.createElement(u8,null,x.createElement(yh.Provider,{value:M},x.createElement(oi.Provider,{value:w},x.createElement(nh,{value:ft(O,{[Me.Open]:Ot.Open,[Me.Closed]:Ot.Closed})},c!=null&&S!=null&&x.createElement(mx,{disabled:f,data:{[c]:S},form:i,onReset:j}),U({ourProps:L,theirProps:m,slot:$,defaultTag:z8,name:"Listbox"}))))))}let W8="button";function H8(e,t){let n=x.useId(),r=I0(),o=_o("Listbox.Button"),s=ol("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...l}=e,u=dt(t,i8(),s.actions.setButtonElement),f=a8(),[p,d,h]=qe(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),m=p===Me.Open;u2(m,{trigger:d,action:x.useCallback(y=>{if(d!=null&&d.contains(y.target))return js.Ignore;let $=y.target.closest('[role="option"]:not([data-disabled])');return on($)?js.Select($):h!=null&&h.contains(y.target)?js.Ignore:js.Close},[d,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let v=ue(y=>{switch(y.key){case Oe.Enter:lx(y.currentTarget);break;case Oe.Space:case Oe.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.First});break;case Oe.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.Last});break}}),T=ue(y=>{switch(y.key){case Oe.Space:y.preventDefault();break}}),E=Bx(y=>{var $;s.state.listboxState===Me.Open?(je.flushSync(()=>s.actions.closeListbox()),($=s.state.buttonElement)==null||$.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:we.Nothing}))}),S=ue(y=>y.preventDefault()),C=_0([i]),M=Px(),{isFocusVisible:B,focusProps:F}=q5({autoFocus:a}),{isHovered:b,hoverProps:g}=G5({isDisabled:c}),{pressed:w,pressProps:O}=ex({disabled:c}),N=Sn({open:p===Me.Open,active:w||p===Me.Open,disabled:c,invalid:o.invalid,value:o.value,hover:b,focus:B,autofocus:a}),I=qe(s,y=>y.listboxState===Me.Open),k=A0(f(),{ref:u,id:i,type:f2(e,d),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":I,"aria-labelledby":C,"aria-describedby":M,disabled:c||void 0,autoFocus:a,onKeyDown:v,onKeyUp:T,onKeyPress:S},E,F,g,O);return rt()({ourProps:k,theirProps:l,slot:N,defaultTag:W8,name:"Listbox.Button"})}let wh=x.createContext(!1),V8="div",G8=Ls.RenderStrategy|Ls.Static;function q8(e,t){let n=x.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,l=s8(o),[u,f]=x.useState(null);l&&(s=!0);let p=_o("Listbox.Options"),d=ol("Listbox.Options"),[h,m,v,T]=qe(d,W=>[W.listboxState,W.buttonElement,W.optionsElement,W.__demoMode]),E=Dc(m),S=Dc(v),C=el(),[M,B]=hp(c,u,C!==null?(C&Ot.Open)===Ot.Open:h===Me.Open);Kx(M,m,d.actions.closeListbox);let F=T?!1:i&&h===Me.Open;y2(F,S);let b=T?!1:i&&h===Me.Open;Zx(b,{allowed:x.useCallback(()=>[m,v],[m,v])});let g=qe(d,d.selectors.didButtonMove)?!1:M,w=qe(d,d.selectors.hasFrozenValue)&&!e.static,O=th(w,p.value),N=x.useCallback(W=>p.compare(O,W),[p.compare,O]),I=qe(d,W=>{var Z;if(l==null||!((Z=l==null?void 0:l.to)!=null&&Z.includes("selection")))return null;let J=W.options.findIndex(oe=>N(oe.dataRef.current.value));return J===-1&&(J=0),J}),k=(()=>{if(l==null)return;if(I===null)return{...l,inner:void 0};let W=Array.from(p.listRef.current.values());return{...l,inner:{listRef:{current:W},index:I}}})(),[y,$]=l8(k),A=c8(),P=dt(t,l?y:null,d.actions.setOptionsElement,f),L=Gn();x.useEffect(()=>{let W=v;W&&h===Me.Open&&(X5(W)||W==null||W.focus({preventScroll:!0}))},[h,v]);let j=ue(W=>{var Z;switch(L.dispose(),W.key){case Oe.Space:if(d.state.searchQuery!=="")return W.preventDefault(),W.stopPropagation(),d.actions.search(W.key);case Oe.Enter:W.preventDefault(),W.stopPropagation(),d.actions.selectActiveOption();break;case ft(p.orientation,{vertical:Oe.ArrowDown,horizontal:Oe.ArrowRight}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.Next});case ft(p.orientation,{vertical:Oe.ArrowUp,horizontal:Oe.ArrowLeft}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.Previous});case Oe.Home:case Oe.PageUp:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.First});case Oe.End:case Oe.PageDown:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:we.Last});case Oe.Escape:W.preventDefault(),W.stopPropagation(),je.flushSync(()=>d.actions.closeListbox()),(Z=d.state.buttonElement)==null||Z.focus({preventScroll:!0});return;case Oe.Tab:W.preventDefault(),W.stopPropagation(),je.flushSync(()=>d.actions.closeListbox()),r2(d.state.buttonElement,W.shiftKey?Ic.Previous:Ic.Next);break;default:W.key.length===1&&(d.actions.search(W.key),L.setTimeout(()=>d.actions.clearSearch(),350));break}}),U=qe(d,W=>{var Z;return(Z=W.buttonElement)==null?void 0:Z.id}),_=Sn({open:h===Me.Open}),H=A0(l?A():{},{id:r,ref:P,"aria-activedescendant":qe(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===Nn.Multi?!0:void 0,"aria-labelledby":U,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===Me.Open?0:void 0,style:{...a.style,...$,"--button-width":Lx(M,m,!0).width},...pp(B)}),Y=rt(),G=x.useMemo(()=>p.mode===Nn.Multi?p:{...p,isSelected:N},[p,N]);return x.createElement(T8,{enabled:s?e.static||M:!1,ownerDocument:E},x.createElement(oi.Provider,{value:G},Y({ourProps:H,theirProps:a,slot:_,defaultTag:V8,features:G8,visible:g,name:"Listbox.Options"})))}let Z8="div";function K8(e,t){let n=x.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=x.useContext(wh)===!0,a=_o("Listbox.Option"),l=ol("Listbox.Option"),u=qe(l,w=>l.selectors.isActive(w,r)),f=a.isSelected(s),p=x.useRef(null),d=F8(p),h=qn({disabled:o,value:s,domRef:p,get textValue(){return d()}}),m=dt(t,p,w=>{w?a.listRef.current.set(r,w):a.listRef.current.delete(r)}),v=qe(l,w=>l.selectors.shouldScrollIntoView(w,r));Ee(()=>{if(v)return nt().requestAnimationFrame(()=>{var w,O;(O=(w=p.current)==null?void 0:w.scrollIntoView)==null||O.call(w,{block:"nearest"})})},[v,p]),Ee(()=>{if(!c)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,c]);let T=ue(w=>{if(o)return w.preventDefault();l.actions.selectOption(s)}),E=ue(()=>{if(o)return l.actions.goToOption({focus:we.Nothing});l.actions.goToOption({focus:we.Specific,id:r})}),S=v2(),C=ue(w=>S.update(w)),M=ue(w=>{S.wasMoved(w)&&(o||u&&l.state.activationTrigger===ri.Pointer||l.actions.goToOption({focus:we.Specific,id:r},ri.Pointer))}),B=ue(w=>{S.wasMoved(w)&&(o||u&&l.state.activationTrigger===ri.Pointer&&l.actions.goToOption({focus:we.Nothing}))}),F=Sn({active:u,focus:u,selected:f,disabled:o,selectedOption:f&&c}),b=c?{}:{id:r,ref:m,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:T,onFocus:E,onPointerEnter:C,onMouseEnter:C,onPointerMove:M,onMouseMove:M,onPointerLeave:B,onMouseLeave:B},g=rt();return!f&&c?null:g({ourProps:b,theirProps:i,slot:F,defaultTag:Z8,name:"Listbox.Option"})}let Y8=x.Fragment;function X8(e,t){let{options:n,placeholder:r,...o}=e,s={ref:dt(t)},i=_o("ListboxSelectedOption"),c=Sn({}),a=i.value===void 0||i.value===null||i.mode===Nn.Multi&&Array.isArray(i.value)&&i.value.length===0,l=rt();return x.createElement(wh.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:x.createElement(x.Fragment,null,r&&a?r:n)},slot:c,defaultTag:Y8,name:"ListboxSelectedOption"}))}let Q8=Ge(U8),J8=Ge(H8),e3=kx,t3=Ge(q8),n3=Ge(K8),r3=Ge(X8),mt=Object.assign(Q8,{Button:J8,Label:e3,Options:t3,Option:n3,SelectedOption:r3});const o3=()=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_active)",children:D.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_active",children:D.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),s3=()=>D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_inactive)",children:D.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_inactive",children:D.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),zo=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return D.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>D.jsx("div",{className:"flex items-center justify-center",children:o>t-e?D.jsx(o3,{}):D.jsx(s3,{})},o))})};class It{}Go(It,"FAST",3),Go(It,"Medium",2),Go(It,"SLOW",1),Go(It,"NONE",0);const i3=Object.values({MAINNET:1,SEPOLIA:11155111}),un=e=>{const t=typeof e=="string"?parseInt(e,10):e;return i3.includes(t)},a3={USDT:!0},xh=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!a3[t.toUpperCase()]:!0},c3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=wt();return D.jsx("div",{className:`relative ${o}`,children:D.jsx(mt,{value:t,onChange:n,disabled:r,children:({open:c})=>D.jsxs(D.Fragment,{children:[D.jsxs(mt.Button,{className:`
|
|
132
140
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
133
141
|
items-center justify-between flex px-3 rounded-lg
|
|
134
142
|
focus:outline-none
|
|
135
143
|
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
136
144
|
${c?"ring-1 ring-white":""}
|
|
137
|
-
`,children:[
|
|
145
|
+
`,children:[D.jsx("span",{className:"text-sm leading-[18px] font-medium",children:i("deposit.chain")}),D.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?D.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):D.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:D.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),D.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),D.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${c?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_12919_27745)",children:D.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_12919_27745",children:D.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),D.jsx(nl,{as:x.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:D.jsx(mt.Options,{className:`
|
|
138
146
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
139
147
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
140
148
|
focus:outline-none
|
|
141
|
-
`,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>
|
|
149
|
+
`,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>D.jsx(mt.Option,{value:a,className:({active:l,selected:u})=>`relative cursor-pointer select-none py-3 px-3 ${u?"bg-fill-btn-secondary":l?"bg-fill-input-secondary":""}`,children:({selected:l,active:u})=>D.jsx(D.Fragment,{children:D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{className:"flex items-center space-x-3",children:[a.chainIconUrl?D.jsx("img",{src:a.chainIconUrl,alt:a.chain,className:"w-5 h-5 rounded-full"}):D.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:D.jsx("span",{className:"text-xs text-white font-bold",children:a.chain.charAt(0)})}),D.jsx("div",{className:"flex flex-col",children:D.jsx("span",{className:`text-sm font-medium ${l||u?"text-text-primary":"text-text-tertiary"}`,children:a.chain})})]}),D.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:D.jsx(zo,{className:"w-full justify-between",selectedLevel:un(a.chainId)?It.SLOW:It.FAST,maxLevel:3})})]})})},a.chainId))})})]})})})},l3=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:c}=wt(),a=l=>l.token||l.symbol;return D.jsx("div",{className:`relative ${o}`,children:D.jsx(mt,{value:t,onChange:n,disabled:r,children:({open:l})=>D.jsxs(D.Fragment,{children:[D.jsxs(mt.Button,{className:`
|
|
142
150
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
143
151
|
items-center justify-between flex px-3 rounded-lg
|
|
144
152
|
focus:outline-none
|
|
145
153
|
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
146
|
-
${
|
|
147
|
-
`,children:[
|
|
154
|
+
${l?"ring-1 ring-white":""}
|
|
155
|
+
`,children:[D.jsx("span",{className:"text-sm leading-[18px] font-medium",children:c("deposit.asset")}),D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsx("img",{src:t.iconUrl,alt:a(t),className:"w-4 h-4 rounded-full"}),D.jsx("span",{className:"text-sm text-white ml-1",children:a(t)}),D.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${l?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:D.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_asset_selector",children:D.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),D.jsx(nl,{as:x.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:D.jsx(mt.Options,{className:`
|
|
148
156
|
absolute z-50 mt-1 w-full max-h-[230px] overflow-y-auto rounded-lg
|
|
149
157
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
150
158
|
focus:outline-none
|
|
151
|
-
`,children:e.map(
|
|
159
|
+
`,children:e.map(u=>D.jsx(mt.Option,{value:u,className:({active:f,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:p})=>D.jsxs("div",{className:"flex items-center space-x-3",children:[D.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),D.jsxs("div",{className:"flex flex-col",children:[D.jsx("span",{className:`text-sm font-medium ${f||p?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===xn&&i==="perpetual"&&u.token==="USDC"&&D.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:c("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},Eh=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=xn,txType:i="deposit",accountType:c})=>{const a=x.useCallback(v=>i==="withdraw"?s===xn?v.allowAaWithdraw!==!1:v.allowWithdraw!==!1:s===xn?v.allowAaDeposit!==!1:v.allowDeposit!==!1,[i,s]),l=x.useMemo(()=>{const v=new Set,T=[];for(const E of t)if(a(E))for(const S of E.tokenList||[]){const C=S.symbol||S.token;!C||!(i!=="withdraw"||S.withdrawEnable===!0&&S.pullOff===!1)||v.has(C)||(v.add(C),T.push({token:C,symbol:C,iconUrl:S.iconUrl,decimals:S.decimals,tokenAddress:S.tokenAddress}))}return T},[t,a,i]),u=v=>{n(v.chainId)},f=v=>{const T=v.symbol||v.token;o(T);const E=[];for(const S of t){if(!a(S))continue;(S.tokenList||[]).some(M=>(M.symbol||M.token)===T)&&E.push(S.chainId)}!E.includes(e.chainId)&&E[0]!==void 0&&n(E[0])},p=x.useMemo(()=>{var E,S;const v=r||((E=l[0])==null?void 0:E.symbol)||((S=l[0])==null?void 0:S.token);if(!v)return[];const T=[];for(const C of t){if(!a(C))continue;const M=(C.tokenList||[]).find(B=>(B.symbol||B.token)===v?i==="withdraw"?B.withdrawEnable===!0&&B.pullOff===!1:!0:!1);M&&T.push({...C,tokenList:[{token:M.token,symbol:M.symbol,iconUrl:M.iconUrl,decimals:M.decimals,tokenAddress:M.tokenAddress}]})}return T},[t,r,l,a,i]),d=x.useMemo(()=>p.find(v=>v.chainId===e.chainId)||p[0],[p,e.chainId]),h=x.useMemo(()=>l,[l]),m=x.useMemo(()=>{if(h.length!==0)return h.find(v=>v.token===r||v.symbol===r)||h[0]},[h,r]);return x.useEffect(()=>{if(h.length===0)return;if(!h.some(T=>(T.symbol||T.token)===r)){const T=h[0];o(T.symbol||T.token)}},[h,r,o]),x.useEffect(()=>{if(p.length===0)return;p.some(T=>T.chainId===e.chainId)||n(p[0].chainId)},[p,e.chainId,n]),D.jsxs("div",{className:"space-y-4",children:[h.length>0&&m&&D.jsx(l3,{tokens:h,selectedToken:m,onTokenChange:f,walletType:s,accountType:c}),D.jsx(c3,{chains:p,selectedChain:d,onChainChange:v=>{const T=t.find(E=>E.chainId===v.chainId);T&&u(T)},walletType:s,className:"w-full"})]})},u3=({options:e})=>D.jsx(D.Fragment,{children:e.map(t=>D.jsx(mt.Option,{value:t.value,className:({active:n,selected:r})=>`relative cursor-pointer select-none py-3 px-3 ${r?"bg-fill-btn-secondary":n?"bg-fill-input-secondary":""}`,children:({selected:n,active:r})=>D.jsx("div",{className:"flex items-center justify-between",children:D.jsx("div",{className:"flex items-center space-x-3",children:D.jsx("div",{className:"flex flex-col",children:D.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Sh=({selectedAccount:e,onAccountChange:t,disabled:n=!1,className:r=""})=>{var f;const{t:o}=wt(),s=x.useMemo(()=>[{value:"spot",label:o("account.spot")},{value:"perpetual",label:o("account.perpetual")}],[o]),i=((f=s.find(p=>p.value===(e??"spot")))==null?void 0:f.label)||"",[c,a]=x.useState(e??"spot"),l=e??c,u=p=>{t==null||t(p),e||a(p)};return D.jsx("div",{className:`relative mb-4 ${r}`,children:D.jsx(mt,{value:l,onChange:u,disabled:n,children:({open:p})=>D.jsxs(D.Fragment,{children:[D.jsxs(mt.Button,{className:`
|
|
152
160
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
153
161
|
items-center justify-between flex px-3 rounded-lg
|
|
154
162
|
focus:outline-none
|
|
155
163
|
${n?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
156
164
|
${p?"ring-1 ring-white":""}
|
|
157
|
-
`,children:[
|
|
165
|
+
`,children:[D.jsx("span",{className:"text-sm leading-[18px] font-medium",children:o("account.title")}),D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsx("span",{className:"text-sm text-white ml-1",children:i}),D.jsxs("svg",{className:`w-3 h-3 ml-2 transition-transform duration-200 ${p?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",children:[D.jsx("g",{clipPath:"url(#clip0_asset_selector)",children:D.jsx("path",{d:"M5.32733 7.6716C5.13944 7.83432 4.86056 7.83432 4.67267 7.6716L1.68366 5.08304C1.33371 4.77997 1.54804 4.20508 2.01099 4.20508L7.98901 4.20508C8.45196 4.20508 8.66629 4.77998 8.31634 5.08304L5.32733 7.6716Z",fill:"#F9F9F9"})}),D.jsx("defs",{children:D.jsx("clipPath",{id:"clip0_asset_selector",children:D.jsx("rect",{width:"10",height:"10",fill:"white",transform:"translate(0 0.955078)"})})})]})]})]}),D.jsx(nl,{as:x.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:D.jsx(mt.Options,{className:`
|
|
158
166
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
159
167
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
160
168
|
focus:outline-none
|
|
161
|
-
`,children:
|
|
169
|
+
`,children:D.jsx(u3,{options:s})})})]})})})};var si={},f3=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},d3=f3,Ph={"text/plain":"Text","text/html":"Url",default:"Text"},p3="Copy to clipboard: #{key}, Enter";function h3(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function m3(e,t){var n,r,o,s,i,c,a=!1;t||(t={}),n=t.debug||!1;try{o=d3(),s=document.createRange(),i=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=Ph[t.format]||Ph.default;window.clipboardData.setData(f,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(c),s.selectNodeContents(c),i.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");a=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(f){n&&console.error("unable to copy using clipboardData: ",f),n&&console.error("falling back to prompt"),r=h3("message"in t?t.message:p3),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),c&&document.body.removeChild(c),o()}return a}var b3=m3;function sl(e){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sl(e)}Object.defineProperty(si,"__esModule",{value:!0}),si.CopyToClipboard=void 0;var ii=Th(x),g3=Th(b3),y3=["text","onCopy","options","children"];function Th(e){return e&&e.__esModule?e:{default:e}}function Ah(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ah(Object(n),!0).forEach(function(r){al(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v3(e,t){if(e==null)return{};var n=w3(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function w3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function x3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S3(e,t,n){return t&&E3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function P3(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&il(e,t)}function il(e,t){return il=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},il(e,t)}function T3(e){var t=$3();return function(){var r=ai(e),o;if(t){var s=ai(this).constructor;o=Reflect.construct(r,arguments,s)}else o=r.apply(this,arguments);return A3(this,o)}}function A3(e,t){if(t&&(sl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nh(e)}function Nh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ai(e){return ai=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ai(e)}function al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ch=function(e){P3(n,e);var t=T3(n);function n(){var r;x3(this,n);for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),al(Nh(r),"onClick",function(c){var a=r.props,l=a.text,u=a.onCopy,f=a.children,p=a.options,d=ii.default.Children.only(f),h=(0,g3.default)(l,p);u&&u(l,h),d&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(c)}),r}return S3(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var s=o.children,i=v3(o,y3),c=ii.default.Children.only(s);return ii.default.cloneElement(c,$h($h({},i),{},{onClick:this.onClick}))}}]),n}(ii.default.PureComponent);si.CopyToClipboard=Ch,al(Ch,"defaultProps",{onCopy:void 0,options:void 0});var N3=si,cl=N3.CopyToClipboard;cl.CopyToClipboard=cl;var C3=cl;const O3=Lm(C3);var I3=Object.defineProperty,ci=Object.getOwnPropertySymbols,Oh=Object.prototype.hasOwnProperty,Ih=Object.prototype.propertyIsEnumerable,kh=(e,t,n)=>t in e?I3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ll=(e,t)=>{for(var n in t||(t={}))Oh.call(t,n)&&kh(e,n,t[n]);if(ci)for(var n of ci(t))Ih.call(t,n)&&kh(e,n,t[n]);return e},ul=(e,t)=>{var n={};for(var r in e)Oh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ci)for(var r of ci(e))t.indexOf(r)<0&&Ih.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
162
170
|
* @license QR Code generator library (TypeScript)
|
|
163
171
|
* Copyright (c) Project Nayuki.
|
|
164
172
|
* SPDX-License-Identifier: MIT
|
|
165
|
-
*/var Xn;(e=>{const t=class ae{constructor(a,u,l,f){if(this.version=a,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let p=[];for(let h=0;h<this.size;h++)p.push(!1);for(let h=0;h<this.size;h++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const d=this.addEccAndInterleave(l);if(this.drawCodewords(d),f==-1){let h=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const w=this.getPenaltyScore();w<h&&(f=m,h=w),this.applyMask(m)}}o(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(a,u){const l=e.QrSegment.makeSegments(a);return ae.encodeSegments(l,u)}static encodeBinary(a,u){const l=e.QrSegment.makeBytes(a);return ae.encodeSegments([l],u)}static encodeSegments(a,u,l=1,f=40,p=-1,d=!0){if(!(ae.MIN_VERSION<=l&&l<=f&&f<=ae.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let h,m;for(h=l;;h++){const S=ae.getNumDataCodewords(h,u)*8,N=i.getTotalBits(a,h);if(N<=S){m=N;break}if(h>=f)throw new RangeError("Data too long")}for(const S of[ae.Ecc.MEDIUM,ae.Ecc.QUARTILE,ae.Ecc.HIGH])d&&m<=ae.getNumDataCodewords(h,S)*8&&(u=S);let w=[];for(const S of a){n(S.mode.modeBits,4,w),n(S.numChars,S.mode.numCharCountBits(h),w);for(const N of S.getData())w.push(N)}o(w.length==m);const $=ae.getNumDataCodewords(h,u)*8;o(w.length<=$),n(0,Math.min(4,$-w.length),w),n(0,(8-w.length%8)%8,w),o(w.length%8==0);for(let S=236;w.length<$;S^=253)n(S,8,w);let E=[];for(;E.length*8<w.length;)E.push(0);return w.forEach((S,N)=>E[N>>>3]|=S<<7-(N&7)),new ae(h,u,E,p)}getModule(a,u){return 0<=a&&a<this.size&&0<=u&&u<this.size&&this.modules[u][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const a=this.getAlignmentPatternPositions(),u=a.length;for(let l=0;l<u;l++)for(let f=0;f<u;f++)l==0&&f==0||l==0&&f==u-1||l==u-1&&f==0||this.drawAlignmentPattern(a[l],a[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){const u=this.errorCorrectionLevel.formatBits<<3|a;let l=u;for(let p=0;p<10;p++)l=l<<1^(l>>>9)*1335;const f=(u<<10|l)^21522;o(f>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(f,p));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(f,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(f,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(f,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let l=0;l<12;l++)a=a<<1^(a>>>11)*7973;const u=this.version<<12|a;o(u>>>18==0);for(let l=0;l<18;l++){const f=r(u,l),p=this.size-11+l%3,d=Math.floor(l/3);this.setFunctionModule(p,d,f),this.setFunctionModule(d,p,f)}}drawFinderPattern(a,u){for(let l=-4;l<=4;l++)for(let f=-4;f<=4;f++){const p=Math.max(Math.abs(f),Math.abs(l)),d=a+f,h=u+l;0<=d&&d<this.size&&0<=h&&h<this.size&&this.setFunctionModule(d,h,p!=2&&p!=4)}}drawAlignmentPattern(a,u){for(let l=-2;l<=2;l++)for(let f=-2;f<=2;f++)this.setFunctionModule(a+f,u+l,Math.max(Math.abs(f),Math.abs(l))!=1)}setFunctionModule(a,u,l){this.modules[u][a]=l,this.isFunction[u][a]=!0}addEccAndInterleave(a){const u=this.version,l=this.errorCorrectionLevel;if(a.length!=ae.getNumDataCodewords(u,l))throw new RangeError("Invalid argument");const f=ae.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][u],p=ae.ECC_CODEWORDS_PER_BLOCK[l.ordinal][u],d=Math.floor(ae.getNumRawDataModules(u)/8),h=f-d%f,m=Math.floor(d/f);let w=[];const $=ae.reedSolomonComputeDivisor(p);for(let S=0,N=0;S<f;S++){let B=a.slice(N,N+m-p+(S<h?0:1));N+=B.length;const F=ae.reedSolomonComputeRemainder(B,$);S<h&&B.push(0),w.push(B.concat(F))}let E=[];for(let S=0;S<w[0].length;S++)w.forEach((N,B)=>{(S!=m-p||B>=h)&&E.push(N[S])});return o(E.length==d),E}drawCodewords(a){if(a.length!=Math.floor(ae.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let l=this.size-1;l>=1;l-=2){l==6&&(l=5);for(let f=0;f<this.size;f++)for(let p=0;p<2;p++){const d=l-p,m=(l+1&2)==0?this.size-1-f:f;!this.isFunction[m][d]&&u<a.length*8&&(this.modules[m][d]=r(a[u>>>3],7-(u&7)),u++)}}o(u==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let u=0;u<this.size;u++)for(let l=0;l<this.size;l++){let f;switch(a){case 0:f=(l+u)%2==0;break;case 1:f=u%2==0;break;case 2:f=l%3==0;break;case 3:f=(l+u)%3==0;break;case 4:f=(Math.floor(l/3)+Math.floor(u/2))%2==0;break;case 5:f=l*u%2+l*u%3==0;break;case 6:f=(l*u%2+l*u%3)%2==0;break;case 7:f=((l+u)%2+l*u%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[u][l]&&f&&(this.modules[u][l]=!this.modules[u][l])}}getPenaltyScore(){let a=0;for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[p][w]==d?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*ae.PENALTY_N3),d=this.modules[p][w],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*ae.PENALTY_N3}for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[w][p]==d?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*ae.PENALTY_N3),d=this.modules[w][p],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*ae.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let d=0;d<this.size-1;d++){const h=this.modules[p][d];h==this.modules[p][d+1]&&h==this.modules[p+1][d]&&h==this.modules[p+1][d+1]&&(a+=ae.PENALTY_N2)}let u=0;for(const p of this.modules)u=p.reduce((d,h)=>d+(h?1:0),u);const l=this.size*this.size,f=Math.ceil(Math.abs(u*20-l*10)/l)-1;return o(0<=f&&f<=9),a+=f*ae.PENALTY_N4,o(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2;let l=[6];for(let f=this.size-7;l.length<a;f-=u)l.splice(1,0,f);return l}}static getNumRawDataModules(a){if(a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*a+128)*a+64;if(a>=2){const l=Math.floor(a/7)+2;u-=(25*l-10)*l-55,a>=7&&(u-=36)}return o(208<=u&&u<=29648),u}static getNumDataCodewords(a,u){return Math.floor(ae.getNumRawDataModules(a)/8)-ae.ECC_CODEWORDS_PER_BLOCK[u.ordinal][a]*ae.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let u=[];for(let f=0;f<a-1;f++)u.push(0);u.push(1);let l=1;for(let f=0;f<a;f++){for(let p=0;p<u.length;p++)u[p]=ae.reedSolomonMultiply(u[p],l),p+1<u.length&&(u[p]^=u[p+1]);l=ae.reedSolomonMultiply(l,2)}return u}static reedSolomonComputeRemainder(a,u){let l=u.map(f=>0);for(const f of a){const p=f^l.shift();l.push(0),u.forEach((d,h)=>l[h]^=ae.reedSolomonMultiply(d,p))}return l}static reedSolomonMultiply(a,u){if(a>>>8||u>>>8)throw new RangeError("Byte out of range");let l=0;for(let f=7;f>=0;f--)l=l<<1^(l>>>7)*285,l^=(u>>>f&1)*a;return o(l>>>8==0),l}finderPenaltyCountPatterns(a){const u=a[1];o(u<=this.size*3);const l=u>0&&a[2]==u&&a[3]==u*3&&a[4]==u&&a[5]==u;return(l&&a[0]>=u*4&&a[6]>=u?1:0)+(l&&a[6]>=u*4&&a[0]>=u?1:0)}finderPenaltyTerminateAndCount(a,u,l){return a&&(this.finderPenaltyAddHistory(u,l),u=0),u+=this.size,this.finderPenaltyAddHistory(u,l),this.finderPenaltyCountPatterns(l)}finderPenaltyAddHistory(a,u){u[0]==0&&(a+=this.size),u.pop(),u.unshift(a)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(c,a,u){if(a<0||a>31||c>>>a)throw new RangeError("Value out of range");for(let l=a-1;l>=0;l--)u.push(c>>>l&1)}function r(c,a){return(c>>>a&1)!=0}function o(c){if(!c)throw new Error("Assertion error")}const s=class xe{constructor(a,u,l){if(this.mode=a,this.numChars=u,this.bitData=l,u<0)throw new RangeError("Invalid argument");this.bitData=l.slice()}static makeBytes(a){let u=[];for(const l of a)n(l,8,u);return new xe(xe.Mode.BYTE,a.length,u)}static makeNumeric(a){if(!xe.isNumeric(a))throw new RangeError("String contains non-numeric characters");let u=[];for(let l=0;l<a.length;){const f=Math.min(a.length-l,3);n(parseInt(a.substring(l,l+f),10),f*3+1,u),l+=f}return new xe(xe.Mode.NUMERIC,a.length,u)}static makeAlphanumeric(a){if(!xe.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let u=[],l;for(l=0;l+2<=a.length;l+=2){let f=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(l))*45;f+=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(l+1)),n(f,11,u)}return l<a.length&&n(xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(l)),6,u),new xe(xe.Mode.ALPHANUMERIC,a.length,u)}static makeSegments(a){return a==""?[]:xe.isNumeric(a)?[xe.makeNumeric(a)]:xe.isAlphanumeric(a)?[xe.makeAlphanumeric(a)]:[xe.makeBytes(xe.toUtf8ByteArray(a))]}static makeEci(a){let u=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)n(a,8,u);else if(a<16384)n(2,2,u),n(a,14,u);else if(a<1e6)n(6,3,u),n(a,21,u);else throw new RangeError("ECI assignment value out of range");return new xe(xe.Mode.ECI,0,u)}static isNumeric(a){return xe.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return xe.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,u){let l=0;for(const f of a){const p=f.mode.numCharCountBits(u);if(f.numChars>=1<<p)return 1/0;l+=4+p+f.bitData.length}return l}static toUtf8ByteArray(a){a=encodeURI(a);let u=[];for(let l=0;l<a.length;l++)a.charAt(l)!="%"?u.push(a.charCodeAt(l)):(u.push(parseInt(a.substring(l+1,l+3),16)),l+=2);return u}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=s;e.QrSegment=s})(Xn||(Xn={})),(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Xn||(Xn={})),(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Xn||(Xn={}));var Nr=Xn;/**
|
|
173
|
+
*/var Xn;(e=>{const t=class ae{constructor(a,l,u,f){if(this.version=a,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let p=[];for(let h=0;h<this.size;h++)p.push(!1);for(let h=0;h<this.size;h++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const d=this.addEccAndInterleave(u);if(this.drawCodewords(d),f==-1){let h=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const v=this.getPenaltyScore();v<h&&(f=m,h=v),this.applyMask(m)}}o(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(a,l){const u=e.QrSegment.makeSegments(a);return ae.encodeSegments(u,l)}static encodeBinary(a,l){const u=e.QrSegment.makeBytes(a);return ae.encodeSegments([u],l)}static encodeSegments(a,l,u=1,f=40,p=-1,d=!0){if(!(ae.MIN_VERSION<=u&&u<=f&&f<=ae.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let h,m;for(h=u;;h++){const S=ae.getNumDataCodewords(h,l)*8,C=i.getTotalBits(a,h);if(C<=S){m=C;break}if(h>=f)throw new RangeError("Data too long")}for(const S of[ae.Ecc.MEDIUM,ae.Ecc.QUARTILE,ae.Ecc.HIGH])d&&m<=ae.getNumDataCodewords(h,S)*8&&(l=S);let v=[];for(const S of a){n(S.mode.modeBits,4,v),n(S.numChars,S.mode.numCharCountBits(h),v);for(const C of S.getData())v.push(C)}o(v.length==m);const T=ae.getNumDataCodewords(h,l)*8;o(v.length<=T),n(0,Math.min(4,T-v.length),v),n(0,(8-v.length%8)%8,v),o(v.length%8==0);for(let S=236;v.length<T;S^=253)n(S,8,v);let E=[];for(;E.length*8<v.length;)E.push(0);return v.forEach((S,C)=>E[C>>>3]|=S<<7-(C&7)),new ae(h,l,E,p)}getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const a=this.getAlignmentPatternPositions(),l=a.length;for(let u=0;u<l;u++)for(let f=0;f<l;f++)u==0&&f==0||u==0&&f==l-1||u==l-1&&f==0||this.drawAlignmentPattern(a[u],a[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){const l=this.errorCorrectionLevel.formatBits<<3|a;let u=l;for(let p=0;p<10;p++)u=u<<1^(u>>>9)*1335;const f=(l<<10|u)^21522;o(f>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(f,p));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(f,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(f,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(f,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let u=0;u<12;u++)a=a<<1^(a>>>11)*7973;const l=this.version<<12|a;o(l>>>18==0);for(let u=0;u<18;u++){const f=r(l,u),p=this.size-11+u%3,d=Math.floor(u/3);this.setFunctionModule(p,d,f),this.setFunctionModule(d,p,f)}}drawFinderPattern(a,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const p=Math.max(Math.abs(f),Math.abs(u)),d=a+f,h=l+u;0<=d&&d<this.size&&0<=h&&h<this.size&&this.setFunctionModule(d,h,p!=2&&p!=4)}}drawAlignmentPattern(a,l){for(let u=-2;u<=2;u++)for(let f=-2;f<=2;f++)this.setFunctionModule(a+f,l+u,Math.max(Math.abs(f),Math.abs(u))!=1)}setFunctionModule(a,l,u){this.modules[l][a]=u,this.isFunction[l][a]=!0}addEccAndInterleave(a){const l=this.version,u=this.errorCorrectionLevel;if(a.length!=ae.getNumDataCodewords(l,u))throw new RangeError("Invalid argument");const f=ae.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l],p=ae.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],d=Math.floor(ae.getNumRawDataModules(l)/8),h=f-d%f,m=Math.floor(d/f);let v=[];const T=ae.reedSolomonComputeDivisor(p);for(let S=0,C=0;S<f;S++){let M=a.slice(C,C+m-p+(S<h?0:1));C+=M.length;const B=ae.reedSolomonComputeRemainder(M,T);S<h&&M.push(0),v.push(M.concat(B))}let E=[];for(let S=0;S<v[0].length;S++)v.forEach((C,M)=>{(S!=m-p||M>=h)&&E.push(C[S])});return o(E.length==d),E}drawCodewords(a){if(a.length!=Math.floor(ae.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f<this.size;f++)for(let p=0;p<2;p++){const d=u-p,m=(u+1&2)==0?this.size-1-f:f;!this.isFunction[m][d]&&l<a.length*8&&(this.modules[m][d]=r(a[l>>>3],7-(l&7)),l++)}}o(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let u=0;u<this.size;u++){let f;switch(a){case 0:f=(u+l)%2==0;break;case 1:f=l%2==0;break;case 2:f=u%3==0;break;case 3:f=(u+l)%3==0;break;case 4:f=(Math.floor(u/3)+Math.floor(l/2))%2==0;break;case 5:f=u*l%2+u*l%3==0;break;case 6:f=(u*l%2+u*l%3)%2==0;break;case 7:f=((u+l)%2+u*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][u]&&f&&(this.modules[l][u]=!this.modules[l][u])}}getPenaltyScore(){let a=0;for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[p][v]==d?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*ae.PENALTY_N3),d=this.modules[p][v],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*ae.PENALTY_N3}for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let v=0;v<this.size;v++)this.modules[v][p]==d?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*ae.PENALTY_N3),d=this.modules[v][p],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*ae.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let d=0;d<this.size-1;d++){const h=this.modules[p][d];h==this.modules[p][d+1]&&h==this.modules[p+1][d]&&h==this.modules[p+1][d+1]&&(a+=ae.PENALTY_N2)}let l=0;for(const p of this.modules)l=p.reduce((d,h)=>d+(h?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return o(0<=f&&f<=9),a+=f*ae.PENALTY_N4,o(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2;let u=[6];for(let f=this.size-7;u.length<a;f-=l)u.splice(1,0,f);return u}}static getNumRawDataModules(a){if(a<ae.MIN_VERSION||a>ae.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){const u=Math.floor(a/7)+2;l-=(25*u-10)*u-55,a>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(ae.getNumRawDataModules(a)/8)-ae.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*ae.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f<a-1;f++)l.push(0);l.push(1);let u=1;for(let f=0;f<a;f++){for(let p=0;p<l.length;p++)l[p]=ae.reedSolomonMultiply(l[p],u),p+1<l.length&&(l[p]^=l[p+1]);u=ae.reedSolomonMultiply(u,2)}return l}static reedSolomonComputeRemainder(a,l){let u=l.map(f=>0);for(const f of a){const p=f^u.shift();u.push(0),l.forEach((d,h)=>u[h]^=ae.reedSolomonMultiply(d,p))}return u}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*a;return o(u>>>8==0),u}finderPenaltyCountPatterns(a){const l=a[1];o(l<=this.size*3);const u=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(u&&a[0]>=l*4&&a[6]>=l?1:0)+(u&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,u){return a&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(c,a,l){if(a<0||a>31||c>>>a)throw new RangeError("Value out of range");for(let u=a-1;u>=0;u--)l.push(c>>>u&1)}function r(c,a){return(c>>>a&1)!=0}function o(c){if(!c)throw new Error("Assertion error")}const s=class xe{constructor(a,l,u){if(this.mode=a,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(a){let l=[];for(const u of a)n(u,8,l);return new xe(xe.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!xe.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u<a.length;){const f=Math.min(a.length-u,3);n(parseInt(a.substring(u,u+f),10),f*3+1,l),u+=f}return new xe(xe.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!xe.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],u;for(u=0;u+2<=a.length;u+=2){let f=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;f+=xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),n(f,11,l)}return u<a.length&&n(xe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,l),new xe(xe.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:xe.isNumeric(a)?[xe.makeNumeric(a)]:xe.isAlphanumeric(a)?[xe.makeAlphanumeric(a)]:[xe.makeBytes(xe.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)n(a,8,l);else if(a<16384)n(2,2,l),n(a,14,l);else if(a<1e6)n(6,3,l),n(a,21,l);else throw new RangeError("ECI assignment value out of range");return new xe(xe.Mode.ECI,0,l)}static isNumeric(a){return xe.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return xe.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let u=0;for(const f of a){const p=f.mode.numCharCountBits(l);if(f.numChars>=1<<p)return 1/0;u+=4+p+f.bitData.length}return u}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let u=0;u<a.length;u++)a.charAt(u)!="%"?l.push(a.charCodeAt(u)):(l.push(parseInt(a.substring(u+1,u+3),16)),u+=2);return l}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=s;e.QrSegment=s})(Xn||(Xn={})),(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Xn||(Xn={})),(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Xn||(Xn={}));var Cr=Xn;/**
|
|
166
174
|
* @license qrcode.react
|
|
167
175
|
* Copyright (c) Paul O'Shannessy
|
|
168
176
|
* SPDX-License-Identifier: ISC
|
|
169
|
-
*/var O3={L:Nr.QrCode.Ecc.LOW,M:Nr.QrCode.Ecc.MEDIUM,Q:Nr.QrCode.Ecc.QUARTILE,H:Nr.QrCode.Ecc.HIGH},kh=128,Bh="L",Lh="#FFFFFF",Fh="#000000",Dh=!1,Rh=1,N3=4,C3=0,I3=.1;function jh(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,c){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${c-s}v1H${s+t}z`),s=null;return}if(c===r.length-1){if(!i)return;s===null?n.push(`M${c+t},${o+t} h1v1H${c+t}z`):n.push(`M${s+t},${o+t} h${c+1-s}v1H${s+t}z`);return}i&&s===null&&(s=c)})}),n.join("")}function _h(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function M3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*I3),i=o/t,c=(r.width||s)*i,a=(r.height||s)*i,u=r.x==null?e.length/2-c/2:r.x*i,l=r.y==null?e.length/2-a/2:r.y*i,f=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let h=Math.floor(u),m=Math.floor(l),w=Math.ceil(c+u-h),$=Math.ceil(a+l-m);p={x:h,y:m,w,h:$}}const d=r.crossOrigin;return{x:u,y:l,h:a,w:c,excavation:p,opacity:f,crossOrigin:d}}function k3(e,t){return t!=null?Math.max(Math.floor(t),0):e?N3:C3}function Uh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=x.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,w)=>(m.push(...Nr.QrSegment.makeSegments(w)),m),[]);return Nr.QrCode.encodeSegments(h,O3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:u,margin:l,numCells:f,calculatedImageSettings:p}=x.useMemo(()=>{let d=a.getModules();const h=k3(r,o),m=d.length+h*2,w=M3(d,i,h,s);return{cells:d,margin:h,numCells:m,calculatedImageSettings:w}},[a,i,s,r,o]);return{qrcode:a,margin:l,cells:u,numCells:f,calculatedImageSettings:p}}var B3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),L3=x.forwardRef(function(t,n){const r=t,{value:o,size:s=kh,level:i=Bh,bgColor:c=Lh,fgColor:a=Fh,includeMargin:u=Dh,minVersion:l=Rh,boostLevel:f,marginSize:p,imageSettings:d}=r,m=lu(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=m,$=lu(m,["style"]),E=d==null?void 0:d.src,S=x.useRef(null),N=x.useRef(null),B=x.useCallback(M=>{S.current=M,typeof n=="function"?n(M):n&&(n.current=M)},[n]),[F,D]=x.useState(!1),{margin:b,cells:g,numCells:v,calculatedImageSettings:C}=Uh({value:o,level:i,minVersion:l,boostLevel:f,includeMargin:u,marginSize:p,imageSettings:d,size:s});x.useEffect(()=>{if(S.current!=null){const M=S.current,y=M.getContext("2d");if(!y)return;let A=g;const T=N.current,P=C!=null&&T!==null&&T.complete&&T.naturalHeight!==0&&T.naturalWidth!==0;P&&C.excavation!=null&&(A=_h(g,C.excavation));const L=window.devicePixelRatio||1;M.height=M.width=s*L;const j=s/v*L;y.scale(j,j),y.fillStyle=c,y.fillRect(0,0,v,v),y.fillStyle=a,B3?y.fill(new Path2D(jh(A,b))):g.forEach(function(z,_){z.forEach(function(W,K){W&&y.fillRect(K+b,_+b,1,1)})}),C&&(y.globalAlpha=C.opacity),P&&y.drawImage(T,C.x+b,C.y+b,C.w,C.h)}}),x.useEffect(()=>{D(!1)},[E]);const O=uu({height:s,width:s},w);let I=null;return E!=null&&(I=x.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{D(!0)},ref:N,crossOrigin:C==null?void 0:C.crossOrigin})),x.createElement(x.Fragment,null,x.createElement("canvas",uu({style:O,height:s,width:s,ref:B,role:"img"},$)),I)});L3.displayName="QRCodeCanvas";var zh=x.forwardRef(function(t,n){const r=t,{value:o,size:s=kh,level:i=Bh,bgColor:c=Lh,fgColor:a=Fh,includeMargin:u=Dh,minVersion:l=Rh,boostLevel:f,title:p,marginSize:d,imageSettings:h}=r,m=lu(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:$,numCells:E,calculatedImageSettings:S}=Uh({value:o,level:i,minVersion:l,boostLevel:f,includeMargin:u,marginSize:d,imageSettings:h,size:s});let N=$,B=null;h!=null&&S!=null&&(S.excavation!=null&&(N=_h($,S.excavation)),B=x.createElement("image",{href:h.src,height:S.h,width:S.w,x:S.x+w,y:S.y+w,preserveAspectRatio:"none",opacity:S.opacity,crossOrigin:S.crossOrigin}));const F=jh(N,w);return x.createElement("svg",uu({height:s,width:s,viewBox:`0 0 ${E} ${E}`,ref:n,role:"img"},m),!!p&&x.createElement("title",null,p),x.createElement("path",{fill:c,d:`M0,0 h${E}v${E}H0z`,shapeRendering:"crispEdges"}),x.createElement("path",{fill:a,d:F,shapeRendering:"crispEdges"}),B)});zh.displayName="QRCodeSVG";function F3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function D3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Hh(){return/apple/i.test(navigator.vendor)}function R3(){return F3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function j3(){return D3().includes("jsdom/")}const Wh="data-floating-ui-focusable",_3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fu(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Cr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ir(e){return"composedPath"in e?e.composedPath()[0]:e.target}function du(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function U3(e){return e.matches("html,body")}function zt(e){return(e==null?void 0:e.ownerDocument)||document}function Vh(e){return De(e)&&e.matches(_3)}function z3(e){if(!e||j3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function H3(e){return e?e.hasAttribute(Wh)?e:e.querySelector("["+Wh+"]")||e:null}function ui(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...ui(e,o.id,n)])}function W3(e){return"nativeEvent"in e}function zo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var V3=typeof document<"u",G3=function(){},Ht=V3?x.useLayoutEffect:G3;const q3={...U};function li(e){const t=U.useRef(e);return Ht(()=>{t.current=e}),t}const Z3=q3.useInsertionEffect||(e=>e());function Wt(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Z3(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Gh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qh(e,t){const n=Ap(e,Gh()),r=n.length;if(r===0)return;const o=fu(zt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Y3(e){return qh(zt(e).body,1)||e}function K3(e){return qh(zt(e).body,-1)||e}function pu(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Cr(n,r)}function X3(e){Ap(e,Gh()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Zh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Q3="data-floating-ui-focusable",Yh="active",Kh="selected",J3={...U};let Xh=!1,e4=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+e4++;function t4(){const[e,t]=U.useState(()=>Xh?Qh():void 0);return Ht(()=>{e==null&&t(Qh())},[]),U.useEffect(()=>{Xh=!0},[]),e}const hu=J3.useId||t4;let mu;process.env.NODE_ENV!=="production"&&(mu=new Set);function n4(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=mu)!=null&&e.has(o))){var s;(s=mu)==null||s.add(o),console.error(o)}}function r4(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const o4=U.createContext(null),s4=U.createContext(null),bu=()=>{var e;return((e=U.useContext(o4))==null?void 0:e.id)||null},gu=()=>U.useContext(s4);function Ho(e){return"data-floating-ui-"+e}function bt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Jh=Ho("safe-polygon");function yu(e,t,n){if(n&&!zo(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function wu(e){return typeof e=="function"?e():e}function i4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:c=!0,delay:a=0,handleClose:u=null,mouseOnly:l=!1,restMs:f=0,move:p=!0}=t,d=gu(),h=bu(),m=li(u),w=li(a),$=li(n),E=li(f),S=U.useRef(),N=U.useRef(-1),B=U.useRef(),F=U.useRef(-1),D=U.useRef(!0),b=U.useRef(!1),g=U.useRef(()=>{}),v=U.useRef(!1),C=Wt(()=>{var T;const P=(T=o.current.openEvent)==null?void 0:T.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"});U.useEffect(()=>{if(!c)return;function T(P){let{open:L}=P;L||(bt(N),bt(F),D.current=!0,v.current=!1)}return s.on("openchange",T),()=>{s.off("openchange",T)}},[c,s]),U.useEffect(()=>{if(!c||!m.current||!n)return;function T(L){C()&&r(!1,L,"hover")}const P=zt(i.floating).documentElement;return P.addEventListener("mouseleave",T),()=>{P.removeEventListener("mouseleave",T)}},[i.floating,n,r,c,m,C]);const O=U.useCallback(function(T,P,L){P===void 0&&(P=!0),L===void 0&&(L="hover");const j=yu(w.current,"close",S.current);j&&!B.current?(bt(N),N.current=window.setTimeout(()=>r(!1,T,L),j)):P&&(bt(N),r(!1,T,L))},[w,r]),I=Wt(()=>{g.current(),B.current=void 0}),M=Wt(()=>{if(b.current){const T=zt(i.floating).body;T.style.pointerEvents="",T.removeAttribute(Jh),b.current=!1}}),y=Wt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!c)return;function T(_){if(bt(N),D.current=!1,l&&!zo(S.current)||wu(E.current)>0&&!yu(w.current,"open"))return;const W=yu(w.current,"open",S.current);W?N.current=window.setTimeout(()=>{$.current||r(!0,_,"hover")},W):n||r(!0,_,"hover")}function P(_){if(y()){M();return}g.current();const W=zt(i.floating);if(bt(F),v.current=!1,m.current&&o.current.floatingContext){n||bt(N),B.current=m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){M(),I(),y()||O(_,!0,"safe-polygon")}});const G=B.current;W.addEventListener("mousemove",G),g.current=()=>{W.removeEventListener("mousemove",G)};return}(S.current==="touch"?!Cr(i.floating,_.relatedTarget):!0)&&O(_)}function L(_){y()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){M(),I(),y()||O(_)}})(_))}function j(){bt(N)}function z(_){y()||O(_,!1)}if(fe(i.domReference)){const _=i.domReference,W=i.floating;return n&&_.addEventListener("mouseleave",L),p&&_.addEventListener("mousemove",T,{once:!0}),_.addEventListener("mouseenter",T),_.addEventListener("mouseleave",P),W&&(W.addEventListener("mouseleave",L),W.addEventListener("mouseenter",j),W.addEventListener("mouseleave",z)),()=>{n&&_.removeEventListener("mouseleave",L),p&&_.removeEventListener("mousemove",T),_.removeEventListener("mouseenter",T),_.removeEventListener("mouseleave",P),W&&(W.removeEventListener("mouseleave",L),W.removeEventListener("mouseenter",j),W.removeEventListener("mouseleave",z))}}},[i,c,e,l,p,O,I,M,r,n,$,d,w,m,o,y,E]),Ht(()=>{var T;if(c&&n&&(T=m.current)!=null&&(T=T.__options)!=null&&T.blockPointerEvents&&C()){b.current=!0;const L=i.floating;if(fe(i.domReference)&&L){var P;const j=zt(i.floating).body;j.setAttribute(Jh,"");const z=i.domReference,_=d==null||(P=d.nodesRef.current.find(W=>W.id===h))==null||(P=P.context)==null?void 0:P.elements.floating;return _&&(_.style.pointerEvents=""),j.style.pointerEvents="none",z.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",z.style.pointerEvents="",L.style.pointerEvents=""}}}},[c,n,h,i,d,m,C]),Ht(()=>{n||(S.current=void 0,v.current=!1,I(),M())},[n,I,M]),U.useEffect(()=>()=>{I(),bt(N),bt(F),M()},[c,i.domReference,I,M]);const A=U.useMemo(()=>{function T(P){S.current=P.pointerType}return{onPointerDown:T,onPointerEnter:T,onMouseMove(P){const{nativeEvent:L}=P;function j(){!D.current&&!$.current&&r(!0,L,"hover")}l&&!zo(S.current)||n||wu(E.current)===0||v.current&&P.movementX**2+P.movementY**2<2||(bt(F),S.current==="touch"?j():(v.current=!0,F.current=window.setTimeout(j,wu(E.current))))}}},[l,r,n,$,E]);return U.useMemo(()=>c?{reference:A}:{},[c,A])}const em={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},tm=U.forwardRef(function(t,n){const[r,o]=U.useState();Ht(()=>{Hh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ho("focus-guard")]:"",style:em};return k.jsx("span",{...t,...s})}),nm=U.createContext(null),rm=Ho("portal");function a4(e){e===void 0&&(e={});const{id:t,root:n}=e,r=hu(),o=u4(),[s,i]=U.useState(null),c=U.useRef(null);return Ht(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Ht(()=>{if(!r||c.current)return;const a=t?document.getElementById(t):null;if(!a)return;const u=document.createElement("div");u.id=r,u.setAttribute(rm,""),a.appendChild(u),c.current=u,i(u)},[t,r]),Ht(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Bc(a)&&(a=a.current),a=a||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,a.appendChild(u));const l=document.createElement("div");l.id=r,l.setAttribute(rm,""),a=u||a,a.appendChild(l),c.current=l,i(l)},[t,n,r,o]),s}function c4(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=a4({id:n,root:r}),[i,c]=U.useState(null),a=U.useRef(null),u=U.useRef(null),l=U.useRef(null),f=U.useRef(null),p=i==null?void 0:i.modal,d=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return U.useEffect(()=>{if(!s||!o||p)return;function m(w){s&&pu(w)&&(w.type==="focusin"?Zh:X3)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),U.useEffect(()=>{s&&(d||Zh(s))},[d,s]),k.jsxs(nm.Provider,{value:U.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:u,beforeInsideRef:l,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&k.jsx(tm,{"data-type":"outside",ref:a,onFocus:m=>{if(pu(m,s)){var w;(w=l.current)==null||w.focus()}else{const $=i?i.domReference:null,E=K3($);E==null||E.focus()}}}),h&&s&&k.jsx("span",{"aria-owns":s.id,style:em}),s&&Br.createPortal(t,s),h&&s&&k.jsx(tm,{"data-type":"outside",ref:u,onFocus:m=>{if(pu(m,s)){var w;(w=f.current)==null||w.focus()}else{const $=i?i.domReference:null,E=Y3($);E==null||E.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const u4=()=>U.useContext(nm);function om(e){return De(e.target)&&e.target.tagName==="BUTTON"}function l4(e){return De(e.target)&&e.target.tagName==="A"}function sm(e){return Vh(e)}function f4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:a=!0,ignoreMouse:u=!1,keyboardHandlers:l=!0,stickIfOpen:f=!0}=t,p=U.useRef(),d=U.useRef(!1),h=U.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const w=p.current;m.button===0&&c!=="click"&&(zo(w,!0)&&u||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const w=p.current;if(c==="mousedown"&&p.current){p.current=void 0;return}zo(w,!0)&&u||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){p.current=void 0,!(m.defaultPrevented||!l||om(m))&&(m.key===" "&&!sm(s)&&(m.preventDefault(),d.current=!0),!l4(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!l||om(m)||sm(s)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,c,u,l,r,n,f,a]);return U.useMemo(()=>i?{reference:h}:{},[i,h])}const d4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},p4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},im=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function h4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:a=!0,outsidePressEvent:u="pointerdown",referencePress:l=!1,referencePressEvent:f="pointerdown",ancestorScroll:p=!1,bubbles:d,capture:h}=t,m=gu(),w=Wt(typeof a=="function"?a:()=>!1),$=typeof a=="function"?w:a,E=U.useRef(!1),{escapeKey:S,outsidePress:N}=im(d),{escapeKey:B,outsidePress:F}=im(h),D=U.useRef(!1),b=Wt(M=>{var y;if(!n||!i||!c||M.key!=="Escape"||D.current)return;const A=(y=s.current.floatingContext)==null?void 0:y.nodeId,T=m?ui(m.nodesRef.current,A):[];if(!S&&(M.stopPropagation(),T.length>0)){let P=!0;if(T.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,W3(M)?M.nativeEvent:M,"escape-key")}),g=Wt(M=>{var y;const A=()=>{var T;b(M),(T=Ir(M))==null||T.removeEventListener("keydown",A)};(y=Ir(M))==null||y.addEventListener("keydown",A)}),v=Wt(M=>{var y;const A=s.current.insideReactTree;s.current.insideReactTree=!1;const T=E.current;if(E.current=!1,u==="click"&&T||A||typeof $=="function"&&!$(M))return;const P=Ir(M),L="["+Ho("inert")+"]",j=zt(o.floating).querySelectorAll(L);let z=fe(P)?P:null;for(;z&&!sn(z);){const G=an(z);if(sn(G)||!fe(G))break;z=G}if(j.length&&fe(P)&&!U3(P)&&!Cr(P,o.floating)&&Array.from(j).every(G=>!Cr(z,G)))return;if(De(P)&&I){const G=sn(P),H=ht(P),Z=/auto|scroll/,J=G||Z.test(H.overflowX),oe=G||Z.test(H.overflowY),me=J&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,ge=oe&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,de=H.direction==="rtl",se=ge&&(de?M.offsetX<=P.offsetWidth-P.clientWidth:M.offsetX>P.clientWidth),pe=me&&M.offsetY>P.clientHeight;if(se||pe)return}const _=(y=s.current.floatingContext)==null?void 0:y.nodeId,W=m&&ui(m.nodesRef.current,_).some(G=>{var H;return du(M,(H=G.context)==null?void 0:H.elements.floating)});if(du(M,o.floating)||du(M,o.domReference)||W)return;const K=m?ui(m.nodesRef.current,_):[];if(K.length>0){let G=!0;if(K.forEach(H=>{var Z;if((Z=H.context)!=null&&Z.open&&!H.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,M,"outside-press")}),C=Wt(M=>{var y;const A=()=>{var T;v(M),(T=Ir(M))==null||T.removeEventListener(u,A)};(y=Ir(M))==null||y.addEventListener(u,A)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=N;let M=-1;function y(j){r(!1,j,"ancestor-scroll")}function A(){window.clearTimeout(M),D.current=!0}function T(){M=window.setTimeout(()=>{D.current=!1},zs()?5:0)}const P=zt(o.floating);c&&(P.addEventListener("keydown",B?g:b,B),P.addEventListener("compositionstart",A),P.addEventListener("compositionend",T)),$&&P.addEventListener(u,F?C:v,F);let L=[];return p&&(fe(o.domReference)&&(L=Tn(o.domReference)),fe(o.floating)&&(L=L.concat(Tn(o.floating))),!fe(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(Tn(o.reference.contextElement)))),L=L.filter(j=>{var z;return j!==((z=P.defaultView)==null?void 0:z.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{c&&(P.removeEventListener("keydown",B?g:b,B),P.removeEventListener("compositionstart",A),P.removeEventListener("compositionend",T)),$&&P.removeEventListener(u,F?C:v,F),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(M)}},[s,o,c,$,u,n,r,p,i,S,N,b,B,g,v,F,C]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,$,u]);const O=U.useMemo(()=>({onKeyDown:b,...l&&{[d4[f]]:M=>{r(!1,M.nativeEvent,"reference-press")},...f!=="click"&&{onClick(M){r(!1,M.nativeEvent,"reference-press")}}}}),[b,r,l,f]),I=U.useMemo(()=>({onKeyDown:b,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[p4[u]]:()=>{s.current.insideReactTree=!0}}),[b,u,s]);return U.useMemo(()=>i?{reference:O,floating:I}:{},[i,O,I])}function m4(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=hu(),s=U.useRef({}),[i]=U.useState(()=>r4()),c=bu()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!fe(d)&&n4("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,u]=U.useState(r.reference),l=Wt((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=U.useMemo(()=>({setPositionReference:u}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:l,elements:p,events:i,floatingId:o,refs:f}),[t,l,p,i,o,f])}function b4(e){e===void 0&&(e={});const{nodeId:t}=e,n=m4({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[c,a]=U.useState(null),l=(o==null?void 0:o.domReference)||s,f=U.useRef(null),p=gu();Ht(()=>{l&&(f.current=l)},[l]);const d=zp({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(S=>{const N=fe(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(N),d.refs.setReference(N)},[d.refs]),m=U.useCallback(S=>{(fe(S)||S===null)&&(f.current=S,i(S)),(fe(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!fe(S))&&d.refs.setReference(S)},[d.refs]),w=U.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),$=U.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),E=U.useMemo(()=>({...d,...r,refs:w,elements:$,nodeId:t}),[d,w,$,t,r]);return Ht(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(N=>N.id===t);S&&(S.context=E)}),U.useMemo(()=>({...d,context:E,refs:w,elements:$}),[d,w,$,E])}function vu(){return R3()&&Hh()}function g4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:a=!0}=t,u=U.useRef(!1),l=U.useRef(-1),f=U.useRef(!0);U.useEffect(()=>{if(!c)return;const d=Ze(i.domReference);function h(){!n&&De(i.domReference)&&i.domReference===fu(zt(i.domReference))&&(u.current=!0)}function m(){f.current=!0}function w(){f.current=!1}return d.addEventListener("blur",h),vu()&&(d.addEventListener("keydown",m,!0),d.addEventListener("pointerdown",w,!0)),()=>{d.removeEventListener("blur",h),vu()&&(d.removeEventListener("keydown",m,!0),d.removeEventListener("pointerdown",w,!0))}},[i.domReference,n,c]),U.useEffect(()=>{if(!c)return;function d(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(u.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,c]),U.useEffect(()=>()=>{bt(l)},[]);const p=U.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(d){if(u.current)return;const h=Ir(d.nativeEvent);if(a&&fe(h)){if(vu()&&!d.relatedTarget){if(!f.current&&!Vh(h))return}else if(!z3(h))return}r(!0,d.nativeEvent,"focus")},onBlur(d){u.current=!1;const h=d.relatedTarget,m=d.nativeEvent,w=fe(h)&&h.hasAttribute(Ho("focus-guard"))&&h.getAttribute("data-type")==="outside";l.current=window.setTimeout(()=>{var $;const E=fu(i.domReference?i.domReference.ownerDocument:document);!h&&E===i.domReference||Cr(($=s.current.floatingContext)==null?void 0:$.refs.floating.current,E)||Cr(i.domReference,E)||w||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return U.useMemo(()=>c?{reference:p}:{},[c,p])}function xu(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Yh]:i,[Kh]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[Q3]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[u,l]=a;if(!(o&&[Yh,Kh].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof l=="function"){var f;(f=r.get(u))==null||f.push(l),i[u]=function(){for(var p,d=arguments.length,h=new Array(d),m=0;m<d;m++)h[m]=arguments[m];return(p=r.get(u))==null?void 0:p.map(w=>w(...h)).find(w=>w!==void 0)}}}else i[u]=l}),i),{})}}function y4(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=U.useCallback(c=>xu(c,e,"reference"),t),s=U.useCallback(c=>xu(c,e,"floating"),n),i=U.useCallback(c=>xu(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const w4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function v4(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:c=!0,role:a="dialog"}=t,u=hu(),l=((n=s.domReference)==null?void 0:n.id)||u,f=U.useMemo(()=>{var E;return((E=H3(s.floating))==null?void 0:E.id)||i},[s.floating,i]),p=(r=w4.get(a))!=null?r:a,h=bu()!=null,m=U.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?f:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:l},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,f,h,o,l,a]),w=U.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":l}}},[p,f,l,a]),$=U.useCallback(E=>{let{active:S,selected:N}=E;const B={role:"option",...S&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...B,"aria-selected":N}}return{}},[f,a]);return U.useMemo(()=>c?{reference:m,floating:w,item:$}:{},[c,m,w,$])}const am=x.forwardRef(({placement:e,className:t=""},n)=>{const o=(s=>{switch(s.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return k.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});am.displayName="TooltipArrow";const Qn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:s="",disabled:i=!1,maxWidth:c="max-w-xs",trigger:a=["hover","focus"]})=>{const[u,l]=x.useState(!1),f=x.useRef(null),{refs:p,floatingStyles:d,context:h}=b4({open:u&&!i,onOpenChange:l,placement:n,whileElementsMounted:Rp,middleware:[Zc(o?12:8),Wp({fallbackAxisSideDirection:"start",padding:8}),Hp({padding:8}),...o?[DE({element:f})]:[]]}),m=i4(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),w=g4(h,{enabled:a.includes("focus")}),$=f4(h,{enabled:a.includes("click")}),E=h4(h),S=v4(h,{role:"tooltip"}),{getReferenceProps:N,getFloatingProps:B}=y4([m,w,$,E,S]);return i?k.jsx(k.Fragment,{children:e}):k.jsxs(k.Fragment,{children:[k.jsx("div",{ref:p.setReference,...N(),className:"cursor-help",children:e}),u&&k.jsx(c4,{children:k.jsxs("div",{ref:p.setFloating,...B(),style:{...d,zIndex:101},className:`
|
|
177
|
+
*/var k3={L:Cr.QrCode.Ecc.LOW,M:Cr.QrCode.Ecc.MEDIUM,Q:Cr.QrCode.Ecc.QUARTILE,H:Cr.QrCode.Ecc.HIGH},Dh=128,Mh="L",Lh="#FFFFFF",Bh="#000000",Fh=!1,Rh=1,D3=4,M3=0,L3=.1;function jh(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,c){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${c-s}v1H${s+t}z`),s=null;return}if(c===r.length-1){if(!i)return;s===null?n.push(`M${c+t},${o+t} h1v1H${c+t}z`):n.push(`M${s+t},${o+t} h${c+1-s}v1H${s+t}z`);return}i&&s===null&&(s=c)})}),n.join("")}function _h(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function B3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*L3),i=o/t,c=(r.width||s)*i,a=(r.height||s)*i,l=r.x==null?e.length/2-c/2:r.x*i,u=r.y==null?e.length/2-a/2:r.y*i,f=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let h=Math.floor(l),m=Math.floor(u),v=Math.ceil(c+l-h),T=Math.ceil(a+u-m);p={x:h,y:m,w:v,h:T}}const d=r.crossOrigin;return{x:l,y:u,h:a,w:c,excavation:p,opacity:f,crossOrigin:d}}function F3(e,t){return t!=null?Math.max(Math.floor(t),0):e?D3:M3}function zh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=x.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,v)=>(m.push(...Cr.QrSegment.makeSegments(v)),m),[]);return Cr.QrCode.encodeSegments(h,k3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:u,numCells:f,calculatedImageSettings:p}=x.useMemo(()=>{let d=a.getModules();const h=F3(r,o),m=d.length+h*2,v=B3(d,i,h,s);return{cells:d,margin:h,numCells:m,calculatedImageSettings:v}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:l,numCells:f,calculatedImageSettings:p}}var R3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),j3=x.forwardRef(function(t,n){const r=t,{value:o,size:s=Dh,level:i=Mh,bgColor:c=Lh,fgColor:a=Bh,includeMargin:l=Fh,minVersion:u=Rh,boostLevel:f,marginSize:p,imageSettings:d}=r,m=ul(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=m,T=ul(m,["style"]),E=d==null?void 0:d.src,S=x.useRef(null),C=x.useRef(null),M=x.useCallback(k=>{S.current=k,typeof n=="function"?n(k):n&&(n.current=k)},[n]),[B,F]=x.useState(!1),{margin:b,cells:g,numCells:w,calculatedImageSettings:O}=zh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:d,size:s});x.useEffect(()=>{if(S.current!=null){const k=S.current,y=k.getContext("2d");if(!y)return;let $=g;const A=C.current,P=O!=null&&A!==null&&A.complete&&A.naturalHeight!==0&&A.naturalWidth!==0;P&&O.excavation!=null&&($=_h(g,O.excavation));const L=window.devicePixelRatio||1;k.height=k.width=s*L;const j=s/w*L;y.scale(j,j),y.fillStyle=c,y.fillRect(0,0,w,w),y.fillStyle=a,R3?y.fill(new Path2D(jh($,b))):g.forEach(function(U,_){U.forEach(function(H,Y){H&&y.fillRect(Y+b,_+b,1,1)})}),O&&(y.globalAlpha=O.opacity),P&&y.drawImage(A,O.x+b,O.y+b,O.w,O.h)}}),x.useEffect(()=>{F(!1)},[E]);const N=ll({height:s,width:s},v);let I=null;return E!=null&&(I=x.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{F(!0)},ref:C,crossOrigin:O==null?void 0:O.crossOrigin})),x.createElement(x.Fragment,null,x.createElement("canvas",ll({style:N,height:s,width:s,ref:M,role:"img"},T)),I)});j3.displayName="QRCodeCanvas";var Uh=x.forwardRef(function(t,n){const r=t,{value:o,size:s=Dh,level:i=Mh,bgColor:c=Lh,fgColor:a=Bh,includeMargin:l=Fh,minVersion:u=Rh,boostLevel:f,title:p,marginSize:d,imageSettings:h}=r,m=ul(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:T,numCells:E,calculatedImageSettings:S}=zh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:d,imageSettings:h,size:s});let C=T,M=null;h!=null&&S!=null&&(S.excavation!=null&&(C=_h(T,S.excavation)),M=x.createElement("image",{href:h.src,height:S.h,width:S.w,x:S.x+v,y:S.y+v,preserveAspectRatio:"none",opacity:S.opacity,crossOrigin:S.crossOrigin}));const B=jh(C,v);return x.createElement("svg",ll({height:s,width:s,viewBox:`0 0 ${E} ${E}`,ref:n,role:"img"},m),!!p&&x.createElement("title",null,p),x.createElement("path",{fill:c,d:`M0,0 h${E}v${E}H0z`,shapeRendering:"crispEdges"}),x.createElement("path",{fill:a,d:B,shapeRendering:"crispEdges"}),M)});Uh.displayName="QRCodeSVG";function _3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function z3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Wh(){return/apple/i.test(navigator.vendor)}function U3(){return _3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function W3(){return z3().includes("jsdom/")}const Hh="data-floating-ui-focusable",H3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fl(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Or(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Lc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ir(e){return"composedPath"in e?e.composedPath()[0]:e.target}function dl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function V3(e){return e.matches("html,body")}function Ut(e){return(e==null?void 0:e.ownerDocument)||document}function Vh(e){return Fe(e)&&e.matches(H3)}function G3(e){if(!e||W3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function q3(e){return e?e.hasAttribute(Hh)?e:e.querySelector("["+Hh+"]")||e:null}function li(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...li(e,o.id,n)])}function Z3(e){return"nativeEvent"in e}function Uo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var K3=typeof document<"u",Y3=function(){},Wt=K3?x.useLayoutEffect:Y3;const X3={...z};function ui(e){const t=z.useRef(e);return Wt(()=>{t.current=e}),t}const Q3=X3.useInsertionEffect||(e=>e());function Ht(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Q3(()=>{t.current=e}),z.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Gh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function qh(e,t){const n=$p(e,Gh()),r=n.length;if(r===0)return;const o=fl(Ut(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function J3(e){return qh(Ut(e).body,1)||e}function eS(e){return qh(Ut(e).body,-1)||e}function pl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Or(n,r)}function tS(e){$p(e,Gh()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Zh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const nS="data-floating-ui-focusable",Kh="active",Yh="selected",rS={...z};let Xh=!1,oS=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+oS++;function sS(){const[e,t]=z.useState(()=>Xh?Qh():void 0);return Wt(()=>{e==null&&t(Qh())},[]),z.useEffect(()=>{Xh=!0},[]),e}const hl=rS.useId||sS;let ml;process.env.NODE_ENV!=="production"&&(ml=new Set);function iS(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ml)!=null&&e.has(o))){var s;(s=ml)==null||s.add(o),console.error(o)}}function aS(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const cS=z.createContext(null),lS=z.createContext(null),bl=()=>{var e;return((e=z.useContext(cS))==null?void 0:e.id)||null},gl=()=>z.useContext(lS);function Wo(e){return"data-floating-ui-"+e}function bt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Jh=Wo("safe-polygon");function yl(e,t,n){if(n&&!Uo(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function vl(e){return typeof e=="function"?e():e}function uS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:c=!0,delay:a=0,handleClose:l=null,mouseOnly:u=!1,restMs:f=0,move:p=!0}=t,d=gl(),h=bl(),m=ui(l),v=ui(a),T=ui(n),E=ui(f),S=z.useRef(),C=z.useRef(-1),M=z.useRef(),B=z.useRef(-1),F=z.useRef(!0),b=z.useRef(!1),g=z.useRef(()=>{}),w=z.useRef(!1),O=Ht(()=>{var A;const P=(A=o.current.openEvent)==null?void 0:A.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"});z.useEffect(()=>{if(!c)return;function A(P){let{open:L}=P;L||(bt(C),bt(B),F.current=!0,w.current=!1)}return s.on("openchange",A),()=>{s.off("openchange",A)}},[c,s]),z.useEffect(()=>{if(!c||!m.current||!n)return;function A(L){O()&&r(!1,L,"hover")}const P=Ut(i.floating).documentElement;return P.addEventListener("mouseleave",A),()=>{P.removeEventListener("mouseleave",A)}},[i.floating,n,r,c,m,O]);const N=z.useCallback(function(A,P,L){P===void 0&&(P=!0),L===void 0&&(L="hover");const j=yl(v.current,"close",S.current);j&&!M.current?(bt(C),C.current=window.setTimeout(()=>r(!1,A,L),j)):P&&(bt(C),r(!1,A,L))},[v,r]),I=Ht(()=>{g.current(),M.current=void 0}),k=Ht(()=>{if(b.current){const A=Ut(i.floating).body;A.style.pointerEvents="",A.removeAttribute(Jh),b.current=!1}}),y=Ht(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);z.useEffect(()=>{if(!c)return;function A(_){if(bt(C),F.current=!1,u&&!Uo(S.current)||vl(E.current)>0&&!yl(v.current,"open"))return;const H=yl(v.current,"open",S.current);H?C.current=window.setTimeout(()=>{T.current||r(!0,_,"hover")},H):n||r(!0,_,"hover")}function P(_){if(y()){k();return}g.current();const H=Ut(i.floating);if(bt(B),w.current=!1,m.current&&o.current.floatingContext){n||bt(C),M.current=m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){k(),I(),y()||N(_,!0,"safe-polygon")}});const G=M.current;H.addEventListener("mousemove",G),g.current=()=>{H.removeEventListener("mousemove",G)};return}(S.current==="touch"?!Or(i.floating,_.relatedTarget):!0)&&N(_)}function L(_){y()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){k(),I(),y()||N(_)}})(_))}function j(){bt(C)}function U(_){y()||N(_,!1)}if(fe(i.domReference)){const _=i.domReference,H=i.floating;return n&&_.addEventListener("mouseleave",L),p&&_.addEventListener("mousemove",A,{once:!0}),_.addEventListener("mouseenter",A),_.addEventListener("mouseleave",P),H&&(H.addEventListener("mouseleave",L),H.addEventListener("mouseenter",j),H.addEventListener("mouseleave",U)),()=>{n&&_.removeEventListener("mouseleave",L),p&&_.removeEventListener("mousemove",A),_.removeEventListener("mouseenter",A),_.removeEventListener("mouseleave",P),H&&(H.removeEventListener("mouseleave",L),H.removeEventListener("mouseenter",j),H.removeEventListener("mouseleave",U))}}},[i,c,e,u,p,N,I,k,r,n,T,d,v,m,o,y,E]),Wt(()=>{var A;if(c&&n&&(A=m.current)!=null&&(A=A.__options)!=null&&A.blockPointerEvents&&O()){b.current=!0;const L=i.floating;if(fe(i.domReference)&&L){var P;const j=Ut(i.floating).body;j.setAttribute(Jh,"");const U=i.domReference,_=d==null||(P=d.nodesRef.current.find(H=>H.id===h))==null||(P=P.context)==null?void 0:P.elements.floating;return _&&(_.style.pointerEvents=""),j.style.pointerEvents="none",U.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",U.style.pointerEvents="",L.style.pointerEvents=""}}}},[c,n,h,i,d,m,O]),Wt(()=>{n||(S.current=void 0,w.current=!1,I(),k())},[n,I,k]),z.useEffect(()=>()=>{I(),bt(C),bt(B),k()},[c,i.domReference,I,k]);const $=z.useMemo(()=>{function A(P){S.current=P.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(P){const{nativeEvent:L}=P;function j(){!F.current&&!T.current&&r(!0,L,"hover")}u&&!Uo(S.current)||n||vl(E.current)===0||w.current&&P.movementX**2+P.movementY**2<2||(bt(B),S.current==="touch"?j():(w.current=!0,B.current=window.setTimeout(j,vl(E.current))))}}},[u,r,n,T,E]);return z.useMemo(()=>c?{reference:$}:{},[c,$])}const em={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},tm=z.forwardRef(function(t,n){const[r,o]=z.useState();Wt(()=>{Wh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Wo("focus-guard")]:"",style:em};return D.jsx("span",{...t,...s})}),nm=z.createContext(null),rm=Wo("portal");function fS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=hl(),o=pS(),[s,i]=z.useState(null),c=z.useRef(null);return Wt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Wt(()=>{if(!r||c.current)return;const a=t?document.getElementById(t):null;if(!a)return;const l=document.createElement("div");l.id=r,l.setAttribute(rm,""),a.appendChild(l),c.current=l,i(l)},[t,r]),Wt(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Mc(a)&&(a=a.current),a=a||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,a.appendChild(l));const u=document.createElement("div");u.id=r,u.setAttribute(rm,""),a=l||a,a.appendChild(u),c.current=u,i(u)},[t,n,r,o]),s}function dS(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=fS({id:n,root:r}),[i,c]=z.useState(null),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),f=z.useRef(null),p=i==null?void 0:i.modal,d=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return z.useEffect(()=>{if(!s||!o||p)return;function m(v){s&&pl(v)&&(v.type==="focusin"?Zh:tS)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),z.useEffect(()=>{s&&(d||Zh(s))},[d,s]),D.jsxs(nm.Provider,{value:z.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&D.jsx(tm,{"data-type":"outside",ref:a,onFocus:m=>{if(pl(m,s)){var v;(v=u.current)==null||v.focus()}else{const T=i?i.domReference:null,E=eS(T);E==null||E.focus()}}}),h&&s&&D.jsx("span",{"aria-owns":s.id,style:em}),s&&Mr.createPortal(t,s),h&&s&&D.jsx(tm,{"data-type":"outside",ref:l,onFocus:m=>{if(pl(m,s)){var v;(v=f.current)==null||v.focus()}else{const T=i?i.domReference:null,E=J3(T);E==null||E.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const pS=()=>z.useContext(nm);function om(e){return Fe(e.target)&&e.target.tagName==="BUTTON"}function hS(e){return Fe(e.target)&&e.target.tagName==="A"}function sm(e){return Vh(e)}function mS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:a=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,p=z.useRef(),d=z.useRef(!1),h=z.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const v=p.current;m.button===0&&c!=="click"&&(Uo(v,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const v=p.current;if(c==="mousedown"&&p.current){p.current=void 0;return}Uo(v,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){p.current=void 0,!(m.defaultPrevented||!u||om(m))&&(m.key===" "&&!sm(s)&&(m.preventDefault(),d.current=!0),!hS(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||om(m)||sm(s)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,c,l,u,r,n,f,a]);return z.useMemo(()=>i?{reference:h}:{},[i,h])}const bS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},gS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},im=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function yS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:a=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:p=!1,bubbles:d,capture:h}=t,m=gl(),v=Ht(typeof a=="function"?a:()=>!1),T=typeof a=="function"?v:a,E=z.useRef(!1),{escapeKey:S,outsidePress:C}=im(d),{escapeKey:M,outsidePress:B}=im(h),F=z.useRef(!1),b=Ht(k=>{var y;if(!n||!i||!c||k.key!=="Escape"||F.current)return;const $=(y=s.current.floatingContext)==null?void 0:y.nodeId,A=m?li(m.nodesRef.current,$):[];if(!S&&(k.stopPropagation(),A.length>0)){let P=!0;if(A.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Z3(k)?k.nativeEvent:k,"escape-key")}),g=Ht(k=>{var y;const $=()=>{var A;b(k),(A=Ir(k))==null||A.removeEventListener("keydown",$)};(y=Ir(k))==null||y.addEventListener("keydown",$)}),w=Ht(k=>{var y;const $=s.current.insideReactTree;s.current.insideReactTree=!1;const A=E.current;if(E.current=!1,l==="click"&&A||$||typeof T=="function"&&!T(k))return;const P=Ir(k),L="["+Wo("inert")+"]",j=Ut(o.floating).querySelectorAll(L);let U=fe(P)?P:null;for(;U&&!sn(U);){const G=an(U);if(sn(G)||!fe(G))break;U=G}if(j.length&&fe(P)&&!V3(P)&&!Or(P,o.floating)&&Array.from(j).every(G=>!Or(U,G)))return;if(Fe(P)&&I){const G=sn(P),W=ht(P),Z=/auto|scroll/,J=G||Z.test(W.overflowX),oe=G||Z.test(W.overflowY),me=J&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,ge=oe&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,de=W.direction==="rtl",se=ge&&(de?k.offsetX<=P.offsetWidth-P.clientWidth:k.offsetX>P.clientWidth),pe=me&&k.offsetY>P.clientHeight;if(se||pe)return}const _=(y=s.current.floatingContext)==null?void 0:y.nodeId,H=m&&li(m.nodesRef.current,_).some(G=>{var W;return dl(k,(W=G.context)==null?void 0:W.elements.floating)});if(dl(k,o.floating)||dl(k,o.domReference)||H)return;const Y=m?li(m.nodesRef.current,_):[];if(Y.length>0){let G=!0;if(Y.forEach(W=>{var Z;if((Z=W.context)!=null&&Z.open&&!W.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}r(!1,k,"outside-press")}),O=Ht(k=>{var y;const $=()=>{var A;w(k),(A=Ir(k))==null||A.removeEventListener(l,$)};(y=Ir(k))==null||y.addEventListener(l,$)});z.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=C;let k=-1;function y(j){r(!1,j,"ancestor-scroll")}function $(){window.clearTimeout(k),F.current=!0}function A(){k=window.setTimeout(()=>{F.current=!1},Us()?5:0)}const P=Ut(o.floating);c&&(P.addEventListener("keydown",M?g:b,M),P.addEventListener("compositionstart",$),P.addEventListener("compositionend",A)),T&&P.addEventListener(l,B?O:w,B);let L=[];return p&&(fe(o.domReference)&&(L=An(o.domReference)),fe(o.floating)&&(L=L.concat(An(o.floating))),!fe(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(An(o.reference.contextElement)))),L=L.filter(j=>{var U;return j!==((U=P.defaultView)==null?void 0:U.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{c&&(P.removeEventListener("keydown",M?g:b,M),P.removeEventListener("compositionstart",$),P.removeEventListener("compositionend",A)),T&&P.removeEventListener(l,B?O:w,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(k)}},[s,o,c,T,l,n,r,p,i,S,C,b,M,g,w,B,O]),z.useEffect(()=>{s.current.insideReactTree=!1},[s,T,l]);const N=z.useMemo(()=>({onKeyDown:b,...u&&{[bS[f]]:k=>{r(!1,k.nativeEvent,"reference-press")},...f!=="click"&&{onClick(k){r(!1,k.nativeEvent,"reference-press")}}}}),[b,r,u,f]),I=z.useMemo(()=>({onKeyDown:b,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[gS[l]]:()=>{s.current.insideReactTree=!0}}),[b,l,s]);return z.useMemo(()=>i?{reference:N,floating:I}:{},[i,N,I])}function vS(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=hl(),s=z.useRef({}),[i]=z.useState(()=>aS()),c=bl()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!fe(d)&&iS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=z.useState(r.reference),u=Ht((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=z.useMemo(()=>({setPositionReference:l}),[]),p=z.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function wS(e){e===void 0&&(e={});const{nodeId:t}=e,n=vS({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=z.useState(null),[c,a]=z.useState(null),u=(o==null?void 0:o.domReference)||s,f=z.useRef(null),p=gl();Wt(()=>{u&&(f.current=u)},[u]);const d=Up({...e,elements:{...o,...c&&{reference:c}}}),h=z.useCallback(S=>{const C=fe(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(C),d.refs.setReference(C)},[d.refs]),m=z.useCallback(S=>{(fe(S)||S===null)&&(f.current=S,i(S)),(fe(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!fe(S))&&d.refs.setReference(S)},[d.refs]),v=z.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=z.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=z.useMemo(()=>({...d,...r,refs:v,elements:T,nodeId:t}),[d,v,T,t,r]);return Wt(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(C=>C.id===t);S&&(S.context=E)}),z.useMemo(()=>({...d,context:E,refs:v,elements:T}),[d,v,T,E])}function wl(){return U3()&&Wh()}function xS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:a=!0}=t,l=z.useRef(!1),u=z.useRef(-1),f=z.useRef(!0);z.useEffect(()=>{if(!c)return;const d=Ze(i.domReference);function h(){!n&&Fe(i.domReference)&&i.domReference===fl(Ut(i.domReference))&&(l.current=!0)}function m(){f.current=!0}function v(){f.current=!1}return d.addEventListener("blur",h),wl()&&(d.addEventListener("keydown",m,!0),d.addEventListener("pointerdown",v,!0)),()=>{d.removeEventListener("blur",h),wl()&&(d.removeEventListener("keydown",m,!0),d.removeEventListener("pointerdown",v,!0))}},[i.domReference,n,c]),z.useEffect(()=>{if(!c)return;function d(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(l.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,c]),z.useEffect(()=>()=>{bt(u)},[]);const p=z.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const h=Ir(d.nativeEvent);if(a&&fe(h)){if(wl()&&!d.relatedTarget){if(!f.current&&!Vh(h))return}else if(!G3(h))return}r(!0,d.nativeEvent,"focus")},onBlur(d){l.current=!1;const h=d.relatedTarget,m=d.nativeEvent,v=fe(h)&&h.hasAttribute(Wo("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var T;const E=fl(i.domReference?i.domReference.ownerDocument:document);!h&&E===i.domReference||Or((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,E)||Or(i.domReference,E)||v||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return z.useMemo(()=>c?{reference:p}:{},[c,p])}function xl(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Kh]:i,[Yh]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[nS]:""},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(a=>{let[l,u]=a;if(!(o&&[Kh,Yh].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof u=="function"){var f;(f=r.get(l))==null||f.push(u),i[l]=function(){for(var p,d=arguments.length,h=new Array(d),m=0;m<d;m++)h[m]=arguments[m];return(p=r.get(l))==null?void 0:p.map(v=>v(...h)).find(v=>v!==void 0)}}}else i[l]=u}),i),{})}}function ES(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=z.useCallback(c=>xl(c,e,"reference"),t),s=z.useCallback(c=>xl(c,e,"floating"),n),i=z.useCallback(c=>xl(c,e,"item"),r);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const SS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PS(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:c=!0,role:a="dialog"}=t,l=hl(),u=((n=s.domReference)==null?void 0:n.id)||l,f=z.useMemo(()=>{var E;return((E=q3(s.floating))==null?void 0:E.id)||i},[s.floating,i]),p=(r=SS.get(a))!=null?r:a,h=bl()!=null,m=z.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?f:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,f,h,o,u,a]),v=z.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,a]),T=z.useCallback(E=>{let{active:S,selected:C}=E;const M={role:"option",...S&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...M,"aria-selected":C}}return{}},[f,a]);return z.useMemo(()=>c?{reference:m,floating:v,item:T}:{},[c,m,v,T])}const am=x.forwardRef(({placement:e,className:t=""},n)=>{const o=(s=>{switch(s.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return D.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});am.displayName="TooltipArrow";const Qn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:s="",disabled:i=!1,maxWidth:c="max-w-xs",trigger:a=["hover","focus"]})=>{const[l,u]=x.useState(!1),f=x.useRef(null),{refs:p,floatingStyles:d,context:h}=wS({open:l&&!i,onOpenChange:u,placement:n,whileElementsMounted:Rp,middleware:[Zc(o?12:8),Hp({fallbackAxisSideDirection:"start",padding:8}),Wp({padding:8}),...o?[zE({element:f})]:[]]}),m=uS(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),v=xS(h,{enabled:a.includes("focus")}),T=mS(h,{enabled:a.includes("click")}),E=yS(h),S=PS(h,{role:"tooltip"}),{getReferenceProps:C,getFloatingProps:M}=ES([m,v,T,E,S]);return i?D.jsx(D.Fragment,{children:e}):D.jsxs(D.Fragment,{children:[D.jsx("div",{ref:p.setReference,...C(),className:"cursor-help",children:e}),l&&D.jsx(dS,{children:D.jsxs("div",{ref:p.setFloating,...M(),style:{...d,zIndex:101},className:`
|
|
170
178
|
z-[101] px-3 py-2 cursor-help
|
|
171
179
|
bg-fill-page-secondary
|
|
172
180
|
text-text-primary text-sm font-medium
|
|
@@ -174,6 +182,6 @@ ${dg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
174
182
|
relative
|
|
175
183
|
${c}
|
|
176
184
|
${s}
|
|
177
|
-
`,children:[t,o&&
|
|
178
|
-
`)[0]:$},[c,t,e==null?void 0:e.chain,l,u]),d=(f==null?void 0:f.minDepositSize)||"10";return k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&k.jsx("div",{className:"bg-white rounded-lg",children:k.jsx(zh,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&k.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[k.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),k.jsx(T3,{onCopy:()=>{s&&s(n)},text:n,children:k.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[k.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),k.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),k.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[k.jsxs("div",{className:"flex items-start",children:[k.jsx("div",{className:"w-5",children:k.jsx("img",{src:Wo,className:"w-4 h-4",alt:"Warning"})}),k.jsx("div",{className:"flex-1",children:k.jsx("p",{className:"text-xs text-functional-orange-1",children:p})})]}),r===a0&&k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),k.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:c("deposit.addressUpdatedNotice")})]})]}),k.jsxs("div",{className:"text-sm",children:[(a||t.toUpperCase()!=="USDC")&&k.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[k.jsx("span",{className:"text-text-tertiary",children:c("deposit.arrivalTime")}),k.jsx(Qn,{content:k.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[k.jsx("p",{children:c("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),k.jsx("p",{children:c("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:k.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:c("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),k.jsxs("div",{className:`flex justify-between items-center h-[18px] ${a||t.toUpperCase()!=="USDC"?"mt-1":"mt-4"}`,children:[k.jsx("span",{className:"text-text-tertiary",children:c("deposit.minDeposit")}),k.jsxs("span",{className:"text-text-primary font-medium text-right",children:[d," ",t]})]}),r===a0&&t.toUpperCase()!=="USDC"&&k.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[k.jsx("span",{className:"text-text-tertiary",children:c("deposit.maxDeposit")}),k.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),k.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{o&&o({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t}),i()},children:c("deposit.title")})]})},Vo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return k.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},E4=(e,t)=>Number(e)>Number(t),Mt=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},fi=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return fi(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:Mt(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},S4=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=Mt(Math.max(0,s).toString());return k.jsxs("span",{className:"flex items-center gap-1",children:[Mt(e),k.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${Mt(e)} ${n}`},P4=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},$4=(e,t,n)=>{if(!xh(e,n))return!1;try{const r=new Ie(t||"0"),o=new Ie("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},T4=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&xh(e,n))try{const i=new Ie(o),c=new Ie("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new Ie(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,Ie.ROUND_DOWN).toString()}catch{return o}},cm={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let Ye=null;const um=x.forwardRef((e,t)=>{const[n,r]=x.useState(!1),[o,s]=x.useState(!1),[i,c]=x.useState(cm),a=x.useCallback(h=>{c(h),r(!0)},[]),u=x.useCallback(h=>{c(m=>({...m,...h}))},[]),l=x.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=x.useCallback(h=>{s(h)},[]),p=x.useCallback(()=>n,[n]),d=x.useCallback(()=>o,[o]);return x.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:l,updateDepositOptions:u,setDepositLoading:f,isOpen:p,isLoading:d}),[a,l,u,f,p,d]),x.useEffect(()=>(Ye={openDeposit:a,closeDeposit:l,updateDepositOptions:u,setDepositLoading:f,isOpen:p,isLoading:d},()=>{Ye=null}),[a,l,u,f,p,d]),n?k.jsx(mm,{isOpen:n,isLoading:o,onClose:l,currentActiveAccount:i.currentActiveAccount,chains:i.chains,spotChains:i.spotChains,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});um.displayName="DepositManager";const lm=e=>{if(!Ye){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ye.openDeposit(e||cm)},fm=()=>{if(!Ye){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ye.closeDeposit()},dm=e=>{Ye&&Ye.updateDepositOptions(e)},di=e=>{if(!Ye){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ye.setDepositLoading(e)},A4=()=>Ye?Ye.isOpen():!1,pm=()=>Ye?Ye.isLoading():!1,O4=()=>({openDeposit:lm,closeDeposit:fm,updateDepositOptions:dm,setDepositLoading:di,isOpen:A4,isLoading:pm}),N4=e=>{const{t}=vt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return x.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const u=parseFloat(r||"0"),l=a,f=P4(r,s||"0",o);return!r||u===0||!o?{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:u<l?{text:t("deposit.minDepositParsed",{amount:l,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!f,isNetworkSwitch:!1}},[n,r,o,s,i,c,a,t])};function C4(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:c,usePublicClient:a,useSwitchChain:u}=e.wagmiHooks,l=o==null?void 0:o.tokenAddress,f=(o==null?void 0:o.decimals)??18,p=o==null?void 0:o.contractAddress,d=!l||l.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=u(),{writeContractAsync:m}=c(),w=a(),$=i({address:l,abi:yr,functionName:"allowance",args:[mn(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&l&&p)}}),E=$!=null&&$.isSuccess?$.data:void 0,S=x.useMemo(()=>{if(d)return!0;if(!$.isSuccess||E===void 0||E===0n)return!1;try{const B=x6(String(Number(s||"0")||0),Number(f));return E>=B}catch{return!1}},[d,$.isSuccess,E,s,f]),N=x.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!w||!l||!p)return;const F=mn(l),D=mn(p);if((E||0n)>0n){const v=await m({abi:yr,address:F,functionName:"approve",args:[D,0n]});await w.waitForTransactionReceipt({hash:v})}const g=await m({abi:yr,address:F,functionName:"approve",args:[D,ef]});await w.waitForTransactionReceipt({hash:g}),$!=null&&$.refetch&&await $.refetch()}catch(B){console.error("[useApprove] onApprove failed:",B)}},[r,n,l,p,E,$,m,w,h]);return{approve:S,onApprove:N}}const I4=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return x.useEffect(()=>{o(mn(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},M4=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var E;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=x.useMemo(()=>{const S="0x0000000000000000000000000000000000000000",N="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(B=>{const F=B.tokenAddress;if(!F)return!1;const D=F.toLowerCase();return!(F===S||D===N)})},[r]),[c,a]=x.useState({}),u=x.useCallback((S,N)=>{a(B=>({...B,[S]:N}))},[]),l=(E=o==null?void 0:o.useBalance)==null?void 0:E.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,p]=x.useState(0),d=x.useMemo(()=>i.map(S=>x.createElement(I4,{key:`${S.tokenAddress}-${f}`,token:S,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:u})),[i,e,s,n,o,u,f]),h=x.useMemo(()=>{const S=l!=null&&l.data?{value:l.data.value,formatted:l.data.formatted,decimals:l.data.decimals,symbol:l.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},N=i.map(F=>{const D=c[mn(F.tokenAddress)],b=D==null?void 0:D.balance,g=b==null?void 0:b.data;return{address:mn(F.tokenAddress),value:(g==null?void 0:g.value)||BigInt(0),formatted:(g==null?void 0:g.formatted)||"0",decimals:(g==null?void 0:g.decimals)||F.decimals}}).filter(F=>F.address),B=N.reduce((F,D)=>({...F,[D.address]:{balance:D}}),{});return{balanceList:N,baseTokenBalance:S,combinedData:B}},[l,c,i]),m=x.useCallback(async()=>h,[h]),w=x.useMemo(()=>{const S=(l==null?void 0:l.isLoading)||!1,N=Object.values(c).some(B=>{var F;return(F=B.balance)==null?void 0:F.isLoading});return S||N},[l==null?void 0:l.isLoading,c]),$=x.useCallback(()=>p(S=>S+1),[]);return{multicallRun:m,multicallRefresh:$,multicallResult:h,validErcTokens:i,isLoading:w,queryComponents:d}},k4=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:u}=vt(),l=i.useAccount(),f=t.tokenList.find(_=>_.token===n||_.symbol===n),p=t.chainId,[d,h]=x.useState("");x.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:m,queryComponents:w}=M4({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:i}),$=x.useMemo(()=>{var W;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return m.baseTokenBalance.formatted;const _=m.combinedData[f.tokenAddress];return((W=_==null?void 0:_.balance)==null?void 0:W.formatted)||"0"},[f,m]),E="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",S="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",N=x.useMemo(()=>{var _,W;return s5({chain:u5,transport:c5(t.rpcUrl||((_=window==null?void 0:window.ENV)==null?void 0:_.CHAIN_RPC_URL_42161)||((W=window==null?void 0:window.ENV)==null?void 0:W.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),B="1000000000000",{formatted:F}=l5({client:N,tokenAddress:E,holder:S,decimals:6,fallbackFormatted:B,pollingInterval:12e3}),[D,b]=x.useState(!1),{approve:g,onApprove:v}=C4({account:e,accountChainId:l.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:d,wagmiHooks:i}),C=x.useCallback(async()=>{if(!D)try{b(!0),await v()}catch(_){console.error("Approve failed:",_)}finally{b(!1)}},[D,v]),O=x.useMemo(()=>+l.chainId!=+t.chainId,[l.chainId,t.chainId]),I=x.useCallback(async()=>{c&&c(p)},[c,p]);x.useEffect(()=>{O&&I()},[O,I]);const{showLayerZeroTip:M,layerZeroTipKey:y}=x.useMemo(()=>{const _=+t.chainId==42161||+t.chainId==421614,W=(n==null?void 0:n.toUpperCase())==="USDT",K=new Ie(d||"0"),G=new Ie("200000");let H=!1,Z;if(_&&W&&d)if(K.gte(G))H=!0,Z="deposit.layerZeroDepositTipGte200k";else{const J=F;if(typeof J=="string"&&J.length>0){const me=new Ie(J);!me.isNaN()&&K.gte(me)&&(H=!0,Z="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:H,layerZeroTipKey:Z}},[t.chainId,n,d,F]),A=x.useCallback(()=>T4(+t.chainId,$||"0",n,r),[$,t==null?void 0:t.chainId,n,r]),T=x.useMemo(()=>r!=="spot"&&$4(+t.chainId,d,n),[r,t==null?void 0:t.chainId,d,n]),P=x.useMemo(()=>"deposit.maxDepositSplitTip",[]),L=N4({isNetworkMismatch:O,depositAmount:d,approved:g,currentTokenBalance:$,selectedToken:n,showLayerZeroTip:M,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),j=_=>{const W=_.target.value,K=A(),G=fi(W,K);if(G.isValid)h(G.formattedValue),G.errorType;else return G.errorType==="exceed_balance",void 0},z=x.useCallback(async()=>{di(!0);try{a&&a({amount:d,chainId:p,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(_){console.error("Deposit error:",_),di(!1)}},[a,d,p,f==null?void 0:f.tokenAddress,r,n]);return k.jsxs(k.Fragment,{children:[w,k.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[k.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[k.jsx("input",{type:"text",placeholder:u("deposit.amount"),value:d,onChange:j,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),k.jsx("button",{onClick:()=>{const _=A();h(_)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:u("deposit.max")})]}),k.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),k.jsxs("div",{className:"flex justify-between items-center",children:[k.jsx(Qn,{content:u("deposit.availableDesc"),children:k.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:u("deposit.available")})}),k.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:S4($||"0",d,n)})]})]}),!g&&E4(d||"0",0)&&k.jsxs("div",{className:"flex justify-center flex-col items-center",children:[k.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:u("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),k.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:u("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),k.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:C,disabled:D,children:D?k.jsx(Vo,{size:"xs",inline:!0}):u("deposit.enableWithToken",{token:n})})]}),M&&k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"flex mb-4",children:[k.jsx("div",{className:"w-5",children:k.jsx("img",{src:Wo,className:"w-4 h-4",alt:"Warning"})}),k.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u(y||"deposit.layerZeroDepositTip")})]}),k.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),T&&k.jsxs("div",{className:"flex mb-4",children:[k.jsx("div",{className:"w-5",children:k.jsx("img",{src:Wo,className:"w-4 h-4",alt:"Warning"})}),k.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:u(P)})]}),T&&k.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),k.jsxs("div",{className:"flex mb-4",children:[k.jsx("div",{className:"w-5",children:!(T||M)&&k.jsx("img",{src:Wo,className:"w-4 h-4",alt:"Warning"})}),k.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:u("deposit.noPrivateKeyWalletWarning")})]}),k.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[k.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[k.jsx("span",{className:"text-sm text-text-tertiary",children:u("deposit.arrivalTime")}),k.jsx(Qn,{content:k.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[k.jsx("p",{children:u("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),k.jsx("p",{children:u("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:k.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:u("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),k.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[k.jsx("span",{className:"text-sm text-text-tertiary",children:u("deposit.equity")}),k.jsx("span",{className:"text-sm text-text-primary font-medium",children:d?k.jsxs("span",{className:"flex items-center gap-1",children:[Mt(o),k.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Mt((parseFloat(o)+parseFloat(d)).toString())," ",n]}):`${Mt(o)} ${n}`})]})]}),k.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${L.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:z,disabled:L.disabled||s,children:[(s||O)&&k.jsx(Vo,{size:"xs"}),L.text]})]})},hm=e=>e.toLocaleUpperCase()===xn?xn:sc,Eu=e=>hm(e.wallet)===xn,B4=e=>hm(e.wallet)===sc,mm=({isOpen:e,isLoading:t=!1,onClose:n,currentActiveAccount:r,chains:o,spotChains:s=[],defaultChainId:i,defaultSymbol:c,defaultAccountType:a="perpetual",balances:u,wagmiHooks:l,onDeposit:f,onCopy:p,onChainChange:d,onTokenChange:h})=>{const{t:m}=vt(),[w,$]=x.useState(a),E=x.useCallback(T=>T==="spot"&&s&&s.length>0?s:o,[o,s]),S=E(a),[N,B]=x.useState(()=>{var T;return!S||S.length===0?1:i||((T=S[0])==null?void 0:T.chainId)||1}),F=x.useMemo(()=>E(w),[w,E]),D=F.find(T=>T.chainId===N)||F[0],[b,g]=x.useState(()=>{var _;if(!S||S.length===0)return"";const T=i||((_=S[0])==null?void 0:_.chainId),P=S.find(W=>W.chainId===T)||S[0],L=((P==null?void 0:P.tokenList)||[]).length>0?P:S.find(W=>(W.tokenList||[]).length>0),j=(L==null?void 0:L.tokenList)||[];if(c&&j.length>0){const W=c.toUpperCase(),K=j.find(G=>(G.token||G.symbol||"").toUpperCase()===W);if(K)return K.token||K.symbol||""}const z=j[0];return(z==null?void 0:z.token)||(z==null?void 0:z.symbol)||""}),v=x.useCallback(T=>{B(T),d==null||d(T)},[d]),C=x.useCallback(T=>{g(T),h==null||h(T)},[h]),O=x.useMemo(()=>{const T=(b||"").toLowerCase();if(!T)return"0";const P=w==="spot"?u==null?void 0:u.spot:u==null?void 0:u.perpetual,L=P==null?void 0:P[T];return typeof L=="string"&&L.length>0?L:"0"},[u,w,b]),[I,M]=x.useState(!1),y=T=>{T.target===T.currentTarget?M(!0):M(!1)},A=T=>{I&&T.target===T.currentTarget&&n(),M(!1)};return e?je.createPortal(k.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:k.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:y,onMouseUp:A,"aria-hidden":"true",children:k.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-[2px] border-solid border-line-divider-secondary",onClick:T=>{T.stopPropagation()},children:[k.jsxs("div",{className:"flex items-center justify-between mb-4",children:[k.jsx("h2",{className:"text-lg font-semibold text-white",children:m("deposit.title")}),k.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:k.jsx(l0,{className:"h-4 w-4"})})]}),k.jsx(Sh,{selectedAccount:w,onAccountChange:T=>{var H,Z;const P=T||"perpetual";$(P);const L=E(P);if(!L||L.length===0)return;const j=L.find(J=>J.chainId===N),z=j?j.chainId:L[0].chainId;B(z),d==null||d(z);const _=L.find(J=>J.chainId===z),W=(_==null?void 0:_.tokenList)||[],G=W.some(J=>(J.symbol||J.token)===b)?b:((H=W[0])==null?void 0:H.symbol)||((Z=W[0])==null?void 0:Z.token)||"";G&&(g(G),h==null||h(G))},className:"w-full"}),k.jsx(Eh,{currentActiveChain:D,chainList:F,onChainChange:v,curSelectToken:b,onTokenChange:C,walletType:Eu(r)?xn:sc,accountType:w}),Eu(r)&&k.jsx(x4,{address:r.smartWalletAddress,currentActiveChain:D,selectedToken:b,accountType:w,onDeposit:f,onCopy:p,onClose:n}),B4(r)&&k.jsx(k4,{address:r.ethAddress,currentActiveChain:D,selectedToken:b,accountType:w,platformBalance:O,isLoading:t,wagmiHooks:l,onChainChange:v,onDeposit:f,onClose:n})]})})}),document.body):null},L4=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",walletType:i="evm",receiverAddress:c="",accountType:a="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:l,onAmountChanged:f,showPoolBalanceInsufficientTip:p=!1})=>{const{t:d}=vt(),h=x.useMemo(()=>{if(a==="spot"||!ln(r==null?void 0:r.chainId)){const F=new Ie(e||"0").minus(s||"0");if(F.isNegative()||F.isZero())return"0";const D=Math.min(F.decimalPlaces()??0,18);return F.decimalPlaces(D,Ie.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,a]),m=x.useMemo(()=>o||"0",[o]),w=x.useMemo(()=>{const F=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new Ie(F||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),$=x.useMemo(()=>w==="0",[w]),E=x.useMemo(()=>{const F=(t||"").toUpperCase();return F==="USDT"||F==="USDC"},[t]),S=F=>{const D=F.target.value,g=fi(D,m||"0");if(g.isValid)u(g.formattedValue),g.errorType;else return g.errorType==="exceed_balance",void 0;f==null||f(g.formattedValue)},N=()=>{const F=m||"0",b=fi(F,F).formattedValue;u(b),f==null||f(b)},B=()=>{const F=parseFloat(o||"0"),D=parseFloat(e||"0");if(D>0){const b=F-D,g=Mt(Math.max(0,b).toString());return k.jsxs("span",{className:"flex items-center gap-1",children:[Mt(o||"0"),k.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),g," ",t]})}return`${Mt(o||"0")} ${t}`};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[k.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[k.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:e,onChange:S,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),k.jsx("button",{onClick:N,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),k.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),k.jsxs("div",{className:"flex justify-between items-center",children:[k.jsx(Qn,{content:d("withdraw.availableDesc"),children:k.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),k.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:B()})]})]}),i==="mpc"&&(a==="spot"||!ln(r==null?void 0:r.chainId))?k.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:k.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:F=>l==null?void 0:l(F.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,k.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:ln(r==null?void 0:r.chainId)?k.jsxs(k.Fragment,{children:[k.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),k.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:d("withdraw.commonWithdraw")})]}):k.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&k.jsxs("div",{className:"flex mb-4",children:[k.jsx("div",{className:"w-5",children:k.jsx("img",{src:Wo,className:"w-4 h-4",alt:"Warning"})}),k.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),k.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[k.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[k.jsx(Qn,{content:k.jsxs("div",{children:[k.jsx("div",{children:d("withdraw.speedNote")}),k.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[k.jsx(Uo,{selectedLevel:It.FAST,maxLevel:3}),k.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),k.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[k.jsx(Uo,{selectedLevel:It.Medium,maxLevel:3}),k.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),k.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[k.jsx(Uo,{selectedLevel:It.SLOW,maxLevel:3}),k.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:k.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),k.jsx("div",{className:"flex items-center",children:k.jsx(Uo,{selectedLevel:ln(r==null?void 0:r.chainId)?It.SLOW:It.FAST,maxLevel:3})})]}),(a==="spot"||!ln(r==null?void 0:r.chainId))&&k.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[$||!E?k.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:$?d("withdraw.fee"):`${d("withdraw.fee")}/${d("withdraw.feeRate")}`}):k.jsx(Qn,{className:"w-[320px] font-normal flex items-center justify-center",content:k.jsx("span",{className:"flex items-center justify-center text-center",children:d("withdraw.feeCalculationTip")}),children:k.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${d("withdraw.fee")}/${d("withdraw.feeRate")}`})}),k.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!$&&` / ${w}%`]})]}),k.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[k.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(ln(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),k.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Mt(h)," ",t]})]})]})]})},F4=[];let Ke=null;const bm=x.forwardRef((e,t)=>{const[n,r]=x.useState(!1),[o,s]=x.useState(!1),[i,c]=x.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=x.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),u=x.useCallback(h=>{c(m=>({...m,...h}))},[]),l=x.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=x.useCallback(h=>{s(h)},[]),p=x.useCallback(()=>n,[n]),d=x.useCallback(()=>o,[o]);return x.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:l,updateWithdrawOptions:u,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,l,u,f,p,d]),x.useEffect(()=>(Ke={openWithdraw:a,closeWithdraw:l,updateWithdrawOptions:u,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{Ke=null}),[a,l,u,f,p,d]),n?k.jsx(xm,{isOpen:n,isLoading:o,onClose:l,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||F4,spotChains:i.spotChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onAccountChange:i.onAccountChange,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});bm.displayName="WithdrawManager";const gm=e=>{if(!Ke){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ke.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},ym=()=>{if(!Ke){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ke.closeWithdraw()},wm=e=>{if(!Ke){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ke.updateWithdrawOptions(e)},pi=e=>{if(!Ke){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ke.setWithdrawLoading(e)},D4=()=>Ke?Ke.isOpen():!1,vm=()=>Ke?Ke.isLoading():!1,R4=()=>({openWithdraw:gm,closeWithdraw:ym,updateWithdrawOptions:wm,setWithdrawLoading:pi,isOpen:D4,isLoading:vm}),j4=({walletType:e,chains:t,spotChains:n=[],defaultChainId:r,defaultSymbol:o,defaultAmount:s="",defaultAccountType:i="perpetual",currentEquity:c,platformBalance:a="0",balances:u,fee:l="0.00",isLoading:f=!1,onWithdraw:p,onClose:d,onChainChange:h,onTokenChange:m,onAmountChanged:w,onAccountChange:$})=>{var H;const{t:E}=vt(),[S,N]=x.useState(i),B=x.useCallback(Z=>Z==="spot"&&n&&n.length>0?n:t,[t,n]),F=x.useMemo(()=>B(S),[S,B]),D=x.useMemo(()=>{if(!F||F.length===0)return{chainId:1,tokenSymbol:""};const Z=de=>{const se=de||[];if(!se.length)return"";const ee="USDC".toUpperCase(),Nn=se.find(gt=>(gt.token||gt.symbol||"").toUpperCase()===ee)||se[0];return Nn.token||Nn.symbol||""};if(o){const de=o==null?void 0:o.toUpperCase();for(const se of F){const pe=se.tokenList||[];let ee;if(de&&(ee=pe.find(Se=>(Se.token||Se.symbol||"").toUpperCase()===de)),ee){const Se=ee.token||ee.symbol||o||"";return{chainId:se.chainId,tokenSymbol:Se}}}}if(r){const de=F.find(ee=>ee.chainId===r)||F[0],se=de.tokenList||[],pe=Z(se);return{chainId:de.chainId,tokenSymbol:pe}}const J="USDC",oe=de=>Array.isArray(de.tokenList)&&de.tokenList.some(se=>(se.token||se.symbol||"").toUpperCase()===J),me=F.find(oe)||F[0];if(!me)return{chainId:1,tokenSymbol:""};const ge=Z(me.tokenList);return{chainId:me.chainId,tokenSymbol:ge}},[F,r,o]),[b,g]=x.useState(()=>D.chainId),[v,C]=x.useState(()=>D.tokenSymbol),[O,I]=x.useState(s),[M,y]=x.useState(""),A=x.useCallback(Z=>{g(Z),h==null||h(Z)},[h]),T=x.useCallback(Z=>{C(Z),m==null||m(Z)},[m]),P=x.useRef(!0),L=x.useRef(v),j=x.useRef(b);x.useEffect(()=>{if(P.current){P.current=!1,L.current=v,j.current=b;return}(L.current!==v||j.current!==b)&&(I(""),L.current=v,j.current=b)},[v,b]);const z=F&&F.length>0?F.find(Z=>Z.chainId===b)||F[0]:null,_=(H=z==null?void 0:z.tokenList)==null?void 0:H.find(Z=>Z.token===v),W=x.useMemo(()=>{const Z=new Ie(O||"0"),J=new Ie(l||"0"),oe=ln(b);return _!=null&&_.minWithdrawSize&&Z.lt(_.minWithdrawSize)?{text:E("withdraw.minWithdrawParsed",{amount:_.minWithdrawSize,token:_.symbol||_.token}),disabled:!0}:!O||Z.isZero()||!oe&&Z.isLessThan(J)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!oe||S==="spot")&&!M.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,b,O,e,M,l,S,_]),K=x.useMemo(()=>{const Z=(v||"").toLowerCase();if(!Z)return a||"0";const J=S==="spot"?u==null?void 0:u.spot:u==null?void 0:u.perpetual,oe=J==null?void 0:J[Z];return typeof oe=="string"&&oe.length>0?oe:a||"0"},[u,S,v,a]),G=x.useCallback(async()=>{pi(!0);try{if(p){const J={amount:new Ie(O||"0").toString(),chainId:b,tokenAddress:(_==null?void 0:_.tokenAddress)||"",coinId:(_==null?void 0:_.coinId)||"",tokenSymbol:v,accountType:S,selectedToken:_};e==="mpc"&&(!ln(b)||S==="spot")&&(J.receiverAddress=M),p(J)}}catch{pi(!1)}},[p,S,_,O,b,v,e,M]);return!F||F.length===0?k.jsx("div",{className:"text-center py-8",children:k.jsx("p",{className:"text-gray-400",children:"No chains available"})}):z?k.jsxs(k.Fragment,{children:[k.jsx(Sh,{selectedAccount:S,onAccountChange:Z=>{var Se,Nn;const J=Z||"perpetual";N(J),$==null||$(J);const oe=B(J);if(!oe||oe.length===0)return;const me=oe.find(gt=>gt.chainId===b),ge=me?me.chainId:oe[0].chainId;g(ge),h==null||h(ge);const de=oe.find(gt=>gt.chainId===ge),se=(de==null?void 0:de.tokenList)||[],ee=se.some(gt=>(gt.symbol||gt.token)===v)?v:((Se=se[0])==null?void 0:Se.symbol)||((Nn=se[0])==null?void 0:Nn.token)||"";ee&&(C(ee),m==null||m(ee))},className:"w-full"}),k.jsx(Eh,{currentActiveChain:z,chainList:F,onChainChange:A,curSelectToken:v,onTokenChange:T,walletType:"EVM",txType:"withdraw"}),k.jsx(L4,{withdrawAmount:O,curSelectToken:v,tokenInfo:_,curSelectTokenData:{balance:_==null?void 0:_.balance,allowance:_==null?void 0:_.allowance},currentActiveChain:z,currentEquity:c||0,decimals:(_==null?void 0:_.decimals)||6,platformBalance:K,fee:l,walletType:e,accountType:S,receiverAddress:M,onWithdrawAmountChange:I,onReceiverAddressChange:y,onAmountChanged:w}),k.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${W.disabled||f?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:G,disabled:W.disabled||f,children:[f&&k.jsx(Vo,{size:"xs"}),W.text]})]}):k.jsx("div",{className:"text-center py-8",children:k.jsx("p",{className:"text-gray-400",children:"Loading..."})})},xm=({isOpen:e,isLoading:t=!1,defaultAccountType:n="perpetual",onClose:r,config:o,currentActiveAccount:s,chains:i,spotChains:c=[],defaultChainId:a,defaultSymbol:u,defaultAmount:l="",currentEquity:f=5e3,platformBalance:p="0",balances:d,fee:h,wagmiHooks:m,onWithdraw:w,onChainChange:$,onTokenChange:E,onAmountChanged:S,onAccountChange:N})=>{const{t:B}=vt(),[F,D]=x.useState(!1),b=v=>{v.target===v.currentTarget?D(!0):D(!1)},g=v=>{F&&v.target===v.currentTarget&&r(),D(!1)};return e?je.createPortal(k.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:k.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:b,onMouseUp:g,"aria-hidden":"true",children:k.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:v=>{v.stopPropagation()},children:[k.jsxs("div",{className:"flex items-center justify-between mb-4",children:[k.jsx("h2",{className:"text-lg font-semibold text-white",children:B("withdraw.withdraw")}),k.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:k.jsx(l0,{className:"h-4 w-4"})})]}),k.jsx(j4,{chains:i,spotChains:c,walletType:Eu(s)?"mpc":"evm",defaultChainId:a,defaultSymbol:u,defaultAmount:l,defaultAccountType:n,currentEquity:f,platformBalance:p,balances:d,fee:h,isLoading:t,wagmiHooks:m,onWithdraw:w,onClose:r,onChainChange:$,onTokenChange:E,onAmountChanged:S,onAccountChange:N})]})})}),document.body):null};re.ChromeLoader=Vo,re.ComponentProvider=Gm,re.DEFAULT_LOCALE=qo,re.Deposit=mm,re.DepositManager=um,re.LOCALE_NAMES=Hm,re.LoadingSpinner=Vo,re.SUPPORTED_LOCALES=bi,re.Tooltip=Qn,re.Withdraw=xm,re.WithdrawManager=bm,re.closeDeposit=fm,re.closeWithdraw=ym,re.formatThousands=Zm,re.isDepositLoading=pm,re.isWithdrawLoading=vm,re.openDeposit=lm,re.openWithdraw=gm,re.setDepositLoading=di,re.setWithdrawLoading=pi,re.updateDepositOptions=dm,re.updateWithdrawOptions=wm,re.useComponentConfig=Lu,re.useDeposit=f5,re.useDepositManager=O4,re.useTranslation=vt,re.useWithdraw=d5,re.useWithdrawManager=R4,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
|
|
185
|
+
`,children:[t,o&&D.jsx(am,{ref:f,placement:h.placement||n})]})})]})},Ho="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",TS=({currentActiveChain:e,selectedToken:t,address:n,accountType:r,onDeposit:o,onCopy:s,onClose:i})=>{const{t:c}=wt(),a=r===g5,l=x.useMemo(()=>{if(!e)return!1;const h=Number(e.chainId);return!Number.isNaN(h)&&(h===42161||h===421614)},[e]),u=a,f=x.useMemo(()=>{var h;return(h=e==null?void 0:e.tokenList)==null?void 0:h.find(m=>m.token===t||m.symbol===t)},[e,t]),p=x.useMemo(()=>{const h=(t||"").toUpperCase();if(!u&&h==="USDC")return c("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const T=c(u?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return u&&(!l||h==="USDC")?String(T).split(`
|
|
186
|
+
`)[0]:T},[c,t,e==null?void 0:e.chain,u,l]),d=(f==null?void 0:f.minDepositSize)||"10";return D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&D.jsx("div",{className:"bg-white rounded-lg",children:D.jsx(Uh,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&D.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[D.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),D.jsx(O3,{onCopy:()=>{s&&s(n)},text:n,children:D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[D.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),D.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),D.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[D.jsxs("div",{className:"flex items-start",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1",children:D.jsx("p",{className:"text-xs text-functional-orange-1",children:p})})]}),r===a0&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),D.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:c("deposit.addressUpdatedNotice")})]})]}),D.jsxs("div",{className:"text-sm",children:[(a||t.toUpperCase()!=="USDC")&&D.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[D.jsx("span",{className:"text-text-tertiary",children:c("deposit.arrivalTime")}),D.jsx(Qn,{content:D.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[D.jsx("p",{children:c("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),D.jsx("p",{children:c("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:D.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:c("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),D.jsxs("div",{className:`flex justify-between items-center h-[18px] ${a||t.toUpperCase()!=="USDC"?"mt-1":"mt-4"}`,children:[D.jsx("span",{className:"text-text-tertiary",children:c("deposit.minDeposit")}),D.jsxs("span",{className:"text-text-primary font-medium text-right",children:[d," ",t]})]}),r===a0&&t.toUpperCase()!=="USDC"&&D.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[D.jsx("span",{className:"text-text-tertiary",children:c("deposit.maxDeposit")}),D.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),D.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{o&&o({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t}),i()},children:c("deposit.title")})]})},Vo=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return D.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},AS=(e,t)=>Number(e)>Number(t),kt=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},fi=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return fi(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:kt(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},$S=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=kt(Math.max(0,s).toString());return D.jsxs("span",{className:"flex items-center gap-1",children:[kt(e),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${kt(e)} ${n}`},NS=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},CS=(e,t,n)=>{if(!xh(e,n))return!1;try{const r=new Ie(t||"0"),o=new Ie("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},OS=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&xh(e,n))try{const i=new Ie(o),c=new Ie("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new Ie(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,Ie.ROUND_DOWN).toString()}catch{return o}},cm={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let Ke=null;const lm=x.forwardRef((e,t)=>{const[n,r]=x.useState(!1),[o,s]=x.useState(!1),[i,c]=x.useState(cm),a=x.useCallback(h=>{c(h),r(!0)},[]),l=x.useCallback(h=>{c(m=>({...m,...h}))},[]),u=x.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=x.useCallback(h=>{s(h)},[]),p=x.useCallback(()=>n,[n]),d=x.useCallback(()=>o,[o]);return x.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),x.useEffect(()=>(Ke={openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d},()=>{Ke=null}),[a,u,l,f,p,d]),n?D.jsx(mm,{isOpen:n,isLoading:o,onClose:u,currentActiveAccount:i.currentActiveAccount,chains:i.chains,spotChains:i.spotChains,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});lm.displayName="DepositManager";const um=e=>{if(!Ke){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ke.openDeposit(e||cm)},fm=()=>{if(!Ke){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ke.closeDeposit()},dm=e=>{Ke&&Ke.updateDepositOptions(e)},di=e=>{if(!Ke){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Ke.setDepositLoading(e)},IS=()=>Ke?Ke.isOpen():!1,pm=()=>Ke?Ke.isLoading():!1,kS=()=>({openDeposit:um,closeDeposit:fm,updateDepositOptions:dm,setDepositLoading:di,isOpen:IS,isLoading:pm}),DS=e=>{const{t}=wt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return x.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const l=parseFloat(r||"0"),u=a,f=NS(r,s||"0",o);return!r||l===0||!o?{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:l<u?{text:t("deposit.minDepositParsed",{amount:u,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(c?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!f,isNetworkSwitch:!1}},[n,r,o,s,i,c,a,t])};function MS(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:c,usePublicClient:a,useSwitchChain:l}=e.wagmiHooks,u=o==null?void 0:o.tokenAddress,f=(o==null?void 0:o.decimals)??18,p=o==null?void 0:o.contractAddress,d=!u||u.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=l(),{writeContractAsync:m}=c(),v=a(),T=i({address:u,abi:yr,functionName:"allowance",args:[mn(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&u&&p)}}),E=T!=null&&T.isSuccess?T.data:void 0,S=x.useMemo(()=>{if(d)return!0;if(!T.isSuccess||E===void 0||E===0n)return!1;try{const M=T6(String(Number(s||"0")||0),Number(f));return E>=M}catch{return!1}},[d,T.isSuccess,E,s,f]),C=x.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!v||!u||!p)return;const B=mn(u),F=mn(p);if((E||0n)>0n){const w=await m({abi:yr,address:B,functionName:"approve",args:[F,0n]});await v.waitForTransactionReceipt({hash:w})}const g=await m({abi:yr,address:B,functionName:"approve",args:[F,ef]});await v.waitForTransactionReceipt({hash:g}),T!=null&&T.refetch&&await T.refetch()}catch(M){console.error("[useApprove] onApprove failed:",M)}},[r,n,u,p,E,T,m,v,h]);return{approve:S,onApprove:C}}const LS=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return x.useEffect(()=>{o(mn(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},BS=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var E;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=x.useMemo(()=>{const S="0x0000000000000000000000000000000000000000",C="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(M=>{const B=M.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===S||F===C)})},[r]),[c,a]=x.useState({}),l=x.useCallback((S,C)=>{a(M=>({...M,[S]:C}))},[]),u=(E=o==null?void 0:o.useBalance)==null?void 0:E.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,p]=x.useState(0),d=x.useMemo(()=>i.map(S=>x.createElement(LS,{key:`${S.tokenAddress}-${f}`,token:S,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:l})),[i,e,s,n,o,l,f]),h=x.useMemo(()=>{const S=u!=null&&u.data?{value:u.data.value,formatted:u.data.formatted,decimals:u.data.decimals,symbol:u.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},C=i.map(B=>{const F=c[mn(B.tokenAddress)],b=F==null?void 0:F.balance,g=b==null?void 0:b.data;return{address:mn(B.tokenAddress),value:(g==null?void 0:g.value)||BigInt(0),formatted:(g==null?void 0:g.formatted)||"0",decimals:(g==null?void 0:g.decimals)||B.decimals}}).filter(B=>B.address),M=C.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:C,baseTokenBalance:S,combinedData:M}},[u,c,i]),m=x.useCallback(async()=>h,[h]),v=x.useMemo(()=>{const S=(u==null?void 0:u.isLoading)||!1,C=Object.values(c).some(M=>{var B;return(B=M.balance)==null?void 0:B.isLoading});return S||C},[u==null?void 0:u.isLoading,c]),T=x.useCallback(()=>p(S=>S+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:v,queryComponents:d}},FS=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:l}=wt(),u=i.useAccount(),f=t.tokenList.find(_=>_.token===n||_.symbol===n),p=t.chainId,[d,h]=x.useState("");x.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:m,queryComponents:v}=BS({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:i}),T=x.useMemo(()=>{var H;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return m.baseTokenBalance.formatted;const _=m.combinedData[f.tokenAddress];return((H=_==null?void 0:_.balance)==null?void 0:H.formatted)||"0"},[f,m]),E="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",S="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",C=x.useMemo(()=>{var _,H;return l5({chain:p5,transport:d5(t.rpcUrl||((_=window==null?void 0:window.ENV)==null?void 0:_.CHAIN_RPC_URL_42161)||((H=window==null?void 0:window.ENV)==null?void 0:H.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),M="1000000000000",{formatted:B}=h5({client:C,tokenAddress:E,holder:S,decimals:6,fallbackFormatted:M,pollingInterval:12e3}),[F,b]=x.useState(!1),{approve:g,onApprove:w}=MS({account:e,accountChainId:u.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:d,wagmiHooks:i}),O=x.useCallback(async()=>{if(!F)try{b(!0),await w()}catch(_){console.error("Approve failed:",_)}finally{b(!1)}},[F,w]),N=x.useMemo(()=>+u.chainId!=+t.chainId,[u.chainId,t.chainId]),I=x.useCallback(async()=>{c&&c(p)},[c,p]);x.useEffect(()=>{N&&I()},[N,I]);const{showLayerZeroTip:k,layerZeroTipKey:y}=x.useMemo(()=>{const _=+t.chainId==42161||+t.chainId==421614,H=(n==null?void 0:n.toUpperCase())==="USDT",Y=new Ie(d||"0"),G=new Ie("200000");let W=!1,Z;if(_&&H&&d)if(Y.gte(G))W=!0,Z="deposit.layerZeroDepositTipGte200k";else{const J=B;if(typeof J=="string"&&J.length>0){const me=new Ie(J);!me.isNaN()&&Y.gte(me)&&(W=!0,Z="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:W,layerZeroTipKey:Z}},[t.chainId,n,d,B]),$=x.useCallback(()=>OS(+t.chainId,T||"0",n,r),[T,t==null?void 0:t.chainId,n,r]),A=x.useMemo(()=>r!=="spot"&&CS(+t.chainId,d,n),[r,t==null?void 0:t.chainId,d,n]),P=x.useMemo(()=>"deposit.maxDepositSplitTip",[]),L=DS({isNetworkMismatch:N,depositAmount:d,approved:g,currentTokenBalance:T,selectedToken:n,showLayerZeroTip:k,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),j=_=>{const H=_.target.value,Y=$(),G=fi(H,Y);if(G.isValid)h(G.formattedValue),G.errorType;else return G.errorType==="exceed_balance",void 0},U=x.useCallback(async()=>{di(!0);try{a&&a({amount:d,chainId:p,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(_){console.error("Deposit error:",_),di(!1)}},[a,d,p,f==null?void 0:f.tokenAddress,r,n]);return D.jsxs(D.Fragment,{children:[v,D.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[D.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[D.jsx("input",{type:"text",placeholder:l("deposit.amount"),value:d,onChange:j,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),D.jsx("button",{onClick:()=>{const _=$();h(_)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:l("deposit.max")})]}),D.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx(Qn,{content:l("deposit.availableDesc"),children:D.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:l("deposit.available")})}),D.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:$S(T||"0",d,n)})]})]}),!g&&AS(d||"0",0)&&D.jsxs("div",{className:"flex justify-center flex-col items-center",children:[D.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:l("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),D.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:l("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),D.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:O,disabled:F,children:F?D.jsx(Vo,{size:"xs",inline:!0}):l("deposit.enableWithToken",{token:n})})]}),k&&D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(y||"deposit.layerZeroDepositTip")})]}),D.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),A&&D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(P)})]}),A&&D.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:!(A||k)&&D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:l("deposit.noPrivateKeyWalletWarning")})]}),D.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[D.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[D.jsx("span",{className:"text-sm text-text-tertiary",children:l("deposit.arrivalTime")}),D.jsx(Qn,{content:D.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[D.jsx("p",{children:l("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),D.jsx("p",{children:l("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:D.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:l("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),D.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[D.jsx("span",{className:"text-sm text-text-tertiary",children:l("deposit.equity")}),D.jsx("span",{className:"text-sm text-text-primary font-medium",children:d?D.jsxs("span",{className:"flex items-center gap-1",children:[kt(o),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),kt((parseFloat(o)+parseFloat(d)).toString())," ",n]}):`${kt(o)} ${n}`})]})]}),D.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${L.disabled||s?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:U,disabled:L.disabled||s,children:[(s||N)&&D.jsx(Vo,{size:"xs"}),L.text]})]})},hm=e=>e.toLocaleUpperCase()===xn?xn:sc,El=e=>hm(e.wallet)===xn,RS=e=>hm(e.wallet)===sc,mm=({isOpen:e,isLoading:t=!1,onClose:n,currentActiveAccount:r,chains:o,spotChains:s=[],defaultChainId:i,defaultSymbol:c,defaultAccountType:a="perpetual",balances:l,wagmiHooks:u,onDeposit:f,onCopy:p,onChainChange:d,onTokenChange:h})=>{const{t:m}=wt(),[v,T]=x.useState(a),E=x.useCallback(A=>A==="spot"&&s&&s.length>0?s:o,[o,s]),S=E(a),[C,M]=x.useState(()=>{var A;return!S||S.length===0?1:i||((A=S[0])==null?void 0:A.chainId)||1}),B=x.useMemo(()=>E(v),[v,E]),F=B.find(A=>A.chainId===C)||B[0],[b,g]=x.useState(()=>{var _;if(!S||S.length===0)return"";const A=i||((_=S[0])==null?void 0:_.chainId),P=S.find(H=>H.chainId===A)||S[0],L=((P==null?void 0:P.tokenList)||[]).length>0?P:S.find(H=>(H.tokenList||[]).length>0),j=(L==null?void 0:L.tokenList)||[];if(c&&j.length>0){const H=c.toUpperCase(),Y=j.find(G=>(G.token||G.symbol||"").toUpperCase()===H);if(Y)return Y.token||Y.symbol||""}const U=j[0];return(U==null?void 0:U.token)||(U==null?void 0:U.symbol)||""}),w=x.useCallback(A=>{M(A),d==null||d(A)},[d]),O=x.useCallback(A=>{g(A),h==null||h(A)},[h]),N=x.useMemo(()=>{const A=(b||"").toLowerCase();if(!A)return"0";const P=v==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,L=P==null?void 0:P[A];return typeof L=="string"&&L.length>0?L:"0"},[l,v,b]),[I,k]=x.useState(!1),y=A=>{A.target===A.currentTarget?k(!0):k(!1)},$=A=>{I&&A.target===A.currentTarget&&n(),k(!1)};return e?je.createPortal(D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:y,onMouseUp:$,"aria-hidden":"true",children:D.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-[2px] border-solid border-line-divider-secondary",onClick:A=>{A.stopPropagation()},children:[D.jsxs("div",{className:"flex items-center justify-between mb-4",children:[D.jsx("h2",{className:"text-lg font-semibold text-white",children:m("deposit.title")}),D.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:D.jsx(u0,{className:"h-4 w-4"})})]}),D.jsx(Sh,{selectedAccount:v,onAccountChange:A=>{var W,Z;const P=A||"perpetual";T(P);const L=E(P);if(!L||L.length===0)return;const j=L.find(J=>J.chainId===C),U=j?j.chainId:L[0].chainId;M(U),d==null||d(U);const _=L.find(J=>J.chainId===U),H=(_==null?void 0:_.tokenList)||[],G=H.some(J=>(J.symbol||J.token)===b)?b:((W=H[0])==null?void 0:W.symbol)||((Z=H[0])==null?void 0:Z.token)||"";G&&(g(G),h==null||h(G))},className:"w-full"}),D.jsx(Eh,{currentActiveChain:F,chainList:B,onChainChange:w,curSelectToken:b,onTokenChange:O,walletType:El(r)?xn:sc,accountType:v}),El(r)&&D.jsx(TS,{address:r.smartWalletAddress,currentActiveChain:F,selectedToken:b,accountType:v,onDeposit:f,onCopy:p,onClose:n}),RS(r)&&D.jsx(FS,{address:r.ethAddress,currentActiveChain:F,selectedToken:b,accountType:v,platformBalance:N,isLoading:t,wagmiHooks:u,onChainChange:w,onDeposit:f,onClose:n})]})})}),document.body):null},jS=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",walletType:i="evm",receiverAddress:c="",accountType:a="perpetual",onWithdrawAmountChange:l,onReceiverAddressChange:u,onAmountChanged:f,showPoolBalanceInsufficientTip:p=!1})=>{const{t:d}=wt(),h=x.useMemo(()=>{if(a==="spot"||!un(r==null?void 0:r.chainId)){const B=new Ie(e||"0").minus(s||"0");if(B.isNegative()||B.isZero())return"0";const F=Math.min(B.decimalPlaces()??0,18);return B.decimalPlaces(F,Ie.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,a]),m=x.useMemo(()=>o||"0",[o]),v=x.useMemo(()=>{const B=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new Ie(B||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),T=x.useMemo(()=>v==="0",[v]),E=x.useMemo(()=>{const B=(t||"").toUpperCase();return B==="USDT"||B==="USDC"},[t]),S=B=>{const F=B.target.value,g=fi(F,m||"0");if(g.isValid)l(g.formattedValue),g.errorType;else return g.errorType==="exceed_balance",void 0;f==null||f(g.formattedValue)},C=()=>{const B=m||"0",b=fi(B,B).formattedValue;l(b),f==null||f(b)},M=()=>{const B=parseFloat(o||"0"),F=parseFloat(e||"0");if(F>0){const b=B-F,g=kt(Math.max(0,b).toString());return D.jsxs("span",{className:"flex items-center gap-1",children:[kt(o||"0"),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),g," ",t]})}return`${kt(o||"0")} ${t}`};return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[D.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[D.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:e,onChange:S,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),D.jsx("button",{onClick:C,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),D.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),D.jsxs("div",{className:"flex justify-between items-center",children:[D.jsx(Qn,{content:d("withdraw.availableDesc"),children:D.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),D.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:M()})]})]}),i==="mpc"&&(a==="spot"||!un(r==null?void 0:r.chainId))?D.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:D.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:B=>u==null?void 0:u(B.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,D.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:un(r==null?void 0:r.chainId)?D.jsxs(D.Fragment,{children:[D.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),D.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:d("withdraw.commonWithdraw")})]}):D.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Ho,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),D.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[D.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[D.jsx(Qn,{content:D.jsxs("div",{children:[D.jsx("div",{children:d("withdraw.speedNote")}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(zo,{selectedLevel:It.FAST,maxLevel:3}),D.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(zo,{selectedLevel:It.Medium,maxLevel:3}),D.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(zo,{selectedLevel:It.SLOW,maxLevel:3}),D.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:D.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),D.jsx("div",{className:"flex items-center",children:D.jsx(zo,{selectedLevel:un(r==null?void 0:r.chainId)?It.SLOW:It.FAST,maxLevel:3})})]}),(a==="spot"||!un(r==null?void 0:r.chainId))&&D.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[T||!E?D.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:T?d("withdraw.fee"):`${d("withdraw.fee")}/${d("withdraw.feeRate")}`}):D.jsx(Qn,{className:"w-[320px] font-normal flex items-center justify-center",content:D.jsx("span",{className:"flex items-center justify-center text-center",children:d("withdraw.feeCalculationTip")}),children:D.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${d("withdraw.fee")}/${d("withdraw.feeRate")}`})}),D.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!T&&` / ${v}%`]})]}),D.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[D.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(un(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),D.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[kt(h)," ",t]})]})]})]})},_S=[];let Ye=null;const bm=x.forwardRef((e,t)=>{const[n,r]=x.useState(!1),[o,s]=x.useState(!1),[i,c]=x.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=x.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),l=x.useCallback(h=>{c(m=>({...m,...h}))},[]),u=x.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=x.useCallback(h=>{s(h)},[]),p=x.useCallback(()=>n,[n]),d=x.useCallback(()=>o,[o]);return x.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),x.useEffect(()=>(Ye={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{Ye=null}),[a,u,l,f,p,d]),n?D.jsx(xm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||_S,spotChains:i.spotChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onAccountChange:i.onAccountChange,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});bm.displayName="WithdrawManager";const gm=e=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},ym=()=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.closeWithdraw()},vm=e=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.updateWithdrawOptions(e)},pi=e=>{if(!Ye){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Ye.setWithdrawLoading(e)},zS=()=>Ye?Ye.isOpen():!1,wm=()=>Ye?Ye.isLoading():!1,US=()=>({openWithdraw:gm,closeWithdraw:ym,updateWithdrawOptions:vm,setWithdrawLoading:pi,isOpen:zS,isLoading:wm}),WS=({walletType:e,chains:t,spotChains:n=[],defaultChainId:r,defaultSymbol:o,defaultAmount:s="",defaultAccountType:i="perpetual",currentEquity:c,platformBalance:a="0",balances:l,fee:u="0.00",isLoading:f=!1,onWithdraw:p,onClose:d,onChainChange:h,onTokenChange:m,onAmountChanged:v,onAccountChange:T})=>{var W;const{t:E}=wt(),[S,C]=x.useState(i),M=x.useCallback(Z=>Z==="spot"&&n&&n.length>0?n:t,[t,n]),B=x.useMemo(()=>M(S),[S,M]),F=x.useMemo(()=>{if(!B||B.length===0)return{chainId:1,tokenSymbol:""};const Z=de=>{const se=de||[];if(!se.length)return"";const ee="USDC".toUpperCase(),Cn=se.find(gt=>(gt.token||gt.symbol||"").toUpperCase()===ee)||se[0];return Cn.token||Cn.symbol||""};if(o){const de=o==null?void 0:o.toUpperCase();for(const se of B){const pe=se.tokenList||[];let ee;if(de&&(ee=pe.find(Se=>(Se.token||Se.symbol||"").toUpperCase()===de)),ee){const Se=ee.token||ee.symbol||o||"";return{chainId:se.chainId,tokenSymbol:Se}}}}if(r){const de=B.find(ee=>ee.chainId===r)||B[0],se=de.tokenList||[],pe=Z(se);return{chainId:de.chainId,tokenSymbol:pe}}const J="USDC",oe=de=>Array.isArray(de.tokenList)&&de.tokenList.some(se=>(se.token||se.symbol||"").toUpperCase()===J),me=B.find(oe)||B[0];if(!me)return{chainId:1,tokenSymbol:""};const ge=Z(me.tokenList);return{chainId:me.chainId,tokenSymbol:ge}},[B,r,o]),[b,g]=x.useState(()=>F.chainId),[w,O]=x.useState(()=>F.tokenSymbol),[N,I]=x.useState(s),[k,y]=x.useState(""),$=x.useCallback(Z=>{g(Z),h==null||h(Z)},[h]),A=x.useCallback(Z=>{O(Z),m==null||m(Z)},[m]),P=x.useRef(!0),L=x.useRef(w),j=x.useRef(b);x.useEffect(()=>{if(P.current){P.current=!1,L.current=w,j.current=b;return}(L.current!==w||j.current!==b)&&(I(""),L.current=w,j.current=b)},[w,b]);const U=B&&B.length>0?B.find(Z=>Z.chainId===b)||B[0]:null,_=(W=U==null?void 0:U.tokenList)==null?void 0:W.find(Z=>Z.token===w),H=x.useMemo(()=>{const Z=new Ie(N||"0"),J=new Ie(u||"0"),oe=un(b);return _!=null&&_.minWithdrawSize&&Z.lt(_.minWithdrawSize)?{text:E("withdraw.minWithdrawParsed",{amount:_.minWithdrawSize,token:_.symbol||_.token}),disabled:!0}:!N||Z.isZero()||!oe&&Z.isLessThan(J)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!oe||S==="spot")&&!k.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,b,N,e,k,u,S,_]),Y=x.useMemo(()=>{const Z=(w||"").toLowerCase();if(!Z)return a||"0";const J=S==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,oe=J==null?void 0:J[Z];return typeof oe=="string"&&oe.length>0?oe:a||"0"},[l,S,w,a]),G=x.useCallback(async()=>{pi(!0);try{if(p){const J={amount:new Ie(N||"0").toString(),chainId:b,tokenAddress:(_==null?void 0:_.tokenAddress)||"",coinId:(_==null?void 0:_.coinId)||"",tokenSymbol:w,accountType:S,selectedToken:_};e==="mpc"&&(!un(b)||S==="spot")&&(J.receiverAddress=k),p(J)}}catch{pi(!1)}},[p,S,_,N,b,w,e,k]);return!B||B.length===0?D.jsx("div",{className:"text-center py-8",children:D.jsx("p",{className:"text-gray-400",children:"No chains available"})}):U?D.jsxs(D.Fragment,{children:[D.jsx(Sh,{selectedAccount:S,onAccountChange:Z=>{var Se,Cn;const J=Z||"perpetual";C(J),T==null||T(J);const oe=M(J);if(!oe||oe.length===0)return;const me=oe.find(gt=>gt.chainId===b),ge=me?me.chainId:oe[0].chainId;g(ge),h==null||h(ge);const de=oe.find(gt=>gt.chainId===ge),se=(de==null?void 0:de.tokenList)||[],ee=se.some(gt=>(gt.symbol||gt.token)===w)?w:((Se=se[0])==null?void 0:Se.symbol)||((Cn=se[0])==null?void 0:Cn.token)||"";ee&&(O(ee),m==null||m(ee))},className:"w-full"}),D.jsx(Eh,{currentActiveChain:U,chainList:B,onChainChange:$,curSelectToken:w,onTokenChange:A,walletType:"EVM",txType:"withdraw"}),D.jsx(jS,{withdrawAmount:N,curSelectToken:w,tokenInfo:_,curSelectTokenData:{balance:_==null?void 0:_.balance,allowance:_==null?void 0:_.allowance},currentActiveChain:U,currentEquity:c||0,decimals:(_==null?void 0:_.decimals)||6,platformBalance:Y,fee:u,walletType:e,accountType:S,receiverAddress:k,onWithdrawAmountChange:I,onReceiverAddressChange:y,onAmountChanged:v}),D.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${H.disabled||f?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:G,disabled:H.disabled||f,children:[f&&D.jsx(Vo,{size:"xs"}),H.text]})]}):D.jsx("div",{className:"text-center py-8",children:D.jsx("p",{className:"text-gray-400",children:"Loading..."})})},xm=({isOpen:e,isLoading:t=!1,defaultAccountType:n="perpetual",onClose:r,config:o,currentActiveAccount:s,chains:i,spotChains:c=[],defaultChainId:a,defaultSymbol:l,defaultAmount:u="",currentEquity:f=5e3,platformBalance:p="0",balances:d,fee:h,wagmiHooks:m,onWithdraw:v,onChainChange:T,onTokenChange:E,onAmountChanged:S,onAccountChange:C})=>{const{t:M}=wt(),[B,F]=x.useState(!1),b=w=>{w.target===w.currentTarget?F(!0):F(!1)},g=w=>{B&&w.target===w.currentTarget&&r(),F(!1)};return e?je.createPortal(D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:D.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[99] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:b,onMouseUp:g,"aria-hidden":"true",children:D.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:w=>{w.stopPropagation()},children:[D.jsxs("div",{className:"flex items-center justify-between mb-4",children:[D.jsx("h2",{className:"text-lg font-semibold text-white",children:M("withdraw.withdraw")}),D.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:D.jsx(u0,{className:"h-4 w-4"})})]}),D.jsx(WS,{chains:i,spotChains:c,walletType:El(s)?"mpc":"evm",defaultChainId:a,defaultSymbol:l,defaultAmount:u,defaultAccountType:n,currentEquity:f,platformBalance:p,balances:d,fee:h,isLoading:t,wagmiHooks:m,onWithdraw:v,onClose:r,onChainChange:T,onTokenChange:E,onAmountChanged:S,onAccountChange:C})]})})}),document.body):null};re.ChromeLoader=Vo,re.ComponentProvider=Ym,re.DEFAULT_LOCALE=qo,re.Deposit=mm,re.DepositManager=lm,re.LOCALE_NAMES=qm,re.LoadingSpinner=Vo,re.SUPPORTED_LOCALES=bi,re.Tooltip=Qn,re.Withdraw=xm,re.WithdrawManager=bm,re.closeDeposit=fm,re.closeWithdraw=ym,re.formatThousands=Qm,re.isDepositLoading=pm,re.isWithdrawLoading=wm,re.openDeposit=um,re.openWithdraw=gm,re.setDepositLoading=di,re.setWithdrawLoading=pi,re.updateDepositOptions=dm,re.updateWithdrawOptions=vm,re.useComponentConfig=Ll,re.useDeposit=m5,re.useDepositManager=kS,re.useTranslation=wt,re.useWithdraw=b5,re.useWithdrawManager=US,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
|
|
179
187
|
//# sourceMappingURL=index.umd.js.map
|