@edgex-web/components 1.0.0-beta.2 → 1.0.0-beta.3

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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(ae,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],y):(ae=typeof globalThis<"u"?globalThis:ae||self,y(ae.EdgeXComponents={},ae.React,ae.ReactDOM))})(this,function(ae,y,He){"use strict";var m4=Object.defineProperty;var b4=(ae,y,He)=>y in ae?m4(ae,y,{enumerable:!0,configurable:!0,writable:!0,value:He}):ae[y]=He;var rs=(ae,y,He)=>b4(ae,typeof y!="symbol"?y+"":y,He);function Ul(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const z=Ul(y),Vr=Ul(He);function Vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ni={exports:{}},Hr={};/**
1
+ (function(ae,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],y):(ae=typeof globalThis<"u"?globalThis:ae||self,y(ae.EdgeXComponents={},ae.React,ae.ReactDOM))})(this,function(ae,y,He){"use strict";var bP=Object.defineProperty;var gP=(ae,y,He)=>y in ae?bP(ae,y,{enumerable:!0,configurable:!0,writable:!0,value:He}):ae[y]=He;var rs=(ae,y,He)=>gP(ae,typeof y!="symbol"?y+"":y,He);function Ul(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const z=Ul(y),Vr=Ul(He);function Vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ni={exports:{}},Hr={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -14,41 +14,41 @@
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 Wl;function Gm(){return Wl||(Wl=1,process.env.NODE_ENV!=="production"&&function(){var e=y,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator";function w(R){if(R===null||typeof R!="object")return null;var G=h&&R[h]||R[m];return typeof G=="function"?G:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(R){{for(var G=arguments.length,X=new Array(G>1?G-1:0),se=1;se<G;se++)X[se-1]=arguments[se];T("error",R,X)}}function T(R,G,X){{var se=P.ReactDebugCurrentFrame,ye=se.getStackAddendum();ye!==""&&(G+="%s",X=X.concat([ye]));var we=X.map(function(me){return String(me)});we.unshift("Warning: "+G),Function.prototype.apply.call(console[R],console,we)}}var A=!1,D=!1,F=!1,L=!1,b=!1,g;g=Symbol.for("react.module.reference");function x(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||b||R===o||R===l||R===u||L||R===d||A||D||F||typeof R=="object"&&R!==null&&(R.$$typeof===p||R.$$typeof===f||R.$$typeof===i||R.$$typeof===c||R.$$typeof===a||R.$$typeof===g||R.getModuleId!==void 0))}function I(R,G,X){var se=R.displayName;if(se)return se;var ye=G.displayName||G.name||"";return ye!==""?X+"("+ye+")":X}function O(R){return R.displayName||"Context"}function $(R){if(R==null)return null;if(typeof R.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof R=="function")return R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof R=="object")switch(R.$$typeof){case c:var G=R;return O(G)+".Consumer";case i:var X=R;return O(X._context)+".Provider";case a:return I(R,R.render,"ForwardRef");case f:var se=R.displayName||null;return se!==null?se:$(R.type)||"Memo";case p:{var ye=R,we=ye._payload,me=ye._init;try{return $(me(we))}catch{return null}}}return null}var M=Object.assign,v=0,N,k,S,B,j,U,_;function q(){}q.__reactDisabledLog=!0;function Z(){{if(v===0){N=console.log,k=console.info,S=console.warn,B=console.error,j=console.group,U=console.groupCollapsed,_=console.groupEnd;var R={configurable:!0,enumerable:!0,value:q,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}v++}}function H(){{if(v--,v===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},R,{value:N}),info:M({},R,{value:k}),warn:M({},R,{value:S}),error:M({},R,{value:B}),group:M({},R,{value:j}),groupCollapsed:M({},R,{value:U}),groupEnd:M({},R,{value:_})})}v<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var W=P.ReactCurrentDispatcher,J;function K(R,G,X){{if(J===void 0)try{throw Error()}catch(ye){var se=ye.stack.trim().match(/\n( *(at )?)/);J=se&&se[1]||""}return`
17
+ */var Wl;function Gm(){return Wl||(Wl=1,process.env.NODE_ENV!=="production"&&function(){var e=y,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator";function v(R){if(R===null||typeof R!="object")return null;var G=h&&R[h]||R[m];return typeof G=="function"?G:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(R){{for(var G=arguments.length,X=new Array(G>1?G-1:0),se=1;se<G;se++)X[se-1]=arguments[se];S("error",R,X)}}function S(R,G,X){{var se=T.ReactDebugCurrentFrame,ye=se.getStackAddendum();ye!==""&&(G+="%s",X=X.concat([ye]));var we=X.map(function(me){return String(me)});we.unshift("Warning: "+G),Function.prototype.apply.call(console[R],console,we)}}var A=!1,D=!1,F=!1,L=!1,b=!1,g;g=Symbol.for("react.module.reference");function x(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||b||R===o||R===l||R===u||L||R===d||A||D||F||typeof R=="object"&&R!==null&&(R.$$typeof===p||R.$$typeof===f||R.$$typeof===i||R.$$typeof===c||R.$$typeof===a||R.$$typeof===g||R.getModuleId!==void 0))}function I(R,G,X){var se=R.displayName;if(se)return se;var ye=G.displayName||G.name||"";return ye!==""?X+"("+ye+")":X}function O(R){return R.displayName||"Context"}function k(R){if(R==null)return null;if(typeof R.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof R=="function")return R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof R=="object")switch(R.$$typeof){case c:var G=R;return O(G)+".Consumer";case i:var X=R;return O(X._context)+".Provider";case a:return I(R,R.render,"ForwardRef");case f:var se=R.displayName||null;return se!==null?se:k(R.type)||"Memo";case p:{var ye=R,we=ye._payload,me=ye._init;try{return k(me(we))}catch{return null}}}return null}var M=Object.assign,w=0,N,$,P,B,j,U,_;function q(){}q.__reactDisabledLog=!0;function Z(){{if(w===0){N=console.log,$=console.info,P=console.warn,B=console.error,j=console.group,U=console.groupCollapsed,_=console.groupEnd;var R={configurable:!0,enumerable:!0,value:q,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}w++}}function H(){{if(w--,w===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},R,{value:N}),info:M({},R,{value:$}),warn:M({},R,{value:P}),error:M({},R,{value:B}),group:M({},R,{value:j}),groupCollapsed:M({},R,{value:U}),groupEnd:M({},R,{value:_})})}w<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var W=T.ReactCurrentDispatcher,J;function K(R,G,X){{if(J===void 0)try{throw Error()}catch(ye){var se=ye.stack.trim().match(/\n( *(at )?)/);J=se&&se[1]||""}return`
18
18
  `+J+R}}var Q=!1,oe;{var ee=typeof WeakMap=="function"?WeakMap:Map;oe=new ee}function ue(R,G){if(!R||Q)return"";{var X=oe.get(R);if(X!==void 0)return X}var se;Q=!0;var ye=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var we;we=W.current,W.current=null,Z();try{if(G){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ot){se=ot}Reflect.construct(R,[],me)}else{try{me.call()}catch(ot){se=ot}R.call(me.prototype)}}else{try{throw Error()}catch(ot){se=ot}R()}}catch(ot){if(ot&&se&&typeof ot.stack=="string"){for(var de=ot.stack.split(`
19
19
  `),Ve=se.stack.split(`
20
20
  `),Ae=de.length-1,Ce=Ve.length-1;Ae>=1&&Ce>=0&&de[Ae]!==Ve[Ce];)Ce--;for(;Ae>=1&&Ce>=0;Ae--,Ce--)if(de[Ae]!==Ve[Ce]){if(Ae!==1||Ce!==1)do if(Ae--,Ce--,Ce<0||de[Ae]!==Ve[Ce]){var Tt=`
21
- `+de[Ae].replace(" at new "," at ");return R.displayName&&Tt.includes("<anonymous>")&&(Tt=Tt.replace("<anonymous>",R.displayName)),typeof R=="function"&&oe.set(R,Tt),Tt}while(Ae>=1&&Ce>=0);break}}}finally{Q=!1,W.current=we,H(),Error.prepareStackTrace=ye}var Wr=R?R.displayName||R.name:"",lr=Wr?K(Wr):"";return typeof R=="function"&&oe.set(R,lr),lr}function ce(R,G,X){return ue(R,!1)}function pe(R){var G=R.prototype;return!!(G&&G.isReactComponent)}function re(R,G,X){if(R==null)return"";if(typeof R=="function")return ue(R,pe(R));if(typeof R=="string")return K(R);switch(R){case l:return K("Suspense");case u:return K("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case a:return ce(R.render);case f:return re(R.type,G,X);case p:{var se=R,ye=se._payload,we=se._init;try{return re(we(ye),G,X)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,he={},ve=P.ReactDebugCurrentFrame;function Ne(R){if(R){var G=R._owner,X=re(R.type,R._source,G?G.type:null);ve.setExtraStackFrame(X)}else ve.setExtraStackFrame(null)}function Qt(R,G,X,se,ye){{var we=Function.call.bind(Y);for(var me in R)if(we(R,me)){var de=void 0;try{if(typeof R[me]!="function"){var Ve=Error((se||"React class")+": "+X+" type `"+me+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[me]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ve.name="Invariant Violation",Ve}de=R[me](G,me,se,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ae){de=Ae}de&&!(de instanceof Error)&&(Ne(ye),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",se||"React class",X,me,typeof de),Ne(null)),de instanceof Error&&!(de.message in he)&&(he[de.message]=!0,Ne(ye),E("Failed %s type: %s",X,de.message),Ne(null))}}}var $e=Array.isArray;function ke(R){return $e(R)}function cr(R){{var G=typeof Symbol=="function"&&Symbol.toStringTag,X=G&&R[Symbol.toStringTag]||R.constructor.name||"Object";return X}}function rt(R){try{return zt(R),!1}catch{return!0}}function zt(R){return""+R}function Rn(R){if(rt(R))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",cr(R)),zt(R)}var Pt=P.ReactCurrentOwner,XS={key:!0,ref:!0,__self:!0,__source:!0},Dm,Bm;function JS(R){if(Y.call(R,"ref")){var G=Object.getOwnPropertyDescriptor(R,"ref").get;if(G&&G.isReactWarning)return!1}return R.ref!==void 0}function QS(R){if(Y.call(R,"key")){var G=Object.getOwnPropertyDescriptor(R,"key").get;if(G&&G.isReactWarning)return!1}return R.key!==void 0}function e4(R,G){typeof R.ref=="string"&&Pt.current}function t4(R,G){{var X=function(){Dm||(Dm=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};X.isReactWarning=!0,Object.defineProperty(R,"key",{get:X,configurable:!0})}}function n4(R,G){{var X=function(){Bm||(Bm=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};X.isReactWarning=!0,Object.defineProperty(R,"ref",{get:X,configurable:!0})}}var r4=function(R,G,X,se,ye,we,me){var de={$$typeof:t,type:R,key:G,ref:X,props:me,_owner:we};return de._store={},Object.defineProperty(de._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(de,"_self",{configurable:!1,enumerable:!1,writable:!1,value:se}),Object.defineProperty(de,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ye}),Object.freeze&&(Object.freeze(de.props),Object.freeze(de)),de};function o4(R,G,X,se,ye){{var we,me={},de=null,Ve=null;X!==void 0&&(Rn(X),de=""+X),QS(G)&&(Rn(G.key),de=""+G.key),JS(G)&&(Ve=G.ref,e4(G,ye));for(we in G)Y.call(G,we)&&!XS.hasOwnProperty(we)&&(me[we]=G[we]);if(R&&R.defaultProps){var Ae=R.defaultProps;for(we in Ae)me[we]===void 0&&(me[we]=Ae[we])}if(de||Ve){var Ce=typeof R=="function"?R.displayName||R.name||"Unknown":R;de&&t4(me,Ce),Ve&&n4(me,Ce)}return r4(R,de,Ve,ye,se,Pt.current,me)}}var Bl=P.ReactCurrentOwner,Lm=P.ReactDebugCurrentFrame;function _r(R){if(R){var G=R._owner,X=re(R.type,R._source,G?G.type:null);Lm.setExtraStackFrame(X)}else Lm.setExtraStackFrame(null)}var Ll;Ll=!1;function Fl(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Fm(){{if(Bl.current){var R=$(Bl.current.type);if(R)return`
21
+ `+de[Ae].replace(" at new "," at ");return R.displayName&&Tt.includes("<anonymous>")&&(Tt=Tt.replace("<anonymous>",R.displayName)),typeof R=="function"&&oe.set(R,Tt),Tt}while(Ae>=1&&Ce>=0);break}}}finally{Q=!1,W.current=we,H(),Error.prepareStackTrace=ye}var Wr=R?R.displayName||R.name:"",lr=Wr?K(Wr):"";return typeof R=="function"&&oe.set(R,lr),lr}function ce(R,G,X){return ue(R,!1)}function pe(R){var G=R.prototype;return!!(G&&G.isReactComponent)}function re(R,G,X){if(R==null)return"";if(typeof R=="function")return ue(R,pe(R));if(typeof R=="string")return K(R);switch(R){case l:return K("Suspense");case u:return K("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case a:return ce(R.render);case f:return re(R.type,G,X);case p:{var se=R,ye=se._payload,we=se._init;try{return re(we(ye),G,X)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,he={},ve=T.ReactDebugCurrentFrame;function Ne(R){if(R){var G=R._owner,X=re(R.type,R._source,G?G.type:null);ve.setExtraStackFrame(X)}else ve.setExtraStackFrame(null)}function Qt(R,G,X,se,ye){{var we=Function.call.bind(Y);for(var me in R)if(we(R,me)){var de=void 0;try{if(typeof R[me]!="function"){var Ve=Error((se||"React class")+": "+X+" type `"+me+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[me]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ve.name="Invariant Violation",Ve}de=R[me](G,me,se,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ae){de=Ae}de&&!(de instanceof Error)&&(Ne(ye),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",se||"React class",X,me,typeof de),Ne(null)),de instanceof Error&&!(de.message in he)&&(he[de.message]=!0,Ne(ye),E("Failed %s type: %s",X,de.message),Ne(null))}}}var ke=Array.isArray;function $e(R){return ke(R)}function cr(R){{var G=typeof Symbol=="function"&&Symbol.toStringTag,X=G&&R[Symbol.toStringTag]||R.constructor.name||"Object";return X}}function rt(R){try{return zt(R),!1}catch{return!0}}function zt(R){return""+R}function Rn(R){if(rt(R))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",cr(R)),zt(R)}var Pt=T.ReactCurrentOwner,JS={key:!0,ref:!0,__self:!0,__source:!0},Dm,Bm;function QS(R){if(Y.call(R,"ref")){var G=Object.getOwnPropertyDescriptor(R,"ref").get;if(G&&G.isReactWarning)return!1}return R.ref!==void 0}function eP(R){if(Y.call(R,"key")){var G=Object.getOwnPropertyDescriptor(R,"key").get;if(G&&G.isReactWarning)return!1}return R.key!==void 0}function tP(R,G){typeof R.ref=="string"&&Pt.current}function nP(R,G){{var X=function(){Dm||(Dm=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};X.isReactWarning=!0,Object.defineProperty(R,"key",{get:X,configurable:!0})}}function rP(R,G){{var X=function(){Bm||(Bm=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};X.isReactWarning=!0,Object.defineProperty(R,"ref",{get:X,configurable:!0})}}var oP=function(R,G,X,se,ye,we,me){var de={$$typeof:t,type:R,key:G,ref:X,props:me,_owner:we};return de._store={},Object.defineProperty(de._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(de,"_self",{configurable:!1,enumerable:!1,writable:!1,value:se}),Object.defineProperty(de,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ye}),Object.freeze&&(Object.freeze(de.props),Object.freeze(de)),de};function sP(R,G,X,se,ye){{var we,me={},de=null,Ve=null;X!==void 0&&(Rn(X),de=""+X),eP(G)&&(Rn(G.key),de=""+G.key),QS(G)&&(Ve=G.ref,tP(G,ye));for(we in G)Y.call(G,we)&&!JS.hasOwnProperty(we)&&(me[we]=G[we]);if(R&&R.defaultProps){var Ae=R.defaultProps;for(we in Ae)me[we]===void 0&&(me[we]=Ae[we])}if(de||Ve){var Ce=typeof R=="function"?R.displayName||R.name||"Unknown":R;de&&nP(me,Ce),Ve&&rP(me,Ce)}return oP(R,de,Ve,ye,se,Pt.current,me)}}var Bl=T.ReactCurrentOwner,Lm=T.ReactDebugCurrentFrame;function _r(R){if(R){var G=R._owner,X=re(R.type,R._source,G?G.type:null);Lm.setExtraStackFrame(X)}else Lm.setExtraStackFrame(null)}var Ll;Ll=!1;function Fl(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Fm(){{if(Bl.current){var R=k(Bl.current.type);if(R)return`
22
22
 
23
- Check the render method of \``+R+"`."}return""}}function s4(R){return""}var Rm={};function i4(R){{var G=Fm();if(!G){var X=typeof R=="string"?R:R.displayName||R.name;X&&(G=`
23
+ Check the render method of \``+R+"`."}return""}}function iP(R){return""}var Rm={};function aP(R){{var G=Fm();if(!G){var X=typeof R=="string"?R:R.displayName||R.name;X&&(G=`
24
24
 
25
- Check the top-level render call using <`+X+">.")}return G}}function jm(R,G){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var X=i4(G);if(Rm[X])return;Rm[X]=!0;var se="";R&&R._owner&&R._owner!==Bl.current&&(se=" It was passed a child from "+$(R._owner.type)+"."),_r(R),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X,se),_r(null)}}function zm(R,G){{if(typeof R!="object")return;if(ke(R))for(var X=0;X<R.length;X++){var se=R[X];Fl(se)&&jm(se,G)}else if(Fl(R))R._store&&(R._store.validated=!0);else if(R){var ye=w(R);if(typeof ye=="function"&&ye!==R.entries)for(var we=ye.call(R),me;!(me=we.next()).done;)Fl(me.value)&&jm(me.value,G)}}}function a4(R){{var G=R.type;if(G==null||typeof G=="string")return;var X;if(typeof G=="function")X=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===a||G.$$typeof===f))X=G.propTypes;else return;if(X){var se=$(G);Qt(X,R.props,"prop",se,R)}else if(G.PropTypes!==void 0&&!Ll){Ll=!0;var ye=$(G);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ye||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function c4(R){{for(var G=Object.keys(R.props),X=0;X<G.length;X++){var se=G[X];if(se!=="children"&&se!=="key"){_r(R),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",se),_r(null);break}}R.ref!==null&&(_r(R),E("Invalid attribute `ref` supplied to `React.Fragment`."),_r(null))}}var Um={};function _m(R,G,X,se,ye,we){{var me=x(R);if(!me){var de="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(de+=" 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 Ve=s4();Ve?de+=Ve:de+=Fm();var Ae;R===null?Ae="null":ke(R)?Ae="array":R!==void 0&&R.$$typeof===t?(Ae="<"+($(R.type)||"Unknown")+" />",de=" Did you accidentally export a JSX literal instead of a component?"):Ae=typeof R,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ae,de)}var Ce=o4(R,G,X,ye,we);if(Ce==null)return Ce;if(me){var Tt=G.children;if(Tt!==void 0)if(se)if(ke(Tt)){for(var Wr=0;Wr<Tt.length;Wr++)zm(Tt[Wr],R);Object.freeze&&Object.freeze(Tt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zm(Tt,R)}if(Y.call(G,"key")){var lr=$(R),ot=Object.keys(G).filter(function(h4){return h4!=="key"}),Rl=ot.length>0?"{key: someKey, "+ot.join(": ..., ")+": ...}":"{key: someKey}";if(!Um[lr+Rl]){var p4=ot.length>0?"{"+ot.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+X+">.")}return G}}function jm(R,G){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var X=aP(G);if(Rm[X])return;Rm[X]=!0;var se="";R&&R._owner&&R._owner!==Bl.current&&(se=" It was passed a child from "+k(R._owner.type)+"."),_r(R),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X,se),_r(null)}}function zm(R,G){{if(typeof R!="object")return;if($e(R))for(var X=0;X<R.length;X++){var se=R[X];Fl(se)&&jm(se,G)}else if(Fl(R))R._store&&(R._store.validated=!0);else if(R){var ye=v(R);if(typeof ye=="function"&&ye!==R.entries)for(var we=ye.call(R),me;!(me=we.next()).done;)Fl(me.value)&&jm(me.value,G)}}}function cP(R){{var G=R.type;if(G==null||typeof G=="string")return;var X;if(typeof G=="function")X=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===a||G.$$typeof===f))X=G.propTypes;else return;if(X){var se=k(G);Qt(X,R.props,"prop",se,R)}else if(G.PropTypes!==void 0&&!Ll){Ll=!0;var ye=k(G);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ye||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lP(R){{for(var G=Object.keys(R.props),X=0;X<G.length;X++){var se=G[X];if(se!=="children"&&se!=="key"){_r(R),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",se),_r(null);break}}R.ref!==null&&(_r(R),E("Invalid attribute `ref` supplied to `React.Fragment`."),_r(null))}}var Um={};function _m(R,G,X,se,ye,we){{var me=x(R);if(!me){var de="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(de+=" 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 Ve=iP();Ve?de+=Ve:de+=Fm();var Ae;R===null?Ae="null":$e(R)?Ae="array":R!==void 0&&R.$$typeof===t?(Ae="<"+(k(R.type)||"Unknown")+" />",de=" Did you accidentally export a JSX literal instead of a component?"):Ae=typeof R,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ae,de)}var Ce=sP(R,G,X,ye,we);if(Ce==null)return Ce;if(me){var Tt=G.children;if(Tt!==void 0)if(se)if($e(Tt)){for(var Wr=0;Wr<Tt.length;Wr++)zm(Tt[Wr],R);Object.freeze&&Object.freeze(Tt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zm(Tt,R)}if(Y.call(G,"key")){var lr=k(R),ot=Object.keys(G).filter(function(mP){return mP!=="key"}),Rl=ot.length>0?"{key: someKey, "+ot.join(": ..., ")+": ...}":"{key: someKey}";if(!Um[lr+Rl]){var hP=ot.length>0?"{"+ot.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Rl,lr,p4,lr),Um[lr+Rl]=!0}}return R===r?c4(Ce):a4(Ce),Ce}}function l4(R,G,X){return _m(R,G,X,!0)}function u4(R,G,X){return _m(R,G,X,!1)}var f4=u4,d4=l4;Gr.Fragment=r,Gr.jsx=f4,Gr.jsxs=d4}()),Gr}process.env.NODE_ENV==="production"?Ni.exports=Hm():Ni.exports=Gm();var C=Ni.exports;const qm={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.
30
+ <%s key={someKey} {...props} />`,Rl,lr,hP,lr),Um[lr+Rl]=!0}}return R===r?lP(Ce):cP(Ce),Ce}}function uP(R,G,X){return _m(R,G,X,!0)}function fP(R,G,X){return _m(R,G,X,!1)}var dP=fP,pP=uP;Gr.Fragment=r,Gr.jsx=dP,Gr.jsxs=pP}()),Gr}process.env.NODE_ENV==="production"?Ni.exports=Hm():Ni.exports=Gm();var C=Ni.exports;const qm={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.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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",perp:"Perpetual-Konto","perpetual-v1":"Perpetuals-V1-Konto","perpetual-v2":"Perpetuals-V2-Konto",spot:"Spot-Konto"}},Km={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.
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.",connectedWalletTitle:"Einzahlung von einer verbundenen Wallet",connectedWalletDesc:"Verwende MetaMask, WalletConnect oder einen anderen Anbieter, um Geld von deiner Krypto-Wallet einzuzahlen",externalWalletTitle:"Einzahlung von externem Konto",externalWalletDesc:"Überweise Gelder von Binance oder anderen Börsen, Chains wie Arbitrum und anderen Wallets",or:"OR"},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.",connectedWalletTitle:"Auszahlung an verbundene Wallet",connectedWalletDesc:"Zahle Geld an deine verbundene Krypto-Wallet, MetaMask, WalletConnect oder einen anderen Anbieter aus",externalWalletTitle:"Auszahlung an externes Konto",externalWalletDesc:"Zahle Geld an Binance oder anderen Börsen, Chains wie Arbitrum und anderen Wallets aus"},account:{title:"Konto",perp:"Perpetual-Konto","perpetual-v1":"Perpetuals-V1-Konto","perpetual-v2":"Perpetuals-V2-Konto",spot:"Spot-Konto"}},Km={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.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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",perp:"Perpetual Account","perpetual-v1":"Perpetuals V1 Account","perpetual-v2":"Perpetuals V2 Account",spot:"Spot Account"}},Zm={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}})
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.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Arbitrum, and other wallets",or:"OR"},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.",connectedWalletTitle:"Withdraw to connected wallet",connectedWalletDesc:"Withdraw funds to your connected crypto wallet, MetaMask, WalletConnect, or another provider",externalWalletTitle:"Withdraw to external account",externalWalletDesc:"Withdraw funds to Binance or other exchanges, chains like Arbitrum, and other wallets"},account:{title:"Account",perp:"Perpetual Account","perpetual-v1":"Perpetuals V1 Account","perpetual-v2":"Perpetuals V2 Account",spot:"Spot Account"}},Zm={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.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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",perp:"Cuenta de perpetuos","perpetual-v1":"Cuenta de perpetuos V1","perpetual-v2":"Cuenta de perpetuos V2",spot:"Cuenta spot"}},Ym={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.
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.",connectedWalletTitle:"Depósito desde una billetera conectada",connectedWalletDesc:"Usa MetaMask, WalletConnect u otro proveedor para depositar fondos desde tu billetera cripto.",externalWalletTitle:"Depósito desde una cuenta externa",externalWalletDesc:"Transfiere fondos desde Binance u otros exchanges, cadenas como Arbitrum y otras billeteras.",or:"OR"},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.",connectedWalletTitle:"Retiro a una billetera conectada",connectedWalletDesc:"Retira fondos a la billetera cripto que tengas conectada: MetaMask, WalletConnect u otro proveedor.",externalWalletTitle:"Retiro a una cuenta externa",externalWalletDesc:"Retira fondos a Binance u otros exchanges, cadenas como Arbitrum y otras billeteras."},account:{title:"Cuenta",perp:"Cuenta de perpetuos","perpetual-v1":"Cuenta de perpetuos V1","perpetual-v2":"Cuenta de perpetuos V2",spot:"Cuenta spot"}},Ym={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.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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",perp:"Compte perpétuel","perpetual-v1":"Compte Perpétuels V1","perpetual-v2":"Compte Perpétuels V2",spot:"Compte spot"}},Xm={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}}).
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.",connectedWalletTitle:"Dépôt depuis un wallet connecté",connectedWalletDesc:"Utilisez MetaMask, WalletConnect ou un autre fournisseur pour déposer des fonds depuis votre wallet crypto",externalWalletTitle:"Dépôt depuis un compte externe",externalWalletDesc:"Transférez des fonds depuis Binance ou d’autres plateformes, des chaînes comme Arbitrum, ou d’autres wallets",or:"OR"},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.",connectedWalletTitle:"Retrait vers un wallet connecté",connectedWalletDesc:"Retirez des fonds vers votre wallet crypto connecté, MetaMask, WalletConnect ou un autre fournisseur",externalWalletTitle:"Retrait vers un compte externe",externalWalletDesc:"Retirez des fonds vers Binance ou d’autres plateformes, des chaînes comme Arbitrum, ou d’autres wallets"},account:{title:"Compte",perp:"Compte perpétuel","perpetual-v1":"Compte Perpétuels V1","perpetual-v2":"Compte Perpétuels V2",spot:"Compte spot"}},Xm={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.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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",perp:"Conto perpetuo","perpetual-v1":"Conto perpetuo V1","perpetual-v2":"Conto perpetuo V2",spot:"Conto Spot"}},Jm={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}})専用です。他通貨は送金しないでください。
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.",connectedWalletTitle:"Deposita dal wallet collegato",connectedWalletDesc:"Usa MetaMask, WalletConnect o un altro fornitore per depositare fondi dal tuo wallet crypto",externalWalletTitle:"Deposita da account esterno",externalWalletDesc:"Trasferisci fondi da Binance o altri exchange, blockchain come Arbitrum e altri wallet",or:"OR"},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.",connectedWalletTitle:"Preleva sul wallet collegato",connectedWalletDesc:"Preleva fondi dal wallet crypto collegato, MetaMask, WalletConnect o un altro fornitore",externalWalletTitle:"Preleva sull'account esterno",externalWalletDesc:"Preleva fondi da Binance o altri exchange, blockchain come Arbitrum e altri wallet"},account:{title:"Account",perp:"Conto perpetuo","perpetual-v1":"Conto perpetuo V1","perpetual-v2":"Conto perpetuo V2",spot:"Conto Spot"}},Jm={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}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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:"アカウント",perp:"パーペチュアルアカウント","perpetual-v1":"先物V1アカウント","perpetual-v2":"先物V2アカウント",spot:"スポットアカウント"}},Qm={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}}).
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}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。",connectedWalletTitle:"接続済みウォレットから入庫",connectedWalletDesc:"MetaMaskWalletConnect、またはその他のプロバイダーを使用し、暗号資産ウォレットから資産を入庫してください。",externalWalletTitle:"外部アカウントから入庫",externalWalletDesc:"バイナンスや他の取引所、Arbitrumなどのネットワーク、またはその他ウォレットから資産を入庫する",or:"OR"},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:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。",connectedWalletTitle:"接続済みウォレットへ出庫",connectedWalletDesc:"接続済み暗号資産ウォレット、MetaMask、WalletConnect、またはその他のプロバイダーへ資産を出庫する",externalWalletTitle:"外部アカウントへ出庫",externalWalletDesc:"バイナンスや他の取引所、Arbitrumなどのネットワーク、またはその他のウォレットへ資産を出庫する"},account:{title:"アカウント",perp:"パーペチュアルアカウント","perpetual-v1":"先物V1アカウント","perpetual-v2":"先物V2アカウント",spot:"スポットアカウント"}},Qm={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}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet.",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Solana, and other wallets.",or:"OR"},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:"Аккаунт",perp:"Перпетуальный счет","perpetual-v1":"Перпетуальный счёт V1","perpetual-v2":"Перпетуальный счёт V2",spot:"Спотовый счет"}},eb={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}}) 资产到此地址。
46
+ Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный.",connectedWalletTitle:"Депозит с подключенного кошелька",connectedWalletDesc:"Используйте MetaMask, WalletConnect или другой сервис для внесения средств с криптокошелька",externalWalletTitle:"Депозит с внешнего аккаунта",externalWalletDesc:"Переводите средства с Binance или других бирж, блокчейнов, таких как Arbitrum, и других кошельков",or:"OR"},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:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств.",connectedWalletTitle:"Вывод на подключенный кошелек",connectedWalletDesc:"Выведите средства на подключенный криптокошелек: MetaMask, WalletConnect или другой",externalWalletTitle:"Вывод средств на внешний аккаунт",externalWalletDesc:"Выведите средства на Binance или другие биржи, блокчейны, такие как Arbitrum, и другие кошельки"},account:{title:"Аккаунт",perp:"Перпетуальный счет","perpetual-v1":"Перпетуальный счёт V1","perpetual-v2":"Перпетуальный счёт V2",spot:"Спотовый счет"}},eb={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}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。",connectedWalletTitle:"从已连接钱包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他钱包进行充值",externalWalletTitle:"从外部钱包充值",externalWalletDesc:"从 Binance 或其他交易所、Solana 等链或其他钱包转账",or:"或"},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:"账户",perp:"合约账户","perpetual-v1":"合约V1账户","perpetual-v2":"合约V2账户",spot:"现货账户"}},tb={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}}) 資產到此位址。
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}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。",connectedWalletTitle:"从已连接钱包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他钱包进行充值",externalWalletTitle:"从外部钱包充值",externalWalletDesc:"从 Binance 或其他交易所、Arbitrum 等链或其他钱包转账",or:"或"},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:"提现金额大于资金池余额,无法进行提现。请选择资金池余额充足的选项。",connectedWalletTitle:"提现至已连接钱包",connectedWalletDesc:"将资金提现至您已连接的加密钱包、MetaMask、WalletConnect 或其他提供商",externalWalletTitle:"提现至外部账户",externalWalletDesc:"将资金提现至 Binance 或其他交易所、Arbitrum 等链及其他钱包"},account:{title:"账户",perp:"合约账户","perpetual-v1":"合约V1账户","perpetual-v2":"合约V2账户",spot:"现货账户"}},tb={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}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。",connectedWalletTitle:"從已連接錢包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他錢包進行充值",externalWalletTitle:"從外部錢包充值",externalWalletDesc:"從 Binance 或其他交易所、Solana 等鏈或其他錢包轉帳",or:"或"},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:"帳戶",perp:"合約帳戶","perpetual-v1":"合約V1賬戶","perpetual-v2":"合約V2賬戶",spot:"現貨帳戶"}},Ci=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],Vl={"en-US":Km,"ja-JP":Jm,"ru-RU":Qm,"zh-CN":eb,"zh-TW":tb,"de-DE":qm,"es-LA":Zm,"fr-FR":Ym,"it-IT":Xm},os="en-US",nb={"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"},rb=e=>Ci.includes(e)?Vl[e]:Vl[os],ob=e=>Ci.includes(e),Hl=y.createContext(null),sb=({config:e,children:t})=>{const n=y.useMemo(()=>{const r=e.locale||os,o=ob(r)?r:os,s=rb(o);return{...e,currentLocale:o,translations:s}},[e]);return C.jsx(Hl.Provider,{value:n,children:t})},Gl=()=>{const e=y.useContext(Hl);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var ib=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Oi=Math.ceil,ft=Math.floor,Ge="[BigNumber Error] ",ql=Ge+"Number primitive has more than 15 significant digits: ",At=1e14,ie=14,Ii=9007199254740991,$i=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],xn=1e7,Me=1e9;function Kl(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:""},w="0123456789abcdefghijklmnopqrstuvwxyz",P=!0;function E(b,g){var x,I,O,$,M,v,N,k,S=this;if(!(S instanceof E))return new E(b,g);if(g==null){if(b&&b._isBigNumber===!0){S.s=b.s,!b.c||b.e>f?S.c=S.e=null:b.e<u?S.c=[S.e=0]:(S.e=b.e,S.c=b.c.slice());return}if((v=typeof b=="number")&&b*0==0){if(S.s=1/b<0?(b=-b,-1):1,b===~~b){for($=0,M=b;M>=10;M/=10,$++);$>f?S.c=S.e=null:(S.e=$,S.c=[b]);return}k=String(b)}else{if(!ib.test(k=String(b)))return r(S,k,v);S.s=k.charCodeAt(0)==45?(k=k.slice(1),-1):1}($=k.indexOf("."))>-1&&(k=k.replace(".","")),(M=k.search(/e/i))>0?($<0&&($=M),$+=+k.slice(M+1),k=k.substring(0,M)):$<0&&($=k.length)}else{if(xe(g,2,w.length,"Base"),g==10&&P)return S=new E(b),F(S,i+S.e+1,c);if(k=String(b),v=typeof b=="number"){if(b*0!=0)return r(S,k,v,g);if(S.s=1/b<0?(k=k.slice(1),-1):1,E.DEBUG&&k.replace(/^0\.0*|\./,"").length>15)throw Error(ql+b)}else S.s=k.charCodeAt(0)===45?(k=k.slice(1),-1):1;for(x=w.slice(0,g),$=M=0,N=k.length;M<N;M++)if(x.indexOf(I=k.charAt(M))<0){if(I=="."){if(M>$){$=N;continue}}else if(!O&&(k==k.toUpperCase()&&(k=k.toLowerCase())||k==k.toLowerCase()&&(k=k.toUpperCase()))){O=!0,M=-1,$=0;continue}return r(S,String(b),v,g)}v=!1,k=n(k,g,10,S.s),($=k.indexOf("."))>-1?k=k.replace(".",""):$=k.length}for(M=0;k.charCodeAt(M)===48;M++);for(N=k.length;k.charCodeAt(--N)===48;);if(k=k.slice(M,++N)){if(N-=M,v&&E.DEBUG&&N>15&&(b>Ii||b!==ft(b)))throw Error(ql+S.s*b);if(($=$-M-1)>f)S.c=S.e=null;else if($<u)S.c=[S.e=0];else{if(S.e=$,S.c=[],M=($+1)%ie,$<0&&(M+=ie),M<N){for(M&&S.c.push(+k.slice(0,M)),N-=ie;M<N;)S.c.push(+k.slice(M,M+=ie));M=ie-(k=k.slice(M)).length}else M-=N;for(;M--;k+="0");S.c.push(+k)}}else S.c=[S.e=0]}E.clone=Kl,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,x;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(g="DECIMAL_PLACES")&&(x=b[g],xe(x,0,Me,g),i=x),b.hasOwnProperty(g="ROUNDING_MODE")&&(x=b[g],xe(x,0,8,g),c=x),b.hasOwnProperty(g="EXPONENTIAL_AT")&&(x=b[g],x&&x.pop?(xe(x[0],-Me,0,g),xe(x[1],0,Me,g),a=x[0],l=x[1]):(xe(x,-Me,Me,g),a=-(l=x<0?-x:x))),b.hasOwnProperty(g="RANGE"))if(x=b[g],x&&x.pop)xe(x[0],-Me,-1,g),xe(x[1],1,Me,g),u=x[0],f=x[1];else if(xe(x,-Me,Me,g),x)u=-(f=x<0?-x:x);else throw Error(Ge+g+" cannot be zero: "+x);if(b.hasOwnProperty(g="CRYPTO"))if(x=b[g],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=x;else throw p=!x,Error(Ge+"crypto unavailable");else p=x;else throw Error(Ge+g+" not true or false: "+x);if(b.hasOwnProperty(g="MODULO_MODE")&&(x=b[g],xe(x,0,9,g),d=x),b.hasOwnProperty(g="POW_PRECISION")&&(x=b[g],xe(x,0,Me,g),h=x),b.hasOwnProperty(g="FORMAT"))if(x=b[g],typeof x=="object")m=x;else throw Error(Ge+g+" not an object: "+x);if(b.hasOwnProperty(g="ALPHABET"))if(x=b[g],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))P=x.slice(0,10)=="0123456789",w=x;else throw Error(Ge+g+" invalid: "+x)}else throw Error(Ge+"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:w}},E.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!E.DEBUG)return!0;var g,x,I=b.c,O=b.e,$=b.s;e:if({}.toString.call(I)=="[object Array]"){if(($===1||$===-1)&&O>=-Me&&O<=Me&&O===ft(O)){if(I[0]===0){if(O===0&&I.length===1)return!0;break e}if(g=(O+1)%ie,g<1&&(g+=ie),String(I[0]).length==g){for(g=0;g<I.length;g++)if(x=I[g],x<0||x>=At||x!==ft(x))break e;if(x!==0)return!0}}}else if(I===null&&O===null&&($===null||$===1||$===-1))return!0;throw Error(Ge+"Invalid BigNumber: "+b)},E.maximum=E.max=function(){return A(arguments,-1)},E.minimum=E.min=function(){return A(arguments,1)},E.random=function(){var b=9007199254740992,g=Math.random()*b&2097151?function(){return ft(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var I,O,$,M,v,N=0,k=[],S=new E(s);if(x==null?x=i:xe(x,0,Me),M=Oi(x/ie),p)if(crypto.getRandomValues){for(I=crypto.getRandomValues(new Uint32Array(M*=2));N<M;)v=I[N]*131072+(I[N+1]>>>11),v>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),I[N]=O[0],I[N+1]=O[1]):(k.push(v%1e14),N+=2);N=M/2}else if(crypto.randomBytes){for(I=crypto.randomBytes(M*=7);N<M;)v=(I[N]&31)*281474976710656+I[N+1]*1099511627776+I[N+2]*4294967296+I[N+3]*16777216+(I[N+4]<<16)+(I[N+5]<<8)+I[N+6],v>=9e15?crypto.randomBytes(7).copy(I,N):(k.push(v%1e14),N+=7);N=M/7}else throw p=!1,Error(Ge+"crypto unavailable");if(!p)for(;N<M;)v=g(),v<9e15&&(k[N++]=v%1e14);for(M=k[--N],x%=ie,M&&x&&(v=$i[ie-x],k[N]=ft(M/v)*v);k[N]===0;k.pop(),N--);if(N<0)k=[$=0];else{for($=-1;k[0]===0;k.splice(0,1),$-=ie);for(N=1,v=k[0];v>=10;v/=10,N++);N<ie&&($-=ie-N)}return S.e=$,S.c=k,S}}(),E.sum=function(){for(var b=1,g=arguments,x=new E(g[0]);b<g.length;)x=x.plus(g[b++]);return x},n=function(){var b="0123456789";function g(x,I,O,$){for(var M,v=[0],N,k=0,S=x.length;k<S;){for(N=v.length;N--;v[N]*=I);for(v[0]+=$.indexOf(x.charAt(k++)),M=0;M<v.length;M++)v[M]>O-1&&(v[M+1]==null&&(v[M+1]=0),v[M+1]+=v[M]/O|0,v[M]%=O)}return v.reverse()}return function(x,I,O,$,M){var v,N,k,S,B,j,U,_,q=x.indexOf("."),Z=i,H=c;for(q>=0&&(S=h,h=0,x=x.replace(".",""),_=new E(I),j=_.pow(x.length-q),h=S,_.c=g(en(pt(j.c),j.e,"0"),10,O,b),_.e=_.c.length),U=g(x,I,O,M?(v=w,b):(v=b,w)),k=S=U.length;U[--S]==0;U.pop());if(!U[0])return v.charAt(0);if(q<0?--k:(j.c=U,j.e=k,j.s=$,j=t(j,_,Z,H,O),U=j.c,B=j.r,k=j.e),N=k+Z+1,q=U[N],S=O/2,B=B||N<0||U[N+1]!=null,B=H<4?(q!=null||B)&&(H==0||H==(j.s<0?3:2)):q>S||q==S&&(H==4||B||H==6&&U[N-1]&1||H==(j.s<0?8:7)),N<1||!U[0])x=B?en(v.charAt(1),-Z,v.charAt(0)):v.charAt(0);else{if(U.length=N,B)for(--O;++U[--N]>O;)U[N]=0,N||(++k,U=[1].concat(U));for(S=U.length;!U[--S];);for(q=0,x="";q<=S;x+=v.charAt(U[q++]));x=en(x,k,v.charAt(0))}return x}}(),t=function(){function b(I,O,$){var M,v,N,k,S=0,B=I.length,j=O%xn,U=O/xn|0;for(I=I.slice();B--;)N=I[B]%xn,k=I[B]/xn|0,M=U*N+k*j,v=j*N+M%xn*xn+S,S=(v/$|0)+(M/xn|0)+U*k,I[B]=v%$;return S&&(I=[S].concat(I)),I}function g(I,O,$,M){var v,N;if($!=M)N=$>M?1:-1;else for(v=N=0;v<$;v++)if(I[v]!=O[v]){N=I[v]>O[v]?1:-1;break}return N}function x(I,O,$,M){for(var v=0;$--;)I[$]-=v,v=I[$]<O[$]?1:0,I[$]=v*M+I[$]-O[$];for(;!I[0]&&I.length>1;I.splice(0,1));}return function(I,O,$,M,v){var N,k,S,B,j,U,_,q,Z,H,W,J,K,Q,oe,ee,ue,ce=I.s==O.s?1:-1,pe=I.c,re=O.c;if(!pe||!pe[0]||!re||!re[0])return new E(!I.s||!O.s||(pe?re&&pe[0]==re[0]:!re)?NaN:pe&&pe[0]==0||!re?ce*0:ce/0);for(q=new E(ce),Z=q.c=[],k=I.e-O.e,ce=$+k+1,v||(v=At,k=dt(I.e/ie)-dt(O.e/ie),ce=ce/ie|0),S=0;re[S]==(pe[S]||0);S++);if(re[S]>(pe[S]||0)&&k--,ce<0)Z.push(1),B=!0;else{for(Q=pe.length,ee=re.length,S=0,ce+=2,j=ft(v/(re[0]+1)),j>1&&(re=b(re,j,v),pe=b(pe,j,v),ee=re.length,Q=pe.length),K=ee,H=pe.slice(0,ee),W=H.length;W<ee;H[W++]=0);ue=re.slice(),ue=[0].concat(ue),oe=re[0],re[1]>=v/2&&oe++;do{if(j=0,N=g(re,H,ee,W),N<0){if(J=H[0],ee!=W&&(J=J*v+(H[1]||0)),j=ft(J/oe),j>1)for(j>=v&&(j=v-1),U=b(re,j,v),_=U.length,W=H.length;g(U,H,_,W)==1;)j--,x(U,ee<_?ue:re,_,v),_=U.length,N=1;else j==0&&(N=j=1),U=re.slice(),_=U.length;if(_<W&&(U=[0].concat(U)),x(H,U,W,v),W=H.length,N==-1)for(;g(re,H,ee,W)<1;)j++,x(H,ee<W?ue:re,W,v),W=H.length}else N===0&&(j++,H=[0]);Z[S++]=j,H[0]?H[W++]=pe[K]||0:(H=[pe[K]],W=1)}while((K++<Q||H[0]!=null)&&ce--);B=H[0]!=null,Z[0]||Z.splice(0,1)}if(v==At){for(S=1,ce=Z[0];ce>=10;ce/=10,S++);F(q,$+(q.e=S+k*ie-1)+1,M,B)}else q.e=k,q.r=+B;return q}}();function T(b,g,x,I){var O,$,M,v,N;if(x==null?x=c:xe(x,0,8),!b.c)return b.toString();if(O=b.c[0],M=b.e,g==null)N=pt(b.c),N=I==1||I==2&&(M<=a||M>=l)?is(N,M):en(N,M,"0");else if(b=F(new E(b),g,x),$=b.e,N=pt(b.c),v=N.length,I==1||I==2&&(g<=$||$<=a)){for(;v<g;N+="0",v++);N=is(N,$)}else if(g-=M+(I===2&&$>M),N=en(N,$,"0"),$+1>v){if(--g>0)for(N+=".";g--;N+="0");}else if(g+=$-v,g>0)for($+1==v&&(N+=".");g--;N+="0");return b.s<0&&O?"-"+N:N}function A(b,g){for(var x,I,O=1,$=new E(b[0]);O<b.length;O++)I=new E(b[O]),(!I.s||(x=jn($,I))===g||x===0&&$.s===g)&&($=I);return $}function D(b,g,x){for(var I=1,O=g.length;!g[--O];g.pop());for(O=g[0];O>=10;O/=10,I++);return(x=I+x*ie-1)>f?b.c=b.e=null:x<u?b.c=[b.e=0]:(b.e=x,b.c=g),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,x=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,M,v,N){var k,S=v?M:M.replace(O,"");if(I.test(S))$.s=isNaN(S)?null:S<0?-1:1;else{if(!v&&(S=S.replace(b,function(B,j,U){return k=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!N||N==k?j:B}),N&&(k=N,S=S.replace(g,"$1").replace(x,"0.$1")),M!=S))return new E(S,k);if(E.DEBUG)throw Error(Ge+"Not a"+(N?" base "+N:"")+" number: "+M);$.s=null}$.c=$.e=null}}();function F(b,g,x,I){var O,$,M,v,N,k,S,B=b.c,j=$i;if(B){e:{for(O=1,v=B[0];v>=10;v/=10,O++);if($=g-O,$<0)$+=ie,M=g,N=B[k=0],S=ft(N/j[O-M-1]%10);else if(k=Oi(($+1)/ie),k>=B.length)if(I){for(;B.length<=k;B.push(0));N=S=0,O=1,$%=ie,M=$-ie+1}else break e;else{for(N=v=B[k],O=1;v>=10;v/=10,O++);$%=ie,M=$-ie+O,S=M<0?0:ft(N/j[O-M-1]%10)}if(I=I||g<0||B[k+1]!=null||(M<0?N:N%j[O-M-1]),I=x<4?(S||I)&&(x==0||x==(b.s<0?3:2)):S>5||S==5&&(x==4||I||x==6&&($>0?M>0?N/j[O-M]:0:B[k-1])%10&1||x==(b.s<0?8:7)),g<1||!B[0])return B.length=0,I?(g-=b.e+1,B[0]=j[(ie-g%ie)%ie],b.e=-g||0):B[0]=b.e=0,b;if($==0?(B.length=k,v=1,k--):(B.length=k+1,v=j[ie-$],B[k]=M>0?ft(N/j[O-M]%j[M])*v:0),I)for(;;)if(k==0){for($=1,M=B[0];M>=10;M/=10,$++);for(M=B[0]+=v,v=1;M>=10;M/=10,v++);$!=v&&(b.e++,B[0]==At&&(B[0]=1));break}else{if(B[k]+=v,B[k]!=At)break;B[k--]=0,v=1}for($=B.length;B[--$]===0;B.pop());}b.e>f?b.c=b.e=null:b.e<u&&(b.c=[b.e=0])}return b}function L(b){var g,x=b.e;return x===null?b.toString():(g=pt(b.c),g=x<=a||x>=l?is(g,x):en(g,x,"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 jn(this,new E(b,g))},o.decimalPlaces=o.dp=function(b,g){var x,I,O,$=this;if(b!=null)return xe(b,0,Me),g==null?g=c:xe(g,0,8),F(new E($),b+$.e+1,g);if(!(x=$.c))return null;if(I=((O=x.length-1)-dt(this.e/ie))*ie,O=x[O])for(;O%10==0;O/=10,I--);return I<0&&(I=0),I},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 x,I,O,$,M,v,N,k,S,B=this;if(b=new E(b),b.c&&!b.isInteger())throw Error(Ge+"Exponent not an integer: "+L(b));if(g!=null&&(g=new E(g)),v=b.e>14,!B.c||!B.c[0]||B.c[0]==1&&!B.e&&B.c.length==1||!b.c||!b.c[0])return S=new E(Math.pow(+L(B),v?b.s*(2-ss(b)):+L(b))),g?S.mod(g):S;if(N=b.s<0,g){if(g.c?!g.c[0]:!g.s)return new E(NaN);I=!N&&B.isInteger()&&g.isInteger(),I&&(B=B.mod(g))}else{if(b.e>9&&(B.e>0||B.e<-1||(B.e==0?B.c[0]>1||v&&B.c[1]>=24e7:B.c[0]<8e13||v&&B.c[0]<=9999975e7)))return $=B.s<0&&ss(b)?-0:0,B.e>-1&&($=1/$),new E(N?1/$:$);h&&($=Oi(h/ie+2))}for(v?(x=new E(.5),N&&(b.s=1),k=ss(b)):(O=Math.abs(+L(b)),k=O%2),S=new E(s);;){if(k){if(S=S.times(B),!S.c)break;$?S.c.length>$&&(S.c.length=$):I&&(S=S.mod(g))}if(O){if(O=ft(O/2),O===0)break;k=O%2}else if(b=b.times(x),F(b,b.e+1,1),b.e>14)k=ss(b);else{if(O=+L(b),O===0)break;k=O%2}B=B.times(B),$?B.c&&B.c.length>$&&(B.c.length=$):I&&(B=B.mod(g))}return I?S:(N&&(S=s.div(S)),g?S.mod(g):$?F(S,h,c,M):S)},o.integerValue=function(b){var g=new E(this);return b==null?b=c:xe(b,0,8),F(g,g.e+1,b)},o.isEqualTo=o.eq=function(b,g){return jn(this,new E(b,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,g){return jn(this,new E(b,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,g){return(g=jn(this,new E(b,g)))===1||g===0},o.isInteger=function(){return!!this.c&&dt(this.e/ie)>this.c.length-2},o.isLessThan=o.lt=function(b,g){return jn(this,new E(b,g))<0},o.isLessThanOrEqualTo=o.lte=function(b,g){return(g=jn(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 x,I,O,$,M=this,v=M.s;if(b=new E(b,g),g=b.s,!v||!g)return new E(NaN);if(v!=g)return b.s=-g,M.plus(b);var N=M.e/ie,k=b.e/ie,S=M.c,B=b.c;if(!N||!k){if(!S||!B)return S?(b.s=-g,b):new E(B?M:NaN);if(!S[0]||!B[0])return B[0]?(b.s=-g,b):new E(S[0]?M:c==3?-0:0)}if(N=dt(N),k=dt(k),S=S.slice(),v=N-k){for(($=v<0)?(v=-v,O=S):(k=N,O=B),O.reverse(),g=v;g--;O.push(0));O.reverse()}else for(I=($=(v=S.length)<(g=B.length))?v:g,v=g=0;g<I;g++)if(S[g]!=B[g]){$=S[g]<B[g];break}if($&&(O=S,S=B,B=O,b.s=-b.s),g=(I=B.length)-(x=S.length),g>0)for(;g--;S[x++]=0);for(g=At-1;I>v;){if(S[--I]<B[I]){for(x=I;x&&!S[--x];S[x]=g);--S[x],S[I]+=At}S[I]-=B[I]}for(;S[0]==0;S.splice(0,1),--k);return S[0]?D(b,S,k):(b.s=c==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,g){var x,I,O=this;return b=new E(b,g),!O.c||!b.s||b.c&&!b.c[0]?new E(NaN):!b.c||O.c&&!O.c[0]?new E(O):(d==9?(I=b.s,b.s=1,x=t(O,b,0,3),b.s=I,x.s*=I):x=t(O,b,0,d),b=O.minus(x.times(b)),!b.c[0]&&d==1&&(b.s=O.s),b)},o.multipliedBy=o.times=function(b,g){var x,I,O,$,M,v,N,k,S,B,j,U,_,q,Z,H=this,W=H.c,J=(b=new E(b,g)).c;if(!W||!J||!W[0]||!J[0])return!H.s||!b.s||W&&!W[0]&&!J||J&&!J[0]&&!W?b.c=b.e=b.s=null:(b.s*=H.s,!W||!J?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(I=dt(H.e/ie)+dt(b.e/ie),b.s*=H.s,N=W.length,B=J.length,N<B&&(_=W,W=J,J=_,O=N,N=B,B=O),O=N+B,_=[];O--;_.push(0));for(q=At,Z=xn,O=B;--O>=0;){for(x=0,j=J[O]%Z,U=J[O]/Z|0,M=N,$=O+M;$>O;)k=W[--M]%Z,S=W[M]/Z|0,v=U*k+S*j,k=j*k+v%Z*Z+_[$]+x,x=(k/q|0)+(v/Z|0)+U*S,_[$--]=k%q;_[$]=x}return x?++I:_.splice(0,1),D(b,_,I)},o.negated=function(){var b=new E(this);return b.s=-b.s||null,b},o.plus=function(b,g){var x,I=this,O=I.s;if(b=new E(b,g),g=b.s,!O||!g)return new E(NaN);if(O!=g)return b.s=-g,I.minus(b);var $=I.e/ie,M=b.e/ie,v=I.c,N=b.c;if(!$||!M){if(!v||!N)return new E(O/0);if(!v[0]||!N[0])return N[0]?b:new E(v[0]?I:O*0)}if($=dt($),M=dt(M),v=v.slice(),O=$-M){for(O>0?(M=$,x=N):(O=-O,x=v),x.reverse();O--;x.push(0));x.reverse()}for(O=v.length,g=N.length,O-g<0&&(x=N,N=v,v=x,g=O),O=0;g;)O=(v[--g]=v[g]+N[g]+O)/At|0,v[g]=At===v[g]?0:v[g]%At;return O&&(v=[O].concat(v),++M),D(b,v,M)},o.precision=o.sd=function(b,g){var x,I,O,$=this;if(b!=null&&b!==!!b)return xe(b,1,Me),g==null?g=c:xe(g,0,8),F(new E($),b,g);if(!(x=$.c))return null;if(O=x.length-1,I=O*ie+1,O=x[O]){for(;O%10==0;O/=10,I--);for(O=x[0];O>=10;O/=10,I++);}return b&&$.e+1>I&&(I=$.e+1),I},o.shiftedBy=function(b){return xe(b,-Ii,Ii),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,g,x,I,O,$=this,M=$.c,v=$.s,N=$.e,k=i+4,S=new E("0.5");if(v!==1||!M||!M[0])return new E(!v||v<0&&(!M||M[0])?NaN:M?$:1/0);if(v=Math.sqrt(+L($)),v==0||v==1/0?(g=pt(M),(g.length+N)%2==0&&(g+="0"),v=Math.sqrt(+g),N=dt((N+1)/2)-(N<0||N%2),v==1/0?g="5e"+N:(g=v.toExponential(),g=g.slice(0,g.indexOf("e")+1)+N),x=new E(g)):x=new E(v+""),x.c[0]){for(N=x.e,v=N+k,v<3&&(v=0);;)if(O=x,x=S.times(O.plus(t($,O,k,1))),pt(O.c).slice(0,v)===(g=pt(x.c)).slice(0,v))if(x.e<N&&--v,g=g.slice(v-3,v+1),g=="9999"||!I&&g=="4999"){if(!I&&(F(O,O.e+i+2,0),O.times(O).eq($))){x=O;break}k+=4,v+=4,I=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(F(x,x.e+i+2,1),b=!x.times(x).eq($));break}}return F(x,x.e+i+1,c,b)},o.toExponential=function(b,g){return b!=null&&(xe(b,0,Me),b++),T(this,b,g,1)},o.toFixed=function(b,g){return b!=null&&(xe(b,0,Me),b=b+this.e+1),T(this,b,g)},o.toFormat=function(b,g,x){var I,O=this;if(x==null)b!=null&&g&&typeof g=="object"?(x=g,g=null):b&&typeof b=="object"?(x=b,b=g=null):x=m;else if(typeof x!="object")throw Error(Ge+"Argument not an object: "+x);if(I=O.toFixed(b,g),O.c){var $,M=I.split("."),v=+x.groupSize,N=+x.secondaryGroupSize,k=x.groupSeparator||"",S=M[0],B=M[1],j=O.s<0,U=j?S.slice(1):S,_=U.length;if(N&&($=v,v=N,N=$,_-=$),v>0&&_>0){for($=_%v||v,S=U.substr(0,$);$<_;$+=v)S+=k+U.substr($,v);N>0&&(S+=k+U.slice($)),j&&(S="-"+S)}I=B?S+(x.decimalSeparator||"")+((N=+x.fractionGroupSize)?B.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):B):S}return(x.prefix||"")+I+(x.suffix||"")},o.toFraction=function(b){var g,x,I,O,$,M,v,N,k,S,B,j,U=this,_=U.c;if(b!=null&&(v=new E(b),!v.isInteger()&&(v.c||v.s!==1)||v.lt(s)))throw Error(Ge+"Argument "+(v.isInteger()?"out of range: ":"not an integer: ")+L(v));if(!_)return new E(U);for(g=new E(s),k=x=new E(s),I=N=new E(s),j=pt(_),$=g.e=j.length-U.e-1,g.c[0]=$i[(M=$%ie)<0?ie+M:M],b=!b||v.comparedTo(g)>0?$>0?g:k:v,M=f,f=1/0,v=new E(j),N.c[0]=0;S=t(v,g,0,1),O=x.plus(S.times(I)),O.comparedTo(b)!=1;)x=I,I=O,k=N.plus(S.times(O=k)),N=O,g=v.minus(S.times(O=g)),v=O;return O=t(b.minus(x),I,0,1),N=N.plus(O.times(k)),x=x.plus(O.times(I)),N.s=k.s=U.s,$=$*2,B=t(k,I,$,c).minus(U).abs().comparedTo(t(N,x,$,c).minus(U).abs())<1?[k,I]:[N,x],f=M,B},o.toNumber=function(){return+L(this)},o.toPrecision=function(b,g){return b!=null&&xe(b,1,Me),T(this,b,g,2)},o.toString=function(b){var g,x=this,I=x.s,O=x.e;return O===null?I?(g="Infinity",I<0&&(g="-"+g)):g="NaN":(b==null?g=O<=a||O>=l?is(pt(x.c),O):en(pt(x.c),O,"0"):b===10&&P?(x=F(new E(x),i+O+1,c),g=en(pt(x.c),x.e,"0")):(xe(b,2,w.length,"Base"),g=n(en(pt(x.c),O,"0"),10,b,I,!0)),I<0&&x.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return L(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&E.set(e),E}function dt(e){var t=e|0;return e>0||e===t?t:t-1}function pt(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ie-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function jn(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 xe(e,t,n,r){if(e<t||e>n||e!==ft(e))throw Error(Ge+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ss(e){var t=e.c.length-1;return dt(e.e/ie)==t&&e.c[t]%2!=0}function is(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function en(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 Le=Kl();const ab=(e,t=6)=>{try{const n=new Le(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Le.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"}},Nt=()=>{const{translations:e,currentLocale:t}=Gl();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}}}},cb="1.1.0";let qe=class jl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof jl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof jl&&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@${cb}`].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 tn(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Zl=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Yl=/^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)?$/,Xl=/^\(.+?\).*?$/,Jl=/^tuple(?<array>(\[(\d*)\])*)$/;function ki(e){let t=e.type;if(Jl.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+=ki(s),o<n-1&&(t+=", ")}const r=tn(Jl,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,ki({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function ur(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=ki(o),r!==n-1&&(t+=", ")}return t}function as(e){var t;return e.type==="function"?`function ${e.name}(${ur(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${ur(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${ur(e.inputs)})`:e.type==="error"?`error ${e.name}(${ur(e.inputs)})`:e.type==="constructor"?`constructor(${ur(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ql=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function lb(e){return Ql.test(e)}function ub(e){return tn(Ql,e)}const eu=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function fb(e){return eu.test(e)}function db(e){return tn(eu,e)}const tu=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function pb(e){return tu.test(e)}function hb(e){return tn(tu,e)}const nu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function cs(e){return nu.test(e)}function mb(e){return tn(nu,e)}const ru=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function bb(e){return ru.test(e)}function gb(e){return tn(ru,e)}const ou=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function yb(e){return ou.test(e)}function vb(e){return tn(ou,e)}const wb=/^receive\(\) external payable$/;function xb(e){return wb.test(e)}const su=new Set(["memory","indexed","storage","calldata"]),Eb=new Set(["indexed"]),Mi=new Set(["calldata","memory","storage"]);class Sb extends qe{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 Pb extends qe{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 Tb extends qe{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 Ab extends qe{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 Nb extends qe{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Cb extends qe{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 Ob extends qe{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 Ib extends qe{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 qe{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 fr extends qe{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class kb extends qe{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Mb extends qe{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 Db extends qe{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 Bb extends qe{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 Lb(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 Di=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 Bi(e,t={}){if(pb(e))return Fb(e,t);if(fb(e))return Rb(e,t);if(lb(e))return jb(e,t);if(bb(e))return zb(e,t);if(yb(e))return Ub(e);if(xb(e))return{type:"receive",stateMutability:"payable"};throw new kb({signature:e})}function Fb(e,t={}){const n=hb(e);if(!n)throw new fr({signature:e,type:"function"});const r=st(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(nn(r[c],{modifiers:Mi,structs:t,type:"function"}));const i=[];if(n.returns){const c=st(n.returns),a=c.length;for(let l=0;l<a;l++)i.push(nn(c[l],{modifiers:Mi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Rb(e,t={}){const n=db(e);if(!n)throw new fr({signature:e,type:"event"});const r=st(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(nn(r[i],{modifiers:Eb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function jb(e,t={}){const n=ub(e);if(!n)throw new fr({signature:e,type:"error"});const r=st(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(nn(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function zb(e,t={}){const n=gb(e);if(!n)throw new fr({signature:e,type:"constructor"});const r=st(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(nn(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function Ub(e){const t=vb(e);if(!t)throw new fr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const _b=/^(?<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$_]*))?$/,Wb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Vb=/^u?int$/;function nn(e,t){var f,p;const n=Lb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Di.has(n))return Di.get(n);const r=Xl.test(e),o=tn(r?Wb:_b,e);if(!o)throw new Nb({param:e});if(o.name&&Gb(o.name))throw new Cb({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=st(o.type),h=[],m=d.length;for(let w=0;w<m;w++)h.push(nn(d[w],{structs:c}));l={components:h}}else if(o.type in c)a="tuple",l={components:c[o.type]};else if(Vb.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"&&!iu(a))throw new Tb({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 Ob({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(Mi.has(o.modifier)&&!qb(a,!!o.array))throw new Ib({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...l};return Di.set(n,u),u}function st(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?st(c,[...t,n.trim()]):st(c,t,`${n}${i}`,r);case"(":return st(c,t,`${n}${i}`,r+1);case")":return st(c,t,`${n}${i}`,r-1);default:return st(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Bb({current:n,depth:r});return t.push(n.trim()),t}function iu(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Zl.test(e)||Yl.test(e)}const Hb=/^(?: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 Gb(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Zl.test(e)||Yl.test(e)||Hb.test(e)}function qb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Li(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!cs(c))continue;const a=mb(c);if(!a)throw new fr({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=nn(h,{type:"struct"});u.push(m)}if(!u.length)throw new Mb({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]=au(a,t)}return r}const Kb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function au(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(Xl.test(i.type))r.push(i);else{const a=tn(Kb,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 Db({type:u});r.push({...i,type:`tuple${l??""}`,components:au(t[u]??[],t,new Set([...n,u]))})}else if(iu(u))r.push(i);else throw new Pb({type:u})}}return r}function cu(e){const t=Li(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];cs(s)||n.push(Bi(s,t))}return n}function lu(e){let t;if(typeof e=="string")t=Bi(e);else{const n=Li(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!cs(s)){t=Bi(s,n);break}}}if(!t)throw new Sb({signature:e});return t}function uu(e){const t=[];if(typeof e=="string"){const n=st(e),r=n.length;for(let o=0;o<r;o++)t.push(nn(n[o],{modifiers:su}))}else{const n=Li(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(cs(s))continue;const i=st(s),c=i.length;for(let a=0;a<c;a++)t.push(nn(i[a],{modifiers:su,structs:n}))}}if(t.length===0)throw new Ab({params:e});return t}function te(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 Ct(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new c1(e.type);return`${e.name}(${ls(e.inputs,{includeName:t})})`}function ls(e,{includeName:t=!1}={}){return e?e.map(n=>Zb(n,{includeName:t})).join(t?", ":","):""}function Zb(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ls(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Ot(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ee(e){return Ot(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const fu="2.42.1";let qr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${fu}`},V=class zl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof zl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof zl&&n.cause.docsPath||n.docsPath,s=(c=qr.getDocsUrl)==null?void 0:c.call(qr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...qr.version?[`Version: ${qr.version}`]:[]].join(`
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}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。",connectedWalletTitle:"從已連接錢包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他錢包進行充值",externalWalletTitle:"從外部錢包充值",externalWalletDesc:"從 Binance 或其他交易所、Arbitrum 等鏈或其他錢包轉帳",or:"或"},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:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。",connectedWalletTitle:"提現至已連接錢包",connectedWalletDesc:"將資金提現至您已連接的加密錢包、MetaMask、WalletConnect 或其他提供商",externalWalletTitle:"提現至外部帳戶",externalWalletDesc:"將資金提現至 Binance 或其他交易所、Arbitrum 等鏈及其他錢包"},account:{title:"帳戶",perp:"合約帳戶","perpetual-v1":"合約V1賬戶","perpetual-v2":"合約V2賬戶",spot:"現貨帳戶"}},Ci=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],Vl={"en-US":Km,"ja-JP":Jm,"ru-RU":Qm,"zh-CN":eb,"zh-TW":tb,"de-DE":qm,"es-LA":Zm,"fr-FR":Ym,"it-IT":Xm},os="en-US",nb={"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"},rb=e=>Ci.includes(e)?Vl[e]:Vl[os],ob=e=>Ci.includes(e),Hl=y.createContext(null),sb=({config:e,children:t})=>{const n=y.useMemo(()=>{const r=e.locale||os,o=ob(r)?r:os,s=rb(o);return{...e,currentLocale:o,translations:s}},[e]);return C.jsx(Hl.Provider,{value:n,children:t})},Gl=()=>{const e=y.useContext(Hl);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var ib=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Oi=Math.ceil,ft=Math.floor,Ge="[BigNumber Error] ",ql=Ge+"Number primitive has more than 15 significant digits: ",At=1e14,ie=14,Ii=9007199254740991,ki=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],xn=1e7,Me=1e9;function Kl(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 x,I,O,k,M,w,N,$,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((w=typeof b=="number")&&b*0==0){if(P.s=1/b<0?(b=-b,-1):1,b===~~b){for(k=0,M=b;M>=10;M/=10,k++);k>f?P.c=P.e=null:(P.e=k,P.c=[b]);return}$=String(b)}else{if(!ib.test($=String(b)))return r(P,$,w);P.s=$.charCodeAt(0)==45?($=$.slice(1),-1):1}(k=$.indexOf("."))>-1&&($=$.replace(".","")),(M=$.search(/e/i))>0?(k<0&&(k=M),k+=+$.slice(M+1),$=$.substring(0,M)):k<0&&(k=$.length)}else{if(xe(g,2,v.length,"Base"),g==10&&T)return P=new E(b),F(P,i+P.e+1,c);if($=String(b),w=typeof b=="number"){if(b*0!=0)return r(P,$,w,g);if(P.s=1/b<0?($=$.slice(1),-1):1,E.DEBUG&&$.replace(/^0\.0*|\./,"").length>15)throw Error(ql+b)}else P.s=$.charCodeAt(0)===45?($=$.slice(1),-1):1;for(x=v.slice(0,g),k=M=0,N=$.length;M<N;M++)if(x.indexOf(I=$.charAt(M))<0){if(I=="."){if(M>k){k=N;continue}}else if(!O&&($==$.toUpperCase()&&($=$.toLowerCase())||$==$.toLowerCase()&&($=$.toUpperCase()))){O=!0,M=-1,k=0;continue}return r(P,String(b),w,g)}w=!1,$=n($,g,10,P.s),(k=$.indexOf("."))>-1?$=$.replace(".",""):k=$.length}for(M=0;$.charCodeAt(M)===48;M++);for(N=$.length;$.charCodeAt(--N)===48;);if($=$.slice(M,++N)){if(N-=M,w&&E.DEBUG&&N>15&&(b>Ii||b!==ft(b)))throw Error(ql+P.s*b);if((k=k-M-1)>f)P.c=P.e=null;else if(k<u)P.c=[P.e=0];else{if(P.e=k,P.c=[],M=(k+1)%ie,k<0&&(M+=ie),M<N){for(M&&P.c.push(+$.slice(0,M)),N-=ie;M<N;)P.c.push(+$.slice(M,M+=ie));M=ie-($=$.slice(M)).length}else M-=N;for(;M--;$+="0");P.c.push(+$)}}else P.c=[P.e=0]}E.clone=Kl,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,x;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(g="DECIMAL_PLACES")&&(x=b[g],xe(x,0,Me,g),i=x),b.hasOwnProperty(g="ROUNDING_MODE")&&(x=b[g],xe(x,0,8,g),c=x),b.hasOwnProperty(g="EXPONENTIAL_AT")&&(x=b[g],x&&x.pop?(xe(x[0],-Me,0,g),xe(x[1],0,Me,g),a=x[0],l=x[1]):(xe(x,-Me,Me,g),a=-(l=x<0?-x:x))),b.hasOwnProperty(g="RANGE"))if(x=b[g],x&&x.pop)xe(x[0],-Me,-1,g),xe(x[1],1,Me,g),u=x[0],f=x[1];else if(xe(x,-Me,Me,g),x)u=-(f=x<0?-x:x);else throw Error(Ge+g+" cannot be zero: "+x);if(b.hasOwnProperty(g="CRYPTO"))if(x=b[g],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=x;else throw p=!x,Error(Ge+"crypto unavailable");else p=x;else throw Error(Ge+g+" not true or false: "+x);if(b.hasOwnProperty(g="MODULO_MODE")&&(x=b[g],xe(x,0,9,g),d=x),b.hasOwnProperty(g="POW_PRECISION")&&(x=b[g],xe(x,0,Me,g),h=x),b.hasOwnProperty(g="FORMAT"))if(x=b[g],typeof x=="object")m=x;else throw Error(Ge+g+" not an object: "+x);if(b.hasOwnProperty(g="ALPHABET"))if(x=b[g],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))T=x.slice(0,10)=="0123456789",v=x;else throw Error(Ge+g+" invalid: "+x)}else throw Error(Ge+"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,x,I=b.c,O=b.e,k=b.s;e:if({}.toString.call(I)=="[object Array]"){if((k===1||k===-1)&&O>=-Me&&O<=Me&&O===ft(O)){if(I[0]===0){if(O===0&&I.length===1)return!0;break e}if(g=(O+1)%ie,g<1&&(g+=ie),String(I[0]).length==g){for(g=0;g<I.length;g++)if(x=I[g],x<0||x>=At||x!==ft(x))break e;if(x!==0)return!0}}}else if(I===null&&O===null&&(k===null||k===1||k===-1))return!0;throw Error(Ge+"Invalid BigNumber: "+b)},E.maximum=E.max=function(){return A(arguments,-1)},E.minimum=E.min=function(){return A(arguments,1)},E.random=function(){var b=9007199254740992,g=Math.random()*b&2097151?function(){return ft(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var I,O,k,M,w,N=0,$=[],P=new E(s);if(x==null?x=i:xe(x,0,Me),M=Oi(x/ie),p)if(crypto.getRandomValues){for(I=crypto.getRandomValues(new Uint32Array(M*=2));N<M;)w=I[N]*131072+(I[N+1]>>>11),w>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),I[N]=O[0],I[N+1]=O[1]):($.push(w%1e14),N+=2);N=M/2}else if(crypto.randomBytes){for(I=crypto.randomBytes(M*=7);N<M;)w=(I[N]&31)*281474976710656+I[N+1]*1099511627776+I[N+2]*4294967296+I[N+3]*16777216+(I[N+4]<<16)+(I[N+5]<<8)+I[N+6],w>=9e15?crypto.randomBytes(7).copy(I,N):($.push(w%1e14),N+=7);N=M/7}else throw p=!1,Error(Ge+"crypto unavailable");if(!p)for(;N<M;)w=g(),w<9e15&&($[N++]=w%1e14);for(M=$[--N],x%=ie,M&&x&&(w=ki[ie-x],$[N]=ft(M/w)*w);$[N]===0;$.pop(),N--);if(N<0)$=[k=0];else{for(k=-1;$[0]===0;$.splice(0,1),k-=ie);for(N=1,w=$[0];w>=10;w/=10,N++);N<ie&&(k-=ie-N)}return P.e=k,P.c=$,P}}(),E.sum=function(){for(var b=1,g=arguments,x=new E(g[0]);b<g.length;)x=x.plus(g[b++]);return x},n=function(){var b="0123456789";function g(x,I,O,k){for(var M,w=[0],N,$=0,P=x.length;$<P;){for(N=w.length;N--;w[N]*=I);for(w[0]+=k.indexOf(x.charAt($++)),M=0;M<w.length;M++)w[M]>O-1&&(w[M+1]==null&&(w[M+1]=0),w[M+1]+=w[M]/O|0,w[M]%=O)}return w.reverse()}return function(x,I,O,k,M){var w,N,$,P,B,j,U,_,q=x.indexOf("."),Z=i,H=c;for(q>=0&&(P=h,h=0,x=x.replace(".",""),_=new E(I),j=_.pow(x.length-q),h=P,_.c=g(en(pt(j.c),j.e,"0"),10,O,b),_.e=_.c.length),U=g(x,I,O,M?(w=v,b):(w=b,v)),$=P=U.length;U[--P]==0;U.pop());if(!U[0])return w.charAt(0);if(q<0?--$:(j.c=U,j.e=$,j.s=k,j=t(j,_,Z,H,O),U=j.c,B=j.r,$=j.e),N=$+Z+1,q=U[N],P=O/2,B=B||N<0||U[N+1]!=null,B=H<4?(q!=null||B)&&(H==0||H==(j.s<0?3:2)):q>P||q==P&&(H==4||B||H==6&&U[N-1]&1||H==(j.s<0?8:7)),N<1||!U[0])x=B?en(w.charAt(1),-Z,w.charAt(0)):w.charAt(0);else{if(U.length=N,B)for(--O;++U[--N]>O;)U[N]=0,N||(++$,U=[1].concat(U));for(P=U.length;!U[--P];);for(q=0,x="";q<=P;x+=w.charAt(U[q++]));x=en(x,$,w.charAt(0))}return x}}(),t=function(){function b(I,O,k){var M,w,N,$,P=0,B=I.length,j=O%xn,U=O/xn|0;for(I=I.slice();B--;)N=I[B]%xn,$=I[B]/xn|0,M=U*N+$*j,w=j*N+M%xn*xn+P,P=(w/k|0)+(M/xn|0)+U*$,I[B]=w%k;return P&&(I=[P].concat(I)),I}function g(I,O,k,M){var w,N;if(k!=M)N=k>M?1:-1;else for(w=N=0;w<k;w++)if(I[w]!=O[w]){N=I[w]>O[w]?1:-1;break}return N}function x(I,O,k,M){for(var w=0;k--;)I[k]-=w,w=I[k]<O[k]?1:0,I[k]=w*M+I[k]-O[k];for(;!I[0]&&I.length>1;I.splice(0,1));}return function(I,O,k,M,w){var N,$,P,B,j,U,_,q,Z,H,W,J,K,Q,oe,ee,ue,ce=I.s==O.s?1:-1,pe=I.c,re=O.c;if(!pe||!pe[0]||!re||!re[0])return new E(!I.s||!O.s||(pe?re&&pe[0]==re[0]:!re)?NaN:pe&&pe[0]==0||!re?ce*0:ce/0);for(q=new E(ce),Z=q.c=[],$=I.e-O.e,ce=k+$+1,w||(w=At,$=dt(I.e/ie)-dt(O.e/ie),ce=ce/ie|0),P=0;re[P]==(pe[P]||0);P++);if(re[P]>(pe[P]||0)&&$--,ce<0)Z.push(1),B=!0;else{for(Q=pe.length,ee=re.length,P=0,ce+=2,j=ft(w/(re[0]+1)),j>1&&(re=b(re,j,w),pe=b(pe,j,w),ee=re.length,Q=pe.length),K=ee,H=pe.slice(0,ee),W=H.length;W<ee;H[W++]=0);ue=re.slice(),ue=[0].concat(ue),oe=re[0],re[1]>=w/2&&oe++;do{if(j=0,N=g(re,H,ee,W),N<0){if(J=H[0],ee!=W&&(J=J*w+(H[1]||0)),j=ft(J/oe),j>1)for(j>=w&&(j=w-1),U=b(re,j,w),_=U.length,W=H.length;g(U,H,_,W)==1;)j--,x(U,ee<_?ue:re,_,w),_=U.length,N=1;else j==0&&(N=j=1),U=re.slice(),_=U.length;if(_<W&&(U=[0].concat(U)),x(H,U,W,w),W=H.length,N==-1)for(;g(re,H,ee,W)<1;)j++,x(H,ee<W?ue:re,W,w),W=H.length}else N===0&&(j++,H=[0]);Z[P++]=j,H[0]?H[W++]=pe[K]||0:(H=[pe[K]],W=1)}while((K++<Q||H[0]!=null)&&ce--);B=H[0]!=null,Z[0]||Z.splice(0,1)}if(w==At){for(P=1,ce=Z[0];ce>=10;ce/=10,P++);F(q,k+(q.e=P+$*ie-1)+1,M,B)}else q.e=$,q.r=+B;return q}}();function S(b,g,x,I){var O,k,M,w,N;if(x==null?x=c:xe(x,0,8),!b.c)return b.toString();if(O=b.c[0],M=b.e,g==null)N=pt(b.c),N=I==1||I==2&&(M<=a||M>=l)?is(N,M):en(N,M,"0");else if(b=F(new E(b),g,x),k=b.e,N=pt(b.c),w=N.length,I==1||I==2&&(g<=k||k<=a)){for(;w<g;N+="0",w++);N=is(N,k)}else if(g-=M+(I===2&&k>M),N=en(N,k,"0"),k+1>w){if(--g>0)for(N+=".";g--;N+="0");}else if(g+=k-w,g>0)for(k+1==w&&(N+=".");g--;N+="0");return b.s<0&&O?"-"+N:N}function A(b,g){for(var x,I,O=1,k=new E(b[0]);O<b.length;O++)I=new E(b[O]),(!I.s||(x=jn(k,I))===g||x===0&&k.s===g)&&(k=I);return k}function D(b,g,x){for(var I=1,O=g.length;!g[--O];g.pop());for(O=g[0];O>=10;O/=10,I++);return(x=I+x*ie-1)>f?b.c=b.e=null:x<u?b.c=[b.e=0]:(b.e=x,b.c=g),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,x=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(k,M,w,N){var $,P=w?M:M.replace(O,"");if(I.test(P))k.s=isNaN(P)?null:P<0?-1:1;else{if(!w&&(P=P.replace(b,function(B,j,U){return $=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!N||N==$?j:B}),N&&($=N,P=P.replace(g,"$1").replace(x,"0.$1")),M!=P))return new E(P,$);if(E.DEBUG)throw Error(Ge+"Not a"+(N?" base "+N:"")+" number: "+M);k.s=null}k.c=k.e=null}}();function F(b,g,x,I){var O,k,M,w,N,$,P,B=b.c,j=ki;if(B){e:{for(O=1,w=B[0];w>=10;w/=10,O++);if(k=g-O,k<0)k+=ie,M=g,N=B[$=0],P=ft(N/j[O-M-1]%10);else if($=Oi((k+1)/ie),$>=B.length)if(I){for(;B.length<=$;B.push(0));N=P=0,O=1,k%=ie,M=k-ie+1}else break e;else{for(N=w=B[$],O=1;w>=10;w/=10,O++);k%=ie,M=k-ie+O,P=M<0?0:ft(N/j[O-M-1]%10)}if(I=I||g<0||B[$+1]!=null||(M<0?N:N%j[O-M-1]),I=x<4?(P||I)&&(x==0||x==(b.s<0?3:2)):P>5||P==5&&(x==4||I||x==6&&(k>0?M>0?N/j[O-M]:0:B[$-1])%10&1||x==(b.s<0?8:7)),g<1||!B[0])return B.length=0,I?(g-=b.e+1,B[0]=j[(ie-g%ie)%ie],b.e=-g||0):B[0]=b.e=0,b;if(k==0?(B.length=$,w=1,$--):(B.length=$+1,w=j[ie-k],B[$]=M>0?ft(N/j[O-M]%j[M])*w:0),I)for(;;)if($==0){for(k=1,M=B[0];M>=10;M/=10,k++);for(M=B[0]+=w,w=1;M>=10;M/=10,w++);k!=w&&(b.e++,B[0]==At&&(B[0]=1));break}else{if(B[$]+=w,B[$]!=At)break;B[$--]=0,w=1}for(k=B.length;B[--k]===0;B.pop());}b.e>f?b.c=b.e=null:b.e<u&&(b.c=[b.e=0])}return b}function L(b){var g,x=b.e;return x===null?b.toString():(g=pt(b.c),g=x<=a||x>=l?is(g,x):en(g,x,"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 jn(this,new E(b,g))},o.decimalPlaces=o.dp=function(b,g){var x,I,O,k=this;if(b!=null)return xe(b,0,Me),g==null?g=c:xe(g,0,8),F(new E(k),b+k.e+1,g);if(!(x=k.c))return null;if(I=((O=x.length-1)-dt(this.e/ie))*ie,O=x[O])for(;O%10==0;O/=10,I--);return I<0&&(I=0),I},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 x,I,O,k,M,w,N,$,P,B=this;if(b=new E(b),b.c&&!b.isInteger())throw Error(Ge+"Exponent not an integer: "+L(b));if(g!=null&&(g=new E(g)),w=b.e>14,!B.c||!B.c[0]||B.c[0]==1&&!B.e&&B.c.length==1||!b.c||!b.c[0])return P=new E(Math.pow(+L(B),w?b.s*(2-ss(b)):+L(b))),g?P.mod(g):P;if(N=b.s<0,g){if(g.c?!g.c[0]:!g.s)return new E(NaN);I=!N&&B.isInteger()&&g.isInteger(),I&&(B=B.mod(g))}else{if(b.e>9&&(B.e>0||B.e<-1||(B.e==0?B.c[0]>1||w&&B.c[1]>=24e7:B.c[0]<8e13||w&&B.c[0]<=9999975e7)))return k=B.s<0&&ss(b)?-0:0,B.e>-1&&(k=1/k),new E(N?1/k:k);h&&(k=Oi(h/ie+2))}for(w?(x=new E(.5),N&&(b.s=1),$=ss(b)):(O=Math.abs(+L(b)),$=O%2),P=new E(s);;){if($){if(P=P.times(B),!P.c)break;k?P.c.length>k&&(P.c.length=k):I&&(P=P.mod(g))}if(O){if(O=ft(O/2),O===0)break;$=O%2}else if(b=b.times(x),F(b,b.e+1,1),b.e>14)$=ss(b);else{if(O=+L(b),O===0)break;$=O%2}B=B.times(B),k?B.c&&B.c.length>k&&(B.c.length=k):I&&(B=B.mod(g))}return I?P:(N&&(P=s.div(P)),g?P.mod(g):k?F(P,h,c,M):P)},o.integerValue=function(b){var g=new E(this);return b==null?b=c:xe(b,0,8),F(g,g.e+1,b)},o.isEqualTo=o.eq=function(b,g){return jn(this,new E(b,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,g){return jn(this,new E(b,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,g){return(g=jn(this,new E(b,g)))===1||g===0},o.isInteger=function(){return!!this.c&&dt(this.e/ie)>this.c.length-2},o.isLessThan=o.lt=function(b,g){return jn(this,new E(b,g))<0},o.isLessThanOrEqualTo=o.lte=function(b,g){return(g=jn(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 x,I,O,k,M=this,w=M.s;if(b=new E(b,g),g=b.s,!w||!g)return new E(NaN);if(w!=g)return b.s=-g,M.plus(b);var N=M.e/ie,$=b.e/ie,P=M.c,B=b.c;if(!N||!$){if(!P||!B)return P?(b.s=-g,b):new E(B?M:NaN);if(!P[0]||!B[0])return B[0]?(b.s=-g,b):new E(P[0]?M:c==3?-0:0)}if(N=dt(N),$=dt($),P=P.slice(),w=N-$){for((k=w<0)?(w=-w,O=P):($=N,O=B),O.reverse(),g=w;g--;O.push(0));O.reverse()}else for(I=(k=(w=P.length)<(g=B.length))?w:g,w=g=0;g<I;g++)if(P[g]!=B[g]){k=P[g]<B[g];break}if(k&&(O=P,P=B,B=O,b.s=-b.s),g=(I=B.length)-(x=P.length),g>0)for(;g--;P[x++]=0);for(g=At-1;I>w;){if(P[--I]<B[I]){for(x=I;x&&!P[--x];P[x]=g);--P[x],P[I]+=At}P[I]-=B[I]}for(;P[0]==0;P.splice(0,1),--$);return P[0]?D(b,P,$):(b.s=c==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,g){var x,I,O=this;return b=new E(b,g),!O.c||!b.s||b.c&&!b.c[0]?new E(NaN):!b.c||O.c&&!O.c[0]?new E(O):(d==9?(I=b.s,b.s=1,x=t(O,b,0,3),b.s=I,x.s*=I):x=t(O,b,0,d),b=O.minus(x.times(b)),!b.c[0]&&d==1&&(b.s=O.s),b)},o.multipliedBy=o.times=function(b,g){var x,I,O,k,M,w,N,$,P,B,j,U,_,q,Z,H=this,W=H.c,J=(b=new E(b,g)).c;if(!W||!J||!W[0]||!J[0])return!H.s||!b.s||W&&!W[0]&&!J||J&&!J[0]&&!W?b.c=b.e=b.s=null:(b.s*=H.s,!W||!J?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(I=dt(H.e/ie)+dt(b.e/ie),b.s*=H.s,N=W.length,B=J.length,N<B&&(_=W,W=J,J=_,O=N,N=B,B=O),O=N+B,_=[];O--;_.push(0));for(q=At,Z=xn,O=B;--O>=0;){for(x=0,j=J[O]%Z,U=J[O]/Z|0,M=N,k=O+M;k>O;)$=W[--M]%Z,P=W[M]/Z|0,w=U*$+P*j,$=j*$+w%Z*Z+_[k]+x,x=($/q|0)+(w/Z|0)+U*P,_[k--]=$%q;_[k]=x}return x?++I:_.splice(0,1),D(b,_,I)},o.negated=function(){var b=new E(this);return b.s=-b.s||null,b},o.plus=function(b,g){var x,I=this,O=I.s;if(b=new E(b,g),g=b.s,!O||!g)return new E(NaN);if(O!=g)return b.s=-g,I.minus(b);var k=I.e/ie,M=b.e/ie,w=I.c,N=b.c;if(!k||!M){if(!w||!N)return new E(O/0);if(!w[0]||!N[0])return N[0]?b:new E(w[0]?I:O*0)}if(k=dt(k),M=dt(M),w=w.slice(),O=k-M){for(O>0?(M=k,x=N):(O=-O,x=w),x.reverse();O--;x.push(0));x.reverse()}for(O=w.length,g=N.length,O-g<0&&(x=N,N=w,w=x,g=O),O=0;g;)O=(w[--g]=w[g]+N[g]+O)/At|0,w[g]=At===w[g]?0:w[g]%At;return O&&(w=[O].concat(w),++M),D(b,w,M)},o.precision=o.sd=function(b,g){var x,I,O,k=this;if(b!=null&&b!==!!b)return xe(b,1,Me),g==null?g=c:xe(g,0,8),F(new E(k),b,g);if(!(x=k.c))return null;if(O=x.length-1,I=O*ie+1,O=x[O]){for(;O%10==0;O/=10,I--);for(O=x[0];O>=10;O/=10,I++);}return b&&k.e+1>I&&(I=k.e+1),I},o.shiftedBy=function(b){return xe(b,-Ii,Ii),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,g,x,I,O,k=this,M=k.c,w=k.s,N=k.e,$=i+4,P=new E("0.5");if(w!==1||!M||!M[0])return new E(!w||w<0&&(!M||M[0])?NaN:M?k:1/0);if(w=Math.sqrt(+L(k)),w==0||w==1/0?(g=pt(M),(g.length+N)%2==0&&(g+="0"),w=Math.sqrt(+g),N=dt((N+1)/2)-(N<0||N%2),w==1/0?g="5e"+N:(g=w.toExponential(),g=g.slice(0,g.indexOf("e")+1)+N),x=new E(g)):x=new E(w+""),x.c[0]){for(N=x.e,w=N+$,w<3&&(w=0);;)if(O=x,x=P.times(O.plus(t(k,O,$,1))),pt(O.c).slice(0,w)===(g=pt(x.c)).slice(0,w))if(x.e<N&&--w,g=g.slice(w-3,w+1),g=="9999"||!I&&g=="4999"){if(!I&&(F(O,O.e+i+2,0),O.times(O).eq(k))){x=O;break}$+=4,w+=4,I=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(F(x,x.e+i+2,1),b=!x.times(x).eq(k));break}}return F(x,x.e+i+1,c,b)},o.toExponential=function(b,g){return b!=null&&(xe(b,0,Me),b++),S(this,b,g,1)},o.toFixed=function(b,g){return b!=null&&(xe(b,0,Me),b=b+this.e+1),S(this,b,g)},o.toFormat=function(b,g,x){var I,O=this;if(x==null)b!=null&&g&&typeof g=="object"?(x=g,g=null):b&&typeof b=="object"?(x=b,b=g=null):x=m;else if(typeof x!="object")throw Error(Ge+"Argument not an object: "+x);if(I=O.toFixed(b,g),O.c){var k,M=I.split("."),w=+x.groupSize,N=+x.secondaryGroupSize,$=x.groupSeparator||"",P=M[0],B=M[1],j=O.s<0,U=j?P.slice(1):P,_=U.length;if(N&&(k=w,w=N,N=k,_-=k),w>0&&_>0){for(k=_%w||w,P=U.substr(0,k);k<_;k+=w)P+=$+U.substr(k,w);N>0&&(P+=$+U.slice(k)),j&&(P="-"+P)}I=B?P+(x.decimalSeparator||"")+((N=+x.fractionGroupSize)?B.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):B):P}return(x.prefix||"")+I+(x.suffix||"")},o.toFraction=function(b){var g,x,I,O,k,M,w,N,$,P,B,j,U=this,_=U.c;if(b!=null&&(w=new E(b),!w.isInteger()&&(w.c||w.s!==1)||w.lt(s)))throw Error(Ge+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+L(w));if(!_)return new E(U);for(g=new E(s),$=x=new E(s),I=N=new E(s),j=pt(_),k=g.e=j.length-U.e-1,g.c[0]=ki[(M=k%ie)<0?ie+M:M],b=!b||w.comparedTo(g)>0?k>0?g:$:w,M=f,f=1/0,w=new E(j),N.c[0]=0;P=t(w,g,0,1),O=x.plus(P.times(I)),O.comparedTo(b)!=1;)x=I,I=O,$=N.plus(P.times(O=$)),N=O,g=w.minus(P.times(O=g)),w=O;return O=t(b.minus(x),I,0,1),N=N.plus(O.times($)),x=x.plus(O.times(I)),N.s=$.s=U.s,k=k*2,B=t($,I,k,c).minus(U).abs().comparedTo(t(N,x,k,c).minus(U).abs())<1?[$,I]:[N,x],f=M,B},o.toNumber=function(){return+L(this)},o.toPrecision=function(b,g){return b!=null&&xe(b,1,Me),S(this,b,g,2)},o.toString=function(b){var g,x=this,I=x.s,O=x.e;return O===null?I?(g="Infinity",I<0&&(g="-"+g)):g="NaN":(b==null?g=O<=a||O>=l?is(pt(x.c),O):en(pt(x.c),O,"0"):b===10&&T?(x=F(new E(x),i+O+1,c),g=en(pt(x.c),x.e,"0")):(xe(b,2,v.length,"Base"),g=n(en(pt(x.c),O,"0"),10,b,I,!0)),I<0&&x.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return L(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&E.set(e),E}function dt(e){var t=e|0;return e>0||e===t?t:t-1}function pt(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ie-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function jn(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 xe(e,t,n,r){if(e<t||e>n||e!==ft(e))throw Error(Ge+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ss(e){var t=e.c.length-1;return dt(e.e/ie)==t&&e.c[t]%2!=0}function is(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function en(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 Le=Kl();const ab=(e,t=6)=>{try{const n=new Le(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,Le.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"}},Nt=()=>{const{translations:e,currentLocale:t}=Gl();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}}}},cb="1.1.0";let qe=class jl extends Error{constructor(t,n={}){var i;const r=n.cause instanceof jl?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof jl&&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@${cb}`].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 tn(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Zl=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Yl=/^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)?$/,Xl=/^\(.+?\).*?$/,Jl=/^tuple(?<array>(\[(\d*)\])*)$/;function $i(e){let t=e.type;if(Jl.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+=$i(s),o<n-1&&(t+=", ")}const r=tn(Jl,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,$i({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function ur(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=$i(o),r!==n-1&&(t+=", ")}return t}function as(e){var t;return e.type==="function"?`function ${e.name}(${ur(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${ur(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${ur(e.inputs)})`:e.type==="error"?`error ${e.name}(${ur(e.inputs)})`:e.type==="constructor"?`constructor(${ur(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Ql=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function lb(e){return Ql.test(e)}function ub(e){return tn(Ql,e)}const eu=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function fb(e){return eu.test(e)}function db(e){return tn(eu,e)}const tu=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function pb(e){return tu.test(e)}function hb(e){return tn(tu,e)}const nu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function cs(e){return nu.test(e)}function mb(e){return tn(nu,e)}const ru=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function bb(e){return ru.test(e)}function gb(e){return tn(ru,e)}const ou=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function yb(e){return ou.test(e)}function vb(e){return tn(ou,e)}const wb=/^receive\(\) external payable$/;function xb(e){return wb.test(e)}const su=new Set(["memory","indexed","storage","calldata"]),Eb=new Set(["indexed"]),Mi=new Set(["calldata","memory","storage"]);class Sb extends qe{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 Pb extends qe{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 Tb extends qe{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 Ab extends qe{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 Nb extends qe{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Cb extends qe{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 Ob extends qe{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 Ib extends qe{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 kb extends qe{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 fr extends qe{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class $b extends qe{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Mb extends qe{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 Db extends qe{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 Bb extends qe{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 Lb(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 Di=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 Bi(e,t={}){if(pb(e))return Fb(e,t);if(fb(e))return Rb(e,t);if(lb(e))return jb(e,t);if(bb(e))return zb(e,t);if(yb(e))return Ub(e);if(xb(e))return{type:"receive",stateMutability:"payable"};throw new $b({signature:e})}function Fb(e,t={}){const n=hb(e);if(!n)throw new fr({signature:e,type:"function"});const r=st(n.parameters),o=[],s=r.length;for(let c=0;c<s;c++)o.push(nn(r[c],{modifiers:Mi,structs:t,type:"function"}));const i=[];if(n.returns){const c=st(n.returns),a=c.length;for(let l=0;l<a;l++)i.push(nn(c[l],{modifiers:Mi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Rb(e,t={}){const n=db(e);if(!n)throw new fr({signature:e,type:"event"});const r=st(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(nn(r[i],{modifiers:Eb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function jb(e,t={}){const n=ub(e);if(!n)throw new fr({signature:e,type:"error"});const r=st(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(nn(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function zb(e,t={}){const n=gb(e);if(!n)throw new fr({signature:e,type:"constructor"});const r=st(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(nn(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function Ub(e){const t=vb(e);if(!t)throw new fr({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const _b=/^(?<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$_]*))?$/,Wb=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Vb=/^u?int$/;function nn(e,t){var f,p;const n=Lb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Di.has(n))return Di.get(n);const r=Xl.test(e),o=tn(r?Wb:_b,e);if(!o)throw new Nb({param:e});if(o.name&&Gb(o.name))throw new Cb({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=st(o.type),h=[],m=d.length;for(let v=0;v<m;v++)h.push(nn(d[v],{structs:c}));l={components:h}}else if(o.type in c)a="tuple",l={components:c[o.type]};else if(Vb.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"&&!iu(a))throw new Tb({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 Ob({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(Mi.has(o.modifier)&&!qb(a,!!o.array))throw new Ib({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...l};return Di.set(n,u),u}function st(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?st(c,[...t,n.trim()]):st(c,t,`${n}${i}`,r);case"(":return st(c,t,`${n}${i}`,r+1);case")":return st(c,t,`${n}${i}`,r-1);default:return st(c,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Bb({current:n,depth:r});return t.push(n.trim()),t}function iu(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Zl.test(e)||Yl.test(e)}const Hb=/^(?: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 Gb(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Zl.test(e)||Yl.test(e)||Hb.test(e)}function qb(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Li(e){const t={},n=e.length;for(let i=0;i<n;i++){const c=e[i];if(!cs(c))continue;const a=mb(c);if(!a)throw new fr({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=nn(h,{type:"struct"});u.push(m)}if(!u.length)throw new Mb({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]=au(a,t)}return r}const Kb=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function au(e,t,n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(Xl.test(i.type))r.push(i);else{const a=tn(Kb,i.type);if(!(a!=null&&a.type))throw new kb({abiParameter:i});const{array:l,type:u}=a;if(u in t){if(n.has(u))throw new Db({type:u});r.push({...i,type:`tuple${l??""}`,components:au(t[u]??[],t,new Set([...n,u]))})}else if(iu(u))r.push(i);else throw new Pb({type:u})}}return r}function cu(e){const t=Li(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];cs(s)||n.push(Bi(s,t))}return n}function lu(e){let t;if(typeof e=="string")t=Bi(e);else{const n=Li(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!cs(s)){t=Bi(s,n);break}}}if(!t)throw new Sb({signature:e});return t}function uu(e){const t=[];if(typeof e=="string"){const n=st(e),r=n.length;for(let o=0;o<r;o++)t.push(nn(n[o],{modifiers:su}))}else{const n=Li(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(cs(s))continue;const i=st(s),c=i.length;for(let a=0;a<c;a++)t.push(nn(i[a],{modifiers:su,structs:n}))}}if(t.length===0)throw new Ab({params:e});return t}function te(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 Ct(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new c1(e.type);return`${e.name}(${ls(e.inputs,{includeName:t})})`}function ls(e,{includeName:t=!1}={}){return e?e.map(n=>Zb(n,{includeName:t})).join(t?", ":","):""}function Zb(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ls(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Ot(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ee(e){return Ot(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const fu="2.42.1";let qr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${fu}`},V=class zl extends Error{constructor(t,n={}){var c;const r=(()=>{var a;return n.cause instanceof zl?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof zl&&n.cause.docsPath||n.docsPath,s=(c=qr.getDocsUrl)==null?void 0:c.call(qr,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...qr.version?[`Version: ${qr.version}`]:[]].join(`
52
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=fu}walk(t){return du(this,t)}};function du(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?du(e.cause,t):t?null:e}class Yb 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
53
  `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class pu 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
54
  `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class hu extends V{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
@@ -68,7 +68,7 @@ React keys must be passed directly to JSX without using spread:
68
68
  `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class a1 extends V{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
69
69
  `),{docsPath:n,name:"InvalidAbiDecodingType"})}}let vu=class extends V{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
70
70
  `),{name:"InvalidArrayError"})}};class c1 extends V{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
71
- `),{name:"InvalidDefinitionTypeError"})}}class l1 extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let wu=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"})}},xu=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 Eu 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 pr(e,{dir:t,size:n=32}={}){return typeof e=="string"?En(e,{dir:t,size:n}):u1(e,{dir:t,size:n})}function En(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new xu({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function u1(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new xu({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 Su=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"})}},f1=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 d1 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 p1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function zn(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 It(e,{size:t}){if(Ee(e)>t)throw new p1({givenSize:Ee(e),maxSize:t})}function Ut(e,t={}){const{signed:n}=t;t.size&&It(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 h1(e,t={}){let n=e;if(t.size&&(It(n,{size:t.size}),n=zn(n)),zn(n)==="0x00")return!1;if(zn(n)==="0x01")return!0;throw new d1(n)}function rn(e,t={}){return Number(Ut(e,t))}const m1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Sn(e,t={}){return typeof e=="number"||typeof e=="bigint"?ne(e,t):typeof e=="string"?Zr(e,t):typeof e=="boolean"?Pu(e,t):Oe(e,t)}function Pu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(It(n,{size:t.size}),pr(n,{size:t.size})):n}function Oe(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=m1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(It(r,{size:t.size}),pr(r,{dir:"right",size:t.size})):r}function ne(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 Su({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?pr(c,{size:r}):c}const b1=new TextEncoder;function Zr(e,t={}){const n=b1.encode(e);return Oe(n,t)}const g1=new TextEncoder;function hr(e,t={}){return typeof e=="number"||typeof e=="bigint"?v1(e,t):typeof e=="boolean"?y1(e,t):Ot(e)?_t(e,t):Un(e,t)}function y1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(It(n,{size:t.size}),pr(n,{size:t.size})):n}const on={zero:48,nine:57,A:65,F:70,a:97,f:102};function Tu(e){if(e>=on.zero&&e<=on.nine)return e-on.zero;if(e>=on.A&&e<=on.F)return e-(on.A-10);if(e>=on.a&&e<=on.f)return e-(on.a-10)}function _t(e,t={}){let n=e;t.size&&(It(n,{size:t.size}),n=pr(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=Tu(r.charCodeAt(c++)),l=Tu(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 v1(e,t){const n=ne(e,t);return _t(n)}function Un(e,t={}){const n=g1.encode(e);return typeof t.size=="number"?(It(n,{size:t.size}),pr(n,{dir:"right",size:t.size})):n}const fs=BigInt(2**32-1),Au=BigInt(32);function w1(e,t=!1){return t?{h:Number(e&fs),l:Number(e>>Au&fs)}:{h:Number(e>>Au&fs)|0,l:Number(e&fs)|0}}function x1(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}=w1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const E1=(e,t,n)=>e<<n|t>>>32-n,S1=(e,t,n)=>t<<n|e>>>32-n,P1=(e,t,n)=>t<<n-32|e>>>64-n,T1=(e,t,n)=>e<<n-32|t>>>64-n,mr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Yr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function _n(e,...t){if(!A1(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 N1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Yr(e.outputLen),Yr(e.blockLen)}function br(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 Nu(e,t){_n(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function C1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function gr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ri(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Wt(e,t){return e<<32-t|e>>>t}const O1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function I1(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]=I1(e[t]);return e}const Cu=O1?e=>e:$1;function k1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ds(e){return typeof e=="string"&&(e=k1(e)),_n(e),e}function M1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];_n(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 ji{}function Ou(e){const t=r=>e().update(ds(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function D1(e=32){if(mr&&typeof mr.getRandomValues=="function")return mr.getRandomValues(new Uint8Array(e));if(mr&&typeof mr.randomBytes=="function")return Uint8Array.from(mr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const B1=BigInt(0),Xr=BigInt(1),L1=BigInt(2),F1=BigInt(7),R1=BigInt(256),j1=BigInt(113),Iu=[],$u=[],ku=[];for(let e=0,t=Xr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Iu.push(2*(5*r+n)),$u.push((e+1)*(e+2)/2%64);let o=B1;for(let s=0;s<7;s++)t=(t<<Xr^(t>>F1)*j1)%R1,t&L1&&(o^=Xr<<(Xr<<BigInt(s))-Xr);ku.push(o)}const Mu=x1(ku,!0),z1=Mu[0],U1=Mu[1],Du=(e,t,n)=>n>32?P1(e,t,n):E1(e,t,n),Bu=(e,t,n)=>n>32?T1(e,t,n):S1(e,t,n);function _1(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=Du(l,u,1)^n[c],p=Bu(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=$u[i],a=Du(o,s,c),l=Bu(o,s,c),u=Iu[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]^=z1[r],e[1]^=U1[r]}gr(n)}class zi extends ji{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,Yr(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=C1(this.state)}clone(){return this._cloneInto()}keccak(){Cu(this.state32),_1(this.state32,this.rounds),Cu(this.state32),this.posOut=0,this.pos=0}update(t){br(this),t=ds(t),_n(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){br(this,!1),_n(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 Yr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Nu(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,gr(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new zi(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 W1=(e,t,n)=>Ou(()=>new zi(t,e,n)),Lu=W1(1,136,256/8);function Fe(e,t){const n=t||"hex",r=Lu(Ot(e,{strict:!1})?hr(e):e);return n==="bytes"?r:Sn(r)}const V1=e=>Fe(hr(e));function H1(e){return V1(e)}function G1(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 q1=e=>{const t=typeof e=="string"?e:as(e);return G1(t)};function Fu(e){return H1(q1(e))}const ps=Fu;let Pn=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"})}},hs=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 Ui=new hs(8192);function ms(e,t){if(Ui.has(`${e}.${t}`))return Ui.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Fe(Un(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 Ui.set(`${e}.${t}`,s),s}function Tn(e,t){if(!ht(e,{strict:!1}))throw new Pn({address:e});return ms(e,t)}const K1=/^0x[a-fA-F0-9]{40}$/,_i=new hs(8192);function ht(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(_i.has(r))return _i.get(r);const o=K1.test(e)?e.toLowerCase()===e?!0:n?ms(e)===e:!0:!1;return _i.set(r,o),o}function $t(e){return typeof e[0]=="string"?yr(e):Z1(e)}function Z1(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 yr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function vr(e,t,n,{strict:r}={}){return Ot(e,{strict:!1})?Y1(e,t,n,{strict:r}):zu(e,t,n,{strict:r})}function Ru(e,t){if(typeof t=="number"&&t>0&&t>Ee(e)-1)throw new wu({offset:t,position:"start",size:Ee(e)})}function ju(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ee(e)!==n-t)throw new wu({offset:n,position:"end",size:Ee(e)})}function zu(e,t,n,{strict:r}={}){Ru(e,t);const o=e.slice(t,n);return r&&ju(o,t,n),o}function Y1(e,t,n,{strict:r}={}){Ru(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&ju(o,t,n),o}const X1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Uu=/^(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 An(e,t){if(e.length!==t.length)throw new Qb({expectedLength:e.length,givenLength:t.length});const n=J1({params:e,values:t}),r=Vi(n);return r.length===0?"0x":r}function J1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Wi({param:e[r],value:t[r]}));return n}function Wi({param:e,value:t}){const n=Hi(e.type);if(n){const[r,o]=n;return eg(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return sg(t,{param:e});if(e.type==="address")return Q1(t);if(e.type==="bool")return ng(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Uu.exec(e.type)??[];return rg(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return tg(t,{param:e});if(e.type==="string")return og(t);throw new i1(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Vi(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=Ee(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(ne(t+o,{size:32})),r.push(c),o+=Ee(c)):n.push(c)}return $t([...n,...r])}function Q1(e){if(!ht(e))throw new Pn({address:e});return{dynamic:!1,encoded:En(e.toLowerCase())}}function eg(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new vu(e);if(!r&&e.length!==t)throw new Xb({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Wi({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=Vi(s);if(r){const c=ne(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?$t([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:$t(s.map(({encoded:i})=>i))}}function tg(e,{param:t}){const[,n]=t.type.split("bytes"),r=Ee(e);if(!n){let o=e;return r%32!==0&&(o=En(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:$t([En(ne(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new Jb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:En(e,{dir:"right"})}}function ng(e){if(typeof e!="boolean")throw new V(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:En(Pu(e))}}function rg(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 Su({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ne(e,{size:32,signed:t})}}function og(e){const t=Zr(e),n=Math.ceil(Ee(t)/32),r=[];for(let o=0;o<n;o++)r.push(En(vr(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:$t([En(ne(Ee(t),{size:32})),...r])}}function sg(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=Wi({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Vi(r):$t(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 Jr=e=>vr(Fu(e),0,4);function Wn(e){const{abi:t,args:n=[],name:r}=e,o=Ot(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Jr(c)===r:c.type==="event"?ps(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?Gi(l,f):!1})){if(i&&"inputs"in i&&i.inputs){const l=_u(c.inputs,i.inputs,n);if(l)throw new o1({abiItem:c,type:l[0]},{abiItem:i,type:l[1]})}i=c}}return i||s[0]}function Gi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ht(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)=>Gi(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=>Gi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _u(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 _u(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")?ht(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ht(n[r],{strict:!1}):!1)return i}}const Wu="/docs/contract/encodeEventTopics";function Qr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=Wn({abi:t,name:n});if(!l)throw new gu(n,{docsPath:Wu});o=l}if(o.type!=="event")throw new gu(void 0,{docsPath:Wu});const s=Ct(o),i=ps(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)=>Vu({param:f,value:u[p][h]})):typeof u[p]<"u"&&u[p]!==null?Vu({param:f,value:u[p]}):null))??[])}return[i,...c]}function Vu({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Fe(hr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new l1(e.type);return An([e],[t])}function bs(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 Hu(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,l=bs(e,{method:"eth_newFilter"}),u=s?Qr({abi:r,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?ne(i):i,toBlock:typeof a=="bigint"?ne(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:f,request:l(f),strict:!!c,type:"event"}}function it(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Gu="/docs/contract/encodeFunctionData";function ig(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Wn({abi:t,args:n,name:r});if(!s)throw new dr(r,{docsPath:Gu});o=s}if(o.type!=="function")throw new dr(void 0,{docsPath:Gu});return{abi:[o],functionName:Jr(Ct(o))}}function kt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:ig(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?An(o.inputs,t??[]):void 0;return yr([s,i??"0x"])}const ag={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."},qu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},cg={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Ku=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Zu=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},lg=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const ug={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 lg({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Zu({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ku({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 Ku({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 qi(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(ug);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function fg(e,t={}){typeof t.size<"u"&&It(e,{size:t.size});const n=Oe(e,t);return Ut(n,t)}function dg(e,t={}){let n=e;if(typeof t.size<"u"&&(It(n,{size:t.size}),n=zn(n)),n.length>1||n[0]>1)throw new f1(n);return!!n[0]}function sn(e,t={}){typeof t.size<"u"&&It(e,{size:t.size});const n=Oe(e,t);return rn(n,t)}function pg(e,t={}){let n=e;return typeof t.size<"u"&&(It(n,{size:t.size}),n=zn(n,{dir:"right"})),new TextDecoder().decode(n)}function eo(e,t){const n=typeof t=="string"?_t(t):t,r=qi(n);if(Ee(n)===0&&e.length>0)throw new Kr;if(Ee(t)&&Ee(t)<32)throw new hu({data:typeof t=="string"?t:Oe(t),params:e,size:Ee(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const c=e[i];r.setPosition(o);const[a,l]=wr(r,c,{staticPosition:0});o+=l,s.push(a)}return s}function wr(e,t,{staticPosition:n}){const r=Hi(t.type);if(r){const[o,s]=r;return mg(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return vg(e,t,{staticPosition:n});if(t.type==="address")return hg(e);if(t.type==="bool")return bg(e);if(t.type.startsWith("bytes"))return gg(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return yg(e,t);if(t.type==="string")return wg(e,{staticPosition:n});throw new a1(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Yu=32,Ki=32;function hg(e){const t=e.readBytes(32);return[ms(Oe(zu(t,-20))),32]}function mg(e,t,{length:n,staticPosition:r}){if(!n){const i=sn(e.readBytes(Ki)),c=r+i,a=c+Yu;e.setPosition(c);const l=sn(e.readBytes(Yu)),u=to(t);let f=0;const p=[];for(let d=0;d<l;++d){e.setPosition(a+(u?d*32:f));const[h,m]=wr(e,t,{staticPosition:a});f+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(to(t)){const i=sn(e.readBytes(Ki)),c=r+i,a=[];for(let l=0;l<n;++l){e.setPosition(c+l*32);const[u]=wr(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]=wr(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function bg(e){return[dg(e.readBytes(32),{size:32}),32]}function gg(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=sn(e.readBytes(32));e.setPosition(n+i);const c=sn(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Oe(a),32]}return[Oe(e.readBytes(Number.parseInt(o,10),32)),32]}function yg(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?fg(o,{signed:n}):sn(o,{signed:n}),32]}function vg(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(to(t)){const i=sn(e.readBytes(Ki)),c=n+i;for(let a=0;a<t.components.length;++a){const l=t.components[a];e.setPosition(c+s);const[u,f]=wr(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]=wr(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=l}return[o,s]}function wg(e,{staticPosition:t}){const n=sn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=sn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=pg(zn(s));return e.setPosition(t+32),[i,32]}function to(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(to);const n=Hi(e.type);return!!(n&&to({...e,type:n[1]}))}function Xu(e){const{abi:t,data:n}=e,r=vr(n,0,4);if(r==="0x")throw new Kr;const s=[...t||[],qu,cg].find(i=>i.type==="error"&&r===Jr(Ct(i)));if(!s)throw new bu(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?eo(s.inputs,vr(n,4)):void 0,errorName:s.name}}const Ie=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function Ju({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"?Ie(t[s]):t[s]}`).join(", ")})`}const xg={gwei:9,wei:18},Eg={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 Yi(e,t="wei"){return Zi(e,xg[t])}function Ke(e,t="wei"){return Zi(e,Eg[t])}class Sg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Pg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Qu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
71
+ `),{name:"InvalidDefinitionTypeError"})}}class l1 extends V{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let wu=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"})}},xu=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 Eu 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 pr(e,{dir:t,size:n=32}={}){return typeof e=="string"?En(e,{dir:t,size:n}):u1(e,{dir:t,size:n})}function En(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new xu({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function u1(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new xu({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 Su=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"})}},f1=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 d1 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 p1=class extends V{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function zn(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 It(e,{size:t}){if(Ee(e)>t)throw new p1({givenSize:Ee(e),maxSize:t})}function Ut(e,t={}){const{signed:n}=t;t.size&&It(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 h1(e,t={}){let n=e;if(t.size&&(It(n,{size:t.size}),n=zn(n)),zn(n)==="0x00")return!1;if(zn(n)==="0x01")return!0;throw new d1(n)}function rn(e,t={}){return Number(Ut(e,t))}const m1=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Sn(e,t={}){return typeof e=="number"||typeof e=="bigint"?ne(e,t):typeof e=="string"?Zr(e,t):typeof e=="boolean"?Pu(e,t):Oe(e,t)}function Pu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(It(n,{size:t.size}),pr(n,{size:t.size})):n}function Oe(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=m1[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(It(r,{size:t.size}),pr(r,{dir:"right",size:t.size})):r}function ne(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 Su({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?pr(c,{size:r}):c}const b1=new TextEncoder;function Zr(e,t={}){const n=b1.encode(e);return Oe(n,t)}const g1=new TextEncoder;function hr(e,t={}){return typeof e=="number"||typeof e=="bigint"?v1(e,t):typeof e=="boolean"?y1(e,t):Ot(e)?_t(e,t):Un(e,t)}function y1(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(It(n,{size:t.size}),pr(n,{size:t.size})):n}const on={zero:48,nine:57,A:65,F:70,a:97,f:102};function Tu(e){if(e>=on.zero&&e<=on.nine)return e-on.zero;if(e>=on.A&&e<=on.F)return e-(on.A-10);if(e>=on.a&&e<=on.f)return e-(on.a-10)}function _t(e,t={}){let n=e;t.size&&(It(n,{size:t.size}),n=pr(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=Tu(r.charCodeAt(c++)),l=Tu(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 v1(e,t){const n=ne(e,t);return _t(n)}function Un(e,t={}){const n=g1.encode(e);return typeof t.size=="number"?(It(n,{size:t.size}),pr(n,{dir:"right",size:t.size})):n}const fs=BigInt(2**32-1),Au=BigInt(32);function w1(e,t=!1){return t?{h:Number(e&fs),l:Number(e>>Au&fs)}:{h:Number(e>>Au&fs)|0,l:Number(e&fs)|0}}function x1(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}=w1(e[s],t);[r[s],o[s]]=[i,c]}return[r,o]}const E1=(e,t,n)=>e<<n|t>>>32-n,S1=(e,t,n)=>t<<n|e>>>32-n,P1=(e,t,n)=>t<<n-32|e>>>64-n,T1=(e,t,n)=>e<<n-32|t>>>64-n,mr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Yr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function _n(e,...t){if(!A1(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 N1(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Yr(e.outputLen),Yr(e.blockLen)}function br(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 Nu(e,t){_n(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function C1(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function gr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ri(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Wt(e,t){return e<<32-t|e>>>t}const O1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function I1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function k1(e){for(let t=0;t<e.length;t++)e[t]=I1(e[t]);return e}const Cu=O1?e=>e:k1;function $1(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ds(e){return typeof e=="string"&&(e=$1(e)),_n(e),e}function M1(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];_n(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 ji{}function Ou(e){const t=r=>e().update(ds(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function D1(e=32){if(mr&&typeof mr.getRandomValues=="function")return mr.getRandomValues(new Uint8Array(e));if(mr&&typeof mr.randomBytes=="function")return Uint8Array.from(mr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const B1=BigInt(0),Xr=BigInt(1),L1=BigInt(2),F1=BigInt(7),R1=BigInt(256),j1=BigInt(113),Iu=[],ku=[],$u=[];for(let e=0,t=Xr,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Iu.push(2*(5*r+n)),ku.push((e+1)*(e+2)/2%64);let o=B1;for(let s=0;s<7;s++)t=(t<<Xr^(t>>F1)*j1)%R1,t&L1&&(o^=Xr<<(Xr<<BigInt(s))-Xr);$u.push(o)}const Mu=x1($u,!0),z1=Mu[0],U1=Mu[1],Du=(e,t,n)=>n>32?P1(e,t,n):E1(e,t,n),Bu=(e,t,n)=>n>32?T1(e,t,n):S1(e,t,n);function _1(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=Du(l,u,1)^n[c],p=Bu(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=ku[i],a=Du(o,s,c),l=Bu(o,s,c),u=Iu[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]^=z1[r],e[1]^=U1[r]}gr(n)}class zi extends ji{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,Yr(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=C1(this.state)}clone(){return this._cloneInto()}keccak(){Cu(this.state32),_1(this.state32,this.rounds),Cu(this.state32),this.posOut=0,this.pos=0}update(t){br(this),t=ds(t),_n(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){br(this,!1),_n(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 Yr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Nu(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,gr(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new zi(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 W1=(e,t,n)=>Ou(()=>new zi(t,e,n)),Lu=W1(1,136,256/8);function Fe(e,t){const n=t||"hex",r=Lu(Ot(e,{strict:!1})?hr(e):e);return n==="bytes"?r:Sn(r)}const V1=e=>Fe(hr(e));function H1(e){return V1(e)}function G1(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 q1=e=>{const t=typeof e=="string"?e:as(e);return G1(t)};function Fu(e){return H1(q1(e))}const ps=Fu;let Pn=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"})}},hs=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 Ui=new hs(8192);function ms(e,t){if(Ui.has(`${e}.${t}`))return Ui.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Fe(Un(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 Ui.set(`${e}.${t}`,s),s}function Tn(e,t){if(!ht(e,{strict:!1}))throw new Pn({address:e});return ms(e,t)}const K1=/^0x[a-fA-F0-9]{40}$/,_i=new hs(8192);function ht(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(_i.has(r))return _i.get(r);const o=K1.test(e)?e.toLowerCase()===e?!0:n?ms(e)===e:!0:!1;return _i.set(r,o),o}function kt(e){return typeof e[0]=="string"?yr(e):Z1(e)}function Z1(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 yr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function vr(e,t,n,{strict:r}={}){return Ot(e,{strict:!1})?Y1(e,t,n,{strict:r}):zu(e,t,n,{strict:r})}function Ru(e,t){if(typeof t=="number"&&t>0&&t>Ee(e)-1)throw new wu({offset:t,position:"start",size:Ee(e)})}function ju(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ee(e)!==n-t)throw new wu({offset:n,position:"end",size:Ee(e)})}function zu(e,t,n,{strict:r}={}){Ru(e,t);const o=e.slice(t,n);return r&&ju(o,t,n),o}function Y1(e,t,n,{strict:r}={}){Ru(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&ju(o,t,n),o}const X1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Uu=/^(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 An(e,t){if(e.length!==t.length)throw new Qb({expectedLength:e.length,givenLength:t.length});const n=J1({params:e,values:t}),r=Vi(n);return r.length===0?"0x":r}function J1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Wi({param:e[r],value:t[r]}));return n}function Wi({param:e,value:t}){const n=Hi(e.type);if(n){const[r,o]=n;return eg(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return sg(t,{param:e});if(e.type==="address")return Q1(t);if(e.type==="bool")return ng(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Uu.exec(e.type)??[];return rg(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return tg(t,{param:e});if(e.type==="string")return og(t);throw new i1(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Vi(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=Ee(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(ne(t+o,{size:32})),r.push(c),o+=Ee(c)):n.push(c)}return kt([...n,...r])}function Q1(e){if(!ht(e))throw new Pn({address:e});return{dynamic:!1,encoded:En(e.toLowerCase())}}function eg(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new vu(e);if(!r&&e.length!==t)throw new Xb({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const c=Wi({param:n,value:e[i]});c.dynamic&&(o=!0),s.push(c)}if(r||o){const i=Vi(s);if(r){const c=ne(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?kt([c,i]):c}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:kt(s.map(({encoded:i})=>i))}}function tg(e,{param:t}){const[,n]=t.type.split("bytes"),r=Ee(e);if(!n){let o=e;return r%32!==0&&(o=En(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:kt([En(ne(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new Jb({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:En(e,{dir:"right"})}}function ng(e){if(typeof e!="boolean")throw new V(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:En(Pu(e))}}function rg(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 Su({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ne(e,{size:32,signed:t})}}function og(e){const t=Zr(e),n=Math.ceil(Ee(t)/32),r=[];for(let o=0;o<n;o++)r.push(En(vr(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:kt([En(ne(Ee(t),{size:32})),...r])}}function sg(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=Wi({param:s,value:e[i]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Vi(r):kt(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 Jr=e=>vr(Fu(e),0,4);function Wn(e){const{abi:t,args:n=[],name:r}=e,o=Ot(r,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Jr(c)===r:c.type==="event"?ps(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?Gi(l,f):!1})){if(i&&"inputs"in i&&i.inputs){const l=_u(c.inputs,i.inputs,n);if(l)throw new o1({abiItem:c,type:l[0]},{abiItem:i,type:l[1]})}i=c}}return i||s[0]}function Gi(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ht(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)=>Gi(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=>Gi(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _u(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 _u(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")?ht(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ht(n[r],{strict:!1}):!1)return i}}const Wu="/docs/contract/encodeEventTopics";function Qr(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const l=Wn({abi:t,name:n});if(!l)throw new gu(n,{docsPath:Wu});o=l}if(o.type!=="event")throw new gu(void 0,{docsPath:Wu});const s=Ct(o),i=ps(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)=>Vu({param:f,value:u[p][h]})):typeof u[p]<"u"&&u[p]!==null?Vu({param:f,value:u[p]}):null))??[])}return[i,...c]}function Vu({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Fe(hr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new l1(e.type);return An([e],[t])}function bs(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 Hu(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:c,toBlock:a}=t,l=bs(e,{method:"eth_newFilter"}),u=s?Qr({abi:r,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?ne(i):i,toBlock:typeof a=="bigint"?ne(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:f,request:l(f),strict:!!c,type:"event"}}function it(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Gu="/docs/contract/encodeFunctionData";function ig(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Wn({abi:t,args:n,name:r});if(!s)throw new dr(r,{docsPath:Gu});o=s}if(o.type!=="function")throw new dr(void 0,{docsPath:Gu});return{abi:[o],functionName:Jr(Ct(o))}}function $t(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:ig(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?An(o.inputs,t??[]):void 0;return yr([s,i??"0x"])}const ag={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."},qu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},cg={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let Ku=class extends V{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Zu=class extends V{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},lg=class extends V{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const ug={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 lg({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Zu({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ku({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 Ku({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 qi(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(ug);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function fg(e,t={}){typeof t.size<"u"&&It(e,{size:t.size});const n=Oe(e,t);return Ut(n,t)}function dg(e,t={}){let n=e;if(typeof t.size<"u"&&(It(n,{size:t.size}),n=zn(n)),n.length>1||n[0]>1)throw new f1(n);return!!n[0]}function sn(e,t={}){typeof t.size<"u"&&It(e,{size:t.size});const n=Oe(e,t);return rn(n,t)}function pg(e,t={}){let n=e;return typeof t.size<"u"&&(It(n,{size:t.size}),n=zn(n,{dir:"right"})),new TextDecoder().decode(n)}function eo(e,t){const n=typeof t=="string"?_t(t):t,r=qi(n);if(Ee(n)===0&&e.length>0)throw new Kr;if(Ee(t)&&Ee(t)<32)throw new hu({data:typeof t=="string"?t:Oe(t),params:e,size:Ee(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const c=e[i];r.setPosition(o);const[a,l]=wr(r,c,{staticPosition:0});o+=l,s.push(a)}return s}function wr(e,t,{staticPosition:n}){const r=Hi(t.type);if(r){const[o,s]=r;return mg(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return vg(e,t,{staticPosition:n});if(t.type==="address")return hg(e);if(t.type==="bool")return bg(e);if(t.type.startsWith("bytes"))return gg(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return yg(e,t);if(t.type==="string")return wg(e,{staticPosition:n});throw new a1(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Yu=32,Ki=32;function hg(e){const t=e.readBytes(32);return[ms(Oe(zu(t,-20))),32]}function mg(e,t,{length:n,staticPosition:r}){if(!n){const i=sn(e.readBytes(Ki)),c=r+i,a=c+Yu;e.setPosition(c);const l=sn(e.readBytes(Yu)),u=to(t);let f=0;const p=[];for(let d=0;d<l;++d){e.setPosition(a+(u?d*32:f));const[h,m]=wr(e,t,{staticPosition:a});f+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(to(t)){const i=sn(e.readBytes(Ki)),c=r+i,a=[];for(let l=0;l<n;++l){e.setPosition(c+l*32);const[u]=wr(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]=wr(e,t,{staticPosition:r+o});o+=a,s.push(c)}return[s,o]}function bg(e){return[dg(e.readBytes(32),{size:32}),32]}function gg(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=sn(e.readBytes(32));e.setPosition(n+i);const c=sn(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Oe(a),32]}return[Oe(e.readBytes(Number.parseInt(o,10),32)),32]}function yg(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?fg(o,{signed:n}):sn(o,{signed:n}),32]}function vg(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(to(t)){const i=sn(e.readBytes(Ki)),c=n+i;for(let a=0;a<t.components.length;++a){const l=t.components[a];e.setPosition(c+s);const[u,f]=wr(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]=wr(e,c,{staticPosition:n});o[r?i:c==null?void 0:c.name]=a,s+=l}return[o,s]}function wg(e,{staticPosition:t}){const n=sn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=sn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=pg(zn(s));return e.setPosition(t+32),[i,32]}function to(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(to);const n=Hi(e.type);return!!(n&&to({...e,type:n[1]}))}function Xu(e){const{abi:t,data:n}=e,r=vr(n,0,4);if(r==="0x")throw new Kr;const s=[...t||[],qu,cg].find(i=>i.type==="error"&&r===Jr(Ct(i)));if(!s)throw new bu(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?eo(s.inputs,vr(n,4)):void 0,errorName:s.name}}const Ie=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function Ju({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"?Ie(t[s]):t[s]}`).join(", ")})`}const xg={gwei:9,wei:18},Eg={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 Yi(e,t="wei"){return Zi(e,xg[t])}function Ke(e,t="wei"){return Zi(e,Eg[t])}class Sg extends V{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Pg extends V{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Qu(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
72
72
  `,"")}function Tg(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}
@@ -77,46 +77,46 @@ React keys must be passed directly to JSX without using spread:
77
77
  `,o+=Qu(r.state)),r.stateDiff&&(o+=` stateDiff:
78
78
  `,o+=Qu(r.stateDiff)),o},` State Override:
79
79
  `).slice(0,-1)}function no(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 Ag extends V{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",no(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 Ng 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=no({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Yi(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ke(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ke(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ke(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",d].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class ef 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 tf 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 Cg 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 Og extends V{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Ig=e=>e,ro=e=>e;class nf extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p,stateOverride:d}){var w;const h=n?it(n):void 0;let m=no({from:h==null?void 0:h.address,to:f,value:typeof p<"u"&&`${Yi(p)} ${((w=o==null?void 0:o.nativeCurrency)==null?void 0:w.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ke(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ke(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ke(l)} gwei`,nonce:u});d&&(m+=`
80
+ `)}class Ag extends V{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",no(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 Ng 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=no({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Yi(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ke(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ke(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ke(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",d].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class ef 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 tf 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 Cg 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 Og extends V{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Ig=e=>e,ro=e=>e;class nf extends V{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:c,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:f,value:p,stateOverride:d}){var v;const h=n?it(n):void 0;let m=no({from:h==null?void 0:h.address,to:f,value:typeof p<"u"&&`${Yi(p)} ${((v=o==null?void 0:o.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ke(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ke(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ke(l)} gwei`,nonce:u});d&&(m+=`
81
81
  ${Tg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class rf extends V{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:c}){const a=Wn({abi:n,args:r,name:i}),l=a?Ju({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?Ct(a,{includeName:!0}):void 0,f=no({address:o&&Ig(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 Xi extends V{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,c,a;if(n&&n!=="0x")try{i=Xu({abi:t,data:n});const{abiItem:u,errorName:f,args:p}=i;if(f==="Error")a=p[0];else if(f==="Panic"){const[d]=p;a=ag[d]}else{const d=u?Ct(u,{includeName:!0}):void 0,h=u&&p?Ju({abiItem:u,args:p,includeFunctionName:!1,includeName:!1}):void 0;c=[d?`Error: ${d}`:"",h&&h!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(u){s=u}else o&&(a=o);let l;s instanceof bu&&(l=s.signature,c=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(a&&a!=="execution reverted"||l?[`The contract function "${r}" reverted with the following ${l?"signature":"reason"}:`,a||l].join(`
82
- `):`The contract function "${r}" reverted.`,{cause:s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=n,this.reason=a,this.signature=l}}class $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 kg 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 gs 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 Vn 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: ${ro(i)}`,t&&`Request body: ${Ie(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 Ji extends V{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${ro(r)}`,`Request body: ${Ie(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 of extends V{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ro(n)}`,`Request body: ${Ie(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Mg=-1;class Ze 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 Ji?t.code:n??Mg}}class at extends Ze{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class oo extends Ze{constructor(t){super(t,{code:oo.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class so extends Ze{constructor(t){super(t,{code:so.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class io extends Ze{constructor(t,{method:n}={}){super(t,{code:io.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class ao extends Ze{constructor(t){super(t,{code:ao.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].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 kg 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 $g 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 gs 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 Vn 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: ${ro(i)}`,t&&`Request body: ${Ie(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 Ji extends V{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${ro(r)}`,`Request body: ${Ie(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 of extends V{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ro(n)}`,`Request body: ${Ie(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Mg=-1;class Ze 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 Ji?t.code:n??Mg}}class at extends Ze{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class oo extends Ze{constructor(t){super(t,{code:oo.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class so extends Ze{constructor(t){super(t,{code:so.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(so,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class io extends Ze{constructor(t,{method:n}={}){super(t,{code:io.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(io,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class ao extends Ze{constructor(t){super(t,{code:ao.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
83
83
  `)})}}Object.defineProperty(ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Hn extends Ze{constructor(t){super(t,{code:Hn.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Hn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Nn extends Ze{constructor(t){super(t,{code:Nn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
84
- `)})}}Object.defineProperty(Nn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class co extends Ze{constructor(t){super(t,{code:co.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class lo extends Ze{constructor(t){super(t,{code:lo.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class uo extends Ze{constructor(t){super(t,{code:uo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Gn extends Ze{constructor(t,{method:n}={}){super(t,{code:Gn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class xr extends Ze{constructor(t){super(t,{code:xr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class fo extends Ze{constructor(t){super(t,{code:fo.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Er extends at{constructor(t){super(t,{code:Er.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Er,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class po extends at{constructor(t){super(t,{code:po.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ho extends at{constructor(t,{method:n}={}){super(t,{code:ho.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class mo extends at{constructor(t){super(t,{code:mo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class bo extends at{constructor(t){super(t,{code:bo.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class go extends at{constructor(t){super(t,{code:go.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(go,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class yo extends at{constructor(t){super(t,{code:yo.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class vo extends at{constructor(t){super(t,{code:vo.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class wo extends at{constructor(t){super(t,{code:wo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class xo extends at{constructor(t){super(t,{code:xo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Eo extends at{constructor(t){super(t,{code:Eo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class So extends at{constructor(t){super(t,{code:So.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(So,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Po extends at{constructor(t){super(t,{code:Po.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Po,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Dg extends Ze{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Bg=3;function Sr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof gs?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 Kr?new $g({functionName:s}):[Bg,Hn.code].includes(a)&&(l||u||f||p)||a===Nn.code&&u==="execution reverted"&&l?new Xi({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c instanceof Ji?u:p??f}):e;return new rf(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function Lg(e){const t=Fe(`0x${e.substring(4)}`).substring(26);return ms(`0x${t}`)}async function Fg({hash:e,signature:t}){const n=Ot(e)?e:Sn(e),{secp256k1:r}=await Promise.resolve().then(()=>b6);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=sf(d);return new r.Signature(Ut(l),Ut(u)).addRecoveryBit(h)}const i=Ot(t)?t:Sn(t);if(Ee(i)!==65)throw new Error("invalid signature length");const c=rn(`0x${i.slice(130)}`),a=sf(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function sf(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 af({hash:e,signature:t}){return Lg(await Fg({hash:e,signature:t}))}function Rg(e,t="hex"){const n=cf(e),r=qi(new Uint8Array(n.length));return n.encode(r),t==="hex"?Oe(r.bytes):r.bytes}function cf(e){return Array.isArray(e)?jg(e.map(t=>cf(t))):zg(e)}function jg(e){const t=e.reduce((o,s)=>o+s.length,0),n=lf(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 zg(e){const t=typeof e=="string"?_t(e):e,n=lf(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 lf(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 Ug(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=Fe(yr(["0x05",Rg([t?ne(t):"0x",o,n?ne(n):"0x"])]));return r==="bytes"?_t(s):s}async function uf(e){const{authorization:t,signature:n}=e;return af({hash:Ug(t),signature:n??t})}class _g 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=no({from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Yi(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ke(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ke(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ke(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 Pr 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(Pr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Pr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class ys extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ke(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(ys,"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?` = ${Ke(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 ea 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(ea,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ta 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(`
84
+ `)})}}Object.defineProperty(Nn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class co extends Ze{constructor(t){super(t,{code:co.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(co,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class lo extends Ze{constructor(t){super(t,{code:lo.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(lo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class uo extends Ze{constructor(t){super(t,{code:uo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(uo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Gn extends Ze{constructor(t,{method:n}={}){super(t,{code:Gn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Gn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class xr extends Ze{constructor(t){super(t,{code:xr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(xr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class fo extends Ze{constructor(t){super(t,{code:fo.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Er extends at{constructor(t){super(t,{code:Er.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Er,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class po extends at{constructor(t){super(t,{code:po.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(po,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ho extends at{constructor(t,{method:n}={}){super(t,{code:ho.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class mo extends at{constructor(t){super(t,{code:mo.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class bo extends at{constructor(t){super(t,{code:bo.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class go extends at{constructor(t){super(t,{code:go.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(go,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class yo extends at{constructor(t){super(t,{code:yo.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class vo extends at{constructor(t){super(t,{code:vo.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class wo extends at{constructor(t){super(t,{code:wo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class xo extends at{constructor(t){super(t,{code:xo.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Eo extends at{constructor(t){super(t,{code:Eo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class So extends at{constructor(t){super(t,{code:So.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(So,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Po extends at{constructor(t){super(t,{code:Po.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Po,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Dg extends Ze{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Bg=3;function Sr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const c=e instanceof gs?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 Kr?new kg({functionName:s}):[Bg,Hn.code].includes(a)&&(l||u||f||p)||a===Nn.code&&u==="execution reverted"&&l?new Xi({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:c instanceof Ji?u:p??f}):e;return new rf(d,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function Lg(e){const t=Fe(`0x${e.substring(4)}`).substring(26);return ms(`0x${t}`)}async function Fg({hash:e,signature:t}){const n=Ot(e)?e:Sn(e),{secp256k1:r}=await Promise.resolve().then(()=>b6);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=sf(d);return new r.Signature(Ut(l),Ut(u)).addRecoveryBit(h)}const i=Ot(t)?t:Sn(t);if(Ee(i)!==65)throw new Error("invalid signature length");const c=rn(`0x${i.slice(130)}`),a=sf(c);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function sf(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 af({hash:e,signature:t}){return Lg(await Fg({hash:e,signature:t}))}function Rg(e,t="hex"){const n=cf(e),r=qi(new Uint8Array(n.length));return n.encode(r),t==="hex"?Oe(r.bytes):r.bytes}function cf(e){return Array.isArray(e)?jg(e.map(t=>cf(t))):zg(e)}function jg(e){const t=e.reduce((o,s)=>o+s.length,0),n=lf(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 zg(e){const t=typeof e=="string"?_t(e):e,n=lf(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 lf(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 Ug(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=Fe(yr(["0x05",Rg([t?ne(t):"0x",o,n?ne(n):"0x"])]));return r==="bytes"?_t(s):s}async function uf(e){const{authorization:t,signature:n}=e;return af({hash:Ug(t),signature:n??t})}class _g 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=no({from:n==null?void 0:n.address,to:f,value:typeof p<"u"&&`${Yi(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof c<"u"&&`${Ke(c)} gwei`,maxFeePerGas:typeof a<"u"&&`${Ke(a)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Ke(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 Pr 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(Pr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Pr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class ys extends V{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Ke(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(ys,"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?` = ${Ke(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 ea 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(ea,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ta 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
85
  `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(ta,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class na 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(na,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class ra 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
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(ra,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class oa 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(oa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class sa 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(sa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ia extends V{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ia,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class vs extends V{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Ke(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Ke(r)} gwei`:""}).`].join(`
87
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(vs,"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 To extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ws(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===Pr.code):e;return r instanceof V?new Pr({cause:e,message:r.details}):Pr.nodeMessage.test(n)?new Pr({cause:e,message:e.details}):ys.nodeMessage.test(n)?new ys({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Qi.nodeMessage.test(n)?new Qi({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):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,nonce:t==null?void 0:t.nonce}):ra.nodeMessage.test(n)?new ra({cause:e}):oa.nodeMessage.test(n)?new oa({cause:e,gas:t==null?void 0:t.gas}):sa.nodeMessage.test(n)?new sa({cause:e,gas:t==null?void 0:t.gas}):ia.nodeMessage.test(n)?new ia({cause:e}):vs.nodeMessage.test(n)?new vs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new To({cause:e})}function Wg(e,{docsPath:t,...n}){const r=(()=>{const o=ws(e,n);return o instanceof To?e:o})();return new _g(r,{docsPath:t,...n})}function xs(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 Vg={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Ao(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Hg(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=>Oe(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=ne(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=ne(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=ne(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=ne(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=ne(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=ne(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Vg[e.type]),typeof e.value<"u"&&(n.value=ne(e.value)),n}function Hg(e){return e.map(t=>({address:t.address,r:t.r?ne(BigInt(t.r)):t.r,s:t.s?ne(BigInt(t.s)):t.s,chainId:ne(t.chainId),nonce:ne(t.nonce),...typeof t.yParity<"u"?{yParity:ne(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:ne(t.v)}:{}}))}function ff(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Eu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Eu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Gg(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=ne(t)),n!==void 0&&(i.nonce=ne(n)),r!==void 0&&(i.state=ff(r)),o!==void 0){if(i.state)throw new Pg;i.stateDiff=ff(o)}return i}function aa(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ht(n,{strict:!1}))throw new Pn({address:n});if(t[n])throw new Sg({address:n});t[n]=Gg(r)}return t}const df=2n**256n-1n;function Tr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?it(t):void 0;if(s&&!ht(s.address))throw new Pn({address:s.address});if(o&&!ht(o))throw new Pn({address:o});if(n&&n>df)throw new ys({maxFeePerGas:n});if(r&&n&&r>n)throw new vs({maxFeePerGas:n,maxPriorityFeePerGas:r})}class pf extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class ca extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class qg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ke(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class hf 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 mf={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function la(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?rn(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?rn(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?mf[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=Kg(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 Kg(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 bf(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:la(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 Mt(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?ne(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 hf({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)||bf)(c,"getBlock")}async function ua(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Zg(e,t){return gf(e,t)}async function gf(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 te(e,Mt,"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 Ut(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):te(e,Mt,"getBlock")({}),te(e,ua,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new ca;const l=a-c.baseFeePerGas;return l<0n?0n:l}}async function Yg(e,t){return fa(e,t)}async function fa(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 pf;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 te(e,Mt,"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 ca;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await gf(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 te(e,ua,"getGasPrice")({}))}}async function yf(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?ne(r):n]},{dedupe:!!r});return rn(o)}function vf(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=>_t(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Oe(s))}function wf(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=>_t(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>_t(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=>Oe(i))}function Xg(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 Jg(e,t,n){return e&t^~e&n}function Qg(e,t,n){return e&t^e&n^t&n}class ey extends ji{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=Ri(this.buffer)}update(t){br(this),t=ds(t),_n(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=Ri(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){br(this),Nu(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,gr(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;Xg(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Ri(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 Cn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ty=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]),On=new Uint32Array(64);class ny extends ey{constructor(t=32){super(64,t,8,!1),this.A=Cn[0]|0,this.B=Cn[1]|0,this.C=Cn[2]|0,this.D=Cn[3]|0,this.E=Cn[4]|0,this.F=Cn[5]|0,this.G=Cn[6]|0,this.H=Cn[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)On[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=On[f-15],d=On[f-2],h=Wt(p,7)^Wt(p,18)^p>>>3,m=Wt(d,17)^Wt(d,19)^d>>>10;On[f]=m+On[f-7]+h+On[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=Wt(c,6)^Wt(c,11)^Wt(c,25),d=u+p+Jg(c,a,l)+ty[f]+On[f]|0,m=(Wt(r,2)^Wt(r,13)^Wt(r,22))+Qg(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(){gr(On)}destroy(){this.set(0,0,0,0,0,0,0,0),gr(this.buffer)}}const xf=Ou(()=>new ny),ry=xf;function oy(e,t){return ry(Ot(e,{strict:!1})?hr(e):e)}function sy(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=oy(t);return o.set([n],0),r==="bytes"?o:Oe(o)}function iy(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(sy({commitment:s,to:r,version:n}));return o}const Ef=6,Sf=32,da=4096,Pf=Sf*da,Tf=Pf*Ef-1-1*da*Ef;class ay extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class cy extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function ly(e){const t=typeof e.data=="string"?_t(e.data):e.data,n=Ee(t);if(!n)throw new cy;if(n>Tf)throw new ay({maxSize:Tf,size:n});const r=[];let o=!0,s=0;for(;o;){const i=qi(new Uint8Array(Pf));let c=0;for(;c<da;){const a=t.slice(s,s+(Sf-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=>Oe(i.bytes))}function uy(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??ly({data:t}),s=e.commitments??vf({blobs:o,kzg:n,to:r}),i=e.proofs??wf({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 fy(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 Ag({transaction:e})}function dy(e,{docsPath:t,...n}){const r=(()=>{const o=ws(e,n);return o instanceof To?e:o})();return new Ng(r,{docsPath:t,...n})}async function pa(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return rn(t)}async function Af(e,t){var b,g,x,I,O;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:w,type:P,value:E,...T}=t,A=await(async()=>{if(!n||!m||typeof h<"u")return h;const $=it(n),M=s?s.id:await te(e,pa,"getChainId")({});return await m.consume({address:$.address,chainId:M,client:e})})();Tr(t);const D=(g=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:g.format,L=(D||Ao)({...xs(T,{format:D}),account:n?it(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:A,to:w,type:P,value:E},"fillTransaction");try{const $=await e.request({method:"eth_fillTransaction",params:[L]}),v=(((I=(x=s==null?void 0:s.formatters)==null?void 0:x.transaction)==null?void 0:I.format)||la)($.tx);delete v.blockHash,delete v.blockNumber,delete v.r,delete v.s,delete v.transactionIndex,delete v.v,delete v.yParity,v.data=v.input,v.gas&&(v.gas=t.gas??v.gas),v.gasPrice&&(v.gasPrice=t.gasPrice??v.gasPrice),v.maxFeePerBlobGas&&(v.maxFeePerBlobGas=t.maxFeePerBlobGas??v.maxFeePerBlobGas),v.maxFeePerGas&&(v.maxFeePerGas=t.maxFeePerGas??v.maxFeePerGas),v.maxPriorityFeePerGas&&(v.maxPriorityFeePerGas=t.maxPriorityFeePerGas??v.maxPriorityFeePerGas),v.nonce&&(v.nonce=t.nonce??v.nonce);const N=await(async()=>{var j,U;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await te(e,Mt,"getBlock")({});return s.fees.baseFeeMultiplier({block:_,client:e,request:t})}return((U=s==null?void 0:s.fees)==null?void 0:U.baseFeeMultiplier)??1.2})();if(N<1)throw new pf;const S=10**(((O=N.toString().split(".")[1])==null?void 0:O.length)??0),B=j=>j*BigInt(Math.ceil(N*S))/BigInt(S);return v.maxFeePerGas&&!t.maxFeePerGas&&(v.maxFeePerGas=B(v.maxFeePerGas)),v.gasPrice&&!t.gasPrice&&(v.gasPrice=B(v.gasPrice)),{raw:$.raw,transaction:{from:L.from,...v}}}catch($){throw dy($,{...t,chain:e.chain})}}const py=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Nf=new Map,ha=new hs(128);async function Cf(e,t){var A,D,F;let n=t;const{account:r=e.account,chain:o=e.chain,nonceManager:s,parameters:i=py}=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 te(e,pa,"getChainId")({}),a))}const u=r&&it(r);let f=n.nonce;if(i.includes("nonce")&&typeof f>"u"&&u&&s){const L=await l();f=await s.consume({address:u.address,chainId:L,client:e})}c!=null&&c.fn&&((A=c.runAt)!=null&&A.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||ha.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 te(e,Af,"fillTransaction")({...n,nonce:f}).then(L=>{const{chainId:b,from:g,gas:x,gasPrice:I,nonce:O,maxFeePerBlobGas:$,maxFeePerGas:M,maxPriorityFeePerGas:v,type:N,...k}=L.transaction;return ha.set(e.uid,!0),{...n,...g?{from:g}:{},...N?{type:N}:{},...typeof b<"u"?{chainId:b}:{},...typeof x<"u"?{gas:x}:{},...typeof I<"u"?{gasPrice:I}:{},...typeof O<"u"?{nonce:O}:{},...typeof $<"u"?{maxFeePerBlobGas:$}:{},...typeof M<"u"?{maxFeePerGas:M}:{},...typeof v<"u"?{maxPriorityFeePerGas:v}:{},..."nonceKey"in k&&typeof k.nonceKey<"u"?{nonceKey:k.nonceKey}:{}}}).catch(L=>{var x;const b=L;return((x=b.walk)==null?void 0:x.call(b,I=>{const O=I;return O.name==="MethodNotFoundRpcError"||O.name==="MethodNotSupportedRpcError"}))&&ha.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:w,type:P}=n;c!=null&&c.fn&&((D=c.runAt)!=null&&D.includes("beforeFillParameters"))&&(n=await c.fn(n,{phase:"beforeFillParameters"}));let E;async function T(){return E||(E=await te(e,Mt,"getBlock")({blockTag:"latest"}),E)}if(i.includes("nonce")&&typeof f>"u"&&u&&!s&&(n.nonce=await te(e,yf,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&w){const L=vf({blobs:h,kzg:w});if(i.includes("blobVersionedHashes")){const b=iy({commitments:L,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=wf({blobs:h,commitments:L,kzg:w}),g=uy({blobs:h,commitments:L,proofs:b,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=fy(n)}catch{let L=Nf.get(e.uid);if(typeof L>"u"){const b=await T();L=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",Nf.set(e.uid,L)}n.type=L?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const L=await T(),{maxFeePerGas:b,maxPriorityFeePerGas:g}=await fa(e,{block:L,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new qg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new ca;if(typeof n.gasPrice>"u"){const L=await T(),{gasPrice:b}=await fa(e,{block:L,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await te(e,ma,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((F=c.runAt)!=null&&F.includes("afterFillParameters"))&&(n=await c.fn(n,{phase:"afterFillParameters"})),Tr(n),delete n.parameters,n}async function ma(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?it(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 uf({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:w,gas:P,gasPrice:E,maxFeePerBlobGas:T,maxFeePerGas:A,maxPriorityFeePerGas:D,nonce:F,value:L,stateOverride:b,...g}=r?await Cf(e,{...t,parameters:s,to:l}):t;if(P&&t.gas!==P)return P;const I=(typeof h=="bigint"?ne(h):void 0)||m,O=aa(b);Tr(t);const $=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,v=($||Ao)({...xs(g,{format:$}),account:o,accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,data:w,gasPrice:E,maxFeePerBlobGas:T,maxFeePerGas:A,maxPriorityFeePerGas:D,nonce:F,to:l,value:L},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:O?[v,I??e.experimental_blockTag??"latest",O]:I?[v,I]:[v]}))}catch(l){throw Wg(l,{...t,account:o,chain:e.chain})}}async function hy(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:i,...c}=t,a=kt({abi:n,args:o,functionName:s});try{return await te(e,ma,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(l){const u=c.account?it(c.account):void 0;throw Sr(l,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}function No(e,t){if(!ht(e,{strict:!1}))throw new Pn({address:e});if(!ht(t,{strict:!1}))throw new Pn({address:t});return e.toLowerCase()===t.toLowerCase()}const Of="/docs/contract/decodeEventLog";function Es(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new t1({docsPath:Of});const a=t.find(m=>m.type==="event"&&i===ps(Ct(m)));if(!(a&&"name"in a)||a.type!=="event")throw new n1(i,{docsPath:Of});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,w)=>[m,w]).filter(([m])=>"indexed"in m&&m.indexed);for(let m=0;m<d.length;m++){const[w,P]=d[m],E=c[m];if(!E)throw new Fi({abiItem:a,param:w});p[f?P:w.name||P]=my({param:w,value:E})}const h=u.filter(m=>!("indexed"in m&&m.indexed));if(h.length>0){if(n&&n!=="0x")try{const m=eo(h,n);if(m)if(f)for(let w=0;w<u.length;w++)p[w]=p[w]??m.shift();else for(let w=0;w<h.length;w++)p[h[w].name]=m[w]}catch(m){if(s)throw m instanceof hu||m instanceof Zu?new us({abiItem:a,data:n,params:h,size:Ee(n)}):m}else if(s)throw new us({abiItem:a,data:"0x",params:h,size:0})}return{eventName:l,args:Object.values(p).length>0?p:void 0}}function my({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(eo([e],t)||[])[0]}function ba(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]===ps(f));if(c.length===0)return null;let a,l;for(const f of c)try{a=Es({...i,abi:[f],strict:!0}),l=f;break}catch{}if(!a&&!o){l=c[0];try{a=Es({...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)||!by({args:a.args,inputs:l.inputs,matchArgs:n})?null:{...a,...i}}).filter(Boolean)}function by(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"?No(i,c):s.type==="string"||s.type==="bytes"?Fe(hr(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 an(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 ga(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=>Qr({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"?ne(r):r,toBlock:typeof o=="bigint"?ne(o):o}]});const d=p.map(h=>an(h));return u?ba({abi:u,args:c,logs:d,strict:l}):d}async function If(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:l}=t,u=i?Wn({abi:n,name:i}):void 0,f=u?void 0:n.filter(p=>p.type==="event");return te(e,ga,"getLogs")({address:r,args:o,blockHash:s,event:u,events:f,fromBlock:c,toBlock:a,strict:l})}const ya="/docs/contract/decodeFunctionResult";function qn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Wn({abi:t,args:n,name:r});if(!c)throw new dr(r,{docsPath:ya});s=c}if(s.type!=="function")throw new dr(void 0,{docsPath:ya});if(!s.outputs)throw new yu(s.name,{docsPath:ya});const i=eo(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 va=BigInt(0),wa=BigInt(1);function Co(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function xa(e){if(!Co(e))throw new Error("Uint8Array expected")}function Oo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Ss(e){const t=e.toString(16);return t.length&1?"0"+t:t}function $f(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?va:BigInt("0x"+e)}const kf=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",gy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Io(e){if(xa(e),kf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=gy[e[n]];return t}const cn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Mf(e){if(e>=cn._0&&e<=cn._9)return e-cn._0;if(e>=cn.A&&e<=cn.F)return e-(cn.A-10);if(e>=cn.a&&e<=cn.f)return e-(cn.a-10)}function Ps(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(kf)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=Mf(e.charCodeAt(s)),c=Mf(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 Kn(e){return $f(Io(e))}function Df(e){return xa(e),$f(Io(Uint8Array.from(e).reverse()))}function $o(e,t){return Ps(e.toString(16).padStart(t*2,"0"))}function Bf(e,t){return $o(e,t).reverse()}function mt(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(Co(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 Ts(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];xa(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 Ea=e=>typeof e=="bigint"&&va<=e;function Sa(e,t,n){return Ea(e)&&Ea(t)&&Ea(n)&&t<=e&&e<n}function Ar(e,t,n,r){if(!Sa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function yy(e){let t;for(t=0;e>va;e>>=wa,t+=1);return t}const As=e=>(wa<<BigInt(e))-wa,Pa=e=>new Uint8Array(e),Lf=e=>Uint8Array.from(e);function vy(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=Pa(e),o=Pa(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=Pa(0))=>{o=c(Lf([0]),f),r=c(),f.length!==0&&(o=c(Lf([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 Ts(...p)};return(f,p)=>{i(),a(f);let d;for(;!(d=p(l()));)a();return i(),d}}const wy={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"||Co(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 Ns(e,t,n={}){const r=(o,s,i)=>{const c=wy[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 Ff(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 xy="0.1.1";function Ey(){return xy}class le extends Error{constructor(t,n={}){const r=(()=>{var a;if(n.cause instanceof le){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 le&&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@${Ey()}`}),this.cause=n.cause,this.details=r,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return Rf(this,t)}}function Rf(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Rf(e.cause,t):t?null:e}function ko(e,t){if(Nr(e)>t)throw new jy({givenSize:Nr(e),maxSize:t})}const ln={zero:48,nine:57,A:65,F:70,a:97,f:102};function jf(e){if(e>=ln.zero&&e<=ln.nine)return e-ln.zero;if(e>=ln.A&&e<=ln.F)return e-(ln.A-10);if(e>=ln.a&&e<=ln.f)return e-(ln.a-10)}function Sy(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new zy({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 zf(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 Cs(e,t){if(ct(e)>t)throw new Gy({givenSize:ct(e),maxSize:t})}function Py(e,t){if(typeof t=="number"&&t>0&&t>ct(e)-1)throw new Xf({offset:t,position:"start",size:ct(e)})}function Ty(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ct(e)!==n-t)throw new Xf({offset:n,position:"end",size:ct(e)})}function Uf(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 qy({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const Ay="#__bigint";function _f(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+Ay:o,n)}const Ny=new TextDecoder,Cy=new TextEncoder;function Oy(e){return e instanceof Uint8Array?e:typeof e=="string"?Wf(e):Iy(e)}function Iy(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Wf(e,t={}){const{size:n}=t;let r=e;n&&(Cs(e,n),r=Yn(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=jf(o.charCodeAt(a++)),u=jf(o.charCodeAt(a++));if(l===void 0||u===void 0)throw new le(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=l*16+u}return i}function $y(e,t={}){const{size:n}=t,r=Cy.encode(e);return typeof n=="number"?(ko(r,n),ky(r,n)):r}function ky(e,t){return Sy(e,{dir:"right",size:t})}function Nr(e){return e.length}function My(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Dy(e,t={}){const{size:n}=t;typeof n<"u"&&ko(e,n);const r=Bt(e,t);return Gf(r,t)}function By(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(ko(r,n),r=Vf(r)),r.length>1||r[0]>1)throw new Ry(r);return!!r[0]}function un(e,t={}){const{size:n}=t;typeof n<"u"&&ko(e,n);const r=Bt(e,t);return qf(r,t)}function Ly(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(ko(r,n),r=Fy(r)),Ny.decode(r)}function Vf(e){return zf(e,{dir:"left"})}function Fy(e){return zf(e,{dir:"right"})}class Ry extends le{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 jy=class extends le{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"})}},zy=class extends le{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 Uy=new TextEncoder,_y=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Wy(e,t={}){const{strict:n=!1}=t;if(!e)throw new Zf(e);if(typeof e!="string")throw new Zf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Yf(e);if(!e.startsWith("0x"))throw new Yf(e)}function Dt(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Vy(e){return e instanceof Uint8Array?Bt(e):Array.isArray(e)?Bt(new Uint8Array(e)):e}function Hf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Cs(n,t.size),Zn(n,t.size)):n}function Bt(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=_y[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(Cs(r,t.size),Yn(r,t.size)):r}function ze(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 Kf({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?Zn(a,r):a}function Ta(e,t={}){return Bt(Uy.encode(e),t)}function Zn(e,t){return Uf(e,{dir:"left",size:t})}function Yn(e,t){return Uf(e,{dir:"right",size:t})}function Vt(e,t,n,r={}){const{strict:o}=r;Py(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&Ty(s,t,n),s}function ct(e){return Math.ceil((e.length-2)/2)}function Gf(e,t={}){const{signed:n}=t;t.size&&Cs(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 qf(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Gf(e,t))}function Hy(e,t={}){const{strict:n=!1}=t;try{return Wy(e,{strict:n}),!0}catch{return!1}}class Kf extends le{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 Zf extends le{constructor(t){super(`Value \`${typeof t=="object"?_f(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 Yf extends le{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 Gy extends le{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 Xf extends le{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 qy extends le{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 Ky(e){return{address:e.address,amount:ze(e.amount),index:ze(e.index),validatorIndex:ze(e.validatorIndex)}}function Jf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:ze(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:ze(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:ze(e.gasLimit)},...typeof e.number=="bigint"&&{number:ze(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:ze(e.prevRandao)},...typeof e.time=="bigint"&&{time:ze(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Ky)}}}const Os=[{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"}],Aa=[{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"}]}],Qf=[{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"}],ed=[...Qf,{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"}]}],Zy=[...Qf,{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"}]}],td=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],nd=[{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"}]}],rd=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],od=[{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"}],Cr=[{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"}]}],Yy="0x82ad56cb",sd="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Xy="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Jy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Na="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Ca 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 id extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Oa="/docs/contract/encodeDeployData";function Ia(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 Yb({docsPath:Oa});if(!("inputs"in o))throw new pu({docsPath:Oa});if(!o.inputs||o.inputs.length===0)throw new pu({docsPath:Oa});const s=An(o.inputs,n);return yr([r,s])}function Or({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 Ca({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Ca({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function ad(e,{docsPath:t,...n}){const r=(()=>{const o=ws(e,n);return o instanceof To?e:o})();return new nf(r,{docsPath:t,...n})}function cd(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const $a=new Map;function ld({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=()=>$a.delete(t),c=()=>a().map(({args:u})=>u),a=()=>$a.get(t)||[],l=u=>$a.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:f,resolve:p,reject:d}=cd();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 Mo(e,t){var $,M,v,N;const{account:n=e.account,authorizationList:r,batch:o=!!(($=e.batch)!=null&&$.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:w,maxFeePerGas:P,maxPriorityFeePerGas:E,nonce:T,to:A,value:D,stateOverride:F,...L}=t,b=n?it(n):void 0;if(u&&(p||d))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,x=p&&d&&A&&f,I=g||x,O=g?ud({code:u,data:f}):x?tv({data:f,factory:p,factoryData:d,to:A}):f;try{Tr(t);const S=(typeof s=="bigint"?ne(s):void 0)||i,B=l?Jf(l):void 0,j=aa(F),U=(N=(v=(M=e.chain)==null?void 0:M.formatters)==null?void 0:v.transactionRequest)==null?void 0:N.format,q=(U||Ao)({...xs(L,{format:U}),accessList:c,account:b,authorizationList:r,blobs:a,data:O,gas:h,gasPrice:m,maxFeePerBlobGas:w,maxFeePerGas:P,maxPriorityFeePerGas:E,nonce:T,to:I?void 0:A,value:D},"call");if(o&&Qy({request:q})&&!j&&!B)try{return await ev(e,{...q,blockNumber:s,blockTag:i})}catch(W){if(!(W instanceof id)&&!(W instanceof Ca))throw W}const Z=(()=>{const W=[q,S];return j&&B?[...W,j,B]:j?[...W,j]:B?[...W,{},B]:W})(),H=await e.request({method:"eth_call",params:Z});return H==="0x"?{data:void 0}:{data:H}}catch(k){const S=nv(k),{offchainLookup:B,offchainLookupSignature:j}=await Promise.resolve().then(()=>ew);if(e.ccipRead!==!1&&(S==null?void 0:S.slice(0,10))===j&&A)return{data:await B(e,{data:S,to:A})};throw I&&(S==null?void 0:S.slice(0,10))==="0x101bb98d"?new kg({factory:p}):ad(k,{...t,account:b,chain:e.chain})}}function Qy({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Yy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function ev(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 Or({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new id})(),f=(typeof s=="bigint"?ne(s):void 0)||i,{schedule:p}=ld({id:`${e.uid}.${f}`,wait:o,shouldSplitBatch(w){return w.reduce((E,{data:T})=>E+(T.length-2),0)>n*2},fn:async w=>{const P=w.map(A=>({allowFailure:!0,callData:A.data,target:A.to})),E=kt({abi:Os,args:[P],functionName:"aggregate3"}),T=await e.request({method:"eth_call",params:[{...l===null?{data:ud({code:Na,data:E})}:{to:l,data:E}},f]});return qn({abi:Os,args:[P],functionName:"aggregate3",data:T||"0x"})}}),[{returnData:d,success:h}]=await p({data:c,to:a});if(!h)throw new gs({data:d});return d==="0x"?{data:void 0}:{data:d}}function ud(e){const{code:t,data:n}=e;return Ia({abi:cu(["constructor(bytes, bytes)"]),bytecode:sd,args:[t,n]})}function tv(e){const{data:t,factory:n,factoryData:r,to:o}=e;return Ia({abi:cu(["constructor(address, bytes, address, bytes)"]),bytecode:Xy,args:[o,t,n,r]})}function nv(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 Lt(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=kt({abi:n,args:o,functionName:s});try{const{data:a}=await te(e,Mo,"call")({...i,data:c,to:r});return qn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw Sr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function rv(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:i,...c}=t,a=c.account?it(c.account):e.account,l=kt({abi:n,args:o,functionName:i});try{const{data:u}=await te(e,Mo,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...c,account:a}),f=qn({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 Sr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:a==null?void 0:a.address})}}const ka=new Map,fd=new Map;let ov=0;function In(e,t,n){const r=++ov,o=()=>ka.get(e)||[],s=()=>{const u=o();ka.set(e,u.filter(f=>f.id!==r))},i=()=>{const u=o();if(!u.some(p=>p.id===r))return;const f=fd.get(e);if(u.length===1&&f){const p=f();p instanceof Promise&&p.catch(()=>{})}s()},c=o();if(ka.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"&&fd.set(e,l),i}async function Ma(e){return new Promise(t=>setTimeout(t,e))}function Do(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 Ma(a);const l=async()=>{o&&(await e({unpoll:s}),await Ma(r),l())};l()})(),s}const sv=new Map,iv=new Map;function av(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,sv),r=t(e,iv);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function cv(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=av(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 lv=e=>`blockNumber.${e}`;async function Bo(e,{cacheTime:t=e.cacheTime}={}){const n=await cv(()=>e.request({method:"eth_blockNumber"}),{cacheKey:lv(e.uid),cacheTime:t});return BigInt(n)}async function Is(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=>an(s));return!("abi"in t)||!t.abi?o:ba({abi:t.abi,logs:o,strict:n})}async function $s(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function uv(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 w=p??!1,P=Ie(["watchContractEvent",r,o,s,e.uid,i,f,w,c]);return In(P,{onLogs:l,onError:a},E=>{let T;c!==void 0&&(T=c-1n);let A,D=!1;const F=Do(async()=>{var L;if(!D){try{A=await te(e,Hu,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:w,fromBlock:c})}catch{}D=!0;return}try{let b;if(A)b=await te(e,Is,"getFilterChanges")({filter:A});else{const g=await te(e,Bo,"getBlockNumber")({});T&&T<g?b=await te(e,If,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:T+1n,toBlock:g,strict:w}):b=[],T=g}if(b.length===0)return;if(s)E.onLogs(b);else for(const g of b)E.onLogs([g])}catch(b){A&&b instanceof Nn&&(D=!1),(L=E.onError)==null||L.call(E,b)}},{emitOnBegin:!0,interval:f});return async()=>{A&&await te(e,$s,"uninstallFilter")({filter:A}),F()}})})():(()=>{const w=p??!1,P=Ie(["watchContractEvent",r,o,s,e.uid,i,f,w]);let E=!0,T=()=>E=!1;return In(P,{onLogs:l,onError:a},A=>((async()=>{try{const D=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),F=i?Qr({abi:n,eventName:i,args:o}):[],{unsubscribe:L}=await D.subscribe({params:["logs",{address:r,topics:F}],onData(b){var x;if(!E)return;const g=b.result;try{const{eventName:I,args:O}=Es({abi:n,data:g.data,topics:g.topics,strict:p}),$=an(g,{args:O,eventName:I});A.onLogs([$])}catch(I){let O,$;if(I instanceof us||I instanceof Fi){if(p)return;O=I.abiItem.name,$=(x=I.abiItem.inputs)==null?void 0:x.some(v=>!("name"in v&&v.name))}const M=an(g,{args:$?[]:{},eventName:O});A.onLogs([M])}},onError(b){var g;(g=A.onError)==null||g.call(A,b)}});T=L,E||T()}catch(D){a==null||a(D)}})(),()=>T()))})()}async function fv(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 Ma(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 dv={"0x0":"reverted","0x1":"success"};function dd(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=>an(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?rn(e.transactionIndex):null,status:e.status?dv[e.status]:null,type:e.type?mf[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Ba=256;let ks=Ba,Ms;function pd(e=11){if(!Ms||ks+e>Ba*2){Ms="",ks=0;for(let t=0;t<Ba;t++)Ms+=(256+Math.random()*256|0).toString(16).substring(1)}return Ms.substring(ks,ks+++e)}function pv(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?it(e.account):void 0,{config:d,request:h,value:m}=e.transport({account:p,chain:n,pollingInterval:u}),w={...d,...m},P={account:p,batch:t,cacheTime:f,ccipRead:r,chain:n,key:o,name:s,pollingInterval:u,request:h,transport:w,type:i,uid:pd(),...c?{experimental_blockTag:c}:{}};function E(T){return A=>{const D=A(T);for(const L in P)delete D[L];const F={...T,...D};return Object.assign(F,{extend:E(F)})}}return Object.assign(P,{extend:E(P)})}function La(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof Xi);return t instanceof Xi?((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 hv(e){const{abi:t,data:n}=e,r=vr(n,0,4),o=t.find(s=>s.type==="function"&&r===Jr(Ct(s)));if(!o)throw new r1(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?eo(o.inputs,vr(n,4)):void 0}}const Fa="/docs/contract/encodeErrorResult";function hd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Wn({abi:t,args:r,name:n});if(!a)throw new mu(n,{docsPath:Fa});o=a}if(o.type!=="error")throw new mu(void 0,{docsPath:Fa});const s=Ct(o),i=Jr(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new e1(o.name,{docsPath:Fa});c=An(o.inputs,r)}return yr([i,c])}const Ra="/docs/contract/encodeFunctionResult";function mv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Wn({abi:t,name:n});if(!i)throw new dr(n,{docsPath:Ra});o=i}if(o.type!=="function")throw new dr(void 0,{docsPath:Ra});if(!o.outputs)throw new yu(o.name,{docsPath:Ra});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new vu(r)})();return An(o.outputs,s)}const Lo="x-batch-gateway:true";async function md(e){const{data:t,ccipRequest:n}=e,{args:[r]}=hv({abi:Aa,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(Lo)?await md({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=bv(a)}})),mv({abi:Aa,functionName:"query",result:[o,s]})}function bv(e){return e.name==="HttpRequestError"&&e.status?hd({abi:Aa,errorName:"HttpError",args:[e.status,e.shortMessage]}):hd({abi:[qu],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function bd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Ot(t)?t:null}function ja(e){let t=new Uint8Array(32).fill(0);if(!e)return Oe(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=bd(n[r]),s=o?hr(o):Fe(Un(n[r]),"bytes");t=Fe($t([t,s]),"bytes")}return Oe(t)}function gv(e){return`[${e.slice(2)}]`}function yv(e){const t=new Uint8Array(32).fill(0);return e?bd(e)||Fe(Un(e)):Oe(t)}function za(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Un(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=Un(o[s]);i.byteLength>255&&(i=Un(gv(yv(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 vv(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 Or({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?[ja(s),BigInt(o)]:[ja(s)];try{const p=kt({abi:nd,functionName:"addr",args:f}),d={address:l,abi:ed,functionName:"resolveWithGateways",args:[Sn(za(s)),p,i??[Lo]],blockNumber:n,blockTag:r},m=await te(e,Lt,"readContract")(d);if(m[0]==="0x")return null;const w=qn({abi:nd,args:f,functionName:"addr",data:m[0]});return w==="0x"||zn(w)==="0x00"?null:w}catch(p){if(c)throw p;if(La(p))return null;throw p}}class wv 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 Fo extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Ua 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 xv extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Ev=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Sv=/^(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>\/.*)?$/,Pv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Tv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Av(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 gd(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function yd({uri:e,gatewayUrls:t}){const n=Pv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=gd(t==null?void 0:t.ipfs,"https://ipfs.io"),o=gd(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(Ev),{protocol:i,subpath:c,target:a,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||Sv.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(Tv,"");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 Ua({uri:e})}function vd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new wv({data:e});return e.image||e.image_url||e.image_data}async function Nv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await _a({gatewayUrls:e,uri:vd(n)})}catch{throw new Ua({uri:t})}}async function _a({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=yd({uri:t,gatewayUrls:e});if(r||await Av(n))return n;throw new Ua({uri:t})}function Cv(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 Fo({reason:"Only EIP-155 supported"});if(!i)throw new Fo({reason:"Chain ID not found"});if(!a)throw new Fo({reason:"Contract address not found"});if(!o)throw new Fo({reason:"Token ID not found"});if(!c)throw new Fo({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function Ov(e,{nft:t}){if(t.namespace==="erc721")return Lt(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 Lt(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 xv({namespace:t.namespace})}async function Iv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?$v(e,{gatewayUrls:t,record:n}):_a({uri:n,gatewayUrls:t})}async function $v(e,{gatewayUrls:t,record:n}){const r=Cv(n),o=await Ov(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=yd({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 _a({uri:vd(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),Nv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function wd(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 Or({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:ed,args:[Sn(za(s)),kt({abi:td,functionName:"text",args:[ja(s),o]}),i??[Lo]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},d=await te(e,Lt,"readContract")(f);if(d[0]==="0x")return null;const h=qn({abi:td,functionName:"text",data:d[0]});return h===""?null:h}catch(f){if(c)throw f;if(La(f))return null;throw f}}async function kv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await te(e,wd,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await Iv(e,{record:a,gatewayUrls:r})}catch{return null}}async function Mv(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 Or({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:Zy,args:[n,s,i??[Lo]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=te(e,Lt,"readContract"),[p]=await f(u);return p||null}catch(u){if(c)throw u;if(La(u))return null;throw u}}async function Dv(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 Or({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 te(e,Lt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Sn(za(o))],blockNumber:n,blockTag:r});return a}async function xd(e,t){var w,P,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?it(n):void 0;try{Tr(t);const A=(typeof r=="bigint"?ne(r):void 0)||o,D=(E=(P=(w=e.chain)==null?void 0:w.formatters)==null?void 0:P.transactionRequest)==null?void 0:E.format,L=(D||Ao)({...xs(h,{format:D}),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:[L,A]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(T){throw ad(T,{...t,account:m,chain:e.chain})}}async function Bv(e){const t=bs(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function Ed(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),l=bs(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(d=>Qr({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"?ne(s):s,toBlock:typeof c=="bigint"?ne(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 Sd(e){const t=bs(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Lv(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o=typeof n=="bigint"?ne(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Fv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Rv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?ne(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}),rn(s)}async function Wa(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?ne(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}class jv 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 zv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,l,u,f]=await te(e,Lt,"readContract")({abi:Uv,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 jv({address:n}):i}}const Uv=[{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 _v(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 Wv(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?ne(n):void 0,i=await e.request({method:"eth_feeHistory",params:[ne(t),s||r,o]},{dedupe:!!s});return _v(i)}async function Vv(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>an(s));return t.abi?ba({abi:t.abi,logs:o,strict:n}):o}async function Hv({address:e,authorization:t,signature:n}){return No(Tn(e),await uf({authorization:t,signature:n}))}const Ds=new hs(8192);function Gv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ds.get(n))return Ds.get(n);const r=e().finally(()=>Ds.delete(n));return Ds.set(n,r),r}function qv(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 Gn(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new Gn(new Error("method not supported"),{method:l});const u=o?Zr(`${a}.${Ie(n)}`):void 0;return Gv(()=>Da(async()=>{try{return await e(n)}catch(p){const d=p;switch(d.code){case oo.code:throw new oo(d);case so.code:throw new so(d);case io.code:throw new io(d,{method:n.method});case ao.code:throw new ao(d);case Hn.code:throw new Hn(d);case Nn.code:throw new Nn(d);case co.code:throw new co(d);case lo.code:throw new lo(d);case uo.code:throw new uo(d);case Gn.code:throw new Gn(d,{method:n.method});case xr.code:throw new xr(d);case fo.code:throw new fo(d);case Er.code:throw new Er(d);case po.code:throw new po(d);case ho.code:throw new ho(d);case mo.code:throw new mo(d);case bo.code:throw new bo(d);case go.code:throw new go(d);case yo.code:throw new yo(d);case vo.code:throw new vo(d);case wo.code:throw new wo(d);case xo.code:throw new xo(d);case Eo.code:throw new Eo(d);case So.code:throw new So(d);case Po.code:throw new Po(d);case 5e3:throw new Er(d);default:throw p instanceof V?p:new Dg(d)}}},{delay:({count:p,error:d})=>{var h;if(d&&d instanceof Vn){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})=>Kv(p)}),{enabled:o,id:u})}}function Kv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===xr.code||e.code===Hn.code:e instanceof Vn&&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 Zv 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=>` ${ro(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class Yv extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${ro(n)}`,`Response: ${Ie(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Xv 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 Jv="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 Qv(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=Xu({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:Td;try{if(!No(o,i))throw new Xv({sender:i,to:o});const d=c.includes(Lo)?await md({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:c}),{data:h}=await Mo(e,{blockNumber:t,blockTag:n,data:$t([l,An([{type:"bytes"},{type:"bytes"}],[d,u])]),to:o});return h}catch(d){throw new Zv({callbackSelector:l,cause:d,data:r,extraData:u,sender:i,urls:c})}}async function Td({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 Vn({body:a,details:f!=null&&f.error?Ie(f.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Ot(f)){r=new Yv({result:f,url:i});continue}return f}catch(u){r=new Vn({body:a,details:u.message,url:i})}}throw r}const ew=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Td,offchainLookup:Qv,offchainLookupAbiItem:Pd,offchainLookupSignature:Jv},Symbol.toStringTag,{value:"Module"}));function tw(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function nw(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 rw(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Ad=rw();function ow(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 nw(async({signal:m})=>{const w={...a,body:Array.isArray(r)?Ie(r.map(A=>({jsonrpc:"2.0",id:A.id??Ad.take(),...A}))):Ie({jsonrpc:"2.0",id:r.id??Ad.take(),...r}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:f||(c>0?m:null)},P=new Request(e,w),E=await(s==null?void 0:s(P,w))??{...w,url:e};return await o(E.url??e,E)},{errorInstance:new of({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 Vn({body:r,details:Ie(h.error)||d.statusText,headers:d.headers,status:d.status,url:e});return h}catch(d){throw d instanceof Vn||d instanceof of?d:new Vn({body:r,cause:d,url:e})}}}}const sw=`Ethereum Signed Message:
89
- `;function iw(e){const t=typeof e=="string"?Zr(e):typeof e.raw=="string"?e.raw:Oe(e.raw),n=Zr(`${sw}${Ee(t)}`);return $t([n,t])}function Nd(e,t){return Fe(iw(e),t)}class aw extends V{constructor({domain:t}){super(`Invalid domain "${Ie(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class cw 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 lw extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function uw(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(Uu);if(p&&(typeof f=="number"||typeof f=="bigint")){const[m,w,P]=p;ne(f,{signed:w==="int",size:Number.parseInt(P,10)/8})}if(u==="address"&&typeof f=="string"&&!ht(f))throw new Pn({address:f});const d=u.match(X1);if(d){const[m,w]=d;if(w&&Ee(f)!==Number.parseInt(w,10))throw new s1({expectedSize:Number.parseInt(w,10),givenSize:Ee(f)})}const h=o[u];h&&(dw(u),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new aw({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new cw({primaryType:r,types:o})}function fw({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 dw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new lw({type:e})}function pw(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:fw({domain:t}),...e.types};uw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(hw({domain:t,types:o})),r!=="EIP712Domain"&&s.push(Cd({data:n,primaryType:r,types:o})),Fe($t(s))}function hw({domain:e,types:t}){return Cd({data:e,primaryType:"EIP712Domain",types:t})}function Cd({data:e,primaryType:t,types:n}){const r=Od({data:e,primaryType:t,types:n});return Fe(r)}function Od({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[mw({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=$d({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return An(r,o)}function mw({primaryType:e,types:t}){const n=Sn(bw({primaryType:e,types:t}));return Fe(n)}function bw({primaryType:e,types:t}){let n="";const r=Id({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 Id({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])Id({primaryType:s.type,types:t},n);return n}function $d({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Fe(Od({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},Fe(r)];if(n==="string")return[{type:"bytes32"},Fe(Sn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>$d({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},Fe(An(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class gw 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 Va={checksum:new gw(8192)}.checksum;function kd(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Lu(Oy(e));return n==="Bytes"?r:Bt(r)}const yw=/^0x[a-fA-F0-9]{40}$/;function Bs(e,t={}){const{strict:n=!0}=t;if(!yw.test(e))throw new Dd({address:e,cause:new vw});if(n){if(e.toLowerCase()===e)return;if(Md(e)!==e)throw new Dd({address:e,cause:new ww})}}function Md(e){if(Va.has(e))return Va.get(e);Bs(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=kd($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 Va.set(e,o),o}function Ha(e,t={}){const{strict:n=!0}=t??{};try{return Bs(e,{strict:n}),!0}catch{return!1}}class Dd extends le{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 vw extends le{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 ww extends le{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const xw=/^(.*)\[([0-9]*)\]$/,Ew=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Bd=/^(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 Ir(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=Za(t.type);if(s){const[i,c]=s;return Pw(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return Cw(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return Sw(e,{checksum:r});if(t.type==="bool")return Tw(e);if(t.type.startsWith("bytes"))return Aw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Nw(e,t);if(t.type==="string")return Ow(e,{staticPosition:o});throw new Ja(t.type)}const Fd=32,Ga=32;function Sw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Md(s):s)(Bt(My(r,-20))),32]}function Pw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=un(e.readBytes(Ga)),l=s+a,u=l+Fd;e.setPosition(l);const f=un(e.readBytes(Fd)),p=Ro(t);let d=0;const h=[];for(let m=0;m<f;++m){e.setPosition(u+(p?m*32:d));const[w,P]=Ir(e,t,{checksumAddress:r,staticPosition:u});d+=P,h.push(w)}return e.setPosition(s+32),[h,32]}if(Ro(t)){const a=un(e.readBytes(Ga)),l=s+a,u=[];for(let f=0;f<o;++f){e.setPosition(l+f*32);const[p]=Ir(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]=Ir(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,c.push(l)}return[c,i]}function Tw(e){return[By(e.readBytes(32),{size:32}),32]}function Aw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=un(e.readBytes(32));e.setPosition(n+i);const c=un(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Bt(a),32]}return[Bt(e.readBytes(Number.parseInt(o,10),32)),32]}function Nw(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?Dy(o,{signed:n}):un(o,{signed:n}),32]}function Cw(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(Ro(t)){const a=un(e.readBytes(Ga)),l=o+a;for(let u=0;u<t.components.length;++u){const f=t.components[u];e.setPosition(l+c);const[p,d]=Ir(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]=Ir(e,l,{checksumAddress:r,staticPosition:o});i[s?a:l==null?void 0:l.name]=u,c+=f}return[i,c]}function Ow(e,{staticPosition:t}){const n=un(e.readBytes(32)),r=t+n;e.setPosition(r);const o=un(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=Ly(Vf(s));return e.setPosition(t+32),[i,32]}function Iw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(qa({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function qa({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=Za(r.type);if(o){const[s,i]=o;return kw(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Fw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return $w(n,{checksum:e});if(r.type==="bool")return Dw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Bd.exec(r.type)??[];return Bw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Mw(n,{type:r.type});if(r.type==="string")return Lw(n);throw new Ja(r.type)}function Ka(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=ct(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(ze(t+o,{size:32})),r.push(c),o+=ct(c)):n.push(c)}return Dt(...n,...r)}function $w(e,t){const{checksum:n=!1}=t;return Bs(e,{strict:n}),{dynamic:!1,encoded:Zn(e.toLowerCase())}}function kw(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new Gw(e);if(!s&&e.length!==r)throw new Hw({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const l=qa({checksumAddress:n,parameter:o,value:e[a]});l.dynamic&&(i=!0),c.push(l)}if(s||i){const a=Ka(c);if(s){const l=ze(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?Dt(l,a):l}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Dt(...c.map(({encoded:a})=>a))}}function Mw(e,{type:t}){const[,n]=t.split("bytes"),r=ct(e);if(!n){let o=e;return r%32!==0&&(o=Yn(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Dt(Zn(ze(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new zd({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Yn(e)}}function Dw(e){if(typeof e!="boolean")throw new le(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Zn(Hf(e))}}function Bw(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 Kf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ze(e,{size:32,signed:t})}}function Lw(e){const t=Ta(e),n=Math.ceil(ct(t)/32),r=[];for(let o=0;o<n;o++)r.push(Yn(Vt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Dt(Yn(ze(ct(t),{size:32})),...r)}}function Fw(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=qa({checksumAddress:n,parameter:c,value:e[a]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ka(s):Dt(...s.map(({encoded:i})=>i))}}function Za(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ro(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(Ro);const n=Za(e.type);return!!(n&&Ro({...e,type:n[1]}))}const Rw={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 Uw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new zw({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Rd({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 Rd({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 jw(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Rw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Rd extends le{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class zw extends le{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 Uw extends le{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"?Wf(t):t,i=jw(s);if(Nr(s)===0&&e.length>0)throw new Vw;if(Nr(s)&&Nr(s)<32)throw new Ww({data:typeof t=="string"?t:Bt(t),parameters:e,size:Nr(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]=Ir(i,u,{checksumAddress:o,staticPosition:0});c+=p,r==="Array"?a.push(f):a[u.name??l]=f}return a}function Ya(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Ud({expectedLength:e.length,givenLength:t.length});const o=Iw({checksumAddress:r,parameters:e,values:t}),s=Ka(o);return s.length===0?"0x":s}function Xa(e,t){if(e.length!==t.length)throw new Ud({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(Xa.encode(o,s))}return Dt(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return Bs(a),Zn(a.toLowerCase(),o?32:0)}if(n==="string")return Ta(r);if(n==="bytes")return r;if(n==="bool")return Zn(Hf(r),o?32:1);const s=n.match(Bd);if(s){const[a,l,u="256"]=s,f=Number.parseInt(u,10)/8;return ze(r,{size:o?32:f,signed:l==="int"})}const i=n.match(Ew);if(i){const[a,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new zd({expectedSize:Number.parseInt(l,10),value:r});return Yn(r,o?32:0)}const c=n.match(xw);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":Dt(...u)}throw new Ja(n)}e.encode=t})(Xa||(Xa={}));function jd(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?uu(e):e}class Ww extends le{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${ur(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Vw extends le{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Hw extends le{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 zd extends le{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ct(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Ud extends le{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 Gw extends le{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Ja extends le{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 _d extends ji{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,N1(t);const r=ds(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),gr(s)}update(t){return br(this),this.iHash.update(t),this}digestInto(t){br(this),_n(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 Wd=(e,t,n)=>new _d(e,t).update(n).digest();Wd.create=(e,t)=>new _d(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ye=BigInt(0),Ue=BigInt(1),Xn=BigInt(2),qw=BigInt(3),Vd=BigInt(4),Hd=BigInt(5),Gd=BigInt(8);function Xe(e,t){const n=e%t;return n>=Ye?n:t+n}function bt(e,t,n){let r=e;for(;t-- >Ye;)r*=r,r%=n;return r}function Qa(e,t){if(e===Ye)throw new Error("invert: expected non-zero number");if(t<=Ye)throw new Error("invert: expected positive modulus, got "+t);let n=Xe(e,t),r=t,o=Ye,s=Ue;for(;n!==Ye;){const c=r/n,a=r%n,l=o-s*c;r=n,n=a,o=s,s=l}if(r!==Ue)throw new Error("invert: does not exist");return Xe(o,t)}function qd(e,t){const n=(e.ORDER+Ue)/Vd,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function Kw(e,t){const n=(e.ORDER-Hd)/Gd,r=e.mul(t,Xn),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Xn),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 Zw(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Ue,n=0;for(;t%Xn===Ye;)t/=Xn,n++;let r=Xn;const o=ec(e);for(;Zd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return qd;let s=o.pow(r,t);const i=(t+Ue)/Xn;return function(a,l){if(a.is0(l))return l;if(Zd(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 w=Ue<<BigInt(u-h-1),P=a.pow(f,w);u=h,f=a.sqr(P),p=a.mul(p,f),d=a.mul(d,P)}return d}}function Yw(e){return e%Vd===qw?qd:e%Gd===Hd?Kw:Zw(e)}const Xw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Jw(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Xw.reduce((r,o)=>(r[o]="function",r),t);return Ns(e,n)}function Qw(e,t,n){if(n<Ye)throw new Error("invalid exponent, negatives unsupported");if(n===Ye)return e.ONE;if(n===Ue)return t;let r=e.ONE,o=t;for(;n>Ye;)n&Ue&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Ue;return r}function Kd(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 Zd(e,t){const n=(e.ORDER-Ue)/Xn,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 Yd(e,t){t!==void 0&&Yr(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ec(e,t,n=!1,r={}){if(e<=Ye)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=Yd(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:As(o),ZERO:Ye,ONE:Ue,create:a=>Xe(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return Ye<=a&&a<e},is0:a=>a===Ye,isOdd:a=>(a&Ue)===Ue,neg:a=>Xe(-a,e),eql:(a,l)=>a===l,sqr:a=>Xe(a*a,e),add:(a,l)=>Xe(a+l,e),sub:(a,l)=>Xe(a-l,e),mul:(a,l)=>Xe(a*l,e),pow:(a,l)=>Qw(c,a,l),div:(a,l)=>Xe(a*Qa(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>Qa(a,e),sqrt:r.sqrt||(a=>(i||(i=Yw(e)),i(c,a))),toBytes:a=>n?Bf(a,s):$o(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Df(a):Kn(a)},invertBatch:a=>Kd(c,a),cmov:(a,l,u)=>u?l:a});return Object.freeze(c)}function Xd(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 Jd(e){const t=Xd(e);return t+Math.ceil(t/2)}function e6(e,t,n=!1){const r=e.length,o=Xd(t),s=Jd(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Df(e):Kn(e),c=Xe(i,t-Ue)+Ue;return n?Bf(c,o):$o(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Qd=BigInt(0),tc=BigInt(1);function nc(e,t){const n=t.negate();return e?n:t}function e0(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function rc(e,t){e0(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=As(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function t0(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+=tc);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 t6(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 n6(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 oc=new WeakMap,n0=new WeakMap;function sc(e){return n0.get(e)||1}function r6(e,t){return{constTimeNegate:nc,hasPrecomputes(n){return sc(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Qd;)r&tc&&(o=o.add(s)),s=s.double(),r>>=tc;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=rc(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=rc(n,t);for(let a=0;a<c.windows;a++){const{nextN:l,offset:u,isZero:f,isNeg:p,isNegF:d,offsetF:h}=t0(o,a,c);o=l,f?i=i.add(nc(d,r[h])):s=s.add(nc(p,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=rc(n,t);for(let c=0;c<i.windows&&o!==Qd;c++){const{nextN:a,offset:l,isZero:u,isNeg:f}=t0(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=oc.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&oc.set(r,o(s))),s},wNAFCached(n,r,o){const s=sc(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=sc(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){e0(r,t),n0.set(n,r),oc.delete(n)}}}function o6(e,t,n,r){t6(n,e),n6(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=yy(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const l=As(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 w=r[m],P=Number(w>>BigInt(d)&l);u[P]=u[P].add(n[m])}let h=i;for(let m=u.length-1,w=i;m>0;m--)w=w.add(u[m]),h=h.add(w);if(p=p.add(h),d!==0)for(let m=0;m<a;m++)p=p.double()}return p}function r0(e){return Jw(e.Fp),Ns(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Yd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function o0(e){e.lowS!==void 0&&Oo("lowS",e.lowS),e.prehash!==void 0&&Oo("prehash",e.prehash)}function s6(e){const t=r0(e);Ns(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 i6 extends Error{constructor(t=""){super(t)}}const fn={Err:i6,_tlv:{encode:(e,t)=>{const{Err:n}=fn;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=Ss(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Ss(o.length/2|128):"";return Ss(e)+s+o+t},decode(e,t){const{Err:n}=fn;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}=fn;if(e<dn)throw new t("integer: negative integers are not allowed");let n=Ss(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}=fn;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 Kn(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=fn,o=mt("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}=fn,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 ic(e,t){return Io($o(e,t))}const dn=BigInt(0),De=BigInt(1);BigInt(2);const ac=BigInt(3),a6=BigInt(4);function c6(e){const t=s6(e),{Fp:n}=t,r=ec(t.n,t.nBitLength),o=t.toBytes||((T,A,D)=>{const F=A.toAffine();return Ts(Uint8Array.from([4]),n.toBytes(F.x),n.toBytes(F.y))}),s=t.fromBytes||(T=>{const A=T.subarray(1),D=n.fromBytes(A.subarray(0,n.BYTES)),F=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:D,y:F}});function i(T){const{a:A,b:D}=t,F=n.sqr(T),L=n.mul(F,T);return n.add(n.add(L,n.mul(T,A)),D)}function c(T,A){const D=n.sqr(A),F=i(T);return n.eql(D,F)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,ac),a6),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(T){return Sa(T,De,t.n)}function f(T){const{allowedPrivateKeyLengths:A,nByteLength:D,wrapPrivateKey:F,n:L}=t;if(A&&typeof T!="bigint"){if(Co(T)&&(T=Io(T)),typeof T!="string"||!A.includes(T.length))throw new Error("invalid private key");T=T.padStart(D*2,"0")}let b;try{b=typeof T=="bigint"?T:Kn(mt("private key",T,D))}catch{throw new Error("invalid private key, expected hex or "+D+" bytes, got "+typeof T)}return F&&(b=Xe(b,L)),Ar("private key",b,De,L),b}function p(T){if(!(T instanceof m))throw new Error("ProjectivePoint expected")}const d=Ff((T,A)=>{const{px:D,py:F,pz:L}=T;if(n.eql(L,n.ONE))return{x:D,y:F};const b=T.is0();A==null&&(A=b?n.ONE:n.inv(L));const g=n.mul(D,A),x=n.mul(F,A),I=n.mul(L,A);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql(I,n.ONE))throw new Error("invZ was invalid");return{x:g,y:x}}),h=Ff(T=>{if(T.is0()){if(t.allowInfinityPoint&&!n.is0(T.py))return;throw new Error("bad point: ZERO")}const{x:A,y:D}=T.toAffine();if(!n.isValid(A)||!n.isValid(D))throw new Error("bad point: x or y not FE");if(!c(A,D))throw new Error("bad point: equation left != right");if(!T.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(A,D,F){if(A==null||!n.isValid(A))throw new Error("x required");if(D==null||!n.isValid(D)||n.is0(D))throw new Error("y required");if(F==null||!n.isValid(F))throw new Error("z required");this.px=A,this.py=D,this.pz=F,Object.freeze(this)}static fromAffine(A){const{x:D,y:F}=A||{};if(!A||!n.isValid(D)||!n.isValid(F))throw new Error("invalid affine point");if(A instanceof m)throw new Error("projective point not allowed");const L=b=>n.eql(b,n.ZERO);return L(D)&&L(F)?m.ZERO:new m(D,F,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const D=Kd(n,A.map(F=>F.pz));return A.map((F,L)=>F.toAffine(D[L])).map(m.fromAffine)}static fromHex(A){const D=m.fromAffine(s(mt("pointHex",A)));return D.assertValidity(),D}static fromPrivateKey(A){return m.BASE.multiply(f(A))}static msm(A,D){return o6(m,r,A,D)}_setWindowSize(A){E.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){p(A);const{px:D,py:F,pz:L}=this,{px:b,py:g,pz:x}=A,I=n.eql(n.mul(D,x),n.mul(b,L)),O=n.eql(n.mul(F,x),n.mul(g,L));return I&&O}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:D}=t,F=n.mul(D,ac),{px:L,py:b,pz:g}=this;let x=n.ZERO,I=n.ZERO,O=n.ZERO,$=n.mul(L,L),M=n.mul(b,b),v=n.mul(g,g),N=n.mul(L,b);return N=n.add(N,N),O=n.mul(L,g),O=n.add(O,O),x=n.mul(A,O),I=n.mul(F,v),I=n.add(x,I),x=n.sub(M,I),I=n.add(M,I),I=n.mul(x,I),x=n.mul(N,x),O=n.mul(F,O),v=n.mul(A,v),N=n.sub($,v),N=n.mul(A,N),N=n.add(N,O),O=n.add($,$),$=n.add(O,$),$=n.add($,v),$=n.mul($,N),I=n.add(I,$),v=n.mul(b,g),v=n.add(v,v),$=n.mul(v,N),x=n.sub(x,$),O=n.mul(v,M),O=n.add(O,O),O=n.add(O,O),new m(x,I,O)}add(A){p(A);const{px:D,py:F,pz:L}=this,{px:b,py:g,pz:x}=A;let I=n.ZERO,O=n.ZERO,$=n.ZERO;const M=t.a,v=n.mul(t.b,ac);let N=n.mul(D,b),k=n.mul(F,g),S=n.mul(L,x),B=n.add(D,F),j=n.add(b,g);B=n.mul(B,j),j=n.add(N,k),B=n.sub(B,j),j=n.add(D,L);let U=n.add(b,x);return j=n.mul(j,U),U=n.add(N,S),j=n.sub(j,U),U=n.add(F,L),I=n.add(g,x),U=n.mul(U,I),I=n.add(k,S),U=n.sub(U,I),$=n.mul(M,j),I=n.mul(v,S),$=n.add(I,$),I=n.sub(k,$),$=n.add(k,$),O=n.mul(I,$),k=n.add(N,N),k=n.add(k,N),S=n.mul(M,S),j=n.mul(v,j),k=n.add(k,S),S=n.sub(N,S),S=n.mul(M,S),j=n.add(j,S),N=n.mul(k,j),O=n.add(O,N),N=n.mul(U,j),I=n.mul(B,I),I=n.sub(I,N),N=n.mul(B,k),$=n.mul(U,$),$=n.add($,N),new m(I,O,$)}subtract(A){return this.add(A.negate())}is0(){return this.equals(m.ZERO)}wNAF(A){return E.wNAFCached(this,A,m.normalizeZ)}multiplyUnsafe(A){const{endo:D,n:F}=t;Ar("scalar",A,dn,F);const L=m.ZERO;if(A===dn)return L;if(this.is0()||A===De)return this;if(!D||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,A,m.normalizeZ);let{k1neg:b,k1:g,k2neg:x,k2:I}=D.splitScalar(A),O=L,$=L,M=this;for(;g>dn||I>dn;)g&De&&(O=O.add(M)),I&De&&($=$.add(M)),M=M.double(),g>>=De,I>>=De;return b&&(O=O.negate()),x&&($=$.negate()),$=new m(n.mul($.px,D.beta),$.py,$.pz),O.add($)}multiply(A){const{endo:D,n:F}=t;Ar("scalar",A,De,F);let L,b;if(D){const{k1neg:g,k1:x,k2neg:I,k2:O}=D.splitScalar(A);let{p:$,f:M}=this.wNAF(x),{p:v,f:N}=this.wNAF(O);$=E.constTimeNegate(g,$),v=E.constTimeNegate(I,v),v=new m(n.mul(v.px,D.beta),v.py,v.pz),L=$.add(v),b=M.add(N)}else{const{p:g,f:x}=this.wNAF(A);L=g,b=x}return m.normalizeZ([L,b])[0]}multiplyAndAddUnsafe(A,D,F){const L=m.BASE,b=(x,I)=>I===dn||I===De||!x.equals(L)?x.multiplyUnsafe(I):x.multiply(I),g=b(this,D).add(b(A,F));return g.is0()?void 0:g}toAffine(A){return d(this,A)}isTorsionFree(){const{h:A,isTorsionFree:D}=t;if(A===De)return!0;if(D)return D(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:D}=t;return A===De?this:D?D(m,this):this.multiplyUnsafe(t.h)}toRawBytes(A=!0){return Oo("isCompressed",A),this.assertValidity(),o(m,this,A)}toHex(A=!0){return Oo("isCompressed",A),Io(this.toRawBytes(A))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:P}=t,E=r6(m,w?Math.ceil(P/2):P);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:u}}function l6(e){const t=r0(e);return Ns(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function u6(e){const t=l6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(v){return Xe(v,r)}function l(v){return Qa(v,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:p,isWithinCurveOrder:d}=c6({...t,toBytes(v,N,k){const S=N.toAffine(),B=n.toBytes(S.x),j=Ts;return Oo("isCompressed",k),k?j(Uint8Array.from([N.hasEvenY()?2:3]),B):j(Uint8Array.from([4]),B,n.toBytes(S.y))},fromBytes(v){const N=v.length,k=v[0],S=v.subarray(1);if(N===i&&(k===2||k===3)){const B=Kn(S);if(!Sa(B,De,n.ORDER))throw new Error("Point is not on curve");const j=p(B);let U;try{U=n.sqrt(j)}catch(Z){const H=Z instanceof Error?": "+Z.message:"";throw new Error("Point is not on curve"+H)}const _=(U&De)===De;return(k&1)===1!==_&&(U=n.neg(U)),{x:B,y:U}}else if(N===c&&k===4){const B=n.fromBytes(S.subarray(0,n.BYTES)),j=n.fromBytes(S.subarray(n.BYTES,2*n.BYTES));return{x:B,y:j}}else{const B=i,j=c;throw new Error("invalid Point, expected length of "+B+", or uncompressed "+j+", got "+N)}}});function h(v){const N=r>>De;return v>N}function m(v){return h(v)?a(-v):v}const w=(v,N,k)=>Kn(v.slice(N,k));class P{constructor(N,k,S){Ar("r",N,De,r),Ar("s",k,De,r),this.r=N,this.s=k,S!=null&&(this.recovery=S),Object.freeze(this)}static fromCompact(N){const k=o;return N=mt("compactSignature",N,k*2),new P(w(N,0,k),w(N,k,2*k))}static fromDER(N){const{r:k,s:S}=fn.toSig(mt("DER",N));return new P(k,S)}assertValidity(){}addRecoveryBit(N){return new P(this.r,this.s,N)}recoverPublicKey(N){const{r:k,s:S,recovery:B}=this,j=L(mt("msgHash",N));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const U=B===2||B===3?k+t.n:k;if(U>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=B&1?"03":"02",q=u.fromHex(_+ic(U,n.BYTES)),Z=l(U),H=a(-j*Z),W=a(S*Z),J=u.BASE.multiplyAndAddUnsafe(q,H,W);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Ps(this.toDERHex())}toDERHex(){return fn.hexFromSig(this)}toCompactRawBytes(){return Ps(this.toCompactHex())}toCompactHex(){const N=o;return ic(this.r,N)+ic(this.s,N)}}const E={isValidPrivateKey(v){try{return f(v),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const v=Jd(t.n);return e6(t.randomBytes(v),t.n)},precompute(v=8,N=u.BASE){return N._setWindowSize(v),N.multiply(BigInt(3)),N}};function T(v,N=!0){return u.fromPrivateKey(v).toRawBytes(N)}function A(v){if(typeof v=="bigint")return!1;if(v instanceof u)return!0;const k=mt("key",v).length,S=n.BYTES,B=S+1,j=2*S+1;if(!(t.allowedPrivateKeyLengths||o===B))return k===B||k===j}function D(v,N,k=!0){if(A(v)===!0)throw new Error("first arg must be private key");if(A(N)===!1)throw new Error("second arg must be public key");return u.fromHex(N).multiply(f(v)).toRawBytes(k)}const F=t.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");const N=Kn(v),k=v.length*8-s;return k>0?N>>BigInt(k):N},L=t.bits2int_modN||function(v){return a(F(v))},b=As(s);function g(v){return Ar("num < 2^"+s,v,dn,b),$o(v,o)}function x(v,N,k=I){if(["recovered","canonical"].some(Q=>Q in k))throw new Error("sign() legacy options not supported");const{hash:S,randomBytes:B}=t;let{lowS:j,prehash:U,extraEntropy:_}=k;j==null&&(j=!0),v=mt("msgHash",v),o0(k),U&&(v=mt("prehashed msgHash",S(v)));const q=L(v),Z=f(N),H=[g(Z),g(q)];if(_!=null&&_!==!1){const Q=_===!0?B(n.BYTES):_;H.push(mt("extraEntropy",Q))}const W=Ts(...H),J=q;function K(Q){const oe=F(Q);if(!d(oe))return;const ee=l(oe),ue=u.BASE.multiply(oe).toAffine(),ce=a(ue.x);if(ce===dn)return;const pe=a(ee*a(J+ce*Z));if(pe===dn)return;let re=(ue.x===ce?0:2)|Number(ue.y&De),Y=pe;return j&&h(pe)&&(Y=m(pe),re^=1),new P(ce,Y,re)}return{seed:W,k2sig:K}}const I={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function $(v,N,k=I){const{seed:S,k2sig:B}=x(v,N,k),j=t;return vy(j.hash.outputLen,j.nByteLength,j.hmac)(S,B)}u.BASE._setWindowSize(8);function M(v,N,k,S=O){var re;const B=v;N=mt("msgHash",N),k=mt("publicKey",k);const{lowS:j,prehash:U,format:_}=S;if(o0(S),"strict"in S)throw new Error("options.strict was renamed to lowS");if(_!==void 0&&_!=="compact"&&_!=="der")throw new Error("format must be compact or der");const q=typeof B=="string"||Co(B),Z=!q&&!_&&typeof B=="object"&&B!==null&&typeof B.r=="bigint"&&typeof B.s=="bigint";if(!q&&!Z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let H,W;try{if(Z&&(H=new P(B.r,B.s)),q){try{_!=="compact"&&(H=P.fromDER(B))}catch(Y){if(!(Y instanceof fn.Err))throw Y}!H&&_!=="der"&&(H=P.fromCompact(B))}W=u.fromHex(k)}catch{return!1}if(!H||j&&H.hasHighS())return!1;U&&(N=t.hash(N));const{r:J,s:K}=H,Q=L(N),oe=l(K),ee=a(Q*oe),ue=a(J*oe),ce=(re=u.BASE.multiplyAndAddUnsafe(W,ee,ue))==null?void 0:re.toAffine();return ce?a(ce.x)===J:!1}return{CURVE:t,getPublicKey:T,getSharedSecret:D,sign:$,verify:M,ProjectivePoint:u,Signature:P,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function f6(e){return{hash:e,hmac:(t,...n)=>Wd(e,t,M1(...n)),randomBytes:D1}}function d6(e,t){const n=r=>u6({...e,...f6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const s0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),i0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),p6=BigInt(0),h6=BigInt(1),cc=BigInt(2),a0=(e,t)=>(e+t/cc)/t;function m6(e){const t=s0,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=bt(u,n,t)*u%t,p=bt(f,n,t)*u%t,d=bt(p,cc,t)*l%t,h=bt(d,o,t)*d%t,m=bt(h,s,t)*h%t,w=bt(m,c,t)*m%t,P=bt(w,a,t)*w%t,E=bt(P,c,t)*m%t,T=bt(E,n,t)*u%t,A=bt(T,i,t)*h%t,D=bt(A,r,t)*l%t,F=bt(D,cc,t);if(!lc.eql(lc.sqr(F),e))throw new Error("Cannot find square root");return F}const lc=ec(s0,void 0,void 0,{sqrt:m6}),c0=d6({a:p6,b:BigInt(7),Fp:lc,n:i0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=i0,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-h6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=a0(s*e,t),a=a0(-r*e,t);let l=Xe(e-c*n-a*o,t),u=Xe(-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}}}},xf),b6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:c0},Symbol.toStringTag,{value:"Module"}));function l0(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new fc({signature:e});if(typeof e.s>"u")throw new fc({signature:e});if(n&&typeof e.yParity>"u")throw new fc({signature:e});if(e.r<0n||e.r>Ld)throw new S6({value:e.r});if(e.s<0n||e.s>Ld)throw new P6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new dc({value:e.yParity})}function g6(e){return u0(Bt(e))}function u0(e){if(e.length!==130&&e.length!==132)throw new E6({signature:e});const t=BigInt(Vt(e,0,32)),n=BigInt(Vt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return uc(o)}catch{throw new dc({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function y6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return v6(e)}function v6(e){const t=typeof e=="string"?u0(e):e instanceof Uint8Array?g6(e):typeof e.r=="string"?x6(e):e.v?w6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return l0(t),t}function w6(e){return{r:e.r,s:e.s,yParity:uc(e.v)}}function x6(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=uc(n)),typeof r!="number")throw new dc({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function uc(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 T6({value:e})}class E6 extends le{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ct(Vy(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class fc extends le{constructor({signature:t}){super(`Signature \`${_f(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class S6 extends le{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 P6 extends le{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 dc extends le{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 T6 extends le{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 A6(e,t={}){return typeof e.chainId=="string"?N6(e):{...e,...t.signature}}function N6(e){const{address:t,chainId:n,nonce:r}=e,o=y6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const C6="0x8010801080108010801080108010801080108010801080108010801080108010",O6=jd("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function f0(e){if(typeof e=="string"){if(Vt(e,-32)!==C6)throw new k6(e)}else l0(e.authorization)}function I6(e){f0(e);const t=qf(Vt(e,-64,-32)),n=Vt(e,-t-64,-64),r=Vt(e,0,-t-64),[o,s,i]=_w(O6,n);return{authorization:A6({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 $6(e){try{return f0(e),!0}catch{return!1}}let k6=class extends le{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 M6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function D6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new M6({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 B6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function L6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?rn(e.nonce):void 0,storageProof:e.storageProof?B6(e.storageProof):void 0}}async function F6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?ne(n):void 0,c=await e.request({method:"eth_getProof",params:[t,o,i||s]});return L6(c)}async function R6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?ne(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function pc(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?ne(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,ne(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||a,ne(s)]},{dedupe:!!l}):i&&typeof c=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,ne(c)]},{dedupe:!0})),!u)throw new ef({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)||la)(u,"getTransaction")}async function j6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([te(e,Bo,"getBlockNumber")({}),t?te(e,pc,"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 Ls(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new tf({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||dd)(n,"getTransactionReceipt")}async function z6(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 Or({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 T=0;T<l.length;T++){const{abi:A,address:D,args:F,functionName:L}=l[T];try{const b=kt({abi:A,args:F,functionName:L});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:D}]}catch(b){const g=Sr(b,{abi:A,address:D,args:F,docsPath:"/docs/contract/multicall",functionName:L,sender:n});if(!o)throw g;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:D}]}}const w=await Promise.allSettled(d.map(T=>te(e,Lt,"readContract")({...p===null?{code:Na}:{address:p},abi:Os,account:n,args:[T],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:c,functionName:"aggregate3",stateOverride:a}))),P=[];for(let T=0;T<w.length;T++){const A=w[T];if(A.status==="rejected"){if(!o)throw A.reason;for(let F=0;F<d[T].length;F++)P.push({status:"failure",error:A.reason,result:void 0});continue}const D=A.value;for(let F=0;F<D.length;F++){const{returnData:L,success:b}=D[F],{callData:g}=d[T][F],{abi:x,address:I,functionName:O,args:$}=l[P.length];try{if(g==="0x")throw new Kr;if(!b)throw new gs({data:L});const M=qn({abi:x,args:$,data:L,functionName:O});P.push(o?{result:M,status:"success"}:M)}catch(M){const v=Sr(M,{abi:x,address:I,args:$,docsPath:"/docs/contract/multicall",functionName:O});if(!o)throw v;P.push({error:v,result:void 0,status:"failure"})}}}if(P.length!==l.length)throw new V("multicall results mismatch");return P}async function hc(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?Jf(p.blockOverrides):void 0,h=p.calls.map(w=>{const P=w,E=P.account?it(P.account):void 0,T=P.abi?kt(P):P.data,A={...P,account:E,data:P.dataSuffix?$t([T||"0x",P.dataSuffix]):T,from:P.from??(E==null?void 0:E.address)};return Tr(A),Ao(A)}),m=p.stateOverrides?aa(p.stateOverrides):void 0;a.push({blockOverrides:d,calls:h,stateOverrides:m})}const u=(typeof n=="bigint"?ne(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:c},u]})).map((p,d)=>({...bf(p),calls:p.calls.map((h,m)=>{var x,I;const{abi:w,args:P,functionName:E,to:T}=o[d].calls[m],A=((x=h.error)==null?void 0:x.data)??h.returnData,D=BigInt(h.gasUsed),F=(I=h.logs)==null?void 0:I.map(O=>an(O)),L=h.status==="0x1"?"success":"failure",b=w&&L==="success"&&A!=="0x"?qn({abi:w,data:A,functionName:E}):null,g=(()=>{var $;if(L==="success")return;let O;if((($=h.error)==null?void 0:$.data)==="0x"?O=new Kr:h.error&&(O=new gs(h.error)),!!O)return Sr(O,{abi:w??[],address:T??"0x",args:P,functionName:E??"<unknown>"})})();return{data:A,gasUsed:D,logs:F,status:L,...L==="success"?{result:b}:{error:g}}})}))}catch(a){const l=a,u=ws(l,{});throw u instanceof To?l:u}}function mc(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 le("Unable to normalize signature.");return o}function bc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Ha(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)=>bc(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=>bc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function d0(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 d0(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")?Ha(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Ha(n[r],{strict:!1}):!1)return i}}function p0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?lu(e):e;return{...r,...n?{hash:$r(r)}:{}}}function Fs(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=Hy(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?h0(l)===Vt(t,0,4):l.type==="event"?$r(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new Rs({name:t});if(i.length===1)return{...i[0],...o?{hash:$r(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:$r(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?bc(f,d):!1})){if(c&&"inputs"in c&&c.inputs){const f=d0(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 Rs({name:t});return{...a,...o?{hash:$r(a)}:{}}}function h0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Fs(n,r)}return e[0]})();return Vt($r(t),0,4)}function U6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Fs(r,o)}return e[0]})(),n=typeof t=="string"?t:as(t);return mc(n)}function $r(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Fs(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:kd(Ta(U6(t)))}class _6 extends le{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${mc(as(t.abiItem))}\`, and`,`\`${n.type}\` in \`${mc(as(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 Rs extends le{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 W6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[H6(i),c]}return e})(),{bytecode:r,args:o}=n;return Dt(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Ya(t.inputs,o):"0x")}function V6(e){return p0(e)}function H6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Rs({name:"constructor"});return t}function G6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,f]=e;return[m0(l,u,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?m0([t,...r],t.name,{args:n}):t,s=q6(o),i=n.length>0?Ya(o.inputs,n):void 0;return i?Dt(s,i):s}function kr(e,t={}){return p0(e,t)}function m0(e,t,n){const r=Fs(e,t,n);if(r.type!=="function")throw new Rs({name:t,type:"function"});return r}function q6(e){return h0(e)}const K6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ht="0x0000000000000000000000000000000000000000",Z6="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function Y6(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:c,validation:a}=t,l=t.account?it(t.account):void 0;if(i&&!l)throw new V("`account` is required when `traceAssetChanges` is true");const u=l?W6(V6("constructor(bytes, bytes)"),{bytecode:sd,args:[Z6,G6(kr("function getBalance(address)"),[l.address])]}):void 0,f=i?await Promise.all(t.calls.map(async S=>{if(!S.data&&!S.abi)return;const{accessList:B}=await xd(e,{account:l.address,...S,data:S.abi?kt(S):S.data});return B.map(({address:j,storageKeys:U})=>U.length>0?j:null)})).then(S=>S.flat().filter(Boolean)):[],p=await hc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:f.map((S,B)=>({abi:[kr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:S,from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]}]:[],{calls:[...o,{}].map(S=>({...S,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:f.map((S,B)=>({abi:[kr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:S,from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]},{calls:f.map((S,B)=>({to:S,abi:[kr("function decimals() returns (uint256)")],functionName:"decimals",from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]},{calls:f.map((S,B)=>({to:S,abi:[kr("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]},{calls:f.map((S,B)=>({to:S,abi:[kr("function symbol() returns (string)")],functionName:"symbol",from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]}]:[]],traceTransfers:c,validation:a}),d=i?p[2]:p[0],[h,m,,w,P,E,T,A]=i?p:[],{calls:D,...F}=d,L=D.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],g=(m==null?void 0:m.calls)??[],x=[...b,...g].map(S=>S.status==="success"?Ut(S.data):null),I=(w==null?void 0:w.calls)??[],O=(P==null?void 0:P.calls)??[],$=[...I,...O].map(S=>S.status==="success"?Ut(S.data):null),M=((E==null?void 0:E.calls)??[]).map(S=>S.status==="success"?S.result:null),v=((A==null?void 0:A.calls)??[]).map(S=>S.status==="success"?S.result:null),N=((T==null?void 0:T.calls)??[]).map(S=>S.status==="success"?S.result:null),k=[];for(const[S,B]of $.entries()){const j=x[S];if(typeof B!="bigint"||typeof j!="bigint")continue;const U=M[S-1],_=v[S-1],q=N[S-1],Z=S===0?{address:K6,decimals:18,symbol:"ETH"}:{address:f[S-1],decimals:q||U?Number(U??1):void 0,symbol:_??void 0};k.some(H=>H.token.address===Z.address)||k.push({token:Z,value:{pre:j,post:B,diff:B-j}})}return{assetChanges:k,block:F,results:L}}const b0="0x6492649264926492649264926492649264926492649264926492649264926492";function X6(e){if(Vt(e,-32)!==b0)throw new e5(e)}function J6(e){const{data:t,signature:n,to:r}=e;return Dt(Ya(jd("address, bytes, bytes"),[r,t,n]),b0)}function Q6(e){try{return X6(e),!0}catch{return!1}}class e5 extends le{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 t5({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 c0.Signature(Ut(e),Ut(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:_t(i)}async function js(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 Ot(d)?d:typeof d=="object"&&"r"in d&&"s"in d?t5(d):Oe(d)})();try{return $6(i)?await n5(e,{...t,multicallAddress:s,signature:i}):await r5(e,{...t,verifierAddress:o,signature:i})}catch(d){try{if(No(Tn(n),await af({hash:r,signature:i})))return!0}catch{}if(d instanceof Jn)return!1;throw d}}async function n5(e,t){var w;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:l,to:u}=I6(t.signature);if(await Wa(e,{address:n,blockNumber:r,blockTag:o})===yr(["0xef0100",c.address]))return await o5(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:ne(c.r,{size:32}),s:ne(c.s,{size:32}),yParity:c.yParity};if(!await Hv({address:n,authorization:p}))throw new Jn;const h=await te(e,Lt,"readContract")({...i?{address:i}:{code:Na},authorizationList:[p],abi:Os,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:kt({abi:rd,functionName:"isValidSignature",args:[s,l]})}]]}),m=(w=h[h.length-1])==null?void 0:w.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new Jn}async function r5(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,l=await(async()=>!r&&!o||Q6(i)?i:J6({data:o,signature:i,to:r}))(),u=c?{to:c,data:kt({abi:od,functionName:"isValidSig",args:[n,s,l]}),...a}:{data:Ia({abi:od,args:[n,s,l],bytecode:Jy}),...a},{data:f}=await te(e,Mo,"call")(u).catch(p=>{throw p instanceof nf?new Jn:p});if(h1(f??"0x0"))return!0;throw new Jn}async function o5(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await te(e,Lt,"readContract")({address:n,abi:rd,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof rf?new Jn:a})).startsWith("0x1626ba7e"))return!0;throw new Jn}class Jn extends Error{}async function s5(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=Nd(n);return te(e,js,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function i5(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:l,...u}=t,f=pw({message:i,primaryType:c,types:a,domain:l});return te(e,js,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...u})}function g0(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=Ie(["watchBlockNumber",e.uid,t,n,i]);return In(f,{onBlockNumber:r,onError:o},p=>Do(async()=>{var d;try{const h=await te(e,Bo,"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=Ie(["watchBlockNumber",e.uid,t,n]);return In(f,{onBlockNumber:r,onError:o},p=>{let d=!0,h=()=>d=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),{unsubscribe:w}=await m.subscribe({params:["newHeads"],onData(P){var T;if(!d)return;const E=Ut((T=P.result)==null?void 0:T.number);p.onBlockNumber(E,a),a=E},onError(P){var E;(E=p.onError)==null||E.call(p,P)}});h=w,d||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function a5(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:c=({count:D})=>~~(1<<D)*200,timeout:a=18e4}=t,l=Ie(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var D;return t.pollingInterval?t.pollingInterval:(D=e.chain)!=null&&D.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,p,d,h=!1,m,w;const{promise:P,resolve:E,reject:T}=cd(),A=a?setTimeout(()=>{w==null||w(),m==null||m(),T(new Og({hash:o}))},a):void 0;return m=In(l,{onReplaced:s,resolve:E,reject:T},async D=>{if(d=await te(e,Ls,"getTransactionReceipt")({hash:o}).catch(()=>{}),d&&r<=1){clearTimeout(A),D.resolve(d),m==null||m();return}w=te(e,g0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(F){const L=g=>{clearTimeout(A),w==null||w(),g(),m==null||m()};let b=F;if(!h)try{if(d){if(r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;L(()=>D.resolve(d));return}if(n&&!f&&(h=!0,await Da(async()=>{f=await te(e,pc,"getTransaction")({hash:o}),f.blockNumber&&(b=f.blockNumber)},{delay:c,retryCount:i}),h=!1),d=await te(e,Ls,"getTransactionReceipt")({hash:o}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;L(()=>D.resolve(d))}catch(g){if(g instanceof ef||g instanceof tf){if(!f){h=!1;return}try{p=f,h=!0;const x=await Da(()=>te(e,Mt,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:$})=>$ instanceof hf});h=!1;const I=x.transactions.find(({from:$,nonce:M})=>$===p.from&&M===p.nonce);if(!I||(d=await te(e,Ls,"getTransactionReceipt")({hash:I.hash}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r)))return;let O="replaced";I.to===p.to&&I.value===p.value&&I.input===p.input?O="repriced":I.from===I.to&&I.value===0n&&(O="cancelled"),L(()=>{var $;($=D.onReplaced)==null||$.call(D,{reason:O,replacedTransaction:p,transaction:I,transactionReceipt:d}),D.resolve(d)})}catch(x){L(()=>D.reject(x))}}else L(()=>D.reject(g))}}})}),P}function c5(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=Ie(["watchBlocks",e.uid,t,n,r,u,a]);return In(h,{onBlock:o,onError:s},m=>Do(async()=>{var w;try{const P=await te(e,Mt,"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 E=(f==null?void 0:f.number)+1n;E<P.number;E++){const T=await te(e,Mt,"getBlock")({blockNumber:E,includeTransactions:u});m.onBlock(T,f),f=T}}((f==null?void 0:f.number)==null||t==="pending"&&(P==null?void 0:P.number)==null||P.number!==null&&P.number>f.number)&&(m.onBlock(P,f),f=P)}catch(P){(w=m.onError)==null||w.call(m,P)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,m=!0,w=()=>h=!1;return(async()=>{try{r&&te(e,Mt,"getBlock")({blockTag:t,includeTransactions:u}).then(T=>{h&&m&&(o(T,void 0),m=!1)}).catch(s);const P=(()=>{if(e.transport.type==="fallback"){const T=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return T?T.value:e.transport}return e.transport})(),{unsubscribe:E}=await P.subscribe({params:["newHeads"],async onData(T){var D;if(!h)return;const A=await te(e,Mt,"getBlock")({blockNumber:(D=T.result)==null?void 0:D.number,includeTransactions:u}).catch(()=>{});h&&(o(A,f),m=!1,f=A)},onError(T){s==null||s(T)}});w=E,h||w()}catch(P){s==null||s(P)}})(),()=>w()})()}function l5(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 w=Ie(["watchEvent",t,n,r,e.uid,o,u,i]);return In(w,{onLogs:a,onError:c},P=>{let E;i!==void 0&&(E=i-1n);let T,A=!1;const D=Do(async()=>{var F;if(!A){try{T=await te(e,Ed,"createEventFilter")({address:t,args:n,event:o,events:s,strict:d,fromBlock:i})}catch{}A=!0;return}try{let L;if(T)L=await te(e,Is,"getFilterChanges")({filter:T});else{const b=await te(e,Bo,"getBlockNumber")({});E&&E!==b?L=await te(e,ga,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:E+1n,toBlock:b}):L=[],E=b}if(L.length===0)return;if(r)P.onLogs(L);else for(const b of L)P.onLogs([b])}catch(L){T&&L instanceof Nn&&(A=!1),(F=P.onError)==null||F.call(P,L)}},{emitOnBegin:!0,interval:u});return async()=>{T&&await te(e,$s,"uninstallFilter")({filter:T}),D()}})})():(()=>{let w=!0,P=()=>w=!1;return(async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const F=e.transport.transports.find(L=>L.config.type==="webSocket"||L.config.type==="ipc");return F?F.value:e.transport}return e.transport})(),T=s??(o?[o]:void 0);let A=[];T&&(A=[T.flatMap(L=>Qr({abi:[L],eventName:L.name,args:n}))],o&&(A=A[0]));const{unsubscribe:D}=await E.subscribe({params:["logs",{address:t,topics:A}],onData(F){var b;if(!w)return;const L=F.result;try{const{eventName:g,args:x}=Es({abi:T??[],data:L.data,topics:L.topics,strict:d}),I=an(L,{args:x,eventName:g});a([I])}catch(g){let x,I;if(g instanceof us||g instanceof Fi){if(f)return;x=g.abiItem.name,I=(b=g.abiItem.inputs)==null?void 0:b.some($=>!("name"in $&&$.name))}const O=an(L,{args:I?[]:{},eventName:x});a([O])}},onError(F){c==null||c(F)}});P=D,w||P()}catch(E){c==null||c(E)}})(),()=>P()})()}function u5(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=Ie(["watchPendingTransactions",e.uid,t,s]);return In(l,{onTransactions:r,onError:n},u=>{let f;const p=Do(async()=>{var d;try{if(!f)try{f=await te(e,Sd,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await te(e,Is,"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 te(e,$s,"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 f5(e){var f,p,d;const{scheme:t,statement:n,...r}=((f=e.match(d5))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...l}=((p=e.match(p5))==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 d5=/^(?:(?<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)?/,p5=/(?: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 h5(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||!ht(r.address,{strict:!1})||t&&!No(r.address,t))return!1}catch{return!1}return!0}async function m5(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:c,time:a=new Date,...l}=t,u=f5(o);if(!u.address||!h5({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const p=Nd(o);return js(e,{address:u.address,hash:p,signature:c,...l})}async function b5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,a,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,ne(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)||dd)(o);if(i.status==="reverted"&&n)throw new Cg({receipt:i});return i}function g5(e){return{call:t=>Mo(e,t),createAccessList:t=>xd(e,t),createBlockFilter:()=>Bv(e),createContractEventFilter:t=>Hu(e,t),createEventFilter:t=>Ed(e,t),createPendingTransactionFilter:()=>Sd(e),estimateContractGas:t=>hy(e,t),estimateGas:t=>ma(e,t),getBalance:t=>Lv(e,t),getBlobBaseFee:()=>Fv(e),getBlock:t=>Mt(e,t),getBlockNumber:t=>Bo(e,t),getBlockTransactionCount:t=>Rv(e,t),getBytecode:t=>Wa(e,t),getChainId:()=>pa(e),getCode:t=>Wa(e,t),getContractEvents:t=>If(e,t),getEip712Domain:t=>zv(e,t),getEnsAddress:t=>vv(e,t),getEnsAvatar:t=>kv(e,t),getEnsName:t=>Mv(e,t),getEnsResolver:t=>Dv(e,t),getEnsText:t=>wd(e,t),getFeeHistory:t=>Wv(e,t),estimateFeesPerGas:t=>Yg(e,t),getFilterChanges:t=>Is(e,t),getFilterLogs:t=>Vv(e,t),getGasPrice:()=>ua(e),getLogs:t=>ga(e,t),getProof:t=>F6(e,t),estimateMaxPriorityFeePerGas:t=>Zg(e,t),fillTransaction:t=>Af(e,t),getStorageAt:t=>R6(e,t),getTransaction:t=>pc(e,t),getTransactionConfirmations:t=>j6(e,t),getTransactionCount:t=>yf(e,t),getTransactionReceipt:t=>Ls(e,t),multicall:t=>z6(e,t),prepareTransactionRequest:t=>Cf(e,t),readContract:t=>Lt(e,t),sendRawTransaction:t=>fv(e,t),sendRawTransactionSync:t=>b5(e,t),simulate:t=>hc(e,t),simulateBlocks:t=>hc(e,t),simulateCalls:t=>Y6(e,t),simulateContract:t=>rv(e,t),verifyHash:t=>js(e,t),verifyMessage:t=>s5(e,t),verifySiweMessage:t=>m5(e,t),verifyTypedData:t=>i5(e,t),uninstallFilter:t=>$s(e,t),waitForTransactionReceipt:t=>a5(e,t),watchBlocks:t=>c5(e,t),watchBlockNumber:t=>g0(e,t),watchContractEvent:t=>uv(e,t),watchEvent:t=>l5(e,t),watchPendingTransactions:t=>u5(e,t)}}function y5(e){const{key:t="public",name:n="Public Client"}=e;return pv({...e,key:t,name:n,type:"publicClient"}).extend(g5)}function v5({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:c},a){const l=pd();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:c},request:qv(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:a}}class w5 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 x5(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:i,name:c="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:l,retryDelay:u,raw:f}=t;return({chain:p,retryCount:d,timeout:h})=>{const{batchSize:m=1e3,wait:w=0}=typeof n=="object"?n:{},P=t.retryCount??d,E=h??t.timeout??1e4,T=e||(p==null?void 0:p.rpcUrls.default.http[0]);if(!T)throw new w5;const A=ow(T,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:l,timeout:E});return v5({key:s,methods:i,name:c,async request({method:D,params:F}){const L={method:D,params:F},{schedule:b}=ld({id:T,wait:w,shouldSplitBatch(O){return O.length>m},fn:O=>A.request({body:O}),sort:(O,$)=>O.id-$.id}),g=async O=>n?b(O):[await A.request({body:O})],[{error:x,result:I}]=await g(L);if(f)return{error:x,result:I};if(x)throw new Ji({body:L,error:x,url:T});return I},retryCount:P,retryDelay:u,timeout:E,type:"http"},{fetchOptions:o,url:T})}}const E5=tw({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 S5({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,c]=y.useState(null),[a,l]=y.useState(o);return y.useEffect(()=>{let u,f;const p=async()=>{try{const d=await e.readContract({address:t,abi:Cr,functionName:"balanceOf",args:[n]});c(d),l(Zi(d,r))}catch{l(o)}};p();try{u=e.watchContractEvent({address:t,abi:Cr,eventName:"Transfer",args:{to:n},onLogs:()=>{p()},poll:!0,pollingInterval:s}),f=e.watchContractEvent({address:t,abi:Cr,eventName:"Transfer",args:{from:n},onLogs:()=>{p()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),f==null||f()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const P5=()=>({openDeposit:y.useCallback(t=>{},[])}),T5=()=>({openWithdraw:y.useCallback(t=>{},[])}),pn="MPC",zs="EVM";var _e=(e=>(e.SPOT="spot",e.PERPETUAL="perpetual",e.PERPETUALV2="perpetual_v2",e))(_e||{});const A5="spot";/**
87
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(vs,"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 To extends V{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ws(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof V?e.walk(o=>(o==null?void 0:o.code)===Pr.code):e;return r instanceof V?new Pr({cause:e,message:r.details}):Pr.nodeMessage.test(n)?new Pr({cause:e,message:e.details}):ys.nodeMessage.test(n)?new ys({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Qi.nodeMessage.test(n)?new Qi({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):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,nonce:t==null?void 0:t.nonce}):ra.nodeMessage.test(n)?new ra({cause:e}):oa.nodeMessage.test(n)?new oa({cause:e,gas:t==null?void 0:t.gas}):sa.nodeMessage.test(n)?new sa({cause:e,gas:t==null?void 0:t.gas}):ia.nodeMessage.test(n)?new ia({cause:e}):vs.nodeMessage.test(n)?new vs({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new To({cause:e})}function Wg(e,{docsPath:t,...n}){const r=(()=>{const o=ws(e,n);return o instanceof To?e:o})();return new _g(r,{docsPath:t,...n})}function xs(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 Vg={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Ao(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Hg(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=>Oe(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=ne(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=ne(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=ne(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=ne(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=ne(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=ne(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Vg[e.type]),typeof e.value<"u"&&(n.value=ne(e.value)),n}function Hg(e){return e.map(t=>({address:t.address,r:t.r?ne(BigInt(t.r)):t.r,s:t.s?ne(BigInt(t.s)):t.s,chainId:ne(t.chainId),nonce:ne(t.nonce),...typeof t.yParity<"u"?{yParity:ne(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:ne(t.v)}:{}}))}function ff(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Eu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Eu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Gg(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=ne(t)),n!==void 0&&(i.nonce=ne(n)),r!==void 0&&(i.state=ff(r)),o!==void 0){if(i.state)throw new Pg;i.stateDiff=ff(o)}return i}function aa(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ht(n,{strict:!1}))throw new Pn({address:n});if(t[n])throw new Sg({address:n});t[n]=Gg(r)}return t}const df=2n**256n-1n;function Tr(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?it(t):void 0;if(s&&!ht(s.address))throw new Pn({address:s.address});if(o&&!ht(o))throw new Pn({address:o});if(n&&n>df)throw new ys({maxFeePerGas:n});if(r&&n&&r>n)throw new vs({maxFeePerGas:n,maxPriorityFeePerGas:r})}class pf extends V{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class ca extends V{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class qg extends V{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ke(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class hf 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 mf={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function la(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?rn(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?rn(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?mf[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=Kg(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 Kg(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 bf(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:la(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 Mt(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?ne(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 hf({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)||bf)(c,"getBlock")}async function ua(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Zg(e,t){return gf(e,t)}async function gf(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 te(e,Mt,"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 Ut(a)}catch{const[c,a]=await Promise.all([n?Promise.resolve(n):te(e,Mt,"getBlock")({}),te(e,ua,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new ca;const l=a-c.baseFeePerGas;return l<0n?0n:l}}async function Yg(e,t){return fa(e,t)}async function fa(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 pf;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 te(e,Mt,"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 ca;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await gf(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 te(e,ua,"getGasPrice")({}))}}async function yf(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?ne(r):n]},{dedupe:!!r});return rn(o)}function vf(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=>_t(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Oe(s))}function wf(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=>_t(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>_t(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=>Oe(i))}function Xg(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 Jg(e,t,n){return e&t^~e&n}function Qg(e,t,n){return e&t^e&n^t&n}class ey extends ji{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=Ri(this.buffer)}update(t){br(this),t=ds(t),_n(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=Ri(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){br(this),Nu(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,gr(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let f=i;f<o;f++)n[f]=0;Xg(r,o-8,BigInt(this.length*8),s),this.process(r,0);const c=Ri(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 Cn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ty=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]),On=new Uint32Array(64);class ny extends ey{constructor(t=32){super(64,t,8,!1),this.A=Cn[0]|0,this.B=Cn[1]|0,this.C=Cn[2]|0,this.D=Cn[3]|0,this.E=Cn[4]|0,this.F=Cn[5]|0,this.G=Cn[6]|0,this.H=Cn[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)On[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=On[f-15],d=On[f-2],h=Wt(p,7)^Wt(p,18)^p>>>3,m=Wt(d,17)^Wt(d,19)^d>>>10;On[f]=m+On[f-7]+h+On[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=Wt(c,6)^Wt(c,11)^Wt(c,25),d=u+p+Jg(c,a,l)+ty[f]+On[f]|0,m=(Wt(r,2)^Wt(r,13)^Wt(r,22))+Qg(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(){gr(On)}destroy(){this.set(0,0,0,0,0,0,0,0),gr(this.buffer)}}const xf=Ou(()=>new ny),ry=xf;function oy(e,t){return ry(Ot(e,{strict:!1})?hr(e):e)}function sy(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=oy(t);return o.set([n],0),r==="bytes"?o:Oe(o)}function iy(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(sy({commitment:s,to:r,version:n}));return o}const Ef=6,Sf=32,da=4096,Pf=Sf*da,Tf=Pf*Ef-1-1*da*Ef;class ay extends V{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class cy extends V{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function ly(e){const t=typeof e.data=="string"?_t(e.data):e.data,n=Ee(t);if(!n)throw new cy;if(n>Tf)throw new ay({maxSize:Tf,size:n});const r=[];let o=!0,s=0;for(;o;){const i=qi(new Uint8Array(Pf));let c=0;for(;c<da;){const a=t.slice(s,s+(Sf-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=>Oe(i.bytes))}function uy(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??ly({data:t}),s=e.commitments??vf({blobs:o,kzg:n,to:r}),i=e.proofs??wf({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 fy(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 Ag({transaction:e})}function dy(e,{docsPath:t,...n}){const r=(()=>{const o=ws(e,n);return o instanceof To?e:o})();return new Ng(r,{docsPath:t,...n})}async function pa(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return rn(t)}async function Af(e,t){var b,g,x,I,O;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,A=await(async()=>{if(!n||!m||typeof h<"u")return h;const k=it(n),M=s?s.id:await te(e,pa,"getChainId")({});return await m.consume({address:k.address,chainId:M,client:e})})();Tr(t);const D=(g=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:g.format,L=(D||Ao)({...xs(S,{format:D}),account:n?it(n):void 0,accessList:r,authorizationList:o,blobs:c,blobVersionedHashes:i,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:d,nonce:A,to:v,type:T,value:E},"fillTransaction");try{const k=await e.request({method:"eth_fillTransaction",params:[L]}),w=(((I=(x=s==null?void 0:s.formatters)==null?void 0:x.transaction)==null?void 0:I.format)||la)(k.tx);delete w.blockHash,delete w.blockNumber,delete w.r,delete w.s,delete w.transactionIndex,delete w.v,delete w.yParity,w.data=w.input,w.gas&&(w.gas=t.gas??w.gas),w.gasPrice&&(w.gasPrice=t.gasPrice??w.gasPrice),w.maxFeePerBlobGas&&(w.maxFeePerBlobGas=t.maxFeePerBlobGas??w.maxFeePerBlobGas),w.maxFeePerGas&&(w.maxFeePerGas=t.maxFeePerGas??w.maxFeePerGas),w.maxPriorityFeePerGas&&(w.maxPriorityFeePerGas=t.maxPriorityFeePerGas??w.maxPriorityFeePerGas),w.nonce&&(w.nonce=t.nonce??w.nonce);const N=await(async()=>{var j,U;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const _=await te(e,Mt,"getBlock")({});return s.fees.baseFeeMultiplier({block:_,client:e,request:t})}return((U=s==null?void 0:s.fees)==null?void 0:U.baseFeeMultiplier)??1.2})();if(N<1)throw new pf;const P=10**(((O=N.toString().split(".")[1])==null?void 0:O.length)??0),B=j=>j*BigInt(Math.ceil(N*P))/BigInt(P);return w.maxFeePerGas&&!t.maxFeePerGas&&(w.maxFeePerGas=B(w.maxFeePerGas)),w.gasPrice&&!t.gasPrice&&(w.gasPrice=B(w.gasPrice)),{raw:k.raw,transaction:{from:L.from,...w}}}catch(k){throw dy(k,{...t,chain:e.chain})}}const py=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Nf=new Map,ha=new hs(128);async function Cf(e,t){var A,D,F;let n=t;const{account:r=e.account,chain:o=e.chain,nonceManager:s,parameters:i=py}=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 te(e,pa,"getChainId")({}),a))}const u=r&&it(r);let f=n.nonce;if(i.includes("nonce")&&typeof f>"u"&&u&&s){const L=await l();f=await s.consume({address:u.address,chainId:L,client:e})}c!=null&&c.fn&&((A=c.runAt)!=null&&A.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||ha.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 te(e,Af,"fillTransaction")({...n,nonce:f}).then(L=>{const{chainId:b,from:g,gas:x,gasPrice:I,nonce:O,maxFeePerBlobGas:k,maxFeePerGas:M,maxPriorityFeePerGas:w,type:N,...$}=L.transaction;return ha.set(e.uid,!0),{...n,...g?{from:g}:{},...N?{type:N}:{},...typeof b<"u"?{chainId:b}:{},...typeof x<"u"?{gas:x}:{},...typeof I<"u"?{gasPrice:I}:{},...typeof O<"u"?{nonce:O}:{},...typeof k<"u"?{maxFeePerBlobGas:k}:{},...typeof M<"u"?{maxFeePerGas:M}:{},...typeof w<"u"?{maxPriorityFeePerGas:w}:{},..."nonceKey"in $&&typeof $.nonceKey<"u"?{nonceKey:$.nonceKey}:{}}}).catch(L=>{var x;const b=L;return((x=b.walk)==null?void 0:x.call(b,I=>{const O=I;return O.name==="MethodNotFoundRpcError"||O.name==="MethodNotSupportedRpcError"}))&&ha.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&&((D=c.runAt)!=null&&D.includes("beforeFillParameters"))&&(n=await c.fn(n,{phase:"beforeFillParameters"}));let E;async function S(){return E||(E=await te(e,Mt,"getBlock")({blockTag:"latest"}),E)}if(i.includes("nonce")&&typeof f>"u"&&u&&!s&&(n.nonce=await te(e,yf,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&v){const L=vf({blobs:h,kzg:v});if(i.includes("blobVersionedHashes")){const b=iy({commitments:L,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=wf({blobs:h,commitments:L,kzg:v}),g=uy({blobs:h,commitments:L,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=fy(n)}catch{let L=Nf.get(e.uid);if(typeof L>"u"){const b=await S();L=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",Nf.set(e.uid,L)}n.type=L?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const L=await S(),{maxFeePerGas:b,maxPriorityFeePerGas:g}=await fa(e,{block:L,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<g)throw new qg({maxPriorityFeePerGas:g});n.maxPriorityFeePerGas=g,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new ca;if(typeof n.gasPrice>"u"){const L=await S(),{gasPrice:b}=await fa(e,{block:L,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await te(e,ma,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((F=c.runAt)!=null&&F.includes("afterFillParameters"))&&(n=await c.fn(n,{phase:"afterFillParameters"})),Tr(n),delete n.parameters,n}async function ma(e,t){var i,c,a;const{account:n=e.account,prepare:r=!0}=t,o=n?it(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 uf({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:A,maxPriorityFeePerGas:D,nonce:F,value:L,stateOverride:b,...g}=r?await Cf(e,{...t,parameters:s,to:l}):t;if(T&&t.gas!==T)return T;const I=(typeof h=="bigint"?ne(h):void 0)||m,O=aa(b);Tr(t);const k=(a=(c=(i=e.chain)==null?void 0:i.formatters)==null?void 0:c.transactionRequest)==null?void 0:a.format,w=(k||Ao)({...xs(g,{format:k}),account:o,accessList:u,authorizationList:f,blobs:p,blobVersionedHashes:d,data:v,gasPrice:E,maxFeePerBlobGas:S,maxFeePerGas:A,maxPriorityFeePerGas:D,nonce:F,to:l,value:L},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:O?[w,I??e.experimental_blockTag??"latest",O]:I?[w,I]:[w]}))}catch(l){throw Wg(l,{...t,account:o,chain:e.chain})}}async function hy(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:i,...c}=t,a=$t({abi:n,args:o,functionName:s});try{return await te(e,ma,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...c})}catch(l){const u=c.account?it(c.account):void 0;throw Sr(l,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}function No(e,t){if(!ht(e,{strict:!1}))throw new Pn({address:e});if(!ht(t,{strict:!1}))throw new Pn({address:t});return e.toLowerCase()===t.toLowerCase()}const Of="/docs/contract/decodeEventLog";function Es(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...c]=o;if(!i)throw new t1({docsPath:Of});const a=t.find(m=>m.type==="event"&&i===ps(Ct(m)));if(!(a&&"name"in a)||a.type!=="event")throw new n1(i,{docsPath:Of});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 Fi({abiItem:a,param:v});p[f?T:v.name||T]=my({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=eo(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 hu||m instanceof Zu?new us({abiItem:a,data:n,params:h,size:Ee(n)}):m}else if(s)throw new us({abiItem:a,data:"0x",params:h,size:0})}return{eventName:l,args:Object.values(p).length>0?p:void 0}}function my({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(eo([e],t)||[])[0]}function ba(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]===ps(f));if(c.length===0)return null;let a,l;for(const f of c)try{a=Es({...i,abi:[f],strict:!0}),l=f;break}catch{}if(!a&&!o){l=c[0];try{a=Es({...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)||!by({args:a.args,inputs:l.inputs,matchArgs:n})?null:{...a,...i}}).filter(Boolean)}function by(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"?No(i,c):s.type==="string"||s.type==="bytes"?Fe(hr(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 an(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 ga(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=>Qr({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"?ne(r):r,toBlock:typeof o=="bigint"?ne(o):o}]});const d=p.map(h=>an(h));return u?ba({abi:u,args:c,logs:d,strict:l}):d}async function If(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:c,toBlock:a,strict:l}=t,u=i?Wn({abi:n,name:i}):void 0,f=u?void 0:n.filter(p=>p.type==="event");return te(e,ga,"getLogs")({address:r,args:o,blockHash:s,event:u,events:f,fromBlock:c,toBlock:a,strict:l})}const ya="/docs/contract/decodeFunctionResult";function qn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const c=Wn({abi:t,args:n,name:r});if(!c)throw new dr(r,{docsPath:ya});s=c}if(s.type!=="function")throw new dr(void 0,{docsPath:ya});if(!s.outputs)throw new yu(s.name,{docsPath:ya});const i=eo(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 va=BigInt(0),wa=BigInt(1);function Co(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function xa(e){if(!Co(e))throw new Error("Uint8Array expected")}function Oo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Ss(e){const t=e.toString(16);return t.length&1?"0"+t:t}function kf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?va:BigInt("0x"+e)}const $f=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",gy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Io(e){if(xa(e),$f)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=gy[e[n]];return t}const cn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Mf(e){if(e>=cn._0&&e<=cn._9)return e-cn._0;if(e>=cn.A&&e<=cn.F)return e-(cn.A-10);if(e>=cn.a&&e<=cn.f)return e-(cn.a-10)}function Ps(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if($f)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=Mf(e.charCodeAt(s)),c=Mf(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 Kn(e){return kf(Io(e))}function Df(e){return xa(e),kf(Io(Uint8Array.from(e).reverse()))}function ko(e,t){return Ps(e.toString(16).padStart(t*2,"0"))}function Bf(e,t){return ko(e,t).reverse()}function mt(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(Co(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 Ts(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];xa(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 Ea=e=>typeof e=="bigint"&&va<=e;function Sa(e,t,n){return Ea(e)&&Ea(t)&&Ea(n)&&t<=e&&e<n}function Ar(e,t,n,r){if(!Sa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function yy(e){let t;for(t=0;e>va;e>>=wa,t+=1);return t}const As=e=>(wa<<BigInt(e))-wa,Pa=e=>new Uint8Array(e),Lf=e=>Uint8Array.from(e);function vy(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=Pa(e),o=Pa(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},c=(...f)=>n(o,r,...f),a=(f=Pa(0))=>{o=c(Lf([0]),f),r=c(),f.length!==0&&(o=c(Lf([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 Ts(...p)};return(f,p)=>{i(),a(f);let d;for(;!(d=p(l()));)a();return i(),d}}const wy={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"||Co(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 Ns(e,t,n={}){const r=(o,s,i)=>{const c=wy[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 Ff(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 xy="0.1.1";function Ey(){return xy}class le extends Error{constructor(t,n={}){const r=(()=>{var a;if(n.cause instanceof le){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 le&&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@${Ey()}`}),this.cause=n.cause,this.details=r,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return Rf(this,t)}}function Rf(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Rf(e.cause,t):t?null:e}function $o(e,t){if(Nr(e)>t)throw new jy({givenSize:Nr(e),maxSize:t})}const ln={zero:48,nine:57,A:65,F:70,a:97,f:102};function jf(e){if(e>=ln.zero&&e<=ln.nine)return e-ln.zero;if(e>=ln.A&&e<=ln.F)return e-(ln.A-10);if(e>=ln.a&&e<=ln.f)return e-(ln.a-10)}function Sy(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new zy({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 zf(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 Cs(e,t){if(ct(e)>t)throw new Gy({givenSize:ct(e),maxSize:t})}function Py(e,t){if(typeof t=="number"&&t>0&&t>ct(e)-1)throw new Xf({offset:t,position:"start",size:ct(e)})}function Ty(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ct(e)!==n-t)throw new Xf({offset:n,position:"end",size:ct(e)})}function Uf(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 qy({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const Ay="#__bigint";function _f(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+Ay:o,n)}const Ny=new TextDecoder,Cy=new TextEncoder;function Oy(e){return e instanceof Uint8Array?e:typeof e=="string"?Wf(e):Iy(e)}function Iy(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Wf(e,t={}){const{size:n}=t;let r=e;n&&(Cs(e,n),r=Yn(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=jf(o.charCodeAt(a++)),u=jf(o.charCodeAt(a++));if(l===void 0||u===void 0)throw new le(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[c]=l*16+u}return i}function ky(e,t={}){const{size:n}=t,r=Cy.encode(e);return typeof n=="number"?($o(r,n),$y(r,n)):r}function $y(e,t){return Sy(e,{dir:"right",size:t})}function Nr(e){return e.length}function My(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Dy(e,t={}){const{size:n}=t;typeof n<"u"&&$o(e,n);const r=Bt(e,t);return Gf(r,t)}function By(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&($o(r,n),r=Vf(r)),r.length>1||r[0]>1)throw new Ry(r);return!!r[0]}function un(e,t={}){const{size:n}=t;typeof n<"u"&&$o(e,n);const r=Bt(e,t);return qf(r,t)}function Ly(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&($o(r,n),r=Fy(r)),Ny.decode(r)}function Vf(e){return zf(e,{dir:"left"})}function Fy(e){return zf(e,{dir:"right"})}class Ry extends le{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 jy=class extends le{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"})}},zy=class extends le{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 Uy=new TextEncoder,_y=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Wy(e,t={}){const{strict:n=!1}=t;if(!e)throw new Zf(e);if(typeof e!="string")throw new Zf(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Yf(e);if(!e.startsWith("0x"))throw new Yf(e)}function Dt(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Vy(e){return e instanceof Uint8Array?Bt(e):Array.isArray(e)?Bt(new Uint8Array(e)):e}function Hf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Cs(n,t.size),Zn(n,t.size)):n}function Bt(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=_y[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(Cs(r,t.size),Yn(r,t.size)):r}function ze(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 Kf({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?Zn(a,r):a}function Ta(e,t={}){return Bt(Uy.encode(e),t)}function Zn(e,t){return Uf(e,{dir:"left",size:t})}function Yn(e,t){return Uf(e,{dir:"right",size:t})}function Vt(e,t,n,r={}){const{strict:o}=r;Py(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&Ty(s,t,n),s}function ct(e){return Math.ceil((e.length-2)/2)}function Gf(e,t={}){const{signed:n}=t;t.size&&Cs(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 qf(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:Gf(e,t))}function Hy(e,t={}){const{strict:n=!1}=t;try{return Wy(e,{strict:n}),!0}catch{return!1}}class Kf extends le{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 Zf extends le{constructor(t){super(`Value \`${typeof t=="object"?_f(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 Yf extends le{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 Gy extends le{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 Xf extends le{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 qy extends le{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 Ky(e){return{address:e.address,amount:ze(e.amount),index:ze(e.index),validatorIndex:ze(e.validatorIndex)}}function Jf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:ze(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:ze(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:ze(e.gasLimit)},...typeof e.number=="bigint"&&{number:ze(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:ze(e.prevRandao)},...typeof e.time=="bigint"&&{time:ze(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Ky)}}}const Os=[{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"}],Aa=[{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"}]}],Qf=[{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"}],ed=[...Qf,{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"}]}],Zy=[...Qf,{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"}]}],td=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],nd=[{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"}]}],rd=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],od=[{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"}],Cr=[{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"}]}],Yy="0x82ad56cb",sd="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Xy="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Jy="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Na="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Ca 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 id extends V{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Oa="/docs/contract/encodeDeployData";function Ia(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 Yb({docsPath:Oa});if(!("inputs"in o))throw new pu({docsPath:Oa});if(!o.inputs||o.inputs.length===0)throw new pu({docsPath:Oa});const s=An(o.inputs,n);return yr([r,s])}function Or({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 Ca({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Ca({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function ad(e,{docsPath:t,...n}){const r=(()=>{const o=ws(e,n);return o instanceof To?e:o})();return new nf(r,{docsPath:t,...n})}function cd(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const ka=new Map;function ld({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=()=>ka.delete(t),c=()=>a().map(({args:u})=>u),a=()=>ka.get(t)||[],l=u=>ka.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:f,resolve:p,reject:d}=cd();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 Mo(e,t){var k,M,w,N;const{account:n=e.account,authorizationList:r,batch:o=!!((k=e.batch)!=null&&k.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:A,value:D,stateOverride:F,...L}=t,b=n?it(n):void 0;if(u&&(p||d))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,x=p&&d&&A&&f,I=g||x,O=g?ud({code:u,data:f}):x?tv({data:f,factory:p,factoryData:d,to:A}):f;try{Tr(t);const P=(typeof s=="bigint"?ne(s):void 0)||i,B=l?Jf(l):void 0,j=aa(F),U=(N=(w=(M=e.chain)==null?void 0:M.formatters)==null?void 0:w.transactionRequest)==null?void 0:N.format,q=(U||Ao)({...xs(L,{format:U}),accessList:c,account:b,authorizationList:r,blobs:a,data:O,gas:h,gasPrice:m,maxFeePerBlobGas:v,maxFeePerGas:T,maxPriorityFeePerGas:E,nonce:S,to:I?void 0:A,value:D},"call");if(o&&Qy({request:q})&&!j&&!B)try{return await ev(e,{...q,blockNumber:s,blockTag:i})}catch(W){if(!(W instanceof id)&&!(W instanceof Ca))throw W}const Z=(()=>{const W=[q,P];return j&&B?[...W,j,B]:j?[...W,j]:B?[...W,{},B]:W})(),H=await e.request({method:"eth_call",params:Z});return H==="0x"?{data:void 0}:{data:H}}catch($){const P=nv($),{offchainLookup:B,offchainLookupSignature:j}=await Promise.resolve().then(()=>ew);if(e.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===j&&A)return{data:await B(e,{data:P,to:A})};throw I&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new $g({factory:p}):ad($,{...t,account:b,chain:e.chain})}}function Qy({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Yy)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function ev(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 Or({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new id})(),f=(typeof s=="bigint"?ne(s):void 0)||i,{schedule:p}=ld({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(A=>({allowFailure:!0,callData:A.data,target:A.to})),E=$t({abi:Os,args:[T],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...l===null?{data:ud({code:Na,data:E})}:{to:l,data:E}},f]});return qn({abi:Os,args:[T],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:d,success:h}]=await p({data:c,to:a});if(!h)throw new gs({data:d});return d==="0x"?{data:void 0}:{data:d}}function ud(e){const{code:t,data:n}=e;return Ia({abi:cu(["constructor(bytes, bytes)"]),bytecode:sd,args:[t,n]})}function tv(e){const{data:t,factory:n,factoryData:r,to:o}=e;return Ia({abi:cu(["constructor(address, bytes, address, bytes)"]),bytecode:Xy,args:[o,t,n,r]})}function nv(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 Lt(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,c=$t({abi:n,args:o,functionName:s});try{const{data:a}=await te(e,Mo,"call")({...i,data:c,to:r});return qn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw Sr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function rv(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:i,...c}=t,a=c.account?it(c.account):e.account,l=$t({abi:n,args:o,functionName:i});try{const{data:u}=await te(e,Mo,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:r,...c,account:a}),f=qn({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 Sr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:a==null?void 0:a.address})}}const $a=new Map,fd=new Map;let ov=0;function In(e,t,n){const r=++ov,o=()=>$a.get(e)||[],s=()=>{const u=o();$a.set(e,u.filter(f=>f.id!==r))},i=()=>{const u=o();if(!u.some(p=>p.id===r))return;const f=fd.get(e);if(u.length===1&&f){const p=f();p instanceof Promise&&p.catch(()=>{})}s()},c=o();if($a.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"&&fd.set(e,l),i}async function Ma(e){return new Promise(t=>setTimeout(t,e))}function Do(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 Ma(a);const l=async()=>{o&&(await e({unpoll:s}),await Ma(r),l())};l()})(),s}const sv=new Map,iv=new Map;function av(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,sv),r=t(e,iv);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function cv(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=av(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 lv=e=>`blockNumber.${e}`;async function Bo(e,{cacheTime:t=e.cacheTime}={}){const n=await cv(()=>e.request({method:"eth_blockNumber"}),{cacheKey:lv(e.uid),cacheTime:t});return BigInt(n)}async function Is(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=>an(s));return!("abi"in t)||!t.abi?o:ba({abi:t.abi,logs:o,strict:n})}async function ks(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function uv(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=Ie(["watchContractEvent",r,o,s,e.uid,i,f,v,c]);return In(T,{onLogs:l,onError:a},E=>{let S;c!==void 0&&(S=c-1n);let A,D=!1;const F=Do(async()=>{var L;if(!D){try{A=await te(e,Hu,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:v,fromBlock:c})}catch{}D=!0;return}try{let b;if(A)b=await te(e,Is,"getFilterChanges")({filter:A});else{const g=await te(e,Bo,"getBlockNumber")({});S&&S<g?b=await te(e,If,"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){A&&b instanceof Nn&&(D=!1),(L=E.onError)==null||L.call(E,b)}},{emitOnBegin:!0,interval:f});return async()=>{A&&await te(e,ks,"uninstallFilter")({filter:A}),F()}})})():(()=>{const v=p??!1,T=Ie(["watchContractEvent",r,o,s,e.uid,i,f,v]);let E=!0,S=()=>E=!1;return In(T,{onLogs:l,onError:a},A=>((async()=>{try{const D=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(g=>g.config.type==="webSocket"||g.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),F=i?Qr({abi:n,eventName:i,args:o}):[],{unsubscribe:L}=await D.subscribe({params:["logs",{address:r,topics:F}],onData(b){var x;if(!E)return;const g=b.result;try{const{eventName:I,args:O}=Es({abi:n,data:g.data,topics:g.topics,strict:p}),k=an(g,{args:O,eventName:I});A.onLogs([k])}catch(I){let O,k;if(I instanceof us||I instanceof Fi){if(p)return;O=I.abiItem.name,k=(x=I.abiItem.inputs)==null?void 0:x.some(w=>!("name"in w&&w.name))}const M=an(g,{args:k?[]:{},eventName:O});A.onLogs([M])}},onError(b){var g;(g=A.onError)==null||g.call(A,b)}});S=L,E||S()}catch(D){a==null||a(D)}})(),()=>S()))})()}async function fv(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 Ma(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 dv={"0x0":"reverted","0x1":"success"};function dd(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=>an(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?rn(e.transactionIndex):null,status:e.status?dv[e.status]:null,type:e.type?mf[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Ba=256;let $s=Ba,Ms;function pd(e=11){if(!Ms||$s+e>Ba*2){Ms="",$s=0;for(let t=0;t<Ba;t++)Ms+=(256+Math.random()*256|0).toString(16).substring(1)}return Ms.substring($s,$s+++e)}function pv(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?it(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:pd(),...c?{experimental_blockTag:c}:{}};function E(S){return A=>{const D=A(S);for(const L in T)delete D[L];const F={...S,...D};return Object.assign(F,{extend:E(F)})}}return Object.assign(T,{extend:E(T)})}function La(e){var n,r,o,s,i,c;if(!(e instanceof V))return!1;const t=e.walk(a=>a instanceof Xi);return t instanceof Xi?((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 hv(e){const{abi:t,data:n}=e,r=vr(n,0,4),o=t.find(s=>s.type==="function"&&r===Jr(Ct(s)));if(!o)throw new r1(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?eo(o.inputs,vr(n,4)):void 0}}const Fa="/docs/contract/encodeErrorResult";function hd(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Wn({abi:t,args:r,name:n});if(!a)throw new mu(n,{docsPath:Fa});o=a}if(o.type!=="error")throw new mu(void 0,{docsPath:Fa});const s=Ct(o),i=Jr(s);let c="0x";if(r&&r.length>0){if(!o.inputs)throw new e1(o.name,{docsPath:Fa});c=An(o.inputs,r)}return yr([i,c])}const Ra="/docs/contract/encodeFunctionResult";function mv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Wn({abi:t,name:n});if(!i)throw new dr(n,{docsPath:Ra});o=i}if(o.type!=="function")throw new dr(void 0,{docsPath:Ra});if(!o.outputs)throw new yu(o.name,{docsPath:Ra});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new vu(r)})();return An(o.outputs,s)}const Lo="x-batch-gateway:true";async function md(e){const{data:t,ccipRequest:n}=e,{args:[r]}=hv({abi:Aa,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,c)=>{try{s[c]=i.urls.includes(Lo)?await md({data:i.data,ccipRequest:n}):await n(i),o[c]=!1}catch(a){o[c]=!0,s[c]=bv(a)}})),mv({abi:Aa,functionName:"query",result:[o,s]})}function bv(e){return e.name==="HttpRequestError"&&e.status?hd({abi:Aa,errorName:"HttpError",args:[e.status,e.shortMessage]}):hd({abi:[qu],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function bd(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Ot(t)?t:null}function ja(e){let t=new Uint8Array(32).fill(0);if(!e)return Oe(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=bd(n[r]),s=o?hr(o):Fe(Un(n[r]),"bytes");t=Fe(kt([t,s]),"bytes")}return Oe(t)}function gv(e){return`[${e.slice(2)}]`}function yv(e){const t=new Uint8Array(32).fill(0);return e?bd(e)||Fe(Un(e)):Oe(t)}function za(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Un(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=Un(o[s]);i.byteLength>255&&(i=Un(gv(yv(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 vv(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 Or({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?[ja(s),BigInt(o)]:[ja(s)];try{const p=$t({abi:nd,functionName:"addr",args:f}),d={address:l,abi:ed,functionName:"resolveWithGateways",args:[Sn(za(s)),p,i??[Lo]],blockNumber:n,blockTag:r},m=await te(e,Lt,"readContract")(d);if(m[0]==="0x")return null;const v=qn({abi:nd,args:f,functionName:"addr",data:m[0]});return v==="0x"||zn(v)==="0x00"?null:v}catch(p){if(c)throw p;if(La(p))return null;throw p}}class wv 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 Fo extends V{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class Ua 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 xv extends V{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Ev=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Sv=/^(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>\/.*)?$/,Pv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Tv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Av(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 gd(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function yd({uri:e,gatewayUrls:t}){const n=Pv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=gd(t==null?void 0:t.ipfs,"https://ipfs.io"),o=gd(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(Ev),{protocol:i,subpath:c,target:a,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||c==="ipns/",f=i==="ipfs:/"||c==="ipfs/"||Sv.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(Tv,"");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 Ua({uri:e})}function vd(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new wv({data:e});return e.image||e.image_url||e.image_data}async function Nv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await _a({gatewayUrls:e,uri:vd(n)})}catch{throw new Ua({uri:t})}}async function _a({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=yd({uri:t,gatewayUrls:e});if(r||await Av(n))return n;throw new Ua({uri:t})}function Cv(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 Fo({reason:"Only EIP-155 supported"});if(!i)throw new Fo({reason:"Chain ID not found"});if(!a)throw new Fo({reason:"Contract address not found"});if(!o)throw new Fo({reason:"Token ID not found"});if(!c)throw new Fo({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:c.toLowerCase(),contractAddress:a,tokenID:o}}async function Ov(e,{nft:t}){if(t.namespace==="erc721")return Lt(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 Lt(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 xv({namespace:t.namespace})}async function Iv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?kv(e,{gatewayUrls:t,record:n}):_a({uri:n,gatewayUrls:t})}async function kv(e,{gatewayUrls:t,record:n}){const r=Cv(n),o=await Ov(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:c}=yd({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 _a({uri:vd(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),Nv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function wd(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 Or({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:ed,args:[Sn(za(s)),$t({abi:td,functionName:"text",args:[ja(s),o]}),i??[Lo]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},d=await te(e,Lt,"readContract")(f);if(d[0]==="0x")return null;const h=qn({abi:td,functionName:"text",data:d[0]});return h===""?null:h}catch(f){if(c)throw f;if(La(f))return null;throw f}}async function $v(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:c}){const a=await te(e,wd,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:c,gatewayUrls:s,strict:i});if(!a)return null;try{return await Iv(e,{record:a,gatewayUrls:r})}catch{return null}}async function Mv(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 Or({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:Zy,args:[n,s,i??[Lo]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},f=te(e,Lt,"readContract"),[p]=await f(u);return p||null}catch(u){if(c)throw u;if(La(u))return null;throw u}}async function Dv(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 Or({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 te(e,Lt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Sn(za(o))],blockNumber:n,blockTag:r});return a}async function xd(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?it(n):void 0;try{Tr(t);const A=(typeof r=="bigint"?ne(r):void 0)||o,D=(E=(T=(v=e.chain)==null?void 0:v.formatters)==null?void 0:T.transactionRequest)==null?void 0:E.format,L=(D||Ao)({...xs(h,{format:D}),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:[L,A]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(S){throw ad(S,{...t,account:m,chain:e.chain})}}async function Bv(e){const t=bs(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function Ed(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:c}={}){const a=o??(r?[r]:void 0),l=bs(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(d=>Qr({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"?ne(s):s,toBlock:typeof c=="bigint"?ne(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 Sd(e){const t=bs(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Lv(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o=typeof n=="bigint"?ne(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Fv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Rv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?ne(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}),rn(s)}async function Wa(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?ne(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}class jv 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 zv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,c,a,l,u,f]=await te(e,Lt,"readContract")({abi:Uv,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 jv({address:n}):i}}const Uv=[{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 _v(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 Wv(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?ne(n):void 0,i=await e.request({method:"eth_feeHistory",params:[ne(t),s||r,o]},{dedupe:!!s});return _v(i)}async function Vv(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>an(s));return t.abi?ba({abi:t.abi,logs:o,strict:n}):o}async function Hv({address:e,authorization:t,signature:n}){return No(Tn(e),await uf({authorization:t,signature:n}))}const Ds=new hs(8192);function Gv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ds.get(n))return Ds.get(n);const r=e().finally(()=>Ds.delete(n));return Ds.set(n,r),r}function qv(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 Gn(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new Gn(new Error("method not supported"),{method:l});const u=o?Zr(`${a}.${Ie(n)}`):void 0;return Gv(()=>Da(async()=>{try{return await e(n)}catch(p){const d=p;switch(d.code){case oo.code:throw new oo(d);case so.code:throw new so(d);case io.code:throw new io(d,{method:n.method});case ao.code:throw new ao(d);case Hn.code:throw new Hn(d);case Nn.code:throw new Nn(d);case co.code:throw new co(d);case lo.code:throw new lo(d);case uo.code:throw new uo(d);case Gn.code:throw new Gn(d,{method:n.method});case xr.code:throw new xr(d);case fo.code:throw new fo(d);case Er.code:throw new Er(d);case po.code:throw new po(d);case ho.code:throw new ho(d);case mo.code:throw new mo(d);case bo.code:throw new bo(d);case go.code:throw new go(d);case yo.code:throw new yo(d);case vo.code:throw new vo(d);case wo.code:throw new wo(d);case xo.code:throw new xo(d);case Eo.code:throw new Eo(d);case So.code:throw new So(d);case Po.code:throw new Po(d);case 5e3:throw new Er(d);default:throw p instanceof V?p:new Dg(d)}}},{delay:({count:p,error:d})=>{var h;if(d&&d instanceof Vn){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})=>Kv(p)}),{enabled:o,id:u})}}function Kv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===xr.code||e.code===Hn.code:e instanceof Vn&&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 Zv 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=>` ${ro(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class Yv extends V{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${ro(n)}`,`Response: ${Ie(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Xv 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 Jv="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 Qv(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=Xu({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:Td;try{if(!No(o,i))throw new Xv({sender:i,to:o});const d=c.includes(Lo)?await md({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:c}),{data:h}=await Mo(e,{blockNumber:t,blockTag:n,data:kt([l,An([{type:"bytes"},{type:"bytes"}],[d,u])]),to:o});return h}catch(d){throw new Zv({callbackSelector:l,cause:d,data:r,extraData:u,sender:i,urls:c})}}async function Td({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 Vn({body:a,details:f!=null&&f.error?Ie(f.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Ot(f)){r=new Yv({result:f,url:i});continue}return f}catch(u){r=new Vn({body:a,details:u.message,url:i})}}throw r}const ew=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Td,offchainLookup:Qv,offchainLookupAbiItem:Pd,offchainLookupSignature:Jv},Symbol.toStringTag,{value:"Module"}));function tw(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function nw(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 rw(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Ad=rw();function ow(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 nw(async({signal:m})=>{const v={...a,body:Array.isArray(r)?Ie(r.map(A=>({jsonrpc:"2.0",id:A.id??Ad.take(),...A}))):Ie({jsonrpc:"2.0",id:r.id??Ad.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 of({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 Vn({body:r,details:Ie(h.error)||d.statusText,headers:d.headers,status:d.status,url:e});return h}catch(d){throw d instanceof Vn||d instanceof of?d:new Vn({body:r,cause:d,url:e})}}}}const sw=`Ethereum Signed Message:
89
+ `;function iw(e){const t=typeof e=="string"?Zr(e):typeof e.raw=="string"?e.raw:Oe(e.raw),n=Zr(`${sw}${Ee(t)}`);return kt([n,t])}function Nd(e,t){return Fe(iw(e),t)}class aw extends V{constructor({domain:t}){super(`Invalid domain "${Ie(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class cw 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 lw extends V{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function uw(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(Uu);if(p&&(typeof f=="number"||typeof f=="bigint")){const[m,v,T]=p;ne(f,{signed:v==="int",size:Number.parseInt(T,10)/8})}if(u==="address"&&typeof f=="string"&&!ht(f))throw new Pn({address:f});const d=u.match(X1);if(d){const[m,v]=d;if(v&&Ee(f)!==Number.parseInt(v,10))throw new s1({expectedSize:Number.parseInt(v,10),givenSize:Ee(f)})}const h=o[u];h&&(dw(u),s(h,f))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new aw({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new cw({primaryType:r,types:o})}function fw({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 dw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new lw({type:e})}function pw(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:fw({domain:t}),...e.types};uw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(hw({domain:t,types:o})),r!=="EIP712Domain"&&s.push(Cd({data:n,primaryType:r,types:o})),Fe(kt(s))}function hw({domain:e,types:t}){return Cd({data:e,primaryType:"EIP712Domain",types:t})}function Cd({data:e,primaryType:t,types:n}){const r=Od({data:e,primaryType:t,types:n});return Fe(r)}function Od({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[mw({primaryType:t,types:n})];for(const s of n[t]){const[i,c]=kd({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(c)}return An(r,o)}function mw({primaryType:e,types:t}){const n=Sn(bw({primaryType:e,types:t}));return Fe(n)}function bw({primaryType:e,types:t}){let n="";const r=Id({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 Id({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])Id({primaryType:s.type,types:t},n);return n}function kd({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Fe(Od({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},Fe(r)];if(n==="string")return[{type:"bytes32"},Fe(Sn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>kd({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},Fe(An(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class gw 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 Va={checksum:new gw(8192)}.checksum;function $d(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Lu(Oy(e));return n==="Bytes"?r:Bt(r)}const yw=/^0x[a-fA-F0-9]{40}$/;function Bs(e,t={}){const{strict:n=!0}=t;if(!yw.test(e))throw new Dd({address:e,cause:new vw});if(n){if(e.toLowerCase()===e)return;if(Md(e)!==e)throw new Dd({address:e,cause:new ww})}}function Md(e){if(Va.has(e))return Va.get(e);Bs(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=$d(ky(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 Va.set(e,o),o}function Ha(e,t={}){const{strict:n=!0}=t??{};try{return Bs(e,{strict:n}),!0}catch{return!1}}class Dd extends le{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 vw extends le{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 ww extends le{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const xw=/^(.*)\[([0-9]*)\]$/,Ew=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Bd=/^(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 Ir(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=Za(t.type);if(s){const[i,c]=s;return Pw(e,{...t,type:c},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return Cw(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return Sw(e,{checksum:r});if(t.type==="bool")return Tw(e);if(t.type.startsWith("bytes"))return Aw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Nw(e,t);if(t.type==="string")return Ow(e,{staticPosition:o});throw new Ja(t.type)}const Fd=32,Ga=32;function Sw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Md(s):s)(Bt(My(r,-20))),32]}function Pw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=un(e.readBytes(Ga)),l=s+a,u=l+Fd;e.setPosition(l);const f=un(e.readBytes(Fd)),p=Ro(t);let d=0;const h=[];for(let m=0;m<f;++m){e.setPosition(u+(p?m*32:d));const[v,T]=Ir(e,t,{checksumAddress:r,staticPosition:u});d+=T,h.push(v)}return e.setPosition(s+32),[h,32]}if(Ro(t)){const a=un(e.readBytes(Ga)),l=s+a,u=[];for(let f=0;f<o;++f){e.setPosition(l+f*32);const[p]=Ir(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]=Ir(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,c.push(l)}return[c,i]}function Tw(e){return[By(e.readBytes(32),{size:32}),32]}function Aw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=un(e.readBytes(32));e.setPosition(n+i);const c=un(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(c);return e.setPosition(n+32),[Bt(a),32]}return[Bt(e.readBytes(Number.parseInt(o,10),32)),32]}function Nw(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?Dy(o,{signed:n}):un(o,{signed:n}),32]}function Cw(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(Ro(t)){const a=un(e.readBytes(Ga)),l=o+a;for(let u=0;u<t.components.length;++u){const f=t.components[u];e.setPosition(l+c);const[p,d]=Ir(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]=Ir(e,l,{checksumAddress:r,staticPosition:o});i[s?a:l==null?void 0:l.name]=u,c+=f}return[i,c]}function Ow(e,{staticPosition:t}){const n=un(e.readBytes(32)),r=t+n;e.setPosition(r);const o=un(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=Ly(Vf(s));return e.setPosition(t+32),[i,32]}function Iw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(qa({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function qa({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=Za(r.type);if(o){const[s,i]=o;return $w(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Fw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return kw(n,{checksum:e});if(r.type==="bool")return Dw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Bd.exec(r.type)??[];return Bw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Mw(n,{type:r.type});if(r.type==="string")return Lw(n);throw new Ja(r.type)}function Ka(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:c}=e[s];i?t+=32:t+=ct(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(ze(t+o,{size:32})),r.push(c),o+=ct(c)):n.push(c)}return Dt(...n,...r)}function kw(e,t){const{checksum:n=!1}=t;return Bs(e,{strict:n}),{dynamic:!1,encoded:Zn(e.toLowerCase())}}function $w(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new Gw(e);if(!s&&e.length!==r)throw new Hw({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const c=[];for(let a=0;a<e.length;a++){const l=qa({checksumAddress:n,parameter:o,value:e[a]});l.dynamic&&(i=!0),c.push(l)}if(s||i){const a=Ka(c);if(s){const l=ze(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?Dt(l,a):l}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Dt(...c.map(({encoded:a})=>a))}}function Mw(e,{type:t}){const[,n]=t.split("bytes"),r=ct(e);if(!n){let o=e;return r%32!==0&&(o=Yn(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Dt(Zn(ze(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new zd({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Yn(e)}}function Dw(e){if(typeof e!="boolean")throw new le(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Zn(Hf(e))}}function Bw(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 Kf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ze(e,{size:32,signed:t})}}function Lw(e){const t=Ta(e),n=Math.ceil(ct(t)/32),r=[];for(let o=0;o<n;o++)r.push(Yn(Vt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Dt(Yn(ze(ct(t),{size:32})),...r)}}function Fw(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=qa({checksumAddress:n,parameter:c,value:e[a]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?Ka(s):Dt(...s.map(({encoded:i})=>i))}}function Za(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ro(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(Ro);const n=Za(e.type);return!!(n&&Ro({...e,type:n[1]}))}const Rw={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 Uw({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new zw({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Rd({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 Rd({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 jw(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Rw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Rd extends le{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class zw extends le{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 Uw extends le{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"?Wf(t):t,i=jw(s);if(Nr(s)===0&&e.length>0)throw new Vw;if(Nr(s)&&Nr(s)<32)throw new Ww({data:typeof t=="string"?t:Bt(t),parameters:e,size:Nr(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]=Ir(i,u,{checksumAddress:o,staticPosition:0});c+=p,r==="Array"?a.push(f):a[u.name??l]=f}return a}function Ya(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new Ud({expectedLength:e.length,givenLength:t.length});const o=Iw({checksumAddress:r,parameters:e,values:t}),s=Ka(o);return s.length===0?"0x":s}function Xa(e,t){if(e.length!==t.length)throw new Ud({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(Xa.encode(o,s))}return Dt(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return Bs(a),Zn(a.toLowerCase(),o?32:0)}if(n==="string")return Ta(r);if(n==="bytes")return r;if(n==="bool")return Zn(Hf(r),o?32:1);const s=n.match(Bd);if(s){const[a,l,u="256"]=s,f=Number.parseInt(u,10)/8;return ze(r,{size:o?32:f,signed:l==="int"})}const i=n.match(Ew);if(i){const[a,l]=i;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new zd({expectedSize:Number.parseInt(l,10),value:r});return Yn(r,o?32:0)}const c=n.match(xw);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":Dt(...u)}throw new Ja(n)}e.encode=t})(Xa||(Xa={}));function jd(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?uu(e):e}class Ww extends le{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${ur(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Vw extends le{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Hw extends le{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 zd extends le{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ct(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class Ud extends le{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 Gw extends le{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class Ja extends le{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 _d extends ji{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,N1(t);const r=ds(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),gr(s)}update(t){return br(this),this.iHash.update(t),this}digestInto(t){br(this),_n(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 Wd=(e,t,n)=>new _d(e,t).update(n).digest();Wd.create=(e,t)=>new _d(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ye=BigInt(0),Ue=BigInt(1),Xn=BigInt(2),qw=BigInt(3),Vd=BigInt(4),Hd=BigInt(5),Gd=BigInt(8);function Xe(e,t){const n=e%t;return n>=Ye?n:t+n}function bt(e,t,n){let r=e;for(;t-- >Ye;)r*=r,r%=n;return r}function Qa(e,t){if(e===Ye)throw new Error("invert: expected non-zero number");if(t<=Ye)throw new Error("invert: expected positive modulus, got "+t);let n=Xe(e,t),r=t,o=Ye,s=Ue;for(;n!==Ye;){const c=r/n,a=r%n,l=o-s*c;r=n,n=a,o=s,s=l}if(r!==Ue)throw new Error("invert: does not exist");return Xe(o,t)}function qd(e,t){const n=(e.ORDER+Ue)/Vd,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function Kw(e,t){const n=(e.ORDER-Hd)/Gd,r=e.mul(t,Xn),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,Xn),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 Zw(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Ue,n=0;for(;t%Xn===Ye;)t/=Xn,n++;let r=Xn;const o=ec(e);for(;Zd(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return qd;let s=o.pow(r,t);const i=(t+Ue)/Xn;return function(a,l){if(a.is0(l))return l;if(Zd(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=Ue<<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 Yw(e){return e%Vd===qw?qd:e%Gd===Hd?Kw:Zw(e)}const Xw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Jw(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Xw.reduce((r,o)=>(r[o]="function",r),t);return Ns(e,n)}function Qw(e,t,n){if(n<Ye)throw new Error("invalid exponent, negatives unsupported");if(n===Ye)return e.ONE;if(n===Ue)return t;let r=e.ONE,o=t;for(;n>Ye;)n&Ue&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Ue;return r}function Kd(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 Zd(e,t){const n=(e.ORDER-Ue)/Xn,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 Yd(e,t){t!==void 0&&Yr(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ec(e,t,n=!1,r={}){if(e<=Ye)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=Yd(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:As(o),ZERO:Ye,ONE:Ue,create:a=>Xe(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return Ye<=a&&a<e},is0:a=>a===Ye,isOdd:a=>(a&Ue)===Ue,neg:a=>Xe(-a,e),eql:(a,l)=>a===l,sqr:a=>Xe(a*a,e),add:(a,l)=>Xe(a+l,e),sub:(a,l)=>Xe(a-l,e),mul:(a,l)=>Xe(a*l,e),pow:(a,l)=>Qw(c,a,l),div:(a,l)=>Xe(a*Qa(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>Qa(a,e),sqrt:r.sqrt||(a=>(i||(i=Yw(e)),i(c,a))),toBytes:a=>n?Bf(a,s):ko(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Df(a):Kn(a)},invertBatch:a=>Kd(c,a),cmov:(a,l,u)=>u?l:a});return Object.freeze(c)}function Xd(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 Jd(e){const t=Xd(e);return t+Math.ceil(t/2)}function e6(e,t,n=!1){const r=e.length,o=Xd(t),s=Jd(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Df(e):Kn(e),c=Xe(i,t-Ue)+Ue;return n?Bf(c,o):ko(c,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Qd=BigInt(0),tc=BigInt(1);function nc(e,t){const n=t.negate();return e?n:t}function e0(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function rc(e,t){e0(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=As(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function t0(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+=tc);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 t6(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 n6(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 oc=new WeakMap,n0=new WeakMap;function sc(e){return n0.get(e)||1}function r6(e,t){return{constTimeNegate:nc,hasPrecomputes(n){return sc(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>Qd;)r&tc&&(o=o.add(s)),s=s.double(),r>>=tc;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=rc(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=rc(n,t);for(let a=0;a<c.windows;a++){const{nextN:l,offset:u,isZero:f,isNeg:p,isNegF:d,offsetF:h}=t0(o,a,c);o=l,f?i=i.add(nc(d,r[h])):s=s.add(nc(p,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=rc(n,t);for(let c=0;c<i.windows&&o!==Qd;c++){const{nextN:a,offset:l,isZero:u,isNeg:f}=t0(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=oc.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&oc.set(r,o(s))),s},wNAFCached(n,r,o){const s=sc(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=sc(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){e0(r,t),n0.set(n,r),oc.delete(n)}}}function o6(e,t,n,r){t6(n,e),n6(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=yy(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const l=As(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 r0(e){return Jw(e.Fp),Ns(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Yd(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function o0(e){e.lowS!==void 0&&Oo("lowS",e.lowS),e.prehash!==void 0&&Oo("prehash",e.prehash)}function s6(e){const t=r0(e);Ns(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 i6 extends Error{constructor(t=""){super(t)}}const fn={Err:i6,_tlv:{encode:(e,t)=>{const{Err:n}=fn;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=Ss(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Ss(o.length/2|128):"";return Ss(e)+s+o+t},decode(e,t){const{Err:n}=fn;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}=fn;if(e<dn)throw new t("integer: negative integers are not allowed");let n=Ss(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}=fn;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 Kn(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=fn,o=mt("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}=fn,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 ic(e,t){return Io(ko(e,t))}const dn=BigInt(0),De=BigInt(1);BigInt(2);const ac=BigInt(3),a6=BigInt(4);function c6(e){const t=s6(e),{Fp:n}=t,r=ec(t.n,t.nBitLength),o=t.toBytes||((S,A,D)=>{const F=A.toAffine();return Ts(Uint8Array.from([4]),n.toBytes(F.x),n.toBytes(F.y))}),s=t.fromBytes||(S=>{const A=S.subarray(1),D=n.fromBytes(A.subarray(0,n.BYTES)),F=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:D,y:F}});function i(S){const{a:A,b:D}=t,F=n.sqr(S),L=n.mul(F,S);return n.add(n.add(L,n.mul(S,A)),D)}function c(S,A){const D=n.sqr(A),F=i(S);return n.eql(D,F)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,ac),a6),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 Sa(S,De,t.n)}function f(S){const{allowedPrivateKeyLengths:A,nByteLength:D,wrapPrivateKey:F,n:L}=t;if(A&&typeof S!="bigint"){if(Co(S)&&(S=Io(S)),typeof S!="string"||!A.includes(S.length))throw new Error("invalid private key");S=S.padStart(D*2,"0")}let b;try{b=typeof S=="bigint"?S:Kn(mt("private key",S,D))}catch{throw new Error("invalid private key, expected hex or "+D+" bytes, got "+typeof S)}return F&&(b=Xe(b,L)),Ar("private key",b,De,L),b}function p(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const d=Ff((S,A)=>{const{px:D,py:F,pz:L}=S;if(n.eql(L,n.ONE))return{x:D,y:F};const b=S.is0();A==null&&(A=b?n.ONE:n.inv(L));const g=n.mul(D,A),x=n.mul(F,A),I=n.mul(L,A);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql(I,n.ONE))throw new Error("invZ was invalid");return{x:g,y:x}}),h=Ff(S=>{if(S.is0()){if(t.allowInfinityPoint&&!n.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:A,y:D}=S.toAffine();if(!n.isValid(A)||!n.isValid(D))throw new Error("bad point: x or y not FE");if(!c(A,D))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(A,D,F){if(A==null||!n.isValid(A))throw new Error("x required");if(D==null||!n.isValid(D)||n.is0(D))throw new Error("y required");if(F==null||!n.isValid(F))throw new Error("z required");this.px=A,this.py=D,this.pz=F,Object.freeze(this)}static fromAffine(A){const{x:D,y:F}=A||{};if(!A||!n.isValid(D)||!n.isValid(F))throw new Error("invalid affine point");if(A instanceof m)throw new Error("projective point not allowed");const L=b=>n.eql(b,n.ZERO);return L(D)&&L(F)?m.ZERO:new m(D,F,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const D=Kd(n,A.map(F=>F.pz));return A.map((F,L)=>F.toAffine(D[L])).map(m.fromAffine)}static fromHex(A){const D=m.fromAffine(s(mt("pointHex",A)));return D.assertValidity(),D}static fromPrivateKey(A){return m.BASE.multiply(f(A))}static msm(A,D){return o6(m,r,A,D)}_setWindowSize(A){E.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){p(A);const{px:D,py:F,pz:L}=this,{px:b,py:g,pz:x}=A,I=n.eql(n.mul(D,x),n.mul(b,L)),O=n.eql(n.mul(F,x),n.mul(g,L));return I&&O}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:D}=t,F=n.mul(D,ac),{px:L,py:b,pz:g}=this;let x=n.ZERO,I=n.ZERO,O=n.ZERO,k=n.mul(L,L),M=n.mul(b,b),w=n.mul(g,g),N=n.mul(L,b);return N=n.add(N,N),O=n.mul(L,g),O=n.add(O,O),x=n.mul(A,O),I=n.mul(F,w),I=n.add(x,I),x=n.sub(M,I),I=n.add(M,I),I=n.mul(x,I),x=n.mul(N,x),O=n.mul(F,O),w=n.mul(A,w),N=n.sub(k,w),N=n.mul(A,N),N=n.add(N,O),O=n.add(k,k),k=n.add(O,k),k=n.add(k,w),k=n.mul(k,N),I=n.add(I,k),w=n.mul(b,g),w=n.add(w,w),k=n.mul(w,N),x=n.sub(x,k),O=n.mul(w,M),O=n.add(O,O),O=n.add(O,O),new m(x,I,O)}add(A){p(A);const{px:D,py:F,pz:L}=this,{px:b,py:g,pz:x}=A;let I=n.ZERO,O=n.ZERO,k=n.ZERO;const M=t.a,w=n.mul(t.b,ac);let N=n.mul(D,b),$=n.mul(F,g),P=n.mul(L,x),B=n.add(D,F),j=n.add(b,g);B=n.mul(B,j),j=n.add(N,$),B=n.sub(B,j),j=n.add(D,L);let U=n.add(b,x);return j=n.mul(j,U),U=n.add(N,P),j=n.sub(j,U),U=n.add(F,L),I=n.add(g,x),U=n.mul(U,I),I=n.add($,P),U=n.sub(U,I),k=n.mul(M,j),I=n.mul(w,P),k=n.add(I,k),I=n.sub($,k),k=n.add($,k),O=n.mul(I,k),$=n.add(N,N),$=n.add($,N),P=n.mul(M,P),j=n.mul(w,j),$=n.add($,P),P=n.sub(N,P),P=n.mul(M,P),j=n.add(j,P),N=n.mul($,j),O=n.add(O,N),N=n.mul(U,j),I=n.mul(B,I),I=n.sub(I,N),N=n.mul(B,$),k=n.mul(U,k),k=n.add(k,N),new m(I,O,k)}subtract(A){return this.add(A.negate())}is0(){return this.equals(m.ZERO)}wNAF(A){return E.wNAFCached(this,A,m.normalizeZ)}multiplyUnsafe(A){const{endo:D,n:F}=t;Ar("scalar",A,dn,F);const L=m.ZERO;if(A===dn)return L;if(this.is0()||A===De)return this;if(!D||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,A,m.normalizeZ);let{k1neg:b,k1:g,k2neg:x,k2:I}=D.splitScalar(A),O=L,k=L,M=this;for(;g>dn||I>dn;)g&De&&(O=O.add(M)),I&De&&(k=k.add(M)),M=M.double(),g>>=De,I>>=De;return b&&(O=O.negate()),x&&(k=k.negate()),k=new m(n.mul(k.px,D.beta),k.py,k.pz),O.add(k)}multiply(A){const{endo:D,n:F}=t;Ar("scalar",A,De,F);let L,b;if(D){const{k1neg:g,k1:x,k2neg:I,k2:O}=D.splitScalar(A);let{p:k,f:M}=this.wNAF(x),{p:w,f:N}=this.wNAF(O);k=E.constTimeNegate(g,k),w=E.constTimeNegate(I,w),w=new m(n.mul(w.px,D.beta),w.py,w.pz),L=k.add(w),b=M.add(N)}else{const{p:g,f:x}=this.wNAF(A);L=g,b=x}return m.normalizeZ([L,b])[0]}multiplyAndAddUnsafe(A,D,F){const L=m.BASE,b=(x,I)=>I===dn||I===De||!x.equals(L)?x.multiplyUnsafe(I):x.multiply(I),g=b(this,D).add(b(A,F));return g.is0()?void 0:g}toAffine(A){return d(this,A)}isTorsionFree(){const{h:A,isTorsionFree:D}=t;if(A===De)return!0;if(D)return D(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:D}=t;return A===De?this:D?D(m,this):this.multiplyUnsafe(t.h)}toRawBytes(A=!0){return Oo("isCompressed",A),this.assertValidity(),o(m,this,A)}toHex(A=!0){return Oo("isCompressed",A),Io(this.toRawBytes(A))}}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=r6(m,v?Math.ceil(T/2):T);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:f,weierstrassEquation:i,isWithinCurveOrder:u}}function l6(e){const t=r0(e);return Ns(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function u6(e){const t=l6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,c=2*n.BYTES+1;function a(w){return Xe(w,r)}function l(w){return Qa(w,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:p,isWithinCurveOrder:d}=c6({...t,toBytes(w,N,$){const P=N.toAffine(),B=n.toBytes(P.x),j=Ts;return Oo("isCompressed",$),$?j(Uint8Array.from([N.hasEvenY()?2:3]),B):j(Uint8Array.from([4]),B,n.toBytes(P.y))},fromBytes(w){const N=w.length,$=w[0],P=w.subarray(1);if(N===i&&($===2||$===3)){const B=Kn(P);if(!Sa(B,De,n.ORDER))throw new Error("Point is not on curve");const j=p(B);let U;try{U=n.sqrt(j)}catch(Z){const H=Z instanceof Error?": "+Z.message:"";throw new Error("Point is not on curve"+H)}const _=(U&De)===De;return($&1)===1!==_&&(U=n.neg(U)),{x:B,y:U}}else if(N===c&&$===4){const B=n.fromBytes(P.subarray(0,n.BYTES)),j=n.fromBytes(P.subarray(n.BYTES,2*n.BYTES));return{x:B,y:j}}else{const B=i,j=c;throw new Error("invalid Point, expected length of "+B+", or uncompressed "+j+", got "+N)}}});function h(w){const N=r>>De;return w>N}function m(w){return h(w)?a(-w):w}const v=(w,N,$)=>Kn(w.slice(N,$));class T{constructor(N,$,P){Ar("r",N,De,r),Ar("s",$,De,r),this.r=N,this.s=$,P!=null&&(this.recovery=P),Object.freeze(this)}static fromCompact(N){const $=o;return N=mt("compactSignature",N,$*2),new T(v(N,0,$),v(N,$,2*$))}static fromDER(N){const{r:$,s:P}=fn.toSig(mt("DER",N));return new T($,P)}assertValidity(){}addRecoveryBit(N){return new T(this.r,this.s,N)}recoverPublicKey(N){const{r:$,s:P,recovery:B}=this,j=L(mt("msgHash",N));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const U=B===2||B===3?$+t.n:$;if(U>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const _=B&1?"03":"02",q=u.fromHex(_+ic(U,n.BYTES)),Z=l(U),H=a(-j*Z),W=a(P*Z),J=u.BASE.multiplyAndAddUnsafe(q,H,W);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}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 fn.hexFromSig(this)}toCompactRawBytes(){return Ps(this.toCompactHex())}toCompactHex(){const N=o;return ic(this.r,N)+ic(this.s,N)}}const E={isValidPrivateKey(w){try{return f(w),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const w=Jd(t.n);return e6(t.randomBytes(w),t.n)},precompute(w=8,N=u.BASE){return N._setWindowSize(w),N.multiply(BigInt(3)),N}};function S(w,N=!0){return u.fromPrivateKey(w).toRawBytes(N)}function A(w){if(typeof w=="bigint")return!1;if(w instanceof u)return!0;const $=mt("key",w).length,P=n.BYTES,B=P+1,j=2*P+1;if(!(t.allowedPrivateKeyLengths||o===B))return $===B||$===j}function D(w,N,$=!0){if(A(w)===!0)throw new Error("first arg must be private key");if(A(N)===!1)throw new Error("second arg must be public key");return u.fromHex(N).multiply(f(w)).toRawBytes($)}const F=t.bits2int||function(w){if(w.length>8192)throw new Error("input is too large");const N=Kn(w),$=w.length*8-s;return $>0?N>>BigInt($):N},L=t.bits2int_modN||function(w){return a(F(w))},b=As(s);function g(w){return Ar("num < 2^"+s,w,dn,b),ko(w,o)}function x(w,N,$=I){if(["recovered","canonical"].some(Q=>Q in $))throw new Error("sign() legacy options not supported");const{hash:P,randomBytes:B}=t;let{lowS:j,prehash:U,extraEntropy:_}=$;j==null&&(j=!0),w=mt("msgHash",w),o0($),U&&(w=mt("prehashed msgHash",P(w)));const q=L(w),Z=f(N),H=[g(Z),g(q)];if(_!=null&&_!==!1){const Q=_===!0?B(n.BYTES):_;H.push(mt("extraEntropy",Q))}const W=Ts(...H),J=q;function K(Q){const oe=F(Q);if(!d(oe))return;const ee=l(oe),ue=u.BASE.multiply(oe).toAffine(),ce=a(ue.x);if(ce===dn)return;const pe=a(ee*a(J+ce*Z));if(pe===dn)return;let re=(ue.x===ce?0:2)|Number(ue.y&De),Y=pe;return j&&h(pe)&&(Y=m(pe),re^=1),new T(ce,Y,re)}return{seed:W,k2sig:K}}const I={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function k(w,N,$=I){const{seed:P,k2sig:B}=x(w,N,$),j=t;return vy(j.hash.outputLen,j.nByteLength,j.hmac)(P,B)}u.BASE._setWindowSize(8);function M(w,N,$,P=O){var re;const B=w;N=mt("msgHash",N),$=mt("publicKey",$);const{lowS:j,prehash:U,format:_}=P;if(o0(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 q=typeof B=="string"||Co(B),Z=!q&&!_&&typeof B=="object"&&B!==null&&typeof B.r=="bigint"&&typeof B.s=="bigint";if(!q&&!Z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let H,W;try{if(Z&&(H=new T(B.r,B.s)),q){try{_!=="compact"&&(H=T.fromDER(B))}catch(Y){if(!(Y instanceof fn.Err))throw Y}!H&&_!=="der"&&(H=T.fromCompact(B))}W=u.fromHex($)}catch{return!1}if(!H||j&&H.hasHighS())return!1;U&&(N=t.hash(N));const{r:J,s:K}=H,Q=L(N),oe=l(K),ee=a(Q*oe),ue=a(J*oe),ce=(re=u.BASE.multiplyAndAddUnsafe(W,ee,ue))==null?void 0:re.toAffine();return ce?a(ce.x)===J:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:D,sign:k,verify:M,ProjectivePoint:u,Signature:T,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function f6(e){return{hash:e,hmac:(t,...n)=>Wd(e,t,M1(...n)),randomBytes:D1}}function d6(e,t){const n=r=>u6({...e,...f6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const s0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),i0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),p6=BigInt(0),h6=BigInt(1),cc=BigInt(2),a0=(e,t)=>(e+t/cc)/t;function m6(e){const t=s0,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=bt(u,n,t)*u%t,p=bt(f,n,t)*u%t,d=bt(p,cc,t)*l%t,h=bt(d,o,t)*d%t,m=bt(h,s,t)*h%t,v=bt(m,c,t)*m%t,T=bt(v,a,t)*v%t,E=bt(T,c,t)*m%t,S=bt(E,n,t)*u%t,A=bt(S,i,t)*h%t,D=bt(A,r,t)*l%t,F=bt(D,cc,t);if(!lc.eql(lc.sqr(F),e))throw new Error("Cannot find square root");return F}const lc=ec(s0,void 0,void 0,{sqrt:m6}),c0=d6({a:p6,b:BigInt(7),Fp:lc,n:i0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=i0,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-h6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),c=a0(s*e,t),a=a0(-r*e,t);let l=Xe(e-c*n-a*o,t),u=Xe(-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}}}},xf),b6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:c0},Symbol.toStringTag,{value:"Module"}));function l0(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new fc({signature:e});if(typeof e.s>"u")throw new fc({signature:e});if(n&&typeof e.yParity>"u")throw new fc({signature:e});if(e.r<0n||e.r>Ld)throw new S6({value:e.r});if(e.s<0n||e.s>Ld)throw new P6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new dc({value:e.yParity})}function g6(e){return u0(Bt(e))}function u0(e){if(e.length!==130&&e.length!==132)throw new E6({signature:e});const t=BigInt(Vt(e,0,32)),n=BigInt(Vt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return uc(o)}catch{throw new dc({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function y6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return v6(e)}function v6(e){const t=typeof e=="string"?u0(e):e instanceof Uint8Array?g6(e):typeof e.r=="string"?x6(e):e.v?w6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return l0(t),t}function w6(e){return{r:e.r,s:e.s,yParity:uc(e.v)}}function x6(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=uc(n)),typeof r!="number")throw new dc({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function uc(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 T6({value:e})}class E6 extends le{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ct(Vy(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class fc extends le{constructor({signature:t}){super(`Signature \`${_f(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class S6 extends le{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 P6 extends le{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 dc extends le{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 T6 extends le{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 A6(e,t={}){return typeof e.chainId=="string"?N6(e):{...e,...t.signature}}function N6(e){const{address:t,chainId:n,nonce:r}=e,o=y6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const C6="0x8010801080108010801080108010801080108010801080108010801080108010",O6=jd("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function f0(e){if(typeof e=="string"){if(Vt(e,-32)!==C6)throw new $6(e)}else l0(e.authorization)}function I6(e){f0(e);const t=qf(Vt(e,-64,-32)),n=Vt(e,-t-64,-64),r=Vt(e,0,-t-64),[o,s,i]=_w(O6,n);return{authorization:A6({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 k6(e){try{return f0(e),!0}catch{return!1}}let $6=class extends le{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 M6 extends V{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function D6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new M6({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 B6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function L6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?rn(e.nonce):void 0,storageProof:e.storageProof?B6(e.storageProof):void 0}}async function F6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?ne(n):void 0,c=await e.request({method:"eth_getProof",params:[t,o,i||s]});return L6(c)}async function R6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?ne(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function pc(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?ne(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,ne(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||a,ne(s)]},{dedupe:!!l}):i&&typeof c=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,ne(c)]},{dedupe:!0})),!u)throw new ef({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)||la)(u,"getTransaction")}async function j6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([te(e,Bo,"getBlockNumber")({}),t?te(e,pc,"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 Ls(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new tf({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||dd)(n,"getTransactionReceipt")}async function z6(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 Or({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:A,address:D,args:F,functionName:L}=l[S];try{const b=$t({abi:A,args:F,functionName:L});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:D}]}catch(b){const g=Sr(b,{abi:A,address:D,args:F,docsPath:"/docs/contract/multicall",functionName:L,sender:n});if(!o)throw g;d[h]=[...d[h],{allowFailure:!0,callData:"0x",target:D}]}}const v=await Promise.allSettled(d.map(S=>te(e,Lt,"readContract")({...p===null?{code:Na}:{address:p},abi:Os,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 A=v[S];if(A.status==="rejected"){if(!o)throw A.reason;for(let F=0;F<d[S].length;F++)T.push({status:"failure",error:A.reason,result:void 0});continue}const D=A.value;for(let F=0;F<D.length;F++){const{returnData:L,success:b}=D[F],{callData:g}=d[S][F],{abi:x,address:I,functionName:O,args:k}=l[T.length];try{if(g==="0x")throw new Kr;if(!b)throw new gs({data:L});const M=qn({abi:x,args:k,data:L,functionName:O});T.push(o?{result:M,status:"success"}:M)}catch(M){const w=Sr(M,{abi:x,address:I,args:k,docsPath:"/docs/contract/multicall",functionName:O});if(!o)throw w;T.push({error:w,result:void 0,status:"failure"})}}}if(T.length!==l.length)throw new V("multicall results mismatch");return T}async function hc(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?Jf(p.blockOverrides):void 0,h=p.calls.map(v=>{const T=v,E=T.account?it(T.account):void 0,S=T.abi?$t(T):T.data,A={...T,account:E,data:T.dataSuffix?kt([S||"0x",T.dataSuffix]):S,from:T.from??(E==null?void 0:E.address)};return Tr(A),Ao(A)}),m=p.stateOverrides?aa(p.stateOverrides):void 0;a.push({blockOverrides:d,calls:h,stateOverrides:m})}const u=(typeof n=="bigint"?ne(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:c},u]})).map((p,d)=>({...bf(p),calls:p.calls.map((h,m)=>{var x,I;const{abi:v,args:T,functionName:E,to:S}=o[d].calls[m],A=((x=h.error)==null?void 0:x.data)??h.returnData,D=BigInt(h.gasUsed),F=(I=h.logs)==null?void 0:I.map(O=>an(O)),L=h.status==="0x1"?"success":"failure",b=v&&L==="success"&&A!=="0x"?qn({abi:v,data:A,functionName:E}):null,g=(()=>{var k;if(L==="success")return;let O;if(((k=h.error)==null?void 0:k.data)==="0x"?O=new Kr:h.error&&(O=new gs(h.error)),!!O)return Sr(O,{abi:v??[],address:S??"0x",args:T,functionName:E??"<unknown>"})})();return{data:A,gasUsed:D,logs:F,status:L,...L==="success"?{result:b}:{error:g}}})}))}catch(a){const l=a,u=ws(l,{});throw u instanceof To?l:u}}function mc(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 le("Unable to normalize signature.");return o}function bc(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Ha(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)=>bc(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=>bc(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function d0(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 d0(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")?Ha(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?Ha(n[r],{strict:!1}):!1)return i}}function p0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?lu(e):e;return{...r,...n?{hash:kr(r)}:{}}}function Fs(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=Hy(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?h0(l)===Vt(t,0,4):l.type==="event"?kr(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new Rs({name:t});if(i.length===1)return{...i[0],...o?{hash:kr(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:kr(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?bc(f,d):!1})){if(c&&"inputs"in c&&c.inputs){const f=d0(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 Rs({name:t});return{...a,...o?{hash:kr(a)}:{}}}function h0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Fs(n,r)}return e[0]})();return Vt(kr(t),0,4)}function U6(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Fs(r,o)}return e[0]})(),n=typeof t=="string"?t:as(t);return mc(n)}function kr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Fs(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:$d(Ta(U6(t)))}class _6 extends le{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${mc(as(t.abiItem))}\`, and`,`\`${n.type}\` in \`${mc(as(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 Rs extends le{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 W6(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,c]=e;return[H6(i),c]}return e})(),{bytecode:r,args:o}=n;return Dt(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?Ya(t.inputs,o):"0x")}function V6(e){return p0(e)}function H6(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Rs({name:"constructor"});return t}function G6(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[l,u,f]=e;return[m0(l,u,{args:f}),f]}const[c,a]=e;return[c,a]})(),{overloads:r}=t,o=r?m0([t,...r],t.name,{args:n}):t,s=q6(o),i=n.length>0?Ya(o.inputs,n):void 0;return i?Dt(s,i):s}function $r(e,t={}){return p0(e,t)}function m0(e,t,n){const r=Fs(e,t,n);if(r.type!=="function")throw new Rs({name:t,type:"function"});return r}function q6(e){return h0(e)}const K6="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ht="0x0000000000000000000000000000000000000000",Z6="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function Y6(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:c,validation:a}=t,l=t.account?it(t.account):void 0;if(i&&!l)throw new V("`account` is required when `traceAssetChanges` is true");const u=l?W6(V6("constructor(bytes, bytes)"),{bytecode:sd,args:[Z6,G6($r("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:B}=await xd(e,{account:l.address,...P,data:P.abi?$t(P):P.data});return B.map(({address:j,storageKeys:U})=>U.length>0?j:null)})).then(P=>P.flat().filter(Boolean)):[],p=await hc(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:f.map((P,B)=>({abi:[$r("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]}]:[],{calls:[...o,{}].map(P=>({...P,from:l==null?void 0:l.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:f.map((P,B)=>({abi:[$r("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:P,from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]},{calls:f.map((P,B)=>({to:P,abi:[$r("function decimals() returns (uint256)")],functionName:"decimals",from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]},{calls:f.map((P,B)=>({to:P,abi:[$r("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]},{calls:f.map((P,B)=>({to:P,abi:[$r("function symbol() returns (string)")],functionName:"symbol",from:Ht,nonce:B})),stateOverrides:[{address:Ht,nonce:0}]}]:[]],traceTransfers:c,validation:a}),d=i?p[2]:p[0],[h,m,,v,T,E,S,A]=i?p:[],{calls:D,...F}=d,L=D.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],g=(m==null?void 0:m.calls)??[],x=[...b,...g].map(P=>P.status==="success"?Ut(P.data):null),I=(v==null?void 0:v.calls)??[],O=(T==null?void 0:T.calls)??[],k=[...I,...O].map(P=>P.status==="success"?Ut(P.data):null),M=((E==null?void 0:E.calls)??[]).map(P=>P.status==="success"?P.result:null),w=((A==null?void 0:A.calls)??[]).map(P=>P.status==="success"?P.result:null),N=((S==null?void 0:S.calls)??[]).map(P=>P.status==="success"?P.result:null),$=[];for(const[P,B]of k.entries()){const j=x[P];if(typeof B!="bigint"||typeof j!="bigint")continue;const U=M[P-1],_=w[P-1],q=N[P-1],Z=P===0?{address:K6,decimals:18,symbol:"ETH"}:{address:f[P-1],decimals:q||U?Number(U??1):void 0,symbol:_??void 0};$.some(H=>H.token.address===Z.address)||$.push({token:Z,value:{pre:j,post:B,diff:B-j}})}return{assetChanges:$,block:F,results:L}}const b0="0x6492649264926492649264926492649264926492649264926492649264926492";function X6(e){if(Vt(e,-32)!==b0)throw new e5(e)}function J6(e){const{data:t,signature:n,to:r}=e;return Dt(Ya(jd("address, bytes, bytes"),[r,t,n]),b0)}function Q6(e){try{return X6(e),!0}catch{return!1}}class e5 extends le{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 t5({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 c0.Signature(Ut(e),Ut(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:_t(i)}async function js(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 Ot(d)?d:typeof d=="object"&&"r"in d&&"s"in d?t5(d):Oe(d)})();try{return k6(i)?await n5(e,{...t,multicallAddress:s,signature:i}):await r5(e,{...t,verifierAddress:o,signature:i})}catch(d){try{if(No(Tn(n),await af({hash:r,signature:i})))return!0}catch{}if(d instanceof Jn)return!1;throw d}}async function n5(e,t){var v;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:c,data:a,signature:l,to:u}=I6(t.signature);if(await Wa(e,{address:n,blockNumber:r,blockTag:o})===yr(["0xef0100",c.address]))return await o5(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:ne(c.r,{size:32}),s:ne(c.s,{size:32}),yParity:c.yParity};if(!await Hv({address:n,authorization:p}))throw new Jn;const h=await te(e,Lt,"readContract")({...i?{address:i}:{code:Na},authorizationList:[p],abi:Os,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:$t({abi:rd,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 Jn}async function r5(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:c,...a}=t,l=await(async()=>!r&&!o||Q6(i)?i:J6({data:o,signature:i,to:r}))(),u=c?{to:c,data:$t({abi:od,functionName:"isValidSig",args:[n,s,l]}),...a}:{data:Ia({abi:od,args:[n,s,l],bytecode:Jy}),...a},{data:f}=await te(e,Mo,"call")(u).catch(p=>{throw p instanceof nf?new Jn:p});if(h1(f??"0x0"))return!0;throw new Jn}async function o5(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await te(e,Lt,"readContract")({address:n,abi:rd,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof rf?new Jn:a})).startsWith("0x1626ba7e"))return!0;throw new Jn}class Jn extends Error{}async function s5(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const c=Nd(n);return te(e,js,"verifyHash")({address:t,factory:r,factoryData:o,hash:c,signature:s,...i})}async function i5(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:c,types:a,domain:l,...u}=t,f=pw({message:i,primaryType:c,types:a,domain:l});return te(e,js,"verifyHash")({address:n,factory:r,factoryData:o,hash:f,signature:s,...u})}function g0(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=Ie(["watchBlockNumber",e.uid,t,n,i]);return In(f,{onBlockNumber:r,onError:o},p=>Do(async()=>{var d;try{const h=await te(e,Bo,"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=Ie(["watchBlockNumber",e.uid,t,n]);return In(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=Ut((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 a5(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:c=({count:D})=>~~(1<<D)*200,timeout:a=18e4}=t,l=Ie(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var D;return t.pollingInterval?t.pollingInterval:(D=e.chain)!=null&&D.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,p,d,h=!1,m,v;const{promise:T,resolve:E,reject:S}=cd(),A=a?setTimeout(()=>{v==null||v(),m==null||m(),S(new Og({hash:o}))},a):void 0;return m=In(l,{onReplaced:s,resolve:E,reject:S},async D=>{if(d=await te(e,Ls,"getTransactionReceipt")({hash:o}).catch(()=>{}),d&&r<=1){clearTimeout(A),D.resolve(d),m==null||m();return}v=te(e,g0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(F){const L=g=>{clearTimeout(A),v==null||v(),g(),m==null||m()};let b=F;if(!h)try{if(d){if(r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;L(()=>D.resolve(d));return}if(n&&!f&&(h=!0,await Da(async()=>{f=await te(e,pc,"getTransaction")({hash:o}),f.blockNumber&&(b=f.blockNumber)},{delay:c,retryCount:i}),h=!1),d=await te(e,Ls,"getTransactionReceipt")({hash:o}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r))return;L(()=>D.resolve(d))}catch(g){if(g instanceof ef||g instanceof tf){if(!f){h=!1;return}try{p=f,h=!0;const x=await Da(()=>te(e,Mt,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:c,retryCount:i,shouldRetry:({error:k})=>k instanceof hf});h=!1;const I=x.transactions.find(({from:k,nonce:M})=>k===p.from&&M===p.nonce);if(!I||(d=await te(e,Ls,"getTransactionReceipt")({hash:I.hash}),r>1&&(!d.blockNumber||b-d.blockNumber+1n<r)))return;let O="replaced";I.to===p.to&&I.value===p.value&&I.input===p.input?O="repriced":I.from===I.to&&I.value===0n&&(O="cancelled"),L(()=>{var k;(k=D.onReplaced)==null||k.call(D,{reason:O,replacedTransaction:p,transaction:I,transactionReceipt:d}),D.resolve(d)})}catch(x){L(()=>D.reject(x))}}else L(()=>D.reject(g))}}})}),T}function c5(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=Ie(["watchBlocks",e.uid,t,n,r,u,a]);return In(h,{onBlock:o,onError:s},m=>Do(async()=>{var v;try{const T=await te(e,Mt,"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 te(e,Mt,"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&&te(e,Mt,"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(A=>A.config.type==="webSocket"||A.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:E}=await T.subscribe({params:["newHeads"],async onData(S){var D;if(!h)return;const A=await te(e,Mt,"getBlock")({blockNumber:(D=S.result)==null?void 0:D.number,includeTransactions:u}).catch(()=>{});h&&(o(A,f),m=!1,f=A)},onError(S){s==null||s(S)}});v=E,h||v()}catch(T){s==null||s(T)}})(),()=>v()})()}function l5(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=Ie(["watchEvent",t,n,r,e.uid,o,u,i]);return In(v,{onLogs:a,onError:c},T=>{let E;i!==void 0&&(E=i-1n);let S,A=!1;const D=Do(async()=>{var F;if(!A){try{S=await te(e,Ed,"createEventFilter")({address:t,args:n,event:o,events:s,strict:d,fromBlock:i})}catch{}A=!0;return}try{let L;if(S)L=await te(e,Is,"getFilterChanges")({filter:S});else{const b=await te(e,Bo,"getBlockNumber")({});E&&E!==b?L=await te(e,ga,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:E+1n,toBlock:b}):L=[],E=b}if(L.length===0)return;if(r)T.onLogs(L);else for(const b of L)T.onLogs([b])}catch(L){S&&L instanceof Nn&&(A=!1),(F=T.onError)==null||F.call(T,L)}},{emitOnBegin:!0,interval:u});return async()=>{S&&await te(e,ks,"uninstallFilter")({filter:S}),D()}})})():(()=>{let v=!0,T=()=>v=!1;return(async()=>{try{const E=(()=>{if(e.transport.type==="fallback"){const F=e.transport.transports.find(L=>L.config.type==="webSocket"||L.config.type==="ipc");return F?F.value:e.transport}return e.transport})(),S=s??(o?[o]:void 0);let A=[];S&&(A=[S.flatMap(L=>Qr({abi:[L],eventName:L.name,args:n}))],o&&(A=A[0]));const{unsubscribe:D}=await E.subscribe({params:["logs",{address:t,topics:A}],onData(F){var b;if(!v)return;const L=F.result;try{const{eventName:g,args:x}=Es({abi:S??[],data:L.data,topics:L.topics,strict:d}),I=an(L,{args:x,eventName:g});a([I])}catch(g){let x,I;if(g instanceof us||g instanceof Fi){if(f)return;x=g.abiItem.name,I=(b=g.abiItem.inputs)==null?void 0:b.some(k=>!("name"in k&&k.name))}const O=an(L,{args:I?[]:{},eventName:x});a([O])}},onError(F){c==null||c(F)}});T=D,v||T()}catch(E){c==null||c(E)}})(),()=>T()})()}function u5(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=Ie(["watchPendingTransactions",e.uid,t,s]);return In(l,{onTransactions:r,onError:n},u=>{let f;const p=Do(async()=>{var d;try{if(!f)try{f=await te(e,Sd,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await te(e,Is,"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 te(e,ks,"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 f5(e){var f,p,d;const{scheme:t,statement:n,...r}=((f=e.match(d5))==null?void 0:f.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:c,requestId:a,...l}=((p=e.match(p5))==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 d5=/^(?:(?<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)?/,p5=/(?: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 h5(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||!ht(r.address,{strict:!1})||t&&!No(r.address,t))return!1}catch{return!1}return!0}async function m5(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:c,time:a=new Date,...l}=t,u=f5(o);if(!u.address||!h5({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const p=Nd(o);return js(e,{address:u.address,hash:p,signature:c,...l})}async function b5(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,a,l;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,ne(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)||dd)(o);if(i.status==="reverted"&&n)throw new Cg({receipt:i});return i}function g5(e){return{call:t=>Mo(e,t),createAccessList:t=>xd(e,t),createBlockFilter:()=>Bv(e),createContractEventFilter:t=>Hu(e,t),createEventFilter:t=>Ed(e,t),createPendingTransactionFilter:()=>Sd(e),estimateContractGas:t=>hy(e,t),estimateGas:t=>ma(e,t),getBalance:t=>Lv(e,t),getBlobBaseFee:()=>Fv(e),getBlock:t=>Mt(e,t),getBlockNumber:t=>Bo(e,t),getBlockTransactionCount:t=>Rv(e,t),getBytecode:t=>Wa(e,t),getChainId:()=>pa(e),getCode:t=>Wa(e,t),getContractEvents:t=>If(e,t),getEip712Domain:t=>zv(e,t),getEnsAddress:t=>vv(e,t),getEnsAvatar:t=>$v(e,t),getEnsName:t=>Mv(e,t),getEnsResolver:t=>Dv(e,t),getEnsText:t=>wd(e,t),getFeeHistory:t=>Wv(e,t),estimateFeesPerGas:t=>Yg(e,t),getFilterChanges:t=>Is(e,t),getFilterLogs:t=>Vv(e,t),getGasPrice:()=>ua(e),getLogs:t=>ga(e,t),getProof:t=>F6(e,t),estimateMaxPriorityFeePerGas:t=>Zg(e,t),fillTransaction:t=>Af(e,t),getStorageAt:t=>R6(e,t),getTransaction:t=>pc(e,t),getTransactionConfirmations:t=>j6(e,t),getTransactionCount:t=>yf(e,t),getTransactionReceipt:t=>Ls(e,t),multicall:t=>z6(e,t),prepareTransactionRequest:t=>Cf(e,t),readContract:t=>Lt(e,t),sendRawTransaction:t=>fv(e,t),sendRawTransactionSync:t=>b5(e,t),simulate:t=>hc(e,t),simulateBlocks:t=>hc(e,t),simulateCalls:t=>Y6(e,t),simulateContract:t=>rv(e,t),verifyHash:t=>js(e,t),verifyMessage:t=>s5(e,t),verifySiweMessage:t=>m5(e,t),verifyTypedData:t=>i5(e,t),uninstallFilter:t=>ks(e,t),waitForTransactionReceipt:t=>a5(e,t),watchBlocks:t=>c5(e,t),watchBlockNumber:t=>g0(e,t),watchContractEvent:t=>uv(e,t),watchEvent:t=>l5(e,t),watchPendingTransactions:t=>u5(e,t)}}function y5(e){const{key:t="public",name:n="Public Client"}=e;return pv({...e,key:t,name:n,type:"publicClient"}).extend(g5)}function v5({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:c},a){const l=pd();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:c},request:qv(r,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:a}}class w5 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 x5(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:i,name:c="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:l,retryDelay:u,raw:f}=t;return({chain:p,retryCount:d,timeout:h})=>{const{batchSize:m=1e3,wait:v=0}=typeof n=="object"?n:{},T=t.retryCount??d,E=h??t.timeout??1e4,S=e||(p==null?void 0:p.rpcUrls.default.http[0]);if(!S)throw new w5;const A=ow(S,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:l,timeout:E});return v5({key:s,methods:i,name:c,async request({method:D,params:F}){const L={method:D,params:F},{schedule:b}=ld({id:S,wait:v,shouldSplitBatch(O){return O.length>m},fn:O=>A.request({body:O}),sort:(O,k)=>O.id-k.id}),g=async O=>n?b(O):[await A.request({body:O})],[{error:x,result:I}]=await g(L);if(f)return{error:x,result:I};if(x)throw new Ji({body:L,error:x,url:S});return I},retryCount:T,retryDelay:u,timeout:E,type:"http"},{fetchOptions:o,url:S})}}const E5=tw({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 S5({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,c]=y.useState(null),[a,l]=y.useState(o);return y.useEffect(()=>{let u,f;const p=async()=>{try{const d=await e.readContract({address:t,abi:Cr,functionName:"balanceOf",args:[n]});c(d),l(Zi(d,r))}catch{l(o)}};p();try{u=e.watchContractEvent({address:t,abi:Cr,eventName:"Transfer",args:{to:n},onLogs:()=>{p()},poll:!0,pollingInterval:s}),f=e.watchContractEvent({address:t,abi:Cr,eventName:"Transfer",args:{from:n},onLogs:()=>{p()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),f==null||f()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const P5=()=>({openDeposit:y.useCallback(t=>{},[])}),T5=()=>({openWithdraw:y.useCallback(t=>{},[])}),pn="MPC",zs="EVM";var _e=(e=>(e.SPOT="spot",e.PERPETUAL="perpetual",e.PERPETUALV2="perpetual_v2",e))(_e||{});const A5="spot",N5="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 N5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),C5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),y0=e=>{const t=C5(e);return t.charAt(0).toUpperCase()+t.slice(1)},v0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),O5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
96
+ */const C5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),O5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),y0=e=>{const t=O5(e);return t.charAt(0).toUpperCase()+t.slice(1)},v0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),I5=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 I5={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"};/**
101
+ */var k5={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 $5=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},a)=>y.createElement("svg",{ref:a,...I5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:v0("lucide",o),...!s&&!O5(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,u])=>y.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
106
+ */const $5=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...c},a)=>y.createElement("svg",{ref:a,...k5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:v0("lucide",o),...!s&&!I5(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,u])=>y.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 k5=(e,t)=>{const n=y.forwardRef(({className:r,...o},s)=>y.createElement($5,{ref:s,iconNode:t,className:v0(`lucide-${N5(y0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=y0(e),n};/**
111
+ */const M5=(e,t)=>{const n=y.forwardRef(({className:r,...o},s)=>y.createElement($5,{ref:s,iconNode:t,className:v0(`lucide-${C5(y0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=y0(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 w0=k5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),x0=typeof document<"u"?y.useLayoutEffect:()=>{};var gc;const M5=(gc=y.useInsertionEffect)!==null&&gc!==void 0?gc:x0;function D5(e){const t=y.useRef(null);return M5(()=>{t.current=e},[e]),y.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const $n=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:$n(e).defaultView||window;function B5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function L5(e){return B5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let F5=!1;function yc(){return F5}function E0(e,t){if(!yc())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:L5(n)?n=n.host:n=n.parentNode}return!1}const vc=(e=document)=>{var t;if(!yc())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 S0(e){return yc()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Us(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 wc(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 hn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const xc=hn(function(){return wc(/^Mac/i)}),R5=hn(function(){return wc(/^iPhone/i)}),j5=hn(function(){return wc(/^iPad/i)||xc()&&navigator.maxTouchPoints>1}),z5=hn(function(){return R5()||j5()});hn(function(){return xc()||z5()}),hn(function(){return Us(/AppleWebKit/i)&&!U5()});const U5=hn(function(){return Us(/Chrome/i)}),_5=hn(function(){return Us(/Android/i)});hn(function(){return Us(/Firefox/i)});function P0(){let e=y.useRef(new Map),t=y.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=y.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=y.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return y.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function W5(e){return e.pointerType===""&&e.isTrusted?!0:_5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function T0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function V5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function A0(e){let t=y.useRef({isFocused:!1,observer:null});x0(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=D5(r=>{e==null||e(r)});return y.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=T0(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 H5=!1,jo=null,Ec=new Set,zo=new Map,er=!1,Sc=!1;const G5={Tab:!0,Escape:!0};function Pc(e,t){for(let n of Ec)n(e,t)}function q5(e){return!(e.metaKey||!xc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function _s(e){er=!0,q5(e)&&(jo="keyboard",Pc("keyboard",e))}function gt(e){jo="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(er=!0,Pc("pointer",e))}function N0(e){W5(e)&&(er=!0,jo="virtual")}function C0(e){e.target===window||e.target===document||H5||!e.isTrusted||(!er&&!Sc&&(jo="virtual",Pc("virtual",e)),er=!1,Sc=!1)}function O0(){er=!1,Sc=!0}function Tc(e){if(typeof window>"u"||typeof document>"u"||zo.get(Qn(e)))return;const t=Qn(e),n=$n(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){er=!0,r.apply(this,arguments)},n.addEventListener("keydown",_s,!0),n.addEventListener("keyup",_s,!0),n.addEventListener("click",N0,!0),t.addEventListener("focus",C0,!0),t.addEventListener("blur",O0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",gt,!0),n.addEventListener("pointermove",gt,!0),n.addEventListener("pointerup",gt,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",gt,!0),n.addEventListener("mousemove",gt,!0),n.addEventListener("mouseup",gt,!0)),t.addEventListener("beforeunload",()=>{I0(e)},{once:!0}),zo.set(t,{focus:r})}const I0=(e,t)=>{const n=Qn(e),r=$n(e);t&&r.removeEventListener("DOMContentLoaded",t),zo.has(n)&&(n.HTMLElement.prototype.focus=zo.get(n).focus,r.removeEventListener("keydown",_s,!0),r.removeEventListener("keyup",_s,!0),r.removeEventListener("click",N0,!0),n.removeEventListener("focus",C0,!0),n.removeEventListener("blur",O0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",gt,!0),r.removeEventListener("pointermove",gt,!0),r.removeEventListener("pointerup",gt,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",gt,!0),r.removeEventListener("mousemove",gt,!0),r.removeEventListener("mouseup",gt,!0)),zo.delete(n))};function K5(e){const t=$n(e);let n;return t.readyState!=="loading"?Tc(e):(n=()=>{Tc(e)},t.addEventListener("DOMContentLoaded",n)),()=>I0(e,n)}typeof document<"u"&&K5();function $0(){return jo!=="pointer"}const Z5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Y5(e,t,n){let r=$n(n==null?void 0:n.target);const o=typeof window<"u"?Qn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Qn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Qn(n==null?void 0:n.target).HTMLElement:HTMLElement,c=typeof window<"u"?Qn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Z5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!G5[n.key])}function X5(e,t,n){Tc(),y.useEffect(()=>{let r=(o,s)=>{Y5(!!(n!=null&&n.isTextInput),o,s)&&e($0())};return Ec.add(r),()=>{Ec.delete(r)}},t)}function J5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=y.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=A0(s),c=y.useCallback(a=>{const l=$n(a.target),u=l?vc(l):vc();a.target===a.currentTarget&&u===S0(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 Q5(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=y.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=P0(),a=y.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=A0(a),u=y.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const p=$n(f.target),d=vc(p);if(!s.current.isFocusWithin&&d===S0(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&&!E0(h,m.target)){let w=new p.defaultView.FocusEvent("blur",{relatedTarget:m.target});V5(w,h);let P=T0(w);a(P)}},{capture:!0})}},[r,o,l,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let Ws=!1,Vs=0;function Ac(){Ws=!0,setTimeout(()=>{Ws=!1},50)}function k0(e){e.pointerType==="touch"&&Ac()}function ex(){if(!(typeof document>"u"))return Vs===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",k0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ac)),Vs++,()=>{Vs--,!(Vs>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",k0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ac))}}function tx(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=y.useState(!1),c=y.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;y.useEffect(ex,[]);let{addGlobalListener:a,removeAllGlobalListeners:l}=P0(),{hoverProps:u,triggerHoverEnd:f}=y.useMemo(()=>{let p=(m,w)=>{if(c.pointerType=w,o||w==="touch"||c.isHovered||!m.currentTarget.contains(m.target))return;c.isHovered=!0;let P=m.currentTarget;c.target=P,a($n(m.target),"pointerover",E=>{c.isHovered&&c.target&&!E0(c.target,E.target)&&d(E,E.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:P,pointerType:w}),n&&n(!0),i(!0)},d=(m,w)=>{let P=c.target;c.pointerType="",c.target=null,!(w==="touch"||!c.isHovered||!P)&&(c.isHovered=!1,l(),r&&r({type:"hoverend",target:P,pointerType:w}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{Ws&&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&&!Ws&&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 y.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:u,isHovered:s}}function nx(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=y.useRef({isFocused:!1,isFocusVisible:t||$0()}),[s,i]=y.useState(!1),[c,a]=y.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=y.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=y.useCallback(d=>{o.current.isFocused=d,i(d),l()},[l]);X5(d=>{o.current.isFocusVisible=d,l()},[],{isTextInput:n});let{focusProps:f}=J5({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=Q5({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:c,focusProps:r?p:f}}var rx=Object.defineProperty,ox=(e,t,n)=>t in e?rx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nc=(e,t,n)=>(ox(e,typeof t!="symbol"?t+"":t,n),n);let sx=class{constructor(){Nc(this,"current",this.detect()),Nc(this,"handoffState","pending"),Nc(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"}},Gt=new sx;function Hs(e){var t;return Gt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Gs(e){var t,n;return Gt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function M0(e){var t,n;return(n=(t=Gs(e))==null?void 0:t.activeElement)!=null?n:null}function ix(e){return M0(e)===e}function D0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function lt(){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 D0(()=>{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=lt();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 tr(){let[e]=y.useState(lt);return y.useEffect(()=>()=>e.dispose(),[e]),e}let Te=(e,t)=>{Gt.isServer?y.useEffect(e,t):y.useLayoutEffect(e,t)};function nr(e){let t=y.useRef(e);return Te(()=>{t.current=e},[e]),t}let be=function(e){let t=nr(e);return y.useCallback((...n)=>t.current(...n),[t])};function ax(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 cx(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function lx({disabled:e=!1}={}){let t=y.useRef(null),[n,r]=y.useState(!1),o=tr(),s=be(()=>{t.current=null,r(!1),o.dispose()}),i=be(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let a=Hs(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",l=>{if(t.current){let u=ax(l);r(cx(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function kn(e){return y.useMemo(()=>e,Object.values(e))}let ux=y.createContext(void 0);function Cc(){return y.useContext(ux)}function Oc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function yt(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,yt),r}var qs=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(qs||{}),Mn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Mn||{});function ut(){let e=dx();return y.useCallback(t=>fx({mergeRefs:e,...t}),[e])}function fx({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??px;let a=B0(t,e);if(s)return Ks(a,n,r,i,c);let l=o??0;if(l&2){let{static:u=!1,...f}=a;if(u)return Ks(f,n,r,i,c)}if(l&1){let{unmount:u=!0,...f}=a;return yt(u?0:1,{0(){return null},1(){return Ks({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return Ks(a,n,r,i,c)}function Ks(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=Ic(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,w=>`-${w.toLowerCase()}`));if(p){f["data-headlessui-state"]=d.join(" ");for(let h of d)f[`data-${h}`]=""}}if(Uo(s)&&(Object.keys(Dn(a)).length>0||Object.keys(Dn(f)).length>0))if(!y.isValidElement(u)||Array.isArray(u)&&u.length>1||mx(u)){if(Object.keys(Dn(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(Dn(a)).concat(Object.keys(Dn(f))).map(p=>` - ${p}`).join(`
116
+ */const w0=M5("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),x0=typeof document<"u"?y.useLayoutEffect:()=>{};var gc;const D5=(gc=y.useInsertionEffect)!==null&&gc!==void 0?gc:x0;function B5(e){const t=y.useRef(null);return D5(()=>{t.current=e},[e]),y.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const kn=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:kn(e).defaultView||window;function L5(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function F5(e){return L5(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let R5=!1;function yc(){return R5}function E0(e,t){if(!yc())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:F5(n)?n=n.host:n=n.parentNode}return!1}const vc=(e=document)=>{var t;if(!yc())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 S0(e){return yc()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Us(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 wc(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 hn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const xc=hn(function(){return wc(/^Mac/i)}),j5=hn(function(){return wc(/^iPhone/i)}),z5=hn(function(){return wc(/^iPad/i)||xc()&&navigator.maxTouchPoints>1}),U5=hn(function(){return j5()||z5()});hn(function(){return xc()||U5()}),hn(function(){return Us(/AppleWebKit/i)&&!_5()});const _5=hn(function(){return Us(/Chrome/i)}),W5=hn(function(){return Us(/Android/i)});hn(function(){return Us(/Firefox/i)});function P0(){let e=y.useRef(new Map),t=y.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=y.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=y.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return y.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 T0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function H5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function A0(e){let t=y.useRef({isFocused:!1,observer:null});x0(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=B5(r=>{e==null||e(r)});return y.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=T0(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 G5=!1,jo=null,Ec=new Set,zo=new Map,er=!1,Sc=!1;const q5={Tab:!0,Escape:!0};function Pc(e,t){for(let n of Ec)n(e,t)}function K5(e){return!(e.metaKey||!xc()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function _s(e){er=!0,K5(e)&&(jo="keyboard",Pc("keyboard",e))}function gt(e){jo="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(er=!0,Pc("pointer",e))}function N0(e){V5(e)&&(er=!0,jo="virtual")}function C0(e){e.target===window||e.target===document||G5||!e.isTrusted||(!er&&!Sc&&(jo="virtual",Pc("virtual",e)),er=!1,Sc=!1)}function O0(){er=!1,Sc=!0}function Tc(e){if(typeof window>"u"||typeof document>"u"||zo.get(Qn(e)))return;const t=Qn(e),n=kn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){er=!0,r.apply(this,arguments)},n.addEventListener("keydown",_s,!0),n.addEventListener("keyup",_s,!0),n.addEventListener("click",N0,!0),t.addEventListener("focus",C0,!0),t.addEventListener("blur",O0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",gt,!0),n.addEventListener("pointermove",gt,!0),n.addEventListener("pointerup",gt,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",gt,!0),n.addEventListener("mousemove",gt,!0),n.addEventListener("mouseup",gt,!0)),t.addEventListener("beforeunload",()=>{I0(e)},{once:!0}),zo.set(t,{focus:r})}const I0=(e,t)=>{const n=Qn(e),r=kn(e);t&&r.removeEventListener("DOMContentLoaded",t),zo.has(n)&&(n.HTMLElement.prototype.focus=zo.get(n).focus,r.removeEventListener("keydown",_s,!0),r.removeEventListener("keyup",_s,!0),r.removeEventListener("click",N0,!0),n.removeEventListener("focus",C0,!0),n.removeEventListener("blur",O0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",gt,!0),r.removeEventListener("pointermove",gt,!0),r.removeEventListener("pointerup",gt,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",gt,!0),r.removeEventListener("mousemove",gt,!0),r.removeEventListener("mouseup",gt,!0)),zo.delete(n))};function Z5(e){const t=kn(e);let n;return t.readyState!=="loading"?Tc(e):(n=()=>{Tc(e)},t.addEventListener("DOMContentLoaded",n)),()=>I0(e,n)}typeof document<"u"&&Z5();function k0(){return jo!=="pointer"}const Y5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function X5(e,t,n){let r=kn(n==null?void 0:n.target);const o=typeof window<"u"?Qn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Qn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?Qn(n==null?void 0:n.target).HTMLElement:HTMLElement,c=typeof window<"u"?Qn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Y5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!q5[n.key])}function J5(e,t,n){Tc(),y.useEffect(()=>{let r=(o,s)=>{X5(!!(n!=null&&n.isTextInput),o,s)&&e(k0())};return Ec.add(r),()=>{Ec.delete(r)}},t)}function Q5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=y.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=A0(s),c=y.useCallback(a=>{const l=kn(a.target),u=l?vc(l):vc();a.target===a.currentTarget&&u===S0(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 ex(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=y.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:c}=P0(),a=y.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=A0(a),u=y.useCallback(f=>{if(!f.currentTarget.contains(f.target))return;const p=kn(f.target),d=vc(p);if(!s.current.isFocusWithin&&d===S0(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&&!E0(h,m.target)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:m.target});H5(v,h);let T=T0(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 Ws=!1,Vs=0;function Ac(){Ws=!0,setTimeout(()=>{Ws=!1},50)}function $0(e){e.pointerType==="touch"&&Ac()}function tx(){if(!(typeof document>"u"))return Vs===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",$0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ac)),Vs++,()=>{Vs--,!(Vs>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",$0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ac))}}function nx(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=y.useState(!1),c=y.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;y.useEffect(tx,[]);let{addGlobalListener:a,removeAllGlobalListeners:l}=P0(),{hoverProps:u,triggerHoverEnd:f}=y.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(kn(m.target),"pointerover",E=>{c.isHovered&&c.target&&!E0(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=>{Ws&&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&&!Ws&&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 y.useEffect(()=>{o&&f({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:u,isHovered:s}}function rx(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=y.useRef({isFocused:!1,isFocusVisible:t||k0()}),[s,i]=y.useState(!1),[c,a]=y.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=y.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=y.useCallback(d=>{o.current.isFocused=d,i(d),l()},[l]);J5(d=>{o.current.isFocusVisible=d,l()},[],{isTextInput:n});let{focusProps:f}=Q5({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=ex({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:c,focusProps:r?p:f}}var ox=Object.defineProperty,sx=(e,t,n)=>t in e?ox(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nc=(e,t,n)=>(sx(e,typeof t!="symbol"?t+"":t,n),n);let ix=class{constructor(){Nc(this,"current",this.detect()),Nc(this,"handoffState","pending"),Nc(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"}},Gt=new ix;function Hs(e){var t;return Gt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Gs(e){var t,n;return Gt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function M0(e){var t,n;return(n=(t=Gs(e))==null?void 0:t.activeElement)!=null?n:null}function ax(e){return M0(e)===e}function D0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function lt(){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 D0(()=>{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=lt();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 tr(){let[e]=y.useState(lt);return y.useEffect(()=>()=>e.dispose(),[e]),e}let Te=(e,t)=>{Gt.isServer?y.useEffect(e,t):y.useLayoutEffect(e,t)};function nr(e){let t=y.useRef(e);return Te(()=>{t.current=e},[e]),t}let be=function(e){let t=nr(e);return y.useCallback((...n)=>t.current(...n),[t])};function cx(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 lx(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ux({disabled:e=!1}={}){let t=y.useRef(null),[n,r]=y.useState(!1),o=tr(),s=be(()=>{t.current=null,r(!1),o.dispose()}),i=be(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let a=Hs(c.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",l=>{if(t.current){let u=cx(l);r(lx(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function $n(e){return y.useMemo(()=>e,Object.values(e))}let fx=y.createContext(void 0);function Cc(){return y.useContext(fx)}function Oc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function yt(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,yt),r}var qs=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(qs||{}),Mn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Mn||{});function ut(){let e=px();return y.useCallback(t=>dx({mergeRefs:e,...t}),[e])}function dx({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:c}){c=c??hx;let a=B0(t,e);if(s)return Ks(a,n,r,i,c);let l=o??0;if(l&2){let{static:u=!1,...f}=a;if(u)return Ks(f,n,r,i,c)}if(l&1){let{unmount:u=!0,...f}=a;return yt(u?0:1,{0(){return null},1(){return Ks({...f,hidden:!0,style:{display:"none"}},n,r,i,c)}})}return Ks(a,n,r,i,c)}function Ks(e,t={},n,r,o){let{as:s=n,children:i,refName:c="ref",...a}=Ic(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(Uo(s)&&(Object.keys(Dn(a)).length>0||Object.keys(Dn(f)).length>0))if(!y.isValidElement(u)||Array.isArray(u)&&u.length>1||bx(u)){if(Object.keys(Dn(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(Dn(a)).concat(Object.keys(Dn(f))).map(p=>` - ${p}`).join(`
117
117
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
118
118
  `)].join(`
119
- `))}else{let p=u.props,d=p==null?void 0:p.className,h=typeof d=="function"?(...P)=>Oc(d(...P),a.className):Oc(d,a.className),m=h?{className:h}:{},w=B0(u.props,Dn(Ic(a,["ref"])));for(let P in f)P in w&&delete f[P];return y.cloneElement(u,Object.assign({},w,f,l,{ref:o(hx(u),l.ref)},m))}return y.createElement(s,Object.assign({},Ic(a,["ref"]),!Uo(s)&&l,!Uo(s)&&f),u)}function dx(){let e=y.useRef([]),t=y.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 px(...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 B0(...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 L0(...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 Je(e){var t;return Object.assign(y.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Dn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ic(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function hx(e){return y.version.split(".")[0]>="19"?e.props.ref:e.ref}function Uo(e){return e===y.Fragment||e===Symbol.for("react.fragment")}function mx(e){return Uo(e.type)}function bx(e,t,n){let[r,o]=y.useState(n),s=e!==void 0,i=y.useRef(s),c=y.useRef(!1),a=y.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,be(l=>(s||He.flushSync(()=>o(l)),t==null?void 0:t(l)))]}function gx(e){let[t]=y.useState(e);return t}function F0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))j0(n,R0(t,r),o);return n}function R0(e,t){return e?e+"["+t+"]":t}function j0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())j0(e,R0(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,""]):vx(n)&&!y.isValidElement(n)&&F0(n,t,e)}function yx(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 vx(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let wx="span";var $c=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))($c||{});function xx(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 ut()({ourProps:s,theirProps:o,slot:{},defaultTag:wx,name:"Hidden"})}let z0=Je(xx),Ex=y.createContext(null);function Sx({children:e}){let t=y.useContext(Ex);if(!t)return y.createElement(y.Fragment,null,e);let{target:n}=t;return n?He.createPortal(y.createElement(y.Fragment,null,e),n):null}function Px({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=y.useState(null),c=tr();return y.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),y.createElement(Sx,null,y.createElement(Tx,{setForm:i,formId:t}),F0(e).map(([a,l])=>y.createElement(z0,{features:$c.Hidden,...Dn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:l,...o})})))}function Tx({setForm:e,formId:t}){return y.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:y.createElement(z0,{features:$c.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Ax=y.createContext(void 0);function U0(){return y.useContext(Ax)}function _0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Zs(e){return _0(e)&&"tagName"in e}function mn(e){return Zs(e)&&"accessKey"in e}function Mr(e){return Zs(e)&&"tabIndex"in e}function Nx(e){return Zs(e)&&"style"in e}function Cx(e){return mn(e)&&e.nodeName==="IFRAME"}function W0(e){return mn(e)&&e.nodeName==="INPUT"}function V0(e){return mn(e)&&e.nodeName==="LABEL"}function Ox(e){return mn(e)&&e.nodeName==="FIELDSET"}function H0(e){return mn(e)&&e.nodeName==="LEGEND"}function Ix(e){return Zs(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function G0(e){let t=e.parentElement,n=null;for(;t&&!Ox(t);)H0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&$x(n)?!1:r}function $x(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(H0(t))return!1;t=t.previousElementSibling}return!0}let q0=Symbol();function kx(e,t=!0){return Object.assign(e,{[q0]:t})}function vt(...e){let t=y.useRef(e);y.useEffect(()=>{t.current=e},[e]);let n=be(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[q0]))?void 0:n}let kc=y.createContext(null);kc.displayName="DescriptionContext";function K0(){let e=y.useContext(kc);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,K0),t}return e}function Mx(){var e,t;return(t=(e=y.useContext(kc))==null?void 0:e.value)!=null?t:void 0}let Dx="p";function Bx(e,t){let n=y.useId(),r=Cc(),{id:o=`headlessui-description-${n}`,...s}=e,i=K0(),c=vt(t);Te(()=>i.register(o),[o,i.register]);let a=kn({...i.slot,disabled:r||!1}),l={ref:c,...i.props,id:o};return ut()({ourProps:l,theirProps:s,slot:a,defaultTag:Dx,name:i.name||"Description"})}let Lx=Je(Bx);Object.assign(Lx,{});var Be=(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))(Be||{});let Ys=y.createContext(null);Ys.displayName="LabelContext";function Z0(){let e=y.useContext(Ys);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,Z0),t}return e}function Y0(e){var t,n,r;let o=(n=(t=y.useContext(Ys))==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 Fx({inherit:e=!1}={}){let t=Y0(),[n,r]=y.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,y.useMemo(()=>function(s){let i=be(a=>(r(l=>[...l,a]),()=>r(l=>{let u=l.slice(),f=u.indexOf(a);return f!==-1&&u.splice(f,1),u}))),c=y.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 y.createElement(Ys.Provider,{value:c},s.children)},[r])]}let Rx="label";function jx(e,t){var n;let r=y.useId(),o=Z0(),s=U0(),i=Cc(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=e,f=vt(t);Te(()=>o.register(c),[c,o.register]);let p=be(m=>{let w=m.currentTarget;if(!(m.target!==m.currentTarget&&Ix(m.target))&&(V0(w)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),V0(w))){let P=document.getElementById(w.htmlFor);if(P){let E=P.getAttribute("disabled");if(E==="true"||E==="")return;let T=P.getAttribute("aria-disabled");if(T==="true"||T==="")return;(W0(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})}}}),d=kn({...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),ut()({ourProps:h,theirProps:u,slot:d,defaultTag:a?Rx:"div",name:o.name||"Label"})}let zx=Je(jx),Ux=Object.assign(zx,{});function _x(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 Wx(e=_x){return y.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 X0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Vx(e,t,n=!1){let[r,o]=y.useState(()=>X0(t));return Te(()=>{if(!t||!e)return;let s=lt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=X0(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 J0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(J0||{});function Hx(e){let t=y.useRef(null),n=be(o=>{t.current=o.pointerType,!G0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===J0.Left&&(o.preventDefault(),e(o))}),r=be(o=>{t.current!=="mouse"&&(G0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let Q0=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 Gx=Object.defineProperty,qx=(e,t,n)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kx=(e,t,n)=>(qx(e,t+"",n),n),ep=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},wt=(e,t,n)=>(ep(e,t,"read from private field"),n?n.call(e):t.get(e)),Mc=(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)},tp=(e,t,n,r)=>(ep(e,t,"write to private field"),t.set(e,n),n),qt,_o,Wo;let np=class{constructor(t){Mc(this,qt,{}),Mc(this,_o,new Q0(()=>new Set)),Mc(this,Wo,new Set),Kx(this,"disposables",lt()),tp(this,qt,t),Gt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return wt(this,qt)}subscribe(t,n){if(Gt.isServer)return()=>{};let r={selector:t,callback:n,current:t(wt(this,qt))};return wt(this,Wo).add(r),this.disposables.add(()=>{wt(this,Wo).delete(r)})}on(t,n){return Gt.isServer?()=>{}:(wt(this,_o).get(t).add(n),this.disposables.add(()=>{wt(this,_o).get(t).delete(n)}))}send(t){let n=this.reduce(wt(this,qt),t);if(n!==wt(this,qt)){tp(this,qt,n);for(let r of wt(this,Wo)){let o=r.selector(wt(this,qt));rp(r.current,o)||(r.current=o,r.callback(o))}for(let r of wt(this,_o).get(t.type))r(wt(this,qt),t)}}};qt=new WeakMap,_o=new WeakMap,Wo=new WeakMap;function rp(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:Dc(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Dc(e.entries(),t.entries()):op(e)&&op(t)?Dc(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Dc(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 op(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Bc(e){let[t,n]=e(),r=lt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Zx=Object.defineProperty,Yx=(e,t,n)=>t in e?Zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sp=(e,t,n)=>(Yx(e,typeof t!="symbol"?t+"":t,n),n),ip=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(ip||{});let Xx={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Jx=class Wm extends np{constructor(){super(...arguments),sp(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),sp(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Wm({stack:[]})}reduce(t,n){return yt(n.type,Xx,t,n)}};const Lc=new Q0(()=>Jx.new());var Fc={exports:{}},Rc={};/**
119
+ `))}else{let p=u.props,d=p==null?void 0:p.className,h=typeof d=="function"?(...T)=>Oc(d(...T),a.className):Oc(d,a.className),m=h?{className:h}:{},v=B0(u.props,Dn(Ic(a,["ref"])));for(let T in f)T in v&&delete f[T];return y.cloneElement(u,Object.assign({},v,f,l,{ref:o(mx(u),l.ref)},m))}return y.createElement(s,Object.assign({},Ic(a,["ref"]),!Uo(s)&&l,!Uo(s)&&f),u)}function px(){let e=y.useRef([]),t=y.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 hx(...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 B0(...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 L0(...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 Je(e){var t;return Object.assign(y.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Dn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ic(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function mx(e){return y.version.split(".")[0]>="19"?e.props.ref:e.ref}function Uo(e){return e===y.Fragment||e===Symbol.for("react.fragment")}function bx(e){return Uo(e.type)}function gx(e,t,n){let[r,o]=y.useState(n),s=e!==void 0,i=y.useRef(s),c=y.useRef(!1),a=y.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,be(l=>(s||He.flushSync(()=>o(l)),t==null?void 0:t(l)))]}function yx(e){let[t]=y.useState(e);return t}function F0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))j0(n,R0(t,r),o);return n}function R0(e,t){return e?e+"["+t+"]":t}function j0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())j0(e,R0(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,""]):wx(n)&&!y.isValidElement(n)&&F0(n,t,e)}function vx(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 wx(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let xx="span";var kc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(kc||{});function Ex(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 ut()({ourProps:s,theirProps:o,slot:{},defaultTag:xx,name:"Hidden"})}let z0=Je(Ex),Sx=y.createContext(null);function Px({children:e}){let t=y.useContext(Sx);if(!t)return y.createElement(y.Fragment,null,e);let{target:n}=t;return n?He.createPortal(y.createElement(y.Fragment,null,e),n):null}function Tx({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=y.useState(null),c=tr();return y.useEffect(()=>{if(r&&s)return c.addEventListener(s,"reset",r)},[s,t,r]),y.createElement(Px,null,y.createElement(Ax,{setForm:i,formId:t}),F0(e).map(([a,l])=>y.createElement(z0,{features:kc.Hidden,...Dn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:l,...o})})))}function Ax({setForm:e,formId:t}){return y.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:y.createElement(z0,{features:kc.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Nx=y.createContext(void 0);function U0(){return y.useContext(Nx)}function _0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Zs(e){return _0(e)&&"tagName"in e}function mn(e){return Zs(e)&&"accessKey"in e}function Mr(e){return Zs(e)&&"tabIndex"in e}function Cx(e){return Zs(e)&&"style"in e}function Ox(e){return mn(e)&&e.nodeName==="IFRAME"}function W0(e){return mn(e)&&e.nodeName==="INPUT"}function V0(e){return mn(e)&&e.nodeName==="LABEL"}function Ix(e){return mn(e)&&e.nodeName==="FIELDSET"}function H0(e){return mn(e)&&e.nodeName==="LEGEND"}function kx(e){return Zs(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function G0(e){let t=e.parentElement,n=null;for(;t&&!Ix(t);)H0(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&$x(n)?!1:r}function $x(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(H0(t))return!1;t=t.previousElementSibling}return!0}let q0=Symbol();function Mx(e,t=!0){return Object.assign(e,{[q0]:t})}function vt(...e){let t=y.useRef(e);y.useEffect(()=>{t.current=e},[e]);let n=be(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[q0]))?void 0:n}let $c=y.createContext(null);$c.displayName="DescriptionContext";function K0(){let e=y.useContext($c);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,K0),t}return e}function Dx(){var e,t;return(t=(e=y.useContext($c))==null?void 0:e.value)!=null?t:void 0}let Bx="p";function Lx(e,t){let n=y.useId(),r=Cc(),{id:o=`headlessui-description-${n}`,...s}=e,i=K0(),c=vt(t);Te(()=>i.register(o),[o,i.register]);let a=$n({...i.slot,disabled:r||!1}),l={ref:c,...i.props,id:o};return ut()({ourProps:l,theirProps:s,slot:a,defaultTag:Bx,name:i.name||"Description"})}let Fx=Je(Lx);Object.assign(Fx,{});var Be=(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))(Be||{});let Ys=y.createContext(null);Ys.displayName="LabelContext";function Z0(){let e=y.useContext(Ys);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,Z0),t}return e}function Y0(e){var t,n,r;let o=(n=(t=y.useContext(Ys))==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 Rx({inherit:e=!1}={}){let t=Y0(),[n,r]=y.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,y.useMemo(()=>function(s){let i=be(a=>(r(l=>[...l,a]),()=>r(l=>{let u=l.slice(),f=u.indexOf(a);return f!==-1&&u.splice(f,1),u}))),c=y.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 y.createElement(Ys.Provider,{value:c},s.children)},[r])]}let jx="label";function zx(e,t){var n;let r=y.useId(),o=Z0(),s=U0(),i=Cc(),{id:c=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...u}=e,f=vt(t);Te(()=>o.register(c),[c,o.register]);let p=be(m=>{let v=m.currentTarget;if(!(m.target!==m.currentTarget&&kx(m.target))&&(V0(v)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),V0(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;(W0(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=$n({...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),ut()({ourProps:h,theirProps:u,slot:d,defaultTag:a?jx:"div",name:o.name||"Label"})}let Ux=Je(zx),_x=Object.assign(Ux,{});function Wx(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=Wx){return y.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 X0(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Hx(e,t,n=!1){let[r,o]=y.useState(()=>X0(t));return Te(()=>{if(!t||!e)return;let s=lt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(c=>{let a=X0(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 J0=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(J0||{});function Gx(e){let t=y.useRef(null),n=be(o=>{t.current=o.pointerType,!G0(o.currentTarget)&&o.pointerType==="mouse"&&o.button===J0.Left&&(o.preventDefault(),e(o))}),r=be(o=>{t.current!=="mouse"&&(G0(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let Q0=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 qx=Object.defineProperty,Kx=(e,t,n)=>t in e?qx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zx=(e,t,n)=>(Kx(e,t+"",n),n),ep=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},wt=(e,t,n)=>(ep(e,t,"read from private field"),n?n.call(e):t.get(e)),Mc=(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)},tp=(e,t,n,r)=>(ep(e,t,"write to private field"),t.set(e,n),n),qt,_o,Wo;let np=class{constructor(t){Mc(this,qt,{}),Mc(this,_o,new Q0(()=>new Set)),Mc(this,Wo,new Set),Zx(this,"disposables",lt()),tp(this,qt,t),Gt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return wt(this,qt)}subscribe(t,n){if(Gt.isServer)return()=>{};let r={selector:t,callback:n,current:t(wt(this,qt))};return wt(this,Wo).add(r),this.disposables.add(()=>{wt(this,Wo).delete(r)})}on(t,n){return Gt.isServer?()=>{}:(wt(this,_o).get(t).add(n),this.disposables.add(()=>{wt(this,_o).get(t).delete(n)}))}send(t){let n=this.reduce(wt(this,qt),t);if(n!==wt(this,qt)){tp(this,qt,n);for(let r of wt(this,Wo)){let o=r.selector(wt(this,qt));rp(r.current,o)||(r.current=o,r.callback(o))}for(let r of wt(this,_o).get(t.type))r(wt(this,qt),t)}}};qt=new WeakMap,_o=new WeakMap,Wo=new WeakMap;function rp(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:Dc(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Dc(e.entries(),t.entries()):op(e)&&op(t)?Dc(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Dc(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 op(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Bc(e){let[t,n]=e(),r=lt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Yx=Object.defineProperty,Xx=(e,t,n)=>t in e?Yx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sp=(e,t,n)=>(Xx(e,typeof t!="symbol"?t+"":t,n),n),ip=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(ip||{});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}}},Qx=class Wm extends np{constructor(){super(...arguments),sp(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),sp(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Wm({stack:[]})}reduce(t,n){return yt(n.type,Jx,t,n)}};const Lc=new Q0(()=>Qx.new());var Fc={exports:{}},Rc={};/**
120
120
  * @license React
121
121
  * use-sync-external-store-with-selector.production.js
122
122
  *
@@ -124,7 +124,7 @@ ${Tg(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 ap;function Qx(){if(ap)return Rc;ap=1;var e=y;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 Rc.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 w(D){if(!P){if(P=!0,E=D,D=f(D),p!==void 0&&h.hasValue){var F=h.value;if(p(F,D))return T=F}return T=D}if(F=T,n(E,D))return F;var L=f(D);return p!==void 0&&p(F,L)?(E=D,F):(E=D,T=L)}var P=!1,E,T,A=u===void 0?null:u;return[function(){return w(l())},A===null?void 0:function(){return w(A())}]},[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},Rc}var jc={};/**
127
+ */var ap;function e2(){if(ap)return Rc;ap=1;var e=y;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 Rc.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(D){if(!T){if(T=!0,E=D,D=f(D),p!==void 0&&h.hasValue){var F=h.value;if(p(F,D))return S=F}return S=D}if(F=S,n(E,D))return F;var L=f(D);return p!==void 0&&p(F,L)?(E=D,F):(E=D,S=L)}var T=!1,E,S,A=u===void 0?null:u;return[function(){return v(l())},A===null?void 0:function(){return v(A())}]},[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},Rc}var jc={};/**
128
128
  * @license React
129
129
  * use-sync-external-store-with-selector.development.js
130
130
  *
@@ -132,11 +132,11 @@ ${Tg(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 cp;function e2(){return cp||(cp=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=y,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;jc.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 w(D){if(!P){if(P=!0,E=D,D=f(D),p!==void 0&&h.hasValue){var F=h.value;if(p(F,D))return T=F}return T=D}if(F=T,n(E,D))return F;var L=f(D);return p!==void 0&&p(F,L)?(E=D,F):(E=D,T=L)}var P=!1,E,T,A=u===void 0?null:u;return[function(){return w(l())},A===null?void 0:function(){return w(A())}]},[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())}()),jc}process.env.NODE_ENV==="production"?Fc.exports=Qx():Fc.exports=e2();var t2=Fc.exports;function Qe(e,t,n=rp){return t2.useSyncExternalStoreWithSelector(be(r=>e.subscribe(n2,r)),be(()=>e.state),be(()=>e.state),be(t),n)}function n2(e){return e}function lp(e,t){let n=y.useId(),r=Lc.get(t),[o,s]=Qe(r,y.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Te(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let zc=new Map,Vo=new Map;function up(e){var t;let n=(t=Vo.get(e))!=null?t:0;return Vo.set(e,n+1),n!==0?()=>fp(e):(zc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>fp(e))}function fp(e){var t;let n=(t=Vo.get(e))!=null?t:1;if(n===1?Vo.delete(e):Vo.set(e,n-1),n!==1)return;let r=zc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,zc.delete(e))}function r2(e,{allowed:t,disallowed:n}={}){let r=lp(e,"inert-others");Te(()=>{var o,s;if(!r)return;let i=lt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(up(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let l=Hs(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(up(f));u=u.parentElement}}return i.dispose},[r,t,n])}function o2(e,t,n){let r=nr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});y.useEffect(()=>{if(!e)return;let o=t===null?null:mn(t)?t:t.current;if(!o)return;let s=lt();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 Uc=["[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(","),s2=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var _c=(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))(_c||{}),i2=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(i2||{}),a2=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(a2||{});function dp(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Uc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function c2(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(s2)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Wc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Wc||{});function pp(e,t=0){var n;return e===((n=Hs(e))==null?void 0:n.body)?!1:yt(t,{0(){return e.matches(Uc)},1(){let r=e;for(;r!==null;){if(r.matches(Uc))return!0;r=r.parentElement}return!1}})}var l2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(l2||{});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 u2=["textarea","input"].join(",");function f2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,u2))!=null?n:!1}function hp(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 d2(e,t,n=e===null?document.body:Gs(e)){return p2(dp(n),t,{relativeTo:e})}function p2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Gs(e[0]):document:Gs(e),i=Array.isArray(e)?n?hp(e):e:t&64?c2(e):dp(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!==M0(p));return t&6&&f2(p)&&p.select(),2}function mp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function h2(){return/Android/gi.test(window.navigator.userAgent)}function bp(){return mp()||h2()}function Dr(e,t,n,r){let o=nr(n);y.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 m2(e,t,n,r){let o=nr(n);y.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 gp=30;function b2(e,t,n){let r=nr(n),o=y.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!pp(l,Wc.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),s=y.useRef(null);Dr(e,"pointerdown",c=>{var a,l;bp()||(s.current=((l=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:l[0])||c.target)},!0),Dr(e,"pointerup",c=>{if(bp()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=y.useRef({x:0,y:0});Dr(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Dr(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=gp||Math.abs(a.y-i.current.y)>=gp))return o(c,()=>Mr(c.target)?c.target:null)},!0),m2(e,"blur",c=>o(c,()=>Cx(window.document.activeElement)?window.document.activeElement:null),!0)}function Vc(...e){return y.useMemo(()=>Hs(...e),[...e])}var g2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(g2||{});const Xs={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},y2=200,yp=5;function v2(e,{trigger:t,action:n,close:r,select:o}){let s=y.useRef(null),i=y.useRef(null),c=y.useRef(null);Dr(e&&t!==null,"pointerdown",a=>{_0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Dr(e&&t!==null,"pointerup",a=>{var l,u;let f=s.current;if(f===null||(s.current=null,!Mr(a.target))||Math.abs(a.x-((l=i.current)!=null?l:a.x))<yp&&Math.abs(a.y-((u=c.current)!=null?u:a.y))<yp)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-f>y2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function w2(e,t){return y.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 x2(e){return y.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function E2(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 S2(){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 P2(){return mp()?{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=lt();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(Mr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),u=e.querySelector(l);Mr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Mr(a.target)&&Nx(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(Mr(c.target)){if(W0(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 T2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function vp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let rr=E2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:lt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=vp(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=vp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[P2(),S2(),T2()];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)}});rr.subscribe(()=>{let e=rr.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)&&rr.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&rr.dispatch("TEARDOWN",n)}});function A2(e,t,n=()=>({containers:[]})){let r=x2(rr),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Te(()=>{if(!(!t||!e))return rr.dispatch("PUSH",t,n),()=>rr.dispatch("POP",t,n)},[e,t]),s}function N2(e,t,n=()=>[document.body]){let r=lp(e,"scroll-lock");A2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function wp(e){return[e.screenX,e.screenY]}function C2(){let e=y.useRef([-1,-1]);return{wasMoved(t){let n=wp(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=wp(t)}}}function O2(e=0){let[t,n]=y.useState(e),r=y.useCallback(a=>n(a),[]),o=y.useCallback(a=>n(l=>l|a),[]),s=y.useCallback(a=>(t&a)===a,[t]),i=y.useCallback(a=>n(l=>l&~a),[]),c=y.useCallback(a=>n(l=>l^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var xp,Ep;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((xp=process==null?void 0:process.env)==null?void 0:xp.NODE_ENV)==="test"&&typeof((Ep=Element==null?void 0:Element.prototype)==null?void 0:Ep.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 I2=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(I2||{});function Sp(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Pp(e,t,n,r){let[o,s]=y.useState(n),{hasFlag:i,addFlag:c,removeFlag:a}=O2(e&&o?3:0),l=y.useRef(!1),u=y.useRef(!1),f=tr();return Te(()=>{var p;if(e){if(n&&s(!0),!t){n&&c(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),$2(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(c(3),a(4)):(c(4),a(2)))},run(){u.current?n?(a(3),c(4)):(a(4),c(3)):n?a(1):c(1)},done(){var d;u.current&&D2(t)||(l.current=!1,a(7),n||s(!1),(d=r==null?void 0:r.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function $2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=lt();return M2(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(k2(e,r))})}),s.dispose}function k2(e,t){var n,r;let o=lt();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 M2(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 D2(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 Js(){return typeof window<"u"}function Br(e){return Hc(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kt(e){var t;return(t=(Hc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hc(e){return Js()?e instanceof Node||e instanceof et(e).Node:!1}function ge(e){return Js()?e instanceof Element||e instanceof et(e).Element:!1}function We(e){return Js()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Gc(e){return!Js()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const B2=new Set(["inline","contents"]);function Ho(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!B2.has(o)}const L2=new Set(["table","td","th"]);function F2(e){return L2.has(Br(e))}const R2=[":popover-open",":modal"];function Qs(e){return R2.some(t=>{try{return e.matches(t)}catch{return!1}})}const j2=["transform","translate","scale","rotate","perspective"],z2=["transform","translate","scale","rotate","perspective","filter"],U2=["paint","layout","strict","content"];function qc(e){const t=ei(),n=ge(e)?xt(e):e;return j2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||z2.some(r=>(n.willChange||"").includes(r))||U2.some(r=>(n.contain||"").includes(r))}function _2(e){let t=gn(e);for(;We(t)&&!bn(t);){if(qc(t))return t;if(Qs(t))return null;t=gn(t)}return null}function ei(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const W2=new Set(["html","body","#document"]);function bn(e){return W2.has(Br(e))}function xt(e){return et(e).getComputedStyle(e)}function ti(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gn(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gc(e)&&e.host||Kt(e);return Gc(t)?t.host:t}function Tp(e){const t=gn(e);return bn(t)?e.ownerDocument?e.ownerDocument.body:e.body:We(t)&&Ho(t)?t:Tp(t)}function Bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Tp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=et(o);if(s){const c=Kc(i);return t.concat(i,i.visualViewport||[],Ho(o)?o:[],c&&n?Bn(c):[])}return t.concat(o,Bn(o,[],n))}function Kc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function V2(){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 yn=Math.min,Re=Math.max,Go=Math.round,ni=Math.floor,Zt=e=>({x:e,y:e}),H2={left:"right",right:"left",bottom:"top",top:"bottom"},G2={start:"end",end:"start"};function Zc(e,t,n){return Re(e,yn(t,n))}function or(e,t){return typeof e=="function"?e(t):e}function Ln(e){return e.split("-")[0]}function Lr(e){return e.split("-")[1]}function Ap(e){return e==="x"?"y":"x"}function Yc(e){return e==="y"?"height":"width"}const q2=new Set(["top","bottom"]);function vn(e){return q2.has(Ln(e))?"y":"x"}function Xc(e){return Ap(vn(e))}function K2(e,t,n){n===void 0&&(n=!1);const r=Lr(e),o=Xc(e),s=Yc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ri(i)),[i,ri(i)]}function Z2(e){const t=ri(e);return[Jc(e),t,Jc(t)]}function Jc(e){return e.replace(/start|end/g,t=>G2[t])}const Np=["left","right"],Cp=["right","left"],Y2=["top","bottom"],X2=["bottom","top"];function J2(e,t,n){switch(e){case"top":case"bottom":return n?t?Cp:Np:t?Np:Cp;case"left":case"right":return t?Y2:X2;default:return[]}}function Q2(e,t,n,r){const o=Lr(e);let s=J2(Ln(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Jc)))),s}function ri(e){return e.replace(/left|right|bottom|top/g,t=>H2[t])}function eE(e){return{top:0,right:0,bottom:0,left:0,...e}}function Op(e){return typeof e!="number"?eE(e):{top:e,right:e,bottom:e,left:e}}function oi(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}}/*!
135
+ */var cp;function t2(){return cp||(cp=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=y,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,c=t.useDebugValue;jc.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(D){if(!T){if(T=!0,E=D,D=f(D),p!==void 0&&h.hasValue){var F=h.value;if(p(F,D))return S=F}return S=D}if(F=S,n(E,D))return F;var L=f(D);return p!==void 0&&p(F,L)?(E=D,F):(E=D,S=L)}var T=!1,E,S,A=u===void 0?null:u;return[function(){return v(l())},A===null?void 0:function(){return v(A())}]},[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())}()),jc}process.env.NODE_ENV==="production"?Fc.exports=e2():Fc.exports=t2();var n2=Fc.exports;function Qe(e,t,n=rp){return n2.useSyncExternalStoreWithSelector(be(r=>e.subscribe(r2,r)),be(()=>e.state),be(()=>e.state),be(t),n)}function r2(e){return e}function lp(e,t){let n=y.useId(),r=Lc.get(t),[o,s]=Qe(r,y.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Te(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let zc=new Map,Vo=new Map;function up(e){var t;let n=(t=Vo.get(e))!=null?t:0;return Vo.set(e,n+1),n!==0?()=>fp(e):(zc.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>fp(e))}function fp(e){var t;let n=(t=Vo.get(e))!=null?t:1;if(n===1?Vo.delete(e):Vo.set(e,n-1),n!==1)return;let r=zc.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,zc.delete(e))}function o2(e,{allowed:t,disallowed:n}={}){let r=lp(e,"inert-others");Te(()=>{var o,s;if(!r)return;let i=lt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(up(a));let c=(s=t==null?void 0:t())!=null?s:[];for(let a of c){if(!a)continue;let l=Hs(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(up(f));u=u.parentElement}}return i.dispose},[r,t,n])}function s2(e,t,n){let r=nr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});y.useEffect(()=>{if(!e)return;let o=t===null?null:mn(t)?t:t.current;if(!o)return;let s=lt();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 Uc=["[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(","),i2=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var _c=(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))(_c||{}),a2=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(a2||{}),c2=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(c2||{});function dp(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Uc)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function l2(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(i2)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Wc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Wc||{});function pp(e,t=0){var n;return e===((n=Hs(e))==null?void 0:n.body)?!1:yt(t,{0(){return e.matches(Uc)},1(){let r=e;for(;r!==null;){if(r.matches(Uc))return!0;r=r.parentElement}return!1}})}var u2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(u2||{});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 f2=["textarea","input"].join(",");function d2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,f2))!=null?n:!1}function hp(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 p2(e,t,n=e===null?document.body:Gs(e)){return h2(dp(n),t,{relativeTo:e})}function h2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Gs(e[0]):document:Gs(e),i=Array.isArray(e)?n?hp(e):e:t&64?l2(e):dp(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!==M0(p));return t&6&&d2(p)&&p.select(),2}function mp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function m2(){return/Android/gi.test(window.navigator.userAgent)}function bp(){return mp()||m2()}function Dr(e,t,n,r){let o=nr(n);y.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 b2(e,t,n,r){let o=nr(n);y.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 gp=30;function g2(e,t,n){let r=nr(n),o=y.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!pp(l,Wc.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),s=y.useRef(null);Dr(e,"pointerdown",c=>{var a,l;bp()||(s.current=((l=(a=c.composedPath)==null?void 0:a.call(c))==null?void 0:l[0])||c.target)},!0),Dr(e,"pointerup",c=>{if(bp()||!s.current)return;let a=s.current;return s.current=null,o(c,()=>a)},!0);let i=y.useRef({x:0,y:0});Dr(e,"touchstart",c=>{i.current.x=c.touches[0].clientX,i.current.y=c.touches[0].clientY},!0),Dr(e,"touchend",c=>{let a={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=gp||Math.abs(a.y-i.current.y)>=gp))return o(c,()=>Mr(c.target)?c.target:null)},!0),b2(e,"blur",c=>o(c,()=>Ox(window.document.activeElement)?window.document.activeElement:null),!0)}function Vc(...e){return y.useMemo(()=>Hs(...e),[...e])}var y2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(y2||{});const Xs={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},v2=200,yp=5;function w2(e,{trigger:t,action:n,close:r,select:o}){let s=y.useRef(null),i=y.useRef(null),c=y.useRef(null);Dr(e&&t!==null,"pointerdown",a=>{_0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,c.current=a.y,s.current=a.timeStamp)}),Dr(e&&t!==null,"pointerup",a=>{var l,u;let f=s.current;if(f===null||(s.current=null,!Mr(a.target))||Math.abs(a.x-((l=i.current)!=null?l:a.x))<yp&&Math.abs(a.y-((u=c.current)!=null?u:a.y))<yp)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-f>v2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function x2(e,t){return y.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 E2(e){return y.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function S2(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 P2(){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 T2(){return mp()?{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=lt();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(Mr(c.target))try{let a=c.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),u=e.querySelector(l);Mr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(c=>{t.addEventListener(e,"touchstart",a=>{if(c.dispose(),Mr(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(Mr(c.target)){if(W0(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 A2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function vp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let rr=S2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:lt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=vp(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=vp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[T2(),P2(),A2()];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)}});rr.subscribe(()=>{let e=rr.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)&&rr.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&rr.dispatch("TEARDOWN",n)}});function N2(e,t,n=()=>({containers:[]})){let r=E2(rr),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Te(()=>{if(!(!t||!e))return rr.dispatch("PUSH",t,n),()=>rr.dispatch("POP",t,n)},[e,t]),s}function C2(e,t,n=()=>[document.body]){let r=lp(e,"scroll-lock");N2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function wp(e){return[e.screenX,e.screenY]}function O2(){let e=y.useRef([-1,-1]);return{wasMoved(t){let n=wp(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=wp(t)}}}function I2(e=0){let[t,n]=y.useState(e),r=y.useCallback(a=>n(a),[]),o=y.useCallback(a=>n(l=>l|a),[]),s=y.useCallback(a=>(t&a)===a,[t]),i=y.useCallback(a=>n(l=>l&~a),[]),c=y.useCallback(a=>n(l=>l^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:c}}var xp,Ep;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((xp=process==null?void 0:process.env)==null?void 0:xp.NODE_ENV)==="test"&&typeof((Ep=Element==null?void 0:Element.prototype)==null?void 0:Ep.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 Sp(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Pp(e,t,n,r){let[o,s]=y.useState(n),{hasFlag:i,addFlag:c,removeFlag:a}=I2(e&&o?3:0),l=y.useRef(!1),u=y.useRef(!1),f=tr();return Te(()=>{var p;if(e){if(n&&s(!0),!t){n&&c(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),$2(t,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(n?(c(3),a(4)):(c(4),a(2)))},run(){u.current?n?(a(3),c(4)):(a(4),c(3)):n?a(1):c(1)},done(){var d;u.current&&B2(t)||(l.current=!1,a(7),n||s(!1),(d=r==null?void 0:r.end)==null||d.call(r,n))}})}},[e,n,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function $2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=lt();return D2(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=lt();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 D2(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 Js(){return typeof window<"u"}function Br(e){return Hc(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kt(e){var t;return(t=(Hc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hc(e){return Js()?e instanceof Node||e instanceof et(e).Node:!1}function ge(e){return Js()?e instanceof Element||e instanceof et(e).Element:!1}function We(e){return Js()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Gc(e){return!Js()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const L2=new Set(["inline","contents"]);function Ho(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!L2.has(o)}const F2=new Set(["table","td","th"]);function R2(e){return F2.has(Br(e))}const j2=[":popover-open",":modal"];function Qs(e){return j2.some(t=>{try{return e.matches(t)}catch{return!1}})}const z2=["transform","translate","scale","rotate","perspective"],U2=["transform","translate","scale","rotate","perspective","filter"],_2=["paint","layout","strict","content"];function qc(e){const t=ei(),n=ge(e)?xt(e):e;return z2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||U2.some(r=>(n.willChange||"").includes(r))||_2.some(r=>(n.contain||"").includes(r))}function W2(e){let t=gn(e);for(;We(t)&&!bn(t);){if(qc(t))return t;if(Qs(t))return null;t=gn(t)}return null}function ei(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const V2=new Set(["html","body","#document"]);function bn(e){return V2.has(Br(e))}function xt(e){return et(e).getComputedStyle(e)}function ti(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gn(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gc(e)&&e.host||Kt(e);return Gc(t)?t.host:t}function Tp(e){const t=gn(e);return bn(t)?e.ownerDocument?e.ownerDocument.body:e.body:We(t)&&Ho(t)?t:Tp(t)}function Bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Tp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=et(o);if(s){const c=Kc(i);return t.concat(i,i.visualViewport||[],Ho(o)?o:[],c&&n?Bn(c):[])}return t.concat(o,Bn(o,[],n))}function Kc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H2(){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 yn=Math.min,Re=Math.max,Go=Math.round,ni=Math.floor,Zt=e=>({x:e,y:e}),G2={left:"right",right:"left",bottom:"top",top:"bottom"},q2={start:"end",end:"start"};function Zc(e,t,n){return Re(e,yn(t,n))}function or(e,t){return typeof e=="function"?e(t):e}function Ln(e){return e.split("-")[0]}function Lr(e){return e.split("-")[1]}function Ap(e){return e==="x"?"y":"x"}function Yc(e){return e==="y"?"height":"width"}const K2=new Set(["top","bottom"]);function vn(e){return K2.has(Ln(e))?"y":"x"}function Xc(e){return Ap(vn(e))}function Z2(e,t,n){n===void 0&&(n=!1);const r=Lr(e),o=Xc(e),s=Yc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ri(i)),[i,ri(i)]}function Y2(e){const t=ri(e);return[Jc(e),t,Jc(t)]}function Jc(e){return e.replace(/start|end/g,t=>q2[t])}const Np=["left","right"],Cp=["right","left"],X2=["top","bottom"],J2=["bottom","top"];function Q2(e,t,n){switch(e){case"top":case"bottom":return n?t?Cp:Np:t?Np:Cp;case"left":case"right":return t?X2:J2;default:return[]}}function eE(e,t,n,r){const o=Lr(e);let s=Q2(Ln(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Jc)))),s}function ri(e){return e.replace(/left|right|bottom|top/g,t=>G2[t])}function tE(e){return{top:0,right:0,bottom:0,left:0,...e}}function Op(e){return typeof e!="number"?tE(e):{top:e,right:e,bottom:e,left:e}}function oi(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
137
  * tabbable 6.3.0
138
138
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
139
- */var tE=["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])"],Qc=tE.join(","),Ip=typeof Element>"u",qo=Ip?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,si=!Ip&&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},Ko=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&&Ko(t.parentNode);return i},nE=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},rE=function(t,n,r){if(Ko(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Qc));return n&&qo.call(t,Qc)&&o.unshift(t),o=o.filter(r),o},el=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ko(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=el(a,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=qo.call(i,Qc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Ko(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var d=el(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},$p=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},kp=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||nE(t))&&!$p(t)?0:t.tabIndex},oE=function(t,n){var r=kp(t);return r<0&&n&&!$p(t)?0:r},sE=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Mp=function(t){return t.tagName==="INPUT"},iE=function(t){return Mp(t)&&t.type==="hidden"},aE=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},cE=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},lE=function(t){if(!t.name)return!0;var n=t.form||si(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=cE(o,t.form);return!s||s===t},uE=function(t){return Mp(t)&&t.type==="radio"},fE=function(t){return uE(t)&&!lE(t)},dE=function(t){var n,r=t&&si(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=si(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},Dp=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},pE=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=qo.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(qo.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=si(t);if(l&&!l.shadowRoot&&o(l)===!0)return Dp(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(dE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Dp(t);return!1},hE=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 qo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},mE=function(t,n){return!(n.disabled||Ko(n)||iE(n)||pE(n,t)||aE(n)||hE(n))},Bp=function(t,n){return!(fE(n)||kp(n)<0||!mE(t,n))},bE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Lp=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=oE(c,i),l=i?Lp(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(sE).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Fp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=el([t],n.includeContainer,{filter:Bp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:bE}):r=rE(t,n.includeContainer,Bp.bind(null,n)),Lp(r)};function Rp(e,t,n){let{reference:r,floating:o}=e;const s=vn(t),i=Xc(t),c=Yc(i),a=Ln(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(Lr(t)){case"start":d[i]-=p*(n&&l?-1:1);break;case"end":d[i]+=p*(n&&l?-1:1);break}return d}const gE=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}=Rp(l,r,a),p=r,d={},h=0;for(let m=0;m<c.length;m++){const{name:w,fn:P}=c[m],{x:E,y:T,data:A,reset:D}=await P({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=T??f,d={...d,[w]:{...d[w],...A}},D&&h<=50&&(h++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(l=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:u,y:f}=Rp(l,p,a)),m=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}};async function ii(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}=or(t,e),h=Op(d),w=c[p?f==="floating"?"reference":"floating":f],P=oi(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:u,strategy:a})),E=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),A=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},D=oi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:T,strategy:a}):E);return{top:(P.top-D.top+h.top)/A.y,bottom:(D.bottom-P.bottom+h.bottom)/A.y,left:(P.left-D.left+h.left)/A.x,right:(D.right-P.right+h.right)/A.x}}const yE=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}=or(e,t)||{};if(l==null)return{};const f=Op(u),p={x:n,y:r},d=Xc(o),h=Yc(d),m=await i.getDimensions(l),w=d==="y",P=w?"top":"left",E=w?"bottom":"right",T=w?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[d]-p[d]-s.floating[h],D=p[d]-s.reference[d],F=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let L=F?F[T]:0;(!L||!await(i.isElement==null?void 0:i.isElement(F)))&&(L=c.floating[T]||s.floating[h]);const b=A/2-D/2,g=L/2-m[h]/2-1,x=yn(f[P],g),I=yn(f[E],g),O=x,$=L-m[h]-I,M=L/2-m[h]/2+b,v=Zc(O,M,$),N=!a.arrow&&Lr(o)!=null&&M!==v&&s.reference[h]/2-(M<O?x:I)-m[h]/2<0,k=N?M<O?M-O:M-$:0;return{[d]:p[d]+k,data:{[d]:v,centerOffset:M-v-k,...N&&{alignmentOffset:k}},reset:N}}}),vE=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,...w}=or(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const P=Ln(o),E=vn(c),T=Ln(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),D=p||(T||!m?[ri(c)]:Z2(c)),F=h!=="none";!p&&F&&D.push(...Q2(c,m,h,A));const L=[c,...D],b=await ii(t,w),g=[];let x=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&g.push(b[P]),f){const M=K2(o,i,A);g.push(b[M[0]],b[M[1]])}if(x=[...x,{placement:o,overflows:g}],!g.every(M=>M<=0)){var I,O;const M=(((I=s.flip)==null?void 0:I.index)||0)+1,v=L[M];if(v&&(!(f==="alignment"?E!==vn(v):!1)||x.every(S=>vn(S.placement)===E?S.overflows[0]>0:!0)))return{data:{index:M,overflows:x},reset:{placement:v}};let N=(O=x.filter(k=>k.overflows[0]<=0).sort((k,S)=>k.overflows[1]-S.overflows[1])[0])==null?void 0:O.placement;if(!N)switch(d){case"bestFit":{var $;const k=($=x.filter(S=>{if(F){const B=vn(S.placement);return B===E||B==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(B=>B>0).reduce((B,j)=>B+j,0)]).sort((S,B)=>S[1]-B[1])[0])==null?void 0:$[0];k&&(N=k);break}case"initialPlacement":N=c;break}if(o!==N)return{reset:{placement:N}}}return{}}}},wE=new Set(["left","top"]);async function xE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ln(n),c=Lr(n),a=vn(n)==="y",l=wE.has(i)?-1:1,u=s&&a?-1:1,f=or(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 EE=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 xE(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}}}}},SE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:w=>{let{x:P,y:E}=w;return{x:P,y:E}}},...a}=or(e,t),l={x:n,y:r},u=await ii(t,a),f=vn(Ln(o)),p=Ap(f);let d=l[p],h=l[f];if(s){const w=p==="y"?"top":"left",P=p==="y"?"bottom":"right",E=d+u[w],T=d-u[P];d=Zc(E,d,T)}if(i){const w=f==="y"?"top":"left",P=f==="y"?"bottom":"right",E=h+u[w],T=h-u[P];h=Zc(E,h,T)}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}}}}}},PE=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}=or(e,t),u=await ii(t,l),f=Ln(o),p=Lr(o),d=vn(o)==="y",{width:h,height:m}=s.floating;let w,P;f==="top"||f==="bottom"?(w=f,P=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(P=f,w=p==="end"?"top":"bottom");const E=m-u.top-u.bottom,T=h-u.left-u.right,A=yn(m-u[w],E),D=yn(h-u[P],T),F=!t.middlewareData.shift;let L=A,b=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=E),F&&!p){const x=Re(u.left,0),I=Re(u.right,0),O=Re(u.top,0),$=Re(u.bottom,0);d?b=h-2*(x!==0||I!==0?x+I:Re(u.left,u.right)):L=m-2*(O!==0||$!==0?O+$:Re(u.top,u.bottom))}await a({...t,availableWidth:b,availableHeight:L});const g=await i.getDimensions(c.floating);return h!==g.width||m!==g.height?{reset:{rects:!0}}:{}}}};function jp(e){const t=xt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=We(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Go(n)!==s||Go(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function tl(e){return ge(e)?e:e.contextElement}function Fr(e){const t=tl(e);if(!We(t))return Zt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=jp(t);let i=(s?Go(n.width):n.width)/r,c=(s?Go(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const TE=Zt(0);function zp(e){const t=et(e);return!ei()||!t.visualViewport?TE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=tl(e);let i=Zt(1);t&&(r?ge(r)&&(i=Fr(r)):i=Fr(e));const c=AE(s,n,r)?zp(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=et(s),d=r&&ge(r)?et(r):r;let h=p,m=Kc(h);for(;m&&r&&d!==h;){const w=Fr(m),P=m.getBoundingClientRect(),E=xt(m),T=P.left+(m.clientLeft+parseFloat(E.paddingLeft))*w.x,A=P.top+(m.clientTop+parseFloat(E.paddingTop))*w.y;a*=w.x,l*=w.y,u*=w.x,f*=w.y,a+=T,l+=A,h=et(m),m=Kc(h)}}return oi({width:u,height:f,x:a,y:l})}function ai(e,t){const n=ti(e).scrollLeft;return t?t.left+n:sr(Kt(e)).left+n}function Up(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ai(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function NE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Kt(r),c=t?Qs(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=Zt(1);const u=Zt(0),f=We(r);if((f||!f&&!s)&&((Br(r)!=="body"||Ho(i))&&(a=ti(r)),We(r))){const d=sr(r);l=Fr(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=i&&!f&&!s?Up(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 CE(e){return Array.from(e.getClientRects())}function OE(e){const t=Kt(e),n=ti(e),r=e.ownerDocument.body,o=Re(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Re(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ai(e);const c=-n.scrollTop;return xt(r).direction==="rtl"&&(i+=Re(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const _p=25;function IE(e,t){const n=et(e),r=Kt(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=ei();(!u||u&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const l=ai(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<=_p&&(s-=h)}else l<=_p&&(s+=l);return{width:s,height:i,x:c,y:a}}const $E=new Set(["absolute","fixed"]);function kE(e,t){const n=sr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=We(e)?Fr(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 Wp(e,t,n){let r;if(t==="viewport")r=IE(e,n);else if(t==="document")r=OE(Kt(e));else if(ge(t))r=kE(t,n);else{const o=zp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return oi(r)}function Vp(e,t){const n=gn(e);return n===t||!ge(n)||bn(n)?!1:xt(n).position==="fixed"||Vp(n,t)}function ME(e,t){const n=t.get(e);if(n)return n;let r=Bn(e,[],!1).filter(c=>ge(c)&&Br(c)!=="body"),o=null;const s=xt(e).position==="fixed";let i=s?gn(e):e;for(;ge(i)&&!bn(i);){const c=xt(i),a=qc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&$E.has(o.position)||Ho(i)&&!a&&Vp(e,i))?r=r.filter(u=>u!==i):o=c,i=gn(i)}return t.set(e,r),r}function DE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Qs(t)?[]:ME(t,this._c):[].concat(n),r],c=i[0],a=i.reduce((l,u)=>{const f=Wp(t,u,o);return l.top=Re(f.top,l.top),l.right=yn(f.right,l.right),l.bottom=yn(f.bottom,l.bottom),l.left=Re(f.left,l.left),l},Wp(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function BE(e){const{width:t,height:n}=jp(e);return{width:t,height:n}}function LE(e,t,n){const r=We(t),o=Kt(t),s=n==="fixed",i=sr(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Zt(0);function l(){a.x=ai(o)}if(r||!r&&!s)if((Br(t)!=="body"||Ho(o))&&(c=ti(t)),r){const d=sr(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?Up(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 nl(e){return xt(e).position==="static"}function Hp(e,t){if(!We(e)||xt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Kt(e)===n&&(n=n.ownerDocument.body),n}function Gp(e,t){const n=et(e);if(Qs(e))return n;if(!We(e)){let o=gn(e);for(;o&&!bn(o);){if(ge(o)&&!nl(o))return o;o=gn(o)}return n}let r=Hp(e,t);for(;r&&F2(r)&&nl(r);)r=Hp(r,t);return r&&bn(r)&&nl(r)&&!qc(r)?n:r||_2(e)||n}const FE=async function(e){const t=this.getOffsetParent||Gp,n=this.getDimensions,r=await n(e.floating);return{reference:LE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RE(e){return xt(e).direction==="rtl"}const jE={convertOffsetParentRelativeRectToViewportRelativeRect:NE,getDocumentElement:Kt,getClippingRect:DE,getOffsetParent:Gp,getElementRects:FE,getClientRects:CE,getDimensions:BE,getScale:Fr,isElement:ge,isRTL:RE};function qp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zE(e,t){let n=null,r;const o=Kt(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=ni(f),m=ni(o.clientWidth-(u+p)),w=ni(o.clientHeight-(f+d)),P=ni(u),T={rootMargin:-h+"px "+-m+"px "+-w+"px "+-P+"px",threshold:Re(0,yn(1,a))||1};let A=!0;function D(F){const L=F[0].intersectionRatio;if(L!==a){if(!A)return i();L?i(!1,L):r=setTimeout(()=>{i(!1,1e-7)},1e3)}L===1&&!qp(l,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(D,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return i(!0),s}function Kp(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=tl(e),u=o||s?[...l?Bn(l):[],...Bn(t)]:[];u.forEach(P=>{o&&P.addEventListener("scroll",n,{passive:!0}),s&&P.addEventListener("resize",n)});const f=l&&c?zE(l,n):null;let p=-1,d=null;i&&(d=new ResizeObserver(P=>{let[E]=P;E&&E.target===l&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var T;(T=d)==null||T.observe(t)})),n()}),l&&!a&&d.observe(l),d.observe(t));let h,m=a?sr(e):null;a&&w();function w(){const P=sr(e);m&&!qp(m,P)&&n(),m=P,h=requestAnimationFrame(w)}return n(),()=>{var P;u.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f==null||f(),(P=d)==null||P.disconnect(),d=null,a&&cancelAnimationFrame(h)}}const rl=ii,UE=EE,_E=SE,WE=vE,VE=PE,Zp=yE,HE=(e,t,n)=>{const r=new Map,o={platform:jE,...n},s={...o.platform,_c:r};return gE(e,t,{...o,platform:s})};var GE=typeof document<"u",qE=function(){},ci=GE?y.useLayoutEffect:qE;function li(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(!li(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)&&!li(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Yp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xp(e,t){const n=Yp(e);return Math.round(t*n)/n}function ol(e){const t=z.useRef(e);return ci(()=>{t.current=e}),t}function Jp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,f]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=z.useState(r);li(p,r)||d(r);const[h,m]=z.useState(null),[w,P]=z.useState(null),E=z.useCallback(S=>{S!==F.current&&(F.current=S,m(S))},[]),T=z.useCallback(S=>{S!==L.current&&(L.current=S,P(S))},[]),A=s||h,D=i||w,F=z.useRef(null),L=z.useRef(null),b=z.useRef(u),g=a!=null,x=ol(a),I=ol(o),O=ol(l),$=z.useCallback(()=>{if(!F.current||!L.current)return;const S={placement:t,strategy:n,middleware:p};I.current&&(S.platform=I.current),HE(F.current,L.current,S).then(B=>{const j={...B,isPositioned:O.current!==!1};M.current&&!li(b.current,j)&&(b.current=j,Vr.flushSync(()=>{f(j)}))})},[p,t,n,I,O]);ci(()=>{l===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(S=>({...S,isPositioned:!1})))},[l]);const M=z.useRef(!1);ci(()=>(M.current=!0,()=>{M.current=!1}),[]),ci(()=>{if(A&&(F.current=A),D&&(L.current=D),A&&D){if(x.current)return x.current(A,D,$);$()}},[A,D,$,x,g]);const v=z.useMemo(()=>({reference:F,floating:L,setReference:E,setFloating:T}),[E,T]),N=z.useMemo(()=>({reference:A,floating:D}),[A,D]),k=z.useMemo(()=>{const S={position:n,left:0,top:0};if(!N.floating)return S;const B=Xp(N.floating,u.x),j=Xp(N.floating,u.y);return c?{...S,transform:"translate("+B+"px, "+j+"px)",...Yp(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:j}},[n,c,N.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:$,refs:v,elements:N,floatingStyles:k}),[u,$,v,N,k])}const KE=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?Zp({element:r.current,padding:o}).fn(n):{}:r?Zp({element:r,padding:o}).fn(n):{}}}},sl=(e,t)=>({...UE(e),options:[e,t]}),Qp=(e,t)=>({..._E(e),options:[e,t]}),eh=(e,t)=>({...WE(e),options:[e,t]}),ZE=(e,t)=>({...VE(e),options:[e,t]}),YE=(e,t)=>({...KE(e),options:[e,t]}),th={...z},XE=th.useInsertionEffect||(e=>e());function nh(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return XE(()=>{t.current=e}),z.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var il=typeof document<"u"?y.useLayoutEffect:y.useEffect;let rh=!1,JE=0;const oh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+JE++;function QE(){const[e,t]=z.useState(()=>rh?oh():void 0);return il(()=>{e==null&&t(oh())},[]),z.useEffect(()=>{rh=!0},[]),e}const e8=th.useId||QE;let Zo;process.env.NODE_ENV!=="production"&&(Zo=new Set);function t8(){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=Zo)!=null&&e.has(o))){var s;(s=Zo)==null||s.add(o),console.warn(o)}}function n8(){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=Zo)!=null&&e.has(o))){var s;(s=Zo)==null||s.add(o),console.error(o)}}function r8(){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 o8=z.createContext(null),s8=z.createContext(null),i8=()=>{var e;return((e=z.useContext(o8))==null?void 0:e.id)||null},a8=()=>z.useContext(s8),c8="data-floating-ui-focusable";function l8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=e8(),s=z.useRef({}),[i]=z.useState(()=>r8()),c=i8()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!ge(d)&&n8("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=z.useState(r.reference),u=nh((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=z.useMemo(()=>({setPositionReference:l}),[]),p=z.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function u8(e){e===void 0&&(e={});const{nodeId:t}=e,n=l8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=z.useState(null),[c,a]=z.useState(null),u=(o==null?void 0:o.domReference)||s,f=z.useRef(null),p=a8();il(()=>{u&&(f.current=u)},[u]);const d=Jp({...e,elements:{...o,...c&&{reference:c}}}),h=z.useCallback(T=>{const A=ge(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;a(A),d.refs.setReference(A)},[d.refs]),m=z.useCallback(T=>{(ge(T)||T===null)&&(f.current=T,i(T)),(ge(d.refs.reference.current)||d.refs.reference.current===null||T!==null&&!ge(T))&&d.refs.setReference(T)},[d.refs]),w=z.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),P=z.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=z.useMemo(()=>({...d,...r,refs:w,elements:P,nodeId:t}),[d,w,P,t,r]);return il(()=>{r.dataRef.current.floatingContext=E;const T=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);T&&(T.context=E)}),z.useMemo(()=>({...d,context:E,refs:w,elements:P}),[d,w,P,E])}const sh="active",ih="selected";function al(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[sh]:i,[ih]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[c8]:""},...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&&[sh,ih].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(w=>w(...h)).find(w=>w!==void 0)}}}else i[l]=u}),i),{})}}function f8(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=z.useCallback(c=>al(c,e,"reference"),t),s=z.useCallback(c=>al(c,e,"floating"),n),i=z.useCallback(c=>al(c,e,"item"),r);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function ah(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const d8=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}=or(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,w=p.clientTop!==0,P=h.clientTop!==0,E=p===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||t8('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const T={...t,...await sl(-d.offsetTop-p.clientTop-f.reference.height/2-d.offsetHeight/2-s).fn(t)},A=await rl(ah(T,h.scrollHeight+m+p.clientTop),u),D=await rl(T,{...u,elementContext:"reference"}),F=Re(0,A.top),L=T.y+F,x=(h.scrollHeight>h.clientHeight?I=>I:Go)(Re(0,h.scrollHeight+(w&&E||P?m*2:0)-F-Re(0,A.bottom)));if(h.style.maxHeight=x+"px",h.scrollTop=F,o){const I=h.offsetHeight<d.offsetHeight*yn(c,n.current.length)-1||D.top>=-a||D.bottom>=-a;Vr.flushSync(()=>o(I))}return r&&(r.current=await rl(ah({...T,y:L},h.offsetHeight+m+p.clientTop),u)),{y:L}}});function p8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=nh(c),l=z.useRef(!1),u=z.useRef(null),f=z.useRef(null);z.useEffect(()=>{if(!o)return;function d(m){if(m.ctrlKey||!h||s.current==null)return;const w=m.deltaY,P=s.current.top>=-.5,E=s.current.bottom>=-.5,T=h.scrollHeight-h.clientHeight,A=w<0?-1:1,D=w<0?"max":"min";h.scrollHeight<=h.clientHeight||(!P&&w>0||!E&&w<0?(m.preventDefault(),Vr.flushSync(()=>{a(F=>F+Math[D](w,T*A))})):/firefox/i.test(V2())&&(h.scrollTop+=w))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",d),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{u.current=null,f.current=null,h.removeEventListener("wheel",d)}},[o,n,r.floating,s,i,a]);const p=z.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const d=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!d||!l.current)){if(u.current!==null){const h=d.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Vr.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{u.current=d.scrollTop})}}}),[r.floating,a,s,i]);return z.useMemo(()=>o?{floating:p}:{},[o,p])}let Rr=y.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rr.displayName="FloatingContext";let cl=y.createContext(null);cl.displayName="PlacementContext";function h8(e){return y.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function m8(){return y.useContext(Rr).setReference}function b8(){return y.useContext(Rr).getReferenceProps}function g8(){let{getFloatingProps:e,slot:t}=y.useContext(Rr);return y.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function y8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=y.useContext(cl),n=y.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Te(()=>{t==null||t(n??null)},[t,n]);let r=y.useContext(Rr);return y.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let ch=4;function v8({children:e,enabled:t=!0}){let[n,r]=y.useState(null),[o,s]=y.useState(0),i=y.useRef(null),[c,a]=y.useState(null);w8(c);let l=t&&n!==null&&c!==null,{to:u="bottom",gap:f=0,offset:p=0,padding:d=0,inner:h}=x8(n,c),[m,w="center"]=u.split(" ");Te(()=>{l&&s(0)},[l]);let{refs:P,floatingStyles:E,context:T}=u8({open:l,placement:m==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${m}`:`${m}-${w}`,strategy:"absolute",transform:!1,middleware:[sl({mainAxis:m==="selection"?0:f,crossAxis:p}),Qp({padding:d}),m!=="selection"&&eh({padding:d}),m==="selection"&&h?d8({...h,padding:d,overflowRef:i,offset:o,minItemsVisible:ch,referenceOverflowThreshold:d,onFallbackChange(I){var O,$;if(!I)return;let M=T.elements.floating;if(!M)return;let v=parseFloat(getComputedStyle(M).scrollPaddingBottom)||0,N=Math.min(ch,M.childElementCount),k=0,S=0;for(let B of($=(O=T.elements.floating)==null?void 0:O.childNodes)!=null?$:[])if(mn(B)){let j=B.offsetTop,U=j+B.clientHeight+v,_=M.scrollTop,q=_+M.clientHeight;if(j>=_&&U<=q)N--;else{S=Math.max(0,Math.min(U,q)-Math.max(j,_)),k=B.clientHeight;break}}N>=1&&s(B=>{let j=k*N-S+v;return B>=j?B:j})}}):null,ZE({padding:d,apply({availableWidth:I,availableHeight:O,elements:$}){Object.assign($.floating.style,{overflow:"auto",maxWidth:`${I}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${O}px)`})}})].filter(Boolean),whileElementsMounted:Kp}),[A=m,D=w]=T.placement.split("-");m==="selection"&&(A="selection");let F=y.useMemo(()=>({anchor:[A,D].filter(Boolean).join(" ")}),[A,D]),L=p8(T,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:g}=f8([L]),x=be(I=>{a(I),P.setFloating(I)});return z.createElement(cl.Provider,{value:r},z.createElement(Rr.Provider,{value:{setFloating:x,setReference:P.setReference,styles:E,getReferenceProps:b,getFloatingProps:g,slot:F}},e))}function w8(e){Te(()=>{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 x8(e,t){var n,r,o;let s=ll((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=ll((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=ll((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function ll(e,t,n=void 0){let r=tr(),o=be((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=uh(a,l);return[u,f=>{let p=lh(a);{let d=p.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[P,E]of p.entries()){let T=window.getComputedStyle(l).getPropertyValue(E);if(d[P]!==T){d[P]=T,m=!0;break}}if(!m)return;let w=uh(a,l);u!==w&&(f(w),u=w)})}return r.dispose}]}return[n,null]}),s=y.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=y.useState();return Te(()=>{let[a,l]=o(e,t);if(c(a),!!l)return l(c)},[e,t]),i}function lh(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,...lh(o)]:[r]}return[]}function uh(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 E8({children:e,freeze:t},n){let r=fh(t,e);return y.isValidElement(r)?y.cloneElement(r,{ref:n}):y.createElement(y.Fragment,null,r)}y.forwardRef(E8);function fh(e,t){let[n,r]=y.useState(t);return!e&&n!==t&&r(t),e?n:t}let ul=y.createContext(null);ul.displayName="OpenClosedContext";var Ft=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ft||{});function fl(){return y.useContext(ul)}function dh({value:e,children:t}){return y.createElement(ul.Provider,{value:e},t)}function S8(e){throw new Error("Unexpected object: "+e)}var Se=(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))(Se||{});function ui(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:S8(e)}}function ph(e){let t=be(e),n=y.useRef(!1);y.useEffect(()=>(n.current=!1,()=>{n.current=!0,D0(()=>{n.current&&t()})}),[t])}let P8=y.createContext(!1);function T8(){return y.useContext(P8)}function A8(e){let t=T8(),n=y.useContext(mh),[r,o]=y.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Gt.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 y.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),y.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let hh=y.Fragment,N8=Je(function(e,t){let{ownerDocument:n=null,...r}=e,o=y.useRef(null),s=vt(kx(p=>{o.current=p}),t),i=Vc(o.current),c=n??i,a=A8(c),l=y.useContext($8),u=tr(),f=ut();return ph(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?He.createPortal(y.createElement("div",{"data-headlessui-portal":"",ref:p=>{u.dispose(),l&&p&&u.add(l.register(p))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:hh,name:"Portal"})),a):null});function C8(e,t){let n=vt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=ut();return r?y.createElement(N8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:hh,name:"Portal"})}let O8=y.Fragment,mh=y.createContext(null);function I8(e,t){let{target:n,...r}=e,o={ref:vt(t)},s=ut();return y.createElement(mh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:O8,name:"Popover.Group"}))}let $8=y.createContext(null),k8=Je(C8),M8=Je(I8),D8=Object.assign(k8,{Group:M8});const fi={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function bh(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function B8(e,t,n){let r=lt();if(t.kind==="Tracked"){let o=function(){s!==bh(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 L8(){let e=typeof document>"u";return"useSyncExternalStore"in z?(t=>t.useSyncExternalStore)(z)(()=>()=>{},()=>!1,()=>!e):!1}function gh(){let e=L8(),[t,n]=z.useState(Gt.isHandoffComplete);return t&&Gt.isHandoffComplete===!1&&n(!1),z.useEffect(()=>{t!==!0&&n(!0)},[t]),z.useEffect(()=>Gt.handoff(),[]),e?!1:t}function F8(){let e=y.useRef(!1);return Te(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function yh(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Uo((t=e.as)!=null?t:wh)||y.Children.count(e.children)===1}let di=y.createContext(null);di.displayName="TransitionContext";var R8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(R8||{});function j8(){let e=y.useContext(di);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function z8(){let e=y.useContext(pi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let pi=y.createContext(null);pi.displayName="NestingContext";function hi(e){return"children"in e?hi(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function vh(e,t){let n=nr(e),r=y.useRef([]),o=F8(),s=tr(),i=be((d,h=Mn.Hidden)=>{let m=r.current.findIndex(({el:w})=>w===d);m!==-1&&(yt(h,{[Mn.Unmount](){r.current.splice(m,1)},[Mn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var w;!hi(r)&&o.current&&((w=n.current)==null||w.call(n))}))}),c=be(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,Mn.Unmount)}),a=y.useRef([]),l=y.useRef(Promise.resolve()),u=y.useRef({enter:[],leave:[]}),f=be((d,h,m)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([w])=>w!==d)),t==null||t.chains.current[h].push([d,new Promise(w=>{a.current.push(w)})]),t==null||t.chains.current[h].push([d,new Promise(w=>{Promise.all(u.current[h].map(([P,E])=>E)).then(()=>w())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=be((d,h,m)=>{Promise.all(u.current[h].splice(0).map(([w,P])=>P)).then(()=>{var w;(w=a.current.shift())==null||w()}).then(()=>m(h))});return y.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:p,wait:l,chains:u}),[c,i,r,f,p,u,l])}let wh=y.Fragment,xh=qs.RenderStrategy;function U8(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,...w}=e,[P,E]=y.useState(null),T=y.useRef(null),A=yh(e),D=vt(...A?[T,t,E]:t===null?[]:[t]),F=(n=w.unmount)==null||n?Mn.Unmount:Mn.Hidden,{show:L,appear:b,initial:g}=j8(),[x,I]=y.useState(L?"visible":"hidden"),O=z8(),{register:$,unregister:M}=O;Te(()=>$(T),[$,T]),Te(()=>{if(F===Mn.Hidden&&T.current){if(L&&x!=="visible"){I("visible");return}return yt(x,{hidden:()=>M(T),visible:()=>$(T)})}},[x,T,$,M,L,F]);let v=gh();Te(()=>{if(A&&v&&x==="visible"&&T.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[T,x,v,A]);let N=g&&!b,k=b&&L&&g,S=y.useRef(!1),B=vh(()=>{S.current||(I("hidden"),M(T))},O),j=be(J=>{S.current=!0;let K=J?"enter":"leave";B.onStart(T,K,Q=>{Q==="enter"?s==null||s():Q==="leave"&&(c==null||c())})}),U=be(J=>{let K=J?"enter":"leave";S.current=!1,B.onStop(T,K,Q=>{Q==="enter"?i==null||i():Q==="leave"&&(a==null||a())}),K==="leave"&&!hi(B)&&(I("hidden"),M(T))});y.useEffect(()=>{A&&o||(j(L),U(L))},[L,A,o]);let _=!(!o||!A||!v||N),[,q]=Pp(_,P,L,{start:j,end:U}),Z=Dn({ref:D,className:((r=Oc(w.className,k&&l,k&&u,q.enter&&l,q.enter&&q.closed&&u,q.enter&&!q.closed&&f,q.leave&&d,q.leave&&!q.closed&&h,q.leave&&q.closed&&m,!q.transition&&L&&p))==null?void 0:r.trim())||void 0,...Sp(q)}),H=0;x==="visible"&&(H|=Ft.Open),x==="hidden"&&(H|=Ft.Closed),L&&x==="hidden"&&(H|=Ft.Opening),!L&&x==="visible"&&(H|=Ft.Closing);let W=ut();return y.createElement(pi.Provider,{value:B},y.createElement(dh,{value:H},W({ourProps:Z,theirProps:w,defaultTag:wh,features:xh,visible:x==="visible",name:"Transition.Child"})))}function _8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=y.useRef(null),c=yh(e),a=vt(...c?[i,t]:t===null?[]:[t]);gh();let l=fl();if(n===void 0&&l!==null&&(n=(l&Ft.Open)===Ft.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=y.useState(n?"visible":"hidden"),p=vh(()=>{n||f("hidden")}),[d,h]=y.useState(!0),m=y.useRef([n]);Te(()=>{d!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let w=y.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);Te(()=>{n?f("visible"):!hi(p)&&i.current!==null&&f("hidden")},[n,p]);let P={unmount:o},E=be(()=>{var D;d&&h(!1),(D=e.beforeEnter)==null||D.call(e)}),T=be(()=>{var D;d&&h(!1),(D=e.beforeLeave)==null||D.call(e)}),A=ut();return y.createElement(pi.Provider,{value:p},y.createElement(di.Provider,{value:w},A({ourProps:{...P,as:y.Fragment,children:y.createElement(Eh,{ref:a,...P,...s,beforeEnter:E,beforeLeave:T})},theirProps:{},defaultTag:y.Fragment,features:xh,visible:u==="visible",name:"Transition"})))}function W8(e,t){let n=y.useContext(di)!==null,r=fl()!==null;return y.createElement(y.Fragment,null,!n&&r?y.createElement(dl,{ref:t,...e}):y.createElement(Eh,{ref:t,...e}))}let dl=Je(_8),Eh=Je(U8),V8=Je(W8),pl=Object.assign(dl,{Child:V8,Root:dl}),Sh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ph(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!mn(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 Sh.test(i)&&(i=i.replace(Sh,"")),i}function H8(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():Ph(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Ph(e).trim()}function G8(e){let t=y.useRef(""),n=y.useRef("");return be(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=H8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var q8=Object.defineProperty,K8=(e,t,n)=>t in e?q8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Th=(e,t,n)=>(K8(e,typeof t!="symbol"?t+"":t,n),n),je=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(je||{}),Fn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Fn||{}),mi=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(mi||{}),Ah=(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))(Ah||{});function Nh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=hp(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 Z8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?fi.Tracked(bh(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:Se.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:fi.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===Se.Nothing)return{...c,activeOptionIndex:null};if(t.focus===Se.Specific)return{...c,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===Se.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=ui(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===Se.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=ui(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=Nh(e),l=ui(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!==Se.Nothing&&(r=ui(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:Se.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,...Nh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:fi.Moved}}};class hl extends np{constructor(t){super(t),Th(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return yt(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:Bc(()=>{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:Bc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Bc(()=>{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})}}),Th(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=Lc.get(null);this.disposables.add(r.on(ip.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(B8(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 hl({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:Se.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:fi.Idle})}reduce(t,n){return yt(n.type,Z8,t,n)}}const Ch=y.createContext(null);function ml(e){let t=y.useContext(Ch);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Oh),n}return t}function Oh({id:e,__demoMode:t=!1}){let n=y.useMemo(()=>hl.new({id:e,__demoMode:t}),[]);return ph(()=>n.dispose()),n}let bi=y.createContext(null);bi.displayName="ListboxDataContext";function Yo(e){let t=y.useContext(bi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yo),n}return t}let Y8=y.Fragment;function X8(e,t){let n=y.useId(),r=Cc(),{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 w=p?"horizontal":"vertical";let P=vt(t),E=gx(s),[T=d?[]:void 0,A]=bx(o,a,E),D=Oh({id:n,__demoMode:h}),F=y.useRef({static:!1,hold:!1}),L=y.useRef(new Map),b=Wx(l),g=y.useCallback(_=>yt(x.mode,{[Fn.Multi]:()=>T.some(q=>b(q,_)),[Fn.Single]:()=>b(T,_)}),[T]),x=kn({value:T,disabled:f,invalid:u,mode:d?Fn.Multi:Fn.Single,orientation:w,onChange:A,compare:b,isSelected:g,optionsPropsRef:F,listRef:L});Te(()=>{D.state.dataRef.current=x},[x]);let I=Qe(D,_=>_.listboxState),O=Lc.get(null),$=Qe(O,y.useCallback(_=>O.selectors.isTop(_,n),[O,n])),[M,v]=Qe(D,_=>[_.buttonElement,_.optionsElement]);b2($,[M,v],(_,q)=>{D.send({type:Ah.CloseListbox}),pp(q,Wc.Loose)||(_.preventDefault(),M==null||M.focus())});let N=kn({open:I===je.Open,disabled:f,invalid:u,value:T}),[k,S]=Fx({inherit:!0}),B={ref:P},j=y.useCallback(()=>{if(E!==void 0)return A==null?void 0:A(E)},[A,E]),U=ut();return y.createElement(S,{value:k,props:{htmlFor:M==null?void 0:M.id},slot:{open:I===je.Open,disabled:f}},y.createElement(v8,null,y.createElement(Ch.Provider,{value:D},y.createElement(bi.Provider,{value:x},y.createElement(dh,{value:yt(I,{[je.Open]:Ft.Open,[je.Closed]:Ft.Closed})},c!=null&&T!=null&&y.createElement(Px,{disabled:f,data:{[c]:T},form:i,onReset:j}),U({ourProps:B,theirProps:m,slot:N,defaultTag:Y8,name:"Listbox"}))))))}let J8="button";function Q8(e,t){let n=y.useId(),r=U0(),o=Yo("Listbox.Button"),s=ml("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...l}=e,u=vt(t,m8(),s.actions.setButtonElement),f=b8(),[p,d,h]=Qe(s,v=>[v.listboxState,v.buttonElement,v.optionsElement]),m=p===je.Open;v2(m,{trigger:d,action:y.useCallback(v=>{if(d!=null&&d.contains(v.target))return Xs.Ignore;let N=v.target.closest('[role="option"]:not([data-disabled])');return mn(N)?Xs.Select(N):h!=null&&h.contains(v.target)?Xs.Ignore:Xs.Close},[d,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let w=be(v=>{switch(v.key){case Be.Enter:yx(v.currentTarget);break;case Be.Space:case Be.ArrowDown:v.preventDefault(),s.actions.openListbox({focus:o.value?Se.Nothing:Se.First});break;case Be.ArrowUp:v.preventDefault(),s.actions.openListbox({focus:o.value?Se.Nothing:Se.Last});break}}),P=be(v=>{switch(v.key){case Be.Space:v.preventDefault();break}}),E=Hx(v=>{var N;s.state.listboxState===je.Open?(He.flushSync(()=>s.actions.closeListbox()),(N=s.state.buttonElement)==null||N.focus({preventScroll:!0})):(v.preventDefault(),s.actions.openListbox({focus:Se.Nothing}))}),T=be(v=>v.preventDefault()),A=Y0([i]),D=Mx(),{isFocusVisible:F,focusProps:L}=nx({autoFocus:a}),{isHovered:b,hoverProps:g}=tx({isDisabled:c}),{pressed:x,pressProps:I}=lx({disabled:c}),O=kn({open:p===je.Open,active:x||p===je.Open,disabled:c,invalid:o.invalid,value:o.value,hover:b,focus:F,autofocus:a}),$=Qe(s,v=>v.listboxState===je.Open),M=L0(f(),{ref:u,id:i,type:w2(e,d),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":$,"aria-labelledby":A,"aria-describedby":D,disabled:c||void 0,autoFocus:a,onKeyDown:w,onKeyUp:P,onKeyPress:T},E,L,g,I);return ut()({ourProps:M,theirProps:l,slot:O,defaultTag:J8,name:"Listbox.Button"})}let Ih=y.createContext(!1),e3="div",t3=qs.RenderStrategy|qs.Static;function n3(e,t){let n=y.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,l=h8(o),[u,f]=y.useState(null);l&&(s=!0);let p=Yo("Listbox.Options"),d=ml("Listbox.Options"),[h,m,w,P]=Qe(d,W=>[W.listboxState,W.buttonElement,W.optionsElement,W.__demoMode]),E=Vc(m),T=Vc(w),A=fl(),[D,F]=Pp(c,u,A!==null?(A&Ft.Open)===Ft.Open:h===je.Open);o2(D,m,d.actions.closeListbox);let L=P?!1:i&&h===je.Open;N2(L,T);let b=P?!1:i&&h===je.Open;r2(b,{allowed:y.useCallback(()=>[m,w],[m,w])});let g=Qe(d,d.selectors.didButtonMove)?!1:D,x=Qe(d,d.selectors.hasFrozenValue)&&!e.static,I=fh(x,p.value),O=y.useCallback(W=>p.compare(I,W),[p.compare,I]),$=Qe(d,W=>{var J;if(l==null||!((J=l==null?void 0:l.to)!=null&&J.includes("selection")))return null;let K=W.options.findIndex(Q=>O(Q.dataRef.current.value));return K===-1&&(K=0),K}),M=(()=>{if(l==null)return;if($===null)return{...l,inner:void 0};let W=Array.from(p.listRef.current.values());return{...l,inner:{listRef:{current:W},index:$}}})(),[v,N]=y8(M),k=g8(),S=vt(t,l?v:null,d.actions.setOptionsElement,f),B=tr();y.useEffect(()=>{let W=w;W&&h===je.Open&&(ix(W)||W==null||W.focus({preventScroll:!0}))},[h,w]);let j=be(W=>{var J;switch(B.dispose(),W.key){case Be.Space:if(d.state.searchQuery!=="")return W.preventDefault(),W.stopPropagation(),d.actions.search(W.key);case Be.Enter:W.preventDefault(),W.stopPropagation(),d.actions.selectActiveOption();break;case yt(p.orientation,{vertical:Be.ArrowDown,horizontal:Be.ArrowRight}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.Next});case yt(p.orientation,{vertical:Be.ArrowUp,horizontal:Be.ArrowLeft}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.Previous});case Be.Home:case Be.PageUp:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.First});case Be.End:case Be.PageDown:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.Last});case Be.Escape:W.preventDefault(),W.stopPropagation(),He.flushSync(()=>d.actions.closeListbox()),(J=d.state.buttonElement)==null||J.focus({preventScroll:!0});return;case Be.Tab:W.preventDefault(),W.stopPropagation(),He.flushSync(()=>d.actions.closeListbox()),d2(d.state.buttonElement,W.shiftKey?_c.Previous:_c.Next);break;default:W.key.length===1&&(d.actions.search(W.key),B.setTimeout(()=>d.actions.clearSearch(),350));break}}),U=Qe(d,W=>{var J;return(J=W.buttonElement)==null?void 0:J.id}),_=kn({open:h===je.Open}),q=L0(l?k():{},{id:r,ref:S,"aria-activedescendant":Qe(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===Fn.Multi?!0:void 0,"aria-labelledby":U,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===je.Open?0:void 0,style:{...a.style,...N,"--button-width":Vx(D,m,!0).width},...Sp(F)}),Z=ut(),H=y.useMemo(()=>p.mode===Fn.Multi?p:{...p,isSelected:O},[p,O]);return y.createElement(D8,{enabled:s?e.static||D:!1,ownerDocument:E},y.createElement(bi.Provider,{value:H},Z({ourProps:q,theirProps:a,slot:_,defaultTag:e3,features:t3,visible:g,name:"Listbox.Options"})))}let r3="div";function o3(e,t){let n=y.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=y.useContext(Ih)===!0,a=Yo("Listbox.Option"),l=ml("Listbox.Option"),u=Qe(l,x=>l.selectors.isActive(x,r)),f=a.isSelected(s),p=y.useRef(null),d=G8(p),h=nr({disabled:o,value:s,domRef:p,get textValue(){return d()}}),m=vt(t,p,x=>{x?a.listRef.current.set(r,x):a.listRef.current.delete(r)}),w=Qe(l,x=>l.selectors.shouldScrollIntoView(x,r));Te(()=>{if(w)return lt().requestAnimationFrame(()=>{var x,I;(I=(x=p.current)==null?void 0:x.scrollIntoView)==null||I.call(x,{block:"nearest"})})},[w,p]),Te(()=>{if(!c)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,c]);let P=be(x=>{if(o)return x.preventDefault();l.actions.selectOption(s)}),E=be(()=>{if(o)return l.actions.goToOption({focus:Se.Nothing});l.actions.goToOption({focus:Se.Specific,id:r})}),T=C2(),A=be(x=>T.update(x)),D=be(x=>{T.wasMoved(x)&&(o||u&&l.state.activationTrigger===mi.Pointer||l.actions.goToOption({focus:Se.Specific,id:r},mi.Pointer))}),F=be(x=>{T.wasMoved(x)&&(o||u&&l.state.activationTrigger===mi.Pointer&&l.actions.goToOption({focus:Se.Nothing}))}),L=kn({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:P,onFocus:E,onPointerEnter:A,onMouseEnter:A,onPointerMove:D,onMouseMove:D,onPointerLeave:F,onMouseLeave:F},g=ut();return!f&&c?null:g({ourProps:b,theirProps:i,slot:L,defaultTag:r3,name:"Listbox.Option"})}let s3=y.Fragment;function i3(e,t){let{options:n,placeholder:r,...o}=e,s={ref:vt(t)},i=Yo("ListboxSelectedOption"),c=kn({}),a=i.value===void 0||i.value===null||i.mode===Fn.Multi&&Array.isArray(i.value)&&i.value.length===0,l=ut();return y.createElement(Ih.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:y.createElement(y.Fragment,null,r&&a?r:n)},slot:c,defaultTag:s3,name:"ListboxSelectedOption"}))}let a3=Je(X8),c3=Je(Q8),l3=Ux,u3=Je(n3),f3=Je(o3),d3=Je(i3),Et=Object.assign(a3,{Button:c3,Label:l3,Options:u3,Option:f3,SelectedOption:d3});const p3=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_active)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_active",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),h3=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_inactive)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_inactive",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Xo=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return C.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>C.jsx("div",{className:"flex items-center justify-center",children:o>t-e?C.jsx(p3,{}):C.jsx(h3,{})},o))})};class Rt{}rs(Rt,"FAST",3),rs(Rt,"Medium",2),rs(Rt,"SLOW",1),rs(Rt,"NONE",0);const m3=Object.values({MAINNET:1,SEPOLIA:11155111}),wn=e=>{const t=typeof e=="string"?parseInt(e,10):e;return m3.includes(t)},b3={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:!b3[t.toUpperCase()]:!0},g3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=Nt();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(Et,{value:t,onChange:n,disabled:r,children:({open:c})=>C.jsxs(C.Fragment,{children:[C.jsxs(Et.Button,{className:`
139
+ */var nE=["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])"],Qc=nE.join(","),Ip=typeof Element>"u",qo=Ip?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,si=!Ip&&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},Ko=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&&Ko(t.parentNode);return i},rE=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},oE=function(t,n,r){if(Ko(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Qc));return n&&qo.call(t,Qc)&&o.unshift(t),o=o.filter(r),o},el=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ko(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=el(a,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var u=qo.call(i,Qc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!Ko(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&p){var d=el(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},kp=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)||rE(t))&&!kp(t)?0:t.tabIndex},sE=function(t,n){var r=$p(t);return r<0&&n&&!kp(t)?0:r},iE=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Mp=function(t){return t.tagName==="INPUT"},aE=function(t){return Mp(t)&&t.type==="hidden"},cE=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},lE=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},uE=function(t){if(!t.name)return!0;var n=t.form||si(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=lE(o,t.form);return!s||s===t},fE=function(t){return Mp(t)&&t.type==="radio"},dE=function(t){return fE(t)&&!uE(t)},pE=function(t){var n,r=t&&si(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=si(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},Dp=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},hE=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=qo.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(qo.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=si(t);if(l&&!l.shadowRoot&&o(l)===!0)return Dp(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(pE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Dp(t);return!1},mE=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 qo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},bE=function(t,n){return!(n.disabled||Ko(n)||aE(n)||hE(n,t)||cE(n)||mE(n))},Bp=function(t,n){return!(dE(n)||$p(n)<0||!bE(t,n))},gE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Lp=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,a=sE(c,i),l=i?Lp(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(iE).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Fp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=el([t],n.includeContainer,{filter:Bp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:gE}):r=oE(t,n.includeContainer,Bp.bind(null,n)),Lp(r)};function Rp(e,t,n){let{reference:r,floating:o}=e;const s=vn(t),i=Xc(t),c=Yc(i),a=Ln(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(Lr(t)){case"start":d[i]-=p*(n&&l?-1:1);break;case"end":d[i]+=p*(n&&l?-1:1);break}return d}const yE=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}=Rp(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:A,reset:D}=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],...A}},D&&h<=50&&(h++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(l=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:u,y:f}=Rp(l,p,a)),m=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}};async function ii(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}=or(t,e),h=Op(d),v=c[p?f==="floating"?"reference":"floating":f],T=oi(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)),A=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},D=oi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:S,strategy:a}):E);return{top:(T.top-D.top+h.top)/A.y,bottom:(D.bottom-T.bottom+h.bottom)/A.y,left:(T.left-D.left+h.left)/A.x,right:(D.right-T.right+h.right)/A.x}}const vE=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}=or(e,t)||{};if(l==null)return{};const f=Op(u),p={x:n,y:r},d=Xc(o),h=Yc(d),m=await i.getDimensions(l),v=d==="y",T=v?"top":"left",E=v?"bottom":"right",S=v?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[d]-p[d]-s.floating[h],D=p[d]-s.reference[d],F=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let L=F?F[S]:0;(!L||!await(i.isElement==null?void 0:i.isElement(F)))&&(L=c.floating[S]||s.floating[h]);const b=A/2-D/2,g=L/2-m[h]/2-1,x=yn(f[T],g),I=yn(f[E],g),O=x,k=L-m[h]-I,M=L/2-m[h]/2+b,w=Zc(O,M,k),N=!a.arrow&&Lr(o)!=null&&M!==w&&s.reference[h]/2-(M<O?x:I)-m[h]/2<0,$=N?M<O?M-O:M-k:0;return{[d]:p[d]+$,data:{[d]:w,centerOffset:M-w-$,...N&&{alignmentOffset:$}},reset:N}}}),wE=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}=or(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Ln(o),E=vn(c),S=Ln(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),D=p||(S||!m?[ri(c)]:Y2(c)),F=h!=="none";!p&&F&&D.push(...eE(c,m,h,A));const L=[c,...D],b=await ii(t,v),g=[];let x=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&g.push(b[T]),f){const M=Z2(o,i,A);g.push(b[M[0]],b[M[1]])}if(x=[...x,{placement:o,overflows:g}],!g.every(M=>M<=0)){var I,O;const M=(((I=s.flip)==null?void 0:I.index)||0)+1,w=L[M];if(w&&(!(f==="alignment"?E!==vn(w):!1)||x.every(P=>vn(P.placement)===E?P.overflows[0]>0:!0)))return{data:{index:M,overflows:x},reset:{placement:w}};let N=(O=x.filter($=>$.overflows[0]<=0).sort(($,P)=>$.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!N)switch(d){case"bestFit":{var k;const $=(k=x.filter(P=>{if(F){const B=vn(P.placement);return B===E||B==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(B=>B>0).reduce((B,j)=>B+j,0)]).sort((P,B)=>P[1]-B[1])[0])==null?void 0:k[0];$&&(N=$);break}case"initialPlacement":N=c;break}if(o!==N)return{reset:{placement:N}}}return{}}}},xE=new Set(["left","top"]);async function EE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ln(n),c=Lr(n),a=vn(n)==="y",l=xE.has(i)?-1:1,u=s&&a?-1:1,f=or(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 SE=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 EE(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}}}}},PE=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}=or(e,t),l={x:n,y:r},u=await ii(t,a),f=vn(Ln(o)),p=Ap(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=Zc(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=Zc(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}}}}}},TE=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}=or(e,t),u=await ii(t,l),f=Ln(o),p=Lr(o),d=vn(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,A=yn(m-u[v],E),D=yn(h-u[T],S),F=!t.middlewareData.shift;let L=A,b=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=E),F&&!p){const x=Re(u.left,0),I=Re(u.right,0),O=Re(u.top,0),k=Re(u.bottom,0);d?b=h-2*(x!==0||I!==0?x+I:Re(u.left,u.right)):L=m-2*(O!==0||k!==0?O+k:Re(u.top,u.bottom))}await a({...t,availableWidth:b,availableHeight:L});const g=await i.getDimensions(c.floating);return h!==g.width||m!==g.height?{reset:{rects:!0}}:{}}}};function jp(e){const t=xt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=We(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Go(n)!==s||Go(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function tl(e){return ge(e)?e:e.contextElement}function Fr(e){const t=tl(e);if(!We(t))return Zt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=jp(t);let i=(s?Go(n.width):n.width)/r,c=(s?Go(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const AE=Zt(0);function zp(e){const t=et(e);return!ei()||!t.visualViewport?AE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==et(e)?!1:t}function sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=tl(e);let i=Zt(1);t&&(r?ge(r)&&(i=Fr(r)):i=Fr(e));const c=NE(s,n,r)?zp(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=et(s),d=r&&ge(r)?et(r):r;let h=p,m=Kc(h);for(;m&&r&&d!==h;){const v=Fr(m),T=m.getBoundingClientRect(),E=xt(m),S=T.left+(m.clientLeft+parseFloat(E.paddingLeft))*v.x,A=T.top+(m.clientTop+parseFloat(E.paddingTop))*v.y;a*=v.x,l*=v.y,u*=v.x,f*=v.y,a+=S,l+=A,h=et(m),m=Kc(h)}}return oi({width:u,height:f,x:a,y:l})}function ai(e,t){const n=ti(e).scrollLeft;return t?t.left+n:sr(Kt(e)).left+n}function Up(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ai(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function CE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Kt(r),c=t?Qs(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=Zt(1);const u=Zt(0),f=We(r);if((f||!f&&!s)&&((Br(r)!=="body"||Ho(i))&&(a=ti(r)),We(r))){const d=sr(r);l=Fr(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=i&&!f&&!s?Up(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 OE(e){return Array.from(e.getClientRects())}function IE(e){const t=Kt(e),n=ti(e),r=e.ownerDocument.body,o=Re(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Re(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ai(e);const c=-n.scrollTop;return xt(r).direction==="rtl"&&(i+=Re(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const _p=25;function kE(e,t){const n=et(e),r=Kt(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=ei();(!u||u&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const l=ai(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<=_p&&(s-=h)}else l<=_p&&(s+=l);return{width:s,height:i,x:c,y:a}}const $E=new Set(["absolute","fixed"]);function ME(e,t){const n=sr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=We(e)?Fr(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 Wp(e,t,n){let r;if(t==="viewport")r=kE(e,n);else if(t==="document")r=IE(Kt(e));else if(ge(t))r=ME(t,n);else{const o=zp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return oi(r)}function Vp(e,t){const n=gn(e);return n===t||!ge(n)||bn(n)?!1:xt(n).position==="fixed"||Vp(n,t)}function DE(e,t){const n=t.get(e);if(n)return n;let r=Bn(e,[],!1).filter(c=>ge(c)&&Br(c)!=="body"),o=null;const s=xt(e).position==="fixed";let i=s?gn(e):e;for(;ge(i)&&!bn(i);){const c=xt(i),a=qc(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&$E.has(o.position)||Ho(i)&&!a&&Vp(e,i))?r=r.filter(u=>u!==i):o=c,i=gn(i)}return t.set(e,r),r}function BE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Qs(t)?[]:DE(t,this._c):[].concat(n),r],c=i[0],a=i.reduce((l,u)=>{const f=Wp(t,u,o);return l.top=Re(f.top,l.top),l.right=yn(f.right,l.right),l.bottom=yn(f.bottom,l.bottom),l.left=Re(f.left,l.left),l},Wp(t,c,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function LE(e){const{width:t,height:n}=jp(e);return{width:t,height:n}}function FE(e,t,n){const r=We(t),o=Kt(t),s=n==="fixed",i=sr(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Zt(0);function l(){a.x=ai(o)}if(r||!r&&!s)if((Br(t)!=="body"||Ho(o))&&(c=ti(t)),r){const d=sr(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?Up(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 nl(e){return xt(e).position==="static"}function Hp(e,t){if(!We(e)||xt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Kt(e)===n&&(n=n.ownerDocument.body),n}function Gp(e,t){const n=et(e);if(Qs(e))return n;if(!We(e)){let o=gn(e);for(;o&&!bn(o);){if(ge(o)&&!nl(o))return o;o=gn(o)}return n}let r=Hp(e,t);for(;r&&R2(r)&&nl(r);)r=Hp(r,t);return r&&bn(r)&&nl(r)&&!qc(r)?n:r||W2(e)||n}const RE=async function(e){const t=this.getOffsetParent||Gp,n=this.getDimensions,r=await n(e.floating);return{reference:FE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jE(e){return xt(e).direction==="rtl"}const zE={convertOffsetParentRelativeRectToViewportRelativeRect:CE,getDocumentElement:Kt,getClippingRect:BE,getOffsetParent:Gp,getElementRects:RE,getClientRects:OE,getDimensions:LE,getScale:Fr,isElement:ge,isRTL:jE};function qp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UE(e,t){let n=null,r;const o=Kt(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=ni(f),m=ni(o.clientWidth-(u+p)),v=ni(o.clientHeight-(f+d)),T=ni(u),S={rootMargin:-h+"px "+-m+"px "+-v+"px "+-T+"px",threshold:Re(0,yn(1,a))||1};let A=!0;function D(F){const L=F[0].intersectionRatio;if(L!==a){if(!A)return i();L?i(!1,L):r=setTimeout(()=>{i(!1,1e-7)},1e3)}L===1&&!qp(l,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(D,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,S)}n.observe(e)}return i(!0),s}function Kp(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=tl(e),u=o||s?[...l?Bn(l):[],...Bn(t)]:[];u.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const f=l&&c?UE(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?sr(e):null;a&&v();function v(){const T=sr(e);m&&!qp(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 rl=ii,_E=SE,WE=PE,VE=wE,HE=TE,Zp=vE,GE=(e,t,n)=>{const r=new Map,o={platform:zE,...n},s={...o.platform,_c:r};return yE(e,t,{...o,platform:s})};var qE=typeof document<"u",KE=function(){},ci=qE?y.useLayoutEffect:KE;function li(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(!li(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)&&!li(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Yp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xp(e,t){const n=Yp(e);return Math.round(t*n)/n}function ol(e){const t=z.useRef(e);return ci(()=>{t.current=e}),t}function Jp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[u,f]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=z.useState(r);li(p,r)||d(r);const[h,m]=z.useState(null),[v,T]=z.useState(null),E=z.useCallback(P=>{P!==F.current&&(F.current=P,m(P))},[]),S=z.useCallback(P=>{P!==L.current&&(L.current=P,T(P))},[]),A=s||h,D=i||v,F=z.useRef(null),L=z.useRef(null),b=z.useRef(u),g=a!=null,x=ol(a),I=ol(o),O=ol(l),k=z.useCallback(()=>{if(!F.current||!L.current)return;const P={placement:t,strategy:n,middleware:p};I.current&&(P.platform=I.current),GE(F.current,L.current,P).then(B=>{const j={...B,isPositioned:O.current!==!1};M.current&&!li(b.current,j)&&(b.current=j,Vr.flushSync(()=>{f(j)}))})},[p,t,n,I,O]);ci(()=>{l===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[l]);const M=z.useRef(!1);ci(()=>(M.current=!0,()=>{M.current=!1}),[]),ci(()=>{if(A&&(F.current=A),D&&(L.current=D),A&&D){if(x.current)return x.current(A,D,k);k()}},[A,D,k,x,g]);const w=z.useMemo(()=>({reference:F,floating:L,setReference:E,setFloating:S}),[E,S]),N=z.useMemo(()=>({reference:A,floating:D}),[A,D]),$=z.useMemo(()=>{const P={position:n,left:0,top:0};if(!N.floating)return P;const B=Xp(N.floating,u.x),j=Xp(N.floating,u.y);return c?{...P,transform:"translate("+B+"px, "+j+"px)",...Yp(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:j}},[n,c,N.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:w,elements:N,floatingStyles:$}),[u,k,w,N,$])}const ZE=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?Zp({element:r.current,padding:o}).fn(n):{}:r?Zp({element:r,padding:o}).fn(n):{}}}},sl=(e,t)=>({..._E(e),options:[e,t]}),Qp=(e,t)=>({...WE(e),options:[e,t]}),eh=(e,t)=>({...VE(e),options:[e,t]}),YE=(e,t)=>({...HE(e),options:[e,t]}),XE=(e,t)=>({...ZE(e),options:[e,t]}),th={...z},JE=th.useInsertionEffect||(e=>e());function nh(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return JE(()=>{t.current=e}),z.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var il=typeof document<"u"?y.useLayoutEffect:y.useEffect;let rh=!1,QE=0;const oh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+QE++;function e8(){const[e,t]=z.useState(()=>rh?oh():void 0);return il(()=>{e==null&&t(oh())},[]),z.useEffect(()=>{rh=!0},[]),e}const t8=th.useId||e8;let Zo;process.env.NODE_ENV!=="production"&&(Zo=new Set);function n8(){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=Zo)!=null&&e.has(o))){var s;(s=Zo)==null||s.add(o),console.warn(o)}}function r8(){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=Zo)!=null&&e.has(o))){var s;(s=Zo)==null||s.add(o),console.error(o)}}function o8(){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 s8=z.createContext(null),i8=z.createContext(null),a8=()=>{var e;return((e=z.useContext(s8))==null?void 0:e.id)||null},c8=()=>z.useContext(i8),l8="data-floating-ui-focusable";function u8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=t8(),s=z.useRef({}),[i]=z.useState(()=>o8()),c=a8()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!ge(d)&&r8("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=z.useState(r.reference),u=nh((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=z.useMemo(()=>({setPositionReference:l}),[]),p=z.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function f8(e){e===void 0&&(e={});const{nodeId:t}=e,n=u8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=z.useState(null),[c,a]=z.useState(null),u=(o==null?void 0:o.domReference)||s,f=z.useRef(null),p=c8();il(()=>{u&&(f.current=u)},[u]);const d=Jp({...e,elements:{...o,...c&&{reference:c}}}),h=z.useCallback(S=>{const A=ge(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;a(A),d.refs.setReference(A)},[d.refs]),m=z.useCallback(S=>{(ge(S)||S===null)&&(f.current=S,i(S)),(ge(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!ge(S))&&d.refs.setReference(S)},[d.refs]),v=z.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=z.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=z.useMemo(()=>({...d,...r,refs:v,elements:T,nodeId:t}),[d,v,T,t,r]);return il(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);S&&(S.context=E)}),z.useMemo(()=>({...d,context:E,refs:v,elements:T}),[d,v,T,E])}const sh="active",ih="selected";function al(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[sh]:i,[ih]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[l8]:""},...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&&[sh,ih].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 d8(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=z.useCallback(c=>al(c,e,"reference"),t),s=z.useCallback(c=>al(c,e,"floating"),n),i=z.useCallback(c=>al(c,e,"item"),r);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function ah(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const p8=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}=or(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")||n8('`placement` side must be "bottom" when using the `inner`',"middleware.")),!d)return{};const S={...t,...await sl(-d.offsetTop-p.clientTop-f.reference.height/2-d.offsetHeight/2-s).fn(t)},A=await rl(ah(S,h.scrollHeight+m+p.clientTop),u),D=await rl(S,{...u,elementContext:"reference"}),F=Re(0,A.top),L=S.y+F,x=(h.scrollHeight>h.clientHeight?I=>I:Go)(Re(0,h.scrollHeight+(v&&E||T?m*2:0)-F-Re(0,A.bottom)));if(h.style.maxHeight=x+"px",h.scrollTop=F,o){const I=h.offsetHeight<d.offsetHeight*yn(c,n.current.length)-1||D.top>=-a||D.bottom>=-a;Vr.flushSync(()=>o(I))}return r&&(r.current=await rl(ah({...S,y:L},h.offsetHeight+m+p.clientTop),u)),{y:L}}});function h8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:c}=t,a=nh(c),l=z.useRef(!1),u=z.useRef(null),f=z.useRef(null);z.useEffect(()=>{if(!o)return;function d(m){if(m.ctrlKey||!h||s.current==null)return;const v=m.deltaY,T=s.current.top>=-.5,E=s.current.bottom>=-.5,S=h.scrollHeight-h.clientHeight,A=v<0?-1:1,D=v<0?"max":"min";h.scrollHeight<=h.clientHeight||(!T&&v>0||!E&&v<0?(m.preventDefault(),Vr.flushSync(()=>{a(F=>F+Math[D](v,S*A))})):/firefox/i.test(H2())&&(h.scrollTop+=v))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",d),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(f.current={...s.current})}),()=>{u.current=null,f.current=null,h.removeEventListener("wheel",d)}},[o,n,r.floating,s,i,a]);const p=z.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const d=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!d||!l.current)){if(u.current!==null){const h=d.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Vr.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{u.current=d.scrollTop})}}}),[r.floating,a,s,i]);return z.useMemo(()=>o?{floating:p}:{},[o,p])}let Rr=y.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Rr.displayName="FloatingContext";let cl=y.createContext(null);cl.displayName="PlacementContext";function m8(e){return y.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function b8(){return y.useContext(Rr).setReference}function g8(){return y.useContext(Rr).getReferenceProps}function y8(){let{getFloatingProps:e,slot:t}=y.useContext(Rr);return y.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function v8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=y.useContext(cl),n=y.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Te(()=>{t==null||t(n??null)},[t,n]);let r=y.useContext(Rr);return y.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let ch=4;function w8({children:e,enabled:t=!0}){let[n,r]=y.useState(null),[o,s]=y.useState(0),i=y.useRef(null),[c,a]=y.useState(null);x8(c);let l=t&&n!==null&&c!==null,{to:u="bottom",gap:f=0,offset:p=0,padding:d=0,inner:h}=E8(n,c),[m,v="center"]=u.split(" ");Te(()=>{l&&s(0)},[l]);let{refs:T,floatingStyles:E,context:S}=f8({open:l,placement:m==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${m}`:`${m}-${v}`,strategy:"absolute",transform:!1,middleware:[sl({mainAxis:m==="selection"?0:f,crossAxis:p}),Qp({padding:d}),m!=="selection"&&eh({padding:d}),m==="selection"&&h?p8({...h,padding:d,overflowRef:i,offset:o,minItemsVisible:ch,referenceOverflowThreshold:d,onFallbackChange(I){var O,k;if(!I)return;let M=S.elements.floating;if(!M)return;let w=parseFloat(getComputedStyle(M).scrollPaddingBottom)||0,N=Math.min(ch,M.childElementCount),$=0,P=0;for(let B of(k=(O=S.elements.floating)==null?void 0:O.childNodes)!=null?k:[])if(mn(B)){let j=B.offsetTop,U=j+B.clientHeight+w,_=M.scrollTop,q=_+M.clientHeight;if(j>=_&&U<=q)N--;else{P=Math.max(0,Math.min(U,q)-Math.max(j,_)),$=B.clientHeight;break}}N>=1&&s(B=>{let j=$*N-P+w;return B>=j?B:j})}}):null,YE({padding:d,apply({availableWidth:I,availableHeight:O,elements:k}){Object.assign(k.floating.style,{overflow:"auto",maxWidth:`${I}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${O}px)`})}})].filter(Boolean),whileElementsMounted:Kp}),[A=m,D=v]=S.placement.split("-");m==="selection"&&(A="selection");let F=y.useMemo(()=>({anchor:[A,D].filter(Boolean).join(" ")}),[A,D]),L=h8(S,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:g}=d8([L]),x=be(I=>{a(I),T.setFloating(I)});return z.createElement(cl.Provider,{value:r},z.createElement(Rr.Provider,{value:{setFloating:x,setReference:T.setReference,styles:E,getReferenceProps:b,getFloatingProps:g,slot:F}},e))}function x8(e){Te(()=>{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 E8(e,t){var n,r,o;let s=ll((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=ll((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=ll((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:c}}function ll(e,t,n=void 0){let r=tr(),o=be((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=uh(a,l);return[u,f=>{let p=lh(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=uh(a,l);u!==v&&(f(v),u=v)})}return r.dispose}]}return[n,null]}),s=y.useMemo(()=>o(e,t)[0],[e,t]),[i=s,c]=y.useState();return Te(()=>{let[a,l]=o(e,t);if(c(a),!!l)return l(c)},[e,t]),i}function lh(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,...lh(o)]:[r]}return[]}function uh(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 S8({children:e,freeze:t},n){let r=fh(t,e);return y.isValidElement(r)?y.cloneElement(r,{ref:n}):y.createElement(y.Fragment,null,r)}y.forwardRef(S8);function fh(e,t){let[n,r]=y.useState(t);return!e&&n!==t&&r(t),e?n:t}let ul=y.createContext(null);ul.displayName="OpenClosedContext";var Ft=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ft||{});function fl(){return y.useContext(ul)}function dh({value:e,children:t}){return y.createElement(ul.Provider,{value:e},t)}function P8(e){throw new Error("Unexpected object: "+e)}var Se=(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))(Se||{});function ui(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:P8(e)}}function ph(e){let t=be(e),n=y.useRef(!1);y.useEffect(()=>(n.current=!1,()=>{n.current=!0,D0(()=>{n.current&&t()})}),[t])}let T8=y.createContext(!1);function A8(){return y.useContext(T8)}function N8(e){let t=A8(),n=y.useContext(mh),[r,o]=y.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Gt.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 y.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),y.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let hh=y.Fragment,C8=Je(function(e,t){let{ownerDocument:n=null,...r}=e,o=y.useRef(null),s=vt(Mx(p=>{o.current=p}),t),i=Vc(o.current),c=n??i,a=N8(c),l=y.useContext($8),u=tr(),f=ut();return ph(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?He.createPortal(y.createElement("div",{"data-headlessui-portal":"",ref:p=>{u.dispose(),l&&p&&u.add(l.register(p))}},f({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:hh,name:"Portal"})),a):null});function O8(e,t){let n=vt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=ut();return r?y.createElement(C8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:hh,name:"Portal"})}let I8=y.Fragment,mh=y.createContext(null);function k8(e,t){let{target:n,...r}=e,o={ref:vt(t)},s=ut();return y.createElement(mh.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:I8,name:"Popover.Group"}))}let $8=y.createContext(null),M8=Je(O8),D8=Je(k8),B8=Object.assign(M8,{Group:D8});const fi={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function bh(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function L8(e,t,n){let r=lt();if(t.kind==="Tracked"){let o=function(){s!==bh(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 F8(){let e=typeof document>"u";return"useSyncExternalStore"in z?(t=>t.useSyncExternalStore)(z)(()=>()=>{},()=>!1,()=>!e):!1}function gh(){let e=F8(),[t,n]=z.useState(Gt.isHandoffComplete);return t&&Gt.isHandoffComplete===!1&&n(!1),z.useEffect(()=>{t!==!0&&n(!0)},[t]),z.useEffect(()=>Gt.handoff(),[]),e?!1:t}function R8(){let e=y.useRef(!1);return Te(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function yh(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Uo((t=e.as)!=null?t:wh)||y.Children.count(e.children)===1}let di=y.createContext(null);di.displayName="TransitionContext";var j8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(j8||{});function z8(){let e=y.useContext(di);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function U8(){let e=y.useContext(pi);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let pi=y.createContext(null);pi.displayName="NestingContext";function hi(e){return"children"in e?hi(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function vh(e,t){let n=nr(e),r=y.useRef([]),o=R8(),s=tr(),i=be((d,h=Mn.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===d);m!==-1&&(yt(h,{[Mn.Unmount](){r.current.splice(m,1)},[Mn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var v;!hi(r)&&o.current&&((v=n.current)==null||v.call(n))}))}),c=be(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,Mn.Unmount)}),a=y.useRef([]),l=y.useRef(Promise.resolve()),u=y.useRef({enter:[],leave:[]}),f=be((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=be((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 y.useMemo(()=>({children:r,register:c,unregister:i,onStart:f,onStop:p,wait:l,chains:u}),[c,i,r,f,p,u,l])}let wh=y.Fragment,xh=qs.RenderStrategy;function _8(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]=y.useState(null),S=y.useRef(null),A=yh(e),D=vt(...A?[S,t,E]:t===null?[]:[t]),F=(n=v.unmount)==null||n?Mn.Unmount:Mn.Hidden,{show:L,appear:b,initial:g}=z8(),[x,I]=y.useState(L?"visible":"hidden"),O=U8(),{register:k,unregister:M}=O;Te(()=>k(S),[k,S]),Te(()=>{if(F===Mn.Hidden&&S.current){if(L&&x!=="visible"){I("visible");return}return yt(x,{hidden:()=>M(S),visible:()=>k(S)})}},[x,S,k,M,L,F]);let w=gh();Te(()=>{if(A&&w&&x==="visible"&&S.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[S,x,w,A]);let N=g&&!b,$=b&&L&&g,P=y.useRef(!1),B=vh(()=>{P.current||(I("hidden"),M(S))},O),j=be(J=>{P.current=!0;let K=J?"enter":"leave";B.onStart(S,K,Q=>{Q==="enter"?s==null||s():Q==="leave"&&(c==null||c())})}),U=be(J=>{let K=J?"enter":"leave";P.current=!1,B.onStop(S,K,Q=>{Q==="enter"?i==null||i():Q==="leave"&&(a==null||a())}),K==="leave"&&!hi(B)&&(I("hidden"),M(S))});y.useEffect(()=>{A&&o||(j(L),U(L))},[L,A,o]);let _=!(!o||!A||!w||N),[,q]=Pp(_,T,L,{start:j,end:U}),Z=Dn({ref:D,className:((r=Oc(v.className,$&&l,$&&u,q.enter&&l,q.enter&&q.closed&&u,q.enter&&!q.closed&&f,q.leave&&d,q.leave&&!q.closed&&h,q.leave&&q.closed&&m,!q.transition&&L&&p))==null?void 0:r.trim())||void 0,...Sp(q)}),H=0;x==="visible"&&(H|=Ft.Open),x==="hidden"&&(H|=Ft.Closed),L&&x==="hidden"&&(H|=Ft.Opening),!L&&x==="visible"&&(H|=Ft.Closing);let W=ut();return y.createElement(pi.Provider,{value:B},y.createElement(dh,{value:H},W({ourProps:Z,theirProps:v,defaultTag:wh,features:xh,visible:x==="visible",name:"Transition.Child"})))}function W8(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=y.useRef(null),c=yh(e),a=vt(...c?[i,t]:t===null?[]:[t]);gh();let l=fl();if(n===void 0&&l!==null&&(n=(l&Ft.Open)===Ft.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,f]=y.useState(n?"visible":"hidden"),p=vh(()=>{n||f("hidden")}),[d,h]=y.useState(!0),m=y.useRef([n]);Te(()=>{d!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let v=y.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);Te(()=>{n?f("visible"):!hi(p)&&i.current!==null&&f("hidden")},[n,p]);let T={unmount:o},E=be(()=>{var D;d&&h(!1),(D=e.beforeEnter)==null||D.call(e)}),S=be(()=>{var D;d&&h(!1),(D=e.beforeLeave)==null||D.call(e)}),A=ut();return y.createElement(pi.Provider,{value:p},y.createElement(di.Provider,{value:v},A({ourProps:{...T,as:y.Fragment,children:y.createElement(Eh,{ref:a,...T,...s,beforeEnter:E,beforeLeave:S})},theirProps:{},defaultTag:y.Fragment,features:xh,visible:u==="visible",name:"Transition"})))}function V8(e,t){let n=y.useContext(di)!==null,r=fl()!==null;return y.createElement(y.Fragment,null,!n&&r?y.createElement(dl,{ref:t,...e}):y.createElement(Eh,{ref:t,...e}))}let dl=Je(W8),Eh=Je(_8),H8=Je(V8),pl=Object.assign(dl,{Child:H8,Root:dl}),Sh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ph(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!mn(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 Sh.test(i)&&(i=i.replace(Sh,"")),i}function G8(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():Ph(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Ph(e).trim()}function q8(e){let t=y.useRef(""),n=y.useRef("");return be(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=G8(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var K8=Object.defineProperty,Z8=(e,t,n)=>t in e?K8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Th=(e,t,n)=>(Z8(e,typeof t!="symbol"?t+"":t,n),n),je=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(je||{}),Fn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Fn||{}),mi=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(mi||{}),Ah=(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))(Ah||{});function Nh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=hp(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 Y8={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?fi.Tracked(bh(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:Se.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:fi.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===Se.Nothing)return{...c,activeOptionIndex:null};if(t.focus===Se.Specific)return{...c,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===Se.Previous){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=ui(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===Se.Next){let u=e.activeOptionIndex;if(u!==null){let f=e.options[u].dataRef.current.domRef,p=ui(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=Nh(e),l=ui(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!==Se.Nothing&&(r=ui(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:Se.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,...Nh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:fi.Moved}}};class hl extends np{constructor(t){super(t),Th(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return yt(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:Bc(()=>{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:Bc(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Bc(()=>{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})}}),Th(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=Lc.get(null);this.disposables.add(r.on(ip.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(L8(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 hl({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:Se.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:fi.Idle})}reduce(t,n){return yt(n.type,Y8,t,n)}}const Ch=y.createContext(null);function ml(e){let t=y.useContext(Ch);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Oh),n}return t}function Oh({id:e,__demoMode:t=!1}){let n=y.useMemo(()=>hl.new({id:e,__demoMode:t}),[]);return ph(()=>n.dispose()),n}let bi=y.createContext(null);bi.displayName="ListboxDataContext";function Yo(e){let t=y.useContext(bi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yo),n}return t}let X8=y.Fragment;function J8(e,t){let n=y.useId(),r=Cc(),{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=vt(t),E=yx(s),[S=d?[]:void 0,A]=gx(o,a,E),D=Oh({id:n,__demoMode:h}),F=y.useRef({static:!1,hold:!1}),L=y.useRef(new Map),b=Vx(l),g=y.useCallback(_=>yt(x.mode,{[Fn.Multi]:()=>S.some(q=>b(q,_)),[Fn.Single]:()=>b(S,_)}),[S]),x=$n({value:S,disabled:f,invalid:u,mode:d?Fn.Multi:Fn.Single,orientation:v,onChange:A,compare:b,isSelected:g,optionsPropsRef:F,listRef:L});Te(()=>{D.state.dataRef.current=x},[x]);let I=Qe(D,_=>_.listboxState),O=Lc.get(null),k=Qe(O,y.useCallback(_=>O.selectors.isTop(_,n),[O,n])),[M,w]=Qe(D,_=>[_.buttonElement,_.optionsElement]);g2(k,[M,w],(_,q)=>{D.send({type:Ah.CloseListbox}),pp(q,Wc.Loose)||(_.preventDefault(),M==null||M.focus())});let N=$n({open:I===je.Open,disabled:f,invalid:u,value:S}),[$,P]=Rx({inherit:!0}),B={ref:T},j=y.useCallback(()=>{if(E!==void 0)return A==null?void 0:A(E)},[A,E]),U=ut();return y.createElement(P,{value:$,props:{htmlFor:M==null?void 0:M.id},slot:{open:I===je.Open,disabled:f}},y.createElement(w8,null,y.createElement(Ch.Provider,{value:D},y.createElement(bi.Provider,{value:x},y.createElement(dh,{value:yt(I,{[je.Open]:Ft.Open,[je.Closed]:Ft.Closed})},c!=null&&S!=null&&y.createElement(Tx,{disabled:f,data:{[c]:S},form:i,onReset:j}),U({ourProps:B,theirProps:m,slot:N,defaultTag:X8,name:"Listbox"}))))))}let Q8="button";function e3(e,t){let n=y.useId(),r=U0(),o=Yo("Listbox.Button"),s=ml("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:a=!1,...l}=e,u=vt(t,b8(),s.actions.setButtonElement),f=g8(),[p,d,h]=Qe(s,w=>[w.listboxState,w.buttonElement,w.optionsElement]),m=p===je.Open;w2(m,{trigger:d,action:y.useCallback(w=>{if(d!=null&&d.contains(w.target))return Xs.Ignore;let N=w.target.closest('[role="option"]:not([data-disabled])');return mn(N)?Xs.Select(N):h!=null&&h.contains(w.target)?Xs.Ignore:Xs.Close},[d,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let v=be(w=>{switch(w.key){case Be.Enter:vx(w.currentTarget);break;case Be.Space:case Be.ArrowDown:w.preventDefault(),s.actions.openListbox({focus:o.value?Se.Nothing:Se.First});break;case Be.ArrowUp:w.preventDefault(),s.actions.openListbox({focus:o.value?Se.Nothing:Se.Last});break}}),T=be(w=>{switch(w.key){case Be.Space:w.preventDefault();break}}),E=Gx(w=>{var N;s.state.listboxState===je.Open?(He.flushSync(()=>s.actions.closeListbox()),(N=s.state.buttonElement)==null||N.focus({preventScroll:!0})):(w.preventDefault(),s.actions.openListbox({focus:Se.Nothing}))}),S=be(w=>w.preventDefault()),A=Y0([i]),D=Dx(),{isFocusVisible:F,focusProps:L}=rx({autoFocus:a}),{isHovered:b,hoverProps:g}=nx({isDisabled:c}),{pressed:x,pressProps:I}=ux({disabled:c}),O=$n({open:p===je.Open,active:x||p===je.Open,disabled:c,invalid:o.invalid,value:o.value,hover:b,focus:F,autofocus:a}),k=Qe(s,w=>w.listboxState===je.Open),M=L0(f(),{ref:u,id:i,type:x2(e,d),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":k,"aria-labelledby":A,"aria-describedby":D,disabled:c||void 0,autoFocus:a,onKeyDown:v,onKeyUp:T,onKeyPress:S},E,L,g,I);return ut()({ourProps:M,theirProps:l,slot:O,defaultTag:Q8,name:"Listbox.Button"})}let Ih=y.createContext(!1),t3="div",n3=qs.RenderStrategy|qs.Static;function r3(e,t){let n=y.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:c=!1,...a}=e,l=m8(o),[u,f]=y.useState(null);l&&(s=!0);let p=Yo("Listbox.Options"),d=ml("Listbox.Options"),[h,m,v,T]=Qe(d,W=>[W.listboxState,W.buttonElement,W.optionsElement,W.__demoMode]),E=Vc(m),S=Vc(v),A=fl(),[D,F]=Pp(c,u,A!==null?(A&Ft.Open)===Ft.Open:h===je.Open);s2(D,m,d.actions.closeListbox);let L=T?!1:i&&h===je.Open;C2(L,S);let b=T?!1:i&&h===je.Open;o2(b,{allowed:y.useCallback(()=>[m,v],[m,v])});let g=Qe(d,d.selectors.didButtonMove)?!1:D,x=Qe(d,d.selectors.hasFrozenValue)&&!e.static,I=fh(x,p.value),O=y.useCallback(W=>p.compare(I,W),[p.compare,I]),k=Qe(d,W=>{var J;if(l==null||!((J=l==null?void 0:l.to)!=null&&J.includes("selection")))return null;let K=W.options.findIndex(Q=>O(Q.dataRef.current.value));return K===-1&&(K=0),K}),M=(()=>{if(l==null)return;if(k===null)return{...l,inner:void 0};let W=Array.from(p.listRef.current.values());return{...l,inner:{listRef:{current:W},index:k}}})(),[w,N]=v8(M),$=y8(),P=vt(t,l?w:null,d.actions.setOptionsElement,f),B=tr();y.useEffect(()=>{let W=v;W&&h===je.Open&&(ax(W)||W==null||W.focus({preventScroll:!0}))},[h,v]);let j=be(W=>{var J;switch(B.dispose(),W.key){case Be.Space:if(d.state.searchQuery!=="")return W.preventDefault(),W.stopPropagation(),d.actions.search(W.key);case Be.Enter:W.preventDefault(),W.stopPropagation(),d.actions.selectActiveOption();break;case yt(p.orientation,{vertical:Be.ArrowDown,horizontal:Be.ArrowRight}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.Next});case yt(p.orientation,{vertical:Be.ArrowUp,horizontal:Be.ArrowLeft}):return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.Previous});case Be.Home:case Be.PageUp:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.First});case Be.End:case Be.PageDown:return W.preventDefault(),W.stopPropagation(),d.actions.goToOption({focus:Se.Last});case Be.Escape:W.preventDefault(),W.stopPropagation(),He.flushSync(()=>d.actions.closeListbox()),(J=d.state.buttonElement)==null||J.focus({preventScroll:!0});return;case Be.Tab:W.preventDefault(),W.stopPropagation(),He.flushSync(()=>d.actions.closeListbox()),p2(d.state.buttonElement,W.shiftKey?_c.Previous:_c.Next);break;default:W.key.length===1&&(d.actions.search(W.key),B.setTimeout(()=>d.actions.clearSearch(),350));break}}),U=Qe(d,W=>{var J;return(J=W.buttonElement)==null?void 0:J.id}),_=$n({open:h===je.Open}),q=L0(l?$():{},{id:r,ref:P,"aria-activedescendant":Qe(d,d.selectors.activeDescendantId),"aria-multiselectable":p.mode===Fn.Multi?!0:void 0,"aria-labelledby":U,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===je.Open?0:void 0,style:{...a.style,...N,"--button-width":Hx(D,m,!0).width},...Sp(F)}),Z=ut(),H=y.useMemo(()=>p.mode===Fn.Multi?p:{...p,isSelected:O},[p,O]);return y.createElement(B8,{enabled:s?e.static||D:!1,ownerDocument:E},y.createElement(bi.Provider,{value:H},Z({ourProps:q,theirProps:a,slot:_,defaultTag:t3,features:n3,visible:g,name:"Listbox.Options"})))}let o3="div";function s3(e,t){let n=y.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,c=y.useContext(Ih)===!0,a=Yo("Listbox.Option"),l=ml("Listbox.Option"),u=Qe(l,x=>l.selectors.isActive(x,r)),f=a.isSelected(s),p=y.useRef(null),d=q8(p),h=nr({disabled:o,value:s,domRef:p,get textValue(){return d()}}),m=vt(t,p,x=>{x?a.listRef.current.set(r,x):a.listRef.current.delete(r)}),v=Qe(l,x=>l.selectors.shouldScrollIntoView(x,r));Te(()=>{if(v)return lt().requestAnimationFrame(()=>{var x,I;(I=(x=p.current)==null?void 0:x.scrollIntoView)==null||I.call(x,{block:"nearest"})})},[v,p]),Te(()=>{if(!c)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,c]);let T=be(x=>{if(o)return x.preventDefault();l.actions.selectOption(s)}),E=be(()=>{if(o)return l.actions.goToOption({focus:Se.Nothing});l.actions.goToOption({focus:Se.Specific,id:r})}),S=O2(),A=be(x=>S.update(x)),D=be(x=>{S.wasMoved(x)&&(o||u&&l.state.activationTrigger===mi.Pointer||l.actions.goToOption({focus:Se.Specific,id:r},mi.Pointer))}),F=be(x=>{S.wasMoved(x)&&(o||u&&l.state.activationTrigger===mi.Pointer&&l.actions.goToOption({focus:Se.Nothing}))}),L=$n({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:A,onMouseEnter:A,onPointerMove:D,onMouseMove:D,onPointerLeave:F,onMouseLeave:F},g=ut();return!f&&c?null:g({ourProps:b,theirProps:i,slot:L,defaultTag:o3,name:"Listbox.Option"})}let i3=y.Fragment;function a3(e,t){let{options:n,placeholder:r,...o}=e,s={ref:vt(t)},i=Yo("ListboxSelectedOption"),c=$n({}),a=i.value===void 0||i.value===null||i.mode===Fn.Multi&&Array.isArray(i.value)&&i.value.length===0,l=ut();return y.createElement(Ih.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:y.createElement(y.Fragment,null,r&&a?r:n)},slot:c,defaultTag:i3,name:"ListboxSelectedOption"}))}let c3=Je(J8),l3=Je(e3),u3=_x,f3=Je(r3),d3=Je(s3),p3=Je(a3),Et=Object.assign(c3,{Button:l3,Label:u3,Options:f3,Option:d3,SelectedOption:p3});const h3=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_active)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_active",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),m3=()=>C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[C.jsx("g",{clipPath:"url(#clip0_inactive)",children:C.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"})}),C.jsx("defs",{children:C.jsx("clipPath",{id:"clip0_inactive",children:C.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),Xo=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return C.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>C.jsx("div",{className:"flex items-center justify-center",children:o>t-e?C.jsx(h3,{}):C.jsx(m3,{})},o))})};class Rt{}rs(Rt,"FAST",3),rs(Rt,"Medium",2),rs(Rt,"SLOW",1),rs(Rt,"NONE",0);const b3=Object.values({MAINNET:1,SEPOLIA:11155111}),wn=e=>{const t=typeof e=="string"?parseInt(e,10):e;return b3.includes(t)},g3={USDT:!0},kh=(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:!g3[t.toUpperCase()]:!0},y3=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>{const{t:i}=Nt();return C.jsx("div",{className:`relative ${o}`,children:C.jsx(Et,{value:t,onChange:n,disabled:r,children:({open:c})=>C.jsxs(C.Fragment,{children:[C.jsxs(Et.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
@@ -146,7 +146,7 @@ ${Tg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
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=>C.jsx(Et.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})=>C.jsx(C.Fragment,{children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[a.chainIconUrl?C.jsx("img",{src:a.chainIconUrl,alt:a.chain,className:"w-5 h-5 rounded-full"}):C.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:a.chain.charAt(0)})}),C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${l||u?"text-text-primary":"text-text-tertiary"}`,children:a.chain})})]}),C.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:C.jsx(Xo,{className:"w-full justify-between",selectedLevel:wn(a.chainId)?Rt.SLOW:Rt.FAST,maxLevel:3})})]})})},a.chainId))})})]})})})},y3=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:c}=Nt(),a=l=>l.token||l.symbol;return C.jsx("div",{className:`relative ${o}`,children:C.jsx(Et,{value:t,onChange:n,disabled:r,children:({open:l})=>C.jsxs(C.Fragment,{children:[C.jsxs(Et.Button,{className:`
149
+ `,children:e.filter(a=>a[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(a=>C.jsx(Et.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})=>C.jsx(C.Fragment,{children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[a.chainIconUrl?C.jsx("img",{src:a.chainIconUrl,alt:a.chain,className:"w-5 h-5 rounded-full"}):C.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:C.jsx("span",{className:"text-xs text-white font-bold",children:a.chain.charAt(0)})}),C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${l||u?"text-text-primary":"text-text-tertiary"}`,children:a.chain})})]}),C.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:C.jsx(Xo,{className:"w-full justify-between",selectedLevel:wn(a.chainId)?Rt.SLOW:Rt.FAST,maxLevel:3})})]})})},a.chainId))})})]})})})},v3=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:c}=Nt(),a=l=>l.token||l.symbol;return C.jsx("div",{className:`relative ${o}`,children:C.jsx(Et,{value:t,onChange:n,disabled:r,children:({open:l})=>C.jsxs(C.Fragment,{children:[C.jsxs(Et.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
@@ -156,7 +156,7 @@ ${Tg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
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=>C.jsx(Et.Option,{value:u,className:({active:f,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:p})=>C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),C.jsxs("div",{className:"flex flex-col",children:[C.jsx("span",{className:`text-sm font-medium ${f||p?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===pn&&i==="perpetual"&&u.token==="USDC"&&C.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:c("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},kh=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=pn,txType:i="deposit",accountType:c})=>{const a=y.useCallback(w=>i==="withdraw"?s===pn?w.allowAaWithdraw!==!1:w.allowWithdraw!==!1:s===pn?w.allowAaDeposit!==!1:w.allowDeposit!==!1,[i,s]),l=y.useMemo(()=>{const w=new Set,P=[];for(const E of t)if(a(E))for(const T of E.tokenList||[]){const A=T.symbol||T.token;!A||!(i!=="withdraw"||T.withdrawEnable===!0&&T.pullOff!==!0)||w.has(A)||(w.add(A),P.push({token:A,symbol:A,iconUrl:T.iconUrl,decimals:T.decimals,tokenAddress:T.tokenAddress}))}return P},[t,a,i]),u=w=>{n(w.chainId)},f=w=>{const P=w.symbol||w.token;o(P);const E=[];for(const T of t){if(!a(T))continue;(T.tokenList||[]).some(D=>(D.symbol||D.token)===P)&&E.push(T.chainId)}!E.includes(e.chainId)&&E[0]!==void 0&&n(E[0])},p=y.useMemo(()=>{var E,T;const w=r||((E=l[0])==null?void 0:E.symbol)||((T=l[0])==null?void 0:T.token);if(!w)return[];const P=[];for(const A of t){if(!a(A))continue;const D=(A.tokenList||[]).find(F=>(F.symbol||F.token)===w?i==="withdraw"?F.withdrawEnable===!0&&F.pullOff!==!0:!0:!1);D&&P.push({...A,tokenList:[{token:D.token,symbol:D.symbol,iconUrl:D.iconUrl,decimals:D.decimals,tokenAddress:D.tokenAddress}]})}return P},[t,r,l,a,i]),d=y.useMemo(()=>p.find(w=>w.chainId===e.chainId)||p[0],[p,e.chainId]),h=y.useMemo(()=>l,[l]),m=y.useMemo(()=>{if(h.length!==0)return h.find(w=>w.token===r||w.symbol===r)||h[0]},[h,r]);return y.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]),y.useEffect(()=>{if(p.length===0)return;p.some(P=>P.chainId===e.chainId)||n(p[0].chainId)},[p,e.chainId,n]),C.jsxs("div",{className:"space-y-4",children:[h.length>0&&m&&C.jsx(y3,{tokens:h,selectedToken:m,onTokenChange:f,walletType:s,accountType:c}),C.jsx(g3,{chains:p,selectedChain:d,onChainChange:w=>{const P=t.find(E=>E.chainId===w.chainId);P&&u(P)},walletType:s,className:"w-full"})]})},v3=({options:e})=>C.jsx(C.Fragment,{children:e.map(t=>C.jsx(Et.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})=>C.jsx("div",{className:"flex items-center justify-between",children:C.jsx("div",{className:"flex items-center space-x-3",children:C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Mh=({selectedAccount:e,onAccountChange:t,options:n,disabled:r=!1,className:o=""})=>{var d;const{t:s}=Nt(),i=y.useMemo(()=>[{value:"spot",label:s("account.spot")},{value:"perpetual",label:s("account.perpetual-v1")}],[s]),c=n&&n.length>0?n:i,a=((d=c.find(h=>h.value===(e??"spot")))==null?void 0:d.label)||"",[l,u]=y.useState(e??"spot"),f=e??l,p=h=>{t==null||t(h),e||u(h)};return C.jsx("div",{className:`relative mb-4 ${o}`,children:C.jsx(Et,{value:f,onChange:p,disabled:r,children:({open:h})=>C.jsxs(C.Fragment,{children:[C.jsxs(Et.Button,{className:`
159
+ `,children:e.map(u=>C.jsx(Et.Option,{value:u,className:({active:f,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":f?"bg-fill-input-secondary":""}`,children:({selected:f,active:p})=>C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),C.jsxs("div",{className:"flex flex-col",children:[C.jsx("span",{className:`text-sm font-medium ${f||p?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===pn&&i==="perpetual"&&u.token==="USDC"&&C.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:c("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},$h=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=pn,txType:i="deposit",accountType:c})=>{const a=y.useCallback(v=>i==="withdraw"?s===pn?v.allowAaWithdraw!==!1:v.allowWithdraw!==!1:s===pn?v.allowAaDeposit!==!1:v.allowDeposit!==!1,[i,s]),l=y.useMemo(()=>{const v=new Set,T=[];for(const E of t)if(a(E))for(const S of E.tokenList||[]){const A=S.symbol||S.token;!A||!(i!=="withdraw"||S.withdrawEnable===!0&&S.pullOff!==!0)||v.has(A)||(v.add(A),T.push({token:A,symbol:A,iconUrl:S.iconUrl,decimals:S.decimals,tokenAddress:S.tokenAddress}))}return T},[t,a,i]),u=v=>{n(v.chainId)},f=v=>{const T=v.symbol||v.token;o(T);const E=[];for(const S of t){if(!a(S))continue;(S.tokenList||[]).some(D=>(D.symbol||D.token)===T)&&E.push(S.chainId)}!E.includes(e.chainId)&&E[0]!==void 0&&n(E[0])},p=y.useMemo(()=>{var E,S;const v=r||((E=l[0])==null?void 0:E.symbol)||((S=l[0])==null?void 0:S.token);if(!v)return[];const T=[];for(const A of t){if(!a(A))continue;const D=(A.tokenList||[]).find(F=>(F.symbol||F.token)===v?i==="withdraw"?F.withdrawEnable===!0&&F.pullOff!==!0:!0:!1);D&&T.push({...A,tokenList:[{token:D.token,symbol:D.symbol,iconUrl:D.iconUrl,decimals:D.decimals,tokenAddress:D.tokenAddress}]})}return T},[t,r,l,a,i]),d=y.useMemo(()=>p.find(v=>v.chainId===e.chainId)||p[0],[p,e.chainId]),h=y.useMemo(()=>l,[l]),m=y.useMemo(()=>{if(h.length!==0)return h.find(v=>v.token===r||v.symbol===r)||h[0]},[h,r]);return y.useEffect(()=>{if(h.length===0)return;if(!h.some(T=>(T.symbol||T.token)===r)){const T=h[0];o(T.symbol||T.token)}},[h,r,o]),y.useEffect(()=>{if(p.length===0)return;p.some(T=>T.chainId===e.chainId)||n(p[0].chainId)},[p,e.chainId,n]),C.jsxs("div",{className:"space-y-4",children:[h.length>0&&m&&C.jsx(v3,{tokens:h,selectedToken:m,onTokenChange:f,walletType:s,accountType:c}),C.jsx(y3,{chains:p,selectedChain:d,onChainChange:v=>{const T=t.find(E=>E.chainId===v.chainId);T&&u(T)},walletType:s,className:"w-full"})]})},w3=({options:e})=>C.jsx(C.Fragment,{children:e.map(t=>C.jsx(Et.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})=>C.jsx("div",{className:"flex items-center justify-between",children:C.jsx("div",{className:"flex items-center space-x-3",children:C.jsx("div",{className:"flex flex-col",children:C.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Mh=({selectedAccount:e,onAccountChange:t,options:n,disabled:r=!1,className:o=""})=>{var d;const{t:s}=Nt(),i=y.useMemo(()=>[{value:"spot",label:s("account.spot")},{value:"perpetual",label:s("account.perpetual-v1")}],[s]),c=n&&n.length>0?n:i,a=((d=c.find(h=>h.value===(e??"spot")))==null?void 0:d.label)||"",[l,u]=y.useState(e??"spot"),f=e??l,p=h=>{t==null||t(h),e||u(h)};return C.jsx("div",{className:`relative mb-4 ${o}`,children:C.jsx(Et,{value:f,onChange:p,disabled:r,children:({open:h})=>C.jsxs(C.Fragment,{children:[C.jsxs(Et.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
@@ -166,15 +166,15 @@ ${Tg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
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:C.jsx(v3,{options:c})})})]})})})};var gi={},w3=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()}},x3=w3,Dh={"text/plain":"Text","text/html":"Url",default:"Text"},E3="Copy to clipboard: #{key}, Enter";function S3(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function P3(e,t){var n,r,o,s,i,c,a=!1;t||(t={}),n=t.debug||!1;try{o=x3(),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=Dh[t.format]||Dh.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=S3("message"in t?t.message:E3),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),c&&document.body.removeChild(c),o()}return a}var T3=P3;function bl(e){"@babel/helpers - typeof";return bl=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},bl(e)}Object.defineProperty(gi,"__esModule",{value:!0}),gi.CopyToClipboard=void 0;var yi=Bh(y),A3=Bh(T3),N3=["text","onCopy","options","children"];function Bh(e){return e&&e.__esModule?e:{default:e}}function Lh(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 Fh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lh(Object(n),!0).forEach(function(r){yl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C3(e,t){if(e==null)return{};var n=O3(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function O3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function I3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k3(e,t,n){return t&&$3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function M3(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&&gl(e,t)}function gl(e,t){return gl=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},gl(e,t)}function D3(e){var t=L3();return function(){var r=vi(e),o;if(t){var s=vi(this).constructor;o=Reflect.construct(r,arguments,s)}else o=r.apply(this,arguments);return B3(this,o)}}function B3(e,t){if(t&&(bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rh(e)}function Rh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vi(e){return vi=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},vi(e)}function yl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jh=function(e){M3(n,e);var t=D3(n);function n(){var r;I3(this,n);for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),yl(Rh(r),"onClick",function(c){var a=r.props,l=a.text,u=a.onCopy,f=a.children,p=a.options,d=yi.default.Children.only(f),h=(0,A3.default)(l,p);u&&u(l,h),d&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(c)}),r}return k3(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var s=o.children,i=C3(o,N3),c=yi.default.Children.only(s);return yi.default.cloneElement(c,Fh(Fh({},i),{},{onClick:this.onClick}))}}]),n}(yi.default.PureComponent);gi.CopyToClipboard=jh,yl(jh,"defaultProps",{onCopy:void 0,options:void 0});var F3=gi,vl=F3.CopyToClipboard;vl.CopyToClipboard=vl;var R3=vl;const j3=Vm(R3);var z3=Object.defineProperty,wi=Object.getOwnPropertySymbols,zh=Object.prototype.hasOwnProperty,Uh=Object.prototype.propertyIsEnumerable,_h=(e,t,n)=>t in e?z3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wl=(e,t)=>{for(var n in t||(t={}))zh.call(t,n)&&_h(e,n,t[n]);if(wi)for(var n of wi(t))Uh.call(t,n)&&_h(e,n,t[n]);return e},xl=(e,t)=>{var n={};for(var r in e)zh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wi)for(var r of wi(e))t.indexOf(r)<0&&Uh.call(e,r)&&(n[r]=e[r]);return n};/**
169
+ `,children:C.jsx(w3,{options:c})})})]})})})};var gi={},x3=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()}},E3=x3,Dh={"text/plain":"Text","text/html":"Url",default:"Text"},S3="Copy to clipboard: #{key}, Enter";function P3(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function T3(e,t){var n,r,o,s,i,c,a=!1;t||(t={}),n=t.debug||!1;try{o=E3(),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=Dh[t.format]||Dh.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=P3("message"in t?t.message:S3),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),c&&document.body.removeChild(c),o()}return a}var A3=T3;function bl(e){"@babel/helpers - typeof";return bl=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},bl(e)}Object.defineProperty(gi,"__esModule",{value:!0}),gi.CopyToClipboard=void 0;var yi=Bh(y),N3=Bh(A3),C3=["text","onCopy","options","children"];function Bh(e){return e&&e.__esModule?e:{default:e}}function Lh(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 Fh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lh(Object(n),!0).forEach(function(r){yl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O3(e,t){if(e==null)return{};var n=I3(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function I3(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function k3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M3(e,t,n){return t&&$3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function D3(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&&gl(e,t)}function gl(e,t){return gl=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},gl(e,t)}function B3(e){var t=F3();return function(){var r=vi(e),o;if(t){var s=vi(this).constructor;o=Reflect.construct(r,arguments,s)}else o=r.apply(this,arguments);return L3(this,o)}}function L3(e,t){if(t&&(bl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rh(e)}function Rh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vi(e){return vi=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},vi(e)}function yl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jh=function(e){D3(n,e);var t=B3(n);function n(){var r;k3(this,n);for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];return r=t.call.apply(t,[this].concat(s)),yl(Rh(r),"onClick",function(c){var a=r.props,l=a.text,u=a.onCopy,f=a.children,p=a.options,d=yi.default.Children.only(f),h=(0,N3.default)(l,p);u&&u(l,h),d&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(c)}),r}return M3(n,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var s=o.children,i=O3(o,C3),c=yi.default.Children.only(s);return yi.default.cloneElement(c,Fh(Fh({},i),{},{onClick:this.onClick}))}}]),n}(yi.default.PureComponent);gi.CopyToClipboard=jh,yl(jh,"defaultProps",{onCopy:void 0,options:void 0});var R3=gi,vl=R3.CopyToClipboard;vl.CopyToClipboard=vl;var j3=vl;const z3=Vm(j3);var U3=Object.defineProperty,wi=Object.getOwnPropertySymbols,zh=Object.prototype.hasOwnProperty,Uh=Object.prototype.propertyIsEnumerable,_h=(e,t,n)=>t in e?U3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wl=(e,t)=>{for(var n in t||(t={}))zh.call(t,n)&&_h(e,n,t[n]);if(wi)for(var n of wi(t))Uh.call(t,n)&&_h(e,n,t[n]);return e},xl=(e,t)=>{var n={};for(var r in e)zh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wi)for(var r of wi(e))t.indexOf(r)<0&&Uh.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 ir;(e=>{const t=class fe{constructor(a,l,u,f){if(this.version=a,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],a<fe.MIN_VERSION||a>fe.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 w=this.getPenaltyScore();w<h&&(f=m,h=w),this.applyMask(m)}}o(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(a,l){const u=e.QrSegment.makeSegments(a);return fe.encodeSegments(u,l)}static encodeBinary(a,l){const u=e.QrSegment.makeBytes(a);return fe.encodeSegments([u],l)}static encodeSegments(a,l,u=1,f=40,p=-1,d=!0){if(!(fe.MIN_VERSION<=u&&u<=f&&f<=fe.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let h,m;for(h=u;;h++){const T=fe.getNumDataCodewords(h,l)*8,A=i.getTotalBits(a,h);if(A<=T){m=A;break}if(h>=f)throw new RangeError("Data too long")}for(const T of[fe.Ecc.MEDIUM,fe.Ecc.QUARTILE,fe.Ecc.HIGH])d&&m<=fe.getNumDataCodewords(h,T)*8&&(l=T);let w=[];for(const T of a){n(T.mode.modeBits,4,w),n(T.numChars,T.mode.numCharCountBits(h),w);for(const A of T.getData())w.push(A)}o(w.length==m);const P=fe.getNumDataCodewords(h,l)*8;o(w.length<=P),n(0,Math.min(4,P-w.length),w),n(0,(8-w.length%8)%8,w),o(w.length%8==0);for(let T=236;w.length<P;T^=253)n(T,8,w);let E=[];for(;E.length*8<w.length;)E.push(0);return w.forEach((T,A)=>E[A>>>3]|=T<<7-(A&7)),new fe(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!=fe.getNumDataCodewords(l,u))throw new RangeError("Invalid argument");const f=fe.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l],p=fe.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],d=Math.floor(fe.getNumRawDataModules(l)/8),h=f-d%f,m=Math.floor(d/f);let w=[];const P=fe.reedSolomonComputeDivisor(p);for(let T=0,A=0;T<f;T++){let D=a.slice(A,A+m-p+(T<h?0:1));A+=D.length;const F=fe.reedSolomonComputeRemainder(D,P);T<h&&D.push(0),w.push(D.concat(F))}let E=[];for(let T=0;T<w[0].length;T++)w.forEach((A,D)=>{(T!=m-p||D>=h)&&E.push(A[T])});return o(E.length==d),E}drawCodewords(a){if(a.length!=Math.floor(fe.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 w=0;w<this.size;w++)this.modules[p][w]==d?(h++,h==5?a+=fe.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*fe.PENALTY_N3),d=this.modules[p][w],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*fe.PENALTY_N3}for(let p=0;p<this.size;p++){let d=!1,h=0,m=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[w][p]==d?(h++,h==5?a+=fe.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*fe.PENALTY_N3),d=this.modules[w][p],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*fe.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+=fe.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*fe.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<fe.MIN_VERSION||a>fe.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(fe.getNumRawDataModules(a)/8)-fe.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*fe.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]=fe.reedSolomonMultiply(l[p],u),p+1<l.length&&(l[p]^=l[p+1]);u=fe.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]^=fe.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 Pe{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 Pe(Pe.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!Pe.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 Pe(Pe.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!Pe.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=Pe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;f+=Pe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),n(f,11,l)}return u<a.length&&n(Pe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,l),new Pe(Pe.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:Pe.isNumeric(a)?[Pe.makeNumeric(a)]:Pe.isAlphanumeric(a)?[Pe.makeAlphanumeric(a)]:[Pe.makeBytes(Pe.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 Pe(Pe.Mode.ECI,0,l)}static isNumeric(a){return Pe.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return Pe.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})(ir||(ir={})),(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={}))})(ir||(ir={})),(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={}))})(ir||(ir={}));var jr=ir;/**
173
+ */var ir;(e=>{const t=class fe{constructor(a,l,u,f){if(this.version=a,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],a<fe.MIN_VERSION||a>fe.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 fe.encodeSegments(u,l)}static encodeBinary(a,l){const u=e.QrSegment.makeBytes(a);return fe.encodeSegments([u],l)}static encodeSegments(a,l,u=1,f=40,p=-1,d=!0){if(!(fe.MIN_VERSION<=u&&u<=f&&f<=fe.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let h,m;for(h=u;;h++){const S=fe.getNumDataCodewords(h,l)*8,A=i.getTotalBits(a,h);if(A<=S){m=A;break}if(h>=f)throw new RangeError("Data too long")}for(const S of[fe.Ecc.MEDIUM,fe.Ecc.QUARTILE,fe.Ecc.HIGH])d&&m<=fe.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 A of S.getData())v.push(A)}o(v.length==m);const T=fe.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,A)=>E[A>>>3]|=S<<7-(A&7)),new fe(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!=fe.getNumDataCodewords(l,u))throw new RangeError("Invalid argument");const f=fe.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l],p=fe.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l],d=Math.floor(fe.getNumRawDataModules(l)/8),h=f-d%f,m=Math.floor(d/f);let v=[];const T=fe.reedSolomonComputeDivisor(p);for(let S=0,A=0;S<f;S++){let D=a.slice(A,A+m-p+(S<h?0:1));A+=D.length;const F=fe.reedSolomonComputeRemainder(D,T);S<h&&D.push(0),v.push(D.concat(F))}let E=[];for(let S=0;S<v[0].length;S++)v.forEach((A,D)=>{(S!=m-p||D>=h)&&E.push(A[S])});return o(E.length==d),E}drawCodewords(a){if(a.length!=Math.floor(fe.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+=fe.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*fe.PENALTY_N3),d=this.modules[p][v],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*fe.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+=fe.PENALTY_N1:h>5&&a++):(this.finderPenaltyAddHistory(h,m),d||(a+=this.finderPenaltyCountPatterns(m)*fe.PENALTY_N3),d=this.modules[v][p],h=1);a+=this.finderPenaltyTerminateAndCount(d,h,m)*fe.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+=fe.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*fe.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<fe.MIN_VERSION||a>fe.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(fe.getNumRawDataModules(a)/8)-fe.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*fe.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]=fe.reedSolomonMultiply(l[p],u),p+1<l.length&&(l[p]^=l[p+1]);u=fe.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]^=fe.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 Pe{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 Pe(Pe.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!Pe.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 Pe(Pe.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!Pe.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=Pe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u))*45;f+=Pe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u+1)),n(f,11,l)}return u<a.length&&n(Pe.ALPHANUMERIC_CHARSET.indexOf(a.charAt(u)),6,l),new Pe(Pe.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:Pe.isNumeric(a)?[Pe.makeNumeric(a)]:Pe.isAlphanumeric(a)?[Pe.makeAlphanumeric(a)]:[Pe.makeBytes(Pe.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 Pe(Pe.Mode.ECI,0,l)}static isNumeric(a){return Pe.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return Pe.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})(ir||(ir={})),(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={}))})(ir||(ir={})),(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={}))})(ir||(ir={}));var jr=ir;/**
174
174
  * @license qrcode.react
175
175
  * Copyright (c) Paul O'Shannessy
176
176
  * SPDX-License-Identifier: ISC
177
- */var U3={L:jr.QrCode.Ecc.LOW,M:jr.QrCode.Ecc.MEDIUM,Q:jr.QrCode.Ecc.QUARTILE,H:jr.QrCode.Ecc.HIGH},Wh=128,Vh="L",Hh="#FFFFFF",Gh="#000000",qh=!1,Kh=1,_3=4,W3=0,V3=.1;function Zh(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 Yh(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 H3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*V3),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),w=Math.ceil(c+l-h),P=Math.ceil(a+u-m);p={x:h,y:m,w,h:P}}const d=r.crossOrigin;return{x:l,y:u,h:a,w:c,excavation:p,opacity:f,crossOrigin:d}}function G3(e,t){return t!=null?Math.max(Math.floor(t),0):e?_3:W3}function Xh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=y.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,w)=>(m.push(...jr.QrSegment.makeSegments(w)),m),[]);return jr.QrCode.encodeSegments(h,U3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:u,numCells:f,calculatedImageSettings:p}=y.useMemo(()=>{let d=a.getModules();const h=G3(r,o),m=d.length+h*2,w=H3(d,i,h,s);return{cells:d,margin:h,numCells:m,calculatedImageSettings:w}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:l,numCells:f,calculatedImageSettings:p}}var q3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),K3=y.forwardRef(function(t,n){const r=t,{value:o,size:s=Wh,level:i=Vh,bgColor:c=Hh,fgColor:a=Gh,includeMargin:l=qh,minVersion:u=Kh,boostLevel:f,marginSize:p,imageSettings:d}=r,m=xl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=m,P=xl(m,["style"]),E=d==null?void 0:d.src,T=y.useRef(null),A=y.useRef(null),D=y.useCallback(M=>{T.current=M,typeof n=="function"?n(M):n&&(n.current=M)},[n]),[F,L]=y.useState(!1),{margin:b,cells:g,numCells:x,calculatedImageSettings:I}=Xh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:d,size:s});y.useEffect(()=>{if(T.current!=null){const M=T.current,v=M.getContext("2d");if(!v)return;let N=g;const k=A.current,S=I!=null&&k!==null&&k.complete&&k.naturalHeight!==0&&k.naturalWidth!==0;S&&I.excavation!=null&&(N=Yh(g,I.excavation));const B=window.devicePixelRatio||1;M.height=M.width=s*B;const j=s/x*B;v.scale(j,j),v.fillStyle=c,v.fillRect(0,0,x,x),v.fillStyle=a,q3?v.fill(new Path2D(Zh(N,b))):g.forEach(function(U,_){U.forEach(function(q,Z){q&&v.fillRect(Z+b,_+b,1,1)})}),I&&(v.globalAlpha=I.opacity),S&&v.drawImage(k,I.x+b,I.y+b,I.w,I.h)}}),y.useEffect(()=>{L(!1)},[E]);const O=wl({height:s,width:s},w);let $=null;return E!=null&&($=y.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{L(!0)},ref:A,crossOrigin:I==null?void 0:I.crossOrigin})),y.createElement(y.Fragment,null,y.createElement("canvas",wl({style:O,height:s,width:s,ref:D,role:"img"},P)),$)});K3.displayName="QRCodeCanvas";var Jh=y.forwardRef(function(t,n){const r=t,{value:o,size:s=Wh,level:i=Vh,bgColor:c=Hh,fgColor:a=Gh,includeMargin:l=qh,minVersion:u=Kh,boostLevel:f,title:p,marginSize:d,imageSettings:h}=r,m=xl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:P,numCells:E,calculatedImageSettings:T}=Xh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:d,imageSettings:h,size:s});let A=P,D=null;h!=null&&T!=null&&(T.excavation!=null&&(A=Yh(P,T.excavation)),D=y.createElement("image",{href:h.src,height:T.h,width:T.w,x:T.x+w,y:T.y+w,preserveAspectRatio:"none",opacity:T.opacity,crossOrigin:T.crossOrigin}));const F=Zh(A,w);return y.createElement("svg",wl({height:s,width:s,viewBox:`0 0 ${E} ${E}`,ref:n,role:"img"},m),!!p&&y.createElement("title",null,p),y.createElement("path",{fill:c,d:`M0,0 h${E}v${E}H0z`,shapeRendering:"crispEdges"}),y.createElement("path",{fill:a,d:F,shapeRendering:"crispEdges"}),D)});Jh.displayName="QRCodeSVG";function Z3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Y3(){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 Qh(){return/apple/i.test(navigator.vendor)}function X3(){return Z3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function J3(){return Y3().includes("jsdom/")}const em="data-floating-ui-focusable",Q3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function El(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 zr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Gc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Sl(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 eS(e){return e.matches("html,body")}function Yt(e){return(e==null?void 0:e.ownerDocument)||document}function tm(e){return We(e)&&e.matches(Q3)}function tS(e){if(!e||J3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function nS(e){return e?e.hasAttribute(em)?e:e.querySelector("["+em+"]")||e:null}function xi(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,...xi(e,o.id,n)])}function rS(e){return"nativeEvent"in e}function Jo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var oS=typeof document<"u",sS=function(){},Xt=oS?y.useLayoutEffect:sS;const iS={...z};function Ei(e){const t=z.useRef(e);return Xt(()=>{t.current=e}),t}const aS=iS.useInsertionEffect||(e=>e());function Jt(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return aS(()=>{t.current=e}),z.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const nm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rm(e,t){const n=Fp(e,nm()),r=n.length;if(r===0)return;const o=El(Yt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function cS(e){return rm(Yt(e).body,1)||e}function lS(e){return rm(Yt(e).body,-1)||e}function Pl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!zr(n,r)}function uS(e){Fp(e,nm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function om(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 fS="data-floating-ui-focusable",sm="active",im="selected",dS={...z};let am=!1,pS=0;const cm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+pS++;function hS(){const[e,t]=z.useState(()=>am?cm():void 0);return Xt(()=>{e==null&&t(cm())},[]),z.useEffect(()=>{am=!0},[]),e}const Tl=dS.useId||hS;let Al;process.env.NODE_ENV!=="production"&&(Al=new Set);function mS(){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=Al)!=null&&e.has(o))){var s;(s=Al)==null||s.add(o),console.error(o)}}function bS(){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 gS=z.createContext(null),yS=z.createContext(null),Nl=()=>{var e;return((e=z.useContext(gS))==null?void 0:e.id)||null},Cl=()=>z.useContext(yS);function Qo(e){return"data-floating-ui-"+e}function St(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const lm=Qo("safe-polygon");function Ol(e,t,n){if(n&&!Jo(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 Il(e){return typeof e=="function"?e():e}function vS(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=Cl(),h=Nl(),m=Ei(l),w=Ei(a),P=Ei(n),E=Ei(f),T=z.useRef(),A=z.useRef(-1),D=z.useRef(),F=z.useRef(-1),L=z.useRef(!0),b=z.useRef(!1),g=z.useRef(()=>{}),x=z.useRef(!1),I=Jt(()=>{var k;const S=(k=o.current.openEvent)==null?void 0:k.type;return(S==null?void 0:S.includes("mouse"))&&S!=="mousedown"});z.useEffect(()=>{if(!c)return;function k(S){let{open:B}=S;B||(St(A),St(F),L.current=!0,x.current=!1)}return s.on("openchange",k),()=>{s.off("openchange",k)}},[c,s]),z.useEffect(()=>{if(!c||!m.current||!n)return;function k(B){I()&&r(!1,B,"hover")}const S=Yt(i.floating).documentElement;return S.addEventListener("mouseleave",k),()=>{S.removeEventListener("mouseleave",k)}},[i.floating,n,r,c,m,I]);const O=z.useCallback(function(k,S,B){S===void 0&&(S=!0),B===void 0&&(B="hover");const j=Ol(w.current,"close",T.current);j&&!D.current?(St(A),A.current=window.setTimeout(()=>r(!1,k,B),j)):S&&(St(A),r(!1,k,B))},[w,r]),$=Jt(()=>{g.current(),D.current=void 0}),M=Jt(()=>{if(b.current){const k=Yt(i.floating).body;k.style.pointerEvents="",k.removeAttribute(lm),b.current=!1}}),v=Jt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);z.useEffect(()=>{if(!c)return;function k(_){if(St(A),L.current=!1,u&&!Jo(T.current)||Il(E.current)>0&&!Ol(w.current,"open"))return;const q=Ol(w.current,"open",T.current);q?A.current=window.setTimeout(()=>{P.current||r(!0,_,"hover")},q):n||r(!0,_,"hover")}function S(_){if(v()){M();return}g.current();const q=Yt(i.floating);if(St(F),x.current=!1,m.current&&o.current.floatingContext){n||St(A),D.current=m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){M(),$(),v()||O(_,!0,"safe-polygon")}});const H=D.current;q.addEventListener("mousemove",H),g.current=()=>{q.removeEventListener("mousemove",H)};return}(T.current==="touch"?!zr(i.floating,_.relatedTarget):!0)&&O(_)}function B(_){v()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){M(),$(),v()||O(_)}})(_))}function j(){St(A)}function U(_){v()||O(_,!1)}if(ge(i.domReference)){const _=i.domReference,q=i.floating;return n&&_.addEventListener("mouseleave",B),p&&_.addEventListener("mousemove",k,{once:!0}),_.addEventListener("mouseenter",k),_.addEventListener("mouseleave",S),q&&(q.addEventListener("mouseleave",B),q.addEventListener("mouseenter",j),q.addEventListener("mouseleave",U)),()=>{n&&_.removeEventListener("mouseleave",B),p&&_.removeEventListener("mousemove",k),_.removeEventListener("mouseenter",k),_.removeEventListener("mouseleave",S),q&&(q.removeEventListener("mouseleave",B),q.removeEventListener("mouseenter",j),q.removeEventListener("mouseleave",U))}}},[i,c,e,u,p,O,$,M,r,n,P,d,w,m,o,v,E]),Xt(()=>{var k;if(c&&n&&(k=m.current)!=null&&(k=k.__options)!=null&&k.blockPointerEvents&&I()){b.current=!0;const B=i.floating;if(ge(i.domReference)&&B){var S;const j=Yt(i.floating).body;j.setAttribute(lm,"");const U=i.domReference,_=d==null||(S=d.nodesRef.current.find(q=>q.id===h))==null||(S=S.context)==null?void 0:S.elements.floating;return _&&(_.style.pointerEvents=""),j.style.pointerEvents="none",U.style.pointerEvents="auto",B.style.pointerEvents="auto",()=>{j.style.pointerEvents="",U.style.pointerEvents="",B.style.pointerEvents=""}}}},[c,n,h,i,d,m,I]),Xt(()=>{n||(T.current=void 0,x.current=!1,$(),M())},[n,$,M]),z.useEffect(()=>()=>{$(),St(A),St(F),M()},[c,i.domReference,$,M]);const N=z.useMemo(()=>{function k(S){T.current=S.pointerType}return{onPointerDown:k,onPointerEnter:k,onMouseMove(S){const{nativeEvent:B}=S;function j(){!L.current&&!P.current&&r(!0,B,"hover")}u&&!Jo(T.current)||n||Il(E.current)===0||x.current&&S.movementX**2+S.movementY**2<2||(St(F),T.current==="touch"?j():(x.current=!0,F.current=window.setTimeout(j,Il(E.current))))}}},[u,r,n,P,E]);return z.useMemo(()=>c?{reference:N}:{},[c,N])}const um={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},fm=z.forwardRef(function(t,n){const[r,o]=z.useState();Xt(()=>{Qh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Qo("focus-guard")]:"",style:um};return C.jsx("span",{...t,...s})}),dm=z.createContext(null),pm=Qo("portal");function wS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Tl(),o=ES(),[s,i]=z.useState(null),c=z.useRef(null);return Xt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Xt(()=>{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(pm,""),a.appendChild(l),c.current=l,i(l)},[t,r]),Xt(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Hc(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(pm,""),a=l||a,a.appendChild(u),c.current=u,i(u)},[t,n,r,o]),s}function xS(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=wS({id:n,root:r}),[i,c]=z.useState(null),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),f=z.useRef(null),p=i==null?void 0:i.modal,d=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return z.useEffect(()=>{if(!s||!o||p)return;function m(w){s&&Pl(w)&&(w.type==="focusin"?om:uS)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),z.useEffect(()=>{s&&(d||om(s))},[d,s]),C.jsxs(dm.Provider,{value:z.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&C.jsx(fm,{"data-type":"outside",ref:a,onFocus:m=>{if(Pl(m,s)){var w;(w=u.current)==null||w.focus()}else{const P=i?i.domReference:null,E=lS(P);E==null||E.focus()}}}),h&&s&&C.jsx("span",{"aria-owns":s.id,style:um}),s&&Vr.createPortal(t,s),h&&s&&C.jsx(fm,{"data-type":"outside",ref:l,onFocus:m=>{if(Pl(m,s)){var w;(w=f.current)==null||w.focus()}else{const P=i?i.domReference:null,E=cS(P);E==null||E.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const ES=()=>z.useContext(dm);function hm(e){return We(e.target)&&e.target.tagName==="BUTTON"}function SS(e){return We(e.target)&&e.target.tagName==="A"}function mm(e){return tm(e)}function PS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:a=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,p=z.useRef(),d=z.useRef(!1),h=z.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const w=p.current;m.button===0&&c!=="click"&&(Jo(w,!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 w=p.current;if(c==="mousedown"&&p.current){p.current=void 0;return}Jo(w,!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||hm(m))&&(m.key===" "&&!mm(s)&&(m.preventDefault(),d.current=!0),!SS(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||hm(m)||mm(s)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,c,l,u,r,n,f,a]);return z.useMemo(()=>i?{reference:h}:{},[i,h])}const TS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},AS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},bm=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 NS(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=Cl(),w=Jt(typeof a=="function"?a:()=>!1),P=typeof a=="function"?w:a,E=z.useRef(!1),{escapeKey:T,outsidePress:A}=bm(d),{escapeKey:D,outsidePress:F}=bm(h),L=z.useRef(!1),b=Jt(M=>{var v;if(!n||!i||!c||M.key!=="Escape"||L.current)return;const N=(v=s.current.floatingContext)==null?void 0:v.nodeId,k=m?xi(m.nodesRef.current,N):[];if(!T&&(M.stopPropagation(),k.length>0)){let S=!0;if(k.forEach(B=>{var j;if((j=B.context)!=null&&j.open&&!B.context.dataRef.current.__escapeKeyBubbles){S=!1;return}}),!S)return}r(!1,rS(M)?M.nativeEvent:M,"escape-key")}),g=Jt(M=>{var v;const N=()=>{var k;b(M),(k=Ur(M))==null||k.removeEventListener("keydown",N)};(v=Ur(M))==null||v.addEventListener("keydown",N)}),x=Jt(M=>{var v;const N=s.current.insideReactTree;s.current.insideReactTree=!1;const k=E.current;if(E.current=!1,l==="click"&&k||N||typeof P=="function"&&!P(M))return;const S=Ur(M),B="["+Qo("inert")+"]",j=Yt(o.floating).querySelectorAll(B);let U=ge(S)?S:null;for(;U&&!bn(U);){const H=gn(U);if(bn(H)||!ge(H))break;U=H}if(j.length&&ge(S)&&!eS(S)&&!zr(S,o.floating)&&Array.from(j).every(H=>!zr(U,H)))return;if(We(S)&&$){const H=bn(S),W=xt(S),J=/auto|scroll/,K=H||J.test(W.overflowX),Q=H||J.test(W.overflowY),oe=K&&S.clientWidth>0&&S.scrollWidth>S.clientWidth,ee=Q&&S.clientHeight>0&&S.scrollHeight>S.clientHeight,ue=W.direction==="rtl",ce=ee&&(ue?M.offsetX<=S.offsetWidth-S.clientWidth:M.offsetX>S.clientWidth),pe=oe&&M.offsetY>S.clientHeight;if(ce||pe)return}const _=(v=s.current.floatingContext)==null?void 0:v.nodeId,q=m&&xi(m.nodesRef.current,_).some(H=>{var W;return Sl(M,(W=H.context)==null?void 0:W.elements.floating)});if(Sl(M,o.floating)||Sl(M,o.domReference)||q)return;const Z=m?xi(m.nodesRef.current,_):[];if(Z.length>0){let H=!0;if(Z.forEach(W=>{var J;if((J=W.context)!=null&&J.open&&!W.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}r(!1,M,"outside-press")}),I=Jt(M=>{var v;const N=()=>{var k;x(M),(k=Ur(M))==null||k.removeEventListener(l,N)};(v=Ur(M))==null||v.addEventListener(l,N)});z.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=A;let M=-1;function v(j){r(!1,j,"ancestor-scroll")}function N(){window.clearTimeout(M),L.current=!0}function k(){M=window.setTimeout(()=>{L.current=!1},ei()?5:0)}const S=Yt(o.floating);c&&(S.addEventListener("keydown",D?g:b,D),S.addEventListener("compositionstart",N),S.addEventListener("compositionend",k)),P&&S.addEventListener(l,F?I:x,F);let B=[];return p&&(ge(o.domReference)&&(B=Bn(o.domReference)),ge(o.floating)&&(B=B.concat(Bn(o.floating))),!ge(o.reference)&&o.reference&&o.reference.contextElement&&(B=B.concat(Bn(o.reference.contextElement)))),B=B.filter(j=>{var U;return j!==((U=S.defaultView)==null?void 0:U.visualViewport)}),B.forEach(j=>{j.addEventListener("scroll",v,{passive:!0})}),()=>{c&&(S.removeEventListener("keydown",D?g:b,D),S.removeEventListener("compositionstart",N),S.removeEventListener("compositionend",k)),P&&S.removeEventListener(l,F?I:x,F),B.forEach(j=>{j.removeEventListener("scroll",v)}),window.clearTimeout(M)}},[s,o,c,P,l,n,r,p,i,T,A,b,D,g,x,F,I]),z.useEffect(()=>{s.current.insideReactTree=!1},[s,P,l]);const O=z.useMemo(()=>({onKeyDown:b,...u&&{[TS[f]]:M=>{r(!1,M.nativeEvent,"reference-press")},...f!=="click"&&{onClick(M){r(!1,M.nativeEvent,"reference-press")}}}}),[b,r,u,f]),$=z.useMemo(()=>({onKeyDown:b,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[AS[l]]:()=>{s.current.insideReactTree=!0}}),[b,l,s]);return z.useMemo(()=>i?{reference:O,floating:$}:{},[i,O,$])}function CS(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Tl(),s=z.useRef({}),[i]=z.useState(()=>bS()),c=Nl()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!ge(d)&&mS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=z.useState(r.reference),u=Jt((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=z.useMemo(()=>({setPositionReference:l}),[]),p=z.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function OS(e){e===void 0&&(e={});const{nodeId:t}=e,n=CS({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=z.useState(null),[c,a]=z.useState(null),u=(o==null?void 0:o.domReference)||s,f=z.useRef(null),p=Cl();Xt(()=>{u&&(f.current=u)},[u]);const d=Jp({...e,elements:{...o,...c&&{reference:c}}}),h=z.useCallback(T=>{const A=ge(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;a(A),d.refs.setReference(A)},[d.refs]),m=z.useCallback(T=>{(ge(T)||T===null)&&(f.current=T,i(T)),(ge(d.refs.reference.current)||d.refs.reference.current===null||T!==null&&!ge(T))&&d.refs.setReference(T)},[d.refs]),w=z.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),P=z.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=z.useMemo(()=>({...d,...r,refs:w,elements:P,nodeId:t}),[d,w,P,t,r]);return Xt(()=>{r.dataRef.current.floatingContext=E;const T=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);T&&(T.context=E)}),z.useMemo(()=>({...d,context:E,refs:w,elements:P}),[d,w,P,E])}function $l(){return X3()&&Qh()}function IS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:a=!0}=t,l=z.useRef(!1),u=z.useRef(-1),f=z.useRef(!0);z.useEffect(()=>{if(!c)return;const d=et(i.domReference);function h(){!n&&We(i.domReference)&&i.domReference===El(Yt(i.domReference))&&(l.current=!0)}function m(){f.current=!0}function w(){f.current=!1}return d.addEventListener("blur",h),$l()&&(d.addEventListener("keydown",m,!0),d.addEventListener("pointerdown",w,!0)),()=>{d.removeEventListener("blur",h),$l()&&(d.removeEventListener("keydown",m,!0),d.removeEventListener("pointerdown",w,!0))}},[i.domReference,n,c]),z.useEffect(()=>{if(!c)return;function d(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(l.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,c]),z.useEffect(()=>()=>{St(u)},[]);const p=z.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const h=Ur(d.nativeEvent);if(a&&ge(h)){if($l()&&!d.relatedTarget){if(!f.current&&!tm(h))return}else if(!tS(h))return}r(!0,d.nativeEvent,"focus")},onBlur(d){l.current=!1;const h=d.relatedTarget,m=d.nativeEvent,w=ge(h)&&h.hasAttribute(Qo("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var P;const E=El(i.domReference?i.domReference.ownerDocument:document);!h&&E===i.domReference||zr((P=s.current.floatingContext)==null?void 0:P.refs.floating.current,E)||zr(i.domReference,E)||w||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return z.useMemo(()=>c?{reference:p}:{},[c,p])}function kl(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[sm]:i,[im]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[fS]:""},...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&&[sm,im].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(w=>w(...h)).find(w=>w!==void 0)}}}else i[l]=u}),i),{})}}function $S(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=z.useCallback(c=>kl(c,e,"reference"),t),s=z.useCallback(c=>kl(c,e,"floating"),n),i=z.useCallback(c=>kl(c,e,"item"),r);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const kS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function MS(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=Tl(),u=((n=s.domReference)==null?void 0:n.id)||l,f=z.useMemo(()=>{var E;return((E=nS(s.floating))==null?void 0:E.id)||i},[s.floating,i]),p=(r=kS.get(a))!=null?r:a,h=Nl()!=null,m=z.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?f:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,f,h,o,u,a]),w=z.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,a]),P=z.useCallback(E=>{let{active:T,selected:A}=E;const D={role:"option",...T&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...D,"aria-selected":A}}return{}},[f,a]);return z.useMemo(()=>c?{reference:m,floating:w,item:P}:{},[c,m,w,P])}const gm=y.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 C.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});gm.displayName="TooltipArrow";const ar=({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]=y.useState(!1),f=y.useRef(null),{refs:p,floatingStyles:d,context:h}=OS({open:l&&!i,onOpenChange:u,placement:n,whileElementsMounted:Kp,middleware:[sl(o?12:8),eh({fallbackAxisSideDirection:"start",padding:8}),Qp({padding:8}),...o?[YE({element:f})]:[]]}),m=vS(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),w=IS(h,{enabled:a.includes("focus")}),P=PS(h,{enabled:a.includes("click")}),E=NS(h),T=MS(h,{role:"tooltip"}),{getReferenceProps:A,getFloatingProps:D}=$S([m,w,P,E,T]);return i?C.jsx(C.Fragment,{children:e}):C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:p.setReference,...A(),className:"cursor-help",children:e}),l&&C.jsx(xS,{children:C.jsxs("div",{ref:p.setFloating,...D(),style:{...d,zIndex:101},className:`
177
+ */var _3={L:jr.QrCode.Ecc.LOW,M:jr.QrCode.Ecc.MEDIUM,Q:jr.QrCode.Ecc.QUARTILE,H:jr.QrCode.Ecc.HIGH},Wh=128,Vh="L",Hh="#FFFFFF",Gh="#000000",qh=!1,Kh=1,W3=4,V3=0,H3=.1;function Zh(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 Yh(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 G3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*H3),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 q3(e,t){return t!=null?Math.max(Math.floor(t),0):e?W3:V3}function Xh({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:c}){let a=y.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,v)=>(m.push(...jr.QrSegment.makeSegments(v)),m),[]);return jr.QrCode.encodeSegments(h,_3[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:u,numCells:f,calculatedImageSettings:p}=y.useMemo(()=>{let d=a.getModules();const h=q3(r,o),m=d.length+h*2,v=G3(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 K3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Z3=y.forwardRef(function(t,n){const r=t,{value:o,size:s=Wh,level:i=Vh,bgColor:c=Hh,fgColor:a=Gh,includeMargin:l=qh,minVersion:u=Kh,boostLevel:f,marginSize:p,imageSettings:d}=r,m=xl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:v}=m,T=xl(m,["style"]),E=d==null?void 0:d.src,S=y.useRef(null),A=y.useRef(null),D=y.useCallback(M=>{S.current=M,typeof n=="function"?n(M):n&&(n.current=M)},[n]),[F,L]=y.useState(!1),{margin:b,cells:g,numCells:x,calculatedImageSettings:I}=Xh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:p,imageSettings:d,size:s});y.useEffect(()=>{if(S.current!=null){const M=S.current,w=M.getContext("2d");if(!w)return;let N=g;const $=A.current,P=I!=null&&$!==null&&$.complete&&$.naturalHeight!==0&&$.naturalWidth!==0;P&&I.excavation!=null&&(N=Yh(g,I.excavation));const B=window.devicePixelRatio||1;M.height=M.width=s*B;const j=s/x*B;w.scale(j,j),w.fillStyle=c,w.fillRect(0,0,x,x),w.fillStyle=a,K3?w.fill(new Path2D(Zh(N,b))):g.forEach(function(U,_){U.forEach(function(q,Z){q&&w.fillRect(Z+b,_+b,1,1)})}),I&&(w.globalAlpha=I.opacity),P&&w.drawImage($,I.x+b,I.y+b,I.w,I.h)}}),y.useEffect(()=>{L(!1)},[E]);const O=wl({height:s,width:s},v);let k=null;return E!=null&&(k=y.createElement("img",{src:E,key:E,style:{display:"none"},onLoad:()=>{L(!0)},ref:A,crossOrigin:I==null?void 0:I.crossOrigin})),y.createElement(y.Fragment,null,y.createElement("canvas",wl({style:O,height:s,width:s,ref:D,role:"img"},T)),k)});Z3.displayName="QRCodeCanvas";var Jh=y.forwardRef(function(t,n){const r=t,{value:o,size:s=Wh,level:i=Vh,bgColor:c=Hh,fgColor:a=Gh,includeMargin:l=qh,minVersion:u=Kh,boostLevel:f,title:p,marginSize:d,imageSettings:h}=r,m=xl(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:v,cells:T,numCells:E,calculatedImageSettings:S}=Xh({value:o,level:i,minVersion:u,boostLevel:f,includeMargin:l,marginSize:d,imageSettings:h,size:s});let A=T,D=null;h!=null&&S!=null&&(S.excavation!=null&&(A=Yh(T,S.excavation)),D=y.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 F=Zh(A,v);return y.createElement("svg",wl({height:s,width:s,viewBox:`0 0 ${E} ${E}`,ref:n,role:"img"},m),!!p&&y.createElement("title",null,p),y.createElement("path",{fill:c,d:`M0,0 h${E}v${E}H0z`,shapeRendering:"crispEdges"}),y.createElement("path",{fill:a,d:F,shapeRendering:"crispEdges"}),D)});Jh.displayName="QRCodeSVG";function Y3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function X3(){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 Qh(){return/apple/i.test(navigator.vendor)}function J3(){return Y3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Q3(){return X3().includes("jsdom/")}const em="data-floating-ui-focusable",eS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function El(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 zr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Gc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ur(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Sl(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 tS(e){return e.matches("html,body")}function Yt(e){return(e==null?void 0:e.ownerDocument)||document}function tm(e){return We(e)&&e.matches(eS)}function nS(e){if(!e||Q3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function rS(e){return e?e.hasAttribute(em)?e:e.querySelector("["+em+"]")||e:null}function xi(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,...xi(e,o.id,n)])}function oS(e){return"nativeEvent"in e}function Jo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var sS=typeof document<"u",iS=function(){},Xt=sS?y.useLayoutEffect:iS;const aS={...z};function Ei(e){const t=z.useRef(e);return Xt(()=>{t.current=e}),t}const cS=aS.useInsertionEffect||(e=>e());function Jt(e){const t=z.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return cS(()=>{t.current=e}),z.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const nm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rm(e,t){const n=Fp(e,nm()),r=n.length;if(r===0)return;const o=El(Yt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function lS(e){return rm(Yt(e).body,1)||e}function uS(e){return rm(Yt(e).body,-1)||e}function Pl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!zr(n,r)}function fS(e){Fp(e,nm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function om(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 dS="data-floating-ui-focusable",sm="active",im="selected",pS={...z};let am=!1,hS=0;const cm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+hS++;function mS(){const[e,t]=z.useState(()=>am?cm():void 0);return Xt(()=>{e==null&&t(cm())},[]),z.useEffect(()=>{am=!0},[]),e}const Tl=pS.useId||mS;let Al;process.env.NODE_ENV!=="production"&&(Al=new Set);function bS(){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=Al)!=null&&e.has(o))){var s;(s=Al)==null||s.add(o),console.error(o)}}function gS(){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 yS=z.createContext(null),vS=z.createContext(null),Nl=()=>{var e;return((e=z.useContext(yS))==null?void 0:e.id)||null},Cl=()=>z.useContext(vS);function Qo(e){return"data-floating-ui-"+e}function St(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const lm=Qo("safe-polygon");function Ol(e,t,n){if(n&&!Jo(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 Il(e){return typeof e=="function"?e():e}function wS(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=Cl(),h=Nl(),m=Ei(l),v=Ei(a),T=Ei(n),E=Ei(f),S=z.useRef(),A=z.useRef(-1),D=z.useRef(),F=z.useRef(-1),L=z.useRef(!0),b=z.useRef(!1),g=z.useRef(()=>{}),x=z.useRef(!1),I=Jt(()=>{var $;const P=($=o.current.openEvent)==null?void 0:$.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"});z.useEffect(()=>{if(!c)return;function $(P){let{open:B}=P;B||(St(A),St(F),L.current=!0,x.current=!1)}return s.on("openchange",$),()=>{s.off("openchange",$)}},[c,s]),z.useEffect(()=>{if(!c||!m.current||!n)return;function $(B){I()&&r(!1,B,"hover")}const P=Yt(i.floating).documentElement;return P.addEventListener("mouseleave",$),()=>{P.removeEventListener("mouseleave",$)}},[i.floating,n,r,c,m,I]);const O=z.useCallback(function($,P,B){P===void 0&&(P=!0),B===void 0&&(B="hover");const j=Ol(v.current,"close",S.current);j&&!D.current?(St(A),A.current=window.setTimeout(()=>r(!1,$,B),j)):P&&(St(A),r(!1,$,B))},[v,r]),k=Jt(()=>{g.current(),D.current=void 0}),M=Jt(()=>{if(b.current){const $=Yt(i.floating).body;$.style.pointerEvents="",$.removeAttribute(lm),b.current=!1}}),w=Jt(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);z.useEffect(()=>{if(!c)return;function $(_){if(St(A),L.current=!1,u&&!Jo(S.current)||Il(E.current)>0&&!Ol(v.current,"open"))return;const q=Ol(v.current,"open",S.current);q?A.current=window.setTimeout(()=>{T.current||r(!0,_,"hover")},q):n||r(!0,_,"hover")}function P(_){if(w()){M();return}g.current();const q=Yt(i.floating);if(St(F),x.current=!1,m.current&&o.current.floatingContext){n||St(A),D.current=m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){M(),k(),w()||O(_,!0,"safe-polygon")}});const H=D.current;q.addEventListener("mousemove",H),g.current=()=>{q.removeEventListener("mousemove",H)};return}(S.current==="touch"?!zr(i.floating,_.relatedTarget):!0)&&O(_)}function B(_){w()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:d,x:_.clientX,y:_.clientY,onClose(){M(),k(),w()||O(_)}})(_))}function j(){St(A)}function U(_){w()||O(_,!1)}if(ge(i.domReference)){const _=i.domReference,q=i.floating;return n&&_.addEventListener("mouseleave",B),p&&_.addEventListener("mousemove",$,{once:!0}),_.addEventListener("mouseenter",$),_.addEventListener("mouseleave",P),q&&(q.addEventListener("mouseleave",B),q.addEventListener("mouseenter",j),q.addEventListener("mouseleave",U)),()=>{n&&_.removeEventListener("mouseleave",B),p&&_.removeEventListener("mousemove",$),_.removeEventListener("mouseenter",$),_.removeEventListener("mouseleave",P),q&&(q.removeEventListener("mouseleave",B),q.removeEventListener("mouseenter",j),q.removeEventListener("mouseleave",U))}}},[i,c,e,u,p,O,k,M,r,n,T,d,v,m,o,w,E]),Xt(()=>{var $;if(c&&n&&($=m.current)!=null&&($=$.__options)!=null&&$.blockPointerEvents&&I()){b.current=!0;const B=i.floating;if(ge(i.domReference)&&B){var P;const j=Yt(i.floating).body;j.setAttribute(lm,"");const U=i.domReference,_=d==null||(P=d.nodesRef.current.find(q=>q.id===h))==null||(P=P.context)==null?void 0:P.elements.floating;return _&&(_.style.pointerEvents=""),j.style.pointerEvents="none",U.style.pointerEvents="auto",B.style.pointerEvents="auto",()=>{j.style.pointerEvents="",U.style.pointerEvents="",B.style.pointerEvents=""}}}},[c,n,h,i,d,m,I]),Xt(()=>{n||(S.current=void 0,x.current=!1,k(),M())},[n,k,M]),z.useEffect(()=>()=>{k(),St(A),St(F),M()},[c,i.domReference,k,M]);const N=z.useMemo(()=>{function $(P){S.current=P.pointerType}return{onPointerDown:$,onPointerEnter:$,onMouseMove(P){const{nativeEvent:B}=P;function j(){!L.current&&!T.current&&r(!0,B,"hover")}u&&!Jo(S.current)||n||Il(E.current)===0||x.current&&P.movementX**2+P.movementY**2<2||(St(F),S.current==="touch"?j():(x.current=!0,F.current=window.setTimeout(j,Il(E.current))))}}},[u,r,n,T,E]);return z.useMemo(()=>c?{reference:N}:{},[c,N])}const um={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},fm=z.forwardRef(function(t,n){const[r,o]=z.useState();Xt(()=>{Qh()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Qo("focus-guard")]:"",style:um};return C.jsx("span",{...t,...s})}),dm=z.createContext(null),pm=Qo("portal");function xS(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Tl(),o=SS(),[s,i]=z.useState(null),c=z.useRef(null);return Xt(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{c.current=null})},[s]),Xt(()=>{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(pm,""),a.appendChild(l),c.current=l,i(l)},[t,r]),Xt(()=>{if(n===null||!r||c.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!Hc(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(pm,""),a=l||a,a.appendChild(u),c.current=u,i(u)},[t,n,r,o]),s}function ES(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=xS({id:n,root:r}),[i,c]=z.useState(null),a=z.useRef(null),l=z.useRef(null),u=z.useRef(null),f=z.useRef(null),p=i==null?void 0:i.modal,d=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return z.useEffect(()=>{if(!s||!o||p)return;function m(v){s&&Pl(v)&&(v.type==="focusin"?om:fS)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),z.useEffect(()=>{s&&(d||om(s))},[d,s]),C.jsxs(dm.Provider,{value:z.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:c}),[o,s]),children:[h&&s&&C.jsx(fm,{"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=uS(T);E==null||E.focus()}}}),h&&s&&C.jsx("span",{"aria-owns":s.id,style:um}),s&&Vr.createPortal(t,s),h&&s&&C.jsx(fm,{"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=lS(T);E==null||E.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const SS=()=>z.useContext(dm);function hm(e){return We(e.target)&&e.target.tagName==="BUTTON"}function PS(e){return We(e.target)&&e.target.tagName==="A"}function mm(e){return tm(e)}function TS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:c="click",toggle:a=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,p=z.useRef(),d=z.useRef(!1),h=z.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const v=p.current;m.button===0&&c!=="click"&&(Jo(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}Jo(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||hm(m))&&(m.key===" "&&!mm(s)&&(m.preventDefault(),d.current=!0),!PS(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||hm(m)||mm(s)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,c,l,u,r,n,f,a]);return z.useMemo(()=>i?{reference:h}:{},[i,h])}const AS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},NS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},bm=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 CS(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=Cl(),v=Jt(typeof a=="function"?a:()=>!1),T=typeof a=="function"?v:a,E=z.useRef(!1),{escapeKey:S,outsidePress:A}=bm(d),{escapeKey:D,outsidePress:F}=bm(h),L=z.useRef(!1),b=Jt(M=>{var w;if(!n||!i||!c||M.key!=="Escape"||L.current)return;const N=(w=s.current.floatingContext)==null?void 0:w.nodeId,$=m?xi(m.nodesRef.current,N):[];if(!S&&(M.stopPropagation(),$.length>0)){let P=!0;if($.forEach(B=>{var j;if((j=B.context)!=null&&j.open&&!B.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,oS(M)?M.nativeEvent:M,"escape-key")}),g=Jt(M=>{var w;const N=()=>{var $;b(M),($=Ur(M))==null||$.removeEventListener("keydown",N)};(w=Ur(M))==null||w.addEventListener("keydown",N)}),x=Jt(M=>{var w;const N=s.current.insideReactTree;s.current.insideReactTree=!1;const $=E.current;if(E.current=!1,l==="click"&&$||N||typeof T=="function"&&!T(M))return;const P=Ur(M),B="["+Qo("inert")+"]",j=Yt(o.floating).querySelectorAll(B);let U=ge(P)?P:null;for(;U&&!bn(U);){const H=gn(U);if(bn(H)||!ge(H))break;U=H}if(j.length&&ge(P)&&!tS(P)&&!zr(P,o.floating)&&Array.from(j).every(H=>!zr(U,H)))return;if(We(P)&&k){const H=bn(P),W=xt(P),J=/auto|scroll/,K=H||J.test(W.overflowX),Q=H||J.test(W.overflowY),oe=K&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,ee=Q&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,ue=W.direction==="rtl",ce=ee&&(ue?M.offsetX<=P.offsetWidth-P.clientWidth:M.offsetX>P.clientWidth),pe=oe&&M.offsetY>P.clientHeight;if(ce||pe)return}const _=(w=s.current.floatingContext)==null?void 0:w.nodeId,q=m&&xi(m.nodesRef.current,_).some(H=>{var W;return Sl(M,(W=H.context)==null?void 0:W.elements.floating)});if(Sl(M,o.floating)||Sl(M,o.domReference)||q)return;const Z=m?xi(m.nodesRef.current,_):[];if(Z.length>0){let H=!0;if(Z.forEach(W=>{var J;if((J=W.context)!=null&&J.open&&!W.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}r(!1,M,"outside-press")}),I=Jt(M=>{var w;const N=()=>{var $;x(M),($=Ur(M))==null||$.removeEventListener(l,N)};(w=Ur(M))==null||w.addEventListener(l,N)});z.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=A;let M=-1;function w(j){r(!1,j,"ancestor-scroll")}function N(){window.clearTimeout(M),L.current=!0}function $(){M=window.setTimeout(()=>{L.current=!1},ei()?5:0)}const P=Yt(o.floating);c&&(P.addEventListener("keydown",D?g:b,D),P.addEventListener("compositionstart",N),P.addEventListener("compositionend",$)),T&&P.addEventListener(l,F?I:x,F);let B=[];return p&&(ge(o.domReference)&&(B=Bn(o.domReference)),ge(o.floating)&&(B=B.concat(Bn(o.floating))),!ge(o.reference)&&o.reference&&o.reference.contextElement&&(B=B.concat(Bn(o.reference.contextElement)))),B=B.filter(j=>{var U;return j!==((U=P.defaultView)==null?void 0:U.visualViewport)}),B.forEach(j=>{j.addEventListener("scroll",w,{passive:!0})}),()=>{c&&(P.removeEventListener("keydown",D?g:b,D),P.removeEventListener("compositionstart",N),P.removeEventListener("compositionend",$)),T&&P.removeEventListener(l,F?I:x,F),B.forEach(j=>{j.removeEventListener("scroll",w)}),window.clearTimeout(M)}},[s,o,c,T,l,n,r,p,i,S,A,b,D,g,x,F,I]),z.useEffect(()=>{s.current.insideReactTree=!1},[s,T,l]);const O=z.useMemo(()=>({onKeyDown:b,...u&&{[AS[f]]:M=>{r(!1,M.nativeEvent,"reference-press")},...f!=="click"&&{onClick(M){r(!1,M.nativeEvent,"reference-press")}}}}),[b,r,u,f]),k=z.useMemo(()=>({onKeyDown:b,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[NS[l]]:()=>{s.current.insideReactTree=!0}}),[b,l,s]);return z.useMemo(()=>i?{reference:O,floating:k}:{},[i,O,k])}function OS(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Tl(),s=z.useRef({}),[i]=z.useState(()=>gS()),c=Nl()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!ge(d)&&bS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,l]=z.useState(r.reference),u=Jt((d,h,m)=>{s.current.openEvent=d?h:void 0,i.emit("openchange",{open:d,event:h,reason:m,nested:c}),n==null||n(d,h,m)}),f=z.useMemo(()=>({setPositionReference:l}),[]),p=z.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return z.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:f}),[t,u,p,i,o,f])}function IS(e){e===void 0&&(e={});const{nodeId:t}=e,n=OS({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=z.useState(null),[c,a]=z.useState(null),u=(o==null?void 0:o.domReference)||s,f=z.useRef(null),p=Cl();Xt(()=>{u&&(f.current=u)},[u]);const d=Jp({...e,elements:{...o,...c&&{reference:c}}}),h=z.useCallback(S=>{const A=ge(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(A),d.refs.setReference(A)},[d.refs]),m=z.useCallback(S=>{(ge(S)||S===null)&&(f.current=S,i(S)),(ge(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!ge(S))&&d.refs.setReference(S)},[d.refs]),v=z.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),T=z.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),E=z.useMemo(()=>({...d,...r,refs:v,elements:T,nodeId:t}),[d,v,T,t,r]);return Xt(()=>{r.dataRef.current.floatingContext=E;const S=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);S&&(S.context=E)}),z.useMemo(()=>({...d,context:E,refs:v,elements:T}),[d,v,T,E])}function kl(){return J3()&&Qh()}function kS(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:c=!0,visibleOnly:a=!0}=t,l=z.useRef(!1),u=z.useRef(-1),f=z.useRef(!0);z.useEffect(()=>{if(!c)return;const d=et(i.domReference);function h(){!n&&We(i.domReference)&&i.domReference===El(Yt(i.domReference))&&(l.current=!0)}function m(){f.current=!0}function v(){f.current=!1}return d.addEventListener("blur",h),kl()&&(d.addEventListener("keydown",m,!0),d.addEventListener("pointerdown",v,!0)),()=>{d.removeEventListener("blur",h),kl()&&(d.removeEventListener("keydown",m,!0),d.removeEventListener("pointerdown",v,!0))}},[i.domReference,n,c]),z.useEffect(()=>{if(!c)return;function d(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(l.current=!0)}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,c]),z.useEffect(()=>()=>{St(u)},[]);const p=z.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(d){if(l.current)return;const h=Ur(d.nativeEvent);if(a&&ge(h)){if(kl()&&!d.relatedTarget){if(!f.current&&!tm(h))return}else if(!nS(h))return}r(!0,d.nativeEvent,"focus")},onBlur(d){l.current=!1;const h=d.relatedTarget,m=d.nativeEvent,v=ge(h)&&h.hasAttribute(Qo("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var T;const E=El(i.domReference?i.domReference.ownerDocument:document);!h&&E===i.domReference||zr((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,E)||zr(i.domReference,E)||v||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return z.useMemo(()=>c?{reference:p}:{},[c,p])}function $l(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[sm]:i,[im]:c,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[dS]:""},...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&&[sm,im].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 $S(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=z.useCallback(c=>$l(c,e,"reference"),t),s=z.useCallback(c=>$l(c,e,"floating"),n),i=z.useCallback(c=>$l(c,e,"item"),r);return z.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const MS=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function DS(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=Tl(),u=((n=s.domReference)==null?void 0:n.id)||l,f=z.useMemo(()=>{var E;return((E=rS(s.floating))==null?void 0:E.id)||i},[s.floating,i]),p=(r=MS.get(a))!=null?r:a,h=Nl()!=null,m=z.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?f:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,f,h,o,u,a]),v=z.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||a==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,a]),T=z.useCallback(E=>{let{active:S,selected:A}=E;const D={role:"option",...S&&{id:f+"-fui-option"}};switch(a){case"select":case"combobox":return{...D,"aria-selected":A}}return{}},[f,a]);return z.useMemo(()=>c?{reference:m,floating:v,item:T}:{},[c,m,v,T])}const gm=y.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 C.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});gm.displayName="TooltipArrow";const ar=({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]=y.useState(!1),f=y.useRef(null),{refs:p,floatingStyles:d,context:h}=IS({open:l&&!i,onOpenChange:u,placement:n,whileElementsMounted:Kp,middleware:[sl(o?12:8),eh({fallbackAxisSideDirection:"start",padding:8}),Qp({padding:8}),...o?[XE({element:f})]:[]]}),m=wS(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),v=kS(h,{enabled:a.includes("focus")}),T=TS(h,{enabled:a.includes("click")}),E=CS(h),S=DS(h,{role:"tooltip"}),{getReferenceProps:A,getFloatingProps:D}=$S([m,v,T,E,S]);return i?C.jsx(C.Fragment,{children:e}):C.jsxs(C.Fragment,{children:[C.jsx("div",{ref:p.setReference,...A(),className:"cursor-help",children:e}),l&&C.jsx(ES,{children:C.jsxs("div",{ref:p.setFloating,...D(),style:{...d,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 @@ ${Tg(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
182
182
  relative
183
183
  ${c}
184
184
  ${s}
185
- `,children:[t,o&&C.jsx(gm,{ref:f,placement:h.placement||n})]})})]})},es="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,accountId:o,accountKey:s,onDeposit:i,onCopy:c,onClose:a})=>{const{t:l}=Nt(),u=r===A5,f=!u,p=y.useMemo(()=>{if(!e)return!1;const P=Number(e.chainId);return!Number.isNaN(P)&&(P===42161||P===421614)},[e]),d=u,h=y.useMemo(()=>{var P;return(P=e==null?void 0:e.tokenList)==null?void 0:P.find(E=>E.token===t||E.symbol===t)},[e,t]),m=y.useMemo(()=>{const P=(t||"").toUpperCase();if(!d&&P==="USDC")return l("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const A=l(d?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return d&&(!p||P==="USDC")?String(A).split(`
186
- `)[0]:A},[l,t,e==null?void 0:e.chain,d,p]),w=(h==null?void 0:h.minDepositSize)||"10";return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(Jh,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&C.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[C.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),C.jsx(j3,{onCopy:()=>{c&&c(n)},text:n,children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[C.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),C.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")]}),C.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[C.jsxs("div",{className:"flex items-start",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:m})})]}),f&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:l("deposit.addressUpdatedNotice")})]})]}),C.jsxs("div",{className:"text-sm",children:[(u||t.toUpperCase()!=="USDC")&&C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[C.jsx("span",{className:"text-text-tertiary",children:l("deposit.arrivalTime")}),C.jsx(ar,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:l("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),C.jsx("p",{children:l("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:l("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),C.jsxs("div",{className:`flex justify-between items-center h-[18px] ${u||t.toUpperCase()!=="USDC"?"mt-1":"mt-4"}`,children:[C.jsx("span",{className:"text-text-tertiary",children:l("deposit.minDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:[w," ",t]})]}),f&&t.toUpperCase()!=="USDC"&&C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[C.jsx("span",{className:"text-text-tertiary",children:l("deposit.maxDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),C.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:()=>{i&&i({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t,accountType:r,accountId:o,key:s}),a()},children:l("deposit.title")})]})},ts=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return C.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},BS=(e,t)=>Number(e)>Number(t),jt=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"},Si=(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 Si(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:jt(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=jt(Math.max(0,s).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[jt(e),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${jt(e)} ${n}`},FS=(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)},RS=(e,t,n)=>{if(!$h(e,n))return!1;try{const r=new Le(t||"0"),o=new Le("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},jS=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&$h(e,n))try{const i=new Le(o),c=new Le("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new Le(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,Le.ROUND_DOWN).toString()}catch{return o}},ym={accountChains:[],defaultChainId:1,defaultAccountType:"",balances:{}};let tt=null;const vm=y.forwardRef((e,t)=>{const[n,r]=y.useState(!1),[o,s]=y.useState(!1),[i,c]=y.useState(ym),a=y.useCallback(h=>{c(h),r(!0)},[]),l=y.useCallback(h=>{c(m=>({...m,...h}))},[]),u=y.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=y.useCallback(h=>{s(h)},[]),p=y.useCallback(()=>n,[n]),d=y.useCallback(()=>o,[o]);return y.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),y.useEffect(()=>(tt={openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d},()=>{tt=null}),[a,u,l,f,p,d]),n?C.jsx(Nm,{isOpen:n,isLoading:o,onClose:u,accountChains:i.accountChains,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});vm.displayName="DepositManager";const wm=e=>{if(!tt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}tt.openDeposit(e||ym)},xm=()=>{if(!tt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}tt.closeDeposit()},Em=e=>{tt&&tt.updateDepositOptions(e)},Pi=e=>{if(!tt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}tt.setDepositLoading(e)},zS=()=>tt?tt.isOpen():!1,Sm=()=>tt?tt.isLoading():!1,US=()=>({openDeposit:wm,closeDeposit:xm,updateDepositOptions:Em,setDepositLoading:Pi,isOpen:zS,isLoading:Sm}),_S=e=>{const{t}=Nt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return y.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const l=parseFloat(r||"0"),u=a,f=FS(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 WS(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(),w=a(),P=i({address:u,abi:Cr,functionName:"allowance",args:[Tn(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&u&&p)}}),E=P!=null&&P.isSuccess?P.data:void 0,T=y.useMemo(()=>{if(d)return!0;if(!P.isSuccess||E===void 0||E===0n)return!1;try{const D=D6(String(Number(s||"0")||0),Number(f));return E>=D}catch{return!1}},[d,P.isSuccess,E,s,f]),A=y.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!w||!u||!p)return;const F=Tn(u),L=Tn(p);if((E||0n)>0n){const x=await m({abi:Cr,address:F,functionName:"approve",args:[L,0n]});await w.waitForTransactionReceipt({hash:x})}const g=await m({abi:Cr,address:F,functionName:"approve",args:[L,df]});await w.waitForTransactionReceipt({hash:g}),P!=null&&P.refetch&&await P.refetch()}catch(D){console.error("[useApprove] onApprove failed:",D)}},[r,n,u,p,E,P,m,w,h]);return{approve:T,onApprove:A}}const VS=({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 y.useEffect(()=>{o(Tn(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},HS=({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=y.useMemo(()=>{const T="0x0000000000000000000000000000000000000000",A="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(D=>{const F=D.tokenAddress;if(!F)return!1;const L=F.toLowerCase();return!(F===T||L===A)})},[r]),[c,a]=y.useState({}),l=y.useCallback((T,A)=>{a(D=>({...D,[T]:A}))},[]),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]=y.useState(0),d=y.useMemo(()=>i.map(T=>y.createElement(VS,{key:`${T.tokenAddress}-${f}`,token:T,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:l})),[i,e,s,n,o,l,f]),h=y.useMemo(()=>{const T=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(F=>{const L=c[Tn(F.tokenAddress)],b=L==null?void 0:L.balance,g=b==null?void 0:b.data;return{address:Tn(F.tokenAddress),value:(g==null?void 0:g.value)||BigInt(0),formatted:(g==null?void 0:g.formatted)||"0",decimals:(g==null?void 0:g.decimals)||F.decimals}}).filter(F=>F.address),D=A.reduce((F,L)=>({...F,[L.address]:{balance:L}}),{});return{balanceList:A,baseTokenBalance:T,combinedData:D}},[u,c,i]),m=y.useCallback(async()=>h,[h]),w=y.useMemo(()=>{const T=(u==null?void 0:u.isLoading)||!1,A=Object.values(c).some(D=>{var F;return(F=D.balance)==null?void 0:F.isLoading});return T||A},[u==null?void 0:u.isLoading,c]),P=y.useCallback(()=>p(T=>T+1),[]);return{multicallRun:m,multicallRefresh:P,multicallResult:h,validErcTokens:i,isLoading:w,queryComponents:d}},GS=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,accountId:o,accountKey:s,platformBalance:i,isLoading:c,wagmiHooks:a,onChainChange:l,onDeposit:u})=>{const{t:f}=Nt(),p=a.useAccount(),d=t.tokenList.find(Z=>Z.token===n||Z.symbol===n),h=t.chainId,[m,w]=y.useState("");y.useEffect(()=>{w("")},[n,t.chainId]);const{multicallResult:P,queryComponents:E}=HS({account:e,chainId:t.chainId,contractAddress:(d==null?void 0:d.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:a}),T=y.useMemo(()=>{var H;if(!d)return"0";if(!d.tokenAddress||d.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return P.baseTokenBalance.formatted;const Z=P.combinedData[d.tokenAddress];return((H=Z==null?void 0:Z.balance)==null?void 0:H.formatted)||"0"},[d,P]),A="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",D="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",F=y.useMemo(()=>{var Z,H;return y5({chain:E5,transport:x5(t.rpcUrl||((Z=window==null?void 0:window.ENV)==null?void 0:Z.CHAIN_RPC_URL_42161)||((H=window==null?void 0:window.ENV)==null?void 0:H.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),L="1000000000000",{formatted:b}=S5({client:F,tokenAddress:A,holder:D,decimals:6,fallbackFormatted:L,pollingInterval:12e3}),[g,x]=y.useState(!1),{approve:I,onApprove:O}=WS({account:e,accountChainId:p.chainId,targetChainId:+t.chainId,tokenInfo:d,amount:m,wagmiHooks:a}),$=y.useCallback(async()=>{if(!g)try{x(!0),await O()}catch(Z){console.error("Approve failed:",Z)}finally{x(!1)}},[g,O]),M=y.useMemo(()=>+p.chainId!=+t.chainId,[p.chainId,t.chainId]),v=y.useCallback(async()=>{l&&l(h)},[l,h]);y.useEffect(()=>{M&&v()},[M,v]);const{showLayerZeroTip:N,layerZeroTipKey:k}=y.useMemo(()=>{const Z=+t.chainId==42161||+t.chainId==421614,H=(n==null?void 0:n.toUpperCase())==="USDT",W=new Le(m||"0"),J=new Le("200000");let K=!1,Q;if(Z&&H&&m)if(W.gte(J))K=!0,Q="deposit.layerZeroDepositTipGte200k";else{const oe=b;if(typeof oe=="string"&&oe.length>0){const ue=new Le(oe);!ue.isNaN()&&W.gte(ue)&&(K=!0,Q="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:K,layerZeroTipKey:Q}},[t.chainId,n,m,b]),S=y.useCallback(()=>jS(+t.chainId,T||"0",n,r),[T,t==null?void 0:t.chainId,n,r]),B=y.useMemo(()=>r!=="spot"&&RS(+t.chainId,m,n),[r,t==null?void 0:t.chainId,m,n]),j=y.useMemo(()=>"deposit.maxDepositSplitTip",[]),U=_S({isNetworkMismatch:M,depositAmount:m,approved:I,currentTokenBalance:T,selectedToken:n,showLayerZeroTip:N,minDeposit:d!=null&&d.minDepositSize?parseFloat(d.minDepositSize):10}),_=Z=>{const H=Z.target.value,W=S(),J=Si(H,W);if(J.isValid)w(J.formattedValue),J.errorType;else return J.errorType==="exceed_balance",void 0},q=y.useCallback(async()=>{Pi(!0);try{u&&u({amount:m,chainId:h,tokenAddress:(d==null?void 0:d.tokenAddress)||"",tokenSymbol:n,accountType:r,accountId:o,key:s})}catch(Z){console.error("Deposit error:",Z),Pi(!1)}},[u,m,h,d==null?void 0:d.tokenAddress,r,n]);return C.jsxs(C.Fragment,{children:[E,C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:f("deposit.amount"),value:m,onChange:_,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"}),C.jsx("button",{onClick:()=>{const Z=S();w(Z)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:f("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(ar,{content:f("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:f("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:LS(T||"0",m,n)})]})]}),!I&&BS(m||"0",0)&&C.jsxs("div",{className:"flex justify-center flex-col items-center",children:[C.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:f("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),C.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:f("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),C.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:g,children:g?C.jsx(ts,{size:"xs",inline:!0}):f("deposit.enableWithToken",{token:n})})]}),N&&C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:f(k||"deposit.layerZeroDepositTip")})]}),C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),B&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:f(j)})]}),B&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!(B||N)&&C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:f("deposit.noPrivateKeyWalletWarning")})]}),C.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[C.jsx("span",{className:"text-sm text-text-tertiary",children:f("deposit.arrivalTime")}),C.jsx(ar,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:f("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),C.jsx("p",{children:f("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:f("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[C.jsx("span",{className:"text-sm text-text-tertiary",children:f("deposit.equity")}),C.jsx("span",{className:"text-sm text-text-primary font-medium",children:m?C.jsxs("span",{className:"flex items-center gap-1",children:[jt(i),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),jt((parseFloat(i)+parseFloat(m)).toString())," ",n]}):`${jt(i)} ${n}`})]})]}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${U.disabled||c?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:q,disabled:U.disabled||c,children:[(c||M)&&C.jsx(ts,{size:"xs"}),U.text]})]})},Pm=e=>e.toLocaleUpperCase()===pn?pn:zs,ns=e=>Pm(e.wallet)===pn,Ml=e=>Pm(e.wallet)===zs,Ti=e=>e?e==="perp"?_e.PERPETUAL:e==="perp-v2"||e==="perp_v2"?_e.PERPETUALV2:e:"",Tm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABBMSURBVHgBvVt7kBTHef/17N77fRwSiNeBBAGBpVNJERKyoqOSuByiVLAScOKqJKAYJU4F8XCVY8d/cLiSkKSS4pDtKJKRdFhxYoNskTKS4jixFguEICAdiDtAvJb3cRzcg7u9vX1M5/t6puexO7u3Byd+VDOzPT3dPd/39ffqPoFbhJSymS5NVJ6yr7V2YfRRidrlMJWIECKC28Bnv5dslqZskjCeEhA0nvSPJ0SU5hQ1IA/DQGTPqqIIbgMLvjzcbAjxoBRoFlLSeKJWqjEFDY0++p6oCRmFFO2Aufvo1rIIbgFiLI3pA/mD11BZC/fjC0WUSoTKRp58IS80vyZrEylzjTDlLYxHYwgZKUqHNka+Uth4TWtlbWowvkZArjWlqBEikz4SNsmkdZXqB7WDaVrfV1SEje3/WhZFgSiIATbhN8Ai/HigDXkYwYRPJkwaT47PeAJt+RjBhE8PDm+QEGvpW/VLkglMUFeuFja13HvBtHHu1SOp3nktHMa3CmHEqAygDlniWzB2iR8NUVhMaPNWPv5yeo0hZcv4j0cqSsiN7z8XbvPWLlgVXwMz3UJk9I4nLekWmqD6t9WTUEzw1vme8zNqc84wzI0ff6+yLe+s8j2kwTdj/KQ+F1rpA9fxzRMvpTePm9TnhGjd+2chNd78Z2ObiVZrbYJaT4Ur4TYhhbMoPM8z7h3dZD+RVhU1MURrx9bydTlnE1Rpq5w3qTTjDqB/BO2//f10H825GXcAMiXb+z8c6SPiNXuIK7XOt+oE/WbVI2wmKBpLr9632nrbeVWVh7RSthfL5OL2trq+zLmEc8zxXSpN8cEBlFZW49OEGR/A2rcqmiBxxzDQmWgiowlbcO2RpUfStd6XnnpNfOsdVk26NfVFxDcVE/z92CsIsimOMAv04sy5hDIrbLWzlO9f+OJnkDwVwcRygVD9NIhwCcYDTPTBfa/jo3//W/z1OzGcLnsYdwqxaBLJ3rS6l9Z/mpD21ZJk3d4yspZIewjrFW/nfVtdaXXkukxWXePEpm/W9rT/3c+88/GpIBpsBV1e4/uO997B97+5QtUvnGpg4bQQyh9ejvJHlqFk1uO4FcTP7MPQwR2Id/wXdh/vxc/Ll+Hk45txpzByLYXBUwm49HFhMUPYasiRcjw6NyTmTQ9hLpUpDRa5bsYkjp03ceB4Cv93Ig29iiz1IzNtgcMEezWsO9FW0+q0cCYgZSMs1cNXbN/0PA698yOnq+oSgWfmh+lKy6ZuGioeXoayR5YjXDcV+cDSfvO9rRjcs9W6HwHeoolfMqbi6G+8gXjlNNwJmCMS/R1xpONewrvCyuLrld4vfLZI/OXSYiK6kbffSz0mvrMzgTf3JLXb6qwatz/nN3fdNyLMmVHbHngZwJK/Qv/esGQ22AZ4wUxYOM3AvInupKrvmYaiHJYkkSIDe/mC8/tYt4k950yMpCROLmpF96zluBVMrhK4bwJQWWz9HiSh7hoETvbkNiQ3T41gpDul7r06Ah5isYROmWBg06oylnyMBcyIP/77GC5eM7M8J3jcVNt4t57YVqM8Ix09NNLlrG49PNiPliVzcg7WNNnArzVaE2TiV1UEtxuIEROStPTpuw9cTOPwFWX5MEJSf3DpfowFVcUCyz4DLF9goDKHKeq6CXx4ReK1gxJXBl0KsPT3HBzSXjy0+pH2b9t7B6ua764pH1Xqc4GZ8BdbhnD8vDLejoekepd+25IwZB2vAj3SBm9HZZU1qJuUWzW0EyHbPkxhgNRJMuX6xV6kTYv4rHLe7Eg5xGecf+CrGAuWLxDY8YcGnn04N/EZk6qAJXOo7Ze4rauKh84n7ElK+5+tr/mhJBeGChP9dojP4Hf/ZU0FpkxwAzW+Sm1grHtlW8IpgwNc6NGaMzub9dCivIMNkFT9x5Ekjl0jlZLMfp5KWSrnh0dS6In5OTRwV2FGnKX+208beH5RfsIHgZm16XOGUlMjfZbqMSU0BRQbTJc6eP0bFbdFfA3uY9Oqcrtf6bsSo4XFCF4Npgo4Q3ZWMyv67O26gE8OvJt3MJbyMzekYsCcu/yT/8UnJn55Nq3aeDFw9yJcnrcKheDlpSHMv9sfKw7Sitp5XOLf2iVeOiDxzicS/3tGKjswoUz4GDWjVmCyMPHT90YCl6ntXuKZJ0uoFGO8MJVsJHlKov2UYryt87zRmVJFpfUPfH03m89m3AbYMM8OkJxG+viPuwSpIP+H999dmPSz5FZm0OTVQxI7jppKrWXio8sSL7xvSb5X/XScTtr6QCpt73go/M+0wtbnnynFeGPF50vQ9rO4urd4bzqT0oyn/x9kBjwY1EEhEbDlmobUNRMNFLz9Hj37cUfax4Sh+vkoBCzRq3elSQWFFCO+8XNTEXk0vHqI2l0R2PSbhvKMfvBBUqkaSwyl4/loLJwbyqt6/uqlIew/lrTesvjlfOzC+8P4h+cqA9/jPtmT2n+MV4H2sixPSKtB+rGYGdAY1AEb4nyYUmPg6TkGSsJOBtCXrmUwY5gJuyhY6RmyKuMVuY0763wmtvZgrty0mMB1J6+P3l6DGbXyJ2nFxP4B046CYPufAto956pH54aRDx8cS7BrCX/+3yZiZ36BWDi3CB90JlVbw9BRsnQibrp7ICcD7pm9QK0CbyxQWiQw9y6Be8lXnlLhl/ogBjCYCV+iYS4RA05fN7E/BwOUwf0dQ3kyq39qEsFdJgRhcqXVnsHtM5mg30vF0q7Ho77fjbbI/8H9M/IzwJFWx4UUlPuR0h/xBmPKRJ2qtvJFbqCm7rnzOv6CwLw7u6GfW/k1NNYbaL4vhBWPhvH1Xw/jdxeEMK0q/9hmgGDwO/xuqjhYtTExdXDF97Mn5B5DE5+ZxYXvuS4I6ZQJ1wtxvFHnd1XFaHR00wzS9SOd3/kwpSEEK2nnJPWk9Y7lDdFNTV6/6/EnFxHhQ8QAgxhhTXSQXErTDPhQT13QvPidwVjwhDMNbj4meImvMRoT7FnZc/O4h1JitCysJqAmupVW0JnS0WEzzJNZdQRBZVSZAX25XjbP78uqS5E9unot6ZSe6ylVEil3Qqm0dOq9bUdIJ1eaA1l9aoPb5VE3QUwIIr5GEBNmk9BUl7HKMLUfDouY0OaY9Hsa+cDvmaZmmss33U8+DMTs5eYpWgB4FdBtX14GpI7syKqrrRGorXLF9XSsjKRfIiTcxSQovuO6IzddD6Ga3qmnBVeB/sCxtMHNxYQg4nNbb3svE5j4fF9V7joJbnGlufNcEgVAuhJsFqyCOqNJn+qzm0tbHkAki7IFakeAIZZ9FyG7O7I6ZUPLTAiFi/DPp6bg7ct1+Js5ZzBLxOFkV6jN8eFqbDxzL5bc04uv3ncJFWUGeQJp3JfsxNWSYEOsmcCupya0ZgIHYJnE57YMb3vNBKXWKChjI3uBknBCZCbhLFvVGU0hHxbOK4Klsz3a2u5o4bxRPKjOhMNoT2paOHvKJqKskzgKzkrKp49sR2LX+sCOudNYnKS5jIKiZAjRvmLMqRlBSbGdbEsIXIoVYWJFGlVFaQzFQigrNYkBEj8pfRYvVm5APkyu8hM1E5r42tPJ1/6Vt2P41rabTiDmfIN95Zq9327A1LvGlv0cDRe703hi9TXAE/x5DY7tNW5ktrYHdRCkfjS4r9ISi9hM4AUNw1ltZtUm1DNGcbFFfMa96U6MhiB1pJFJ/NHaT58cdlSFzgFJjzvE95vfGMR4o5X6tG2v7UVJrxOlYJiIGPaJtSw7cHMIuNHvLxevmjh1LqVKF3E4aa9eZogmMCPkESZuc7k75bzXcHEvKgIMcSaCiBpE/NHav3w8RFupwklHuEbQTkXQdXskhn0dCYwXLtL3/uhdysUr1WVaW2vuzpieQzT6xuSIVmxbMjspvjc7Z1NeaqgOkrT5k0pbTBq28zJFYQ8D7F75GbfhZcjvsCtaVhrCb/W9gkLgJWo+4o/Wvmp6GVy6+11KvRrWf7dXqY3bBfexvOWGuueATRtvNZrUDFGRSITr9IYMB2O93o5GaP+256VlWQOkyN283ptCVSXtEZdZlB6umoqNb0fV/oDGPy2difJBazcsNky2YjCNhvowrQ6BIaMaz878GIWCdTy7qkFJuELamzTn87+46iRytAoQvpMjQs5vDIlXvlZP9iCMWwEb+y//Y6/siCZFwLkiexVYgV26yJjV9cPJUcOaiGAV5FsFvPEuSrOj1jAt54qKEEm5QLp+DmKPrcfBCcvw36clPrjolhMz/kg94zY8m4oKQxGfwSpoSX9hq4DBUlwo8YPaGzTn6hkV/kgW7j37+VKmBREOv7+hR6mQseL9oyNYRu92RBPK39KpB+m4Qa4Kov+3MfH5zrsnzKvgLDypid7t6xE7tN03EDOFmTMw6QkMl04EGRHsOfARtrz6A1+7P/2DZ/D55kUqE1k6fBU1V/epVSXjlv7nVbB6xl51vRPgVXDhl90wkzpkzzg5Iv0nGr64uALrlldh2iirgaV+665BbH2LDbl7CiIYSvrPmcWhxVkMsGfhc0ljB7ejd8d6RXC2CXz1Hkm5cOIIus8ew9Bw3I4yXVRVVqqIo+6eWZj1wK869cyEkdP7kKDrmzfmYduE/C7peKL/3BBuHB9w4gAb3vBApxOdnP1j95fIRQtKxPyZxaguh2rC0TMT/v2jcTLeI94TENAqx3vEUfWo9ZBhrOj68dRtevAsblFDPrOi9ivN4QHVwijNLaV917pw4tB7iMf8rlxpeSV+5ZEnUdswKee7fEzlOx9VYvvHo8T044jrx/vRFx2y9qjc7K0vV09fLC0CSmQfUXfgDYQ9u15SCH+44R5XlGi9snO675yoyNHzuxjDThkTP5MBlTX1CBcVts23eldhmy3jhcv7exDvtdxOLbkW9AlnJ0wLUCnek9LSlnT3eGOOtvSfPHxl54yHMqaS93AuM6EJdwB9cUSeft2shfpLlE8fZsKMnP6fy7RpKvRuoC267uFcr+rQGzBe2GLuBLlutKvfsy5WUxEpRfoL0Z0zs+KtwHQ0e0VUmFtb8OljS12ZWLz3udBDtFY/9fF4jH2rixd3/2fjQxDmC4A3X595isHNnsE5xKv1u5S+WELdet+z+jSEuaVr5/TFQcRn5N0PICawUV4J648pxhs8oXX2GAp7/rxoLdnylfzHFBh/0HjmOh5DV1zdOXMt6X7r+7wuqvSnj634zQngpOW2qsyozu/LrHaUziQXcN0VGiPfpAQKgH1yroXKn2B8wJLeYscfWXjsRdkYMpItJB/jMh5Lfbgk3BJZGTzepKVnG4mmGyg1sUK19xxVtKNW4VcvfrWUqaIMIbeUGUZLLqn3zQ1jgIcRTyHHXnIe6GCvNRfhM+EyIkTjqbHHNJ4wifCl4dZchM8EMyKdxgZaFc1Ez0b4AgVtI6zUjtc7Us8M9BMbtpQbRmshhNcYEwO8sA90cWFD1mgX75+pcuFM626+3vafqb6YbCaF2Qw2nEI02sLgGY/sFmQ7xaC7hSna93zl9v5MteHpk80U9z9FdqKJyNtIdG8kdtRa+wqil3R3vwlB34WINFOHe3bNjuAW8P/4M203oLS1YgAAAABJRU5ErkJggg==",Am="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0WSURBVHgB1ZsNcFTVFYDPe7thd7NZsonIT6CwQWvAnwTaRNuxQoJ2SqpViW3RiiMgVq2dgcy0dnRqkwz9Ga0dNjOt2BYVi2hpVaSFBmyRRWBajUoIWIlYWERAhWE3xoT87O7rOfftDW/fu+9vEzrTb+bN7rvvvnd2z7n3nHN/ngR5kvh7US2AMkvKKHMBpFkgQRgUPAgJkvg9jtfjkj+yTy6cGgvVbI3BCFAUpRY/ZuExN/sZzh5EEo949tiHR0ySpBiMhG+ivAzQ/5qL/8UoT8rKU1CeDDF4IT95kpvKiY3hsFw0uFxRpBXDynZO3Ddlaaz/g3UtJfXJuJMbUOkkYzkeKwDcy8MjhkcLGiPu6I6bUZ48AnkSyiuAFvijQ3ng0ABM8YVDTYr6w0aEHJgG8piStcGrdpsqJqv4JhgFeVnWgpUhVMWPnjwJ5Tk0hK0Bul8JLFdAbs6jxdsR945vaCmavW6tthCVTy2wGWD05YFqhLU5pbegPOX8yYOXdPJ0WBqge1twlTJ6rVCIJ1AWDc051EjfUfmrwIG8gVQG9hw6DfHTvew8Mi4INeWlEPJ7wQFRNAKTBw3O5I2QKBqh0eyi0ADkcqTg0EZsGbXwP8AfaezwXbKSAmmtVT1SfOexbtj/YZJ910LKr5g4Fg1RAnac+RQ6LljKEoVaq3qzIviDLgeoiqjfw0G1PH4KozDafuc7GGQOAHTEwRoJOiANdfCylDReEpDcFtwLaqbhCsmLiVAq6fY2KPryP8ETusKyTtfJHmiPJ6Cnf4idH/l3J+zZvJF9r7luPlR84Sr2nQxRHSmFGZNCps+a/QNU2hFzWYvrAO7Eo/YycET8E/Q1f8JAs8OiEgXoF6U6Y7GOfN2O7J8GwZo2SJ15Dc6+c6/j+/wVj4Bv2v2m108kz0L7kQT7ZOeHD0H79q34+X5OvXGTJsP8O5ZBqKSUnZMhbpo92eCWGp9Cn7BFLIsUvmoJtrxyyAsyxJJfY694x7SKwR3lGCDxSnCxpMDT4BKufDkwlZ0PHn/WkRHGlC2CwOVPCK/19KdQ8Weg66Me9TxxBt7c3gYH33rD8pkVX7wSaq6tHzZExcTQcHygFkoKErH8BtTOEhgVmrE3tGwwvdyIRojyk2EDJNr8EUn2UCeKgAv0yufYGcHsPr2fH+g/C517YrB/90723SnV6JYqr64Fnz/AzicXj4Plvy9mrVRP07dRaQthVLEwQhIHeOU8Hnh46UN3+igjqAUXmCmRPXhsJV6fCqlTm4X3+mc8At7Sa3LKyM9v6TwJx870QTqjQNdbr8OWp5+AY+8dhHQqBW4gF/V+59vgCwTQPU2Bx/9WBAeO+gz1zofyCRY/JDVQ6/BjuR/ebdkGkO0B2dZ/BFxgpXwtop5A94bm5P6yTXtP2Pr5fPGPmwntvl8ayiPjMZivhvNK3U9MYkIGSqgXsAglezxNigKOMVO+kurGTKg4p2zM5EXsU2sE38UP5tShlk/KZ35+28twcN8+GE3eT39NWL6jBRxBKSdlTZR+EpEL1UDN01Irnv6+mnUle3UXZJboNDMDKC7yfTPlZ85+AL1v1oO35BpDYNUbwVsyJ+f6p9nUsuvt102VPzYUhBu/fh1UXFIOkydNgOMnP4aHV0Zh0cKbWJmW9Rv+AgffOzx83uurNDyPUk3qAVaQ0lo3q1mTQYHZZ5ALs3oOXVuBAb7ZGA/YiN+baGOzmhFwgJ3yM2ePwiAehJkRBk+ut3VbemZ8fjo8+fgvIBQ61+Ta1+xnhrhv2Xdyyjdt+YeqfB+WDfSi8q+AQY9RQ6Q4KyhY1zWBMGhzKKsi90I9ycoIy68XGiBMM64ydoVacEim/yikMc/PKdMonzN4Av3+AWMGlE7sZj3ELdFHf5yj5BMnP4HVa56De5fdllNOrF7zPGQq5kC6uoGdkwH0kPuwUhi1djvlc7ihkn3mdchVCQd1ON0tYxSuAhf0oRsZwsDK7hcon6M3An2nMk+oEtxALbxsUq62Hl65Cm66/jp2aCGjnPgsA5maBshUzgelbCacLZhueKbdCJfSRyfK51Dd1r9a16EpDQPo+mXMgyJWNzK3U93GPjlkhP7//NygfHI7voseGj7nRuDKV5/n3P1wF6OFXEzXocOGct4r0qh8JXQhK0vPuwcGC43D2rk2BlgbA9ewOGHRC2guyYAEVV4r/6/1+fTZ217P3BAxgAbQQsqnkS2HX+eKH35m4TRwCvl9LaqSn4fbMfDqe8Wj0d+h3y9k7odDhhj0jKWunkO40Fwm+XRRwLWD7nnmVXXiTkRC/Myw12yeXx9wRUbg6JXvz/YCvZEKsI4+TTVD5HpWr1nPBi6iXvHqzn+pv/PEu5BB18PJDBnnG638vxvXo2eF60kcCMumlyTn5QrGAidlTtc/zVzPpi3bDb2ip6dXDbzl1TgDdyHIu9fB/xPe7AK6oReQbycfz/w/tn6rgNufbenc/2t9vhYqoykIu15gpmQKuvpe8eyGTWrgvXYRZHpOg3fTT8Hz5ouYBd3CrssFiqEXWLkYu7GBFU0LzQM8nynVkSQXRJNCQjfEjRC47Ak2iNIqnxQ5GH982B1xI5ChtMovyLqmoWyZMpS0NIDY9TwndD3DgReDLQu8eKQr68HTuZXFAirzCAywL24+5cwXXvKJAzTgMosvMVGhBHF0QVIHWMCNYMh2pt6vxghNdkRG0Cu/EOvSwQ2R7tlvKqts4gShkqmVU84vDLyoZG3gzVD+PyYInld/y879xWmDHKsVLFI+KdItNCq2Cu47DwgKM3BUxnXYneACbcDlgVlrBA5XPocbIXVml+mzH1i2wFC29HsPwry5XzLk/Dzwput1y62YCaWwR0gYjIsP74LABcZZVIsFEwaNXN24IqprN7IWysSlShkU6x6QUx9dh34eR2QEvfKHy0u/gn66U/jsmkiJYfWKDaxwzueBFd/NKecxgf2mfVsNz6IBmIJBuS/2Bwj4PzNcp4m1mKhFZqFeYDe9wKE6dnXJ/wsNIENMLqn/LMYCsQNotlN1R7kZjtYIZsqnGNCHwTmV2MWeoyUUKIDq8tKcMu7fRTGBBV40DJPd9RpLPfWk6u4BamJFRzawQKznmRhYQgrd+1jWrwtmPamMgi7VsTMUrRcLiNNuuux6QFGzJCtN4BDaXMWzIy1kGNFEG1c+h7Ilv2bELOIudD1khLaNT+aUU9n8BUtzyijYpr71M3UCTvs70TgUCz6asRJO9cw2yNj7K5MRqg42HR0/N0bgcztOpqPpnvL7BBdo89aL0hJ1HOD3RsEF5wKzsSfo0SufGDz6G7CC/Hv72/vhhyvuNlxjgVeH1HMKU8+XDOUsE0J3VCW3gQhaoHcCVzgFWjpuvtKZ8gmzNWi2cw7ICyEldcmkokit4AIzI2gRKZ8gFzRgYgQ+3UBBl4KvFu2IV4+MqafeFY31pKHu9ruh4Y6FMK+q23AP+eVG96NXx5DrMQm+a/m2xXMjYZ+32Wks4FgZwUz5HJqm0McCgvz9oltvNKSj2sBrhkypJ64B+CQFrirug9smJWFmqQf/moz+WhG22uhmyx0MeUPKbxY/N85bPzG8KP/IM/39P7ptzIAkw3xwASmRFt4Lxn8DpAJ1gGWnfEZmAAcFA+Ad91XDpcrLZxjm+fe89wns7zoCp08eN32kNNgHM6d/Dm6sCMK0wBB4JXVbyvVVZXDR+AD4CwC2CXI+aqUUDIVTxnlgoXyiEf58biu7YXomsbUoKklsg6wreGBOJ16zV74Gu41ZBG1PeWqXumeA1o13vLAejusW7CdPvxiqr62HMvwkysIBtk2RPrWQy4mKN2o4SimtsN2YpUArbJRyNr2Jtya+EtyRz75QMoJorsgOMpx+i4oe2qBFO+T41sSut96A9u1qcL36hgYov1Rd+aKxxLyZ4w2K12K6UyGLk7VeLTSuaN1iuzWxA7Oe2cZiAYkd4bA0NLQj+2bIeWfMhAWxQNU6mo+yldf5YRI6j306bAgO+fnKzxXDFVPC7LsVp7ohNv4u9kaPpTyaL6LshxZwaJqBG4SnpTSnxAZ1NiNrti80DQscb87l5OuO3CD5p7QWz+1i3RKnRSgdtpXHty3y7enk52kgZ6f4LK2SlHUDC1CeBOf1/4ncjhbbKfpEW3CxpL49EoFRRCooSRZMvLWl8NLHcsYgaITFAKMvD9T3yOgFjdwxT8P5lafdByrC2StKbf4IyJ5mrHwnjBDawg5yUWsm+XFzyYKkMO1FI0RAfUtmxPKy0BinGZUvTrNvRnkSUBo+OvKo1dNbNy9Ltmm900UqhsYQ9KZixM29UkE4mRnoboV+b9RM8Xo0hnAtD9QWSIqPmipezzlD5C8vA1Eniue4MoAWtqFLhlp0T1Vo7Qhb3M99TTUp+yZ0pPs/3um94JqOUXpNlQ7aRhPJHtrXVOmgLJ+m1ztG6TXVWtq5wGQpAnmU2SgoT8bPPF9T/S+t/b7McgGVIAAAAABJRU5ErkJggg==",Nm=({isOpen:e,isLoading:t=!1,onClose:n,accountChains:r,defaultChainId:o,defaultSymbol:s,defaultAccountType:i,balances:c,wagmiHooks:a,onDeposit:l,onCopy:u,onChainChange:f,onTokenChange:p})=>{const{t:d}=Nt(),h=y.useMemo(()=>r.map(K=>({...K,key:Ti(K.key)})),[r]),m=y.useMemo(()=>Ti(i),[i]),w=y.useMemo(()=>{var Q;if(!h||h.length===0)return m;const K=h.find(oe=>oe.key===m);return(K==null?void 0:K.key)||((Q=h[0])==null?void 0:Q.key)||m},[h,m]),[P,E]=y.useState(w),T=y.useCallback(K=>{var Q;return((Q=h.find(oe=>oe.key===K))==null?void 0:Q.chains)||[]},[h]),A=T(w),D=()=>{var pe;if(!A||A.length===0)return{chainId:o||1,token:""};const K=o||((pe=A[0])==null?void 0:pe.chainId),Q=A.find(re=>re.chainId===K)||A[0],oe=(Q==null?void 0:Q.tokenList)||[],ee=(s||"").toUpperCase();if(ee&&oe.length>0){const re=oe.find(Y=>(Y.token||Y.symbol||"").toUpperCase()===ee);if(re)return{chainId:Q.chainId,token:re.token||re.symbol||""}}if(ee)for(const re of A){const he=((re==null?void 0:re.tokenList)||[]).find(ve=>(ve.token||ve.symbol||"").toUpperCase()===ee);if(he)return{chainId:re.chainId,token:he.token||he.symbol||""}}const ue=oe.length>0?Q:A.find(re=>(re.tokenList||[]).length>0)||Q,ce=((ue==null?void 0:ue.tokenList)||[])[0];return{chainId:(ue==null?void 0:ue.chainId)||Q.chainId||1,token:(ce==null?void 0:ce.token)||(ce==null?void 0:ce.symbol)||""}},[{chainId:F,token:L}]=y.useState(()=>D()),[b,g]=y.useState(F),x=y.useMemo(()=>h.find(K=>K.key===P)||h[0],[h,P]),I=y.useMemo(()=>(x==null?void 0:x.chains)||[],[x]),O=y.useMemo(()=>{var ue,ce;if(!x||!Ml(x.account)||!(P===_e.SPOT||P===_e.PERPETUALV2))return!1;const oe=!!((ue=x.walletOptions)!=null&&ue.evm),ee=!!((ce=x.walletOptions)!=null&&ce.mpc);return oe&&ee},[x,P]),$=y.useCallback(()=>{var K,Q;return(K=x==null?void 0:x.walletOptions)!=null&&K.evm?"evm":(Q=x==null?void 0:x.walletOptions)!=null&&Q.mpc||x!=null&&x.account&&ns(x.account)?"mpc":"evm"},[x]),[M,v]=y.useState(()=>O?null:$());y.useEffect(()=>{v(O?null:$())},[P,O,$]);const N=y.useMemo(()=>{if(!x)return;if(!O)return x.account;if(!M)return;const K=x.walletOptions;return M==="mpc"?(K==null?void 0:K.mpc)||x.account:(K==null?void 0:K.evm)||x.account},[x,M,O]),k=y.useMemo(()=>N&&ns(N)?pn:zs,[N]),S=I.find(K=>K.chainId===b)||I[0],[B,j]=y.useState(L),U=y.useCallback(K=>{g(K),f==null||f(K)},[f]),_=y.useCallback(K=>{j(K),p==null||p(K)},[p]),q=y.useMemo(()=>{const K=(B||"").toLowerCase();if(!K)return"0";const Q=(c==null?void 0:c[P])||(P===_e.PERPETUAL?c==null?void 0:c.perp:void 0),oe=Q==null?void 0:Q[K];return typeof oe=="string"&&oe.length>0?oe:"0"},[c,P,B]),[Z,H]=y.useState(!1),W=K=>{K.target===K.currentTarget?H(!0):H(!1)},J=K=>{Z&&K.target===K.currentTarget&&n(),H(!1)};return e?He.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:C.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:W,onMouseUp:J,"aria-hidden":"true",children:C.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:K=>{K.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:d("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(w0,{className:"h-4 w-4"})})]}),C.jsx(Mh,{selectedAccount:P,options:h.map(K=>({value:K.key,label:K.key===_e.SPOT?d("account.spot"):K.key===_e.PERPETUAL?d("account.perpetual-v1"):K.key===_e.PERPETUALV2?d("account.perpetual-v2"):K.key})),onAccountChange:K=>{var he,ve;const Q=K||P;E(Q);const oe=T(Q);if(!oe||oe.length===0)return;const ee=oe.find(Ne=>Ne.chainId===b),ue=ee?ee.chainId:oe[0].chainId;g(ue),f==null||f(ue);const ce=oe.find(Ne=>Ne.chainId===ue),pe=(ce==null?void 0:ce.tokenList)||[],Y=pe.some(Ne=>(Ne.symbol||Ne.token)===B)?B:((he=pe[0])==null?void 0:he.symbol)||((ve=pe[0])==null?void 0:ve.token)||"";Y&&(j(Y),p==null||p(Y))},className:"w-full"}),C.jsx(kh,{currentActiveChain:S,chainList:I,onChainChange:U,curSelectToken:B,onTokenChange:_,walletType:k,accountType:P}),O&&!M&&C.jsxs("div",{className:"mb-4",children:[C.jsx("div",{className:"h-[1px] w-full bg-[#404040] my-4"}),C.jsx("button",{type:"button",onClick:()=>v("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:d("deposit.connectedWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Tm,className:"w-12 h-5"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:d("deposit.connectedWalletDesc")})]})}),C.jsxs("div",{className:"flex items-center my-2",children:[C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),C.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:d("deposit.or")}),C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),C.jsx("button",{type:"button",onClick:()=>v("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:d("deposit.externalWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Am,className:"w-12 h-5"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:d("deposit.externalWalletDesc")})]})})]}),(!O||M)&&C.jsxs(C.Fragment,{children:[N&&ns(N)&&C.jsx(DS,{address:N.smartWalletAddress,currentActiveChain:S,selectedToken:B,accountType:P,accountId:N.accountId,accountKey:x==null?void 0:x.key,onDeposit:l,onCopy:u,onClose:n}),N&&Ml(N)&&C.jsx(GS,{address:N.ethAddress,currentActiveChain:S,selectedToken:B,accountType:P,accountId:N.accountId,accountKey:x==null?void 0:x.key,platformBalance:q,isLoading:t,wagmiHooks:a,onChainChange:U,onDeposit:l,onClose:n})]})]})})}),document.body):null},qS=({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}=Nt(),h=y.useMemo(()=>{if(a==="spot"||!wn(r==null?void 0:r.chainId)){const F=new Le(e||"0").minus(s||"0");if(F.isNegative()||F.isZero())return"0";const L=Math.min(F.decimalPlaces()??0,18);return F.decimalPlaces(L,Le.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,a]),m=y.useMemo(()=>o||"0",[o]),w=y.useMemo(()=>{const F=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new Le(F||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),P=y.useMemo(()=>w==="0",[w]),E=y.useMemo(()=>{const F=(t||"").toUpperCase();return F==="USDT"||F==="USDC"},[t]),T=F=>{const L=F.target.value,g=Si(L,m||"0");if(g.isValid)l(g.formattedValue),g.errorType;else return g.errorType==="exceed_balance",void 0;f==null||f(g.formattedValue)},A=()=>{const F=m||"0",b=Si(F,F).formattedValue;l(b),f==null||f(b)},D=()=>{const F=parseFloat(o||"0"),L=parseFloat(e||"0");if(L>0){const b=F-L,g=jt(Math.max(0,b).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[jt(o||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),g," ",t]})}return`${jt(o||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:e,onChange:T,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"}),C.jsx("button",{onClick:A,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(ar,{content:d("withdraw.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:D()})]})]}),i==="mpc"&&(a==="spot"||!wn(r==null?void 0:r.chainId))?C.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:C.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:F=>u==null?void 0:u(F.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,C.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:wn(r==null?void 0:r.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),C.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")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),C.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[C.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[C.jsx(ar,{content:C.jsxs("div",{children:[C.jsx("div",{children:d("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Xo,{selectedLevel:Rt.FAST,maxLevel:3}),C.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Xo,{selectedLevel:Rt.Medium,maxLevel:3}),C.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Xo,{selectedLevel:Rt.SLOW,maxLevel:3}),C.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),C.jsx("div",{className:"flex items-center",children:C.jsx(Xo,{selectedLevel:wn(r==null?void 0:r.chainId)?Rt.SLOW:Rt.FAST,maxLevel:3})})]}),(a==="spot"||!wn(r==null?void 0:r.chainId))&&C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[P||!E?C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:P?d("withdraw.fee"):`${d("withdraw.fee")}/${d("withdraw.feeRate")}`}):C.jsx(ar,{className:"w-[320px] font-normal flex items-center justify-center",content:C.jsx("span",{className:"flex items-center justify-center text-center",children:d("withdraw.feeCalculationTip")}),children:C.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")}`})}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!P&&` / ${w}%`]})]}),C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(wn(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[jt(h)," ",t]})]})]})]})};let nt=null;const Dl={accountChains:[],defaultAccountType:""},Cm=y.forwardRef((e,t)=>{const[n,r]=y.useState(!1),[o,s]=y.useState(!1),[i,c]=y.useState(Dl),a=y.useCallback(h=>{c(h||Dl),r(!0)},[]),l=y.useCallback(h=>{c(m=>({...m,...h}))},[]),u=y.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=y.useCallback(h=>{s(h)},[]),p=y.useCallback(()=>n,[n]),d=y.useCallback(()=>o,[o]);return y.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),y.useEffect(()=>(nt={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{nt=null}),[a,u,l,f,p,d]),n?C.jsx(Mm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},accountChains:i.accountChains,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});Cm.displayName="WithdrawManager";const Om=e=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.openWithdraw(e||Dl)},Im=()=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.closeWithdraw()},$m=e=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.updateWithdrawOptions(e)},Ai=e=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.setWithdrawLoading(e)},KS=()=>nt?nt.isOpen():!1,km=()=>nt?nt.isLoading():!1,ZS=()=>({openWithdraw:Om,closeWithdraw:Im,updateWithdrawOptions:$m,setWithdrawLoading:Ai,isOpen:KS,isLoading:km}),YS=({accountChains:e,defaultChainId:t,defaultSymbol:n,defaultAmount:r="",defaultAccountType:o,currentEquity:s,platformBalance:i="0",balances:c,fee:a="0.00",isLoading:l=!1,onWithdraw:u,onClose:f,onChainChange:p,onTokenChange:d,onAmountChanged:h,onAccountChange:m})=>{var re;const{t:w}=Nt(),P=y.useMemo(()=>e.map(Y=>({...Y,key:Ti(Y.key)})),[e]),E=y.useMemo(()=>Ti(o),[o]),T=y.useMemo(()=>{var he;if(!P||P.length===0)return E;const Y=P.find(ve=>ve.key===E);return(Y==null?void 0:Y.key)||((he=P[0])==null?void 0:he.key)||E},[P,E]),[A,D]=y.useState(T),F=y.useCallback(Y=>{var he;return((he=P.find(ve=>ve.key===Y))==null?void 0:he.chains)||[]},[P]),L=y.useMemo(()=>P.find(Y=>Y.key===A)||P[0],[P,A]),b=y.useMemo(()=>(L==null?void 0:L.chains)||[],[L]),g=y.useMemo(()=>{var Qt,$e;if(!L||!Ml(L.account)||!(A===_e.SPOT||A===_e.PERPETUALV2))return!1;const ve=!!((Qt=L.walletOptions)!=null&&Qt.evm),Ne=!!(($e=L.walletOptions)!=null&&$e.mpc);return ve&&Ne},[L,A]),x=y.useCallback(()=>{var Y,he;return(Y=L==null?void 0:L.walletOptions)!=null&&Y.evm?"evm":(he=L==null?void 0:L.walletOptions)!=null&&he.mpc||L!=null&&L.account&&ns(L.account)?"mpc":"evm"},[L]),[I,O]=y.useState(()=>g?null:x());y.useEffect(()=>{O(g?null:x())},[A,g,x]);const $=y.useMemo(()=>{if(!L)return;if(!g)return L.account;if(!I)return;const Y=L.walletOptions;return I==="mpc"?(Y==null?void 0:Y.mpc)||L.account:(Y==null?void 0:Y.evm)||L.account},[L,g,I]),M=y.useMemo(()=>$&&ns($)?"mpc":"evm",[$]),v=M==="mpc"?pn:zs,N=y.useMemo(()=>{if(!b||b.length===0)return{chainId:1,tokenSymbol:""};const Y=$e=>{const ke=$e||[];if(!ke.length)return"";const rt="USDC".toUpperCase(),Rn=ke.find(Pt=>(Pt.token||Pt.symbol||"").toUpperCase()===rt)||ke[0];return Rn.token||Rn.symbol||""};if(n){const $e=n==null?void 0:n.toUpperCase();for(const ke of b){const cr=ke.tokenList||[];let rt;if($e&&(rt=cr.find(zt=>(zt.token||zt.symbol||"").toUpperCase()===$e)),rt){const zt=rt.token||rt.symbol||n||"";return{chainId:ke.chainId,tokenSymbol:zt}}}}if(t){const $e=b.find(rt=>rt.chainId===t)||b[0],ke=$e.tokenList||[],cr=Y(ke);return{chainId:$e.chainId,tokenSymbol:cr}}const he="USDC",ve=$e=>Array.isArray($e.tokenList)&&$e.tokenList.some(ke=>(ke.token||ke.symbol||"").toUpperCase()===he),Ne=b.find(ve)||b[0];if(!Ne)return{chainId:1,tokenSymbol:""};const Qt=Y(Ne.tokenList);return{chainId:Ne.chainId,tokenSymbol:Qt}},[b,t,n]),[k,S]=y.useState(()=>N.chainId),[B,j]=y.useState(()=>N.tokenSymbol),[U,_]=y.useState(r),[q,Z]=y.useState(""),H=y.useCallback(Y=>{S(Y),p==null||p(Y)},[p]),W=y.useCallback(Y=>{j(Y),d==null||d(Y)},[d]),J=y.useRef(!0),K=y.useRef(B),Q=y.useRef(k);y.useEffect(()=>{if(J.current){J.current=!1,K.current=B,Q.current=k;return}(K.current!==B||Q.current!==k)&&(_(""),K.current=B,Q.current=k)},[B,k]);const oe=b&&b.length>0?b.find(Y=>Y.chainId===k)||b[0]:null,ee=(re=oe==null?void 0:oe.tokenList)==null?void 0:re.find(Y=>Y.token===B),ue=y.useMemo(()=>{const Y=new Le(U||"0"),he=new Le(a||"0"),ve=wn(k);return ee!=null&&ee.minWithdrawSize&&Y.lt(ee.minWithdrawSize)?{text:w("withdraw.minWithdrawParsed",{amount:ee.minWithdrawSize,token:ee.symbol||ee.token}),disabled:!0}:!U||Y.isZero()||!ve&&Y.isLessThan(he)?{text:w("withdraw.confirmWithdraw"),disabled:!0}:M==="mpc"&&(!ve||A==="spot")&&!q.trim()?{text:w("withdraw.invalidReceiverAddress"),disabled:!0}:{text:w("withdraw.confirmWithdraw"),disabled:!1}},[w,k,U,M,q,a,A,ee]),ce=y.useMemo(()=>{const Y=(B||"").toLowerCase();if(!Y)return i||"0";const he=(c==null?void 0:c[A])||(A===_e.PERPETUAL?c==null?void 0:c.perp:void 0),ve=he==null?void 0:he[Y];return typeof ve=="string"&&ve.length>0?ve:i||"0"},[c,A,B,i]),pe=y.useCallback(async()=>{Ai(!0);try{if(u){const he={amount:new Le(U||"0").toString(),chainId:k,tokenAddress:(ee==null?void 0:ee.tokenAddress)||"",coinId:(ee==null?void 0:ee.coinId)||"",tokenSymbol:B,accountType:A,selectedToken:ee};M==="mpc"&&(!wn(k)||A==="spot")&&(he.receiverAddress=q),u(he)}}catch{Ai(!1)}},[u,A,ee,U,k,B,M,q]);return!b||b.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):oe?C.jsxs(C.Fragment,{children:[C.jsx(Mh,{selectedAccount:A,options:P.map(Y=>({value:Y.key,label:Y.key===_e.SPOT?w("account.spot"):Y.key===_e.PERPETUAL?w("account.perpetual-v1"):Y.key===_e.PERPETUALV2?w("account.perpetual-v2"):Y.key})),onAccountChange:Y=>{var zt,Rn;const he=Y||A;D(he),m==null||m(he);const ve=F(he);if(!ve||ve.length===0)return;const Ne=ve.find(Pt=>Pt.chainId===k),Qt=Ne?Ne.chainId:ve[0].chainId;S(Qt),p==null||p(Qt);const $e=ve.find(Pt=>Pt.chainId===Qt),ke=($e==null?void 0:$e.tokenList)||[],rt=ke.some(Pt=>(Pt.symbol||Pt.token)===B)?B:((zt=ke[0])==null?void 0:zt.symbol)||((Rn=ke[0])==null?void 0:Rn.token)||"";rt&&(j(rt),d==null||d(rt))},className:"w-full"}),C.jsx(kh,{currentActiveChain:oe,chainList:b,onChainChange:H,curSelectToken:B,onTokenChange:W,walletType:v,txType:"withdraw"}),g&&!I&&C.jsxs("div",{className:"mb-4",children:[C.jsx("div",{className:"h-[1px] w-full bg-[#404040] my-4"}),C.jsx("button",{type:"button",onClick:()=>O("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:w("deposit.connectedWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Tm,className:"w-12 h-5",alt:"EVM"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:w("deposit.connectedWalletDesc")})]})}),C.jsxs("div",{className:"flex items-center my-2",children:[C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),C.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:w("deposit.or")}),C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),C.jsx("button",{type:"button",onClick:()=>O("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:w("deposit.externalWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Am,className:"w-12 h-5",alt:"MPC"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:w("deposit.externalWalletDesc")})]})})]}),(!g||I)&&C.jsxs(C.Fragment,{children:[C.jsx(qS,{withdrawAmount:U,curSelectToken:B,tokenInfo:ee,curSelectTokenData:{balance:ee==null?void 0:ee.balance,allowance:ee==null?void 0:ee.allowance},currentActiveChain:oe,currentEquity:s||0,decimals:(ee==null?void 0:ee.decimals)||6,platformBalance:ce,fee:a,walletType:M,accountType:A,receiverAddress:q,onWithdrawAmountChange:_,onReceiverAddressChange:Z,onAmountChanged:h}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${ue.disabled||l?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:pe,disabled:ue.disabled||l,children:[l&&C.jsx(ts,{size:"xs"}),ue.text]})]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Mm=({isOpen:e,isLoading:t=!1,defaultAccountType:n,onClose:r,config:o,accountChains:s,defaultChainId:i,defaultSymbol:c,defaultAmount:a="",currentEquity:l=5e3,platformBalance:u="0",balances:f,fee:p,wagmiHooks:d,onWithdraw:h,onChainChange:m,onTokenChange:w,onAmountChanged:P,onAccountChange:E})=>{const{t:T}=Nt(),[A,D]=y.useState(!1),F=b=>{b.target===b.currentTarget?D(!0):D(!1)},L=b=>{A&&b.target===b.currentTarget&&r(),D(!1)};return e?He.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:C.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:F,onMouseUp:L,"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:b=>{b.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:T("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:C.jsx(w0,{className:"h-4 w-4"})})]}),C.jsx(YS,{accountChains:s,defaultChainId:i,defaultSymbol:c,defaultAmount:a,defaultAccountType:n,currentEquity:l,platformBalance:u,balances:f,fee:p,isLoading:t,wagmiHooks:d,onWithdraw:h,onClose:r,onChainChange:m,onTokenChange:w,onAmountChanged:P,onAccountChange:E})]})})}),document.body):null};ae.ChromeLoader=ts,ae.ComponentProvider=sb,ae.DEFAULT_LOCALE=os,ae.Deposit=Nm,ae.DepositManager=vm,ae.LOCALE_NAMES=nb,ae.LoadingSpinner=ts,ae.SUPPORTED_LOCALES=Ci,ae.Tooltip=ar,ae.Withdraw=Mm,ae.WithdrawManager=Cm,ae.closeDeposit=xm,ae.closeWithdraw=Im,ae.formatThousands=ab,ae.isDepositLoading=Sm,ae.isWithdrawLoading=km,ae.openDeposit=wm,ae.openWithdraw=Om,ae.setDepositLoading=Pi,ae.setWithdrawLoading=Ai,ae.updateDepositOptions=Em,ae.updateWithdrawOptions=$m,ae.useComponentConfig=Gl,ae.useDeposit=P5,ae.useDepositManager=US,ae.useTranslation=Nt,ae.useWithdraw=T5,ae.useWithdrawManager=ZS,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
185
+ `,children:[t,o&&C.jsx(gm,{ref:f,placement:h.placement||n})]})})]})},es="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=",BS=({currentActiveChain:e,selectedToken:t,address:n,accountType:r,accountId:o,accountKey:s,onDeposit:i,onCopy:c,onClose:a})=>{const{t:l}=Nt(),u=r===A5,f=!u,p=(t||"").toUpperCase(),d=!(r===N5&&p==="USDC"),h=y.useMemo(()=>{if(!e)return!1;const S=Number(e.chainId);return!Number.isNaN(S)&&(S===42161||S===421614)},[e]),m=u,v=y.useMemo(()=>{var S;return(S=e==null?void 0:e.tokenList)==null?void 0:S.find(A=>A.token===t||A.symbol===t)},[e,t]),T=y.useMemo(()=>{const S=(t||"").toUpperCase();if(!m&&S==="USDC")return l("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const F=l(m?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return m&&(!h||S==="USDC")?String(F).split(`
186
+ `)[0]:F},[l,t,e==null?void 0:e.chain,m,h]),E=(v==null?void 0:v.minDepositSize)||"10";return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&C.jsx("div",{className:"bg-white rounded-lg",children:C.jsx(Jh,{value:n,size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&C.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[C.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:n}),C.jsx(z3,{onCopy:()=>{c&&c(n)},text:n,children:C.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[C.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),C.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")]}),C.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[C.jsxs("div",{className:"flex items-start",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1",children:C.jsx("p",{className:"text-xs text-functional-orange-1",children:T})})]}),f&&C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:l("deposit.addressUpdatedNotice")})]})]}),C.jsxs("div",{className:"text-sm",children:[d&&C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[C.jsx("span",{className:"text-text-tertiary",children:l("deposit.arrivalTime")}),C.jsx(ar,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:l("deposit.arrivaltimeTooltip1",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60,v1:e==null?void 0:e.txConfirm})}),C.jsx("p",{children:l("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed",children:l("deposit.arrivalEstimated",{v:(e==null?void 0:e.blockTime)*e.txConfirm/60})})})]}),C.jsxs("div",{className:`flex justify-between items-center h-[18px] ${d?"mt-1":"mt-4"}`,children:[C.jsx("span",{className:"text-text-tertiary",children:l("deposit.minDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:[E," ",t]})]}),f&&p!=="USDC"&&C.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[C.jsx("span",{className:"text-text-tertiary",children:l("deposit.maxDeposit")}),C.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]}),C.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:()=>{i&&i({amount:"",chainId:e.chainId,tokenAddress:n,tokenSymbol:t,accountType:r,accountId:o,key:s}),a()},children:l("deposit.title")})]})},ts=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return C.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},LS=(e,t)=>Number(e)>Number(t),jt=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"},Si=(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 Si(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:jt(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},FS=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=jt(Math.max(0,s).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[jt(e),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${jt(e)} ${n}`},RS=(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)},jS=(e,t,n)=>{if(!kh(e,n))return!1;try{const r=new Le(t||"0"),o=new Le("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},zS=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&kh(e,n))try{const i=new Le(o),c=new Le("200000");i.gt(c)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new Le(o||"0");return console.log("bn:",i),console.log("bn:",i.isNaN()),i.isNaN()?o:i.decimalPlaces(6,Le.ROUND_DOWN).toString()}catch{return o}},ym={accountChains:[],defaultChainId:1,defaultAccountType:"",balances:{}};let tt=null;const vm=y.forwardRef((e,t)=>{const[n,r]=y.useState(!1),[o,s]=y.useState(!1),[i,c]=y.useState(ym),a=y.useCallback(h=>{c(h),r(!0)},[]),l=y.useCallback(h=>{c(m=>({...m,...h}))},[]),u=y.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=y.useCallback(h=>{s(h)},[]),p=y.useCallback(()=>n,[n]),d=y.useCallback(()=>o,[o]);return y.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),y.useEffect(()=>(tt={openDeposit:a,closeDeposit:u,updateDepositOptions:l,setDepositLoading:f,isOpen:p,isLoading:d},()=>{tt=null}),[a,u,l,f,p,d]),n?C.jsx(Nm,{isOpen:n,isLoading:o,onClose:u,accountChains:i.accountChains,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});vm.displayName="DepositManager";const wm=e=>{if(!tt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}tt.openDeposit(e||ym)},xm=()=>{if(!tt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}tt.closeDeposit()},Em=e=>{tt&&tt.updateDepositOptions(e)},Pi=e=>{if(!tt){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}tt.setDepositLoading(e)},US=()=>tt?tt.isOpen():!1,Sm=()=>tt?tt.isLoading():!1,_S=()=>({openDeposit:wm,closeDeposit:xm,updateDepositOptions:Em,setDepositLoading:Pi,isOpen:US,isLoading:Sm}),WS=e=>{const{t}=Nt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:c,minDeposit:a=10}=e;return y.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const l=parseFloat(r||"0"),u=a,f=RS(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 VS(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:Cr,functionName:"allowance",args:[Tn(t||""),p],chainId:r,query:{enabled:!!(!d&&t&&r&&u&&p)}}),E=T!=null&&T.isSuccess?T.data:void 0,S=y.useMemo(()=>{if(d)return!0;if(!T.isSuccess||E===void 0||E===0n)return!1;try{const D=D6(String(Number(s||"0")||0),Number(f));return E>=D}catch{return!1}},[d,T.isSuccess,E,s,f]),A=y.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!v||!u||!p)return;const F=Tn(u),L=Tn(p);if((E||0n)>0n){const x=await m({abi:Cr,address:F,functionName:"approve",args:[L,0n]});await v.waitForTransactionReceipt({hash:x})}const g=await m({abi:Cr,address:F,functionName:"approve",args:[L,df]});await v.waitForTransactionReceipt({hash:g}),T!=null&&T.refetch&&await T.refetch()}catch(D){console.error("[useApprove] onApprove failed:",D)}},[r,n,u,p,E,T,m,v,h]);return{approve:S,onApprove:A}}const HS=({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 y.useEffect(()=>{o(Tn(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},GS=({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=y.useMemo(()=>{const S="0x0000000000000000000000000000000000000000",A="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(D=>{const F=D.tokenAddress;if(!F)return!1;const L=F.toLowerCase();return!(F===S||L===A)})},[r]),[c,a]=y.useState({}),l=y.useCallback((S,A)=>{a(D=>({...D,[S]:A}))},[]),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]=y.useState(0),d=y.useMemo(()=>i.map(S=>y.createElement(HS,{key:`${S.tokenAddress}-${f}`,token:S,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:l})),[i,e,s,n,o,l,f]),h=y.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"},A=i.map(F=>{const L=c[Tn(F.tokenAddress)],b=L==null?void 0:L.balance,g=b==null?void 0:b.data;return{address:Tn(F.tokenAddress),value:(g==null?void 0:g.value)||BigInt(0),formatted:(g==null?void 0:g.formatted)||"0",decimals:(g==null?void 0:g.decimals)||F.decimals}}).filter(F=>F.address),D=A.reduce((F,L)=>({...F,[L.address]:{balance:L}}),{});return{balanceList:A,baseTokenBalance:S,combinedData:D}},[u,c,i]),m=y.useCallback(async()=>h,[h]),v=y.useMemo(()=>{const S=(u==null?void 0:u.isLoading)||!1,A=Object.values(c).some(D=>{var F;return(F=D.balance)==null?void 0:F.isLoading});return S||A},[u==null?void 0:u.isLoading,c]),T=y.useCallback(()=>p(S=>S+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:v,queryComponents:d}},qS=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,accountId:o,accountKey:s,platformBalance:i,isLoading:c,wagmiHooks:a,onChainChange:l,onDeposit:u})=>{const{t:f}=Nt(),p=a.useAccount(),d=t.tokenList.find(Z=>Z.token===n||Z.symbol===n),h=t.chainId,[m,v]=y.useState("");y.useEffect(()=>{v("")},[n,t.chainId]);const{multicallResult:T,queryComponents:E}=GS({account:e,chainId:t.chainId,contractAddress:(d==null?void 0:d.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:a}),S=y.useMemo(()=>{var H;if(!d)return"0";if(!d.tokenAddress||d.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return T.baseTokenBalance.formatted;const Z=T.combinedData[d.tokenAddress];return((H=Z==null?void 0:Z.balance)==null?void 0:H.formatted)||"0"},[d,T]),A="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",D="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",F=y.useMemo(()=>{var Z,H;return y5({chain:E5,transport:x5(t.rpcUrl||((Z=window==null?void 0:window.ENV)==null?void 0:Z.CHAIN_RPC_URL_42161)||((H=window==null?void 0:window.ENV)==null?void 0:H.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),L="1000000000000",{formatted:b}=S5({client:F,tokenAddress:A,holder:D,decimals:6,fallbackFormatted:L,pollingInterval:12e3}),[g,x]=y.useState(!1),{approve:I,onApprove:O}=VS({account:e,accountChainId:p.chainId,targetChainId:+t.chainId,tokenInfo:d,amount:m,wagmiHooks:a}),k=y.useCallback(async()=>{if(!g)try{x(!0),await O()}catch(Z){console.error("Approve failed:",Z)}finally{x(!1)}},[g,O]),M=y.useMemo(()=>+p.chainId!=+t.chainId,[p.chainId,t.chainId]),w=y.useCallback(async()=>{l&&l(h)},[l,h]);y.useEffect(()=>{M&&w()},[M,w]);const{showLayerZeroTip:N,layerZeroTipKey:$}=y.useMemo(()=>{const Z=+t.chainId==42161||+t.chainId==421614,H=(n==null?void 0:n.toUpperCase())==="USDT",W=new Le(m||"0"),J=new Le("200000");let K=!1,Q;if(Z&&H&&m)if(W.gte(J))K=!0,Q="deposit.layerZeroDepositTipGte200k";else{const oe=b;if(typeof oe=="string"&&oe.length>0){const ue=new Le(oe);!ue.isNaN()&&W.gte(ue)&&(K=!0,Q="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:K,layerZeroTipKey:Q}},[t.chainId,n,m,b]),P=y.useCallback(()=>zS(+t.chainId,S||"0",n,r),[S,t==null?void 0:t.chainId,n,r]),B=y.useMemo(()=>r!=="spot"&&jS(+t.chainId,m,n),[r,t==null?void 0:t.chainId,m,n]),j=y.useMemo(()=>"deposit.maxDepositSplitTip",[]),U=WS({isNetworkMismatch:M,depositAmount:m,approved:I,currentTokenBalance:S,selectedToken:n,showLayerZeroTip:N,minDeposit:d!=null&&d.minDepositSize?parseFloat(d.minDepositSize):10}),_=Z=>{const H=Z.target.value,W=P(),J=Si(H,W);if(J.isValid)v(J.formattedValue),J.errorType;else return J.errorType==="exceed_balance",void 0},q=y.useCallback(async()=>{Pi(!0);try{u&&u({amount:m,chainId:h,tokenAddress:(d==null?void 0:d.tokenAddress)||"",tokenSymbol:n,accountType:r,accountId:o,key:s})}catch(Z){console.error("Deposit error:",Z),Pi(!1)}},[u,m,h,d==null?void 0:d.tokenAddress,r,n]);return C.jsxs(C.Fragment,{children:[E,C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.jsx("input",{type:"text",placeholder:f("deposit.amount"),value:m,onChange:_,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"}),C.jsx("button",{onClick:()=>{const Z=P();v(Z)},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:f("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(ar,{content:f("deposit.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:f("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:FS(S||"0",m,n)})]})]}),!I&&LS(m||"0",0)&&C.jsxs("div",{className:"flex justify-center flex-col items-center",children:[C.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:f("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),C.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:f("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),C.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:k,disabled:g,children:g?C.jsx(ts,{size:"xs",inline:!0}):f("deposit.enableWithToken",{token:n})})]}),N&&C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:f($||"deposit.layerZeroDepositTip")})]}),C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),B&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:f(j)})]}),B&&C.jsx("div",{className:"my-2 ml-5 h-[1px] border-b border-dashed border-line-divider-secondary"}),C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:!(B||N)&&C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:f("deposit.noPrivateKeyWalletWarning")})]}),C.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[C.jsx("span",{className:"text-sm text-text-tertiary",children:f("deposit.arrivalTime")}),C.jsx(ar,{content:C.jsxs("div",{className:"grid flex-grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:[C.jsx("p",{children:f("deposit.arrivaltimeTooltip1",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60,v1:t==null?void 0:t.txConfirm})}),C.jsx("p",{children:f("deposit.arrivaltimeTooltip2")})]}),placement:"top",children:C.jsx("span",{className:"text-text-primary font-medium text-right border-b-[2px] border-dashed border-line-divider-primary decoration-dashed text-sm",children:f("deposit.arrivalEstimated",{v:(t==null?void 0:t.blockTime)*t.txConfirm/60})})})]}),C.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[C.jsx("span",{className:"text-sm text-text-tertiary",children:f("deposit.equity")}),C.jsx("span",{className:"text-sm text-text-primary font-medium",children:m?C.jsxs("span",{className:"flex items-center gap-1",children:[jt(i),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),jt((parseFloat(i)+parseFloat(m)).toString())," ",n]}):`${jt(i)} ${n}`})]})]}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${U.disabled||c?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:q,disabled:U.disabled||c,children:[(c||M)&&C.jsx(ts,{size:"xs"}),U.text]})]})},Pm=e=>e.toLocaleUpperCase()===pn?pn:zs,ns=e=>Pm(e.wallet)===pn,Ml=e=>Pm(e.wallet)===zs,Ti=e=>e?e==="perp"?_e.PERPETUAL:e==="perp-v2"||e==="perp_v2"?_e.PERPETUALV2:e:"",Tm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABBMSURBVHgBvVt7kBTHef/17N77fRwSiNeBBAGBpVNJERKyoqOSuByiVLAScOKqJKAYJU4F8XCVY8d/cLiSkKSS4pDtKJKRdFhxYoNskTKS4jixFguEICAdiDtAvJb3cRzcg7u9vX1M5/t6puexO7u3Byd+VDOzPT3dPd/39ffqPoFbhJSymS5NVJ6yr7V2YfRRidrlMJWIECKC28Bnv5dslqZskjCeEhA0nvSPJ0SU5hQ1IA/DQGTPqqIIbgMLvjzcbAjxoBRoFlLSeKJWqjEFDY0++p6oCRmFFO2Aufvo1rIIbgFiLI3pA/mD11BZC/fjC0WUSoTKRp58IS80vyZrEylzjTDlLYxHYwgZKUqHNka+Uth4TWtlbWowvkZArjWlqBEikz4SNsmkdZXqB7WDaVrfV1SEje3/WhZFgSiIATbhN8Ai/HigDXkYwYRPJkwaT47PeAJt+RjBhE8PDm+QEGvpW/VLkglMUFeuFja13HvBtHHu1SOp3nktHMa3CmHEqAygDlniWzB2iR8NUVhMaPNWPv5yeo0hZcv4j0cqSsiN7z8XbvPWLlgVXwMz3UJk9I4nLekWmqD6t9WTUEzw1vme8zNqc84wzI0ff6+yLe+s8j2kwTdj/KQ+F1rpA9fxzRMvpTePm9TnhGjd+2chNd78Z2ObiVZrbYJaT4Ur4TYhhbMoPM8z7h3dZD+RVhU1MURrx9bydTlnE1Rpq5w3qTTjDqB/BO2//f10H825GXcAMiXb+z8c6SPiNXuIK7XOt+oE/WbVI2wmKBpLr9632nrbeVWVh7RSthfL5OL2trq+zLmEc8zxXSpN8cEBlFZW49OEGR/A2rcqmiBxxzDQmWgiowlbcO2RpUfStd6XnnpNfOsdVk26NfVFxDcVE/z92CsIsimOMAv04sy5hDIrbLWzlO9f+OJnkDwVwcRygVD9NIhwCcYDTPTBfa/jo3//W/z1OzGcLnsYdwqxaBLJ3rS6l9Z/mpD21ZJk3d4yspZIewjrFW/nfVtdaXXkukxWXePEpm/W9rT/3c+88/GpIBpsBV1e4/uO997B97+5QtUvnGpg4bQQyh9ejvJHlqFk1uO4FcTP7MPQwR2Id/wXdh/vxc/Ll+Hk45txpzByLYXBUwm49HFhMUPYasiRcjw6NyTmTQ9hLpUpDRa5bsYkjp03ceB4Cv93Ig29iiz1IzNtgcMEezWsO9FW0+q0cCYgZSMs1cNXbN/0PA698yOnq+oSgWfmh+lKy6ZuGioeXoayR5YjXDcV+cDSfvO9rRjcs9W6HwHeoolfMqbi6G+8gXjlNNwJmCMS/R1xpONewrvCyuLrld4vfLZI/OXSYiK6kbffSz0mvrMzgTf3JLXb6qwatz/nN3fdNyLMmVHbHngZwJK/Qv/esGQ22AZ4wUxYOM3AvInupKrvmYaiHJYkkSIDe/mC8/tYt4k950yMpCROLmpF96zluBVMrhK4bwJQWWz9HiSh7hoETvbkNiQ3T41gpDul7r06Ah5isYROmWBg06oylnyMBcyIP/77GC5eM7M8J3jcVNt4t57YVqM8Ix09NNLlrG49PNiPliVzcg7WNNnArzVaE2TiV1UEtxuIEROStPTpuw9cTOPwFWX5MEJSf3DpfowFVcUCyz4DLF9goDKHKeq6CXx4ReK1gxJXBl0KsPT3HBzSXjy0+pH2b9t7B6ua764pH1Xqc4GZ8BdbhnD8vDLejoekepd+25IwZB2vAj3SBm9HZZU1qJuUWzW0EyHbPkxhgNRJMuX6xV6kTYv4rHLe7Eg5xGecf+CrGAuWLxDY8YcGnn04N/EZk6qAJXOo7Ze4rauKh84n7ElK+5+tr/mhJBeGChP9dojP4Hf/ZU0FpkxwAzW+Sm1grHtlW8IpgwNc6NGaMzub9dCivIMNkFT9x5Ekjl0jlZLMfp5KWSrnh0dS6In5OTRwV2FGnKX+208beH5RfsIHgZm16XOGUlMjfZbqMSU0BRQbTJc6eP0bFbdFfA3uY9Oqcrtf6bsSo4XFCF4Npgo4Q3ZWMyv67O26gE8OvJt3MJbyMzekYsCcu/yT/8UnJn55Nq3aeDFw9yJcnrcKheDlpSHMv9sfKw7Sitp5XOLf2iVeOiDxzicS/3tGKjswoUz4GDWjVmCyMPHT90YCl6ntXuKZJ0uoFGO8MJVsJHlKov2UYryt87zRmVJFpfUPfH03m89m3AbYMM8OkJxG+viPuwSpIP+H999dmPSz5FZm0OTVQxI7jppKrWXio8sSL7xvSb5X/XScTtr6QCpt73go/M+0wtbnnynFeGPF50vQ9rO4urd4bzqT0oyn/x9kBjwY1EEhEbDlmobUNRMNFLz9Hj37cUfax4Sh+vkoBCzRq3elSQWFFCO+8XNTEXk0vHqI2l0R2PSbhvKMfvBBUqkaSwyl4/loLJwbyqt6/uqlIew/lrTesvjlfOzC+8P4h+cqA9/jPtmT2n+MV4H2sixPSKtB+rGYGdAY1AEb4nyYUmPg6TkGSsJOBtCXrmUwY5gJuyhY6RmyKuMVuY0763wmtvZgrty0mMB1J6+P3l6DGbXyJ2nFxP4B046CYPufAto956pH54aRDx8cS7BrCX/+3yZiZ36BWDi3CB90JlVbw9BRsnQibrp7ICcD7pm9QK0CbyxQWiQw9y6Be8lXnlLhl/ogBjCYCV+iYS4RA05fN7E/BwOUwf0dQ3kyq39qEsFdJgRhcqXVnsHtM5mg30vF0q7Ho77fjbbI/8H9M/IzwJFWx4UUlPuR0h/xBmPKRJ2qtvJFbqCm7rnzOv6CwLw7u6GfW/k1NNYbaL4vhBWPhvH1Xw/jdxeEMK0q/9hmgGDwO/xuqjhYtTExdXDF97Mn5B5DE5+ZxYXvuS4I6ZQJ1wtxvFHnd1XFaHR00wzS9SOd3/kwpSEEK2nnJPWk9Y7lDdFNTV6/6/EnFxHhQ8QAgxhhTXSQXErTDPhQT13QvPidwVjwhDMNbj4meImvMRoT7FnZc/O4h1JitCysJqAmupVW0JnS0WEzzJNZdQRBZVSZAX25XjbP78uqS5E9unot6ZSe6ylVEil3Qqm0dOq9bUdIJ1eaA1l9aoPb5VE3QUwIIr5GEBNmk9BUl7HKMLUfDouY0OaY9Hsa+cDvmaZmmss33U8+DMTs5eYpWgB4FdBtX14GpI7syKqrrRGorXLF9XSsjKRfIiTcxSQovuO6IzddD6Ga3qmnBVeB/sCxtMHNxYQg4nNbb3svE5j4fF9V7joJbnGlufNcEgVAuhJsFqyCOqNJn+qzm0tbHkAki7IFakeAIZZ9FyG7O7I6ZUPLTAiFi/DPp6bg7ct1+Js5ZzBLxOFkV6jN8eFqbDxzL5bc04uv3ncJFWUGeQJp3JfsxNWSYEOsmcCupya0ZgIHYJnE57YMb3vNBKXWKChjI3uBknBCZCbhLFvVGU0hHxbOK4Klsz3a2u5o4bxRPKjOhMNoT2paOHvKJqKskzgKzkrKp49sR2LX+sCOudNYnKS5jIKiZAjRvmLMqRlBSbGdbEsIXIoVYWJFGlVFaQzFQigrNYkBEj8pfRYvVm5APkyu8hM1E5r42tPJ1/6Vt2P41rabTiDmfIN95Zq9327A1LvGlv0cDRe703hi9TXAE/x5DY7tNW5ktrYHdRCkfjS4r9ISi9hM4AUNw1ltZtUm1DNGcbFFfMa96U6MhiB1pJFJ/NHaT58cdlSFzgFJjzvE95vfGMR4o5X6tG2v7UVJrxOlYJiIGPaJtSw7cHMIuNHvLxevmjh1LqVKF3E4aa9eZogmMCPkESZuc7k75bzXcHEvKgIMcSaCiBpE/NHav3w8RFupwklHuEbQTkXQdXskhn0dCYwXLtL3/uhdysUr1WVaW2vuzpieQzT6xuSIVmxbMjspvjc7Z1NeaqgOkrT5k0pbTBq28zJFYQ8D7F75GbfhZcjvsCtaVhrCb/W9gkLgJWo+4o/Wvmp6GVy6+11KvRrWf7dXqY3bBfexvOWGuueATRtvNZrUDFGRSITr9IYMB2O93o5GaP+256VlWQOkyN283ptCVSXtEZdZlB6umoqNb0fV/oDGPy2difJBazcsNky2YjCNhvowrQ6BIaMaz878GIWCdTy7qkFJuELamzTn87+46iRytAoQvpMjQs5vDIlXvlZP9iCMWwEb+y//Y6/siCZFwLkiexVYgV26yJjV9cPJUcOaiGAV5FsFvPEuSrOj1jAt54qKEEm5QLp+DmKPrcfBCcvw36clPrjolhMz/kg94zY8m4oKQxGfwSpoSX9hq4DBUlwo8YPaGzTn6hkV/kgW7j37+VKmBREOv7+hR6mQseL9oyNYRu92RBPK39KpB+m4Qa4Kov+3MfH5zrsnzKvgLDypid7t6xE7tN03EDOFmTMw6QkMl04EGRHsOfARtrz6A1+7P/2DZ/D55kUqE1k6fBU1V/epVSXjlv7nVbB6xl51vRPgVXDhl90wkzpkzzg5Iv0nGr64uALrlldh2iirgaV+665BbH2LDbl7CiIYSvrPmcWhxVkMsGfhc0ljB7ejd8d6RXC2CXz1Hkm5cOIIus8ew9Bw3I4yXVRVVqqIo+6eWZj1wK869cyEkdP7kKDrmzfmYduE/C7peKL/3BBuHB9w4gAb3vBApxOdnP1j95fIRQtKxPyZxaguh2rC0TMT/v2jcTLeI94TENAqx3vEUfWo9ZBhrOj68dRtevAsblFDPrOi9ivN4QHVwijNLaV917pw4tB7iMf8rlxpeSV+5ZEnUdswKee7fEzlOx9VYvvHo8T044jrx/vRFx2y9qjc7K0vV09fLC0CSmQfUXfgDYQ9u15SCH+44R5XlGi9snO675yoyNHzuxjDThkTP5MBlTX1CBcVts23eldhmy3jhcv7exDvtdxOLbkW9AlnJ0wLUCnek9LSlnT3eGOOtvSfPHxl54yHMqaS93AuM6EJdwB9cUSeft2shfpLlE8fZsKMnP6fy7RpKvRuoC267uFcr+rQGzBe2GLuBLlutKvfsy5WUxEpRfoL0Z0zs+KtwHQ0e0VUmFtb8OljS12ZWLz3udBDtFY/9fF4jH2rixd3/2fjQxDmC4A3X595isHNnsE5xKv1u5S+WELdet+z+jSEuaVr5/TFQcRn5N0PICawUV4J648pxhs8oXX2GAp7/rxoLdnylfzHFBh/0HjmOh5DV1zdOXMt6X7r+7wuqvSnj634zQngpOW2qsyozu/LrHaUziQXcN0VGiPfpAQKgH1yroXKn2B8wJLeYscfWXjsRdkYMpItJB/jMh5Lfbgk3BJZGTzepKVnG4mmGyg1sUK19xxVtKNW4VcvfrWUqaIMIbeUGUZLLqn3zQ1jgIcRTyHHXnIe6GCvNRfhM+EyIkTjqbHHNJ4wifCl4dZchM8EMyKdxgZaFc1Ez0b4AgVtI6zUjtc7Us8M9BMbtpQbRmshhNcYEwO8sA90cWFD1mgX75+pcuFM626+3vafqb6YbCaF2Qw2nEI02sLgGY/sFmQ7xaC7hSna93zl9v5MteHpk80U9z9FdqKJyNtIdG8kdtRa+wqil3R3vwlB34WINFOHe3bNjuAW8P/4M203oLS1YgAAAABJRU5ErkJggg==",Am="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0WSURBVHgB1ZsNcFTVFYDPe7thd7NZsonIT6CwQWvAnwTaRNuxQoJ2SqpViW3RiiMgVq2dgcy0dnRqkwz9Ga0dNjOt2BYVi2hpVaSFBmyRRWBajUoIWIlYWERAhWE3xoT87O7rOfftDW/fu+9vEzrTb+bN7rvvvnd2z7n3nHN/ngR5kvh7US2AMkvKKHMBpFkgQRgUPAgJkvg9jtfjkj+yTy6cGgvVbI3BCFAUpRY/ZuExN/sZzh5EEo949tiHR0ySpBiMhG+ivAzQ/5qL/8UoT8rKU1CeDDF4IT95kpvKiY3hsFw0uFxRpBXDynZO3Ddlaaz/g3UtJfXJuJMbUOkkYzkeKwDcy8MjhkcLGiPu6I6bUZ48AnkSyiuAFvijQ3ng0ABM8YVDTYr6w0aEHJgG8piStcGrdpsqJqv4JhgFeVnWgpUhVMWPnjwJ5Tk0hK0Bul8JLFdAbs6jxdsR945vaCmavW6tthCVTy2wGWD05YFqhLU5pbegPOX8yYOXdPJ0WBqge1twlTJ6rVCIJ1AWDc051EjfUfmrwIG8gVQG9hw6DfHTvew8Mi4INeWlEPJ7wQFRNAKTBw3O5I2QKBqh0eyi0ADkcqTg0EZsGbXwP8AfaezwXbKSAmmtVT1SfOexbtj/YZJ910LKr5g4Fg1RAnac+RQ6LljKEoVaq3qzIviDLgeoiqjfw0G1PH4KozDafuc7GGQOAHTEwRoJOiANdfCylDReEpDcFtwLaqbhCsmLiVAq6fY2KPryP8ETusKyTtfJHmiPJ6Cnf4idH/l3J+zZvJF9r7luPlR84Sr2nQxRHSmFGZNCps+a/QNU2hFzWYvrAO7Eo/YycET8E/Q1f8JAs8OiEgXoF6U6Y7GOfN2O7J8GwZo2SJ15Dc6+c6/j+/wVj4Bv2v2m108kz0L7kQT7ZOeHD0H79q34+X5OvXGTJsP8O5ZBqKSUnZMhbpo92eCWGp9Cn7BFLIsUvmoJtrxyyAsyxJJfY694x7SKwR3lGCDxSnCxpMDT4BKufDkwlZ0PHn/WkRHGlC2CwOVPCK/19KdQ8Weg66Me9TxxBt7c3gYH33rD8pkVX7wSaq6tHzZExcTQcHygFkoKErH8BtTOEhgVmrE3tGwwvdyIRojyk2EDJNr8EUn2UCeKgAv0yufYGcHsPr2fH+g/C517YrB/90723SnV6JYqr64Fnz/AzicXj4Plvy9mrVRP07dRaQthVLEwQhIHeOU8Hnh46UN3+igjqAUXmCmRPXhsJV6fCqlTm4X3+mc8At7Sa3LKyM9v6TwJx870QTqjQNdbr8OWp5+AY+8dhHQqBW4gF/V+59vgCwTQPU2Bx/9WBAeO+gz1zofyCRY/JDVQ6/BjuR/ebdkGkO0B2dZ/BFxgpXwtop5A94bm5P6yTXtP2Pr5fPGPmwntvl8ayiPjMZivhvNK3U9MYkIGSqgXsAglezxNigKOMVO+kurGTKg4p2zM5EXsU2sE38UP5tShlk/KZ35+28twcN8+GE3eT39NWL6jBRxBKSdlTZR+EpEL1UDN01Irnv6+mnUle3UXZJboNDMDKC7yfTPlZ85+AL1v1oO35BpDYNUbwVsyJ+f6p9nUsuvt102VPzYUhBu/fh1UXFIOkydNgOMnP4aHV0Zh0cKbWJmW9Rv+AgffOzx83uurNDyPUk3qAVaQ0lo3q1mTQYHZZ5ALs3oOXVuBAb7ZGA/YiN+baGOzmhFwgJ3yM2ePwiAehJkRBk+ut3VbemZ8fjo8+fgvIBQ61+Ta1+xnhrhv2Xdyyjdt+YeqfB+WDfSi8q+AQY9RQ6Q4KyhY1zWBMGhzKKsi90I9ycoIy68XGiBMM64ydoVacEim/yikMc/PKdMonzN4Av3+AWMGlE7sZj3ELdFHf5yj5BMnP4HVa56De5fdllNOrF7zPGQq5kC6uoGdkwH0kPuwUhi1djvlc7ihkn3mdchVCQd1ON0tYxSuAhf0oRsZwsDK7hcon6M3An2nMk+oEtxALbxsUq62Hl65Cm66/jp2aCGjnPgsA5maBshUzgelbCacLZhueKbdCJfSRyfK51Dd1r9a16EpDQPo+mXMgyJWNzK3U93GPjlkhP7//NygfHI7voseGj7nRuDKV5/n3P1wF6OFXEzXocOGct4r0qh8JXQhK0vPuwcGC43D2rk2BlgbA9ewOGHRC2guyYAEVV4r/6/1+fTZ217P3BAxgAbQQsqnkS2HX+eKH35m4TRwCvl9LaqSn4fbMfDqe8Wj0d+h3y9k7odDhhj0jKWunkO40Fwm+XRRwLWD7nnmVXXiTkRC/Myw12yeXx9wRUbg6JXvz/YCvZEKsI4+TTVD5HpWr1nPBi6iXvHqzn+pv/PEu5BB18PJDBnnG638vxvXo2eF60kcCMumlyTn5QrGAidlTtc/zVzPpi3bDb2ip6dXDbzl1TgDdyHIu9fB/xPe7AK6oReQbycfz/w/tn6rgNufbenc/2t9vhYqoykIu15gpmQKuvpe8eyGTWrgvXYRZHpOg3fTT8Hz5ouYBd3CrssFiqEXWLkYu7GBFU0LzQM8nynVkSQXRJNCQjfEjRC47Ak2iNIqnxQ5GH982B1xI5ChtMovyLqmoWyZMpS0NIDY9TwndD3DgReDLQu8eKQr68HTuZXFAirzCAywL24+5cwXXvKJAzTgMosvMVGhBHF0QVIHWMCNYMh2pt6vxghNdkRG0Cu/EOvSwQ2R7tlvKqts4gShkqmVU84vDLyoZG3gzVD+PyYInld/y879xWmDHKsVLFI+KdItNCq2Cu47DwgKM3BUxnXYneACbcDlgVlrBA5XPocbIXVml+mzH1i2wFC29HsPwry5XzLk/Dzwput1y62YCaWwR0gYjIsP74LABcZZVIsFEwaNXN24IqprN7IWysSlShkU6x6QUx9dh34eR2QEvfKHy0u/gn66U/jsmkiJYfWKDaxwzueBFd/NKecxgf2mfVsNz6IBmIJBuS/2Bwj4PzNcp4m1mKhFZqFeYDe9wKE6dnXJ/wsNIENMLqn/LMYCsQNotlN1R7kZjtYIZsqnGNCHwTmV2MWeoyUUKIDq8tKcMu7fRTGBBV40DJPd9RpLPfWk6u4BamJFRzawQKznmRhYQgrd+1jWrwtmPamMgi7VsTMUrRcLiNNuuux6QFGzJCtN4BDaXMWzIy1kGNFEG1c+h7Ilv2bELOIudD1khLaNT+aUU9n8BUtzyijYpr71M3UCTvs70TgUCz6asRJO9cw2yNj7K5MRqg42HR0/N0bgcztOpqPpnvL7BBdo89aL0hJ1HOD3RsEF5wKzsSfo0SufGDz6G7CC/Hv72/vhhyvuNlxjgVeH1HMKU8+XDOUsE0J3VCW3gQhaoHcCVzgFWjpuvtKZ8gmzNWi2cw7ICyEldcmkokit4AIzI2gRKZ8gFzRgYgQ+3UBBl4KvFu2IV4+MqafeFY31pKHu9ruh4Y6FMK+q23AP+eVG96NXx5DrMQm+a/m2xXMjYZ+32Wks4FgZwUz5HJqm0McCgvz9oltvNKSj2sBrhkypJ64B+CQFrirug9smJWFmqQf/moz+WhG22uhmyx0MeUPKbxY/N85bPzG8KP/IM/39P7ptzIAkw3xwASmRFt4Lxn8DpAJ1gGWnfEZmAAcFA+Ad91XDpcrLZxjm+fe89wns7zoCp08eN32kNNgHM6d/Dm6sCMK0wBB4JXVbyvVVZXDR+AD4CwC2CXI+aqUUDIVTxnlgoXyiEf58biu7YXomsbUoKklsg6wreGBOJ16zV74Gu41ZBG1PeWqXumeA1o13vLAejusW7CdPvxiqr62HMvwkysIBtk2RPrWQy4mKN2o4SimtsN2YpUArbJRyNr2Jtya+EtyRz75QMoJorsgOMpx+i4oe2qBFO+T41sSut96A9u1qcL36hgYov1Rd+aKxxLyZ4w2K12K6UyGLk7VeLTSuaN1iuzWxA7Oe2cZiAYkd4bA0NLQj+2bIeWfMhAWxQNU6mo+yldf5YRI6j306bAgO+fnKzxXDFVPC7LsVp7ohNv4u9kaPpTyaL6LshxZwaJqBG4SnpTSnxAZ1NiNrti80DQscb87l5OuO3CD5p7QWz+1i3RKnRSgdtpXHty3y7enk52kgZ6f4LK2SlHUDC1CeBOf1/4ncjhbbKfpEW3CxpL49EoFRRCooSRZMvLWl8NLHcsYgaITFAKMvD9T3yOgFjdwxT8P5lafdByrC2StKbf4IyJ5mrHwnjBDawg5yUWsm+XFzyYKkMO1FI0RAfUtmxPKy0BinGZUvTrNvRnkSUBo+OvKo1dNbNy9Ltmm900UqhsYQ9KZixM29UkE4mRnoboV+b9RM8Xo0hnAtD9QWSIqPmipezzlD5C8vA1Eniue4MoAWtqFLhlp0T1Vo7Qhb3M99TTUp+yZ0pPs/3um94JqOUXpNlQ7aRhPJHtrXVOmgLJ+m1ztG6TXVWtq5wGQpAnmU2SgoT8bPPF9T/S+t/b7McgGVIAAAAABJRU5ErkJggg==",Nm=({isOpen:e,isLoading:t=!1,onClose:n,accountChains:r,defaultChainId:o,defaultSymbol:s,defaultAccountType:i,balances:c,wagmiHooks:a,onDeposit:l,onCopy:u,onChainChange:f,onTokenChange:p})=>{const{t:d}=Nt(),h=y.useMemo(()=>r.map(K=>({...K,key:Ti(K.key)})),[r]),m=y.useMemo(()=>Ti(i),[i]),v=y.useMemo(()=>{var Q;if(!h||h.length===0)return m;const K=h.find(oe=>oe.key===m);return(K==null?void 0:K.key)||((Q=h[0])==null?void 0:Q.key)||m},[h,m]),[T,E]=y.useState(v),S=y.useCallback(K=>{var Q;return((Q=h.find(oe=>oe.key===K))==null?void 0:Q.chains)||[]},[h]),A=S(v),D=()=>{var pe;if(!A||A.length===0)return{chainId:o||1,token:""};const K=o||((pe=A[0])==null?void 0:pe.chainId),Q=A.find(re=>re.chainId===K)||A[0],oe=(Q==null?void 0:Q.tokenList)||[],ee=(s||"").toUpperCase();if(ee&&oe.length>0){const re=oe.find(Y=>(Y.token||Y.symbol||"").toUpperCase()===ee);if(re)return{chainId:Q.chainId,token:re.token||re.symbol||""}}if(ee)for(const re of A){const he=((re==null?void 0:re.tokenList)||[]).find(ve=>(ve.token||ve.symbol||"").toUpperCase()===ee);if(he)return{chainId:re.chainId,token:he.token||he.symbol||""}}const ue=oe.length>0?Q:A.find(re=>(re.tokenList||[]).length>0)||Q,ce=((ue==null?void 0:ue.tokenList)||[])[0];return{chainId:(ue==null?void 0:ue.chainId)||Q.chainId||1,token:(ce==null?void 0:ce.token)||(ce==null?void 0:ce.symbol)||""}},[{chainId:F,token:L}]=y.useState(()=>D()),[b,g]=y.useState(F),x=y.useMemo(()=>h.find(K=>K.key===T)||h[0],[h,T]),I=y.useMemo(()=>(x==null?void 0:x.chains)||[],[x]),O=y.useMemo(()=>{var ue,ce;if(!x||!Ml(x.account)||!(T===_e.SPOT||T===_e.PERPETUALV2))return!1;const oe=!!((ue=x.walletOptions)!=null&&ue.evm),ee=!!((ce=x.walletOptions)!=null&&ce.mpc);return oe&&ee},[x,T]),k=y.useCallback(()=>{var K,Q;return(K=x==null?void 0:x.walletOptions)!=null&&K.evm?"evm":(Q=x==null?void 0:x.walletOptions)!=null&&Q.mpc||x!=null&&x.account&&ns(x.account)?"mpc":"evm"},[x]),[M,w]=y.useState(()=>O?null:k());y.useEffect(()=>{w(O?null:k())},[T,O,k]);const N=y.useMemo(()=>{if(!x)return;if(!O)return x.account;if(!M)return;const K=x.walletOptions;return M==="mpc"?(K==null?void 0:K.mpc)||x.account:(K==null?void 0:K.evm)||x.account},[x,M,O]),$=y.useMemo(()=>N&&ns(N)?pn:zs,[N]),P=I.find(K=>K.chainId===b)||I[0],[B,j]=y.useState(L),U=y.useCallback(K=>{g(K),f==null||f(K)},[f]),_=y.useCallback(K=>{j(K),p==null||p(K)},[p]),q=y.useMemo(()=>{const K=(B||"").toLowerCase();if(!K)return"0";const Q=(c==null?void 0:c[T])||(T===_e.PERPETUAL?c==null?void 0:c.perp:void 0),oe=Q==null?void 0:Q[K];return typeof oe=="string"&&oe.length>0?oe:"0"},[c,T,B]),[Z,H]=y.useState(!1),W=K=>{K.target===K.currentTarget?H(!0):H(!1)},J=K=>{Z&&K.target===K.currentTarget&&n(),H(!1)};return e?He.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:C.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:W,onMouseUp:J,"aria-hidden":"true",children:C.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:K=>{K.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:d("deposit.title")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:C.jsx(w0,{className:"h-4 w-4"})})]}),C.jsx(Mh,{selectedAccount:T,options:h.map(K=>({value:K.key,label:K.key===_e.SPOT?d("account.spot"):K.key===_e.PERPETUAL?d("account.perpetual-v1"):K.key===_e.PERPETUALV2?d("account.perpetual-v2"):K.key})),onAccountChange:K=>{var he,ve;const Q=K||T;E(Q);const oe=S(Q);if(!oe||oe.length===0)return;const ee=oe.find(Ne=>Ne.chainId===b),ue=ee?ee.chainId:oe[0].chainId;g(ue),f==null||f(ue);const ce=oe.find(Ne=>Ne.chainId===ue),pe=(ce==null?void 0:ce.tokenList)||[],Y=pe.some(Ne=>(Ne.symbol||Ne.token)===B)?B:((he=pe[0])==null?void 0:he.symbol)||((ve=pe[0])==null?void 0:ve.token)||"";Y&&(j(Y),p==null||p(Y))},className:"w-full"}),C.jsx($h,{currentActiveChain:P,chainList:I,onChainChange:U,curSelectToken:B,onTokenChange:_,walletType:$,accountType:T}),O&&!M&&C.jsxs("div",{className:"mb-4",children:[C.jsx("div",{className:"h-[1px] w-full bg-[#404040] my-4"}),C.jsx("button",{type:"button",onClick:()=>w("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:d("deposit.connectedWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Tm,className:"w-12 h-5"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:d("deposit.connectedWalletDesc")})]})}),C.jsxs("div",{className:"flex items-center my-2",children:[C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),C.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:d("deposit.or")}),C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),C.jsx("button",{type:"button",onClick:()=>w("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:d("deposit.externalWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Am,className:"w-12 h-5"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:d("deposit.externalWalletDesc")})]})})]}),(!O||M)&&C.jsxs(C.Fragment,{children:[N&&ns(N)&&C.jsx(BS,{address:N.smartWalletAddress,currentActiveChain:P,selectedToken:B,accountType:T,accountId:N.accountId,accountKey:x==null?void 0:x.key,onDeposit:l,onCopy:u,onClose:n}),N&&Ml(N)&&C.jsx(qS,{address:N.ethAddress,currentActiveChain:P,selectedToken:B,accountType:T,accountId:N.accountId,accountKey:x==null?void 0:x.key,platformBalance:q,isLoading:t,wagmiHooks:a,onChainChange:U,onDeposit:l,onClose:n})]})]})})}),document.body):null},KS=({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}=Nt(),h=y.useMemo(()=>{if(a==="spot"||!wn(r==null?void 0:r.chainId)){const F=new Le(e||"0").minus(s||"0");if(F.isNegative()||F.isZero())return"0";const L=Math.min(F.decimalPlaces()??0,18);return F.decimalPlaces(L,Le.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,a]),m=y.useMemo(()=>o||"0",[o]),v=y.useMemo(()=>{const F=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new Le(F||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),T=y.useMemo(()=>v==="0",[v]),E=y.useMemo(()=>{const F=(t||"").toUpperCase();return F==="USDT"||F==="USDC"},[t]),S=F=>{const L=F.target.value,g=Si(L,m||"0");if(g.isValid)l(g.formattedValue),g.errorType;else return g.errorType==="exceed_balance",void 0;f==null||f(g.formattedValue)},A=()=>{const F=m||"0",b=Si(F,F).formattedValue;l(b),f==null||f(b)},D=()=>{const F=parseFloat(o||"0"),L=parseFloat(e||"0");if(L>0){const b=F-L,g=jt(Math.max(0,b).toString());return C.jsxs("span",{className:"flex items-center gap-1",children:[jt(o||"0"),C.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),g," ",t]})}return`${jt(o||"0")} ${t}`};return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[C.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[C.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"}),C.jsx("button",{onClick:A,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),C.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),C.jsxs("div",{className:"flex justify-between items-center",children:[C.jsx(ar,{content:d("withdraw.availableDesc"),children:C.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),C.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:D()})]})]}),i==="mpc"&&(a==="spot"||!wn(r==null?void 0:r.chainId))?C.jsx("div",{className:"bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3",children:C.jsx("input",{type:"text",placeholder:d("withdraw.receiverAddress"),value:c,onChange:F=>u==null?void 0:u(F.target.value),className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"})}):null,C.jsx("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:wn(r==null?void 0:r.chainId)?C.jsxs(C.Fragment,{children:[C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.noticeDesc")}),C.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")})]}):C.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:d("withdraw.crossChainTips")})}),p&&C.jsxs("div",{className:"flex mb-4",children:[C.jsx("div",{className:"w-5",children:C.jsx("img",{src:es,className:"w-4 h-4",alt:"Warning"})}),C.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d("withdraw.poolBalanceInsufficientTip")})]}),C.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[C.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[C.jsx(ar,{content:C.jsxs("div",{children:[C.jsx("div",{children:d("withdraw.speedNote")}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Xo,{selectedLevel:Rt.FAST,maxLevel:3}),C.jsx("span",{children:d("withdraw.speedNoteSpeed1")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Xo,{selectedLevel:Rt.Medium,maxLevel:3}),C.jsx("span",{children:d("withdraw.speedNoteSpeed2")})]}),C.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[C.jsx(Xo,{selectedLevel:Rt.SLOW,maxLevel:3}),C.jsx("span",{children:d("withdraw.speedNoteSpeed3")})]})]}),children:C.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:d("withdraw.speed")})}),C.jsx("div",{className:"flex items-center",children:C.jsx(Xo,{selectedLevel:wn(r==null?void 0:r.chainId)?Rt.SLOW:Rt.FAST,maxLevel:3})})]}),(a==="spot"||!wn(r==null?void 0:r.chainId))&&C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[T||!E?C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:T?d("withdraw.fee"):`${d("withdraw.fee")}/${d("withdraw.feeRate")}`}):C.jsx(ar,{className:"w-[320px] font-normal flex items-center justify-center",content:C.jsx("span",{className:"flex items-center justify-center text-center",children:d("withdraw.feeCalculationTip")}),children:C.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")}`})}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!T&&` / ${v}%`]})]}),C.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[C.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:d(wn(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),C.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[jt(h)," ",t]})]})]})]})};let nt=null;const Dl={accountChains:[],defaultAccountType:""},Cm=y.forwardRef((e,t)=>{const[n,r]=y.useState(!1),[o,s]=y.useState(!1),[i,c]=y.useState(Dl),a=y.useCallback(h=>{c(h||Dl),r(!0)},[]),l=y.useCallback(h=>{c(m=>({...m,...h}))},[]),u=y.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),f=y.useCallback(h=>{s(h)},[]),p=y.useCallback(()=>n,[n]),d=y.useCallback(()=>o,[o]);return y.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d}),[a,u,l,f,p,d]),y.useEffect(()=>(nt={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:l,setWithdrawLoading:f,isOpen:p,isLoading:d},()=>{nt=null}),[a,u,l,f,p,d]),n?C.jsx(Mm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},accountChains:i.accountChains,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});Cm.displayName="WithdrawManager";const Om=e=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.openWithdraw(e||Dl)},Im=()=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.closeWithdraw()},km=e=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.updateWithdrawOptions(e)},Ai=e=>{if(!nt){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}nt.setWithdrawLoading(e)},ZS=()=>nt?nt.isOpen():!1,$m=()=>nt?nt.isLoading():!1,YS=()=>({openWithdraw:Om,closeWithdraw:Im,updateWithdrawOptions:km,setWithdrawLoading:Ai,isOpen:ZS,isLoading:$m}),XS=({accountChains:e,defaultChainId:t,defaultSymbol:n,defaultAmount:r="",defaultAccountType:o,currentEquity:s,platformBalance:i="0",balances:c,fee:a="0.00",isLoading:l=!1,onWithdraw:u,onClose:f,onChainChange:p,onTokenChange:d,onAmountChanged:h,onAccountChange:m})=>{var re;const{t:v}=Nt(),T=y.useMemo(()=>e.map(Y=>({...Y,key:Ti(Y.key)})),[e]),E=y.useMemo(()=>Ti(o),[o]),S=y.useMemo(()=>{var he;if(!T||T.length===0)return E;const Y=T.find(ve=>ve.key===E);return(Y==null?void 0:Y.key)||((he=T[0])==null?void 0:he.key)||E},[T,E]),[A,D]=y.useState(S),F=y.useCallback(Y=>{var he;return((he=T.find(ve=>ve.key===Y))==null?void 0:he.chains)||[]},[T]),L=y.useMemo(()=>T.find(Y=>Y.key===A)||T[0],[T,A]),b=y.useMemo(()=>(L==null?void 0:L.chains)||[],[L]),g=y.useMemo(()=>{var Qt,ke;if(!L||!Ml(L.account)||!(A===_e.SPOT||A===_e.PERPETUALV2))return!1;const ve=!!((Qt=L.walletOptions)!=null&&Qt.evm),Ne=!!((ke=L.walletOptions)!=null&&ke.mpc);return ve&&Ne},[L,A]),x=y.useCallback(()=>{var Y,he;return(Y=L==null?void 0:L.walletOptions)!=null&&Y.evm?"evm":(he=L==null?void 0:L.walletOptions)!=null&&he.mpc||L!=null&&L.account&&ns(L.account)?"mpc":"evm"},[L]),[I,O]=y.useState(()=>g?null:x());y.useEffect(()=>{O(g?null:x())},[A,g,x]);const k=y.useMemo(()=>{if(!L)return;if(!g)return L.account;if(!I)return;const Y=L.walletOptions;return I==="mpc"?(Y==null?void 0:Y.mpc)||L.account:(Y==null?void 0:Y.evm)||L.account},[L,g,I]),M=y.useMemo(()=>k&&ns(k)?"mpc":"evm",[k]),w=M==="mpc"?pn:zs,N=y.useMemo(()=>{if(!b||b.length===0)return{chainId:1,tokenSymbol:""};const Y=ke=>{const $e=ke||[];if(!$e.length)return"";const rt="USDC".toUpperCase(),Rn=$e.find(Pt=>(Pt.token||Pt.symbol||"").toUpperCase()===rt)||$e[0];return Rn.token||Rn.symbol||""};if(n){const ke=n==null?void 0:n.toUpperCase();for(const $e of b){const cr=$e.tokenList||[];let rt;if(ke&&(rt=cr.find(zt=>(zt.token||zt.symbol||"").toUpperCase()===ke)),rt){const zt=rt.token||rt.symbol||n||"";return{chainId:$e.chainId,tokenSymbol:zt}}}}if(t){const ke=b.find(rt=>rt.chainId===t)||b[0],$e=ke.tokenList||[],cr=Y($e);return{chainId:ke.chainId,tokenSymbol:cr}}const he="USDC",ve=ke=>Array.isArray(ke.tokenList)&&ke.tokenList.some($e=>($e.token||$e.symbol||"").toUpperCase()===he),Ne=b.find(ve)||b[0];if(!Ne)return{chainId:1,tokenSymbol:""};const Qt=Y(Ne.tokenList);return{chainId:Ne.chainId,tokenSymbol:Qt}},[b,t,n]),[$,P]=y.useState(()=>N.chainId),[B,j]=y.useState(()=>N.tokenSymbol),[U,_]=y.useState(r),[q,Z]=y.useState(""),H=y.useCallback(Y=>{P(Y),p==null||p(Y)},[p]),W=y.useCallback(Y=>{j(Y),d==null||d(Y)},[d]),J=y.useRef(!0),K=y.useRef(B),Q=y.useRef($);y.useEffect(()=>{if(J.current){J.current=!1,K.current=B,Q.current=$;return}(K.current!==B||Q.current!==$)&&(_(""),K.current=B,Q.current=$)},[B,$]);const oe=b&&b.length>0?b.find(Y=>Y.chainId===$)||b[0]:null,ee=(re=oe==null?void 0:oe.tokenList)==null?void 0:re.find(Y=>Y.token===B),ue=y.useMemo(()=>{const Y=new Le(U||"0"),he=new Le(a||"0"),ve=wn($);return ee!=null&&ee.minWithdrawSize&&Y.lt(ee.minWithdrawSize)?{text:v("withdraw.minWithdrawParsed",{amount:ee.minWithdrawSize,token:ee.symbol||ee.token}),disabled:!0}:!U||Y.isZero()||!ve&&Y.isLessThan(he)?{text:v("withdraw.confirmWithdraw"),disabled:!0}:M==="mpc"&&(!ve||A==="spot")&&!q.trim()?{text:v("withdraw.invalidReceiverAddress"),disabled:!0}:{text:v("withdraw.confirmWithdraw"),disabled:!1}},[v,$,U,M,q,a,A,ee]),ce=y.useMemo(()=>{const Y=(B||"").toLowerCase();if(!Y)return i||"0";const he=(c==null?void 0:c[A])||(A===_e.PERPETUAL?c==null?void 0:c.perp:void 0),ve=he==null?void 0:he[Y];return typeof ve=="string"&&ve.length>0?ve:i||"0"},[c,A,B,i]),pe=y.useCallback(async()=>{Ai(!0);try{if(u){const he={amount:new Le(U||"0").toString(),chainId:$,tokenAddress:(ee==null?void 0:ee.tokenAddress)||"",coinId:(ee==null?void 0:ee.coinId)||"",tokenSymbol:B,accountType:A,selectedToken:ee};M==="mpc"&&(!wn($)||A==="spot")&&(he.receiverAddress=q),u(he)}}catch{Ai(!1)}},[u,A,ee,U,$,B,M,q]);return!b||b.length===0?C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"No chains available"})}):oe?C.jsxs(C.Fragment,{children:[C.jsx(Mh,{selectedAccount:A,options:T.map(Y=>({value:Y.key,label:Y.key===_e.SPOT?v("account.spot"):Y.key===_e.PERPETUAL?v("account.perpetual-v1"):Y.key===_e.PERPETUALV2?v("account.perpetual-v2"):Y.key})),onAccountChange:Y=>{var zt,Rn;const he=Y||A;D(he),m==null||m(he);const ve=F(he);if(!ve||ve.length===0)return;const Ne=ve.find(Pt=>Pt.chainId===$),Qt=Ne?Ne.chainId:ve[0].chainId;P(Qt),p==null||p(Qt);const ke=ve.find(Pt=>Pt.chainId===Qt),$e=(ke==null?void 0:ke.tokenList)||[],rt=$e.some(Pt=>(Pt.symbol||Pt.token)===B)?B:((zt=$e[0])==null?void 0:zt.symbol)||((Rn=$e[0])==null?void 0:Rn.token)||"";rt&&(j(rt),d==null||d(rt))},className:"w-full"}),C.jsx($h,{currentActiveChain:oe,chainList:b,onChainChange:H,curSelectToken:B,onTokenChange:W,walletType:w,txType:"withdraw"}),g&&!I&&C.jsxs("div",{className:"mb-4",children:[C.jsx("div",{className:"h-[1px] w-full bg-[#404040] my-4"}),C.jsx("button",{type:"button",onClick:()=>O("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:v("withdraw.connectedWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Tm,className:"w-12 h-5",alt:"EVM"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:v("withdraw.connectedWalletDesc")})]})}),C.jsxs("div",{className:"flex items-center my-2",children:[C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),C.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:v("deposit.or")}),C.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),C.jsx("button",{type:"button",onClick:()=>O("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:C.jsxs("div",{className:"flex flex-col gap-2",children:[C.jsxs("div",{className:"flex items-center justify-between gap-3",children:[C.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:v("withdraw.externalWalletTitle")}),C.jsx("div",{className:"flex items-center gap-1 shrink-0",children:C.jsx("img",{src:Am,className:"w-12 h-5",alt:"MPC"})})]}),C.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:v("withdraw.externalWalletDesc")})]})})]}),(!g||I)&&C.jsxs(C.Fragment,{children:[C.jsx(KS,{withdrawAmount:U,curSelectToken:B,tokenInfo:ee,curSelectTokenData:{balance:ee==null?void 0:ee.balance,allowance:ee==null?void 0:ee.allowance},currentActiveChain:oe,currentEquity:s||0,decimals:(ee==null?void 0:ee.decimals)||6,platformBalance:ce,fee:a,walletType:M,accountType:A,receiverAddress:q,onWithdrawAmountChange:_,onReceiverAddressChange:Z,onAmountChanged:h}),C.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${ue.disabled||l?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:pe,disabled:ue.disabled||l,children:[l&&C.jsx(ts,{size:"xs"}),ue.text]})]})]}):C.jsx("div",{className:"text-center py-8",children:C.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Mm=({isOpen:e,isLoading:t=!1,defaultAccountType:n,onClose:r,config:o,accountChains:s,defaultChainId:i,defaultSymbol:c,defaultAmount:a="",currentEquity:l=5e3,platformBalance:u="0",balances:f,fee:p,wagmiHooks:d,onWithdraw:h,onChainChange:m,onTokenChange:v,onAmountChanged:T,onAccountChange:E})=>{const{t:S}=Nt(),[A,D]=y.useState(!1),F=b=>{b.target===b.currentTarget?D(!0):D(!1)},L=b=>{A&&b.target===b.currentTarget&&r(),D(!1)};return e?He.createPortal(C.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:C.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:F,onMouseUp:L,"aria-hidden":"true",children:C.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:b=>{b.stopPropagation()},children:[C.jsxs("div",{className:"flex items-center justify-between mb-4",children:[C.jsx("h2",{className:"text-lg font-semibold text-white",children:S("withdraw.withdraw")}),C.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:C.jsx(w0,{className:"h-4 w-4"})})]}),C.jsx(XS,{accountChains:s,defaultChainId:i,defaultSymbol:c,defaultAmount:a,defaultAccountType:n,currentEquity:l,platformBalance:u,balances:f,fee:p,isLoading:t,wagmiHooks:d,onWithdraw:h,onClose:r,onChainChange:m,onTokenChange:v,onAmountChanged:T,onAccountChange:E})]})})}),document.body):null};ae.ChromeLoader=ts,ae.ComponentProvider=sb,ae.DEFAULT_LOCALE=os,ae.Deposit=Nm,ae.DepositManager=vm,ae.LOCALE_NAMES=nb,ae.LoadingSpinner=ts,ae.SUPPORTED_LOCALES=Ci,ae.Tooltip=ar,ae.Withdraw=Mm,ae.WithdrawManager=Cm,ae.closeDeposit=xm,ae.closeWithdraw=Im,ae.formatThousands=ab,ae.isDepositLoading=Sm,ae.isWithdrawLoading=$m,ae.openDeposit=wm,ae.openWithdraw=Om,ae.setDepositLoading=Pi,ae.setWithdrawLoading=Ai,ae.updateDepositOptions=Em,ae.updateWithdrawOptions=km,ae.useComponentConfig=Gl,ae.useDeposit=P5,ae.useDepositManager=_S,ae.useTranslation=Nt,ae.useWithdraw=T5,ae.useWithdrawManager=YS,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
187
187
  //# sourceMappingURL=index.umd.js.map