@dodoex/widgets 3.0.2-zetachain.65 → 3.0.2-zetachain.66
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/{helper-IsDVw6HA.js → helper-DEwixHKL.js} +1 -1
- package/dist/{helper-D4r1rHLq.cjs → helper-gAcilzSP.cjs} +1 -1
- package/dist/{index-DrCa7BsT.cjs → index-6I0PA0zd.cjs} +1 -1
- package/dist/{index-DPqGYJ1j.js → index-BrGDxVVy.js} +1 -1
- package/dist/{index-B9rLKDFQ.cjs → index-CWdtJLrZ.cjs} +1 -1
- package/dist/{index-JWO9aEsP.js → index-Ctl1ZVSq.js} +1 -1
- package/dist/index-Dj5Qez4C.cjs +31 -0
- package/dist/index-Dqy2oEgI.js +31 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/types/components/Widget/index.d.ts +1 -0
- package/dist/types/constants/chainList.d.ts +1 -0
- package/package.json +2 -2
- package/dist/index-BC63njL_.cjs +0 -31
- package/dist/index-DKNQo7gl.js +0 -31
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";var e=require("@lingui/react"),t=require("@dodoex/components"),n=require("react"),i=require("lodash"),o=require("@lingui/core"),r=require("@dodoex/api"),a=require("@reown/appkit-utils"),s=require("bignumber.js"),l=require("@solana/web3.js"),d=require("@reown/appkit/networks"),c=require("@tanstack/react-query"),u=require("zustand"),p=require("@dodoex/dodo-contract-request"),h=require("@ethersproject/providers"),m=require("@reown/appkit/react"),x=require("@ethersproject/bignumber"),g=require("axios"),f=require("@ethersproject/contracts"),y=require("react-dom"),v=require("identicon.js"),b=require("@bitcoinerlab/secp256k1"),C=require("bitcoinjs-lib"),j=require("dayjs"),w=require("@dodoex/contract-request"),k=require("react-transition-group"),T=require("recharts"),B=require("react-window"),E=require("jsbi"),I=require("tiny-invariant"),A=require("@ethersproject/units"),S=require("react-infinite-scroller"),L=require("@uniswap/sdk-core"),M=require("@uniswap/v2-sdk"),R=require("d3");function O(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var P=O(n),_=O(C);function D(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function N(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}var F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function U(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,V={exports:{}},W={};var H,Z={};
|
|
2
|
+
/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.development.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/"production"===process.env.NODE_ENV?V.exports=function(){if(q)return W;q=1;var e=n,t=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,n,i){var s,l={},d=null,c=null;for(s in void 0!==i&&(d=""+i),void 0!==n.key&&(d=""+n.key),void 0!==n.ref&&(c=n.ref),n)o.call(n,s)&&!a.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:d,ref:c,props:l,_owner:r.current}}return W.Fragment=i,W.jsx=s,W.jsxs=s,W}():V.exports=(H||(H=1,"production"!==process.env.NODE_ENV&&function(){var e=n,t=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),x=Symbol.iterator,g="@@iterator",f=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];!function(e,t,n){var i=f.ReactDebugCurrentFrame.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var o=n.map((function(e){return String(e)}));o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var v,b=!1,C=!1,j=!1,w=!1,k=!1;function T(e){return e.displayName||"Context"}function B(e){if(null==e)return null;if("number"==typeof e.tag&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case i:return"Portal";case a:return"Profiler";case r:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return T(e)+".Consumer";case s:return T(e._context)+".Provider";case d:return function(e,t,n){var i=e.displayName;if(i)return i;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:B(e.type)||"Memo";case h:var n=e,m=n._payload,x=n._init;try{return B(x(m))}catch(e){return null}}return null}v=Symbol.for("react.module.reference");var E,I,A,S,L,M,R,O=Object.assign,P=0;function _(){}_.__reactDisabledLog=!0;var D,N=f.ReactCurrentDispatcher;function F(e,t,n){if(void 0===D)try{throw Error()}catch(e){var i=e.stack.trim().match(/\n( *(at )?)/);D=i&&i[1]||""}return"\n"+D+e}var U,q=!1,V="function"==typeof WeakMap?WeakMap:Map;function W(e,t){if(!e||q)return"";var n,i=U.get(e);if(void 0!==i)return i;q=!0;var o,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=N.current,N.current=null,function(){if(0===P){E=console.log,I=console.info,A=console.warn,S=console.error,L=console.group,M=console.groupCollapsed,R=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}P++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),l=n.stack.split("\n"),d=s.length-1,c=l.length-1;d>=1&&c>=0&&s[d]!==l[c];)c--;for(;d>=1&&c>=0;d--,c--)if(s[d]!==l[c]){if(1!==d||1!==c)do{if(d--,--c<0||s[d]!==l[c]){var u="\n"+s[d].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),"function"==typeof e&&U.set(e,u),u}}while(d>=1&&c>=0);break}}}finally{q=!1,N.current=o,function(){if(0==--P){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:O({},e,{value:E}),info:O({},e,{value:I}),warn:O({},e,{value:A}),error:O({},e,{value:S}),group:O({},e,{value:L}),groupCollapsed:O({},e,{value:M}),groupEnd:O({},e,{value:R})})}P<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}var p=e?e.displayName||e.name:"",h=p?F(p):"";return"function"==typeof e&&U.set(e,h),h}function H(e,t,n){if(null==e)return"";if("function"==typeof e)return W(e,!(!(i=e.prototype)||!i.isReactComponent));var i;if("string"==typeof e)return F(e);switch(e){case c:return F("Suspense");case u:return F("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case d:return W(e.render,!1);case p:return H(e.type,t,n);case h:var o=e,r=o._payload,a=o._init;try{return H(a(r),t,n)}catch(e){}}return""}U=new V;var z=Object.prototype.hasOwnProperty,$={},G=f.ReactDebugCurrentFrame;function Q(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);G.setExtraStackFrame(n)}else G.setExtraStackFrame(null)}var Y=Array.isArray;function X(e){return Y(e)}function K(e){return""+e}function J(e){if(function(e){try{return K(e),!1}catch(e){return!0}}(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),K(e)}var ee,te,ne,ie=f.ReactCurrentOwner,oe={key:!0,ref:!0,__self:!0,__source:!0};ne={};var re=function(e,n,i,o,r,a,s){var l={$$typeof:t,type:e,key:n,ref:i,props:s,_owner:a,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function ae(e,t,n,i,o){var r,a={},s=null,l=null;for(r in void 0!==n&&(J(n),s=""+n),function(e){if(z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(J(t.key),s=""+t.key),function(e){if(z.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(l=t.ref,function(e,t){if("string"==typeof e.ref&&ie.current&&t&&ie.current.stateNode!==t){var n=B(ie.current.type);ne[n]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(ie.current.type),e.ref),ne[n]=!0)}}(t,o)),t)z.call(t,r)&&!oe.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps){var d=e.defaultProps;for(r in d)void 0===a[r]&&(a[r]=d[r])}if(s||l){var c="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var n=function(){ee||(ee=!0,y("%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,c),l&&function(e,t){var n=function(){te||(te=!0,y("%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,c)}return re(e,s,l,o,i,ie.current,a)}var se,le=f.ReactCurrentOwner,de=f.ReactDebugCurrentFrame;function ce(e){if(e){var t=e._owner,n=H(e.type,e._source,t?t.type:null);de.setExtraStackFrame(n)}else de.setExtraStackFrame(null)}function ue(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function pe(){if(le.current){var e=B(le.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}se=!1;var he={};function me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=pe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!he[n]){he[n]=!0;var i="";e&&e._owner&&e._owner!==le.current&&(i=" It was passed a child from "+B(e._owner.type)+"."),ce(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),ce(null)}}}function xe(e,t){if("object"==typeof e)if(X(e))for(var n=0;n<e.length;n++){var i=e[n];ue(i)&&me(i,t)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=x&&e[x]||e[g];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var r,a=o.call(e);!(r=a.next()).done;)ue(r.value)&&me(r.value,t)}}function ge(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==d&&n.$$typeof!==p)return;t=n.propTypes}if(t){var i=B(n);!function(e,t,n,i,o){var r=Function.call.bind(z);for(var a in e)if(r(e,a)){var s=void 0;try{if("function"!=typeof e[a]){var l=Error((i||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=e[a](t,a,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(Q(o),y("%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).",i||"React class",n,a,typeof s),Q(null)),s instanceof Error&&!(s.message in $)&&($[s.message]=!0,Q(o),y("Failed %s type: %s",n,s.message),Q(null))}}(t,e.props,"prop",i,e)}else void 0===n.PropTypes||se||(se=!0,y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",B(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var fe={};function ye(e,n,i,x,g,f){var T=function(e){return"string"==typeof e||"function"==typeof e||!!(e===o||e===a||k||e===r||e===c||e===u||w||e===m||b||C||j)||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===d||e.$$typeof===v||void 0!==e.getModuleId)}(e);if(!T){var E,I="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),I+=pe(),null===e?E="null":X(e)?E="array":void 0!==e&&e.$$typeof===t?(E="<"+(B(e.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,I)}var A=ae(e,n,i,g,f);if(null==A)return A;if(T){var S=n.children;if(void 0!==S)if(x)if(X(S)){for(var L=0;L<S.length;L++)xe(S[L],e);Object.freeze&&Object.freeze(S)}else y("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 xe(S,e)}if(z.call(n,"key")){var M=B(e),R=Object.keys(n).filter((function(e){return"key"!==e})),O=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";fe[M+O]||(y('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',O,M,R.length>0?"{"+R.join(": ..., ")+": ...}":"{}",M),fe[M+O]=!0)}return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var i=t[n];if("children"!==i&&"key"!==i){ce(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),ce(null);break}}null!==e.ref&&(ce(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),ce(null))}(A):ge(A),A}var ve=function(e,t,n){return ye(e,t,n,!1)},be=function(e,t,n){return ye(e,t,n,!0)};Z.Fragment=o,Z.jsx=ve,Z.jsxs=be}()),Z);var z=V.exports;const $=n.createContext(null);function G(e){var{children:t}=e,n=D(e,["children"]);return z.jsx($.Provider,{value:n,children:t})}function Q(e){const t=n.useContext($);if(!t)throw new Error("Missing UserOptionsContext.Provider in the tree");const i=(null!=e?e:e=>e)(t);return n.useMemo((()=>i),[i])}function Y(e){const{EmptyDataIcon:n}=Q();return n?z.jsx(n,{...e}):z.jsx(t.EmptyDataIcon,{...e})}function X({sx:n,hasSearch:i,emptyText:o}){return z.jsxs(t.Box,{sx:Object.assign({display:"flex",flexDirection:"column",gap:12,justifyContent:"center",alignItems:"center",typography:"body2",fontWeight:500,color:"text.secondary",textAlign:"center"},n),children:[z.jsx(Y,{hasSearch:i,sx:{width:60,height:60,borderRadius:12}}),z.jsx(t.Box,{children:null!=o?o:z.jsx(e.Trans,{id:"AxPAXW",message:"No results found"})})]})}var K,J;function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ee.apply(null,arguments)}const te=e=>P.createElement("svg",ee({width:60,height:60,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),P.createElement("g",{opacity:.5},P.createElement("mask",{id:"mask0_3521_179418",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:60,height:60},K||(K=P.createElement("rect",{width:60,height:60,rx:16,fill:"white"}))),J||(J=P.createElement("g",{mask:"url(#mask0_3521_179418)"},P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 30.0352H60V16.0352C60 7.1986 52.8366 0.0351562 44 0.0351562H16C7.16344 0.0351562 0 7.1986 0 16.0352V30.0352Z",fill:"#727272",fillOpacity:.4}),P.createElement("path",{d:"M29.4643 4H16C9.37258 4 4 9.37258 4 16V27H27.1154L31.7914 18.7271L23.1831 13.6634L29.4643 4Z",fill:"#727272",fillOpacity:.4}),P.createElement("path",{d:"M31.7101 27H56V16C56 9.37258 50.6274 4 44 4H34.0384L34.1766 4.08987L28.8164 12.3364L37.2081 17.2727L31.7101 27Z",fill:"#727272",fillOpacity:.4}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 44C0 52.8366 7.16344 60 16 60H44C52.8366 60 60 52.8366 60 44V30H0V44Z",fill:"#ABABAB",fillOpacity:.4}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M59.4395 44.8861C59.4395 53.0965 52.7625 59.7526 44.5257 59.7526C36.2891 59.7526 29.6118 53.0965 29.6118 44.8861C29.6118 36.6756 36.2891 30.0195 44.5257 30.0195C52.7625 30.0195 59.4395 36.6756 59.4395 44.8861Z",fill:"#727272",fillOpacity:.4}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.8277 44.8665C29.8277 53.077 23.1507 59.7331 14.9139 59.7331C6.67727 59.7331 0 53.077 0 44.8665C0 36.6561 6.67727 30 14.9139 30C23.1507 30 29.8277 36.6561 29.8277 44.8665Z",fill:"#727272",fillOpacity:.4}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.9177 44.8883C51.9177 48.958 48.6082 52.257 44.5255 52.257C40.4431 52.257 37.1333 48.958 37.1333 44.8883C37.1333 40.8186 40.4431 37.5195 44.5255 37.5195C48.6082 37.5195 51.9177 40.8186 51.9177 44.8883Z",fill:"#444446"})))));function ne({sx:n,refresh:o}){return z.jsxs(t.Box,{sx:i.merge({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},n),children:[z.jsx(t.Box,{component:te,sx:{display:"inline-block",width:60,height:60,mb:12}}),z.jsx(t.Box,{sx:{typography:"body2",width:252,textAlign:"center"},children:z.jsx(t.Box,{component:"span",sx:{color:"text.secondary"},children:z.jsx(e.Trans,{id:"Vmw6BM",message:"Something went wrong…<0>Refresh again</0>",components:{0:z.jsx(t.HoverOpacity,{component:"span",color:"primary.main",weak:!0,sx:{cursor:"pointer"},onClick:()=>{o()}})}})})})]})}var ie,oe={},re={exports:{}};(ie=re).exports=function(e){return e&&e.__esModule?e:{default:e}},ie.exports.__esModule=!0,ie.exports.default=ie.exports;var ae,se,le=re.exports,de={},ce={};function ue(){if(ae)return ce;ae=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.default=void 0;var e=n,t=z;var i=function(n,i){const o=(e,o)=>(0,t.jsx)("svg",{"data-testid":"".concat(i,"Icon"),viewBox:"0 0 24 24",width:"24px",height:"24px",ref:o,...e,children:n});return"production"!==process.env.NODE_ENV&&(o.displayName="".concat(i,"Icon")),(0,e.memo)((0,e.forwardRef)(o))};return ce.default=i,ce}var pe,he={};var me,xe={};var ge,fe={};var ye,ve={};var be,Ce={};var je,we={};var ke,Te={};var Be,Ee={};var Ie,Ae={};var Se,Le={};var Me,Re={};var Oe,Pe={};var _e,De={};var Ne,Fe={};var Ue,qe={};var Ve,We={};function He(){if(Ve)return We;Ve=1;var e=le;Object.defineProperty(We,"__esModule",{value:!0}),We.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M8.381 5.1429h6.8572V4h2.2857v1.1429h3.4286V20H2.6667V5.1429h3.4286V4H8.381v1.1429ZM4.9525 7.4286v10.2857h13.7143V7.4286H4.9525Zm4.5714 1.1428v2.2857H6.0953V8.5714H9.524Z"}),"Date");return We.default=i,We}var Ze,ze={};var $e,Ge={};var Qe,Ye={};var Xe,Ke={};var Je,et={};var tt,nt={};var it,ot={};var rt,at={};var st,lt={};var dt,ct={};var ut,pt={};var ht,mt={};var xt,gt={};var ft,yt={};var vt,bt={};var Ct,jt={};var wt,kt={};var Tt,Bt={};function Et(){if(Tt)return Bt;Tt=1;var e=le;Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M18.8793 6.1513 14.0305 11l4.8488 4.8487-1.6163 1.6163-4.8487-4.8488-4.8487 4.8488-1.6163-1.6163L10.7981 11 5.9493 6.1513 7.5656 4.535l4.8487 4.8488L17.263 4.535l1.6163 1.6163Z"}),"Error");return Bt.default=i,Bt}var It,At={};var St,Lt={};var Mt,Rt={};var Ot,Pt={};var _t,Dt={};var Nt,Ft={};var Ut,qt={};var Vt,Wt={};var Ht,Zt={};var zt,$t={};var Gt,Qt={};var Yt,Xt={};var Kt,Jt={};var en,tn={};var nn,on={};var rn,an={};var sn,ln={};var dn,cn={};var un,pn={};var hn,mn={};var xn,gn={};var fn,yn={};var vn,bn={};var Cn,jn={};var wn,kn={};var Tn,Bn={};var En,In={};var An,Sn={};var Ln,Mn={};var Rn,On={};var Pn,_n={};var Dn,Nn={};var Fn,Un={};var qn,Vn={};var Wn,Hn={};var Zn,zn={};var $n,Gn={};var Qn,Yn={};var Xn,Kn={};var Jn,ei={};var ti,ni={};var ii,oi={};var ri,ai={};var si,li={};var di,ci={};var ui,pi={};var hi,mi={};var xi,gi={};var fi,yi={};var vi,bi={};var Ci,ji={};var wi,ki={};var Ti,Bi={};!function(e){var t=le;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Alarm",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"ArrowBack",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"ArrowRight",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"ArrowSubmit",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"ArrowTopRight",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"ArrowTopRightBorder",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"ArrowTopRightBorderButton",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"Article",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"AttentionFilled",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"BridgeDark",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"BridgeLight",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"CareersAtDodo",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"CaretUp",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"Clear",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"Copy",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"DailyMount",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"Date",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"Delete",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"DetailBorder",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"Disconnect",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(e,"Document",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"Dodo",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"DodoToken",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"Dollar",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(e,"DollarBorder",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"DollarFilled",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"Done",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"DoneBorder",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"DoneFilled",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"DoubleArrow",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(e,"DoubleArrowBorder",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"DoubleRight",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"Edit",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"Endpoint",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"Error",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"ErrorBorder",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(e,"ErrorFilled",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(e,"ErrorWarn",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"ExpertMode",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(e,"FailedList",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(e,"Fee",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(e,"FeeDividend",{enumerable:!0,get:function(){return W.default}}),Object.defineProperty(e,"FeeDividendPercentage",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(e,"GasFee",{enumerable:!0,get:function(){return Z.default}}),Object.defineProperty(e,"Hot",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(e,"HotFilled",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(e,"InvalidFilled",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(e,"Language",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(e,"LastingDays",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(e,"Link",{enumerable:!0,get:function(){return J.default}}),Object.defineProperty(e,"Loading",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(e,"Lock",{enumerable:!0,get:function(){return te.default}}),Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(e,"Minus",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(e,"MoonPay",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(e,"More",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(e,"NoFound",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(e,"NoResult",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(e,"NoToken",{enumerable:!0,get:function(){return Ve.default}}),Object.defineProperty(e,"Notice",{enumerable:!0,get:function(){return We.default}}),Object.defineProperty(e,"PlayCircleFilled",{enumerable:!0,get:function(){return Tt.default}}),Object.defineProperty(e,"Plus",{enumerable:!0,get:function(){return Bt.default}}),Object.defineProperty(e,"PriceComparison",{enumerable:!0,get:function(){return Ei.default}}),Object.defineProperty(e,"PriceRoute",{enumerable:!0,get:function(){return Ii.default}}),Object.defineProperty(e,"Profile",{enumerable:!0,get:function(){return Ai.default}}),Object.defineProperty(e,"Protect",{enumerable:!0,get:function(){return Si.default}}),Object.defineProperty(e,"QuestionBorder",{enumerable:!0,get:function(){return Li.default}}),Object.defineProperty(e,"Refresh",{enumerable:!0,get:function(){return Mi.default}}),Object.defineProperty(e,"Route",{enumerable:!0,get:function(){return Ri.default}}),Object.defineProperty(e,"Search",{enumerable:!0,get:function(){return Oi.default}}),Object.defineProperty(e,"Setting",{enumerable:!0,get:function(){return Pi.default}}),Object.defineProperty(e,"SettingCrossChain",{enumerable:!0,get:function(){return _i.default}}),Object.defineProperty(e,"Share",{enumerable:!0,get:function(){return Di.default}}),Object.defineProperty(e,"Slippage",{enumerable:!0,get:function(){return Ni.default}}),Object.defineProperty(e,"Star",{enumerable:!0,get:function(){return Fi.default}}),Object.defineProperty(e,"StarFilled",{enumerable:!0,get:function(){return Ui.default}}),Object.defineProperty(e,"Switch",{enumerable:!0,get:function(){return qi.default}}),Object.defineProperty(e,"ThemeModeDark",{enumerable:!0,get:function(){return Vi.default}}),Object.defineProperty(e,"ThemeModeLight",{enumerable:!0,get:function(){return Wi.default}}),Object.defineProperty(e,"Time",{enumerable:!0,get:function(){return Hi.default}}),Object.defineProperty(e,"TokenPair",{enumerable:!0,get:function(){return Zi.default}}),Object.defineProperty(e,"TokenSingle",{enumerable:!0,get:function(){return zi.default}}),Object.defineProperty(e,"TotalLiquidity",{enumerable:!0,get:function(){return $i.default}}),Object.defineProperty(e,"Traders",{enumerable:!0,get:function(){return Gi.default}}),Object.defineProperty(e,"VDODO",{enumerable:!0,get:function(){return Qi.default}}),Object.defineProperty(e,"Volume",{enumerable:!0,get:function(){return Yi.default}}),Object.defineProperty(e,"Warn",{enumerable:!0,get:function(){return Xi.default}});var n=t(function(){if(se)return de;se=1;var e=le;Object.defineProperty(de,"__esModule",{value:!0}),de.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M12 5.99 19.53 19H4.47L12 5.99M12 2 1 21h22L12 2Zm1 14h-2v2h2v-2Zm0-6h-2v4h2v-4Z"}),"Alarm");return de.default=i,de}()),i=t(function(){if(pe)return he;pe=1;var e=le;Object.defineProperty(he,"__esModule",{value:!0}),he.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2Z"}),"ArrowBack");return he.default=i,he}()),o=t(function(){if(me)return xe;me=1;var e=le;Object.defineProperty(xe,"__esModule",{value:!0}),xe.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M9.645 5 8 6.645 13.3433 12 8 17.355 9.645 19l7-7-7-7Z"}),"ArrowRight");return xe.default=i,xe}()),r=t(function(){if(ge)return fe;ge=1;var e=le;Object.defineProperty(fe,"__esModule",{value:!0}),fe.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"m8.3787 10.7197 3.7123-3.7124 3.7123 3.7124-1.0606 1.0606-1.966-1.966v5.8809h-1.5V9.943l-1.8373 1.8373-1.0607-1.0606Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M24 11.9999c0 6.6275-5.3726 12-12 12s-12-5.3725-12-12c0-6.6274 5.3726-12 12-12s12 5.3726 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5s-10.5-4.701-10.5-10.5 4.701-10.5 10.5-10.5S22.5 6.201 22.5 12Z",clipRule:"evenodd"},"1")],"ArrowSubmit");return fe.default=i,fe}()),a=t(function(){if(ye)return ve;ye=1;var e=le;Object.defineProperty(ve,"__esModule",{value:!0}),ve.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"m18.8572 7.5672.0244-.0244-.0244-.0243V5.1428h-2.3756l-.0244-.0243-.0244.0244H8.5715v3.4285h4.4328l-8.5714 8.5714 2.4243 2.4244 8.5715-8.5714v4.4328h3.4285V7.5672Z"}),"ArrowTopRight");return ve.default=i,ve}()),s=t(function(){if(be)return Ce;be=1;var e=le;Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 5v14h14v-7h2v7c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h7v2H5Zm9 0V3h7v7h-2V6.41l-9.83 9.83-1.41-1.41L17.59 5H14Z",clipRule:"evenodd"}),"ArrowTopRightBorder");return Ce.default=i,Ce}()),l=t(function(){if(je)return we;je=1;var e=le;Object.defineProperty(we,"__esModule",{value:!0}),we.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M6.8574 6.5142a.3429.3429 0 0 0-.3428.3429v10.2857c0 .1893.1535.3428.3428.3428h10.2858a.3428.3428 0 0 0 .3428-.3428v-4.5195h2.7429v4.5195c0 1.7041-1.3815 3.0857-3.0857 3.0857H6.8574c-1.7042 0-3.0857-1.3815-3.0857-3.0857V6.857c0-1.7042 1.3815-3.0857 3.0857-3.0857h4.5195v2.7429H6.8574Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M17.486 8.4668v1.8188h2.7429V3.7713h-6.5143v2.7429h1.8451l-6.3991 6.3991L11.1 14.8528l6.3859-6.386Z"},"1")],"ArrowTopRightBorderButton");return we.default=i,we}()),d=t(function(){if(ke)return Te;ke=1;var e=le;Object.defineProperty(Te,"__esModule",{value:!0}),Te.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 3h14c1.1 0 2 .9 2 2v14c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2Zm2 14h7v-2H7v2Zm10-4H7v-2h10v2ZM7 9h10V7H7v2Z",clipRule:"evenodd"}),"Article");return Te.default=i,Te}()),c=t(function(){if(Be)return Ee;Be=1;var e=le;Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"#E94D6A",d:"M12 2.6667C6.848 2.6667 2.6667 6.848 2.6667 12c0 5.152 4.1813 9.3333 9.3333 9.3333 5.152 0 9.3333-4.1813 9.3333-9.3333 0-5.152-4.1813-9.3333-9.3333-9.3333Zm1.3333 14.6666h-2.6666v-2.6666h2.6666v2.6666Zm0-4h-2.6666V6.6667h2.6666v6.6666Z"}),"AttentionFilled");return Ee.default=i,Ee}()),u=t(function(){if(Ie)return Ae;Ie=1;var e=le;Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"url(#a)",fillRule:"evenodd",d:"M12 5.48A6.48 6.48 0 0 1 14.48 5C19.81 5 24 11.3702 24 19.5202h-3.69c0-4.93-1.83-8.7-3.93-10.16a3.35 3.35 0 0 0-1.9-.67A3.71 3.71 0 0 0 12 9.83c-1.84 1.69-3.35 5.22-3.35 9.69H5A19.18 19.18 0 0 1 7.63 9.34 9.54 9.54 0 0 1 12 5.48Zm-2.85-.47C4 5.26 0 11.5602 0 19.5202h3.12c0-6.38 2.42-11.79 6.03-14.51Zm5.33 5.5201a1.9999 1.9999 0 0 0-1.31.71 15.2104 15.2104 0 0 1 2.18 8.28h3.11c0-5.58-2.58-8.99-3.98-8.99Z",clipRule:"evenodd"},"0"),(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:"a",x1:"24",x2:"0",y1:"19.2601",y2:"19.2601",gradientUnits:"userSpaceOnUse",children:[(0,n.jsx)("stop",{"stop-color":"#FFE804"}),(0,n.jsx)("stop",{offset:"1","stop-color":"#BC9CFF"})]})},"1")],"BridgeDark");return Ae.default=i,Ae}()),p=t(function(){if(Se)return Le;Se=1;var e=le;Object.defineProperty(Le,"__esModule",{value:!0}),Le.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"#6851B4",d:"M14.4801 5a6.4795 6.4795 0 0 0-2.48.48 9.5401 9.5401 0 0 0-4.37 3.86A19.18 19.18 0 0 0 5 19.5202h3.65c0-4.47 1.51-8 3.35-9.69a3.7098 3.7098 0 0 1 2.48-1.14c.687.023 1.3504.257 1.9.67 2.1 1.46 3.93 5.23 3.93 10.16H24c0-8.15-4.19-14.52-9.52-14.52Z"},"0"),(0,n.jsx)("path",{fill:"#BC9CFF",d:"M9.15 5.01C4 5.26 0 11.5602 0 19.5202h3.12c0-6.38 2.42-11.79 6.03-14.51Zm5.3299 5.5201a1.9999 1.9999 0 0 0-1.31.71 15.2095 15.2095 0 0 1 2.18 8.28h3.11c0-5.58-2.58-8.99-3.98-8.99Z"},"1")],"BridgeLight");return Le.default=i,Le}()),h=t(function(){if(Me)return Re;Me=1;var e=le;Object.defineProperty(Re,"__esModule",{value:!0}),Re.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M5 21h3v-2H5v-3H3v3c0 1.1.9 2 2 2Zm14-5v3h-3v2h3c1.1 0 2-.9 2-2v-3h-2ZM16 5h3v3h2V5c0-1.1-.9-2-2-2h-3v2ZM5 8V5h3V3H5c-1.1 0-2 .9-2 2v3h2Zm7 4c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M12 13.9c-2 0-6 1.1-6 3.1v1h12v-1c0-2-4-3.1-6-3.1Z"},"1")],"CareersAtDodo");return Re.default=i,Re}()),m=t(function(){if(Oe)return Pe;Oe=1;var e=le;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.584 6.624c.1979-.2968.6341-.2968.832 0l7.0658 10.5987c.2215.3322-.0167.7773-.4161.7773H4.9343c-.3994 0-.6376-.4451-.416-.7774L11.584 6.624Z",clipRule:"evenodd"}),"CaretUp");return Pe.default=i,Pe}()),x=t(function(){if(_e)return De;_e=1;var e=le;Object.defineProperty(De,"__esModule",{value:!0}),De.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("rect",{width:"18",height:"18",fill:"currentColor",opacity:".1",rx:"9"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M11.1213 12.182 9 10.0606 6.8787 12.182 5.818 11.1213 7.9393 9 5.818 6.8787 6.8787 5.818 9 7.9393l2.1213-2.1213 1.0607 1.0607L10.0607 9l2.1213 2.1213-1.0607 1.0607Z"},"1")],"Clear");return De.default=i,De}()),g=t(function(){if(Ne)return Fe;Ne=1;var e=le;Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.1667 2.5H5.3095C4.3143 2.5 3.5 3.3143 3.5 4.3095v12.6667h1.8095V4.3095h10.8572V2.5Zm-.9048 3.619H8.9286c-.9953 0-1.8005.8143-1.8005 1.8096l-.009 11.7619c0 .9952.8052 1.8095 1.8004 1.8095h9.9615c.9952 0 1.8095-.8143 1.8095-1.8095v-8.1429l-5.4286-5.4285ZM8.9286 7.9286v11.7619h9.9524v-7.2381h-4.5239V7.9286H8.9286Z",clipRule:"evenodd"}),"Copy");return Fe.default=i,Fe}()),f=t(function(){if(Ue)return qe;Ue=1;var e=le;Object.defineProperty(qe,"__esModule",{value:!0}),qe.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m12 3.5 8.3553 3.5809c.8081.3463.8081 1.492 0 1.8383L12 12.5 3.6447 8.9191c-.8081-.3463-.8081-1.492 0-1.8383L12 3.5ZM5.9999 8 12 10.5 17.9999 8 12 5.5 5.9999 8Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M3 16.5v-2l9 4 9-4v2l-9 4-9-4Z"},"1"),(0,n.jsx)("path",{fill:"currentColor",d:"M3 10.5v2l8.9999 4L21 12.5v-2l-9.0001 4L3 10.5Z"},"2")],"DailyMount");return qe.default=i,qe}()),y=t(He()),v=t(function(){if(Ze)return ze;Ze=1;var e=le;Object.defineProperty(ze,"__esModule",{value:!0}),ze.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.5 3h-5l-1 1H5v2h14V4h-3.5l-1-1ZM16 9v10H8V9h8ZM6 7h12v12c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V7Z",clipRule:"evenodd"}),"Delete");return ze.default=i,ze}()),b=t(function(){if($e)return Ge;$e=1;var e=le;Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1 5v2h2V7h-2Zm0 4v6h2v-6h-2Zm-7 1c0 4.41 3.59 8 8 8s8-3.59 8-8-3.59-8-8-8-8 3.59-8 8Z",clipRule:"evenodd"}),"DetailBorder");return Ge.default=i,Ge}()),C=t(function(){if(Qe)return Ye;Qe=1;var e=le;Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 3h2v10h-2V3Zm5.41 3.59 1.42-1.42C19.77 6.82 21 9.26 21 12c0 4.97-4.03 9-9 9s-9-4.03-9-9c0-2.74 1.23-5.18 3.17-6.83l1.41 1.41C6.01 7.86 5 9.81 5 12c0 3.87 3.13 7 7 7s7-3.13 7-7c0-2.19-1.01-4.14-2.59-5.41Z",clipRule:"evenodd"}),"Disconnect");return Ye.default=i,Ye}()),j=t(function(){if(Xe)return Ke;Xe=1;var e=le;Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M17 9H7V7h10v2ZM7 13h10v-2H7v2Zm0 4h7v-2H7v2Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm0 2v14H5V5h14Z",clipRule:"evenodd"},"1")],"Document");return Ke.default=i,Ke}()),w=t(function(){if(Je)return et;Je=1;var e=le;Object.defineProperty(et,"__esModule",{value:!0}),et.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"#fff",d:"M15.9898 12.4545a6.3883 6.3883 0 0 0-4.9938-5.6986c.06-.0476.1174-.0982.1721-.1518.4871-.487.6598-1.1036.3861-1.3773-.2457-.2458-.7684-.1302-1.2249.249-.0864-.6764-.4255-1.1825-.8319-1.1825s-.7455.508-.8319 1.1824c-.4565-.381-.9791-.4947-1.2249-.2489-.2737.2737-.1003.889.3861 1.3773.0548.0545.1124.106.1727.1543a6.3882 6.3882 0 0 0-4.9874 5.6974l-.106 1.2535H4.55l.0947-1.1145a4.7491 4.7491 0 0 1 4.7327-4.3473h.2457a4.7492 4.7492 0 0 1 4.7321 4.3473l.0947 1.1145h1.6465l-.1066-1.2548Z"},"0"),(0,n.jsx)("path",{fill:"#fff",d:"M7.8916 12.4538c.3261 0 .5905-.4702.5905-1.0503 0-.5801-.2644-1.0503-.5905-1.0503-.3262 0-.5906.4702-.5906 1.0503 0 .5801.2644 1.0503.5906 1.0503Zm3.2169 0c.3262 0 .5906-.4702.5906-1.0503 0-.5801-.2644-1.0503-.5906-1.0503s-.5906.4702-.5906 1.0503c0 .5801.2644 1.0503.5906 1.0503Z"},"1")],"Dodo");return et.default=i,et}()),k=t(function(){if(tt)return nt;tt=1;var e=le;Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsxs)("linearGradient",{id:"a",x1:"4.5183%",x2:"100%",y1:"-4.3728%",y2:"100%",children:[(0,n.jsx)("stop",{offset:"0","stop-color":"#fffc2c"}),(0,n.jsx)("stop",{offset:"1","stop-color":"#efe806"})]},"0"),(0,n.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,n.jsx)("circle",{cx:"25",cy:"25",r:"25",fill:"url(#a)"}),(0,n.jsx)("path",{fill:"#000",d:"M25.4339 8c1.135 0 2.0552 1.677 2.0552 3.7454 0 .05-.0009.0995-.002.149.6095-.746 1.3206-1.1158 1.8633-.8798.552.2402.7866 1.0462.675 2.0386-.0274.4702-.1406.9866-.3457 1.504-.1189.3-.2602.5773-.416.8273C37.3525 17.2357 43.089 24.0885 42.999 36h-4.923c.0763-10.0963-5.609-15.0813-13.0482-15.2381-8.101-.1706-12.5853 5.3913-13.1044 15.2381H7c.6308-11.961 5.6414-19.249 14.4431-20.6817-.1408-.2106-.4002-.6366-.5159-.8845-.69-1.4773-.5919-2.9986.219-3.398.6483-.3193 1.556.1762 2.2465 1.1432a6.8289 6.8289 0 0 1-.0141-.4336C23.3786 9.677 24.2987 8 25.4339 8zm-4.4956 18.5748c.5932 0 1.0742.551 1.0742 1.2301v3.0216c0 .6795-.481 1.2302-1.0742 1.2302-.5934 0-1.0744-.5507-1.0744-1.2302V27.805c0-.6792.481-1.2301 1.0744-1.2301zm8.5943 0c.5934 0 1.0744.551 1.0744 1.2301v3.0216c0 .6795-.481 1.2302-1.0744 1.2302-.5932 0-1.0742-.5507-1.0742-1.2302V27.805c0-.6792.481-1.2301 1.0742-1.2301z"})]},"1")],"DodoToken");return nt.default=i,nt}()),T=t(function(){if(it)return ot;it=1;var e=le;Object.defineProperty(ot,"__esModule",{value:!0}),ot.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M10.4846 21.4766V19.008h2.7977v2.4686h-2.7977Zm0-16.4366V2.5714h2.7977V5.04h-2.7977Zm1.4194 14.688c-1.056 0-2.0057-.1954-2.8491-.5863-.8366-.3977-1.5189-.96-2.0469-1.6868-.528-.7269-.864-1.5806-1.008-2.5612l2.7771-.432c.1235.5349.3395 1.0046.648 1.4092a3.185 3.185 0 0 0 1.1418.9257c.4594.2126.96.3188 1.5017.3188.5074 0 .9668-.0822 1.3783-.2468.4114-.1646.7337-.3909.9668-.6789.2332-.2948.3497-.6171.3497-.9668 0-.24-.0514-.4526-.1543-.6377-.096-.1852-.2468-.3463-.4525-.4835-.1989-.1371-.456-.2571-.7715-.36l-3.6617-1.1314c-1.0423-.3223-1.8308-.8091-2.3657-1.4606-.5348-.6514-.8023-1.4537-.8023-2.4068 0-.8983.2126-1.68.6377-2.3452.432-.672 1.0423-1.1863 1.8309-1.5428.7886-.3635 1.7143-.5417 2.7771-.5349.9738.0137 1.8412.192 2.6023.5349.768.336 1.4057.8263 1.9132 1.4708.5143.6377.888 1.416 1.1211 2.3349l-2.88.5143c-.096-.4389-.2743-.8229-.5348-1.152-.2606-.336-.5863-.5966-.9772-.7817-.3908-.192-.8194-.2949-1.2857-.3086-.4457-.0137-.8537.0514-1.224.1954-.3703.144-.6651.3463-.8846.6069-.2125.2605-.3188.5485-.3188.864 0 .3634.1508.672.4525.9257.3018.2537.7818.4731 1.44.6583l2.6126.7405c.8777.2538 1.5874.5658 2.1292.936.5417.3635.9394.8023 1.1931 1.3166.2537.5143.3806 1.128.3806 1.8412 0 .9257-.2366 1.7451-.7097 2.4582-.4732.7132-1.1383 1.2686-1.9955 1.6663-.8503.3909-1.8274.5863-2.9314.5863Z"}),"Dollar");return ot.default=i,ot}()),B=t(function(){if(rt)return at;rt=1;var e=le;Object.defineProperty(at,"__esModule",{value:!0}),at.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M10.0002 7c-1.1045 0-2 .8954-2 2v2c0 1.1046.8955 2 2 2h4v2h-6v2h3v1h2v-1h1c1.1046 0 2-.8954 2-2v-2c0-1.1046-.8954-2-2-2h-4V9h6V7h-3V6h-2v1h-1Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.0002 2c-5.5228 0-10 4.4771-10 10 0 5.5228 4.4772 10 10 10 5.5229 0 10-4.4772 10-10 0-5.5229-4.4771-10-10-10Zm-8 10c0-4.4183 3.5818-8 8-8 4.4183 0 8 3.5817 8 8s-3.5817 8-8 8c-4.4182 0-8-3.5817-8-8Z",clipRule:"evenodd"},"1")],"DollarBorder");return at.default=i,at}()),E=t(function(){if(st)return lt;st=1;var e=le;Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm.88 15.76V19h-1.75v-1.29c-.74-.18-2.39-.77-3.02-2.96l1.65-.67c.06.22.58 2.09 2.4 2.09.93 0 1.98-.48 1.98-1.61 0-.96-.7-1.46-2.28-2.03a16.8782 16.8782 0 0 0-.0913-.032l-.003-.0011-.1077-.0374C10.507 12.0604 8.51 11.368 8.51 9.22c0-.1.01-2.4 2.62-2.96V5h1.75v1.24c1.84.32 2.51 1.79 2.66 2.23l-1.58.67c-.11-.35-.59-1.34-1.9-1.34-.7 0-1.81.37-1.81 1.39 0 .95.86 1.31 2.64 1.9 2.4.83 3.01 2.05 3.01 3.45 0 2.63-2.5 3.13-3.02 3.22Z",clipRule:"evenodd"}),"DollarFilled");return lt.default=i,lt}()),I=t(function(){if(dt)return ct;dt=1;var e=le;Object.defineProperty(ct,"__esModule",{value:!0}),ct.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M19.1401 5.3333 8.889 15.5844 4.86 11.5711l-2.1933 2.1933 6.2223 6.2222L21.3334 7.5422l-2.1933-2.2089Z"}),"Done");return ct.default=i,ct}()),A=t(function(){if(ut)return pt;ut=1;var e=le;Object.defineProperty(pt,"__esModule",{value:!0}),pt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 0C5.376 0 0 5.376 0 12s5.376 12 12 12 12-5.376 12-12S18.624 0 12 0Zm-.0003 21.6001c-5.292 0-9.6-4.308-9.6-9.6s4.308-9.6 9.6-9.6 9.6 4.308 9.6 9.6-4.308 9.6-9.6 9.6Zm-1.9233-6.9881 6.716-6.716 1.4369 1.4472-8.1529 8.1529L6 13.4197l1.437-1.437 2.6394 2.6293Z",clipRule:"evenodd"}),"DoneBorder");return pt.default=i,pt}()),S=t(function(){if(ht)return mt;ht=1;var e=le;Object.defineProperty(mt,"__esModule",{value:!0}),mt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#2FBA90"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M16.0162 8.25 10.25 14.0163l-2.2663-2.2576L6.75 12.9925l3.5 3.5 7-7L16.0162 8.25Z"},"1")],"DoneFilled");return mt.default=i,mt}()),L=t(function(){if(xt)return gt;xt=1;var e=le;Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M5.5 3h-5v1.5h9L5.5.75V3Zm-1.25 7.25V8H9.5V6.5h-9l3.75 3.75Z"}),"DoubleArrow");return gt.default=i,gt}()),M=t(function(){if(ft)return yt;ft=1;var e=le;Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12Zm2 0c0 4.4093 3.5893 8 8 8 4.4093 0 8-3.5907 8-8 0-4.4107-3.5907-8-8-8-4.4107 0-8 3.5893-8 8Zm11-5.5V9h-4v2h4v2.5l3.5-3.5L15 6.5ZM5.5 14 9 10.5V13h4v2H9v2.5L5.5 14Z",clipRule:"evenodd"}),"DoubleArrowBorder");return yt.default=i,yt}()),R=t(function(){if(vt)return bt;vt=1;var e=le;Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M5.101 5 3.456 6.645 8.7995 12 3.456 17.355 5.101 19l7.0001-7-7-7Zm9.0001 0-1.645 1.645L17.7994 12l-5.3433 5.355L14.1011 19l7-7-7-7Z"}),"DoubleRight");return bt.default=i,bt}()),O=t(function(){if(Ct)return jt;Ct=1;var e=le;Object.defineProperty(jt,"__esModule",{value:!0}),jt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"m12.8 4 5.7 5.7-7.7 7.7H5.1v-5.7L12.8 4ZM7 12.4v3h3l5.5-5.7-2.7-2.8L7 12.4Zm-2 6h3v2H5v-2Zm4 0h4v2H9v-2Zm5 0h5v2h-5v-2Z"}),"Edit");return jt.default=i,jt}()),P=t(function(){if(wt)return kt;wt=1;var e=le;Object.defineProperty(kt,"__esModule",{value:!0}),kt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M18 7c0 2.2091-1.7909 4-4 4-2.2091 0-4-1.7909-4-4 0-2.2091 1.7909-4 4-4 2.2091 0 4 1.7909 4 4Zm-2 0c0 1.1046-.8954 2-2 2s-2-.8954-2-2 .8954-2 2-2 2 .8954 2 2Zm3.5 0c0 .3415-.0311.6757-.0907 1H21c.5523 0 1-.4477 1-1s-.4477-1-1-1h-1.5907c.0596.3243.0907.6585.0907 1ZM8.5907 8H3c-.5523 0-1-.4477-1-1s.4477-1 1-1h5.5907A5.5311 5.5311 0 0 0 8.5 7c0 .3415.0311.6757.0907 1ZM15 17c0 2.2091-1.7909 4-4 4-2.2091 0-4-1.7909-4-4 0-2.2091 1.7909-4 4-4 2.2091 0 4 1.7909 4 4Zm-2 0c0 1.1046-.8954 2-2 2s-2-.8954-2-2 .8954-2 2-2 2 .8954 2 2Zm3.4093 1a5.5286 5.5286 0 0 0 .0907-1c0-.3415-.0311-.6757-.0907-1H21c.5523 0 1 .4477 1 1s-.4477 1-1 1h-4.5907ZM3 18h2.5907A5.5313 5.5313 0 0 1 5.5 17c0-.3415.0311-.6757.0907-1H3c-.5523 0-1 .4477-1 1s.4477 1 1 1Z",clipRule:"evenodd"}),"Endpoint");return kt.default=i,kt}()),_=t(Et()),D=t(function(){if(It)return At;It=1;var e=le;Object.defineProperty(At,"__esModule",{value:!0}),At.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 0C5.364 0 0 5.364 0 12s5.364 12 12 12 12-5.364 12-12S18.636 0 12 0Zm3.108 7.2L12 10.308 8.892 7.2 7.2 8.892 10.308 12 7.2 15.108 8.892 16.8 12 13.692l3.108 3.108 1.692-1.692L13.692 12 16.8 8.892 15.108 7.2ZM2.4 12c0 5.292 4.308 9.6 9.6 9.6s9.6-4.308 9.6-9.6-4.308-9.6-9.6-9.6S2.4 6.708 2.4 12Z",clipRule:"evenodd"}),"ErrorBorder");return At.default=i,At}()),N=t(function(){if(St)return Lt;St=1;var e=le;Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#EC5A7D"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M16.8897 8.3635 13.2531 12l3.6366 3.6365-1.2122 1.2122-3.6366-3.6365-3.6365 3.6365-1.2122-1.2122L10.8288 12 7.1922 8.3635l1.2122-1.2122 3.6365 3.6365 3.6366-3.6365 1.2122 1.2122Z"},"1")],"ErrorFilled");return Lt.default=i,Lt}()),F=t(function(){if(Mt)return Rt;Mt=1;var e=le;Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m1 21.5 11-19 11 19H1Zm18.53-2L12 6.49 4.47 19.5h15.06Zm-6.53-3h-2v2h2v-2Zm-2-6h2v4h-2v-4Z",clipRule:"evenodd"}),"ErrorWarn");return Rt.default=i,Rt}()),U=t(function(){if(Ot)return Pt;Ot=1;var e=le;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M11.5171 9.7774c0-.8778.7199-1.589 1.6086-1.589.8886 0 1.6085.7112 1.6085 1.589 0 .8777-.7199 1.5889-1.6085 1.5889-.8887 0-1.6086-.7112-1.6086-1.589Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.2743 9.3778C5.4767 5.2667 8.9076 2 13.1258 2 17.4791 2 21 5.4778 21 9.7778c0 3.1-1.8448 5.7778-4.4995 7.0222V22H8.6264v-3.3333H7.5015c-1.2374 0-2.2497-1-2.2497-2.2223v-3.3333H3.5644c-.4612 0-.7311-.5222-.45-.8889l2.1599-2.8444Zm9.9101 3.0444c-.2362.1778-.4836.3222-.7535.4333l-.1799 1.1775a.198.198 0 0 1-.0389.0992c-.0418.0557-.1116.09-.1863.09H12.226c-.1125 0-.2025-.0778-.225-.1889l-.1687-1.1777c-.2812-.1112-.5287-.2556-.7649-.4334l-1.1137.4445c-.1012.0333-.225 0-.2812-.1l-.8999-1.5445c-.0453-.0716-.0395-.1648.0114-.2332a.2188.2188 0 0 1 .045-.0449l.9447-.7331c-.0112-.1444-.0224-.2888-.0224-.4332 0-.1445.0224-.3.045-.4334L8.84 8.6111c-.09-.0667-.1125-.1778-.0562-.2889l.8999-1.5333a.2332.2332 0 0 1 .0158-.0245c.0598-.081.1618-.1063.2544-.0758l1.1248.4444c.225-.1666.4836-.3221.7535-.4332l.1687-1.1776a.2466.2466 0 0 1 .0439-.0991.2235.2235 0 0 1 .1813-.09h1.7998c.1125 0 .2025.0777.225.1888l.1687 1.1778c.27.111.5175.2555.7537.4333l1.1249-.4444c.1012-.0334.2249 0 .2699.1l.8999 1.5333c.0453.0805.0396.1755-.0114.2442a.2143.2143 0 0 1-.0451.045l-.9558.7331c.0337.1333.0449.2777.0449.4332 0 .1445-.0112.2889-.0225.4334l.9337.7333c.09.0667.1125.1778.0562.2778l-.8999 1.5444a.1986.1986 0 0 1-.016.0245c-.0613.0811-.1719.1064-.2542.0759l-1.1136-.4445Z",clipRule:"evenodd"},"1")],"ExpertMode");return Pt.default=i,Pt}()),q=t(function(){if(_t)return Dt;_t=1;var e=le;Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsxs)("g",{opacity:".5",children:[(0,n.jsx)("mask",{id:"a",width:"60",height:"60",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:"mask-type:alpha",children:(0,n.jsx)("rect",{width:"60",height:"60",fill:"#fff",rx:"16"})}),(0,n.jsxs)("g",{mask:"url(#a)",children:[(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",fillRule:"evenodd",d:"M0 30.0352h60v-14c0-8.8366-7.1634-16-16-16H16c-8.8366 0-16 7.1634-16 16v14Z",clipRule:"evenodd"}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M29.4643 4H16C9.3726 4 4 9.3726 4 16v11h23.1154l4.676-8.2729-8.6083-5.0637L29.4643 4Z"}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M31.7101 27H56V16c0-6.6274-5.3726-12-12-12h-9.9616l.1382.0899-5.3602 8.2465 8.3917 4.9363L31.7101 27Z"}),(0,n.jsx)("path",{fill:"#ABABAB",fillOpacity:".4",fillRule:"evenodd",d:"M0 44c0 8.8366 7.1634 16 16 16h28c8.8366 0 16-7.1634 16-16V30H0v14Z",clipRule:"evenodd"}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",fillRule:"evenodd",d:"M59.4395 44.8861c0 8.2104-6.677 14.8665-14.9138 14.8665-8.2366 0-14.9139-6.6561-14.9139-14.8665 0-8.2105 6.6773-14.8666 14.9139-14.8666 8.2368 0 14.9138 6.6561 14.9138 14.8666Z",clipRule:"evenodd"}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",fillRule:"evenodd",d:"M29.8277 44.8665c0 8.2105-6.677 14.8666-14.9138 14.8666C6.6773 59.7331 0 53.077 0 44.8665 0 36.6561 6.6773 30 14.9139 30c8.2368 0 14.9138 6.6561 14.9138 14.8665Z",clipRule:"evenodd"}),(0,n.jsx)("path",{fill:"#444446",fillRule:"evenodd",d:"M51.9177 44.8883c0 4.0697-3.3095 7.3687-7.3922 7.3687-4.0824 0-7.3922-3.299-7.3922-7.3687 0-4.0697 3.3098-7.3688 7.3922-7.3688 4.0827 0 7.3922 3.2991 7.3922 7.3688Z",clipRule:"evenodd"})]})]}),"FailedList");return Dt.default=i,Dt}()),V=t(function(){if(Nt)return Ft;Nt=1;var e=le;Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M12.0008 17.4401C7.5818 17.4401 4 16.1208 4 14v2.1599C4 18.281 7.582 20 12.0008 20S20 18.281 20 16.1599V14c.001 2.1208-3.5801 3.4401-7.9992 3.4401Zm0-4.0001C7.5818 13.44 4 12.121 4 10v2.1601C4 14.2808 7.582 16 12.0008 16S20 14.2806 20 12.1601V10c.001 2.121-3.5801 3.44-7.9992 3.44ZM12.0004 4C7.5816 4 4 5.535 4 7.4286v1.1428C4 10.465 7.5818 12 12.0004 12 16.4189 12 20 10.465 20 8.5714V7.4286C20 5.535 16.4191 4 12.0004 4Z"}),"Fee");return Ft.default=i,Ft}()),W=t(function(){if(Ut)return qt;Ut=1;var e=le;Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M12.0008 17.4401C7.5818 17.4401 4 16.1208 4 14v2.1599C4 18.281 7.582 20 12.0008 20S20 18.281 20 16.1599V14c.001 2.1208-3.5801 3.4401-7.9992 3.4401Zm0-4.0001C7.5818 13.44 4 12.121 4 10v2.1601C4 14.2808 7.582 16 12.0008 16S20 14.2806 20 12.1601V10c.001 2.121-3.5801 3.44-7.9992 3.44ZM12.0004 4C7.5816 4 4 5.535 4 7.4286v1.1428C4 10.465 7.5818 12 12.0004 12 16.4189 12 20 10.465 20 8.5714V7.4286C20 5.535 16.4191 4 12.0004 4Z"}),"FeeDividend");return qt.default=i,qt}()),H=t(function(){if(Vt)return Wt;Vt=1;var e=le;Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M7.009 12C8.7207 12 10 10.9704 10 9S8.7207 6 7.009 6 4 7.0296 4 9s1.2973 3 3.009 3ZM10 18l7-12h-3L7 18h3Zm-3.0103-8C6.371 10 6 9.6934 6 9.0073 6 8.3066 6.3711 8 6.9897 8 7.6082 8 8 8.3066 8 9.0073 8 9.6934 7.6082 10 6.9897 10ZM17 18c1.7169 0 3-1.0296 3-3 0-1.9882-1.2831-3-3-3s-3 1.0118-3 3c0 1.9704 1.2831 3 3 3Zm-.0103-2c-.6186 0-.9897-.3066-.9897-.9927S16.3711 14 16.9897 14C17.6082 14 18 14.3212 18 15.0073c0 .6861-.3918.9927-1.0103.9927Z"}),"FeeDividendPercentage");return Wt.default=i,Wt}()),Z=t(function(){if(Ht)return Zt;Ht=1;var e=le;Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M5.143 6.7462c0-.568.4605-1.0285 1.0285-1.0285h4.8c.5681 0 1.0286.4605 1.0286 1.0285 0 .5681-.4605 1.0286-1.0286 1.0286h-4.8c-.568 0-1.0285-.4605-1.0285-1.0286Z"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.1429 1.7144c-1.8936 0-3.4286 1.535-3.4286 3.4285v13.7143c0 1.8936 1.535 3.4286 3.4286 3.4286H12c1.8935 0 3.4286-1.535 3.4286-3.4286v-6.8571h.8571a.8571.8571 0 0 1 .8572.8571v5.1429c0 .9468.7675 1.7143 1.7142 1.7143h1.7143c.9468 0 1.7143-.7675 1.7143-1.7143V8.0178a2.5715 2.5715 0 0 0-1.6164-2.3875l-3.2081-1.2832-.6367 1.5917 3.2081 1.2832a.8572.8572 0 0 1 .5388.7958v9.9823h-1.7143v-5.1429c0-1.4201-1.1512-2.5714-2.5714-2.5714h-.8571V5.1429c0-1.8935-1.5351-3.4285-3.4286-3.4285H5.1429ZM12 3.4286H5.1429c-.9468 0-1.7143.7676-1.7143 1.7143v13.7143c0 .9468.7675 1.7143 1.7143 1.7143H12c.9468 0 1.7143-.7675 1.7143-1.7143V5.1429c0-.9467-.7675-1.7143-1.7143-1.7143Z",clipRule:"evenodd"},"1")],"GasFee");return Zt.default=i,Zt}()),$=t(function(){if(zt)return $t;zt=1;var e=le;Object.defineProperty($t,"__esModule",{value:!0}),$t.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.3131 12.0642c.301-2.3412.5403-5.6679-.7338-7.6225-.3848-.5903-.9077-1.0555-1.6087-1.3306 0 0-.0736.759-.3537 1.836-.3625 1.394-1.0708 3.321-2.4132 4.8253-2.3391 2.6213-3.3492 8.4683 2.249 10.6093.7977.3263 1.678.5072 2.6032.5072a6.98 6.98 0 0 0 1.7468-.2209c1.7565-.4417 3.2827-1.5497 4.1317-3.129.4672-.8411.7321-1.7944.7321-2.8046 0-.078-.0069-.1494-.0207-.2136-.0237-1.3149-.4315-2.7805-1.343-4.3445-.3785-.6495-.8439-1.316-1.4048-1.9956-.0954.7784-.3052 1.526-.5805 2.2197-.3533.8902-.8145 1.6918-1.2808 2.3565-.211.301-.4232.5739-.6268.8142-.621.7331-1.1627 1.1633-1.354 1.1633-.0886 0-.0682-.3087 0-.8266.0257-.1946.0581-.4188.094-.6672l.0435-.3014c.0387-.2706.0798-.5641.1197-.875Zm4.0673.3122a13.8236 13.8236 0 0 1-.9138 1.4763c-.4806.6771-.9782 1.2478-1.42 1.6686-.2178.2074-.4503.4055-.6839.5652-.1155.079-.2634.1709-.4342.2494-.1351.0621-.4563.1985-.8726.1985-.9565 0-1.4718-.6674-1.6519-1.0332-.1555-.3159-.1862-.6056-.1959-.7091-.0235-.2491-.0046-.4966.0088-.6453.0279-.3095.0876-.7219.1478-1.138l.014-.0964c.1375-.952.3069-2.1545.3583-3.3932.0305-.7358.0165-1.4357-.0558-2.0662-.4699 1.154-1.1502 2.4149-2.1345 3.5179-.8676.9722-1.5157 2.6156-1.4 4.1511.1036 1.3771.8147 2.7622 2.9489 3.5785l.0193.0074.0192.0078c.5834.2386 1.2324.3732 1.9218.3732.4498 0 .8845-.0573 1.2967-.1637l.0112-.0029c1.3155-.3307 2.399-1.1453 2.9852-2.2356l.0058-.0109.0061-.0109c.3145-.5662.4931-1.1954.505-1.8592l-.0166-.0775-.0032-.1749c-.0115-.6355-.147-1.3654-.4657-2.1769Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M19.4073 9.7777c.8182 0 1.4814-.6632 1.4814-1.4814s-.6632-1.4815-1.4814-1.4815-1.4815.6633-1.4815 1.4815.6633 1.4814 1.4815 1.4814ZM4.2222 7.5556c.6136 0 1.1111-.4975 1.1111-1.1112 0-.6136-.4975-1.111-1.1111-1.111-.6136 0-1.1111.4974-1.1111 1.111 0 .6137.4975 1.1112 1.1111 1.1112Z",opacity:".2"},"1")],"Hot");return $t.default=i,$t}()),G=t(function(){if(Gt)return Qt;Gt=1;var e=le;Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#FFE804"},"0"),(0,n.jsx)("path",{fill:"#1A1A1B",fillRule:"evenodd",d:"M12.3 19.5367c3.3492 0 6.3-2.3625 6.3-5.5125 0-3.15-2.3625-4.725-3.15-5.5125-1.1072-1.1072-1.4553-2.5625-1.5553-3.5634-.0551-.5544-.5899-.9482-1.0537-.6395-.908.6017-2.1916 1.8302-2.9035 4.203-.5064 1.6867 0 3.1499 0 3.1499s-.7875-.3937-1.1813-1.575c-.1299-.389-.3024-.8639-.4748-1.3254-.2489-.6638-1.1474-.6583-1.3655.0166C6.4843 10.1088 6 11.9003 6 13.2367c0 3.9375 2.9515 6.3 6.3 6.3Z",clipRule:"evenodd"},"1"),(0,n.jsx)("path",{fill:"#FFE804",fillRule:"evenodd",d:"M11.5123 16.3868c1.9491 0 4.1061-1.2159 4.6164-3.0767.1086-.3954.6623-.5781.7733-.1835.0803.289.1228.5882.1228.8977 0 2.1751-2.116 3.9375-4.725 3.9375-1.6836 0-3.1618-.7339-3.998-1.8388-.2474-.326.1936-.6221.5496-.4197.7576.4315 1.6742.6835 2.6609.6835Z",clipRule:"evenodd"},"2")],"HotFilled");return Qt.default=i,Qt}()),Q=t(function(){if(Yt)return Xt;Yt=1;var e=le;Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.4546 4h13.0909A2.4546 2.4546 0 0 1 21 6.4545v9.8182a2.4549 2.4549 0 0 1-2.4545 2.4546H5.4545A2.4546 2.4546 0 0 1 3 16.2727V6.4545A2.4545 2.4545 0 0 1 5.4546 4Zm-.4092 3.75A1.7043 1.7043 0 0 0 6.75 9.4545 1.7046 1.7046 0 1 0 5.0454 7.75Zm.209 8.863a.824.824 0 0 0 .411.1098l12.6688.0004a.8225.8225 0 0 0 .8236-.8746.8227.8227 0 0 0-.1462-.4186l-3.577-5.1447a.8248.8248 0 0 0-.6773-.3538.825.825 0 0 0-.6772.3538l-3.7976 5.4614-2.0238-3.537a.8253.8253 0 0 0-1.1296-.3037.8254.8254 0 0 0-.3022.3037l-1.8773 3.2809a.8237.8237 0 0 0 .3047 1.1224Z",clipRule:"evenodd"}),"Image");return Xt.default=i,Xt}()),Y=t(function(){if(Kt)return Jt;Kt=1;var e=le;Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("circle",{cx:"16",cy:"16",r:"16",fill:"currentColor",fillOpacity:".1"},"0"),(0,n.jsx)("path",{fill:"#1a1a1b",d:"M10 14.75h12v2.5H10v-2.5Z"},"1")],"InvalidFilled");return Jt.default=i,Jt}()),X=t(function(){if(en)return tn;en=1;var e=le;Object.defineProperty(tn,"__esModule",{value:!0}),tn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2Zm6.93 6h-2.95c-.32-1.25-.7801-2.45-1.38-3.56 1.8401.63 3.37 1.91 4.33 3.56ZM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96ZM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26Zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56A7.987 7.987 0 0 1 5.08 16Zm2.95-8H5.08a7.987 7.987 0 0 1 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8ZM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96ZM9.66 14c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.0901.65.16 1.32.16 2 0 .68-.0699 1.34-.16 2H9.66Zm4.93 5.56c.5999-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.4899 2.93-4.33 3.56ZM16.36 14c.0799-.66.14-1.32.14-2 0-.68-.0601-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38Z",clipRule:"evenodd"}),"Language");return tn.default=i,tn}()),K=t(function(){if(nn)return on;nn=1;var e=le;Object.defineProperty(on,"__esModule",{value:!0}),on.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M3 7c0-1.1046.8954-2 2-2h1v2H5v12h14V7h-1V5h1c1.1046 0 2 .8954 2 2v12c0 1.1046-.8954 2-2 2H5c-1.1046 0-2-.8954-2-2V7Zm7 0V5h4v2h-4Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 9V3h2v6H7Zm8 0V3h2v6h-2Zm-8 2h10v2H7v-2Zm0 4h10v2H7v-2Z",clipRule:"evenodd"},"1")],"LastingDays");return on.default=i,on}()),J=t(function(){if(rn)return an;rn=1;var e=le;Object.defineProperty(an,"__esModule",{value:!0}),an.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("defs",{children:(0,n.jsx)("filter",{id:"a","color-interpolation-filters":"auto",children:(0,n.jsx)("feColorMatrix",{in:"SourceGraphic",values:"0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"})})},"0"),(0,n.jsx)("g",{fill:"none",fillRule:"evenodd",filter:"url(#a)",transform:"translate(-3 -3)",children:(0,n.jsxs)("g",{fill:"#CCC",fillRule:"nonzero",children:[(0,n.jsx)("path",{d:"m5.3001 8.1062-1.402 1.4565c-1.1974 1.2439-1.1974 3.2606 0 4.5044 1.1973 1.2439 3.1386 1.2439 4.336 0l1.868-1.9417c.7037-.731 1.022-1.7713.8537-2.7901-.1682-1.019-.802-1.8896-1.6998-2.3353l-.5988.6221a1.0587 1.0587 0 0 0-.1574.2113c.6956.2077 1.2335.782 1.4143 1.51.1808.728-.0224 1.5011-.5344 2.0325l-1.8671 1.9407c-.7986.8296-2.0934.8296-2.892 0-.7987-.8297-.7987-2.1748 0-3.0044l.8103-.8408a4.4243 4.4243 0 0 1-.1308-1.3663v.001Z"}),(0,n.jsx)("path",{d:"M7.8978 5.8739c-.7036.7311-1.0218 1.7715-.8536 2.7905.1682 1.019.802 1.8898 1.6998 2.3356l.792-.824c-.7052-.1964-1.256-.7689-1.4448-1.5016-.1889-.7328.0128-1.5146.5291-2.051l1.8671-1.9408c.7986-.8297 2.0934-.8297 2.892 0 .7987.8297.7987 2.175 0 3.0048l-.8103.8409a4.431 4.431 0 0 1 .1308 1.3664l1.402-1.4567c1.1974-1.244 1.1974-3.261 0-4.505-1.1973-1.244-3.1386-1.244-4.336 0L7.898 5.874Z"})]})},"1")],"Link");return an.default=i,an}()),ee=t(function(){if(sn)return ln;sn=1;var e=le;Object.defineProperty(ln,"__esModule",{value:!0}),ln.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.0495 3C16.5908 3 20.3508 6.3268 21 10.6635l-2.2376.3345c-.4867-3.2527-3.3068-5.748-6.7129-5.748-3.7484 0-6.7871 3.022-6.7871 6.75 0 3.7279 3.0387 6.75 6.7871 6.75V21C7.0516 21 3 16.9706 3 12s4.0516-9 9.0495-9Zm4.3627 14.1709 1.4549 1.7231a9.0498 9.0498 0 0 1-2.9404 1.6415l-.7197-2.1338a6.7865 6.7865 0 0 0 2.2052-1.2308Zm4.5511-3.6073-2.2283-.3916a6.6858 6.6858 0 0 1-.8956 2.3526l1.9299 1.1747a8.914 8.914 0 0 0 1.194-3.1357Z",clipRule:"evenodd"}),"Loading");return ln.default=i,ln}()),te=t(function(){if(dn)return cn;dn=1;var e=le;Object.defineProperty(cn,"__esModule",{value:!0}),cn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M17 8h1c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V10c0-1.1.9-2 2-2h1V6c0-2.76 2.24-5 5-5s5 2.24 5 5v2Zm-5-5c-1.66 0-3 1.34-3 3v2h6V6c0-1.66-1.34-3-3-3ZM6 20V10h12v10H6Zm8-5c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2Z",clipRule:"evenodd"}),"Lock");return cn.default=i,cn}()),ne=t(function(){if(un)return pn;un=1;var e=le;Object.defineProperty(pn,"__esModule",{value:!0}),pn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M3.6166 11.4624c0-1.575.3306-3.0673.9917-4.477.6611-1.4098 1.6042-2.6105 2.8292-3.6022l1.1958 1.3126c-1.0305.836-1.8326 1.8423-2.4062 3.0187-.5737 1.1764-.8605 2.4257-.8605 3.7479h-1.75Zm19.0459 0c0-1.3222-.2723-2.5715-.8167-3.7479-.5444-1.1764-1.3319-2.1826-2.3625-3.0187l1.1958-1.3126C21.8847 4.3944 22.8083 5.6 23.45 7c.6416 1.4.9625 2.8875.9625 4.4625h-1.75ZM4.6666 22.1666v-1.75h2.45v-8.925c0-1.5945.4813-3.0382 1.4438-4.3313.9625-1.293 2.2312-2.1048 3.8062-2.4354v-.8458c0-.4472.1605-.8167.4813-1.1084.3208-.2916.7048-.4375 1.1521-.4375.4472 0 .8312.1459 1.1521.4375.3208.2917.4812.6612.4812 1.1084v.8458c1.575.3306 2.8486 1.1424 3.8208 2.4354.9723 1.293 1.4584 2.7368 1.4584 4.3313v8.925h2.4208v1.75H4.6666Zm9.3334 3.5c-.6223 0-1.1667-.2285-1.6334-.6854-.4666-.457-.7-1.0063-.7-1.6479h4.6667c0 .6416-.2285 1.1909-.6854 1.6479-.457.4569-1.0063.6854-1.6479.6854Z"}),"Message");return pn.default=i,pn}()),ie=t(function(){if(hn)return mn;hn=1;var e=le;Object.defineProperty(mn,"__esModule",{value:!0}),mn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M5 11h14v2H5z"}),"Minus");return mn.default=i,mn}()),oe=t(function(){if(xn)return gn;xn=1;var e=le;Object.defineProperty(gn,"__esModule",{value:!0}),gn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#7D00FF"},"0"),(0,n.jsx)("path",{fill:"#fff",d:"M16.8474 9.3052a2.1524 2.1524 0 0 0 2.1113-2.5725 2.1527 2.1527 0 1 0-2.1113 2.5725ZM10.247 19a5.2466 5.2466 0 0 1-4.8476-3.239 5.2472 5.2472 0 0 1 3.824-7.1541 5.2467 5.2467 0 0 1 5.3863 2.2311 5.2471 5.2471 0 0 1-2.3548 7.7626A5.2467 5.2467 0 0 1 10.247 19Z"},"1")],"MoonPay");return gn.default=i,gn}()),re=t(function(){if(fn)return yn;fn=1;var e=le;Object.defineProperty(yn,"__esModule",{value:!0}),yn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 12.5c0 .8284-.6716 1.5-1.5 1.5S4 13.3284 4 12.5 4.6716 11 5.5 11s1.5.6716 1.5 1.5Zm6 0c0 .8284-.6716 1.5-1.5 1.5s-1.5-.6716-1.5-1.5.6716-1.5 1.5-1.5 1.5.6716 1.5 1.5Zm4.5 1.5c.8284 0 1.5-.6716 1.5-1.5s-.6716-1.5-1.5-1.5-1.5.6716-1.5 1.5.6716 1.5 1.5 1.5Z",clipRule:"evenodd"}),"More");return yn.default=i,yn}()),ae=t(function(){if(vn)return bn;vn=1;var e=le;Object.defineProperty(bn,"__esModule",{value:!0}),bn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("defs",{children:(0,n.jsx)("rect",{id:"a",width:"60",height:"60",x:"0",y:"0",rx:"16"})},"0"),(0,n.jsxs)("g",{fill:"none",fillRule:"evenodd",opacity:".5",children:[(0,n.jsx)("mask",{id:"b",fill:"#fff",children:(0,n.jsx)("use",{xlinkHref:"#a"})}),(0,n.jsx)("use",{xlinkHref:"#a",fill:"#FFF",fillOpacity:"0"}),(0,n.jsxs)("g",{mask:"url(#b)",opacity:".4",children:[(0,n.jsx)("path",{fill:"#727272",d:"M0 0v37.5847h.0058V60h59.9884V37.5847H60V0z"}),(0,n.jsx)("path",{fill:"#ABABAB",d:"M0 0v24.4129h.0038v14.5597h38.9651V24.4129h.0038V0z"}),(0,n.jsx)("path",{fill:"#ABABAB",d:"m20.9274 20.9273.0036 38.9728h38.9651V45.3404h.0038V20.9273z"}),(0,n.jsx)("path",{fill:"#444446",d:"M23.3955 4.8471c10.469 0 18.9558 8.4868 18.9558 18.956 0 3.849-1.1471 7.43-3.1181 10.42l16.4696 16.469-5.111 5.6234-16.7122-16.7171c-3.0027 1.997-6.6075 3.1607-10.484 3.1607-10.4691 0-18.9561-8.4868-18.9561-18.956 0-10.4692 8.487-18.956 18.956-18.956Zm0 7.7036c-6.2145 0-11.2523 5.0378-11.2523 11.2524s5.0378 11.2524 11.2523 11.2524c6.2146 0 11.2524-5.0378 11.2524-11.2524S29.61 12.5507 23.3955 12.5507Z"})]})]},"1")],"NoFound");return bn.default=i,bn}()),ce=t(function(){if(Cn)return jn;Cn=1;var e=le;Object.defineProperty(jn,"__esModule",{value:!0}),jn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("defs",{children:(0,n.jsx)("rect",{id:"a",width:"60",height:"60",x:"0",y:"0",rx:"16"})},"0"),(0,n.jsxs)("g",{fill:"none",fillRule:"evenodd",opacity:".5",children:[(0,n.jsx)("mask",{id:"b",fill:"#fff",children:(0,n.jsx)("use",{xlinkHref:"#a"})}),(0,n.jsxs)("g",{fillOpacity:".4",mask:"url(#b)",children:[(0,n.jsx)("path",{fill:"#727272",d:"M0 30.1054h60V0H0z"}),(0,n.jsx)("path",{fill:"#ABABAB",d:"M.0058 59.8097h59.9886v-29.753H.0058z"})]}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M30.3117 29.752c-.244 0-.4865-.006-.7274-.0178-10.5472-.5144-15.4471-13.4418-8.0154-20.992L30.1739 0l8.687 8.6627c7.6331 7.6113 2.532 20.842-8.21 21.0855a15.6646 15.6646 0 0 1-.3392.0038m0 30c-.244 0-.4865-.006-.7274-.0178-10.5472-.5144-15.4471-13.4418-8.0154-20.992L30.1739 30l8.687 8.6627c7.6331 7.6113 2.532 20.842-8.21 21.0855a15.6646 15.6646 0 0 1-.3392.0038",mask:"url(#b)"})]},"1")],"NoResult");return jn.default=i,jn}()),Ve=t(function(){if(wn)return kn;wn=1;var e=le;Object.defineProperty(kn,"__esModule",{value:!0}),kn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsxs)("defs",{children:[(0,n.jsx)("rect",{id:"a",width:"60",height:"60",x:"0",y:"0",rx:"16"}),(0,n.jsx)("path",{id:"c",d:"M0 0h29.8277v29.7331H0z"})]},"0"),(0,n.jsxs)("g",{fill:"none",fillRule:"evenodd",opacity:".5",children:[(0,n.jsx)("mask",{id:"b",fill:"#fff",children:(0,n.jsx)("use",{xlinkHref:"#a"})}),(0,n.jsxs)("g",{mask:"url(#b)",children:[(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M0 30.1054h60V0H0z"}),(0,n.jsx)("path",{fill:"#ABABAB",fillOpacity:".4",d:"M.0058 59.8097h59.9886v-29.753H.0058z"}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M59.826 15.098c0 8.2105-6.6771 14.8665-14.9139 14.8665-8.2366 0-14.9138-6.656-14.9138-14.8665 0-8.2104 6.6772-14.8665 14.9138-14.8665 8.2368 0 14.9139 6.656 14.9139 14.8665"}),(0,n.jsxs)("g",{transform:"translate(30.0506 30.2669)",children:[(0,n.jsx)("mask",{id:"d",fill:"#fff",children:(0,n.jsx)("use",{xlinkHref:"#c"})}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M29.8277 14.8665c0 8.2105-6.677 14.8666-14.9138 14.8666C6.6773 29.733 0 23.077 0 14.8665 0 6.6561 6.6773 0 14.9139 0c8.2368 0 14.9138 6.656 14.9138 14.8665",mask:"url(#d)"})]}),(0,n.jsx)("path",{fill:"#727272",fillOpacity:".4",d:"M30.2141 15.0772c0 8.2105-6.677 14.8666-14.9138 14.8666C7.0637 29.9437.3864 23.2877.3864 15.0772.3864 6.8668 7.0637.2107 15.3003.2107c8.2368 0 14.9138 6.656 14.9138 14.8665m0 30.0562C30.2141 53.3439 23.5371 60 15.3003 60 7.0637 59.9999.3864 53.3439.3864 45.1334c0-8.2104 6.6773-14.8665 14.9139-14.8665 8.2368 0 14.9138 6.656 14.9138 14.8665"}),(0,n.jsx)("path",{fill:"#444446",d:"M52.3043 15.098c0 4.0697-3.3096 7.3688-7.3922 7.3688-4.0825 0-7.3922-3.2991-7.3922-7.3688s3.3097-7.3688 7.3922-7.3688c4.0826 0 7.3922 3.2991 7.3922 7.3688"})]})]},"1")],"NoToken");return kn.default=i,kn}()),We=t(function(){if(Tn)return Bn;Tn=1;var e=le;Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M18 16v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2Zm-6 6c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2Zm-4-5h8v-6c0-2.48-1.51-4.5-4-4.5S8 8.52 8 11v6Z",clipRule:"evenodd"}),"Notice");return Bn.default=i,Bn}()),Tt=t(function(){if(En)return In;En=1;var e=le;Object.defineProperty(In,"__esModule",{value:!0}),In.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12Zm14 0-6-4.5v9l6-4.5Z",clipRule:"evenodd"}),"PlayCircleFilled");return In.default=i,In}()),Bt=t(function(){if(An)return Sn;An=1;var e=le;Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2Z"}),"Plus");return Sn.default=i,Sn}()),Ei=t(function(){if(Ln)return Mn;Ln=1;var e=le;Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 7h5V5H2v2Zm0 4h5V9H2v2Zm5 2H2v2h5v-2Zm9.76 2.17L20.59 19 22 17.59l-3.83-3.84c.52-.79.83-1.73.83-2.75 0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.02 0 1.96-.31 2.76-.83ZM17 11c0-1.65-1.35-3-3-3s-3 1.35-3 3 1.35 3 3 3 3-1.35 3-3Zm-5 6v2H2v-2h10Z",clipRule:"evenodd"}),"PriceComparison");return Mn.default=i,Mn}()),Ii=t(function(){if(Rn)return On;Rn=1;var e=le;Object.defineProperty(On,"__esModule",{value:!0}),On.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m11 2 4.55 4.55L11 11V7.09c-2.84.48-5 2.94-5 5.91s2.16 5.43 5 5.91v2.02c-3.95-.49-7-3.85-7-7.93s3.06-7.44 7-7.93V2Zm7.31 6.11c.9 1.16 1.45 2.5 1.62 3.89h-2.02c-.14-.87-.48-1.72-1.02-2.47l1.42-1.42ZM13 18.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03Zm5.31-1.01-1.42-1.41c.54-.76.88-1.61 1.02-2.48h2.02c-.17 1.39-.72 2.73-1.62 3.89Z",clipRule:"evenodd"}),"PriceRoute");return On.default=i,On}()),Ai=t(function(){if(Pn)return _n;Pn=1;var e=le;Object.defineProperty(_n,"__esModule",{value:!0}),_n.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 2C8.6863 2 6 4.6863 6 8s2.6863 6 6 6 6-2.6863 6-6-2.6863-6-6-6ZM8 8c0-2.2091 1.7909-4 4-4 2.2091 0 4 1.7909 4 4 0 2.2091-1.7909 4-4 4-2.2091 0-4-1.7909-4-4Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M4.7242 20.7497C6.664 19.0377 9.2096 18 12 18s5.336 1.0377 7.2757 2.7497c.4141.3655 1.046.3261 1.4115-.088.3655-.414.3261-1.046-.088-1.4114C18.3081 17.2281 15.2963 16 12 16c-3.2963 0-6.3081 1.2281-8.5992 3.2503-.414.3654-.4535.9974-.088 1.4114.3654.4141.9974.4535 1.4114.088Z"},"1")],"Profile");return _n.default=i,_n}()),Si=t(function(){if(Dn)return Nn;Dn=1;var e=le;Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4Z"},"0"),(0,n.jsx)("path",{fill:"#fff",d:"m15.8946 8.3638-5.5915 5.5915-2.1976-2.1891-1.1963 1.1964 3.3939 3.3939 6.7879-6.7879-1.1964-1.2048Z"},"1")],"Protect");return Nn.default=i,Nn}()),Li=t(function(){if(Fn)return Un;Fn=1;var e=le;Object.defineProperty(Un,"__esModule",{value:!0}),Un.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.3333 12c0-5.888 4.7786-10.6667 10.6666-10.6667 5.888 0 10.6667 4.7787 10.6667 10.6667 0 5.888-4.7787 10.6667-10.6667 10.6667-5.888 0-10.6667-4.7787-10.6667-10.6667Zm11.7333 4.2667V18.4h-2.1333v-2.1333h2.1333Zm-1.0667 4.2666c-4.704 0-8.5333-3.8293-8.5333-8.5333 0-4.704 3.8293-8.5333 8.5333-8.5333 4.704 0 8.5334 3.8293 8.5334 8.5333 0 4.704-3.8294 8.5333-8.5334 8.5333ZM7.7332 9.8667C7.7332 7.5093 9.6426 5.6 12 5.6s4.2667 1.9093 4.2667 4.2667c0 1.3684-.8427 2.1048-1.6632 2.8219-.7784.6802-1.5368 1.343-1.5368 2.5114h-2.1333c0-1.9427 1.0049-2.713 1.8884-3.3902.6931-.5313 1.3116-1.0053 1.3116-1.9431 0-1.1734-.96-2.1334-2.1334-2.1334-1.1733 0-2.1333.96-2.1333 2.1334H7.7332Z",clipRule:"evenodd"}),"QuestionBorder");return Un.default=i,Un}()),Mi=t(function(){if(qn)return Vn;qn=1;var e=le;Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.99 1v3c4.42 0 8 3.58 8 8 0 1.57-.46 3.03-1.24 4.26l-1.46-1.46c.45-.83.7-1.79.7-2.8 0-3.31-2.69-6-6-6v3l-4-4 4-4Zm-6 11c0 3.31 2.69 6 6 6v-3l4 4-4 4v-3c-4.42 0-8-3.58-8-8 0-1.57.46-3.03 1.24-4.26L6.69 9.2c-.45.83-.7 1.79-.7 2.8Z",clipRule:"evenodd"}),"Refresh");return Vn.default=i,Vn}()),Ri=t(function(){if(Wn)return Hn;Wn=1;var e=le;Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M8.82 19H17c2.21 0 4-1.79 4-4s-1.79-4-4-4H7c-1.1 0-2-.9-2-2s.9-2 2-2h8.18C15.6 8.16 16.7 9 18 9c1.66 0 3-1.34 3-3s-1.34-3-3-3c-1.3 0-2.4.84-2.82 2H7C4.79 5 3 6.79 3 9s1.79 4 4 4h10c1.1 0 2 .9 2 2s-.9 2-2 2H8.82c-.41-1.16-1.51-2-2.82-2-1.66 0-3 1.34-3 3s1.34 3 3 3c1.3 0 2.4-.84 2.82-2ZM17 6c0-.55.45-1 1-1s1 .45 1 1-.45 1-1 1-1-.45-1-1ZM6 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1Z",clipRule:"evenodd"}),"Route");return Hn.default=i,Hn}()),Oi=t(function(){if(Zn)return zn;Zn=1;var e=le;Object.defineProperty(zn,"__esModule",{value:!0}),zn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.71 14h.79l4.99 5L19 20.49l-5-4.99v-.79l-.27-.28C12.59 15.41 11.11 16 9.5 16 5.91 16 3 13.09 3 9.5S5.91 3 9.5 3 16 5.91 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27ZM5 9.5C5 11.99 7.01 14 9.5 14S14 11.99 14 9.5 11.99 5 9.5 5 5 7.01 5 9.5Z",clipRule:"evenodd"}),"Search");return zn.default=i,zn}()),Pi=t(function(){if($n)return Gn;$n=1;var e=le;Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M19.2001 12c0 .33-.02.64-.06.94l2.01 1.58c.19.14.24.39.12.61l-1.92 3.32c-.12.22-.37.3-.59.22l-2.39-.96c-.49.38-1.03.7-1.62.94l-.36 2.54c-.03.24-.23.41-.47.41h-3.84c-.24 0-.43-.17-.48-.41l-.36-2.54c-.59-.24-1.12-.56-1.62-.94l-2.39.96c-.22.07-.47 0-.59-.22l-1.92-3.32c-.11-.2-.06-.47.12-.61l2.03-1.58c-.05-.3-.07-.63-.07-.94 0-.31.04-.64.09-.94l-2.03-1.58c-.2-.14-.24-.4-.12-.61l1.91-3.32c.12-.22.37-.3.59-.22l2.39.96c.49-.37 1.03-.7 1.62-.94l.36-2.54c.04-.24.23-.41.47-.41h3.84c.24 0 .44.17.48.41l.36 2.54c.59.24 1.12.56 1.62.94l2.39-.96c.22-.07.47 0 .59.22l1.92 3.32c.11.2.06.47-.12.61l-2.03 1.58c.05.3.07.62.07.94Zm-10.8 0c0 1.98 1.62 3.6 3.6 3.6s3.6-1.62 3.6-3.6-1.62-3.6-3.6-3.6-3.6 1.62-3.6 3.6Z",clipRule:"evenodd"}),"Setting");return Gn.default=i,Gn}()),_i=t(function(){if(Qn)return Yn;Qn=1;var e=le;Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M19.2001 12c0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22l-1.91 3.32c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94 0 .31.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41H12v-6c-1.9799 0-3.5999-1.62-3.5999-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6h3.6Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.75 13a.75.75 0 0 0-.75.75v7.5a.75.75 0 0 0 .75.75h2.5a.75.75 0 0 0 .75-.75v-2.1945l-.4052-.4052H14.25v-2.5h2.3448L17 15.7451V13.75a.75.75 0 0 0-.75-.75h-2.5ZM18 21.25v-1.1944l.3057.3058 2.9611-2.961-2.961-2.9611-.3058.3058V13.75a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1-.75-.75Zm.3058-5.75 1.9003 1.9004-1.9003 1.9003-.7071-.7071.6932-.6932H15v-1h3.2919l-.6932-.6933.7071-.7071Z",clipRule:"evenodd"},"1")],"SettingCrossChain");return Yn.default=i,Yn}()),Di=t(function(){if(Xn)return Kn;Xn=1;var e=le;Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M16.5435 15.0947a2.9324 2.9324 0 0 0-1.6805.5272l-4.572-3.2066c.009-.09.0142-.18.0142-.2726 0-.0154-.0026-.0296-.0026-.045l4.7546-3.3621a3.039 3.039 0 0 0 1.4863.387c1.6907 0 3.0613-1.3706 3.0613-3.0613S18.2355 3 16.5435 3c-1.6895 0-3.06 1.3706-3.06 3.0613 0 .2417.0295.477.0823.7033L9.2072 9.8477a2.9326 2.9326 0 0 0-1.8553-.6583c-1.6303 0-2.952 1.3217-2.952 2.9533 0 1.6303 1.3217 2.952 2.952 2.952.6982 0 1.3359-.243 1.8411-.6467l4.4422 3.1153a2.863 2.863 0 0 0-.0424.4834c0 1.6316 1.3217 2.9533 2.952 2.9533 1.6315 0 2.9532-1.3217 2.9532-2.9533s-1.323-2.952-2.9545-2.952Z"}),"Share");return Kn.default=i,Kn}()),Ni=t(function(){if(Jn)return ei;Jn=1;var e=le;Object.defineProperty(ei,"__esModule",{value:!0}),ei.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M19.95 4.46c-.75-.38-1.58-.8-2.95-.8s-2.2.42-2.95.8l-.0797.0393c-.6145.3033-1.1361.5607-1.9703.5607-.9 0-1.4-.25-2.05-.6l-.0783-.0387C9.1425 4.0607 8.3322 3.66 7 3.66c-1.3712 0-2.1895.4146-2.9356.7927L4.05 4.46l-.0255.013c-.6382.324-1.156.587-2.0245.587v1.93c1.3291 0 2.1736-.4168 2.915-.7828L4.95 6.19l.0255-.013C5.6137 5.853 6.1315 5.59 7 5.59c.88 0 1.4.25 2.05.6l.0144.0073c.7461.378 1.5644.7927 2.9356.7927 1.3322 0 2.1425-.4007 2.8717-.7613L14.95 6.19l.0797-.0393C15.6442 5.8474 16.1658 5.59 17 5.59c.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V5.04c-.9 0-1.4-.25-2.05-.58Zm-5.8651 8.8628c.7415-.366 1.586-.7828 2.9151-.7828 1.35 0 2.2.42 2.95.8.65.35 1.15.6 2.05.6v1.95c-1.37 0-2.2-.42-2.95-.8-.65-.35-1.15-.6-2.05-.6-.9 0-1.4.25-2.05.6l-.0783.0387c-.7292.3606-1.5395.7613-2.8717.7613-1.3712 0-2.1895-.4146-2.9356-.7927L9.05 15.09c-.65-.35-1.15-.6-2.05-.6-.9 0-1.4.25-2.05.6l-.035.0172c-.7414.366-1.5859.7828-2.915.7828v-1.95c.8357 0 1.3468-.2525 1.9529-.5521L4.05 13.34l.0783-.0387C4.8575 12.9407 5.6678 12.54 7 12.54c1.3712 0 2.1895.4146 2.9356.7927l.0144.0073c.65.35 1.15.6 2.05.6.8342 0 1.3558-.2574 1.9703-.5607l.0797-.0393.0349-.0172ZM14.05 17.79c.75-.38 1.6-.8 2.95-.8s2.2.42 2.95.8c.65.35 1.15.6 2.05.6v1.95c-1.37 0-2.2-.42-2.95-.8-.65-.35-1.15-.6-2.05-.6-.8682 0-1.3978.2689-2.0459.5979l-.0041.0021-.0144.0073c-.7461.3781-1.5644.7927-2.9356.7927s-2.1895-.4146-2.9356-.7927L9.05 19.54c-.65-.35-1.17-.6-2.05-.6-.8685 0-1.3863.263-2.0245.5871L4.95 19.54c-.75.38-1.6.8-2.95.8v-1.95c.8685 0 1.3863-.263 2.0245-.587l.0255-.013.0144-.0073C4.8105 17.4046 5.6288 16.99 7 16.99s2.1895.4146 2.9356.7927l.0144.0073c.65.35 1.15.6 2.05.6.8682 0 1.3978-.2689 2.0459-.5979l.0041-.0021Zm.0349-8.9172c.7415-.366 1.586-.7828 2.9151-.7828 1.35 0 2.2.42 2.95.8.65.35 1.15.6 2.05.6v1.95c-1.37 0-2.2-.42-2.95-.8-.65-.35-1.15-.6-2.05-.6-.8342 0-1.3558.2574-1.9703.5607l-.0797.0393-.0783.0387c-.7292.3606-1.5395.7613-2.8717.7613-1.3712 0-2.1895-.4146-2.9356-.7927L9.05 10.64c-.65-.35-1.18-.6-2.05-.6-.8342 0-1.3558.2574-1.9703.5607L4.95 10.64l-.035.0172c-.7414.366-1.5859.7828-2.915.7828V9.49c.9 0 1.4-.25 2.05-.6l.0783-.0387C4.8575 8.4907 5.6678 8.09 7 8.09c1.3712 0 2.1895.4146 2.9356.7927L9.95 8.89c.65.35 1.15.6 2.05.6.9 0 1.4-.25 2.05-.6l.0349-.0172Z",clipRule:"evenodd"}),"Slippage");return ei.default=i,ei}()),Fi=t(function(){if(ti)return ni;ti=1;var e=le;Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.0001 15.7678 3.7524 1.397-.1691-4.0005 2.4882-3.1371-3.8569-1.0754-2.2146-3.3358-2.2147 3.3358-3.857 1.0754 2.4883 3.1371-.169 4.0005L12 15.7678Zm-5.8779 4.3224.2648-6.2664-3.8975-4.914L8.531 7.2253 12.0001 2l3.469 5.2253 6.0415 1.6845-3.8975 4.914.2648 6.2664-5.8778-2.1883-5.8779 2.1883Z",clipRule:"evenodd"}),"Star");return ni.default=i,ni}()),Ui=t(function(){if(ii)return oi;ii=1;var e=le;Object.defineProperty(oi,"__esModule",{value:!0}),oi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"m12 17.9019-5.8778 2.1883.2648-6.2664-3.8976-4.914L8.531 7.2253 12 2l3.469 5.2253 6.0416 1.6845-3.8976 4.914.2649 6.2664L12 17.9019Z",clipRule:"evenodd"}),"StarFilled");return oi.default=i,oi}()),qi=t(function(){if(ri)return ai;ri=1;var e=le;Object.defineProperty(ai,"__esModule",{value:!0}),ai.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M13.3334 8.6667H6.6668v2h11.9999l-5.3333-5v3Zm-1.6666 9.6666v-3h6.9999v-2h-12l5.0001 5Z"}),"Switch");return ai.default=i,ai}()),Vi=t(function(){if(si)return li;si=1;var e=le;Object.defineProperty(li,"__esModule",{value:!0}),li.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1Z"}),"ThemeModeDark");return li.default=i,li}()),Wi=t(function(){if(di)return ci;di=1;var e=le;Object.defineProperty(ci,"__esModule",{value:!0}),ci.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1ZM7 12c0 2.76 2.24 5 5 5s5-2.24 5-5-2.24-5-5-5-5 2.24-5 5Zm-5 1h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1Zm20 0h-2c-.55 0-1-.45-1-1s.45-1 1-1h2c.55 0 1 .45 1 1s-.45 1-1 1Zm-11 9v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1s-1-.45-1-1ZM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .38-.39.39-1.03 0-1.41L5.99 4.58Zm10.96 12.37c.38-.39 1.02-.39 1.41 0l1.06 1.06c.39.38.39 1.02 0 1.41-.38.39-1.02.39-1.41 0l-1.06-1.06c-.39-.38-.39-1.02 0-1.41Zm2.47-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41.39.38 1.03.39 1.41 0l1.06-1.06ZM7.05 16.95c.39.38.39 1.02 0 1.41l-1.06 1.06c-.38.39-1.02.38-1.41 0-.39-.38-.39-1.02 0-1.41l1.06-1.06c.38-.39 1.02-.39 1.41 0Z",clipRule:"evenodd"}),"ThemeModeLight");return ci.default=i,ci}()),Hi=t(function(){if(ui)return pi;ui=1;var e=le;Object.defineProperty(pi,"__esModule",{value:!0}),pi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.0547 11.9995c0-6.0436 4.8993-10.9429 10.9428-10.9429 6.0436 0 10.9429 4.8993 10.9429 10.9429s-4.8993 10.9429-10.9429 10.9429c-6.0435 0-10.9428-4.8993-10.9428-10.9429Zm10.9428-9.0572c-5.002 0-9.0571 4.055-9.0571 9.0572 0 5.0021 4.055 9.0571 9.0571 9.0571 5.0022 0 9.0572-4.055 9.0572-9.0571s-4.055-9.0572-9.0572-9.0572Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.0061 5.0566a.9428.9428 0 0 1 .9427.943l-.0005 5.6138 3.9635 3.9635a.9429.9429 0 0 1-1.3334 1.3334l-4.2397-4.2397a.9427.9427 0 0 1-.2762-.6668l.0006-6.0044a.9429.9429 0 0 1 .943-.9428Z",clipRule:"evenodd"},"1")],"Time");return pi.default=i,pi}()),Zi=t(function(){if(hi)return mi;hi=1;var e=le;Object.defineProperty(mi,"__esModule",{value:!0}),mi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M12 0c6.6274 0 12 5.3726 12 12s-5.3726 12-12 12S0 18.6274 0 12 5.3726 0 12 0Zm.6 1.2h-1.2v21.6h1.2V1.2Z"}),"TokenPair");return mi.default=i,mi}()),zi=t(function(){if(xi)return gi;xi=1;var e=le;Object.defineProperty(gi,"__esModule",{value:!0}),gi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M12 0c6.6274 0 12 5.3726 12 12s-5.3726 12-12 12S0 18.6274 0 12 5.3726 0 12 0Zm0 1.5v21c5.799 0 10.5-4.701 10.5-10.5S17.799 1.5 12 1.5Z"}),"TokenSingle");return gi.default=i,gi}()),$i=t(function(){if(fi)return yi;fi=1;var e=le;Object.defineProperty(yi,"__esModule",{value:!0}),yi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 2c-5.33 4.55-8 8.48-8 11.8 0 4.98 3.8 8.2 8 8.2s8-3.22 8-8.2c0-3.32-2.67-7.25-8-11.8ZM7.83 14c.37 0 .67.26.74.62.41 2.22 2.28 2.98 3.64 2.87.43-.02.79.32.79.75 0 .4-.32.73-.72.75-2.13.13-4.62-1.09-5.19-4.12-.08-.45.28-.87.74-.87Z",clipRule:"evenodd"}),"TotalLiquidity");return yi.default=i,yi}()),Gi=t(function(){if(vi)return bi;vi=1;var e=le;Object.defineProperty(bi,"__esModule",{value:!0}),bi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3Zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3Zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5Zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5Z",clipRule:"evenodd"}),"Traders");return bi.default=i,bi}()),Qi=t(function(){if(Ci)return ji;Ci=1;var e=le;Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.5969 7.1862c1.5039-1.9757 5.3933-5.7177 6.2353-5.1229.7495.5295-1.1684 4.3167-2.6596 6.5359C19.141 10.1349 22 14.4786 22 19.5966c0 .901-.396 1.675-1.0762 2.3224-.2124.2022-.5209-.0004-.5022-.3183.0027-.046.004-.0926.004-.1395 0-5.2974-3.7434-9.4646-8.4256-9.4646s-8.53 4.1672-8.53 9.4646c0 .0191.0002.0381.0007.0571.0073.3186-.3135.4889-.519.2774C2.3479 21.1739 2 20.441 2 19.5966c0-4.8332 2.5497-8.9759 6.1745-10.7178-.3435-1.7536-.223-4.7651.7387-4.8757.7814-.0898 1.8877 1.762 2.5293 3.3936l.1544-.2105ZM15 16c.5523 0 1 1.0508 1 2.347C16 19.6433 15.5523 20 15 20s-1-.3567-1-1.653c0-1.2962.4477-2.347 1-2.347Zm-8.4295 0L12 18.7221 7.0884 20l-.3281-.9263 2.438-.6345L6 16.8357 6.5705 16Z",clipRule:"evenodd"}),"VDODO");return ji.default=i,ji}()),Yi=t(function(){if(wi)return ki;wi=1;var e=le;Object.defineProperty(ki,"__esModule",{value:!0}),ki.default=void 0;var t=e(ue()),n=z,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 20h4V4h-4v16Zm-6 0h4v-8H4v8ZM16 9v11h4V9h-4Z",clipRule:"evenodd"}),"Volume");return ki.default=i,ki}()),Xi=t(function(){if(Ti)return Bi;Ti=1;var e=le;Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var t=e(ue()),n=z,i=(0,t.default)([(0,n.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.0267 0h9.9466L24 7.0267v9.9466L16.9733 24H7.0267L0 16.9733V7.0267L7.0267 0Zm8.84 21.3333 5.4666-5.4666V8.1333l-5.4666-5.4666H8.1333L2.6667 8.1333v7.7334l5.4666 5.4666h7.7334Z",clipRule:"evenodd"},"0"),(0,n.jsx)("path",{fill:"currentColor",d:"M13.381 5.9523h-2.7619v7.9524h2.7619V5.9523ZM12 18.0475c.7627 0 1.381-.6182 1.381-1.3809s-.6183-1.381-1.381-1.381-1.3809.6183-1.3809 1.381.6182 1.3809 1.3809 1.3809Z"},"1")],"Warn");return Bi.default=i,Bi}())}(oe);const Ei={[r.ChainId.MAINNET]:["https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io","https://rpc.ankr.com/eth"],[r.ChainId.GOERLI]:["https://gateway.tenderly.co/public/goerli"],[r.ChainId.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org"],[r.ChainId.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon"],[r.ChainId.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[r.ChainId.ARBITRUM_SEPOLIA]:["https://sepolia-rollup.arbitrum.io/rpc"],[r.ChainId.AURORA]:["https://mainnet.aurora.dev/"],[r.ChainId.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[r.ChainId.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[r.ChainId.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[r.ChainId.CONFLUX]:["https://evm.confluxrpc.com"],[r.ChainId.BASE]:["https://mainnet.base.org"],[r.ChainId.LINEA]:["https://rpc.linea.build"],[r.ChainId.SCROLL]:["https://rpc.scroll.io"],[r.ChainId.MANTA]:["https://pacific-rpc.manta.network/http"],[r.ChainId.MANTLE]:["https://rpc.mantle.xyz"],[r.ChainId.SEPOLIA]:["https://ethereum-sepolia-rpc.publicnode.com"],[r.ChainId.DODO_CHAIN_TESTNET]:["https://dodochain-testnet.alt.technology"],[r.ChainId.TAIKO]:["https://rpc.mainnet.taiko.xyz"],[r.ChainId.PLUME]:["https://phoenix-rpc.plumenetwork.xyz"],[r.ChainId.PLUME_TESTNET]:["https://test-rpc.plumenetwork.xyz"],[r.ChainId.NEOX]:["https://mainnet-1.rpc.banelabs.org"],[r.ChainId.MORPH]:["https://rpc.morphl2.io"],[r.ChainId.RISE_TESTNET]:["https://testnet.riselabs.xyz"],[r.ChainId.ZETACHAIN]:["https://zetachain-evm.blockpi.network/v1/rpc/public"],[r.ChainId.ZETACHAIN_TESTNET]:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"],[r.ChainId.SOLANA]:[l.clusterApiUrl("mainnet-beta")],[r.ChainId.SOLANA_DEVNET]:[l.clusterApiUrl("devnet")],[r.ChainId.BTC]:["https://rpc.walletconnect.org/v1"],[r.ChainId.BTC_SIGNET]:["https://rpc.walletconnect.org/v1"]},Ii=e=>{const t={};return Object.entries(Ei).forEach((([e,n])=>{const i=Number(e),o=n,[r]=o;r&&(t[i]=r)})),t},Ai={[r.ChainId.MAINNET]:"etherscan.io",[r.ChainId.GOERLI]:"goerli.etherscan.io",[r.ChainId.OPTIMISM]:"optimistic.etherscan.io",[r.ChainId.CONFLUX]:"snowtrace.io",[r.ChainId.BSC]:"bscscan.com",[r.ChainId.OKCHAIN]:"www.oklink.com/okexchain",[r.ChainId.POLYGON]:"polygonscan.com",[r.ChainId.ARBITRUM_ONE]:"arbiscan.io",[r.ChainId.ARBITRUM_SEPOLIA]:"sepolia.arbiscan.io",[r.ChainId.AURORA]:"aurorascan.dev",[r.ChainId.AVALANCHE]:"snowtrace.io",[r.ChainId.BASE]:"basescan.org",[r.ChainId.LINEA]:"lineascan.build",[r.ChainId.SCROLL]:"scrollscan.com",[r.ChainId.MANTA]:"pacific-explorer.manta.network",[r.ChainId.MANTLE]:"explorer.mantle.xyz",[r.ChainId.SEPOLIA]:"sepolia.etherscan.io",[r.ChainId.DODO_CHAIN_TESTNET]:"dodochain-testnet-explorer.alt.technology",[r.ChainId.TAIKO]:"taikoscan.io",[r.ChainId.PLUME]:"phoenix-explorer.plumenetwork.xyz",[r.ChainId.PLUME_TESTNET]:"test-explorer.plumenetwork.xyz",[r.ChainId.NEOX]:"xexplorer.neo.org",[r.ChainId.MORPH]:"explorer.morphl2.io",[r.ChainId.RISE_TESTNET]:"explorer.testnet.riselabs.xyz",[r.ChainId.ZETACHAIN]:"zetachain.blockscout.com",[r.ChainId.ZETACHAIN_TESTNET]:"zetachain-testnet.blockscout.com",[r.ChainId.SOLANA]:"solscan.io",[r.ChainId.SOLANA_DEVNET]:"solscan.io",[r.ChainId.BTC]:"mempool.space",[r.ChainId.BTC_SIGNET]:"mempool.space/signet"},Si={[r.ChainId.BSC]:"bsc",[r.ChainId.MAINNET]:"ethereum-mainnet",[r.ChainId.POLYGON]:"polygon",[r.ChainId.ARBITRUM_ONE]:"arbitrum",[r.ChainId.ARBITRUM_SEPOLIA]:"arb-sep",[r.ChainId.OKCHAIN]:"okchain",[r.ChainId.OPTIMISM]:"optimism",[r.ChainId.AURORA]:"aurora",[r.ChainId.AVALANCHE]:"avalanche",[r.ChainId.GOERLI]:"gor",[r.ChainId.CONFLUX]:"cfx",[r.ChainId.BASE]:"base",[r.ChainId.LINEA]:"linea",[r.ChainId.SCROLL]:"scr",[r.ChainId.MANTA]:"manta",[r.ChainId.MANTLE]:"mantle",[r.ChainId.SEPOLIA]:"sepolia",[r.ChainId.DODO_CHAIN_TESTNET]:"dodochain-testnet",[r.ChainId.TAIKO]:"taiko",[r.ChainId.PLUME]:"plume",[r.ChainId.PLUME_TESTNET]:"plume-testnet",[r.ChainId.NEOX]:"neox",[r.ChainId.MORPH]:"morph",[r.ChainId.RISE_TESTNET]:"rise-testnet",[r.ChainId.ZETACHAIN]:"zetachain",[r.ChainId.ZETACHAIN_TESTNET]:"zetachain-testnet",[r.ChainId.SOLANA]:"solana",[r.ChainId.SOLANA_DEVNET]:"solana-devnet",[r.ChainId.BTC]:"btc",[r.ChainId.BTC_SIGNET]:"btc-signet"};r.ChainId.MAINNET,r.ChainId.GOERLI,r.ChainId.OPTIMISM,r.ChainId.CONFLUX,r.ChainId.BSC,r.ChainId.OKCHAIN,r.ChainId.POLYGON,r.ChainId.ARBITRUM_ONE,r.ChainId.ARBITRUM_SEPOLIA,r.ChainId.AURORA,r.ChainId.AVALANCHE,r.ChainId.BASE,r.ChainId.LINEA,r.ChainId.SCROLL,r.ChainId.MANTA,r.ChainId.MANTLE,r.ChainId.SEPOLIA,r.ChainId.DODO_CHAIN_TESTNET,r.ChainId.TAIKO,r.ChainId.PLUME,r.ChainId.PLUME_TESTNET,r.ChainId.NEOX,r.ChainId.MORPH,r.ChainId.RISE_TESTNET,r.ChainId.ZETACHAIN,r.ChainId.ZETACHAIN_TESTNET,r.ChainId.SOLANA,r.ChainId.SOLANA_DEVNET,r.ChainId.BTC,r.ChainId.BTC_SIGNET,r.ChainId.MAINNET,r.ChainId.GOERLI,r.ChainId.OPTIMISM,r.ChainId.CONFLUX,r.ChainId.BSC,r.ChainId.OKCHAIN,r.ChainId.POLYGON,r.ChainId.ARBITRUM_ONE,r.ChainId.ARBITRUM_SEPOLIA,r.ChainId.AURORA,r.ChainId.AVALANCHE,r.ChainId.BASE,r.ChainId.LINEA,r.ChainId.SCROLL,r.ChainId.MANTA,r.ChainId.MANTLE,r.ChainId.SEPOLIA,r.ChainId.DODO_CHAIN_TESTNET,r.ChainId.TAIKO,r.ChainId.PLUME,r.ChainId.PLUME_TESTNET,r.ChainId.NEOX,r.ChainId.MORPH,r.ChainId.RISE_TESTNET,r.ChainId.ZETACHAIN,r.ChainId.ZETACHAIN_TESTNET,r.ChainId.SOLANA,r.ChainId.SOLANA_DEVNET,r.ChainId.BTC,r.ChainId.BTC_SIGNET;const Li={key:"Flashbots",name:"Flashbots",logo:"https://docs.flashbots.net/img/logo.png",docUrl:"https://docs.flashbots.net/new-to-mev",addChainParameters:{chainId:"0x1",chainName:"Flashbots Protect",rpcUrls:["https://rpc.flashbots.net/fast"],nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},blockExplorerUrls:["https://etherscan.io/"]},isPrivacyEndpoint:{contract:"0xf1a54b0759b58661cEa17CfF19dd37940a9b5f1A",rpcMethod:"isFlashRPC"}},Mi={key:"Blocknative",name:"Blocknative",logo:"https://docs.blocknative.com/~gitbook/image?url=https%3A%2F%2F3295439492-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LmQ_1MIOGRk17Wz50Bx%252Ficon%252Fi7MyzIYm9BywxU73iEwF%252FBlocknative-Favicon.png%3Falt%3Dmedia%26token%3Dcd2df16c-3180-4ed4-b5f3-f8be6bd13767&width=32&dpr=2&quality=100&sign=c6dab474&sv=2",docUrl:"https://docs.blocknative.com/",addChainParameters:{chainId:"0x1",chainName:"Blocknative",rpcUrls:["https://rpc.blocknative.com/boost"],nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},blockExplorerUrls:["https://etherscan.io/"]},isPrivacyEndpoint:{contract:"0x76838FdE3Aeb876dC10E6e3bB2a1757dEA58a25C",rpcMethod:"isBlocknativeRPC"}},Ri={[r.ChainId.MAINNET]:[Li,Mi],[r.ChainId.GOERLI]:[],[r.ChainId.OPTIMISM]:[],[r.ChainId.CONFLUX]:[],[r.ChainId.BSC]:[],[r.ChainId.OKCHAIN]:[],[r.ChainId.POLYGON]:[],[r.ChainId.ARBITRUM_ONE]:[],[r.ChainId.ARBITRUM_SEPOLIA]:[],[r.ChainId.AURORA]:[],[r.ChainId.AVALANCHE]:[],[r.ChainId.BASE]:[],[r.ChainId.LINEA]:[],[r.ChainId.SCROLL]:[],[r.ChainId.MANTA]:[],[r.ChainId.MANTLE]:[],[r.ChainId.SEPOLIA]:[Li,Mi],[r.ChainId.DODO_CHAIN_TESTNET]:[],[r.ChainId.TAIKO]:[],[r.ChainId.PLUME]:[],[r.ChainId.PLUME_TESTNET]:[],[r.ChainId.NEOX]:[],[r.ChainId.MORPH]:[],[r.ChainId.RISE_TESTNET]:[],[r.ChainId.ZETACHAIN]:[],[r.ChainId.ZETACHAIN_TESTNET]:[],[r.ChainId.SOLANA]:[],[r.ChainId.SOLANA_DEVNET]:[],[r.ChainId.BTC]:[],[r.ChainId.BTC_SIGNET]:[]};var Oi;!function(e){e.routePrice="routePrice",e.solanaRoutePrice="solanaRoutePrice",e.fiatPrice="fiatPrice",e.bridgeRoutePrice="bridgeRoutePrice",e.bridgeEncode="bridgeEncode",e.bridgeCreateRoute="bridgeCreateRoute"}(Oi||(Oi={}));const Pi="https://api.dodoex.io/cross-chain/widget",_i="https://api.dodoex.io/route-service/zetachain/swap",Di="https://api.dodoex.io/route-service/zetachain/svm/swap",Ni="https://api.dodoex.io/frontend-price-api-v2/current/batch",Fi=`${Pi}/routes`,Ui=`${Pi}/transaction/encode`,qi=`${Pi}/order/create`;function Vi(e,t={}){var n,i,o,r,a,s;switch(e){case Oi.routePrice:return null!==(n=t.routePrice)&&void 0!==n?n:_i;case Oi.solanaRoutePrice:return null!==(i=t.solanaRoutePrice)&&void 0!==i?i:Di;case Oi.fiatPrice:return null!==(o=t.fiatPrice)&&void 0!==o?o:Ni;case Oi.bridgeRoutePrice:return null!==(r=t.bridgeRoutePrice)&&void 0!==r?r:Fi;case Oi.bridgeEncode:return null!==(a=t.bridgeEncode)&&void 0!==a?a:Ui;case Oi.bridgeCreateRoute:return null!==(s=t.bridgeCreateRoute)&&void 0!==s?s:qi;default:throw new Error(`Invalid key = ${e}`)}}const Wi=new r.ContractRequests({rpc:Ii()}),Hi=new r.TokenApi({contractRequests:Wi});var Zi,zi,$i,Gi,Qi;function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Yi.apply(null,arguments)}var Xi,Ki;function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ji.apply(null,arguments)}var eo,to;function no(){return no=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},no.apply(null,arguments)}var io,oo,ro;function ao(){return ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ao.apply(null,arguments)}var so;function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},lo.apply(null,arguments)}var co,uo,po;function ho(){return ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ho.apply(null,arguments)}var mo,xo;function go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},go.apply(null,arguments)}const fo=e=>P.createElement("svg",go({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),mo||(mo=P.createElement("g",{clipPath:"url(#clip0_5431_179637)"},P.createElement("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"#F2F4F7"}),P.createElement("path",{d:"M12.3735 3V9.6525L17.9963 12.165L12.3735 3Z",fill:"#343434"}),P.createElement("path",{d:"M12.3735 3L6.75 12.165L12.3735 9.6525V3Z",fill:"#8C8C8C"}),P.createElement("path",{d:"M12.3735 16.4759V20.9962L18 13.2119L12.3735 16.4759Z",fill:"#3C3C3B"}),P.createElement("path",{d:"M12.3735 20.9962V16.4752L6.75 13.2119L12.3735 20.9962Z",fill:"#8C8C8C"}),P.createElement("path",{d:"M12.3735 15.4298L17.9963 12.1651L12.3735 9.65405V15.4298Z",fill:"#141414"}),P.createElement("path",{d:"M6.75 12.1651L12.3735 15.4298V9.65405L6.75 12.1651Z",fill:"#393939"}))),xo||(xo=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_5431_179637"},P.createElement("rect",{width:24,height:24,fill:"white"})))));var yo,vo;function bo(){return bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},bo.apply(null,arguments)}var Co,jo,wo,ko;function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},To.apply(null,arguments)}const Bo=e=>P.createElement("svg",To({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),P.createElement("g",{clipPath:"url(#clip0_10530_9160)"},Co||(Co=P.createElement("rect",{width:24,height:24,fill:"black"})),P.createElement("g",{clipPath:"url(#clip1_10530_9160)"},P.createElement("mask",{id:"mask0_10530_9160",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:4,y:5,width:16,height:14},jo||(jo=P.createElement("path",{d:"M19.0117 5.69995H4.97998V18.272H19.0117V5.69995Z",fill:"white"}))),wo||(wo=P.createElement("g",{mask:"url(#mask0_10530_9160)"},P.createElement("path",{d:"M18.9394 15.6121L16.6231 18.1008C16.5727 18.1549 16.5118 18.1979 16.4441 18.2274C16.3764 18.2569 16.3034 18.2721 16.2296 18.272H5.24889C5.1965 18.272 5.14525 18.2567 5.10143 18.2279C5.05762 18.1991 5.02315 18.1581 5.00227 18.11C4.98138 18.0619 4.97499 18.0087 4.98388 17.9569C4.99276 17.9052 5.01654 17.8572 5.05228 17.8188L7.37039 15.3302C7.42061 15.2762 7.48134 15.2332 7.54882 15.2038C7.61631 15.1743 7.68911 15.1591 7.76272 15.1589H18.7428C18.7952 15.1589 18.8464 15.1743 18.8902 15.203C18.9341 15.2318 18.9685 15.2728 18.9894 15.321C19.0103 15.3691 19.0167 15.4223 19.0078 15.474C18.9989 15.5258 18.9752 15.5737 18.9394 15.6121ZM16.6231 10.6007C16.5727 10.5466 16.5118 10.5035 16.4441 10.4741C16.3764 10.4446 16.3034 10.4294 16.2296 10.4294H5.24889C5.1965 10.4294 5.14525 10.4448 5.10143 10.4736C5.05762 10.5023 5.02315 10.5433 5.00227 10.5914C4.98138 10.6396 4.97499 10.6928 4.98388 10.7445C4.99276 10.7963 5.01654 10.8442 5.05228 10.8826L7.37039 13.3713C7.42061 13.4252 7.48134 13.4682 7.54882 13.4977C7.61631 13.5272 7.68911 13.5424 7.76272 13.5425H18.7428C18.7952 13.5425 18.8464 13.5272 18.8902 13.4984C18.9341 13.4696 18.9685 13.4286 18.9894 13.3805C19.0103 13.3324 19.0167 13.2791 19.0078 13.2274C18.9989 13.1757 18.9752 13.1277 18.9394 13.0893L16.6231 10.6007ZM5.24889 8.81303H16.2296C16.3034 8.81307 16.3764 8.79789 16.4441 8.76843C16.5118 8.73898 16.5727 8.69588 16.6231 8.64181L18.9394 6.15314C18.9752 6.11477 18.9989 6.06677 19.0078 6.01504C19.0167 5.96331 19.0103 5.91011 18.9894 5.86197C18.9685 5.81383 18.9341 5.77285 18.8902 5.74407C18.8464 5.71529 18.7952 5.69995 18.7428 5.69995H7.76272C7.68911 5.70008 7.61631 5.71534 7.54882 5.74479C7.48134 5.77424 7.42061 5.81726 7.37039 5.87117L5.05288 8.35984C5.01717 8.39818 4.9934 8.44612 4.9845 8.4978C4.97559 8.54947 4.98193 8.60262 5.00274 8.65074C5.02356 8.69885 5.05793 8.73984 5.10165 8.76867C5.14538 8.7975 5.19655 8.81291 5.24889 8.81303Z",fill:"url(#paint0_linear_10530_9160)"}))))),ko||(ko=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_10530_9160",x1:6.16443,y1:18.5716,x2:17.7026,y2:5.58804,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{offset:.08,stopColor:"#9945FF"}),P.createElement("stop",{offset:.3,stopColor:"#8752F3"}),P.createElement("stop",{offset:.5,stopColor:"#5497D5"}),P.createElement("stop",{offset:.6,stopColor:"#43B4CA"}),P.createElement("stop",{offset:.72,stopColor:"#28E0B9"}),P.createElement("stop",{offset:.97,stopColor:"#19FB9B"})),P.createElement("clipPath",{id:"clip0_10530_9160"},P.createElement("rect",{width:24,height:24,rx:12,fill:"white"})),P.createElement("clipPath",{id:"clip1_10530_9160"},P.createElement("rect",{width:14.0349,height:12.6,fill:"white",transform:"translate(4.97998 5.69995)"})))));var Eo,Io;function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ao.apply(null,arguments)}const So=e=>P.createElement("svg",Ao({width:32,height:32,viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Eo||(Eo=P.createElement("g",{clipPath:"url(#clip0_1737_111)"},P.createElement("path",{d:"M45 89.5C69.5767 89.5 89.5 69.5767 89.5 45C89.5 20.4233 69.5767 0.5 45 0.5C20.4233 0.5 0.5 20.4233 0.5 45C0.5 69.5767 20.4233 89.5 45 89.5Z",fill:"#005741"}),P.createElement("path",{d:"M56.5594 54.836V60.846H31.7663C32.1083 56.8905 33.3847 54.1075 37.7986 50.194L56.5594 34.1889V48.2337H63.3129V22.3945H24.9112V35.2744H31.6647V29.148H52.0664L33.3971 45.0812L33.3524 45.1233C25.5283 52.0505 24.9062 57.6415 24.9062 64.229V67.6045H63.3154V54.841H56.5619L56.5594 54.836Z",fill:"white"}))),Io||(Io=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_1737_111"},P.createElement("rect",{width:89,height:89,fill:"white",transform:"translate(0.5 0.5)"}))))),Lo="0x0000000000000000000000000000000000000000",Mo=e=>{if(!e)return Lo;const t=Ro.get(e);return t?t.fallbackAddress:Lo},Ro=new Map([[r.ChainId.MAINNET,{chainId:r.ChainId.MAINNET,logo:fo,name:"Ethereum",caipNetwork:d.mainnet,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.POLYGON,{chainId:r.ChainId.POLYGON,logo:e=>P.createElement("svg",bo({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),yo||(yo=P.createElement("defs",null,P.createElement("circle",{id:"path-1",cx:12,cy:12,r:12}))),vo||(vo=P.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},P.createElement("g",{transform:"translate(-223.000000, -266.000000)"},P.createElement("g",{transform:"translate(18.000000, 132.000000)"},P.createElement("g",{transform:"translate(20.000000, 41.000000)"},P.createElement("g",{transform:"translate(156.000000, 82.000000)"},P.createElement("g",{transform:"translate(29.000000, 11.000000)"},P.createElement("mask",{id:"mask-2",fill:"white"},P.createElement("use",{xlinkHref:"#path-1"})),P.createElement("g",null),P.createElement("g",{mask:"url(#mask-2)"},P.createElement("circle",{fill:"#8247E5",fillRule:"nonzero",cx:12,cy:12,r:12}),P.createElement("path",{d:"M8.01148,5.30068 C8.25312,5.16644 8.54688,5.16644 8.78852,5.30068 L12.38852,7.30068 C12.64248,7.44176 12.8,7.70948 12.8,8 L12.8,9.30068 L11.2,10.2 L11.2,8.47072 L8.4,6.91516 L5.6,8.47072 L5.6,11.52928 L8.4,13.08484 L15.21148,9.30068 C15.45312,9.16644 15.74688,9.16644 15.98852,9.30068 L19.58852,11.30068 C19.84248,11.44176 20,11.70948 20,12 L20,16 C20,16.29052 19.84248,16.55824 19.58852,16.69932 L15.98852,18.69932 C15.74688,18.83356 15.45312,18.83356 15.21148,18.69932 L11.61148,16.69932 C11.35752,16.55824 11.2,16.29052 11.2,16 L11.2,14.69932 L12.8,13.8 L12.8,15.52928 L15.6,17.08484 L18.4,15.52928 L18.4,12.47072 L15.6,10.91516 L8.78852,14.69932 C8.54688,14.83356 8.25312,14.83356 8.01148,14.69932 L4.41148,12.69932 C4.15752,12.55824 4,12.29052 4,12 L4,8 C4,7.70948 4.15752,7.44176 4.41148,7.30068 L8.01148,5.30068 Z",fill:"#FFFFFF"})))))))))),name:"Polygon",caipNetwork:d.polygon,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.BSC,{chainId:r.ChainId.BSC,logo:e=>P.createElement("svg",ao({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"7.5in",height:"7.5in",style:{shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",imageRendering:"optimizeQuality",fillRule:"evenodd",clipRule:"evenodd"},viewBox:"0 0 7500 7500"},e),io||(io=P.createElement("defs",null,P.createElement("style",{type:"text/css"},".fil0 {fill:none}\n .fil1 {fill:#f0b90b}\n .fil2 {fill:#fff}"))),oo||(oo=P.createElement("g",{id:"Layer_x0020_1"},P.createElement("metadata",{id:"CorelCorpID_0Corel-Layer"}),P.createElement("rect",{className:"fil0",width:7500,height:7500}),P.createElement("g",{id:"_2419820813232"},P.createElement("circle",{className:"fil1",cx:3750,cy:3750,r:3500}),P.createElement("g",null,P.createElement("path",{className:"fil2",d:"M2779 3351l971 -971 971 972 565 -565 -1536 -1537 -1536 1536 565 565 0 0zm-1529 399l565 -565 565 565 -565 565 -565 -565zm1529 399l971 971 971 -972 566 565 0 0 -1537 1537 -1536 -1536 -1 -1 566 -564 0 0zm2341 -399l565 -565 565 565 -565 565 -565 -565z"})),P.createElement("g",null,P.createElement("path",{className:"fil2",d:"M4380 3750l0 0 -630 -632 -466 467 0 0 -54 54 -111 111 -1 1 1 1 630 630 631 -631 0 0 0 0 0 -1zm0 0l0 0 0 0z"}))))),ro||(ro=P.createElement("style",{xmlns:""},"#yddContainer{display:block;font-family:Microsoft YaHei;position:relative;width:100%;height:100%;top:-4px;left:-4px;font-size:12px;border:1px solid}#yddTop{display:block;height:22px}#yddTopBorderlr{display:block;position:static;height:17px;padding:2px 28px;line-height:17px;font-size:12px;color:#5079bb;font-weight:bold;border-style:none solid;border-width:1px}#yddTopBorderlr .ydd-sp{position:absolute;top:2px;height:0;overflow:hidden}.ydd-icon{left:5px;width:17px;padding:0px 0px 0px 0px;padding-top:17px;background-position:-16px -44px}.ydd-close{right:5px;width:16px;padding-top:16px;background-position:left -44px}#yddKeyTitle{float:left;text-decoration:none}#yddMiddle{display:block;margin-bottom:10px}.ydd-tabs{display:block;margin:5px 0;padding:0 5px;height:18px;border-bottom:1px solid}.ydd-tab{display:block;float:left;height:18px;margin:0 5px -1px 0;padding:0 4px;line-height:18px;border:1px solid;border-bottom:none}.ydd-trans-container{display:block;line-height:160%}.ydd-trans-container a{text-decoration:none;}#yddBottom{position:absolute;bottom:0;left:0;width:100%;height:22px;line-height:22px;overflow:hidden;background-position:left -22px}.ydd-padding010{padding:0 10px}#yddWrapper{color:#252525;z-index:10001;background:url(chrome-extension://eopjamdnofihpioajgfdikhhbobonhbb/ab20.png);}#yddContainer{background:#fff;border-color:#4b7598}#yddTopBorderlr{border-color:#f0f8fc}#yddWrapper .ydd-sp{background-image:url(chrome-extension://eopjamdnofihpioajgfdikhhbobonhbb/ydd-sprite.png)}#yddWrapper a,#yddWrapper a:hover,#yddWrapper a:visited{color:#50799b}#yddWrapper .ydd-tabs{color:#959595}.ydd-tabs,.ydd-tab{background:#fff;border-color:#d5e7f3}#yddBottom{color:#363636}#yddWrapper{min-width:250px;max-width:400px;}"))),name:d.bsc.name,caipNetwork:d.bsc,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.BASE,{chainId:r.ChainId.BASE,logo:e=>P.createElement("svg",no({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),eo||(eo=P.createElement("path",{d:"M16 32C19.1645 32 22.2579 31.0616 24.8891 29.3035C27.5203 27.5454 29.5711 25.0466 30.7821 22.1229C31.9931 19.1993 32.3099 15.9823 31.6926 12.8786C31.0752 9.77486 29.5513 6.92394 27.3137 4.6863C25.0761 2.44866 22.2251 0.924806 19.1214 0.307443C16.0177 -0.309921 12.8007 0.00693265 9.87706 1.21793C6.95345 2.42894 4.45459 4.4797 2.69649 7.11088C0.938384 9.74207 0 12.8355 0 16C0 20.2435 1.68571 24.3131 4.68629 27.3137C7.68687 30.3143 11.7565 32 16 32Z",fill:"#0052FF"})),to||(to=P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9624 27.2676C22.1853 27.2676 27.23 22.223 27.23 16C27.23 9.7771 22.1853 4.73242 15.9624 4.73242C10.0588 4.73242 5.21562 9.27262 4.73409 15.0518H21.4544V16.9281H4.73242C5.20435 22.7169 10.0519 27.2676 15.9624 27.2676Z",fill:"white"}))),name:d.base.name,caipNetwork:d.base,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.ZETACHAIN,{chainId:r.ChainId.ZETACHAIN,logo:So,name:d.zetachain.name,caipNetwork:d.zetachain,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.AVALANCHE,{chainId:r.ChainId.AVALANCHE,logo:e=>P.createElement("svg",Ji({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Xi||(Xi=P.createElement("defs",null,P.createElement("circle",{id:"path-1",cx:12,cy:12,r:12}))),Ki||(Ki=P.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},P.createElement("g",null,P.createElement("mask",{fill:"white"},P.createElement("use",{xlinkHref:"#path-1"})),P.createElement("use",{fill:"#E84142",xlinkHref:"#path-1"}),P.createElement("g",{mask:"url(#mask-2)",fill:"#FFFFFF",fillRule:"nonzero"},P.createElement("g",{transform:"translate(5.000000, 5.000000)"},P.createElement("path",{d:"M3.51363108,13 L1.15960067,13 C0.664946832,13 0.420612287,13 0.271614013,12.9001615 C0.110719232,12.7911601 0.0123723422,12.6101909 0.000457589205,12.410743 C-0.00848303711,12.226815 0.113693358,12.0023407 0.358027903,11.5534302 L6.1704203,0.83471072 C6.41774722,0.379558003 6.54289774,0.1519721 6.70083664,0.0678061674 C6.87067205,-0.0226020558 7.07329583,-0.0226020558 7.24314949,0.0678061674 C7.40108839,0.1519721 7.52623891,0.379558003 7.77354758,0.83471072 L8.96845316,3.01699266 C9.23960959,3.51267254 9.37667486,3.76207783 9.43628512,4.0239486 C9.50182538,4.30763877 9.50182538,4.60692511 9.43628512,4.89061527 C9.37667486,5.15248605 9.24258371,5.40189134 8.97142729,5.89757122 L5.91831288,11.5440764 C5.64418233,12.0459985 5.50711706,12.2985154 5.31640802,12.4885903 C5.11079187,12.6943759 4.86348319,12.8440382 4.59230852,12.9282232 C4.34499985,13 4.06787693,13 3.51363108,13 Z"}),P.createElement("path",{d:"M12.8314423,13 L9.45829001,13 C8.96066205,13 8.710361,13 8.5643551,12.9003524 C8.40344207,12.7911601 8.30511343,12.6071366 8.29319868,12.4077078 C8.28425805,12.2237606 8.40940857,11.9993054 8.65970962,11.5472643 L10.3432113,8.52326579 C10.5906295,8.07746696 10.7157982,7.85612335 10.8707083,7.77193833 C11.0405802,7.6815301 11.2401933,7.6815301 11.4100652,7.77193833 C11.5680771,7.85612335 11.690144,8.07746696 11.9404816,8.52015419 L13.6300775,11.5441527 C13.8802326,11.9961938 14.0085032,12.220649 13.9995625,12.4045771 C13.9906219,12.6040822 13.8891732,12.7881057 13.7284244,12.8971072 C13.5793531,13 13.3290156,13 12.8314423,13 Z"}))))))),name:d.avalanche.name,caipNetwork:d.avalanche,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.SOLANA,{chainId:r.ChainId.SOLANA,logo:Bo,name:d.solana.name,caipNetwork:d.solana,isEVMChain:!1,isSolanaChain:!0,isBTCChain:!1,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.BTC,{chainId:r.ChainId.BTC,logo:e=>P.createElement("svg",ho({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),P.createElement("g",{id:"bitcoinchain 1",clipPath:"url(#clip0_68_34440)"},P.createElement("g",{id:"Clip path group"},P.createElement("mask",{id:"mask0_68_34440",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:0,y:0,width:24,height:24},co||(co=P.createElement("g",{id:"clip0_240_54028"},P.createElement("path",{id:"Vector",d:"M24 0H0V24H24V0Z",fill:"white"})))),uo||(uo=P.createElement("g",{mask:"url(#mask0_68_34440)"},P.createElement("g",{id:"Group"},P.createElement("path",{id:"Vector_2",d:"M23.6392 14.9031C22.0365 21.3316 15.5254 25.2441 9.09602 23.6409C2.66927 22.0382 -1.2431 15.5266 0.360399 9.09847C1.9624 2.6691 8.47352 -1.24365 14.901 0.359098C21.33 1.96185 25.242 8.4741 23.6392 14.9031Z",fill:"#E8AB61"}),P.createElement("path",{id:"Vector_3",d:"M17.2901 10.2908C17.5289 8.69402 16.3131 7.83564 14.6508 7.26302L15.1901 5.10002L13.8735 4.77189L13.3485 6.87789C13.0023 6.79164 12.6468 6.71027 12.2936 6.62964L12.8223 4.50977L11.5065 4.18164L10.9668 6.34389C10.6803 6.27864 10.3991 6.21414 10.1261 6.14627L10.1276 6.13952L8.31184 5.68614L7.96159 7.09239C7.96159 7.09239 8.93847 7.31627 8.91784 7.33014C9.45109 7.46327 9.54747 7.81614 9.53134 8.09589L8.91709 10.56C8.95384 10.5694 9.00147 10.5829 9.05397 10.6039C9.01009 10.593 8.96322 10.581 8.91484 10.5694L8.05384 14.0213C7.98859 14.1833 7.82322 14.4263 7.45047 14.334C7.46359 14.3531 6.49347 14.0951 6.49347 14.0951L5.83984 15.6022L7.55322 16.0294C7.87197 16.1092 8.18434 16.1929 8.49184 16.2717L7.94697 18.4594L9.26209 18.7875L9.80172 16.623C10.161 16.7205 10.5097 16.8105 10.851 16.8952L10.3132 19.0497L11.6298 19.3777L12.1747 17.1942C14.4198 17.619 16.1081 17.4477 16.8186 15.417C17.3913 13.782 16.7901 12.8389 15.6089 12.2239C16.4691 12.0255 17.1171 11.4596 17.2901 10.2908ZM14.2818 14.5091C13.875 16.1442 11.1221 15.2602 10.2296 15.0387L10.9526 12.1403C11.8451 12.363 14.7071 12.804 14.2818 14.5091ZM14.6891 10.2671C14.3178 11.7544 12.0266 10.9988 11.2833 10.8135L11.9388 8.18477C12.6821 8.37002 15.0756 8.71577 14.6891 10.2671Z",fill:"#101010"})))))),po||(po=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_68_34440"},P.createElement("rect",{width:24,height:24,fill:"white"}))))),name:d.bitcoin.name,caipNetwork:d.bitcoin,isEVMChain:!1,isSolanaChain:!1,isBTCChain:!0,isTestNet:!1,fallbackAddress:Lo}],[r.ChainId.SEPOLIA,{chainId:r.ChainId.SEPOLIA,logo:fo,name:d.sepolia.name,caipNetwork:d.sepolia,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!0,fallbackAddress:Lo}],[r.ChainId.ARBITRUM_SEPOLIA,{chainId:r.ChainId.ARBITRUM_SEPOLIA,logo:e=>P.createElement("svg",Yi({height:"692pt",viewBox:"0 0 619 692",width:"619pt",xmlns:"http://www.w3.org/2000/svg"},e),Zi||(Zi=P.createElement("path",{d:"m280.46 17.3c18.85-10.03 43.1-9.37 61.23 1.99 78.77 45.29 157.52 90.59 236.28 135.88 17.98 10.27 30.16 30.12 30.76 50.87v275.89c.49 19.03-8.56 38.11-23.76 49.6-83.95 48.66-167.91 97.29-251.9 145.88-14.93 5.88-32.32 5.81-47.05-.66-10.1-5.39-19.93-11.25-29.88-16.91-25.72-14.85-51.49-29.62-77.2-44.49 7.13-11.82 13.88-23.88 21.17-35.61 34.11 19.55 68.15 39.21 102.24 58.77 5.43 2.44 12.28 2.51 17.36-.81 28.11-16.31 56.23-32.61 84.36-48.89 28.58-16.52 57.15-33.07 85.69-49.67 7.92-4.6 15.84-9.2 23.78-13.77 14.97-8.59 29.86-17.33 44.83-25.93 5.77-3.22 8.74-10.05 8.75-16.47-.04-14.36.09-28.73-.07-43.09.18-76.95.01-153.9.09-230.85.24-7.26-3.78-14.44-10.07-18.06-79.37-45.64-158.72-91.3-238.08-136.94-6.26-3.47-14.38-3.15-20.42.66-78.73 45.56-157.48 91.1-236.15 136.78-6.59 3.53-10.68 11.06-10.31 18.5.21 73.45.1 146.9.48 220.34-12.68 20.02-25.84 39.75-38.67 59.68-.95 1.49-1.95 2.96-3.1 4.31-.23-95.74-.02-191.5-.1-287.25.31-22.52 14.44-43.97 34.72-53.61 78.35-45.36 156.61-90.87 235.02-136.14z",fill:"#8cbfdf"})),zi||(zi=P.createElement("path",{d:"m298.57 54.69c6.04-3.81 14.16-4.13 20.42-.66 79.36 45.64 158.71 91.3 238.08 136.94 6.29 3.62 10.31 10.8 10.07 18.06-.08 76.95.09 153.9-.09 230.85-6.25-8.84-11.77-18.21-17.74-27.25-38.11-59.38-76.26-118.73-114.34-178.12l-.71.13c-16.14 27.89-32.81 55.48-48.94 83.38 42.77 69.1 85.49 138.23 128.22 207.35-7.94 4.57-15.86 9.17-23.78 13.77-40.35-63.61-80.71-127.22-121.07-190.83l-.73-.41c-19.01 31.61-37.43 63.61-56.36 95.28 4.29 7.87 9.61 15.25 14.3 22.94 26.05 40.9 52.13 81.79 78.17 122.69-28.13 16.28-56.25 32.58-84.36 48.89-5.08 3.32-11.93 3.25-17.36.81-34.09-19.56-68.13-39.22-102.24-58.77 73.38-124.27 146.6-248.63 219.92-372.94l-.41-.3c-25.22.18-50.45.2-75.67.29-7.21.39-14.55-.37-21.69.39-73.43 121.29-146.88 242.57-220.46 363.77-8.47-4.83-16.92-9.69-25.34-14.61 19.61-32.21 39.88-64.05 59.74-96.12 51.98-83.37 103.96-166.73 155.94-250.1.66-1.19 1.78-2.22 1.79-3.66-13.31-.19-26.61-.72-39.92-.97-20.59.3-41.98 3.68-59.65 14.9-6.98 4.5-13.13 10.36-17.61 17.37-41.35 64.21-82.86 128.31-124.16 192.55-.38-73.44-.27-146.89-.48-220.34-.37-7.44 3.72-14.97 10.31-18.5 78.67-45.68 157.42-91.22 236.15-136.78z",fill:"#2b374d"})),$i||($i=P.createElement("path",{d:"m194.36 220.39c17.67-11.22 39.06-14.6 59.65-14.9 13.31.25 26.61.78 39.92.97-.01 1.44-1.13 2.47-1.79 3.66-51.98 83.37-103.96 166.73-155.94 250.1-19.86 32.07-40.13 63.91-59.74 96.12-13.05-7.52-26.09-15.05-39.14-22.57-9.44-4.83-16.23-13.58-21.12-22.76-2.5-5.29-4.79-10.85-5.38-16.71 1.15-1.35 2.15-2.82 3.1-4.31 12.83-19.93 25.99-39.66 38.67-59.68 41.3-64.24 82.81-128.34 124.16-192.55 4.48-7.01 10.63-12.87 17.61-17.37z",fill:"#fff"})),Gi||(Gi=P.createElement("path",{d:"m343.95 206.79c25.22-.09 50.45-.11 75.67-.29l.41.3c-73.32 124.31-146.54 248.67-219.92 372.94-7.29 11.73-14.04 23.79-21.17 35.61-25.73-14.78-51.42-29.61-77.14-44.4 73.58-121.2 147.03-242.48 220.46-363.77 7.14-.76 14.48 0 21.69-.39z",fill:"#fff"})),Qi||(Qi=P.createElement("g",{fill:"#00a2f7"},P.createElement("path",{d:"m434.26 234.64.71-.13c38.08 59.39 76.23 118.74 114.34 178.12 5.97 9.04 11.49 18.41 17.74 27.25.16 14.36.03 28.73.07 43.09-.01 6.42-2.98 13.25-8.75 16.47-14.97 8.6-29.86 17.34-44.83 25.93-42.73-69.12-85.45-138.25-128.22-207.35 16.13-27.9 32.8-55.49 48.94-83.38z"}),P.createElement("path",{d:"m311.6 443.18c18.93-31.67 37.35-63.67 56.36-95.28l.73.41c40.36 63.61 80.72 127.22 121.07 190.83-28.54 16.6-57.11 33.15-85.69 49.67-26.04-40.9-52.12-81.79-78.17-122.69-4.69-7.69-10.01-15.07-14.3-22.94z"})))),name:d.arbitrumSepolia.name,caipNetwork:d.arbitrumSepolia,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!0,fallbackAddress:Lo}],[r.ChainId.ZETACHAIN_TESTNET,{chainId:r.ChainId.ZETACHAIN_TESTNET,logo:So,name:r.zetachainTestnet.name,mainnet:r.ChainId.ZETACHAIN,caipNetwork:r.zetachainTestnet,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,isTestNet:!0,fallbackAddress:Lo}],[r.ChainId.SOLANA_DEVNET,{chainId:r.ChainId.SOLANA_DEVNET,logo:Bo,name:d.solanaDevnet.name,caipNetwork:d.solanaDevnet,isEVMChain:!1,isSolanaChain:!0,isBTCChain:!1,isTestNet:!0,fallbackAddress:"CVVQYs9Pi3t4it4KFpm3hxk97uDA6AVzNVJvGQTPH17n"}],[r.ChainId.BTC_SIGNET,{chainId:r.ChainId.BTC_SIGNET,logo:e=>P.createElement("svg",lo({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 65 65",width:22,height:22},e),so||(so=P.createElement("g",{transform:"translate(0.00630876,-0.00301984)"},P.createElement("path",{d:"m63.033,39.744c-4.274,17.143-21.637,27.576-38.782,23.301-17.138-4.274-27.571-21.638-23.295-38.78,4.272-17.145,21.635-27.579,38.775-23.305,17.144,4.274,27.576,21.64,23.302,38.784z",fill:"#b028aa"}),P.createElement("path",{fill:"#FFF",d:"m46.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z"})))),name:r.btcSignet.name,caipNetwork:r.btcSignet,isEVMChain:!1,isSolanaChain:!1,isBTCChain:!0,isTestNet:!0,fallbackAddress:"tb1qcrd8yvatjzpxl0ew29jsps2z595jpwtm5mj38v"}]]),Oo=e=>{var t;return!!(null===(t=Ro.get(e))||void 0===t?void 0:t.mainnet)},Po="DODO_WIDGET_LAST_FROM_TOKEN",_o="DODO_WIDGET_LAST_TO_TOKEN";function Do(e,t){localStorage.setItem("from"===e?Po:_o,t?JSON.stringify(t):"")}const No="DODO_WIDGET_SLIPPAGE_SWAP",Fo="DODO_WIDGET_SLIPPAGE_BRIDGE";const Uo={PoolEditPage:"risk-warning-once-pool-edit"};const qo=15,Vo=.2,Wo=50,Ho=20,Zo=3e4,zo=.5,$o="swap-review-btn",Go="swap-select-token-btn",Qo="select-token-btn",Yo="token-picker-wrapper",Xo="token-picker-item",Ko=u.create((e=>({tokenList:[],popularTokenList:[],slippageWithTokens:[]})));function Jo(e){const{tokenList:t,popularTokenList:n}=null!=e?e:Ko.getState();return i.unionBy(n,t,(e=>e.address.toLowerCase()+e.chainId+e.side))}function er({omniPlan:e,tokenList:t}){const n=[];return e&&e.forEach(((e,i)=>{var o;const r=t.find((t=>t.address.toLowerCase()===e.inToken.toLowerCase()&&t.chainId===Number(e.inChainId))),a=t.find((t=>t.address.toLowerCase()===e.outToken.toLowerCase()&&t.chainId===Number(e.outChainId)));n.push({id:`${e.inChainType}-${e.outChainType}-${e.type}-${e.inToken}-${e.outToken}-${e.inAmount}-${e.outAmount}-${i}`,tool:e.inChainType,toolDetails:{name:e.inChainType,logoURI:e.inChainType},type:e.type,estimate:{fromToken:null!=r?r:{address:e.inToken,symbol:e.inToken.slice(0,6),chainId:Number(e.inChainId),decimals:18,name:e.inToken.slice(0,6)},toToken:null!=a?a:{address:e.outToken,symbol:e.outToken.slice(0,6),chainId:Number(e.outChainId),decimals:18,name:e.outToken.slice(0,6)},fromTokenAmount:new s.BigNumber(e.inAmountWithOutDecimals),toTokenAmount:new s.BigNumber(e.outAmountWithOutDecimals)},swapSteps:null===(o=e.swapSteps)||void 0===o?void 0:o.map((n=>{const i=t.find((t=>t.address.toLowerCase()===n.inputToken.toLowerCase()&&t.chainId===Number(e.inChainId))),o=t.find((t=>t.address.toLowerCase()===n.outputToken.toLowerCase()&&t.chainId===Number(e.inChainId)));return Object.assign(Object.assign({},n),{inputToken:null!=i?i:{address:n.inputToken,symbol:n.inputToken.slice(0,6),chainId:Number(e.inChainId),decimals:18,name:n.inputToken.slice(0,6)},outputToken:null!=o?o:{address:n.outputToken,symbol:n.outputToken.slice(0,6),chainId:Number(e.inChainId),decimals:18,name:n.outputToken.slice(0,6)}})})),hash:e.hash,hashChainId:e.hashChainId?Number(e.hashChainId):void 0})})),{tool:"zetachain",toolDetails:{name:"zetachain",logoURI:"zetachain"},type:"Bridge",includedSteps:n}}var tr;function nr({input:e,showDecimals:t=4,showPrecisionDecimals:n=2,exponentialDecimalsAmount:i=8,showIntegerOnly:o=!1,showDecimalsOnly:r=!1,noGroupSeparator:a=!1,roundingMode:l=s.BigNumber.ROUND_DOWN}){const d=new s.BigNumber(e);if(d.isNaN())return"-";let c=d.dp(t,l);if(c.eq(0)&&(d.gt(0)||d.lt(0))){const e=null!=n?n:t;c=d.sd(e,s.BigNumber.ROUND_DOWN);const a=c.dp();if(a&&a>i&&!r&&!o)return c.toExponential();c=d.sd(null!=n?n:t,s.BigNumber.ROUND_DOWN)}return o&&(c=c.integerValue(s.BigNumber.ROUND_DOWN)),r&&(c=c.minus(c.integerValue(s.BigNumber.ROUND_DOWN))),a?c.toFormat({decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0}):c.toFormat()}function ir({input:e,decimals:t,showPrecisionDecimals:n=2,exponentialDecimalsAmount:i,noGroupSeparator:o}){if(null==e)return"-";const r=new s.BigNumber(e);if(r.isNaN())return"-";return nr({input:r,showDecimals:void 0===t?0:t>6?6:t>4?4:t,showPrecisionDecimals:n,exponentialDecimalsAmount:i,noGroupSeparator:o})}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(tr||(tr={}));function or(e){if("number"==typeof e)return or(new s.BigNumber(e));if(e.isNaN())return"NaN";if(e.isNegative())return`-${or(e.negated())}`;if(e.isZero())return"0";let t=e.integerValue(s.BigNumber.ROUND_FLOOR),n=e.minus(t),i="";for(;!t.isZero();){i=t.modulo(10).toString().toString()+i,t=t.idiv(10)}if(""===i&&(i="0"),n.isZero())return i;i+=".";let o=0;for(;!n.isZero()&&o<100;){const e=n.times(10),t=e.integerValue(s.BigNumber.ROUND_FLOOR);i+=t.toString(),n=e.minus(t),o+=1}return i}const rr=(e,t)=>{if("string"==typeof e&&!e.match(/[-+]?\d+(.+d+)?/))return e;const n=new s.BigNumber(e);if(t){let e=n.toFixed(t,s.BigNumber.ROUND_DOWN);return i=e,new s.BigNumber(i).isZero()&&(e=or(n.precision(t,s.BigNumber.ROUND_DOWN))),e}var i;return or(n)},ar=(e,t)=>{let n=e;const i=n.match("[0-9。.]+");n=i&&i.length>0?i[0]:"",n=n.replace("。",".");let o=0;if(n){const e=n.split("."),t=0===e[0].length?["0"]:[e[0]];e.length>1?t[1]=e.slice(1,e.length).join(""):t[0].length>1&&"0"===t[0][0]&&(t[0]=t[0].slice(1,t[0].length)),t.length>1&&(o=t[1].length),n=t.join(".")}return t>=0&&o>t?rr(n,t):n},sr=(e,t,n)=>new s.BigNumber(e).times(new s.BigNumber(10).pow(t)).dp(0),lr=(e,t)=>new s.BigNumber(e).div(new s.BigNumber(10).pow(t));function dr(e){return Number(e.toString().split(".")[0])}const cr=1e3,ur=1e6,pr=1e9;function hr(e){return new s.BigNumber(e).negated()}function mr(e,t=4){return!e||e.isNaN()?"-":e.eq(0)?"0":e.lte(1e-6)&&e.gte(-1e-6)?e.toExponential(2):e.lt(1)&&e.gt(-1)||e.lt(cr)&&e.gt(hr(cr))?nr({input:e,showDecimals:t}):e.lt(ur)&&e.gt(hr(ur))?`${nr({input:e.div(cr),showDecimals:2})}K`:`${nr({input:e.div(ur),showDecimals:2})}M`}function xr(e){if(!e||e.isNaN())return"-";if(e.isZero())return"0";if(e.lte(pr)&&e.gt(hr(pr)))return mr(e);const t=e.toExponential(2);if(t.includes("e+")){const[e,n]=t.split("e+");if(e&&n)return`${e}x10^${n}`}return t}function gr({input:e,showDecimals:t=2,roundingMode:n=s.BigNumber.ROUND_HALF_UP}){return null==e?"-":`${nr({input:new s.BigNumber(e||0).multipliedBy(100),showDecimals:t,roundingMode:n})}%`}const fr=(e,t=2)=>gr({input:e,showDecimals:t});function yr(e){return e?"unknown"===e.symbol?e.name:e.symbol:""}let vr=!1,br=!1;const Cr={debug:1,default:2,info:2,warning:3,error:4,off:5};let jr=Cr.default,wr=null;const kr=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Tr,Br;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Tr||(Tr={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(Br||(Br={}));const Er="0123456789abcdef";class Ir{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==Cr[n]&&this.throwArgumentError("invalid log level name","logLevel",e),jr>Cr[n]||console.log.apply(console,t)}debug(...e){this._log(Ir.levels.DEBUG,e)}info(...e){this._log(Ir.levels.INFO,e)}warn(...e){this._log(Ir.levels.WARNING,e)}makeError(e,t,n){if(br)return this.makeError("censored error",t,{});t||(t=Ir.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=Er[t[e]>>4],n+=Er[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push(`code=${t}`),i.push(`version=${this.version}`);const o=e;let r="";switch(t){case Br.NUMERIC_FAULT:{r="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":r+="-"+t;break;case"negative-power":case"negative-width":r+="-unsupported";break;case"unbound-bitwise-result":r+="-unbound-result"}break}case Br.CALL_EXCEPTION:case Br.INSUFFICIENT_FUNDS:case Br.MISSING_NEW:case Br.NONCE_EXPIRED:case Br.REPLACEMENT_UNDERPRICED:case Br.TRANSACTION_REPLACED:case Br.UNPREDICTABLE_GAS_LIMIT:r=t}r&&(e+=" [ See: https://links.ethers.org/v5-errors-"+r+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(n).forEach((function(e){a[e]=n[e]})),a}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,Ir.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,i){e||this.throwError(t,n,i)}assertArgument(e,t,n,i){e||this.throwArgumentError(t,n,i)}checkNormalize(e){kr&&this.throwError("platform missing String.prototype.normalize",Ir.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:kr})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Ir.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Ir.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,Ir.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,Ir.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Ir.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Ir.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Ir.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return wr||(wr=new Ir("logger/5.8.0")),wr}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Ir.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),vr){if(!e)return;this.globalLogger().throwError("error censorship permanent",Ir.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}br=!!e,vr=!!t}static setLogLevel(e){const t=Cr[e.toLowerCase()];null!=t?jr=t:Ir.globalLogger().warn("invalid log level - "+e)}static from(e){return new Ir(e)}}Ir.errors=Br,Ir.levels=Tr;const Ar=new Ir("bytes/5.8.0");function Sr(e){return!!e.toHexString}function Lr(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Lr(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Mr(e){return"number"==typeof e&&e==e&&e%1==0}function Rr(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Mr(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!Mr(n)||n<0||n>=256)return!1}return!0}function Or(e,t){if(t||(t={}),"number"==typeof e){Ar.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),Lr(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Sr(e)&&(e=e.toHexString()),Dr(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":Ar.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;e<n.length;e+=2)i.push(parseInt(n.substring(e,e+2),16));return Lr(new Uint8Array(i))}return Rr(e)?Lr(new Uint8Array(e)):Ar.throwArgumentError("invalid arrayify value","value",e)}function Pr(e){const t=e.map((e=>Or(e))),n=t.reduce(((e,t)=>e+t.length),0),i=new Uint8Array(n);return t.reduce(((e,t)=>(i.set(t,e),e+t.length)),0),Lr(i)}function _r(e,t){(e=Or(e)).length>t&&Ar.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),Lr(n)}function Dr(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Nr="0123456789abcdef";function Fr(e,t){if(t||(t={}),"number"==typeof e){Ar.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Nr[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Sr(e))return e.toHexString();if(Dr(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":Ar.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(Rr(e)){let t="0x";for(let n=0;n<e.length;n++){let i=e[n];t+=Nr[(240&i)>>4]+Nr[15&i]}return t}return Ar.throwArgumentError("invalid hexlify value","value",e)}function Ur(e){if("string"!=typeof e)e=Fr(e);else if(!Dr(e)||e.length%2)return null;return(e.length-2)/2}function qr(e,t,n){return"string"!=typeof e?e=Fr(e):(!Dr(e)||e.length%2)&&Ar.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function Vr(e,t){for("string"!=typeof e?e=Fr(e):Dr(e)||Ar.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Ar.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}var Wr={exports:{}};
|
|
11
|
+
/**
|
|
12
|
+
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
13
|
+
*
|
|
14
|
+
* @version 0.8.0
|
|
15
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
16
|
+
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
17
|
+
* @license MIT
|
|
18
|
+
*/!function(e){!function(){var t="input is invalid type",n="object"==typeof window,i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self;!i.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?i=F:o&&(i=self);var r=!i.JS_SHA3_NO_COMMON_JS&&e.exports,a=!i.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),l=[4,1024,262144,67108864],d=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],p=[128,256],h=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!i.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var x=function(e,t,n){return function(i){return new S(e,t,e).update(i)[n]()}},g=function(e,t,n){return function(i,o){return new S(e,t,o).update(i)[n]()}},f=function(e,t,n){return function(t,i,o,r){return j["cshake"+e].update(t,i,o,r)[n]()}},y=function(e,t,n){return function(t,i,o,r){return j["kmac"+e].update(t,i,o,r)[n]()}},v=function(e,t,n,i){for(var o=0;o<h.length;++o){var r=h[o];e[r]=t(n,i,r)}return e},b=function(e,t){var n=x(e,t,"hex");return n.create=function(){return new S(e,t,e)},n.update=function(e){return n.create().update(e)},v(n,x,e,t)},C=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:p,createMethod:function(e,t){var n=g(e,t,"hex");return n.create=function(n){return new S(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},v(n,g,e,t)}},{name:"cshake",padding:l,bits:p,createMethod:function(e,t){var n=m[e],i=f(e,0,"hex");return i.create=function(i,o,r){return o||r?new S(e,t,i).bytepad([o,r],n):j["shake"+e].create(i)},i.update=function(e,t,n,o){return i.create(t,n,o).update(e)},v(i,f,e,t)}},{name:"kmac",padding:l,bits:p,createMethod:function(e,t){var n=m[e],i=y(e,0,"hex");return i.create=function(i,o,r){return new L(e,t,o).bytepad(["KMAC",r],n).bytepad([i],n)},i.update=function(e,t,n,o){return i.create(e,n,o).update(t)},v(i,y,e,t)}}],j={},w=[],k=0;k<C.length;++k)for(var T=C[k],B=T.bits,E=0;E<B.length;++E){var I=T.name+"_"+B[E];if(w.push(I),j[I]=T.createMethod(B[E],T.padding),"sha3"!==T.name){var A=T.name+B[E];w.push(A),j[A]=j[I]}}function S(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var i=0;i<50;++i)this.s[i]=0}function L(e,t,n){S.call(this,e,t,n)}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var o,r,s=this.blocks,l=this.byteCount,c=e.length,u=this.blockCount,p=0,h=this.s;p<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,o=1;o<u+1;++o)s[o]=0;if(n)for(o=this.start;p<c&&o<l;++p)s[o>>2]|=e[p]<<d[3&o++];else for(o=this.start;p<c&&o<l;++p)(r=e.charCodeAt(p))<128?s[o>>2]|=r<<d[3&o++]:r<2048?(s[o>>2]|=(192|r>>6)<<d[3&o++],s[o>>2]|=(128|63&r)<<d[3&o++]):r<55296||r>=57344?(s[o>>2]|=(224|r>>12)<<d[3&o++],s[o>>2]|=(128|r>>6&63)<<d[3&o++],s[o>>2]|=(128|63&r)<<d[3&o++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++p)),s[o>>2]|=(240|r>>18)<<d[3&o++],s[o>>2]|=(128|r>>12&63)<<d[3&o++],s[o>>2]|=(128|r>>6&63)<<d[3&o++],s[o>>2]|=(128|63&r)<<d[3&o++]);if(this.lastByteIndex=o,o>=l){for(this.start=o-l,this.block=s[u],o=0;o<u;++o)h[o]^=s[o];M(h),this.reset=!0}else this.start=o}return this},S.prototype.encode=function(e,t){var n=255&e,i=1,o=[n];for(n=255&(e>>=8);n>0;)o.unshift(n),n=255&(e>>=8),++i;return t?o.push(i):o.unshift(i),this.update(o),o.length},S.prototype.encodeString=function(e){var n,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var o=0,r=e.length;if(n)o=r;else for(var s=0;s<e.length;++s){var l=e.charCodeAt(s);l<128?o+=1:l<2048?o+=2:l<55296||l>=57344?o+=3:(l=65536+((1023&l)<<10|1023&e.charCodeAt(++s)),o+=4)}return o+=this.encode(8*o),this.update(e),o},S.prototype.bytepad=function(e,t){for(var n=this.encode(t),i=0;i<e.length;++i)n+=this.encodeString(e[i]);var o=t-n%t,r=[];return r.length=o,this.update(r),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,i=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)i[t]^=e[t];M(i)}},S.prototype.toString=S.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,r=0,a=0,l="";a<i;){for(r=0;r<t&&a<i;++r,++a)e=n[r],l+=s[e>>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t==0&&(M(n),r=0)}return o&&(e=n[r],l+=s[e>>4&15]+s[15&e],o>1&&(l+=s[e>>12&15]+s[e>>8&15]),o>2&&(l+=s[e>>20&15]+s[e>>16&15])),l},S.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,r=0,a=0,s=this.outputBits>>3;e=o?new ArrayBuffer(i+1<<2):new ArrayBuffer(s);for(var l=new Uint32Array(e);a<i;){for(r=0;r<t&&a<i;++r,++a)l[a]=n[r];a%t==0&&M(n)}return o&&(l[r]=n[r],e=e.slice(0,s)),e},S.prototype.buffer=S.prototype.arrayBuffer,S.prototype.digest=S.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,i=this.s,o=this.outputBlocks,r=this.extraBytes,a=0,s=0,l=[];s<o;){for(a=0;a<n&&s<o;++a,++s)e=s<<2,t=i[a],l[e]=255&t,l[e+1]=t>>8&255,l[e+2]=t>>16&255,l[e+3]=t>>24&255;s%n==0&&M(i)}return r&&(e=s<<2,t=i[a],l[e]=255&t,r>1&&(l[e+1]=t>>8&255),r>2&&(l[e+2]=t>>16&255)),l},L.prototype=new S,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),S.prototype.finalize.call(this)};var M=function(e){var t,n,i,o,r,a,s,l,d,u,p,h,m,x,g,f,y,v,b,C,j,w,k,T,B,E,I,A,S,L,M,R,O,P,_,D,N,F,U,q,V,W,H,Z,z,$,G,Q,Y,X,K,J,ee,te,ne,ie,oe,re,ae,se,le,de,ce;for(i=0;i<48;i+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],r=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],d=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(m=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=o^(l<<1|d>>>31),n=r^(d<<1|l>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(u<<1|p>>>31),n=s^(p<<1|u>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=l^(h<<1|m>>>31),n=d^(m<<1|h>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=u^(o<<1|r>>>31),n=p^(r<<1|o>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,x=e[0],g=e[1],$=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,A=e[20]<<3|e[21]>>>29,S=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,le=e[30]<<9|e[31]>>>23,W=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,_=e[3]<<1|e[2]>>>31,f=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,L=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,N=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,b=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,K=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,B=e[7]<<28|e[6]>>>4,ie=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,C=e[36]<<21|e[37]>>>11,j=e[37]<<21|e[36]>>>11,J=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,Z=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,re=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,w=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=x^~f&v,e[1]=g^~y&b,e[10]=T^~E&A,e[11]=B^~I&S,e[20]=P^~D&F,e[21]=_^~N&U,e[30]=Z^~$&Q,e[31]=z^~G&Y,e[40]=te^~ie&re,e[41]=ne^~oe&ae,e[2]=f^~v&C,e[3]=y^~b&j,e[12]=E^~A&L,e[13]=I^~S&M,e[22]=D^~F&q,e[23]=N^~U&V,e[32]=$^~Q&X,e[33]=G^~Y&K,e[42]=ie^~re&se,e[43]=oe^~ae&le,e[4]=v^~C&w,e[5]=b^~j&k,e[14]=A^~L&R,e[15]=S^~M&O,e[24]=F^~q&W,e[25]=U^~V&H,e[34]=Q^~X&J,e[35]=Y^~K&ee,e[44]=re^~se&de,e[45]=ae^~le&ce,e[6]=C^~w&x,e[7]=j^~k&g,e[16]=L^~R&T,e[17]=M^~O&B,e[26]=q^~W&P,e[27]=V^~H&_,e[36]=X^~J&Z,e[37]=K^~ee&z,e[46]=se^~de&te,e[47]=le^~ce&ne,e[8]=w^~x&f,e[9]=k^~g&y,e[18]=R^~T&E,e[19]=O^~B&I,e[28]=W^~P&D,e[29]=H^~_&N,e[38]=J^~Z&$,e[39]=ee^~z&G,e[48]=de^~te&ie,e[49]=ce^~ne&oe,e[0]^=c[i],e[1]^=c[i+1]};if(r)e.exports=j;else for(k=0;k<w.length;++k)i[w[k]]=j[w[k]]}()}(Wr);var Hr=U(Wr.exports);function Zr(e){return"0x"+Hr.keccak_256(Or(e))}const zr=new Ir("address/5.8.0");function $r(e){Dr(e,20)||zr.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const i=Or(Zr(n));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Gr={};for(let e=0;e<10;e++)Gr[String(e)]=String(e);for(let e=0;e<26;e++)Gr[String.fromCharCode(65+e)]=String(10+e);const Qr=Math.floor((Yr=9007199254740991,Math.log10?Math.log10(Yr):Math.log(Yr)/Math.LN10));var Yr;function Xr(e){let t=null;if("string"!=typeof e&&zr.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=$r(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&zr.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Gr[e])).join("");for(;t.length>=Qr;){let e=t.substring(0,Qr);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e)&&zr.throwArgumentError("bad icap checksum","address",e),t=x._base36To16(e.substring(4));t.length<40;)t="0"+t;t=$r("0x"+t)}else zr.throwArgumentError("invalid address","address",e);return t}function Kr(e,t,n){return 32!==Ur(t)&&zr.throwArgumentError("salt must be 32 bytes","salt",t),32!==Ur(n)&&zr.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),Xr(qr(Zr(Pr(["0xff",Xr(e),t,n])),12))}const Jr=x.BigNumber.from(-1),ea=x.BigNumber.from(0),ta=x.BigNumber.from(1),na=x.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ia=new Ir("strings/5.8.0");var oa,ra;function aa(e,t,n,i,o){if(e===ra.BAD_PREFIX||e===ra.UNEXPECTED_CONTINUE){let e=0;for(let i=t+1;i<n.length&&n[i]>>6==2;i++)e++;return e}return e===ra.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(oa||(oa={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(ra||(ra={}));const sa=Object.freeze({error:function(e,t,n,i,o){return ia.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:aa,replace:function(e,t,n,i,o){return e===ra.OVERLONG?(i.push(o),0):(i.push(65533),aa(e,t,n))}});function la(e,t=oa.current){t!=oa.current&&(ia.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);if(i<128)n.push(i);else if(i<2048)n.push(i>>6|192),n.push(63&i|128);else if(55296==(64512&i)){t++;const o=e.charCodeAt(t);if(t>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");const r=65536+((1023&i)<<10)+(1023&o);n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(63&i|128)}return Or(n)}function da(e,t){return n=function(e,t){null==t&&(t=sa.error),e=Or(e);const n=[];let i=0;for(;i<e.length;){const o=e[i++];if(!(o>>7)){n.push(o);continue}let r=null,a=null;if(192==(224&o))r=1,a=127;else if(224==(240&o))r=2,a=2047;else{if(240!=(248&o)){i+=t(128==(192&o)?ra.UNEXPECTED_CONTINUE:ra.BAD_PREFIX,i-1,e,n);continue}r=3,a=65535}if(i-1+r>=e.length){i+=t(ra.OVERRUN,i-1,e,n);continue}let s=o&(1<<8-r-1)-1;for(let o=0;o<r;o++){let o=e[i];if(128!=(192&o)){i+=t(ra.MISSING_CONTINUE,i,e,n),s=null;break}s=s<<6|63&o,i++}null!==s&&(s>1114111?i+=t(ra.OUT_OF_RANGE,i-1-r,e,n,s):s>=55296&&s<=57343?i+=t(ra.UTF16_SURROGATE,i-1-r,e,n,s):s<=a?i+=t(ra.OVERLONG,i-1-r,e,n,s):n.push(s))}return n}(e,t),n.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("");var n}const ca=new RegExp("^bytes([0-9]+)$"),ua=new RegExp("^(u?int)([0-9]*)$"),pa=new RegExp("^(.*)\\[([0-9]*)\\]$"),ha="0000000000000000000000000000000000000000000000000000000000000000",ma=new Ir("solidity/5.8.0");function xa(e,t,n){switch(e){case"address":return n?_r(t,32):Or(t);case"string":return la(t);case"bytes":return Or(t);case"bool":return t=t?"0x01":"0x00",n?_r(t,32):Or(t)}let i=e.match(ua);if(i){let o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&ma.throwArgumentError("invalid number type","type",e),n&&(o=256),_r(t=x.BigNumber.from(t).toTwos(o),o/8)}if(i=e.match(ca),i){const o=parseInt(i[1]);return(String(o)!==i[1]||0===o||o>32)&&ma.throwArgumentError("invalid bytes type","type",e),Or(t).byteLength!==o&&ma.throwArgumentError(`invalid value for ${e}`,"value",t),n?Or((t+ha).substring(0,66)):t}if(i=e.match(pa),i&&Array.isArray(t)){const n=i[1];parseInt(i[2]||String(t.length))!=t.length&&ma.throwArgumentError(`invalid array length for ${e}`,"value",t);const o=[];return t.forEach((function(e){o.push(xa(n,e,!0))})),Pr(o)}return ma.throwArgumentError("invalid type","type",e)}function ga(e,t){e.length!=t.length&&ma.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,i){n.push(xa(e,t[i]))})),Fr(Pr(n))}function fa(e,t){return Zr(ga(e,t))}const ya=new r.PoolApi({contractRequests:Wi}),va=new r.AMMV3Api({contractRequests:Wi});function ba(e,t){var n;return e?{chainId:t,address:e.id,name:e.name,decimals:Number(e.decimals),symbol:e.symbol,logoURI:null!==(n=e.logoImg)&&void 0!==n?n:""}:e}function Ca(e){var t,n,i,o,r,a,s;const l=null==e?void 0:e.pair;if(l)return{address:l.id,chainId:l.chainId,baseToken:ba(l.baseToken,l.chainId),quoteToken:ba(l.quoteToken,l.chainId),type:l.type,creator:l.creator,baseLpToken:{id:null===(t=l.baseLpToken)||void 0===t?void 0:t.id,decimals:Number(null!==(i=null===(n=l.baseLpToken)||void 0===n?void 0:n.decimals)&&void 0!==i?i:18)},quoteLpToken:{id:null===(o=l.quoteLpToken)||void 0===o?void 0:o.id,decimals:Number(null!==(a=null===(r=l.quoteLpToken)||void 0===r?void 0:r.decimals)&&void 0!==a?a:18)},lpFeeRate:null===(s=null==e?void 0:e.pair)||void 0===s?void 0:s.lpFeeRate}}function ja(e){const t=Ca(e);if(t)return Object.assign(Object.assign({},t),{liquidityPositions:null==e?void 0:e.liquidityPositions})}function wa(e){switch(e){case"AMMV2":return"AMM V2";case"AMMV3":return"AMM V3";default:return"PMM"}}function ka(e){return!(!p.getUniswapV2FactoryContractAddressByChainId(e)||!p.getUniswapV2Router02ContractAddressByChainId(e))}const Ta=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const n=e.substring(2,e.length).toLowerCase(),i=t.substring(2,t.length).toLowerCase();return n.length>i.length?n.endsWith(i):i.endsWith(n)};function Ba(e){try{return!!Xr(e)}catch(e){return!1}}function Ea(e){return e?e.length<=10?e:`${e.slice(0,6)}...${e.slice(e.length-4,e.length)}`:"-"}function Ia(e,t,n="address"){return`https://${Ai[e]}${t?`/${n}/${t}`:""}${e===r.ChainId.SOLANA_DEVNET?"?cluster=devnet":""}`}const Aa=({factoryAddress:e,tokenA:t,tokenB:n,fee:i})=>{const[o,a]=function(e,t){if(e.chainId!==t.chainId)throw new Error("token is not in the same chain");return e.address.toLowerCase()<t.address.toLowerCase()}(t,n)?[t,n]:[n,t];if(t.chainId!==n.chainId)throw new Error("token is not valid.");return Kr(e,fa(["bytes"],[ga(["address","address","uint256"],[o.address,a.address,sr(i,4).toString()])]),(e=>{const t=ka(e);switch(e){case r.ChainId.PLUME:case r.ChainId.PLUME_TESTNET:return"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f";case r.ChainId.NEOX:return"0x007722521498f3d29a63d1eb6ab35e202874706c77ce73d45c1ad9da88174a3f";case r.ChainId.SEPOLIA:return t?"0x67a372377cf6d7f78cfdcc9df0bc21e1139bd49e5a47c33ee0de5389a4396410":"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f";default:return"0x2ebf1082215ab683deab4ee8ff50d42205db2059829b641717ab3f61f18d481a"}})(t.chainId))};function Sa(e){var t;if(!e)return"a";const n=null===(t=Ro.get(e))||void 0===t?void 0:t.caipNetwork;if(!n)return"";const i=a.CaipNetworksUtil.getChainNamespace(n);if(!i)return"";switch(i){case"eip155":return"EVM";case"solana":return"Solana";case"bip122":return"Bitcoin";default:return i}}const La=e=>r.platformIdMap[e]||r.platformIdMap[r.ChainId.MAINNET],Ma=e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t};function Ra(e){return Number(e)>6?6:4}function Oa(e,t){var n,i;return e?{chainId:t,address:e.address||e.id,name:null!==(n=e.name)&&void 0!==n?n:e.symbol,decimals:Number(e.decimals),symbol:e.symbol,logoURI:null!==(i=e.logoImg)&&void 0!==i?i:""}:e}function Pa(){const e=m.useAppKit(),t=m.useDisconnect(),{onlyChainId:i,defaultChainId:o,solanaConnection:s}=Q(),l=function(){const{btcWalletStore:e}=Q();return e}(),c=m.useAppKitAccount({namespace:"eip155"}),u=m.useAppKitAccount({namespace:"solana"}),p=n.useMemo((()=>l&&l.address?{allAccounts:[{namespace:"bip122",address:l.address,publicKey:l.publicKey,type:"payment"}],caipAddress:`bip122:${r.btcSignet.id}:${l.address}`,address:l.address,isConnected:l.connected,embeddedWalletInfo:void 0,status:l.connected?"connected":"disconnected"}:{allAccounts:[],caipAddress:void 0,address:void 0,isConnected:!1,embeddedWalletInfo:void 0,status:"disconnected"}),[l]),{walletProvider:x}=m.useAppKitProvider("eip155"),{walletProvider:g}=m.useAppKitProvider("solana"),f=m.useAppKitNetwork(),y=n.useMemo((()=>{if(!f||!f.caipNetwork)return i||o||r.ChainId.MAINNET;const e=f.chainId;return e===d.solana.id?r.ChainId.SOLANA:e===d.solanaDevnet.id?r.ChainId.SOLANA_DEVNET:e===r.btcSignet.id?r.ChainId.BTC_SIGNET:e===d.bitcoin.id?r.ChainId.BTC:Number(e)}),[f,o,i]),v=n.useMemo((()=>{var e;return null===(e=Ro.get(y))||void 0===e?void 0:e.caipNetwork}),[y]),b=n.useMemo((()=>{if(!v)return;const e=a.CaipNetworksUtil.getChainNamespace(v);return"bip122"===e?p:"solana"===e?u:c}),[p,v,c,u]),C=n.useCallback((e=>{if(!e)return;const t=Ro.get(e);if(!(null==t?void 0:t.caipNetwork))return;const n=t.caipNetwork,i=a.CaipNetworksUtil.getChainNamespace(n);return{appKitAccount:"bip122"===i?Object.assign({},p):"solana"===i?u:c,namespace:i,targetCaipNetwork:n,chain:t}}),[p,c,u]),j=n.useCallback((({namespace:t})=>{"bip122"!==t?e.open({namespace:t}):null==l||l.setModalVisible(!0)}),[e,l]),w=n.useCallback((({namespace:e})=>{"bip122"!==e?t.disconnect({namespace:e}):null==l||l.disconnect()}),[t,l]),k=n.useMemo((()=>x?new h.Web3Provider(x,y):null),[y,x]);return{open:j,disconnect:w,chainId:y,chainIdToCaipNetwork:v,connectedChainId:y,defaultChainId:o,onlyChainId:i,account:null==b?void 0:b.address,currentAccount:b,appKitActiveNetwork:f,evmAccount:c,solanaAccount:u,bitcoinAccount:p,evmProvider:k,solanaWalletProvider:g,solanaConnection:s,bitcoinWalletProvider:null==l?void 0:l.btcWallet,getAppKitAccountByChainId:C}}var _a;!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(_a||(_a={}));const Da=(e,t)=>N(void 0,void 0,void 0,(function*(){const{value:n,from:i,to:o,data:r}=e,a={from:i,to:o,value:n,data:r};n&&!/^0x0*$/.test(n)||delete a.value;try{return(yield t.estimateGas(a)).add(5e4)}catch(e){console.error(e);try{if(yield t.call(a),"test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")}catch(e){if("test"!==process.env.NODE_ENV)throw e}}return null})),Na=(e,t)=>N(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(o.i18n._({id:"em6LzM",message:"Transaction rejected."})):e}})),Fa=(e,t,n,i,o)=>N(void 0,void 0,void 0,(function*(){const a=yield r.TokenApi.encode.approveABI(n,i),s={from:t,to:e,data:a,value:"0x0",gasLimit:void 0},l=yield Da(s,o);return l&&(s.gasLimit=l),yield Na(s,o)}));let Ua=null;function qa(){const{GRAPHQL_URL:e,graphQLRequests:t}=Q();return t||(Ua||(Ua=new r.GraphQLRequests({url:e})),Ua)}var Va;!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(Va||(Va={}));const Wa=u.create((e=>({fromTokenChainId:void 0,latestBlockNumber:0,openConnectWalletInfo:!1,slippage:null})));function Ha(e){Wa.setState({contractStatus:e})}function Za(e){Wa.setState({autoSlippage:e})}function za(e){Wa.setState({slippage:e})}function $a(e){const t=n.useRef(!1),[i,o]=n.useState(!1);return n.useEffect((()=>{if(void 0===e)return;const n=function(e){const t=localStorage.getItem(e?Fo:No);return t?Number(t):null}(e);if(!t.current)return za(n?n.toString():null),void(t.current=!0);za(n?n.toString():null),o(!0);const i=setTimeout((()=>{o(!1)}),3e3);return()=>{clearTimeout(i)}}),[e]),i}function Ga({tokenList:e,blockNumber:t,skip:o}){const{getAppKitAccountByChainId:r}=Pa(),[a,s]=n.useState(new Map),l=c.useQueries({queries:e.map((e=>{const n=r(e.chainId),i=Hi.getFetchTokenQuery(e.chainId,e.address,null==n?void 0:n.appKitAccount.address);return{queryKey:t?[...i.queryKey,t]:i.queryKey,enabled:i.enabled&&!o,queryFn:i.queryFn}})),combine:e=>({data:e.map((e=>e.data)),pending:e.some((e=>e.isPending))})});return n.useEffect((()=>{const e=new Map;l.data.forEach((t=>{t&&e.set(`${t.chainId}-${t.address}`,t)})),s((t=>i.isEqual(t,e)?t:e))}),[l.data]),a}function Qa(){const{evmProvider:e,chainId:t}=Pa(),i=n.useCallback((()=>N(this,void 0,void 0,(function*(){if(e&&t)try{const t=yield e.getBlockNumber();return Wa.setState({latestBlockNumber:t}),t}catch(e){console.error("Failed to fetch block number",e)}}))),[e,t]);return n.useEffect((()=>{i()}),[i]),{updateBlockNumber:i}}function Ya({fromToken:e,toToken:t,getAutoSlippage:i}){n.useEffect((()=>{(()=>{N(this,void 0,void 0,(function*(){if(!i)return;const n=i({fromToken:e,toToken:t});if(void 0!==n&&"number"!=typeof n){var o;o=!0,Wa.setState((e=>{var t,n;return{autoSlippage:{loading:o,value:null!==(n=null===(t=e.autoSlippage)||void 0===t?void 0:t.value)&&void 0!==n?n:null}}}));try{const e=yield n;Za({loading:!1,value:null!=e?e:null})}catch(e){console.error(e),Za({loading:!1,value:null})}}else Za({loading:!1,value:null})}))})()}),[e,t])}function Xa(){const e=t.useTheme(),i=Q((e=>e.width)),[o,r]=n.useState(null!=i?i:"undefined"==typeof window?375:document.body.clientWidth);n.useEffect((()=>{const e=()=>{r("undefined"==typeof window?375:document.body.clientWidth)};return"number"!=typeof i?(e(),window.addEventListener("resize",e)):r(i),()=>{window.removeEventListener("resize",e)}}),[i]);return{isMobile:n.useMemo((()=>"number"==typeof o&&o<e.breakpoints.values.tablet),[o,e.breakpoints.values]),isTablet:n.useMemo((()=>"number"==typeof o&&o<e.breakpoints.values.tablet),[o,e.breakpoints.values]),minDevice:n.useCallback((e=>"number"==typeof o&&o>e),[o]),maxDevice:n.useCallback((e=>"number"==typeof o&&o<e),[o])}}var Ka,Ja,es,ts;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Ka||(Ka={})),exports.MetadataFlag=void 0,(Ja=exports.MetadataFlag||(exports.MetadataFlag={})).swap="swap",Ja.crossChain="crossChain",Ja.addLiquidity="addLiquidity",Ja.removeLiquidity="removeLiquidity",Ja.createDPPPool="createDPPPool",Ja.createDSPPool="createDSPPool",Ja.createGSPPool="createGSPPool",Ja.createDVMPool="createDVMPool",Ja.createAMMV2Position="createAMMV2Position",Ja.addLiquidityAMMV2Position="addLiquidityAMMV2Position",Ja.removeLiqidityAMMV2Position="removeLiqidityAMMV2Position",Ja.createAMMV3Pool="createAMMV3Pool",Ja.addAMMV3Pool="addAMMV3Pool",Ja.removeAMMV3Pool="removeAMMV3Pool",Ja.claimAMMV3Pool="claimAMMV3Pool",Ja.stakeMining="stakeMining",Ja.unstakeMining="unstakeMining",Ja.claimMining="claimMining",Ja.submissionCreateMetaKey="submissionCreateMetaKey",Ja.approve="approve",Ja.reset="reset",Ja.curveAddLiquidity="curveAddLiquidity",Ja.curveRemoveLiquidityOneCoin="curveRemoveLiquidityOneCoin",Ja.curveRemoveLiquidity="curveRemoveLiquidity",Ja.curveRemoveLiquidityImBalance="curveRemoveLiquidityImBalance",function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(es||(es={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(ts||(ts={}));const ns=new s(2).pow(256).minus(1);function is(){const{chainId:e}=Pa();return e}function os(e,t){var n;const i=null===(n=r.basicTokenMap[e])||void 0===n?void 0:n.symbol,a=[{error:"insufficient",msg:o.i18n._({id:"CkfzUf",message:"Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",values:{EtherTokenSymbol:i}})},{error:["External Swap execution Failed","Return amount is not enough"],msg:o.i18n._({id:"AghcDJ",message:"Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance."})},{error:"SafeERC20: low-level call failed",msg:o.i18n._({id:"rYkFu5",message:"SafeERC20: low-level call failed. Please contact the ZUNO team."})},{error:["User denied","cancel","User rejected","user rejected"],msg:o.i18n._({id:"xEbi+8",message:"User denied transaction signature."})},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:o.i18n._({id:"h4RLFN",message:"RPC node data exception"})},{error:['execution reverted:FORCESTOP ["originalError"'],msg:o.i18n._({id:"yM82Jw",message:"ForceStop exception"})},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:o.i18n._({id:"gz+9Rb",message:"Gas price is too low, please adjust in your wallet and try again"})},{error:["MINT_INVALID"],msg:o.i18n._({id:"Xpkm7d",message:"No ForceStop access"})},{error:["NOT_PHASE_EXE"],msg:o.i18n._({id:"qK7wuW",message:"Unable to SETTLE during the cooling-off period"})},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:o.i18n._({id:"TizaRy",message:"Wallet incompatibility"})},{error:["ALREADY_SETTLED"],msg:o.i18n._({id:"C1mcuF",message:"This CP has been settled by other addrs"})},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:o.i18n._({id:"g3x+cF",message:"Service update, please wait and try again"})}];let s="";return a.some((e=>Array.isArray(e.error)?e.error.some((n=>t.indexOf(n)>-1&&(s=e.msg,!0))):t.indexOf(e.error)>-1&&(s=e.msg,!0))),s||t}var rs,as;function ss({onTxFail:e,onTxSubmit:t,onTxSuccess:i,onTxReverted:o}={}){const{evmAccount:a,evmProvider:s}=Pa(),l=c.useQueryClient(),d=is(),[u,p]=n.useState(!1),[h,m]=n.useState(new Map),[x,g]=n.useState(null),[f,y]=n.useState(""),[v,b]=n.useState(null),[C,j]=n.useState(!1),[w,k]=n.useState(),{updateBlockNumber:T}=Qa(),B=n.useCallback(((n,c,u)=>N(this,void 0,void 0,(function*(){const{subtitle:h,early:x,submittedBack:f,mixpanelProps:v,submittedConfirmBack:C,successBack:w,metadata:B}=null!=u?u:{};if(y(""),g(""),!a.address||!s)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let E,I,A,S;k((()=>C)),p(!1),b({spec:c,brief:n,subtitle:h,submitState:"loading"});try{if(p(!0),c.opcode===rs.Approval){S=yield Fa(c.token.address,a.address,c.contract,c.amt||ns,s),E=S.hash,y(E);try{A=yield s.getTransactionCount(a.address)}catch(e){console.error(e)}}else{if(c.opcode!==rs.TX)throw new Error(`Op ${c.opcode} not implemented!`);if(""===c.to)throw new Error("Submission: malformed to");if(0===c.data.length)throw new Error("Submission: malformed data");if(0===c.data.indexOf("0x")&&c.data.length<=2)throw new Error("Submission: malformed data");try{A=yield s.getTransactionCount(a.address)}catch(e){console.error(e)}if(I={value:c.value,data:c.data,to:c.to,gasLimit:c.gasLimit,from:a.address,chainId:d},!I.gasLimit)try{const e=yield Da(I,s);e&&(I.gasLimit=e)}catch(e){throw console.debug(e),e}if(S=yield Na(I,s),E=S.hash,y(E),!E)throw new Error(`Unexpected tx: ${E}`)}}catch(t){if(p(!1),b({spec:c,brief:n,subtitle:h}),console.error(t),t.message){Ha(Va.Failed);const i={error:t.message,brief:n};v&&Object.assign(i,v),e&&e(t,v),g(os(d,t.message))}return es.Failed}b({spec:c,brief:n,subtitle:h,submitState:"submitted"}),j(!1),p(!1);const L=Object.assign(Object.assign(Object.assign(Object.assign({brief:n},c),I),{tx:E,subtitle:h,metadata:B,nonce:A}),v);Ha(Va.Pending),t&&t(E,L),f&&f();const M={brief:n,spec:c,tx:E,subtitle:h,metadata:B};if(m((e=>e.set(E,[M,Ka.Running]))),x)return es.Submitted;if(f&&f(),null==S?void 0:S.wait){const e=yield S.wait(1);if(L.receipt=e,j(!0),e.status===ts.Success)return yield ds(T,e.blockNumber),"TX"===L.opcode&&Ha(Va.TxSuccess),"APPROVAL"===L.opcode&&Ha(Va.ApproveSuccess),w&&w(E,i),i&&i(E,L),l.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY]}),m((e=>e.set(E,[Object.assign(Object.assign({},M),{doneTime:Math.ceil(Date.now()/1e3)}),Ka.Success]))),es.Success}return o&&o(E,L),yield T(),j(!0),m((e=>e.set(E,[Object.assign(Object.assign({},M),{doneTime:Math.ceil(Date.now()/1e3)}),Ka.Failed]))),es.Failed}))),[a.address,d,p,s,T,l]),E=n.useCallback((n=>N(this,[n],void 0,(function*({brief:n,subtitle:o,early:r,mixpanelProps:a,metadata:s,submittedBack:c,submittedConfirmBack:u,successBack:h,handler:x}){k((()=>u)),y(""),g(""),p(!1);const f=Object.assign({brief:n,subtitle:o},a);return new Promise((u=>N(this,void 0,void 0,(function*(){const v={opcode:rs.TX,value:"",to:"",data:""},C={brief:n,spec:v,subtitle:o,metadata:s};let w="";const k=(e,{showing:i,reportInfo:a}={})=>{w=e,y(e),null!==i&&b(Object.assign({spec:v,brief:n,subtitle:o},i)),p(!1),m((t=>t.set(e,[Object.assign(Object.assign({},C),{tx:e}),Ka.Running]))),Ha(Va.Pending),t&&t(e,Object.assign(Object.assign({tx:e},f),a)),c&&c(),r&&u(es.Submitted)},B=(e,...t)=>N(this,[e,...t],void 0,(function*(e,{showing:t,reportInfo:n,notShowingDone:o}={}){y(e),t&&b((e=>Object.assign(Object.assign({},e),t))),Ha(Va.TxSuccess),m((t=>t.set(null!=w?w:e,[Object.assign(Object.assign({},C),{tx:w}),Ka.Success]))),h&&h(e,i),i&&i(e,Object.assign(Object.assign({tx:e},f),n)),yield T(),l.invalidateQueries({queryKey:["token"]}),l.invalidateQueries({queryKey:["clmm"]}),l.invalidateQueries({queryKey:["cpmm"]}),o||(j(!0),b((e=>Object.assign(Object.assign({},e),{done:!0})))),u(es.Success)})),E=t=>{if(p(!1),b({spec:v,brief:n,subtitle:o}),w&&m((e=>e.set(w,[Object.assign(Object.assign({},C),{tx:w}),Ka.Failed]))),console.error(t),t.message){console.error(t.code),Ha(Va.Failed);const i={error:t.message,brief:n};a&&Object.assign(i,a),e&&e(t,a),g(os(d,t.message))}u(es.Failed)};try{p(!0),yield x({onSubmit:k,onSuccess:B,onError:E,setShowing:b})}catch(e){return void E(e)}}))))}))),[d,p,T,l]),I=n.useCallback((e=>{m((t=>{const n=new Map;return t.forEach(((t,i)=>{const[o,r]=t,a=e(o);a?n.set(i,[Object.assign(Object.assign({},o),{brief:a.brief,subtitle:a.subtitle,metadata:a.metadata}),r]):n.set(i,t)})),n}))}),[a.address,d,h]),A=n.useMemo((()=>({executeCustom:E,execute:B,requests:h,updateText:I,setShowing:b,waitingSubmit:u,errorMessage:x})),[E,B,h,I,u,x]),S=n.useCallback((()=>{b(null),w&&(w(),k(void 0))}),[w]);return{showing:v,showingDone:C,transactionTx:f,errorMessage:x,setErrorMessage:g,closeShowing:S,setShowing:b,ctxVal:A,requests:h}}!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(rs||(rs={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(as||(as={}));let ls=0;function ds(e,t,n=800){return clearTimeout(ls),new Promise((i=>{ls=window.setTimeout((()=>N(this,void 0,void 0,(function*(){const o=yield e();if(o&&o>=t)i(o);else{const o=yield ds(e,t,n);i(o)}}))),n)}))}const cs=n.createContext({execute:()=>Promise.resolve(es.Canceled),executeCustom:()=>Promise.resolve(es.Canceled),requests:void 0,updateText:()=>{},waitingSubmit:!1,errorMessage:null});function us(){const{submission:e}=Q(),t=n.useContext(cs);return e||t}function ps(){const{requests:e}=us(),t=[];return null==e||e.forEach((function([e,n]){n===Ka.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const hs=15e3;function ms(e){const{apiServices:t}=Q();return n.useMemo((()=>Vi(e,t)),[t,e])}function xs({fromToken:e,toToken:t}){const[i,o]=n.useState(!0),[r,a]=n.useState(null),{apikey:s}=Q(),[l,d]=n.useState(""),[c,u]=n.useState(""),p=ms(Oi.fiatPrice),h=n.useCallback((()=>{if(!e||!t)return;o(!0),a(null);const n=[e,t];g.post(p,{networks:n.map((e=>La(e.chainId))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},s?{headers:{apikey:s}}:void 0).then((n=>{var i;o(!1);const r=null===(i=n.data)||void 0===i?void 0:i.data;r&&(d(r.find((t=>t.address===e.address)).price),u(r.find((e=>e.address===t.address)).price))})).catch((e=>{a(e),o(!1),console.error(e)}))}),[e,t,s,p]);return function({refetch:e,interval:t}){let i;n.useEffect((()=>(e(),clearTimeout(i),i=setInterval((()=>{e()}),null!=t?t:hs),()=>clearTimeout(i))),[e])}({refetch:h}),{loading:i,isLoading:i,refetch:h,error:r,toFiatPrice:c,fromFiatPrice:l}}function gs(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var t;const i=e=>null===e?null:JSON.parse(e,void 0),o=null!=(t=n.getItem(e))?t:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)}}const fs=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>fs(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>fs(t)(e)}}},ys=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,i,o)=>{let r={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let d;try{d=r.getStorage()}catch(e){}if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...e)}),i,o);const c=fs(r.serialize),u=()=>{const e=r.partialize({...i()});let t;const n=c({state:e,version:r.version}).then((e=>d.setItem(r.name,e))).catch((e=>{t=e}));if(t)throw t;return n},p=o.setState;o.setState=(e,t)=>{p(e,t),u()};const h=e(((...e)=>{n(...e),u()}),i,o);let m;const x=()=>{var e;if(!d)return;a=!1,s.forEach((e=>e(i())));const t=(null==(e=r.onRehydrateStorage)?void 0:e.call(r,i()))||void 0;return fs(d.getItem.bind(d))(r.name).then((e=>{if(e)return r.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===r.version)return e.state;if(r.migrate)return r.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return m=r.merge(e,null!=(t=i())?t:h),n(m,!0),u()})).then((()=>{null==t||t(m,void 0),a=!0,l.forEach((e=>e(m)))})).catch((e=>{null==t||t(void 0,e)}))};return o.persist={setOptions:e=>{r={...r,...e},e.getStorage&&(d=e.getStorage())},clearStorage:()=>{null==d||d.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>x(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},x(),m||h})(e,t)):((e,t)=>(n,i,o)=>{let r={storage:gs((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let d=r.storage;if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...e)}),i,o);const c=()=>{const e=r.partialize({...i()});return d.setItem(r.name,{state:e,version:r.version})},u=o.setState;o.setState=(e,t)=>{u(e,t),c()};const p=e(((...e)=>{n(...e),c()}),i,o);let h;const m=()=>{var e,t;if(!d)return;a=!1,s.forEach((e=>{var t;return e(null!=(t=i())?t:p)}));const o=(null==(t=r.onRehydrateStorage)?void 0:t.call(r,null!=(e=i())?e:p))||void 0;return fs(d.getItem.bind(d))(r.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===r.version)return e.state;if(r.migrate)return r.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return h=r.merge(e,null!=(t=i())?t:p),n(h,!0),c()})).then((()=>{null==o||o(h,void 0),h=i(),a=!0,l.forEach((e=>e(h)))})).catch((e=>{null==o||o(void 0,e)}))};return o.persist={setOptions:e=>{r={...r,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},r.skipHydration||m(),h||p})(e,t),vs=u.create(ys((e=>({slippageAdvanced:!1,notRemindAgainSlippageHigher:!1,notRemindAgainSlippageLower:!1,customSwapPairSlippages:[],ddl:String(Ho),expertMode:!1,disableIndirectRouting:!1})),{name:"swap-setting-storage",storage:gs((()=>localStorage))}));var bs;function Cs({toToken:e,fromToken:t,fromAmount:i,toAmount:a,marginAmount:d,estimateGas:u,isReverseRouting:p,slippage:h,slippageLoading:m}){const{getAppKitAccountByChainId:x,solanaWalletProvider:f,solanaConnection:y}=Pa(),v=us(),{feeRate:b,rebateTo:C,apikey:j,apiServices:w}=Q(),k=vs((e=>Number(e.ddl))),T=vs((e=>Number(e.disableIndirectRouting))),{isSolanaChain:B,isSolanaMainnet:E,account:I}=n.useMemo((()=>{if(!t)return{isSolanaChain:!1,isSolanaMainnet:!1,account:null};const e=x(t.chainId);if(!(null==e?void 0:e.chain))return{isSolanaChain:!1,isSolanaMainnet:!1,account:null};const{address:n}=e.appKitAccount,{isSolanaChain:i,chainId:o}=e.chain;return{isSolanaChain:i,isSolanaMainnet:o===r.ChainId.SOLANA,account:n}}),[x,t]),{data:A,isLoading:S,error:L}=c.useQuery({queryKey:["route-price",t,e,i,a,u,p,h,b,C,j,w,k,T,B,E,I],queryFn:()=>N(this,void 0,void 0,(function*(){if(!t||!e||t.chainId!==e.chainId||!p&&!i||p&&!a||null==h)return{status:bs.Initial,rawBrief:null};const n=new s(i).multipliedBy(new s(10).pow(t.decimals)).dp(0,s.ROUND_DOWN),o=new s(a).multipliedBy(new s(10).pow(e.decimals)).dp(0,s.ROUND_DOWN),r=Math.floor(Date.now()/1e3)+60*k,l=B?{apikey:j,inputMint:t.address,outputMint:e.address,amount:n.toString(),user:I||Mo(t.chainId),chainId:E?"solana-mainnet":"solana-devnet",slippageBps:new s(h).dividedBy(100).multipliedBy(1e4).dp(0,s.ROUND_DOWN).toString(),source:"jupiter"}:Object.assign({chainId:t.chainId,deadLine:r,apikey:j,slippage:h,source:T?"noMaxHops":"dodoMix",toTokenAddress:e.address,fromTokenAddress:t.address,userAddr:I||Mo(t.chainId),estimateGas:u,rebateTo:C||void 0,fee:b||void 0},p?{toAmount:o.toString()}:{fromAmount:n.toString()}),d=Vi(B?Oi.solanaRoutePrice:Oi.routePrice,w),c=(yield g.get(d,{params:l})).data.data;return(null==c?void 0:c.resAmount)?{status:bs.Success,rawBrief:Object.assign(Object.assign({},c),{routeInfo:JSON.stringify(c.routeInfo),resPricePerToToken:B?new s(i).dividedBy(c.resAmount).dp(e.decimals,s.ROUND_DOWN).toNumber():c.resPricePerToToken,resPricePerFromToken:B?new s(c.resAmount).dividedBy(i).dp(t.decimals,s.ROUND_DOWN).toNumber():c.resPricePerFromToken})}:{status:bs.Failed,rawBrief:null}})),refetchInterval:15e3,initialData:{status:bs.Initial,rawBrief:null}}),M=function(){const e=us(),t=n.useCallback((({from:t,to:n,data:i,useSource:r,duration:a,ddl:s,gasLimit:l,subtitle:d,value:c,mixpanelProps:u})=>{const p=60*s,h=c;r&&"weth"!==r.toLowerCase()&&l&&l.lt(Zo)&&console.debug("Warning: GasLimit less than the minimum!");const m={from:t,to:n,data:i,value:h,route:r,duration:a,ddlSecRel:p,gasLimit:l};e.execute(o.i18n._({id:"vH2C/2",message:"Swap"}),Object.assign({opcode:rs.TX},m),{subtitle:d,metadata:{[exports.MetadataFlag.swap]:!0},mixpanelProps:u})}),[e]);return t}(),R=n.useCallback((n=>{if(!A.rawBrief||!I)return;const{resAmount:o,to:r,data:a,useSource:s,duration:l,value:d}=A.rawBrief,c=p?o:i,u=p?i:o;t&&c&&M({from:I,to:r,data:a,useSource:s,duration:l,ddl:k,value:d,subtitle:n,mixpanelProps:{from:I,fromTokenAddress:t.address,toTokenAddress:null==e?void 0:e.address,fromAmount:c,resAmount:u,resPricePerFromToken:p?A.rawBrief.resPricePerToToken:A.rawBrief.resPricePerFromToken,resPricePerToToken:p?A.rawBrief.resPricePerFromToken:A.rawBrief.resPricePerToToken,fromTokenSymbol:t.symbol,toTokenSymbol:null==e?void 0:e.symbol,fromTokenDecimals:t.decimals,toTokenDecimals:null==e?void 0:e.decimals}})}),[I,A.rawBrief,k,M,i,t,p,null==e?void 0:e.address,null==e?void 0:e.decimals,null==e?void 0:e.symbol]),O=c.useMutation({mutationFn:e=>N(this,void 0,void 0,(function*(){if(A.rawBrief&&A.rawBrief.data&&f&&y)try{const t=function({data:e}){if(!e||"string"!=typeof e)throw new Error("Invalid transaction data");let t;if("undefined"!=typeof Buffer)t=new Uint8Array(Buffer.from(e,"base64"));else{const n=atob(e);t=new Uint8Array(n.length);for(let e=0;e<n.length;e++)t[e]=n.charCodeAt(e)}if(0===t.length)throw new Error("Empty transaction buffer");if(t.length<3)throw new Error("Transaction buffer too small");console.log("First 10 bytes:",Array.from(t.slice(0,10))),console.log("Total length:",t.length);const n=t[0],i=1+64*n;let o;console.log("Signature count:",n),console.log("Expected signature section length:",i),console.log("Actual buffer length:",t.length);try{if(0===t[0]&&128===t[1]){const e=l.VersionedMessage.deserialize(t.slice(1));o=new l.VersionedTransaction(e)}else o=l.Transaction.from(t)}catch(e){throw new Error(`Failed to deserialize transaction: ${e.message}\n Buffer head: ${Array.from(t.slice(0,10))}\n Buffer length: ${t.length}`)}if(!o)throw new Error("Failed to create transaction");if(o instanceof l.VersionedTransaction){if(!o.message||!o.message.header)throw new Error("Invalid versioned transaction structure")}else if(o instanceof l.Transaction&&!o.recentBlockhash)throw new Error("Invalid legacy transaction structure");return o}({data:A.rawBrief.data});return v.executeCustom({brief:o.i18n._({id:"vH2C/2",message:"Swap"}),subtitle:e,metadata:{[exports.MetadataFlag.swap]:!0},handler:e=>N(this,void 0,void 0,(function*(){try{const n=yield f.sendTransaction(t,y);e.onSubmit(n);const i=yield y.getLatestBlockhash(),o=yield y.confirmTransaction({signature:n,blockhash:i.blockhash,lastValidBlockHeight:i.lastValidBlockHeight});if(o.value.err)return void e.onError(o.value.err);e.onSuccess(n)}catch(t){console.error("wallet.sendTransaction execute:",t),e.onError(t)}}))})}catch(e){throw console.error("Transaction deserialization error:",e),e}}))}),P=n.useMemo((()=>B?O.mutate:R),[R,O.mutate,B]);return{status:S?bs.Loading:L?bs.Failed:A.status,rawBrief:A.rawBrief,executeSwap:P}}function js(e){const{bridgeSlippage:t,swapSlippage:i}=Q(),{autoSlippage:o}=Wa();return{defaultSlippage:n.useMemo((()=>!(null==o?void 0:o.loading)&&(null==o?void 0:o.value)?o.value:e?null!=t?t:zo:null!=i?i:Vo),[i,t,e,o]),loading:null==o?void 0:o.loading}}function ws({side:e,defaultToken:t,tokenList:n,occupyToken:i,chainId:o}){var r,a;let s,l=null,d=n.filter((t=>!(t.side&&t.side!==e||o&&t.chainId!==o)));if(d.length||(d=n.filter((t=>!t.side||t.side===e))),d.length){let n=function(e){const t=localStorage.getItem("from"===e?Po:_o);if(!t)return null;try{return JSON.parse(t)}catch(e){return console.error(e),null}}(e);!n&&t&&(n=Object.assign({},t),s=t.amount),n&&(l=null!==(r=d.find((e=>e.address===(null==n?void 0:n.address)&&e.chainId===n.chainId)))&&void 0!==r?r:null),l||(i?l=null!==(a=d.find((e=>e.address!==i.address)))&&void 0!==a?a:null:[l]=d)}return{findToken:l,setDefaultAmount:s}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(bs||(bs={}));const ks=[{inputs:[],name:"isFlashRPC",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"isBlocknativeRPC",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"}];function Ts({chainId:e,account:t}){const{evmProvider:o}=Pa(),r=n.useMemo((()=>e?Ri[e]:[]),[e]),a=Boolean(t)&&void 0!==r&&r.length>0,[s,l]=n.useState(new Map),{refetch:d,refetchTimes:c}=function(e){const[t,i]=n.useState(0);return{refetch:n.useCallback((()=>{i((e=>e+1))}),[e]),refetchTimes:t,isRefetch:t>0}}();n.useEffect((()=>{function e(e){return N(this,arguments,void 0,(function*({address:e,provider:t,method:n}){if(!t)return!1;try{const i=new f.Contract(e,ks,t);return yield i[n]()}catch(e){console.error(e)}return!1}))}!function(){N(this,void 0,void 0,(function*(){const t=[],n=new Map;if(r&&r.length>0&&r.forEach((({key:i,isPrivacyEndpoint:r})=>{r&&r.contract&&t.push({call:e({address:r.contract,method:r.rpcMethod,provider:o}),callback:e=>{n.set(i,e)}})})),!t.length)return void l(new Map);(yield Promise.all(t.map((e=>e.call)))).forEach(((e,n)=>{t[n].callback(e)})),l((e=>i.isEqual(e,n)?e:n))}))}()}),[e,r,o,c]);const u=n.useMemo((()=>Array.from(s.values()).some((e=>e))),[s]);return{privacySwapSupplierEndpoints:r,privacySwapEnableAble:a,privacySwapEnable:u,refetchEndpointStatus:d,endpointStatusMap:s}}function Bs({fromToken:e,toToken:t}){var i,o,a,l;const{customSlippage:d,customSlippageNum:u,handleSlippageChange:p}=function({fromToken:e,toToken:t}){const{account:i}=Pa(),{customSwapPairSlippages:o}=vs(),r=n.useCallback((n=>{var o,r,a,s,l,d;const c=null!==(o=null==i?void 0:i.toLocaleLowerCase())&&void 0!==o?o:"",u=[n.from.toLocaleLowerCase(),n.to.toLocaleLowerCase()];return(null!==(a=null===(r=n.account)||void 0===r?void 0:r.toLocaleLowerCase())&&void 0!==a?a:"")===c&&n.chainId===(null==e?void 0:e.chainId)&&u.includes(null===(s=null==e?void 0:e.address)||void 0===s?void 0:s.toLocaleLowerCase())&&u.includes(null!==(d=null===(l=null==t?void 0:t.address)||void 0===l?void 0:l.toLocaleLowerCase())&&void 0!==d?d:"")}),[e,t,i]),a=e&&t?o.find(r):null,s=(null==a?void 0:a.disabled)?null:a,l=n.useCallback((n=>{vs.setState((o=>{var a,s,l;if(!e||!t)throw new Error("token is not valid.");const d=[...o.customSwapPairSlippages],c=Object.assign(Object.assign({},n),{account:null!==(a=null==i?void 0:i.toLowerCase())&&void 0!==a?a:"",from:e.address.toLowerCase(),to:t.address.toLowerCase(),fromSymbol:e.symbol,toSymbol:t.symbol,fromLogo:null!==(s=e.logoURI)&&void 0!==s?s:null,toLogo:null!==(l=t.logoURI)&&void 0!==l?l:null,chainId:e.chainId}),u=d.findIndex(r);return u>-1?d.splice(u,1,c):d.push(c),{customSwapPairSlippages:d}}))}),[i,e,t,r]),d=null==s?void 0:s.slippage;return{customSlippageNum:d?Number(d):0,customSlippage:d,handleSlippageChange:l}}({fromToken:e,toToken:t}),{defaultSlippage:h}=js(!1),m=function({fromToken:e,toToken:t}){const i=qa().getQuery(r.TokenApi.graphql.fetchErc20ForecastSlippage,{where:{aToken:{address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId},bToken:{address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}}}),o=c.useQuery(Object.assign(Object.assign({},i),{enabled:!!e&&!!t})),a=n.useMemo((()=>{var e,t,n;if(!(null===(e=o.data)||void 0===e?void 0:e.erc20_extend_erc20ExtendV2))return{};const{erc20_extend_erc20ExtendV2:i}=o.data,r=(null===(t=i.forecastSlippageList)||void 0===t?void 0:t.length)?null===(n=[...i.forecastSlippageList])||void 0===n?void 0:n.map((e=>Object.assign(Object.assign({},e),{confidenceRatio:(null==e?void 0:e.confidenceRatio)?Number(e.confidenceRatio):0}))).sort(((e,t)=>(null==e?void 0:e.confidenceRatio)-(null==t?void 0:t.confidenceRatio))):[];return{recommendSlippage:r.length?r[r.length-1]:void 0,slippageList:r}}),[o.data]);return Object.assign({slippageData:a},o)}({fromToken:e,toToken:t}),x=null===(i=m.slippageData.recommendSlippage)||void 0===i?void 0:i.forecastSlippage,g=x?new s(x).times(100).toNumber():x;return{customSlippage:d,customSlippageNum:u,handleSlippageChange:p,forecastSlippage:g,forecastSlippageQuery:m,recommendSlippage:null!==(o=null!=g?g:h)&&void 0!==o?o:0,slippage:null!==(l=null!==(a=d?Number(d):void 0)&&void 0!==a?a:g)&&void 0!==l?l:h,slippageLoading:m.isLoading}}var Es,Is,As,Ss,Ls;function Ms(t,{amount:i,contractAddress:o,offset:a,overrideBalance:l,skipQuery:d}={}){var u,p,h,m;const{getAppKitAccountByChainId:x}=Pa(),g=null===(u=x(null==t?void 0:t.chainId))||void 0===u?void 0:u.appKitAccount.address,[f,y]=n.useMemo((()=>t?[t.chainId,null!=o?o:r.contractConfig[t.chainId].DODO_APPROVE]:[void 0,o]),[t,o]),v=c.useQueryClient(),b=c.useQuery(Object.assign(Object.assign({},Hi.getFetchTokenQuery(d?void 0:f,null==t?void 0:t.address,g,y)),{refetchInterval:f===r.ChainId.NEOX?3e3:void 0})),{runningRequests:C}=ps(),{updateBlockNumber:j}=Qa(),{i18n:w}=e.useLingui(),k=n.useMemo((()=>{var e;return f?null===(e=r.basicTokenMap[f])||void 0===e?void 0:e.address:null}),[f]),T=n.useCallback((()=>{var e,n;if(!t)return Is.Loading;const o=C.some((e=>{var n,i,o;return(null===(n=e.spec)||void 0===n?void 0:n.opcode)===rs.Approval&&(null===(i=e.spec)||void 0===i?void 0:i.token.address)===(null==t?void 0:t.address)&&(null===(o=e.spec)||void 0===o?void 0:o.contract)===y})),r=null!=l?l:null===(e=b.data)||void 0===e?void 0:e.balance,d=null===(n=b.data)||void 0===n?void 0:n.allowance,c=new s(i||0);if(!g)return Is.Unchecked;if(!r||c.minus(null!=a?a:0).gt(r))return Is.Unchecked;if(c.isZero())return Is.Unchecked;return t.address===k?Is.Sufficient:o?Is.Approving:d?c.minus(null!=a?a:0).gt(d)?Is.Insufficient:Is.Sufficient:Is.Loading}),[C,g,a,k,b.data,t,l,i,y]),{isApproving:B,isGetApproveLoading:E,needApprove:I,needReset:A}=n.useMemo((()=>{var e;const n=T(),i=function(e,t){var n;return("USDT"===(null==e?void 0:e.symbol)||(null===(n=null==e?void 0:e.address)||void 0===n?void 0:n.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&t&&t.gt(0)}(t,null===(e=b.data)||void 0===e?void 0:e.allowance);return{isApproving:n===Is.Approving,isGetApproveLoading:n===Is.Loading||b.isLoading,needApprove:n===Is.Insufficient&&!i,needReset:n===Is.Insufficient&&i}}),[T,t,null===(p=b.data)||void 0===p?void 0:p.allowance,b.isLoading]),S=us(),L=n.useMemo((()=>{if(!t)return"";return`${A?w._({id:"OfhWJH",message:"Reset"}):w._({id:"Z7ZXbT",message:"Approve"})} ${Ma(t)}`}),[t,A,w._]),M=c.useMutation({mutationFn:()=>N(this,void 0,void 0,(function*(){if(!y||!g||!t)return;const e=A?new s(0):void 0;(yield S.execute(L,{opcode:rs.Approval,token:t,contract:y,amt:e},{metadata:{[exports.MetadataFlag.approve]:!0}}))===es.Success&&(yield j(),v.invalidateQueries({queryKey:Hi.getFetchTokenQuery(f,null==t?void 0:t.address,g,y).queryKey,refetchType:"all"}))}))}),R=n.useCallback((()=>N(this,void 0,void 0,(function*(){M.mutate()}))),[M]),O=n.useCallback((()=>{var e;const n=new s(0);if(!t)return n.toString();const i=null!=l?l:null===(e=b.data)||void 0===e?void 0:e.balance;if(!i)return n.toString();return i.toString()}),[f,null===(h=b.data)||void 0===h?void 0:h.balance,l,t]),P=n.useMemo((()=>{var e,t;if(!i)return!1;return(null!==(t=null!=l?l:null===(e=b.data)||void 0===e?void 0:e.balance)&&void 0!==t?t:new s(0)).lt(i)}),[null===(m=b.data)||void 0===m?void 0:m.balance,l,i]),_=B||M.isPending;return{token:t,isApproving:_,isGetApproveLoading:E,needApprove:I,needReset:A,needShowTokenStatusButton:I||A||_||P,insufficientBalance:P,loading:b.isLoading,approveTitle:L,submitApprove:R,getMaxBalance:O}}function Rs({fees:e}){return n.useMemo((()=>{const t=e.map((e=>{const t=new s.BigNumber(e.amountUSD);return{key:e.type,title:"platformFee"===e.type?"ZetaChain Fees":"btcDepositFee"===e.type?"Source Chain Fees":"destinationFee"===e.type?"Destination Chain Fees":e.type,value:t.isFinite()?t.dp(4,s.BigNumber.ROUND_DOWN).toString():null,isFree:!1}}));return t.push({key:"protocolFees",title:"Protocol Fees",value:"0",isFree:!0}),t}),[e])}function Os(e,t){let n=o.i18n._({id:"B0/2ea",message:"s"});return t||(n=e>=2?o.i18n._({id:"V+rJKF",message:"Seconds"}):o.i18n._({id:"ku//5b",message:"Second"})),n}function Ps(e,t){let n="";return n=e>=2?t?o.i18n._({id:"TFOxRM",message:"Mins"}):o.i18n._({id:"agRWc1",message:"Minutes"}):t?o.i18n._({id:"eTUF28",message:"Min"}):o.i18n._({id:"6UYTy8",message:"Minute"}),n}function _s(e){return e>=2?o.i18n._({id:"yY8wAv",message:"Hours"}):o.i18n._({id:"6XgEPi",message:"Hour"})}function Ds({start:e,end:t,showSecondUnit:n}){if(!e||!t)return null;const i=t-e,r=1e3,a=6e4,s=36e5,l=24*s;let d="",c="";if(i<a){const e=i/r;d=`${dr(e)} ${Os(e,n)}`}else if(i<s){const e=i/a;d=`${dr(e)} ${Ps(e,n)}`;const t=i%a/r;c=`${dr(t)} ${Os(t,n)}`}else if(i<l){const e=i/s;d=`${dr(e)} ${_s(e)}`;const t=i%s/a;c=`${dr(t)} ${Ps(t)}`}else{const e=i/l;d=`${dr(e)} ${function(e){return e>=2?o.i18n._({id:"HuVZMK",message:"Days"}):o.i18n._({id:"H7OUPr",message:"Day"})}(e)}`;const t=i%l/s;c=`${dr(t)} ${_s(t)}`}return n?`${d}${c}`.replaceAll(" ","").toLowerCase():d}function Ns(e){const t=String(e);return 1===t.length?`0${t}`:t}function Fs(e,t="/",{noYear:n}={}){const i=e.getFullYear(),o=e.getMonth()+1,r=e.getDate(),a=e.getHours(),s=e.getMinutes();let l=`${Ns(o)}${t}${Ns(r)} ${Ns(a)}:${Ns(s)}`;return n||(l=`${i}${t}${l}`),l}function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Us.apply(null,arguments)}!function(e){e.All="all"}(Es||(Es={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(Is||(Is={})),function(e){e.Loading="Loading",e.Insufficient="BalanceInsufficient",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(As||(As={}));const qs=e=>P.createElement("svg",Us({xmlns:"http://www.w3.org/2000/svg",width:41,height:48,viewBox:"0 0 41 48",fill:"none"},e),Ss||(Ss=P.createElement("g",{opacity:.1},P.createElement("path",{d:"M69.3733 -7.24829V16.7239C69.3733 20.9663 67.7575 25.1065 64.7744 28.5311C63.8422 29.6045 62.7857 30.5757 61.667 31.4446L61.6049 31.4957H47.9325V9.26134H35.2544H22.452H21.3334H8.65527L8.84172 9.10801L19.5932 0.827625L23.5707 -2.18806C28.0453 -5.66378 33.5764 -7.24829 39.6668 -7.24829H69.3733Z",fill:"url(#paint0_linear_2049_57770)"}),P.createElement("path",{d:"M61.6048 31.5474L61.5426 31.5985L60.7969 32.1607L58.0624 34.3075L48.1809 41.9234L47.2487 42.639C42.7741 46.0636 36.8701 47.9548 30.8418 47.9548H0.886719V37.2209L0.948865 31.4962L1.01102 23.8803C1.07316 18.309 3.80765 13.0443 8.7173 9.2619H21.3332H21.3954V31.4962L61.6048 31.5474Z",fill:"url(#paint1_linear_2049_57770)"}))),Ls||(Ls=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_2049_57770",x1:40.5027,y1:-9.613,x2:37.8436,y2:51.3238,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#48EF8A"}),P.createElement("stop",{offset:.5458,stopColor:"#43B4A6"}),P.createElement("stop",{offset:.6918,stopColor:"#2D796F"}),P.createElement("stop",{offset:.9662})),P.createElement("linearGradient",{id:"paint1_linear_2049_57770",x1:33.1012,y1:50.9719,x2:26.0861,y2:-11.7811,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FF5F96"}),P.createElement("stop",{offset:.6103,stopColor:"#FF33AF"}),P.createElement("stop",{offset:1})))));var Vs,Ws;function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Hs.apply(null,arguments)}const Zs=e=>P.createElement("svg",Hs({xmlns:"http://www.w3.org/2000/svg",width:41,height:49,viewBox:"0 0 41 49",fill:"none"},e),Vs||(Vs=P.createElement("g",{opacity:.1,clipPath:"url(#clip0_2049_57744)"},P.createElement("path",{d:"M63.1864 2.81575C61.5413 -1.0709 59.1861 -4.56212 56.1887 -7.55958C55.6162 -8.13198 55.0264 -8.68035 54.419 -9.20469C54.3513 -9.26149 54.2836 -9.32048 54.2158 -9.37728C51.6903 -11.5227 48.872 -13.2574 45.8068 -14.5529C41.7803 -16.257 37.5026 -17.12 33.0938 -17.12C28.6872 -17.12 24.4094 -16.257 20.383 -14.5551C16.4941 -12.91 13.0007 -10.5592 10.0033 -7.56176C7.00362 -4.5643 4.65065 -1.07309 3.00555 2.81356C1.30145 6.84004 0.438477 11.1134 0.438477 15.52C0.438477 19.9266 1.30145 24.2 3.00555 28.2243C4.65065 32.1109 7.0058 35.6021 10.0033 38.5996C10.4883 39.0846 10.9886 39.5543 11.4998 40.0044C11.5959 40.0896 11.6943 40.1748 11.7904 40.2578C14.3618 42.4753 17.2435 44.2668 20.383 45.5929C24.4094 47.2948 28.6872 48.1578 33.0938 48.1578C37.5026 48.1578 41.7781 47.2948 45.8046 45.5929C49.6934 43.95 53.1868 41.597 56.1843 38.5996C59.1839 35.6021 61.5369 32.1109 63.182 28.2243C64.8839 24.2 65.7491 19.9244 65.7491 15.52C65.7513 11.1134 64.8883 6.84003 63.1864 2.81575ZM33.0938 46.4013C25.7225 46.4013 18.9454 43.808 13.6299 39.4866L45.9968 25.8647L34.9137 14.6177L34.9093 14.6221L34.8874 14.6002L12.7014 38.7001C6.26518 33.0351 2.19719 24.744 2.19719 15.52C2.19719 -1.50785 16.0572 -15.3613 33.0938 -15.3613C40.3755 -15.3613 47.0761 -12.8292 52.3632 -8.60388L23.7977 3.37067L34.8874 14.598L34.8918 14.5937L34.9137 14.6155L53.2895 -7.83267C59.8415 -2.16546 63.9925 6.20209 63.9925 15.52C63.9925 32.5479 50.1326 46.4013 33.0938 46.4013ZM17.0971 36.2903L34.9333 16.916L43.2004 25.3054L17.0971 36.2903ZM49.4225 -5.63264L34.7979 12.232L26.6007 3.93433L49.4225 -5.63264Z",fill:"url(#paint0_linear_2049_57744)"}))),Ws||(Ws=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_2049_57744",x1:56.1813,y1:-7.5661,x2:10.0091,y2:38.6061,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#3EF8F3"}),P.createElement("stop",{offset:1,stopColor:"#07AEFE"})),P.createElement("clipPath",{id:"clip0_2049_57744"},P.createElement("rect",{width:65.28,height:65.28,fill:"white",transform:"translate(0.438477 -17.12)"})))));var zs;function $s(){return $s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$s.apply(null,arguments)}const Gs=e=>P.createElement("svg",$s({xmlns:"http://www.w3.org/2000/svg",width:44,height:52,viewBox:"0 0 44 52",fill:"none"},e),zs||(zs=P.createElement("g",{opacity:.1},P.createElement("path",{d:"M15.487 0.976233H29.9851L30.0102 23.019C30.011 23.5455 30.2206 24.0502 30.5932 24.4222C30.9657 24.7942 31.4707 25.0032 31.9972 25.0032C32.2581 25.0031 32.5165 24.9515 32.7575 24.8514C32.9984 24.7514 33.2173 24.6048 33.4016 24.4201C33.5859 24.2354 33.732 24.0161 33.8315 23.7749C33.9309 23.5337 33.9819 23.2753 33.9814 23.0143L33.9545 -1.01261C33.9537 -1.5392 33.7441 -2.04397 33.3715 -2.41615C32.999 -2.78833 32.4941 -2.9975 31.9675 -2.99774H15.487C14.96 -2.99774 14.4546 -2.7884 14.082 -2.41577C13.7093 -2.04313 13.5 -1.53773 13.5 -1.01075C13.5 -0.483771 13.7093 0.0216253 14.082 0.394258C14.4546 0.76689 14.96 0.976233 15.487 0.976233Z",fill:"#154618"}),P.createElement("path",{d:"M11.8257 9.97397H20.9902L21.0143 23.0186V32.0139C21.014 32.2753 21.0652 32.5342 21.165 32.7758C21.2649 33.0174 21.4115 33.2369 21.5963 33.4217C21.7811 33.6066 22.0006 33.7531 22.2422 33.853C22.4838 33.9529 22.7427 34.0041 23.0041 34.0037H41.0004C41.2614 34.0035 41.5198 33.9518 41.7608 33.8517C42.0019 33.7515 42.2208 33.6049 42.4052 33.4201C42.5895 33.2353 42.7357 33.016 42.8352 32.7747C42.9348 32.5335 42.9859 32.2749 42.9855 32.0139V23.0149L42.9576 -10.0121C42.9579 -10.5389 42.7489 -11.0443 42.3766 -11.417C42.0044 -11.7898 41.4993 -11.9995 40.9725 -12H19.2866C18.7596 -12 18.2543 -11.7907 17.8816 -11.418C17.509 -11.0454 17.2996 -10.54 17.2996 -10.013C17.2996 -9.48603 17.509 -8.98063 17.8816 -8.608C18.2543 -8.23536 18.7596 -8.02602 19.2866 -8.02602H38.9892L39.0162 23.0149V30.0251H24.9883V23.0149L24.9614 7.98141C24.9601 7.45515 24.7503 6.95085 24.3778 6.57907C24.0053 6.20729 23.5006 5.99838 22.9744 5.99813H11.8219C11.295 5.99813 10.7896 6.20748 10.4169 6.58011C10.0443 6.95275 9.83496 7.45814 9.83496 7.98512C9.83496 8.51211 10.0443 9.01751 10.4169 9.39014C10.7896 9.76277 11.295 9.97211 11.8219 9.97211L11.8257 9.97397Z",fill:"#154618"}),P.createElement("path",{d:"M58.998 32.558C58.737 32.558 58.4786 32.6094 58.2376 32.7093C57.9965 32.8091 57.7774 32.9555 57.5929 33.14C57.4084 33.3245 57.2621 33.5436 57.1622 33.7846C57.0624 34.0257 57.011 34.2841 57.011 34.545V48.0209H6.9896V34.545C6.9896 34.0181 6.78026 33.5126 6.40763 33.14C6.03499 32.7674 5.5296 32.558 5.00261 32.558C4.47563 32.558 3.97023 32.7674 3.5976 33.14C3.22497 33.5126 3.01562 34.0181 3.01562 34.545V50.0125C3.01562 50.5395 3.22497 51.0449 3.5976 51.4175C3.97023 51.7901 4.47563 51.9995 5.00261 51.9995H58.9989C59.2598 51.9995 59.5182 51.9481 59.7593 51.8482C60.0003 51.7484 60.2194 51.602 60.4039 51.4175C60.5884 51.233 60.7348 51.014 60.8346 50.7729C60.9345 50.5318 60.9859 50.2734 60.9859 50.0125V34.545C60.9859 34.284 60.9344 34.0256 60.8345 33.7844C60.7346 33.5433 60.5882 33.3242 60.4036 33.1397C60.219 32.9552 59.9998 32.8088 59.7586 32.709C59.5174 32.6092 59.259 32.5579 58.998 32.558Z",fill:"#154618"}),P.createElement("path",{d:"M15.9876 39.0284V29.4847C15.9876 28.9577 15.7783 28.4524 15.4057 28.0797C15.033 27.7071 14.5276 27.4977 14.0007 27.4977C13.4737 27.4977 12.9683 27.7071 12.5956 28.0797C12.223 28.4524 12.0137 28.9577 12.0137 29.4847V41.0154C12.0139 41.5423 12.2233 42.0476 12.5959 42.4201C12.9685 42.7927 13.4738 43.0021 14.0007 43.0024H49.9979C50.5248 43.0021 51.03 42.7927 51.4026 42.4201C51.7752 42.0476 51.9846 41.5423 51.9848 41.0154V29.4847C51.9848 28.9577 51.7755 28.4524 51.4029 28.0797C51.0302 27.7071 50.5248 27.4977 49.9979 27.4977C49.4709 27.4977 48.9655 27.7071 48.5928 28.0797C48.2202 28.4524 48.0109 28.9577 48.0109 29.4847V39.0284H15.9876Z",fill:"#154618"})))),Qs=[{id:"thorswap",name:"ThorSwap",ICON:z.jsx(Zs,{}),width:41,height:49},{id:"ZUNO",name:"ZUNO",selected:!0,ICON:z.jsx(Gs,{}),width:44,height:52},{id:"ChainFlip",name:"ChainFlip",ICON:z.jsx(qs,{}),width:41,height:48}],Ys=({feeUSD:e})=>{const n=t.useTheme();return z.jsx(t.Box,{sx:{display:"flex",alignItems:"flex-start",gap:8,px:8,py:12,backgroundColor:"background.tag",borderRadius:8},children:Qs.map((i=>z.jsxs(t.Box,{sx:{flexGrow:1,flexBasis:"100%",flexShrink:1,display:"flex",flexDirection:"column",gap:4,px:2,pb:2,borderRadius:8,background:i.selected?n.palette.primary.main:"transparent"},children:[z.jsx(t.Box,{sx:{color:i.selected?n.palette.primary.contrastText:n.palette.primary.main,typography:"h6",lineHeight:"16px",px:8,py:4,textAlign:"center"},children:i.selected?z.jsx(z.Fragment,{children:"Cheapest"}):z.jsx(z.Fragment,{children:" "})}),z.jsxs(t.Box,{sx:{p:11,border:`solid 1px ${n.palette.border.main}`,borderRadius:8,backgroundColor:"background.paper",position:"relative",overflow:"hidden"},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:n.palette.text.secondary},children:i.name}),z.jsx(t.Box,{sx:{pt:20,typography:"h6",color:n.palette.text.secondary},children:"Fee Cost"}),z.jsxs(t.Box,{sx:{pt:4,typography:"body2",fontWeight:600,color:n.palette.text.primary},children:[i.selected?null!==e?`$${e}`:"-":"$-",i.selected?null:z.jsx(t.Box,{component:"span",sx:{color:n.palette.text.secondary},children:"(no route)"})]}),z.jsx(t.Box,{sx:{position:"absolute",top:0,right:0,width:i.width,height:i.height},children:i.ICON})]})]},i.id)))})},Xs=300;function Ks({open:e,onClose:n,afterClose:i,title:o,rightSlot:r,canBack:a=!0,children:s,height:l,testId:d}){return z.jsxs(t.Box,{sx:{position:"absolute",top:e?0:"100%",transition:`all ${Xs}ms`,zIndex:20,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:l},"data-testid":d,"data-active":e?"1":"0",children:[o?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:20,px:16},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:o}),r,!r&&a&&z.jsx(t.Box,{component:oe.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{n&&n(),setTimeout((()=>i&&i()),Xs)}})]}):"",e?s:""]})}function Js({open:e,onClose:n,afterClose:i,title:o,rightSlot:r,canBack:a=!0,children:s,height:l,testId:d}){return z.jsx(t.Modal,{open:e,onClose:n,"data-testid":d,"data-active":e?"1":"0",children:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",height:l},children:[o?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:20,px:16},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:o}),r,!r&&a&&z.jsx(t.Box,{component:oe.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{n&&n(),setTimeout((()=>i&&i()),Xs)}})]}):"",e?s:""]})})}function el(e){var{scope:t,modal:n}=e,i=D(e,["scope","modal"]);const{widgetRef:o,DialogComponent:r}=Q();if(r)return z.jsx(r,{scope:t,...i});const a=n?Js:Ks;return(null==o?void 0:o.current)&&!t?y.createPortal(z.jsx(a,{...i}),o.current):z.jsx(a,{...i})}const tl=[{id:12,name:"BTC",address:"Btc1111111111111111111111111111111111111111",symbol:"BTC",decimals:8,logo:"https://images.dodoex.io/8u70XjrPNgcVffPsM2CUsThfewe-M8YkCb61pvH8MbI/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy9kZXYvMTgzMzMvYnRjMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMQ.webp",chainId:18333,position:1,slippage:null},{id:16,name:"sBTC.BTC",address:"0xdbfF6471a79E5374d771922F2194eccc42210B9F",symbol:"sBTC.BTC",decimals:8,logo:"https://images.dodoex.io/PAuwJNz7hUnicIjvdHhWMuLzEA1K8bIDhP0siYm39iI/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4ZGJmZjY0NzFhNzllNTM3NGQ3NzE5MjJmMjE5NGVjY2M0MjIxMGI5Zg.webp",chainId:7001,position:1,slippage:null},{id:15,name:"WSOL",address:"So11111111111111111111111111111111111111112",symbol:"SOL",decimals:9,logo:"https://images.dodoex.io/9y55YGyddAW3Oghubkioc9qwaK_T22nj7zEeIUTQokU/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTUxL3NvMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTI.webp",chainId:1399811151,position:1,slippage:null},{id:13,name:"WETH",address:"0x0246DffDa649e877CFd0951837332B4690fAD1EB",symbol:"WETH",decimals:18,logo:"https://images.dodoex.io/TCefiok1g3HBQn6sFNDq2jaHt5EMa2cTGD9g6lMhJpc/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4MDI0NmRmZmRhNjQ5ZTg3N2NmZDA5NTE4MzczMzJiNDY5MGZhZDFlYg.webp",chainId:7001,position:1,slippage:null},{id:10,name:"SOL.SOLANA",address:"0xADF73ebA3Ebaa7254E859549A44c74eF7cff7501",symbol:"SOL.SOLANA",decimals:9,logo:"https://images.dodoex.io/p29e1Bm9r48LoDR-WIBm36JMR9Ws4eEV6sQQrliw9zs/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4YWRmNzNlYmEzZWJhYTcyNTRlODU5NTQ5YTQ0Yzc0ZWY3Y2ZmNzUwMQ.webp",chainId:7001,position:1,slippage:null},{id:8,name:"ETH.ARBSEP",address:"0x1de70f3e971B62A0707dA18100392af14f7fB677",symbol:"ETH.ARBSEP",decimals:18,logo:"https://images.dodoex.io/PzA4w0PPgfrlBoa79Eo7UBMQLuf9MT62wuvRP20zwlU/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4MWRlNzBmM2U5NzFiNjJhMDcwN2RhMTgxMDAzOTJhZjE0ZjdmYjY3Nw.webp",chainId:7001,position:1,slippage:null},{id:6,name:"sETH.SEPOLIA",address:"0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0",symbol:"sETH.SEPOLIA",decimals:18,logo:"https://images.dodoex.io/4eFMcUpnwYSWFMekEQYBezuoWCSnsiAPn6cPonV6IGE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4MDViYTE0OWE3YmQ2ZGMxZjkzN2ZhOTA0NmE5ZTA1YzA1ZjNiMThiMA.webp",chainId:7001,position:1,slippage:null},{id:5,name:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",decimals:18,logo:"https://images.dodoex.io/aR091dK35zcnyEZuJSfhSjA-yg1BW_XGEZqi0KN4qdE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy80MjE2MTQvMHhlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVl.webp",chainId:421614,position:1,slippage:null},{id:3,name:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",decimals:18,logo:"https://images.dodoex.io/P3yC2p-mcfWKHL3QTNyPG6NIL6mCLQJuy6D3eF6IXqA/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMTE1NTExMS8weGVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWU.webp",chainId:11155111,position:1,slippage:null},{id:1,name:"USDD",address:"0x680447595e8b7b3Aa1B43beB9f6098C79ac2Ab3f",symbol:"USDD",decimals:18,logo:"https://images.dodoex.io/fatODMcjTeSizv9E1eCQzFHrhkKTIerFzE6n9GWY-_4/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy80MjE2MS8weDY4MDQ0NzU5NWU4YjdiM2FhMWI0M2JlYjlmNjA5OGM3OWFjMmFiM2Y.webp",chainId:42161,position:1,slippage:null},{id:14,name:"TRAINING1",address:"aiy9XpdqsABsLnBvvDwefTLfcZjokNFqLDeD3gGhCRc",symbol:"TRAINING1",decimals:6,logo:"https://images.dodoex.io/CI8c05o63B09bWzWXtI_5Z7oIZfXh9qaTF5Tucz9qhs/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTUxL2FpeTl4cGRxc2Fic2xuYnZ2ZHdlZnRsZmN6am9rbmZxbGRlZDNnZ2hjcmM.webp",chainId:1399811151,position:1,slippage:null},{id:11,name:"SOL",address:"So11111111111111111111111111111111111111111",symbol:"SOL",decimals:9,logo:"https://images.dodoex.io/ko0s38K3-b8kr1TdsReoiPgJt3QQkIbO4yshme2l7PM/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTUxL3NvMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE.webp",chainId:1399811151,position:1,slippage:null},{id:17,name:"USDC",address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",decimals:6,logo:"https://images.dodoex.io/EuGxqCwOzt4Olg1oI84ezmYbQ8_N5lCW6PeaaVGIN9A/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTQ5L2VwamZ3ZGQ1YXVmcXNzcWVtMnFuMXh6eWJhcGM4ZzR3ZWdna3p3eXRkdDF2.webp",chainId:1399811149,position:1,slippage:null},{id:9,name:"USDC.ARBSEP",address:"0x4bC32034caCcc9B7e02536945eDbC286bACbA073",symbol:"USDC.ARBSEP",decimals:6,logo:"https://images.dodoex.io/EucuUuN0jHNd6apBwcby_eh57aYzxD8AFnkBeoJXhSc/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4NGJjMzIwMzRjYWNjYzliN2UwMjUzNjk0NWVkYmMyODZiYWNiYTA3Mw.webp",chainId:7001,position:1,slippage:null},{id:7,name:"USDC.SEPOLIA",address:"0xcC683A782f4B30c138787CB5576a86AF66fdc31d",symbol:"USDC.SEPOLIA",decimals:6,logo:"https://images.dodoex.io/ng9FXb63x8h-ITfB04ikMVnGyGITS0KOw2fcTYHtXPk/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAxLzB4Y2M2ODNhNzgyZjRiMzBjMTM4Nzg3Y2I1NTc2YTg2YWY2NmZkYzMxZA.webp",chainId:7001,position:1,slippage:null},{id:4,name:"USDC",address:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",symbol:"USDC",decimals:6,logo:"https://images.dodoex.io/cYegvLr5lcFzE1xLzQlcFHxoXQeK6cI7rdBCnfxAJdE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy80MjE2MTQvMHg3NWZhZjExNGVhZmIxYmRiZTJmMDMxNmRmODkzZmQ1OGNlNDZhYTRk.webp",chainId:421614,position:1,slippage:null},{id:2,name:"USDC",address:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",symbol:"USDC",decimals:6,logo:"https://images.dodoex.io/AJheN4AJDTFTkfEjd2_qGhqDP63S9wXqkwclm2kf7lE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMTE1NTExMS8weDFjN2Q0YjE5NmNiMGM3YjAxZDc0M2ZiYzYxMTZhOTAyMzc5YzcyMzg.webp",chainId:11155111,position:1,slippage:null},{id:33,name:"USDC",address:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",symbol:"USDC",decimals:6,logo:"https://images.dodoex.io/CERjbaEHxUZ94fySsFAZI233s7osUkuOlbektBuifDg/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy84NDUzLzB4ODMzNTg5ZmNkNmVkYjZlMDhmNGM3YzMyZDRmNzFiNTRiZGEwMjkxMw.webp",chainId:8453,position:1,slippage:null},{id:20,name:"USDT.ETH",address:"0x7c8dDa80bbBE1254a7aACf3219EBe1481c6E01d7",symbol:"USDT.ETH",decimals:6,logo:"https://images.dodoex.io/NhDsnNLIe6wxANbCTkN4aO0e3tIr2dDNOHHruS-fSr4/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4N2M4ZGRhODBiYmJlMTI1NGE3YWFjZjMyMTllYmUxNDgxYzZlMDFkNw.webp",chainId:7e3,position:1,slippage:null},{id:19,name:"USDT",address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",decimals:6,logo:"https://images.dodoex.io/_01_c54V78OZyrazL-r-FOZ8vdjo9wuGwv9UWAetRwE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xLzB4ZGFjMTdmOTU4ZDJlZTUyM2EyMjA2MjA2OTk0NTk3YzEzZDgzMWVjNw.webp",chainId:1,position:1,slippage:null},{id:18,name:"USDT",address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",decimals:6,logo:"https://images.dodoex.io/nhd6FG-jos1PQn_XgpY21lk6IwWyUDbqzEYfOgPKxMY/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTQ5L2VzOXZtZnJ6YWNlcm1qZnJmNGgyZnlkNGtjb25reTExbWNjZThiZW53bnli.webp",chainId:1399811149,position:1,slippage:null},{id:29,name:"USDC.POL",address:"0xfC9201f4116aE6b054722E10b98D904829b469c3",symbol:"USDC.POL",decimals:6,logo:"https://images.dodoex.io/NPAlNcipHd61-GdLMWJghdNGw1ySweKRpTnsGWS8P9Q/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4ZmM5MjAxZjQxMTZhZTZiMDU0NzIyZTEwYjk4ZDkwNDgyOWI0NjljMw.webp",chainId:7e3,position:1,slippage:null},{id:23,name:"ETH.ETH",address:"0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891",symbol:"ETH.ETH",decimals:18,logo:"https://images.dodoex.io/Bi4aLE6vSccLsC48cL3khm5VxCzncCnJnfgjhSHmk9U/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4ZDk3YjFkZTM2MTllZDJjNmJlYjM4NjAxNDdlMzBjYThhN2RjOTg5MQ.webp",chainId:7e3,position:1,slippage:null},{id:24,name:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",decimals:18,logo:"https://images.dodoex.io/uyGXGjBVyWKFvjsJMA3REDvJFx3d6-ju3J3te82Kmzc/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xLzB4ZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZQ.webp",chainId:1,position:1,slippage:null},{id:25,name:"MATIC",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"MATIC",decimals:18,logo:"https://images.dodoex.io/q14Bdyohg8GsUtSuCucO1OvD8WdDAjwevatXpOnf2es/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzcvMHhlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVl.webp",chainId:137,position:1,slippage:null},{id:26,name:"POL.POL",address:"0xADF73ebA3Ebaa7254E859549A44c74eF7cff7501",symbol:"POL.POL",decimals:18,logo:"https://images.dodoex.io/kObVkVJHiJQ_SbBPzIhKJ3FoLFFUFUdLpVP3gUytqWU/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4YWRmNzNlYmEzZWJhYTcyNTRlODU5NTQ5YTQ0Yzc0ZWY3Y2ZmNzUwMQ.webp",chainId:7e3,position:1,slippage:null},{id:28,name:"USDT.POL",address:"0xdbfF6471a79E5374d771922F2194eccc42210B9F",symbol:"USDT.POL",decimals:6,logo:"https://images.dodoex.io/Y4uv2NgWWMhqP1AmKqT_0g9ZRRLxyc0MA6A_8sbprzw/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4ZGJmZjY0NzFhNzllNTM3NGQ3NzE5MjJmMjE5NGVjY2M0MjIxMGI5Zg.webp",chainId:7e3,position:1,slippage:null},{id:27,name:"USDT",address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:"USDT",decimals:6,logo:"https://images.dodoex.io/Pyi3jMJcoPyK_Yy0PULJSbJ6-aZCvOMAJx2AZd_aPXc/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzcvMHhjMjEzMmQwNWQzMWM5MTRhODdjNjYxMWMxMDc0OGFlYjA0YjU4ZThm.webp",chainId:137,position:1,slippage:null},{id:40,name:"USDC",address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",decimals:18,logo:"https://images.dodoex.io/n_vqPBUiJHV2hPiOKpvBq6O6Hri9OQqhwgoG60A4J6g/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy81Ni8weDhhYzc2YTUxY2M5NTBkOTgyMmQ2OGI4M2ZlMWFkOTdiMzJjZDU4MGQ.webp",chainId:56,position:1,slippage:null},{id:42,name:"USDC.SOL",address:"0x8344d6f84d26f998fa070BbEA6D2E15E359e2641",symbol:"USDC.SOL",decimals:6,logo:"https://images.dodoex.io/iG8OY3i2giQ9hs1C2W086-Q5zvre46jw9RYrarOwyGc/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4ODM0NGQ2Zjg0ZDI2Zjk5OGZhMDcwYmJlYTZkMmUxNWUzNTllMjY0MQ.webp",chainId:7e3,position:1,slippage:null},{id:39,name:"USDC.BSC",address:"0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0",symbol:"USDC.BSC",decimals:18,logo:"https://images.dodoex.io/bTXu-YYQfq6Qn0cv9-y4yoofAQlGCuwYCAHQ0uELzBI/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4MDViYTE0OWE3YmQ2ZGMxZjkzN2ZhOTA0NmE5ZTA1YzA1ZjNiMThiMA.webp",chainId:7e3,position:1,slippage:null},{id:32,name:"USDC.BASE",address:"0x96152E6180E085FA57c7708e18AF8F05e37B479D",symbol:"USDC.BASE",decimals:6,logo:"https://images.dodoex.io/JPhXeoyirD6jsVk51fvPAx4pxVlULTwq5KCxaQcPlC8/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4OTYxNTJlNjE4MGUwODVmYTU3Yzc3MDhlMThhZjhmMDVlMzdiNDc5ZA.webp",chainId:7e3,position:1,slippage:null},{id:31,name:"ETH.BASE",address:"0x1de70f3e971B62A0707dA18100392af14f7fB677",symbol:"ETH.BASE",decimals:18,logo:"https://images.dodoex.io/qxH5mwxmr21MICXXndfHvphy5X8S5TIuj3x_2W_Y4dc/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4MWRlNzBmM2U5NzFiNjJhMDcwN2RhMTgxMDAzOTJhZjE0ZjdmYjY3Nw.webp",chainId:7e3,position:1,slippage:null},{id:36,name:"BNB",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"BNB",decimals:18,logo:"https://images.dodoex.io/7O7CL3_y3iNVbX2lzvO9InsX82rJIoylKfJacxh-eVQ/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy81Ni8weGVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWU.webp",chainId:56,position:1,slippage:null},{id:35,name:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ETH",decimals:18,logo:"https://images.dodoex.io/c52q9Ci69y-onlKa4FMKaNikyAGOntawU6VIkqJukyA/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy84NDUzLzB4ZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZQ.webp",chainId:8453,position:1,slippage:null},{id:34,name:"BNB.BSC",address:"0x48f80608B672DC30DC7e3dbBd0343c5F02C738Eb",symbol:"BNB.BSC",decimals:18,logo:"https://images.dodoex.io/1ejG0wdx8UH7e6AHiL1h4QbZ5L_Alxm6Is4BosQ2ATI/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4NDhmODA2MDhiNjcyZGMzMGRjN2UzZGJiZDAzNDNjNWYwMmM3MzhlYg.webp",chainId:7e3,position:1,slippage:null},{id:38,name:"USDT",address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",decimals:18,logo:"https://images.dodoex.io/2W4uxRtZOxCLY-a9gQizkJi4RVQLUzbr0UX2gNo37Ok/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy81Ni8weDU1ZDM5ODMyNmY5OTA1OWZmNzc1NDg1MjQ2OTk5MDI3YjMxOTc5NTU.webp",chainId:56,position:1,slippage:null},{id:37,name:"USDT.BSC",address:"0x91d4F0D54090Df2D81e834c3c8CE71C6c865e79F",symbol:"USDT.BSC",decimals:18,logo:"https://images.dodoex.io/V2trm_Y-xP1eOBywqVf88CvJfFoyGGpWD18znuRBWRQ/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4OTFkNGYwZDU0MDkwZGYyZDgxZTgzNGMzYzhjZTcxYzZjODY1ZTc5Zg.webp",chainId:7e3,position:1,slippage:null},{id:45,name:"SOL",address:"So11111111111111111111111111111111111111111",symbol:"SOL",decimals:9,logo:"https://images.dodoex.io/kys02NROjudFdajYoIH12IffDX9b3J9XxKS1T8_jgyo/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTQ5L3NvMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE.webp",chainId:1399811149,position:1,slippage:null},{id:41,name:"SOL.SOL",address:"0x4bC32034caCcc9B7e02536945eDbC286bACbA073",symbol:"SOL.SOL",decimals:9,logo:"https://images.dodoex.io/PQIDkNF0rOpKTHAv22jhY_4cMRL_oT0hNrkuxuN8DsI/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4NGJjMzIwMzRjYWNjYzliN2UwMjUzNjk0NWVkYmMyODZiYWNiYTA3Mw.webp",chainId:7e3,position:1,slippage:null},{id:44,name:"ZETA",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",symbol:"ZETA",decimals:18,logo:"https://images.dodoex.io/FrT_2br7AHQd_EyVOn6h8r0p4J0m6whuU1oSJ_071vw/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4ZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZQ.webp",chainId:7e3,position:1,slippage:null},{id:43,name:"USDT.SOL",address:"0xEe9CC614D03e7Dbe994b514079f4914a605B4719",symbol:"USDT.SOL",decimals:6,logo:"https://images.dodoex.io/2HDkUjIqo4oJCLEh6l7qekmKIk2kq09Jlhzy1sd9BmY/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4ZWU5Y2M2MTRkMDNlN2RiZTk5NGI1MTQwNzlmNDkxNGE2MDViNDcxOQ.webp",chainId:7e3,position:1,slippage:null},{id:30,name:"USDC",address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",symbol:"USDC",decimals:6,logo:"https://images.dodoex.io/DTRPNHS0BdX9XKQKYh_hmmykcTNTuF1yvyhcJmXm6pE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzcvMHgzYzQ5OWM1NDJjZWY1ZTM4MTFlMTE5MmNlNzBkOGNjMDNkNWMzMzU5.webp",chainId:137,position:1,slippage:null},{id:22,name:"USDC",address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",decimals:6,logo:"https://images.dodoex.io/GTUw7K7vTrzx_WlQWZsO-KeXG7iRSeCWxVFe9gHGVB0/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xLzB4YTBiODY5OTFjNjIxOGIzNmMxZDE5ZDRhMmU5ZWIwY2UzNjA2ZWI0OA.webp",chainId:1,position:1,slippage:null},{id:21,name:"USDC.ETH",address:"0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a",symbol:"USDC.ETH",decimals:6,logo:"https://images.dodoex.io/j6lLwDFo5kwRkEDbcdvMuqHfYReF1JaFO9K67DMLDew/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy83MDAwLzB4MGNiZTBkZjEzMmE2YzZiNGEyOTc0ZmExYjdmYjk1M2NmMGNjNzk4YQ.webp",chainId:7e3,position:1,slippage:null},{id:46,name:"WSOL",address:"So11111111111111111111111111111111111111112",symbol:"SOL",decimals:9,logo:"https://images.dodoex.io/5OgzDevtf0Z-I7x6JUnlaRvZzFmZp6xXgLmIb7vgvnE/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy8xMzk5ODExMTQ5L3NvMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTI.webp",chainId:1399811149,position:1,slippage:null},{id:47,name:"BTC",address:"Btc1111111111111111111111111111111111111111",symbol:"BTC",decimals:8,logo:"https://images.dodoex.io/b9WxLdejlaElrFFP9nst4EHXNn2Hm3VJw3Xi_smuXEM/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy84MjIzL2J0YzExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE.webp",chainId:8223,position:1,slippage:null}];function nl({tokenList:e,popularTokenList:t}){n.useEffect((()=>{(()=>{N(this,void 0,void 0,(function*(){let n=[];var o;n=i.isArray(e)?e:i.unionBy(t,tl,(e=>e.address.toLowerCase()+e.chainId+e.side)),o=n,Ko.setState({tokenList:o})}))})()}),[e,t]),n.useEffect((()=>{var e;e=null!=t?t:[],Ko.setState({popularTokenList:e})}),[t])}var il;function ol(e,t,n,i=0){if(e===t)return il.fully+i;const o=e.indexOf(t);return 0===o?il.prefix+i:o>0?il.other+i:il.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(il||(il={}));const rl=(e,t,{matchAddress:n}={})=>{if(!t)return 0;const i=t.toLocaleLowerCase();let o=0;if(n&&e.address.toLocaleLowerCase()===i&&(o=1),!o){o=ol(e.symbol.toLocaleLowerCase(),i,0,1)}if(o)e.name.toLocaleLowerCase()===i&&(o=il.fully+1);else{let t=ol(e.name.toLocaleLowerCase(),i,0,10);t=t===il.fully+10?il.fully+1:t,o=t}return o};function al({value:e,onChange:t,occupiedAddrs:i,occupiedChainId:o,hiddenAddrs:r,showAddrs:a,side:l,chainId:d,visible:c,defaultLoadBalance:u,multiple:p}){const[h,m]=n.useState(""),{tokenList:x}=Ko(),g=is(),f=n.useMemo((()=>null!=d?d:g),[d,g]),y=n.useMemo((()=>x.filter((e=>e.chainId===f))),[x,f]),v=Ko((e=>e.popularTokenList.filter((e=>e.chainId===f)))),b=n.useMemo((()=>(null==tl?void 0:tl.filter((e=>e.chainId===f)))||[]),[f]),C=n.useMemo((()=>new Set(r?r.map((e=>e.toLowerCase())):void 0)),[r]),j=n.useMemo((()=>a?new Set(a.map((e=>e.toLowerCase()))):void 0),[a]),w=n.useCallback((e=>{const t=new Set;return e.filter((e=>{if(e.chainId!==f)return!1;let n=!0;if(n=j?j.has(e.address.toLowerCase()):!C.has(e.address.toLowerCase()),n)if(l)n=!e.side||e.side===l;else{const i=`${e.chainId}-${e.address}`;n=!t.has(i),t.add(i)}return n}))}),[j,f,C]),k=n.useMemo((()=>w(v)),[v,w]),T=n.useCallback((n=>{const r=n.address.toLowerCase(),a=!(o&&n.chainId!==o||!(null==i?void 0:i.some((e=>e.toLowerCase()===r))));if(Array.isArray(e)||p&&!e){const i=[...e],o=i.findIndex((e=>e.address.toLocaleLowerCase()===r));-1!==o?i.splice(o,1):i.push(n),t(i,a)}else t(n,a)}),[t,i,o]),B=n.useMemo((()=>{const e=w(y),t=new Set;return e.forEach((e=>{t.add(e.address)})),k.forEach((n=>{t.has(n.address)||e.push(n)})),e||[]}),[y,w,k]),E=function({chainId:e,value:t,tokenList:i,popularTokenList:o,visible:r,defaultLoadBalance:a}){const{latestBlockNumber:s}=Wa(),l=n.useMemo((()=>{const t=new Set;return i.forEach((n=>{n.chainId===e&&t.add(n)})),null==o||o.forEach((n=>{n.chainId===e&&t.add(n)})),Array.from(t)}),[i,o,e]),d=n.useMemo((()=>t?Array.isArray(t)?t.map((e=>e)):[t]:[]),[t]),c=Ga({tokenList:l,skip:!1===r&&!a});return Ga({tokenList:d,blockNumber:s}),c}({chainId:f,tokenList:B,popularTokenList:k,value:e,visible:c,defaultLoadBalance:u}),I=n.useCallback((t=>{if(null===t)return null;const n=[];h?t.forEach((e=>{const t=rl(e,h,{matchAddress:!0});t&&n.push({sort:t,token:e})})):t.forEach((e=>{n.push({sort:0,token:e})}));const o=[];return n.sort(((t,n)=>{var o,r;const a=t.token,l=n.token;if(e)if(Array.isArray(e)){const t=e.map((e=>e.address)),n=t.indexOf(a.address),i=t.indexOf(l.address),o=-1!==n,r=-1!==i;if(o||r)return o&&n<i||!r?-1:1}else{if(a.address===e.address)return-1;if(l.address===e.address)return 1}if(null==i?void 0:i.includes(a.address))return-1;if(null==i?void 0:i.includes(l.address))return 1;const d=(null===(o=E.get(`${a.chainId}-${a.address}`))||void 0===o?void 0:o.balance)||new s(0),c=(null===(r=E.get(`${l.chainId}-${l.address}`))||void 0===r?void 0:r.balance)||new s(0),u=k.map((e=>e.address));if(null==u?void 0:u.includes(a.address))return-1;if(null==u?void 0:u.includes(l.address))return 1;if(!d.eq(c))return d.gt(c)?-1:1;if(t.sort!==n.sort)return t.sort>n.sort?1:-1;const p=b.map((e=>e.address));return(null==p?void 0:p.includes(a.address))?-1:(null==p?void 0:p.includes(l.address))?1:a.symbol.localeCompare(l.symbol)})).some((e=>!!(h&&o.length>21)||(o.push(e.token),!1))),o}),[h,E,i,e,k,b]),A=n.useMemo((()=>I(B)||[]),[I]);return{filter:h,setFilter:m,showTokenList:A,onSelectToken:T,popularTokenList:k,tokenInfoMap:E}}function sl({width:e=24,height:i=24,marginRight:o=8,url:r,zIndex:a,cross:s,address:l,token:d,sx:c,chainId:u,noShowChain:p,noBorder:h,chainSize:m=12,logoOffset:x}){const[g,f]=n.useState(!1),[y,b]=n.useState(""),[C,j]=n.useState(""),[w,k]=n.useState(!1),T=n.useCallback((()=>f(!0)),[]);let B=function(e){const{chainId:t}=Pa(),{tokenList:i}=Ko();return n.useMemo((()=>{if(!e)return;let n=i.find((({address:n,chainId:i})=>i===t&&n===e));return n||(n=i.find((({address:t})=>t===e))),n}),[e,i,t])}(l);d&&(B=d);const E=l||(null==B?void 0:B.address),I=null==B?void 0:B.symbol,A=null==I?void 0:I.charAt(0).toUpperCase(),{getTokenLogoUrl:S}=Q(),L=n.useMemo((()=>null!=u?u:null==B?void 0:B.chainId),[u,B]),M=n.useMemo((()=>{const t=null==B?void 0:B.logoURI,n=r||t||"";return S&&S({address:E,chainId:L,width:e,height:i,url:n})||n}),[r,B,S,E,L,e,i]);let R=x;R||(R=m/2<8?m/2:m-8),n.useEffect((()=>{k(!1)}),[E,M]),n.useEffect((()=>{s&&(M?function(e,t){const n=new XMLHttpRequest;let i;n.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n.response)},n.onerror=function(){t()};try{i=new URL(e)}catch(e){}finally{n.open("GET",i||e),n.responseType="blob",n.send()}}(M,(e=>{b(e)})):b(""))}),[M,s]),n.useEffect((()=>{try{let t=E;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const n=new v(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();j(`data:image/svg+xml;base64,${n}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[E,e]);const O=L?Ro.get(L):null,{onlyChainId:P}=Q(),_=!p&&!!O&&!P,D=z.jsxs(t.Box,{sx:Object.assign(Object.assign(Object.assign({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:e,height:i,borderRadius:"50%"},h?{}:{border:"solid 1px",borderColor:"border.main"}),{flexShrink:0}),_?{}:Object.assign({marginRight:o,zIndex:a},c)),children:[!g&&z.jsx(t.Box,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:A}),z.jsx(t.Box,{component:"img",src:!(s?y:M)||w?C:s?y:M,onLoad:T,onError:e=>{const t=e.target;E&&C&&k(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]});return _?z.jsxs(t.Box,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",width:e+R,height:i,marginRight:o,zIndex:a},c||{}),children:[D,z.jsx(t.Box,{sx:{position:"absolute",right:0,bottom:-1,width:m,height:m,border:"solid 1px",borderColor:"border.main",borderRadius:"50%",overflow:"hidden"},children:z.jsx(t.Box,{component:O.logo,sx:{display:"block",width:"100%",height:"100%"}})})]}):D}const{isSameAddress:ll}=r.TokenApi.utils;function dl({routing:e,fromTokenRaw:t,toTokenRaw:i,targetTokenAddress:o}){return n.useMemo((()=>ll(t.address,o)?t:ll(i.address,o)?i:null),[t,e.chainId,o,i])}function cl({routing:i,fromTokenRaw:o,toTokenRaw:r}){const{poolDetails:a}=i,s=t.useTheme(),l=dl({fromTokenRaw:o,toTokenRaw:r,routing:i,targetTokenAddress:i.fromToken}),d=dl({fromTokenRaw:o,toTokenRaw:r,routing:i,targetTokenAddress:i.toToken}),c=Array.from(a.keys()),{isMobile:u}=Xa();return z.jsx(t.Box,{sx:{backgroundColor:s.palette.hover.default,borderRadius:8,borderColor:s.palette.border.main,borderWidth:1,borderStyle:"solid",padding:20,display:"flex",flexDirection:"column",gap:20,mx:u?0:4},children:c.map(((o,r)=>{const c=a.get(o);return c?z.jsxs(n.Fragment,{children:[r>0&&z.jsx(t.Box,{sx:{width:"100%",height:"1px",backgroundColor:s.palette.background.paperDarkContrast}}),z.jsxs(t.Box,{sx:{typography:"body2",color:s.palette.text.secondary,textTransform:"capitalize"},children:[z.jsx(e.Trans,{id:"Z5HWHd",message:"On"})," ",o]}),z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12},children:c.map((e=>{var n,o;return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body1",color:s.palette.text.primary,gap:20},children:[z.jsx(t.Tooltip,{title:`${null!==(n=null==l?void 0:l.symbol)&&void 0!==n?n:"-"}/${null!==(o=null==d?void 0:d.symbol)&&void 0!==o?o:"-"}`,children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,color:s.palette.text.secondary,cursor:"default","&:hover":e.poolAddress?{color:s.palette.text.primary,cursor:"pointer"}:void 0},onClick:()=>{e.poolAddress&&window.open(Ia(i.chainId,e.poolAddress),"_blank")},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{width:20,height:20,address:i.fromToken,chainId:i.chainId,sx:{marginRight:-4}}),z.jsx(sl,{width:20,height:20,address:i.toToken,chainId:i.chainId})]}),e.poolAddress&&z.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("g",{children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.33333V12.6667H12.6667V7.99999H14V12.6667C14 13.4 13.4 14 12.6667 14H3.33333C2.59333 14 2 13.4 2 12.6667V3.33333C2 2.6 2.59333 2 3.33333 2H8V3.33333H3.33333ZM9.33333 3.33333V2H14V6.66666H12.6667V4.27333L6.11333 10.8267L5.17333 9.88666L11.7267 3.33333H9.33333Z",fill:"currentColor"})})})]})}),e.poolPart]},e.poolAddress)}))})]},o):null}))})}function ul({sx:e}){const n=t.useTheme();return z.jsx(t.Box,{sx:Object.assign({width:5,height:5,backgroundColor:n.palette.text.primary,borderRadius:"50%",flex:"0 0 auto"},e)})}function pl({sx:e}){const n=t.useTheme();return z.jsx(t.Box,{sx:Object.assign({width:"0",height:"0",borderBottom:"3px solid transparent",borderTop:"3px solid transparent",borderLeft:`5px solid ${n.palette.text.primary}`,flex:"0 0 auto"},e)})}function hl({sx:e}){const n=t.useTheme();return z.jsx(t.Box,{sx:Object.assign({borderTopWidth:1,borderTopStyle:"dashed",borderTopColor:n.palette.text.primary,flexGrow:1,flexShrink:0},e)})}function ml(){const e=t.useTheme();return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,ml:7},children:[z.jsx(ul,{}),z.jsx(t.Box,{sx:{width:"1px",height:"22px",borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:e.palette.text.primary}}),z.jsx(pl,{sx:{transform:"rotate(90deg)"}})]})}function xl({routeData:e,fromTokenRaw:i,toTokenRaw:o,sx:r}){const a=t.useTheme();return z.jsxs(t.Box,{sx:Object.assign({pb:20,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:8,maxHeight:"calc(80vh - 64px - 48px - 24px - 50px - 60px)",overflow:"auto"},r),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{width:20,height:20,address:i.address,chainId:i.chainId}),z.jsx(t.Box,{sx:{typography:"body1",color:a.palette.text.primary,fontWeight:500},children:i.symbol||"-"})]}),z.jsx(ml,{}),e.map(((e,t)=>z.jsxs(n.Fragment,{children:[t>0&&z.jsx(ml,{}),z.jsx(cl,{routing:e,fromTokenRaw:i,toTokenRaw:o})]},e.fromToken))),z.jsx(ml,{}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{width:20,height:20,address:o.address,chainId:o.chainId}),z.jsx(t.Box,{sx:{typography:"body1",color:a.palette.text.primary,fontWeight:500},children:o.symbol||"-"})]})]})}function gl({routeData:e,fromTokenRaw:i,toTokenRaw:o}){const r=t.useTheme();return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{width:20,height:20,address:i.address,chainId:i.chainId}),z.jsx(t.Box,{sx:{typography:"body1",color:r.palette.text.primary,fontWeight:500},children:i.symbol||"-"})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:{typography:"body1",color:r.palette.text.primary,fontWeight:500},children:o.symbol||"-"}),z.jsx(sl,{width:20,height:20,address:o.address,chainId:o.chainId})]})]}),z.jsxs(t.Box,{sx:{mt:5,display:"flex",alignItems:"flex-start",mx:7.5},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[z.jsx(ul,{}),z.jsx(t.Box,{sx:{width:"1px",height:"48px",borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:r.palette.text.primary}})]}),z.jsx(hl,{sx:{mt:52,ml:-2.5,minWidth:59}}),z.jsx(pl,{sx:{mt:49.5}}),z.jsx(t.Box,{sx:{mt:23,maxWidth:761,display:"flex",alignItems:"flex-start",overflow:"auto"},children:e.map(((e,r)=>z.jsxs(n.Fragment,{children:[r>0&&z.jsxs(t.Box,{sx:{mt:26.5,display:"flex",alignItems:"center",width:"24px",flexShrink:0},children:[z.jsx(ul,{}),z.jsx(hl,{}),z.jsx(pl,{})]}),z.jsx(cl,{routing:e,fromTokenRaw:i,toTokenRaw:o})]},e.fromToken)))}),z.jsx(ul,{sx:{mt:51}}),z.jsx(hl,{sx:{mt:53,mr:-2.5,minWidth:59}}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[z.jsx(pl,{sx:{transform:"rotate(-90deg)"}}),z.jsx(t.Box,{sx:{width:"1px",height:"48px",borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:r.palette.text.primary}})]})]})]})}var fl,yl;function vl(){return vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vl.apply(null,arguments)}var bl,Cl;function jl(){return jl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},jl.apply(null,arguments)}var wl,kl;function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Tl.apply(null,arguments)}var Bl,El,Il;function Al(){return Al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Al.apply(null,arguments)}var Sl,Ll;function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ml.apply(null,arguments)}var Rl,Ol,Pl,_l;function Dl(){return Dl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Dl.apply(null,arguments)}var Nl,Fl,Ul;function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ql.apply(null,arguments)}var Vl,Wl,Hl,Zl,zl,$l;function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Gl.apply(null,arguments)}var Ql,Yl;function Xl(){return Xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Xl.apply(null,arguments)}var Kl,Jl;function ed(){return ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ed.apply(null,arguments)}var td,nd;function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},id.apply(null,arguments)}var od;function rd(){return rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},rd.apply(null,arguments)}var ad,sd;function ld(){return ld=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ld.apply(null,arguments)}var dd,cd,ud,pd,hd,md;function xd(){return xd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xd.apply(null,arguments)}var gd,fd;function yd(){return yd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},yd.apply(null,arguments)}var vd,bd,Cd;function jd(){return jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},jd.apply(null,arguments)}var wd,kd;function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Td.apply(null,arguments)}var Bd,Ed;function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Id.apply(null,arguments)}var Ad,Sd,Ld,Md,Rd;function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Od.apply(null,arguments)}const Pd=[{id:"cBridge",logoURI:e=>P.createElement("svg",ql({width:34,height:34,viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Nl||(Nl=P.createElement("rect",{x:1,y:1,width:32,height:32,rx:8,fill:"white",stroke:"#33363F"})),Fl||(Fl=P.createElement("g",{clipPath:"url(#clip0_37_1169)"},P.createElement("path",{d:"M10.9221 22C13.0882 22 14.8442 21.2006 14.8442 20.2144C14.8442 19.2283 13.0882 18.4288 10.9221 18.4288C8.75599 18.4288 7 19.2283 7 20.2144C7 21.2006 8.75599 22 10.9221 22Z",fill:"#444444"}),P.createElement("path",{d:"M23.5587 22C25.7248 22 27.4808 21.2006 27.4808 20.2144C27.4808 19.2283 25.7248 18.4288 23.5587 18.4288C21.3926 18.4288 19.6366 19.2283 19.6366 20.2144C19.6366 21.2006 21.3926 22 23.5587 22Z",fill:"#DDDDDD"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.88456 20.2144C9.84901 20.2146 9.81379 20.2076 9.78098 20.1939C9.74818 20.1802 9.71844 20.1601 9.69353 20.1347C9.66862 20.1094 9.64903 20.0793 9.63593 20.0462C9.62283 20.0132 9.61648 19.9779 9.61725 19.9423C9.7509 15.5317 13.1124 12 17.2394 12C21.3663 12 24.7278 15.5317 24.8615 19.9423C24.8622 19.9779 24.8559 20.0132 24.8428 20.0462C24.8297 20.0793 24.8101 20.1094 24.7852 20.1347C24.7603 20.1601 24.7306 20.1802 24.6977 20.1939C24.6649 20.2076 24.6297 20.2146 24.5942 20.2144H22.0874C22.0152 20.2135 21.946 20.1848 21.8943 20.1344C21.8426 20.0839 21.8123 20.0155 21.8096 19.9433C21.6894 17.1106 19.6894 14.8567 17.2403 14.8567C14.7913 14.8567 12.7913 17.1106 12.6711 19.9433C12.6684 20.0155 12.638 20.0839 12.5863 20.1344C12.5346 20.1848 12.4655 20.2135 12.3932 20.2144H9.88456Z",fill:"#FF957E"}))),Ul||(Ul=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_37_1169"},P.createElement("rect",{width:20.4808,height:10,fill:"white",transform:"translate(7 12)"}))))),name:"cBridge"},{id:"stargate",logoURI:e=>P.createElement("svg",xd({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dd||(dd=P.createElement("path",{d:"M0.5 8C0.5 3.85786 3.85786 0.5 8 0.5H24C28.1421 0.5 31.5 3.85786 31.5 8V24C31.5 28.1421 28.1421 31.5 24 31.5H8C3.85786 31.5 0.5 28.1421 0.5 24V8Z",fill:"black",stroke:"black"})),cd||(cd=P.createElement("path",{d:"M17.5867 8.63649L18.0125 9.63382C18.8482 11.592 20.4079 13.1518 22.3662 13.9875L23.3635 14.4133C23.6245 14.5246 23.8365 14.6842 24 14.8743C23.5033 11.3132 20.6868 8.49629 17.1257 8C17.3154 8.16317 17.4754 8.37546 17.5867 8.63649Z",fill:"#999999"})),ud||(ud=P.createElement("path",{d:"M8.63649 14.4133L9.63382 13.9875C11.592 13.1518 13.1518 11.592 13.9879 9.63382L14.4133 8.63649C14.525 8.37546 14.6846 8.16317 14.8743 8C11.3132 8.49629 8.49667 11.3132 8 14.8743C8.16357 14.6842 8.37548 14.5246 8.63649 14.4133Z",fill:"#999999"})),pd||(pd=P.createElement("path",{d:"M23.3635 17.5863L22.3662 18.0121C20.4079 18.8479 18.8482 20.408 18.0125 22.3662L17.5867 23.3632C17.4754 23.6242 17.3154 23.8365 17.1257 24C20.6868 23.5034 23.5033 20.6865 24 17.1253C23.8365 17.3154 23.6245 17.475 23.3635 17.5863Z",fill:"#999999"})),hd||(hd=P.createElement("path",{d:"M14.4133 23.3632L13.9879 22.3662C13.1518 20.408 11.592 18.8479 9.63382 18.0121L8.63649 17.5863C8.37548 17.475 8.16357 17.3154 8 17.1253C8.49667 20.6865 11.3132 23.5034 14.8743 24C14.6846 23.8365 14.525 23.6242 14.4133 23.3632Z",fill:"#999999"})),md||(md=P.createElement("path",{d:"M12.3715 15.2177L12.863 15.0078C13.8278 14.5959 14.5966 13.8275 15.0086 12.8626L15.2181 12.3711C15.512 11.6827 16.4879 11.6827 16.7818 12.3711L16.9913 12.8626C17.4032 13.8275 18.172 14.5959 19.1369 15.0078L19.6284 15.2177C20.3168 15.5116 20.3168 16.4872 19.6284 16.7811L19.1369 16.991C18.172 17.4029 17.4032 18.1713 16.9913 19.1366L16.7818 19.6276C16.4879 20.3161 15.512 20.3161 15.2181 19.6276L15.0086 19.1366C14.5966 18.1713 13.8278 17.4029 12.863 16.991L12.3715 16.7811C11.6831 16.4872 11.6831 15.5116 12.3715 15.2177Z",fill:"#F2F2F2"}))),name:"Stargate"},{id:"connext",logoURI:e=>P.createElement("svg",Gl({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Vl||(Vl=P.createElement("rect",{width:32,height:32,rx:8,fill:"black"})),Wl||(Wl=P.createElement("path",{d:"M13.0566 9.12524C13.0566 9.12524 12.31 9.87191 11.4353 10.7466L7.90996 14.2399C6.46996 15.7066 7.0353 17.1999 8.03796 18.2026L10.918 21.0826C11.174 21.3386 12.1766 22.3946 12.9766 21.5732C13.4406 21.1092 13.3393 20.3892 13.078 20.1066L9.76063 16.8159C9.16863 16.2239 9.4513 15.6852 10.0433 15.1199L12.8753 12.2879L14.6513 14.0639C15.27 14.6826 16.038 14.9119 16.6833 14.2719C17.3286 13.6266 16.9393 13.0132 16.3206 12.3946L14.3633 10.4372L13.0566 9.12524Z",fill:"url(#paint0_linear_5431_181414)"})),Hl||(Hl=P.createElement("path",{d:"M13.2112 9.25332C12.7472 8.78932 12.0805 8.53332 11.4352 9.17865C10.7898 9.82399 11.1258 10.544 11.5365 10.9547",fill:"url(#paint1_linear_5431_181414)"})),Zl||(Zl=P.createElement("path",{d:"M18.9218 22.8638C18.9218 22.8638 19.6685 22.1171 20.5432 21.2424L24.0685 17.7171C25.5352 16.2504 24.9698 14.7571 23.9405 13.7544L21.0605 10.9011C20.8045 10.6451 19.8018 9.5891 19.0018 10.4104C18.5378 10.8744 18.6392 11.5944 18.9005 11.8771L22.2178 15.1678C22.8098 15.7598 22.5272 16.2984 21.9352 16.8638L19.1032 19.6958L17.3272 17.9198C16.7085 17.3011 15.9405 17.0718 15.2952 17.7118C14.6498 18.3518 15.0392 18.9704 15.6578 19.5891L17.6152 21.5464L18.9218 22.8638Z",fill:"url(#paint2_linear_5431_181414)"})),zl||(zl=P.createElement("path",{d:"M18.7671 22.7306C19.2311 23.1946 19.8978 23.4772 20.5431 22.8319C21.1884 22.1866 20.8524 21.4666 20.4418 21.0559",fill:"url(#paint3_linear_5431_181414)"})),$l||($l=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5431_181414",x1:7.86029,y1:12.5047,x2:23.8117,y2:22.7959,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#29C1FC"}),P.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),P.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),P.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),P.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),P.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),P.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),P.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),P.createElement("linearGradient",{id:"paint1_linear_5431_181414",x1:10.2949,y1:8.73084,x2:26.2463,y2:19.0221,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#29C1FC"}),P.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),P.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),P.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),P.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),P.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),P.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),P.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),P.createElement("linearGradient",{id:"paint2_linear_5431_181414",x1:9.46092,y1:10.0213,x2:25.4123,y2:20.3125,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#29C1FC"}),P.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),P.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),P.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),P.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),P.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),P.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),P.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),P.createElement("linearGradient",{id:"paint3_linear_5431_181414",x1:7.01942,y1:13.8057,x2:22.9708,y2:24.0969,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#29C1FC"}),P.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),P.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),P.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),P.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),P.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),P.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),P.createElement("stop",{offset:.9956,stopColor:"#FBB03B"}))))),name:"Connext"},{id:"synapse",logoURI:e=>P.createElement("svg",jd({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),P.createElement("mask",{id:"mask0_419_48383",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:32,height:32},vd||(vd=P.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",fill:"black"}))),bd||(bd=P.createElement("g",{mask:"url(#mask0_419_48383)"},P.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H24C28.4183 0 32 3.58172 32 8V24C32 28.4183 28.4183 32 24 32H8C3.58172 32 0 28.4183 0 24V8Z",fill:"#121826"}),P.createElement("path",{d:"M15.9794 7C15.5251 7 15.1568 7.36058 15.1568 7.80538C15.1568 8.25017 15.5251 8.61075 15.9794 8.61075C16.4337 8.61075 16.802 8.25017 16.802 7.80538C16.802 7.36058 16.4337 7 15.9794 7Z",fill:"url(#paint0_radial_419_48383)"}),P.createElement("path",{d:"M15.9794 7.44297C16.1839 7.44297 16.3496 7.60522 16.3496 7.80537C16.3496 8.00551 16.1839 8.16776 15.9794 8.16776C15.775 8.16776 15.6093 8.00551 15.6093 7.80537C15.6093 7.60522 15.775 7.44293 15.9794 7.44293V7.44297ZM12.4422 9.13423C11.9879 9.13423 11.6196 9.49481 11.6196 9.93961C11.6196 10.3844 11.9878 10.7449 12.4422 10.7449C12.8965 10.7449 13.2648 10.3844 13.2648 9.93961C13.2648 9.49481 12.8965 9.13423 12.4422 9.13423ZM19.599 9.17448C19.1446 9.17448 18.7764 9.53506 18.7764 9.97986C18.7764 10.4247 19.1446 10.7852 19.599 10.7852C20.0533 10.7852 20.4216 10.4247 20.4216 9.97986C20.4216 9.53506 20.0533 9.17448 19.599 9.17448V9.17448Z",fill:"url(#paint1_radial_419_48383)"}),P.createElement("path",{d:"M12.4422 9.57715C12.6466 9.57715 12.8124 9.7394 12.8124 9.93958C12.8124 10.1397 12.6466 10.302 12.4422 10.302C12.2377 10.302 12.072 10.1397 12.072 9.93958C12.072 9.7394 12.2377 9.57715 12.4422 9.57715ZM19.599 9.6174C19.8034 9.6174 19.9691 9.77965 19.9691 9.97984C19.9691 10.18 19.8034 10.3422 19.599 10.3422C19.3945 10.3422 19.2288 10.18 19.2288 9.97984C19.2288 9.77969 19.3945 9.6174 19.599 9.6174V9.6174ZM15.9794 10.9866C15.457 10.9866 15.0334 11.4012 15.0334 11.9127C15.0334 12.4242 15.457 12.8389 15.9794 12.8389C16.5019 12.8389 16.9255 12.4242 16.9255 11.9127C16.9255 11.4012 16.5019 10.9866 15.9794 10.9866ZM8.8226 11.1074C8.3683 11.1074 8 11.4679 8 11.9127C8 12.3575 8.3683 12.7181 8.8226 12.7181C9.27695 12.7181 9.64525 12.3575 9.64525 11.9127C9.64525 11.4679 9.27695 11.1074 8.8226 11.1074ZM23.1774 11.1074C22.723 11.1074 22.3548 11.4679 22.3548 11.9127C22.3548 12.3575 22.723 12.7181 23.1774 12.7181C23.6317 12.7181 24 12.3575 24 11.9127C24 11.4679 23.6317 11.1074 23.1774 11.1074V11.1074Z",fill:"url(#paint2_radial_419_48383)"}),P.createElement("path",{d:"M15.9794 11.4295C16.252 11.4295 16.473 11.6458 16.473 11.9127C16.473 12.1796 16.252 12.3959 15.9794 12.3959C15.7068 12.3959 15.4859 12.1796 15.4859 11.9127C15.4859 11.6458 15.7068 11.4295 15.9794 11.4295V11.4295ZM8.82261 11.5503C9.02706 11.5503 9.19281 11.7126 9.19281 11.9127C9.19281 12.1129 9.02706 12.2751 8.82261 12.2751C8.61817 12.2751 8.45245 12.1129 8.45245 11.9127C8.45245 11.7126 8.61817 11.5503 8.82261 11.5503V11.5503ZM23.1774 11.5503C23.3818 11.5503 23.5476 11.7126 23.5476 11.9127C23.5476 12.1129 23.3818 12.2751 23.1774 12.2751C22.973 12.2751 22.8072 12.1129 22.8072 11.9127C22.8072 11.7126 22.973 11.5503 23.1774 11.5503ZM12.3188 13C11.7963 13 11.3727 13.4146 11.3727 13.9261C11.3727 14.4377 11.7963 14.8523 12.3188 14.8523C12.8412 14.8523 13.2648 14.4377 13.2648 13.9261C13.2648 13.4146 12.8412 13 12.3188 13ZM19.599 13C19.0765 13 18.653 13.4146 18.653 13.9261C18.653 14.4377 19.0765 14.8523 19.599 14.8523C20.1214 14.8523 20.545 14.4377 20.545 13.9261C20.545 13.4146 20.1214 13 19.599 13Z",fill:"url(#paint3_radial_419_48383)"}),P.createElement("path",{d:"M12.3187 13.443C12.5913 13.443 12.8123 13.6593 12.8123 13.9262C12.8123 14.1931 12.5913 14.4094 12.3187 14.4094C12.0461 14.4094 11.8252 14.1931 11.8252 13.9262C11.8252 13.6593 12.0461 13.443 12.3187 13.443ZM19.599 13.443C19.8715 13.443 20.0925 13.6593 20.0925 13.9262C20.0925 14.1931 19.8715 14.4094 19.599 14.4094C19.3264 14.4094 19.1054 14.1931 19.1054 13.9262C19.1054 13.6593 19.3264 13.443 19.599 13.443Z",fill:"url(#paint4_radial_419_48383)"}),P.createElement("path",{d:"M8.8226 15.1745C8.3683 15.1745 8 15.5351 8 15.9799C8 16.4247 8.3683 16.7853 8.8226 16.7853C9.27695 16.7853 9.64525 16.4247 9.64525 15.9799C9.64525 15.5351 9.27695 15.1745 8.8226 15.1745ZM23.1774 15.1745C22.723 15.1745 22.3548 15.5351 22.3548 15.9799C22.3548 16.4247 22.723 16.7853 23.1774 16.7853C23.6317 16.7853 24 16.4247 24 15.9799C24 15.5351 23.6317 15.1745 23.1774 15.1745ZM16.0206 15.2953C16.4067 15.2953 16.7198 15.6018 16.7198 15.9799C16.7198 16.358 16.4067 16.6645 16.0206 16.6645C15.6344 16.6645 15.3214 16.358 15.3214 15.9799C15.3214 15.6018 15.6344 15.2953 16.0206 15.2953Z",fill:"url(#paint5_radial_419_48383)"}),P.createElement("path",{d:"M8.82261 15.6174C9.02706 15.6174 9.19281 15.7797 9.19281 15.9798C9.19281 16.18 9.02706 16.3423 8.82261 16.3423C8.61817 16.3423 8.45245 16.18 8.45245 15.9798C8.45245 15.7797 8.61817 15.6174 8.82261 15.6174V15.6174ZM23.1774 15.6174C23.3818 15.6174 23.5476 15.7797 23.5476 15.9798C23.5476 16.18 23.3818 16.3423 23.1774 16.3423C22.973 16.3423 22.8072 16.18 22.8072 15.9798C22.8072 15.7797 22.973 15.6174 23.1774 15.6174ZM12.4422 17.0671C11.9197 17.0671 11.4961 17.4818 11.4961 17.9933C11.4961 18.5048 11.9197 18.9194 12.4422 18.9194C12.9646 18.9194 13.3882 18.5048 13.3882 17.9933C13.3882 17.4818 12.9646 17.0671 12.4422 17.0671V17.0671ZM19.599 17.0671C19.0765 17.0671 18.653 17.4818 18.653 17.9933C18.653 18.5048 19.0765 18.9194 19.599 18.9194C20.1214 18.9194 20.545 18.5048 20.545 17.9933C20.545 17.4818 20.1214 17.0671 19.599 17.0671V17.0671Z",fill:"url(#paint6_radial_419_48383)"}),P.createElement("path",{d:"M12.4422 17.5101C12.7148 17.5101 12.9357 17.7264 12.9357 17.9933C12.9357 18.2602 12.7148 18.4765 12.4422 18.4765C12.1696 18.4765 11.9486 18.2602 11.9486 17.9933C11.9486 17.7264 12.1696 17.5101 12.4422 17.5101V17.5101ZM19.599 17.5101C19.8716 17.5101 20.0925 17.7264 20.0925 17.9933C20.0925 18.2602 19.8716 18.4765 19.599 18.4765C19.3264 18.4765 19.1054 18.2602 19.1054 17.9933C19.1054 17.7264 19.3264 17.5101 19.599 17.5101V17.5101ZM15.9794 19.0805C15.457 19.0805 15.0334 19.4952 15.0334 20.0067C15.0334 20.5182 15.457 20.9329 15.9794 20.9329C16.5019 20.9329 16.9255 20.5182 16.9255 20.0067C16.9255 19.4952 16.5019 19.0805 15.9794 19.0805ZM8.8226 19.2416C8.3683 19.2416 8 19.6022 8 20.047C8 20.4918 8.3683 20.8524 8.8226 20.8524C9.27695 20.8524 9.64525 20.4918 9.64525 20.047C9.64525 19.6022 9.27695 19.2416 8.8226 19.2416ZM23.1774 19.2416C22.723 19.2416 22.3548 19.6022 22.3548 20.047C22.3548 20.4918 22.723 20.8524 23.1774 20.8524C23.6317 20.8524 24 20.4918 24 20.047C24 19.6022 23.6317 19.2416 23.1774 19.2416Z",fill:"url(#paint7_radial_419_48383)"}),P.createElement("path",{d:"M15.9794 19.5235C16.252 19.5235 16.473 19.7398 16.473 20.0067C16.473 20.2736 16.252 20.4899 15.9794 20.4899C15.7068 20.4899 15.4859 20.2736 15.4859 20.0067C15.4859 19.7398 15.7068 19.5235 15.9794 19.5235ZM8.82261 19.6845C9.02706 19.6845 9.19281 19.8468 9.19281 20.047C9.19281 20.2471 9.02706 20.4094 8.82261 20.4094C8.61817 20.4094 8.45245 20.2471 8.45245 20.047C8.45245 19.8468 8.61817 19.6845 8.82261 19.6845V19.6845ZM23.1774 19.6845C23.3818 19.6845 23.5476 19.8468 23.5476 20.047C23.5476 20.2471 23.3818 20.4094 23.1774 20.4094C22.973 20.4094 22.8072 20.2471 22.8072 20.047C22.8072 19.8468 22.973 19.6845 23.1774 19.6845ZM12.4422 21.255C11.9879 21.255 11.6196 21.6156 11.6196 22.0604C11.6196 22.5052 11.9878 22.8658 12.4422 22.8658C12.8965 22.8658 13.2648 22.5052 13.2648 22.0604C13.2648 21.6156 12.8965 21.255 12.4422 21.255ZM19.599 21.2953C19.1446 21.2953 18.7763 21.6559 18.7763 22.1007C18.7763 22.5455 19.1446 22.9061 19.599 22.9061C20.0533 22.9061 20.4216 22.5455 20.4216 22.1007C20.4216 21.6559 20.0533 21.2953 19.599 21.2953Z",fill:"url(#paint8_radial_419_48383)"}),P.createElement("path",{d:"M12.4422 21.698C12.6466 21.698 12.8124 21.8602 12.8124 22.0604C12.8124 22.2606 12.6466 22.4228 12.4422 22.4228C12.2377 22.4228 12.072 22.2606 12.072 22.0604C12.072 21.8602 12.2377 21.698 12.4422 21.698ZM19.599 21.7383C19.8035 21.7383 19.9692 21.9005 19.9692 22.1007C19.9692 22.3008 19.8035 22.4631 19.599 22.4631C19.3946 22.4631 19.2288 22.3008 19.2288 22.1007C19.2288 21.9005 19.3946 21.7383 19.599 21.7383ZM15.9795 23.3893C15.5251 23.3893 15.1568 23.7498 15.1568 24.1946C15.1568 24.6394 15.5251 25 15.9795 25C16.4338 25 16.8021 24.6394 16.8021 24.1946C16.8021 23.7498 16.4338 23.3893 15.9795 23.3893V23.3893Z",fill:"url(#paint9_radial_419_48383)"}),P.createElement("path",{d:"M15.9794 23.8322C16.1838 23.8322 16.3496 23.9945 16.3496 24.1946C16.3496 24.3948 16.1838 24.5571 15.9794 24.5571C15.775 24.5571 15.6092 24.3948 15.6092 24.1946C15.6092 23.9945 15.775 23.8322 15.9794 23.8322ZM19.2699 13.7972L16.3496 15.5288L16.5848 15.9075L19.5051 14.176L19.2699 13.7972V13.7972ZM12.6761 13.7576L12.4331 14.1313L15.3945 15.9837L15.6375 15.6099L12.6761 13.7576V13.7576ZM11.8843 13.9551L9.16962 15.6061L9.40873 15.9824L12.1234 14.3314L11.8843 13.9551ZM22.9113 15.8855L19.9909 17.617L20.2262 17.9958L23.1465 16.2643L22.9113 15.8855ZM15.5077 16.0466L12.5874 17.7781L12.8226 18.1569L15.7429 16.4254L15.5077 16.0466V16.0466ZM16.5437 15.9944L16.3007 16.3681L19.2622 18.2205L19.5051 17.8467L16.5437 15.9944V15.9944Z",fill:"url(#paint10_radial_419_48383)"}),P.createElement("path",{d:"M20.0758 13.8205L19.8328 14.1942L22.7943 16.0466L23.0373 15.6728L20.0758 13.8205ZM9.16191 15.9308L8.91895 16.3045L11.8804 18.1569L12.1234 17.7832L9.16191 15.9308V15.9308Z",fill:"url(#paint11_radial_419_48383)"}))),Cd||(Cd=P.createElement("defs",null,P.createElement("radialGradient",{id:"paint0_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint1_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint2_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint3_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint4_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint5_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint6_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint7_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint8_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint9_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint10_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"})),P.createElement("radialGradient",{id:"paint11_radial_419_48383",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(15.9999 16.0001) scale(7.99998 7.83228)"},P.createElement("stop",{stopColor:"#FF00FF"}),P.createElement("stop",{offset:1,stopColor:"#734CE2"}))))),name:"Synapse"},{id:"swft",logoURI:e=>P.createElement("svg",Dl({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Rl||(Rl=P.createElement("path",{d:"M14.0802 2.71222C14.0802 2.71222 12.9826 1.61464 11.6884 1.51537C10.3941 1.4161 9.89405 1.81505 9.99332 2.214C10.0926 2.61295 10.5421 2.66165 11.1396 2.2627C11.7371 1.86375 13.0332 1.96489 14.0802 2.71222Z",fill:"#0999FF"})),Ol||(Ol=P.createElement("path",{d:"M13.5408 2.87517C13.5408 2.87517 12.668 2.33013 11.8176 2.45936C10.9673 2.5886 10.6938 2.92012 10.8268 3.16174C10.9598 3.40336 11.2482 3.36964 11.576 3.02314C11.9038 2.67663 12.7523 2.54927 13.5408 2.87517Z",fill:"#0999FF"})),Pl||(Pl=P.createElement("path",{d:"M12.2597 2.99879C12.6341 2.88498 13.0346 2.89022 13.4059 3.01377C12.8628 2.91825 12.3439 3.13364 12.1866 3.39399C12.0293 3.65434 11.8476 3.71615 11.7352 3.58129C11.6228 3.44644 11.7408 3.1992 12.2597 2.99879Z",fill:"#0999FF"})),_l||(_l=P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.7592 6.10048C17.8075 5.65096 17.1089 5.82703 16.1218 6.25033C15.425 6.5575 15.6236 7.84238 16.0225 8.93996C16.4215 10.0375 17.2194 13.8248 15.425 15.8176C13.9914 17.4099 12.8137 17.6032 10.5679 17.972C10.0027 18.0648 9.36998 18.1687 8.6485 18.3087C5.05982 19.0055 4.86128 21.697 4.86128 21.697C3.17126 12.5314 7.83234 10.1212 10.1284 8.93399C10.4049 8.79097 10.6472 8.6657 10.8399 8.5485C11.9352 7.87375 12.0384 6.61486 12.0958 5.91511C12.1082 5.7641 12.1184 5.63913 12.136 5.55169C12.1467 5.49883 12.1573 5.4355 12.1694 5.36375C12.2698 4.76704 12.4681 3.58853 13.5783 3.01003C16.9703 1.41797 19.7592 6.10048 19.7592 6.10048ZM10.8009 15.8525C11.5854 15.8693 12.9238 15.898 13.6045 14.5964C14.3724 13.1261 13.5221 11.8075 12.3084 11.3917C11.0946 10.9759 9.25161 11.5509 8.04352 13.2366C6.83543 14.9223 6.68934 16.9826 6.68934 16.9826C6.7545 16.9197 6.81451 16.8522 6.87696 16.782C7.13404 16.4929 7.4325 16.1574 8.302 15.8982C8.96656 15.7001 9.67011 15.7718 10.1431 15.82C10.3006 15.836 10.4326 15.8495 10.529 15.8495C10.6088 15.8484 10.7003 15.8504 10.8009 15.8525ZM18.5642 5.503C18.5642 5.503 16.62 5.24639 15.8727 5.9956C15.8727 5.9956 16.472 4.30989 18.5642 5.503Z",fill:"#0999FF"}))),name:"Swft"},{id:"hyphen",logoURI:e=>P.createElement("svg",Tl({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),wl||(wl=P.createElement("path",{d:"M10.2675 16.7858V15.0715C10.2675 14.5915 10.6618 14.2143 11.1247 14.2143H12.839C13.319 14.2143 13.6961 14.5915 13.6961 15.0715V20.2143C13.6961 20.6943 13.319 21.0715 12.839 21.0715H4.26755C3.78755 21.0715 3.4104 20.6943 3.4104 20.2143V8.21433C3.4104 7.73433 3.03326 7.35719 2.55326 7.35719H2.05612C1.30183 7.35719 0.907546 6.43148 1.45612 5.90005L4.52469 2.81433C4.60378 2.73295 4.69838 2.66825 4.80291 2.62407C4.90745 2.57989 5.01978 2.55713 5.13326 2.55713C5.24674 2.55713 5.35908 2.57989 5.46361 2.62407C5.56814 2.66825 5.66275 2.73295 5.74183 2.81433L8.79326 5.90005C9.34183 6.43148 8.96469 7.35719 8.19326 7.35719H7.69612C7.21612 7.35719 6.83897 7.73433 6.83897 8.21433V16.7858C6.83897 17.2658 7.21612 17.6429 7.69612 17.6429H9.4104C9.8904 17.6429 10.2675 17.2658 10.2675 16.7858Z",fill:"#615CCD"})),kl||(kl=P.createElement("path",{d:"M20.5533 16.7858C20.5533 17.2658 20.9304 17.6429 21.4104 17.6429H21.9247C22.679 17.6429 23.0561 18.5686 22.5247 19.1001L19.4561 22.1686C19.1133 22.5115 18.5818 22.5115 18.239 22.1686L15.1704 19.1001C14.6218 18.5686 14.999 17.6429 15.7704 17.6429H16.2676C16.7476 17.6429 17.1247 17.2658 17.1247 16.7858V8.21436C17.1247 7.73436 16.7476 7.35721 16.2676 7.35721H14.5533C14.0733 7.35721 13.6961 7.73436 13.6961 8.21436V9.92864C13.6961 10.4086 13.319 10.7858 12.839 10.7858H11.1247C10.6447 10.7858 10.2676 10.4086 10.2676 9.92864V4.78578C10.2676 4.30578 10.6447 3.92864 11.1247 3.92864H19.6961C20.1761 3.92864 20.5533 4.30578 20.5533 4.78578V16.7858Z",fill:"#615CCD"}))),name:"Hyphen"},{id:"lifi",logoURI:e=>P.createElement("svg",Al({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Bl||(Bl=P.createElement("rect",{y:.5,width:24,height:24,rx:4,fill:"white"})),El||(El=P.createElement("rect",{x:7.5,y:6.5,width:8.72727,height:12,fill:"url(#pattern0)"})),Il||(Il=P.createElement("defs",null,P.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},P.createElement("use",{xlinkHref:"#image0_1105_25179",transform:"translate(-0.958333 -0.393939) scale(0.0208333 0.0151515)"})),P.createElement("image",{id:"image0_1105_25179",width:252,height:124,xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAAB8CAYAAABNG92/AAAMbGlDQ1BJQ0MgUHJvZmlsZQAASImVlwdcU0kTwPeVJCQkBAhEQEroTRDpRUoILYKAVMFGSAIJJcaEIGJHj1Pw7CKKFT0V8dDTE5BDRezlUOz9sKCinId6KIrKtymg533l901++94/s7Mzs/P2lQWA3seTSvNQXQDyJQWyhMhQ1vi0dBbpCSACBP7owIPHl0vZ8fExAMrg+e/y9jq0hHLFRenrn/3/VfQFQjkfAGQi5EyBnJ8PuQUAfANfKisAgKjUW08vkCp5HmQDGUwQ8molZ6t5l5Iz1dyssklK4EC+BIAWlceTZQOgcxfqWYX8bOhH5yNkN4lALAGAPgJyEF/EE0BW5j4iP3+qkishO0B7KWSYD/DN/Mpn9t/8Zw755/Gyh1g9L5VohYnl0jzejP+zNP9b8vMUgzHsYKOKZFEJyvnDGt7MnRqtZCrkbklmbJyy1pD7xAJ13QFAKSJFVLLaHjXlyzmwfoAJ2U3AC4uGbAo5QpIXG6PRZ2aJI7iQ4WpBi8QF3CTIRpAXCeXhiRqbLbKpCZpYaH2WjMPW6M/wZKq4ylj3FbnJbI3/1yIhV+Mf0ykWJaVCpkC2KRSnxELWgewqz02M1tiMLhZxYgdtZIoEZf42kBOEkshQtX+sMEsWkaCxL8uXD84X2yISc2M1vL9AlBSlrg92gs9T5Q/ngl0SStjJg36E8vExg3MRCMPC1XPHngklyYkaP33SgtAE9VicIs2L19jjVsK8SKXeCrKnvDBRMxZPKYCLU+0fz5IWxCep88SLc3hj4tX54MtBDOCAMMACCtgywVSQA8Rt3Q3d8J+6JwLwgAxkAyFw0WgGR6SqeiTwmAiKwR+QhEA+NC5U1SsEhVD/aUirPrqALFVvoWpELngCOR9Egzz4X6EaJRmKlgIeQ434H9F5sPFhvnmwKfv/vX5Q+0XDhpoYjUYxGJFFH7QkhhPDiFHECKIjboIH4QF4DDyGwOaO++J+g/P4Yk94QmgnPCRcI3QQbk0Rl8i+yXIs6ID+IzS1yPy6Frgd9OmFh+KB0Dv0jDNxE+CCe8I4bDwYRvaCWo4mb2VVWN/4/tsMvroaGjuyGxklDyOHkB2+HanjpOM15EVZ66/ro841c6jenKGeb+Nzvqq+AJ6jv7XEFmEHsNPYMews1ow1ABZ2FGvELmCHlTy0uh6rVtdgtARVPrnQj/gf8QavrLKScrdaty63j+q+AmFRgfLG40yVzpCJs0UFLDZ8OwhZXAnfdQTL3c3dHQDlu0b9+HrDVL1DEOa5L7oSOgCj3w8MDDR/0cXYAvBLKbz9n3zROVTDx8R8AM6U8xWyQrUOVx4I8ClBh3eaMTAH1sABzscdeIMAEALCwRgQB5JAGpgMsxfBdS4D08EsMB+UgnKwHKwB68FmsA3sAj+B/aABNINj4BQ4Dy6Ba+AOXD2d4AXoAW9BP4IgJISGMBBjxAKxRZwRd8QXCULCkRgkAUlDMpBsRIIokFnIAqQcWYmsR7YiNcjPyCHkGHIWaUduIQ+QLuQ18gHFUCpqgJqhduhI1Bdlo9FoEjoJzUanocXoQnQpWolWo3vQevQYeh69hnagL9BeDGDaGBOzxFwwX4yDxWHpWBYmw+ZgZVgFVo3VYU3wOl/BOrBu7D1OxBk4C3eBKzgKT8b5+DR8Dr4EX4/vwuvxE/gV/AHeg38m0AimBGeCP4FLGE/IJkwnlBIqCDsIBwkn4b3USXhLJBKZRHuiD7wX04g5xJnEJcSNxL3EFmI78RGxl0QiGZOcSYGkOBKPVEAqJa0j7SEdJV0mdZL6tLS1LLTctSK00rUkWiVaFVq7tY5oXdZ6qtVP1iXbkv3JcWQBeQZ5GXk7uYl8kdxJ7qfoUewpgZQkSg5lPqWSUkc5SblLeaOtrW2l7ac9TlusPU+7Unuf9hntB9rvqfpUJyqHOpGqoC6l7qS2UG9R39BoNDtaCC2dVkBbSquhHafdp/XpMHRcdbg6Ap25OlU69TqXdV7SyXRbOps+mV5Mr6AfoF+kd+uSde10Obo83Tm6VbqHdG/o9uox9Ebpxenl6y3R2613Vu+ZPknfTj9cX6C/UH+b/nH9RwyMYc3gMPiMBYztjJOMTgOigb0B1yDHoNzgJ4M2gx5DfUNPwxTDIsMqw8OGHUyMacfkMvOYy5j7mdeZH4aZDWMPEw5bPKxu2OVh74yGG4UYCY3KjPYaXTP6YMwyDjfONV5h3GB8zwQ3cTIZZzLdZJPJSZPu4QbDA4bzh5cN3z/8tilq6mSaYDrTdJvpBdNeM3OzSDOp2Tqz42bd5kzzEPMc89XmR8y7LBgWQRZii9UWRy2eswxZbFYeq5J1gtVjaWoZZamw3GrZZtlvZW+VbFVitdfqnjXF2tc6y3q1dat1j42FzVibWTa1Nrdtyba+tiLbtbanbd/Z2dul2n1v12D3zN7InmtfbF9rf9eB5hDsMM2h2uGqI9HR1zHXcaPjJSfUyctJ5FTldNEZdfZ2FjtvdG4fQRjhN0IyonrEDReqC9ul0KXW5YEr0zXGtcS1wfXlSJuR6SNXjDw98rObl1ue23a3O6P0R40ZVTKqadRrdyd3vnuV+1UPmkeEx1yPRo9Xns6eQs9Nnje9GF5jvb73avX65O3jLfOu8+7ysfHJ8Nngc8PXwDfed4nvGT+CX6jfXL9mv/f+3v4F/vv9/wxwCcgN2B3wbLT9aOHo7aMfBVoF8gK3BnYEsYIygrYEdQRbBvOCq4MfhliHCEJ2hDxlO7Jz2HvYL0PdQmWhB0Pfcfw5szktYVhYZFhZWFu4fnhy+Prw+xFWEdkRtRE9kV6RMyNboghR0VErom5wzbh8bg23Z4zPmNljTkRToxOj10c/jHGKkcU0jUXHjhm7auzdWNtYSWxDHIjjxq2KuxdvHz8t/tdxxHHx46rGPUkYlTAr4XQiI3FK4u7Et0mhScuS7iQ7JCuSW1PoKRNTalLepYalrkztGD9y/Ozx59NM0sRpjemk9JT0Hem9E8InrJnQOdFrYunE65PsJxVNOjvZZHLe5MNT6FN4Uw5kEDJSM3ZnfOTF8ap5vZnczA2ZPXwOfy3/hSBEsFrQJQwUrhQ+zQrMWpn1LDswe1V2lyhYVCHqFnPE68WvcqJyNue8y43L3Zk7kJeatzdfKz8j/5BEX5IrOTHVfGrR1Haps7RU2jHNf9qaaT2yaNkOOSKfJG8sMIAf9RcUDorvFA8KgwqrCvump0w/UKRXJCm6MMNpxuIZT4sjin+cic/kz2ydZTlr/qwHs9mzt85B5mTOaZ1rPXfh3M55kfN2zafMz53/W4lbycqSvxakLmhaaLZw3sJH30V+V1uqUyorvfF9wPebF+GLxIvaFnssXrf4c5mg7Fy5W3lF+ccl/CXnfhj1Q+UPA0uzlrYt8162aTlxuWT59RXBK3at1FtZvPLRqrGr6lezVpet/mvNlDVnKzwrNq+lrFWs7aiMqWxcZ7Nu+bqP60Xrr1WFVu3dYLph8YZ3GwUbL28K2VS32Wxz+eYPW8Rbbm6N3FpfbVddsY24rXDbk+0p20//6PtjzQ6THeU7Pu2U7OzYlbDrRI1PTc1u093LatFaRW3Xnol7Lv0U9lNjnUvd1r3MveX7wD7Fvuc/Z/x8fX/0/tYDvgfqfrH9ZcNBxsGyeqR+Rn1Pg6ihozGtsf3QmEOtTQFNB391/XVns2Vz1WHDw8uOUI4sPDJwtPhob4u0pftY9rFHrVNa7xwff/zqiXEn2k5GnzxzKuLU8dPs00fPBJ5pPut/9tA533MN573P11/wunDwN6/fDrZ5t9Vf9LnYeMnvUlP76PYjl4MvH7sSduXUVe7V89dir7VfT75+88bEGx03BTef3cq79ep24e3+O/PuEu6W3dO9V3Hf9H71746/7+3w7jj8IOzBhYeJD+884j968Vj++GPnwie0JxVPLZ7WPHN/1twV0XXp+YTnnS+kL/q7S//Q+2PDS4eXv/wZ8ueFnvE9na9krwZeL3lj/GbnX55/tfbG995/m/+2/11Zn3Hfrve+709/SP3wtH/6R9LHyk+On5o+R3++O5A/MCDlyXiqTwEMNjQrC4DXOwGgpQHAgPs2ygT1XlAliHr/qiLwn1i9X1SJNwB18KT8jOe0ALAPNnvItHkAKD/hk0IA6uEx1DQiz/JwV/uiwp0QoW9g4I0ZAKQmAD7JBgb6Nw4MfNoOk70FQMs09R5UKUS4Z9jiqaTLzKJ54BtR70+/muO3Z6DMQDX8b+d/AU/6jzXPsPu0AAAAbGVYSWZNTQAqAAAACAAEARoABQAAAAEAAAA+ARsABQAAAAEAAABGASgAAwAAAAEAAgAAh2kABAAAAAEAAABOAAAAAAAAAJAAAAABAAAAkAAAAAEAAqACAAQAAAABAAAA/KADAAQAAAABAAAAfAAAAABezPYPAAAACXBIWXMAABYlAAAWJQFJUiTwAAAH8UlEQVR4Ae2d0U3cQBRFTYT4hQ7gi19IBUkqIFQQ6AAaIKQCoAPSQVJBkg6ggkAH8IOEhJRwEZOMVsZrrz3GM/eMZO2ud3bsd967+7zjmdmlP4+lokAAAhYE3lhYiZEQgMATAQRPIEDAiACCN3I2pkIAwRMDEDAigOCNnI2pEEDwxAAEjAggeCNnYyoEEDwxAAEjAgjeyNmYCgEETwxAwIgAgjdyNqZCAMETAxAwIoDgjZyNqRBA8MQABIwIIHgjZ2MqBBA8MQABIwII3sjZmAoBBE8MQMCIAII3cjamQgDBEwMQMCKA4I2cjakQQPDEAASMCCB4I2djKgQQPDEAASMCCN7I2ZgKAQSfMAaurq6qr1+/Vvv7+9Xbt2+rpaWl6vz8POERaRoCzQSW+KupZkBd3r24uKguLy+rnz9/Pm0S/GzZ2Niofv/+Pbub1xAYhQCC74FZAv/169c/gd/c3LRqjb/za4WJSgkILCdos9gmY3FL7G0FXiwQDMuOAIJvcFkscF2mUyCQOwEE/+xBZetY4MrgFAiURsBW8OpQk8AlbGVvBF5aaGNPHQEbwQeBS9za6nrQ6wCxDwIlESha8LoH/u3btyeB08FWUthiy6IEihW8BrhowAsFAhD4T6DYkXZra2v/reQZBCDwRKDogTca1XZ9fT05VzPwZnIusTmhYjO8PHh8fGzjSAyFQBsCRWd4AZhilifDtwlN6qQgUHSGF7C9vb0U3BZuc3V1deHP8kEI9CVQvOAPDg6qKYlsal9AfQOIz+dFoHjBq7deon/N8u7du+rz58/Vjx8/qtPT06Snojn3L20acDR02dzcfPF4R0dHgxxOfTEv2TTE/rq+Ho3haGp7EMNeoZFi78PHLCV4Ce329jbeneS5ribev39fbW9vPz3qOQUCUyFgIfiQ5b98+TI49yBwCVubhE6BwFQJWAhe8IfK8uvr60/CDgLXXQAKBHIhYCP4RbP81tbWv8wtkSPwXEKb86wjYCN4Gf/x48dq3mV9EHjI4EMM0Q1z7TUF99OnT3xp1EUi+0YhYCX4OqLqQQ/i1uMQJZ6KK5HHc+01qYdFLIeg/L8N3QHpU4bye59zGOuzNoKX6OLZc8q06rkfIoOr7Xgxjaa59k3vjeX00o5Td1utNBuHsqdYwQcR6t6ztng+vMTeZ334WNyzbQ/lGNqBQAoCRQheYo7Xg5cIm0rXjBCvdTev7abj8h4EXptA1oKX0HWZrlVtupSmnvbQwSZha4t/f3c5BnUhMEUCWQte99a7ir3OCRK2hlJK3Ai8jhD7SiGQteAl0r5FXxi7u7t9m+HzEMiCQNaCH4Jw6sksQ5wjbTQT+PDhQ3OFhndPTk6shkPbC15j39UpR8mXgH6SLVriuzeLtpHT597kdLIpzvW1p86msIk2IfASAXvBq8de9+UpEHAgYC94ObnrfXmHwMDGMgkg+Ee/Ksvv7OyU6WGsgkBEwL7TLrDQb/nv37+Hl8kep7S+XjIjR264z+SZpkFYI5sxyuEQ/DNmzZjSzLnUPfaaoksZlgA/ydrztLukb8qwqQMnzNBr7x5qQmBYAnYZvmnu89BZPsViGsO6n9bcCFgJXuvRzRtZpyy/6MiteDENDegZYq69W0Bib1oCWQteGVTTYptKLMKm7B7aUB1d9s9b0lp14qWo27QdjuH+eHd39yKC5eXlamVl5cX3eaMfgawFr0UsJLQgTmXwWIR6vkjRHxDMFglcxwrbom3Ptjvm68PDw15XHUONOxfLh4eHWtPv7+9r97NzGAJZC16i01hojaXW7RVtfYu+ROLx1bo/r8v8HAU+y6Lv1N+Yy2zbvM6DQNaCD4iVdfuUsGSVpsrqyyMU/WQYYr59aI9HCLw2gSIE3wWislTb5bC4Z96FLHVzIFC84MOS0bqcVfbuclkbZ/scnMk5QmAegeIEL0GHRSf1vM+y0GpHnx+ib2CeI3gfAmMQyF7wQdzKxikysjrs+ixpPYYTOQYE2hJY+vNY2laeWj1NeDk7O0t+WvqnGLJ8cswcYAQCWQu+7n55CmZ9/7gixTnRJgQWIYDgW1Ijy7cERbVJE3gz6bOb0MnptzwFArkTIMN38CBZvgMsqk6SABm+g1vmzbTr0BRVIfAqBMjwHbBruquyPNNeO0Cj6qQIkOE7uEPDcsnyHYBRdXIEEHxHl6QY3NPxFKgOgYUJIPgO6DR7jgzfARhVJ0cg+6G1KYnGq+VoPjy/3VPSpu0xCCD4Z8olrGgzRsBwjLwJ2Apel+fK2mHJKsbK5x3InH07AjaCD5fnQeRcnrcLEGqVRSBrwesyPCxgGbslvjwPAo/f5zkEXAlkPfBGPeZaiZXLc9fwxe6uBLIWfFdjqQ8BdwLch3ePAOy3IoDgrdyNse4EELx7BGC/FQEEb+VujHUngODdIwD7rQggeCt3Y6w7AQTvHgHYb0UAwVu5G2PdCSB49wjAfisCCN7K3RjrTgDBu0cA9lsRQPBW7sZYdwII3j0CsN+KAIK3cjfGuhNA8O4RgP1WBBC8lbsx1p0AgnePAOy3IoDgrdyNse4EELx7BGC/FQEEb+VujHUngODdIwD7rQggeCt3Y6w7AQTvHgHYb0UAwVu5G2PdCSB49wjAfisCCN7K3RjrTgDBu0cA9lsRQPBW7sZYdwII3j0CsN+KAIK3cjfGuhNA8O4RgP1WBBC8lbsx1p0AgnePAOy3IvAXd0VRjJTy4H0AAAAASUVORK5CYII="})))),name:"LIFI"},{id:"nabox",logoURI:e=>P.createElement("svg",Ml({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Sl||(Sl=P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 7.23999V18.418L4.73651 20.2838V12.2876L7.96146 14.1503V22.1412L11.199 24.007V12.8279L1.5 7.23999Z",fill:"#2AC98B"})),Ll||(Ll=P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.85179 6.21724L12.0946 4.31675L16.1237 6.67449L12.883 8.56657L8.85179 6.21724ZM12.0988 0.5L2.32306 6.21934L12.8651 12.4001V24.5L16.0627 22.6374V10.3966L19.294 8.50455V20.7348L22.5389 18.8248V6.60827L12.0988 0.5Z",fill:"#2AC98B"}))),name:"Nabox"},{id:"bungee",logoURI:e=>P.createElement("svg",jl({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),bl||(bl=P.createElement("g",{clipPath:"url(#clip0_1106_26400)"},P.createElement("path",{d:"M24 4.5C24 2.29086 22.2091 0.5 20 0.5H4C1.79086 0.5 0 2.29086 0 4.5V20.5C0 22.7091 1.79086 24.5 4 24.5H20C22.2091 24.5 24 22.7091 24 20.5V4.5Z",fill:"#FEA700"}),P.createElement("path",{d:"M3.26157 14.6479C4.44801 14.6479 5.40958 13.6862 5.40958 12.4999C5.40958 11.3137 4.44779 10.3519 3.26157 10.3519C2.07824 10.3519 1.1189 11.3088 1.11401 12.491V12.509C1.1189 13.691 2.07824 14.6479 3.26157 14.6479Z",fill:"#ED1E7F"}),P.createElement("path",{d:"M20.7367 14.6477C21.923 14.6477 22.8847 13.686 22.8847 12.4997C22.8847 11.3134 21.923 10.3517 20.7367 10.3517C19.5504 10.3517 18.5887 11.3134 18.5887 12.4997C18.5887 13.686 19.5504 14.6477 20.7367 14.6477Z",fill:"#4CB85D"}),P.createElement("path",{d:"M9.59911 15.9941C10.2391 15.9941 10.8329 15.7967 11.3251 15.4612V15.9438H12.672V12.9378C12.672 12.9314 12.6726 12.9252 12.6726 12.9187V12.0794C12.6726 11.1272 13.4471 10.3527 14.3993 10.3527C15.3535 10.3527 16.126 11.1272 16.126 12.0794V15.9438H17.4747V12.0794C17.4747 10.3825 16.0982 9.00586 14.3993 9.00586C13.7591 9.00586 13.1646 9.20338 12.6722 9.53919V9.05539H11.3253V12.9307C11.3189 13.8792 10.5475 14.6454 9.5993 14.6454C8.6453 14.6454 7.87264 13.873 7.87264 12.9187V9.05607H6.52399V12.9187C6.52375 14.6176 7.90019 15.9941 9.59911 15.9941Z",fill:"black"}))),Cl||(Cl=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_1106_26400"},P.createElement("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.5)"}))))),name:"Bungee"},{id:"squid",logoURI:e=>P.createElement("svg",ld({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ad||(ad=P.createElement("g",{clipPath:"url(#clip0_6759_209574)"},P.createElement("path",{d:"M23.7182 11.278C23.2776 12.8519 22.2417 14.5477 20.9174 15.1962C16.7933 17.2151 14.6496 12.8533 14.9088 9.67381C15.0643 7.76437 15.6835 6.24613 15.2064 4.69333C15.0542 4.19797 14.7307 3.73957 14.2008 3.49141C12.7469 2.81029 11.3241 3.74677 10.6627 4.73893C9.94895 5.80885 9.61391 7.14757 9.70463 8.37109C9.79151 9.54997 10.1995 10.3228 10.8149 11.3783C11.6371 12.7885 12.5126 13.7044 12.8477 14.7872C13.0637 15.4852 13.1865 16.6117 12.1944 16.7063C11.1465 16.8066 11.1993 15.4328 11.1845 14.7436C11.1398 12.6488 9.80927 11.8943 8.80751 9.48133C8.22239 8.07205 7.99439 6.58165 8.33663 5.11045C8.81807 3.04021 9.99119 1.37125 12.1061 0.793809C13.7971 0.332049 15.7555 0.710769 16.8259 2.19157C18.0984 3.95221 17.8502 6.02917 17.3328 7.87477C16.3752 11.289 17.2305 12.9167 18.0288 13.3424C19.5403 14.1484 21.1262 13.2354 21.8299 12.2677C22.5921 11.2194 23.0467 9.30709 22.9747 8.08309C22.9473 7.61557 22.9061 7.21333 22.8432 6.85237",fill:"white"}),P.createElement("path",{d:"M0 12.0001C0 12.8756 0.09456 13.7291 0.27264 14.5513C0.2544 13.9316 0.31536 13.3182 0.47568 12.746C0.91632 11.1721 1.95216 9.47627 3.27648 8.82779C7.40064 6.80891 9.54432 11.1707 9.28512 14.3502C9.1296 16.2596 8.5104 17.7779 8.98752 19.3307C9.13968 19.826 9.4632 20.2844 9.99312 20.5326C11.447 21.2137 12.8698 20.2772 13.5312 19.2851C14.245 18.2151 14.58 16.8764 14.4893 15.6529C14.4024 14.474 13.9944 13.7012 13.3795 12.6457C12.5573 11.2355 11.6818 10.3196 11.3467 9.23675C11.1307 8.53883 11.0078 7.41227 12 7.31771C13.0478 7.21739 12.995 8.59115 13.0099 9.28043C13.0546 11.3751 14.3851 12.1297 15.3869 14.5427C15.972 15.9519 16.2 17.4423 15.8578 18.9135C15.3763 20.9838 14.2032 22.6527 12.0883 23.2302C10.3973 23.6919 8.43888 23.3132 7.36848 21.8324C6.096 20.0718 6.34416 17.9948 6.8616 16.1492C7.8192 12.735 6.96384 11.1073 6.1656 10.6815C4.65408 9.87611 3.06816 10.7886 2.36448 11.7563C1.60224 12.8046 1.14768 14.7169 1.21968 15.9409C1.26432 16.7003 1.34592 17.2878 1.49664 17.8062",fill:"white"}),P.createElement("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"#E6FA36"}),P.createElement("path",{d:"M15.8578 18.914C16.2 17.4428 15.972 15.9524 15.3869 14.5432C14.3851 12.1302 13.0541 11.3752 13.0099 9.28092C12.9955 8.59164 13.0479 7.21788 12 7.3182C11.0079 7.41324 11.1307 8.5398 11.3467 9.23772C11.6818 10.3206 12.5578 11.2364 13.3795 12.6467C13.9949 13.7022 14.4024 14.475 14.4893 15.6539C14.5795 16.8774 14.245 18.2161 13.5312 19.286C12.8693 20.2782 11.4471 21.2147 9.99313 20.5336C9.46321 20.2854 9.13969 19.8265 8.98753 19.3316C8.51089 17.7784 9.12961 16.2606 9.28513 14.3512C9.54433 11.1716 7.40017 6.80988 3.27649 8.82876C1.95217 9.47724 0.916332 11.1726 0.475692 12.747C0.315372 13.3196 0.254412 13.9326 0.272652 14.5523C0.523212 15.7081 0.939852 16.802 1.49665 17.8076C1.34593 17.2888 1.26433 16.7017 1.21969 15.9424C1.14769 14.7188 1.60273 12.806 2.36449 11.7577C3.06769 10.79 4.65409 9.87708 6.16561 10.683C6.96385 11.1088 7.81921 12.7364 6.86161 16.1507C6.34369 17.9968 6.09553 20.0732 7.36849 21.8339C8.43889 23.3147 10.3973 23.6934 12.0883 23.2316C14.2032 22.6532 15.3768 20.9843 15.8578 18.914Z",fill:"black"}),P.createElement("path",{d:"M23.7182 11.2782C23.8008 10.984 23.8565 10.6787 23.8891 10.3676C23.8891 10.3691 23.8896 10.37 23.8896 10.371C23.7206 9.12732 23.3616 7.94412 22.8422 6.85164C22.9051 7.21308 22.9464 7.61484 22.9737 8.08236C23.0457 9.30588 22.5907 11.2187 21.8289 12.267C21.1257 13.2347 19.5393 14.1476 18.0278 13.3417C17.2296 12.916 16.3742 11.2883 17.3318 7.87404C17.8497 6.02796 18.0979 3.95148 16.8249 2.19084C15.7545 0.710036 13.7961 0.331317 12.1051 0.793076C9.99021 1.37052 8.81661 3.03948 8.33565 5.10972C7.99341 6.58092 8.22141 8.07132 8.80653 9.4806C9.80829 11.8936 11.1393 12.6486 11.1835 14.7428C11.1979 15.4321 11.1456 16.8059 12.1934 16.7056C13.1856 16.6105 13.0627 15.484 12.8467 14.7865C12.5117 13.7036 11.6356 12.7878 10.8139 11.3776C10.1985 10.322 9.79101 9.54924 9.70365 8.37036C9.61341 7.14684 9.94797 5.80812 10.6617 4.7382C11.3236 3.74604 12.7459 2.80956 14.1998 3.49068C14.7297 3.73884 15.0532 4.19772 15.2054 4.6926C15.682 6.24588 15.0633 7.76364 14.9078 9.67308C14.6486 12.8526 16.7928 17.2144 20.9165 15.1955C22.2413 14.548 23.2776 12.8521 23.7182 11.2782Z",fill:"black"}))),sd||(sd=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_6759_209574"},P.createElement("rect",{width:24,height:24,fill:"white"}))))),name:"Squid"},{id:"across",logoURI:e=>P.createElement("svg",vl({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),fl||(fl=P.createElement("rect",{width:32,height:32,rx:16,fill:"#6CF9D8"})),yl||(yl=P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95021 8.41988L8.50949 6.8606L14.7408 13.0919C14.3626 13.253 14.0083 13.4879 13.6998 13.7964C13.4609 14.0353 13.2662 14.3017 13.1157 14.5853L6.95021 8.41988ZM12.9982 17.4399L6.85803 23.5801L8.41732 25.1394L14.495 19.0617C14.209 18.9107 13.9405 18.7149 13.6998 18.4742C13.3932 18.1675 13.1593 17.8156 12.9982 17.4399ZM17.5887 19.0584L23.5826 25.0522L25.1418 23.493L19.0822 17.4333C18.921 17.8114 18.6862 18.1657 18.3777 18.4742C18.1388 18.7131 17.8724 18.9079 17.5887 19.0584ZM18.9652 14.5916L25.0497 8.50706L23.4904 6.94778L17.3434 13.0947C17.7191 13.2558 18.071 13.4897 18.3777 13.7964C18.6184 14.037 18.8142 14.3055 18.9652 14.5916Z",fill:"#2D2E33"}))),name:"Across"},{id:"layerswap",logoURI:e=>P.createElement("svg",ed({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kl||(Kl=P.createElement("g",{clipPath:"url(#clip0_8229_671)"},P.createElement("path",{opacity:.3,d:"M11.4062 12.7691C11.4062 12.0165 12.0163 11.4065 12.7688 11.4065H24.5209C25.2735 11.4065 25.8835 12.0165 25.8835 12.7691V24.5213C25.8835 25.2738 25.2735 25.8837 24.5209 25.8837H12.7688C12.0163 25.8837 11.4062 25.2738 11.4062 24.5213V12.7691Z",fill:"#FF0093"}),P.createElement("path",{opacity:.5,d:"M23.2097 21.847C23.2097 22.5995 22.5996 23.2094 21.8471 23.2094H10.095C9.34246 23.2094 8.73242 22.5995 8.73242 21.847V10.0947C8.73242 9.34222 9.34246 8.73218 10.095 8.73218H21.8471C22.5996 8.73218 23.2097 9.34222 23.2097 10.0947V21.847Z",fill:"#FF0093"}),P.createElement("path",{opacity:.9,d:"M20.5349 19.1718C20.5349 19.9244 19.9249 20.5344 19.1723 20.5344H7.42018C6.66766 20.5344 6.05762 19.9244 6.05762 19.1718V7.4197C6.05762 6.66717 6.66766 6.05713 7.42018 6.05713H19.1723C19.9249 6.05713 20.5349 6.66717 20.5349 7.4197V19.1718Z",fill:"#FF0093"}))),Jl||(Jl=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_8229_671"},P.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(6 6)"}))))),name:"Layerswap"},{id:"okx",logoURI:e=>P.createElement("svg",id({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),td||(td=P.createElement("g",{clipPath:"url(#clip0_1443_44689)"},P.createElement("path",{d:"M21 0H11C4.92487 0 0 4.92487 0 11V21C0 27.0751 4.92487 32 11 32H21C27.0751 32 32 27.0751 32 21V11C32 4.92487 27.0751 0 21 0Z",fill:"black"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.6063 6.99255H7.39351C7.17207 6.99255 6.99255 7.17207 6.99255 7.39351V12.6063C6.99255 12.8278 7.17207 13.0073 7.39351 13.0073H12.6063C12.8278 13.0073 13.0073 12.8278 13.0073 12.6063V7.39351C13.0073 7.17207 12.8278 6.99255 12.6063 6.99255ZM18.6237 13.0073H13.4109C13.1895 13.0073 13.0099 13.1869 13.0099 13.4083V18.6211C13.0099 18.8426 13.1895 19.0221 13.4109 19.0221H18.6237C18.8452 19.0221 19.0247 18.8426 19.0247 18.6211V13.4083C19.0247 13.1869 18.8452 13.0073 18.6237 13.0073ZM19.4231 6.99255H24.6359C24.8574 6.99255 25.0369 7.17207 25.0369 7.39351V12.6063C25.0369 12.8278 24.8574 13.0073 24.6359 13.0073H19.4231C19.2016 13.0073 19.0221 12.8278 19.0221 12.6063V7.39351C19.0221 7.17207 19.2016 6.99255 19.4231 6.99255ZM12.6063 19.0221H7.39351C7.17207 19.0221 6.99255 19.2016 6.99255 19.4231V24.6359C6.99255 24.8574 7.17207 25.0369 7.39351 25.0369H12.6063C12.8278 25.0369 13.0073 24.8574 13.0073 24.6359V19.4231C13.0073 19.2016 12.8278 19.0221 12.6063 19.0221ZM19.4231 19.0221H24.6359C24.8574 19.0221 25.0369 19.2016 25.0369 19.4231V24.6359C25.0369 24.8574 24.8574 25.0369 24.6359 25.0369H19.4231C19.2016 25.0369 19.0221 24.8574 19.0221 24.6359V19.4231C19.0221 19.2016 19.2016 19.0221 19.4231 19.0221Z",fill:"white"}))),nd||(nd=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_1443_44689"},P.createElement("rect",{width:32,height:32,fill:"white"}))))),name:"okx"},{id:"symbiosis",logoURI:e=>P.createElement("svg",yd({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),gd||(gd=P.createElement("g",{clipPath:"url(#clip0_8229_679)"},P.createElement("path",{d:"M13.8614 16.7844L14.4243 16.2215V14.2548L13.8614 13.6919H13.0938L12.5601 14.2548V16.2215L13.0938 16.7844H13.8614Z",fill:"#75FB6E"}),P.createElement("path",{d:"M18.9063 16.7625L19.44 16.1995V14.2548L18.9063 13.6919H18.1313L17.5757 14.2548V16.1995L18.1313 16.7625H18.9063Z",fill:"#75FB6E"}),P.createElement("path",{d:"M31.5175 12.332L30.7425 12.2296L27.9717 14.3571L27.862 15.1321L27.7377 15.2417H26.9847L26.4217 15.7973V16.5431L26.9335 17.0548V17.318L26.3998 17.881L26.4217 21.3683L26.9847 21.902L27.0139 22.1725L27.0286 22.1871L26.5022 22.7062V23.4812L26.2609 23.7151H22.3422L22.1083 23.4812V23.079V19.5552L21.9986 19.4528L21.5454 18.9995V18.729L21.5015 18.6925L22.0498 18.1442V17.3984L22.0133 17.3546L22.1083 17.3473L22.2618 17.1572L23.0368 17.0768L24.9011 14.6788L24.828 13.9331L25.0107 13.743L25.0034 13.6699L25.0107 13.6626L24.9888 13.4505L24.9815 13.3994L25.5444 12.8364L25.4933 8.36212L24.9303 7.82842V7.76993L24.9596 7.53598L24.7475 7.26548L24.8207 6.49052L22.9344 4.09253L22.1595 4.01211L22.0425 3.85858L22.0498 3.85127V3.10555L21.5161 2.54261H20.8289H20.7704L20.5072 2.33059V1.56294L19.915 1H16.0548H15.9452H12.0777L11.4928 1.56294V2.33059L11.2296 2.54261H11.1711H10.4766L9.94288 3.10555V3.85127L9.95019 3.85858L9.84053 4.01211L9.06557 4.09253L7.17204 6.49052L7.25246 7.26548L7.04044 7.53598L7.06968 7.76993V7.82842L6.50674 8.36212L6.45556 12.8364L7.01119 13.3994L6.98926 13.743L7.19397 13.955L7.12086 14.6788L8.98515 17.0768L9.76011 17.1572L9.92095 17.3473L9.98675 17.3546L9.94288 17.3984V18.1442L10.4766 18.7071L10.4546 18.729V18.9995L10.0014 19.4528L9.89171 19.5552V23.079V23.4812L9.65045 23.7151H5.73178L5.49052 23.4812V22.7062L4.95682 22.1725L4.98606 21.902L5.54901 21.3683L5.57094 17.881L5.03724 17.318L5.06648 17.0548L5.57094 16.5431V15.7973L5.01531 15.2417H4.25497L4.13068 15.1321L4.02833 14.3571L1.25017 12.2296L0.482522 12.332L0 12.9461L0.109664 13.721L2.88051 15.8485L3.65547 15.7462L3.71396 15.79L3.70665 15.7973V16.5431L4.24035 17.106H4.26959V17.2668L3.70665 17.8225L3.65547 21.3171L4.18917 21.8801V22.1432H4.15993L3.62623 22.7062V23.4812L4.15993 24.0148H4.93489L5.17615 24.2488V25.0238L5.70985 25.5575H9.62851L10.1841 25.0238V24.2488L10.4254 24.0148H11.2296L11.756 23.4812V23.2106V19.5552L11.2808 18.9995L11.2515 18.7071L11.8145 18.1442V17.3984L11.2515 16.8355H10.4985L10.3742 16.6747L10.4546 15.907L8.56111 13.509L7.78615 13.4286V13.4213V13.3994L8.3491 12.8657L8.37103 8.4133L7.83733 7.85035L7.84464 7.76993L7.86657 7.748L8.64153 7.66758L10.5058 5.26959L10.4254 4.49463L10.4912 4.41421H11.2515L11.8145 3.85127V3.15673V3.10555L12.0777 2.89353H15.9452H16.0548H19.915L20.1855 3.10555V3.15673V3.85127L20.7485 4.41421H21.5088L21.5746 4.49463L21.4942 5.26959L23.3585 7.66758L24.1334 7.748L24.148 7.76993L24.1554 7.85035L23.6217 8.4133L23.6509 12.8657L24.2138 13.3994V13.4286L23.4681 13.509L21.5746 15.907L21.6477 16.6747L21.5088 16.8574L21.4942 16.8355H20.7192L20.1855 17.3984V18.1442L20.7192 18.7071H20.7485L20.7192 18.9995L20.2659 19.5552V23.2106V23.4812L20.7996 24.0148H21.5746L21.8085 24.2488V25.0238L22.3715 25.5575H26.2902L26.8239 25.0238V24.2488L27.0651 24.0148H27.8401L28.3738 23.4812V22.7062L27.8401 22.1432H27.7816V21.8801L28.3153 21.3171L28.2641 17.8225L27.7012 17.2668V17.106H27.7597L28.2934 16.5431V15.7973L28.286 15.79L28.3445 15.7462L29.1195 15.8485L31.8903 13.721L32 12.9461L31.5175 12.332Z",fill:"#75FB6E"}),P.createElement("path",{d:"M13.5693 23.854L13.0137 24.4096V25.1846L12.7724 25.4259H11.9975L8.2689 29.074V29.827L8.02764 30.061H4.10897L3.86771 29.827V29.0521L3.30477 28.4891H2.53712L2.00342 29.0521V29.827L2.53712 30.3607H3.30477L3.54603 30.5947V31.3697L4.07973 31.9034H7.99839L8.56133 31.3697V30.5947L8.79528 30.3607L8.82453 30.3827H9.59949L13.3354 26.7345V25.9596L13.5474 25.7183H14.2931L14.9072 25.1846V24.4096L14.3443 23.854H13.5693Z",fill:"#75FB6E"}),P.createElement("path",{d:"M28.7465 28.4891L28.1836 29.0521V29.827L27.9423 30.061H24.0236L23.7824 29.827V29.074L20.0538 25.4259H19.2788L19.0376 25.1846V24.4096L18.4819 23.854H17.707L17.144 24.4096V25.1846L17.7582 25.7183H18.5039L18.7159 25.9596V26.7345L22.4518 30.3827H23.2267L23.2487 30.3607L23.4899 30.5947V31.3697L24.0529 31.9034H27.9716L28.5052 31.3697V30.5947L28.7465 30.3607H29.5142L30.0479 29.827V29.0521L29.5142 28.4891H28.7465Z",fill:"#75FB6E"}))),fd||(fd=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_8229_679"},P.createElement("rect",{width:32,height:30.9034,fill:"white",transform:"translate(0 1)"}))))),name:"symbiosis"},{id:"scroll",logoURI:e=>P.createElement("svg",Od({width:24,height:24,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),Ad||(Ad=P.createElement("path",{d:"m22.289 16.217.002-13.915C22.27 1.137 21.348.2 20.18.2H5.657A5.758 5.758 0 0 0 0 5.96c0 1.063.284 1.969.721 2.763.365.662.944 1.286 1.518 1.756.157.128.083.08.576.383.68.417 1.46.624 1.46.624l-.006 8.322c.016.393.06.771.158 1.123a3.721 3.721 0 0 0 2.243 2.51 4.29 4.29 0 0 0 1.541.31l11.6.043A4.192 4.192 0 0 0 24 19.599a4.191 4.191 0 0 0-1.709-3.38l-.002-.002z",fill:"#FFEEDA"})),Sd||(Sd=P.createElement("path",{d:"M22.57 19.688a2.764 2.764 0 0 1-2.761 2.675l-7.985-.031a4.165 4.165 0 0 0 1.022-2.736c0-1.639-.977-2.766-.977-2.766h7.94a2.764 2.764 0 0 1 2.762 2.767v.09h-.001z",fill:"#EBC28E"})),Ld||(Ld=P.createElement("path",{d:"M2.992 9.295C2.076 8.427 1.426 7.3 1.426 5.959l.002-.142c.074-2.28 1.951-4.114 4.228-4.186h14.523c.38.012.686.286.686.671v12.285c.336.061.496.102.818.22.252.09.61.293.61.293V2.302C22.27 1.137 21.349.2 20.18.2H5.657A5.758 5.758 0 0 0 0 5.96c0 1.828.832 3.386 2.198 4.484.091.073.181.168.426.167.428 0 .728-.337.71-.71-.015-.306-.144-.42-.342-.607z",fill:"#190602"})),Md||(Md=P.createElement("path",{d:"M19.809 15.403H8.417a1.396 1.396 0 0 0-1.383 1.395v1.633c.021.757.666 1.406 1.428 1.406h.847V18.43h-.847v-1.599h.461c1.438 0 2.496 1.339 2.496 2.767 0 1.264-1.152 2.887-3.086 2.756-1.718-.115-2.64-1.64-2.639-2.756V5.714c0-.628-.509-1.137-1.136-1.137H3.422v1.417h.845v13.603c-.043 2.766 1.97 4.16 4.067 4.16l11.474.034a4.192 4.192 0 0 0 4.189-4.195 4.192 4.192 0 0 0-4.19-4.195l.002.002zm2.76 4.286a2.764 2.764 0 0 1-2.76 2.675l-7.985-.03a4.165 4.165 0 0 0 1.022-2.736c0-1.64-.977-2.767-.977-2.767h7.94a2.764 2.764 0 0 1 2.762 2.767v.091h-.001zM16.743 4.833H8.157V6.25h8.587a.709.709 0 0 0 0-1.417z",fill:"#190602"})),Rd||(Rd=P.createElement("path",{d:"M16.743 11.52H8.157v1.416h8.587a.709.709 0 0 0 0-1.416zM18.255 8.177H8.157v1.417h10.098a.709.709 0 0 0 0-1.417z",fill:"#190602"}))),name:"Scroll"},{id:"manta",logoURI:e=>P.createElement("svg",Id({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Bd||(Bd=P.createElement("g",{clipPath:"url(#a)"},P.createElement("rect",{width:24,height:24,rx:12,fill:"#fff"}),P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.58 20.606A10.72 10.72 0 0 1 1.262 12C1.263 6.07 6.07 1.263 12 1.263c4.894 0 10.238 2.925 11.53 7.404C22.087 3.662 17.473 0 12 0 5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12v-.632h-.747a21.577 21.577 0 0 1-1.449-.075c-.9-.08-1.927-.232-2.626-.512-1.125-.449-1.76-1.045-2.486-1.742L16.65 9c-.727-.699-1.544-1.483-2.96-2.15-1.395-.656-2.937-.55-4.07-.317a10.319 10.319 0 0 0-1.832.562c-.57.24-1.124.524-1.684.788a73.87 73.87 0 0 0 1.732.499 6.356 6.356 0 0 1 1.375.657c.586.376 1.072.85 1.27 1.432-1.243.163-2.41.71-3.281 1.223a13.438 13.438 0 0 0-1.639 1.139c-.07.058-1.194 1.048-1.194 1.048s1.449.154 2.164.298c.475.096 1.117.25 1.785.483.672.235 1.35.542 1.914.935.564.394.978.85 1.182 1.371.594 1.518.011 2.997-1.16 3.83-1.156.821-2.914 1.017-4.673-.19zm4.094 1.878c.468-.152.91-.374 1.31-.658 1.593-1.132 2.431-3.206 1.604-5.32-.325-.83-.945-1.464-1.635-1.946-.69-.482-1.485-.835-2.22-1.091-.484-.169-.951-.3-1.36-.398.153-.1.309-.197.467-.29.972-.572 2.196-1.097 3.37-1.097 1.77 0 3.088.543 4.347 1.126l.344.16c1.125.528 2.306 1.083 3.678 1.083 1.33 0 2.367-.377 3.081-.766-.636 5.323-5.166 9.45-10.66 9.45-.799 0-1.577-.087-2.326-.253zm11.622-9.973a5.289 5.289 0 0 1-1.717.279c-1.076 0-2.001-.432-3.175-.98l-.317-.146c-1.175-.545-2.535-1.122-4.306-1.226-.237-1.172-1.126-1.973-1.887-2.463a6.731 6.731 0 0 0-.253-.155c.076-.017.154-.035.233-.051 1.023-.21 2.244-.263 3.278.223 1.227.578 1.92 1.243 2.64 1.935l.025.023c.74.712 1.525 1.458 2.892 2.004.76.304 1.743.467 2.587.557z",fill:"url(#b)"}))),Ed||(Ed=P.createElement("defs",null,P.createElement("linearGradient",{id:"b",x1:0,y1:24,x2:24.43,y2:23.554,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#29CCB9"}),P.createElement("stop",{offset:.495,stopColor:"#0091FF"}),P.createElement("stop",{offset:1,stopColor:"#FF66B7"})),P.createElement("clipPath",{id:"a"},P.createElement("rect",{width:24,height:24,rx:12,fill:"#fff"}))))),name:"Manta"},{id:"orbiter",logoURI:e=>P.createElement("svg",rd({xmlns:"http://www.w3.org/2000/svg",width:"32.000000pt",height:"32.000000pt",viewBox:"0 0 32.000000 32.000000",preserveAspectRatio:"xMidYMid meet"},e),od||(od=P.createElement("g",{transform:"translate(0.000000,32.000000) scale(0.100000,-0.100000)",fill:"#000000",stroke:"none"},P.createElement("path",{d:"M91 285 c-32 -28 -56 -85 -48 -115 3 -11 -5 -27 -19 -41 -32 -30 -30 -39 7 -39 32 0 34 -5 14 -53 -14 -33 11 -17 28 18 14 29 22 35 47 35 28 0 30 -2 30 -40 0 -51 18 -53 22 -2 3 32 7 37 31 40 23 3 30 -2 42 -32 9 -20 20 -36 26 -36 7 0 8 7 4 18 -20 47 -18 52 14 52 36 0 39 10 11 35 -13 11 -20 31 -20 53 0 107 -112 171 -189 107z m112 4 c12 -6 30 -21 39 -33 22 -26 24 -96 4 -96 -29 0 -46 13 -46 35 0 30 -26 56 -48 48 -22 -8 -32 -23 -32 -49 0 -21 -17 -34 -46 -34 -10 0 -14 12 -14 38 1 75 78 124 143 91z m-25 -82 c2 -10 -3 -17 -12 -17 -18 0 -29 16 -21 31 9 14 29 6 33 -14z m-88 -92 c0 -8 -4 -15 -9 -15 -13 0 -22 16 -14 24 11 11 23 6 23 -9z m80 0 c0 -8 -4 -15 -10 -15 -5 0 -10 7 -10 15 0 8 5 15 10 15 6 0 10 -7 10 -15z m82 0 c0 -5 -5 -11 -11 -13 -6 -2 -11 4 -11 13 0 9 5 15 11 13 6 -2 11 -8 11 -13z"})))),name:"Orbiter"},{id:"dodo",logoURI:e=>P.createElement("svg",Xl({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none",viewBox:"0 0 32 32"},e),Ql||(Ql=P.createElement("g",{clipPath:"url(#a)"},P.createElement("rect",{width:32,height:32,fill:"#FFE804",rx:8}),P.createElement("path",{fill:"#fff",d:"m16.444 4.444-1.51.89-1.245 1.421-.978 2.49-.356 2.577-2.577.356-3.823 2.933L4.445 20l.622 3.555.8-.622.622 1.6 1.244-1.244.445 1.51.444.534 1.422-2.4 2.311-.178v1.6l-.888.89v1.244l2.222.178.71-.89v-2.844l.268-.355 1.688.355.178.89v1.51l-.889 1.334.89.622 1.955-.445.266-4.977.623-.356 1.777.622 1.156 3.378 1.511-2.311.889 1.422 1.422-1.422 1.067.267.178-4.445-1.423-4.622-2.666-1.956L21.422 12l-1.067-.445-.977-4.977-1.6-1.778-1.334-.267v-.089Z"}),P.createElement("path",{fill:"#000",d:"M27.911 20.622v-.267l-.089-.178c0-.088-.178-.444 0-.533 0-.178 0-.266-.178-.444.178-.09 0-.267 0-.445v-.266l.178-.09c-.178 0 0-.266-.178-.266 0-.178-.177-.267 0-.267l-.088-.355v-.089a3.555 3.555 0 0 1-.178-1.067c-.178 0-.178-.089-.178-.178v-.266c-.089 0-.178-.178-.089-.267-.178 0-.089-.089-.178-.178v-.355l-.177-.356c0-.178-.178-.178-.178-.266v-.09H26.4v-.266l-.178-.089a2.654 2.654 0 0 0-.267-.355v.088c-.088 0 0-.088 0-.177h-.177v-.178H25.6v-.178h-.267l-.355-.267V12.8c-.09 0 0 0 0-.09h-.445L24 12.445c0-.089-.178 0-.178-.178-.089 0 0 .178-.089 0-.089 0-.178 0-.266-.177 0 .177-.09 0-.267 0a.71.71 0 0 1-.356-.267s-.266-.089-.355 0l-.089-.178s0 .09-.089 0h-.978c-.177-.089-.266-.178-.355 0H20.8l-.089-.267v-1.244c.089-.089.089-.355 0-.355v-.356l-.089-.178c-.089 0-.089 0 0 0l-.178-.355v-.267c0 .089 0 .089 0 0v-.356c-.177-.177-.088-.266 0-.444h-.177v-.178l-.09-.178-.088-.177L20 6.933s0-.267-.178-.267l-.089-.177h-.089v-.09l-.088-.088v-.089l-.178-.444v.088l-.09-.088H19.2s-.178-.09 0-.267h-.267l-.266-.533c-.178-.09-.356-.178-.356-.356-.267 0-.355-.178-.533-.356l-.267.09c-.178-.267-.622-.267-.889-.267 0 .089 0 .089 0 0h-.178c-.177 0-.088.177-.177.177v-.088l-.445.088-.266.178s-.356 0-.267.09c0-.09 0-.09 0 0v.088l-.089-.089c0 .178-.267.178-.356.356l-.266.177-.445.445c-.177 0-.266.089-.266.178l-.09.177-.266.356c0 .089 0 .178-.089 0l-.089.267-.178.355v.09H12.8l-.622.088c-.534 0-1.156-.267-1.6 0-.178-.178-.445 0-.534-.089 0 .089-.177.089-.088 0H9.6v.178c-.089 0-.089 0 0 .089h.178c.089.089 0 0 0 .089.178 0 .178 0 0 0l.355.089h.445c.178.177.444.266.622.177-.178.178.178 0 .356.09l.444.177h.533V8l.267.089c0 .089-.178.089-.089.177v.267s0 .178-.178.178v.178c-.178 0 0 .266-.178.355v.622s0 .178-.177.09v1.777H12c-.356-.178-.622 0-.889-.089h-.444l-.445.178-.8.267h-.178l-.533.355-.178.178-.177.089-.178.178-.356.266-.089.178c-.089 0-.177 0-.266.178L7.2 13.6l-.178.089-.444.444-.178.356-.178.088-.178.178-.088.178-.178.267v.089l-.09.088v.267H5.6L5.333 16v.266l-.089.09c-.177.088-.177.177-.177.355 0 0 0 .178-.09.089 0 .089-.177.266 0 .355H4.89a.889.889 0 0 0-.178.445l-.178.533c0 .178 0 .356-.177.445v.977l-.09.445c0 .089-.177.177-.088.266-.178 0 0 .09 0 .178h-.09v1.067l.09.533c.178.09.178.267.178.356-.09.178 0 .71 0 .71h.088l.09.623c0 .178 0 .178.177.267.178.177 0 .444.267.355 0 .356.444.09.533-.089V24c.178-.356.178-.356 0 0 .178-.178.356-.267.356-.445v.267l.177.355c0 .267.178.445.356.534h.356c.177 0 .266-.178.355-.356L7.378 24l.178-.267h.177c0 .178 0 .267.178.356-.267.088 0 .444 0 .622v.889c.178.089.178.089 0 0l.445.355s.533-.266.355-.355H8.8c.178 0 .267-.267.356-.445l.177-.266v-.09l.09-.355c0-.089 0-.089 0 0 .177 0 .177-.178.266-.267-.089-.088 0-.088 0-.177v-.09l.178-.177.177-.267v-.088c0-.09.267 0 .356-.178 0-.178.178-.178.355-.267.09 0 .09 0 0 0h1.423v.089c0 .178-.267.356-.09.622-.088.09 0 .178 0 .356v.533c-.444 0-.532.444-.888.711l-.178.445v.533l.09.355.177.356.267.178c.088.089.177.089.355 0h.267l.177-.178-.444.178c0-.089 0-.089 0 0l.444-.178.445.089.267-.089h.444l.445-.089.444-.355.178-.445v-.533c.178-.445 0-.8 0-1.156.178-.266 0-.444 0-.533v-1.067c.178 0 .355.178.444.09l.356.088H16c0-.089 0-.089 0 0h-.622l.533.089h.267v.711c-.178 0 0 .356 0 .444v.623l.177.089c-.177.177-.177.355-.088.533-.178 0-.356.089-.356.267-.178 0-.267.177-.355.266l-.178.623v.177l.089.267s.088 0 0 .089c.177 0 .355.267.533.355.267.09.267.09 0 0l.267.09h.355c0 .177.178.088.267.088-.089.09 0 0 .178.09h.266c.267.177.534 0 .711 0l.534-.534.178-.267c0 .267-.623.533-.89.622 0 .178-.266.09-.533.178.267 0 .445 0 .623-.178.177-.089.8-.355.8-.622V25.6c.177-.178 0-.445.088-.623v-.888c.178-.356 0-.623.178-1.067-.089 0-.178-.267-.089-.356-.089 0-.089 0 0 0v-.088c.09-.356-.177-.623.356-.712h.8c-.178-.177-.178-.177 0 0l.355.178c.178 0 .178.267.267.267l.178.178c0 .177 0 .266.178.444l.088.178.178.355v.178s.178 0 0 .09l.178.088v.355c0 .267 0 .356.178.534v.533h.089c0-.178 0-.178 0 0v.445c0 .177 0 0 .178 0 0 .088 0 .088 0 0-.09 0-.178.177-.178 0-.09.177.089.088.178.088l-.09.267v.356c.356.355.623 0 .712-.356l.178-.089v-.444l.088-.356h.09l.444-.71.444-.534.09.355c.088.178 0 .356.177.356v.178c0-.267 0-.534-.267-.711.178.177.267.444.267.71v.178l.178.267c0 .178.266.356.444.356h.089c.089 0 .178-.09.089-.178l.267-.178c0-.178 0-.355.177-.444 0-.267 0-.267 0 0l.267-.623c0-.177.178-.266.267-.444v-.178l.355.356-.267-.356v.178h.09l.177.267c0 .177.356.177.445.266 0-.088.177 0 .355 0l.267-.177.266-.178v-.267s.09-.266 0-.178v-.177c.178 0 0 0 0-.09.09 0 0-.088 0-.088l.09-.356c0-.177.177-.266 0-.444.266 0 .177-.267.177-.356v-1.333h.09Zm-3.467 4.622.09.178-.09-.089v-.089Zm.178.178c0-.178 0 0-.089 0h.267-.178Zm2.49-3.645c-.09 0 0 .09 0 .178l-.09.534c-.178 0 0 .177-.089.355.178 0 0 .178 0 .178l-.177.178-.09-.178-.177-.267H26.4l-.089-.089h-.267c-.177 0-.266.178-.444.356h-.267l-.089.267v.177l-.355.178v.178L24.71 24c0-.178 0-.534-.178-.445l-.178-.444v.089c.09-.267-.177-.356-.177-.534l-.267.09h-.089v.088l-.355.178v.089c-.178.089-.267.355-.267.444-.178.267-.267.622-.533.8-.178.09 0 .445-.267.445v-.978c-.089 0-.178-.267-.089-.444-.178 0-.267-.267-.267-.356l-.266-.444v-.09l-.178-.355c-.089-.089-.178 0-.178-.178l-.267-.177h-.088l-.267-.356h-.356l-.355-.089h-.445l-.088-.089-.178.09h-.356c-.266 0-.355 0-.444.177l-.178.444v.356l-.089.622h-.089v3.556l-.267.088-.177.09c-.267 0-.356 0-.445.177h-.622c-.267 0-.533 0-.622-.355 0 0 0-.178.178-.267l.266-.267s.178-.177 0-.266c.267 0 .178-.178.267-.356V24.8c-.178 0-.089 0 0 0v-.89l-.089-.266c0-.178 0-.444-.178-.622v-.089l-.089-.178s.09 0 0-.089c.178-.088 0-.266 0-.355 0 0-.177 0-.177-.178-.09 0 0 0 0-.089-.178.178-.356 0-.445 0-.266 0-.355.178-.533 0H15.2l-.178-.089-.178.09v.088h-.177c-.178 0-.267 0-.267.178h-.089l-.089.267v.444c-.089.178-.178.356-.089.622-.177 0 0 .356-.089.445v.355l-.088.445.088.266v.445l-.177.533-.445.178H12.8l-.356.089h-.177l-.178-.09h-.178l-.178-.088c-.178-.267-.089-.445 0-.711 0-.178.267-.267.267-.534-.356 0-.356 0 0 0l.355-.355c.09 0 .09-.178.267-.178v-1.066c0 .088 0 .088 0 0 0-.178 0-.267-.178-.267l.09-.178v-.267l-.09-.088c-.266-.267-.533-.356-.889-.445h-.533s-.178 0-.178.178c-.177-.178-.533 0-.71 0-.09 0-.178.267-.445.267v.088c0 .178-.089 0-.178.09 0 .088-.178.177 0 .266-.267 0-.267.267-.444.356l-.09.177-.177.09-.178.621v.09l-.266.177v.267-.356l-.178-.178c0-.355-.178-.8-.356-.977l-.178-.445H7.29c0 .178-.267.178-.178.356l-.178.089v.088a.536.536 0 0 0-.355.445V24l-.267-.534-.089-.355c-.089-.178 0-.267 0-.356l-.178-.177c-.177 0-.177.088-.355 0v.177l-.089.09c-.267 0-.178.266-.178.355l-.178-.178v-.267c-.177-.266-.177-.622-.266-.889v-1.6c0 .356 0 .356 0 0v-.444c0-.178.178-.356 0-.444l.266-.178c-.088-.445 0-.89.178-1.245-.089 0-.089-.177 0-.177v-.356c0-.178.178-.267.356-.445l.089-.355c.177 0 .177-.267.177-.356L6.222 16v-.09l.267-.444.267-.355.266-.267c0-.089 0-.178.178-.266.089 0 .267-.09.267-.267l.177-.089.178-.178v-.178l.534-.355.355-.267H8.8v-.089h.267c0-.178.089-.178.177-.266-.088 0-.177.177-.266.088 0 .09 0 .09 0 0 .089.09.178 0 .266-.088l.09-.09.444-.177.355-.089c.267-.178.623-.267.89-.178l.71-.089H12s.089 0 0-.088c.267 0 .267.177.444 0V12c.09 0 0-.178 0-.178v-.267l.09-.089c.088-.177.177-.266 0-.444.177 0 .177-.267.177-.444h-.089c0-.445.09-.445 0 0l.178-.267c-.089-.178 0-.267 0-.356v-.177c0-.178 0-.356.178-.534.089 0 0-.178.178-.266-.09 0 0-.09 0-.178v-.356c.177 0 .266-.178.266-.355 0-.178 0-.356.178-.445l.267-.355c0-.09 0-.09 0 0V7.11s.088-.089 0-.178c.355-.089.355-.533.622-.711l.266-.267c0-.177.267-.355.356-.444l.356-.089s.266 0 .177-.178l.267-.089.178-.177h.089l.71-.178h.356c.178 0 .09.089.178.178l.445.177v.09c.266.266.355.266 0 0l.355.355c.178.178.267.533.534.71-.178.179.266.445.266.623v.178c.178 0 0 .178.178.267v.088l.178.267.089.533.088.267v.533l.09.267v.711l.177.622v.89c.178.177.178.177 0 0v-.534.444L20 12h.089c.089.089.267.266.355.178h.623l.355.088h.267s0 .178.178.09l.71.088.356.178c.267.178.711.267.89.533H24v.178c.267 0 .355.267.533.267.267 0 .356.266.534.355l.444.356c.089.178 0 .444.356.355l.177.623c.267.266.267.266 0 0v.177l.178.356c0 .178.178.267.267.444h-.178v.267l.178.178v.267l.178.266c0 .178 0 .356.177.356-.266 0 0 .355 0 .355 0 .267 0 .356 0 0v.267c-.177.178.09.355 0 .533v.178c0-.089 0-.089 0 0v.622c.09 0 .09 0 0 .09v.444l.178.355v.356s-.089.089 0 .177v.09c0 .177 0 .177 0 0h-.089l.09.177v.534h.088Z"}),P.createElement("path",{fill:"#000",d:"M17.334 6.222h-.178l-.267.09-.178.355.09.266h.177l.356.09.266-.268V6.4c-.178 0-.178-.178-.266-.178Zm-1.6 0h-.356c-.267.09-.267.267-.267.445v.177l.445.178h.089l.177-.089v-.178c.09-.088.178-.177.09-.355l-.09-.178h-.088Z"}))),Yl||(Yl=P.createElement("defs",null,P.createElement("clipPath",{id:"a"},P.createElement("path",{fill:"#fff",d:"M0 0h32v32H0z"}))))),name:"Omni-Trade"},{id:"zetachain",logoURI:e=>P.createElement("svg",Td({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},e),wd||(wd=P.createElement("g",{clipPath:"url(#clip0_2101_121411)"},P.createElement("path",{d:"M18 0H6C2.68629 0 0 2.68629 0 6V18C0 21.3137 2.68629 24 6 24H18C21.3137 24 24 21.3137 24 18V6C24 2.68629 21.3137 0 18 0Z",fill:"white"}),P.createElement("path",{d:"M7.87178 7.24452H11.4965L11.5028 12.7555C11.5029 12.8871 11.5554 13.0133 11.6485 13.1063C11.7416 13.1993 11.8679 13.2516 11.9995 13.2516C12.0648 13.2515 12.1293 13.2387 12.1896 13.2136C12.2498 13.1886 12.3046 13.152 12.3506 13.1058C12.3967 13.0596 12.4332 13.0048 12.4581 12.9445C12.483 12.8842 12.4957 12.8196 12.4956 12.7543L12.4889 6.74728C12.4887 6.61563 12.4363 6.48943 12.3431 6.39638C12.25 6.30333 12.1237 6.25104 11.9921 6.25098H7.87178C7.74002 6.25098 7.61367 6.30331 7.52051 6.39648C7.42734 6.48964 7.375 6.616 7.375 6.74775C7.375 6.8795 7.42734 7.00586 7.52051 7.09902C7.61367 7.19218 7.74002 7.24452 7.87178 7.24452Z",fill:"#154618"}),P.createElement("path",{d:"M6.95668 9.49378H9.24793L9.25397 12.7551V15.0041C9.25388 15.0694 9.26668 15.1341 9.29165 15.1945C9.31662 15.2549 9.35326 15.3098 9.39947 15.356C9.44568 15.4022 9.50056 15.4389 9.56096 15.4638C9.62135 15.4888 9.68608 15.5016 9.75144 15.5015H14.2507C14.316 15.5015 14.3806 15.4886 14.4408 15.4635C14.5011 15.4385 14.5558 15.4018 14.6019 15.3556C14.648 15.3094 14.6845 15.2546 14.7094 15.1943C14.7343 15.134 14.7471 15.0693 14.747 15.0041V12.7542L14.74 4.49701C14.7401 4.36529 14.6879 4.23895 14.5948 4.14575C14.5017 4.05255 14.3754 4.00012 14.2437 4H8.82202C8.69027 4 8.56391 4.05234 8.47075 4.1455C8.37759 4.23866 8.32525 4.36502 8.32525 4.49677C8.32525 4.62853 8.37759 4.75488 8.47075 4.84805C8.56391 4.94121 8.69027 4.99355 8.82202 4.99355H13.7479L13.7546 12.7542V14.5068H10.2475V12.7542L10.2407 8.99561C10.2404 8.86404 10.188 8.73796 10.0948 8.64501C10.0017 8.55206 9.87558 8.49983 9.744 8.49977H6.95575C6.824 8.49977 6.69765 8.55211 6.60448 8.64527C6.51132 8.73843 6.45898 8.86479 6.45898 8.99654C6.45898 9.1283 6.51132 9.25465 6.60448 9.34782C6.69765 9.44098 6.824 9.49332 6.95575 9.49332L6.95668 9.49378Z",fill:"#154618"}),P.createElement("path",{d:"M18.7503 15.1377C18.685 15.1377 18.6204 15.1505 18.5602 15.1755C18.4999 15.2005 18.4451 15.2371 18.399 15.2832C18.3529 15.3293 18.3163 15.3841 18.2913 15.4444C18.2663 15.5046 18.2535 15.5692 18.2535 15.6345V19.0036H5.74745V15.6345C5.74745 15.5027 5.69511 15.3764 5.60195 15.2832C5.50879 15.19 5.38243 15.1377 5.25068 15.1377C5.11893 15.1377 4.99257 15.19 4.89941 15.2832C4.80624 15.3764 4.75391 15.5027 4.75391 15.6345V19.5015C4.75391 19.6333 4.80624 19.7596 4.89941 19.8528C4.99257 19.946 5.11893 19.9983 5.25068 19.9983H18.7505C18.8157 19.9983 18.8803 19.9855 18.9406 19.9605C19.0009 19.9355 19.0556 19.8989 19.1018 19.8528C19.1479 19.8067 19.1845 19.7519 19.2095 19.6916C19.2344 19.6314 19.2473 19.5668 19.2473 19.5015V15.6345C19.2473 15.5692 19.2344 15.5046 19.2094 15.4443C19.1845 15.384 19.1478 15.3292 19.1017 15.2831C19.0555 15.237 19.0007 15.2004 18.9404 15.1754C18.8801 15.1505 18.8155 15.1377 18.7503 15.1377Z",fill:"#154618"}),P.createElement("path",{d:"M7.99746 16.7568V14.3708C7.99746 14.239 7.94512 14.1127 7.85195 14.0195C7.75879 13.9264 7.63243 13.874 7.50068 13.874C7.36893 13.874 7.24257 13.9264 7.14941 14.0195C7.05625 14.1127 7.00391 14.239 7.00391 14.3708V17.2536C7.00397 17.3853 7.05633 17.5117 7.14948 17.6048C7.24263 17.698 7.36895 17.7503 7.50068 17.7504H16.5004C16.6322 17.7503 16.7585 17.698 16.8516 17.6048C16.9448 17.5117 16.9971 17.3853 16.9972 17.2536V14.3708C16.9972 14.239 16.9449 14.1127 16.8517 14.0195C16.7585 13.9264 16.6322 13.874 16.5004 13.874C16.3687 13.874 16.2423 13.9264 16.1492 14.0195C16.056 14.1127 16.0037 14.239 16.0037 14.3708V16.7568H7.99746Z",fill:"#154618"}))),kd||(kd=P.createElement("defs",null,P.createElement("clipPath",{id:"clip0_2101_121411"},P.createElement("rect",{width:24,height:24,rx:12,fill:"white"}))))),name:"ZUNO"}];function _d({item:e,isMobile:i}){var o,r,a,l,d,c;const u=t.useTheme(),[p,h]=n.useState(!1),m=n.useMemo((()=>e.swapSteps?e.swapSteps.map((e=>{var t,n,i,o;const{inputToken:r,outputToken:a,percent:l}=e,d=new Map,c={poolPart:gr({input:new s(l).div(100)}),poolAddress:null!==(n=null===(t=e.assembleArgs)||void 0===t?void 0:t.pairAddress)&&void 0!==n?n:null};return d.set(null!==(o=null===(i=e.assembleArgs)||void 0===i?void 0:i.pairName)&&void 0!==o?o:"-",[c]),{fromToken:r.address,toToken:a.address,chainId:r.chainId,poolDetails:d}})):[]),[e.swapSteps]),x="from"===e.key,g="to"===e.key,f=x||g;return z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:{width:20,height:20,borderRadius:"50%",backgroundColor:u.palette.background.tag,display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx(t.Box,{component:e.logo,sx:{width:20,height:20}})}),z.jsx(t.Box,{sx:{typography:"body1",lineHeight:"22px",color:u.palette.text.primary},children:e.title})]}),f?null:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",gap:4,typography:"body2",lineHeight:"22px",color:u.palette.text.primary},children:[z.jsxs(t.Box,{children:[ir({input:e.fromTokenAmount,decimals:null===(o=e.fromToken)||void 0===o?void 0:o.decimals})," ",null===(r=e.fromToken)||void 0===r?void 0:r.symbol]}),z.jsx(t.Box,{sx:{color:u.palette.text.secondary},children:"On"}),z.jsx(t.Box,{component:null===(a=e.fromChain)||void 0===a?void 0:a.logo,sx:{width:18,height:18}}),z.jsx(t.Box,{sx:{color:u.palette.text.secondary},children:"to"}),z.jsxs(t.Box,{children:[ir({input:e.toTokenAmount,decimals:null===(l=e.toToken)||void 0===l?void 0:l.decimals})," ",null===(d=e.toToken)||void 0===d?void 0:d.symbol]}),z.jsx(t.Box,{sx:{color:u.palette.text.secondary},children:"on"}),z.jsx(t.Box,{component:null===(c=e.toChain)||void 0===c?void 0:c.logo,sx:{width:18,height:18}})]})]}),g?null:z.jsxs(t.Box,{sx:{pt:8,pb:24,ml:9,borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:u.palette.border.light},children:[x?null:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4},children:[e.tx&&e.txChainId&&z.jsxs(t.Box,{component:"a",href:Ia(e.txChainId,e.tx,"tx"),target:"_blank",sx:{display:"flex",alignItems:"center",gap:4,color:u.palette.text.secondary,typography:"body2",lineHeight:"19px","&:hover":{color:u.palette.text.primary},textDecoration:"none"},children:["TX:",z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.33333V12.6667H12.6667V7.99999H14V12.6667C14 13.4 13.4 14 12.6667 14H3.33333C2.59333 14 2 13.4 2 12.6667V3.33333C2 2.6 2.59333 2 3.33333 2H8V3.33333H3.33333ZM9.33333 3.33333V2H14V6.66666H12.6667V4.27333L6.11333 10.8267L5.17333 9.88666L11.7267 3.33333H9.33333Z",fill:"currentColor"})})]}),e.swapSteps&&z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>h(!p),sx:{display:"flex",alignItems:"center",gap:4,py:2,pr:2,pl:6,borderRadius:20,backgroundColor:u.palette.background.tag,color:u.palette.text.secondary,typography:"h6",lineHeight:"16px","&:hover":{color:u.palette.text.primary}},children:["Route",z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00033 9.33334L9.33366 5.83334H4.66699L7.00033 9.33334Z",fill:"currentColor"})})]})]}),p&&e.fromToken&&e.toToken&&z.jsx(t.Box,{sx:{mt:8,ml:20,p:12,borderRadius:12,backgroundColor:u.palette.background.paperDarkContrast},children:i?z.jsx(xl,{routeData:m,fromTokenRaw:e.fromToken,toTokenRaw:e.toToken}):z.jsx(gl,{routeData:m,fromTokenRaw:e.fromToken,toTokenRaw:e.toToken})})]})]},e.key)}const Dd=({route:e,isMobile:i})=>{const{fromChainId:o,toChainId:r,step:a}=e,s=n.useMemo((()=>{const e=Ro.get(o),t=Ro.get(r),n=[{key:"from",logo:null==e?void 0:e.logo,title:null==e?void 0:e.name}];return a.includedSteps.length>0&&a.includedSteps.forEach((e=>{var t,i;const o=Pd.find((t=>t.id===e.tool)),r=Ro.get(e.estimate.fromToken.chainId),a=Ro.get(e.estimate.toToken.chainId);n.push({key:e.id,logo:null!==(t=null==o?void 0:o.logoURI)&&void 0!==t?t:null==r?void 0:r.logo,title:null!==(i=null==o?void 0:o.name)&&void 0!==i?i:null==r?void 0:r.name,fromTokenAmount:e.estimate.fromTokenAmount,fromToken:e.estimate.fromToken,fromChain:r,toTokenAmount:e.estimate.toTokenAmount,toToken:e.estimate.toToken,toChain:a,tx:e.hash,txChainId:e.hashChainId,swapSteps:e.swapSteps})})),n.push({key:"to",logo:null==t?void 0:t.logo,title:null==t?void 0:t.name}),n}),[o,a.includedSteps,r]);return z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:s.map((e=>z.jsx(_d,{item:e,isMobile:i},e.key)))})},Nd=({route:i})=>{const[o,r]=n.useState(!1),a=t.useTheme(),{isMobile:s}=Xa(),{fromChainId:l,toChainId:d,step:c}=i,u=n.useMemo((()=>{const e=Ro.get(l),t=Ro.get(d),n=[{key:"from",logo:null==e?void 0:e.logo}];return c.includedSteps.length>0&&c.includedSteps.forEach((e=>{const t=Pd.find((t=>t.id===e.tool));t&&n.push({key:e.id,logo:t.logoURI})})),n.push({key:"to",logo:null==t?void 0:t.logo}),n}),[l,c.includedSteps,d]);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{py:4,pl:8,pr:4,display:"flex",alignItems:"center",gap:4,borderRadius:12,backgroundColor:a.palette.background.tag,cursor:"pointer",typography:"h6",fontWeight:500,color:a.palette.text.secondary,"&:hover":{color:a.palette.text.primary}},onClick:()=>{r(!0)},children:[z.jsx(t.Box,{sx:{color:a.palette.text.primary},children:"Route:"}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:0},children:u.map(((e,n)=>z.jsx(t.Box,{sx:{ml:0===n?0:-4,width:16,height:16,borderRadius:"50%",backgroundColor:a.palette.border.main,border:`1px solid ${a.palette.border.main}`,p:1,display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx(t.Box,{component:e.logo,sx:{width:14,height:14}})},e.key)))}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:z.jsx("path",{d:"M2.91699 11.0833V7.58332H4.08366V9.91666H6.41699V11.0833H2.91699ZM9.91699 6.41666V4.08332H7.58366V2.91666H11.0837V6.41666H9.91699Z",fill:"currentColor"})})]}),z.jsx(el,{open:o,title:z.jsx(e.Trans,{id:"rT8e1f",message:"Route"}),onClose:()=>r(!1),modal:!0,children:z.jsx(t.Box,{sx:{minWidth:s?"100%":800,py:20,px:20,borderTop:`1px solid ${a.palette.border.main}`},children:z.jsx(Dd,{route:i,isMobile:s})})})]})};function Fd({route:i}){var o;const r=t.useTheme(),[a,l]=n.useState(!1),d=Rs({fees:null!==(o=null==i?void 0:i.fees)&&void 0!==o?o:[]});if(!i)return null;const{product:c,executionDuration:u,feeUSD:p,fromAmount:h,fromToken:m,fromChainId:x,toTokenAmount:g,toToken:f,toChainId:y,step:{includedSteps:v}}=i,b=a?f:m,C=a?m:f;return z.jsx(z.Fragment,{children:z.jsxs(t.Box,{sx:{flexGrow:1,display:"flex",flexDirection:"column",gap:8},children:[z.jsxs(t.Box,{sx:{px:11,py:7,borderRadius:12,border:`solid 1px ${r.palette.border.main}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",typography:"body2",color:r.palette.text.primary,fontWeight:600,gap:6},children:[z.jsxs("span",{children:["1 ",b.symbol]}),z.jsx("span",{style:{color:r.palette.text.secondary},children:"="}),z.jsxs("span",{children:[ir({input:a?new s(h).div(g):g.div(h),decimals:null==C?void 0:C.decimals})," ",C.symbol]}),z.jsx(t.Box,{component:t.ButtonBase,onClick:e=>{e.stopPropagation(),l((e=>!e))},sx:{color:r.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:r.palette.text.secondary}},children:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[z.jsx("circle",{cx:"9",cy:"9",r:"9",fill:"currentColor",fillOpacity:"0.1"}),z.jsx("path",{d:"M9.5 6.5H4.5V8H13.5L9.5 4.25V6.5ZM8.25 13.75V11.5H13.5V10H4.5L8.25 13.75Z",fill:"currentColor",fillOpacity:"0.5"})]})})]}),z.jsx(Nd,{route:i})]}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8,px:11,py:7,borderRadius:12,border:`solid 1px ${r.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600},children:"Cheapest Fee"}),z.jsx(t.Tooltip,{onlyHover:!0,placement:"top",title:z.jsx(t.Box,{sx:{minWidth:200,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,typography:"h6",color:r.palette.text.secondary},children:d.map((e=>z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsx(t.Box,{children:e.title}),e.isFree?z.jsx(t.Box,{sx:{color:r.palette.primary.main},children:"Free"}):null!==e.value?z.jsxs(t.Box,{sx:{color:r.palette.text.primary},children:["~$",e.value]}):z.jsx(t.Box,{sx:{color:r.palette.text.primary},children:"-"})]},e.key)))}),children:z.jsxs(t.Box,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:4,px:8,py:4,border:`solid 1px ${r.palette.border.main}`,borderRadius:12},children:[z.jsx(oe.GasFee,{style:{color:r.palette.text.secondary,width:14,height:14}}),z.jsx(t.Box,{sx:{typography:"h6",lineHeight:"16px"},children:null!==p?`$${p}`:"-"})]})}),z.jsx(t.Tooltip,{onlyHover:!0,placement:"top",title:z.jsx(e.Trans,{id:"h5FVz1",message:"Estimated transaction time"}),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,px:8,py:4,border:`solid 1px ${r.palette.border.main}`,borderRadius:12,typography:"h6"},children:[z.jsx(oe.Time,{style:{color:r.palette.text.secondary,width:14,height:14}}),z.jsx(t.Box,{sx:{typography:"h6",lineHeight:"16px"},children:null!==u?Ds({start:Date.now(),end:Date.now()+1e3*u}):"-"})]})})]}),z.jsx(Ys,{feeUSD:p})]})]})})}_.initEccLib(b);const Ud={bech32:"tb",bip32:{private:70615956,public:70617039},messagePrefix:"Bitcoin Signed Message:\n",pubKeyHash:111,scriptHash:196,wif:239};function qd(e){return N(this,void 0,void 0,(function*(){const t=`https://mempool.space/signet/api/tx/${e}`,n=yield fetch(t);return yield n.json()}))}const Vd=520;function Wd(e){if(e<253)return Buffer.from([e]);const t=Buffer.alloc(3);return t.writeUInt8(253,0),t.writeUInt16LE(e,1),t}function Hd(e){return N(this,arguments,void 0,(function*({toAddress:e,amount:t,calldata:n,btcWallet:i,btcDepositFee:o}){var r;if(!i)throw new Error("btcWallet is undefined");i.balance.confirmed,console.log("btcWallet balance:",i.balance),console.log("btcWallet address:",i.address),console.log("btcWallet publicKey:",i.publicKey);const a=Buffer.from(i.publicKey.substr(2),"hex"),s=function(e){const t=[];let n=0;for(;n<e.length;){const i=Math.min(Vd,e.length-n),o=e.slice(n,n+i);t.push(o),n+=i}return t}(Buffer.from(n,"hex"));console.log("chunks:",s.length);const l=_.script.compile([a,_.opcodes.OP_CHECKSIG,_.opcodes.OP_FALSE,_.opcodes.OP_IF,...s.map((e=>e)),_.opcodes.OP_ENDIF]),d={output:l,redeemVersion:192},c=_.payments.p2tr({internalPubkey:a,scriptTree:d,redeem:d,network:Ud});console.log("scriptTaproot",c);const u=null===(r=c.witness)||void 0===r?void 0:r[c.witness.length-1].toString("hex");let p=yield function(e){return N(this,void 0,void 0,(function*(){const t=`https://mempool.space/signet/api/address/${e}/utxo`,n=yield fetch(t);return yield n.json()}))}(i.address);if(console.log("utxos:",p.length),!p.length)return"No UTXO";p=p.sort(((e,t)=>e.status.block_time-t.status.block_time)),console.log(p);const h=new _.Psbt({network:Ud});h.addOutput({script:c.output,value:t});let m=0;for(let e=0;e<p.length;e++){const t=p[e],n=yield qd(t.txid);console.log(e,n),m+=t.value,h.addInput({hash:t.txid,index:t.vout,witnessUtxo:{script:Buffer.from(n.vout[t.vout].scriptpubkey,"hex"),value:t.value}})}const x=m-t-o;if(x<0)throw new Error("Insufficient funds");console.log("change:",m,x),h.addOutput({address:i.address,value:x}),console.log("psbt.data.inputs:",h.data.inputs);const g=h.toHex();console.log("psbtHex:",g);const f=yield i.signPsbt(g);console.log("signPsbtResult:",f);const y=yield i.pushPsbt(f);console.log("tx:",y);const v=new _.Psbt({network:Ud}),{output:b}=_.payments.p2tr({internalPubkey:a,network:Ud,scriptTree:{output:l}});v.addInput({hash:y,index:0,tapLeafScript:[{controlBlock:Buffer.from(u,"hex"),leafVersion:c.redeemVersion,script:l}],witnessUtxo:{script:b,value:t}});const C=function(e,t){const n=[Buffer.alloc(64),e,t],i=[Wd(n.length)];for(const e of n)i.push(Wd(e.length)),i.push(e);return Buffer.concat(i)}(l,Buffer.from(u,"hex")),j=10+(80+Math.ceil(C.length/4))+31,w=Math.ceil(10*j);if(t-w<294)throw new Error("reveal would be dust");v.addOutput({address:e,value:t-w});const k=yield i.signPsbt(v.toHex(),{});console.log("signPsbtResult2:",k);const T=yield i.pushPsbt(k);return console.log("tx2:",T),y}))}function Zd({route:e,bridgeOrderTxRequest:i}){const a=qa(),{solanaWalletProvider:d,solanaConnection:c,bitcoinWalletProvider:u}=Pa(),p=us(),h=n.useCallback((()=>{if(i&&e)try{const{fromToken:n,toToken:h,fromAmount:m,toTokenAmount:x,fromChainId:g,toChainId:f,toAddress:y,slippage:v,roundedRouteCostTime:b,fees:C}=e,j=ir({input:m,decimals:n.decimals}),w=ir({input:x,decimals:h.decimals}),k=z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{token:n,marginRight:6,chainId:n.chainId}),`${j} ${null==n?void 0:n.symbol}`,z.jsx(t.Box,{component:oe.DoubleRight,sx:{width:12,height:12,mx:16}}),z.jsx(sl,{token:h,marginRight:6,chainId:h.chainId}),`${w} ${null==h?void 0:h.symbol}`]}),T=(t,n)=>N(this,void 0,void 0,(function*(){const o=yield function(e){return N(this,arguments,void 0,(function*({graphQLRequests:e,tx:t,route:n,calldata:i}){var o;const{sourceRoute:a}=n,s=D(null!=a?a:{},["approveTarget","encodeParams"]),l=Object.assign(Object.assign({fromHash:t},s),{calldata:i});return null===(o=(yield e.getData(r.SwapApi.graphql.cross_chain_swap_zetachain_orderCreate.toString(),{data:l})).cross_chain_swap_zetachain_orderCreate)||void 0===o?void 0:o.success}))}({graphQLRequests:a,tx:t,route:e,calldata:i.data});n&&n(t,{orderId:o})})),B={fromChainId:g,toChainId:f,fromTokenAddress:n.address,toTokenAddress:h.address,fromTokenSymbol:n.symbol,toTokenSymbol:h.symbol,fromTokenAmount:m,toTokenAmount:x.toString(),slippage:v,sendAccount:y,roundedRouteCostTime:b},E={[exports.MetadataFlag.crossChain]:!0},I=Object.assign(Object.assign(Object.assign({},i),{fromToken:n,toToken:h,pay:j,receive:w}),B),A=Ro.get(g);if(!A)throw new Error("fromChain is null");if(A.isBTCChain){if(!u)throw new Error("bitcoinWalletProvider is null");return p.executeCustom({brief:o.i18n._({id:"+uZnU3",message:"Cross Chain"}),subtitle:k,metadata:E,mixpanelProps:I,successBack:T,handler:e=>N(this,void 0,void 0,(function*(){var t;try{const n=null===(t=C.find((e=>"btcDepositFee"===e.type)))||void 0===t?void 0:t.amount,o=yield Hd({toAddress:i.to,amount:new s.BigNumber(i.value).toNumber(),calldata:i.data,btcWallet:u,btcDepositFee:n?Number(n):450});e.onSubmit(o),e.onSuccess(o)}catch(t){console.error("wallet.signPSBT execute:",t),e.onError(t)}}))})}if(A.isSolanaChain){if(!d||!c)throw console.error("solanaWalletProvider or solanaConnection is null",d,c),new Error("solanaWalletProvider or solanaConnection is null");return p.executeCustom({brief:o.i18n._({id:"+uZnU3",message:"Cross Chain"}),subtitle:k,metadata:E,mixpanelProps:I,successBack:T,handler:e=>N(this,void 0,void 0,(function*(){try{const t=function({data:e}){if(!e||"string"!=typeof e)throw new Error("Invalid transaction data");let t;if("undefined"!=typeof Buffer)t=new Uint8Array(Buffer.from(e,"base64"));else{const n=atob(e);t=new Uint8Array(n.length);for(let e=0;e<n.length;e++)t[e]=n.charCodeAt(e)}const n=l.Message.from(t);return l.Transaction.populate(n)}({data:i.data}),n=yield c.getLatestBlockhash();t.recentBlockhash=n.blockhash,t.feePayer=new l.PublicKey(i.from);const o=yield d.signTransaction(t),r=yield c.sendRawTransaction(o.serialize());e.onSubmit(r),e.onSuccess(r)}catch(t){if(l.TransactionExpiredBlockheightExceededError,t instanceof l.SendTransactionError){const e=yield t.getLogs(c);console.log("logs:",e)}console.error("wallet.sendTransaction execute:",t),e.onError(t)}}))})}return p.execute(o.i18n._({id:"+uZnU3",message:"Cross Chain"}),Object.assign({opcode:rs.TX},i),{subtitle:k,metadata:E,mixpanelProps:I,successBack:T})}catch(e){console.error(e)}}),[i,e,p,a,u,d,c]);return h}function zd({size:e="medium",toolDetails:n,nameMarginLeft:i=4,logoMarginLeft:o=0,nameSx:r}){if(!n||!n.logoURI||!n.name)return null;const{logoURI:a,name:s}=n,l=Pd.find((e=>e.id===s));return z.jsx(t.Box,{component:null==l?void 0:l.logoURI,style:{marginLeft:o,width:"large"===e?24:16,height:"large"===e?24:16}})}function $d({children:e}){const n=t.useTheme();return z.jsxs(t.Box,{sx:{position:"relative",width:"calc(100% - 16px)",mx:"auto"},children:[z.jsx(t.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",borderTopColor:n.palette.text.primary,borderTopWidth:1,borderTopStyle:"dashed","&:before":{content:'""',position:"absolute",left:0,top:-.5,backgroundColor:n.palette.text.primary,width:6,height:6,borderRadius:"50%",transform:"translate(-50%, -50%)"},"&:after":{display:{tablet:"block"},content:'""',position:"absolute",right:-1,top:-.5,width:0,height:0,transform:"translate(0, -50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:`6px solid ${n.palette.text.primary}`}}}),z.jsx(t.Box,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:e})]})}function Gd({chainId:i,token:o,amount:r}){var a;const s=t.useTheme(),l=n.useMemo((()=>Ro.get(i)),[i]);return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column"},children:[z.jsx(t.Box,{sx:{mb:8,display:"flex",alignItems:"flex-end",alignSelf:"center"},children:z.jsx(sl,{address:null!==(a=null==o?void 0:o.address)&&void 0!==a?a:"",marginRight:0,width:28,height:28,url:null==o?void 0:o.logoURI})}),z.jsxs(t.Box,{sx:{color:s.palette.text.primary,typography:"body1",fontWeight:600,width:"100%",wordBreak:"break-word",textAlign:"center"},children:[ir({input:r,decimals:null==o?void 0:o.decimals})," ",null==o?void 0:o.symbol]}),z.jsxs(t.Box,{sx:{color:s.palette.text.secondary,typography:"h6",alignSelf:"center"},children:[z.jsx(e.Trans,{id:"Fdp03t",message:"on"})," ",null==l?void 0:l.name]})]})}const Qd="en-US";var Yd,Xd,Kd,Jd={exports:{}};Jd.exports=(Yd="minute",Xd=/[+-]\d\d(?::?\d\d)?/g,Kd=/([+-]|\d\d)/g,function(e,t,n){var i=t.prototype;n.utc=function(e){return new t({date:e,utc:!0,args:arguments})},i.utc=function(e){var t=n(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),Yd):t},i.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=i.parse;i.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var r=i.init;i.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else r.call(this)};var a=i.utcOffset;i.utcOffset=function(e,t){var n=this.$utils().u;if(n(e))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof e&&(e=function(e){void 0===e&&(e="");var t=e.match(Xd);if(!t)return null;var n=(""+t[0]).match(Kd)||["-",0,0],i=n[0],o=60*+n[1]+ +n[2];return 0===o?0:"+"===i?o:-o}(e),null===e))return this;var i=Math.abs(e)<=16?60*e:e,o=this;if(t)return o.$offset=i,o.$u=0===e,o;if(0!==e){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(i+r,Yd)).$offset=i,o.$x.$localOffset=r}else o=this.utc();return o};var s=i.format;i.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return s.call(this,t)},i.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var l=i.toDate;i.toDate=function(e){return"s"===e&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var d=i.diff;i.diff=function(e,t,i){if(e&&this.$u===e.$u)return d.call(this,e,t,i);var o=this.local(),r=n(e).local();return d.call(o,r,t,i)}});var ec=U(Jd.exports),tc={exports:{}};tc.exports=function(){var e,t,n=1e3,i=6e4,o=36e5,r=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,l=2628e6,d=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,c={years:s,months:l,days:r,hours:o,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},u=function(e){return e instanceof y},p=function(e,t,n){return new y(e,n,t.$l)},h=function(e){return t.p(e)+"s"},m=function(e){return e<0},x=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},f=function(e,t){return e?m(e)?{negative:!0,format:""+g(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},y=function(){function m(e,t,n){var i=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return p(e*c[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){i.$d[h(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var o=e.match(d);if(o){var r=o.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*c[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=x(e/s),e%=s,this.$d.months=x(e/l),e%=l,this.$d.days=x(e/r),e%=r,this.$d.hours=x(e/o),e%=o,this.$d.minutes=x(e/i),e%=i,this.$d.seconds=x(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=f(this.$d.years,"Y"),t=f(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=f(n,"D"),o=f(this.$d.hours,"H"),r=f(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var s=f(a,"S"),l=e.negative||t.negative||i.negative||o.negative||r.negative||s.negative,d=o.format||r.format||s.format?"T":"",c=(l?"-":"")+"P"+e.format+t.format+i.format+d+o.format+r.format+s.format;return"P"===c||"-P"===c?"P0D":c},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(a,(function(e,t){return t||String(i[e])}))},g.as=function(e){return this.$ms/c[h(e)]},g.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?x(t/c[n]):this.$d[n],t||0},g.add=function(e,t,n){var i;return i=t?e*c[h(t)]:u(e)?e.$ms:p(e,this).$ms,p(this.$ms+i*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return p(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},m}(),v=function(e,t,n){return e.add(t.years()*n,"y").add(t.months()*n,"M").add(t.days()*n,"d").add(t.hours()*n,"h").add(t.minutes()*n,"m").add(t.seconds()*n,"s").add(t.milliseconds()*n,"ms")};return function(n,i,o){e=o,t=o().$utils(),o.duration=function(e,t){var n=o.locale();return p(e,{$l:n},t)},o.isDuration=u;var r=i.prototype.add,a=i.prototype.subtract;i.prototype.add=function(e,t){return u(e)?v(this,e,1):r.bind(this)(e,t)},i.prototype.subtract=function(e,t){return u(e)?v(this,e,-1):a.bind(this)(e,t)}}}();var nc=U(tc.exports),ic={exports:{}};ic.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,n,i){var o=n.prototype,r=o.format;i.en.formats=e,o.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,i=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,i,o){var r=o&&o.toUpperCase();return i||n[o]||e[o]||n[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,void 0===n?{}:n);return r.call(this,i)}}}();var oc=U(ic.exports);function rc({locale:t,children:i}){return n.useEffect((()=>{(()=>{N(this,void 0,void 0,(function*(){yield function(){return N(this,arguments,void 0,(function*(e=Qd){try{const t=yield import(`./locales/${e}.js`);o.i18n.load(e,t.messages||t.default.messages)}catch(e){}o.i18n.activate(e)}))}(t)}))})()}),[t]),z.jsx(e.I18nProvider,{i18n:o.i18n,children:i})}j.extend(ec),j.extend(nc),j.extend(oc);const ac=new c.QueryClient({defaultOptions:{queries:{structuralSharing:!1}}});var sc,lc={exports:{}},dc={exports:{}},cc={};var uc,pc,hc,mc,xc,gc,fc,yc,vc,bc,Cc,jc,wc,kc,Tc={};
|
|
19
|
+
/** @license React v16.13.1
|
|
20
|
+
* react-is.development.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/function Bc(){return pc||(pc=1,"production"===process.env.NODE_ENV?dc.exports=function(){if(sc)return cc;sc=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case l:case d:case i:case r:case o:case u:return e;default:switch(e=e&&e.$$typeof){case s:case c:case m:case h:case a:return e;default:return p}}case n:return p}}}function b(e){return v(e)===d}return cc.AsyncMode=l,cc.ConcurrentMode=d,cc.ContextConsumer=s,cc.ContextProvider=a,cc.Element=t,cc.ForwardRef=c,cc.Fragment=i,cc.Lazy=m,cc.Memo=h,cc.Portal=n,cc.Profiler=r,cc.StrictMode=o,cc.Suspense=u,cc.isAsyncMode=function(e){return b(e)||v(e)===l},cc.isConcurrentMode=b,cc.isContextConsumer=function(e){return v(e)===s},cc.isContextProvider=function(e){return v(e)===a},cc.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},cc.isForwardRef=function(e){return v(e)===c},cc.isFragment=function(e){return v(e)===i},cc.isLazy=function(e){return v(e)===m},cc.isMemo=function(e){return v(e)===h},cc.isPortal=function(e){return v(e)===n},cc.isProfiler=function(e){return v(e)===r},cc.isStrictMode=function(e){return v(e)===o},cc.isSuspense=function(e){return v(e)===u},cc.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===r||e===o||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===c||e.$$typeof===g||e.$$typeof===f||e.$$typeof===y||e.$$typeof===x)},cc.typeOf=v,cc}():dc.exports=(uc||(uc=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var x=e.type;switch(x){case l:case d:case i:case r:case o:case u:return x;default:var g=x&&x.$$typeof;switch(g){case s:case c:case m:case h:case a:return g;default:return p}}case n:return p}}}var b=l,C=d,j=s,w=a,k=t,T=c,B=i,E=m,I=h,A=n,S=r,L=o,M=u,R=!1;function O(e){return v(e)===d}Tc.AsyncMode=b,Tc.ConcurrentMode=C,Tc.ContextConsumer=j,Tc.ContextProvider=w,Tc.Element=k,Tc.ForwardRef=T,Tc.Fragment=B,Tc.Lazy=E,Tc.Memo=I,Tc.Portal=A,Tc.Profiler=S,Tc.StrictMode=L,Tc.Suspense=M,Tc.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),O(e)||v(e)===l},Tc.isConcurrentMode=O,Tc.isContextConsumer=function(e){return v(e)===s},Tc.isContextProvider=function(e){return v(e)===a},Tc.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Tc.isForwardRef=function(e){return v(e)===c},Tc.isFragment=function(e){return v(e)===i},Tc.isLazy=function(e){return v(e)===m},Tc.isMemo=function(e){return v(e)===h},Tc.isPortal=function(e){return v(e)===n},Tc.isProfiler=function(e){return v(e)===r},Tc.isStrictMode=function(e){return v(e)===o},Tc.isSuspense=function(e){return v(e)===u},Tc.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===r||e===o||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===c||e.$$typeof===g||e.$$typeof===f||e.$$typeof===y||e.$$typeof===x)},Tc.typeOf=v}()),Tc)),dc.exports}
|
|
27
|
+
/*
|
|
28
|
+
object-assign
|
|
29
|
+
(c) Sindre Sorhus
|
|
30
|
+
@license MIT
|
|
31
|
+
*/function Ec(){if(mc)return hc;mc=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return hc=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(i,o){for(var r,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(i),l=1;l<arguments.length;l++){for(var d in r=Object(arguments[l]))t.call(r,d)&&(s[d]=r[d]);if(e){a=e(r);for(var c=0;c<a.length;c++)n.call(r,a[c])&&(s[a[c]]=r[a[c]])}}return s},hc}function Ic(){if(gc)return xc;gc=1;return xc="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Ac(){return yc?fc:(yc=1,fc=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var Sc=Bc();lc.exports=function(){if(jc)return Cc;jc=1;var e=Bc(),t=Ec(),n=Ic(),i=Ac(),o=function(){if(bc)return vc;bc=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Ic(),n={},i=Ac();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,r,a,s,l){if("production"!==process.env.NODE_ENV)for(var d in o)if(i(o,d)){var c;try{if("function"!=typeof o[d]){var u=Error((s||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=o[d](r,d,s,a,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var p=l?l():"";e("Failed "+a+" type: "+c.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},vc=o}(),r=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(r=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Cc=function(s,l){var d="function"==typeof Symbol&&Symbol.iterator,c="@@iterator",u="<<anonymous>>",p={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:x(a),arrayOf:function(e){return x((function(t,i,o,r,a){if("function"!=typeof e)return new m("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[i];if(!Array.isArray(s))return new m("Invalid "+r+" `"+a+"` of type `"+v(s)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<s.length;l++){var d=e(s,l,o,r,a+"["+l+"]",n);if(d instanceof Error)return d}return null}))},element:x((function(e,t,n,i,o){var r=e[t];return s(r)?null:new m("Invalid "+i+" `"+o+"` of type `"+v(r)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:x((function(t,n,i,o,r){var a=t[n];return e.isValidElementType(a)?null:new m("Invalid "+o+" `"+r+"` of type `"+v(a)+"` supplied to `"+i+"`, expected a single ReactElement type.")})),instanceOf:function(e){return x((function(t,n,i,o,r){if(!(t[n]instanceof e)){var a=e.name||u;return new m("Invalid "+o+" `"+r+"` of type `"+((s=t[n]).constructor&&s.constructor.name?s.constructor.name:u)+"` supplied to `"+i+"`, expected instance of `"+a+"`.")}var s;return null}))},node:x((function(e,t,n,i,o){return y(e[t])?null:new m("Invalid "+i+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return x((function(t,o,r,a,s){if("function"!=typeof e)return new m("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[o],d=v(l);if("object"!==d)return new m("Invalid "+a+" `"+s+"` of type `"+d+"` supplied to `"+r+"`, expected an object.");for(var c in l)if(i(l,c)){var u=e(l,c,r,a,s+"."+c,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){return Array.isArray(e)?x((function(t,n,i,o,r){for(var a=t[n],s=0;s<e.length;s++)if(h(a,e[s]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new m("Invalid "+o+" `"+r+"` of value `"+String(a)+"` supplied to `"+i+"`, expected one of "+l+".")})):("production"!==process.env.NODE_ENV&&r(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&r("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+C(o)+" at index "+t+"."),a}return x((function(t,o,r,a,s){for(var l=[],d=0;d<e.length;d++){var c=(0,e[d])(t,o,r,a,s,n);if(null==c)return null;c.data&&i(c.data,"expectedType")&&l.push(c.data.expectedType)}return new m("Invalid "+a+" `"+s+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return x((function(t,i,o,r,a){var s=t[i],l=v(s);if("object"!==l)return new m("Invalid "+r+" `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var d in e){var c=e[d];if("function"!=typeof c)return f(o,r,a,d,b(c));var u=c(s,d,o,r,a+"."+d,n);if(u)return u}return null}))},exact:function(e){return x((function(o,r,a,s,l){var d=o[r],c=v(d);if("object"!==c)return new m("Invalid "+s+" `"+l+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var u=t({},o[r],e);for(var p in u){var h=e[p];if(i(e,p)&&"function"!=typeof h)return f(a,s,l,p,b(h));if(!h)return new m("Invalid "+s+" `"+l+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var x=h(d,p,a,s,l+"."+p,n);if(x)return x}return null}))}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function x(e){if("production"!==process.env.NODE_ENV)var t={},i=0;function o(o,a,s,d,c,p,h){if(d=d||u,p=p||s,h!==n){if(l){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=d+":"+s;!t[g]&&i<3&&(r("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+d+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,i++)}}return null==a[s]?o?null===a[s]?new m("The "+c+" `"+p+"` is marked as required in `"+d+"`, but its value is `null`."):new m("The "+c+" `"+p+"` is marked as required in `"+d+"`, but its value is `undefined`."):null:e(a,s,d,c,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(e){return x((function(t,n,i,o,r,a){var s=t[n];return v(s)!==e?new m("Invalid "+o+" `"+r+"` of type `"+b(s)+"` supplied to `"+i+"`, expected `"+e+"`.",{expectedType:e}):null}))}function f(e,t,n,i,o){return new m((e||"React class")+": "+t+" type `"+n+"."+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function y(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(y);if(null===e||s(e))return!0;var t=function(e){var t=e&&(d&&e[d]||e[c]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,i=t.call(e);if(t!==e.entries){for(;!(n=i.next()).done;)if(!y(n.value))return!1}else for(;!(n=i.next()).done;){var o=n.value;if(o&&!y(o[1]))return!1}return!0;default:return!1}}function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function C(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},Cc}()(Sc.isElement,!0)}else lc.exports=function(){if(kc)return wc;kc=1;var e=Ic();function t(){}function n(){}return n.resetWarningCache=t,wc=function(){function i(t,n,i,o,r,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var Lc=U(lc.exports);function Mc(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}function Rc(e,t,n,i,o){const r=e[t],a=o||t;if(null==r||"undefined"==typeof window)return null;let s;const l=r.type;return"function"!=typeof l||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(l)||(s="Did you accidentally use a plain function component for an element instead?"),void 0!==s?new Error(`Invalid ${i} \`${a}\` supplied to \`${n}\`. Expected an element that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const Oc=Mc(Lc.element,Rc);Oc.isRequired=Mc(Lc.element.isRequired,Rc);const Pc="exact-prop: ";function _c(e){return e&&e.ownerDocument||document}const Dc="undefined"!=typeof window?P.useLayoutEffect:P.useEffect;function Nc(e){const t=P.useRef(e);return Dc((()=>{t.current=e})),P.useRef(((...e)=>(0,t.current)(...e))).current}function Fc(...e){return P.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{!function(e,t){"function"==typeof e?e(t):e&&(e.current=t)}(e,t)}))}),e)}const Uc={};const qc=[];class Vc{static create(){return new Vc}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Wc(){const e=function(e,t){const n=P.useRef(Uc);return n.current===Uc&&(n.current=e(t)),n}(Vc.create).current;var t;return t=e.disposeEffect,P.useEffect(t,qc),e}const Hc={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Zc(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function zc(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zc(e))&&(i&&(i+=" "),i+=t);return i}function $c(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter((n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n))).forEach((t=>{n[t]=e[t]})),n}function Gc(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t]))).forEach((n=>{t[n]=e[n]})),t}function Qc(e){const{elementType:t,externalSlotProps:n,ownerState:i,skipResolvingSlotProps:o=!1,...r}=e,a=o?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(n,i),{props:s,internalRef:l}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:i,externalForwardedProps:o,className:r}=e;if(!t){const e=zc(n?.className,r,o?.className,i?.className),t={...n?.style,...o?.style,...i?.style},a={...n,...o,...i};return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=$c({...o,...i}),s=Gc(i),l=Gc(o),d=t(a),c=zc(d?.className,n?.className,r,o?.className,i?.className),u={...d?.style,...n?.style,...o?.style,...i?.style},p={...d,...n,...l,...s};return c.length>0&&(p.className=c),Object.keys(u).length>0&&(p.style=u),{props:p,internalRef:d.ref}}({...r,externalSlotProps:a}),d=function(e,t,n){return void 0===e||"string"==typeof e?t:{...t,ownerState:{...t.ownerState,...n}}}(t,{...s,ref:Fc(l,a?.ref,e.additionalProps?.ref)},i);return d}function Yc(e){return e.substring(2).toLowerCase()}function Xc(e){const{children:t,disableReactTree:n=!1,mouseEvent:i="onClick",onClickAway:o,touchEvent:r="onTouchEnd"}=e,a=P.useRef(!1),s=P.useRef(null),l=P.useRef(!1),d=P.useRef(!1);P.useEffect((()=>(setTimeout((()=>{l.current=!0}),0),()=>{l.current=!1})),[]);const c=Fc((u=t)&&P.isValidElement(u)?u.props.propertyIsEnumerable("ref")?u.props.ref:u.ref:null,s);var u;const p=Nc((e=>{const t=d.current;d.current=!1;const i=_c(s.current);if(!l.current||!s.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,i))return;if(a.current)return void(a.current=!1);let r;r=e.composedPath?e.composedPath().indexOf(s.current)>-1:!i.documentElement.contains(e.target)||s.current.contains(e.target),r||!n&&t||o(e)})),h=e=>n=>{d.current=!0;const i=t.props[e];i&&i(n)},m={ref:c};return!1!==r&&(m[r]=h(r)),P.useEffect((()=>{if(!1!==r){const e=Yc(r),t=_c(s.current),n=()=>{a.current=!0};return t.addEventListener(e,p),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,p),t.removeEventListener("touchmove",n)}}}),[p,r]),!1!==i&&(m[i]=h(i)),P.useEffect((()=>{if(!1!==i){const e=Yc(i),t=_c(s.current);return t.addEventListener(e,p),()=>{t.removeEventListener(e,p)}}}),[p,i]),z.jsx(P.Fragment,{children:P.cloneElement(t,m)})}"production"!==process.env.NODE_ENV&&(Xc.propTypes={children:Oc.isRequired,disableReactTree:Lc.bool,mouseEvent:Lc.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:Lc.func.isRequired,touchEvent:Lc.oneOf(["onTouchEnd","onTouchStart",!1])}),"production"!==process.env.NODE_ENV&&(Xc.propTypes=function(e){return"production"===process.env.NODE_ENV?e:{...e,[Pc]:t=>{const n=Object.keys(t).filter((t=>!e.hasOwnProperty(t)));return n.length>0?new Error(`The following props are not supported: ${n.map((e=>`\`${e}\``)).join(", ")}. Please remove them.`):null}}}(Xc.propTypes));const Kc="base";function Jc(e,t){const n=Hc[t];return n?`${Kc}--${n}`:function(e,t){return`${Kc}-${e}-${t}`}(e,t)}const eu="Snackbar";function tu(e){return Jc(eu,e)}!function(e,t){const n={};t.forEach((t=>{n[t]=Jc(e,t)}))}(eu,["root"]);const nu={disableDefaultClasses:!1},iu=P.createContext(nu);"production"!==process.env.NODE_ENV&&(iu.displayName="ClassNameConfiguratorContext");const ou=()=>function(e,t,n){const i={};for(const o in e){const r=e[o];let a="";for(let e=0;e<r.length;e+=1){const i=r[e];i&&(a+=t(i)+" ",n&&n[i]&&(a+=n[i]+" "))}i[o]=a}return i}({root:["root"]},function(e){const{disableDefaultClasses:t}=P.useContext(iu);return n=>t?"":e(n)}(tu)),ru=P.forwardRef((function(e,t){const{autoHideDuration:n=null,children:i,disableWindowBlurListener:o=!1,exited:r=!0,onBlur:a,onClose:s,onFocus:l,onMouseEnter:d,onMouseLeave:c,open:u,resumeHideDuration:p,slotProps:h={},slots:m={},...x}=e,g=ou(),{getRootProps:f,onClickAway:y}=function(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:i,open:o,resumeHideDuration:r}=e,a=Wc();P.useEffect((()=>{if(o)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&i?.(e,"escapeKeyDown")}}),[o,i]);const s=Nc(((e,t)=>{i?.(e,t)})),l=Nc((e=>{i&&null!=e&&a.start(e,(()=>{s(null,"timeout")}))}));P.useEffect((()=>(o&&l(t),a.clear)),[o,t,l,a]);const d=a.clear,c=P.useCallback((()=>{null!=t&&l(null!=r?r:.5*t)}),[t,r,l]),u=e=>t=>{const n=e.onFocus;n?.(t),d()},p=e=>t=>{const n=e.onMouseEnter;n?.(t),d()},h=e=>t=>{const n=e.onMouseLeave;n?.(t),c()};return P.useEffect((()=>{if(!n&&o)return window.addEventListener("focus",c),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",c),window.removeEventListener("blur",d)}}),[n,o,c,d]),{getRootProps:(t={})=>{const n={...$c(e),...$c(t)};return{role:"presentation",...t,...n,onBlur:(i=n,e=>{const t=i.onBlur;t?.(e),c()}),onFocus:u(n),onMouseEnter:p(n),onMouseLeave:h(n)};var i},onClickAway:e=>{i?.(e,"clickaway")}}}({...e,autoHideDuration:n,disableWindowBlurListener:o,onClose:s,open:u,resumeHideDuration:p}),v=e,b=m.root||"div",C=Qc({elementType:b,getSlotProps:f,externalForwardedProps:x,externalSlotProps:h.root,additionalProps:{ref:t},ownerState:v,className:g.root}),j=Qc({elementType:Xc,externalSlotProps:h.clickAwayListener,additionalProps:{onClickAway:y},ownerState:v});return delete j.ownerState,!u&&r?null:z.jsx(Xc,{...j,children:z.jsx(b,{...C,children:i})})}));function au({size:e,color:i,time:o,strokeWidth:r=2,sx:a}){const[s,l]=n.useState("0 1069"),d=e/2,c=d-1;return n.useEffect((()=>{l(2*Math.PI*c+" 0")}),[]),z.jsx(t.Box,{width:e,height:e,component:"svg",sx:Object.assign({position:"absolute",top:`-${r}`,left:`-${r}`,transform:"rotate(-90deg)"},a),children:z.jsx(t.Box,{component:"circle",cx:d,cy:d,r:c,strokeWidth:r,stroke:i,fill:"none",strokeDasharray:s,sx:{transition:`stroke-dasharray ${o}`}})})}"production"!==process.env.NODE_ENV&&(ru.propTypes={autoHideDuration:Lc.number,children:Lc.node,disableWindowBlurListener:Lc.bool,exited:Lc.bool,onClose:Lc.func,open:Lc.bool,resumeHideDuration:Lc.number,slotProps:Lc.shape({clickAwayListener:Lc.oneOfType([Lc.func,Lc.shape({children:Lc.element.isRequired,disableReactTree:Lc.bool,mouseEvent:Lc.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:Lc.func,touchEvent:Lc.oneOf(["onTouchEnd","onTouchStart",!1])})]),root:Lc.oneOfType([Lc.func,Lc.object])}),slots:Lc.shape({root:Lc.elementType})});var su=n.memo(au);const lu=u.create((e=>({notify:null,toast:t=>{e({notify:t})},close:()=>{e({notify:null})}}))),du={entering:"translateX(0)",entered:"translateX(0)",exiting:"translateX(500px)",exited:"translateX(500px)",unmounted:"translateX(500px)"};function cu(){const e=t.useTheme(),{notify:i,close:o}=lu(),[r,a]=n.useState(!0),s=n.useRef(null),l=null==i?void 0:i.timeout,d=!!i;let c=z.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("circle",{cx:"18",cy:"18",r:"16.5",stroke:"#2FBA90",strokeWidth:"3"}),z.jsx("path",{d:"M25.1384 11.334L14.8873 21.5851L10.8584 17.5718L8.66504 19.7651L14.8873 25.9873L27.3317 13.5429L25.1384 11.334Z",fill:"#2FBA90"})]});switch(null==i?void 0:i.type){case"error":c=z.jsxs("svg",{width:"36",height:"37",viewBox:"0 0 36 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("circle",{cx:"18",cy:"18.5",r:"16.5",stroke:"#FF6187",strokeWidth:"3"}),z.jsx("path",{d:"M25.3331 13.0452L19.8782 18.5L25.3331 23.9548L23.5148 25.7731L18.06 20.3183L12.6051 25.7731L10.7869 23.9548L16.2417 18.5L10.7869 13.0452L12.6051 11.2269L18.06 16.6817L23.5148 11.2269L25.3331 13.0452Z",fill:"#FF6187"})]});break;case"warning":c=z.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.4065 3.6189L9.62438 3.59576L3.39812 9.78928L3.37498 18.5714L9.5685 24.7976L18.3506 24.8208L24.5769 18.6273L24.6 9.84516L18.4065 3.6189ZM26.9359 8.88481L19.3791 1.28812L8.66403 1.25988L1.06734 8.81663L1.0391 19.5317L8.59585 27.1284L19.311 27.1567L26.9076 19.5999L26.9359 8.88481Z",fill:"#B15600"}),z.jsx("path",{d:"M15.1664 7.58398H12.8331V16.9173H15.1664V7.58398Z",fill:"#B15600"}),z.jsx("path",{d:"M13.9998 21.6395C14.8896 21.6395 15.6109 20.9181 15.6109 20.0283C15.6109 19.1386 14.8896 18.4172 13.9998 18.4172C13.11 18.4172 12.3887 19.1386 12.3887 20.0283C12.3887 20.9181 13.11 21.6395 13.9998 21.6395Z",fill:"#B15600"})]})}return z.jsx(t.Box,{component:ru,open:d,autoHideDuration:l,onClose:(e,t)=>{"clickaway"!==t&&o()},exited:r,sx:{position:"fixed",top:20,left:20,right:20,zIndex:1,[e.breakpoints.up("tablet")]:{left:"auto"}},children:z.jsx(k.Transition,{timeout:{enter:400,exit:400},in:d,appear:!0,unmountOnExit:!0,onEnter:()=>{a(!1)},onExited:()=>{a(!0)},nodeRef:s,children:n=>z.jsxs(t.Box,{ref:s,sx:{display:"flex",justifyContent:"space-between",p:12,borderRadius:8,backgroundColor:"background.paper",color:"text.primary",border:"solid 1px",borderColor:"border.main",boxShadow:"0px 6px 12px 0px rgba(0, 0, 0, 0.10)",transform:du[n],transition:"transform 300ms ease",[e.breakpoints.up("tablet")]:{p:20,width:"auto",maxWidth:328}},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{sx:{mt:7,"& > svg":{width:28,height:28},[e.breakpoints.up("tablet")]:{"& > svg":{width:36,height:36}}},children:i?c:""}),z.jsxs(t.Box,{sx:{ml:20},children:[z.jsx(t.Box,{sx:{typography:"caption"},children:null==i?void 0:i.message}),(null==i?void 0:i.link)?z.jsxs(t.Box,{component:"a",target:"_blank",rel:"noopener noreferrer",href:i.link.outerLink,sx:{display:"inline-flex",alignItems:"center",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},children:[i.link.text,z.jsx(t.Box,{component:"svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{ml:4,width:18,height:18},children:z.jsx("path",{d:"M4.22703 13.2122L10.6811 6.75812L4.75206 6.75812L4.75736 5.25729H13.2426V13.7426H11.7471L11.7418 7.81878L5.28769 14.2729L4.22703 13.2122Z",fill:"currentColor"})})]}):"",(null==i?void 0:i.content)?z.jsx(t.Box,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:i.content}):""]})]}),z.jsxs(t.Box,{sx:{position:"relative",top:10,ml:12,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:12,borderStyle:"solid",borderWidth:l?"2.4px":0,borderColor:e.palette.border.main,backgroundColor:l?"transparent":e.palette.background.paperDarkContrast,cursor:"pointer",boxSizing:"border-box",[e.breakpoints.up("tablet")]:{ml:28}},onClick:o,children:[l?z.jsx(su,{size:24,strokeWidth:"2.4px",time:`${l}ms`,color:e.palette.text.disabled}):"",z.jsx(t.Box,{component:"svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:16,height:16,border:"none",color:e.palette.text.disabled},children:z.jsx("g",{children:z.jsx("path",{d:"M12.8897 4.36345L9.25313 8L12.8897 11.6365L11.6775 12.8487L8.04095 9.21218L4.4044 12.8487L3.19221 11.6365L6.82876 8L3.19221 4.36345L4.4044 3.15127L8.04095 6.78782L11.6775 3.15127L12.8897 4.36345Z",fill:"currentColor"})})})]})]})})})}var uu;function pu(){return pu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pu.apply(null,arguments)}const hu=e=>P.createElement("svg",pu({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),uu||(uu=P.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},P.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},P.createElement("g",{transform:"translate(18.000000, 291.000000)"},P.createElement("g",{transform:"translate(40.000000, 83.000000)"},P.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"}))))))),mu=6;function xu(){var e;const n=t.useTheme();return z.jsx(t.Box,{sx:{mx:"auto",border:`${mu}px solid ${null===(e=n.palette)||void 0===e?void 0:e.background.input}`,borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:z.jsx(t.Box,{component:hu,sx:{position:"absolute",top:`-${mu}px`,right:`-${mu}px`,color:"primary.main"}})})}function gu({showingDone:e,errorMessage:n}){return t.useTheme(),n?z.jsx(t.Box,{component:oe.ErrorWarn,sx:{width:64,height:64,color:"error.main"}}):e?z.jsx(t.Box,{component:oe.DoneBorder,sx:{width:64,height:64,color:"success.main"}}):z.jsx(xu,{})}function fu({showingDone:e,showing:n}){return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[z.jsx(t.Box,{sx:{mt:60},children:e?o.i18n._({id:"4xbbt/",message:"{0} confirmed",values:{0:null==n?void 0:n.brief}}):o.i18n._({id:"/nzjSF",message:"{0} pending",values:{0:null==n?void 0:n.brief}})}),(null==n?void 0:n.subtitle)?z.jsx(t.Box,{sx:{mt:20,typography:"body2"},children:null==n?void 0:n.subtitle}):""]})}function yu({isStarted:i,isEnded:o,tx:r}){const[a,s]=n.useState(0),{chainId:l}=Pa(),d=n.useMemo((()=>`https://${Ai[l||1]}/tx/${r}`),[r,l]),c=n.useMemo((()=>{const e=Math.floor(a/60),t=a%60;return e?`${e}m ${t}s`:`${t}s`}),[a]),u=n.useRef();return n.useEffect((()=>(i&&(s(0),window.clearInterval(u.current),u.current=window.setInterval((()=>{s((e=>e+1))}),1e3)),()=>{window.clearInterval(u.current)})),[i]),n.useEffect((()=>{o&&window.clearInterval(u.current)}),[o]),z.jsxs(t.Box,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[z.jsxs(t.Box,{children:[z.jsx(e.Trans,{id:"+Jkdiu",message:"Transaction Time:"}),c]}),z.jsxs(t.HoverOpacity,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:d,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(e.Trans,{id:"S3piC2",message:"Tx"}),z.jsx(t.Box,{component:oe.ArrowTopRightBorder,sx:{width:16,height:16,ml:6}})]})]})}function vu(n){var{children:i,executionStatus:r,showSubmitLoadingDialog:a}=n;const s=ss(D(n,["children","executionStatus","showSubmitLoadingDialog"])),{ctxVal:l,showing:d,closeShowing:c,setShowing:u,showingDone:p,errorMessage:h,transactionTx:m}=Object.assign(Object.assign({},s),r),{isMobile:x}=Xa(),{noSubmissionDialog:g,submissionDialogModal:f}=Q(),y=()=>{u((e=>{if(!e)return e;const t=Object.assign({},e);return delete t.submitState,t}))};return z.jsxs(cs.Provider,{value:l,children:[i,a&&z.jsx(el,{modal:!0,open:!!(null==d?void 0:d.submitState),onClose:y,children:!!d&&z.jsxs(t.Box,{sx:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:20,p:20,minHeight:208,width:x?"100%":340,textAlign:"center"},children:[z.jsxs(t.Box,{sx:{textAlign:"center",color:"text.secondary"},children:[d.brief,z.jsx(t.Box,{component:oe.Error,sx:{position:"absolute",top:20,right:20,color:"text.secondary",cursor:"pointer"},onClick:y})]}),"submitted"===d.submitState?z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{component:oe.ArrowSubmit,sx:{width:64,height:64}}),z.jsxs("div",{children:[z.jsx("div",{children:o.i18n._({id:"EcVqOR",message:"{0} Submitted",values:{0:d.brief}})}),d.subtitle&&z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:d.subtitle})]}),z.jsx(t.Button,{variant:t.Button.Variant.outlined,fullWidth:!0,onClick:y,sx:{mt:4},children:z.jsx(e.Trans,{id:"zga9sT",message:"OK"})})]}):z.jsxs(z.Fragment,{children:[z.jsx(xu,{}),z.jsxs("div",{children:[z.jsx(t.Box,{children:z.jsx(e.Trans,{id:"7y/8M6",message:"Please confirm in wallet"})}),d.subtitle&&z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:d.subtitle})]})]})]})}),z.jsx(el,{open:!!d&&"loading"!==d.submitState&&!g,onClose:c,id:"submission",modal:!!x||f,children:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto",width:x?void 0:f?340:void 0},children:[z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{textAlign:"center",pt:60},children:z.jsx(gu,{showingDone:p,errorMessage:h})}),h?z.jsxs(t.Box,{sx:{textAlign:"center",mt:60},children:[z.jsx(t.Box,{children:z.jsx(e.Trans,{id:"kf83Ld",message:"Something went wrong."})}),z.jsx(t.Box,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:h})]}):z.jsxs(z.Fragment,{children:[z.jsx(fu,{showingDone:p,showing:d}),z.jsx(yu,{isStarted:!!d,isEnded:p,tx:m})]})]}),z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.big,onClick:()=>{Ha(Va.Initial),c()},sx:{mt:20},children:h?z.jsx(e.Trans,{id:"1QfxQT",message:"Dismiss"}):z.jsx(e.Trans,{id:"yz7wBu",message:"Close"})})]})})]})}const bu="dodo-widget-container";function Cu(e){return e.noLangProvider?z.jsx(z.Fragment,{children:e.children}):z.jsx(rc,{locale:e.locale,children:z.jsx(vu,{...e,children:e.children})})}function ju(e){return nl(e),Qa(),function(){const{chainId:e,evmProvider:t}=Pa();n.useEffect((()=>{const n=n=>{if(n===e){const e=Ro.get(n);if(null==e?void 0:e.isEVMChain)return t}return null},i=new w.ContractRequests({multiCallAddressList:p.multiCallAddressList,getProvider:n,rpc:Ii()});Wi.setGetConfigProvider(n),p.setContractRequests(i),r.setContractRequests(i)}),[e,t])}(),e.noUI?z.jsx(Cu,{...e,children:e.children}):null}function wu(e){var t;const i=n.useRef(null);return z.jsx(G,{...Object.assign(Object.assign({},e),{widgetRef:null!==(t=e.widgetRef)&&void 0!==t?t:i}),children:z.jsx(ju,{...e})})}function ku(e){var{sx:i}=e,o=D(e,["sx"]);const{width:r}=Q(),a=n.useMemo((()=>{let e="";return"number"==typeof r?e=`${r}px`:r&&(e=r),e?`calc(${e} - 40px)`:"auto"}),[r]);return z.jsx(t.QuestionTooltip,{container:document.querySelector(`.${bu}`),maxWidth:a,sx:Object.assign({cursor:"help"},i),...o})}function Tu({route:i}){const o=t.useTheme();Ro.get(i.fromChainId);const r=Ro.get(i.toChainId),[a,s]=n.useState(!1),[l,d]=n.useState(!1),c=Rs({fees:i.fees});return z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{py:20,borderStyle:"solid",borderWidth:o.spacing(1,0,0),borderColor:o.palette.border.main},children:z.jsx(t.Accordion,{children:z.jsx(t.AccordionItem,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.primary"},children:[z.jsx(t.Box,{component:oe.DetailBorder,sx:{mr:6,width:18,height:18}}),z.jsx(e.Trans,{id:"rRDi3Y",message:"Detail"})]}),z.jsx(t.Box,{component:oe.CaretUp,sx:{width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]}),children:z.jsxs(t.Box,{sx:{mt:16},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsx(t.Box,{sx:{typography:"body2",color:"text.secondary",flexShrink:0},children:z.jsx(e.Trans,{id:"lt8yMa",message:"Send to:"})}),z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[r?z.jsx(t.Box,{component:r.logo,sx:{width:18,height:18}}):null,z.jsx(t.Box,{sx:{display:"inline-block",mx:6,width:"1px",height:12,backgroundColor:"border.main"}}),z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600},children:Ea(i.toAddress)}),z.jsx(t.HoverOpacity,{component:"a",href:Ia(i.toChainId,i.toAddress,"address"),target:"_blank",rel:"noopener noreferrer",sx:{ml:6,width:18,height:18,color:"text.secondary",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:z.jsx(t.Box,{component:oe.ArrowTopRightBorder,sx:{width:18,height:18}})})]})]}),z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:z.jsx(e.Trans,{id:"sMMlTX",message:"Total fees"})}),z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>s(!a),sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4,typography:"body2",color:"text.primary"},children:[z.jsx(t.Box,{sx:{fontWeight:600,color:o.palette.text.primary},children:i.feeUSD?`~$${i.feeUSD}`:"-"}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:a?z.jsx("path",{d:"M3.75 11.2663L4.98375 12.5L9 8.4925L13.0162 12.5L14.25 11.2663L9 6.01625L3.75 11.2663Z",fill:"currentColor",fillOpacity:"0.5"}):z.jsx("path",{d:"M14.25 7.73375L13.0163 6.5L9 10.5075L4.98375 6.5L3.75 7.73375L9 12.9838L14.25 7.73375Z",fill:"currentColor",fillOpacity:"0.5"})})]})]}),a&&c.map((e=>z.jsxs(t.Box,{sx:{mt:8,pl:22,pr:22,display:"flex",alignItems:"center",justifyContent:"space-between",color:"text.secondary",typography:"body2",position:"relative"},children:[z.jsx(t.Box,{component:"svg",xmlns:"http://www.w3.org/2000/svg",width:"10",height:"25",viewBox:"0 0 10 25",fill:"none",sx:{width:10,height:25,position:"absolute",left:10,bottom:10},children:z.jsx("path",{d:"M9 24L2 24C1.44772 24 1 23.5523 1 23L1 1",stroke:"currentColor",strokeOpacity:"0.5",strokeLinecap:"round",strokeDasharray:"2 2"})}),z.jsx(t.Box,{sx:{flex:1},children:e.title}),e.isFree?z.jsx(t.Box,{sx:{color:o.palette.primary.main},children:"Free"}):null!==e.value?z.jsxs(t.Box,{sx:{color:o.palette.text.primary},children:["~$",e.value]}):z.jsx(t.Box,{sx:{color:o.palette.text.primary},children:"-"})]},e.title))),z.jsxs(t.Box,{sx:{mt:8,mb:l?8:0,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"body2",fontWeight:600,color:"success.main",flexShrink:0},children:"Fee comparison"}),z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>d(!l),sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4,typography:"body2",color:"text.primary"},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:o.palette.text.primary},children:"ZUNO"}),z.jsx(t.Box,{sx:{px:8,borderRadius:12,backgroundColor:o.palette.success.main,typography:"h6",fontWeight:600,color:o.palette.success.contrastText,textTransform:"uppercase"},children:"Cheapest"}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:l?z.jsx("path",{d:"M3.75 11.2663L4.98375 12.5L9 8.4925L13.0162 12.5L14.25 11.2663L9 6.01625L3.75 11.2663Z",fill:"currentColor",fillOpacity:"0.5"}):z.jsx("path",{d:"M14.25 7.73375L13.0163 6.5L9 10.5075L4.98375 6.5L3.75 7.73375L9 12.9838L14.25 7.73375Z",fill:"currentColor",fillOpacity:"0.5"})})]})]}),l&&z.jsx(Ys,{feeUSD:i.feeUSD}),z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:[z.jsx(e.Trans,{id:"CMHmbm",message:"Slippage"}),z.jsx(ku,{onlyHover:!0,title:z.jsx(e.Trans,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:6})]}),z.jsxs(t.Box,{sx:{typography:"body2"},children:[100*i.slippage,"%"]})]})]})})})}),z.jsx(t.Box,{sx:{pt:0,pb:0,borderStyle:"solid",borderWidth:o.spacing(1,0,0),borderColor:o.palette.border.main},children:z.jsx(t.Accordion,{children:z.jsx(t.AccordionItem,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:z.jsxs(t.Box,{sx:{py:20,display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.primary"},children:[z.jsx(t.Box,{component:oe.DetailBorder,sx:{mr:6,width:18,height:18}}),z.jsx(e.Trans,{id:"QNWt8A",message:"Estimated Time"})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.primary",typography:"body2"},children:[i.executionDuration?Ds({start:Date.now(),end:Date.now()+1e3*i.executionDuration}):"-",z.jsx(t.Box,{component:oe.CaretUp,sx:{ml:6,width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]})]}),children:z.jsx(Dd,{route:i,isMobile:!0})})})})]})}function Bu({open:i,onClose:o,route:r,bridgeOrderTxRequest:a,clearToAmt:s,clearFromAmt:l,isDialogModal:d}){const c=t.useTheme(),{contractStatus:u}=Wa(),p=Zd({route:r,bridgeOrderTxRequest:a});return n.useEffect((()=>{u!==Va.Pending&&o(),u===Va.TxSuccess&&(s(),l())}),[u]),z.jsx(el,{title:z.jsx(e.Trans,{id:"tKE4Ak",message:"Cross Chain Summary"}),open:i,id:"cross-chain-summary",onClose:()=>{Ha(Va.Initial),o()},modal:d,children:z.jsxs(z.Fragment,{children:[r?z.jsxs(t.Box,{sx:{px:16,pb:20,flex:1,overflowY:"auto"},children:[z.jsxs(t.Box,{sx:{display:"grid",gridTemplateColumns:"36% 28% 36%",py:20,borderStyle:"solid",borderWidth:c.spacing(1,0,0),borderColor:c.palette.border.main},children:[z.jsx(Gd,{token:r.fromToken,chainId:r.fromChainId,amount:r.fromAmount}),z.jsx($d,{children:z.jsx(t.Box,{sx:{display:"flex",px:3,py:3,backgroundColor:c.palette.background.paperContrast,border:`1px solid ${c.palette.border.main}`,borderRadius:"50%",alignItems:"center",width:24,height:24,overflow:"hidden"},children:z.jsx(zd,{size:"medium",toolDetails:r.step.toolDetails,nameMarginLeft:8})})}),z.jsx(Gd,{token:r.toToken,chainId:r.toChainId,amount:r.toTokenAmount})]}),z.jsx(Tu,{route:r})]}):"",z.jsx(t.Box,{sx:{px:16,py:20},children:z.jsx(t.Button,{fullWidth:!0,isLoading:u==Va.Pending,disabled:!r,onClick:()=>{p(),Ha(Va.Pending)},children:u==Va.Pending?z.jsx(e.Trans,{id:"P+K/3O",message:"Confirming"}):z.jsx(e.Trans,{id:"PZqJog",message:"Confirm Cross Chain"})})})]})})}function Eu({message:n,onClose:i,isDialogModal:o}){return z.jsx(el,{open:!!n,onClose:i,id:"error-message",modal:o,children:z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{flex:1,textAlign:"center"},children:[z.jsx(t.Box,{component:oe.ErrorWarn,sx:{mt:60,width:64,height:64,color:"error.main"}}),n?z.jsxs(t.Box,{sx:{textAlign:"center",mt:60},children:[z.jsx(t.Box,{children:z.jsx(e.Trans,{id:"kf83Ld",message:"Something went wrong."})}),z.jsx(t.Box,{sx:{color:"text.secondary",mt:12,mx:20,typography:"body2",wordBreak:"break-all",overflow:"auto",height:"300px"},children:n})]}):""]}),z.jsx(t.Box,{sx:{px:16,py:20},children:z.jsx(t.Button,{onClick:i,fullWidth:!0,children:z.jsx(e.Trans,{id:"1QfxQT",message:"Dismiss"})})})]})})}function Iu(){const[e,i]=n.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsxs(t.ButtonBase,{sx:{mt:16,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:4,typography:"body2",fontWeight:600,color:"text.link","&:hover":{color:"text.primary"}},onClick:()=>i(!0),children:[z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",children:z.jsx("path",{d:"M3.5 16.25V4.25C3.5 3.8375 3.64687 3.48438 3.94063 3.19063C4.23438 2.89687 4.5875 2.75 5 2.75H9.5C9.9125 2.75 10.2656 2.89687 10.5594 3.19063C10.8531 3.48438 11 3.8375 11 4.25V9.5H11.75C12.1625 9.5 12.5156 9.64688 12.8094 9.94063C13.1031 10.2344 13.25 10.5875 13.25 11V14.375C13.25 14.5875 13.3219 14.7656 13.4656 14.9094C13.6094 15.0531 13.7875 15.125 14 15.125C14.2125 15.125 14.3906 15.0531 14.5344 14.9094C14.6781 14.7656 14.75 14.5875 14.75 14.375V8.975C14.6375 9.0375 14.5188 9.07813 14.3938 9.09688C14.2688 9.11563 14.1375 9.125 14 9.125C13.475 9.125 13.0312 8.94375 12.6688 8.58125C12.3063 8.21875 12.125 7.775 12.125 7.25C12.125 6.85 12.2344 6.49063 12.4531 6.17188C12.6719 5.85313 12.9625 5.625 13.325 5.4875L11.75 3.9125L12.5375 3.125L15.3125 5.825C15.5 6.0125 15.6406 6.23125 15.7344 6.48125C15.8281 6.73125 15.875 6.9875 15.875 7.25V14.375C15.875 14.9 15.6938 15.3438 15.3313 15.7063C14.9688 16.0688 14.525 16.25 14 16.25C13.475 16.25 13.0312 16.0688 12.6688 15.7063C12.3063 15.3438 12.125 14.9 12.125 14.375V10.625H11V16.25H3.5ZM5 8H9.5V4.25H5V8ZM14 8C14.2125 8 14.3906 7.92813 14.5344 7.78438C14.6781 7.64062 14.75 7.4625 14.75 7.25C14.75 7.0375 14.6781 6.85938 14.5344 6.71563C14.3906 6.57188 14.2125 6.5 14 6.5C13.7875 6.5 13.6094 6.57188 13.4656 6.71563C13.3219 6.85938 13.25 7.0375 13.25 7.25C13.25 7.4625 13.3219 7.64062 13.4656 7.78438C13.6094 7.92813 13.7875 8 14 8Z",fill:"currentColor"})}),"Gas Refuel>"]}),z.jsx(el,{open:e,onClose:()=>i(!1),title:"Gas refuel",modal:!0,children:z.jsxs(t.Box,{sx:{maxWidth:540,minHeight:600,px:20,pb:24,display:"flex",flexDirection:"column",alignItems:"center",gap:16},children:[z.jsx(t.Box,{sx:{pt:20,borderTopWidth:1,borderTopStyle:"solid",borderColor:"border.main",typography:"body2",color:"text.secondary"},children:"A solution for gas refueling that allows you to refill your wallet anonymously and gas-free."}),z.jsx(t.Box,{component:"iframe",src:"https://smolrefuel.com/?partner=0x1271CAba4bf23f8Fb31F97448605d65EE302CA51",width:"100%",sx:{borderRadius:12,overflow:"hidden",flex:1,border:"none"}})]})})]})}function Au({open:i,execute:o,onClose:r,toToken:a,fromToken:l,fromAmount:d,toAmount:c,priceImpact:u,clearFromAmt:p,clearToAmt:h,baseFeeAmount:m,curToFiatPrice:x,curFromFiatPrice:g,pricePerFromToken:f,additionalFeeAmount:y,loading:v,slippage:b,isDialogModal:C}){var j,w;const k=t.useTheme(),{contractStatus:T}=Wa(),B=n.useMemo((()=>new s(u).gt(qo)),[u]),[E,I]=n.useState(!1),[A,S]=n.useState(!1);return n.useEffect((()=>{T!==Va.Pending&&r(),T===Va.TxSuccess&&(h(),p())}),[T]),n.useEffect((()=>{I(!1)}),[x]),z.jsx(el,{open:i,onClose:()=>{Ha(Va.Initial),r()},id:"swap-summary",title:z.jsx(e.Trans,{id:"QR4/RH",message:"Swap summary"}),modal:C,children:z.jsxs(t.Box,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${k.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${k.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[z.jsx(sl,{width:16,height:16,url:null==l?void 0:l.logoURI,address:null!==(j=null==l?void 0:l.address)&&void 0!==j?j:"",marginRight:6}),z.jsx(t.Box,{children:`${ir({input:d,decimals:null==l?void 0:l.decimals})} ${null==l?void 0:l.symbol}`})]}),z.jsx(t.Box,{sx:{mt:4,typography:"h6",color:k.palette.text.secondary},children:g?`$${nr({input:g,showDecimals:1})}`:"-"})]}),z.jsx(t.Box,{sx:{width:16,mx:16},component:oe.DoubleRight}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex"},children:[z.jsx(sl,{width:16,height:16,marginRight:6,url:null==a?void 0:a.logoURI,address:null!==(w=null==a?void 0:a.address)&&void 0!==w?w:""}),z.jsx(t.LoadingSkeleton,{loading:v,loadingProps:{width:30},children:`${ir({input:c,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`})]}),z.jsx(t.LoadingSkeleton,{loading:v,loadingProps:{width:30},sx:{typography:"h6",mt:4,color:k.palette.text.secondary},children:x?`$${nr({input:x,showDecimals:1})}(${u}%)`:"-"})]})]}),z.jsxs(t.Box,{sx:{mt:12,display:"flex",alignItems:"center",typography:"h6"},children:[`1 ${null==l?void 0:l.symbol} = `,z.jsx(t.LoadingSkeleton,{loading:v,loadingProps:{width:30},children:ir({input:new s(c).dividedBy(new s(d)),decimals:null==a?void 0:a.decimals})})," ",`${null==a?void 0:a.symbol}`]})]}),z.jsxs(t.Box,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${k.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:k.palette.text.secondary},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{sx:{width:16,mr:7},component:oe.DetailBorder}),z.jsx(e.Trans,{id:"XeovX3",message:"Swap Detail"})]}),z.jsx(t.Box,{component:t.ButtonBase,children:z.jsx(t.Box,{onClick:()=>S(!A),sx:{width:10,color:"text.secondary",transform:A?"rotateX(0deg)":"rotateX(180deg)"},component:oe.CaretUp})})]}),z.jsxs(t.Box,{sx:{mt:16,display:A?"initial":"none"},children:[z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(e.Trans,{id:"93m8jT",message:"Basic Fee"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"8Z29ZO",message:"Estimated service provider fees"}),ml:5})]}),z.jsx(t.LoadingSkeleton,{loading:v,loadingProps:{width:30},children:m?`${ir({input:m,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`:"0"})]}),z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(e.Trans,{id:"J39pAJ",message:"Additional Fee"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"ZXvy7b",message:"Additional routing fees set by the Widget user"}),ml:5})]}),z.jsx(t.LoadingSkeleton,{loading:v,loadingProps:{width:30},children:y?`${ir({input:y,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`:"0"})]}),z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(e.Trans,{id:"T+qgFw",message:"Price Impact"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),z.jsx(t.Box,{children:`${u}%`})]}),z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(e.Trans,{id:"CMHmbm",message:"Slippage"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"GAypnX",message:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),z.jsxs(t.Box,{children:[b,"%"]})]})]})]}),z.jsx(t.Box,{sx:{flex:1}}),B&&z.jsxs(t.Box,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>I(!E),children:[z.jsx(t.Box,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:E?z.jsx(t.Box,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:z.jsx(t.Box,{component:oe.Done,sx:{width:14,color:"secondary.contrastText"}})}):z.jsx(t.Box,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${k.palette.text.secondary}`}})}),z.jsx(t.Box,{children:z.jsx(e.Trans,{components:{0:z.jsx(t.Box,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:u},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),z.jsx(t.Button,{isLoading:T==Va.Pending,disabled:B&&!E,fullWidth:!0,onClick:()=>{o(),Ha(Va.Pending)},children:T==Va.Pending?z.jsx(e.Trans,{id:"P+K/3O",message:"Confirming"}):z.jsx(e.Trans,{id:"lQ6r7x",message:"Confirm swap"})})]})})}function Su(e){var{sx:n,maxVal:i,decimals:o=2,onInputChange:r}=e,a=D(e,["sx","maxVal","decimals","onInputChange"]);return z.jsx(t.Input,{...a,onChange:e=>{const t=0===e.target.value.length?null:ar(e.target.value,o),n=i&&t&&new s.BigNumber(t).gt(i)?i.toString():t;r&&r(n)}})}function Lu({open:i,onClose:o,isBridge:r,isDialogModal:a}){const s=t.useTheme(),{slippage:l}=Wa(),d=n.useMemo((()=>Number(l)>=Wo),[l]),{defaultSlippage:c}=js(r);return z.jsx(el,{open:i,onClose:o,id:"swap-settings",title:z.jsx(e.Trans,{id:"Tz0i8g",message:"Settings"}),modal:a,children:z.jsx(t.Box,{sx:{mx:20},children:z.jsxs(t.Box,{sx:{py:20,borderTop:`1px solid ${s.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{mb:16,display:"flex",alignItems:"center"},children:[z.jsx(e.Trans,{id:"lqTDfd",message:"Slippage Tolerance"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column"},children:[z.jsx(Su,{fullWidth:!0,maxVal:100,value:null!=l?l:"",placeholder:c.toString(),onInputChange:e=>{!function(e,t){null===t?localStorage.removeItem(e?Fo:No):localStorage.setItem(e?Fo:No,String(t))}(!!r,e),za(e)},suffix:z.jsx(t.Box,{sx:{color:"text.disabled"},children:"%"}),height:36,sx:{mt:12}}),d&&z.jsx(t.Box,{sx:{typography:"h6",mt:6,color:"error.main"},children:z.jsx(e.Trans,{id:"Zm56FI",message:"Maximum slippage do not exceed 50%"})})]})]})})})}const Mu="position-y-dot";function Ru(){return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[z.jsx(t.Skeleton,{width:"100%",height:12}),z.jsx(t.Skeleton,{width:"100%",height:12})]})}function Ou({data:e,loading:i}){var o,r;const a=t.useTheme(),s=a.palette.primary.main,l=n.useRef(null),d=e.length;return z.jsx(t.Box,{sx:{height:105,flex:1,[`& .${Mu}`]:{}},ref:l,children:i?z.jsx(Ru,{}):z.jsx(t.Box,{component:T.ResponsiveContainer,sx:{typography:"h6","& .recharts-cartesian-axis text":{fill:a.palette.background.paperContrast}},children:z.jsxs(T.AreaChart,{data:e,margin:{top:0,right:0,left:0,bottom:0},children:[z.jsx(T.XAxis,{dataKey:"forecastSlippage",axisLine:!1,tickLine:!1,interval:"preserveStartEnd",tickFormatter:e=>gr({input:e}),type:"number",domain:[d&&null!==(o=e[0].forecastSlippage)&&void 0!==o?o:0,d&&null!==(r=e[d-1].forecastSlippage)&&void 0!==r?r:"auto"]}),z.jsx(T.YAxis,{dataKey:"confidenceRatio",axisLine:!1,tickLine:!1,hide:!0}),z.jsx("defs",{children:z.jsxs("linearGradient",{id:"count-linear",x1:"0",y1:"0",x2:"0",y2:"1",children:[z.jsx("stop",{offset:"0",stopColor:s,stopOpacity:.3}),z.jsx("stop",{offset:"100%",stopColor:s,stopOpacity:0})]})}),z.jsx(T.Area,{type:"monotone",dataKey:"confidenceRatio",stroke:s,strokeWidth:2,fill:"url(#count-linear)"}),e.map((e=>z.jsx(T.ReferenceDot,{x:e.forecastSlippage,y:e.confidenceRatio,r:1,fill:a.palette.text.primary,stroke:"none",className:Mu},e.confidenceRatio)))]})})})}var Pu=n.memo(Ou);const _u=t.styled(t.Slider)((({theme:e})=>({height:2,padding:"15px 0",margin:0,"& .base-Slider-valueLabel":{fontSize:12,fontWeight:"normal",top:-6,backgroundColor:"unset",color:e.palette.text.primary,"&:before":{display:"none"},"& *":{background:"transparent",color:e.palette.text.primary}},"& .base-Slider-track":{display:"none"},"& .base-Slider-rail":{backgroundColor:e.palette.text.disabled,height:1,opacity:1},"& .base-Slider-mark":{display:"none",opacity:1,backgroundColor:e.palette.success.main,height:6,width:4,borderRadius:4},"& .base-Slider-markLabel":{display:"none",fontSize:"12px",lineHeight:"17px"}})));function Du(i){var{hidden:o,sx:r,value:a,color:s,min:l,max:d,formatValue:c,getSliderYPosition:u}=i,p=D(i,["hidden","sx","value","color","min","max","formatValue","getSliderYPosition"]);const{children:h}=p,m=D(p,["children"]),{isMobile:x}=t.useDevices(),g=n.useRef(null),f=u(a),y=x?4:0,v=f?f-39-y:void 0,b=null!=s?s:"text.primary",C=a===l,j=a===d;return z.jsxs(t.Box,{...m,ref:g,sx:Object.assign({position:"absolute","&&&":{display:o?"none":"block",backgroundColor:"transparent",boxShadow:"none",bottom:8+y,width:"auto",height:"auto",top:"auto",marginLeft:0,transform:"none"}},r),children:[h,z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[v?z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:b,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),z.jsx(t.Box,{sx:{height:v,width:"0",borderStyle:"dashed",borderWidth:1,borderColor:b}})]}):"",z.jsx(t.Box,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:b,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),z.jsxs(t.Box,{sx:Object.assign(Object.assign({typography:"h6",position:"absolute",bottom:-20,color:b,whiteSpace:"nowrap",backgroundColor:"background.paperContrast"},C?{left:0}:{}),j?{right:0}:{}),children:[j?z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{component:"span",sx:{color:"success.main"},children:z.jsx(e.Trans,{id:"cOvZFM",message:"Dynamic"})}),z.jsx("span",{children:" • "})]}):"",c(a)]})]})]})}function Nu(e){var{hoverValue:n,formatValue:i,getSliderYPosition:o}=e,r=D(e,["hoverValue","formatValue","getSliderYPosition"]);const{isMobile:a}=t.useDevices(),s=a?"primary.main":void 0,l=a?void 0:"primary.main";return z.jsx(_u,{slots:{thumb:e=>{const t=r.value&&"number"==typeof r.value&&(r.min&&r.value<r.min||r.max&&r.value>r.max),d={value:r.value,min:r.min,max:r.max,hidden:!!t,color:s,formatValue:i,getSliderYPosition:o},c=Object.assign(Object.assign({},e),d);if(null!==n&&r.max&&r.min&&r.value!==n){const e=r.max-r.min,t=n-r.min,i=t?t/e*100:0;if(a){const e=!!n&&(!!r.min&&n<r.min||!!r.max&&n>r.max);return z.jsxs(z.Fragment,{children:[z.jsx(Du,{...d,value:n,color:l,hidden:e,sx:{left:i+"%"}}),z.jsx(Du,{...c})]})}return z.jsxs(z.Fragment,{children:[z.jsx(Du,{...c}),z.jsx(Du,{...d,value:n,hidden:!1,color:l,sx:{left:i+"%"}})]})}return z.jsx(Du,{...c})}},...r})}const Fu=(e,{time:t=100,wrapper:n=document,retryCount:i=50}={})=>new Promise((o=>{n.querySelector(e)?o(!0):setTimeout((()=>N(void 0,void 0,void 0,(function*(){if(n.querySelector(e))o(!0);else if(i){const r=yield Fu(e,{time:t,wrapper:n,retryCount:i-1});o(r)}else o(!1)}))),t)}));function Uu({data:i,activeSlippage:o,loading:r,sx:a,handleChangeCustomSlippage:l}){const d=n.useMemo((()=>{var e;return null!==(e=null==i?void 0:i.length)&&void 0!==e?e:0}),[i]),{isMobile:c}=t.useDevices(),[u,p]=n.useState([]),h=n.useRef(null);n.useEffect((()=>{(()=>{N(this,void 0,void 0,(function*(){var e;if(h.current&&d){const t=`.${Mu}`;yield Fu(t,{wrapper:h.current});const n=h.current.querySelectorAll(t),{y:i,height:o}=h.current.getBoundingClientRect(),r=null!==(e=null==n?void 0:n.length)&&void 0!==e?e:0,a=[];for(let e=0;e<r;e++){const t=n[e];const r=(t.children[0]?t.children[0].getBoundingClientRect().y:t.getBoundingClientRect().y)-i-.5;a.push(o-r)}p(a)}}))})()}),[d]);const m=(({activeSlippage:e,data:t,yPositions:i})=>{const[o,r]=n.useState(0),a=n.useMemo((()=>1e6),[]),[l,d]=n.useMemo((()=>{var e,n;const i=null==t?void 0:t.length;return i?[new s(null!==(e=t[0].forecastSlippage)&&void 0!==e?e:0).times(null!=a?a:0).dp(0,1).toNumber(),new s(null!==(n=t[i-1].forecastSlippage)&&void 0!==n?n:0).times(null!=a?a:0).dp(0,1).toNumber()]:[0,0]}),[t,a]),c=n.useCallback((e=>{if(void 0===e)return"";const n=new s(e);if((null==t?void 0:t.length)&&a){const e=t.find((e=>{var t;return new s(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(a).dp(0,1).isEqualTo(n)}));if(null==e?void 0:e.forecastSlippage)return gr({input:e.forecastSlippage,showDecimals:4})}return gr({input:a?n.div(a):n,showDecimals:4})}),[a,t]),u=n.useCallback((e=>{let n=0;return e&&(null==t?void 0:t.length)&&a?(t.some(((o,r)=>{var l,d;const c=null!==(l=o.forecastSlippage)&&void 0!==l?l:0,u=new s(c).times(a).dp(0,1).toNumber();if(e===u)return n=i[r],!0;if(e<u){if(0===r)return n=0,!0;const o=c-(null!==(d=t[r-1].forecastSlippage)&&void 0!==d?d:0),l=i[r]-i[r-1],u=c-new s(e).div(a).toNumber();return n=i[r]-l/o*u,!0}})),n):n}),[i,t,a]),p=n.useCallback((e=>{r(e);const n=new s(e);let i,o=-1;if((null==t?void 0:t.length)&&a){o=t.findIndex((e=>{var t;return new s(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(a).dp(0,1).isEqualTo(n)}));const e=-1!==o?t[o]:void 0;i=null==e?void 0:e.forecastSlippage}return i||(i=n.div(null!=a?a:0).toNumber()),i}),[t,a]);return n.useEffect((()=>{if(a&&e){const t=new s(e).times(a).dp(0,1);t.isEqualTo(o)||r(t.toNumber())}}),[e]),{min:l,max:d,value:o,decimalConversion:a,formatValue:c,getSliderYPosition:u,handleChangeValue:p}})({data:i,activeSlippage:o,yPositions:u}),{hoverValue:x,setHoverValue:g}=function(e,{slippageSlider:i}){const{isMobile:o}=t.useDevices(),[r,a]=n.useState(null),l=n.useRef(!1);return n.useEffect((()=>{if(e.current&&i.max){const t=e.current;let{width:n,x:d}=t.getBoundingClientRect();const c=e=>{if(l.current)return;const t=e.pageX-d,o=i.max-i.min,c=new s(t/n*o).integerValue().plus(i.min).toNumber();c!==r&&a(c)},u=()=>{a(null)},p=()=>{l.current=!1},h=()=>{l.current=!0};return o||(t.addEventListener("mousemove",c),t.addEventListener("mouseleave",u),t.addEventListener("mouseup",p),t.addEventListener("mousedown",h)),()=>{o&&(t.removeEventListener("mousemove",c),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseUp",p),t.removeEventListener("mouseDown",h))}}}),[e,o]),{hoverValue:r,setHoverValue:a}}(h,{slippageSlider:m}),{successRate:f,hoverSuccessRate:y}=function({data:e,activeSlippage:t,hoverValue:i,decimalConversion:o}){const r=n.useMemo((()=>{var n,i;let o="-";if(t&&(null==e?void 0:e.length)){const r=e.some(((n,i)=>{var r,a,s,l,d,c;const u=null!==(r=n.forecastSlippage)&&void 0!==r?r:0;if(t===u)return o=gr({input:null!==(a=null==n?void 0:n.confidenceRatio)&&void 0!==a?a:0}),!0;if(t<u){if(0===i)o=`< ${gr({input:null!==(s=null==n?void 0:n.confidenceRatio)&&void 0!==s?s:0})}`;else{const t=gr({input:null!==(d=null===(l=e[i-1])||void 0===l?void 0:l.confidenceRatio)&&void 0!==d?d:0}),r=gr({input:null!==(c=null==n?void 0:n.confidenceRatio)&&void 0!==c?c:0});o=`${t} - ${r}`}return!0}return!1}));r||(o=`> ${gr({input:null!==(i=null===(n=e[e.length-1])||void 0===n?void 0:n.confidenceRatio)&&void 0!==i?i:0})}`)}return o}),[e,t]),a=n.useMemo((()=>{var t,n;let r="";if(i&&(null==e?void 0:e.length)&&o){const a=e.some(((t,n)=>{var a,l,d,c,u,p;const h=null!==(a=t.forecastSlippage)&&void 0!==a?a:0,m=new s(h).times(o).dp(0,1).toNumber();if(i===m)return r=gr({input:null!==(l=null==t?void 0:t.confidenceRatio)&&void 0!==l?l:0}),!0;if(i<m){if(0===n)r=`< ${gr({input:null!==(d=null==t?void 0:t.confidenceRatio)&&void 0!==d?d:0})}`;else{const i=gr({input:null!==(u=null===(c=e[n-1])||void 0===c?void 0:c.confidenceRatio)&&void 0!==u?u:0}),o=gr({input:null!==(p=null==t?void 0:t.confidenceRatio)&&void 0!==p?p:0});r=`${i} - ${o}`}return!0}return!1}));a||(r=`> ${gr({input:null!==(n=null===(t=e[e.length-1])||void 0===t?void 0:t.confidenceRatio)&&void 0!==n?n:0})}`)}return r}),[i,o,e]);return{successRate:r,hoverSuccessRate:a}}({data:i,activeSlippage:o,hoverValue:x,decimalConversion:m.decimalConversion});return i?z.jsxs(t.Box,{sx:Object.assign({p:12,pb:28,borderRadius:12,backgroundColor:"background.paperContrast"},a),children:[z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{typography:"h6",fontWeight:600,color:"text.secondary"},children:z.jsx(e.Trans,{id:"88dol0",message:"Success Rate"})}),z.jsx(t.LoadingSkeleton,{loading:r,loadingProps:{width:100},sx:{mt:4,typography:"caption",color:y?"primary.main":"text.primary"},children:y||f})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"flex-end",pr:4},children:[z.jsx(t.Box,{sx:{pb:8,mr:16,typography:"h6",fontWeight:600},children:z.jsx(e.Trans,{id:"CMHmbm",message:"Slippage"})}),z.jsxs(t.Box,{sx:{flex:1},ref:h,children:[z.jsx(Pu,{data:i,loading:r}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:!r&&d?z.jsx(Nu,{value:c?x||-1:m.value,min:m.min,max:m.max,disabled:!c,marks:[{value:m.max,label:m.max}],formatValue:m.formatValue,getSliderYPosition:m.getSliderYPosition,hoverValue:c?m.value:x,onChange:(e,t)=>{if("number"==typeof t){if(c)return void g(t);const e=m.handleChangeValue(t);l(e)}},onChangeCommitted:()=>{g(null)}}):""})]})]})]}):null}var qu,Vu=n.memo(Uu);function Wu({title:i,desc:o,doNotChecked:r,onChangeDoNotChecked:a}){const s=t.useTheme();if(n.useMemo((()=>r),[]))return null;const l=s.palette.warning.main;return z.jsxs(t.Box,{sx:{backgroundColor:t.alpha(l,.1),borderRadius:8,padding:12},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,typography:"body2",color:l,fontWeight:700},children:[z.jsx(oe.Warn,{}),i]}),z.jsx(t.Box,{sx:{mt:8,typography:"body2",fontWeight:500,color:s.palette.text.secondary,textAlign:"center"},children:o}),!!a&&z.jsxs(t.Box,{sx:{width:"100%",mt:20,color:s.palette.text.secondary,typography:"h6",fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",gap:8,cursor:"pointer"},component:"label",children:[z.jsx(t.Checkbox,{checked:r,size:16,onChange:e=>{const{checked:t}=e.target;a(t)}}),z.jsx(e.Trans,{id:"3WdxUv",message:"Do not remind again"})]})]})}function Hu({fromToken:i,toToken:r}){var a,l;const d=t.useTheme(),{slippageAdvanced:c,notRemindAgainSlippageHigher:u,notRemindAgainSlippageLower:p}=vs(),{customSlippage:h,customSlippageNum:m,handleSlippageChange:x,forecastSlippage:g,forecastSlippageQuery:f,recommendSlippage:y}=Bs({fromToken:i,toToken:r}),v=!!g,[b,C]=n.useState(!1),[j,w]=n.useState();!j&&i&&r&&w(h?qu.custom:qu.recommend);const k=j===qu.custom,T=n.useRef(null),B=n.useMemo((()=>j===qu.custom?m?new s(m).div(100).toNumber():void 0:new s(y).div(100).toNumber()),[j,y,m]),E=n.useCallback((e=>{k||w(qu.custom),x({slippage:new s(e).times(100).toString(),disabled:!1,deleted:!1,recommend:String(y)})}),[k,y,x]);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{mt:24,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[z.jsx(e.Trans,{id:"x6GJ4a",message:"Max Slippage"}),z.jsx(t.QuestionTooltip,{title:z.jsxs(z.Fragment,{children:[z.jsx(e.Trans,{id:"qoii6e",message:"The dynamic slippage is provided by ZUNO team through analyzing historical transactions."}),z.jsx("br",{}),z.jsxs(t.Box,{component:"a",href:o.i18n._({id:"zABfk1",message:"https://blog.dodoex.io/introducing-the-dodo-smart-slippage-3d32d13a4fef"}),target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[z.jsx(e.Trans,{id:"NgeSlx",message:"Learn More"}),">"]})]}),ml:7})]}),f.isLoading||(null===(a=f.slippageData.slippageList)||void 0===a?void 0:a.length)?z.jsxs(t.LoadingSkeleton,{loading:f.isLoading,loadingProps:{width:100},component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[z.jsx(e.Trans,{id:"sxkWRg",message:"Advanced"}),z.jsx(t.Checkbox,{sx:{top:-1},size:16,checked:c,onChange:e=>{const{checked:t}=e.target;vs.setState({slippageAdvanced:t})}})]}):""]}),!!j&&z.jsxs(t.Tabs,{value:j,onChange:(e,t)=>{w(t),t===qu.custom&&C(!0)},children:[z.jsxs(t.TabListButton,{variant:"inPaper",sx:{mt:16,'&:not(:hover) [aria-selected="true"] .weak':{color:t.alpha(d.palette.secondary.contrastText,.5)}},children:[z.jsx(t.TabButton,{value:qu.recommend,variant:"inPaper",sx:{position:"relative"},children:z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{component:"span",sx:{position:"absolute",top:4,left:4,ml:4,typography:"h6",fontWeight:600,padding:d.spacing(0,8),borderRadius:4,backgroundColor:k?t.alpha(d.palette.purple.main,.1):"#FFF"},children:z.jsx(t.Box,{component:"span",sx:{background:k?`linear-gradient(90deg, ${d.palette.purple.main} -1.33%, ${"dark"===d.palette.mode?"#E6D9FF":"#BFAFF3"} 98.67%)`:`linear-gradient(90deg, ${d.palette.purple.main} -1.33%, #BFAFF3 98.67%)`,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"New"})}),z.jsxs(t.Box,{sx:{textAlign:"center"},children:[v?z.jsxs(t.Box,{sx:{flexGrow:1,typography:"body2",fontWeight:600},children:[y.toString()||"-","%"]}):z.jsx(t.Tooltip,{title:z.jsx(e.Trans,{id:"wSpNR+",message:"This trading pair does not have enough historical data and has used the default dynamic slippage."}),sx:{ml:0,maxWidth:240},children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"body2",fontWeight:600,color:d.palette.warning.main,gap:4},children:[z.jsx(t.Box,{component:oe.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),z.jsxs("span",{children:[y.toString()||"-","%"]})]})}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:600},className:"weak",children:z.jsx(e.Trans,{id:"cOvZFM",message:"Dynamic"})})]})]})}),z.jsx(t.TabButton,{value:qu.custom,variant:"inPaper",sx:{position:"relative",p:0},children:z.jsxs(t.Box,{sx:{px:16,py:12,typography:"body2",fontWeight:600,textAlign:"center"},onClick:()=>{setTimeout((()=>{C(!0)}))},children:[b?z.jsx(t.Input,{ref:T,placeholder:"-",sx:{backgroundColor:"transparent",borderWidth:0,"& input":{textAlign:"center",typography:"body2",p:0,boxSizing:"border-box",height:19,color:k?d.palette.secondary.contrastText:d.palette.text.secondary,"&::placeholder":{color:"custom.input.placeholder",opacity:1}}},inputMode:"decimal",value:h||"",autoFocus:!0,onChange:e=>{const t=e.target.value;x({slippage:t,disabled:!1,recommend:String(y)})},onBlur:()=>{setTimeout((()=>{if(C(!1),!m)return void w(qu.recommend);const e=!m||m<0;e&&h&&x({slippage:h,disabled:e,deleted:e,recommend:String(y)})}),10)},onKeyDown:e=>{var t;"Enter"===e.code&&(e.preventDefault(),null===(t=T.current)||void 0===t||t.blur())}}):z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,color:h&&k?d.palette.warning.main:void 0},children:[h&&z.jsx(t.Box,{component:oe.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),h||"-","%"]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"h6",fontWeight:600},className:"weak",children:z.jsx(e.Trans,{id:"8Tg/JR",message:"Custom"})})]})})]}),z.jsx(t.TabPanel,{value:qu.recommend,children:(null===(l=f.slippageData.slippageList)||void 0===l?void 0:l.length)&&c?z.jsx(Vu,{data:f.slippageData.slippageList,activeSlippage:B,loading:f.isLoading,handleChangeCustomSlippage:E,sx:{mt:8}}):""}),z.jsxs(t.TabPanel,{value:qu.custom,children:[z.jsx(t.Box,{sx:{mt:8}}),m>y&&z.jsx(Wu,{title:o.i18n._({id:"8XNsbx",message:"Higher than dynamic slippage"}),desc:o.i18n._({id:"iLj1a9",message:"Dynamic slippage is {recommendSlippage}%,the current slippage setting is higher than the dynamic slippage, which means you are willing to accept a worse final execution price.",values:{recommendSlippage:y}}),doNotChecked:u,onChangeDoNotChecked:e=>vs.setState({notRemindAgainSlippageHigher:e})}),!!m&&m<y&&z.jsx(Wu,{title:o.i18n._({id:"TTlkRL",message:"Lower than dynamic slippage"}),desc:o.i18n._({id:"yq+Q9s",message:"Dynamic slippage is {recommendSlippage}% , the current slippage setting may increase the failure rate of transactions.",values:{recommendSlippage:y}}),doNotChecked:p,onChangeDoNotChecked:e=>vs.setState({notRemindAgainSlippageLower:e})})]})]})]})}function Zu({checked:n,onChange:i,sx:o,disabled:r}){const a=t.useTheme();let s=a.palette.background.tag;return n&&(s=a.palette.secondary.main),z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",position:"relative",borderRadius:8,backgroundColor:a.palette.background.input,opacity:r?.5:1},o),component:t.ButtonBase,disabled:r,onClick:()=>{r||i(!n)},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:a.palette.text.primary,whiteSpace:"nowrap"},children:z.jsx(e.Trans,{id:"az8lvo",message:"Off"})}),z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:n?a.palette.secondary.contrastText:a.palette.text.primary,whiteSpace:"nowrap"},children:z.jsx(e.Trans,{id:"Z5HWHd",message:"On"})}),z.jsx(t.Box,{sx:{borderRadius:6,backgroundColor:s,zIndex:0,position:"absolute",top:2,bottom:2,width:"calc(50% - 2px - 2px)",left:n?"calc(50% + 2px)":"2px",transition:"left 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}})]})}function zu({show:n,onClick:i}){const o=t.useTheme();return z.jsxs(t.HoverOpacity,{weak:!0,sx:{display:n?"flex":"none",alignItems:"center",position:"absolute",bottom:28,left:"50%",transform:"translateX(-50%)",p:o.spacing(8,20),fontWeight:600,borderRadius:20,border:`solid 1px ${o.palette.border.main}`,backgroundColor:"background.paperContrast",boxShadow:`0px 8px 16px 0px ${t.alpha("light"===o.palette.mode?"#FFF":"#000",.1)}`,cursor:"pointer",whiteSpace:"nowrap",gap:4},onClick:i,children:[z.jsx(e.Trans,{id:"F8yRdq",message:"More trade settings"}),z.jsx(t.Box,{component:"svg",width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{color:"text.secondary"},children:z.jsx("path",{d:"M12.5 19L6.5 13L7.9 11.6L12.5 16.175L17.1 11.6L18.5 13L12.5 19ZM12.5 13L6.5 6.99998L7.9 5.59998L12.5 10.175L17.1 5.59998L18.5 6.99998L12.5 13Z",fill:"currentColor"})})]})}function $u({selected:e,name:n,logo:i,onClick:o}){const r=t.useTheme();return z.jsxs(t.Box,{component:t.ButtonBase,onClick:o,sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,py:19,mt:16,mx:8,width:"calc(33.33% - 8px - 8px)",borderRadius:8,backgroundColor:r.palette.background.paperContrast,borderColor:e?r.palette.secondary.main:r.palette.background.paperContrast,borderWidth:1,borderStyle:"solid","&:hover":{borderColor:r.palette.secondary.main},position:"relative",overflow:"hidden"},children:[z.jsx("img",{src:i,alt:n,style:{height:40,width:40}}),z.jsx(t.Box,{sx:{color:r.palette.text.primary,typography:"body2",fontWeight:600},children:n}),e&&z.jsx(t.Box,{sx:{right:0,top:0,position:"absolute",width:32,height:24,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:r.palette.secondary.main,borderRadius:"0px 0px 0px 8px"},children:z.jsx("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M11.8709 3.16663L5.03682 10.0007L2.35089 7.32514L0.888672 8.78737L5.03682 12.9355L13.3331 4.63922L11.8709 3.16663Z",fill:r.palette.secondary.contrastText})})})]})}function Gu({privacySwapSupplierEndpoints:e,endpointStatusMap:i,refetchEndpointStatus:o,setIsSelectSupplierMode:r}){var a,s;const l=t.useTheme(),[d,c]=n.useState(null!==(s=null===(a=null==e?void 0:e[0])||void 0===a?void 0:a.key)&&void 0!==s?s:null),[u,p]=n.useState(i);u!==i&&(p(i),Array.from(i.entries()).forEach((([e,t])=>{t&&c(e)})));const h=d?null==e?void 0:e.find((e=>e.key===d)):void 0,m=!d||i.get(d),x=n.useCallback((()=>{o(),r(!1)}),[o,r]),{switchTo:g}=function({chainId:e,successCallback:t,selectedSupplier:i}){return{switchTo:n.useCallback((()=>N(this,void 0,void 0,(function*(){if(i)try{yield window.ethereum.request({method:"wallet_addEthereumChain",params:[i.addChainParameters]}),t()}catch(e){console.error(e)}}))),[i,t])}}({successCallback:x,selectedSupplier:h});return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"stretch",flexDirection:"column",minHeight:"100%"},children:[z.jsx(t.Box,{sx:{mt:20,pt:12,display:"flex",alignItems:"flex-start",flexWrap:"wrap",mx:-8},children:null==e?void 0:e.map(((e,t)=>{const n=d===e.key;return z.jsx($u,{selected:n,name:e.name,logo:e.logo,onClick:()=>c(e.key)},t)}))}),z.jsx(t.Box,{sx:{mt:24,width:"100%",height:"1px",flexShrink:0,flexGrow:0,backgroundColor:l.palette.border.main}}),z.jsxs(t.Box,{sx:{mt:24,mb:24,typography:"body2",fontWeight:500,color:l.palette.text.secondary},children:[z.jsx(t.Box,{children:"*Choose your privacy transaction server. Later, a new network will be added to your wallet, and transactions submitted under this network can only be seen by the privacy transaction server. The server will protect you from the impact of MEV. You can also disable the privacy transaction by switching back to the original network."}),h&&z.jsx(t.Box,{sx:{color:l.palette.primary.main},component:"a",href:null==h?void 0:h.docUrl,target:"_blank",rel:"noopener noreferrer",children:"Learn more>"})]}),z.jsx(t.Button,{size:t.Button.Size.big,variant:t.Button.Variant.contained,fullWidth:!0,sx:{marginTop:"auto",flexShrink:0,flexGrow:0},disabled:m,onClick:g,children:"Enable Privacy Swap"}),z.jsx(t.Box,{sx:{height:28,width:"100%"}})]})}function Qu({open:o,onClose:r,fromToken:a,toToken:s,privacySwapEnableAble:l,privacySwapEnable:d,privacySwapSupplierEndpoints:c,endpointStatusMap:u,refetchEndpointStatus:p,isDialogModal:h}){const m=t.useTheme(),{ddl:x,expertMode:g,disableIndirectRouting:f}=vs(),[y,v]=n.useState(!1),b=n.useRef(null),[C,j]=n.useState(!1);return n.useEffect((()=>{const e=b.current,t=new ResizeObserver((()=>{e&&j(e.scrollHeight!==e.offsetHeight)})),n=i.throttle((()=>{if(!e)return;const t=e.scrollTop+e.clientHeight<e.scrollHeight-2;j(t)}),50);return e&&(j(e.scrollHeight!==e.clientHeight),t.observe(e),e.addEventListener("scroll",n)),()=>{e&&(t.unobserve(e),e.removeEventListener("scroll",n))}}),[null==b?void 0:b.current]),z.jsx(el,{open:o,onClose:y?()=>v(!1):r,id:"swap-settings",title:y?"Select A Supplier":z.jsx(e.Trans,{id:"Tz0i8g",message:"Settings"}),modal:h,children:z.jsx(t.Box,{sx:{px:20,pb:34,overflowY:"auto"},ref:b,children:y?z.jsx(Gu,{privacySwapSupplierEndpoints:c,endpointStatusMap:u,refetchEndpointStatus:p,setIsSelectSupplierMode:v,privacySwapEnable:d,privacySwapEnableAble:l}):z.jsxs(z.Fragment,{children:[z.jsx(Hu,{fromToken:a,toToken:s}),z.jsxs(t.Box,{sx:{mt:24,pt:14,borderTop:`solid 1px ${m.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[z.jsx(e.Trans,{id:"zSMRJ/",message:"Transaction Deadline"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"wmCrk7",message:"You may modify the transaction deadline, the maximum time allowed for a trade to be processed on-chain. However, please note that this may lead to your trade executing at a subpar price, as the market price may change during that time."}),ml:7})]}),z.jsxs(t.Box,{sx:{mt:16,display:"flex",alignItems:"center",gap:8,typography:"body2"},children:[z.jsx(t.Input,{sx:{width:80,height:34,lineHeight:1,typography:"body2","& input":{px:16,py:6}},placeholder:String(Ho),value:x,onChange:e=>{vs.setState({ddl:e.target.value})}}),z.jsx(e.Trans,{id:"H9HlDe",message:"minutes"})]})]}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,mt:24,pt:14,borderTop:`solid 1px ${m.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{fontWeight:600},children:[z.jsx(e.Trans,{id:"MXQodB",message:"Disable Indirect Routing"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"Y0Knz4",message:"Checking this option means that the routing algorithm will only route to liquidity pools between the two tokens in the trading pair and will ignore routes with any intermediary tokens."}),ml:7})]}),z.jsx(Zu,{checked:f,onChange:e=>{vs.setState({disableIndirectRouting:e})}})]}),l&&z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{fontWeight:600},children:[z.jsx(e.Trans,{id:"U1Bq/+",message:"Privacy Swap"}),z.jsx(ku,{title:z.jsx(e.Trans,{id:"fsEEap",message:"Privacy Swap can effectively protect users from sandwich attacks that could come about due to the differences between the slippage settings and the current price in the liquidity pool. This feature is free for a limited time."}),ml:7})]}),z.jsx(Zu,{checked:d,disabled:d,onChange:e=>{e&&v(!0)}})]})]}),z.jsx(zu,{show:C,onClick:()=>{var e,t;null===(e=b.current)||void 0===e||e.scrollTo({top:null===(t=b.current)||void 0===t?void 0:t.scrollHeight,behavior:"smooth"})}})]})})})}function Yu({onClick:e,disabled:n,plus:i}){const o=t.useTheme(),r=n||i||!e;return z.jsx(t.Box,{sx:{width:"100%",position:"relative"},children:z.jsx(t.Box,{component:t.ButtonBase,sx:Object.assign({width:44,height:44,borderRadius:"50%",backgroundColor:o.palette.background.paper,border:"4px solid #E4E1D4",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)",color:"text.secondary"},r?{cursor:"inherit"}:{"&:hover":{color:"text.primary"},"&:focus-visible":{"&::before":{content:'""',position:"absolute",display:"block",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"50%",width:36,height:36,border:"solid 1px",borderColor:"text.secondary"}}}),disabled:r,onClick:()=>{r||e&&e()},children:i?z.jsx(t.Box,{component:oe.Plus,sx:{width:24,height:24}}):z.jsx(t.Box,{component:oe.ArrowBack,sx:{width:24,height:24}})})})}!function(e){e.recommend="recommend",e.custom="custom"}(qu||(qu={}));const Xu=()=>{const{requests:e,updateText:t}=us(),i=n.useMemo((()=>{let t={};return null==e||e.forEach((([e,n])=>{var i,o;if((n===Ka.Running||n===Ka.Success)&&(null===(i=e.metadata)||void 0===i?void 0:i.logBalance)&&(!e.doneTime||Math.ceil(Date.now()/1e3)-e.doneTime<300)){const n=null===(o=e.metadata)||void 0===o?void 0:o.logBalance;t=Object.assign(Object.assign({},t),n)}})),t}),[e&&Array.from(e)]),o=n.useMemo((()=>{let t={};return null==e||e.forEach((([e,n])=>{var i,o;if(n===Ka.Success&&(null===(i=e.metadata)||void 0===i?void 0:i.logBalance)&&e.doneTime&&Math.ceil(Date.now()/1e3)-e.doneTime<300){const n=null===(o=e.metadata)||void 0===o?void 0:o.logBalance;t=Object.assign(Object.assign({},t),n)}})),t}),[e&&Array.from(e)]),r=n.useCallback(((e,n,i)=>{const o=e[n];if(!o)return!1;return!!(s.isBigNumber(i)?i:new s(i)).isEqualTo(o)||(t((e=>{var t;const i=Object.assign({},e.metadata);return(null===(t=null==i?void 0:i.logBalance)||void 0===t?void 0:t[n])?(delete i.logBalance[n],Object.keys(i.logBalance).length||delete i.logBalance,{brief:e.brief,spec:e.spec,metadata:i}):null})),!1)}),[t]),a=n.useCallback(((e,t)=>r(i,e,t)),[i,r]),l=n.useCallback(((e,t)=>r(o,e,t)),[o,r]);return{balanceData:i,balanceDataDone:o,isTokenLoading:a,isTokenLoadingDone:l}};function Ku({onClick:n,balance:i,decimals:o,address:r,showMaxBtn:a,canClickBalance:s,loading:l,balanceText:d}){const{palette:c}=t.useTheme(),u=s&&(null==i?void 0:i.gt(0))&&n;return z.jsxs(t.Box,{sx:Object.assign({typography:"body2",alignItems:"center",color:c.text.secondary,wordBreak:"break-word",textAlign:"right"},u?{"&:hover":{color:c.text.primary,cursor:"pointer"}}:{}),onClick:u?()=>n(i?i.toString():""):void 0,children:[null!=d?d:z.jsx(e.Trans,{id:"0QDjxt",message:"Balance:"})," ",l?z.jsx(t.RotatingIcon,{sx:{position:"relative",top:-2,verticalAlign:"middle"}}):z.jsxs(z.Fragment,{children:[r?ir({input:i,decimals:Math.min(o||4,4)}):"-",a&&i&&i.gt(0)&&n&&z.jsx(t.Box,{component:t.ButtonBase,sx:{ml:6,color:(null==i?void 0:i.gt(0))?c.primary.main:c.text.disabled,cursor:r?"pointer":"unset",typography:"body2"},onClick:()=>n&&n(i?i.toString():""),children:z.jsx(e.Trans,{id:"CK1KXz",message:"Max"})})]})]})}const Ju=n.forwardRef((function({readOnly:e,sx:i,value:o,decimals:r,onChange:a,suffix:s,suffixGap:l=0,withClear:d,onFocus:c,placeholder:u,readonlyShowSuffix:p,typography:h},m){const x=t.useTheme(),g=n.useMemo((()=>s||(d&&o&&a?z.jsx(t.Box,{component:t.ButtonBase,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,color:"text.secondary","&:focus-visible":{border:"solid 1px",borderColor:"text.primary"}},onClick:()=>{a&&a("")},children:z.jsx(t.Box,{component:oe.Error,sx:{width:12}})}):void 0)),[a,s,x.palette.text.primary,o,d]);return z.jsx(t.Input,{fullWidth:!0,value:o,readOnly:e,placeholder:u||"0.00",onFocus:c,onChange:e=>{const t=e.target.value,n=0===t.length?"":ar(t,r);a&&a(n)},"data-testid":"number-input-wrapper",suffix:(!e||p)&&g,suffixGap:l,ref:m,sx:Object.assign({border:"none","& input":{fontSize:24,typography:h,border:"none",outline:"none",padding:0,color:"text.primary","&::placeholder":{fontSize:24,typography:h,color:"text.disabled"}}},i)})}));function ep({token:n,onClick:i,showChainLogo:o,readonly:r,showChainName:a}){var s,l;const d=t.useTheme(),c=(null==n?void 0:n.chainId)?Ro.get(n.chainId):null,u=a&&!!c;return z.jsxs(t.Box,{component:t.ButtonBase,sx:{display:"flex",alignItems:"center",gap:8,color:d.palette.text.primary,typography:u?"body2":"body1",fontWeight:600,"&:focus-visible":{opacity:.5}},onClick:e=>{r||i&&i(e)},"data-testid":Go,children:[!!(null==n?void 0:n.address)&&z.jsx(sl,{url:null==n?void 0:n.logoURI,address:null!==(s=null==n?void 0:n.address)&&void 0!==s?s:"",chainId:null==n?void 0:n.chainId,noShowChain:!o,width:32,height:32,chainSize:16,logoOffset:6,marginRight:0}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[(null==n?void 0:n.address)?z.jsx(z.Fragment,{children:z.jsx(t.Box,{children:null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"-"})}):z.jsx(e.Trans,{id:"sIPJGT",message:"SELECT TOKEN"}),!r&&z.jsx("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 11.75L12 7.25H6L9 11.75Z",fill:"currentColor"})})]}),!!u&&z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary"},children:[c.name,z.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"})})]})]})]})}function tp({chain:e,active:n,onClick:i}){return z.jsx(t.Tooltip,{title:e.name,placement:"top",onlyHover:!0,children:z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",gap:8,p:8,borderRadius:8,cursor:"pointer",border:"1px solid"},n?{backgroundColor:"tabActive.main",borderColor:"tabActive.main",color:"primary.main"}:{borderColor:"border.main","&:hover":{backgroundColor:"hover.default"}}),onClick:i,children:[z.jsx(t.Box,{component:e.logo,sx:{width:24,height:24}}),n&&z.jsx(t.Box,{sx:{typography:"body2",color:"primary.main"},children:e.name})]})},e.chainId)}var np=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],i=0;i<e.rangeCount;i++)n.push(e.getRangeAt(i));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}},ip={"text/plain":"Text","text/html":"Url",default:"Text"};var op=function(e,t){var n,i,o,r,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(o=np(),r=document.createRange(),a=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(i){if(i.stopPropagation(),t.format)if(i.preventDefault(),void 0===i.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=ip[t.format]||ip.default;window.clipboardData.setData(o,e)}else i.clipboardData.clearData(),i.clipboardData.setData(t.format,e);t.onCopy&&(i.preventDefault(),t.onCopy(i.clipboardData))})),document.body.appendChild(s),r.selectNodeContents(s),a.addRange(r),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(r):a.removeAllRanges()),s&&document.body.removeChild(s),o()}return l},rp=U(op);function ap({copyText:e,size:i,sx:r,componentProps:a,onClick:s,children:l}){var d;const[c,u]=n.useState(!1);return z.jsx(t.TooltipToast,{title:o.i18n._({id:"6V3Ea3",message:"Copied"}),open:c,onClose:()=>u(!1),arrow:!1,children:z.jsxs(t.Box,{...a,component:null!==(d=null==a?void 0:a.component)&&void 0!==d?d:t.ButtonBase,onClick:t=>{if(null==a?void 0:a.onClick)return a.onClick(t);t.stopPropagation(),e&&(rp(e),u(!0)),s&&s()},sx:Object.assign({cursor:"pointer"},null==a?void 0:a.sx),children:[z.jsx(t.Box,{component:oe.Copy,sx:Object.assign({width:i||"auto",height:i||"auto"},r)}),l]})})}function sp({truncate:e,address:n,disabledAddress:i,sx:o,handleOpen:r,addressHoverColor:a,addressHoverShowIcon:s}){return i?z.jsx(t.Box,{children:e?Ea(n):n}):z.jsx(t.HoverAddUnderLine,{lineSx:{bottom:-1},lineColor:null!=a?a:(null==o?void 0:o.color)||"",hoverSx:{color:"addressHoverColor","& svg":{display:"inline-block"}},className:"truncate-address-link",children:z.jsxs(t.Box,{onClick:e=>{null==r||r(e,"address")},sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[e?Ea(n):n,s?z.jsx(t.Box,{component:oe.ArrowRight,sx:{display:"none",width:14,height:14}}):""]})})}function lp({address:e,truncate:n,showCopy:i,size:o="medium",iconSize:r,iconSpace:a,sx:s,iconDarkHover:l,disabledAddress:d,addressHoverColor:c,addressHoverShowIcon:u,customChainId:p,handleOpen:h,onAddressClick:m,onShareClick:x}){const g=t.useTheme(),{chainId:f}=Pa(),y=null!=p?p:f,v="big"===o,b="medium"===o,C=l?t.HoverAddBackground:t.HoverOpacity,j=e=>{let t=e?12:8;return a&&(t=a),l&&(t-=3),t},w=v?"h5":b?"body1":"body2",k=(t,n)=>{h?h(t,n):y&&(t.stopPropagation(),window.open(Ia(y,e,"address")))},T=r||(b?16:14);return z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",typography:w,color:g.palette.text.primary,lineHeight:"normal"},s||{}),children:[z.jsx(sp,{truncate:n,address:e,disabledAddress:d,sx:s,typography:w,handleOpen:null!=m?m:k,addressHoverColor:c,addressHoverShowIcon:u}),z.jsx(C,{sx:{display:"inline-flex",ml:j(b),cursor:"pointer"},onClick:e=>{k(e,"icon")},children:z.jsx(t.Box,{component:oe.ArrowTopRightBorder,sx:{width:T,height:T}})}),i?z.jsx(ap,{size:T,copyText:e,componentProps:{component:C,sx:{ml:j(b),display:"inline-flex",alignItems:"center",justifyContent:"center"}}}):null,!!x&&z.jsx(C,{sx:{display:"inline-flex",ml:j(b),cursor:"pointer"},onClick:e=>{x(e)},children:z.jsx(t.Box,{component:oe.Share,sx:{width:T,height:T,ml:j(b)}})})]})}function dp({token:e,disabled:n,style:i,balance:o,onClick:r}){const a=t.useTheme(),s=o?ir({input:o,decimals:e.decimals}):"";return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",px:8,py:8,borderRadius:8,cursor:n?"auto":"pointer",opacity:n?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:i,onClick:()=>{n||r()},"data-testid":Xo,children:[z.jsx(sl,{token:e,width:32,height:32,noShowChain:!0,noBorder:!0}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[z.jsx(t.Box,{sx:{textAlign:"left",color:"text.primary",typography:"body2",fontWeight:600},children:e.symbol}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:{color:"text.secondary",typography:"h6",fontWeight:500,maxWidth:"80px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,children:e.name}),z.jsx(lp,{address:e.address,customChainId:e.chainId,showCopy:!0,truncate:!0,iconSpace:2,iconSize:12,size:"small",sx:{typography:"h6",color:"text.disabled"}})]})]}),z.jsx(t.Box,{sx:{ml:"auto",typography:"body1",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(null==o?void 0:o.gte(0))?s:z.jsx(t.Box,{component:oe.Loading,width:18,sx:{"& path":{fill:a.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})}function cp(){return z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[z.jsx(t.Skeleton,{variant:"circular",width:32,sx:{mt:8}}),z.jsxs(t.Box,{sx:{ml:8,flex:"1 0 auto"},children:[z.jsx(t.Skeleton,{sx:{borderRadius:4},height:24}),z.jsx(t.Skeleton,{sx:{mt:4,borderRadius:4},height:19,width:137})]})]})}function up({chainId:e,value:i,onChange:r,occupiedAddrs:a,occupiedChainId:s,hiddenAddrs:l,showAddrs:d,visible:u,side:p,defaultLoadBalance:h,multiple:m,searchPlaceholder:x,searchOtherAddress:g,sx:f}){const{chainList:y,selectChainId:v,setSelectChainId:b}=function(e){const{crossChain:t,defaultChainId:i,IS_TEST_ENV:o}=Q(),r=n.useMemo((()=>t?o?Array.from(Ro.values()):Array.from(Ro.values()).filter((e=>!e.isTestNet)):[]),[o,t]),[a,s]=n.useState(i);return n.useEffect((()=>{s((e=>void 0===e?i:e))}),[i]),{chainList:r,selectChainId:n.useMemo((()=>null!=a?a:i),[a,i]),setSelectChainId:s}}(),{showTokenList:C,filter:j,setFilter:w,onSelectToken:k,popularTokenList:T,tokenInfoMap:E}=al({value:i,onChange:r,occupiedAddrs:a,occupiedChainId:s,hiddenAddrs:l,showAddrs:d,side:p,chainId:null!=e?e:v,visible:u,defaultLoadBalance:h,multiple:m}),I=n.useRef(null),A=n.useRef(null),[S,L]=n.useState(329);n.useEffect((()=>{if(u&&i)if(Array.isArray(i)){const[e]=i;e&&e.chainId!==v&&b(e.chainId)}else b(i.chainId)}),[i,u]),n.useEffect((()=>{if(u&&I.current){const e=new ResizeObserver((e=>{for(const t of e)if(t.target===I.current&&A.current){const e=t.contentRect.height-48-A.current.offsetHeight-16;e>0&&L(e)}}));return e.observe(I.current),()=>{e.disconnect()}}}),[u,v]);const M=c.useQuery({queryKey:["token-picker-searchOtherAddress",j],queryFn:()=>g?g(j):null,enabled:Ba(j)&&!!g}),R=n.useCallback((({index:e,style:t})=>{var n;const o=C[e];if(!o)return null;let r=!1;return i&&(r=Array.isArray(i)?i.some((e=>e.address===o.address&&e.chainId===o.chainId)):i.address===o.address&&i.chainId===o.chainId),z.jsx(dp,{token:o,disabled:r,style:t,onClick:()=>k(o),balance:null===(n=E.get(`${o.chainId}-${o.address}`))||void 0===n?void 0:n.balance},o.address+o.chainId)}),[C,T,i]);return z.jsxs(t.Box,{sx:Object.assign({display:"flex",flexDirection:"column",px:16,flexGrow:1,overflow:"hidden"},f),ref:I,children:[z.jsx(t.SearchInput,{fullWidth:!0,height:48,value:j,onChange:e=>w(e.target.value),clearValue:()=>w(""),placeholder:null!=x?x:o.i18n._({id:"72/M0o",message:"Enter the token symbol or address"}),sx:{mb:16}}),void 0===e&&y.length>0&&z.jsx(t.Box,{ref:A,sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},children:y.map((e=>z.jsx(tp,{chain:e,active:e.chainId===v,onClick:()=>{b(e.chainId)}},e.chainId)))}),z.jsx(t.Box,{sx:{pb:16,flexGrow:1},children:C.length?z.jsx(B.FixedSizeList,{height:S,itemCount:C.length,itemSize:56,width:"100%",className:"token-list",children:R}):z.jsx(t.Box,{sx:{height:S,overflowY:"auto"},children:M.isLoading?z.jsx(cp,{}):M.data?M.data:z.jsx(X,{hasSearch:!0,sx:{mt:80}})})})]})}function pp(t){const{height:n,TokenPickerDialog:i}=Q(),{isMobile:o}=Xa();if(i)return z.jsx(i,{...t});const{open:r,title:a,value:s,onClose:l,occupiedAddrs:d,hiddenAddrs:c,occupiedChainId:u,onTokenChange:p,side:h,defaultLoadBalance:m,multiple:x,searchPlaceholder:g,searchOtherAddress:f,chainId:y,modal:v}=t;return z.jsx(el,{height:v?"80vh":n,open:r,onClose:l,title:null!=a?a:z.jsx(e.Trans,{id:"T0Y2+3",message:"Select a token"}),id:"select-token",testId:Yo,modal:v,children:z.jsx(up,{value:s,visible:r,onChange:p,occupiedAddrs:d,occupiedChainId:u,hiddenAddrs:c,side:h,defaultLoadBalance:m,multiple:x,searchPlaceholder:g,searchOtherAddress:f,chainId:y,sx:v?{width:o?"100%":420,borderRadius:16}:void 0})})}const hp=/^ST[0-9A-HJ-NP-Z]{39}$/;const mp=({chainId:e,open:i,onClose:o,inputToAddress:a,setInputToAddress:s})=>{const d=t.useTheme(),[c,u]=n.useState(a||""),p=function(e,t){return n.useMemo((()=>{if(!e)return!1;const n=Ro.get(t);if(!n)return!1;try{if(n.isEVMChain)return!!Xr(e);if(n.isSolanaChain)return new l.PublicKey(e),!0;if(n.isBTCChain){if(hp.test(e))return!0;try{return t===r.ChainId.BTC_SIGNET?_.address.toOutputScript(e,Ud):_.address.toOutputScript(e,_.networks.bitcoin),!0}catch(e){return!1}}return!1}catch(e){return!1}}),[e,t])}(c,e),h=n.useMemo((()=>Ro.get(e)),[e]);return z.jsx(el,{open:i,onClose:o,title:"Receive address",modal:!0,children:z.jsxs(t.Box,{sx:{minWidth:420,p:20,borderTop:`1px solid ${d.palette.border.main}`,display:"flex",flexDirection:"column",gap:20},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[z.jsx(t.Input,{fullWidth:!0,value:c,placeholder:`Enter ${null==h?void 0:h.name} address`,onChange:e=>{u(e.target.value)},height:48,suffix:c?z.jsx(t.Box,{component:t.ButtonBase,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,color:"text.secondary","&:focus-visible":{border:"solid 1px",borderColor:"text.primary"}},onClick:()=>{u("")},children:z.jsx(t.Box,{component:oe.Error,sx:{width:12}})}):null}),!p&&c&&z.jsx(t.Box,{sx:{typography:"h6",color:"error.main"},children:"Invalid address"})]}),z.jsx(t.Button,{fullWidth:!0,variant:t.Button.Variant.contained,size:t.Button.Size.middle,disabled:!c||!p,onClick:()=>{s(c),o()},children:"Confirm"})]})})},xp=({token:e,enterAddressEnabled:i=!1,inputToAddress:o,setInputToAddress:r,account:a})=>{var s,l,d,c,u,p;const h=e.chainId,{open:m,disconnect:x}=Pa(),[g,f]=n.useState(!1),y=n.useMemo((()=>Ro.get(h)),[h]),v=z.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M12.001 6.3667C12.7373 6.3667 13.3339 6.9634 13.334 7.69971V9.03369H10.1338C9.54481 9.03383 9.06738 9.51108 9.06738 10.1001C9.06751 10.689 9.54488 11.1664 10.1338 11.1665H13.334V12.4995C13.334 13.2359 12.7374 13.8335 12.001 13.8335H4.00098C3.2646 13.8335 2.66797 13.2359 2.66797 12.4995V7.69971C2.66806 6.9634 3.26465 6.3667 4.00098 6.3667H12.001Z",fill:"currentColor"}),z.jsx("ellipse",{cx:"10.1349",cy:"10.1002",rx:"0.533334",ry:"0.533333",fill:"currentColor"}),z.jsx("path",{d:"M8.54243 3.63688C9.14948 3.36708 9.86253 3.5853 10.2146 4.14863L10.9341 5.29984H4.80078L8.54243 3.63688Z",fill:"currentColor"})]});return z.jsxs(z.Fragment,{children:[z.jsx(t.Popup,{triggerChildren:(null===(s=null==a?void 0:a.appKitAccount)||void 0===s?void 0:s.isConnected)?z.jsxs(t.Box,{sx:{display:"inline-flex",alignItems:"center",gap:4,px:4,py:2,borderRadius:4,backgroundColor:"background.tag",typography:"h6",lineHeight:"16px"},children:[v,Ea(null===(l=null==a?void 0:a.appKitAccount)||void 0===l?void 0:l.address),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:z.jsx("path",{d:"M12.667 6.93016L11.5703 5.8335L8.00033 9.39572L4.43033 5.8335L3.33366 6.93016L8.00033 11.5968L12.667 6.93016Z",fill:"currentColor",fillOpacity:"0.5"})})]}):z.jsxs(t.Box,{sx:{display:"inline-flex",alignItems:"center",gap:4,px:4,py:2,borderRadius:4,backgroundColor:"background.tag",typography:"h6",lineHeight:"16px"},children:["Wallet address:",Ea(null===(d=null==a?void 0:a.appKitAccount)||void 0===d?void 0:d.address),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:z.jsx("path",{d:"M3.33301 10.0698L4.42967 11.1665L7.99967 7.60428L11.5697 11.1665L12.6663 10.0698L7.99967 5.40317L3.33301 10.0698Z",fill:"currentColor",fillOpacity:"0.5"})})]}),titleSx:{display:"flex",flexDirection:"column",gap:8},children:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[z.jsxs(t.Box,{sx:{typography:"h6",lineHeight:"16px",color:"text.secondary"},children:["Connected(",Sa(h),")"]}),(null===(c=null==a?void 0:a.appKitAccount)||void 0===c?void 0:c.isConnected)?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8,px:8,py:8,color:"text.primary",borderRadius:8,backgroundColor:"background.paperContrast",typography:"body2",lineHeight:"19px"},children:[o?v:y&&z.jsx(t.Box,{component:y.logo,sx:{width:16,height:16}}),Ea(null===(u=null==a?void 0:a.appKitAccount)||void 0===u?void 0:u.address),z.jsx(t.Box,{sx:{ml:"auto",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>{o?r(null):x({namespace:null==a?void 0:a.namespace})},children:z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.25 2.25H9.75V9.75H8.25V2.25ZM12.3075 4.94244L13.3725 3.87744C14.8275 5.11494 15.75 6.94494 15.75 8.99994C15.75 12.7274 12.7275 15.7499 9 15.7499C5.2725 15.7499 2.25 12.7274 2.25 8.99994C2.25 6.94494 3.1725 5.11494 4.6275 3.87744L5.685 4.93494C4.5075 5.89494 3.75 7.35744 3.75 8.99994C3.75 11.9024 6.0975 14.2499 9 14.2499C11.9025 14.2499 14.25 11.9024 14.25 8.99994C14.25 7.35744 13.4925 5.89494 12.3075 4.94244Z",fill:"#ED4A25"})})})]}):z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{height:"1px",width:"100%",backgroundColor:"border.main"}}),z.jsx(t.Box,{sx:{p:8,cursor:"pointer",typography:"body2",lineHeight:"19px",color:"text.primary","&:hover":{borderRadius:8,backgroundColor:"background.paperContrast"}},onClick:()=>{m({namespace:null==a?void 0:a.namespace})},children:"Connect a new wallet"})]}),i&&z.jsxs(z.Fragment,{children:[(null===(p=null==a?void 0:a.appKitAccount)||void 0===p?void 0:p.isConnected)&&z.jsx(t.Box,{sx:{height:"1px",width:"100%",backgroundColor:"border.main"}}),z.jsx(t.Box,{sx:{p:8,cursor:"pointer",typography:"body2",lineHeight:"19px",color:"text.primary","&:hover":{borderRadius:8,backgroundColor:"background.paperContrast"}},onClick:()=>{f(!0)},children:"Enter receive address"})]})]})}),g&&z.jsx(mp,{open:g,onClose:()=>f(!1),chainId:h,inputToAddress:o,setInputToAddress:r})]})};function gp({sx:i,amt:o,token:r,readOnly:a,showMaxBtn:s,canClickBalance:l,onMaxClick:d,fiatPriceTxt:u,failedReason:p,occupiedAddrs:h,occupiedChainId:m,onInputFocus:x,onTokenClick:g,onInputChange:f,onTokenChange:y,side:v,showChainLogo:b,showChainName:C,defaultLoadBalance:j,overrideBalance:w,overrideBalanceLoading:k,balanceText:T,showPercentage:B,inputReadonlyTooltip:E,inputTypography:I,hideToken:A,checkLogBalance:S,notTokenPickerModal:L,enterAddressEnabled:M,inputToAddress:R,setInputToAddress:O,account:P}){var _,D,N;const F=t.useTheme(),[U,q]=n.useState(!1),V=c.useQuery(Hi.getFetchTokenQuery(null==r?void 0:r.chainId,null==r?void 0:r.address,null===(_=null==P?void 0:P.appKitAccount)||void 0===_?void 0:_.address)),W=null!==(N=null!=w?w:null===(D=V.data)||void 0===D?void 0:D.balance)&&void 0!==N?N:null,{isTokenLoading:H}=Xu();let Z=null!=k?k:V.isLoading;!Z&&W&&(S?Z=Object.entries(S).some((([e,t])=>H(e,t))):r&&(Z=H(r.address,W))),Ga({tokenList:r?[r]:[]});const[$,G]=n.useState(0),Y=n.useRef("");n.useEffect((()=>{o!==Y.current&&G(0)}),[o]);const{gotoBuyToken:X}=Q();let K=X&&W&&o&&W.lt(o);const J=!!f||!!E,ee={"& input":{typography:"h2",height:"44px",border:"none",outline:"none",padding:0,color:"text.primary","&::placeholder":{typography:"h2",height:"44px",color:"text.disabled"}},backgroundColor:"background.paper"};return z.jsxs(t.Box,{sx:Object.assign({minHeight:J?133:"auto",padding:F.spacing(20,20,24),overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",borderRadius:12,backgroundColor:F.palette.background.paper},i),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[A?z.jsx(t.Box,{}):z.jsx(ep,{token:r,showChainLogo:b,showChainName:C,onClick:()=>q(!0),readonly:!y}),r&&z.jsx(xp,{token:r,enterAddressEnabled:M,inputToAddress:R,setInputToAddress:O,account:P})]}),J&&(a&&E?z.jsx(t.TooltipToast,{title:E,arrow:!1,children:z.jsx(t.Box,{children:z.jsx(Ju,{value:o,readOnly:!0,withClear:!0,sx:Object.assign({mt:16},ee)})})}):z.jsx(Ju,{value:o,onFocus:x,onChange:f?e=>{f(e),G(0)}:void 0,readOnly:a,withClear:!0,suffix:K?z.jsx(t.Button,{variant:t.Button.Variant.tag,backgroundColor:F.palette.background.paperDarkContrast,sx:{fontSize:12},onClick:e=>{var t;e.stopPropagation(),(null===(t=null==P?void 0:P.appKitAccount)||void 0===t?void 0:t.address)&&(null==X||X({token:r,account:P.appKitAccount.address}))},children:z.jsx(e.Trans,{id:"qiOIiY",message:"Buy"})}):void 0,typography:I,sx:Object.assign({mt:16},ee)})),p&&z.jsx(t.Box,{sx:{mt:4,typography:"h6",lineHeight:"16px",fontWeight:500,color:F.palette.error.main},children:p}),z.jsxs(t.Box,{sx:{mt:B?9:4,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsx(t.Box,{sx:{typography:"h6",color:F.palette.text.secondary},children:u}),z.jsx(Ku,{balance:W,balanceText:T,onClick:a||!d&&!f?void 0:e=>{d?d(e):f&&f(e),0!==$&&1!==$&&(G(1),Y.current=e)},showMaxBtn:s,canClickBalance:l,address:null==r?void 0:r.address,decimals:null==r?void 0:r.decimals,loading:Z})]}),z.jsx(pp,{value:r,open:U,side:v,chainId:void 0,occupiedAddrs:h,occupiedChainId:m,defaultLoadBalance:j,onClose:()=>{q(!1),g&&g()},onTokenChange:(e,t)=>{q(!1),setTimeout((()=>{!Array.isArray(e)&&y&&y(e,t)}),Xs)},modal:!L})]})}function fp({rawRouteData:e,chainId:t}){const i=n.useMemo((()=>{if(!e)return[];try{const n=JSON.parse(e);return n.subRoute[0].midPath.map((e=>{const{fromToken:n,toToken:i,oneSplitTotalPart:o}=e,r=new Map;return e.poolDetails.forEach((e=>{var t;const n={poolPart:gr({input:new s(e.poolPart).div(o)}),poolAddress:e.pool||null};r.has(e.poolName)?null===(t=r.get(e.poolName))||void 0===t||t.push(n):r.set(e.poolName,[n])})),{fromToken:n,toToken:i,chainId:t,poolDetails:r}}))}catch(e){console.error(e)}return[]}),[t,e]);return{routeData:i}}const yp=({routeInfo:i,toToken:o,fromToken:r})=>{const[a,s]=n.useState(!1),l=t.useTheme(),{isMobile:d}=Xa(),c=n.useMemo((()=>{const e=[{key:"from",logo:z.jsx(sl,{token:r,noShowChain:!0,height:14,width:14,marginRight:0})}];return e.push({key:"to",logo:z.jsx(sl,{token:o,noShowChain:!0,height:14,width:14,marginRight:0})}),e}),[r,o]),{routeData:u}=fp({rawRouteData:i,chainId:null==r?void 0:r.chainId});return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{py:4,pl:8,pr:4,display:"flex",alignItems:"center",gap:4,borderRadius:12,backgroundColor:l.palette.background.tag,cursor:"pointer",typography:"h6",fontWeight:500,color:l.palette.text.secondary,"&:hover":{color:l.palette.text.primary}},onClick:()=>{s(!0)},children:[z.jsx(t.Box,{sx:{color:l.palette.text.primary},children:"Route:"}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:0},children:c.map(((e,t)=>z.jsx(n.Fragment,{children:e.logo},e.key)))}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:z.jsx("path",{d:"M2.91699 11.0833V7.58332H4.08366V9.91666H6.41699V11.0833H2.91699ZM9.91699 6.41666V4.08332H7.58366V2.91666H11.0837V6.41666H9.91699Z",fill:"currentColor"})})]}),z.jsx(el,{open:a,title:z.jsx(e.Trans,{id:"rT8e1f",message:"Route"}),onClose:()=>s(!1),modal:!0,children:z.jsx(t.Box,{sx:{minWidth:d?"100%":800,py:20,px:20,borderTop:`1px solid ${l.palette.border.main}`},children:d?z.jsx(xl,{routeData:u,fromTokenRaw:r,toTokenRaw:o}):z.jsx(gl,{routeData:u,fromTokenRaw:r,toTokenRaw:o})})})]})};function vp({toToken:i,fromToken:o,priceStatus:r,pricePerToToken:a,pricePerFromToken:s,routeInfo:l}){const d=t.useTheme(),[c,u]=n.useState("-"),[p,h]=n.useState(null),[m,x]=n.useState("-"),[g,f]=n.useState(null);n.useEffect((()=>{u(null==o?void 0:o.symbol),x(null==i?void 0:i.symbol),h(a),f(s)}),[o,i,a,s]);const y=n.useCallback((()=>{u(m),x(c),h(g),f(p)}),[c,p,m,g]);return z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:{[bs.Initial]:"-",[bs.Loading]:z.jsxs(z.Fragment,{children:[z.jsx(t.RotatingIcon,{sx:{mr:5}}),z.jsx(e.Trans,{id:"JdNn1Y",message:"Fetching best price..."})]}),[bs.Failed]:z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{component:oe.Warn,sx:{width:15,mr:5,color:"warning.main"}}),z.jsx(e.Trans,{id:"NVAuTg",message:"Quote not available"})]}),[bs.Success]:z.jsxs(t.Box,{sx:{width:"100%",mt:16,px:11,py:7,borderRadius:12,border:`solid 1px ${d.palette.border.main}`,display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"flex-start",gap:6},children:[z.jsxs(t.Box,{sx:{typography:"body2",lineHeight:"18px",color:d.palette.text.primary},children:["1 ",c," ",z.jsx("span",{style:{color:d.palette.text.secondary},children:"="})," $",nr({input:g,showDecimals:4})," ",m]}),z.jsx(t.Box,{component:t.ButtonBase,sx:{width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:z.jsx(t.Box,{sx:{width:16,color:"text.secondary"},onClick:y,component:oe.Switch})})]}),o&&i&&z.jsx(yp,{routeInfo:l,fromToken:o,toToken:i})]})}[r]})}const bp=[.25,.5,.75,1];function Cp({value:e,onChange:n,sx:i}){const o=t.useTheme(),r="light"===o.palette.mode,{isMobile:a}=Xa();return z.jsx(t.Box,{sx:Object.assign({display:"grid",gap:a?10:14,gridTemplateColumns:`repeat(${bp.length}, 1fr)`},i),children:bp.map((i=>{const a=i===e;return z.jsxs(t.ButtonBase,{disabled:!n,sx:{typography:"h6",borderRadius:4,padding:o.spacing(4,0),width:"100%",color:"text.secondary",backgroundColor:"background.paperDarkContrast","&:disabled":{color:"text.disabled"},"&:not(:disabled)&:hover":{color:o.palette.text.primary,backgroundColor:t.alpha(o.palette.text.primary,.2)},"&.selected, &:focus":{color:"#fff",backgroundColor:r?o.palette.primary.main:t.alpha(o.palette.text.primary,.4)}},onClick:()=>{!a&&n&&n(i)},className:a?"selected":void 0,children:[100*i,"%"]},i)}))})}function jp(){return t.useTheme(),z.jsx(t.Box,{sx:{height:4,position:"relative",color:"text.secondary"},children:z.jsx(t.Box,{sx:{width:44,height:44,backgroundColor:"background.input",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",borderWidth:4,borderStyle:"solid",borderColor:"background.paper",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%,-50%)",color:"text.secondary"},children:z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:z.jsx("path",{d:"M19.0142 13H13.0142V19H11.0142V13H5.01416V11H11.0142V5H13.0142V11H19.0142V13Z",fill:"currentColor"})})})})}function wp(){return z.jsx(t.Box,{sx:{position:"relative",height:4},children:z.jsx(t.Box,{sx:{width:44,height:44,borderRadius:22,backgroundColor:"background.input",borderWidth:4,borderColor:"background.paper",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%,-50%) rotate(90deg)",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:z.jsx(t.Box,{component:oe.Plus})})})}function kp({sx:i,inputSx:o,amt:r,token:a,readOnly:s,showMaxBtn:l,canClickBalance:d,onMaxClick:u,fiatPriceTxt:p,occupiedAddrs:h,occupiedChainId:m,onInputFocus:x,onTokenClick:g,onInputChange:f,onTokenChange:y,side:v,showChainLogo:b,showChainName:C,defaultLoadBalance:j,overrideBalance:w,overrideBalanceLoading:k,balanceText:T,showPercentage:B,inputReadonlyTooltip:E,inputTypography:I,chainId:A,hideToken:S,checkLogBalance:L,notTokenPickerModal:M}){var R,O;const{account:P}=Pa(),_=t.useTheme(),[D,N]=n.useState(!1),F=c.useQuery(Hi.getFetchTokenQuery(null==a?void 0:a.chainId,null==a?void 0:a.address,P)),U=null!==(O=null!=w?w:null===(R=F.data)||void 0===R?void 0:R.balance)&&void 0!==O?O:null,{isTokenLoading:q}=Xu();let V=null!=k?k:F.isLoading;!V&&U&&(L?V=Object.entries(L).some((([e,t])=>q(e,t))):a&&(V=q(a.address,U))),Ga({tokenList:a?[a]:[]});const[W,H]=n.useState(0),Z=n.useRef("");n.useEffect((()=>{r!==Z.current&&H(0)}),[r]);const{gotoBuyToken:$}=Q();let G=$&&U&&r&&U.lt(r);const Y=!!f||!!E;return z.jsxs(t.Box,{sx:Object.assign({minHeight:Y?133:"auto",padding:_.spacing(20,20,24),borderRadius:16,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:_.palette.background.input},i),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[S?z.jsx(t.Box,{}):z.jsx(ep,{token:a,showChainLogo:b,showChainName:C,onClick:()=>N(!0),readonly:!y}),z.jsx(Ku,{balance:U,balanceText:T,onClick:s||!u&&!f?void 0:e=>{u?u(e):f&&f(e),0!==W&&1!==W&&(H(1),Z.current=e)},showMaxBtn:l,canClickBalance:d,address:null==a?void 0:a.address,decimals:null==a?void 0:a.decimals,loading:V})]}),Y&&(s&&E?z.jsx(t.TooltipToast,{title:E,arrow:!1,children:z.jsx(t.Box,{children:z.jsx(Ju,{value:r,readOnly:!0,withClear:!0,sx:Object.assign({mt:12},o)})})}):z.jsx(Ju,{value:r,onFocus:x,onChange:f?e=>{f(e),H(0)}:void 0,readOnly:s,withClear:!0,suffix:G?z.jsx(t.Button,{variant:t.Button.Variant.tag,backgroundColor:_.palette.background.paperDarkContrast,sx:{fontSize:12},onClick:e=>{e.stopPropagation(),null==$||$({token:a,account:P})},children:z.jsx(e.Trans,{id:"qiOIiY",message:"Buy"})}):void 0,typography:I,sx:Object.assign({mt:12},o)})),!s&&B?z.jsx(Cp,{sx:{mt:16},value:W,onChange:U&&void 0!==(null==a?void 0:a.decimals)?e=>{if(U&&(null==a?void 0:a.decimals))if(H(e),1===e){const e=U.toString();u?u(e):f&&f(e),Z.current=e}else if(f){const t=U.multipliedBy(e).dp(a.decimals).toString();f(t),Z.current=t}}:void 0}):"",void 0!==p?z.jsx(t.Box,{sx:{mt:B?9:0,typography:"h6",color:_.palette.text.secondary},children:p}):"",z.jsx(pp,{value:a,open:D,side:v,chainId:A,occupiedAddrs:h,occupiedChainId:m,defaultLoadBalance:j,onClose:()=>{N(!1),g&&g()},onTokenChange:(e,t)=>{N(!1),setTimeout((()=>{!Array.isArray(e)&&y&&y(e,t)}),Xs)},modal:!M})]})}var Tp;function Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Bp.apply(null,arguments)}const Ep=e=>P.createElement("svg",Bp({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Tp||(Tp=P.createElement("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"}))),Ip=e=>Object.keys(new Array(e+1).join(","));function Ap(e){return null!=e&&""!==e}var Sp;function Lp(){return Lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Lp.apply(null,arguments)}const Mp=e=>P.createElement("svg",Lp({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),Sp||(Sp=P.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},P.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),P.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),P.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),P.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),P.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),P.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),P.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),P.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),P.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),P.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),P.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),P.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),P.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),P.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),P.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),P.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),P.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),P.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),P.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},P.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),P.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),P.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),P.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),P.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),P.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),P.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),P.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),P.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),P.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),P.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),P.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))));function Rp(e){const{switchNetwork:t}=m.useAppKitNetwork();return n.useMemo((()=>{var n;if(!e)return;const i=null===(n=Ro.get(e))||void 0===n?void 0:n.caipNetwork;return i?()=>t(i):void 0}),[e,t])}function Op({token:e,size:r="small",sx:a,children:s}){const[l,d]=n.useState(!1),{evmProvider:c,chainId:u}=Pa(),p=Rp(e.chainId);return z.jsxs(t.Box,{sx:i.merge({margin:"0",border:"none",padding:"0",background:"none",cursor:"pointer","&:focus":{outline:"none"},"&:active":{outline:"none"},display:"inline-flex",alignItems:"center",justifyContent:"center"},a),onClick:t=>N(this,void 0,void 0,(function*(){if(t.stopPropagation(),void 0!==e.chainId&&e.chainId!==u&&p)return void(null==p||p());if(l)return;if(!c)return;d(!0);const{result:n,failMsg:i}=yield function(e,t){return N(this,void 0,void 0,(function*(){if(!e)return{result:!1};try{return{result:yield e.send("wallet_watchAsset",{type:"ERC20",options:{address:t.address,symbol:t.symbol,decimals:t.decimals,image:t.logoURI}})}}catch(e){return console.error(e),{result:!1,failMsg:null==e?void 0:e.message}}}))}(c,e);n?lu.getState().toast({message:o.i18n._({id:"DupCvC",message:"Added successful"}),type:"success",timeout:3e3}):lu.getState().toast({message:`${o.i18n._({id:"v4wgrk",message:"Failed to add"})}${i?`: ${i}`:""}`,type:"error"}),d(!1)})),component:"button",children:[z.jsx(t.Box,{component:Mp,sx:Object.assign({},"medium"===r?{width:16,height:16}:{width:14,height:14})}),s]})}function Pp({tokens:e,width:n=24,height:i=24,gap:o=-4,cross:r,mr:a,chainId:s,showChainLogo:l,sx:d}){var c;const u=t.useTheme(),{onlyChainId:p}=Q(),h=l&&!p,m=n/2;return!e||e.length<=0?z.jsx(t.Box,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:a,position:"relative",zIndex:0},d),children:z.jsx(t.Box,{component:"svg",xmlns:"http://www.w3.org/2000/svg",width:52,height:24,viewBox:"0 0 52 24",fill:"none",sx:{height:n,width:"auto",color:t.alpha(u.palette.text.primary,"light"===u.palette.mode?.11:.13),animation:"pulseKeyframe 2s ease-in-out 0.5s infinite","@keyframes pulseKeyframe":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}},children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.3746 4.50813C19.1755 1.76008 15.7933 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24C15.7933 24 19.1755 22.2399 21.3746 19.4919C19.8788 17.3743 19 14.7898 19 12C19 9.21023 19.8788 6.62571 21.3746 4.50813ZM22 5.36441C24.1498 2.13102 27.8261 0 32 0C38.3911 0 43.6152 4.99623 43.9797 11.296C41.0986 12.163 39 14.8364 39 18C39 19.1371 39.2711 20.2108 39.7523 21.1602C37.6611 22.9317 34.9553 24 32 24C27.8261 24 24.1498 21.869 22 18.6356C20.7363 16.735 20 14.4535 20 12C20 9.54653 20.7363 7.26502 22 5.36441ZM52 18C52 21.3137 49.3137 24 46 24C43.5588 24 41.458 22.542 40.5211 20.4493C40.5042 20.4116 40.4876 20.3736 40.4715 20.3355C40.1679 19.6176 40 18.8284 40 18C40 15.3894 41.6673 13.1682 43.9952 12.3431C44.6221 12.1209 45.2969 12 46 12C49.3137 12 52 14.6863 52 18Z",fill:"currentColor"})})}):z.jsxs(t.Box,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:a,position:"relative",zIndex:0},d),children:[e.map(((e,i)=>z.jsx(t.Box,{sx:{display:"inline-flex",width:n,height:n,ml:i>0?o:0,borderRadius:"50%",backgroundColor:u.palette.background.default},children:"object"==typeof e?z.jsx(sl,{address:e.address,width:n,height:n,chainId:s,url:e.logoURI,cross:r,noShowChain:!0,noBorder:!0,marginRight:0}):z.jsx(t.Box,{component:"img",height:n,src:e})},i))),h&&Ro.has(s)?z.jsx(t.Box,{component:null===(c=Ro.get(s))||void 0===c?void 0:c.logo,sx:{position:"absolute",bottom:0,right:0,zIndex:e.length+1,transform:"translateX(50%)",width:m,height:m}}):""]})}function _p({loading:e,empty:n,hasSearch:i,children:o,refetch:r}){return e?z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",gap:24,px:24,height:320},children:Ip(4).map(((e,n)=>z.jsx(t.Skeleton,{width:"100%",height:45},n)))}):r?z.jsx(ne,{refresh:r,sx:{height:320}}):n?z.jsx(X,{hasSearch:i,sx:{height:320}}):z.jsx(z.Fragment,{children:o})}function Dp({show:e,onClick:n,sx:i}){return z.jsx(t.Box,{component:t.ButtonBase,sx:Object.assign({p:3,transform:e?"rotate(180deg)":"none",transition:"all 100ms",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},i),onClick:n,children:z.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.58398 11.376C8.78189 11.6728 9.21811 11.6728 9.41603 11.376L12.4818 6.77735C12.7033 6.44507 12.4651 6 12.0657 6H5.93426C5.53491 6 5.29672 6.44507 5.51823 6.77735L8.58398 11.376Z",fill:"currentColor"})})})}function Np({isMobile:e,statusText:n,statusColor:i,time:o,alphaColor:r,sx:a,children:s}){const l=t.useTheme(),d=t.alpha(i,.1),c=r?t.alpha(i,r):i;return z.jsxs(t.Box,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:e?"center":"flex-start",gap:2,typography:"h6",color:"text.secondary"},a),children:[z.jsxs(t.Box,{sx:{padding:l.spacing(4,16),borderRadius:4,backgroundColor:d,color:c,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"},children:[n,s]}),o]})}function Fp({token:e,amount:n,canAddMetamask:i,title:o,linkVisible:r=!0}){var a,s;return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[z.jsxs(t.Box,{sx:{typography:"h6",fontWeight:500,color:"text.primary"},children:[o,": ",ir({input:n,decimals:null==e?void 0:e.decimals})," ",null==e?void 0:e.symbol]}),i&&e&&z.jsx(Op,{token:e})]}),z.jsxs(t.Box,{sx:{display:"inline-flex",alignItems:"center",gap:4,typography:"h6",fontWeight:500,color:"text.secondary"},children:[e&&null!==(s=null===(a=Ro.get(e.chainId))||void 0===a?void 0:a.name)&&void 0!==s?s:"-",r&&z.jsx(Ep,{})]})]})}function Up({token:e,amount:n,showChain:i,hideLogo:o,canAddMetamask:r,sx:a}){var s,l;let d="";i&&(d=null!==(l=null===(s=Ro.get(e.chainId))||void 0===s?void 0:s.name)&&void 0!==l?l:"");const c=ir({input:n,decimals:e.decimals});return z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},a),children:[!o&&z.jsx(sl,{address:e.address,chainId:e.chainId,width:20,height:20}),z.jsxs(t.Box,{sx:{fontWeight:600},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,wordBreak:"break-word"},children:[`${c} ${e.symbol}`,r&&z.jsx(Op,{token:e})]}),!!d&&z.jsxs(t.Box,{sx:{display:"inline-flex",alignItems:"center",gap:2,typography:"h6",fontWeight:500,color:"text.secondary"},children:[d,z.jsx(Ep,{})]})]})]})}function qp({height:n=64,sx:i,onClick:o,hasMore:r,loading:a}){return t.useTheme(),r?z.jsx(t.ButtonBase,{sx:Object.assign({display:"flex",justifyContent:"center",alignItems:"center",height:n,width:"100%",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},i),onClick:o,children:a?z.jsx(t.RotatingIcon,{}):z.jsxs(z.Fragment,{children:[z.jsx(e.Trans,{id:"yQ2kGp",message:"Load more"}),z.jsx(t.Box,{component:oe.ArrowRight,sx:{transform:"rotate(90deg)"}})]})}):null}function Vp(e){var{sx:n,children:i,hasMore:o,loadMore:r,loadMoreLoading:a}=e,s=D(e,["sx","children","hasMore","loadMore","loadMoreLoading"]);return t.useTheme(),z.jsxs(t.Box,{sx:Object.assign({position:"relative",flex:1,overflowY:"auto",pt:12,px:20,pb:20},n),...s,children:[z.jsx(t.Box,{component:"table",sx:{width:"100%",borderCollapse:"separate",borderSpacing:"0 4px","& th":{py:12,px:24,typography:"body2",textAlign:"left",color:"text.secondary",backgroundColor:"background.paper"},"& th:first-of-type":{borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px"},"& th:last-of-type":{borderTopRightRadius:"8px",borderBottomRightRadius:"8px"},"& td":{px:24,py:16,backgroundColor:"background.paper"},"& thead":{position:"sticky",top:0,zIndex:2,"&::after":{content:'""',display:"table-row",height:"0"}}},children:i}),!!r&&z.jsx(qp,{loading:a,hasMore:o,onClick:r})]})}const Wp=new Ir("properties/5.8.0");function Hp(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Zp(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}const zp={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function $p(e){if(null==e||zp[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let i=null;try{i=e[t[n]]}catch(e){continue}if(!$p(i))return!1}return!0}return Wp.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Gp(e){if($p(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Qp(e))));if("object"==typeof e){const t={};for(const n in e){const i=e[n];void 0!==i&&Hp(t,n,Qp(i))}return t}return Wp.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Qp(e){return Gp(e)}class Yp{constructor(e){for(const t in e)this[t]=Qp(e[t])}}const Xp="abi/5.8.0",Kp=new Ir(Xp),Jp={};let eh={calldata:!0,memory:!0,storage:!0},th={calldata:!0,memory:!0};function nh(e,t){if("bytes"===e||"string"===e){if(eh[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&th[t])return!0;return(eh[t]||"payable"===t)&&Kp.throwArgumentError("invalid modifier","name",t),!1}function ih(e,t){for(let n in t)Hp(e,n,t[n])}const oh=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),rh=new RegExp(/^(.*)\[([0-9]*)\]$/);class ah{constructor(e,t){e!==Jp&&Kp.throwError("use fromString",Ir.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),ih(this,t);let n=this.type.match(rh);ih(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:ah.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=oh.sighash),oh[e]||Kp.throwArgumentError("invalid format type","format",e),e===oh.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==oh.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===oh.full?", ":",")+")"):t+=this.type,e!==oh.sighash&&(!0===this.indexed&&(t+=" indexed"),e===oh.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?ah.fromString(e,t):ah.fromObject(e)}static fromObject(e){return ah.isParamType(e)?e:new ah(Jp,{name:e.name||null,type:fh(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ah.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function i(t){Kp.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function o(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let r={type:"",name:"",state:{allowType:!0}},a=r;for(let n=0;n<e.length;n++){let r=e[n];switch(r){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||i(n),a.state.allowType=!1,a.type=fh(a.type),a.components=[o(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||i(n),a.indexed=!0,a.name=""),nh(a.type,a.name)&&(a.name=""),a.type=fh(a.type);let e=a;a=a.parent,a||i(n),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||i(n),a.indexed=!0,a.name=""),nh(a.type,a.name)&&(a.name=""),a.type=fh(a.type);let s=o(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=fh(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||i(n),a.indexed&&i(n),a.indexed=!0,a.name=""):nh(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||i(n),a.type+=r,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||i(n),a.type+=r,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=r,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=r,delete a.state.allowArray):a.state.readArray?a.type+=r:i(n)}}return a.parent&&Kp.throwArgumentError("unexpected eof","param",e),delete r.state,"indexed"===a.name?(t||i(n.length-7),a.indexed&&i(n.length-7),a.indexed=!0,a.name=""):nh(a.type,a.name)&&(a.name=""),r.type=fh(r.type),r}(e,!!t),ah.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}}function sh(e,t){return function(e){e=e.trim();let t=[],n="",i=0;for(let o=0;o<e.length;o++){let r=e[o];","===r&&0===i?(t.push(n),n=""):(n+=r,"("===r?i++:")"===r&&(i--,-1===i&&Kp.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>ah.fromString(e,t)))}class lh{constructor(e,t){e!==Jp&&Kp.throwError("use a static from method",Ir.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),ih(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return lh.isFragment(e)?e:"string"==typeof e?lh.fromString(e):lh.fromObject(e)}static fromObject(e){if(lh.isFragment(e))return e;switch(e.type){case"function":return mh.fromObject(e);case"event":return dh.fromObject(e);case"constructor":return hh.fromObject(e);case"error":return gh.fromObject(e);case"fallback":case"receive":return null}return Kp.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?dh.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?mh.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?hh.fromString(e.trim()):"error"===e.split(" ")[0]?gh.fromString(e.substring(5).trim()):Kp.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class dh extends lh{format(e){if(e||(e=oh.sighash),oh[e]||Kp.throwArgumentError("invalid format type","format",e),e===oh.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==oh.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===oh.full?", ":",")+") ",e!==oh.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?dh.fromString(e):dh.fromObject(e)}static fromObject(e){if(dh.isEventFragment(e))return e;"event"!==e.type&&Kp.throwArgumentError("invalid event object","value",e);const t={name:vh(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ah.fromObject):[],type:"event"};return new dh(Jp,t)}static fromString(e){let t=e.match(bh);t||Kp.throwArgumentError("invalid event string","value",e);let n=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Kp.warn("unknown modifier: "+e)}})),dh.fromObject({name:t[1].trim(),anonymous:n,inputs:sh(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function ch(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&Kp.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||Kp.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=x.BigNumber.from(n[1]),n[0]):e}function uh(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function ph(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Kp.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Kp.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Kp.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Kp.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Kp.throwArgumentError("unable to determine stateMutability","value",e),t}class hh extends lh{format(e){if(e||(e=oh.sighash),oh[e]||Kp.throwArgumentError("invalid format type","format",e),e===oh.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===oh.sighash&&Kp.throwError("cannot format a constructor for sighash",Ir.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===oh.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?hh.fromString(e):hh.fromObject(e)}static fromObject(e){if(hh.isConstructorFragment(e))return e;"constructor"!==e.type&&Kp.throwArgumentError("invalid constructor object","value",e);let t=ph(e);t.constant&&Kp.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ah.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?x.BigNumber.from(e.gas):null};return new hh(Jp,n)}static fromString(e){let t={type:"constructor"},n=(e=ch(e,t)).match(bh);return n&&"constructor"===n[1].trim()||Kp.throwArgumentError("invalid constructor string","value",e),t.inputs=sh(n[2].trim(),!1),uh(n[3].trim(),t),hh.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class mh extends hh{format(e){if(e||(e=oh.sighash),oh[e]||Kp.throwArgumentError("invalid format type","format",e),e===oh.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==oh.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===oh.full?", ":",")+") ",e!==oh.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?mh.fromString(e):mh.fromObject(e)}static fromObject(e){if(mh.isFunctionFragment(e))return e;"function"!==e.type&&Kp.throwArgumentError("invalid function object","value",e);let t=ph(e);const n={type:e.type,name:vh(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ah.fromObject):[],outputs:e.outputs?e.outputs.map(ah.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?x.BigNumber.from(e.gas):null};return new mh(Jp,n)}static fromString(e){let t={type:"function"},n=(e=ch(e,t)).split(" returns ");n.length>2&&Kp.throwArgumentError("invalid function string","value",e);let i=n[0].match(bh);if(i||Kp.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&vh(t.name),t.inputs=sh(i[2],!1),uh(i[3].trim(),t),n.length>1){let i=n[1].match(bh);""==i[1].trim()&&""==i[3].trim()||Kp.throwArgumentError("unexpected tokens","value",e),t.outputs=sh(i[2],!1)}else t.outputs=[];return mh.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function xh(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Kp.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class gh extends lh{format(e){if(e||(e=oh.sighash),oh[e]||Kp.throwArgumentError("invalid format type","format",e),e===oh.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==oh.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===oh.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?gh.fromString(e):gh.fromObject(e)}static fromObject(e){if(gh.isErrorFragment(e))return e;"error"!==e.type&&Kp.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:vh(e.name),inputs:e.inputs?e.inputs.map(ah.fromObject):[]};return xh(new gh(Jp,t))}static fromString(e){let t={type:"error"},n=e.match(bh);return n||Kp.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&vh(t.name),t.inputs=sh(n[2],!1),xh(gh.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function fh(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const yh=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function vh(e){return e&&e.match(yh)||Kp.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const bh=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ch=new Ir(Xp);class jh{constructor(e,t,n,i){this.name=e,this.type=t,this.localName=n,this.dynamic=i}_throwError(e,t){Ch.throwArgumentError(e,this.localName,t)}}class wh{constructor(e){Hp(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return function(e){let t="0x";return e.forEach((e=>{t+=Fr(e).substring(2)})),t}(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Pr(e._data))}writeBytes(e){let t=Or(e);const n=t.length%this.wordSize;return n&&(t=Pr([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=Or(x.BigNumber.from(e));return t.length>this.wordSize&&Ch.throwError("value out-of-bounds",Ir.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Pr([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class kh{constructor(e,t,n,i){Hp(this,"_data",Or(e)),Hp(this,"wordSize",t||32),Hp(this,"_coerceFunc",n),Hp(this,"allowLoose",i),this._offset=0}get data(){return Fr(this._data)}get consumed(){return this._offset}static coerce(e,t){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):kh.coerce(e,t)}_peekBytes(e,t,n){let i=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+t<=this._data.length?i=t:Ch.throwError("data out-of-bounds",Ir.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new kh(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let n=this._peekBytes(0,e,!!t);return this._offset+=n.length,n.slice(0,e)}readValue(){return x.BigNumber.from(this.readBytes(this.wordSize))}}class Th extends jh{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Xr(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Xr(Vr(e.readValue().toHexString(),20))}}class Bh extends jh{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Eh=new Ir(Xp);function Ih(e,t,n){let i=null;if(Array.isArray(n))i=n;else if(n&&"object"==typeof n){let e={};i=t.map((t=>{const i=t.localName;return i||Eh.throwError("cannot encode object for signature with missing names",Ir.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[i]&&Eh.throwError("cannot encode object for signature with duplicate names",Ir.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[i]=!0,n[i]}))}else Eh.throwArgumentError("invalid tuple value","tuple",n);t.length!==i.length&&Eh.throwArgumentError("types/value length mismatch","tuple",n);let o=new wh(e.wordSize),r=new wh(e.wordSize),a=[];t.forEach(((e,t)=>{let n=i[t];if(e.dynamic){let t=r.length;e.encode(r,n);let i=o.writeUpdatableValue();a.push((e=>{i(e+t)}))}else e.encode(o,n)})),a.forEach((e=>{e(o.length)}));let s=e.appendWriter(o);return s+=e.appendWriter(r),s}function Ah(e,t){let n=[],i=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let n=e.readValue(),r=i.subReader(n.toNumber());try{o=t.decode(r)}catch(e){if(e.code===Ir.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(e.code===Ir.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}null!=o&&n.push(o)}));const o=t.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});t.forEach(((e,t)=>{let i=e.localName;if(!i||1!==o[i])return;if("length"===i&&(i="_length"),null!=n[i])return;const r=n[t];r instanceof Error?Object.defineProperty(n,i,{enumerable:!0,get:()=>{throw r}}):n[i]=r}));for(let e=0;e<n.length;e++){const t=n[e];t instanceof Error&&Object.defineProperty(n,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(n)}class Sh extends jh{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let n=this.length;-1===n&&(n=t.length,e.writeValue(t.length)),Eh.checkArgumentCount(t.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let e=0;e<t.length;e++)i.push(this.coder);return Ih(e,i,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&Eh.throwError("insufficient data length",Ir.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e<t;e++)n.push(new Bh(this.coder));return e.coerce(this.name,Ah(e,n))}}class Lh extends jh{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Mh extends jh{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Or(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class Rh extends Mh{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Fr(super.decode(e)))}}class Oh extends jh{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=Or(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,Fr(e.readBytes(this.size)))}}class Ph extends jh{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class _h extends jh{constructor(e,t,n){const i=(t?"int":"uint")+8*e;super(i,i,n,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let n=x.BigNumber.from(t),i=na.mask(8*e.wordSize);if(this.signed){let e=i.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(ta).mul(Jr)))&&this._throwError("value out-of-bounds",t)}else(n.lt(ea)||n.gt(i.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return n=n.toTwos(8*this.size).mask(8*this.size),this.signed&&(n=n.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}class Dh extends Mh{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,la(t))}decode(e){return da(super.decode(e))}}class Nh extends jh{constructor(e,t){let n=!1;const i=[];e.forEach((e=>{e.dynamic&&(n=!0),i.push(e.type)}));super("tuple","tuple("+i.join(",")+")",t,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e}),{});return this.coders.forEach(((n,i)=>{let o=n.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[i]))})),Object.freeze(e)}encode(e,t){return Ih(e,this.coders,t)}decode(e){return e.coerce(this.name,Ah(e,this.coders))}}const Fh=new Ir(Xp),Uh=new RegExp(/^bytes([0-9]*)$/),qh=new RegExp(/^(u?int)([0-9]*)$/);const Vh=new class{constructor(e){Hp(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Th(e.name);case"bool":return new Lh(e.name);case"string":return new Dh(e.name);case"bytes":return new Rh(e.name);case"array":return new Sh(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Nh((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Ph(e.name)}let t=e.type.match(qh);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&Fh.throwArgumentError("invalid "+t[1]+" bit length","param",e),new _h(n/8,"int"===t[1],e.name)}if(t=e.type.match(Uh),t){let n=parseInt(t[1]);return(0===n||n>32)&&Fh.throwArgumentError("invalid bytes length","param",e),new Oh(n,e.name)}return Fh.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new kh(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new wh(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ah.from(e))));return new Nh(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Fh.throwError("types/values length mismatch",Ir.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(ah.from(e)))),i=new Nh(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}decode(e,t,n){const i=e.map((e=>this._getCoder(ah.from(e))));return new Nh(i,"_").decode(this._getReader(Or(t),n))}};function Wh(e){return Zr(la(e))}const Hh=new Ir(Xp);class Zh extends Yp{}class zh extends Yp{}class $h extends Yp{}class Gh extends Yp{static isIndexed(e){return!(!e||!e._isIndexed)}}const Qh={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Yh(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class Xh{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,Hp(this,"fragments",t.map((e=>lh.from(e))).filter((e=>null!=e))),Hp(this,"_abiCoder",Zp(new.target,"getAbiCoder")()),Hp(this,"functions",{}),Hp(this,"errors",{}),Hp(this,"events",{}),Hp(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Hh.warn("duplicate definition - constructor"):void Hp(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let n=e.format();t[n]?Hh.warn("duplicate definition - "+n):t[n]=e})),this.deploy||Hp(this,"deploy",hh.from({payable:!1,type:"constructor"})),Hp(this,"_isInterface",!0)}format(e){e||(e=oh.full),e===oh.sighash&&Hh.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===oh.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Vh}static getAddress(e){return Xr(e)}static getSighash(e){return qr(Wh(e.format()),0,4)}static getEventTopic(e){return Wh(e.format())}getFunction(e){if(Dr(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Hh.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===n.length?Hh.throwArgumentError("no matching function","name",t):n.length>1&&Hh.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[mh.fromString(e).format()];return t||Hh.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Dr(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Hh.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===n.length?Hh.throwArgumentError("no matching event","name",t):n.length>1&&Hh.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[dh.fromString(e).format()];return t||Hh.throwArgumentError("no matching event","signature",e),t}getError(e){if(Dr(e)){const t=Zp(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}Hh.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),n=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===n.length?Hh.throwArgumentError("no matching error","name",t):n.length>1&&Hh.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[mh.fromString(e).format()];return t||Hh.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return Zp(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Zp(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const n=Or(t);return Fr(n.slice(0,4))!==this.getSighash(e)&&Hh.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Fr(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Fr(Pr([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=Or(t);return Fr(n.slice(0,4))!==this.getSighash(e)&&Hh.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Fr(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Fr(Pr([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=Or(t),i=null,o="",r=null,a=null,s=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch(e){}break;case 4:{const e=Fr(n.slice(0,4)),t=Qh[e];if(t)r=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.signature,t.reason&&(i=r[0]),"Error"===a?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(r[0])}`:"Panic"===a&&(o=`; VM Exception while processing transaction: reverted with panic code ${r[0]}`);else try{const t=this.getError(e);r=this._abiCoder.decode(t.inputs,n.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return Hh.throwError("call revert exception"+o,Ir.errors.CALL_EXCEPTION,{method:e.format(),data:Fr(t),errorArgs:r,errorName:a,errorSignature:s,reason:i})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Fr(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Hh.throwError("too many arguments for "+e.format(),Ir.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(e,t)=>"string"===e.type?Wh(t):"bytes"===e.type?Zr(Fr(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=x.BigNumber.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Vr(Fr(t),32));for(t.forEach(((t,o)=>{let r=e.inputs[o];r.indexed?null==t?n.push(null):"array"===r.baseType||"tuple"===r.baseType?Hh.throwArgumentError("filtering with tuples or arrays not supported","contract."+r.name,t):Array.isArray(t)?n.push(t.map((e=>i(r,e)))):n.push(i(r,t)):null!=t&&Hh.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+r.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Hh.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,r)=>{const a=t[r];if(e.indexed)if("string"===e.type)n.push(Wh(a));else if("bytes"===e.type)n.push(Zr(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(this._abiCoder.encode([e.type],[a]))}else i.push(e),o.push(a)})),{data:this._abiCoder.encode(i,o),topics:n}}decodeEventLog(e,t,n){if("string"==typeof e&&(e=this.getEvent(e)),null!=n&&!e.anonymous){let t=this.getEventTopic(e);Dr(n[0],32)&&n[0].toLowerCase()===t||Hh.throwError("fragment/topic mismatch",Ir.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:n[0]}),n=n.slice(1)}let i=[],o=[],r=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(ah.fromObject({type:"bytes32",name:e.name})),r.push(!0)):(i.push(e),r.push(!1)):(o.push(e),r.push(!1))}));let a=null!=n?this._abiCoder.decode(i,Pr(n)):null,s=this._abiCoder.decode(o,t,!0),l=[],d=0,c=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)l[t]=new Gh({_isIndexed:!0,hash:null});else if(r[t])l[t]=new Gh({_isIndexed:!0,hash:a[c++]});else try{l[t]=a[c++]}catch(e){l[t]=e}else try{l[t]=s[d++]}catch(e){l[t]=e}if(e.name&&null==l[e.name]){const n=l[t];n instanceof Error?Object.defineProperty(l,e.name,{enumerable:!0,get:()=>{throw Yh(`property ${JSON.stringify(e.name)}`,n)}}):l[e.name]=n}}));for(let e=0;e<l.length;e++){const t=l[e];t instanceof Error&&Object.defineProperty(l,e,{enumerable:!0,get:()=>{throw Yh(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new zh({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:x.BigNumber.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Zh({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Fr(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new $h({args:this._abiCoder.decode(n.inputs,"0x"+t.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!(!e||!e._isInterface)}}function Kh({fromToken:e,toToken:i,fromTokenPrice:o,toTokenPrice:r,sx:a,children:l}){const d=t.useTheme(),[c,u]=n.useState(!1),p=n.useMemo((()=>new s(o&&r?c?r:o:0)),[o,r,c]);return z.jsxs(t.Box,{component:t.ButtonBase,sx:Object.assign({display:"flex",alignItems:"center",gap:8,color:"text.primary",typography:"body1",fontWeight:600,"&:hover>svg>path":{fill:d.palette.text.primary}},a),onClick:()=>u((e=>!e)),children:[z.jsxs(t.Box,{children:[l,"1 ",c?i.symbol:e.symbol," = ",p&&p.isFinite()?ir({input:p,decimals:c?e.decimals:i.decimals}):"-"," ",c?e.symbol:i.symbol]}),z.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("circle",{cx:"9",cy:"9",r:"9",fill:d.palette.border.main}),z.jsx("path",{d:"M9.5 6.5H4.5V8H13.5L9.5 4.25V6.5ZM8.25 13.75V11.5H13.5V10H4.5L8.25 13.75Z",fill:d.palette.text.secondary})]})]})}function Jh({showFold:e,isMobile:i,data:o}){const a=t.useTheme(),s=n.useMemo((()=>{var e,t,n,i,a,s,l,d,c,u,p,h,m;return[{title:"Total time spent",value:null!==(n=Ds({start:null!==(e=o.startTime)&&void 0!==e?e:void 0,end:null!==(t=o.endTime)&&void 0!==t?t:void 0}))&&void 0!==n?n:"-"},{title:"Pay",value:z.jsx(lp,{address:null!==(i=o.fromAddress)&&void 0!==i?i:"",customChainId:null!==(a=o.routeData.fromChainId)&&void 0!==a?a:r.ChainId.ZETACHAIN,showCopy:!0,truncate:!0,iconSpace:4,iconSize:14,size:"small"})},{title:"Receive",value:z.jsx(lp,{address:null!==(s=o.toAddress)&&void 0!==s?s:"",customChainId:null!==(l=o.routeData.toChainId)&&void 0!==l?l:r.ChainId.ZETACHAIN,showCopy:!0,truncate:!0,iconSpace:4,iconSize:14,size:"small"})},{title:z.jsxs(z.Fragment,{children:["Fill Gas (Destination gas)",z.jsx(ku,{onlyHover:!0,title:"-",ml:0})]}),value:`$${null!==(u=null===(c=null===(d=o.fees)||void 0===d?void 0:d.find((e=>"destinationFee"===e.type)))||void 0===c?void 0:c.amountUSD)&&void 0!==u?u:"-"}`},{title:z.jsxs(z.Fragment,{children:["Bridge Fee",z.jsx(ku,{onlyHover:!0,title:"-",ml:0})]}),value:`$${null!==(m=null===(h=null===(p=o.fees)||void 0===p?void 0:p.find((e=>"platformFee"===e.type)))||void 0===h?void 0:h.amountUSD)&&void 0!==m?m:"-"}`}]}),[o.endTime,o.fees,o.fromAddress,o.routeData.fromChainId,o.routeData.toChainId,o.startTime,o.toAddress]);return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:16,p:e?16:0,borderBottomLeftRadius:8,borderBottomRightRadius:8,background:`linear-gradient(0deg, ${a.palette.background.skeleton} 0%, ${a.palette.background.skeleton} 100%), ${a.palette.background.paper}`,maxHeight:e?"auto":0,transition:"all 300ms",overflow:"hidden",[a.breakpoints.up("tablet")]:{marginTop:"-4px",marginBottom:"4px",gap:24}},children:[z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8,[a.breakpoints.up("tablet")]:{alignItems:"center",flexDirection:"row",gap:20}},children:s.map(((e,n)=>z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",[a.breakpoints.up("tablet")]:{flexBasis:"20%",flexGrow:1,flexShrink:1,flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",gap:4}},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.secondary",typography:"h6"},children:e.title}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.primary",typography:"body2"},children:e.value})]},n)))}),null!=o.routeData.fromChainId&&null!=o.routeData.toChainId&&z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{height:"1px",width:"100%",backgroundColor:"border.disabled"}}),z.jsx(Dd,{route:{fromChainId:o.routeData.fromChainId,toChainId:o.routeData.toChainId,step:o.routeData.step},isMobile:i})]})]})}function em({data:e,isMobile:i,isErrorRefund:o,refetch:r}){var a,s,l,d,u,p,h,m,x,g;const f=t.useTheme(),y=us(),{chainId:v,appKitActiveNetwork:b,getAppKitAccountByChainId:C}=Pa(),{statusText:j,statusColor:w,statusAlphaColor:k}=n.useMemo((()=>{let t="Loading",n=f.palette.text.primary;switch(e.status){case"pending":t="Pending",n=f.palette.text.secondary;break;case"success":t="Succeeded",n=f.palette.success.main;break;case"failure_revert":t="Failed",n=f.palette.error.main;break;case"abort":t="Aborted",n=f.palette.error.main}return{statusText:t,statusColor:n,statusAlphaColor:undefined}}),[e.status,f.palette.error.main,f.palette.success.main,f.palette.text.primary,f.palette.text.secondary]),[T,B]=n.useState(!1),E=e.createdAt?Fs(new Date(e.createdAt)):"-",I=c.useMutation({mutationFn:()=>N(this,void 0,void 0,(function*(){if(!e.externalId||!e.refundCridgeContract)return;if(v!==e.refundChainId){const t=C(e.refundChainId);if(!t)return;b.switchNetwork(t.chain.caipNetwork)}const t=new Xh([{inputs:[{internalType:"bytes32",name:"externalId",type:"bytes32"}],name:"claimRefund",outputs:[],stateMutability:"nonpayable",type:"function"}]).encodeFunctionData("claimRefund",[e.externalId]);return yield y.execute("Claim",{opcode:rs.TX,data:t,to:e.refundCridgeContract,value:"0x0"},{metadata:{crossChainSwapClaimRefund:!0},submittedBack:()=>{r()},successBack:()=>{r()}})}))});return n.useMemo((()=>z.jsxs(t.Button,{variant:t.Button.Variant.contained,size:t.Button.Size.small,color:"error",isLoading:I.isPending,disabled:I.isPending||"wait_claim_refund"!==e.subStatus,onClick:()=>{I.mutate()},sx:{typography:"h6",lineHeight:"16px",py:6,minWidth:98,height:28},children:["refund_success"===e.subStatus?"Claimed":"Claim","wait_claim_refund"!==e.subStatus&&z.jsx(ku,{onlyHover:!0,title:e.subStatus,ml:4,sx:{color:f.palette.text.disabled}})]})),[I,e.subStatus,f.palette.text.disabled]),i?z.jsxs(t.Box,{sx:{backgroundColor:f.palette.background.paper,borderRadius:8},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",p:16,gap:16},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{width:24,height:24,address:null===(a=e.fromToken)||void 0===a?void 0:a.address,chainId:null===(s=e.fromToken)||void 0===s?void 0:s.chainId}),z.jsx(t.Box,{component:"svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{color:"text.secondary"},children:z.jsx("path",{d:"M7.575 8.625L4.5 11.7L5.625 12.75L9.75 8.625L5.625 4.5L4.5 5.55L7.575 8.625ZM12.15 8.625L9.075 11.7L10.125 12.75L14.25 8.625L10.125 4.5L9.075 5.55L12.15 8.625Z",fill:"currentColor"})}),z.jsx(sl,{width:24,height:24,address:null===(l=e.toToken)||void 0===l?void 0:l.address,chainId:null===(d=e.toToken)||void 0===d?void 0:d.chainId})]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:z.jsx(Np,{isMobile:!1,statusText:j,statusColor:w,alphaColor:k,children:"success"!==e.status&&z.jsx(ku,{onlyHover:!0,title:e.subStatus,ml:4,sx:{color:w}})})})]}),z.jsx(t.Box,{sx:{typography:"h6",color:f.palette.text.secondary},children:E})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[z.jsx(Fp,{token:e.fromToken,amount:e.fromAmount,canAddMetamask:!1,title:"Pay",linkVisible:!1}),z.jsx(Fp,{token:e.toToken,amount:e.toAmount,canAddMetamask:e.fromToken&&null!==(p=null===(u=Ro.get(e.fromToken.chainId))||void 0===u?void 0:u.isEVMChain)&&void 0!==p&&p,title:"Receive",linkVisible:!1})]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:2,borderRadius:8,border:`1px solid ${f.palette.border.main}`},children:z.jsx(Dp,{show:T,onClick:()=>B((e=>!e)),sx:{color:"text.secondary"}})})]})]}),z.jsx(Jh,{showFold:T,data:e,isMobile:i})]}):z.jsxs(z.Fragment,{children:[z.jsxs("tr",{children:[z.jsx(t.Box,{component:"td",sx:{borderTopLeftRadius:8,borderBottomLeftRadius:T?0:8},children:e.fromToken&&z.jsx(Up,{token:e.fromToken,amount:null!==(h=e.fromAmount)&&void 0!==h?h:"",showChain:!0})}),z.jsx("td",{children:e.toToken&&z.jsx(Up,{token:e.toToken,amount:null!==(m=e.toAmount)&&void 0!==m?m:"",showChain:!0,canAddMetamask:null!==(g=null===(x=Ro.get(e.toToken.chainId))||void 0===x?void 0:x.isEVMChain)&&void 0!==g&&g})}),z.jsx("td",{children:z.jsx(Np,{isMobile:i,statusText:j,statusColor:w,alphaColor:k,time:E,children:"success"!==e.status&&z.jsx(ku,{onlyHover:!0,title:e.subStatus,ml:4,sx:{color:w}})})}),o?null:z.jsx("td",{children:e.fromToken&&e.toToken&&z.jsx(Kh,{fromToken:e.fromToken,toToken:e.toToken,fromTokenPrice:e.fromTokenPrice,toTokenPrice:e.toTokenPrice})}),z.jsx(t.Box,{component:"td",sx:{borderTopRightRadius:8,borderBottomRightRadius:T?0:8},children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8},children:["refund_success"===e.subStatus&&z.jsxs(z.Fragment,{children:[z.jsx(t.Tooltip,{title:"refund TX",placement:"top",onlyHover:!0,children:z.jsx(t.Box,{component:"a",href:e.refundChainId&&e.refundHash?Ia(e.refundChainId,e.refundHash,"tx"):void 0,target:"_blank",rel:"noopener noreferrer",sx:{p:3,color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx(t.Box,{component:oe.ArrowTopRightBorder,sx:{width:18,height:18}})})}),z.jsx(t.Box,{sx:{height:16,width:"1px",backgroundColor:"border.main"}})]}),z.jsx(Dp,{show:T,onClick:()=>B((e=>!e))})]})})]}),z.jsx("tr",{children:z.jsx(t.Box,{component:"td",colSpan:5,sx:{p:"0 !important",backgroundColor:"transparent !important"},children:z.jsx(Jh,{showFold:T,data:e})})})]})}function tm({account:i,type:o}){const{isMobile:a}=Xa(),l=function({account:e,limit:t=5,type:i}){var o;const{tokenList:a}=Ko(),l=qa().getInfiniteQuery(r.SwapApi.graphql.cross_chain_swap_zetachain_orderList,"page",{where:{user:e,pageSize:t,type:i}}),d=c.useInfiniteQuery(Object.assign(Object.assign({},l),{enabled:!!e,initialPageParam:1,getNextPageParam:e=>{var n;const{page:i,count:o}=null!==(n=e.cross_chain_swap_zetachain_orderList)&&void 0!==n?n:{page:0,count:0};return i&&o?i*t>=o?null:i+1:null}})),u=n.useMemo((()=>{var e,t,n,i;return null!==(i=null===(n=null===(t=null===(e=d.data)||void 0===e?void 0:e.pages)||void 0===t?void 0:t.reduce(((e,t)=>{var n,i;return[...e,...null!==(i=null===(n=t.cross_chain_swap_zetachain_orderList)||void 0===n?void 0:n.list)&&void 0!==i?i:[]]}),[]))||void 0===n?void 0:n.map((e=>{const t=a.find((t=>{var n;return t.address.toLowerCase()===(null===(n=null==e?void 0:e.fromTokenAddress)||void 0===n?void 0:n.toLowerCase())&&t.chainId===(null==e?void 0:e.fromChainId)})),n=a.find((t=>{var n;return t.address.toLowerCase()===(null===(n=null==e?void 0:e.toTokenAddress)||void 0===n?void 0:n.toLowerCase())&&t.chainId===(null==e?void 0:e.toChainId)})),i=(null==e?void 0:e.fromAmount)&&t?new s(e.fromAmount).div(10**t.decimals).dp(t.decimals,s.ROUND_DOWN):null,o=(null==e?void 0:e.toAmount)&&n?new s(e.toAmount).div(10**n.decimals).dp(n.decimals,s.ROUND_DOWN):null;return{hash:null==e?void 0:e.fromHash,refundHash:null==e?void 0:e.refundHash,externalId:null==e?void 0:e.externalId,refundCridgeContract:null==e?void 0:e.refundCridgeContract,refundChainId:(null==e?void 0:e.refundChainId)?Number(e.refundChainId):void 0,fromToken:t,toToken:n,fromAmount:i,toAmount:o,startTime:(null==e?void 0:e.startTime)?1e3*e.startTime:void 0,endTime:(null==e?void 0:e.endTime)?1e3*e.endTime:void 0,createdAt:null==e?void 0:e.createdAt,fromAddress:null==e?void 0:e.fromAddress,toAddress:null==e?void 0:e.toAddress,routeData:{fromChainId:null==e?void 0:e.fromChainId,toChainId:null==e?void 0:e.toChainId,step:er({omniPlan:null==e?void 0:e.omniPlan,tokenList:a})},fees:null==e?void 0:e.fees,status:null==e?void 0:e.status,subStatus:null==e?void 0:e.subStatus,transactionHash:null==e?void 0:e.fromHash,fromTokenPrice:i&&o&&t?o.div(i).dp(t.decimals,s.ROUND_DOWN).toString():null,toTokenPrice:i&&o&&n?i.div(o).dp(n.decimals,s.ROUND_DOWN).toString():null}})))&&void 0!==i?i:[]}),[null===(o=d.data)||void 0===o?void 0:o.pages,a]);return Object.assign(Object.assign({},d),{orderList:u})}({account:i,limit:a?10:5,type:o}),d="error_refund"===o;return z.jsx(_p,{isMobile:a,empty:!l.orderList.length,loading:l.isLoading,children:a?z.jsxs(t.Box,{sx:{pt:12,px:16,display:"flex",flexDirection:"column",gap:8},children:[l.orderList.map((e=>z.jsx(em,{data:e,isMobile:a,isErrorRefund:d,refetch:l.refetch},e.hash))),z.jsx(qp,{loading:l.isFetchingNextPage,onClick:l.fetchNextPage,hasMore:l.hasNextPage,height:68})]}):z.jsx(z.Fragment,{children:z.jsxs(Vp,{loadMoreLoading:l.isFetchingNextPage,loadMore:l.fetchNextPage,hasMore:l.hasNextPage,children:[z.jsx("thead",{children:z.jsxs("tr",{children:[z.jsx("th",{children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:z.jsx(e.Trans,{id:"4fL/V7",message:"Pay"})})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"lDgVWA",message:"Receive"})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"uAQUqI",message:"Status"})}),d?null:z.jsx("th",{children:z.jsx(e.Trans,{id:"fqDzSu",message:"Rate"})}),z.jsx(t.Box,{component:"th",sx:{width:140,textAlign:"right !important"},children:z.jsx(e.Trans,{id:"URmyfc",message:"Details"})})]})}),z.jsx("tbody",{children:l.orderList.map((e=>z.jsx(em,{data:e,isMobile:a,isErrorRefund:d,refetch:l.refetch},e.hash)))})]})})})}function nm({account:e,limit:t=5}){var n,i,o,a;const l=void 0,d=qa().getInfiniteQuery(r.SwapApi.graphql.cross_chain_swap_zetachain_swapOrderList,"page",{where:{userAddress:null==e?void 0:e.toLowerCase(),pageSize:t}}),u=c.useInfiniteQuery(Object.assign(Object.assign({},d),{enabled:!!e,initialPageParam:1,getNextPageParam:e=>{var n;const{page:i,count:o}=null!==(n=e.cross_chain_swap_zetachain_swapOrderList)&&void 0!==n?n:{page:0,count:0};return i&&o?i*t>=o?null:i+1:null}})),p=null!==(a=null===(o=null===(i=null===(n=u.data)||void 0===n?void 0:n.pages)||void 0===i?void 0:i.reduce(((e,t)=>{var n,i;return[...e,...null!==(i=null===(n=t.cross_chain_swap_zetachain_swapOrderList)||void 0===n?void 0:n.list)&&void 0!==i?i:[]]}),[]))||void 0===o?void 0:o.map((t=>{var n,i,o,r,a,d,c,u,p,h,m,x,g,f,y,v,b,C;let j="";const w=null!==(i=null===(n=null==t?void 0:t.extra)||void 0===n?void 0:n.safeTxHash)&&void 0!==i?i:void 0;return w&&l&&e&&(j=l(w,null==t?void 0:t.chainId,e)),{hash:null!==(o=null==t?void 0:t.hash)&&void 0!==o?o:"",fromToken:Oa({address:null!==(r=null==t?void 0:t.fromTokenAddress)&&void 0!==r?r:"",decimals:null==t?void 0:t.fromTokenDecimals,symbol:null!==(a=null==t?void 0:t.fromTokenSymbol)&&void 0!==a?a:"",name:null!==(d=null==t?void 0:t.fromTokenSymbol)&&void 0!==d?d:""},null==t?void 0:t.chainId),toToken:Oa({address:null!==(c=null==t?void 0:t.toTokenAddress)&&void 0!==c?c:"",decimals:null==t?void 0:t.toTokenDecimals,symbol:null!==(u=null==t?void 0:t.toTokenSymbol)&&void 0!==u?u:"",name:null!==(p=null==t?void 0:t.toTokenSymbol)&&void 0!==p?p:""},null==t?void 0:t.chainId),fromAmount:(null==t?void 0:t.fromAmount)&&String(t.fromTokenDecimals)?new s(t.fromAmount).div(10**t.fromTokenDecimals):null,toAmount:null!==(h=null==t?void 0:t.toAmount)&&void 0!==h?h:"",minAmount:null!==(m=null==t?void 0:t.minAmount)&&void 0!==m?m:"",fromTokenPrice:null!==(x=null==t?void 0:t.fromTokenPrice)&&void 0!==x?x:"",toTokenPrice:null!==(g=null==t?void 0:t.toTokenPrice)&&void 0!==g?g:"",createdAt:null!==(f=null==t?void 0:t.createdAt)&&void 0!==f?f:"",routeData:null!==(v=null===(y=null==t?void 0:t.extra)||void 0===y?void 0:y.routeData)&&void 0!==v?v:"",safeTxHash:w,safeTxUrl:j,status:null!==(b=null==t?void 0:t.status)&&void 0!==b?b:"",transactionHash:null===(C=null==t?void 0:t.extra)||void 0===C?void 0:C.transactionHash}})))&&void 0!==a?a:[];return Object.assign(Object.assign({},u),{orderList:p})}var im,om;function rm({showFold:i,isMobile:o,data:r}){const a=t.useTheme(),{routeData:l}=fp({rawRouteData:r.routeData,chainId:r.fromToken.chainId}),d=n.useMemo((()=>r.fromTokenPrice?new s(r.fromTokenPrice):new s(0)),[r.fromTokenPrice]);return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:24,p:i?16:0,borderBottomLeftRadius:8,borderBottomRightRadius:8,background:`linear-gradient(0deg, ${a.palette.background.skeleton} 0%, ${a.palette.background.skeleton} 100%), ${a.palette.background.paper}`,maxHeight:i?400:0,transition:"all 300ms",overflow:"hidden",[a.breakpoints.up("tablet")]:{marginTop:"-4px",marginBottom:"4px"}},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"h6",color:a.palette.text.secondary},children:[z.jsx(e.Trans,{id:"URmyfc",message:"Details"}),o&&z.jsxs(t.Box,{children:["Rate: 1 ",r.fromToken.symbol,"=",d&&d.isFinite()?ir({input:d,decimals:r.toToken.decimals}):"-"," ",r.toToken.symbol]})]}),o?z.jsx(xl,{routeData:l,fromTokenRaw:r.fromToken,toTokenRaw:r.toToken}):z.jsx(gl,{routeData:l,fromTokenRaw:r.fromToken,toTokenRaw:r.toToken})]})}function am({data:e,isMobile:i}){var r,a,s,l,d,c;const u=t.useTheme(),[p,h]=n.useState(!1),{statusText:m,statusColor:x,statusAlphaColor:g}=function({status:e,stateTextMap:n}){let i=n?n[e]:e;const r=t.useTheme();let a,s=o.i18n._({id:"yQE2r9",message:"Loading"}),l=r.palette.text.primary;switch(e){case im.Warning:s=o.i18n._({id:"GGWsTU",message:"Canceled"}),a=.1;break;case im.Failed:s=o.i18n._({id:"7Bj3x9",message:"Failed"}),l=r.palette.error.main;break;case im.Success:s=o.i18n._({id:"KAbcm2",message:"Succeeded"}),l=r.palette.success.main}return{state:i,statusText:s,statusColor:l,statusAlphaColor:a}}({status:e.status}),f=Fs(new Date(e.createdAt));return i?z.jsxs(t.Box,{sx:{backgroundColor:u.palette.background.paper,borderRadius:8},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",p:16,gap:16},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},onClick:()=>window.open(Ia(e.fromToken.chainId,e.hash,"tx"),"_blank"),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{width:24,height:24,address:e.fromToken.address,chainId:e.fromToken.chainId}),z.jsx(t.Box,{component:"svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{color:"text.secondary"},children:z.jsx("path",{d:"M7.575 8.625L4.5 11.7L5.625 12.75L9.75 8.625L5.625 4.5L4.5 5.55L7.575 8.625ZM12.15 8.625L9.075 11.7L10.125 12.75L14.25 8.625L10.125 4.5L9.075 5.55L12.15 8.625Z",fill:"currentColor"})}),z.jsx(sl,{width:24,height:24,address:e.toToken.address,chainId:e.toToken.chainId})]}),z.jsx(Np,{isMobile:!1,statusText:m,statusColor:x,alphaColor:g})]}),z.jsx(t.Box,{sx:{typography:"h6",color:u.palette.text.secondary},children:f})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[z.jsx(Fp,{token:e.fromToken,amount:e.fromAmount,canAddMetamask:!1,title:"Pay"}),z.jsx(Fp,{token:e.toToken,amount:e.toAmount,canAddMetamask:null!==(a=null===(r=Ro.get(e.fromToken.chainId))||void 0===r?void 0:r.isEVMChain)&&void 0!==a&&a,title:"Receive"})]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:2,borderRadius:8,border:`1px solid ${u.palette.border.main}`},children:z.jsx(Dp,{show:p,onClick:()=>h((e=>!e)),sx:{color:"text.secondary"}})})]})]}),z.jsx(rm,{showFold:p,data:e,isMobile:!0})]}):z.jsxs(z.Fragment,{children:[z.jsxs("tr",{children:[z.jsx(t.Box,{component:"td",sx:{borderTopLeftRadius:8,borderBottomLeftRadius:p?0:8},children:z.jsx(Up,{token:e.fromToken,amount:null!==(s=e.fromAmount)&&void 0!==s?s:"",showChain:!0})}),z.jsx("td",{children:z.jsx(Up,{token:e.toToken,amount:null!==(l=e.toAmount)&&void 0!==l?l:"",showChain:!0,canAddMetamask:null!==(c=null===(d=Ro.get(e.toToken.chainId))||void 0===d?void 0:d.isEVMChain)&&void 0!==c&&c})}),z.jsx("td",{children:z.jsx(Np,{isMobile:i,statusText:m,statusColor:x,alphaColor:g,time:f})}),z.jsx("td",{children:z.jsx(Kh,{fromToken:e.fromToken,toToken:e.toToken,fromTokenPrice:e.fromTokenPrice,toTokenPrice:e.toTokenPrice})}),z.jsx(t.Box,{component:"td",sx:{borderTopRightRadius:8,borderBottomRightRadius:p?0:8},children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{component:"a",href:Ia(e.fromToken.chainId,e.hash,"tx"),target:"_blank",rel:"noopener noreferrer",sx:{p:3,color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx(t.Box,{component:oe.ArrowTopRightBorder,sx:{width:18,height:18}})}),z.jsx(t.Box,{sx:{height:16,width:"1px",backgroundColor:"border.main"}}),z.jsx(Dp,{show:p,onClick:()=>h((e=>!e))})]})})]}),z.jsx("tr",{children:z.jsx(t.Box,{component:"td",colSpan:5,sx:{p:"0 !important",backgroundColor:"transparent !important"},children:z.jsx(rm,{showFold:p,data:e})})})]})}function sm({account:n}){const{isMobile:i}=Xa(),o=nm({account:n,limit:i?10:5});return z.jsx(_p,{isMobile:i,empty:!o.orderList.length,loading:o.isLoading,children:i?z.jsxs(t.Box,{sx:{pt:12,px:16,display:"flex",flexDirection:"column",gap:8},children:[o.orderList.map((e=>z.jsx(am,{data:e,isMobile:i},e.hash))),z.jsx(qp,{loading:o.isFetchingNextPage,onClick:o.fetchNextPage,hasMore:o.hasNextPage,height:68})]}):z.jsx(z.Fragment,{children:z.jsxs(Vp,{loadMoreLoading:o.isFetchingNextPage,loadMore:o.fetchNextPage,hasMore:o.hasNextPage,children:[z.jsx("thead",{children:z.jsxs("tr",{children:[z.jsx("th",{children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:z.jsx(e.Trans,{id:"4fL/V7",message:"Pay"})})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"lDgVWA",message:"Receive"})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"uAQUqI",message:"Status"})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"fqDzSu",message:"Rate"})}),z.jsx(t.Box,{component:"th",sx:{width:140},children:z.jsx(e.Trans,{id:"URmyfc",message:"Details"})})]})}),z.jsx("tbody",{children:o.orderList.map((e=>z.jsx(am,{data:e,isMobile:i},e.hash)))})]})})})}function lm(e){var{sx:n}=e,i=D(e,["sx"]);return z.jsx(t.TabPanel,{...i,sx:Object.assign(Object.assign({},n),{display:"flex",flexDirection:"column",overflow:"hidden"})})}!function(e){e.Running="pending",e.Success="success",e.Failed="failed",e.Warning="reset"}(im||(im={})),function(e){e.sameChain="same-chain",e.crossChain="cross-chain",e.errorRefunds="error-refunds"}(om||(om={}));const dm="widget-module-container",cm=n.forwardRef((function(e,n){var{sx:i}=e,o=D(e,["sx"]);const{isMobile:r}=Xa();return z.jsx(t.Box,{className:dm,ref:n,sx:Object.assign(Object.assign({flex:1,backgroundColor:"transparent"},r?{padding:0,height:"100%",width:"100%",overflowX:"hidden"}:{padding:0,height:"auto"}),i),...o})}));var um;exports.PageType=void 0,(um=exports.PageType||(exports.PageType={})).Pool="pool",um.PoolDetail="poolDetail",um.CurvePoolDetail="curvePoolDetail",um.CreatePool="createPool",um.ModifyPool="modifyPool",um.MiningList="miningList",um.MiningDetail="miningDetail",um.createPoolAMMV2="createPoolAMMV2",um.createPoolAMMV3="createPoolAMMV3";const pm=u.create(((e,t)=>({page:void 0,historyList:[],push:t=>{e((e=>{var n;const i=[...e.historyList,null!==(n=e.page)&&void 0!==n?n:{type:exports.PageType.Pool}];return{page:t,historyList:i}}))},back:()=>{e((e=>{const t=e.historyList.length;if(!t)return"undefined"!=typeof window&&window.history&&history.back(),e;const n=[...e.historyList];return{page:n.splice(t-1,1)[0],historyList:n}}))}})));function hm({title:e,descList:n,linkTo:i,sx:o}){const r=t.useTheme();return z.jsxs(t.Box,{sx:Object.assign({backgroundColor:r.palette.background.paper,backdropFilter:"blur(4px)",borderRadius:12,padding:24,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24},o),children:[z.jsx(t.Box,{sx:{color:r.palette.text.primary,typography:"body1",fontWeight:500,lineHeight:"24px"},children:e}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"stretch",gap:24},children:n.map(((e,n)=>z.jsxs(t.Box,{sx:{flex:1,padding:16,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:8,borderWidth:1,borderColor:r.palette.border.main,borderStyle:"solid",borderRadius:8},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:{color:r.palette.primary.contrastText,typography:"h6",fontWeight:600,lineHeight:"20px",width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:r.palette.primary.main},children:n+1}),z.jsx(t.Box,{sx:{color:r.palette.text.primary,typography:"body2",fontWeight:500,lineHeight:"24px"},children:e.title})]}),z.jsx(t.Box,{sx:{color:r.palette.text.secondary,typography:"h6",fontWeight:500,lineHeight:"18px"},children:e.desc})]},n)))}),z.jsx(t.Box,{component:"a",href:i,target:"_blank",rel:"noopener noreferrer",sx:{px:24,py:12,borderRadius:8,backgroundColor:r.palette.background.tag,color:r.palette.text.primary,typography:"body2",fontWeight:700,lineHeight:"21px",textDecoration:"none"},children:"Read Docs"})]})}const mm=[{value:0,label:"0%"},{value:25,label:"25%"},{value:50,label:"50%"},{value:75,label:"75%"},{value:100,label:"100%"}];function xm({disabled:e,value:n,onChange:i,sx:o}){return z.jsxs(t.Box,{sx:Object.assign({p:20,backgroundColor:"background.cardInput",borderRadius:12},o),children:[z.jsx(Ju,{value:String(n),onChange:e=>i(+e),readOnly:!0,readonlyShowSuffix:!0,suffix:z.jsx(t.Box,{sx:{typography:"h2"},children:"%"}),sx:{mt:12,backgroundColor:"background.cardInput","& input":{pl:0,typography:"h1"}}}),z.jsx(t.Box,{sx:{mt:20},children:z.jsx(t.Slider,{marks:mm,step:1,disabled:e,value:n,onChange:(e,t)=>i(t)})})]})}function gm({active:n,sx:i,onClick:o}){const r=t.useTheme(),a="light"===r.palette.mode;let s=r.palette.primary.main,l="transparent";return n&&(s=r.palette.primary.contrastText,l=t.alpha(r.palette.primary.main,.8)),z.jsx(t.Box,{component:t.ButtonBase,sx:Object.assign({typography:"body2",p:n?r.spacing(8,20,9):r.spacing(7,19,8),minWidth:79,border:n?void 0:`1px solid ${s}`,color:s,backgroundColor:l,borderRadius:8,fontWeight:600,"&:hover":{color:n?r.palette.primary.contrastText:r.palette.primary.main,backgroundColor:n?r.palette.primary.main:a?"rgba(26, 26, 27, 0.04)":"rgba(241, 249, 2, 0.08)"}},i),onClick:o,children:z.jsx(e.Trans,{id:"R9Khdg",message:"Auto"})})}const fm="auto",ym="0.1",vm="0.5",bm="0.5",Cm=.01,jm=({address:e,type:t})=>{const[i,o]=n.useState(fm),r=n.useMemo((()=>i===fm?"AMMV3"===t?new s(bm).div(100).toNumber():"AMMV2"===t?new s(vm).div(100).toNumber():new s(ym).div(100).toNumber():i),[i,t]);return{slipper:i,setSlipper:o,slipperValue:r,resetSlipper:()=>{o(fm)}}};function wm({type:i,disabled:o,value:r,onChange:a,sx:l}){const d=t.useTheme(),c=r===fm,[u,p]=n.useState(c?"":new s(r).times(100).toNumber()),h="AMMV3"==i?bm:"AMMV2"==i?vm:ym;return z.jsx(t.Tooltip,{disabled:o,onlyClick:!0,title:z.jsxs(t.Box,{sx:{backgroundColor:d.palette.background.paper,padding:d.spacing(12,20),borderRadius:8,width:318,maxWidth:"90vw",boxSizing:"border-box"},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2"},children:[z.jsx("span",{children:z.jsx(e.Trans,{id:"lqTDfd",message:"Slippage Tolerance"})}),z.jsxs("span",{children:[c?h:r&&new s(r).times(100).toNumber(),"%"]})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",margin:d.spacing(16,0,0,0)},children:[z.jsx(gm,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{p(""),a(fm)},active:c}),z.jsx(t.Input,{placeholder:String(h),value:u,onChange:e=>{const{value:t}=e.target;p(t),a(t?new s(t).div(100).toNumber():fm)},onBlur:()=>{(!c&&new s(r).gt(.1)||new s(r).lte(0))&&(p(10),a(.1))},suffix:z.jsx(t.Box,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:z.jsx(t.HoverAddBackground,{sx:Object.assign({width:"max-content",alignItems:"right",margin:d.spacing(0,0,0,"auto"),p:d.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast"},l),children:z.jsx(t.Box,{component:oe.Setting,sx:{width:18,height:18,"& path:last-child":{fill:d.palette.text.primary}}})})})}const km=50;var Tm,Bm,Em;function Im(i){var r,a,s,{chainId:l,includeButton:d}=i,c=D(i,["chainId","includeButton"]);const{chainId:u,getAppKitAccountByChainId:p,open:h}=Pa(),[m,x]=n.useState(!1),g=Rp(l),f=void 0!==u&&void 0!==l&&u!==l,y=p(l);return!(null==y?void 0:y.appKitAccount.address)||m||void 0===u||l&&l!==u?z.jsx(z.Fragment,{children:z.jsx(t.Button,{...c,isLoading:m,onClick:()=>N(this,void 0,void 0,(function*(){if(f)return g?(x(!0),yield g(),void x(!1)):void 0;x(!0),h({namespace:null==y?void 0:y.namespace}),x(!1)})),children:m?z.jsx(e.Trans,{id:"J28zul",message:"Connecting..."}):f&&l?o.i18n._({id:"1+P9RR",message:"Switch to {0}",values:{0:null!==(s=null===(a=Ro.get(l))||void 0===a?void 0:a.name)&&void 0!==s?s:"unknown"}}):z.jsx(e.Trans,{id:"r7ScnQ",message:"Connect to a wallet"})})}):d?z.jsx(z.Fragment,{children:null!==(r=c.children)&&void 0!==r?r:null}):z.jsx(t.Button,{...c})}!function(e){e[e.quantity=1]="quantity",e[e.percentage=2]="percentage"}(Tm||(Tm={})),function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(Bm||(Bm={})),function(e){e.LOWER="LOWER",e.UPPER="UPPER"}(Em||(Em={}));const Am={xs:"4px",sm:"8px",md:"12px",lg:"24px",xl:"32px"},Sm=({children:e,sx:n})=>(t.useTheme(),z.jsx(t.Box,{sx:Object.assign({display:"flex",flexDirection:"column",gap:20,px:20,py:20,borderRadius:12},n),children:e})),Lm=({children:e,sx:n})=>{const i=t.useTheme();return z.jsx(Sm,{sx:Object.assign(Object.assign({},n),{backgroundColor:i.palette.background.paperContrast}),children:e})},Mm=({children:e})=>{const n=t.useTheme();return z.jsxs(t.Box,{sx:{p:8,borderRadius:8,backgroundColor:t.alpha(n.palette.warning.main,.1),display:"flex",alignItems:"center",gap:8},children:[z.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 16.125L9 1.875L17.25 16.125H0.75ZM14.6475 14.625L8.99998 4.86749L3.35247 14.625H14.6475ZM9.75004 12.375H8.25003V13.875H9.75004V12.375ZM8.25003 7.875H9.75004V10.875H8.25003V7.875Z",fill:n.palette.warning.main})}),z.jsx(t.Box,{sx:{typography:"h6",color:n.palette.warning.main,textAlign:"left"},children:e})]})};function Rm({gap:e,flex:n,children:i,style:o}){return z.jsx(t.Box,{sx:Object.assign(Object.assign(Object.assign({display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:e&&Am[e]||e},n&&{flex:n}),{width:"100%",alignItems:"center"}),o),children:i})}function Om({gap:e,justify:n,grow:i,children:o,style:r}){return z.jsx(t.Box,{sx:Object.assign({display:"grid",gridAutoRows:"auto",gridRowGap:e&&Am[e]||e,justifyItems:n,flexGrow:i&&1},r),children:o})}function Pm({gap:e,children:n,sx:i}){return z.jsx(t.Box,{sx:Object.assign({width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"flex-start",gap:e&&Am[e]||e},i),children:n})}function _m({children:e,style:t}){return z.jsx(Pm,{sx:Object.assign({justifyContent:"space-between"},t),children:e})}function Dm({gap:e,justify:t,children:n,sx:i}){return z.jsx(Pm,{sx:Object.assign({position:"relative",width:"fit-content",margin:`-${e}`},i),children:n})}function Nm({children:e,disabled:t,sx:n}){return z.jsx(Pm,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,opacity:t?.2:1,pointerEvents:t?"none":"auto"},n),children:e})}const Fm=({chainId:n,approvalA:i,approvalB:r,parsedAmounts:a,isValid:s,depositADisabled:l,depositBDisabled:d,errorMessage:c,setShowConfirm:u})=>{var p,h;const m=i.needApprove&&!!a[Bm.CURRENCY_A]||i.isApproving,x=r.needApprove&&!!a[Bm.CURRENCY_B]||r.isApproving;return z.jsx(Im,{includeButton:!0,fullWidth:!0,chainId:n,children:z.jsxs(Om,{gap:"md",style:{width:"100%"},children:[(m||x)&&s&&z.jsxs(t.Box,{sx:{width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"space-between",gap:8},children:[m&&z.jsx(t.Button,{size:t.Button.Size.big,isLoading:i.isApproving,onClick:i.submitApprove,disabled:i.insufficientBalance,width:x?"50%":"100%",children:i.isApproving?z.jsx(e.Trans,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(p=i.token)||void 0===p?void 0:p.symbol}}):i.approveTitle}),x&&z.jsx(t.Button,{size:t.Button.Size.big,isLoading:r.isApproving,onClick:r.submitApprove,disabled:r.insufficientBalance,width:m?"50%":"100%",children:r.isApproving?z.jsx(e.Trans,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(h=r.token)||void 0===h?void 0:h.symbol}}):r.approveTitle})]}),z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.big,onClick:()=>{u(!0)},disabled:!s||i.needApprove&&!l||r.needApprove&&!d,danger:!s&&!!a[Bm.CURRENCY_A]&&!!a[Bm.CURRENCY_B],children:c||o.i18n._({id:"rdUucN",message:"Preview"})})]})})},Um=({chainId:e,disabled:n,isLoading:i,onConfirm:r})=>z.jsx(Im,{includeButton:!0,fullWidth:!0,chainId:e,children:z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.big,onClick:r,disabled:n,isLoading:i,children:o.i18n._({id:"h5pjuM",message:"Collect fees"})})});function qm(e){const t=n.useRef();return n.useEffect((()=>{t.current=e})),t.current}const Vm=[.25,.5,.75,1];function Wm({currentValue:e,onClick:i,sx:o}){const r=t.useTheme(),a="light"===r.palette.mode,{isMobile:s}=Xa(),[l,d]=n.useState(null),c=n.useRef(0);n.useEffect((()=>{e?(c.current+=1,c.current>=2&&(d(null),c.current=0)):d(null)}),[e]);const u=qm(e);return n.useEffect((()=>{u===e&&1===l&&(c.current=1)}),[e,u,l]),z.jsx(t.Box,{sx:Object.assign({display:"grid",gap:s?10:14,gridTemplateColumns:`repeat(${Vm.length}, 1fr)`},o),children:Vm.map((e=>{const n=e===l;return z.jsxs(t.ButtonBase,{sx:{typography:"h6",borderRadius:4,padding:r.spacing(4,0),width:"100%",color:"text.secondary",backgroundColor:"background.paperDarkContrast","&:hover":{color:r.palette.text.primary,backgroundColor:t.alpha(r.palette.text.primary,.2)},"&.selected, &:focus":{color:"#fff",backgroundColor:a?r.palette.primary.main:t.alpha(r.palette.text.primary,.4)}},onClick:()=>{n||(c.current=0,d(e),i(e))},className:n?"selected":void 0,children:[100*e,"%"]},e)}))})}const Hm=({value:i,onUserInput:r,maxAmount:a,balance:s,currency:l,locked:d})=>{var c,u;const p=t.useTheme(),h=n.useCallback((e=>{if(!a||!l)return;const t=a.toExact().multipliedBy(e).dp(l.decimals).toString();r(t)}),[l,a,r]),m=n.useMemo((()=>s?ir({input:s.toExact(),decimals:null==l?void 0:l.decimals}):"-"),[null==l?void 0:l.decimals,s]);return z.jsxs(t.Box,{sx:{pt:20,pb:20,px:20,borderRadius:16,backgroundColor:p.palette.background.cardInput},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,color:p.palette.text.primary,typography:"h5"},children:[(null==l?void 0:l.address)&&z.jsx(sl,{address:null!==(c=null==l?void 0:l.address)&&void 0!==c?c:"",chainId:null==l?void 0:l.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:(null==l?void 0:l.address)?z.jsx(t.Box,{children:null!==(u=null==l?void 0:l.symbol)&&void 0!==u?u:"-"}):z.jsx(e.Trans,{id:"sIPJGT",message:"SELECT TOKEN"})})]}),z.jsxs(t.Box,{component:t.ButtonBase,sx:{color:p.palette.text.secondary,"&:hover":{color:p.palette.text.primary},cursor:"pointer",display:"flex",flexWrap:"wrap",justifyContent:"flex-end",typography:"body2"},onClick:()=>{h(1)},children:[z.jsxs(t.Box,{sx:{wordBreak:"keep-all"},children:[o.i18n._({id:"fsBGk0",message:"Balance"}),": "]}),z.jsx(t.Box,{sx:{wordBreak:"break-all",textAlign:"right",display:"flex",alignItems:"center"},children:m})]})]}),z.jsx(Ju,{sx:{mt:4,backgroundColor:p.palette.background.cardInput},suffix:void 0,value:i,onChange:r,readOnly:d,withClear:!d}),d?null:z.jsx(Wm,{sx:{mt:20,mb:0},onClick:h,currentValue:i})]})},Zm={},zm={};var $m,Gm;Object.values(r.ChainId).filter((e=>"number"==typeof e)).map((e=>{const t=p.getUniswapV3FactoryContractAddressByChainId(e),n=p.getNonfungiblePositionManagerContractAddressByChainId(e);t&&(Zm[e]=t),n&&(zm[e]=n)})),r.ChainId.MAINNET,r.ChainId.ARBITRUM_ONE,r.ChainId.SEPOLIA,r.ChainId.TAIKO,function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}($m||($m={})),function(e){e[e.ROUND_DOWN=0]="ROUND_DOWN",e[e.ROUND_HALF_UP=1]="ROUND_HALF_UP",e[e.ROUND_UP=2]="ROUND_UP"}(Gm||(Gm={}));const Qm=E.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ym={[Gm.ROUND_DOWN]:s.ROUND_DOWN,[Gm.ROUND_HALF_UP]:s.ROUND_HALF_UP,[Gm.ROUND_UP]:s.ROUND_UP},Xm={[Gm.ROUND_DOWN]:s.ROUND_DOWN,[Gm.ROUND_HALF_UP]:s.ROUND_HALF_UP,[Gm.ROUND_UP]:s.ROUND_UP};class Km{constructor(e,t=E.BigInt(1)){this.numerator=E.BigInt(e),this.denominator=E.BigInt(t)}static tryParseFraction(e){if(e instanceof E||"number"==typeof e||"string"==typeof e)return new Km(e);if("numerator"in e&&"denominator"in e)return e;throw new Error("Could not parse fraction")}get quotient(){return E.divide(this.numerator,this.denominator)}get remainder(){return new Km(E.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new Km(this.denominator,this.numerator)}add(e){const t=Km.tryParseFraction(e);return E.equal(this.denominator,t.denominator)?new Km(E.add(this.numerator,t.numerator),this.denominator):new Km(E.add(E.multiply(this.numerator,t.denominator),E.multiply(t.numerator,this.denominator)),E.multiply(this.denominator,t.denominator))}subtract(e){const t=Km.tryParseFraction(e);return E.equal(this.denominator,t.denominator)?new Km(E.subtract(this.numerator,t.numerator),this.denominator):new Km(E.subtract(E.multiply(this.numerator,t.denominator),E.multiply(t.numerator,this.denominator)),E.multiply(this.denominator,t.denominator))}lessThan(e){const t=Km.tryParseFraction(e);return E.lessThan(E.multiply(this.numerator,t.denominator),E.multiply(t.numerator,this.denominator))}equalTo(e){const t=Km.tryParseFraction(e);return E.equal(E.multiply(this.numerator,t.denominator),E.multiply(t.numerator,this.denominator))}greaterThan(e){const t=Km.tryParseFraction(e);return E.greaterThan(E.multiply(this.numerator,t.denominator),E.multiply(t.numerator,this.denominator))}multiply(e){const t=Km.tryParseFraction(e);return new Km(E.multiply(this.numerator,t.numerator),E.multiply(this.denominator,t.denominator))}divide(e){const t=Km.tryParseFraction(e);return new Km(E.multiply(this.numerator,t.denominator),E.multiply(this.denominator,t.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=Gm.ROUND_HALF_UP){I(Number.isInteger(e),`${e} is not an integer.`),I(e>0,`${e} is not positive.`);const i=Ym[n],o=new s(this.numerator.toString()).div(this.denominator.toString()).precision(e,i);return o.toFormat(o.decimalPlaces(),i,t)}toFixed(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=Gm.ROUND_HALF_UP){I(Number.isInteger(e),`${e} is not an integer.`),I(e>=0,`${e} is negative.`);const i=Xm[n];return new s(this.numerator.toString()).decimalPlaces(e,i).div(this.denominator.toString()).toFormat(e,i,t)}get asFraction(){return new Km(this.numerator,this.denominator)}}class Jm extends Km{static fromRawAmount(e,t){return new Jm(e,t)}static fromFractionalAmount(e,t,n){return new Jm(e,t,n)}constructor(e,t,n){super(t,n),I(E.lessThanOrEqual(this.quotient,Qm),"AMOUNT"),this.currency=e,this.decimalScale=E.exponentiate(E.BigInt(10),E.BigInt(e.decimals))}add(e){I(this.currency.equals(e.currency),"CURRENCY");const t=super.add(e);return Jm.fromFractionalAmount(this.currency,t.numerator,t.denominator)}subtract(e){I(this.currency.equals(e.currency),"CURRENCY");const t=super.subtract(e);return Jm.fromFractionalAmount(this.currency,t.numerator,t.denominator)}multiply(e){const t=super.multiply(e);return Jm.fromFractionalAmount(this.currency,t.numerator,t.denominator)}divide(e){const t=super.divide(e);return Jm.fromFractionalAmount(this.currency,t.numerator,t.denominator)}toSignificant(e=6,t,n=Gm.ROUND_DOWN){return super.divide(this.decimalScale).toSignificant(e,t,n)}toFixed(e=this.currency.decimals,t,n=Gm.ROUND_DOWN){return I(e<=this.currency.decimals,"DECIMALS"),super.divide(this.decimalScale).toFixed(e,t,n)}toExact(){return new s(this.quotient.toString()).div(this.decimalScale.toString())}get wrapped(){return this.currency.isToken?this:Jm.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}const ex=new Km(E.BigInt(100));function tx(e){return new nx(e.numerator,e.denominator)}class nx extends Km{constructor(){super(...arguments),this.isPercent=!0}add(e){return tx(super.add(e))}subtract(e){return tx(super.subtract(e))}multiply(e){return tx(super.multiply(e))}divide(e){return tx(super.divide(e))}toSignificant(e=5,t,n){return super.multiply(ex).toSignificant(e,t,n)}toFixed(e=2,t,n){return super.multiply(ex).toFixed(e,t,n)}}class ix extends Km{constructor(...e){let t,n,i,o;if(4===e.length)[t,n,i,o]=e;else{const r=e[0].quoteAmount.divide(e[0].baseAmount);[t,n,i,o]=[e[0].baseAmount.currency,e[0].quoteAmount.currency,r.denominator,r.numerator]}super(o,i),this.baseCurrency=t,this.quoteCurrency=n,this.scalar=new Km(E.exponentiate(E.BigInt(10),E.BigInt(t.decimals)),E.exponentiate(E.BigInt(10),E.BigInt(n.decimals)))}invert(){return new ix(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)}multiply(e){I(this.quoteCurrency.equals(e.baseCurrency),"TOKEN");const t=super.multiply(e);return new ix(this.baseCurrency,e.quoteCurrency,t.denominator,t.numerator)}quote(e){I(e.currency.equals(this.baseCurrency),"TOKEN");const t=super.multiply(e);return Jm.fromFractionalAmount(this.quoteCurrency,t.numerator,t.denominator)}get adjustedForDecimals(){return super.multiply(this.scalar)}toSignificant(e=6,t,n){return this.adjustedForDecimals.toSignificant(e,t,n)}toFixed(e=4,t,n){return this.adjustedForDecimals.toFixed(e,t,n)}}class ox{constructor(e,t,n,i){I(Number.isSafeInteger(e),"CHAIN_ID"),I(t>=0&&t<255&&Number.isInteger(t),"DECIMALS"),this.chainId=e,this.decimals=t,this.symbol=n,this.name=i}}function rx(e){try{return Xr(e)}catch(t){throw new Error(`${e} is not a valid address.`)}}const ax=/^0x[0-9a-fA-F]{40}$/;class sx extends ox{constructor(e,t,n,i,o,r,a,s){super(e,n,i,o),this.isNative=!1,this.isToken=!0,this.address=r?function(e){if(ax.test(e))return e;throw new Error(`${e} is not a valid address.`)}(t):rx(t),a&&I(a.gte(x.BigNumber.from(0)),"NON-NEGATIVE FOT FEES"),s&&I(s.gte(x.BigNumber.from(0)),"NON-NEGATIVE FOT FEES"),this.buyFeeBps=a,this.sellFeeBps=s}equals(e){return e.isToken&&this.chainId===e.chainId&&this.address.toLowerCase()===e.address.toLowerCase()}sortsBefore(e){return I(this.chainId===e.chainId,"CHAIN_IDS"),I(this.address.toLowerCase()!==e.address.toLowerCase(),"ADDRESSES"),this.address.toLowerCase()<e.address.toLowerCase()}get wrapped(){return this}}const lx=E.BigInt(Number.MAX_SAFE_INTEGER),dx=E.BigInt(0),cx=E.BigInt(1),ux=E.BigInt(2);const px=E.BigInt(0),hx=1e4;new nx(E.BigInt(1),hx),new nx(1,100),new nx(3,100),new nx(5,100),new nx(10,100),new nx(15,100);const mx=new nx(0);new nx(1);const xx="0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";var gx;!function(e){e[e.LOWEST=100]="LOWEST",e[e.LOW_200=200]="LOW_200",e[e.LOW_300=300]="LOW_300",e[e.LOW_400=400]="LOW_400",e[e.LOW=500]="LOW",e[e.MEDIUM=3e3]="MEDIUM",e[e.HIGH=1e4]="HIGH"}(gx||(gx={}));const fx={[gx.LOWEST]:1,[gx.LOW_200]:4,[gx.LOW_300]:6,[gx.LOW_400]:8,[gx.LOW]:10,[gx.MEDIUM]:60,[gx.HIGH]:200},yx=E.BigInt(-1),vx=E.BigInt(0),bx=E.BigInt(1),Cx=E.exponentiate(E.BigInt(2),E.BigInt(96)),jx=E.exponentiate(Cx,E.BigInt(2));function wx({factoryAddress:e,tokenA:t,tokenB:n,fee:i,initCodeHashManualOverride:o,chainId:a}){const[s,l]=t.sortsBefore(n)?[t,n]:[n,t],d=fa(["bytes"],[Vh.encode(["address","address","uint24"],[s.address,l.address,i])]),c=null!=o?o:function(e){switch(e){case r.ChainId.TAIKO:case r.ChainId.ZETACHAIN:case r.ChainId.ZETACHAIN_TESTNET:return"0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";case r.ChainId.SEPOLIA:return"0x4509fa1e2d1989ac1632a56fe87c53e8d1e9d05847694e00f62b23e28cec98c4";default:return xx}}(a);return Kr(e,d,c)}const kx=E.BigInt(2),Tx=[128,64,32,16,8,4,2,1].map((e=>[e,E.exponentiate(kx,E.BigInt(e))]));function Bx(e,t){return E.signedRightShift(E.multiply(e,E.BigInt(t)),E.BigInt(128))}const Ex=E.exponentiate(E.BigInt(2),E.BigInt(32));class Ix{constructor(){}static getSqrtRatioAtTick(e){I(e>=Ix.MIN_TICK&&e<=Ix.MAX_TICK&&Number.isInteger(e),"TICK");const t=e<0?-1*e:e;let n=1&t?E.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):E.BigInt("0x100000000000000000000000000000000");return 2&t&&(n=Bx(n,"0xfff97272373d413259a46990580e213a")),4&t&&(n=Bx(n,"0xfff2e50f5f656932ef12357cf3c7fdcc")),8&t&&(n=Bx(n,"0xffe5caca7e10e4e61c3624eaa0941cd0")),16&t&&(n=Bx(n,"0xffcb9843d60f6159c9db58835c926644")),32&t&&(n=Bx(n,"0xff973b41fa98c081472e6896dfb254c0")),64&t&&(n=Bx(n,"0xff2ea16466c96a3843ec78b326b52861")),128&t&&(n=Bx(n,"0xfe5dee046a99a2a811c461f1969c3053")),256&t&&(n=Bx(n,"0xfcbe86c7900a88aedcffc83b479aa3a4")),512&t&&(n=Bx(n,"0xf987a7253ac413176f2b074cf7815e54")),1024&t&&(n=Bx(n,"0xf3392b0822b70005940c7a398e4b70f3")),2048&t&&(n=Bx(n,"0xe7159475a2c29b7443b29c7fa6e889d9")),4096&t&&(n=Bx(n,"0xd097f3bdfd2022b8845ad8f792aa5825")),8192&t&&(n=Bx(n,"0xa9f746462d870fdf8a65dc1f90e061e5")),16384&t&&(n=Bx(n,"0x70d869a156d2a1b890bb3df62baf32f7")),32768&t&&(n=Bx(n,"0x31be135f97d08fd981231505542fcfa6")),65536&t&&(n=Bx(n,"0x9aa508b5b7a84e1c677de54f3e99bc9")),131072&t&&(n=Bx(n,"0x5d6af8dedb81196699c329225ee604")),262144&t&&(n=Bx(n,"0x2216e584f5fa1ea926041bedfe98")),524288&t&&(n=Bx(n,"0x48a170391f7dc42444e8fa2")),e>0&&(n=E.divide(Qm,n)),E.greaterThan(E.remainder(n,Ex),vx)?E.add(E.divide(n,Ex),bx):E.divide(n,Ex)}static getTickAtSqrtRatio(e){I(E.greaterThanOrEqual(e,Ix.MIN_SQRT_RATIO)&&E.lessThan(e,Ix.MAX_SQRT_RATIO),"SQRT_RATIO");const t=E.leftShift(e,E.BigInt(32)),n=function(e){I(E.greaterThan(e,vx),"ZERO"),I(E.lessThanOrEqual(e,Qm),"MAX");let t=0;for(const[n,i]of Tx)E.greaterThanOrEqual(e,i)&&(e=E.signedRightShift(e,E.BigInt(n)),t+=n);return t}(t);let i;i=E.greaterThanOrEqual(E.BigInt(n),E.BigInt(128))?E.signedRightShift(t,E.BigInt(n-127)):E.leftShift(t,E.BigInt(127-n));let o=E.leftShift(E.subtract(E.BigInt(n),E.BigInt(128)),E.BigInt(64));for(let e=0;e<14;e++){i=E.signedRightShift(E.multiply(i,i),E.BigInt(127));const t=E.signedRightShift(i,E.BigInt(128));o=E.bitwiseOr(o,E.leftShift(t,E.BigInt(63-e))),i=E.signedRightShift(i,t)}const r=E.multiply(o,E.BigInt("255738958999603826347141")),a=E.toNumber(E.signedRightShift(E.subtract(r,E.BigInt("3402992956809132418596140100660247210")),E.BigInt(128))),s=E.toNumber(E.signedRightShift(E.add(r,E.BigInt("291339464771989622907027621153398088495")),E.BigInt(128)));return a===s?a:E.lessThanOrEqual(Ix.getSqrtRatioAtTick(s),e)?s:a}}Ix.MIN_TICK=-887272,Ix.MAX_TICK=-Ix.MIN_TICK,Ix.MIN_SQRT_RATIO=E.BigInt("4295128739"),Ix.MAX_SQRT_RATIO=E.BigInt("1461446703485210103287273052203988822378723970342");class Ax{constructor(){}static mulDivRoundingUp(e,t,n){const i=E.multiply(e,t);let o=E.divide(i,n);return E.notEqual(E.remainder(i,n),vx)&&(o=E.add(o,bx)),o}}const Sx=E.subtract(E.exponentiate(E.BigInt(2),E.BigInt(160)),bx);function Lx(e,t){const n=E.multiply(e,t);return E.bitwiseAnd(n,Qm)}class Mx{constructor(){}static getAmount0Delta(e,t,n,i){E.greaterThan(e,t)&&([e,t]=[t,e]);const o=E.leftShift(n,E.BigInt(96)),r=E.subtract(t,e);return i?Ax.mulDivRoundingUp(Ax.mulDivRoundingUp(o,r,t),bx,e):E.divide(E.divide(E.multiply(o,r),t),e)}static getAmount1Delta(e,t,n,i){return E.greaterThan(e,t)&&([e,t]=[t,e]),i?Ax.mulDivRoundingUp(n,E.subtract(t,e),Cx):E.divide(E.multiply(n,E.subtract(t,e)),Cx)}static getNextSqrtPriceFromInput(e,t,n,i){return I(E.greaterThan(e,vx)),I(E.greaterThan(t,vx)),i?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)}static getNextSqrtPriceFromOutput(e,t,n,i){return I(E.greaterThan(e,vx)),I(E.greaterThan(t,vx)),i?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)}static getNextSqrtPriceFromAmount0RoundingUp(e,t,n,i){if(E.equal(n,vx))return e;const o=E.leftShift(t,E.BigInt(96));if(i){let t=Lx(n,e);if(E.equal(E.divide(t,n),e)){const n=function(e,t){const n=E.add(e,t);return E.bitwiseAnd(n,Qm)}(o,t);if(E.greaterThanOrEqual(n,o))return Ax.mulDivRoundingUp(o,e,n)}return Ax.mulDivRoundingUp(o,bx,E.add(E.divide(o,e),n))}{let t=Lx(n,e);I(E.equal(E.divide(t,n),e)),I(E.greaterThan(o,t));const i=E.subtract(o,t);return Ax.mulDivRoundingUp(o,e,i)}}static getNextSqrtPriceFromAmount1RoundingDown(e,t,n,i){if(i){const i=E.lessThanOrEqual(n,Sx)?E.divide(E.leftShift(n,E.BigInt(96)),t):E.divide(E.multiply(n,Cx),t);return E.add(e,i)}{const i=Ax.mulDivRoundingUp(n,Cx,t);return I(E.greaterThan(e,i)),E.subtract(e,i)}}}const Rx=E.exponentiate(E.BigInt(10),E.BigInt(6));class Ox{constructor(){}static computeSwapStep(e,t,n,i,o){const r={};o=E.BigInt(o);const a=E.greaterThanOrEqual(e,t),s=E.greaterThanOrEqual(i,vx);if(s){const s=E.divide(E.multiply(i,E.subtract(Rx,o)),Rx);r.amountIn=a?Mx.getAmount0Delta(t,e,n,!0):Mx.getAmount1Delta(e,t,n,!0),E.greaterThanOrEqual(s,r.amountIn)?r.sqrtRatioNextX96=t:r.sqrtRatioNextX96=Mx.getNextSqrtPriceFromInput(e,n,s,a)}else r.amountOut=a?Mx.getAmount1Delta(t,e,n,!1):Mx.getAmount0Delta(e,t,n,!1),E.greaterThanOrEqual(E.multiply(i,yx),r.amountOut)?r.sqrtRatioNextX96=t:r.sqrtRatioNextX96=Mx.getNextSqrtPriceFromOutput(e,n,E.multiply(i,yx),a);const l=E.equal(t,r.sqrtRatioNextX96);return a?(r.amountIn=l&&s?r.amountIn:Mx.getAmount0Delta(r.sqrtRatioNextX96,e,n,!0),r.amountOut=l&&!s?r.amountOut:Mx.getAmount1Delta(r.sqrtRatioNextX96,e,n,!1)):(r.amountIn=l&&s?r.amountIn:Mx.getAmount1Delta(e,r.sqrtRatioNextX96,n,!0),r.amountOut=l&&!s?r.amountOut:Mx.getAmount0Delta(e,r.sqrtRatioNextX96,n,!1)),!s&&E.greaterThan(r.amountOut,E.multiply(i,yx))&&(r.amountOut=E.multiply(i,yx)),s&&E.notEqual(r.sqrtRatioNextX96,t)?r.feeAmount=E.subtract(i,r.amountIn):r.feeAmount=Ax.mulDivRoundingUp(r.amountIn,o,E.subtract(Rx,o)),[r.sqrtRatioNextX96,r.amountIn,r.amountOut,r.feeAmount]}}class Px{constructor(){}static addDelta(e,t){return E.lessThan(t,vx)?E.subtract(e,E.multiply(t,yx)):E.add(e,t)}}class _x{getTick(e){return N(this,void 0,void 0,(function*(){throw new Error(_x.ERROR_MESSAGE)}))}nextInitializedTickWithinOneWord(e,t,n){return N(this,void 0,void 0,(function*(){throw new Error(_x.ERROR_MESSAGE)}))}}function Dx(e,t){return e.index-t.index}_x.ERROR_MESSAGE="No tick data provider was given";class Nx{constructor(){}static validateList(e,t){I(t>0,"TICK_SPACING_NONZERO"),I(e.every((({index:e})=>e%t==0)),"TICK_SPACING"),I(E.equal(e.reduce(((e,{liquidityNet:t})=>E.add(e,t)),vx),vx),"ZERO_NET"),I(function(e,t){for(let n=0;n<e.length-1;n++)if(t(e[n],e[n+1])>0)return!1;return!0}(e,Dx),"SORTED")}static isBelowSmallest(e,t){return I(e.length>0,"LENGTH"),t<e[0].index}static isAtOrAboveLargest(e,t){return I(e.length>0,"LENGTH"),t>=e[e.length-1].index}static getTick(e,t){const n=e[this.binarySearch(e,t)];return I(n.index===t,"NOT_CONTAINED"),n}static binarySearch(e,t){I(!this.isBelowSmallest(e,t),"BELOW_SMALLEST");let n,i=0,o=e.length-1;for(;;){if(n=Math.floor((i+o)/2),e[n].index<=t&&(n===e.length-1||e[n+1].index>t))return n;e[n].index<t?i=n+1:o=n-1}}static nextInitializedTick(e,t,n){if(n){if(I(!Nx.isBelowSmallest(e,t),"BELOW_SMALLEST"),Nx.isAtOrAboveLargest(e,t))return e[e.length-1];return e[this.binarySearch(e,t)]}if(I(!this.isAtOrAboveLargest(e,t),"AT_OR_ABOVE_LARGEST"),this.isBelowSmallest(e,t))return e[0];return e[this.binarySearch(e,t)+1]}static nextInitializedTickWithinOneWord(e,t,n,i){const o=Math.floor(t/i);if(n){const r=(o>>8<<8)*i;if(Nx.isBelowSmallest(e,t))return[r,!1];const a=Nx.nextInitializedTick(e,t,n).index,s=Math.max(r,a);return[s,s===a]}{const r=(((o+1>>8)+1<<8)-1)*i;if(this.isAtOrAboveLargest(e,t))return[r,!1];const a=this.nextInitializedTick(e,t,n).index,s=Math.min(r,a);return[s,s===a]}}}function Fx(e){let t=E.BigInt(e).toString(16);return t.length%2!=0&&(t=`0${t}`),`0x${t}`}function Ux(e,t){const n=E.leftShift(E.BigInt(e),E.BigInt(192)),i=E.BigInt(t);return function(e){if(I(E.greaterThanOrEqual(e,dx),"NEGATIVE"),E.lessThan(e,lx))return E.BigInt(Math.floor(Math.sqrt(E.toNumber(e))));let t,n;for(t=e,n=E.add(E.divide(e,ux),cx);E.lessThan(n,t);)t=n,n=E.divide(E.add(E.divide(e,n),n),ux);return t}(E.divide(n,i))}function qx(e,t,n){E.greaterThan(e,t)&&([e,t]=[t,e]);const i=E.divide(E.multiply(e,t),Cx);return E.divide(E.multiply(E.BigInt(n),i),E.subtract(t,e))}function Vx(e,t,n){E.greaterThan(e,t)&&([e,t]=[t,e]);const i=E.multiply(E.multiply(E.BigInt(n),e),t),o=E.multiply(Cx,E.subtract(t,e));return E.divide(i,o)}function Wx(e,t,n){return E.greaterThan(e,t)&&([e,t]=[t,e]),E.divide(E.multiply(E.BigInt(n),Cx),E.subtract(t,e))}function Hx(e,t,n,i,o,r){E.greaterThan(t,n)&&([t,n]=[n,t]);const a=r?Vx:qx;if(E.lessThanOrEqual(e,t))return a(t,n,i);if(E.lessThan(e,n)){const r=a(e,n,i),s=Wx(t,e,o);return E.lessThan(r,s)?r:s}return Wx(t,n,o)}function Zx(e,t){I(Number.isInteger(e)&&Number.isInteger(t),"INTEGERS"),I(t>0,"TICK_SPACING"),I(e>=Ix.MIN_TICK&&e<=Ix.MAX_TICK,"TICK_BOUND");const n=Math.round(e/t)*t;return n<Ix.MIN_TICK?n+t:n>Ix.MAX_TICK?n-t:n}function zx(e,t,n){const i=Ix.getSqrtRatioAtTick(n),o=E.multiply(i,i);return e.sortsBefore(t)?new ix(e,t,jx,o):new ix(e,t,o,jx)}function $x(e){const t=e.baseCurrency.sortsBefore(e.quoteCurrency),n=t?Ux(e.numerator,e.denominator):Ux(e.denominator,e.numerator);let i=Ix.getTickAtSqrtRatio(n);const o=zx(e.baseCurrency,e.quoteCurrency,i+1);return t?e.lessThan(o)||i++:e.greaterThan(o)||i++,i}E.exponentiate(E.BigInt(2),E.BigInt(128)),E.exponentiate(E.BigInt(2),E.BigInt(256));class Gx{constructor({index:e,liquidityGross:t,liquidityNet:n}){I(e>=Ix.MIN_TICK&&e<=Ix.MAX_TICK,"TICK"),this.index=e,this.liquidityGross=E.BigInt(t),this.liquidityNet=E.BigInt(n)}}class Qx{constructor(e,t){const n=e.map((e=>e instanceof Gx?e:new Gx(e)));Nx.validateList(n,t),this.ticks=n}getTick(e){return N(this,void 0,void 0,(function*(){return Nx.getTick(this.ticks,e)}))}nextInitializedTickWithinOneWord(e,t,n){return N(this,void 0,void 0,(function*(){return Nx.nextInitializedTickWithinOneWord(this.ticks,e,t,n)}))}}const Yx=new _x;let Xx=class e{static getAddress(e,t,n,i,o){return wx({factoryAddress:null!=o?o:"0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2",fee:n,tokenA:e,tokenB:t,initCodeHashManualOverride:i})}constructor(e,t,n,i,o,r,a=Yx){I(Number.isInteger(n)&&n<1e6,"FEE");const s=Ix.getSqrtRatioAtTick(r),l=Ix.getSqrtRatioAtTick(r+1);I(E.greaterThanOrEqual(E.BigInt(i),s)&&E.lessThanOrEqual(E.BigInt(i),l),"PRICE_BOUNDS"),[this.token0,this.token1]=e.sortsBefore(t)?[e,t]:[t,e],this.fee=n,this.sqrtRatioX96=E.BigInt(i),this.liquidity=E.BigInt(o),this.tickCurrent=r,this.tickDataProvider=Array.isArray(a)?new Qx(a,fx[n]):a}involvesToken(e){return e.equals(this.token0)||e.equals(this.token1)}get token0Price(){var e;return null!==(e=this._token0Price)&&void 0!==e?e:this._token0Price=new ix(this.token0,this.token1,jx,E.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}get token1Price(){var e;return null!==(e=this._token1Price)&&void 0!==e?e:this._token1Price=new ix(this.token1,this.token0,E.multiply(this.sqrtRatioX96,this.sqrtRatioX96),jx)}priceOf(e){return I(this.involvesToken(e),"TOKEN"),e.equals(this.token0)?this.token0Price:this.token1Price}get chainId(){return this.token0.chainId}getOutputAmount(t,n){return N(this,void 0,void 0,(function*(){I(this.involvesToken(t.currency),"TOKEN");const i=t.currency.equals(this.token0),{amountCalculated:o,sqrtRatioX96:r,liquidity:a,tickCurrent:s}=yield this.swap(i,t.quotient,n),l=i?this.token1:this.token0;return[Jm.fromRawAmount(l,E.multiply(o,yx)),new e(this.token0,this.token1,this.fee,r,a,s,this.tickDataProvider)]}))}getInputAmount(t,n){return N(this,void 0,void 0,(function*(){I(t.currency.isToken&&this.involvesToken(t.currency),"TOKEN");const i=t.currency.equals(this.token1),{amountCalculated:o,sqrtRatioX96:r,liquidity:a,tickCurrent:s}=yield this.swap(i,E.multiply(t.quotient,yx),n),l=i?this.token0:this.token1;return[Jm.fromRawAmount(l,o),new e(this.token0,this.token1,this.fee,r,a,s,this.tickDataProvider)]}))}swap(e,t,n){return N(this,void 0,void 0,(function*(){return function(e,t,n,i,o,r,a,s,l){return N(this,void 0,void 0,(function*(){l||(l=a?E.add(Ix.MIN_SQRT_RATIO,bx):E.subtract(Ix.MAX_SQRT_RATIO,bx)),a?(I(E.greaterThan(l,Ix.MIN_SQRT_RATIO),"RATIO_MIN"),I(E.lessThan(l,t),"RATIO_CURRENT")):(I(E.lessThan(l,Ix.MAX_SQRT_RATIO),"RATIO_MAX"),I(E.greaterThan(l,t),"RATIO_CURRENT"));const d=E.greaterThanOrEqual(s,vx),c={amountSpecifiedRemaining:s,amountCalculated:vx,sqrtPriceX96:t,tick:n,liquidity:i};for(;E.notEqual(c.amountSpecifiedRemaining,vx)&&c.sqrtPriceX96!==l;){let t={};if(t.sqrtPriceStartX96=c.sqrtPriceX96,[t.tickNext,t.initialized]=yield r.nextInitializedTickWithinOneWord(c.tick,a,o),t.tickNext<Ix.MIN_TICK?t.tickNext=Ix.MIN_TICK:t.tickNext>Ix.MAX_TICK&&(t.tickNext=Ix.MAX_TICK),t.sqrtPriceNextX96=Ix.getSqrtRatioAtTick(t.tickNext),[c.sqrtPriceX96,t.amountIn,t.amountOut,t.feeAmount]=Ox.computeSwapStep(c.sqrtPriceX96,(a?E.lessThan(t.sqrtPriceNextX96,l):E.greaterThan(t.sqrtPriceNextX96,l))?l:t.sqrtPriceNextX96,c.liquidity,c.amountSpecifiedRemaining,e),d?(c.amountSpecifiedRemaining=E.subtract(c.amountSpecifiedRemaining,E.add(t.amountIn,t.feeAmount)),c.amountCalculated=E.subtract(c.amountCalculated,t.amountOut)):(c.amountSpecifiedRemaining=E.add(c.amountSpecifiedRemaining,t.amountOut),c.amountCalculated=E.add(c.amountCalculated,E.add(t.amountIn,t.feeAmount))),E.equal(c.sqrtPriceX96,t.sqrtPriceNextX96)){if(t.initialized){let e=E.BigInt((yield r.getTick(t.tickNext)).liquidityNet);a&&(e=E.multiply(e,yx)),c.liquidity=Px.addDelta(c.liquidity,e)}c.tick=a?t.tickNext-1:t.tickNext}else E.notEqual(c.sqrtPriceX96,t.sqrtPriceStartX96)&&(c.tick=Ix.getTickAtSqrtRatio(c.sqrtPriceX96))}return{amountCalculated:c.amountCalculated,sqrtRatioX96:c.sqrtPriceX96,liquidity:c.liquidity,tickCurrent:c.tick}}))}(E.BigInt(this.fee),this.sqrtRatioX96,this.tickCurrent,this.liquidity,this.tickSpacing,this.tickDataProvider,e,t,n)}))}get tickSpacing(){return fx[this.fee]}};class Kx{constructor({pool:e,liquidity:t,tickLower:n,tickUpper:i}){this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,I(n<i,"TICK_ORDER"),I(n>=Ix.MIN_TICK&&n%e.tickSpacing==0,"TICK_LOWER"),I(i<=Ix.MAX_TICK&&i%e.tickSpacing==0,"TICK_UPPER"),this.pool=e,this.tickLower=n,this.tickUpper=i,this.liquidity=E.BigInt(t)}get token0PriceLower(){return zx(this.pool.token0,this.pool.token1,this.tickLower)}get token0PriceUpper(){return zx(this.pool.token0,this.pool.token1,this.tickUpper)}get amount0(){return null===this._token0Amount&&(this.pool.tickCurrent<this.tickLower?this._token0Amount=Jm.fromRawAmount(this.pool.token0,Mx.getAmount0Delta(Ix.getSqrtRatioAtTick(this.tickLower),Ix.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this.pool.tickCurrent<this.tickUpper?this._token0Amount=Jm.fromRawAmount(this.pool.token0,Mx.getAmount0Delta(this.pool.sqrtRatioX96,Ix.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this._token0Amount=Jm.fromRawAmount(this.pool.token0,vx)),this._token0Amount}get amount1(){return null===this._token1Amount&&(this.pool.tickCurrent<this.tickLower?this._token1Amount=Jm.fromRawAmount(this.pool.token1,vx):this.pool.tickCurrent<this.tickUpper?this._token1Amount=Jm.fromRawAmount(this.pool.token1,Mx.getAmount1Delta(Ix.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!1)):this._token1Amount=Jm.fromRawAmount(this.pool.token1,Mx.getAmount1Delta(Ix.getSqrtRatioAtTick(this.tickLower),Ix.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1))),this._token1Amount}ratiosAfterSlippage(e){const t=this.pool.token0Price.asFraction.multiply(new nx(1).subtract(e)),n=this.pool.token0Price.asFraction.multiply(e.add(1));let i=Ux(t.numerator,t.denominator);E.lessThanOrEqual(i,Ix.MIN_SQRT_RATIO)&&(i=E.add(Ix.MIN_SQRT_RATIO,E.BigInt(1)));let o=Ux(n.numerator,n.denominator);return E.greaterThanOrEqual(o,Ix.MAX_SQRT_RATIO)&&(o=E.subtract(Ix.MAX_SQRT_RATIO,E.BigInt(1))),{sqrtRatioX96Lower:i,sqrtRatioX96Upper:o}}mintAmountsWithSlippage(e){const{sqrtRatioX96Upper:t,sqrtRatioX96Lower:n}=this.ratiosAfterSlippage(e),i=new Xx(this.pool.token0,this.pool.token1,this.pool.fee,n,0,Ix.getTickAtSqrtRatio(n)),o=new Xx(this.pool.token0,this.pool.token1,this.pool.fee,t,0,Ix.getTickAtSqrtRatio(t)),r=Kx.fromAmounts(Object.assign(Object.assign({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts),{useFullPrecision:!1})),{amount0:a}=new Kx({pool:o,liquidity:r.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts,{amount1:s}=new Kx({pool:i,liquidity:r.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts;return{amount0:a,amount1:s}}burnAmountsWithSlippage(e){const{sqrtRatioX96Upper:t,sqrtRatioX96Lower:n}=this.ratiosAfterSlippage(e),i=new Xx(this.pool.token0,this.pool.token1,this.pool.fee,n,0,Ix.getTickAtSqrtRatio(n)),o=new Xx(this.pool.token0,this.pool.token1,this.pool.fee,t,0,Ix.getTickAtSqrtRatio(t)),r=new Kx({pool:o,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,a=new Kx({pool:i,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount1;return{amount0:r.quotient,amount1:a.quotient}}get mintAmounts(){return null===this._mintAmounts?this.pool.tickCurrent<this.tickLower?{amount0:Mx.getAmount0Delta(Ix.getSqrtRatioAtTick(this.tickLower),Ix.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:vx}:this.pool.tickCurrent<this.tickUpper?{amount0:Mx.getAmount0Delta(this.pool.sqrtRatioX96,Ix.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:Mx.getAmount1Delta(Ix.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!0)}:{amount0:vx,amount1:Mx.getAmount1Delta(Ix.getSqrtRatioAtTick(this.tickLower),Ix.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0)}:this._mintAmounts}static fromAmounts({pool:e,tickLower:t,tickUpper:n,amount0:i,amount1:o,useFullPrecision:r}){const a=Ix.getSqrtRatioAtTick(t),s=Ix.getSqrtRatioAtTick(n);return new Kx({pool:e,tickLower:t,tickUpper:n,liquidity:Hx(e.sqrtRatioX96,a,s,i,o,r)})}static fromAmount0({pool:e,tickLower:t,tickUpper:n,amount0:i,useFullPrecision:o}){return Kx.fromAmounts({pool:e,tickLower:t,tickUpper:n,amount0:i,amount1:Qm,useFullPrecision:o})}static fromAmount1({pool:e,tickLower:t,tickUpper:n,amount1:i}){return Kx.fromAmounts({pool:e,tickLower:t,tickUpper:n,amount0:Qm,amount1:i,useFullPrecision:!0})}}var Jx=[{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"}];class eg{constructor(){}static encodeMulticall(e){return Array.isArray(e)||(e=[e]),1===e.length?e[0]:eg.INTERFACE.encodeFunctionData("multicall",[e])}static decodeMulticall(e){return eg.INTERFACE.decodeFunctionData("multicall",e).data}}eg.INTERFACE=new Xh(Jx);var tg=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"},{internalType:"address",name:"_tokenDescriptor_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Collect",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"DecreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"IncreaseLiquidity",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint128",name:"amount0Max",type:"uint128"},{internalType:"uint128",name:"amount1Max",type:"uint128"}],internalType:"struct INonfungiblePositionManager.CollectParams",name:"params",type:"tuple"}],name:"collect",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"}],name:"createAndInitializePoolIfNecessary",outputs:[{internalType:"address",name:"pool",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.DecreaseLiquidityParams",name:"params",type:"tuple"}],name:"decreaseLiquidity",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.IncreaseLiquidityParams",name:"params",type:"tuple"}],name:"increaseLiquidity",outputs:[{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"}],internalType:"struct INonfungiblePositionManager.MintParams",name:"params",type:"tuple"}],name:"mint",outputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"positions",outputs:[{internalType:"uint96",name:"nonce",type:"uint96"},{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"},{internalType:"uint128",name:"liquidity",type:"uint128"},{internalType:"uint256",name:"feeGrowthInside0LastX128",type:"uint256"},{internalType:"uint256",name:"feeGrowthInside1LastX128",type:"uint256"},{internalType:"uint128",name:"tokensOwed0",type:"uint128"},{internalType:"uint128",name:"tokensOwed1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount0Owed",type:"uint256"},{internalType:"uint256",name:"amount1Owed",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"uniswapV3MintCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}],ng=[{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"}];class ig{constructor(){}static encodeFeeBips(e){return Fx(e.multiply(1e4).quotient)}static encodeUnwrapWETH9(e,t,n){if(t=rx(t),n){const i=this.encodeFeeBips(n.fee),o=rx(n.recipient);return ig.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[Fx(e),t,i,o])}return ig.INTERFACE.encodeFunctionData("unwrapWETH9",[Fx(e),t])}static encodeSweepToken(e,t,n,i){if(n=rx(n),i){const o=this.encodeFeeBips(i.fee),r=rx(i.recipient);return ig.INTERFACE.encodeFunctionData("sweepTokenWithFee",[e.address,Fx(t),n,o,r])}return ig.INTERFACE.encodeFunctionData("sweepToken",[e.address,Fx(t),n])}static encodeRefundETH(){return ig.INTERFACE.encodeFunctionData("refundETH")}}ig.INTERFACE=new Xh(ng);var og=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"}];class rg{constructor(){}static encodePermit(e,t){return"nonce"in t?rg.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,Fx(t.nonce),Fx(t.expiry),t.v,t.r,t.s]):rg.INTERFACE.encodeFunctionData("selfPermit",[e.address,Fx(t.amount),Fx(t.deadline),t.v,t.r,t.s])}}rg.INTERFACE=new Xh(og);const ag=Fx(E.subtract(E.exponentiate(E.BigInt(2),E.BigInt(128)),E.BigInt(1)));function sg(e){return Object.keys(e).some((e=>"recipient"===e))}const lg={Permit:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};class dg{constructor(){}static encodeCreate(e){return dg.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[e.token0.address,e.token1.address,e.fee,Fx(e.sqrtRatioX96)])}static createCallParameters(e){return{calldata:this.encodeCreate(e),value:Fx(0)}}static addCallParameters(e,t){I(E.greaterThan(e.liquidity,vx),"ZERO_LIQUIDITY");const n=[],{amount0:i,amount1:o}=e.mintAmounts,r=e.mintAmountsWithSlippage(t.slippageTolerance),a=Fx(r.amount0),s=Fx(r.amount1),l=Fx(t.deadline);if(sg(t)&&t.createPool&&n.push(this.encodeCreate(e.pool)),t.token0Permit&&n.push(rg.encodePermit(e.pool.token0,t.token0Permit)),t.token1Permit&&n.push(rg.encodePermit(e.pool.token1,t.token1Permit)),sg(t)){const r=rx(t.recipient);n.push(dg.INTERFACE.encodeFunctionData("mint",[{token0:e.pool.token0.address,token1:e.pool.token1.address,fee:e.pool.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0Desired:Fx(i),amount1Desired:Fx(o),amount0Min:a,amount1Min:s,recipient:r,deadline:l}]))}else n.push(dg.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:Fx(t.tokenId),amount0Desired:Fx(i),amount1Desired:Fx(o),amount0Min:a,amount1Min:s,deadline:l}]));let d=Fx(0);if(t.useNative){const r=t.useNative.wrapped;I(e.pool.token0.equals(r)||e.pool.token1.equals(r),"NO_WETH");const a=e.pool.token0.equals(r)?i:o;E.greaterThan(a,vx)&&n.push(ig.encodeRefundETH()),d=Fx(a)}return{calldata:eg.encodeMulticall(n),value:d}}static encodeCollect(e){const t=[],n=Fx(e.tokenId),i=e.expectedCurrencyOwed0.currency.isNative||e.expectedCurrencyOwed1.currency.isNative,o=rx(e.recipient);if(t.push(dg.INTERFACE.encodeFunctionData("collect",[{tokenId:n,recipient:i?"0x0000000000000000000000000000000000000000":o,amount0Max:ag,amount1Max:ag}])),i){const n=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed0.quotient:e.expectedCurrencyOwed1.quotient,i=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed1.currency:e.expectedCurrencyOwed0.currency,r=e.expectedCurrencyOwed0.currency.isNative?e.expectedCurrencyOwed1.quotient:e.expectedCurrencyOwed0.quotient;t.push(ig.encodeUnwrapWETH9(n,o)),t.push(ig.encodeSweepToken(i,r,o))}return t}static collectCallParameters(e){const t=dg.encodeCollect(e);return{calldata:eg.encodeMulticall(t),value:Fx(0)}}static removeCallParameters(e,t){const n=[],i=Fx(t.deadline),o=Fx(t.tokenId),r=new Kx({pool:e.pool,liquidity:t.liquidityPercentage.multiply(e.liquidity).quotient,tickLower:e.tickLower,tickUpper:e.tickUpper});I(E.greaterThan(r.liquidity,vx),"ZERO_LIQUIDITY");const{amount0:a,amount1:s}=r.burnAmountsWithSlippage(t.slippageTolerance);t.permit&&n.push(dg.INTERFACE.encodeFunctionData("permit",[rx(t.permit.spender),o,Fx(t.permit.deadline),t.permit.v,t.permit.r,t.permit.s])),n.push(dg.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:o,liquidity:Fx(r.liquidity),amount0Min:Fx(a),amount1Min:Fx(s),deadline:i}]));const l=t.collectOptions,{expectedCurrencyOwed0:d,expectedCurrencyOwed1:c}=l,u=D(l,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return n.push(...dg.encodeCollect(Object.assign({tokenId:Fx(t.tokenId),expectedCurrencyOwed0:d.add(Jm.fromRawAmount(d.currency,a)),expectedCurrencyOwed1:c.add(Jm.fromRawAmount(c.currency,s))},u))),t.liquidityPercentage.equalTo(bx)?t.burnToken&&n.push(dg.INTERFACE.encodeFunctionData("burn",[o])):I(!0!==t.burnToken,"CANNOT_BURN"),{calldata:eg.encodeMulticall(n),value:Fx(0)}}static safeTransferFromParameters(e){const t=rx(e.recipient),n=rx(e.sender);let i;return i=e.data?dg.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[n,t,Fx(e.tokenId),e.data]):dg.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[n,t,Fx(e.tokenId)]),{calldata:i,value:Fx(0)}}static getPermitData(e,t,n){return{domain:{name:"Uniswap V3 Positions NFT-V1",chainId:n,version:"1",verifyingContract:t},types:lg,values:e}}}dg.INTERFACE=new Xh(tg);var cg=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactInputSingleParams",name:"params",type:"tuple"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160[]",name:"sqrtPriceX96AfterList",type:"uint160[]"},{internalType:"uint32[]",name:"initializedTicksCrossedList",type:"uint32[]"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct IQuoterV2.QuoteExactOutputSingleParams",name:"params",type:"tuple"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceX96After",type:"uint160"},{internalType:"uint32",name:"initializedTicksCrossed",type:"uint32"},{internalType:"uint256",name:"gasEstimate",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}];new Xh([{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountIn",type:"uint256"}],name:"quoteExactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"quoteExactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],name:"quoteExactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"path",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"view",type:"function"}]),new Xh(cg);new Xh([{inputs:[{internalType:"contract IUniswapV3Factory",name:"_factory",type:"address"},{internalType:"contract INonfungiblePositionManager",name:"_nonfungiblePositionManager",type:"address"},{internalType:"uint256",name:"_maxIncentiveStartLeadTime",type:"uint256"},{internalType:"uint256",name:"_maxIncentiveDuration",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"DepositTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{indexed:!0,internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{indexed:!1,internalType:"uint256",name:"startTime",type:"uint256"},{indexed:!1,internalType:"uint256",name:"endTime",type:"uint256"},{indexed:!1,internalType:"address",name:"refundee",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"IncentiveCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"refund",type:"uint256"}],name:"IncentiveEnded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"reward",type:"uint256"}],name:"RewardClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"},{indexed:!1,internalType:"uint128",name:"liquidity",type:"uint128"}],name:"TokenStaked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"TokenUnstaked",type:"event"},{inputs:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountRequested",type:"uint256"}],name:"claimReward",outputs:[{internalType:"uint256",name:"reward",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"reward",type:"uint256"}],name:"createIncentive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"deposits",outputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint48",name:"numberOfStakes",type:"uint48"},{internalType:"int24",name:"tickLower",type:"int24"},{internalType:"int24",name:"tickUpper",type:"int24"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"}],name:"endIncentive",outputs:[{internalType:"uint256",name:"refund",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"contract IUniswapV3Factory",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getRewardInfo",outputs:[{internalType:"uint256",name:"reward",type:"uint256"},{internalType:"uint160",name:"secondsInsideX128",type:"uint160"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"incentives",outputs:[{internalType:"uint256",name:"totalRewardUnclaimed",type:"uint256"},{internalType:"uint160",name:"totalSecondsClaimedX128",type:"uint160"},{internalType:"uint96",name:"numberOfStakes",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveDuration",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxIncentiveStartLeadTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"nonfungiblePositionManager",outputs:[{internalType:"contract INonfungiblePositionManager",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Minimal",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"rewards",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"stakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes32",name:"incentiveId",type:"bytes32"}],name:"stakes",outputs:[{internalType:"uint160",name:"secondsPerLiquidityInsideInitialX128",type:"uint160"},{internalType:"uint128",name:"liquidity",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"}],name:"transferDeposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"contract IERC20Minimal",name:"rewardToken",type:"address"},{internalType:"contract IUniswapV3Pool",name:"pool",type:"address"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"address",name:"refundee",type:"address"}],internalType:"struct IUniswapV3Staker.IncentiveKey",name:"key",type:"tuple"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"unstakeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"withdrawToken",outputs:[],stateMutability:"nonpayable",type:"function"}]);function ug({removed:e,inRange:n}){const i=t.useTheme(),r={py:4,px:8,color:i.palette.success.main,borderRadius:4,backgroundColor:t.alpha(i.palette.success.main,.1),typography:"h6"};return e?z.jsx(t.Tooltip,{title:o.i18n._({id:"MZPP7t",message:"Your position has 0 liquidity, and is not earning fees."}),maxWidth:240,children:z.jsx(t.Box,{sx:Object.assign(Object.assign({},r),{color:i.palette.warning.main,backgroundColor:t.alpha(i.palette.warning.main,.1)}),children:o.i18n._({id:"D87pha",message:"Closed"})})}):n?z.jsx(t.Tooltip,{title:o.i18n._({id:"aIvv/z",message:"The price of this pool is within your selected range. Your position is currently earning fees."}),maxWidth:240,children:z.jsx(t.Box,{sx:r,children:o.i18n._({id:"vOyUlD",message:"In range"})})}):z.jsx(t.Tooltip,{title:o.i18n._({id:"IwiTcw",message:"The price of this pool is outside of your selected range. Your position is not currently earning fees."}),maxWidth:240,children:z.jsx(t.Box,{sx:Object.assign(Object.assign({},r),{color:i.palette.error.main,backgroundColor:t.alpha(i.palette.error.main,.1)}),children:o.i18n._({id:"i3Z+/Z",message:"Out of range"})})})}new Xh([{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_WETH9",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"WETH9",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"}],internalType:"struct ISwapRouter.ExactInputParams",name:"params",type:"tuple"}],name:"exactInput",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOutMinimum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactInputSingleParams",name:"params",type:"tuple"}],name:"exactInputSingle",outputs:[{internalType:"uint256",name:"amountOut",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"path",type:"bytes"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"}],internalType:"struct ISwapRouter.ExactOutputParams",name:"params",type:"tuple"}],name:"exactOutput",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"tokenIn",type:"address"},{internalType:"address",name:"tokenOut",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"amountInMaximum",type:"uint256"},{internalType:"uint160",name:"sqrtPriceLimitX96",type:"uint160"}],internalType:"struct ISwapRouter.ExactOutputSingleParams",name:"params",type:"tuple"}],name:"exactOutputSingle",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"refundETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowed",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"uint256",name:"expiry",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitAllowedIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"selfPermitIfNecessary",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"sweepToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"sweepTokenWithFee",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"int256",name:"amount0Delta",type:"int256"},{internalType:"int256",name:"amount1Delta",type:"int256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"uniswapV3SwapCallback",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"}],name:"unwrapWETH9",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amountMinimum",type:"uint256"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"feeBips",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"}],name:"unwrapWETH9WithFee",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}]);const pg=({token:e,amount:n})=>{var i;const o=t.useTheme();return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(sl,{address:null!==(i=null==e?void 0:e.address)&&void 0!==i?i:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:18,height:18,marginRight:0}),z.jsxs(t.Box,{sx:{typography:"body1",color:o.palette.text.primary},children:[ir({input:n.toSignificant(),decimals:null==e?void 0:e.decimals})," ",null==e?void 0:e.symbol]}),z.jsx(t.ButtonBase,{sx:{display:"flex",alignItems:"center",color:o.palette.text.secondary,"&:hover":{color:o.palette.text.primary}},onClick:()=>{window.open(Ia(e.chainId,null==e?void 0:e.address,"address"))},children:z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:z.jsx("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M3.33333 3.33333V12.6667H12.6667V8H14V12.6667C14 13.4 13.4 14 12.6667 14H3.33333C2.59333 14 2 13.4 2 12.6667V3.33333C2 2.6 2.59333 2 3.33333 2H8V3.33333H3.33333ZM9.33333 3.33333V2H14V6.66667H12.6667V4.27333L6.11333 10.8267L5.17333 9.88667L11.7267 3.33333H9.33333Z",fill:"currentColor"})})})]})},hg=({position:i,inRange:r})=>{var a;const s=t.useTheme(),l=i.pool.token0,d=i.pool.token1,c=i.pool.chainId,u=(null==i?void 0:i.liquidity)&&E.equal(null==i?void 0:i.liquidity,E.BigInt(0)),p=n.useMemo((()=>Xx.getAddress(i.pool.token0,i.pool.token1,i.pool.fee,void 0,c?Zm[c]:void 0)),[c,i.pool.fee,i.pool.token0,i.pool.token1]);return z.jsxs(t.Box,{sx:{border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:s.spacing(12,20),borderBottomStyle:"solid",borderBottomColor:"border.main",borderBottomWidth:1},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[z.jsxs(t.Box,{sx:{typography:"body2",color:s.palette.text.primary},children:[o.i18n._({id:"PVa3KL",message:"Position on"})," ",null==l?void 0:l.symbol,"/",null==d?void 0:d.symbol]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(ug,{removed:u,inRange:r}),z.jsx(t.Box,{sx:{py:4,px:8,color:s.palette.text.secondary,borderRadius:4,backgroundColor:s.palette.background.tag,typography:"h6"},children:gr({input:(null===(a=null==i?void 0:i.pool)||void 0===a?void 0:a.fee)/1e6})})]})]}),z.jsxs(t.ButtonBase,{sx:{display:"flex",alignItems:"center",gap:0,typography:"body2",color:s.palette.text.secondary,"&:hover":{color:s.palette.text.primary}},onClick:()=>{window.open(Ia(c,p,"address"))},children:[o.i18n._({id:"URmyfc",message:"Details"}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:z.jsx("path",{d:"M7.5 5L6.4425 6.0575L9.8775 9.5L6.4425 12.9425L7.5 14L12 9.5L7.5 5Z",fill:"currentColor"})})]})]}),z.jsxs(t.Box,{sx:{p:s.spacing(12,20)},children:[z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"YHc3B+",message:"My Liquidity"})}),z.jsxs(t.Box,{sx:{mt:12},children:[z.jsx(pg,{token:l,amount:i.amount0}),z.jsx(pg,{token:d,amount:i.amount1})]})]})]})};function mg({price:e,atLimit:t,direction:n}){return t[n]?n===Em.LOWER?"0":"∞":"string"==typeof e&&"∞"===e?"∞":ir({input:"string"==typeof e?e:null==e?void 0:e.toSignificant()})}const xg=({baseToken:e,quoteToken:n,handleRateToggle:i,sx:o})=>{const r=t.useTheme(),a=null==e?void 0:e.wrapped,s=null==n?void 0:n.wrapped,l=a&&s&&a.sortsBefore(s);return z.jsx(t.Box,{component:t.ButtonBase,onClick:i,sx:Object.assign({display:"flex",alignItems:"center",p:1,borderRadius:8,backgroundColor:r.palette.border.main},o),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",width:"100%",[r.breakpoints.up("tablet")]:{width:"auto"}},children:[z.jsx(t.Box,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},l?{color:r.palette.text.primary,backgroundColor:r.palette.background.paper}:{color:r.palette.text.secondary,backgroundColor:"transparent"}),children:l?e.symbol:null==n?void 0:n.symbol}),z.jsx(t.Box,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},l?{color:r.palette.text.secondary,backgroundColor:"transparent"}:{color:r.palette.text.primary,backgroundColor:r.palette.background.paper}),children:l?n.symbol:null==e?void 0:e.symbol})]})})},gg=({position:i,title:o,baseCurrencyDefault:r,ticksAtLimit:a})=>{const s=i.pool.token0,l=i.pool.token1,d=t.useTheme(),[c,u]=n.useState(r?r===s?s:r===l?l:s:s),p=c===s,h=p?l:s,m=p?i.pool.priceOf(i.pool.token0):i.pool.priceOf(i.pool.token1),x=p?i.token0PriceLower:i.token0PriceUpper.invert(),g=p?i.token0PriceUpper:i.token0PriceLower.invert(),f=n.useCallback((()=>{u(h)}),[h]);return z.jsxs(Om,{gap:"md",children:[z.jsxs(_m,{children:[o?z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:d.palette.text.secondary},children:o}):z.jsx("div",{}),z.jsx(xg,{baseToken:p?s:l,quoteToken:p?l:s,handleRateToggle:f})]}),z.jsxs(_m,{children:[z.jsxs(Lm,{sx:{width:"48%",py:12,gap:12},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:4},children:[z.jsx(t.Box,{sx:{color:d.palette.text.primary,typography:"body2"},children:z.jsx(e.Trans,{id:"EQs1sJ",message:"Min price"})}),z.jsx(t.Box,{sx:{color:d.palette.text.secondary,typography:"h6"},children:z.jsx(e.Trans,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),z.jsx(t.Box,{sx:{color:d.palette.text.primary,typography:"caption"},children:mg({price:x,atLimit:a,direction:Em.LOWER})}),z.jsx(t.Box,{sx:{color:d.palette.text.secondary,typography:"h6"},children:z.jsx(e.Trans,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==c?void 0:c.symbol}})})]}),z.jsxs(Lm,{sx:{width:"48%",py:12,gap:12},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:4},children:[z.jsx(t.Box,{sx:{color:d.palette.text.primary,typography:"body2"},children:z.jsx(e.Trans,{id:"5etEUX",message:"Max price"})}),z.jsx(t.Box,{sx:{color:d.palette.text.secondary,typography:"h6"},children:z.jsx(e.Trans,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),z.jsx(t.Box,{sx:{color:d.palette.text.primary,typography:"caption"},children:mg({price:g,atLimit:a,direction:Em.UPPER})}),z.jsx(t.Box,{sx:{color:d.palette.text.secondary,typography:"h6"},children:z.jsx(e.Trans,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==h?void 0:h.symbol}})})]})]}),z.jsxs(Lm,{sx:{py:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(Om,{gap:"4px",justify:"flex-start",children:[z.jsx(t.Box,{sx:{color:d.palette.text.primary,typography:"body2"},children:z.jsx(e.Trans,{id:"DWd30U",message:"Current price"})}),z.jsx(t.Box,{sx:{color:d.palette.text.secondary,typography:"h6"},children:z.jsx(e.Trans,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),z.jsx(t.Box,{sx:{color:d.palette.text.primary,typography:"caption"},children:`${ir({input:m.toSignificant()})} `})]})]})},fg=({chainId:e,disabled:n,removed:i,isLoading:r,error:a,onConfirm:s})=>z.jsx(Im,{includeButton:!0,fullWidth:!0,chainId:e,children:z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.big,onClick:s,disabled:n,isLoading:r,children:i?o.i18n._({id:"D87pha",message:"Closed"}):null!=a?a:o.i18n._({id:"t/YqKh",message:"Remove"})})}),yg={[gx.LOWEST]:{label:"0.01%"},[gx.LOW_200]:{label:"0.02%"},[gx.LOW_300]:{label:"0.03%"},[gx.LOW_400]:{label:"0.04%"},[gx.LOW]:{label:"0.05%"},[gx.MEDIUM]:{label:"0.30%"},[gx.HIGH]:{label:"1.00%"}},vg=({poolType:e})=>{const n="AMM V2"===e?t.lightPalette.error.main:"AMM V3"===e?t.lightPalette.purple.main:t.lightPalette.success.main;return z.jsx(t.Box,{sx:{px:8,height:24,typography:"h6",lineHeight:"24px",borderRadius:4,background:t.alpha(n,.1),color:n,whiteSpace:"nowrap"},children:e})},bg=({isAMMV2:n,isAMMV3:i,lpFeeRate:o,mtFeeRate:r})=>{var a,l;return z.jsx(t.Tooltip,{title:z.jsx(e.Trans,{id:"O6RUgz",message:"Fee rate"}),children:z.jsx(t.Box,{sx:{px:8,height:24,typography:"h6",lineHeight:"24px",borderRadius:4,backgroundColor:"background.tag",color:"text.secondary",whiteSpace:"nowrap"},children:i?null!==(l=null===(a=yg[o])||void 0===a?void 0:a.label)&&void 0!==l?l:"-":gr({input:new s(null!=o?o:0).plus(r?lr(r,n?4:18):0)})})})},Cg=({sx:e})=>z.jsx(vg,{poolType:"AMM V3"}),jg=({position:n,title:i,inRange:o,baseCurrencyDefault:r,ticksAtLimit:a})=>{var s,l,d;const c=n.pool.token0,u=n.pool.token1,p=(null==n?void 0:n.liquidity)&&E.equal(null==n?void 0:n.liquidity,E.BigInt(0));return z.jsxs(Om,{gap:"md",style:{marginTop:"0.5rem"},children:[z.jsxs(_m,{style:{gap:4},children:[z.jsxs(Dm,{children:[z.jsx(Pp,{tokens:[{address:c.address},{address:u.address}],mr:8}),z.jsxs(t.Box,{sx:{typography:"h5"},children:[null==c?void 0:c.symbol," / ",null==u?void 0:u.symbol]})]}),z.jsx(Cg,{sx:{ml:"auto"}}),z.jsx(ug,{removed:p,inRange:o})]}),z.jsxs(Lm,{children:[z.jsxs(Om,{gap:"md",children:[z.jsxs(_m,{children:[z.jsxs(Dm,{children:[z.jsx(sl,{address:null!==(s=null==c?void 0:c.address)&&void 0!==s?s:"",chainId:null==c?void 0:c.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),z.jsx(t.Box,{sx:{ml:8},children:null==c?void 0:c.symbol})]}),z.jsx(Dm,{children:z.jsx(t.Box,{sx:{mr:8},children:ir({input:n.amount0.toSignificant(),decimals:null==c?void 0:c.decimals})})})]}),z.jsxs(_m,{children:[z.jsxs(Dm,{children:[z.jsx(sl,{address:null!==(l=null==u?void 0:u.address)&&void 0!==l?l:"",chainId:null==u?void 0:u.chainId,noShowChain:!0,width:32,height:32,marginRight:0}),z.jsx(t.Box,{ml:"8px",children:null==u?void 0:u.symbol})]}),z.jsx(Dm,{children:z.jsx(t.Box,{mr:"8px",children:ir({input:n.amount1.toSignificant(),decimals:null==u?void 0:u.decimals})})})]})]}),z.jsxs(_m,{children:[z.jsx(t.Box,{children:z.jsx(e.Trans,{id:"EU3wU4",message:"Fee tier"})}),z.jsx(t.Box,{children:gr({input:(null===(d=null==n?void 0:n.pool)||void 0===d?void 0:d.fee)/1e6})})]})]}),z.jsx(gg,{position:n,title:i,baseCurrencyDefault:r,ticksAtLimit:a})]})},wg=({on:e,onClose:n,position:i,outOfRange:r,ticksAtLimit:a,onConfirm:s,loading:l})=>{const{isMobile:d}=Xa();return z.jsx(el,{open:e,onClose:n,modal:!0,title:o.i18n._({id:"E6MqGy",message:"Add liquidity"}),height:683,children:z.jsxs(t.Box,{sx:{flex:1,px:20,pb:24,display:"flex",flexDirection:"column",justifyContent:"space-between",width:d?void 0:420},children:[z.jsx(t.Box,{sx:{pt:0,px:0},children:i?z.jsx(jg,{position:i,inRange:!r,ticksAtLimit:a,title:o.i18n._({id:"3VUfrF",message:"Selected Range"})}):null}),z.jsx(t.Button,{size:t.Button.Size.big,fullWidth:!0,isLoading:l,sx:{mt:20},onClick:s,children:o.i18n._({id:"m16xKo",message:"Add"})})]})})};class kg{static getPoolAddress(e,t,n,i,o){this.addresses.length>this.MAX_ENTRIES&&(this.addresses=this.addresses.slice(0,this.MAX_ENTRIES/2));const{address:r}=t,{address:a}=n,s=`${e}:${r}:${a}:${i.toString()}`,l=this.addresses.find((e=>e.key===s));if(l)return l.address;const d={key:s,address:wx({factoryAddress:e,tokenA:t,tokenB:n,fee:i,chainId:o})};return this.addresses.unshift(d),d.address}static getPool(e,t,n,i,o,r){this.pools.length>this.MAX_ENTRIES&&(this.pools=this.pools.slice(0,this.MAX_ENTRIES/2));const a=this.pools.find((a=>a.token0===e&&a.token1===t&&a.fee===n&&E.EQ(a.sqrtRatioX96,i)&&E.EQ(a.liquidity,o)&&a.tickCurrent===r));if(a)return a;const s=new Xx(e,t,n,i,o,r);return this.pools.unshift(s),s}}var Tg;function Bg(e,t,i){const o=n.useMemo((()=>[[e,t,i]]),[e,t,i]);return function(e,t){const i=n.useMemo((()=>e?t.map((([e,t,n])=>{if(e&&t&&n){const i=e.wrapped,o=t.wrapped;if(i.equals(o))return;return i.sortsBefore(o)?[i,o,n]:[o,i,n]}})):new Array(t.length)),[e,t]),o=n.useMemo((()=>{const t=e&&Zm[e];return t?i.map((n=>n&&kg.getPoolAddress(t,...n,e))):new Array(i.length)}),[e,i]),{data:r}=c.useQueries({queries:o.map((t=>va.getV3PoolSlot0(e,t))),combine:e=>({data:e.map((e=>e.data))})}),{data:a}=c.useQueries({queries:o.map((t=>va.getV3PoolLiquidity(e,t))),combine:e=>({data:e.map((e=>e.data))})});return n.useMemo((()=>t.map(((e,t)=>{const n=i[t];if(!n)return[Tg.INVALID,null];const[o,s,l]=n;if(!r[t])return[Tg.NOT_EXISTS,null];const d=r[t];if(!a[t])return[Tg.NOT_EXISTS,null];const c=a[t];if(!d||!c)return[Tg.NOT_EXISTS,null];if(!d.sqrtPriceX96||d.sqrtPriceX96.eq(0))return[Tg.NOT_EXISTS,null];try{const e=kg.getPool(o,s,l,d.sqrtPriceX96,c[0],d.tick);return[Tg.EXISTS,e]}catch(e){return console.error(e,{tags:{file:"usePools",function:"usePools"},extra:{token0:o.address,token1:s.address,chainId:o.chainId,fee:l}}),[Tg.NOT_EXISTS,null]}}))),[a,t,r,i])}(null==e?void 0:e.chainId,o)[0]}kg.MAX_ENTRIES=128,kg.pools=[],kg.addresses=[],function(e){e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID"}(Tg||(Tg={}));class Eg{constructor(e){const t=r.basicTokenMap[e];this.chainId=e,this.decimals=t.decimals,this.name=t.name,this.symbol=t.symbol,this.isNative=!0,this.isToken=!1,this.address=Ig(this.chainId)}equals(e){return e.isNative&&e.chainId===this.chainId}get wrapped(){const e=r.basicTokenMap[this.chainId];return new sx(this.chainId,e.wrappedTokenAddress,e.decimals,e.wrappedTokenSymbol,e.name)}static onChain(e){var t;return null!==(t=this._cachedNativeCurrency[e])&&void 0!==t?t:this._cachedNativeCurrency[e]=new Eg(e)}}function Ig(e){return r.basicTokenMap[e].address}function Ag(e,t){const n=null==e?void 0:e.toLowerCase(),i=null==t?void 0:t.toLowerCase();return null!==n&&null!==i&&n===i}Eg._cachedNativeCurrency={};const Sg=(e,t)=>!t||Ag(t,Ig(e));function Lg(e){if(!e)return;const{name:t,chainId:n,address:i,decimals:o,symbol:r}=e;return function(e,t){return!Sg(e,t)}(n,i)?new sx(n,i,o,null!=r?r:void 0,null!=t?t:void 0):new Eg(n)}function Mg(e){var t,n;if(e)return{chainId:e.chainId,address:e.address,decimals:e.decimals,symbol:null!==(t=e.symbol)&&void 0!==t?t:"",name:null!==(n=e.name)&&void 0!==n?n:""}}function Rg(e,t,n){if(e&&t&&"number"==typeof n)return zx(e,t,n)}function Og(e,t){if(e&&t&&!isNaN(parseFloat(e)))try{const n=A.parseUnits(function(e,t){const n=e.split(/[.,]/),i=e.includes(".")?".":",";return n.length>1&&n[1].length>t?n[0]+i+n[1].slice(0,t):e}(e,t.decimals),t.decimals).toString();if("0"!==n)return Jm.fromRawAmount(t,E.BigInt(n))}catch(t){console.error("tryParseCurrencyAmount","tryParseCurrencyAmount",`Failed to parse input amount: "${e}"`,t)}}function Pg(e,t,n,i){if(!(e&&t&&n&&i))return;const o=function(e,t,n){var i;if(!e||!t||!n)return;if(!n.match(/^\d*\.?\d+$/))return;const[o,r]=n.split("."),a=null!==(i=null==r?void 0:r.length)&&void 0!==i?i:0,s=E.BigInt((null!=o?o:"")+(null!=r?r:""));return new ix(e,t,E.multiply(E.BigInt(10**a),E.BigInt(10**e.decimals)),E.multiply(s,E.BigInt(10**t.decimals)))}(e,t,i);if(!o)return;let r;const a=Ux(o.numerator,o.denominator);return r=E.greaterThanOrEqual(a,Ix.MAX_SQRT_RATIO)?Ix.MAX_TICK:E.lessThanOrEqual(a,Ix.MIN_SQRT_RATIO)?Ix.MIN_TICK:$x(o),Zx(r,fx[n])}function _g({state:e,existingPosition:t}){var i,r,a,s,l,d,u,p,h,m,x,g,f;const{account:y,chainId:v}=Pa(),{feeAmount:b,independentField:C,typedValue:j,leftRangeTypedValue:w,rightRangeTypedValue:k,startPriceTypedValue:T}=e,B=null!==(i=e.baseToken)&&void 0!==i?i:void 0,I=null!==(r=e.baseToken)&&void 0!==r?r:void 0,A=null!==(a=e.quoteToken)&&void 0!==a?a:void 0,S=C===Bm.CURRENCY_A?Bm.CURRENCY_B:Bm.CURRENCY_A,L=n.useMemo((()=>({[Bm.CURRENCY_A]:B,[Bm.CURRENCY_B]:A})),[B,A]),[M,R,O]=n.useMemo((()=>[null==B?void 0:B.wrapped,null==A?void 0:A.wrapped,null==I?void 0:I.wrapped]),[B,A,I]),[P,_]=n.useMemo((()=>M&&R?M.sortsBefore(R)?[M,R]:[R,M]:[void 0,void 0]),[M,R]),D=c.useQuery(Hi.getFetchTokenQuery(null===(s=L[Bm.CURRENCY_A])||void 0===s?void 0:s.chainId,null===(l=L[Bm.CURRENCY_A])||void 0===l?void 0:l.address,y)),N=c.useQuery(Hi.getFetchTokenQuery(null===(d=L[Bm.CURRENCY_B])||void 0===d?void 0:d.chainId,null===(u=L[Bm.CURRENCY_B])||void 0===u?void 0:u.address,y)),F=n.useMemo((()=>{var e,t,n,i,o,r;return{[Bm.CURRENCY_A]:L[Bm.CURRENCY_A]?(null===(e=D.data)||void 0===e?void 0:e.balance)?Jm.fromRawAmount(L[Bm.CURRENCY_A],E.BigInt(null===(t=D.data)||void 0===t?void 0:t.balance.multipliedBy(Math.pow(10,null!==(n=L[Bm.CURRENCY_A].decimals)&&void 0!==n?n:18)).toString())):Jm.fromRawAmount(L[Bm.CURRENCY_A],0):void 0,[Bm.CURRENCY_B]:L[Bm.CURRENCY_B]?(null===(i=N.data)||void 0===i?void 0:i.balance)?Jm.fromRawAmount(L[Bm.CURRENCY_B],E.BigInt(null===(o=N.data)||void 0===o?void 0:o.balance.multipliedBy(Math.pow(10,null!==(r=L[Bm.CURRENCY_B].decimals)&&void 0!==r?r:18)).toString())):Jm.fromRawAmount(L[Bm.CURRENCY_B],0):void 0}}),[L,null===(p=D.data)||void 0===p?void 0:p.balance,null===(h=N.data)||void 0===h?void 0:h.balance]),[U,q]=Bg(L[Bm.CURRENCY_A],L[Bm.CURRENCY_B],b),V=U===Tg.NOT_EXISTS,W=Boolean(O&&P&&!O.equals(P)),H=n.useMemo((()=>{var e;if(!V)return q&&P?q.priceOf(P):void 0;{const t=Og(T,W?P:_);if(t&&P&&_){const n=Og("1",W?_:P),i=n&&t?new ix(n.currency,t.currency,n.quotient,t.quotient):void 0;return null!==(e=W?null==i?void 0:i.invert():i)&&void 0!==e?e:void 0}}}),[V,T,W,_,P,q]),Z=n.useMemo((()=>{const e=H?Ux(H.numerator,H.denominator):void 0;return H&&e&&!(E.greaterThanOrEqual(e,Ix.MIN_SQRT_RATIO)&&E.lessThan(e,Ix.MAX_SQRT_RATIO))}),[H]),z=n.useMemo((()=>{if(M&&R&&b&&H&&!Z){const e=$x(H),t=Ix.getSqrtRatioAtTick(e);return new Xx(M,R,b,t,E.BigInt(0),e,[])}}),[b,Z,H,M,R]),$=null!=q?q:z,G=n.useMemo((()=>({[Em.LOWER]:b?Zx(Ix.MIN_TICK,fx[b]):void 0,[Em.UPPER]:b?Zx(Ix.MAX_TICK,fx[b]):void 0})),[b]),Q=n.useMemo((()=>({[Em.LOWER]:"number"==typeof(null==t?void 0:t.tickLower)?t.tickLower:W&&"boolean"==typeof k||!W&&"boolean"==typeof w?G[Em.LOWER]:W?Pg(_,P,b,k.toString()):Pg(P,_,b,w.toString()),[Em.UPPER]:"number"==typeof(null==t?void 0:t.tickUpper)?t.tickUpper:!W&&"boolean"==typeof k||W&&"boolean"==typeof w?G[Em.UPPER]:W?Pg(_,P,b,w.toString()):Pg(P,_,b,k.toString())})),[t,b,W,w,k,G,P,_]),{[Em.LOWER]:Y,[Em.UPPER]:X}=Q||{},K=n.useMemo((()=>({[Em.LOWER]:b&&Y===G.LOWER,[Em.UPPER]:b&&X===G.UPPER})),[G,Y,X,b]),J=Boolean("number"==typeof Y&&"number"==typeof X&&Y>=X),ee=n.useMemo((()=>({[Em.LOWER]:Rg(P,_,G.LOWER),[Em.UPPER]:Rg(P,_,G.UPPER)})),[P,_,G.LOWER,G.UPPER]),te=n.useMemo((()=>({[Em.LOWER]:Rg(P,_,Q[Em.LOWER]),[Em.UPPER]:Rg(P,_,Q[Em.UPPER])})),[P,_,Q]),{[Em.LOWER]:ne,[Em.UPPER]:ie}=te,oe=Boolean(!J&&H&&ne&&ie&&(H.lessThan(ne)||H.greaterThan(ie))),re=Og(j,L[C]),ae=n.useMemo((()=>{const e=null==re?void 0:re.wrapped,t=S===Bm.CURRENCY_B?A:B;if(re&&e&&"number"==typeof Y&&"number"==typeof X&&$){if(oe||J)return;const n=e.currency.equals($.token0)?Kx.fromAmount0({pool:$,tickLower:Y,tickUpper:X,amount0:re.quotient,useFullPrecision:!0}):Kx.fromAmount1({pool:$,tickLower:Y,tickUpper:X,amount1:re.quotient}),i=e.currency.equals($.token0)?n.amount1:n.amount0;return t&&Jm.fromRawAmount(t,i.quotient)}}),[re,oe,S,A,B,Y,X,$,J]),se=n.useMemo((()=>({[Bm.CURRENCY_A]:C===Bm.CURRENCY_A?re:ae,[Bm.CURRENCY_B]:C===Bm.CURRENCY_A?ae:re})),[ae,re,C]),le=Boolean("number"==typeof X&&$&&$.tickCurrent>=X),de=Boolean("number"==typeof Y&&$&&$.tickCurrent<=Y),ce=J||Boolean(le&&$&&M&&$.token0.equals(M)||de&&$&&M&&$.token1.equals(M)),ue=J||Boolean(le&&$&&R&&$.token0.equals(R)||de&&$&&R&&$.token1.equals(R)),{inputTax:pe,outputTax:he}=function(e,t,i){const[{inputTax:o,outputTax:r},a]=n.useState({inputTax:mx,outputTax:mx});return{inputTax:o,outputTax:r}}((null==B?void 0:B.isToken)&&B.address,(null==A?void 0:A.isToken)&&A.address),me=n.useMemo((()=>{var e,t;if(!$||!M||!R||"number"!=typeof Y||"number"!=typeof X||J)return;const n=le?px:null===(e=null==se?void 0:se[M.equals($.token0)?Bm.CURRENCY_A:Bm.CURRENCY_B])||void 0===e?void 0:e.quotient,i=de?px:null===(t=null==se?void 0:se[M.equals($.token0)?Bm.CURRENCY_B:Bm.CURRENCY_A])||void 0===t?void 0:t.quotient;return void 0!==n&&void 0!==i?Kx.fromAmounts({pool:$,tickLower:Y,tickUpper:X,amount0:n,amount1:i,useFullPrecision:!0}):void 0}),[se,$,M,R,le,de,J,Y,X]);let xe;y||(xe=o.i18n._({id:"r7ScnQ",message:"Connect to a wallet"})),U===Tg.INVALID&&(xe=null!=xe?xe:o.i18n._({id:"R7D79P",message:"Invalid pair"})),Z&&(xe=null!=xe?xe:o.i18n._({id:"HXBqgG",message:"Invalid price input"})),(se[Bm.CURRENCY_A]||ce)&&(se[Bm.CURRENCY_B]||ue)||(xe=null!=xe?xe:o.i18n._({id:"iPMIoT",message:"Enter an amount"}));const{[Bm.CURRENCY_A]:ge,[Bm.CURRENCY_B]:fe}=se;ge&&(null===(m=null==F?void 0:F[Bm.CURRENCY_A])||void 0===m?void 0:m.lessThan(ge))&&(xe=o.i18n._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(x=L[Bm.CURRENCY_A])||void 0===x?void 0:x.symbol}})),fe&&(null===(g=null==F?void 0:F[Bm.CURRENCY_B])||void 0===g?void 0:g.lessThan(fe))&&(xe=o.i18n._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(f=L[Bm.CURRENCY_B])||void 0===f?void 0:f.symbol}}));const ye=pe.greaterThan(0)||he.greaterThan(0),ve=U===Tg.INVALID||ye;return{dependentField:S,currencies:L,pool:q,poolState:U,currencyBalances:F,parsedAmounts:se,ticks:Q,price:H,pricesAtTicks:te,pricesAtLimit:ee,position:me,noLiquidity:V,errorMessage:xe,invalidPool:ve,invalidRange:J,outOfRange:oe,depositADisabled:ce,depositBDisabled:ue,invertPrice:W,ticksAtLimit:K,isTaxed:ye}}var Dg;function Ng(e,t){switch(t.type){case Dg.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:Lg(n)})}case Dg.UpdateDefaultBaseToken:{const n=t.payload;return e.baseToken?e:Object.assign(Object.assign({},e),{baseToken:Lg(n)})}case Dg.UpdateQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{quoteToken:Lg(n)})}case Dg.UpdateDefaultQuoteToken:{const n=t.payload;return e.quoteToken?e:Object.assign(Object.assign({},e),{quoteToken:Lg(n)})}case Dg.UpdateBaseTokenAndClearQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:Lg(n),quoteToken:null})}case Dg.UpdateFeeAmount:return Object.assign(Object.assign({},e),{feeAmount:t.payload});case Dg.ToggleRate:{const{baseToken:t,quoteToken:n}=e;return Object.assign(Object.assign({},e),{baseToken:n,quoteToken:t})}case Dg.setFullRange:return Object.assign(Object.assign({},e),{leftRangeTypedValue:!0,rightRangeTypedValue:!0});case Dg.typeStartPriceInput:return Object.assign(Object.assign({},e),{startPriceTypedValue:t.payload.typedValue});case Dg.typeLeftRangeInput:return Object.assign(Object.assign({},e),{leftRangeTypedValue:t.payload.typedValue});case Dg.typeRightRangeInput:return Object.assign(Object.assign({},e),{rightRangeTypedValue:t.payload.typedValue});case Dg.typeInput:{const{payload:{field:n,typedValue:i,noLiquidity:o}}=t;return o?(e.independentField,Object.assign(Object.assign({},e),{independentField:n,typedValue:i})):Object.assign(Object.assign({},e),{independentField:n,typedValue:i})}default:throw Error("Unknown action: "+t.type)}}function Fg({noLiquidity:e,dispatch:t}){return{onFieldAInput:n.useCallback((n=>{t({type:Dg.typeInput,payload:{field:Bm.CURRENCY_A,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onFieldBInput:n.useCallback((n=>{t({type:Dg.typeInput,payload:{field:Bm.CURRENCY_B,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onLeftRangeInput:n.useCallback((e=>{t({type:Dg.typeLeftRangeInput,payload:{typedValue:e}})}),[t]),onRightRangeInput:n.useCallback((e=>{t({type:Dg.typeRightRangeInput,payload:{typedValue:e}})}),[t]),onStartPriceInput:n.useCallback((e=>{t({type:Dg.typeStartPriceInput,payload:{typedValue:e}})}),[t])}}function Ug(e){return e?zm[e]:void 0}function qg(e,t){const i=Ug(t),o=n.useMemo((()=>e?e.map((e=>[e])):[]),[e]),r=c.useQuery(va.getPositions(t,i,o)),a=r.isLoading,s=r.error,l=n.useMemo((()=>{var t;if(!a&&!s&&e)return null===(t=r.data)||void 0===t?void 0:t.map(((t,n)=>({tokenId:e[n],fee:t.fee,feeGrowthInside0LastX128:t.feeGrowthInside0LastX128.toString(),feeGrowthInside1LastX128:t.feeGrowthInside1LastX128.toString(),liquidity:t.liquidity.toString(),nonce:t.nonce.toString(),operator:t.operator,tickLower:t.tickLower,tickUpper:t.tickUpper,token0:t.token0,token1:t.token1,tokensOwed0:t.tokensOwed0.toString(),tokensOwed1:t.tokensOwed1.toString()})))}),[a,s,r,e]);return{loading:a,positions:null==l?void 0:l.map(((e,t)=>Object.assign(Object.assign({},e),{tokenId:o[t][0]})))}}!function(e){e[e.UpdateBaseToken=0]="UpdateBaseToken",e[e.UpdateDefaultBaseToken=1]="UpdateDefaultBaseToken",e[e.UpdateQuoteToken=2]="UpdateQuoteToken",e[e.UpdateDefaultQuoteToken=3]="UpdateDefaultQuoteToken",e[e.UpdateBaseTokenAndClearQuoteToken=4]="UpdateBaseTokenAndClearQuoteToken",e[e.UpdateFeeAmount=5]="UpdateFeeAmount",e[e.ToggleRate=6]="ToggleRate",e[e.setFullRange=7]="setFullRange",e[e.typeStartPriceInput=8]="typeStartPriceInput",e[e.typeLeftRangeInput=9]="typeLeftRangeInput",e[e.typeRightRangeInput=10]="typeRightRangeInput",e[e.typeInput=11]="typeInput"}(Dg||(Dg={}));const Vg=E.exponentiate(E.BigInt(10),E.BigInt(16));function Wg(e){if(e)return e.currency.isNative?E.greaterThan(e.quotient,Vg)?Jm.fromRawAmount(e.currency,E.subtract(e.quotient,Vg)):Jm.fromRawAmount(e.currency,E.BigInt(0)):e}const Hg=1e4,Zg=100*Hg;function zg(e){const t=Math.floor(Number(e)*Hg);return new nx(t,Zg)}const $g=({token:e,amount:n})=>{var i;const o=t.useTheme();return z.jsxs(t.Box,{sx:{py:8,display:"flex",alignItems:"center",gap:6,typography:"h5",color:o.palette.text.primary},children:[z.jsx(sl,{address:null!==(i=null==e?void 0:e.address)&&void 0!==i?i:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),z.jsx(t.Box,{children:null==e?void 0:e.symbol}),z.jsx(t.Box,{sx:{ml:"auto"},children:ir({input:null==n?void 0:n.toSignificant(),decimals:null==e?void 0:e.decimals})})]})},Gg=({chainId:e,baseToken:i,quoteToken:a,feeAmount:l,tokenId:d,onClose:u})=>{var p,h;const{isMobile:m}=Xa(),g=t.useTheme(),f=us(),y=c.useQueryClient(),{account:v}=Pa(),{position:b,loading:C}=function(e,t){var n;const i=qg(e?[e]:void 0,t);return{loading:i.loading,position:null===(n=i.positions)||void 0===n?void 0:n[0]}}(d,e),j=!!b&&!C,{position:w}=function(e,t,i){const o=n.useMemo((()=>t?Lg(t):void 0),[t]),r=n.useMemo((()=>i?Lg(i):void 0),[i]),[,a]=Bg(null!=o?o:void 0,null!=r?r:void 0,null==e?void 0:e.fee);let s;return a&&e&&(s=new Kx({pool:a,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})),{position:s,pool:null!=a?a:void 0}}(b,i,a),[k,T]=n.useState("stake"),[B,E]=n.useState(!1),[I,A]=n.useState(km),[S,L]=n.useReducer(Ng,{baseToken:Lg(i),quoteToken:Lg(a),feeAmount:l,independentField:Bm.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""}),{independentField:M,typedValue:R,startPriceTypedValue:O}=S,{pool:P,ticks:_,dependentField:D,price:F,pricesAtTicks:U,pricesAtLimit:q,parsedAmounts:V,currencyBalances:W,position:H,noLiquidity:Z,currencies:$,errorMessage:G,invalidPool:Y,invalidRange:X,outOfRange:K,depositADisabled:J,depositBDisabled:ee,invertPrice:te,ticksAtLimit:ne,isTaxed:ie}=_g({state:S,existingPosition:w}),{position:re,liquidityPercentage:ae,liquidityValue0:se,liquidityValue1:le,feeValue0:de,feeValue1:ce,error:ue}=function({percent:e,position:t,asWETH:i,baseToken:r,quoteToken:a}){const{account:s,chainId:l}=Pa(),[d,c]=n.useMemo((()=>[null==r?void 0:r.wrapped,null==a?void 0:a.wrapped]),[r,a]),[u,p]=n.useMemo((()=>d&&c?d.sortsBefore(c)?[d,c]:[c,d]:[void 0,void 0]),[d,c]),[,h]=Bg(null!=u?u:void 0,null!=p?p:void 0,null==t?void 0:t.fee),m=n.useMemo((()=>h&&(null==t?void 0:t.liquidity)&&"number"==typeof(null==t?void 0:t.tickLower)&&"number"==typeof(null==t?void 0:t.tickUpper)?new Kx({pool:h,liquidity:t.liquidity.toString(),tickLower:t.tickLower,tickUpper:t.tickUpper}):void 0),[h,t]),x=new nx(e,100),g=m?x.multiply(m.amount0.quotient).quotient:void 0,f=m?x.multiply(m.amount1.quotient).quotient:void 0,y=u&&g?Jm.fromRawAmount(u,g):void 0,v=p&&f?Jm.fromRawAmount(p,f):void 0,b=!(!h||!t)&&(h.tickCurrent<t.tickLower||h.tickCurrent>t.tickUpper);let C;return s||(C=o.i18n._({id:"r7ScnQ",message:"Connect to a wallet"})),0===e&&(C=null!=C?C:o.i18n._({id:"Sta9CR",message:"Enter a percent"})),{position:m,liquidityPercentage:x,liquidityValue0:y,liquidityValue1:v,feeValue0:void 0,feeValue1:void 0,outOfRange:b,error:C}}({position:b,asWETH:void 0,percent:I,baseToken:S.baseToken,quoteToken:S.quoteToken}),pe="0"===(null==b?void 0:b.liquidity),[he,me]=function({chainId:e,pool:t,tokenId:n,asWETH:i}){var o;const r=Ug(e),a=null===(o=x.BigNumber.from(n))||void 0===o?void 0:o.toHexString(),s=c.useQuery(va.getOwner(e,r,n)),l=c.useQuery(va.getCollect(e,r,a,s.data&&Array.isArray(s.data)?s.data[0]:void 0));return t&&l&&l.data&&l.data.amount0&&l.data.amount1?[Jm.fromRawAmount(t.token0,l.data.amount0.toString()),Jm.fromRawAmount(t.token1,l.data.amount1.toString())]:[void 0,void 0]}({pool:null!=P?P:void 0,tokenId:d,asWETH:!1,chainId:e}),xe=me,ge=he;n.useMemo((()=>{var e;return null===(e=te?null==F?void 0:F.invert():F)||void 0===e?void 0:e.toSignificant()}),[te,F]);const{onFieldAInput:fe,onFieldBInput:ye,onLeftRangeInput:ve,onRightRangeInput:be,onStartPriceInput:Ce}=Fg({noLiquidity:Z,dispatch:L}),{slipper:je,setSlipper:we,slipperValue:ke,resetSlipper:Te}=jm({address:void 0,type:"AMMV3"}),Be=!G&&!X,Ee=n.useMemo((()=>{var e,t;return{[M]:R,[D]:null!==(t=null===(e=V[D])||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""}}),[D,M,V,R]),Ie=n.useMemo((()=>[Bm.CURRENCY_A,Bm.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:Wg(W[t])})),{})),[W]),Ae=Ms(Mg(null===(p=V[Bm.CURRENCY_A])||void 0===p?void 0:p.currency),{contractAddress:zm[e],overrideBalance:W[Bm.CURRENCY_A]?new s(W[Bm.CURRENCY_A].toSignificant()):void 0,amount:V[Bm.CURRENCY_A]?new s(V[Bm.CURRENCY_A].toSignificant()):void 0}),Se=Ms(Mg(null===(h=V[Bm.CURRENCY_B])||void 0===h?void 0:h.currency),{contractAddress:zm[e],overrideBalance:W[Bm.CURRENCY_B]?new s(W[Bm.CURRENCY_B].toSignificant()):void 0,amount:V[Bm.CURRENCY_B]?new s(V[Bm.CURRENCY_B].toSignificant()):void 0}),{[Em.LOWER]:Le,[Em.UPPER]:Me}=_,{[Em.LOWER]:Re,[Em.UPPER]:Oe}=U,{deadLine:Pe}=Q(),_e=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(!v||!e||!H)return;if(!S.baseToken||!S.quoteToken)return;const t=Math.ceil(Date.now()/1e3)+(null!=Pe?Pe:600),n=S.baseToken.isNative?S.baseToken:S.quoteToken.isNative?S.quoteToken:void 0;try{const{calldata:i,value:a}=dg.addCallParameters(H,{tokenId:d,slippageTolerance:zg(100*ke),deadline:t.toString(),useNative:n});let s={to:zm[e],data:i,value:a};(yield f.execute(o.i18n._({id:"OBdohg",message:"Add Liquidity"}),Object.assign({opcode:rs.TX},s),{early:!1,metadata:{[exports.MetadataFlag.addAMMV3Pool]:"1"}}))===es.Success&&(E(!1),setTimeout((()=>{null==u||u()}),100)),y.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"ammv3"],refetchType:"all"})}catch(e){console.error("onAddMutation",e)}}))}),De=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(!(v&&e&&re&&ae&&se&&le))return;const t=Math.ceil(Date.now()/1e3)+(null!=Pe?Pe:600);try{const{calldata:n,value:i}=dg.removeCallParameters(re,{tokenId:d.toString(),liquidityPercentage:ae,slippageTolerance:zg(100*ke),deadline:t.toString(),collectOptions:{expectedCurrencyOwed0:null!=de?de:Jm.fromRawAmount(se.currency,0),expectedCurrencyOwed1:null!=ce?ce:Jm.fromRawAmount(le.currency,0),recipient:v}});let a={to:zm[e],data:n,value:i};(yield f.execute(o.i18n._({id:"3XBvkd",message:"Remove Liquidity"}),Object.assign({opcode:rs.TX},a),{early:!1,metadata:{[exports.MetadataFlag.removeAMMV3Pool]:"1"}}))===es.Success&&setTimeout((()=>{null==u||u()}),100),y.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"ammv3"],refetchType:"all"})}catch(e){console.error("onRemoveMutation",e)}}))}),Ne=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(v&&e&&P)try{const{calldata:t,value:n}=dg.collectCallParameters({tokenId:d.toString(),expectedCurrencyOwed0:null!=he?he:Jm.fromRawAmount(P.token0,0),expectedCurrencyOwed1:null!=me?me:Jm.fromRawAmount(P.token1,0),recipient:v});let i={to:zm[e],data:t,value:n};(yield f.execute(o.i18n._({id:"zXCpR0",message:"Claim Rewards"}),Object.assign({opcode:rs.TX},i),{early:!1,metadata:{[exports.MetadataFlag.claimAMMV3Pool]:"1"}}))===es.Success&&setTimeout((()=>{null==u||u()}),100),y.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"ammv3"],refetchType:"all"})}catch(e){console.error("onClaimMutation",e)}}))}),Fe=n.useMemo((()=>{var n,i,r,a;const s=[{key:"stake",value:o.i18n._({id:"m16xKo",message:"Add"})},{key:"unstake",value:o.i18n._({id:"t/YqKh",message:"Remove"})},{key:"claim",value:o.i18n._({id:"hom7qf",message:"Claim"})}];return z.jsxs(t.Box,{sx:{borderRadius:16,backgroundColor:g.palette.background.paper},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:24,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:g.palette.background.paper},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:g.palette.text.primary},children:o.i18n._({id:"E6MqGy",message:"Add liquidity"})}),u?z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:z.jsx(t.Box,{component:oe.Error,sx:{width:16,height:16},onClick:()=>{u()}})}):void 0]}),j&&w&&z.jsx(t.Box,{sx:{mx:20,mb:16},children:z.jsx(hg,{position:w,inRange:!K})}),z.jsxs(t.Tabs,{value:k,onChange:(e,t)=>{T(t)},children:[z.jsx(t.TabsButtonGroup,{tabs:s,variant:"inPaper",tabsListSx:{mx:20}}),z.jsxs(t.TabPanel,{value:"stake",children:[j&&w&&z.jsx(t.Box,{sx:{mt:16,mx:20},children:z.jsx(gg,{position:w,title:o.i18n._({id:"3VUfrF",message:"Selected Range"}),ticksAtLimit:ne})}),z.jsxs(t.Box,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:g.palette.text.secondary,textAlign:"left"},children:o.i18n._({id:"BRi+RY",message:"Add more liquidity"})}),z.jsxs(t.Box,{children:[z.jsx(Hm,{value:Ee[Bm.CURRENCY_A],onUserInput:fe,maxAmount:Ie[Bm.CURRENCY_A],balance:W[Bm.CURRENCY_A],currency:null!==(n=$[Bm.CURRENCY_A])&&void 0!==n?n:null,locked:J}),z.jsx(jp,{}),z.jsx(Hm,{value:Ee[Bm.CURRENCY_B],onUserInput:ye,maxAmount:Ie[Bm.CURRENCY_B],balance:W[Bm.CURRENCY_B],currency:null!==(i=$[Bm.CURRENCY_B])&&void 0!==i?i:null,locked:ee})]}),z.jsx(wm,{value:je,onChange:we,disabled:!1,type:"AMMV3"})]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:g.palette.background.paper},children:z.jsx(Fm,{chainId:e,approvalA:Ae,approvalB:Se,parsedAmounts:V,isValid:Be,depositADisabled:J,depositBDisabled:ee,errorMessage:G,setShowConfirm:E})}),z.jsx(wg,{parsedAmounts:V,position:H,existingPosition:void 0,priceLower:Re,priceUpper:Oe,outOfRange:K,ticksAtLimit:ne,on:B,onClose:()=>{E(!1)},onConfirm:_e.mutate,loading:_e.isPending})]}),z.jsxs(t.TabPanel,{value:"unstake",children:[z.jsxs(t.Box,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[z.jsx(xm,{disabled:!1,value:I,onChange:e=>A(e)}),z.jsx(wm,{value:je,onChange:we,disabled:!1,type:"AMMV3"})]}),z.jsxs(t.Box,{sx:{mt:16,mx:20,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[z.jsx(t.Box,{sx:{typography:"body2",color:g.palette.text.secondary},children:"Receive"}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[z.jsxs(t.Box,{sx:{typography:"body1",fontWeight:600,color:g.palette.text.primary},children:[z.jsx(t.Box,{component:"span",sx:{color:g.palette.primary.main},children:se?ir({input:se.toExact(),decimals:se.currency.decimals}):"-"})," ",null===(r=null==se?void 0:se.currency)||void 0===r?void 0:r.symbol]}),z.jsxs(t.Box,{sx:{typography:"body1",fontWeight:600,color:g.palette.text.primary},children:[z.jsx(t.Box,{component:"span",sx:{color:g.palette.primary.main},children:le?ir({input:le.toExact(),decimals:le.currency.decimals}):"-"})," ",null===(a=null==le?void 0:le.currency)||void 0===a?void 0:a.symbol]})]})]}),z.jsx(t.Box,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:g.palette.background.paper},children:z.jsx(fg,{chainId:e,disabled:pe||0===I||!se,removed:pe,error:ue,onConfirm:De.mutate,isLoading:De.isPending})})]}),z.jsxs(t.TabPanel,{value:"claim",children:[z.jsxs(t.Box,{sx:{mx:20,mt:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:g.palette.border.main},children:[z.jsx(t.Box,{sx:{py:12,px:20,typography:"body1",color:g.palette.text.primary,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:g.palette.border.main},children:o.i18n._({id:"tu/fxg",message:"Claim fees"})}),z.jsxs(t.Box,{sx:{p:20},children:[z.jsx($g,{token:null==xe?void 0:xe.currency,amount:xe}),z.jsx($g,{token:null==ge?void 0:ge.currency,amount:ge})]})]}),z.jsx(t.Box,{sx:{mx:20,mt:16,typography:"h6",color:g.palette.text.secondary},children:o.i18n._({id:"Joa5Dk",message:"*Collecting fees will withdraw currently available fees for you."})}),z.jsx(t.Box,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:g.palette.background.paper},children:z.jsx(Um,{chainId:e,disabled:Ne.isPending,onConfirm:Ne.mutate,isLoading:Ne.isPending})})]})]})]})}),[Ae,Se,e,$,W,J,ee,ue,G,w,ge,xe,Ee,j,Be,se,le,Ie,_e.isPending,_e.mutate,Ne.isPending,Ne.mutate,u,fe,ye,De.isPending,De.mutate,k,K,V,H,Re,Oe,pe,we,B,I,je,g.palette.background.paper,g.palette.border.main,g.palette.primary.main,g.palette.text.primary,g.palette.text.secondary,ne]);return m?z.jsx(el,{open:null!=i&&null!=a,onClose:u,scope:!m,modal:m,id:"pool-operate",children:Fe}):Fe};const Qg=({outOfRange:e})=>{const n=t.useTheme();return z.jsx(t.Tooltip,{title:e?o.i18n._({id:"i3Z+/Z",message:"Out of range"}):o.i18n._({id:"vOyUlD",message:"In range"}),children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:e?z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.583252 12.5416L6.99992 1.45825L13.4166 12.5416H0.583252ZM11.3924 11.3749L6.9999 3.78575L2.6074 11.3749H11.3924ZM7.58328 9.62492H6.41661V10.7916H7.58328V9.62492ZM6.41661 6.12492H7.58328V8.45825H6.41661V6.12492Z",fill:n.palette.warning.main})}):z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",children:z.jsx("circle",{cx:"4",cy:"4",r:"4",fill:n.palette.success.main})})})})},Yg=({p:e,currency0:i,currency1:r,onClickManage:a})=>{const s=t.useTheme(),[,l]=Bg(null!=i?i:void 0,null!=r?r:void 0,e.fee),d=n.useMemo((()=>{if(l)return new Kx({pool:l,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})}),[e.liquidity,e.tickLower,e.tickUpper,l]),c=(u=e.fee,p=e.tickLower,h=e.tickUpper,n.useMemo((()=>({[Em.LOWER]:u&&p?p===Zx(Ix.MIN_TICK,fx[u]):void 0,[Em.UPPER]:u&&h?h===Zx(Ix.MAX_TICK,fx[u]):void 0})),[u,p,h]));var u,p,h;const m=null==d?void 0:d.token0PriceLower,x=null==d?void 0:d.token0PriceUpper,g=null==d?void 0:d.amount1.currency,f=null==d?void 0:d.amount0.currency,y=!!l&&(l.tickCurrent<e.tickLower||l.tickCurrent>=e.tickUpper),v=i==i?null==d?void 0:d.pool.priceOf(null==d?void 0:d.pool.token0):null==d?void 0:d.pool.priceOf(null==d?void 0:d.pool.token1);return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,px:20,py:20,pb:12,borderRadius:12,backgroundColor:s.palette.background.paperContrast},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h5",color:s.palette.text.primary},children:[z.jsx(t.Box,{children:z.jsxs(z.Fragment,{children:[z.jsxs("span",{children:[mg({price:m,atLimit:c,direction:Em.LOWER})," "]}),null==g?void 0:g.symbol]})}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:z.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),z.jsx(t.Box,{children:z.jsxs(z.Fragment,{children:[z.jsxs("span",{children:[mg({price:x,atLimit:c,direction:Em.UPPER})," "]}),null==g?void 0:g.symbol]})})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(Qg,{outOfRange:y}),z.jsxs(t.Box,{sx:{typography:"h6",color:s.palette.text.secondary},children:[o.i18n._({id:"DWd30U",message:"Current price"}),": ",`${ir({input:null==v?void 0:v.toSignificant()})}`," ",null==g?void 0:g.symbol," per ",null==f?void 0:f.symbol]})]})]}),z.jsx(t.Button,{variant:t.Button.Variant.outlined,size:t.Button.Size.small,fullWidth:!0,onClick:a,children:o.i18n._({id:"wckWOP",message:"Manage"})})]})},Xg=({chainId:e,baseToken:i,quoteToken:r,feeAmount:a,onClose:s,handleGoToAddLiquidityV3:l})=>{const{isMobile:d}=Xa(),u=t.useTheme(),{account:p}=Pa(),{positions:h,loading:m}=function(e,t){const i=Ug(t),{isLoading:o,data:r}=c.useQuery(va.getBalanceOf(t,i,null!=e?e:void 0)),a=n.useMemo((()=>{if(e&&r&&r.isFinite()){const t=[];for(let n=0;n<r.toNumber();n++)t.push([e,n]);return t}return[]}),[e,r]),s=c.useQuery(va.getTokenOfOwnerByIndex(t,i,a)),l=s.isLoading,d=n.useMemo((()=>e&&s.data?s.data.map((e=>{if(Array.isArray(e)&&e.length>0)return e[0].toString()})):[]),[e,s]),{positions:u,loading:p}=qg(d,t);return{loading:l||o||p,positions:u}}(p,e),x=n.useMemo((()=>i?Lg(i):void 0),[i]),g=n.useMemo((()=>r?Lg(r):void 0),[r]),[f,y]=n.useMemo((()=>[null==x?void 0:x.wrapped,null==g?void 0:g.wrapped]),[x,g]),[v,b]=n.useMemo((()=>f&&y?f.sortsBefore(y)?[f,y]:[y,f]:[void 0,void 0]),[f,y]),C=n.useMemo((()=>{if(void 0!==h)return h.filter((e=>Ag(null==v?void 0:v.address,e.token0)&&Ag(null==b?void 0:b.address,e.token1)&&e.fee===a))}),[a,h,null==v?void 0:v.address,null==b?void 0:b.address]),[j,w]=n.useState(null),k=n.useMemo((()=>{var e;return z.jsxs(t.Box,{sx:{p:20,display:"flex",flexDirection:"column",gap:16,borderRadius:16,backgroundColor:u.palette.background.paper,minHeight:480},children:[z.jsxs(t.Box,{sx:{pb:16,borderBottomColor:u.palette.border.main,borderBottomStyle:"solid",borderBottomWidth:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[o.i18n._({id:"Gs02OK",message:"My Positions"})," (",null!==(e=null==C?void 0:C.length)&&void 0!==e?e:0,")"]}),s?z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:z.jsx(t.Box,{component:oe.Error,sx:{width:16,height:16},onClick:()=>{s()}})}):void 0]}),C&&C.length>0?z.jsxs(z.Fragment,{children:[null==C?void 0:C.map((e=>z.jsx(Yg,{p:e,currency0:x,currency1:g,onClickManage:()=>{w(e)}},e.tokenId))),z.jsxs(t.Button,{size:t.Button.Size.big,variant:t.Button.Variant.second,onClick:()=>{l({from:i.address,to:r.address,fee:String(a)})},sx:{gap:8},children:[z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:z.jsx("path",{d:"M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z",fill:"currentColor"})}),o.i18n._({id:"FQ4aT9",message:"Add Position"})]})]}):z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{mt:100,display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[z.jsx(Y,{sx:{width:60,height:60,borderRadius:24/105*60}}),z.jsx(t.Box,{sx:{typography:"body1",color:u.palette.text.secondary},children:o.i18n._({id:"/6L4mj",message:"Your position is empty"})})]}),z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:void 0!==C&&0===C.length?z.jsx(t.Button,{size:t.Button.Size.small,onClick:()=>{l({from:i.address,to:r.address,fee:String(a)})},children:o.i18n._({id:"FQ4aT9",message:"Add Position"})}):z.jsx(Im,{size:t.Button.Size.small})})]})]})}),[u.palette.background.paper,u.palette.border.main,u.palette.text.primary,u.palette.text.secondary,C,s,x,g,l,i.address,r.address,a]);return null!==j?z.jsx(Gg,{baseToken:i,quoteToken:r,feeAmount:a,tokenId:j.tokenId,chainId:e,onClose:()=>{w(null)}}):d?z.jsx(el,{open:null!=i&&null!=r,onClose:s,scope:!d,modal:d,id:"pool-operate",children:k}):k};function Kg({children:e,sx:n,gap:i=20,repeatBaseForLargeScreen:o=3}){const{isMobile:r,minDevice:a}=Xa();let s={};if(r)s={display:"flex",flexDirection:"column",gap:i};else{let e=2;[1418,1761,2104].some(((t,n)=>{if(a(t))return e=o+n,!0})),s={display:"grid",gap:i,gridTemplateColumns:`repeat(${e}, 1fr)`}}return z.jsx(t.Box,{sx:Object.assign(Object.assign({},s),n),children:e})}function Jg({text:e,onClick:n}){const i=t.useTheme();return z.jsxs(t.Box,{sx:{typography:"body2",display:"inline-flex",alignItems:"center",p:i.spacing(0,4,0,8),width:"max-content",height:32,backgroundColor:"hover.default",color:"primary.main",borderWidth:1,borderRadius:8,cursor:"pointer"},onClick:n,children:[e,z.jsx(t.Box,{component:oe.ArrowBack,sx:{ml:2,width:16,height:16,transform:"rotate(180deg)"}})]})}function ef({lqList:e,onDeleteTag:n,sx:i}){var o;if(!(null==e?void 0:e.length))return null;if(!(null===(o=e[0])||void 0===o?void 0:o.pair))return null;const{pair:r}=e[0],a=ba(r.baseToken,r.chainId),s=ba(r.quoteToken,r.chainId);return a&&s?z.jsxs(t.Box,{sx:Object.assign({typography:"body2",display:"inline-flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},i),children:[z.jsx(Pp,{tokens:[a,s],chainId:a.chainId,width:20,mr:8}),a.symbol,"+",s.symbol,z.jsx(t.Box,{component:oe.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>n()})]}):null}function tf({tags:e,onDeleteTag:n,sx:i}){return e.length?z.jsx(t.Box,{sx:Object.assign({display:"inline-flex",alignItems:"center"},i),children:e.map((e=>z.jsxs(t.Box,{sx:{typography:"body2",display:"flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},children:[z.jsx(sl,{address:e.address,width:20,height:20,chainId:e.chainId,url:e.logoURI,noShowChain:!0,marginRight:8}),e.symbol,z.jsx(t.Box,{component:oe.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>n(e)})]},e.address)))}):null}function nf({chainId:e,address:n,type:i=exports.PageType.PoolDetail}){const{isMobile:o}=Xa();return z.jsx(t.Box,{component:"button",onClick:t=>{t.stopPropagation(),pm.getState().push({type:i,params:{chainId:e,address:n}})},sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:8,cursor:"pointer",flexShrink:0,color:"text.primary","&:hover":{opacity:.5}},o?{width:64,height:36,backgroundColor:"background.tag"}:{width:40,height:32,backgroundColor:"transparent",borderWidth:1,borderStyle:"solid",borderColor:"border.main"}),children:z.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M5.83333 14.1667H7.5V8.33333H5.83333V14.1667ZM9.16667 14.1667H10.8333V5.83333H9.16667V14.1667ZM12.5 14.1667H14.1667V10.8333H12.5V14.1667ZM4.16667 17.5C3.70833 17.5 3.31597 17.3368 2.98958 17.0104C2.66319 16.684 2.5 16.2917 2.5 15.8333V4.16667C2.5 3.70833 2.66319 3.31597 2.98958 2.98958C3.31597 2.66319 3.70833 2.5 4.16667 2.5H15.8333C16.2917 2.5 16.684 2.66319 17.0104 2.98958C17.3368 3.31597 17.5 3.70833 17.5 4.16667V15.8333C17.5 16.2917 17.3368 16.684 17.0104 17.0104C16.684 17.3368 16.2917 17.5 15.8333 17.5H4.16667ZM4.16667 15.8333H15.8333V4.16667H4.16667V15.8333Z",fill:"currentColor"})})})}function of(n){var{sx:i,children:o,empty:r,loading:a,hasMore:s,loadMore:l,loadMoreLoading:d}=n,c=D(n,["sx","children","empty","loading","hasMore","loadMore","loadMoreLoading"]);const u=t.useTheme();return z.jsxs(t.Box,{sx:Object.assign({position:"relative",flex:1,overflowY:"auto",borderRadius:16},i),...c,children:[z.jsx(t.Box,{component:"table",sx:Object.assign({width:"100%",borderCollapse:"collapse","& th":{px:24,py:12,typography:"h6",lineHeight:"20px",textAlign:"left",color:"text.secondary"},"& td":{px:24,py:12,backgroundColor:"background.paper"},"& thead":{position:"sticky",top:0,zIndex:2,backgroundColor:"background.tag"},"& tbody tr":{borderWidth:"1px 0px 1px 0px",borderStyle:"solid",borderColor:"border.main"}},!r&&!a&&{"& th:last-child, & td:last-child":{position:"sticky",right:0,zIndex:1,"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:1,width:"1px",boxShadow:`${"dark"===u.palette.mode?"#1A1A1B":t.alpha("#1A1A1B",.1)} -2px 0px 4px 0px`}}}),children:o}),s&&z.jsx(t.ButtonBase,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:l,children:d?z.jsx(t.RotatingIcon,{}):z.jsxs(z.Fragment,{children:[z.jsx(e.Trans,{id:"yQ2kGp",message:"Load more"}),z.jsx(t.Box,{component:oe.ArrowRight,sx:{transform:"rotate(90deg)"}})]})})]})}function rf({sx:n}){const{supportAMMV2:i,supportAMMV3:o}=Q(),r=i||o;return z.jsxs(t.Box,{sx:Object.assign({px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},n),children:[z.jsx(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(Pp,{width:24,tokens:[],mr:6,showChainLogo:!0}),z.jsx(t.Skeleton,{variant:"rounded",height:20,width:88})]})}),z.jsxs(t.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[r&&z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:z.jsx(t.Skeleton,{variant:"rounded",height:24,width:100})}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"1Qz63U",message:"Pool Type"})})]}),z.jsxs(t.Box,{children:[z.jsx(t.Skeleton,{variant:"rounded",height:24,width:100}),z.jsx(t.Box,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:z.jsx(e.Trans,{id:"rSayea",message:"APY"})})]}),z.jsxs(t.Box,{children:[z.jsx(t.Skeleton,{variant:"rounded",height:24,width:100}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})})]}),r&&z.jsxs(t.Box,{children:[z.jsx(t.Skeleton,{variant:"rounded",height:24,width:100}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"Q8W3SC",message:"Volume (1D)"})})]})]}),z.jsx(t.Skeleton,{variant:"rounded",height:32,sx:{mt:20}})]})}function af({sx:i,value:r,onChange:a,searchAddress:s}){const[l,d]=n.useState(!1),{isMobile:c}=Xa();return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{component:t.ButtonBase,sx:Object.assign(Object.assign({typography:"body2",display:"flex",alignItems:"center",justifyContent:"flex-start",px:12,height:32,backgroundColor:"background.tag",color:"text.secondary",borderRadius:8,fontWeight:600},c?{width:"100%"}:{minWidth:220}),i),onClick:()=>d(!0),children:[z.jsx(t.Box,{component:oe.Search,sx:{width:16,height:16,mr:8,flexShrink:0}}),z.jsx(e.Trans,{id:"A1taO8",message:"Search"})]}),z.jsx(pp,{value:r,open:l,multiple:!0,title:z.jsx(e.Trans,{id:"o8aMNm",message:"Select a liquidity pool"}),searchPlaceholder:o.i18n._({id:"4nzwq3",message:"Search by token or pool address"}),onClose:()=>{d(!1)},onTokenChange:e=>{if(Array.isArray(e)){if(e.length>2){const t=[e[0],e[2]];a(t)}else a(e);d(!1)}},searchOtherAddress:e=>s(e,(()=>d(!1))),modal:!0})]})}function sf({list:n,onClick:i}){return z.jsx(z.Fragment,{children:null==n?void 0:n.map((n=>{var o,a,l,d;if(!(null==n?void 0:n.pair))return null;const c=n.pair,u=ba(c.baseToken,c.chainId),p=ba(c.quoteToken,c.chainId),h=c.apy?fr(new s(null===(o=c.apy)||void 0===o?void 0:o.transactionBaseApy).plus(null!==(l=null===(a=c.apy)||void 0===a?void 0:a.miningBaseApy)&&void 0!==l?l:0)):void 0,m=r.PoolApi.utils.singleSideLp(c.type)&&c.apy?fr(new s(c.apy.transactionQuoteApy).plus(null!==(d=c.apy.miningQuoteApy)&&void 0!==d?d:0)):void 0;return u&&p?z.jsxs(t.Box,{onClick:i,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:10,py:20,borderRadius:8,cursor:"pointer","&:hover":{backgroundColor:"custom.background.listHover"}},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(Pp,{tokens:[u,p],chainId:c.chainId,width:24,mr:10}),z.jsxs(t.Box,{sx:{typography:"h5"},children:[u.symbol,"/",p.symbol]})]}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{color:"custom.status.green.default",fontWeight:600},children:[h,m?`/${m}`:""]}),z.jsx(t.Box,{sx:{mt:2,typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"rSayea",message:"APY"})})]})]},c.id):null}))})}function lf(e){var t;const[i,o]=n.useState(null!==(t=null==e?void 0:e.tokens)&&void 0!==t?t:[]),[r,a]=n.useState([]);n.useEffect((()=>{e&&(o(e.tokens),a(e.lqList))}),[e]);const[s,l]=n.useMemo((()=>{const[e,t]=i;return[null==e?void 0:e.symbol,null==t?void 0:t.symbol]}),[i]);return{filterTokens:i,filterASymbol:s,filterBSymbol:l,filterAddressLqList:r,handleDeleteToken:t=>{o((n=>{const i=[...n],o=i.indexOf(t);return-1!==o&&i.splice(o,1),e&&e.onChangeFilterTokens(i),i}))},handleChangeFilterTokens:t=>{a([]),o(t),e&&(e.onChangeFilterTokens(t),e.onChangeFilterAddressLqList([]))},handleChangeFilterAddress:t=>{a(t),o([]),e&&(e.onChangeFilterTokens([]),e.onChangeFilterAddressLqList(t))}}}var df;function cf({apy:e,dailyApy:n,weeklyApy:i,sx:o}){const r=t.useTheme();return z.jsx(t.Tooltip,{title:z.jsxs(t.Box,{sx:{maxWidth:216,typography:"h6",fontWeight:500,color:"text.secondary"},children:[z.jsx(t.Box,{sx:{fontWeight:700},children:"Base vAPY (annualized)"}),z.jsxs(t.Box,{component:"ul",sx:{pl:16,my:0},children:[z.jsxs("li",{children:["Daily: ",gr({input:n,showDecimals:2})]}),z.jsxs("li",{children:["Weekly: ",gr({input:i,showDecimals:2})]})]}),z.jsx("br",{}),"*Variable APY based on today’s trading activity"]}),children:z.jsx(t.Box,{component:"span",sx:Object.assign({fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto",typography:"h5",[r.breakpoints.up("tablet")]:{typography:"body2"}},o),children:gr({input:e,showDecimals:2})})})}!function(e){e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(df||(df={}));const uf=({pool:e,separate:n,wrap:i})=>{const o=t.useTheme();if(!e)return null;e.coins.length;const r=e.coins.slice(0,8),a=r.length,s=n?a>=6&&i?18:24:a>3?24:36,l=(d=a,i?d<=3?{rows:1,cols:d,itemsPerRow:[d]}:4===d?{rows:2,cols:2,itemsPerRow:[2,2]}:5===d?{rows:2,cols:3,itemsPerRow:[3,2]}:6===d?{rows:2,cols:3,itemsPerRow:[3,3]}:7===d?{rows:2,cols:4,itemsPerRow:[4,3]}:8===d?{rows:2,cols:4,itemsPerRow:[4,4]}:{rows:1,cols:d,itemsPerRow:[d]}:{rows:1,cols:d,itemsPerRow:[d]});var d;return z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:4},children:Array.from({length:l.rows},((i,d)=>z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:1===d&&5===a?"flex-start":"center",gap:n?2:0,[o.breakpoints.up("tablet")]:{gap:n?4:0}},children:r.slice(l.itemsPerRow.slice(0,d).reduce(((e,t)=>e+t),0),l.itemsPerRow.slice(0,d+1).reduce(((e,t)=>e+t),0)).map(((i,o)=>z.jsx(t.Tooltip,{title:i.symbol,placement:"top",onlyHover:!0,leaveDelay:100,sx:{maxWidth:240},children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",zIndex:o,position:"relative",marginLeft:n?0:o>0?"-8px":0},children:z.jsx(sl,{address:i.address,width:s,height:s,chainId:e.chainId,url:void 0,cross:!1,noShowChain:!0,noBorder:!0,marginRight:0})})},i.address)))},d)))})},pf=new r.CurveApi({contractRequests:Wi}),hf=[{chainId:r.ChainId.ZETACHAIN_TESTNET,name:"MockToken 4Pool",address:"0xDddfBCc76166d741c2dfa6b6a90769df398b9969",symbol:"MTK.10000",decimals:18,fee:"20000000",coins:[{address:"0x08f9f0e8EBc8B3F7808974463D31CC39Ca9F79F0",name:"Mock Token 1",decimals:18,symbol:"MTK1",chainId:r.ChainId.ZETACHAIN_TESTNET},{address:"0xc39f8C093b10660E12d982256979E239B18D073d",name:"Mock Token 2",decimals:18,symbol:"MTK2",chainId:r.ChainId.ZETACHAIN_TESTNET},{address:"0xbE3499499C928F086a32B0bE586e07A9D085b5eF",name:"Mock Token 3",decimals:18,symbol:"MTK3",chainId:r.ChainId.ZETACHAIN_TESTNET},{address:"0x11D6F6C038B9E841e024F7aB5Bd40101D69638b3",name:"Mock Token 4",decimals:18,symbol:"MTK4",chainId:r.ChainId.ZETACHAIN_TESTNET}],apy:"0.631",dailyApy:"0.001",weeklyApy:"0.002",tvl:"1000000000000000000",volume:"1000000000000000000"}];function mf({poolList:n,setOperateCurvePool:i}){const o=t.useTheme();return z.jsx(z.Fragment,{children:n.map((n=>z.jsxs(t.Box,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",border:`1px solid ${o.palette.border.main}`,borderRadius:16},className:"gradient-card-border",onClick:()=>{pm.getState().push({type:exports.PageType.CurvePoolDetail,params:{chainId:n.chainId,address:n.address}})},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600},children:n.name}),z.jsx(t.Box,{sx:{maxWidth:146,wordBreak:"break-word",typography:"body2",color:o.palette.text.secondary},children:n.coins.map(((e,i)=>z.jsxs(t.Box,{component:"span",children:[e.symbol,i!==n.coins.length-1&&"/"]},e.address)))})]}),z.jsx(uf,{pool:n,separate:!0,wrap:!0})]}),z.jsxs(t.Box,{sx:{mt:40},children:[z.jsx(cf,{apy:n.apy,dailyApy:n.dailyApy,weeklyApy:n.weeklyApy}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"rSayea",message:"APY"})})]}),z.jsxs(t.Box,{sx:{mt:20,display:"flex",alignItems:"center",gap:20},children:[z.jsxs(t.Box,{sx:{flexBasis:"100%",flexGrow:1,flexShrink:1},children:[z.jsxs(t.Box,{sx:{typography:"h5"},children:["$",n.tvl?xr(new s(n.tvl)):"-"]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})})]}),z.jsx(t.Box,{sx:{flexShrink:0,flexGrow:0,width:"1px",height:24,backgroundColor:o.palette.border.main}}),z.jsxs(t.Box,{sx:{flexBasis:"100%",flexGrow:1,flexShrink:1},children:[z.jsxs(t.Box,{sx:{typography:"h5"},children:["$",n.volume?xr(new s(n.volume)):"-"]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"/cF7Rs",message:"Volume"})})]})]}),z.jsxs(t.Box,{sx:{mt:20,display:"flex",alignItems:"center",gap:"8px"},children:[z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),i({pool:n,type:df.Add})},children:z.jsx(e.Trans,{id:"m16xKo",message:"Add"})}),z.jsx(nf,{chainId:n.chainId,address:n.address,type:exports.PageType.CurvePoolDetail})]})]},`${n.chainId}-${n.address}`)))})}function xf({poolList:e=hf,loading:n,operateCurvePool:i,setOperateCurvePool:r,hasMore:a,loadMore:l,loadMoreLoading:d}){const c=t.useTheme();return z.jsxs(of,{hasMore:a,loadMore:l,loadMoreLoading:d,empty:!(null==e?void 0:e.length),loading:n,children:[z.jsx(t.Box,{component:"thead",children:z.jsxs(t.Box,{component:"tr",children:[z.jsx(t.Box,{component:"th",children:"Pool"}),z.jsx(t.Box,{component:"th",children:"Assets"}),z.jsx(t.Box,{component:"th",children:"APY"}),z.jsx(t.Box,{component:"th",children:"TVL"}),z.jsx(t.Box,{component:"th",children:"Volume"}),z.jsx(t.Box,{component:"th",sx:{width:155}})]})}),z.jsx(t.Box,{component:"tbody",children:e.map((e=>{var n;let a="";if((null===(n=null==i?void 0:i.pool)||void 0===n?void 0:n.address.toLowerCase())===e.address.toLowerCase())if(i.type===df.Remove)a=o.i18n._({id:"0+31GV",message:"Removing"});else a=o.i18n._({id:"1yHVE+",message:"Adding"});const l=c.palette.hover.default;return z.jsxs(t.Box,{component:"tr",sx:{["&:hover td"+(a?", & td":"")]:{backgroundImage:`linear-gradient(${l}, ${l})`}},children:[z.jsxs(t.Box,{component:"td",children:[z.jsx(t.Box,{sx:{typography:"body2",lineHeight:"19px",fontWeight:600},children:e.name}),z.jsx(lp,{address:e.address,customChainId:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"h6",color:"text.secondary"}})]}),z.jsx(t.Box,{component:"td",children:z.jsx(uf,{pool:e,separate:!0,wrap:!1})}),z.jsx(t.Box,{component:"td",children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:z.jsx(cf,{apy:e.apy,dailyApy:e.dailyApy,weeklyApy:e.weeklyApy})})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{typography:"body2",fontWeight:600},title:`$${ir({input:e.tvl,decimals:2})}`,children:["$",e.tvl?xr(new s(e.tvl)):"-"]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{typography:"body2",fontWeight:600},title:`$${ir({input:e.volume,decimals:2})}`,children:["$",e.volume?xr(new s(e.volume)):"-"]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[z.jsx(nf,{chainId:e.chainId,address:e.address,type:exports.PageType.CurvePoolDetail}),a?z.jsx(Jg,{text:a,onClick:()=>r(null)}):z.jsx(t.Button,{size:t.Button.Size.small,onClick:()=>{r({pool:e,type:df.Add})},sx:{py:0,height:32},children:o.i18n._({id:"m16xKo",message:"Add"})})]})})]},`${e.chainId}-${e.address}`)}))})]})}const gf=({scrollParentRef:e,filterChainIds:o,activeChainId:a,operateCurvePool:s,setOperateCurvePool:l,children:d,tokenAndPoolFilter:u})=>{var p,h;const m=t.useTheme(),{isMobile:x}=Xa(),g=qa(),f=c.useQueryClient(),{onlyChainId:y}=Q(),{filterTokens:v,filterASymbol:b,filterBSymbol:C,filterAddressLqList:j,handleDeleteToken:w,handleChangeFilterTokens:k,handleChangeFilterAddress:T}=lf(),B=n.useMemo((()=>({chainIds:o,pageSize:x?4:8,filterState:{viewOnlyOwn:!1,filterTypes:["CURVE"]}})),[o,x]),E=g.getInfiniteQuery(r.PoolApi.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},B),{filterState:Object.assign({filterASymbol:b,filterBSymbol:C},B.filterState)})}),I=c.useInfiniteQuery(Object.assign(Object.assign({},E),{initialPageParam:1,getNextPageParam:e=>{var t;const{currentPage:n,totalCount:i,pageSize:o}=null!==(t=e.liquidity_list)&&void 0!==t?t:{};if(!n||!i||!o)return null;let r=Math.floor(i/o);return i%o&&(r+=1),n>=r?null:n+1}}));let A=[];const L=!!(null==j?void 0:j.length);L?A=[...j]:null===(p=I.data)||void 0===p||p.pages.forEach((e=>{var t,n;null===(n=null===(t=e.liquidity_list)||void 0===t?void 0:t.lqList)||void 0===n||n.forEach((e=>{null==A||A.push(e)}))}));const M=I.hasNextPage&&!L;return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pb:20,display:"flex",flexDirection:"column",gap:12,[m.breakpoints.up("tablet")]:{py:16,flexDirection:"row",alignItems:"center",gap:8,px:0,justifyContent:"space-between"}},children:[z.jsx(t.Box,{sx:{[m.breakpoints.up("tablet")]:{mr:"auto"}},children:d}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:Object.assign({flex:1,display:"flex",alignItems:"center",gap:8},x?{}:{"& > button":{flex:1}}),children:null!==(h=null==u?void 0:u.element)&&void 0!==h?h:z.jsx(af,{value:v,onChange:k,searchAddress:(e,t)=>N(void 0,void 0,void 0,(function*(){var n;const i=g.getInfiniteQuery(r.PoolApi.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},B),{filterState:Object.assign({address:e},B.filterState)})}),o=null===(n=(yield f.fetchQuery(i)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==o?void 0:o.length)?z.jsx(sf,{list:o,onClick:()=>{T(o),t()}}):null}))})}),(L||!!v.length)&&z.jsxs(t.Box,{sx:{my:0},children:[L?z.jsx(ef,{lqList:j,onDeleteTag:()=>T([])}):"",z.jsx(tf,{tags:v,onDeleteTag:w})]})]})]}),x?z.jsx(S,{hasMore:M,threshold:300,loadMore:i.debounce((()=>{I.hasNextPage&&!I.isFetching&&I.fetchNextPage()}),500),useWindow:!1,getScrollParent:()=>e.current||null,loader:z.jsx(rf,{sx:{mt:20}},"loader"),children:z.jsxs(Kg,{children:[I.isLoading?z.jsx(rf,{}):"",!I.isLoading&&!(null==A?void 0:A.length)&&!I.error&&z.jsx(X,{sx:{mt:40},hasSearch:!!(a&&!y||b||C)}),!!I.error&&z.jsx(ne,{refresh:I.refetch,sx:{mt:40}}),z.jsx(mf,{poolList:hf,setOperateCurvePool:l})]})}):z.jsxs(z.Fragment,{children:[z.jsx(xf,{poolList:hf,loading:I.isLoading,operateCurvePool:s,setOperateCurvePool:l,hasMore:M,loadMoreLoading:I.isFetchingNextPage,loadMore:()=>{I.hasNextPage&&!I.isFetching&&I.fetchNextPage()}}),z.jsx(_p,{loading:I.isLoading,refetch:I.error?I.refetch:void 0,empty:!(null==A?void 0:A.length),hasSearch:!!(a&&!y||b||C)})]})]})};function ff({children:e}){const n=t.useTheme();return z.jsx(t.Box,{sx:{px:20,py:16,boxShadow:"0px -1px 0px 0px rgba(55, 55, 57, 0.10)",backgroundColor:"background.paper",borderBottomLeftRadius:16,borderBottomRightRadius:16,position:"fixed",bottom:0,left:0,right:0,[n.breakpoints.up("tablet")]:{position:"static"}},children:e})}const yf=e=>{const n=t.useTheme();return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,px:12,height:36,borderRadius:8,border:`1px solid ${n.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{typography:"body2",fontWeight:500,lineHeight:"19px",color:n.palette.text.secondary,textTransform:"capitalize"},children:["Slippage Bonus (incl. pricing)",z.jsx(ku,{title:"Bonus comes as an advantage from current coin prices which usually appears for coins which are low in balance"})]}),z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,lineHeight:"19px",color:n.palette.success.main},children:"-"})]})};function vf({pool:e,account:t}){var i;const o=c.useQuery(pf.getBalanceOf(null==e?void 0:e.chainId,null==e?void 0:e.address,t)),r=c.useQuery(pf.getBalances(null==e?void 0:e.chainId,null==e?void 0:e.address,null!==(i=null==e?void 0:e.coins)&&void 0!==i?i:[])),a=c.useQuery(pf.getTotalSupply(null==e?void 0:e.chainId,null==e?void 0:e.address)),l=n.useMemo((()=>a.data?null==(null==e?void 0:e.decimals)?null:a.data.div(10**e.decimals).dp(e.decimals,s.ROUND_DOWN):null),[a.data,null==e?void 0:e.decimals]),d=n.useMemo((()=>o.data?null==(null==e?void 0:e.decimals)?null:o.data.div(10**e.decimals).dp(e.decimals,s.ROUND_DOWN):null),[o.data,null==e?void 0:e.decimals]),u=n.useMemo((()=>r.data?null==(null==e?void 0:e.coins)?null:r.data.map(((t,n)=>{const i=e.coins[n];return t.div(10**i.decimals).dp(i.decimals,s.ROUND_DOWN)})):null),[r.data,null==e?void 0:e.coins]),p=n.useMemo((()=>u&&d&&l?null==(null==e?void 0:e.coins)?null:u.map(((t,n)=>{const i=e.coins[n];return t.multipliedBy(d).div(l).dp(i.decimals,s.ROUND_DOWN)})):null),[u,d,l,null==e?void 0:e.coins]);return{lpTokenTotalSupply:l,tokenBalances:u,lpTokenBalance:d,userTokenBalances:p,lpTokenBalanceLoading:o.isLoading||r.isLoading||a.isLoading}}const bf=({operateCurvePool:e})=>{const i=t.useTheme(),{account:a,chainId:l}=Pa(),d=us(),u=c.useQueryClient(),[p,h]=n.useState(!1),[m,x]=n.useState({}),g=n.useRef(m);g.current=m;const{slipper:f,setSlipper:y,slipperValue:v,resetSlipper:b}=jm({address:e.pool.address}),{lpTokenTotalSupply:C,tokenBalances:j,lpTokenBalance:w,userTokenBalances:k}=vf({pool:e.pool,account:a}),T=n.useCallback((()=>{const t={};e.pool.coins.forEach((e=>{t[e.address]=""})),x(t)}),[e.pool.coins]);n.useEffect((()=>{T()}),[T]);const B=(t,n)=>{x((i=>{const o=Object.assign(Object.assign({},i),{[t]:n});if(p&&j){const i=e.pool.coins.findIndex((e=>e.address===t));if(-1!==i){const r=j[i],a=new s(n||"0");a.isZero()||""===n?e.pool.coins.forEach((e=>{e.address!==t&&(o[e.address]="0")})):r&&r.gt(0)&&a.gt(0)&&e.pool.coins.forEach(((e,t)=>{if(t!==i){const n=j[t];if(n&&n.gt(0)){const t=n.div(r),i=a.multipliedBy(t).dp(e.decimals,s.ROUND_DOWN).toString();o[e.address]=i}else o[e.address]="0"}}))}}return o}))},E=c.useQueries({queries:e.pool.coins.map((t=>{const n=Hi.getFetchTokenQuery(t.chainId,t.address,a,e.pool.address);return{queryKey:n.queryKey,enabled:n.enabled&&null!=t.chainId&&null!=t.address&&null!=a&&null!=e.pool.address,queryFn:n.queryFn}})),combine:e=>({data:e.map((e=>{var t,n,i,o;return{address:null===(t=e.data)||void 0===t?void 0:t.address,symbol:null===(n=e.data)||void 0===n?void 0:n.symbol,balance:null===(i=e.data)||void 0===i?void 0:i.balance,allowance:null===(o=e.data)||void 0===o?void 0:o.allowance}})),loading:e.some((e=>e.isLoading))})}),{getApprovalState:I,getBalanceState:A,getPendingRest:S,submitApprove:L}=(({account:e,chainId:t,offset:i,contractAddress:a})=>{var l,d;const u=us(),p=c.useQueryClient(),{runningRequests:h}=ps(),{updateBlockNumber:m}=Qa(),x=n.useMemo((()=>null!=a?a:r.contractConfig[t].DODO_APPROVE),[t,a]),g=n.useMemo((()=>{var e;return t?null===(e=r.basicTokenMap[t])||void 0===e?void 0:e.address:null}),[t]),f=c.useMutation({mutationFn:n=>N(void 0,[n],void 0,(function*({token:n,isReset:i,submittedBack:r,canceledCallback:a,successBack:l,failedCallback:d}){if(!x||!e||!n)return;const c=Ma(n),h=i?new s(0):void 0,g=i?o.i18n._({id:"OfhWJH",message:"Reset"}):o.i18n._({id:"Z7ZXbT",message:"Approve"}),f=yield u.execute(`${g} ${c}`,{opcode:rs.Approval,token:n,contract:x,amt:h},{submittedBack:r,metadata:{[exports.MetadataFlag.approve]:!0}});if(f===es.Canceled&&(null==a||a()),f===es.Success&&l&&l(),f===es.Failed&&(null==d||d()),f!==es.Success)return f;yield m(),p.invalidateQueries({queryKey:Hi.getFetchTokenQuery(t,null==n?void 0:n.address,e,x).queryKey,refetchType:"all"})}))}),y=n.useCallback(((t,n,o,r)=>{var a,l;if(!t)return Is.Loading;const d=h.some((e=>{var n,i,o;return(null===(n=e.spec)||void 0===n?void 0:n.opcode)===rs.Approval&&(null===(i=e.spec)||void 0===i?void 0:i.token.address)===(null==t?void 0:t.address)&&(null===(o=e.spec)||void 0===o?void 0:o.contract)===x})),c=(null===(l=null===(a=f.variables)||void 0===a?void 0:a.token)||void 0===l?void 0:l.address)===(null==t?void 0:t.address)&&f.isPending,u=new s(null!=n?n:0);return e?!o||u.minus(null!=i?i:0).gt(o)||u.isZero()?Is.Unchecked:t&&t.address===g?Is.Sufficient:d||c?Is.Approving:r?u.minus(null!=i?i:0).gt(r)?Is.Insufficient:Is.Sufficient:Is.Loading:Is.Unchecked}),[e,g,x,i,h,f.isPending,null===(d=null===(l=f.variables)||void 0===l?void 0:l.token)||void 0===d?void 0:d.address]);return{getApprovalState:y,getPendingRest:n.useCallback(((e,t)=>("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)),[]),getBalanceState:n.useCallback(((t,n,o)=>e?o?t.minus(null!=i?i:0).gt(o)?As.Insufficient:As.Sufficient:As.Loading:As.Unchecked),[e,i]),submitApprove:n.useCallback(((e,t,n,i,o,r)=>N(void 0,void 0,void 0,(function*(){f.mutate({token:e,isReset:t,submittedBack:n,canceledCallback:i,successBack:o,failedCallback:r})}))),[f]),getMaxBalance:n.useCallback(((e,n)=>{const i=new s(0);return e&&void 0!==t&&n||i}),[t])}})({account:a,chainId:e.pool.chainId,contractAddress:e.pool.address}),M=n.useCallback(((t,n,i)=>{var o;if(!j)return{};const r={},a=n||m,l=i||E.data,d=j.findIndex((e=>e&&e.gt(0)));if(-1!==d){const n=j[d],i=e.pool.coins[d];let c;if(void 0!==t)c=t;else{const e=Object.values(a).find((e=>e&&"0"!==e&&""!==e));if(e)c=e;else{const e=null===(o=null==l?void 0:l.find((e=>{var t,n;return(null===(t=e.address)||void 0===t?void 0:t.toLowerCase())===(null===(n=i.address)||void 0===n?void 0:n.toLowerCase())})))||void 0===o?void 0:o.balance;c=e&&e.gt(0)?e.dp(i.decimals,s.ROUND_DOWN).toString():"1"}}const u=new s(c);r[i.address]=c,e.pool.coins.forEach(((e,t)=>{if(t!==d){const i=j[t];if(i&&i.gt(0)&&n.gt(0)){const t=i.div(n),o=u.multipliedBy(t).dp(e.decimals,s.ROUND_DOWN).toString();r[e.address]=o}else r[e.address]="0"}}))}return r}),[e.pool.coins,j,m,E.data]),R=c.useQuery(pf.calcTokenAmount(e.pool.chainId,e.pool.address,e.pool.coins.map((e=>{const t=m[e.address]||"0",n=new s(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,s.ROUND_DOWN).toString():"0"})),!0)),O=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(a&&R.data)try{const t=new Xh([{inputs:[{name:"_amounts",type:"uint256[]"},{name:"_min_mint_amount",type:"uint256"}],name:"add_liquidity",outputs:[{name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}]),n=e.pool.coins.map((e=>{const t=m[e.address]||"0",n=new s(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,s.ROUND_DOWN).toString():"0"})),i=R.data.multipliedBy(1-v).dp(0,s.ROUND_DOWN).toString(),o=t.encodeFunctionData("add_liquidity",[n,i]),a=()=>{u.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"curve"],refetchType:"all"}),u.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"token","getFetchTokenQuery"],refetchType:"all"})};return yield d.execute("add_liquidity",{opcode:rs.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[exports.MetadataFlag.curveAddLiquidity]:!0},submittedBack:()=>{a()},successBack:()=>{a(),T()}})}catch(e){console.error("curve add_liquidity",e)}}))}),P=n.useMemo((()=>{var n,i;if(!a||e.pool.chainId!==l)return z.jsx(Im,{chainId:e.pool.chainId,fullWidth:!0});if(E.loading)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Loading..."});if(!Object.values(m).some((e=>e&&"0"!==e)))return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Please enter amount"});for(const o of e.pool.coins){const e=m[o.address];if(!e||"0"===e)continue;const r=new s(e);if(!r.isFinite())return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Invalid input"});const a=E.data.find((e=>{var t,n;return(null===(t=e.address)||void 0===t?void 0:t.toLowerCase())===(null===(n=o.address)||void 0===n?void 0:n.toLowerCase())})),l=null!==(n=null==a?void 0:a.balance)&&void 0!==n?n:null,d=null!==(i=null==a?void 0:a.allowance)&&void 0!==i?i:null,c=A(r,o,l),u=S(o,d),p=I(o,r,l,d);if(c===As.Loading||p===Is.Loading)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Loading..."});if(c===As.Insufficient)return z.jsxs(t.Button,{fullWidth:!0,disabled:!0,children:["Insufficient ",o.symbol," balance"]});if(p===Is.Approving)return z.jsxs(t.Button,{fullWidth:!0,disabled:!0,children:[o.symbol," Approval Pending"]});if(p===Is.Insufficient)return z.jsxs(t.Button,{fullWidth:!0,onClick:()=>{L(o,u)},children:["Approve ",o.symbol]})}return R.isLoading||!R.data?z.jsx(t.Button,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Calculating..."}):R.data.lte(0)?z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Invalid input"}):z.jsx(t.Button,{fullWidth:!0,disabled:O.isPending,isLoading:O.isPending,onClick:()=>{O.mutate()},children:"Add"})}),[a,l,I,A,S,R.data,R.isLoading,O,e.pool.chainId,e.pool.coins,L,m,E.data,E.loading]);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pb:100,px:20,pt:16,display:"flex",flexDirection:"column",gap:16,[i.breakpoints.up("tablet")]:{pb:20}},children:[z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:4},children:e.pool.coins.map((e=>{var n;const o=null===(n=E.data.find((t=>{var n,i;return(null===(n=t.address)||void 0===n?void 0:n.toLowerCase())===(null===(i=e.address)||void 0===i?void 0:i.toLowerCase())})))||void 0===n?void 0:n.balance;return z.jsxs(t.Box,{sx:{px:20,py:12,display:"flex",alignItems:"center",gap:16,borderRadius:16,backgroundColor:i.palette.background.cardInput},children:[z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(sl,{width:24,height:24,address:e.address,chainId:e.chainId,noShowChain:!0,noBorder:!0,marginRight:0}),z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",color:i.palette.text.primary},children:e.symbol})]}),z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>{o&&((e,t,n)=>{if(!t)return;const i=t.dp(n,s.ROUND_DOWN).toString();B(e,i)})(e.address,o,e.decimals)},sx:{mt:4,typography:"h6",fontWeight:500,lineHeight:"16px",color:i.palette.text.secondary,"&:hover":{color:i.palette.text.primary}},children:["Balance: ",o?ir({input:o,decimals:e.decimals}):"-"]})]}),z.jsx(Ju,{value:m[e.address]||"",onChange:t=>{B(e.address,t)},decimals:e.decimals,typography:"h4",sx:{mt:0,"& input":{fontSize:24,typography:"h4",lineHeight:"33px",fontWeight:600,textAlign:"right",border:"none",outline:"none",padding:0,color:"text.primary","&::placeholder":{fontSize:24,typography:"h4",lineHeight:"33px",fontWeight:600,color:"text.disabled"}}}})]},e.symbol)}))}),z.jsxs(t.Box,{sx:{mt:-8,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8},children:[z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>{const e=!p;if(h(e),e&&j){const e=M(void 0,g.current,E.data);x(e)}},sx:{px:11,py:3,borderRadius:20,border:`1px solid ${p?i.palette.primary.main:i.palette.border.main}`,typography:"body2",fontWeight:500,lineHeight:"19px",color:p?i.palette.primary.contrastText:i.palette.text.primary,backgroundColor:p?i.palette.primary.main:"transparent","&:hover":{opacity:.8}},children:["Balanced proportion: ",p?"ON":"OFF"]}),z.jsx(wm,{value:f,onChange:y,sx:{width:"auto",display:"inline-flex",ml:0}})]}),z.jsx(yf,{})]}),z.jsx(ff,{children:P})]})};function Cf({disabled:e,selected:n,onClick:i,children:o,iconVisible:r}){const a=t.useTheme(),s=n?a.palette.success.main:a.palette.text.secondary;return z.jsxs(t.Box,{component:t.ButtonBase,disabled:e,onClick:i,sx:{flexGrow:1,flexShrink:1,flexBasis:"100%",display:"flex",alignItems:"center",gap:8},children:[r&&z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:n?z.jsxs(z.Fragment,{children:[z.jsx("rect",{x:"0.5",y:"1",width:"17",height:"17",rx:"8.5",stroke:s}),z.jsx("rect",{x:"4.5",y:"5",width:"9",height:"9",rx:"4.5",fill:s,stroke:s})]}):z.jsx("rect",{x:"0.5",y:"1",width:"17",height:"17",rx:"8.5",stroke:s})}),z.jsx(t.Box,{sx:{flexGrow:1,display:"flex",alignItems:"center",gap:8,typography:"body2",fontWeight:500,lineHeight:"19px",color:a.palette.text.primary},children:o})]})}const jf=({operateCurvePool:e})=>{const i=t.useTheme(),{account:o,chainId:a}=Pa(),l=us(),d=c.useQueryClient(),[u,p]=n.useState(""),[h,m]=n.useState("oneCoin"),[x,g]=n.useState(0),[f,y]=n.useState({}),{slipper:v,setSlipper:b,slipperValue:C,resetSlipper:j}=jm({address:e.pool.address}),{lpTokenBalance:w,userTokenBalances:k,lpTokenBalanceLoading:T}=vf({pool:e.pool,account:o}),B=n.useCallback((()=>{const t={};e.pool.coins.forEach((e=>{t[e.address]=""})),y(t)}),[e.pool.coins]);n.useEffect((()=>{B()}),[B]);const E=n.useMemo((()=>{const e=new s.BigNumber(u);return e.isFinite()?e:null}),[u]),I=c.useQuery(pf.calcWithdrawOneCoin(e.pool.chainId,e.pool.address,E?E.multipliedBy(10**e.pool.decimals).dp(0,s.BigNumber.ROUND_DOWN).toString():"0",x)),A=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(o&&I.data)try{const t=new Xh([{inputs:[{name:"_burn_amount",type:"uint256"},{name:"i",type:"int128"},{name:"_min_received",type:"uint256"}],name:"remove_liquidity_one_coin",outputs:[{name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}]),n=E?E.multipliedBy(10**e.pool.decimals).dp(0,s.BigNumber.ROUND_DOWN).toString():"0",i=I.data.multipliedBy(1-C).dp(0,s.BigNumber.ROUND_DOWN).toString(),o=t.encodeFunctionData("remove_liquidity_one_coin",[n,x,i]),a=()=>{d.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"curve"],refetchType:"all"}),d.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"token","getFetchTokenQuery"],refetchType:"all"})};return yield l.execute("remove_liquidity_one_coin",{opcode:rs.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[exports.MetadataFlag.curveRemoveLiquidityOneCoin]:!0},submittedBack:()=>{a()},successBack:()=>{a(),p("")}})}catch(e){console.error("curve remove_liquidity_one_coin",e)}}))}),S=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(o)try{const t=new Xh([{inputs:[{name:"_burn_amount",type:"uint256"},{name:"_min_amounts",type:"uint256[]"}],name:"remove_liquidity",outputs:[{name:"",type:"uint256[]"}],stateMutability:"nonpayable",type:"function"}]),n=E?E.multipliedBy(10**e.pool.decimals).dp(0,s.BigNumber.ROUND_DOWN).toString():"0",i=e.pool.coins.map(((e,t)=>(null==k?void 0:k[t])&&E&&w&&w.gt(0)?k[t].multipliedBy(E).div(w).multipliedBy(10**e.decimals).multipliedBy(1-C).dp(0,s.BigNumber.ROUND_DOWN).toString():"0")),o=t.encodeFunctionData("remove_liquidity",[n,i]),a=()=>{d.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"curve"],refetchType:"all"}),d.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"token","getFetchTokenQuery"],refetchType:"all"})};return yield l.execute("remove_liquidity",{opcode:rs.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[exports.MetadataFlag.curveRemoveLiquidity]:!0},submittedBack:()=>{a()},successBack:()=>{a(),p("")}})}catch(e){console.error("curve remove_liquidity",e)}}))}),L=c.useQuery(pf.calcTokenAmount(e.pool.chainId,e.pool.address,e.pool.coins.map((e=>{const t=f[e.address]||"0",n=new s.BigNumber(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,s.BigNumber.ROUND_DOWN).toString():"0"})),!1)),M=c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){if(o&&L.data)try{const t=new Xh([{inputs:[{name:"_amounts",type:"uint256[]"},{name:"_max_burn_amount",type:"uint256"}],name:"remove_liquidity_imbalance",outputs:[{name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"}]),n=e.pool.coins.map((e=>{const t=f[e.address]||"0",n=new s.BigNumber(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,s.BigNumber.ROUND_DOWN).toString():"0"})),i=L.data.multipliedBy(1+C).dp(0,s.BigNumber.ROUND_DOWN).toString(),o=t.encodeFunctionData("remove_liquidity_imbalance",[n,i]),a=()=>{d.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"curve"],refetchType:"all"}),d.invalidateQueries({queryKey:[r.CONTRACT_QUERY_KEY,"token","getFetchTokenQuery"],refetchType:"all"})};return yield l.execute("remove_liquidity_imbalance",{opcode:rs.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[exports.MetadataFlag.curveRemoveLiquidityImBalance]:!0},submittedBack:()=>{a()},successBack:()=>{a(),p(""),B()}})}catch(e){console.error("curve remove_liquidity_imbalance",e)}}))}),R=n.useMemo((()=>{if(!o||e.pool.chainId!==a)return z.jsx(Im,{chainId:e.pool.chainId,fullWidth:!0});if(!u||"0"===u)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Please enter amount"});const n=new s.BigNumber(u);if(!n.isFinite())return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Invalid input"});if(T)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Loading..."});if(!w||w.lte(0))return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"No LP token balance"});if(n.gt(w))return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Insufficient LP token balance"});if("oneCoin"===h)return I.isLoading||!I.data?z.jsx(t.Button,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Calculating..."}):I.data.lte(0)?z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Invalid input"}):z.jsx(t.Button,{fullWidth:!0,disabled:A.isPending,isLoading:A.isPending,onClick:()=>{A.mutate()},children:"Remove"});if("balanced"===h)return z.jsx(t.Button,{fullWidth:!0,disabled:S.isPending,isLoading:S.isPending,onClick:()=>{S.mutate()},children:"Remove"});if("custom"===h){if(!Object.values(f).some((e=>e&&"0"!==e)))return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Please enter amount"});for(const n of e.pool.coins){const e=f[n.address];if(!e||"0"===e)continue;if(!new s.BigNumber(e).isFinite())return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Invalid input"})}if(L.isLoading||!L.data)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Calculating..."});if(L.data.lte(0))return z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Invalid input"});const i=L.data.dividedBy(10**e.pool.decimals).dp(e.pool.decimals,s.BigNumber.ROUND_DOWN);return i.gt(n)?z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Insufficient input amount"}):i.gt(w)?z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:"Insufficient LP token balance"}):z.jsx(t.Button,{fullWidth:!0,disabled:M.isPending,isLoading:M.isPending,onClick:()=>{M.mutate()},children:"Remove"})}return null}),[o,e.pool.chainId,e.pool.decimals,e.pool.coins,a,u,T,w,h,I.isLoading,I.data,A,S,f,L.isLoading,L.data,M]);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pb:100,px:20,pt:16,display:"flex",flexDirection:"column",gap:16,[i.breakpoints.up("tablet")]:{pb:20}},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[z.jsxs(t.Box,{sx:{px:20,py:12,display:"flex",alignItems:"center",gap:16,borderRadius:16,backgroundColor:i.palette.background.cardInput},children:[z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",color:i.palette.text.primary},children:"LP Tokens"}),z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>{w&&p(w.dp(e.pool.decimals,s.BigNumber.ROUND_DOWN).toString())},sx:{mt:4,typography:"h6",fontWeight:500,lineHeight:"16px",color:i.palette.text.secondary,"&:hover":{color:i.palette.text.primary}},children:["Balance: ",w?ir({input:w,decimals:e.pool.decimals}):"-"]})]}),z.jsx(Ju,{value:u,onChange:e=>{p(e)},decimals:e.pool.decimals,typography:"h4",sx:{mt:0,"& input":{fontSize:24,typography:"h4",lineHeight:"33px",fontWeight:600,textAlign:"right",border:"none",outline:"none",padding:0,color:"text.primary","&::placeholder":{fontSize:24,typography:"h4",lineHeight:"33px",fontWeight:600,color:"text.disabled"}}}})]}),z.jsxs(t.Box,{sx:{p:12,display:"flex",flexDirection:"column",alignItems:"stretch",gap:20,borderRadius:8,border:`1px solid ${i.palette.border.main}`},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(Cf,{iconVisible:!0,disabled:!1,selected:"oneCoin"===h,onClick:()=>{m("oneCoin")},children:"One coin"}),z.jsx(Cf,{iconVisible:!0,disabled:!1,selected:"balanced"===h,onClick:()=>{m("balanced")},children:"Balanced"}),z.jsx(Cf,{iconVisible:!0,disabled:!1,selected:"custom"===h,onClick:()=>{m("custom")},children:"Custom"})]}),z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12},children:e.pool.coins.map(((e,n)=>{var o;return z.jsxs(Cf,{iconVisible:"oneCoin"===h||"balanced"===h,disabled:!1,selected:"oneCoin"!==h||x===n,onClick:()=>{"oneCoin"===h&&g(n)},children:[z.jsx(sl,{width:24,height:24,address:e.address,chainId:e.chainId,noShowChain:!0,noBorder:!0,marginRight:0}),z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",color:i.palette.text.primary},children:e.symbol}),"oneCoin"===h&&z.jsx(t.Box,{sx:{ml:"auto",typography:"body1",fontWeight:600,lineHeight:"22px",color:i.palette.text.primary},children:x===n?ir({input:null===(o=I.data)||void 0===o?void 0:o.div(10**e.decimals),decimals:e.decimals}):"0"}),"balanced"===h&&z.jsx(t.Box,{sx:{ml:"auto",typography:"body1",fontWeight:600,lineHeight:"22px",color:i.palette.text.primary},children:(null==k?void 0:k[n])&&E&&w&&w.gt(0)?ir({input:k[n].multipliedBy(E).div(w),decimals:e.decimals}):"-"}),"custom"===h&&z.jsx(t.Box,{sx:{ml:"auto"},children:z.jsx(Ju,{value:f[e.address]||"",onChange:t=>{var n,i;n=e.address,i=t,y((e=>Object.assign(Object.assign({},e),{[n]:i})))},decimals:e.decimals,sx:{mt:0,"& input":{fontSize:16,typography:"body1",lineHeight:"22px",fontWeight:600,textAlign:"right",border:`1px solid ${i.palette.border.main}`,borderRadius:8,outline:"none",padding:0,color:"text.primary",height:38,width:160,px:12,"&::placeholder":{fontSize:16,typography:"body1",lineHeight:"22px",fontWeight:600,color:"text.disabled"}}}})})]},e.address)}))})]}),z.jsx(wm,{value:v,onChange:b,sx:{}})]}),z.jsx(yf,{})]}),z.jsx(ff,{children:R})]})},wf=({onClose:e,poolDetailBtnVisible:i=!0,operateCurvePool:o})=>{const r=t.useTheme(),{account:a}=Pa(),[s,l]=n.useState(o.type),[d,c]=n.useState(o.type);d!==o.type&&(c(o.type),l(o.type));const{lpTokenBalance:u,userTokenBalances:p}=vf({pool:o.pool,account:a});return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{position:"relative",display:"flex",flexDirection:"column",gap:16,px:20,pt:20},children:[e&&z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid",borderColor:r.palette.border.main},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",pb:17},children:"Liquidity"}),z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,borderStyle:"solid",borderColor:"border.main",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:e,component:t.ButtonBase,children:z.jsx(t.Box,{component:oe.Error,sx:{width:16,height:16}})})]}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{px:20,py:12,borderTopLeftRadius:8,borderTopRightRadius:8,borderStyle:"solid",borderColor:"border.main",borderWidth:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,lineHeight:"19px",color:"text.primary"},children:o.pool.name}),z.jsx(lp,{address:o.pool.address,customChainId:o.pool.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"h6",color:"text.secondary"}})]}),i&&z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>{pm.getState().push({type:exports.PageType.CurvePoolDetail,params:{address:o.pool.address,chainId:o.pool.chainId}})},sx:{display:"flex",alignItems:"center",color:"text.secondary","&:hover":{color:"text.primary"}},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:500,lineHeight:"19px"},children:"details"}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:z.jsx("path",{d:"M7.49988 5L6.44238 6.0575L9.87738 9.5L6.44238 12.9425L7.49988 14L11.9999 9.5L7.49988 5Z",fill:"currentColor"})})]})]}),z.jsxs(t.Box,{sx:{px:20,py:12,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderStyle:"solid",borderColor:"border.main",borderWidth:1,borderTop:"none",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:12},children:[z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,lineHeight:"16px",color:"text.secondary"},children:"My LP tokens"}),z.jsx(t.Tooltip,{title:z.jsx(t.Box,{sx:{m:8,display:"flex",flexDirection:"column",gap:20,minWidth:216},children:null==p?void 0:p.map(((e,n)=>{const i=o.pool.coins[n];return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600,lineHeight:"14px"},children:[z.jsx(sl,{width:14,height:14,address:i.address,chainId:i.chainId,noShowChain:!0,noBorder:!0,marginRight:0}),z.jsx(t.Box,{children:i.symbol}),z.jsx(t.Box,{sx:{ml:"auto"},children:ir({input:e,decimals:i.decimals})})]},n)}))}),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:500,lineHeight:"22px",color:r.palette.text.primary},children:ir({input:u,decimals:o.pool.decimals})}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00016 1.33325C4.32016 1.33325 1.3335 4.31992 1.3335 7.99992C1.3335 11.6799 4.32016 14.6666 8.00016 14.6666C11.6802 14.6666 14.6668 11.6799 14.6668 7.99992C14.6668 4.31992 11.6802 1.33325 8.00016 1.33325ZM7.3335 4.66658V5.99992H8.66683V4.66658H7.3335ZM7.3335 7.33325V11.3333H8.66683V7.33325H7.3335ZM2.66683 7.99992C2.66683 10.9399 5.06016 13.3333 8.00016 13.3333C10.9402 13.3333 13.3335 10.9399 13.3335 7.99992C13.3335 5.05992 10.9402 2.66659 8.00016 2.66659C5.06016 2.66659 2.66683 5.05992 2.66683 7.99992Z",fill:r.palette.text.secondary})})]})})]})]})]}),z.jsxs(t.Tabs,{value:s,onChange:(e,t)=>{l(t)},children:[z.jsx(t.TabsButtonGroup,{tabs:[{key:df.Add,value:"Add"},{key:df.Remove,value:"Remove"}],variant:"inPaper",tabsListSx:{mt:16,mx:20}}),z.jsx(t.TabPanel,{value:df.Add,children:z.jsx(bf,{operateCurvePool:o})}),z.jsx(t.TabPanel,{value:df.Remove,children:z.jsx(jf,{operateCurvePool:o})})]})]})},kf=({poolDetailBtnVisible:e,operateCurvePool:i,setOperateCurvePool:o})=>{const{isMobile:r}=Xa(),a=n.useMemo((()=>{if(o)return()=>{o(null)}}),[o]);return r?z.jsx(el,{open:!0,onClose:a,scope:!r,modal:r,id:"curve-pool-operate",children:z.jsx(wf,{onClose:a,operateCurvePool:i,poolDetailBtnVisible:e})}):z.jsx(t.Box,{sx:{borderRadius:16,backgroundColor:"background.paper"},children:z.jsx(wf,{onClose:a,operateCurvePool:i,poolDetailBtnVisible:e})})};function Tf(e,t,n,i){return"CLASSICAL"===i&&e&&t&&e.isEqualTo(t)?e.times(`1e${n}`).minus(1).div(`1e${n}`):e}function Bf(e,t){return e.lte(0)?new s.BigNumber(0):t.div(e)}function Ef(e,t,n,i,o,r,a){const l=o&&function(e){return-1!==["0x9D9793e1E18CDEe6cf63818315D55244f73EC006","0x0D04146B2Fe5d267629a7eb341Fb4388DcdBD22f","0x3D9d765b0fbAf594F90F07bc42889473e6613C7A","0x3854BdcB1a7cBA4b1A5f9a7C8719e247Df4c42c6","0xA46F5eC3219f956d14C6816Ef9cf6CaBf13bdD77","0xB16f2Ff8E8499E31B257d2A02D25e8956Ae6aFe7"].findIndex((t=>t.toLowerCase()===e.toLowerCase()))}(o);let d,c;const u="CLASSICAL"===r?i:n;if(e&&t&&u&&void 0!==a){if(c=Bf(t,u),d=e.times(c),"CLASSICAL"===r&&l){if(!i)return[void 0,void 0];d.gt(i)&&n&&(c=Bf(t,s.BigNumber.min(i,n)),d=d.times(c))}return[c,d.dp(Number(a),s.BigNumber.ROUND_DOWN)]}return[void 0,void 0]}function If({account:e,pool:t}){var n,i;const{chainId:o,address:r,type:a,baseTokenDecimals:l,quoteTokenDecimals:d,baseLpTokenDecimals:u,quoteLpTokenDecimals:p}=null!=t?t:{},h=c.useQuery(ya.getTotalBaseLpQuery(o,r,a,u)),m=c.useQuery(ya.getTotalQuoteLpQuery(o,r,a,p)),x=c.useQuery(ya.getUserBaseLpQuery(o,r,a,u,e)),g=c.useQuery(ya.getUserQuoteLpQuery(o,r,a,p,e)),f=c.useQuery(ya.getReserveLpQuery(o,r,a,l,d)),y=c.useQuery(ya.getClassicalTargetQuery(o,r,a,l,d)),v=h.data,b=m.data,{baseReserve:C,quoteReserve:j}=f.data||{},w=null===(n=y.data)||void 0===n?void 0:n.baseTarget,k=null===(i=y.data)||void 0===i?void 0:i.quoteTarget,T="DPP"===a,B=T?C:Tf(x.data,v,u,a),E=T?j:Tf(g.data,b,p,a),[I,A]=T?[new s.BigNumber(1),C]:Ef(B,v,C,w,r,a,l);let S,L;if(j){let e=m.data;e||m.isLoading||m.error||!v||(e=v);const t=g.isFetched&&!g.error&&null===E?B:E;T?(S=new s.BigNumber(1),L=j):g.isLoading||g.error||y.error||t?[S,L]=Ef(t,e,j,k,r,a,d):L=new s.BigNumber(0)}const M=x.isLoading||g.isLoading,R=x.isError||g.isError,O=()=>{x.refetch(),g.refetch(),h.refetch(),m.refetch(),f.refetch(),y.refetch()},P=M||h.isLoading||m.isLoading||f.isLoading||y.isLoading,_=R||h.isError||m.isError||f.isError||y.isError,D="DVM"===(null==t?void 0:t.type)&&(!j||j.isZero());return{totalBaseLpBalance:v,totalQuoteLpBalance:b,baseReserve:C,quoteReserve:j,classicalBaseTarget:w,classicalQuoteTarget:k,userBaseLpBalance:B,userQuoteLpBalance:E,userBaseLpToTokenBalance:A,userQuoteLpToTokenBalance:L,baseLpToTokenProportion:I,quoteLpToTokenProportion:S,isSinglePool:D,userLpBalanceLoading:M,userLpToTokenBalanceLoading:P,userLpBalanceError:R,userLpToTokenBalanceError:_,userLpToTokenBalanceRefetch:O,error:_,loading:P,refetch:O}}const Af=new r.MiningApi({contractRequests:Wi});function Sf({chainId:e,address:n,showName:i,size:o,offset:r,rightContent:a}){const s=z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:r},children:[z.jsx(sl,{chainId:e,address:n,width:o,height:o,noShowChain:!0,marginRight:0}),i]});return a?z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s,a]}):s}function Lf({miningItem:e}){var t,n;const{account:i}=Pa(),o=null!==(t=null==e?void 0:e.rewardTokenInfos)&&void 0!==t?t:[],r=[],a=[];if(e){const t=e.version,s=null!==(n=e.miningContractAddress)&&void 0!==n?n:"";o.forEach((n=>{var o,l,d,c,u,p,h,m,x;const g={address:null!==(o=null==n?void 0:n.address)&&void 0!==o?o:"",decimals:null==n?void 0:n.decimals,symbol:null!==(l=null==n?void 0:n.symbol)&&void 0!==l?l:"",usdPrice:null!==(d=null==n?void 0:n.price)&&void 0!==d?d:""};if("3"===t)r.push(g),a.push(Af.getPendingRewardQuery(e.chainId,s,i,g.address,g.decimals,t));else switch(e.type){case"classical":r.push(g),a.push(Af.getPendingRewardQuery(e.chainId,s,i,null!==(u=null===(c=e.baseLpToken)||void 0===c?void 0:c.address)&&void 0!==u?u:"",g.decimals,"2")),r.push(g),a.push(Af.getPendingRewardQuery(e.chainId,s,i,null!==(h=null===(p=e.quoteLpToken)||void 0===p?void 0:p.address)&&void 0!==h?h:"",g.decimals,"2"));break;case"vdodo":case"single":r.push(g),a.push(Af.getPendingRewardQuery(e.chainId,s,i,null!==(x=null===(m=e.baseToken)||void 0===m?void 0:m.address)&&void 0!==x?x:"",g.decimals,"2"));break;default:throw new Error(`type: ${e.type} is not valid.`)}}))}return c.useQueries({queries:a,combine:e=>{let t=new s(0),n=new s(0);return{data:e.map(((e,i)=>{const o=r[i],a=e.data;if(a){t=a.plus(t);const e=null==o?void 0:o.usdPrice;e&&(n=n.plus(a.times(e)))}return Object.assign(Object.assign({},o),{amount:a})})),pending:e.some((e=>e.isPending)),error:e.some((e=>e.isError)),totalReward:t,totalRewardUSD:n,refetch:()=>{e.forEach((e=>e.refetch()))}}}})}function Mf({value:e,label:n,tokenList:i,loading:o}){const r=t.useTheme();return z.jsxs(t.Box,{sx:{flexGrow:0,flexShrink:1,width:"30%"},children:[z.jsx(t.Box,{sx:{typography:"h6",color:r.palette.text.secondary},children:n}),z.jsxs(t.Box,{sx:{mt:8,typography:"body1",fontWeight:600,color:r.palette.text.primary,display:"flex",alignItems:"center",gap:4},children:[z.jsx(t.LoadingSkeleton,{loading:o,loadingProps:{width:30},children:e?`$${ir({input:e,decimals:2})}`:"-"}),z.jsx(t.Tooltip,{placement:"top",title:z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8,width:190,color:"text.primary",fontWeight:600},children:i.map((e=>{var t;return z.jsx(Sf,{chainId:e.chainId,address:e.address,showName:null!==(t=e.symbolEle)&&void 0!==t?t:e.symbol,rightContent:e.amount,size:20,offset:6},e.address+e.chainId)}))}),children:z.jsx(t.Box,{component:t.ButtonBase,sx:{display:"flex",alignItems:"center",color:r.palette.text.secondary,width:16,height:16,"&:hover":{color:"text.primary"}},children:z.jsx(oe.DetailBorder,{})})})]})]})}function Rf({chainId:n,loading:i,miningItem:r,miningContractAddress:a,stakedTokenUSD:s,stakedTokenUSDLoading:l,miningTitle:d,associatedMineSectionShort:c,stakedTokenList:u,isEnded:p}){var h,m;const x=t.useTheme(),g=Lf({miningItem:r});return z.jsxs(t.Box,{sx:{backgroundColor:x.palette.background.paper,borderRadius:8,borderColor:x.palette.border.main,borderStyle:"solid",borderWidth:1,mb:20},children:[c?null:z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{py:12,px:20,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.LoadingSkeleton,{loading:i,loadingProps:{width:100},children:z.jsx(Pp,{width:24,tokens:u,gap:-6,chainId:n,mr:4,showChainLogo:!1})}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(t.Box,{sx:{color:x.palette.text.primary,typography:"body2",fontWeight:600,display:"flex",alignItems:"center"},children:null!=d?d:"-"}),p&&z.jsx(t.Box,{sx:{backgroundColor:x.palette.border.disabled,borderRadius:4,typography:"h6",fontWeight:500,px:8,color:x.palette.text.disabled},children:z.jsx(e.Trans,{id:"237hSL",message:"Ended"})})]}),z.jsx(lp,{size:"small",truncate:!0,address:null!=a?a:"",iconSpace:4,sx:{color:x.palette.text.secondary,typography:"h6"},customChainId:n})]})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:x.palette.text.secondary,typography:"h6",cursor:"pointer"},onClick:()=>{pm.getState().push({type:exports.PageType.MiningDetail,params:{address:a,chainId:n}})},children:[z.jsx(e.Trans,{id:"URmyfc",message:"Details"}),z.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:z.jsx("path",{d:"M7.5 4.5L6.4425 5.5575L9.8775 9L6.4425 12.4425L7.5 13.5L12 9L7.5 4.5Z",fill:"currentColor"})})]})]}),z.jsx(t.Box,{sx:{width:"100%",height:"1px",backgroundColor:x.palette.border.main}})]}),z.jsxs(t.Box,{sx:{py:12,px:20,display:"flex",alignItems:"center",gap:20},children:[z.jsx(Mf,{value:s,label:o.i18n._({id:"luOvdJ",message:"My Staked"}),tokenList:u,loading:i||l}),z.jsx(t.Box,{sx:{width:"1px",height:30,backgroundColor:x.palette.border.main,flexGrow:0,flexShrink:0}}),z.jsx(Mf,{value:g.totalRewardUSD,label:o.i18n._({id:"4cJ0hF",message:"Rewards"}),tokenList:null!==(m=null===(h=g.data)||void 0===h?void 0:h.map((e=>Object.assign(Object.assign({chainId:n},e),{name:e.symbol,amount:ir({input:e.amount,decimals:e.decimals})}))))&&void 0!==m?m:[],loading:g.pending||i})]})]})}const Of=({miningItem:e,successBack:t})=>{const{account:n}=Pa(),i=us();return c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){const a=yield N(void 0,void 0,void 0,(function*(){if(!n||!(null==e?void 0:e.miningContractAddress))return null;let t="";const i=yield r.MiningApi.encode.claimAllMining(e.miningContractAddress);if(i&&i.data)return i.value=0,i;throw t="invalid data",new Error(t)}));if(!a)return;return yield i.execute(o.i18n._({id:"hom7qf",message:"Claim"}),Object.assign({opcode:rs.TX},a),{metadata:{[exports.MetadataFlag.claimMining]:"1"},successBack:t})}))})};function Pf({miningItem:n}){const i=Lf({miningItem:n}),o=Of({miningItem:n,successBack:()=>{i.refetch()}});return z.jsx(Im,{includeButton:!0,fullWidth:!0,chainId:null==n?void 0:n.chainId,children:z.jsx(t.Button,{fullWidth:!0,isLoading:o.isPending,disabled:i.totalReward.isZero(),onClick:()=>{o.mutate()},children:o.isPending?z.jsx(e.Trans,{id:"KvG1xW",message:"Claiming"}):z.jsx(e.Trans,{id:"dUdltF",message:"One-Click Claim"})})})}function _f({tokenSymbol:e,goLpLink:n}){const i=t.useTheme();return z.jsxs(t.HoverAddUnderLine,{sx:{color:i.palette.text.secondary,typography:"h6",display:"flex",alignItems:"center"},component:t.ButtonBase,onClick:n,children:[o.i18n._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:e}}),z.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M5.83324 3.88867L5.01074 4.71117L7.68241 7.38867L5.01074 10.0662L5.83324 10.8887L9.33324 7.38867L5.83324 3.88867Z",fill:"currentColor"})})]})}function Df({miningItem:n,loading:i,sx:o}){const r=t.useTheme(),a=Lf({miningItem:n});return z.jsxs(t.Box,{sx:Object.assign({borderWidth:1,borderRadius:12},o),children:[z.jsxs(t.Box,{sx:{typography:"body1",color:r.palette.text.secondary,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12},children:[z.jsx(e.Trans,{id:"4cJ0hF",message:"Rewards"}),":",z.jsx(t.LoadingSkeleton,{loading:i||a.pending,loadingProps:{width:100},sx:{color:r.palette.text.primary,fontWeight:600},children:a.pending||a.error?"-":`$${ir({input:a.totalRewardUSD,decimals:2})}`})]}),z.jsxs(t.Box,{sx:{borderTopWidth:1,px:20,pt:4,pb:8},children:[(i||a.pending)&&z.jsx(t.LoadingSkeleton,{loading:i,loadingProps:{width:150}}),!i&&!a.pending&&!!n&&a.data.map((e=>z.jsxs(t.Box,{sx:{mt:16,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.address&&e.symbol&&z.jsx(Sf,{chainId:n.chainId,address:e.address,showName:e.symbol,size:24,offset:6}),z.jsxs(t.Box,{sx:{ml:"auto"},children:[z.jsx(t.Box,{sx:{typography:"h5",textAlign:"right"},children:ir({input:e.amount,decimals:e.decimals})}),z.jsx(t.Box,{sx:{mt:2,typography:"body2",color:r.palette.text.secondary,textAlign:"right"},children:e.usdPrice&&e.amount?`≈ $${ir({input:new s(e.amount).multipliedBy(e.usdPrice).dp(4,s.ROUND_DOWN),decimals:4})}`:"-"})]})]},e.address)))]})]})}function Nf({status:n,children:i,buttonProps:o}){return!n.needShowTokenStatusButton&&i?z.jsx(z.Fragment,{children:i}):n.insufficientBalance?z.jsx(t.Button,{fullWidth:!0,disabled:!0,...o,children:z.jsx(e.Trans,{id:"znqB4T",message:"Insufficient balance"})}):z.jsx(t.Button,{fullWidth:!0,isLoading:n.isApproving,onClick:n.submitApprove,disabled:n.insufficientBalance,...o,children:n.isApproving?z.jsx(e.Trans,{id:"j2Uisd",message:"Approving"}):n.approveTitle})}function Ff(e){if(!e&&"number"!=typeof e)return e;let t="";return t=s.isBigNumber(e)?e.toString(16):new s(e).toString(16),t.length%2?"0x0"+t:"0x"+t}function Uf(e){return Ff(sr(e,18))}const qf=({miningItem:e,amount:t,submittedBack:n,successBack:i,logBalance:a})=>{const{chainId:l,account:d}=Pa(),u=us(),p=r.basicTokenMap[l];return c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){const l=yield N(void 0,void 0,void 0,(function*(){var n,i;if(!(d&&e&&e.baseToken&&e.miningContractAddress))return null;let o="";const a=new s(t),l=Number(e.baseToken.decimals),c=yield r.MiningApi.encode.depositMining(e.miningContractAddress,a,l);if(!c||!c.data)throw o="invalid data",new Error(o);try{return t&&(null===(i=null===(n=e.baseLpToken)||void 0===n?void 0:n.address)||void 0===i?void 0:i.toLocaleLowerCase())===p.address.toLocaleLowerCase()?c.value=Uf(a):c.value=0,c}catch(e){throw console.error("2.0 sendTransaction error",e),o=`2.0 sendTransaction error; ERROR: ${e}`,new Error(o)}}));if(!l)return;return yield u.execute(o.i18n._({id:"JYKRJS",message:"Stake"}),Object.assign({opcode:rs.TX},l),{metadata:{[exports.MetadataFlag.stakeMining]:"1",logBalance:a},submittedBack:n,successBack:i})}))})};function Vf({goLpLink:n,amount:i,miningItem:r,balanceInfo:a,submittedBack:s,successBack:l,logBalance:d}){var c,u,p,h;const m=qf({miningItem:r,amount:i,submittedBack:s,successBack:l,logBalance:d}),x=r?`${null===(c=r.baseToken)||void 0===c?void 0:c.symbol}-${null===(u=r.quoteToken)||void 0===u?void 0:u.symbol} LP`:"",g=Ms(r?Oa(Object.assign(Object.assign({},r.baseLpToken),{symbol:x}),r.chainId):null,{contractAddress:null!==(p=null==r?void 0:r.miningContractAddress)&&void 0!==p?p:"",overrideBalance:a.userBaseLpBalance,amount:i});return n&&x&&(null===(h=a.userBaseLpBalance)||void 0===h?void 0:h.isZero())?z.jsx(t.Button,{fullWidth:!0,onClick:()=>n(),children:o.i18n._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:x}})}):z.jsx(Im,{includeButton:!0,fullWidth:!0,chainId:null==r?void 0:r.chainId,children:z.jsx(Nf,{status:g,children:z.jsx(t.Button,{fullWidth:!0,isLoading:m.isPending,disabled:!Number(i),onClick:()=>{m.mutate()},children:m.isPending?z.jsx(e.Trans,{id:"KsqhWn",message:"Staking"}):z.jsx(e.Trans,{id:"JYKRJS",message:"Stake"})})})})}const Wf=({miningItem:e,amount:t,submittedBack:n,successBack:i,logBalance:a})=>{const{account:l}=Pa(),d=us();return c.useMutation({mutationFn:()=>N(void 0,void 0,void 0,(function*(){const c=yield N(void 0,void 0,void 0,(function*(){if(!(l&&e&&e.baseToken&&e.miningContractAddress))return null;let n="";const i=new s(t),o=Number(e.baseToken.decimals),a=yield r.MiningApi.encode.withdrawMining(e.miningContractAddress,i,o);if(a&&a.data)return a.value=0,a;throw n="invalid data",new Error(n)}));if(!c)return;return yield d.execute(o.i18n._({id:"OFjZGo",message:"Unstake"}),Object.assign({opcode:rs.TX},c),{metadata:{[exports.MetadataFlag.unstakeMining]:"1",logBalance:a},submittedBack:n,successBack:i})}))})};function Hf({amount:n,miningItem:i,overrideBalance:o,submittedBack:r,successBack:a,logBalance:s}){var l,d;const c=Wf({miningItem:i,amount:n,submittedBack:r,successBack:a,logBalance:s}),u=i?`${null===(l=i.baseToken)||void 0===l?void 0:l.symbol}-${null===(d=i.quoteToken)||void 0===d?void 0:d.symbol} LP`:"",p=Ms(i?Oa(Object.assign(Object.assign({},i.baseLpToken),{symbol:u}),i.chainId):null,{overrideBalance:o,amount:n,skipQuery:!0});return z.jsx(Im,{includeButton:!0,fullWidth:!0,chainId:null==i?void 0:i.chainId,children:z.jsx(Nf,{status:p,children:z.jsx(t.Button,{fullWidth:!0,isLoading:c.isPending,disabled:!Number(n),onClick:()=>{c.mutate()},children:c.isPending?z.jsx(e.Trans,{id:"1gWStS",message:"Unstaking"}):z.jsx(e.Trans,{id:"OFjZGo",message:"Unstake"})})})})}function Zf(e){var{sx:n}=e,i=D(e,["sx"]);const o=t.useTheme();return z.jsx(t.Box,{sx:Object.assign({paddingTop:20,backgroundColor:o.palette.background.paper,position:"sticky",bottom:0},n),...i})}function zf({chainId:e,poolAddress:i,status:a,loading:l,operateType:d,setOperateType:u,miningItem:p,associatedMineSectionVisible:h,goLpLink:m}){var x,g,f,y,v,b,C,j,w,k,T,B,E,I,A,S,L;const M=t.useTheme(),{account:R}=Pa(),{miningContractAddress:O}=null!=p?p:{},P=Oa(null==p?void 0:p.baseToken,e),_=Oa(null==p?void 0:p.quoteToken,e),[D,N]=n.useState(""),[F,U]=n.useState(""),q=[{key:"stake",value:o.i18n._({id:"JYKRJS",message:"Stake"})},{key:"unstake",value:o.i18n._({id:"OFjZGo",message:"Unstake"})},{key:"claim",value:o.i18n._({id:"hom7qf",message:"Claim"})}],V=p&&P&&_&&["classical","lptoken"].includes(null!==(x=p.type)&&void 0!==x?x:"")?{chainId:e,address:i,type:"lptoken"===p.type?"DSP":"CLASSICAL",baseToken:P,quoteToken:_}:void 0,W=If({account:R,pool:p&&P&&_&&p.baseLpToken&&p.quoteLpToken&&["classical","lptoken"].includes(null!==(g=p.type)&&void 0!==g?g:"")?{chainId:e,address:i,type:"lptoken"===p.type?"DSP":"CLASSICAL",baseTokenDecimals:P.decimals,quoteTokenDecimals:_.decimals,baseLpTokenDecimals:null!==(f=p.baseLpToken.decimals)&&void 0!==f?f:18,quoteLpTokenDecimals:null!==(y=p.quoteLpToken.decimals)&&void 0!==y?y:18}:void 0}),H=c.useQuery(ya.getPMMStateQuery(null==V?void 0:V.chainId,null==V?void 0:V.address,null==V?void 0:V.type,null===(v=null==V?void 0:V.baseToken)||void 0===v?void 0:v.decimals,null===(b=null==V?void 0:V.quoteToken)||void 0===b?void 0:b.decimals)),Z=c.useQuery(Af.getLpStakedBalance(null==p?void 0:p.chainId,(null==p?void 0:p.miningContractAddress)||void 0,R,null!==(j=null===(C=null==p?void 0:p.baseLpToken)||void 0===C?void 0:C.address)&&void 0!==j?j:"",null===(w=null==p?void 0:p.baseToken)||void 0===w?void 0:w.decimals,null==p?void 0:p.version)),$=Z.isLoading||H.isLoading;let G,Q,Y;if(Z.data&&W.baseLpToTokenProportion&&W.quoteLpToTokenProportion&&!H.isLoading){const e=null===(k=null==p?void 0:p.baseToken)||void 0===k?void 0:k.price,t=null===(T=null==p?void 0:p.quoteToken)||void 0===T?void 0:T.price,n=null===(B=H.data)||void 0===B?void 0:B.midPrice;Q=Z.data.times(W.baseLpToTokenProportion),Y=Z.data.times(W.quoteLpToTokenProportion),n?t?G=Q.times(n).plus(Y).times(t):e&&(G=Y.times(n).plus(Q).times(e)):e&&t&&(G=Q.times(e).plus(Y.times(t)))}const X=P&&_?[Object.assign(Object.assign({},P),{amount:ir({input:Q,decimals:P.decimals})}),Object.assign(Object.assign({},_),{amount:ir({input:Y,decimals:_.decimals})})]:[],K=P&&_?`${P.symbol}-${_.symbol} LP`:"- LP",J=a===r.MiningStatusE.ended,ee=(null===(E=null==p?void 0:p.baseLpToken)||void 0===E?void 0:E.address)&&W.userBaseLpBalance?{[null===(I=null==p?void 0:p.baseLpToken)||void 0===I?void 0:I.address]:W.userBaseLpBalance.toString()}:{},te=()=>{W.refetch(),H.refetch(),Z.refetch()};return z.jsx(z.Fragment,{children:z.jsxs(t.Box,{sx:{paddingTop:20,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:M.palette.background.paper,px:20,paddingBottom:0,borderBottomLeftRadius:0,borderBottomRightRadius:0},children:[h&&z.jsx(Rf,{chainId:e,miningContractAddress:null!=O?O:"",loading:l,miningItem:p,stakedTokenUSD:G,stakedTokenUSDLoading:$,miningTitle:null!==(A=null==p?void 0:p.title)&&void 0!==A?A:"",stakedTokenList:X}),z.jsxs(t.Tabs,{value:d,onChange:(e,t)=>{u(t)},children:[z.jsx(t.TabsButtonGroup,{tabs:q,variant:"inPaper",tabsListSx:{mt:16}}),z.jsxs(t.TabPanel,{value:"stake",children:[z.jsxs(t.Box,{sx:{mt:20,borderColor:M.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:16},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(Pp,{width:X.length>1?20:28,tokens:X,chainId:e}),z.jsx(t.Box,{sx:{ml:8,typography:"body1",color:M.palette.text.primary,fontWeight:600},children:K})]}),!!m&&z.jsx(_f,{tokenSymbol:K,goLpLink:m})]}),z.jsx(kp,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:o.i18n._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:W.userBaseLpBalance||new s("-"),overrideBalanceLoading:W.loading,amt:D,canClickBalance:!0,onInputChange:e=>{N(e)},readOnly:J||l,token:P,checkLogBalance:ee,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),z.jsx(Zf,{children:z.jsx(Vf,{miningItem:p,balanceInfo:W,amount:D,goLpLink:m,submittedBack:()=>N(""),successBack:te,logBalance:ee})})]}),z.jsxs(t.TabPanel,{value:"unstake",children:[z.jsx(kp,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:o.i18n._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:Z.data||new s("-"),overrideBalanceLoading:Z.isLoading,amt:J?null!==(L=null===(S=Z.data)||void 0===S?void 0:S.toString())&&void 0!==L?L:"":F,onInputChange:e=>{U(e)},canClickBalance:!0,readOnly:J||l,token:P,checkLogBalance:ee,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),z.jsx(Zf,{children:z.jsx(Hf,{miningItem:p,overrideBalance:Z.data,amount:F,submittedBack:()=>U(""),successBack:te,logBalance:ee})})]}),z.jsxs(t.TabPanel,{value:"claim",children:[z.jsx(Df,{miningItem:p,loading:l,sx:{mt:20}}),z.jsx(Zf,{children:z.jsx(Pf,{miningItem:p})})]})]})]})})}function $f({chainId:e,account:t,poolAddress:i,goLpLink:o}){var a,s,l;const d=qa().getQuery(r.MiningApi.graphql.fetchMiningList,{where:{chainIds:[e],user:t,filterState:{address:i}}}),u=c.useQuery(Object.assign(Object.assign({},d),{enabled:!!i})),p=null===(l=null===(s=null===(a=u.data)||void 0===a?void 0:a.mining_list)||void 0===s?void 0:s.list)||void 0===l?void 0:l[0],{status:h}=function({miningItem:e}){var t,n;let i=r.MiningStatusE.active,o=[];if(null==e?void 0:e.rewardTokenInfos)if("classical"!==e.type){const a=r.MiningApi.utils.getMiningStatusByTimestamp({startTime:null!==(t=e.startTime)&&void 0!==t?t:"",endTime:null!==(n=e.endTime)&&void 0!==n?n:"",rewardTokenInfoList:e.rewardTokenInfos.map((e=>{var t,n;return{startTime:null!==(t=null==e?void 0:e.startTime)&&void 0!==t?t:"",endTime:null!==(n=null==e?void 0:e.endTime)&&void 0!==n?n:""}}))});i=a.status,o.push(a)}else if(e.rewardQuoteTokenInfos){o=[e.rewardTokenInfos,e.rewardQuoteTokenInfos].map((t=>{var n,i;return r.MiningApi.utils.getMiningStatusByTimestamp({startTime:null!==(n=e.startTime)&&void 0!==n?n:"",endTime:null!==(i=e.endTime)&&void 0!==i?i:"",rewardTokenInfoList:t.map((e=>{var t,n;return{startTime:null!==(t=null==e?void 0:e.startTime)&&void 0!==t?t:"",endTime:null!==(n=null==e?void 0:e.endTime)&&void 0!==n?n:""}}))})}));const[{status:t},{status:n}]=o;r.MiningStatusE.active,(t===r.MiningStatusE.upcoming&&n===r.MiningStatusE.upcoming||t===r.MiningStatusE.upcoming&&n===r.MiningStatusE.ended||t===r.MiningStatusE.ended&&n===r.MiningStatusE.upcoming)&&r.MiningStatusE.upcoming,t===r.MiningStatusE.ended&&n===r.MiningStatusE.ended&&r.MiningStatusE.ended}return{status:i,miningStatusList:o}}({miningItem:p}),[m,x]=n.useState(h===r.MiningStatusE.ended?"unstake":"stake");return z.jsx(zf,{chainId:e,loading:u.isLoading||u.isPending,operateType:m,setOperateType:x,associatedMineSectionVisible:!0,miningItem:p,status:h,goLpLink:o,poolAddress:i})}const Gf=()=>{const n=t.useTheme();return z.jsx(t.Tooltip,{placement:"top-end",leaveDelay:100,title:z.jsx(t.Box,{sx:{maxWidth:240,color:n.palette.warning.main,typography:"h6",fontWeight:500,"&>a":{textDecoration:"underline",color:n.palette.warning.main},"&>a:hover":{color:t.alpha(n.palette.warning.main,.5)}},children:z.jsx(e.Trans,{id:"QtgfjM",message:"The creator of the liquidity pool can adjust the liquidity distribution by modifying the market-making price parameters. <0>Learn more</0>",components:{0:z.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.dodoex.io/en/product/pmm-algorithm"})}})}),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:2,py:4,px:8,borderRadius:8,backgroundColor:t.alpha(n.palette.warning.main,.1),color:n.palette.warning.main,typography:"h6",fontWeight:500,lineHeight:"16px",cursor:"help"},children:[z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:z.jsx("path",{d:"M8.00008 10.6666C8.18897 10.6666 8.3473 10.6027 8.47508 10.4749C8.60286 10.3471 8.66675 10.1888 8.66675 9.99992C8.66675 9.81103 8.60286 9.6527 8.47508 9.52492C8.3473 9.39714 8.18897 9.33325 8.00008 9.33325C7.81119 9.33325 7.65286 9.39714 7.52508 9.52492C7.3973 9.6527 7.33341 9.81103 7.33341 9.99992C7.33341 10.1888 7.3973 10.3471 7.52508 10.4749C7.65286 10.6027 7.81119 10.6666 8.00008 10.6666ZM7.33341 7.99992H8.66675V4.66659H7.33341V7.99992ZM8.00008 14.6666C6.45564 14.2777 5.18064 13.3916 4.17508 12.0083C3.16953 10.6249 2.66675 9.08881 2.66675 7.39992V3.33325L8.00008 1.33325L13.3334 3.33325V7.39992C13.3334 9.08881 12.8306 10.6249 11.8251 12.0083C10.8195 13.3916 9.54453 14.2777 8.00008 14.6666ZM8.00008 13.2666C9.15564 12.8999 10.1112 12.1666 10.8667 11.0666C11.6223 9.96659 12.0001 8.74436 12.0001 7.39992V4.24992L8.00008 2.74992L4.00008 4.24992V7.39992C4.00008 8.74436 4.37786 9.96659 5.13341 11.0666C5.88897 12.1666 6.84453 12.8999 8.00008 13.2666Z",fill:"currentColor"})}),z.jsx(e.Trans,{id:"iDGO1l",message:"Disclaimer"})]})})};var Qf;function Yf(n){const{ConfirmComponent:i}=Q();if(i)return z.jsx(i,{...n});const{open:o,onClose:r,title:a,children:s,singleBtn:l,danger:d,singleBtnText:c,cancelText:u,confirmText:p,disabledConfirm:h,confirmLoading:m,isManualClose:x,onConfirm:g,modal:f}=n;return z.jsx(el,{open:o,onClose:r,title:a,modal:f,children:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1},children:[z.jsx(t.Box,{sx:{typography:"body2",color:a?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:s}),l?z.jsx(t.Box,{sx:{px:20},children:z.jsx(t.Button,{fullWidth:!0,variant:t.Button.Variant.outlined,danger:d,sx:{mt:32,mb:20},onClick:()=>{r()},children:c||z.jsx(e.Trans,{id:"DPfwMq",message:"Done"})})}):z.jsxs(t.Box,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[z.jsx(t.Button,{variant:t.Button.Variant.second,onClick:()=>{r()},children:u||z.jsx(e.Trans,{id:"dEgA5A",message:"Cancel"})}),z.jsx(t.Button,{sx:{ml:8},variant:t.Button.Variant.outlined,danger:d,disabled:h,isLoading:m,onClick:()=>{g&&g(),x||r()},children:p||z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})})]})]})})}function Xf(e){var{sx:n,label:i,children:o}=e,r=D(e,["sx","label","children"]);return z.jsxs(t.Box,{sx:Object.assign({display:"flex",justifyContent:"space-between"},n),...r,children:[z.jsx(t.Box,{children:i}),z.jsx(t.Box,{sx:{textAlign:"right",fontWeight:600},children:o})]})}function Kf({baseToken:e,quoteToken:i,midPrice:o,loading:r,disabled:a}){const l=t.useTheme(),[d,c]=n.useState(!1),u=d?null==i?void 0:i.symbol:null==e?void 0:e.symbol,p=d&&o?new s(1).div(o):o,h=d?null==e?void 0:e.symbol:null==i?void 0:i.symbol;return z.jsxs(t.LoadingSkeleton,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:r,loadingProps:{width:50},children:[e&&i?z.jsx(t.Tooltip,{title:`1 ${u} = ${p?nr({input:p}):""} ${h}`,children:o?z.jsx(t.Box,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${u} = ${p?nr({input:p}):""} ${h}`}):z.jsxs(t.Box,{children:[`1 ${u} = `,z.jsx(t.LoadingSkeleton,{loading:r,loadingProps:{width:30},component:"span",sx:{display:"inline-block"},children:"-"}),` ${h}`]})}):"-",z.jsx(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,backgroundColor:"background.paperDarkContrast",borderRadius:"50%"},!a&&{cursor:"pointer","&:hover":{backgroundColor:t.alpha(l.palette.text.primary,.04)}}),onClick:()=>{a||c((e=>!e))},children:z.jsx(t.Box,{component:oe.Switch,sx:{width:18,height:18}})})]})}function Jf({baseToken:n,quoteToken:i,loading:o,midPrice:r,shareOfPool:a,sx:s}){const l=t.useTheme(),d=!n||!i;return z.jsxs(t.Box,{sx:Object.assign({mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},s),children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[z.jsx(t.Box,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:z.jsx(e.Trans,{id:"kNeEXg",message:"Current Price"})}),z.jsx(Kf,{baseToken:n,quoteToken:i,loading:o,disabled:d,midPrice:r})]}),z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:l.spacing(1,0,0),borderColor:"border.main"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:z.jsx(e.Trans,{id:"SbBMxj",message:"Share of pool"})}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:z.jsx(t.LoadingSkeleton,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:o,loadingProps:{width:50},children:a||"-%"})})]})]})}function ey({open:n,onClose:i,slippage:o,baseToken:r,quoteToken:a,baseAmount:s,quoteAmount:l,lpAmount:d,fee:c,price:u,shareOfPool:p,pairAddress:h,createMutation:m}){const x=t.useTheme(),{isMobile:g}=Xa();return z.jsx(el,{modal:!0,open:n,onClose:i,title:d?z.jsx(e.Trans,{id:"AeZIvT",message:"You will receive"}):z.jsx(e.Trans,{id:"aM1tos",message:"You are creating a pool"}),children:z.jsxs(t.Box,{sx:{px:20,py:24,borderTopWidth:1,width:g?"100%":420},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h3"},children:[z.jsx(Pp,{width:24,height:24,tokens:r&&a?[r,a]:[],chainId:null==r?void 0:r.chainId}),d?ir({input:d,decimals:18}):""]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:x.palette.text.secondary,gap:4,fontWeight:600},children:[z.jsx(e.Trans,{id:"syToc5",message:"{0}/{1} Pool Tokens",values:{0:null==r?void 0:r.symbol,1:null==a?void 0:a.symbol}}),z.jsx(vg,{poolType:"AMM V2"})]})]}),z.jsx(t.Box,{sx:{mt:16,typography:"h6",color:"text.secondary",textAlign:"center"},children:z.jsx(e.Trans,{id:"rQ9c+8",message:"Output is estimated. If the price changes by more than {0} your transaction will revert.",values:{0:gr({input:o})}})}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,mt:20,p:20,typography:"body2",borderRadius:12,backgroundColor:x.palette.background.paperContrast},children:[z.jsx(Xf,{label:z.jsx(e.Trans,{id:"YG004A",message:"{0} deposited",values:{0:null==r?void 0:r.symbol}}),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[z.jsx(sl,{width:18,height:18,marginRight:4,token:r}),ir({input:s,decimals:null==r?void 0:r.decimals})]})}),z.jsx(Xf,{label:z.jsx(e.Trans,{id:"YG004A",message:"{0} deposited",values:{0:null==a?void 0:a.symbol}}),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{width:18,height:18,marginRight:4,token:a}),ir({input:l,decimals:null==a?void 0:a.decimals})]})}),z.jsx(Xf,{label:z.jsx(e.Trans,{id:"EU3wU4",message:"Fee tier"}),children:gr({input:c})}),z.jsx(Xf,{label:z.jsx(e.Trans,{id:"fqDzSu",message:"Rate"}),children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{width:18,height:18,marginRight:4,token:r}),z.jsx(Kf,{baseToken:r,quoteToken:a,midPrice:u})]})}),z.jsx(Xf,{label:z.jsx(e.Trans,{id:"SbBMxj",message:"Share of pool"}),children:p}),z.jsx(Xf,{label:z.jsx(e.Trans,{id:"ESQO1L",message:"Pool address"}),children:z.jsx(lp,{showCopy:!1,address:null!=h?h:"",customChainId:null==r?void 0:r.chainId,truncate:!0,iconSpace:4,sx:{typography:"body2"}})})]}),z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.big,sx:{mt:20},isLoading:m.isPending,onClick:()=>{m.mutate()},children:m.isPending?z.jsx(e.Trans,{id:"pwUZo2",message:"Confirming..."}):z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})})]})})}function ty(e,t,n){const i=new s(e),o=new s(t),r=i.minus(o),a=i.gt(o),l=i.lt(o);return{now:o,target:i,isChange:a||l,change:r,changeText:(l?"":"+")+nr({input:r,showDecimals:n>6?6:4,showPrecisionDecimals:2}),isAdd:a,isRemove:l}}!function(e){e[e.Liquidity=1]="Liquidity",e[e.Mining=2]="Mining"}(Qf||(Qf={}));const ny=e=>N(void 0,[e],void 0,(function*({chainId:e,account:t,srcPool:n,baseToken:i,quoteToken:o,baseAmount:a,quoteAmount:l,feeRate:d,initPrice:c,slippageCoefficient:u,ddl:p,SLIPPAGE_PROTECTION:h}){const m=e?r.basicTokenMap[e]:void 0,g=function({srcPool:e,newPool:t}){if(!e)return null;const{baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:r}=t,{baseReserve:a,quoteReserve:l}=e;return{baseAmount:ty(o,a,n.decimals),quoteAmount:ty(r,l,i.decimals),feeRate:ty(new s(t.feeRate).div(100),e.feeRate,6),initPrice:ty(t.initPrice,e.i,10),slippageCoefficient:ty(t.slippageCoefficient||"1",e.k,4)}}({srcPool:n,newPool:{baseToken:i,quoteToken:o,baseAmount:a,quoteAmount:l,feeRate:d,initPrice:c,slippageCoefficient:u}});if(!(t&&e&&g&&n))return null;const f=Number(i.decimals),y=Number(o.decimals);let v;const b=g.slippageCoefficient.target;try{const t=i.symbol===(null==m?void 0:m.symbol),a=o.symbol===(null==m?void 0:m.symbol);if(g.baseAmount.isRemove&&g.quoteAmount.isRemove){const t=[yield ya.getDPPOwnerProxyAddressQuery(e,n.address).queryFn(),g.feeRate.target.multipliedBy(1e4).toNumber(),g.initPrice.target.toNumber(),b.toNumber(),x.parseFixed(g.baseAmount.change.abs().dp(f,s.ROUND_FLOOR).toString(),f).toString(),x.parseFixed(g.quoteAmount.change.abs().dp(y,s.ROUND_FLOOR).toString(),y).toString(),x.parseFixed(g.baseAmount.now.multipliedBy(1-h).dp(f,s.ROUND_FLOOR).toString(),f).toString(),x.parseFixed(g.quoteAmount.now.multipliedBy(1-h).dp(y,s.ROUND_FLOOR).toString(),y).toString(),f,y];v=yield r.PoolApi.encode.removeDPPPoolABI(...t)}else{const t=[e,n.address,g.feeRate.target.multipliedBy(1e4).toNumber(),g.initPrice.target.toNumber(),b.toNumber(),g.baseAmount.isAdd?x.parseFixed(g.baseAmount.change.abs().dp(f,s.ROUND_FLOOR).toString(),f).toString():"0",g.quoteAmount.isAdd?x.parseFixed(g.quoteAmount.change.abs().dp(y,s.ROUND_FLOOR).toString(),y).toString():"0",g.baseAmount.isAdd?"0":x.parseFixed(g.baseAmount.change.abs().dp(f,s.ROUND_FLOOR).toString(),f).toString(),g.quoteAmount.isAdd?"0":x.parseFixed(g.quoteAmount.change.abs().dp(y,s.ROUND_FLOOR).toString(),y).toString(),x.parseFixed(g.baseAmount.now.multipliedBy(1-h).dp(f,s.ROUND_FLOOR).toString(),f).toString(),x.parseFixed(g.quoteAmount.now.multipliedBy(1-h).dp(y,s.ROUND_FLOOR).toString(),y).toString(),0,f,y,Math.ceil(Date.now()/1e3)+(null!=p?p:600)];v=yield r.PoolApi.encode.resetDPPPoolABI(...t)}return t&&g.baseAmount.isAdd&&(v.value=Uf(g.baseAmount.change)),a&&g.quoteAmount.isAdd&&(v.value=Uf(g.quoteAmount.change)),v}catch(e){throw console.error("2.0 resetDPPPool error",e),new Error(`2.0 resetDPPPool error;ERROR:${e}`)}})),iy=(e,t,n)=>t?e&&"0"!==e?n?t.minus(e).toString():t.plus(e).toString():t.toString():e;function oy({pool:e}){var t,n;const{account:i}=Pa(),o=us(),r=c.useQuery(ya.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(t=null==e?void 0:e.baseToken)||void 0===t?void 0:t.decimals,null===(n=null==e?void 0:e.quoteToken)||void 0===n?void 0:n.decimals)),a=c.useQuery(ya.getLPFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type)),{deadLine:l}=Q(),d=c.useMutation({mutationFn:t=>N(this,[t],void 0,(function*({baseAmount:t,quoteAmount:n,isRemove:d=!1,feeRate:c,initPrice:u,slippageCoefficient:p,txTitle:h,submittedBack:m}){var x;if(!e)throw new Error("pool is undefined");const g=a.data;if(!g)throw new Error("lpFeeRate is undefined");if(!r.data)throw new Error("pmmStateQuery.data is undefined");const{pmmParamsBG:f,baseReserve:y,quoteReserve:v}=r.data,b=f.i.toNumber(),C=f.k.toNumber(),j=yield ny({account:i,chainId:null==e?void 0:e.chainId,SLIPPAGE_PROTECTION:Cm,srcPool:Object.assign(Object.assign({},e),{baseReserve:y,quoteReserve:v,i:b,k:C,feeRate:g.times(100).toString()}),baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,baseAmount:iy(t,y?new s(y):void 0,d),quoteAmount:iy(n,v?new s(v):void 0,d),feeRate:null!=c?c:g.times(100).toString(),initPrice:null!=u?u:String(b),slippageCoefficient:null!=p?p:String(C),ddl:l});if(!j)throw new Error(`modify pool failed: ${e.address}`);return o.execute(h,Object.assign(Object.assign({opcode:rs.TX},j),{value:null!==(x=j.value)&&void 0!==x?x:0}),{metadata:{[d?exports.MetadataFlag.removeLiquidity:exports.MetadataFlag.addLiquidity]:!0},submittedBack:m})}))});return{modifyDPPMutation:d}}const ry=e=>{const{account:t,chainId:i}=Pa(),o=us(),a=c.useQueryClient(),{deadLine:l}=Q(),{modifyDPPMutation:d}=oy({pool:e}),u=c.useMutation({mutationFn:n=>N(void 0,void 0,void 0,(function*(){var d,c,u,p,h;if(!e||!t||!n.balanceInfo)return;const{isRemove:m,baseAmount:g,quoteAmount:f,slippageProtection:y,balanceInfo:v,SLIPPAGE_PROTECTION:b,submittedBack:C,successBack:j,txTitle:w,withdrawInfo:k}=n,T=!m,{address:B,type:E,baseToken:I,quoteToken:A}=e,S=I.address.toLowerCase(),L=A.address.toLowerCase(),M=r.basicTokenMap[i].address.toLowerCase(),R=M===S,O=M===L,P="DSP"===E||"GSP"===E,_="CLASSICAL"===E,D=B.toLocaleLowerCase(),N=new s(g),F=new s(f),U=N.isNaN(),q=F.isNaN(),V=+I.decimals,W=+A.decimals,H=I.symbol,Z=A.symbol,z=y;let $,G=U?"0":x.parseFixed(N.multipliedBy(1-z).dp(V,s.ROUND_FLOOR).toString(),V).toString(),Q=q?"0":x.parseFixed(F.multipliedBy(1-z).dp(W,s.ROUND_FLOOR).toString(),W).toString();try{if(T)if(_){const e=!U&&(null==v?void 0:v.classicalBaseTarget)&&v.classicalBaseTarget.gt(0)&&v.totalBaseLpBalance?x.parseFixed(N.multipliedBy(v.totalBaseLpBalance).multipliedBy(1-b).div(v.classicalBaseTarget).dp(V,s.ROUND_FLOOR).toString(),V).toString():"0",t=!q&&(null==v?void 0:v.classicalBaseTarget)&&v.totalQuoteLpBalance&&v.classicalQuoteTarget&&v.classicalQuoteTarget.gt(0)?x.parseFixed(F.multipliedBy(v.totalQuoteLpBalance).multipliedBy(1-b).div(v.classicalQuoteTarget).dp(W,s.ROUND_FLOOR).toString(),W).toString():"0",n=[i,D,U?"0":x.parseFixed(N.dp(V,s.ROUND_FLOOR).toString(),V).toString(),q?"0":x.parseFixed(F.dp(W,s.ROUND_FLOOR).toString(),W).toString(),e,t,R?1:O?2:0,Math.ceil(Date.now()/1e3)+(null!=l?l:600)];$=yield r.PoolApi.encode.addClassicalLiquidityABI(...n)}else{const e=[i,D,U?"0":x.parseFixed(N.dp(V,s.ROUND_FLOOR).toString(),V).toString(),q?"0":x.parseFixed(F.dp(W,s.ROUND_FLOOR).toString(),W).toString(),G,Q,R?1:O?2:0,Math.ceil(Date.now()/1e3)+(null!=l?l:600)];$=P?yield r.PoolApi.encode.addDSPLiquidityABI(...e):yield r.PoolApi.encode.addDVMLiquidityABI(...e)}else if(_){if("base"===(U?"quote":"base")){const e=N.dp(V,s.ROUND_FLOOR).toString(),t=k&&k.receiveAmountBg?x.parseFixed(k.receiveAmountBg.multipliedBy(1-z).dp(V,s.ROUND_FLOOR).toString(),V).toString():G,n=[i,D,x.parseFixed(e,V).toString(),t];$=yield r.PoolApi.encode.removeClassicalBaseABI(...n)}else{const e=F.dp(W,s.ROUND_FLOOR).toString(),t=k&&k.receiveAmountBg?x.parseFixed(k.receiveAmountBg.multipliedBy(1-z).dp(W,s.ROUND_FLOOR).toString(),W).toString():Q,n=[i,D,x.parseFixed(e,W).toString(),t];$=yield r.PoolApi.encode.removeClassicalQuoteABI(...n)}}else{if(!((null==v?void 0:v.baseReserve)&&v.quoteReserve&&v.totalBaseLpBalance&&v.userBaseLpBalance&&v.userBaseLpToTokenBalance))return;let e=new s(0);if(null===(d=v.totalBaseLpBalance)||void 0===d?void 0:d.lte(0))e=v.userBaseLpBalance||new s(0);else if(v.baseReserve.gt(0)&&v.quoteReserve.eq(0)){let t=N;N.gte(v.userBaseLpToTokenBalance)&&(t=v.userBaseLpToTokenBalance),e=t.multipliedBy(v.totalBaseLpBalance).div(v.baseReserve)}else if(v.baseReserve.gt(0)&&v.quoteReserve.gt(0)){let t=N;N.gte(v.userBaseLpToTokenBalance)&&(t=v.userBaseLpToTokenBalance);let n,i=F;if(v.userQuoteLpToTokenBalance&&F.gte(v.userQuoteLpToTokenBalance)&&(i=v.userQuoteLpToTokenBalance),i.gt(0)&&(null===(c=v.userQuoteLpToTokenBalance)||void 0===c?void 0:c.gt(0))&&(n=i.div(v.userQuoteLpToTokenBalance)),t.gt(0)&&v.userBaseLpToTokenBalance.gt(0)&&(n=t.div(v.userBaseLpToTokenBalance)),(null==n?void 0:n.gte(1))&&(n=new s(1)),!n)return;e=n.multipliedBy(v.userBaseLpBalance);const o=e.dp(V,s.ROUND_FLOOR).div(v.totalBaseLpBalance);t=o.multipliedBy(v.baseReserve).dp(V,s.ROUND_FLOOR),i=o.multipliedBy(v.quoteReserve).dp(W,s.ROUND_FLOOR),G=x.parseFixed(t.multipliedBy(1-z).dp(V,s.ROUND_FLOOR).toString(),V).toString(),Q=x.parseFixed(i.multipliedBy(1-z).dp(W,s.ROUND_FLOOR).toString(),W).toString()}const n=R||O,o=[i,D,t,e.isNaN()?"0":x.parseFixed(e.dp(V,s.ROUND_FLOOR).toString(),V).toString(),G,Q,n,Math.ceil(Date.now()/1e3)+(null!=l?l:600)];$=P?yield r.PoolApi.encode.removeDSPLiquidityABI(...o):yield r.PoolApi.encode.removeDVMLiquidityABI(...o)}}catch(e){throw new Error(`v2 addDVMLiquidity or removeDVMLiquidity or removeDSPLiquidity error: ${e}`)}if($&&$.data){const n={};if(g){const o=null===(u=a.getQueryData(Hi.getFetchTokenQuery(i,I.address,t).queryKey))||void 0===u?void 0:u.balance;o&&(n[I.address]=o.toString()),e.baseLpToken&&(null==v?void 0:v.userBaseLpBalance)&&(n[e.baseLpToken.id]=v.userBaseLpBalance.toString())}if(f){const o=null===(p=a.getQueryData(Hi.getFetchTokenQuery(i,A.address,t).queryKey))||void 0===p?void 0:p.balance;o&&(n[A.address]=o.toString()),e.quoteLpToken&&(null==v?void 0:v.userQuoteLpBalance)&&(n[e.quoteLpToken.id]=v.userQuoteLpBalance.toString())}try{let e;T&&R&&($.value=Uf(U?"0":N)),T&&O&&($.value=Uf(q?"0":F)),U||(e=`${N.toString()}${H}`),q||(e=U?`${F.toString()}${Z}`:`${e} & ${F.toString()}${Z}`);(yield o.execute(w,Object.assign(Object.assign({opcode:rs.TX},$),{value:null!==(h=$.value)&&void 0!==h?h:0}),{subtitle:e,metadata:{[T?exports.MetadataFlag.addLiquidity:exports.MetadataFlag.removeLiquidity]:!0,logBalance:n},submittedBack:C}))===es.Success&&j&&j()}catch(e){throw Error(`v2 sendTransaction error: ${e}`)}}}))}),p="DPP"===(null==e?void 0:e.type)?d:u;return n.useEffect((()=>{p.reset()}),[e]),{operateLiquidityMutation:p}};function ay({baseToken:t,quoteToken:n,baseAmount:i,quoteAmount:a,slippage:l,fee:d,isExists:u,successBack:h,submittedBack:m}){const x=us(),{account:g}=Pa();e.useLingui();const{deadLine:f}=Q();return c.useMutation({mutationFn:()=>N(this,void 0,void 0,(function*(){var e,c;if(!t||!n)throw new Error("token is undefined");if(!g)throw new Error("account is undefined");if(!d)throw new Error("fee is undefined");const y=t.chainId,v=r.basicTokenMap[y].address.toLowerCase(),b=p.getUniswapV2Router02ContractAddressByChainId(y),C=p.getUniswapV2Router02FixedFeeContractAddressByChainId(y),j=!b,w=b||C;if(!w)throw new Error("AMMV2 contract address is not valid.");let k="",T="0x0";const B=t.address.toLowerCase()===v,E=n.address.toLowerCase()===v,I=sr(i,t.decimals),A=sr(a,n.decimals),S=I.times(1-l).dp(0,s.ROUND_FLOOR),L=A.times(1-l).dp(0,s.ROUND_FLOOR),M=sr(d,4).toString(),R=Math.ceil(Date.now()/1e3)+(null!=f?f:600);try{if(B){const t=n.address,i=A.toString(),o=L.toString(),r=S.toString();T=null!==(e=Ff(I))&&void 0!==e?e:"",k=j?p.encodeUniswapV2Router02FixedFeeAddLiquidityETH(t,i,o,r,g,R):p.encodeUniswapV2Router02AddLiquidityETH(t,M,i,o,r,g,R)}else if(E){const e=t.address,n=I.toString(),i=S.toString(),o=L.toString();T=null!==(c=Ff(A))&&void 0!==c?c:"",k=j?p.encodeUniswapV2Router02FixedFeeAddLiquidityETH(e,n,i,o,g,R):p.encodeUniswapV2Router02AddLiquidityETH(e,M,n,i,o,g,R)}else k=j?p.encodeUniswapV2Router02FixedFeeAddLiquidity(t.address,n.address,I.toString(),A.toString(),S.toString(),L.toString(),g,R):p.encodeUniswapV2Router02AddLiquidity(t.address,n.address,M,I.toString(),A.toString(),S.toString(),L.toString(),g,R)}catch(e){throw console.error("encodeUniswapV2Router02AddLiquidity error",e),e}return yield x.execute(u?o.i18n._({id:"E6MqGy",message:"Add liquidity"}):o.i18n._({id:"L37FfW",message:"Create AMM V2 Position"}),{opcode:rs.TX,to:w,data:k,value:T},{metadata:{[u?exports.MetadataFlag.addLiquidityAMMV2Position:exports.MetadataFlag.createAMMV2Position]:!0},successBack:h,submittedBack:m})}))})}function sy({lqAndDodoCompareText:n,baseToken:i,quoteToken:r,midPrice:a}){const s=a?nr({input:a}):"";return z.jsxs(t.Box,{sx:{p:10,mb:12,backgroundColor:"background.paperDarkContrast",borderRadius:12},children:[z.jsxs(t.Box,{sx:{typography:"body2",display:"flex",alignItems:"center",justifyContent:"center",color:"error.main",fontWeight:600,mb:10,textAlign:"center"},children:[z.jsx(t.Box,{component:oe.Alarm,sx:{mr:4}}),o.i18n._({id:"YUyuNp",message:"{lqAndDodoCompareText} Price Difference",values:{lqAndDodoCompareText:n}})]}),z.jsxs(t.Box,{sx:{typography:"h6",color:"text.secondary",textAlign:"center"},children:[z.jsx(e.Trans,{id:"ZhEBp4",message:"Current liquidity pool token price"}),` 1 ${null==i?void 0:i.symbol} = ${s} ${null==r?void 0:r.symbol} ${o.i18n._({id:"wd1uHY",message:"differs from the price quoted by ZUNO by {lqAndDodoCompareText}",values:{lqAndDodoCompareText:n}})}`]})]})}function ly({chainId:n,baseTokenStatus:i,quoteTokenStatus:o,children:r}){const{runningRequests:a}=ps(),{account:s,chainId:l}=Pa();if(!s||n!==l)return z.jsx(Im,{chainId:n,fullWidth:!0});const d=a.some((e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t[exports.MetadataFlag.addLiquidity])||(null===(n=e.metadata)||void 0===n?void 0:n[exports.MetadataFlag.removeLiquidity])})),c=[];i.needShowTokenStatusButton&&c.push(z.jsx(Nf,{status:i})),o.needShowTokenStatusButton&&!i.isApproving&&c.push(z.jsx(Nf,{status:o}));const u=c.length;return 2===u?z.jsx(t.Box,{sx:{display:"flex","& > button":{flex:1,"&:last-child":{ml:8}}},children:c.map((e=>e))}):1===u?c[0]:d?z.jsx(t.Button,{fullWidth:!0,disabled:!0,isLoading:!0,children:z.jsx(e.Trans,{id:"UbRKMZ",message:"Pending"})}):z.jsx(z.Fragment,{children:r})}function dy({pool:i,addPortion:o,midPrice:a,shareOfPool:l}){var d,c,u,p,h,m;const x=t.useTheme(),[g,f]=n.useState(!1);let y="";if(o&&a){const e=new s(1).div(o.plus(1)),t=new s(o).div(o.plus(1)),n=e.times(a),r=n.plus(t);y=o?`${gr({input:n.div(r)})} ${null===(d=null==i?void 0:i.baseToken)||void 0===d?void 0:d.symbol} + ${gr({input:t.div(r)})} ${null===(c=null==i?void 0:i.quoteToken)||void 0===c?void 0:c.symbol}`:""}const v=g?null===(u=null==i?void 0:i.quoteToken)||void 0===u?void 0:u.symbol:null===(p=null==i?void 0:i.baseToken)||void 0===p?void 0:p.symbol,b=g&&a?new s(1).div(a):a,C=g?null===(h=null==i?void 0:i.baseToken)||void 0===h?void 0:h.symbol:null===(m=null==i?void 0:i.quoteToken)||void 0===m?void 0:m.symbol;return z.jsxs(t.Box,{sx:{mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[z.jsx(t.Box,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:z.jsx(e.Trans,{id:"kNeEXg",message:"Current Price"})}),z.jsxs(t.LoadingSkeleton,{sx:{display:"flex",alignItems:"center",fontWeight:600,ml:8,overflow:"hidden"},loading:!i,loadingProps:{width:50},children:[z.jsx(t.Tooltip,{title:`1 ${v} = ${b?nr({input:b}):""} ${C}`,children:a?z.jsx(t.Box,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${v} = ${b?nr({input:b}):""} ${C}`}):z.jsxs(t.Box,{children:[`1 ${v} = `,z.jsx(t.LoadingSkeleton,{loading:!0,loadingProps:{width:30},component:"span",sx:{display:"inline-block"}}),` ${C}`]})}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,cursor:"pointer",backgroundColor:"background.paperDarkContrast",borderRadius:"50%","&:hover":{backgroundColor:t.alpha(x.palette.text.primary,.04)}},onClick:()=>f((e=>!e)),children:z.jsx(t.Box,{component:oe.Switch,sx:{width:18,height:18}})})]})]}),"AMMV2"===(null==i?void 0:i.type)?z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:x.spacing(1,0,0),borderColor:"border.main"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:z.jsx(e.Trans,{id:"NEQTCn",message:"Share Of Pool"})}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:l})]}):z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:x.spacing(1,0,0),borderColor:"border.main"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:[z.jsx(e.Trans,{id:"22Xs8M",message:"Deposit Ratio"}),z.jsx(t.QuestionTooltip,{ml:4,title:z.jsx(e.Trans,{id:"I0yi1d",message:"Deposit ratio is determined by the current assets ratio in the pool. The ratio does not represent the exchange price"})})]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:i&&r.PoolApi.utils.singleSideLp(i.type)?z.jsx(e.Trans,{id:"Kb3KaW",message:"Any Ratio"}):z.jsx(z.Fragment,{children:z.jsx(t.Tooltip,{title:y,children:z.jsx(t.Box,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:y})})})})]})]})}function cy({baseToken:e,quoteToken:t}){const{toFiatPrice:n,fromFiatPrice:i}=xs({fromToken:null!=e?e:null,toToken:null!=t?t:null});return function({fromToken:e,toToken:t,fromFiatPrice:n,toFiatPrice:i,reverse:o,showDecimals:r=1}){const a={comparePrice:null,comparePriceText:"",loading:!0};return e&&t&&n&&i?(o?(a.loading=!1,a.comparePrice=i.div(n),a.comparePriceText=`1 ${Ma(t)} = ${nr({input:a.comparePrice,showDecimals:r})} ${Ma(e)}`):(a.loading=!1,a.comparePrice=n.div(i),a.comparePriceText=`1 ${Ma(e)} = ${nr({input:a.comparePrice,showDecimals:r})} ${Ma(t)}`),a):a}({fromToken:e,toToken:t,fromFiatPrice:i?new s(i):void 0,toFiatPrice:n?new s(n):void 0})}const uy=(e,t,i)=>{const{comparePrice:o}=cy({baseToken:e,quoteToken:t}),r=n.useMemo((()=>{if(!(i&&o&&o.toNumber()&&i.toNumber()))return 0;const e=o.minus(i);return Math.abs(e.div(o).toNumber())}),[i,o]),a=n.useMemo((()=>`${mr(new s(r).times(100))}%`),[r]);return{lqAndDodoCompare:r,lqAndDodoCompareText:a,midPrice:i,isShowCompare:r>.01,isWarnCompare:r>.03}};function py({pool:e,baseAmount:t,quoteAmount:i}){const[o,a,l,d,u,p]=n.useMemo((()=>{var t,n;const{baseToken:i,quoteToken:o}=e||{};let a=!1;if(!i||!o)return[void 0,void 0,void 0,void 0,void 0,a];const s=i.chainId,l=r.basicTokenMap[s],d=(null===(t=l.address)||void 0===t?void 0:t.toLowerCase())===i.address.toLowerCase(),c=(null===(n=l.address)||void 0===n?void 0:n.toLowerCase())===o.address.toLowerCase(),u=d?l.wrappedTokenAddress:i.address,p=c?l.wrappedTokenAddress:o.address,h=new L.Token(i.chainId,u,i.decimals,i.symbol,i.name),m=new L.Token(o.chainId,p,o.decimals,o.symbol,o.name);a=!h.sortsBefore(m);const[x,g]=a?[m,h]:[h,m];return[s,null==e?void 0:e.type,null==e?void 0:e.address,x,g,a]}),[e]),h=ya.getReserveLpQuery(o,l,a,null==d?void 0:d.decimals,null==u?void 0:u.decimals),m="AMMV2"===a,x=c.useQuery(Object.assign(Object.assign({},h),{enabled:!!h.enabled&&m})),g=ya.getTotalBaseLpQuery(o,l,a,18),f=c.useQuery(Object.assign(Object.assign({},g),{enabled:!!g.enabled&&m})),{account:y}=Pa(),v=ya.getUserBaseLpQuery(o,l,a,18,y),b=c.useQuery(Object.assign(Object.assign({},v),{enabled:!!v.enabled&&m})),C=n.useMemo((()=>x.isFetched&&!!x.data&&f.isFetched&&!!f.data),[x.isFetched,x.data,f.isFetched,f.data]),[j,w]=n.useMemo((()=>{var e;if(!d||!u||!1===C)return[null,null];const{baseReserve:t,quoteReserve:n}=null!==(e=x.data)&&void 0!==e?e:{baseReserve:0,quoteReserve:0},i=L.CurrencyAmount.fromRawAmount(d,sr(t,d.decimals).toString()),o=L.CurrencyAmount.fromRawAmount(u,sr(n,u.decimals).toString());let r=i,a=o;p&&(r=o,a=i);const s=new M.Pair(r,a);if(r.equalTo(0)||a.equalTo(0))return[s,null];const l=a.divide(r);return[s,new L.Price(r.currency,a.currency,l.denominator,l.numerator)]}),[d,u,x.data,p]),[k,T]=n.useMemo((()=>C?w?[new s(w.toSignificant()),new s(w.invert().toSignificant())]:[void 0,void 0]:t&&i?[new s(i).div(t),new s(t).div(i)]:[void 0,void 0]),[w,C,t,i]),B=f.data,E=C?f.data&&d?sr(f.data,18).toString():"":"0";let I,A;const S=p?u:d,R=p?d:u;if((null==j?void 0:j.liquidityToken)&&E&&B&&S&&R){const e=L.CurrencyAmount.fromRawAmount(null==j?void 0:j.liquidityToken,E);if(void 0!==t&&void 0!==i){if(Number(t)&&Number(i)){const n=L.CurrencyAmount.fromRawAmount(S,sr(t,S.decimals).toString()),o=L.CurrencyAmount.fromRawAmount(R,sr(i,R.decimals).toString()),r=null==j?void 0:j.getLiquidityMinted(e,n,o);A=lr(r.quotient.toString(),18),I=A.div(B.plus(A)).times(100)}}else A=b.data||void 0,A&&(I=A.div(B).times(100))}else C||(I=new s(100));let O="-";return(null==e?void 0:e.baseToken)&&e.quoteToken&&(O=I?`${nr({input:I,showDecimals:2,roundingMode:s.ROUND_HALF_UP})}%`:"0%"),{isRearTokenA:p,pair:j,price:k,invertedPrice:T,reserveQuery:x,totalBaseLpQuery:f,liquidityMinted:A,poolTokenPercentage:I,shareOfPool:O,isExists:C}}function hy({pool:e,maxBaseAmount:t,maxQuoteAmount:i,isRemove:o}){var a,l,d;const[u,p]=n.useState(""),[h,m]=n.useState(""),x=!e||"AMMV2"!==e.type&&"AMMV3"!==e.type,g=c.useQuery(ya.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(a=null==e?void 0:e.baseToken)||void 0===a?void 0:a.decimals,null===(l=null==e?void 0:e.quoteToken)||void 0===l?void 0:l.decimals)),f=()=>{p(""),m("")},y=null==e?void 0:e.type,v=py({pool:e,baseAmount:u,quoteAmount:h});let b=null===(d=g.data)||void 0===d?void 0:d.midPrice,C=new s(NaN),j=!1,w=!1;const k=g.data;if(e)if(k){const t=k.pmmParamsBG.i,n=k.pmmParamsBG.b,i=k.pmmParamsBG.q;w=("DSP"===e.type||"GSP"===e.type)&&(i.eq(0)||n.eq(0)),j="DVM"===e.type&&new s(i).eq(0),C=w?t:j?s(1):i.div(n)}else"AMMV2"===y&&(b=v.isRearTokenA?v.invertedPrice:v.price,C=b||new s(1));const T=n.useRef(C);if(!e||C.isNaN())return{baseAmount:u,quoteAmount:h,handleChangeBaseAmount:()=>{},handleChangeQuoteAmount:()=>{},reset:f};const B=!j&&!r.PoolApi.utils.singleSideLp(e.type),E=e.baseToken.decimals,I=e.quoteToken.decimals,A=e=>{if(e){let n=C.multipliedBy(e).dp(I).toString();i&&o&&(i.lte(n)||(null==t?void 0:t.lte(0)))&&(n=i.toString()),m(n)}else m(e)};!B||T.current&&C.isEqualTo(T.current)||(T.current=C,A(u));let S=!1;S=!!e&&r.PoolApi.utils.singleSideLp(e.type)?!u&&!h:j?!u:!u||!h;const L=x?g:v.reserveQuery;return{baseAmount:u,quoteAmount:h,handleChangeBaseAmount:e=>{let t=ar(e,E);null===t&&(t=u),p(t),B&&A(t)},handleChangeQuoteAmount:e=>{let n=ar(e,I);null===n&&(n=h),m(n),B&&(e=>{if(e){let n=new s(e).div(C).dp(E).toString();t&&o&&(t.lte(n)||(null==i?void 0:i.lte(0)))&&(n=t.toString()),p(n)}else p(e)})(n)},reset:f,addPortion:C,amountLoading:L.isLoading,amountError:L.isError,amountRefetch:L.refetch,amountCheckedDisabled:S,midPrice:b,uniV2Pair:v}}function my({submittedBack:e,onlyShowSide:i,pool:a,balanceInfo:s}){var l,d,u,h,m,x;const g=t.useTheme(),{isMobile:f}=Xa(),{account:y}=Pa(),{baseAmount:v,quoteAmount:b,handleChangeBaseAmount:C,handleChangeQuoteAmount:j,addPortion:w,midPrice:k,amountLoading:T,amountCheckedDisabled:B,uniV2Pair:E,reset:I}=hy({pool:a}),A=c.useQuery(ya.getFeeRateQuery(null==a?void 0:a.chainId,null==a?void 0:a.address,null==a?void 0:a.type,y)),S=null===(m=null===(d=null===(l=A.data)||void 0===l?void 0:l.mtFeeRate)||void 0===d?void 0:d.plus(null!==(h=null===(u=A.data)||void 0===u?void 0:u.lpFeeRate)&&void 0!==h?h:0))||void 0===m?void 0:m.toNumber(),L="AMMV2"===(null==a?void 0:a.type),[M,R]=n.useState(!1),{slipper:O,setSlipper:P,slipperValue:_,resetSlipper:D}=jm({address:null==a?void 0:a.address,type:null==a?void 0:a.type}),N=qm(a);n.useEffect((()=>{(null==a?void 0:a.address)!==(null==N?void 0:N.address)&&(I(),D())}),[a]);const F=r.PoolApi.utils.canOperateLiquidity(null==a?void 0:a.type,void 0,null==a?void 0:a.creator,y),[U,q]=n.useState(!1),{isShowCompare:V,lqAndDodoCompareText:W,isWarnCompare:H}=uy(null==a?void 0:a.baseToken,null==a?void 0:a.quoteToken,k),Z=L&&a.chainId?p.getUniswapV2Router02ContractAddressByChainId(a.chainId)||p.getUniswapV2Router02FixedFeeContractAddressByChainId(a.chainId):void 0,$=Ms(null==a?void 0:a.baseToken,{amount:v,contractAddress:Z}),G=Ms(null==a?void 0:a.quoteToken,{amount:b,contractAddress:Z}),Q=$.insufficientBalance||G.insufficientBalance,{isSinglePool:Y}=s,X=!a||Q||!k||!!s.loading||!!s.error||B||A.isLoading;let K=L?o.i18n._({id:"bwSQI0",message:"Supply"}):o.i18n._({id:"m16xKo",message:"Add"});Q&&(K=o.i18n._({id:"znqB4T",message:"Insufficient balance"}));const J=()=>{I(),D(),e&&e()},{operateLiquidityMutation:ee}=ry(a),te=()=>{L?R(!0):ee.mutate({txTitle:o.i18n._({id:"OBdohg",message:"Add Liquidity"}),isRemove:!1,baseAmount:v,quoteAmount:b,slippageProtection:_,balanceInfo:s,SLIPPAGE_PROTECTION:Cm,submittedBack:J})},ne=ay({baseToken:null==a?void 0:a.baseToken,quoteToken:null==a?void 0:a.quoteToken,baseAmount:v,quoteAmount:b,fee:S,isExists:!0,slippage:_,submittedBack:()=>{J(),R(!1)}});return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pt:20,pb:18,px:20},children:["quote"===i?"":z.jsx(kp,{amt:v,token:null==a?void 0:a.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:C,readOnly:s.loading||!F,sx:{backgroundColor:"background.cardInput",padding:g.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"}}),i?"":z.jsx(jp,{}),"base"===i?"":z.jsx(kp,{amt:b,token:null==a?void 0:a.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:j,readOnly:s.loading||!F||Y,sx:{backgroundColor:"background.cardInput",padding:g.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"}}),z.jsxs(t.LoadingSkeleton,{loading:s.loading||T,sx:{mt:8},children:[z.jsx(wm,{value:O,onChange:P,disabled:!F,type:null==a?void 0:a.type}),z.jsx(dy,{pool:a,addPortion:w,midPrice:k,shareOfPool:null==E?void 0:E.shareOfPool})]})]}),z.jsxs(t.Box,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[V&&z.jsx(sy,{baseToken:null==a?void 0:a.baseToken,quoteToken:null==a?void 0:a.quoteToken,lqAndDodoCompareText:W,midPrice:k}),a?z.jsx(ly,{chainId:a.chainId,baseTokenStatus:$,quoteTokenStatus:G,children:z.jsx(t.Button,{fullWidth:!0,disabled:X,danger:H,isLoading:ee.isPending||ne.isPending,onClick:()=>{X||(H?q(!0):te())},children:K})}):z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:K})]}),z.jsx(Yf,{open:U,onClose:()=>q(!1),title:o.i18n._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:te,modal:!0,children:z.jsxs(t.Box,{children:[z.jsx(t.Box,{children:o.i18n._({id:"tecieV",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on ZUNO.",values:{lqAndDodoCompareText:W}})}),z.jsx(t.Box,{children:o.i18n._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),z.jsx(Eu,{message:null===(x=ee.error)||void 0===x?void 0:x.message,onClose:()=>ee.reset(),isDialogModal:f}),L&&!!a&&z.jsx(ey,{open:M,onClose:()=>R(!1),slippage:_,baseToken:a.baseToken,baseAmount:v,quoteToken:a.quoteToken,quoteAmount:b,fee:S,price:null==E?void 0:E.price,lpAmount:null==E?void 0:E.liquidityMinted,shareOfPool:null==E?void 0:E.shareOfPool,pairAddress:a.address,createMutation:ne})]})}function xy({chainId:e,address:n,token:i,quoteToken:o,lpBalance:r,lpBalanceLoading:a,balanceNeedUpdateLoading:s,tokenBalanceList:l}){var d;const c=o?`${null==i?void 0:i.symbol}/${o.symbol}`:null!==(d=null==i?void 0:i.symbol)&&void 0!==d?d:"";return z.jsxs(t.Box,{sx:{display:"flex"},children:[i?z.jsx(t.Box,{sx:{position:"relative",top:2},children:o?z.jsx(Pp,{tokens:[i,o],chainId:e,width:18,mr:4}):z.jsx(sl,{address:i.address,width:18,height:18,chainId:e,url:i.logoURI,marginRight:4,noShowChain:!0})}):z.jsx(t.Skeleton,{width:32,height:32,sx:{mr:4}}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",wordBreak:"break-all"},children:[z.jsx(t.LoadingSkeleton,{loading:a,loadingProps:{width:30},sx:{display:"flex",alignItems:"center",mr:2},children:s?z.jsx(t.RotatingIcon,{}):nr({input:r||"-"})}),`${c} LP`,!!(null==l?void 0:l.length)&&z.jsx(t.Tooltip,{title:z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:l.map((e=>z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",fontWeight:600,color:"text.primary"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{address:e.token.address,chainId:e.token.chainId,width:14,height:14,url:e.token.logoURI,marginRight:4,noShowChain:!0}),e.token.symbol]}),z.jsxs(t.LoadingSkeleton,{loading:e.loading,children:[!e.balance||e.balance.isZero()||e.balance.isNaN()?"":"~",e.balance?nr({input:e.balance}):""]})]},e.token.address)))}),sx:{padding:20,width:256},children:z.jsx(t.HoverOpacity,{component:oe.DetailBorder,sx:{ml:4,width:16,height:16}})}),z.jsx(t.Box,{component:"a",target:"_blank",rel:"noopener noreferrer",href:e?Ia(e,n,"address"):"",sx:{display:"inline-flex",height:14},children:z.jsx(t.HoverOpacity,{component:oe.ArrowTopRightBorder,sx:{ml:4,width:14,height:14}})})]})]},n)}function gy({loading:n,hidePoolInfo:i,pool:o,balanceInfo:a}){var l,d,u,p,h,m,x;const g=t.useTheme(),f=n||!o,y=!!o&&r.PoolApi.utils.singleSideLp(o.type),{isTokenLoading:v}=Xu(),{account:b}=Pa(),C=c.useQuery(ya.getFeeRateQuery(null==o?void 0:o.chainId,null==o?void 0:o.address,null==o?void 0:o.type,b)),j=null===(d=null===(l=C.data)||void 0===l?void 0:l.lpFeeRate)||void 0===d?void 0:d.plus(null!==(p=null===(u=C.data)||void 0===u?void 0:u.mtFeeRate)&&void 0!==p?p:0);let w=!1,k=!1;o&&(a.userBaseLpBalance&&o.baseLpToken&&(w=v(o.baseLpToken.id,a.userBaseLpBalance)),a.userQuoteLpBalance&&o.quoteLpToken&&(k=v(o.quoteLpToken.id,a.userQuoteLpBalance)));const T="AMMV2"===(null==o?void 0:o.type);return z.jsxs(t.Box,{sx:{mt:16,mx:20,border:"solid 1px",borderColor:"border.main",borderRadius:12},children:[i?"":z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:g.spacing(12,20),borderStyle:"solid",borderColor:"border.main",borderWidth:g.spacing(0,0,1)},children:[z.jsxs(t.Box,{children:[z.jsxs(t.LoadingSkeleton,{loading:f,loadingSx:{width:100,mb:4},sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[null===(h=null==o?void 0:o.baseToken)||void 0===h?void 0:h.symbol,"/",null===(m=null==o?void 0:o.quoteToken)||void 0===m?void 0:m.symbol,"AMMV2"===(null==o?void 0:o.type)&&z.jsx(t.LoadingSkeleton,{loading:C.isLoading,loadingProps:{width:30},sx:{typography:"h6"},children:z.jsx(t.Tooltip,{title:z.jsxs(t.Box,{sx:{typography:"h6","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",z.jsx("b",{children:z.jsx(e.Trans,{id:"e38JNU",message:"Tips:"})})," ",z.jsx(e.Trans,{id:"1ABiXc",message:"By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.",values:{0:gr({input:j})},components:{0:z.jsx("b",{})}})]}),sx:{maxWidth:240},children:z.jsx(t.Box,{sx:{px:8,height:24,typography:"h6",lineHeight:"24px",borderRadius:4,background:g.palette.background.tag,color:"text.secondary",whiteSpace:"nowrap"},children:gr({input:j})})})})]}),z.jsx(t.LoadingSkeleton,{loading:f,children:z.jsx(lp,{address:null!==(x=null==o?void 0:o.address)&&void 0!==x?x:"",truncate:!0,iconSize:14,iconSpace:4,customChainId:null==o?void 0:o.chainId,sx:{typography:"h6",color:"text.secondary"}})})]}),(null==o?void 0:o.address)&&!T?z.jsxs(t.Box,{component:t.ButtonBase,sx:{typography:"body2",display:"flex",alignItems:"center",color:"text.secondary"},onClick:()=>{pm.getState().push({type:exports.PageType.PoolDetail,params:{chainId:o.chainId,address:o.address}})},children:[z.jsx(e.Trans,{id:"URmyfc",message:"Details"}),z.jsx(t.Box,{component:oe.ArrowRight,sx:{ml:4,position:"relative",top:1.2,width:16,height:16}})]}):""]}),z.jsxs(t.Box,{sx:{p:g.spacing(12,20)},children:[z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"YHc3B+",message:"My Liquidity"})}),z.jsx(t.Box,{sx:{mt:12},children:z.jsx(t.LoadingSkeleton,{loading:f,loadingSx:{width:100},children:y?z.jsxs(z.Fragment,{children:[z.jsx(xy,{chainId:null==o?void 0:o.chainId,address:null==o?void 0:o.address,token:null==o?void 0:o.baseToken,lpBalance:null==a?void 0:a.userBaseLpBalance,lpBalanceLoading:a.userLpBalanceLoading,balanceNeedUpdateLoading:w,tokenBalanceList:o?[{token:o.baseToken,balance:null==a?void 0:a.userBaseLpToTokenBalance,loading:a.userLpToTokenBalanceLoading}]:void 0}),z.jsx(xy,{chainId:null==o?void 0:o.chainId,address:null==o?void 0:o.address,token:null==o?void 0:o.quoteToken,lpBalance:null==a?void 0:a.userQuoteLpBalance,lpBalanceLoading:a.userLpBalanceLoading,balanceNeedUpdateLoading:k,tokenBalanceList:o?[{token:o.quoteToken,balance:null==a?void 0:a.userQuoteLpToTokenBalance,loading:a.userLpToTokenBalanceLoading}]:void 0})]}):z.jsx(xy,{chainId:null==o?void 0:o.chainId,address:null==o?void 0:o.address,token:null==o?void 0:o.baseToken,quoteToken:null==o?void 0:o.quoteToken,lpBalance:a.userBaseLpBalance,lpBalanceLoading:a.userLpBalanceLoading,balanceNeedUpdateLoading:w,tokenBalanceList:o?[{token:o.baseToken,balance:a.userBaseLpToTokenBalance||new s(0),loading:a.userLpToTokenBalanceLoading},{token:o.quoteToken,balance:a.userQuoteLpToTokenBalance||new s(0),loading:a.userLpToTokenBalanceLoading}]:void 0})})})]})]})}const fy=({pool:e,isBase:t,baseAmount:n,quoteAmount:i})=>{var o,r;const a="CLASSICAL"===(null==e?void 0:e.type),l=t||void 0===t,d=null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,u=null===(r=null==e?void 0:e.quoteToken)||void 0===r?void 0:r.decimals,p=c.useQuery(Object.assign(Object.assign({},ya.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,n&&void 0!==d?x.parseFixed(new s(n).dp(d,s.ROUND_FLOOR).toString(),d).toString():"",d)),{enabled:!!e&&!!n&&a&&l})),h=c.useQuery(Object.assign(Object.assign({},ya.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,i&&void 0!==u?x.parseFixed(new s(i).dp(u,s.ROUND_FLOOR).toString(),u).toString():"",u)),{enabled:!!e&&!!i&&a&&!l}));let m,g="",f="",y="",v="",b="",C=!1,j=null;if(e){const t=Ra(e.baseToken.decimals),o=Ra(e.quoteToken.decimals);if(y=nr({input:n,showDecimals:t}),v=nr({input:i,showDecimals:o}),a)if(C=l?p.isLoading:h.isLoading,j=l?p.error:h.error,l){if(p.data){g=nr({input:p.data,showDecimals:t}),b=g;const e=new s(n).minus(p.data);y=e.gt(0)?nr({input:e,showDecimals:t}):"-",m=e}}else if(h.data){f=nr({input:h.data,showDecimals:o}),b=f;const e=new s(i).minus(h.data);y=e.gt(0)?nr({input:e,showDecimals:t}):"-",m=e}}let w=[];return e&&(a?t?w.push({amount:y||"0",symbol:e.baseToken.symbol}):w.push({amount:v||"0",symbol:e.quoteToken.symbol}):(w.push({amount:y||"0",symbol:e.baseToken.symbol}),w.push({amount:v||"0",symbol:e.quoteToken.symbol}))),{withdrawFee:b,baseWithdrawFee:g,quoteWithdrawFee:f,receiveBaseAmount:y,receiveQuoteAmount:v,receiveAmountBg:m,receiveList:w,loading:C,error:j}};var yy;!function(e){e[e.base=1]="base",e[e.quote=2]="quote"}(yy||(yy={}));const vy=e=>{const[t,i]=n.useState(yy.base);let o,a;return e&&r.PoolApi.utils.singleSideLp(e.type)&&(o=t===yy.base,a=o?e.baseToken:e.quoteToken),{isBase:o,checkToken:a,checkTokenType:t,setCheckToken:i}};function by({token:e,pool:n,sx:i,value:o,onChange:r,selectedValue:a,lpBalance:s,balanceMax:l,balanceInfo:d,loading:c}){var u;const p=null==n?void 0:n.chainId;return z.jsxs(t.Box,{sx:i,children:[z.jsxs(t.Box,{sx:{typography:"h5",display:"flex",alignItems:"center",justifyContent:"space-between",fontWeight:600},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[e?z.jsx(t.Radio,{checked:o===a,onChange:()=>r(o),sx:{mr:16}}):"",z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:e?z.jsx(z.Fragment,{children:z.jsx(sl,{address:e.address,width:24,height:24,chainId:e.chainId||p,url:e.logoURI,noShowChain:!0})}):n&&z.jsx(Pp,{tokens:[n.baseToken,n.quoteToken],chainId:(null===(u=n.baseToken)||void 0===u?void 0:u.chainId)||p,width:24,height:24})})]}),z.jsxs(t.Box,{sx:{textAlign:"right"},children:[e?`${e.symbol} LP `:n&&`${n.baseToken.symbol}\n ${n.quoteToken.symbol}\n LP `,c?z.jsx(t.Box,{component:t.RotatingIcon,sx:{ml:4,position:"relative",top:3}}):s&&nr({input:s})||""]})]}),z.jsx(t.Box,{sx:{typography:"body2",mt:5,color:"text.secondary",textAlign:"right"},children:e?z.jsxs(z.Fragment,{children:[c?z.jsx(t.Box,{component:t.RotatingIcon,sx:{ml:4,position:"relative",top:3}}):`≈ ${l&&nr({input:l})||""}`,` ${e.symbol}`]}):n&&d&&d.userBaseLpToTokenBalance&&d.userQuoteLpToTokenBalance?z.jsxs(z.Fragment,{children:[c?z.jsx(t.Box,{component:t.RotatingIcon,sx:{position:"relative",top:4}}):nr({input:d.userBaseLpToTokenBalance}),` ${null==n?void 0:n.baseToken.symbol} + `,c?z.jsx(t.Box,{component:t.RotatingIcon,sx:{position:"relative",top:4}}):nr({input:d.userQuoteLpToTokenBalance}),` ${null==n?void 0:n.quoteToken.symbol}`]}):""})]})}function Cy({pool:e,checkTokenType:t,setCheckToken:n,balanceInfo:i,baseTokenBalanceUpdateLoading:o,quoteBalanceUpdateLoading:a}){if(!e)return null;const s=r.PoolApi.utils.singleSideLp(e.type);return z.jsx(z.Fragment,{children:s?z.jsxs(z.Fragment,{children:[z.jsx(by,{token:e.baseToken,selectedValue:t,onChange:n,value:yy.base,lpBalance:i&&i.userBaseLpBalance,balanceMax:i&&i.userBaseLpToTokenBalance,loading:o}),z.jsx(by,{selectedValue:t,onChange:n,sx:{mt:13},token:e.quoteToken,value:yy.quote,lpBalance:i&&i.userQuoteLpBalance,balanceMax:i&&i.userQuoteLpToTokenBalance,loading:a})]}):z.jsx(by,{pool:e,value:t,onChange:n,lpBalance:i&&i.userBaseLpBalance,balanceInfo:i,loading:o||a})})}function jy({submittedBack:i,onlyShowSide:a,pool:l,balanceInfo:d}){var u,h,m,x,g,f,y,v,b,C;const j=t.useTheme(),{isMobile:w}=Xa(),{account:k}=Pa(),T=d.userBaseLpToTokenBalance,B=d.userQuoteLpToTokenBalance,E=d.loading,{slipper:I,setSlipper:A,slipperValue:S,resetSlipper:L}=jm({address:null==l?void 0:l.address}),{isBase:M,checkToken:R,checkTokenType:O,setCheckToken:P}=vy(l),{baseAmount:_,quoteAmount:D,handleChangeBaseAmount:F,handleChangeQuoteAmount:U,addPortion:q,midPrice:V,amountLoading:W,amountCheckedDisabled:H,uniV2Pair:Z,reset:$}=hy({pool:l,maxBaseAmount:T,maxQuoteAmount:B}),[G,Y]=n.useState(""),[X,K]=n.useState("");n.useEffect((()=>{const e=setTimeout((()=>{Y(_)}),80);return()=>clearTimeout(e)}),[_]),n.useEffect((()=>{const e=setTimeout((()=>{K(D)}),80);return()=>clearTimeout(e)}),[D]);const J=e=>{F(e)},ee=e=>{U(e)},te="AMMV2"===(null==l?void 0:l.type),ne=(null==l?void 0:l.chainId)?r.basicTokenMap[l.chainId]:void 0,ie=null===(u=null==ne?void 0:ne.address)||void 0===u?void 0:u.toLowerCase(),oe=null===(h=null==ne?void 0:ne.wrappedTokenAddress)||void 0===h?void 0:h.toLowerCase(),re=!!l&&[ie,oe].includes(l.baseToken.address.toLowerCase()),ae=!!l&&[ie,oe].includes(l.quoteToken.address.toLowerCase()),se=te&&l&&(re||ae),[le,de]=n.useState(!1),ce=se&&re&&!le&&ne?l?Object.assign(Object.assign({},l.baseToken),{symbol:ne.symbol,address:ne.address}):void 0:null==l?void 0:l.baseToken,ue=se&&ae&&!le&&ne?l?Object.assign(Object.assign({},l.quoteToken),{symbol:ne.symbol,address:ne.address}):void 0:null==l?void 0:l.quoteToken,pe=fy({pool:l?Object.assign(Object.assign({},l),{baseToken:ce,quoteToken:ue}):l,isBase:M,baseAmount:G,quoteAmount:X}),{mode:he,modeOptions:me,handleChangeMode:xe,sliderPercentage:ge,handleChangeSliderPercentage:fe,resetPercentage:ye}=function({isBase:e,pool:t,baseOverride:i,quoteOverride:r,resetAmount:a,handleChangeBaseAmount:s,handleChangeQuoteAmount:l}){const[d,c]=n.useState(Tm.percentage),[u,p]=n.useState(km),h=n.useRef(null),m=()=>{h.current&&clearTimeout(h.current)},x=()=>{m(),p(km)};return n.useEffect((()=>m),[]),{mode:d,modeOptions:[{key:Tm.quantity,value:o.i18n._({id:"PIYEqF",message:"Quantity model"})},{key:Tm.percentage,value:o.i18n._({id:"x4QVeW",message:"Percentage to remove"})}],handleChangeMode:e=>{c(e),a(),x()},sliderPercentage:u,handleChangeSliderPercentage:n=>{if(m(),n!==u&&p(n),!t)return;const o=100===n,a=()=>{if(t)if(e||void 0===e){if(i){let e=i.toString();o||(e=rr(i.times(n/100),t.baseToken.decimals)),s(e)}}else if(r){let e=r.toString();o||(e=rr(r.times(n/100),t.quoteToken.decimals)),l(e)}};o?a():h.current=setTimeout(a,100)},resetPercentage:x}}({isBase:M,pool:l,baseOverride:T,quoteOverride:B,resetAmount:$,handleChangeBaseAmount:J,handleChangeQuoteAmount:ee});n.useEffect((()=>{$(),ye()}),[O]);const ve=qm(l);n.useEffect((()=>{(null==l?void 0:l.address)!==(null==ve?void 0:ve.address)&&($(),L(),xe(Tm.percentage),fe(km))}),[l]),n.useEffect((()=>{he===Tm.percentage&&fe(ge)}),[null==T?void 0:T.toString(),null==B?void 0:B.toString()]);const be=r.PoolApi.utils.canOperateLiquidity(null==l?void 0:l.type,void 0,null==l?void 0:l.creator,k),[Ce,je]=n.useState(!1),{isShowCompare:we,lqAndDodoCompareText:ke,isWarnCompare:Te}=uy(null==l?void 0:l.baseToken,null==l?void 0:l.quoteToken,V),Be=c.useQuery(ya.getFeeRateQuery(null==l?void 0:l.chainId,null==l?void 0:l.address,null==l?void 0:l.type,k)),Ee=null===(y=null===(x=null===(m=Be.data)||void 0===m?void 0:m.mtFeeRate)||void 0===x?void 0:x.plus(null!==(f=null===(g=Be.data)||void 0===g?void 0:g.lpFeeRate)&&void 0!==f?f:0))||void 0===y?void 0:y.toNumber(),{baseTokenStatus:Ie,quoteTokenStatus:Ae}=function({pool:e,baseAmount:t,quoteAmount:n,balanceInfo:i}){var o,a,l,d,c;const{chainId:u,baseToken:h,quoteToken:m}=null!=e?e:{};let x="";const g="AMMV2"===(null==e?void 0:e.type);u&&(x=null!==(o=r.contractConfig[u].DODO_V1_PAIR_PROXY)&&void 0!==o?o:"",g&&(x=p.getUniswapV2Router02ContractAddressByChainId(u)||p.getUniswapV2Router02FixedFeeContractAddressByChainId(e.chainId)));const f=null!==(l=null===(a=null==e?void 0:e.baseLpToken)||void 0===a?void 0:a.id)&&void 0!==l?l:"",y=null!==(c=null===(d=null==e?void 0:e.quoteLpToken)||void 0===d?void 0:d.id)&&void 0!==c?c:"",v="CLASSICAL"===(null==e?void 0:e.type);return{baseTokenStatus:Ms(h?Object.assign(Object.assign({},h),{symbol:v?h.symbol+" LP":`${h.symbol}/${null==m?void 0:m.symbol} LP`,address:f}):void 0,{amount:g&&i.userBaseLpToTokenBalance&&i.userBaseLpBalance?new s(t).div(i.userBaseLpToTokenBalance).times(i.userBaseLpBalance).toString():t,skipQuery:!x||!f||!v&&!g,contractAddress:x,overrideBalance:g?i.userBaseLpBalance:i.userBaseLpToTokenBalance}),quoteTokenStatus:Ms(m?Object.assign(Object.assign({},m),{address:y}):void 0,{amount:n,skipQuery:!x||!y||!v,contractAddress:x,overrideBalance:i.userQuoteLpToTokenBalance})}}({pool:l,baseAmount:_,quoteAmount:D,balanceInfo:d}),Se=Ie.insufficientBalance||Ae.insufficientBalance,{isSinglePool:Le}=d,Me=Se?o.i18n._({id:"znqB4T",message:"Insufficient balance"}):o.i18n._({id:"t/YqKh",message:"Remove"}),Re=()=>{$(),L(),i&&i()},Oe=null===(v=null==Z?void 0:Z.pair)||void 0===v?void 0:v.liquidityToken.decimals,Pe=null===(b=d.userBaseLpBalance)||void 0===b?void 0:b.times(ge/100),_e=Pe&&void 0!==Oe?sr(Pe,Oe).toString():"",{operateLiquidityMutation:De}=ry(l),Ne=function({baseToken:t,quoteToken:n,baseAmount:i,quoteAmount:a,liquidityAmount:l,slippage:d,fee:u,submittedBack:h}){const m=us(),{account:x}=Pa();e.useLingui();const{deadLine:g}=Q();return c.useMutation({mutationFn:()=>N(this,void 0,void 0,(function*(){if(!t||!n)throw new Error("token is undefined");if(!x)throw new Error("account is undefined");if(!u)throw new Error("fee is undefined");const e=t.chainId,c=r.basicTokenMap[e].address.toLowerCase(),f=p.getUniswapV2Router02ContractAddressByChainId(e),y=p.getUniswapV2Router02FixedFeeContractAddressByChainId(e),v=!f,b=f||y;if(!b)throw new Error("AMMV2 contract address is not valid.");let C="";const j=t.address.toLowerCase()===c,w=n.address.toLowerCase()===c,k=sr(new s(i).times(1-d),t.decimals),T=sr(new s(a).times(1-d),n.decimals),B=sr(u,4).toString(),E=Math.ceil(Date.now()/1e3)+(null!=g?g:600);try{if(j){const e=n.address,t=T.toString(),i=k.toString();C=v?p.encodeUniswapV2Router02FixedFeeRemoveLiquidityETH(e,l,t,i,x,E):p.encodeUniswapV2Router02RemoveLiquidityETH(e,B,l,t,i,x,E)}else if(w){const e=t.address,n=k.toString(),i=T.toString();C=v?p.encodeUniswapV2Router02FixedFeeRemoveLiquidityETH(e,l,n,i,x,E):p.encodeUniswapV2Router02RemoveLiquidityETH(e,B,l,n,i,x,E)}else C=v?p.encodeUniswapV2Router02FixedFeeRemoveLiquidity(t.address,n.address,l,k.toString(),T.toString(),x,E):p.encodeUniswapV2Router02RemoveLiquidity(t.address,n.address,B,l,k.toString(),T.toString(),x,E)}catch(e){throw console.error("encodeUniswapV2Router02RemoveLiquidity error",e),e}return yield m.execute(o.i18n._({id:"cJtosk",message:"Remove liquidity"}),{opcode:rs.TX,to:b,data:C,value:"0x0"},{metadata:{[exports.MetadataFlag.removeLiqidityAMMV2Position]:!0},submittedBack:h})}))})}({baseToken:ce,quoteToken:ue,baseAmount:_,quoteAmount:D,liquidityAmount:_e,slippage:S,fee:Ee,submittedBack:Re}),Fe=()=>{if(te)return Ne.mutate();De.mutate({txTitle:o.i18n._({id:"3XBvkd",message:"Remove Liquidity"}),isRemove:!0,baseAmount:_,quoteAmount:D,slippageProtection:S,balanceInfo:d,SLIPPAGE_PROTECTION:Cm,submittedBack:Re})},Ue=n.useMemo((()=>{var e;const t=new s(_),n=new s(D);return!l||Se||!V||!!d.loading||!!d.error||H||!!pe.error||pe.loading||!!(null===(e=pe.receiveAmountBg)||void 0===e?void 0:e.lte(0))||Be.isLoading||(te?null==Pe||Pe.lte(0):!t.isFinite()||!n.isFinite()||t.lte(0)&&n.lte(0))}),[H,d.error,d.loading,_,Be.isLoading,te,Se,Pe,V,l,D,pe.error,pe.loading,pe.receiveAmountBg]);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pb:18,px:20},children:[!te&&z.jsxs(t.Box,{sx:{mt:20,borderStyle:"solid",borderWidth:1,borderRadius:12,borderColor:"border.main"},children:[z.jsx(t.Select,{value:he,options:me,onChange:(e,t)=>xe(t),popupOffset:0,sx:{px:20,py:12,width:"100%",backgroundColor:"transparent",color:"text.primary",typography:"body2"}}),!!l&&r.PoolApi.utils.singleSideLp(l.type)&&z.jsx(t.Box,{sx:{pt:20,pb:13,px:20,borderStyle:"solid",borderWidth:"1px 0 0"},children:z.jsx(Cy,{pool:l,balanceInfo:d,checkTokenType:O,setCheckToken:P,baseTokenBalanceUpdateLoading:!1,quoteBalanceUpdateLoading:!1})})]}),z.jsx(t.Box,{sx:{pt:20},children:he===Tm.percentage?z.jsx(xm,{disabled:d.loading||!be,value:ge,onChange:fe}):R?z.jsx(kp,{amt:M?_:D,token:R,canClickBalance:!0,showPercentage:!0,onInputChange:M?J:ee,readOnly:d.loading||!be,overrideBalance:M?T:B,overrideBalanceLoading:E,sx:{backgroundColor:"background.cardInput",padding:j.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"}}):z.jsxs(z.Fragment,{children:[z.jsx(kp,{amt:_,token:null==l?void 0:l.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:J,readOnly:d.loading||!be,overrideBalance:T,overrideBalanceLoading:E,sx:{backgroundColor:"background.cardInput",padding:j.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"}}),a?"":z.jsx(jp,{}),"base"===a?"":z.jsx(kp,{amt:D,token:null==l?void 0:l.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:ee,readOnly:d.loading||!be||Le,overrideBalance:B,overrideBalanceLoading:E,sx:{backgroundColor:"background.cardInput",padding:j.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"}})]})}),z.jsxs(t.LoadingSkeleton,{loading:d.loading||W,sx:{mt:8},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"flex-end",gap:8},children:[te&&se&&z.jsx(t.Box,{sx:{px:12,py:4,borderRadius:20,borderWidth:1,backgroundColor:"transparent",color:"primary.main",cursor:"pointer",typography:"body2","&:hover":{backgroundColor:"hover.default"}},component:"button",onClick:()=>de((e=>!e)),children:z.jsx(e.Trans,{id:"/k7Ttv",message:"Receive {0}",values:{0:le?null==ne?void 0:ne.symbol:null==ne?void 0:ne.wrappedTokenSymbol}})}),z.jsx(wm,{value:I,onChange:A,disabled:!be,type:null==l?void 0:l.type,sx:{margin:0}})]}),z.jsx(dy,{pool:l,addPortion:q,midPrice:V,shareOfPool:null==Z?void 0:Z.shareOfPool})]}),!!l&&z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",mt:20,mb:14},children:[z.jsx(t.Box,{sx:{typography:"body2",color:"text.secondary",position:"relative",top:2},children:z.jsx(e.Trans,{id:"lDgVWA",message:"Receive"})}),z.jsx(t.Box,{sx:{textAlign:"right"},children:pe.receiveList.map(((e,n)=>z.jsxs(t.Box,{sx:{mt:n>0?4:0},children:[z.jsxs(t.LoadingSkeleton,{component:"span",loading:pe.loading,loadingSx:{mr:8,width:100},sx:{display:"inline-block",typography:"h5",fontWeight:600,color:pe.receiveBaseAmount&&"0"!==pe.receiveBaseAmount?"primary.main":"text.primary"},children:[e.amount," "]}),z.jsx(t.Box,{component:"span",sx:{typography:"body2"},children:e.symbol})]},e.symbol)))})]})]}),z.jsxs(t.Box,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[we&&z.jsx(sy,{baseToken:null==l?void 0:l.baseToken,quoteToken:null==l?void 0:l.quoteToken,lqAndDodoCompareText:ke,midPrice:V}),l?z.jsx(ly,{chainId:l.chainId,baseTokenStatus:Ie,quoteTokenStatus:Ae,children:z.jsx(t.Button,{fullWidth:!0,disabled:Ue,danger:Te,isLoading:De.isPending||Ne.isPending,onClick:()=>{Ue||(Te?je(!0):Fe())},children:Me})}):z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:Me})]}),z.jsx(Yf,{open:Ce,onClose:()=>je(!1),title:o.i18n._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:Fe,modal:!0,children:z.jsxs(t.Box,{children:[z.jsx(t.Box,{children:o.i18n._({id:"tecieV",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on ZUNO.",values:{lqAndDodoCompareText:ke}})}),z.jsx(t.Box,{children:o.i18n._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),z.jsx(Eu,{message:null===(C=De.error)||void 0===C?void 0:C.message,onClose:()=>De.reset(),isDialogModal:w})]})}function wy({pool:i,operate:o,hidePoolInfo:r,errorRefetch:a,submittedBack:s}){var l,d,u,p,h,m;const{operateTab:x,operateTabs:g,handleChangeTab:f}=function(t=df.Add){const{i18n:i}=e.useLingui(),[o,r]=n.useState(t),a=n.useMemo((()=>[{key:df.Add,value:i._({id:"m16xKo",message:"Add"})},{key:df.Remove,value:i._({id:"t/YqKh",message:"Remove"})}]),[i._]);return n.useEffect((()=>{r(t)}),[t]),{operateTab:o,operateTabs:a,handleChangeTab:e=>{r(e)}}}(o),{account:y}=Pa(),v=If({account:y,pool:i?{chainId:i.chainId,address:i.address,type:i.type,baseTokenDecimals:i.baseToken.decimals,quoteTokenDecimals:i.quoteToken.decimals,baseLpTokenDecimals:null!==(d=null===(l=i.baseLpToken)||void 0===l?void 0:l.decimals)&&void 0!==d?d:18,quoteLpTokenDecimals:null!==(p=null===(u=i.quoteLpToken)||void 0===u?void 0:u.decimals)&&void 0!==p?p:18}:void 0}),b=c.useQuery(ya.getPMMStateQuery(null==i?void 0:i.chainId,null==i?void 0:i.address,null==i?void 0:i.type,null===(h=null==i?void 0:i.baseToken)||void 0===h?void 0:h.decimals,null===(m=null==i?void 0:i.quoteToken)||void 0===m?void 0:m.decimals));return v.error||b.error||a?z.jsx(ne,{refresh:()=>{v.error&&v.refetch(),b.error&&b.refetch(),a&&a()},sx:{my:40,height:"100%"}}):z.jsxs(z.Fragment,{children:[z.jsx(gy,{pool:i,balanceInfo:v,hidePoolInfo:r}),z.jsxs(t.Tabs,{value:x,onChange:(e,t)=>{f(t)},children:[z.jsx(t.TabsButtonGroup,{tabs:g,variant:"inPaper",tabsListSx:{mt:16,mx:20}}),z.jsx(t.TabPanel,{value:df.Add,children:z.jsx(my,{pool:i,balanceInfo:v,submittedBack:s})}),z.jsx(t.TabPanel,{value:df.Remove,children:z.jsx(jy,{pool:i,balanceInfo:v,submittedBack:s})})]})]})}function ky({onClose:i,pool:a,address:s,operate:l,chainId:d,hasMining:u,hidePoolInfo:p,sx:h}){var m,x,g,f,y,v,b,C,j;const{account:w}=Pa(),k=d?Si[d]:"",T=qa(),B=c.useQuery(Object.assign(Object.assign({},T.getQuery(r.PoolApi.graphql.fetchPoolList,{where:{id:null!==(m=null==s?void 0:s.toLocaleLowerCase())&&void 0!==m?m:"",chain:k}})),{enabled:!!s&&!!d})),E=null===(g=null===(x=B.data)||void 0===x?void 0:x.pairs)||void 0===g?void 0:g[0],I=E&&d?function(e,t){var n,i,o,r,a,s;if(e)return{address:e.id,chainId:t,baseToken:ba(e.baseToken,t),quoteToken:ba(e.quoteToken,t),type:e.type,creator:e.creator,baseLpToken:{id:null===(n=e.baseLpToken)||void 0===n?void 0:n.id,decimals:Number(null!==(o=null===(i=e.baseLpToken)||void 0===i?void 0:i.decimals)&&void 0!==o?o:18)},quoteLpToken:{id:null===(r=e.quoteLpToken)||void 0===r?void 0:r.id,decimals:Number(null!==(s=null===(a=e.quoteLpToken)||void 0===a?void 0:a.decimals)&&void 0!==s?s:18)}}}(E,d):void 0,A=s&&d?I:a,S=B.error?B.refetch:void 0,{poolOrMiningTab:L,poolOrMiningTabs:M,handleChangeTab:R}=function({hasMining:t}){const{i18n:i}=e.useLingui(),[o,r]=n.useState(Qf.Liquidity);return{poolOrMiningTab:o,poolOrMiningTabs:n.useMemo((()=>{const e=[{key:Qf.Liquidity,value:i._({id:"6y2TB3",message:"Liquidity"})},{key:Qf.Mining,value:i._({id:"Sti4vy",message:"Mining"})}];return t?e:e.slice(0,1)}),[i._,t]),handleChangeTab:e=>{r(e)}}}({hasMining:u}),O=If({account:w,pool:A?{chainId:A.chainId,address:A.address,type:A.type,baseTokenDecimals:A.baseToken.decimals,quoteTokenDecimals:A.quoteToken.decimals,baseLpTokenDecimals:null!==(y=null===(f=A.baseLpToken)||void 0===f?void 0:f.decimals)&&void 0!==y?y:18,quoteLpTokenDecimals:null!==(b=null===(v=A.quoteLpToken)||void 0===v?void 0:v.decimals)&&void 0!==b?b:18}:void 0}),P=!!(null===(C=O.userBaseLpBalance)||void 0===C?void 0:C.gt(0))||!!(null===(j=O.userQuoteLpBalance)||void 0===j?void 0:j.gt(0)),_=null!=d?d:null==A?void 0:A.chainId,D=null!=s?s:null==A?void 0:A.address;return z.jsx(t.Box,{sx:h,children:z.jsxs(t.Tabs,{value:L,onChange:(e,t)=>{R(t)},sx:{display:"flex",flexDirection:"column",overflow:"hidden",height:"100%"},children:[z.jsx(t.TabsGroup,{tabs:M,tabsListSx:Object.assign({mx:20,justifyContent:"space-between"},u&&P?{"& button:last-child":{position:"relative","&::before":{content:`"${o.i18n._({id:"TY5fM3",message:"LP Tokens"})}"`,position:"absolute",top:16,right:20,px:8,py:2,borderRadius:12,transform:"scale(0.66667) translateX(100%)",transformOrigin:"right top",backgroundColor:t.alpha("#DABB1B",.2),color:"#DABB1B"}}}:{}),rightSlot:z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:12},children:["GSP"===(null==A?void 0:A.type)&&z.jsx(Gf,{}),i?z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,borderStyle:"solid",borderColor:"border.main",color:"text.secondary","&:hover":{color:"text.primary"},cursor:"pointer"},children:z.jsx(t.Box,{component:oe.Error,sx:{width:16,height:16},onClick:()=>{i()}})}):void 0]})}),z.jsx(t.TabPanel,{value:Qf.Liquidity,sx:{flex:1,overflowY:"auto"},children:z.jsx(wy,{pool:A,operate:l,hidePoolInfo:p,errorRefetch:S,submittedBack:()=>{u&&R(Qf.Mining)}})}),z.jsx(t.TabPanel,{value:Qf.Mining,sx:{flex:1,overflowY:"auto"},children:_&&D?z.jsx($f,{chainId:_,account:w,poolAddress:D,goLpLink:()=>{R(Qf.Liquidity)}}):""})]})})}function Ty(e){var{modal:t}=e,n=D(e,["modal"]);const{isMobile:i}=Xa();return z.jsx(el,{open:!!n.pool||!!n.address,onClose:n.onClose,scope:!i,modal:t,id:"pool-operate",children:z.jsx(ky,{...n})})}function By({address:n,chainId:i,hideName:o,sx:a}){const s=t.useTheme(),l=qa(),{onlyChainId:d}=Q(),u=c.useQuery(Object.assign({},l.getQuery(r.SystemApi.graphql.fetchLiquidityLpPartnerRewards,{where:{chainId:d||void 0}})));if(!n)return null;const p=[];return("string"==typeof n?[n]:Array.from(new Set(n)).filter((e=>!!e))).forEach((e=>{var t,n,o;e&&(null===(o=null===(n=null===(t=u.data)||void 0===t?void 0:t.liquidity_getLpPartnerRewards)||void 0===n?void 0:n.partnerRewards)||void 0===o||o.some((t=>{var n,o,r,a,s,l,d,c,h,m,x,g,f,y;if((null==t?void 0:t.chainId)===i&&(null===(n=null==t?void 0:t.pool)||void 0===n?void 0:n.toLocaleLowerCase())===e.toLocaleLowerCase()){const e=null===(a=null===(r=null===(o=u.data)||void 0===o?void 0:o.liquidity_getLpPartnerRewards)||void 0===r?void 0:r.partnerInfos)||void 0===a?void 0:a.find((e=>(null==e?void 0:e.partner)===t.partner));if(!e)return;p.push({partner:{name:null!==(s=null==e?void 0:e.partner)&&void 0!==s?s:"",logo:null!==(l=null==e?void 0:e.logo)&&void 0!==l?l:"",introduction:null!==(d=null==e?void 0:e.introduction)&&void 0!==d?d:"",link:null!==(c=null==e?void 0:e.link)&&void 0!==c?c:"",extra:null!==(h=null==e?void 0:e.extra)&&void 0!==h?h:{},background:(null===(m=null==e?void 0:e.theme)||void 0===m?void 0:m[0])||void 0,color:(null===(x=null==e?void 0:e.theme)||void 0===x?void 0:x[1])||void 0},reward:null!==(g=null==t?void 0:t.reward)&&void 0!==g?g:"",type:null!==(f=null==t?void 0:t.type)&&void 0!==f?f:"stakelp",sort:null!==(y=null==e?void 0:e.sort)&&void 0!==y?y:Number.MAX_SAFE_INTEGER})}})))})),(null==p?void 0:p.length)?(p.sort(((e,t)=>e.sort-t.sort)),z.jsx(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},a),children:p.map((n=>z.jsx(t.Tooltip,{leaveDelay:100,title:z.jsxs(t.Box,{sx:{maxWidth:240,whiteSpace:"pre-wrap"},children:[n.partner.introduction,!!n.partner.link&&z.jsxs(t.Box,{component:"a",target:"_blank",href:n.partner.link,rel:"noopener noreferrer",sx:{display:"flex",alignItems:"center",gap:4,color:"primary.main","&:hover":{opacity:.5}},children:[z.jsx(e.Trans,{id:"zwWKhA",message:"Learn more"})," ",z.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.91667 2.91667V11.0833H11.0833V7H12.25V11.0833C12.25 11.725 11.725 12.25 11.0833 12.25H2.91667C2.26917 12.25 1.75 11.725 1.75 11.0833V2.91667C1.75 2.275 2.26917 1.75 2.91667 1.75H7V2.91667H2.91667ZM8.16667 2.91667V1.75H12.25V5.83333H11.0833V3.73917L5.34917 9.47333L4.52667 8.65083L10.2608 2.91667H8.16667Z",fill:"currentColor"})})]})]}),children:z.jsxs(t.ButtonBase,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,p:s.spacing(0,4),height:20,borderRadius:4,background:n.partner.background,color:n.partner.color,whiteSpace:"nowrap"},children:[z.jsx(t.Box,{component:"img",src:n.partner.logo,alt:n.partner.name,sx:{width:14,height:14,borderRadius:"50%"}}),!o&&!!n.reward&&z.jsx(t.Box,{sx:{fontSize:"10px",fontWeight:600},children:n.reward})]})},n.partner.name+n.reward)))})):null}var Ey,Iy;function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ay.apply(null,arguments)}const Sy=e=>P.createElement("svg",Ay({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ey||(Ey=P.createElement("circle",{cx:16,cy:16,r:16,fill:"#FFE804"})),Iy||(Iy=P.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 12.25H12.25V8.5H8.5V12.25ZM14.125 23.5H17.875V19.75H14.125V23.5ZM12.25 23.5H8.5V19.75H12.25V23.5ZM8.5 17.875H12.25V14.125H8.5V17.875ZM17.875 17.875H14.125V14.125H17.875V17.875ZM19.75 8.5V12.25H23.5V8.5H19.75ZM17.875 12.25H14.125V8.5H17.875V12.25ZM19.75 17.875H23.5V14.125H19.75V17.875ZM23.5 23.5H19.75V19.75H23.5V23.5Z",fill:"#1A1A1B"}))),Ly="_default";function My({value:e,onChange:n,placeholder:o,options:r,sx:a,readOnly:s,valueOnlyIcon:l}){const d=t.useTheme();return z.jsx(t.Select,{value:null!=e?e:Ly,onChange:(t,i)=>{const o="number"==typeof e&&i?Number(i):i;n(o===Ly?void 0:o)},disabled:s,sx:i.merge({padding:d.spacing(8,12),"& .MuiSelect-select.MuiSelect-select.MuiSelect-select":{display:"flex",alignItems:"center",gap:8,padding:d.spacing(8,12,8,12),minHeight:"auto",backgroundColor:"transparent",color:"text.primary",borderRadius:8,typography:"body2",fontWeight:600,borderStyle:"solid",borderWidth:1,borderColor:"divider","& svg, & img":{width:24,height:24},'&:hover, &[aria-expanded="true"]':{backgroundColor:"background.paper"},"&.Mui-readOnly":{color:"text.disabled"}},"& .MuiSelect-icon":{color:s?"text.disabled":"text.primary"},"& .MuiOutlinedInput-notchedOutline":{display:"none"}},a),renderValue:n=>{if(!(null==n?void 0:n.value)||n.value===Ly)return z.jsx(t.Box,{sx:{color:"text.secondary"},children:null!=o?o:""});const i=r.find((t=>t.key===e));return i?z.jsxs(z.Fragment,{children:[i.logo,l?"":i.value]}):null},options:[...r]})}function Ry({isMobileStyle:e,chain:n,isLastItem:i,logoWidth:o,mobileLogoWidth:r,sx:a}){const s=t.useTheme();return e?z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",py:18,borderTop:`1px solid ${s.palette.border.main}`,borderBottom:i?`1px solid ${s.palette.border.main}`:"none"},a),children:[z.jsx(t.Box,{component:null==n?void 0:n.logo,sx:{width:r,height:r}}),z.jsx(t.Box,{component:"span",className:"name",sx:{marginLeft:8},children:null==n?void 0:n.name})]}):z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{component:null==n?void 0:n.logo,sx:{width:o,height:o}}),z.jsx(t.Box,{component:"span",className:"name",sx:{marginLeft:8},children:null==n?void 0:n.name})]})}const Oy=-1;function Py({chainId:i,setChainId:o,logoWidth:r=24,mobileLogoWidth:a=32,mainLogoWidth:s=24,mainMobileLogoWidth:l=18,notShowAllChain:d,valueOnlyIcon:c,sx:u}){const p=function(){const{chainId:e}=Pa();return n.useMemo((()=>{const t=new Map;let n;return Ro.forEach(((i,o)=>{if(i.mainnet){if(e!==i.chainId)return;n=i.mainnet}t.set(o,Object.assign({},i))})),void 0!==n&&t.delete(n),Array.from(t.values())}),[e])}(),[h,m]=n.useState(!1),{isMobile:x}=Xa(),{i18n:g}=e.useLingui(),f=n.useCallback((()=>{const e=void 0===i?p[0]:p.find((e=>e.chainId===i));if(c){if(void 0===i||!e)return"";const n=x?a:s;return z.jsx(t.Box,{component:null==e?void 0:e.logo,sx:{width:n,height:n}})}return void 0!==i||d?e?z.jsx(Ry,{isMobileStyle:x,chain:e,logoWidth:s,mobileLogoWidth:l}):null:z.jsx(Ry,{isMobileStyle:x,chain:{chainId:Oy,logo:Sy,name:g._({id:"pY/ok7",message:"All chains"})},logoWidth:s,mobileLogoWidth:l,sx:{border:"none"}})}),[i,p,d,c,x,g._]),y=n.useMemo((()=>{const e=[];return d||e.push({key:Oy,value:z.jsx(Ry,{isMobileStyle:x,chain:{chainId:Oy,logo:Sy,name:g._({id:"pY/ok7",message:"All chains"})},logoWidth:r,mobileLogoWidth:a})}),p.forEach(((t,n)=>{e.push({key:t.chainId,value:z.jsx(Ry,{isLastItem:n===p.length-1,isMobileStyle:x,chain:t,logoWidth:r,mobileLogoWidth:a})})})),e}),[x,r,a,p,d]);return x?z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>m(!0),sx:Object.assign({display:"flex",alignItems:"center",backgroundColor:"background.tag",color:"text.primary",borderRadius:8,border:"none",px:8,height:32,fontWeight:600,typography:"body2"},u),children:[z.jsx(t.Box,{sx:{pr:5},children:f()}),z.jsx(t.Box,{component:oe.CaretUp,sx:{width:12,height:12,transform:"rotate(180deg)"}})]}),z.jsx(el,{open:h,title:z.jsx(e.Trans,{id:"lJvbHq",message:"Select Network"}),onClose:()=>m(!1),id:"select-chain",modal:!0,children:z.jsx(t.Box,{sx:{mb:20},children:y.map((e=>z.jsxs(t.Box,{onClick:()=>{const t=e.key;o(t===Oy?void 0:Number(t)),m(!1)},sx:{position:"relative",px:20,"&:active":{backgroundColor:"hover.default"},"&:hover":{backgroundColor:"hover.default"},cursor:"pointer"},children:[e.value,(i?e.key===i:e.key===Oy)&&z.jsx(t.Box,{sx:{position:"absolute",left:0,top:24,height:20,width:2,backgroundColor:"text.primary"}})]},e.key)))})})]}):z.jsx(My,{value:null!=i?i:Oy,onChange:e=>{y.some((t=>String(t.key)===String(e)))&&o(e===Oy?void 0:e)},placeholder:g._({id:"lJvbHq",message:"Select Network"}),options:y,valueOnlyIcon:c,sx:Object.assign({px:8,height:32,fontWeight:600,typography:"body2",backgroundColor:"background.tag",color:"text.primary"},u)})}const _y=e=>{const{filterList:n,value:i,onChange:o}=e,r=t.useTheme();return z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:n.map(((e,a)=>z.jsx(t.Box,{sx:Object.assign(Object.assign({borderLeftWidth:1,borderRightWidth:a===n.length-1?1:0,borderTopWidth:1,borderBottomWidth:1,borderColor:r.palette.border.main,borderStyle:"solid",typography:"body2",lineHeight:"30px",color:r.palette.text.secondary,px:20,cursor:"pointer",borderTopLeftRadius:0===a?8:0,borderBottomLeftRadius:0===a?8:0,borderTopRightRadius:a===n.length-1?8:0,borderBottomRightRadius:a===n.length-1?8:0},i===e.value?{backgroundColor:r.palette.border.disabled,color:r.palette.text.primary}:{}),{[r.breakpoints.down("tablet")]:{flexGrow:1,flexBasis:"25%",textAlign:"center"}}),onClick:()=>o(e.value),children:e.label},e.value)))})},Dy=({sx:n,isRightTop:i,isReverseColor:o})=>{const r=t.useTheme();return z.jsx(t.Box,{sx:Object.assign(Object.assign(Object.assign({display:"inline-flex",padding:"2px 4px",alignItems:"center",gap:"4px",borderRadius:4,background:t.alpha(r.palette.warning.main,.1),color:r.palette.warning.main,fontSize:"10px",fontWeight:600,lineHeight:"14px"},i?{position:"absolute",top:-14,right:0,background:`linear-gradient(0deg, ${r.palette.warning.main}1A 0%, ${r.palette.warning.main}1A 100%), ${r.palette.background.paper}`}:void 0),o?{background:"light"===r.palette.mode?"linear-gradient(0deg, var(--label-warning, rgba(177, 86, 0, 0.10)) 0%, var(--label-warning, rgba(177, 86, 0, 0.10)) 100%), #FFF":"linear-gradient(0deg, #FFFFFF, #FFFFFF),linear-gradient(0deg, rgba(235, 141, 39, 0.1), rgba(235, 141, 39, 0.1))",zIndex:1}:void 0),n),children:z.jsx(e.Trans,{id:"y5rS9U",message:"Migrate"})})};function Ny({chainId:n,baseToken:i,quoteToken:o,apy:r,hasQuote:a,hasMining:l,sx:d,children:c}){if(!i)return null;const u=a?[{token:i,transactionApy:null==r?void 0:r.transactionBaseApy,miningApy:null==r?void 0:r.miningBaseApy},{token:o,transactionApy:null==r?void 0:r.transactionQuoteApy,miningApy:null==r?void 0:r.miningQuoteApy}]:[{transactionApy:null==r?void 0:r.transactionBaseApy,miningApy:null==r?void 0:r.miningBaseApy,metromMiningApy:null==r?void 0:r.metromMiningApy}];return z.jsx(t.Tooltip,{children:null!=c?c:z.jsx(t.HoverOpacity,{component:oe.QuestionBorder,sx:Object.assign({width:15,height:15},d)}),title:z.jsx(t.Box,{sx:{minWidth:236},children:u.map(((r,a)=>{var d,c,u,p,h;return z.jsxs(t.Box,{sx:{mt:0===a?0:20},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,typography:"body2",fontWeight:600,color:"text.primary"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:r.token?z.jsxs(z.Fragment,{children:[z.jsx(sl,{width:14,height:14,marginRight:4,address:r.token.address,url:r.token.logoURI,chainId:n,noShowChain:!0}),r.token.symbol]}):z.jsxs(z.Fragment,{children:[z.jsx(Pp,{tokens:[i,o],width:14,mr:4,chainId:n}),i.symbol,"/",null==o?void 0:o.symbol]})}),z.jsx(t.Box,{children:fr(new s(null!==(u=r.transactionApy)&&void 0!==u?u:0).plus(null!==(p=r.miningApy)&&void 0!==p?p:0).plus(null!==(h=r.metromMiningApy)&&void 0!==h?h:0))})]}),z.jsxs(t.Box,{sx:{mt:8,display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[z.jsx("span",{children:z.jsx(e.Trans,{id:"OnDEky",message:"LP Fee"})}),z.jsx("span",{children:r.transactionApy?fr(new s(r.transactionApy)):"-"})]}),l?z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[z.jsx("span",{children:z.jsx(e.Trans,{id:"pSQ1lM",message:"MT Fee"})}),z.jsx("span",{children:r.miningApy?fr(new s(r.miningApy)):"-"})]}):"",r.metromMiningApy&&Number(r.metromMiningApy)>0&&z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[z.jsx("span",{children:z.jsx(e.Trans,{id:"Sti4vy",message:"Mining"})}),z.jsx("span",{children:r.metromMiningApy?fr(new s(r.metromMiningApy)):"-"})]})]},null!==(c=null===(d=r.token)||void 0===d?void 0:d.address)&&void 0!==c?c:1)}))})})}function Fy({lqList:n,setOperatePool:i,getMigrationPairAndMining:o,supportAMM:a,timeRange:l}){const d=t.useTheme(),{onSharePool:c}=Q();return z.jsx(z.Fragment,{children:null==n?void 0:n.map((n=>{var u,p,h,m,x,g,f,y,v;if(!(null==n?void 0:n.pair))return null;const b=n.pair,C=ba(b.baseToken,b.chainId),j=ba(b.quoteToken,b.chainId),w=null===(u=b.apyList)||void 0===u?void 0:u.find((e=>(null==e?void 0:e.timeRange)===`${l}D`)),k=w?fr(new s(null==w?void 0:w.transactionBaseApy).plus(null!==(p=null==w?void 0:w.miningBaseApy)&&void 0!==p?p:0)):void 0,T=r.PoolApi.utils.singleSideLp(b.type)&&w?fr(new s(w.transactionQuoteApy).plus(null!==(h=w.miningQuoteApy)&&void 0!==h?h:0)):void 0,B=!!(null===(m=b.miningAddress)||void 0===m?void 0:m[0]),E=!!(null==w?void 0:w.metromMiningApy)&&Number(null==w?void 0:w.metromMiningApy)>0,I=b.type,A=wa(I),S="AMMV2"===I,L="AMMV3"===I,M=null==o?void 0:o({address:b.id,chainId:b.chainId});return z.jsxs(t.Box,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{a||pm.getState().push({type:exports.PageType.PoolDetail,params:{chainId:b.chainId,address:b.id}})},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[C&&j?z.jsx(Pp,{tokens:[C,j],width:24,mr:6,chainId:b.chainId,showChainLogo:!0}):"",z.jsxs(t.Box,{sx:{typography:"body2",fontWeight:600},children:[`${null==C?void 0:C.symbol}/${null==j?void 0:j.symbol}`,!!c&&z.jsx(t.Box,{component:oe.Share,sx:{ml:2,width:12,height:12},onClick:()=>c({chainId:b.chainId,baseToken:C,quoteToken:j,poolId:b.id,apy:w,isSingle:r.PoolApi.utils.singleSideLp(b.type)})}),z.jsx(By,{address:b.id,chainId:b.chainId})]}),!!M&&z.jsx(Dy,{})]}),B||E?z.jsxs(t.Box,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${t.alpha(d.palette.secondary.main,.3)} 0%, ${t.alpha(d.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",z.jsx(e.Trans,{id:"Sti4vy",message:"Mining"})]}):""]}),z.jsxs(t.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[a&&z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[A,z.jsx(t.Tooltip,{title:z.jsx(e.Trans,{id:"O6RUgz",message:"Fee rate"}),children:z.jsx(t.Box,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:L?null!==(g=null===(x=yg[b.lpFeeRate])||void 0===x?void 0:x.label)&&void 0!==g?g:"-":gr({input:new s(null!==(f=b.lpFeeRate)&&void 0!==f?f:0).plus(b.mtFeeRate?lr(b.mtFeeRate,S?4:18):0)})})})]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"1Qz63U",message:"Pool Type"})})]}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h5",color:"success.main"},children:[k,T?`/${T}`:""]}),z.jsxs(t.Box,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[l,"d ",z.jsx(e.Trans,{id:"rSayea",message:"APY"}),z.jsx(Ny,{chainId:b.chainId,apy:w,baseToken:C,quoteToken:j,hasQuote:!!T,hasMining:B,sx:{width:14,height:14}})]})]}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h5"},children:["$",xr(new s(b.tvl))]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})})]}),a&&z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:["$",nr({input:null===(v=null===(y=b.volumeList)||void 0===y?void 0:y.find((e=>(null==e?void 0:e.timeRange)===`${l}D`)))||void 0===v?void 0:v.volume})]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"iuFFMB",message:"Volume ({timeRange}d)",values:{timeRange:l}})})]})]}),z.jsxs(t.Box,{sx:{mt:20,display:"flex",alignItems:"center",gap:"8px"},children:[z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),i({pool:Ca(n),hasMining:B})},children:z.jsx(e.Trans,{id:"m16xKo",message:"Add"})}),a&&"PMM"===A&&z.jsx(nf,{chainId:b.chainId,address:b.id})]})]},b.id+b.chainId)}))})}function Uy({lqList:n,loading:i,operatePool:a,setOperatePool:l,getMigrationPairAndMining:d,hasMore:c,loadMore:u,loadMoreLoading:p,supportAMM:h,timeRange:m}){const x=t.useTheme(),{onSharePool:g}=Q();return z.jsxs(of,{hasMore:c,loadMore:u,loadMoreLoading:p,empty:!(null==n?void 0:n.length),loading:i,children:[z.jsx(t.Box,{component:"thead",children:z.jsxs(t.Box,{component:"tr",children:[z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"AxdOHo",message:"Pair"})}),h&&z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"1Qz63U",message:"Pool Type"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})}),z.jsxs(t.Box,{component:"th",children:[m,"d ",z.jsx(e.Trans,{id:"rSayea",message:"APY"})]}),h&&z.jsxs("th",{children:[m,"d ",z.jsx(e.Trans,{id:"/cF7Rs",message:"Volume"})]}),z.jsx(t.Box,{component:"th",sx:{width:80}})]})}),z.jsx(t.Box,{component:"tbody",children:null==n?void 0:n.map((e=>{var n,i,c,u,p,f,y,v;if(!(null==e?void 0:e.pair))return null;const b=e.pair,C=ba(b.baseToken,b.chainId),j=ba(b.quoteToken,b.chainId),w=null===(n=b.apyList)||void 0===n?void 0:n.find((e=>(null==e?void 0:e.timeRange)===`${m}D`)),k=w?fr(new s(null==w?void 0:w.transactionBaseApy).plus(null!==(i=null==w?void 0:w.miningBaseApy)&&void 0!==i?i:0).plus(null!==(c=null==w?void 0:w.metromMiningApy)&&void 0!==c?c:0)):void 0,T=r.PoolApi.utils.singleSideLp(b.type)&&w?fr(new s(w.transactionQuoteApy).plus(null!==(u=w.miningQuoteApy)&&void 0!==u?u:0)):void 0;let B="";if((null===(p=null==a?void 0:a.pool)||void 0===p?void 0:p.address)===b.id||(null==a?void 0:a.address)===b.id)if(a.operate===df.Remove)B=o.i18n._({id:"0+31GV",message:"Removing"});else B=o.i18n._({id:"1yHVE+",message:"Adding"});const E=!!(null===(f=b.miningAddress)||void 0===f?void 0:f[0]),I=!!(null==w?void 0:w.metromMiningApy)&&Number(null==w?void 0:w.metromMiningApy)>0,A=b.type,S=wa(A),L="AMMV2"===A,M="AMMV3"===A,R=x.palette.hover.default,O=null==d?void 0:d({address:b.id,chainId:b.chainId});return z.jsxs(t.Box,{component:"tr",sx:{["&:hover td"+(B?", & td":"")]:{backgroundImage:`linear-gradient(${R}, ${R})`}},children:[z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[C&&j?z.jsx(Pp,{tokens:[C,j],width:24,mr:8,chainId:b.chainId,showChainLogo:!0}):"",z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==C?void 0:C.symbol}/${null==j?void 0:j.symbol}`,z.jsx(By,{address:b.id,chainId:b.chainId}),!!O&&z.jsx(Dy,{})]}),z.jsx(lp,{address:b.id,customChainId:b.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,onShareClick:g?()=>g({chainId:b.chainId,baseToken:C,quoteToken:j,poolId:b.id,apy:w,isSingle:r.PoolApi.utils.singleSideLp(b.type)}):void 0,sx:{typography:"h6",color:"text.secondary"},disabledAddress:h,onAddressClick:()=>{pm.getState().push({type:exports.PageType.PoolDetail,params:{chainId:b.chainId,address:b.id}})}})]})]})}),h&&z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(vg,{poolType:S}),z.jsx(bg,{isAMMV2:L,isAMMV3:M,lpFeeRate:b.lpFeeRate,mtFeeRate:b.mtFeeRate})]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{typography:"body2"},title:b.tvl?`$${nr({input:b.tvl})}`:void 0,children:["$",xr(new s(b.tvl))]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[E||I?z.jsx(t.Tooltip,{title:o.i18n._({id:"Sti4vy",message:"Mining"}),children:z.jsxs(t.Box,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",z.jsx(Ny,{chainId:b.chainId,apy:w,baseToken:C,quoteToken:j,hasQuote:!!T,hasMining:E,children:z.jsxs(t.Box,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[k,T?`/${T}`:""]})})]})}),h&&z.jsxs(t.Box,{component:"td",sx:{typography:"body2"},children:["$",nr({input:null===(v=null===(y=b.volumeList)||void 0===y?void 0:y.find((e=>(null==e?void 0:e.timeRange)===`${m}D`)))||void 0===v?void 0:v.volume})]}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[h&&"PMM"===S&&z.jsx(nf,{chainId:b.chainId,address:b.id}),B?z.jsx(Jg,{text:B,onClick:()=>l(null)}):z.jsx(t.Button,{size:t.Button.Size.small,onClick:()=>{l({pool:Ca(e),hasMining:E})},sx:{py:0,height:32},children:o.i18n._({id:"m16xKo",message:"Add"})})]})})]},b.id+b.chainId)}))})]})}function qy({scrollParentRef:e,filterChainIds:o,activeChainId:a,handleChangeActiveChainId:s,operatePool:l,setOperatePool:d,tokenAndPoolFilter:u,getMigrationPairAndMining:p,children:h}){var m,x;const g=t.useTheme(),{onlyChainId:f,supportAMMV2:y,supportAMMV3:v,notSupportPMM:b}=Q(),{minDevice:C,isMobile:j}=Xa(),w=c.useQueryClient(),[k,T]=n.useState("all"),[B,E]=n.useState("1"),{filterTokens:I,filterASymbol:A,filterBSymbol:L,filterAddressLqList:M,handleDeleteToken:R,handleChangeFilterTokens:O,handleChangeFilterAddress:P}=lf(u),_=n.useMemo((()=>{if(v&&"v3"===k)return["AMMV3"];if(y&&"v2"===k)return["AMMV2"];if(!b&&"pmm"===k)return["CLASSICAL","DVM","DSP","GSP"];let e=b?[]:["CLASSICAL","DVM","DSP","GSP"];return y&&e.push("AMMV2"),v&&e.push("AMMV3"),e}),[b,y,v,k]),D=n.useMemo((()=>({chainIds:o,pageSize:j?4:8,filterState:{viewOnlyOwn:!1,filterTypes:_}})),[o,_,j]),F=qa(),U=F.getInfiniteQuery(r.PoolApi.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},D),{filterState:Object.assign({filterASymbol:A,filterBSymbol:L},D.filterState)})}),q=c.useInfiniteQuery(Object.assign(Object.assign({},U),{initialPageParam:1,getNextPageParam:e=>{var t;const{currentPage:n,totalCount:i,pageSize:o}=null!==(t=e.liquidity_list)&&void 0!==t?t:{};if(!n||!i||!o)return null;let r=Math.floor(i/o);return i%o&&(r+=1),n>=r?null:n+1}}));let V=[];const W=!!(null==M?void 0:M.length);W?V=[...M]:null===(m=q.data)||void 0===m||m.pages.forEach((e=>{var t,n;null===(n=null===(t=e.liquidity_list)||void 0===t?void 0:t.lqList)||void 0===n||n.forEach((e=>{null==V||V.push(e)}))}));const H=q.hasNextPage&&!W;return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pt:12,pb:20,display:"flex",flexDirection:"column",gap:12,[g.breakpoints.up("tablet")]:{py:16,flexDirection:"row",alignItems:"center",gap:8,px:0,justifyContent:"space-between"}},children:[z.jsx(t.Box,{sx:{[g.breakpoints.up("tablet")]:{mr:"auto"}},children:h}),!f&&z.jsx(Py,{chainId:a,setChainId:s}),(y||v)&&z.jsx(_y,{filterList:[{label:"All",value:"all"}].concat(b?[]:[{label:"PMM",value:"pmm"}]).concat(y?[{label:"V2",value:"v2"}]:[]).concat(v?[{label:"V3",value:"v3"}]:[]),value:k,onChange:e=>T(e)}),z.jsx(_y,{filterList:[{label:"1d",value:"1"},{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"}],value:B,onChange:e=>E(e)}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:Object.assign({flex:1,display:"flex",alignItems:"center",gap:8},j?{}:{"& > button":{flex:1}}),children:null!==(x=null==u?void 0:u.element)&&void 0!==x?x:z.jsx(af,{value:I,onChange:O,searchAddress:(e,t)=>N(this,void 0,void 0,(function*(){var n;const i=F.getInfiniteQuery(r.PoolApi.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},D),{filterState:Object.assign({address:e},D.filterState)})}),o=null===(n=(yield w.fetchQuery(i)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==o?void 0:o.length)?z.jsx(sf,{list:o,onClick:()=>{P(o),t()}}):null}))})}),(W||!!I.length)&&z.jsxs(t.Box,{sx:{my:0},children:[W?z.jsx(ef,{lqList:M,onDeleteTag:()=>P([])}):"",z.jsx(tf,{tags:I,onDeleteTag:R})]})]})]}),j?z.jsx(S,{hasMore:H,threshold:300,loadMore:i.debounce((()=>{q.hasNextPage&&!q.isFetching&&q.fetchNextPage()}),500),useWindow:!1,getScrollParent:()=>e.current||null,loader:z.jsx(rf,{sx:{mt:20}},"loader"),children:z.jsxs(Kg,{children:[q.isLoading?z.jsx(rf,{}):"",!q.isLoading&&!(null==V?void 0:V.length)&&!q.error&&z.jsx(X,{sx:{mt:40},hasSearch:!!(a&&!f||A||L)}),!!q.error&&z.jsx(ne,{refresh:q.refetch,sx:{mt:40}}),z.jsx(Fy,{lqList:V,setOperatePool:d,supportAMM:y||v,getMigrationPairAndMining:p,timeRange:B})]})}):z.jsxs(z.Fragment,{children:[z.jsx(Uy,{lqList:V,loading:q.isLoading,operatePool:l,setOperatePool:d,hasMore:H,loadMoreLoading:q.isFetchingNextPage,loadMore:()=>{q.hasNextPage&&!q.isFetching&&q.fetchNextPage()},supportAMM:y||v,timeRange:B,getMigrationPairAndMining:p}),z.jsx(_p,{loading:q.isLoading,refetch:q.error?q.refetch:void 0,empty:!(null==V?void 0:V.length),hasSearch:!!(a&&!f||A||L)})]})]})}function Vy({onClick:e,title:n,desc:i}){const o=t.useTheme();return z.jsx(t.Box,{sx:{mx:20,px:0,py:14,borderTop:`1px solid ${o.palette.border.main}`,[o.breakpoints.up("tablet")]:{maxWidth:236,borderTop:"none",mx:0,px:16,py:8}},children:z.jsxs(t.ButtonBase,{onClick:e,sx:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:0,p:0,borderRadius:8,textAlign:"left","&:hover":{backgroundColor:o.palette.background.tag},[o.breakpoints.up("tablet")]:{p:8}},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:o.palette.text.primary},children:n}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary},children:i})]})})}const Wy=i=>{const o=t.useTheme(),{isMobile:r}=Xa(),{supportAMMV2:a,supportAMMV3:s,notSupportPMM:l}=Q(),[d,c]=n.useState(!1),u={[exports.PageType.CreatePool]:!l,[exports.PageType.createPoolAMMV2]:!!a,[exports.PageType.createPoolAMMV3]:!!s},p=Object.entries(u).filter((([e,t])=>!0===t)),h=1===p.length?p[0][0]:void 0;if(!h){const n=z.jsxs(z.Fragment,{children:[!l&&z.jsx(Vy,{onClick:()=>{pm.getState().push({type:exports.PageType.CreatePool})},title:z.jsx(e.Trans,{id:"Eif7f6",message:"PMM Pool"}),desc:z.jsx(e.Trans,{id:"LQ0J1B",message:"Flexible customization, take full control of liquidity"})}),a&&z.jsx(Vy,{onClick:()=>{pm.getState().push({type:exports.PageType.createPoolAMMV2})},title:z.jsx(e.Trans,{id:"lNYomJ",message:"AMM V2 Position"}),desc:z.jsx(e.Trans,{id:"lLbR0m",message:"Simple, full-range liquidity"})}),s&&z.jsx(Vy,{onClick:()=>{pm.getState().push({type:exports.PageType.createPoolAMMV3})},title:z.jsx(e.Trans,{id:"sVlqoo",message:"AMM V3 Position"}),desc:z.jsx(e.Trans,{id:"EkAv3P",message:"Concentrated liquidity, higher efficiency"})})]});return r?z.jsxs(z.Fragment,{children:[z.jsxs(t.Button,{variant:t.Button.Variant.second,fullWidth:!0,onClick:()=>{c(!0)},sx:{height:36},children:[z.jsx(t.Box,{component:oe.Plus,sx:{mr:4}}),z.jsx(e.Trans,{id:"p2jbcE",message:"Create Pool"})]}),z.jsx(el,{open:d,title:z.jsx(e.Trans,{id:"p2jbcE",message:"Create Pool"}),onClose:()=>{c(!1)},modal:!0,children:z.jsx(t.Box,{sx:{mb:0},children:n})})]}):z.jsx(t.Tooltip,{arrow:!1,leaveDelay:300,placement:r?"bottom":"bottom-end",sx:{p:0,backgroundColor:"background.paper"},title:z.jsx(t.Box,{children:n}),children:z.jsxs(t.Box,{sx:{width:r?"100%":"auto",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,pl:8,pr:16,py:6,borderRadius:40,backgroundColor:o.palette.background.tag,typography:"body2",fontWeight:600,color:o.palette.text.link,cursor:"pointer","&:hover":{backgroundColor:t.alpha(o.palette.primary.main,.1)}},children:[z.jsx(t.Box,{component:oe.Plus}),z.jsx(e.Trans,{id:"p2jbcE",message:"Create Pool"})]})})}return z.jsxs(t.Button,{variant:t.Button.Variant.outlined,fullWidth:r,onClick:()=>{pm.getState().push({type:h})},sx:{height:40},children:[z.jsx(t.Box,{component:oe.Plus,sx:{mr:4}}),z.jsx(e.Trans,{id:"p2jbcE",message:"Create Pool"})]})},Hy="DODO_WIDGET_POOL_LIST_TOP_TAB",Zy="DODO_WIDGET_POOL_LIST_TAB",zy="DODO_WIDGET_POOLS_LIST_FILTER_CHAIN";var $y,Gy,Qy,Yy;!function(e){e.ALM="ALM",e.NORMAL="NORMAL",e.MULTI_TOKEN="MULTI_TOKEN"}($y||($y={})),function(e){e.ALL="ALL",e.MY="MY"}(Gy||(Gy={})),function(e){e.addLiquidity="add-liquidity",e.myLiquidity="my-liquidity",e.myCreated="my-created"}(Qy||(Qy={})),function(e){e.ALL="ALL",e.MY="MY"}(Yy||(Yy={}));const Xy=(e,n,i)=>{let r=o.i18n._({id:"TJBHlP",message:"Standard"}),a=i.palette.purple.main;switch(e){case"DSP":r=o.i18n._({id:"J7M/DA",message:"Pegged"}),a=i.palette.success.main;break;case"DPP":r=o.i18n._({id:"zwBp5t",message:"Private"}),a=i.palette.error.main}"DVM"===e&&(!n||n.isZero())&&(r=o.i18n._({id:"S8G1qk",message:"Single"}),a=i.palette.warning.main);return{typeLabel:r,typeColor:a,typeBgColor:t.alpha(a,.1)}};function Ky({account:n,list:i,setOperatePool:o}){const r=t.useTheme();return z.jsx(z.Fragment,{children:null==i?void 0:i.map((i=>{var a,l,d,c,u;if(!i)return null;const p=null!==(a=i.pairAddress)&&void 0!==a?a:"",h=i.chainId,m=i.poolType,x={chainId:h,address:null!==(l=i.baseAddress)&&void 0!==l?l:"",symbol:null!==(d=i.baseSymbol)&&void 0!==d?d:""},g={chainId:h,address:null!==(c=i.quoteAddress)&&void 0!==c?c:"",symbol:null!==(u=i.quoteSymbol)&&void 0!==u?u:""},{typeLabel:f,typeColor:y,typeBgColor:v}=Xy(m,i.quoteReserve?new s(i.quoteReserve):null,r);return z.jsxs(t.Box,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{pm.getState().push({type:exports.PageType.PoolDetail,params:{chainId:h,address:p}})},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[x&&g?z.jsx(Pp,{tokens:[x,g],width:24,mr:8,chainId:h,showChainLogo:!0}):"",z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600},children:Ea(p)}),"DPP"===m&&z.jsx(t.HoverAddBackground,{sx:{ml:2},component:t.ButtonBase,onClick:e=>{e.stopPropagation(),pm.getState().push({type:exports.PageType.ModifyPool,params:{chainId:h,address:p}})},children:z.jsx(t.Box,{component:oe.Edit,sx:{width:12,height:12,cursor:"pointer"}})})]}),z.jsx(t.Box,{sx:{typography:"h6",width:"max-content",p:8,borderRadius:8,backgroundColor:v,color:y},children:f})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",mt:44},children:[z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h5"},children:["$",i.tvl?xr(new s(i.tvl)):"-"]}),z.jsx(t.Box,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})})]}),z.jsx(t.Box,{sx:{display:"inline-block",mx:20,height:24,width:"1px",backgroundColor:"custom.border.default"}}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h5"},children:["$",i.totalFee?xr(new s(i.totalFee)):"-"]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"hCBYHP",message:"Total Fee Revenue"})})]})]}),z.jsxs(t.Box,{sx:{mt:20,display:"flex",gap:"8px"},children:[!!n&&z.jsx(t.Button,{fullWidth:!0,variant:t.Button.Variant.outlined,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),o({address:p,operate:df.Remove,chainId:h})},children:z.jsx(e.Trans,{id:"t/YqKh",message:"Remove"})}),z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),o({address:p,operate:df.Add,chainId:h})},children:z.jsx(e.Trans,{id:"m16xKo",message:"Add"})})]})]},p+h)}))})}function Jy({account:n,list:i,loading:r,operatePool:a,setOperatePool:l}){const d=t.useTheme(),c=pm();return z.jsxs(of,{empty:!(null==i?void 0:i.length),loading:r,children:[z.jsx(t.Box,{component:"thead",children:z.jsxs(t.Box,{component:"tr",children:[z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"AxdOHo",message:"Pair"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"hCBYHP",message:"Total Fee Revenue"})}),z.jsx(t.Box,{component:"th",sx:{width:160}})]})}),z.jsx(t.Box,{component:"tbody",children:null==i?void 0:i.map((i=>{var r,u,p,h,m,x;if(!i)return null;const g="DPP"===i.poolType,f=null!==(r=i.pairAddress)&&void 0!==r?r:"",y=i.chainId,v=i.poolType,b={chainId:y,address:null!==(u=i.baseAddress)&&void 0!==u?u:"",symbol:null!==(p=i.baseSymbol)&&void 0!==p?p:""},C={chainId:y,address:null!==(h=i.quoteAddress)&&void 0!==h?h:"",symbol:null!==(m=i.quoteSymbol)&&void 0!==m?m:""},{typeLabel:j,typeColor:w,typeBgColor:k}=Xy(v,i.quoteReserve?new s(i.quoteReserve):null,d);let T="";if((null===(x=null==a?void 0:a.pool)||void 0===x?void 0:x.address)===f||(null==a?void 0:a.address)===f)if((null==a?void 0:a.operate)===df.Remove)T=o.i18n._({id:"0+31GV",message:"Removing"});else T=o.i18n._({id:"1yHVE+",message:"Adding"});const B=d.palette.hover.default;return z.jsxs(t.Box,{component:"tr",sx:{["&:hover td"+(T?", & td":"")]:{backgroundImage:`linear-gradient(${B}, ${B})`}},children:[z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[b&&C?z.jsx(Pp,{tokens:[b,C],width:24,mr:10,chainId:y,showChainLogo:!0}):"",z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsxs(t.HoverAddUnderLine,{lineSx:{bottom:-1},lineColor:"primary.main",hoverSx:{color:"primary.main","& svg":{display:"inline-block"}},className:"truncate-address-link",sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600},onClick:()=>{c.push({type:exports.PageType.PoolDetail,params:{chainId:y,address:f}})},children:Ea(f)}),z.jsx(t.Box,{component:oe.ArrowRight,sx:{display:"none",width:14,height:14}})]}),g?z.jsx(t.Box,{sx:{typography:"h6",px:8,py:2,ml:8,borderStyle:"solid",borderWidth:1,borderColor:"text.primary",borderRadius:4,whiteSpace:"nowrap",cursor:"pointer","&:hover":{backgroundColor:t.alpha(d.palette.text.primary,.1)}},onClick:()=>{c.push({type:exports.PageType.ModifyPool,params:{chainId:y,address:f}})},children:z.jsx(e.Trans,{id:"ePK91l",message:"Edit"})}):""]}),z.jsx(t.Box,{sx:{typography:"h6",width:"max-content",mt:2,px:8,py:2,borderRadius:12,backgroundColor:k,color:w},children:j})]})]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{typography:"body2"},title:i.tvl?`$${nr({input:i.tvl})}`:void 0,children:["$",i.tvl?xr(new s(i.tvl)):"-"]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{title:i.totalFee?`$${nr({input:i.totalFee})}`:"",sx:{typography:"body2",fontWeight:600},children:["$",i.totalFee?xr(new s(i.totalFee)):"-"]})}),z.jsx(t.Box,{component:"td",children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:T?z.jsx(Jg,{text:T,onClick:()=>l(null)}):z.jsxs(z.Fragment,{children:[!!n&&z.jsx(t.Button,{variant:t.Button.Variant.second,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),l({operate:df.Remove,chainId:y,address:f})},sx:{py:0,height:32},children:z.jsx(e.Trans,{id:"t/YqKh",message:"Remove"})}),z.jsx(t.Button,{size:t.Button.Size.small,onClick:()=>{l({chainId:y,address:f})},sx:{py:0,height:32},children:o.i18n._({id:"m16xKo",message:"Add"})})]})})})]},f+y)}))})]})}function ev({account:i,filterChainIds:o,activeChainId:a,handleChangeActiveChainId:s,operatePool:l,setOperatePool:d,children:u}){var p,h,m,x,g,f;const{isMobile:y}=Xa(),v=t.useTheme(),{onlyChainId:b}=Q(),C={limit:1e3,page:1,owner:i},j=qa().getQuery(r.PoolApi.graphql.fetchDashboardPairList,{where:C}),w=c.useQuery(Object.assign({},j)),k=null!==(f=o?null===(m=null===(h=null===(p=w.data)||void 0===p?void 0:p.dashboard_pairs_list)||void 0===h?void 0:h.list)||void 0===m?void 0:m.filter((e=>{var t;return o.includes(null!==(t=null==e?void 0:e.chainId)&&void 0!==t?t:0)})):null===(g=null===(x=w.data)||void 0===x?void 0:x.dashboard_pairs_list)||void 0===g?void 0:g.list)&&void 0!==f?f:[],[T,B]=n.useState(!1),E=T?k.filter((e=>!!Number(null==e?void 0:e.tvl))):k;return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pt:12,pb:20,display:"flex",flexDirection:"column",gap:12,[v.breakpoints.up("tablet")]:{py:16,flexDirection:"row",alignItems:"center",gap:8,px:0,justifyContent:"space-between"}},children:[z.jsx(t.Box,{sx:{[v.breakpoints.up("tablet")]:{mr:"auto"}},children:u}),!b&&z.jsx(Py,{chainId:a,setChainId:s}),z.jsxs(t.Box,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[z.jsx(t.Checkbox,{sx:{top:-1},size:16,checked:T,onChange:e=>{const{checked:t}=e.target;B(t)}}),z.jsx(e.Trans,{id:"eVZ7bY",message:"Hide TVL=0 pools"})]})]}),y?z.jsxs(Kg,{children:[w.isLoading?z.jsx(rf,{}):"",!w.isLoading&&!(null==E?void 0:E.length)&&!w.error&&z.jsx(X,{sx:{mt:40},hasSearch:!!a&&!b}),!!w.error&&z.jsx(ne,{refresh:w.refetch,sx:{mt:40}}),z.jsx(Ky,{account:i,list:E,setOperatePool:d})]}):z.jsxs(z.Fragment,{children:[z.jsx(Jy,{account:i,list:E,loading:w.isLoading,operatePool:l,setOperatePool:d}),z.jsx(_p,{loading:w.isLoading,refetch:w.error?w.refetch:void 0,empty:!(null==E?void 0:E.length),hasSearch:!!a&&!b})]})]})}function tv({account:n,lqList:i,setOperatePool:o,getMigrationPairAndMining:a,supportAMM:l,timeRange:d}){const c=t.useTheme();return z.jsx(z.Fragment,{children:null==i?void 0:i.map((i=>{var u,p,h,m,x,g,f,y,v,b,C,j,w,k,T;if(!(null==i?void 0:i.pair))return null;const B=i.pair,E=ba(B.baseToken,B.chainId),I=ba(B.quoteToken,B.chainId),A=null===(u=B.apyList)||void 0===u?void 0:u.find((e=>(null==e?void 0:e.timeRange)===`${d}D`)),S=r.PoolApi.utils.singleSideLp(B.type),L=A?fr(new s(null==A?void 0:A.transactionBaseApy).plus(null!==(p=null==A?void 0:A.miningBaseApy)&&void 0!==p?p:0).plus(null!==(h=null==A?void 0:A.metromMiningApy)&&void 0!==h?h:0)):void 0,M=S&&A?fr(new s(A.transactionQuoteApy).plus(null!==(m=A.miningQuoteApy)&&void 0!==m?m:0)):void 0;let R,O;(null===(x=i.liquidityPositions)||void 0===x?void 0:x.length)&&i.liquidityPositions.forEach((e=>{var t,n,i,o,r;if(null==e?void 0:e.liquidityTokenBalance){const a=null===(t=e.id)||void 0===t?void 0:t.split("-");if(2===(null==a?void 0:a.length)){const t=a[1].toLocaleLowerCase();if((null===(i=null===(n=null==B?void 0:B.baseLpToken)||void 0===n?void 0:n.id)||void 0===i?void 0:i.toLocaleLowerCase())===t)return void(R=new s(e.liquidityTokenBalance));(null===(r=null===(o=null==B?void 0:B.quoteLpToken)||void 0===o?void 0:o.id)||void 0===r?void 0:r.toLocaleLowerCase())===t&&(O=new s(e.liquidityTokenBalance))}}}));const P=!!(null===(g=B.miningAddress)||void 0===g?void 0:g[0]),_=!!(null==A?void 0:A.metromMiningApy)&&Number(null==A?void 0:A.metromMiningApy)>0,D=null===(f=i.liquidityPositions)||void 0===f?void 0:f[0],N=B.type,F=wa(N),U="AMMV2"===N,q="AMMV3"===N,V=null==a?void 0:a({address:B.id,chainId:B.chainId});return z.jsxs(t.Box,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{l||pm.getState().push({type:exports.PageType.PoolDetail,params:{chainId:B.chainId,address:B.id}})},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[E&&I?z.jsx(Pp,{tokens:[E,I],width:24,mr:6,chainId:B.chainId,showChainLogo:!0}):"",z.jsxs(t.Box,{sx:{typography:"body2",fontWeight:600},children:[`${null==E?void 0:E.symbol}/${null==I?void 0:I.symbol}`,z.jsx(By,{address:B.id,chainId:B.chainId})]}),!!V&&z.jsx(Dy,{})]}),P||_?z.jsxs(t.Box,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${t.alpha(c.palette.secondary.main,.3)} 0%, ${t.alpha(c.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",z.jsx(e.Trans,{id:"Sti4vy",message:"Mining"})]}):""]}),z.jsxs(t.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",rowGap:20,mt:44,"& > div:nth-child(odd)":{pr:20},"& > div:nth-child(even)":{position:"relative",pl:20,"&::before":{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",display:"inline-block",content:'""',height:24,width:"1px",backgroundColor:"border.main"}}},children:[l&&z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[F,z.jsx(t.Tooltip,{title:z.jsx(e.Trans,{id:"O6RUgz",message:"Fee rate"}),children:z.jsx(t.Box,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:q?null!==(v=null===(y=yg[B.lpFeeRate])||void 0===y?void 0:y.label)&&void 0!==v?v:"-":gr({input:new s(null!==(b=B.lpFeeRate)&&void 0!==b?b:0).plus(B.mtFeeRate?lr(B.mtFeeRate,U?4:18):0)})})})]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"1Qz63U",message:"Pool Type"})})]}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h5",color:"success.main"},children:[L||"-%",M?`/${M}`:""]}),z.jsxs(t.Box,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[d,"d ",z.jsx(e.Trans,{id:"rSayea",message:"APY"}),z.jsx(Ny,{chainId:B.chainId,apy:A,baseToken:E,quoteToken:I,hasQuote:!!M,hasMining:P,sx:{width:14,height:14}})]})]}),q?null:z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h5"},children:["$",xr(new s(B.tvl||0))]}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})})]}),"AMMV2"===N&&z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"h5"},children:gr({input:null===(j=null===(C=i.liquidityPositions)||void 0===C?void 0:C[0])||void 0===j?void 0:j.poolShare})}),z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"h3PbRN",message:"My Pool Share"})})]}),z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"h5",display:"flex",alignItems:"center",fontWeight:"bold"},children:q?(null==D?void 0:D.liquidityUSD)?`$${ir({input:D.liquidityUSD,decimals:2})}`:"-":z.jsxs(z.Fragment,{children:[S?z.jsx(sl,{address:null==E?void 0:E.address,chainId:B.chainId,url:null==E?void 0:E.logoURI,width:18,height:18,sx:{mr:4}}):z.jsx(Pp,{tokens:E&&I?[E,I]:[],width:18,mr:4,showChainLogo:!1,chainId:B.chainId}),R?nr({input:R}):"",S&&z.jsxs(z.Fragment,{children:[" / ",z.jsx(sl,{address:null==I?void 0:I.address,chainId:B.chainId,url:null==I?void 0:I.logoURI,width:18,height:18,sx:{mx:4}}),O?nr({input:O}):"0"]})]})}),z.jsx(t.Box,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:z.jsx(e.Trans,{id:"YHc3B+",message:"My Liquidity"})})]})]}),q&&z.jsxs(t.Box,{sx:{mt:20},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[z.jsx(Qg,{outOfRange:null!==(w=null==D?void 0:D.outOfRange)&&void 0!==w&&w}),z.jsx(t.Box,{children:z.jsxs(z.Fragment,{children:[z.jsxs("span",{children:[mg({price:null===(k=null==D?void 0:D.priceRange)||void 0===k?void 0:k.token0LowerPrice,atLimit:{},direction:Em.LOWER})," "]}),null==E?void 0:E.symbol]})}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:z.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),z.jsx(t.Box,{children:z.jsxs(z.Fragment,{children:[z.jsxs("span",{children:[mg({price:null===(T=null==D?void 0:D.priceRange)||void 0===T?void 0:T.token1LowerPrice,atLimit:{},direction:Em.UPPER})," "]}),null==E?void 0:E.symbol]})})]}),z.jsx(t.Box,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:z.jsx(e.Trans,{id:"YA4hwj",message:"Price Range"})})]}),z.jsxs(t.Box,{sx:{mt:20,display:"flex",alignItems:"center",gap:"8px"},children:[q?null:!!n&&z.jsx(t.Button,{fullWidth:!0,variant:t.Button.Variant.outlined,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),o({operate:df.Remove,pool:ja(i),hasMining:P})},children:z.jsx(e.Trans,{id:"t/YqKh",message:"Remove"})}),z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),o({operate:df.Add,pool:ja(i),hasMining:P})},children:z.jsx(e.Trans,{id:"J/hVSQ",message:"{0}",values:{0:q?"Manage":"Add"}})}),l&&"PMM"===F&&z.jsx(nf,{chainId:B.chainId,address:B.id})]})]},q?null==D?void 0:D.id:B.id+B.chainId)}))})}function nv({account:n,lqList:i,loading:a,operatePool:l,setOperatePool:d,supportAMM:c,onlyV3:u,getMigrationPairAndMining:p,timeRange:h}){const m=t.useTheme();return z.jsxs(of,{empty:!(null==i?void 0:i.length),loading:a,children:[z.jsx(t.Box,{component:"thead",children:z.jsxs(t.Box,{component:"tr",children:[z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"AxdOHo",message:"Pair"})}),c&&z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"1Qz63U",message:"Pool Type"})}),u?null:z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"FHKsZF",message:"TVL"})}),z.jsxs(t.Box,{component:"th",children:[h,"d ",z.jsx(e.Trans,{id:"rSayea",message:"APY"})]}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"YHc3B+",message:"My Liquidity"})}),u?z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"YA4hwj",message:"Price Range"})}):null,z.jsx(t.Box,{component:"th",sx:{width:210}})]})}),z.jsx(t.Box,{component:"tbody",children:null==i?void 0:i.map((i=>{var a,x,g,f,y,v,b,C,j,w,k,T,B,E,I;if(!(null==i?void 0:i.pair))return null;const A=i.pair,S=ba(A.baseToken,A.chainId),L=ba(A.quoteToken,A.chainId),M=r.PoolApi.utils.singleSideLp(A.type),R=null===(a=A.apyList)||void 0===a?void 0:a.find((e=>(null==e?void 0:e.timeRange)===`${h}D`)),O=R?fr(new s(null==R?void 0:R.transactionBaseApy).plus(null!==(x=null==R?void 0:R.miningBaseApy)&&void 0!==x?x:0)):void 0,P=M&&R?fr(new s(R.transactionQuoteApy).plus(null!==(g=R.miningQuoteApy)&&void 0!==g?g:0)):void 0;let _,D;(null===(f=i.liquidityPositions)||void 0===f?void 0:f.length)&&i.liquidityPositions.forEach((e=>{var t,n,i,o,r;if(null==e?void 0:e.liquidityTokenBalance){const a=null===(t=e.id)||void 0===t?void 0:t.split("-");if(2===(null==a?void 0:a.length)){const t=a[1].toLocaleLowerCase();if((null===(i=null===(n=null==A?void 0:A.baseLpToken)||void 0===n?void 0:n.id)||void 0===i?void 0:i.toLocaleLowerCase())===t)return void(_=new s(e.liquidityTokenBalance));(null===(r=null===(o=null==A?void 0:A.quoteLpToken)||void 0===o?void 0:o.id)||void 0===r?void 0:r.toLocaleLowerCase())===t&&(D=new s(e.liquidityTokenBalance))}}}));const N=null===(y=i.liquidityPositions)||void 0===y?void 0:y[0],F=A.type,U=wa(F),q="AMMV2"===F,V="AMMV3"===F;let W="";if(V)(null===(C=null===(b=null===(v=null==l?void 0:l.pool)||void 0===v?void 0:v.liquidityPositions)||void 0===b?void 0:b[0])||void 0===C?void 0:C.id)===(null==N?void 0:N.id)&&(W=o.i18n._({id:"p3607o",message:"Managing"}));else if((null===(j=null==l?void 0:l.pool)||void 0===j?void 0:j.address)===A.id||(null==l?void 0:l.address)===A.id)if(l.operate===df.Remove)W=o.i18n._({id:"0+31GV",message:"Removing"});else W=o.i18n._({id:"1yHVE+",message:"Adding"});const H=!!(null===(w=A.miningAddress)||void 0===w?void 0:w[0]),Z=!!(null==R?void 0:R.metromMiningApy)&&Number(null==R?void 0:R.metromMiningApy)>0,$=m.palette.hover.default,G=null==p?void 0:p({address:A.id,chainId:A.chainId});return z.jsxs(t.Box,{component:"tr",sx:{["&:hover td"+(W?", & td":"")]:{backgroundImage:`linear-gradient(${$}, ${$})`}},children:[z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[S&&L?z.jsx(Pp,{tokens:[S,L],width:24,mr:8,chainId:A.chainId,showChainLogo:!0}):"",z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==S?void 0:S.symbol}/${null==L?void 0:L.symbol}`,z.jsx(By,{address:A.id,chainId:A.chainId}),!!G&&z.jsx(Dy,{})]}),z.jsx(lp,{address:A.id,customChainId:A.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,disabledAddress:c,onAddressClick:()=>{pm.getState().push({type:exports.PageType.PoolDetail,params:{chainId:A.chainId,address:A.id}})},sx:{typography:"h6",color:"text.secondary"}})]})]})}),c&&z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(vg,{poolType:U}),z.jsx(bg,{isAMMV2:q,isAMMV3:V,lpFeeRate:A.lpFeeRate,mtFeeRate:A.mtFeeRate})]})}),V?null:z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{typography:"body2"},title:A.tvl?`$${nr({input:A.tvl||0})}`:void 0,children:["$",xr(new s(A.tvl||0))]})}),z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[H||Z?z.jsx(t.Tooltip,{title:o.i18n._({id:"Sti4vy",message:"Mining"}),children:z.jsxs(t.Box,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",z.jsx(Ny,{chainId:A.chainId,apy:R,baseToken:S,quoteToken:L,hasQuote:!!P,hasMining:H,children:z.jsxs(t.Box,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[O||"-%",P?`/${P}`:""]})})]})}),z.jsx(t.Box,{component:"td",children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"body2"},children:V?(null==N?void 0:N.liquidityUSD)?`$${ir({input:N.liquidityUSD,decimals:2})}`:"-":z.jsxs(z.Fragment,{children:[M?z.jsx(sl,{address:null==S?void 0:S.address,chainId:A.chainId,url:null==S?void 0:S.logoURI,width:24,height:24,noShowChain:!0,sx:{mr:4}}):z.jsx(Pp,{tokens:S&&L?[S,L]:[],width:24,mr:4,showChainLogo:!1,chainId:A.chainId}),_?nr({input:_}):"-",M&&z.jsxs(z.Fragment,{children:[" / ",z.jsx(sl,{address:null==L?void 0:L.address,chainId:A.chainId,url:null==L?void 0:L.logoURI,width:24,height:24,noShowChain:!0,sx:{mx:4}}),D?nr({input:D}):"0"]}),q&&z.jsx(t.Tooltip,{title:z.jsx(e.Trans,{id:"NXZdrO",message:"My pool share"}),children:z.jsx(t.Box,{sx:{ml:4,px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:gr({input:null===(T=null===(k=i.liquidityPositions)||void 0===k?void 0:k[0])||void 0===T?void 0:T.poolShare})})})]})})}),u?z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[z.jsx(Qg,{outOfRange:null!==(B=null==N?void 0:N.outOfRange)&&void 0!==B&&B}),z.jsx(t.Box,{children:z.jsxs(z.Fragment,{children:[z.jsxs("span",{children:[mg({price:null===(E=null==N?void 0:N.priceRange)||void 0===E?void 0:E.token0LowerPrice,atLimit:{},direction:Em.LOWER})," "]}),null==S?void 0:S.symbol]})}),z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:z.jsx("path",{d:"M15.75 9.50293L12.75 12.5029L11.7 11.4529L12.8813 10.2529L5.11875 10.2529L6.3 11.4529L5.25 12.5029L2.25 9.50293L5.25 6.50293L6.31875 7.55293L5.11875 8.75293L12.8813 8.75293L11.7 7.55293L12.75 6.50293L15.75 9.50293Z",fill:"currentColor",fillOpacity:"0.5"})}),z.jsx(t.Box,{children:z.jsxs(z.Fragment,{children:[z.jsxs("span",{children:[mg({price:null===(I=null==N?void 0:N.priceRange)||void 0===I?void 0:I.token0UpperPrice,atLimit:{},direction:Em.UPPER})," "]}),null==S?void 0:S.symbol]})})]})}):null,z.jsx(t.Box,{component:"td",children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[c&&"PMM"===U&&z.jsx(nf,{chainId:A.chainId,address:A.id}),W?z.jsx(Jg,{text:W,onClick:()=>d(null)}):z.jsxs(z.Fragment,{children:[V?null:!!n&&z.jsxs(t.Button,{variant:t.Button.Variant.second,size:t.Button.Size.small,onClick:e=>{e.stopPropagation(),d({operate:df.Remove,pool:ja(i),hasMining:H})},sx:{py:0,height:32},children:[z.jsx(e.Trans,{id:"t/YqKh",message:"Remove"}),!!G&&z.jsx(Dy,{isRightTop:!0})]}),z.jsx(t.Button,{size:t.Button.Size.small,onClick:()=>{d({pool:ja(i),hasMining:H})},sx:{py:0,height:32},children:V?o.i18n._({id:"wckWOP",message:"Manage"}):o.i18n._({id:"m16xKo",message:"Add"})})]})]})})]},V?null==N?void 0:N.id:A.id+A.chainId)}))})]})}function iv({account:e,filterChainIds:i,activeChainId:o,handleChangeActiveChainId:a,operatePool:s,setOperatePool:l,getMigrationPairAndMining:d,tokenAndPoolFilter:u,children:p}){var h,m,x,g,f,y,v,b;const C=t.useTheme(),{minDevice:j,isMobile:w}=Xa(),k=c.useQueryClient(),{onlyChainId:T,supportAMMV2:B,supportAMMV3:E,notSupportPMM:I}=Q(),[A,S]=n.useState("pmm&v2"),[L,M]=n.useState("1"),{filterTokens:R,filterASymbol:O,filterBSymbol:P,filterAddressLqList:_,handleDeleteToken:D,handleChangeFilterTokens:F,handleChangeFilterAddress:U}=lf(u);let q=I?[]:["CLASSICAL","DVM","DSP","GSP","DPP"];B&&q.push("AMMV2"),E&&"v3"===A&&(q=["AMMV3"]);const V={currentPage:1,pageSize:1e3,user:e,filterState:{viewOnlyOwn:!0,filterTypes:q}},W=qa(),H=W.getQuery(r.PoolApi.graphql.fetchMyLiquidityList,{where:Object.assign(Object.assign({},V),{filterState:Object.assign({filterASymbol:O,filterBSymbol:P},V.filterState)})}),Z=c.useQuery(Object.assign({},H));let $=null!==(x=null===(m=null===(h=Z.data)||void 0===h?void 0:h.liquidity_list)||void 0===m?void 0:m.lqList)&&void 0!==x?x:[];const G=!!(null==_?void 0:_.length);return G?$=[..._]:i&&($=null!==(v=null===(y=null===(f=null===(g=Z.data)||void 0===g?void 0:g.liquidity_list)||void 0===f?void 0:f.lqList)||void 0===y?void 0:y.filter((e=>{var t,n;return i.includes(null!==(n=null===(t=null==e?void 0:e.pair)||void 0===t?void 0:t.chainId)&&void 0!==n?n:0)})))&&void 0!==v?v:[]),z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{pt:12,pb:20,display:"flex",flexDirection:"column",gap:12,[C.breakpoints.up("tablet")]:{py:16,flexDirection:"row",gap:8,px:0,justifyContent:"space-between"}},children:[z.jsx(t.Box,{sx:{[C.breakpoints.up("tablet")]:{mr:"auto"}},children:p}),!T&&z.jsx(Py,{chainId:o,setChainId:a}),E&&z.jsx(_y,{filterList:[{label:"V3",value:"v3"},{label:"V2 & PMM",value:"pmm&v2"}],value:A,onChange:e=>S(e)}),z.jsx(_y,{filterList:[{label:"1d",value:"1"},{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"}],value:L,onChange:e=>M(e)}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:Object.assign({flex:1,display:"flex",alignItems:"center",gap:8},w?{}:{"& > button":{flex:1}}),children:null!==(b=null==u?void 0:u.element)&&void 0!==b?b:z.jsx(af,{value:R,onChange:F,searchAddress:(e,t)=>N(this,void 0,void 0,(function*(){var n;const i=W.getInfiniteQuery(r.PoolApi.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},V),{filterState:Object.assign({address:e},V.filterState)})}),o=null===(n=(yield k.fetchQuery(i)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==o?void 0:o.length)?z.jsx(sf,{list:o,onClick:()=>{U(o),t()}}):null}))})}),(G||!!R.length)&&z.jsxs(t.Box,{sx:{my:0},children:[G?z.jsx(ef,{lqList:_,onDeleteTag:()=>U([])}):"",z.jsx(tf,{tags:R,onDeleteTag:D})]})]})]}),w?z.jsxs(Kg,{children:[Z.isLoading?z.jsx(rf,{}):"",!Z.isLoading&&!(null==$?void 0:$.length)&&!Z.error&&z.jsx(X,{sx:{mt:40},hasSearch:!!(o&&!T||O||P)}),!!Z.error&&z.jsx(ne,{refresh:Z.refetch,sx:{mt:40}}),z.jsx(tv,{account:e,lqList:$,setOperatePool:l,supportAMM:B||E,getMigrationPairAndMining:d,timeRange:L})]}):z.jsxs(z.Fragment,{children:[z.jsx(nv,{account:e,lqList:$,loading:Z.isLoading,operatePool:s,setOperatePool:l,supportAMM:B||E,onlyV3:"v3"===A,getMigrationPairAndMining:d,timeRange:L}),z.jsx(_p,{loading:Z.isLoading,refetch:Z.error?Z.refetch:void 0,empty:!(null==$?void 0:$.length),hasSearch:!!(o&&!T||O||P)})]})]})}function ov(e){var{sx:n}=e,i=D(e,["sx"]);return z.jsx(t.TabPanel,{...i,sx:Object.assign(Object.assign({},n),{display:"flex",flexDirection:"column",overflow:"hidden"})})}function rv({params:e,scrollRef:i,tokenAndPoolFilter:o,operatePool:a,onOperatePool:s,getMigrationPairAndMining:l}){var d,c,u;const{isMobile:p}=Xa();t.useTheme();const h=Q((e=>e.noDocumentLink)),m=n.useRef(null),{account:x}=Pa(),{poolTopTab:g,normalPoolTab:f,almPoolTab:y,multiTokenPoolTab:v,normalTabs:b,almTabs:C,topTabs:j,multiTokenTabs:w,handleChangePoolTab:k}=function(){const[e,t]=n.useState($y.NORMAL),[i,o]=n.useState(Gy.ALL),[r,a]=n.useState(Qy.addLiquidity),[s,l]=n.useState(Yy.ALL),{supportAMMV2:d,supportAMMV3:c,notSupportPMM:u,supportCurve:p}=Q(),h=n.useMemo((()=>{const e=[{key:$y.NORMAL,value:"Normal"}];return p&&e.push({key:$y.MULTI_TOKEN,value:"Multi-token"}),e}),[p]),m=n.useMemo((()=>[{key:Gy.ALL,value:"All vauls"},{key:Gy.MY,value:"My liquidity"}]),[]),x=n.useMemo((()=>{const e=[{key:Qy.addLiquidity,value:"Add Liquidity"},{key:Qy.myLiquidity,value:"My Liquidity"}];return u||e.push({key:Qy.myCreated,value:d||c?"My Pools (PMM)":"My Pools"}),e}),[d,c,u]),g=n.useMemo((()=>[{key:Yy.ALL,value:"All pools"},{key:Yy.MY,value:"My liquidity"}]),[]),f=n.useRef(!1);return n.useEffect((()=>{const e=sessionStorage.getItem(Hy),n=sessionStorage.getItem(Zy);e&&n&&!f.current&&(f.current=!0,t(e),e===$y.NORMAL?a(n):e===$y.ALM?o(n):e===$y.MULTI_TOKEN&&l(n))}),[]),{poolTopTab:e,normalPoolTab:r,almPoolTab:i,multiTokenPoolTab:s,topTabs:h,normalTabs:x,almTabs:m,multiTokenTabs:g,handleChangePoolTab:({topTab:e,poolTab:n})=>{t(e),e===$y.NORMAL?a(n):e===$y.ALM?o(n):e===$y.MULTI_TOKEN&&l(n),sessionStorage.setItem(Hy,e),sessionStorage.setItem(Zy,n)}}}(),{activeChainId:T,filterChainIds:B,handleChangeActiveChainId:E}=function(){const{chainId:e}=Pa(),{onlyChainId:t,defaultChainId:i}=Q(),[o,a]=n.useState(t),s=n.useMemo((()=>void 0!==o?[o]:Oo(e)?void 0:Object.values(r.ChainId).filter((e=>!!Number(e)))),[e,o]);return n.useEffect((()=>{const e=Number(sessionStorage.getItem(zy));e&&a(e)}),[]),n.useEffect((()=>{!sessionStorage.getItem(zy)&&i&&a(i)}),[i]),{activeChainId:o,filterChainIds:s,handleChangeActiveChainId:e=>{void 0===e?sessionStorage.removeItem(zy):sessionStorage.setItem(zy,String(e)),a(e)}}}(),[I,A]=n.useState({pool:hf[0],type:df.Remove}),[S,L]=n.useState(a||null),M=e=>{if(s){if(s(e))return}L(e)};return n.useEffect((()=>{L(a||null)}),[a]),z.jsxs(cm,{sx:Object.assign({},p?{p:0}:{display:"flex",gap:12,flex:1}),ref:m,children:[z.jsxs(t.Tabs,{value:g,onChange:(e,t)=>{t===$y.NORMAL?k({topTab:t,poolTab:f}):t===$y.ALM?k({topTab:t,poolTab:y}):t===$y.MULTI_TOKEN&&k({topTab:t,poolTab:v})},sx:p?{}:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",height:"max-content",maxHeight:"100%"},children:[z.jsxs(t.Box,{sx:Object.assign({},p?void 0:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",pb:16,borderBottomWidth:1,borderBottomColor:"border.main",borderBottomStyle:"solid"}),children:[z.jsx(t.TabsGroup,{tabs:j,variant:"default",tabsListSx:Object.assign({justifyContent:"space-between"},p?{mb:12,gap:32}:{borderBottomWidth:0}),tabSx:p?{mr:0,padding:"0px 0px 16px 0px",flexGrow:1,flexShrink:1,flexBasis:"93px",gap:32}:{mr:48,typography:"h5",lineHeight:"25px",minHeight:41,padding:"8px 0px 8px 0px"}}),g===$y.NORMAL&&z.jsx(Wy,{})]}),z.jsx(ov,{value:$y.ALM,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:"ALM"}),z.jsx(ov,{value:$y.NORMAL,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:z.jsxs(t.Tabs,{value:f,onChange:(e,t)=>{k({topTab:$y.NORMAL,poolTab:t})},children:[z.jsx(t.TabPanel,{value:Qy.addLiquidity,children:z.jsx(qy,{account:x,filterChainIds:B,scrollParentRef:null!=i?i:m,activeChainId:T,handleChangeActiveChainId:E,operatePool:S,setOperatePool:M,tokenAndPoolFilter:o,getMigrationPairAndMining:l,children:z.jsx(t.TabsButtonGroup,{tabs:b,variant:"inPaperContrast"})})}),z.jsx(t.TabPanel,{value:Qy.myLiquidity,children:z.jsx(iv,{account:x,filterChainIds:B,activeChainId:T,handleChangeActiveChainId:E,operatePool:S,setOperatePool:M,tokenAndPoolFilter:o,getMigrationPairAndMining:l,children:z.jsx(t.TabsButtonGroup,{tabs:b,variant:"inPaperContrast"})})}),z.jsx(t.TabPanel,{value:Qy.myCreated,children:z.jsx(ev,{account:x,filterChainIds:B,activeChainId:T,handleChangeActiveChainId:E,operatePool:S,setOperatePool:M,children:z.jsx(t.TabsButtonGroup,{tabs:b,variant:"inPaperContrast"})})}),!h&&z.jsx(hm,{title:"How does Liquidity Pools work?",descList:[{title:"Deposit Liquidity",desc:"Select a liquidity pool that suits your preferences and supply a pair of assets in our AMM pools or any supported assets in StableSwap pools. In return, you'll receive LP tokens, representing your share of the liquidity provided."},{title:"Earn Fees",desc:"As transactions occur within the pool, fees are collected and added to your LP tokens' value. This accrues daily, giving you real-time APY as your token holdings grow."},{title:"Delegate & Change Pool Fees",desc:"Boosted pool rewards are distributed every Sunday. If you've contributed liquidity to these pools, simply visit the rewards page, select the relevant week, and claim your earnings with ease."}],linkTo:"https://docs.dodoex.io/product/tutorial/how-to-provide-liquidity",sx:Object.assign({mt:16},p&&{mt:20})})]})}),z.jsx(ov,{value:$y.MULTI_TOKEN,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:z.jsxs(t.Tabs,{value:v,onChange:(e,t)=>{k({topTab:$y.MULTI_TOKEN,poolTab:t})},children:[z.jsx(t.TabPanel,{value:Yy.ALL,children:z.jsx(gf,{filterChainIds:B,scrollParentRef:null!=i?i:m,activeChainId:T,operateCurvePool:I,setOperateCurvePool:A,tokenAndPoolFilter:o,children:z.jsx(t.TabsButtonGroup,{tabs:w,variant:"inPaperContrast"})})}),z.jsx(t.TabPanel,{value:Yy.MY,children:z.jsx(gf,{filterChainIds:B,scrollParentRef:null!=i?i:m,activeChainId:T,operateCurvePool:I,setOperateCurvePool:A,tokenAndPoolFilter:o,children:z.jsx(t.TabsButtonGroup,{tabs:w,variant:"inPaperContrast"})})})]})})]}),g===$y.NORMAL&&S&&z.jsx(t.Box,{sx:{position:"relative",width:p?"100%":375},children:"AMMV3"===(null===(d=null==S?void 0:S.pool)||void 0===d?void 0:d.type)&&S.pool.chainId?f===Qy.myLiquidity&&(null===(u=null===(c=S.pool.liquidityPositions)||void 0===c?void 0:c[0])||void 0===u?void 0:u.tokenId)?z.jsx(Gg,{baseToken:S.pool.baseToken,quoteToken:S.pool.quoteToken,feeAmount:Number(S.pool.lpFeeRate),tokenId:S.pool.liquidityPositions[0].tokenId,chainId:S.pool.chainId,onClose:()=>M(null)}):z.jsx(Xg,{chainId:S.pool.chainId,baseToken:S.pool.baseToken,quoteToken:S.pool.quoteToken,feeAmount:Number(S.pool.lpFeeRate),onClose:()=>M(null),handleGoToAddLiquidityV3:e=>{pm.getState().push({type:exports.PageType.createPoolAMMV3,params:e})}}):z.jsx(z.Fragment,{children:p?z.jsx(Ty,{account:x,onClose:()=>M(null),modal:p,...S}):z.jsx(ky,{account:x,onClose:()=>M(null),...S,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"}})})}),g===$y.MULTI_TOKEN&&I&&z.jsx(t.Box,{sx:{position:"relative",width:p?"100%":375},children:z.jsx(kf,{operateCurvePool:I,setOperateCurvePool:A})})]})}function av({sx:e,onClick:n}){const o=t.useTheme();return z.jsx(t.HoverOpacity,{onClick:()=>{n?n():pm.getState().back()},sx:i.merge({display:"inline-flex",alignItems:"center",cursor:"pointer"},e),children:z.jsx(t.Box,{sx:{color:o.palette.text.secondary,width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",borderColor:o.palette.border.main,borderStyle:"solid",borderWidth:1,borderRadius:8,backgroundColor:o.palette.background.paper},children:z.jsx(oe.ArrowBack,{})})})}var sv,lv,dv,cv,uv,pv,hv,mv,xv,gv,fv,yv,vv;function bv(){return bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},bv.apply(null,arguments)}const Cv=e=>P.createElement("svg",bv({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),sv||(sv=P.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_5229_28889)"})),lv||(lv=P.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_5229_28889)"})),dv||(dv=P.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_5229_28889)"})),cv||(cv=P.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_5229_28889)"})),uv||(uv=P.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_5229_28889)"})),pv||(pv=P.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28889)"})),hv||(hv=P.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_5229_28889)"})),mv||(mv=P.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_5229_28889)"})),xv||(xv=P.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_5229_28889)"})),gv||(gv=P.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_5229_28889)"})),fv||(fv=P.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_5229_28889)"})),yv||(yv=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28889)"})),vv||(vv=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5229_28889",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint1_linear_5229_28889",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint2_linear_5229_28889",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint3_linear_5229_28889",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint4_linear_5229_28889",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint5_linear_5229_28889",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint6_linear_5229_28889",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint7_linear_5229_28889",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint8_linear_5229_28889",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint9_linear_5229_28889",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint10_linear_5229_28889",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint11_linear_5229_28889",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var jv,wv,kv,Tv,Bv,Ev,Iv,Av,Sv,Lv,Mv,Rv,Ov;function Pv(){return Pv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Pv.apply(null,arguments)}const _v=e=>P.createElement("svg",Pv({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),jv||(jv=P.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_3900_354238)"})),wv||(wv=P.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_3900_354238)"})),kv||(kv=P.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_3900_354238)"})),Tv||(Tv=P.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_3900_354238)"})),Bv||(Bv=P.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_3900_354238)"})),Ev||(Ev=P.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_3900_354238)"})),Iv||(Iv=P.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_3900_354238)"})),Av||(Av=P.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_3900_354238)"})),Sv||(Sv=P.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_3900_354238)"})),Lv||(Lv=P.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_3900_354238)"})),Mv||(Mv=P.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_3900_354238)"})),Rv||(Rv=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_3900_354238)"})),Ov||(Ov=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_3900_354238",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint1_linear_3900_354238",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint2_linear_3900_354238",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint3_linear_3900_354238",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint4_linear_3900_354238",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint5_linear_3900_354238",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint6_linear_3900_354238",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint7_linear_3900_354238",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint8_linear_3900_354238",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint9_linear_3900_354238",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint10_linear_3900_354238",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint11_linear_3900_354238",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var Dv,Nv,Fv,Uv,qv,Vv,Wv,Hv,Zv,zv,$v,Gv,Qv,Yv;function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Xv.apply(null,arguments)}const Kv=e=>P.createElement("svg",Xv({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Dv||(Dv=P.createElement("g",{clipPath:"url(#clip0_5057_344879)"},P.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344879)"}),P.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344879)"}),P.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344879)"}),P.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344879)"}),P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344879)"}),P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344879)"}),P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344879)"}),P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344879)"}),P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344879)"}),P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344879)"}))),Nv||(Nv=P.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344879)"})),Fv||(Fv=P.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344879)"})),Uv||(Uv=P.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344879)"})),qv||(qv=P.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344879)"})),Vv||(Vv=P.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344879)"})),Wv||(Wv=P.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344879)"})),Hv||(Hv=P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344879)"})),Zv||(Zv=P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344879)"})),zv||(zv=P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344879)"})),$v||($v=P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344879)"})),Gv||(Gv=P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344879)"})),Qv||(Qv=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344879)"})),Yv||(Yv=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5057_344879",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint1_linear_5057_344879",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint2_linear_5057_344879",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint3_linear_5057_344879",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint4_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint5_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint6_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint7_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint8_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint9_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"white",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),P.createElement("linearGradient",{id:"paint10_linear_5057_344879",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint11_linear_5057_344879",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint12_linear_5057_344879",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint13_linear_5057_344879",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint14_linear_5057_344879",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint15_linear_5057_344879",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint16_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint17_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint18_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint19_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint20_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint21_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("clipPath",{id:"clip0_5057_344879"},P.createElement("rect",{width:737,height:220,fill:"white"})))));var Jv,eb,tb,nb,ib,ob,rb,ab,sb,lb,db,cb,ub,pb;function hb(){return hb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},hb.apply(null,arguments)}const mb=e=>P.createElement("svg",hb({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Jv||(Jv=P.createElement("g",{clipPath:"url(#clip0_5057_344817)"},P.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344817)"}),P.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344817)"}),P.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344817)"}),P.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344817)"}),P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344817)"}),P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344817)"}),P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344817)"}),P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344817)"}),P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344817)"}),P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344817)"}))),eb||(eb=P.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344817)"})),tb||(tb=P.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344817)"})),nb||(nb=P.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344817)"})),ib||(ib=P.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344817)"})),ob||(ob=P.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344817)"})),rb||(rb=P.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344817)"})),ab||(ab=P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344817)"})),sb||(sb=P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344817)"})),lb||(lb=P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344817)"})),db||(db=P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344817)"})),cb||(cb=P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344817)"})),ub||(ub=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344817)"})),pb||(pb=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5057_344817",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint1_linear_5057_344817",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint2_linear_5057_344817",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint3_linear_5057_344817",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint4_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint5_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint6_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint7_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint8_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint9_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),P.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),P.createElement("linearGradient",{id:"paint10_linear_5057_344817",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint11_linear_5057_344817",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint12_linear_5057_344817",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint13_linear_5057_344817",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint14_linear_5057_344817",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint15_linear_5057_344817",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint16_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint17_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint18_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint19_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint20_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint21_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("clipPath",{id:"clip0_5057_344817"},P.createElement("rect",{width:737,height:220,fill:"white"})))));var xb,gb,fb,yb,vb,bb,Cb,jb,wb,kb,Tb,Bb,Eb;function Ib(){return Ib=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ib.apply(null,arguments)}const Ab=e=>P.createElement("svg",Ib({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xb||(xb=P.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),gb||(gb=P.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),fb||(fb=P.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),yb||(yb=P.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),vb||(vb=P.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),bb||(bb=P.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),Cb||(Cb=P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_5229_28865)"})),jb||(jb=P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_5229_28865)"})),wb||(wb=P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_5229_28865)"})),kb||(kb=P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_5229_28865)"})),Tb||(Tb=P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_5229_28865)"})),Bb||(Bb=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_5229_28865)"})),Eb||(Eb=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5229_28865",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint1_linear_5229_28865",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint2_linear_5229_28865",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint3_linear_5229_28865",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint4_linear_5229_28865",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint5_linear_5229_28865",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var Sb,Lb,Mb,Rb,Ob,Pb,_b,Db,Nb,Fb,Ub,qb,Vb;function Wb(){return Wb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Wb.apply(null,arguments)}const Hb=e=>P.createElement("svg",Wb({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Sb||(Sb=P.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),Lb||(Lb=P.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),Mb||(Mb=P.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),Rb||(Rb=P.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),Ob||(Ob=P.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),Pb||(Pb=P.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),_b||(_b=P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_3900_354262)"})),Db||(Db=P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_3900_354262)"})),Nb||(Nb=P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_3900_354262)"})),Fb||(Fb=P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_3900_354262)"})),Ub||(Ub=P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_3900_354262)"})),qb||(qb=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_3900_354262)"})),Vb||(Vb=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_3900_354262",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint1_linear_3900_354262",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint2_linear_3900_354262",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint3_linear_3900_354262",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint4_linear_3900_354262",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint5_linear_3900_354262",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var Zb,zb,$b,Gb,Qb,Yb,Xb,Kb,Jb,eC,tC,nC,iC;function oC(){return oC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},oC.apply(null,arguments)}const rC=e=>P.createElement("svg",oC({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Zb||(Zb=P.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_5229_28987)"})),zb||(zb=P.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_5229_28987)"})),$b||($b=P.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_5229_28987)"})),Gb||(Gb=P.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_5229_28987)"})),Qb||(Qb=P.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_5229_28987)"})),Yb||(Yb=P.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28987)"})),Xb||(Xb=P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_5229_28987)"})),Kb||(Kb=P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_5229_28987)"})),Jb||(Jb=P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_5229_28987)"})),eC||(eC=P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_5229_28987)"})),tC||(tC=P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_5229_28987)"})),nC||(nC=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28987)"})),iC||(iC=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5229_28987",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint1_linear_5229_28987",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint2_linear_5229_28987",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint3_linear_5229_28987",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint4_linear_5229_28987",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint5_linear_5229_28987",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint6_linear_5229_28987",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint7_linear_5229_28987",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint8_linear_5229_28987",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint9_linear_5229_28987",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint10_linear_5229_28987",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint11_linear_5229_28987",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var aC,sC,lC,dC,cC,uC,pC,hC,mC,xC,gC,fC,yC;function vC(){return vC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vC.apply(null,arguments)}const bC=e=>P.createElement("svg",vC({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),aC||(aC=P.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_4437_25449)"})),sC||(sC=P.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_4437_25449)"})),lC||(lC=P.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_4437_25449)"})),dC||(dC=P.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_4437_25449)"})),cC||(cC=P.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_4437_25449)"})),uC||(uC=P.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_4437_25449)"})),pC||(pC=P.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_4437_25449)"})),hC||(hC=P.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_4437_25449)"})),mC||(mC=P.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_4437_25449)"})),xC||(xC=P.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_4437_25449)"})),gC||(gC=P.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_4437_25449)"})),fC||(fC=P.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_4437_25449)"})),yC||(yC=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_4437_25449",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint1_linear_4437_25449",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint2_linear_4437_25449",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint3_linear_4437_25449",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint4_linear_4437_25449",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint5_linear_4437_25449",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint6_linear_4437_25449",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint7_linear_4437_25449",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint8_linear_4437_25449",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint9_linear_4437_25449",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint10_linear_4437_25449",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),P.createElement("linearGradient",{id:"paint11_linear_4437_25449",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),P.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var CC,jC;function wC(){const e="https://docs.dodoex.io/product/tutorial/how-to-create-pools#learn-more-about-the-characteristics-of-different-pool-models",t=[{version:jC.standard,title:o.i18n._({id:"TJBHlP",message:"Standard"}),description:o.i18n._({id:"QNrpkx",message:"Classical AMM-like pool. Suitable for most assets."}),exampleImgUrl:bC,exampleDarkImgUrl:rC,docUrl:e,initPriceLabel:o.i18n._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:o.i18n._({id:"5OKrbq",message:"Since this pool uses the PMM algorithm, which is different from the normal AMM pool mechanism, the initial price calculation is also different from AMM."}),initPriceTipsLink:"https://docs.dodoex.io/en/product/dodo-v2-pools/dodo-vending-machine/dvm-initial-price-formula-explanation"},{version:jC.pegged,title:o.i18n._({id:"J7M/DA",message:"Pegged"}),description:o.i18n._({id:"RvYEUJ",message:"Suitable for synthetic assets. The liquidity is super concentrated at some price like Curve Finance."}),exampleImgUrl:_v,exampleDarkImgUrl:Cv,docUrl:e,initPriceLabel:o.i18n._({id:"4ogEAw",message:"Pegged Exchange Rate"}),initPriceTips:o.i18n._({id:"M9dIDb",message:"The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."})},{version:jC.singleToken,title:o.i18n._({id:"34w3mT",message:"Single-Token"}),description:o.i18n._({id:"a1AzKr",message:"For those who are looking to sell tokens and only need ask-side liquidity."}),exampleImgUrl:Hb,exampleDarkImgUrl:Ab,docUrl:e,initPriceLabel:o.i18n._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:o.i18n._({id:"HGf8fG",message:"You can set the minimum selling price for single-token pools."})},{version:jC.marketMakerPool,title:o.i18n._({id:"4vKwIV",message:"Private Pool"}),description:o.i18n._({id:"pKjCsP",message:"100% use your own funds and enjoy the maximum degree of flexibility."}),exampleImgUrl:mb,exampleDarkImgUrl:Kv,docUrl:e,initPriceLabel:o.i18n._({id:"CeLrge",message:"Mid Price"}),initPriceTips:o.i18n._({id:"GGPOuT",message:"set current mid price"})}],n=t.reduce(((e,t)=>(e[t.version]=t,e)),{});return{versionList:t,versionMap:n,subPeggedVersionList:kC()}}function kC(){return[{version:CC.DSP,title:o.i18n._({id:"D1bhHv",message:"The pool’s market-making price is fixed"}),description:o.i18n._({id:"lgE483",message:"Once created, the price cannot be changed. This option applies to assets like ETH-WETH."})},{version:CC.GSP,title:o.i18n._({id:"LVzIav",message:"The pool’s market-making price can be adjusted"}),description:o.i18n._({id:"KkjUUb",message:"Once created, you can adjust the pool’s market-making price at any time. This option is suitable for assets with fluctuating pegged prices. Adjusting the pool’s market-making price allows for more competitive quotes."})}]}function TC(){return kC().reduce(((e,t)=>(e[t.version]=t,e)),{})}!function(e){e.DSP="dsp",e.GSP="gsp"}(CC||(CC={})),function(e){e.standard="standard",e.singleToken="single-token",e.pegged="pagged",e.marketMakerPool="market-maker-pool"}(jC||(jC={}));const BC="0.3",EC=.01,IC=10,AC="1",SC="0.0000000000001",LC=1e8,MC="1",RC="0.0001",OC="0.1",PC=8;function _C({selectedVersion:e,quoteToken:t,initPrice:n,midPrice:i}){return e===jC.standard?!i||i.isZero()?null:ir({input:i,decimals:t.decimals}):ir({input:n,decimals:t.decimals})}function DC({initPrice:e}){const t=new s(e);if(!t.isFinite()||t.lte(0))return{base:null,quote:null};const n=new s(1),i=n.dividedBy(n.plus(t)).dp(PC,s.ROUND_DOWN);return{base:i,quote:n.minus(i).dp(PC,s.ROUND_DOWN)}}function NC({chainId:e,baseToken:t,quoteToken:n}){const i=r.basicTokenMap[e];return!(!t||!n)&&(!(!Ta(t.address,i.address)||!Ta(n.address,i.wrappedTokenAddress))||!(!Ta(t.address,i.wrappedTokenAddress)||!Ta(n.address,i.address)))}function FC({title:e,children:n,isWaiting:i}){const o=t.useTheme();return z.jsxs(t.Box,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:i?"-":n}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:e})]})}function UC({status:n,selectedVersion:i,baseToken:o,quoteToken:r,initPrice:a,slippageCoefficient:s,midPrice:l,sx:d}){var c;const{versionMap:u}=wC(),p="waiting"===n,{initPriceLabel:h}=u[i];return o&&r?z.jsx(z.Fragment,{children:z.jsxs(t.Box,{sx:Object.assign({mt:0,display:"flex",alignItems:"stretch",gap:12,opacity:p?.5:1},d),children:[z.jsxs(FC,{title:z.jsx(e.Trans,{id:"fSFt4a",message:"Token Pair"}),isWaiting:p,children:[z.jsx(Pp,{width:24,height:24,tokens:[o,r]}),o.symbol,"-",r.symbol]}),z.jsx(FC,{title:z.jsx(e.Trans,{id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:p,children:s}),z.jsxs(FC,{title:h,isWaiting:p,children:["1 ",o.symbol," = ",null!==(c=_C({midPrice:l,quoteToken:r,selectedVersion:i,initPrice:a}))&&void 0!==c?c:"-"," ",r.symbol]})]})}):null}var qC,VC;function WC(){return WC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},WC.apply(null,arguments)}const HC=e=>P.createElement("svg",WC({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qC||(qC=P.createElement("g",{clipPath:"url(#clip0_5251_29079)"},P.createElement("path",{d:"M41.2736 0.409826C33.3354 1.31458 28.4933 23.304 27.1777 32H54.0001V0.0303594C53.1946 0.0303459 46.2675 -0.159361 41.2736 0.409826Z",fill:"url(#paint0_linear_5251_29079)"}),P.createElement("path",{d:"M27 31.7932C28.3204 23.1499 33.2469 1.97641 41.3084 0.583249C43.491 0.206055 53.1916 0.206014 54 0.206056",stroke:"#EC5A7D",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}),P.createElement("path",{d:"M12.7264 0.409826C20.6646 1.31458 25.5067 23.304 26.8223 32H-0.000102997V0.0303594C0.805374 0.0303459 7.73247 -0.159361 12.7264 0.409826Z",fill:"url(#paint1_linear_5251_29079)"}),P.createElement("path",{d:"M27 31.7932C25.6796 23.1499 20.7531 1.97641 12.6916 0.583249C10.509 0.206055 0.808383 0.206014 2.38419e-07 0.206056",stroke:"#2FBA90",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}))),VC||(VC=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5251_29079",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#EC5A7D",stopOpacity:.3}),P.createElement("stop",{offset:1,stopColor:"#EC5A7D",stopOpacity:0})),P.createElement("linearGradient",{id:"paint1_linear_5251_29079",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#2FBA90",stopOpacity:.3}),P.createElement("stop",{offset:1,stopColor:"#2FBA90",stopOpacity:0})),P.createElement("clipPath",{id:"clip0_5251_29079"},P.createElement("rect",{width:54,height:32,fill:"white"})))));var ZC,zC;function $C(){return $C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$C.apply(null,arguments)}const GC=e=>P.createElement("svg",$C({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ZC||(ZC=P.createElement("g",{clipPath:"url(#clip0_5251_28999)"},P.createElement("path",{d:"M41.2736 0.409826C33.3354 1.31458 28.4933 23.304 27.1777 32H54.0001V0.0303594C53.1946 0.0303459 46.2675 -0.159361 41.2736 0.409826Z",fill:"url(#paint0_linear_5251_28999)"}),P.createElement("path",{d:"M27 31.7932C28.3204 23.1499 33.2469 1.97641 41.3084 0.583249C43.491 0.206055 53.1916 0.206014 54 0.206056",stroke:"#FF6187",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}),P.createElement("path",{d:"M12.7264 0.409826C20.6646 1.31458 25.5067 23.304 26.8223 32H-0.000102997V0.0303594C0.805374 0.0303459 7.73247 -0.159361 12.7264 0.409826Z",fill:"url(#paint1_linear_5251_28999)"}),P.createElement("path",{d:"M27 31.7932C25.6796 23.1499 20.7531 1.97641 12.6916 0.583249C10.509 0.206055 0.808383 0.206014 2.38419e-07 0.206056",stroke:"#55F9C7",strokeWidth:.206452,strokeLinecap:"square",strokeLinejoin:"round"}))),zC||(zC=P.createElement("defs",null,P.createElement("linearGradient",{id:"paint0_linear_5251_28999",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#FF6187",stopOpacity:.3}),P.createElement("stop",{offset:1,stopColor:"#FF6187",stopOpacity:0})),P.createElement("linearGradient",{id:"paint1_linear_5251_28999",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},P.createElement("stop",{stopColor:"#55F9C7",stopOpacity:.3}),P.createElement("stop",{offset:1,stopColor:"#55F9C7",stopOpacity:0})),P.createElement("clipPath",{id:"clip0_5251_28999"},P.createElement("rect",{width:54,height:32,fill:"white"})))));function QC({height:e,text:t}){return z.jsx(X,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:e||261},emptyText:t||o.i18n._({id:"uiuMDr",message:"Enter parameters to view the yield curve"})})}const YC=n.lazy((()=>Promise.resolve().then((function(){return require("./index-6I0PA0zd.cjs")})))),XC=n.lazy((()=>Promise.resolve().then((function(){return require("./index-CWdtJLrZ.cjs")}))));var KC,JC;function ej({baseToken:i,quoteToken:r,pmmParams:a,pmmModel:s,midPrice:l}){var d,c;const u=t.useTheme(),{isMobile:p}=Xa(),[h,m]=n.useState(KC.depth),x=n.useRef(null),[g,f]=n.useState(0),y=null!==(d=null==i?void 0:i.symbol)&&void 0!==d?d:"",v=null!==(c=null==r?void 0:r.symbol)&&void 0!==c?c:"";n.useEffect((()=>{const e=()=>{x&&x.current&&f(x.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[x,l]);const b=h===KC.depth;if(!l||l.isNaN())return z.jsx(QC,{height:p?261:b?665:494});const C=u.palette.success.main,j=u.palette.error.main,w=[{key:KC.liquidity,value:o.i18n._({id:"6y2TB3",message:"Liquidity"})},{key:KC.depth,value:o.i18n._({id:"n25Lml",message:"Depth"})}];return z.jsxs(t.Box,{ref:x,sx:{mt:2,"& input":{backgroundColor:"background.cardInput",borderStyle:"solid",borderWidth:"1px",borderColor:"border.main",borderRadius:8,color:"text.primary",overflow:"hidden"},"& .operate-btn-wrapper button":{backgroundColor:"background.paperContrast",color:"text.primary"}},children:[z.jsxs(t.Tabs,{value:h,onChange:(e,t)=>{m(t)},children:[z.jsx(t.TabsButtonGroup,{tabs:w,variant:"tag",tabsListSx:{ml:"auto"}}),z.jsx(t.Box,{sx:Object.assign({typography:"h6",mt:8,mb:14,color:"text.secondary"},p?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:z.jsx(e.Trans,{id:"tyGEMJ",message:"Amounts"})}),z.jsx(t.TabPanel,{value:KC.depth,children:g&&z.jsx(n.Suspense,{children:z.jsx(YC,{width:g,height:p?261:364,chartId:"create-pool-depth-chart",baseTokenSymbol:y,quoteTokenSymbol:v,pmmModel:s,pmmParams:a,midPrice:l,colorMap:{grid:"light"===u.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===u.palette.mode?"#E4E4E4":void 0,leftBg:[0,t.alpha(C,.04),1,t.alpha(C,.3)],leftLine:C,rightBg:[0,t.alpha(j,.04),1,t.alpha(j,.3)],rightLine:j,tooltipBg:u.palette.background.paperContrast,tooltipColor:u.palette.text.primary},notShowAmountInput:p})})}),z.jsx(t.TabPanel,{value:KC.liquidity,children:z.jsx(n.Suspense,{children:z.jsx(XC,{width:g,height:p?261:364,baseTokenSymbol:y,quoteTokenSymbol:v,pmmModel:s,pmmParams:a,midPrice:l,notShowTipText:!0,colorMap:{grid:"light"===u.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===u.palette.mode?"#E4E4E4":void 0,leftBg:[0,t.alpha(C,.04),1,t.alpha(C,.3)],leftLine:C,rightBg:[0,t.alpha(j,.04),1,t.alpha(j,.3)],rightLine:j,tooltipBg:u.palette.background.paperContrast,tooltipColor:u.palette.text.primary,textColor:u.palette.text.secondary}})})})]}),z.jsx(t.Box,{sx:Object.assign({typography:"h6",mt:6,color:"text.secondary"},p?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:z.jsx(e.Trans,{id:"DZULmp",message:"Swap Rate"})}),b?"":z.jsxs(t.Box,{sx:{typography:"h6",mt:24,color:"text.secondary",textAlign:"center"},children:["* ",o.i18n._({id:"DuVAxN",message:"The area of the chart indicates the buy/sell volume of {baseSymbol} that can be carried by the market when the current price changes to the hover price.",values:{baseSymbol:y}})]})]})}!function(e){e[e.liquidity=1]="liquidity",e[e.depth=2]="depth"}(KC||(KC={})),function(e){e[e.standard=1]="standard",e[e.singleToken=2]="singleToken",e[e.pagged=3]="pagged",e[e.marketMaker=4]="marketMaker"}(JC||(JC={}));const tj=({selectedVersion:e,baseAmount:t,quoteAmount:i,initPrice:o,slippageCoefficient:a})=>{const s=n.useMemo((()=>{const n=[jC.standard,jC.singleToken].includes(e),r=e===jC.singleToken;if(!t||!r&&!i)return;const s=Number(o),l=Number(t),d=Number(i),c=Number(a);return{i:s,k:c,b:l,b0:l,q:d,q0:0!==c&&n?0:d,R:0!==c&&n?1:0}}),[t,o,i,e,a]),l=n.useMemo((()=>{if(s)return r.getPmmModel(s)}),[s]),d=n.useMemo((()=>{if(l)return l.getMidPrice()}),[l]);return{pmmParams:s,pmmModel:l,midPrice:d}};function nj({selectedVersion:e,baseToken:i,quoteToken:r,initPrice:a,slippageCoefficient:s,baseAmount:l,quoteAmount:d}){const c=t.useTheme(),{isMobile:u}=Xa(),[p,h]=n.useState(!1),{pmmParams:m,pmmModel:x,midPrice:g}=tj({selectedVersion:e,baseAmount:l,quoteAmount:d,initPrice:a,slippageCoefficient:s});if(!u)return null;const f=o.i18n._({id:"FQfStS",message:"Emulator"}),y=o.i18n._({id:"ihn3o9",message:"The liquidity of ZUNO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});return z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{mx:20,mb:8},children:z.jsxs(t.Box,{sx:{width:"100%",px:20,py:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:c.palette.border.main,display:"flex",alignItems:"center",justifyContent:"space-between"},component:t.ButtonBase,onClick:()=>h(!0),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:c.palette.text.secondary,typography:"body1",fontWeight:600},children:[f,z.jsx(t.QuestionTooltip,{title:y,ml:4,sx:{width:14,height:14}})]}),!g||g.isNaN()?z.jsx(t.Box,{sx:{py:5,typography:"body1"},children:"-"}):"light"===c.palette.mode?z.jsx(HC,{width:"52",height:"32"}):z.jsx(GC,{width:"52",height:"32"})]})}),z.jsx(el,{open:p,onClose:()=>h(!1),modal:!0,title:z.jsxs(t.Box,{children:[f,z.jsx(t.QuestionTooltip,{title:y,ml:4})]}),children:z.jsx(t.Box,{sx:{px:28,pb:20,maxHeight:"calc(80vh - 134px)",overflowY:"auto",overflowX:"hidden"},children:z.jsx(ej,{baseToken:i,quoteToken:r,pmmParams:m,pmmModel:x,midPrice:g})})})]})}function ij({color:e,backgroundColor:n,tagKey:i}){return z.jsx(t.Box,{sx:{ml:8,px:8,py:2,borderRadius:4,backgroundColor:n,color:e,typography:"h6",fontWeight:500},children:i})}function oj({isWaiting:n,feeRate:i}){const r=t.useTheme();return z.jsxs(t.Box,{sx:{padding:16,borderRadius:8,backgroundColor:r.palette.background.paper,width:"50%",opacity:n?.5:1},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:n?"-":z.jsxs(z.Fragment,{children:[i||"-","%",i===BC&&z.jsx(ij,{tagKey:o.i18n._({id:"/+c6tU",message:"99% Default"}),color:r.palette.purple.main,backgroundColor:t.alpha(r.palette.purple.main,.1)})]})}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:r.palette.text.secondary,mt:8},children:z.jsx(e.Trans,{id:"Y7rVy0",message:"Fee Rate"})})]})}function rj({isWaiting:n,selectedVersion:i,baseToken:o,quoteToken:r,initPrice:a,slippageCoefficient:s,baseAmount:l,quoteAmount:d,peggedBaseTokenRatio:c,peggedQuoteTokenRatio:u}){const p=t.useTheme(),{pmmParams:h,pmmModel:m,midPrice:x}=tj({selectedVersion:i,baseAmount:l,quoteAmount:d,initPrice:a,slippageCoefficient:s});return z.jsxs(z.Fragment,{children:[!n&&z.jsx(ej,{baseToken:o,quoteToken:r,pmmParams:h,pmmModel:m,midPrice:x}),z.jsxs(t.Box,{sx:{mt:n?0:20,padding:16,borderRadius:8,backgroundColor:p.palette.background.paper,width:"50%",opacity:n?.5:1},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:n?"-":z.jsxs(z.Fragment,{children:[c,"% ",null==o?void 0:o.symbol," : ",u,"% ",null==r?void 0:r.symbol]})}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:p.palette.text.secondary,mt:8},children:z.jsx(e.Trans,{id:"eK0eiF",message:"Initial asset ratio"})})]})]})}function aj({title:e,children:n,isWaiting:i}){const o=t.useTheme();return z.jsxs(t.Box,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:i?"-":n}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:e})]})}function sj({status:e,selectedVersion:n,baseToken:i,quoteToken:r,initPrice:a,slippageCoefficient:s,baseAmount:l,quoteAmount:d}){var c;const{pmmParams:u,pmmModel:p,midPrice:h}=tj({selectedVersion:n,baseAmount:l,quoteAmount:d,initPrice:a,slippageCoefficient:s}),{versionMap:m}=wC(),x="waiting"===e,{initPriceLabel:g}=m[n];return z.jsxs(z.Fragment,{children:["running"===e&&z.jsx(ej,{baseToken:i,quoteToken:r,pmmParams:u,pmmModel:p,midPrice:h}),z.jsxs(t.Box,{sx:{mt:20,display:"flex",alignItems:"stretch",gap:12,opacity:x?.5:1},children:[z.jsx(aj,{title:o.i18n._({id:"fSFt4a",message:"Token Pair"}),isWaiting:x,children:i&&r?z.jsxs(z.Fragment,{children:[z.jsx(Pp,{width:24,tokens:[i,r],chainId:i.chainId}),i.symbol,"-",r.symbol]}):""}),z.jsx(aj,{title:g,isWaiting:x,children:i&&r?z.jsxs(z.Fragment,{children:["1 ",i.symbol,"=",null!==(c=_C({midPrice:h,quoteToken:r,selectedVersion:n,initPrice:a}))&&void 0!==c?c:"-"," ",r.symbol]}):""}),z.jsx(aj,{title:o.i18n._({id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:x,children:s})]})]})}function lj({isWaiting:n,selectedSubPeggedVersion:i}){var o,r;const a=t.useTheme(),s=TC();return z.jsxs(t.Box,{sx:{padding:16,borderRadius:8,backgroundColor:a.palette.background.paper,width:"50%",opacity:n?.5:1},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:n?"-":i&&null!==(r=null===(o=s[i])||void 0===o?void 0:o.title)&&void 0!==r?r:"-"}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:a.palette.text.secondary,mt:8},children:z.jsx(e.Trans,{id:"XPiFIY",message:"Can the pool price be adjusted?"})})]})}function dj({index:e,titleKey:n,status:i}){const o=t.useTheme(),{isMobile:r}=Xa();return z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:Object.assign({mt:28,mb:28,borderTopColor:"border.main",borderTopStyle:"solid",borderTopWidth:1},r?{mt:12,mb:12,display:1===e?"none":"block"}:{})}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",mb:20},children:[z.jsx(t.Box,{sx:{display:"flex",width:"20px",height:"20px",justifyContent:"center",alignItems:"center",flexShrink:0,borderRadius:"50%",backgroundColor:"waiting"===i?o.palette.background.paperDarkContrast:o.palette.secondary.main,typography:"h6",fontWeight:600,textAlign:"center",color:"waiting"===i?o.palette.text.disabled:o.palette.secondary.contrastText},children:"completed"===i?z.jsx(z.Fragment,{children:z.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M12.7596 3.55566L5.92549 10.3897L3.23957 7.71418L1.77734 9.17641L5.92549 13.3246L14.2218 5.02826L12.7596 3.55566Z",fill:"currentColor"})})}):e}),z.jsx(t.Box,{sx:{ml:8,typography:"body1",fontWeight:600,color:"waiting"===i?o.palette.text.disabled:o.palette.text.primary},children:n})]})]})}function cj({currentStep:e,isPeggedVersion:n}){const i=t.useTheme(),{isMobile:r}=Xa();let a="",s="",l="";switch(e){case 0:a=o.i18n._({id:"hdIg7i",message:"Select Pool Version"}),l=o.i18n._({id:"fw3eYd",message:"ZUNO provides a variety of pool versions to suit your needs."});break;case 1:a=o.i18n._({id:"lsg9Mi",message:"Parameter Settings"});break;case 2:n?a=o.i18n._({id:"6lss/t",message:"Pricing Model"}):(a=o.i18n._({id:"Y7rVy0",message:"Fee Rate"}),s=o.i18n._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}));break;case 3:if(!n)throw new Error("type is error");a=o.i18n._({id:"Y7rVy0",message:"Fee Rate"}),s=o.i18n._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."});break;case 4:if(!n)throw new Error("type is error");a=o.i18n._({id:"3ggd2j",message:"Asset ratio within the pool"});break;default:throw new Error(`Invalid Step ${e}`)}return z.jsxs(t.Box,{sx:Object.assign({position:"sticky",top:0,py:20,px:20,backgroundColor:i.palette.background.paper,zIndex:1},r?{}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{sx:{typography:"h5",color:i.palette.text.primary,fontWeight:600},children:a}),s&&z.jsx(t.QuestionTooltip,{title:s,sx:{width:16,height:16}}),z.jsx(t.Box,{sx:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:(n?[0,1,2,3,4]:[0,1,2]).map((n=>z.jsx(t.Box,{sx:{width:12,height:12,borderRadius:12,background:e>=n?i.palette.secondary.main:t.alpha(i.palette.primary.main,.1)}},n)))})]}),l&&z.jsx(t.Box,{sx:{mt:8,typography:"body2",color:i.palette.text.secondary},children:l})]})}function uj({versionItem:n,status:i}){const o=t.useTheme(),{noDocumentLink:r}=Q(),a="light"===o.palette.mode;return"completed"===i?z.jsxs(t.Box,{sx:{backgroundColor:o.palette.background.paper,borderRadius:8,width:"50%",padding:16},children:[z.jsx(t.Box,{sx:{typography:"h5",fontWeight:600,color:o.palette.text.primary},children:n.title}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,mt:8,color:o.palette.text.secondary},children:n.description})]}):z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{sx:{typography:"h4",fontWeight:600},children:n.title}),!r&&z.jsxs(t.Box,{sx:{ml:8,display:"flex",padding:"2px 8px",justifyContent:"center",alignItems:"center",gap:"2px",color:o.palette.text.disabled,backgroundColor:o.palette.background.paperDarkContrast,borderRadius:4,typography:"h6"},component:"a",href:n.docUrl,target:"_blank",rel:"noreferrer",children:[z.jsx(e.Trans,{id:"TGi+jm",message:"Doc"}),z.jsx("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.91667 3.41667V11.5833H11.0833V7.5H12.25V11.5833C12.25 12.225 11.725 12.75 11.0833 12.75H2.91667C2.26917 12.75 1.75 12.225 1.75 11.5833V3.41667C1.75 2.775 2.26917 2.25 2.91667 2.25H7V3.41667H2.91667ZM8.16667 3.41667V2.25H12.25V6.33333H11.0833V4.23917L5.34917 9.97333L4.52667 9.15083L10.2608 3.41667H8.16667Z",fill:"currentColor"})})]})]}),z.jsx(t.Box,{sx:{position:"relative",width:"100%",minHeight:220},children:z.jsx(t.Box,{component:a?n.exampleImgUrl:n.exampleDarkImgUrl,sx:{marginTop:20,width:"100%"}})})]})}function pj({side:e,tokenList:t,occupyToken:n,needFindToken:i,chainId:o}){var r,a;let s=null,l=null;const d=t.filter((t=>!(t.side&&t.side!==e||o&&t.chainId!==o)));return d.length&&(i&&(s=null!==(r=d.find((e=>e.address===(null==i?void 0:i.address)&&e.chainId===i.chainId)))&&void 0!==r?r:null,l=s),l||(n?l=null!==(a=d.find((e=>e.address!==n.address)))&&void 0!==a?a:null:[l]=d)),{findToken:s,defaultToken:l}}function hj(){const{account:e,chainId:t}=Pa(),n=pm((e=>{var t;return null===(t=e.page)||void 0===t?void 0:t.params}));return function({chainId:e,account:t,defaultBaseToken:n,defaultQuoteToken:i,tokenListInclude:o}={}){const{tokenList:r}=Ko(),a=pj({side:"from",needFindToken:n,tokenList:r,chainId:e}),s=c.useQuery(Object.assign({},Hi.getFetchTokenQuery(o?void 0:e,null==n?void 0:n.address,t))),l=c.useQuery(Object.assign({},Hi.getFetchTokenQuery(o?void 0:e,null==i?void 0:i.address,t)));let d=null,u=!1;d=a.defaultToken,s.data&&(d=s.data,u=s.isLoading);let p=null,h=!1;return p=pj({side:"to",needFindToken:i,occupyToken:d,tokenList:r,chainId:e}).defaultToken,l.data&&(p=l.data,h=l.isLoading),{defaultBaseToken:d,defaultQuoteToken:p,defaultBaseTokenLoading:u,defaultQuoteTokenLoading:h}}({chainId:t,account:e,defaultBaseToken:(null==n?void 0:n.fromAddress)?{address:null==n?void 0:n.fromAddress,chainId:t}:void 0,defaultQuoteToken:(null==n?void 0:n.toAddress)?{address:null==n?void 0:n.toAddress,chainId:t}:void 0})}function mj({tokens:e}){const{apikey:t}=Q(),n=ms(Oi.fiatPrice);return c.useQuery({enabled:!!e.length,queryKey:["fetch","fetchFiatPrice",e],queryFn:()=>N(this,void 0,void 0,(function*(){const i=yield g.post(n,{networks:e.map((e=>La(e.chainId))),addresses:e.map((e=>e.address)),symbols:e.map((e=>e.symbol)),isCache:!0},t?{headers:{apikey:t}}:void 0),o=new Map;return i.data.data&&i.data.data.forEach((e=>{const t=Number(e.price);!Number.isNaN(t)&&t>0&&o.set(e.address,t)})),o}))})}const xj=({selectedVersion:e})=>e===jC.pegged?["0.0001","0.0005","0.002"]:["0.5","0.01","1"];var gj;function fj(e,t){return!e||null==t||e.isNaN()?"":e.dp(t,s.ROUND_DOWN).toString()}function yj({state:e,fixedRatioPrice:t}){const{selectedVersion:n,baseToken:i,quoteToken:o,baseAmount:r,isFixedRatio:a,leftTokenAddress:l}=e;if(!i||!o)throw new Error("token is required");const d=l===(null==i?void 0:i.address),c=n===jC.standard,u=n===jC.pegged,p=new s(t);let h=c?SC:d?t:!p.isNaN()&&p.gt(0)?new s(1).div(p).dp(d?o.decimals:i.decimals).toString():AC;if(c){const e=18-i.decimals+o.decimals;e<String(SC).split(".")[1].length&&(h=new s(1).div(10**e).toString())}if(u){const n=DC({initPrice:h}),i=n.base?n.base.multipliedBy(100).toString():"",o=n.quote?n.quote.multipliedBy(100).toString():"";return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t,peggedBaseTokenRatio:i,peggedQuoteTokenRatio:o})}if(c&&a){const n=new s(r);if(!n.isNaN()&&!p.isNaN()&&p.gt(0)){const r=d?n.multipliedBy(p):n.div(p);return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t,baseAmount:fj(n,i.decimals),quoteAmount:fj(r,o.decimals)})}}return Object.assign(Object.assign({},e),{initPrice:h,fixedRatioPrice:t})}function vj(e,t){var n;switch(t.type){case gj.SetCurrentStep:{const{payload:n}=t;return e.selectedVersion===jC.pegged?Object.assign(Object.assign({},e),{currentStep:n>=4?4:n<=0?0:n}):Object.assign(Object.assign({},e),{currentStep:n>=2?2:n<=0?0:n})}case gj.SelectNewVersion:{const{payload:i}=t;if(i===e.selectedVersion)return e;let o,r=MC;i===jC.pegged&&(r=RC,o=CC.DSP);let a=SC;i===jC.singleToken?a="":i!==jC.standard&&(a=AC);let s=!0;return i===jC.singleToken&&(s=!1),Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:"",isFixedRatio:s,initPrice:a,fixedRatioPrice:i===jC.singleToken?"":AC,slippageCoefficient:r,isSlippageCoefficientCustomized:!xj({selectedVersion:t.payload}).includes(r),selectedVersion:t.payload,selectedSubPeggedVersion:o,leftTokenAddress:null===(n=e.baseToken)||void 0===n?void 0:n.address})}case gj.SelectNewSubPeggedVersion:return Object.assign(Object.assign({},e),{selectedSubPeggedVersion:t.payload});case gj.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:n,baseAmount:"",leftTokenAddress:null==n?void 0:n.address})}case gj.UpdateQuoteToken:{const{baseToken:n}=e;return Object.assign(Object.assign({},e),{quoteToken:t.payload,quoteAmount:"",leftTokenAddress:null==n?void 0:n.address})}case gj.SwitchTokens:{const{selectedVersion:t,baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:r}=e;return t===jC.singleToken?Object.assign(Object.assign({},e),{baseToken:i,quoteToken:n,leftTokenAddress:null==i?void 0:i.address}):Object.assign(Object.assign({},e),{baseToken:i,quoteToken:n,baseAmount:r,quoteAmount:o,leftTokenAddress:null==i?void 0:i.address})}case gj.UpdateBaseAmount:{const n=t.payload,{selectedVersion:i,quoteToken:o,fixedRatioPrice:a,isFixedRatio:l,peggedBaseTokenRatio:d}=e;if(!o)throw new Error("token is required");const c=new s(n);if(i===jC.pegged){const t=new s(d).div(100).dp(PC,s.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:""});const i=c.div(t).minus(c);return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:fj(i,o.decimals)})}if(i===jC.standard&&l&&a){if(!n)return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:n});const t=function(e,t){const n=new r.PMMModel;return n.B=new s(e.baseAmount),n.i=new s(e.initPrice),n.k=new s(e.slippageCoefficient),n.RStatus=1,n.getQuoteByMidPrice(t)}(Object.assign(Object.assign({},e),{baseAmount:n}),new s(a));return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:fj(t,o.decimals)})}return Object.assign(Object.assign({},e),{baseAmount:n})}case gj.UpdateQuoteAmount:{const n=t.payload,{selectedVersion:i,baseToken:o,fixedRatioPrice:r,isFixedRatio:a,leftTokenAddress:l,peggedQuoteTokenRatio:d}=e;if(!o)throw new Error("token is required");const c=l===(null==o?void 0:o.address),u=new s(n);if(i===jC.pegged){const t=new s(d).div(100).dp(PC,s.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:n});const i=u.div(t).minus(u);return Object.assign(Object.assign({},e),{baseAmount:fj(i,o.decimals),quoteAmount:n})}if(i===jC.standard&&a){const t=new s(r),i=t.gt(0)?c?u.div(t):u.multipliedBy(t):void 0;return Object.assign(Object.assign({},e),{baseAmount:fj(i,o.decimals),quoteAmount:n})}return Object.assign(Object.assign({},e),{quoteAmount:n})}case gj.UpdateIsFixedRatio:return Object.assign(Object.assign({},e),{isFixedRatio:t.payload});case gj.InitFixedRatioPrice:{const{leftTokenAddress:n,baseToken:i,quoteToken:o}=e;if(!i||!o)throw new Error("token is required");const r=n===(null==i?void 0:i.address),{baseTokenFiatPrice:a,quoteTokenFiatPrice:l}=t.payload,d=a&&l?new s(a).div(l):void 0,c=a&&l?new s(l).div(a):void 0,u=r?d:c,p=r?o.decimals:i.decimals;return u&&!u.isNaN()?yj({state:e,fixedRatioPrice:u.dp(p,s.ROUND_DOWN).toString()}):e}case gj.UpdateFixedRatioPrice:return yj({state:e,fixedRatioPrice:t.payload});case gj.ToggleLeftToken:{const{baseToken:t,quoteToken:n,fixedRatioPrice:i}=e;if(!t||!n)throw new Error("token is required");const o=e.leftTokenAddress===(null==t?void 0:t.address),r=o?null==n?void 0:n.address:null==t?void 0:t.address,a=new s(i);if(!a.isNaN()&&a.gt(0)){const i=new s(1).div(a).dp(o?t.decimals:n.decimals);return yj({state:Object.assign(Object.assign({},e),{leftTokenAddress:r}),fixedRatioPrice:i.toString()})}return Object.assign(Object.assign({},e),{leftTokenAddress:r})}case gj.UpdateSlippageCoefficient:return Object.assign(Object.assign({},e),{slippageCoefficient:t.payload});case gj.UpdateIsSlippageCoefficientCustomized:return Object.assign(Object.assign({},e),{isSlippageCoefficientCustomized:t.payload});case gj.UpdateFeeRate:return Object.assign(Object.assign({},e),{feeRate:t.payload});case gj.UpdateIsFeeRateCustomized:return Object.assign(Object.assign({},e),{isFeeRateCustomized:t.payload});case gj.InitEditParameters:return function(e,t){const{baseToken:n,quoteToken:i}=t;return n&&i?Object.assign(Object.assign({},e),{baseToken:n,quoteToken:i,leftTokenAddress:null==n?void 0:n.address,slippageCoefficient:"",initPrice:"",fixedRatioPrice:"",feeRate:"",isFixedRatio:!1}):e}(e,t.payload);case gj.UpdatePeggedBaseTokenRatio:{if(!e.quoteToken)throw new Error("token is required");const n=t.payload,i=new s(n).dp(PC-2,s.ROUND_DOWN);if(!i.isFinite()||i.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:"",baseAmount:"",quoteAmount:""});const o=new s(100).minus(i).dp(PC-2,s.ROUND_DOWN),r=i.lte(0)?"0":e.baseAmount,a=new s(r),l=a.div(i.div(100)).minus(a);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:n,peggedQuoteTokenRatio:o.lt(0)?"0":o.toString(),baseAmount:r,quoteAmount:fj(l,e.quoteToken.decimals)})}case gj.UpdatePeggedQuoteTokenRatio:{if(!e.baseToken)throw new Error("token is required");const n=t.payload,i=new s(n).dp(PC-2,s.ROUND_DOWN);if(!i.isFinite()||i.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:n,baseAmount:"",quoteAmount:""});const o=new s(100).minus(i).dp(PC-2,s.ROUND_DOWN),r=i.lte(0)?"0":e.quoteAmount,a=new s(r),l=a.div(i.div(100)).minus(a);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:o.lt(0)?"0":o.toString(),peggedQuoteTokenRatio:n,baseAmount:fj(l,e.baseToken.decimals),quoteAmount:r})}default:throw Error("Unknown action: "+t.type)}}function bj({isSingleTokenVersion:e,leftTokenAddress:t,baseToken:i,quoteToken:o,dispatch:r}){var a,l;const d=mj({tokens:n.useMemo((()=>i&&o?[i,o]:[]),[i,o])}),c=t===(null==i?void 0:i.address),u=i?null===(a=d.data)||void 0===a?void 0:a.get(i.address):void 0,p=o?null===(l=d.data)||void 0===l?void 0:l.get(o.address):void 0,h=n.useMemo((()=>{const e=u&&p?new s(u).div(p):void 0,t=u&&p?new s(p).div(u):void 0;return c?e:t}),[u,c,p]),m=!h||h.isNaN(),x=!d.isLoading&&!d.isPending&&m;return n.useLayoutEffect((()=>{x&&r({type:gj.UpdateIsFixedRatio,payload:!1})}),[r,x]),n.useLayoutEffect((()=>{e||u&&r({type:gj.InitFixedRatioPrice,payload:{baseTokenFiatPrice:u,quoteTokenFiatPrice:p}})}),[u,r,e,p]),{fiatPriceLoading:d.isLoading||d.isPending,currentPrice:h,isErrorPrice:x,isNullPrice:m}}function Cj({label:e,value:n}){return z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",mb:16},children:[z.jsx(t.Box,{sx:{color:"text.secondary",mr:8},children:e}),z.jsx(t.Box,{sx:{textAlign:"right",wordBreak:"break-all"},children:n})]})}function jj({on:e,onClose:n,state:i,onConfirm:r,isModify:a,loading:s}){var l,d,c,u,p,h,m;const{chainId:x}=Pa(),{versionMap:g}=wC(),{isMobile:f}=Xa(),{title:y,initPriceLabel:v}=g[i.selectedVersion],{midPrice:b}=tj({selectedVersion:i.selectedVersion,baseAmount:i.baseAmount,quoteAmount:i.quoteAmount,initPrice:i.initPrice,slippageCoefficient:i.slippageCoefficient}),C=TC(),j=i.selectedVersion===jC.pegged;return z.jsx(el,{open:e,onClose:n,modal:!0,title:a?o.i18n._({id:"dzV+zO",message:"Modify Confirmation"}):o.i18n._({id:"tnRI9r",message:"Pool Creation Confirmation"}),children:z.jsxs(t.Box,{sx:{flex:1,px:20,pb:20,display:"flex",flexDirection:"column",justifyContent:"space-between",width:f?void 0:420},children:[z.jsxs(t.Box,{sx:{pt:40,px:8},children:[z.jsx(Cj,{label:o.i18n._({id:"eE0JZ4",message:"Version"}),value:y}),z.jsx(Cj,{label:o.i18n._({id:"7m5+6j",message:"Initial Tokens"}),value:z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[z.jsx(sl,{address:null===(l=i.baseToken)||void 0===l?void 0:l.address,chainId:x,marginRight:8,width:18,height:18}),i.baseAmount||"-"," ",null===(d=i.baseToken)||void 0===d?void 0:d.symbol]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:4},children:[z.jsx(sl,{address:null===(c=i.quoteToken)||void 0===c?void 0:c.address,chainId:x,marginRight:8,width:18,height:18}),i.quoteAmount||"-"," ",null===(u=i.quoteToken)||void 0===u?void 0:u.symbol]})]})}),z.jsx(Cj,{label:o.i18n._({id:"sjn3tj",message:"Slippage Coefficient"}),value:i.slippageCoefficient}),z.jsx(Cj,{label:v,value:i.baseToken&&i.quoteToken?`1 ${i.baseToken.symbol} = ${_C({midPrice:b,quoteToken:i.quoteToken,selectedVersion:i.selectedVersion,initPrice:i.initPrice})} ${i.quoteToken.symbol}`:""}),j&&z.jsx(Cj,{label:o.i18n._({id:"6lss/t",message:"Pricing Model"}),value:i.selectedSubPeggedVersion?null===(p=C[i.selectedSubPeggedVersion])||void 0===p?void 0:p.title:"-"}),z.jsx(Cj,{label:o.i18n._({id:"Y7rVy0",message:"Fee Rate"}),value:`${i.feeRate}%`}),j&&z.jsx(Cj,{label:o.i18n._({id:"eK0eiF",message:"Initial asset ratio"}),value:z.jsxs(z.Fragment,{children:[i.peggedBaseTokenRatio,"% ",null===(h=i.baseToken)||void 0===h?void 0:h.symbol," : ",i.peggedQuoteTokenRatio,"% ",null===(m=i.quoteToken)||void 0===m?void 0:m.symbol]})})]}),z.jsx(t.Button,{fullWidth:!0,isLoading:s,sx:{mt:30},onClick:r,children:a?o.i18n._({id:"7VpPHA",message:"Confirm"}):o.i18n._({id:"hYgDIe",message:"Create"})})]})})}!function(e){e[e.SetCurrentStep=1]="SetCurrentStep",e[e.SelectNewVersion=2]="SelectNewVersion",e[e.SelectNewSubPeggedVersion=3]="SelectNewSubPeggedVersion",e[e.UpdateBaseToken=4]="UpdateBaseToken",e[e.UpdateQuoteToken=5]="UpdateQuoteToken",e[e.SwitchTokens=6]="SwitchTokens",e[e.UpdateBaseAmount=7]="UpdateBaseAmount",e[e.UpdateQuoteAmount=8]="UpdateQuoteAmount",e[e.UpdateIsFixedRatio=9]="UpdateIsFixedRatio",e[e.UpdateFixedRatioPrice=10]="UpdateFixedRatioPrice",e[e.InitFixedRatioPrice=11]="InitFixedRatioPrice",e[e.ToggleLeftToken=12]="ToggleLeftToken",e[e.UpdateSlippageCoefficient=13]="UpdateSlippageCoefficient",e[e.UpdateIsSlippageCoefficientCustomized=14]="UpdateIsSlippageCoefficientCustomized",e[e.UpdateFeeRate=15]="UpdateFeeRate",e[e.UpdateIsFeeRateCustomized=16]="UpdateIsFeeRateCustomized",e[e.InitEditParameters=17]="InitEditParameters",e[e.UpdatePeggedBaseTokenRatio=18]="UpdatePeggedBaseTokenRatio",e[e.UpdatePeggedQuoteTokenRatio=19]="UpdatePeggedQuoteTokenRatio"}(gj||(gj={}));const wj=({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:a,feeRate:l,initPrice:d,slippageCoefficient:c})=>{const{chainId:u,account:p}=Pa(),{deadLine:h}=Q(),m=r.basicTokenMap[u];return{getCreateParams:()=>N(void 0,void 0,void 0,(function*(){if(!p||!n||!i)return null;let g="";const f=Number(n.decimals),y=Number(i.decimals),v=new s(l),b=e===jC.marketMakerPool,C=e===jC.standard,j=e===jC.pegged,w=e===jC.pegged&&t===CC.GSP,k={decimals:f,address:n.address},T={decimals:y,address:i.address},B=x.parseFixed(o,f).toString(),E=x.parseFixed(a||"0",y).toString(),I=b?v.times(100).toNumber():v.times(80).toNumber();let A=b&&C?new s(a).div(o).dp(y,s.ROUND_DOWN).toString():new s(d).toString();if(C){const e=18-n.decimals+i.decimals;e<String(SC).split(".")[1].length&&(A=new s(1).div(10**e).toString())}const S=Number(c||(j?"0.1":"1")),L=Math.ceil(Date.now()/1e3)+(null!=h?h:3600);let M;const R=[u,k,T,B,E,I,A,S,L];try{e===jC.standard||e===jC.singleToken?M=yield r.PoolApi.encode.createDVMPoolABI(...R):b?M=yield r.PoolApi.encode.createDPPPoolABI(...R):j?M=yield r.PoolApi.encode.createDSPPoolABI(...R):w&&(M=yield r.PoolApi.encode.createGSPPoolABI(u,p,k,T,B,E,I,A,S,L))}catch(e){throw console.error("2.0 CreatePool createPrams error",R,e),g=`2.0 CreatePool createPrams error; ERROR: ${e}`,new Error(g)}if(!M||!M.data)throw g="invalid data",new Error(g);try{const e=m.address.toLowerCase();return o&&n.address.toLowerCase()===e?M.value=Uf(o):a&&i.address.toLowerCase()===e?M.value=Uf(a):M.value=0,M}catch(e){throw console.error("2.0 sendTransaction error",e),g=`2.0 sendTransaction error; ERROR: ${e}`,new Error(g)}}))}},kj=({chainId:n,baseToken:i,quoteToken:o})=>{const r=t.useTheme();return NC({chainId:n,baseToken:i,quoteToken:o})?z.jsx(t.Box,{sx:{mb:12,py:8,px:12,borderRadius:8,backgroundColor:t.alpha(r.palette.error.main,.1),color:r.palette.error.main,textAlign:"center",typography:"h6",fontWeight:500},children:z.jsx(e.Trans,{id:"peTryP",message:"{0}-{1} is not supported. Please select another pair.",values:{0:null==i?void 0:i.symbol,1:null==o?void 0:o.symbol}})}):null};function Tj({state:n,dispatch:i,openConfirm:r,isPeggedVersion:a,isStandardVersion:l,isSingleTokenVersion:d,fiatPriceLoading:c}){var u,p;const{currentStep:h,selectedVersion:m,baseToken:x,quoteToken:g,baseAmount:f,quoteAmount:y,initPrice:v,slippageCoefficient:b,feeRate:C}=n,j=new s(f||0),w=new s(y||0),k=Ms(x,{amount:f}),T=Ms(g,{amount:y}),B={variant:t.Button.Variant.contained},E=NC({chainId:null!==(p=null===(u=n.baseToken)||void 0===u?void 0:u.chainId)&&void 0!==p?p:1,baseToken:x,quoteToken:g}),I=o.i18n._({id:"hXzOVo",message:"Next"}),A=z.jsx(t.Button,{fullWidth:!0,disabled:!0,...B,children:I}),S=z.jsx(t.Button,{variant:t.Button.Variant.contained,fullWidth:!0,onClick:r,children:z.jsx(e.Trans,{id:"hYgDIe",message:"Create"})});if(0===h)return z.jsx(t.Button,{fullWidth:!0,...B,onClick:()=>{i({type:gj.SetCurrentStep,payload:1})},children:I});const L=!x||j.isNaN()||j.lte(0),M=!g||w.isNaN()||w.lte(0);if(1===h){if(E)return A;if(a){if(!x||!g)return A}else{if(L)return A;if(k.needShowTokenStatusButton||k.insufficientBalance)return z.jsx(Nf,{status:k,buttonProps:B});if(!d){if(M)return A;if(T.needShowTokenStatusButton||T.insufficientBalance)return z.jsx(Nf,{status:T,buttonProps:B})}if(!l){if(!g)return A;const e=new s(v),t=Math.min(g.decimals,16);if(!v||e.isNaN()||e.lt(`1e-${t}`)||e.gt(LC))return A;const n=new s(b);if(!b||n.isNaN()||n.lt(0)||n.gt(m===jC.pegged?OC:MC))return A}if(c)return A;if(NC({chainId:x.chainId,baseToken:x,quoteToken:g}))return A}return z.jsx(t.Button,{fullWidth:!0,...B,onClick:()=>{i({type:gj.SetCurrentStep,payload:2})},children:I})}const R=new s(C),O=!C||R.isNaN()||R.lt(EC)||R.gt(IC);return 2===h?a?z.jsx(t.Button,{fullWidth:!0,...B,onClick:()=>{i({type:gj.SetCurrentStep,payload:3})},children:I}):O?A:S:3===h?O?A:z.jsx(t.Button,{fullWidth:!0,...B,onClick:()=>{i({type:gj.SetCurrentStep,payload:4})},children:I}):4===h?L||M?A:k.needShowTokenStatusButton||k.insufficientBalance?z.jsx(Nf,{status:k,buttonProps:B}):T.needShowTokenStatusButton||T.insufficientBalance?z.jsx(Nf,{status:T,buttonProps:B}):S:null}function Bj({state:i,dispatch:r,isPeggedVersion:a,isStandardVersion:s,isSingleTokenVersion:l,fiatPriceLoading:d}){const{currentStep:u}=i,p=t.useTheme(),{isMobile:h}=Xa(),m=us(),{onlyChainId:x,chainId:g}=Pa(),[f,y]=n.useState(!1),{getCreateParams:v}=wj(i),b=c.useMutation({mutationFn:()=>N(this,void 0,void 0,(function*(){const e=yield v();if(!e)return;(yield m.execute(o.i18n._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:rs.TX,desc:"Create pool"},e),{early:!0,metadata:{[i.selectedVersion===jC.marketMakerPool?exports.MetadataFlag.createDPPPool:i.selectedVersion===jC.pegged?i.selectedSubPeggedVersion===CC.DSP?exports.MetadataFlag.createDSPPool:exports.MetadataFlag.createGSPPool:exports.MetadataFlag.createDVMPool]:"1"}}))===es.Submitted&&setTimeout((()=>{pm.getState().push({type:exports.PageType.Pool,params:{tab:Qy.myCreated}})}),100)}))});return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:p.palette.background.paperContrast,px:20,py:20},h?{}:{position:"static",backgroundColor:"transparent",py:0}),children:[1==u&&z.jsx(kj,{chainId:g,baseToken:i.baseToken,quoteToken:i.quoteToken}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[0===u&&h&&z.jsx(t.Button,{variant:t.Button.Variant.second,fullWidth:!0,onClick:()=>{pm.getState().back()},children:z.jsx(e.Trans,{id:"dEgA5A",message:"Cancel"})}),u>0&&z.jsx(t.Button,{variant:t.Button.Variant.second,fullWidth:!0,onClick:()=>{r({type:gj.SetCurrentStep,payload:u-1})},children:z.jsx(e.Trans,{id:"iH8pgl",message:"Back"})}),z.jsx(Im,{chainId:x,variant:t.Button.Variant.contained,fullWidth:!0,includeButton:!0,children:z.jsx(Tj,{state:i,dispatch:r,openConfirm:()=>{y(!0)},isPeggedVersion:a,isStandardVersion:s,isSingleTokenVersion:l,fiatPriceLoading:d})})]})]}),z.jsx(jj,{on:f,onClose:()=>y(!1),state:i,isModify:!1,onConfirm:b.mutate,loading:b.isPending})]})}function Ej({selected:e}){const n=t.useTheme();return z.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{marginLeft:"auto",flexShrink:0},children:[z.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:e?n.palette.success.main:n.palette.text.secondary}),e&&z.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:n.palette.success.main,stroke:n.palette.success.main})]})}function Ij({title:e,subTitle:n,description:i,selected:o,onClick:r,children:a,sx:s,titleSx:l}){const d=t.useTheme();d.palette.mode;return z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",p:20,backgroundColor:d.palette.background.tag,borderWidth:1,borderColor:o?d.palette.primary.main:"transparent",borderStyle:"solid",borderRadius:12,flexWrap:"wrap",justifyContent:"flex-start",textAlign:"left","&:hover":{borderColor:d.palette.primary.main}},s),component:t.ButtonBase,onClick:r,children:[z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between",typography:"caption",pr:2,color:d.palette.text.primary},l),children:[e,n,z.jsx(Ej,{selected:o})]}),z.jsx(t.Box,{sx:{mt:8,typography:"body2",width:"100%",textAlign:"left",color:o?d.palette.text.primary:d.palette.text.secondary},children:i}),a]})}function Aj({errorMsg:e,isCustomized:i,onClick:r,value:a,onChange:s}){const l=t.useTheme(),d=n.useMemo((()=>!(!a||"0"===a||Number(a))),[a]);return z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{py:12,px:20,backgroundColor:l.palette.background.paper,borderColor:i&&e||d?l.palette.error.main:i?l.palette.primary.main:l.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center"},onClick:r,children:z.jsx(Ju,{value:i?a:"",onChange:s,suffix:z.jsx(Ej,{selected:i}),placeholder:o.i18n._({id:"8Tg/JR",message:"Custom"}),sx:{backgroundColor:"transparent","& input":{typography:"body1",height:36,lineHeight:"36px",p:l.spacing(0),color:l.palette.text.primary,"&::placeholder":{color:l.palette.text.disabled,fontWeight:600,typography:"body1",lineHeight:1,position:"relative"}}}})}),e&&z.jsx(t.Box,{sx:{typography:"h6",color:"error.main",mt:6},children:e})]})}const Sj=()=>[{title:"0.01%",description:o.i18n._({id:"yzjPpo",message:"Fees will be the same as in most other pools."}),value:"0.01"},{title:"0.3%",description:o.i18n._({id:"OJOe+K",message:"Set the fee to the same as most other pools"}),value:BC,tag:"99% Default"},{title:"1%",description:"Most suitable for swapping exotic assets.",value:"1"}];function Lj(){const e=t.useTheme();return n.useMemo((()=>Sj().map((n=>n.value===BC?Object.assign(Object.assign({},n),{tagBackgroundColor:t.alpha(e.palette.purple.main,.1),tagColor:e.palette.purple.main}):n))),[e.palette.purple.main])}const Mj=e=>{if(!e)return"";const t=new s(e);return t.isNaN()||!t.lt(EC)&&!t.gt(IC)?"":o.i18n._({id:"GSt7YT",message:"The fee rate must be between 0.01% to 10%"})},Rj=(e,t)=>{if(!e)return"";const n=new s(e);if(!n.isNaN()&&(n.lt(0)||n.gt(t===jC.pegged?OC:MC)))switch(t){case jC.standard:case jC.singleToken:case jC.marketMakerPool:return o.i18n._({id:"3U+Oti",message:"he slippage coefficient needs to be greater than or equal to 0, and less than or equal to 1."});case jC.pegged:return o.i18n._({id:"LDprZB",message:"The slippage coefficient needs to be greater than 0, and less than 0.1."})}return""};function Oj({dispatch:i,feeRate:o,isFeeRateCustomized:r}){const a=t.useTheme(),s=Lj(),l=n.useMemo((()=>Mj(o)||""),[o]);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:[s.map((e=>{const t=!r&&o===e.value;return z.jsx(Ij,{title:e.title,description:e.description,onClick:()=>{i({type:gj.UpdateIsFeeRateCustomized,payload:!1}),i({type:gj.UpdateFeeRate,payload:e.value})},selected:t,subTitle:e.tag?z.jsx(ij,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:a.palette.background.paper,borderColor:t?a.palette.primary.main:a.palette.border.main}},e.value)})),z.jsx(t.Box,{sx:{mt:8},children:z.jsx(Aj,{errorMsg:l,isCustomized:r,onClick:()=>{i({type:gj.UpdateFeeRate,payload:""}),i({type:gj.UpdateIsFeeRateCustomized,payload:!0})},value:o,onChange:e=>{i({type:gj.UpdateFeeRate,payload:e})}})})]}),z.jsx(t.Box,{sx:{typography:"body2",mt:20,color:"text.secondary",px:20},children:z.jsx(e.Trans,{id:"0b0AkA",message:"* Please note that the Fee Rate cannot be modified after the pool is created"})})]})}function Pj({on:t,onClose:n,onConfirm:i}){return z.jsx(Yf,{open:t,onClose:n,onConfirm:i,title:o.i18n._({id:"t+LmjM",message:"Initial Price Alert"}),modal:!0,children:z.jsx(e.Trans,{id:"yXm1vH",message:"The initial price is different from the current market price, which may cause your pool to be arbitraged"})})}const _j=({title:e,children:n,sx:i})=>{const o=t.useTheme();return z.jsxs(t.Box,{sx:Object.assign({mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},i),children:[z.jsx(t.Box,{sx:{typography:"body2",color:o.palette.text.primary,fontWeight:500,display:"flex",alignItems:"center"},children:e}),n]})};function Dj({selectedVersion:i,isStandardVersion:r,isSingleTokenVersion:a,isFixedRatio:l,leftTokenAddress:d,baseToken:c,quoteToken:u,fixedRatioPrice:p,dispatch:h,priceInfo:m}){const x=t.useTheme(),[g,f]=n.useState(!1),{versionMap:y}=wC(),{initPriceLabel:v,initPriceTips:b,initPriceTipsLink:C}=y[i],j=d===(null==c?void 0:c.address),w=j?null==c?void 0:c.symbol:null==u?void 0:u.symbol,k=j?null==u?void 0:u.symbol:null==c?void 0:c.symbol,{currentPrice:T,isErrorPrice:B,isNullPrice:E,fiatPriceLoading:I}=m,A=j?null==u?void 0:u.decimals:null==c?void 0:c.decimals,S=n.useMemo((()=>{if(!u)return"";const e=function(e,t,n){if(!t)return"";const i=new s(t),r=Math.min(n,16),a=Number(`1e-${r}`);if(e!==jC.standard&&!i.isNaN()&&(i.lt(a)||i.gt(LC))){const t=a.toFixed(r);switch(e){case jC.pegged:case jC.singleToken:return o.i18n._({id:"P4iKEj",message:"The initial price needs to be greater than {min} and less than 100,000,000",values:{min:t}});case jC.marketMakerPool:return o.i18n._({id:"kdzjmC",message:"The mid price needs to be greater than {min} and less than 100,000,000",values:{min:t}})}}return""}(i,p,u.decimals);return e||""}),[p,u,i]),L=n.useMemo((()=>!(!p||"0"===p||Number(p))),[p]);return z.jsxs(z.Fragment,{children:[z.jsx(_j,{title:z.jsxs(z.Fragment,{children:[v,b&&z.jsx(t.QuestionTooltip,{title:z.jsxs(z.Fragment,{children:[b,C?z.jsxs(z.Fragment,{children:["\n",z.jsxs(t.Box,{component:"a",href:C,target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[z.jsx(e.Trans,{id:"NgeSlx",message:"Learn More"}),">"]})]}):""]}),ml:4,sx:{width:14,height:14,alignItems:"center"}})]}),sx:{mt:20},children:z.jsxs(t.Box,{sx:{pt:r?11:19,px:19,pb:11,borderWidth:1,borderStyle:"solid",borderColor:S||L?"error.main":x.palette.background.cardInput,borderRadius:8,backgroundColor:x.palette.background.cardInput,display:"flex",flexDirection:"column",alignItems:"stretch",gap:20},children:[r?null:z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{typography:"body2",color:x.palette.text.primary,display:"flex",alignItems:"center"},children:[z.jsxs(t.Box,{sx:{fontWeight:600,color:x.palette.text.disabled,flexShrink:0},children:["1 ",null!=w?w:"-"," ="]}),z.jsx(Ju,{value:p,onChange:e=>{h({type:gj.UpdateFixedRatioPrice,payload:e})},readOnly:l,sx:{backgroundColor:"background.cardInput",pl:0,pr:0,mt:0,flex:"1 1 auto","& input":{textAlign:"right",typography:"h5",height:25,py:0,px:8,color:x.palette.text.primary,"&::placeholder":{color:x.palette.text.disabled}}}}),z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:x.palette.text.disabled,flexShrink:0},children:null!=k?k:"-"}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},component:t.ButtonBase,onClick:()=>{h({type:gj.ToggleLeftToken})},children:z.jsx(t.HoverOpacity,{weak:!0,component:oe.Switch,sx:{marginLeft:8,p:x.spacing(2),color:x.palette.text.primary,backgroundColor:t.alpha(x.palette.primary.main,.1),borderRadius:"50%"}})})]}),S&&z.jsx(t.Box,{sx:{typography:"h6",color:"error.main",mt:-14},children:S})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:r?"flex-start":"flex-end",typography:"h6",color:x.palette.text.primary,fontWeight:500},children:["=",z.jsx(e.Trans,{id:"pdZiL7",message:"Current Market Price:"})," ",I?z.jsx(t.Skeleton,{sx:{borderRadius:4},width:50,height:17}):E?z.jsx(t.Tooltip,{title:z.jsx(e.Trans,{id:"mObS+5",message:"Failed to get price of the token"}),children:z.jsx(t.Box,{component:oe.Warn,sx:{width:14,height:14,color:x.palette.error.main,typography:"h6"}})}):ir({input:T,decimals:A})," ",k,B||a?null:z.jsx(t.Checkbox,{checked:l,onChange:e=>{if(e.target.checked){if(h({type:gj.UpdateIsFixedRatio,payload:!0}),!A)throw new Error("currentTokenDecimals is undefined");T&&!T.isNaN()&&h({type:gj.UpdateFixedRatioPrice,payload:T.dp(A,s.ROUND_DOWN).toString()})}else f(!0)},sx:{ml:8}})]})]})}),z.jsx(Pj,{on:g,onClose:()=>f(!1),onConfirm:()=>{h({type:gj.UpdateIsFixedRatio,payload:!1})}})]})}function Nj({selectedVersion:e,selectedSubPeggedVersion:n,baseToken:i,quoteToken:o,initPrice:r,dispatch:a}){var s;const l=t.useTheme(),{versionMap:d,subPeggedVersionList:c}=wC(),{initPriceLabel:u}=d[e];return i&&o?z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body2",color:l.palette.text.secondary,fontWeight:500},children:u}),z.jsxs(t.Box,{sx:{typography:"h5",color:l.palette.text.primary,fontWeight:600},children:["1 ",null==i?void 0:i.symbol,"=",null!==(s=_C({midPrice:void 0,quoteToken:o,selectedVersion:e,initPrice:r}))&&void 0!==s?s:"-"," ",o.symbol]})]}),z.jsx(t.Box,{sx:{mt:20,display:"flex",flexDirection:"column",gap:12,px:20},children:c.map((e=>{const t=n===e.version;return z.jsx(Ij,{title:e.title,description:e.description,onClick:()=>{a({type:gj.SelectNewSubPeggedVersion,payload:e.version})},selected:t,subTitle:void 0,sx:{backgroundColor:l.palette.background.paper,borderColor:t?l.palette.primary.main:l.palette.border.main},titleSx:{typography:"body1",fontWeight:600}},e.version)}))})]}):null}function Fj({title:e,value:n,onChange:i}){const o=t.useTheme();return z.jsxs(t.Box,{sx:{flexGrow:1,flexShrink:1,flexBasis:"50%",display:"flex",alignItems:"center",px:15,py:7,borderWidth:1,borderStyle:"solid",borderColor:o.palette.border.main,borderRadius:8,backgroundColor:o.palette.background.cardInput},children:[z.jsx(t.Box,{sx:{color:o.palette.text.primary,typography:"body1",fontWeight:500,flexShrink:0},children:e}),z.jsx(Ju,{value:n,onChange:i,suffix:"%",placeholder:"0",sx:{backgroundColor:"background.cardInput",mt:0,display:"flex",alignItems:"center",width:"100%",typography:"h5",lineHeight:"32px",color:o.palette.text.disabled,"& input":{textAlign:"right",py:0,px:8,color:o.palette.text.primary,"&::placeholder":{opacity:1,color:o.palette.text.disabled,fontWeight:600,typography:"h5",lineHeight:1,position:"relative"}}}})]})}const Uj=({baseToken:i,quoteToken:o,initPrice:r,peggedBaseTokenRatio:a,peggedQuoteTokenRatio:l,baseAmount:d,quoteAmount:c,dispatch:u})=>{var p,h;const m=t.useTheme(),[x,g]=n.useMemo((()=>{const{base:e,quote:t}=DC({initPrice:r});return[e?e.multipliedBy(100).toString():null,t?t.multipliedBy(100).toString():null]}),[r]),f=""===a&&""===l,[y,v]=n.useMemo((()=>{var e,t;const n=null!==(e=null==i?void 0:i.decimals)&&void 0!==e?e:0,a=null!==(t=null==o?void 0:o.decimals)&&void 0!==t?t:0,l=new s(d).dp(n,s.ROUND_DOWN).multipliedBy(`1e${n}`),u=new s(c).dp(a,s.ROUND_DOWN).multipliedBy(`1e${a}`),p=new s(r).multipliedBy(`1e${18-n+a}`).dp(0,s.ROUND_DOWN),h=u.lt(l.multipliedBy(p).div(1e18))?u.multipliedBy(1e18).div(p):l,m=new s(1001);if(m.gt(h))return[new s(1),"100%"];const x=m.dividedBy(h);return[x,gr({input:x})]}),[d,null==i?void 0:i.decimals,r,c,null==o?void 0:o.decimals]),b=n.useMemo((()=>!!y.lte("0.0000000001")||null!=x&&a===x&&null!=g&&l===g),[y,a,l,x,g]),C=`${null==i?void 0:i.symbol}:${null==o?void 0:o.symbol}=${x}%:${g}%`;return z.jsxs(_j,{title:z.jsx(e.Trans,{id:"OuSseo",message:"Ratio Settings"}),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(Fj,{title:null!==(p=null==i?void 0:i.symbol)&&void 0!==p?p:"",value:a,onChange:e=>{u({type:gj.UpdatePeggedBaseTokenRatio,payload:e})}}),z.jsx(t.Box,{sx:{color:m.palette.text.primary,typography:"body2",fontWeight:500,width:14,flexShrink:0,flexGrow:0,textAlign:"center"},children:":"}),z.jsx(Fj,{title:null!==(h=null==o?void 0:o.symbol)&&void 0!==h?h:"",value:l,onChange:e=>{u({type:gj.UpdatePeggedQuoteTokenRatio,payload:e})}})]}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,px:19,pt:19,pb:11,borderRadius:16,borderWidth:1,borderColor:b||f?m.palette.border.main:"transparent",borderStyle:"solid",backgroundColor:b||f?m.palette.background.paper:t.alpha(m.palette.warning.main,.1)},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[f?null:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8,color:b?m.palette.text.primary:m.palette.warning.main,typography:"body1",fontWeight:600},children:[b?null:z.jsx(oe.Warn,{}),z.jsx(e.Trans,{id:"x3muNy",message:"Liquidity Burn Ratio"}),": ",v]}),z.jsx(t.Box,{sx:{color:m.palette.text.secondary,typography:"h6",textAlign:"center","&>strong":{color:b?m.palette.text.primary:m.palette.warning.main}},children:f?z.jsx(e.Trans,{id:"pQJBKk",message:"The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{recommendRatioText:C}}):z.jsx(e.Trans,{id:"ZlQ83E",message:"<0>{lostRatio}</0> of the initial liquidity you provide will be burned. <1/>The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{lostRatio:v,recommendRatioText:C},components:{0:z.jsx("strong",{}),1:z.jsx("br",{})}})})]}),f||!b?z.jsx(t.Button,{variant:t.Button.Variant.outlined,fullWidth:!0,size:t.Button.Size.small,onClick:()=>{u({type:gj.UpdatePeggedBaseTokenRatio,payload:null!=x?x:""})},sx:{border:`solid 1px ${m.palette.text.primary}`,color:m.palette.text.primary,"&:hover":{background:t.alpha(m.palette.text.primary,.1)}},children:z.jsx(e.Trans,{id:"NjdGps",message:"Use the recommended ratio"})}):null]})]})};function qj({open:e,onClose:n,afterClose:i,title:o,titleCenter:r,rightSlot:a,canBack:s=!0,children:l,width:d=420,height:c,testId:u}){const p=t.useTheme(),{isMobile:h}=Xa();return z.jsx(t.WidgetModal,{open:e,onClose:n,container:h?document.querySelector(`.${bu}`):void 0,disableEnforceFocus:!0,children:z.jsxs(t.Box,{sx:Object.assign({backgroundColor:"background.paper",display:"flex",height:c,flexDirection:"column",justifyContent:"center",alignItems:"center",outline:0,overflow:"hidden","& > div":{width:"100%"}},h?{width:"100%",borderRadius:p.spacing(16,16,0,0)}:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:d,maxWidth:"95%",minHeight:200,maxHeight:"80%",borderRadius:16}),"data-testid":u,children:[o?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:r?"center":"space-between",p:20,width:"100%",boxSizing:"border-box"},children:[z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:o}),a,!a&&s&&z.jsx(t.Box,{component:oe.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{n&&n(),null==i||i()}})]}):"",l]})})}var Vj;function Wj(){return Wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Wj.apply(null,arguments)}const Hj=e=>P.createElement("svg",Wj({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Vj||(Vj=P.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},P.createElement("path",{id:"\\xE4\\xB8\\x89\\xE8\\xA7\\x92\\xE5\\xBD\\xA2",fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"}))));function Zj({dispatch:i,slippageCoefficient:r,selectedVersion:a,isCustomized:s,isStandardVersion:l}){const d=t.useTheme(),[c,u]=n.useState(!1),[p,h]=n.useState(r),m=function({selectedVersion:e}){const i=t.useTheme();return n.useMemo((()=>{const n=i.palette.background.paperDarkContrast,r=i.palette.text.disabled,a=i.palette.purple.main,s=t.alpha(a,.1);return e===jC.pegged?[{tag:"",description:o.i18n._({id:"PPqGw9",message:"Applicable to pegged assets with a fixed price and no fluctuation"}),value:"0",title:"K=0",tagBackgroundColor:"transparent",tagColor:"transparent"},{tag:o.i18n._({id:"nTWWCZ",message:"Low"}),description:o.i18n._({id:"L4nQwl",message:"Suitable for stablecoins with price fluctuations within 0.5%"}),value:"0.0001",title:"K=0.0001",tagBackgroundColor:s,tagColor:a},{tag:o.i18n._({id:"agPptk",message:"Medium"}),description:o.i18n._({id:"FrP5tr",message:"Suitable for stablecoins with price fluctuations within 2%"}),value:"0.0005",title:"K=0.0005",tagBackgroundColor:n,tagColor:r},{tag:o.i18n._({id:"yx/fMc",message:"High"}),description:o.i18n._({id:"bC0iyq",message:"Suitable for stablecoins with price fluctuations within 10%"}),value:"0.002",title:"K=0.002",tagBackgroundColor:n,tagColor:r}]:[{tag:o.i18n._({id:"agPptk",message:"Medium"}),description:o.i18n._({id:"VXTSOE",message:"Suitable for most situations."}),value:"0.5",title:"K=0.5",tagBackgroundColor:n,tagColor:r},{tag:o.i18n._({id:"nTWWCZ",message:"Low"}),description:o.i18n._({id:"DPi/hO",message:"Results in a relatively fixed price."}),value:"0.01",title:"K=0.01",tagBackgroundColor:n,tagColor:r},{tag:o.i18n._({id:"yx/fMc",message:"High"}),description:o.i18n._({id:"fKYdE9",message:"Results in a more volatile price."}),value:"1",title:"K=1",tagBackgroundColor:s,tagColor:a}]}),[e,i.palette])}({selectedVersion:a}),[x,g]=n.useState(r);x!==r&&(g(r),h(r));const f=n.useMemo((()=>{const e=Rj(p,a);return null!=e?e:""}),[a,p]),y=n.useMemo((()=>!(!p||"0"===p||Number(p))),[p]),v=Boolean(f)||y||s&&!p;return z.jsxs(z.Fragment,{children:[z.jsx(_j,{title:z.jsxs(z.Fragment,{children:[z.jsx(e.Trans,{id:"sjn3tj",message:"Slippage Coefficient"}),z.jsx(t.QuestionTooltip,{title:o.i18n._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:4,sx:{width:14,height:14}})]}),sx:{mt:20},children:z.jsxs(t.Box,{component:t.ButtonBase,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:8,color:d.palette.text.primary,borderRadius:8,backgroundColor:d.palette.background.cardInput,"&:hover":{backgroundColor:d.palette.hover.default},"&[disabled]>svg":{color:d.palette.text.disabled}},disabled:l,onClick:l?void 0:()=>{u(!0)},children:[z.jsx(t.Box,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px"},children:r}),z.jsx(t.Box,{component:Hj,sx:{flexShrink:0,width:18,height:18}})]})}),z.jsx(qj,{open:c,onClose:()=>u(!1),title:z.jsxs(t.Box,{children:[z.jsx(e.Trans,{id:"sjn3tj",message:"Slippage Coefficient"}),z.jsx(t.QuestionTooltip,{title:o.i18n._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:8})]}),children:z.jsxs(t.Box,{sx:{flex:1,overflowY:"auto"},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,p:d.spacing(8,28,28)},children:[m.map((e=>{const t=!s&&p===e.value;return z.jsx(Ij,{title:e.title,description:e.description,onClick:()=>{i({type:gj.UpdateIsSlippageCoefficientCustomized,payload:!1}),h(e.value)},selected:t,subTitle:e.tag?z.jsx(ij,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:d.palette.background.paper,borderColor:t?d.palette.primary.main:d.palette.border.main},titleSx:{typography:"body1"}},e.value)})),z.jsx(t.Box,{sx:{mt:8},children:z.jsx(Aj,{errorMsg:f,isCustomized:s,onClick:()=>{s||h(""),i({type:gj.UpdateIsSlippageCoefficientCustomized,payload:!0})},value:p,onChange:e=>{h(e)}})})]}),z.jsx(t.Box,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:z.jsx(t.Button,{fullWidth:!0,disabled:v,onClick:()=>{i({type:gj.UpdateSlippageCoefficient,payload:p}),u(!1)},children:z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function zj({token:i,oppositeTokenAddress:o,dispatch:r,tokenSelectOnChange:a}){var s;const l=t.useTheme(),{chainId:d,account:u}=Pa(),[p,h]=n.useState(!1),m=c.useQuery(Object.assign({},Hi.getFetchTokenQuery(d,null==i?void 0:i.address,u)));return i?z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{component:t.ButtonBase,sx:{display:"flex",alignItems:"center",px:20,py:8,borderRadius:8,backgroundColor:l.palette.background.cardInput,"&:hover":{backgroundColor:l.palette.hover.default}},onClick:()=>{h(!0)},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{address:i.address,marginRight:0,width:24,height:24,chainId:i.chainId||d,noShowChain:!0,sx:{flexShrink:0}}),z.jsx(t.Box,{sx:{typography:"h5",color:l.palette.text.primary,fontWeight:600,lineHeight:"32px",flexShrink:0},children:i.symbol}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h6",fontWeight:500,color:l.palette.text.secondary,wordBreak:"break-all"},children:["(",z.jsx(e.Trans,{id:"fsBGk0",message:"Balance"}),": ",!i.address||m.isLoading?z.jsx(t.RotatingIcon,{}):ir({input:null===(s=m.data)||void 0===s?void 0:s.balance,decimals:i.decimals}),")"]})]}),z.jsx(t.Box,{component:Hj,sx:{flexShrink:0,ml:"auto",width:18,height:18,color:l.palette.text.secondary}})]}),z.jsx(pp,{value:i,open:p,chainId:d,occupiedAddrs:[o],occupiedChainId:i.chainId,onClose:()=>{h(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return r({type:gj.SwitchTokens}),void h(!1);a(e),h(!1)}},modal:!0})]}):null}const $j=({baseToken:t,quoteToken:n,dispatch:i})=>{var o,r;return z.jsxs(_j,{title:z.jsx(e.Trans,{id:"dmiCGN",message:"Select Token Pair"}),children:[z.jsx(zj,{token:t,oppositeTokenAddress:null!==(o=null==n?void 0:n.address)&&void 0!==o?o:"",dispatch:i,tokenSelectOnChange:e=>{i({type:gj.UpdateBaseToken,payload:e})}}),z.jsx(zj,{token:n,oppositeTokenAddress:null!==(r=null==t?void 0:t.address)&&void 0!==r?r:"",dispatch:i,tokenSelectOnChange:e=>{i({type:gj.UpdateQuoteToken,payload:e})}})]})};function Gj({selectedVersion:e,dispatch:n}){const i=t.useTheme(),{isMobile:o}=Xa(),{versionList:r}=wC(),a="light"===i.palette.mode;return z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:r.map((i=>{const r=e===i.version;return z.jsx(Ij,{title:i.title,description:i.description,onClick:()=>{n({type:gj.SelectNewVersion,payload:i.version})},selected:r,children:o&&r&&z.jsx(t.Box,{component:a?i.exampleImgUrl:i.exampleDarkImgUrl,sx:{mt:28,width:"100%",height:88.1}})},i.version)}))})}function Qj(){const i=t.useTheme(),{defaultBaseToken:r,defaultQuoteToken:a}=hj(),{chainId:l}=Pa(),[d,c]=n.useReducer(vj,{currentStep:0,selectedVersion:jC.standard,baseToken:r,quoteToken:a,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:SC,fixedRatioPrice:AC,leftTokenAddress:null==r?void 0:r.address,feeRate:BC,isFeeRateCustomized:!1,slippageCoefficient:MC,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});!r||d.baseToken&&d.baseToken.chainId===l||c({type:gj.UpdateBaseToken,payload:r}),!a||d.quoteToken&&d.quoteToken.chainId===l||c({type:gj.UpdateQuoteToken,payload:a});const{isMobile:u}=Xa(),{versionMap:p}=wC(),h=p[d.selectedVersion],m=d.selectedVersion===jC.singleToken,x=d.selectedVersion===jC.standard,g=d.selectedVersion===jC.pegged,f=m?d.quoteToken:d.baseToken,y=m?d.baseToken:d.quoteToken,v=bj({isSingleTokenVersion:m,leftTokenAddress:d.leftTokenAddress,baseToken:d.baseToken,quoteToken:d.quoteToken,dispatch:c}),b=new s(d.peggedBaseTokenRatio).div(100).dp(PC,s.ROUND_DOWN),C=new s(d.peggedQuoteTokenRatio).div(100).dp(PC,s.ROUND_DOWN),j=g&&b.lte(0),w=g&&C.lte(0),k=z.jsxs(t.Box,{sx:{px:20},children:[z.jsx(kp,{canClickBalance:!0,showPercentage:!0,amt:m?d.quoteAmount:d.baseAmount,onInputChange:m?void 0:e=>{c({type:m?gj.UpdateQuoteAmount:gj.UpdateBaseAmount,payload:e})},readOnly:m||j,sx:{backgroundColor:"background.cardInput",padding:i.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"},inputReadonlyTooltip:j?o.i18n._({id:"t3d3/V",message:"ratio is 0"}):void 0,token:f,occupiedAddrs:y?[y.address]:void 0,occupiedChainId:l,chainId:l,onTokenChange:g?void 0:(e,t)=>{c(t?{type:gj.SwitchTokens}:{type:m?gj.UpdateQuoteToken:gj.UpdateBaseToken,payload:e})}}),z.jsx(jp,{}),z.jsx(kp,{canClickBalance:!0,showPercentage:!0,amt:m?d.baseAmount:d.quoteAmount,onInputChange:e=>{c({type:m?gj.UpdateBaseAmount:gj.UpdateQuoteAmount,payload:e})},readOnly:x&&d.isFixedRatio&&!!d.fixedRatioPrice||w,sx:{backgroundColor:"background.cardInput",padding:i.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"},inputReadonlyTooltip:w?o.i18n._({id:"t3d3/V",message:"ratio is 0"}):o.i18n._({id:"5QDjef",message:"The token amount is calculated by initial price."}),token:y,occupiedAddrs:f?[f.address]:void 0,occupiedChainId:l,chainId:l,onTokenChange:(e,t)=>{c(t?{type:gj.SwitchTokens}:{type:m?gj.UpdateBaseToken:gj.UpdateQuoteToken,payload:e})}})]});return z.jsx(cm,{children:z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"flex-start",height:"100%"},u?{}:{height:"auto",overflowX:"auto"}),children:[u?null:z.jsxs(t.Box,{sx:{mr:12,flexGrow:1,display:"block",overflow:"hidden"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:20},children:[z.jsx(av,{}),z.jsx(t.Box,{sx:{typography:"caption",fontWeight:600,color:"text.primary",mr:"auto"},children:z.jsx(e.Trans,{id:"pHQq+U",message:"Pool Setup"})}),z.jsx(vg,{poolType:"PMM"})]}),z.jsx(dj,{titleKey:o.i18n._({id:"hdIg7i",message:"Select Pool Version"}),index:1,status:0===d.currentStep?"running":"completed"}),z.jsx(uj,{versionItem:h,status:0===d.currentStep?"running":"completed"},h.version),z.jsx(dj,{titleKey:o.i18n._({id:"lsg9Mi",message:"Parameter Settings"}),index:2,status:0===d.currentStep?"waiting":1===d.currentStep?"running":"completed"}),g?z.jsx(UC,{status:0===d.currentStep?"waiting":1===d.currentStep?"running":"completed",baseToken:d.baseToken,quoteToken:d.quoteToken,initPrice:d.initPrice,slippageCoefficient:d.slippageCoefficient,selectedVersion:d.selectedVersion,midPrice:void 0}):z.jsx(sj,{status:0===d.currentStep?"waiting":1===d.currentStep?"running":"completed",baseToken:d.baseToken,quoteToken:d.quoteToken,initPrice:d.initPrice,slippageCoefficient:d.slippageCoefficient,selectedVersion:d.selectedVersion,baseAmount:d.baseAmount,quoteAmount:d.quoteAmount}),g&&z.jsxs(z.Fragment,{children:[z.jsx(dj,{titleKey:o.i18n._({id:"6lss/t",message:"Pricing Model"}),index:3,status:d.currentStep>2?"completed":2===d.currentStep?"running":"waiting"}),z.jsx(lj,{isWaiting:d.currentStep<2,selectedSubPeggedVersion:d.selectedSubPeggedVersion})]}),g?z.jsxs(z.Fragment,{children:[z.jsx(dj,{titleKey:o.i18n._({id:"Y7rVy0",message:"Fee Rate"}),index:4,status:d.currentStep>3?"completed":3===d.currentStep?"running":"waiting"}),z.jsx(oj,{isWaiting:d.currentStep<3,feeRate:d.feeRate})]}):z.jsxs(z.Fragment,{children:[z.jsx(dj,{titleKey:o.i18n._({id:"Y7rVy0",message:"Fee Rate"}),index:3,status:2===d.currentStep?"running":"waiting"}),z.jsx(oj,{isWaiting:d.currentStep<2,feeRate:d.feeRate})]}),g&&z.jsxs(z.Fragment,{children:[z.jsx(dj,{titleKey:o.i18n._({id:"3ggd2j",message:"Asset ratio within the pool"}),index:5,status:d.currentStep>4?"completed":4===d.currentStep?"running":"waiting"}),z.jsx(rj,{isWaiting:d.currentStep<4,baseToken:d.baseToken,quoteToken:d.quoteToken,initPrice:d.initPrice,slippageCoefficient:d.slippageCoefficient,selectedVersion:d.selectedVersion,baseAmount:d.baseAmount,quoteAmount:d.quoteAmount,peggedBaseTokenRatio:d.peggedBaseTokenRatio,peggedQuoteTokenRatio:d.peggedQuoteTokenRatio})]})]}),z.jsxs(t.Box,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,borderRadius:0,backgroundColor:"background.paper",minHeight:"100%"},u?{}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto",height:"100%",position:"sticky",top:"0px",overflowY:"hidden"}),children:[z.jsx(cj,{currentStep:d.currentStep,isPeggedVersion:g}),0===d.currentStep&&z.jsx(Gj,{selectedVersion:d.selectedVersion,dispatch:c}),1===d.currentStep&&z.jsxs(z.Fragment,{children:[g?z.jsx(z.Fragment,{children:z.jsx($j,{baseToken:d.baseToken,quoteToken:d.quoteToken,dispatch:c})}):z.jsxs(z.Fragment,{children:[z.jsx(nj,{baseToken:d.baseToken,quoteToken:d.quoteToken,initPrice:d.initPrice,slippageCoefficient:d.slippageCoefficient,selectedVersion:d.selectedVersion,baseAmount:d.baseAmount,quoteAmount:d.quoteAmount}),k]}),z.jsx(Zj,{dispatch:c,slippageCoefficient:d.slippageCoefficient,selectedVersion:d.selectedVersion,isCustomized:d.isSlippageCoefficientCustomized,isStandardVersion:x}),z.jsx(Dj,{selectedVersion:d.selectedVersion,isFixedRatio:d.isFixedRatio,leftTokenAddress:d.leftTokenAddress,baseToken:d.baseToken,quoteToken:d.quoteToken,fixedRatioPrice:d.fixedRatioPrice,dispatch:c,isStandardVersion:x,isSingleTokenVersion:m,priceInfo:v})]}),g&&2===d.currentStep&&z.jsx(Nj,{selectedVersion:d.selectedVersion,selectedSubPeggedVersion:d.selectedSubPeggedVersion,baseToken:d.baseToken,quoteToken:d.quoteToken,initPrice:d.initPrice,dispatch:c}),d.currentStep===(g?3:2)&&z.jsx(Oj,{dispatch:c,feeRate:d.feeRate,isFeeRateCustomized:d.isFeeRateCustomized}),g&&4===d.currentStep&&z.jsxs(z.Fragment,{children:[z.jsx(nj,{baseToken:d.baseToken,quoteToken:d.quoteToken,initPrice:d.initPrice,slippageCoefficient:d.slippageCoefficient,selectedVersion:d.selectedVersion,baseAmount:d.baseAmount,quoteAmount:d.quoteAmount}),z.jsx(Uj,{dispatch:c,baseToken:d.baseToken,quoteToken:d.quoteToken,peggedBaseTokenRatio:d.peggedBaseTokenRatio,peggedQuoteTokenRatio:d.peggedQuoteTokenRatio,initPrice:d.initPrice,baseAmount:d.baseAmount,quoteAmount:d.quoteAmount}),z.jsx(_j,{title:z.jsx(e.Trans,{id:"E4LM3N",message:"Add Initial Liquidity"}),sx:{mt:20},children:z.jsx(t.Box,{sx:{mx:-20},children:k})})]}),z.jsx(t.Box,{sx:Object.assign({pb:160},u?{}:{pb:28})}),z.jsx(Bj,{state:d,dispatch:c,isPeggedVersion:g,isStandardVersion:x,isSingleTokenVersion:m,fiatPriceLoading:v.fiatPriceLoading})]})]})})}function Yj({open:n,onClose:i,title:o,children:r,singleBtn:a,danger:s,singleBtnText:l,cancelText:d,confirmText:c,disabledConfirm:u,confirmLoading:p,isManualClose:h,onConfirm:m}){const x=qj;return z.jsx(x,{open:n,onClose:i,title:z.jsx(t.Box,{sx:{textAlign:"center"},children:o}),canBack:!1,titleCenter:!0,children:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,width:"100%"},children:[z.jsx(t.Box,{sx:{typography:"body2",color:o?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:r}),a?z.jsx(t.Box,{sx:{px:20},children:z.jsx(t.Button,{fullWidth:!0,variant:t.Button.Variant.outlined,danger:s,sx:{mt:32,mb:20},onClick:()=>{i()},children:l||z.jsx(e.Trans,{id:"DPfwMq",message:"Done"})})}):z.jsxs(t.Box,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[z.jsx(t.Button,{variant:t.Button.Variant.second,onClick:()=>{i()},children:d||z.jsx(e.Trans,{id:"dEgA5A",message:"Cancel"})}),z.jsx(t.Button,{sx:{ml:8},variant:t.Button.Variant.outlined,danger:s,disabled:u,isLoading:p,onClick:()=>{m&&m(),h||i()},children:c||z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})})]})]})})}function Xj({sx:n,onClick:o}){const r=t.useTheme();return z.jsxs(t.HoverOpacity,{onClick:()=>{o?o():pm.getState().back()},sx:i.merge({display:"inline-flex",alignItems:"center",cursor:"pointer","& > svg":{mr:10}},n),children:[z.jsx(t.Box,{sx:{color:r.palette.text.secondary,width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",borderColor:r.palette.border.main,borderStyle:"solid",borderWidth:1,borderRadius:"50%",backgroundColor:r.palette.background.paper,mr:6},children:z.jsx(oe.ArrowBack,{})}),z.jsx(e.Trans,{id:"CKyk7Q",message:"Go back"})]})}function Kj({open:i,onClose:r,alertContent:a,onConfirm:s}){const l=t.useTheme(),[d,c]=n.useState(!1),u=o.i18n._({id:"LQU+Dm",message:"Risk Disclaimer"});return z.jsx(qj,{open:i,onClose:r,title:u,canBack:!1,titleCenter:!0,children:z.jsxs(t.Box,{sx:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[z.jsx(t.Box,{sx:{mb:20,mx:20,maxHeight:275,overflowY:"auto",borderWidth:1,borderRadius:10,borderStyle:"solid",borderColor:"border.main",p:l.spacing(20),typography:"body2",backgroundColor:l.palette.background.input,color:l.palette.text.primary,textAlign:"left"},children:a}),z.jsxs(t.Box,{sx:{padding:20,pt:12,backgroundColor:l.palette.background.paperContrast},children:[z.jsxs(t.Box,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary",textAlign:"left","& a":{fontWeight:600,color:"primary.main","&:hover":{textDecoration:"underline"}}},children:[z.jsx(t.Checkbox,{sx:{top:-1},checked:d,onChange:e=>{const{checked:t}=e.target;c(t)}}),z.jsx(t.Box,{children:z.jsx(e.Trans,{id:"dqWPbT",message:"I have read, understand, and agree to the <0>Terms of Service</0>.",components:{0:z.jsx("a",{href:"https://docs.dodoex.io/home/terms-of-service",target:"_blank",rel:"noopener noreferrer"})}})})]}),z.jsx(t.Box,{sx:{mt:12,display:"flex",alignItems:"center"},children:z.jsx(t.Button,{sx:{},disabled:!d,fullWidth:!0,onClick:()=>{c(!1),null==s||s()},children:z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})})})]})]})})}function Jj({id:e,chainId:t}){var n,i,o,a,l,d,u,p,h,m,x,g,f;const y=t?Si[t]:"",v=qa().getQuery(r.PoolApi.graphql.fetchPool,{id:e||"",where:{refreshNow:!1,chain:y},liquidityWhere:{chain:y,refreshNow:!1,filterState:{address:e}}}),b=c.useQuery(Object.assign(Object.assign({},v),{enabled:!!e})),{pair:C,liquidity_list:j}=null!==(n=b.data)&&void 0!==n?n:{},w=null===(o=null===(i=null==j?void 0:j.lqList)||void 0===i?void 0:i[0])||void 0===o?void 0:o.pair;return Object.assign(Object.assign({},b),{poolDetail:C&&t?Object.assign(Object.assign({},C),{address:C.id,type:C.type,chainId:t,baseToken:ba(C.baseToken,t),quoteToken:ba(C.quoteToken,t),miningAddress:null!==(l=null===(a=null==w?void 0:w.miningAddress)||void 0===a?void 0:a[0])&&void 0!==l?l:"",apy:null==w?void 0:w.apy,baseApy:(null==w?void 0:w.apy)?fr(new s(null!==(d=w.apy.transactionBaseApy)&&void 0!==d?d:0).plus(null!==(u=w.apy.miningBaseApy)&&void 0!==u?u:0)):void 0,quoteApy:Number(null===(p=null==w?void 0:w.apy)||void 0===p?void 0:p.transactionQuoteApy)||Number(null===(h=null==w?void 0:w.apy)||void 0===h?void 0:h.miningQuoteApy)?fr(new s(null!==(x=null===(m=null==w?void 0:w.apy)||void 0===m?void 0:m.transactionQuoteApy)&&void 0!==x?x:0).plus(null!==(f=null===(g=null==w?void 0:w.apy)||void 0===g?void 0:g.miningQuoteApy)&&void 0!==f?f:0)):void 0,isCpPool:!1,cpAddress:void 0,cpLiquidator:void 0,cpCreator:void 0,cpCreatedAtTimestamp:void 0}):null})}function ew({disabled:n,chainId:i,baseStatus:o,quoteStatus:r,onClick:a}){const{account:s}=Pa();return s?o.needShowTokenStatusButton||r.needShowTokenStatusButton?z.jsx(Nf,{status:o.needShowTokenStatusButton?o:r,buttonProps:{variant:t.Button.Variant.contained,fullWidth:!0}}):z.jsx(t.Button,{variant:t.Button.Variant.contained,fullWidth:!0,disabled:n,onClick:()=>a(),children:z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})}):z.jsx(Im,{chainId:i,variant:t.Button.Variant.contained,fullWidth:!0,includeButton:!0})}function tw({state:i,pool:r,loading:a}){var l,d;const{baseToken:u,quoteToken:p,baseAmount:h,quoteAmount:m,initPrice:x,slippageCoefficient:g,feeRate:f}=i,y=c.useQuery(ya.getPMMStateQuery(null==r?void 0:r.chainId,null==r?void 0:r.address,null==r?void 0:r.type,null===(l=null==r?void 0:r.baseToken)||void 0===l?void 0:l.decimals,null===(d=null==r?void 0:r.quoteToken)||void 0===d?void 0:d.decimals)),v=t.useTheme(),{isMobile:b}=Xa(),{account:C}=Pa(),j=pm(),[w,k]=n.useState(!1),T=y.data&&h?new s(h).minus(y.data.baseReserve):void 0,B=y.data&&m?new s(m).minus(y.data.quoteReserve):void 0,E=null==T?void 0:T.lt(0),I=Ms(u,{amount:T}),A=Ms(p,{amount:B});let S=!r||a||!h||Number(h)<0||!m||Number(m)<0;if(!S&&p){const e=new s(x),t=Math.min(p.decimals,16);(!x||e.isNaN()||e.lt(`1e-${t}`)||e.gt(LC))&&(S=!0);const n=new s(g);(!g||n.isNaN()||n.lt(0)||n.gt(MC))&&(S=!0);const i=new s(f);(!f||i.isNaN()||i.lt(0)||i.gt(IC))&&(S=!0)}const{modifyDPPMutation:L}=oy({pool:r||void 0});return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:Object.assign(Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:v.palette.background.paperContrast,px:20,py:20},b?{}:{position:"static",backgroundColor:"transparent",py:0}),{display:"flex",alignItems:"center",gap:8}),children:[b&&!!C&&z.jsx(t.Button,{variant:t.Button.Variant.second,fullWidth:!0,onClick:()=>{j.back()},children:z.jsx(e.Trans,{id:"dEgA5A",message:"Cancel"})}),z.jsx(ew,{disabled:S,chainId:null==r?void 0:r.chainId,baseStatus:I,quoteStatus:A,onClick:()=>k(!0)})]}),z.jsx(jj,{on:w,onClose:()=>k(!1),state:i,isModify:!0,loading:L.isPending,onConfirm:()=>{var e,t;L.mutate({txTitle:o.i18n._({id:"KRnA5J",message:"Set pool parameters"}),baseAmount:null!==(e=null==T?void 0:T.toString())&&void 0!==e?e:"",quoteAmount:null!==(t=null==B?void 0:B.toString())&&void 0!==t?t:"",isRemove:E,feeRate:i.feeRate,initPrice:i.initPrice,slippageCoefficient:i.slippageCoefficient,submittedBack:()=>{k(!1),j.push({type:exports.PageType.Pool,params:{tab:Qy.myCreated}})}})}})]})}function nw({dispatch:i,feeRate:r,isCustomized:a}){const s=t.useTheme(),[l,d]=n.useState(!1),[c,u]=n.useState(r),p=Lj();!c&&r&&u(r);const h=Mj(c),m=!(!c||"0"===c||Number(c)),x=Boolean(h)||m||a&&!c;return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:20,px:20},children:[z.jsxs(t.Box,{sx:{fontWeight:500,display:"flex",alignItems:"center"},children:[z.jsx(e.Trans,{id:"Y7rVy0",message:"Fee Rate"}),z.jsx(t.QuestionTooltip,{title:o.i18n._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8,size:16})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",ml:12},children:[r,"%",z.jsx(t.Button,{variant:t.Button.Variant.tag,sx:{ml:12,fontSize:12},onClick:()=>d(!0),children:z.jsx(e.Trans,{id:"ePK91l",message:"Edit"})})]})]}),z.jsx(qj,{open:l,onClose:()=>d(!1),title:z.jsxs(t.Box,{children:[z.jsx(e.Trans,{id:"Y7rVy0",message:"Fee Rate"}),z.jsx(t.QuestionTooltip,{title:o.i18n._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8})]}),children:z.jsxs(t.Box,{sx:{flex:1,overflowY:"auto"},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,p:s.spacing(8,28,28)},children:[p.map((e=>{const t=!a&&c===e.value;return z.jsx(Ij,{title:e.title,description:e.description,onClick:()=>{i({type:gj.UpdateIsFeeRateCustomized,payload:!1}),u(e.value)},selected:t,subTitle:e.tag?z.jsx(ij,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:s.palette.background.paper,borderColor:t?s.palette.primary.main:s.palette.border.main}},e.value)})),z.jsx(t.Box,{sx:{mt:8},children:z.jsx(Aj,{errorMsg:h,isCustomized:a,onClick:()=>{a||u(""),i({type:gj.UpdateIsFeeRateCustomized,payload:!0})},value:c,onChange:e=>{u(e)}})})]}),z.jsx(t.Box,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:z.jsx(t.Button,{fullWidth:!0,disabled:x,onClick:()=>{i({type:gj.UpdateFeeRate,payload:c}),d(!1)},children:z.jsx(e.Trans,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function iw({titleKey:e}){const n=t.useTheme();return z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{sx:{mt:28,mb:28,borderTopColor:"divider",borderTopStyle:"solid",borderTopWidth:1}}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",mb:20},children:z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:n.palette.text.primary},children:e})})]})}function ow({params:i}){var r,a,s,l;const d=t.useTheme(),{isMobile:u}=Xa(),{chainId:p}=Pa(),[h,m]=n.useState(!1),[x,g]=n.useReducer(vj,{currentStep:0,selectedVersion:jC.marketMakerPool,baseToken:null,quoteToken:null,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:AC,fixedRatioPrice:AC,leftTokenAddress:void 0,feeRate:BC,isFeeRateCustomized:!1,slippageCoefficient:MC,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});n.useEffect((()=>{m(!window.localStorage.getItem(Uo.PoolEditPage))}),[]);const[f,y]=n.useState("inital"),v=Jj({id:null==i?void 0:i.address,chainId:null==i?void 0:i.chainId}),{poolDetail:b}=v,C=D(v,["poolDetail"]);C.isPending||C.error||b||"inital"!==f||y("open"),!x.baseToken&&(null==b?void 0:b.baseToken)&&g({type:gj.InitEditParameters,payload:b});const j=c.useQuery(ya.getPMMStateQuery(null==b?void 0:b.chainId,null==b?void 0:b.address,null==b?void 0:b.type,null===(r=null==b?void 0:b.baseToken)||void 0===r?void 0:r.decimals,null===(a=null==b?void 0:b.quoteToken)||void 0===a?void 0:a.decimals));if(!x.slippageCoefficient&&(null===(l=null===(s=j.data)||void 0===s?void 0:s.pmmParamsBG)||void 0===l?void 0:l.k)){const e=j.data.pmmParamsBG.k.toString(),t=!xj({selectedVersion:x.selectedVersion}).includes(e);g({type:gj.UpdateSlippageCoefficient,payload:e}),g({type:gj.UpdateIsSlippageCoefficientCustomized,payload:t})}!x.baseAmount&&j.data&&(g({type:gj.UpdateBaseAmount,payload:j.data.baseReserve.toString()}),g({type:gj.UpdateQuoteAmount,payload:j.data.quoteReserve.toString()})),!x.fixedRatioPrice&&j.data&&g({type:gj.UpdateFixedRatioPrice,payload:j.data.pmmParamsBG.i.toString()});const w=c.useQuery(ya.getLPFeeRateQuery(null==b?void 0:b.chainId,null==b?void 0:b.address,null==b?void 0:b.type));if(!x.feeRate&&w.data){const e=w.data.times(100).toString(),t=-1===Sj().findIndex((t=>t.value===e));g({type:gj.UpdateFeeRate,payload:e}),g({type:gj.UpdateIsFeeRateCustomized,payload:t})}const k=x.selectedVersion===jC.singleToken,T=x.selectedVersion===jC.standard,B=bj({isSingleTokenVersion:k,leftTokenAddress:x.leftTokenAddress,baseToken:x.baseToken,quoteToken:x.quoteToken,dispatch:g}),{versionMap:E}=wC(),I=E[x.selectedVersion],A=!(null==b?void 0:b.baseToken),S=z.jsx(t.Skeleton,{variant:"rounded",width:210,height:60,sx:{padding:16,borderRadius:8}}),L=z.jsx(t.Skeleton,{variant:"rounded",height:167,sx:{mx:20,borderRadius:16}});return z.jsxs(z.Fragment,{children:[z.jsx(cm,{children:z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"flex-start"},u?{height:"100%"}:{height:"auto"}),children:[u?null:z.jsxs(t.Box,{sx:{mr:12,flexGrow:1,display:"block"},children:[z.jsx(Xj,{}),z.jsx(t.Box,{sx:{mt:28,typography:"h5",fontWeight:600,color:"text.primary"},children:z.jsx(e.Trans,{id:"pHQq+U",message:"Pool Setup"})}),z.jsx(iw,{titleKey:o.i18n._({id:"hdIg7i",message:"Select Pool Version"})}),z.jsx(uj,{versionItem:I,status:"completed"},I.version),z.jsx(iw,{titleKey:o.i18n._({id:"lsg9Mi",message:"Parameter Settings"})}),A?S:z.jsx(sj,{status:"running",baseToken:x.baseToken,quoteToken:x.quoteToken,initPrice:x.initPrice,slippageCoefficient:x.slippageCoefficient,selectedVersion:x.selectedVersion,baseAmount:x.baseAmount,quoteAmount:x.quoteAmount}),z.jsx(iw,{titleKey:o.i18n._({id:"Y7rVy0",message:"Fee Rate"})}),A?S:z.jsx(oj,{isWaiting:!1,feeRate:x.feeRate})]}),z.jsxs(t.Box,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,backgroundColor:"background.paper"},u?{width:"100%",borderRadius:0,minHeight:"100%"}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto"}),children:[z.jsx(t.Box,{sx:Object.assign({top:0,py:20,px:20,backgroundColor:d.palette.background.paper,zIndex:1},u?{position:"sticky"}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:z.jsx(t.Box,{sx:{typography:"h5",color:d.palette.text.primary,fontWeight:600},children:z.jsx(e.Trans,{id:"6XYkjc",message:"Edit Parameter Settings"})})})}),A?null:z.jsx(nj,{baseToken:x.baseToken,quoteToken:x.quoteToken,initPrice:x.initPrice,slippageCoefficient:x.slippageCoefficient,selectedVersion:x.selectedVersion,baseAmount:x.baseAmount,quoteAmount:x.quoteAmount}),A?L:z.jsxs(t.Box,{sx:{px:20},children:[z.jsx(kp,{canClickBalance:!0,showPercentage:!0,amt:x.baseAmount,onInputChange:e=>{g({type:gj.UpdateBaseAmount,payload:e})},readOnly:k,token:x.baseToken,occupiedAddrs:x.quoteToken?[x.quoteToken.address]:void 0,occupiedChainId:p,chainId:p}),z.jsx(wp,{}),z.jsx(kp,{canClickBalance:!0,showPercentage:!0,amt:x.quoteAmount,onInputChange:e=>{g({type:gj.UpdateQuoteAmount,payload:e})},token:x.quoteToken,occupiedAddrs:x.baseToken?[x.baseToken.address]:void 0,occupiedChainId:p,chainId:p})]}),A?null:z.jsxs(z.Fragment,{children:[x.selectedVersion!==jC.standard&&z.jsx(Zj,{dispatch:g,slippageCoefficient:x.slippageCoefficient,selectedVersion:x.selectedVersion,isCustomized:x.isSlippageCoefficientCustomized,isStandardVersion:T}),z.jsx(Dj,{selectedVersion:x.selectedVersion,isFixedRatio:x.isFixedRatio,leftTokenAddress:x.leftTokenAddress,baseToken:x.baseToken,quoteToken:x.quoteToken,fixedRatioPrice:x.fixedRatioPrice,dispatch:g,isStandardVersion:T,isSingleTokenVersion:k,priceInfo:B}),z.jsx(nw,{dispatch:g,feeRate:x.feeRate,isCustomized:x.isFeeRateCustomized})]}),z.jsx(t.Box,{sx:{pb:160,[d.breakpoints.up("tablet")]:{pb:28}}}),z.jsx(tw,{state:x,pool:b,loading:A})]})]})}),z.jsx(Yj,{singleBtn:!0,open:"open"===f,onClose:()=>y("close"),onConfirm:()=>y("close"),title:o.i18n._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),z.jsx(Kj,{open:h,onClose:()=>{m(!1)},onConfirm:()=>{window.localStorage.setItem(Uo.PoolEditPage,"1"),m(!1)},alertContent:z.jsx(e.Trans,{id:"Y9QDtD",message:"You are making changes to the liquidity of a private pool. This is a highly discretionary operation that may cause substantial inflows/outflows of funds and changes in market prices. Please make sure you are fully aware of the implications of each parameter modification."})})]})}function rw(e){return null==e?0:new s(e).dp(4,s.ROUND_DOWN).toNumber()}function aw({unit:i,data:o,masterKey:r,sumKey:a}){const l=t.useTheme(),d=n.useRef(null),[c,u]=n.useState(null),[p,h]=n.useState(0);n.useEffect((()=>{const e=()=>{d&&d.current&&h(d.current.offsetWidth)};return setTimeout(e,100),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[d]);const m="light"===l.palette.mode?t.alpha(l.palette.success.main,.6):l.palette.primary.main,x="#ff9553",g=o[o.length-2],f="date";let y=[];if(null==o?void 0:o.length){let e=o[0][r];o.forEach((t=>{t[r]>e&&(e=t[r])})),y=e?[0,Math.ceil(e/3),Math.ceil(e/3*2),e]:[0]}let v=0;y.forEach((e=>{const t=mr(new s(e));let n=t.replace(".","").length;t.indexOf(".")>-1&&(n+=.11),n>v&&(v=n)}));const b=10*v+2;return z.jsxs(t.Box,{ref:d,sx:{position:"relative"},children:[z.jsxs(t.Box,{sx:{minHeight:62,mb:10},children:[z.jsxs(t.Box,{sx:{typography:"caption",mb:8},children:[i||z.jsx("span",{children:" "}),nr({input:null==g?void 0:g[a]})]}),z.jsx(t.Box,{sx:{color:"text.secondary"},children:j(null==g?void 0:g[f]).format("LL")})]}),z.jsxs(T.BarChart,{width:p,height:364,data:o,margin:{top:5,right:10,left:0,bottom:5},children:[z.jsx("defs",{children:o.map(((e,n)=>z.jsxs("linearGradient",{id:`colorBar${e.date}`,x1:"0",x2:"0",y1:"0",y2:"1",children:[z.jsx("stop",{offset:"0%",stopColor:n===o.length-1?x:m}),z.jsx("stop",{offset:"100%",stopColor:t.alpha(n===o.length-1?x:m,.04)})]},e.date)))}),z.jsx(T.XAxis,{hide:!0,dataKey:f,axisLine:!1,tickFormatter:e=>j(e).format("MM-DD")}),z.jsx(T.YAxis,{orientation:"right",axisLine:!1,ticks:y,width:b,tickFormatter:e=>mr(new s(e))}),z.jsx(T.Tooltip,{isAnimationActive:!1,content:({active:n,payload:i,label:o})=>{if(!(n&&i&&i.length))return null;const r=j(o).format("YYYY-MM-DD")===j().format("YYYY-MM-DD");return z.jsxs(t.Box,{sx:{px:10,py:12,maxWidth:240,borderRadius:8,backgroundColor:"background.paperContrast",typography:"h6",color:"text.secondary"},children:[z.jsx(t.Box,{sx:{mr:8},children:j(o).format("MM-DD HH:mm")}),z.jsx(t.Box,{children:i[0].value}),r?z.jsx(t.Box,{children:z.jsx(e.Trans,{id:"ubzjDN",message:"Real Time"})}):""]})},cursor:!1,coordinate:{x:0,y:0}}),z.jsx(T.Bar,{dataKey:r,onMouseMove:e=>{u(e[f])},onMouseLeave:()=>{u(null)},children:o.map((e=>z.jsx(T.Cell,{fill:`url(#colorBar${e.date})`},e.date)))}),c&&z.jsx(T.ReferenceLine,{x:c,stroke:m,strokeDasharray:"3 3"})]})]})}var sw,lw;function dw({poolDetail:e,chart24hDataFirst:i}){var a,l,d,u,p,h,m,x;const g=t.useTheme(),[f,y]=n.useState(i?sw.volume:sw.depth),v={key:sw.depth,value:o.i18n._({id:"n25Lml",message:"Depth"})},b=[{key:sw.volume,value:o.i18n._({id:"/cF7Rs",message:"Volume"})},{key:sw.feeRevenue,value:o.i18n._({id:"9QjAGB",message:"FeeRevenue"})},{key:sw.traders,value:o.i18n._({id:"qDhDFK",message:"Traders"})}];i?b.push(v):b.splice(0,0,v);const C=function({address:e,chainId:t,day:n}){var i,o,a;const l=t?Si[t]:"",d=qa().getQuery(r.PoolApi.graphql.fetchPoolDayData,{where:{pair_address:null!=e?e:"",chain:l,day:n}}),u=c.useQuery(Object.assign(Object.assign({},d),{enabled:!!e&&!!t})),p=null!==(a=null===(o=null===(i=u.data)||void 0===i?void 0:i.dashboard_pairs_day_data)||void 0===o?void 0:o.map((e=>{var t,n;return{volume:rw(null==e?void 0:e.volumeUsd),fee:rw(new s(null!==(t=null==e?void 0:e.feeUsd)&&void 0!==t?t:0).plus(null!==(n=null==e?void 0:e.mtFeeUsd)&&void 0!==n?n:0).toString()),traders:(null==e?void 0:e.addresses)?Number(e.addresses):0,date:(null==e?void 0:e.timestamp)?1e3*(null==e?void 0:e.timestamp):0,tvl:rw(null==e?void 0:e.tvlUsd)}})))&&void 0!==a?a:[];return Object.assign(Object.assign({},u),{dayDataList:p})}({chainId:null==e?void 0:e.chainId,address:null==e?void 0:e.address,day:30}),j=c.useQuery(ya.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(a=null==e?void 0:e.baseToken)||void 0===a?void 0:a.decimals,null===(l=null==e?void 0:e.quoteToken)||void 0===l?void 0:l.decimals)),{pmmParamsBG:w}=null!==(d=j.data)&&void 0!==d?d:{},k=w?{i:w.i.toNumber(),k:w.k.toNumber(),b:w.b.toNumber(),b0:w.b0.toNumber(),q:w.q.toNumber(),q0:w.k.isEqualTo(0)?w.q.toNumber():w.q0.toNumber(),R:w.k.isEqualTo(0)?0:w.R}:void 0,T=k?r.getPmmModel(k):void 0,[B,E]=n.useState(!1),I=B&&(null===(u=j.data)||void 0===u?void 0:u.midPrice)?new s(1).div(null===(p=j.data)||void 0===p?void 0:p.midPrice):null===(h=j.data)||void 0===h?void 0:h.midPrice;return z.jsx(t.Box,{sx:{mt:24,[g.breakpoints.up("tablet")]:{mt:20,pt:28,borderTop:`1px solid ${g.palette.border.main}`}},children:z.jsxs(t.Tabs,{value:f,onChange:(e,t)=>y(t),children:[z.jsx(t.TabsGroup,{tabs:b,variant:"rounded",tabsListSx:{borderWidth:0,gap:4,mb:24}}),f===sw.depth&&(null==e?void 0:e.baseToken)&&(null==e?void 0:e.quoteToken)?z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:z.jsx(cw,{baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,midPrice:I,isSwitchMidPrice:B,setIsSwitchMidPrice:E,showMidPrice:f===sw.depth})}):"",z.jsx(t.TabPanel,{value:sw.depth,children:z.jsx(ej,{baseToken:null!==(m=null==e?void 0:e.baseToken)&&void 0!==m?m:null,quoteToken:null!==(x=null==e?void 0:e.quoteToken)&&void 0!==x?x:null,pmmParams:k,pmmModel:T,midPrice:I})}),z.jsx(t.TabPanel,{value:sw.volume,children:z.jsx(aw,{data:C.dayDataList,masterKey:"volume",sumKey:"volume",unit:"$"})}),z.jsx(t.TabPanel,{value:sw.feeRevenue,children:z.jsx(aw,{data:C.dayDataList,masterKey:"fee",sumKey:"fee",unit:"$"})}),z.jsx(t.TabPanel,{value:sw.traders,children:z.jsx(aw,{data:C.dayDataList,masterKey:"traders",sumKey:"traders",unit:""})})]})})}function cw({baseToken:e,quoteToken:n,midPrice:i,isSwitchMidPrice:o,setIsSwitchMidPrice:r,showMidPrice:a}){const s=null==e?void 0:e.symbol,l=null==n?void 0:n.symbol,d=o?l:s,c=o?s:l;return z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:a?z.jsxs(t.Box,{sx:{mt:4,typography:"body2",color:"text.secondary",wordBreak:"break-all",display:"flex"},children:[`1 ${d} = ${i?nr({input:i,showDecimals:16}):"-"} ${c}`,z.jsx(t.HoverOpacity,{weak:!0,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,position:"relative",top:1.5,ml:9,cursor:"pointer",borderRadius:"50%",backgroundColor:"background.paperDarkContrast",p:0},onClick:()=>r((e=>!e)),children:z.jsx(t.Box,{component:oe.Switch})})]}):""})}function uw({poolDetail:i}){var o,a,l;const{isMobile:d}=Xa(),u=t.useTheme(),p=null==i?void 0:i.chainId;null===(l=c.useQuery(ya.getPMMStateQuery(null==i?void 0:i.chainId,null==i?void 0:i.address,null==i?void 0:i.type,null===(o=null==i?void 0:i.baseToken)||void 0===o?void 0:o.decimals,null===(a=null==i?void 0:i.quoteToken)||void 0===a?void 0:a.decimals)).data)||void 0===l||l.midPrice;const h=function({pool:e}){var t,n,i,o,a,l,d;const{chainId:u,address:p,type:h,baseToken:m,quoteToken:x}=e||{},g=null!=p?p:"",f=u?Si[u]:"",y=null==m?void 0:m.decimals,v=null==x?void 0:x.decimals,b=c.useQuery(ya.getPMMStateQuery(u,p,h,null==m?void 0:m.decimals,null==x?void 0:x.decimals)),C=null===(t=b.data)||void 0===t?void 0:t.midPrice,j=c.useQuery(ya.getTotalBaseLpQuery(u,p,h,y)),w=c.useQuery(ya.getTotalQuoteLpQuery(u,p,h,v)),k=c.useQuery(ya.getReserveLpQuery(u,p,h,y,v)),T=c.useQuery(ya.getClassicalTargetQuery(u,p,h,y,v)),B=j.data;let E=w.data;E||w.isLoading||w.error||!B||(E=B);const{baseReserve:I,quoteReserve:A}=k.data||{},S=null===(n=T.data)||void 0===n?void 0:n.baseTarget,L=null===(i=T.data)||void 0===i?void 0:i.quoteTarget,M=mj({tokens:x?[x]:[]}),R=qa(),O=c.useQuery(Object.assign(Object.assign({},R.getQuery(r.PoolApi.graphql.fetchLiquidityPositions,{id:g,where:{pair:g,liquidityTokenBalance_not:"0",chain:f,refreshNow:!0},miningWhere:{pair:g,liquidityTokenInMining_not:"0",chain:f},first:1e3,orderBy:"liquidityTokenBalance",orderDirection:"desc"})),{enabled:!!p})),{balance:P,mining:_,pair:D}=null!==(o=O.data)&&void 0!==o?o:{};let N=[];const F=x?null===(a=M.data)||void 0===a?void 0:a.get(x.address):void 0;if(P&&_&&D){const{baseLpToken:e,quoteLpToken:t}=D,n=new Map,i=(null==e?void 0:e.id)===(null==t?void 0:t.id);for(const o of P){const{id:r,liquidityTokenBalance:a}=o,l=new s(null!=a?a:0),[d,c]=r.split("-");let u={id:d,baseSupplied:new s(0),quoteSupplied:new s(0)};n.has(u.id)?u=n.get(u.id):n.set(u.id,u);const[,m]=Ef(l,B,I,S,p,h,y);m&&(i||c===(null==e?void 0:e.id))&&(u.baseSupplied=m);const[,x]=Ef(l,E,A,L,p,h,v);x&&(i||c===(null==t?void 0:t.id))&&(u.quoteSupplied=x)}for(const o of _){const{id:r,liquidityTokenInMining:a}=o,l=new s(null!=a?a:0),[d,c]=r.split("-"),[,u]=Ef(l,B,I,S,p,h,y),[,m]=Ef(l,E,A,L,p,h,v);if(n.has(d)){const o=n.get(d);u&&(i||c===(null==e?void 0:e.id))&&(o.baseSupplied=u.plus(o.baseSupplied)),m&&(i||c===(null==t?void 0:t.id))&&(o.quoteSupplied=m.plus(o.quoteSupplied))}else{const o={id:d,baseSupplied:new s(0),quoteSupplied:new s(0)};u&&(i||c===(null==e?void 0:e.id))&&(o.baseSupplied=u),m&&(i||c===(null==t?void 0:t.id))&&(o.quoteSupplied=m),n.set(o.id,o)}}const o=(null!==(l=null==m?void 0:m.decimals)&&void 0!==l?l:0)>6?6:4,r=(null!==(d=null==x?void 0:x.decimals)&&void 0!==d?d:0)>6?6:4,a=F;n.forEach((e=>{var t,n;N.push({userId:e.id,baseSupplied:e.baseSupplied?nr({input:e.baseSupplied,showDecimals:o}):"0",quoteSupplied:e.quoteSupplied?nr({input:e.quoteSupplied,showDecimals:r}):"0",baseTokenAddress:null!==(t=null==m?void 0:m.address)&&void 0!==t?t:"",quoteTokenAddress:null!==(n=null==x?void 0:x.address)&&void 0!==n?n:"",baseTokenSymbol:yr(m),quoteTokenSymbol:yr(x),sharePercentage:C&&I?nr({input:C.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).div(C.multipliedBy(I).plus(null!=A?A:0)).multipliedBy(100),showDecimals:2}):"",dollarValue:null!=a&&C?`$${nr({input:C.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).multipliedBy(a),showDecimals:2})}`:"-",dollarValueBN:C?C.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0):s(0)})})),N.sort(((e,t)=>t.dollarValueBN.gt(e.dollarValueBN)?1:-1))}const U=[b,j,w,T,k,M,O],q=function(e){const t=[];if(e.forEach((e=>{e.error&&t.push(e.refetch)})),t.length)return()=>{t.forEach((e=>e()))}}(U),V=U.some((e=>e.isLoading));return Object.assign(Object.assign({},O),{isLoading:V,errorRefetch:q,list:N})}({pool:i}),[m,x]=n.useState(1),g=m*(d?4:8),f=h.list,y=g<f.length,v=f.slice(0,g);return z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column"},children:z.jsx(_p,{refetch:h.error?h.refetch:void 0,loading:h.isLoading&&!(null==v?void 0:v.length),empty:!(null==v?void 0:v.length),children:!!(null==v?void 0:v.length)&&z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{overflowX:"auto",minHeight:244},children:z.jsxs(t.Box,{component:"table",sx:{minWidth:"100%"},children:[z.jsx(t.Box,{component:"thead",sx:{position:"sticky",top:0},children:z.jsxs(t.Box,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"JlIjZf",message:"Liquidity Provider"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"C1qIFl",message:"Liquidity Supplied"})}),z.jsx(t.Box,{component:"th",sx:{"&&":{textAlign:"right"}},children:z.jsx(e.Trans,{id:"me2dmq",message:"Value (USD)"})}),z.jsx(t.Box,{component:"th",sx:{"&&":{textAlign:"right"}},children:z.jsx(e.Trans,{id:"Z8lGw6",message:"Share"})})]})}),z.jsx(t.Box,{component:"tbody",children:null==v?void 0:v.map((e=>z.jsxs(t.Box,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[z.jsx("td",{children:z.jsx(t.Box,{sx:{display:"flex",alignItems:"center"},children:z.jsx(lp,{address:e.userId,customChainId:p,truncate:!0})})}),z.jsxs("td",{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{address:e.baseTokenAddress,chainId:p,width:18,height:18}),`${e.baseSupplied} ${e.baseTokenSymbol}`]}),z.jsxs(t.Box,{sx:{mt:4,display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{address:e.quoteTokenAddress,chainId:p,width:18,height:18}),`${e.quoteSupplied} ${e.quoteTokenSymbol}`]})]}),z.jsx(t.Box,{component:"td",sx:{textAlign:"right"},children:e.dollarValue}),z.jsx(t.Box,{component:"td",sx:{textAlign:"right"},children:`${e.sharePercentage}%`})]},e.userId)))})]})}),y&&z.jsxs(t.ButtonBase,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:u.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>x((e=>e+1)),children:[z.jsx(e.Trans,{id:"yQ2kGp",message:"Load more"}),z.jsx(t.Box,{component:oe.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function pw({address:e,chainId:t}){var n;const i=qa(),o=t?Si[t]:"",a=i.getQuery(r.PoolApi.graphql.fetchPoolDashboard,{where:{pair_address:null!=e?e:"",chain:o}}),s=c.useQuery(Object.assign(Object.assign({},a),{enabled:!!e&&!!t})),l=null===(n=s.data)||void 0===n?void 0:n.dashboard_pairs_detail;return Object.assign(Object.assign({},s),{dashboard:l})}function hw(e,t){if(!e)return"";const n=j(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function mw({chainId:e,address:n,symbol:o,amount:r,sx:a}){return z.jsxs(t.Box,{sx:i.merge({display:"flex",justifyContent:"flex-end",alignItems:"center"},a),children:[n&&z.jsx(t.Box,{sx:{height:16,flexBasis:16,flexGrow:0,flexShrink:0,mr:4},children:z.jsx(sl,{width:16,height:16,address:n,chainId:e})}),z.jsxs(t.Box,{sx:{textAlign:"right",display:"flex",alignItems:"center"},children:[r," ",z.jsx(t.Box,{sx:{display:"inline-block",maxWidth:"6em",minWidth:"auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"},title:o,children:o})]})]})}function xw({chainId:e,baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:r,vertical:a}){const{isMobile:s}=Xa();return z.jsxs(t.Box,{sx:{mt:4,display:"flex",justifyContent:"flex-end",flexDirection:a?"column":"row",alignItems:a?"flex-end":"center",flexWrap:"wrap",typography:s?"h6":"body1"},children:[n?z.jsx(mw,{chainId:e,address:null==n?void 0:n.address,amount:o,symbol:null==n?void 0:n.symbol}):"-",a?"":z.jsx(t.Box,{sx:{mx:10},children:"/"}),i?z.jsx(mw,{chainId:e,address:null==i?void 0:i.address,amount:r,symbol:null==i?void 0:i.symbol,sx:{mt:a?4:0}}):"-"]})}function gw({label:e,children:n,pairsStatLoading:o,poolDetailLoading:r}){const{isMobile:a}=Xa();return z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between"},children:[z.jsx(t.Box,{sx:{color:"text.secondary",minWidth:"5em",typography:a?"h6":"body1"},children:e}),z.jsx(t.Box,{sx:i.merge({textAlign:"right",overflow:"hidden","& .title":{typography:a?"body1":"caption",width:"100%"}},o&&!r||!o&&r?{ml:8,flex:1,display:"flex",flexDirection:"column",alignItems:"flex-end","& .title":{display:"flex",justifyContent:"flex-end"}}:{}),children:n})]})}function fw({sx:e}){return z.jsx(t.Skeleton,{sx:Object.assign({width:"100%",maxWidth:237,height:22},e)})}function yw({detail:e,lpFeeRate:n,mtFeeRate:i}){const{isMobile:r}=Xa();return"DPP"===(null==e?void 0:e.type)?null:e&&n&&i?z.jsxs(t.Box,{sx:{color:"text.secondary",typography:r?"h6":"body1"},children:[z.jsx("span",{children:"LP "}),z.jsx("span",{children:gr({input:n,showDecimals:6})}),z.jsxs("span",{children:[" / ",o.i18n._({id:"7C/BwI",message:"Community Treasury"})," "]}),z.jsx("span",{children:gr({input:new s(null!=i?i:0).toNumber(),showDecimals:6})})]}):z.jsx(fw,{sx:{mt:4}})}function vw({detail:e}){var n,i,r,a,l,d,u,p,h,m,x,g,f,y,v,b,C,j,w,k,T,B,E,I,A,S,L;const M=t.useTheme(),{isMobile:R}=Xa(),{baseToken:O,quoteToken:P}=null!=e?e:{},_="DPP"===(null==e?void 0:e.type),D="DSP"===(null==e?void 0:e.type)||"GSP"===(null==e?void 0:e.type),N="CLASSICAL"===(null==e?void 0:e.type),F=pw({address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId}),U=F.dashboard,q=F.isLoading,V=c.useQuery(ya.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(n=null==e?void 0:e.baseToken)||void 0===n?void 0:n.decimals,null===(i=null==e?void 0:e.quoteToken)||void 0===i?void 0:i.decimals)),W=q?z.jsx(fw,{}):null===(null==U?void 0:U.totalVolume)||void 0===(null==U?void 0:U.totalVolume)?"-":`$${nr({input:new s(null==U?void 0:U.totalVolume),showDecimals:2})}`,H=q?z.jsx(fw,{}):U&&(Ap(U.totalFee)||Ap(U.totalMtFee))?`$${nr({input:new s(U.totalFee||0).plus(U.totalMtFee||0),showDecimals:2})}`:"-",{account:Z}=Pa(),$=c.useQuery(ya.getFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,Z)),G=null===(r=$.data)||void 0===r?void 0:r.mtFeeRate,Q=null===(a=$.data)||void 0===a?void 0:a.lpFeeRate,Y=null==G?void 0:G.plus(null!=Q?Q:0),X=!e,K=c.useQuery(ya.getClassicalTargetQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(l=null==e?void 0:e.baseToken)||void 0===l?void 0:l.decimals,null===(d=null==e?void 0:e.quoteToken)||void 0===d?void 0:d.decimals));return z.jsxs(t.Box,{sx:Object.assign({pb:30,position:"relative",overflow:"hidden"},R?{backgroundColor:"background.paper",p:20}:{mt:32}),children:[z.jsxs(t.Box,{sx:{flex:"1 0 50%","& > div + div":{mt:10},"&::after":{content:'""',display:"block",my:20,width:"100%",height:"1px",backgroundColor:"border.main"}},children:[z.jsx(gw,{label:o.i18n._({id:"l4Za6X",message:"Total Swap Volume"}),pairsStatLoading:q,children:z.jsx("div",{className:"title",children:W})}),q||!e?z.jsx(fw,{sx:{mt:4}}):z.jsx(xw,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:nr({input:null!==(u=null==U?void 0:U.baseVolumeCumulative)&&void 0!==u?u:0,showDecimals:2}),quoteAmount:nr({input:null!==(p=null==U?void 0:U.quoteVolumeCumulative)&&void 0!==p?p:0,showDecimals:2})}),z.jsx(gw,{label:o.i18n._({id:"Z033WN",message:"Total Swap Fee"}),pairsStatLoading:q,children:z.jsx("div",{className:"title",children:H})}),q||!e?z.jsx(fw,{sx:{mt:4}}):z.jsx(xw,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:nr({input:new s(null!==(h=null==U?void 0:U.baseFee)&&void 0!==h?h:0).plus(null!==(m=null==U?void 0:U.baseMtFee)&&void 0!==m?m:0),showDecimals:2}),quoteAmount:nr({input:new s(null!==(x=null==U?void 0:U.quoteFee)&&void 0!==x?x:0).plus(null!==(g=null==U?void 0:U.quoteMtFee)&&void 0!==g?g:0),showDecimals:2})}),z.jsx(gw,{label:o.i18n._({id:"/BbUJ6",message:"Total Number of Traders"}),pairsStatLoading:q,children:q?z.jsx(fw,{sx:{mt:4}}):nr({input:null!==(f=null==U?void 0:U.txUsers)&&void 0!==f?f:0,showDecimals:0})})]}),z.jsxs(t.Box,{sx:{flex:"1 0 50%",overflow:"hidden","& > div + div":{mt:10}},children:[z.jsx(gw,{label:o.i18n._({id:"UE2beD",message:"Creator"}),poolDetailLoading:!e,children:e?e.isCpPool?z.jsx(lp,{address:null!==(y=e.cpCreator)&&void 0!==y?y:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):z.jsx(lp,{address:null!==(v=e.creator)&&void 0!==v?v:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):z.jsx(fw,{})}),(null==e?void 0:e.isCpPool)||(null==e?void 0:e.owner)?z.jsx(gw,{label:o.i18n._({id:"LtI9AS",message:"Owner"}),poolDetailLoading:X,children:X?z.jsx(fw,{}):(null==e?void 0:e.isCpPool)?z.jsx(lp,{address:null==e?void 0:e.cpCreator,truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}}):z.jsx(lp,{address:null!==(b=e.owner)&&void 0!==b?b:"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})}):"",z.jsx(gw,{label:o.i18n._({id:"52uNwk",message:"Creation Time"}),poolDetailLoading:X,children:X?z.jsx(fw,{}):hw(1e3*Number((null==e?void 0:e.isCpPool)?e.cpCreatedAtTimestamp||0:e.createdAtTimestamp||0))||"-"}),(null==e?void 0:e.isCpPool)?z.jsxs(z.Fragment,{children:[z.jsx(gw,{label:o.i18n._({id:"cDWXuq",message:"Settler"}),poolDetailLoading:X,children:X?z.jsx(fw,{}):z.jsx(lp,{address:(null==e?void 0:e.cpLiquidator)||"",truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})}),z.jsx(gw,{label:o.i18n._({id:"JuzN3b",message:"Related CrowdPooling"}),poolDetailLoading:X,children:X?z.jsx(fw,{}):z.jsx(lp,{address:null==e?void 0:e.cpAddress,truncate:!0,"data-key":"link",sx:{color:M.palette.text.primary}})})]}):void 0,z.jsxs(gw,{label:o.i18n._({id:"Y7rVy0",message:"Fee Rate"}),poolDetailLoading:X,children:[z.jsx("div",{className:"detail-title",style:{textAlign:"right"},children:gr({input:null==Y?void 0:Y.toNumber(),showDecimals:6})}),z.jsx(yw,{detail:e,lpFeeRate:Q,mtFeeRate:G})]}),z.jsx(gw,{label:o.i18n._({id:"sjn3tj",message:"Slippage Coefficient"}),poolDetailLoading:X,children:X?z.jsx(fw,{}):null===(j=null===(C=V.data)||void 0===C?void 0:C.pmmParamsBG)||void 0===j?void 0:j.k.toString()}),z.jsx(gw,{poolDetailLoading:X,label:N?o.i18n._({id:"d8YnVj",message:"Guide Price"}):_?o.i18n._({id:"CeLrge",message:"Mid Price"}):D?o.i18n._({id:"4ogEAw",message:"Pegged Exchange Rate"}):o.i18n._({id:"jjuKOj",message:"Min Price"}),children:X?z.jsx(fw,{}):null!==O&&(D?`1 ${null==O?void 0:O.symbol} = ${null===(T=null===(k=null===(w=V.data)||void 0===w?void 0:w.pmmParamsBG)||void 0===k?void 0:k.i)||void 0===T?void 0:T.toString()} ${null==P?void 0:P.symbol}`:null===(I=null===(E=null===(B=V.data)||void 0===B?void 0:B.pmmParamsBG)||void 0===E?void 0:E.i)||void 0===I?void 0:I.toString())||"-"}),N&&z.jsxs(z.Fragment,{children:[z.jsx(gw,{label:o.i18n._({id:"JR7wWw",message:"Equilibrium target"}),poolDetailLoading:X,children:X?z.jsx(fw,{}):z.jsx(z.Fragment,{children:null===(L=null===(S=null===(A=V.data)||void 0===A?void 0:A.pmmParamsBG)||void 0===S?void 0:S.k)||void 0===L?void 0:L.toString()})}),K.data?z.jsx(xw,{vertical:!0,chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:nr({input:K.data.baseTarget,showDecimals:2}),quoteAmount:nr({input:K.data.quoteTarget,showDecimals:2})}):""]})]})]})}function bw(e,t){if(!e)return"";const n=j(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function Cw({amountOut:e,amountIn:i,fromTokenSymbol:o,toTokenSymbol:r}){const[a,s]=n.useState(!1),l=nr({input:i/e,showDecimals:2}),d=nr({input:e/i,showDecimals:2});return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:["1 ",a?r:o," = ",a?l:d," ",a?o:r,z.jsx(t.Box,{sx:{ml:10,width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"background.paperContrast",borderRadius:"50%"},onClick:()=>s((e=>!e)),children:z.jsx(t.Box,{component:oe.Switch})})]})}function jw({poolDetail:i}){var o,a,l;const{isMobile:d}=Xa(),u=t.useTheme(),{account:p,chainId:h}=Pa(),m=c.useQuery(ya.getFeeRateQuery(null==i?void 0:i.chainId,null==i?void 0:i.address,null==i?void 0:i.type,p)),x=null===(o=m.data)||void 0===o?void 0:o.mtFeeRate,g=null===(a=m.data)||void 0===a?void 0:a.lpFeeRate,f=null==x?void 0:x.plus(null!=g?g:0),y=function({chainId:e,address:t,first:n=50}){var i;const o=e?Si[e]:"",a=qa().getQuery(r.PoolApi.graphql.fetchPoolSwapList,{first:n,orderBy:"timestamp",orderDirection:"desc",where:{pair:t,chain:o}}),s=c.useQuery(Object.assign(Object.assign({},a),{enabled:!!t})),l=null===(i=s.data)||void 0===i?void 0:i.swaps;return Object.assign(Object.assign({},s),{swapList:l})}({address:null==i?void 0:i.address,chainId:null==i?void 0:i.chainId}),[v,b]=n.useState(1),C=v*(d?4:8),j=null!==(l=y.swapList)&&void 0!==l?l:[],w=C<j.length,k=j.slice(0,C);return z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column"},children:z.jsx(_p,{refetch:y.error?y.refetch:void 0,loading:y.isLoading,empty:!(null==k?void 0:k.length),children:!!(null==k?void 0:k.length)&&z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{overflowX:"auto",minHeight:244},children:z.jsxs(t.Box,{component:"table",sx:{minWidth:"100%"},children:[z.jsx(t.Box,{component:"thead",sx:{position:"sticky",top:0},children:z.jsxs(t.Box,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"LhMjLm",message:"Time"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"UPXmW+",message:"Trader"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"v4nCHK",message:"Paid"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"fZ5Vnu",message:"Received"})}),z.jsx(t.Box,{component:"th",children:z.jsx(e.Trans,{id:"a7u1N9",message:"Price"})}),z.jsx(t.Box,{component:"th",sx:{"&&":{textAlign:"right"}},children:z.jsx(e.Trans,{id:"Y7rVy0",message:"Fee Rate"})}),z.jsx(t.Box,{component:"th",sx:{"&&":{textAlign:"right"}},children:z.jsx(e.Trans,{id:"PLUB/s",message:"Fee"})})]})}),z.jsx(t.Box,{component:"tbody",children:null==k?void 0:k.map((e=>z.jsxs(t.Box,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[z.jsx("td",{children:bw(1e3*e.timestamp)}),z.jsx("td",{children:z.jsx(lp,{address:e.from,truncate:!0})}),z.jsx("td",{children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{address:e.fromToken.id,chainId:h,width:18,height:18}),`${nr({input:e.amountIn,showDecimals:2})} ${e.fromToken.symbol}`]})}),z.jsx("td",{children:z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{address:e.toToken.id,chainId:h,width:18,height:18}),`${nr({input:e.amountOut,showDecimals:2})} ${e.toToken.symbol}`]})}),z.jsx("td",{children:z.jsx(Cw,{amountOut:e.amountOut,amountIn:e.amountIn,fromTokenSymbol:e.fromToken.symbol,toTokenSymbol:e.toToken.symbol})}),z.jsx(t.Box,{component:"td",sx:{textAlign:"right"},children:gr({input:f})}),z.jsx(t.Box,{component:"td",sx:{textAlign:"right"},children:`${nr({input:new s(e.amountOut).times(null!=f?f:0)})} ${e.toToken.symbol}`})]},e.id)))})]})}),w&&z.jsxs(t.ButtonBase,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:u.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>b((e=>e+1)),children:[z.jsx(e.Trans,{id:"yQ2kGp",message:"Load more"}),z.jsx(t.Box,{component:oe.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function ww({poolDetail:e}){const{isMobile:i}=Xa(),[r,a]=n.useState(lw.parameters),s=[{key:lw.parameters,value:o.i18n._({id:"F18WP3",message:"Parameters"})},{key:lw.swaps,value:o.i18n._({id:"EatqP4",message:"Swaps"})}];return e&&"DPP"!==(null==e?void 0:e.type)&&s.push({key:lw.liquidityProviders,value:o.i18n._({id:"juypHV",message:"Liquidity Providers"})}),z.jsx(t.Box,{sx:Object.assign({mt:24,backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},i?{}:{mt:32,px:20}),children:z.jsxs(t.Tabs,{value:r,onChange:(e,t)=>a(t),children:[z.jsx(t.TabsGroup,{tabs:s}),z.jsx(t.TabPanel,{value:lw.parameters,children:z.jsx(vw,{detail:e})}),z.jsx(t.TabPanel,{value:lw.swaps,children:z.jsx(jw,{poolDetail:e})}),z.jsx(t.TabPanel,{value:lw.liquidityProviders,children:z.jsx(uw,{poolDetail:e})})]})})}function kw(){return z.jsx(t.Skeleton,{variant:"rounded",sx:{width:90}})}function Tw({poolDetail:n}){var i,r;const a=t.useTheme(),{isMobile:l}=Xa(),d=pw({address:null==n?void 0:n.address,chainId:null==n?void 0:n.chainId}),c=d.dashboard,u=[{description:o.i18n._({id:"Gr2anW",message:"Traders (24H)"}),text:d.isLoading?z.jsx(kw,{}):null===(null==c?void 0:c.txUserNear24h)||void 0===(null==c?void 0:c.txUserNear24h)?"-":mr(new s(null==c?void 0:c.txUserNear24h))},{description:o.i18n._({id:"sTnImq",message:"Total Liquidity"}),text:d.isLoading?z.jsx(kw,{}):null===(null==c?void 0:c.tvl)||void 0===(null==c?void 0:c.tvl)?"-":`$${mr(new s(null==c?void 0:c.tvl))}`},{description:o.i18n._({id:"p7/w10",message:"Volume (24H)"}),text:d.isLoading?z.jsx(kw,{}):null===(null==c?void 0:c.volume)||void 0===(null==c?void 0:c.volume)?"-":`$${mr(new s(null==c?void 0:c.volume))}`},{description:o.i18n._({id:"7X40pG",message:"Fees (24H)"}),text:d.isLoading?z.jsx(kw,{}):null!==!(null==c?void 0:c.feeNear24h)||(null==c?void 0:c.mtFeeNear24h)?`$${mr(new s(null!==(i=null==c?void 0:c.feeNear24h)&&void 0!==i?i:0).plus(null!==(r=null==c?void 0:c.mtFeeNear24h)&&void 0!==r?r:0))}`:"-",question:d.isLoading?void 0:z.jsxs(t.Box,{sx:{width:198},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsx(e.Trans,{id:"OnDEky",message:"LP Fee"}),z.jsx(t.Box,{children:(null==c?void 0:c.feeNear24h)?`$${mr(new s(null==c?void 0:c.feeNear24h))}`:"-"})]}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsx(e.Trans,{id:"pSQ1lM",message:"MT Fee"}),z.jsx(t.Box,{children:(null==c?void 0:c.mtFeeNear24h)?`$${mr(new s(null==c?void 0:c.mtFeeNear24h))}`:"-"})]})]})}];return z.jsx(t.Box,{sx:Object.assign({display:"grid",gap:12},l?{mt:24,gridTemplateColumns:"repeat(2, 1fr)"}:{mt:32,gridTemplateColumns:"repeat(4, 1fr)"}),children:u.map((e=>z.jsxs(t.Box,{sx:{borderRadius:8,p:16,backgroundColor:"background.paper",border:`1px solid ${a.palette.border.main}`},children:[z.jsx(t.Box,{sx:{typography:"caption",fontWeight:600,lineHeight:"27px"},children:e.text}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary",gap:4},children:[e.description,e.question?z.jsx(ku,{title:e.question}):""]})]},e.description)))})}function Bw({poolDetail:n,loading:i}){var a,s,l,d;const{address:c}=null!=n?n:{},u=t.useTheme(),p=pm(),{account:h}=Pa(),{isMobile:m}=Xa(),x=h&&"DPP"===(null==n?void 0:n.type)&&(null===(a=null==n?void 0:n.owner)||void 0===a?void 0:a.toLocaleLowerCase())===h.toLocaleLowerCase(),{supportAMMV2:g,onSharePool:f}=Q();return z.jsxs(t.Box,{sx:Object.assign({},m?{pt:24}:{pt:20,display:"flex",alignItems:"center",justifyContent:"space-between"}),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[(null==n?void 0:n.baseToken)?z.jsx(Pp,{tokens:[n.baseToken,n.quoteToken],chainId:n.chainId,width:36,mr:8}):z.jsx(t.Skeleton,{variant:"circular",sx:{width:36,height:36,mr:8}}),z.jsxs(t.Box,{children:[z.jsxs(t.Box,{sx:{typography:"h4"},children:[(null==n?void 0:n.baseToken)?`${null===(s=n.baseToken)||void 0===s?void 0:s.symbol} / ${null===(l=n.quoteToken)||void 0===l?void 0:l.symbol}`:"-",g&&z.jsx(t.Box,{component:"span",sx:{position:"relative",top:-4,ml:4,px:4,py:2,borderRadius:4,fontSize:10,lineHeight:1,fontWeight:600,backgroundColor:t.alpha(u.palette.purple.main,.1),color:u.palette.purple.main},children:"PMM"}),z.jsx(By,{address:c,chainId:null==n?void 0:n.chainId,hideName:m,sx:{display:"inline-flex",ml:8}}),x&&!m?z.jsx(t.Box,{component:t.ButtonBase,sx:{typography:"h6",px:8,py:2,ml:8,borderStyle:"solid",borderWidth:1,borderRadius:4,borderColor:"primary.main",color:"primary.main",whiteSpace:"nowrap","&:hover":{backgroundColor:"primary.main",color:"primary.contrastText"}},onClick:()=>{p.push({type:exports.PageType.ModifyPool,params:{address:null==n?void 0:n.address,chainId:null==n?void 0:n.chainId}})},children:z.jsx(e.Trans,{id:"ePK91l",message:"Edit"})}):""]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",mr:12},children:z.jsx(lp,{address:null!=c?c:"",truncate:!0,showCopy:!0,iconDarkHover:!0,"data-key":"link",sx:{typography:"body2",color:"text.secondary"},iconSize:14,iconSpace:6,customChainId:null==n?void 0:n.chainId,onShareClick:f&&n?()=>f({chainId:n.chainId,baseToken:n.baseToken,quoteToken:n.quoteToken,poolId:c,apy:n.apy,isSingle:r.PoolApi.utils.singleSideLp(n.type)}):void 0})})]})]}),z.jsxs(t.Box,{sx:m?{display:"flex",alignItems:"center",mt:24}:{textAlign:"right"},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",color:"success.main",typography:"h4"},children:[(null==n?void 0:n.miningAddress)?z.jsx(t.Tooltip,{title:o.i18n._({id:"B3mhDR",message:"Add liquidity to obtain LP tokens for mining"}),children:z.jsx("span",{children:"✨ "})}):"",z.jsx(t.LoadingSkeleton,{loading:i,loadingSx:{width:100},children:null!==(d=null==n?void 0:n.baseApy)&&void 0!==d?d:"0%"}),(null==n?void 0:n.quoteApy)?`/${null==n?void 0:n.quoteApy}`:""]}),z.jsx(t.Box,{sx:Object.assign({typography:"body2"},m?{ml:4}:{}),children:z.jsx(e.Trans,{id:"rSayea",message:"APY"})})]})]})}function Ew({chainId:e,shortNumber:n,pieSize:i="default",baseReserve:o=new s(1),baseAmount:r=new s(1),quoteAmount:a=new s(0),baseTokenSymbol:l="-",quoteTokenSymbol:d="-",quoteTokenDecimals:c=18,baseTokenDecimals:u=18,baseTokenAddress:p,quoteTokenAddress:h,baseTvlRate:m,quoteTvlRate:x,disabledAmount:g,disabledRate:f,disabledPercentage:y,loading:v,sx:b,pieRadius:C}){const j=t.useTheme(),w="small"===i,k=w?6:16,B=C||(w?23:30),E=u>6?6:u>4?4:2,I=c>6?6:c>4?4:2,A=n?mr(new s(o)):nr({input:o,showDecimals:E}),S=n?mr(new s(a)):nr({input:a,showDecimals:I});let L=r.plus(a);L=L.lte(0)?new s(1):L;const M=m||r.div(L).multipliedBy(100).toFixed(2),R=x||a.div(L).multipliedBy(100).toFixed(2),O=r.lte(0)&&a.lte(0),P=j.palette.success.main,_=j.palette.error.main,D=[{name:"base",value:O?1:r.toNumber(),color:P},{name:"quote",value:O?1:a.toNumber(),color:_}];return z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:"column"},b||{}),children:[z.jsx("div",{children:y?"":v?z.jsx(t.Skeleton,{width:46,height:46,variant:"circular"}):z.jsx(T.PieChart,{width:2*B,height:2*B,children:z.jsx(T.Pie,{isAnimationActive:!1,dataKey:"value",data:D,labelLine:!1,label:!1,outerRadius:B,fill:_,children:D.map(((e,t)=>z.jsx(T.Cell,{fill:e.color,strokeWidth:0},`cell-${t}`)))})})}),z.jsxs(t.Box,{className:"symbol-wrapper",sx:{display:"flex",flexDirection:"column",justifyContent:"center",ml:0,mt:16,width:"100%","& > div":{paddingLeft:"12px",position:"relative","&::before":{content:'""',width:"8px",height:"8px",position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)",backgroundColor:j.palette.purple.main,borderRadius:"50%"},"&:last-child::before":{backgroundColor:_},"&> span.symbol":{display:"inline-block",maxWidth:"6em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"}}},children:[v?z.jsx(t.Skeleton,{width:237,sx:{borderRadius:4}}):z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{children:[z.jsx(t.Box,{className:"symbol",title:l,sx:{typography:"h6"},children:l}),p?z.jsx(lp,{address:p,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),z.jsxs(t.Box,{sx:{textAlign:"right"},children:[g?"":`${A} `,y||f?"":z.jsxs(t.Box,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${M}%)`]})]})]}),v?z.jsx(t.Skeleton,{width:237,sx:{borderRadius:4,marginTop:`${k}px`}}):z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:`${k}px`},children:[z.jsxs(t.Box,{children:[z.jsx(t.Box,{className:"symbol",title:d,sx:{typography:"h6"},children:d}),h?z.jsx(lp,{address:h,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),z.jsxs(t.Box,{sx:{textAlign:"right"},children:[g?"":`${S} `,y||f?"":z.jsxs(t.Box,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${R}%)`]})]})]})]})]})}function Iw({poolDetail:n}){var i,o,r,a,l,d,u,p,h;const m=t.useTheme(),{isMobile:x}=Xa(),g=c.useQuery(ya.getPMMStateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,null===(i=null==n?void 0:n.baseToken)||void 0===i?void 0:i.decimals,null===(o=null==n?void 0:n.quoteToken)||void 0===o?void 0:o.decimals)),f=null===(r=g.data)||void 0===r?void 0:r.midPrice,y=c.useQuery(ya.getReserveLpQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,null===(a=null==n?void 0:n.baseToken)||void 0===a?void 0:a.decimals,null===(l=null==n?void 0:n.quoteToken)||void 0===l?void 0:l.decimals)),{baseReserve:v,quoteReserve:b}=y.data||{},C=v&&f?null==f?void 0:f.multipliedBy(v):void 0,j=b&&f?new s(b):void 0;let w=C&&j?null==C?void 0:C.plus(j):void 0;w=!w||w.lte(0)?new s(1):w;const k=C&&C.div(w).multipliedBy(100).toFixed(2),T=j&&j.div(w).multipliedBy(100).toFixed(2);return z.jsxs(t.Box,{sx:{mt:x?24:28},children:[z.jsx(t.Box,{sx:{fontWeight:600},children:z.jsx(e.Trans,{id:"sTnImq",message:"Total Liquidity"})}),z.jsxs(t.Box,{sx:{display:"flex",mt:16,backgroundColor:"background.paper",borderRadius:16,overflowX:"auto",border:`1px solid ${m.palette.border.main}`},children:[z.jsx(t.Box,{sx:{flex:x?1:void 0,padding:x?m.spacing(20,30,20,20):m.spacing(20,30,16)},children:z.jsx(Ew,{pieRadius:44,baseReserve:v,baseAmount:C,baseTokenDecimals:null===(d=null==n?void 0:n.baseToken)||void 0===d?void 0:d.decimals,quoteAmount:j,baseTvlRate:k,quoteTvlRate:T,chainId:null==n?void 0:n.chainId,quoteTokenDecimals:(null===(u=null==n?void 0:n.quoteToken)||void 0===u?void 0:u.decimals)||void 0,baseTokenSymbol:yr(null==n?void 0:n.baseToken),quoteTokenSymbol:yr(null==n?void 0:n.quoteToken),baseTokenAddress:x?null===(p=null==n?void 0:n.baseToken)||void 0===p?void 0:p.address:"",quoteTokenAddress:x?null===(h=null==n?void 0:n.quoteToken)||void 0===h?void 0:h.address:"",shortNumber:!0,disabledRate:!x,disabledAmount:!x,loading:g.isLoading||y.isLoading,sx:x?{typography:"body2",fontWeight:600}:{"& .symbol-wrapper":{display:"flex",alignItems:"center",flexDirection:"row","& > div, & > span":{mt:0,"&:last-child":{ml:16}},"& .MuiSkeleton-root":{width:"40px !important"}}}})}),x?"":z.jsxs(t.Box,{component:"table",sx:{flex:1,fontWeight:600,borderStyle:"solid",borderColor:"border.main",borderWidth:"0 0 0 1px","& thead":{typography:"h6",color:"text.secondary","& th":{textAlign:"right",px:20,py:16,borderStyle:"solid",borderColor:"border.main",borderWidth:"0 0 1px","&:first-child":{textAlign:"left"}}},"& tbody":{typography:"body2",textAlign:"right","& td":{px:20,py:0,"&:first-child":{textAlign:"left"}}}},children:[z.jsx("thead",{children:z.jsxs("tr",{children:[z.jsx("th",{children:z.jsx(e.Trans,{id:"bUUVED",message:"Asset"})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"hcNa1G",message:"Token Amount"})}),z.jsx("th",{children:z.jsx(e.Trans,{id:"iaocTt",message:"Ratio"})})]})}),z.jsxs("tbody",{children:[z.jsxs("tr",{children:[z.jsx("td",{children:n?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{address:n.baseToken.address,width:24,height:24,marginRight:4,chainId:n.chainId}),z.jsxs(t.Box,{children:[n.baseToken.symbol,z.jsx(lp,{address:n.baseToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:n.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):z.jsx(t.Skeleton,{width:100,height:24})}),z.jsx("td",{children:n?mr(new s(n.baseReserve)):z.jsx(t.Skeleton,{width:50,height:24,sx:{display:"inline-block"}})}),z.jsx("td",{children:g.isLoading?z.jsx(t.Skeleton,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=k?k:"-"}%`})]}),z.jsxs("tr",{children:[z.jsx("td",{children:n?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{address:n.quoteToken.address,width:24,height:24,marginRight:4,chainId:n.chainId}),z.jsxs(t.Box,{children:[n.quoteToken.symbol,z.jsx(lp,{address:n.quoteToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:n.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):z.jsx(t.Skeleton,{width:100,height:24})}),z.jsx("td",{children:n?mr(new s(n.quoteReserve)):z.jsx(t.Skeleton,{width:50,height:24,sx:{display:"inline-block"}})}),z.jsx("td",{children:g.isLoading?z.jsx(t.Skeleton,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=T?T:"-"}%`})]})]})]})]})]})}function Aw({params:i}){var r,a,s,l,d,c,u;const p=pm(),{isMobile:h}=Xa(),{account:m}=Pa(),x=t.useTheme(),g=Jj({id:null==i?void 0:i.address,chainId:null==i?void 0:i.chainId}),{poolDetail:f}=g,y=D(g,["poolDetail"]),[v,b]=n.useState("inital");y.isPending||y.error||f||"inital"!==v||b("open");const C=f&&"DPP"===f.type&&m&&(null===(r=f.owner)||void 0===r?void 0:r.toLocaleLowerCase())===m.toLocaleLowerCase(),j=f&&"DPP"!==f.type||m&&(null==f?void 0:f.owner)&&f.owner.toLocaleLowerCase()===m.toLocaleLowerCase(),[w,k]=n.useState();f&&void 0===w&&!h&&k(df.Add);const T=w&&f?Object.assign(Object.assign({},f),{baseLpToken:{id:null===(a=f.baseLpToken)||void 0===a?void 0:a.id,decimals:Number(null!==(l=null===(s=f.baseLpToken)||void 0===s?void 0:s.decimals)&&void 0!==l?l:18)},quoteLpToken:{id:null===(d=f.quoteLpToken)||void 0===d?void 0:d.id,decimals:Number(null!==(u=null===(c=f.quoteLpToken)||void 0===c?void 0:c.decimals)&&void 0!==u?u:18)}}):void 0,B=!!(null==f?void 0:f.miningAddress);return z.jsxs(cm,{sx:h?{p:x.spacing(28,0,j?108:0)}:{p:x.spacing(28,0,40)},children:[z.jsx(Xj,{onClick:()=>{p.push({type:exports.PageType.Pool})}}),z.jsxs(t.Box,{sx:h?{}:{display:"flex",gap:12,overflow:"hidden"},children:[z.jsxs(t.Box,{sx:{flex:1,overflow:"hidden"},children:[z.jsx(Bw,{poolDetail:f,loading:y.isPending}),z.jsx(dw,{poolDetail:f,chart24hDataFirst:!0}),z.jsx(Tw,{poolDetail:f}),z.jsx(Iw,{poolDetail:f}),z.jsx(ww,{poolDetail:f})]}),h?z.jsx(Ty,{account:m,pool:T,operate:w,hasMining:B,modal:!0,onClose:()=>{k(void 0)}}):z.jsx(ky,{account:m,operate:w,hasMining:B,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},pool:T,hidePoolInfo:!0})]}),z.jsx(Yj,{singleBtn:!0,open:"open"===v,onClose:()=>b("close"),onConfirm:()=>b("close"),title:o.i18n._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),h&&j&&z.jsx(z.Fragment,{children:z.jsxs(t.Box,{sx:{position:"fixed",bottom:0,left:0,right:0,p:20,display:"grid",gap:"8px",gridTemplateColumns:C?"repeat(3, 1fr)":"repeat(2, 1fr)",backgroundColor:"background.paperContrast"},children:[C?z.jsx(t.Button,{variant:t.Button.Variant.second,onClick:()=>{pm.getState().push({type:exports.PageType.ModifyPool,params:{chainId:f.chainId,address:f.address}})},children:z.jsx(e.Trans,{id:"ePK91l",message:"Edit"})}):"",z.jsx(t.Button,{variant:t.Button.Variant.second,onClick:()=>{k(df.Remove)},children:z.jsx(e.Trans,{id:"t/YqKh",message:"Remove"})}),z.jsx(t.Button,{onClick:()=>{k(df.Add)},children:z.jsx(e.Trans,{id:"m16xKo",message:"Add"})})]})})]})}function Sw({statuses:n,children:i,buttonProps:o}){var r;if(!n.find((e=>e.needShowTokenStatusButton))&&i)return z.jsx(z.Fragment,{children:i});const a=n.find((e=>e.insufficientBalance));if(a)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,...o,children:z.jsx(e.Trans,{id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(r=a.token)||void 0===r?void 0:r.symbol}})});const s=n.some((e=>e.isApproving));return z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:n.map(((n,i)=>{var r,a;let l="";return n.isApproving?l=z.jsx(e.Trans,{id:"j2Uisd",message:"Approving"}):(n.needReset||n.needApprove)&&(l=n.approveTitle),l?z.jsx(t.Button,{fullWidth:!0,isLoading:n.isApproving,onClick:n.submitApprove,disabled:n.insufficientBalance||s,...o,children:l},null!==(a=null===(r=n.token)||void 0===r?void 0:r.symbol)&&void 0!==a?a:i):null}))})}function Lw({token:i,chainId:o,showChainLogo:r,readonly:a,showChainName:s,logoSize:l=24,chainLogoSize:d=12,side:c,occupiedToken:u,defaultLoadBalance:p,notTokenPickerModal:h,border:m,px:x=20,py:g=8,highlightDefault:f,onTokenClick:y,onTokenChange:v}){var b,C;const{onlyChainId:j}=Q(),w=o||j,k=t.useTheme(),[T,B]=n.useState(!1),E=(null==i?void 0:i.chainId)?Ro.get(i.chainId):null,I=s&&!!E;return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{component:t.ButtonBase,sx:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,color:k.palette.text.primary,typography:I?"body2":"body1",fontWeight:600,px:x,py:g,"&:focus-visible":{opacity:.5}},!!m&&{border:`solid 1px ${k.palette.border.main}`,borderRadius:8,"&:hover":{backgroundColor:k.palette.hover.default}}),!(!f||i)&&{backgroundColor:k.palette.primary.main,color:k.palette.primary.contrastText,"&:hover":{opacity:.8}}),onClick:()=>{a||B(!0)},"data-testid":Qo,children:[!!(null==i?void 0:i.address)&&z.jsx(sl,{url:null==i?void 0:i.logoURI,address:null!==(b=null==i?void 0:i.address)&&void 0!==b?b:"",chainId:null==i?void 0:i.chainId,noShowChain:!r,width:l,height:l,chainSize:d,logoOffset:10,marginRight:0}),z.jsxs(t.Box,{sx:{flex:1},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(null==i?void 0:i.address)?z.jsx(z.Fragment,{children:z.jsx(t.Box,{children:null!==(C=null==i?void 0:i.symbol)&&void 0!==C?C:"-"})}):z.jsx(e.Trans,{id:"sIPJGT",message:"SELECT TOKEN"}),!a&&z.jsx(t.Box,{component:"svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{flexShrink:0},children:z.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"})})]}),!!I&&z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary"},children:[E.name,z.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M5.6036 4.12761C5.50037 4.20906 5.3708 4.24967 5.23958 4.24169C5.10836 4.23372 4.98466 4.17773 4.89203 4.08438C4.7994 3.99103 4.74433 3.86685 4.7373 3.73549C4.73026 3.60413 4.77177 3.47477 4.8539 3.37205L5.96239 2.25211C6.46737 1.76405 7.14372 1.494 7.84575 1.5001C8.54779 1.50621 9.21934 1.78798 9.71577 2.28474C10.2122 2.78151 10.4938 3.4535 10.4999 4.156C10.506 4.85851 10.2361 5.5353 9.74839 6.04062L8.60241 7.16592C8.55441 7.22201 8.49533 7.26757 8.4289 7.29974C8.36246 7.3319 8.29009 7.34997 8.21635 7.35282C8.1426 7.35567 8.06906 7.34324 8.00034 7.3163C7.93162 7.28936 7.86921 7.2485 7.81702 7.19627C7.76483 7.14405 7.724 7.0816 7.69707 7.01284C7.67015 6.94407 7.65772 6.87048 7.66057 6.79668C7.66342 6.72289 7.68148 6.65047 7.71363 6.58399C7.74577 6.51751 7.7913 6.4584 7.84736 6.41036L8.97191 5.28506C9.25568 4.98032 9.41017 4.57725 9.40283 4.16078C9.39549 3.74431 9.22689 3.34695 8.93255 3.05242C8.63821 2.75788 8.24111 2.58917 7.82491 2.58182C7.40872 2.57447 7.00592 2.72906 6.70138 3.01302L5.6036 4.12761ZM6.34259 7.93755C6.38819 7.87582 6.44652 7.82461 6.51361 7.7874C6.58071 7.75018 6.65501 7.72783 6.73149 7.72185C6.80798 7.71586 6.88485 7.7264 6.95691 7.75273C7.02897 7.77906 7.09453 7.82058 7.14917 7.87447C7.2038 7.92836 7.24622 7.99337 7.27356 8.06509C7.3009 8.13682 7.31252 8.21358 7.30764 8.29019C7.30275 8.3668 7.28148 8.44147 7.24525 8.50913C7.20902 8.5768 7.15869 8.63589 7.09765 8.68239L5.96774 9.81305C5.45894 10.2708 4.7943 10.5163 4.11029 10.4992C3.42627 10.482 2.77479 10.2034 2.2896 9.72061C1.80441 9.23784 1.52232 8.58752 1.50127 7.90316C1.48021 7.2188 1.72179 6.55234 2.17638 6.04062L3.30629 4.93139C3.3504 4.86735 3.4079 4.81369 3.47482 4.77413C3.54174 4.73456 3.61646 4.71005 3.69379 4.70229C3.77113 4.69453 3.84922 4.70371 3.92266 4.72919C3.99609 4.75466 4.0631 4.79583 4.11904 4.84983C4.17497 4.90384 4.21849 4.96937 4.24657 5.0419C4.27464 5.11442 4.28661 5.19219 4.28163 5.2698C4.27665 5.34742 4.25484 5.42302 4.21773 5.49135C4.18062 5.55969 4.12908 5.61912 4.06671 5.66552L2.93144 6.79618C2.64767 7.10092 2.49318 7.50398 2.50052 7.92045C2.50786 8.33692 2.67647 8.73428 2.97081 9.02882C3.26515 9.32335 3.66224 9.49207 4.07844 9.49942C4.49463 9.50676 4.89743 9.35217 5.20197 9.06821L6.34259 7.93755ZM5.00919 7.76072C4.96119 7.81681 4.90211 7.86237 4.83567 7.89454C4.76924 7.9267 4.69687 7.94477 4.62312 7.94763C4.54937 7.95048 4.47583 7.93804 4.40711 7.9111C4.33839 7.88416 4.27598 7.8433 4.2238 7.79108C4.17161 7.73885 4.13077 7.6764 4.10385 7.60764C4.07693 7.53887 4.0645 7.46528 4.06735 7.39149C4.0702 7.31769 4.08826 7.24528 4.1204 7.17879C4.15255 7.11231 4.19808 7.0532 4.25413 7.00516L6.90487 4.35267C7.00731 4.26488 7.13909 4.21901 7.27386 4.22422C7.40863 4.22943 7.53648 4.28533 7.63185 4.38077C7.72722 4.4762 7.78309 4.60413 7.7883 4.73899C7.7935 4.87385 7.74766 5.00572 7.65993 5.10823L5.00919 7.76072Z",fill:"currentColor"})})]})]})]}),z.jsx(pp,{value:i,open:T,side:c,chainId:w,occupiedAddrs:u?[u.address]:void 0,occupiedChainId:null==u?void 0:u.chainId,defaultLoadBalance:p,onClose:()=>{B(!1),y&&y()},onTokenChange:(e,t)=>{B(!1),setTimeout((()=>{!Array.isArray(e)&&v&&v(e,t)}),Xs)},modal:!h})]})}function Mw({title:e,disabled:n,children:i}){return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:12,opacity:n?.3:void 0},children:[z.jsx(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:600},children:e}),i]})}!function(e){e[e.depth=1]="depth",e[e.volume=2]="volume",e[e.feeRevenue=3]="feeRevenue",e[e.traders=4]="traders"}(sw||(sw={})),function(e){e[e.parameters=1]="parameters",e[e.swaps=2]="swaps",e[e.liquidityProviders=3]="liquidityProviders"}(lw||(lw={}));const Rw=1e-4;function Ow({disabled:i,fee:o,onChange:r,feeList:a,hasCustom:l}){const d=t.useTheme(),[c,u]=n.useState(!1),[p,h]=n.useState(!1),[m,x]=n.useState(""),{isMobile:g}=Xa(),f=!a.includes(o),y=f||p,v=!p&&f&&!!m&&new s(m).div(100).lt(Rw),b=i||v;return z.jsxs(t.Box,{sx:{opacity:i?.3:void 0,fontWeight:600},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:12,borderWidth:1,borderRadius:12,borderStyle:"solid",borderColor:"border.main"},children:[z.jsx(e.Trans,{id:"tMMG40",message:"{0}% fee tier",values:{0:o?new s(o).times(100).toString():"-"}}),z.jsx(t.ButtonBase,{sx:{px:16,py:7,border:`solid 1px ${d.palette.text.primary}`,borderRadius:8,fontWeight:600,color:"text.primary",cursor:b?"default":"pointer",opacity:v?.3:1},disabled:b,onClick:()=>{b||u((e=>!e))},children:c?z.jsx(e.Trans,{id:"vLyv1R",message:"Hide"}):z.jsx(e.Trans,{id:"ePK91l",message:"Edit"})})]}),c&&z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:Object.assign({mt:12},g?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8,"& > label":{flex:1}}),children:[a.map((e=>{const n=o===e&&!y;return z.jsxs(t.Box,{component:"label",sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderRadius:12,borderStyle:"solid",borderColor:"border.main",cursor:"pointer"},n&&{color:d.palette.primary.main,borderColor:d.palette.primary.main}),children:[100*e,"%",z.jsx(t.Radio,{size:18,checked:n,onChange:(t,n)=>{n&&r(e)}})]},e)})),l&&z.jsxs(t.Box,{component:"label",sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderRadius:12,borderStyle:"solid",borderColor:"border.main",cursor:"pointer",color:v?d.palette.error.main:"text.primary"},y&&{color:d.palette.primary.main,borderColor:d.palette.primary.main}),onClick:()=>{h(!0),x("")},children:[p?z.jsx(t.Input,{value:m,autoFocus:!0,onChange:e=>{const t=e.target.value;isNaN(Number(t))||x(t)},onBlur:()=>{const e=Number(m),t=e?new s(e).div(100).toNumber():e;t&&t<Rw?r(0):m&&(e||0===e)&&r(t),h(!1)},sx:{p:0,flex:1,height:"100%",border:"none",backgroundColor:"none"},inputSx:{p:0}}):z.jsx(z.Fragment,{children:f?(new s(o).times(100).toNumber()||m)+"%":z.jsx(e.Trans,{id:"8Tg/JR",message:"Custom"})}),z.jsx(t.Radio,{size:18,checked:y,sx:{flexShrink:0}})]})]}),v&&z.jsxs(t.Box,{sx:{mt:12,display:"flex",alignItems:"center",gap:8,p:8,borderRadius:8,typography:"h6",backgroundColor:t.alpha(d.palette.error.main,.1),color:d.palette.error.main},children:[z.jsx(t.Box,{component:oe.ErrorBorder,sx:{width:18,height:18}}),z.jsx(e.Trans,{id:"LHxwaD",message:"The fee tier should greater than {0}%",values:{0:100*Rw}})]})]})]})}function Pw({isExists:i,pair:o,pairAddress:r}){var a,l,d;const{isBalanceLoading:u,isDepositedLoading:h,balance:m,token0Deposited:x,token1Deposited:g,poolTokenPercentage:f}=function({pairAddress:e,pair:t}){var i;const{account:o}=Pa(),r=null===(i=null==t?void 0:t.liquidityToken)||void 0===i?void 0:i.chainId,a=c.useQuery(Object.assign(Object.assign({},p.getFetchUniswapV2PairBalanceOfQueryOptions(r,e,o)),{retry:!1})),l=c.useQuery(Object.assign(Object.assign({},p.getFetchUniswapV2PairTotalSupplyQueryOptions(r,e)),{retry:!1})),[d,u,h]=n.useMemo((()=>{if(!t||!a.data||!l.data||l.data<a.data)return[void 0,void 0,void 0];const e=L.CurrencyAmount.fromRawAmount(t.liquidityToken,l.data.toString()),n=L.CurrencyAmount.fromRawAmount(t.liquidityToken,a.data.toString());return[new L.Percent(a.data.toString(),l.data.toString()),t.getLiquidityValue(t.token0,e,n,!1),t.getLiquidityValue(t.token1,e,n,!1)]}),[a.data,l.data,t]);return{isBalanceLoading:a.isLoading,isDepositedLoading:a.isLoading||l.isLoading,balance:a.data&&t?lr(a.data.toString(),t.liquidityToken.decimals):void 0,poolTokenPercentage:d?new s(d.toSignificant(6)):void 0,token0Deposited:u?new s(u.toSignificant()):void 0,token1Deposited:h?new s(h.toSignificant()):void 0}}({pairAddress:r,pair:o}),y=f?`${nr({input:f,showDecimals:2,roundingMode:s.ROUND_HALF_UP})}%`:void 0;return i&&o?z.jsxs(t.Box,{sx:{px:20,py:12,borderWidth:1,borderRadius:8,borderStyle:"solid",borderColor:"border.main"},children:[z.jsx(t.Box,{sx:{typography:"h6",color:"text.secondary"},children:z.jsx(e.Trans,{id:"YHc3B+",message:"My Liquidity"})}),z.jsxs(t.Box,{sx:{mt:12,display:"flex",alignItems:"center"},children:[z.jsx(Pp,{width:18,height:18,tokens:[o.token0,o.token1],mr:4}),z.jsx(t.LoadingSkeleton,{loading:u,loadingProps:{width:50},sx:{mr:4},children:ir({input:m,decimals:null===(a=o.liquidityToken)||void 0===a?void 0:a.decimals})}),`${o.token0.symbol}/${o.token1.symbol} LP`,z.jsx(t.Tooltip,{title:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:10,typography:"body2",color:"text.primary"},children:[z.jsx(Sf,{address:o.token0.address,chainId:o.token0.chainId,showName:null!==(l=o.token0.symbol)&&void 0!==l?l:"",size:14,offset:4,rightContent:z.jsx(t.LoadingSkeleton,{loading:h,loadingProps:{width:50},children:ir({input:x,decimals:o.token0.decimals})})}),z.jsx(Sf,{address:o.token1.address,chainId:o.token1.chainId,showName:null!==(d=o.token1.symbol)&&void 0!==d?d:"",size:14,offset:4,rightContent:z.jsx(t.LoadingSkeleton,{loading:h,loadingProps:{width:50},children:ir({input:g,decimals:o.token1.decimals})})}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsx(e.Trans,{id:"c4miqE",message:"Pool share"}),z.jsx(t.LoadingSkeleton,{loading:h,loadingProps:{width:50},children:y})]})]}),sx:{padding:20,width:256},children:z.jsx(t.HoverOpacity,{component:oe.DetailBorder,sx:{ml:4,width:16,height:16,cursor:"pointer"}})}),z.jsx(t.Box,{component:"a",target:"_blank",rel:"noopener noreferrer",href:Ia(o.liquidityToken.chainId,o.liquidityToken.address,"address"),sx:{ml:4,display:"inline-flex",height:16},children:z.jsx(t.HoverOpacity,{component:oe.ArrowTopRightBorder,sx:{width:16,height:16}})})]})]}):null}function _w({sx:i,disabled:o,slippage:r,onChangeSlippage:a}){const l=t.useTheme(),d=r===fm,[c,u]=n.useState(d?"":new s(r).times(100).toNumber());return z.jsx(t.Tooltip,{disabled:o,onlyClick:!0,title:z.jsxs(t.Box,{sx:{backgroundColor:l.palette.background.paper,padding:l.spacing(16,20),borderRadius:16,width:375,maxWidth:"90vw",boxSizing:"border-box"},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.primary"},children:[z.jsx("span",{children:z.jsx(e.Trans,{id:"lqTDfd",message:"Slippage Tolerance"})}),z.jsxs("span",{children:[d?vm:r&&new s(r).times(100).toNumber(),"%"]})]}),z.jsxs(t.Box,{sx:{mt:16,display:"flex",alignItems:"center",margin:l.spacing(16,0,0,0)},children:[z.jsx(gm,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{u(""),a(fm)},active:d}),z.jsx(t.Input,{placeholder:String(vm),value:c,onChange:e=>{const{value:t}=e.target;u(t),a(t?new s(t).div(100).toNumber():fm)},onBlur:()=>{(!d&&new s(r).gt(.1)||new s(r).lte(0))&&(u(10),a(.1))},suffix:z.jsx(t.Box,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:z.jsx(t.HoverAddBackground,{sx:Object.assign({width:"max-content",alignItems:"right",margin:l.spacing(0,0,0,"auto"),p:l.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast",cursor:"pointer"},i),children:z.jsx(t.Box,{component:oe.Setting,sx:{width:18,height:18,"& path:last-child":{fill:l.palette.text.primary}}})})})}function Dw(){var i,o,a;const l=t.useTheme(),[d,c]=n.useState(.003),[u,h]=n.useState(),[m,x]=n.useState(),[g,f]=n.useState(""),[y,v]=n.useState(""),[b,C]=n.useState(fm),j=b===fm?new s(vm).div(100).toNumber():b,{isMobile:w}=Xa(),{onlyChainId:k}=Q(),T=n.useMemo((()=>k||(null==u?void 0:u.chainId)||(null==m?void 0:m.chainId)),[k,u,m]),{pairAddress:B,pair:E,price:I,isInvalidPair:A,invertedPrice:S,priceLoading:M,liquidityMinted:R,shareOfPool:O,isExists:P}=function({baseToken:e,quoteToken:t,baseAmount:i,quoteAmount:o,fee:a}){const[s,l,d]=n.useMemo((()=>{var n,i;if(!e||!t)return[null,null,!1];const o=r.basicTokenMap[e.chainId],a=(null===(n=o.address)||void 0===n?void 0:n.toLowerCase())===e.address.toLowerCase(),s=(null===(i=o.address)||void 0===i?void 0:i.toLowerCase())===t.address.toLowerCase(),l=a?o.wrappedTokenAddress:e.address,d=s?o.wrappedTokenAddress:t.address,c=l.toLowerCase()===d.toLowerCase();return c?[null,null,!0]:[new L.Token(e.chainId,l,e.decimals,e.symbol,e.name),new L.Token(t.chainId,d,t.decimals,t.symbol,t.name),c]}),[e,t]),c=n.useMemo((()=>{if(!s||!l||void 0===a)return;const e=s.chainId,t=e?p.getUniswapV2FactoryContractAddressByChainId(e)||p.getUniswapV2FactoryFixedFeeContractAddressByChainId(e):void 0;return t?Aa({factoryAddress:t,tokenA:s,tokenB:l,fee:a}):void 0}),[s,l,a]),{pair:u,price:h,invertedPrice:m,reserveQuery:x,liquidityMinted:g,shareOfPool:f,isExists:y}=py({pool:e&&t&&c?{baseToken:e,quoteToken:t,type:"AMMV2",address:c}:void 0,baseAmount:i,quoteAmount:o});return{pairAddress:c,pair:u,isInvalidPair:d,price:h,invertedPrice:m,priceLoading:x.isLoading,liquidityMinted:g,shareOfPool:f,isExists:y}}({baseToken:u,quoteToken:m,baseAmount:g,quoteAmount:y,fee:d}),_=qm(I);if(I&&g&&!I.isEqualTo(null!=_?_:0)&&P){const e=I.times(g).dp(null!==(i=null==m?void 0:m.decimals)&&void 0!==i?i:18);e.isEqualTo(y)||v(e.toString())}const D=T?p.getUniswapV2Router02ContractAddressByChainId(T)||p.getUniswapV2Router02FixedFeeContractAddressByChainId(T):void 0,N=Ms(u,{amount:g,contractAddress:D}),F=Ms(m,{amount:y,contractAddress:D}),[U,q]=n.useState(!1),V=!u||!m,W=ay({baseToken:u,quoteToken:m,baseAmount:g,quoteAmount:y,fee:d,isExists:P,slippage:j,successBack:()=>{pm.getState().push({type:exports.PageType.Pool,params:{tab:Qy.myLiquidity}})}});return n.useEffect((()=>{console.error("createMutation.error",W.error)}),[W.error]),z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:20,mx:16,pb:20,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"border.main",mb:20,[l.breakpoints.up("tablet")]:{width:600,mx:"auto"}},children:[z.jsx(av,{onClick:()=>{pm.getState().push({type:exports.PageType.Pool})}}),z.jsx(t.Box,{sx:{typography:"caption",fontWeight:600,color:"text.primary",mr:"auto"},children:z.jsx(e.Trans,{id:"E6MqGy",message:"Add liquidity"})}),z.jsx(vg,{poolType:"AMM V2"})]}),z.jsxs(t.Box,{sx:{pt:20,px:16,position:"relative",overflow:"hidden",backgroundColor:l.palette.background.paper,borderRadius:16,[l.breakpoints.up("tablet")]:{borderWidth:1,borderStyle:"solid",borderColor:"border.main",px:0,mx:"auto",width:600}},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:20,[l.breakpoints.up("tablet")]:{pt:20,px:20,pb:20}},children:[z.jsx(Pw,{pair:E,pairAddress:B,isExists:P}),z.jsxs(Mw,{title:z.jsx(e.Trans,{id:"nxRg31",message:"Select pair"}),children:[z.jsxs(t.Box,{sx:{display:"grid",gridTemplateColumns:w?"repeat(1, 1fr)":"repeat(2, 1fr)",gap:12},children:[z.jsx(Lw,{border:!0,highlightDefault:!0,chainId:T,token:u,onTokenChange:(e,t)=>{t?(h(m),x(u),f(""),v("")):(h(e),f(""))},occupiedToken:m}),z.jsx(Lw,{border:!0,highlightDefault:!0,chainId:T,token:m,onTokenChange:(e,t)=>{t?(h(m),x(u)):(x(e),v(""))},occupiedToken:u})]}),(!T||ka(T))&&z.jsx(Ow,{fee:d,onChange:c,feeList:[1e-4,5e-4,.003],hasCustom:!0,disabled:V})]}),z.jsx(Mw,{title:z.jsx(e.Trans,{id:"MU9s7M",message:"Deposit amounts"}),disabled:V,children:z.jsxs(t.Box,{children:[z.jsx(kp,{sx:{mb:4,pb:28,minHeight:"auto",backgroundColor:"background.cardInput",padding:l.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"},token:u,amt:g,defaultLoadBalance:!0,onInputChange:e=>{var t;f(e);const n=Number(e);P&&I&&n&&v(I.times(e).dp(null!==(t=null==m?void 0:m.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(o=null==m?void 0:m.address)&&void 0!==o?o:""],occupiedChainId:null==m?void 0:m.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:V}),z.jsx(jp,{}),z.jsx(kp,{sx:{pb:20,minHeight:"auto",backgroundColor:"background.cardInput",padding:l.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"},token:m,amt:y,defaultLoadBalance:!0,onInputChange:e=>{var t;v(e);const n=Number(e);P&&S&&n&&f(S.times(e).dp(null!==(t=null==u?void 0:u.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(a=null==u?void 0:u.address)&&void 0!==a?a:""],occupiedChainId:null==u?void 0:u.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:V}),z.jsx(_w,{slippage:b,onChangeSlippage:C,disabled:V,sx:{mt:8}}),z.jsx(Jf,{baseToken:u,quoteToken:m,loading:M,midPrice:I,shareOfPool:O}),!!P&&z.jsxs(t.Box,{sx:{mt:20,p:20,borderRadius:16,backgroundColor:"background.paperContrast",typography:"h6",textAlign:"center","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",z.jsx("b",{children:z.jsx(e.Trans,{id:"e38JNU",message:"Tips:"})})," ",z.jsx(e.Trans,{id:"1ABiXc",message:"By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity.",values:{0:gr({input:d})},components:{0:z.jsx("b",{})}})]})]})})]}),z.jsx(t.Box,{sx:{mt:20,py:16,[l.breakpoints.up("tablet")]:{px:20}},children:z.jsx(Im,{fullWidth:!0,includeButton:!0,size:t.Button.Size.big,disabled:V,chainId:T,children:z.jsx(Sw,{statuses:[N,F],buttonProps:{size:t.Button.Size.big},children:z.jsx(t.Button,{fullWidth:!0,size:t.Button.Size.big,disabled:!(u&&m&&g&&y&&!A&&d),onClick:()=>q(!0),children:A?z.jsx(e.Trans,{id:"R7D79P",message:"Invalid pair"}):z.jsx(e.Trans,{id:"bwSQI0",message:"Supply"})})})})}),z.jsx(ey,{open:U,onClose:()=>q(!1),slippage:j,baseToken:u,baseAmount:g,quoteToken:m,quoteAmount:y,fee:d,price:I,lpAmount:R,shareOfPool:O,pairAddress:B,createMutation:W})]})]})}const Nw=({disabled:e,feeAmount:i,dispatch:r})=>{const a=t.useTheme(),{isMobile:s}=Xa(),[l,d]=n.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderStyle:"solid",borderColor:a.palette.border.main,borderRadius:12},e?{opacity:.3}:void 0),children:[z.jsx(t.Box,{sx:{typography:"h5",color:a.palette.text.primary},children:i?`${yg[i].label} ${o.i18n._({id:"fxRyGG",message:"fee tier"})}`:o.i18n._({id:"EU3wU4",message:"Fee tier"})}),z.jsx(t.Button,{size:t.Button.Size.small,variant:t.Button.Variant.outlined,disabled:e,onClick:()=>d((e=>!e)),sx:{color:a.palette.text.primary,border:`solid 1px ${a.palette.text.primary}`},children:l?o.i18n._({id:"vLyv1R",message:"Hide"}):o.i18n._({id:"ePK91l",message:"Edit"})})]}),l&&z.jsx(t.Box,{sx:Object.assign({},s?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8}),children:[gx.LOWEST,gx.LOW,gx.MEDIUM,gx.HIGH].map((n=>{const o=i===n;return z.jsxs(t.Button,{size:t.Button.Size.middle,variant:t.Button.Variant.outlined,disabled:e,onClick:()=>{r({type:Dg.UpdateFeeAmount,payload:n})},sx:{flexBasis:"50%",flexShrink:1,flexGrow:1,justifyContent:"space-between",px:20,color:o?a.palette.primary.main:a.palette.text.primary,borderRadius:12,borderColor:o?a.palette.primary.main:a.palette.border.main,[a.breakpoints.up("tablet")]:{flexBasis:"25%"}},children:[yg[n].label,o?z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[z.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:a.palette.primary.main}),z.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:a.palette.primary.main,stroke:a.palette.primary.main})]}):z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:z.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:a.palette.text.secondary})})]},n)}))})]})},Fw={neutral1:"#222222",neutral2:"#7D7D7D",accent1:"#FC72FF",critical:"FF5F52",white:"#FFFFFF",surface3:"#22222212",opacity:{hover:.6,click:.4,disabled:.5,enabled:1}},Uw=({series:e,xScale:i,yScale:o,xValue:r,yValue:a,fill:s})=>n.useMemo((()=>{var n;return z.jsx(t.Box,{component:"path",opacity:.5,stroke:null!=s?s:Fw.accent1,fill:null!=s?s:Fw.accent1,d:null!==(n=R.area().curve(R.curveStepAfter).x((e=>i(r(e)))).y1((e=>o(a(e)))).y0(o(0))(e.filter((e=>{const t=i(r(e));return t>0&&t<=window.innerWidth}))))&&void 0!==n?n:void 0})}),[s,e,i,r,o,a]),qw=({axisGenerator:e})=>z.jsx("g",{ref:t=>{t&&R.select(t).call(e).call((e=>e.select(".domain").remove()))}}),Vw=({xScale:e,innerHeight:i,offset:o=0})=>n.useMemo((()=>z.jsx(t.Box,{component:"g",transform:`translate(0, ${i+o})`,sx:{"& line":{display:"none"},"& text":{color:Fw.neutral2,transform:"translateY(5px)"}},children:z.jsx(qw,{axisGenerator:R.axisBottom(e).ticks(6)})})),[i,o,e]),Ww=e=>["M 0 0",`v ${e}`,"m 1 0","V 0","M 0 1","h 12","q 2 0, 2 2","v 22","q 0 2 -2 2","h -12","z"].join(" "),Hw=()=>["m 5 7","v 14","M 0 0","m 9 7","v 14","z"].join(" "),Zw=({color:e,size:t=10,margin:n=10})=>z.jsx("polygon",{points:`0 0, ${t} ${t}, 0 ${t}`,transform:` translate(${t+n}, ${n}) rotate(45) `,fill:e,stroke:e,strokeWidth:"4",strokeLinejoin:"round"});const zw=({color:e,d:n})=>z.jsx(t.Box,{component:"path",cursor:"ew-resize",pointerEvents:"none",strokeWidth:3,stroke:e,fill:e,d:n}),$w=({d:e})=>z.jsx(t.Box,{component:"path",cursor:"ew-resize",pointerEvents:"none",stroke:Fw.white,opacity:Fw.opacity.hover,d:e}),Gw=({visible:e,transform:n,children:i})=>z.jsx(t.Box,{component:"g",opacity:e?"1":"0",transform:n,sx:{transition:"opacity 300ms"},children:i}),Qw=({y:e,x:n,height:i,width:o,rx:r})=>z.jsx(t.Box,{component:"rect",fill:Fw.surface3,y:e,x:n,height:i,width:o,rx:r}),Yw=({y:e,transform:n,dominantBaseline:i,children:o})=>z.jsx(t.Box,{component:"text",y:e,textAnchor:"middle",fontSize:"13px",fill:Fw.neutral1,transform:n,dominantBaseline:i,children:o}),Xw=(e,t,n)=>{const i=e.map((e=>n(e).toFixed(1))),o=t.map((e=>n(e).toFixed(1)));return i.every(((e,t)=>e===o[t]))},Kw=({id:e,xScale:t,interactive:i,brushLabelValue:o,brushExtent:r,setBrushExtent:a,innerWidth:s,innerHeight:l,westHandleColor:d,eastHandleColor:c})=>{const u=n.useRef(null),p=n.useRef(null),[h,m]=n.useState(r),[x,g]=n.useState(!1),[f,y]=n.useState(!1),v=function(e){const t=n.useRef();return n.useEffect((()=>{t.current=e}),[e]),t.current}(r),b=n.useCallback((e=>{const{type:n,selection:i,mode:o}=e;if(!i)return void m(null);const s=i.map(t.invert);"end"!==n||Xw(r,s,t)||a(s,o),m(s)}),[t,r,a]);n.useEffect((()=>{m(r)}),[r]),n.useEffect((()=>{u.current&&(p.current=R.brushX().extent([[Math.max(2,t(0)),0],[s-2,l]]).handleSize(30).filter((()=>i)).on("brush end",b),p.current(R.select(u.current)),v&&Xw(r,v,t)&&R.select(u.current).transition().call(p.current.move,r.map(t)),R.select(u.current).selectAll(".selection").attr("stroke","none").attr("fill-opacity","0.1").attr("fill",`url(#${e}-gradient-selection)`))}),[r,b,e,l,s,i,v,t]),n.useEffect((()=>{u.current&&p.current&&p.current.move(R.select(u.current),r.map(t))}),[r,t]),n.useEffect((()=>{g(!0);const e=setTimeout((()=>g(!1)),1500);return()=>clearTimeout(e)}),[h]);const C=h&&t(h[0])>20,j=h&&t(h[1])>s-20,w=h&&(t(h[0])<0||t(h[1])<0),k=h&&(t(h[0])>s||t(h[1])>s),T=h&&t(h[0])>=0&&t(h[0])<=s,B=h&&t(h[1])>=0&&t(h[1])<=s;return n.useMemo((()=>z.jsxs(z.Fragment,{children:[z.jsxs("defs",{children:[z.jsxs("linearGradient",{id:`${e}-gradient-selection`,x1:"0%",y1:"100%",x2:"100%",y2:"100%",children:[z.jsx("stop",{stopColor:d}),z.jsx("stop",{stopColor:c,offset:"1"})]}),z.jsx("clipPath",{id:`${e}-brush-clip`,children:z.jsx("rect",{x:"0",y:"0",width:s,height:l})})]}),z.jsx("g",{ref:u,clipPath:`url(#${e}-brush-clip)`,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}),h&&z.jsxs(z.Fragment,{children:[T?z.jsxs("g",{transform:`translate(${Math.max(0,t(h[0]))}, 0), scale(${C?"-1":"1"}, 1)`,children:[z.jsxs("g",{children:[z.jsx(zw,{color:d,d:Ww(l)}),z.jsx($w,{d:Hw()})]}),z.jsxs(Gw,{transform:`translate(50,0), scale(${C?"1":"-1"}, 1)`,visible:x||f,children:[z.jsx(Qw,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),z.jsx(Yw,{transform:"scale(-1, 1)",y:"15",dominantBaseline:"middle",children:o("w",h[0])})]})]}):null,B?z.jsxs("g",{transform:`translate(${t(h[1])}, 0), scale(${j?"-1":"1"}, 1)`,children:[z.jsxs("g",{children:[z.jsx(zw,{color:c,d:Ww(l)}),z.jsx($w,{d:Hw()})]}),z.jsxs(Gw,{transform:`translate(50,0), scale(${j?"-1":"1"}, 1)`,visible:x||f,children:[z.jsx(Qw,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),z.jsx(Yw,{y:"15",dominantBaseline:"middle",children:o("e",h[1])})]})]}):null,w&&z.jsx(Zw,{color:d}),k&&z.jsx("g",{transform:`translate(${s}, 0) scale(-1, 1)`,children:z.jsx(Zw,{color:c})})]})]})),[o,c,B,j,C,f,e,l,s,h,k,x,w,d,T,t])},Jw=({value:e,xScale:i,innerHeight:o})=>n.useMemo((()=>z.jsx(t.Box,{component:"line",x1:i(e),y1:"0",x2:i(e),y2:o,sx:{opacity:.5,strokeWidth:2,stroke:Fw.neutral1,fill:"none"}})),[e,i,o]);function ek({svg:e,xScale:i,setZoom:o,width:r,height:a,resetBrush:s,showResetButton:l,zoomLevels:d}){const c=n.useRef(),[u,p,h,m]=n.useMemo((()=>[()=>e&&c.current&&R.select(e).transition().call(c.current.scaleBy,2),()=>e&&c.current&&R.select(e).transition().call(c.current.scaleBy,.5),()=>e&&c.current&&R.select(e).transition().call(c.current.scaleTo,.5),()=>e&&c.current&&R.select(e).call(c.current.transform,R.zoomIdentity.translate(0,0).scale(1)).transition().call(c.current.scaleTo,.5)]),[e]);return n.useEffect((()=>{e&&(c.current=R.zoom().scaleExtent([d.min,d.max]).extent([[0,0],[r,a]]).on("zoom",(({transform:e})=>o(e))),R.select(e).call(c.current))}),[a,r,o,e,i,c,d,d.max,d.min]),n.useEffect((()=>{h()}),[h,d]),z.jsxs(t.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${l?3:2}, 1fr)`,gridGap:"6px",position:"absolute",top:"-32px",right:0},children:[l&&z.jsx(t.Button,{size:t.Button.Size.small,sx:{borderRadius:16},onClick:()=>{s(),m()},disabled:!1,children:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[z.jsx("polyline",{points:"1 4 1 10 7 10"}),z.jsx("polyline",{points:"23 20 23 14 17 14"}),z.jsx("path",{d:"M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"})]})}),z.jsx(t.Button,{size:t.Button.Size.small,sx:{borderRadius:16},onClick:u,disabled:!1,children:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[z.jsx("circle",{cx:"11",cy:"11",r:"8"}),z.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),z.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),z.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),z.jsx(t.Button,{size:t.Button.Size.small,sx:{borderRadius:16},onClick:p,disabled:!1,children:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[z.jsx("circle",{cx:"11",cy:"11",r:"8"}),z.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),z.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})})]})}const tk=e=>e.price0,nk=e=>e.activeLiquidity;function ik({id:e="liquidityChartRangeInput",data:{series:i,current:o},ticksAtLimit:r,styles:a,dimensions:{width:s,height:l},margins:d,interactive:c=!0,brushDomain:u,brushLabels:p,onBrushDomainChange:h,zoomLevels:m}){const x=n.useRef(null),[g,f]=n.useState(null),[y,v]=n.useMemo((()=>[l-d.top-d.bottom,s-d.left-d.right]),[s,l,d]),{xScale:b,yScale:C}=n.useMemo((()=>{const e={xScale:R.scaleLinear().domain([o*m.initialMin,o*m.initialMax]).range([0,v]),yScale:R.scaleLinear().domain([0,R.max(i,nk)]).range([y,0])};if(g){const t=g.rescaleX(e.xScale);e.xScale.domain(t.domain())}return e}),[o,m.initialMin,m.initialMax,v,i,y,g]);return n.useEffect((()=>{f(null)}),[m]),n.useEffect((()=>{u||h(b.domain(),void 0)}),[u,h,b]),z.jsxs(z.Fragment,{children:[z.jsx(ek,{svg:x.current,xScale:b,setZoom:f,width:v,height:l,resetBrush:()=>{h([o*m.initialMin,o*m.initialMax],"reset")},showResetButton:Boolean(r[Em.LOWER]||r[Em.UPPER]),zoomLevels:m}),z.jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${s} ${l}`,style:{overflow:"visible"},children:[z.jsxs("defs",{children:[z.jsx("clipPath",{id:`${e}-chart-clip`,children:z.jsx("rect",{x:"0",y:"0",width:v,height:l})}),u&&z.jsx("mask",{id:`${e}-chart-area-mask`,children:z.jsx("rect",{fill:"white",x:b(u[0]),y:"0",width:b(u[1])-b(u[0]),height:y})})]}),z.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[z.jsxs("g",{clipPath:`url(#${e}-chart-clip)`,children:[z.jsx(Uw,{series:i,xScale:b,yScale:C,xValue:tk,yValue:nk}),u&&z.jsx("g",{mask:`url(#${e}-chart-area-mask)`,children:z.jsx(Uw,{series:i,xScale:b,yScale:C,xValue:tk,yValue:nk,fill:a.area.selection})}),z.jsx(Jw,{value:o,xScale:b,innerHeight:y}),z.jsx(Vw,{xScale:b,innerHeight:y})]}),z.jsx(t.Box,{component:"rect",width:v,height:l,ref:x,sx:{fill:"transparent",cursor:"grab","&:active":{cursor:"grabbing"}}}),z.jsx(Kw,{id:e,xScale:b,interactive:c,brushLabelValue:p,brushExtent:null!=u?u:b.domain(),innerWidth:v,innerHeight:y,setBrushExtent:h,westHandleColor:a.brush.handle.west,eastHandleColor:a.brush.handle.east})]})]})]})}const ok=8;function rk(e,t,n,i,o,r){var a,s,l,d,c;let u=Object.assign({},n),p=[];for(let n=o+(r?1:-1);r?n<i.length:n>=0;r?n++:n--){const o=Number(null===(a=i[n])||void 0===a?void 0:a.tickIdx),h=zx(e,t,o),m={liquidityActive:u.liquidityActive,tick:o,liquidityNet:E.BigInt(null!==(l=null===(s=i[n])||void 0===s?void 0:s.liquidityNet)&&void 0!==l?l:""),price0:h.toFixed(ok),sdkPrice:h};r?m.liquidityActive=E.add(u.liquidityActive,E.BigInt(null!==(c=null===(d=i[n])||void 0===d?void 0:d.liquidityNet)&&void 0!==c?c:0)):!r&&E.notEqual(u.liquidityNet,E.BigInt(0))&&(m.liquidityActive=E.subtract(u.liquidityActive,u.liquidityNet)),p.push(m),u=m}return r||(p=p.reverse()),p}const ak=8,sk=(e,t)=>e&&t?Math.floor(e/fx[t])*fx[t]:void 0,lk=1e3;function dk(e,t,i,o){const[a,s]=n.useState(0),[l,d]=n.useState([]),{data:u,error:p,isLoading:h}=function(e,t,n,i=0,o){var a;const s=qa(),l=e&&t&&n?Xx.getAddress(null==e?void 0:e.wrapped,null==t?void 0:t.wrapped,n,void 0,o?Zm[o]:void 0):void 0,d=s.getQuery(r.AMMV3Api.graphql.AllV3TicksDocument,{skip:i,first:lk,where:{chain:o?Si[o]:void 0,poolAddress:null!==(a=null==l?void 0:l.toLowerCase())&&void 0!==a?a:void 0,refreshNow:!0,schemaName:"ammv3"}});return c.useQuery(Object.assign(Object.assign({},d),{enabled:!0}))}(e,t,i,a,o),m=null==u?void 0:u.ticks;return n.useEffect((()=>{(null==m?void 0:m.length)&&(d((e=>[...e,...m])),(null==m?void 0:m.length)===lk&&s((e=>e+lk)))}),[m]),{isLoading:h||(null==m?void 0:m.length)===lk,error:p,ticks:l}}function ck({currencyA:e,currencyB:t,feeAmount:i}){const{isLoading:o,error:r,data:a}=function(e,t,i,o){var r,a,s;const{chainId:l}=Pa(),d=Bg(e,t,i),c=null===(r=d[1])||void 0===r?void 0:r.liquidity,u=null===(a=d[1])||void 0===a?void 0:a.sqrtRatioX96,p=null===(s=d[1])||void 0===s?void 0:s.tickCurrent,h=n.useMemo((()=>sk(p,i)),[p,i]),{isLoading:m,error:x,ticks:g}=dk(e,t,i,l);return n.useMemo((()=>{var n,i,o,r,a;if(!e||!t||void 0===h||d[0]!==Tg.EXISTS||!g||0===g.length||m)return{isLoading:m||d[0]===Tg.LOADING,error:x,activeTick:h,data:void 0};const s=null==e?void 0:e.wrapped,l=null==t?void 0:t.wrapped,f=g.findIndex((e=>(null==e?void 0:e.tickIdx)&&e.tickIdx>h))-1;if(f<0)return console.log("usePoolTickData","usePoolActiveLiquidity","TickData pivot not found",{token0:s.address,token1:l.address,chainId:s.chainId}),{isLoading:m,error:x,activeTick:h,data:void 0};const y=zx(s,l,h),v={liquidityActive:E.BigInt(null!==(i=null===(n=d[1])||void 0===n?void 0:n.liquidity)&&void 0!==i?i:0),tick:h,liquidityNet:Number(null===(o=g[f])||void 0===o?void 0:o.tickIdx)===h?E.BigInt(null!==(a=null===(r=g[f])||void 0===r?void 0:r.liquidityNet)&&void 0!==a?a:0):E.BigInt(0),price0:y.toFixed(ak),sdkPrice:y},b=rk(s,l,v,g,f,!0),C=rk(s,l,v,g,f,!1).concat(v).concat(b);return{isLoading:m,error:x,currentTick:p,activeTick:h,liquidity:c,sqrtPriceX96:u,data:C}}),[e,t,h,d,g,m,x,p,c,u])}(e,t,i),s=n.useCallback((()=>{if(!(null==a?void 0:a.length))return;const e=[];for(let t=0;t<a.length;t++){const n=a[t],i={activeLiquidity:parseFloat(n.liquidityActive.toString()),price0:parseFloat(n.price0)};i.activeLiquidity>0&&e.push(i)}return e}),[a]);return n.useMemo((()=>({isLoading:o,error:r,formattedData:o?void 0:s()})),[o,r,s])}const uk={initialMin:.999,initialMax:1.001,min:1e-5,max:1.5},pk={[gx.LOWEST]:uk,[gx.LOW_200]:uk,[gx.LOW_300]:uk,[gx.LOW_400]:uk,[gx.LOW]:uk,[gx.MEDIUM]:{initialMin:.5,initialMax:2,min:1e-5,max:20},[gx.HIGH]:{initialMin:.5,initialMax:2,min:1e-5,max:20}};function hk({message:e,icon:n}){return z.jsxs(Rm,{style:{height:"100%",justifyContent:"center"},children:[n,e&&z.jsx(t.Box,{sx:{mt:20,p:10,typography:"caption",textAlign:"center"},children:e})]})}function mk(){return z.jsx(t.LoadingSkeleton,{})}function xk({currencyA:i,currencyB:o,feeAmount:r,ticksAtLimit:a,price:s,priceLower:l,priceUpper:d,onLeftRangeInput:c,onRightRangeInput:u,interactive:p}){const h=i&&o&&(null==i?void 0:i.wrapped.sortsBefore(null==o?void 0:o.wrapped)),{isLoading:m,error:x,formattedData:g}=ck({currencyA:i,currencyB:o,feeAmount:r}),f=n.useCallback(((e,t)=>{let n=Number(e[0]);const i=Number(e[1]);n<=0&&(n=1/10**6),(!a[h?Em.LOWER:Em.UPPER]||"handle"===t||"reset"===t)&&n>0&&c(n.toFixed(6)),(!a[h?Em.UPPER:Em.LOWER]||"reset"===t)&&i>0&&i<1e35&&u(i.toFixed(6))}),[h,c,u,a]);p=p&&Boolean(null==g?void 0:g.length);const y=n.useMemo((()=>{const e=h?l:null==d?void 0:d.invert(),t=h?d:null==l?void 0:l.invert();return e&&t?[parseFloat(null==e?void 0:e.toSignificant(6)),parseFloat(null==t?void 0:t.toSignificant(6))]:void 0}),[h,l,d]),v=n.useCallback(((e,t)=>{if(!s)return"";if("w"===e&&a[h?Em.LOWER:Em.UPPER])return"0";if("e"===e&&a[h?Em.UPPER:Em.LOWER])return"∞";const n=(t<s?-1:1)*((Math.max(t,s)-Math.min(t,s))/s)*100;return s?`${ir({input:n,decimals:2})}%`:""}),[h,s,a]),b=!i||!o||void 0===g&&!m&&!x;return z.jsx(Om,{gap:"md",style:{minHeight:"200px"},children:b?z.jsx(hk,{message:z.jsx(e.Trans,{id:"OZUH85",message:"Your position will appear here."}),icon:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:Fw.neutral1,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[z.jsx("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),z.jsx("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})]})}):m?z.jsx(mk,{}):x?z.jsx(hk,{message:z.jsx(e.Trans,{id:"79D0qY",message:"Liquidity data not available."}),icon:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:Fw.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[z.jsx("path",{d:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3"}),z.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}):g&&0!==g.length&&s?z.jsx(t.Box,{sx:{position:"relative",width:"100%",maxHeight:"200px",justifyContent:"center",alignContent:"center"},children:z.jsx(ik,{data:{series:g,current:s},dimensions:{width:560,height:200},margins:{top:10,right:2,bottom:20,left:0},styles:{area:{selection:Fw.accent1},brush:{handle:{west:Fw.critical,east:Fw.accent1}}},interactive:p,brushLabels:v,brushDomain:y,onBrushDomainChange:f,zoomLevels:pk[null!=r?r:gx.MEDIUM],ticksAtLimit:a})}):z.jsx(hk,{message:z.jsx(e.Trans,{id:"rH6vg9",message:"There is no liquidity data."}),icon:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:Fw.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[z.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),z.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),z.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})})})}const gk=({value:i,decrement:o,increment:r,decrementDisabled:a=!1,incrementDisabled:s=!1,locked:l,onUserInput:d,title:c,tokenA:u,tokenB:p})=>{const h=t.useTheme(),[m,x]=n.useState(!1),[g,f]=n.useState(""),[y,v]=n.useState(!1),[b,C]=n.useState(!1),j=n.useCallback((()=>{v(!1),x(!1),d(g)}),[g,d]),w=n.useCallback((()=>{v(!1),d(o())}),[o,d]),k=n.useCallback((()=>{v(!1),d(r())}),[r,d]);return n.useEffect((()=>{g===i||y||setTimeout((()=>{f(i),C(!0),setTimeout((function(){C(!1)}),1800)}),0)}),[g,y,i]),z.jsx(t.Box,{onFocus:()=>{v(!0),x(!0)},onBlur:j,sx:{width:"100%",py:12,px:20,borderRadius:16,backgroundColor:h.palette.background.cardInput},children:z.jsxs(t.Box,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:h.palette.text.primary},children:c}),z.jsx(t.Box,{sx:{mt:4,typography:"h6",fontWeight:500,color:h.palette.text.secondary},children:z.jsx(e.Trans,{id:"1/LP4K",message:"{tokenB} per {tokenA}",values:{tokenB:p,tokenA:u}})}),z.jsx(Ju,{sx:{mt:12,backgroundColor:h.palette.background.cardInput},value:g,onChange:e=>{f(e)},readOnly:l})]}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:8},children:[!l&&z.jsx(t.Button,{size:t.Button.Size.small,onClick:k,disabled:s,sx:{px:4,backgroundColor:h.palette.background.paper,"&[disabled]":{cursor:"default"}},children:z.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("path",{d:"M14.25 9.75H9.75V14.25H8.25V9.75H3.75V8.25H8.25V3.75H9.75V8.25H14.25V9.75Z",fill:a?h.palette.text.disabled:h.palette.text.primary})})}),!l&&z.jsx(t.Button,{size:t.Button.Size.small,onClick:w,disabled:a,sx:{px:4,backgroundColor:h.palette.background.paper,"&[disabled]":{cursor:"default"}},children:z.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:z.jsx("rect",{x:"3.75",y:"8.25",width:"10.5",height:"1.5",fill:a?h.palette.text.disabled:h.palette.text.primary})})})]})]})})},fk=({priceLower:n,priceUpper:i,onLeftRangeInput:o,onRightRangeInput:r,getDecrementLower:a,getIncrementLower:s,getDecrementUpper:l,getIncrementUpper:d,currencyA:c,currencyB:u,feeAmount:p,ticksAtLimit:h})=>{var m,x,g,f;const y=null===(m=null!=c?c:void 0)||void 0===m?void 0:m.wrapped,v=null===(x=null!=u?u:void 0)||void 0===x?void 0:x.wrapped,b=y&&v&&y.sortsBefore(v),C=b?n:null==i?void 0:i.invert(),j=b?i:null==n?void 0:n.invert();return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[z.jsx(gk,{value:h[b?Em.LOWER:Em.UPPER]?"0":null!==(g=null==C?void 0:C.toSignificant(8))&&void 0!==g?g:"",onUserInput:o,decrement:b?a:d,increment:b?s:l,decrementDisabled:void 0===C||h[b?Em.LOWER:Em.UPPER],incrementDisabled:void 0===C||h[b?Em.LOWER:Em.UPPER],feeAmount:p,label:C?`${null==u?void 0:u.symbol}`:"-",title:z.jsx(e.Trans,{id:"uEoBVI",message:"Low price"}),tokenA:null==c?void 0:c.symbol,tokenB:null==u?void 0:u.symbol}),z.jsx(gk,{value:h[b?Em.UPPER:Em.LOWER]?"∞":null!==(f=null==j?void 0:j.toSignificant(8))&&void 0!==f?f:"",onUserInput:r,decrement:b?l:s,increment:b?d:a,incrementDisabled:void 0===j||h[b?Em.UPPER:Em.LOWER],decrementDisabled:void 0===j||h[b?Em.UPPER:Em.LOWER],feeAmount:p,label:j?`${null==u?void 0:u.symbol}`:"-",tokenA:null==c?void 0:c.symbol,tokenB:null==u?void 0:u.symbol,title:z.jsx(e.Trans,{id:"kAC8rT",message:"High price"})})]})};var yk;function vk(){return vk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vk.apply(null,arguments)}const bk=e=>P.createElement("svg",vk({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),yk||(yk=P.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},P.createElement("path",{id:"\\xE4\\xB8\\x89\\xE8\\xA7\\x92\\xE5\\xBD\\xA2",fillRule:"evenodd",clipRule:"evenodd",d:"M6.58398 12.376C6.78189 12.6728 7.21811 12.6728 7.41603 12.376L10.4818 7.77735C10.7033 7.44507 10.4651 7 10.0657 7H3.93426C3.53491 7 3.29672 7.44507 3.51823 7.77735L6.58398 12.376Z",fill:"currentColor"}))));function Ck({token:e,oppositeTokenAddress:i,dispatch:r,tokenSelectOnChange:a}){const s=t.useTheme(),{chainId:l}=Pa(),[d,c]=n.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{component:t.ButtonBase,sx:{flexBasis:"100%",flexGrow:1,flexShrink:1,display:"flex",alignItems:"center",px:20,py:8,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:e?s.palette.border.main:s.palette.primary.main,color:e?s.palette.text.primary:s.palette.primary.contrastText,backgroundColor:e?"transparent":s.palette.primary.main,"&:hover":{borderColor:e?s.palette.border.main:s.palette.primary.main,opacity:.8},[s.breakpoints.up("tablet")]:{flexBasis:"50%"}},onClick:()=>{c(!0)},children:[e?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(sl,{address:e.address,marginRight:0,width:24,height:24,chainId:e.chainId||l,noShowChain:!0,sx:{flexShrink:0}}),z.jsx(t.Box,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:e.symbol})]}):z.jsx(t.Box,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:o.i18n._({id:"0RrIzN",message:"Select token"})}),z.jsx(t.Box,{component:bk,sx:{flexShrink:0,ml:"auto",width:18,height:18}})]}),z.jsx(pp,{value:Mg(e),open:d,chainId:l,occupiedAddrs:[i],occupiedChainId:null==e?void 0:e.chainId,onClose:()=>{c(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return r({type:Dg.UpdateBaseTokenAndClearQuoteToken,payload:e}),void c(!1);a(e),c(!1)}},modal:!0})]})}const jk=({baseToken:e,quoteToken:n,dispatch:i})=>{var o,r;const a=t.useTheme();return z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",[a.breakpoints.up("tablet")]:{flexWrap:"nowrap"}},children:[z.jsx(Ck,{token:e,oppositeTokenAddress:null!==(o=null==n?void 0:n.address)&&void 0!==o?o:"",dispatch:i,tokenSelectOnChange:e=>{i({type:Dg.UpdateBaseToken,payload:e})}}),z.jsx(Ck,{token:n,oppositeTokenAddress:null!==(r=null==e?void 0:e.address)&&void 0!==r?r:"",dispatch:i,tokenSelectOnChange:e=>{i({type:Dg.UpdateQuoteToken,payload:e})}})]})};const wk=[{value:.03,title:"Narrow"},{value:.08,title:"Standard"},{value:.15,title:"Wide"},{value:1,title:"Full"}],kk=e=>{const i=t.useTheme(),[o,r]=n.useState(null);return z.jsx(t.Box,{sx:{borderRadius:16,borderWidth:1,borderStyle:"solid",borderColor:i.palette.border.main,overflow:"hidden",display:"flex",alignItems:"center",flexWrap:"wrap",alignSelf:"stretch"},children:wk.map(((n,a)=>z.jsxs(t.Box,{component:t.ButtonBase,onClick:()=>{r(n.value),e.onSelect(n.value)},sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",px:20,py:12,gap:8,flexBasis:"50%",flexGrow:1,borderRight:a%2==0?`1px solid ${i.palette.border.main}`:"none",borderBottom:a<=1?`1px solid ${i.palette.border.main}`:"none",[i.breakpoints.up("tablet")]:{flexBasis:"25%",borderRight:a===wk.length-1?"none":`1px solid ${i.palette.border.main}`,borderBottom:"none"},backgroundColor:o===n.value?t.alpha("#7BF179",.1):"transparent","&:hover":{backgroundColor:t.alpha("#7BF179",.1)}},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:i.palette.text.primary},children:n.title}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:600,color:i.palette.text.primary},children:1===n.value?"∞":`+-${100*n.value}%`})]},n.value)))})};function Tk({params:i,handleGoBack:r,handleGoToPoolList:a}){var l,d,u,p,h,m,x,g,f,y;const{chainId:v,account:b}=Pa(),C=t.useTheme(),j=us(),{isMobile:w}=Xa(),k=c.useQuery(Object.assign({},Hi.getFetchTokenQuery(v,null==i?void 0:i.from,b))),T=c.useQuery(Object.assign({},Hi.getFetchTokenQuery(v,null==i?void 0:i.to,b))),[B,E]=n.useReducer(Ng,{baseToken:null,quoteToken:null,feeAmount:(null==i?void 0:i.fee)?Number(null==i?void 0:i.fee):void 0,independentField:Bm.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""});n.useEffect((()=>{k.data&&E({type:Dg.UpdateDefaultBaseToken,payload:k.data})}),[k]),n.useEffect((()=>{T.data&&E({type:Dg.UpdateDefaultQuoteToken,payload:T.data})}),[T]);const{independentField:I,typedValue:A,startPriceTypedValue:S}=B,{pool:L,ticks:M,dependentField:R,price:O,pricesAtTicks:P,pricesAtLimit:_,parsedAmounts:D,currencyBalances:F,position:U,noLiquidity:q,currencies:V,errorMessage:W,invalidPool:H,invalidRange:Z,outOfRange:$,depositADisabled:G,depositBDisabled:Y,invertPrice:X,ticksAtLimit:K,isTaxed:J}=_g({state:B}),ee=n.useMemo((()=>{var e;return null===(e=X?null==O?void 0:O.invert():O)||void 0===e?void 0:e.toSignificant()}),[X,O]),{onFieldAInput:te,onFieldBInput:ne,onLeftRangeInput:ie,onRightRangeInput:oe,onStartPriceInput:re}=Fg({noLiquidity:q,dispatch:E}),{slipper:ae,setSlipper:se,slipperValue:le,resetSlipper:de}=jm({address:void 0,type:"AMMV3"}),ce=!W&&!Z,[ue,pe]=n.useState(!1),he={[I]:A,[R]:null!==(d=null===(l=D[R])||void 0===l?void 0:l.toSignificant(6))&&void 0!==d?d:""},me=[Bm.CURRENCY_A,Bm.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:Wg(F[t])})),{}),xe=Ms(Mg(null===(u=D[Bm.CURRENCY_A])||void 0===u?void 0:u.currency),{contractAddress:zm[v],overrideBalance:F[Bm.CURRENCY_A]?new s(F[Bm.CURRENCY_A].toSignificant()):void 0,amount:D[Bm.CURRENCY_A]?new s(D[Bm.CURRENCY_A].toSignificant()):void 0}),ge=Ms(Mg(null===(p=D[Bm.CURRENCY_B])||void 0===p?void 0:p.currency),{contractAddress:zm[v],overrideBalance:F[Bm.CURRENCY_B]?new s(F[Bm.CURRENCY_B].toSignificant()):void 0,amount:D[Bm.CURRENCY_B]?new s(D[Bm.CURRENCY_B].toSignificant()):void 0}),{[Em.LOWER]:fe,[Em.UPPER]:ye}=M,{[Em.LOWER]:ve,[Em.UPPER]:be}=P,{getDecrementLower:Ce,getIncrementLower:je,getDecrementUpper:we,getIncrementUpper:ke,getSetFullRange:Te}=function({tickLower:e,tickUpper:t,pool:i,state:o,dispatch:r}){const{baseToken:a,quoteToken:s,feeAmount:l}=o,d=n.useMemo((()=>null==a?void 0:a.wrapped),[a]),c=n.useMemo((()=>null==s?void 0:s.wrapped),[s]);return{getDecrementLower:n.useCallback((()=>d&&c&&"number"==typeof e&&l?zx(d,c,e-fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):"number"!=typeof e&&d&&c&&l&&i?zx(d,c,i.tickCurrent-fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):""),[d,c,e,l,i]),getIncrementLower:n.useCallback((()=>d&&c&&"number"==typeof e&&l?zx(d,c,e+fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):"number"!=typeof e&&d&&c&&l&&i?zx(d,c,i.tickCurrent+fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):""),[d,c,e,l,i]),getDecrementUpper:n.useCallback((()=>d&&c&&"number"==typeof t&&l?zx(d,c,t-fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):"number"!=typeof t&&d&&c&&l&&i?zx(d,c,i.tickCurrent-fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):""),[d,c,t,l,i]),getIncrementUpper:n.useCallback((()=>d&&c&&"number"==typeof t&&l?zx(d,c,t+fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):"number"!=typeof t&&d&&c&&l&&i?zx(d,c,i.tickCurrent+fx[l]).toSignificant(5,void 0,Gm.ROUND_UP):""),[d,c,t,l,i]),getSetFullRange:n.useCallback((()=>{r({type:Dg.setFullRange,payload:void 0})}),[r])}}({tickLower:fe,tickUpper:ye,pool:L,state:B,dispatch:E}),Be=n.useCallback((e=>{if(Te(),1!==e){if(ee){const t=new s(ee),n=t.multipliedBy(1-e),i=t.multipliedBy(1+e);ie(n.dp(5,s.ROUND_DOWN).toString()),oe(i.dp(5,s.ROUND_DOWN).toString())}return}const t=_[Em.LOWER];t&&ie(t.toSignificant(5));const n=_[Em.UPPER];n&&oe(n.toSignificant(5))}),[ee,Te,ie,oe,_]),{deadLine:Ee}=Q(),Ie=c.useMutation({mutationFn:()=>N(this,void 0,void 0,(function*(){if(!b||!v||!U)return;if(!B.baseToken||!B.quoteToken)return;const e=Math.ceil(Date.now()/1e3)+(null!=Ee?Ee:600),t=B.baseToken.isNative?B.baseToken:B.quoteToken.isNative?B.quoteToken:void 0;try{const{calldata:n,value:i}=dg.addCallParameters(U,{slippageTolerance:zg(100*le),recipient:b,deadline:e.toString(),useNative:t,createPool:q});let r={to:zm[v],data:n,value:i};(yield j.execute(o.i18n._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:rs.TX},r),{early:!1,metadata:{[exports.MetadataFlag.createAMMV3Pool]:"1"}}))===es.Success&&setTimeout((()=>{a()}),100)}catch(e){console.error("onAddMutation",e)}}))});return z.jsxs(z.Fragment,{children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:20,mx:16,pb:20,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"border.main",mb:20,[C.breakpoints.up("tablet")]:{width:600,mx:"auto"}},children:[z.jsx(av,{}),z.jsx(t.Box,{sx:{typography:"caption",fontWeight:600,color:"text.primary",mr:"auto"},children:z.jsx(e.Trans,{id:"E6MqGy",message:"Add liquidity"})}),z.jsx(vg,{poolType:"AMM V3"})]}),z.jsxs(t.Box,{sx:{px:16,display:"flex",flexDirection:"column",alignItems:"stretch",backgroundColor:C.palette.background.paper,borderRadius:16,[C.breakpoints.up("tablet")]:{borderColor:C.palette.border.main,borderWidth:1,borderStyle:"solid",px:0,mx:"auto",width:600}},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:20,py:20,[C.breakpoints.up("tablet")]:{px:20}},children:[z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:C.palette.text.primary,textAlign:"left"},children:o.i18n._({id:"nxRg31",message:"Select pair"})}),z.jsx(jk,{baseToken:B.baseToken,quoteToken:B.quoteToken,dispatch:E}),z.jsx(Nw,{disabled:!B.baseToken||!B.quoteToken,feeAmount:B.feeAmount,dispatch:E})]}),z.jsxs(Nm,{disabled:!B.feeAmount||H,children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:C.palette.text.primary,textAlign:"left"},children:o.i18n._({id:"5CZbyC",message:"Set price range"})}),Boolean(B.baseToken&&B.quoteToken)&&z.jsx(xg,{baseToken:B.baseToken,quoteToken:B.quoteToken,handleRateToggle:()=>{var e,t,n,i,o;K[Em.LOWER]||K[Em.UPPER]||(ie(null!==(t=null===(e=X?ve:null==be?void 0:be.invert())||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""),oe(null!==(i=null===(n=X?be:null==ve?void 0:ve.invert())||void 0===n?void 0:n.toSignificant(6))&&void 0!==i?i:""),te(null!==(o=he[Bm.CURRENCY_B])&&void 0!==o?o:"")),E({type:Dg.ToggleRate,payload:void 0})},sx:w?{flexGrow:0,flexShrink:1,flexBasis:"50%"}:void 0})]}),z.jsx(kk,{onSelect:Be}),z.jsx(fk,{priceLower:ve,priceUpper:be,getDecrementLower:Ce,getIncrementLower:je,getDecrementUpper:we,getIncrementUpper:ke,onLeftRangeInput:ie,onRightRangeInput:oe,currencyA:B.baseToken,currencyB:B.quoteToken,feeAmount:B.feeAmount,ticksAtLimit:K}),$&&z.jsx(Mm,{children:o.i18n._({id:"b+KjnH",message:"Your position will not earn fees or be used in trades until the market price moves into your range."})}),Z&&z.jsx(Mm,{children:o.i18n._({id:"Jh223O",message:"Invalid range selected. The min price must be lower than the max price."})})]}),q?z.jsxs(Nm,{children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:C.palette.text.primary,textAlign:"left"},children:o.i18n._({id:"zeSosD",message:"Starting price"})}),z.jsx(t.Box,{sx:{p:8,borderRadius:8,backgroundColor:t.alpha(C.palette.primary.main,.1),typography:"h6",color:C.palette.primary.main},children:o.i18n._({id:"X6T02b",message:"This pool must be initialized before you can add liquidity. To initialize, select a starting price for the pool. Then, enter your liquidity price range and deposit amount. Gas fees will be higher than usual due to the initialization transaction."})}),z.jsx(t.Box,{sx:{px:16,py:12,borderRadius:8,borderWidth:1,borderColor:C.palette.border.main,borderStyle:"solid"},children:z.jsx(Ju,{sx:{backgroundColor:"transparent"},value:S,onChange:re})})]}):z.jsxs(Nm,{disabled:!B.feeAmount||H,children:[z.jsxs(t.Box,{sx:{typography:"body1",fontWeight:600,color:C.palette.text.primary,textAlign:"left"},children:[o.i18n._({id:"DWd30U",message:"Current price"}),z.jsxs(t.Box,{children:[ee," ",o.i18n._({id:"b2jAb+",message:"per"})," ",null!==(m=null===(h=B.baseToken)||void 0===h?void 0:h.symbol)&&void 0!==m?m:""]})]}),z.jsx(xk,{currencyA:null!==(x=B.baseToken)&&void 0!==x?x:void 0,currencyB:null!==(g=B.quoteToken)&&void 0!==g?g:void 0,feeAmount:B.feeAmount,ticksAtLimit:K,price:O?parseFloat((X?O.invert():O).toSignificant(8)):void 0,priceLower:ve,priceUpper:be,onLeftRangeInput:ie,onRightRangeInput:oe,interactive:!0})]}),z.jsxs(Nm,{disabled:H||Z||q&&!S,children:[z.jsx(t.Box,{sx:{typography:"body1",fontWeight:600,color:C.palette.text.primary,textAlign:"left"},children:o.i18n._({id:"MU9s7M",message:"Deposit amounts"})}),z.jsxs(t.Box,{children:[z.jsx(Hm,{value:he[Bm.CURRENCY_A],onUserInput:te,maxAmount:me[Bm.CURRENCY_A],balance:F[Bm.CURRENCY_A],currency:null!==(f=V[Bm.CURRENCY_A])&&void 0!==f?f:null,locked:G}),z.jsx(jp,{}),z.jsx(Hm,{value:he[Bm.CURRENCY_B],onUserInput:ne,maxAmount:me[Bm.CURRENCY_B],balance:F[Bm.CURRENCY_B],currency:null!==(y=V[Bm.CURRENCY_B])&&void 0!==y?y:null,locked:Y})]}),z.jsx(wm,{value:ae,onChange:se,disabled:!1,type:"AMMV3"})]})]}),z.jsx(t.Box,{sx:{display:"flex",alignItems:"center",py:16,[C.breakpoints.up("tablet")]:{px:20,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:C.palette.background.paper}},children:z.jsx(Fm,{chainId:v,approvalA:xe,approvalB:ge,parsedAmounts:D,isValid:ce,depositADisabled:G,depositBDisabled:Y,errorMessage:W,setShowConfirm:pe})}),z.jsx(wg,{parsedAmounts:D,position:U,existingPosition:void 0,priceLower:ve,priceUpper:be,outOfRange:$,ticksAtLimit:K,on:ue,onClose:()=>{pe(!1)},onConfirm:Ie.mutate,loading:Ie.isPending})]})]})}const Bk=["#154618","#ED4A25","#0E794D","#F7A33E","#582969","#DFCC28","#294369","#1D1D1D"],Ek=({poolDetail:e,tokenBalances:i})=>{const o=t.useTheme(),r=n.useMemo((()=>{if(!e)return[];if(!i)return[];const t=i.reduce(((e,t)=>e.plus(t)),new s.BigNumber(0));return e.coins.map(((e,n)=>({name:e.name,symbol:e.symbol,address:e.address,chainId:e.chainId,value:i[n].toNumber(),percentage:i[n].div(t).toNumber(),color:Bk[n]})))}),[e,i]);return z.jsxs(t.Box,{sx:{mt:16,display:"flex",flexDirection:"column",alignItems:"stretch",gap:28,p:20,backgroundColor:o.palette.background.paper,borderRadius:16,[o.breakpoints.up("tablet")]:{flexDirection:"row",alignItems:"center",border:`1px solid ${o.palette.border.main}`,p:0,gap:0}},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",[o.breakpoints.up("tablet")]:{minWidth:364,flexDirection:"column",gap:16}},children:[z.jsx(T.PieChart,{width:88,height:88,children:z.jsx(T.Pie,{isAnimationActive:!1,dataKey:"value",data:r,labelLine:!1,label:!1,outerRadius:44,children:r.map(((e,t)=>z.jsx(T.Cell,{fill:e.color,strokeWidth:0},`cell-${t}`)))})}),z.jsx(t.Box,{sx:{display:"none",[o.breakpoints.up("tablet")]:{display:"flex",alignItems:"center",justifyContent:"center",flexWrap:"wrap",gap:16,maxWidth:172}},children:r.map((e=>z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(t.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color}}),z.jsx(t.Box,{sx:{typography:"h6",color:o.palette.text.primary},children:e.symbol})]},e.address)))})]}),z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",gap:16,[o.breakpoints.up("tablet")]:{display:"none"}},children:r.map((e=>z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(t.Box,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color}}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:o.palette.text.primary},children:e.symbol}),z.jsx(lp,{address:e.address,customChainId:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:12,iconSpace:4,sx:{typography:"h6",color:"text.secondary"}})]}),z.jsxs(t.Box,{sx:{ml:"auto",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:o.palette.text.primary,textAlign:"right"},children:xr(new s.BigNumber(e.value))}),z.jsxs(t.Box,{sx:{typography:"h6",color:o.palette.text.secondary,textAlign:"right"},children:["(",gr({input:new s.BigNumber(e.percentage),showDecimals:2}),")"]})]})]},e.address)))}),z.jsxs(t.Box,{sx:{display:"none",[o.breakpoints.up("tablet")]:{flexGrow:1,display:"block",borderLeft:`1px solid ${o.palette.border.main}`}},children:[z.jsxs(t.Box,{sx:{borderBottom:`1px solid ${o.palette.border.main}`,typography:"h6",fontWeight:600,color:o.palette.text.secondary,height:48,display:"flex",alignItems:"center"},children:[z.jsx(t.Box,{sx:{flexBasis:"150px",flexGrow:1,flexShrink:1,px:20},children:"Asset"}),z.jsx(t.Box,{sx:{flexBasis:"150px",flexGrow:1,flexShrink:1,px:20,textAlign:"right"},children:"Token Amount"}),z.jsx(t.Box,{sx:{flexBasis:"150px",flexGrow:1,flexShrink:1,px:20,textAlign:"right"},children:"ratio"})]}),r.map((e=>z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",height:56},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8,flexBasis:"150px",flexGrow:1,flexShrink:1,px:20},children:[z.jsx(sl,{address:e.address,width:24,height:24,chainId:e.chainId,url:void 0,cross:!1,noShowChain:!0,noBorder:!0,marginRight:0}),z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:o.palette.text.primary},children:e.symbol}),z.jsx(lp,{address:e.address,customChainId:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:12,iconSpace:4,sx:{typography:"h6",color:"text.secondary"}})]})]}),z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:o.palette.text.primary,textAlign:"right",flexBasis:"150px",flexGrow:1,flexShrink:1,px:20},children:xr(new s.BigNumber(e.value))}),z.jsx(t.Box,{sx:{typography:"body2",fontWeight:600,color:o.palette.text.primary,textAlign:"right",flexBasis:"150px",flexGrow:1,flexShrink:1,px:20},children:gr({input:new s.BigNumber(e.percentage),showDecimals:2})})]},e.address)))]})]})},Ik=({poolDetail:e})=>z.jsx(z.Fragment,{children:"LiquidityProvidersTable"}),Ak=({title:e,children:n,tip:i,sx:o})=>z.jsxs(t.Box,{sx:Object.assign({display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,py:8},o),children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body2",color:"text.secondary"},children:e}),i&&z.jsx(ku,{title:i})]}),z.jsx(t.Box,{sx:{typography:"body1",color:"text.primary"},children:n})]}),Sk=({poolDetail:e})=>z.jsxs(t.Box,{sx:{mt:10,display:"flex",flexDirection:"column",alignItems:"stretch"},children:[z.jsx(Ak,{title:"Daily USD volume",children:"200.33M"}),z.jsx(Ak,{title:"Liquidity utilization",tip:"24h Volume/Liquidity ratio",children:"138.93%"}),z.jsx(t.Box,{sx:{my:10,width:"100%",height:"1px",backgroundColor:"border.main"}}),z.jsx(Ak,{title:"Fee",children:"0.02%"}),z.jsx(Ak,{title:"DAO fee",children:"0.02%"}),z.jsx(t.Box,{sx:{my:10,width:"100%",height:"1px",backgroundColor:"border.main"}}),z.jsx(Ak,{title:"Virtual price",tip:"Measures pool growth; this is not a dollar value",children:"1.00440296"}),z.jsx(t.Box,{sx:{my:10,width:"100%",height:"1px",backgroundColor:"border.main"}}),z.jsx(Ak,{title:"Pool/Token",children:(null==e?void 0:e.address)?z.jsx(lp,{address:null==e?void 0:e.address,customChainId:null==e?void 0:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"body1",color:"text.primary"}}):"-"}),z.jsx(t.Box,{sx:{my:10,width:"100%",height:"1px",backgroundColor:"border.main"}}),z.jsx(Ak,{title:"Pool Type",children:"Stableswap-NG"}),z.jsx(Ak,{title:"Basepool",children:z.jsx(lp,{address:"0xDddfBCc76166d741c2dfa6b6a90769df398b9969",customChainId:null==e?void 0:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"body1",color:"text.primary"}})}),z.jsx(Ak,{title:"Registry",children:z.jsx(lp,{address:"0xDddfBCc76166d741c2dfa6b6a90769df398b9969",customChainId:null==e?void 0:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"body1",color:"text.primary"}})}),z.jsx(t.Box,{sx:{my:10,width:"100%",height:"1px",backgroundColor:"border.main"}}),z.jsx(Ak,{title:"Coins",sx:{alignItems:"flex-start"},children:z.jsx(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:12},children:null==e?void 0:e.coins.map((n=>z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(sl,{address:n.address,width:16,height:16,chainId:null==e?void 0:e.chainId,url:void 0,cross:!1,noShowChain:!0,noBorder:!0,marginRight:0}),z.jsxs(t.Box,{sx:{typography:"body1",fontWeight:500,color:"text.primary"},children:[n.symbol,"(Standard)"]})]},n.address)))})}),z.jsx(Ak,{title:"Pool Parameters:",sx:{alignItems:"flex-start"},children:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:12},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body1",color:"text.primary"},children:"A:200"}),z.jsx(ku,{title:"Amplification coefficient chosen from fluctuation of prices around 1."})]}),z.jsx(t.Box,{sx:{typography:"body1",color:"text.primary"},children:"Off Peg Multiplier:5"})]})})]}),Lk=({poolDetail:e})=>{var n;const i=t.useTheme();return z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,[i.breakpoints.up("tablet")]:{py:20,flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${i.palette.border.main}`}},children:[z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",gap:8},children:[z.jsx(uf,{pool:e,separate:!1,wrap:!0}),z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"h4",fontWeight:600},children:null!==(n=null==e?void 0:e.name)&&void 0!==n?n:"-"}),(null==e?void 0:e.address)&&z.jsx(lp,{address:null==e?void 0:e.address,customChainId:null==e?void 0:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"body2",color:"text.secondary"}})]})]}),z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"flex-end",gap:4,[i.breakpoints.up("tablet")]:{flexDirection:"column",gap:0}},children:[z.jsx(cf,{apy:null==e?void 0:e.apy,dailyApy:null==e?void 0:e.dailyApy,weeklyApy:null==e?void 0:e.weeklyApy,sx:{typography:"h4",[i.breakpoints.up("tablet")]:{typography:"h4"}}}),z.jsx(t.Box,{sx:{typography:"body2",color:"text.secondary"},children:"APY"})]})]})},Mk=({poolDetail:e})=>{const n=t.useTheme(),i=[{title:"Trader",value:xr(new s("1770"))},{title:"Total Liquidity",value:`$${xr(new s("381800"))}`},{title:"Volume",value:`$${xr(new s("159820"))}`},{title:"Fees",value:gr({input:new s("0.0002"),showDecimals:2})}];return z.jsx(t.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"repeat(2, 1fr)",gap:12,[n.breakpoints.up("tablet")]:{gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(1, 1fr)"}},children:i.map(((e,i)=>z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",p:16,borderRadius:8,backgroundColor:n.palette.background.paper,[n.breakpoints.up("tablet")]:{border:`1px solid ${n.palette.border.main}`}},children:[z.jsx(t.Box,{sx:{typography:"caption",color:n.palette.text.primary},children:e.value}),z.jsx(t.Box,{sx:{typography:"h6",color:n.palette.text.secondary},children:e.title})]},i)))})},Rk=({poolDetail:e})=>z.jsx(z.Fragment,{children:"SwapsTable"});const Ok=({params:i})=>{const o=pm(),{isMobile:r}=Xa(),{account:a}=Pa(),s=t.useTheme(),{poolDetail:l,isLoading:d,error:u}=function({address:e,chainId:t}){const{data:n,isLoading:i,error:o}=c.useQuery({queryKey:["poolDetail"],queryFn:()=>hf[0]});return{poolDetail:n,isLoading:i,error:o}}({address:null==i?void 0:i.address,chainId:null==i?void 0:i.chainId}),{tokenBalances:p}=vf({pool:l,account:a}),[h,m]=n.useState(null),[x,g]=n.useState("parameters");n.useEffect((()=>{r||l&&m({pool:l,type:df.Add})}),[l,r]);const f=n.useMemo((()=>[{key:"parameters",value:"Parameters"},{key:"swaps",value:"Swaps"},{key:"liquidity",value:"Liquidity"}]),[]);return z.jsxs(cm,{sx:r?{p:s.spacing(28,0,108)}:{p:s.spacing(28,0,40)},children:[z.jsxs(t.Box,{sx:{[s.breakpoints.up("tablet")]:{display:"flex",gap:12,overflow:"hidden"}},children:[z.jsxs(t.Box,{sx:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",gap:24,[s.breakpoints.up("tablet")]:{gap:28}},children:[z.jsx(Xj,{onClick:()=>{o.push({type:exports.PageType.Pool})}}),z.jsx(Lk,{poolDetail:l}),z.jsx(Mk,{poolDetail:l}),z.jsxs(t.Box,{children:[z.jsx(t.Box,{sx:{typography:"body1",color:s.palette.text.primary},children:"Currency reserves"}),z.jsx(Ek,{poolDetail:l,tokenBalances:p})]}),z.jsx(t.Box,{sx:{backgroundColor:s.palette.background.paper,borderRadius:16,overflow:"hidden",px:16,pb:16,[s.breakpoints.up("tablet")]:{px:20,pb:20}},children:z.jsxs(t.Tabs,{value:x,onChange:(e,t)=>g(t),children:[z.jsx(t.TabsGroup,{tabs:f}),z.jsx(t.TabPanel,{value:"parameters",children:z.jsx(Sk,{poolDetail:l})}),z.jsx(t.TabPanel,{value:"swaps",children:z.jsx(Rk,{poolDetail:l})}),z.jsx(t.TabPanel,{value:"liquidity",children:z.jsx(Ik,{poolDetail:l})})]})})]}),z.jsx(t.Box,{sx:{position:"relative",width:r?"100%":375},children:h?z.jsx(kf,{poolDetailBtnVisible:!1,operateCurvePool:h,setOperateCurvePool:r?m:void 0}):r?null:z.jsx(t.Skeleton,{width:375,height:403,sx:{borderRadius:16}})})]}),r&&z.jsx(z.Fragment,{children:z.jsxs(t.Box,{sx:{position:"fixed",bottom:0,left:0,right:0,p:20,display:"grid",gap:"8px",gridTemplateColumns:"repeat(2, 1fr)",backgroundColor:"background.paperContrast"},children:[z.jsx(t.Button,{variant:t.Button.Variant.second,disabled:!l,onClick:()=>{l&&m({pool:l,type:df.Remove})},children:z.jsx(e.Trans,{id:"t/YqKh",message:"Remove"})}),z.jsx(t.Button,{disabled:!l,onClick:()=>{l&&m({pool:l,type:df.Add})},children:z.jsx(e.Trans,{id:"m16xKo",message:"Add"})})]})})]})};exports.AMMV2Create=Dw,exports.AMMV3PositionManage=Gg,exports.AMMV3PositionsView=Xg,exports.AddLiquidityV3=Tk,exports.CurvePoolDetail=Ok,exports.EmptyList=X,exports.FailedList=ne,exports.Message=cu,exports.Pool=function(){const{routerPage:e}=Q(),t=pm((e=>e.page)),n=null!=e?e:t;switch(null==n?void 0:n.type){case exports.PageType.Pool:return z.jsx(rv,{params:n.params});case exports.PageType.CreatePool:return z.jsx(Qj,{});case exports.PageType.ModifyPool:return z.jsx(ow,{params:n.params});case exports.PageType.PoolDetail:return z.jsx(Aw,{params:n.params});case exports.PageType.CurvePoolDetail:return z.jsx(Ok,{params:n.params});case exports.PageType.createPoolAMMV2:return z.jsx(Dw,{});case exports.PageType.createPoolAMMV3:return z.jsx(Tk,{params:n.params,handleGoBack:()=>{pm.getState().push({type:exports.PageType.Pool})},handleGoToPoolList:()=>{pm.getState().push({type:exports.PageType.Pool})}});default:return z.jsx(rv,{params:null==n?void 0:n.params})}},exports.PoolCreate=Qj,exports.PoolDetail=Aw,exports.PoolList=rv,exports.PoolModify=ow,exports.PoolOperate=ky,exports.PoolOperateDialog=Ty,exports.Swap=function({getAutoSlippage:l,onPayTokenChange:d,onReceiveTokenChange:u}={}){var p,h,m,x,g,f;const y=t.useTheme(),{isInflight:v}=ps(),{noPowerBy:b,onlyChainId:C}=Q(),{isMobile:j}=Xa(),{open:w,disconnect:k,getAppKitAccountByChainId:T,chainId:B,appKitActiveNetwork:E}=Pa(),[I,A]=n.useState(!1),[S,L]=n.useState(""),[M,R]=n.useState(""),[O,P]=n.useState(""),[_,D]=n.useState(""),[F,U]=n.useState(null),[q,V]=n.useState(null),[W,H]=n.useState(!1),[Z,$]=n.useState(!1),[G,Y]=n.useState(!1),[X,K]=n.useState(null),J=n.useMemo((()=>T(null==F?void 0:F.chainId)),[null==F?void 0:F.chainId,T]),ee=n.useMemo((()=>{const e=T(null==q?void 0:q.chainId);if(e)return X?Object.assign(Object.assign({},e),{appKitAccount:Object.assign(Object.assign({},e.appKitAccount),{isConnected:!0,address:X})}):e}),[T,null==q?void 0:q.chainId,X]),te=n.useMemo((()=>i.debounce((e=>P(e)),300)),[]),ne=n.useMemo((()=>i.debounce((e=>D(e)),300)),[]),ie=n.useMemo((()=>{if(F&&q)return!(!(null==F?void 0:F.chainId)||!(null==q?void 0:q.chainId)||F.chainId===q.chainId)}),[F,q]),{toFiatPrice:re,fromFiatPrice:ae}=xs({toToken:q,fromToken:F}),{marginAmount:se}=function({token:e,fiatPrice:t}){return{marginAmount:n.useMemo((()=>{var n;const i=null!==(n=null==e?void 0:e.decimals)&&void 0!==n?n:6,o=null!=t?new s(500).div(t):new s(0),r=sr(o,i);return(r.lt(new s(1).times(new s(10).pow(i-3)))?new s(0):r).toString(10)}),[null==e?void 0:e.decimals,t])}}({token:I?q:F,fiatPrice:I?re:ae});Ya({fromToken:F,toToken:q,getAutoSlippage:l});const{slippage:le,slippageLoading:de}=Bs({fromToken:F,toToken:q}),{slippage:ce}=function(){const{defaultSlippage:e}=js(!0);return{slippage:Wa((t=>t.slippage||e))}}(),{privacySwapSupplierEndpoints:ue,privacySwapEnable:pe,privacySwapEnableAble:he,endpointStatusMap:me,refetchEndpointStatus:xe}=Ts({chainId:null==F?void 0:F.chainId,account:null==J?void 0:J.appKitAccount.address}),ge=function(e){var t,n;const{getAppKitAccountByChainId:i}=Pa(),{latestBlockNumber:o}=Wa(),a=Hi.getFetchTokenQuery(e&&(null===(t=Ro.get(e))||void 0===t?void 0:t.isEVMChain)?e:void 0,e?r.basicTokenMap[e].address:void 0,null===(n=i(e))||void 0===n?void 0:n.appKitAccount.address);return c.useQuery(Object.assign(Object.assign({},a),{queryKey:[...a.queryKey,o]}))}(null==F?void 0:F.chainId),{sendRouteLoading:fe,sendRouteError:ye,setSendRouteError:ve,bridgeOrderTxRequest:be,handleClickSend:Ce}=function(){const e=qa(),{evmProvider:t}=Pa(),[i,a]=n.useState(),[s,l]=n.useState(!1),[d,c]=n.useState(""),u=n.useCallback((n=>N(this,[n],void 0,(function*({selectedRoute:n,fromEtherTokenBalance:i,goNext:s}){var d,u;if(!n)return;const{encodeParams:p}=n;if(p&&p.interfaceParams){c(""),l(!0);try{const h=yield e.getData(r.SwapApi.graphql.cross_chain_swap_zetachain_transactionEncode.toString(),{data:{interfaceParams:p.interfaceParams}});if(!h||!h.cross_chain_swap_zetachain_transactionEncode)throw new Error("cross_chain_swap_transactionEncode is null");const{data:m,to:x,value:g,from:f,chainId:y}=h.cross_chain_swap_zetachain_transactionEncode;if(!(m&&x&&g&&f&&y))throw new Error("cross_chain_swap_transactionEncode is null");const v=Ro.get(y);if(null==v?void 0:v.isEVMChain){if(!i)throw new Error("fromEtherTokenBalance is null");const{fromToken:e,fromAmount:a}=n,s=r.basicTokenMap[y],p=lr(g,18),h=s&&e.address.toLowerCase()===s.address.toLowerCase(),v=p.minus(h?a:0);if(!p.isNaN()&&p.gt(0)&&i.lt(p))return c(o.i18n._({id:"F9xwHA",message:"Insufficient cross-chain fees, need at least {0} {1}",values:{0:ir({input:v,decimals:null!==(d=null==s?void 0:s.decimals)&&void 0!==d?d:18}),1:null!==(u=null==s?void 0:s.symbol)&&void 0!==u?u:"-"}})),void l(!1);if(!t||!(yield Da({from:f,to:x,value:g,data:m},t)))throw new Error("failed to estimate gas")}a({data:m,to:x,value:g,from:f,chainId:y}),s()}catch(e){console.error("[failed to construct transaction request]: ",e);const{message:t}=e;c(t)}l(!1)}}))),[e,t]);return{sendRouteLoading:s,sendRouteError:d,setSendRouteError:c,bridgeOrderTxRequest:i,handleClickSend:u}}(),{bridgeRouteList:je,status:we,failedReason:ke}=function({fromAccount:e,toAccount:t,fromToken:i,toToken:o,fromAmount:r,enabled:a,slippage:l}){var d,u,p,h;const{tokenList:m}=Ko(),{GRAPHQL_URL:x}=Q(),g=n.useMemo((()=>i&&r?new s(r).multipliedBy(new s(10).pow(i.decimals)).dp(0,s.ROUND_DOWN):null),[r,i]),f=null!==(u=null===(d=null==e?void 0:e.appKitAccount)||void 0===d?void 0:d.address)&&void 0!==u?u:Mo(null==i?void 0:i.chainId),y=null!==(h=null===(p=null==t?void 0:t.appKitAccount)||void 0===p?void 0:p.address)&&void 0!==h?h:Mo(null==o?void 0:o.chainId),{data:v,error:b,isLoading:C,refetch:j}=c.useQuery({retry:!1,queryKey:["graphql","cross_chain_swap_zetachain_routes",null==i?void 0:i.chainId,null==i?void 0:i.address,null==o?void 0:o.chainId,null==o?void 0:o.address,f,y,null==g?void 0:g.toString(),l],queryFn:()=>N(this,void 0,void 0,(function*(){const e=yield fetch(`${x}?opname=Cross_chain_swap_zetachain_routes`,{headers:{"content-type":"application/json"},body:`{"query":"\\n query Cross_chain_swap_zetachain_routes($where: Cross_chain_swap_zetachainrouteParams) {\\n cross_chain_swap_zetachain_routes(where: $where) {\\n routeId\\n fromChainId\\n fromTokenAddress\\n fromAmount\\n fromAmountWithOutDecimals\\n fromAmountUSD\\n toChainId\\n toTokenAddress\\n toAmount\\n toAmountWithOutDecimals\\n toAmountUSD\\n fromAddress\\n toAddress\\n slippage\\n approveTarget\\n fees\\n omniPlan\\n encodeParams\\n }\\n}\\n ","variables":{"where":{"fromChainId":${null==i?void 0:i.chainId},"fromTokenAddress":"${null==i?void 0:i.address}","toChainId":${null==o?void 0:o.chainId},"toTokenAddress":"${null==o?void 0:o.address}","fromAddress":"${f}","toAddress":"${y}","fromAmount":"${null==g?void 0:g.toString()}","slippage":${l?Number(l)/100:null}}},"operationName":"Cross_chain_swap_zetachain_routes"}`,method:"POST"}),t=yield e.json();if(t.errors)throw new Error(t.errors[0].message);return t.data})),refetchInterval:15e3,enabled:!!i&&!!o&&!!g&&g.isFinite()&&g.gt(0)&&i.chainId!==o.chainId&&a}),{status:w,failedReason:k,bridgeRouteList:T}=n.useMemo((()=>{if(C)return{status:tr.Loading,bridgeRouteList:[]};if(b){let e;if(console.error("error:",b),b.message.includes("NOT_ROUTE_MIN_AMOUNT:min-")){const t=b.message.split("min-")[1];t&&(e=`(Enter min amount: ${t})`)}return{status:tr.Failed,failedReason:e,bridgeRouteList:[]}}if(v&&v.cross_chain_swap_zetachain_routes){const e=[],{routeId:t,fromChainId:n,fromTokenAddress:i,fromAmount:o,fromAmountWithOutDecimals:r,fromAmountUSD:a,toChainId:l,toTokenAddress:d,toAmount:c,fromAddress:u,toAddress:p,slippage:h,approveTarget:x,fees:g,omniPlan:f,encodeParams:y}=v.cross_chain_swap_zetachain_routes,b=Ro.get(n);if(t&&n&&i&&r&&l&&d&&c&&u&&p&&h&&(!(null==b?void 0:b.isEVMChain)||x)&&g&&g.length>0&&f&&f.length>0&&y){const o=m.find((e=>e.address.toLowerCase()===i.toLowerCase()&&e.chainId===n)),a=m.find((e=>e.address.toLowerCase()===d.toLowerCase()&&e.chainId===l)),b=new s(c);if(o&&a&&b.isFinite()&&b.gt(0)){const i=er({omniPlan:f,tokenList:m});if(i.includedSteps.length>0){const d=g.reduce(((e,t)=>{var n;return e.plus(null!==(n=t.amountUSD)&&void 0!==n?n:0)}),new s(0)).dp(4,s.ROUND_DOWN).toString(),c={key:t,id:t,fromChainId:n,toChainId:l,fromToken:o,toToken:a,fromAmount:r,toTokenAmount:b.div(`1e${a.decimals}`),fromAddress:u,toAddress:p,product:"zetachain",slippage:h,roundedRouteCostTime:0,spenderContractAddress:null!=x?x:null,feeUSD:d,fees:g,executionDuration:null,step:i,encodeParams:y,productParams:null,sourceRoute:v.cross_chain_swap_zetachain_routes};e.push(c)}}}return e.length>0?{status:tr.Success,bridgeRouteList:e}:{status:tr.Failed,bridgeRouteList:[]}}return{status:tr.Initial,bridgeRouteList:[]}}),[C,b,v,m]);return{status:w,failedReason:k,refetch:j,bridgeRouteList:T}}({toToken:q,fromToken:F,fromAmount:O,fromAccount:J,toAccount:ee,enabled:!G&&!fe,slippage:ce}),Te=n.useMemo((()=>{if(je&&je.length>0)return je[0]}),[je]),{isApproving:Be,isGetApproveLoading:Ee,needApprove:Ie,insufficientBalance:Ae,submitApprove:Se,getMaxBalance:Le}=Ms(F,{amount:O,contractAddress:null!==(p=null==Te?void 0:Te.spenderContractAddress)&&void 0!==p?p:void 0}),Me=n.useCallback((()=>{Ze(Le())}),[Le]),Re=n.useMemo((()=>!(!(null==J?void 0:J.appKitAccount.address)||Ae||Be||Ee||Ie)),[null==J?void 0:J.appKitAccount.address,Ae,Be,Ee,Ie]),{status:Oe,rawBrief:Pe,executeSwap:_e}=Cs({toToken:q,fromToken:F,marginAmount:se,fromAmount:O,toAmount:_,estimateGas:Re,isReverseRouting:I,slippage:le,slippageLoading:de}),{resAmount:De,priceImpact:Ne,baseFeeAmount:Fe,additionalFeeAmount:Ue,resPricePerToToken:qe,resPricePerFromToken:Ve,routeInfo:We}=n.useMemo((()=>Pe||{resAmount:null,priceImpact:null,baseFeeAmount:null,additionalFeeAmount:null,resPricePerToToken:null,resPricePerFromToken:null,routeInfo:null}),[Pe]),He=$a(ie),Ze=n.useCallback((e=>{const t=e.toString();L(t),te(t)}),[L,te]),ze=n.useCallback((e=>{const t=e.toString();R(t),ne(t)}),[R,ne]),$e=n.useCallback((e=>U((t=>{var n;const i="function"==typeof e?e(t):e;return B||Wa.setState({fromTokenChainId:null!==(n=null==i?void 0:i.chainId)&&void 0!==n?n:void 0}),d&&i&&i!==t&&d(i),i}))),[d,B]),Ge=n.useCallback((e=>V((t=>{const n="function"==typeof e?e(t):e;return u&&n&&n!==t&&u(n),n}))),[u]);!function({fromToken:e,toToken:t,setFromToken:i,setToToken:o,updateFromAmt:r,updateToAmt:a,setIsReverseRouting:s}){const{tokenList:l}=Ko(),{crossChain:d,defaultFromToken:c,defaultToToken:u,onlyChainId:p}=Q(),{chainId:h}=Pa(),m=n.useCallback((()=>{let n,m=null;const x=d?void 0:null!=p?p:h;if(!e){const e=ws({side:"from",defaultToken:c,tokenList:l,chainId:x});m=e.findToken,n=e.setDefaultAmount,m&&(i(m),void 0!==n&&(s(!1),r(n)))}if(!t){const{findToken:e,setDefaultAmount:t}=ws({side:"to",defaultToken:u,tokenList:l,occupyToken:m,chainId:x});e&&(o(e),void 0===n&&void 0!==t&&(s(!0),a(t)))}}),[h,d,c,u,e,p,i,s,o,t,l,r,a]);n.useEffect((()=>{const e=setTimeout((()=>{m()}),10);return()=>clearTimeout(e)}),[m])}({fromToken:F,toToken:q,setFromToken:$e,setToToken:Ge,updateFromAmt:Ze,updateToAmt:ze,setIsReverseRouting:A});const Qe=n.useCallback((()=>{Ze(""),ze(""),$e(q),Ge(F),Do("from",q),Do("to",F)}),[$e,q,Ge,F,Ze,ze]),Ye=n.useCallback(((e,t)=>{if(t)return Qe();Ze(""),ze(""),$e(e),Do("from",e)}),[Qe,Ze,ze,$e,Do]),Xe=n.useCallback(((e,t)=>{if(t)return Qe();Ze(""),ze(""),Ge(e),Do("to",e)}),[Qe,Ze,ze,$e,Do]),Ke=n.useCallback((()=>{I&&Ze(""),A(!1)}),[I,Ze]),Je=n.useCallback((()=>{I||ze(""),A(!0)}),[I,ze]),et=(e=>{const{defaultSlippage:t}=js(void 0===e),i=Wa((e=>e.slippage||t));return n.useMemo((()=>(void 0===e?Number(i):e)>5),[i,e])})(ie?void 0:le),tt=n.useMemo((()=>(100*Number(Ne)).toFixed(2)),[Ne]),nt=n.useMemo((()=>{const e=I?De:O;return e&&ae?new s(ae).multipliedBy(e):null}),[ae,O,I,De]),it=n.useMemo((()=>{var e;if(!re||void 0===ie)return null;if(ie)return(null===(e=null==Te?void 0:Te.toTokenAmount)||void 0===e?void 0:e.gt(0))?Te.toTokenAmount.multipliedBy(re):null;const t=I?_:De;return t?new s(re).multipliedBy(t):null}),[re,_,I,De,Te,ie]),ot=n.useMemo((()=>z.jsxs(t.Box,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[z.jsx(ku,{title:z.jsx(e.Trans,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),z.jsxs(t.Box,{sx:{display:"flex"},children:[z.jsx(e.Trans,{id:"6+mYrD",message:"Current price impact"}),z.jsxs(t.Box,{sx:{color:y.palette.error.main,ml:4},children:[tt,"%"]})]})]})),[tt,y.palette.error.main]),rt=n.useMemo((()=>z.jsx(vp,{toToken:q,fromToken:F,priceStatus:Oe,pricePerToToken:qe,pricePerFromToken:Ve,routeInfo:We})),[q,F,Oe,qe,Ve,We]),at=n.useMemo((()=>!r.ChainId[(null==F?void 0:F.chainId)||1]),[null==F?void 0:F.chainId]),st=n.useMemo((()=>{if(!F)return!1;const e=T(F.chainId);return!!e&&(!!e.chain.isEVMChain&&(!!B&&!!(null==F?void 0:F.chainId)&&(null==F?void 0:F.chainId)!==B))}),[B,F,T]),lt=function({fromToken:e,toToken:t}){const i=Ko(Jo);return n.useMemo((()=>!(!e||i.some((t=>t.chainId===e.chainId&&t.address===e.address&&(!t.side||"to"===t.side))))||!(!t||i.some((e=>e.chainId===t.chainId&&e.address===t.address&&(!e.side||"from"===e.side))))),[e,t,i])}({fromToken:F,toToken:q}),dt=n.useMemo((()=>et&&new s(I?_:O).gt(0)&&!Ae&&(ie?we===bs.Success:Oe===bs.Success)?z.jsxs(t.Box,{sx:{textAlign:"center",mb:8},children:[z.jsx(t.Box,{component:oe.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),o.i18n._({id:"//95jS",message:"The current slippage protection coefficient set exceeds {maxSlippageWarning}%, which may result in losses.",values:{maxSlippageWarning:5}})]}):null),[et,I,O,_,ie,we,Oe]),ct=n.useMemo((()=>st?z.jsxs(t.Box,{sx:{textAlign:"center"},children:[z.jsx(t.Box,{component:oe.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),z.jsx(e.Trans,{id:"54ffaC",message:"The current network is inconsistent with the wallet - please switch in wallet"})]}):ie&&we===bs.Initial?"-":Oe===bs.Loading||ie&&we===bs.Loading?z.jsx(t.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:z.jsxs(z.Fragment,{children:[z.jsx(t.RotatingIcon,{sx:{mr:5}}),z.jsx(e.Trans,{id:"JdNn1Y",message:"Fetching best price..."})]})}):at?z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{component:oe.Warn,sx:{mr:6,width:16,color:"warning.main"}}),z.jsx(e.Trans,{id:"udsWDJ",message:"Unsupported network - switch to trade"})]}):ie&&je.length?z.jsxs(z.Fragment,{children:[dt,z.jsx(Fd,{route:Te})]}):ie&&(we===bs.Success&&!je.length||we===bs.Failed)&&S?z.jsxs(z.Fragment,{children:[z.jsx(t.Box,{component:oe.Warn,sx:{width:15,mr:5,color:"warning.main"}}),z.jsx(e.Trans,{id:"NVAuTg",message:"Quote not available"})]}):z.jsxs(z.Fragment,{children:[!ie&&S&&new s(tt).gt(qo)&&ot,dt,rt]})),[Oe,rt,S,ot,tt,at,ie,we,je,Te,st,dt]),ut=n.useMemo((()=>I?new s(M).gt(0)?ir({input:De,decimals:null==F?void 0:F.decimals}):"-":S),[S,M,De,F,I]),pt=n.useMemo((()=>{var e;return I?M:ie?(null===(e=null==Te?void 0:Te.toTokenAmount)||void 0===e?void 0:e.gt(0))&&we!==bs.Loading?ir({input:Te.toTokenAmount,decimals:null==q?void 0:q.decimals}):"-":new s(S).gt(0)?ir({input:De,decimals:null==q?void 0:q.decimals}):"-"}),[S,M,De,q,I,Te,ie,we]),ht=n.useMemo((()=>{var n,i;if(!(null===(n=null==J?void 0:J.appKitAccount)||void 0===n?void 0:n.isConnected))return z.jsx(t.Button,{fullWidth:!0,onClick:()=>{var e;if(!(null==F?void 0:F.chainId))return;const t=null===(e=Ro.get(F.chainId))||void 0===e?void 0:e.caipNetwork;if(!t)return;const n=a.CaipNetworksUtil.getChainNamespace(t);w({namespace:n})},children:z.jsx(e.Trans,{id:"4g7eC1",message:"Connect to {0} wallet",values:{0:Sa(null==F?void 0:F.chainId)}})});if(J.chain.isEVMChain&&J.chain.chainId!==B)return z.jsx(t.Button,{fullWidth:!0,onClick:()=>{E.switchNetwork(J.chain.caipNetwork)},children:z.jsx(e.Trans,{id:"1+P9RR",message:"Switch to {0}",values:{0:J.chain.name}})});if(J.chain.isSolanaChain&&J.chain.chainId!==B)return z.jsx(t.Button,{fullWidth:!0,onClick:()=>{E.switchNetwork(J.chain.caipNetwork)},children:z.jsx(e.Trans,{id:"1+P9RR",message:"Switch to {0}",values:{0:J.chain.name}})});if(!(null===(i=null==ee?void 0:ee.appKitAccount)||void 0===i?void 0:i.isConnected))return z.jsx(t.Button,{fullWidth:!0,onClick:()=>{var e;if(!(null==q?void 0:q.chainId))return;const t=null===(e=Ro.get(q.chainId))||void 0===e?void 0:e.caipNetwork;if(!t)return;const n=a.CaipNetworksUtil.getChainNamespace(t);w({namespace:n})},children:z.jsx(e.Trans,{id:"4g7eC1",message:"Connect to {0} wallet",values:{0:Sa(null==q?void 0:q.chainId)}})});if(v)return z.jsx(t.Button,{fullWidth:!0,isLoading:!0,disabled:!0,children:z.jsx(e.Trans,{id:"FRBvjQ",message:"Transaction Pending"})});if(!F||!q)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:z.jsx(e.Trans,{id:"KlvBGJ",message:"Select Tokens"})});if(!new s(I?_:O).gt(0))return z.jsx(t.Button,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:z.jsx(e.Trans,{id:"iPMIoT",message:"Enter an amount"})});if(ie?we===bs.Loading||Ee:Oe===bs.Loading)return z.jsx(t.Button,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:z.jsx(e.Trans,{id:"OauUE6",message:"Fetching Price..."})});let o=!1;return o=ie?!je.length||we===bs.Failed:!De||Oe===bs.Failed,o?z.jsx(t.Button,{fullWidth:!0,disabled:!0,children:z.jsx(e.Trans,{id:"NVAuTg",message:"Quote not available"})}):Ae?z.jsx(t.Button,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:z.jsx(e.Trans,{id:"znqB4T",message:"Insufficient balance"})}):Ie?z.jsx(t.Button,{fullWidth:!0,disabled:Be,onClick:()=>Se(),children:Be?z.jsx(e.Trans,{id:"j2Uisd",message:"Approving"}):z.jsx(e.Trans,{id:"Z7ZXbT",message:"Approve"})}):ie?z.jsx(t.Button,{fullWidth:!0,onClick:()=>{var e,t;return Ce({selectedRoute:Te,fromEtherTokenBalance:null!==(t=null===(e=ge.data)||void 0===e?void 0:e.balance)&&void 0!==t?t:null,goNext:()=>Y(!0)})},"data-testid":$o,disabled:!Te,isLoading:fe,children:z.jsx(e.Trans,{id:"SXnevP",message:"Review Cross Chain"})}):pe?z.jsxs(t.Button,{fullWidth:!0,onClick:()=>H(!0),"data-testid":$o,children:[z.jsx(t.Tooltip,{placement:"top",onlyHover:!0,maxWidth:240,title:z.jsxs(t.Box,{sx:{display:"flex",flexDirection:"column",gap:4},children:[z.jsx(t.Box,{sx:{typography:"body2",fontWeight:500,color:"text.primary"},children:"Privacy Swap is Enabled"}),z.jsx(t.Box,{sx:{typography:"h6",fontWeight:500,color:"text.secondary"},children:"Your transactions on the Ethereum network will be protected from sandwich attacks."})]}),children:z.jsx(t.Box,{sx:{mr:8},children:z.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"30",viewBox:"0 0 25 30",fill:"none",children:[z.jsx("path",{d:"M12.5 4L3.5 8V14C3.5 19.55 7.34 24.74 12.5 26C17.66 24.74 21.5 19.55 21.5 14V8L12.5 4Z",fill:"white"}),z.jsx("path",{d:"M23 14C23 20.1791 18.7457 26.0187 12.8555 27.457L12.5 27.5439L12.1445 27.457C6.25427 26.0187 2 20.1791 2 14V7.02539L2.89062 6.62891L11.8906 2.62891L12.5 2.3584L13.1094 2.62891L22.1094 6.62891L23 7.02539V14Z",stroke:"white",strokeOpacity:"0.5",strokeWidth:"3"}),z.jsx("path",{d:"M16.3937 11.3638L10.8021 16.9553L8.60457 14.7662L7.4082 15.9626L10.8021 19.3565L17.59 12.5686L16.3937 11.3638Z",fill:"#154618"})]})})}),z.jsx(e.Trans,{id:"K/Ay/d",message:"Review Swap"})]}):z.jsx(t.Button,{fullWidth:!0,onClick:()=>H(!0),"data-testid":$o,children:z.jsx(e.Trans,{id:"K/Ay/d",message:"Review Swap"})})}),[null===(h=null==J?void 0:J.appKitAccount)||void 0===h?void 0:h.isConnected,null==J?void 0:J.chain.isEVMChain,null==J?void 0:J.chain.chainId,null==J?void 0:J.chain.isSolanaChain,null==J?void 0:J.chain.name,null==J?void 0:J.chain.caipNetwork,B,null===(m=null==ee?void 0:ee.appKitAccount)||void 0===m?void 0:m.isConnected,v,F,q,I,_,O,ie,we,Ee,Oe,Ae,Ie,w,E,je.length,De,Be,Se,Te,fe,Ce,null===(x=ge.data)||void 0===x?void 0:x.balance,pe]),mt=n.useMemo((()=>F&&q?z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center"},children:[z.jsx(sl,{token:F,width:16,height:16,marginRight:6,chainId:F.chainId,noShowChain:!!C}),`${ir({input:I?De:O,decimals:null==F?void 0:F.decimals})} ${null==F?void 0:F.symbol}`,z.jsx(t.Box,{component:oe.DoubleRight,sx:{width:12,height:12,mx:16}}),z.jsx(sl,{token:q,width:16,height:16,marginRight:6,chainId:q.chainId,noShowChain:!!C}),`${ir({input:I?_:De,decimals:null==q?void 0:q.decimals})} ${null==q?void 0:q.symbol}`]}):z.jsx(t.Box,{})),[F,q,O,_,De,I,C]);return z.jsxs(t.Box,{sx:{width:"100%",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",borderRadius:16,backgroundColor:y.palette.background.skeleton,[y.breakpoints.up("laptop")]:{width:450,backgroundColor:y.palette.background.skeleton,backdropFilter:"blur(4px)"}},children:[z.jsxs(t.Box,{sx:{display:"flex",justifyContent:"space-between",px:16,py:20},children:[z.jsx(t.Box,{sx:{typography:"caption",color:y.palette.text.primary},children:"Universal Swap"}),z.jsxs(t.Box,{sx:{display:"flex",alignItems:"center",borderRadius:4,p:1,backgroundColor:y.palette.background.tag},children:[z.jsxs(t.Box,{sx:{color:y.palette.text.secondary,typography:"h6",px:6,py:4},children:[ie?(null==Te?void 0:Te.slippage)?100*Te.slippage:null!=ce?ce:"-":le,"%"]}),z.jsx(t.Tooltip,{open:He,title:ie?z.jsx(e.Trans,{id:"qLkska",message:"The setting has been switched to cross chain mode"}):z.jsx(e.Trans,{id:"NSCBTb",message:"The setting has been switched to swap mode"}),placement:"bottom-end",children:z.jsx(t.Box,{component:t.ButtonBase,onClick:()=>$(!0),sx:{p:4,backgroundColor:y.palette.background.paper,borderRadius:4,height:28,width:28,display:"flex",alignItems:"center",justifyContent:"center"},children:z.jsx(t.Box,{component:oe.Setting,sx:{width:20,height:20,color:"text.primary",cursor:"pointer"}})})})]})]}),z.jsxs(t.Box,{sx:{flex:1,px:16,pb:20,overflowY:"auto"},children:[z.jsxs(t.Box,{children:[z.jsx(gp,{sx:{mb:4},token:F,side:"from",amt:ut,defaultLoadBalance:!0,onMaxClick:Me,onInputChange:Ze,onInputFocus:ie?void 0:Ke,showMaxBtn:!I&&!S,occupiedAddrs:[null!==(g=null==q?void 0:q.address)&&void 0!==g?g:""],occupiedChainId:null==q?void 0:q.chainId,fiatPriceTxt:nt?`$${nr({input:nt,showDecimals:1})}`:"$-",onTokenChange:Ye,readOnly:I,showChainLogo:!C,showChainName:!C,notTokenPickerModal:!j,enterAddressEnabled:!1,inputToAddress:X,setInputToAddress:K,account:J,failedReason:ke}),z.jsx(Yu,{onClick:Qe,disabled:lt}),z.jsx(gp,{token:q,side:"to",amt:pt,onInputChange:ze,onInputFocus:ie?void 0:Je,occupiedAddrs:[null!==(f=null==F?void 0:F.address)&&void 0!==f?f:""],occupiedChainId:null==F?void 0:F.chainId,fiatPriceTxt:it?`$${nr({input:it,showDecimals:1})}(${tt}%)`:"$-",onTokenChange:Xe,readOnly:ie||!I,showChainLogo:!C,showChainName:!C,notTokenPickerModal:!j,enterAddressEnabled:ie,inputToAddress:X,setInputToAddress:K,account:ee,sx:{padding:y.spacing(24,20,20)}}),z.jsx(t.Box,{sx:{py:16,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:ct})]}),ht,z.jsx(Iu,{}),b?"":z.jsxs(t.Box,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:y.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[z.jsx(t.Box,{sx:{width:18,height:18,transform:"translate(1px, 2px)","& path":{fill:y.palette.text.disabled}},component:oe.Dodo}),z.jsx(e.Trans,{id:"QIsI8+",message:"Powered by ZUNO protocol"})]})]}),z.jsx(Au,{toToken:q,fromToken:F,fromAmount:I?De:O,toAmount:I?_:De,open:W,baseFeeAmount:Fe,priceImpact:tt,additionalFeeAmount:Ue,curToFiatPrice:it,execute:()=>_e(mt),clearFromAmt:()=>Ze(""),clearToAmt:()=>ze(""),curFromFiatPrice:nt,pricePerFromToken:Ve,onClose:()=>H(!1),loading:Oe===bs.Loading,slippage:le,isDialogModal:j}),ie?z.jsx(Lu,{open:Z,onClose:()=>$(!1),isBridge:!0,isDialogModal:j}):z.jsx(Qu,{open:Z,onClose:()=>$(!1),fromToken:F,toToken:q,privacySwapEnableAble:he,privacySwapEnable:pe,privacySwapSupplierEndpoints:ue,endpointStatusMap:me,refetchEndpointStatus:xe,isDialogModal:j}),z.jsx(Bu,{open:G,onClose:()=>Y(!1),route:Te,bridgeOrderTxRequest:be,clearFromAmt:()=>Ze(""),clearToAmt:()=>ze(""),isDialogModal:j}),z.jsx(Eu,{message:ye,onClose:()=>ve(""),isDialogModal:j})]})},exports.SwapOrderHistory=function(){const e=t.useTheme(),{isMobile:i}=Xa(),o=n.useRef(null),{evmAccount:r,solanaAccount:a,bitcoinAccount:s}=Pa(),[l,d]=n.useState(om.sameChain),[c,u]=n.useState(),p=n.useMemo((()=>[{key:om.sameChain,value:"Same chain Swaps"},{key:om.crossChain,value:"Cross Chain Swaps"},{key:om.errorRefunds,value:"Error Refunds"}]),[]),h=n.useMemo((()=>{var e,t,n;const i=[];if(r.isConnected&&r.address){const t=null===(e=Ro.entries().find((([e,t])=>t.isEVMChain)))||void 0===e?void 0:e[1];t&&i.push({account:Xr(r.address),firstChain:t})}if(a.isConnected&&a.address){const e=null===(t=Ro.entries().find((([e,t])=>t.isSolanaChain)))||void 0===t?void 0:t[1];e&&i.push({account:a.address,firstChain:e})}if(s.isConnected&&s.address){const e=null===(n=Ro.entries().find((([e,t])=>t.isBTCChain)))||void 0===n?void 0:n[1];e&&i.push({account:s.address,firstChain:e})}return i}),[s.address,s.isConnected,r.address,r.isConnected,a.address,a.isConnected]);return n.useEffect((()=>{u((()=>{if(h.length>0)return h[0].account}))}),[h]),z.jsxs(t.Tabs,{value:l,onChange:(e,t)=>{d(t)},sx:{width:"100%",display:"flex",flexDirection:"column",flex:1,overflow:"hidden",height:"max-content",maxHeight:"100%",borderRadius:16,backgroundColor:"background.skeleton",backdropFilter:"blur(4px)",[e.breakpoints.up("laptop")]:{}},className:i?void 0:"gradient-card-border",children:[z.jsx(t.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",px:16,pt:20,[e.breakpoints.up("laptop")]:{px:24}},children:z.jsx(t.TabsGroup,{tabs:p,variant:"default",tabsListSx:{justifyContent:"space-between",borderBottomWidth:0},tabSx:{mr:28,typography:"body2",lineHeight:"19px",minHeight:39,padding:"0px 0px 20px 0px",[e.breakpoints.up("laptop")]:{typography:"body1",lineHeight:"22px",minHeight:42}}})}),z.jsx(t.Box,{ref:o,sx:{px:16,py:12,display:"flex",alignItems:"center",gap:12,overflowX:"auto",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"border.main",[e.breakpoints.up("laptop")]:{px:24},"&::-webkit-scrollbar":{display:"none"},msOverflowStyle:"none",scrollbarWidth:"none",WebkitOverflowScrolling:"touch",userSelect:"none"},children:h.map(((n,i)=>{const r=c===n.account,a=i===h.length-1,s=0===i;return z.jsxs(t.Box,{sx:Object.assign(Object.assign({display:"flex",alignItems:"center",gap:4,pl:8,py:8,pr:10,borderRadius:4,backgroundColor:"transparent",cursor:"pointer",typography:"body2",lineHeight:"19px",color:"text.secondary",flexShrink:0},r&&{backgroundColor:t.alpha(e.palette.success.main,.1),color:"success.main"}),{"&:hover":{backgroundColor:r?t.alpha(e.palette.success.main,.1):e.palette.background.paperDarkContrast}}),onClick:()=>((e,t,n)=>{u(e),o.current&&(t?o.current.scrollTo({left:o.current.scrollWidth,behavior:"smooth"}):n&&o.current.scrollTo({left:0,behavior:"smooth"}))})(n.account,a,s),children:[n.firstChain&&z.jsx(t.Box,{component:n.firstChain.logo,sx:{width:16,height:16}}),"(",Sa(n.firstChain.chainId),")",Ea(n.account)]},n.account)}))}),c?z.jsxs(z.Fragment,{children:[z.jsx(lm,{value:om.sameChain,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:z.jsx(sm,{account:c})}),z.jsx(lm,{value:om.crossChain,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:z.jsx(tm,{account:c})}),z.jsx(lm,{value:om.errorRefunds,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:z.jsx(tm,{account:c,type:"error_refund"})})]}):z.jsx(_p,{isMobile:i,empty:!0,loading:!1})]})},exports.TokenCard=kp,exports.TokenLogo=sl,exports.UnstyleWidget=wu,exports.WIDGET_CLASS_NAME=bu,exports.WIDGET_MODULE_CLASS_NAME=dm,exports.Widget=function(e){const n=t.createTheme({mode:e.colorMode,theme:e.theme,lang:e.locale||Qd});return e.apikey||e.apiServices||console.error("apikey and apiServices must have a."),z.jsxs(t.ThemeProvider,{theme:n,children:[z.jsx(t.CssBaseline,{container:`.${bu}, .${t.WIDGET_MODAL_CLASS}, .${t.WIDGET_MODAL_FIXED_CLASS}`}),z.jsx(c.QueryClientProvider,{client:ac,children:z.jsxs(wu,{...e,children:[e.children,z.jsx(cu,{})]})})]})},exports.chainListMap=Ro,exports.fixedInputStringToFormattedNumber=ar,exports.formatPercentageNumber=gr,exports.formatReadableNumber=nr,exports.formatShortNumber=mr,exports.formatTokenAmountNumber=ir,exports.getEtherscanPage=Ia,exports.jsxRuntimeExports=z,exports.rpcServerMap=Ei,exports.scanUrlDomainMap=Ai,exports.tokenList=tl,exports.useMessageState=lu,exports.usePoolBalanceInfo=If,exports.useRouterStore=pm,exports.useTradeSwapOrderList=nm;
|