@edgex-web/components 0.2.0-beta.25 → 0.2.0-beta.27
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-DUDkZ8HG.mjs → ccip-BSq94rYE.mjs} +2 -2
- package/dist/{ccip-DUDkZ8HG.mjs.map → ccip-BSq94rYE.mjs.map} +1 -1
- package/dist/components/Withdraw/src/evm/WalletView.d.ts.map +1 -1
- package/dist/{index-DmDxxC0G.mjs → index-pXwuLONu.mjs} +7221 -6953
- package/dist/index-pXwuLONu.mjs.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +79 -79
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/token.d.ts +2 -0
- package/dist/types/token.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index-DmDxxC0G.mjs.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(se,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],E):(se=typeof globalThis<"u"?globalThis:se||self,E(se.EdgeXComponents={},se.React,se.ReactDOM))})(this,function(se,E,je){"use strict";var EP=Object.defineProperty;var SP=(se,E,je)=>E in se?EP(se,E,{enumerable:!0,configurable:!0,writable:!0,value:je}):se[E]=je;var ts=(se,E,je)=>SP(se,typeof E!="symbol"?E+"":E,je);function jl(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 U=jl(E),zr=jl(je);function _m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ti={exports:{}},Ur={};/**
|
|
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 _l;function zm(){if(_l)return Ur;_l=1;var e=E,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={},d=null,p=null;l!==void 0&&(d=""+l),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(p=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:d,ref:p,props:f,_owner:o.current}}return Ur.Fragment=n,Ur.jsx=i,Ur.jsxs=i,Ur}var Wr={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,109 +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 ee=!1,fe;{var pe=typeof WeakMap=="function"?WeakMap:Map;fe=new pe}function he(R,q){if(!R||ee)return"";{var K=fe.get(R);if(K!==void 0)return K}var
|
|
19
|
-
`),Re=
|
|
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
|
|
21
|
-
`+ce[Pe].replace(" at new "," at ");return R.displayName&&
|
|
17
|
+
*/var zl;function Um(){return zl||(zl=1,process.env.NODE_ENV!=="production"&&function(){var e=E,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"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,b="@@iterator";function S(R){if(R===null||typeof R!="object")return null;var q=h&&R[h]||R[b];return typeof q=="function"?q:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(R){{for(var q=arguments.length,K=new Array(q>1?q-1:0),re=1;re<q;re++)K[re-1]=arguments[re];w("error",R,K)}}function w(R,q,K){{var re=P.ReactDebugCurrentFrame,be=re.getStackAddendum();be!==""&&(q+="%s",K=K.concat([be]));var ge=K.map(function(le){return String(le)});ge.unshift("Warning: "+q),Function.prototype.apply.call(console[R],console,ge)}}var A=!1,M=!1,B=!1,F=!1,m=!1,g;g=Symbol.for("react.module.reference");function v(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||m||R===o||R===l||R===u||F||R===p||A||M||B||typeof R=="object"&&R!==null&&(R.$$typeof===d||R.$$typeof===f||R.$$typeof===i||R.$$typeof===c||R.$$typeof===a||R.$$typeof===g||R.getModuleId!==void 0))}function $(R,q,K){var re=R.displayName;if(re)return re;var be=q.displayName||q.name||"";return be!==""?K+"("+be+")":K}function N(R){return R.displayName||"Context"}function O(R){if(R==null)return null;if(typeof R.tag=="number"&&x("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 $(R,R.render,"ForwardRef");case f:var re=R.displayName||null;return re!==null?re:O(R.type)||"Memo";case d:{var be=R,ge=be._payload,le=be._init;try{return O(le(ge))}catch{return null}}}return null}var k=Object.assign,y=0,C,I,T,L,j,z,_;function H(){}H.__reactDisabledLog=!0;function Y(){{if(y===0){C=console.log,I=console.info,T=console.warn,L=console.error,j=console.group,z=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:C}),info:k({},R,{value:I}),warn:k({},R,{value:T}),error:k({},R,{value:L}),group:k({},R,{value:j}),groupCollapsed:k({},R,{value:z}),groupEnd:k({},R,{value:_})})}y<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var W=P.ReactCurrentDispatcher,Z;function J(R,q,K){{if(Z===void 0)try{throw Error()}catch(be){var re=be.stack.trim().match(/\n( *(at )?)/);Z=re&&re[1]||""}return`
|
|
18
|
+
`+Z+R}}var ee=!1,fe;{var pe=typeof WeakMap=="function"?WeakMap:Map;fe=new pe}function he(R,q){if(!R||ee)return"";{var K=fe.get(R);if(K!==void 0)return K}var re;ee=!0;var be=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ge;ge=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(Je){re=Je}Reflect.construct(R,[],le)}else{try{le.call()}catch(Je){re=Je}R.call(le.prototype)}}else{try{throw Error()}catch(Je){re=Je}R()}}catch(Je){if(Je&&re&&typeof Je.stack=="string"){for(var ce=Je.stack.split(`
|
|
19
|
+
`),Re=re.stack.split(`
|
|
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 wt=`
|
|
21
|
+
`+ce[Pe].replace(" at new "," at ");return R.displayName&&wt.includes("<anonymous>")&&(wt=wt.replace("<anonymous>",R.displayName)),typeof R=="function"&&fe.set(R,wt),wt}while(Pe>=1&&Te>=0);break}}}finally{ee=!1,W.current=ge,G(),Error.prepareStackTrace=be}var _r=R?R.displayName||R.name:"",rr=_r?J(_r):"";return typeof R=="function"&&fe.set(R,rr),rr}function ie(R,q,K){return he(R,!1)}function me(R){var q=R.prototype;return!!(q&&q.isReactComponent)}function ne(R,q,K){if(R==null)return"";if(typeof R=="function")return he(R,me(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 ie(R.render);case f:return ne(R.type,q,K);case d:{var re=R,be=re._payload,ge=re._init;try{return ne(ge(be),q,K)}catch{}}}return""}var Se=Object.prototype.hasOwnProperty,kn={},vt=P.ReactDebugCurrentFrame;function Pi(R){if(R){var q=R._owner,K=ne(R.type,R._source,q?q.type:null);vt.setExtraStackFrame(K)}else vt.setExtraStackFrame(null)}function eP(R,q,K,re,be){{var ge=Function.call.bind(Se);for(var le in R)if(ge(R,le)){var ce=void 0;try{if(typeof R[le]!="function"){var Re=Error((re||"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,re,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pe){ce=Pe}ce&&!(ce instanceof Error)&&(Pi(be),x("%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).",re||"React class",K,le,typeof ce),Pi(null)),ce instanceof Error&&!(ce.message in kn)&&(kn[ce.message]=!0,Pi(be),x("Failed %s type: %s",K,ce.message),Pi(null))}}}var tP=Array.isArray;function kl(R){return tP(R)}function nP(R){{var q=typeof Symbol=="function"&&Symbol.toStringTag,K=q&&R[Symbol.toStringTag]||R.constructor.name||"Object";return K}}function rP(R){try{return $m(R),!1}catch{return!0}}function $m(R){return""+R}function Nm(R){if(rP(R))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nP(R)),$m(R)}var Cm=P.ReactCurrentOwner,oP={key:!0,ref:!0,__self:!0,__source:!0},Om,Im;function sP(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 iP(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 aP(R,q){typeof R.ref=="string"&&Cm.current}function cP(R,q){{var K=function(){Om||(Om=!0,x("%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 lP(R,q){{var K=function(){Im||(Im=!0,x("%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 uP=function(R,q,K,re,be,ge,le){var ce={$$typeof:t,type:R,key:q,ref:K,props:le,_owner:ge};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:re}),Object.defineProperty(ce,"_source",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.freeze&&(Object.freeze(ce.props),Object.freeze(ce)),ce};function fP(R,q,K,re,be){{var ge,le={},ce=null,Re=null;K!==void 0&&(Nm(K),ce=""+K),iP(q)&&(Nm(q.key),ce=""+q.key),sP(q)&&(Re=q.ref,aP(q,be));for(ge in q)Se.call(q,ge)&&!oP.hasOwnProperty(ge)&&(le[ge]=q[ge]);if(R&&R.defaultProps){var Pe=R.defaultProps;for(ge in Pe)le[ge]===void 0&&(le[ge]=Pe[ge])}if(ce||Re){var Te=typeof R=="function"?R.displayName||R.name||"Unknown":R;ce&&cP(le,Te),Re&&lP(le,Te)}return uP(R,ce,Re,be,re,Cm.current,le)}}var Dl=P.ReactCurrentOwner,km=P.ReactDebugCurrentFrame;function jr(R){if(R){var q=R._owner,K=ne(R.type,R._source,q?q.type:null);km.setExtraStackFrame(K)}else km.setExtraStackFrame(null)}var Ml;Ml=!1;function Ll(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Dm(){{if(Dl.current){var R=O(Dl.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 dP(R){return""}var Mm={};function pP(R){{var q=Dm();if(!q){var K=typeof R=="string"?R:R.displayName||R.name;K&&(q=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+K+">.")}return q}}function
|
|
25
|
+
Check the top-level render call using <`+K+">.")}return q}}function Lm(R,q){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var K=pP(q);if(Mm[K])return;Mm[K]=!0;var re="";R&&R._owner&&R._owner!==Dl.current&&(re=" It was passed a child from "+O(R._owner.type)+"."),jr(R),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,re),jr(null)}}function Bm(R,q){{if(typeof R!="object")return;if(kl(R))for(var K=0;K<R.length;K++){var re=R[K];Ll(re)&&Lm(re,q)}else if(Ll(R))R._store&&(R._store.validated=!0);else if(R){var be=S(R);if(typeof be=="function"&&be!==R.entries)for(var ge=be.call(R),le;!(le=ge.next()).done;)Ll(le.value)&&Lm(le.value,q)}}}function hP(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 re=O(q);eP(K,R.props,"prop",re,R)}else if(q.PropTypes!==void 0&&!Ml){Ml=!0;var be=O(q);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",be||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mP(R){{for(var q=Object.keys(R.props),K=0;K<q.length;K++){var re=q[K];if(re!=="children"&&re!=="key"){jr(R),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",re),jr(null);break}}R.ref!==null&&(jr(R),x("Invalid attribute `ref` supplied to `React.Fragment`."),jr(null))}}var Fm={};function Rm(R,q,K,re,be,ge){{var le=v(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=dP();Re?ce+=Re:ce+=Dm();var Pe;R===null?Pe="null":kl(R)?Pe="array":R!==void 0&&R.$$typeof===t?(Pe="<"+(O(R.type)||"Unknown")+" />",ce=" Did you accidentally export a JSX literal instead of a component?"):Pe=typeof R,x("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=fP(R,q,K,be,ge);if(Te==null)return Te;if(le){var wt=q.children;if(wt!==void 0)if(re)if(kl(wt)){for(var _r=0;_r<wt.length;_r++)Bm(wt[_r],R);Object.freeze&&Object.freeze(wt)}else x("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 Bm(wt,R)}if(Se.call(q,"key")){var rr=O(R),Je=Object.keys(q).filter(function(xP){return xP!=="key"}),Bl=Je.length>0?"{key: someKey, "+Je.join(": ..., ")+": ...}":"{key: someKey}";if(!Fm[rr+Bl]){var wP=Je.length>0?"{"+Je.join(": ..., ")+": ...}":"{}";x(`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}
|
|
30
|
+
<%s key={someKey} {...props} />`,Bl,rr,wP,rr),Fm[rr+Bl]=!0}}return R===r?mP(Te):hP(Te),Te}}function bP(R,q,K){return Rm(R,q,K,!0)}function gP(R,q,K){return Rm(R,q,K,!1)}var yP=gP,vP=bP;Wr.Fragment=r,Wr.jsx=yP,Wr.jsxs=vP}()),Wr}process.env.NODE_ENV==="production"?Ti.exports=zm():Ti.exports=Um();var D=Ti.exports;const Wm={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
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"}},
|
|
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"}},Hm={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"}},
|
|
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"}},Vm={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
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"}},
|
|
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"}},Gm={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
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"}},
|
|
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"}},qm={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
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"}},
|
|
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"}},Zm={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}})専用です。他通貨は送金しないでください。
|
|
41
41
|
入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,maxDepositSplitTip:"1回の入金上限は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:"通常出金は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:"スポットアカウント"}},Km={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}}).
|
|
43
43
|
Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,maxDepositSplitTip:"Максимальная сумма одного пополнения — 200 000. Если вам нужно пополнить на сумму более 200 000, выполните несколько пополнений.",spotDepositNotSupportedTip:"Пополнение недоступно. Сначала контрактный счёт, затем перевод.",crossChainDepositFeeTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
44
44
|
За кроссчейн‑депозит вы оплачиваете комиссию сети Edge. Зачисленная сумма будет немного меньше суммы вашего депозита.`,addressUpdatedNotice:"Внимание: ваш адрес пополнения обновлён. Используйте новый адрес. Старый действует только в переходный период и будет отключён. Если он сохранён где‑то ещё, срочно обновите.",enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Средства поступят в течение примерно {{v}} минут (после достижения {{v1}} подтверждений блоков).",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",availableDesc:"Максимальная сумма, которую вы можете пополнить. Если доступный баланс равен 0 или отрицательный, пополнение невозможно.",noPrivateKeyWalletWarning:`Не используйте кошельки без приватных ключей для пополнения. Пополнение с такого кошелька может привести к безвозвратной потере средств.
|
|
45
45
|
|
|
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:"Спотовый счет"}},
|
|
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:"Спотовый счет"}},Ym={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
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:"现货账户"}},
|
|
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:"现货账户"}},Xm={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}}) 資產到此位址。
|
|
49
49
|
充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,maxDepositSplitTip:"單筆充值金額上限為 200,000。若需要充值金額大於 200,000,請分多筆進行操作。",spotDepositNotSupportedTip:"不支援充值,請先充入合約帳戶再劃轉。",crossChainDepositFeeTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
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,re=14,yi=9007199254740991,vi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],fn=1e7,Ce=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,$,C,O,k,y,A,I,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(O=0,k=b;k>=10;k/=10,O++);O>f?P.c=P.e=null:(P.e=O,P.c=[b]);return}I=String(b)}else{if(!Xm.test(I=String(b)))return r(P,I,y);P.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(O=I.indexOf("."))>-1&&(I=I.replace(".","")),(k=I.search(/e/i))>0?(O<0&&(O=k),O+=+I.slice(k+1),I=I.substring(0,k)):O<0&&(O=I.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(I=String(b),y=typeof b=="number"){if(b*0!=0)return r(P,I,y,g);if(P.s=1/b<0?(I=I.slice(1),-1):1,E.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(Bl+b)}else P.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(w=v.slice(0,g),O=k=0,A=I.length;k<A;k++)if(w.indexOf($=I.charAt(k))<0){if($=="."){if(k>O){O=A;continue}}else if(!C&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){C=!0,k=-1,O=0;continue}return r(P,String(b),y,g)}y=!1,I=n(I,g,10,P.s),(O=I.indexOf("."))>-1?I=I.replace(".",""):O=I.length}for(k=0;I.charCodeAt(k)===48;k++);for(A=I.length;I.charCodeAt(--A)===48;);if(I=I.slice(k,++A)){if(A-=k,y&&E.DEBUG&&A>15&&(b>yi||b!==ot(b)))throw Error(Bl+P.s*b);if((O=O-k-1)>f)P.c=P.e=null;else if(O<u)P.c=[P.e=0];else{if(P.e=O,P.c=[],k=(O+1)%re,O<0&&(k+=re),k<A){for(k&&P.c.push(+I.slice(0,k)),A-=re;k<A;)P.c.push(+I.slice(k,k+=re));k=re-(I=I.slice(k)).length}else k-=A;for(;k--;I+="0");P.c.push(+I)}}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,Ce,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],-Ce,0,g),ye(w[1],0,Ce,g),a=w[0],l=w[1]):(ye(w,-Ce,Ce,g),a=-(l=w<0?-w:w))),b.hasOwnProperty(g="RANGE"))if(w=b[g],w&&w.pop)ye(w[0],-Ce,-1,g),ye(w[1],1,Ce,g),u=w[0],f=w[1];else if(ye(w,-Ce,Ce,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,Ce,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,$=b.c,C=b.e,O=b.s;e:if({}.toString.call($)=="[object Array]"){if((O===1||O===-1)&&C>=-Ce&&C<=Ce&&C===ot(C)){if($[0]===0){if(C===0&&$.length===1)return!0;break e}if(g=(C+1)%re,g<1&&(g+=re),String($[0]).length==g){for(g=0;g<$.length;g++)if(w=$[g],w<0||w>=vt||w!==ot(w))break e;if(w!==0)return!0}}}else if($===null&&C===null&&(O===null||O===1||O===-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(w){var $,C,O,k,y,A=0,I=[],P=new E(s);if(w==null?w=i:ye(w,0,Ce),k=gi(w/re),p)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(k*=2));A<k;)y=$[A]*131072+($[A+1]>>>11),y>=9e15?(C=crypto.getRandomValues(new Uint32Array(2)),$[A]=C[0],$[A+1]=C[1]):(I.push(y%1e14),A+=2);A=k/2}else if(crypto.randomBytes){for($=crypto.randomBytes(k*=7);A<k;)y=($[A]&31)*281474976710656+$[A+1]*1099511627776+$[A+2]*4294967296+$[A+3]*16777216+($[A+4]<<16)+($[A+5]<<8)+$[A+6],y>=9e15?crypto.randomBytes(7).copy($,A):(I.push(y%1e14),A+=7);A=k/7}else throw p=!1,Error(_e+"crypto unavailable");if(!p)for(;A<k;)y=g(),y<9e15&&(I[A++]=y%1e14);for(k=I[--A],w%=re,k&&w&&(y=vi[re-w],I[A]=ot(k/y)*y);I[A]===0;I.pop(),A--);if(A<0)I=[O=0];else{for(O=-1;I[0]===0;I.splice(0,1),O-=re);for(A=1,y=I[0];y>=10;y/=10,A++);A<re&&(O-=re-A)}return P.e=O,P.c=I,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,$,C,O){for(var k,y=[0],A,I=0,P=w.length;I<P;){for(A=y.length;A--;y[A]*=$);for(y[0]+=O.indexOf(w.charAt(I++)),k=0;k<y.length;k++)y[k]>C-1&&(y[k+1]==null&&(y[k+1]=0),y[k+1]+=y[k]/C|0,y[k]%=C)}return y.reverse()}return function(w,$,C,O,k){var y,A,I,P,L,j,z,_,H=w.indexOf("."),Y=i,G=c;for(H>=0&&(P=h,h=0,w=w.replace(".",""),_=new E($),j=_.pow(w.length-H),h=P,_.c=g(Vt(it(j.c),j.e,"0"),10,C,b),_.e=_.c.length),z=g(w,$,C,k?(y=v,b):(y=b,v)),I=P=z.length;z[--P]==0;z.pop());if(!z[0])return y.charAt(0);if(H<0?--I:(j.c=z,j.e=I,j.s=O,j=t(j,_,Y,G,C),z=j.c,L=j.r,I=j.e),A=I+Y+1,H=z[A],P=C/2,L=L||A<0||z[A+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&&z[A-1]&1||G==(j.s<0?8:7)),A<1||!z[0])w=L?Vt(y.charAt(1),-Y,y.charAt(0)):y.charAt(0);else{if(z.length=A,L)for(--C;++z[--A]>C;)z[A]=0,A||(++I,z=[1].concat(z));for(P=z.length;!z[--P];);for(H=0,w="";H<=P;w+=y.charAt(z[H++]));w=Vt(w,I,y.charAt(0))}return w}}(),t=function(){function b($,C,O){var k,y,A,I,P=0,L=$.length,j=C%fn,z=C/fn|0;for($=$.slice();L--;)A=$[L]%fn,I=$[L]/fn|0,k=z*A+I*j,y=j*A+k%fn*fn+P,P=(y/O|0)+(k/fn|0)+z*I,$[L]=y%O;return P&&($=[P].concat($)),$}function g($,C,O,k){var y,A;if(O!=k)A=O>k?1:-1;else for(y=A=0;y<O;y++)if($[y]!=C[y]){A=$[y]>C[y]?1:-1;break}return A}function w($,C,O,k){for(var y=0;O--;)$[O]-=y,y=$[O]<C[O]?1:0,$[O]=y*k+$[O]-C[O];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,C,O,k,y){var A,I,P,L,j,z,_,H,Y,G,W,Z,J,ee,fe,pe,he,se=$.s==C.s?1:-1,me=$.c,te=C.c;if(!me||!me[0]||!te||!te[0])return new E(!$.s||!C.s||(me?te&&me[0]==te[0]:!te)?NaN:me&&me[0]==0||!te?se*0:se/0);for(H=new E(se),Y=H.c=[],I=$.e-C.e,se=O+I+1,y||(y=vt,I=st($.e/re)-st(C.e/re),se=se/re|0),P=0;te[P]==(me[P]||0);P++);if(te[P]>(me[P]||0)&&I--,se<0)Y.push(1),L=!0;else{for(ee=me.length,pe=te.length,P=0,se+=2,j=ot(y/(te[0]+1)),j>1&&(te=b(te,j,y),me=b(me,j,y),pe=te.length,ee=me.length),J=pe,G=me.slice(0,pe),W=G.length;W<pe;G[W++]=0);he=te.slice(),he=[0].concat(he),fe=te[0],te[1]>=y/2&&fe++;do{if(j=0,A=g(te,G,pe,W),A<0){if(Z=G[0],pe!=W&&(Z=Z*y+(G[1]||0)),j=ot(Z/fe),j>1)for(j>=y&&(j=y-1),z=b(te,j,y),_=z.length,W=G.length;g(z,G,_,W)==1;)j--,w(z,pe<_?he:te,_,y),_=z.length,A=1;else j==0&&(A=j=1),z=te.slice(),_=z.length;if(_<W&&(z=[0].concat(z)),w(G,z,W,y),W=G.length,A==-1)for(;g(te,G,pe,W)<1;)j++,w(G,pe<W?he:te,W,y),W=G.length}else A===0&&(j++,G=[0]);Y[P++]=j,G[0]?G[W++]=me[J]||0:(G=[me[J]],W=1)}while((J++<ee||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,O+(H.e=P+I*re-1)+1,k,L)}else H.e=I,H.r=+L;return H}}();function S(b,g,w,$){var C,O,k,y,A;if(w==null?w=c:ye(w,0,8),!b.c)return b.toString();if(C=b.c[0],k=b.e,g==null)A=it(b.c),A=$==1||$==2&&(k<=a||k>=l)?Ko(A,k):Vt(A,k,"0");else if(b=B(new E(b),g,w),O=b.e,A=it(b.c),y=A.length,$==1||$==2&&(g<=O||O<=a)){for(;y<g;A+="0",y++);A=Ko(A,O)}else if(g-=k+($===2&&O>k),A=Vt(A,O,"0"),O+1>y){if(--g>0)for(A+=".";g--;A+="0");}else if(g+=O-y,g>0)for(O+1==y&&(A+=".");g--;A+="0");return b.s<0&&C?"-"+A:A}function N(b,g){for(var w,$,C=1,O=new E(b[0]);C<b.length;C++)$=new E(b[C]),(!$.s||(w=On(O,$))===g||w===0&&O.s===g)&&(O=$);return O}function M(b,g,w){for(var $=1,C=g.length;!g[--C];g.pop());for(C=g[0];C>=10;C/=10,$++);return(w=$+w*re-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=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(O,k,y,A){var I,P=y?k:k.replace(C,"");if($.test(P))O.s=isNaN(P)?null:P<0?-1:1;else{if(!y&&(P=P.replace(b,function(L,j,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!A||A==I?j:L}),A&&(I=A,P=P.replace(g,"$1").replace(w,"0.$1")),k!=P))return new E(P,I);if(E.DEBUG)throw Error(_e+"Not a"+(A?" base "+A:"")+" number: "+k);O.s=null}O.c=O.e=null}}();function B(b,g,w,$){var C,O,k,y,A,I,P,L=b.c,j=vi;if(L){e:{for(C=1,y=L[0];y>=10;y/=10,C++);if(O=g-C,O<0)O+=re,k=g,A=L[I=0],P=ot(A/j[C-k-1]%10);else if(I=gi((O+1)/re),I>=L.length)if($){for(;L.length<=I;L.push(0));A=P=0,C=1,O%=re,k=O-re+1}else break e;else{for(A=y=L[I],C=1;y>=10;y/=10,C++);O%=re,k=O-re+C,P=k<0?0:ot(A/j[C-k-1]%10)}if($=$||g<0||L[I+1]!=null||(k<0?A:A%j[C-k-1]),$=w<4?(P||$)&&(w==0||w==(b.s<0?3:2)):P>5||P==5&&(w==4||$||w==6&&(O>0?k>0?A/j[C-k]:0:L[I-1])%10&1||w==(b.s<0?8:7)),g<1||!L[0])return L.length=0,$?(g-=b.e+1,L[0]=j[(re-g%re)%re],b.e=-g||0):L[0]=b.e=0,b;if(O==0?(L.length=I,y=1,I--):(L.length=I+1,y=j[re-O],L[I]=k>0?ot(A/j[C-k]%j[k])*y:0),$)for(;;)if(I==0){for(O=1,k=L[0];k>=10;k/=10,O++);for(k=L[0]+=y,y=1;k>=10;k/=10,y++);O!=y&&(b.e++,L[0]==vt&&(L[0]=1));break}else{if(L[I]+=y,L[I]!=vt)break;L[I--]=0,y=1}for(O=L.length;L[--O]===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,$,C,O=this;if(b!=null)return ye(b,0,Ce),g==null?g=c:ye(g,0,8),B(new E(O),b+O.e+1,g);if(!(w=O.c))return null;if($=((C=w.length-1)-st(this.e/re))*re,C=w[C])for(;C%10==0;C/=10,$--);return $<0&&($=0),$},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,$,C,O,k,y,A,I,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(A=b.s<0,g){if(g.c?!g.c[0]:!g.s)return new E(NaN);$=!A&&L.isInteger()&&g.isInteger(),$&&(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 O=L.s<0&&Zo(b)?-0:0,L.e>-1&&(O=1/O),new E(A?1/O:O);h&&(O=gi(h/re+2))}for(y?(w=new E(.5),A&&(b.s=1),I=Zo(b)):(C=Math.abs(+F(b)),I=C%2),P=new E(s);;){if(I){if(P=P.times(L),!P.c)break;O?P.c.length>O&&(P.c.length=O):$&&(P=P.mod(g))}if(C){if(C=ot(C/2),C===0)break;I=C%2}else if(b=b.times(w),B(b,b.e+1,1),b.e>14)I=Zo(b);else{if(C=+F(b),C===0)break;I=C%2}L=L.times(L),O?L.c&&L.c.length>O&&(L.c.length=O):$&&(L=L.mod(g))}return $?P:(A&&(P=s.div(P)),g?P.mod(g):O?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/re)>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,$,C,O,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 A=k.e/re,I=b.e/re,P=k.c,L=b.c;if(!A||!I){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(A=st(A),I=st(I),P=P.slice(),y=A-I){for((O=y<0)?(y=-y,C=P):(I=A,C=L),C.reverse(),g=y;g--;C.push(0));C.reverse()}else for($=(O=(y=P.length)<(g=L.length))?y:g,y=g=0;g<$;g++)if(P[g]!=L[g]){O=P[g]<L[g];break}if(O&&(C=P,P=L,L=C,b.s=-b.s),g=($=L.length)-(w=P.length),g>0)for(;g--;P[w++]=0);for(g=vt-1;$>y;){if(P[--$]<L[$]){for(w=$;w&&!P[--w];P[w]=g);--P[w],P[$]+=vt}P[$]-=L[$]}for(;P[0]==0;P.splice(0,1),--I);return P[0]?M(b,P,I):(b.s=c==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,g){var w,$,C=this;return b=new E(b,g),!C.c||!b.s||b.c&&!b.c[0]?new E(NaN):!b.c||C.c&&!C.c[0]?new E(C):(d==9?($=b.s,b.s=1,w=t(C,b,0,3),b.s=$,w.s*=$):w=t(C,b,0,d),b=C.minus(w.times(b)),!b.c[0]&&d==1&&(b.s=C.s),b)},o.multipliedBy=o.times=function(b,g){var w,$,C,O,k,y,A,I,P,L,j,z,_,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($=st(G.e/re)+st(b.e/re),b.s*=G.s,A=W.length,L=Z.length,A<L&&(_=W,W=Z,Z=_,C=A,A=L,L=C),C=A+L,_=[];C--;_.push(0));for(H=vt,Y=fn,C=L;--C>=0;){for(w=0,j=Z[C]%Y,z=Z[C]/Y|0,k=A,O=C+k;O>C;)I=W[--k]%Y,P=W[k]/Y|0,y=z*I+P*j,I=j*I+y%Y*Y+_[O]+w,w=(I/H|0)+(y/Y|0)+z*P,_[O--]=I%H;_[O]=w}return w?++$:_.splice(0,1),M(b,_,$)},o.negated=function(){var b=new E(this);return b.s=-b.s||null,b},o.plus=function(b,g){var w,$=this,C=$.s;if(b=new E(b,g),g=b.s,!C||!g)return new E(NaN);if(C!=g)return b.s=-g,$.minus(b);var O=$.e/re,k=b.e/re,y=$.c,A=b.c;if(!O||!k){if(!y||!A)return new E(C/0);if(!y[0]||!A[0])return A[0]?b:new E(y[0]?$:C*0)}if(O=st(O),k=st(k),y=y.slice(),C=O-k){for(C>0?(k=O,w=A):(C=-C,w=y),w.reverse();C--;w.push(0));w.reverse()}for(C=y.length,g=A.length,C-g<0&&(w=A,A=y,y=w,g=C),C=0;g;)C=(y[--g]=y[g]+A[g]+C)/vt|0,y[g]=vt===y[g]?0:y[g]%vt;return C&&(y=[C].concat(y),++k),M(b,y,k)},o.precision=o.sd=function(b,g){var w,$,C,O=this;if(b!=null&&b!==!!b)return ye(b,1,Ce),g==null?g=c:ye(g,0,8),B(new E(O),b,g);if(!(w=O.c))return null;if(C=w.length-1,$=C*re+1,C=w[C]){for(;C%10==0;C/=10,$--);for(C=w[0];C>=10;C/=10,$++);}return b&&O.e+1>$&&($=O.e+1),$},o.shiftedBy=function(b){return ye(b,-yi,yi),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,g,w,$,C,O=this,k=O.c,y=O.s,A=O.e,I=i+4,P=new E("0.5");if(y!==1||!k||!k[0])return new E(!y||y<0&&(!k||k[0])?NaN:k?O:1/0);if(y=Math.sqrt(+F(O)),y==0||y==1/0?(g=it(k),(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),w=new E(g)):w=new E(y+""),w.c[0]){for(A=w.e,y=A+I,y<3&&(y=0);;)if(C=w,w=P.times(C.plus(t(O,C,I,1))),it(C.c).slice(0,y)===(g=it(w.c)).slice(0,y))if(w.e<A&&--y,g=g.slice(y-3,y+1),g=="9999"||!$&&g=="4999"){if(!$&&(B(C,C.e+i+2,0),C.times(C).eq(O))){w=C;break}I+=4,y+=4,$=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(B(w,w.e+i+2,1),b=!w.times(w).eq(O));break}}return B(w,w.e+i+1,c,b)},o.toExponential=function(b,g){return b!=null&&(ye(b,0,Ce),b++),S(this,b,g,1)},o.toFixed=function(b,g){return b!=null&&(ye(b,0,Ce),b=b+this.e+1),S(this,b,g)},o.toFormat=function(b,g,w){var $,C=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($=C.toFixed(b,g),C.c){var O,k=$.split("."),y=+w.groupSize,A=+w.secondaryGroupSize,I=w.groupSeparator||"",P=k[0],L=k[1],j=C.s<0,z=j?P.slice(1):P,_=z.length;if(A&&(O=y,y=A,A=O,_-=O),y>0&&_>0){for(O=_%y||y,P=z.substr(0,O);O<_;O+=y)P+=I+z.substr(O,y);A>0&&(P+=I+z.slice(O)),j&&(P="-"+P)}$=L?P+(w.decimalSeparator||"")+((A=+w.fractionGroupSize)?L.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):L):P}return(w.prefix||"")+$+(w.suffix||"")},o.toFraction=function(b){var g,w,$,C,O,k,y,A,I,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: ")+F(y));if(!_)return new E(z);for(g=new E(s),I=w=new E(s),$=A=new E(s),j=it(_),O=g.e=j.length-z.e-1,g.c[0]=vi[(k=O%re)<0?re+k:k],b=!b||y.comparedTo(g)>0?O>0?g:I:y,k=f,f=1/0,y=new E(j),A.c[0]=0;P=t(y,g,0,1),C=w.plus(P.times($)),C.comparedTo(b)!=1;)w=$,$=C,I=A.plus(P.times(C=I)),A=C,g=y.minus(P.times(C=g)),y=C;return C=t(b.minus(w),$,0,1),A=A.plus(C.times(I)),w=w.plus(C.times($)),A.s=I.s=z.s,O=O*2,L=t(I,$,O,c).minus(z).abs().comparedTo(t(A,w,O,c).minus(z).abs())<1?[I,$]:[A,w],f=k,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(b,g){return b!=null&&ye(b,1,Ce),S(this,b,g,2)},o.toString=function(b){var g,w=this,$=w.s,C=w.e;return C===null?$?(g="Infinity",$<0&&(g="-"+g)):g="NaN":(b==null?g=C<=a||C>=l?Ko(it(w.c),C):Vt(it(w.c),C,"0"):b===10&&T?(w=B(new E(w),i+C+1,c),g=Vt(it(w.c),w.e,"0")):(ye(b,2,v.length,"Base"),g=n(Vt(it(w.c),C,"0"),10,b,$,!0)),$<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=re-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/re)==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 Cl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Cl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Cl&&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 Cb(e,t);if(nb(e))return Nb(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 Cb(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 Nb(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 Nl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof Nl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Nl&&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=
|
|
53
|
-
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class
|
|
54
|
-
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class
|
|
55
|
-
`),{metaMessages:[`Params: (${
|
|
56
|
-
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class
|
|
57
|
-
`),{name:"AbiEncodingLengthMismatchError"})}}class
|
|
58
|
-
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class
|
|
59
|
-
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class
|
|
60
|
-
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class
|
|
61
|
-
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class
|
|
62
|
-
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class
|
|
63
|
-
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class
|
|
64
|
-
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class
|
|
65
|
-
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class
|
|
66
|
-
`),{metaMessages:[`Params: (${
|
|
67
|
-
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class
|
|
68
|
-
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class
|
|
69
|
-
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let
|
|
70
|
-
`),{name:"InvalidArrayError"})}};class
|
|
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),C1=BigInt(7),N1=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>>C1)*O1)%N1,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 Ci 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 Ci(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 Ci(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 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=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 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 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}):Nu(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 Cu(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 Nu(e,t,n,{strict:r}={}){$u(e,t);const o=e.slice(t,n);return r&&Cu(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&&Cu(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(Nu(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
|
|
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:"現貨帳戶"}},Ai=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],Ul={"en-US":Hm,"ja-JP":Zm,"ru-RU":Km,"zh-CN":Ym,"zh-TW":Xm,"de-DE":Wm,"es-LA":Vm,"fr-FR":Gm,"it-IT":qm},ns="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"},Jm=e=>Ai.includes(e)?Ul[e]:Ul[ns],eb=e=>Ai.includes(e),Wl=E.createContext(null),tb=({config:e,children:t})=>{const n=E.useMemo(()=>{const r=e.locale||ns,o=eb(r)?r:ns,s=Jm(o);return{...e,currentLocale:o,translations:s}},[e]);return D.jsx(Wl.Provider,{value:n,children:t})},Hl=()=>{const e=E.useContext(Wl);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var nb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,$i=Math.ceil,st=Math.floor,_e="[BigNumber Error] ",Vl=_e+"Number primitive has more than 15 significant digits: ",xt=1e14,oe=14,Ni=9007199254740991,Ci=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],pn=1e7,Ne=1e9;function Gl(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,c=4,a=-7,l=21,u=-1e7,f=1e7,d=!1,p=1,h=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",P=!0;function x(m,g){var v,$,N,O,k,y,C,I,T=this;if(!(T instanceof x))return new x(m,g);if(g==null){if(m&&m._isBigNumber===!0){T.s=m.s,!m.c||m.e>f?T.c=T.e=null:m.e<u?T.c=[T.e=0]:(T.e=m.e,T.c=m.c.slice());return}if((y=typeof m=="number")&&m*0==0){if(T.s=1/m<0?(m=-m,-1):1,m===~~m){for(O=0,k=m;k>=10;k/=10,O++);O>f?T.c=T.e=null:(T.e=O,T.c=[m]);return}I=String(m)}else{if(!nb.test(I=String(m)))return r(T,I,y);T.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(O=I.indexOf("."))>-1&&(I=I.replace(".","")),(k=I.search(/e/i))>0?(O<0&&(O=k),O+=+I.slice(k+1),I=I.substring(0,k)):O<0&&(O=I.length)}else{if(ye(g,2,S.length,"Base"),g==10&&P)return T=new x(m),B(T,i+T.e+1,c);if(I=String(m),y=typeof m=="number"){if(m*0!=0)return r(T,I,y,g);if(T.s=1/m<0?(I=I.slice(1),-1):1,x.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(Vl+m)}else T.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(v=S.slice(0,g),O=k=0,C=I.length;k<C;k++)if(v.indexOf($=I.charAt(k))<0){if($=="."){if(k>O){O=C;continue}}else if(!N&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){N=!0,k=-1,O=0;continue}return r(T,String(m),y,g)}y=!1,I=n(I,g,10,T.s),(O=I.indexOf("."))>-1?I=I.replace(".",""):O=I.length}for(k=0;I.charCodeAt(k)===48;k++);for(C=I.length;I.charCodeAt(--C)===48;);if(I=I.slice(k,++C)){if(C-=k,y&&x.DEBUG&&C>15&&(m>Ni||m!==st(m)))throw Error(Vl+T.s*m);if((O=O-k-1)>f)T.c=T.e=null;else if(O<u)T.c=[T.e=0];else{if(T.e=O,T.c=[],k=(O+1)%oe,O<0&&(k+=oe),k<C){for(k&&T.c.push(+I.slice(0,k)),C-=oe;k<C;)T.c.push(+I.slice(k,k+=oe));k=oe-(I=I.slice(k)).length}else k-=C;for(;k--;I+="0");T.c.push(+I)}}else T.c=[T.e=0]}x.clone=Gl,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(m){var g,v;if(m!=null)if(typeof m=="object"){if(m.hasOwnProperty(g="DECIMAL_PLACES")&&(v=m[g],ye(v,0,Ne,g),i=v),m.hasOwnProperty(g="ROUNDING_MODE")&&(v=m[g],ye(v,0,8,g),c=v),m.hasOwnProperty(g="EXPONENTIAL_AT")&&(v=m[g],v&&v.pop?(ye(v[0],-Ne,0,g),ye(v[1],0,Ne,g),a=v[0],l=v[1]):(ye(v,-Ne,Ne,g),a=-(l=v<0?-v:v))),m.hasOwnProperty(g="RANGE"))if(v=m[g],v&&v.pop)ye(v[0],-Ne,-1,g),ye(v[1],1,Ne,g),u=v[0],f=v[1];else if(ye(v,-Ne,Ne,g),v)u=-(f=v<0?-v:v);else throw Error(_e+g+" cannot be zero: "+v);if(m.hasOwnProperty(g="CRYPTO"))if(v=m[g],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))d=v;else throw d=!v,Error(_e+"crypto unavailable");else d=v;else throw Error(_e+g+" not true or false: "+v);if(m.hasOwnProperty(g="MODULO_MODE")&&(v=m[g],ye(v,0,9,g),p=v),m.hasOwnProperty(g="POW_PRECISION")&&(v=m[g],ye(v,0,Ne,g),h=v),m.hasOwnProperty(g="FORMAT"))if(v=m[g],typeof v=="object")b=v;else throw Error(_e+g+" not an object: "+v);if(m.hasOwnProperty(g="ALPHABET"))if(v=m[g],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))P=v.slice(0,10)=="0123456789",S=v;else throw Error(_e+g+" invalid: "+v)}else throw Error(_e+"Object expected: "+m);return{DECIMAL_PLACES:i,ROUNDING_MODE:c,EXPONENTIAL_AT:[a,l],RANGE:[u,f],CRYPTO:d,MODULO_MODE:p,POW_PRECISION:h,FORMAT:b,ALPHABET:S}},x.isBigNumber=function(m){if(!m||m._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var g,v,$=m.c,N=m.e,O=m.s;e:if({}.toString.call($)=="[object Array]"){if((O===1||O===-1)&&N>=-Ne&&N<=Ne&&N===st(N)){if($[0]===0){if(N===0&&$.length===1)return!0;break e}if(g=(N+1)%oe,g<1&&(g+=oe),String($[0]).length==g){for(g=0;g<$.length;g++)if(v=$[g],v<0||v>=xt||v!==st(v))break e;if(v!==0)return!0}}}else if($===null&&N===null&&(O===null||O===1||O===-1))return!0;throw Error(_e+"Invalid BigNumber: "+m)},x.maximum=x.max=function(){return A(arguments,-1)},x.minimum=x.min=function(){return A(arguments,1)},x.random=function(){var m=9007199254740992,g=Math.random()*m&2097151?function(){return st(Math.random()*m)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(v){var $,N,O,k,y,C=0,I=[],T=new x(s);if(v==null?v=i:ye(v,0,Ne),k=$i(v/oe),d)if(crypto.getRandomValues){for($=crypto.getRandomValues(new Uint32Array(k*=2));C<k;)y=$[C]*131072+($[C+1]>>>11),y>=9e15?(N=crypto.getRandomValues(new Uint32Array(2)),$[C]=N[0],$[C+1]=N[1]):(I.push(y%1e14),C+=2);C=k/2}else if(crypto.randomBytes){for($=crypto.randomBytes(k*=7);C<k;)y=($[C]&31)*281474976710656+$[C+1]*1099511627776+$[C+2]*4294967296+$[C+3]*16777216+($[C+4]<<16)+($[C+5]<<8)+$[C+6],y>=9e15?crypto.randomBytes(7).copy($,C):(I.push(y%1e14),C+=7);C=k/7}else throw d=!1,Error(_e+"crypto unavailable");if(!d)for(;C<k;)y=g(),y<9e15&&(I[C++]=y%1e14);for(k=I[--C],v%=oe,k&&v&&(y=Ci[oe-v],I[C]=st(k/y)*y);I[C]===0;I.pop(),C--);if(C<0)I=[O=0];else{for(O=-1;I[0]===0;I.splice(0,1),O-=oe);for(C=1,y=I[0];y>=10;y/=10,C++);C<oe&&(O-=oe-C)}return T.e=O,T.c=I,T}}(),x.sum=function(){for(var m=1,g=arguments,v=new x(g[0]);m<g.length;)v=v.plus(g[m++]);return v},n=function(){var m="0123456789";function g(v,$,N,O){for(var k,y=[0],C,I=0,T=v.length;I<T;){for(C=y.length;C--;y[C]*=$);for(y[0]+=O.indexOf(v.charAt(I++)),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(v,$,N,O,k){var y,C,I,T,L,j,z,_,H=v.indexOf("."),Y=i,G=c;for(H>=0&&(T=h,h=0,v=v.replace(".",""),_=new x($),j=_.pow(v.length-H),h=T,_.c=g(qt(at(j.c),j.e,"0"),10,N,m),_.e=_.c.length),z=g(v,$,N,k?(y=S,m):(y=m,S)),I=T=z.length;z[--T]==0;z.pop());if(!z[0])return y.charAt(0);if(H<0?--I:(j.c=z,j.e=I,j.s=O,j=t(j,_,Y,G,N),z=j.c,L=j.r,I=j.e),C=I+Y+1,H=z[C],T=N/2,L=L||C<0||z[C+1]!=null,L=G<4?(H!=null||L)&&(G==0||G==(j.s<0?3:2)):H>T||H==T&&(G==4||L||G==6&&z[C-1]&1||G==(j.s<0?8:7)),C<1||!z[0])v=L?qt(y.charAt(1),-Y,y.charAt(0)):y.charAt(0);else{if(z.length=C,L)for(--N;++z[--C]>N;)z[C]=0,C||(++I,z=[1].concat(z));for(T=z.length;!z[--T];);for(H=0,v="";H<=T;v+=y.charAt(z[H++]));v=qt(v,I,y.charAt(0))}return v}}(),t=function(){function m($,N,O){var k,y,C,I,T=0,L=$.length,j=N%pn,z=N/pn|0;for($=$.slice();L--;)C=$[L]%pn,I=$[L]/pn|0,k=z*C+I*j,y=j*C+k%pn*pn+T,T=(y/O|0)+(k/pn|0)+z*I,$[L]=y%O;return T&&($=[T].concat($)),$}function g($,N,O,k){var y,C;if(O!=k)C=O>k?1:-1;else for(y=C=0;y<O;y++)if($[y]!=N[y]){C=$[y]>N[y]?1:-1;break}return C}function v($,N,O,k){for(var y=0;O--;)$[O]-=y,y=$[O]<N[O]?1:0,$[O]=y*k+$[O]-N[O];for(;!$[0]&&$.length>1;$.splice(0,1));}return function($,N,O,k,y){var C,I,T,L,j,z,_,H,Y,G,W,Z,J,ee,fe,pe,he,ie=$.s==N.s?1:-1,me=$.c,ne=N.c;if(!me||!me[0]||!ne||!ne[0])return new x(!$.s||!N.s||(me?ne&&me[0]==ne[0]:!ne)?NaN:me&&me[0]==0||!ne?ie*0:ie/0);for(H=new x(ie),Y=H.c=[],I=$.e-N.e,ie=O+I+1,y||(y=xt,I=it($.e/oe)-it(N.e/oe),ie=ie/oe|0),T=0;ne[T]==(me[T]||0);T++);if(ne[T]>(me[T]||0)&&I--,ie<0)Y.push(1),L=!0;else{for(ee=me.length,pe=ne.length,T=0,ie+=2,j=st(y/(ne[0]+1)),j>1&&(ne=m(ne,j,y),me=m(me,j,y),pe=ne.length,ee=me.length),J=pe,G=me.slice(0,pe),W=G.length;W<pe;G[W++]=0);he=ne.slice(),he=[0].concat(he),fe=ne[0],ne[1]>=y/2&&fe++;do{if(j=0,C=g(ne,G,pe,W),C<0){if(Z=G[0],pe!=W&&(Z=Z*y+(G[1]||0)),j=st(Z/fe),j>1)for(j>=y&&(j=y-1),z=m(ne,j,y),_=z.length,W=G.length;g(z,G,_,W)==1;)j--,v(z,pe<_?he:ne,_,y),_=z.length,C=1;else j==0&&(C=j=1),z=ne.slice(),_=z.length;if(_<W&&(z=[0].concat(z)),v(G,z,W,y),W=G.length,C==-1)for(;g(ne,G,pe,W)<1;)j++,v(G,pe<W?he:ne,W,y),W=G.length}else C===0&&(j++,G=[0]);Y[T++]=j,G[0]?G[W++]=me[J]||0:(G=[me[J]],W=1)}while((J++<ee||G[0]!=null)&&ie--);L=G[0]!=null,Y[0]||Y.splice(0,1)}if(y==xt){for(T=1,ie=Y[0];ie>=10;ie/=10,T++);B(H,O+(H.e=T+I*oe-1)+1,k,L)}else H.e=I,H.r=+L;return H}}();function w(m,g,v,$){var N,O,k,y,C;if(v==null?v=c:ye(v,0,8),!m.c)return m.toString();if(N=m.c[0],k=m.e,g==null)C=at(m.c),C=$==1||$==2&&(k<=a||k>=l)?os(C,k):qt(C,k,"0");else if(m=B(new x(m),g,v),O=m.e,C=at(m.c),y=C.length,$==1||$==2&&(g<=O||O<=a)){for(;y<g;C+="0",y++);C=os(C,O)}else if(g-=k+($===2&&O>k),C=qt(C,O,"0"),O+1>y){if(--g>0)for(C+=".";g--;C+="0");}else if(g+=O-y,g>0)for(O+1==y&&(C+=".");g--;C+="0");return m.s<0&&N?"-"+C:C}function A(m,g){for(var v,$,N=1,O=new x(m[0]);N<m.length;N++)$=new x(m[N]),(!$.s||(v=Dn(O,$))===g||v===0&&O.s===g)&&(O=$);return O}function M(m,g,v){for(var $=1,N=g.length;!g[--N];g.pop());for(N=g[0];N>=10;N/=10,$++);return(v=$+v*oe-1)>f?m.c=m.e=null:v<u?m.c=[m.e=0]:(m.e=v,m.c=g),m}r=function(){var m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,v=/^\.([^.]+)$/,$=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(O,k,y,C){var I,T=y?k:k.replace(N,"");if($.test(T))O.s=isNaN(T)?null:T<0?-1:1;else{if(!y&&(T=T.replace(m,function(L,j,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!C||C==I?j:L}),C&&(I=C,T=T.replace(g,"$1").replace(v,"0.$1")),k!=T))return new x(T,I);if(x.DEBUG)throw Error(_e+"Not a"+(C?" base "+C:"")+" number: "+k);O.s=null}O.c=O.e=null}}();function B(m,g,v,$){var N,O,k,y,C,I,T,L=m.c,j=Ci;if(L){e:{for(N=1,y=L[0];y>=10;y/=10,N++);if(O=g-N,O<0)O+=oe,k=g,C=L[I=0],T=st(C/j[N-k-1]%10);else if(I=$i((O+1)/oe),I>=L.length)if($){for(;L.length<=I;L.push(0));C=T=0,N=1,O%=oe,k=O-oe+1}else break e;else{for(C=y=L[I],N=1;y>=10;y/=10,N++);O%=oe,k=O-oe+N,T=k<0?0:st(C/j[N-k-1]%10)}if($=$||g<0||L[I+1]!=null||(k<0?C:C%j[N-k-1]),$=v<4?(T||$)&&(v==0||v==(m.s<0?3:2)):T>5||T==5&&(v==4||$||v==6&&(O>0?k>0?C/j[N-k]:0:L[I-1])%10&1||v==(m.s<0?8:7)),g<1||!L[0])return L.length=0,$?(g-=m.e+1,L[0]=j[(oe-g%oe)%oe],m.e=-g||0):L[0]=m.e=0,m;if(O==0?(L.length=I,y=1,I--):(L.length=I+1,y=j[oe-O],L[I]=k>0?st(C/j[N-k]%j[k])*y:0),$)for(;;)if(I==0){for(O=1,k=L[0];k>=10;k/=10,O++);for(k=L[0]+=y,y=1;k>=10;k/=10,y++);O!=y&&(m.e++,L[0]==xt&&(L[0]=1));break}else{if(L[I]+=y,L[I]!=xt)break;L[I--]=0,y=1}for(O=L.length;L[--O]===0;L.pop());}m.e>f?m.c=m.e=null:m.e<u&&(m.c=[m.e=0])}return m}function F(m){var g,v=m.e;return v===null?m.toString():(g=at(m.c),g=v<=a||v>=l?os(g,v):qt(g,v,"0"),m.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var m=new x(this);return m.s<0&&(m.s=1),m},o.comparedTo=function(m,g){return Dn(this,new x(m,g))},o.decimalPlaces=o.dp=function(m,g){var v,$,N,O=this;if(m!=null)return ye(m,0,Ne),g==null?g=c:ye(g,0,8),B(new x(O),m+O.e+1,g);if(!(v=O.c))return null;if($=((N=v.length-1)-it(this.e/oe))*oe,N=v[N])for(;N%10==0;N/=10,$--);return $<0&&($=0),$},o.dividedBy=o.div=function(m,g){return t(this,new x(m,g),i,c)},o.dividedToIntegerBy=o.idiv=function(m,g){return t(this,new x(m,g),0,1)},o.exponentiatedBy=o.pow=function(m,g){var v,$,N,O,k,y,C,I,T,L=this;if(m=new x(m),m.c&&!m.isInteger())throw Error(_e+"Exponent not an integer: "+F(m));if(g!=null&&(g=new x(g)),y=m.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!m.c||!m.c[0])return T=new x(Math.pow(+F(L),y?m.s*(2-rs(m)):+F(m))),g?T.mod(g):T;if(C=m.s<0,g){if(g.c?!g.c[0]:!g.s)return new x(NaN);$=!C&&L.isInteger()&&g.isInteger(),$&&(L=L.mod(g))}else{if(m.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 O=L.s<0&&rs(m)?-0:0,L.e>-1&&(O=1/O),new x(C?1/O:O);h&&(O=$i(h/oe+2))}for(y?(v=new x(.5),C&&(m.s=1),I=rs(m)):(N=Math.abs(+F(m)),I=N%2),T=new x(s);;){if(I){if(T=T.times(L),!T.c)break;O?T.c.length>O&&(T.c.length=O):$&&(T=T.mod(g))}if(N){if(N=st(N/2),N===0)break;I=N%2}else if(m=m.times(v),B(m,m.e+1,1),m.e>14)I=rs(m);else{if(N=+F(m),N===0)break;I=N%2}L=L.times(L),O?L.c&&L.c.length>O&&(L.c.length=O):$&&(L=L.mod(g))}return $?T:(C&&(T=s.div(T)),g?T.mod(g):O?B(T,h,c,k):T)},o.integerValue=function(m){var g=new x(this);return m==null?m=c:ye(m,0,8),B(g,g.e+1,m)},o.isEqualTo=o.eq=function(m,g){return Dn(this,new x(m,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(m,g){return Dn(this,new x(m,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(m,g){return(g=Dn(this,new x(m,g)))===1||g===0},o.isInteger=function(){return!!this.c&&it(this.e/oe)>this.c.length-2},o.isLessThan=o.lt=function(m,g){return Dn(this,new x(m,g))<0},o.isLessThanOrEqualTo=o.lte=function(m,g){return(g=Dn(this,new x(m,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(m,g){var v,$,N,O,k=this,y=k.s;if(m=new x(m,g),g=m.s,!y||!g)return new x(NaN);if(y!=g)return m.s=-g,k.plus(m);var C=k.e/oe,I=m.e/oe,T=k.c,L=m.c;if(!C||!I){if(!T||!L)return T?(m.s=-g,m):new x(L?k:NaN);if(!T[0]||!L[0])return L[0]?(m.s=-g,m):new x(T[0]?k:c==3?-0:0)}if(C=it(C),I=it(I),T=T.slice(),y=C-I){for((O=y<0)?(y=-y,N=T):(I=C,N=L),N.reverse(),g=y;g--;N.push(0));N.reverse()}else for($=(O=(y=T.length)<(g=L.length))?y:g,y=g=0;g<$;g++)if(T[g]!=L[g]){O=T[g]<L[g];break}if(O&&(N=T,T=L,L=N,m.s=-m.s),g=($=L.length)-(v=T.length),g>0)for(;g--;T[v++]=0);for(g=xt-1;$>y;){if(T[--$]<L[$]){for(v=$;v&&!T[--v];T[v]=g);--T[v],T[$]+=xt}T[$]-=L[$]}for(;T[0]==0;T.splice(0,1),--I);return T[0]?M(m,T,I):(m.s=c==3?-1:1,m.c=[m.e=0],m)},o.modulo=o.mod=function(m,g){var v,$,N=this;return m=new x(m,g),!N.c||!m.s||m.c&&!m.c[0]?new x(NaN):!m.c||N.c&&!N.c[0]?new x(N):(p==9?($=m.s,m.s=1,v=t(N,m,0,3),m.s=$,v.s*=$):v=t(N,m,0,p),m=N.minus(v.times(m)),!m.c[0]&&p==1&&(m.s=N.s),m)},o.multipliedBy=o.times=function(m,g){var v,$,N,O,k,y,C,I,T,L,j,z,_,H,Y,G=this,W=G.c,Z=(m=new x(m,g)).c;if(!W||!Z||!W[0]||!Z[0])return!G.s||!m.s||W&&!W[0]&&!Z||Z&&!Z[0]&&!W?m.c=m.e=m.s=null:(m.s*=G.s,!W||!Z?m.c=m.e=null:(m.c=[0],m.e=0)),m;for($=it(G.e/oe)+it(m.e/oe),m.s*=G.s,C=W.length,L=Z.length,C<L&&(_=W,W=Z,Z=_,N=C,C=L,L=N),N=C+L,_=[];N--;_.push(0));for(H=xt,Y=pn,N=L;--N>=0;){for(v=0,j=Z[N]%Y,z=Z[N]/Y|0,k=C,O=N+k;O>N;)I=W[--k]%Y,T=W[k]/Y|0,y=z*I+T*j,I=j*I+y%Y*Y+_[O]+v,v=(I/H|0)+(y/Y|0)+z*T,_[O--]=I%H;_[O]=v}return v?++$:_.splice(0,1),M(m,_,$)},o.negated=function(){var m=new x(this);return m.s=-m.s||null,m},o.plus=function(m,g){var v,$=this,N=$.s;if(m=new x(m,g),g=m.s,!N||!g)return new x(NaN);if(N!=g)return m.s=-g,$.minus(m);var O=$.e/oe,k=m.e/oe,y=$.c,C=m.c;if(!O||!k){if(!y||!C)return new x(N/0);if(!y[0]||!C[0])return C[0]?m:new x(y[0]?$:N*0)}if(O=it(O),k=it(k),y=y.slice(),N=O-k){for(N>0?(k=O,v=C):(N=-N,v=y),v.reverse();N--;v.push(0));v.reverse()}for(N=y.length,g=C.length,N-g<0&&(v=C,C=y,y=v,g=N),N=0;g;)N=(y[--g]=y[g]+C[g]+N)/xt|0,y[g]=xt===y[g]?0:y[g]%xt;return N&&(y=[N].concat(y),++k),M(m,y,k)},o.precision=o.sd=function(m,g){var v,$,N,O=this;if(m!=null&&m!==!!m)return ye(m,1,Ne),g==null?g=c:ye(g,0,8),B(new x(O),m,g);if(!(v=O.c))return null;if(N=v.length-1,$=N*oe+1,N=v[N]){for(;N%10==0;N/=10,$--);for(N=v[0];N>=10;N/=10,$++);}return m&&O.e+1>$&&($=O.e+1),$},o.shiftedBy=function(m){return ye(m,-Ni,Ni),this.times("1e"+m)},o.squareRoot=o.sqrt=function(){var m,g,v,$,N,O=this,k=O.c,y=O.s,C=O.e,I=i+4,T=new x("0.5");if(y!==1||!k||!k[0])return new x(!y||y<0&&(!k||k[0])?NaN:k?O:1/0);if(y=Math.sqrt(+F(O)),y==0||y==1/0?(g=at(k),(g.length+C)%2==0&&(g+="0"),y=Math.sqrt(+g),C=it((C+1)/2)-(C<0||C%2),y==1/0?g="5e"+C:(g=y.toExponential(),g=g.slice(0,g.indexOf("e")+1)+C),v=new x(g)):v=new x(y+""),v.c[0]){for(C=v.e,y=C+I,y<3&&(y=0);;)if(N=v,v=T.times(N.plus(t(O,N,I,1))),at(N.c).slice(0,y)===(g=at(v.c)).slice(0,y))if(v.e<C&&--y,g=g.slice(y-3,y+1),g=="9999"||!$&&g=="4999"){if(!$&&(B(N,N.e+i+2,0),N.times(N).eq(O))){v=N;break}I+=4,y+=4,$=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(B(v,v.e+i+2,1),m=!v.times(v).eq(O));break}}return B(v,v.e+i+1,c,m)},o.toExponential=function(m,g){return m!=null&&(ye(m,0,Ne),m++),w(this,m,g,1)},o.toFixed=function(m,g){return m!=null&&(ye(m,0,Ne),m=m+this.e+1),w(this,m,g)},o.toFormat=function(m,g,v){var $,N=this;if(v==null)m!=null&&g&&typeof g=="object"?(v=g,g=null):m&&typeof m=="object"?(v=m,m=g=null):v=b;else if(typeof v!="object")throw Error(_e+"Argument not an object: "+v);if($=N.toFixed(m,g),N.c){var O,k=$.split("."),y=+v.groupSize,C=+v.secondaryGroupSize,I=v.groupSeparator||"",T=k[0],L=k[1],j=N.s<0,z=j?T.slice(1):T,_=z.length;if(C&&(O=y,y=C,C=O,_-=O),y>0&&_>0){for(O=_%y||y,T=z.substr(0,O);O<_;O+=y)T+=I+z.substr(O,y);C>0&&(T+=I+z.slice(O)),j&&(T="-"+T)}$=L?T+(v.decimalSeparator||"")+((C=+v.fractionGroupSize)?L.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(v.fractionGroupSeparator||"")):L):T}return(v.prefix||"")+$+(v.suffix||"")},o.toFraction=function(m){var g,v,$,N,O,k,y,C,I,T,L,j,z=this,_=z.c;if(m!=null&&(y=new x(m),!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 x(z);for(g=new x(s),I=v=new x(s),$=C=new x(s),j=at(_),O=g.e=j.length-z.e-1,g.c[0]=Ci[(k=O%oe)<0?oe+k:k],m=!m||y.comparedTo(g)>0?O>0?g:I:y,k=f,f=1/0,y=new x(j),C.c[0]=0;T=t(y,g,0,1),N=v.plus(T.times($)),N.comparedTo(m)!=1;)v=$,$=N,I=C.plus(T.times(N=I)),C=N,g=y.minus(T.times(N=g)),y=N;return N=t(m.minus(v),$,0,1),C=C.plus(N.times(I)),v=v.plus(N.times($)),C.s=I.s=z.s,O=O*2,L=t(I,$,O,c).minus(z).abs().comparedTo(t(C,v,O,c).minus(z).abs())<1?[I,$]:[C,v],f=k,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(m,g){return m!=null&&ye(m,1,Ne),w(this,m,g,2)},o.toString=function(m){var g,v=this,$=v.s,N=v.e;return N===null?$?(g="Infinity",$<0&&(g="-"+g)):g="NaN":(m==null?g=N<=a||N>=l?os(at(v.c),N):qt(at(v.c),N,"0"):m===10&&P?(v=B(new x(v),i+N+1,c),g=qt(at(v.c),v.e,"0")):(ye(m,2,S.length,"Base"),g=n(qt(at(v.c),N,"0"),10,m,$,!0)),$<0&&v.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&&x.set(e),x}function it(e){var t=e|0;return e>0||e===t?t:t-1}function at(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=oe-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Dn(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!==st(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 rs(e){var t=e.c.length-1;return it(e.e/oe)==t&&e.c[t]%2!=0}function os(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function qt(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 Ce=Gl();const rb=(e,t=6)=>{try{const n=new Ce(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Ce.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"}},Et=()=>{const{translations:e,currentLocale:t}=Hl();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}}}},ob="1.2.3";let ze=class Fl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Fl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Fl&&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@${ob}`].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 Zt(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const ql=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Zl=/^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)?$/,Kl=/^\(.+?\).*?$/,Yl=/^tuple(?<array>(\[(\d*)\])*)$/;function Oi(e){let t=e.type;if(Yl.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+=Oi(s),o<n-1&&(t+=", ")}const r=Zt(Yl,e.type);return t+=`)${(r==null?void 0:r.array)||""}`,Oi({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function or(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=Oi(o),r!==n-1&&(t+=", ")}return t}function ss(e){var t;return e.type==="function"?`function ${e.name}(${or(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${or(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${or(e.inputs)})`:e.type==="error"?`error ${e.name}(${or(e.inputs)})`:e.type==="constructor"?`constructor(${or(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Xl=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function sb(e){return Xl.test(e)}function ib(e){return Zt(Xl,e)}const Ql=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function ab(e){return Ql.test(e)}function cb(e){return Zt(Ql,e)}const Jl=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function lb(e){return Jl.test(e)}function ub(e){return Zt(Jl,e)}const eu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function is(e){return eu.test(e)}function fb(e){return Zt(eu,e)}const tu=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function db(e){return tu.test(e)}function pb(e){return Zt(tu,e)}const nu=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function hb(e){return nu.test(e)}function mb(e){return Zt(nu,e)}const bb=/^receive\(\) external payable$/;function gb(e){return bb.test(e)}const ru=new Set(["memory","indexed","storage","calldata"]),yb=new Set(["indexed"]),Ii=new Set(["calldata","memory","storage"]);class vb 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 wb 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 xb 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 Eb 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 Sb extends ze{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Pb 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 Tb 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 Ab 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 $b 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 sr 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 Nb extends ze{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Cb 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 Ob 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 Ib 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 kb(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}${r}`}const ki=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 Di(e,t={}){if(lb(e))return Db(e,t);if(ab(e))return Mb(e,t);if(sb(e))return Lb(e,t);if(db(e))return Bb(e,t);if(hb(e))return Fb(e);if(gb(e))return{type:"receive",stateMutability:"payable"};throw new Nb({signature:e})}function Db(e,t={}){const n=ub(e);if(!n)throw new sr({signature:e,type:"function"});const r=et(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(Kt(r[c],{modifiers:Ii,structs:t,type:"function"}));const i=[];if(n.returns){const c=et(n.returns),a=c.length;for(let l=0;l<a;l++)i.push(Kt(c[l],{modifiers:Ii,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Mb(e,t={}){const n=cb(e);if(!n)throw new sr({signature:e,type:"event"});const r=et(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(Kt(r[i],{modifiers:yb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Lb(e,t={}){const n=ib(e);if(!n)throw new sr({signature:e,type:"error"});const r=et(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(Kt(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Bb(e,t={}){const n=pb(e);if(!n)throw new sr({signature:e,type:"constructor"});const r=et(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(Kt(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function Fb(e){const t=mb(e);if(!t)throw new sr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Rb=/^(?<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$_]*))?$/,jb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,_b=/^u?int$/;function Kt(e,t){var f,d;const n=kb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(ki.has(n))return ki.get(n);const r=Kl.test(e),o=Zt(r?jb:Rb,e);if(!o)throw new Sb({param:e});if(o.name&&Ub(o.name))throw new Pb({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 p=et(o.type),h=[],b=p.length;for(let S=0;S<b;S++)h.push(Kt(p[S],{structs:c}));l={components:h}}else if(o.type in c)a="tuple",l={components:c[o.type]};else if(_b.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"&&!ou(a))throw new xb({type:a});if(o.modifier){if(!((d=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&d.call(f,o.modifier)))throw new Tb({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(Ii.has(o.modifier)&&!Wb(a,!!o.array))throw new Ab({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...l};return ki.set(n,u),u}function et(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?et(c,[...t,n.trim()]):et(c,t,`${n}${i}`,r);case"(":return et(c,t,`${n}${i}`,r+1);case")":return et(c,t,`${n}${i}`,r-1);default:return et(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Ib({current:n,depth:r});return t.push(n.trim()),t}function ou(e){return e==="address"||e==="bool"||e==="function"||e==="string"||ql.test(e)||Zl.test(e)}const zb=/^(?: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 Ub(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||ql.test(e)||Zl.test(e)||zb.test(e)}function Wb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Mi(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!is(c))continue;const a=fb(c);if(!a)throw new sr({signature:c,type:"struct"});const l=a.properties.split(";"),u=[],f=l.length;for(let d=0;d<f;d++){const h=l[d].trim();if(!h)continue;const b=Kt(h,{type:"struct"});u.push(b)}if(!u.length)throw new Cb({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]=su(a,t)}return r}const Hb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function su(e=[],t={},n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(Kl.test(i.type))r.push(i);else{const a=Zt(Hb,i.type);if(!(a!=null&&a.type))throw new $b({abiParameter:i});const{array:l,type:u}=a;if(u in t){if(n.has(u))throw new Ob({type:u});r.push({...i,type:`tuple${l??""}`,components:su(t[u],t,new Set([...n,u]))})}else if(ou(u))r.push(i);else throw new wb({type:u})}}return r}function iu(e){const t=Mi(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];is(s)||n.push(Di(s,t))}return n}function au(e){let t;if(typeof e=="string")t=Di(e);else{const n=Mi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!is(s)){t=Di(s,n);break}}}if(!t)throw new vb({signature:e});return t}function cu(e){const t=[];if(typeof e=="string"){const n=et(e),r=n.length;for(let o=0;o<r;o++)t.push(Kt(n[o],{modifiers:ru}))}else{const n=Mi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(is(s))continue;const i=et(s),c=i.length;for(let a=0;a<c;a++)t.push(Kt(i[a],{modifiers:ru,structs:n}))}}if(t.length===0)throw new Eb({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 St(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new o1(e.type);return`${e.name}(${as(e.inputs,{includeName:t})})`}function as(e,{includeName:t=!1}={}){return e?e.map(n=>Vb(n,{includeName:t})).join(t?", ":","):""}function Vb(e,{includeName:t}){return e.type.startsWith("tuple")?`(${as(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Pt(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 Pt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const lu="2.47.2";let Hr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${lu}`},V=class Rl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof Rl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Rl&&n.cause.docsPath||n.docsPath,s=(c=Hr.getDocsUrl)==null?void 0:c.call(Hr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Hr.version?[`Version: ${Hr.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=lu}walk(t){return uu(this,t)}};function uu(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?uu(e.cause,t):t?null:e}class Gb 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 fu 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 du 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: (${as(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 Vr extends V{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class qb 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 Zb 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 Kb 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 Yb 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 pu 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 hu 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://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
60
|
+
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Xb 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://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
61
|
+
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class mu 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(`
|
|
62
|
+
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class ir 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(`
|
|
63
|
+
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class bu 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 Jb 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://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
65
|
+
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class e1 extends V{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${St(t.abiItem)}\`, and`,`\`${n.type}\` in \`${St(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let t1=class extends V{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class cs 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: (${as(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 Li extends V{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${St(t,{includeName:!0})}".`].join(`
|
|
67
|
+
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class n1 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 r1 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 gu=class extends V{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
70
|
+
`),{name:"InvalidArrayError"})}};class o1 extends V{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
71
|
+
`),{name:"InvalidDefinitionTypeError"})}}class s1 extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let yu=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"})}},vu=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 wu 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 ar(e,{dir:t,size:n=32}={}){return typeof e=="string"?hn(e,{dir:t,size:n}):i1(e,{dir:t,size:n})}function hn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new vu({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function i1(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new vu({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 Bi=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"})}},a1=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 c1 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 l1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function Mn(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 Tt(e,{size:t}){if(ve(e)>t)throw new l1({givenSize:ve(e),maxSize:t})}function Lt(e,t={}){const{signed:n}=t;t.size&&Tt(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 u1(e,t={}){let n=e;if(t.size&&(Tt(n,{size:t.size}),n=Mn(n)),Mn(n)==="0x00")return!1;if(Mn(n)==="0x01")return!0;throw new c1(n)}function Yt(e,t={}){const n=Lt(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Bi({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}const f1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function mn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Q(e,t):typeof e=="string"?Gr(e,t):typeof e=="boolean"?xu(e,t):Ae(e,t)}function xu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Tt(n,{size:t.size}),ar(n,{size:t.size})):n}function Ae(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=f1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(Tt(r,{size:t.size}),ar(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 Bi({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?ar(c,{size:r}):c}const d1=new TextEncoder;function Gr(e,t={}){const n=d1.encode(e);return Ae(n,t)}const p1=new TextEncoder;function cr(e,t={}){return typeof e=="number"||typeof e=="bigint"?m1(e,t):typeof e=="boolean"?h1(e,t):Pt(e)?Bt(e,t):Ln(e,t)}function h1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Tt(n,{size:t.size}),ar(n,{size:t.size})):n}const Xt={zero:48,nine:57,A:65,F:70,a:97,f:102};function Eu(e){if(e>=Xt.zero&&e<=Xt.nine)return e-Xt.zero;if(e>=Xt.A&&e<=Xt.F)return e-(Xt.A-10);if(e>=Xt.a&&e<=Xt.f)return e-(Xt.a-10)}function Bt(e,t={}){let n=e;t.size&&(Tt(n,{size:t.size}),n=ar(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=Eu(r.charCodeAt(c++)),l=Eu(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 m1(e,t){const n=Q(e,t);return Bt(n)}function Ln(e,t={}){const n=p1.encode(e);return typeof t.size=="number"?(Tt(n,{size:t.size}),ar(n,{dir:"right",size:t.size})):n}const ls=BigInt(2**32-1),Su=BigInt(32);function b1(e,t=!1){return t?{h:Number(e&ls),l:Number(e>>Su&ls)}:{h:Number(e>>Su&ls)|0,l:Number(e&ls)|0}}function g1(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}=b1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const y1=(e,t,n)=>e<<n|t>>>32-n,v1=(e,t,n)=>t<<n|e>>>32-n,w1=(e,t,n)=>t<<n-32|e>>>64-n,x1=(e,t,n)=>e<<n-32|t>>>64-n,lr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function E1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function qr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Bn(e,...t){if(!E1(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 S1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");qr(e.outputLen),qr(e.blockLen)}function ur(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 Pu(e,t){Bn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function P1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function fr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Fi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ft(e,t){return e<<32-t|e>>>t}const T1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function A1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function $1(e){for(let t=0;t<e.length;t++)e[t]=A1(e[t]);return e}const Tu=T1?e=>e:$1;function N1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function us(e){return typeof e=="string"&&(e=N1(e)),Bn(e),e}function C1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Bn(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 Ri{}function Au(e){const t=r=>e().update(us(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function O1(e=32){if(lr&&typeof lr.getRandomValues=="function")return lr.getRandomValues(new Uint8Array(e));if(lr&&typeof lr.randomBytes=="function")return Uint8Array.from(lr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const I1=BigInt(0),Zr=BigInt(1),k1=BigInt(2),D1=BigInt(7),M1=BigInt(256),L1=BigInt(113),$u=[],Nu=[],Cu=[];for(let e=0,t=Zr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],$u.push(2*(5*r+n)),Nu.push((e+1)*(e+2)/2%64);let o=I1;for(let s=0;s<7;s++)t=(t<<Zr^(t>>D1)*L1)%M1,t&k1&&(o^=Zr<<(Zr<<BigInt(s))-Zr);Cu.push(o)}const Ou=g1(Cu,!0),B1=Ou[0],F1=Ou[1],Iu=(e,t,n)=>n>32?w1(e,t,n):y1(e,t,n),ku=(e,t,n)=>n>32?x1(e,t,n):v1(e,t,n);function R1(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=Iu(l,u,1)^n[c],d=ku(l,u,1)^n[c+1];for(let p=0;p<50;p+=10)e[i+p]^=f,e[i+p+1]^=d}let o=e[2],s=e[3];for(let i=0;i<24;i++){const c=Nu[i],a=Iu(o,s,c),l=ku(o,s,c),u=$u[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]^=B1[r],e[1]^=F1[r]}fr(n)}class ji extends Ri{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,qr(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=P1(this.state)}clone(){return this._cloneInto()}keccak(){Tu(this.state32),R1(this.state32,this.rounds),Tu(this.state32),this.posOut=0,this.pos=0}update(t){ur(this),t=us(t),Bn(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){ur(this,!1),Bn(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 qr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Pu(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,fr(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new ji(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 j1=(e,t,n)=>Au(()=>new ji(t,e,n)),Du=j1(1,136,256/8);function ke(e,t){const n=t||"hex",r=Du(Pt(e,{strict:!1})?cr(e):e);return n==="bytes"?r:mn(r)}const _1=e=>ke(cr(e));function z1(e){return _1(e)}function U1(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 W1=e=>{const t=typeof e=="string"?e:ss(e);return U1(t)};function Mu(e){return z1(W1(e))}const fs=Mu;let bn=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"})}},ds=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 _i=new ds(8192);function ps(e,t){if(_i.has(`${e}.${t}`))return _i.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=ke(Ln(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 _i.set(`${e}.${t}`,s),s}function Qt(e,t){if(!ct(e,{strict:!1}))throw new bn({address:e});return ps(e,t)}const H1=/^0x[a-fA-F0-9]{40}$/,zi=new ds(8192);function ct(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(zi.has(r))return zi.get(r);const o=H1.test(e)?e.toLowerCase()===e?!0:n?ps(e)===e:!0:!1;return zi.set(r,o),o}function At(e){return typeof e[0]=="string"?dr(e):V1(e)}function V1(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 dr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Fn(e,t,n,{strict:r}={}){return Pt(e,{strict:!1})?G1(e,t,n,{strict:r}):Fu(e,t,n,{strict:r})}function Lu(e,t){if(typeof t=="number"&&t>0&&t>ve(e)-1)throw new yu({offset:t,position:"start",size:ve(e)})}function Bu(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ve(e)!==n-t)throw new yu({offset:n,position:"end",size:ve(e)})}function Fu(e,t,n,{strict:r}={}){Lu(e,t);const o=e.slice(t,n);return r&&Bu(o,t,n),o}function G1(e,t,n,{strict:r}={}){Lu(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Bu(o,t,n),o}const q1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ru=/^(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 gn(e,t){if(e.length!==t.length)throw new Kb({expectedLength:e.length,givenLength:t.length});const n=Z1({params:e,values:t}),r=Wi(n);return r.length===0?"0x":r}function Z1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Ui({param:e[r],value:t[r]}));return n}function Ui({param:e,value:t}){const n=Hi(e.type);if(n){const[r,o]=n;return Y1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return tg(t,{param:e});if(e.type==="address")return K1(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"]=Ru.exec(e.type)??[];return J1(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return X1(t,{param:e});if(e.type==="string")return eg(t);throw new n1(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Wi(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 At([...n,...r])}function K1(e){if(!ct(e))throw new bn({address:e});return{dynamic:!1,encoded:hn(e.toLowerCase())}}function Y1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new gu(e);if(!r&&e.length!==t)throw new qb({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Ui({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=Wi(s);if(r){const c=Q(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?At([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:At(s.map(({encoded:i})=>i))}}function X1(e,{param:t}){const[,n]=t.type.split("bytes"),r=ve(e);if(!n){let o=e;return r%32!==0&&(o=hn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:At([hn(Q(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new Zb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:hn(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:hn(xu(e))}}function J1(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 Bi({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 eg(e){const t=Gr(e),n=Math.ceil(ve(t)/32),r=[];for(let o=0;o<n;o++)r.push(hn(Fn(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:At([hn(Q(ve(t),{size:32})),...r])}}function tg(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=Ui({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Wi(r):At(r.map(({encoded:o})=>o))}}function Hi(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Kr=e=>Fn(Mu(e),0,4);function Rn(e){const{abi:t,args:n=[],name:r}=e,o=Pt(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Kr(c)===r:c.type==="event"?fs(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?Vi(l,f):!1})){if(i&&"inputs"in i&&i.inputs){const l=ju(c.inputs,i.inputs,n);if(l)throw new e1({abiItem:c,type:l[0]},{abiItem:i,type:l[1]})}i=c}}return i||s[0]}function Vi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ct(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)=>n==="object"&&Vi(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=>Vi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ju(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 ju(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")?ct(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ct(n[r],{strict:!1}):!1)return i}}const _u="/docs/contract/encodeEventTopics";function Yr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=Rn({abi:t,name:n});if(!l)throw new mu(n,{docsPath:_u});o=l}if(o.type!=="event")throw new mu(void 0,{docsPath:_u});const s=St(o),i=fs(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,d)=>Array.isArray(u[d])?u[d].map((p,h)=>zu({param:f,value:u[d][h]})):typeof u[d]<"u"&&u[d]!==null?zu({param:f,value:u[d]}):null))??[])}return[i,...c]}function zu({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return ke(cr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new s1(e.type);return gn([e],[t])}function hs(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 Uu(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,l=hs(e,{method:"eth_newFilter"}),u=s?Yr({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 tt(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Wu="/docs/contract/encodeFunctionData";function ng(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Rn({abi:t,args:n,name:r});if(!s)throw new ir(r,{docsPath:Wu});o=s}if(o.type!=="function")throw new ir(void 0,{docsPath:Wu});return{abi:[o],functionName:Kr(St(o))}}function lt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:ng(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?gn(o.inputs,t??[]):void 0;return dr([s,i??"0x"])}const rg={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."},Hu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},og={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Vu=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Gu=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},sg=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const ig={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 sg({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Gu({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Vu({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 Vu({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 Gi(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(ig);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function ag(e,t={}){typeof t.size<"u"&&Tt(e,{size:t.size});const n=Ae(e,t);return Lt(n,t)}function cg(e,t={}){let n=e;if(typeof t.size<"u"&&(Tt(n,{size:t.size}),n=Mn(n)),n.length>1||n[0]>1)throw new a1(n);return!!n[0]}function Jt(e,t={}){typeof t.size<"u"&&Tt(e,{size:t.size});const n=Ae(e,t);return Yt(n,t)}function lg(e,t={}){let n=e;return typeof t.size<"u"&&(Tt(n,{size:t.size}),n=Mn(n,{dir:"right"})),new TextDecoder().decode(n)}function Xr(e,t){const n=typeof t=="string"?Bt(t):t,r=Gi(n);if(ve(n)===0&&e.length>0)throw new Vr;if(ve(t)&&ve(t)<32)throw new du({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]=pr(r,c,{staticPosition:0});o+=l,s.push(a)}return s}function pr(e,t,{staticPosition:n}){const r=Hi(t.type);if(r){const[o,s]=r;return fg(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return mg(e,t,{staticPosition:n});if(t.type==="address")return ug(e);if(t.type==="bool")return dg(e);if(t.type.startsWith("bytes"))return pg(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return hg(e,t);if(t.type==="string")return bg(e,{staticPosition:n});throw new r1(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const qu=32,qi=32;function ug(e){const t=e.readBytes(32);return[ps(Ae(Fu(t,-20))),32]}function fg(e,t,{length:n,staticPosition:r}){if(!n){const i=Jt(e.readBytes(qi)),c=r+i,a=c+qu;e.setPosition(c);const l=Jt(e.readBytes(qu)),u=Qr(t);let f=0;const d=[];for(let p=0;p<l;++p){e.setPosition(a+(u?p*32:f));const[h,b]=pr(e,t,{staticPosition:a});f+=b,d.push(h)}return e.setPosition(r+32),[d,32]}if(Qr(t)){const i=Jt(e.readBytes(qi)),c=r+i,a=[];for(let l=0;l<n;++l){e.setPosition(c+l*32);const[u]=pr(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]=pr(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function dg(e){return[cg(e.readBytes(32),{size:32}),32]}function pg(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=Jt(e.readBytes(32));e.setPosition(n+i);const c=Jt(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 hg(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?ag(o,{signed:n}):Jt(o,{signed:n}),32]}function mg(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(Qr(t)){const i=Jt(e.readBytes(qi)),c=n+i;for(let a=0;a<t.components.length;++a){const l=t.components[a];e.setPosition(c+s);const[u,f]=pr(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]=pr(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=l}return[o,s]}function bg(e,{staticPosition:t}){const n=Jt(e.readBytes(32)),r=t+n;e.setPosition(r);const o=Jt(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=lg(Mn(s));return e.setPosition(t+32),[i,32]}function Qr(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(Qr);const n=Hi(e.type);return!!(n&&Qr({...e,type:n[1]}))}function Zu(e){const{abi:t,data:n}=e,r=Fn(n,0,4);if(r==="0x")throw new Vr;const s=[...t||[],Hu,og].find(i=>i.type==="error"&&r===Kr(St(i)));if(!s)throw new hu(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Xr(s.inputs,Fn(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 Ku({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 gg={gwei:9,wei:18},yg={ether:-9,wei:9};function Zi(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 Ki(e,t="wei"){return Zi(e,gg[t])}function Ue(e,t="wei"){return Zi(e,yg[t])}class vg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class wg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Yu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
72
|
+
`,"")}function xg(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
|
|
73
73
|
`;return r.nonce&&(o+=` nonce: ${r.nonce}
|
|
74
74
|
`),r.balance&&(o+=` balance: ${r.balance}
|
|
75
75
|
`),r.code&&(o+=` code: ${r.code}
|
|
76
76
|
`),r.state&&(o+=` state:
|
|
77
|
-
`,o+=
|
|
78
|
-
`,o+=
|
|
79
|
-
`).slice(0,-1)}function
|
|
80
|
-
`)}class
|
|
81
|
-
${
|
|
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
|
|
83
|
-
`)})}}Object.defineProperty(
|
|
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 Cg({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 Cg({hash:e,signature:t}))}function Ng(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",Ng([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(
|
|
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(
|
|
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,$,C;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,N=await(async()=>{if(!n||!m||typeof h<"u")return h;const O=Je(n),k=s?s.id:await X(e,ta,"getChainId")({});return await m.consume({address:O.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:N,to:v,type:T,value:E},"fillTransaction");try{const O=await e.request({method:"eth_fillTransaction",params:[F]}),y=((($=(w=s==null?void 0:s.formatters)==null?void 0:w.transaction)==null?void 0:$.format)||Xi)(O.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,At,"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**(((C=A.toString().split(".")[1])==null?void 0:C.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:O.raw,transaction:{from:F.from,...y}}}catch(O){throw ry(O,{...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 N,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&&((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(F=>{const{chainId:b,from:g,gas:w,gasPrice:$,nonce:C,maxFeePerBlobGas:O,maxFeePerGas:k,maxPriorityFeePerGas:y,type:A,...I}=F.transaction;return na.set(e.uid,!0),{...n,...g?{from:g}:{},...A?{type:A}:{},...typeof b<"u"?{chainId:b}:{},...typeof w<"u"?{gas:w}:{},...typeof $<"u"?{gasPrice:$}:{},...typeof C<"u"?{nonce:C}:{},...typeof O<"u"?{maxFeePerBlobGas:O}:{},...typeof k<"u"?{maxFeePerGas:k}:{},...typeof y<"u"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in I&&typeof I.nonceKey<"u"?{nonceKey:I.nonceKey}:{}}}).catch(F=>{var w;const b=F;return((w=b.walk)==null?void 0:w.call(b,$=>{const C=$;return C.name==="MethodNotFoundRpcError"||C.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:N,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 $=(typeof h=="bigint"?Q(h):void 0)||m,C=Ki(b);mr(t);const O=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,y=(O||bo)({...us(g,{format:O}),account:o,accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,data:v,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:N,maxPriorityFeePerGas:M,nonce:B,to:l,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:C?[y,$??e.experimental_blockTag??"latest",C]:$?[y,$]:[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 Cf(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 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 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=Cf(o.charCodeAt(a++)),u=Cf(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=Ct(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 Ny(r);return!!r[0]}function en(e,t={}){const{size:n}=t;typeof n<"u"&&Eo(e,n);const r=Ct(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=Cy(r)),yy.decode(r)}function Df(e){return Nf(e,{dir:"left"})}function Cy(e){return Nf(e,{dir:"right"})}class Ny 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?Ct(e):Array.isArray(e)?Ct(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 Ct(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 Ct(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 O,k,y,A;const{account:n=e.account,authorizationList:r,batch:o=!!((O=e.batch)!=null&&O.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:N,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&&N)throw new V("Cannot provide both `code` & `to` as parameters.");const g=u&&f,w=p&&d&&N&&f,$=g||w,C=g?Jf({code:u,data:f}):w?Gy({data:f,factory:p,factoryData:d,to:N}):f;try{mr(t);const P=(typeof s=="bigint"?Q(s):void 0)||i,L=l?zf(l):void 0,j=Ki(B),z=(A=(y=(k=e.chain)==null?void 0:k.formatters)==null?void 0:y.transactionRequest)==null?void 0:A.format,H=(z||bo)({...us(F,{format:z}),accessList:c,account:b,authorizationList:r,blobs:a,data:C,gas:h,gasPrice:m,maxFeePerBlobGas:v,maxFeePerGas:T,maxPriorityFeePerGas:E,nonce:S,to:$?void 0:N,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(I){const P=qy(I),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>Vv);if(e.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===j&&N)return{data:await L(e,{data:P,to:N})};throw $&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new Sg({factory:p}):Yf(I,{...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(N=>({allowFailure:!0,callData:N.data,target:N.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 Nt(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 N,M=!1;const B=Po(async()=>{var F;if(!M){try{N=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(N)b=await X(e,vs,"getFilterChanges")({filter:N});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){N&&b instanceof gn&&(M=!1),(F=E.onError)==null||F.call(E,b)}},{emitOnBegin:!0,interval:f});return async()=>{N&&await X(e,ws,"uninstallFilter")({filter:N}),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},N=>((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:$,args:C}=fs({abi:n,data:g.data,topics:g.topics,strict:p}),O=Xt(g,{args:C,eventName:$});N.onLogs([O])}catch($){let C,O;if($ instanceof Jo||$ instanceof Ti){if(p)return;C=$.abiItem.name,O=(w=$.abiItem.inputs)==null?void 0:w.some(y=>!("name"in y&&y.name))}const k=Xt(g,{args:O?[]:{},eventName:C});N.onLogs([k])}},onError(b){var g;(g=N.onError)==null||g.call(N,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 N=>{const M=N(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 Ca(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(Ca(s)),p,i??[Ao]],blockNumber:n,blockTag:r},m=await X(e,Nt,"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 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 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 Na({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 Na({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 Na({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 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 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(Ca(s)),Tt({abi:Hf,functionName:"text",args:[$a(s),o]}),i??[Ao]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},d=await X(e,Nt,"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,Nt,"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,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(Ca(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 N=(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,N]});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 Cv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Nv(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,Nt,"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(N=>({jsonrpc:"2.0",id:N.id??md.take(),...N}))):$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:Ct(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)(Ct(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=Co(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(Co(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),[Ct(a),32]}return[Ct(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(Co(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 Cw(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 Nd({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 Cw(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 Co(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(Co);const n=Fa(e.type);return!!(n&&Co({...e,type:n[1]}))}const Nw={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(Nw);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:Ct(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 Nd({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 Cd(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 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 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),Ne=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,N,M)=>{const B=N.toAffine();return hs(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(S=>{const N=S.subarray(1),M=n.fromBytes(N.subarray(0,n.BYTES)),B=n.fromBytes(N.subarray(n.BYTES,2*n.BYTES));return{x:M,y:B}});function i(S){const{a:N,b:M}=t,B=n.sqr(S),F=n.mul(B,S);return n.add(n.add(F,n.mul(S,N)),M)}function c(S,N){const M=n.sqr(N),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,Ne,t.n)}function f(S){const{allowedPrivateKeyLengths:N,nByteLength:M,wrapPrivateKey:B,n:F}=t;if(N&&typeof S!="bigint"){if(yo(S)&&(S=wo(S)),typeof S!="string"||!N.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,Ne,F),b}function p(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const d=Af((S,N)=>{const{px:M,py:B,pz:F}=S;if(n.eql(F,n.ONE))return{x:M,y:B};const b=S.is0();N==null&&(N=b?n.ONE:n.inv(F));const g=n.mul(M,N),w=n.mul(B,N),$=n.mul(F,N);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql($,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:N,y:M}=S.toAffine();if(!n.isValid(N)||!n.isValid(M))throw new Error("bad point: x or y not FE");if(!c(N,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(N,M,B){if(N==null||!n.isValid(N))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=N,this.py=M,this.pz=B,Object.freeze(this)}static fromAffine(N){const{x:M,y:B}=N||{};if(!N||!n.isValid(M)||!n.isValid(B))throw new Error("invalid affine point");if(N 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(N){const M=Fd(n,N.map(B=>B.pz));return N.map((B,F)=>B.toAffine(M[F])).map(m.fromAffine)}static fromHex(N){const M=m.fromAffine(s(ct("pointHex",N)));return M.assertValidity(),M}static fromPrivateKey(N){return m.BASE.multiply(f(N))}static msm(N,M){return Kw(m,r,N,M)}_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:M,py:B,pz:F}=this,{px:b,py:g,pz:w}=N,$=n.eql(n.mul(M,w),n.mul(b,F)),C=n.eql(n.mul(B,w),n.mul(g,F));return $&&C}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:N,b:M}=t,B=n.mul(M,Ka),{px:F,py:b,pz:g}=this;let w=n.ZERO,$=n.ZERO,C=n.ZERO,O=n.mul(F,F),k=n.mul(b,b),y=n.mul(g,g),A=n.mul(F,b);return A=n.add(A,A),C=n.mul(F,g),C=n.add(C,C),w=n.mul(N,C),$=n.mul(B,y),$=n.add(w,$),w=n.sub(k,$),$=n.add(k,$),$=n.mul(w,$),w=n.mul(A,w),C=n.mul(B,C),y=n.mul(N,y),A=n.sub(O,y),A=n.mul(N,A),A=n.add(A,C),C=n.add(O,O),O=n.add(C,O),O=n.add(O,y),O=n.mul(O,A),$=n.add($,O),y=n.mul(b,g),y=n.add(y,y),O=n.mul(y,A),w=n.sub(w,O),C=n.mul(y,k),C=n.add(C,C),C=n.add(C,C),new m(w,$,C)}add(N){p(N);const{px:M,py:B,pz:F}=this,{px:b,py:g,pz:w}=N;let $=n.ZERO,C=n.ZERO,O=n.ZERO;const k=t.a,y=n.mul(t.b,Ka);let A=n.mul(M,b),I=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,I),L=n.sub(L,j),j=n.add(M,F);let z=n.add(b,w);return j=n.mul(j,z),z=n.add(A,P),j=n.sub(j,z),z=n.add(B,F),$=n.add(g,w),z=n.mul(z,$),$=n.add(I,P),z=n.sub(z,$),O=n.mul(k,j),$=n.mul(y,P),O=n.add($,O),$=n.sub(I,O),O=n.add(I,O),C=n.mul($,O),I=n.add(A,A),I=n.add(I,A),P=n.mul(k,P),j=n.mul(y,j),I=n.add(I,P),P=n.sub(A,P),P=n.mul(k,P),j=n.add(j,P),A=n.mul(I,j),C=n.add(C,A),A=n.mul(z,j),$=n.mul(L,$),$=n.sub($,A),A=n.mul(L,I),O=n.mul(z,O),O=n.add(O,A),new m($,C,O)}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:M,n:B}=t;br("scalar",N,nn,B);const F=m.ZERO;if(N===nn)return F;if(this.is0()||N===Ne)return this;if(!M||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,N,m.normalizeZ);let{k1neg:b,k1:g,k2neg:w,k2:$}=M.splitScalar(N),C=F,O=F,k=this;for(;g>nn||$>nn;)g&Ne&&(C=C.add(k)),$&Ne&&(O=O.add(k)),k=k.double(),g>>=Ne,$>>=Ne;return b&&(C=C.negate()),w&&(O=O.negate()),O=new m(n.mul(O.px,M.beta),O.py,O.pz),C.add(O)}multiply(N){const{endo:M,n:B}=t;br("scalar",N,Ne,B);let F,b;if(M){const{k1neg:g,k1:w,k2neg:$,k2:C}=M.splitScalar(N);let{p:O,f:k}=this.wNAF(w),{p:y,f:A}=this.wNAF(C);O=E.constTimeNegate(g,O),y=E.constTimeNegate($,y),y=new m(n.mul(y.px,M.beta),y.py,y.pz),F=O.add(y),b=k.add(A)}else{const{p:g,f:w}=this.wNAF(N);F=g,b=w}return m.normalizeZ([F,b])[0]}multiplyAndAddUnsafe(N,M,B){const F=m.BASE,b=(w,$)=>$===nn||$===Ne||!w.equals(F)?w.multiplyUnsafe($):w.multiply($),g=b(this,M).add(b(N,B));return g.is0()?void 0:g}toAffine(N){return d(this,N)}isTorsionFree(){const{h:N,isTorsionFree:M}=t;if(N===Ne)return!0;if(M)return M(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:M}=t;return N===Ne?this:M?M(m,this):this.multiplyUnsafe(t.h)}toRawBytes(N=!0){return vo("isCompressed",N),this.assertValidity(),o(m,this,N)}toHex(N=!0){return vo("isCompressed",N),wo(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: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,I){const P=A.toAffine(),L=n.toBytes(P.x),j=hs;return vo("isCompressed",I),I?j(Uint8Array.from([A.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(P.y))},fromBytes(y){const A=y.length,I=y[0],P=y.subarray(1);if(A===i&&(I===2||I===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(Y){const G=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+G)}const _=(z&Ne)===Ne;return(I&1)===1!==_&&(z=n.neg(z)),{x:L,y:z}}else if(A===c&&I===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 v=(y,A,I)=>jn(y.slice(A,I));class T{constructor(A,I,P){br("r",A,Ne,r),br("s",I,Ne,r),this.r=A,this.s=I,P!=null&&(this.recovery=P),Object.freeze(this)}static fromCompact(A){const I=o;return A=ct("compactSignature",A,I*2),new T(v(A,0,I),v(A,I,2*I))}static fromDER(A){const{r:I,s:P}=tn.toSig(ct("DER",A));return new T(I,P)}assertValidity(){}addRecoveryBit(A){return new T(this.r,this.s,A)}recoverPublicKey(A){const{r:I,s:P,recovery:L}=this,j=F(ct("msgHash",A));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?I+t.n:I;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=L&1?"03":"02",H=u.fromHex(_+Za(z,n.BYTES)),Y=l(z),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 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=zd(t.n);return Vw(t.randomBytes(y),t.n)},precompute(y=8,A=u.BASE){return A._setWindowSize(y),A.multiply(BigInt(3)),A}};function S(y,A=!0){return u.fromPrivateKey(y).toRawBytes(A)}function N(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const I=ct("key",y).length,P=n.BYTES,L=P+1,j=2*P+1;if(!(t.allowedPrivateKeyLengths||o===L))return I===L||I===j}function M(y,A,I=!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 u.fromHex(A).multiply(f(y)).toRawBytes(I)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const A=jn(y),I=y.length*8-s;return I>0?A>>BigInt(I):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,I=$){if(["recovered","canonical"].some(ee=>ee in I))throw new Error("sign() legacy options not supported");const{hash:P,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:_}=I;j==null&&(j=!0),y=ct("msgHash",y),qd(I),z&&(y=ct("prehashed msgHash",P(y)));const H=F(y),Y=f(A),G=[g(Y),g(H)];if(_!=null&&_!==!1){const ee=_===!0?L(n.BYTES):_;G.push(ct("extraEntropy",ee))}const W=hs(...G),Z=H;function J(ee){const fe=B(ee);if(!d(fe))return;const pe=l(fe),he=u.BASE.multiply(fe).toAffine(),se=a(he.x);if(se===nn)return;const me=a(pe*a(Z+se*Y));if(me===nn)return;let te=(he.x===se?0:2)|Number(he.y&Ne),Se=me;return j&&h(me)&&(Se=m(me),te^=1),new T(se,Se,te)}return{seed:W,k2sig:J}}const $={lowS:t.lowS,prehash:!1},C={lowS:t.lowS,prehash:!1};function O(y,A,I=$){const{seed:P,k2sig:L}=w(y,A,I),j=t;return uy(j.hash.outputLen,j.nByteLength,j.hmac)(P,L)}u.BASE._setWindowSize(8);function k(y,A,I,P=C){var te;const L=y;A=ct("msgHash",A),I=ct("publicKey",I);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 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(I)}catch{return!1}if(!G||j&&G.hasHighS())return!1;z&&(A=t.hash(A));const{r:Z,s:J}=G,ee=F(A),fe=l(J),pe=a(ee*fe),he=a(Z*fe),se=(te=u.BASE.multiplyAndAddUnsafe(W,pe,he))==null?void 0:te.toAffine();return se?a(se.x)===Z:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:M,sign:O,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,N=lt(S,i,t)*h%t,M=lt(N,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(Ct(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=Cd("(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 C6(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 N6(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:N,address:M,args:B,functionName:F}=l[S];try{const b=Tt({abi:N,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:N,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,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}))),T=[];for(let S=0;S<v.length;S++){const N=v[S];if(N.status==="rejected"){if(!o)throw N.reason;for(let B=0;B<d[S].length;B++)T.push({status:"failure",error:N.reason,result:void 0});continue}const M=N.value;for(let B=0;B<M.length;B++){const{returnData:F,success:b}=M[B],{callData:g}=d[S][B],{abi:w,address:$,functionName:C,args:O}=l[T.length];try{if(g==="0x")throw new Rr;if(!b)throw new is({data:F});const k=Rn({abi:w,args:O,data:F,functionName:C});T.push(o?{result:k,status:"success"}:k)}catch(k){const y=pr(k,{abi:w,address:$,args:O,docsPath:"/docs/contract/multicall",functionName:C});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,N={...T,account:E,data:T.dataSuffix?Pt([S||"0x",T.dataSuffix]):S,from:T.from??(E==null?void 0:E.address)};return mr(N),bo(N)}),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,$;const{abi:v,args:T,functionName:E,to:S}=o[d].calls[m],N=((w=h.error)==null?void 0:w.data)??h.returnData,M=BigInt(h.gasUsed),B=($=h.logs)==null?void 0:$.map(C=>Xt(C)),F=h.status==="0x1"?"success":"failure",b=v&&F==="success"&&N!=="0x"?Rn({abi:v,data:N,functionName:E}):null,g=(()=>{var O;if(F==="success")return;let C;if(((O=h.error)==null?void 0:O.data)==="0x"?C=new Rr:h.error&&(C=new is(h.error)),!!C)return pr(C,{abi:v??[],address:S??"0x",args:T,functionName:E??"<unknown>"})})();return{data:N,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:z})=>z.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,N]=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),$=(v==null?void 0:v.calls)??[],C=(T==null?void 0:T.calls)??[],O=[...$,...C].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=((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),I=[];for(const[P,L]of O.entries()){const j=w[P];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=k[P-1],_=y[P-1],H=A[P-1],Y=P===0?{address:j6,decimals:18,symbol:"ETH"}:{address:f[P-1],decimals:H||z?Number(z??1):void 0,symbol:_??void 0};I.some(G=>G.token.address===Y.address)||I.push({token:Y,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:I,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(Cd("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 Cs(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,Nt,"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,Nt,"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,Cs,"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,Cs,"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(),N=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(N),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(N),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:O})=>O instanceof nf});h=!1;const $=w.transactions.find(({from:O,nonce:k})=>O===p.from&&k===p.nonce);if(!$||(d=await X(e,Ts,"getTransactionReceipt")({hash:$.hash}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r)))return;let C="replaced";$.to===p.to&&$.value===p.value&&$.input===p.input?C="repriced":$.from===$.to&&$.value===0n&&(C="cancelled"),F(()=>{var O;(O=M.onReplaced)==null||O.call(M,{reason:C,replacedTransaction:p,transaction:$,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(N=>N.config.type==="webSocket"||N.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 N=await X(e,At,"getBlock")({blockNumber:(M=S.result)==null?void 0:M.number,includeTransactions:u}).catch(()=>{});h&&(o(N,f),m=!1,f=N)},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,N=!1;const M=Po(async()=>{var B;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 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&&(N=!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 N=[];S&&(N=[S.flatMap(F=>Wr({abi:[F],eventName:F.name,args:n}))],o&&(N=N[0]));const{unsubscribe:M}=await E.subscribe({params:["logs",{address:t,topics:N}],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}),$=Xt(F,{args:w,eventName:g});a([$])}catch(g){let w,$;if(g instanceof Jo||g instanceof Ti){if(f)return;w=g.abiItem.name,$=(b=g.abiItem.inputs)==null?void 0:b.some(O=>!("name"in O&&O.name))}const C=Xt(F,{args:$?[]:{},eventName:w});a([C])}},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
|
|
77
|
+
`,o+=Yu(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
78
|
+
`,o+=Yu(r.stateDiff)),o},` State Override:
|
|
79
|
+
`).slice(0,-1)}function Jr(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(`
|
|
80
|
+
`)}class Eg extends V{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Jr(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 Sg 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:d}){var h;const p=Jr({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 d<"u"&&`${Ki(d)} ${((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:",p].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Xu 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 Qu 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 Pg 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 Tg extends V{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Ag=e=>e,eo=e=>e;class Ju 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:d,stateOverride:p}){var S;const h=n?tt(n):void 0;let b=Jr({from:h==null?void 0:h.address,to:f,value:typeof d<"u"&&`${Ki(d)} ${((S=o==null?void 0:o.nativeCurrency)==null?void 0:S.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});p&&(b+=`
|
|
81
|
+
${xg(p)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",b].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class ef extends V{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:c}){const a=Rn({abi:n,args:r,name:i}),l=a?Ku({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?St(a,{includeName:!0}):void 0,f=Jr({address:o&&Ag(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 Yi extends V{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,c,a;if(n&&n!=="0x")try{i=Zu({abi:t,data:n});const{abiItem:u,errorName:f,args:d}=i;if(f==="Error")a=d[0];else if(f==="Panic"){const[p]=d;a=rg[p]}else{const p=u?St(u,{includeName:!0}):void 0,h=u&&d?Ku({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;c=[p?`Error: ${p}`:"",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 hu&&(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://4byte.sourcify.dev/?q=${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 $g 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 Ng 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 ms 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 jn 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: ${eo(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 Xi extends V{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${eo(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 tf extends V{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${eo(n)}`,`Request body: ${$e(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Cg=-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 Xi?t.code:n??Cg}}class He 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 to extends We{constructor(t){super(t,{code:to.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(to,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class no extends We{constructor(t){super(t,{code:no.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(no,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class ro extends We{constructor(t,{method:n}={}){super(t,{code:ro.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(ro,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class oo extends We{constructor(t){super(t,{code:oo.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
83
|
+
`)})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class _n extends We{constructor(t){super(t,{code:_n.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(_n,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class yn extends We{constructor(t){super(t,{code:yn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
84
|
+
`)})}}Object.defineProperty(yn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class so extends We{constructor(t){super(t,{code:so.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class io extends We{constructor(t){super(t,{code:io.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ao extends We{constructor(t){super(t,{code:ao.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class zn extends We{constructor(t,{method:n}={}){super(t,{code:zn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(zn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class hr extends We{constructor(t){super(t,{code:hr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(hr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class co extends We{constructor(t){super(t,{code:co.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class mr extends He{constructor(t){super(t,{code:mr.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(mr,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class lo extends He{constructor(t){super(t,{code:lo.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class uo extends He{constructor(t,{method:n}={}){super(t,{code:uo.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class fo extends He{constructor(t){super(t,{code:fo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class po extends He{constructor(t){super(t,{code:po.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ho extends He{constructor(t){super(t,{code:ho.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class mo extends He{constructor(t){super(t,{code:mo.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class bo extends He{constructor(t){super(t,{code:bo.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class go extends He{constructor(t){super(t,{code:go.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(go,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class yo extends He{constructor(t){super(t,{code:yo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class vo extends He{constructor(t){super(t,{code:vo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class wo extends He{constructor(t){super(t,{code:wo.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class xo extends He{constructor(t){super(t,{code:xo.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Eo extends He{constructor(t){super(t,{code:Eo.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(Eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class Og extends We{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Ig=3;function br(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof ms?e:e instanceof V?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:l,details:u,message:f,shortMessage:d}=c,p=e instanceof Vr?new $g({functionName:s}):[Ig,_n.code].includes(a)&&(l||u||f||d)||a===yn.code&&u==="execution reverted"&&l?new Yi({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c instanceof Xi?u:d??f}):e;return new ef(p,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function kg(e){const t=ke(`0x${e.substring(4)}`).substring(26);return ps(`0x${t}`)}async function Dg({hash:e,signature:t}){const n=Pt(e)?e:mn(e),{secp256k1:r}=await Promise.resolve().then(()=>h6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:l,s:u,v:f,yParity:d}=t,p=Number(d??f),h=nf(p);return new r.Signature(Lt(l),Lt(u)).addRecoveryBit(h)}const i=Pt(t)?t:mn(t);if(ve(i)!==65)throw new Error("invalid signature length");const c=Yt(`0x${i.slice(130)}`),a=nf(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function nf(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 rf({hash:e,signature:t}){return kg(await Dg({hash:e,signature:t}))}function Mg(e,t="hex"){const n=of(e),r=Gi(new Uint8Array(n.length));return n.encode(r),t==="hex"?Ae(r.bytes):r.bytes}function of(e){return Array.isArray(e)?Lg(e.map(t=>of(t))):Bg(e)}function Lg(e){const t=e.reduce((o,s)=>o+s.length,0),n=sf(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 Bg(e){const t=typeof e=="string"?Bt(e):e,n=sf(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 sf(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 Fg(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=ke(dr(["0x05",Mg([t?Q(t):"0x",o,n?Q(n):"0x"])]));return r==="bytes"?Bt(s):s}async function af(e){const{authorization:t,signature:n}=e;return rf({hash:Fg(t),signature:n??t})}class Rg 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:d}){var h;const p=Jr({from:n==null?void 0:n.address,to:f,value:typeof d<"u"&&`${Ki(d)} ${((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:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class gr 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(gr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(gr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class bs 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(bs,"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 Qi 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(Qi,"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 Ji 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(Ji,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ea 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(ea,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class ta 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(ta,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class na 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(na,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ra 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(ra,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class oa 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(oa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class sa extends V{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(sa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class gs 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(gs,"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 So extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ys(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===gr.code):e;return r instanceof V?new gr({cause:e,message:r.details}):gr.nodeMessage.test(n)?new gr({cause:e,message:e.details}):bs.nodeMessage.test(n)?new bs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Qi.nodeMessage.test(n)?new Qi({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Ji.nodeMessage.test(n)?new Ji({cause:e,nonce:t==null?void 0:t.nonce}):ea.nodeMessage.test(n)?new ea({cause:e,nonce:t==null?void 0:t.nonce}):ta.nodeMessage.test(n)?new ta({cause:e,nonce:t==null?void 0:t.nonce}):na.nodeMessage.test(n)?new na({cause:e}):ra.nodeMessage.test(n)?new ra({cause:e,gas:t==null?void 0:t.gas}):oa.nodeMessage.test(n)?new oa({cause:e,gas:t==null?void 0:t.gas}):sa.nodeMessage.test(n)?new sa({cause:e}):gs.nodeMessage.test(n)?new gs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new So({cause:e})}function jg(e,{docsPath:t,...n}){const r=(()=>{const o=ys(e,n);return o instanceof So?e:o})();return new Rg(r,{docsPath:t,...n})}function vs(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 _g={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Po(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=zg(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=_g[e.type]),typeof e.value<"u"&&(n.value=Q(e.value)),n}function zg(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 cf(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new wu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new wu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Ug(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=cf(r)),o!==void 0){if(i.state)throw new wg;i.stateDiff=cf(o)}return i}function ia(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ct(n,{strict:!1}))throw new bn({address:n});if(t[n])throw new vg({address:n});t[n]=Ug(r)}return t}const lf=2n**256n-1n;function yr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?tt(t):void 0;if(s&&!ct(s.address))throw new bn({address:s.address});if(o&&!ct(o))throw new bn({address:o});if(n&&n>lf)throw new bs({maxFeePerGas:n});if(r&&n&&r>n)throw new gs({maxFeePerGas:n,maxPriorityFeePerGas:r})}class uf extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class aa extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Wg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ue(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class ff 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 df={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function ca(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Yt(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?Yt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?df[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=Hg(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 Hg(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 pf(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:ca(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 $t(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 ff({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)||pf)(c,"getBlock")}async function la(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Vg(e,t){return hf(e,t)}async function hf(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,$t,"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 Lt(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):X(e,$t,"getBlock")({}),X(e,la,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new aa;const l=a-c.baseFeePerGas;return l<0n?0n:l}}async function Gg(e,t){return ua(e,t)}async function ua(e,t){var d,p;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,b;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)??1.2})();if(i<1)throw new uf;const a=10**(((d=i.toString().split(".")[1])==null?void 0:d.length)??0),l=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),u=n||await X(e,$t,"getBlock")({});if(typeof((p=r==null?void 0:r.fees)==null?void 0:p.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 aa;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await hf(e,{block:u,chain:r,request:o}),b=l(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??b+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??l(await X(e,la,"getGasPrice")({}))}}async function mf(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 Yt(o)}function bf(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=>Ae(s))}function gf(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=>Ae(i))}function qg(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 Zg(e,t,n){return e&t^~e&n}function Kg(e,t,n){return e&t^e&n^t&n}class Yg extends Ri{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=Fi(this.buffer)}update(t){ur(this),t=us(t),Bn(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=Fi(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){ur(this),Pu(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,fr(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;qg(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Fi(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 vn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xg=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 Qg extends Yg{constructor(t=32){super(64,t,8,!1),this.A=vn[0]|0,this.B=vn[1]|0,this.C=vn[2]|0,this.D=vn[3]|0,this.E=vn[4]|0,this.F=vn[5]|0,this.G=vn[6]|0,this.H=vn[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 d=wn[f-15],p=wn[f-2],h=Ft(d,7)^Ft(d,18)^d>>>3,b=Ft(p,17)^Ft(p,19)^p>>>10;wn[f]=b+wn[f-7]+h+wn[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 d=Ft(c,6)^Ft(c,11)^Ft(c,25),p=u+d+Zg(c,a,l)+Xg[f]+wn[f]|0,b=(Ft(r,2)^Ft(r,13)^Ft(r,22))+Kg(r,o,s)|0;u=l,l=a,a=c,c=i+p|0,i=s,s=o,o=r,r=p+b|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(){fr(wn)}destroy(){this.set(0,0,0,0,0,0,0,0),fr(this.buffer)}}const yf=Au(()=>new Qg),Jg=yf;function ey(e,t){return Jg(Pt(e,{strict:!1})?cr(e):e)}function ty(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=ey(t);return o.set([n],0),r==="bytes"?o:Ae(o)}function ny(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(ty({commitment:s,to:r,version:n}));return o}const vf=6,wf=32,fa=4096,xf=wf*fa,Ef=xf*vf-1-1*fa*vf;class ry extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class oy extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function sy(e){const t=typeof e.data=="string"?Bt(e.data):e.data,n=ve(t);if(!n)throw new oy;if(n>Ef)throw new ry({maxSize:Ef,size:n});const r=[];let o=!0,s=0;for(;o;){const i=Gi(new Uint8Array(xf));let c=0;for(;c<fa;){const a=t.slice(s,s+(wf-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 iy(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??sy({data:t}),s=e.commitments??bf({blobs:o,kzg:n,to:r}),i=e.proofs??gf({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 ay(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 Eg({transaction:e})}function cy(e,{docsPath:t,...n}){const r=(()=>{const o=ys(e,n);return o instanceof So?e:o})();return new Sg(r,{docsPath:t,...n})}async function da(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return Yt(t)}async function Sf(e,t){var m,g,v,$,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:d,maxPriorityFeePerGas:p,nonce:h,nonceManager:b,to:S,type:P,value:x,...w}=t,A=await(async()=>{if(!n||!b||typeof h<"u")return h;const O=tt(n),k=s?s.id:await X(e,da,"getChainId")({});return await b.consume({address:O.address,chainId:k,client:e})})();yr(t);const M=(g=(m=s==null?void 0:s.formatters)==null?void 0:m.transactionRequest)==null?void 0:g.format,F=(M||Po)({...vs(w,{format:M}),account:n?tt(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:p,nonce:A,to:S,type:P,value:x},"fillTransaction");try{const O=await e.request({method:"eth_fillTransaction",params:[F]}),y=((($=(v=s==null?void 0:s.formatters)==null?void 0:v.transaction)==null?void 0:$.format)||ca)(O.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 C=await(async()=>{var j,z;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await X(e,$t,"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(C<1)throw new uf;const T=10**(((N=C.toString().split(".")[1])==null?void 0:N.length)??0),L=j=>j*BigInt(Math.ceil(C*T))/BigInt(T);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:O.raw,transaction:{from:F.from,...y}}}catch(O){throw cy(O,{...t,chain:e.chain})}}const ly=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Pf=new Map,pa=new ds(128);async function Tf(e,t){var A,M,B;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=ly);const{account:r,chain:o=e.chain,nonceManager:s,parameters:i}=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,da,"getChainId")({}),a))}const u=r&&tt(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&&((A=c.runAt)!=null&&A.includes("beforeFillTransaction"))&&(n=await c.fn({...n,chain:o},{phase:"beforeFillTransaction"}),f??(f=n.nonce));const p=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||pa.get(e.uid)===!1||!["fees","gas"].some(m=>i.includes(m))?!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,Sf,"fillTransaction")({...n,nonce:f}).then(F=>{const{chainId:m,from:g,gas:v,gasPrice:$,nonce:N,maxFeePerBlobGas:O,maxFeePerGas:k,maxPriorityFeePerGas:y,type:C,...I}=F.transaction;return pa.set(e.uid,!0),{...n,...g?{from:g}:{},...C&&!n.type?{type:C}:{},...typeof m<"u"?{chainId:m}:{},...typeof v<"u"?{gas:v}:{},...typeof $<"u"?{gasPrice:$}:{},...typeof N<"u"?{nonce:N}:{},...typeof O<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:O}:{},...typeof k<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:k}:{},...typeof y<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in I&&typeof I.nonceKey<"u"?{nonceKey:I.nonceKey}:{}}}).catch(F=>{var v;const m=F;return m.name!=="TransactionExecutionError"||((v=m.walk)==null?void 0:v.call(m,$=>{const N=$;return N.name==="MethodNotFoundRpcError"||N.name==="MethodNotSupportedRpcError"}))&&pa.set(e.uid,!1),n}):n;f??(f=p.nonce),n={...p,...u?{from:u==null?void 0:u.address}:{},...f?{nonce:f}:{}};const{blobs:h,gas:b,kzg:S,type:P}=n;c!=null&&c.fn&&((M=c.runAt)!=null&&M.includes("beforeFillParameters"))&&(n=await c.fn({...n,chain:o},{phase:"beforeFillParameters"}));let x;async function w(){return x||(x=await X(e,$t,"getBlock")({blockTag:"latest"}),x)}if(i.includes("nonce")&&typeof f>"u"&&u&&!s&&(n.nonce=await X(e,mf,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&S){const F=bf({blobs:h,kzg:S});if(i.includes("blobVersionedHashes")){const m=ny({commitments:F,to:"hex"});n.blobVersionedHashes=m}if(i.includes("sidecars")){const m=gf({blobs:h,commitments:F,kzg:S}),g=iy({blobs:h,commitments:F,proofs:m,to:"hex"});n.sidecars=g}}if(i.includes("chainId")&&(n.chainId=await l()),(i.includes("fees")||i.includes("type"))&&typeof P>"u")try{n.type=ay(n)}catch{let F=Pf.get(e.uid);if(typeof F>"u"){const m=await w();F=typeof(m==null?void 0:m.baseFeePerGas)=="bigint",Pf.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 w(),{maxFeePerGas:m,maxPriorityFeePerGas:g}=await ua(e,{block:F,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new Wg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=m}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new aa;if(typeof n.gasPrice>"u"){const F=await w(),{gasPrice:m}=await ua(e,{block:F,chain:o,request:n,type:"legacy"});n.gasPrice=m}}return i.includes("gas")&&typeof b>"u"&&(n.gas=await X(e,ha,"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,chain:o},{phase:"afterFillParameters"})),yr(n),delete n.parameters,n}async function ha(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?tt(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 af({authorization:t.authorizationList[0]}).catch(()=>{throw new V("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:f,blobs:d,blobVersionedHashes:p,blockNumber:h,blockTag:b,data:S,gas:P,gasPrice:x,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:M,nonce:B,value:F,stateOverride:m,...g}=r?await Tf(e,{...t,parameters:s,to:l}):t;if(P&&t.gas!==P)return P;const $=(typeof h=="bigint"?Q(h):void 0)||b,N=ia(m);yr(t);const O=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,y=(O||Po)({...vs(g,{format:O}),account:o,accessList:u,authorizationList:f,blobs:d,blobVersionedHashes:p,data:S,gasPrice:x,maxFeePerBlobGas:w,maxFeePerGas:A,maxPriorityFeePerGas:M,nonce:B,to:l,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:N?[y,$??e.experimental_blockTag??"latest",N]:$?[y,$]:[y]}))}catch(l){throw jg(l,{...t,account:o,chain:e.chain})}}async function uy(e,t){var l;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(l=e.dataSuffix)==null?void 0:l.value,...c}=t,a=lt({abi:n,args:o,functionName:s});try{return await X(e,ha,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(u){const f=c.account?tt(c.account):void 0;throw br(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:f==null?void 0:f.address})}}function To(e,t){if(!ct(e,{strict:!1}))throw new bn({address:e});if(!ct(t,{strict:!1}))throw new bn({address:t});return e.toLowerCase()===t.toLowerCase()}function Rt(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}:{}}}const Af="/docs/contract/decodeEventLog";function ws(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new Xb({docsPath:Af});const a=t.find(P=>P.type==="event"&&i===fs(St(P)));if(!(a&&"name"in a)||a.type!=="event")throw new Qb(i,{docsPath:Af});const{name:l,inputs:u}=a,f=u==null?void 0:u.some(P=>!("name"in P&&P.name)),d=f?[]:{},p=u.map((P,x)=>[P,x]).filter(([P])=>"indexed"in P&&P.indexed),h=[];for(let P=0;P<p.length;P++){const[x,w]=p[P],A=c[P];if(!A){if(s)throw new Li({abiItem:a,param:x});h.push([x,w]);continue}d[f?w:x.name||w]=fy({param:x,value:A})}const b=u.filter(P=>!("indexed"in P&&P.indexed)),S=s?b:[...h.map(([P])=>P),...b];if(S.length>0){if(n&&n!=="0x")try{const P=Xr(S,n);if(P){let x=0;if(!s)for(const[w,A]of h)d[f?A:w.name||A]=P[x++];if(f)for(let w=0;w<u.length;w++)d[w]===void 0&&x<P.length&&(d[w]=P[x++]);else for(let w=0;w<b.length;w++)d[b[w].name]=P[x++]}}catch(P){if(s)throw P instanceof du||P instanceof Gu?new cs({abiItem:a,data:n,params:S,size:ve(n)}):P}else if(s)throw new cs({abiItem:a,data:"0x",params:S,size:0})}return{eventName:l,args:Object.values(d).length>0?d:void 0}}function fy({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Xr([e],t)||[])[0]}function ma(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]})(),i=t.filter(c=>c.type==="event").map(c=>({abi:c,selector:fs(c)}));return r.map(c=>{var d;const a=typeof c.blockNumber=="string"?Rt(c):c,l=i.filter(p=>a.topics[0]===p.selector);if(l.length===0)return null;let u,f;for(const p of l)try{u=ws({...a,abi:[p.abi],strict:!0}),f=p;break}catch{}if(!u&&!o){f=l[0];try{u=ws({data:a.data,topics:a.topics,abi:[f.abi],strict:!1})}catch{const p=(d=f.abi.inputs)==null?void 0:d.some(h=>!("name"in h&&h.name));return{...a,args:p?[]:{},eventName:f.abi.name}}}return!u||!f||s&&!s.includes(u.eventName)||!dy({args:u.args,inputs:f.abi.inputs,matchArgs:n})?null:{...u,...a}}).filter(Boolean)}function dy(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"?To(i,c):s.type==="string"||s.type==="bytes"?ke(cr(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}async function ba(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(b=>Yr({abi:[b],eventName:b.name,args:i?void 0:c}))],s&&(f=f[0]));let d;n?d=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):d=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 p=d.map(h=>Rt(h));return u?ma({abi:u,args:c,logs:p,strict:l}):p}async function $f(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:l}=t,u=i?Rn({abi:n,name:i}):void 0,f=u?void 0:n.filter(d=>d.type==="event");return X(e,ba,"getLogs")({address:r,args:o,blockHash:s,event:u,events:f,fromBlock:c,toBlock:a,strict:l})}const ga="/docs/contract/decodeFunctionResult";function xn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Rn({abi:t,args:n,name:r});if(!c)throw new ir(r,{docsPath:ga});s=c}if(s.type!=="function")throw new ir(void 0,{docsPath:ga});if(!s.outputs)throw new bu(s.name,{docsPath:ga});const i=Xr(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 ya=BigInt(0),va=BigInt(1);function Ao(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function wa(e){if(!Ao(e))throw new Error("Uint8Array expected")}function $o(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function xs(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Nf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?ya:BigInt("0x"+e)}const Cf=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",py=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function No(e){if(wa(e),Cf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=py[e[n]];return t}const en={_0:48,_9:57,A:65,F:70,a:97,f:102};function Of(e){if(e>=en._0&&e<=en._9)return e-en._0;if(e>=en.A&&e<=en.F)return e-(en.A-10);if(e>=en.a&&e<=en.f)return e-(en.a-10)}function Es(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Cf)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=Of(e.charCodeAt(s)),c=Of(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 Un(e){return Nf(No(e))}function If(e){return wa(e),Nf(No(Uint8Array.from(e).reverse()))}function Co(e,t){return Es(e.toString(16).padStart(t*2,"0"))}function kf(e,t){return Co(e,t).reverse()}function ut(e,t,n){let r;if(typeof t=="string")try{r=Es(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(Ao(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 Ss(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];wa(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 xa=e=>typeof e=="bigint"&&ya<=e;function Ea(e,t,n){return xa(e)&&xa(t)&&xa(n)&&t<=e&&e<n}function vr(e,t,n,r){if(!Ea(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function hy(e){let t;for(t=0;e>ya;e>>=va,t+=1);return t}const Ps=e=>(va<<BigInt(e))-va,Sa=e=>new Uint8Array(e),Df=e=>Uint8Array.from(e);function my(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=Sa(e),o=Sa(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=Sa(0))=>{o=c(Df([0]),f),r=c(),f.length!==0&&(o=c(Df([1]),f),r=c())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<t;){r=c();const p=r.slice();d.push(p),f+=r.length}return Ss(...d)};return(f,d)=>{i(),a(f);let p;for(;!(p=d(l()));)a();return i(),p}}const by={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"||Ao(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 Ts(e,t,n={}){const r=(o,s,i)=>{const c=by[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 Mf(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 gy="0.1.1";function yy(){return gy}class te extends Error{static setStaticOptions(t){te.prototype.docsOrigin=t.docsOrigin,te.prototype.showVersion=t.showVersion,te.prototype.version=t.version}constructor(t,n={}){const r=(()=>{var u;if(n.cause instanceof te){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:(u=n.cause)!=null&&u.message?n.cause.message:n.details})(),o=n.cause instanceof te&&n.cause.docsPath||n.docsPath,s=n.docsOrigin??te.prototype.docsOrigin,i=`${s}${o??""}`,c=!!(n.version??te.prototype.showVersion),a=n.version??te.prototype.version,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o||c?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0,c?`Version: ${a}`:void 0]:[]].filter(u=>typeof u=="string").join(`
|
|
88
|
+
`);super(l,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,"docsOrigin",{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,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=s,this.docsPath=o,this.shortMessage=t,this.showVersion=c,this.version=a}walk(t){return Lf(this,t)}}Object.defineProperty(te,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${yy()}`}}),te.setStaticOptions(te.defaultStaticOptions);function Lf(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Lf(e.cause,t):t?null:e}function Oo(e,t){if(wr(e)>t)throw new Ly({givenSize:wr(e),maxSize:t})}const tn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Bf(e){if(e>=tn.zero&&e<=tn.nine)return e-tn.zero;if(e>=tn.A&&e<=tn.F)return e-(tn.A-10);if(e>=tn.a&&e<=tn.f)return e-(tn.a-10)}function vy(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new By({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 Ff(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 As(e,t){if(nt(e)>t)throw new Uy({givenSize:nt(e),maxSize:t})}function wy(e,t){if(typeof t=="number"&&t>0&&t>nt(e)-1)throw new Zf({offset:t,position:"start",size:nt(e)})}function xy(e,t,n){if(typeof t=="number"&&typeof n=="number"&&nt(e)!==n-t)throw new Zf({offset:n,position:"end",size:nt(e)})}function Rf(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 Wy({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const Ey="#__bigint";function jf(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+Ey:o,n)}const Sy=new TextDecoder,Py=new TextEncoder;function Ty(e){return e instanceof Uint8Array?e:typeof e=="string"?_f(e):Ay(e)}function Ay(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function _f(e,t={}){const{size:n}=t;let r=e;n&&(As(e,n),r=Hn(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=Bf(o.charCodeAt(a++)),u=Bf(o.charCodeAt(a++));if(l===void 0||u===void 0)throw new te(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=l<<4|u}return i}function $y(e,t={}){const{size:n}=t,r=Py.encode(e);return typeof n=="number"?(Oo(r,n),Ny(r,n)):r}function Ny(e,t){return vy(e,{dir:"right",size:t})}function wr(e){return e.length}function Cy(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Oy(e,t={}){const{size:n}=t;typeof n<"u"&&Oo(e,n);const r=Ct(e,t);return Wf(r,t)}function Iy(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Oo(r,n),r=zf(r)),r.length>1||r[0]>1)throw new My(r);return!!r[0]}function nn(e,t={}){const{size:n}=t;typeof n<"u"&&Oo(e,n);const r=Ct(e,t);return Hf(r,t)}function ky(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Oo(r,n),r=Dy(r)),Sy.decode(r)}function zf(e){return Ff(e,{dir:"left"})}function Dy(e){return Ff(e,{dir:"right"})}class My extends te{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 Ly=class extends te{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"})}},By=class extends te{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 Fy=new TextEncoder,Ry=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function jy(e,t={}){const{strict:n=!1}=t;if(!e)throw new Gf(e);if(typeof e!="string")throw new Gf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new qf(e);if(!e.startsWith("0x"))throw new qf(e)}function Nt(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function _y(e){return e instanceof Uint8Array?Ct(e):Array.isArray(e)?Ct(new Uint8Array(e)):e}function Uf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(As(n,t.size),Wn(n,t.size)):n}function Ct(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Ry[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(As(r,t.size),Hn(r,t.size)):r}function Be(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 Vf({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:n,size:r,value:`${e}${l}`})}const a=`0x${(n&&o<0?BigInt.asUintN(r*8,BigInt(o)):o).toString(16)}`;return r?Wn(a,r):a}function Pa(e,t={}){return Ct(Fy.encode(e),t)}function Wn(e,t){return Rf(e,{dir:"left",size:t})}function Hn(e,t){return Rf(e,{dir:"right",size:t})}function jt(e,t,n,r={}){const{strict:o}=r;wy(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&xy(s,t,n),s}function nt(e){return Math.ceil((e.length-2)/2)}function Wf(e,t={}){const{signed:n}=t;t.size&&As(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 Hf(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Wf(e,t))}function zy(e,t={}){const{strict:n=!1}=t;try{return jy(e,{strict:n}),!0}catch{return!1}}class Vf extends te{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 Gf extends te{constructor(t){super(`Value \`${typeof t=="object"?jf(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 qf extends te{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 Uy extends te{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 Zf extends te{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 Wy extends te{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 Hy(e){return{address:e.address,amount:Be(e.amount),index:Be(e.index),validatorIndex:Be(e.validatorIndex)}}function Kf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Be(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Be(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Be(e.gasLimit)},...typeof e.number=="bigint"&&{number:Be(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Be(e.prevRandao)},...typeof e.time=="bigint"&&{time:Be(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Hy)}}}const xr=[{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:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],Ta=[{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"}]}],Yf=[{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"}],Xf=[...Yf,{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"}]}],Vy=[...Yf,{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"}]}],Qf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Jf=[{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"}]}],ed=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],td=[{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"}],Er=[{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"}]}],Gy="0x82ad56cb",nd="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",qy="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Zy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Aa="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class $a 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 rd extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Na="/docs/contract/encodeDeployData";function Ca(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 Gb({docsPath:Na});if(!("inputs"in o))throw new fu({docsPath:Na});if(!o.inputs||o.inputs.length===0)throw new fu({docsPath:Na});const s=gn(o.inputs,n);return dr([r,s])}function Sr({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 $a({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new $a({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function od(e,{docsPath:t,...n}){const r=(()=>{const o=ys(e,n);return o instanceof So?e:o})();return new Ju(r,{docsPath:t,...n})}function sd(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const Oa=new Map;function id({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=a();i();const f=u.map(({args:d})=>d);f.length!==0&&e(f).then(d=>{o&&Array.isArray(d)&&d.sort(o);for(let p=0;p<u.length;p++){const{resolve:h}=u[p];h==null||h([d[p],d])}}).catch(d=>{for(let p=0;p<u.length;p++){const{reject:h}=u[p];h==null||h(d)}})},i=()=>Oa.delete(t),c=()=>a().map(({args:u})=>u),a=()=>Oa.get(t)||[],l=u=>Oa.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:f,resolve:d,reject:p}=sd();return(n==null?void 0:n([...c(),u]))&&s(),a().length>0?(l({args:u,resolve:d,reject:p}),f):(l({args:u,resolve:d,reject:p}),setTimeout(s,r),f)}}}async function Pr(e,t){var O,k,y,C;const{account:n=e.account,authorizationList:r,batch:o=!!((O=e.batch)!=null&&O.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:c,blobs:a,blockOverrides:l,code:u,data:f,factory:d,factoryData:p,gas:h,gasPrice:b,maxFeePerBlobGas:S,maxFeePerGas:P,maxPriorityFeePerGas:x,nonce:w,to:A,value:M,stateOverride:B,...F}=t,m=n?tt(n):void 0;if(u&&(d||p))throw new V("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&A)throw new V("Cannot provide both `code` & `to` as parameters.");const g=u&&f,v=d&&p&&A&&f,$=g||v,N=g?ad({code:u,data:f}):v?Xy({data:f,factory:d,factoryData:p,to:A}):f;try{yr(t);const T=(typeof s=="bigint"?Q(s):void 0)||i,L=l?Kf(l):void 0,j=ia(B),z=(C=(y=(k=e.chain)==null?void 0:k.formatters)==null?void 0:y.transactionRequest)==null?void 0:C.format,H=(z||Po)({...vs(F,{format:z}),accessList:c,account:m,authorizationList:r,blobs:a,data:N,gas:h,gasPrice:b,maxFeePerBlobGas:S,maxFeePerGas:P,maxPriorityFeePerGas:x,nonce:w,to:$?void 0:A,value:M},"call");if(o&&Ky({request:H})&&!j&&!L)try{return await Yy(e,{...H,blockNumber:s,blockTag:i})}catch(W){if(!(W instanceof rd)&&!(W instanceof $a))throw W}const Y=(()=>{const W=[H,T];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(I){const T=Qy(I),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>Xv);if(e.ccipRead!==!1&&(T==null?void 0:T.slice(0,10))===j&&A)return{data:await L(e,{data:T,to:A})};throw $&&(T==null?void 0:T.slice(0,10))==="0x101bb98d"?new Ng({factory:d}):od(I,{...t,account:m,chain:e.chain})}}function Ky({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Gy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Yy(e,t){var b;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((b=e.batch)==null?void 0:b.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 Sr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new rd})(),f=(typeof s=="bigint"?Q(s):void 0)||i,{schedule:d}=id({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch(S){return S.reduce((x,{data:w})=>x+(w.length-2),0)>n*2},fn:async S=>{const P=S.map(A=>({allowFailure:!0,callData:A.data,target:A.to})),x=lt({abi:xr,args:[P],functionName:"aggregate3"}),w=await e.request({method:"eth_call",params:[{...l===null?{data:ad({code:Aa,data:x})}:{to:l,data:x}},f]});return xn({abi:xr,args:[P],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:p,success:h}]=await d({data:c,to:a});if(!h)throw new ms({data:p});return p==="0x"?{data:void 0}:{data:p}}function ad(e){const{code:t,data:n}=e;return Ca({abi:iu(["constructor(bytes, bytes)"]),bytecode:nd,args:[t,n]})}function Xy(e){const{data:t,factory:n,factoryData:r,to:o}=e;return Ca({abi:iu(["constructor(address, bytes, address, bytes)"]),bytecode:qy,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 Ot(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=lt({abi:n,args:o,functionName:s});try{const{data:a}=await X(e,Pr,"call")({...i,data:c,to:r});return xn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw br(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function Jy(e,t){var u;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...c}=t,a=c.account?tt(c.account):e.account,l=lt({abi:n,args:o,functionName:s});try{const{data:f}=await X(e,Pr,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...c,account:a}),d=xn({abi:n,args:o,functionName:s,data:f||"0x"}),p=n.filter(h=>"name"in h&&h.name===t.functionName);return{result:d,request:{abi:p,address:r,args:o,dataSuffix:i,functionName:s,...c,account:a}}}catch(f){throw br(f,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const Ia=new Map,cd=new Map;let ev=0;function En(e,t,n){const r=++ev,o=()=>Ia.get(e)||[],s=()=>{const u=o();Ia.set(e,u.filter(f=>f.id!==r))},i=()=>{const u=o();if(!u.some(d=>d.id===r))return;const f=cd.get(e);if(u.length===1&&f){const d=f();d instanceof Promise&&d.catch(()=>{})}s()},c=o();if(Ia.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return i;const a={};for(const u in t)a[u]=(...f)=>{var p,h;const d=o();if(d.length!==0)for(const b of d)(h=(p=b.fns)[u])==null||h.call(p,...f)};const l=n(a);return typeof l=="function"&&cd.set(e,l),i}async function ka(e){return new Promise(t=>setTimeout(t,e))}function Io(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 ka(a);const l=async()=>{o&&(await e({unpoll:s}),await ka(r),l())};l()})(),s}const tv=new Map,nv=new Map;function rv(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,tv),r=t(e,nv);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function ov(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=rv(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 sv=e=>`blockNumber.${e}`;async function ko(e,{cacheTime:t=e.cacheTime}={}){const n=await ov(()=>e.request({method:"eth_blockNumber"}),{cacheKey:sv(e.uid),cacheTime:t});return BigInt(n)}async function $s(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=>Rt(s));return!("abi"in t)||!t.abi?o:ma({abi:t.abi,logs:o,strict:n})}async function Ns(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function iv(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:d}=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 S=d??!1,P=$e(["watchContractEvent",r,o,s,e.uid,i,f,S,c]);return En(P,{onLogs:l,onError:a},x=>{let w;c!==void 0&&(w=c-1n);let A,M=!1;const B=Io(async()=>{var F;if(!M){try{A=await X(e,Uu,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:S,fromBlock:c})}catch{}M=!0;return}try{let m;if(A)m=await X(e,$s,"getFilterChanges")({filter:A});else{const g=await X(e,ko,"getBlockNumber")({});w&&w<g?m=await X(e,$f,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:w+1n,toBlock:g,strict:S}):m=[],w=g}if(m.length===0)return;if(s)x.onLogs(m);else for(const g of m)x.onLogs([g])}catch(m){A&&m instanceof yn&&(M=!1),(F=x.onError)==null||F.call(x,m)}},{emitOnBegin:!0,interval:f});return async()=>{A&&await X(e,Ns,"uninstallFilter")({filter:A}),B()}})})():(()=>{const S=d??!1,P=$e(["watchContractEvent",r,o,s,e.uid,i,f,S]);let x=!0,w=()=>x=!1;return En(P,{onLogs:l,onError:a},A=>((async()=>{try{const M=(()=>{if(e.transport.type==="fallback"){const m=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return m?m.value:e.transport}return e.transport})(),B=i?Yr({abi:n,eventName:i,args:o}):[],{unsubscribe:F}=await M.subscribe({params:["logs",{address:r,topics:B}],onData(m){var v;if(!x)return;const g=m.result;try{const{eventName:$,args:N}=ws({abi:n,data:g.data,topics:g.topics,strict:d}),O=Rt(g,{args:N,eventName:$});A.onLogs([O])}catch($){let N,O;if($ instanceof cs||$ instanceof Li){if(d)return;N=$.abiItem.name,O=(v=$.abiItem.inputs)==null?void 0:v.some(y=>!("name"in y&&y.name))}const k=Rt(g,{args:O?[]:{},eventName:N});A.onLogs([k])}},onError(m){var g;(g=A.onError)==null||g.call(A,m)}});w=F,x||w()}catch(M){a==null||a(M)}})(),()=>w()))})()}async function av(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Da(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 ka(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 cv={"0x0":"reverted","0x1":"success"};function ld(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=>Rt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Yt(e.transactionIndex):null,status:e.status?cv[e.status]:null,type:e.type?df[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Ma=256;let Cs=Ma,Os;function ud(e=11){if(!Os||Cs+e>Ma*2){Os="",Cs=0;for(let t=0;t<Ma;t++)Os+=(256+Math.random()*256|0).toString(16).substring(1)}return Os.substring(Cs,Cs+++e)}function lv(e){const{batch:t,chain:n,ccipRead:r,dataSuffix:o,key:s="base",name:i="Base Client",type:c="base"}=e,a=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),l=(n==null?void 0:n.blockTime)??12e3,u=Math.min(Math.max(Math.floor(l/2),500),4e3),f=e.pollingInterval??u,d=e.cacheTime??f,p=e.account?tt(e.account):void 0,{config:h,request:b,value:S}=e.transport({account:p,chain:n,pollingInterval:f}),P={...h,...S},x={account:p,batch:t,cacheTime:d,ccipRead:r,chain:n,dataSuffix:o,key:s,name:i,pollingInterval:f,request:b,transport:P,type:c,uid:ud(),...a?{experimental_blockTag:a}:{}};function w(A){return M=>{const B=M(A);for(const m in x)delete B[m];const F={...A,...B};return Object.assign(F,{extend:w(F)})}}return Object.assign(x,{extend:w(x)})}function La(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof Yi);return t instanceof Yi?((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 uv(e){const{abi:t,data:n}=e,r=Fn(n,0,4),o=t.find(s=>s.type==="function"&&r===Kr(St(s)));if(!o)throw new Jb(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Xr(o.inputs,Fn(n,4)):void 0}}const Ba="/docs/contract/encodeErrorResult";function fd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Rn({abi:t,args:r,name:n});if(!a)throw new pu(n,{docsPath:Ba});o=a}if(o.type!=="error")throw new pu(void 0,{docsPath:Ba});const s=St(o),i=Kr(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new Yb(o.name,{docsPath:Ba});c=gn(o.inputs,r)}return dr([i,c])}const Fa="/docs/contract/encodeFunctionResult";function fv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Rn({abi:t,name:n});if(!i)throw new ir(n,{docsPath:Fa});o=i}if(o.type!=="function")throw new ir(void 0,{docsPath:Fa});if(!o.outputs)throw new bu(o.name,{docsPath:Fa});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new gu(r)})();return gn(o.outputs,s)}const Do="x-batch-gateway:true";async function dd(e){const{data:t,ccipRequest:n}=e,{args:[r]}=uv({abi:Ta,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(Do)?await dd({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=dv(a)}})),fv({abi:Ta,functionName:"query",result:[o,s]})}function dv(e){return e.name==="HttpRequestError"&&e.status?fd({abi:Ta,errorName:"HttpError",args:[e.status,e.shortMessage]}):fd({abi:[Hu],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function pd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Pt(t)?t:null}function Ra(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=pd(n[r]),s=o?cr(o):ke(Ln(n[r]),"bytes");t=ke(At([t,s]),"bytes")}return Ae(t)}function pv(e){return`[${e.slice(2)}]`}function hv(e){const t=new Uint8Array(32).fill(0);return e?pd(e)||ke(Ln(e)):Ae(t)}function ja(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Ln(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=Ln(o[s]);i.byteLength>255&&(i=Ln(pv(hv(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 mv(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 Sr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;const f=o!=null?[Ra(s),BigInt(o)]:[Ra(s)];try{const d=lt({abi:Jf,functionName:"addr",args:f}),p={address:l,abi:Xf,functionName:"resolveWithGateways",args:[mn(ja(s)),d,i??[Do]],blockNumber:n,blockTag:r},b=await X(e,Ot,"readContract")(p);if(b[0]==="0x")return null;const S=xn({abi:Jf,args:f,functionName:"addr",data:b[0]});return S==="0x"||Mn(S)==="0x00"?null:S}catch(d){if(c)throw d;if(La(d))return null;throw d}}class bv 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 Mo extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class _a 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 gv extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const yv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,vv=/^(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>\/.*)?$/,wv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,xv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Ev(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 hd(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function md({uri:e,gatewayUrls:t}){const n=wv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=hd(t==null?void 0:t.ipfs,"https://ipfs.io"),o=hd(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(yv),{protocol:i,subpath:c,target:a,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||vv.test(e);if(e.startsWith("http")&&!u&&!f){let p=e;return t!=null&&t.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:p,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 d=e.replace(xv,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new _a({uri:e})}function bd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new bv({data:e});return e.image||e.image_url||e.image_data}async function Sv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await za({gatewayUrls:e,uri:bd(n)})}catch{throw new _a({uri:t})}}async function za({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=md({uri:t,gatewayUrls:e});if(r||await Ev(n))return n;throw new _a({uri:t})}function Pv(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 Mo({reason:"Only EIP-155 supported"});if(!i)throw new Mo({reason:"Chain ID not found"});if(!a)throw new Mo({reason:"Contract address not found"});if(!o)throw new Mo({reason:"Token ID not found"});if(!c)throw new Mo({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function Tv(e,{nft:t}){if(t.namespace==="erc721")return Ot(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 Ot(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 gv({namespace:t.namespace})}async function Av(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?$v(e,{gatewayUrls:t,record:n}):za({uri:n,gatewayUrls:t})}async function $v(e,{gatewayUrls:t,record:n}){const r=Pv(n),o=await Tv(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=md({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 za({uri:bd(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),Sv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function gd(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 Sr({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:Xf,args:[mn(ja(s)),lt({abi:Qf,functionName:"text",args:[Ra(s),o]}),i??[Do]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},p=await X(e,Ot,"readContract")(f);if(p[0]==="0x")return null;const h=xn({abi:Qf,functionName:"text",data:p[0]});return h===""?null:h}catch(f){if(c)throw f;if(La(f))return null;throw f}}async function Nv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await X(e,gd,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await Av(e,{record:a,gatewayUrls:r})}catch{return null}}async function Cv(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 Sr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:Vy,args:[n,s,i??[Do]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=X(e,Ot,"readContract"),[d]=await f(u);return d||null}catch(u){if(c)throw u;if(La(u))return null;throw u}}async function Ov(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 Sr({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,Ot,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[mn(ja(o))],blockNumber:n,blockTag:r});return a}async function yd(e,t){var S,P,x;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:d,value:p,...h}=t,b=n?tt(n):void 0;try{yr(t);const A=(typeof r=="bigint"?Q(r):void 0)||o,M=(x=(P=(S=e.chain)==null?void 0:S.formatters)==null?void 0:P.transactionRequest)==null?void 0:x.format,F=(M||Po)({...vs(h,{format:M}),account:b,blobs:s,data:i,gas:c,gasPrice:a,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:f,to:d,value:p},"createAccessList"),m=await e.request({method:"eth_createAccessList",params:[F,A]});return{accessList:m.accessList,gasUsed:BigInt(m.gasUsed)}}catch(w){throw od(w,{...t,account:b,chain:e.chain})}}async function Iv(e){const t=hs(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function vd(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),l=hs(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(p=>Yr({abi:[p],eventName:p.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 wd(e){const t=hs(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function kv(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){var i,c,a;if((i=e.batch)!=null&&i.multicall&&((a=(c=e.chain)==null?void 0:c.contracts)!=null&&a.multicall3)){const l=e.chain.contracts.multicall3.address,u=lt({abi:xr,functionName:"getEthBalance",args:[t]}),{data:f}=await X(e,Pr,"call")({to:l,data:u,blockNumber:n,blockTag:r});return xn({abi:xr,functionName:"getEthBalance",args:[t],data:f||"0x"})}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 Dv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Mv(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}),Yt(s)}async function Is(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}async function Lv(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=await Is(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(o&&ve(o)===23&&o.startsWith("0xef0100"))return Qt(Fn(o,3,23))}class Bv 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 Fv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,l,u,f]=await X(e,Ot,"readContract")({abi:Rv,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 Bv({address:n}):i}}const Rv=[{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 jv(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 _v(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 jv(i)}async function zv(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Rt(s));return t.abi?ma({abi:t.abi,logs:o,strict:n}):o}async function Uv({address:e,authorization:t,signature:n}){return To(Qt(e),await af({authorization:t,signature:n}))}const ks=new ds(8192);function Wv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(ks.get(n))return ks.get(n);const r=e().finally(()=>ks.delete(n));return ks.set(n,r),r}function Hv(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 zn(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new zn(new Error("method not supported"),{method:l});const u=o?Gr(`${a}.${$e(n)}`):void 0;return Wv(()=>Da(async()=>{try{return await e(n)}catch(d){const p=d;switch(p.code){case to.code:throw new to(p);case no.code:throw new no(p);case ro.code:throw new ro(p,{method:n.method});case oo.code:throw new oo(p);case _n.code:throw new _n(p);case yn.code:throw new yn(p);case so.code:throw new so(p);case io.code:throw new io(p);case ao.code:throw new ao(p);case zn.code:throw new zn(p,{method:n.method});case hr.code:throw new hr(p);case co.code:throw new co(p);case mr.code:throw new mr(p);case lo.code:throw new lo(p);case uo.code:throw new uo(p);case fo.code:throw new fo(p);case po.code:throw new po(p);case ho.code:throw new ho(p);case mo.code:throw new mo(p);case bo.code:throw new bo(p);case go.code:throw new go(p);case yo.code:throw new yo(p);case vo.code:throw new vo(p);case wo.code:throw new wo(p);case xo.code:throw new xo(p);case 5e3:throw new mr(p);case Eo.code:throw new Eo(p);default:throw d instanceof V?d:new Og(p)}}},{delay:({count:d,error:p})=>{var h;if(p&&p instanceof jn){const b=(h=p==null?void 0:p.headers)==null?void 0:h.get("Retry-After");if(b!=null&&b.match(/\d/))return Number.parseInt(b,10)*1e3}return~~(1<<d)*i},retryCount:c,shouldRetry:({error:d})=>Vv(d)}),{enabled:o,id:u})}}function Vv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===hr.code||e.code===_n.code:e instanceof jn&&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 Gv 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=>` ${eo(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class qv extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${eo(n)}`,`Response: ${$e(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Zv 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 Kv="0x556f1830",xd={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 Yv(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=Zu({data:r,abi:[xd]}),[i,c,a,l,u]=s,{ccipRead:f}=e,d=f&&typeof(f==null?void 0:f.request)=="function"?f.request:Ed;try{if(!To(o,i))throw new Zv({sender:i,to:o});const p=c.includes(Do)?await dd({data:a,ccipRequest:d}):await d({data:a,sender:i,urls:c}),{data:h}=await Pr(e,{blockNumber:t,blockTag:n,data:At([l,gn([{type:"bytes"},{type:"bytes"}],[p,u])]),to:o});return h}catch(p){throw new Gv({callbackSelector:l,cause:p,data:r,extraData:u,sender:i,urls:c})}}async function Ed({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 jn({body:a,details:f!=null&&f.error?$e(f.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Pt(f)){r=new qv({result:f,url:i});continue}return f}catch(u){r=new jn({body:a,details:u.message,url:i})}}throw r}const Xv=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Ed,offchainLookup:Yv,offchainLookupAbiItem:xd,offchainLookupSignature:Kv},Symbol.toStringTag,{value:"Module"}));function Qv(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return o=>{const s=typeof o=="function"?o(r):o,i={...r,...s};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function Jv(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 ew(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Sd=ew();function tw(e,t={}){const{url:n,headers:r}=nw(e);return{async request(o){var h;const{body:s,fetchFn:i=t.fetchFn??fetch,onRequest:c=t.onRequest,onResponse:a=t.onResponse,timeout:l=t.timeout??1e4}=o,u={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:f,method:d,signal:p}=u;try{const b=await Jv(async({signal:P})=>{const x={...u,body:Array.isArray(s)?$e(s.map(B=>({jsonrpc:"2.0",id:B.id??Sd.take(),...B}))):$e({jsonrpc:"2.0",id:s.id??Sd.take(),...s}),headers:{...r,"Content-Type":"application/json",...f},method:d||"POST",signal:p||(l>0?P:null)},w=new Request(n,x),A=await(c==null?void 0:c(w,x))??{...x,url:n};return await i(A.url??n,A)},{errorInstance:new tf({body:s,url:n}),timeout:l,signal:!0});a&&await a(b);let S;if((h=b.headers.get("Content-Type"))!=null&&h.startsWith("application/json"))S=await b.json();else{S=await b.text();try{S=JSON.parse(S||"{}")}catch(P){if(b.ok)throw P;S={error:S}}}if(!b.ok)throw new jn({body:s,details:$e(S.error)||b.statusText,headers:b.headers,status:b.status,url:n});return S}catch(b){throw b instanceof jn||b instanceof tf?b:new jn({body:s,cause:b,url:n})}}}}function nw(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const rw=`Ethereum Signed Message:
|
|
89
|
+
`;function ow(e){const t=typeof e=="string"?Gr(e):typeof e.raw=="string"?e.raw:Ae(e.raw),n=Gr(`${rw}${ve(t)}`);return At([n,t])}function Pd(e,t){return ke(ow(e),t)}class sw extends V{constructor({domain:t}){super(`Invalid domain "${$e(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class iw 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 aw extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function cw(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],d=u.match(Ru);if(d&&(typeof f=="number"||typeof f=="bigint")){const[b,S,P]=d;Q(f,{signed:S==="int",size:Number.parseInt(P,10)/8})}if(u==="address"&&typeof f=="string"&&!ct(f))throw new bn({address:f});const p=u.match(q1);if(p){const[b,S]=p;if(S&&ve(f)!==Number.parseInt(S,10))throw new t1({expectedSize:Number.parseInt(S,10),givenSize:ve(f)})}const h=o[u];h&&(uw(u),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new sw({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new iw({primaryType:r,types:o})}function lw({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 uw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new aw({type:e})}function fw(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:lw({domain:t}),...e.types};cw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(dw({domain:t,types:o})),r!=="EIP712Domain"&&s.push(Td({data:n,primaryType:r,types:o})),ke(At(s))}function dw({domain:e,types:t}){return Td({data:e,primaryType:"EIP712Domain",types:t})}function Td({data:e,primaryType:t,types:n}){const r=Ad({data:e,primaryType:t,types:n});return ke(r)}function Ad({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[pw({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=Nd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return gn(r,o)}function pw({primaryType:e,types:t}){const n=mn(hw({primaryType:e,types:t}));return ke(n)}function hw({primaryType:e,types:t}){let n="";const r=$d({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 $d({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])$d({primaryType:s.type,types:t},n);return n}function Nd({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},ke(Ad({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},ke(r)];if(n==="string")return[{type:"bytes32"},ke(mn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>Nd({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},ke(gn(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class mw 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 Ua={checksum:new mw(8192)}.checksum;class Cd extends Ri{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,S1(t);const r=us(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),fr(s)}update(t){return ur(this),this.iHash.update(t),this}digestInto(t){ur(this),Bn(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 Od=(e,t,n)=>new Cd(e,t).update(n).digest();Od.create=(e,t)=>new Cd(e,t);function Id(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Du(Ty(e));return n==="Bytes"?r:Ct(r)}const bw=/^0x[a-fA-F0-9]{40}$/;function Ds(e,t={}){const{strict:n=!0}=t;if(!bw.test(e))throw new Dd({address:e,cause:new gw});if(n){if(e.toLowerCase()===e)return;if(kd(e)!==e)throw new Dd({address:e,cause:new yw})}}function kd(e){if(Ua.has(e))return Ua.get(e);Ds(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=Id($y(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 Ua.set(e,o),o}function Wa(e,t={}){const{strict:n=!0}=t??{};try{return Ds(e,{strict:n}),!0}catch{return!1}}class Dd extends te{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 gw extends te{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 yw extends te{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const vw=/^(.*)\[([0-9]*)\]$/,ww=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Md=/^(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)?$/,Ld=2n**256n-1n;function Tr(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=qa(t.type);if(s){const[i,c]=s;return Ew(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return Aw(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return xw(e,{checksum:r});if(t.type==="bool")return Sw(e);if(t.type.startsWith("bytes"))return Pw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Tw(e,t);if(t.type==="string")return $w(e,{staticPosition:o});throw new Ya(t.type)}const Bd=32,Ha=32;function xw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?kd(s):s)(Ct(Cy(r,-20))),32]}function Ew(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=nn(e.readBytes(Ha)),l=s+a,u=l+Bd;e.setPosition(l);const f=nn(e.readBytes(Bd)),d=Lo(t);let p=0;const h=[];for(let b=0;b<f;++b){e.setPosition(u+(d?b*32:p));const[S,P]=Tr(e,t,{checksumAddress:r,staticPosition:u});p+=P,h.push(S)}return e.setPosition(s+32),[h,32]}if(Lo(t)){const a=nn(e.readBytes(Ha)),l=s+a,u=[];for(let f=0;f<o;++f){e.setPosition(l+f*32);const[d]=Tr(e,t,{checksumAddress:r,staticPosition:l});u.push(d)}return e.setPosition(s+32),[u,32]}let i=0;const c=[];for(let a=0;a<o;++a){const[l,u]=Tr(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,c.push(l)}return[c,i]}function Sw(e){return[Iy(e.readBytes(32),{size:32}),32]}function Pw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=nn(e.readBytes(32));e.setPosition(n+i);const c=nn(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Ct(a),32]}return[Ct(e.readBytes(Number.parseInt(o,10),32)),32]}function Tw(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?Oy(o,{signed:n}):nn(o,{signed:n}),32]}function Aw(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(Lo(t)){const a=nn(e.readBytes(Ha)),l=o+a;for(let u=0;u<t.components.length;++u){const f=t.components[u];e.setPosition(l+c);const[d,p]=Tr(e,f,{checksumAddress:r,staticPosition:l});c+=p,i[s?u:f==null?void 0:f.name]=d}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const l=t.components[a],[u,f]=Tr(e,l,{checksumAddress:r,staticPosition:o});i[s?a:l==null?void 0:l.name]=u,c+=f}return[i,c]}function $w(e,{staticPosition:t}){const n=nn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=nn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=ky(zf(s));return e.setPosition(t+32),[i,32]}function Nw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(Va({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function Va({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=qa(r.type);if(o){const[s,i]=o;return Ow(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Lw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Cw(n,{checksum:e});if(r.type==="bool")return kw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Md.exec(r.type)??[];return Dw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Iw(n,{type:r.type});if(r.type==="string")return Mw(n);throw new Ya(r.type)}function Ga(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=nt(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(Be(t+o,{size:32})),r.push(c),o+=nt(c)):n.push(c)}return Nt(...n,...r)}function Cw(e,t){const{checksum:n=!1}=t;return Ds(e,{strict:n}),{dynamic:!1,encoded:Wn(e.toLowerCase())}}function Ow(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new Hw(e);if(!s&&e.length!==r)throw new Ww({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const l=Va({checksumAddress:n,parameter:o,value:e[a]});l.dynamic&&(i=!0),c.push(l)}if(s||i){const a=Ga(c);if(s){const l=Be(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?Nt(l,a):l}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Nt(...c.map(({encoded:a})=>a))}}function Iw(e,{type:t}){const[,n]=t.split("bytes"),r=nt(e);if(!n){let o=e;return r%32!==0&&(o=Hn(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Nt(Wn(Be(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new jd({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Hn(e)}}function kw(e){if(typeof e!="boolean")throw new te(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Wn(Uf(e))}}function Dw(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 Vf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Be(e,{size:32,signed:t})}}function Mw(e){const t=Pa(e),n=Math.ceil(nt(t)/32),r=[];for(let o=0;o<n;o++)r.push(Hn(jt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Nt(Hn(Be(nt(t),{size:32})),...r)}}function Lw(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=Va({checksumAddress:n,parameter:c,value:e[a]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ga(s):Nt(...s.map(({encoded:i})=>i))}}function qa(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Lo(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(Lo);const n=qa(e.type);return!!(n&&Lo({...e,type:n[1]}))}const Bw={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 jw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Rw({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Fd({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 Fd({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 Fw(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Bw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Fd extends te{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class Rw extends te{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 jw extends te{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 _w(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?_f(t):t,i=Fw(s);if(wr(s)===0&&e.length>0)throw new Uw;if(wr(s)&&wr(s)<32)throw new zw({data:typeof t=="string"?t:Ct(t),parameters:e,size:wr(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,d]=Tr(i,u,{checksumAddress:o,staticPosition:0});c+=d,r==="Array"?a.push(f):a[u.name??l]=f}return a}function Za(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new _d({expectedLength:e.length,givenLength:t.length});const o=Nw({checksumAddress:r,parameters:e,values:t}),s=Ga(o);return s.length===0?"0x":s}function Ka(e,t){if(e.length!==t.length)throw new _d({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(Ka.encode(o,s))}return Nt(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return Ds(a),Wn(a.toLowerCase(),o?32:0)}if(n==="string")return Pa(r);if(n==="bytes")return r;if(n==="bool")return Wn(Uf(r),o?32:1);const s=n.match(Md);if(s){const[a,l,u="256"]=s,f=Number.parseInt(u,10)/8;return Be(r,{size:o?32:f,signed:l==="int"})}const i=n.match(ww);if(i){const[a,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new jd({expectedSize:Number.parseInt(l,10),value:r});return Hn(r,o?32:0)}const c=n.match(vw);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":Nt(...u)}throw new Ya(n)}e.encode=t})(Ka||(Ka={}));function Rd(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?cu(e):e}class zw extends te{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${or(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Uw extends te{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Ww extends te{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 jd extends te{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${nt(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class _d extends te{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 Hw extends te{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Ya extends te{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ve=BigInt(0),Fe=BigInt(1),Vn=BigInt(2),Vw=BigInt(3),zd=BigInt(4),Ud=BigInt(5),Wd=BigInt(8);function Ge(e,t){const n=e%t;return n>=Ve?n:t+n}function ft(e,t,n){let r=e;for(;t-- >Ve;)r*=r,r%=n;return r}function Xa(e,t){if(e===Ve)throw new Error("invert: expected non-zero number");if(t<=Ve)throw new Error("invert: expected positive modulus, got "+t);let n=Ge(e,t),r=t,o=Ve,s=Fe;for(;n!==Ve;){const c=r/n,a=r%n,l=o-s*c;r=n,n=a,o=s,s=l}if(r!==Fe)throw new Error("invert: does not exist");return Ge(o,t)}function Hd(e,t){const n=(e.ORDER+Fe)/zd,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function Gw(e,t){const n=(e.ORDER-Ud)/Wd,r=e.mul(t,Vn),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Vn),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 qw(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Fe,n=0;for(;t%Vn===Ve;)t/=Vn,n++;let r=Vn;const o=Qa(e);for(;Gd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Hd;let s=o.pow(r,t);const i=(t+Fe)/Vn;return function(a,l){if(a.is0(l))return l;if(Gd(a,l)!==1)throw new Error("Cannot find square root");let u=n,f=a.mul(a.ONE,s),d=a.pow(l,t),p=a.pow(l,i);for(;!a.eql(d,a.ONE);){if(a.is0(d))return a.ZERO;let h=1,b=a.sqr(d);for(;!a.eql(b,a.ONE);)if(h++,b=a.sqr(b),h===u)throw new Error("Cannot find square root");const S=Fe<<BigInt(u-h-1),P=a.pow(f,S);u=h,f=a.sqr(P),d=a.mul(d,f),p=a.mul(p,P)}return p}}function Zw(e){return e%zd===Vw?Hd:e%Wd===Ud?Gw:qw(e)}const Kw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Yw(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Kw.reduce((r,o)=>(r[o]="function",r),t);return Ts(e,n)}function Xw(e,t,n){if(n<Ve)throw new Error("invalid exponent, negatives unsupported");if(n===Ve)return e.ONE;if(n===Fe)return t;let r=e.ONE,o=t;for(;n>Ve;)n&Fe&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Fe;return r}function Vd(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 Gd(e,t){const n=(e.ORDER-Fe)/Vn,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 qd(e,t){t!==void 0&&qr(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Qa(e,t,n=!1,r={}){if(e<=Ve)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=qd(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:Ps(o),ZERO:Ve,ONE:Fe,create:a=>Ge(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return Ve<=a&&a<e},is0:a=>a===Ve,isOdd:a=>(a&Fe)===Fe,neg:a=>Ge(-a,e),eql:(a,l)=>a===l,sqr:a=>Ge(a*a,e),add:(a,l)=>Ge(a+l,e),sub:(a,l)=>Ge(a-l,e),mul:(a,l)=>Ge(a*l,e),pow:(a,l)=>Xw(c,a,l),div:(a,l)=>Ge(a*Xa(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>Xa(a,e),sqrt:r.sqrt||(a=>(i||(i=Zw(e)),i(c,a))),toBytes:a=>n?kf(a,s):Co(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?If(a):Un(a)},invertBatch:a=>Vd(c,a),cmov:(a,l,u)=>u?l:a});return Object.freeze(c)}function Zd(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 Kd(e){const t=Zd(e);return t+Math.ceil(t/2)}function Qw(e,t,n=!1){const r=e.length,o=Zd(t),s=Kd(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?If(e):Un(e),c=Ge(i,t-Fe)+Fe;return n?kf(c,o):Co(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Yd=BigInt(0),Ja=BigInt(1);function ec(e,t){const n=t.negate();return e?n:t}function Xd(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function tc(e,t){Xd(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=Ps(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function Qd(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+=Ja);const l=t*r,u=l+Math.abs(c)-1,f=c===0,d=c<0,p=t%2!==0;return{nextN:a,offset:u,isZero:f,isNeg:d,isNegF:p,offsetF:l}}function Jw(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 e6(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 nc=new WeakMap,Jd=new WeakMap;function rc(e){return Jd.get(e)||1}function t6(e,t){return{constTimeNegate:ec,hasPrecomputes(n){return rc(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Yd;)r&Ja&&(o=o.add(s)),s=s.double(),r>>=Ja;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=tc(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=tc(n,t);for(let a=0;a<c.windows;a++){const{nextN:l,offset:u,isZero:f,isNeg:d,isNegF:p,offsetF:h}=Qd(o,a,c);o=l,f?i=i.add(ec(p,r[h])):s=s.add(ec(d,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=tc(n,t);for(let c=0;c<i.windows&&o!==Yd;c++){const{nextN:a,offset:l,isZero:u,isNeg:f}=Qd(o,c,i);if(o=a,!u){const d=r[l];s=s.add(f?d.negate():d)}}return s},getPrecomputes(n,r,o){let s=nc.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&nc.set(r,o(s))),s},wNAFCached(n,r,o){const s=rc(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=rc(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){Xd(r,t),Jd.set(n,r),nc.delete(n)}}}function n6(e,t,n,r){Jw(n,e),e6(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=hy(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const l=Ps(a),u=new Array(Number(l)+1).fill(i),f=Math.floor((t.BITS-1)/a)*a;let d=i;for(let p=f;p>=0;p-=a){u.fill(i);for(let b=0;b<s;b++){const S=r[b],P=Number(S>>BigInt(p)&l);u[P]=u[P].add(n[b])}let h=i;for(let b=u.length-1,S=i;b>0;b--)S=S.add(u[b]),h=h.add(S);if(d=d.add(h),p!==0)for(let b=0;b<a;b++)d=d.double()}return d}function e0(e){return Yw(e.Fp),Ts(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...qd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function t0(e){e.lowS!==void 0&&$o("lowS",e.lowS),e.prehash!==void 0&&$o("prehash",e.prehash)}function r6(e){const t=e0(e);Ts(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 o6 extends Error{constructor(t=""){super(t)}}const rn={Err:o6,_tlv:{encode:(e,t)=>{const{Err:n}=rn;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=xs(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?xs(o.length/2|128):"";return xs(e)+s+o+t},decode(e,t){const{Err:n}=rn;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}=rn;if(e<on)throw new t("integer: negative integers are not allowed");let n=xs(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}=rn;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 Un(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=rn,o=ut("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}=rn,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 oc(e,t){return No(Co(e,t))}const on=BigInt(0),Oe=BigInt(1);BigInt(2);const sc=BigInt(3),s6=BigInt(4);function i6(e){const t=r6(e),{Fp:n}=t,r=Qa(t.n,t.nBitLength),o=t.toBytes||((w,A,M)=>{const B=A.toAffine();return Ss(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(w=>{const A=w.subarray(1),M=n.fromBytes(A.subarray(0,n.BYTES)),B=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:M,y:B}});function i(w){const{a:A,b:M}=t,B=n.sqr(w),F=n.mul(B,w);return n.add(n.add(F,n.mul(w,A)),M)}function c(w,A){const M=n.sqr(A),B=i(w);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,sc),s6),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(w){return Ea(w,Oe,t.n)}function f(w){const{allowedPrivateKeyLengths:A,nByteLength:M,wrapPrivateKey:B,n:F}=t;if(A&&typeof w!="bigint"){if(Ao(w)&&(w=No(w)),typeof w!="string"||!A.includes(w.length))throw new Error("invalid private key");w=w.padStart(M*2,"0")}let m;try{m=typeof w=="bigint"?w:Un(ut("private key",w,M))}catch{throw new Error("invalid private key, expected hex or "+M+" bytes, got "+typeof w)}return B&&(m=Ge(m,F)),vr("private key",m,Oe,F),m}function d(w){if(!(w instanceof b))throw new Error("ProjectivePoint expected")}const p=Mf((w,A)=>{const{px:M,py:B,pz:F}=w;if(n.eql(F,n.ONE))return{x:M,y:B};const m=w.is0();A==null&&(A=m?n.ONE:n.inv(F));const g=n.mul(M,A),v=n.mul(B,A),$=n.mul(F,A);if(m)return{x:n.ZERO,y:n.ZERO};if(!n.eql($,n.ONE))throw new Error("invZ was invalid");return{x:g,y:v}}),h=Mf(w=>{if(w.is0()){if(t.allowInfinityPoint&&!n.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:A,y:M}=w.toAffine();if(!n.isValid(A)||!n.isValid(M))throw new Error("bad point: x or y not FE");if(!c(A,M))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class b{constructor(A,M,B){if(A==null||!n.isValid(A))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=A,this.py=M,this.pz=B,Object.freeze(this)}static fromAffine(A){const{x:M,y:B}=A||{};if(!A||!n.isValid(M)||!n.isValid(B))throw new Error("invalid affine point");if(A instanceof b)throw new Error("projective point not allowed");const F=m=>n.eql(m,n.ZERO);return F(M)&&F(B)?b.ZERO:new b(M,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const M=Vd(n,A.map(B=>B.pz));return A.map((B,F)=>B.toAffine(M[F])).map(b.fromAffine)}static fromHex(A){const M=b.fromAffine(s(ut("pointHex",A)));return M.assertValidity(),M}static fromPrivateKey(A){return b.BASE.multiply(f(A))}static msm(A,M){return n6(b,r,A,M)}_setWindowSize(A){x.setWindowSize(this,A)}assertValidity(){h(this)}hasEvenY(){const{y:A}=this.toAffine();if(n.isOdd)return!n.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){d(A);const{px:M,py:B,pz:F}=this,{px:m,py:g,pz:v}=A,$=n.eql(n.mul(M,v),n.mul(m,F)),N=n.eql(n.mul(B,v),n.mul(g,F));return $&&N}negate(){return new b(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:M}=t,B=n.mul(M,sc),{px:F,py:m,pz:g}=this;let v=n.ZERO,$=n.ZERO,N=n.ZERO,O=n.mul(F,F),k=n.mul(m,m),y=n.mul(g,g),C=n.mul(F,m);return C=n.add(C,C),N=n.mul(F,g),N=n.add(N,N),v=n.mul(A,N),$=n.mul(B,y),$=n.add(v,$),v=n.sub(k,$),$=n.add(k,$),$=n.mul(v,$),v=n.mul(C,v),N=n.mul(B,N),y=n.mul(A,y),C=n.sub(O,y),C=n.mul(A,C),C=n.add(C,N),N=n.add(O,O),O=n.add(N,O),O=n.add(O,y),O=n.mul(O,C),$=n.add($,O),y=n.mul(m,g),y=n.add(y,y),O=n.mul(y,C),v=n.sub(v,O),N=n.mul(y,k),N=n.add(N,N),N=n.add(N,N),new b(v,$,N)}add(A){d(A);const{px:M,py:B,pz:F}=this,{px:m,py:g,pz:v}=A;let $=n.ZERO,N=n.ZERO,O=n.ZERO;const k=t.a,y=n.mul(t.b,sc);let C=n.mul(M,m),I=n.mul(B,g),T=n.mul(F,v),L=n.add(M,B),j=n.add(m,g);L=n.mul(L,j),j=n.add(C,I),L=n.sub(L,j),j=n.add(M,F);let z=n.add(m,v);return j=n.mul(j,z),z=n.add(C,T),j=n.sub(j,z),z=n.add(B,F),$=n.add(g,v),z=n.mul(z,$),$=n.add(I,T),z=n.sub(z,$),O=n.mul(k,j),$=n.mul(y,T),O=n.add($,O),$=n.sub(I,O),O=n.add(I,O),N=n.mul($,O),I=n.add(C,C),I=n.add(I,C),T=n.mul(k,T),j=n.mul(y,j),I=n.add(I,T),T=n.sub(C,T),T=n.mul(k,T),j=n.add(j,T),C=n.mul(I,j),N=n.add(N,C),C=n.mul(z,j),$=n.mul(L,$),$=n.sub($,C),C=n.mul(L,I),O=n.mul(z,O),O=n.add(O,C),new b($,N,O)}subtract(A){return this.add(A.negate())}is0(){return this.equals(b.ZERO)}wNAF(A){return x.wNAFCached(this,A,b.normalizeZ)}multiplyUnsafe(A){const{endo:M,n:B}=t;vr("scalar",A,on,B);const F=b.ZERO;if(A===on)return F;if(this.is0()||A===Oe)return this;if(!M||x.hasPrecomputes(this))return x.wNAFCachedUnsafe(this,A,b.normalizeZ);let{k1neg:m,k1:g,k2neg:v,k2:$}=M.splitScalar(A),N=F,O=F,k=this;for(;g>on||$>on;)g&Oe&&(N=N.add(k)),$&Oe&&(O=O.add(k)),k=k.double(),g>>=Oe,$>>=Oe;return m&&(N=N.negate()),v&&(O=O.negate()),O=new b(n.mul(O.px,M.beta),O.py,O.pz),N.add(O)}multiply(A){const{endo:M,n:B}=t;vr("scalar",A,Oe,B);let F,m;if(M){const{k1neg:g,k1:v,k2neg:$,k2:N}=M.splitScalar(A);let{p:O,f:k}=this.wNAF(v),{p:y,f:C}=this.wNAF(N);O=x.constTimeNegate(g,O),y=x.constTimeNegate($,y),y=new b(n.mul(y.px,M.beta),y.py,y.pz),F=O.add(y),m=k.add(C)}else{const{p:g,f:v}=this.wNAF(A);F=g,m=v}return b.normalizeZ([F,m])[0]}multiplyAndAddUnsafe(A,M,B){const F=b.BASE,m=(v,$)=>$===on||$===Oe||!v.equals(F)?v.multiplyUnsafe($):v.multiply($),g=m(this,M).add(m(A,B));return g.is0()?void 0:g}toAffine(A){return p(this,A)}isTorsionFree(){const{h:A,isTorsionFree:M}=t;if(A===Oe)return!0;if(M)return M(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:M}=t;return A===Oe?this:M?M(b,this):this.multiplyUnsafe(t.h)}toRawBytes(A=!0){return $o("isCompressed",A),this.assertValidity(),o(b,this,A)}toHex(A=!0){return $o("isCompressed",A),No(this.toRawBytes(A))}}b.BASE=new b(t.Gx,t.Gy,n.ONE),b.ZERO=new b(n.ZERO,n.ONE,n.ZERO);const{endo:S,nBitLength:P}=t,x=t6(b,S?Math.ceil(P/2):P);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:u}}function a6(e){const t=e0(e);return Ts(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function c6(e){const t=a6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(y){return Ge(y,r)}function l(y){return Xa(y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:p}=i6({...t,toBytes(y,C,I){const T=C.toAffine(),L=n.toBytes(T.x),j=Ss;return $o("isCompressed",I),I?j(Uint8Array.from([C.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(T.y))},fromBytes(y){const C=y.length,I=y[0],T=y.subarray(1);if(C===i&&(I===2||I===3)){const L=Un(T);if(!Ea(L,Oe,n.ORDER))throw new Error("Point is not on curve");const j=d(L);let z;try{z=n.sqrt(j)}catch(Y){const G=Y instanceof Error?": "+Y.message:"";throw new Error("Point is not on curve"+G)}const _=(z&Oe)===Oe;return(I&1)===1!==_&&(z=n.neg(z)),{x:L,y:z}}else if(C===c&&I===4){const L=n.fromBytes(T.subarray(0,n.BYTES)),j=n.fromBytes(T.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 "+C)}}});function h(y){const C=r>>Oe;return y>C}function b(y){return h(y)?a(-y):y}const S=(y,C,I)=>Un(y.slice(C,I));class P{constructor(C,I,T){vr("r",C,Oe,r),vr("s",I,Oe,r),this.r=C,this.s=I,T!=null&&(this.recovery=T),Object.freeze(this)}static fromCompact(C){const I=o;return C=ut("compactSignature",C,I*2),new P(S(C,0,I),S(C,I,2*I))}static fromDER(C){const{r:I,s:T}=rn.toSig(ut("DER",C));return new P(I,T)}assertValidity(){}addRecoveryBit(C){return new P(this.r,this.s,C)}recoverPublicKey(C){const{r:I,s:T,recovery:L}=this,j=F(ut("msgHash",C));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?I+t.n:I;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=L&1?"03":"02",H=u.fromHex(_+oc(z,n.BYTES)),Y=l(z),G=a(-j*Y),W=a(T*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 P(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Es(this.toDERHex())}toDERHex(){return rn.hexFromSig(this)}toCompactRawBytes(){return Es(this.toCompactHex())}toCompactHex(){const C=o;return oc(this.r,C)+oc(this.s,C)}}const x={isValidPrivateKey(y){try{return f(y),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const y=Kd(t.n);return Qw(t.randomBytes(y),t.n)},precompute(y=8,C=u.BASE){return C._setWindowSize(y),C.multiply(BigInt(3)),C}};function w(y,C=!0){return u.fromPrivateKey(y).toRawBytes(C)}function A(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const I=ut("key",y).length,T=n.BYTES,L=T+1,j=2*T+1;if(!(t.allowedPrivateKeyLengths||o===L))return I===L||I===j}function M(y,C,I=!0){if(A(y)===!0)throw new Error("first arg must be private key");if(A(C)===!1)throw new Error("second arg must be public key");return u.fromHex(C).multiply(f(y)).toRawBytes(I)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const C=Un(y),I=y.length*8-s;return I>0?C>>BigInt(I):C},F=t.bits2int_modN||function(y){return a(B(y))},m=Ps(s);function g(y){return vr("num < 2^"+s,y,on,m),Co(y,o)}function v(y,C,I=$){if(["recovered","canonical"].some(ee=>ee in I))throw new Error("sign() legacy options not supported");const{hash:T,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:_}=I;j==null&&(j=!0),y=ut("msgHash",y),t0(I),z&&(y=ut("prehashed msgHash",T(y)));const H=F(y),Y=f(C),G=[g(Y),g(H)];if(_!=null&&_!==!1){const ee=_===!0?L(n.BYTES):_;G.push(ut("extraEntropy",ee))}const W=Ss(...G),Z=H;function J(ee){const fe=B(ee);if(!p(fe))return;const pe=l(fe),he=u.BASE.multiply(fe).toAffine(),ie=a(he.x);if(ie===on)return;const me=a(pe*a(Z+ie*Y));if(me===on)return;let ne=(he.x===ie?0:2)|Number(he.y&Oe),Se=me;return j&&h(me)&&(Se=b(me),ne^=1),new P(ie,Se,ne)}return{seed:W,k2sig:J}}const $={lowS:t.lowS,prehash:!1},N={lowS:t.lowS,prehash:!1};function O(y,C,I=$){const{seed:T,k2sig:L}=v(y,C,I),j=t;return my(j.hash.outputLen,j.nByteLength,j.hmac)(T,L)}u.BASE._setWindowSize(8);function k(y,C,I,T=N){var ne;const L=y;C=ut("msgHash",C),I=ut("publicKey",I);const{lowS:j,prehash:z,format:_}=T;if(t0(T),"strict"in T)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"||Ao(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 P(L.r,L.s)),H){try{_!=="compact"&&(G=P.fromDER(L))}catch(Se){if(!(Se instanceof rn.Err))throw Se}!G&&_!=="der"&&(G=P.fromCompact(L))}W=u.fromHex(I)}catch{return!1}if(!G||j&&G.hasHighS())return!1;z&&(C=t.hash(C));const{r:Z,s:J}=G,ee=F(C),fe=l(J),pe=a(ee*fe),he=a(Z*fe),ie=(ne=u.BASE.multiplyAndAddUnsafe(W,pe,he))==null?void 0:ne.toAffine();return ie?a(ie.x)===Z:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:M,sign:O,verify:k,ProjectivePoint:u,Signature:P,utils:x}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function l6(e){return{hash:e,hmac:(t,...n)=>Od(e,t,C1(...n)),randomBytes:O1}}function u6(e,t){const n=r=>c6({...e,...l6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const n0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),r0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f6=BigInt(0),d6=BigInt(1),ic=BigInt(2),o0=(e,t)=>(e+t/ic)/t;function p6(e){const t=n0,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=ft(u,n,t)*u%t,d=ft(f,n,t)*u%t,p=ft(d,ic,t)*l%t,h=ft(p,o,t)*p%t,b=ft(h,s,t)*h%t,S=ft(b,c,t)*b%t,P=ft(S,a,t)*S%t,x=ft(P,c,t)*b%t,w=ft(x,n,t)*u%t,A=ft(w,i,t)*h%t,M=ft(A,r,t)*l%t,B=ft(M,ic,t);if(!ac.eql(ac.sqr(B),e))throw new Error("Cannot find square root");return B}const ac=Qa(n0,void 0,void 0,{sqrt:p6}),s0=u6({a:f6,b:BigInt(7),Fp:ac,n:r0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=r0,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-d6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=o0(s*e,t),a=o0(-r*e,t);let l=Ge(e-c*n-a*o,t),u=Ge(-c*r-a*s,t);const f=l>i,d=u>i;if(f&&(l=t-l),d&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:l,k2neg:d,k2:u}}}},yf),h6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:s0},Symbol.toStringTag,{value:"Module"}));function i0(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new lc({signature:e});if(typeof e.s>"u")throw new lc({signature:e});if(n&&typeof e.yParity>"u")throw new lc({signature:e});if(e.r<0n||e.r>Ld)throw new x6({value:e.r});if(e.s<0n||e.s>Ld)throw new E6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new uc({value:e.yParity})}function m6(e){return a0(Ct(e))}function a0(e){if(e.length!==130&&e.length!==132)throw new w6({signature:e});const t=BigInt(jt(e,0,32)),n=BigInt(jt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return cc(o)}catch{throw new uc({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function b6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return g6(e)}function g6(e){const t=typeof e=="string"?a0(e):e instanceof Uint8Array?m6(e):typeof e.r=="string"?v6(e):e.v?y6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return i0(t),t}function y6(e){return{r:e.r,s:e.s,yParity:cc(e.v)}}function v6(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=cc(n)),typeof r!="number")throw new uc({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function cc(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 S6({value:e})}class w6 extends te{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${nt(_y(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class lc extends te{constructor({signature:t}){super(`Signature \`${jf(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class x6 extends te{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 E6 extends te{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 uc extends te{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 S6 extends te{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"?T6(e):{...e,...t.signature}}function T6(e){const{address:t,chainId:n,nonce:r}=e,o=b6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const A6="0x8010801080108010801080108010801080108010801080108010801080108010",$6=Rd("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function c0(e){if(typeof e=="string"){if(jt(e,-32)!==A6)throw new O6(e)}else i0(e.authorization)}function N6(e){c0(e);const t=Hf(jt(e,-64,-32)),n=jt(e,-t-64,-64),r=jt(e,0,-t-64),[o,s,i]=_w($6,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 C6(e){try{return c0(e),!0}catch{return!1}}let O6=class extends te{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 I6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function k6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new I6({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 D6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function M6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Yt(e.nonce):void 0,storageProof:e.storageProof?D6(e.storageProof):void 0}}async function L6(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 M6(c)}async function B6(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 fc(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:c}){var d,p,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 Xu({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(p=(d=e.chain)==null?void 0:d.formatters)==null?void 0:p.transaction)==null?void 0:h.format)||ca)(u,"getTransaction")}async function F6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([X(e,ko,"getBlockNumber")({}),t?X(e,fc,"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 Ms(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Qu({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||ld)(n,"getTransactionReceipt")}async function R6(e,t){var x;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((x=e.batch)==null?void 0:x.multicall)=="object"?e.batch.multicall:{},d=(()=>{if(t.multicallAddress)return t.multicallAddress;if(f)return null;if(e.chain)return Sr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),p=[[]];let h=0,b=0;for(let w=0;w<l.length;w++){const{abi:A,address:M,args:B,functionName:F}=l[w];try{const m=lt({abi:A,args:B,functionName:F});b+=(m.length-2)/2,u>0&&b>u&&p[h].length>0&&(h++,b=(m.length-2)/2,p[h]=[]),p[h]=[...p[h],{allowFailure:!0,callData:m,target:M}]}catch(m){const g=br(m,{abi:A,address:M,args:B,docsPath:"/docs/contract/multicall",functionName:F,sender:n});if(!o)throw g;p[h]=[...p[h],{allowFailure:!0,callData:"0x",target:M}]}}const S=await Promise.allSettled(p.map(w=>X(e,Ot,"readContract")({...d===null?{code:Aa}:{address:d},abi:xr,account:n,args:[w],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:c,functionName:"aggregate3",stateOverride:a}))),P=[];for(let w=0;w<S.length;w++){const A=S[w];if(A.status==="rejected"){if(!o)throw A.reason;for(let B=0;B<p[w].length;B++)P.push({status:"failure",error:A.reason,result:void 0});continue}const M=A.value;for(let B=0;B<M.length;B++){const{returnData:F,success:m}=M[B],{callData:g}=p[w][B],{abi:v,address:$,functionName:N,args:O}=l[P.length];try{if(g==="0x")throw new Vr;if(!m)throw new ms({data:F});const k=xn({abi:v,args:O,data:F,functionName:N});P.push(o?{result:k,status:"success"}:k)}catch(k){const y=br(k,{abi:v,address:$,args:O,docsPath:"/docs/contract/multicall",functionName:N});if(!o)throw y;P.push({error:y,result:void 0,status:"failure"})}}}if(P.length!==l.length)throw new V("multicall results mismatch");return P}async function dc(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 d of o){const p=d.blockOverrides?Kf(d.blockOverrides):void 0,h=d.calls.map(S=>{const P=S,x=P.account?tt(P.account):void 0,w=P.abi?lt(P):P.data,A={...P,account:x,data:P.dataSuffix?At([w||"0x",P.dataSuffix]):w,from:P.from??(x==null?void 0:x.address)};return yr(A),Po(A)}),b=d.stateOverrides?ia(d.stateOverrides):void 0;a.push({blockOverrides:p,calls:h,stateOverrides:b})}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((d,p)=>({...pf(d),calls:d.calls.map((h,b)=>{var v,$;const{abi:S,args:P,functionName:x,to:w}=o[p].calls[b],A=((v=h.error)==null?void 0:v.data)??h.returnData,M=BigInt(h.gasUsed),B=($=h.logs)==null?void 0:$.map(N=>Rt(N)),F=h.status==="0x1"?"success":"failure",m=S&&F==="success"&&A!=="0x"?xn({abi:S,data:A,functionName:x}):null,g=(()=>{if(F==="success")return;let N;if(A==="0x"?N=new Vr:A&&(N=new ms({data:A})),!!N)return br(N,{abi:S??[],address:w??"0x",args:P,functionName:x??"<unknown>"})})();return{data:A,gasUsed:M,logs:B,status:F,...F==="success"?{result:m}:{error:g}}})}))}catch(a){const l=a,u=ys(l,{});throw u instanceof So?l:u}}function pc(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 te("Unable to normalize signature.");return o}function hc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Wa(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)=>hc(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=>hc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function l0(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 l0(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")?Wa(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Wa(n[r],{strict:!1}):!1)return i}}function u0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?au(e):e;return{...r,...n?{hash:Ar(r)}:{}}}function Ls(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=zy(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?f0(l)===jt(t,0,4):l.type==="event"?Ar(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new Bs({name:t});if(i.length===1)return{...i[0],...o?{hash:Ar(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:Ar(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==r.length)continue;if(r.every((f,d)=>{const p="inputs"in l&&l.inputs[d];return p?hc(f,p):!1})){if(c&&"inputs"in c&&c.inputs){const f=l0(l.inputs,c.inputs,r);if(f)throw new _6({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 Bs({name:t});return{...a,...o?{hash:Ar(a)}:{}}}function f0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ls(n,r)}return e[0]})();return jt(Ar(t),0,4)}function j6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Ls(r,o)}return e[0]})(),n=typeof t=="string"?t:ss(t);return pc(n)}function Ar(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Ls(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Id(Pa(j6(t)))}class _6 extends te{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${pc(ss(t.abiItem))}\`, and`,`\`${n.type}\` in \`${pc(ss(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 Bs extends te{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 z6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[W6(i),c]}return e})(),{bytecode:r,args:o}=n;return Nt(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Za(t.inputs,o):"0x")}function U6(e){return u0(e)}function W6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Bs({name:"constructor"});return t}function H6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,f]=e;return[d0(l,u,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?d0([t,...r],t.name,{args:n}):t,s=V6(o),i=n.length>0?Za(o.inputs,n):void 0;return i?Nt(s,i):s}function $r(e,t={}){return u0(e,t)}function d0(e,t,n){const r=Ls(e,t,n);if(r.type!=="function")throw new Bs({name:t,type:"function"});return r}function V6(e){return f0(e)}const G6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",It="0x0000000000000000000000000000000000000000",q6="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?tt(t.account):void 0;if(i&&!l)throw new V("`account` is required when `traceAssetChanges` is true");const u=l?z6(U6("constructor(bytes, bytes)"),{bytecode:nd,args:[q6,H6($r("function getBalance(address)"),[l.address])]}):void 0,f=i?await Promise.all(t.calls.map(async T=>{if(!T.data&&!T.abi)return;const{accessList:L}=await yd(e,{account:l.address,...T,data:T.abi?lt(T):T.data});return L.map(({address:j,storageKeys:z})=>z.length>0?j:null)})).then(T=>T.flat().filter(Boolean)):[],d=await dc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:f.map((T,L)=>({abi:[$r("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:T,from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]}]:[],{calls:[...o,{to:It}].map(T=>({...T,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:f.map((T,L)=>({abi:[$r("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:T,from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]},{calls:f.map((T,L)=>({to:T,abi:[$r("function decimals() returns (uint256)")],functionName:"decimals",from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]},{calls:f.map((T,L)=>({to:T,abi:[$r("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]},{calls:f.map((T,L)=>({to:T,abi:[$r("function symbol() returns (string)")],functionName:"symbol",from:It,nonce:L})),stateOverrides:[{address:It,nonce:0}]}]:[]],traceTransfers:c,validation:a}),p=i?d[2]:d[0],[h,b,,S,P,x,w,A]=i?d:[],{calls:M,...B}=p,F=M.slice(0,-1)??[],m=(h==null?void 0:h.calls)??[],g=(b==null?void 0:b.calls)??[],v=[...m,...g].map(T=>T.status==="success"?Lt(T.data):null),$=(S==null?void 0:S.calls)??[],N=(P==null?void 0:P.calls)??[],O=[...$,...N].map(T=>T.status==="success"?Lt(T.data):null),k=((x==null?void 0:x.calls)??[]).map(T=>T.status==="success"?T.result:null),y=((A==null?void 0:A.calls)??[]).map(T=>T.status==="success"?T.result:null),C=((w==null?void 0:w.calls)??[]).map(T=>T.status==="success"?T.result:null),I=[];for(const[T,L]of O.entries()){const j=v[T];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=k[T-1],_=y[T-1],H=C[T-1],Y=T===0?{address:G6,decimals:18,symbol:"ETH"}:{address:f[T-1],decimals:H||z?Number(z??1):void 0,symbol:_??void 0};I.some(G=>G.token.address===Y.address)||I.push({token:Y,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:I,block:B,results:F}}const p0="0x6492649264926492649264926492649264926492649264926492649264926492";function K6(e){if(jt(e,-32)!==p0)throw new Q6(e)}function Y6(e){const{data:t,signature:n,to:r}=e;return Nt(Za(Rd("address, bytes, bytes"),[r,t,n]),p0)}function X6(e){try{return K6(e),!0}catch{return!1}}class Q6 extends te{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 J6({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 s0.Signature(Lt(e),Lt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:Bt(i)}async function Fs(e,t){var a,l,u,f;const{address:n,chain:r=e.chain,hash:o,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??((l=(a=r==null?void 0:r.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:l.address),multicallAddress:i=t.multicallAddress??((f=(u=r==null?void 0:r.contracts)==null?void 0:u.multicall3)==null?void 0:f.address)}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const c=(()=>{const d=t.signature;return Pt(d)?d:typeof d=="object"&&"r"in d&&"s"in d?J6(d):Ae(d)})();try{return C6(c)?await e5(e,{...t,multicallAddress:i,signature:c}):await t5(e,{...t,verifierAddress:s,signature:c})}catch(d){try{if(To(Qt(n),await rf({hash:o,signature:c})))return!0}catch{}if(d instanceof Gn)return!1;throw d}}async function e5(e,t){var S;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:l,to:u}=N6(t.signature);if(await Is(e,{address:n,blockNumber:r,blockTag:o})===dr(["0xef0100",c.address]))return await n5(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:l});const d={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 Uv({address:n,authorization:d}))throw new Gn;const h=await X(e,Ot,"readContract")({...i?{address:i}:{code:Aa},authorizationList:[d],abi:xr,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:lt({abi:ed,functionName:"isValidSignature",args:[s,l]})}]]}),b=(S=h[h.length-1])==null?void 0:S.returnData;if(b!=null&&b.startsWith("0x1626ba7e"))return!0;throw new Gn}async function t5(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,l=await(async()=>!r&&!o||X6(i)?i:Y6({data:o,signature:i,to:r}))(),u=c?{to:c,data:lt({abi:td,functionName:"isValidSig",args:[n,s,l]}),...a}:{data:Ca({abi:td,args:[n,s,l],bytecode:Zy}),...a},{data:f}=await X(e,Pr,"call")(u).catch(d=>{throw d instanceof Ju?new Gn:d});if(u1(f??"0x0"))return!0;throw new Gn}async function n5(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await X(e,Ot,"readContract")({address:n,abi:ed,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof ef?new Gn:a})).startsWith("0x1626ba7e"))return!0;throw new Gn}class Gn extends Error{}async function r5(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=Pd(n);return X(e,Fs,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function o5(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:l,...u}=t,f=fw({message:i,primaryType:c,types:a,domain:l});return X(e,Fs,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...u})}function h0(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 En(f,{onBlockNumber:r,onError:o},d=>Io(async()=>{var p;try{const h=await X(e,ko,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let b=a+1n;b<h;b++)d.onBlockNumber(b,a),a=b}(a===void 0||h>a)&&(d.onBlockNumber(h,a),a=h)}catch(h){(p=d.onError)==null||p.call(d,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const f=$e(["watchBlockNumber",e.uid,t,n]);return En(f,{onBlockNumber:r,onError:o},d=>{let p=!0,h=()=>p=!1;return(async()=>{try{const b=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),{unsubscribe:S}=await b.subscribe({params:["newHeads"],onData(P){var w;if(!p)return;const x=Lt((w=P.result)==null?void 0:w.number);d.onBlockNumber(x,a),a=x},onError(P){var x;(x=d.onError)==null||x.call(d,P)}});h=S,p||h()}catch(b){o==null||o(b)}})(),()=>h()})})()}async function s5(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,d,p,h=!1,b,S;const{promise:P,resolve:x,reject:w}=sd(),A=a?setTimeout(()=>{S==null||S(),b==null||b(),w(new Tg({hash:o}))},a):void 0;return b=En(l,{onReplaced:s,resolve:x,reject:w},async M=>{if(p=await X(e,Ms,"getTransactionReceipt")({hash:o}).catch(()=>{}),p&&r<=1){clearTimeout(A),M.resolve(p),b==null||b();return}S=X(e,h0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(B){const F=g=>{clearTimeout(A),S==null||S(),g(),b==null||b()};let m=B;if(!h)try{if(p){if(r>1&&(!p.blockNumber||m-p.blockNumber+1n<r))return;F(()=>M.resolve(p));return}if(n&&!f&&(h=!0,await Da(async()=>{f=await X(e,fc,"getTransaction")({hash:o}),f.blockNumber&&(m=f.blockNumber)},{delay:c,retryCount:i}),h=!1),p=await X(e,Ms,"getTransactionReceipt")({hash:o}),r>1&&(!p.blockNumber||m-p.blockNumber+1n<r))return;F(()=>M.resolve(p))}catch(g){if(g instanceof Xu||g instanceof Qu){if(!f){h=!1;return}try{d=f,h=!0;const v=await Da(()=>X(e,$t,"getBlock")({blockNumber:m,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:O})=>O instanceof ff});h=!1;const $=v.transactions.find(({from:O,nonce:k})=>O===d.from&&k===d.nonce);if(!$||(p=await X(e,Ms,"getTransactionReceipt")({hash:$.hash}),r>1&&(!p.blockNumber||m-p.blockNumber+1n<r)))return;let N="replaced";$.to===d.to&&$.value===d.value&&$.input===d.input?N="repriced":$.from===$.to&&$.value===0n&&(N="cancelled"),F(()=>{var O;(O=M.onReplaced)==null||O.call(M,{reason:N,replacedTransaction:d,transaction:$,transactionReceipt:p}),M.resolve(p)})}catch(v){F(()=>M.reject(v))}}else F(()=>M.reject(g))}}})}),P}function i5(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 En(h,{onBlock:o,onError:s},b=>Io(async()=>{var S;try{const P=await X(e,$t,"getBlock")({blockTag:t,includeTransactions:u});if(P.number!==null&&(f==null?void 0:f.number)!=null){if(P.number===f.number)return;if(P.number-f.number>1&&n)for(let x=(f==null?void 0:f.number)+1n;x<P.number;x++){const w=await X(e,$t,"getBlock")({blockNumber:x,includeTransactions:u});b.onBlock(w,f),f=w}}((f==null?void 0:f.number)==null||t==="pending"&&(P==null?void 0:P.number)==null||P.number!==null&&P.number>f.number)&&(b.onBlock(P,f),f=P)}catch(P){(S=b.onError)==null||S.call(b,P)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,b=!0,S=()=>h=!1;return(async()=>{try{r&&X(e,$t,"getBlock")({blockTag:t,includeTransactions:u}).then(w=>{h&&b&&(o(w,void 0),b=!1)}).catch(s);const P=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return w?w.value:e.transport}return e.transport})(),{unsubscribe:x}=await P.subscribe({params:["newHeads"],async onData(w){var M;if(!h)return;const A=await X(e,$t,"getBlock")({blockNumber:(M=w.result)==null?void 0:M.number,includeTransactions:u}).catch(()=>{});h&&(o(A,f),b=!1,f=A)},onError(w){s==null||s(w)}});S=x,h||S()}catch(P){s==null||s(P)}})(),()=>S()})()}function a5(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 d=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")),p=f??!1;return d?(()=>{const S=$e(["watchEvent",t,n,r,e.uid,o,u,i]);return En(S,{onLogs:a,onError:c},P=>{let x;i!==void 0&&(x=i-1n);let w,A=!1;const M=Io(async()=>{var B;if(!A){try{w=await X(e,vd,"createEventFilter")({address:t,args:n,event:o,events:s,strict:p,fromBlock:i})}catch{}A=!0;return}try{let F;if(w)F=await X(e,$s,"getFilterChanges")({filter:w});else{const m=await X(e,ko,"getBlockNumber")({});x&&x!==m?F=await X(e,ba,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:x+1n,toBlock:m}):F=[],x=m}if(F.length===0)return;if(r)P.onLogs(F);else for(const m of F)P.onLogs([m])}catch(F){w&&F instanceof yn&&(A=!1),(B=P.onError)==null||B.call(P,F)}},{emitOnBegin:!0,interval:u});return async()=>{w&&await X(e,Ns,"uninstallFilter")({filter:w}),M()}})})():(()=>{let S=!0,P=()=>S=!1;return(async()=>{try{const x=(()=>{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})(),w=s??(o?[o]:void 0);let A=[];w&&(A=[w.flatMap(F=>Yr({abi:[F],eventName:F.name,args:n}))],o&&(A=A[0]));const{unsubscribe:M}=await x.subscribe({params:["logs",{address:t,topics:A}],onData(B){var m;if(!S)return;const F=B.result;try{const{eventName:g,args:v}=ws({abi:w??[],data:F.data,topics:F.topics,strict:p}),$=Rt(F,{args:v,eventName:g});a([$])}catch(g){let v,$;if(g instanceof cs||g instanceof Li){if(f)return;v=g.abiItem.name,$=(m=g.abiItem.inputs)==null?void 0:m.some(O=>!("name"in O&&O.name))}const N=Rt(F,{args:$?[]:{},eventName:v});a([N])}},onError(B){c==null||c(B)}});P=M,S||P()}catch(x){c==null||c(x)}})(),()=>P()})()}function c5(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 En(l,{onTransactions:r,onError:n},u=>{let f;const d=Io(async()=>{var p;try{if(!f)try{f=await X(e,wd,"createPendingTransactionFilter")({});return}catch(b){throw d(),b}const h=await X(e,$s,"getFilterChanges")({filter:f});if(h.length===0)return;if(t)u.onTransactions(h);else for(const b of h)u.onTransactions([b])}catch(h){(p=u.onError)==null||p.call(u,h)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await X(e,Ns,"uninstallFilter")({filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const p=d.result;r([p])},onError(d){n==null||n(d)}});u=f,l||u()}catch(f){n==null||n(f)}})(),()=>u()})()}function l5(e){var f,d,p;const{scheme:t,statement:n,...r}=((f=e.match(u5))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...l}=((d=e.match(f5))==null?void 0:d.groups)??{},u=(p=e.split("Resources:")[1])==null?void 0:p.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 u5=/^(?:(?<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)?/,f5=/(?: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 d5(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||!ct(r.address,{strict:!1})||t&&!To(r.address,t))return!1}catch{return!1}return!0}async function p5(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:c,time:a=new Date,...l}=t,u=l5(o);if(!u.address||!d5({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const d=Pd(o);return Fs(e,{address:u.address,hash:d,signature:c,...l})}async function h5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,a,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,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)||ld)(o);if(i.status==="reverted"&&n)throw new Pg({receipt:i});return i}function m5(e){return{call:t=>Pr(e,t),createAccessList:t=>yd(e,t),createBlockFilter:()=>Iv(e),createContractEventFilter:t=>Uu(e,t),createEventFilter:t=>vd(e,t),createPendingTransactionFilter:()=>wd(e),estimateContractGas:t=>uy(e,t),estimateGas:t=>ha(e,t),getBalance:t=>kv(e,t),getBlobBaseFee:()=>Dv(e),getBlock:t=>$t(e,t),getBlockNumber:t=>ko(e,t),getBlockTransactionCount:t=>Mv(e,t),getBytecode:t=>Is(e,t),getChainId:()=>da(e),getCode:t=>Is(e,t),getContractEvents:t=>$f(e,t),getDelegation:t=>Lv(e,t),getEip712Domain:t=>Fv(e,t),getEnsAddress:t=>mv(e,t),getEnsAvatar:t=>Nv(e,t),getEnsName:t=>Cv(e,t),getEnsResolver:t=>Ov(e,t),getEnsText:t=>gd(e,t),getFeeHistory:t=>_v(e,t),estimateFeesPerGas:t=>Gg(e,t),getFilterChanges:t=>$s(e,t),getFilterLogs:t=>zv(e,t),getGasPrice:()=>la(e),getLogs:t=>ba(e,t),getProof:t=>L6(e,t),estimateMaxPriorityFeePerGas:t=>Vg(e,t),fillTransaction:t=>Sf(e,t),getStorageAt:t=>B6(e,t),getTransaction:t=>fc(e,t),getTransactionConfirmations:t=>F6(e,t),getTransactionCount:t=>mf(e,t),getTransactionReceipt:t=>Ms(e,t),multicall:t=>R6(e,t),prepareTransactionRequest:t=>Tf(e,t),readContract:t=>Ot(e,t),sendRawTransaction:t=>av(e,t),sendRawTransactionSync:t=>h5(e,t),simulate:t=>dc(e,t),simulateBlocks:t=>dc(e,t),simulateCalls:t=>Z6(e,t),simulateContract:t=>Jy(e,t),verifyHash:t=>Fs(e,t),verifyMessage:t=>r5(e,t),verifySiweMessage:t=>p5(e,t),verifyTypedData:t=>o5(e,t),uninstallFilter:t=>Ns(e,t),waitForTransactionReceipt:t=>s5(e,t),watchBlocks:t=>i5(e,t),watchBlockNumber:t=>h0(e,t),watchContractEvent:t=>iv(e,t),watchEvent:t=>a5(e,t),watchPendingTransactions:t=>c5(e,t)}}function b5(e){const{key:t="public",name:n="Public Client"}=e;return lv({...e,key:t,name:n,type:"publicClient"}).extend(m5)}function g5({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:c},a){const l=ud();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:c},request:Hv(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:a}}class y5 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 v5(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:d,retryCount:p,timeout:h})=>{const{batchSize:b=1e3,wait:S=0}=typeof n=="object"?n:{},P=t.retryCount??p,x=h??t.timeout??1e4,w=e||(d==null?void 0:d.rpcUrls.default.http[0]);if(!w)throw new y5;const A=tw(w,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:l,timeout:x});return g5({key:s,methods:i,name:c,async request({method:M,params:B}){const F={method:M,params:B},{schedule:m}=id({id:w,wait:S,shouldSplitBatch(N){return N.length>b},fn:N=>A.request({body:N}),sort:(N,O)=>N.id-O.id}),g=async N=>n?m(N):[await A.request({body:N})],[{error:v,result:$}]=await g(F);if(f)return{error:v,result:$};if(v)throw new Xi({body:F,error:v,url:w});return $},retryCount:P,retryDelay:u,timeout:x,type:"http"},{fetchOptions:o,url:w})}}const w5=Qv({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 x5({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,c]=E.useState(null),[a,l]=E.useState(o);return E.useEffect(()=>{let u,f;const d=async()=>{try{const p=await e.readContract({address:t,abi:Er,functionName:"balanceOf",args:[n]});c(p),l(Zi(p,r))}catch{l(o)}};d();try{u=e.watchContractEvent({address:t,abi:Er,eventName:"Transfer",args:{to:n},onLogs:()=>{d()},poll:!0,pollingInterval:s}),f=e.watchContractEvent({address:t,abi:Er,eventName:"Transfer",args:{from:n},onLogs:()=>{d()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),f==null||f()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const E5=()=>({openDeposit:E.useCallback(t=>{},[])}),S5=()=>({openWithdraw:E.useCallback(t=>{},[])}),Sn="MPC",mc="EVM",P5="spot",m0="perpetual";/**
|
|
92
92
|
* @license lucide-react v0.540.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const T5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),A5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),b0=e=>{const t=A5(e);return t.charAt(0).toUpperCase()+t.slice(1)},g0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),$5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
97
97
|
* @license lucide-react v0.540.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/var
|
|
101
|
+
*/var N5={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"};/**
|
|
102
102
|
* @license lucide-react v0.540.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const C5=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},a)=>E.createElement("svg",{ref:a,...N5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:g0("lucide",o),...!s&&!$5(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,u])=>E.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
|
|
107
107
|
* @license lucide-react v0.540.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const O5=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(C5,{ref:s,iconNode:t,className:g0(`lucide-${T5(b0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=b0(e),n};/**
|
|
112
112
|
* @license lucide-react v0.540.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
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 C5=!1;function ac(){return C5}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 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 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)}),N5=rn(function(){return lc(/^iPhone/i)}),O5=rn(function(){return lc(/^iPad/i)||uc()&&navigator.maxTouchPoints>1}),I5=rn(function(){return N5()||O5()});rn(function(){return uc()||I5()}),rn(function(){return Ns(/AppleWebKit/i)&&!k5()});const k5=rn(function(){return Ns(/Chrome/i)}),D5=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?(...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,No=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)&&(No="keyboard",pc("keyboard",e))}function ut(e){No="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Vn=!0,pc("pointer",e))}function g0(e){M5(e)&&(Vn=!0,No="virtual")}function y0(e){e.target===window||e.target===document||B5||!e.isTrusted||(!Vn&&!dc&&(No="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 No!=="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(`
|
|
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(
|
|
116
|
+
*/const y0=O5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),I5=typeof document<"u"?E.useLayoutEffect:()=>{},Pn=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},qn=e=>e&&"window"in e&&e.window===e?e:Pn(e).defaultView||window;function k5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function D5(e){return k5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let M5=!1;function bc(){return M5}function Tn(e,t){if(!bc())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:D5(n)?n=n.host:n=n.parentNode}return!1}const Nr=(e=document)=>{var t;if(!bc())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 De(e){if(bc()&&e.target instanceof Element&&e.target.shadowRoot){var t,n;if("composedPath"in e)return(t=e.composedPath()[0])!==null&&t!==void 0?t:null;if("composedPath"in e.nativeEvent)return(n=e.nativeEvent.composedPath()[0])!==null&&n!==void 0?n:null}return e.target}function L5(e){if(B5())e.focus({preventScroll:!0});else{let t=F5(e);e.focus(),R5(t)}}let Rs=null;function B5(){if(Rs==null){Rs=!1;try{document.createElement("div").focus({get preventScroll(){return Rs=!0,!0}})}catch{}}return Rs}function F5(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function R5(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function js(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 gc(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 sn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Bo=sn(function(){return gc(/^Mac/i)}),j5=sn(function(){return gc(/^iPhone/i)}),v0=sn(function(){return gc(/^iPad/i)||Bo()&&navigator.maxTouchPoints>1}),_5=sn(function(){return j5()||v0()});sn(function(){return Bo()||_5()});const z5=sn(function(){return js(/AppleWebKit/i)&&!U5()}),U5=sn(function(){return js(/Chrome/i)}),W5=sn(function(){return js(/Android/i)}),H5=sn(function(){return js(/Firefox/i)});function Fo(e,t,n=!0){var r,o;let{metaKey:s,ctrlKey:i,altKey:c,shiftKey:a}=t;H5()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Bo()?s=!0:i=!0);let l=z5()&&Bo()&&!v0()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:i,altKey:c,shiftKey:a}):new MouseEvent("click",{metaKey:s,ctrlKey:i,altKey:c,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});Fo.isOpening=n,L5(e),e.dispatchEvent(l),Fo.isOpening=!1}Fo.isOpening=!1;function w0(){let e=E.useRef(new Map),t=E.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=E.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=E.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return E.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function V5(e){return e.pointerType===""&&e.isTrusted?!0:W5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function x0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function G5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function E0(e){let t=E.useRef({isFocused:!1,observer:null});return I5(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),E.useCallback(n=>{let r=De(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r,s=i=>{if(t.current.isFocused=!1,o.disabled){let c=x0(i);e==null||e(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===Nr()?null:Nr();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"]})}},[e])}let q5=!1,Ro=null;const yc=new Set;let jo=new Map,Zn=!1,vc=!1;const Z5={Tab:!0,Escape:!0};function wc(e,t){for(let n of yc)n(e,t)}function K5(e){return!(e.metaKey||!Bo()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function _s(e){Zn=!0,!Fo.isOpening&&K5(e)&&(Ro="keyboard",wc("keyboard",e))}function dt(e){Ro="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(Zn=!0,wc("pointer",e))}function S0(e){!Fo.isOpening&&V5(e)&&(Zn=!0,Ro="virtual")}function P0(e){De(e)===window||De(e)===document||q5||!e.isTrusted||(!Zn&&!vc&&(Ro="virtual",wc("virtual",e)),Zn=!1,vc=!1)}function T0(){Zn=!1,vc=!0}function xc(e){if(typeof window>"u"||typeof document>"u"||jo.get(qn(e)))return;const t=qn(e),n=Pn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Zn=!0,r.apply(this,arguments)},n.addEventListener("keydown",_s,!0),n.addEventListener("keyup",_s,!0),n.addEventListener("click",S0,!0),t.addEventListener("focus",P0,!0),t.addEventListener("blur",T0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",dt,!0),n.addEventListener("pointermove",dt,!0),n.addEventListener("pointerup",dt,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",dt,!0),n.addEventListener("mousemove",dt,!0),n.addEventListener("mouseup",dt,!0)),t.addEventListener("beforeunload",()=>{A0(e)},{once:!0}),jo.set(t,{focus:r})}const A0=(e,t)=>{const n=qn(e),r=Pn(e);t&&r.removeEventListener("DOMContentLoaded",t),jo.has(n)&&(n.HTMLElement.prototype.focus=jo.get(n).focus,r.removeEventListener("keydown",_s,!0),r.removeEventListener("keyup",_s,!0),r.removeEventListener("click",S0,!0),n.removeEventListener("focus",P0,!0),n.removeEventListener("blur",T0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",dt,!0),r.removeEventListener("pointermove",dt,!0),r.removeEventListener("pointerup",dt,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",dt,!0),r.removeEventListener("mousemove",dt,!0),r.removeEventListener("mouseup",dt,!0)),jo.delete(n))};function Y5(e){const t=Pn(e);let n;return t.readyState!=="loading"?xc(e):(n=()=>{xc(e)},t.addEventListener("DOMContentLoaded",n)),()=>A0(e,n)}typeof document<"u"&&Y5();function Ec(){return Ro!=="pointer"}const X5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Q5(e,t,n){let r=Pn(n?De(n):void 0),o=n?De(n):void 0;const s=typeof window<"u"?qn(o).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?qn(o).HTMLTextAreaElement:HTMLTextAreaElement,c=typeof window<"u"?qn(o).HTMLElement:HTMLElement,a=typeof window<"u"?qn(o).KeyboardEvent:KeyboardEvent;let l=Nr(r);return e=e||l instanceof s&&!X5.has(l.type)||l instanceof i||l instanceof c&&l.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!Z5[n.key])}function J5(e,t,n){xc(),E.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(o,s)=>{Q5(!!(n!=null&&n.isTextInput),o,s)&&e(Ec())};return yc.add(r),()=>{yc.delete(r)}},t)}function ex(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=E.useCallback(a=>{if(De(a)===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=E0(s),c=E.useCallback(a=>{let l=De(a);const u=Pn(l),f=u?Nr(u):Nr();l===a.currentTarget&&l===f&&(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 tx(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=E.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=w0(),a=E.useCallback(f=>{Tn(f.currentTarget,De(f))&&s.current.isFocusWithin&&!Tn(f.currentTarget,f.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(f),o&&o(!1))},[n,o,s,c]),l=E0(a),u=E.useCallback(f=>{if(!Tn(f.currentTarget,De(f)))return;let d=De(f);const p=Pn(d),h=Nr(p);if(!s.current.isFocusWithin&&h===d){r&&r(f),o&&o(!0),s.current.isFocusWithin=!0,l(f);let b=f.currentTarget;i(p,"focus",S=>{let P=De(S);if(s.current.isFocusWithin&&!Tn(b,P)){let x=new p.defaultView.FocusEvent("blur",{relatedTarget:P});G5(x,b);let w=x0(x);a(w)}},{capture:!0})}},[r,o,l,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let zs=!1,Us=0;function Sc(){zs=!0,setTimeout(()=>{zs=!1},50)}function $0(e){e.pointerType==="touch"&&Sc()}function nx(){if(!(typeof document>"u"))return Us===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",$0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Sc)),Us++,()=>{Us--,!(Us>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",$0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Sc))}}function rx(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=E.useState(!1),c=E.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;E.useEffect(nx,[]);let{addGlobalListener:a,removeAllGlobalListeners:l}=w0(),{hoverProps:u,triggerHoverEnd:f}=E.useMemo(()=>{let d=(b,S)=>{if(c.pointerType=S,o||S==="touch"||c.isHovered||!Tn(b.currentTarget,De(b)))return;c.isHovered=!0;let P=b.currentTarget;c.target=P,a(Pn(De(b)),"pointerover",x=>{c.isHovered&&c.target&&!Tn(c.target,De(x))&&p(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:P,pointerType:S}),n&&n(!0),i(!0)},p=(b,S)=>{let P=c.target;c.pointerType="",c.target=null,!(S==="touch"||!c.isHovered||!P)&&(c.isHovered=!1,l(),r&&r({type:"hoverend",target:P,pointerType:S}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=b=>{zs&&b.pointerType==="mouse"||d(b,b.pointerType)},h.onPointerLeave=b=>{!o&&Tn(b.currentTarget,De(b))&&p(b,b.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{c.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=b=>{!c.ignoreEmulatedMouseEvents&&!zs&&d(b,"mouse"),c.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=b=>{!o&&Tn(b.currentTarget,De(b))&&p(b,"mouse")}),{hoverProps:h,triggerHoverEnd:p}},[t,n,r,o,c,a,l]);return E.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:u,isHovered:s}}function ox(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=E.useRef({isFocused:!1,isFocusVisible:t||Ec()}),[s,i]=E.useState(!1),[c,a]=E.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=E.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=E.useCallback(p=>{o.current.isFocused=p,o.current.isFocusVisible=Ec(),i(p),l()},[l]);J5(p=>{o.current.isFocusVisible=p,l()},[n,s],{enabled:s,isTextInput:n});let{focusProps:f}=ex({isDisabled:r,onFocusChange:u}),{focusWithinProps:d}=tx({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:c,focusProps:r?d:f}}var sx=Object.defineProperty,ix=(e,t,n)=>t in e?sx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pc=(e,t,n)=>(ix(e,typeof t!="symbol"?t+"":t,n),n);let ax=class{constructor(){Pc(this,"current",this.detect()),Pc(this,"handoffState","pending"),Pc(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"}},_t=new ax;function Ws(e){var t;return _t.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Hs(e){var t,n;return _t.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function N0(e){var t,n;return(n=(t=Hs(e))==null?void 0:t.activeElement)!=null?n:null}function cx(e){return N0(e)===e}function C0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function rt(){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 C0(()=>{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=rt();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 Kn(){let[e]=E.useState(rt);return E.useEffect(()=>()=>e.dispose(),[e]),e}let Ee=(e,t)=>{_t.isServer?E.useEffect(e,t):E.useLayoutEffect(e,t)};function Yn(e){let t=E.useRef(e);return Ee(()=>{t.current=e},[e]),t}let ue=function(e){let t=Yn(e);return E.useCallback((...n)=>t.current(...n),[t])};function lx(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 ux(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function fx({disabled:e=!1}={}){let t=E.useRef(null),[n,r]=E.useState(!1),o=Kn(),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=Ws(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",l=>{if(t.current){let u=lx(l);r(ux(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function An(e){return E.useMemo(()=>e,Object.values(e))}let dx=E.createContext(void 0);function Tc(){return E.useContext(dx)}function Ac(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function pt(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,pt),r}var Vs=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Vs||{}),$n=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))($n||{});function ot(){let e=hx();return E.useCallback(t=>px({mergeRefs:e,...t}),[e])}function px({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??mx;let a=O0(t,e);if(s)return Gs(a,n,r,i,c);let l=o??0;if(l&2){let{static:u=!1,...f}=a;if(u)return Gs(f,n,r,i,c)}if(l&1){let{unmount:u=!0,...f}=a;return pt(u?0:1,{0(){return null},1(){return Gs({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return Gs(a,n,r,i,c)}function Gs(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=$c(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 d=!1,p=[];for(let[h,b]of Object.entries(t))typeof b=="boolean"&&(d=!0),b===!0&&p.push(h.replace(/([A-Z])/g,S=>`-${S.toLowerCase()}`));if(d){f["data-headlessui-state"]=p.join(" ");for(let h of p)f[`data-${h}`]=""}}if(_o(s)&&(Object.keys(Nn(a)).length>0||Object.keys(Nn(f)).length>0))if(!E.isValidElement(u)||Array.isArray(u)&&u.length>1||gx(u)){if(Object.keys(Nn(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(Nn(a)).concat(Object.keys(Nn(f))).map(d=>` - ${d}`).join(`
|
|
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(d=>` - ${d}`).join(`
|
|
118
118
|
`)].join(`
|
|
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))N0(n,C0(t,r),o);return n}function C0(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,C0(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 Cx({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 Nx="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?Nx:"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={};/**
|
|
119
|
+
`))}else{let d=u.props,p=d==null?void 0:d.className,h=typeof p=="function"?(...P)=>Ac(p(...P),a.className):Ac(p,a.className),b=h?{className:h}:{},S=O0(u.props,Nn($c(a,["ref"])));for(let P in f)P in S&&delete f[P];return E.cloneElement(u,Object.assign({},S,f,l,{ref:o(bx(u),l.ref)},b))}return E.createElement(s,Object.assign({},$c(a,["ref"]),!_o(s)&&l,!_o(s)&&f),u)}function hx(){let e=E.useRef([]),t=E.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 mx(...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 O0(...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 I0(...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 qe(e){var t;return Object.assign(E.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Nn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function $c(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function bx(e){return E.version.split(".")[0]>="19"?e.props.ref:e.ref}function _o(e){return e===E.Fragment||e===Symbol.for("react.fragment")}function gx(e){return _o(e.type)}function yx(e,t,n){let[r,o]=E.useState(n),s=e!==void 0,i=E.useRef(s),c=E.useRef(!1),a=E.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 vx(e){let[t]=E.useState(e);return t}function k0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))M0(n,D0(t,r),o);return n}function D0(e,t){return e?e+"["+t+"]":t}function M0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())M0(e,D0(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,""]):xx(n)&&!E.isValidElement(n)&&k0(n,t,e)}function wx(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 xx(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Ex="span";var Nc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Nc||{});function Sx(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 ot()({ourProps:s,theirProps:o,slot:{},defaultTag:Ex,name:"Hidden"})}let L0=qe(Sx),Px=E.createContext(null);function Tx({children:e}){let t=E.useContext(Px);if(!t)return E.createElement(E.Fragment,null,e);let{target:n}=t;return n?je.createPortal(E.createElement(E.Fragment,null,e),n):null}function Ax({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=E.useState(null),c=Kn();return E.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),E.createElement(Tx,null,E.createElement($x,{setForm:i,formId:t}),k0(e).map(([a,l])=>E.createElement(L0,{features:Nc.Hidden,...Nn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:l,...o})})))}function $x({setForm:e,formId:t}){return E.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:E.createElement(L0,{features:Nc.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Nx=E.createContext(void 0);function B0(){return E.useContext(Nx)}function F0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function qs(e){return F0(e)&&"tagName"in e}function an(e){return qs(e)&&"accessKey"in e}function Cr(e){return qs(e)&&"tabIndex"in e}function Cx(e){return qs(e)&&"style"in e}function Ox(e){return an(e)&&e.nodeName==="IFRAME"}function R0(e){return an(e)&&e.nodeName==="INPUT"}function j0(e){return an(e)&&e.nodeName==="LABEL"}function Ix(e){return an(e)&&e.nodeName==="FIELDSET"}function _0(e){return an(e)&&e.nodeName==="LEGEND"}function kx(e){return qs(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function z0(e){let t=e.parentElement,n=null;for(;t&&!Ix(t);)_0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Dx(n)?!1:r}function Dx(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(_0(t))return!1;t=t.previousElementSibling}return!0}let U0=Symbol();function Mx(e,t=!0){return Object.assign(e,{[U0]:t})}function ht(...e){let t=E.useRef(e);E.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[U0]))?void 0:n}let Cc=E.createContext(null);Cc.displayName="DescriptionContext";function W0(){let e=E.useContext(Cc);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,W0),t}return e}function Lx(){var e,t;return(t=(e=E.useContext(Cc))==null?void 0:e.value)!=null?t:void 0}let Bx="p";function Fx(e,t){let n=E.useId(),r=Tc(),{id:o=`headlessui-description-${n}`,...s}=e,i=W0(),c=ht(t);Ee(()=>i.register(o),[o,i.register]);let a=An({...i.slot,disabled:r||!1}),l={ref:c,...i.props,id:o};return ot()({ourProps:l,theirProps:s,slot:a,defaultTag:Bx,name:i.name||"Description"})}let Rx=qe(Fx);Object.assign(Rx,{});var Ie=(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))(Ie||{});let Zs=E.createContext(null);Zs.displayName="LabelContext";function H0(){let e=E.useContext(Zs);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,H0),t}return e}function V0(e){var t,n,r;let o=(n=(t=E.useContext(Zs))==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 jx({inherit:e=!1}={}){let t=V0(),[n,r]=E.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,E.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=E.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 E.createElement(Zs.Provider,{value:c},s.children)},[r])]}let _x="label";function zx(e,t){var n;let r=E.useId(),o=H0(),s=B0(),i=Tc(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=e,f=ht(t);Ee(()=>o.register(c),[c,o.register]);let d=ue(b=>{let S=b.currentTarget;if(!(b.target!==b.currentTarget&&kx(b.target))&&(j0(S)&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),j0(S))){let P=document.getElementById(S.htmlFor);if(P){let x=P.getAttribute("disabled");if(x==="true"||x==="")return;let w=P.getAttribute("aria-disabled");if(w==="true"||w==="")return;(R0(P)&&(P.type==="file"||P.type==="radio"||P.type==="checkbox")||P.role==="radio"||P.role==="checkbox"||P.role==="switch")&&P.click(),P.focus({preventScroll:!0})}}}),p=An({...o.slot,disabled:i||!1}),h={ref:f,...o.props,id:c,htmlFor:a,onClick:d};return l&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in u&&delete u.onClick),ot()({ourProps:h,theirProps:u,slot:p,defaultTag:a?_x:"div",name:o.name||"Label"})}let Ux=qe(zx),Wx=Object.assign(Ux,{});function Hx(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 Vx(e=Hx){return E.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 G0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Gx(e,t,n=!1){let[r,o]=E.useState(()=>G0(t));return Ee(()=>{if(!t||!e)return;let s=rt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=G0(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 q0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(q0||{});function qx(e){let t=E.useRef(null),n=ue(o=>{t.current=o.pointerType,!z0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===q0.Left&&(o.preventDefault(),e(o))}),r=ue(o=>{t.current!=="mouse"&&(z0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let Z0=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 Zx=Object.defineProperty,Kx=(e,t,n)=>t in e?Zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yx=(e,t,n)=>(Kx(e,t+"",n),n),K0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},mt=(e,t,n)=>(K0(e,t,"read from private field"),n?n.call(e):t.get(e)),Oc=(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)},Y0=(e,t,n,r)=>(K0(e,t,"write to private field"),t.set(e,n),n),zt,zo,Uo;let X0=class{constructor(t){Oc(this,zt,{}),Oc(this,zo,new Z0(()=>new Set)),Oc(this,Uo,new Set),Yx(this,"disposables",rt()),Y0(this,zt,t),_t.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return mt(this,zt)}subscribe(t,n){if(_t.isServer)return()=>{};let r={selector:t,callback:n,current:t(mt(this,zt))};return mt(this,Uo).add(r),this.disposables.add(()=>{mt(this,Uo).delete(r)})}on(t,n){return _t.isServer?()=>{}:(mt(this,zo).get(t).add(n),this.disposables.add(()=>{mt(this,zo).get(t).delete(n)}))}send(t){let n=this.reduce(mt(this,zt),t);if(n!==mt(this,zt)){Y0(this,zt,n);for(let r of mt(this,Uo)){let o=r.selector(mt(this,zt));Q0(r.current,o)||(r.current=o,r.callback(o))}for(let r of mt(this,zo).get(t.type))r(mt(this,zt),t)}}};zt=new WeakMap,zo=new WeakMap,Uo=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:Ic(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Ic(e.entries(),t.entries()):J0(e)&&J0(t)?Ic(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Ic(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 J0(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function kc(e){let[t,n]=e(),r=rt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Xx=Object.defineProperty,Qx=(e,t,n)=>t in e?Xx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ep=(e,t,n)=>(Qx(e,typeof t!="symbol"?t+"":t,n),n),tp=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(tp||{});let Jx={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}}},e2=class jm extends X0{constructor(){super(...arguments),ep(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),ep(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new jm({stack:[]})}reduce(t,n){return pt(n.type,Jx,t,n)}};const Dc=new Z0(()=>e2.new());var Mc={exports:{}},Lc={};/**
|
|
120
120
|
* @license React
|
|
121
121
|
* use-sync-external-store-with-selector.production.js
|
|
122
122
|
*
|
|
@@ -124,7 +124,7 @@ ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the MIT license found in the
|
|
126
126
|
* LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/var
|
|
127
|
+
*/var np;function t2(){if(np)return Lc;np=1;var e=E;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 Lc.useSyncExternalStoreWithSelector=function(a,l,u,f,d){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=i(function(){function S(M){if(!P){if(P=!0,x=M,M=f(M),d!==void 0&&h.hasValue){var B=h.value;if(d(B,M))return w=B}return w=M}if(B=w,n(x,M))return B;var F=f(M);return d!==void 0&&d(B,F)?(x=M,B):(x=M,w=F)}var P=!1,x,w,A=u===void 0?null:u;return[function(){return S(l())},A===null?void 0:function(){return S(A())}]},[l,u,f,d]);var b=r(a,p[0],p[1]);return s(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},Lc}var Bc={};/**
|
|
128
128
|
* @license React
|
|
129
129
|
* use-sync-external-store-with-selector.development.js
|
|
130
130
|
*
|
|
@@ -132,49 +132,49 @@ ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
132
132
|
*
|
|
133
133
|
* This source code is licensed under the MIT license found in the
|
|
134
134
|
* LICENSE file in the root directory of this source tree.
|
|
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;Cc.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,N=u===void 0?null:u;return[function(){return v(l())},N===null?void 0:function(){return v(N())}]},[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())}()),Cc}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 Nc=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):(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=Mo.get(e))!=null?t:1;if(n===1?Mo.delete(e):Mo.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 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
|
|
137
|
-
* tabbable 6.
|
|
135
|
+
*/var rp;function n2(){return rp||(rp=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=E,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;Bc.useSyncExternalStoreWithSelector=function(a,l,u,f,d){var p=o(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=i(function(){function S(M){if(!P){if(P=!0,x=M,M=f(M),d!==void 0&&h.hasValue){var B=h.value;if(d(B,M))return w=B}return w=M}if(B=w,n(x,M))return B;var F=f(M);return d!==void 0&&d(B,F)?(x=M,B):(x=M,w=F)}var P=!1,x,w,A=u===void 0?null:u;return[function(){return S(l())},A===null?void 0:function(){return S(A())}]},[l,u,f,d]);var b=r(a,p[0],p[1]);return s(function(){h.hasValue=!0,h.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Bc}process.env.NODE_ENV==="production"?Mc.exports=t2():Mc.exports=n2();var r2=Mc.exports;function Ze(e,t,n=Q0){return r2.useSyncExternalStoreWithSelector(ue(r=>e.subscribe(o2,r)),ue(()=>e.state),ue(()=>e.state),ue(t),n)}function o2(e){return e}function op(e,t){let n=E.useId(),r=Dc.get(t),[o,s]=Ze(r,E.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 Fc=new Map,Wo=new Map;function sp(e){var t;let n=(t=Wo.get(e))!=null?t:0;return Wo.set(e,n+1),n!==0?()=>ip(e):(Fc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ip(e))}function ip(e){var t;let n=(t=Wo.get(e))!=null?t:1;if(n===1?Wo.delete(e):Wo.set(e,n-1),n!==1)return;let r=Fc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Fc.delete(e))}function s2(e,{allowed:t,disallowed:n}={}){let r=op(e,"inert-others");Ee(()=>{var o,s;if(!r)return;let i=rt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(sp(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let l=Ws(a);if(!l)continue;let u=a.parentElement;for(;u&&u!==l.body;){for(let f of u.children)c.some(d=>f.contains(d))||i.add(sp(f));u=u.parentElement}}return i.dispose},[r,t,n])}function i2(e,t,n){let r=Yn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});E.useEffect(()=>{if(!e)return;let o=t===null?null:an(t)?t:t.current;if(!o)return;let s=rt();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 Rc=["[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(","),a2=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var jc=(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))(jc||{}),c2=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(c2||{}),l2=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(l2||{});function ap(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Rc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function u2(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(a2)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var _c=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(_c||{});function cp(e,t=0){var n;return e===((n=Ws(e))==null?void 0:n.body)?!1:pt(t,{0(){return e.matches(Rc)},1(){let r=e;for(;r!==null;){if(r.matches(Rc))return!0;r=r.parentElement}return!1}})}var f2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(f2||{});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 d2=["textarea","input"].join(",");function p2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,d2))!=null?n:!1}function lp(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 h2(e,t,n=e===null?document.body:Hs(e)){return m2(ap(n),t,{relativeTo:e})}function m2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Hs(e[0]):document:Hs(e),i=Array.isArray(e)?n?lp(e):e:t&64?u2(e):ap(e);o.length>0&&i.length>1&&(i=i.filter(p=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===p:h===p))),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,d;do{if(u>=f||u+f<=0)return 0;let p=a+u;if(t&16)p=(p+f)%f;else{if(p<0)return 3;if(p>=f)return 1}d=i[p],d==null||d.focus(l),u+=c}while(d!==N0(d));return t&6&&p2(d)&&d.select(),2}function up(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function b2(){return/Android/gi.test(window.navigator.userAgent)}function fp(){return up()||b2()}function Or(e,t,n,r){let o=Yn(n);E.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 g2(e,t,n,r){let o=Yn(n);E.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 dp=30;function y2(e,t,n){let r=Yn(n),o=E.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(d){return typeof d=="function"?f(d()):Array.isArray(d)||d instanceof Set?d:[d]}(t);for(let f of u)if(f!==null&&(f.contains(l)||c.composed&&c.composedPath().includes(f)))return;return!cp(l,_c.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),s=E.useRef(null);Or(e,"pointerdown",c=>{var a,l;fp()||(s.current=((l=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:l[0])||c.target)},!0),Or(e,"pointerup",c=>{if(fp()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=E.useRef({x:0,y:0});Or(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Or(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=dp||Math.abs(a.y-i.current.y)>=dp))return o(c,()=>Cr(c.target)?c.target:null)},!0),g2(e,"blur",c=>o(c,()=>Ox(window.document.activeElement)?window.document.activeElement:null),!0)}function zc(...e){return E.useMemo(()=>Ws(...e),[...e])}var v2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(v2||{});const Ks={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},w2=200,pp=5;function x2(e,{trigger:t,action:n,close:r,select:o}){let s=E.useRef(null),i=E.useRef(null),c=E.useRef(null);Or(e&&t!==null,"pointerdown",a=>{F0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Or(e&&t!==null,"pointerup",a=>{var l,u;let f=s.current;if(f===null||(s.current=null,!Cr(a.target))||Math.abs(a.x-((l=i.current)!=null?l:a.x))<pp&&Math.abs(a.y-((u=c.current)!=null?u:a.y))<pp)return;let d=n(a);switch(d.kind){case 0:return;case 1:{a.timeStamp-f>w2&&(o(d.target),r());break}case 2:{r();break}}},{capture:!0})}function E2(e,t){return E.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 S2(e){return E.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 T2(){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 A2(){return up()?{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=rt();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(Cr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),u=e.querySelector(l);Cr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Cr(a.target)&&Cx(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(Cr(c.target)){if(R0(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 $2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function hp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Xn=P2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:rt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=hp(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=hp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[A2(),T2(),$2()];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)}});Xn.subscribe(()=>{let e=Xn.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)&&Xn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Xn.dispatch("TEARDOWN",n)}});function N2(e,t,n=()=>({containers:[]})){let r=S2(Xn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Ee(()=>{if(!(!t||!e))return Xn.dispatch("PUSH",t,n),()=>Xn.dispatch("POP",t,n)},[e,t]),s}function C2(e,t,n=()=>[document.body]){let r=op(e,"scroll-lock");N2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function mp(e){return[e.screenX,e.screenY]}function O2(){let e=E.useRef([-1,-1]);return{wasMoved(t){let n=mp(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=mp(t)}}}function I2(e=0){let[t,n]=E.useState(e),r=E.useCallback(a=>n(a),[]),o=E.useCallback(a=>n(l=>l|a),[]),s=E.useCallback(a=>(t&a)===a,[t]),i=E.useCallback(a=>n(l=>l&~a),[]),c=E.useCallback(a=>n(l=>l^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var bp,gp;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((bp=process==null?void 0:process.env)==null?void 0:bp.NODE_ENV)==="test"&&typeof((gp=Element==null?void 0:Element.prototype)==null?void 0:gp.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 k2=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(k2||{});function yp(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function vp(e,t,n,r){let[o,s]=E.useState(n),{hasFlag:i,addFlag:c,removeFlag:a}=I2(e&&o?3:0),l=E.useRef(!1),u=E.useRef(!1),f=Kn();return Ee(()=>{var d;if(e){if(n&&s(!0),!t){n&&c(3);return}return(d=r==null?void 0:r.start)==null||d.call(r,n),D2(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 p;u.current&&B2(t)||(l.current=!1,a(7),n||s(!1),(p=r==null?void 0:r.end)==null||p.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 D2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=rt();return L2(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(M2(e,r))})}),s.dispose}function M2(e,t){var n,r;let o=rt();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 L2(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 B2(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 Ys(){return typeof window<"u"}function Ir(e){return Uc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(Uc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Uc(e){return Ys()?e instanceof Node||e instanceof Ke(e).Node:!1}function de(e){return Ys()?e instanceof Element||e instanceof Ke(e).Element:!1}function Ye(e){return Ys()?e instanceof HTMLElement||e instanceof Ke(e).HTMLElement:!1}function Wc(e){return!Ys()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ke(e).ShadowRoot}function Ho(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function F2(e){return/^(table|td|th)$/.test(Ir(e))}function Xs(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const R2=/transform|translate|scale|rotate|perspective|filter/,j2=/paint|layout|strict|content/,Qn=e=>!!e&&e!=="none";let Hc;function Vc(e){const t=de(e)?bt(e):e;return Qn(t.transform)||Qn(t.translate)||Qn(t.scale)||Qn(t.rotate)||Qn(t.perspective)||!Qs()&&(Qn(t.backdropFilter)||Qn(t.filter))||R2.test(t.willChange||"")||j2.test(t.contain||"")}function _2(e){let t=ln(e);for(;Ye(t)&&!cn(t);){if(Vc(t))return t;if(Xs(t))return null;t=ln(t)}return null}function Qs(){return Hc==null&&(Hc=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hc}function cn(e){return/^(html|body|#document)$/.test(Ir(e))}function bt(e){return Ke(e).getComputedStyle(e)}function Js(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ln(e){if(Ir(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wc(e)&&e.host||Ut(e);return Wc(t)?t.host:t}function wp(e){const t=ln(e);return cn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&Ho(t)?t:wp(t)}function Cn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=wp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ke(o);if(s){const c=Gc(i);return t.concat(i,i.visualViewport||[],Ho(o)?o:[],c&&n?Cn(c):[])}else return t.concat(o,Cn(o,[],n))}function Gc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function z2(){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 un=Math.min,Me=Math.max,Vo=Math.round,ei=Math.floor,Wt=e=>({x:e,y:e}),U2={left:"right",right:"left",bottom:"top",top:"bottom"};function qc(e,t,n){return Me(e,un(t,n))}function Jn(e,t){return typeof e=="function"?e(t):e}function On(e){return e.split("-")[0]}function kr(e){return e.split("-")[1]}function xp(e){return e==="x"?"y":"x"}function Zc(e){return e==="y"?"height":"width"}function fn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Kc(e){return xp(fn(e))}function W2(e,t,n){n===void 0&&(n=!1);const r=kr(e),o=Kc(e),s=Zc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ti(i)),[i,ti(i)]}function H2(e){const t=ti(e);return[Yc(e),t,Yc(t)]}function Yc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ep=["left","right"],Sp=["right","left"],V2=["top","bottom"],G2=["bottom","top"];function q2(e,t,n){switch(e){case"top":case"bottom":return n?t?Sp:Ep:t?Ep:Sp;case"left":case"right":return t?V2:G2;default:return[]}}function Z2(e,t,n,r){const o=kr(e);let s=q2(On(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Yc)))),s}function ti(e){const t=On(e);return U2[t]+e.slice(t.length)}function K2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pp(e){return typeof e!="number"?K2(e):{top:e,right:e,bottom:e,left:e}}function ni(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}}/*!
|
|
137
|
+
* tabbable 6.4.0
|
|
138
138
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
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 Cp(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}=Cp(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:N,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],...N}},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}=Cp(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)),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},M=Gs(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:S,strategy:a}):E);return{top:(T.top-M.top+h.top)/N.y,bottom:(M.bottom-T.bottom+h.bottom)/N.y,left:(T.left-M.left+h.left)/N.x,right:(M.right-T.right+h.right)/N.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",N=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=N/2-M/2,g=F/2-m[h]/2-1,w=cn(f[T],g),$=cn(f[E],g),C=w,O=F-m[h]-$,k=F/2-m[h]/2+b,y=Rc(C,k,O),A=!a.arrow&&Ar(o)!=null&&k!==y&&s.reference[h]/2-(k<C?w:$)-m[h]/2<0,I=A?k<C?k-C:k-O:0;return{[d]:p[d]+I,data:{[d]:y,centerOffset:k-y-I,...A&&{alignmentOffset:I}},reset:A}}}),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,N=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,N));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,N);g.push(b[k[0]],b[k[1]])}if(w=[...w,{placement:o,overflows:g}],!g.every(k=>k<=0)){var $,C;const k=((($=s.flip)==null?void 0:$.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 A=(C=w.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:C.placement;if(!A)switch(d){case"bestFit":{var O;const I=(O=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:O[0];I&&(A=I);break}case"initialPlacement":A=c;break}if(o!==A)return{reset:{placement:A}}}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,N=cn(m-u[v],E),M=cn(h-u[T],S),B=!t.middlewareData.shift;let F=N,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),$=De(u.right,0),C=De(u.top,0),O=De(u.bottom,0);d?b=h-2*(w!==0||$!==0?w+$:De(u.left,u.right)):F=m-2*(C!==0||O!==0?C+O: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 Np(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 de(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}=Np(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?de(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&&de(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,N=T.top+(m.clientTop+parseFloat(E.paddingTop))*v.y;a*=v.x,l*=v.y,u*=v.x,f*=v.y,a+=S,l+=N,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(de(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||!de(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=>de(c)&&Tr(c)!=="body"),o=null;const s=ht(e).position==="fixed";let i=s?an(e):e;for(;de(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}=Np(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(de(o)&&!Vc(o))return o;o=an(o)}return n}let r=Lp(e,t);for(;r&&C2(r)&&Vc(r);)r=Lp(r,t);return r&&sn(r)&&Vc(r)&&!Bc(r)?n:r||D2(e)||n}const CE=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 NE(e){return ht(e).direction==="rtl"}const OE={convertOffsetParentRelativeRectToViewportRelativeRect:yE,getDocumentElement:_t,getClippingRect:TE,getOffsetParent:Bp,getElementRects:CE,getClientRects:vE,getDimensions:AE,getScale:$r,isElement:de,isRTL:NE};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 N=!0;function M(B){const F=B[0].intersectionRatio;if(F!==a){if(!N)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!Fp(l,e.getBoundingClientRect())&&i(),N=!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=U.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]=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),[v,T]=U.useState(null),E=U.useCallback(P=>{P!==B.current&&(B.current=P,m(P))},[]),S=U.useCallback(P=>{P!==F.current&&(F.current=P,T(P))},[]),N=s||h,M=i||v,B=U.useRef(null),F=U.useRef(null),b=U.useRef(u),g=a!=null,w=qc(a),$=qc(o),C=qc(l),O=U.useCallback(()=>{if(!B.current||!F.current)return;const P={placement:t,strategy:n,middleware:p};$.current&&(P.platform=$.current),BE(B.current,F.current,P).then(L=>{const j={...L,isPositioned:C.current!==!1};k.current&&!Xs(b.current,j)&&(b.current=j,Mr.flushSync(()=>{f(j)}))})},[p,t,n,$,C]);Ys(()=>{l===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const k=U.useRef(!1);Ys(()=>(k.current=!0,()=>{k.current=!1}),[]),Ys(()=>{if(N&&(B.current=N),M&&(F.current=M),N&&M){if(w.current)return w.current(N,M,O);O()}},[N,M,O,w,g]);const y=U.useMemo(()=>({reference:B,floating:F,setReference:E,setFloating:S}),[E,S]),A=U.useMemo(()=>({reference:N,floating:M}),[N,M]),I=U.useMemo(()=>{const P={position:n,left:0,top:0};if(!A.floating)return P;const L=zp(A.floating,u.x),j=zp(A.floating,u.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,u.x,u.y]);return U.useMemo(()=>({...u,update:O,refs:y,elements:A,floatingStyles:I}),[u,O,y,A,I])}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={...U},UE=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 UE(()=>{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 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]=U.useState(()=>qp?Zp():void 0);return Kc(()=>{e==null&&t(Zp())},[]),U.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=U.createContext(null),YE=U.createContext(null),XE=()=>{var e;return((e=U.useContext(KE))==null?void 0:e.id)||null},QE=()=>U.useContext(YE),JE="data-floating-ui-focusable";function e8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=VE(),s=U.useRef({}),[i]=U.useState(()=>ZE()),c=XE()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!de(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]=U.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=U.useMemo(()=>({setPositionReference:l}),[]),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: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]=U.useState(null),[c,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),p=QE();Kc(()=>{u&&(f.current=u)},[u]);const d=Up({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(S=>{const N=de(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;a(N),d.refs.setReference(N)},[d.refs]),m=U.useCallback(S=>{(de(S)||S===null)&&(f.current=S,i(S)),(de(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!de(S))&&d.refs.setReference(S)},[d.refs]),v=U.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=U.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=U.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(N=>N.id===t);S&&(S.context=E)}),U.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=U.useCallback(c=>Yc(c,e,"reference"),t),s=U.useCallback(c=>Yc(c,e,"floating"),n),i=U.useCallback(c=>Yc(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 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)},N=await Gc(Xp(S,h.scrollHeight+m+p.clientTop),u),M=await Gc(S,{...u,elementContext:"reference"}),B=De(0,N.top),F=S.y+B,w=(h.scrollHeight>h.clientHeight?$=>$:Bo)(De(0,h.scrollHeight+(v&&E||T?m*2:0)-B-De(0,N.bottom)));if(h.style.maxHeight=w+"px",h.scrollTop=B,o){const $=h.offsetHeight<d.offsetHeight*cn(c,n.current.length)-1||M.top>=-a||M.bottom>=-a;Mr.flushSync(()=>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=U.useRef(!1),u=U.useRef(null),f=U.useRef(null);U.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,N=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*N))})):/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=U.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 U.useMemo(()=>o?{floating:p}:{},[o,p])}let Cr=x.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Cr.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(Cr).setReference}function a8(){return x.useContext(Cr).getReferenceProps}function c8(){let{getFloatingProps:e,slot:t}=x.useContext(Cr);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(Cr);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($){var C,O;if(!$)return;let k=S.elements.floating;if(!k)return;let y=parseFloat(getComputedStyle(k).scrollPaddingBottom)||0,A=Math.min(Qp,k.childElementCount),I=0,P=0;for(let L of(O=(C=S.elements.floating)==null?void 0:C.childNodes)!=null?O:[])if(on(L)){let j=L.offsetTop,z=j+L.clientHeight+y,_=k.scrollTop,H=_+k.clientHeight;if(j>=_&&z<=H)A--;else{P=Math.max(0,Math.min(z,H)-Math.max(j,_)),I=L.clientHeight;break}}A>=1&&s(L=>{let j=I*A-P+y;return L>=j?L:j})}}):null,_E({padding:d,apply({availableWidth:$,availableHeight:C,elements:O}){Object.assign(O.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${C}px)`})}})].filter(Boolean),whileElementsMounted:Rp}),[N=m,M=v]=S.placement.split("-");m==="selection"&&(N="selection");let B=x.useMemo(()=>({anchor:[N,M].filter(Boolean).join(" ")}),[N,M]),F=o8(S,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:g}=n8([F]),w=ue($=>{a($),T.setFloating($)});return U.createElement(Xc.Provider,{value:r},U.createElement(Cr.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 U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function ah(){let e=$8(),[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 C8(){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 N8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(N8||{});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=C8(),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),N=ch(e),M=dt(...N?[S,t,E]:t===null?[]:[t]),B=(n=v.unmount)==null||n?Pn.Unmount:Pn.Hidden,{show:F,appear:b,initial:g}=O8(),[w,$]=x.useState(F?"visible":"hidden"),C=I8(),{register:O,unregister:k}=C;Ee(()=>O(S),[O,S]),Ee(()=>{if(B===Pn.Hidden&&S.current){if(F&&w!=="visible"){$("visible");return}return ft(w,{hidden:()=>k(S),visible:()=>O(S)})}},[w,S,O,k,F,B]);let y=ah();Ee(()=>{if(N&&y&&w==="visible"&&S.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[S,w,y,N]);let A=g&&!b,I=b&&F&&g,P=x.useRef(!1),L=lh(()=>{P.current||($("hidden"),k(S))},C),j=ue(Z=>{P.current=!0;let J=Z?"enter":"leave";L.onStart(S,J,ee=>{ee==="enter"?s==null||s():ee==="leave"&&(c==null||c())})}),z=ue(Z=>{let J=Z?"enter":"leave";P.current=!1,L.onStop(S,J,ee=>{ee==="enter"?i==null||i():ee==="leave"&&(a==null||a())}),J==="leave"&&!ni(L)&&($("hidden"),k(S))});x.useEffect(()=>{N&&o||(j(F),z(F))},[F,N,o]);let _=!(!o||!N||!y||A),[,H]=hp(_,T,F,{start:j,end:z}),Y=Tn({ref:M,className:((r=yc(v.className,I&&l,I&&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)}),N=rt();return x.createElement(ti.Provider,{value:p},x.createElement(ei.Provider,{value:v},N({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||{}),Cn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Cn||{}),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,N]=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,{[Cn.Multi]:()=>S.some(H=>b(H,_)),[Cn.Single]:()=>b(S,_)}),[S]),w=Sn({value:S,disabled:f,invalid:u,mode:d?Cn.Multi:Cn.Single,orientation:v,onChange:N,compare:b,isSelected:g,optionsPropsRef:B,listRef:F});Ee(()=>{M.state.dataRef.current=w},[w]);let $=qe(M,_=>_.listboxState),C=Tc.get(null),O=qe(C,x.useCallback(_=>C.selectors.isTop(_,n),[C,n])),[k,y]=qe(M,_=>[_.buttonElement,_.optionsElement]);a2(O,[k,y],(_,H)=>{M.send({type:bh.CloseListbox}),rp(H,kc.Loose)||(_.preventDefault(),k==null||k.focus())});let A=Sn({open:$===Me.Open,disabled:f,invalid:u,value:S}),[I,P]=Cx({inherit:!0}),L={ref:T},j=x.useCallback(()=>{if(E!==void 0)return N==null?void 0:N(E)},[N,E]),z=rt();return x.createElement(P,{value:I,props:{htmlFor:k==null?void 0:k.id},slot:{open:$===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($,{[Me.Open]:Ot.Open,[Me.Closed]:Ot.Closed})},c!=null&&S!=null&&x.createElement(mx,{disabled:f,data:{[c]:S},form:i,onReset:j}),z({ourProps:L,theirProps:m,slot:A,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 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 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 A;s.state.listboxState===Me.Open?(je.flushSync(()=>s.actions.closeListbox()),(A=s.state.buttonElement)==null||A.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:we.Nothing}))}),S=ue(y=>y.preventDefault()),N=_0([i]),M=Px(),{isFocusVisible:B,focusProps:F}=q5({autoFocus:a}),{isHovered:b,hoverProps:g}=G5({isDisabled:c}),{pressed:w,pressProps:$}=ex({disabled:c}),C=Sn({open:p===Me.Open,active:w||p===Me.Open,disabled:c,invalid:o.invalid,value:o.value,hover:b,focus:B,autofocus:a}),O=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":O,"aria-labelledby":N,"aria-describedby":M,disabled:c||void 0,autoFocus:a,onKeyDown:v,onKeyUp:T,onKeyPress:S},E,F,g,$);return rt()({ourProps:k,theirProps:l,slot:C,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),N=el(),[M,B]=hp(c,u,N!==null?(N&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,$=th(w,p.value),C=x.useCallback(W=>p.compare($,W),[p.compare,$]),O=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(ee=>C(ee.dataRef.current.value));return J===-1&&(J=0),J}),k=(()=>{if(l==null)return;if(O===null)return{...l,inner:void 0};let W=Array.from(p.listRef.current.values());return{...l,inner:{listRef:{current:W},index:O}}})(),[y,A]=l8(k),I=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}}),z=qe(d,W=>{var Z;return(Z=W.buttonElement)==null?void 0:Z.id}),_=Sn({open:h===Me.Open}),H=A0(l?I():{},{id:r,ref:P,"aria-activedescendant":qe(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===Cn.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===Me.Open?0:void 0,style:{...a.style,...A,"--button-width":Lx(M,m,!0).width},...pp(B)}),Y=rt(),G=x.useMemo(()=>p.mode===Cn.Multi?p:{...p,isSelected:C},[p,C]);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,$;($=(w=p.current)==null?void 0:w.scrollIntoView)==null||$.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(),N=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:N,onMouseEnter:N,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===Cn.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:`
|
|
139
|
+
*/var Y2=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Xc=Y2.join(","),Tp=typeof Element>"u",Go=Tp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ri=!Tp&&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},oi=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&&(typeof t.closest=="function"?t.closest("[inert]"):oi(t.parentNode));return i},X2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Q2=function(t,n,r){if(oi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Xc));return n&&Go.call(t,Xc)&&o.unshift(t),o=o.filter(r),o},Qc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!oi(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=Qc(a,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=Go.call(i,Xc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),d=!oi(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&d){var p=Qc(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Ap=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},$p=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||X2(t))&&!Ap(t)?0:t.tabIndex},J2=function(t,n){var r=$p(t);return r<0&&n&&!Ap(t)?0:r},eE=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Np=function(t){return t.tagName==="INPUT"},tE=function(t){return Np(t)&&t.type==="hidden"},nE=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},rE=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},oE=function(t){if(!t.name)return!0;var n=t.form||ri(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=rE(o,t.form);return!s||s===t},sE=function(t){return Np(t)&&t.type==="radio"},iE=function(t){return sE(t)&&!oE(t)},aE=function(t){var n,r=t&&ri(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=ri(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},Cp=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},cE=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=Go.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Go.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=ri(t);if(l&&!l.shadowRoot&&o(l)===!0)return Cp(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(aE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Cp(t);return!1},lE=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 Go.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},uE=function(t,n){return!(n.disabled||tE(n)||cE(n,t)||nE(n)||lE(n))},Op=function(t,n){return!(iE(n)||$p(n)<0||!uE(t,n))},fE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ip=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=J2(c,i),l=i?Ip(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(eE).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},kp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Qc([t],n.includeContainer,{filter:Op.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:fE}):r=Q2(t,n.includeContainer,Op.bind(null,n)),Ip(r)};function Dp(e,t,n){let{reference:r,floating:o}=e;const s=fn(t),i=Kc(t),c=Zc(i),a=On(t),l=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(a){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(kr(t)){case"start":p[i]-=d*(n&&l?-1:1);break;case"end":p[i]+=d*(n&&l?-1:1);break}return p}async function Mp(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:d=!1,padding:p=0}=Jn(t,e),h=Pp(p),S=c[d?f==="floating"?"reference":"floating":f],P=ni(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(S)))==null||n?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),x=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),A=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},M=ni(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:w,strategy:a}):x);return{top:(P.top-M.top+h.top)/A.y,bottom:(M.bottom-P.bottom+h.bottom)/A.y,left:(P.left-M.left+h.left)/A.x,right:(M.right-P.right+h.right)/A.x}}const dE=50,pE=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Mp},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}=Dp(l,r,a),d=r,p=0;const h={};for(let b=0;b<s.length;b++){const S=s[b];if(!S)continue;const{name:P,fn:x}=S,{x:w,y:A,data:M,reset:B}=await x({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:l,platform:c,elements:{reference:e,floating:t}});u=w??u,f=A??f,h[P]={...h[P],...M},B&&p<dE&&(p++,typeof B=="object"&&(B.placement&&(d=B.placement),B.rects&&(l=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):B.rects),{x:u,y:f}=Dp(l,d,a)),b=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}},hE=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}=Jn(e,t)||{};if(l==null)return{};const f=Pp(u),d={x:n,y:r},p=Kc(o),h=Zc(p),b=await i.getDimensions(l),S=p==="y",P=S?"top":"left",x=S?"bottom":"right",w=S?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[p]-d[p]-s.floating[h],M=d[p]-s.reference[p],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let F=B?B[w]:0;(!F||!await(i.isElement==null?void 0:i.isElement(B)))&&(F=c.floating[w]||s.floating[h]);const m=A/2-M/2,g=F/2-b[h]/2-1,v=un(f[P],g),$=un(f[x],g),N=v,O=F-b[h]-$,k=F/2-b[h]/2+m,y=qc(N,k,O),C=!a.arrow&&kr(o)!=null&&k!==y&&s.reference[h]/2-(k<N?v:$)-b[h]/2<0,I=C?k<N?k-N:k-O:0;return{[p]:d[p]+I,data:{[p]:y,centerOffset:k-y-I,...C&&{alignmentOffset:I}},reset:C}}}),mE=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:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:b=!0,...S}=Jn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const P=On(o),x=fn(c),w=On(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),M=d||(w||!b?[ti(c)]:H2(c)),B=h!=="none";!d&&B&&M.push(...Z2(c,b,h,A));const F=[c,...M],m=await a.detectOverflow(t,S),g=[];let v=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&g.push(m[P]),f){const k=W2(o,i,A);g.push(m[k[0]],m[k[1]])}if(v=[...v,{placement:o,overflows:g}],!g.every(k=>k<=0)){var $,N;const k=((($=s.flip)==null?void 0:$.index)||0)+1,y=F[k];if(y&&(!(f==="alignment"?x!==fn(y):!1)||v.every(T=>fn(T.placement)===x?T.overflows[0]>0:!0)))return{data:{index:k,overflows:v},reset:{placement:y}};let C=(N=v.filter(I=>I.overflows[0]<=0).sort((I,T)=>I.overflows[1]-T.overflows[1])[0])==null?void 0:N.placement;if(!C)switch(p){case"bestFit":{var O;const I=(O=v.filter(T=>{if(B){const L=fn(T.placement);return L===x||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:O[0];I&&(C=I);break}case"initialPlacement":C=c;break}if(o!==C)return{reset:{placement:C}}}return{}}}},bE=new Set(["left","top"]);async function gE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=On(n),c=kr(n),a=fn(n)==="y",l=bE.has(i)?-1:1,u=s&&a?-1:1,f=Jn(t,e);let{mainAxis:d,crossAxis:p,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"&&(p=c==="end"?h*-1:h),a?{x:p*u,y:d*l}:{x:d*l,y:p*u}}const yE=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 gE(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}}}}},vE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:P=>{let{x,y:w}=P;return{x,y:w}}},...l}=Jn(e,t),u={x:n,y:r},f=await s.detectOverflow(t,l),d=fn(On(o)),p=xp(d);let h=u[p],b=u[d];if(i){const P=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=h+f[P],A=h-f[x];h=qc(w,h,A)}if(c){const P=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=b+f[P],A=b-f[x];b=qc(w,b,A)}const S=a.fn({...t,[p]:h,[d]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[p]:i,[d]:c}}}}}},wE=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}=Jn(e,t),u=await i.detectOverflow(t,l),f=On(o),d=kr(o),p=fn(o)==="y",{width:h,height:b}=s.floating;let S,P;f==="top"||f==="bottom"?(S=f,P=d===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(P=f,S=d==="end"?"top":"bottom");const x=b-u.top-u.bottom,w=h-u.left-u.right,A=un(b-u[S],x),M=un(h-u[P],w),B=!t.middlewareData.shift;let F=A,m=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(m=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=x),B&&!d){const v=Me(u.left,0),$=Me(u.right,0),N=Me(u.top,0),O=Me(u.bottom,0);p?m=h-2*(v!==0||$!==0?v+$:Me(u.left,u.right)):F=b-2*(N!==0||O!==0?N+O:Me(u.top,u.bottom))}await a({...t,availableWidth:m,availableHeight:F});const g=await i.getDimensions(c.floating);return h!==g.width||b!==g.height?{reset:{rects:!0}}:{}}}};function Lp(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ye(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Vo(n)!==s||Vo(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Jc(e){return de(e)?e:e.contextElement}function Dr(e){const t=Jc(e);if(!Ye(t))return Wt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Lp(t);let i=(s?Vo(n.width):n.width)/r,c=(s?Vo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const xE=Wt(0);function Bp(e){const t=Ke(e);return!Qs()||!t.visualViewport?xE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function EE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ke(e)?!1:t}function er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Jc(e);let i=Wt(1);t&&(r?de(r)&&(i=Dr(r)):i=Dr(e));const c=EE(s,n,r)?Bp(s):Wt(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 d=Ke(s),p=r&&de(r)?Ke(r):r;let h=d,b=Gc(h);for(;b&&r&&p!==h;){const S=Dr(b),P=b.getBoundingClientRect(),x=bt(b),w=P.left+(b.clientLeft+parseFloat(x.paddingLeft))*S.x,A=P.top+(b.clientTop+parseFloat(x.paddingTop))*S.y;a*=S.x,l*=S.y,u*=S.x,f*=S.y,a+=w,l+=A,h=Ke(b),b=Gc(h)}}return ni({width:u,height:f,x:a,y:l})}function si(e,t){const n=Js(e).scrollLeft;return t?t.left+n:er(Ut(e)).left+n}function Fp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-si(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function SE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Ut(r),c=t?Xs(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=Wt(1);const u=Wt(0),f=Ye(r);if((f||!f&&!s)&&((Ir(r)!=="body"||Ho(i))&&(a=Js(r)),f)){const p=er(r);l=Dr(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const d=i&&!f&&!s?Fp(i,a):Wt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-a.scrollTop*l.y+u.y+d.y}}function PE(e){return Array.from(e.getClientRects())}function TE(e){const t=Ut(e),n=Js(e),r=e.ownerDocument.body,o=Me(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Me(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+si(e);const c=-n.scrollTop;return bt(r).direction==="rtl"&&(i+=Me(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Rp=25;function AE(e,t){const n=Ke(e),r=Ut(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=Qs();(!u||u&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const l=si(r);if(l<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-p);h<=Rp&&(s-=h)}else l<=Rp&&(s+=l);return{width:s,height:i,x:c,y:a}}function $E(e,t){const n=er(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ye(e)?Dr(e):Wt(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 jp(e,t,n){let r;if(t==="viewport")r=AE(e,n);else if(t==="document")r=TE(Ut(e));else if(de(t))r=$E(t,n);else{const o=Bp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ni(r)}function _p(e,t){const n=ln(e);return n===t||!de(n)||cn(n)?!1:bt(n).position==="fixed"||_p(n,t)}function NE(e,t){const n=t.get(e);if(n)return n;let r=Cn(e,[],!1).filter(c=>de(c)&&Ir(c)!=="body"),o=null;const s=bt(e).position==="fixed";let i=s?ln(e):e;for(;de(i)&&!cn(i);){const c=bt(i),a=Vc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ho(i)&&!a&&_p(e,i))?r=r.filter(u=>u!==i):o=c,i=ln(i)}return t.set(e,r),r}function CE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Xs(t)?[]:NE(t,this._c):[].concat(n),r],c=jp(t,i[0],o);let a=c.top,l=c.right,u=c.bottom,f=c.left;for(let d=1;d<i.length;d++){const p=jp(t,i[d],o);a=Me(p.top,a),l=un(p.right,l),u=un(p.bottom,u),f=Me(p.left,f)}return{width:l-f,height:u-a,x:f,y:a}}function OE(e){const{width:t,height:n}=Lp(e);return{width:t,height:n}}function IE(e,t,n){const r=Ye(t),o=Ut(t),s=n==="fixed",i=er(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Wt(0);function l(){a.x=si(o)}if(r||!r&&!s)if((Ir(t)!=="body"||Ho(o))&&(c=Js(t)),r){const p=er(t,!0,s,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?Fp(o,c):Wt(0),f=i.left+c.scrollLeft-a.x-u.x,d=i.top+c.scrollTop-a.y-u.y;return{x:f,y:d,width:i.width,height:i.height}}function el(e){return bt(e).position==="static"}function zp(e,t){if(!Ye(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function Up(e,t){const n=Ke(e);if(Xs(e))return n;if(!Ye(e)){let o=ln(e);for(;o&&!cn(o);){if(de(o)&&!el(o))return o;o=ln(o)}return n}let r=zp(e,t);for(;r&&F2(r)&&el(r);)r=zp(r,t);return r&&cn(r)&&el(r)&&!Vc(r)?n:r||_2(e)||n}const kE=async function(e){const t=this.getOffsetParent||Up,n=this.getDimensions,r=await n(e.floating);return{reference:IE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DE(e){return bt(e).direction==="rtl"}const ME={convertOffsetParentRelativeRectToViewportRelativeRect:SE,getDocumentElement:Ut,getClippingRect:CE,getOffsetParent:Up,getElementRects:kE,getClientRects:PE,getDimensions:OE,getScale:Dr,isElement:de,isRTL:DE};function Wp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function LE(e,t){let n=null,r;const o=Ut(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:d,height:p}=l;if(c||t(),!d||!p)return;const h=ei(f),b=ei(o.clientWidth-(u+d)),S=ei(o.clientHeight-(f+p)),P=ei(u),w={rootMargin:-h+"px "+-b+"px "+-S+"px "+-P+"px",threshold:Me(0,un(1,a))||1};let A=!0;function M(B){const F=B[0].intersectionRatio;if(F!==a){if(!A)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!Wp(l,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(M,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,w)}n.observe(e)}return i(!0),s}function Hp(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=Jc(e),u=o||s?[...l?Cn(l):[],...t?Cn(t):[]]:[];u.forEach(P=>{o&&P.addEventListener("scroll",n,{passive:!0}),s&&P.addEventListener("resize",n)});const f=l&&c?LE(l,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(P=>{let[x]=P;x&&x.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),l&&!a&&p.observe(l),t&&p.observe(t));let h,b=a?er(e):null;a&&S();function S(){const P=er(e);b&&!Wp(b,P)&&n(),b=P,h=requestAnimationFrame(S)}return n(),()=>{var P;u.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),f==null||f(),(P=p)==null||P.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const tl=Mp,BE=yE,FE=vE,RE=mE,jE=wE,Vp=hE,_E=(e,t,n)=>{const r=new Map,o={platform:ME,...n},s={...o.platform,_c:r};return pE(e,t,{...o,platform:s})};var zE=typeof document<"u",UE=function(){},ii=zE?E.useLayoutEffect:UE;function ai(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(!ai(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)&&!ai(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Gp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qp(e,t){const n=Gp(e);return Math.round(t*n)/n}function nl(e){const t=U.useRef(e);return ii(()=>{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:l}=e,[u,f]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=U.useState(r);ai(d,r)||p(r);const[h,b]=U.useState(null),[S,P]=U.useState(null),x=U.useCallback(T=>{T!==B.current&&(B.current=T,b(T))},[]),w=U.useCallback(T=>{T!==F.current&&(F.current=T,P(T))},[]),A=s||h,M=i||S,B=U.useRef(null),F=U.useRef(null),m=U.useRef(u),g=a!=null,v=nl(a),$=nl(o),N=nl(l),O=U.useCallback(()=>{if(!B.current||!F.current)return;const T={placement:t,strategy:n,middleware:d};$.current&&(T.platform=$.current),_E(B.current,F.current,T).then(L=>{const j={...L,isPositioned:N.current!==!1};k.current&&!ai(m.current,j)&&(m.current=j,zr.flushSync(()=>{f(j)}))})},[d,t,n,$,N]);ii(()=>{l===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[l]);const k=U.useRef(!1);ii(()=>(k.current=!0,()=>{k.current=!1}),[]),ii(()=>{if(A&&(B.current=A),M&&(F.current=M),A&&M){if(v.current)return v.current(A,M,O);O()}},[A,M,O,v,g]);const y=U.useMemo(()=>({reference:B,floating:F,setReference:x,setFloating:w}),[x,w]),C=U.useMemo(()=>({reference:A,floating:M}),[A,M]),I=U.useMemo(()=>{const T={position:n,left:0,top:0};if(!C.floating)return T;const L=qp(C.floating,u.x),j=qp(C.floating,u.y);return c?{...T,transform:"translate("+L+"px, "+j+"px)",...Gp(C.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,c,C.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:O,refs:y,elements:C,floatingStyles:I}),[u,O,y,C,I])}const WE=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?Vp({element:r.current,padding:o}).fn(n):{}:r?Vp({element:r,padding:o}).fn(n):{}}}},rl=(e,t)=>{const n=BE(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kp=(e,t)=>{const n=FE(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yp=(e,t)=>{const n=RE(e);return{name:n.name,fn:n.fn,options:[e,t]}},HE=(e,t)=>{const n=jE(e);return{name:n.name,fn:n.fn,options:[e,t]}},VE=(e,t)=>{const n=WE(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xp={...U},GE=Xp.useInsertionEffect||(e=>e());function Qp(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return GE(()=>{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 ol=typeof document<"u"?E.useLayoutEffect:E.useEffect;let Jp=!1,qE=0;const eh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+qE++;function ZE(){const[e,t]=U.useState(()=>Jp?eh():void 0);return ol(()=>{e==null&&t(eh())},[]),U.useEffect(()=>{Jp=!0},[]),e}const KE=Xp.useId||ZE;let qo;process.env.NODE_ENV!=="production"&&(qo=new Set);function YE(){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=qo)!=null&&e.has(o))){var s;(s=qo)==null||s.add(o),console.warn(o)}}function XE(){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=qo)!=null&&e.has(o))){var s;(s=qo)==null||s.add(o),console.error(o)}}function QE(){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 JE=U.createContext(null),e8=U.createContext(null),t8=()=>{var e;return((e=U.useContext(JE))==null?void 0:e.id)||null},n8=()=>U.useContext(e8),r8="data-floating-ui-focusable";function o8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=KE(),s=U.useRef({}),[i]=U.useState(()=>QE()),c=t8()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!de(p)&&XE("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]=U.useState(r.reference),u=Qp((p,h,b)=>{s.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:b,nested:c}),n==null||n(p,h,b)}),f=U.useMemo(()=>({setPositionReference:l}),[]),d=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:u,elements:d,events:i,floatingId:o,refs:f}),[t,u,d,i,o,f])}function s8(e){e===void 0&&(e={});const{nodeId:t}=e,n=o8({...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),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),d=n8();ol(()=>{u&&(f.current=u)},[u]);const p=Zp({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(w=>{const A=de(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;a(A),p.refs.setReference(A)},[p.refs]),b=U.useCallback(w=>{(de(w)||w===null)&&(f.current=w,i(w)),(de(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!de(w))&&p.refs.setReference(w)},[p.refs]),S=U.useMemo(()=>({...p.refs,setReference:b,setPositionReference:h,domReference:f}),[p.refs,b,h]),P=U.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),x=U.useMemo(()=>({...p,...r,refs:S,elements:P,nodeId:t}),[p,S,P,t,r]);return ol(()=>{r.dataRef.current.floatingContext=x;const w=d==null?void 0:d.nodesRef.current.find(A=>A.id===t);w&&(w.context=x)}),U.useMemo(()=>({...p,context:x,refs:S,elements:P}),[p,S,P,x])}const th="active",nh="selected";function sl(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[th]:i,[nh]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[r8]:""},...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&&[th,nh].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 d,p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return(d=r.get(l))==null?void 0:d.map(S=>S(...h)).find(S=>S!==void 0)}}}else i[l]=u}),i),{})}}function i8(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=>sl(c,e,"reference"),t),s=U.useCallback(c=>sl(c,e,"floating"),n),i=U.useCallback(c=>sl(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function rh(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const a8=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}=Jn(e,t),{rects:f,elements:{floating:d}}=t,p=n.current[i],h=(l==null?void 0:l.current)||d,b=d.clientTop||h.clientTop,S=d.clientTop!==0,P=h.clientTop!==0,x=d===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||YE('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const w={...t,...await rl(-p.offsetTop-d.clientTop-f.reference.height/2-p.offsetHeight/2-s).fn(t)},A=await tl(rh(w,h.scrollHeight+b+d.clientTop),u),M=await tl(w,{...u,elementContext:"reference"}),B=Me(0,A.top),F=w.y+B,v=(h.scrollHeight>h.clientHeight?$=>$:Vo)(Me(0,h.scrollHeight+(S&&x||P?b*2:0)-B-Me(0,A.bottom)));if(h.style.maxHeight=v+"px",h.scrollTop=B,o){const $=h.offsetHeight<p.offsetHeight*un(c,n.current.length)-1||M.top>=-a||M.bottom>=-a;zr.flushSync(()=>o($))}return r&&(r.current=await tl(rh({...w,y:F},h.offsetHeight+b+d.clientTop),u)),{y:F}}});function c8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=Qp(c),l=U.useRef(!1),u=U.useRef(null),f=U.useRef(null);U.useEffect(()=>{if(!o)return;function p(b){if(b.ctrlKey||!h||s.current==null)return;const S=b.deltaY,P=s.current.top>=-.5,x=s.current.bottom>=-.5,w=h.scrollHeight-h.clientHeight,A=S<0?-1:1,M=S<0?"max":"min";h.scrollHeight<=h.clientHeight||(!P&&S>0||!x&&S<0?(b.preventDefault(),zr.flushSync(()=>{a(B=>B+Math[M](S,w*A))})):/firefox/i.test(z2())&&(h.scrollTop+=S))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",p),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{u.current=null,f.current=null,h.removeEventListener("wheel",p)}},[o,n,r.floating,s,i,a]);const d=U.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const p=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!p||!l.current)){if(u.current!==null){const h=p.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&zr.flushSync(()=>a(b=>b+h))}requestAnimationFrame(()=>{u.current=p.scrollTop})}}}),[r.floating,a,s,i]);return U.useMemo(()=>o?{floating:d}:{},[o,d])}let Mr=E.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Mr.displayName="FloatingContext";let il=E.createContext(null);il.displayName="PlacementContext";function l8(e){return E.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function u8(){return E.useContext(Mr).setReference}function f8(){return E.useContext(Mr).getReferenceProps}function d8(){let{getFloatingProps:e,slot:t}=E.useContext(Mr);return E.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function p8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=E.useContext(il),n=E.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=E.useContext(Mr);return E.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let oh=4;function h8({children:e,enabled:t=!0}){let[n,r]=E.useState(null),[o,s]=E.useState(0),i=E.useRef(null),[c,a]=E.useState(null);m8(c);let l=t&&n!==null&&c!==null,{to:u="bottom",gap:f=0,offset:d=0,padding:p=0,inner:h}=b8(n,c),[b,S="center"]=u.split(" ");Ee(()=>{l&&s(0)},[l]);let{refs:P,floatingStyles:x,context:w}=s8({open:l,placement:b==="selection"?S==="center"?"bottom":`bottom-${S}`:S==="center"?`${b}`:`${b}-${S}`,strategy:"absolute",transform:!1,middleware:[rl({mainAxis:b==="selection"?0:f,crossAxis:d}),Kp({padding:p}),b!=="selection"&&Yp({padding:p}),b==="selection"&&h?a8({...h,padding:p,overflowRef:i,offset:o,minItemsVisible:oh,referenceOverflowThreshold:p,onFallbackChange($){var N,O;if(!$)return;let k=w.elements.floating;if(!k)return;let y=parseFloat(getComputedStyle(k).scrollPaddingBottom)||0,C=Math.min(oh,k.childElementCount),I=0,T=0;for(let L of(O=(N=w.elements.floating)==null?void 0:N.childNodes)!=null?O:[])if(an(L)){let j=L.offsetTop,z=j+L.clientHeight+y,_=k.scrollTop,H=_+k.clientHeight;if(j>=_&&z<=H)C--;else{T=Math.max(0,Math.min(z,H)-Math.max(j,_)),I=L.clientHeight;break}}C>=1&&s(L=>{let j=I*C-T+y;return L>=j?L:j})}}):null,HE({padding:p,apply({availableWidth:$,availableHeight:N,elements:O}){Object.assign(O.floating.style,{overflow:"auto",maxWidth:`${$}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${N}px)`})}})].filter(Boolean),whileElementsMounted:Hp}),[A=b,M=S]=w.placement.split("-");b==="selection"&&(A="selection");let B=E.useMemo(()=>({anchor:[A,M].filter(Boolean).join(" ")}),[A,M]),F=c8(w,{overflowRef:i,onChange:s}),{getReferenceProps:m,getFloatingProps:g}=i8([F]),v=ue($=>{a($),P.setFloating($)});return U.createElement(il.Provider,{value:r},U.createElement(Mr.Provider,{value:{setFloating:v,setReference:P.setReference,styles:x,getReferenceProps:m,getFloatingProps:g,slot:B}},e))}function m8(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 b8(e,t){var n,r,o;let s=al((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=al((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=al((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function al(e,t,n=void 0){let r=Kn(),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=ih(a,l);return[u,f=>{let d=sh(a);{let p=d.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let b=!1;for(let[P,x]of d.entries()){let w=window.getComputedStyle(l).getPropertyValue(x);if(p[P]!==w){p[P]=w,b=!0;break}}if(!b)return;let S=ih(a,l);u!==S&&(f(S),u=S)})}return r.dispose}]}return[n,null]}),s=E.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=E.useState();return Ee(()=>{let[a,l]=o(e,t);if(c(a),!!l)return l(c)},[e,t]),i}function sh(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,...sh(o)]:[r]}return[]}function ih(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 g8({children:e,freeze:t},n){let r=ah(t,e);return E.isValidElement(r)?E.cloneElement(r,{ref:n}):E.createElement(E.Fragment,null,r)}E.forwardRef(g8);function ah(e,t){let[n,r]=E.useState(t);return!e&&n!==t&&r(t),e?n:t}let cl=E.createContext(null);cl.displayName="OpenClosedContext";var kt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(kt||{});function ll(){return E.useContext(cl)}function ch({value:e,children:t}){return E.createElement(cl.Provider,{value:e},t)}function y8(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 ci(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:y8(e)}}function lh(e){let t=ue(e),n=E.useRef(!1);E.useEffect(()=>(n.current=!1,()=>{n.current=!0,C0(()=>{n.current&&t()})}),[t])}let v8=E.createContext(!1);function w8(){return E.useContext(v8)}function x8(e){let t=w8(),n=E.useContext(fh),[r,o]=E.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(_t.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 E.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),E.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let uh=E.Fragment,E8=qe(function(e,t){let{ownerDocument:n=null,...r}=e,o=E.useRef(null),s=ht(Mx(d=>{o.current=d}),t),i=zc(o.current),c=n??i,a=x8(c),l=E.useContext(A8),u=Kn(),f=ot();return lh(()=>{var d;a&&a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a))}),a?je.createPortal(E.createElement("div",{"data-headlessui-portal":"",ref:d=>{u.dispose(),l&&d&&u.add(l.register(d))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:uh,name:"Portal"})),a):null});function S8(e,t){let n=ht(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=ot();return r?E.createElement(E8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:uh,name:"Portal"})}let P8=E.Fragment,fh=E.createContext(null);function T8(e,t){let{target:n,...r}=e,o={ref:ht(t)},s=ot();return E.createElement(fh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:P8,name:"Popover.Group"}))}let A8=E.createContext(null),$8=qe(S8),N8=qe(T8),C8=Object.assign($8,{Group:N8});const li={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function dh(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function O8(e,t,n){let r=rt();if(t.kind==="Tracked"){let o=function(){s!==dh(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 I8(){let e=typeof document>"u";return"useSyncExternalStore"in U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function ph(){let e=I8(),[t,n]=U.useState(_t.isHandoffComplete);return t&&_t.isHandoffComplete===!1&&n(!1),U.useEffect(()=>{t!==!0&&n(!0)},[t]),U.useEffect(()=>_t.handoff(),[]),e?!1:t}function k8(){let e=E.useRef(!1);return Ee(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function hh(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!_o((t=e.as)!=null?t:bh)||E.Children.count(e.children)===1}let ui=E.createContext(null);ui.displayName="TransitionContext";var D8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(D8||{});function M8(){let e=E.useContext(ui);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function L8(){let e=E.useContext(fi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let fi=E.createContext(null);fi.displayName="NestingContext";function di(e){return"children"in e?di(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function mh(e,t){let n=Yn(e),r=E.useRef([]),o=k8(),s=Kn(),i=ue((p,h=$n.Hidden)=>{let b=r.current.findIndex(({el:S})=>S===p);b!==-1&&(pt(h,{[$n.Unmount](){r.current.splice(b,1)},[$n.Hidden](){r.current[b].state="hidden"}}),s.microTask(()=>{var S;!di(r)&&o.current&&((S=n.current)==null||S.call(n))}))}),c=ue(p=>{let h=r.current.find(({el:b})=>b===p);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:p,state:"visible"}),()=>i(p,$n.Unmount)}),a=E.useRef([]),l=E.useRef(Promise.resolve()),u=E.useRef({enter:[],leave:[]}),f=ue((p,h,b)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([S])=>S!==p)),t==null||t.chains.current[h].push([p,new Promise(S=>{a.current.push(S)})]),t==null||t.chains.current[h].push([p,new Promise(S=>{Promise.all(u.current[h].map(([P,x])=>x)).then(()=>S())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(h)):b(h)}),d=ue((p,h,b)=>{Promise.all(u.current[h].splice(0).map(([S,P])=>P)).then(()=>{var S;(S=a.current.shift())==null||S()}).then(()=>b(h))});return E.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:d,wait:l,chains:u}),[c,i,r,f,d,u,l])}let bh=E.Fragment,gh=Vs.RenderStrategy;function B8(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:c,afterLeave:a,enter:l,enterFrom:u,enterTo:f,entered:d,leave:p,leaveFrom:h,leaveTo:b,...S}=e,[P,x]=E.useState(null),w=E.useRef(null),A=hh(e),M=ht(...A?[w,t,x]:t===null?[]:[t]),B=(n=S.unmount)==null||n?$n.Unmount:$n.Hidden,{show:F,appear:m,initial:g}=M8(),[v,$]=E.useState(F?"visible":"hidden"),N=L8(),{register:O,unregister:k}=N;Ee(()=>O(w),[O,w]),Ee(()=>{if(B===$n.Hidden&&w.current){if(F&&v!=="visible"){$("visible");return}return pt(v,{hidden:()=>k(w),visible:()=>O(w)})}},[v,w,O,k,F,B]);let y=ph();Ee(()=>{if(A&&y&&v==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,v,y,A]);let C=g&&!m,I=m&&F&&g,T=E.useRef(!1),L=mh(()=>{T.current||($("hidden"),k(w))},N),j=ue(Z=>{T.current=!0;let J=Z?"enter":"leave";L.onStart(w,J,ee=>{ee==="enter"?s==null||s():ee==="leave"&&(c==null||c())})}),z=ue(Z=>{let J=Z?"enter":"leave";T.current=!1,L.onStop(w,J,ee=>{ee==="enter"?i==null||i():ee==="leave"&&(a==null||a())}),J==="leave"&&!di(L)&&($("hidden"),k(w))});E.useEffect(()=>{A&&o||(j(F),z(F))},[F,A,o]);let _=!(!o||!A||!y||C),[,H]=vp(_,P,F,{start:j,end:z}),Y=Nn({ref:M,className:((r=Ac(S.className,I&&l,I&&u,H.enter&&l,H.enter&&H.closed&&u,H.enter&&!H.closed&&f,H.leave&&p,H.leave&&!H.closed&&h,H.leave&&H.closed&&b,!H.transition&&F&&d))==null?void 0:r.trim())||void 0,...yp(H)}),G=0;v==="visible"&&(G|=kt.Open),v==="hidden"&&(G|=kt.Closed),F&&v==="hidden"&&(G|=kt.Opening),!F&&v==="visible"&&(G|=kt.Closing);let W=ot();return E.createElement(fi.Provider,{value:L},E.createElement(ch,{value:G},W({ourProps:Y,theirProps:S,defaultTag:bh,features:gh,visible:v==="visible",name:"Transition.Child"})))}function F8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=E.useRef(null),c=hh(e),a=ht(...c?[i,t]:t===null?[]:[t]);ph();let l=ll();if(n===void 0&&l!==null&&(n=(l&kt.Open)===kt.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=E.useState(n?"visible":"hidden"),d=mh(()=>{n||f("hidden")}),[p,h]=E.useState(!0),b=E.useRef([n]);Ee(()=>{p!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),h(!1))},[b,n]);let S=E.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);Ee(()=>{n?f("visible"):!di(d)&&i.current!==null&&f("hidden")},[n,d]);let P={unmount:o},x=ue(()=>{var M;p&&h(!1),(M=e.beforeEnter)==null||M.call(e)}),w=ue(()=>{var M;p&&h(!1),(M=e.beforeLeave)==null||M.call(e)}),A=ot();return E.createElement(fi.Provider,{value:d},E.createElement(ui.Provider,{value:S},A({ourProps:{...P,as:E.Fragment,children:E.createElement(yh,{ref:a,...P,...s,beforeEnter:x,beforeLeave:w})},theirProps:{},defaultTag:E.Fragment,features:gh,visible:u==="visible",name:"Transition"})))}function R8(e,t){let n=E.useContext(ui)!==null,r=ll()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(ul,{ref:t,...e}):E.createElement(yh,{ref:t,...e}))}let ul=qe(F8),yh=qe(B8),j8=qe(R8),fl=Object.assign(ul,{Child:j8,Root:ul}),vh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function wh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!an(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 vh.test(i)&&(i=i.replace(vh,"")),i}function _8(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():wh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return wh(e).trim()}function z8(e){let t=E.useRef(""),n=E.useRef("");return ue(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=_8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var U8=Object.defineProperty,W8=(e,t,n)=>t in e?U8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xh=(e,t,n)=>(W8(e,typeof t!="symbol"?t+"":t,n),n),Le=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Le||{}),In=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(In||{}),pi=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(pi||{}),Eh=(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))(Eh||{});function Sh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=lp(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 H8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?li.Tracked(dh(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:li.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,d=ci(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.options[d].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...c,activeOptionIndex:d}}}}else if(t.focus===we.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,d=ci(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(d!==null){let p=e.options[d].dataRef.current.domRef;if(((s=f.current)==null?void 0:s.nextElementSibling)===p.current||((i=p.current)==null?void 0:i.nextElementSibling)===null)return{...c,activeOptionIndex:d}}}}let a=Sh(e),l=ci(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=ci(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,...Sh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:li.Moved}}};class dl extends X0{constructor(t){super(t),xh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return pt(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:kc(()=>{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:kc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:kc(()=>{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})}}),xh(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=Dc.get(null);this.disposables.add(r.on(tp.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(O8(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 dl({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:li.Idle})}reduce(t,n){return pt(n.type,H8,t,n)}}const Ph=E.createContext(null);function pl(e){let t=E.useContext(Ph);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Th),n}return t}function Th({id:e,__demoMode:t=!1}){let n=E.useMemo(()=>dl.new({id:e,__demoMode:t}),[]);return lh(()=>n.dispose()),n}let hi=E.createContext(null);hi.displayName="ListboxDataContext";function Zo(e){let t=E.useContext(hi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Zo),n}return t}let V8=E.Fragment;function G8(e,t){let n=E.useId(),r=Tc(),{value:o,defaultValue:s,form:i,name:c,onChange:a,by:l,invalid:u=!1,disabled:f=r||!1,horizontal:d=!1,multiple:p=!1,__demoMode:h=!1,...b}=e;const S=d?"horizontal":"vertical";let P=ht(t),x=vx(s),[w=p?[]:void 0,A]=yx(o,a,x),M=Th({id:n,__demoMode:h}),B=E.useRef({static:!1,hold:!1}),F=E.useRef(new Map),m=Vx(l),g=E.useCallback(_=>pt(v.mode,{[In.Multi]:()=>w.some(H=>m(H,_)),[In.Single]:()=>m(w,_)}),[w]),v=An({value:w,disabled:f,invalid:u,mode:p?In.Multi:In.Single,orientation:S,onChange:A,compare:m,isSelected:g,optionsPropsRef:B,listRef:F});Ee(()=>{M.state.dataRef.current=v},[v]);let $=Ze(M,_=>_.listboxState),N=Dc.get(null),O=Ze(N,E.useCallback(_=>N.selectors.isTop(_,n),[N,n])),[k,y]=Ze(M,_=>[_.buttonElement,_.optionsElement]);y2(O,[k,y],(_,H)=>{M.send({type:Eh.CloseListbox}),cp(H,_c.Loose)||(_.preventDefault(),k==null||k.focus())});let C=An({open:$===Le.Open,disabled:f,invalid:u,value:w}),[I,T]=jx({inherit:!0}),L={ref:P},j=E.useCallback(()=>{if(x!==void 0)return A==null?void 0:A(x)},[A,x]),z=ot();return E.createElement(T,{value:I,props:{htmlFor:k==null?void 0:k.id},slot:{open:$===Le.Open,disabled:f}},E.createElement(h8,null,E.createElement(Ph.Provider,{value:M},E.createElement(hi.Provider,{value:v},E.createElement(ch,{value:pt($,{[Le.Open]:kt.Open,[Le.Closed]:kt.Closed})},c!=null&&w!=null&&E.createElement(Ax,{disabled:f,data:{[c]:w},form:i,onReset:j}),z({ourProps:L,theirProps:b,slot:C,defaultTag:V8,name:"Listbox"}))))))}let q8="button";function Z8(e,t){let n=E.useId(),r=B0(),o=Zo("Listbox.Button"),s=pl("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...l}=e,u=ht(t,u8(),s.actions.setButtonElement),f=f8(),[d,p,h]=Ze(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),b=d===Le.Open;x2(b,{trigger:p,action:E.useCallback(y=>{if(p!=null&&p.contains(y.target))return Ks.Ignore;let C=y.target.closest('[role="option"]:not([data-disabled])');return an(C)?Ks.Select(C):h!=null&&h.contains(y.target)?Ks.Ignore:Ks.Close},[p,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let S=ue(y=>{switch(y.key){case Ie.Enter:wx(y.currentTarget);break;case Ie.Space:case Ie.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.First});break;case Ie.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?we.Nothing:we.Last});break}}),P=ue(y=>{switch(y.key){case Ie.Space:y.preventDefault();break}}),x=qx(y=>{var C;s.state.listboxState===Le.Open?(je.flushSync(()=>s.actions.closeListbox()),(C=s.state.buttonElement)==null||C.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:we.Nothing}))}),w=ue(y=>y.preventDefault()),A=V0([i]),M=Lx(),{isFocusVisible:B,focusProps:F}=ox({autoFocus:a}),{isHovered:m,hoverProps:g}=rx({isDisabled:c}),{pressed:v,pressProps:$}=fx({disabled:c}),N=An({open:d===Le.Open,active:v||d===Le.Open,disabled:c,invalid:o.invalid,value:o.value,hover:m,focus:B,autofocus:a}),O=Ze(s,y=>y.listboxState===Le.Open),k=I0(f(),{ref:u,id:i,type:E2(e,p),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":O,"aria-labelledby":A,"aria-describedby":M,disabled:c||void 0,autoFocus:a,onKeyDown:S,onKeyUp:P,onKeyPress:w},x,F,g,$);return ot()({ourProps:k,theirProps:l,slot:N,defaultTag:q8,name:"Listbox.Button"})}let Ah=E.createContext(!1),K8="div",Y8=Vs.RenderStrategy|Vs.Static;function X8(e,t){let n=E.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,l=l8(o),[u,f]=E.useState(null);l&&(s=!0);let d=Zo("Listbox.Options"),p=pl("Listbox.Options"),[h,b,S,P]=Ze(p,W=>[W.listboxState,W.buttonElement,W.optionsElement,W.__demoMode]),x=zc(b),w=zc(S),A=ll(),[M,B]=vp(c,u,A!==null?(A&kt.Open)===kt.Open:h===Le.Open);i2(M,b,p.actions.closeListbox);let F=P?!1:i&&h===Le.Open;C2(F,w);let m=P?!1:i&&h===Le.Open;s2(m,{allowed:E.useCallback(()=>[b,S],[b,S])});let g=Ze(p,p.selectors.didButtonMove)?!1:M,v=Ze(p,p.selectors.hasFrozenValue)&&!e.static,$=ah(v,d.value),N=E.useCallback(W=>d.compare($,W),[d.compare,$]),O=Ze(p,W=>{var Z;if(l==null||!((Z=l==null?void 0:l.to)!=null&&Z.includes("selection")))return null;let J=W.options.findIndex(ee=>N(ee.dataRef.current.value));return J===-1&&(J=0),J}),k=(()=>{if(l==null)return;if(O===null)return{...l,inner:void 0};let W=Array.from(d.listRef.current.values());return{...l,inner:{listRef:{current:W},index:O}}})(),[y,C]=p8(k),I=d8(),T=ht(t,l?y:null,p.actions.setOptionsElement,f),L=Kn();E.useEffect(()=>{let W=S;W&&h===Le.Open&&(cx(W)||W==null||W.focus({preventScroll:!0}))},[h,S]);let j=ue(W=>{var Z;switch(L.dispose(),W.key){case Ie.Space:if(p.state.searchQuery!=="")return W.preventDefault(),W.stopPropagation(),p.actions.search(W.key);case Ie.Enter:W.preventDefault(),W.stopPropagation(),p.actions.selectActiveOption();break;case pt(d.orientation,{vertical:Ie.ArrowDown,horizontal:Ie.ArrowRight}):return W.preventDefault(),W.stopPropagation(),p.actions.goToOption({focus:we.Next});case pt(d.orientation,{vertical:Ie.ArrowUp,horizontal:Ie.ArrowLeft}):return W.preventDefault(),W.stopPropagation(),p.actions.goToOption({focus:we.Previous});case Ie.Home:case Ie.PageUp:return W.preventDefault(),W.stopPropagation(),p.actions.goToOption({focus:we.First});case Ie.End:case Ie.PageDown:return W.preventDefault(),W.stopPropagation(),p.actions.goToOption({focus:we.Last});case Ie.Escape:W.preventDefault(),W.stopPropagation(),je.flushSync(()=>p.actions.closeListbox()),(Z=p.state.buttonElement)==null||Z.focus({preventScroll:!0});return;case Ie.Tab:W.preventDefault(),W.stopPropagation(),je.flushSync(()=>p.actions.closeListbox()),h2(p.state.buttonElement,W.shiftKey?jc.Previous:jc.Next);break;default:W.key.length===1&&(p.actions.search(W.key),L.setTimeout(()=>p.actions.clearSearch(),350));break}}),z=Ze(p,W=>{var Z;return(Z=W.buttonElement)==null?void 0:Z.id}),_=An({open:h===Le.Open}),H=I0(l?I():{},{id:r,ref:T,"aria-activedescendant":Ze(p,p.selectors.activeDescendantId),"aria-multiselectable":d.mode===In.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":d.orientation,onKeyDown:j,role:"listbox",tabIndex:h===Le.Open?0:void 0,style:{...a.style,...C,"--button-width":Gx(M,b,!0).width},...yp(B)}),Y=ot(),G=E.useMemo(()=>d.mode===In.Multi?d:{...d,isSelected:N},[d,N]);return E.createElement(C8,{enabled:s?e.static||M:!1,ownerDocument:x},E.createElement(hi.Provider,{value:G},Y({ourProps:H,theirProps:a,slot:_,defaultTag:K8,features:Y8,visible:g,name:"Listbox.Options"})))}let Q8="div";function J8(e,t){let n=E.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=E.useContext(Ah)===!0,a=Zo("Listbox.Option"),l=pl("Listbox.Option"),u=Ze(l,v=>l.selectors.isActive(v,r)),f=a.isSelected(s),d=E.useRef(null),p=z8(d),h=Yn({disabled:o,value:s,domRef:d,get textValue(){return p()}}),b=ht(t,d,v=>{v?a.listRef.current.set(r,v):a.listRef.current.delete(r)}),S=Ze(l,v=>l.selectors.shouldScrollIntoView(v,r));Ee(()=>{if(S)return rt().requestAnimationFrame(()=>{var v,$;($=(v=d.current)==null?void 0:v.scrollIntoView)==null||$.call(v,{block:"nearest"})})},[S,d]),Ee(()=>{if(!c)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,c]);let P=ue(v=>{if(o)return v.preventDefault();l.actions.selectOption(s)}),x=ue(()=>{if(o)return l.actions.goToOption({focus:we.Nothing});l.actions.goToOption({focus:we.Specific,id:r})}),w=O2(),A=ue(v=>w.update(v)),M=ue(v=>{w.wasMoved(v)&&(o||u&&l.state.activationTrigger===pi.Pointer||l.actions.goToOption({focus:we.Specific,id:r},pi.Pointer))}),B=ue(v=>{w.wasMoved(v)&&(o||u&&l.state.activationTrigger===pi.Pointer&&l.actions.goToOption({focus:we.Nothing}))}),F=An({active:u,focus:u,selected:f,disabled:o,selectedOption:f&&c}),m=c?{}:{id:r,ref:b,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":f,disabled:void 0,onClick:P,onFocus:x,onPointerEnter:A,onMouseEnter:A,onPointerMove:M,onMouseMove:M,onPointerLeave:B,onMouseLeave:B},g=ot();return!f&&c?null:g({ourProps:m,theirProps:i,slot:F,defaultTag:Q8,name:"Listbox.Option"})}let e3=E.Fragment;function t3(e,t){let{options:n,placeholder:r,...o}=e,s={ref:ht(t)},i=Zo("ListboxSelectedOption"),c=An({}),a=i.value===void 0||i.value===null||i.mode===In.Multi&&Array.isArray(i.value)&&i.value.length===0,l=ot();return E.createElement(Ah.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:E.createElement(E.Fragment,null,r&&a?r:n)},slot:c,defaultTag:e3,name:"ListboxSelectedOption"}))}let n3=qe(G8),r3=qe(Z8),o3=Wx,s3=qe(X8),i3=qe(J8),a3=qe(t3),gt=Object.assign(n3,{Button:r3,Label:o3,Options:s3,Option:i3,SelectedOption:a3});const c3=()=>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)"})})})]}),l3=()=>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)"})})})]}),Ko=({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(c3,{}):D.jsx(l3,{})},o))})};class Dt{}ts(Dt,"FAST",3),ts(Dt,"Medium",2),ts(Dt,"SLOW",1),ts(Dt,"NONE",0);const u3=Object.values({MAINNET:1,SEPOLIA:11155111}),dn=e=>{const t=typeof e=="string"?parseInt(e,10):e;return u3.includes(t)},f3={USDT:!0},$h=(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:!f3[t.toUpperCase()]:!0},d3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=Et();return D.jsx("div",{className:`relative ${o}`,children:D.jsx(gt,{value:t,onChange:n,disabled:r,children:({open:c})=>D.jsxs(D.Fragment,{children:[D.jsxs(gt.Button,{className:`
|
|
140
140
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
141
141
|
items-center justify-between flex px-3 rounded-lg
|
|
142
142
|
focus:outline-none
|
|
143
143
|
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
144
144
|
${c?"ring-1 ring-white":""}
|
|
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(
|
|
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(fl,{as:E.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(gt.Options,{className:`
|
|
146
146
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
147
147
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
148
148
|
focus:outline-none
|
|
149
|
-
`,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>D.jsx(
|
|
149
|
+
`,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>D.jsx(gt.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(Ko,{className:"w-full justify-between",selectedLevel:dn(a.chainId)?Dt.SLOW:Dt.FAST,maxLevel:3})})]})})},a.chainId))})})]})})})},p3=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:c}=Et(),a=l=>l.token||l.symbol;return D.jsx("div",{className:`relative ${o}`,children:D.jsx(gt,{value:t,onChange:n,disabled:r,children:({open:l})=>D.jsxs(D.Fragment,{children:[D.jsxs(gt.Button,{className:`
|
|
150
150
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
151
151
|
items-center justify-between flex px-3 rounded-lg
|
|
152
152
|
focus:outline-none
|
|
153
153
|
${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
154
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(
|
|
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(fl,{as:E.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(gt.Options,{className:`
|
|
156
156
|
absolute z-50 mt-1 w-full max-h-[230px] overflow-y-auto rounded-lg
|
|
157
157
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
158
158
|
focus:outline-none
|
|
159
|
-
`,children:e.map(u=>D.jsx(
|
|
159
|
+
`,children:e.map(u=>D.jsx(gt.Option,{value:u,className:({active:f,selected:d})=>`relative cursor-pointer select-none py-3 px-3 ${d?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:d})=>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||d?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===Sn&&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)))})})]})})})},Nh=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=Sn,txType:i="deposit",accountType:c})=>{const a=E.useCallback(S=>i==="withdraw"?s===Sn?S.allowAaWithdraw!==!1:S.allowWithdraw!==!1:s===Sn?S.allowAaDeposit!==!1:S.allowDeposit!==!1,[i,s]),l=E.useMemo(()=>{const S=new Set,P=[];for(const x of t)if(a(x))for(const w of x.tokenList||[]){const A=w.symbol||w.token;!A||!(i!=="withdraw"||w.withdrawEnable===!0&&w.pullOff===!1)||S.has(A)||(S.add(A),P.push({token:A,symbol:A,iconUrl:w.iconUrl,decimals:w.decimals,tokenAddress:w.tokenAddress}))}return P},[t,a,i]),u=S=>{n(S.chainId)},f=S=>{const P=S.symbol||S.token;o(P);const x=[];for(const w of t){if(!a(w))continue;(w.tokenList||[]).some(M=>(M.symbol||M.token)===P)&&x.push(w.chainId)}!x.includes(e.chainId)&&x[0]!==void 0&&n(x[0])},d=E.useMemo(()=>{var x,w;const S=r||((x=l[0])==null?void 0:x.symbol)||((w=l[0])==null?void 0:w.token);if(!S)return[];const P=[];for(const A of t){if(!a(A))continue;const M=(A.tokenList||[]).find(B=>(B.symbol||B.token)===S?i==="withdraw"?B.withdrawEnable===!0&&B.pullOff===!1:!0:!1);M&&P.push({...A,tokenList:[{token:M.token,symbol:M.symbol,iconUrl:M.iconUrl,decimals:M.decimals,tokenAddress:M.tokenAddress}]})}return P},[t,r,l,a,i]),p=E.useMemo(()=>d.find(S=>S.chainId===e.chainId)||d[0],[d,e.chainId]),h=E.useMemo(()=>l,[l]),b=E.useMemo(()=>{if(h.length!==0)return h.find(S=>S.token===r||S.symbol===r)||h[0]},[h,r]);return E.useEffect(()=>{if(h.length===0)return;if(!h.some(P=>(P.symbol||P.token)===r)){const P=h[0];o(P.symbol||P.token)}},[h,r,o]),E.useEffect(()=>{if(d.length===0)return;d.some(P=>P.chainId===e.chainId)||n(d[0].chainId)},[d,e.chainId,n]),D.jsxs("div",{className:"space-y-4",children:[h.length>0&&b&&D.jsx(p3,{tokens:h,selectedToken:b,onTokenChange:f,walletType:s,accountType:c}),D.jsx(d3,{chains:d,selectedChain:p,onChainChange:S=>{const P=t.find(x=>x.chainId===S.chainId);P&&u(P)},walletType:s,className:"w-full"})]})},h3=({options:e})=>D.jsx(D.Fragment,{children:e.map(t=>D.jsx(gt.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))}),Ch=({selectedAccount:e,onAccountChange:t,disabled:n=!1,className:r=""})=>{var f;const{t:o}=Et(),s=E.useMemo(()=>[{value:"spot",label:o("account.spot")},{value:"perpetual",label:o("account.perpetual")}],[o]),i=((f=s.find(d=>d.value===(e??"spot")))==null?void 0:f.label)||"",[c,a]=E.useState(e??"spot"),l=e??c,u=d=>{t==null||t(d),e||a(d)};return D.jsx("div",{className:`relative mb-4 ${r}`,children:D.jsx(gt,{value:l,onChange:u,disabled:n,children:({open:d})=>D.jsxs(D.Fragment,{children:[D.jsxs(gt.Button,{className:`
|
|
160
160
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
161
161
|
items-center justify-between flex px-3 rounded-lg
|
|
162
162
|
focus:outline-none
|
|
163
163
|
${n?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
|
|
164
|
-
${
|
|
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 ${
|
|
164
|
+
${d?"ring-1 ring-white":""}
|
|
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 ${d?"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(fl,{as:E.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(gt.Options,{className:`
|
|
166
166
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
167
167
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
168
168
|
focus:outline-none
|
|
169
|
-
`,children:D.jsx(
|
|
169
|
+
`,children:D.jsx(h3,{options:s})})})]})})})};var mi={},m3=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()}},b3=m3,Oh={"text/plain":"Text","text/html":"Url",default:"Text"},g3="Copy to clipboard: #{key}, Enter";function y3(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function v3(e,t){var n,r,o,s,i,c,a=!1;t||(t={}),n=t.debug||!1;try{o=b3(),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=Oh[t.format]||Oh.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=y3("message"in t?t.message:g3),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),c&&document.body.removeChild(c),o()}return a}var w3=v3;Object.defineProperty(mi,"__esModule",{value:!0}),mi.CopyToClipboard=void 0;var x3=Ih(w3),bi=Ih(E),E3=["text","onCopy","options","children"];function Ih(e){return e&&e.__esModule?e:{default:e}}function Lr(e){"@babel/helpers - typeof";return Lr=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},Lr(e)}function kh(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 Dh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kh(Object(n),!0).forEach(function(r){ml(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function S3(e,t){if(e==null)return{};var n,r,o=P3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function T3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A3(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,Lh(r.key),r)}}function $3(e,t,n){return t&&A3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N3(e,t,n){return t=gi(t),C3(e,Mh()?Reflect.construct(t,n||[],gi(e).constructor):t.apply(e,n))}function C3(e,t){if(t&&(Lr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return O3(e)}function O3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mh=function(){return!!e})()}function gi(e){return gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gi(e)}function I3(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&&hl(e,t)}function hl(e,t){return hl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},hl(e,t)}function ml(e,t,n){return(t=Lh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lh(e){var t=k3(e,"string");return Lr(t)=="symbol"?t:t+""}function k3(e,t){if(Lr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var D3=mi.CopyToClipboard=function(e){function t(){var n;T3(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=N3(this,t,[].concat(o)),ml(n,"onClick",function(i){var c=n.props,a=c.text,l=c.onCopy,u=c.children,f=c.options,d=bi.default.Children.only(u),p=(0,x3.default)(a,f);l&&l(a,p),d!=null&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(i)}),n}return I3(t,e),$3(t,[{key:"render",value:function(){var r=this.props;r.text,r.onCopy,r.options;var o=r.children,s=S3(r,E3),i=bi.default.Children.only(o);return bi.default.cloneElement(i,Dh(Dh({},s),{},{onClick:this.onClick}))}}])}(bi.default.PureComponent);ml(D3,"defaultProps",{onCopy:void 0,options:void 0});var M3=mi,bl=M3.CopyToClipboard;bl.CopyToClipboard=bl;var L3=bl;const B3=_m(L3);var F3=Object.defineProperty,yi=Object.getOwnPropertySymbols,Bh=Object.prototype.hasOwnProperty,Fh=Object.prototype.propertyIsEnumerable,Rh=(e,t,n)=>t in e?F3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gl=(e,t)=>{for(var n in t||(t={}))Bh.call(t,n)&&Rh(e,n,t[n]);if(yi)for(var n of yi(t))Fh.call(t,n)&&Rh(e,n,t[n]);return e},yl=(e,t)=>{var n={};for(var r in e)Bh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yi)for(var r of yi(e))t.indexOf(r)<0&&Fh.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
170
170
|
* @license QR Code generator library (TypeScript)
|
|
171
171
|
* Copyright (c) Project Nayuki.
|
|
172
172
|
* SPDX-License-Identifier: MIT
|
|
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,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&&(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 N of S.getData())v.push(N)}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,N)=>E[N>>>3]|=S<<7-(N&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,N=0;S<f;S++){let M=a.slice(N,N+m-p+(S<h?0:1));N+=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((N,M)=>{(S!=m-p||M>=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 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 Nr=Xn;/**
|
|
173
|
+
*/var tr;(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 d=[];for(let h=0;h<this.size;h++)d.push(!1);for(let h=0;h<this.size;h++)this.modules.push(d.slice()),this.isFunction.push(d.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(u);if(this.drawCodewords(p),f==-1){let h=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);const S=this.getPenaltyScore();S<h&&(f=b,h=S),this.applyMask(b)}}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,d=-1,p=!0){if(!(ae.MIN_VERSION<=u&&u<=f&&f<=ae.MAX_VERSION)||d<-1||d>7)throw new RangeError("Invalid value");let h,b;for(h=u;;h++){const w=ae.getNumDataCodewords(h,l)*8,A=i.getTotalBits(a,h);if(A<=w){b=A;break}if(h>=f)throw new RangeError("Data too long")}for(const w of[ae.Ecc.MEDIUM,ae.Ecc.QUARTILE,ae.Ecc.HIGH])p&&b<=ae.getNumDataCodewords(h,w)*8&&(l=w);let S=[];for(const w of a){n(w.mode.modeBits,4,S),n(w.numChars,w.mode.numCharCountBits(h),S);for(const A of w.getData())S.push(A)}o(S.length==b);const P=ae.getNumDataCodewords(h,l)*8;o(S.length<=P),n(0,Math.min(4,P-S.length),S),n(0,(8-S.length%8)%8,S),o(S.length%8==0);for(let w=236;S.length<P;w^=253)n(w,8,S);let x=[];for(;x.length*8<S.length;)x.push(0);return S.forEach((w,A)=>x[A>>>3]|=w<<7-(A&7)),new ae(h,l,x,d)}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 d=0;d<10;d++)u=u<<1^(u>>>9)*1335;const f=(l<<10|u)^21522;o(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,r(f,d));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,r(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,r(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,r(f,d));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),d=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(d,p,f),this.setFunctionModule(p,d,f)}}drawFinderPattern(a,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),p=a+f,h=l+u;0<=p&&p<this.size&&0<=h&&h<this.size&&this.setFunctionModule(p,h,d!=2&&d!=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],d=ae.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],p=Math.floor(ae.getNumRawDataModules(l)/8),h=f-p%f,b=Math.floor(p/f);let S=[];const P=ae.reedSolomonComputeDivisor(d);for(let w=0,A=0;w<f;w++){let M=a.slice(A,A+b-d+(w<h?0:1));A+=M.length;const B=ae.reedSolomonComputeRemainder(M,P);w<h&&M.push(0),S.push(M.concat(B))}let x=[];for(let w=0;w<S[0].length;w++)S.forEach((A,M)=>{(w!=b-d||M>=h)&&x.push(A[w])});return o(x.length==p),x}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 d=0;d<2;d++){const p=u-d,b=(u+1&2)==0?this.size-1-f:f;!this.isFunction[b][p]&&l<a.length*8&&(this.modules[b][p]=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 d=0;d<this.size;d++){let p=!1,h=0,b=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[d][S]==p?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,b),p||(a+=this.finderPenaltyCountPatterns(b)*ae.PENALTY_N3),p=this.modules[d][S],h=1);a+=this.finderPenaltyTerminateAndCount(p,h,b)*ae.PENALTY_N3}for(let d=0;d<this.size;d++){let p=!1,h=0,b=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][d]==p?(h++,h==5?a+=ae.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,b),p||(a+=this.finderPenaltyCountPatterns(b)*ae.PENALTY_N3),p=this.modules[S][d],h=1);a+=this.finderPenaltyTerminateAndCount(p,h,b)*ae.PENALTY_N3}for(let d=0;d<this.size-1;d++)for(let p=0;p<this.size-1;p++){const h=this.modules[d][p];h==this.modules[d][p+1]&&h==this.modules[d+1][p]&&h==this.modules[d+1][p+1]&&(a+=ae.PENALTY_N2)}let l=0;for(const d of this.modules)l=d.reduce((p,h)=>p+(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 d=0;d<l.length;d++)l[d]=ae.reedSolomonMultiply(l[d],u),d+1<l.length&&(l[d]^=l[d+1]);u=ae.reedSolomonMultiply(u,2)}return l}static reedSolomonComputeRemainder(a,l){let u=l.map(f=>0);for(const f of a){const d=f^u.shift();u.push(0),l.forEach((p,h)=>u[h]^=ae.reedSolomonMultiply(p,d))}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 d=f.mode.numCharCountBits(l);if(f.numChars>=1<<d)return 1/0;u+=4+d+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})(tr||(tr={})),(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={}))})(tr||(tr={})),(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={}))})(tr||(tr={}));var Br=tr;/**
|
|
174
174
|
* @license qrcode.react
|
|
175
175
|
* Copyright (c) Paul O'Shannessy
|
|
176
176
|
* SPDX-License-Identifier: ISC
|
|
177
|
-
*/var k3={L:Nr.QrCode.Ecc.LOW,M:Nr.QrCode.Ecc.MEDIUM,Q:Nr.QrCode.Ecc.QUARTILE,H:Nr.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(...Nr.QrSegment.makeSegments(v)),m),[]);return Nr.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),N=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:$}=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 A=g;const I=N.current,P=$!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;P&&$.excavation!=null&&(A=_h(g,$.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(A,b))):g.forEach(function(z,_){z.forEach(function(H,Y){H&&y.fillRect(Y+b,_+b,1,1)})}),$&&(y.globalAlpha=$.opacity),P&&y.drawImage(I,$.x+b,$.y+b,$.w,$.h)}}),x.useEffect(()=>{F(!1)},[E]);const C=ll({height:s,width:s},v);let O=null;return E!=null&&(O=x.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{F(!0)},ref:N,crossOrigin:$==null?void 0:$.crossOrigin})),x.createElement(x.Fragment,null,x.createElement("canvas",ll({style:C,height:s,width:s,ref:M,role:"img"},T)),O)});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 N=T,M=null;h!=null&&S!=null&&(S.excavation!=null&&(N=_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(N,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={...U};function ui(e){const t=U.useRef(e);return Wt(()=>{t.current=e}),t}const Q3=X3.useInsertionEffect||(e=>e());function Ht(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Q3(()=>{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=$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={...U};let Xh=!1,oS=0;const Qh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+oS++;function sS(){const[e,t]=U.useState(()=>Xh?Qh():void 0);return Wt(()=>{e==null&&t(Qh())},[]),U.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=U.createContext(null),lS=U.createContext(null),bl=()=>{var e;return((e=U.useContext(cS))==null?void 0:e.id)||null},gl=()=>U.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=U.useRef(),N=U.useRef(-1),M=U.useRef(),B=U.useRef(-1),F=U.useRef(!0),b=U.useRef(!1),g=U.useRef(()=>{}),w=U.useRef(!1),$=Ht(()=>{var I;const P=(I=o.current.openEvent)==null?void 0:I.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"});U.useEffect(()=>{if(!c)return;function I(P){let{open:L}=P;L||(bt(N),bt(B),F.current=!0,w.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[c,s]),U.useEffect(()=>{if(!c||!m.current||!n)return;function I(L){$()&&r(!1,L,"hover")}const P=Ut(i.floating).documentElement;return P.addEventListener("mouseleave",I),()=>{P.removeEventListener("mouseleave",I)}},[i.floating,n,r,c,m,$]);const C=U.useCallback(function(I,P,L){P===void 0&&(P=!0),L===void 0&&(L="hover");const j=yl(v.current,"close",S.current);j&&!M.current?(bt(N),N.current=window.setTimeout(()=>r(!1,I,L),j)):P&&(bt(N),r(!1,I,L))},[v,r]),O=Ht(()=>{g.current(),M.current=void 0}),k=Ht(()=>{if(b.current){const I=Ut(i.floating).body;I.style.pointerEvents="",I.removeAttribute(Jh),b.current=!1}}),y=Ht(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!c)return;function I(_){if(bt(N),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?N.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(N),M.current=m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){k(),O(),y()||C(_,!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)&&C(_)}function L(_){y()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){k(),O(),y()||C(_)}})(_))}function j(){bt(N)}function z(_){y()||C(_,!1)}if(de(i.domReference)){const _=i.domReference,H=i.floating;return n&&_.addEventListener("mouseleave",L),p&&_.addEventListener("mousemove",I,{once:!0}),_.addEventListener("mouseenter",I),_.addEventListener("mouseleave",P),H&&(H.addEventListener("mouseleave",L),H.addEventListener("mouseenter",j),H.addEventListener("mouseleave",z)),()=>{n&&_.removeEventListener("mouseleave",L),p&&_.removeEventListener("mousemove",I),_.removeEventListener("mouseenter",I),_.removeEventListener("mouseleave",P),H&&(H.removeEventListener("mouseleave",L),H.removeEventListener("mouseenter",j),H.removeEventListener("mouseleave",z))}}},[i,c,e,u,p,C,O,k,r,n,T,d,v,m,o,y,E]),Wt(()=>{var I;if(c&&n&&(I=m.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&$()){b.current=!0;const L=i.floating;if(de(i.domReference)&&L){var P;const j=Ut(i.floating).body;j.setAttribute(Jh,"");const z=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",z.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",z.style.pointerEvents="",L.style.pointerEvents=""}}}},[c,n,h,i,d,m,$]),Wt(()=>{n||(S.current=void 0,w.current=!1,O(),k())},[n,O,k]),U.useEffect(()=>()=>{O(),bt(N),bt(B),k()},[c,i.domReference,O,k]);const A=U.useMemo(()=>{function I(P){S.current=P.pointerType}return{onPointerDown:I,onPointerEnter:I,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 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();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=U.createContext(null),rm=Wo("portal");function fS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=hl(),o=pS(),[s,i]=U.useState(null),c=U.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]=U.useState(null),a=U.useRef(null),l=U.useRef(null),u=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(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]),U.useEffect(()=>{s&&(d||Zh(s))},[d,s]),D.jsxs(nm.Provider,{value:U.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=()=>U.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=U.useRef(),d=U.useRef(!1),h=U.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 U.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=U.useRef(!1),{escapeKey:S,outsidePress:N}=im(d),{escapeKey:M,outsidePress:B}=im(h),F=U.useRef(!1),b=Ht(k=>{var y;if(!n||!i||!c||k.key!=="Escape"||F.current)return;const A=(y=s.current.floatingContext)==null?void 0:y.nodeId,I=m?li(m.nodesRef.current,A):[];if(!S&&(k.stopPropagation(),I.length>0)){let P=!0;if(I.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 A=()=>{var I;b(k),(I=Ir(k))==null||I.removeEventListener("keydown",A)};(y=Ir(k))==null||y.addEventListener("keydown",A)}),w=Ht(k=>{var y;const A=s.current.insideReactTree;s.current.insideReactTree=!1;const I=E.current;if(E.current=!1,l==="click"&&I||A||typeof T=="function"&&!T(k))return;const P=Ir(k),L="["+Wo("inert")+"]",j=Ut(o.floating).querySelectorAll(L);let z=de(P)?P:null;for(;z&&!sn(z);){const G=an(z);if(sn(G)||!de(G))break;z=G}if(j.length&&de(P)&&!V3(P)&&!Or(P,o.floating)&&Array.from(j).every(G=>!Or(z,G)))return;if(Fe(P)&&O){const G=sn(P),W=ht(P),Z=/auto|scroll/,J=G||Z.test(W.overflowX),ee=G||Z.test(W.overflowY),fe=J&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,pe=ee&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,he=W.direction==="rtl",se=pe&&(he?k.offsetX<=P.offsetWidth-P.clientWidth:k.offsetX>P.clientWidth),me=fe&&k.offsetY>P.clientHeight;if(se||me)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")}),$=Ht(k=>{var y;const A=()=>{var I;w(k),(I=Ir(k))==null||I.removeEventListener(l,A)};(y=Ir(k))==null||y.addEventListener(l,A)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=N;let k=-1;function y(j){r(!1,j,"ancestor-scroll")}function A(){window.clearTimeout(k),F.current=!0}function I(){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",A),P.addEventListener("compositionend",I)),T&&P.addEventListener(l,B?$:w,B);let L=[];return p&&(de(o.domReference)&&(L=An(o.domReference)),de(o.floating)&&(L=L.concat(An(o.floating))),!de(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(An(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",M?g:b,M),P.removeEventListener("compositionstart",A),P.removeEventListener("compositionend",I)),T&&P.removeEventListener(l,B?$:w,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(k)}},[s,o,c,T,l,n,r,p,i,S,N,b,M,g,w,B,$]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,T,l]);const C=U.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]),O=U.useMemo(()=>({onKeyDown:b,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[gS[l]]:()=>{s.current.insideReactTree=!0}}),[b,l,s]);return U.useMemo(()=>i?{reference:C,floating:O}:{},[i,C,O])}function vS(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=hl(),s=U.useRef({}),[i]=U.useState(()=>aS()),c=bl()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!de(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]=U.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=U.useMemo(()=>({setPositionReference:l}),[]),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: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]=U.useState(null),[c,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),p=gl();Wt(()=>{u&&(f.current=u)},[u]);const d=Up({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(S=>{const N=de(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(N),d.refs.setReference(N)},[d.refs]),m=U.useCallback(S=>{(de(S)||S===null)&&(f.current=S,i(S)),(de(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!de(S))&&d.refs.setReference(S)},[d.refs]),v=U.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=U.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=U.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(N=>N.id===t);S&&(S.context=E)}),U.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=U.useRef(!1),u=U.useRef(-1),f=U.useRef(!0);U.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]),U.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]),U.useEffect(()=>()=>{bt(u)},[]);const p=U.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const h=Ir(d.nativeEvent);if(a&&de(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=de(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 U.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=U.useCallback(c=>xl(c,e,"reference"),t),s=U.useCallback(c=>xl(c,e,"floating"),n),i=U.useCallback(c=>xl(c,e,"item"),r);return U.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=U.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=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:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,f,h,o,u,a]),v=U.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=U.useCallback(E=>{let{active:S,selected:N}=E;const M={role:"option",...S&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...M,"aria-selected":N}}return{}},[f,a]);return U.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:N,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,...N(),className:"cursor-help",children:e}),l&&D.jsx(dS,{children:D.jsxs("div",{ref:p.setFloating,...M(),style:{...d,zIndex:101},className:`
|
|
177
|
+
*/var R3={L:Br.QrCode.Ecc.LOW,M:Br.QrCode.Ecc.MEDIUM,Q:Br.QrCode.Ecc.QUARTILE,H:Br.QrCode.Ecc.HIGH},jh=128,_h="L",zh="#FFFFFF",Uh="#000000",Wh=!1,Hh=1,j3=4,_3=0,z3=.1;function Vh(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 Gh(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 U3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*z3),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 d=null;if(r.excavate){let h=Math.floor(l),b=Math.floor(u),S=Math.ceil(c+l-h),P=Math.ceil(a+u-b);d={x:h,y:b,w:S,h:P}}const p=r.crossOrigin;return{x:l,y:u,h:a,w:c,excavation:d,opacity:f,crossOrigin:p}}function W3(e,t){return t!=null?Math.max(Math.floor(t),0):e?j3:_3}function qh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=E.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((b,S)=>(b.push(...Br.QrSegment.makeSegments(S)),b),[]);return Br.QrCode.encodeSegments(h,R3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:u,numCells:f,calculatedImageSettings:d}=E.useMemo(()=>{let p=a.getModules();const h=W3(r,o),b=p.length+h*2,S=U3(p,i,h,s);return{cells:p,margin:h,numCells:b,calculatedImageSettings:S}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:l,numCells:f,calculatedImageSettings:d}}var H3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),V3=E.forwardRef(function(t,n){const r=t,{value:o,size:s=jh,level:i=_h,bgColor:c=zh,fgColor:a=Uh,includeMargin:l=Wh,minVersion:u=Hh,boostLevel:f,marginSize:d,imageSettings:p}=r,b=yl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=b,P=yl(b,["style"]),x=p==null?void 0:p.src,w=E.useRef(null),A=E.useRef(null),M=E.useCallback(k=>{w.current=k,typeof n=="function"?n(k):n&&(n.current=k)},[n]),[B,F]=E.useState(!1),{margin:m,cells:g,numCells:v,calculatedImageSettings:$}=qh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:d,imageSettings:p,size:s});E.useEffect(()=>{if(w.current!=null){const k=w.current,y=k.getContext("2d");if(!y)return;let C=g;const I=A.current,T=$!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;T&&$.excavation!=null&&(C=Gh(g,$.excavation));const L=window.devicePixelRatio||1;k.height=k.width=s*L;const j=s/v*L;y.scale(j,j),y.fillStyle=c,y.fillRect(0,0,v,v),y.fillStyle=a,H3?y.fill(new Path2D(Vh(C,m))):g.forEach(function(z,_){z.forEach(function(H,Y){H&&y.fillRect(Y+m,_+m,1,1)})}),$&&(y.globalAlpha=$.opacity),T&&y.drawImage(I,$.x+m,$.y+m,$.w,$.h)}}),E.useEffect(()=>{F(!1)},[x]);const N=gl({height:s,width:s},S);let O=null;return x!=null&&(O=E.createElement("img",{src:x,key:x,style:{display:"none"},onLoad:()=>{F(!0)},ref:A,crossOrigin:$==null?void 0:$.crossOrigin})),E.createElement(E.Fragment,null,E.createElement("canvas",gl({style:N,height:s,width:s,ref:M,role:"img"},P)),O)});V3.displayName="QRCodeCanvas";var Zh=E.forwardRef(function(t,n){const r=t,{value:o,size:s=jh,level:i=_h,bgColor:c=zh,fgColor:a=Uh,includeMargin:l=Wh,minVersion:u=Hh,boostLevel:f,title:d,marginSize:p,imageSettings:h}=r,b=yl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:P,numCells:x,calculatedImageSettings:w}=qh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:h,size:s});let A=P,M=null;h!=null&&w!=null&&(w.excavation!=null&&(A=Gh(P,w.excavation)),M=E.createElement("image",{href:h.src,height:w.h,width:w.w,x:w.x+S,y:w.y+S,preserveAspectRatio:"none",opacity:w.opacity,crossOrigin:w.crossOrigin}));const B=Vh(A,S);return E.createElement("svg",gl({height:s,width:s,viewBox:`0 0 ${x} ${x}`,ref:n,role:"img"},b),!!d&&E.createElement("title",null,d),E.createElement("path",{fill:c,d:`M0,0 h${x}v${x}H0z`,shapeRendering:"crispEdges"}),E.createElement("path",{fill:a,d:B,shapeRendering:"crispEdges"}),M)});Zh.displayName="QRCodeSVG";function G3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function q3(){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 Kh(){return/apple/i.test(navigator.vendor)}function Z3(){return G3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function K3(){return q3().includes("jsdom/")}const Yh="data-floating-ui-focusable",Y3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function vl(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 Fr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Wc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Rr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function wl(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 X3(e){return e.matches("html,body")}function Ht(e){return(e==null?void 0:e.ownerDocument)||document}function Xh(e){return Ye(e)&&e.matches(Y3)}function Q3(e){if(!e||K3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function J3(e){return e?e.hasAttribute(Yh)?e:e.querySelector("["+Yh+"]")||e:null}function vi(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,...vi(e,o.id,n)])}function eS(e){return"nativeEvent"in e}function Yo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var tS=typeof document<"u",nS=function(){},Vt=tS?E.useLayoutEffect:nS;const rS={...U};function wi(e){const t=U.useRef(e);return Vt(()=>{t.current=e}),t}const oS=rS.useInsertionEffect||(e=>e());function Gt(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return oS(()=>{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 Qh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Jh(e,t){const n=kp(e,Qh()),r=n.length;if(r===0)return;const o=vl(Ht(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function sS(e){return Jh(Ht(e).body,1)||e}function iS(e){return Jh(Ht(e).body,-1)||e}function xl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Fr(n,r)}function aS(e){kp(e,Qh()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function em(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 cS="data-floating-ui-focusable",tm="active",nm="selected",lS={...U};let rm=!1,uS=0;const om=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+uS++;function fS(){const[e,t]=U.useState(()=>rm?om():void 0);return Vt(()=>{e==null&&t(om())},[]),U.useEffect(()=>{rm=!0},[]),e}const El=lS.useId||fS;let Sl;process.env.NODE_ENV!=="production"&&(Sl=new Set);function dS(){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=Sl)!=null&&e.has(o))){var s;(s=Sl)==null||s.add(o),console.error(o)}}function pS(){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 hS=U.createContext(null),mS=U.createContext(null),Pl=()=>{var e;return((e=U.useContext(hS))==null?void 0:e.id)||null},Tl=()=>U.useContext(mS);function Xo(e){return"data-floating-ui-"+e}function yt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const sm=Xo("safe-polygon");function Al(e,t,n){if(n&&!Yo(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 $l(e){return typeof e=="function"?e():e}function bS(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:d=!0}=t,p=Tl(),h=Pl(),b=wi(l),S=wi(a),P=wi(n),x=wi(f),w=U.useRef(),A=U.useRef(-1),M=U.useRef(),B=U.useRef(-1),F=U.useRef(!0),m=U.useRef(!1),g=U.useRef(()=>{}),v=U.useRef(!1),$=Gt(()=>{var I;const T=(I=o.current.openEvent)==null?void 0:I.type;return(T==null?void 0:T.includes("mouse"))&&T!=="mousedown"});U.useEffect(()=>{if(!c)return;function I(T){let{open:L}=T;L||(yt(A),yt(B),F.current=!0,v.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[c,s]),U.useEffect(()=>{if(!c||!b.current||!n)return;function I(L){$()&&r(!1,L,"hover")}const T=Ht(i.floating).documentElement;return T.addEventListener("mouseleave",I),()=>{T.removeEventListener("mouseleave",I)}},[i.floating,n,r,c,b,$]);const N=U.useCallback(function(I,T,L){T===void 0&&(T=!0),L===void 0&&(L="hover");const j=Al(S.current,"close",w.current);j&&!M.current?(yt(A),A.current=window.setTimeout(()=>r(!1,I,L),j)):T&&(yt(A),r(!1,I,L))},[S,r]),O=Gt(()=>{g.current(),M.current=void 0}),k=Gt(()=>{if(m.current){const I=Ht(i.floating).body;I.style.pointerEvents="",I.removeAttribute(sm),m.current=!1}}),y=Gt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!c)return;function I(_){if(yt(A),F.current=!1,u&&!Yo(w.current)||$l(x.current)>0&&!Al(S.current,"open"))return;const H=Al(S.current,"open",w.current);H?A.current=window.setTimeout(()=>{P.current||r(!0,_,"hover")},H):n||r(!0,_,"hover")}function T(_){if(y()){k();return}g.current();const H=Ht(i.floating);if(yt(B),v.current=!1,b.current&&o.current.floatingContext){n||yt(A),M.current=b.current({...o.current.floatingContext,tree:p,x:_.clientX,y:_.clientY,onClose(){k(),O(),y()||N(_,!0,"safe-polygon")}});const G=M.current;H.addEventListener("mousemove",G),g.current=()=>{H.removeEventListener("mousemove",G)};return}(w.current==="touch"?!Fr(i.floating,_.relatedTarget):!0)&&N(_)}function L(_){y()||o.current.floatingContext&&(b.current==null||b.current({...o.current.floatingContext,tree:p,x:_.clientX,y:_.clientY,onClose(){k(),O(),y()||N(_)}})(_))}function j(){yt(A)}function z(_){y()||N(_,!1)}if(de(i.domReference)){const _=i.domReference,H=i.floating;return n&&_.addEventListener("mouseleave",L),d&&_.addEventListener("mousemove",I,{once:!0}),_.addEventListener("mouseenter",I),_.addEventListener("mouseleave",T),H&&(H.addEventListener("mouseleave",L),H.addEventListener("mouseenter",j),H.addEventListener("mouseleave",z)),()=>{n&&_.removeEventListener("mouseleave",L),d&&_.removeEventListener("mousemove",I),_.removeEventListener("mouseenter",I),_.removeEventListener("mouseleave",T),H&&(H.removeEventListener("mouseleave",L),H.removeEventListener("mouseenter",j),H.removeEventListener("mouseleave",z))}}},[i,c,e,u,d,N,O,k,r,n,P,p,S,b,o,y,x]),Vt(()=>{var I;if(c&&n&&(I=b.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&$()){m.current=!0;const L=i.floating;if(de(i.domReference)&&L){var T;const j=Ht(i.floating).body;j.setAttribute(sm,"");const z=i.domReference,_=p==null||(T=p.nodesRef.current.find(H=>H.id===h))==null||(T=T.context)==null?void 0:T.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,p,b,$]),Vt(()=>{n||(w.current=void 0,v.current=!1,O(),k())},[n,O,k]),U.useEffect(()=>()=>{O(),yt(A),yt(B),k()},[c,i.domReference,O,k]);const C=U.useMemo(()=>{function I(T){w.current=T.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(T){const{nativeEvent:L}=T;function j(){!F.current&&!P.current&&r(!0,L,"hover")}u&&!Yo(w.current)||n||$l(x.current)===0||v.current&&T.movementX**2+T.movementY**2<2||(yt(B),w.current==="touch"?j():(v.current=!0,B.current=window.setTimeout(j,$l(x.current))))}}},[u,r,n,P,x]);return U.useMemo(()=>c?{reference:C}:{},[c,C])}const gS={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},im=U.forwardRef(function(t,n){const[r,o]=U.useState();Vt(()=>{Kh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Xo("focus-guard")]:"",style:gS};return D.jsx("span",{...t,...s})}),yS={clipPath:"inset(50%)",position:"fixed",top:0,left:0},am=U.createContext(null),cm=Xo("portal");function vS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=El(),o=xS(),[s,i]=U.useState(null),c=U.useRef(null);return Vt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Vt(()=>{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(cm,""),a.appendChild(l),c.current=l,i(l)},[t,r]),Vt(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Uc(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(cm,""),a=l||a,a.appendChild(u),c.current=u,i(u)},[t,n,r,o]),s}function wS(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=vS({id:n,root:r}),[i,c]=U.useState(null),a=U.useRef(null),l=U.useRef(null),u=U.useRef(null),f=U.useRef(null),d=i==null?void 0:i.modal,p=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return U.useEffect(()=>{if(!s||!o||d)return;function b(S){s&&xl(S)&&(S.type==="focusin"?em:aS)(s)}return s.addEventListener("focusin",b,!0),s.addEventListener("focusout",b,!0),()=>{s.removeEventListener("focusin",b,!0),s.removeEventListener("focusout",b,!0)}},[s,o,d]),U.useEffect(()=>{s&&(p||em(s))},[p,s]),D.jsxs(am.Provider,{value:U.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&D.jsx(im,{"data-type":"outside",ref:a,onFocus:b=>{if(xl(b,s)){var S;(S=u.current)==null||S.focus()}else{const P=i?i.domReference:null,x=iS(P);x==null||x.focus()}}}),h&&s&&D.jsx("span",{"aria-owns":s.id,style:yS}),s&&zr.createPortal(t,s),h&&s&&D.jsx(im,{"data-type":"outside",ref:l,onFocus:b=>{if(xl(b,s)){var S;(S=f.current)==null||S.focus()}else{const P=i?i.domReference:null,x=sS(P);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,b.nativeEvent,"focus-out"))}}})]})}const xS=()=>U.useContext(am);function lm(e){return Ye(e.target)&&e.target.tagName==="BUTTON"}function ES(e){return Ye(e.target)&&e.target.tagName==="A"}function um(e){return Xh(e)}function SS(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,d=U.useRef(),p=U.useRef(!1),h=U.useMemo(()=>({onPointerDown(b){d.current=b.pointerType},onMouseDown(b){const S=d.current;b.button===0&&c!=="click"&&(Yo(S,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,b.nativeEvent,"click"):(b.preventDefault(),r(!0,b.nativeEvent,"click"))))},onClick(b){const S=d.current;if(c==="mousedown"&&d.current){d.current=void 0;return}Yo(S,!0)&&l||(n&&a&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,b.nativeEvent,"click"):r(!0,b.nativeEvent,"click"))},onKeyDown(b){d.current=void 0,!(b.defaultPrevented||!u||lm(b))&&(b.key===" "&&!um(s)&&(b.preventDefault(),p.current=!0),!ES(b)&&b.key==="Enter"&&r(!(n&&a),b.nativeEvent,"click"))},onKeyUp(b){b.defaultPrevented||!u||lm(b)||um(s)||b.key===" "&&p.current&&(p.current=!1,r(!(n&&a),b.nativeEvent,"click"))}}),[o,s,c,l,u,r,n,f,a]);return U.useMemo(()=>i?{reference:h}:{},[i,h])}const PS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},TS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},fm=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 AS(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:d=!1,bubbles:p,capture:h}=t,b=Tl(),S=Gt(typeof a=="function"?a:()=>!1),P=typeof a=="function"?S:a,x=U.useRef(!1),{escapeKey:w,outsidePress:A}=fm(p),{escapeKey:M,outsidePress:B}=fm(h),F=U.useRef(!1),m=Gt(k=>{var y;if(!n||!i||!c||k.key!=="Escape"||F.current)return;const C=(y=s.current.floatingContext)==null?void 0:y.nodeId,I=b?vi(b.nodesRef.current,C):[];if(!w&&(k.stopPropagation(),I.length>0)){let T=!0;if(I.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,eS(k)?k.nativeEvent:k,"escape-key")}),g=Gt(k=>{var y;const C=()=>{var I;m(k),(I=Rr(k))==null||I.removeEventListener("keydown",C)};(y=Rr(k))==null||y.addEventListener("keydown",C)}),v=Gt(k=>{var y;const C=s.current.insideReactTree;s.current.insideReactTree=!1;const I=x.current;if(x.current=!1,l==="click"&&I||C||typeof P=="function"&&!P(k))return;const T=Rr(k),L="["+Xo("inert")+"]",j=Ht(o.floating).querySelectorAll(L);let z=de(T)?T:null;for(;z&&!cn(z);){const G=ln(z);if(cn(G)||!de(G))break;z=G}if(j.length&&de(T)&&!X3(T)&&!Fr(T,o.floating)&&Array.from(j).every(G=>!Fr(z,G)))return;if(Ye(T)&&O){const G=cn(T),W=bt(T),Z=/auto|scroll/,J=G||Z.test(W.overflowX),ee=G||Z.test(W.overflowY),fe=J&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,pe=ee&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,he=W.direction==="rtl",ie=pe&&(he?k.offsetX<=T.offsetWidth-T.clientWidth:k.offsetX>T.clientWidth),me=fe&&k.offsetY>T.clientHeight;if(ie||me)return}const _=(y=s.current.floatingContext)==null?void 0:y.nodeId,H=b&&vi(b.nodesRef.current,_).some(G=>{var W;return wl(k,(W=G.context)==null?void 0:W.elements.floating)});if(wl(k,o.floating)||wl(k,o.domReference)||H)return;const Y=b?vi(b.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")}),$=Gt(k=>{var y;const C=()=>{var I;v(k),(I=Rr(k))==null||I.removeEventListener(l,C)};(y=Rr(k))==null||y.addEventListener(l,C)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=A;let k=-1;function y(j){r(!1,j,"ancestor-scroll")}function C(){window.clearTimeout(k),F.current=!0}function I(){k=window.setTimeout(()=>{F.current=!1},Qs()?5:0)}const T=Ht(o.floating);c&&(T.addEventListener("keydown",M?g:m,M),T.addEventListener("compositionstart",C),T.addEventListener("compositionend",I)),P&&T.addEventListener(l,B?$:v,B);let L=[];return d&&(de(o.domReference)&&(L=Cn(o.domReference)),de(o.floating)&&(L=L.concat(Cn(o.floating))),!de(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(Cn(o.reference.contextElement)))),L=L.filter(j=>{var z;return j!==((z=T.defaultView)==null?void 0:z.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{c&&(T.removeEventListener("keydown",M?g:m,M),T.removeEventListener("compositionstart",C),T.removeEventListener("compositionend",I)),P&&T.removeEventListener(l,B?$:v,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(k)}},[s,o,c,P,l,n,r,d,i,w,A,m,M,g,v,B,$]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,P,l]);const N=U.useMemo(()=>({onKeyDown:m,...u&&{[PS[f]]:k=>{r(!1,k.nativeEvent,"reference-press")},...f!=="click"&&{onClick(k){r(!1,k.nativeEvent,"reference-press")}}}}),[m,r,u,f]),O=U.useMemo(()=>{function k(y){y.button===0&&(x.current=!0)}return{onKeyDown:m,onMouseDown:k,onMouseUp:k,[TS[l]]:()=>{s.current.insideReactTree=!0}}},[m,l,s]);return U.useMemo(()=>i?{reference:N,floating:O}:{},[i,N,O])}function $S(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=El(),s=U.useRef({}),[i]=U.useState(()=>pS()),c=Pl()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!de(p)&&dS("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]=U.useState(r.reference),u=Gt((p,h,b)=>{s.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:b,nested:c}),n==null||n(p,h,b)}),f=U.useMemo(()=>({setPositionReference:l}),[]),d=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:u,elements:d,events:i,floatingId:o,refs:f}),[t,u,d,i,o,f])}function NS(e){e===void 0&&(e={});const{nodeId:t}=e,n=$S({...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),u=(o==null?void 0:o.domReference)||s,f=U.useRef(null),d=Tl();Vt(()=>{u&&(f.current=u)},[u]);const p=Zp({...e,elements:{...o,...c&&{reference:c}}}),h=U.useCallback(w=>{const A=de(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;a(A),p.refs.setReference(A)},[p.refs]),b=U.useCallback(w=>{(de(w)||w===null)&&(f.current=w,i(w)),(de(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!de(w))&&p.refs.setReference(w)},[p.refs]),S=U.useMemo(()=>({...p.refs,setReference:b,setPositionReference:h,domReference:f}),[p.refs,b,h]),P=U.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),x=U.useMemo(()=>({...p,...r,refs:S,elements:P,nodeId:t}),[p,S,P,t,r]);return Vt(()=>{r.dataRef.current.floatingContext=x;const w=d==null?void 0:d.nodesRef.current.find(A=>A.id===t);w&&(w.context=x)}),U.useMemo(()=>({...p,context:x,refs:S,elements:P}),[p,S,P,x])}function Nl(){return Z3()&&Kh()}function CS(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=U.useRef(!1),u=U.useRef(-1),f=U.useRef(!0);U.useEffect(()=>{if(!c)return;const p=Ke(i.domReference);function h(){!n&&Ye(i.domReference)&&i.domReference===vl(Ht(i.domReference))&&(l.current=!0)}function b(){f.current=!0}function S(){f.current=!1}return p.addEventListener("blur",h),Nl()&&(p.addEventListener("keydown",b,!0),p.addEventListener("pointerdown",S,!0)),()=>{p.removeEventListener("blur",h),Nl()&&(p.removeEventListener("keydown",b,!0),p.removeEventListener("pointerdown",S,!0))}},[i.domReference,n,c]),U.useEffect(()=>{if(!c)return;function p(h){let{reason:b}=h;(b==="reference-press"||b==="escape-key")&&(l.current=!0)}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,c]),U.useEffect(()=>()=>{yt(u)},[]);const d=U.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(p){if(l.current)return;const h=Rr(p.nativeEvent);if(a&&de(h)){if(Nl()&&!p.relatedTarget){if(!f.current&&!Xh(h))return}else if(!Q3(h))return}r(!0,p.nativeEvent,"focus")},onBlur(p){l.current=!1;const h=p.relatedTarget,b=p.nativeEvent,S=de(h)&&h.hasAttribute(Xo("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var P;const x=vl(i.domReference?i.domReference.ownerDocument:document);!h&&x===i.domReference||Fr((P=s.current.floatingContext)==null?void 0:P.refs.floating.current,x)||Fr(i.domReference,x)||S||r(!1,b,"focus")})}}),[s,i.domReference,r,a]);return U.useMemo(()=>c?{reference:d}:{},[c,d])}function Cl(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[tm]:i,[nm]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[cS]:""},...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&&[tm,nm].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 d,p=arguments.length,h=new Array(p),b=0;b<p;b++)h[b]=arguments[b];return(d=r.get(l))==null?void 0:d.map(S=>S(...h)).find(S=>S!==void 0)}}}else i[l]=u}),i),{})}}function OS(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=>Cl(c,e,"reference"),t),s=U.useCallback(c=>Cl(c,e,"floating"),n),i=U.useCallback(c=>Cl(c,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const IS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function kS(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=El(),u=((n=s.domReference)==null?void 0:n.id)||l,f=U.useMemo(()=>{var x;return((x=J3(s.floating))==null?void 0:x.id)||i},[s.floating,i]),d=(r=IS.get(a))!=null?r:a,h=Pl()!=null,b=U.useMemo(()=>d==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[d,f,h,o,u,a]),S=U.useMemo(()=>{const x={id:f,...d&&{role:d}};return d==="tooltip"||a==="label"?x:{...x,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,a]),P=U.useCallback(x=>{let{active:w,selected:A}=x;const M={role:"option",...w&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...M,"aria-selected":A}}return{}},[f,a]);return U.useMemo(()=>c?{reference:b,floating:S,item:P}:{},[c,b,S,P])}const dm=E.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})});dm.displayName="TooltipArrow";const nr=({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]=E.useState(!1),f=E.useRef(null),{refs:d,floatingStyles:p,context:h}=NS({open:l&&!i,onOpenChange:u,placement:n,whileElementsMounted:Hp,middleware:[rl(o?12:8),Yp({fallbackAxisSideDirection:"start",padding:8}),Kp({padding:8}),...o?[VE({element:f})]:[]]}),b=bS(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),S=CS(h,{enabled:a.includes("focus")}),P=SS(h,{enabled:a.includes("click")}),x=AS(h),w=kS(h,{role:"tooltip"}),{getReferenceProps:A,getFloatingProps:M}=OS([b,S,P,x,w]);return i?D.jsx(D.Fragment,{children:e}):D.jsxs(D.Fragment,{children:[D.jsx("div",{ref:d.setReference,...A(),className:"cursor-help",children:e}),l&&D.jsx(wS,{children:D.jsxs("div",{ref:d.setFloating,...M(),style:{...p,zIndex:101},className:`
|
|
178
178
|
z-[101] px-3 py-2 cursor-help
|
|
179
179
|
bg-fill-page-secondary
|
|
180
180
|
text-text-primary text-sm font-medium
|
|
@@ -182,6 +182,6 @@ ${bg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
182
182
|
relative
|
|
183
183
|
${c}
|
|
184
184
|
${s}
|
|
185
|
-
`,children:[t,o&&D.jsx(
|
|
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}`},CS=(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)},NS=(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=CS(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]),N=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:N}}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",N="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(M=>{const B=M.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===S||F===N)})},[r]),[c,a]=x.useState({}),l=x.useCallback((S,N)=>{a(M=>({...M,[S]:N}))},[]),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"},N=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=N.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:N,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,N=Object.values(c).some(M=>{var B;return(B=M.balance)==null?void 0:B.isLoading});return S||N},[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",N=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:N,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}),$=x.useCallback(async()=>{if(!F)try{b(!0),await w()}catch(_){console.error("Approve failed:",_)}finally{b(!1)}},[F,w]),C=x.useMemo(()=>+u.chainId!=+t.chainId,[u.chainId,t.chainId]),O=x.useCallback(async()=>{c&&c(p)},[c,p]);x.useEffect(()=>{C&&O()},[C,O]);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 fe=new Ie(J);!fe.isNaN()&&Y.gte(fe)&&(W=!0,Z="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:W,layerZeroTipKey:Z}},[t.chainId,n,d,B]),A=x.useCallback(()=>OS(+t.chainId,T||"0",n,r),[T,t==null?void 0:t.chainId,n,r]),I=x.useMemo(()=>r!=="spot"&&NS(+t.chainId,d,n),[r,t==null?void 0:t.chainId,d,n]),P=x.useMemo(()=>"deposit.maxDepositSplitTip",[]),L=DS({isNetworkMismatch:C,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=A(),G=fi(H,Y);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 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 _=A();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:$,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"})]}),I&&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)})]}),I&&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:!(I||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:z,disabled:L.disabled||s,children:[(s||C)&&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(j=>j==="spot"&&s&&s.length>0?s:o,[o,s]),S=E(a),N=()=>{var W;if(!S||S.length===0)return{chainId:1,token:""};const j=i||((W=S[0])==null?void 0:W.chainId),z=S.find(Z=>Z.chainId===j)||S[0],_=(z==null?void 0:z.tokenList)||[],H=(c||"").toUpperCase();if(H&&_.length>0){const Z=_.find(J=>(J.token||J.symbol||"").toUpperCase()===H);if(Z)return{chainId:z.chainId,token:Z.token||Z.symbol||""}}if(H)for(const Z of S){const ee=((Z==null?void 0:Z.tokenList)||[]).find(fe=>(fe.token||fe.symbol||"").toUpperCase()===H);if(ee)return{chainId:Z.chainId,token:ee.token||ee.symbol||""}}const Y=_.length>0?z:S.find(Z=>(Z.tokenList||[]).length>0)||z,G=((Y==null?void 0:Y.tokenList)||[])[0];return{chainId:(Y==null?void 0:Y.chainId)||z.chainId||1,token:(G==null?void 0:G.token)||(G==null?void 0:G.symbol)||""}},[{chainId:M,token:B}]=x.useState(()=>N()),[F,b]=x.useState(M),g=x.useMemo(()=>E(v),[v,E]),w=g.find(j=>j.chainId===F)||g[0],[$,C]=x.useState(B),O=x.useCallback(j=>{b(j),d==null||d(j)},[d]),k=x.useCallback(j=>{C(j),h==null||h(j)},[h]),y=x.useMemo(()=>{const j=($||"").toLowerCase();if(!j)return"0";const z=v==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,_=z==null?void 0:z[j];return typeof _=="string"&&_.length>0?_:"0"},[l,v,$]),[A,I]=x.useState(!1),P=j=>{j.target===j.currentTarget?I(!0):I(!1)},L=j=>{A&&j.target===j.currentTarget&&n(),I(!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:P,onMouseUp:L,"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:j=>{j.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:j=>{var ee,fe;const z=j||"perpetual";T(z);const _=E(z);if(!_||_.length===0)return;const H=_.find(pe=>pe.chainId===F),Y=H?H.chainId:_[0].chainId;b(Y),d==null||d(Y);const G=_.find(pe=>pe.chainId===Y),W=(G==null?void 0:G.tokenList)||[],J=W.some(pe=>(pe.symbol||pe.token)===$)?$:((ee=W[0])==null?void 0:ee.symbol)||((fe=W[0])==null?void 0:fe.token)||"";J&&(C(J),h==null||h(J))},className:"w-full"}),D.jsx(Eh,{currentActiveChain:w,chainList:g,onChainChange:O,curSelectToken:$,onTokenChange:k,walletType:El(r)?xn:sc,accountType:v}),El(r)&&D.jsx(TS,{address:r.smartWalletAddress,currentActiveChain:w,selectedToken:$,accountType:v,onDeposit:f,onCopy:p,onClose:n}),RS(r)&&D.jsx(FS,{address:r.ethAddress,currentActiveChain:w,selectedToken:$,accountType:v,platformBalance:y,isLoading:t,wagmiHooks:u,onChainChange:O,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)},N=()=>{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: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")})]}),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,N]=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=he=>{const se=he||[];if(!se.length)return"";const te="USDC".toUpperCase(),Nn=se.find(gt=>(gt.token||gt.symbol||"").toUpperCase()===te)||se[0];return Nn.token||Nn.symbol||""};if(o){const he=o==null?void 0:o.toUpperCase();for(const se of B){const me=se.tokenList||[];let te;if(he&&(te=me.find(Se=>(Se.token||Se.symbol||"").toUpperCase()===he)),te){const Se=te.token||te.symbol||o||"";return{chainId:se.chainId,tokenSymbol:Se}}}}if(r){const he=B.find(te=>te.chainId===r)||B[0],se=he.tokenList||[],me=Z(se);return{chainId:he.chainId,tokenSymbol:me}}const J="USDC",ee=he=>Array.isArray(he.tokenList)&&he.tokenList.some(se=>(se.token||se.symbol||"").toUpperCase()===J),fe=B.find(ee)||B[0];if(!fe)return{chainId:1,tokenSymbol:""};const pe=Z(fe.tokenList);return{chainId:fe.chainId,tokenSymbol:pe}},[B,r,o]),[b,g]=x.useState(()=>F.chainId),[w,$]=x.useState(()=>F.tokenSymbol),[C,O]=x.useState(s),[k,y]=x.useState(""),A=x.useCallback(Z=>{g(Z),h==null||h(Z)},[h]),I=x.useCallback(Z=>{$(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)&&(O(""),L.current=w,j.current=b)},[w,b]);const z=B&&B.length>0?B.find(Z=>Z.chainId===b)||B[0]:null,_=(W=z==null?void 0:z.tokenList)==null?void 0:W.find(Z=>Z.token===w),H=x.useMemo(()=>{const Z=new Ie(C||"0"),J=new Ie(u||"0"),ee=un(b);return _!=null&&_.minWithdrawSize&&Z.lt(_.minWithdrawSize)?{text:E("withdraw.minWithdrawParsed",{amount:_.minWithdrawSize,token:_.symbol||_.token}),disabled:!0}:!C||Z.isZero()||!ee&&Z.isLessThan(J)?{text:E("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!ee||S==="spot")&&!k.trim()?{text:E("withdraw.invalidReceiverAddress"),disabled:!0}:{text:E("withdraw.confirmWithdraw"),disabled:!1}},[E,b,C,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,ee=J==null?void 0:J[Z];return typeof ee=="string"&&ee.length>0?ee:a||"0"},[l,S,w,a]),G=x.useCallback(async()=>{pi(!0);try{if(p){const J={amount:new Ie(C||"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,_,C,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"})}):z?D.jsxs(D.Fragment,{children:[D.jsx(Sh,{selectedAccount:S,onAccountChange:Z=>{var Se,Nn;const J=Z||"perpetual";N(J),T==null||T(J);const ee=M(J);if(!ee||ee.length===0)return;const fe=ee.find(gt=>gt.chainId===b),pe=fe?fe.chainId:ee[0].chainId;g(pe),h==null||h(pe);const he=ee.find(gt=>gt.chainId===pe),se=(he==null?void 0:he.tokenList)||[],te=se.some(gt=>(gt.symbol||gt.token)===w)?w:((Se=se[0])==null?void 0:Se.symbol)||((Nn=se[0])==null?void 0:Nn.token)||"";te&&($(te),m==null||m(te))},className:"w-full"}),D.jsx(Eh,{currentActiveChain:z,chainList:B,onChainChange:A,curSelectToken:w,onTokenChange:I,walletType:"EVM",txType:"withdraw"}),D.jsx(jS,{withdrawAmount:C,curSelectToken:w,tokenInfo:_,curSelectTokenData:{balance:_==null?void 0:_.balance,allowance:_==null?void 0:_.allowance},currentActiveChain:z,currentEquity:c||0,decimals:(_==null?void 0:_.decimals)||6,platformBalance:Y,fee:u,walletType:e,accountType:S,receiverAddress:k,onWithdrawAmountChange:O,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:N})=>{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:N})]})})}),document.body):null};oe.ChromeLoader=Vo,oe.ComponentProvider=Ym,oe.DEFAULT_LOCALE=qo,oe.Deposit=mm,oe.DepositManager=lm,oe.LOCALE_NAMES=qm,oe.LoadingSpinner=Vo,oe.SUPPORTED_LOCALES=bi,oe.Tooltip=Qn,oe.Withdraw=xm,oe.WithdrawManager=bm,oe.closeDeposit=fm,oe.closeWithdraw=ym,oe.formatThousands=Qm,oe.isDepositLoading=pm,oe.isWithdrawLoading=wm,oe.openDeposit=um,oe.openWithdraw=gm,oe.setDepositLoading=di,oe.setWithdrawLoading=pi,oe.updateDepositOptions=dm,oe.updateWithdrawOptions=vm,oe.useComponentConfig=Ll,oe.useDeposit=m5,oe.useDepositManager=kS,oe.useTranslation=wt,oe.useWithdraw=b5,oe.useWithdrawManager=US,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|
|
185
|
+
`,children:[t,o&&D.jsx(dm,{ref:f,placement:h.placement||n})]})})]})},Qo="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=",DS=({currentActiveChain:e,selectedToken:t,address:n,accountType:r,onDeposit:o,onCopy:s,onClose:i})=>{const{t:c}=Et(),a=r===P5,l=E.useMemo(()=>{if(!e)return!1;const h=Number(e.chainId);return!Number.isNaN(h)&&(h===42161||h===421614)},[e]),u=a,f=E.useMemo(()=>{var h;return(h=e==null?void 0:e.tokenList)==null?void 0:h.find(b=>b.token===t||b.symbol===t)},[e,t]),d=E.useMemo(()=>{const h=(t||"").toUpperCase();if(!u&&h==="USDC")return c("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const P=c(u?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return u&&(!l||h==="USDC")?String(P).split(`
|
|
186
|
+
`)[0]:P},[c,t,e==null?void 0:e.chain,u,l]),p=(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(Zh,{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(B3,{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:Qo,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:d})})]}),r===m0&&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(nr,{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:[p," ",t]})]}),r===m0&&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")})]})},Jo=({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"})},MS=(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"},xi=(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 xi(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}},LS=(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 D.jsxs("span",{className:"flex items-center gap-1",children:[Mt(e),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${Mt(e)} ${n}`},BS=(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)},FS=(e,t,n)=>{if(!$h(e,n))return!1;try{const r=new Ce(t||"0"),o=new Ce("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},RS=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&$h(e,n))try{const i=new Ce(o),c=new Ce("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new Ce(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,Ce.ROUND_DOWN).toString()}catch{return o}},pm={chains:[],spotChains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""},defaultChainId:1,defaultAccountType:"perpetual",balances:{spot:{},perpetual:{}}};let Xe=null;const hm=E.forwardRef((e,t)=>{const[n,r]=E.useState(!1),[o,s]=E.useState(!1),[i,c]=E.useState(pm),a=E.useCallback(h=>{c(h),r(!0)},[]),l=E.useCallback(h=>{c(b=>({...b,...h}))},[]),u=E.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=E.useCallback(h=>{s(h)},[]),d=E.useCallback(()=>n,[n]),p=E.useCallback(()=>o,[o]);return E.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:d,isLoading:p}),[a,u,l,f,d,p]),E.useEffect(()=>(Xe={openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:d,isLoading:p},()=>{Xe=null}),[a,u,l,f,d,p]),n?D.jsx(wm,{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 b;return(b=i.onChainChange)==null?void 0:b.call(i,h)},onTokenChange:h=>{var b;return(b=i.onTokenChange)==null?void 0:b.call(i,h)}}):null});hm.displayName="DepositManager";const mm=e=>{if(!Xe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Xe.openDeposit(e||pm)},bm=()=>{if(!Xe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Xe.closeDeposit()},gm=e=>{Xe&&Xe.updateDepositOptions(e)},Ei=e=>{if(!Xe){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Xe.setDepositLoading(e)},jS=()=>Xe?Xe.isOpen():!1,ym=()=>Xe?Xe.isLoading():!1,_S=()=>({openDeposit:mm,closeDeposit:bm,updateDepositOptions:gm,setDepositLoading:Ei,isOpen:jS,isLoading:ym}),zS=e=>{const{t}=Et(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return E.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const l=parseFloat(r||"0"),u=a,f=BS(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 US(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,d=o==null?void 0:o.contractAddress,p=!u||u.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=l(),{writeContractAsync:b}=c(),S=a(),P=i({address:u,abi:Er,functionName:"allowance",args:[Qt(t||""),d],chainId:r,query:{enabled:!!(!p&&t&&r&&u&&d)}}),x=P!=null&&P.isSuccess?P.data:void 0,w=E.useMemo(()=>{if(p)return!0;if(!P.isSuccess||x===void 0||x===0n)return!1;try{const M=k6(String(Number(s||"0")||0),Number(f));return x>=M}catch{return!1}},[p,P.isSuccess,x,s,f]),A=E.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!b||!S||!u||!d)return;const B=Qt(u),F=Qt(d);if((x||0n)>0n){const v=await b({abi:Er,address:B,functionName:"approve",args:[F,0n]});await S.waitForTransactionReceipt({hash:v})}const g=await b({abi:Er,address:B,functionName:"approve",args:[F,lf]});await S.waitForTransactionReceipt({hash:g}),P!=null&&P.refetch&&await P.refetch()}catch(M){console.error("[useApprove] onApprove failed:",M)}},[r,n,u,d,x,P,b,S,h]);return{approve:w,onApprove:A}}const WS=({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 E.useEffect(()=>{o(Qt(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},HS=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var x;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=E.useMemo(()=>{const w="0x0000000000000000000000000000000000000000",A="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(M=>{const B=M.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===w||F===A)})},[r]),[c,a]=E.useState({}),l=E.useCallback((w,A)=>{a(M=>({...M,[w]:A}))},[]),u=(x=o==null?void 0:o.useBalance)==null?void 0:x.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[f,d]=E.useState(0),p=E.useMemo(()=>i.map(w=>E.createElement(WS,{key:`${w.tokenAddress}-${f}`,token:w,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:l})),[i,e,s,n,o,l,f]),h=E.useMemo(()=>{const w=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"},A=i.map(B=>{const F=c[Qt(B.tokenAddress)],m=F==null?void 0:F.balance,g=m==null?void 0:m.data;return{address:Qt(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=A.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:A,baseTokenBalance:w,combinedData:M}},[u,c,i]),b=E.useCallback(async()=>h,[h]),S=E.useMemo(()=>{const w=(u==null?void 0:u.isLoading)||!1,A=Object.values(c).some(M=>{var B;return(B=M.balance)==null?void 0:B.isLoading});return w||A},[u==null?void 0:u.isLoading,c]),P=E.useCallback(()=>d(w=>w+1),[]);return{multicallRun:b,multicallRefresh:P,multicallResult:h,validErcTokens:i,isLoading:S,queryComponents:p}},VS=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,platformBalance:o,isLoading:s,wagmiHooks:i,onChainChange:c,onDeposit:a})=>{const{t:l}=Et(),u=i.useAccount(),f=t.tokenList.find(_=>_.token===n||_.symbol===n),d=t.chainId,[p,h]=E.useState("");E.useEffect(()=>{h("")},[n,t.chainId]);const{multicallResult:b,queryComponents:S}=HS({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}),P=E.useMemo(()=>{var H;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return b.baseTokenBalance.formatted;const _=b.combinedData[f.tokenAddress];return((H=_==null?void 0:_.balance)==null?void 0:H.formatted)||"0"},[f,b]),x="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",w="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",A=E.useMemo(()=>{var _,H;return b5({chain:w5,transport:v5(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}=x5({client:A,tokenAddress:x,holder:w,decimals:6,fallbackFormatted:M,pollingInterval:12e3}),[F,m]=E.useState(!1),{approve:g,onApprove:v}=US({account:e,accountChainId:u.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:p,wagmiHooks:i}),$=E.useCallback(async()=>{if(!F)try{m(!0),await v()}catch(_){console.error("Approve failed:",_)}finally{m(!1)}},[F,v]),N=E.useMemo(()=>+u.chainId!=+t.chainId,[u.chainId,t.chainId]),O=E.useCallback(async()=>{c&&c(d)},[c,d]);E.useEffect(()=>{N&&O()},[N,O]);const{showLayerZeroTip:k,layerZeroTipKey:y}=E.useMemo(()=>{const _=+t.chainId==42161||+t.chainId==421614,H=(n==null?void 0:n.toUpperCase())==="USDT",Y=new Ce(p||"0"),G=new Ce("200000");let W=!1,Z;if(_&&H&&p)if(Y.gte(G))W=!0,Z="deposit.layerZeroDepositTipGte200k";else{const J=B;if(typeof J=="string"&&J.length>0){const fe=new Ce(J);!fe.isNaN()&&Y.gte(fe)&&(W=!0,Z="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:W,layerZeroTipKey:Z}},[t.chainId,n,p,B]),C=E.useCallback(()=>RS(+t.chainId,P||"0",n,r),[P,t==null?void 0:t.chainId,n,r]),I=E.useMemo(()=>r!=="spot"&&FS(+t.chainId,p,n),[r,t==null?void 0:t.chainId,p,n]),T=E.useMemo(()=>"deposit.maxDepositSplitTip",[]),L=zS({isNetworkMismatch:N,depositAmount:p,approved:g,currentTokenBalance:P,selectedToken:n,showLayerZeroTip:k,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),j=_=>{const H=_.target.value,Y=C(),G=xi(H,Y);if(G.isValid)h(G.formattedValue),G.errorType;else return G.errorType==="exceed_balance",void 0},z=E.useCallback(async()=>{Ei(!0);try{a&&a({amount:p,chainId:d,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,accountType:r})}catch(_){console.error("Deposit error:",_),Ei(!1)}},[a,p,d,f==null?void 0:f.tokenAddress,r,n]);return D.jsxs(D.Fragment,{children:[S,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:p,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 _=C();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(nr,{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:LS(P||"0",p,n)})]})]}),!g&&MS(p||"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:$,disabled:F,children:F?D.jsx(Jo,{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:Qo,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"})]}),I&&D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:l(T)})]}),I&&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:!(I||k)&&D.jsx("img",{src:Qo,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(nr,{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:p?D.jsxs("span",{className:"flex items-center gap-1",children:[Mt(o),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),Mt((parseFloat(o)+parseFloat(p)).toString())," ",n]}):`${Mt(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:z,disabled:L.disabled||s,children:[(s||N)&&D.jsx(Jo,{size:"xs"}),L.text]})]})},vm=e=>e.toLocaleUpperCase()===Sn?Sn:mc,Ol=e=>vm(e.wallet)===Sn,GS=e=>vm(e.wallet)===mc,wm=({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:d,onChainChange:p,onTokenChange:h})=>{const{t:b}=Et(),[S,P]=E.useState(a),x=E.useCallback(j=>j==="spot"&&s&&s.length>0?s:o,[o,s]),w=x(a),A=()=>{var W;if(!w||w.length===0)return{chainId:1,token:""};const j=i||((W=w[0])==null?void 0:W.chainId),z=w.find(Z=>Z.chainId===j)||w[0],_=(z==null?void 0:z.tokenList)||[],H=(c||"").toUpperCase();if(H&&_.length>0){const Z=_.find(J=>(J.token||J.symbol||"").toUpperCase()===H);if(Z)return{chainId:z.chainId,token:Z.token||Z.symbol||""}}if(H)for(const Z of w){const ee=((Z==null?void 0:Z.tokenList)||[]).find(fe=>(fe.token||fe.symbol||"").toUpperCase()===H);if(ee)return{chainId:Z.chainId,token:ee.token||ee.symbol||""}}const Y=_.length>0?z:w.find(Z=>(Z.tokenList||[]).length>0)||z,G=((Y==null?void 0:Y.tokenList)||[])[0];return{chainId:(Y==null?void 0:Y.chainId)||z.chainId||1,token:(G==null?void 0:G.token)||(G==null?void 0:G.symbol)||""}},[{chainId:M,token:B}]=E.useState(()=>A()),[F,m]=E.useState(M),g=E.useMemo(()=>x(S),[S,x]),v=g.find(j=>j.chainId===F)||g[0],[$,N]=E.useState(B),O=E.useCallback(j=>{m(j),p==null||p(j)},[p]),k=E.useCallback(j=>{N(j),h==null||h(j)},[h]),y=E.useMemo(()=>{const j=($||"").toLowerCase();if(!j)return"0";const z=S==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,_=z==null?void 0:z[j];return typeof _=="string"&&_.length>0?_:"0"},[l,S,$]),[C,I]=E.useState(!1),T=j=>{j.target===j.currentTarget?I(!0):I(!1)},L=j=>{C&&j.target===j.currentTarget&&n(),I(!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:T,onMouseUp:L,"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:j=>{j.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:b("deposit.title")}),D.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:D.jsx(y0,{className:"h-4 w-4"})})]}),D.jsx(Ch,{selectedAccount:S,onAccountChange:j=>{var ee,fe;const z=j||"perpetual";P(z);const _=x(z);if(!_||_.length===0)return;const H=_.find(pe=>pe.chainId===F),Y=H?H.chainId:_[0].chainId;m(Y),p==null||p(Y);const G=_.find(pe=>pe.chainId===Y),W=(G==null?void 0:G.tokenList)||[],J=W.some(pe=>(pe.symbol||pe.token)===$)?$:((ee=W[0])==null?void 0:ee.symbol)||((fe=W[0])==null?void 0:fe.token)||"";J&&(N(J),h==null||h(J))},className:"w-full"}),D.jsx(Nh,{currentActiveChain:v,chainList:g,onChainChange:O,curSelectToken:$,onTokenChange:k,walletType:Ol(r)?Sn:mc,accountType:S}),Ol(r)&&D.jsx(DS,{address:r.smartWalletAddress,currentActiveChain:v,selectedToken:$,accountType:S,onDeposit:f,onCopy:d,onClose:n}),GS(r)&&D.jsx(VS,{address:r.ethAddress,currentActiveChain:v,selectedToken:$,accountType:S,platformBalance:y,isLoading:t,wagmiHooks:u,onChainChange:O,onDeposit:f,onClose:n})]})})}),document.body):null},Il=6,qS=(e,t=Il)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},ZS=e=>{if(e==null||e==="")return null;try{const t=new Ce(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},es=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},KS=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",decimals:i=Il,walletType:c="evm",receiverAddress:a="",accountType:l="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:f,onAmountChanged:d,showPoolBalanceInsufficientTip:p=!1})=>{const{t:h}=Et(),b=E.useMemo(()=>{const m=qS((n==null?void 0:n.decimals)??i,Il),g=ZS((n==null?void 0:n.stepSize)??(n==null?void 0:n.stepsize));return g===null?m:Math.min(m,g)},[i,n==null?void 0:n.decimals,n==null?void 0:n.stepSize,n==null?void 0:n.stepsize]),S=E.useMemo(()=>{if(l==="spot"||!dn(r==null?void 0:r.chainId)){const m=new Ce(e||"0").minus(s||"0");if(m.isNegative()||m.isZero())return"0";const g=Math.min(m.decimalPlaces()??0,18);return m.decimalPlaces(g,Ce.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,l]),P=E.useMemo(()=>o||"0",[o]),x=E.useMemo(()=>{const m=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new Ce(m||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]),w=E.useMemo(()=>x==="0",[x]),A=E.useMemo(()=>{const m=(t||"").toUpperCase();return m==="USDT"||m==="USDC"},[t]),M=m=>{const g=m.target.value,v=es(g,b),N=xi(v,P||"0");if(N.isValid){const O=es(N.formattedValue,b);u(O),N.errorType}else return N.errorType==="exceed_balance",void 0;d==null||d(es(N.formattedValue,b))},B=()=>{const m=P||"0",g=es(m,b),v=xi(g,m),$=es(v.formattedValue,b);u($),d==null||d($)},F=()=>{const m=parseFloat(o||"0"),g=parseFloat(e||"0");if(g>0){const v=m-g,$=Mt(Math.max(0,v).toString());return D.jsxs("span",{className:"flex items-center gap-1",children:[Mt(o||"0"),D.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),$," ",t]})}return`${Mt(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:h("deposit.amount"),value:e,onChange:M,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:B,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:h("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(nr,{content:h("withdraw.availableDesc"),children:D.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:h("deposit.available")})}),D.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:F()})]})]}),c==="mpc"&&(l==="spot"||!dn(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:h("withdraw.receiverAddress"),value:a,onChange:m=>f==null?void 0:f(m.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,l!=="spot"&&D.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:dn(r==null?void 0:r.chainId)?D.jsxs(D.Fragment,{children:[D.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:h("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:h("withdraw.commonWithdraw")})]}):D.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:h("withdraw.crossChainTips")})}),p&&D.jsxs("div",{className:"flex mb-4",children:[D.jsx("div",{className:"w-5",children:D.jsx("img",{src:Qo,className:"w-4 h-4",alt:"Warning"})}),D.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:h("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(nr,{content:D.jsxs("div",{children:[D.jsx("div",{children:h("withdraw.speedNote")}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(Ko,{selectedLevel:Dt.FAST,maxLevel:3}),D.jsx("span",{children:h("withdraw.speedNoteSpeed1")})]}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(Ko,{selectedLevel:Dt.Medium,maxLevel:3}),D.jsx("span",{children:h("withdraw.speedNoteSpeed2")})]}),D.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[D.jsx(Ko,{selectedLevel:Dt.SLOW,maxLevel:3}),D.jsx("span",{children:h("withdraw.speedNoteSpeed3")})]})]}),children:D.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:h("withdraw.speed")})}),D.jsx("div",{className:"flex items-center",children:D.jsx(Ko,{selectedLevel:dn(r==null?void 0:r.chainId)?Dt.SLOW:Dt.FAST,maxLevel:3})})]}),(l==="spot"||!dn(r==null?void 0:r.chainId))&&D.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[w||!A?D.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:w?h("withdraw.fee"):`${h("withdraw.fee")}/${h("withdraw.feeRate")}`}):D.jsx(nr,{className:"w-[320px] font-normal flex items-center justify-center",content:D.jsx("span",{className:"flex items-center justify-center text-center",children:h("withdraw.feeCalculationTip")}),children:D.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${h("withdraw.fee")}/${h("withdraw.feeRate")}`})}),D.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!w&&` / ${x}%`]})]}),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:h(dn(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),D.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[Mt(S)," ",t]})]})]})]})},YS=[];let Qe=null;const xm=E.forwardRef((e,t)=>{const[n,r]=E.useState(!1),[o,s]=E.useState(!1),[i,c]=E.useState({chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),a=E.useCallback(h=>{c(h||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}}),r(!0)},[]),l=E.useCallback(h=>{c(b=>({...b,...h}))},[]),u=E.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=E.useCallback(h=>{s(h)},[]),d=E.useCallback(()=>n,[n]),p=E.useCallback(()=>o,[o]);return E.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:d,isLoading:p}),[a,u,l,f,d,p]),E.useEffect(()=>(Qe={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:d,isLoading:p},()=>{Qe=null}),[a,u,l,f,d,p]),n?D.jsx(Am,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},currentActiveAccount:i.currentActiveAccount,chains:i.chains||YS,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});xm.displayName="WithdrawManager";const Em=e=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.openWithdraw(e||{chains:[],currentActiveAccount:{wallet:"EVM",ethAddress:"",accountId:"",smartWalletAddress:""}})},Sm=()=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.closeWithdraw()},Pm=e=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.updateWithdrawOptions(e)},Si=e=>{if(!Qe){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}Qe.setWithdrawLoading(e)},XS=()=>Qe?Qe.isOpen():!1,Tm=()=>Qe?Qe.isLoading():!1,QS=()=>({openWithdraw:Em,closeWithdraw:Sm,updateWithdrawOptions:Pm,setWithdrawLoading:Si,isOpen:XS,isLoading:Tm}),JS=({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:d,onClose:p,onChainChange:h,onTokenChange:b,onAmountChanged:S,onAccountChange:P})=>{var W;const{t:x}=Et(),[w,A]=E.useState(i),M=E.useCallback(Z=>Z==="spot"&&n&&n.length>0?n:t,[t,n]),B=E.useMemo(()=>M(w),[w,M]),F=E.useMemo(()=>{if(!B||B.length===0)return{chainId:1,tokenSymbol:""};const Z=he=>{const ie=he||[];if(!ie.length)return"";const ne="USDC".toUpperCase(),kn=ie.find(vt=>(vt.token||vt.symbol||"").toUpperCase()===ne)||ie[0];return kn.token||kn.symbol||""};if(o){const he=o==null?void 0:o.toUpperCase();for(const ie of B){const me=ie.tokenList||[];let ne;if(he&&(ne=me.find(Se=>(Se.token||Se.symbol||"").toUpperCase()===he)),ne){const Se=ne.token||ne.symbol||o||"";return{chainId:ie.chainId,tokenSymbol:Se}}}}if(r){const he=B.find(ne=>ne.chainId===r)||B[0],ie=he.tokenList||[],me=Z(ie);return{chainId:he.chainId,tokenSymbol:me}}const J="USDC",ee=he=>Array.isArray(he.tokenList)&&he.tokenList.some(ie=>(ie.token||ie.symbol||"").toUpperCase()===J),fe=B.find(ee)||B[0];if(!fe)return{chainId:1,tokenSymbol:""};const pe=Z(fe.tokenList);return{chainId:fe.chainId,tokenSymbol:pe}},[B,r,o]),[m,g]=E.useState(()=>F.chainId),[v,$]=E.useState(()=>F.tokenSymbol),[N,O]=E.useState(s),[k,y]=E.useState(""),C=E.useCallback(Z=>{g(Z),h==null||h(Z)},[h]),I=E.useCallback(Z=>{$(Z),b==null||b(Z)},[b]),T=E.useRef(!0),L=E.useRef(v),j=E.useRef(m);E.useEffect(()=>{if(T.current){T.current=!1,L.current=v,j.current=m;return}(L.current!==v||j.current!==m)&&(O(""),L.current=v,j.current=m)},[v,m]);const z=B&&B.length>0?B.find(Z=>Z.chainId===m)||B[0]:null,_=(W=z==null?void 0:z.tokenList)==null?void 0:W.find(Z=>Z.token===v),H=E.useMemo(()=>{const Z=new Ce(N||"0"),J=new Ce(u||"0"),ee=dn(m);return _!=null&&_.minWithdrawSize&&Z.lt(_.minWithdrawSize)?{text:x("withdraw.minWithdrawParsed",{amount:_.minWithdrawSize,token:_.symbol||_.token}),disabled:!0}:!N||Z.isZero()||!ee&&Z.isLessThan(J)?{text:x("withdraw.confirmWithdraw"),disabled:!0}:e==="mpc"&&(!ee||w==="spot")&&!k.trim()?{text:x("withdraw.invalidReceiverAddress"),disabled:!0}:{text:x("withdraw.confirmWithdraw"),disabled:!1}},[x,m,N,e,k,u,w,_]),Y=E.useMemo(()=>{const Z=(v||"").toLowerCase();if(!Z)return a||"0";const J=w==="spot"?l==null?void 0:l.spot:l==null?void 0:l.perpetual,ee=J==null?void 0:J[Z];return typeof ee=="string"&&ee.length>0?ee:a||"0"},[l,w,v,a]),G=E.useCallback(async()=>{Si(!0);try{if(d){const J={amount:new Ce(N||"0").toString(),chainId:m,tokenAddress:(_==null?void 0:_.tokenAddress)||"",coinId:(_==null?void 0:_.coinId)||"",tokenSymbol:v,accountType:w,selectedToken:_};e==="mpc"&&(!dn(m)||w==="spot")&&(J.receiverAddress=k),d(J)}}catch{Si(!1)}},[d,w,_,N,m,v,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"})}):z?D.jsxs(D.Fragment,{children:[D.jsx(Ch,{selectedAccount:w,onAccountChange:Z=>{var Se,kn;const J=Z||"perpetual";A(J),P==null||P(J);const ee=M(J);if(!ee||ee.length===0)return;const fe=ee.find(vt=>vt.chainId===m),pe=fe?fe.chainId:ee[0].chainId;g(pe),h==null||h(pe);const he=ee.find(vt=>vt.chainId===pe),ie=(he==null?void 0:he.tokenList)||[],ne=ie.some(vt=>(vt.symbol||vt.token)===v)?v:((Se=ie[0])==null?void 0:Se.symbol)||((kn=ie[0])==null?void 0:kn.token)||"";ne&&($(ne),b==null||b(ne))},className:"w-full"}),D.jsx(Nh,{currentActiveChain:z,chainList:B,onChainChange:C,curSelectToken:v,onTokenChange:I,walletType:"EVM",txType:"withdraw"}),D.jsx(KS,{withdrawAmount:N,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:Y,fee:u,walletType:e,accountType:w,receiverAddress:k,onWithdrawAmountChange:O,onReceiverAddressChange:y,onAmountChanged:S}),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(Jo,{size:"xs"}),H.text]})]}):D.jsx("div",{className:"text-center py-8",children:D.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Am=({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:d="0",balances:p,fee:h,wagmiHooks:b,onWithdraw:S,onChainChange:P,onTokenChange:x,onAmountChanged:w,onAccountChange:A})=>{const{t:M}=Et(),[B,F]=E.useState(!1),m=v=>{v.target===v.currentTarget?F(!0):F(!1)},g=v=>{B&&v.target===v.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:m,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:v=>{v.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(y0,{className:"h-4 w-4"})})]}),D.jsx(JS,{chains:i,spotChains:c,walletType:Ol(s)?"mpc":"evm",defaultChainId:a,defaultSymbol:l,defaultAmount:u,defaultAccountType:n,currentEquity:f,platformBalance:d,balances:p,fee:h,isLoading:t,wagmiHooks:b,onWithdraw:S,onClose:r,onChainChange:P,onTokenChange:x,onAmountChanged:w,onAccountChange:A})]})})}),document.body):null};se.ChromeLoader=Jo,se.ComponentProvider=tb,se.DEFAULT_LOCALE=ns,se.Deposit=wm,se.DepositManager=hm,se.LOCALE_NAMES=Qm,se.LoadingSpinner=Jo,se.SUPPORTED_LOCALES=Ai,se.Tooltip=nr,se.Withdraw=Am,se.WithdrawManager=xm,se.closeDeposit=bm,se.closeWithdraw=Sm,se.formatThousands=rb,se.isDepositLoading=ym,se.isWithdrawLoading=Tm,se.openDeposit=mm,se.openWithdraw=Em,se.setDepositLoading=Ei,se.setWithdrawLoading=Si,se.updateDepositOptions=gm,se.updateWithdrawOptions=Pm,se.useComponentConfig=Hl,se.useDeposit=E5,se.useDepositManager=_S,se.useTranslation=Et,se.useWithdraw=S5,se.useWithdrawManager=QS,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|
|
187
187
|
//# sourceMappingURL=index.umd.js.map
|