@dodoex/widgets 3.0.2-zetachain.61 → 3.0.2-zetachain.63

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.
Files changed (30) hide show
  1. package/dist/cjs/locales/en-US.js +1 -1
  2. package/dist/cjs/locales/zh-CN.js +1 -1
  3. package/dist/{helper-nlCS0gWV.js → helper-Bmh7M-BF.js} +1 -1
  4. package/dist/{helper-9qayftO5.cjs → helper-_tHgX2Ak.cjs} +1 -1
  5. package/dist/{index-Ds-05r88.js → index-BgEhIZm4.js} +1 -1
  6. package/dist/index-BrjW4hHx.cjs +31 -0
  7. package/dist/index-DaKct2mi.js +31 -0
  8. package/dist/{index-aAEdLqba.cjs → index-IHN0Ue2A.cjs} +1 -1
  9. package/dist/{index-C1QyFyHV.cjs → index-q2k2YXsR.cjs} +1 -1
  10. package/dist/{index-DcHBHVEd.js → index-z7Nn7GL4.js} +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/locales/en-US.js +1 -1
  14. package/dist/locales/zh-CN.js +1 -1
  15. package/dist/types/components/Swap/components/Dialog.d.ts +1 -1
  16. package/dist/types/components/Widget/index.d.ts +1 -0
  17. package/dist/types/hooks/Submission/types.d.ts +5 -1
  18. package/dist/types/widgets/PoolWidget/curve/Add.d.ts +5 -0
  19. package/dist/types/widgets/PoolWidget/curve/AndOrRemove.d.ts +7 -0
  20. package/dist/types/widgets/PoolWidget/curve/OperateDialog.d.ts +6 -0
  21. package/dist/types/widgets/PoolWidget/curve/Remove.d.ts +5 -0
  22. package/dist/types/widgets/PoolWidget/curve/components/ApyTooltip.d.ts +5 -0
  23. package/dist/types/widgets/PoolWidget/curve/components/OperateButtonContainer.d.ts +3 -0
  24. package/dist/types/widgets/PoolWidget/curve/components/SlippageBonus.d.ts +3 -0
  25. package/dist/types/widgets/PoolWidget/curve/hooks/useLpTokenBalances.d.ts +12 -0
  26. package/dist/types/widgets/PoolWidget/curve/types.d.ts +2 -0
  27. package/dist/types/widgets/PoolWidget/curve/utils.d.ts +2 -0
  28. package/package.json +2 -2
  29. package/dist/index-qZpmElHH.cjs +0 -31
  30. package/dist/index-twlCfFgF.js +0 -31
@@ -0,0 +1,31 @@
1
+ import{Trans as e,useLingui as t,I18nProvider as n}from"@lingui/react";import{Box as i,EmptyDataIcon as o,HoverOpacity as r,useTheme as a,Modal as s,Tooltip as l,ButtonBase as d,Button as c,createTheme as u,ThemeProvider as p,CssBaseline as h,WIDGET_MODAL_CLASS as m,WIDGET_MODAL_FIXED_CLASS as g,QuestionTooltip as f,Accordion as x,AccordionItem as y,LoadingSkeleton as v,Input as b,Skeleton as j,styled as C,Slider as w,useDevices as k,alpha as T,Checkbox as E,Tabs as A,TabListButton as I,TabButton as S,TabPanel as L,RotatingIcon as O,TooltipToast as R,HoverAddUnderLine as M,HoverAddBackground as _,SearchInput as P,Popup as B,TabsGroup as D,lightPalette as N,TabsButtonGroup as F,Radio as U,Select as q,WidgetModal as V}from"@dodoex/components";import*as W from"react";import H,{useMemo as Z,useCallback as z,useState as $,useRef as G,useEffect as Y,useContext as Q,createContext as X,forwardRef as K,Fragment as J,useReducer as ee,useLayoutEffect as te}from"react";import{merge as ne,unionBy as ie,isEqual as oe,isArray as re,throttle as ae,debounce as se}from"lodash";import{i18n as le}from"@lingui/core";import{ChainId as de,ContractRequests as ce,TokenApi as ue,zetachainTestnet as pe,btcSignet as he,PoolApi as me,AMMV3Api as ge,platformIdMap as fe,GraphQLRequests as xe,SwapApi as ye,basicTokenMap as ve,CONTRACT_QUERY_KEY as be,contractConfig as je,setContractRequests as Ce,SystemApi as we,CurveApi as ke,MiningApi as Te,MiningStatusE as Ee,getPmmModel as Ae,PMMModel as Ie}from"@dodoex/api";import{CaipNetworksUtil as Se}from"@reown/appkit-utils";import Le,{BigNumber as Oe}from"bignumber.js";import{clusterApiUrl as Re,Message as Me,Transaction as _e,VersionedMessage as Pe,VersionedTransaction as Be,PublicKey as De,TransactionExpiredBlockheightExceededError as Ne,SendTransactionError as Fe}from"@solana/web3.js";import{mainnet as Ue,polygon as qe,bsc as Ve,base as We,zetachain as He,solana as Ze,bitcoin as ze,sepolia as $e,arbitrumSepolia as Ge,solanaDevnet as Ye}from"@reown/appkit/networks";import{useQuery as Qe,useQueries as Xe,useQueryClient as Ke,useMutation as Je,QueryClient as et,QueryClientProvider as tt,useInfiniteQuery as nt}from"@tanstack/react-query";import{create as it}from"zustand";import{getUniswapV2FactoryContractAddressByChainId as ot,getUniswapV2Router02ContractAddressByChainId as rt,multiCallAddressList as at,setContractRequests as st,getUniswapV3FactoryContractAddressByChainId as lt,getNonfungiblePositionManagerContractAddressByChainId as dt,getUniswapV2Router02FixedFeeContractAddressByChainId as ct,encodeUniswapV2Router02FixedFeeAddLiquidityETH as ut,encodeUniswapV2Router02AddLiquidityETH as pt,encodeUniswapV2Router02FixedFeeAddLiquidity as ht,encodeUniswapV2Router02AddLiquidity as mt,encodeUniswapV2Router02FixedFeeRemoveLiquidityETH as gt,encodeUniswapV2Router02RemoveLiquidityETH as ft,encodeUniswapV2Router02FixedFeeRemoveLiquidity as xt,encodeUniswapV2Router02RemoveLiquidity as yt,getUniswapV2FactoryFixedFeeContractAddressByChainId as vt,getFetchUniswapV2PairBalanceOfQueryOptions as bt,getFetchUniswapV2PairTotalSupplyQueryOptions as jt}from"@dodoex/dodo-contract-request";import{Web3Provider as Ct}from"@ethersproject/providers";import{useAppKit as wt,useDisconnect as kt,useAppKitAccount as Tt,useAppKitProvider as Et,useAppKitNetwork as At}from"@reown/appkit/react";import{_base36To16 as It,BigNumber as St,parseFixed as Lt}from"@ethersproject/bignumber";import Ot from"axios";import{Contract as Rt}from"@ethersproject/contracts";import{createPortal as Mt}from"react-dom";import _t from"identicon.js";import Pt from"@bitcoinerlab/secp256k1";import*as Bt from"bitcoinjs-lib";import Dt from"dayjs";import{ContractRequests as Nt}from"@dodoex/contract-request";import{Transition as Ft}from"react-transition-group";import{ResponsiveContainer as Ut,AreaChart as qt,XAxis as Vt,YAxis as Wt,Area as Ht,ReferenceDot as Zt,BarChart as zt,Tooltip as $t,Bar as Gt,Cell as Yt,ReferenceLine as Qt,PieChart as Xt,Pie as Kt}from"recharts";import{FixedSizeList as Jt}from"react-window";import en from"jsbi";import tn from"tiny-invariant";import{parseUnits as nn}from"@ethersproject/units";import on from"react-infinite-scroller";import{Token as rn,CurrencyAmount as an,Price as sn,Percent as ln}from"@uniswap/sdk-core";import{Pair as dn}from"@uniswap/v2-sdk";import{area as cn,curveStepAfter as un,axisBottom as pn,select as hn,brushX as mn,zoomIdentity as gn,zoom as fn,scaleLinear as xn,max as yn}from"d3";function vn(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 bn(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 jn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wn,kn={exports:{}},Tn={};var En,An={};
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?kn.exports=function(){if(wn)return Tn;wn=1;var e=H,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},d=null,c=null;for(s in void 0!==a&&(d=""+a),void 0!==n.key&&(d=""+n.key),void 0!==n.ref&&(c=n.ref),n)i.call(n,s)&&!r.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:o.current}}return Tn.Fragment=n,Tn.jsx=a,Tn.jsxs=a,Tn}():kn.exports=(En||(En=1,"production"!==process.env.NODE_ENV&&function(){var e=H,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=Symbol.iterator,g="@@iterator",f=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(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 y,v=!1,b=!1,j=!1,C=!1,w=!1;function k(e){return e.displayName||"Context"}function T(e){if(null==e)return null;if("number"==typeof e.tag&&x("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 i:return"Fragment";case n:return"Portal";case r:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case c:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return k(e)+".Consumer";case a:return k(e._context)+".Provider";case l: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 u:var t=e.displayName||null;return null!==t?t:T(e.type)||"Memo";case p:var h=e,m=h._payload,g=h._init;try{return T(g(m))}catch(e){return null}}return null}y=Symbol.for("react.module.reference");var E,A,I,S,L,O,R,M=Object.assign,_=0;function P(){}P.__reactDisabledLog=!0;var B,D=f.ReactCurrentDispatcher;function N(e,t,n){if(void 0===B)try{throw Error()}catch(e){var i=e.stack.trim().match(/\n( *(at )?)/);B=i&&i[1]||""}return"\n"+B+e}var F,U=!1,q="function"==typeof WeakMap?WeakMap:Map;function V(e,t){if(!e||U)return"";var n,i=F.get(e);if(void 0!==i)return i;U=!0;var o,r=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=D.current,D.current=null,function(){if(0===_){E=console.log,A=console.info,I=console.warn,S=console.error,L=console.group,O=console.groupCollapsed,R=console.groupEnd;var e={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}_++}();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&&F.set(e,u),u}}while(d>=1&&c>=0);break}}}finally{U=!1,D.current=o,function(){if(0==--_){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:E}),info:M({},e,{value:A}),warn:M({},e,{value:I}),error:M({},e,{value:S}),group:M({},e,{value:L}),groupCollapsed:M({},e,{value:O}),groupEnd:M({},e,{value:R})})}_<0&&x("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?N(p):"";return"function"==typeof e&&F.set(e,h),h}function W(e,t,n){if(null==e)return"";if("function"==typeof e)return V(e,!(!(i=e.prototype)||!i.isReactComponent));var i;if("string"==typeof e)return N(e);switch(e){case d:return N("Suspense");case c:return N("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case l:return V(e.render,!1);case u:return W(e.type,t,n);case p:var o=e,r=o._payload,a=o._init;try{return W(a(r),t,n)}catch(e){}}return""}F=new q;var Z=Object.prototype.hasOwnProperty,z={},$=f.ReactDebugCurrentFrame;function G(e){if(e){var t=e._owner,n=W(e.type,e._source,t?t.type:null);$.setExtraStackFrame(n)}else $.setExtraStackFrame(null)}var Y=Array.isArray;function Q(e){return Y(e)}function X(e){return""+e}function K(e){if(function(e){try{return X(e),!1}catch(e){return!0}}(e))return x("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)),X(e)}var J,ee,te,ne=f.ReactCurrentOwner,ie={key:!0,ref:!0,__self:!0,__source:!0};te={};var oe=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 re(e,t,n,i,o){var r,a={},s=null,l=null;for(r in void 0!==n&&(K(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)&&(K(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&&ne.current&&t&&ne.current.stateNode!==t){var n=T(ne.current.type);te[n]||(x('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',T(ne.current.type),e.ref),te[n]=!0)}}(t,o)),t)Z.call(t,r)&&!ie.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(){J||(J=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,c),l&&function(e,t){var n=function(){ee||(ee=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,c)}return oe(e,s,l,o,i,ne.current,a)}var ae,se=f.ReactCurrentOwner,le=f.ReactDebugCurrentFrame;function de(e){if(e){var t=e._owner,n=W(e.type,e._source,t?t.type:null);le.setExtraStackFrame(n)}else le.setExtraStackFrame(null)}function ce(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function ue(){if(se.current){var e=T(se.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ae=!1;var pe={};function he(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=ue();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(!pe[n]){pe[n]=!0;var i="";e&&e._owner&&e._owner!==se.current&&(i=" It was passed a child from "+T(e._owner.type)+"."),de(e),x('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),de(null)}}}function me(e,t){if("object"==typeof e)if(Q(e))for(var n=0;n<e.length;n++){var i=e[n];ce(i)&&he(i,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=m&&e[m]||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;)ce(r.value)&&he(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!==l&&n.$$typeof!==u)return;t=n.propTypes}if(t){var i=T(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||(G(o),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",n,a,typeof s),G(null)),s instanceof Error&&!(s.message in z)&&(z[s.message]=!0,G(o),x("Failed %s type: %s",n,s.message),G(null))}}(t,e.props,"prop",i,e)}else void 0===n.PropTypes||ae||(ae=!0,x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var fe={};function xe(e,n,m,g,f,k){var E=function(e){return"string"==typeof e||"function"==typeof e||!!(e===i||e===r||w||e===o||e===d||e===c||C||e===h||v||b||j)||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===u||e.$$typeof===a||e.$$typeof===s||e.$$typeof===l||e.$$typeof===y||void 0!==e.getModuleId)}(e);if(!E){var A,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+=ue(),null===e?A="null":Q(e)?A="array":void 0!==e&&e.$$typeof===t?(A="<"+(T(e.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):A=typeof e,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,I)}var S=re(e,n,m,f,k);if(null==S)return S;if(E){var L=n.children;if(void 0!==L)if(g)if(Q(L)){for(var O=0;O<L.length;O++)me(L[O],e);Object.freeze&&Object.freeze(L)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else me(L,e)}if(Z.call(n,"key")){var R=T(e),M=Object.keys(n).filter((function(e){return"key"!==e})),_=M.length>0?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}";fe[R+_]||(x('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} />',_,R,M.length>0?"{"+M.join(": ..., ")+": ...}":"{}",R),fe[R+_]=!0)}return e===i?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var i=t[n];if("children"!==i&&"key"!==i){de(e),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),de(null);break}}null!==e.ref&&(de(e),x("Invalid attribute `ref` supplied to `React.Fragment`."),de(null))}(S):ge(S),S}var ye=function(e,t,n){return xe(e,t,n,!1)},ve=function(e,t,n){return xe(e,t,n,!0)};An.Fragment=i,An.jsx=ye,An.jsxs=ve}()),An);var In=kn.exports;const Sn=H.createContext(null);function Ln(e){var{children:t}=e,n=vn(e,["children"]);return In.jsx(Sn.Provider,{value:n,children:t})}function On(e){const t=H.useContext(Sn);if(!t)throw new Error("Missing UserOptionsContext.Provider in the tree");const n=(null!=e?e:e=>e)(t);return H.useMemo((()=>n),[n])}function Rn(e){const{EmptyDataIcon:t}=On();return t?In.jsx(t,{...e}):In.jsx(o,{...e})}function Mn({sx:t,hasSearch:n,emptyText:o}){return In.jsxs(i,{sx:Object.assign({display:"flex",flexDirection:"column",gap:12,justifyContent:"center",alignItems:"center",typography:"body2",fontWeight:500,color:"text.secondary",textAlign:"center"},t),children:[In.jsx(Rn,{hasSearch:n,sx:{width:60,height:60,borderRadius:12}}),In.jsx(i,{children:null!=o?o:In.jsx(e,{id:"AxPAXW",message:"No results found"})})]})}var _n,Pn;function Bn(){return Bn=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},Bn.apply(null,arguments)}const Dn=e=>W.createElement("svg",Bn({width:60,height:60,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),W.createElement("g",{opacity:.5},W.createElement("mask",{id:"mask0_3521_179418",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:60,height:60},_n||(_n=W.createElement("rect",{width:60,height:60,rx:16,fill:"white"}))),Pn||(Pn=W.createElement("g",{mask:"url(#mask0_3521_179418)"},W.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}),W.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}),W.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}),W.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}),W.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}),W.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}),W.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 Nn({sx:t,refresh:n}){return In.jsxs(i,{sx:ne({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},t),children:[In.jsx(i,{component:Dn,sx:{display:"inline-block",width:60,height:60,mb:12}}),In.jsx(i,{sx:{typography:"body2",width:252,textAlign:"center"},children:In.jsx(i,{component:"span",sx:{color:"text.secondary"},children:In.jsx(e,{id:"Vmw6BM",message:"Something went wrong…<0>Refresh again</0>",components:{0:In.jsx(r,{component:"span",color:"primary.main",weak:!0,sx:{cursor:"pointer"},onClick:()=>{n()}})}})})})]})}var Fn,Un={},qn={exports:{}};(Fn=qn).exports=function(e){return e&&e.__esModule?e:{default:e}},Fn.exports.__esModule=!0,Fn.exports.default=Fn.exports;var Vn,Wn,Hn=qn.exports,Zn={},zn={};function $n(){if(Vn)return zn;Vn=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.default=void 0;var e=H,t=In;var n=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 zn.default=n,zn}var Gn,Yn={};var Qn,Xn={};var Kn,Jn={};var ei,ti={};var ni,ii={};var oi,ri={};var ai,si={};var li,di={};var ci,ui={};var pi,hi={};var mi,gi={};var fi,xi={};var yi,vi={};var bi,ji={};var Ci,wi={};var ki,Ti={};function Ei(){if(ki)return Ti;ki=1;var e=Hn;Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.default=void 0;var t=e($n()),n=In,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 Ti.default=i,Ti}var Ai,Ii={};var Si,Li={};var Oi,Ri={};var Mi,_i={};var Pi,Bi={};var Di,Ni={};var Fi,Ui={};var qi,Vi={};var Wi,Hi={};var Zi,zi={};var $i,Gi={};var Yi,Qi={};var Xi,Ki={};var Ji,eo={};var to,no={};var io,oo={};var ro,ao={};var so,lo={};function co(){if(so)return lo;so=1;var e=Hn;Object.defineProperty(lo,"__esModule",{value:!0}),lo.default=void 0;var t=e($n()),n=In,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 lo.default=i,lo}var uo,po={};var ho,mo={};var go,fo={};var xo,yo={};var vo,bo={};var jo,Co={};var wo,ko={};var To,Eo={};var Ao,Io={};var So,Lo={};var Oo,Ro={};var Mo,_o={};var Po,Bo={};var Do,No={};var Fo,Uo={};var qo,Vo={};var Wo,Ho={};var Zo,zo={};var $o,Go={};var Yo,Qo={};var Xo,Ko={};var Jo,er={};var tr,nr={};var ir,or={};var rr,ar={};var sr,lr={};var dr,cr={};var ur,pr={};var hr,mr={};var gr,fr={};var xr,yr={};var vr,br={};var jr,Cr={};var wr,kr={};var Tr,Er={};var Ar,Ir={};var Sr,Lr={};var Or,Rr={};var Mr,_r={};var Pr,Br={};var Dr,Nr={};var Fr,Ur={};var qr,Vr={};var Wr,Hr={};var Zr,zr={};var $r,Gr={};var Yr,Qr={};var Xr,Kr={};var Jr,ea={};var ta,na={};var ia,oa={};var ra,aa={};var sa,la={};!function(e){var t=Hn;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 g.default}}),Object.defineProperty(e,"Copy",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"DailyMount",{enumerable:!0,get:function(){return x.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 j.default}}),Object.defineProperty(e,"Document",{enumerable:!0,get:function(){return C.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 E.default}}),Object.defineProperty(e,"DollarFilled",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"Done",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"DoneBorder",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"DoneFilled",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(e,"DoubleArrow",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"DoubleArrowBorder",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"DoubleRight",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"Edit",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"Endpoint",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"Error",{enumerable:!0,get:function(){return B.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 z.default}}),Object.defineProperty(e,"HotFilled",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return G.default}}),Object.defineProperty(e,"InvalidFilled",{enumerable:!0,get:function(){return Y.default}}),Object.defineProperty(e,"Language",{enumerable:!0,get:function(){return Q.default}}),Object.defineProperty(e,"LastingDays",{enumerable:!0,get:function(){return X.default}}),Object.defineProperty(e,"Link",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(e,"Loading",{enumerable:!0,get:function(){return J.default}}),Object.defineProperty(e,"Lock",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return te.default}}),Object.defineProperty(e,"Minus",{enumerable:!0,get:function(){return ne.default}}),Object.defineProperty(e,"MoonPay",{enumerable:!0,get:function(){return ie.default}}),Object.defineProperty(e,"More",{enumerable:!0,get:function(){return oe.default}}),Object.defineProperty(e,"NoFound",{enumerable:!0,get:function(){return re.default}}),Object.defineProperty(e,"NoResult",{enumerable:!0,get:function(){return ae.default}}),Object.defineProperty(e,"NoToken",{enumerable:!0,get:function(){return se.default}}),Object.defineProperty(e,"Notice",{enumerable:!0,get:function(){return le.default}}),Object.defineProperty(e,"PlayCircleFilled",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(e,"Plus",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(e,"PriceComparison",{enumerable:!0,get:function(){return ue.default}}),Object.defineProperty(e,"PriceRoute",{enumerable:!0,get:function(){return pe.default}}),Object.defineProperty(e,"Profile",{enumerable:!0,get:function(){return he.default}}),Object.defineProperty(e,"Protect",{enumerable:!0,get:function(){return me.default}}),Object.defineProperty(e,"QuestionBorder",{enumerable:!0,get:function(){return ge.default}}),Object.defineProperty(e,"Refresh",{enumerable:!0,get:function(){return fe.default}}),Object.defineProperty(e,"Route",{enumerable:!0,get:function(){return xe.default}}),Object.defineProperty(e,"Search",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(e,"Setting",{enumerable:!0,get:function(){return ve.default}}),Object.defineProperty(e,"SettingCrossChain",{enumerable:!0,get:function(){return be.default}}),Object.defineProperty(e,"Share",{enumerable:!0,get:function(){return je.default}}),Object.defineProperty(e,"Slippage",{enumerable:!0,get:function(){return Ce.default}}),Object.defineProperty(e,"Star",{enumerable:!0,get:function(){return we.default}}),Object.defineProperty(e,"StarFilled",{enumerable:!0,get:function(){return ke.default}}),Object.defineProperty(e,"Switch",{enumerable:!0,get:function(){return Te.default}}),Object.defineProperty(e,"ThemeModeDark",{enumerable:!0,get:function(){return Ee.default}}),Object.defineProperty(e,"ThemeModeLight",{enumerable:!0,get:function(){return Ae.default}}),Object.defineProperty(e,"Time",{enumerable:!0,get:function(){return Ie.default}}),Object.defineProperty(e,"TokenPair",{enumerable:!0,get:function(){return Se.default}}),Object.defineProperty(e,"TokenSingle",{enumerable:!0,get:function(){return Le.default}}),Object.defineProperty(e,"TotalLiquidity",{enumerable:!0,get:function(){return Oe.default}}),Object.defineProperty(e,"Traders",{enumerable:!0,get:function(){return Re.default}}),Object.defineProperty(e,"VDODO",{enumerable:!0,get:function(){return Me.default}}),Object.defineProperty(e,"Volume",{enumerable:!0,get:function(){return _e.default}}),Object.defineProperty(e,"Warn",{enumerable:!0,get:function(){return Pe.default}});var n=t(function(){if(Wn)return Zn;Wn=1;var e=Hn;Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.default=void 0;var t=e($n()),n=In,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 Zn.default=i,Zn}()),i=t(function(){if(Gn)return Yn;Gn=1;var e=Hn;Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=void 0;var t=e($n()),n=In,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 Yn.default=i,Yn}()),o=t(function(){if(Qn)return Xn;Qn=1;var e=Hn;Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.default=void 0;var t=e($n()),n=In,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 Xn.default=i,Xn}()),r=t(function(){if(Kn)return Jn;Kn=1;var e=Hn;Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.default=void 0;var t=e($n()),n=In,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 Jn.default=i,Jn}()),a=t(function(){if(ei)return ti;ei=1;var e=Hn;Object.defineProperty(ti,"__esModule",{value:!0}),ti.default=void 0;var t=e($n()),n=In,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 ti.default=i,ti}()),s=t(function(){if(ni)return ii;ni=1;var e=Hn;Object.defineProperty(ii,"__esModule",{value:!0}),ii.default=void 0;var t=e($n()),n=In,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 ii.default=i,ii}()),l=t(function(){if(oi)return ri;oi=1;var e=Hn;Object.defineProperty(ri,"__esModule",{value:!0}),ri.default=void 0;var t=e($n()),n=In,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 ri.default=i,ri}()),d=t(function(){if(ai)return si;ai=1;var e=Hn;Object.defineProperty(si,"__esModule",{value:!0}),si.default=void 0;var t=e($n()),n=In,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 si.default=i,si}()),c=t(function(){if(li)return di;li=1;var e=Hn;Object.defineProperty(di,"__esModule",{value:!0}),di.default=void 0;var t=e($n()),n=In,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 di.default=i,di}()),u=t(function(){if(ci)return ui;ci=1;var e=Hn;Object.defineProperty(ui,"__esModule",{value:!0}),ui.default=void 0;var t=e($n()),n=In,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 ui.default=i,ui}()),p=t(function(){if(pi)return hi;pi=1;var e=Hn;Object.defineProperty(hi,"__esModule",{value:!0}),hi.default=void 0;var t=e($n()),n=In,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 hi.default=i,hi}()),h=t(function(){if(mi)return gi;mi=1;var e=Hn;Object.defineProperty(gi,"__esModule",{value:!0}),gi.default=void 0;var t=e($n()),n=In,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 gi.default=i,gi}()),m=t(function(){if(fi)return xi;fi=1;var e=Hn;Object.defineProperty(xi,"__esModule",{value:!0}),xi.default=void 0;var t=e($n()),n=In,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 xi.default=i,xi}()),g=t(function(){if(yi)return vi;yi=1;var e=Hn;Object.defineProperty(vi,"__esModule",{value:!0}),vi.default=void 0;var t=e($n()),n=In,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 vi.default=i,vi}()),f=t(function(){if(bi)return ji;bi=1;var e=Hn;Object.defineProperty(ji,"__esModule",{value:!0}),ji.default=void 0;var t=e($n()),n=In,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 ji.default=i,ji}()),x=t(function(){if(Ci)return wi;Ci=1;var e=Hn;Object.defineProperty(wi,"__esModule",{value:!0}),wi.default=void 0;var t=e($n()),n=In,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 wi.default=i,wi}()),y=t(Ei()),v=t(function(){if(Ai)return Ii;Ai=1;var e=Hn;Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.default=void 0;var t=e($n()),n=In,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 Ii.default=i,Ii}()),b=t(function(){if(Si)return Li;Si=1;var e=Hn;Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var t=e($n()),n=In,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 Li.default=i,Li}()),j=t(function(){if(Oi)return Ri;Oi=1;var e=Hn;Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.default=void 0;var t=e($n()),n=In,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 Ri.default=i,Ri}()),C=t(function(){if(Mi)return _i;Mi=1;var e=Hn;Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var t=e($n()),n=In,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 _i.default=i,_i}()),w=t(function(){if(Pi)return Bi;Pi=1;var e=Hn;Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var t=e($n()),n=In,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 Bi.default=i,Bi}()),k=t(function(){if(Di)return Ni;Di=1;var e=Hn;Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=void 0;var t=e($n()),n=In,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 Ni.default=i,Ni}()),T=t(function(){if(Fi)return Ui;Fi=1;var e=Hn;Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var t=e($n()),n=In,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 Ui.default=i,Ui}()),E=t(function(){if(qi)return Vi;qi=1;var e=Hn;Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var t=e($n()),n=In,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 Vi.default=i,Vi}()),A=t(function(){if(Wi)return Hi;Wi=1;var e=Hn;Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var t=e($n()),n=In,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 Hi.default=i,Hi}()),I=t(function(){if(Zi)return zi;Zi=1;var e=Hn;Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var t=e($n()),n=In,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 zi.default=i,zi}()),S=t(function(){if($i)return Gi;$i=1;var e=Hn;Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var t=e($n()),n=In,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 Gi.default=i,Gi}()),L=t(function(){if(Yi)return Qi;Yi=1;var e=Hn;Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.default=void 0;var t=e($n()),n=In,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 Qi.default=i,Qi}()),O=t(function(){if(Xi)return Ki;Xi=1;var e=Hn;Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=void 0;var t=e($n()),n=In,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 Ki.default=i,Ki}()),R=t(function(){if(Ji)return eo;Ji=1;var e=Hn;Object.defineProperty(eo,"__esModule",{value:!0}),eo.default=void 0;var t=e($n()),n=In,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 eo.default=i,eo}()),M=t(function(){if(to)return no;to=1;var e=Hn;Object.defineProperty(no,"__esModule",{value:!0}),no.default=void 0;var t=e($n()),n=In,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 no.default=i,no}()),_=t(function(){if(io)return oo;io=1;var e=Hn;Object.defineProperty(oo,"__esModule",{value:!0}),oo.default=void 0;var t=e($n()),n=In,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 oo.default=i,oo}()),P=t(function(){if(ro)return ao;ro=1;var e=Hn;Object.defineProperty(ao,"__esModule",{value:!0}),ao.default=void 0;var t=e($n()),n=In,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 ao.default=i,ao}()),B=t(co()),D=t(function(){if(uo)return po;uo=1;var e=Hn;Object.defineProperty(po,"__esModule",{value:!0}),po.default=void 0;var t=e($n()),n=In,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 po.default=i,po}()),N=t(function(){if(ho)return mo;ho=1;var e=Hn;Object.defineProperty(mo,"__esModule",{value:!0}),mo.default=void 0;var t=e($n()),n=In,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 mo.default=i,mo}()),F=t(function(){if(go)return fo;go=1;var e=Hn;Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0;var t=e($n()),n=In,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 fo.default=i,fo}()),U=t(function(){if(xo)return yo;xo=1;var e=Hn;Object.defineProperty(yo,"__esModule",{value:!0}),yo.default=void 0;var t=e($n()),n=In,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 yo.default=i,yo}()),q=t(function(){if(vo)return bo;vo=1;var e=Hn;Object.defineProperty(bo,"__esModule",{value:!0}),bo.default=void 0;var t=e($n()),n=In,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 bo.default=i,bo}()),V=t(function(){if(jo)return Co;jo=1;var e=Hn;Object.defineProperty(Co,"__esModule",{value:!0}),Co.default=void 0;var t=e($n()),n=In,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 Co.default=i,Co}()),W=t(function(){if(wo)return ko;wo=1;var e=Hn;Object.defineProperty(ko,"__esModule",{value:!0}),ko.default=void 0;var t=e($n()),n=In,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 ko.default=i,ko}()),H=t(function(){if(To)return Eo;To=1;var e=Hn;Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.default=void 0;var t=e($n()),n=In,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 Eo.default=i,Eo}()),Z=t(function(){if(Ao)return Io;Ao=1;var e=Hn;Object.defineProperty(Io,"__esModule",{value:!0}),Io.default=void 0;var t=e($n()),n=In,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 Io.default=i,Io}()),z=t(function(){if(So)return Lo;So=1;var e=Hn;Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.default=void 0;var t=e($n()),n=In,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 Lo.default=i,Lo}()),$=t(function(){if(Oo)return Ro;Oo=1;var e=Hn;Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.default=void 0;var t=e($n()),n=In,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 Ro.default=i,Ro}()),G=t(function(){if(Mo)return _o;Mo=1;var e=Hn;Object.defineProperty(_o,"__esModule",{value:!0}),_o.default=void 0;var t=e($n()),n=In,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 _o.default=i,_o}()),Y=t(function(){if(Po)return Bo;Po=1;var e=Hn;Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.default=void 0;var t=e($n()),n=In,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 Bo.default=i,Bo}()),Q=t(function(){if(Do)return No;Do=1;var e=Hn;Object.defineProperty(No,"__esModule",{value:!0}),No.default=void 0;var t=e($n()),n=In,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 No.default=i,No}()),X=t(function(){if(Fo)return Uo;Fo=1;var e=Hn;Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.default=void 0;var t=e($n()),n=In,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 Uo.default=i,Uo}()),K=t(function(){if(qo)return Vo;qo=1;var e=Hn;Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.default=void 0;var t=e($n()),n=In,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 Vo.default=i,Vo}()),J=t(function(){if(Wo)return Ho;Wo=1;var e=Hn;Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.default=void 0;var t=e($n()),n=In,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 Ho.default=i,Ho}()),ee=t(function(){if(Zo)return zo;Zo=1;var e=Hn;Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var t=e($n()),n=In,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 zo.default=i,zo}()),te=t(function(){if($o)return Go;$o=1;var e=Hn;Object.defineProperty(Go,"__esModule",{value:!0}),Go.default=void 0;var t=e($n()),n=In,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 Go.default=i,Go}()),ne=t(function(){if(Yo)return Qo;Yo=1;var e=Hn;Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var t=e($n()),n=In,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M5 11h14v2H5z"}),"Minus");return Qo.default=i,Qo}()),ie=t(function(){if(Xo)return Ko;Xo=1;var e=Hn;Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.default=void 0;var t=e($n()),n=In,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 Ko.default=i,Ko}()),oe=t(function(){if(Jo)return er;Jo=1;var e=Hn;Object.defineProperty(er,"__esModule",{value:!0}),er.default=void 0;var t=e($n()),n=In,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 er.default=i,er}()),re=t(function(){if(tr)return nr;tr=1;var e=Hn;Object.defineProperty(nr,"__esModule",{value:!0}),nr.default=void 0;var t=e($n()),n=In,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 nr.default=i,nr}()),ae=t(function(){if(ir)return or;ir=1;var e=Hn;Object.defineProperty(or,"__esModule",{value:!0}),or.default=void 0;var t=e($n()),n=In,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 or.default=i,or}()),se=t(function(){if(rr)return ar;rr=1;var e=Hn;Object.defineProperty(ar,"__esModule",{value:!0}),ar.default=void 0;var t=e($n()),n=In,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 ar.default=i,ar}()),le=t(function(){if(sr)return lr;sr=1;var e=Hn;Object.defineProperty(lr,"__esModule",{value:!0}),lr.default=void 0;var t=e($n()),n=In,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 lr.default=i,lr}()),de=t(function(){if(dr)return cr;dr=1;var e=Hn;Object.defineProperty(cr,"__esModule",{value:!0}),cr.default=void 0;var t=e($n()),n=In,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 cr.default=i,cr}()),ce=t(function(){if(ur)return pr;ur=1;var e=Hn;Object.defineProperty(pr,"__esModule",{value:!0}),pr.default=void 0;var t=e($n()),n=In,i=(0,t.default)((0,n.jsx)("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2Z"}),"Plus");return pr.default=i,pr}()),ue=t(function(){if(hr)return mr;hr=1;var e=Hn;Object.defineProperty(mr,"__esModule",{value:!0}),mr.default=void 0;var t=e($n()),n=In,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 mr.default=i,mr}()),pe=t(function(){if(gr)return fr;gr=1;var e=Hn;Object.defineProperty(fr,"__esModule",{value:!0}),fr.default=void 0;var t=e($n()),n=In,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 fr.default=i,fr}()),he=t(function(){if(xr)return yr;xr=1;var e=Hn;Object.defineProperty(yr,"__esModule",{value:!0}),yr.default=void 0;var t=e($n()),n=In,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 yr.default=i,yr}()),me=t(function(){if(vr)return br;vr=1;var e=Hn;Object.defineProperty(br,"__esModule",{value:!0}),br.default=void 0;var t=e($n()),n=In,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 br.default=i,br}()),ge=t(function(){if(jr)return Cr;jr=1;var e=Hn;Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.default=void 0;var t=e($n()),n=In,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 Cr.default=i,Cr}()),fe=t(function(){if(wr)return kr;wr=1;var e=Hn;Object.defineProperty(kr,"__esModule",{value:!0}),kr.default=void 0;var t=e($n()),n=In,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 kr.default=i,kr}()),xe=t(function(){if(Tr)return Er;Tr=1;var e=Hn;Object.defineProperty(Er,"__esModule",{value:!0}),Er.default=void 0;var t=e($n()),n=In,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 Er.default=i,Er}()),ye=t(function(){if(Ar)return Ir;Ar=1;var e=Hn;Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.default=void 0;var t=e($n()),n=In,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 Ir.default=i,Ir}()),ve=t(function(){if(Sr)return Lr;Sr=1;var e=Hn;Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.default=void 0;var t=e($n()),n=In,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 Lr.default=i,Lr}()),be=t(function(){if(Or)return Rr;Or=1;var e=Hn;Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.default=void 0;var t=e($n()),n=In,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 Rr.default=i,Rr}()),je=t(function(){if(Mr)return _r;Mr=1;var e=Hn;Object.defineProperty(_r,"__esModule",{value:!0}),_r.default=void 0;var t=e($n()),n=In,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 _r.default=i,_r}()),Ce=t(function(){if(Pr)return Br;Pr=1;var e=Hn;Object.defineProperty(Br,"__esModule",{value:!0}),Br.default=void 0;var t=e($n()),n=In,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 Br.default=i,Br}()),we=t(function(){if(Dr)return Nr;Dr=1;var e=Hn;Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.default=void 0;var t=e($n()),n=In,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 Nr.default=i,Nr}()),ke=t(function(){if(Fr)return Ur;Fr=1;var e=Hn;Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.default=void 0;var t=e($n()),n=In,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 Ur.default=i,Ur}()),Te=t(function(){if(qr)return Vr;qr=1;var e=Hn;Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.default=void 0;var t=e($n()),n=In,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 Vr.default=i,Vr}()),Ee=t(function(){if(Wr)return Hr;Wr=1;var e=Hn;Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.default=void 0;var t=e($n()),n=In,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 Hr.default=i,Hr}()),Ae=t(function(){if(Zr)return zr;Zr=1;var e=Hn;Object.defineProperty(zr,"__esModule",{value:!0}),zr.default=void 0;var t=e($n()),n=In,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 zr.default=i,zr}()),Ie=t(function(){if($r)return Gr;$r=1;var e=Hn;Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.default=void 0;var t=e($n()),n=In,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 Gr.default=i,Gr}()),Se=t(function(){if(Yr)return Qr;Yr=1;var e=Hn;Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.default=void 0;var t=e($n()),n=In,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 Qr.default=i,Qr}()),Le=t(function(){if(Xr)return Kr;Xr=1;var e=Hn;Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.default=void 0;var t=e($n()),n=In,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 Kr.default=i,Kr}()),Oe=t(function(){if(Jr)return ea;Jr=1;var e=Hn;Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=void 0;var t=e($n()),n=In,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 ea.default=i,ea}()),Re=t(function(){if(ta)return na;ta=1;var e=Hn;Object.defineProperty(na,"__esModule",{value:!0}),na.default=void 0;var t=e($n()),n=In,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 na.default=i,na}()),Me=t(function(){if(ia)return oa;ia=1;var e=Hn;Object.defineProperty(oa,"__esModule",{value:!0}),oa.default=void 0;var t=e($n()),n=In,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 oa.default=i,oa}()),_e=t(function(){if(ra)return aa;ra=1;var e=Hn;Object.defineProperty(aa,"__esModule",{value:!0}),aa.default=void 0;var t=e($n()),n=In,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 aa.default=i,aa}()),Pe=t(function(){if(sa)return la;sa=1;var e=Hn;Object.defineProperty(la,"__esModule",{value:!0}),la.default=void 0;var t=e($n()),n=In,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 la.default=i,la}())}(Un);const da={[de.MAINNET]:["https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io","https://rpc.ankr.com/eth"],[de.GOERLI]:["https://gateway.tenderly.co/public/goerli"],[de.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org"],[de.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"],[de.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[de.ARBITRUM_SEPOLIA]:["https://sepolia-rollup.arbitrum.io/rpc"],[de.AURORA]:["https://mainnet.aurora.dev/"],[de.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[de.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[de.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[de.CONFLUX]:["https://evm.confluxrpc.com"],[de.BASE]:["https://mainnet.base.org"],[de.LINEA]:["https://rpc.linea.build"],[de.SCROLL]:["https://rpc.scroll.io"],[de.MANTA]:["https://pacific-rpc.manta.network/http"],[de.MANTLE]:["https://rpc.mantle.xyz"],[de.SEPOLIA]:["https://ethereum-sepolia-rpc.publicnode.com"],[de.DODO_CHAIN_TESTNET]:["https://dodochain-testnet.alt.technology"],[de.TAIKO]:["https://rpc.mainnet.taiko.xyz"],[de.PLUME]:["https://phoenix-rpc.plumenetwork.xyz"],[de.PLUME_TESTNET]:["https://test-rpc.plumenetwork.xyz"],[de.NEOX]:["https://mainnet-1.rpc.banelabs.org"],[de.MORPH]:["https://rpc.morphl2.io"],[de.RISE_TESTNET]:["https://testnet.riselabs.xyz"],[de.ZETACHAIN]:["https://zetachain-evm.blockpi.network/v1/rpc/public"],[de.ZETACHAIN_TESTNET]:["https://zetachain-athens-evm.blockpi.network/v1/rpc/public"],[de.SOLANA]:[Re("mainnet-beta")],[de.SOLANA_DEVNET]:[Re("devnet")],[de.BTC]:["https://rpc.walletconnect.org/v1"],[de.BTC_SIGNET]:["https://rpc.walletconnect.org/v1"]},ca=e=>{const t={};return Object.entries(da).forEach((([e,n])=>{const i=Number(e),o=n,[r]=o;r&&(t[i]=r)})),t},ua={[de.MAINNET]:"etherscan.io",[de.GOERLI]:"goerli.etherscan.io",[de.OPTIMISM]:"optimistic.etherscan.io",[de.CONFLUX]:"snowtrace.io",[de.BSC]:"bscscan.com",[de.OKCHAIN]:"www.oklink.com/okexchain",[de.POLYGON]:"polygonscan.com",[de.ARBITRUM_ONE]:"arbiscan.io",[de.ARBITRUM_SEPOLIA]:"sepolia.arbiscan.io",[de.AURORA]:"aurorascan.dev",[de.AVALANCHE]:"snowtrace.io",[de.BASE]:"basescan.org",[de.LINEA]:"lineascan.build",[de.SCROLL]:"scrollscan.com",[de.MANTA]:"pacific-explorer.manta.network",[de.MANTLE]:"explorer.mantle.xyz",[de.SEPOLIA]:"sepolia.etherscan.io",[de.DODO_CHAIN_TESTNET]:"dodochain-testnet-explorer.alt.technology",[de.TAIKO]:"taikoscan.io",[de.PLUME]:"phoenix-explorer.plumenetwork.xyz",[de.PLUME_TESTNET]:"test-explorer.plumenetwork.xyz",[de.NEOX]:"xexplorer.neo.org",[de.MORPH]:"explorer.morphl2.io",[de.RISE_TESTNET]:"explorer.testnet.riselabs.xyz",[de.ZETACHAIN]:"zetachain.blockscout.com",[de.ZETACHAIN_TESTNET]:"zetachain-testnet.blockscout.com",[de.SOLANA]:"solscan.io",[de.SOLANA_DEVNET]:"solscan.io",[de.BTC]:"mempool.space",[de.BTC_SIGNET]:"mempool.space/signet"},pa={[de.BSC]:"bsc",[de.MAINNET]:"ethereum-mainnet",[de.POLYGON]:"polygon",[de.ARBITRUM_ONE]:"arbitrum",[de.ARBITRUM_SEPOLIA]:"arb-sep",[de.OKCHAIN]:"okchain",[de.OPTIMISM]:"optimism",[de.AURORA]:"aurora",[de.AVALANCHE]:"avalanche",[de.GOERLI]:"gor",[de.CONFLUX]:"cfx",[de.BASE]:"base",[de.LINEA]:"linea",[de.SCROLL]:"scr",[de.MANTA]:"manta",[de.MANTLE]:"mantle",[de.SEPOLIA]:"sepolia",[de.DODO_CHAIN_TESTNET]:"dodochain-testnet",[de.TAIKO]:"taiko",[de.PLUME]:"plume",[de.PLUME_TESTNET]:"plume-testnet",[de.NEOX]:"neox",[de.MORPH]:"morph",[de.RISE_TESTNET]:"rise-testnet",[de.ZETACHAIN]:"zetachain",[de.ZETACHAIN_TESTNET]:"zetachain-testnet",[de.SOLANA]:"solana",[de.SOLANA_DEVNET]:"solana-devnet",[de.BTC]:"btc",[de.BTC_SIGNET]:"btc-signet"};de.MAINNET,de.GOERLI,de.OPTIMISM,de.CONFLUX,de.BSC,de.OKCHAIN,de.POLYGON,de.ARBITRUM_ONE,de.ARBITRUM_SEPOLIA,de.AURORA,de.AVALANCHE,de.BASE,de.LINEA,de.SCROLL,de.MANTA,de.MANTLE,de.SEPOLIA,de.DODO_CHAIN_TESTNET,de.TAIKO,de.PLUME,de.PLUME_TESTNET,de.NEOX,de.MORPH,de.RISE_TESTNET,de.ZETACHAIN,de.ZETACHAIN_TESTNET,de.SOLANA,de.SOLANA_DEVNET,de.BTC,de.BTC_SIGNET,de.MAINNET,de.GOERLI,de.OPTIMISM,de.CONFLUX,de.BSC,de.OKCHAIN,de.POLYGON,de.ARBITRUM_ONE,de.ARBITRUM_SEPOLIA,de.AURORA,de.AVALANCHE,de.BASE,de.LINEA,de.SCROLL,de.MANTA,de.MANTLE,de.SEPOLIA,de.DODO_CHAIN_TESTNET,de.TAIKO,de.PLUME,de.PLUME_TESTNET,de.NEOX,de.MORPH,de.RISE_TESTNET,de.ZETACHAIN,de.ZETACHAIN_TESTNET,de.SOLANA,de.SOLANA_DEVNET,de.BTC,de.BTC_SIGNET;const ha={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"}},ma={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"}},ga={[de.MAINNET]:[ha,ma],[de.GOERLI]:[],[de.OPTIMISM]:[],[de.CONFLUX]:[],[de.BSC]:[],[de.OKCHAIN]:[],[de.POLYGON]:[],[de.ARBITRUM_ONE]:[],[de.ARBITRUM_SEPOLIA]:[],[de.AURORA]:[],[de.AVALANCHE]:[],[de.BASE]:[],[de.LINEA]:[],[de.SCROLL]:[],[de.MANTA]:[],[de.MANTLE]:[],[de.SEPOLIA]:[ha,ma],[de.DODO_CHAIN_TESTNET]:[],[de.TAIKO]:[],[de.PLUME]:[],[de.PLUME_TESTNET]:[],[de.NEOX]:[],[de.MORPH]:[],[de.RISE_TESTNET]:[],[de.ZETACHAIN]:[],[de.ZETACHAIN_TESTNET]:[],[de.SOLANA]:[],[de.SOLANA_DEVNET]:[],[de.BTC]:[],[de.BTC_SIGNET]:[]};var fa;!function(e){e.routePrice="routePrice",e.solanaRoutePrice="solanaRoutePrice",e.fiatPrice="fiatPrice",e.bridgeRoutePrice="bridgeRoutePrice",e.bridgeEncode="bridgeEncode",e.bridgeCreateRoute="bridgeCreateRoute"}(fa||(fa={}));const xa="https://api.dodoex.io/cross-chain/widget",ya="https://api.dodoex.io/route-service/zetachain/swap",va="https://api.dodoex.io/route-service/zetachain/svm/swap",ba="https://api.dodoex.io/frontend-price-api-v2/current/batch",ja=`${xa}/routes`,Ca=`${xa}/transaction/encode`,wa=`${xa}/order/create`;function ka(e,t={}){var n,i,o,r,a,s;switch(e){case fa.routePrice:return null!==(n=t.routePrice)&&void 0!==n?n:ya;case fa.solanaRoutePrice:return null!==(i=t.solanaRoutePrice)&&void 0!==i?i:va;case fa.fiatPrice:return null!==(o=t.fiatPrice)&&void 0!==o?o:ba;case fa.bridgeRoutePrice:return null!==(r=t.bridgeRoutePrice)&&void 0!==r?r:ja;case fa.bridgeEncode:return null!==(a=t.bridgeEncode)&&void 0!==a?a:Ca;case fa.bridgeCreateRoute:return null!==(s=t.bridgeCreateRoute)&&void 0!==s?s:wa;default:throw new Error(`Invalid key = ${e}`)}}const Ta=new ce({rpc:ca()}),Ea=new ue({contractRequests:Ta});var Aa,Ia,Sa,La,Oa;function Ra(){return Ra=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},Ra.apply(null,arguments)}var Ma,_a;function Pa(){return Pa=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},Pa.apply(null,arguments)}var Ba,Da,Na;function Fa(){return Fa=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},Fa.apply(null,arguments)}var Ua;function qa(){return qa=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},qa.apply(null,arguments)}var Va,Wa,Ha;function Za(){return Za=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},Za.apply(null,arguments)}var za,$a;function Ga(){return Ga=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},Ga.apply(null,arguments)}const Ya=e=>W.createElement("svg",Ga({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),za||(za=W.createElement("g",{clipPath:"url(#clip0_5431_179637)"},W.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"}),W.createElement("path",{d:"M12.3735 3V9.6525L17.9963 12.165L12.3735 3Z",fill:"#343434"}),W.createElement("path",{d:"M12.3735 3L6.75 12.165L12.3735 9.6525V3Z",fill:"#8C8C8C"}),W.createElement("path",{d:"M12.3735 16.4759V20.9962L18 13.2119L12.3735 16.4759Z",fill:"#3C3C3B"}),W.createElement("path",{d:"M12.3735 20.9962V16.4752L6.75 13.2119L12.3735 20.9962Z",fill:"#8C8C8C"}),W.createElement("path",{d:"M12.3735 15.4298L17.9963 12.1651L12.3735 9.65405V15.4298Z",fill:"#141414"}),W.createElement("path",{d:"M6.75 12.1651L12.3735 15.4298V9.65405L6.75 12.1651Z",fill:"#393939"}))),$a||($a=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_5431_179637"},W.createElement("rect",{width:24,height:24,fill:"white"})))));var Qa,Xa;function Ka(){return Ka=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},Ka.apply(null,arguments)}var Ja,es,ts,ns;function is(){return is=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},is.apply(null,arguments)}const os=e=>W.createElement("svg",is({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),W.createElement("g",{clipPath:"url(#clip0_10530_9160)"},Ja||(Ja=W.createElement("rect",{width:24,height:24,fill:"black"})),W.createElement("g",{clipPath:"url(#clip1_10530_9160)"},W.createElement("mask",{id:"mask0_10530_9160",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:4,y:5,width:16,height:14},es||(es=W.createElement("path",{d:"M19.0117 5.69995H4.97998V18.272H19.0117V5.69995Z",fill:"white"}))),ts||(ts=W.createElement("g",{mask:"url(#mask0_10530_9160)"},W.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)"}))))),ns||(ns=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_10530_9160",x1:6.16443,y1:18.5716,x2:17.7026,y2:5.58804,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{offset:.08,stopColor:"#9945FF"}),W.createElement("stop",{offset:.3,stopColor:"#8752F3"}),W.createElement("stop",{offset:.5,stopColor:"#5497D5"}),W.createElement("stop",{offset:.6,stopColor:"#43B4CA"}),W.createElement("stop",{offset:.72,stopColor:"#28E0B9"}),W.createElement("stop",{offset:.97,stopColor:"#19FB9B"})),W.createElement("clipPath",{id:"clip0_10530_9160"},W.createElement("rect",{width:24,height:24,rx:12,fill:"white"})),W.createElement("clipPath",{id:"clip1_10530_9160"},W.createElement("rect",{width:14.0349,height:12.6,fill:"white",transform:"translate(4.97998 5.69995)"})))));var rs,as;function ss(){return ss=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},ss.apply(null,arguments)}const ls=e=>W.createElement("svg",ss({width:32,height:32,viewBox:"0 0 90 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rs||(rs=W.createElement("g",{clipPath:"url(#clip0_1737_111)"},W.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"}),W.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"}))),as||(as=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_1737_111"},W.createElement("rect",{width:89,height:89,fill:"white",transform:"translate(0.5 0.5)"}))))),ds="0x0000000000000000000000000000000000000000",cs=e=>{if(!e)return ds;const t=us.get(e);return t?t.fallbackAddress:ds},us=new Map([[de.MAINNET,{chainId:de.MAINNET,logo:Ya,name:"Ethereum",caipNetwork:Ue,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.POLYGON,{chainId:de.POLYGON,logo:e=>W.createElement("svg",Ka({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Qa||(Qa=W.createElement("defs",null,W.createElement("circle",{id:"path-1",cx:12,cy:12,r:12}))),Xa||(Xa=W.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},W.createElement("g",{transform:"translate(-223.000000, -266.000000)"},W.createElement("g",{transform:"translate(18.000000, 132.000000)"},W.createElement("g",{transform:"translate(20.000000, 41.000000)"},W.createElement("g",{transform:"translate(156.000000, 82.000000)"},W.createElement("g",{transform:"translate(29.000000, 11.000000)"},W.createElement("mask",{id:"mask-2",fill:"white"},W.createElement("use",{xlinkHref:"#path-1"})),W.createElement("g",null),W.createElement("g",{mask:"url(#mask-2)"},W.createElement("circle",{fill:"#8247E5",fillRule:"nonzero",cx:12,cy:12,r:12}),W.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:qe,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.BSC,{chainId:de.BSC,logo:e=>W.createElement("svg",Fa({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),Ba||(Ba=W.createElement("defs",null,W.createElement("style",{type:"text/css"},".fil0 {fill:none}\n .fil1 {fill:#f0b90b}\n .fil2 {fill:#fff}"))),Da||(Da=W.createElement("g",{id:"Layer_x0020_1"},W.createElement("metadata",{id:"CorelCorpID_0Corel-Layer"}),W.createElement("rect",{className:"fil0",width:7500,height:7500}),W.createElement("g",{id:"_2419820813232"},W.createElement("circle",{className:"fil1",cx:3750,cy:3750,r:3500}),W.createElement("g",null,W.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"})),W.createElement("g",null,W.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"}))))),Na||(Na=W.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:"BNBChain",caipNetwork:Ve,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.BASE,{chainId:de.BASE,logo:e=>W.createElement("svg",Pa({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Ma||(Ma=W.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"})),_a||(_a=W.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:"Base",caipNetwork:We,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.ZETACHAIN,{chainId:de.ZETACHAIN,logo:ls,name:"Zetachain",caipNetwork:He,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.SOLANA,{chainId:de.SOLANA,logo:os,name:"Solana",caipNetwork:Ze,isEVMChain:!1,isSolanaChain:!0,isBTCChain:!1,fallbackAddress:ds}],[de.BTC,{chainId:de.BTC,logo:e=>W.createElement("svg",Za({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),W.createElement("g",{id:"bitcoinchain 1",clipPath:"url(#clip0_68_34440)"},W.createElement("g",{id:"Clip path group"},W.createElement("mask",{id:"mask0_68_34440",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:0,y:0,width:24,height:24},Va||(Va=W.createElement("g",{id:"clip0_240_54028"},W.createElement("path",{id:"Vector",d:"M24 0H0V24H24V0Z",fill:"white"})))),Wa||(Wa=W.createElement("g",{mask:"url(#mask0_68_34440)"},W.createElement("g",{id:"Group"},W.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"}),W.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"})))))),Ha||(Ha=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_68_34440"},W.createElement("rect",{width:24,height:24,fill:"white"}))))),name:"Bitcoin",caipNetwork:ze,isEVMChain:!1,isSolanaChain:!1,isBTCChain:!0,fallbackAddress:ds}],[de.SEPOLIA,{chainId:de.SEPOLIA,logo:Ya,name:"Ethereum Sepolia",caipNetwork:$e,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.ARBITRUM_SEPOLIA,{chainId:de.ARBITRUM_SEPOLIA,logo:e=>W.createElement("svg",Ra({height:"692pt",viewBox:"0 0 619 692",width:"619pt",xmlns:"http://www.w3.org/2000/svg"},e),Aa||(Aa=W.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"})),Ia||(Ia=W.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"})),Sa||(Sa=W.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"})),La||(La=W.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"})),Oa||(Oa=W.createElement("g",{fill:"#00a2f7"},W.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"}),W.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:"Arbitrum Sepolia",caipNetwork:Ge,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.ZETACHAIN_TESTNET,{chainId:de.ZETACHAIN_TESTNET,logo:ls,name:"Zetachain Testnet",mainnet:de.ZETACHAIN,caipNetwork:pe,isEVMChain:!0,isSolanaChain:!1,isBTCChain:!1,fallbackAddress:ds}],[de.SOLANA_DEVNET,{chainId:de.SOLANA_DEVNET,logo:os,name:"Solana Devnet",caipNetwork:Ye,isEVMChain:!1,isSolanaChain:!0,isBTCChain:!1,fallbackAddress:"CVVQYs9Pi3t4it4KFpm3hxk97uDA6AVzNVJvGQTPH17n"}],[de.BTC_SIGNET,{chainId:de.BTC_SIGNET,logo:e=>W.createElement("svg",qa({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 65 65",width:22,height:22},e),Ua||(Ua=W.createElement("g",{transform:"translate(0.00630876,-0.00301984)"},W.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"}),W.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:"Bitcoin Signet",caipNetwork:he,isEVMChain:!1,isSolanaChain:!1,isBTCChain:!0,fallbackAddress:"tb1qcrd8yvatjzpxl0ew29jsps2z595jpwtm5mj38v"}]]),ps=e=>{var t;return!!(null===(t=us.get(e))||void 0===t?void 0:t.mainnet)},hs="DODO_WIDGET_LAST_FROM_TOKEN",ms="DODO_WIDGET_LAST_TO_TOKEN";function gs(e,t){localStorage.setItem("from"===e?hs:ms,t?JSON.stringify(t):"")}const fs="DODO_WIDGET_SLIPPAGE_SWAP",xs="DODO_WIDGET_SLIPPAGE_BRIDGE";const ys={PoolEditPage:"risk-warning-once-pool-edit"};const vs=15,bs=.2,js=50,Cs=20,ws=3e4,ks=.5,Ts="swap-review-btn",Es="swap-select-token-btn",As="select-token-btn",Is="token-picker-wrapper",Ss="token-picker-item",Ls=it((e=>({tokenList:[],popularTokenList:[],slippageWithTokens:[]})));function Os(e){const{tokenList:t,popularTokenList:n}=null!=e?e:Ls.getState();return ie(n,t,(e=>e.address.toLowerCase()+e.chainId+e.side))}function Rs({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 Oe(e.inAmountWithOutDecimals),toTokenAmount:new Oe(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 Ms;function _s({input:e,showDecimals:t=4,showPrecisionDecimals:n=2,exponentialDecimalsAmount:i=8,showIntegerOnly:o=!1,showDecimalsOnly:r=!1,noGroupSeparator:a=!1,roundingMode:s=Oe.ROUND_DOWN}){const l=new Oe(e);if(l.isNaN())return"-";let d=l.dp(t,s);if(d.eq(0)&&(l.gt(0)||l.lt(0))){const e=null!=n?n:t;d=l.sd(e,Oe.ROUND_DOWN);const a=d.dp();if(a&&a>i&&!r&&!o)return d.toExponential();d=l.sd(null!=n?n:t,Oe.ROUND_DOWN)}return o&&(d=d.integerValue(Oe.ROUND_DOWN)),r&&(d=d.minus(d.integerValue(Oe.ROUND_DOWN))),a?d.toFormat({decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0}):d.toFormat()}function Ps({input:e,decimals:t,showPrecisionDecimals:n=2,exponentialDecimalsAmount:i,noGroupSeparator:o}){if(null==e)return"-";const r=new Oe(e);if(r.isNaN())return"-";return _s({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"}(Ms||(Ms={}));function Bs(e){if("number"==typeof e)return Bs(new Oe(e));if(e.isNaN())return"NaN";if(e.isNegative())return`-${Bs(e.negated())}`;if(e.isZero())return"0";let t=e.integerValue(Oe.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(Oe.ROUND_FLOOR);i+=t.toString(),n=e.minus(t),o+=1}return i}const Ds=(e,t)=>{if("string"==typeof e&&!e.match(/[-+]?\d+(.+d+)?/))return e;const n=new Oe(e);if(t){let e=n.toFixed(t,Oe.ROUND_DOWN);return new Oe(e).isZero()&&(e=Bs(n.precision(t,Oe.ROUND_DOWN))),e}return Bs(n)},Ns=(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?Ds(n,t):n},Fs=(e,t,n)=>new Oe(e).times(new Oe(10).pow(t)).dp(0),Us=(e,t)=>new Oe(e).div(new Oe(10).pow(t));function qs(e){return Number(e.toString().split(".")[0])}const Vs=1e3,Ws=1e6,Hs=1e9;function Zs(e){return new Oe(e).negated()}function zs(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(Vs)&&e.gt(Zs(Vs))?_s({input:e,showDecimals:t}):e.lt(Ws)&&e.gt(Zs(Ws))?`${_s({input:e.div(Vs),showDecimals:2})}K`:`${_s({input:e.div(Ws),showDecimals:2})}M`}function $s(e){if(!e||e.isNaN())return"-";if(e.isZero())return"0";if(e.lte(Hs)&&e.gt(Zs(Hs)))return zs(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 Gs({input:e,showDecimals:t=2,roundingMode:n=Oe.ROUND_HALF_UP}){return null==e?"-":`${_s({input:new Oe(e||0).multipliedBy(100),showDecimals:t,roundingMode:n})}%`}const Ys=(e,t=2)=>Gs({input:e,showDecimals:t});function Qs(e){return e?"unknown"===e.symbol?e.name:e.symbol:""}let Xs=!1,Ks=!1;const Js={debug:1,default:2,info:2,warning:3,error:4,off:5};let el=Js.default,tl=null;const nl=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 il,ol;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(il||(il={})),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"}(ol||(ol={}));const rl="0123456789abcdef";class al{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==Js[n]&&this.throwArgumentError("invalid log level name","logLevel",e),el>Js[n]||console.log.apply(console,t)}debug(...e){this._log(al.levels.DEBUG,e)}info(...e){this._log(al.levels.INFO,e)}warn(...e){this._log(al.levels.WARNING,e)}makeError(e,t,n){if(Ks)return this.makeError("censored error",t,{});t||(t=al.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+=rl[t[e]>>4],n+=rl[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 ol.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 ol.CALL_EXCEPTION:case ol.INSUFFICIENT_FUNDS:case ol.MISSING_NEW:case ol.NONCE_EXPIRED:case ol.REPLACEMENT_UNDERPRICED:case ol.TRANSACTION_REPLACED:case ol.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,al.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){nl&&this.throwError("platform missing String.prototype.normalize",al.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:nl})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,al.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,al.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,al.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,al.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",al.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",al.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",al.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return tl||(tl=new al("logger/5.8.0")),tl}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",al.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Xs){if(!e)return;this.globalLogger().throwError("error censorship permanent",al.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Ks=!!e,Xs=!!t}static setLogLevel(e){const t=Js[e.toLowerCase()];null!=t?el=t:al.globalLogger().warn("invalid log level - "+e)}static from(e){return new al(e)}}al.errors=ol,al.levels=il;const sl=new al("bytes/5.8.0");function ll(e){return!!e.toHexString}function dl(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return dl(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function cl(e){return"number"==typeof e&&e==e&&e%1==0}function ul(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!cl(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!cl(n)||n<0||n>=256)return!1}return!0}function pl(e,t){if(t||(t={}),"number"==typeof e){sl.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),dl(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),ll(e)&&(e=e.toHexString()),gl(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":sl.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 dl(new Uint8Array(i))}return ul(e)?dl(new Uint8Array(e)):sl.throwArgumentError("invalid arrayify value","value",e)}function hl(e){const t=e.map((e=>pl(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),dl(i)}function ml(e,t){(e=pl(e)).length>t&&sl.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),dl(n)}function gl(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const fl="0123456789abcdef";function xl(e,t){if(t||(t={}),"number"==typeof e){sl.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=fl[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),ll(e))return e.toHexString();if(gl(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":sl.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(ul(e)){let t="0x";for(let n=0;n<e.length;n++){let i=e[n];t+=fl[(240&i)>>4]+fl[15&i]}return t}return sl.throwArgumentError("invalid hexlify value","value",e)}function yl(e){if("string"!=typeof e)e=xl(e);else if(!gl(e)||e.length%2)return null;return(e.length-2)/2}function vl(e,t,n){return"string"!=typeof e?e=xl(e):(!gl(e)||e.length%2)&&sl.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function bl(e,t){for("string"!=typeof e?e=xl(e):gl(e)||sl.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&sl.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}var jl={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=jn: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 g=function(e,t,n){return function(i){return new L(e,t,e).update(i)[n]()}},f=function(e,t,n){return function(i,o){return new L(e,t,o).update(i)[n]()}},x=function(e,t,n){return function(t,i,o,r){return C["cshake"+e].update(t,i,o,r)[n]()}},y=function(e,t,n){return function(t,i,o,r){return C["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=g(e,t,"hex");return n.create=function(){return new L(e,t,e)},n.update=function(e){return n.create().update(e)},v(n,g,e,t)},j=[{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=f(e,t,"hex");return n.create=function(n){return new L(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},v(n,f,e,t)}},{name:"cshake",padding:l,bits:p,createMethod:function(e,t){var n=m[e],i=x(e,0,"hex");return i.create=function(i,o,r){return o||r?new L(e,t,i).bytepad([o,r],n):C["shake"+e].create(i)},i.update=function(e,t,n,o){return i.create(t,n,o).update(e)},v(i,x,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 O(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)}}],C={},w=[],k=0;k<j.length;++k)for(var T=j[k],E=T.bits,A=0;A<E.length;++A){var I=T.name+"_"+E[A];if(w.push(I),C[I]=T.createMethod(E[A],T.padding),"sha3"!==T.name){var S=T.name+E[A];w.push(S),C[S]=C[I]}}function L(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 O(e,t,n){L.call(this,e,t,n)}L.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];R(h),this.reset=!0}else this.start=o}return this},L.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},L.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},L.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},L.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];R(i)}},L.prototype.toString=L.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&&(R(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},L.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&&R(n)}return o&&(l[r]=n[r],e=e.slice(0,s)),e},L.prototype.buffer=L.prototype.arrayBuffer,L.prototype.digest=L.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&&R(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},O.prototype=new L,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var R=function(e){var t,n,i,o,r,a,s,l,d,u,p,h,m,g,f,x,y,v,b,j,C,w,k,T,E,A,I,S,L,O,R,M,_,P,B,D,N,F,U,q,V,W,H,Z,z,$,G,Y,Q,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,g=e[0],f=e[1],$=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,S=e[20]<<3|e[21]>>>29,L=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,B=e[3]<<1|e[2]>>>31,x=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,R=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,M=e[45]<<29|e[44]>>>3,_=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,E=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,j=e[36]<<21|e[37]>>>11,C=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,A=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]=g^~x&v,e[1]=f^~y&b,e[10]=T^~A&S,e[11]=E^~I&L,e[20]=P^~D&F,e[21]=B^~N&U,e[30]=Z^~$&Y,e[31]=z^~G&Q,e[40]=te^~ie&re,e[41]=ne^~oe&ae,e[2]=x^~v&j,e[3]=y^~b&C,e[12]=A^~S&O,e[13]=I^~L&R,e[22]=D^~F&q,e[23]=N^~U&V,e[32]=$^~Y&X,e[33]=G^~Q&K,e[42]=ie^~re&se,e[43]=oe^~ae&le,e[4]=v^~j&w,e[5]=b^~C&k,e[14]=S^~O&M,e[15]=L^~R&_,e[24]=F^~q&W,e[25]=U^~V&H,e[34]=Y^~X&J,e[35]=Q^~K&ee,e[44]=re^~se&de,e[45]=ae^~le&ce,e[6]=j^~w&g,e[7]=C^~k&f,e[16]=O^~M&T,e[17]=R^~_&E,e[26]=q^~W&P,e[27]=V^~H&B,e[36]=X^~J&Z,e[37]=K^~ee&z,e[46]=se^~de&te,e[47]=le^~ce&ne,e[8]=w^~g&x,e[9]=k^~f&y,e[18]=M^~T&A,e[19]=_^~E&I,e[28]=W^~P&D,e[29]=H^~B&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=C;else for(k=0;k<w.length;++k)i[w[k]]=C[w[k]]}()}(jl);var Cl=Cn(jl.exports);function wl(e){return"0x"+Cl.keccak_256(pl(e))}const kl=new al("address/5.8.0");function Tl(e){gl(e,20)||kl.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=pl(wl(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 El={};for(let e=0;e<10;e++)El[String(e)]=String(e);for(let e=0;e<26;e++)El[String.fromCharCode(65+e)]=String(10+e);const Al=Math.floor((Il=9007199254740991,Math.log10?Math.log10(Il):Math.log(Il)/Math.LN10));var Il;function Sl(e){let t=null;if("string"!=typeof e&&kl.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Tl(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&kl.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=>El[e])).join("");for(;t.length>=Al;){let e=t.substring(0,Al);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)&&kl.throwArgumentError("bad icap checksum","address",e),t=It(e.substring(4));t.length<40;)t="0"+t;t=Tl("0x"+t)}else kl.throwArgumentError("invalid address","address",e);return t}function Ll(e,t,n){return 32!==yl(t)&&kl.throwArgumentError("salt must be 32 bytes","salt",t),32!==yl(n)&&kl.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),Sl(vl(wl(hl(["0xff",Sl(e),t,n])),12))}const Ol=St.from(-1),Rl=St.from(0),Ml=St.from(1),_l=St.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Pl=new al("strings/5.8.0");var Bl,Dl;function Nl(e,t,n,i,o){if(e===Dl.BAD_PREFIX||e===Dl.UNEXPECTED_CONTINUE){let e=0;for(let i=t+1;i<n.length&&n[i]>>6==2;i++)e++;return e}return e===Dl.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Bl||(Bl={})),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"}(Dl||(Dl={}));const Fl=Object.freeze({error:function(e,t,n,i,o){return Pl.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",n)},ignore:Nl,replace:function(e,t,n,i,o){return e===Dl.OVERLONG?(i.push(o),0):(i.push(65533),Nl(e,t,n))}});function Ul(e,t=Bl.current){t!=Bl.current&&(Pl.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 pl(n)}function ql(e,t){return n=function(e,t){null==t&&(t=Fl.error),e=pl(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)?Dl.UNEXPECTED_CONTINUE:Dl.BAD_PREFIX,i-1,e,n);continue}r=3,a=65535}if(i-1+r>=e.length){i+=t(Dl.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(Dl.MISSING_CONTINUE,i,e,n),s=null;break}s=s<<6|63&o,i++}null!==s&&(s>1114111?i+=t(Dl.OUT_OF_RANGE,i-1-r,e,n,s):s>=55296&&s<=57343?i+=t(Dl.UTF16_SURROGATE,i-1-r,e,n,s):s<=a?i+=t(Dl.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 Vl=new RegExp("^bytes([0-9]+)$"),Wl=new RegExp("^(u?int)([0-9]*)$"),Hl=new RegExp("^(.*)\\[([0-9]*)\\]$"),Zl="0000000000000000000000000000000000000000000000000000000000000000",zl=new al("solidity/5.8.0");function $l(e,t,n){switch(e){case"address":return n?ml(t,32):pl(t);case"string":return Ul(t);case"bytes":return pl(t);case"bool":return t=t?"0x01":"0x00",n?ml(t,32):pl(t)}let i=e.match(Wl);if(i){let o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&zl.throwArgumentError("invalid number type","type",e),n&&(o=256),ml(t=St.from(t).toTwos(o),o/8)}if(i=e.match(Vl),i){const o=parseInt(i[1]);return(String(o)!==i[1]||0===o||o>32)&&zl.throwArgumentError("invalid bytes type","type",e),pl(t).byteLength!==o&&zl.throwArgumentError(`invalid value for ${e}`,"value",t),n?pl((t+Zl).substring(0,66)):t}if(i=e.match(Hl),i&&Array.isArray(t)){const n=i[1];parseInt(i[2]||String(t.length))!=t.length&&zl.throwArgumentError(`invalid array length for ${e}`,"value",t);const o=[];return t.forEach((function(e){o.push($l(n,e,!0))})),hl(o)}return zl.throwArgumentError("invalid type","type",e)}function Gl(e,t){e.length!=t.length&&zl.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const n=[];return e.forEach((function(e,i){n.push($l(e,t[i]))})),xl(hl(n))}function Yl(e,t){return wl(Gl(e,t))}const Ql=new me({contractRequests:Ta}),Xl=new ge({contractRequests:Ta});function Kl(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 Jl(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:Kl(l.baseToken,l.chainId),quoteToken:Kl(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 ed(e){const t=Jl(e);if(t)return Object.assign(Object.assign({},t),{liquidityPositions:null==e?void 0:e.liquidityPositions})}function td(e){switch(e){case"AMMV2":return"AMM V2";case"AMMV3":return"AMM V3";default:return"PMM"}}function nd(e){return!(!ot(e)||!rt(e))}const id=(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 od(e){try{return!!Sl(e)}catch(e){return!1}}function rd(e){return e?e.length<=10?e:`${e.slice(0,6)}...${e.slice(e.length-4,e.length)}`:"-"}function ad(e,t,n="address"){return`https://${ua[e]}${t?`/${n}/${t}`:""}${e===de.SOLANA_DEVNET?"?cluster=devnet":""}`}const sd=({factoryAddress:e,tokenA:t,tokenB:n,fee:i})=>{const[o,r]=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 Ll(e,Yl(["bytes"],[Gl(["address","address","uint256"],[o.address,r.address,Fs(i,4).toString()])]),(e=>{const t=nd(e);switch(e){case de.PLUME:case de.PLUME_TESTNET:return"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f";case de.NEOX:return"0x007722521498f3d29a63d1eb6ab35e202874706c77ce73d45c1ad9da88174a3f";case de.SEPOLIA:return t?"0x67a372377cf6d7f78cfdcc9df0bc21e1139bd49e5a47c33ee0de5389a4396410":"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f";default:return"0x2ebf1082215ab683deab4ee8ff50d42205db2059829b641717ab3f61f18d481a"}})(t.chainId))};function ld(e){var t;if(!e)return"a";const n=null===(t=us.get(e))||void 0===t?void 0:t.caipNetwork;if(!n)return"";const i=Se.getChainNamespace(n);if(!i)return"";switch(i){case"eip155":return"EVM";case"solana":return"Solana";case"bip122":return"Bitcoin";default:return i}}const dd=e=>fe[e]||fe[de.MAINNET],cd=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 ud(e){return Number(e)>6?6:4}function pd(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 hd(){const e=wt(),t=kt(),{onlyChainId:n,defaultChainId:i,solanaConnection:o}=On(),r=function(){const{btcWalletStore:e}=On();return e}(),a=Tt({namespace:"eip155"}),s=Tt({namespace:"solana"}),l=Z((()=>r&&r.address?{allAccounts:[{namespace:"bip122",address:r.address,publicKey:r.publicKey,type:"payment"}],caipAddress:`bip122:${he.id}:${r.address}`,address:r.address,isConnected:r.connected,embeddedWalletInfo:void 0,status:r.connected?"connected":"disconnected"}:{allAccounts:[],caipAddress:void 0,address:void 0,isConnected:!1,embeddedWalletInfo:void 0,status:"disconnected"}),[r]),{walletProvider:d}=Et("eip155"),{walletProvider:c}=Et("solana"),u=At(),p=Z((()=>{if(!u||!u.caipNetwork)return n||i||de.MAINNET;const e=u.chainId;return e===Ze.id?de.SOLANA:e===Ye.id?de.SOLANA_DEVNET:e===he.id?de.BTC_SIGNET:e===ze.id?de.BTC:Number(e)}),[u,i,n]),h=Z((()=>{var e;return null===(e=us.get(p))||void 0===e?void 0:e.caipNetwork}),[p]),m=Z((()=>{if(!h)return;const e=Se.getChainNamespace(h);return"bip122"===e?l:"solana"===e?s:a}),[l,h,a,s]),g=z((e=>{if(!e)return;const t=us.get(e);if(!(null==t?void 0:t.caipNetwork))return;const n=t.caipNetwork,i=Se.getChainNamespace(n);return{appKitAccount:"bip122"===i?Object.assign({},l):"solana"===i?s:a,namespace:i,targetCaipNetwork:n,chain:t}}),[l,a,s]),f=z((({namespace:t})=>{"bip122"!==t?e.open({namespace:t}):null==r||r.setModalVisible(!0)}),[e,r]),x=z((({namespace:e})=>{"bip122"!==e?t.disconnect({namespace:e}):null==r||r.disconnect()}),[t,r]),y=Z((()=>d?new Ct(d,p):null),[p,d]);return{open:f,disconnect:x,chainId:p,chainIdToCaipNetwork:h,connectedChainId:p,defaultChainId:i,onlyChainId:n,account:null==m?void 0:m.address,currentAccount:m,appKitActiveNetwork:u,evmAccount:a,solanaAccount:s,bitcoinAccount:l,evmProvider:y,solanaWalletProvider:c,solanaConnection:o,bitcoinWalletProvider:null==r?void 0:r.btcWallet,getAppKitAccountByChainId:g}}var md;!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(md||(md={}));const gd=(e,t)=>bn(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})),fd=(e,t)=>bn(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(le._({id:"em6LzM",message:"Transaction rejected."})):e}})),xd=(e,t,n,i,o)=>bn(void 0,void 0,void 0,(function*(){const r=yield ue.encode.approveABI(n,i),a={from:t,to:e,data:r,value:"0x0",gasLimit:void 0},s=yield gd(a,o);return s&&(a.gasLimit=s),yield fd(a,o)}));let yd=null;function vd(){const{GRAPHQL_URL:e,graphQLRequests:t}=On();return t||(yd||(yd=new xe({url:e})),yd)}var bd;!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(bd||(bd={}));const jd=it((e=>({fromTokenChainId:void 0,latestBlockNumber:0,openConnectWalletInfo:!1,slippage:null})));function Cd(e){jd.setState({contractStatus:e})}function wd(e){jd.setState({autoSlippage:e})}function kd(e){jd.setState({slippage:e})}function Td(e){const t=G(!1),[n,i]=$(!1);return Y((()=>{if(void 0===e)return;const n=function(e){const t=localStorage.getItem(e?xs:fs);return t?Number(t):null}(e);if(!t.current)return kd(n?n.toString():null),void(t.current=!0);kd(n?n.toString():null),i(!0);const o=setTimeout((()=>{i(!1)}),3e3);return()=>{clearTimeout(o)}}),[e]),n}function Ed({tokenList:e,blockNumber:t,skip:n}){const{getAppKitAccountByChainId:i}=hd(),[o,r]=$(new Map),a=Xe({queries:e.map((e=>{const o=i(e.chainId),r=Ea.getFetchTokenQuery(e.chainId,e.address,null==o?void 0:o.appKitAccount.address);return{queryKey:t?[...r.queryKey,t]:r.queryKey,enabled:r.enabled&&!n,queryFn:r.queryFn}})),combine:e=>({data:e.map((e=>e.data)),pending:e.some((e=>e.isPending))})});return Y((()=>{const e=new Map;a.data.forEach((t=>{t&&e.set(`${t.chainId}-${t.address}`,t)})),r((t=>oe(t,e)?t:e))}),[a.data]),o}function Ad(){const{evmProvider:e,chainId:t}=hd(),n=z((()=>bn(this,void 0,void 0,(function*(){if(e&&t)try{const t=yield e.getBlockNumber();return jd.setState({latestBlockNumber:t}),t}catch(e){console.error("Failed to fetch block number",e)}}))),[e,t]);return Y((()=>{n()}),[n]),{updateBlockNumber:n}}function Id({fromToken:e,toToken:t,getAutoSlippage:n}){Y((()=>{(()=>{bn(this,void 0,void 0,(function*(){if(!n)return;const i=n({fromToken:e,toToken:t});if(void 0!==i&&"number"!=typeof i){var o;o=!0,jd.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 i;wd({loading:!1,value:null!=e?e:null})}catch(e){console.error(e),wd({loading:!1,value:null})}}else wd({loading:!1,value:null})}))})()}),[e,t])}function Sd(){const e=a(),t=On((e=>e.width)),[n,i]=H.useState(null!=t?t:"undefined"==typeof window?375:document.body.clientWidth);H.useEffect((()=>{const e=()=>{i("undefined"==typeof window?375:document.body.clientWidth)};return"number"!=typeof t?(e(),window.addEventListener("resize",e)):i(t),()=>{window.removeEventListener("resize",e)}}),[t]);return{isMobile:H.useMemo((()=>"number"==typeof n&&n<e.breakpoints.values.tablet),[n,e.breakpoints.values]),isTablet:H.useMemo((()=>"number"==typeof n&&n<e.breakpoints.values.tablet),[n,e.breakpoints.values]),minDevice:H.useCallback((e=>"number"==typeof n&&n>e),[n]),maxDevice:H.useCallback((e=>"number"==typeof n&&n<e),[n])}}var Ld,Od,Rd,Md;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Ld||(Ld={})),function(e){e.swap="swap",e.crossChain="crossChain",e.addLiquidity="addLiquidity",e.removeLiquidity="removeLiquidity",e.createDPPPool="createDPPPool",e.createDSPPool="createDSPPool",e.createGSPPool="createGSPPool",e.createDVMPool="createDVMPool",e.createAMMV2Position="createAMMV2Position",e.addLiquidityAMMV2Position="addLiquidityAMMV2Position",e.removeLiqidityAMMV2Position="removeLiqidityAMMV2Position",e.createAMMV3Pool="createAMMV3Pool",e.addAMMV3Pool="addAMMV3Pool",e.removeAMMV3Pool="removeAMMV3Pool",e.claimAMMV3Pool="claimAMMV3Pool",e.stakeMining="stakeMining",e.unstakeMining="unstakeMining",e.claimMining="claimMining",e.submissionCreateMetaKey="submissionCreateMetaKey",e.approve="approve",e.reset="reset",e.curveAddLiquidity="curveAddLiquidity",e.curveRemoveLiquidityOneCoin="curveRemoveLiquidityOneCoin",e.curveRemoveLiquidity="curveRemoveLiquidity",e.curveRemoveLiquidityImBalance="curveRemoveLiquidityImBalance"}(Od||(Od={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(Rd||(Rd={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(Md||(Md={}));const _d=new Le(2).pow(256).minus(1);function Pd(){const{chainId:e}=hd();return e}function Bd(e,t){var n;const i=null===(n=ve[e])||void 0===n?void 0:n.symbol,o=[{error:"insufficient",msg:le._({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:le._({id:"AghcDJ",message:"Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance."})},{error:"SafeERC20: low-level call failed",msg:le._({id:"rYkFu5",message:"SafeERC20: low-level call failed. Please contact the ZUNO team."})},{error:["User denied","cancel","User rejected","user rejected"],msg:le._({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:le._({id:"h4RLFN",message:"RPC node data exception"})},{error:['execution reverted:FORCESTOP ["originalError"'],msg:le._({id:"yM82Jw",message:"ForceStop exception"})},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:le._({id:"gz+9Rb",message:"Gas price is too low, please adjust in your wallet and try again"})},{error:["MINT_INVALID"],msg:le._({id:"Xpkm7d",message:"No ForceStop access"})},{error:["NOT_PHASE_EXE"],msg:le._({id:"qK7wuW",message:"Unable to SETTLE during the cooling-off period"})},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:le._({id:"TizaRy",message:"Wallet incompatibility"})},{error:["ALREADY_SETTLED"],msg:le._({id:"C1mcuF",message:"This CP has been settled by other addrs"})},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:le._({id:"g3x+cF",message:"Service update, please wait and try again"})}];let r="";return o.some((e=>Array.isArray(e.error)?e.error.some((n=>t.indexOf(n)>-1&&(r=e.msg,!0))):t.indexOf(e.error)>-1&&(r=e.msg,!0))),r||t}var Dd,Nd;function Fd({onTxFail:e,onTxSubmit:t,onTxSuccess:n,onTxReverted:i}={}){const{evmAccount:o,evmProvider:r}=hd(),a=Ke(),s=Pd(),[l,d]=$(!1),[c,u]=$(new Map),[p,h]=$(null),[m,g]=$(""),[f,x]=$(null),[y,v]=$(!1),[b,j]=$(),{updateBlockNumber:C}=Ad(),w=z(((l,c,p)=>bn(this,void 0,void 0,(function*(){const{subtitle:m,early:f,submittedBack:y,mixpanelProps:b,submittedConfirmBack:w,successBack:k,metadata:T}=null!=p?p:{};if(g(""),h(""),!o.address||!r)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let E,A,I,S;j((()=>w)),d(!1),x({spec:c,brief:l,subtitle:m,submitState:"loading"});try{if(d(!0),c.opcode===Dd.Approval){S=yield xd(c.token.address,o.address,c.contract,c.amt||_d,r),E=S.hash,g(E);try{I=yield r.getTransactionCount(o.address)}catch(e){console.error(e)}}else{if(c.opcode!==Dd.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{I=yield r.getTransactionCount(o.address)}catch(e){console.error(e)}if(A={value:c.value,data:c.data,to:c.to,gasLimit:c.gasLimit,from:o.address,chainId:s},!A.gasLimit)try{const e=yield gd(A,r);e&&(A.gasLimit=e)}catch(e){throw console.debug(e),e}if(S=yield fd(A,r),E=S.hash,g(E),!E)throw new Error(`Unexpected tx: ${E}`)}}catch(t){if(d(!1),x({spec:c,brief:l,subtitle:m}),console.error(t),t.message){Cd(bd.Failed);const n={error:t.message,brief:l};b&&Object.assign(n,b),e&&e(t,b),h(Bd(s,t.message))}return Rd.Failed}x({spec:c,brief:l,subtitle:m,submitState:"submitted"}),v(!1),d(!1);const L=Object.assign(Object.assign(Object.assign(Object.assign({brief:l},c),A),{tx:E,subtitle:m,metadata:T,nonce:I}),b);Cd(bd.Pending),t&&t(E,L),y&&y();const O={brief:l,spec:c,tx:E,subtitle:m,metadata:T};if(u((e=>e.set(E,[O,Ld.Running]))),f)return Rd.Submitted;if(y&&y(),null==S?void 0:S.wait){const e=yield S.wait(1);if(L.receipt=e,v(!0),e.status===Md.Success)return yield qd(C,e.blockNumber),"TX"===L.opcode&&Cd(bd.TxSuccess),"APPROVAL"===L.opcode&&Cd(bd.ApproveSuccess),k&&k(E,n),n&&n(E,L),a.invalidateQueries({queryKey:[be]}),u((e=>e.set(E,[Object.assign(Object.assign({},O),{doneTime:Math.ceil(Date.now()/1e3)}),Ld.Success]))),Rd.Success}return i&&i(E,L),yield C(),v(!0),u((e=>e.set(E,[Object.assign(Object.assign({},O),{doneTime:Math.ceil(Date.now()/1e3)}),Ld.Failed]))),Rd.Failed}))),[o.address,s,d,r,C,a]),k=z((i=>bn(this,[i],void 0,(function*({brief:i,subtitle:o,early:r,mixpanelProps:l,metadata:c,submittedBack:p,submittedConfirmBack:m,successBack:f,handler:y}){j((()=>m)),g(""),h(""),d(!1);const b=Object.assign({brief:i,subtitle:o},l);return new Promise((m=>bn(this,void 0,void 0,(function*(){const j={opcode:Dd.TX,value:"",to:"",data:""},w={brief:i,spec:j,subtitle:o,metadata:c};let k="";const T=(e,{showing:n,reportInfo:a}={})=>{k=e,g(e),null!==n&&x(Object.assign({spec:j,brief:i,subtitle:o},n)),d(!1),u((t=>t.set(e,[Object.assign(Object.assign({},w),{tx:e}),Ld.Running]))),Cd(bd.Pending),t&&t(e,Object.assign(Object.assign({tx:e},b),a)),p&&p(),r&&m(Rd.Submitted)},E=(e,...t)=>bn(this,[e,...t],void 0,(function*(e,{showing:t,reportInfo:i,notShowingDone:o}={}){g(e),t&&x((e=>Object.assign(Object.assign({},e),t))),Cd(bd.TxSuccess),u((t=>t.set(null!=k?k:e,[Object.assign(Object.assign({},w),{tx:k}),Ld.Success]))),f&&f(e,n),n&&n(e,Object.assign(Object.assign({tx:e},b),i)),yield C(),a.invalidateQueries({queryKey:["token"]}),a.invalidateQueries({queryKey:["clmm"]}),a.invalidateQueries({queryKey:["cpmm"]}),o||(v(!0),x((e=>Object.assign(Object.assign({},e),{done:!0})))),m(Rd.Success)})),A=t=>{if(d(!1),x({spec:j,brief:i,subtitle:o}),k&&u((e=>e.set(k,[Object.assign(Object.assign({},w),{tx:k}),Ld.Failed]))),console.error(t),t.message){console.error(t.code),Cd(bd.Failed);const n={error:t.message,brief:i};l&&Object.assign(n,l),e&&e(t,l),h(Bd(s,t.message))}m(Rd.Failed)};try{d(!0),yield y({onSubmit:T,onSuccess:E,onError:A,setShowing:x})}catch(e){return void A(e)}}))))}))),[s,d,C,a]),T=z((e=>{u((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}))}),[o.address,s,c]),E=Z((()=>({executeCustom:k,execute:w,requests:c,updateText:T,setShowing:x,waitingSubmit:l,errorMessage:p})),[k,w,c,T,l,p]),A=z((()=>{x(null),b&&(b(),j(void 0))}),[b]);return{showing:f,showingDone:y,transactionTx:m,errorMessage:p,setErrorMessage:h,closeShowing:A,setShowing:x,ctxVal:E,requests:c}}!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(Dd||(Dd={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(Nd||(Nd={}));let Ud=0;function qd(e,t,n=800){return clearTimeout(Ud),new Promise((i=>{Ud=window.setTimeout((()=>bn(this,void 0,void 0,(function*(){const o=yield e();if(o&&o>=t)i(o);else{const o=yield qd(e,t,n);i(o)}}))),n)}))}const Vd=X({execute:()=>Promise.resolve(Rd.Canceled),executeCustom:()=>Promise.resolve(Rd.Canceled),requests:void 0,updateText:()=>{},waitingSubmit:!1,errorMessage:null});function Wd(){const{submission:e}=On(),t=Q(Vd);return e||t}function Hd(){const{requests:e}=Wd(),t=[];return null==e||e.forEach((function([e,n]){n===Ld.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const Zd=15e3;function zd(e){const{apiServices:t}=On();return Z((()=>ka(e,t)),[t,e])}function $d({fromToken:e,toToken:t}){const[n,i]=$(!0),[o,r]=$(null),{apikey:a}=On(),[s,l]=$(""),[d,c]=$(""),u=zd(fa.fiatPrice),p=z((()=>{if(!e||!t)return;i(!0),r(null);const n=[e,t];Ot.post(u,{networks:n.map((e=>dd(e.chainId))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},a?{headers:{apikey:a}}:void 0).then((n=>{var o;i(!1);const r=null===(o=n.data)||void 0===o?void 0:o.data;r&&(l(r.find((t=>t.address===e.address)).price),c(r.find((e=>e.address===t.address)).price))})).catch((e=>{r(e),i(!1),console.error(e)}))}),[e,t,a,u]);return function({refetch:e,interval:t}){let n;Y((()=>(e(),clearTimeout(n),n=setInterval((()=>{e()}),null!=t?t:Zd),()=>clearTimeout(n))),[e])}({refetch:p}),{loading:n,isLoading:n,refetch:p,error:o,toFiatPrice:d,fromFiatPrice:s}}function Gd(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 Yd=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>Yd(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>Yd(t)(e)}}},Qd=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&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=Yd(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 g=()=>{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 Yd(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:()=>g(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},g(),m||h})(e,t)):((e,t)=>(n,i,o)=>{let r={storage:Gd((()=>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 Yd(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),Xd=it(Qd((e=>({slippageAdvanced:!1,notRemindAgainSlippageHigher:!1,notRemindAgainSlippageLower:!1,customSwapPairSlippages:[],ddl:String(Cs),expertMode:!1,disableIndirectRouting:!1})),{name:"swap-setting-storage",storage:Gd((()=>localStorage))}));var Kd;function Jd({toToken:e,fromToken:t,fromAmount:n,toAmount:i,marginAmount:o,estimateGas:r,isReverseRouting:a,slippage:s,slippageLoading:l}){const{getAppKitAccountByChainId:d,solanaWalletProvider:c,solanaConnection:u}=hd(),p=Wd(),{feeRate:h,rebateTo:m,apikey:g,apiServices:f}=On(),x=Xd((e=>Number(e.ddl))),y=Xd((e=>Number(e.disableIndirectRouting))),{isSolanaChain:v,isSolanaMainnet:b,account:j}=Z((()=>{if(!t)return{isSolanaChain:!1,isSolanaMainnet:!1,account:null};const e=d(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===de.SOLANA,account:n}}),[d,t]),{data:C,isLoading:w,error:k}=Qe({queryKey:["route-price",t,e,n,i,r,a,s,h,m,g,f,x,y,v,b,j],queryFn:()=>bn(this,void 0,void 0,(function*(){if(!t||!e||t.chainId!==e.chainId||!a&&!n||a&&!i||null==s)return{status:Kd.Initial,rawBrief:null};const o=new Le(n).multipliedBy(new Le(10).pow(t.decimals)).dp(0,Le.ROUND_DOWN),l=new Le(i).multipliedBy(new Le(10).pow(e.decimals)).dp(0,Le.ROUND_DOWN),d=Math.floor(Date.now()/1e3)+60*x,c=v?{apikey:g,inputMint:t.address,outputMint:e.address,amount:o.toString(),user:j||cs(t.chainId),chainId:b?"solana-mainnet":"solana-devnet",slippageBps:new Le(s).dividedBy(100).multipliedBy(1e4).dp(0,Le.ROUND_DOWN).toString(),source:"jupiter"}:Object.assign({chainId:t.chainId,deadLine:d,apikey:g,slippage:s,source:y?"noMaxHops":"dodoMix",toTokenAddress:e.address,fromTokenAddress:t.address,userAddr:j||cs(t.chainId),estimateGas:r,rebateTo:m||void 0,fee:h||void 0},a?{toAmount:l.toString()}:{fromAmount:o.toString()}),u=ka(v?fa.solanaRoutePrice:fa.routePrice,f),p=(yield Ot.get(u,{params:c})).data.data;return(null==p?void 0:p.resAmount)?{status:Kd.Success,rawBrief:Object.assign(Object.assign({},p),{routeInfo:JSON.stringify(p.routeInfo),resPricePerToToken:v?new Le(n).dividedBy(p.resAmount).dp(e.decimals,Le.ROUND_DOWN).toNumber():p.resPricePerToToken,resPricePerFromToken:v?new Le(p.resAmount).dividedBy(n).dp(t.decimals,Le.ROUND_DOWN).toNumber():p.resPricePerFromToken})}:{status:Kd.Failed,rawBrief:null}})),refetchInterval:15e3,initialData:{status:Kd.Initial,rawBrief:null}}),T=function(){const e=Wd(),t=z((({from:t,to:n,data:i,useSource:o,duration:r,ddl:a,gasLimit:s,subtitle:l,value:d,mixpanelProps:c})=>{const u=60*a,p=d;o&&"weth"!==o.toLowerCase()&&s&&s.lt(ws)&&console.debug("Warning: GasLimit less than the minimum!");const h={from:t,to:n,data:i,value:p,route:o,duration:r,ddlSecRel:u,gasLimit:s};e.execute(le._({id:"vH2C/2",message:"Swap"}),Object.assign({opcode:Dd.TX},h),{subtitle:l,metadata:{[Od.swap]:!0},mixpanelProps:c})}),[e]);return t}(),E=z((i=>{if(!C.rawBrief||!j)return;const{resAmount:o,to:r,data:s,useSource:l,duration:d,value:c}=C.rawBrief,u=a?o:n,p=a?n:o;t&&u&&T({from:j,to:r,data:s,useSource:l,duration:d,ddl:x,value:c,subtitle:i,mixpanelProps:{from:j,fromTokenAddress:t.address,toTokenAddress:null==e?void 0:e.address,fromAmount:u,resAmount:p,resPricePerFromToken:a?C.rawBrief.resPricePerToToken:C.rawBrief.resPricePerFromToken,resPricePerToToken:a?C.rawBrief.resPricePerFromToken:C.rawBrief.resPricePerToToken,fromTokenSymbol:t.symbol,toTokenSymbol:null==e?void 0:e.symbol,fromTokenDecimals:t.decimals,toTokenDecimals:null==e?void 0:e.decimals}})}),[j,C.rawBrief,x,T,n,t,a,null==e?void 0:e.address,null==e?void 0:e.decimals,null==e?void 0:e.symbol]),A=Je({mutationFn:e=>bn(this,void 0,void 0,(function*(){if(C.rawBrief&&C.rawBrief.data&&c&&u)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=Pe.deserialize(t.slice(1));o=new Be(e)}else o=_e.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 Be){if(!o.message||!o.message.header)throw new Error("Invalid versioned transaction structure")}else if(o instanceof _e&&!o.recentBlockhash)throw new Error("Invalid legacy transaction structure");return o}({data:C.rawBrief.data});return p.executeCustom({brief:le._({id:"vH2C/2",message:"Swap"}),subtitle:e,metadata:{[Od.swap]:!0},handler:e=>bn(this,void 0,void 0,(function*(){try{const n=yield c.sendTransaction(t,u);e.onSubmit(n);const i=yield u.getLatestBlockhash(),o=yield u.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}}))}),I=Z((()=>v?A.mutate:E),[E,A.mutate,v]);return{status:w?Kd.Loading:k?Kd.Failed:C.status,rawBrief:C.rawBrief,executeSwap:I}}function ec(e){const{bridgeSlippage:t,swapSlippage:n}=On(),{autoSlippage:i}=jd();return{defaultSlippage:Z((()=>!(null==i?void 0:i.loading)&&(null==i?void 0:i.value)?i.value:e?null!=t?t:ks:null!=n?n:bs),[n,t,e,i]),loading:null==i?void 0:i.loading}}function tc({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?hs:ms);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"}(Kd||(Kd={}));const nc=[{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 ic({chainId:e,account:t}){const{evmProvider:n}=hd(),i=Z((()=>e?ga[e]:[]),[e]),o=Boolean(t)&&void 0!==i&&i.length>0,[r,a]=$(new Map),{refetch:s,refetchTimes:l}=function(e){const[t,n]=$(0);return{refetch:z((()=>{n((e=>e+1))}),[e]),refetchTimes:t,isRefetch:t>0}}();Y((()=>{function e(e){return bn(this,arguments,void 0,(function*({address:e,provider:t,method:n}){if(!t)return!1;try{const i=new Rt(e,nc,t);return yield i[n]()}catch(e){console.error(e)}return!1}))}!function(){bn(this,void 0,void 0,(function*(){const t=[],o=new Map;if(i&&i.length>0&&i.forEach((({key:i,isPrivacyEndpoint:r})=>{r&&r.contract&&t.push({call:e({address:r.contract,method:r.rpcMethod,provider:n}),callback:e=>{o.set(i,e)}})})),!t.length)return void a(new Map);(yield Promise.all(t.map((e=>e.call)))).forEach(((e,n)=>{t[n].callback(e)})),a((e=>oe(e,o)?e:o))}))}()}),[e,i,n,l]);const d=Z((()=>Array.from(r.values()).some((e=>e))),[r]);return{privacySwapSupplierEndpoints:i,privacySwapEnableAble:o,privacySwapEnable:d,refetchEndpointStatus:s,endpointStatusMap:r}}function oc({fromToken:e,toToken:t}){var n,i,o,r;const{customSlippage:a,customSlippageNum:s,handleSlippageChange:l}=function({fromToken:e,toToken:t}){const{account:n}=hd(),{customSwapPairSlippages:i}=Xd(),o=H.useCallback((i=>{var o,r,a,s,l,d;const c=null!==(o=null==n?void 0:n.toLocaleLowerCase())&&void 0!==o?o:"",u=[i.from.toLocaleLowerCase(),i.to.toLocaleLowerCase()];return(null!==(a=null===(r=i.account)||void 0===r?void 0:r.toLocaleLowerCase())&&void 0!==a?a:"")===c&&i.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,n]),r=e&&t?i.find(o):null,a=(null==r?void 0:r.disabled)?null:r,s=H.useCallback((i=>{Xd.setState((r=>{var a,s,l;if(!e||!t)throw new Error("token is not valid.");const d=[...r.customSwapPairSlippages],c=Object.assign(Object.assign({},i),{account:null!==(a=null==n?void 0:n.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(o);return u>-1?d.splice(u,1,c):d.push(c),{customSwapPairSlippages:d}}))}),[n,e,t,o]),l=null==a?void 0:a.slippage;return{customSlippageNum:l?Number(l):0,customSlippage:l,handleSlippageChange:s}}({fromToken:e,toToken:t}),{defaultSlippage:d}=ec(!1),c=function({fromToken:e,toToken:t}){const n=vd().getQuery(ue.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}}}),i=Qe(Object.assign(Object.assign({},n),{enabled:!!e&&!!t})),o=H.useMemo((()=>{var e,t,n;if(!(null===(e=i.data)||void 0===e?void 0:e.erc20_extend_erc20ExtendV2))return{};const{erc20_extend_erc20ExtendV2:o}=i.data,r=(null===(t=o.forecastSlippageList)||void 0===t?void 0:t.length)?null===(n=[...o.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}}),[i.data]);return Object.assign({slippageData:o},i)}({fromToken:e,toToken:t}),u=null===(n=c.slippageData.recommendSlippage)||void 0===n?void 0:n.forecastSlippage,p=u?new Le(u).times(100).toNumber():u;return{customSlippage:a,customSlippageNum:s,handleSlippageChange:l,forecastSlippage:p,forecastSlippageQuery:c,recommendSlippage:null!==(i=null!=p?p:d)&&void 0!==i?i:0,slippage:null!==(r=null!==(o=a?Number(a):void 0)&&void 0!==o?o:p)&&void 0!==r?r:d,slippageLoading:c.isLoading}}var rc,ac,sc,lc,dc;function cc(e,{amount:n,contractAddress:i,offset:o,overrideBalance:r,skipQuery:a}={}){var s,l,d,c;const{getAppKitAccountByChainId:u}=hd(),p=null===(s=u(null==e?void 0:e.chainId))||void 0===s?void 0:s.appKitAccount.address,[h,m]=H.useMemo((()=>e?[e.chainId,null!=i?i:je[e.chainId].DODO_APPROVE]:[void 0,i]),[e,i]),g=Ke(),f=Qe(Object.assign(Object.assign({},Ea.getFetchTokenQuery(a?void 0:h,null==e?void 0:e.address,p,m)),{refetchInterval:h===de.NEOX?3e3:void 0})),{runningRequests:x}=Hd(),{updateBlockNumber:y}=Ad(),{i18n:v}=t(),b=H.useMemo((()=>{var e;return h?null===(e=ve[h])||void 0===e?void 0:e.address:null}),[h]),j=H.useCallback((()=>{var t,i;if(!e)return ac.Loading;const a=x.some((t=>{var n,i,o;return(null===(n=t.spec)||void 0===n?void 0:n.opcode)===Dd.Approval&&(null===(i=t.spec)||void 0===i?void 0:i.token.address)===(null==e?void 0:e.address)&&(null===(o=t.spec)||void 0===o?void 0:o.contract)===m})),s=null!=r?r:null===(t=f.data)||void 0===t?void 0:t.balance,l=null===(i=f.data)||void 0===i?void 0:i.allowance,d=new Le(n||0);if(!p)return ac.Unchecked;if(!s||d.minus(null!=o?o:0).gt(s))return ac.Unchecked;if(d.isZero())return ac.Unchecked;return e.address===b?ac.Sufficient:a?ac.Approving:l?d.minus(null!=o?o:0).gt(l)?ac.Insufficient:ac.Sufficient:ac.Loading}),[x,p,o,b,f.data,e,r,n,m]),{isApproving:C,isGetApproveLoading:w,needApprove:k,needReset:T}=H.useMemo((()=>{var t;const n=j(),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)}(e,null===(t=f.data)||void 0===t?void 0:t.allowance);return{isApproving:n===ac.Approving,isGetApproveLoading:n===ac.Loading||f.isLoading,needApprove:n===ac.Insufficient&&!i,needReset:n===ac.Insufficient&&i}}),[j,e,null===(l=f.data)||void 0===l?void 0:l.allowance,f.isLoading]),E=Wd(),A=H.useMemo((()=>{if(!e)return"";return`${T?v._({id:"OfhWJH",message:"Reset"}):v._({id:"Z7ZXbT",message:"Approve"})} ${cd(e)}`}),[e,T,v._]),I=Je({mutationFn:()=>bn(this,void 0,void 0,(function*(){if(!m||!p||!e)return;const t=T?new Le(0):void 0;(yield E.execute(A,{opcode:Dd.Approval,token:e,contract:m,amt:t},{metadata:{[Od.approve]:!0}}))===Rd.Success&&(yield y(),g.invalidateQueries({queryKey:Ea.getFetchTokenQuery(h,null==e?void 0:e.address,p,m).queryKey,refetchType:"all"}))}))}),S=H.useCallback((()=>bn(this,void 0,void 0,(function*(){I.mutate()}))),[I]),L=H.useCallback((()=>{var t;const n=new Le(0);if(!e)return n.toString();const i=null!=r?r:null===(t=f.data)||void 0===t?void 0:t.balance;if(!i)return n.toString();return i.toString()}),[h,null===(d=f.data)||void 0===d?void 0:d.balance,r,e]),O=H.useMemo((()=>{var e,t;if(!n)return!1;return(null!==(t=null!=r?r:null===(e=f.data)||void 0===e?void 0:e.balance)&&void 0!==t?t:new Le(0)).lt(n)}),[null===(c=f.data)||void 0===c?void 0:c.balance,r,n]),R=C||I.isPending;return{token:e,isApproving:R,isGetApproveLoading:w,needApprove:k,needReset:T,needShowTokenStatusButton:k||T||R||O,insufficientBalance:O,loading:f.isLoading,approveTitle:A,submitApprove:S,getMaxBalance:L}}function uc({fees:e}){return Z((()=>{const t=e.map((e=>{const t=new Oe(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,Oe.ROUND_DOWN).toString():null,isFree:!1}}));return t.push({key:"protocolFees",title:"Protocol Fees",value:"0",isFree:!0}),t}),[e])}function pc(e,t){let n=le._({id:"B0/2ea",message:"s"});return t||(n=e>=2?le._({id:"V+rJKF",message:"Seconds"}):le._({id:"ku//5b",message:"Second"})),n}function hc(e,t){let n="";return n=e>=2?t?le._({id:"TFOxRM",message:"Mins"}):le._({id:"agRWc1",message:"Minutes"}):t?le._({id:"eTUF28",message:"Min"}):le._({id:"6UYTy8",message:"Minute"}),n}function mc(e){return e>=2?le._({id:"yY8wAv",message:"Hours"}):le._({id:"6XgEPi",message:"Hour"})}function gc({start:e,end:t,showSecondUnit:n}){if(!e||!t)return null;const i=t-e,o=1e3,r=6e4,a=36e5,s=24*a;let l="",d="";if(i<r){const e=i/o;l=`${qs(e)} ${pc(e,n)}`}else if(i<a){const e=i/r;l=`${qs(e)} ${hc(e,n)}`;const t=i%r/o;d=`${qs(t)} ${pc(t,n)}`}else if(i<s){const e=i/a;l=`${qs(e)} ${mc(e)}`;const t=i%a/r;d=`${qs(t)} ${hc(t)}`}else{const e=i/s;l=`${qs(e)} ${function(e){return e>=2?le._({id:"HuVZMK",message:"Days"}):le._({id:"H7OUPr",message:"Day"})}(e)}`;const t=i%s/a;d=`${qs(t)} ${mc(t)}`}return n?`${l}${d}`.replaceAll(" ","").toLowerCase():l}function fc(e){const t=String(e);return 1===t.length?`0${t}`:t}function xc(e,t="/",{noYear:n}={}){const i=e.getFullYear(),o=e.getMonth()+1,r=e.getDate(),a=e.getHours(),s=e.getMinutes();let l=`${fc(o)}${t}${fc(r)} ${fc(a)}:${fc(s)}`;return n||(l=`${i}${t}${l}`),l}function yc(){return yc=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},yc.apply(null,arguments)}!function(e){e.All="all"}(rc||(rc={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(ac||(ac={})),function(e){e.Loading="Loading",e.Insufficient="BalanceInsufficient",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(sc||(sc={}));const vc=e=>W.createElement("svg",yc({xmlns:"http://www.w3.org/2000/svg",width:41,height:48,viewBox:"0 0 41 48",fill:"none"},e),lc||(lc=W.createElement("g",{opacity:.1},W.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)"}),W.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)"}))),dc||(dc=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_2049_57770",x1:40.5027,y1:-9.613,x2:37.8436,y2:51.3238,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#48EF8A"}),W.createElement("stop",{offset:.5458,stopColor:"#43B4A6"}),W.createElement("stop",{offset:.6918,stopColor:"#2D796F"}),W.createElement("stop",{offset:.9662})),W.createElement("linearGradient",{id:"paint1_linear_2049_57770",x1:33.1012,y1:50.9719,x2:26.0861,y2:-11.7811,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FF5F96"}),W.createElement("stop",{offset:.6103,stopColor:"#FF33AF"}),W.createElement("stop",{offset:1})))));var bc,jc;function Cc(){return Cc=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},Cc.apply(null,arguments)}const wc=e=>W.createElement("svg",Cc({xmlns:"http://www.w3.org/2000/svg",width:41,height:49,viewBox:"0 0 41 49",fill:"none"},e),bc||(bc=W.createElement("g",{opacity:.1,clipPath:"url(#clip0_2049_57744)"},W.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)"}))),jc||(jc=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_2049_57744",x1:56.1813,y1:-7.5661,x2:10.0091,y2:38.6061,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#3EF8F3"}),W.createElement("stop",{offset:1,stopColor:"#07AEFE"})),W.createElement("clipPath",{id:"clip0_2049_57744"},W.createElement("rect",{width:65.28,height:65.28,fill:"white",transform:"translate(0.438477 -17.12)"})))));var kc;function Tc(){return Tc=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},Tc.apply(null,arguments)}const Ec=e=>W.createElement("svg",Tc({xmlns:"http://www.w3.org/2000/svg",width:44,height:52,viewBox:"0 0 44 52",fill:"none"},e),kc||(kc=W.createElement("g",{opacity:.1},W.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"}),W.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"}),W.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"}),W.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"})))),Ac=[{id:"thorswap",name:"ThorSwap",ICON:In.jsx(wc,{}),width:41,height:49},{id:"ZUNO",name:"ZUNO",selected:!0,ICON:In.jsx(Ec,{}),width:44,height:52},{id:"ChainFlip",name:"ChainFlip",ICON:In.jsx(vc,{}),width:41,height:48}],Ic=({feeUSD:e})=>{const t=a();return In.jsx(i,{sx:{display:"flex",alignItems:"flex-start",gap:8,px:8,py:12,backgroundColor:"background.tag",borderRadius:8},children:Ac.map((n=>In.jsxs(i,{sx:{flexGrow:1,flexBasis:"100%",flexShrink:1,display:"flex",flexDirection:"column",gap:4,px:2,pb:2,borderRadius:8,background:n.selected?t.palette.primary.main:"transparent"},children:[In.jsx(i,{sx:{color:n.selected?t.palette.primary.contrastText:t.palette.primary.main,typography:"h6",lineHeight:"16px",px:8,py:4,textAlign:"center"},children:n.selected?In.jsx(In.Fragment,{children:"Cheapest"}):In.jsx(In.Fragment,{children:" "})}),In.jsxs(i,{sx:{p:11,border:`solid 1px ${t.palette.border.main}`,borderRadius:8,backgroundColor:"background.paper",position:"relative",overflow:"hidden"},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600,color:t.palette.text.secondary},children:n.name}),In.jsx(i,{sx:{pt:20,typography:"h6",color:t.palette.text.secondary},children:"Fee Cost"}),In.jsxs(i,{sx:{pt:4,typography:"body2",fontWeight:600,color:t.palette.text.primary},children:[n.selected?null!==e?`$${e}`:"-":"$-",n.selected?null:In.jsx(i,{component:"span",sx:{color:t.palette.text.secondary},children:"(no route)"})]}),In.jsx(i,{sx:{position:"absolute",top:0,right:0,width:n.width,height:n.height},children:n.ICON})]})]},n.id)))})},Sc=300;function Lc({open:e,onClose:t,afterClose:n,title:o,rightSlot:r,canBack:a=!0,children:s,height:l,testId:d}){return In.jsxs(i,{sx:{position:"absolute",top:e?0:"100%",transition:`all ${Sc}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?In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:20,px:16},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:o}),r,!r&&a&&In.jsx(i,{component:Un.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>n&&n()),Sc)}})]}):"",e?s:""]})}function Oc({open:e,onClose:t,afterClose:n,title:o,rightSlot:r,canBack:a=!0,children:l,height:d,testId:c}){return In.jsx(s,{open:e,onClose:t,"data-testid":c,"data-active":e?"1":"0",children:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",height:d},children:[o?In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:20,px:16},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:o}),r,!r&&a&&In.jsx(i,{component:Un.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>n&&n()),Sc)}})]}):"",e?l:""]})})}function Rc(e){var{scope:t,modal:n}=e,i=vn(e,["scope","modal"]);const{widgetRef:o,DialogComponent:r}=On();if(r)return In.jsx(r,{scope:t,...i});const a=n?Oc:Lc;return(null==o?void 0:o.current)&&!t?Mt(In.jsx(a,{...i}),o.current):In.jsx(a,{...i})}const Mc=[{id:19,name:"BTC",address:"Btc1111111111111111111111111111111111111111",symbol:"BTC",decimals:8,logo:"https://images.dodoex.io/Q1VTMWZNsPlIhSP9TcAGXz9umOA9Ttcx2yFcBVbNA2Y/rs:fit:160:160:0/g:no/aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL2RvZG8tbWVkaWEtc3RhZ2luZy9kZXYvMTgzMzQvYnRjMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMQ.webp",chainId:8223,position:1,slippage:null},{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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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}];function _c({tokenList:e,popularTokenList:t}){Y((()=>{(()=>{bn(this,void 0,void 0,(function*(){let n=[];var i;n=re(e)?e:ie(t,Mc,(e=>e.address.toLowerCase()+e.chainId+e.side)),i=n,Ls.setState({tokenList:i})}))})()}),[e,t]),Y((()=>{var e;e=null!=t?t:[],Ls.setState({popularTokenList:e})}),[t])}var Pc;function Bc(e,t,n,i=0){if(e===t)return Pc.fully+i;const o=e.indexOf(t);return 0===o?Pc.prefix+i:o>0?Pc.other+i:Pc.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(Pc||(Pc={}));const Dc=(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=Bc(e.symbol.toLocaleLowerCase(),i,0,1)}if(o)e.name.toLocaleLowerCase()===i&&(o=Pc.fully+1);else{let t=Bc(e.name.toLocaleLowerCase(),i,0,10);t=t===Pc.fully+10?Pc.fully+1:t,o=t}return o};function Nc({value:e,onChange:t,occupiedAddrs:n,occupiedChainId:i,hiddenAddrs:o,showAddrs:r,side:a,chainId:s,visible:l,defaultLoadBalance:d,multiple:c}){const[u,p]=$(""),{tokenList:h}=Ls(),m=Pd(),g=Z((()=>null!=s?s:m),[s,m]),f=Z((()=>h.filter((e=>e.chainId===g))),[h,g]),x=Ls((e=>e.popularTokenList.filter((e=>e.chainId===g)))),y=Z((()=>(null==Mc?void 0:Mc.filter((e=>e.chainId===g)))||[]),[g]),v=Z((()=>new Set(o?o.map((e=>e.toLowerCase())):void 0)),[o]),b=Z((()=>r?new Set(r.map((e=>e.toLowerCase()))):void 0),[r]),j=z((e=>{const t=new Set;return e.filter((e=>{if(e.chainId!==g)return!1;let n=!0;if(n=b?b.has(e.address.toLowerCase()):!v.has(e.address.toLowerCase()),n)if(a)n=!e.side||e.side===a;else{const i=`${e.chainId}-${e.address}`;n=!t.has(i),t.add(i)}return n}))}),[b,g,v]),C=Z((()=>j(x)),[x,j]),w=z((o=>{const r=o.address.toLowerCase(),a=!(i&&o.chainId!==i||!(null==n?void 0:n.some((e=>e.toLowerCase()===r))));if(Array.isArray(e)||c&&!e){const n=[...e],i=n.findIndex((e=>e.address.toLocaleLowerCase()===r));-1!==i?n.splice(i,1):n.push(o),t(n,a)}else t(o,a)}),[t,n,i]),k=Z((()=>{const e=j(f),t=new Set;return e.forEach((e=>{t.add(e.address)})),C.forEach((n=>{t.has(n.address)||e.push(n)})),e||[]}),[f,j,C]),T=function({chainId:e,value:t,tokenList:n,popularTokenList:i,visible:o,defaultLoadBalance:r}){const{latestBlockNumber:a}=jd(),s=Z((()=>{const t=new Set;return n.forEach((n=>{n.chainId===e&&t.add(n)})),null==i||i.forEach((n=>{n.chainId===e&&t.add(n)})),Array.from(t)}),[n,i,e]),l=Z((()=>t?Array.isArray(t)?t.map((e=>e)):[t]:[]),[t]),d=Ed({tokenList:s,skip:!1===o&&!r});return Ed({tokenList:l,blockNumber:a}),d}({chainId:g,tokenList:k,popularTokenList:C,value:e,visible:l,defaultLoadBalance:d}),E=z((t=>{if(null===t)return null;const i=[];u?t.forEach((e=>{const t=Dc(e,u,{matchAddress:!0});t&&i.push({sort:t,token:e})})):t.forEach((e=>{i.push({sort:0,token:e})}));const o=[];return i.sort(((t,i)=>{var o,r;const a=t.token,s=i.token;if(e)if(Array.isArray(e)){const t=e.map((e=>e.address)),n=t.indexOf(a.address),i=t.indexOf(s.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(s.address===e.address)return 1}if(null==n?void 0:n.includes(a.address))return-1;if(null==n?void 0:n.includes(s.address))return 1;const l=(null===(o=T.get(`${a.chainId}-${a.address}`))||void 0===o?void 0:o.balance)||new Le(0),d=(null===(r=T.get(`${s.chainId}-${s.address}`))||void 0===r?void 0:r.balance)||new Le(0),c=C.map((e=>e.address));if(null==c?void 0:c.includes(a.address))return-1;if(null==c?void 0:c.includes(s.address))return 1;if(!l.eq(d))return l.gt(d)?-1:1;if(t.sort!==i.sort)return t.sort>i.sort?1:-1;const u=y.map((e=>e.address));return(null==u?void 0:u.includes(a.address))?-1:(null==u?void 0:u.includes(s.address))?1:a.symbol.localeCompare(s.symbol)})).some((e=>!!(u&&o.length>21)||(o.push(e.token),!1))),o}),[u,T,n,e,C,y]),A=Z((()=>E(k)||[]),[E]);return{filter:u,setFilter:p,showTokenList:A,onSelectToken:w,popularTokenList:C,tokenInfoMap:T}}function Fc({width:e=24,height:t=24,marginRight:n=8,url:o,zIndex:r,cross:a,address:s,token:l,sx:d,chainId:c,noShowChain:u,noBorder:p,chainSize:h=12,logoOffset:m}){const[g,f]=$(!1),[x,y]=$(""),[v,b]=$(""),[j,C]=$(!1),w=z((()=>f(!0)),[]);let k=function(e){const{chainId:t}=hd(),{tokenList:n}=Ls();return Z((()=>{if(!e)return;let i=n.find((({address:n,chainId:i})=>i===t&&n===e));return i||(i=n.find((({address:t})=>t===e))),i}),[e,n,t])}(s);l&&(k=l);const T=s||(null==k?void 0:k.address),E=null==k?void 0:k.symbol,A=null==E?void 0:E.charAt(0).toUpperCase(),{getTokenLogoUrl:I}=On(),S=Z((()=>null!=c?c:null==k?void 0:k.chainId),[c,k]),L=Z((()=>{const n=null==k?void 0:k.logoURI,i=o||n||"";return I&&I({address:T,chainId:S,width:e,height:t,url:i})||i}),[o,k,I,T,S,e,t]);let O=m;O||(O=h/2<8?h/2:h-8),Y((()=>{C(!1)}),[T,L]),Y((()=>{a&&(L?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()}}(L,(e=>{y(e)})):y(""))}),[L,a]),Y((()=>{try{let t=T;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const n=new _t(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();b(`data:image/svg+xml;base64,${n}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[T,e]);const R=S?us.get(S):null,{onlyChainId:M}=On(),_=!u&&!!R&&!M,P=In.jsxs(i,{sx:Object.assign(Object.assign(Object.assign({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:e,height:t,borderRadius:"50%"},p?{}:{border:"solid 1px",borderColor:"border.main"}),{flexShrink:0}),_?{}:Object.assign({marginRight:n,zIndex:r},d)),children:[!g&&In.jsx(i,{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}),In.jsx(i,{component:"img",src:!(a?x:L)||j?v:a?x:L,onLoad:w,onError:e=>{const t=e.target;T&&v&&C(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]});return _?In.jsxs(i,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",width:e+O,height:t,marginRight:n,zIndex:r},d||{}),children:[P,In.jsx(i,{sx:{position:"absolute",right:0,bottom:-1,width:h,height:h,border:"solid 1px",borderColor:"border.main",borderRadius:"50%",overflow:"hidden"},children:In.jsx(i,{component:R.logo,sx:{display:"block",width:"100%",height:"100%"}})})]}):P}const{isSameAddress:Uc}=ue.utils;function qc({routing:e,fromTokenRaw:t,toTokenRaw:n,targetTokenAddress:i}){return H.useMemo((()=>Uc(t.address,i)?t:Uc(n.address,i)?n:null),[t,e.chainId,i,n])}function Vc({routing:t,fromTokenRaw:n,toTokenRaw:o}){const{poolDetails:r}=t,s=a(),d=qc({fromTokenRaw:n,toTokenRaw:o,routing:t,targetTokenAddress:t.fromToken}),c=qc({fromTokenRaw:n,toTokenRaw:o,routing:t,targetTokenAddress:t.toToken}),u=Array.from(r.keys()),{isMobile:p}=Sd();return In.jsx(i,{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:p?0:4},children:u.map(((n,o)=>{const a=r.get(n);return a?In.jsxs(H.Fragment,{children:[o>0&&In.jsx(i,{sx:{width:"100%",height:"1px",backgroundColor:s.palette.background.paperDarkContrast}}),In.jsxs(i,{sx:{typography:"body2",color:s.palette.text.secondary,textTransform:"capitalize"},children:[In.jsx(e,{id:"Z5HWHd",message:"On"})," ",n]}),In.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:12},children:a.map((e=>{var n,o;return In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body1",color:s.palette.text.primary,gap:20},children:[In.jsx(l,{title:`${null!==(n=null==d?void 0:d.symbol)&&void 0!==n?n:"-"}/${null!==(o=null==c?void 0:c.symbol)&&void 0!==o?o:"-"}`,children:In.jsxs(i,{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(ad(t.chainId,e.poolAddress),"_blank")},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{width:20,height:20,address:t.fromToken,chainId:t.chainId,sx:{marginRight:-4}}),In.jsx(Fc,{width:20,height:20,address:t.toToken,chainId:t.chainId})]}),e.poolAddress&&In.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.jsx("g",{children:In.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)}))})]},n):null}))})}function Wc({sx:e}){const t=a();return In.jsx(i,{sx:Object.assign({width:5,height:5,backgroundColor:t.palette.text.primary,borderRadius:"50%",flex:"0 0 auto"},e)})}function Hc({sx:e}){const t=a();return In.jsx(i,{sx:Object.assign({width:"0",height:"0",borderBottom:"3px solid transparent",borderTop:"3px solid transparent",borderLeft:`5px solid ${t.palette.text.primary}`,flex:"0 0 auto"},e)})}function Zc({sx:e}){const t=a();return In.jsx(i,{sx:Object.assign({borderTopWidth:1,borderTopStyle:"dashed",borderTopColor:t.palette.text.primary,flexGrow:1,flexShrink:0},e)})}function zc(){const e=a();return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,ml:7},children:[In.jsx(Wc,{}),In.jsx(i,{sx:{width:"1px",height:"22px",borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:e.palette.text.primary}}),In.jsx(Hc,{sx:{transform:"rotate(90deg)"}})]})}function $c({routeData:e,fromTokenRaw:t,toTokenRaw:n,sx:o}){const r=a();return In.jsxs(i,{sx:Object.assign({pb:20,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:8,maxHeight:"calc(80vh - 64px - 48px - 24px - 50px - 60px)",overflow:"auto"},o),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{width:20,height:20,address:t.address,chainId:t.chainId}),In.jsx(i,{sx:{typography:"body1",color:r.palette.text.primary,fontWeight:500},children:t.symbol||"-"})]}),In.jsx(zc,{}),e.map(((e,i)=>In.jsxs(H.Fragment,{children:[i>0&&In.jsx(zc,{}),In.jsx(Vc,{routing:e,fromTokenRaw:t,toTokenRaw:n})]},e.fromToken))),In.jsx(zc,{}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{width:20,height:20,address:n.address,chainId:n.chainId}),In.jsx(i,{sx:{typography:"body1",color:r.palette.text.primary,fontWeight:500},children:n.symbol||"-"})]})]})}function Gc({routeData:e,fromTokenRaw:t,toTokenRaw:n}){const o=a();return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{width:20,height:20,address:t.address,chainId:t.chainId}),In.jsx(i,{sx:{typography:"body1",color:o.palette.text.primary,fontWeight:500},children:t.symbol||"-"})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:{typography:"body1",color:o.palette.text.primary,fontWeight:500},children:n.symbol||"-"}),In.jsx(Fc,{width:20,height:20,address:n.address,chainId:n.chainId})]})]}),In.jsxs(i,{sx:{mt:5,display:"flex",alignItems:"flex-start",mx:7.5},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[In.jsx(Wc,{}),In.jsx(i,{sx:{width:"1px",height:"48px",borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:o.palette.text.primary}})]}),In.jsx(Zc,{sx:{mt:52,ml:-2.5,minWidth:59}}),In.jsx(Hc,{sx:{mt:49.5}}),In.jsx(i,{sx:{mt:23,maxWidth:761,display:"flex",alignItems:"flex-start",overflow:"auto"},children:e.map(((e,o)=>In.jsxs(H.Fragment,{children:[o>0&&In.jsxs(i,{sx:{mt:26.5,display:"flex",alignItems:"center",width:"24px",flexShrink:0},children:[In.jsx(Wc,{}),In.jsx(Zc,{}),In.jsx(Hc,{})]}),In.jsx(Vc,{routing:e,fromTokenRaw:t,toTokenRaw:n})]},e.fromToken)))}),In.jsx(Wc,{sx:{mt:51}}),In.jsx(Zc,{sx:{mt:53,mr:-2.5,minWidth:59}}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[In.jsx(Hc,{sx:{transform:"rotate(-90deg)"}}),In.jsx(i,{sx:{width:"1px",height:"48px",borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:o.palette.text.primary}})]})]})]})}var Yc,Qc;function Xc(){return Xc=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},Xc.apply(null,arguments)}var Kc,Jc;function eu(){return eu=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},eu.apply(null,arguments)}var tu,nu;function iu(){return iu=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},iu.apply(null,arguments)}var ou,ru,au;function su(){return su=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},su.apply(null,arguments)}var lu,du;function cu(){return cu=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},cu.apply(null,arguments)}var uu,pu,hu,mu;function gu(){return gu=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},gu.apply(null,arguments)}var fu,xu,yu;function vu(){return vu=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},vu.apply(null,arguments)}var bu,ju,Cu,wu,ku,Tu;function Eu(){return Eu=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},Eu.apply(null,arguments)}var Au,Iu;function Su(){return Su=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},Su.apply(null,arguments)}var Lu,Ou;function Ru(){return Ru=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},Ru.apply(null,arguments)}var Mu,_u;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)}var Bu;function Du(){return Du=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},Du.apply(null,arguments)}var Nu,Fu;function Uu(){return Uu=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},Uu.apply(null,arguments)}var qu,Vu,Wu,Hu,Zu,zu;function $u(){return $u=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},$u.apply(null,arguments)}var Gu,Yu;function Qu(){return Qu=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},Qu.apply(null,arguments)}var Xu,Ku,Ju;function ep(){return ep=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},ep.apply(null,arguments)}var tp,np;function ip(){return ip=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},ip.apply(null,arguments)}var op,rp;function ap(){return ap=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},ap.apply(null,arguments)}var sp,lp,dp,cp,up;function pp(){return pp=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},pp.apply(null,arguments)}const hp=[{id:"cBridge",logoURI:e=>W.createElement("svg",vu({width:34,height:34,viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),fu||(fu=W.createElement("rect",{x:1,y:1,width:32,height:32,rx:8,fill:"white",stroke:"#33363F"})),xu||(xu=W.createElement("g",{clipPath:"url(#clip0_37_1169)"},W.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"}),W.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"}),W.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"}))),yu||(yu=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_37_1169"},W.createElement("rect",{width:20.4808,height:10,fill:"white",transform:"translate(7 12)"}))))),name:"cBridge"},{id:"stargate",logoURI:e=>W.createElement("svg",$u({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qu||(qu=W.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"})),Vu||(Vu=W.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"})),Wu||(Wu=W.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"})),Hu||(Hu=W.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"})),Zu||(Zu=W.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"})),zu||(zu=W.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=>W.createElement("svg",Eu({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),bu||(bu=W.createElement("rect",{width:32,height:32,rx:8,fill:"black"})),ju||(ju=W.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)"})),Cu||(Cu=W.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)"})),wu||(wu=W.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)"})),ku||(ku=W.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)"})),Tu||(Tu=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5431_181414",x1:7.86029,y1:12.5047,x2:23.8117,y2:22.7959,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#29C1FC"}),W.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),W.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),W.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),W.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),W.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),W.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),W.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),W.createElement("linearGradient",{id:"paint1_linear_5431_181414",x1:10.2949,y1:8.73084,x2:26.2463,y2:19.0221,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#29C1FC"}),W.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),W.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),W.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),W.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),W.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),W.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),W.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),W.createElement("linearGradient",{id:"paint2_linear_5431_181414",x1:9.46092,y1:10.0213,x2:25.4123,y2:20.3125,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#29C1FC"}),W.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),W.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),W.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),W.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),W.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),W.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),W.createElement("stop",{offset:.9956,stopColor:"#FBB03B"})),W.createElement("linearGradient",{id:"paint3_linear_5431_181414",x1:7.01942,y1:13.8057,x2:22.9708,y2:24.0969,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#29C1FC"}),W.createElement("stop",{offset:.5022,stopColor:"#AB00FF"}),W.createElement("stop",{offset:.5082,stopColor:"#AC03FC"}),W.createElement("stop",{offset:.6406,stopColor:"#C840B8"}),W.createElement("stop",{offset:.7601,stopColor:"#DE7082"}),W.createElement("stop",{offset:.8629,stopColor:"#EE935B"}),W.createElement("stop",{offset:.9448,stopColor:"#F7A844"}),W.createElement("stop",{offset:.9956,stopColor:"#FBB03B"}))))),name:"Connext"},{id:"synapse",logoURI:e=>W.createElement("svg",ep({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),W.createElement("mask",{id:"mask0_419_48383",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:32,height:32},Xu||(Xu=W.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"}))),Ku||(Ku=W.createElement("g",{mask:"url(#mask0_419_48383)"},W.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"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}),W.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)"}))),Ju||(Ju=W.createElement("defs",null,W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"})),W.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)"},W.createElement("stop",{stopColor:"#FF00FF"}),W.createElement("stop",{offset:1,stopColor:"#734CE2"}))))),name:"Synapse"},{id:"swft",logoURI:e=>W.createElement("svg",gu({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),uu||(uu=W.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"})),pu||(pu=W.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"})),hu||(hu=W.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"})),mu||(mu=W.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=>W.createElement("svg",iu({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),tu||(tu=W.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"})),nu||(nu=W.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=>W.createElement("svg",su({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),ou||(ou=W.createElement("rect",{y:.5,width:24,height:24,rx:4,fill:"white"})),ru||(ru=W.createElement("rect",{x:7.5,y:6.5,width:8.72727,height:12,fill:"url(#pattern0)"})),au||(au=W.createElement("defs",null,W.createElement("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:1,height:1},W.createElement("use",{xlinkHref:"#image0_1105_25179",transform:"translate(-0.958333 -0.393939) scale(0.0208333 0.0151515)"})),W.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=>W.createElement("svg",cu({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),lu||(lu=W.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"})),du||(du=W.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=>W.createElement("svg",eu({width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kc||(Kc=W.createElement("g",{clipPath:"url(#clip0_1106_26400)"},W.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"}),W.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"}),W.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"}),W.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"}))),Jc||(Jc=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_1106_26400"},W.createElement("rect",{width:24,height:24,fill:"white",transform:"translate(0 0.5)"}))))),name:"Bungee"},{id:"squid",logoURI:e=>W.createElement("svg",Uu({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Nu||(Nu=W.createElement("g",{clipPath:"url(#clip0_6759_209574)"},W.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"}),W.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"}),W.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"}),W.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"}),W.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"}))),Fu||(Fu=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_6759_209574"},W.createElement("rect",{width:24,height:24,fill:"white"}))))),name:"Squid"},{id:"across",logoURI:e=>W.createElement("svg",Xc({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Yc||(Yc=W.createElement("rect",{width:32,height:32,rx:16,fill:"#6CF9D8"})),Qc||(Qc=W.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=>W.createElement("svg",Ru({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Lu||(Lu=W.createElement("g",{clipPath:"url(#clip0_8229_671)"},W.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"}),W.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"}),W.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"}))),Ou||(Ou=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_8229_671"},W.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(6 6)"}))))),name:"Layerswap"},{id:"okx",logoURI:e=>W.createElement("svg",Pu({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Mu||(Mu=W.createElement("g",{clipPath:"url(#clip0_1443_44689)"},W.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"}),W.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"}))),_u||(_u=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_1443_44689"},W.createElement("rect",{width:32,height:32,fill:"white"}))))),name:"okx"},{id:"symbiosis",logoURI:e=>W.createElement("svg",Qu({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Gu||(Gu=W.createElement("g",{clipPath:"url(#clip0_8229_679)"},W.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"}),W.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"}),W.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"}),W.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"}),W.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"}))),Yu||(Yu=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_8229_679"},W.createElement("rect",{width:32,height:30.9034,fill:"white",transform:"translate(0 1)"}))))),name:"symbiosis"},{id:"scroll",logoURI:e=>W.createElement("svg",pp({width:24,height:24,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),sp||(sp=W.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"})),lp||(lp=W.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"})),dp||(dp=W.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"})),cp||(cp=W.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"})),up||(up=W.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=>W.createElement("svg",ap({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),op||(op=W.createElement("g",{clipPath:"url(#a)"},W.createElement("rect",{width:24,height:24,rx:12,fill:"#fff"}),W.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)"}))),rp||(rp=W.createElement("defs",null,W.createElement("linearGradient",{id:"b",x1:0,y1:24,x2:24.43,y2:23.554,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#29CCB9"}),W.createElement("stop",{offset:.495,stopColor:"#0091FF"}),W.createElement("stop",{offset:1,stopColor:"#FF66B7"})),W.createElement("clipPath",{id:"a"},W.createElement("rect",{width:24,height:24,rx:12,fill:"#fff"}))))),name:"Manta"},{id:"orbiter",logoURI:e=>W.createElement("svg",Du({xmlns:"http://www.w3.org/2000/svg",width:"32.000000pt",height:"32.000000pt",viewBox:"0 0 32.000000 32.000000",preserveAspectRatio:"xMidYMid meet"},e),Bu||(Bu=W.createElement("g",{transform:"translate(0.000000,32.000000) scale(0.100000,-0.100000)",fill:"#000000",stroke:"none"},W.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=>W.createElement("svg",Su({xmlns:"http://www.w3.org/2000/svg",width:32,height:32,fill:"none",viewBox:"0 0 32 32"},e),Au||(Au=W.createElement("g",{clipPath:"url(#a)"},W.createElement("rect",{width:32,height:32,fill:"#FFE804",rx:8}),W.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"}),W.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"}),W.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"}))),Iu||(Iu=W.createElement("defs",null,W.createElement("clipPath",{id:"a"},W.createElement("path",{fill:"#fff",d:"M0 0h32v32H0z"}))))),name:"Omni-Trade"},{id:"zetachain",logoURI:e=>W.createElement("svg",ip({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},e),tp||(tp=W.createElement("g",{clipPath:"url(#clip0_2101_121411)"},W.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"}),W.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"}),W.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"}),W.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"}),W.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"}))),np||(np=W.createElement("defs",null,W.createElement("clipPath",{id:"clip0_2101_121411"},W.createElement("rect",{width:24,height:24,rx:12,fill:"white"}))))),name:"ZUNO"}];function mp({item:e,isMobile:t}){var n,o,r,s,l,c;const u=a(),[p,h]=$(!1),m=H.useMemo((()=>e.swapSteps?e.swapSteps.map((e=>{var t,n,i,o;const{inputToken:r,outputToken:a,percent:s}=e,l=new Map,d={poolPart:Gs({input:new Le(s).div(100)}),poolAddress:null!==(n=null===(t=e.assembleArgs)||void 0===t?void 0:t.pairAddress)&&void 0!==n?n:null};return l.set(null!==(o=null===(i=e.assembleArgs)||void 0===i?void 0:i.pairName)&&void 0!==o?o:"-",[d]),{fromToken:r.address,toToken:a.address,chainId:r.chainId,poolDetails:l}})):[]),[e.swapSteps]),g="from"===e.key,f="to"===e.key,x=g||f;return In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:{width:20,height:20,borderRadius:"50%",backgroundColor:u.palette.background.tag,display:"flex",alignItems:"center",justifyContent:"center"},children:In.jsx(i,{component:e.logo,sx:{width:20,height:20}})}),In.jsx(i,{sx:{typography:"body1",lineHeight:"22px",color:u.palette.text.primary},children:e.title})]}),x?null:In.jsxs(i,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",gap:4,typography:"body2",lineHeight:"22px",color:u.palette.text.primary},children:[In.jsxs(i,{children:[Ps({input:e.fromTokenAmount,decimals:null===(n=e.fromToken)||void 0===n?void 0:n.decimals})," ",null===(o=e.fromToken)||void 0===o?void 0:o.symbol]}),In.jsx(i,{sx:{color:u.palette.text.secondary},children:"On"}),In.jsx(i,{component:null===(r=e.fromChain)||void 0===r?void 0:r.logo,sx:{width:18,height:18}}),In.jsx(i,{sx:{color:u.palette.text.secondary},children:"to"}),In.jsxs(i,{children:[Ps({input:e.toTokenAmount,decimals:null===(s=e.toToken)||void 0===s?void 0:s.decimals})," ",null===(l=e.toToken)||void 0===l?void 0:l.symbol]}),In.jsx(i,{sx:{color:u.palette.text.secondary},children:"on"}),In.jsx(i,{component:null===(c=e.toChain)||void 0===c?void 0:c.logo,sx:{width:18,height:18}})]})]}),f?null:In.jsxs(i,{sx:{pt:8,pb:24,ml:9,borderLeftWidth:1,borderLeftStyle:"dashed",borderLeftColor:u.palette.border.light},children:[g?null:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4},children:[e.tx&&e.txChainId&&In.jsxs(i,{component:"a",href:ad(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:",In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:In.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&&In.jsxs(i,{component:d,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",In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:In.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&&In.jsx(i,{sx:{mt:8,ml:20,p:12,borderRadius:12,backgroundColor:u.palette.background.paperDarkContrast},children:t?In.jsx($c,{routeData:m,fromTokenRaw:e.fromToken,toTokenRaw:e.toToken}):In.jsx(Gc,{routeData:m,fromTokenRaw:e.fromToken,toTokenRaw:e.toToken})})]})]},e.key)}const gp=({route:e,isMobile:t})=>{const{fromChainId:n,toChainId:o,step:r}=e,a=Z((()=>{const e=us.get(n),t=us.get(o),i=[{key:"from",logo:null==e?void 0:e.logo,title:null==e?void 0:e.name}];return r.includedSteps.length>0&&r.includedSteps.forEach((e=>{var t,n;const o=hp.find((t=>t.id===e.tool)),r=us.get(e.estimate.fromToken.chainId),a=us.get(e.estimate.toToken.chainId);i.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!==(n=null==o?void 0:o.name)&&void 0!==n?n: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})})),i.push({key:"to",logo:null==t?void 0:t.logo,title:null==t?void 0:t.name}),i}),[n,r.includedSteps,o]);return In.jsx(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:a.map((e=>In.jsx(mp,{item:e,isMobile:t},e.key)))})},fp=({route:t})=>{const[n,o]=$(!1),r=a(),{isMobile:s}=Sd(),{fromChainId:l,toChainId:d,step:c}=t,u=Z((()=>{const e=us.get(l),t=us.get(d),n=[{key:"from",logo:null==e?void 0:e.logo}];return c.includedSteps.length>0&&c.includedSteps.forEach((e=>{const t=hp.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 In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{py:4,pl:8,pr:4,display:"flex",alignItems:"center",gap:4,borderRadius:12,backgroundColor:r.palette.background.tag,cursor:"pointer",typography:"h6",fontWeight:500,color:r.palette.text.secondary,"&:hover":{color:r.palette.text.primary}},onClick:()=>{o(!0)},children:[In.jsx(i,{sx:{color:r.palette.text.primary},children:"Route:"}),In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:0},children:u.map(((e,t)=>In.jsx(i,{sx:{ml:0===t?0:-4,width:16,height:16,borderRadius:"50%",backgroundColor:r.palette.border.main,border:`1px solid ${r.palette.border.main}`,p:1,display:"flex",alignItems:"center",justifyContent:"center"},children:In.jsx(i,{component:e.logo,sx:{width:14,height:14}})},e.key)))}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:In.jsx("path",{d:"M2.91699 11.0833V7.58332H4.08366V9.91666H6.41699V11.0833H2.91699ZM9.91699 6.41666V4.08332H7.58366V2.91666H11.0837V6.41666H9.91699Z",fill:"currentColor"})})]}),In.jsx(Rc,{open:n,title:In.jsx(e,{id:"rT8e1f",message:"Route"}),onClose:()=>o(!1),modal:!0,children:In.jsx(i,{sx:{minWidth:s?"100%":800,py:20,px:20,borderTop:`1px solid ${r.palette.border.main}`},children:In.jsx(gp,{route:t,isMobile:s})})})]})};function xp({route:t}){var n;const o=a(),[r,s]=$(!1),c=uc({fees:null!==(n=null==t?void 0:t.fees)&&void 0!==n?n:[]});if(!t)return null;const{product:u,executionDuration:p,feeUSD:h,fromAmount:m,fromToken:g,fromChainId:f,toTokenAmount:x,toToken:y,toChainId:v,step:{includedSteps:b}}=t,j=r?y:g,C=r?g:y;return In.jsx(In.Fragment,{children:In.jsxs(i,{sx:{flexGrow:1,display:"flex",flexDirection:"column",gap:8},children:[In.jsxs(i,{sx:{px:11,py:7,borderRadius:12,border:`solid 1px ${o.palette.border.main}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",typography:"body2",color:o.palette.text.primary,fontWeight:600,gap:6},children:[In.jsxs("span",{children:["1 ",j.symbol]}),In.jsx("span",{style:{color:o.palette.text.secondary},children:"="}),In.jsxs("span",{children:[Ps({input:r?new Le(m).div(x):x.div(m),decimals:null==C?void 0:C.decimals})," ",C.symbol]}),In.jsx(i,{component:d,onClick:e=>{e.stopPropagation(),s((e=>!e))},sx:{color:o.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:o.palette.text.secondary}},children:In.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[In.jsx("circle",{cx:"9",cy:"9",r:"9",fill:"currentColor",fillOpacity:"0.1"}),In.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"})]})})]}),In.jsx(fp,{route:t})]}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8,px:11,py:7,borderRadius:12,border:`solid 1px ${o.palette.border.main}`},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600},children:"Cheapest Fee"}),In.jsx(l,{onlyHover:!0,placement:"top",title:In.jsx(i,{sx:{minWidth:200,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,typography:"h6",color:o.palette.text.secondary},children:c.map((e=>In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsx(i,{children:e.title}),e.isFree?In.jsx(i,{sx:{color:o.palette.primary.main},children:"Free"}):null!==e.value?In.jsxs(i,{sx:{color:o.palette.text.primary},children:["~$",e.value]}):In.jsx(i,{sx:{color:o.palette.text.primary},children:"-"})]},e.key)))}),children:In.jsxs(i,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:4,px:8,py:4,border:`solid 1px ${o.palette.border.main}`,borderRadius:12},children:[In.jsx(Un.GasFee,{style:{color:o.palette.text.secondary,width:14,height:14}}),In.jsx(i,{sx:{typography:"h6",lineHeight:"16px"},children:null!==h?`$${h}`:"-"})]})}),In.jsx(l,{onlyHover:!0,placement:"top",title:In.jsx(e,{id:"h5FVz1",message:"Estimated transaction time"}),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,px:8,py:4,border:`solid 1px ${o.palette.border.main}`,borderRadius:12,typography:"h6"},children:[In.jsx(Un.Time,{style:{color:o.palette.text.secondary,width:14,height:14}}),In.jsx(i,{sx:{typography:"h6",lineHeight:"16px"},children:null!==p?gc({start:Date.now(),end:Date.now()+1e3*p}):"-"})]})})]}),In.jsx(Ic,{feeUSD:h})]})]})})}Bt.initEccLib(Pt);const yp={bech32:"tb",bip32:{private:70615956,public:70617039},messagePrefix:"Bitcoin Signed Message:\n",pubKeyHash:111,scriptHash:196,wif:239};function vp(e){return bn(this,void 0,void 0,(function*(){const t=`https://mempool.space/signet/api/tx/${e}`,n=yield fetch(t);return yield n.json()}))}const bp=520;function jp(e){if(e<253)return Buffer.from([e]);const t=Buffer.alloc(3);return t.writeUInt8(253,0),t.writeUInt16LE(e,1),t}function Cp(e){return bn(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(bp,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=Bt.script.compile([a,Bt.opcodes.OP_CHECKSIG,Bt.opcodes.OP_FALSE,Bt.opcodes.OP_IF,...s.map((e=>e)),Bt.opcodes.OP_ENDIF]),d={output:l,redeemVersion:192},c=Bt.payments.p2tr({internalPubkey:a,scriptTree:d,redeem:d,network:yp});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 bn(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 Bt.Psbt({network:yp});h.addOutput({script:c.output,value:t});let m=0;for(let e=0;e<p.length;e++){const t=p[e],n=yield vp(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 g=m-t-o;if(g<0)throw new Error("Insufficient funds");console.log("change:",m,g),h.addOutput({address:i.address,value:g}),console.log("psbt.data.inputs:",h.data.inputs);const f=h.toHex();console.log("psbtHex:",f);const x=yield i.signPsbt(f);console.log("signPsbtResult:",x);const y=yield i.pushPsbt(x);console.log("tx:",y);const v=new Bt.Psbt({network:yp}),{output:b}=Bt.payments.p2tr({internalPubkey:a,network:yp,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 j=function(e,t){const n=[Buffer.alloc(64),e,t],i=[jp(n.length)];for(const e of n)i.push(jp(e.length)),i.push(e);return Buffer.concat(i)}(l,Buffer.from(u,"hex")),C=10+(80+Math.ceil(j.length/4))+31,w=Math.ceil(10*C);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 wp({route:e,bridgeOrderTxRequest:t}){const n=vd(),{solanaWalletProvider:o,solanaConnection:r,bitcoinWalletProvider:a}=hd(),s=Wd(),l=z((()=>{if(t&&e)try{const{fromToken:l,toToken:d,fromAmount:c,toTokenAmount:u,fromChainId:p,toChainId:h,toAddress:m,slippage:g,roundedRouteCostTime:f,fees:x}=e,y=Ps({input:c,decimals:l.decimals}),v=Ps({input:u,decimals:d.decimals}),b=In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{token:l,marginRight:6,chainId:l.chainId}),`${y} ${null==l?void 0:l.symbol}`,In.jsx(i,{component:Un.DoubleRight,sx:{width:12,height:12,mx:16}}),In.jsx(Fc,{token:d,marginRight:6,chainId:d.chainId}),`${v} ${null==d?void 0:d.symbol}`]}),j=(i,o)=>bn(this,void 0,void 0,(function*(){const r=yield function(e){return bn(this,arguments,void 0,(function*({graphQLRequests:e,tx:t,route:n,calldata:i}){var o;const{sourceRoute:r}=n,a=vn(null!=r?r:{},["approveTarget","encodeParams"]),s=Object.assign(Object.assign({fromHash:t},a),{calldata:i});return null===(o=(yield e.getData(ye.graphql.cross_chain_swap_zetachain_orderCreate.toString(),{data:s})).cross_chain_swap_zetachain_orderCreate)||void 0===o?void 0:o.success}))}({graphQLRequests:n,tx:i,route:e,calldata:t.data});o&&o(i,{orderId:r})})),C={fromChainId:p,toChainId:h,fromTokenAddress:l.address,toTokenAddress:d.address,fromTokenSymbol:l.symbol,toTokenSymbol:d.symbol,fromTokenAmount:c,toTokenAmount:u.toString(),slippage:g,sendAccount:m,roundedRouteCostTime:f},w={[Od.crossChain]:!0},k=Object.assign(Object.assign(Object.assign({},t),{fromToken:l,toToken:d,pay:y,receive:v}),C),T=us.get(p);if(!T)throw new Error("fromChain is null");if(T.isBTCChain){if(!a)throw new Error("bitcoinWalletProvider is null");return s.executeCustom({brief:le._({id:"+uZnU3",message:"Cross Chain"}),subtitle:b,metadata:w,mixpanelProps:k,successBack:j,handler:e=>bn(this,void 0,void 0,(function*(){var n;try{const i=null===(n=x.find((e=>"btcDepositFee"===e.type)))||void 0===n?void 0:n.amount,o=yield Cp({toAddress:t.to,amount:new Oe(t.value).toNumber(),calldata:t.data,btcWallet:a,btcDepositFee:i?Number(i):450});e.onSubmit(o),e.onSuccess(o)}catch(t){console.error("wallet.signPSBT execute:",t),e.onError(t)}}))})}if(T.isSolanaChain){if(!o||!r)throw console.error("solanaWalletProvider or solanaConnection is null",o,r),new Error("solanaWalletProvider or solanaConnection is null");return s.executeCustom({brief:le._({id:"+uZnU3",message:"Cross Chain"}),subtitle:b,metadata:w,mixpanelProps:k,successBack:j,handler:e=>bn(this,void 0,void 0,(function*(){try{const n=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=Me.from(t);return _e.populate(n)}({data:t.data}),i=yield r.getLatestBlockhash();n.recentBlockhash=i.blockhash,n.feePayer=new De(t.from);const a=yield o.signTransaction(n),s=yield r.sendRawTransaction(a.serialize());e.onSubmit(s),e.onSuccess(s)}catch(t){if(t instanceof Fe){const e=yield t.getLogs(r);console.log("logs:",e)}console.error("wallet.sendTransaction execute:",t),e.onError(t)}}))})}return s.execute(le._({id:"+uZnU3",message:"Cross Chain"}),Object.assign({opcode:Dd.TX},t),{subtitle:b,metadata:w,mixpanelProps:k,successBack:j})}catch(e){console.error(e)}}),[t,e,s,n,a,o,r]);return l}function kp({size:e="medium",toolDetails:t,nameMarginLeft:n=4,logoMarginLeft:o=0,nameSx:r}){if(!t||!t.logoURI||!t.name)return null;const{logoURI:a,name:s}=t,l=hp.find((e=>e.id===s));return In.jsx(i,{component:null==l?void 0:l.logoURI,style:{marginLeft:o,width:"large"===e?24:16,height:"large"===e?24:16}})}function Tp({children:e}){const t=a();return In.jsxs(i,{sx:{position:"relative",width:"calc(100% - 16px)",mx:"auto"},children:[In.jsx(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",borderTopColor:t.palette.text.primary,borderTopWidth:1,borderTopStyle:"dashed","&:before":{content:'""',position:"absolute",left:0,top:-.5,backgroundColor:t.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 ${t.palette.text.primary}`}}}),In.jsx(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:e})]})}function Ep({chainId:t,token:n,amount:o}){var r;const s=a(),l=Z((()=>us.get(t)),[t]);return In.jsxs(i,{sx:{display:"flex",flexDirection:"column"},children:[In.jsx(i,{sx:{mb:8,display:"flex",alignItems:"flex-end",alignSelf:"center"},children:In.jsx(Fc,{address:null!==(r=null==n?void 0:n.address)&&void 0!==r?r:"",marginRight:0,width:28,height:28,url:null==n?void 0:n.logoURI})}),In.jsxs(i,{sx:{color:s.palette.text.primary,typography:"body1",fontWeight:600,width:"100%",wordBreak:"break-word",textAlign:"center"},children:[Ps({input:o,decimals:null==n?void 0:n.decimals})," ",null==n?void 0:n.symbol]}),In.jsxs(i,{sx:{color:s.palette.text.secondary,typography:"h6",alignSelf:"center"},children:[In.jsx(e,{id:"Fdp03t",message:"on"})," ",null==l?void 0:l.name]})]})}const Ap="en-US";var Ip,Sp,Lp,Op={exports:{}};Op.exports=(Ip="minute",Sp=/[+-]\d\d(?::?\d\d)?/g,Lp=/([+-]|\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(),Ip):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(Sp);if(!t)return null;var n=(""+t[0]).match(Lp)||["-",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,Ip)).$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 Rp=Cn(Op.exports),Mp={exports:{}};Mp.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},g=function(e){return m(e)?Math.ceil(e):Math.floor(e)},f=function(e){return Math.abs(e)},x=function(e,t){return e?m(e)?{negative:!0,format:""+f(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 f=m.prototype;return f.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*c[n]}),0)},f.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=g(e/s),e%=s,this.$d.months=g(e/l),e%=l,this.$d.days=g(e/r),e%=r,this.$d.hours=g(e/o),e%=o,this.$d.minutes=g(e/i),e%=i,this.$d.seconds=g(e/n),e%=n,this.$d.milliseconds=e},f.toISOString=function(){var e=x(this.$d.years,"Y"),t=x(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=x(n,"D"),o=x(this.$d.hours,"H"),r=x(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=x(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},f.toJSON=function(){return this.toISOString()},f.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])}))},f.as=function(e){return this.$ms/c[h(e)]},f.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?g(t/c[n]):this.$d[n],t||0},f.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)},f.subtract=function(e,t){return this.add(e,t,!0)},f.locale=function(e){var t=this.clone();return t.$l=e,t},f.clone=function(){return p(this.$ms,this)},f.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},f.valueOf=function(){return this.asMilliseconds()},f.milliseconds=function(){return this.get("milliseconds")},f.asMilliseconds=function(){return this.as("milliseconds")},f.seconds=function(){return this.get("seconds")},f.asSeconds=function(){return this.as("seconds")},f.minutes=function(){return this.get("minutes")},f.asMinutes=function(){return this.as("minutes")},f.hours=function(){return this.get("hours")},f.asHours=function(){return this.as("hours")},f.days=function(){return this.get("days")},f.asDays=function(){return this.as("days")},f.weeks=function(){return this.get("weeks")},f.asWeeks=function(){return this.as("weeks")},f.months=function(){return this.get("months")},f.asMonths=function(){return this.as("months")},f.years=function(){return this.get("years")},f.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 _p=Cn(Mp.exports),Pp={exports:{}};Pp.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 Bp=Cn(Pp.exports);function Dp({locale:e,children:t}){return Y((()=>{(()=>{bn(this,void 0,void 0,(function*(){yield function(){return bn(this,arguments,void 0,(function*(e=Ap){try{const t=yield import(`./locales/${e}.js`);le.load(e,t.messages||t.default.messages)}catch(e){}le.activate(e)}))}(e)}))})()}),[e]),In.jsx(n,{i18n:le,children:t})}Dt.extend(Rp),Dt.extend(_p),Dt.extend(Bp);const Np=new et({defaultOptions:{queries:{structuralSharing:!1}}});var Fp,Up={exports:{}},qp={exports:{}},Vp={};var Wp,Hp,Zp,zp,$p,Gp,Yp,Qp,Xp,Kp,Jp,eh,th,nh,ih={};
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 oh(){return Hp||(Hp=1,"production"===process.env.NODE_ENV?qp.exports=function(){if(Fp)return Vp;Fp=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,g=e?Symbol.for("react.block"):60121,f=e?Symbol.for("react.fundamental"):60117,x=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 Vp.AsyncMode=l,Vp.ConcurrentMode=d,Vp.ContextConsumer=s,Vp.ContextProvider=a,Vp.Element=t,Vp.ForwardRef=c,Vp.Fragment=i,Vp.Lazy=m,Vp.Memo=h,Vp.Portal=n,Vp.Profiler=r,Vp.StrictMode=o,Vp.Suspense=u,Vp.isAsyncMode=function(e){return b(e)||v(e)===l},Vp.isConcurrentMode=b,Vp.isContextConsumer=function(e){return v(e)===s},Vp.isContextProvider=function(e){return v(e)===a},Vp.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Vp.isForwardRef=function(e){return v(e)===c},Vp.isFragment=function(e){return v(e)===i},Vp.isLazy=function(e){return v(e)===m},Vp.isMemo=function(e){return v(e)===h},Vp.isPortal=function(e){return v(e)===n},Vp.isProfiler=function(e){return v(e)===r},Vp.isStrictMode=function(e){return v(e)===o},Vp.isSuspense=function(e){return v(e)===u},Vp.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===f||e.$$typeof===x||e.$$typeof===y||e.$$typeof===g)},Vp.typeOf=v,Vp}():qp.exports=(Wp||(Wp=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,g=e?Symbol.for("react.block"):60121,f=e?Symbol.for("react.fundamental"):60117,x=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 g=e.type;switch(g){case l:case d:case i:case r:case o:case u:return g;default:var f=g&&g.$$typeof;switch(f){case s:case c:case m:case h:case a:return f;default:return p}}case n:return p}}}var b=l,j=d,C=s,w=a,k=t,T=c,E=i,A=m,I=h,S=n,L=r,O=o,R=u,M=!1;function _(e){return v(e)===d}ih.AsyncMode=b,ih.ConcurrentMode=j,ih.ContextConsumer=C,ih.ContextProvider=w,ih.Element=k,ih.ForwardRef=T,ih.Fragment=E,ih.Lazy=A,ih.Memo=I,ih.Portal=S,ih.Profiler=L,ih.StrictMode=O,ih.Suspense=R,ih.isAsyncMode=function(e){return M||(M=!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.")),_(e)||v(e)===l},ih.isConcurrentMode=_,ih.isContextConsumer=function(e){return v(e)===s},ih.isContextProvider=function(e){return v(e)===a},ih.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ih.isForwardRef=function(e){return v(e)===c},ih.isFragment=function(e){return v(e)===i},ih.isLazy=function(e){return v(e)===m},ih.isMemo=function(e){return v(e)===h},ih.isPortal=function(e){return v(e)===n},ih.isProfiler=function(e){return v(e)===r},ih.isStrictMode=function(e){return v(e)===o},ih.isSuspense=function(e){return v(e)===u},ih.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===f||e.$$typeof===x||e.$$typeof===y||e.$$typeof===g)},ih.typeOf=v}()),ih)),qp.exports}
27
+ /*
28
+ object-assign
29
+ (c) Sindre Sorhus
30
+ @license MIT
31
+ */function rh(){if(zp)return Zp;zp=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return Zp=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},Zp}function ah(){if(Gp)return $p;Gp=1;return $p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function sh(){return Qp?Yp:(Qp=1,Yp=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var lh=oh();Up.exports=function(){if(eh)return Jp;eh=1;var e=oh(),t=rh(),n=ah(),i=sh(),o=function(){if(Kp)return Xp;Kp=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=ah(),n={},i=sh();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={})},Xp=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){}}),Jp=function(s,l){var d="function"==typeof Symbol&&Symbol.iterator,c="@@iterator",u="<<anonymous>>",p={array:f("array"),bigint:f("bigint"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:g(a),arrayOf:function(e){return g((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:g((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:g((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 g((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:g((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 g((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)?g((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 "+j(o)+" at index "+t+"."),a}return g((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 g((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 x(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 g((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 x(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 g=h(d,p,a,s,l+"."+p,n);if(g)return g}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 g(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 g=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 g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var f=d+":"+s;!t[f]&&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[f]=!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 f(e){return g((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 x(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 j(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},Jp}()(lh.isElement,!0)}else Up.exports=function(){if(nh)return th;nh=1;var e=ah();function t(){}function n(){}return n.resetWarningCache=t,th=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 dh=Cn(Up.exports);function ch(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}function uh(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 ph=ch(dh.element,uh);ph.isRequired=ch(dh.element.isRequired,uh);const hh="exact-prop: ​";function mh(e){return e&&e.ownerDocument||document}const gh="undefined"!=typeof window?W.useLayoutEffect:W.useEffect;function fh(e){const t=W.useRef(e);return gh((()=>{t.current=e})),W.useRef(((...e)=>(0,t.current)(...e))).current}function xh(...e){return W.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 yh={};const vh=[];class bh{static create(){return new bh}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 jh(){const e=function(e,t){const n=W.useRef(yh);return n.current===yh&&(n.current=e(t)),n}(bh.create).current;var t;return t=e.disposeEffect,W.useEffect(t,vh),e}const Ch={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 wh(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=wh(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function kh(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wh(e))&&(i&&(i+=" "),i+=t);return i}function Th(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 Eh(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 Ah(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=kh(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=Th({...o,...i}),s=Eh(i),l=Eh(o),d=t(a),c=kh(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:xh(l,a?.ref,e.additionalProps?.ref)},i);return d}function Ih(e){return e.substring(2).toLowerCase()}function Sh(e){const{children:t,disableReactTree:n=!1,mouseEvent:i="onClick",onClickAway:o,touchEvent:r="onTouchEnd"}=e,a=W.useRef(!1),s=W.useRef(null),l=W.useRef(!1),d=W.useRef(!1);W.useEffect((()=>(setTimeout((()=>{l.current=!0}),0),()=>{l.current=!1})),[]);const c=xh((u=t)&&W.isValidElement(u)?u.props.propertyIsEnumerable("ref")?u.props.ref:u.ref:null,s);var u;const p=fh((e=>{const t=d.current;d.current=!1;const i=mh(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)),W.useEffect((()=>{if(!1!==r){const e=Ih(r),t=mh(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)),W.useEffect((()=>{if(!1!==i){const e=Ih(i),t=mh(s.current);return t.addEventListener(e,p),()=>{t.removeEventListener(e,p)}}}),[p,i]),In.jsx(W.Fragment,{children:W.cloneElement(t,m)})}"production"!==process.env.NODE_ENV&&(Sh.propTypes={children:ph.isRequired,disableReactTree:dh.bool,mouseEvent:dh.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:dh.func.isRequired,touchEvent:dh.oneOf(["onTouchEnd","onTouchStart",!1])}),"production"!==process.env.NODE_ENV&&(Sh.propTypes=function(e){return"production"===process.env.NODE_ENV?e:{...e,[hh]: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}}}(Sh.propTypes));const Lh="base";function Oh(e,t){const n=Ch[t];return n?`${Lh}--${n}`:function(e,t){return`${Lh}-${e}-${t}`}(e,t)}const Rh="Snackbar";function Mh(e){return Oh(Rh,e)}!function(e,t){const n={};t.forEach((t=>{n[t]=Oh(e,t)}))}(Rh,["root"]);const _h={disableDefaultClasses:!1},Ph=W.createContext(_h);"production"!==process.env.NODE_ENV&&(Ph.displayName="ClassNameConfiguratorContext");const Bh=()=>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}=W.useContext(Ph);return n=>t?"":e(n)}(Mh)),Dh=W.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={},...g}=e,f=Bh(),{getRootProps:x,onClickAway:y}=function(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:i,open:o,resumeHideDuration:r}=e,a=jh();W.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=fh(((e,t)=>{i?.(e,t)})),l=fh((e=>{i&&null!=e&&a.start(e,(()=>{s(null,"timeout")}))}));W.useEffect((()=>(o&&l(t),a.clear)),[o,t,l,a]);const d=a.clear,c=W.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 W.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={...Th(e),...Th(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",j=Ah({elementType:b,getSlotProps:x,externalForwardedProps:g,externalSlotProps:h.root,additionalProps:{ref:t},ownerState:v,className:f.root}),C=Ah({elementType:Sh,externalSlotProps:h.clickAwayListener,additionalProps:{onClickAway:y},ownerState:v});return delete C.ownerState,!u&&r?null:In.jsx(Sh,{...C,children:In.jsx(b,{...j,children:i})})}));function Nh({size:e,color:t,time:n,strokeWidth:o=2,sx:r}){const[a,s]=$("0 1069"),l=e/2,d=l-1;return Y((()=>{s(2*Math.PI*d+" 0")}),[]),In.jsx(i,{width:e,height:e,component:"svg",sx:Object.assign({position:"absolute",top:`-${o}`,left:`-${o}`,transform:"rotate(-90deg)"},r),children:In.jsx(i,{component:"circle",cx:l,cy:l,r:d,strokeWidth:o,stroke:t,fill:"none",strokeDasharray:a,sx:{transition:`stroke-dasharray ${n}`}})})}"production"!==process.env.NODE_ENV&&(Dh.propTypes={autoHideDuration:dh.number,children:dh.node,disableWindowBlurListener:dh.bool,exited:dh.bool,onClose:dh.func,open:dh.bool,resumeHideDuration:dh.number,slotProps:dh.shape({clickAwayListener:dh.oneOfType([dh.func,dh.shape({children:dh.element.isRequired,disableReactTree:dh.bool,mouseEvent:dh.oneOf(["onClick","onMouseDown","onMouseUp","onPointerDown","onPointerUp",!1]),onClickAway:dh.func,touchEvent:dh.oneOf(["onTouchEnd","onTouchStart",!1])})]),root:dh.oneOfType([dh.func,dh.object])}),slots:dh.shape({root:dh.elementType})});var Fh=H.memo(Nh);const Uh=it((e=>({notify:null,toast:t=>{e({notify:t})},close:()=>{e({notify:null})}}))),qh={entering:"translateX(0)",entered:"translateX(0)",exiting:"translateX(500px)",exited:"translateX(500px)",unmounted:"translateX(500px)"};function Vh(){const e=a(),{notify:t,close:n}=Uh(),[o,r]=H.useState(!0),s=H.useRef(null),l=null==t?void 0:t.timeout,d=!!t;let c=In.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[In.jsx("circle",{cx:"18",cy:"18",r:"16.5",stroke:"#2FBA90",strokeWidth:"3"}),In.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==t?void 0:t.type){case"error":c=In.jsxs("svg",{width:"36",height:"37",viewBox:"0 0 36 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[In.jsx("circle",{cx:"18",cy:"18.5",r:"16.5",stroke:"#FF6187",strokeWidth:"3"}),In.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=In.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[In.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"}),In.jsx("path",{d:"M15.1664 7.58398H12.8331V16.9173H15.1664V7.58398Z",fill:"#B15600"}),In.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 In.jsx(i,{component:Dh,open:d,autoHideDuration:l,onClose:(e,t)=>{"clickaway"!==t&&n()},exited:o,sx:{position:"fixed",top:20,left:20,right:20,zIndex:1,[e.breakpoints.up("tablet")]:{left:"auto"}},children:In.jsx(Ft,{timeout:{enter:400,exit:400},in:d,appear:!0,unmountOnExit:!0,onEnter:()=>{r(!1)},onExited:()=>{r(!0)},nodeRef:s,children:o=>In.jsxs(i,{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:qh[o],transition:"transform 300ms ease",[e.breakpoints.up("tablet")]:{p:20,width:"auto",maxWidth:328}},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(i,{sx:{mt:7,"& > svg":{width:28,height:28},[e.breakpoints.up("tablet")]:{"& > svg":{width:36,height:36}}},children:t?c:""}),In.jsxs(i,{sx:{ml:20},children:[In.jsx(i,{sx:{typography:"caption"},children:null==t?void 0:t.message}),(null==t?void 0:t.link)?In.jsxs(i,{component:"a",target:"_blank",rel:"noopener noreferrer",href:t.link.outerLink,sx:{display:"inline-flex",alignItems:"center",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},children:[t.link.text,In.jsx(i,{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:In.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==t?void 0:t.content)?In.jsx(i,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:t.content}):""]})]}),In.jsxs(i,{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:n,children:[l?In.jsx(Fh,{size:24,strokeWidth:"2.4px",time:`${l}ms`,color:e.palette.text.disabled}):"",In.jsx(i,{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:In.jsx("g",{children:In.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 Wh;function Hh(){return Hh=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},Hh.apply(null,arguments)}const Zh=e=>W.createElement("svg",Hh({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Wh||(Wh=W.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},W.createElement("g",{transform:"translate(18.000000, 291.000000)"},W.createElement("g",{transform:"translate(40.000000, 83.000000)"},W.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"}))))))),zh=6;function $h(){var e;const t=a();return In.jsx(i,{sx:{mx:"auto",border:`${zh}px solid ${null===(e=t.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:In.jsx(i,{component:Zh,sx:{position:"absolute",top:`-${zh}px`,right:`-${zh}px`,color:"primary.main"}})})}function Gh({showingDone:e,errorMessage:t}){return a(),t?In.jsx(i,{component:Un.ErrorWarn,sx:{width:64,height:64,color:"error.main"}}):e?In.jsx(i,{component:Un.DoneBorder,sx:{width:64,height:64,color:"success.main"}}):In.jsx($h,{})}function Yh({showingDone:e,showing:t}){return In.jsxs(i,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[In.jsx(i,{sx:{mt:60},children:e?le._({id:"4xbbt/",message:"{0} confirmed",values:{0:null==t?void 0:t.brief}}):le._({id:"/nzjSF",message:"{0} pending",values:{0:null==t?void 0:t.brief}})}),(null==t?void 0:t.subtitle)?In.jsx(i,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function Qh({isStarted:t,isEnded:n,tx:o}){const[a,s]=$(0),{chainId:l}=hd(),d=Z((()=>`https://${ua[l||1]}/tx/${o}`),[o,l]),c=Z((()=>{const e=Math.floor(a/60),t=a%60;return e?`${e}m ${t}s`:`${t}s`}),[a]),u=G();return Y((()=>(t&&(s(0),window.clearInterval(u.current),u.current=window.setInterval((()=>{s((e=>e+1))}),1e3)),()=>{window.clearInterval(u.current)})),[t]),Y((()=>{n&&window.clearInterval(u.current)}),[n]),In.jsxs(i,{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:[In.jsxs(i,{children:[In.jsx(e,{id:"+Jkdiu",message:"Transaction Time:"}),c]}),In.jsxs(r,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:d,target:"_blank",rel:"noopener noreferrer",children:[In.jsx(e,{id:"S3piC2",message:"Tx"}),In.jsx(i,{component:Un.ArrowTopRightBorder,sx:{width:16,height:16,ml:6}})]})]})}function Xh(t){var{children:n,executionStatus:o,showSubmitLoadingDialog:r}=t;const a=Fd(vn(t,["children","executionStatus","showSubmitLoadingDialog"])),{ctxVal:s,showing:l,closeShowing:d,setShowing:u,showingDone:p,errorMessage:h,transactionTx:m}=Object.assign(Object.assign({},a),o),{isMobile:g}=Sd(),{noSubmissionDialog:f,submissionDialogModal:x}=On(),y=()=>{u((e=>{if(!e)return e;const t=Object.assign({},e);return delete t.submitState,t}))};return In.jsxs(Vd.Provider,{value:s,children:[n,r&&In.jsx(Rc,{modal:!0,open:!!(null==l?void 0:l.submitState),onClose:y,children:!!l&&In.jsxs(i,{sx:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:20,p:20,minHeight:208,width:g?"100%":340,textAlign:"center"},children:[In.jsxs(i,{sx:{textAlign:"center",color:"text.secondary"},children:[l.brief,In.jsx(i,{component:Un.Error,sx:{position:"absolute",top:20,right:20,color:"text.secondary",cursor:"pointer"},onClick:y})]}),"submitted"===l.submitState?In.jsxs(In.Fragment,{children:[In.jsx(i,{component:Un.ArrowSubmit,sx:{width:64,height:64}}),In.jsxs("div",{children:[In.jsx("div",{children:le._({id:"EcVqOR",message:"{0} Submitted",values:{0:l.brief}})}),l.subtitle&&In.jsx(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:l.subtitle})]}),In.jsx(c,{variant:c.Variant.outlined,fullWidth:!0,onClick:y,sx:{mt:4},children:In.jsx(e,{id:"zga9sT",message:"OK"})})]}):In.jsxs(In.Fragment,{children:[In.jsx($h,{}),In.jsxs("div",{children:[In.jsx(i,{children:In.jsx(e,{id:"7y/8M6",message:"Please confirm in wallet"})}),l.subtitle&&In.jsx(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:8,color:"text.secondary",typography:"body2"},children:l.subtitle})]})]})]})}),In.jsx(Rc,{open:!!l&&"loading"!==l.submitState&&!f,onClose:d,id:"submission",modal:!!g||x,children:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto",width:g?void 0:x?340:void 0},children:[In.jsxs(i,{children:[In.jsx(i,{sx:{textAlign:"center",pt:60},children:In.jsx(Gh,{showingDone:p,errorMessage:h})}),h?In.jsxs(i,{sx:{textAlign:"center",mt:60},children:[In.jsx(i,{children:In.jsx(e,{id:"kf83Ld",message:"Something went wrong."})}),In.jsx(i,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:h})]}):In.jsxs(In.Fragment,{children:[In.jsx(Yh,{showingDone:p,showing:l}),In.jsx(Qh,{isStarted:!!l,isEnded:p,tx:m})]})]}),In.jsx(c,{fullWidth:!0,size:c.Size.big,onClick:()=>{Cd(bd.Initial),d()},sx:{mt:20},children:h?In.jsx(e,{id:"1QfxQT",message:"Dismiss"}):In.jsx(e,{id:"yz7wBu",message:"Close"})})]})})]})}const Kh="dodo-widget-container";function Jh(e){return e.noLangProvider?In.jsx(In.Fragment,{children:e.children}):In.jsx(Dp,{locale:e.locale,children:In.jsx(Xh,{...e,children:e.children})})}function em(e){return _c(e),Ad(),function(){const{chainId:e,evmProvider:t}=hd();H.useEffect((()=>{const n=n=>{if(n===e){const e=us.get(n);if(null==e?void 0:e.isEVMChain)return t}return null},i=new Nt({multiCallAddressList:at,getProvider:n,rpc:ca()});Ta.setGetConfigProvider(n),st(i),Ce(i)}),[e,t])}(),e.noUI?In.jsx(Jh,{...e,children:e.children}):null}function tm(e){var t;const n=G(null);return In.jsx(Ln,{...Object.assign(Object.assign({},e),{widgetRef:null!==(t=e.widgetRef)&&void 0!==t?t:n}),children:In.jsx(em,{...e})})}function nm(e){const t=u({mode:e.colorMode,theme:e.theme,lang:e.locale||Ap});return e.apikey||e.apiServices||console.error("apikey and apiServices must have a."),In.jsxs(p,{theme:t,children:[In.jsx(h,{container:`.${Kh}, .${m}, .${g}`}),In.jsx(tt,{client:Np,children:In.jsxs(tm,{...e,children:[e.children,In.jsx(Vh,{})]})})]})}function im(e){var{sx:t}=e,n=vn(e,["sx"]);const{width:i}=On(),o=Z((()=>{let e="";return"number"==typeof i?e=`${i}px`:i&&(e=i),e?`calc(${e} - 40px)`:"auto"}),[i]);return In.jsx(f,{container:document.querySelector(`.${Kh}`),maxWidth:o,sx:Object.assign({cursor:"help"},t),...n})}function om({route:t}){const n=a();us.get(t.fromChainId);const o=us.get(t.toChainId),[s,l]=$(!1),[c,u]=$(!1),p=uc({fees:t.fees});return In.jsxs(i,{children:[In.jsx(i,{sx:{py:20,borderStyle:"solid",borderWidth:n.spacing(1,0,0),borderColor:n.palette.border.main},children:In.jsx(x,{children:In.jsx(y,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:"text.primary"},children:[In.jsx(i,{component:Un.DetailBorder,sx:{mr:6,width:18,height:18}}),In.jsx(e,{id:"rRDi3Y",message:"Detail"})]}),In.jsx(i,{component:Un.CaretUp,sx:{width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]}),children:In.jsxs(i,{sx:{mt:16},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsx(i,{sx:{typography:"body2",color:"text.secondary",flexShrink:0},children:In.jsx(e,{id:"lt8yMa",message:"Send to:"})}),In.jsxs(i,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[o?In.jsx(i,{component:o.logo,sx:{width:18,height:18}}):null,In.jsx(i,{sx:{display:"inline-block",mx:6,width:"1px",height:12,backgroundColor:"border.main"}}),In.jsx(i,{sx:{typography:"body2",fontWeight:600},children:rd(t.toAddress)}),In.jsx(r,{component:"a",href:ad(t.toChainId,t.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:In.jsx(i,{component:Un.ArrowTopRightBorder,sx:{width:18,height:18}})})]})]}),In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:In.jsx(e,{id:"sMMlTX",message:"Total fees"})}),In.jsxs(i,{component:d,onClick:()=>l(!s),sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4,typography:"body2",color:"text.primary"},children:[In.jsx(i,{sx:{fontWeight:600,color:n.palette.text.primary},children:t.feeUSD?`~$${t.feeUSD}`:"-"}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:s?In.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"}):In.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"})})]})]}),s&&p.map((e=>In.jsxs(i,{sx:{mt:8,pl:22,pr:22,display:"flex",alignItems:"center",justifyContent:"space-between",color:"text.secondary",typography:"body2",position:"relative"},children:[In.jsx(i,{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:In.jsx("path",{d:"M9 24L2 24C1.44772 24 1 23.5523 1 23L1 1",stroke:"currentColor",strokeOpacity:"0.5",strokeLinecap:"round",strokeDasharray:"2 2"})}),In.jsx(i,{sx:{flex:1},children:e.title}),e.isFree?In.jsx(i,{sx:{color:n.palette.primary.main},children:"Free"}):null!==e.value?In.jsxs(i,{sx:{color:n.palette.text.primary},children:["~$",e.value]}):In.jsx(i,{sx:{color:n.palette.text.primary},children:"-"})]},e.title))),In.jsxs(i,{sx:{mt:8,mb:c?8:0,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"body2",fontWeight:600,color:"success.main",flexShrink:0},children:"Fee comparison"}),In.jsxs(i,{component:d,onClick:()=>u(!c),sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4,typography:"body2",color:"text.primary"},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600,color:n.palette.text.primary},children:"ZUNO"}),In.jsx(i,{sx:{px:8,borderRadius:12,backgroundColor:n.palette.success.main,typography:"h6",fontWeight:600,color:n.palette.success.contrastText,textTransform:"uppercase"},children:"Cheapest"}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:c?In.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"}):In.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"})})]})]}),c&&In.jsx(Ic,{feeUSD:t.feeUSD}),In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",typography:"body2",color:"text.secondary",flexShrink:0},children:[In.jsx(e,{id:"CMHmbm",message:"Slippage"}),In.jsx(im,{onlyHover:!0,title:In.jsx(e,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:6})]}),In.jsxs(i,{sx:{typography:"body2"},children:[100*t.slippage,"%"]})]})]})})})}),In.jsx(i,{sx:{pt:0,pb:0,borderStyle:"solid",borderWidth:n.spacing(1,0,0),borderColor:n.palette.border.main},children:In.jsx(x,{children:In.jsx(y,{initialEntered:!0,sx:{"& button.active svg":{transform:"rotate(0)"}},header:In.jsxs(i,{sx:{py:20,display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:"text.primary"},children:[In.jsx(i,{component:Un.DetailBorder,sx:{mr:6,width:18,height:18}}),In.jsx(e,{id:"QNWt8A",message:"Estimated Time"})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:"text.primary",typography:"body2"},children:[t.executionDuration?gc({start:Date.now(),end:Date.now()+1e3*t.executionDuration}):"-",In.jsx(i,{component:Un.CaretUp,sx:{ml:6,width:12,height:12,color:"text.secondary",transform:"rotate(180deg)",transition:"transform 0.2s linear"}})]})]}),children:In.jsx(gp,{route:t,isMobile:!0})})})})]})}function rm({open:t,onClose:n,route:o,bridgeOrderTxRequest:r,clearToAmt:s,clearFromAmt:l,isDialogModal:d}){const u=a(),{contractStatus:p}=jd(),h=wp({route:o,bridgeOrderTxRequest:r});return Y((()=>{p!==bd.Pending&&n(),p===bd.TxSuccess&&(s(),l())}),[p]),In.jsx(Rc,{title:In.jsx(e,{id:"tKE4Ak",message:"Cross Chain Summary"}),open:t,id:"cross-chain-summary",onClose:()=>{Cd(bd.Initial),n()},modal:d,children:In.jsxs(In.Fragment,{children:[o?In.jsxs(i,{sx:{px:16,pb:20,flex:1,overflowY:"auto"},children:[In.jsxs(i,{sx:{display:"grid",gridTemplateColumns:"36% 28% 36%",py:20,borderStyle:"solid",borderWidth:u.spacing(1,0,0),borderColor:u.palette.border.main},children:[In.jsx(Ep,{token:o.fromToken,chainId:o.fromChainId,amount:o.fromAmount}),In.jsx(Tp,{children:In.jsx(i,{sx:{display:"flex",px:3,py:3,backgroundColor:u.palette.background.paperContrast,border:`1px solid ${u.palette.border.main}`,borderRadius:"50%",alignItems:"center",width:24,height:24,overflow:"hidden"},children:In.jsx(kp,{size:"medium",toolDetails:o.step.toolDetails,nameMarginLeft:8})})}),In.jsx(Ep,{token:o.toToken,chainId:o.toChainId,amount:o.toTokenAmount})]}),In.jsx(om,{route:o})]}):"",In.jsx(i,{sx:{px:16,py:20},children:In.jsx(c,{fullWidth:!0,isLoading:p==bd.Pending,disabled:!o,onClick:()=>{h(),Cd(bd.Pending)},children:p==bd.Pending?In.jsx(e,{id:"P+K/3O",message:"Confirming"}):In.jsx(e,{id:"PZqJog",message:"Confirm Cross Chain"})})})]})})}function am({message:t,onClose:n,isDialogModal:o}){return In.jsx(Rc,{open:!!t,onClose:n,id:"error-message",modal:o,children:In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{flex:1,textAlign:"center"},children:[In.jsx(i,{component:Un.ErrorWarn,sx:{mt:60,width:64,height:64,color:"error.main"}}),t?In.jsxs(i,{sx:{textAlign:"center",mt:60},children:[In.jsx(i,{children:In.jsx(e,{id:"kf83Ld",message:"Something went wrong."})}),In.jsx(i,{sx:{color:"text.secondary",mt:12,mx:20,typography:"body2",wordBreak:"break-all",overflow:"auto",height:"300px"},children:t})]}):""]}),In.jsx(i,{sx:{px:16,py:20},children:In.jsx(c,{onClick:n,fullWidth:!0,children:In.jsx(e,{id:"1QfxQT",message:"Dismiss"})})})]})})}function sm(){const[e,t]=$(!1);return In.jsxs(In.Fragment,{children:[In.jsxs(d,{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:()=>t(!0),children:[In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",children:In.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>"]}),In.jsx(Rc,{open:e,onClose:()=>t(!1),title:"Gas refuel",modal:!0,children:In.jsxs(i,{sx:{maxWidth:540,minHeight:600,px:20,pb:24,display:"flex",flexDirection:"column",alignItems:"center",gap:16},children:[In.jsx(i,{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."}),In.jsx(i,{component:"iframe",src:"https://smolrefuel.com/?partner=0x1271CAba4bf23f8Fb31F97448605d65EE302CA51",width:"100%",sx:{borderRadius:12,overflow:"hidden",flex:1,border:"none"}})]})})]})}function lm({open:t,execute:n,onClose:o,toToken:r,fromToken:s,fromAmount:l,toAmount:u,priceImpact:p,clearFromAmt:h,clearToAmt:m,baseFeeAmount:g,curToFiatPrice:f,curFromFiatPrice:x,pricePerFromToken:y,additionalFeeAmount:b,loading:j,slippage:C,isDialogModal:w}){var k,T;const E=a(),{contractStatus:A}=jd(),I=Z((()=>new Le(p).gt(vs)),[p]),[S,L]=$(!1),[O,R]=$(!1);return Y((()=>{A!==bd.Pending&&o(),A===bd.TxSuccess&&(m(),h())}),[A]),Y((()=>{L(!1)}),[f]),In.jsx(Rc,{open:t,onClose:()=>{Cd(bd.Initial),o()},id:"swap-summary",title:In.jsx(e,{id:"QR4/RH",message:"Swap summary"}),modal:w,children:In.jsxs(i,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${E.palette.border.main}`},children:[In.jsxs(i,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${E.palette.border.main}`},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[In.jsx(Fc,{width:16,height:16,url:null==s?void 0:s.logoURI,address:null!==(k=null==s?void 0:s.address)&&void 0!==k?k:"",marginRight:6}),In.jsx(i,{children:`${Ps({input:l,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),In.jsx(i,{sx:{mt:4,typography:"h6",color:E.palette.text.secondary},children:x?`$${_s({input:x,showDecimals:1})}`:"-"})]}),In.jsx(i,{sx:{width:16,mx:16},component:Un.DoubleRight}),In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex"},children:[In.jsx(Fc,{width:16,height:16,marginRight:6,url:null==r?void 0:r.logoURI,address:null!==(T=null==r?void 0:r.address)&&void 0!==T?T:""}),In.jsx(v,{loading:j,loadingProps:{width:30},children:`${Ps({input:u,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),In.jsx(v,{loading:j,loadingProps:{width:30},sx:{typography:"h6",mt:4,color:E.palette.text.secondary},children:f?`$${_s({input:f,showDecimals:1})}(${p}%)`:"-"})]})]}),In.jsxs(i,{sx:{mt:12,display:"flex",alignItems:"center",typography:"h6"},children:[`1 ${null==s?void 0:s.symbol} = `,In.jsx(v,{loading:j,loadingProps:{width:30},children:Ps({input:new Le(u).dividedBy(new Le(l)),decimals:null==r?void 0:r.decimals})})," ",`${null==r?void 0:r.symbol}`]})]}),In.jsxs(i,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${E.palette.border.main}`},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:E.palette.text.secondary},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(i,{sx:{width:16,mr:7},component:Un.DetailBorder}),In.jsx(e,{id:"XeovX3",message:"Swap Detail"})]}),In.jsx(i,{component:d,children:In.jsx(i,{onClick:()=>R(!O),sx:{width:10,color:"text.secondary",transform:O?"rotateX(0deg)":"rotateX(180deg)"},component:Un.CaretUp})})]}),In.jsxs(i,{sx:{mt:16,display:O?"initial":"none"},children:[In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(e,{id:"93m8jT",message:"Basic Fee"}),In.jsx(im,{title:In.jsx(e,{id:"8Z29ZO",message:"Estimated service provider fees"}),ml:5})]}),In.jsx(v,{loading:j,loadingProps:{width:30},children:g?`${Ps({input:g,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`:"0"})]}),In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(e,{id:"J39pAJ",message:"Additional Fee"}),In.jsx(im,{title:In.jsx(e,{id:"ZXvy7b",message:"Additional routing fees set by the Widget user"}),ml:5})]}),In.jsx(v,{loading:j,loadingProps:{width:30},children:b?`${Ps({input:b,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`:"0"})]}),In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(e,{id:"T+qgFw",message:"Price Impact"}),In.jsx(im,{title:In.jsx(e,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),In.jsx(i,{children:`${p}%`})]}),In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(e,{id:"CMHmbm",message:"Slippage"}),In.jsx(im,{title:In.jsx(e,{id:"GAypnX",message:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),In.jsxs(i,{children:[C,"%"]})]})]})]}),In.jsx(i,{sx:{flex:1}}),I&&In.jsxs(i,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>L(!S),children:[In.jsx(i,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:S?In.jsx(i,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:In.jsx(i,{component:Un.Done,sx:{width:14,color:"secondary.contrastText"}})}):In.jsx(i,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${E.palette.text.secondary}`}})}),In.jsx(i,{children:In.jsx(e,{components:{0:In.jsx(i,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:p},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),In.jsx(c,{isLoading:A==bd.Pending,disabled:I&&!S,fullWidth:!0,onClick:()=>{n(),Cd(bd.Pending)},children:A==bd.Pending?In.jsx(e,{id:"P+K/3O",message:"Confirming"}):In.jsx(e,{id:"lQ6r7x",message:"Confirm swap"})})]})})}function dm(e){var{sx:t,maxVal:n,decimals:i=2,onInputChange:o}=e,r=vn(e,["sx","maxVal","decimals","onInputChange"]);return In.jsx(b,{...r,onChange:e=>{const t=0===e.target.value.length?null:Ns(e.target.value,i),r=n&&t&&new Oe(t).gt(n)?n.toString():t;o&&o(r)}})}function cm({open:t,onClose:n,isBridge:o,isDialogModal:r}){const s=a(),{slippage:l}=jd(),d=Z((()=>Number(l)>=js),[l]),{defaultSlippage:c}=ec(o);return In.jsx(Rc,{open:t,onClose:n,id:"swap-settings",title:In.jsx(e,{id:"Tz0i8g",message:"Settings"}),modal:r,children:In.jsx(i,{sx:{mx:20},children:In.jsxs(i,{sx:{py:20,borderTop:`1px solid ${s.palette.border.main}`},children:[In.jsxs(i,{sx:{mb:16,display:"flex",alignItems:"center"},children:[In.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"}),In.jsx(im,{title:In.jsx(e,{id:"KAmxpM",message:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column"},children:[In.jsx(dm,{fullWidth:!0,maxVal:100,value:null!=l?l:"",placeholder:c.toString(),onInputChange:e=>{!function(e,t){null===t?localStorage.removeItem(e?xs:fs):localStorage.setItem(e?xs:fs,String(t))}(!!o,e),kd(e)},suffix:In.jsx(i,{sx:{color:"text.disabled"},children:"%"}),height:36,sx:{mt:12}}),d&&In.jsx(i,{sx:{typography:"h6",mt:6,color:"error.main"},children:In.jsx(e,{id:"Zm56FI",message:"Maximum slippage do not exceed 50%"})})]})]})})})}const um="position-y-dot";function pm(){return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[In.jsx(j,{width:"100%",height:12}),In.jsx(j,{width:"100%",height:12})]})}function hm({data:e,loading:t}){var n,o;const r=a(),s=r.palette.primary.main,l=H.useRef(null),d=e.length;return In.jsx(i,{sx:{height:105,flex:1,[`& .${um}`]:{}},ref:l,children:t?In.jsx(pm,{}):In.jsx(i,{component:Ut,sx:{typography:"h6","& .recharts-cartesian-axis text":{fill:r.palette.background.paperContrast}},children:In.jsxs(qt,{data:e,margin:{top:0,right:0,left:0,bottom:0},children:[In.jsx(Vt,{dataKey:"forecastSlippage",axisLine:!1,tickLine:!1,interval:"preserveStartEnd",tickFormatter:e=>Gs({input:e}),type:"number",domain:[d&&null!==(n=e[0].forecastSlippage)&&void 0!==n?n:0,d&&null!==(o=e[d-1].forecastSlippage)&&void 0!==o?o:"auto"]}),In.jsx(Wt,{dataKey:"confidenceRatio",axisLine:!1,tickLine:!1,hide:!0}),In.jsx("defs",{children:In.jsxs("linearGradient",{id:"count-linear",x1:"0",y1:"0",x2:"0",y2:"1",children:[In.jsx("stop",{offset:"0",stopColor:s,stopOpacity:.3}),In.jsx("stop",{offset:"100%",stopColor:s,stopOpacity:0})]})}),In.jsx(Ht,{type:"monotone",dataKey:"confidenceRatio",stroke:s,strokeWidth:2,fill:"url(#count-linear)"}),e.map((e=>In.jsx(Zt,{x:e.forecastSlippage,y:e.confidenceRatio,r:1,fill:r.palette.text.primary,stroke:"none",className:um},e.confidenceRatio)))]})})})}var mm=H.memo(hm);const gm=C(w)((({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 fm(t){var{hidden:n,sx:o,value:r,color:a,min:s,max:l,formatValue:d,getSliderYPosition:c}=t,u=vn(t,["hidden","sx","value","color","min","max","formatValue","getSliderYPosition"]);const{children:p}=u,h=vn(u,["children"]),{isMobile:m}=k(),g=H.useRef(null),f=c(r),x=m?4:0,y=f?f-39-x:void 0,v=null!=a?a:"text.primary",b=r===s,j=r===l;return In.jsxs(i,{...h,ref:g,sx:Object.assign({position:"absolute","&&&":{display:n?"none":"block",backgroundColor:"transparent",boxShadow:"none",bottom:8+x,width:"auto",height:"auto",top:"auto",marginLeft:0,transform:"none"}},o),children:[p,In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[y?In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:v,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),In.jsx(i,{sx:{height:y,width:"0",borderStyle:"dashed",borderWidth:1,borderColor:v}})]}):"",In.jsx(i,{sx:{width:16,height:16,borderRadius:"50%",backgroundColor:v,borderStyle:"solid",borderWidth:2,borderColor:"background.paperContrast",flexShrink:1}}),In.jsxs(i,{sx:Object.assign(Object.assign({typography:"h6",position:"absolute",bottom:-20,color:v,whiteSpace:"nowrap",backgroundColor:"background.paperContrast"},b?{left:0}:{}),j?{right:0}:{}),children:[j?In.jsxs(In.Fragment,{children:[In.jsx(i,{component:"span",sx:{color:"success.main"},children:In.jsx(e,{id:"cOvZFM",message:"Dynamic"})}),In.jsx("span",{children:" • "})]}):"",d(r)]})]})]})}function xm(e){var{hoverValue:t,formatValue:n,getSliderYPosition:i}=e,o=vn(e,["hoverValue","formatValue","getSliderYPosition"]);const{isMobile:r}=k(),a=r?"primary.main":void 0,s=r?void 0:"primary.main";return In.jsx(gm,{slots:{thumb:e=>{const l=o.value&&"number"==typeof o.value&&(o.min&&o.value<o.min||o.max&&o.value>o.max),d={value:o.value,min:o.min,max:o.max,hidden:!!l,color:a,formatValue:n,getSliderYPosition:i},c=Object.assign(Object.assign({},e),d);if(null!==t&&o.max&&o.min&&o.value!==t){const e=o.max-o.min,n=t-o.min,i=n?n/e*100:0;if(r){const e=!!t&&(!!o.min&&t<o.min||!!o.max&&t>o.max);return In.jsxs(In.Fragment,{children:[In.jsx(fm,{...d,value:t,color:s,hidden:e,sx:{left:i+"%"}}),In.jsx(fm,{...c})]})}return In.jsxs(In.Fragment,{children:[In.jsx(fm,{...c}),In.jsx(fm,{...d,value:t,hidden:!1,color:s,sx:{left:i+"%"}})]})}return In.jsx(fm,{...c})}},...o})}const ym=(e,{time:t=100,wrapper:n=document,retryCount:i=50}={})=>new Promise((o=>{n.querySelector(e)?o(!0):setTimeout((()=>bn(void 0,void 0,void 0,(function*(){if(n.querySelector(e))o(!0);else if(i){const r=yield ym(e,{time:t,wrapper:n,retryCount:i-1});o(r)}else o(!1)}))),t)}));function vm({data:t,activeSlippage:n,loading:o,sx:r,handleChangeCustomSlippage:a}){const s=H.useMemo((()=>{var e;return null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0}),[t]),{isMobile:l}=k(),[d,c]=H.useState([]),u=H.useRef(null);H.useEffect((()=>{(()=>{bn(this,void 0,void 0,(function*(){var e;if(u.current&&s){const t=`.${um}`;yield ym(t,{wrapper:u.current});const n=u.current.querySelectorAll(t),{y:i,height:o}=u.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)}c(a)}}))})()}),[s]);const p=(({activeSlippage:e,data:t,yPositions:n})=>{const[i,o]=H.useState(0),r=H.useMemo((()=>1e6),[]),[a,s]=H.useMemo((()=>{var e,n;const i=null==t?void 0:t.length;return i?[new Le(null!==(e=t[0].forecastSlippage)&&void 0!==e?e:0).times(null!=r?r:0).dp(0,1).toNumber(),new Le(null!==(n=t[i-1].forecastSlippage)&&void 0!==n?n:0).times(null!=r?r:0).dp(0,1).toNumber()]:[0,0]}),[t,r]),l=H.useCallback((e=>{if(void 0===e)return"";const n=new Le(e);if((null==t?void 0:t.length)&&r){const e=t.find((e=>{var t;return new Le(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(r).dp(0,1).isEqualTo(n)}));if(null==e?void 0:e.forecastSlippage)return Gs({input:e.forecastSlippage,showDecimals:4})}return Gs({input:r?n.div(r):n,showDecimals:4})}),[r,t]),d=H.useCallback((e=>{let i=0;return e&&(null==t?void 0:t.length)&&r?(t.some(((o,a)=>{var s,l;const d=null!==(s=o.forecastSlippage)&&void 0!==s?s:0,c=new Le(d).times(r).dp(0,1).toNumber();if(e===c)return i=n[a],!0;if(e<c){if(0===a)return i=0,!0;const o=d-(null!==(l=t[a-1].forecastSlippage)&&void 0!==l?l:0),s=n[a]-n[a-1],c=d-new Le(e).div(r).toNumber();return i=n[a]-s/o*c,!0}})),i):i}),[n,t,r]),c=H.useCallback((e=>{o(e);const n=new Le(e);let i,a=-1;if((null==t?void 0:t.length)&&r){a=t.findIndex((e=>{var t;return new Le(null!==(t=e.forecastSlippage)&&void 0!==t?t:0).times(r).dp(0,1).isEqualTo(n)}));const e=-1!==a?t[a]:void 0;i=null==e?void 0:e.forecastSlippage}return i||(i=n.div(null!=r?r:0).toNumber()),i}),[t,r]);return H.useEffect((()=>{if(r&&e){const t=new Le(e).times(r).dp(0,1);t.isEqualTo(i)||o(t.toNumber())}}),[e]),{min:a,max:s,value:i,decimalConversion:r,formatValue:l,getSliderYPosition:d,handleChangeValue:c}})({data:t,activeSlippage:n,yPositions:d}),{hoverValue:h,setHoverValue:m}=function(e,{slippageSlider:t}){const{isMobile:n}=k(),[i,o]=H.useState(null),r=H.useRef(!1);return H.useEffect((()=>{if(e.current&&t.max){const a=e.current;let{width:s,x:l}=a.getBoundingClientRect();const d=e=>{if(r.current)return;const n=e.pageX-l,a=t.max-t.min,d=new Le(n/s*a).integerValue().plus(t.min).toNumber();d!==i&&o(d)},c=()=>{o(null)},u=()=>{r.current=!1},p=()=>{r.current=!0};return n||(a.addEventListener("mousemove",d),a.addEventListener("mouseleave",c),a.addEventListener("mouseup",u),a.addEventListener("mousedown",p)),()=>{n&&(a.removeEventListener("mousemove",d),a.removeEventListener("mouseleave",c),a.removeEventListener("mouseUp",u),a.removeEventListener("mouseDown",p))}}}),[e,n]),{hoverValue:i,setHoverValue:o}}(u,{slippageSlider:p}),{successRate:g,hoverSuccessRate:f}=function({data:e,activeSlippage:t,hoverValue:n,decimalConversion:i}){const o=H.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=Gs({input:null!==(a=null==n?void 0:n.confidenceRatio)&&void 0!==a?a:0}),!0;if(t<u){if(0===i)o=`< ${Gs({input:null!==(s=null==n?void 0:n.confidenceRatio)&&void 0!==s?s:0})}`;else{const t=Gs({input:null!==(d=null===(l=e[i-1])||void 0===l?void 0:l.confidenceRatio)&&void 0!==d?d:0}),r=Gs({input:null!==(c=null==n?void 0:n.confidenceRatio)&&void 0!==c?c:0});o=`${t} - ${r}`}return!0}return!1}));r||(o=`> ${Gs({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]),r=H.useMemo((()=>{var t,o;let r="";if(n&&(null==e?void 0:e.length)&&i){const a=e.some(((t,o)=>{var a,s,l,d,c,u;const p=null!==(a=t.forecastSlippage)&&void 0!==a?a:0,h=new Le(p).times(i).dp(0,1).toNumber();if(n===h)return r=Gs({input:null!==(s=null==t?void 0:t.confidenceRatio)&&void 0!==s?s:0}),!0;if(n<h){if(0===o)r=`< ${Gs({input:null!==(l=null==t?void 0:t.confidenceRatio)&&void 0!==l?l:0})}`;else{const n=Gs({input:null!==(c=null===(d=e[o-1])||void 0===d?void 0:d.confidenceRatio)&&void 0!==c?c:0}),i=Gs({input:null!==(u=null==t?void 0:t.confidenceRatio)&&void 0!==u?u:0});r=`${n} - ${i}`}return!0}return!1}));a||(r=`> ${Gs({input:null!==(o=null===(t=e[e.length-1])||void 0===t?void 0:t.confidenceRatio)&&void 0!==o?o:0})}`)}return r}),[n,i,e]);return{successRate:o,hoverSuccessRate:r}}({data:t,activeSlippage:n,hoverValue:h,decimalConversion:p.decimalConversion});return t?In.jsxs(i,{sx:Object.assign({p:12,pb:28,borderRadius:12,backgroundColor:"background.paperContrast"},r),children:[In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{typography:"h6",fontWeight:600,color:"text.secondary"},children:In.jsx(e,{id:"88dol0",message:"Success Rate"})}),In.jsx(v,{loading:o,loadingProps:{width:100},sx:{mt:4,typography:"caption",color:f?"primary.main":"text.primary"},children:f||g})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"flex-end",pr:4},children:[In.jsx(i,{sx:{pb:8,mr:16,typography:"h6",fontWeight:600},children:In.jsx(e,{id:"CMHmbm",message:"Slippage"})}),In.jsxs(i,{sx:{flex:1},ref:u,children:[In.jsx(mm,{data:t,loading:o}),In.jsx(i,{sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:!o&&s?In.jsx(xm,{value:l?h||-1:p.value,min:p.min,max:p.max,disabled:!l,marks:[{value:p.max,label:p.max}],formatValue:p.formatValue,getSliderYPosition:p.getSliderYPosition,hoverValue:l?p.value:h,onChange:(e,t)=>{if("number"==typeof t){if(l)return void m(t);const e=p.handleChangeValue(t);a(e)}},onChangeCommitted:()=>{m(null)}}):""})]})]})]}):null}var bm,jm=H.memo(vm);function Cm({title:t,desc:n,doNotChecked:o,onChangeDoNotChecked:r}){const s=a();if(Z((()=>o),[]))return null;const l=s.palette.warning.main;return In.jsxs(i,{sx:{backgroundColor:T(l,.1),borderRadius:8,padding:12},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,typography:"body2",color:l,fontWeight:700},children:[In.jsx(Un.Warn,{}),t]}),In.jsx(i,{sx:{mt:8,typography:"body2",fontWeight:500,color:s.palette.text.secondary,textAlign:"center"},children:n}),!!r&&In.jsxs(i,{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:[In.jsx(E,{checked:o,size:16,onChange:e=>{const{checked:t}=e.target;r(t)}}),In.jsx(e,{id:"3WdxUv",message:"Do not remind again"})]})]})}function wm({fromToken:t,toToken:n}){var o,r;const s=a(),{slippageAdvanced:d,notRemindAgainSlippageHigher:c,notRemindAgainSlippageLower:u}=Xd(),{customSlippage:p,customSlippageNum:h,handleSlippageChange:m,forecastSlippage:g,forecastSlippageQuery:x,recommendSlippage:y}=oc({fromToken:t,toToken:n}),j=!!g,[C,w]=H.useState(!1),[k,O]=H.useState();!k&&t&&n&&O(p?bm.custom:bm.recommend);const R=k===bm.custom,M=H.useRef(null),_=H.useMemo((()=>k===bm.custom?h?new Le(h).div(100).toNumber():void 0:new Le(y).div(100).toNumber()),[k,y,h]),P=H.useCallback((e=>{R||O(bm.custom),m({slippage:new Le(e).times(100).toString(),disabled:!1,deleted:!1,recommend:String(y)})}),[R,y,m]);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{mt:24,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[In.jsx(e,{id:"x6GJ4a",message:"Max Slippage"}),In.jsx(f,{title:In.jsxs(In.Fragment,{children:[In.jsx(e,{id:"qoii6e",message:"The dynamic slippage is provided by ZUNO team through analyzing historical transactions."}),In.jsx("br",{}),In.jsxs(i,{component:"a",href:le._({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:[In.jsx(e,{id:"NgeSlx",message:"Learn More"}),">"]})]}),ml:7})]}),x.isLoading||(null===(o=x.slippageData.slippageList)||void 0===o?void 0:o.length)?In.jsxs(v,{loading:x.isLoading,loadingProps:{width:100},component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[In.jsx(e,{id:"sxkWRg",message:"Advanced"}),In.jsx(E,{sx:{top:-1},size:16,checked:d,onChange:e=>{const{checked:t}=e.target;Xd.setState({slippageAdvanced:t})}})]}):""]}),!!k&&In.jsxs(A,{value:k,onChange:(e,t)=>{O(t),t===bm.custom&&w(!0)},children:[In.jsxs(I,{variant:"inPaper",sx:{mt:16,'&:not(:hover) [aria-selected="true"] .weak':{color:T(s.palette.secondary.contrastText,.5)}},children:[In.jsx(S,{value:bm.recommend,variant:"inPaper",sx:{position:"relative"},children:In.jsxs(In.Fragment,{children:[In.jsx(i,{component:"span",sx:{position:"absolute",top:4,left:4,ml:4,typography:"h6",fontWeight:600,padding:s.spacing(0,8),borderRadius:4,backgroundColor:R?T(s.palette.purple.main,.1):"#FFF"},children:In.jsx(i,{component:"span",sx:{background:R?`linear-gradient(90deg, ${s.palette.purple.main} -1.33%, ${"dark"===s.palette.mode?"#E6D9FF":"#BFAFF3"} 98.67%)`:`linear-gradient(90deg, ${s.palette.purple.main} -1.33%, #BFAFF3 98.67%)`,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"New"})}),In.jsxs(i,{sx:{textAlign:"center"},children:[j?In.jsxs(i,{sx:{flexGrow:1,typography:"body2",fontWeight:600},children:[y.toString()||"-","%"]}):In.jsx(l,{title:In.jsx(e,{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:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"body2",fontWeight:600,color:s.palette.warning.main,gap:4},children:[In.jsx(i,{component:Un.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),In.jsxs("span",{children:[y.toString()||"-","%"]})]})}),In.jsx(i,{sx:{typography:"h6",fontWeight:600},className:"weak",children:In.jsx(e,{id:"cOvZFM",message:"Dynamic"})})]})]})}),In.jsx(S,{value:bm.custom,variant:"inPaper",sx:{position:"relative",p:0},children:In.jsxs(i,{sx:{px:16,py:12,typography:"body2",fontWeight:600,textAlign:"center"},onClick:()=>{setTimeout((()=>{w(!0)}))},children:[C?In.jsx(b,{ref:M,placeholder:"-",sx:{backgroundColor:"transparent",borderWidth:0,"& input":{textAlign:"center",typography:"body2",p:0,boxSizing:"border-box",height:19,color:R?s.palette.secondary.contrastText:s.palette.text.secondary,"&::placeholder":{color:"custom.input.placeholder",opacity:1}}},inputMode:"decimal",value:p||"",autoFocus:!0,onChange:e=>{const t=e.target.value;m({slippage:t,disabled:!1,recommend:String(y)})},onBlur:()=>{setTimeout((()=>{if(w(!1),!h)return void O(bm.recommend);const e=!h||h<0;e&&p&&m({slippage:p,disabled:e,deleted:e,recommend:String(y)})}),10)},onKeyDown:e=>{var t;"Enter"===e.code&&(e.preventDefault(),null===(t=M.current)||void 0===t||t.blur())}}):In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,color:p&&R?s.palette.warning.main:void 0},children:[p&&In.jsx(i,{component:Un.Alarm,sx:{position:"relative",top:-2,width:18,height:18}}),p||"-","%"]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",typography:"h6",fontWeight:600},className:"weak",children:In.jsx(e,{id:"8Tg/JR",message:"Custom"})})]})})]}),In.jsx(L,{value:bm.recommend,children:(null===(r=x.slippageData.slippageList)||void 0===r?void 0:r.length)&&d?In.jsx(jm,{data:x.slippageData.slippageList,activeSlippage:_,loading:x.isLoading,handleChangeCustomSlippage:P,sx:{mt:8}}):""}),In.jsxs(L,{value:bm.custom,children:[In.jsx(i,{sx:{mt:8}}),h>y&&In.jsx(Cm,{title:le._({id:"8XNsbx",message:"Higher than dynamic slippage"}),desc:le._({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:c,onChangeDoNotChecked:e=>Xd.setState({notRemindAgainSlippageHigher:e})}),!!h&&h<y&&In.jsx(Cm,{title:le._({id:"TTlkRL",message:"Lower than dynamic slippage"}),desc:le._({id:"yq+Q9s",message:"Dynamic slippage is {recommendSlippage}% , the current slippage setting may increase the failure rate of transactions.",values:{recommendSlippage:y}}),doNotChecked:u,onChangeDoNotChecked:e=>Xd.setState({notRemindAgainSlippageLower:e})})]})]})]})}function km({checked:t,onChange:n,sx:o,disabled:r}){const s=a();let l=s.palette.background.tag;return t&&(l=s.palette.secondary.main),In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",position:"relative",borderRadius:8,backgroundColor:s.palette.background.input,opacity:r?.5:1},o),component:d,disabled:r,onClick:()=>{r||n(!t)},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:s.palette.text.primary,whiteSpace:"nowrap"},children:In.jsx(e,{id:"az8lvo",message:"Off"})}),In.jsx(i,{sx:{typography:"body2",fontWeight:600,pl:12,pr:13,pt:8,pb:9,width:"50%",zIndex:1,color:t?s.palette.secondary.contrastText:s.palette.text.primary,whiteSpace:"nowrap"},children:In.jsx(e,{id:"Z5HWHd",message:"On"})}),In.jsx(i,{sx:{borderRadius:6,backgroundColor:l,zIndex:0,position:"absolute",top:2,bottom:2,width:"calc(50% - 2px - 2px)",left:t?"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 Tm({show:t,onClick:n}){const o=a();return In.jsxs(r,{weak:!0,sx:{display:t?"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("light"===o.palette.mode?"#FFF":"#000",.1)}`,cursor:"pointer",whiteSpace:"nowrap",gap:4},onClick:n,children:[In.jsx(e,{id:"F8yRdq",message:"More trade settings"}),In.jsx(i,{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:In.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 Em({selected:e,name:t,logo:n,onClick:o}){const r=a();return In.jsxs(i,{component:d,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:[In.jsx("img",{src:n,alt:t,style:{height:40,width:40}}),In.jsx(i,{sx:{color:r.palette.text.primary,typography:"body2",fontWeight:600},children:t}),e&&In.jsx(i,{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:In.jsx("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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 Am({privacySwapSupplierEndpoints:e,endpointStatusMap:t,refetchEndpointStatus:n,setIsSelectSupplierMode:o}){var r,s;const l=a(),[d,u]=$(null!==(s=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.key)&&void 0!==s?s:null),[p,h]=$(t);p!==t&&(h(t),Array.from(t.entries()).forEach((([e,t])=>{t&&u(e)})));const m=d?null==e?void 0:e.find((e=>e.key===d)):void 0,g=!d||t.get(d),f=z((()=>{n(),o(!1)}),[n,o]),{switchTo:x}=function({chainId:e,successCallback:t,selectedSupplier:n}){return{switchTo:z((()=>bn(this,void 0,void 0,(function*(){if(n)try{yield window.ethereum.request({method:"wallet_addEthereumChain",params:[n.addChainParameters]}),t()}catch(e){console.error(e)}}))),[n,t])}}({successCallback:f,selectedSupplier:m});return In.jsxs(i,{sx:{display:"flex",alignItems:"stretch",flexDirection:"column",minHeight:"100%"},children:[In.jsx(i,{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 In.jsx(Em,{selected:n,name:e.name,logo:e.logo,onClick:()=>u(e.key)},t)}))}),In.jsx(i,{sx:{mt:24,width:"100%",height:"1px",flexShrink:0,flexGrow:0,backgroundColor:l.palette.border.main}}),In.jsxs(i,{sx:{mt:24,mb:24,typography:"body2",fontWeight:500,color:l.palette.text.secondary},children:[In.jsx(i,{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."}),m&&In.jsx(i,{sx:{color:l.palette.primary.main},component:"a",href:null==m?void 0:m.docUrl,target:"_blank",rel:"noopener noreferrer",children:"Learn more>"})]}),In.jsx(c,{size:c.Size.big,variant:c.Variant.contained,fullWidth:!0,sx:{marginTop:"auto",flexShrink:0,flexGrow:0},disabled:g,onClick:x,children:"Enable Privacy Swap"}),In.jsx(i,{sx:{height:28,width:"100%"}})]})}function Im({open:t,onClose:n,fromToken:o,toToken:r,privacySwapEnableAble:s,privacySwapEnable:l,privacySwapSupplierEndpoints:d,endpointStatusMap:c,refetchEndpointStatus:u,isDialogModal:p}){const h=a(),{ddl:m,expertMode:g,disableIndirectRouting:f}=Xd(),[x,y]=$(!1),v=H.useRef(null),[j,C]=H.useState(!1);return H.useEffect((()=>{const e=v.current,t=new ResizeObserver((()=>{e&&C(e.scrollHeight!==e.offsetHeight)})),n=ae((()=>{if(!e)return;const t=e.scrollTop+e.clientHeight<e.scrollHeight-2;C(t)}),50);return e&&(C(e.scrollHeight!==e.clientHeight),t.observe(e),e.addEventListener("scroll",n)),()=>{e&&(t.unobserve(e),e.removeEventListener("scroll",n))}}),[null==v?void 0:v.current]),In.jsx(Rc,{open:t,onClose:x?()=>y(!1):n,id:"swap-settings",title:x?"Select A Supplier":In.jsx(e,{id:"Tz0i8g",message:"Settings"}),modal:p,children:In.jsx(i,{sx:{px:20,pb:34,overflowY:"auto"},ref:v,children:x?In.jsx(Am,{privacySwapSupplierEndpoints:d,endpointStatusMap:c,refetchEndpointStatus:u,setIsSelectSupplierMode:y,privacySwapEnable:l,privacySwapEnableAble:s}):In.jsxs(In.Fragment,{children:[In.jsx(wm,{fromToken:o,toToken:r}),In.jsxs(i,{sx:{mt:24,pt:14,borderTop:`solid 1px ${h.palette.border.main}`},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",fontWeight:600},children:[In.jsx(e,{id:"zSMRJ/",message:"Transaction Deadline"}),In.jsx(im,{title:In.jsx(e,{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})]}),In.jsxs(i,{sx:{mt:16,display:"flex",alignItems:"center",gap:8,typography:"body2"},children:[In.jsx(b,{sx:{width:80,height:34,lineHeight:1,typography:"body2","& input":{px:16,py:6}},placeholder:String(Cs),value:m,onChange:e=>{Xd.setState({ddl:e.target.value})}}),In.jsx(e,{id:"H9HlDe",message:"minutes"})]})]}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:12,mt:24,pt:14,borderTop:`solid 1px ${h.palette.border.main}`},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{fontWeight:600},children:[In.jsx(e,{id:"MXQodB",message:"Disable Indirect Routing"}),In.jsx(im,{title:In.jsx(e,{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})]}),In.jsx(km,{checked:f,onChange:e=>{Xd.setState({disableIndirectRouting:e})}})]}),s&&In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{fontWeight:600},children:[In.jsx(e,{id:"U1Bq/+",message:"Privacy Swap"}),In.jsx(im,{title:In.jsx(e,{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})]}),In.jsx(km,{checked:l,disabled:l,onChange:e=>{e&&y(!0)}})]})]}),In.jsx(Tm,{show:j,onClick:()=>{var e,t;null===(e=v.current)||void 0===e||e.scrollTo({top:null===(t=v.current)||void 0===t?void 0:t.scrollHeight,behavior:"smooth"})}})]})})})}function Sm({onClick:e,disabled:t,plus:n}){const o=a(),r=t||n||!e;return In.jsx(i,{sx:{width:"100%",position:"relative"},children:In.jsx(i,{component:d,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:n?In.jsx(i,{component:Un.Plus,sx:{width:24,height:24}}):In.jsx(i,{component:Un.ArrowBack,sx:{width:24,height:24}})})})}!function(e){e.recommend="recommend",e.custom="custom"}(bm||(bm={}));const Lm=()=>{const{requests:e,updateText:t}=Wd(),n=H.useMemo((()=>{let t={};return null==e||e.forEach((([e,n])=>{var i,o;if((n===Ld.Running||n===Ld.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)]),i=H.useMemo((()=>{let t={};return null==e||e.forEach((([e,n])=>{var i,o;if(n===Ld.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=H.useCallback(((e,n,i)=>{const o=e[n];if(!o)return!1;return!!(Le.isBigNumber(i)?i:new Le(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]),r=H.useCallback(((e,t)=>o(n,e,t)),[n,o]),a=H.useCallback(((e,t)=>o(i,e,t)),[i,o]);return{balanceData:n,balanceDataDone:i,isTokenLoading:r,isTokenLoadingDone:a}};function Om({onClick:t,balance:n,decimals:o,address:r,showMaxBtn:s,canClickBalance:l,loading:c,balanceText:u}){const{palette:p}=a(),h=l&&(null==n?void 0:n.gt(0))&&t;return In.jsxs(i,{sx:Object.assign({typography:"body2",alignItems:"center",color:p.text.secondary,wordBreak:"break-word",textAlign:"right"},h?{"&:hover":{color:p.text.primary,cursor:"pointer"}}:{}),onClick:h?()=>t(n?n.toString():""):void 0,children:[null!=u?u:In.jsx(e,{id:"0QDjxt",message:"Balance:"})," ",c?In.jsx(O,{sx:{position:"relative",top:-2,verticalAlign:"middle"}}):In.jsxs(In.Fragment,{children:[r?Ps({input:n,decimals:Math.min(o||4,4)}):"-",s&&n&&n.gt(0)&&t&&In.jsx(i,{component:d,sx:{ml:6,color:(null==n?void 0:n.gt(0))?p.primary.main:p.text.disabled,cursor:r?"pointer":"unset",typography:"body2"},onClick:()=>t&&t(n?n.toString():""),children:In.jsx(e,{id:"CK1KXz",message:"Max"})})]})]})}const Rm=K((function({readOnly:e,sx:t,value:n,decimals:o,onChange:r,suffix:s,suffixGap:l=0,withClear:c,onFocus:u,placeholder:p,readonlyShowSuffix:h,typography:m},g){const f=a(),x=Z((()=>s||(c&&n&&r?In.jsx(i,{component:d,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:()=>{r&&r("")},children:In.jsx(i,{component:Un.Error,sx:{width:12}})}):void 0)),[r,s,f.palette.text.primary,n,c]);return In.jsx(b,{fullWidth:!0,value:n,readOnly:e,placeholder:p||"0.00",onFocus:u,onChange:e=>{const t=e.target.value,n=0===t.length?"":Ns(t,o);r&&r(n)},"data-testid":"number-input-wrapper",suffix:(!e||h)&&x,suffixGap:l,ref:g,sx:Object.assign({border:"none","& input":{fontSize:24,typography:m,border:"none",outline:"none",padding:0,color:"text.primary","&::placeholder":{fontSize:24,typography:m,color:"text.disabled"}}},t)})}));function Mm({token:t,onClick:n,showChainLogo:o,readonly:r,showChainName:s}){var l,c;const u=a(),p=(null==t?void 0:t.chainId)?us.get(t.chainId):null,h=s&&!!p;return In.jsxs(i,{component:d,sx:{display:"flex",alignItems:"center",gap:8,color:u.palette.text.primary,typography:h?"body2":"body1",fontWeight:600,"&:focus-visible":{opacity:.5}},onClick:e=>{r||n&&n(e)},"data-testid":Es,children:[!!(null==t?void 0:t.address)&&In.jsx(Fc,{url:null==t?void 0:t.logoURI,address:null!==(l=null==t?void 0:t.address)&&void 0!==l?l:"",chainId:null==t?void 0:t.chainId,noShowChain:!o,width:32,height:32,chainSize:16,logoOffset:6,marginRight:0}),In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[(null==t?void 0:t.address)?In.jsx(In.Fragment,{children:In.jsx(i,{children:null!==(c=null==t?void 0:t.symbol)&&void 0!==c?c:"-"})}):In.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"}),!r&&In.jsx("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 11.75L12 7.25H6L9 11.75Z",fill:"currentColor"})})]}),!!h&&In.jsxs(i,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary"},children:[p.name,In.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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 _m({chain:e,active:t,onClick:n}){return In.jsx(l,{title:e.name,placement:"top",onlyHover:!0,children:In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",gap:8,p:8,borderRadius:8,cursor:"pointer",border:"1px solid"},t?{backgroundColor:"tabActive.main",borderColor:"tabActive.main",color:"primary.main"}:{borderColor:"border.main","&:hover":{backgroundColor:"hover.default"}}),onClick:n,children:[In.jsx(i,{component:e.logo,sx:{width:24,height:24}}),t&&In.jsx(i,{sx:{typography:"body2",color:"primary.main"},children:e.name})]})},e.chainId)}var Pm=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()}},Bm={"text/plain":"Text","text/html":"Url",default:"Text"};var Dm=function(e,t){var n,i,o,r,a,s,l=!1;t||(t={}),n=t.debug||!1;try{if(o=Pm(),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=Bm[t.format]||Bm.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},Nm=Cn(Dm);function Fm({copyText:e,size:t,sx:n,componentProps:o,onClick:r,children:a}){var s;const[l,c]=H.useState(!1);return In.jsx(R,{title:le._({id:"6V3Ea3",message:"Copied"}),open:l,onClose:()=>c(!1),arrow:!1,children:In.jsxs(i,{...o,component:null!==(s=null==o?void 0:o.component)&&void 0!==s?s:d,onClick:t=>{if(null==o?void 0:o.onClick)return o.onClick(t);t.stopPropagation(),e&&(Nm(e),c(!0)),r&&r()},sx:Object.assign({cursor:"pointer"},null==o?void 0:o.sx),children:[In.jsx(i,{component:Un.Copy,sx:Object.assign({width:t||"auto",height:t||"auto"},n)}),a]})})}function Um({truncate:e,address:t,disabledAddress:n,sx:o,handleOpen:r,addressHoverColor:a,addressHoverShowIcon:s}){return n?In.jsx(i,{children:e?rd(t):t}):In.jsx(M,{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:In.jsxs(i,{onClick:e=>{null==r||r(e,"address")},sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[e?rd(t):t,s?In.jsx(i,{component:Un.ArrowRight,sx:{display:"none",width:14,height:14}}):""]})})}function qm({address:e,truncate:t,showCopy:n,size:o="medium",iconSize:s,iconSpace:l,sx:d,iconDarkHover:c,disabledAddress:u,addressHoverColor:p,addressHoverShowIcon:h,customChainId:m,handleOpen:g,onAddressClick:f,onShareClick:x}){const y=a(),{chainId:v}=hd(),b=null!=m?m:v,j="medium"===o,C=c?_:r,w=e=>{let t=e?12:8;return l&&(t=l),c&&(t-=3),t},k="big"===o?"h5":j?"body1":"body2",T=(t,n)=>{g?g(t,n):b&&(t.stopPropagation(),window.open(ad(b,e,"address")))},E=s||(j?16:14);return In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",typography:k,color:y.palette.text.primary,lineHeight:"normal"},d||{}),children:[In.jsx(Um,{truncate:t,address:e,disabledAddress:u,sx:d,typography:k,handleOpen:null!=f?f:T,addressHoverColor:p,addressHoverShowIcon:h}),In.jsx(C,{sx:{display:"inline-flex",ml:w(j),cursor:"pointer"},onClick:e=>{T(e,"icon")},children:In.jsx(i,{component:Un.ArrowTopRightBorder,sx:{width:E,height:E}})}),n?In.jsx(Fm,{size:E,copyText:e,componentProps:{component:C,sx:{ml:w(j),display:"inline-flex",alignItems:"center",justifyContent:"center"}}}):null,!!x&&In.jsx(C,{sx:{display:"inline-flex",ml:w(j),cursor:"pointer"},onClick:e=>{x(e)},children:In.jsx(i,{component:Un.Share,sx:{width:E,height:E,ml:w(j)}})})]})}function Vm({token:e,disabled:t,style:n,balance:o,onClick:r}){const s=a(),l=o?Ps({input:o,decimals:e.decimals}):"";return In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",px:8,py:8,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:n,onClick:()=>{t||r()},"data-testid":Ss,children:[In.jsx(Fc,{token:e,width:32,height:32,noShowChain:!0,noBorder:!0}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:2},children:[In.jsx(i,{sx:{textAlign:"left",color:"text.primary",typography:"body2",fontWeight:600},children:e.symbol}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:{color:"text.secondary",typography:"h6",fontWeight:500,maxWidth:"80px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,children:e.name}),In.jsx(qm,{address:e.address,customChainId:e.chainId,showCopy:!0,truncate:!0,iconSpace:2,iconSize:12,size:"small",sx:{typography:"h6",color:"text.disabled"}})]})]}),In.jsx(i,{sx:{ml:"auto",typography:"body1",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(null==o?void 0:o.gte(0))?l:In.jsx(i,{component:Un.Loading,width:18,sx:{"& path":{fill:s.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})}function Wm(){return In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between"},children:[In.jsx(j,{variant:"circular",width:32,sx:{mt:8}}),In.jsxs(i,{sx:{ml:8,flex:"1 0 auto"},children:[In.jsx(j,{sx:{borderRadius:4},height:24}),In.jsx(j,{sx:{mt:4,borderRadius:4},height:19,width:137})]})]})}function Hm({chainId:e,value:t,onChange:n,occupiedAddrs:o,occupiedChainId:r,hiddenAddrs:a,showAddrs:s,visible:l,side:d,defaultLoadBalance:c,multiple:u,searchPlaceholder:p,searchOtherAddress:h,sx:m}){const{chainList:g,selectChainId:f,setSelectChainId:x}=function(e){const{crossChain:t,defaultChainId:n}=On(),i=Z((()=>t?Array.from(us.values()):[]),[t]),[o,r]=$(n);return Y((()=>{r((e=>void 0===e?n:e))}),[n]),{chainList:i,selectChainId:Z((()=>null!=o?o:n),[o,n]),setSelectChainId:r}}(),{showTokenList:y,filter:v,setFilter:b,onSelectToken:j,popularTokenList:C,tokenInfoMap:w}=Nc({value:t,onChange:n,occupiedAddrs:o,occupiedChainId:r,hiddenAddrs:a,showAddrs:s,side:d,chainId:null!=e?e:f,visible:l,defaultLoadBalance:c,multiple:u}),k=G(null),T=G(null),[E,A]=$(329);Y((()=>{if(l&&t)if(Array.isArray(t)){const[e]=t;e&&e.chainId!==f&&x(e.chainId)}else x(t.chainId)}),[t,l]),Y((()=>{if(l&&k.current){const e=new ResizeObserver((e=>{for(const t of e)if(t.target===k.current&&T.current){const e=t.contentRect.height-48-T.current.offsetHeight-16;e>0&&A(e)}}));return e.observe(k.current),()=>{e.disconnect()}}}),[l,f]);const I=Qe({queryKey:["token-picker-searchOtherAddress",v],queryFn:()=>h?h(v):null,enabled:od(v)&&!!h}),S=z((({index:e,style:n})=>{var i;const o=y[e];if(!o)return null;let r=!1;return t&&(r=Array.isArray(t)?t.some((e=>e.address===o.address&&e.chainId===o.chainId)):t.address===o.address&&t.chainId===o.chainId),In.jsx(Vm,{token:o,disabled:r,style:n,onClick:()=>j(o),balance:null===(i=w.get(`${o.chainId}-${o.address}`))||void 0===i?void 0:i.balance},o.address+o.chainId)}),[y,C,t]);return In.jsxs(i,{sx:Object.assign({display:"flex",flexDirection:"column",px:16,flexGrow:1,overflow:"hidden"},m),ref:k,children:[In.jsx(P,{fullWidth:!0,height:48,value:v,onChange:e=>b(e.target.value),clearValue:()=>b(""),placeholder:null!=p?p:le._({id:"72/M0o",message:"Enter the token symbol or address"}),sx:{mb:16}}),void 0===e&&g.length>0&&In.jsx(i,{ref:T,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:g.map((e=>In.jsx(_m,{chain:e,active:e.chainId===f,onClick:()=>{x(e.chainId)}},e.chainId)))}),In.jsx(i,{sx:{pb:16,flexGrow:1},children:y.length?In.jsx(Jt,{height:E,itemCount:y.length,itemSize:56,width:"100%",className:"token-list",children:S}):In.jsx(i,{sx:{height:E,overflowY:"auto"},children:I.isLoading?In.jsx(Wm,{}):I.data?I.data:In.jsx(Mn,{hasSearch:!0,sx:{mt:80}})})})]})}function Zm(t){const{height:n,TokenPickerDialog:i}=On(),{isMobile:o}=Sd();if(i)return In.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:g,searchPlaceholder:f,searchOtherAddress:x,chainId:y,modal:v}=t;return In.jsx(Rc,{height:v?"80vh":n,open:r,onClose:l,title:null!=a?a:In.jsx(e,{id:"T0Y2+3",message:"Select a token"}),id:"select-token",testId:Is,modal:v,children:In.jsx(Hm,{value:s,visible:r,onChange:p,occupiedAddrs:d,occupiedChainId:u,hiddenAddrs:c,side:h,defaultLoadBalance:m,multiple:g,searchPlaceholder:f,searchOtherAddress:x,chainId:y,sx:v?{width:o?"100%":420,borderRadius:16}:void 0})})}const zm=/^ST[0-9A-HJ-NP-Z]{39}$/;const $m=({chainId:e,open:t,onClose:n,inputToAddress:o,setInputToAddress:r})=>{const s=a(),[l,u]=$(o||""),p=function(e,t){return Z((()=>{if(!e)return!1;const n=us.get(t);if(!n)return!1;try{if(n.isEVMChain)return!!Sl(e);if(n.isSolanaChain)return new De(e),!0;if(n.isBTCChain){if(zm.test(e))return!0;try{return t===de.BTC_SIGNET?Bt.address.toOutputScript(e,yp):Bt.address.toOutputScript(e,Bt.networks.bitcoin),!0}catch(e){return!1}}return!1}catch(e){return!1}}),[e,t])}(l,e),h=Z((()=>us.get(e)),[e]);return In.jsx(Rc,{open:t,onClose:n,title:"Receive address",modal:!0,children:In.jsxs(i,{sx:{minWidth:420,p:20,borderTop:`1px solid ${s.palette.border.main}`,display:"flex",flexDirection:"column",gap:20},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[In.jsx(b,{fullWidth:!0,value:l,placeholder:`Enter ${null==h?void 0:h.name} address`,onChange:e=>{u(e.target.value)},height:48,suffix:l?In.jsx(i,{component:d,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:In.jsx(i,{component:Un.Error,sx:{width:12}})}):null}),!p&&l&&In.jsx(i,{sx:{typography:"h6",color:"error.main"},children:"Invalid address"})]}),In.jsx(c,{fullWidth:!0,variant:c.Variant.contained,size:c.Size.middle,disabled:!l||!p,onClick:()=>{r(l),n()},children:"Confirm"})]})})},Gm=({token:e,enterAddressEnabled:t=!1,inputToAddress:n,setInputToAddress:o,account:r})=>{var a,s,l,d,c,u;const p=e.chainId,{open:h,disconnect:m}=hd(),[g,f]=$(!1),x=Z((()=>us.get(p)),[p]),y=In.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[In.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"}),In.jsx("ellipse",{cx:"10.1349",cy:"10.1002",rx:"0.533334",ry:"0.533333",fill:"currentColor"}),In.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 In.jsxs(In.Fragment,{children:[In.jsx(B,{triggerChildren:(null===(a=null==r?void 0:r.appKitAccount)||void 0===a?void 0:a.isConnected)?In.jsxs(i,{sx:{display:"inline-flex",alignItems:"center",gap:4,px:4,py:2,borderRadius:4,backgroundColor:"background.tag",typography:"h6",lineHeight:"16px"},children:[y,rd(null===(s=null==r?void 0:r.appKitAccount)||void 0===s?void 0:s.address),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:In.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"})})]}):In.jsxs(i,{sx:{display:"inline-flex",alignItems:"center",gap:4,px:4,py:2,borderRadius:4,backgroundColor:"background.tag",typography:"h6",lineHeight:"16px"},children:["Wallet address:",rd(null===(l=null==r?void 0:r.appKitAccount)||void 0===l?void 0:l.address),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:In.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:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[In.jsxs(i,{sx:{typography:"h6",lineHeight:"16px",color:"text.secondary"},children:["Connected(",ld(p),")"]}),(null===(d=null==r?void 0:r.appKitAccount)||void 0===d?void 0:d.isConnected)?In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8,px:8,py:8,color:"text.primary",borderRadius:8,backgroundColor:"background.paperContrast",typography:"body2",lineHeight:"19px"},children:[n?y:x&&In.jsx(i,{component:x.logo,sx:{width:16,height:16}}),rd(null===(c=null==r?void 0:r.appKitAccount)||void 0===c?void 0:c.address),In.jsx(i,{sx:{ml:"auto",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:()=>{n?o(null):m({namespace:null==r?void 0:r.namespace})},children:In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:In.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"})})})]}):In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{height:"1px",width:"100%",backgroundColor:"border.main"}}),In.jsx(i,{sx:{p:8,cursor:"pointer",typography:"body2",lineHeight:"19px",color:"text.primary","&:hover":{borderRadius:8,backgroundColor:"background.paperContrast"}},onClick:()=>{h({namespace:null==r?void 0:r.namespace})},children:"Connect a new wallet"})]}),t&&In.jsxs(In.Fragment,{children:[(null===(u=null==r?void 0:r.appKitAccount)||void 0===u?void 0:u.isConnected)&&In.jsx(i,{sx:{height:"1px",width:"100%",backgroundColor:"border.main"}}),In.jsx(i,{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&&In.jsx($m,{open:g,onClose:()=>f(!1),chainId:p,inputToAddress:n,setInputToAddress:o})]})};function Ym({sx:t,amt:n,token:o,readOnly:r,showMaxBtn:s,canClickBalance:l,onMaxClick:d,fiatPriceTxt:u,failedReason:p,occupiedAddrs:h,occupiedChainId:m,onInputFocus:g,onTokenClick:f,onInputChange:x,onTokenChange:y,side:v,showChainLogo:b,showChainName:j,defaultLoadBalance:C,overrideBalance:w,overrideBalanceLoading:k,balanceText:T,showPercentage:E,inputReadonlyTooltip:A,inputTypography:I,hideToken:S,checkLogBalance:L,notTokenPickerModal:O,enterAddressEnabled:M,inputToAddress:_,setInputToAddress:P,account:B}){var D,N,F;const U=a(),[q,V]=$(!1),W=Qe(Ea.getFetchTokenQuery(null==o?void 0:o.chainId,null==o?void 0:o.address,null===(D=null==B?void 0:B.appKitAccount)||void 0===D?void 0:D.address)),H=null!==(F=null!=w?w:null===(N=W.data)||void 0===N?void 0:N.balance)&&void 0!==F?F:null,{isTokenLoading:Z}=Lm();let z=null!=k?k:W.isLoading;!z&&H&&(L?z=Object.entries(L).some((([e,t])=>Z(e,t))):o&&(z=Z(o.address,H))),Ed({tokenList:o?[o]:[]});const[Q,X]=$(0),K=G("");Y((()=>{n!==K.current&&X(0)}),[n]);const{gotoBuyToken:J}=On();let ee=J&&H&&n&&H.lt(n);const te=!!x||!!A,ne={"& 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 In.jsxs(i,{sx:Object.assign({minHeight:te?133:"auto",padding:U.spacing(20,20,24),overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",borderRadius:12,backgroundColor:U.palette.background.paper},t),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[S?In.jsx(i,{}):In.jsx(Mm,{token:o,showChainLogo:b,showChainName:j,onClick:()=>V(!0),readonly:!y}),o&&In.jsx(Gm,{token:o,enterAddressEnabled:M,inputToAddress:_,setInputToAddress:P,account:B})]}),te&&(r&&A?In.jsx(R,{title:A,arrow:!1,children:In.jsx(i,{children:In.jsx(Rm,{value:n,readOnly:!0,withClear:!0,sx:Object.assign({mt:16},ne)})})}):In.jsx(Rm,{value:n,onFocus:g,onChange:x?e=>{x(e),X(0)}:void 0,readOnly:r,withClear:!0,suffix:ee?In.jsx(c,{variant:c.Variant.tag,backgroundColor:U.palette.background.paperDarkContrast,sx:{fontSize:12},onClick:e=>{var t;e.stopPropagation(),(null===(t=null==B?void 0:B.appKitAccount)||void 0===t?void 0:t.address)&&(null==J||J({token:o,account:B.appKitAccount.address}))},children:In.jsx(e,{id:"qiOIiY",message:"Buy"})}):void 0,typography:I,sx:Object.assign({mt:16},ne)})),p&&In.jsx(i,{sx:{mt:4,typography:"h6",lineHeight:"16px",fontWeight:500,color:U.palette.error.main},children:p}),In.jsxs(i,{sx:{mt:E?9:4,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsx(i,{sx:{typography:"h6",color:U.palette.text.secondary},children:u}),In.jsx(Om,{balance:H,balanceText:T,onClick:r||!d&&!x?void 0:e=>{d?d(e):x&&x(e),0!==Q&&1!==Q&&(X(1),K.current=e)},showMaxBtn:s,canClickBalance:l,address:null==o?void 0:o.address,decimals:null==o?void 0:o.decimals,loading:z})]}),In.jsx(Zm,{value:o,open:q,side:v,chainId:void 0,occupiedAddrs:h,occupiedChainId:m,defaultLoadBalance:C,onClose:()=>{V(!1),f&&f()},onTokenChange:(e,t)=>{V(!1),setTimeout((()=>{!Array.isArray(e)&&y&&y(e,t)}),Sc)},modal:!O})]})}function Qm({rawRouteData:e,chainId:t}){const n=H.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:Gs({input:new Le(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:n}}const Xm=({routeInfo:t,toToken:n,fromToken:o})=>{const[r,s]=$(!1),l=a(),{isMobile:d}=Sd(),c=Z((()=>{const e=[{key:"from",logo:In.jsx(Fc,{token:o,noShowChain:!0,height:14,width:14,marginRight:0})}];return e.push({key:"to",logo:In.jsx(Fc,{token:n,noShowChain:!0,height:14,width:14,marginRight:0})}),e}),[o,n]),{routeData:u}=Qm({rawRouteData:t,chainId:null==o?void 0:o.chainId});return In.jsxs(In.Fragment,{children:[In.jsxs(i,{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:[In.jsx(i,{sx:{color:l.palette.text.primary},children:"Route:"}),In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:0},children:c.map(((e,t)=>In.jsx(J,{children:e.logo},e.key)))}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:In.jsx("path",{d:"M2.91699 11.0833V7.58332H4.08366V9.91666H6.41699V11.0833H2.91699ZM9.91699 6.41666V4.08332H7.58366V2.91666H11.0837V6.41666H9.91699Z",fill:"currentColor"})})]}),In.jsx(Rc,{open:r,title:In.jsx(e,{id:"rT8e1f",message:"Route"}),onClose:()=>s(!1),modal:!0,children:In.jsx(i,{sx:{minWidth:d?"100%":800,py:20,px:20,borderTop:`1px solid ${l.palette.border.main}`},children:d?In.jsx($c,{routeData:u,fromTokenRaw:o,toTokenRaw:n}):In.jsx(Gc,{routeData:u,fromTokenRaw:o,toTokenRaw:n})})})]})};function Km({toToken:t,fromToken:n,priceStatus:o,pricePerToToken:r,pricePerFromToken:s,routeInfo:l}){const c=a(),[u,p]=$("-"),[h,m]=$(null),[g,f]=$("-"),[x,y]=$(null);Y((()=>{p(null==n?void 0:n.symbol),f(null==t?void 0:t.symbol),m(r),y(s)}),[n,t,r,s]);const v=z((()=>{p(g),f(u),m(x),y(h)}),[u,h,g,x]);return In.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:{[Kd.Initial]:"-",[Kd.Loading]:In.jsxs(In.Fragment,{children:[In.jsx(O,{sx:{mr:5}}),In.jsx(e,{id:"JdNn1Y",message:"Fetching best price..."})]}),[Kd.Failed]:In.jsxs(In.Fragment,{children:[In.jsx(i,{component:Un.Warn,sx:{width:15,mr:5,color:"warning.main"}}),In.jsx(e,{id:"NVAuTg",message:"Quote not available"})]}),[Kd.Success]:In.jsxs(i,{sx:{width:"100%",mt:16,px:11,py:7,borderRadius:12,border:`solid 1px ${c.palette.border.main}`,display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"flex-start",gap:6},children:[In.jsxs(i,{sx:{typography:"body2",lineHeight:"18px",color:c.palette.text.primary},children:["1 ",u," ",In.jsx("span",{style:{color:c.palette.text.secondary},children:"="})," $",_s({input:x,showDecimals:4})," ",g]}),In.jsx(i,{component:d,sx:{width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:In.jsx(i,{sx:{width:16,color:"text.secondary"},onClick:v,component:Un.Switch})})]}),n&&t&&In.jsx(Xm,{routeInfo:l,fromToken:n,toToken:t})]})}[o]})}function Jm({getAutoSlippage:t,onPayTokenChange:n,onReceiveTokenChange:o}={}){var r,s,u,p,h,m;const g=a(),{isInflight:f}=Hd(),{noPowerBy:x,onlyChainId:y}=On(),{isMobile:v}=Sd(),{open:b,disconnect:j,getAppKitAccountByChainId:C,chainId:w,appKitActiveNetwork:k}=hd(),[T,E]=$(!1),[A,I]=$(""),[S,L]=$(""),[R,M]=$(""),[_,P]=$(""),[B,D]=$(null),[N,F]=$(null),[U,q]=$(!1),[V,W]=$(!1),[H,G]=$(!1),[Q,X]=$(null),K=Z((()=>C(null==B?void 0:B.chainId)),[null==B?void 0:B.chainId,C]),J=Z((()=>{const e=C(null==N?void 0:N.chainId);if(e)return Q?Object.assign(Object.assign({},e),{appKitAccount:Object.assign(Object.assign({},e.appKitAccount),{isConnected:!0,address:Q})}):e}),[C,null==N?void 0:N.chainId,Q]),ee=Z((()=>se((e=>M(e)),300)),[]),te=Z((()=>se((e=>P(e)),300)),[]),ne=Z((()=>{if(B&&N)return!(!(null==B?void 0:B.chainId)||!(null==N?void 0:N.chainId)||B.chainId===N.chainId)}),[B,N]),{toFiatPrice:ie,fromFiatPrice:oe}=$d({toToken:N,fromToken:B}),{marginAmount:re}=function({token:e,fiatPrice:t}){return{marginAmount:Z((()=>{var n;const i=null!==(n=null==e?void 0:e.decimals)&&void 0!==n?n:6,o=null!=t?new Le(500).div(t):new Le(0),r=Fs(o,i);return(r.lt(new Le(1).times(new Le(10).pow(i-3)))?new Le(0):r).toString(10)}),[null==e?void 0:e.decimals,t])}}({token:T?N:B,fiatPrice:T?ie:oe});Id({fromToken:B,toToken:N,getAutoSlippage:t});const{slippage:ae,slippageLoading:ce}=oc({fromToken:B,toToken:N}),{slippage:ue}=function(){const{defaultSlippage:e}=ec(!0);return{slippage:jd((t=>t.slippage||e))}}(),{privacySwapSupplierEndpoints:pe,privacySwapEnable:he,privacySwapEnableAble:me,endpointStatusMap:ge,refetchEndpointStatus:fe}=ic({chainId:null==B?void 0:B.chainId,account:null==K?void 0:K.appKitAccount.address}),xe=function(e){var t,n;const{getAppKitAccountByChainId:i}=hd(),{latestBlockNumber:o}=jd(),r=Ea.getFetchTokenQuery(e&&(null===(t=us.get(e))||void 0===t?void 0:t.isEVMChain)?e:void 0,e?ve[e].address:void 0,null===(n=i(e))||void 0===n?void 0:n.appKitAccount.address);return Qe(Object.assign(Object.assign({},r),{queryKey:[...r.queryKey,o]}))}(null==B?void 0:B.chainId),{sendRouteLoading:be,sendRouteError:je,setSendRouteError:Ce,bridgeOrderTxRequest:we,handleClickSend:ke}=function(){const e=vd(),{evmProvider:t}=hd(),[n,i]=$(),[o,r]=$(!1),[a,s]=$(""),l=z((n=>bn(this,[n],void 0,(function*({selectedRoute:n,fromEtherTokenBalance:o,goNext:a}){var l,d;if(!n)return;const{encodeParams:c}=n;if(c&&c.interfaceParams){s(""),r(!0);try{const u=yield e.getData(ye.graphql.cross_chain_swap_zetachain_transactionEncode.toString(),{data:{interfaceParams:c.interfaceParams}});if(!u||!u.cross_chain_swap_zetachain_transactionEncode)throw new Error("cross_chain_swap_transactionEncode is null");const{data:p,to:h,value:m,from:g,chainId:f}=u.cross_chain_swap_zetachain_transactionEncode;if(!(p&&h&&m&&g&&f))throw new Error("cross_chain_swap_transactionEncode is null");const x=us.get(f);if(null==x?void 0:x.isEVMChain){if(!o)throw new Error("fromEtherTokenBalance is null");const{fromToken:e,fromAmount:i}=n,a=ve[f],c=Us(m,18),u=a&&e.address.toLowerCase()===a.address.toLowerCase(),x=c.minus(u?i:0);if(!c.isNaN()&&c.gt(0)&&o.lt(c))return s(le._({id:"F9xwHA",message:"Insufficient cross-chain fees, need at least {0} {1}",values:{0:Ps({input:x,decimals:null!==(l=null==a?void 0:a.decimals)&&void 0!==l?l:18}),1:null!==(d=null==a?void 0:a.symbol)&&void 0!==d?d:"-"}})),void r(!1);if(!t||!(yield gd({from:g,to:h,value:m,data:p},t)))throw new Error("failed to estimate gas")}i({data:p,to:h,value:m,from:g,chainId:f}),a()}catch(e){console.error("[failed to construct transaction request]: ",e);const{message:t}=e;s(t)}r(!1)}}))),[e,t]);return{sendRouteLoading:o,sendRouteError:a,setSendRouteError:s,bridgeOrderTxRequest:n,handleClickSend:l}}(),{bridgeRouteList:Te,status:Ee,failedReason:Ae}=function({fromAccount:e,toAccount:t,fromToken:n,toToken:i,fromAmount:o,enabled:r,slippage:a}){var s,l,d,c;const{tokenList:u}=Ls(),{GRAPHQL_URL:p}=On(),h=Z((()=>n&&o?new Le(o).multipliedBy(new Le(10).pow(n.decimals)).dp(0,Le.ROUND_DOWN):null),[o,n]),m=null!==(l=null===(s=null==e?void 0:e.appKitAccount)||void 0===s?void 0:s.address)&&void 0!==l?l:cs(null==n?void 0:n.chainId),g=null!==(c=null===(d=null==t?void 0:t.appKitAccount)||void 0===d?void 0:d.address)&&void 0!==c?c:cs(null==i?void 0:i.chainId),{data:f,error:x,isLoading:y,refetch:v}=Qe({retry:!1,queryKey:["graphql","cross_chain_swap_zetachain_routes",null==n?void 0:n.chainId,null==n?void 0:n.address,null==i?void 0:i.chainId,null==i?void 0:i.address,m,g,null==h?void 0:h.toString(),a],queryFn:()=>bn(this,void 0,void 0,(function*(){const e=yield fetch(`${p}?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==n?void 0:n.chainId},"fromTokenAddress":"${null==n?void 0:n.address}","toChainId":${null==i?void 0:i.chainId},"toTokenAddress":"${null==i?void 0:i.address}","fromAddress":"${m}","toAddress":"${g}","fromAmount":"${null==h?void 0:h.toString()}","slippage":${a?Number(a)/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:!!n&&!!i&&!!h&&h.isFinite()&&h.gt(0)&&n.chainId!==i.chainId&&r}),{status:b,failedReason:j,bridgeRouteList:C}=Z((()=>{if(y)return{status:Ms.Loading,bridgeRouteList:[]};if(x){let e;if(console.error("error:",x),x.message.includes("NOT_ROUTE_MIN_AMOUNT:min-")){const t=x.message.split("min-")[1];t&&(e=`(Enter min amount: ${t})`)}return{status:Ms.Failed,failedReason:e,bridgeRouteList:[]}}if(f&&f.cross_chain_swap_zetachain_routes){const e=[],{routeId:t,fromChainId:n,fromTokenAddress:i,fromAmount:o,fromAmountWithOutDecimals:r,fromAmountUSD:a,toChainId:s,toTokenAddress:l,toAmount:d,fromAddress:c,toAddress:p,slippage:h,approveTarget:m,fees:g,omniPlan:x,encodeParams:y}=f.cross_chain_swap_zetachain_routes,v=us.get(n);if(t&&n&&i&&r&&s&&l&&d&&c&&p&&h&&(!(null==v?void 0:v.isEVMChain)||m)&&g&&g.length>0&&x&&x.length>0&&y){const o=u.find((e=>e.address.toLowerCase()===i.toLowerCase()&&e.chainId===n)),a=u.find((e=>e.address.toLowerCase()===l.toLowerCase()&&e.chainId===s)),v=new Le(d);if(o&&a&&v.isFinite()&&v.gt(0)){const i=Rs({omniPlan:x,tokenList:u});if(i.includedSteps.length>0){const l=g.reduce(((e,t)=>{var n;return e.plus(null!==(n=t.amountUSD)&&void 0!==n?n:0)}),new Le(0)).dp(4,Le.ROUND_DOWN).toString(),d={key:t,id:t,fromChainId:n,toChainId:s,fromToken:o,toToken:a,fromAmount:r,toTokenAmount:v.div(`1e${a.decimals}`),fromAddress:c,toAddress:p,product:"zetachain",slippage:h,roundedRouteCostTime:0,spenderContractAddress:null!=m?m:null,feeUSD:l,fees:g,executionDuration:null,step:i,encodeParams:y,productParams:null,sourceRoute:f.cross_chain_swap_zetachain_routes};e.push(d)}}}return e.length>0?{status:Ms.Success,bridgeRouteList:e}:{status:Ms.Failed,bridgeRouteList:[]}}return{status:Ms.Initial,bridgeRouteList:[]}}),[y,x,f,u]);return{status:b,failedReason:j,refetch:v,bridgeRouteList:C}}({toToken:N,fromToken:B,fromAmount:R,fromAccount:K,toAccount:J,enabled:!H&&!be,slippage:ue}),Ie=Z((()=>{if(Te&&Te.length>0)return Te[0]}),[Te]),{isApproving:Oe,isGetApproveLoading:Re,needApprove:Me,insufficientBalance:_e,submitApprove:Pe,getMaxBalance:Be}=cc(B,{amount:R,contractAddress:null!==(r=null==Ie?void 0:Ie.spenderContractAddress)&&void 0!==r?r:void 0}),De=z((()=>{Xe(Be())}),[Be]),Ne=Z((()=>!(!(null==K?void 0:K.appKitAccount.address)||_e||Oe||Re||Me)),[null==K?void 0:K.appKitAccount.address,_e,Oe,Re,Me]),{status:Fe,rawBrief:Ue,executeSwap:qe}=Jd({toToken:N,fromToken:B,marginAmount:re,fromAmount:R,toAmount:_,estimateGas:Ne,isReverseRouting:T,slippage:ae,slippageLoading:ce}),{resAmount:Ve,priceImpact:We,baseFeeAmount:He,additionalFeeAmount:Ze,resPricePerToToken:ze,resPricePerFromToken:$e,routeInfo:Ge}=Z((()=>Ue||{resAmount:null,priceImpact:null,baseFeeAmount:null,additionalFeeAmount:null,resPricePerToToken:null,resPricePerFromToken:null,routeInfo:null}),[Ue]),Ye=Td(ne),Xe=z((e=>{const t=e.toString();I(t),ee(t)}),[I,ee]),Ke=z((e=>{const t=e.toString();L(t),te(t)}),[L,te]),Je=z((e=>D((t=>{var i;const o="function"==typeof e?e(t):e;return w||jd.setState({fromTokenChainId:null!==(i=null==o?void 0:o.chainId)&&void 0!==i?i:void 0}),n&&o&&o!==t&&n(o),o}))),[n,w]),et=z((e=>F((t=>{const n="function"==typeof e?e(t):e;return o&&n&&n!==t&&o(n),n}))),[o]);!function({fromToken:e,toToken:t,setFromToken:n,setToToken:i,updateFromAmt:o,updateToAmt:r,setIsReverseRouting:a}){const{tokenList:s}=Ls(),{crossChain:l,defaultFromToken:d,defaultToToken:c,onlyChainId:u}=On(),{chainId:p}=hd(),h=z((()=>{let h,m=null;const g=l?void 0:null!=u?u:p;if(!e){const e=tc({side:"from",defaultToken:d,tokenList:s,chainId:g});m=e.findToken,h=e.setDefaultAmount,m&&(n(m),void 0!==h&&(a(!1),o(h)))}if(!t){const{findToken:e,setDefaultAmount:t}=tc({side:"to",defaultToken:c,tokenList:s,occupyToken:m,chainId:g});e&&(i(e),void 0===h&&void 0!==t&&(a(!0),r(t)))}}),[p,l,d,c,e,u,n,a,i,t,s,o,r]);Y((()=>{const e=setTimeout((()=>{h()}),10);return()=>clearTimeout(e)}),[h])}({fromToken:B,toToken:N,setFromToken:Je,setToToken:et,updateFromAmt:Xe,updateToAmt:Ke,setIsReverseRouting:E});const tt=z((()=>{Xe(""),Ke(""),Je(N),et(B),gs("from",N),gs("to",B)}),[Je,N,et,B,Xe,Ke]),nt=z(((e,t)=>{if(t)return tt();Xe(""),Ke(""),Je(e),gs("from",e)}),[tt,Xe,Ke,Je,gs]),it=z(((e,t)=>{if(t)return tt();Xe(""),Ke(""),et(e),gs("to",e)}),[tt,Xe,Ke,Je,gs]),ot=z((()=>{T&&Xe(""),E(!1)}),[T,Xe]),rt=z((()=>{T||Ke(""),E(!0)}),[T,Ke]),at=(e=>{const{defaultSlippage:t}=ec(void 0===e),n=jd((e=>e.slippage||t));return Z((()=>(void 0===e?Number(n):e)>5),[n,e])})(ne?void 0:ae),st=Z((()=>(100*Number(We)).toFixed(2)),[We]),lt=Z((()=>{const e=T?Ve:R;return e&&oe?new Le(oe).multipliedBy(e):null}),[oe,R,T,Ve]),dt=Z((()=>{var e;if(!ie||void 0===ne)return null;if(ne)return(null===(e=null==Ie?void 0:Ie.toTokenAmount)||void 0===e?void 0:e.gt(0))?Ie.toTokenAmount.multipliedBy(ie):null;const t=T?_:Ve;return t?new Le(ie).multipliedBy(t):null}),[ie,_,T,Ve,Ie,ne]),ct=Z((()=>In.jsxs(i,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[In.jsx(im,{title:In.jsx(e,{id:"4kY4C4",message:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),In.jsxs(i,{sx:{display:"flex"},children:[In.jsx(e,{id:"6+mYrD",message:"Current price impact"}),In.jsxs(i,{sx:{color:g.palette.error.main,ml:4},children:[st,"%"]})]})]})),[st,g.palette.error.main]),ut=Z((()=>In.jsx(Km,{toToken:N,fromToken:B,priceStatus:Fe,pricePerToToken:ze,pricePerFromToken:$e,routeInfo:Ge})),[N,B,Fe,ze,$e,Ge]),pt=Z((()=>!de[(null==B?void 0:B.chainId)||1]),[null==B?void 0:B.chainId]),ht=Z((()=>{if(!B)return!1;const e=C(B.chainId);return!!e&&(!!e.chain.isEVMChain&&(!!w&&!!(null==B?void 0:B.chainId)&&(null==B?void 0:B.chainId)!==w))}),[w,B,C]),mt=function({fromToken:e,toToken:t}){const n=Ls(Os);return Z((()=>!(!e||n.some((t=>t.chainId===e.chainId&&t.address===e.address&&(!t.side||"to"===t.side))))||!(!t||n.some((e=>e.chainId===t.chainId&&e.address===t.address&&(!e.side||"from"===e.side))))),[e,t,n])}({fromToken:B,toToken:N}),gt=Z((()=>at&&new Le(T?_:R).gt(0)&&!_e&&(ne?Ee===Kd.Success:Fe===Kd.Success)?In.jsxs(i,{sx:{textAlign:"center",mb:8},children:[In.jsx(i,{component:Un.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),le._({id:"//95jS",message:"The current slippage protection coefficient set exceeds {maxSlippageWarning}%, which may result in losses.",values:{maxSlippageWarning:5}})]}):null),[at,T,R,_,ne,Ee,Fe]),ft=Z((()=>ht?In.jsxs(i,{sx:{textAlign:"center"},children:[In.jsx(i,{component:Un.Warn,sx:{position:"relative",top:2,mr:6,width:16,height:16,color:"warning.main"}}),In.jsx(e,{id:"54ffaC",message:"The current network is inconsistent with the wallet - please switch in wallet"})]}):ne&&Ee===Kd.Initial?"-":Fe===Kd.Loading||ne&&Ee===Kd.Loading?In.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:In.jsxs(In.Fragment,{children:[In.jsx(O,{sx:{mr:5}}),In.jsx(e,{id:"JdNn1Y",message:"Fetching best price..."})]})}):pt?In.jsxs(In.Fragment,{children:[In.jsx(i,{component:Un.Warn,sx:{mr:6,width:16,color:"warning.main"}}),In.jsx(e,{id:"udsWDJ",message:"Unsupported network - switch to trade"})]}):ne&&Te.length?In.jsxs(In.Fragment,{children:[gt,In.jsx(xp,{route:Ie})]}):ne&&(Ee===Kd.Success&&!Te.length||Ee===Kd.Failed)&&A?In.jsxs(In.Fragment,{children:[In.jsx(i,{component:Un.Warn,sx:{width:15,mr:5,color:"warning.main"}}),In.jsx(e,{id:"NVAuTg",message:"Quote not available"})]}):In.jsxs(In.Fragment,{children:[!ne&&A&&new Le(st).gt(vs)&&ct,gt,ut]})),[Fe,ut,A,ct,st,pt,ne,Ee,Te,Ie,ht,gt]),xt=Z((()=>T?new Le(S).gt(0)?Ps({input:Ve,decimals:null==B?void 0:B.decimals}):"-":A),[A,S,Ve,B,T]),yt=Z((()=>{var e;return T?S:ne?(null===(e=null==Ie?void 0:Ie.toTokenAmount)||void 0===e?void 0:e.gt(0))&&Ee!==Kd.Loading?Ps({input:Ie.toTokenAmount,decimals:null==N?void 0:N.decimals}):"-":new Le(A).gt(0)?Ps({input:Ve,decimals:null==N?void 0:N.decimals}):"-"}),[A,S,Ve,N,T,Ie,ne,Ee]),vt=Z((()=>{var t,n;if(!(null===(t=null==K?void 0:K.appKitAccount)||void 0===t?void 0:t.isConnected))return In.jsx(c,{fullWidth:!0,onClick:()=>{var e;if(!(null==B?void 0:B.chainId))return;const t=null===(e=us.get(B.chainId))||void 0===e?void 0:e.caipNetwork;if(!t)return;const n=Se.getChainNamespace(t);b({namespace:n})},children:In.jsx(e,{id:"4g7eC1",message:"Connect to {0} wallet",values:{0:ld(null==B?void 0:B.chainId)}})});if(K.chain.isEVMChain&&K.chain.chainId!==w)return In.jsx(c,{fullWidth:!0,onClick:()=>{k.switchNetwork(K.chain.caipNetwork)},children:In.jsx(e,{id:"1+P9RR",message:"Switch to {0}",values:{0:K.chain.name}})});if(K.chain.isSolanaChain&&K.chain.chainId!==w)return In.jsx(c,{fullWidth:!0,onClick:()=>{k.switchNetwork(K.chain.caipNetwork)},children:In.jsx(e,{id:"1+P9RR",message:"Switch to {0}",values:{0:K.chain.name}})});if(!(null===(n=null==J?void 0:J.appKitAccount)||void 0===n?void 0:n.isConnected))return In.jsx(c,{fullWidth:!0,onClick:()=>{var e;if(!(null==N?void 0:N.chainId))return;const t=null===(e=us.get(N.chainId))||void 0===e?void 0:e.caipNetwork;if(!t)return;const n=Se.getChainNamespace(t);b({namespace:n})},children:In.jsx(e,{id:"4g7eC1",message:"Connect to {0} wallet",values:{0:ld(null==N?void 0:N.chainId)}})});if(f)return In.jsx(c,{fullWidth:!0,isLoading:!0,disabled:!0,children:In.jsx(e,{id:"FRBvjQ",message:"Transaction Pending"})});if(!B||!N)return In.jsx(c,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:In.jsx(e,{id:"KlvBGJ",message:"Select Tokens"})});if(!new Le(T?_:R).gt(0))return In.jsx(c,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:In.jsx(e,{id:"iPMIoT",message:"Enter an amount"})});if(ne?Ee===Kd.Loading||Re:Fe===Kd.Loading)return In.jsx(c,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:In.jsx(e,{id:"OauUE6",message:"Fetching Price..."})});let o=!1;return o=ne?!Te.length||Ee===Kd.Failed:!Ve||Fe===Kd.Failed,o?In.jsx(c,{fullWidth:!0,disabled:!0,children:In.jsx(e,{id:"NVAuTg",message:"Quote not available"})}):_e?In.jsx(c,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:In.jsx(e,{id:"znqB4T",message:"Insufficient balance"})}):Me?In.jsx(c,{fullWidth:!0,disabled:Oe,onClick:()=>Pe(),children:Oe?In.jsx(e,{id:"j2Uisd",message:"Approving"}):In.jsx(e,{id:"Z7ZXbT",message:"Approve"})}):ne?In.jsx(c,{fullWidth:!0,onClick:()=>{var e,t;return ke({selectedRoute:Ie,fromEtherTokenBalance:null!==(t=null===(e=xe.data)||void 0===e?void 0:e.balance)&&void 0!==t?t:null,goNext:()=>G(!0)})},"data-testid":Ts,disabled:!Ie,isLoading:be,children:In.jsx(e,{id:"SXnevP",message:"Review Cross Chain"})}):he?In.jsxs(c,{fullWidth:!0,onClick:()=>q(!0),"data-testid":Ts,children:[In.jsx(l,{placement:"top",onlyHover:!0,maxWidth:240,title:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:4},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:500,color:"text.primary"},children:"Privacy Swap is Enabled"}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:"text.secondary"},children:"Your transactions on the Ethereum network will be protected from sandwich attacks."})]}),children:In.jsx(i,{sx:{mr:8},children:In.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"30",viewBox:"0 0 25 30",fill:"none",children:[In.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"}),In.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"}),In.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"})]})})}),In.jsx(e,{id:"K/Ay/d",message:"Review Swap"})]}):In.jsx(c,{fullWidth:!0,onClick:()=>q(!0),"data-testid":Ts,children:In.jsx(e,{id:"K/Ay/d",message:"Review Swap"})})}),[null===(s=null==K?void 0:K.appKitAccount)||void 0===s?void 0:s.isConnected,null==K?void 0:K.chain.isEVMChain,null==K?void 0:K.chain.chainId,null==K?void 0:K.chain.isSolanaChain,null==K?void 0:K.chain.name,null==K?void 0:K.chain.caipNetwork,w,null===(u=null==J?void 0:J.appKitAccount)||void 0===u?void 0:u.isConnected,f,B,N,T,_,R,ne,Ee,Re,Fe,_e,Me,b,k,Te.length,Ve,Oe,Pe,Ie,be,ke,null===(p=xe.data)||void 0===p?void 0:p.balance,he]),bt=Z((()=>B&&N?In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{token:B,width:16,height:16,marginRight:6,chainId:B.chainId,noShowChain:!!y}),`${Ps({input:T?Ve:R,decimals:null==B?void 0:B.decimals})} ${null==B?void 0:B.symbol}`,In.jsx(i,{component:Un.DoubleRight,sx:{width:12,height:12,mx:16}}),In.jsx(Fc,{token:N,width:16,height:16,marginRight:6,chainId:N.chainId,noShowChain:!!y}),`${Ps({input:T?_:Ve,decimals:null==N?void 0:N.decimals})} ${null==N?void 0:N.symbol}`]}):In.jsx(i,{})),[B,N,R,_,Ve,T,y]);return In.jsxs(i,{sx:{width:"100%",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",borderRadius:16,backgroundColor:g.palette.background.skeleton,[g.breakpoints.up("laptop")]:{width:450,backgroundColor:g.palette.background.skeleton,backdropFilter:"blur(4px)"}},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",px:16,py:20},children:[In.jsx(i,{sx:{typography:"caption",color:g.palette.text.primary},children:"Universal Swap"}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",borderRadius:4,p:1,backgroundColor:g.palette.background.tag},children:[In.jsxs(i,{sx:{color:g.palette.text.secondary,typography:"h6",px:6,py:4},children:[ne?(null==Ie?void 0:Ie.slippage)?100*Ie.slippage:null!=ue?ue:"-":ae,"%"]}),In.jsx(l,{open:Ye,title:ne?In.jsx(e,{id:"qLkska",message:"The setting has been switched to cross chain mode"}):In.jsx(e,{id:"NSCBTb",message:"The setting has been switched to swap mode"}),placement:"bottom-end",children:In.jsx(i,{component:d,onClick:()=>W(!0),sx:{p:4,backgroundColor:g.palette.background.paper,borderRadius:4,height:28,width:28,display:"flex",alignItems:"center",justifyContent:"center"},children:In.jsx(i,{component:Un.Setting,sx:{width:20,height:20,color:"text.primary",cursor:"pointer"}})})})]})]}),In.jsxs(i,{sx:{flex:1,px:16,pb:20,overflowY:"auto"},children:[In.jsxs(i,{children:[In.jsx(Ym,{sx:{mb:4},token:B,side:"from",amt:xt,defaultLoadBalance:!0,onMaxClick:De,onInputChange:Xe,onInputFocus:ne?void 0:ot,showMaxBtn:!T&&!A,occupiedAddrs:[null!==(h=null==N?void 0:N.address)&&void 0!==h?h:""],occupiedChainId:null==N?void 0:N.chainId,fiatPriceTxt:lt?`$${_s({input:lt,showDecimals:1})}`:"$-",onTokenChange:nt,readOnly:T,showChainLogo:!y,showChainName:!y,notTokenPickerModal:!v,enterAddressEnabled:!1,inputToAddress:Q,setInputToAddress:X,account:K,failedReason:Ae}),In.jsx(Sm,{onClick:tt,disabled:mt}),In.jsx(Ym,{token:N,side:"to",amt:yt,onInputChange:Ke,onInputFocus:ne?void 0:rt,occupiedAddrs:[null!==(m=null==B?void 0:B.address)&&void 0!==m?m:""],occupiedChainId:null==B?void 0:B.chainId,fiatPriceTxt:dt?`$${_s({input:dt,showDecimals:1})}(${st}%)`:"$-",onTokenChange:it,readOnly:ne||!T,showChainLogo:!y,showChainName:!y,notTokenPickerModal:!v,enterAddressEnabled:ne,inputToAddress:Q,setInputToAddress:X,account:J,sx:{padding:g.spacing(24,20,20)}}),In.jsx(i,{sx:{py:16,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:ft})]}),vt,In.jsx(sm,{}),x?"":In.jsxs(i,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:g.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[In.jsx(i,{sx:{width:18,height:18,transform:"translate(1px, 2px)","& path":{fill:g.palette.text.disabled}},component:Un.Dodo}),In.jsx(e,{id:"QIsI8+",message:"Powered by ZUNO protocol"})]})]}),In.jsx(lm,{toToken:N,fromToken:B,fromAmount:T?Ve:R,toAmount:T?_:Ve,open:U,baseFeeAmount:He,priceImpact:st,additionalFeeAmount:Ze,curToFiatPrice:dt,execute:()=>qe(bt),clearFromAmt:()=>Xe(""),clearToAmt:()=>Ke(""),curFromFiatPrice:lt,pricePerFromToken:$e,onClose:()=>q(!1),loading:Fe===Kd.Loading,slippage:ae,isDialogModal:v}),ne?In.jsx(cm,{open:V,onClose:()=>W(!1),isBridge:!0,isDialogModal:v}):In.jsx(Im,{open:V,onClose:()=>W(!1),fromToken:B,toToken:N,privacySwapEnableAble:me,privacySwapEnable:he,privacySwapSupplierEndpoints:pe,endpointStatusMap:ge,refetchEndpointStatus:fe,isDialogModal:v}),In.jsx(rm,{open:H,onClose:()=>G(!1),route:Ie,bridgeOrderTxRequest:we,clearFromAmt:()=>Xe(""),clearToAmt:()=>Ke(""),isDialogModal:v}),In.jsx(am,{message:je,onClose:()=>Ce(""),isDialogModal:v})]})}const eg=[.25,.5,.75,1];function tg({value:e,onChange:t,sx:n}){const o=a(),r="light"===o.palette.mode,{isMobile:s}=Sd();return In.jsx(i,{sx:Object.assign({display:"grid",gap:s?10:14,gridTemplateColumns:`repeat(${eg.length}, 1fr)`},n),children:eg.map((n=>{const i=n===e;return In.jsxs(d,{disabled:!t,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(o.palette.text.primary,.2)},"&.selected, &:focus":{color:"#fff",backgroundColor:r?o.palette.primary.main:T(o.palette.text.primary,.4)}},onClick:()=>{!i&&t&&t(n)},className:i?"selected":void 0,children:[100*n,"%"]},n)}))})}function ng(){return a(),In.jsx(i,{sx:{height:4,position:"relative",color:"text.secondary"},children:In.jsx(i,{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:In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:In.jsx("path",{d:"M19.0142 13H13.0142V19H11.0142V13H5.01416V11H11.0142V5H13.0142V11H19.0142V13Z",fill:"currentColor"})})})})}function ig(){return In.jsx(i,{sx:{position:"relative",height:4},children:In.jsx(i,{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:In.jsx(i,{component:Un.Plus})})})}function og({sx:t,inputSx:n,amt:o,token:r,readOnly:s,showMaxBtn:l,canClickBalance:d,onMaxClick:u,fiatPriceTxt:p,occupiedAddrs:h,occupiedChainId:m,onInputFocus:g,onTokenClick:f,onInputChange:x,onTokenChange:y,side:v,showChainLogo:b,showChainName:j,defaultLoadBalance:C,overrideBalance:w,overrideBalanceLoading:k,balanceText:T,showPercentage:E,inputReadonlyTooltip:A,inputTypography:I,chainId:S,hideToken:L,checkLogBalance:O,notTokenPickerModal:M}){var _,P;const{account:B}=hd(),D=a(),[N,F]=$(!1),U=Qe(Ea.getFetchTokenQuery(null==r?void 0:r.chainId,null==r?void 0:r.address,B)),q=null!==(P=null!=w?w:null===(_=U.data)||void 0===_?void 0:_.balance)&&void 0!==P?P:null,{isTokenLoading:V}=Lm();let W=null!=k?k:U.isLoading;!W&&q&&(O?W=Object.entries(O).some((([e,t])=>V(e,t))):r&&(W=V(r.address,q))),Ed({tokenList:r?[r]:[]});const[H,Z]=$(0),z=G("");Y((()=>{o!==z.current&&Z(0)}),[o]);const{gotoBuyToken:Q}=On();let X=Q&&q&&o&&q.lt(o);const K=!!x||!!A;return In.jsxs(i,{sx:Object.assign({minHeight:K?133:"auto",padding:D.spacing(20,20,24),borderRadius:16,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:D.palette.background.input},t),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[L?In.jsx(i,{}):In.jsx(Mm,{token:r,showChainLogo:b,showChainName:j,onClick:()=>F(!0),readonly:!y}),In.jsx(Om,{balance:q,balanceText:T,onClick:s||!u&&!x?void 0:e=>{u?u(e):x&&x(e),0!==H&&1!==H&&(Z(1),z.current=e)},showMaxBtn:l,canClickBalance:d,address:null==r?void 0:r.address,decimals:null==r?void 0:r.decimals,loading:W})]}),K&&(s&&A?In.jsx(R,{title:A,arrow:!1,children:In.jsx(i,{children:In.jsx(Rm,{value:o,readOnly:!0,withClear:!0,sx:Object.assign({mt:12},n)})})}):In.jsx(Rm,{value:o,onFocus:g,onChange:x?e=>{x(e),Z(0)}:void 0,readOnly:s,withClear:!0,suffix:X?In.jsx(c,{variant:c.Variant.tag,backgroundColor:D.palette.background.paperDarkContrast,sx:{fontSize:12},onClick:e=>{e.stopPropagation(),null==Q||Q({token:r,account:B})},children:In.jsx(e,{id:"qiOIiY",message:"Buy"})}):void 0,typography:I,sx:Object.assign({mt:12},n)})),!s&&E?In.jsx(tg,{sx:{mt:16},value:H,onChange:q&&void 0!==(null==r?void 0:r.decimals)?e=>{if(q&&(null==r?void 0:r.decimals))if(Z(e),1===e){const e=q.toString();u?u(e):x&&x(e),z.current=e}else if(x){const t=q.multipliedBy(e).dp(r.decimals).toString();x(t),z.current=t}}:void 0}):"",void 0!==p?In.jsx(i,{sx:{mt:E?9:0,typography:"h6",color:D.palette.text.secondary},children:p}):"",In.jsx(Zm,{value:r,open:N,side:v,chainId:S,occupiedAddrs:h,occupiedChainId:m,defaultLoadBalance:C,onClose:()=>{F(!1),f&&f()},onTokenChange:(e,t)=>{F(!1),setTimeout((()=>{!Array.isArray(e)&&y&&y(e,t)}),Sc)},modal:!M})]})}var rg;function ag(){return ag=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},ag.apply(null,arguments)}const sg=e=>W.createElement("svg",ag({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),rg||(rg=W.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"}))),lg=e=>Object.keys(new Array(e+1).join(","));function dg(e){return null!=e&&""!==e}var cg;function ug(){return ug=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},ug.apply(null,arguments)}const pg=e=>W.createElement("svg",ug({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),cg||(cg=W.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},W.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"}),W.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)"}),W.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"}),W.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"}),W.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"}),W.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),W.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),W.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"}),W.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),W.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),W.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),W.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),W.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),W.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),W.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)"}),W.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)"}),W.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),W.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"}),W.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},W.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"}),W.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),W.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),W.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"}),W.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),W.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),W.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),W.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),W.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),W.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)"}),W.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),W.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 hg(e){const{switchNetwork:t}=At();return Z((()=>{var n;if(!e)return;const i=null===(n=us.get(e))||void 0===n?void 0:n.caipNetwork;return i?()=>t(i):void 0}),[e,t])}function mg({token:e,size:t="small",sx:n,children:o}){const[r,a]=$(!1),{evmProvider:s,chainId:l}=hd(),d=hg(e.chainId);return In.jsxs(i,{sx:ne({margin:"0",border:"none",padding:"0",background:"none",cursor:"pointer","&:focus":{outline:"none"},"&:active":{outline:"none"},display:"inline-flex",alignItems:"center",justifyContent:"center"},n),onClick:t=>bn(this,void 0,void 0,(function*(){if(t.stopPropagation(),void 0!==e.chainId&&e.chainId!==l&&d)return void(null==d||d());if(r)return;if(!s)return;a(!0);const{result:n,failMsg:i}=yield function(e,t){return bn(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}}}))}(s,e);n?Uh.getState().toast({message:le._({id:"DupCvC",message:"Added successful"}),type:"success",timeout:3e3}):Uh.getState().toast({message:`${le._({id:"v4wgrk",message:"Failed to add"})}${i?`: ${i}`:""}`,type:"error"}),a(!1)})),component:"button",children:[In.jsx(i,{component:pg,sx:Object.assign({},"medium"===t?{width:16,height:16}:{width:14,height:14})}),o]})}function gg({tokens:e,width:t=24,height:n=24,gap:o=-4,cross:r,mr:s,chainId:l,showChainLogo:d,sx:c}){var u;const p=a(),{onlyChainId:h}=On(),m=d&&!h,g=t/2;return!e||e.length<=0?In.jsx(i,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:s,position:"relative",zIndex:0},c),children:In.jsx(i,{component:"svg",xmlns:"http://www.w3.org/2000/svg",width:52,height:24,viewBox:"0 0 52 24",fill:"none",sx:{height:t,width:"auto",color:T(p.palette.text.primary,"light"===p.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:In.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"})})}):In.jsxs(i,{sx:Object.assign({display:"inline-flex",alignItems:"center",mr:s,position:"relative",zIndex:0},c),children:[e.map(((e,n)=>In.jsx(i,{sx:{display:"inline-flex",width:t,height:t,ml:n>0?o:0,borderRadius:"50%",backgroundColor:p.palette.background.default},children:"object"==typeof e?In.jsx(Fc,{address:e.address,width:t,height:t,chainId:l,url:e.logoURI,cross:r,noShowChain:!0,noBorder:!0,marginRight:0}):In.jsx(i,{component:"img",height:t,src:e})},n))),m&&us.has(l)?In.jsx(i,{component:null===(u=us.get(l))||void 0===u?void 0:u.logo,sx:{position:"absolute",bottom:0,right:0,zIndex:e.length+1,transform:"translateX(50%)",width:g,height:g}}):""]})}function fg({loading:e,empty:t,hasSearch:n,children:o,refetch:r}){return e?In.jsx(i,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",gap:24,px:24,height:320},children:lg(4).map(((e,t)=>In.jsx(j,{width:"100%",height:45},t)))}):r?In.jsx(Nn,{refresh:r,sx:{height:320}}):t?In.jsx(Mn,{hasSearch:n,sx:{height:320}}):In.jsx(In.Fragment,{children:o})}function xg({show:e,onClick:t,sx:n}){return In.jsx(i,{component:d,sx:Object.assign({p:3,transform:e?"rotate(180deg)":"none",transition:"all 100ms",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},n),onClick:t,children:In.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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 yg({isMobile:e,statusText:t,statusColor:n,time:o,alphaColor:r,sx:s,children:l}){const d=a(),c=T(n,.1),u=r?T(n,r):n;return In.jsxs(i,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:e?"center":"flex-start",gap:2,typography:"h6",color:"text.secondary"},s),children:[In.jsxs(i,{sx:{padding:d.spacing(4,16),borderRadius:4,backgroundColor:c,color:u,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center"},children:[t,l]}),o]})}function vg({token:e,amount:t,canAddMetamask:n,title:o,linkVisible:r=!0}){var a,s;return In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:2},children:[In.jsxs(i,{sx:{typography:"h6",fontWeight:500,color:"text.primary"},children:[o,": ",Ps({input:t,decimals:null==e?void 0:e.decimals})," ",null==e?void 0:e.symbol]}),n&&e&&In.jsx(mg,{token:e})]}),In.jsxs(i,{sx:{display:"inline-flex",alignItems:"center",gap:4,typography:"h6",fontWeight:500,color:"text.secondary"},children:[e&&null!==(s=null===(a=us.get(e.chainId))||void 0===a?void 0:a.name)&&void 0!==s?s:"-",r&&In.jsx(sg,{})]})]})}function bg({token:e,amount:t,showChain:n,hideLogo:o,canAddMetamask:r,sx:a}){var s,l;let d="";n&&(d=null!==(l=null===(s=us.get(e.chainId))||void 0===s?void 0:s.name)&&void 0!==l?l:"");const c=Ps({input:t,decimals:e.decimals});return In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},a),children:[!o&&In.jsx(Fc,{address:e.address,chainId:e.chainId,width:20,height:20}),In.jsxs(i,{sx:{fontWeight:600},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,wordBreak:"break-word"},children:[`${c} ${e.symbol}`,r&&In.jsx(mg,{token:e})]}),!!d&&In.jsxs(i,{sx:{display:"inline-flex",alignItems:"center",gap:2,typography:"h6",fontWeight:500,color:"text.secondary"},children:[d,In.jsx(sg,{})]})]})]})}function jg({height:t=64,sx:n,onClick:o,hasMore:r,loading:s}){return a(),r?In.jsx(d,{sx:Object.assign({display:"flex",justifyContent:"center",alignItems:"center",height:t,width:"100%",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},n),onClick:o,children:s?In.jsx(O,{}):In.jsxs(In.Fragment,{children:[In.jsx(e,{id:"yQ2kGp",message:"Load more"}),In.jsx(i,{component:Un.ArrowRight,sx:{transform:"rotate(90deg)"}})]})}):null}function Cg(e){var{sx:t,children:n,hasMore:o,loadMore:r,loadMoreLoading:s}=e,l=vn(e,["sx","children","hasMore","loadMore","loadMoreLoading"]);return a(),In.jsxs(i,{sx:Object.assign({position:"relative",flex:1,overflowY:"auto",pt:12,px:20,pb:20},t),...l,children:[In.jsx(i,{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:n}),!!r&&In.jsx(jg,{loading:s,hasMore:o,onClick:r})]})}const wg=new al("properties/5.8.0");function kg(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function Tg(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 Eg={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Ag(e){if(null==e||Eg[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(!Ag(i))return!1}return!0}return wg.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Ig(e){if(Ag(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>Sg(e))));if("object"==typeof e){const t={};for(const n in e){const i=e[n];void 0!==i&&kg(t,n,Sg(i))}return t}return wg.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Sg(e){return Ig(e)}class Lg{constructor(e){for(const t in e)this[t]=Sg(e[t])}}const Og="abi/5.8.0",Rg=new al(Og),Mg={};let _g={calldata:!0,memory:!0,storage:!0},Pg={calldata:!0,memory:!0};function Bg(e,t){if("bytes"===e||"string"===e){if(_g[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Pg[t])return!0;return(_g[t]||"payable"===t)&&Rg.throwArgumentError("invalid modifier","name",t),!1}function Dg(e,t){for(let n in t)kg(e,n,t[n])}const Ng=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Fg=new RegExp(/^(.*)\[([0-9]*)\]$/);class Ug{constructor(e,t){e!==Mg&&Rg.throwError("use fromString",al.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Dg(this,t);let n=this.type.match(Fg);Dg(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Ug.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=Ng.sighash),Ng[e]||Rg.throwArgumentError("invalid format type","format",e),e===Ng.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!==Ng.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ng.full?", ":",")+")"):t+=this.type,e!==Ng.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ng.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Ug.fromString(e,t):Ug.fromObject(e)}static fromObject(e){return Ug.isParamType(e)?e:new Ug(Mg,{name:e.name||null,type:Xg(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Ug.fromObject):null})}static fromString(e,t){return n=function(e,t){let n=e;function i(t){Rg.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=Xg(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=""),Bg(a.type,a.name)&&(a.name=""),a.type=Xg(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=""),Bg(a.type,a.name)&&(a.name=""),a.type=Xg(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=Xg(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=""):Bg(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&&Rg.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=""):Bg(a.type,a.name)&&(a.name=""),r.type=Xg(r.type),r}(e,!!t),Ug.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}}function qg(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&&Rg.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>Ug.fromString(e,t)))}class Vg{constructor(e,t){e!==Mg&&Rg.throwError("use a static from method",al.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Dg(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Vg.isFragment(e)?e:"string"==typeof e?Vg.fromString(e):Vg.fromObject(e)}static fromObject(e){if(Vg.isFragment(e))return e;switch(e.type){case"function":return Gg.fromObject(e);case"event":return Wg.fromObject(e);case"constructor":return $g.fromObject(e);case"error":return Qg.fromObject(e);case"fallback":case"receive":return null}return Rg.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]?Wg.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Gg.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?$g.fromString(e.trim()):"error"===e.split(" ")[0]?Qg.fromString(e.substring(5).trim()):Rg.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Wg extends Vg{format(e){if(e||(e=Ng.sighash),Ng[e]||Rg.throwArgumentError("invalid format type","format",e),e===Ng.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!==Ng.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ng.full?", ":",")+") ",e!==Ng.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Wg.fromString(e):Wg.fromObject(e)}static fromObject(e){if(Wg.isEventFragment(e))return e;"event"!==e.type&&Rg.throwArgumentError("invalid event object","value",e);const t={name:Jg(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ug.fromObject):[],type:"event"};return new Wg(Mg,t)}static fromString(e){let t=e.match(ef);t||Rg.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:Rg.warn("unknown modifier: "+e)}})),Wg.fromObject({name:t[1].trim(),anonymous:n,inputs:qg(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Hg(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&Rg.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||Rg.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=St.from(n[1]),n[0]):e}function Zg(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 zg(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&&Rg.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Rg.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||Rg.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&&Rg.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&&Rg.throwArgumentError("unable to determine stateMutability","value",e),t}class $g extends Vg{format(e){if(e||(e=Ng.sighash),Ng[e]||Rg.throwArgumentError("invalid format type","format",e),e===Ng.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===Ng.sighash&&Rg.throwError("cannot format a constructor for sighash",al.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ng.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?$g.fromString(e):$g.fromObject(e)}static fromObject(e){if($g.isConstructorFragment(e))return e;"constructor"!==e.type&&Rg.throwArgumentError("invalid constructor object","value",e);let t=zg(e);t.constant&&Rg.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ug.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?St.from(e.gas):null};return new $g(Mg,n)}static fromString(e){let t={type:"constructor"},n=(e=Hg(e,t)).match(ef);return n&&"constructor"===n[1].trim()||Rg.throwArgumentError("invalid constructor string","value",e),t.inputs=qg(n[2].trim(),!1),Zg(n[3].trim(),t),$g.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Gg extends $g{format(e){if(e||(e=Ng.sighash),Ng[e]||Rg.throwArgumentError("invalid format type","format",e),e===Ng.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!==Ng.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ng.full?", ":",")+") ",e!==Ng.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?Gg.fromString(e):Gg.fromObject(e)}static fromObject(e){if(Gg.isFunctionFragment(e))return e;"function"!==e.type&&Rg.throwArgumentError("invalid function object","value",e);let t=zg(e);const n={type:e.type,name:Jg(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ug.fromObject):[],outputs:e.outputs?e.outputs.map(Ug.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?St.from(e.gas):null};return new Gg(Mg,n)}static fromString(e){let t={type:"function"},n=(e=Hg(e,t)).split(" returns ");n.length>2&&Rg.throwArgumentError("invalid function string","value",e);let i=n[0].match(ef);if(i||Rg.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Jg(t.name),t.inputs=qg(i[2],!1),Zg(i[3].trim(),t),n.length>1){let i=n[1].match(ef);""==i[1].trim()&&""==i[3].trim()||Rg.throwArgumentError("unexpected tokens","value",e),t.outputs=qg(i[2],!1)}else t.outputs=[];return Gg.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Yg(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Rg.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Qg extends Vg{format(e){if(e||(e=Ng.sighash),Ng[e]||Rg.throwArgumentError("invalid format type","format",e),e===Ng.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ng.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ng.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Qg.fromString(e):Qg.fromObject(e)}static fromObject(e){if(Qg.isErrorFragment(e))return e;"error"!==e.type&&Rg.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Jg(e.name),inputs:e.inputs?e.inputs.map(Ug.fromObject):[]};return Yg(new Qg(Mg,t))}static fromString(e){let t={type:"error"},n=e.match(ef);return n||Rg.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Jg(t.name),t.inputs=qg(n[2],!1),Yg(Qg.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Xg(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Kg=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Jg(e){return e&&e.match(Kg)||Rg.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const ef=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const tf=new al(Og);class nf{constructor(e,t,n,i){this.name=e,this.type=t,this.localName=n,this.dynamic=i}_throwError(e,t){tf.throwArgumentError(e,this.localName,t)}}class of{constructor(e){kg(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+=xl(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(hl(e._data))}writeBytes(e){let t=pl(e);const n=t.length%this.wordSize;return n&&(t=hl([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=pl(St.from(e));return t.length>this.wordSize&&tf.throwError("value out-of-bounds",al.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=hl([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 rf{constructor(e,t,n,i){kg(this,"_data",pl(e)),kg(this,"wordSize",t||32),kg(this,"_coerceFunc",n),kg(this,"allowLoose",i),this._offset=0}get data(){return xl(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):rf.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:tf.throwError("data out-of-bounds",al.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new rf(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 St.from(this.readBytes(this.wordSize))}}class af extends nf{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Sl(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Sl(bl(e.readValue().toHexString(),20))}}class sf extends nf{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 lf=new al(Og);function df(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||lf.throwError("cannot encode object for signature with missing names",al.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[i]&&lf.throwError("cannot encode object for signature with duplicate names",al.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:n}),e[i]=!0,n[i]}))}else lf.throwArgumentError("invalid tuple value","tuple",n);t.length!==i.length&&lf.throwArgumentError("types/value length mismatch","tuple",n);let o=new of(e.wordSize),r=new of(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 cf(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===al.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===al.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 uf extends nf{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)),lf.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 df(e,i,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&lf.throwError("insufficient data length",al.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let n=[];for(let e=0;e<t;e++)n.push(new sf(this.coder));return e.coerce(this.name,cf(e,n))}}class pf extends nf{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 hf extends nf{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=pl(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class mf extends hf{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,xl(super.decode(e)))}}class gf extends nf{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=pl(t);return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return e.coerce(this.name,xl(e.readBytes(this.size)))}}class ff extends nf{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 xf extends nf{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=St.from(t),i=_l.mask(8*e.wordSize);if(this.signed){let e=i.mask(8*this.size-1);(n.gt(e)||n.lt(e.add(Ml).mul(Ol)))&&this._throwError("value out-of-bounds",t)}else(n.lt(Rl)||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 yf extends hf{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Ul(t))}decode(e){return ql(super.decode(e))}}class vf extends nf{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 df(e,this.coders,t)}decode(e){return e.coerce(this.name,cf(e,this.coders))}}const bf=new al(Og),jf=new RegExp(/^bytes([0-9]*)$/),Cf=new RegExp(/^(u?int)([0-9]*)$/);const wf=new class{constructor(e){kg(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new af(e.name);case"bool":return new pf(e.name);case"string":return new yf(e.name);case"bytes":return new mf(e.name);case"array":return new uf(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new vf((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new ff(e.name)}let t=e.type.match(Cf);if(t){let n=parseInt(t[2]||"256");return(0===n||n>256||n%8!=0)&&bf.throwArgumentError("invalid "+t[1]+" bit length","param",e),new xf(n/8,"int"===t[1],e.name)}if(t=e.type.match(jf),t){let n=parseInt(t[1]);return(0===n||n>32)&&bf.throwArgumentError("invalid bytes length","param",e),new gf(n,e.name)}return bf.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new rf(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new of(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Ug.from(e))));return new vf(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&bf.throwError("types/values length mismatch",al.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const n=e.map((e=>this._getCoder(Ug.from(e)))),i=new vf(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}decode(e,t,n){const i=e.map((e=>this._getCoder(Ug.from(e))));return new vf(i,"_").decode(this._getReader(pl(t),n))}};function kf(e){return wl(Ul(e))}const Tf=new al(Og);class Ef extends Lg{}class Af extends Lg{}class If extends Lg{}class Sf extends Lg{static isIndexed(e){return!(!e||!e._isIndexed)}}const Lf={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Of(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return n.error=t,n}class Rf{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,kg(this,"fragments",t.map((e=>Vg.from(e))).filter((e=>null!=e))),kg(this,"_abiCoder",Tg(new.target,"getAbiCoder")()),kg(this,"functions",{}),kg(this,"errors",{}),kg(this,"events",{}),kg(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Tf.warn("duplicate definition - constructor"):void kg(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]?Tf.warn("duplicate definition - "+n):t[n]=e})),this.deploy||kg(this,"deploy",$g.from({payable:!1,type:"constructor"})),kg(this,"_isInterface",!0)}format(e){e||(e=Ng.full),e===Ng.sighash&&Tf.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ng.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return wf}static getAddress(e){return Sl(e)}static getSighash(e){return vl(kf(e.format()),0,4)}static getEventTopic(e){return kf(e.format())}getFunction(e){if(gl(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Tf.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?Tf.throwArgumentError("no matching function","name",t):n.length>1&&Tf.throwArgumentError("multiple matching functions","name",t),this.functions[n[0]]}const t=this.functions[Gg.fromString(e).format()];return t||Tf.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(gl(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Tf.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?Tf.throwArgumentError("no matching event","name",t):n.length>1&&Tf.throwArgumentError("multiple matching events","name",t),this.events[n[0]]}const t=this.events[Wg.fromString(e).format()];return t||Tf.throwArgumentError("no matching event","signature",e),t}getError(e){if(gl(e)){const t=Tg(this.constructor,"getSighash");for(const n in this.errors){if(e===t(this.errors[n]))return this.errors[n]}Tf.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?Tf.throwArgumentError("no matching error","name",t):n.length>1&&Tf.throwArgumentError("multiple matching errors","name",t),this.errors[n[0]]}const t=this.errors[Gg.fromString(e).format()];return t||Tf.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 Tg(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Tg(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=pl(t);return xl(n.slice(0,4))!==this.getSighash(e)&&Tf.throwArgumentError(`data signature does not match error ${e.name}.`,"data",xl(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),xl(hl([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const n=pl(t);return xl(n.slice(0,4))!==this.getSighash(e)&&Tf.throwArgumentError(`data signature does not match function ${e.name}.`,"data",xl(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),xl(hl([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let n=pl(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=xl(n.slice(0,4)),t=Lf[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 Tf.throwError("call revert exception"+o,al.errors.CALL_EXCEPTION,{method:e.format(),data:xl(t),errorArgs:r,errorName:a,errorSignature:s,reason:i})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),xl(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Tf.throwError("too many arguments for "+e.format(),al.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(e,t)=>"string"===e.type?kf(t):"bytes"===e.type?wl(xl(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=St.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),bl(xl(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?Tf.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&&Tf.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&&Tf.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(kf(a));else if("bytes"===e.type)n.push(wl(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);gl(n[0],32)&&n[0].toLowerCase()===t||Tf.throwError("fragment/topic mismatch",al.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(Ug.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,hl(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 Sf({_isIndexed:!0,hash:null});else if(r[t])l[t]=new Sf({_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 Of(`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 Of(`index ${e}`,t)}})}return Object.freeze(l)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Af({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:St.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Ef({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=xl(e);let n=this.getError(t.substring(0,10).toLowerCase());return n?new If({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 Mf({fromToken:e,toToken:t,fromTokenPrice:n,toTokenPrice:o,sx:r,children:s}){const l=a(),[c,u]=$(!1),p=Z((()=>new Le(n&&o?c?o:n:0)),[n,o,c]);return In.jsxs(i,{component:d,sx:Object.assign({display:"flex",alignItems:"center",gap:8,color:"text.primary",typography:"body1",fontWeight:600,"&:hover>svg>path":{fill:l.palette.text.primary}},r),onClick:()=>u((e=>!e)),children:[In.jsxs(i,{children:[s,"1 ",c?t.symbol:e.symbol," = ",p&&p.isFinite()?Ps({input:p,decimals:c?e.decimals:t.decimals}):"-"," ",c?e.symbol:t.symbol]}),In.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[In.jsx("circle",{cx:"9",cy:"9",r:"9",fill:l.palette.border.main}),In.jsx("path",{d:"M9.5 6.5H4.5V8H13.5L9.5 4.25V6.5ZM8.25 13.75V11.5H13.5V10H4.5L8.25 13.75Z",fill:l.palette.text.secondary})]})]})}function _f({showFold:e,isMobile:t,data:n}){const o=a(),r=Z((()=>{var e,t,i,o,r,a,s,l,d,c,u,p,h;return[{title:"Total time spent",value:null!==(i=gc({start:null!==(e=n.startTime)&&void 0!==e?e:void 0,end:null!==(t=n.endTime)&&void 0!==t?t:void 0}))&&void 0!==i?i:"-"},{title:"Pay",value:In.jsx(qm,{address:null!==(o=n.fromAddress)&&void 0!==o?o:"",customChainId:null!==(r=n.routeData.fromChainId)&&void 0!==r?r:de.ZETACHAIN,showCopy:!0,truncate:!0,iconSpace:4,iconSize:14,size:"small"})},{title:"Receive",value:In.jsx(qm,{address:null!==(a=n.toAddress)&&void 0!==a?a:"",customChainId:null!==(s=n.routeData.toChainId)&&void 0!==s?s:de.ZETACHAIN,showCopy:!0,truncate:!0,iconSpace:4,iconSize:14,size:"small"})},{title:In.jsxs(In.Fragment,{children:["Fill Gas (Destination gas)",In.jsx(im,{onlyHover:!0,title:"-",ml:0})]}),value:`$${null!==(c=null===(d=null===(l=n.fees)||void 0===l?void 0:l.find((e=>"destinationFee"===e.type)))||void 0===d?void 0:d.amountUSD)&&void 0!==c?c:"-"}`},{title:In.jsxs(In.Fragment,{children:["Bridge Fee",In.jsx(im,{onlyHover:!0,title:"-",ml:0})]}),value:`$${null!==(h=null===(p=null===(u=n.fees)||void 0===u?void 0:u.find((e=>"platformFee"===e.type)))||void 0===p?void 0:p.amountUSD)&&void 0!==h?h:"-"}`}]}),[n.endTime,n.fees,n.fromAddress,n.routeData.fromChainId,n.routeData.toChainId,n.startTime,n.toAddress]);return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:16,p:e?16:0,borderBottomLeftRadius:8,borderBottomRightRadius:8,background:`linear-gradient(0deg, ${o.palette.background.skeleton} 0%, ${o.palette.background.skeleton} 100%), ${o.palette.background.paper}`,maxHeight:e?"auto":0,transition:"all 300ms",overflow:"hidden",[o.breakpoints.up("tablet")]:{marginTop:"-4px",marginBottom:"4px",gap:24}},children:[In.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:8,[o.breakpoints.up("tablet")]:{alignItems:"center",flexDirection:"row",gap:20}},children:r.map(((e,t)=>In.jsxs(i,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",[o.breakpoints.up("tablet")]:{flexBasis:"20%",flexGrow:1,flexShrink:1,flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",gap:4}},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.secondary",typography:"h6"},children:e.title}),In.jsx(i,{sx:{display:"flex",alignItems:"center",color:"text.primary",typography:"body2"},children:e.value})]},t)))}),null!=n.routeData.fromChainId&&null!=n.routeData.toChainId&&In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{height:"1px",width:"100%",backgroundColor:"border.disabled"}}),In.jsx(gp,{route:{fromChainId:n.routeData.fromChainId,toChainId:n.routeData.toChainId,step:n.routeData.step},isMobile:t})]})]})}function Pf({data:e,isMobile:t,isErrorRefund:n,refetch:o}){var r,s,d,u,p,h,m,g,f,x;const y=a(),v=Wd(),{chainId:b,appKitActiveNetwork:j,getAppKitAccountByChainId:C}=hd(),{statusText:w,statusColor:k,statusAlphaColor:T}=Z((()=>{let t="Loading",n=y.palette.text.primary;switch(e.status){case"pending":t="Pending",n=y.palette.text.secondary;break;case"success":t="Succeeded",n=y.palette.success.main;break;case"failure_revert":t="Failed",n=y.palette.error.main;break;case"abort":t="Aborted",n=y.palette.error.main}return{statusText:t,statusColor:n,statusAlphaColor:undefined}}),[e.status,y.palette.error.main,y.palette.success.main,y.palette.text.primary,y.palette.text.secondary]),[E,A]=H.useState(!1),I=e.createdAt?xc(new Date(e.createdAt)):"-",S=Je({mutationFn:()=>bn(this,void 0,void 0,(function*(){if(!e.externalId||!e.refundCridgeContract)return;if(b!==e.refundChainId){const t=C(e.refundChainId);if(!t)return;j.switchNetwork(t.chain.caipNetwork)}const t=new Rf([{inputs:[{internalType:"bytes32",name:"externalId",type:"bytes32"}],name:"claimRefund",outputs:[],stateMutability:"nonpayable",type:"function"}]).encodeFunctionData("claimRefund",[e.externalId]);return yield v.execute("Claim",{opcode:Dd.TX,data:t,to:e.refundCridgeContract,value:"0x0"},{metadata:{crossChainSwapClaimRefund:!0},submittedBack:()=>{o()},successBack:()=>{o()}})}))});return Z((()=>In.jsxs(c,{variant:c.Variant.contained,size:c.Size.small,color:"error",isLoading:S.isPending,disabled:S.isPending||"wait_claim_refund"!==e.subStatus,onClick:()=>{S.mutate()},sx:{typography:"h6",lineHeight:"16px",py:6,minWidth:98,height:28},children:["refund_success"===e.subStatus?"Claimed":"Claim","wait_claim_refund"!==e.subStatus&&In.jsx(im,{onlyHover:!0,title:e.subStatus,ml:4,sx:{color:y.palette.text.disabled}})]})),[S,e.subStatus,y.palette.text.disabled]),t?In.jsxs(i,{sx:{backgroundColor:y.palette.background.paper,borderRadius:8},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",p:16,gap:16},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{width:24,height:24,address:null===(r=e.fromToken)||void 0===r?void 0:r.address,chainId:null===(s=e.fromToken)||void 0===s?void 0:s.chainId}),In.jsx(i,{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:In.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"})}),In.jsx(Fc,{width:24,height:24,address:null===(d=e.toToken)||void 0===d?void 0:d.address,chainId:null===(u=e.toToken)||void 0===u?void 0:u.chainId})]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:8},children:In.jsx(yg,{isMobile:!1,statusText:w,statusColor:k,alphaColor:T,children:"success"!==e.status&&In.jsx(im,{onlyHover:!0,title:e.subStatus,ml:4,sx:{color:k}})})})]}),In.jsx(i,{sx:{typography:"h6",color:y.palette.text.secondary},children:I})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[In.jsx(vg,{token:e.fromToken,amount:e.fromAmount,canAddMetamask:!1,title:"Pay",linkVisible:!1}),In.jsx(vg,{token:e.toToken,amount:e.toAmount,canAddMetamask:e.fromToken&&null!==(h=null===(p=us.get(e.fromToken.chainId))||void 0===p?void 0:p.isEVMChain)&&void 0!==h&&h,title:"Receive",linkVisible:!1})]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:2,borderRadius:8,border:`1px solid ${y.palette.border.main}`},children:In.jsx(xg,{show:E,onClick:()=>A((e=>!e)),sx:{color:"text.secondary"}})})]})]}),In.jsx(_f,{showFold:E,data:e,isMobile:t})]}):In.jsxs(In.Fragment,{children:[In.jsxs("tr",{children:[In.jsx(i,{component:"td",sx:{borderTopLeftRadius:8,borderBottomLeftRadius:E?0:8},children:e.fromToken&&In.jsx(bg,{token:e.fromToken,amount:null!==(m=e.fromAmount)&&void 0!==m?m:"",showChain:!0})}),In.jsx("td",{children:e.toToken&&In.jsx(bg,{token:e.toToken,amount:null!==(g=e.toAmount)&&void 0!==g?g:"",showChain:!0,canAddMetamask:null!==(x=null===(f=us.get(e.toToken.chainId))||void 0===f?void 0:f.isEVMChain)&&void 0!==x&&x})}),In.jsx("td",{children:In.jsx(yg,{isMobile:t,statusText:w,statusColor:k,alphaColor:T,time:I,children:"success"!==e.status&&In.jsx(im,{onlyHover:!0,title:e.subStatus,ml:4,sx:{color:k}})})}),n?null:In.jsx("td",{children:e.fromToken&&e.toToken&&In.jsx(Mf,{fromToken:e.fromToken,toToken:e.toToken,fromTokenPrice:e.fromTokenPrice,toTokenPrice:e.toTokenPrice})}),In.jsx(i,{component:"td",sx:{borderTopRightRadius:8,borderBottomRightRadius:E?0:8},children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8},children:["refund_success"===e.subStatus&&In.jsxs(In.Fragment,{children:[In.jsx(l,{title:"refund TX",placement:"top",onlyHover:!0,children:In.jsx(i,{component:"a",href:e.refundChainId&&e.refundHash?ad(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:In.jsx(i,{component:Un.ArrowTopRightBorder,sx:{width:18,height:18}})})}),In.jsx(i,{sx:{height:16,width:"1px",backgroundColor:"border.main"}})]}),In.jsx(xg,{show:E,onClick:()=>A((e=>!e))})]})})]}),In.jsx("tr",{children:In.jsx(i,{component:"td",colSpan:5,sx:{p:"0 !important",backgroundColor:"transparent !important"},children:In.jsx(_f,{showFold:E,data:e})})})]})}function Bf({account:t,type:n}){const{isMobile:o}=Sd(),r=function({account:e,limit:t=5,type:n}){var i;const{tokenList:o}=Ls(),r=vd().getInfiniteQuery(ye.graphql.cross_chain_swap_zetachain_orderList,"page",{where:{user:e,pageSize:t,type:n}}),a=nt(Object.assign(Object.assign({},r),{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}})),s=Z((()=>{var e,t,n,i;return null!==(i=null===(n=null===(t=null===(e=a.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=o.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=o.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 Le(e.fromAmount).div(10**t.decimals).dp(t.decimals,Le.ROUND_DOWN):null,r=(null==e?void 0:e.toAmount)&&n?new Le(e.toAmount).div(10**n.decimals).dp(n.decimals,Le.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:r,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:Rs({omniPlan:null==e?void 0:e.omniPlan,tokenList:o})},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&&r&&t?r.div(i).dp(t.decimals,Le.ROUND_DOWN).toString():null,toTokenPrice:i&&r&&n?i.div(r).dp(n.decimals,Le.ROUND_DOWN).toString():null}})))&&void 0!==i?i:[]}),[null===(i=a.data)||void 0===i?void 0:i.pages,o]);return Object.assign(Object.assign({},a),{orderList:s})}({account:t,limit:o?10:5,type:n}),a="error_refund"===n;return In.jsx(fg,{isMobile:o,empty:!r.orderList.length,loading:r.isLoading,children:o?In.jsxs(i,{sx:{pt:12,px:16,display:"flex",flexDirection:"column",gap:8},children:[r.orderList.map((e=>In.jsx(Pf,{data:e,isMobile:o,isErrorRefund:a,refetch:r.refetch},e.hash))),In.jsx(jg,{loading:r.isFetchingNextPage,onClick:r.fetchNextPage,hasMore:r.hasNextPage,height:68})]}):In.jsx(In.Fragment,{children:In.jsxs(Cg,{loadMoreLoading:r.isFetchingNextPage,loadMore:r.fetchNextPage,hasMore:r.hasNextPage,children:[In.jsx("thead",{children:In.jsxs("tr",{children:[In.jsx("th",{children:In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:8},children:In.jsx(e,{id:"4fL/V7",message:"Pay"})})}),In.jsx("th",{children:In.jsx(e,{id:"lDgVWA",message:"Receive"})}),In.jsx("th",{children:In.jsx(e,{id:"uAQUqI",message:"Status"})}),a?null:In.jsx("th",{children:In.jsx(e,{id:"fqDzSu",message:"Rate"})}),In.jsx(i,{component:"th",sx:{width:140,textAlign:"right !important"},children:In.jsx(e,{id:"URmyfc",message:"Details"})})]})}),In.jsx("tbody",{children:r.orderList.map((e=>In.jsx(Pf,{data:e,isMobile:o,isErrorRefund:a,refetch:r.refetch},e.hash)))})]})})})}function Df({account:e,limit:t=5}){var n,i,o,r;const a=void 0,s=vd().getInfiniteQuery(ye.graphql.cross_chain_swap_zetachain_swapOrderList,"page",{where:{userAddress:null==e?void 0:e.toLowerCase(),pageSize:t}}),l=nt(Object.assign(Object.assign({},s),{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}})),d=null!==(r=null===(o=null===(i=null===(n=l.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,s,l,d,c,u,p,h,m,g,f,x,y,v,b;let j="";const C=null!==(i=null===(n=null==t?void 0:t.extra)||void 0===n?void 0:n.safeTxHash)&&void 0!==i?i:void 0;return C&&a&&e&&(j=a(C,null==t?void 0:t.chainId,e)),{hash:null!==(o=null==t?void 0:t.hash)&&void 0!==o?o:"",fromToken:pd({address:null!==(r=null==t?void 0:t.fromTokenAddress)&&void 0!==r?r:"",decimals:null==t?void 0:t.fromTokenDecimals,symbol:null!==(s=null==t?void 0:t.fromTokenSymbol)&&void 0!==s?s:"",name:null!==(l=null==t?void 0:t.fromTokenSymbol)&&void 0!==l?l:""},null==t?void 0:t.chainId),toToken:pd({address:null!==(d=null==t?void 0:t.toTokenAddress)&&void 0!==d?d:"",decimals:null==t?void 0:t.toTokenDecimals,symbol:null!==(c=null==t?void 0:t.toTokenSymbol)&&void 0!==c?c:"",name:null!==(u=null==t?void 0:t.toTokenSymbol)&&void 0!==u?u:""},null==t?void 0:t.chainId),fromAmount:(null==t?void 0:t.fromAmount)&&String(t.fromTokenDecimals)?new Le(t.fromAmount).div(10**t.fromTokenDecimals):null,toAmount:null!==(p=null==t?void 0:t.toAmount)&&void 0!==p?p:"",minAmount:null!==(h=null==t?void 0:t.minAmount)&&void 0!==h?h:"",fromTokenPrice:null!==(m=null==t?void 0:t.fromTokenPrice)&&void 0!==m?m:"",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!==(y=null===(x=null==t?void 0:t.extra)||void 0===x?void 0:x.routeData)&&void 0!==y?y:"",safeTxHash:C,safeTxUrl:j,status:null!==(v=null==t?void 0:t.status)&&void 0!==v?v:"",transactionHash:null===(b=null==t?void 0:t.extra)||void 0===b?void 0:b.transactionHash}})))&&void 0!==r?r:[];return Object.assign(Object.assign({},l),{orderList:d})}var Nf,Ff;function Uf({showFold:t,isMobile:n,data:o}){const r=a(),{routeData:s}=Qm({rawRouteData:o.routeData,chainId:o.fromToken.chainId}),l=Z((()=>o.fromTokenPrice?new Le(o.fromTokenPrice):new Le(0)),[o.fromTokenPrice]);return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:24,p:t?16:0,borderBottomLeftRadius:8,borderBottomRightRadius:8,background:`linear-gradient(0deg, ${r.palette.background.skeleton} 0%, ${r.palette.background.skeleton} 100%), ${r.palette.background.paper}`,maxHeight:t?400:0,transition:"all 300ms",overflow:"hidden",[r.breakpoints.up("tablet")]:{marginTop:"-4px",marginBottom:"4px"}},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"h6",color:r.palette.text.secondary},children:[In.jsx(e,{id:"URmyfc",message:"Details"}),n&&In.jsxs(i,{children:["Rate: 1 ",o.fromToken.symbol,"=",l&&l.isFinite()?Ps({input:l,decimals:o.toToken.decimals}):"-"," ",o.toToken.symbol]})]}),n?In.jsx($c,{routeData:s,fromTokenRaw:o.fromToken,toTokenRaw:o.toToken}):In.jsx(Gc,{routeData:s,fromTokenRaw:o.fromToken,toTokenRaw:o.toToken})]})}function qf({data:e,isMobile:t}){var n,o,r,s,l,d;const c=a(),[u,p]=H.useState(!1),{statusText:h,statusColor:m,statusAlphaColor:g}=function({status:e,stateTextMap:t}){let n=t?t[e]:e;const i=a();let o,r=le._({id:"yQE2r9",message:"Loading"}),s=i.palette.text.primary;switch(e){case Nf.Warning:r=le._({id:"GGWsTU",message:"Canceled"}),o=.1;break;case Nf.Failed:r=le._({id:"7Bj3x9",message:"Failed"}),s=i.palette.error.main;break;case Nf.Success:r=le._({id:"KAbcm2",message:"Succeeded"}),s=i.palette.success.main}return{state:n,statusText:r,statusColor:s,statusAlphaColor:o}}({status:e.status}),f=xc(new Date(e.createdAt));return t?In.jsxs(i,{sx:{backgroundColor:c.palette.background.paper,borderRadius:8},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",p:16,gap:16},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},onClick:()=>window.open(ad(e.fromToken.chainId,e.hash,"tx"),"_blank"),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{width:24,height:24,address:e.fromToken.address,chainId:e.fromToken.chainId}),In.jsx(i,{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:In.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"})}),In.jsx(Fc,{width:24,height:24,address:e.toToken.address,chainId:e.toToken.chainId})]}),In.jsx(yg,{isMobile:!1,statusText:h,statusColor:m,alphaColor:g})]}),In.jsx(i,{sx:{typography:"h6",color:c.palette.text.secondary},children:f})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[In.jsx(vg,{token:e.fromToken,amount:e.fromAmount,canAddMetamask:!1,title:"Pay"}),In.jsx(vg,{token:e.toToken,amount:e.toAmount,canAddMetamask:null!==(o=null===(n=us.get(e.fromToken.chainId))||void 0===n?void 0:n.isEVMChain)&&void 0!==o&&o,title:"Receive"})]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:2,borderRadius:8,border:`1px solid ${c.palette.border.main}`},children:In.jsx(xg,{show:u,onClick:()=>p((e=>!e)),sx:{color:"text.secondary"}})})]})]}),In.jsx(Uf,{showFold:u,data:e,isMobile:!0})]}):In.jsxs(In.Fragment,{children:[In.jsxs("tr",{children:[In.jsx(i,{component:"td",sx:{borderTopLeftRadius:8,borderBottomLeftRadius:u?0:8},children:In.jsx(bg,{token:e.fromToken,amount:null!==(r=e.fromAmount)&&void 0!==r?r:"",showChain:!0})}),In.jsx("td",{children:In.jsx(bg,{token:e.toToken,amount:null!==(s=e.toAmount)&&void 0!==s?s:"",showChain:!0,canAddMetamask:null!==(d=null===(l=us.get(e.toToken.chainId))||void 0===l?void 0:l.isEVMChain)&&void 0!==d&&d})}),In.jsx("td",{children:In.jsx(yg,{isMobile:t,statusText:h,statusColor:m,alphaColor:g,time:f})}),In.jsx("td",{children:In.jsx(Mf,{fromToken:e.fromToken,toToken:e.toToken,fromTokenPrice:e.fromTokenPrice,toTokenPrice:e.toTokenPrice})}),In.jsx(i,{component:"td",sx:{borderTopRightRadius:8,borderBottomRightRadius:u?0:8},children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{component:"a",href:ad(e.fromToken.chainId,e.hash,"tx"),target:"_blank",rel:"noopener noreferrer",sx:{p:3,color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:In.jsx(i,{component:Un.ArrowTopRightBorder,sx:{width:18,height:18}})}),In.jsx(i,{sx:{height:16,width:"1px",backgroundColor:"border.main"}}),In.jsx(xg,{show:u,onClick:()=>p((e=>!e))})]})})]}),In.jsx("tr",{children:In.jsx(i,{component:"td",colSpan:5,sx:{p:"0 !important",backgroundColor:"transparent !important"},children:In.jsx(Uf,{showFold:u,data:e})})})]})}function Vf({account:t}){const{isMobile:n}=Sd(),o=Df({account:t,limit:n?10:5});return In.jsx(fg,{isMobile:n,empty:!o.orderList.length,loading:o.isLoading,children:n?In.jsxs(i,{sx:{pt:12,px:16,display:"flex",flexDirection:"column",gap:8},children:[o.orderList.map((e=>In.jsx(qf,{data:e,isMobile:n},e.hash))),In.jsx(jg,{loading:o.isFetchingNextPage,onClick:o.fetchNextPage,hasMore:o.hasNextPage,height:68})]}):In.jsx(In.Fragment,{children:In.jsxs(Cg,{loadMoreLoading:o.isFetchingNextPage,loadMore:o.fetchNextPage,hasMore:o.hasNextPage,children:[In.jsx("thead",{children:In.jsxs("tr",{children:[In.jsx("th",{children:In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:8},children:In.jsx(e,{id:"4fL/V7",message:"Pay"})})}),In.jsx("th",{children:In.jsx(e,{id:"lDgVWA",message:"Receive"})}),In.jsx("th",{children:In.jsx(e,{id:"uAQUqI",message:"Status"})}),In.jsx("th",{children:In.jsx(e,{id:"fqDzSu",message:"Rate"})}),In.jsx(i,{component:"th",sx:{width:140},children:In.jsx(e,{id:"URmyfc",message:"Details"})})]})}),In.jsx("tbody",{children:o.orderList.map((e=>In.jsx(qf,{data:e,isMobile:n},e.hash)))})]})})})}function Wf(e){var{sx:t}=e,n=vn(e,["sx"]);return In.jsx(L,{...n,sx:Object.assign(Object.assign({},t),{display:"flex",flexDirection:"column",overflow:"hidden"})})}function Hf(){const e=a(),{isMobile:t}=Sd(),n=G(null),{evmAccount:o,solanaAccount:r,bitcoinAccount:s}=hd(),[l,d]=$(Ff.sameChain),[c,u]=$(),p=Z((()=>[{key:Ff.sameChain,value:"Same chain Swaps"},{key:Ff.crossChain,value:"Cross Chain Swaps"},{key:Ff.errorRefunds,value:"Error Refunds"}]),[]),h=Z((()=>{var e,t,n;const i=[];if(o.isConnected&&o.address){const t=null===(e=us.entries().find((([e,t])=>t.isEVMChain)))||void 0===e?void 0:e[1];t&&i.push({account:Sl(o.address),firstChain:t})}if(r.isConnected&&r.address){const e=null===(t=us.entries().find((([e,t])=>t.isSolanaChain)))||void 0===t?void 0:t[1];e&&i.push({account:r.address,firstChain:e})}if(s.isConnected&&s.address){const e=null===(n=us.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,o.address,o.isConnected,r.address,r.isConnected]);Y((()=>{u((()=>{if(h.length>0)return h[0].account}))}),[h]);return In.jsxs(A,{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:t?void 0:"gradient-card-border",children:[In.jsx(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",px:16,pt:20,[e.breakpoints.up("laptop")]:{px:24}},children:In.jsx(D,{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}}})}),In.jsx(i,{ref:n,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(((t,o)=>{const r=c===t.account,a=o===h.length-1,s=0===o;return In.jsxs(i,{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(e.palette.success.main,.1),color:"success.main"}),{"&:hover":{backgroundColor:r?T(e.palette.success.main,.1):e.palette.background.paperDarkContrast}}),onClick:()=>((e,t,i)=>{u(e),n.current&&(t?n.current.scrollTo({left:n.current.scrollWidth,behavior:"smooth"}):i&&n.current.scrollTo({left:0,behavior:"smooth"}))})(t.account,a,s),children:[t.firstChain&&In.jsx(i,{component:t.firstChain.logo,sx:{width:16,height:16}}),"(",ld(t.firstChain.chainId),")",rd(t.account)]},t.account)}))}),c?In.jsxs(In.Fragment,{children:[In.jsx(Wf,{value:Ff.sameChain,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:In.jsx(Vf,{account:c})}),In.jsx(Wf,{value:Ff.crossChain,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:In.jsx(Bf,{account:c})}),In.jsx(Wf,{value:Ff.errorRefunds,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:In.jsx(Bf,{account:c,type:"error_refund"})})]}):In.jsx(fg,{isMobile:t,empty:!0,loading:!1})]})}!function(e){e.Running="pending",e.Success="success",e.Failed="failed",e.Warning="reset"}(Nf||(Nf={})),function(e){e.sameChain="same-chain",e.crossChain="cross-chain",e.errorRefunds="error-refunds"}(Ff||(Ff={}));const Zf="widget-module-container",zf=H.forwardRef((function(e,t){var{sx:n}=e,o=vn(e,["sx"]);const{isMobile:r}=Sd();return In.jsx(i,{className:Zf,ref:t,sx:Object.assign(Object.assign({flex:1,backgroundColor:"transparent"},r?{padding:0,height:"100%",width:"100%",overflowX:"hidden"}:{padding:0,height:"auto"}),n),...o})}));var $f;!function(e){e.Pool="pool",e.PoolDetail="poolDetail",e.CreatePool="createPool",e.ModifyPool="modifyPool",e.MiningList="miningList",e.MiningDetail="miningDetail",e.createPoolAMMV2="createPoolAMMV2",e.createPoolAMMV3="createPoolAMMV3"}($f||($f={}));const Gf=it(((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:$f.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 Yf({title:e,descList:t,linkTo:n,sx:o}){const r=a();return In.jsxs(i,{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:[In.jsx(i,{sx:{color:r.palette.text.primary,typography:"body1",fontWeight:500,lineHeight:"24px"},children:e}),In.jsx(i,{sx:{display:"flex",alignItems:"stretch",gap:24},children:t.map(((e,t)=>In.jsxs(i,{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:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{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:t+1}),In.jsx(i,{sx:{color:r.palette.text.primary,typography:"body2",fontWeight:500,lineHeight:"24px"},children:e.title})]}),In.jsx(i,{sx:{color:r.palette.text.secondary,typography:"h6",fontWeight:500,lineHeight:"18px"},children:e.desc})]},t)))}),In.jsx(i,{component:"a",href:n,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 Qf=[{value:0,label:"0%"},{value:25,label:"25%"},{value:50,label:"50%"},{value:75,label:"75%"},{value:100,label:"100%"}];function Xf({disabled:e,value:t,onChange:n,sx:o}){return In.jsxs(i,{sx:Object.assign({p:20,backgroundColor:"background.cardInput",borderRadius:12},o),children:[In.jsx(Rm,{value:String(t),onChange:e=>n(+e),readOnly:!0,readonlyShowSuffix:!0,suffix:In.jsx(i,{sx:{typography:"h2"},children:"%"}),sx:{mt:12,backgroundColor:"background.cardInput","& input":{pl:0,typography:"h1"}}}),In.jsx(i,{sx:{mt:20},children:In.jsx(w,{marks:Qf,step:1,disabled:e,value:t,onChange:(e,t)=>n(t)})})]})}function Kf({active:t,sx:n,onClick:o}){const r=a(),s="light"===r.palette.mode;let l=r.palette.primary.main,c="transparent";return t&&(l=r.palette.primary.contrastText,c=T(r.palette.primary.main,.8)),In.jsx(i,{component:d,sx:Object.assign({typography:"body2",p:t?r.spacing(8,20,9):r.spacing(7,19,8),minWidth:79,border:t?void 0:`1px solid ${l}`,color:l,backgroundColor:c,borderRadius:8,fontWeight:600,"&:hover":{color:t?r.palette.primary.contrastText:r.palette.primary.main,backgroundColor:t?r.palette.primary.main:s?"rgba(26, 26, 27, 0.04)":"rgba(241, 249, 2, 0.08)"}},n),onClick:o,children:In.jsx(e,{id:"R9Khdg",message:"Auto"})})}const Jf="auto",ex="0.1",tx="0.5",nx="0.5",ix=.01,ox=({address:e,type:t})=>{const[n,i]=$(Jf),o=Z((()=>n===Jf?"AMMV3"===t?new Le(nx).div(100).toNumber():"AMMV2"===t?new Le(tx).div(100).toNumber():new Le(ex).div(100).toNumber():n),[n,t]);return{slipper:n,setSlipper:i,slipperValue:o,resetSlipper:()=>{i(Jf)}}};function rx({type:t,disabled:n,value:o,onChange:r,sx:s}){const d=a(),c=o===Jf,[u,p]=$(c?"":new Le(o).times(100).toNumber()),h="AMMV3"==t?nx:"AMMV2"==t?tx:ex;return In.jsx(l,{disabled:n,onlyClick:!0,title:In.jsxs(i,{sx:{backgroundColor:d.palette.background.paper,padding:d.spacing(12,20),borderRadius:8,width:318,maxWidth:"90vw",boxSizing:"border-box"},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2"},children:[In.jsx("span",{children:In.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"})}),In.jsxs("span",{children:[c?h:o&&new Le(o).times(100).toNumber(),"%"]})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",margin:d.spacing(16,0,0,0)},children:[In.jsx(Kf,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{p(""),r(Jf)},active:c}),In.jsx(b,{placeholder:String(h),value:u,onChange:e=>{const{value:t}=e.target;p(t),r(t?new Le(t).div(100).toNumber():Jf)},onBlur:()=>{(!c&&new Le(o).gt(.1)||new Le(o).lte(0))&&(p(10),r(.1))},suffix:In.jsx(i,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:In.jsx(_,{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"},s),children:In.jsx(i,{component:Un.Setting,sx:{width:18,height:18,"& path:last-child":{fill:d.palette.text.primary}}})})})}const ax=50;var sx,lx,dx;function cx(t){var n,i,o,{chainId:r,includeButton:a}=t,s=vn(t,["chainId","includeButton"]);const{chainId:l,getAppKitAccountByChainId:d,open:u}=hd(),[p,h]=H.useState(!1),m=hg(r),g=void 0!==l&&void 0!==r&&l!==r,f=d(r);return!(null==f?void 0:f.appKitAccount.address)||p||void 0===l||r&&r!==l?In.jsx(In.Fragment,{children:In.jsx(c,{...s,isLoading:p,onClick:()=>bn(this,void 0,void 0,(function*(){if(g)return m?(h(!0),yield m(),void h(!1)):void 0;h(!0),u({namespace:null==f?void 0:f.namespace}),h(!1)})),children:p?In.jsx(e,{id:"J28zul",message:"Connecting..."}):g&&r?le._({id:"1+P9RR",message:"Switch to {0}",values:{0:null!==(o=null===(i=us.get(r))||void 0===i?void 0:i.name)&&void 0!==o?o:"unknown"}}):In.jsx(e,{id:"r7ScnQ",message:"Connect to a wallet"})})}):a?In.jsx(In.Fragment,{children:null!==(n=s.children)&&void 0!==n?n:null}):In.jsx(c,{...s})}!function(e){e[e.quantity=1]="quantity",e[e.percentage=2]="percentage"}(sx||(sx={})),function(e){e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B"}(lx||(lx={})),function(e){e.LOWER="LOWER",e.UPPER="UPPER"}(dx||(dx={}));const ux={xs:"4px",sm:"8px",md:"12px",lg:"24px",xl:"32px"},px=({children:e,sx:t})=>(a(),In.jsx(i,{sx:Object.assign({display:"flex",flexDirection:"column",gap:20,px:20,py:20,borderRadius:12},t),children:e})),hx=({children:e,sx:t})=>{const n=a();return In.jsx(px,{sx:Object.assign(Object.assign({},t),{backgroundColor:n.palette.background.paperContrast}),children:e})},mx=({children:e})=>{const t=a();return In.jsxs(i,{sx:{p:8,borderRadius:8,backgroundColor:T(t.palette.warning.main,.1),display:"flex",alignItems:"center",gap:8},children:[In.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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:t.palette.warning.main})}),In.jsx(i,{sx:{typography:"h6",color:t.palette.warning.main,textAlign:"left"},children:e})]})};function gx({gap:e,flex:t,children:n,style:o}){return In.jsx(i,{sx:Object.assign(Object.assign(Object.assign({display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:e&&ux[e]||e},t&&{flex:t}),{width:"100%",alignItems:"center"}),o),children:n})}function fx({gap:e,justify:t,grow:n,children:o,style:r}){return In.jsx(i,{sx:Object.assign({display:"grid",gridAutoRows:"auto",gridRowGap:e&&ux[e]||e,justifyItems:t,flexGrow:n&&1},r),children:o})}function xx({gap:e,children:t,sx:n}){return In.jsx(i,{sx:Object.assign({width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"flex-start",gap:e&&ux[e]||e},n),children:t})}function yx({children:e,style:t}){return In.jsx(xx,{sx:Object.assign({justifyContent:"space-between"},t),children:e})}function vx({gap:e,justify:t,children:n,sx:i}){return In.jsx(xx,{sx:Object.assign({position:"relative",width:"fit-content",margin:`-${e}`},i),children:n})}function bx({children:e,disabled:t,sx:n}){return In.jsx(xx,{sx:Object.assign({display:"flex",flexDirection:"column",alignItems:"stretch",gap:12,opacity:t?.2:1,pointerEvents:t?"none":"auto"},n),children:e})}const jx=({chainId:t,approvalA:n,approvalB:o,parsedAmounts:r,isValid:a,depositADisabled:s,depositBDisabled:l,errorMessage:d,setShowConfirm:u})=>{var p,h;const m=n.needApprove&&!!r[lx.CURRENCY_A]||n.isApproving,g=o.needApprove&&!!r[lx.CURRENCY_B]||o.isApproving;return In.jsx(cx,{includeButton:!0,fullWidth:!0,chainId:t,children:In.jsxs(fx,{gap:"md",style:{width:"100%"},children:[(m||g)&&a&&In.jsxs(i,{sx:{width:"100%",display:"flex",padding:0,alignItems:"center",justifyContent:"space-between",gap:8},children:[m&&In.jsx(c,{size:c.Size.big,isLoading:n.isApproving,onClick:n.submitApprove,disabled:n.insufficientBalance,width:g?"50%":"100%",children:n.isApproving?In.jsx(e,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(p=n.token)||void 0===p?void 0:p.symbol}}):n.approveTitle}),g&&In.jsx(c,{size:c.Size.big,isLoading:o.isApproving,onClick:o.submitApprove,disabled:o.insufficientBalance,width:m?"50%":"100%",children:o.isApproving?In.jsx(e,{id:"DTFrUE",message:"Approving {0}...",values:{0:null===(h=o.token)||void 0===h?void 0:h.symbol}}):o.approveTitle})]}),In.jsx(c,{fullWidth:!0,size:c.Size.big,onClick:()=>{u(!0)},disabled:!a||n.needApprove&&!s||o.needApprove&&!l,danger:!a&&!!r[lx.CURRENCY_A]&&!!r[lx.CURRENCY_B],children:d||le._({id:"rdUucN",message:"Preview"})})]})})},Cx=({chainId:e,disabled:t,isLoading:n,onConfirm:i})=>In.jsx(cx,{includeButton:!0,fullWidth:!0,chainId:e,children:In.jsx(c,{fullWidth:!0,size:c.Size.big,onClick:i,disabled:t,isLoading:n,children:le._({id:"h5pjuM",message:"Collect fees"})})});function wx(e){const t=G();return Y((()=>{t.current=e})),t.current}const kx=[.25,.5,.75,1];function Tx({currentValue:e,onClick:t,sx:n}){const o=a(),r="light"===o.palette.mode,{isMobile:s}=Sd(),[l,c]=$(null),u=G(0);Y((()=>{e?(u.current+=1,u.current>=2&&(c(null),u.current=0)):c(null)}),[e]);const p=wx(e);return Y((()=>{p===e&&1===l&&(u.current=1)}),[e,p,l]),In.jsx(i,{sx:Object.assign({display:"grid",gap:s?10:14,gridTemplateColumns:`repeat(${kx.length}, 1fr)`},n),children:kx.map((e=>{const n=e===l;return In.jsxs(d,{sx:{typography:"h6",borderRadius:4,padding:o.spacing(4,0),width:"100%",color:"text.secondary",backgroundColor:"background.paperDarkContrast","&:hover":{color:o.palette.text.primary,backgroundColor:T(o.palette.text.primary,.2)},"&.selected, &:focus":{color:"#fff",backgroundColor:r?o.palette.primary.main:T(o.palette.text.primary,.4)}},onClick:()=>{n||(u.current=0,c(e),t(e))},className:n?"selected":void 0,children:[100*e,"%"]},e)}))})}const Ex=({value:t,onUserInput:n,maxAmount:o,balance:r,currency:s,locked:l})=>{var c,u;const p=a(),h=z((e=>{if(!o||!s)return;const t=o.toExact().multipliedBy(e).dp(s.decimals).toString();n(t)}),[s,o,n]),m=Z((()=>r?Ps({input:r.toExact(),decimals:null==s?void 0:s.decimals}):"-"),[null==s?void 0:s.decimals,r]);return In.jsxs(i,{sx:{pt:20,pb:20,px:20,borderRadius:16,backgroundColor:p.palette.background.cardInput},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,color:p.palette.text.primary,typography:"h5"},children:[(null==s?void 0:s.address)&&In.jsx(Fc,{address:null!==(c=null==s?void 0:s.address)&&void 0!==c?c:"",chainId:null==s?void 0:s.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:(null==s?void 0:s.address)?In.jsx(i,{children:null!==(u=null==s?void 0:s.symbol)&&void 0!==u?u:"-"}):In.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"})})]}),In.jsxs(i,{component:d,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:[In.jsxs(i,{sx:{wordBreak:"keep-all"},children:[le._({id:"fsBGk0",message:"Balance"}),": "]}),In.jsx(i,{sx:{wordBreak:"break-all",textAlign:"right",display:"flex",alignItems:"center"},children:m})]})]}),In.jsx(Rm,{sx:{mt:4,backgroundColor:p.palette.background.cardInput},suffix:void 0,value:t,onChange:n,readOnly:l,withClear:!l}),l?null:In.jsx(Tx,{sx:{mt:20,mb:0},onClick:h,currentValue:t})]})},Ax={},Ix={};var Sx,Lx;Object.values(de).filter((e=>"number"==typeof e)).map((e=>{const t=lt(e),n=dt(e);t&&(Ax[e]=t),n&&(Ix[e]=n)})),de.MAINNET,de.ARBITRUM_ONE,de.SEPOLIA,de.TAIKO,function(e){e[e.EXACT_INPUT=0]="EXACT_INPUT",e[e.EXACT_OUTPUT=1]="EXACT_OUTPUT"}(Sx||(Sx={})),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"}(Lx||(Lx={}));const Ox=en.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Rx={[Lx.ROUND_DOWN]:Le.ROUND_DOWN,[Lx.ROUND_HALF_UP]:Le.ROUND_HALF_UP,[Lx.ROUND_UP]:Le.ROUND_UP},Mx={[Lx.ROUND_DOWN]:Le.ROUND_DOWN,[Lx.ROUND_HALF_UP]:Le.ROUND_HALF_UP,[Lx.ROUND_UP]:Le.ROUND_UP};class _x{constructor(e,t=en.BigInt(1)){this.numerator=en.BigInt(e),this.denominator=en.BigInt(t)}static tryParseFraction(e){if(e instanceof en||"number"==typeof e||"string"==typeof e)return new _x(e);if("numerator"in e&&"denominator"in e)return e;throw new Error("Could not parse fraction")}get quotient(){return en.divide(this.numerator,this.denominator)}get remainder(){return new _x(en.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new _x(this.denominator,this.numerator)}add(e){const t=_x.tryParseFraction(e);return en.equal(this.denominator,t.denominator)?new _x(en.add(this.numerator,t.numerator),this.denominator):new _x(en.add(en.multiply(this.numerator,t.denominator),en.multiply(t.numerator,this.denominator)),en.multiply(this.denominator,t.denominator))}subtract(e){const t=_x.tryParseFraction(e);return en.equal(this.denominator,t.denominator)?new _x(en.subtract(this.numerator,t.numerator),this.denominator):new _x(en.subtract(en.multiply(this.numerator,t.denominator),en.multiply(t.numerator,this.denominator)),en.multiply(this.denominator,t.denominator))}lessThan(e){const t=_x.tryParseFraction(e);return en.lessThan(en.multiply(this.numerator,t.denominator),en.multiply(t.numerator,this.denominator))}equalTo(e){const t=_x.tryParseFraction(e);return en.equal(en.multiply(this.numerator,t.denominator),en.multiply(t.numerator,this.denominator))}greaterThan(e){const t=_x.tryParseFraction(e);return en.greaterThan(en.multiply(this.numerator,t.denominator),en.multiply(t.numerator,this.denominator))}multiply(e){const t=_x.tryParseFraction(e);return new _x(en.multiply(this.numerator,t.numerator),en.multiply(this.denominator,t.denominator))}divide(e){const t=_x.tryParseFraction(e);return new _x(en.multiply(this.numerator,t.denominator),en.multiply(this.denominator,t.numerator))}toSignificant(e,t={decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0},n=Lx.ROUND_HALF_UP){tn(Number.isInteger(e),`${e} is not an integer.`),tn(e>0,`${e} is not positive.`);const i=Rx[n],o=new Le(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=Lx.ROUND_HALF_UP){tn(Number.isInteger(e),`${e} is not an integer.`),tn(e>=0,`${e} is negative.`);const i=Mx[n];return new Le(this.numerator.toString()).decimalPlaces(e,i).div(this.denominator.toString()).toFormat(e,i,t)}get asFraction(){return new _x(this.numerator,this.denominator)}}class Px extends _x{static fromRawAmount(e,t){return new Px(e,t)}static fromFractionalAmount(e,t,n){return new Px(e,t,n)}constructor(e,t,n){super(t,n),tn(en.lessThanOrEqual(this.quotient,Ox),"AMOUNT"),this.currency=e,this.decimalScale=en.exponentiate(en.BigInt(10),en.BigInt(e.decimals))}add(e){tn(this.currency.equals(e.currency),"CURRENCY");const t=super.add(e);return Px.fromFractionalAmount(this.currency,t.numerator,t.denominator)}subtract(e){tn(this.currency.equals(e.currency),"CURRENCY");const t=super.subtract(e);return Px.fromFractionalAmount(this.currency,t.numerator,t.denominator)}multiply(e){const t=super.multiply(e);return Px.fromFractionalAmount(this.currency,t.numerator,t.denominator)}divide(e){const t=super.divide(e);return Px.fromFractionalAmount(this.currency,t.numerator,t.denominator)}toSignificant(e=6,t,n=Lx.ROUND_DOWN){return super.divide(this.decimalScale).toSignificant(e,t,n)}toFixed(e=this.currency.decimals,t,n=Lx.ROUND_DOWN){return tn(e<=this.currency.decimals,"DECIMALS"),super.divide(this.decimalScale).toFixed(e,t,n)}toExact(){return new Le(this.quotient.toString()).div(this.decimalScale.toString())}get wrapped(){return this.currency.isToken?this:Px.fromFractionalAmount(this.currency.wrapped,this.numerator,this.denominator)}}const Bx=new _x(en.BigInt(100));function Dx(e){return new Nx(e.numerator,e.denominator)}class Nx extends _x{constructor(){super(...arguments),this.isPercent=!0}add(e){return Dx(super.add(e))}subtract(e){return Dx(super.subtract(e))}multiply(e){return Dx(super.multiply(e))}divide(e){return Dx(super.divide(e))}toSignificant(e=5,t,n){return super.multiply(Bx).toSignificant(e,t,n)}toFixed(e=2,t,n){return super.multiply(Bx).toFixed(e,t,n)}}class Fx extends _x{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 _x(en.exponentiate(en.BigInt(10),en.BigInt(t.decimals)),en.exponentiate(en.BigInt(10),en.BigInt(n.decimals)))}invert(){return new Fx(this.quoteCurrency,this.baseCurrency,this.numerator,this.denominator)}multiply(e){tn(this.quoteCurrency.equals(e.baseCurrency),"TOKEN");const t=super.multiply(e);return new Fx(this.baseCurrency,e.quoteCurrency,t.denominator,t.numerator)}quote(e){tn(e.currency.equals(this.baseCurrency),"TOKEN");const t=super.multiply(e);return Px.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 Ux{constructor(e,t,n,i){tn(Number.isSafeInteger(e),"CHAIN_ID"),tn(t>=0&&t<255&&Number.isInteger(t),"DECIMALS"),this.chainId=e,this.decimals=t,this.symbol=n,this.name=i}}function qx(e){try{return Sl(e)}catch(t){throw new Error(`${e} is not a valid address.`)}}const Vx=/^0x[0-9a-fA-F]{40}$/;class Wx extends Ux{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(Vx.test(e))return e;throw new Error(`${e} is not a valid address.`)}(t):qx(t),a&&tn(a.gte(St.from(0)),"NON-NEGATIVE FOT FEES"),s&&tn(s.gte(St.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 tn(this.chainId===e.chainId,"CHAIN_IDS"),tn(this.address.toLowerCase()!==e.address.toLowerCase(),"ADDRESSES"),this.address.toLowerCase()<e.address.toLowerCase()}get wrapped(){return this}}const Hx=en.BigInt(Number.MAX_SAFE_INTEGER),Zx=en.BigInt(0),zx=en.BigInt(1),$x=en.BigInt(2);const Gx=en.BigInt(0),Yx=1e4;new Nx(en.BigInt(1),Yx),new Nx(1,100),new Nx(3,100),new Nx(5,100),new Nx(10,100),new Nx(15,100);const Qx=new Nx(0);new Nx(1);const Xx="0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";var Kx;!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"}(Kx||(Kx={}));const Jx={[Kx.LOWEST]:1,[Kx.LOW_200]:4,[Kx.LOW_300]:6,[Kx.LOW_400]:8,[Kx.LOW]:10,[Kx.MEDIUM]:60,[Kx.HIGH]:200},ey=en.BigInt(-1),ty=en.BigInt(0),ny=en.BigInt(1),iy=en.exponentiate(en.BigInt(2),en.BigInt(96)),oy=en.exponentiate(iy,en.BigInt(2));function ry({factoryAddress:e,tokenA:t,tokenB:n,fee:i,initCodeHashManualOverride:o,chainId:r}){const[a,s]=t.sortsBefore(n)?[t,n]:[n,t],l=Yl(["bytes"],[wf.encode(["address","address","uint24"],[a.address,s.address,i])]),d=null!=o?o:function(e){switch(e){case de.TAIKO:case de.ZETACHAIN:case de.ZETACHAIN_TESTNET:return"0x5ccd5621c1bb9e44ce98cef8b90d31eb2423dec3793b6239232cefae976936ea";case de.SEPOLIA:return"0x4509fa1e2d1989ac1632a56fe87c53e8d1e9d05847694e00f62b23e28cec98c4";default:return Xx}}(r);return Ll(e,l,d)}const ay=en.BigInt(2),sy=[128,64,32,16,8,4,2,1].map((e=>[e,en.exponentiate(ay,en.BigInt(e))]));function ly(e,t){return en.signedRightShift(en.multiply(e,en.BigInt(t)),en.BigInt(128))}const dy=en.exponentiate(en.BigInt(2),en.BigInt(32));class cy{constructor(){}static getSqrtRatioAtTick(e){tn(e>=cy.MIN_TICK&&e<=cy.MAX_TICK&&Number.isInteger(e),"TICK");const t=e<0?-1*e:e;let n=1&t?en.BigInt("0xfffcb933bd6fad37aa2d162d1a594001"):en.BigInt("0x100000000000000000000000000000000");return 2&t&&(n=ly(n,"0xfff97272373d413259a46990580e213a")),4&t&&(n=ly(n,"0xfff2e50f5f656932ef12357cf3c7fdcc")),8&t&&(n=ly(n,"0xffe5caca7e10e4e61c3624eaa0941cd0")),16&t&&(n=ly(n,"0xffcb9843d60f6159c9db58835c926644")),32&t&&(n=ly(n,"0xff973b41fa98c081472e6896dfb254c0")),64&t&&(n=ly(n,"0xff2ea16466c96a3843ec78b326b52861")),128&t&&(n=ly(n,"0xfe5dee046a99a2a811c461f1969c3053")),256&t&&(n=ly(n,"0xfcbe86c7900a88aedcffc83b479aa3a4")),512&t&&(n=ly(n,"0xf987a7253ac413176f2b074cf7815e54")),1024&t&&(n=ly(n,"0xf3392b0822b70005940c7a398e4b70f3")),2048&t&&(n=ly(n,"0xe7159475a2c29b7443b29c7fa6e889d9")),4096&t&&(n=ly(n,"0xd097f3bdfd2022b8845ad8f792aa5825")),8192&t&&(n=ly(n,"0xa9f746462d870fdf8a65dc1f90e061e5")),16384&t&&(n=ly(n,"0x70d869a156d2a1b890bb3df62baf32f7")),32768&t&&(n=ly(n,"0x31be135f97d08fd981231505542fcfa6")),65536&t&&(n=ly(n,"0x9aa508b5b7a84e1c677de54f3e99bc9")),131072&t&&(n=ly(n,"0x5d6af8dedb81196699c329225ee604")),262144&t&&(n=ly(n,"0x2216e584f5fa1ea926041bedfe98")),524288&t&&(n=ly(n,"0x48a170391f7dc42444e8fa2")),e>0&&(n=en.divide(Ox,n)),en.greaterThan(en.remainder(n,dy),ty)?en.add(en.divide(n,dy),ny):en.divide(n,dy)}static getTickAtSqrtRatio(e){tn(en.greaterThanOrEqual(e,cy.MIN_SQRT_RATIO)&&en.lessThan(e,cy.MAX_SQRT_RATIO),"SQRT_RATIO");const t=en.leftShift(e,en.BigInt(32)),n=function(e){tn(en.greaterThan(e,ty),"ZERO"),tn(en.lessThanOrEqual(e,Ox),"MAX");let t=0;for(const[n,i]of sy)en.greaterThanOrEqual(e,i)&&(e=en.signedRightShift(e,en.BigInt(n)),t+=n);return t}(t);let i;i=en.greaterThanOrEqual(en.BigInt(n),en.BigInt(128))?en.signedRightShift(t,en.BigInt(n-127)):en.leftShift(t,en.BigInt(127-n));let o=en.leftShift(en.subtract(en.BigInt(n),en.BigInt(128)),en.BigInt(64));for(let e=0;e<14;e++){i=en.signedRightShift(en.multiply(i,i),en.BigInt(127));const t=en.signedRightShift(i,en.BigInt(128));o=en.bitwiseOr(o,en.leftShift(t,en.BigInt(63-e))),i=en.signedRightShift(i,t)}const r=en.multiply(o,en.BigInt("255738958999603826347141")),a=en.toNumber(en.signedRightShift(en.subtract(r,en.BigInt("3402992956809132418596140100660247210")),en.BigInt(128))),s=en.toNumber(en.signedRightShift(en.add(r,en.BigInt("291339464771989622907027621153398088495")),en.BigInt(128)));return a===s?a:en.lessThanOrEqual(cy.getSqrtRatioAtTick(s),e)?s:a}}cy.MIN_TICK=-887272,cy.MAX_TICK=-cy.MIN_TICK,cy.MIN_SQRT_RATIO=en.BigInt("4295128739"),cy.MAX_SQRT_RATIO=en.BigInt("1461446703485210103287273052203988822378723970342");class uy{constructor(){}static mulDivRoundingUp(e,t,n){const i=en.multiply(e,t);let o=en.divide(i,n);return en.notEqual(en.remainder(i,n),ty)&&(o=en.add(o,ny)),o}}const py=en.subtract(en.exponentiate(en.BigInt(2),en.BigInt(160)),ny);function hy(e,t){const n=en.multiply(e,t);return en.bitwiseAnd(n,Ox)}class my{constructor(){}static getAmount0Delta(e,t,n,i){en.greaterThan(e,t)&&([e,t]=[t,e]);const o=en.leftShift(n,en.BigInt(96)),r=en.subtract(t,e);return i?uy.mulDivRoundingUp(uy.mulDivRoundingUp(o,r,t),ny,e):en.divide(en.divide(en.multiply(o,r),t),e)}static getAmount1Delta(e,t,n,i){return en.greaterThan(e,t)&&([e,t]=[t,e]),i?uy.mulDivRoundingUp(n,en.subtract(t,e),iy):en.divide(en.multiply(n,en.subtract(t,e)),iy)}static getNextSqrtPriceFromInput(e,t,n,i){return tn(en.greaterThan(e,ty)),tn(en.greaterThan(t,ty)),i?this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!0):this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!0)}static getNextSqrtPriceFromOutput(e,t,n,i){return tn(en.greaterThan(e,ty)),tn(en.greaterThan(t,ty)),i?this.getNextSqrtPriceFromAmount1RoundingDown(e,t,n,!1):this.getNextSqrtPriceFromAmount0RoundingUp(e,t,n,!1)}static getNextSqrtPriceFromAmount0RoundingUp(e,t,n,i){if(en.equal(n,ty))return e;const o=en.leftShift(t,en.BigInt(96));if(i){let t=hy(n,e);if(en.equal(en.divide(t,n),e)){const n=function(e,t){const n=en.add(e,t);return en.bitwiseAnd(n,Ox)}(o,t);if(en.greaterThanOrEqual(n,o))return uy.mulDivRoundingUp(o,e,n)}return uy.mulDivRoundingUp(o,ny,en.add(en.divide(o,e),n))}{let t=hy(n,e);tn(en.equal(en.divide(t,n),e)),tn(en.greaterThan(o,t));const i=en.subtract(o,t);return uy.mulDivRoundingUp(o,e,i)}}static getNextSqrtPriceFromAmount1RoundingDown(e,t,n,i){if(i){const i=en.lessThanOrEqual(n,py)?en.divide(en.leftShift(n,en.BigInt(96)),t):en.divide(en.multiply(n,iy),t);return en.add(e,i)}{const i=uy.mulDivRoundingUp(n,iy,t);return tn(en.greaterThan(e,i)),en.subtract(e,i)}}}const gy=en.exponentiate(en.BigInt(10),en.BigInt(6));class fy{constructor(){}static computeSwapStep(e,t,n,i,o){const r={};o=en.BigInt(o);const a=en.greaterThanOrEqual(e,t),s=en.greaterThanOrEqual(i,ty);if(s){const s=en.divide(en.multiply(i,en.subtract(gy,o)),gy);r.amountIn=a?my.getAmount0Delta(t,e,n,!0):my.getAmount1Delta(e,t,n,!0),en.greaterThanOrEqual(s,r.amountIn)?r.sqrtRatioNextX96=t:r.sqrtRatioNextX96=my.getNextSqrtPriceFromInput(e,n,s,a)}else r.amountOut=a?my.getAmount1Delta(t,e,n,!1):my.getAmount0Delta(e,t,n,!1),en.greaterThanOrEqual(en.multiply(i,ey),r.amountOut)?r.sqrtRatioNextX96=t:r.sqrtRatioNextX96=my.getNextSqrtPriceFromOutput(e,n,en.multiply(i,ey),a);const l=en.equal(t,r.sqrtRatioNextX96);return a?(r.amountIn=l&&s?r.amountIn:my.getAmount0Delta(r.sqrtRatioNextX96,e,n,!0),r.amountOut=l&&!s?r.amountOut:my.getAmount1Delta(r.sqrtRatioNextX96,e,n,!1)):(r.amountIn=l&&s?r.amountIn:my.getAmount1Delta(e,r.sqrtRatioNextX96,n,!0),r.amountOut=l&&!s?r.amountOut:my.getAmount0Delta(e,r.sqrtRatioNextX96,n,!1)),!s&&en.greaterThan(r.amountOut,en.multiply(i,ey))&&(r.amountOut=en.multiply(i,ey)),s&&en.notEqual(r.sqrtRatioNextX96,t)?r.feeAmount=en.subtract(i,r.amountIn):r.feeAmount=uy.mulDivRoundingUp(r.amountIn,o,en.subtract(gy,o)),[r.sqrtRatioNextX96,r.amountIn,r.amountOut,r.feeAmount]}}class xy{constructor(){}static addDelta(e,t){return en.lessThan(t,ty)?en.subtract(e,en.multiply(t,ey)):en.add(e,t)}}class yy{getTick(e){return bn(this,void 0,void 0,(function*(){throw new Error(yy.ERROR_MESSAGE)}))}nextInitializedTickWithinOneWord(e,t,n){return bn(this,void 0,void 0,(function*(){throw new Error(yy.ERROR_MESSAGE)}))}}function vy(e,t){return e.index-t.index}yy.ERROR_MESSAGE="No tick data provider was given";class by{constructor(){}static validateList(e,t){tn(t>0,"TICK_SPACING_NONZERO"),tn(e.every((({index:e})=>e%t==0)),"TICK_SPACING"),tn(en.equal(e.reduce(((e,{liquidityNet:t})=>en.add(e,t)),ty),ty),"ZERO_NET"),tn(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,vy),"SORTED")}static isBelowSmallest(e,t){return tn(e.length>0,"LENGTH"),t<e[0].index}static isAtOrAboveLargest(e,t){return tn(e.length>0,"LENGTH"),t>=e[e.length-1].index}static getTick(e,t){const n=e[this.binarySearch(e,t)];return tn(n.index===t,"NOT_CONTAINED"),n}static binarySearch(e,t){tn(!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(tn(!by.isBelowSmallest(e,t),"BELOW_SMALLEST"),by.isAtOrAboveLargest(e,t))return e[e.length-1];return e[this.binarySearch(e,t)]}if(tn(!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(by.isBelowSmallest(e,t))return[r,!1];const a=by.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 jy(e){let t=en.BigInt(e).toString(16);return t.length%2!=0&&(t=`0${t}`),`0x${t}`}function Cy(e,t){const n=en.leftShift(en.BigInt(e),en.BigInt(192)),i=en.BigInt(t);return function(e){if(tn(en.greaterThanOrEqual(e,Zx),"NEGATIVE"),en.lessThan(e,Hx))return en.BigInt(Math.floor(Math.sqrt(en.toNumber(e))));let t,n;for(t=e,n=en.add(en.divide(e,$x),zx);en.lessThan(n,t);)t=n,n=en.divide(en.add(en.divide(e,n),n),$x);return t}(en.divide(n,i))}function wy(e,t,n){en.greaterThan(e,t)&&([e,t]=[t,e]);const i=en.divide(en.multiply(e,t),iy);return en.divide(en.multiply(en.BigInt(n),i),en.subtract(t,e))}function ky(e,t,n){en.greaterThan(e,t)&&([e,t]=[t,e]);const i=en.multiply(en.multiply(en.BigInt(n),e),t),o=en.multiply(iy,en.subtract(t,e));return en.divide(i,o)}function Ty(e,t,n){return en.greaterThan(e,t)&&([e,t]=[t,e]),en.divide(en.multiply(en.BigInt(n),iy),en.subtract(t,e))}function Ey(e,t,n,i,o,r){en.greaterThan(t,n)&&([t,n]=[n,t]);const a=r?ky:wy;if(en.lessThanOrEqual(e,t))return a(t,n,i);if(en.lessThan(e,n)){const r=a(e,n,i),s=Ty(t,e,o);return en.lessThan(r,s)?r:s}return Ty(t,n,o)}function Ay(e,t){tn(Number.isInteger(e)&&Number.isInteger(t),"INTEGERS"),tn(t>0,"TICK_SPACING"),tn(e>=cy.MIN_TICK&&e<=cy.MAX_TICK,"TICK_BOUND");const n=Math.round(e/t)*t;return n<cy.MIN_TICK?n+t:n>cy.MAX_TICK?n-t:n}function Iy(e,t,n){const i=cy.getSqrtRatioAtTick(n),o=en.multiply(i,i);return e.sortsBefore(t)?new Fx(e,t,oy,o):new Fx(e,t,o,oy)}function Sy(e){const t=e.baseCurrency.sortsBefore(e.quoteCurrency),n=t?Cy(e.numerator,e.denominator):Cy(e.denominator,e.numerator);let i=cy.getTickAtSqrtRatio(n);const o=Iy(e.baseCurrency,e.quoteCurrency,i+1);return t?e.lessThan(o)||i++:e.greaterThan(o)||i++,i}en.exponentiate(en.BigInt(2),en.BigInt(128)),en.exponentiate(en.BigInt(2),en.BigInt(256));class Ly{constructor({index:e,liquidityGross:t,liquidityNet:n}){tn(e>=cy.MIN_TICK&&e<=cy.MAX_TICK,"TICK"),this.index=e,this.liquidityGross=en.BigInt(t),this.liquidityNet=en.BigInt(n)}}class Oy{constructor(e,t){const n=e.map((e=>e instanceof Ly?e:new Ly(e)));by.validateList(n,t),this.ticks=n}getTick(e){return bn(this,void 0,void 0,(function*(){return by.getTick(this.ticks,e)}))}nextInitializedTickWithinOneWord(e,t,n){return bn(this,void 0,void 0,(function*(){return by.nextInitializedTickWithinOneWord(this.ticks,e,t,n)}))}}const Ry=new yy;let My=class e{static getAddress(e,t,n,i,o){return ry({factoryAddress:null!=o?o:"0x78172691DD3B8ADa7aEbd9bFfB487FB11D735DB2",fee:n,tokenA:e,tokenB:t,initCodeHashManualOverride:i})}constructor(e,t,n,i,o,r,a=Ry){tn(Number.isInteger(n)&&n<1e6,"FEE");const s=cy.getSqrtRatioAtTick(r),l=cy.getSqrtRatioAtTick(r+1);tn(en.greaterThanOrEqual(en.BigInt(i),s)&&en.lessThanOrEqual(en.BigInt(i),l),"PRICE_BOUNDS"),[this.token0,this.token1]=e.sortsBefore(t)?[e,t]:[t,e],this.fee=n,this.sqrtRatioX96=en.BigInt(i),this.liquidity=en.BigInt(o),this.tickCurrent=r,this.tickDataProvider=Array.isArray(a)?new Oy(a,Jx[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 Fx(this.token0,this.token1,oy,en.multiply(this.sqrtRatioX96,this.sqrtRatioX96))}get token1Price(){var e;return null!==(e=this._token1Price)&&void 0!==e?e:this._token1Price=new Fx(this.token1,this.token0,en.multiply(this.sqrtRatioX96,this.sqrtRatioX96),oy)}priceOf(e){return tn(this.involvesToken(e),"TOKEN"),e.equals(this.token0)?this.token0Price:this.token1Price}get chainId(){return this.token0.chainId}getOutputAmount(t,n){return bn(this,void 0,void 0,(function*(){tn(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[Px.fromRawAmount(l,en.multiply(o,ey)),new e(this.token0,this.token1,this.fee,r,a,s,this.tickDataProvider)]}))}getInputAmount(t,n){return bn(this,void 0,void 0,(function*(){tn(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,en.multiply(t.quotient,ey),n),l=i?this.token0:this.token1;return[Px.fromRawAmount(l,o),new e(this.token0,this.token1,this.fee,r,a,s,this.tickDataProvider)]}))}swap(e,t,n){return bn(this,void 0,void 0,(function*(){return function(e,t,n,i,o,r,a,s,l){return bn(this,void 0,void 0,(function*(){l||(l=a?en.add(cy.MIN_SQRT_RATIO,ny):en.subtract(cy.MAX_SQRT_RATIO,ny)),a?(tn(en.greaterThan(l,cy.MIN_SQRT_RATIO),"RATIO_MIN"),tn(en.lessThan(l,t),"RATIO_CURRENT")):(tn(en.lessThan(l,cy.MAX_SQRT_RATIO),"RATIO_MAX"),tn(en.greaterThan(l,t),"RATIO_CURRENT"));const d=en.greaterThanOrEqual(s,ty),c={amountSpecifiedRemaining:s,amountCalculated:ty,sqrtPriceX96:t,tick:n,liquidity:i};for(;en.notEqual(c.amountSpecifiedRemaining,ty)&&c.sqrtPriceX96!==l;){let t={};if(t.sqrtPriceStartX96=c.sqrtPriceX96,[t.tickNext,t.initialized]=yield r.nextInitializedTickWithinOneWord(c.tick,a,o),t.tickNext<cy.MIN_TICK?t.tickNext=cy.MIN_TICK:t.tickNext>cy.MAX_TICK&&(t.tickNext=cy.MAX_TICK),t.sqrtPriceNextX96=cy.getSqrtRatioAtTick(t.tickNext),[c.sqrtPriceX96,t.amountIn,t.amountOut,t.feeAmount]=fy.computeSwapStep(c.sqrtPriceX96,(a?en.lessThan(t.sqrtPriceNextX96,l):en.greaterThan(t.sqrtPriceNextX96,l))?l:t.sqrtPriceNextX96,c.liquidity,c.amountSpecifiedRemaining,e),d?(c.amountSpecifiedRemaining=en.subtract(c.amountSpecifiedRemaining,en.add(t.amountIn,t.feeAmount)),c.amountCalculated=en.subtract(c.amountCalculated,t.amountOut)):(c.amountSpecifiedRemaining=en.add(c.amountSpecifiedRemaining,t.amountOut),c.amountCalculated=en.add(c.amountCalculated,en.add(t.amountIn,t.feeAmount))),en.equal(c.sqrtPriceX96,t.sqrtPriceNextX96)){if(t.initialized){let e=en.BigInt((yield r.getTick(t.tickNext)).liquidityNet);a&&(e=en.multiply(e,ey)),c.liquidity=xy.addDelta(c.liquidity,e)}c.tick=a?t.tickNext-1:t.tickNext}else en.notEqual(c.sqrtPriceX96,t.sqrtPriceStartX96)&&(c.tick=cy.getTickAtSqrtRatio(c.sqrtPriceX96))}return{amountCalculated:c.amountCalculated,sqrtRatioX96:c.sqrtPriceX96,liquidity:c.liquidity,tickCurrent:c.tick}}))}(en.BigInt(this.fee),this.sqrtRatioX96,this.tickCurrent,this.liquidity,this.tickSpacing,this.tickDataProvider,e,t,n)}))}get tickSpacing(){return Jx[this.fee]}};class _y{constructor({pool:e,liquidity:t,tickLower:n,tickUpper:i}){this._token0Amount=null,this._token1Amount=null,this._mintAmounts=null,tn(n<i,"TICK_ORDER"),tn(n>=cy.MIN_TICK&&n%e.tickSpacing==0,"TICK_LOWER"),tn(i<=cy.MAX_TICK&&i%e.tickSpacing==0,"TICK_UPPER"),this.pool=e,this.tickLower=n,this.tickUpper=i,this.liquidity=en.BigInt(t)}get token0PriceLower(){return Iy(this.pool.token0,this.pool.token1,this.tickLower)}get token0PriceUpper(){return Iy(this.pool.token0,this.pool.token1,this.tickUpper)}get amount0(){return null===this._token0Amount&&(this.pool.tickCurrent<this.tickLower?this._token0Amount=Px.fromRawAmount(this.pool.token0,my.getAmount0Delta(cy.getSqrtRatioAtTick(this.tickLower),cy.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this.pool.tickCurrent<this.tickUpper?this._token0Amount=Px.fromRawAmount(this.pool.token0,my.getAmount0Delta(this.pool.sqrtRatioX96,cy.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!1)):this._token0Amount=Px.fromRawAmount(this.pool.token0,ty)),this._token0Amount}get amount1(){return null===this._token1Amount&&(this.pool.tickCurrent<this.tickLower?this._token1Amount=Px.fromRawAmount(this.pool.token1,ty):this.pool.tickCurrent<this.tickUpper?this._token1Amount=Px.fromRawAmount(this.pool.token1,my.getAmount1Delta(cy.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!1)):this._token1Amount=Px.fromRawAmount(this.pool.token1,my.getAmount1Delta(cy.getSqrtRatioAtTick(this.tickLower),cy.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=Cy(t.numerator,t.denominator);en.lessThanOrEqual(i,cy.MIN_SQRT_RATIO)&&(i=en.add(cy.MIN_SQRT_RATIO,en.BigInt(1)));let o=Cy(n.numerator,n.denominator);return en.greaterThanOrEqual(o,cy.MAX_SQRT_RATIO)&&(o=en.subtract(cy.MAX_SQRT_RATIO,en.BigInt(1))),{sqrtRatioX96Lower:i,sqrtRatioX96Upper:o}}mintAmountsWithSlippage(e){const{sqrtRatioX96Upper:t,sqrtRatioX96Lower:n}=this.ratiosAfterSlippage(e),i=new My(this.pool.token0,this.pool.token1,this.pool.fee,n,0,cy.getTickAtSqrtRatio(n)),o=new My(this.pool.token0,this.pool.token1,this.pool.fee,t,0,cy.getTickAtSqrtRatio(t)),r=_y.fromAmounts(Object.assign(Object.assign({pool:this.pool,tickLower:this.tickLower,tickUpper:this.tickUpper},this.mintAmounts),{useFullPrecision:!1})),{amount0:a}=new _y({pool:o,liquidity:r.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).mintAmounts,{amount1:s}=new _y({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 My(this.pool.token0,this.pool.token1,this.pool.fee,n,0,cy.getTickAtSqrtRatio(n)),o=new My(this.pool.token0,this.pool.token1,this.pool.fee,t,0,cy.getTickAtSqrtRatio(t)),r=new _y({pool:o,liquidity:this.liquidity,tickLower:this.tickLower,tickUpper:this.tickUpper}).amount0,a=new _y({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:my.getAmount0Delta(cy.getSqrtRatioAtTick(this.tickLower),cy.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:ty}:this.pool.tickCurrent<this.tickUpper?{amount0:my.getAmount0Delta(this.pool.sqrtRatioX96,cy.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0),amount1:my.getAmount1Delta(cy.getSqrtRatioAtTick(this.tickLower),this.pool.sqrtRatioX96,this.liquidity,!0)}:{amount0:ty,amount1:my.getAmount1Delta(cy.getSqrtRatioAtTick(this.tickLower),cy.getSqrtRatioAtTick(this.tickUpper),this.liquidity,!0)}:this._mintAmounts}static fromAmounts({pool:e,tickLower:t,tickUpper:n,amount0:i,amount1:o,useFullPrecision:r}){const a=cy.getSqrtRatioAtTick(t),s=cy.getSqrtRatioAtTick(n);return new _y({pool:e,tickLower:t,tickUpper:n,liquidity:Ey(e.sqrtRatioX96,a,s,i,o,r)})}static fromAmount0({pool:e,tickLower:t,tickUpper:n,amount0:i,useFullPrecision:o}){return _y.fromAmounts({pool:e,tickLower:t,tickUpper:n,amount0:i,amount1:Ox,useFullPrecision:o})}static fromAmount1({pool:e,tickLower:t,tickUpper:n,amount1:i}){return _y.fromAmounts({pool:e,tickLower:t,tickUpper:n,amount0:Ox,amount1:i,useFullPrecision:!0})}}var Py=[{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"payable",type:"function"}];class By{constructor(){}static encodeMulticall(e){return Array.isArray(e)||(e=[e]),1===e.length?e[0]:By.INTERFACE.encodeFunctionData("multicall",[e])}static decodeMulticall(e){return By.INTERFACE.decodeFunctionData("multicall",e).data}}By.INTERFACE=new Rf(Py);var Dy=[{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"}],Ny=[{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 Fy{constructor(){}static encodeFeeBips(e){return jy(e.multiply(1e4).quotient)}static encodeUnwrapWETH9(e,t,n){if(t=qx(t),n){const i=this.encodeFeeBips(n.fee),o=qx(n.recipient);return Fy.INTERFACE.encodeFunctionData("unwrapWETH9WithFee",[jy(e),t,i,o])}return Fy.INTERFACE.encodeFunctionData("unwrapWETH9",[jy(e),t])}static encodeSweepToken(e,t,n,i){if(n=qx(n),i){const o=this.encodeFeeBips(i.fee),r=qx(i.recipient);return Fy.INTERFACE.encodeFunctionData("sweepTokenWithFee",[e.address,jy(t),n,o,r])}return Fy.INTERFACE.encodeFunctionData("sweepToken",[e.address,jy(t),n])}static encodeRefundETH(){return Fy.INTERFACE.encodeFunctionData("refundETH")}}Fy.INTERFACE=new Rf(Ny);var Uy=[{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 qy{constructor(){}static encodePermit(e,t){return"nonce"in t?qy.INTERFACE.encodeFunctionData("selfPermitAllowed",[e.address,jy(t.nonce),jy(t.expiry),t.v,t.r,t.s]):qy.INTERFACE.encodeFunctionData("selfPermit",[e.address,jy(t.amount),jy(t.deadline),t.v,t.r,t.s])}}qy.INTERFACE=new Rf(Uy);const Vy=jy(en.subtract(en.exponentiate(en.BigInt(2),en.BigInt(128)),en.BigInt(1)));function Wy(e){return Object.keys(e).some((e=>"recipient"===e))}const Hy={Permit:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};class Zy{constructor(){}static encodeCreate(e){return Zy.INTERFACE.encodeFunctionData("createAndInitializePoolIfNecessary",[e.token0.address,e.token1.address,e.fee,jy(e.sqrtRatioX96)])}static createCallParameters(e){return{calldata:this.encodeCreate(e),value:jy(0)}}static addCallParameters(e,t){tn(en.greaterThan(e.liquidity,ty),"ZERO_LIQUIDITY");const n=[],{amount0:i,amount1:o}=e.mintAmounts,r=e.mintAmountsWithSlippage(t.slippageTolerance),a=jy(r.amount0),s=jy(r.amount1),l=jy(t.deadline);if(Wy(t)&&t.createPool&&n.push(this.encodeCreate(e.pool)),t.token0Permit&&n.push(qy.encodePermit(e.pool.token0,t.token0Permit)),t.token1Permit&&n.push(qy.encodePermit(e.pool.token1,t.token1Permit)),Wy(t)){const r=qx(t.recipient);n.push(Zy.INTERFACE.encodeFunctionData("mint",[{token0:e.pool.token0.address,token1:e.pool.token1.address,fee:e.pool.fee,tickLower:e.tickLower,tickUpper:e.tickUpper,amount0Desired:jy(i),amount1Desired:jy(o),amount0Min:a,amount1Min:s,recipient:r,deadline:l}]))}else n.push(Zy.INTERFACE.encodeFunctionData("increaseLiquidity",[{tokenId:jy(t.tokenId),amount0Desired:jy(i),amount1Desired:jy(o),amount0Min:a,amount1Min:s,deadline:l}]));let d=jy(0);if(t.useNative){const r=t.useNative.wrapped;tn(e.pool.token0.equals(r)||e.pool.token1.equals(r),"NO_WETH");const a=e.pool.token0.equals(r)?i:o;en.greaterThan(a,ty)&&n.push(Fy.encodeRefundETH()),d=jy(a)}return{calldata:By.encodeMulticall(n),value:d}}static encodeCollect(e){const t=[],n=jy(e.tokenId),i=e.expectedCurrencyOwed0.currency.isNative||e.expectedCurrencyOwed1.currency.isNative,o=qx(e.recipient);if(t.push(Zy.INTERFACE.encodeFunctionData("collect",[{tokenId:n,recipient:i?"0x0000000000000000000000000000000000000000":o,amount0Max:Vy,amount1Max:Vy}])),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(Fy.encodeUnwrapWETH9(n,o)),t.push(Fy.encodeSweepToken(i,r,o))}return t}static collectCallParameters(e){const t=Zy.encodeCollect(e);return{calldata:By.encodeMulticall(t),value:jy(0)}}static removeCallParameters(e,t){const n=[],i=jy(t.deadline),o=jy(t.tokenId),r=new _y({pool:e.pool,liquidity:t.liquidityPercentage.multiply(e.liquidity).quotient,tickLower:e.tickLower,tickUpper:e.tickUpper});tn(en.greaterThan(r.liquidity,ty),"ZERO_LIQUIDITY");const{amount0:a,amount1:s}=r.burnAmountsWithSlippage(t.slippageTolerance);t.permit&&n.push(Zy.INTERFACE.encodeFunctionData("permit",[qx(t.permit.spender),o,jy(t.permit.deadline),t.permit.v,t.permit.r,t.permit.s])),n.push(Zy.INTERFACE.encodeFunctionData("decreaseLiquidity",[{tokenId:o,liquidity:jy(r.liquidity),amount0Min:jy(a),amount1Min:jy(s),deadline:i}]));const l=t.collectOptions,{expectedCurrencyOwed0:d,expectedCurrencyOwed1:c}=l,u=vn(l,["expectedCurrencyOwed0","expectedCurrencyOwed1"]);return n.push(...Zy.encodeCollect(Object.assign({tokenId:jy(t.tokenId),expectedCurrencyOwed0:d.add(Px.fromRawAmount(d.currency,a)),expectedCurrencyOwed1:c.add(Px.fromRawAmount(c.currency,s))},u))),t.liquidityPercentage.equalTo(ny)?t.burnToken&&n.push(Zy.INTERFACE.encodeFunctionData("burn",[o])):tn(!0!==t.burnToken,"CANNOT_BURN"),{calldata:By.encodeMulticall(n),value:jy(0)}}static safeTransferFromParameters(e){const t=qx(e.recipient),n=qx(e.sender);let i;return i=e.data?Zy.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256,bytes)",[n,t,jy(e.tokenId),e.data]):Zy.INTERFACE.encodeFunctionData("safeTransferFrom(address,address,uint256)",[n,t,jy(e.tokenId)]),{calldata:i,value:jy(0)}}static getPermitData(e,t,n){return{domain:{name:"Uniswap V3 Positions NFT-V1",chainId:n,version:"1",verifyingContract:t},types:Hy,values:e}}}Zy.INTERFACE=new Rf(Dy);var zy=[{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 Rf([{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 Rf(zy);new Rf([{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 $y({removed:e,inRange:t}){const n=a(),o={py:4,px:8,color:n.palette.success.main,borderRadius:4,backgroundColor:T(n.palette.success.main,.1),typography:"h6"};return e?In.jsx(l,{title:le._({id:"MZPP7t",message:"Your position has 0 liquidity, and is not earning fees."}),maxWidth:240,children:In.jsx(i,{sx:Object.assign(Object.assign({},o),{color:n.palette.warning.main,backgroundColor:T(n.palette.warning.main,.1)}),children:le._({id:"D87pha",message:"Closed"})})}):t?In.jsx(l,{title:le._({id:"aIvv/z",message:"The price of this pool is within your selected range. Your position is currently earning fees."}),maxWidth:240,children:In.jsx(i,{sx:o,children:le._({id:"vOyUlD",message:"In range"})})}):In.jsx(l,{title:le._({id:"IwiTcw",message:"The price of this pool is outside of your selected range. Your position is not currently earning fees."}),maxWidth:240,children:In.jsx(i,{sx:Object.assign(Object.assign({},o),{color:n.palette.error.main,backgroundColor:T(n.palette.error.main,.1)}),children:le._({id:"i3Z+/Z",message:"Out of range"})})})}new Rf([{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 Gy=({token:e,amount:t})=>{var n;const o=a();return In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(Fc,{address:null!==(n=null==e?void 0:e.address)&&void 0!==n?n:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:18,height:18,marginRight:0}),In.jsxs(i,{sx:{typography:"body1",color:o.palette.text.primary},children:[Ps({input:t.toSignificant(),decimals:null==e?void 0:e.decimals})," ",null==e?void 0:e.symbol]}),In.jsx(d,{sx:{display:"flex",alignItems:"center",color:o.palette.text.secondary,"&:hover":{color:o.palette.text.primary}},onClick:()=>{window.open(ad(e.chainId,null==e?void 0:e.address,"address"))},children:In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:In.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"})})})]})},Yy=({position:t,inRange:n})=>{var o;const r=a(),s=t.pool.token0,l=t.pool.token1,c=t.pool.chainId,u=(null==t?void 0:t.liquidity)&&en.equal(null==t?void 0:t.liquidity,en.BigInt(0)),p=Z((()=>My.getAddress(t.pool.token0,t.pool.token1,t.pool.fee,void 0,c?Ax[c]:void 0)),[c,t.pool.fee,t.pool.token0,t.pool.token1]);return In.jsxs(i,{sx:{border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:r.spacing(12,20),borderBottomStyle:"solid",borderBottomColor:"border.main",borderBottomWidth:1},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[In.jsxs(i,{sx:{typography:"body2",color:r.palette.text.primary},children:[le._({id:"PVa3KL",message:"Position on"})," ",null==s?void 0:s.symbol,"/",null==l?void 0:l.symbol]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx($y,{removed:u,inRange:n}),In.jsx(i,{sx:{py:4,px:8,color:r.palette.text.secondary,borderRadius:4,backgroundColor:r.palette.background.tag,typography:"h6"},children:Gs({input:(null===(o=null==t?void 0:t.pool)||void 0===o?void 0:o.fee)/1e6})})]})]}),In.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:0,typography:"body2",color:r.palette.text.secondary,"&:hover":{color:r.palette.text.primary}},onClick:()=>{window.open(ad(c,p,"address"))},children:[le._({id:"URmyfc",message:"Details"}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:In.jsx("path",{d:"M7.5 5L6.4425 6.0575L9.8775 9.5L6.4425 12.9425L7.5 14L12 9.5L7.5 5Z",fill:"currentColor"})})]})]}),In.jsxs(i,{sx:{p:r.spacing(12,20)},children:[In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),In.jsxs(i,{sx:{mt:12},children:[In.jsx(Gy,{token:s,amount:t.amount0}),In.jsx(Gy,{token:l,amount:t.amount1})]})]})]})};function Qy({price:e,atLimit:t,direction:n}){return t[n]?n===dx.LOWER?"0":"∞":"string"==typeof e&&"∞"===e?"∞":Ps({input:"string"==typeof e?e:null==e?void 0:e.toSignificant()})}const Xy=({baseToken:e,quoteToken:t,handleRateToggle:n,sx:o})=>{const r=a(),s=null==e?void 0:e.wrapped,l=null==t?void 0:t.wrapped,c=s&&l&&s.sortsBefore(l);return In.jsx(i,{component:d,onClick:n,sx:Object.assign({display:"flex",alignItems:"center",p:1,borderRadius:8,backgroundColor:r.palette.border.main},o),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",width:"100%",[r.breakpoints.up("tablet")]:{width:"auto"}},children:[In.jsx(i,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},c?{color:r.palette.text.primary,backgroundColor:r.palette.background.paper}:{color:r.palette.text.secondary,backgroundColor:"transparent"}),children:c?e.symbol:null==t?void 0:t.symbol}),In.jsx(i,{sx:Object.assign({flexGrow:1,flexShrink:1,flexBasis:"50%",px:12,py:4,borderRadius:7,textAlign:"center",typography:"h6",whiteSpace:"nowrap"},c?{color:r.palette.text.secondary,backgroundColor:"transparent"}:{color:r.palette.text.primary,backgroundColor:r.palette.background.paper}),children:c?t.symbol:null==e?void 0:e.symbol})]})})},Ky=({position:t,title:n,baseCurrencyDefault:o,ticksAtLimit:r})=>{const s=t.pool.token0,l=t.pool.token1,d=a(),[c,u]=$(o?o===s?s:o===l?l:s:s),p=c===s,h=p?l:s,m=p?t.pool.priceOf(t.pool.token0):t.pool.priceOf(t.pool.token1),g=p?t.token0PriceLower:t.token0PriceUpper.invert(),f=p?t.token0PriceUpper:t.token0PriceLower.invert(),x=z((()=>{u(h)}),[h]);return In.jsxs(fx,{gap:"md",children:[In.jsxs(yx,{children:[n?In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:d.palette.text.secondary},children:n}):In.jsx("div",{}),In.jsx(Xy,{baseToken:p?s:l,quoteToken:p?l:s,handleRateToggle:x})]}),In.jsxs(yx,{children:[In.jsxs(hx,{sx:{width:"48%",py:12,gap:12},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:4},children:[In.jsx(i,{sx:{color:d.palette.text.primary,typography:"body2"},children:In.jsx(e,{id:"EQs1sJ",message:"Min price"})}),In.jsx(i,{sx:{color:d.palette.text.secondary,typography:"h6"},children:In.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),In.jsx(i,{sx:{color:d.palette.text.primary,typography:"caption"},children:Qy({price:g,atLimit:r,direction:dx.LOWER})}),In.jsx(i,{sx:{color:d.palette.text.secondary,typography:"h6"},children:In.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==c?void 0:c.symbol}})})]}),In.jsxs(hx,{sx:{width:"48%",py:12,gap:12},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:4},children:[In.jsx(i,{sx:{color:d.palette.text.primary,typography:"body2"},children:In.jsx(e,{id:"5etEUX",message:"Max price"})}),In.jsx(i,{sx:{color:d.palette.text.secondary,typography:"h6"},children:In.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),In.jsx(i,{sx:{color:d.palette.text.primary,typography:"caption"},children:Qy({price:f,atLimit:r,direction:dx.UPPER})}),In.jsx(i,{sx:{color:d.palette.text.secondary,typography:"h6"},children:In.jsx(e,{id:"WgTuci",message:"Your position will be 100% composed of {0} at this price",values:{0:null==h?void 0:h.symbol}})})]})]}),In.jsxs(hx,{sx:{py:12,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(fx,{gap:"4px",justify:"flex-start",children:[In.jsx(i,{sx:{color:d.palette.text.primary,typography:"body2"},children:In.jsx(e,{id:"DWd30U",message:"Current price"})}),In.jsx(i,{sx:{color:d.palette.text.secondary,typography:"h6"},children:In.jsx(e,{id:"7Z4WfS",message:"{0} per {1}",values:{0:h.symbol,1:c.symbol}})})]}),In.jsx(i,{sx:{color:d.palette.text.primary,typography:"caption"},children:`${Ps({input:m.toSignificant()})} `})]})]})},Jy=({chainId:e,disabled:t,removed:n,isLoading:i,error:o,onConfirm:r})=>In.jsx(cx,{includeButton:!0,fullWidth:!0,chainId:e,children:In.jsx(c,{fullWidth:!0,size:c.Size.big,onClick:r,disabled:t,isLoading:i,children:n?le._({id:"D87pha",message:"Closed"}):null!=o?o:le._({id:"t/YqKh",message:"Remove"})})}),ev={[Kx.LOWEST]:{label:"0.01%"},[Kx.LOW_200]:{label:"0.02%"},[Kx.LOW_300]:{label:"0.03%"},[Kx.LOW_400]:{label:"0.04%"},[Kx.LOW]:{label:"0.05%"},[Kx.MEDIUM]:{label:"0.30%"},[Kx.HIGH]:{label:"1.00%"}},tv=({poolType:e})=>{const t="AMM V2"===e?N.error.main:"AMM V3"===e?N.purple.main:N.success.main;return In.jsx(i,{sx:{px:8,height:24,typography:"h6",lineHeight:"24px",borderRadius:4,background:T(t,.1),color:t,whiteSpace:"nowrap"},children:e})},nv=({isAMMV2:t,isAMMV3:n,lpFeeRate:o,mtFeeRate:r})=>{var a,s;return In.jsx(l,{title:In.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:In.jsx(i,{sx:{px:8,height:24,typography:"h6",lineHeight:"24px",borderRadius:4,backgroundColor:"background.tag",color:"text.secondary",whiteSpace:"nowrap"},children:n?null!==(s=null===(a=ev[o])||void 0===a?void 0:a.label)&&void 0!==s?s:"-":Gs({input:new Le(null!=o?o:0).plus(r?Us(r,t?4:18):0)})})})},iv=({sx:e})=>In.jsx(tv,{poolType:"AMM V3"}),ov=({position:t,title:n,inRange:o,baseCurrencyDefault:r,ticksAtLimit:a})=>{var s,l,d;const c=t.pool.token0,u=t.pool.token1,p=(null==t?void 0:t.liquidity)&&en.equal(null==t?void 0:t.liquidity,en.BigInt(0));return In.jsxs(fx,{gap:"md",style:{marginTop:"0.5rem"},children:[In.jsxs(yx,{style:{gap:4},children:[In.jsxs(vx,{children:[In.jsx(gg,{tokens:[{address:c.address},{address:u.address}],mr:8}),In.jsxs(i,{sx:{typography:"h5"},children:[null==c?void 0:c.symbol," / ",null==u?void 0:u.symbol]})]}),In.jsx(iv,{sx:{ml:"auto"}}),In.jsx($y,{removed:p,inRange:o})]}),In.jsxs(hx,{children:[In.jsxs(fx,{gap:"md",children:[In.jsxs(yx,{children:[In.jsxs(vx,{children:[In.jsx(Fc,{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}),In.jsx(i,{sx:{ml:8},children:null==c?void 0:c.symbol})]}),In.jsx(vx,{children:In.jsx(i,{sx:{mr:8},children:Ps({input:t.amount0.toSignificant(),decimals:null==c?void 0:c.decimals})})})]}),In.jsxs(yx,{children:[In.jsxs(vx,{children:[In.jsx(Fc,{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}),In.jsx(i,{ml:"8px",children:null==u?void 0:u.symbol})]}),In.jsx(vx,{children:In.jsx(i,{mr:"8px",children:Ps({input:t.amount1.toSignificant(),decimals:null==u?void 0:u.decimals})})})]})]}),In.jsxs(yx,{children:[In.jsx(i,{children:In.jsx(e,{id:"EU3wU4",message:"Fee tier"})}),In.jsx(i,{children:Gs({input:(null===(d=null==t?void 0:t.pool)||void 0===d?void 0:d.fee)/1e6})})]})]}),In.jsx(Ky,{position:t,title:n,baseCurrencyDefault:r,ticksAtLimit:a})]})},rv=({on:e,onClose:t,position:n,outOfRange:o,ticksAtLimit:r,onConfirm:a,loading:s})=>{const{isMobile:l}=Sd();return In.jsx(Rc,{open:e,onClose:t,modal:!0,title:le._({id:"E6MqGy",message:"Add liquidity"}),height:683,children:In.jsxs(i,{sx:{flex:1,px:20,pb:24,display:"flex",flexDirection:"column",justifyContent:"space-between",width:l?void 0:420},children:[In.jsx(i,{sx:{pt:0,px:0},children:n?In.jsx(ov,{position:n,inRange:!o,ticksAtLimit:r,title:le._({id:"3VUfrF",message:"Selected Range"})}):null}),In.jsx(c,{size:c.Size.big,fullWidth:!0,isLoading:s,sx:{mt:20},onClick:a,children:le._({id:"m16xKo",message:"Add"})})]})})};class av{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:ry({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&&en.EQ(a.sqrtRatioX96,i)&&en.EQ(a.liquidity,o)&&a.tickCurrent===r));if(a)return a;const s=new My(e,t,n,i,o,r);return this.pools.unshift(s),s}}var sv;function lv(e,t,n){const i=Z((()=>[[e,t,n]]),[e,t,n]);return function(e,t){const n=Z((()=>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]),i=Z((()=>{const t=e&&Ax[e];return t?n.map((n=>n&&av.getPoolAddress(t,...n,e))):new Array(n.length)}),[e,n]),{data:o}=Xe({queries:i.map((t=>Xl.getV3PoolSlot0(e,t))),combine:e=>({data:e.map((e=>e.data))})}),{data:r}=Xe({queries:i.map((t=>Xl.getV3PoolLiquidity(e,t))),combine:e=>({data:e.map((e=>e.data))})});return Z((()=>t.map(((e,t)=>{const i=n[t];if(!i)return[sv.INVALID,null];const[a,s,l]=i;if(!o[t])return[sv.NOT_EXISTS,null];const d=o[t];if(!r[t])return[sv.NOT_EXISTS,null];const c=r[t];if(!d||!c)return[sv.NOT_EXISTS,null];if(!d.sqrtPriceX96||d.sqrtPriceX96.eq(0))return[sv.NOT_EXISTS,null];try{const e=av.getPool(a,s,l,d.sqrtPriceX96,c[0],d.tick);return[sv.EXISTS,e]}catch(e){return console.error(e,{tags:{file:"usePools",function:"usePools"},extra:{token0:a.address,token1:s.address,chainId:a.chainId,fee:l}}),[sv.NOT_EXISTS,null]}}))),[r,t,o,n])}(null==e?void 0:e.chainId,i)[0]}av.MAX_ENTRIES=128,av.pools=[],av.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"}(sv||(sv={}));class dv{constructor(e){const t=ve[e];this.chainId=e,this.decimals=t.decimals,this.name=t.name,this.symbol=t.symbol,this.isNative=!0,this.isToken=!1,this.address=cv(this.chainId)}equals(e){return e.isNative&&e.chainId===this.chainId}get wrapped(){const e=ve[this.chainId];return new Wx(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 dv(e)}}function cv(e){return ve[e].address}function uv(e,t){const n=null==e?void 0:e.toLowerCase(),i=null==t?void 0:t.toLowerCase();return null!==n&&null!==i&&n===i}dv._cachedNativeCurrency={};const pv=(e,t)=>!t||uv(t,cv(e));function hv(e){if(!e)return;const{name:t,chainId:n,address:i,decimals:o,symbol:r}=e;return function(e,t){return!pv(e,t)}(n,i)?new Wx(n,i,o,null!=r?r:void 0,null!=t?t:void 0):new dv(n)}function mv(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 gv(e,t,n){if(e&&t&&"number"==typeof n)return Iy(e,t,n)}function fv(e,t){if(e&&t&&!isNaN(parseFloat(e)))try{const n=nn(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 Px.fromRawAmount(t,en.BigInt(n))}catch(t){console.error("tryParseCurrencyAmount","tryParseCurrencyAmount",`Failed to parse input amount: "${e}"`,t)}}function xv(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=en.BigInt((null!=o?o:"")+(null!=r?r:""));return new Fx(e,t,en.multiply(en.BigInt(10**a),en.BigInt(10**e.decimals)),en.multiply(s,en.BigInt(10**t.decimals)))}(e,t,i);if(!o)return;let r;const a=Cy(o.numerator,o.denominator);return r=en.greaterThanOrEqual(a,cy.MAX_SQRT_RATIO)?cy.MAX_TICK:en.lessThanOrEqual(a,cy.MIN_SQRT_RATIO)?cy.MIN_TICK:Sy(o),Ay(r,Jx[n])}function yv({state:e,existingPosition:t}){var n,i,o,r,a,s,l,d,c,u,p,h,m;const{account:g,chainId:f}=hd(),{feeAmount:x,independentField:y,typedValue:v,leftRangeTypedValue:b,rightRangeTypedValue:j,startPriceTypedValue:C}=e,w=null!==(n=e.baseToken)&&void 0!==n?n:void 0,k=null!==(i=e.baseToken)&&void 0!==i?i:void 0,T=null!==(o=e.quoteToken)&&void 0!==o?o:void 0,E=y===lx.CURRENCY_A?lx.CURRENCY_B:lx.CURRENCY_A,A=Z((()=>({[lx.CURRENCY_A]:w,[lx.CURRENCY_B]:T})),[w,T]),[I,S,L]=Z((()=>[null==w?void 0:w.wrapped,null==T?void 0:T.wrapped,null==k?void 0:k.wrapped]),[w,T,k]),[O,R]=Z((()=>I&&S?I.sortsBefore(S)?[I,S]:[S,I]:[void 0,void 0]),[I,S]),M=Qe(Ea.getFetchTokenQuery(null===(r=A[lx.CURRENCY_A])||void 0===r?void 0:r.chainId,null===(a=A[lx.CURRENCY_A])||void 0===a?void 0:a.address,g)),_=Qe(Ea.getFetchTokenQuery(null===(s=A[lx.CURRENCY_B])||void 0===s?void 0:s.chainId,null===(l=A[lx.CURRENCY_B])||void 0===l?void 0:l.address,g)),P=Z((()=>{var e,t,n,i,o,r;return{[lx.CURRENCY_A]:A[lx.CURRENCY_A]?(null===(e=M.data)||void 0===e?void 0:e.balance)?Px.fromRawAmount(A[lx.CURRENCY_A],en.BigInt(null===(t=M.data)||void 0===t?void 0:t.balance.multipliedBy(Math.pow(10,null!==(n=A[lx.CURRENCY_A].decimals)&&void 0!==n?n:18)).toString())):Px.fromRawAmount(A[lx.CURRENCY_A],0):void 0,[lx.CURRENCY_B]:A[lx.CURRENCY_B]?(null===(i=_.data)||void 0===i?void 0:i.balance)?Px.fromRawAmount(A[lx.CURRENCY_B],en.BigInt(null===(o=_.data)||void 0===o?void 0:o.balance.multipliedBy(Math.pow(10,null!==(r=A[lx.CURRENCY_B].decimals)&&void 0!==r?r:18)).toString())):Px.fromRawAmount(A[lx.CURRENCY_B],0):void 0}}),[A,null===(d=M.data)||void 0===d?void 0:d.balance,null===(c=_.data)||void 0===c?void 0:c.balance]),[B,D]=lv(A[lx.CURRENCY_A],A[lx.CURRENCY_B],x),N=B===sv.NOT_EXISTS,F=Boolean(L&&O&&!L.equals(O)),U=Z((()=>{var e;if(!N)return D&&O?D.priceOf(O):void 0;{const t=fv(C,F?O:R);if(t&&O&&R){const n=fv("1",F?R:O),i=n&&t?new Fx(n.currency,t.currency,n.quotient,t.quotient):void 0;return null!==(e=F?null==i?void 0:i.invert():i)&&void 0!==e?e:void 0}}}),[N,C,F,R,O,D]),q=Z((()=>{const e=U?Cy(U.numerator,U.denominator):void 0;return U&&e&&!(en.greaterThanOrEqual(e,cy.MIN_SQRT_RATIO)&&en.lessThan(e,cy.MAX_SQRT_RATIO))}),[U]),V=Z((()=>{if(I&&S&&x&&U&&!q){const e=Sy(U),t=cy.getSqrtRatioAtTick(e);return new My(I,S,x,t,en.BigInt(0),e,[])}}),[x,q,U,I,S]),W=null!=D?D:V,H=Z((()=>({[dx.LOWER]:x?Ay(cy.MIN_TICK,Jx[x]):void 0,[dx.UPPER]:x?Ay(cy.MAX_TICK,Jx[x]):void 0})),[x]),z=Z((()=>({[dx.LOWER]:"number"==typeof(null==t?void 0:t.tickLower)?t.tickLower:F&&"boolean"==typeof j||!F&&"boolean"==typeof b?H[dx.LOWER]:F?xv(R,O,x,j.toString()):xv(O,R,x,b.toString()),[dx.UPPER]:"number"==typeof(null==t?void 0:t.tickUpper)?t.tickUpper:!F&&"boolean"==typeof j||F&&"boolean"==typeof b?H[dx.UPPER]:F?xv(R,O,x,b.toString()):xv(O,R,x,j.toString())})),[t,x,F,b,j,H,O,R]),{[dx.LOWER]:G,[dx.UPPER]:Y}=z||{},Q=Z((()=>({[dx.LOWER]:x&&G===H.LOWER,[dx.UPPER]:x&&Y===H.UPPER})),[H,G,Y,x]),X=Boolean("number"==typeof G&&"number"==typeof Y&&G>=Y),K=Z((()=>({[dx.LOWER]:gv(O,R,H.LOWER),[dx.UPPER]:gv(O,R,H.UPPER)})),[O,R,H.LOWER,H.UPPER]),J=Z((()=>({[dx.LOWER]:gv(O,R,z[dx.LOWER]),[dx.UPPER]:gv(O,R,z[dx.UPPER])})),[O,R,z]),{[dx.LOWER]:ee,[dx.UPPER]:te}=J,ne=Boolean(!X&&U&&ee&&te&&(U.lessThan(ee)||U.greaterThan(te))),ie=fv(v,A[y]),oe=Z((()=>{const e=null==ie?void 0:ie.wrapped,t=E===lx.CURRENCY_B?T:w;if(ie&&e&&"number"==typeof G&&"number"==typeof Y&&W){if(ne||X)return;const n=e.currency.equals(W.token0)?_y.fromAmount0({pool:W,tickLower:G,tickUpper:Y,amount0:ie.quotient,useFullPrecision:!0}):_y.fromAmount1({pool:W,tickLower:G,tickUpper:Y,amount1:ie.quotient}),i=e.currency.equals(W.token0)?n.amount1:n.amount0;return t&&Px.fromRawAmount(t,i.quotient)}}),[ie,ne,E,T,w,G,Y,W,X]),re=Z((()=>({[lx.CURRENCY_A]:y===lx.CURRENCY_A?ie:oe,[lx.CURRENCY_B]:y===lx.CURRENCY_A?oe:ie})),[oe,ie,y]),ae=Boolean("number"==typeof Y&&W&&W.tickCurrent>=Y),se=Boolean("number"==typeof G&&W&&W.tickCurrent<=G),de=X||Boolean(ae&&W&&I&&W.token0.equals(I)||se&&W&&I&&W.token1.equals(I)),ce=X||Boolean(ae&&W&&S&&W.token0.equals(S)||se&&W&&S&&W.token1.equals(S)),{inputTax:ue,outputTax:pe}=function(e,t,n){const[{inputTax:i,outputTax:o},r]=$({inputTax:Qx,outputTax:Qx});return{inputTax:i,outputTax:o}}((null==w?void 0:w.isToken)&&w.address,(null==T?void 0:T.isToken)&&T.address),he=Z((()=>{var e,t;if(!W||!I||!S||"number"!=typeof G||"number"!=typeof Y||X)return;const n=ae?Gx:null===(e=null==re?void 0:re[I.equals(W.token0)?lx.CURRENCY_A:lx.CURRENCY_B])||void 0===e?void 0:e.quotient,i=se?Gx:null===(t=null==re?void 0:re[I.equals(W.token0)?lx.CURRENCY_B:lx.CURRENCY_A])||void 0===t?void 0:t.quotient;return void 0!==n&&void 0!==i?_y.fromAmounts({pool:W,tickLower:G,tickUpper:Y,amount0:n,amount1:i,useFullPrecision:!0}):void 0}),[re,W,I,S,ae,se,X,G,Y]);let me;g||(me=le._({id:"r7ScnQ",message:"Connect to a wallet"})),B===sv.INVALID&&(me=null!=me?me:le._({id:"R7D79P",message:"Invalid pair"})),q&&(me=null!=me?me:le._({id:"HXBqgG",message:"Invalid price input"})),(re[lx.CURRENCY_A]||de)&&(re[lx.CURRENCY_B]||ce)||(me=null!=me?me:le._({id:"iPMIoT",message:"Enter an amount"}));const{[lx.CURRENCY_A]:ge,[lx.CURRENCY_B]:fe}=re;ge&&(null===(u=null==P?void 0:P[lx.CURRENCY_A])||void 0===u?void 0:u.lessThan(ge))&&(me=le._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(p=A[lx.CURRENCY_A])||void 0===p?void 0:p.symbol}})),fe&&(null===(h=null==P?void 0:P[lx.CURRENCY_B])||void 0===h?void 0:h.lessThan(fe))&&(me=le._({id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(m=A[lx.CURRENCY_B])||void 0===m?void 0:m.symbol}}));const xe=ue.greaterThan(0)||pe.greaterThan(0),ye=B===sv.INVALID||xe;return{dependentField:E,currencies:A,pool:D,poolState:B,currencyBalances:P,parsedAmounts:re,ticks:z,price:U,pricesAtTicks:J,pricesAtLimit:K,position:he,noLiquidity:N,errorMessage:me,invalidPool:ye,invalidRange:X,outOfRange:ne,depositADisabled:de,depositBDisabled:ce,invertPrice:F,ticksAtLimit:Q,isTaxed:xe}}var vv;function bv(e,t){switch(t.type){case vv.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:hv(n)})}case vv.UpdateDefaultBaseToken:{const n=t.payload;return e.baseToken?e:Object.assign(Object.assign({},e),{baseToken:hv(n)})}case vv.UpdateQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{quoteToken:hv(n)})}case vv.UpdateDefaultQuoteToken:{const n=t.payload;return e.quoteToken?e:Object.assign(Object.assign({},e),{quoteToken:hv(n)})}case vv.UpdateBaseTokenAndClearQuoteToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:hv(n),quoteToken:null})}case vv.UpdateFeeAmount:return Object.assign(Object.assign({},e),{feeAmount:t.payload});case vv.ToggleRate:{const{baseToken:t,quoteToken:n}=e;return Object.assign(Object.assign({},e),{baseToken:n,quoteToken:t})}case vv.setFullRange:return Object.assign(Object.assign({},e),{leftRangeTypedValue:!0,rightRangeTypedValue:!0});case vv.typeStartPriceInput:return Object.assign(Object.assign({},e),{startPriceTypedValue:t.payload.typedValue});case vv.typeLeftRangeInput:return Object.assign(Object.assign({},e),{leftRangeTypedValue:t.payload.typedValue});case vv.typeRightRangeInput:return Object.assign(Object.assign({},e),{rightRangeTypedValue:t.payload.typedValue});case vv.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 jv({noLiquidity:e,dispatch:t}){return{onFieldAInput:z((n=>{t({type:vv.typeInput,payload:{field:lx.CURRENCY_A,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onFieldBInput:z((n=>{t({type:vv.typeInput,payload:{field:lx.CURRENCY_B,typedValue:n,noLiquidity:!0===e}})}),[t,e]),onLeftRangeInput:z((e=>{t({type:vv.typeLeftRangeInput,payload:{typedValue:e}})}),[t]),onRightRangeInput:z((e=>{t({type:vv.typeRightRangeInput,payload:{typedValue:e}})}),[t]),onStartPriceInput:z((e=>{t({type:vv.typeStartPriceInput,payload:{typedValue:e}})}),[t])}}function Cv(e){return e?Ix[e]:void 0}function wv(e,t){const n=Cv(t),i=Z((()=>e?e.map((e=>[e])):[]),[e]),o=Qe(Xl.getPositions(t,n,i)),r=o.isLoading,a=o.error,s=Z((()=>{var t;if(!r&&!a&&e)return null===(t=o.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()})))}),[r,a,o,e]);return{loading:r,positions:null==s?void 0:s.map(((e,t)=>Object.assign(Object.assign({},e),{tokenId:i[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"}(vv||(vv={}));const kv=en.exponentiate(en.BigInt(10),en.BigInt(16));function Tv(e){if(e)return e.currency.isNative?en.greaterThan(e.quotient,kv)?Px.fromRawAmount(e.currency,en.subtract(e.quotient,kv)):Px.fromRawAmount(e.currency,en.BigInt(0)):e}const Ev=1e4,Av=100*Ev;function Iv(e){const t=Math.floor(Number(e)*Ev);return new Nx(t,Av)}const Sv=({token:e,amount:t})=>{var n;const o=a();return In.jsxs(i,{sx:{py:8,display:"flex",alignItems:"center",gap:6,typography:"h5",color:o.palette.text.primary},children:[In.jsx(Fc,{address:null!==(n=null==e?void 0:e.address)&&void 0!==n?n:"",chainId:null==e?void 0:e.chainId,noShowChain:!0,width:24,height:24,marginRight:0}),In.jsx(i,{children:null==e?void 0:e.symbol}),In.jsx(i,{sx:{ml:"auto"},children:Ps({input:null==t?void 0:t.toSignificant(),decimals:null==e?void 0:e.decimals})})]})},Lv=({chainId:e,baseToken:t,quoteToken:n,feeAmount:o,tokenId:r,onClose:s})=>{var l,d;const{isMobile:c}=Sd(),u=a(),p=Wd(),h=Ke(),{account:m}=hd(),{position:g,loading:f}=function(e,t){var n;const i=wv(e?[e]:void 0,t);return{loading:i.loading,position:null===(n=i.positions)||void 0===n?void 0:n[0]}}(r,e),x=!!g&&!f,{position:y}=function(e,t,n){const i=Z((()=>t?hv(t):void 0),[t]),o=Z((()=>n?hv(n):void 0),[n]),[,r]=lv(null!=i?i:void 0,null!=o?o:void 0,null==e?void 0:e.fee);let a;return r&&e&&(a=new _y({pool:r,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})),{position:a,pool:null!=r?r:void 0}}(g,t,n),[v,b]=$("stake"),[j,C]=$(!1),[w,k]=$(ax),[T,E]=ee(bv,{baseToken:hv(t),quoteToken:hv(n),feeAmount:o,independentField:lx.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""}),{independentField:I,typedValue:S,startPriceTypedValue:O}=T,{pool:R,ticks:M,dependentField:_,price:P,pricesAtTicks:B,pricesAtLimit:D,parsedAmounts:N,currencyBalances:U,position:q,noLiquidity:V,currencies:W,errorMessage:H,invalidPool:z,invalidRange:G,outOfRange:Y,depositADisabled:Q,depositBDisabled:X,invertPrice:K,ticksAtLimit:J,isTaxed:te}=yv({state:T,existingPosition:y}),{position:ne,liquidityPercentage:ie,liquidityValue0:oe,liquidityValue1:re,feeValue0:ae,feeValue1:se,error:de}=function({percent:e,position:t,asWETH:n,baseToken:i,quoteToken:o}){const{account:r,chainId:a}=hd(),[s,l]=Z((()=>[null==i?void 0:i.wrapped,null==o?void 0:o.wrapped]),[i,o]),[d,c]=Z((()=>s&&l?s.sortsBefore(l)?[s,l]:[l,s]:[void 0,void 0]),[s,l]),[,u]=lv(null!=d?d:void 0,null!=c?c:void 0,null==t?void 0:t.fee),p=Z((()=>u&&(null==t?void 0:t.liquidity)&&"number"==typeof(null==t?void 0:t.tickLower)&&"number"==typeof(null==t?void 0:t.tickUpper)?new _y({pool:u,liquidity:t.liquidity.toString(),tickLower:t.tickLower,tickUpper:t.tickUpper}):void 0),[u,t]),h=new Nx(e,100),m=p?h.multiply(p.amount0.quotient).quotient:void 0,g=p?h.multiply(p.amount1.quotient).quotient:void 0,f=d&&m?Px.fromRawAmount(d,m):void 0,x=c&&g?Px.fromRawAmount(c,g):void 0,y=!(!u||!t)&&(u.tickCurrent<t.tickLower||u.tickCurrent>t.tickUpper);let v;return r||(v=le._({id:"r7ScnQ",message:"Connect to a wallet"})),0===e&&(v=null!=v?v:le._({id:"Sta9CR",message:"Enter a percent"})),{position:p,liquidityPercentage:h,liquidityValue0:f,liquidityValue1:x,feeValue0:void 0,feeValue1:void 0,outOfRange:y,error:v}}({position:g,asWETH:void 0,percent:w,baseToken:T.baseToken,quoteToken:T.quoteToken}),ce="0"===(null==g?void 0:g.liquidity),[ue,pe]=function({chainId:e,pool:t,tokenId:n,asWETH:i}){var o;const r=Cv(e),a=null===(o=St.from(n))||void 0===o?void 0:o.toHexString(),s=Qe(Xl.getOwner(e,r,n)),l=Qe(Xl.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?[Px.fromRawAmount(t.token0,l.data.amount0.toString()),Px.fromRawAmount(t.token1,l.data.amount1.toString())]:[void 0,void 0]}({pool:null!=R?R:void 0,tokenId:r,asWETH:!1,chainId:e}),he=pe,me=ue;Z((()=>{var e;return null===(e=K?null==P?void 0:P.invert():P)||void 0===e?void 0:e.toSignificant()}),[K,P]);const{onFieldAInput:ge,onFieldBInput:fe,onLeftRangeInput:xe,onRightRangeInput:ye,onStartPriceInput:ve}=jv({noLiquidity:V,dispatch:E}),{slipper:je,setSlipper:Ce,slipperValue:we,resetSlipper:ke}=ox({address:void 0,type:"AMMV3"}),Te=!H&&!G,Ee=Z((()=>{var e,t;return{[I]:S,[_]:null!==(t=null===(e=N[_])||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""}}),[_,I,N,S]),Ae=Z((()=>[lx.CURRENCY_A,lx.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:Tv(U[t])})),{})),[U]),Ie=cc(mv(null===(l=N[lx.CURRENCY_A])||void 0===l?void 0:l.currency),{contractAddress:Ix[e],overrideBalance:U[lx.CURRENCY_A]?new Le(U[lx.CURRENCY_A].toSignificant()):void 0,amount:N[lx.CURRENCY_A]?new Le(N[lx.CURRENCY_A].toSignificant()):void 0}),Se=cc(mv(null===(d=N[lx.CURRENCY_B])||void 0===d?void 0:d.currency),{contractAddress:Ix[e],overrideBalance:U[lx.CURRENCY_B]?new Le(U[lx.CURRENCY_B].toSignificant()):void 0,amount:N[lx.CURRENCY_B]?new Le(N[lx.CURRENCY_B].toSignificant()):void 0}),{[dx.LOWER]:Oe,[dx.UPPER]:Re}=M,{[dx.LOWER]:Me,[dx.UPPER]:_e}=B,{deadLine:Pe}=On(),Be=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(!m||!e||!q)return;if(!T.baseToken||!T.quoteToken)return;const t=Math.ceil(Date.now()/1e3)+(null!=Pe?Pe:600),n=T.baseToken.isNative?T.baseToken:T.quoteToken.isNative?T.quoteToken:void 0;try{const{calldata:i,value:o}=Zy.addCallParameters(q,{tokenId:r,slippageTolerance:Iv(100*we),deadline:t.toString(),useNative:n});let a={to:Ix[e],data:i,value:o};(yield p.execute(le._({id:"OBdohg",message:"Add Liquidity"}),Object.assign({opcode:Dd.TX},a),{early:!1,metadata:{[Od.addAMMV3Pool]:"1"}}))===Rd.Success&&(C(!1),setTimeout((()=>{null==s||s()}),100)),h.invalidateQueries({queryKey:[be,"ammv3"],refetchType:"all"})}catch(e){console.error("onAddMutation",e)}}))}),De=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(!(m&&e&&ne&&ie&&oe&&re))return;const t=Math.ceil(Date.now()/1e3)+(null!=Pe?Pe:600);try{const{calldata:n,value:i}=Zy.removeCallParameters(ne,{tokenId:r.toString(),liquidityPercentage:ie,slippageTolerance:Iv(100*we),deadline:t.toString(),collectOptions:{expectedCurrencyOwed0:null!=ae?ae:Px.fromRawAmount(oe.currency,0),expectedCurrencyOwed1:null!=se?se:Px.fromRawAmount(re.currency,0),recipient:m}});let o={to:Ix[e],data:n,value:i};(yield p.execute(le._({id:"3XBvkd",message:"Remove Liquidity"}),Object.assign({opcode:Dd.TX},o),{early:!1,metadata:{[Od.removeAMMV3Pool]:"1"}}))===Rd.Success&&setTimeout((()=>{null==s||s()}),100),h.invalidateQueries({queryKey:[be,"ammv3"],refetchType:"all"})}catch(e){console.error("onRemoveMutation",e)}}))}),Ne=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(m&&e&&R)try{const{calldata:t,value:n}=Zy.collectCallParameters({tokenId:r.toString(),expectedCurrencyOwed0:null!=ue?ue:Px.fromRawAmount(R.token0,0),expectedCurrencyOwed1:null!=pe?pe:Px.fromRawAmount(R.token1,0),recipient:m});let i={to:Ix[e],data:t,value:n};(yield p.execute(le._({id:"zXCpR0",message:"Claim Rewards"}),Object.assign({opcode:Dd.TX},i),{early:!1,metadata:{[Od.claimAMMV3Pool]:"1"}}))===Rd.Success&&setTimeout((()=>{null==s||s()}),100),h.invalidateQueries({queryKey:[be,"ammv3"],refetchType:"all"})}catch(e){console.error("onClaimMutation",e)}}))}),Fe=Z((()=>{var t,n,o,r;const a=[{key:"stake",value:le._({id:"m16xKo",message:"Add"})},{key:"unstake",value:le._({id:"t/YqKh",message:"Remove"})},{key:"claim",value:le._({id:"hom7qf",message:"Claim"})}];return In.jsxs(i,{sx:{borderRadius:16,backgroundColor:u.palette.background.paper},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:24,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:u.palette.background.paper},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:le._({id:"E6MqGy",message:"Add liquidity"})}),s?In.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:In.jsx(i,{component:Un.Error,sx:{width:16,height:16},onClick:()=>{s()}})}):void 0]}),x&&y&&In.jsx(i,{sx:{mx:20,mb:16},children:In.jsx(Yy,{position:y,inRange:!Y})}),In.jsxs(A,{value:v,onChange:(e,t)=>{b(t)},children:[In.jsx(F,{tabs:a,variant:"inPaper",tabsListSx:{mx:20}}),In.jsxs(L,{value:"stake",children:[x&&y&&In.jsx(i,{sx:{mt:16,mx:20},children:In.jsx(Ky,{position:y,title:le._({id:"3VUfrF",message:"Selected Range"}),ticksAtLimit:J})}),In.jsxs(i,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.secondary,textAlign:"left"},children:le._({id:"BRi+RY",message:"Add more liquidity"})}),In.jsxs(i,{children:[In.jsx(Ex,{value:Ee[lx.CURRENCY_A],onUserInput:ge,maxAmount:Ae[lx.CURRENCY_A],balance:U[lx.CURRENCY_A],currency:null!==(t=W[lx.CURRENCY_A])&&void 0!==t?t:null,locked:Q}),In.jsx(ng,{}),In.jsx(Ex,{value:Ee[lx.CURRENCY_B],onUserInput:fe,maxAmount:Ae[lx.CURRENCY_B],balance:U[lx.CURRENCY_B],currency:null!==(n=W[lx.CURRENCY_B])&&void 0!==n?n:null,locked:X})]}),In.jsx(rx,{value:je,onChange:Ce,disabled:!1,type:"AMMV3"})]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:In.jsx(jx,{chainId:e,approvalA:Ie,approvalB:Se,parsedAmounts:N,isValid:Te,depositADisabled:Q,depositBDisabled:X,errorMessage:H,setShowConfirm:C})}),In.jsx(rv,{parsedAmounts:N,position:q,existingPosition:void 0,priceLower:Me,priceUpper:_e,outOfRange:Y,ticksAtLimit:J,on:j,onClose:()=>{C(!1)},onConfirm:Be.mutate,loading:Be.isPending})]}),In.jsxs(L,{value:"unstake",children:[In.jsxs(i,{sx:{mt:16,mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[In.jsx(Xf,{disabled:!1,value:w,onChange:e=>k(e)}),In.jsx(rx,{value:je,onChange:Ce,disabled:!1,type:"AMMV3"})]}),In.jsxs(i,{sx:{mt:16,mx:20,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[In.jsx(i,{sx:{typography:"body2",color:u.palette.text.secondary},children:"Receive"}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[In.jsxs(i,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[In.jsx(i,{component:"span",sx:{color:u.palette.primary.main},children:oe?Ps({input:oe.toExact(),decimals:oe.currency.decimals}):"-"})," ",null===(o=null==oe?void 0:oe.currency)||void 0===o?void 0:o.symbol]}),In.jsxs(i,{sx:{typography:"body1",fontWeight:600,color:u.palette.text.primary},children:[In.jsx(i,{component:"span",sx:{color:u.palette.primary.main},children:re?Ps({input:re.toExact(),decimals:re.currency.decimals}):"-"})," ",null===(r=null==re?void 0:re.currency)||void 0===r?void 0:r.symbol]})]})]}),In.jsx(i,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:In.jsx(Jy,{chainId:e,disabled:ce||0===w||!oe,removed:ce,error:de,onConfirm:De.mutate,isLoading:De.isPending})})]}),In.jsxs(L,{value:"claim",children:[In.jsxs(i,{sx:{mx:20,mt:16,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:u.palette.border.main},children:[In.jsx(i,{sx:{py:12,px:20,typography:"body1",color:u.palette.text.primary,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:u.palette.border.main},children:le._({id:"tu/fxg",message:"Claim fees"})}),In.jsxs(i,{sx:{p:20},children:[In.jsx(Sv,{token:null==he?void 0:he.currency,amount:he}),In.jsx(Sv,{token:null==me?void 0:me.currency,amount:me})]})]}),In.jsx(i,{sx:{mx:20,mt:16,typography:"h6",color:u.palette.text.secondary},children:le._({id:"Joa5Dk",message:"*Collecting fees will withdraw currently available fees for you."})}),In.jsx(i,{sx:{mt:20,display:"flex",alignItems:"center",px:20,py:16,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:u.palette.background.paper},children:In.jsx(Cx,{chainId:e,disabled:Ne.isPending,onConfirm:Ne.mutate,isLoading:Ne.isPending})})]})]})]})}),[Ie,Se,e,W,U,Q,X,de,H,y,me,he,Ee,x,Te,oe,re,Ae,Be.isPending,Be.mutate,Ne.isPending,Ne.mutate,s,ge,fe,De.isPending,De.mutate,v,Y,N,q,Me,_e,ce,Ce,j,w,je,u.palette.background.paper,u.palette.border.main,u.palette.primary.main,u.palette.text.primary,u.palette.text.secondary,J]);return c?In.jsx(Rc,{open:null!=t&&null!=n,onClose:s,scope:!c,modal:c,id:"pool-operate",children:Fe}):Fe};const Ov=({outOfRange:e})=>{const t=a();return In.jsx(l,{title:e?le._({id:"i3Z+/Z",message:"Out of range"}):le._({id:"vOyUlD",message:"In range"}),children:In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:e?In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:In.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:t.palette.warning.main})}):In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",children:In.jsx("circle",{cx:"4",cy:"4",r:"4",fill:t.palette.success.main})})})})},Rv=({p:e,currency0:t,currency1:n,onClickManage:o})=>{const r=a(),[,s]=lv(null!=t?t:void 0,null!=n?n:void 0,e.fee),l=Z((()=>{if(s)return new _y({pool:s,liquidity:e.liquidity.toString(),tickLower:e.tickLower,tickUpper:e.tickUpper})}),[e.liquidity,e.tickLower,e.tickUpper,s]),d=(u=e.fee,p=e.tickLower,h=e.tickUpper,Z((()=>({[dx.LOWER]:u&&p?p===Ay(cy.MIN_TICK,Jx[u]):void 0,[dx.UPPER]:u&&h?h===Ay(cy.MAX_TICK,Jx[u]):void 0})),[u,p,h]));var u,p,h;const m=null==l?void 0:l.token0PriceLower,g=null==l?void 0:l.token0PriceUpper,f=null==l?void 0:l.amount1.currency,x=null==l?void 0:l.amount0.currency,y=!!s&&(s.tickCurrent<e.tickLower||s.tickCurrent>=e.tickUpper),v=t==t?null==l?void 0:l.pool.priceOf(null==l?void 0:l.pool.token0):null==l?void 0:l.pool.priceOf(null==l?void 0:l.pool.token1);return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:24,px:20,py:20,pb:12,borderRadius:12,backgroundColor:r.palette.background.paperContrast},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h5",color:r.palette.text.primary},children:[In.jsx(i,{children:In.jsxs(In.Fragment,{children:[In.jsxs("span",{children:[Qy({price:m,atLimit:d,direction:dx.LOWER})," "]}),null==f?void 0:f.symbol]})}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:In.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"})}),In.jsx(i,{children:In.jsxs(In.Fragment,{children:[In.jsxs("span",{children:[Qy({price:g,atLimit:d,direction:dx.UPPER})," "]}),null==f?void 0:f.symbol]})})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(Ov,{outOfRange:y}),In.jsxs(i,{sx:{typography:"h6",color:r.palette.text.secondary},children:[le._({id:"DWd30U",message:"Current price"}),": ",`${Ps({input:null==v?void 0:v.toSignificant()})}`," ",null==f?void 0:f.symbol," per ",null==x?void 0:x.symbol]})]})]}),In.jsx(c,{variant:c.Variant.outlined,size:c.Size.small,fullWidth:!0,onClick:o,children:le._({id:"wckWOP",message:"Manage"})})]})},Mv=({chainId:e,baseToken:t,quoteToken:n,feeAmount:o,onClose:r,handleGoToAddLiquidityV3:s})=>{const{isMobile:l}=Sd(),d=a(),{account:u}=hd(),{positions:p,loading:h}=function(e,t){const n=Cv(t),{isLoading:i,data:o}=Qe(Xl.getBalanceOf(t,n,null!=e?e:void 0)),r=Z((()=>{if(e&&o&&o.isFinite()){const t=[];for(let n=0;n<o.toNumber();n++)t.push([e,n]);return t}return[]}),[e,o]),a=Qe(Xl.getTokenOfOwnerByIndex(t,n,r)),s=a.isLoading,l=Z((()=>e&&a.data?a.data.map((e=>{if(Array.isArray(e)&&e.length>0)return e[0].toString()})):[]),[e,a]),{positions:d,loading:c}=wv(l,t);return{loading:s||i||c,positions:d}}(u,e),m=Z((()=>t?hv(t):void 0),[t]),g=Z((()=>n?hv(n):void 0),[n]),[f,x]=Z((()=>[null==m?void 0:m.wrapped,null==g?void 0:g.wrapped]),[m,g]),[y,v]=Z((()=>f&&x?f.sortsBefore(x)?[f,x]:[x,f]:[void 0,void 0]),[f,x]),b=Z((()=>{if(void 0!==p)return p.filter((e=>uv(null==y?void 0:y.address,e.token0)&&uv(null==v?void 0:v.address,e.token1)&&e.fee===o))}),[o,p,null==y?void 0:y.address,null==v?void 0:v.address]),[j,C]=$(null),w=Z((()=>{var e;return In.jsxs(i,{sx:{p:20,display:"flex",flexDirection:"column",gap:16,borderRadius:16,backgroundColor:d.palette.background.paper,minHeight:480},children:[In.jsxs(i,{sx:{pb:16,borderBottomColor:d.palette.border.main,borderBottomStyle:"solid",borderBottomWidth:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{sx:{typography:"body1",fontWeight:600,color:d.palette.text.primary},children:[le._({id:"Gs02OK",message:"My Positions"})," (",null!==(e=null==b?void 0:b.length)&&void 0!==e?e:0,")"]}),r?In.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,borderRadius:"50%",borderWidth:1,color:"text.secondary",cursor:"pointer"},children:In.jsx(i,{component:Un.Error,sx:{width:16,height:16},onClick:()=>{r()}})}):void 0]}),b&&b.length>0?In.jsxs(In.Fragment,{children:[null==b?void 0:b.map((e=>In.jsx(Rv,{p:e,currency0:m,currency1:g,onClickManage:()=>{C(e)}},e.tokenId))),In.jsxs(c,{size:c.Size.big,variant:c.Variant.second,onClick:()=>{s({from:t.address,to:n.address,fee:String(o)})},sx:{gap:8},children:[In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:In.jsx("path",{d:"M19 13H13V19H11V13H5V11H11V5H13V11H19V13Z",fill:"currentColor"})}),le._({id:"FQ4aT9",message:"Add Position"})]})]}):In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{mt:100,display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[In.jsx(Rn,{sx:{width:60,height:60,borderRadius:24/105*60}}),In.jsx(i,{sx:{typography:"body1",color:d.palette.text.secondary},children:le._({id:"/6L4mj",message:"Your position is empty"})})]}),In.jsx(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:void 0!==b&&0===b.length?In.jsx(c,{size:c.Size.small,onClick:()=>{s({from:t.address,to:n.address,fee:String(o)})},children:le._({id:"FQ4aT9",message:"Add Position"})}):In.jsx(cx,{size:c.Size.small})})]})]})}),[d.palette.background.paper,d.palette.border.main,d.palette.text.primary,d.palette.text.secondary,b,r,m,g,s,t.address,n.address,o]);return null!==j?In.jsx(Lv,{baseToken:t,quoteToken:n,feeAmount:o,tokenId:j.tokenId,chainId:e,onClose:()=>{C(null)}}):l?In.jsx(Rc,{open:null!=t&&null!=n,onClose:r,scope:!l,modal:l,id:"pool-operate",children:w}):w};function _v({children:e,sx:t,gap:n=20,repeatBaseForLargeScreen:o=3}){const{isMobile:r,minDevice:a}=Sd();let s={};if(r)s={display:"flex",flexDirection:"column",gap:n};else{let e=2;[1418,1761,2104].some(((t,n)=>{if(a(t))return e=o+n,!0})),s={display:"grid",gap:n,gridTemplateColumns:`repeat(${e}, 1fr)`}}return In.jsx(i,{sx:Object.assign(Object.assign({},s),t),children:e})}function Pv({address:t,chainId:n,hideName:o,sx:r}){const s=a(),c=vd(),{onlyChainId:u}=On(),p=Qe(Object.assign({},c.getQuery(we.graphql.fetchLiquidityLpPartnerRewards,{where:{chainId:u||void 0}})));if(!t)return null;const h=[];return("string"==typeof t?[t]:Array.from(new Set(t)).filter((e=>!!e))).forEach((e=>{var t,i,o;e&&(null===(o=null===(i=null===(t=p.data)||void 0===t?void 0:t.liquidity_getLpPartnerRewards)||void 0===i?void 0:i.partnerRewards)||void 0===o||o.some((t=>{var i,o,r,a,s,l,d,c,u,m,g,f,x,y;if((null==t?void 0:t.chainId)===n&&(null===(i=null==t?void 0:t.pool)||void 0===i?void 0:i.toLocaleLowerCase())===e.toLocaleLowerCase()){const e=null===(a=null===(r=null===(o=p.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;h.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!==(u=null==e?void 0:e.extra)&&void 0!==u?u:{},background:(null===(m=null==e?void 0:e.theme)||void 0===m?void 0:m[0])||void 0,color:(null===(g=null==e?void 0:e.theme)||void 0===g?void 0:g[1])||void 0},reward:null!==(f=null==t?void 0:t.reward)&&void 0!==f?f:"",type:null!==(x=null==t?void 0:t.type)&&void 0!==x?x:"stakelp",sort:null!==(y=null==e?void 0:e.sort)&&void 0!==y?y:Number.MAX_SAFE_INTEGER})}})))})),(null==h?void 0:h.length)?(h.sort(((e,t)=>e.sort-t.sort)),In.jsx(i,{sx:Object.assign({display:"flex",alignItems:"center",gap:4},r),children:h.map((t=>In.jsx(l,{leaveDelay:100,title:In.jsxs(i,{sx:{maxWidth:240,whiteSpace:"pre-wrap"},children:[t.partner.introduction,!!t.partner.link&&In.jsxs(i,{component:"a",target:"_blank",href:t.partner.link,rel:"noopener noreferrer",sx:{display:"flex",alignItems:"center",gap:4,color:"primary.main","&:hover":{opacity:.5}},children:[In.jsx(e,{id:"zwWKhA",message:"Learn more"})," ",In.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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:In.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,p:s.spacing(0,4),height:20,borderRadius:4,background:t.partner.background,color:t.partner.color,whiteSpace:"nowrap"},children:[In.jsx(i,{component:"img",src:t.partner.logo,alt:t.partner.name,sx:{width:14,height:14,borderRadius:"50%"}}),!o&&!!t.reward&&In.jsx(i,{sx:{fontSize:"10px",fontWeight:600},children:t.reward})]})},t.partner.name+t.reward)))})):null}function Bv({text:e,onClick:t}){const n=a();return In.jsxs(i,{sx:{typography:"body2",display:"inline-flex",alignItems:"center",p:n.spacing(0,4,0,8),width:"max-content",height:32,backgroundColor:"hover.default",color:"primary.main",borderWidth:1,borderRadius:8,cursor:"pointer"},onClick:t,children:[e,In.jsx(i,{component:Un.ArrowBack,sx:{ml:2,width:16,height:16,transform:"rotate(180deg)"}})]})}function Dv({lqList:e,onDeleteTag:t,sx:n}){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=Kl(r.baseToken,r.chainId),s=Kl(r.quoteToken,r.chainId);return a&&s?In.jsxs(i,{sx:Object.assign({typography:"body2",display:"inline-flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},n),children:[In.jsx(gg,{tokens:[a,s],chainId:a.chainId,width:20,mr:8}),a.symbol,"+",s.symbol,In.jsx(i,{component:Un.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>t()})]}):null}function Nv({tags:e,onDeleteTag:t,sx:n}){return e.length?In.jsx(i,{sx:Object.assign({display:"inline-flex",alignItems:"center"},n),children:e.map((e=>In.jsxs(i,{sx:{typography:"body2",display:"flex",alignItems:"center",px:8,mr:8,borderRadius:8,fontWeight:600,height:32,backgroundColor:"hover.default"},children:[In.jsx(Fc,{address:e.address,width:20,height:20,chainId:e.chainId,url:e.logoURI,noShowChain:!0,marginRight:8}),e.symbol,In.jsx(i,{component:Un.Error,sx:{ml:4,width:16,height:16,cursor:"pointer",color:"text.secondary",position:"relative",top:1.5},onClick:()=>t(e)})]},e.address)))}):null}function Fv({chainId:e,address:t}){const{isMobile:n}=Sd();return In.jsx(i,{component:"button",onClick:n=>{n.stopPropagation(),Gf.getState().push({type:$f.PoolDetail,params:{chainId:e,address:t}})},sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:8,cursor:"pointer",flexShrink:0,color:"text.primary","&:hover":{opacity:.5}},n?{width:64,height:36,backgroundColor:"background.tag"}:{width:40,height:32,backgroundColor:"transparent",borderWidth:1,borderStyle:"solid",borderColor:"border.main"}),children:In.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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 Uv(t){var{sx:n,children:o,empty:r,loading:s,hasMore:l,loadMore:c,loadMoreLoading:u}=t,p=vn(t,["sx","children","empty","loading","hasMore","loadMore","loadMoreLoading"]);const h=a();return In.jsxs(i,{sx:Object.assign({position:"relative",flex:1,overflowY:"auto",borderRadius:16},n),...p,children:[In.jsx(i,{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&&!s&&{"& 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"===h.palette.mode?"#1A1A1B":T("#1A1A1B",.1)} -2px 0px 4px 0px`}}}),children:o}),l&&In.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:c,children:u?In.jsx(O,{}):In.jsxs(In.Fragment,{children:[In.jsx(e,{id:"yQ2kGp",message:"Load more"}),In.jsx(i,{component:Un.ArrowRight,sx:{transform:"rotate(90deg)"}})]})})]})}function qv({sx:t}){const{supportAMMV2:n,supportAMMV3:o}=On(),r=n||o;return In.jsxs(i,{sx:Object.assign({px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},t),children:[In.jsx(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(gg,{width:24,tokens:[],mr:6,showChainLogo:!0}),In.jsx(j,{variant:"rounded",height:20,width:88})]})}),In.jsxs(i,{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&&In.jsxs(i,{children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:In.jsx(j,{variant:"rounded",height:24,width:100})}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),In.jsxs(i,{children:[In.jsx(j,{variant:"rounded",height:24,width:100}),In.jsx(i,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:In.jsx(e,{id:"rSayea",message:"APY"})})]}),In.jsxs(i,{children:[In.jsx(j,{variant:"rounded",height:24,width:100}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),r&&In.jsxs(i,{children:[In.jsx(j,{variant:"rounded",height:24,width:100}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"Q8W3SC",message:"Volume (1D)"})})]})]}),In.jsx(j,{variant:"rounded",height:32,sx:{mt:20}})]})}function Vv({chainId:t,baseToken:n,quoteToken:o,apy:a,hasQuote:s,hasMining:d,sx:c,children:u}){if(!n)return null;const p=s?[{token:n,transactionApy:null==a?void 0:a.transactionBaseApy,miningApy:null==a?void 0:a.miningBaseApy},{token:o,transactionApy:null==a?void 0:a.transactionQuoteApy,miningApy:null==a?void 0:a.miningQuoteApy}]:[{transactionApy:null==a?void 0:a.transactionBaseApy,miningApy:null==a?void 0:a.miningBaseApy,metromMiningApy:null==a?void 0:a.metromMiningApy}];return In.jsx(l,{children:null!=u?u:In.jsx(r,{component:Un.QuestionBorder,sx:Object.assign({width:15,height:15},c)}),title:In.jsx(i,{sx:{minWidth:236},children:p.map(((r,a)=>{var s,l,c,u,p;return In.jsxs(i,{sx:{mt:0===a?0:20},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,typography:"body2",fontWeight:600,color:"text.primary"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:r.token?In.jsxs(In.Fragment,{children:[In.jsx(Fc,{width:14,height:14,marginRight:4,address:r.token.address,url:r.token.logoURI,chainId:t,noShowChain:!0}),r.token.symbol]}):In.jsxs(In.Fragment,{children:[In.jsx(gg,{tokens:[n,o],width:14,mr:4,chainId:t}),n.symbol,"/",null==o?void 0:o.symbol]})}),In.jsx(i,{children:Ys(new Le(null!==(c=r.transactionApy)&&void 0!==c?c:0).plus(null!==(u=r.miningApy)&&void 0!==u?u:0).plus(null!==(p=r.metromMiningApy)&&void 0!==p?p:0))})]}),In.jsxs(i,{sx:{mt:8,display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[In.jsx("span",{children:In.jsx(e,{id:"OnDEky",message:"LP Fee"})}),In.jsx("span",{children:r.transactionApy?Ys(new Le(r.transactionApy)):"-"})]}),d?In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[In.jsx("span",{children:In.jsx(e,{id:"pSQ1lM",message:"MT Fee"})}),In.jsx("span",{children:r.miningApy?Ys(new Le(r.miningApy)):"-"})]}):"",r.metromMiningApy&&Number(r.metromMiningApy)>0&&In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",typography:"h6",color:"text.secondary"},children:[In.jsx("span",{children:In.jsx(e,{id:"Sti4vy",message:"Mining"})}),In.jsx("span",{children:r.metromMiningApy?Ys(new Le(r.metromMiningApy)):"-"})]})]},null!==(l=null===(s=r.token)||void 0===s?void 0:s.address)&&void 0!==l?l:1)}))})})}function Wv({sx:t,value:n,onChange:o,searchAddress:r}){const[a,s]=H.useState(!1),{isMobile:l}=Sd();return In.jsxs(In.Fragment,{children:[In.jsxs(i,{component:d,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},l?{width:"100%"}:{minWidth:220}),t),onClick:()=>s(!0),children:[In.jsx(i,{component:Un.Search,sx:{width:16,height:16,mr:8,flexShrink:0}}),In.jsx(e,{id:"A1taO8",message:"Search"})]}),In.jsx(Zm,{value:n,open:a,multiple:!0,title:In.jsx(e,{id:"o8aMNm",message:"Select a liquidity pool"}),searchPlaceholder:le._({id:"4nzwq3",message:"Search by token or pool address"}),onClose:()=>{s(!1)},onTokenChange:e=>{if(Array.isArray(e)){if(e.length>2){const t=[e[0],e[2]];o(t)}else o(e);s(!1)}},searchOtherAddress:e=>r(e,(()=>s(!1))),modal:!0})]})}function Hv({list:t,onClick:n}){return In.jsx(In.Fragment,{children:null==t?void 0:t.map((t=>{var o,r,a,s;if(!(null==t?void 0:t.pair))return null;const l=t.pair,d=Kl(l.baseToken,l.chainId),c=Kl(l.quoteToken,l.chainId),u=l.apy?Ys(new Le(null===(o=l.apy)||void 0===o?void 0:o.transactionBaseApy).plus(null!==(a=null===(r=l.apy)||void 0===r?void 0:r.miningBaseApy)&&void 0!==a?a:0)):void 0,p=me.utils.singleSideLp(l.type)&&l.apy?Ys(new Le(l.apy.transactionQuoteApy).plus(null!==(s=l.apy.miningQuoteApy)&&void 0!==s?s:0)):void 0;return d&&c?In.jsxs(i,{onClick:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:10,py:20,borderRadius:8,cursor:"pointer","&:hover":{backgroundColor:"custom.background.listHover"}},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(gg,{tokens:[d,c],chainId:l.chainId,width:24,mr:10}),In.jsxs(i,{sx:{typography:"h5"},children:[d.symbol,"/",c.symbol]})]}),In.jsxs(i,{children:[In.jsxs(i,{sx:{color:"custom.status.green.default",fontWeight:600},children:[u,p?`/${p}`:""]}),In.jsx(i,{sx:{mt:2,typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"rSayea",message:"APY"})})]})]},l.id):null}))})}function Zv(e){var t;const[n,i]=H.useState(null!==(t=null==e?void 0:e.tokens)&&void 0!==t?t:[]),[o,r]=H.useState([]);H.useEffect((()=>{e&&(i(e.tokens),r(e.lqList))}),[e]);const[a,s]=H.useMemo((()=>{const[e,t]=n;return[null==e?void 0:e.symbol,null==t?void 0:t.symbol]}),[n]);return{filterTokens:n,filterASymbol:a,filterBSymbol:s,filterAddressLqList:o,handleDeleteToken:t=>{i((n=>{const i=[...n],o=i.indexOf(t);return-1!==o&&i.splice(o,1),e&&e.onChangeFilterTokens(i),i}))},handleChangeFilterTokens:t=>{r([]),i(t),e&&(e.onChangeFilterTokens(t),e.onChangeFilterAddressLqList([]))},handleChangeFilterAddress:t=>{r(t),i([]),e&&(e.onChangeFilterTokens([]),e.onChangeFilterAddressLqList(t))}}}var zv;!function(e){e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(zv||(zv={}));const $v=({pool:e,separate:t,wrap:n})=>{const o=e.coins.length,r=t?o>=6&&n?18:24:o>=3?24:36;return t?In.jsx(i,{sx:{display:"flex",alignItems:"gap",gap:4},children:e.coins.map((t=>In.jsx(l,{title:t.symbol,placement:"top",onlyHover:!0,leaveDelay:100,sx:{maxWidth:240},children:In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:In.jsx(Fc,{address:t.address,width:r,height:r,chainId:e.chainId,url:void 0,cross:!1,noShowChain:!0,noBorder:!0,marginRight:0})})},t.address)))}):In.jsx(i,{sx:{display:"flex",alignItems:"gap",gap:-8},children:e.coins.map((t=>In.jsx(l,{title:t.symbol,placement:"top",onlyHover:!0,leaveDelay:100,sx:{maxWidth:240},children:In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:In.jsx(Fc,{address:t.address,width:r,height:r,chainId:e.chainId,url:void 0,cross:!1,noShowChain:!0,noBorder:!0,marginRight:0})})},t.address)))})},Gv=new ke({contractRequests:Ta}),Yv=[{chainId:de.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:de.ZETACHAIN_TESTNET},{address:"0xc39f8C093b10660E12d982256979E239B18D073d",name:"Mock Token 2",decimals:18,symbol:"MTK2",chainId:de.ZETACHAIN_TESTNET},{address:"0xbE3499499C928F086a32B0bE586e07A9D085b5eF",name:"Mock Token 3",decimals:18,symbol:"MTK3",chainId:de.ZETACHAIN_TESTNET},{address:"0x11D6F6C038B9E841e024F7aB5Bd40101D69638b3",name:"Mock Token 4",decimals:18,symbol:"MTK4",chainId:de.ZETACHAIN_TESTNET}],apy:null,dailyApy:null,weeklyApy:null,tvl:null,volume:null}];function Qv({apy:e,dailyApy:t,weeklyApy:n}){return In.jsx(l,{title:In.jsxs(i,{sx:{maxWidth:216,typography:"h6",fontWeight:500,color:"text.secondary"},children:[In.jsx(i,{sx:{fontWeight:700},children:"Base vAPY (annualized)"}),In.jsxs(i,{component:"ul",sx:{pl:16,my:0},children:[In.jsxs("li",{children:["Daily: ",Gs({input:t,showDecimals:2})]}),In.jsxs("li",{children:["Weekly: ",Gs({input:n,showDecimals:2})]})]}),In.jsx("br",{}),"*Variable APY based on today’s trading activity"]}),children:In.jsx(i,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:Gs({input:e,showDecimals:2})})})}function Xv({poolList:e=Yv,loading:t,operateCurvePool:n,setOperateCurvePool:o,hasMore:r,loadMore:s,loadMoreLoading:l}){const d=a();return In.jsxs(Uv,{hasMore:r,loadMore:s,loadMoreLoading:l,empty:!(null==e?void 0:e.length),loading:t,children:[In.jsx(i,{component:"thead",children:In.jsxs(i,{component:"tr",children:[In.jsx(i,{component:"th",children:"Pool"}),In.jsx(i,{component:"th",children:"Assets"}),In.jsx(i,{component:"th",children:"APY"}),In.jsx(i,{component:"th",children:"TVL"}),In.jsx(i,{component:"th",children:"Volume"}),In.jsx(i,{component:"th",sx:{width:155}})]})}),In.jsx(i,{component:"tbody",children:e.map((e=>{var t;let r="";if((null===(t=null==n?void 0:n.pool)||void 0===t?void 0:t.address.toLowerCase())===e.address.toLowerCase())if(n.type===zv.Remove)r=le._({id:"0+31GV",message:"Removing"});else r=le._({id:"1yHVE+",message:"Adding"});const a=d.palette.hover.default;return In.jsxs(i,{component:"tr",sx:{["&:hover td"+(r?", & td":"")]:{backgroundImage:`linear-gradient(${a}, ${a})`}},children:[In.jsxs(i,{component:"td",children:[In.jsx(i,{sx:{typography:"body2",lineHeight:"19px",fontWeight:600},children:e.name}),In.jsx(qm,{address:e.address,customChainId:e.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"h6",color:"text.secondary"}})]}),In.jsx(i,{component:"td",children:In.jsx($v,{pool:e,separate:!0,wrap:!1})}),In.jsx(i,{component:"td",children:In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:In.jsx(Qv,{apy:e.apy,dailyApy:e.dailyApy,weeklyApy:e.weeklyApy})})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{typography:"body2",fontWeight:600},title:`$${Ps({input:e.tvl,decimals:2})}`,children:["$",e.tvl?$s(new Le(e.tvl)):"-"]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{typography:"body2",fontWeight:600},title:`$${Ps({input:e.volume,decimals:2})}`,children:["$",e.volume?$s(new Le(e.volume)):"-"]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[In.jsx(Fv,{chainId:e.chainId,address:e.address}),r?In.jsx(Bv,{text:r,onClick:()=>o(null)}):In.jsx(c,{size:c.Size.small,onClick:()=>{o({pool:e,type:zv.Add})},sx:{py:0,height:32},children:le._({id:"m16xKo",message:"Add"})})]})})]},`${e.chainId}-${e.address}`)}))})]})}const Kv=({scrollParentRef:e,filterChainIds:t,activeChainId:n,operateCurvePool:o,setOperateCurvePool:r,children:s,tokenAndPoolFilter:l})=>{var d,c;const u=a(),{isMobile:p}=Sd(),h=vd(),m=Ke(),{onlyChainId:g}=On(),{filterTokens:f,filterASymbol:x,filterBSymbol:y,filterAddressLqList:v,handleDeleteToken:b,handleChangeFilterTokens:j,handleChangeFilterAddress:C}=Zv(),w=Z((()=>({chainIds:t,pageSize:p?4:8,filterState:{viewOnlyOwn:!1,filterTypes:["CURVE"]}})),[t,p]),k=h.getInfiniteQuery(me.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},w),{filterState:Object.assign({filterASymbol:x,filterBSymbol:y},w.filterState)})}),T=nt(Object.assign(Object.assign({},k),{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 E=[];const A=!!(null==v?void 0:v.length);A?E=[...v]:null===(d=T.data)||void 0===d||d.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==E||E.push(e)}))}));const I=T.hasNextPage&&!A;return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pb:20,display:"flex",flexDirection:"column",gap:12,[u.breakpoints.up("tablet")]:{py:16,flexDirection:"row",alignItems:"center",gap:8,px:0,justifyContent:"space-between"}},children:[In.jsx(i,{sx:{[u.breakpoints.up("tablet")]:{mr:"auto"}},children:s}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:Object.assign({flex:1,display:"flex",alignItems:"center",gap:8},p?{}:{"& > button":{flex:1}}),children:null!==(c=null==l?void 0:l.element)&&void 0!==c?c:In.jsx(Wv,{value:f,onChange:j,searchAddress:(e,t)=>bn(void 0,void 0,void 0,(function*(){var n;const i=h.getInfiniteQuery(me.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},w),{filterState:Object.assign({address:e},w.filterState)})}),o=null===(n=(yield m.fetchQuery(i)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==o?void 0:o.length)?In.jsx(Hv,{list:o,onClick:()=>{C(o),t()}}):null}))})}),(A||!!f.length)&&In.jsxs(i,{sx:{my:0},children:[A?In.jsx(Dv,{lqList:v,onDeleteTag:()=>C([])}):"",In.jsx(Nv,{tags:f,onDeleteTag:b})]})]})]}),p?In.jsx(on,{hasMore:I,threshold:300,loadMore:se((()=>{T.hasNextPage&&!T.isFetching&&T.fetchNextPage()}),500),useWindow:!1,getScrollParent:()=>e.current||null,loader:In.jsx(qv,{sx:{mt:20}},"loader"),children:In.jsxs(_v,{children:[T.isLoading?In.jsx(qv,{}):"",!T.isLoading&&!(null==E?void 0:E.length)&&!T.error&&In.jsx(Mn,{sx:{mt:40},hasSearch:!!(n&&!g||x||y)}),!!T.error&&In.jsx(Nn,{refresh:T.refetch,sx:{mt:40}})]})}):In.jsxs(In.Fragment,{children:[In.jsx(Xv,{poolList:Yv,loading:T.isLoading,operateCurvePool:o,setOperateCurvePool:r,hasMore:I,loadMoreLoading:T.isFetchingNextPage,loadMore:()=>{T.hasNextPage&&!T.isFetching&&T.fetchNextPage()}}),In.jsx(fg,{loading:T.isLoading,refetch:T.error?T.refetch:void 0,empty:!(null==E?void 0:E.length),hasSearch:!!(n&&!g||x||y)})]})]})};function Jv({children:e}){const t=a();return In.jsx(i,{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,[t.breakpoints.up("tablet")]:{position:"static"}},children:e})}const eb=e=>{const t=a();return In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,px:12,height:36,borderRadius:8,border:`1px solid ${t.palette.border.main}`},children:[In.jsxs(i,{sx:{typography:"body2",fontWeight:500,lineHeight:"19px",color:t.palette.text.secondary,textTransform:"capitalize"},children:["Slippage Bonus (incl. pricing)",In.jsx(im,{title:"Bonus comes as an advantage from current coin prices which usually appears for coins which are low in balance"})]}),In.jsx(i,{sx:{typography:"body2",fontWeight:600,lineHeight:"19px",color:t.palette.success.main},children:"-"})]})};function tb({pool:e,account:t}){const n=Qe(Gv.getBalanceOf(e.chainId,e.address,t)),i=Qe(Gv.getBalances(e.chainId,e.address,e.coins)),o=Qe(Gv.getTotalSupply(e.chainId,e.address)),r=Z((()=>o.data?o.data.div(10**e.decimals).dp(e.decimals,Le.ROUND_DOWN):null),[o.data,e.decimals]),a=Z((()=>n.data?n.data.div(10**e.decimals).dp(e.decimals,Le.ROUND_DOWN):null),[n.data,e.decimals]),s=Z((()=>i.data?i.data.map(((t,n)=>{const i=e.coins[n];return t.div(10**i.decimals).dp(i.decimals,Le.ROUND_DOWN)})):null),[i.data,e.coins]),l=Z((()=>s&&a&&r?s.map(((t,n)=>{const i=e.coins[n];return t.multipliedBy(a).div(r).dp(i.decimals,Le.ROUND_DOWN)})):null),[s,a,r,e.coins]);return{lpTokenTotalSupply:r,tokenBalances:s,lpTokenBalance:a,userTokenBalances:l,lpTokenBalanceLoading:n.isLoading||i.isLoading||o.isLoading}}const nb=({operateCurvePool:e})=>{const t=a(),{account:n,chainId:o}=hd(),r=Wd(),s=Ke(),[l,u]=$(!1),[p,h]=$({}),m=G(p);m.current=p;const{slipper:g,setSlipper:f,slipperValue:x,resetSlipper:y}=ox({address:e.pool.address}),{lpTokenTotalSupply:v,tokenBalances:b,lpTokenBalance:j,userTokenBalances:C}=tb({pool:e.pool,account:n}),w=z((()=>{const t={};e.pool.coins.forEach((e=>{t[e.address]=""})),h(t)}),[e.pool.coins]);Y((()=>{w()}),[w]);const k=(t,n)=>{h((i=>{const o=Object.assign(Object.assign({},i),{[t]:n});if(l&&b){const i=e.pool.coins.findIndex((e=>e.address===t));if(-1!==i){const r=b[i],a=new Le(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=b[t];if(n&&n.gt(0)){const t=n.div(r),i=a.multipliedBy(t).dp(e.decimals,Le.ROUND_DOWN).toString();o[e.address]=i}else o[e.address]="0"}}))}}return o}))},T=Xe({queries:e.pool.coins.map((t=>{const i=Ea.getFetchTokenQuery(t.chainId,t.address,n,e.pool.address);return{queryKey:i.queryKey,enabled:i.enabled&&null!=t.chainId&&null!=t.address&&null!=n&&null!=e.pool.address,queryFn:i.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:E,getBalanceState:A,getPendingRest:I,submitApprove:S}=(({account:e,chainId:t,offset:n,contractAddress:i})=>{var o,r;const a=Wd(),s=Ke(),{runningRequests:l}=Hd(),{updateBlockNumber:d}=Ad(),c=H.useMemo((()=>null!=i?i:je[t].DODO_APPROVE),[t,i]),u=H.useMemo((()=>{var e;return t?null===(e=ve[t])||void 0===e?void 0:e.address:null}),[t]),p=Je({mutationFn:n=>bn(void 0,[n],void 0,(function*({token:n,isReset:i,submittedBack:o,canceledCallback:r,successBack:l,failedCallback:u}){if(!c||!e||!n)return;const p=cd(n),h=i?new Le(0):void 0,m=i?le._({id:"OfhWJH",message:"Reset"}):le._({id:"Z7ZXbT",message:"Approve"}),g=yield a.execute(`${m} ${p}`,{opcode:Dd.Approval,token:n,contract:c,amt:h},{submittedBack:o,metadata:{[Od.approve]:!0}});if(g===Rd.Canceled&&(null==r||r()),g===Rd.Success&&l&&l(),g===Rd.Failed&&(null==u||u()),g!==Rd.Success)return g;yield d(),s.invalidateQueries({queryKey:Ea.getFetchTokenQuery(t,null==n?void 0:n.address,e,c).queryKey,refetchType:"all"})}))}),h=z(((t,i,o,r)=>{var a,s;if(!t)return ac.Loading;const d=l.some((e=>{var n,i,o;return(null===(n=e.spec)||void 0===n?void 0:n.opcode)===Dd.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)===c})),h=(null===(s=null===(a=p.variables)||void 0===a?void 0:a.token)||void 0===s?void 0:s.address)===(null==t?void 0:t.address)&&p.isPending,m=new Le(null!=i?i:0);return e?!o||m.minus(null!=n?n:0).gt(o)||m.isZero()?ac.Unchecked:t&&t.address===u?ac.Sufficient:d||h?ac.Approving:r?m.minus(null!=n?n:0).gt(r)?ac.Insufficient:ac.Sufficient:ac.Loading:ac.Unchecked}),[e,u,c,n,l,p.isPending,null===(r=null===(o=p.variables)||void 0===o?void 0:o.token)||void 0===r?void 0:r.address]);return{getApprovalState:h,getPendingRest:z(((e,t)=>("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)),[]),getBalanceState:z(((t,i,o)=>e?o?t.minus(null!=n?n:0).gt(o)?sc.Insufficient:sc.Sufficient:sc.Loading:sc.Unchecked),[e,n]),submitApprove:z(((e,t,n,i,o,r)=>bn(void 0,void 0,void 0,(function*(){p.mutate({token:e,isReset:t,submittedBack:n,canceledCallback:i,successBack:o,failedCallback:r})}))),[p]),getMaxBalance:z(((e,n)=>{const i=new Le(0);return e&&void 0!==t&&n||i}),[t])}})({account:n,chainId:e.pool.chainId,contractAddress:e.pool.address}),L=z(((t,n,i)=>{var o;if(!b)return{};const r={},a=n||p,s=i||T.data,l=b.findIndex((e=>e&&e.gt(0)));if(-1!==l){const n=b[l],i=e.pool.coins[l];let d;if(void 0!==t)d=t;else{const e=Object.values(a).find((e=>e&&"0"!==e&&""!==e));if(e)d=e;else{const e=null===(o=null==s?void 0:s.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;d=e&&e.gt(0)?e.dp(i.decimals,Le.ROUND_DOWN).toString():"1"}}const c=new Le(d);r[i.address]=d,e.pool.coins.forEach(((e,t)=>{if(t!==l){const i=b[t];if(i&&i.gt(0)&&n.gt(0)){const t=i.div(n),o=c.multipliedBy(t).dp(e.decimals,Le.ROUND_DOWN).toString();r[e.address]=o}else r[e.address]="0"}}))}return r}),[e.pool.coins,b,p,T.data]),O=Qe(Gv.calcTokenAmount(e.pool.chainId,e.pool.address,e.pool.coins.map((e=>{const t=p[e.address]||"0",n=new Le(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,Le.ROUND_DOWN).toString():"0"})),!0)),R=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(n&&O.data)try{const t=new Rf([{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=p[e.address]||"0",n=new Le(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,Le.ROUND_DOWN).toString():"0"})),i=O.data.multipliedBy(1-x).dp(0,Le.ROUND_DOWN).toString(),o=t.encodeFunctionData("add_liquidity",[n,i]),a=()=>{s.invalidateQueries({queryKey:[be,"curve"],refetchType:"all"}),s.invalidateQueries({queryKey:[be,"token","getFetchTokenQuery"],refetchType:"all"})};return yield r.execute("add_liquidity",{opcode:Dd.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[Od.curveAddLiquidity]:!0},submittedBack:()=>{a()},successBack:()=>{a(),w()}})}catch(e){console.error("curve add_liquidity",e)}}))}),M=Z((()=>{var t,i;if(!n||e.pool.chainId!==o)return In.jsx(cx,{chainId:e.pool.chainId,fullWidth:!0});if(T.loading)return In.jsx(c,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Loading..."});if(!Object.values(p).some((e=>e&&"0"!==e)))return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Please enter amount"});for(const n of e.pool.coins){const e=p[n.address];if(!e||"0"===e)continue;const o=new Le(e);if(!o.isFinite())return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Invalid input"});const r=T.data.find((e=>{var t,i;return(null===(t=e.address)||void 0===t?void 0:t.toLowerCase())===(null===(i=n.address)||void 0===i?void 0:i.toLowerCase())})),a=null!==(t=null==r?void 0:r.balance)&&void 0!==t?t:null,s=null!==(i=null==r?void 0:r.allowance)&&void 0!==i?i:null,l=A(o,n,a),d=I(n,s),u=E(n,o,a,s);if(l===sc.Loading||u===ac.Loading)return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Loading..."});if(l===sc.Insufficient)return In.jsxs(c,{fullWidth:!0,disabled:!0,children:["Insufficient ",n.symbol," balance"]});if(u===ac.Approving)return In.jsxs(c,{fullWidth:!0,disabled:!0,children:[n.symbol," Approval Pending"]});if(u===ac.Insufficient)return In.jsxs(c,{fullWidth:!0,onClick:()=>{S(n,d)},children:["Approve ",n.symbol]})}return O.isLoading||!O.data?In.jsx(c,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Calculating..."}):O.data.lte(0)?In.jsx(c,{fullWidth:!0,disabled:!0,children:"Invalid input"}):In.jsx(c,{fullWidth:!0,disabled:R.isPending,isLoading:R.isPending,onClick:()=>{R.mutate()},children:"Add"})}),[n,o,E,A,I,O.data,O.isLoading,R,e.pool.chainId,e.pool.coins,S,p,T.data,T.loading]);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pb:100,px:20,pt:16,display:"flex",flexDirection:"column",gap:16,[t.breakpoints.up("tablet")]:{pb:20}},children:[In.jsx(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:4},children:e.pool.coins.map((e=>{var n;const o=null===(n=T.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 In.jsxs(i,{sx:{px:20,py:12,display:"flex",alignItems:"center",gap:16,borderRadius:16,backgroundColor:t.palette.background.cardInput},children:[In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(Fc,{width:24,height:24,address:e.address,chainId:e.chainId,noShowChain:!0,noBorder:!0,marginRight:0}),In.jsx(i,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",color:t.palette.text.primary},children:e.symbol})]}),In.jsxs(i,{component:d,onClick:()=>{o&&((e,t,n)=>{if(!t)return;const i=t.dp(n,Le.ROUND_DOWN).toString();k(e,i)})(e.address,o,e.decimals)},sx:{mt:4,typography:"h6",fontWeight:500,lineHeight:"16px",color:t.palette.text.secondary,"&:hover":{color:t.palette.text.primary}},children:["Balance: ",o?Ps({input:o,decimals:e.decimals}):"-"]})]}),In.jsx(Rm,{value:p[e.address]||"",onChange:t=>{k(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)}))}),In.jsxs(i,{sx:{mt:-8,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8},children:[In.jsxs(i,{component:d,onClick:()=>{const e=!l;if(u(e),e&&b){const e=L(void 0,m.current,T.data);h(e)}},sx:{px:11,py:3,borderRadius:20,border:`1px solid ${l?t.palette.primary.main:t.palette.border.main}`,typography:"body2",fontWeight:500,lineHeight:"19px",color:l?t.palette.primary.contrastText:t.palette.text.primary,backgroundColor:l?t.palette.primary.main:"transparent","&:hover":{opacity:.8}},children:["Balanced proportion: ",l?"ON":"OFF"]}),In.jsx(rx,{value:g,onChange:f,sx:{width:"auto",display:"inline-flex",ml:0}})]}),In.jsx(eb,{})]}),In.jsx(Jv,{children:M})]})};function ib({disabled:e,selected:t,onClick:n,children:o,iconVisible:r}){const s=a(),l=t?s.palette.success.main:s.palette.text.secondary;return In.jsxs(i,{component:d,disabled:e,onClick:n,sx:{flexGrow:1,flexShrink:1,flexBasis:"100%",display:"flex",alignItems:"center",gap:8},children:[r&&In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:t?In.jsxs(In.Fragment,{children:[In.jsx("rect",{x:"0.5",y:"1",width:"17",height:"17",rx:"8.5",stroke:l}),In.jsx("rect",{x:"4.5",y:"5",width:"9",height:"9",rx:"4.5",fill:l,stroke:l})]}):In.jsx("rect",{x:"0.5",y:"1",width:"17",height:"17",rx:"8.5",stroke:l})}),In.jsx(i,{sx:{flexGrow:1,display:"flex",alignItems:"center",gap:8,typography:"body2",fontWeight:500,lineHeight:"19px",color:s.palette.text.primary},children:o})]})}const ob=({operateCurvePool:e})=>{const t=a(),{account:n,chainId:o}=hd(),r=Wd(),s=Ke(),[l,u]=$(""),[p,h]=$("oneCoin"),[m,g]=$(0),[f,x]=$({}),{slipper:y,setSlipper:v,slipperValue:b,resetSlipper:j}=ox({address:e.pool.address}),{lpTokenBalance:C,userTokenBalances:w,lpTokenBalanceLoading:k}=tb({pool:e.pool,account:n}),T=z((()=>{const t={};e.pool.coins.forEach((e=>{t[e.address]=""})),x(t)}),[e.pool.coins]);Y((()=>{T()}),[T]);const E=Z((()=>{const e=new Oe(l);return e.isFinite()?e:null}),[l]),A=Qe(Gv.calcWithdrawOneCoin(e.pool.chainId,e.pool.address,E?E.multipliedBy(10**e.pool.decimals).dp(0,Oe.ROUND_DOWN).toString():"0",m)),I=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(n&&A.data)try{const t=new Rf([{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,Oe.ROUND_DOWN).toString():"0",i=A.data.multipliedBy(1-b).dp(0,Oe.ROUND_DOWN).toString(),o=t.encodeFunctionData("remove_liquidity_one_coin",[n,m,i]),a=()=>{s.invalidateQueries({queryKey:[be,"curve"],refetchType:"all"}),s.invalidateQueries({queryKey:[be,"token","getFetchTokenQuery"],refetchType:"all"})};return yield r.execute("remove_liquidity_one_coin",{opcode:Dd.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[Od.curveRemoveLiquidityOneCoin]:!0},submittedBack:()=>{a()},successBack:()=>{a(),u("")}})}catch(e){console.error("curve remove_liquidity_one_coin",e)}}))}),S=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(n)try{const t=new Rf([{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,Oe.ROUND_DOWN).toString():"0",i=e.pool.coins.map(((e,t)=>(null==w?void 0:w[t])&&E&&C&&C.gt(0)?w[t].multipliedBy(E).div(C).multipliedBy(10**e.decimals).multipliedBy(1-b).dp(0,Oe.ROUND_DOWN).toString():"0")),o=t.encodeFunctionData("remove_liquidity",[n,i]),a=()=>{s.invalidateQueries({queryKey:[be,"curve"],refetchType:"all"}),s.invalidateQueries({queryKey:[be,"token","getFetchTokenQuery"],refetchType:"all"})};return yield r.execute("remove_liquidity",{opcode:Dd.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[Od.curveRemoveLiquidity]:!0},submittedBack:()=>{a()},successBack:()=>{a(),u("")}})}catch(e){console.error("curve remove_liquidity",e)}}))}),L=Qe(Gv.calcTokenAmount(e.pool.chainId,e.pool.address,e.pool.coins.map((e=>{const t=f[e.address]||"0",n=new Oe(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,Oe.ROUND_DOWN).toString():"0"})),!1)),O=Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){if(n&&L.data)try{const t=new Rf([{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 Oe(t);return n.isFinite()?n.multipliedBy(10**e.decimals).dp(0,Oe.ROUND_DOWN).toString():"0"})),i=L.data.multipliedBy(1+b).dp(0,Oe.ROUND_DOWN).toString(),o=t.encodeFunctionData("remove_liquidity_imbalance",[n,i]),a=()=>{s.invalidateQueries({queryKey:[be,"curve"],refetchType:"all"}),s.invalidateQueries({queryKey:[be,"token","getFetchTokenQuery"],refetchType:"all"})};return yield r.execute("remove_liquidity_imbalance",{opcode:Dd.TX,data:o,to:e.pool.address,value:"0x0"},{metadata:{[Od.curveRemoveLiquidityImBalance]:!0},submittedBack:()=>{a()},successBack:()=>{a(),u(""),T()}})}catch(e){console.error("curve remove_liquidity_imbalance",e)}}))}),R=Z((()=>{if(!n||e.pool.chainId!==o)return In.jsx(cx,{chainId:e.pool.chainId,fullWidth:!0});if(!l||"0"===l)return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Please enter amount"});const t=new Oe(l);if(!t.isFinite())return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Invalid input"});if(k)return In.jsx(c,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Loading..."});if(!C||C.lte(0))return In.jsx(c,{fullWidth:!0,disabled:!0,children:"No LP token balance"});if(t.gt(C))return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Insufficient LP token balance"});if("oneCoin"===p)return A.isLoading||!A.data?In.jsx(c,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Calculating..."}):A.data.lte(0)?In.jsx(c,{fullWidth:!0,disabled:!0,children:"Invalid input"}):In.jsx(c,{fullWidth:!0,disabled:I.isPending,isLoading:I.isPending,onClick:()=>{I.mutate()},children:"Remove"});if("balanced"===p)return In.jsx(c,{fullWidth:!0,disabled:S.isPending,isLoading:S.isPending,onClick:()=>{S.mutate()},children:"Remove"});if("custom"===p){if(!Object.values(f).some((e=>e&&"0"!==e)))return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Please enter amount"});for(const t of e.pool.coins){const e=f[t.address];if(!e||"0"===e)continue;if(!new Oe(e).isFinite())return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Invalid input"})}if(L.isLoading||!L.data)return In.jsx(c,{fullWidth:!0,disabled:!0,isLoading:!0,children:"Calculating..."});if(L.data.lte(0))return In.jsx(c,{fullWidth:!0,disabled:!0,children:"Invalid input"});const n=L.data.dividedBy(10**e.pool.decimals).dp(e.pool.decimals,Oe.ROUND_DOWN);return n.gt(t)?In.jsx(c,{fullWidth:!0,disabled:!0,children:"Insufficient input amount"}):n.gt(C)?In.jsx(c,{fullWidth:!0,disabled:!0,children:"Insufficient LP token balance"}):In.jsx(c,{fullWidth:!0,disabled:O.isPending,isLoading:O.isPending,onClick:()=>{O.mutate()},children:"Remove"})}return null}),[n,e.pool.chainId,e.pool.decimals,e.pool.coins,o,l,k,C,p,A.isLoading,A.data,I,S,f,L.isLoading,L.data,O]);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pb:100,px:20,pt:16,display:"flex",flexDirection:"column",gap:16,[t.breakpoints.up("tablet")]:{pb:20}},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[In.jsxs(i,{sx:{px:20,py:12,display:"flex",alignItems:"center",gap:16,borderRadius:16,backgroundColor:t.palette.background.cardInput},children:[In.jsxs(i,{children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",color:t.palette.text.primary},children:"LP Tokens"}),In.jsxs(i,{component:d,onClick:()=>{C&&u(C.dp(e.pool.decimals,Oe.ROUND_DOWN).toString())},sx:{mt:4,typography:"h6",fontWeight:500,lineHeight:"16px",color:t.palette.text.secondary,"&:hover":{color:t.palette.text.primary}},children:["Balance: ",C?Ps({input:C,decimals:e.pool.decimals}):"-"]})]}),In.jsx(Rm,{value:l,onChange:e=>{u(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"}}}})]}),In.jsxs(i,{sx:{p:12,display:"flex",flexDirection:"column",alignItems:"stretch",gap:20,borderRadius:8,border:`1px solid ${t.palette.border.main}`},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(ib,{iconVisible:!0,disabled:!1,selected:"oneCoin"===p,onClick:()=>{h("oneCoin")},children:"One coin"}),In.jsx(ib,{iconVisible:!0,disabled:!1,selected:"balanced"===p,onClick:()=>{h("balanced")},children:"Balanced"}),In.jsx(ib,{iconVisible:!0,disabled:!1,selected:"custom"===p,onClick:()=>{h("custom")},children:"Custom"})]}),In.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:12},children:e.pool.coins.map(((e,n)=>{var o;return In.jsxs(ib,{iconVisible:"oneCoin"===p||"balanced"===p,disabled:!1,selected:"oneCoin"!==p||m===n,onClick:()=>{"oneCoin"===p&&g(n)},children:[In.jsx(Fc,{width:24,height:24,address:e.address,chainId:e.chainId,noShowChain:!0,noBorder:!0,marginRight:0}),In.jsx(i,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",color:t.palette.text.primary},children:e.symbol}),"oneCoin"===p&&In.jsx(i,{sx:{ml:"auto",typography:"body1",fontWeight:600,lineHeight:"22px",color:t.palette.text.primary},children:m===n?Ps({input:null===(o=A.data)||void 0===o?void 0:o.div(10**e.decimals),decimals:e.decimals}):"0"}),"balanced"===p&&In.jsx(i,{sx:{ml:"auto",typography:"body1",fontWeight:600,lineHeight:"22px",color:t.palette.text.primary},children:(null==w?void 0:w[n])&&E&&C&&C.gt(0)?Ps({input:w[n].multipliedBy(E).div(C),decimals:e.decimals}):"-"}),"custom"===p&&In.jsx(i,{sx:{ml:"auto"},children:In.jsx(Rm,{value:f[e.address]||"",onChange:t=>{var n,i;n=e.address,i=t,x((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 ${t.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)}))})]}),In.jsx(rx,{value:y,onChange:v,sx:{}})]}),In.jsx(eb,{})]}),In.jsx(Jv,{children:R})]})},rb=({onClose:e,poolInfoVisible:t=!0,operateCurvePool:n})=>{const o=a(),{account:r}=hd(),[s,c]=$(n.type),[u,p]=$(n.type);u!==n.type&&(p(n.type),c(n.type));const{lpTokenBalance:h,userTokenBalances:m}=tb({pool:n.pool,account:r});return In.jsxs(In.Fragment,{children:[e&&t&&In.jsxs(i,{sx:{position:"relative",display:"flex",flexDirection:"column",gap:16,px:20,pt:20},children:[e&&In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid",borderColor:o.palette.border.main},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,lineHeight:"22px",pb:17},children:"Liquidity"}),In.jsx(i,{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:d,children:In.jsx(i,{component:Un.Error,sx:{width:16,height:16}})})]}),t&&In.jsxs(i,{children:[In.jsxs(i,{sx:{px:20,py:12,borderTopLeftRadius:8,borderTopRightRadius:8,borderStyle:"solid",borderColor:"border.main",borderWidth:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[In.jsxs(i,{children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600,lineHeight:"19px",color:"text.primary"},children:n.pool.name}),In.jsx(qm,{address:n.pool.address,customChainId:n.pool.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,sx:{typography:"h6",color:"text.secondary"}})]}),In.jsxs(i,{component:d,onClick:()=>{},sx:{display:"flex",alignItems:"center",color:"text.secondary","&:hover":{color:"text.primary"}},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:500,lineHeight:"19px"},children:"details"}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:In.jsx("path",{d:"M7.49988 5L6.44238 6.0575L9.87738 9.5L6.44238 12.9425L7.49988 14L11.9999 9.5L7.49988 5Z",fill:"currentColor"})})]})]}),In.jsxs(i,{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:[In.jsx(i,{sx:{typography:"h6",fontWeight:500,lineHeight:"16px",color:"text.secondary"},children:"My LP tokens"}),In.jsx(l,{title:In.jsx(i,{sx:{m:8,display:"flex",flexDirection:"column",gap:20,minWidth:216},children:null==m?void 0:m.map(((e,t)=>{const o=n.pool.coins[t];return In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600,lineHeight:"14px"},children:[In.jsx(Fc,{width:14,height:14,address:o.address,chainId:o.chainId,noShowChain:!0,noBorder:!0,marginRight:0}),In.jsx(i,{children:o.symbol}),In.jsx(i,{sx:{ml:"auto"},children:Ps({input:e,decimals:o.decimals})})]},t)}))}),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:500,lineHeight:"22px",color:o.palette.text.primary},children:Ps({input:h,decimals:n.pool.decimals})}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:In.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:o.palette.text.secondary})})]})})]})]})]}),In.jsxs(A,{value:s,onChange:(e,t)=>{c(t)},children:[In.jsx(F,{tabs:[{key:zv.Add,value:"Add"},{key:zv.Remove,value:"Remove"}],variant:"inPaper",tabsListSx:{mt:16,mx:20}}),In.jsx(L,{value:zv.Add,children:In.jsx(nb,{operateCurvePool:n})}),In.jsx(L,{value:zv.Remove,children:In.jsx(ob,{operateCurvePool:n})})]})]})},ab=({operateCurvePool:e,setOperateCurvePool:t})=>{const{isMobile:n}=Sd(),o=z((()=>{t(null)}),[t]);return n?In.jsx(Rc,{open:!0,onClose:o,scope:!n,modal:n,id:"curve-pool-operate",children:In.jsx(rb,{onClose:o,operateCurvePool:e})}):In.jsx(i,{sx:{borderRadius:16,backgroundColor:"background.paper"},children:In.jsx(rb,{onClose:o,operateCurvePool:e})})};function sb(e,t,n,i){return"CLASSICAL"===i&&e&&t&&e.isEqualTo(t)?e.times(`1e${n}`).minus(1).div(`1e${n}`):e}function lb(e,t){return e.lte(0)?new Oe(0):t.div(e)}function db(e,t,n,i,o,r,a){const s=o&&function(e){return-1!==["0x9D9793e1E18CDEe6cf63818315D55244f73EC006","0x0D04146B2Fe5d267629a7eb341Fb4388DcdBD22f","0x3D9d765b0fbAf594F90F07bc42889473e6613C7A","0x3854BdcB1a7cBA4b1A5f9a7C8719e247Df4c42c6","0xA46F5eC3219f956d14C6816Ef9cf6CaBf13bdD77","0xB16f2Ff8E8499E31B257d2A02D25e8956Ae6aFe7"].findIndex((t=>t.toLowerCase()===e.toLowerCase()))}(o);let l,d;const c="CLASSICAL"===r?i:n;if(e&&t&&c&&void 0!==a){if(d=lb(t,c),l=e.times(d),"CLASSICAL"===r&&s){if(!i)return[void 0,void 0];l.gt(i)&&n&&(d=lb(t,Oe.min(i,n)),l=l.times(d))}return[d,l.dp(Number(a),Oe.ROUND_DOWN)]}return[void 0,void 0]}function cb({account:e,pool:t}){var n,i;const{chainId:o,address:r,type:a,baseTokenDecimals:s,quoteTokenDecimals:l,baseLpTokenDecimals:d,quoteLpTokenDecimals:c}=null!=t?t:{},u=Qe(Ql.getTotalBaseLpQuery(o,r,a,d)),p=Qe(Ql.getTotalQuoteLpQuery(o,r,a,c)),h=Qe(Ql.getUserBaseLpQuery(o,r,a,d,e)),m=Qe(Ql.getUserQuoteLpQuery(o,r,a,c,e)),g=Qe(Ql.getReserveLpQuery(o,r,a,s,l)),f=Qe(Ql.getClassicalTargetQuery(o,r,a,s,l)),x=u.data,y=p.data,{baseReserve:v,quoteReserve:b}=g.data||{},j=null===(n=f.data)||void 0===n?void 0:n.baseTarget,C=null===(i=f.data)||void 0===i?void 0:i.quoteTarget,w="DPP"===a,k=w?v:sb(h.data,x,d,a),T=w?b:sb(m.data,y,c,a),[E,A]=w?[new Oe(1),v]:db(k,x,v,j,r,a,s);let I,S;if(b){let e=p.data;e||p.isLoading||p.error||!x||(e=x);const t=m.isFetched&&!m.error&&null===T?k:T;w?(I=new Oe(1),S=b):m.isLoading||m.error||f.error||t?[I,S]=db(t,e,b,C,r,a,l):S=new Oe(0)}const L=h.isLoading||m.isLoading,O=h.isError||m.isError,R=()=>{h.refetch(),m.refetch(),u.refetch(),p.refetch(),g.refetch(),f.refetch()},M=L||u.isLoading||p.isLoading||g.isLoading||f.isLoading,_=O||u.isError||p.isError||g.isError||f.isError,P="DVM"===(null==t?void 0:t.type)&&(!b||b.isZero());return{totalBaseLpBalance:x,totalQuoteLpBalance:y,baseReserve:v,quoteReserve:b,classicalBaseTarget:j,classicalQuoteTarget:C,userBaseLpBalance:k,userQuoteLpBalance:T,userBaseLpToTokenBalance:A,userQuoteLpToTokenBalance:S,baseLpToTokenProportion:E,quoteLpToTokenProportion:I,isSinglePool:P,userLpBalanceLoading:L,userLpToTokenBalanceLoading:M,userLpBalanceError:O,userLpToTokenBalanceError:_,userLpToTokenBalanceRefetch:R,error:_,loading:M,refetch:R}}const ub=new Te({contractRequests:Ta});function pb({chainId:e,address:t,showName:n,size:o,offset:r,rightContent:a}){const s=In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:r},children:[In.jsx(Fc,{chainId:e,address:t,width:o,height:o,noShowChain:!0,marginRight:0}),n]});return a?In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s,a]}):s}function hb({miningItem:e}){var t,n;const{account:i}=hd(),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,g;const f={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(f),a.push(ub.getPendingRewardQuery(e.chainId,s,i,f.address,f.decimals,t));else switch(e.type){case"classical":r.push(f),a.push(ub.getPendingRewardQuery(e.chainId,s,i,null!==(u=null===(c=e.baseLpToken)||void 0===c?void 0:c.address)&&void 0!==u?u:"",f.decimals,"2")),r.push(f),a.push(ub.getPendingRewardQuery(e.chainId,s,i,null!==(h=null===(p=e.quoteLpToken)||void 0===p?void 0:p.address)&&void 0!==h?h:"",f.decimals,"2"));break;case"vdodo":case"single":r.push(f),a.push(ub.getPendingRewardQuery(e.chainId,s,i,null!==(g=null===(m=e.baseToken)||void 0===m?void 0:m.address)&&void 0!==g?g:"",f.decimals,"2"));break;default:throw new Error(`type: ${e.type} is not valid.`)}}))}return Xe({queries:a,combine:e=>{let t=new Le(0),n=new Le(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 mb({value:e,label:t,tokenList:n,loading:o}){const r=a();return In.jsxs(i,{sx:{flexGrow:0,flexShrink:1,width:"30%"},children:[In.jsx(i,{sx:{typography:"h6",color:r.palette.text.secondary},children:t}),In.jsxs(i,{sx:{mt:8,typography:"body1",fontWeight:600,color:r.palette.text.primary,display:"flex",alignItems:"center",gap:4},children:[In.jsx(v,{loading:o,loadingProps:{width:30},children:e?`$${Ps({input:e,decimals:2})}`:"-"}),In.jsx(l,{placement:"top",title:In.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:8,width:190,color:"text.primary",fontWeight:600},children:n.map((e=>{var t;return In.jsx(pb,{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:In.jsx(i,{component:d,sx:{display:"flex",alignItems:"center",color:r.palette.text.secondary,width:16,height:16,"&:hover":{color:"text.primary"}},children:In.jsx(Un.DetailBorder,{})})})]})]})}function gb({chainId:t,loading:n,miningItem:o,miningContractAddress:r,stakedTokenUSD:s,stakedTokenUSDLoading:l,miningTitle:d,associatedMineSectionShort:c,stakedTokenList:u,isEnded:p}){var h,m;const g=a(),f=hb({miningItem:o});return In.jsxs(i,{sx:{backgroundColor:g.palette.background.paper,borderRadius:8,borderColor:g.palette.border.main,borderStyle:"solid",borderWidth:1,mb:20},children:[c?null:In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{py:12,px:20,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(v,{loading:n,loadingProps:{width:100},children:In.jsx(gg,{width:24,tokens:u,gap:-6,chainId:t,mr:4,showChainLogo:!1})}),In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(i,{sx:{color:g.palette.text.primary,typography:"body2",fontWeight:600,display:"flex",alignItems:"center"},children:null!=d?d:"-"}),p&&In.jsx(i,{sx:{backgroundColor:g.palette.border.disabled,borderRadius:4,typography:"h6",fontWeight:500,px:8,color:g.palette.text.disabled},children:In.jsx(e,{id:"237hSL",message:"Ended"})})]}),In.jsx(qm,{size:"small",truncate:!0,address:null!=r?r:"",iconSpace:4,sx:{color:g.palette.text.secondary,typography:"h6"},customChainId:t})]})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:g.palette.text.secondary,typography:"h6",cursor:"pointer"},onClick:()=>{Gf.getState().push({type:$f.MiningDetail,params:{address:r,chainId:t}})},children:[In.jsx(e,{id:"URmyfc",message:"Details"}),In.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:In.jsx("path",{d:"M7.5 4.5L6.4425 5.5575L9.8775 9L6.4425 12.4425L7.5 13.5L12 9L7.5 4.5Z",fill:"currentColor"})})]})]}),In.jsx(i,{sx:{width:"100%",height:"1px",backgroundColor:g.palette.border.main}})]}),In.jsxs(i,{sx:{py:12,px:20,display:"flex",alignItems:"center",gap:20},children:[In.jsx(mb,{value:s,label:le._({id:"luOvdJ",message:"My Staked"}),tokenList:u,loading:n||l}),In.jsx(i,{sx:{width:"1px",height:30,backgroundColor:g.palette.border.main,flexGrow:0,flexShrink:0}}),In.jsx(mb,{value:f.totalRewardUSD,label:le._({id:"4cJ0hF",message:"Rewards"}),tokenList:null!==(m=null===(h=f.data)||void 0===h?void 0:h.map((e=>Object.assign(Object.assign({chainId:t},e),{name:e.symbol,amount:Ps({input:e.amount,decimals:e.decimals})}))))&&void 0!==m?m:[],loading:f.pending||n})]})]})}const fb=({miningItem:e,successBack:t})=>{const{account:n}=hd(),i=Wd();return Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){const o=yield bn(void 0,void 0,void 0,(function*(){if(!n||!(null==e?void 0:e.miningContractAddress))return null;let t="";const i=yield Te.encode.claimAllMining(e.miningContractAddress);if(i&&i.data)return i.value=0,i;throw t="invalid data",new Error(t)}));if(!o)return;return yield i.execute(le._({id:"hom7qf",message:"Claim"}),Object.assign({opcode:Dd.TX},o),{metadata:{[Od.claimMining]:"1"},successBack:t})}))})};function xb({miningItem:t}){const n=hb({miningItem:t}),i=fb({miningItem:t,successBack:()=>{n.refetch()}});return In.jsx(cx,{includeButton:!0,fullWidth:!0,chainId:null==t?void 0:t.chainId,children:In.jsx(c,{fullWidth:!0,isLoading:i.isPending,disabled:n.totalReward.isZero(),onClick:()=>{i.mutate()},children:i.isPending?In.jsx(e,{id:"KvG1xW",message:"Claiming"}):In.jsx(e,{id:"dUdltF",message:"One-Click Claim"})})})}function yb({tokenSymbol:e,goLpLink:t}){const n=a();return In.jsxs(M,{sx:{color:n.palette.text.secondary,typography:"h6",display:"flex",alignItems:"center"},component:d,onClick:t,children:[le._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:e}}),In.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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 vb({miningItem:t,loading:n,sx:o}){const r=a(),s=hb({miningItem:t});return In.jsxs(i,{sx:Object.assign({borderWidth:1,borderRadius:12},o),children:[In.jsxs(i,{sx:{typography:"body1",color:r.palette.text.secondary,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12},children:[In.jsx(e,{id:"4cJ0hF",message:"Rewards"}),":",In.jsx(v,{loading:n||s.pending,loadingProps:{width:100},sx:{color:r.palette.text.primary,fontWeight:600},children:s.pending||s.error?"-":`$${Ps({input:s.totalRewardUSD,decimals:2})}`})]}),In.jsxs(i,{sx:{borderTopWidth:1,px:20,pt:4,pb:8},children:[(n||s.pending)&&In.jsx(v,{loading:n,loadingProps:{width:150}}),!n&&!s.pending&&!!t&&s.data.map((e=>In.jsxs(i,{sx:{mt:16,display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[e.address&&e.symbol&&In.jsx(pb,{chainId:t.chainId,address:e.address,showName:e.symbol,size:24,offset:6}),In.jsxs(i,{sx:{ml:"auto"},children:[In.jsx(i,{sx:{typography:"h5",textAlign:"right"},children:Ps({input:e.amount,decimals:e.decimals})}),In.jsx(i,{sx:{mt:2,typography:"body2",color:r.palette.text.secondary,textAlign:"right"},children:e.usdPrice&&e.amount?`≈ $${Ps({input:new Le(e.amount).multipliedBy(e.usdPrice).dp(4,Le.ROUND_DOWN),decimals:4})}`:"-"})]})]},e.address)))]})]})}function bb({status:t,children:n,buttonProps:i}){return!t.needShowTokenStatusButton&&n?In.jsx(In.Fragment,{children:n}):t.insufficientBalance?In.jsx(c,{fullWidth:!0,disabled:!0,...i,children:In.jsx(e,{id:"znqB4T",message:"Insufficient balance"})}):In.jsx(c,{fullWidth:!0,isLoading:t.isApproving,onClick:t.submitApprove,disabled:t.insufficientBalance,...i,children:t.isApproving?In.jsx(e,{id:"j2Uisd",message:"Approving"}):t.approveTitle})}function jb(e){if(!e&&"number"!=typeof e)return e;let t="";return t=Le.isBigNumber(e)?e.toString(16):new Le(e).toString(16),t.length%2?"0x0"+t:"0x"+t}function Cb(e){return jb(Fs(e,18))}const wb=({miningItem:e,amount:t,submittedBack:n,successBack:i,logBalance:o})=>{const{chainId:r,account:a}=hd(),s=Wd(),l=ve[r];return Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){const r=yield bn(void 0,void 0,void 0,(function*(){var n,i;if(!(a&&e&&e.baseToken&&e.miningContractAddress))return null;let o="";const r=new Le(t),s=Number(e.baseToken.decimals),d=yield Te.encode.depositMining(e.miningContractAddress,r,s);if(!d||!d.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())===l.address.toLocaleLowerCase()?d.value=Cb(r):d.value=0,d}catch(e){throw console.error("2.0 sendTransaction error",e),o=`2.0 sendTransaction error; ERROR: ${e}`,new Error(o)}}));if(!r)return;return yield s.execute(le._({id:"JYKRJS",message:"Stake"}),Object.assign({opcode:Dd.TX},r),{metadata:{[Od.stakeMining]:"1",logBalance:o},submittedBack:n,successBack:i})}))})};function kb({goLpLink:t,amount:n,miningItem:i,balanceInfo:o,submittedBack:r,successBack:a,logBalance:s}){var l,d,u,p;const h=wb({miningItem:i,amount:n,submittedBack:r,successBack:a,logBalance:s}),m=i?`${null===(l=i.baseToken)||void 0===l?void 0:l.symbol}-${null===(d=i.quoteToken)||void 0===d?void 0:d.symbol} LP`:"",g=cc(i?pd(Object.assign(Object.assign({},i.baseLpToken),{symbol:m}),i.chainId):null,{contractAddress:null!==(u=null==i?void 0:i.miningContractAddress)&&void 0!==u?u:"",overrideBalance:o.userBaseLpBalance,amount:n});return t&&m&&(null===(p=o.userBaseLpBalance)||void 0===p?void 0:p.isZero())?In.jsx(c,{fullWidth:!0,onClick:()=>t(),children:le._({id:"dJqd5x",message:"Get {tokenSymbol}",values:{tokenSymbol:m}})}):In.jsx(cx,{includeButton:!0,fullWidth:!0,chainId:null==i?void 0:i.chainId,children:In.jsx(bb,{status:g,children:In.jsx(c,{fullWidth:!0,isLoading:h.isPending,disabled:!Number(n),onClick:()=>{h.mutate()},children:h.isPending?In.jsx(e,{id:"KsqhWn",message:"Staking"}):In.jsx(e,{id:"JYKRJS",message:"Stake"})})})})}const Tb=({miningItem:e,amount:t,submittedBack:n,successBack:i,logBalance:o})=>{const{account:r}=hd(),a=Wd();return Je({mutationFn:()=>bn(void 0,void 0,void 0,(function*(){const s=yield bn(void 0,void 0,void 0,(function*(){if(!(r&&e&&e.baseToken&&e.miningContractAddress))return null;let n="";const i=new Le(t),o=Number(e.baseToken.decimals),a=yield Te.encode.withdrawMining(e.miningContractAddress,i,o);if(a&&a.data)return a.value=0,a;throw n="invalid data",new Error(n)}));if(!s)return;return yield a.execute(le._({id:"OFjZGo",message:"Unstake"}),Object.assign({opcode:Dd.TX},s),{metadata:{[Od.unstakeMining]:"1",logBalance:o},submittedBack:n,successBack:i})}))})};function Eb({amount:t,miningItem:n,overrideBalance:i,submittedBack:o,successBack:r,logBalance:a}){var s,l;const d=Tb({miningItem:n,amount:t,submittedBack:o,successBack:r,logBalance:a}),u=n?`${null===(s=n.baseToken)||void 0===s?void 0:s.symbol}-${null===(l=n.quoteToken)||void 0===l?void 0:l.symbol} LP`:"",p=cc(n?pd(Object.assign(Object.assign({},n.baseLpToken),{symbol:u}),n.chainId):null,{overrideBalance:i,amount:t,skipQuery:!0});return In.jsx(cx,{includeButton:!0,fullWidth:!0,chainId:null==n?void 0:n.chainId,children:In.jsx(bb,{status:p,children:In.jsx(c,{fullWidth:!0,isLoading:d.isPending,disabled:!Number(t),onClick:()=>{d.mutate()},children:d.isPending?In.jsx(e,{id:"1gWStS",message:"Unstaking"}):In.jsx(e,{id:"OFjZGo",message:"Unstake"})})})})}function Ab(e){var{sx:t}=e,n=vn(e,["sx"]);const o=a();return In.jsx(i,{sx:Object.assign({paddingTop:20,backgroundColor:o.palette.background.paper,position:"sticky",bottom:0},t),...n})}function Ib({chainId:e,poolAddress:t,status:n,loading:o,operateType:r,setOperateType:s,miningItem:l,associatedMineSectionVisible:d,goLpLink:c}){var u,p,h,m,g,f,x,y,v,b,j,C,w,k,T,E,I;const S=a(),{account:O}=hd(),{miningContractAddress:R}=null!=l?l:{},M=pd(null==l?void 0:l.baseToken,e),_=pd(null==l?void 0:l.quoteToken,e),[P,B]=H.useState(""),[D,N]=H.useState(""),U=[{key:"stake",value:le._({id:"JYKRJS",message:"Stake"})},{key:"unstake",value:le._({id:"OFjZGo",message:"Unstake"})},{key:"claim",value:le._({id:"hom7qf",message:"Claim"})}],q=l&&M&&_&&["classical","lptoken"].includes(null!==(u=l.type)&&void 0!==u?u:"")?{chainId:e,address:t,type:"lptoken"===l.type?"DSP":"CLASSICAL",baseToken:M,quoteToken:_}:void 0,V=cb({account:O,pool:l&&M&&_&&l.baseLpToken&&l.quoteLpToken&&["classical","lptoken"].includes(null!==(p=l.type)&&void 0!==p?p:"")?{chainId:e,address:t,type:"lptoken"===l.type?"DSP":"CLASSICAL",baseTokenDecimals:M.decimals,quoteTokenDecimals:_.decimals,baseLpTokenDecimals:null!==(h=l.baseLpToken.decimals)&&void 0!==h?h:18,quoteLpTokenDecimals:null!==(m=l.quoteLpToken.decimals)&&void 0!==m?m:18}:void 0}),W=Qe(Ql.getPMMStateQuery(null==q?void 0:q.chainId,null==q?void 0:q.address,null==q?void 0:q.type,null===(g=null==q?void 0:q.baseToken)||void 0===g?void 0:g.decimals,null===(f=null==q?void 0:q.quoteToken)||void 0===f?void 0:f.decimals)),Z=Qe(ub.getLpStakedBalance(null==l?void 0:l.chainId,(null==l?void 0:l.miningContractAddress)||void 0,O,null!==(y=null===(x=null==l?void 0:l.baseLpToken)||void 0===x?void 0:x.address)&&void 0!==y?y:"",null===(v=null==l?void 0:l.baseToken)||void 0===v?void 0:v.decimals,null==l?void 0:l.version)),z=Z.isLoading||W.isLoading;let $,G,Y;if(Z.data&&V.baseLpToTokenProportion&&V.quoteLpToTokenProportion&&!W.isLoading){const e=null===(b=null==l?void 0:l.baseToken)||void 0===b?void 0:b.price,t=null===(j=null==l?void 0:l.quoteToken)||void 0===j?void 0:j.price,n=null===(C=W.data)||void 0===C?void 0:C.midPrice;G=Z.data.times(V.baseLpToTokenProportion),Y=Z.data.times(V.quoteLpToTokenProportion),n?t?$=G.times(n).plus(Y).times(t):e&&($=Y.times(n).plus(G).times(e)):e&&t&&($=G.times(e).plus(Y.times(t)))}const Q=M&&_?[Object.assign(Object.assign({},M),{amount:Ps({input:G,decimals:M.decimals})}),Object.assign(Object.assign({},_),{amount:Ps({input:Y,decimals:_.decimals})})]:[],X=M&&_?`${M.symbol}-${_.symbol} LP`:"- LP",K=n===Ee.ended,J=(null===(w=null==l?void 0:l.baseLpToken)||void 0===w?void 0:w.address)&&V.userBaseLpBalance?{[null===(k=null==l?void 0:l.baseLpToken)||void 0===k?void 0:k.address]:V.userBaseLpBalance.toString()}:{},ee=()=>{V.refetch(),W.refetch(),Z.refetch()};return In.jsx(In.Fragment,{children:In.jsxs(i,{sx:{paddingTop:20,borderTopLeftRadius:16,borderTopRightRadius:16,backgroundColor:S.palette.background.paper,px:20,paddingBottom:0,borderBottomLeftRadius:0,borderBottomRightRadius:0},children:[d&&In.jsx(gb,{chainId:e,miningContractAddress:null!=R?R:"",loading:o,miningItem:l,stakedTokenUSD:$,stakedTokenUSDLoading:z,miningTitle:null!==(T=null==l?void 0:l.title)&&void 0!==T?T:"",stakedTokenList:Q}),In.jsxs(A,{value:r,onChange:(e,t)=>{s(t)},children:[In.jsx(F,{tabs:U,variant:"inPaper",tabsListSx:{mt:16}}),In.jsxs(L,{value:"stake",children:[In.jsxs(i,{sx:{mt:20,borderColor:S.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:16},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(gg,{width:Q.length>1?20:28,tokens:Q,chainId:e}),In.jsx(i,{sx:{ml:8,typography:"body1",color:S.palette.text.primary,fontWeight:600},children:X})]}),!!c&&In.jsx(yb,{tokenSymbol:X,goLpLink:c})]}),In.jsx(og,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:le._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:V.userBaseLpBalance||new Le("-"),overrideBalanceLoading:V.loading,amt:P,canClickBalance:!0,onInputChange:e=>{B(e)},readOnly:K||o,token:M,checkLogBalance:J,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),In.jsx(Ab,{children:In.jsx(kb,{miningItem:l,balanceInfo:V,amount:P,goLpLink:c,submittedBack:()=>B(""),successBack:ee,logBalance:J})})]}),In.jsxs(L,{value:"unstake",children:[In.jsx(og,{showPercentage:!0,hideToken:!0,inputTypography:"h1",balanceText:le._({id:"RxHSET",message:"LP Balance:"}),overrideBalance:Z.data||new Le("-"),overrideBalanceLoading:Z.isLoading,amt:K?null!==(I=null===(E=Z.data)||void 0===E?void 0:E.toString())&&void 0!==I?I:"":D,onInputChange:e=>{N(e)},canClickBalance:!0,readOnly:K||o,token:M,checkLogBalance:J,occupiedChainId:e,chainId:e,sx:{mt:20,borderWidth:1}}),In.jsx(Ab,{children:In.jsx(Eb,{miningItem:l,overrideBalance:Z.data,amount:D,submittedBack:()=>N(""),successBack:ee,logBalance:J})})]}),In.jsxs(L,{value:"claim",children:[In.jsx(vb,{miningItem:l,loading:o,sx:{mt:20}}),In.jsx(Ab,{children:In.jsx(xb,{miningItem:l})})]})]})]})})}function Sb({chainId:e,account:t,poolAddress:n,goLpLink:i}){var o,r,a;const s=vd().getQuery(Te.graphql.fetchMiningList,{where:{chainIds:[e],user:t,filterState:{address:n}}}),l=Qe(Object.assign(Object.assign({},s),{enabled:!!n})),d=null===(a=null===(r=null===(o=l.data)||void 0===o?void 0:o.mining_list)||void 0===r?void 0:r.list)||void 0===a?void 0:a[0],{status:c}=function({miningItem:e}){var t,n;let i=Ee.active,o=[];if(null==e?void 0:e.rewardTokenInfos)if("classical"!==e.type){const r=Te.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=r.status,o.push(r)}else if(e.rewardQuoteTokenInfos){o=[e.rewardTokenInfos,e.rewardQuoteTokenInfos].map((t=>{var n,i;return Te.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;Ee.active,(t===Ee.upcoming&&n===Ee.upcoming||t===Ee.upcoming&&n===Ee.ended||t===Ee.ended&&n===Ee.upcoming)&&Ee.upcoming,t===Ee.ended&&n===Ee.ended&&Ee.ended}return{status:i,miningStatusList:o}}({miningItem:d}),[u,p]=H.useState(c===Ee.ended?"unstake":"stake");return In.jsx(Ib,{chainId:e,loading:l.isLoading||l.isPending,operateType:u,setOperateType:p,associatedMineSectionVisible:!0,miningItem:d,status:c,goLpLink:i,poolAddress:n})}const Lb=()=>{const t=a();return In.jsx(l,{placement:"top-end",leaveDelay:100,title:In.jsx(i,{sx:{maxWidth:240,color:t.palette.warning.main,typography:"h6",fontWeight:500,"&>a":{textDecoration:"underline",color:t.palette.warning.main},"&>a:hover":{color:T(t.palette.warning.main,.5)}},children:In.jsx(e,{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:In.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.dodoex.io/en/product/pmm-algorithm"})}})}),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:2,py:4,px:8,borderRadius:8,backgroundColor:T(t.palette.warning.main,.1),color:t.palette.warning.main,typography:"h6",fontWeight:500,lineHeight:"16px",cursor:"help"},children:[In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:In.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"})}),In.jsx(e,{id:"iDGO1l",message:"Disclaimer"})]})})};var Ob;function Rb(t){const{ConfirmComponent:n}=On();if(n)return In.jsx(n,{...t});const{open:o,onClose:r,title:a,children:s,singleBtn:l,danger:d,singleBtnText:u,cancelText:p,confirmText:h,disabledConfirm:m,confirmLoading:g,isManualClose:f,onConfirm:x,modal:y}=t;return In.jsx(Rc,{open:o,onClose:r,title:a,modal:y,children:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1},children:[In.jsx(i,{sx:{typography:"body2",color:a?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:s}),l?In.jsx(i,{sx:{px:20},children:In.jsx(c,{fullWidth:!0,variant:c.Variant.outlined,danger:d,sx:{mt:32,mb:20},onClick:()=>{r()},children:u||In.jsx(e,{id:"DPfwMq",message:"Done"})})}):In.jsxs(i,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[In.jsx(c,{variant:c.Variant.second,onClick:()=>{r()},children:p||In.jsx(e,{id:"dEgA5A",message:"Cancel"})}),In.jsx(c,{sx:{ml:8},variant:c.Variant.outlined,danger:d,disabled:m,isLoading:g,onClick:()=>{x&&x(),f||r()},children:h||In.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})]})})}function Mb(e){var{sx:t,label:n,children:o}=e,r=vn(e,["sx","label","children"]);return In.jsxs(i,{sx:Object.assign({display:"flex",justifyContent:"space-between"},t),...r,children:[In.jsx(i,{children:n}),In.jsx(i,{sx:{textAlign:"right",fontWeight:600},children:o})]})}function _b({baseToken:e,quoteToken:t,midPrice:n,loading:o,disabled:r}){const s=a(),[d,c]=$(!1),u=d?null==t?void 0:t.symbol:null==e?void 0:e.symbol,p=d&&n?new Le(1).div(n):n,h=d?null==e?void 0:e.symbol:null==t?void 0:t.symbol;return In.jsxs(v,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:o,loadingProps:{width:50},children:[e&&t?In.jsx(l,{title:`1 ${u} = ${p?_s({input:p}):""} ${h}`,children:n?In.jsx(i,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${u} = ${p?_s({input:p}):""} ${h}`}):In.jsxs(i,{children:[`1 ${u} = `,In.jsx(v,{loading:o,loadingProps:{width:30},component:"span",sx:{display:"inline-block"},children:"-"}),` ${h}`]})}):"-",In.jsx(i,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,backgroundColor:"background.paperDarkContrast",borderRadius:"50%"},!r&&{cursor:"pointer","&:hover":{backgroundColor:T(s.palette.text.primary,.04)}}),onClick:()=>{r||c((e=>!e))},children:In.jsx(i,{component:Un.Switch,sx:{width:18,height:18}})})]})}function Pb({baseToken:t,quoteToken:n,loading:o,midPrice:r,shareOfPool:s,sx:l}){const d=a(),c=!t||!n;return In.jsxs(i,{sx:Object.assign({mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},l),children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[In.jsx(i,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:In.jsx(e,{id:"kNeEXg",message:"Current Price"})}),In.jsx(_b,{baseToken:t,quoteToken:n,loading:o,disabled:c,midPrice:r})]}),In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:d.spacing(1,0,0),borderColor:"border.main"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:In.jsx(e,{id:"SbBMxj",message:"Share of pool"})}),In.jsx(i,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:In.jsx(v,{sx:{display:"flex",alignItems:"center",fontWeight:600,overflow:"hidden"},loading:o,loadingProps:{width:50},children:s||"-%"})})]})]})}function Bb({open:t,onClose:n,slippage:o,baseToken:r,quoteToken:s,baseAmount:l,quoteAmount:d,lpAmount:u,fee:p,price:h,shareOfPool:m,pairAddress:g,createMutation:f}){const x=a(),{isMobile:y}=Sd();return In.jsx(Rc,{modal:!0,open:t,onClose:n,title:u?In.jsx(e,{id:"AeZIvT",message:"You will receive"}):In.jsx(e,{id:"aM1tos",message:"You are creating a pool"}),children:In.jsxs(i,{sx:{px:20,py:24,borderTopWidth:1,width:y?"100%":420},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,typography:"h3"},children:[In.jsx(gg,{width:24,height:24,tokens:r&&s?[r,s]:[],chainId:null==r?void 0:r.chainId}),u?Ps({input:u,decimals:18}):""]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:x.palette.text.secondary,gap:4,fontWeight:600},children:[In.jsx(e,{id:"syToc5",message:"{0}/{1} Pool Tokens",values:{0:null==r?void 0:r.symbol,1:null==s?void 0:s.symbol}}),In.jsx(tv,{poolType:"AMM V2"})]})]}),In.jsx(i,{sx:{mt:16,typography:"h6",color:"text.secondary",textAlign:"center"},children:In.jsx(e,{id:"rQ9c+8",message:"Output is estimated. If the price changes by more than {0} your transaction will revert.",values:{0:Gs({input:o})}})}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:12,mt:20,p:20,typography:"body2",borderRadius:12,backgroundColor:x.palette.background.paperContrast},children:[In.jsx(Mb,{label:In.jsx(e,{id:"YG004A",message:"{0} deposited",values:{0:null==r?void 0:r.symbol}}),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[In.jsx(Fc,{width:18,height:18,marginRight:4,token:r}),Ps({input:l,decimals:null==r?void 0:r.decimals})]})}),In.jsx(Mb,{label:In.jsx(e,{id:"YG004A",message:"{0} deposited",values:{0:null==s?void 0:s.symbol}}),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{width:18,height:18,marginRight:4,token:s}),Ps({input:d,decimals:null==s?void 0:s.decimals})]})}),In.jsx(Mb,{label:In.jsx(e,{id:"EU3wU4",message:"Fee tier"}),children:Gs({input:p})}),In.jsx(Mb,{label:In.jsx(e,{id:"fqDzSu",message:"Rate"}),children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{width:18,height:18,marginRight:4,token:r}),In.jsx(_b,{baseToken:r,quoteToken:s,midPrice:h})]})}),In.jsx(Mb,{label:In.jsx(e,{id:"SbBMxj",message:"Share of pool"}),children:m}),In.jsx(Mb,{label:In.jsx(e,{id:"ESQO1L",message:"Pool address"}),children:In.jsx(qm,{showCopy:!1,address:null!=g?g:"",customChainId:null==r?void 0:r.chainId,truncate:!0,iconSpace:4,sx:{typography:"body2"}})})]}),In.jsx(c,{fullWidth:!0,size:c.Size.big,sx:{mt:20},isLoading:f.isPending,onClick:()=>{f.mutate()},children:f.isPending?In.jsx(e,{id:"pwUZo2",message:"Confirming..."}):In.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})})}function Db(e,t,n){const i=new Le(e),o=new Le(t),r=i.minus(o),a=i.gt(o),s=i.lt(o);return{now:o,target:i,isChange:a||s,change:r,changeText:(s?"":"+")+_s({input:r,showDecimals:n>6?6:4,showPrecisionDecimals:2}),isAdd:a,isRemove:s}}!function(e){e[e.Liquidity=1]="Liquidity",e[e.Mining=2]="Mining"}(Ob||(Ob={}));const Nb=e=>bn(void 0,[e],void 0,(function*({chainId:e,account:t,srcPool:n,baseToken:i,quoteToken:o,baseAmount:r,quoteAmount:a,feeRate:s,initPrice:l,slippageCoefficient:d,ddl:c,SLIPPAGE_PROTECTION:u}){const p=e?ve[e]:void 0,h=function({srcPool:e,newPool:t}){if(!e)return null;const{baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:r}=t,{baseReserve:a,quoteReserve:s}=e;return{baseAmount:Db(o,a,n.decimals),quoteAmount:Db(r,s,i.decimals),feeRate:Db(new Le(t.feeRate).div(100),e.feeRate,6),initPrice:Db(t.initPrice,e.i,10),slippageCoefficient:Db(t.slippageCoefficient||"1",e.k,4)}}({srcPool:n,newPool:{baseToken:i,quoteToken:o,baseAmount:r,quoteAmount:a,feeRate:s,initPrice:l,slippageCoefficient:d}});if(!(t&&e&&h&&n))return null;const m=Number(i.decimals),g=Number(o.decimals);let f;const x=h.slippageCoefficient.target;try{const t=i.symbol===(null==p?void 0:p.symbol),r=o.symbol===(null==p?void 0:p.symbol);if(h.baseAmount.isRemove&&h.quoteAmount.isRemove){const t=[yield Ql.getDPPOwnerProxyAddressQuery(e,n.address).queryFn(),h.feeRate.target.multipliedBy(1e4).toNumber(),h.initPrice.target.toNumber(),x.toNumber(),Lt(h.baseAmount.change.abs().dp(m,Le.ROUND_FLOOR).toString(),m).toString(),Lt(h.quoteAmount.change.abs().dp(g,Le.ROUND_FLOOR).toString(),g).toString(),Lt(h.baseAmount.now.multipliedBy(1-u).dp(m,Le.ROUND_FLOOR).toString(),m).toString(),Lt(h.quoteAmount.now.multipliedBy(1-u).dp(g,Le.ROUND_FLOOR).toString(),g).toString(),m,g];f=yield me.encode.removeDPPPoolABI(...t)}else{const t=[e,n.address,h.feeRate.target.multipliedBy(1e4).toNumber(),h.initPrice.target.toNumber(),x.toNumber(),h.baseAmount.isAdd?Lt(h.baseAmount.change.abs().dp(m,Le.ROUND_FLOOR).toString(),m).toString():"0",h.quoteAmount.isAdd?Lt(h.quoteAmount.change.abs().dp(g,Le.ROUND_FLOOR).toString(),g).toString():"0",h.baseAmount.isAdd?"0":Lt(h.baseAmount.change.abs().dp(m,Le.ROUND_FLOOR).toString(),m).toString(),h.quoteAmount.isAdd?"0":Lt(h.quoteAmount.change.abs().dp(g,Le.ROUND_FLOOR).toString(),g).toString(),Lt(h.baseAmount.now.multipliedBy(1-u).dp(m,Le.ROUND_FLOOR).toString(),m).toString(),Lt(h.quoteAmount.now.multipliedBy(1-u).dp(g,Le.ROUND_FLOOR).toString(),g).toString(),0,m,g,Math.ceil(Date.now()/1e3)+(null!=c?c:600)];f=yield me.encode.resetDPPPoolABI(...t)}return t&&h.baseAmount.isAdd&&(f.value=Cb(h.baseAmount.change)),r&&h.quoteAmount.isAdd&&(f.value=Cb(h.quoteAmount.change)),f}catch(e){throw console.error("2.0 resetDPPPool error",e),new Error(`2.0 resetDPPPool error;ERROR:${e}`)}})),Fb=(e,t,n)=>t?e&&"0"!==e?n?t.minus(e).toString():t.plus(e).toString():t.toString():e;function Ub({pool:e}){var t,n;const{account:i}=hd(),o=Wd(),r=Qe(Ql.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=Qe(Ql.getLPFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type)),{deadLine:s}=On(),l=Je({mutationFn:t=>bn(this,[t],void 0,(function*({baseAmount:t,quoteAmount:n,isRemove:l=!1,feeRate:d,initPrice:c,slippageCoefficient:u,txTitle:p,submittedBack:h}){var m;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:x,quoteReserve:y}=r.data,v=f.i.toNumber(),b=f.k.toNumber(),j=yield Nb({account:i,chainId:null==e?void 0:e.chainId,SLIPPAGE_PROTECTION:ix,srcPool:Object.assign(Object.assign({},e),{baseReserve:x,quoteReserve:y,i:v,k:b,feeRate:g.times(100).toString()}),baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,baseAmount:Fb(t,x?new Le(x):void 0,l),quoteAmount:Fb(n,y?new Le(y):void 0,l),feeRate:null!=d?d:g.times(100).toString(),initPrice:null!=c?c:String(v),slippageCoefficient:null!=u?u:String(b),ddl:s});if(!j)throw new Error(`modify pool failed: ${e.address}`);return o.execute(p,Object.assign(Object.assign({opcode:Dd.TX},j),{value:null!==(m=j.value)&&void 0!==m?m:0}),{metadata:{[l?Od.removeLiquidity:Od.addLiquidity]:!0},submittedBack:h})}))});return{modifyDPPMutation:l}}const qb=e=>{const{account:t,chainId:n}=hd(),i=Wd(),o=Ke(),{deadLine:r}=On(),{modifyDPPMutation:a}=Ub({pool:e}),s=Je({mutationFn:a=>bn(void 0,void 0,void 0,(function*(){var s,l,d,c,u;if(!e||!t||!a.balanceInfo)return;const{isRemove:p,baseAmount:h,quoteAmount:m,slippageProtection:g,balanceInfo:f,SLIPPAGE_PROTECTION:x,submittedBack:y,successBack:v,txTitle:b,withdrawInfo:j}=a,C=!p,{address:w,type:k,baseToken:T,quoteToken:E}=e,A=T.address.toLowerCase(),I=E.address.toLowerCase(),S=ve[n].address.toLowerCase(),L=S===A,O=S===I,R="DSP"===k||"GSP"===k,M="CLASSICAL"===k,_=w.toLocaleLowerCase(),P=new Le(h),B=new Le(m),D=P.isNaN(),N=B.isNaN(),F=+T.decimals,U=+E.decimals,q=T.symbol,V=E.symbol,W=g;let H,Z=D?"0":Lt(P.multipliedBy(1-W).dp(F,Le.ROUND_FLOOR).toString(),F).toString(),z=N?"0":Lt(B.multipliedBy(1-W).dp(U,Le.ROUND_FLOOR).toString(),U).toString();try{if(C)if(M){const e=!D&&(null==f?void 0:f.classicalBaseTarget)&&f.classicalBaseTarget.gt(0)&&f.totalBaseLpBalance?Lt(P.multipliedBy(f.totalBaseLpBalance).multipliedBy(1-x).div(f.classicalBaseTarget).dp(F,Le.ROUND_FLOOR).toString(),F).toString():"0",t=!N&&(null==f?void 0:f.classicalBaseTarget)&&f.totalQuoteLpBalance&&f.classicalQuoteTarget&&f.classicalQuoteTarget.gt(0)?Lt(B.multipliedBy(f.totalQuoteLpBalance).multipliedBy(1-x).div(f.classicalQuoteTarget).dp(U,Le.ROUND_FLOOR).toString(),U).toString():"0",i=[n,_,D?"0":Lt(P.dp(F,Le.ROUND_FLOOR).toString(),F).toString(),N?"0":Lt(B.dp(U,Le.ROUND_FLOOR).toString(),U).toString(),e,t,L?1:O?2:0,Math.ceil(Date.now()/1e3)+(null!=r?r:600)];H=yield me.encode.addClassicalLiquidityABI(...i)}else{const e=[n,_,D?"0":Lt(P.dp(F,Le.ROUND_FLOOR).toString(),F).toString(),N?"0":Lt(B.dp(U,Le.ROUND_FLOOR).toString(),U).toString(),Z,z,L?1:O?2:0,Math.ceil(Date.now()/1e3)+(null!=r?r:600)];H=R?yield me.encode.addDSPLiquidityABI(...e):yield me.encode.addDVMLiquidityABI(...e)}else if(M){if("base"===(D?"quote":"base")){const e=P.dp(F,Le.ROUND_FLOOR).toString(),t=j&&j.receiveAmountBg?Lt(j.receiveAmountBg.multipliedBy(1-W).dp(F,Le.ROUND_FLOOR).toString(),F).toString():Z,i=[n,_,Lt(e,F).toString(),t];H=yield me.encode.removeClassicalBaseABI(...i)}else{const e=B.dp(U,Le.ROUND_FLOOR).toString(),t=j&&j.receiveAmountBg?Lt(j.receiveAmountBg.multipliedBy(1-W).dp(U,Le.ROUND_FLOOR).toString(),U).toString():z,i=[n,_,Lt(e,U).toString(),t];H=yield me.encode.removeClassicalQuoteABI(...i)}}else{if(!((null==f?void 0:f.baseReserve)&&f.quoteReserve&&f.totalBaseLpBalance&&f.userBaseLpBalance&&f.userBaseLpToTokenBalance))return;let e=new Le(0);if(null===(s=f.totalBaseLpBalance)||void 0===s?void 0:s.lte(0))e=f.userBaseLpBalance||new Le(0);else if(f.baseReserve.gt(0)&&f.quoteReserve.eq(0)){let t=P;P.gte(f.userBaseLpToTokenBalance)&&(t=f.userBaseLpToTokenBalance),e=t.multipliedBy(f.totalBaseLpBalance).div(f.baseReserve)}else if(f.baseReserve.gt(0)&&f.quoteReserve.gt(0)){let t=P;P.gte(f.userBaseLpToTokenBalance)&&(t=f.userBaseLpToTokenBalance);let n,i=B;if(f.userQuoteLpToTokenBalance&&B.gte(f.userQuoteLpToTokenBalance)&&(i=f.userQuoteLpToTokenBalance),i.gt(0)&&(null===(l=f.userQuoteLpToTokenBalance)||void 0===l?void 0:l.gt(0))&&(n=i.div(f.userQuoteLpToTokenBalance)),t.gt(0)&&f.userBaseLpToTokenBalance.gt(0)&&(n=t.div(f.userBaseLpToTokenBalance)),(null==n?void 0:n.gte(1))&&(n=new Le(1)),!n)return;e=n.multipliedBy(f.userBaseLpBalance);const o=e.dp(F,Le.ROUND_FLOOR).div(f.totalBaseLpBalance);t=o.multipliedBy(f.baseReserve).dp(F,Le.ROUND_FLOOR),i=o.multipliedBy(f.quoteReserve).dp(U,Le.ROUND_FLOOR),Z=Lt(t.multipliedBy(1-W).dp(F,Le.ROUND_FLOOR).toString(),F).toString(),z=Lt(i.multipliedBy(1-W).dp(U,Le.ROUND_FLOOR).toString(),U).toString()}const i=L||O,o=[n,_,t,e.isNaN()?"0":Lt(e.dp(F,Le.ROUND_FLOOR).toString(),F).toString(),Z,z,i,Math.ceil(Date.now()/1e3)+(null!=r?r:600)];H=R?yield me.encode.removeDSPLiquidityABI(...o):yield me.encode.removeDVMLiquidityABI(...o)}}catch(e){throw new Error(`v2 addDVMLiquidity or removeDVMLiquidity or removeDSPLiquidity error: ${e}`)}if(H&&H.data){const r={};if(h){const i=null===(d=o.getQueryData(Ea.getFetchTokenQuery(n,T.address,t).queryKey))||void 0===d?void 0:d.balance;i&&(r[T.address]=i.toString()),e.baseLpToken&&(null==f?void 0:f.userBaseLpBalance)&&(r[e.baseLpToken.id]=f.userBaseLpBalance.toString())}if(m){const i=null===(c=o.getQueryData(Ea.getFetchTokenQuery(n,E.address,t).queryKey))||void 0===c?void 0:c.balance;i&&(r[E.address]=i.toString()),e.quoteLpToken&&(null==f?void 0:f.userQuoteLpBalance)&&(r[e.quoteLpToken.id]=f.userQuoteLpBalance.toString())}try{let e;C&&L&&(H.value=Cb(D?"0":P)),C&&O&&(H.value=Cb(N?"0":B)),D||(e=`${P.toString()}${q}`),N||(e=D?`${B.toString()}${V}`:`${e} & ${B.toString()}${V}`);(yield i.execute(b,Object.assign(Object.assign({opcode:Dd.TX},H),{value:null!==(u=H.value)&&void 0!==u?u:0}),{subtitle:e,metadata:{[C?Od.addLiquidity:Od.removeLiquidity]:!0,logBalance:r},submittedBack:y}))===Rd.Success&&v&&v()}catch(e){throw Error(`v2 sendTransaction error: ${e}`)}}}))}),l="DPP"===(null==e?void 0:e.type)?a:s;return H.useEffect((()=>{l.reset()}),[e]),{operateLiquidityMutation:l}};function Vb({baseToken:e,quoteToken:n,baseAmount:i,quoteAmount:o,slippage:r,fee:a,isExists:s,successBack:l,submittedBack:d}){const c=Wd(),{account:u}=hd();t();const{deadLine:p}=On();return Je({mutationFn:()=>bn(this,void 0,void 0,(function*(){var t,h;if(!e||!n)throw new Error("token is undefined");if(!u)throw new Error("account is undefined");if(!a)throw new Error("fee is undefined");const m=e.chainId,g=ve[m].address.toLowerCase(),f=rt(m),x=ct(m),y=!f,v=f||x;if(!v)throw new Error("AMMV2 contract address is not valid.");let b="",j="0x0";const C=e.address.toLowerCase()===g,w=n.address.toLowerCase()===g,k=Fs(i,e.decimals),T=Fs(o,n.decimals),E=k.times(1-r).dp(0,Le.ROUND_FLOOR),A=T.times(1-r).dp(0,Le.ROUND_FLOOR),I=Fs(a,4).toString(),S=Math.ceil(Date.now()/1e3)+(null!=p?p:600);try{if(C){const e=n.address,i=T.toString(),o=A.toString(),r=E.toString();j=null!==(t=jb(k))&&void 0!==t?t:"",b=y?ut(e,i,o,r,u,S):pt(e,I,i,o,r,u,S)}else if(w){const t=e.address,n=k.toString(),i=E.toString(),o=A.toString();j=null!==(h=jb(T))&&void 0!==h?h:"",b=y?ut(t,n,i,o,u,S):pt(t,I,n,i,o,u,S)}else b=y?ht(e.address,n.address,k.toString(),T.toString(),E.toString(),A.toString(),u,S):mt(e.address,n.address,I,k.toString(),T.toString(),E.toString(),A.toString(),u,S)}catch(e){throw console.error("encodeUniswapV2Router02AddLiquidity error",e),e}return yield c.execute(s?le._({id:"E6MqGy",message:"Add liquidity"}):le._({id:"L37FfW",message:"Create AMM V2 Position"}),{opcode:Dd.TX,to:v,data:b,value:j},{metadata:{[s?Od.addLiquidityAMMV2Position:Od.createAMMV2Position]:!0},successBack:l,submittedBack:d})}))})}function Wb({lqAndDodoCompareText:t,baseToken:n,quoteToken:o,midPrice:r}){const a=r?_s({input:r}):"";return In.jsxs(i,{sx:{p:10,mb:12,backgroundColor:"background.paperDarkContrast",borderRadius:12},children:[In.jsxs(i,{sx:{typography:"body2",display:"flex",alignItems:"center",justifyContent:"center",color:"error.main",fontWeight:600,mb:10,textAlign:"center"},children:[In.jsx(i,{component:Un.Alarm,sx:{mr:4}}),le._({id:"YUyuNp",message:"{lqAndDodoCompareText} Price Difference",values:{lqAndDodoCompareText:t}})]}),In.jsxs(i,{sx:{typography:"h6",color:"text.secondary",textAlign:"center"},children:[In.jsx(e,{id:"ZhEBp4",message:"Current liquidity pool token price"}),` 1 ${null==n?void 0:n.symbol} = ${a} ${null==o?void 0:o.symbol} ${le._({id:"wd1uHY",message:"differs from the price quoted by ZUNO by {lqAndDodoCompareText}",values:{lqAndDodoCompareText:t}})}`]})]})}function Hb({chainId:t,baseTokenStatus:n,quoteTokenStatus:o,children:r}){const{runningRequests:a}=Hd(),{account:s,chainId:l}=hd();if(!s||t!==l)return In.jsx(cx,{chainId:t,fullWidth:!0});const d=a.some((e=>{var t,n;return(null===(t=e.metadata)||void 0===t?void 0:t[Od.addLiquidity])||(null===(n=e.metadata)||void 0===n?void 0:n[Od.removeLiquidity])})),u=[];n.needShowTokenStatusButton&&u.push(In.jsx(bb,{status:n})),o.needShowTokenStatusButton&&!n.isApproving&&u.push(In.jsx(bb,{status:o}));const p=u.length;return 2===p?In.jsx(i,{sx:{display:"flex","& > button":{flex:1,"&:last-child":{ml:8}}},children:u.map((e=>e))}):1===p?u[0]:d?In.jsx(c,{fullWidth:!0,disabled:!0,isLoading:!0,children:In.jsx(e,{id:"UbRKMZ",message:"Pending"})}):In.jsx(In.Fragment,{children:r})}function Zb({pool:t,addPortion:n,midPrice:o,shareOfPool:r}){var s,d,c,u,p,h;const m=a(),[g,x]=$(!1);let y="";if(n&&o){const e=new Le(1).div(n.plus(1)),i=new Le(n).div(n.plus(1)),r=e.times(o),a=r.plus(i);y=n?`${Gs({input:r.div(a)})} ${null===(s=null==t?void 0:t.baseToken)||void 0===s?void 0:s.symbol} + ${Gs({input:i.div(a)})} ${null===(d=null==t?void 0:t.quoteToken)||void 0===d?void 0:d.symbol}`:""}const b=g?null===(c=null==t?void 0:t.quoteToken)||void 0===c?void 0:c.symbol:null===(u=null==t?void 0:t.baseToken)||void 0===u?void 0:u.symbol,j=g&&o?new Le(1).div(o):o,C=g?null===(p=null==t?void 0:t.baseToken)||void 0===p?void 0:p.symbol:null===(h=null==t?void 0:t.quoteToken)||void 0===h?void 0:h.symbol;return In.jsxs(i,{sx:{mt:20,border:"solid 1px",borderColor:"border.main",borderRadius:8},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,height:36,typography:"body2"},children:[In.jsx(i,{sx:{color:"text.secondary",whiteSpace:"nowrap"},children:In.jsx(e,{id:"kNeEXg",message:"Current Price"})}),In.jsxs(v,{sx:{display:"flex",alignItems:"center",fontWeight:600,ml:8,overflow:"hidden"},loading:!t,loadingProps:{width:50},children:[In.jsx(l,{title:`1 ${b} = ${j?_s({input:j}):""} ${C}`,children:o?In.jsx(i,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:`1 ${b} = ${j?_s({input:j}):""} ${C}`}):In.jsxs(i,{children:[`1 ${b} = `,In.jsx(v,{loading:!0,loadingProps:{width:30},component:"span",sx:{display:"inline-block"}}),` ${C}`]})}),In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"center",ml:4,width:18,height:18,cursor:"pointer",backgroundColor:"background.paperDarkContrast",borderRadius:"50%","&:hover":{backgroundColor:T(m.palette.text.primary,.04)}},onClick:()=>x((e=>!e)),children:In.jsx(i,{component:Un.Switch,sx:{width:18,height:18}})})]})]}),"AMMV2"===(null==t?void 0:t.type)?In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:m.spacing(1,0,0),borderColor:"border.main"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:In.jsx(e,{id:"NEQTCn",message:"Share Of Pool"})}),In.jsx(i,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:r})]}):In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:12,py:4,minHeight:36,typography:"body2",borderStyle:"solid",borderWidth:m.spacing(1,0,0),borderColor:"border.main"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:"text.secondary",whiteSpace:"nowrap"},children:[In.jsx(e,{id:"22Xs8M",message:"Deposit Ratio"}),In.jsx(f,{ml:4,title:In.jsx(e,{id:"I0yi1d",message:"Deposit ratio is determined by the current assets ratio in the pool. The ratio does not represent the exchange price"})})]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",fontWeight:600,textAlign:"right",ml:8,overflow:"hidden"},children:t&&me.utils.singleSideLp(t.type)?In.jsx(e,{id:"Kb3KaW",message:"Any Ratio"}):In.jsx(In.Fragment,{children:In.jsx(l,{title:y,children:In.jsx(i,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:y})})})})]})]})}function zb({baseToken:e,quoteToken:t}){const{toFiatPrice:n,fromFiatPrice:i}=$d({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 ${cd(t)} = ${_s({input:a.comparePrice,showDecimals:r})} ${cd(e)}`):(a.loading=!1,a.comparePrice=n.div(i),a.comparePriceText=`1 ${cd(e)} = ${_s({input:a.comparePrice,showDecimals:r})} ${cd(t)}`),a):a}({fromToken:e,toToken:t,fromFiatPrice:i?new Le(i):void 0,toFiatPrice:n?new Le(n):void 0})}const $b=(e,t,n)=>{const{comparePrice:i}=zb({baseToken:e,quoteToken:t}),o=Z((()=>{if(!(n&&i&&i.toNumber()&&n.toNumber()))return 0;const e=i.minus(n);return Math.abs(e.div(i).toNumber())}),[n,i]),r=Z((()=>`${zs(new Le(o).times(100))}%`),[o]);return{lqAndDodoCompare:o,lqAndDodoCompareText:r,midPrice:n,isShowCompare:o>.01,isWarnCompare:o>.03}};function Gb({pool:e,baseAmount:t,quoteAmount:n}){const[i,o,r,a,s,l]=H.useMemo((()=>{var t,n;const{baseToken:i,quoteToken:o}=e||{};let r=!1;if(!i||!o)return[void 0,void 0,void 0,void 0,void 0,r];const a=i.chainId,s=ve[a],l=(null===(t=s.address)||void 0===t?void 0:t.toLowerCase())===i.address.toLowerCase(),d=(null===(n=s.address)||void 0===n?void 0:n.toLowerCase())===o.address.toLowerCase(),c=l?s.wrappedTokenAddress:i.address,u=d?s.wrappedTokenAddress:o.address,p=new rn(i.chainId,c,i.decimals,i.symbol,i.name),h=new rn(o.chainId,u,o.decimals,o.symbol,o.name);r=!p.sortsBefore(h);const[m,g]=r?[h,p]:[p,h];return[a,null==e?void 0:e.type,null==e?void 0:e.address,m,g,r]}),[e]),d=Ql.getReserveLpQuery(i,r,o,null==a?void 0:a.decimals,null==s?void 0:s.decimals),c="AMMV2"===o,u=Qe(Object.assign(Object.assign({},d),{enabled:!!d.enabled&&c})),p=Ql.getTotalBaseLpQuery(i,r,o,18),h=Qe(Object.assign(Object.assign({},p),{enabled:!!p.enabled&&c})),{account:m}=hd(),g=Ql.getUserBaseLpQuery(i,r,o,18,m),f=Qe(Object.assign(Object.assign({},g),{enabled:!!g.enabled&&c})),x=H.useMemo((()=>u.isFetched&&!!u.data&&h.isFetched&&!!h.data),[u.isFetched,u.data,h.isFetched,h.data]),[y,v]=H.useMemo((()=>{var e;if(!a||!s||!1===x)return[null,null];const{baseReserve:t,quoteReserve:n}=null!==(e=u.data)&&void 0!==e?e:{baseReserve:0,quoteReserve:0},i=an.fromRawAmount(a,Fs(t,a.decimals).toString()),o=an.fromRawAmount(s,Fs(n,s.decimals).toString());let r=i,d=o;l&&(r=o,d=i);const c=new dn(r,d);if(r.equalTo(0)||d.equalTo(0))return[c,null];const p=d.divide(r);return[c,new sn(r.currency,d.currency,p.denominator,p.numerator)]}),[a,s,u.data,l]),[b,j]=H.useMemo((()=>x?v?[new Le(v.toSignificant()),new Le(v.invert().toSignificant())]:[void 0,void 0]:t&&n?[new Le(n).div(t),new Le(t).div(n)]:[void 0,void 0]),[v,x,t,n]),C=h.data,w=x?h.data&&a?Fs(h.data,18).toString():"":"0";let k,T;const E=l?s:a,A=l?a:s;if((null==y?void 0:y.liquidityToken)&&w&&C&&E&&A){const e=an.fromRawAmount(null==y?void 0:y.liquidityToken,w);if(void 0!==t&&void 0!==n){if(Number(t)&&Number(n)){const i=an.fromRawAmount(E,Fs(t,E.decimals).toString()),o=an.fromRawAmount(A,Fs(n,A.decimals).toString()),r=null==y?void 0:y.getLiquidityMinted(e,i,o);T=Us(r.quotient.toString(),18),k=T.div(C.plus(T)).times(100)}}else T=f.data||void 0,T&&(k=T.div(C).times(100))}else x||(k=new Le(100));let I="-";return(null==e?void 0:e.baseToken)&&e.quoteToken&&(I=k?`${_s({input:k,showDecimals:2,roundingMode:Le.ROUND_HALF_UP})}%`:"0%"),{isRearTokenA:l,pair:y,price:b,invertedPrice:j,reserveQuery:u,totalBaseLpQuery:h,liquidityMinted:T,poolTokenPercentage:k,shareOfPool:I,isExists:x}}function Yb({pool:e,maxBaseAmount:t,maxQuoteAmount:n,isRemove:i}){var o,r,a;const[s,l]=H.useState(""),[d,c]=H.useState(""),u=!e||"AMMV2"!==e.type&&"AMMV3"!==e.type,p=Qe(Ql.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,null===(r=null==e?void 0:e.quoteToken)||void 0===r?void 0:r.decimals)),h=()=>{l(""),c("")},m=null==e?void 0:e.type,g=Gb({pool:e,baseAmount:s,quoteAmount:d});let f=null===(a=p.data)||void 0===a?void 0:a.midPrice,x=new Le(NaN),y=!1,v=!1;const b=p.data;if(e)if(b){const t=b.pmmParamsBG.i,n=b.pmmParamsBG.b,i=b.pmmParamsBG.q;v=("DSP"===e.type||"GSP"===e.type)&&(i.eq(0)||n.eq(0)),y="DVM"===e.type&&new Le(i).eq(0),x=v?t:y?Le(1):i.div(n)}else"AMMV2"===m&&(f=g.isRearTokenA?g.invertedPrice:g.price,x=f||new Le(1));const j=H.useRef(x);if(!e||x.isNaN())return{baseAmount:s,quoteAmount:d,handleChangeBaseAmount:()=>{},handleChangeQuoteAmount:()=>{},reset:h};const C=!y&&!me.utils.singleSideLp(e.type),w=e.baseToken.decimals,k=e.quoteToken.decimals,T=e=>{if(e){let o=x.multipliedBy(e).dp(k).toString();n&&i&&(n.lte(o)||(null==t?void 0:t.lte(0)))&&(o=n.toString()),c(o)}else c(e)};!C||j.current&&x.isEqualTo(j.current)||(j.current=x,T(s));let E=!1;E=!!e&&me.utils.singleSideLp(e.type)?!s&&!d:y?!s:!s||!d;const A=u?p:g.reserveQuery;return{baseAmount:s,quoteAmount:d,handleChangeBaseAmount:e=>{let t=Ns(e,w);null===t&&(t=s),l(t),C&&T(t)},handleChangeQuoteAmount:e=>{let o=Ns(e,k);null===o&&(o=d),c(o),C&&(e=>{if(e){let o=new Le(e).div(x).dp(w).toString();t&&i&&(t.lte(o)||(null==n?void 0:n.lte(0)))&&(o=t.toString()),l(o)}else l(e)})(o)},reset:h,addPortion:x,amountLoading:A.isLoading,amountError:A.isError,amountRefetch:A.refetch,amountCheckedDisabled:E,midPrice:f,uniV2Pair:g}}function Qb({submittedBack:e,onlyShowSide:t,pool:n,balanceInfo:o}){var r,s,l,d,u,p;const h=a(),{isMobile:m}=Sd(),{account:g}=hd(),{baseAmount:f,quoteAmount:x,handleChangeBaseAmount:y,handleChangeQuoteAmount:b,addPortion:j,midPrice:C,amountLoading:w,amountCheckedDisabled:k,uniV2Pair:T,reset:E}=Yb({pool:n}),A=Qe(Ql.getFeeRateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,g)),I=null===(u=null===(s=null===(r=A.data)||void 0===r?void 0:r.mtFeeRate)||void 0===s?void 0:s.plus(null!==(d=null===(l=A.data)||void 0===l?void 0:l.lpFeeRate)&&void 0!==d?d:0))||void 0===u?void 0:u.toNumber(),S="AMMV2"===(null==n?void 0:n.type),[L,O]=H.useState(!1),{slipper:R,setSlipper:M,slipperValue:_,resetSlipper:P}=ox({address:null==n?void 0:n.address,type:null==n?void 0:n.type}),B=wx(n);H.useEffect((()=>{(null==n?void 0:n.address)!==(null==B?void 0:B.address)&&(E(),P())}),[n]);const D=me.utils.canOperateLiquidity(null==n?void 0:n.type,void 0,null==n?void 0:n.creator,g),[N,F]=H.useState(!1),{isShowCompare:U,lqAndDodoCompareText:q,isWarnCompare:V}=$b(null==n?void 0:n.baseToken,null==n?void 0:n.quoteToken,C),W=S&&n.chainId?rt(n.chainId)||ct(n.chainId):void 0,Z=cc(null==n?void 0:n.baseToken,{amount:f,contractAddress:W}),z=cc(null==n?void 0:n.quoteToken,{amount:x,contractAddress:W}),$=Z.insufficientBalance||z.insufficientBalance,{isSinglePool:G}=o,Y=!n||$||!C||!!o.loading||!!o.error||k||A.isLoading;let Q=S?le._({id:"bwSQI0",message:"Supply"}):le._({id:"m16xKo",message:"Add"});$&&(Q=le._({id:"znqB4T",message:"Insufficient balance"}));const X=()=>{E(),P(),e&&e()},{operateLiquidityMutation:K}=qb(n),J=()=>{S?O(!0):K.mutate({txTitle:le._({id:"OBdohg",message:"Add Liquidity"}),isRemove:!1,baseAmount:f,quoteAmount:x,slippageProtection:_,balanceInfo:o,SLIPPAGE_PROTECTION:ix,submittedBack:X})},ee=Vb({baseToken:null==n?void 0:n.baseToken,quoteToken:null==n?void 0:n.quoteToken,baseAmount:f,quoteAmount:x,fee:I,isExists:!0,slippage:_,submittedBack:()=>{X(),O(!1)}});return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pt:20,pb:18,px:20},children:["quote"===t?"":In.jsx(og,{amt:f,token:null==n?void 0:n.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:y,readOnly:o.loading||!D,sx:{backgroundColor:"background.cardInput",padding:h.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"}}),t?"":In.jsx(ng,{}),"base"===t?"":In.jsx(og,{amt:x,token:null==n?void 0:n.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:b,readOnly:o.loading||!D||G,sx:{backgroundColor:"background.cardInput",padding:h.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"}}),In.jsxs(v,{loading:o.loading||w,sx:{mt:8},children:[In.jsx(rx,{value:R,onChange:M,disabled:!D,type:null==n?void 0:n.type}),In.jsx(Zb,{pool:n,addPortion:j,midPrice:C,shareOfPool:null==T?void 0:T.shareOfPool})]})]}),In.jsxs(i,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[U&&In.jsx(Wb,{baseToken:null==n?void 0:n.baseToken,quoteToken:null==n?void 0:n.quoteToken,lqAndDodoCompareText:q,midPrice:C}),n?In.jsx(Hb,{chainId:n.chainId,baseTokenStatus:Z,quoteTokenStatus:z,children:In.jsx(c,{fullWidth:!0,disabled:Y,danger:V,isLoading:K.isPending||ee.isPending,onClick:()=>{Y||(V?F(!0):J())},children:Q})}):In.jsx(c,{fullWidth:!0,disabled:!0,children:Q})]}),In.jsx(Rb,{open:N,onClose:()=>F(!1),title:le._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:J,modal:!0,children:In.jsxs(i,{children:[In.jsx(i,{children:le._({id:"tecieV",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on ZUNO.",values:{lqAndDodoCompareText:q}})}),In.jsx(i,{children:le._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),In.jsx(am,{message:null===(p=K.error)||void 0===p?void 0:p.message,onClose:()=>K.reset(),isDialogModal:m}),S&&!!n&&In.jsx(Bb,{open:L,onClose:()=>O(!1),slippage:_,baseToken:n.baseToken,baseAmount:f,quoteToken:n.quoteToken,quoteAmount:x,fee:I,price:null==T?void 0:T.price,lpAmount:null==T?void 0:T.liquidityMinted,shareOfPool:null==T?void 0:T.shareOfPool,pairAddress:n.address,createMutation:ee})]})}function Xb({chainId:e,address:t,token:n,quoteToken:o,lpBalance:a,lpBalanceLoading:s,balanceNeedUpdateLoading:d,tokenBalanceList:c}){var u;const p=o?`${null==n?void 0:n.symbol}/${o.symbol}`:null!==(u=null==n?void 0:n.symbol)&&void 0!==u?u:"";return In.jsxs(i,{sx:{display:"flex"},children:[n?In.jsx(i,{sx:{position:"relative",top:2},children:o?In.jsx(gg,{tokens:[n,o],chainId:e,width:18,mr:4}):In.jsx(Fc,{address:n.address,width:18,height:18,chainId:e,url:n.logoURI,marginRight:4,noShowChain:!0})}):In.jsx(j,{width:32,height:32,sx:{mr:4}}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",wordBreak:"break-all"},children:[In.jsx(v,{loading:s,loadingProps:{width:30},sx:{display:"flex",alignItems:"center",mr:2},children:d?In.jsx(O,{}):_s({input:a||"-"})}),`${p} LP`,!!(null==c?void 0:c.length)&&In.jsx(l,{title:In.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:c.map((e=>In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",fontWeight:600,color:"text.primary"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{address:e.token.address,chainId:e.token.chainId,width:14,height:14,url:e.token.logoURI,marginRight:4,noShowChain:!0}),e.token.symbol]}),In.jsxs(v,{loading:e.loading,children:[!e.balance||e.balance.isZero()||e.balance.isNaN()?"":"~",e.balance?_s({input:e.balance}):""]})]},e.token.address)))}),sx:{padding:20,width:256},children:In.jsx(r,{component:Un.DetailBorder,sx:{ml:4,width:16,height:16}})}),In.jsx(i,{component:"a",target:"_blank",rel:"noopener noreferrer",href:e?ad(e,t,"address"):"",sx:{display:"inline-flex",height:14},children:In.jsx(r,{component:Un.ArrowTopRightBorder,sx:{ml:4,width:14,height:14}})})]})]},t)}function Kb({loading:t,hidePoolInfo:n,pool:o,balanceInfo:r}){var s,c,u,p,h,m,g;const f=a(),x=t||!o,y=!!o&&me.utils.singleSideLp(o.type),{isTokenLoading:b}=Lm(),{account:j}=hd(),C=Qe(Ql.getFeeRateQuery(null==o?void 0:o.chainId,null==o?void 0:o.address,null==o?void 0:o.type,j)),w=null===(c=null===(s=C.data)||void 0===s?void 0:s.lpFeeRate)||void 0===c?void 0:c.plus(null!==(p=null===(u=C.data)||void 0===u?void 0:u.mtFeeRate)&&void 0!==p?p:0);let k=!1,T=!1;o&&(r.userBaseLpBalance&&o.baseLpToken&&(k=b(o.baseLpToken.id,r.userBaseLpBalance)),r.userQuoteLpBalance&&o.quoteLpToken&&(T=b(o.quoteLpToken.id,r.userQuoteLpBalance)));const E="AMMV2"===(null==o?void 0:o.type);return In.jsxs(i,{sx:{mt:16,mx:20,border:"solid 1px",borderColor:"border.main",borderRadius:12},children:[n?"":In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:f.spacing(12,20),borderStyle:"solid",borderColor:"border.main",borderWidth:f.spacing(0,0,1)},children:[In.jsxs(i,{children:[In.jsxs(v,{loading:x,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)&&In.jsx(v,{loading:C.isLoading,loadingProps:{width:30},sx:{typography:"h6"},children:In.jsx(l,{title:In.jsxs(i,{sx:{typography:"h6","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",In.jsx("b",{children:In.jsx(e,{id:"e38JNU",message:"Tips:"})})," ",In.jsx(e,{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:Gs({input:w})},components:{0:In.jsx("b",{})}})]}),sx:{maxWidth:240},children:In.jsx(i,{sx:{px:8,height:24,typography:"h6",lineHeight:"24px",borderRadius:4,background:f.palette.background.tag,color:"text.secondary",whiteSpace:"nowrap"},children:Gs({input:w})})})})]}),In.jsx(v,{loading:x,children:In.jsx(qm,{address:null!==(g=null==o?void 0:o.address)&&void 0!==g?g:"",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)&&!E?In.jsxs(i,{component:d,sx:{typography:"body2",display:"flex",alignItems:"center",color:"text.secondary"},onClick:()=>{Gf.getState().push({type:$f.PoolDetail,params:{chainId:o.chainId,address:o.address}})},children:[In.jsx(e,{id:"URmyfc",message:"Details"}),In.jsx(i,{component:Un.ArrowRight,sx:{ml:4,position:"relative",top:1.2,width:16,height:16}})]}):""]}),In.jsxs(i,{sx:{p:f.spacing(12,20)},children:[In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),In.jsx(i,{sx:{mt:12},children:In.jsx(v,{loading:x,loadingSx:{width:100},children:y?In.jsxs(In.Fragment,{children:[In.jsx(Xb,{chainId:null==o?void 0:o.chainId,address:null==o?void 0:o.address,token:null==o?void 0:o.baseToken,lpBalance:null==r?void 0:r.userBaseLpBalance,lpBalanceLoading:r.userLpBalanceLoading,balanceNeedUpdateLoading:k,tokenBalanceList:o?[{token:o.baseToken,balance:null==r?void 0:r.userBaseLpToTokenBalance,loading:r.userLpToTokenBalanceLoading}]:void 0}),In.jsx(Xb,{chainId:null==o?void 0:o.chainId,address:null==o?void 0:o.address,token:null==o?void 0:o.quoteToken,lpBalance:null==r?void 0:r.userQuoteLpBalance,lpBalanceLoading:r.userLpBalanceLoading,balanceNeedUpdateLoading:T,tokenBalanceList:o?[{token:o.quoteToken,balance:null==r?void 0:r.userQuoteLpToTokenBalance,loading:r.userLpToTokenBalanceLoading}]:void 0})]}):In.jsx(Xb,{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:r.userBaseLpBalance,lpBalanceLoading:r.userLpBalanceLoading,balanceNeedUpdateLoading:k,tokenBalanceList:o?[{token:o.baseToken,balance:r.userBaseLpToTokenBalance||new Le(0),loading:r.userLpToTokenBalanceLoading},{token:o.quoteToken,balance:r.userQuoteLpToTokenBalance||new Le(0),loading:r.userLpToTokenBalanceLoading}]:void 0})})})]})]})}const Jb=({pool:e,isBase:t,baseAmount:n,quoteAmount:i})=>{var o,r;const a="CLASSICAL"===(null==e?void 0:e.type),s=t||void 0===t,l=null===(o=null==e?void 0:e.baseToken)||void 0===o?void 0:o.decimals,d=null===(r=null==e?void 0:e.quoteToken)||void 0===r?void 0:r.decimals,c=Qe(Object.assign(Object.assign({},Ql.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,n&&void 0!==l?Lt(new Le(n).dp(l,Le.ROUND_FLOOR).toString(),l).toString():"",l)),{enabled:!!e&&!!n&&a&&s})),u=Qe(Object.assign(Object.assign({},Ql.getWithdrawBasePenaltyQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,i&&void 0!==d?Lt(new Le(i).dp(d,Le.ROUND_FLOOR).toString(),d).toString():"",d)),{enabled:!!e&&!!i&&a&&!s}));let p,h="",m="",g="",f="",x="",y=!1,v=null;if(e){const t=ud(e.baseToken.decimals),o=ud(e.quoteToken.decimals);if(g=_s({input:n,showDecimals:t}),f=_s({input:i,showDecimals:o}),a)if(y=s?c.isLoading:u.isLoading,v=s?c.error:u.error,s){if(c.data){h=_s({input:c.data,showDecimals:t}),x=h;const e=new Le(n).minus(c.data);g=e.gt(0)?_s({input:e,showDecimals:t}):"-",p=e}}else if(u.data){m=_s({input:u.data,showDecimals:o}),x=m;const e=new Le(i).minus(u.data);g=e.gt(0)?_s({input:e,showDecimals:t}):"-",p=e}}let b=[];return e&&(a?t?b.push({amount:g||"0",symbol:e.baseToken.symbol}):b.push({amount:f||"0",symbol:e.quoteToken.symbol}):(b.push({amount:g||"0",symbol:e.baseToken.symbol}),b.push({amount:f||"0",symbol:e.quoteToken.symbol}))),{withdrawFee:x,baseWithdrawFee:h,quoteWithdrawFee:m,receiveBaseAmount:g,receiveQuoteAmount:f,receiveAmountBg:p,receiveList:b,loading:y,error:v}};var ej;!function(e){e[e.base=1]="base",e[e.quote=2]="quote"}(ej||(ej={}));const tj=e=>{const[t,n]=H.useState(ej.base);let i,o;return e&&me.utils.singleSideLp(e.type)&&(i=t===ej.base,o=i?e.baseToken:e.quoteToken),{isBase:i,checkToken:o,checkTokenType:t,setCheckToken:n}};function nj({token:e,pool:t,sx:n,value:o,onChange:r,selectedValue:a,lpBalance:s,balanceMax:l,balanceInfo:d,loading:c}){var u;const p=null==t?void 0:t.chainId;return In.jsxs(i,{sx:n,children:[In.jsxs(i,{sx:{typography:"h5",display:"flex",alignItems:"center",justifyContent:"space-between",fontWeight:600},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[e?In.jsx(U,{checked:o===a,onChange:()=>r(o),sx:{mr:16}}):"",In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:e?In.jsx(In.Fragment,{children:In.jsx(Fc,{address:e.address,width:24,height:24,chainId:e.chainId||p,url:e.logoURI,noShowChain:!0})}):t&&In.jsx(gg,{tokens:[t.baseToken,t.quoteToken],chainId:(null===(u=t.baseToken)||void 0===u?void 0:u.chainId)||p,width:24,height:24})})]}),In.jsxs(i,{sx:{textAlign:"right"},children:[e?`${e.symbol} LP `:t&&`${t.baseToken.symbol}\n ${t.quoteToken.symbol}\n LP `,c?In.jsx(i,{component:O,sx:{ml:4,position:"relative",top:3}}):s&&_s({input:s})||""]})]}),In.jsx(i,{sx:{typography:"body2",mt:5,color:"text.secondary",textAlign:"right"},children:e?In.jsxs(In.Fragment,{children:[c?In.jsx(i,{component:O,sx:{ml:4,position:"relative",top:3}}):`≈ ${l&&_s({input:l})||""}`,` ${e.symbol}`]}):t&&d&&d.userBaseLpToTokenBalance&&d.userQuoteLpToTokenBalance?In.jsxs(In.Fragment,{children:[c?In.jsx(i,{component:O,sx:{position:"relative",top:4}}):_s({input:d.userBaseLpToTokenBalance}),` ${null==t?void 0:t.baseToken.symbol} + `,c?In.jsx(i,{component:O,sx:{position:"relative",top:4}}):_s({input:d.userQuoteLpToTokenBalance}),` ${null==t?void 0:t.quoteToken.symbol}`]}):""})]})}function ij({pool:e,checkTokenType:t,setCheckToken:n,balanceInfo:i,baseTokenBalanceUpdateLoading:o,quoteBalanceUpdateLoading:r}){if(!e)return null;const a=me.utils.singleSideLp(e.type);return In.jsx(In.Fragment,{children:a?In.jsxs(In.Fragment,{children:[In.jsx(nj,{token:e.baseToken,selectedValue:t,onChange:n,value:ej.base,lpBalance:i&&i.userBaseLpBalance,balanceMax:i&&i.userBaseLpToTokenBalance,loading:o}),In.jsx(nj,{selectedValue:t,onChange:n,sx:{mt:13},token:e.quoteToken,value:ej.quote,lpBalance:i&&i.userQuoteLpBalance,balanceMax:i&&i.userQuoteLpToTokenBalance,loading:r})]}):In.jsx(nj,{pool:e,value:t,onChange:n,lpBalance:i&&i.userBaseLpBalance,balanceInfo:i,loading:o||r})})}function oj({submittedBack:n,onlyShowSide:o,pool:r,balanceInfo:s}){var l,d,u,p,h,m,g,f,x,y;const b=a(),{isMobile:j}=Sd(),{account:C}=hd(),w=s.userBaseLpToTokenBalance,k=s.userQuoteLpToTokenBalance,T=s.loading,{slipper:E,setSlipper:A,slipperValue:I,resetSlipper:S}=ox({address:null==r?void 0:r.address}),{isBase:L,checkToken:O,checkTokenType:R,setCheckToken:M}=tj(r),{baseAmount:_,quoteAmount:P,handleChangeBaseAmount:B,handleChangeQuoteAmount:D,addPortion:N,midPrice:F,amountLoading:U,amountCheckedDisabled:V,uniV2Pair:W,reset:z}=Yb({pool:r,maxBaseAmount:w,maxQuoteAmount:k}),[$,G]=H.useState(""),[Y,Q]=H.useState("");H.useEffect((()=>{const e=setTimeout((()=>{G(_)}),80);return()=>clearTimeout(e)}),[_]),H.useEffect((()=>{const e=setTimeout((()=>{Q(P)}),80);return()=>clearTimeout(e)}),[P]);const X=e=>{B(e)},K=e=>{D(e)},J="AMMV2"===(null==r?void 0:r.type),ee=(null==r?void 0:r.chainId)?ve[r.chainId]:void 0,te=null===(l=null==ee?void 0:ee.address)||void 0===l?void 0:l.toLowerCase(),ne=null===(d=null==ee?void 0:ee.wrappedTokenAddress)||void 0===d?void 0:d.toLowerCase(),ie=!!r&&[te,ne].includes(r.baseToken.address.toLowerCase()),oe=!!r&&[te,ne].includes(r.quoteToken.address.toLowerCase()),re=J&&r&&(ie||oe),[ae,se]=H.useState(!1),de=re&&ie&&!ae&&ee?r?Object.assign(Object.assign({},r.baseToken),{symbol:ee.symbol,address:ee.address}):void 0:null==r?void 0:r.baseToken,ce=re&&oe&&!ae&&ee?r?Object.assign(Object.assign({},r.quoteToken),{symbol:ee.symbol,address:ee.address}):void 0:null==r?void 0:r.quoteToken,ue=Jb({pool:r?Object.assign(Object.assign({},r),{baseToken:de,quoteToken:ce}):r,isBase:L,baseAmount:$,quoteAmount:Y}),{mode:pe,modeOptions:he,handleChangeMode:ge,sliderPercentage:fe,handleChangeSliderPercentage:xe,resetPercentage:ye}=function({isBase:e,pool:t,baseOverride:n,quoteOverride:i,resetAmount:o,handleChangeBaseAmount:r,handleChangeQuoteAmount:a}){const[s,l]=H.useState(sx.percentage),[d,c]=H.useState(ax),u=H.useRef(null),p=()=>{u.current&&clearTimeout(u.current)},h=()=>{p(),c(ax)};return H.useEffect((()=>p),[]),{mode:s,modeOptions:[{key:sx.quantity,value:le._({id:"PIYEqF",message:"Quantity model"})},{key:sx.percentage,value:le._({id:"x4QVeW",message:"Percentage to remove"})}],handleChangeMode:e=>{l(e),o(),h()},sliderPercentage:d,handleChangeSliderPercentage:o=>{if(p(),o!==d&&c(o),!t)return;const s=100===o,l=()=>{if(t)if(e||void 0===e){if(n){let e=n.toString();s||(e=Ds(n.times(o/100),t.baseToken.decimals)),r(e)}}else if(i){let e=i.toString();s||(e=Ds(i.times(o/100),t.quoteToken.decimals)),a(e)}};s?l():u.current=setTimeout(l,100)},resetPercentage:h}}({isBase:L,pool:r,baseOverride:w,quoteOverride:k,resetAmount:z,handleChangeBaseAmount:X,handleChangeQuoteAmount:K});H.useEffect((()=>{z(),ye()}),[R]);const be=wx(r);H.useEffect((()=>{(null==r?void 0:r.address)!==(null==be?void 0:be.address)&&(z(),S(),ge(sx.percentage),xe(ax))}),[r]),H.useEffect((()=>{pe===sx.percentage&&xe(fe)}),[null==w?void 0:w.toString(),null==k?void 0:k.toString()]);const Ce=me.utils.canOperateLiquidity(null==r?void 0:r.type,void 0,null==r?void 0:r.creator,C),[we,ke]=H.useState(!1),{isShowCompare:Te,lqAndDodoCompareText:Ee,isWarnCompare:Ae}=$b(null==r?void 0:r.baseToken,null==r?void 0:r.quoteToken,F),Ie=Qe(Ql.getFeeRateQuery(null==r?void 0:r.chainId,null==r?void 0:r.address,null==r?void 0:r.type,C)),Se=null===(g=null===(p=null===(u=Ie.data)||void 0===u?void 0:u.mtFeeRate)||void 0===p?void 0:p.plus(null!==(m=null===(h=Ie.data)||void 0===h?void 0:h.lpFeeRate)&&void 0!==m?m:0))||void 0===g?void 0:g.toNumber(),{baseTokenStatus:Oe,quoteTokenStatus:Re}=function({pool:e,baseAmount:t,quoteAmount:n,balanceInfo:i}){var o,r,a,s,l;const{chainId:d,baseToken:c,quoteToken:u}=null!=e?e:{};let p="";const h="AMMV2"===(null==e?void 0:e.type);d&&(p=null!==(o=je[d].DODO_V1_PAIR_PROXY)&&void 0!==o?o:"",h&&(p=rt(d)||ct(e.chainId)));const m=null!==(a=null===(r=null==e?void 0:e.baseLpToken)||void 0===r?void 0:r.id)&&void 0!==a?a:"",g=null!==(l=null===(s=null==e?void 0:e.quoteLpToken)||void 0===s?void 0:s.id)&&void 0!==l?l:"",f="CLASSICAL"===(null==e?void 0:e.type);return{baseTokenStatus:cc(c?Object.assign(Object.assign({},c),{symbol:f?c.symbol+" LP":`${c.symbol}/${null==u?void 0:u.symbol} LP`,address:m}):void 0,{amount:h&&i.userBaseLpToTokenBalance&&i.userBaseLpBalance?new Le(t).div(i.userBaseLpToTokenBalance).times(i.userBaseLpBalance).toString():t,skipQuery:!p||!m||!f&&!h,contractAddress:p,overrideBalance:h?i.userBaseLpBalance:i.userBaseLpToTokenBalance}),quoteTokenStatus:cc(u?Object.assign(Object.assign({},u),{address:g}):void 0,{amount:n,skipQuery:!p||!g||!f,contractAddress:p,overrideBalance:i.userQuoteLpToTokenBalance})}}({pool:r,baseAmount:_,quoteAmount:P,balanceInfo:s}),Me=Oe.insufficientBalance||Re.insufficientBalance,{isSinglePool:_e}=s,Pe=Me?le._({id:"znqB4T",message:"Insufficient balance"}):le._({id:"t/YqKh",message:"Remove"}),Be=()=>{z(),S(),n&&n()},De=null===(f=null==W?void 0:W.pair)||void 0===f?void 0:f.liquidityToken.decimals,Ne=null===(x=s.userBaseLpBalance)||void 0===x?void 0:x.times(fe/100),Fe=Ne&&void 0!==De?Fs(Ne,De).toString():"",{operateLiquidityMutation:Ue}=qb(r),qe=function({baseToken:e,quoteToken:n,baseAmount:i,quoteAmount:o,liquidityAmount:r,slippage:a,fee:s,submittedBack:l}){const d=Wd(),{account:c}=hd();t();const{deadLine:u}=On();return Je({mutationFn:()=>bn(this,void 0,void 0,(function*(){if(!e||!n)throw new Error("token is undefined");if(!c)throw new Error("account is undefined");if(!s)throw new Error("fee is undefined");const t=e.chainId,p=ve[t].address.toLowerCase(),h=rt(t),m=ct(t),g=!h,f=h||m;if(!f)throw new Error("AMMV2 contract address is not valid.");let x="";const y=e.address.toLowerCase()===p,v=n.address.toLowerCase()===p,b=Fs(new Le(i).times(1-a),e.decimals),j=Fs(new Le(o).times(1-a),n.decimals),C=Fs(s,4).toString(),w=Math.ceil(Date.now()/1e3)+(null!=u?u:600);try{if(y){const e=n.address,t=j.toString(),i=b.toString();x=g?gt(e,r,t,i,c,w):ft(e,C,r,t,i,c,w)}else if(v){const t=e.address,n=b.toString(),i=j.toString();x=g?gt(t,r,n,i,c,w):ft(t,C,r,n,i,c,w)}else x=g?xt(e.address,n.address,r,b.toString(),j.toString(),c,w):yt(e.address,n.address,C,r,b.toString(),j.toString(),c,w)}catch(e){throw console.error("encodeUniswapV2Router02RemoveLiquidity error",e),e}return yield d.execute(le._({id:"cJtosk",message:"Remove liquidity"}),{opcode:Dd.TX,to:f,data:x,value:"0x0"},{metadata:{[Od.removeLiqidityAMMV2Position]:!0},submittedBack:l})}))})}({baseToken:de,quoteToken:ce,baseAmount:_,quoteAmount:P,liquidityAmount:Fe,slippage:I,fee:Se,submittedBack:Be}),Ve=()=>{if(J)return qe.mutate();Ue.mutate({txTitle:le._({id:"3XBvkd",message:"Remove Liquidity"}),isRemove:!0,baseAmount:_,quoteAmount:P,slippageProtection:I,balanceInfo:s,SLIPPAGE_PROTECTION:ix,submittedBack:Be})},We=Z((()=>{var e;const t=new Le(_),n=new Le(P);return!r||Me||!F||!!s.loading||!!s.error||V||!!ue.error||ue.loading||!!(null===(e=ue.receiveAmountBg)||void 0===e?void 0:e.lte(0))||Ie.isLoading||(J?null==Ne||Ne.lte(0):!t.isFinite()||!n.isFinite()||t.lte(0)&&n.lte(0))}),[V,s.error,s.loading,_,Ie.isLoading,J,Me,Ne,F,r,P,ue.error,ue.loading,ue.receiveAmountBg]);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pb:18,px:20},children:[!J&&In.jsxs(i,{sx:{mt:20,borderStyle:"solid",borderWidth:1,borderRadius:12,borderColor:"border.main"},children:[In.jsx(q,{value:pe,options:he,onChange:(e,t)=>ge(t),popupOffset:0,sx:{px:20,py:12,width:"100%",backgroundColor:"transparent",color:"text.primary",typography:"body2"}}),!!r&&me.utils.singleSideLp(r.type)&&In.jsx(i,{sx:{pt:20,pb:13,px:20,borderStyle:"solid",borderWidth:"1px 0 0"},children:In.jsx(ij,{pool:r,balanceInfo:s,checkTokenType:R,setCheckToken:M,baseTokenBalanceUpdateLoading:!1,quoteBalanceUpdateLoading:!1})})]}),In.jsx(i,{sx:{pt:20},children:pe===sx.percentage?In.jsx(Xf,{disabled:s.loading||!Ce,value:fe,onChange:xe}):O?In.jsx(og,{amt:L?_:P,token:O,canClickBalance:!0,showPercentage:!0,onInputChange:L?X:K,readOnly:s.loading||!Ce,overrideBalance:L?w:k,overrideBalanceLoading:T,sx:{backgroundColor:"background.cardInput",padding:b.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"}}):In.jsxs(In.Fragment,{children:[In.jsx(og,{amt:_,token:null==r?void 0:r.baseToken,canClickBalance:!0,showPercentage:!0,onInputChange:X,readOnly:s.loading||!Ce,overrideBalance:w,overrideBalanceLoading:T,sx:{backgroundColor:"background.cardInput",padding:b.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"}}),o?"":In.jsx(ng,{}),"base"===o?"":In.jsx(og,{amt:P,token:null==r?void 0:r.quoteToken,canClickBalance:!0,showPercentage:!0,onInputChange:K,readOnly:s.loading||!Ce||_e,overrideBalance:k,overrideBalanceLoading:T,sx:{backgroundColor:"background.cardInput",padding:b.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"}})]})}),In.jsxs(v,{loading:s.loading||U,sx:{mt:8},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"flex-end",gap:8},children:[J&&re&&In.jsx(i,{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:()=>se((e=>!e)),children:In.jsx(e,{id:"/k7Ttv",message:"Receive {0}",values:{0:ae?null==ee?void 0:ee.symbol:null==ee?void 0:ee.wrappedTokenSymbol}})}),In.jsx(rx,{value:E,onChange:A,disabled:!Ce,type:null==r?void 0:r.type,sx:{margin:0}})]}),In.jsx(Zb,{pool:r,addPortion:N,midPrice:F,shareOfPool:null==W?void 0:W.shareOfPool})]}),!!r&&In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",mt:20,mb:14},children:[In.jsx(i,{sx:{typography:"body2",color:"text.secondary",position:"relative",top:2},children:In.jsx(e,{id:"lDgVWA",message:"Receive"})}),In.jsx(i,{sx:{textAlign:"right"},children:ue.receiveList.map(((e,t)=>In.jsxs(i,{sx:{mt:t>0?4:0},children:[In.jsxs(v,{component:"span",loading:ue.loading,loadingSx:{mr:8,width:100},sx:{display:"inline-block",typography:"h5",fontWeight:600,color:ue.receiveBaseAmount&&"0"!==ue.receiveBaseAmount?"primary.main":"text.primary"},children:[e.amount," "]}),In.jsx(i,{component:"span",sx:{typography:"body2"},children:e.symbol})]},e.symbol)))})]})]}),In.jsxs(i,{sx:{px:20,py:16,position:"sticky",bottom:0,borderStyle:"solid",borderWidth:"1px 0 0",borderColor:"border.main",backgroundColor:"background.paper"},children:[Te&&In.jsx(Wb,{baseToken:null==r?void 0:r.baseToken,quoteToken:null==r?void 0:r.quoteToken,lqAndDodoCompareText:Ee,midPrice:F}),r?In.jsx(Hb,{chainId:r.chainId,baseTokenStatus:Oe,quoteTokenStatus:Re,children:In.jsx(c,{fullWidth:!0,disabled:We,danger:Ae,isLoading:Ue.isPending||qe.isPending,onClick:()=>{We||(Ae?ke(!0):Ve())},children:Pe})}):In.jsx(c,{fullWidth:!0,disabled:!0,children:Pe})]}),In.jsx(Rb,{open:we,onClose:()=>ke(!1),title:le._({id:"bEsfUQ",message:"Confirm submission"}),onConfirm:Ve,modal:!0,children:In.jsxs(i,{children:[In.jsx(i,{children:le._({id:"tecieV",message:"Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on ZUNO.",values:{lqAndDodoCompareText:Ee}})}),In.jsx(i,{children:le._({id:"vXvgFK",message:"There is risk of being arbitraged if adding this liquidity."})})]})}),In.jsx(am,{message:null===(y=Ue.error)||void 0===y?void 0:y.message,onClose:()=>Ue.reset(),isDialogModal:j})]})}function rj({pool:e,operate:n,hidePoolInfo:i,errorRefetch:o,submittedBack:r}){var a,s,l,d,c,u;const{operateTab:p,operateTabs:h,handleChangeTab:m}=function(e=zv.Add){const{i18n:n}=t(),[i,o]=H.useState(e),r=H.useMemo((()=>[{key:zv.Add,value:n._({id:"m16xKo",message:"Add"})},{key:zv.Remove,value:n._({id:"t/YqKh",message:"Remove"})}]),[n._]);return H.useEffect((()=>{o(e)}),[e]),{operateTab:i,operateTabs:r,handleChangeTab:e=>{o(e)}}}(n),{account:g}=hd(),f=cb({account:g,pool:e?{chainId:e.chainId,address:e.address,type:e.type,baseTokenDecimals:e.baseToken.decimals,quoteTokenDecimals:e.quoteToken.decimals,baseLpTokenDecimals:null!==(s=null===(a=e.baseLpToken)||void 0===a?void 0:a.decimals)&&void 0!==s?s:18,quoteLpTokenDecimals:null!==(d=null===(l=e.quoteLpToken)||void 0===l?void 0:l.decimals)&&void 0!==d?d:18}:void 0}),x=Qe(Ql.getPMMStateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(c=null==e?void 0:e.baseToken)||void 0===c?void 0:c.decimals,null===(u=null==e?void 0:e.quoteToken)||void 0===u?void 0:u.decimals));return f.error||x.error||o?In.jsx(Nn,{refresh:()=>{f.error&&f.refetch(),x.error&&x.refetch(),o&&o()},sx:{my:40,height:"100%"}}):In.jsxs(In.Fragment,{children:[In.jsx(Kb,{pool:e,balanceInfo:f,hidePoolInfo:i}),In.jsxs(A,{value:p,onChange:(e,t)=>{m(t)},children:[In.jsx(F,{tabs:h,variant:"inPaper",tabsListSx:{mt:16,mx:20}}),In.jsx(L,{value:zv.Add,children:In.jsx(Qb,{pool:e,balanceInfo:f,submittedBack:r})}),In.jsx(L,{value:zv.Remove,children:In.jsx(oj,{pool:e,balanceInfo:f,submittedBack:r})})]})]})}function aj({onClose:e,pool:n,address:o,operate:r,chainId:a,hasMining:s,hidePoolInfo:l,sx:d}){var c,u,p,h,m,g,f,x,y;const{account:v}=hd(),b=a?pa[a]:"",j=vd(),C=Qe(Object.assign(Object.assign({},j.getQuery(me.graphql.fetchPoolList,{where:{id:null!==(c=null==o?void 0:o.toLocaleLowerCase())&&void 0!==c?c:"",chain:b}})),{enabled:!!o&&!!a})),w=null===(p=null===(u=C.data)||void 0===u?void 0:u.pairs)||void 0===p?void 0:p[0],k=w&&a?function(e,t){var n,i,o,r,a,s;if(e)return{address:e.id,chainId:t,baseToken:Kl(e.baseToken,t),quoteToken:Kl(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)}}}(w,a):void 0,E=o&&a?k:n,I=C.error?C.refetch:void 0,{poolOrMiningTab:S,poolOrMiningTabs:O,handleChangeTab:R}=function({hasMining:e}){const{i18n:n}=t(),[i,o]=H.useState(Ob.Liquidity);return{poolOrMiningTab:i,poolOrMiningTabs:H.useMemo((()=>{const t=[{key:Ob.Liquidity,value:n._({id:"6y2TB3",message:"Liquidity"})},{key:Ob.Mining,value:n._({id:"Sti4vy",message:"Mining"})}];return e?t:t.slice(0,1)}),[n._,e]),handleChangeTab:e=>{o(e)}}}({hasMining:s}),M=cb({account:v,pool:E?{chainId:E.chainId,address:E.address,type:E.type,baseTokenDecimals:E.baseToken.decimals,quoteTokenDecimals:E.quoteToken.decimals,baseLpTokenDecimals:null!==(m=null===(h=E.baseLpToken)||void 0===h?void 0:h.decimals)&&void 0!==m?m:18,quoteLpTokenDecimals:null!==(f=null===(g=E.quoteLpToken)||void 0===g?void 0:g.decimals)&&void 0!==f?f:18}:void 0}),_=!!(null===(x=M.userBaseLpBalance)||void 0===x?void 0:x.gt(0))||!!(null===(y=M.userQuoteLpBalance)||void 0===y?void 0:y.gt(0)),P=null!=a?a:null==E?void 0:E.chainId,B=null!=o?o:null==E?void 0:E.address;return In.jsx(i,{sx:d,children:In.jsxs(A,{value:S,onChange:(e,t)=>{R(t)},sx:{display:"flex",flexDirection:"column",overflow:"hidden",height:"100%"},children:[In.jsx(D,{tabs:O,tabsListSx:Object.assign({mx:20,justifyContent:"space-between"},s&&_?{"& button:last-child":{position:"relative","&::before":{content:`"${le._({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("#DABB1B",.2),color:"#DABB1B"}}}:{}),rightSlot:In.jsxs(i,{sx:{display:"flex",justifyContent:"center",alignItems:"center",gap:12},children:["GSP"===(null==E?void 0:E.type)&&In.jsx(Lb,{}),e?In.jsx(i,{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:In.jsx(i,{component:Un.Error,sx:{width:16,height:16},onClick:()=>{e()}})}):void 0]})}),In.jsx(L,{value:Ob.Liquidity,sx:{flex:1,overflowY:"auto"},children:In.jsx(rj,{pool:E,operate:r,hidePoolInfo:l,errorRefetch:I,submittedBack:()=>{s&&R(Ob.Mining)}})}),In.jsx(L,{value:Ob.Mining,sx:{flex:1,overflowY:"auto"},children:P&&B?In.jsx(Sb,{chainId:P,account:v,poolAddress:B,goLpLink:()=>{R(Ob.Liquidity)}}):""})]})})}function sj(e){var{modal:t}=e,n=vn(e,["modal"]);const{isMobile:i}=Sd();return In.jsx(Rc,{open:!!n.pool||!!n.address,onClose:n.onClose,scope:!i,modal:t,id:"pool-operate",children:In.jsx(aj,{...n})})}var lj,dj;function cj(){return cj=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},cj.apply(null,arguments)}const uj=e=>W.createElement("svg",cj({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),lj||(lj=W.createElement("circle",{cx:16,cy:16,r:16,fill:"#FFE804"})),dj||(dj=W.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"}))),pj="_default";function hj({value:e,onChange:t,placeholder:n,options:o,sx:r,readOnly:s,valueOnlyIcon:l}){const d=a();return In.jsx(q,{value:null!=e?e:pj,onChange:(n,i)=>{const o="number"==typeof e&&i?Number(i):i;t(o===pj?void 0:o)},disabled:s,sx:ne({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"}},r),renderValue:t=>{if(!(null==t?void 0:t.value)||t.value===pj)return In.jsx(i,{sx:{color:"text.secondary"},children:null!=n?n:""});const r=o.find((t=>t.key===e));return r?In.jsxs(In.Fragment,{children:[r.logo,l?"":r.value]}):null},options:[...o]})}function mj({isMobileStyle:e,chain:t,isLastItem:n,logoWidth:o,mobileLogoWidth:r,sx:s}){const l=a();return e?In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",py:18,borderTop:`1px solid ${l.palette.border.main}`,borderBottom:n?`1px solid ${l.palette.border.main}`:"none"},s),children:[In.jsx(i,{component:null==t?void 0:t.logo,sx:{width:r,height:r}}),In.jsx(i,{component:"span",className:"name",sx:{marginLeft:8},children:null==t?void 0:t.name})]}):In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(i,{component:null==t?void 0:t.logo,sx:{width:o,height:o}}),In.jsx(i,{component:"span",className:"name",sx:{marginLeft:8},children:null==t?void 0:t.name})]})}const gj=-1;function fj({chainId:n,setChainId:o,logoWidth:r=24,mobileLogoWidth:a=32,mainLogoWidth:s=24,mainMobileLogoWidth:l=18,notShowAllChain:c,valueOnlyIcon:u,sx:p}){const h=function(){const{chainId:e}=hd();return Z((()=>{const t=new Map;let n;return us.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])}(),[m,g]=H.useState(!1),{isMobile:f}=Sd(),{i18n:x}=t(),y=H.useCallback((()=>{const e=void 0===n?h[0]:h.find((e=>e.chainId===n));if(u){if(void 0===n||!e)return"";const t=f?a:s;return In.jsx(i,{component:null==e?void 0:e.logo,sx:{width:t,height:t}})}return void 0!==n||c?e?In.jsx(mj,{isMobileStyle:f,chain:e,logoWidth:s,mobileLogoWidth:l}):null:In.jsx(mj,{isMobileStyle:f,chain:{chainId:gj,logo:uj,name:x._({id:"pY/ok7",message:"All chains"})},logoWidth:s,mobileLogoWidth:l,sx:{border:"none"}})}),[n,h,c,u,f,x._]),v=H.useMemo((()=>{const e=[];return c||e.push({key:gj,value:In.jsx(mj,{isMobileStyle:f,chain:{chainId:gj,logo:uj,name:x._({id:"pY/ok7",message:"All chains"})},logoWidth:r,mobileLogoWidth:a})}),h.forEach(((t,n)=>{e.push({key:t.chainId,value:In.jsx(mj,{isLastItem:n===h.length-1,isMobileStyle:f,chain:t,logoWidth:r,mobileLogoWidth:a})})})),e}),[f,r,a,h,c]);return f?In.jsxs(In.Fragment,{children:[In.jsxs(i,{component:d,onClick:()=>g(!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"},p),children:[In.jsx(i,{sx:{pr:5},children:y()}),In.jsx(i,{component:Un.CaretUp,sx:{width:12,height:12,transform:"rotate(180deg)"}})]}),In.jsx(Rc,{open:m,title:In.jsx(e,{id:"lJvbHq",message:"Select Network"}),onClose:()=>g(!1),id:"select-chain",modal:!0,children:In.jsx(i,{sx:{mb:20},children:v.map((e=>In.jsxs(i,{onClick:()=>{const t=e.key;o(t===gj?void 0:Number(t)),g(!1)},sx:{position:"relative",px:20,"&:active":{backgroundColor:"hover.default"},"&:hover":{backgroundColor:"hover.default"},cursor:"pointer"},children:[e.value,(n?e.key===n:e.key===gj)&&In.jsx(i,{sx:{position:"absolute",left:0,top:24,height:20,width:2,backgroundColor:"text.primary"}})]},e.key)))})})]}):In.jsx(hj,{value:null!=n?n:gj,onChange:e=>{v.some((t=>String(t.key)===String(e)))&&o(e===gj?void 0:e)},placeholder:x._({id:"lJvbHq",message:"Select Network"}),options:v,valueOnlyIcon:u,sx:Object.assign({px:8,height:32,fontWeight:600,typography:"body2",backgroundColor:"background.tag",color:"text.primary"},p)})}const xj=e=>{const{filterList:t,value:n,onChange:o}=e,r=a();return In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:t.map(((e,a)=>In.jsx(i,{sx:Object.assign(Object.assign({borderLeftWidth:1,borderRightWidth:a===t.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===t.length-1?8:0,borderBottomRightRadius:a===t.length-1?8:0},n===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)))})},yj=({sx:t,isRightTop:n,isReverseColor:o})=>{const r=a();return In.jsx(i,{sx:Object.assign(Object.assign(Object.assign({display:"inline-flex",padding:"2px 4px",alignItems:"center",gap:"4px",borderRadius:4,background:T(r.palette.warning.main,.1),color:r.palette.warning.main,fontSize:"10px",fontWeight:600,lineHeight:"14px"},n?{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),t),children:In.jsx(e,{id:"y5rS9U",message:"Migrate"})})};function vj({lqList:t,setOperatePool:n,getMigrationPairAndMining:o,supportAMM:r,timeRange:s}){const d=a(),{onSharePool:u}=On();return In.jsx(In.Fragment,{children:null==t?void 0:t.map((t=>{var a,p,h,m,g,f,x,y,v;if(!(null==t?void 0:t.pair))return null;const b=t.pair,j=Kl(b.baseToken,b.chainId),C=Kl(b.quoteToken,b.chainId),w=null===(a=b.apyList)||void 0===a?void 0:a.find((e=>(null==e?void 0:e.timeRange)===`${s}D`)),k=w?Ys(new Le(null==w?void 0:w.transactionBaseApy).plus(null!==(p=null==w?void 0:w.miningBaseApy)&&void 0!==p?p:0)):void 0,E=me.utils.singleSideLp(b.type)&&w?Ys(new Le(w.transactionQuoteApy).plus(null!==(h=w.miningQuoteApy)&&void 0!==h?h:0)):void 0,A=!!(null===(m=b.miningAddress)||void 0===m?void 0:m[0]),I=!!(null==w?void 0:w.metromMiningApy)&&Number(null==w?void 0:w.metromMiningApy)>0,S=b.type,L=td(S),O="AMMV2"===S,R="AMMV3"===S,M=null==o?void 0:o({address:b.id,chainId:b.chainId});return In.jsxs(i,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{r||Gf.getState().push({type:$f.PoolDetail,params:{chainId:b.chainId,address:b.id}})},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[j&&C?In.jsx(gg,{tokens:[j,C],width:24,mr:6,chainId:b.chainId,showChainLogo:!0}):"",In.jsxs(i,{sx:{typography:"body2",fontWeight:600},children:[`${null==j?void 0:j.symbol}/${null==C?void 0:C.symbol}`,!!u&&In.jsx(i,{component:Un.Share,sx:{ml:2,width:12,height:12},onClick:()=>u({chainId:b.chainId,baseToken:j,quoteToken:C,poolId:b.id,apy:w,isSingle:me.utils.singleSideLp(b.type)})}),In.jsx(Pv,{address:b.id,chainId:b.chainId})]}),!!M&&In.jsx(yj,{})]}),A||I?In.jsxs(i,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${T(d.palette.secondary.main,.3)} 0%, ${T(d.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",In.jsx(e,{id:"Sti4vy",message:"Mining"})]}):""]}),In.jsxs(i,{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&&In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[L,In.jsx(l,{title:In.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:In.jsx(i,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:R?null!==(f=null===(g=ev[b.lpFeeRate])||void 0===g?void 0:g.label)&&void 0!==f?f:"-":Gs({input:new Le(null!==(x=b.lpFeeRate)&&void 0!==x?x:0).plus(b.mtFeeRate?Us(b.mtFeeRate,O?4:18):0)})})})]}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h5",color:"success.main"},children:[k,E?`/${E}`:""]}),In.jsxs(i,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[s,"d ",In.jsx(e,{id:"rSayea",message:"APY"}),In.jsx(Vv,{chainId:b.chainId,apy:w,baseToken:j,quoteToken:C,hasQuote:!!E,hasMining:A,sx:{width:14,height:14}})]})]}),In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h5"},children:["$",$s(new Le(b.tvl))]}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),r&&In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:["$",_s({input:null===(v=null===(y=b.volumeList)||void 0===y?void 0:y.find((e=>(null==e?void 0:e.timeRange)===`${s}D`)))||void 0===v?void 0:v.volume})]}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"iuFFMB",message:"Volume ({timeRange}d)",values:{timeRange:s}})})]})]}),In.jsxs(i,{sx:{mt:20,display:"flex",alignItems:"center",gap:"8px"},children:[In.jsx(c,{fullWidth:!0,size:c.Size.small,onClick:e=>{e.stopPropagation(),n({pool:Jl(t),hasMining:A})},children:In.jsx(e,{id:"m16xKo",message:"Add"})}),r&&"PMM"===L&&In.jsx(Fv,{chainId:b.chainId,address:b.id})]})]},b.id+b.chainId)}))})}function bj({lqList:t,loading:n,operatePool:o,setOperatePool:r,getMigrationPairAndMining:s,hasMore:d,loadMore:u,loadMoreLoading:p,supportAMM:h,timeRange:m}){const g=a(),{onSharePool:f}=On();return In.jsxs(Uv,{hasMore:d,loadMore:u,loadMoreLoading:p,empty:!(null==t?void 0:t.length),loading:n,children:[In.jsx(i,{component:"thead",children:In.jsxs(i,{component:"tr",children:[In.jsx(i,{component:"th",children:In.jsx(e,{id:"AxdOHo",message:"Pair"})}),h&&In.jsx(i,{component:"th",children:In.jsx(e,{id:"1Qz63U",message:"Pool Type"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"FHKsZF",message:"TVL"})}),In.jsxs(i,{component:"th",children:[m,"d ",In.jsx(e,{id:"rSayea",message:"APY"})]}),h&&In.jsxs("th",{children:[m,"d ",In.jsx(e,{id:"/cF7Rs",message:"Volume"})]}),In.jsx(i,{component:"th",sx:{width:80}})]})}),In.jsx(i,{component:"tbody",children:null==t?void 0:t.map((e=>{var t,n,a,d,u,p,x,y;if(!(null==e?void 0:e.pair))return null;const v=e.pair,b=Kl(v.baseToken,v.chainId),j=Kl(v.quoteToken,v.chainId),C=null===(t=v.apyList)||void 0===t?void 0:t.find((e=>(null==e?void 0:e.timeRange)===`${m}D`)),w=C?Ys(new Le(null==C?void 0:C.transactionBaseApy).plus(null!==(n=null==C?void 0:C.miningBaseApy)&&void 0!==n?n:0).plus(null!==(a=null==C?void 0:C.metromMiningApy)&&void 0!==a?a:0)):void 0,k=me.utils.singleSideLp(v.type)&&C?Ys(new Le(C.transactionQuoteApy).plus(null!==(d=C.miningQuoteApy)&&void 0!==d?d:0)):void 0;let T="";if((null===(u=null==o?void 0:o.pool)||void 0===u?void 0:u.address)===v.id||(null==o?void 0:o.address)===v.id)if(o.operate===zv.Remove)T=le._({id:"0+31GV",message:"Removing"});else T=le._({id:"1yHVE+",message:"Adding"});const E=!!(null===(p=v.miningAddress)||void 0===p?void 0:p[0]),A=!!(null==C?void 0:C.metromMiningApy)&&Number(null==C?void 0:C.metromMiningApy)>0,I=v.type,S=td(I),L="AMMV2"===I,O="AMMV3"===I,R=g.palette.hover.default,M=null==s?void 0:s({address:v.id,chainId:v.chainId});return In.jsxs(i,{component:"tr",sx:{["&:hover td"+(T?", & td":"")]:{backgroundImage:`linear-gradient(${R}, ${R})`}},children:[In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[b&&j?In.jsx(gg,{tokens:[b,j],width:24,mr:8,chainId:v.chainId,showChainLogo:!0}):"",In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==b?void 0:b.symbol}/${null==j?void 0:j.symbol}`,In.jsx(Pv,{address:v.id,chainId:v.chainId}),!!M&&In.jsx(yj,{})]}),In.jsx(qm,{address:v.id,customChainId:v.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,onShareClick:f?()=>f({chainId:v.chainId,baseToken:b,quoteToken:j,poolId:v.id,apy:C,isSingle:me.utils.singleSideLp(v.type)}):void 0,sx:{typography:"h6",color:"text.secondary"},disabledAddress:h,onAddressClick:()=>{Gf.getState().push({type:$f.PoolDetail,params:{chainId:v.chainId,address:v.id}})}})]})]})}),h&&In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(tv,{poolType:S}),In.jsx(nv,{isAMMV2:L,isAMMV3:O,lpFeeRate:v.lpFeeRate,mtFeeRate:v.mtFeeRate})]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{typography:"body2"},title:v.tvl?`$${_s({input:v.tvl})}`:void 0,children:["$",$s(new Le(v.tvl))]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[E||A?In.jsx(l,{title:le._({id:"Sti4vy",message:"Mining"}),children:In.jsxs(i,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",In.jsx(Vv,{chainId:v.chainId,apy:C,baseToken:b,quoteToken:j,hasQuote:!!k,hasMining:E,children:In.jsxs(i,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[w,k?`/${k}`:""]})})]})}),h&&In.jsxs(i,{component:"td",sx:{typography:"body2"},children:["$",_s({input:null===(y=null===(x=v.volumeList)||void 0===x?void 0:x.find((e=>(null==e?void 0:e.timeRange)===`${m}D`)))||void 0===y?void 0:y.volume})]}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[h&&"PMM"===S&&In.jsx(Fv,{chainId:v.chainId,address:v.id}),T?In.jsx(Bv,{text:T,onClick:()=>r(null)}):In.jsx(c,{size:c.Size.small,onClick:()=>{r({pool:Jl(e),hasMining:E})},sx:{py:0,height:32},children:le._({id:"m16xKo",message:"Add"})})]})})]},v.id+v.chainId)}))})]})}function jj({scrollParentRef:e,filterChainIds:t,activeChainId:n,handleChangeActiveChainId:o,operatePool:r,setOperatePool:s,tokenAndPoolFilter:l,getMigrationPairAndMining:d,children:c}){var u,p;const h=a(),{onlyChainId:m,supportAMMV2:g,supportAMMV3:f,notSupportPMM:x}=On(),{minDevice:y,isMobile:v}=Sd(),b=Ke(),[j,C]=$("all"),[w,k]=$("1"),{filterTokens:T,filterASymbol:E,filterBSymbol:A,filterAddressLqList:I,handleDeleteToken:S,handleChangeFilterTokens:L,handleChangeFilterAddress:O}=Zv(l),R=Z((()=>{if(f&&"v3"===j)return["AMMV3"];if(g&&"v2"===j)return["AMMV2"];if(!x&&"pmm"===j)return["CLASSICAL","DVM","DSP","GSP"];let e=x?[]:["CLASSICAL","DVM","DSP","GSP"];return g&&e.push("AMMV2"),f&&e.push("AMMV3"),e}),[x,g,f,j]),M=Z((()=>({chainIds:t,pageSize:v?4:8,filterState:{viewOnlyOwn:!1,filterTypes:R}})),[t,R,v]),_=vd(),P=_.getInfiniteQuery(me.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},M),{filterState:Object.assign({filterASymbol:E,filterBSymbol:A},M.filterState)})}),B=nt(Object.assign(Object.assign({},P),{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 D=[];const N=!!(null==I?void 0:I.length);N?D=[...I]:null===(u=B.data)||void 0===u||u.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==D||D.push(e)}))}));const F=B.hasNextPage&&!N;return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pt:12,pb:20,display:"flex",flexDirection:"column",gap:12,[h.breakpoints.up("tablet")]:{py:16,flexDirection:"row",alignItems:"center",gap:8,px:0,justifyContent:"space-between"}},children:[In.jsx(i,{sx:{[h.breakpoints.up("tablet")]:{mr:"auto"}},children:c}),!m&&In.jsx(fj,{chainId:n,setChainId:o}),(g||f)&&In.jsx(xj,{filterList:[{label:"All",value:"all"}].concat(x?[]:[{label:"PMM",value:"pmm"}]).concat(g?[{label:"V2",value:"v2"}]:[]).concat(f?[{label:"V3",value:"v3"}]:[]),value:j,onChange:e=>C(e)}),In.jsx(xj,{filterList:[{label:"1d",value:"1"},{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"}],value:w,onChange:e=>k(e)}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:Object.assign({flex:1,display:"flex",alignItems:"center",gap:8},v?{}:{"& > button":{flex:1}}),children:null!==(p=null==l?void 0:l.element)&&void 0!==p?p:In.jsx(Wv,{value:T,onChange:L,searchAddress:(e,t)=>bn(this,void 0,void 0,(function*(){var n;const i=_.getInfiniteQuery(me.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},M),{filterState:Object.assign({address:e},M.filterState)})}),o=null===(n=(yield b.fetchQuery(i)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==o?void 0:o.length)?In.jsx(Hv,{list:o,onClick:()=>{O(o),t()}}):null}))})}),(N||!!T.length)&&In.jsxs(i,{sx:{my:0},children:[N?In.jsx(Dv,{lqList:I,onDeleteTag:()=>O([])}):"",In.jsx(Nv,{tags:T,onDeleteTag:S})]})]})]}),v?In.jsx(on,{hasMore:F,threshold:300,loadMore:se((()=>{B.hasNextPage&&!B.isFetching&&B.fetchNextPage()}),500),useWindow:!1,getScrollParent:()=>e.current||null,loader:In.jsx(qv,{sx:{mt:20}},"loader"),children:In.jsxs(_v,{children:[B.isLoading?In.jsx(qv,{}):"",!B.isLoading&&!(null==D?void 0:D.length)&&!B.error&&In.jsx(Mn,{sx:{mt:40},hasSearch:!!(n&&!m||E||A)}),!!B.error&&In.jsx(Nn,{refresh:B.refetch,sx:{mt:40}}),In.jsx(vj,{lqList:D,setOperatePool:s,supportAMM:g||f,getMigrationPairAndMining:d,timeRange:w})]})}):In.jsxs(In.Fragment,{children:[In.jsx(bj,{lqList:D,loading:B.isLoading,operatePool:r,setOperatePool:s,hasMore:F,loadMoreLoading:B.isFetchingNextPage,loadMore:()=>{B.hasNextPage&&!B.isFetching&&B.fetchNextPage()},supportAMM:g||f,timeRange:w,getMigrationPairAndMining:d}),In.jsx(fg,{loading:B.isLoading,refetch:B.error?B.refetch:void 0,empty:!(null==D?void 0:D.length),hasSearch:!!(n&&!m||E||A)})]})]})}function Cj({onClick:e,title:t,desc:n}){const o=a();return In.jsx(i,{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:In.jsxs(d,{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:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:o.palette.text.primary},children:t}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary},children:n})]})})}const wj=t=>{const n=a(),{isMobile:o}=Sd(),{supportAMMV2:r,supportAMMV3:s,notSupportPMM:d}=On(),[u,p]=H.useState(!1),h={[$f.CreatePool]:!d,[$f.createPoolAMMV2]:!!r,[$f.createPoolAMMV3]:!!s},m=Object.entries(h).filter((([e,t])=>!0===t)),g=1===m.length?m[0][0]:void 0;if(!g){const t=In.jsxs(In.Fragment,{children:[!d&&In.jsx(Cj,{onClick:()=>{Gf.getState().push({type:$f.CreatePool})},title:In.jsx(e,{id:"Eif7f6",message:"PMM Pool"}),desc:In.jsx(e,{id:"LQ0J1B",message:"Flexible customization, take full control of liquidity"})}),r&&In.jsx(Cj,{onClick:()=>{Gf.getState().push({type:$f.createPoolAMMV2})},title:In.jsx(e,{id:"lNYomJ",message:"AMM V2 Position"}),desc:In.jsx(e,{id:"lLbR0m",message:"Simple, full-range liquidity"})}),s&&In.jsx(Cj,{onClick:()=>{Gf.getState().push({type:$f.createPoolAMMV3})},title:In.jsx(e,{id:"sVlqoo",message:"AMM V3 Position"}),desc:In.jsx(e,{id:"EkAv3P",message:"Concentrated liquidity, higher efficiency"})})]});return o?In.jsxs(In.Fragment,{children:[In.jsxs(c,{variant:c.Variant.second,fullWidth:!0,onClick:()=>{p(!0)},sx:{height:36},children:[In.jsx(i,{component:Un.Plus,sx:{mr:4}}),In.jsx(e,{id:"p2jbcE",message:"Create Pool"})]}),In.jsx(Rc,{open:u,title:In.jsx(e,{id:"p2jbcE",message:"Create Pool"}),onClose:()=>{p(!1)},modal:!0,children:In.jsx(i,{sx:{mb:0},children:t})})]}):In.jsx(l,{arrow:!1,leaveDelay:300,placement:o?"bottom":"bottom-end",sx:{p:0,backgroundColor:"background.paper"},title:In.jsx(i,{children:t}),children:In.jsxs(i,{sx:{width:o?"100%":"auto",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,pl:8,pr:16,py:6,borderRadius:40,backgroundColor:n.palette.background.tag,typography:"body2",fontWeight:600,color:n.palette.text.link,cursor:"pointer","&:hover":{backgroundColor:T(n.palette.primary.main,.1)}},children:[In.jsx(i,{component:Un.Plus}),In.jsx(e,{id:"p2jbcE",message:"Create Pool"})]})})}return In.jsxs(c,{variant:c.Variant.outlined,fullWidth:o,onClick:()=>{Gf.getState().push({type:g})},sx:{height:40},children:[In.jsx(i,{component:Un.Plus,sx:{mr:4}}),In.jsx(e,{id:"p2jbcE",message:"Create Pool"})]})},kj="DODO_WIDGET_POOL_LIST_TOP_TAB",Tj="DODO_WIDGET_POOL_LIST_TAB",Ej="DODO_WIDGET_POOLS_LIST_FILTER_CHAIN";var Aj,Ij,Sj,Lj;!function(e){e.ALM="ALM",e.NORMAL="NORMAL",e.MULTI_TOKEN="MULTI_TOKEN"}(Aj||(Aj={})),function(e){e.ALL="ALL",e.MY="MY"}(Ij||(Ij={})),function(e){e.addLiquidity="add-liquidity",e.myLiquidity="my-liquidity",e.myCreated="my-created"}(Sj||(Sj={})),function(e){e.ALL="ALL",e.MY="MY"}(Lj||(Lj={}));const Oj=(e,t,n)=>{let i=le._({id:"TJBHlP",message:"Standard"}),o=n.palette.purple.main;switch(e){case"DSP":i=le._({id:"J7M/DA",message:"Pegged"}),o=n.palette.success.main;break;case"DPP":i=le._({id:"zwBp5t",message:"Private"}),o=n.palette.error.main}"DVM"===e&&(!t||t.isZero())&&(i=le._({id:"S8G1qk",message:"Single"}),o=n.palette.warning.main);return{typeLabel:i,typeColor:o,typeBgColor:T(o,.1)}};function Rj({account:t,list:n,setOperatePool:o}){const r=a();return In.jsx(In.Fragment,{children:null==n?void 0:n.map((n=>{var a,s,l,u,p;if(!n)return null;const h=null!==(a=n.pairAddress)&&void 0!==a?a:"",m=n.chainId,g=n.poolType,f={chainId:m,address:null!==(s=n.baseAddress)&&void 0!==s?s:"",symbol:null!==(l=n.baseSymbol)&&void 0!==l?l:""},x={chainId:m,address:null!==(u=n.quoteAddress)&&void 0!==u?u:"",symbol:null!==(p=n.quoteSymbol)&&void 0!==p?p:""},{typeLabel:y,typeColor:v,typeBgColor:b}=Oj(g,n.quoteReserve?new Le(n.quoteReserve):null,r);return In.jsxs(i,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{Gf.getState().push({type:$f.PoolDetail,params:{chainId:m,address:h}})},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[f&&x?In.jsx(gg,{tokens:[f,x],width:24,mr:8,chainId:m,showChainLogo:!0}):"",In.jsx(i,{sx:{typography:"body2",fontWeight:600},children:rd(h)}),"DPP"===g&&In.jsx(_,{sx:{ml:2},component:d,onClick:e=>{e.stopPropagation(),Gf.getState().push({type:$f.ModifyPool,params:{chainId:m,address:h}})},children:In.jsx(i,{component:Un.Edit,sx:{width:12,height:12,cursor:"pointer"}})})]}),In.jsx(i,{sx:{typography:"h6",width:"max-content",p:8,borderRadius:8,backgroundColor:b,color:v},children:y})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",mt:44},children:[In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h5"},children:["$",n.tvl?$s(new Le(n.tvl)):"-"]}),In.jsx(i,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:In.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),In.jsx(i,{sx:{display:"inline-block",mx:20,height:24,width:"1px",backgroundColor:"custom.border.default"}}),In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h5"},children:["$",n.totalFee?$s(new Le(n.totalFee)):"-"]}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"hCBYHP",message:"Total Fee Revenue"})})]})]}),In.jsxs(i,{sx:{mt:20,display:"flex",gap:"8px"},children:[!!t&&In.jsx(c,{fullWidth:!0,variant:c.Variant.outlined,size:c.Size.small,onClick:e=>{e.stopPropagation(),o({address:h,operate:zv.Remove,chainId:m})},children:In.jsx(e,{id:"t/YqKh",message:"Remove"})}),In.jsx(c,{fullWidth:!0,size:c.Size.small,onClick:e=>{e.stopPropagation(),o({address:h,operate:zv.Add,chainId:m})},children:In.jsx(e,{id:"m16xKo",message:"Add"})})]})]},h+m)}))})}function Mj({account:t,list:n,loading:o,operatePool:r,setOperatePool:s}){const l=a(),d=Gf();return In.jsxs(Uv,{empty:!(null==n?void 0:n.length),loading:o,children:[In.jsx(i,{component:"thead",children:In.jsxs(i,{component:"tr",children:[In.jsx(i,{component:"th",children:In.jsx(e,{id:"AxdOHo",message:"Pair"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"FHKsZF",message:"TVL"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"hCBYHP",message:"Total Fee Revenue"})}),In.jsx(i,{component:"th",sx:{width:160}})]})}),In.jsx(i,{component:"tbody",children:null==n?void 0:n.map((n=>{var o,a,u,p,h,m;if(!n)return null;const g="DPP"===n.poolType,f=null!==(o=n.pairAddress)&&void 0!==o?o:"",x=n.chainId,y=n.poolType,v={chainId:x,address:null!==(a=n.baseAddress)&&void 0!==a?a:"",symbol:null!==(u=n.baseSymbol)&&void 0!==u?u:""},b={chainId:x,address:null!==(p=n.quoteAddress)&&void 0!==p?p:"",symbol:null!==(h=n.quoteSymbol)&&void 0!==h?h:""},{typeLabel:j,typeColor:C,typeBgColor:w}=Oj(y,n.quoteReserve?new Le(n.quoteReserve):null,l);let k="";if((null===(m=null==r?void 0:r.pool)||void 0===m?void 0:m.address)===f||(null==r?void 0:r.address)===f)if((null==r?void 0:r.operate)===zv.Remove)k=le._({id:"0+31GV",message:"Removing"});else k=le._({id:"1yHVE+",message:"Adding"});const E=l.palette.hover.default;return In.jsxs(i,{component:"tr",sx:{["&:hover td"+(k?", & td":"")]:{backgroundImage:`linear-gradient(${E}, ${E})`}},children:[In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[v&&b?In.jsx(gg,{tokens:[v,b],width:24,mr:10,chainId:x,showChainLogo:!0}):"",In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsxs(M,{lineSx:{bottom:-1},lineColor:"primary.main",hoverSx:{color:"primary.main","& svg":{display:"inline-block"}},className:"truncate-address-link",sx:{display:"flex",alignItems:"center"},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600},onClick:()=>{d.push({type:$f.PoolDetail,params:{chainId:x,address:f}})},children:rd(f)}),In.jsx(i,{component:Un.ArrowRight,sx:{display:"none",width:14,height:14}})]}),g?In.jsx(i,{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(l.palette.text.primary,.1)}},onClick:()=>{d.push({type:$f.ModifyPool,params:{chainId:x,address:f}})},children:In.jsx(e,{id:"ePK91l",message:"Edit"})}):""]}),In.jsx(i,{sx:{typography:"h6",width:"max-content",mt:2,px:8,py:2,borderRadius:12,backgroundColor:w,color:C},children:j})]})]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{typography:"body2"},title:n.tvl?`$${_s({input:n.tvl})}`:void 0,children:["$",n.tvl?$s(new Le(n.tvl)):"-"]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{title:n.totalFee?`$${_s({input:n.totalFee})}`:"",sx:{typography:"body2",fontWeight:600},children:["$",n.totalFee?$s(new Le(n.totalFee)):"-"]})}),In.jsx(i,{component:"td",children:In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:k?In.jsx(Bv,{text:k,onClick:()=>s(null)}):In.jsxs(In.Fragment,{children:[!!t&&In.jsx(c,{variant:c.Variant.second,size:c.Size.small,onClick:e=>{e.stopPropagation(),s({operate:zv.Remove,chainId:x,address:f})},sx:{py:0,height:32},children:In.jsx(e,{id:"t/YqKh",message:"Remove"})}),In.jsx(c,{size:c.Size.small,onClick:()=>{s({chainId:x,address:f})},sx:{py:0,height:32},children:le._({id:"m16xKo",message:"Add"})})]})})})]},f+x)}))})]})}function _j({account:t,filterChainIds:n,activeChainId:o,handleChangeActiveChainId:r,operatePool:s,setOperatePool:l,children:d}){var c,u,p,h,m,g;const{isMobile:f}=Sd(),x=a(),{onlyChainId:y}=On(),v={limit:1e3,page:1,owner:t},b=vd().getQuery(me.graphql.fetchDashboardPairList,{where:v}),j=Qe(Object.assign({},b)),C=null!==(g=n?null===(p=null===(u=null===(c=j.data)||void 0===c?void 0:c.dashboard_pairs_list)||void 0===u?void 0:u.list)||void 0===p?void 0:p.filter((e=>{var t;return n.includes(null!==(t=null==e?void 0:e.chainId)&&void 0!==t?t:0)})):null===(m=null===(h=j.data)||void 0===h?void 0:h.dashboard_pairs_list)||void 0===m?void 0:m.list)&&void 0!==g?g:[],[w,k]=H.useState(!1),T=w?C.filter((e=>!!Number(null==e?void 0:e.tvl))):C;return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pt:12,pb:20,display:"flex",flexDirection:"column",gap:12,[x.breakpoints.up("tablet")]:{py:16,flexDirection:"row",alignItems:"center",gap:8,px:0,justifyContent:"space-between"}},children:[In.jsx(i,{sx:{[x.breakpoints.up("tablet")]:{mr:"auto"}},children:d}),!y&&In.jsx(fj,{chainId:o,setChainId:r}),In.jsxs(i,{component:"label",sx:{display:"flex",alignItems:"center",gap:8,typography:"body2",cursor:"pointer",color:"text.secondary"},children:[In.jsx(E,{sx:{top:-1},size:16,checked:w,onChange:e=>{const{checked:t}=e.target;k(t)}}),In.jsx(e,{id:"eVZ7bY",message:"Hide TVL=0 pools"})]})]}),f?In.jsxs(_v,{children:[j.isLoading?In.jsx(qv,{}):"",!j.isLoading&&!(null==T?void 0:T.length)&&!j.error&&In.jsx(Mn,{sx:{mt:40},hasSearch:!!o&&!y}),!!j.error&&In.jsx(Nn,{refresh:j.refetch,sx:{mt:40}}),In.jsx(Rj,{account:t,list:T,setOperatePool:l})]}):In.jsxs(In.Fragment,{children:[In.jsx(Mj,{account:t,list:T,loading:j.isLoading,operatePool:s,setOperatePool:l}),In.jsx(fg,{loading:j.isLoading,refetch:j.error?j.refetch:void 0,empty:!(null==T?void 0:T.length),hasSearch:!!o&&!y})]})]})}function Pj({account:t,lqList:n,setOperatePool:o,getMigrationPairAndMining:r,supportAMM:s,timeRange:d}){const u=a();return In.jsx(In.Fragment,{children:null==n?void 0:n.map((n=>{var a,p,h,m,g,f,x,y,v,b,j,C,w,k,E;if(!(null==n?void 0:n.pair))return null;const A=n.pair,I=Kl(A.baseToken,A.chainId),S=Kl(A.quoteToken,A.chainId),L=null===(a=A.apyList)||void 0===a?void 0:a.find((e=>(null==e?void 0:e.timeRange)===`${d}D`)),O=me.utils.singleSideLp(A.type),R=L?Ys(new Le(null==L?void 0:L.transactionBaseApy).plus(null!==(p=null==L?void 0:L.miningBaseApy)&&void 0!==p?p:0).plus(null!==(h=null==L?void 0:L.metromMiningApy)&&void 0!==h?h:0)):void 0,M=O&&L?Ys(new Le(L.transactionQuoteApy).plus(null!==(m=L.miningQuoteApy)&&void 0!==m?m:0)):void 0;let _,P;(null===(g=n.liquidityPositions)||void 0===g?void 0:g.length)&&n.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 Le(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&&(P=new Le(e.liquidityTokenBalance))}}}));const B=!!(null===(f=A.miningAddress)||void 0===f?void 0:f[0]),D=!!(null==L?void 0:L.metromMiningApy)&&Number(null==L?void 0:L.metromMiningApy)>0,N=null===(x=n.liquidityPositions)||void 0===x?void 0:x[0],F=A.type,U=td(F),q="AMMV2"===F,V="AMMV3"===F,W=null==r?void 0:r({address:A.id,chainId:A.chainId});return In.jsxs(i,{sx:{px:20,pt:20,pb:12,backgroundColor:"background.paper",borderRadius:16},className:"gradient-card-border",onClick:()=>{s||Gf.getState().push({type:$f.PoolDetail,params:{chainId:A.chainId,address:A.id}})},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[I&&S?In.jsx(gg,{tokens:[I,S],width:24,mr:6,chainId:A.chainId,showChainLogo:!0}):"",In.jsxs(i,{sx:{typography:"body2",fontWeight:600},children:[`${null==I?void 0:I.symbol}/${null==S?void 0:S.symbol}`,In.jsx(Pv,{address:A.id,chainId:A.chainId})]}),!!W&&In.jsx(yj,{})]}),B||D?In.jsxs(i,{sx:{p:8,typography:"h6",fontWeight:"bold",background:`linear-gradient(180deg, ${T(u.palette.secondary.main,.3)} 0%, ${T(u.palette.purple.main,.3)} 100%)`,borderRadius:8,color:"purple.main",whiteSpace:"nowrap"},children:["✨ ",In.jsx(e,{id:"Sti4vy",message:"Mining"})]}):""]}),In.jsxs(i,{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:[s&&In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,whiteSpace:"nowrap"},children:[U,In.jsx(l,{title:In.jsx(e,{id:"O6RUgz",message:"Fee rate"}),children:In.jsx(i,{sx:{px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:V?null!==(v=null===(y=ev[A.lpFeeRate])||void 0===y?void 0:y.label)&&void 0!==v?v:"-":Gs({input:new Le(null!==(b=A.lpFeeRate)&&void 0!==b?b:0).plus(A.mtFeeRate?Us(A.mtFeeRate,q?4:18):0)})})})]}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"1Qz63U",message:"Pool Type"})})]}),In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h5",color:"success.main"},children:[R||"-%",M?`/${M}`:""]}),In.jsxs(i,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:[d,"d ",In.jsx(e,{id:"rSayea",message:"APY"}),In.jsx(Vv,{chainId:A.chainId,apy:L,baseToken:I,quoteToken:S,hasQuote:!!M,hasMining:B,sx:{width:14,height:14}})]})]}),V?null:In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h5"},children:["$",$s(new Le(A.tvl||0))]}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"FHKsZF",message:"TVL"})})]}),"AMMV2"===F&&In.jsxs(i,{children:[In.jsx(i,{sx:{typography:"h5"},children:Gs({input:null===(C=null===(j=n.liquidityPositions)||void 0===j?void 0:j[0])||void 0===C?void 0:C.poolShare})}),In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"h3PbRN",message:"My Pool Share"})})]}),In.jsxs(i,{children:[In.jsx(i,{sx:{typography:"h5",display:"flex",alignItems:"center",fontWeight:"bold"},children:V?(null==N?void 0:N.liquidityUSD)?`$${Ps({input:N.liquidityUSD,decimals:2})}`:"-":In.jsxs(In.Fragment,{children:[O?In.jsx(Fc,{address:null==I?void 0:I.address,chainId:A.chainId,url:null==I?void 0:I.logoURI,width:18,height:18,sx:{mr:4}}):In.jsx(gg,{tokens:I&&S?[I,S]:[],width:18,mr:4,showChainLogo:!1,chainId:A.chainId}),_?_s({input:_}):"",O&&In.jsxs(In.Fragment,{children:[" / ",In.jsx(Fc,{address:null==S?void 0:S.address,chainId:A.chainId,url:null==S?void 0:S.logoURI,width:18,height:18,sx:{mx:4}}),P?_s({input:P}):"0"]})]})}),In.jsx(i,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:In.jsx(e,{id:"YHc3B+",message:"My Liquidity"})})]})]}),V&&In.jsxs(i,{sx:{mt:20},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[In.jsx(Ov,{outOfRange:null!==(w=null==N?void 0:N.outOfRange)&&void 0!==w&&w}),In.jsx(i,{children:In.jsxs(In.Fragment,{children:[In.jsxs("span",{children:[Qy({price:null===(k=null==N?void 0:N.priceRange)||void 0===k?void 0:k.token0LowerPrice,atLimit:{},direction:dx.LOWER})," "]}),null==I?void 0:I.symbol]})}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:In.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"})}),In.jsx(i,{children:In.jsxs(In.Fragment,{children:[In.jsxs("span",{children:[Qy({price:null===(E=null==N?void 0:N.priceRange)||void 0===E?void 0:E.token1LowerPrice,atLimit:{},direction:dx.UPPER})," "]}),null==I?void 0:I.symbol]})})]}),In.jsx(i,{sx:{typography:"h6",display:"flex",alignItems:"center",color:"text.secondary"},children:In.jsx(e,{id:"YA4hwj",message:"Price Range"})})]}),In.jsxs(i,{sx:{mt:20,display:"flex",alignItems:"center",gap:"8px"},children:[V?null:!!t&&In.jsx(c,{fullWidth:!0,variant:c.Variant.outlined,size:c.Size.small,onClick:e=>{e.stopPropagation(),o({operate:zv.Remove,pool:ed(n),hasMining:B})},children:In.jsx(e,{id:"t/YqKh",message:"Remove"})}),In.jsx(c,{fullWidth:!0,size:c.Size.small,onClick:e=>{e.stopPropagation(),o({operate:zv.Add,pool:ed(n),hasMining:B})},children:In.jsx(e,{id:"J/hVSQ",message:"{0}",values:{0:V?"Manage":"Add"}})}),s&&"PMM"===U&&In.jsx(Fv,{chainId:A.chainId,address:A.id})]})]},V?null==N?void 0:N.id:A.id+A.chainId)}))})}function Bj({account:t,lqList:n,loading:o,operatePool:r,setOperatePool:s,supportAMM:d,onlyV3:u,getMigrationPairAndMining:p,timeRange:h}){const m=a();return In.jsxs(Uv,{empty:!(null==n?void 0:n.length),loading:o,children:[In.jsx(i,{component:"thead",children:In.jsxs(i,{component:"tr",children:[In.jsx(i,{component:"th",children:In.jsx(e,{id:"AxdOHo",message:"Pair"})}),d&&In.jsx(i,{component:"th",children:In.jsx(e,{id:"1Qz63U",message:"Pool Type"})}),u?null:In.jsx(i,{component:"th",children:In.jsx(e,{id:"FHKsZF",message:"TVL"})}),In.jsxs(i,{component:"th",children:[h,"d ",In.jsx(e,{id:"rSayea",message:"APY"})]}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),u?In.jsx(i,{component:"th",children:In.jsx(e,{id:"YA4hwj",message:"Price Range"})}):null,In.jsx(i,{component:"th",sx:{width:210}})]})}),In.jsx(i,{component:"tbody",children:null==n?void 0:n.map((n=>{var o,a,g,f,x,y,v,b,j,C,w,k,T,E,A;if(!(null==n?void 0:n.pair))return null;const I=n.pair,S=Kl(I.baseToken,I.chainId),L=Kl(I.quoteToken,I.chainId),O=me.utils.singleSideLp(I.type),R=null===(o=I.apyList)||void 0===o?void 0:o.find((e=>(null==e?void 0:e.timeRange)===`${h}D`)),M=R?Ys(new Le(null==R?void 0:R.transactionBaseApy).plus(null!==(a=null==R?void 0:R.miningBaseApy)&&void 0!==a?a:0)):void 0,_=O&&R?Ys(new Le(R.transactionQuoteApy).plus(null!==(g=R.miningQuoteApy)&&void 0!==g?g:0)):void 0;let P,B;(null===(f=n.liquidityPositions)||void 0===f?void 0:f.length)&&n.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==I?void 0:I.baseLpToken)||void 0===n?void 0:n.id)||void 0===i?void 0:i.toLocaleLowerCase())===t)return void(P=new Le(e.liquidityTokenBalance));(null===(r=null===(o=null==I?void 0:I.quoteLpToken)||void 0===o?void 0:o.id)||void 0===r?void 0:r.toLocaleLowerCase())===t&&(B=new Le(e.liquidityTokenBalance))}}}));const D=null===(x=n.liquidityPositions)||void 0===x?void 0:x[0],N=I.type,F=td(N),U="AMMV2"===N,q="AMMV3"===N;let V="";if(q)(null===(b=null===(v=null===(y=null==r?void 0:r.pool)||void 0===y?void 0:y.liquidityPositions)||void 0===v?void 0:v[0])||void 0===b?void 0:b.id)===(null==D?void 0:D.id)&&(V=le._({id:"p3607o",message:"Managing"}));else if((null===(j=null==r?void 0:r.pool)||void 0===j?void 0:j.address)===I.id||(null==r?void 0:r.address)===I.id)if(r.operate===zv.Remove)V=le._({id:"0+31GV",message:"Removing"});else V=le._({id:"1yHVE+",message:"Adding"});const W=!!(null===(C=I.miningAddress)||void 0===C?void 0:C[0]),H=!!(null==R?void 0:R.metromMiningApy)&&Number(null==R?void 0:R.metromMiningApy)>0,Z=m.palette.hover.default,z=null==p?void 0:p({address:I.id,chainId:I.chainId});return In.jsxs(i,{component:"tr",sx:{["&:hover td"+(V?", & td":"")]:{backgroundImage:`linear-gradient(${Z}, ${Z})`}},children:[In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[S&&L?In.jsx(gg,{tokens:[S,L],width:24,mr:8,chainId:I.chainId,showChainLogo:!0}):"",In.jsxs(i,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,typography:"body2",fontWeight:600},children:[`${null==S?void 0:S.symbol}/${null==L?void 0:L.symbol}`,In.jsx(Pv,{address:I.id,chainId:I.chainId}),!!z&&In.jsx(yj,{})]}),In.jsx(qm,{address:I.id,customChainId:I.chainId,truncate:!0,showCopy:!0,iconDarkHover:!0,iconSize:14,iconSpace:4,disabledAddress:d,onAddressClick:()=>{Gf.getState().push({type:$f.PoolDetail,params:{chainId:I.chainId,address:I.id}})},sx:{typography:"h6",color:"text.secondary"}})]})]})}),d&&In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(tv,{poolType:F}),In.jsx(nv,{isAMMV2:U,isAMMV3:q,lpFeeRate:I.lpFeeRate,mtFeeRate:I.mtFeeRate})]})}),q?null:In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{typography:"body2"},title:I.tvl?`$${_s({input:I.tvl||0})}`:void 0,children:["$",$s(new Le(I.tvl||0))]})}),In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[W||H?In.jsx(l,{title:le._({id:"Sti4vy",message:"Mining"}),children:In.jsxs(i,{component:"span",sx:{typography:"body2",color:"success.main"},children:["✨"," "]})}):"",In.jsx(Vv,{chainId:I.chainId,apy:R,baseToken:S,quoteToken:L,hasQuote:!!_,hasMining:W,children:In.jsxs(i,{component:"span",sx:{typography:"body2",fontWeight:600,display:"flex",alignItems:"center",width:"max-content",color:"success.main",cursor:"auto"},children:[M||"-%",_?`/${_}`:""]})})]})}),In.jsx(i,{component:"td",children:In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"body2"},children:q?(null==D?void 0:D.liquidityUSD)?`$${Ps({input:D.liquidityUSD,decimals:2})}`:"-":In.jsxs(In.Fragment,{children:[O?In.jsx(Fc,{address:null==S?void 0:S.address,chainId:I.chainId,url:null==S?void 0:S.logoURI,width:24,height:24,noShowChain:!0,sx:{mr:4}}):In.jsx(gg,{tokens:S&&L?[S,L]:[],width:24,mr:4,showChainLogo:!1,chainId:I.chainId}),P?_s({input:P}):"-",O&&In.jsxs(In.Fragment,{children:[" / ",In.jsx(Fc,{address:null==L?void 0:L.address,chainId:I.chainId,url:null==L?void 0:L.logoURI,width:24,height:24,noShowChain:!0,sx:{mx:4}}),B?_s({input:B}):"0"]}),U&&In.jsx(l,{title:In.jsx(e,{id:"NXZdrO",message:"My pool share"}),children:In.jsx(i,{sx:{ml:4,px:8,py:4,borderRadius:4,typography:"h6",backgroundColor:"background.tag",color:"text.secondary"},children:Gs({input:null===(k=null===(w=n.liquidityPositions)||void 0===w?void 0:w[0])||void 0===k?void 0:k.poolShare})})})]})})}),u?In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4,color:"text.primary"},children:[In.jsx(Ov,{outOfRange:null!==(T=null==D?void 0:D.outOfRange)&&void 0!==T&&T}),In.jsx(i,{children:In.jsxs(In.Fragment,{children:[In.jsxs("span",{children:[Qy({price:null===(E=null==D?void 0:D.priceRange)||void 0===E?void 0:E.token0LowerPrice,atLimit:{},direction:dx.LOWER})," "]}),null==S?void 0:S.symbol]})}),In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",children:In.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"})}),In.jsx(i,{children:In.jsxs(In.Fragment,{children:[In.jsxs("span",{children:[Qy({price:null===(A=null==D?void 0:D.priceRange)||void 0===A?void 0:A.token0UpperPrice,atLimit:{},direction:dx.UPPER})," "]}),null==S?void 0:S.symbol]})})]})}):null,In.jsx(i,{component:"td",children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"8px"},children:[d&&"PMM"===F&&In.jsx(Fv,{chainId:I.chainId,address:I.id}),V?In.jsx(Bv,{text:V,onClick:()=>s(null)}):In.jsxs(In.Fragment,{children:[q?null:!!t&&In.jsxs(c,{variant:c.Variant.second,size:c.Size.small,onClick:e=>{e.stopPropagation(),s({operate:zv.Remove,pool:ed(n),hasMining:W})},sx:{py:0,height:32},children:[In.jsx(e,{id:"t/YqKh",message:"Remove"}),!!z&&In.jsx(yj,{isRightTop:!0})]}),In.jsx(c,{size:c.Size.small,onClick:()=>{s({pool:ed(n),hasMining:W})},sx:{py:0,height:32},children:q?le._({id:"wckWOP",message:"Manage"}):le._({id:"m16xKo",message:"Add"})})]})]})})]},q?null==D?void 0:D.id:I.id+I.chainId)}))})]})}function Dj({account:e,filterChainIds:t,activeChainId:n,handleChangeActiveChainId:o,operatePool:r,setOperatePool:s,getMigrationPairAndMining:l,tokenAndPoolFilter:d,children:c}){var u,p,h,m,g,f,x,y;const v=a(),{minDevice:b,isMobile:j}=Sd(),C=Ke(),{onlyChainId:w,supportAMMV2:k,supportAMMV3:T,notSupportPMM:E}=On(),[A,I]=H.useState("pmm&v2"),[S,L]=H.useState("1"),{filterTokens:O,filterASymbol:R,filterBSymbol:M,filterAddressLqList:_,handleDeleteToken:P,handleChangeFilterTokens:B,handleChangeFilterAddress:D}=Zv(d);let N=E?[]:["CLASSICAL","DVM","DSP","GSP","DPP"];k&&N.push("AMMV2"),T&&"v3"===A&&(N=["AMMV3"]);const F={currentPage:1,pageSize:1e3,user:e,filterState:{viewOnlyOwn:!0,filterTypes:N}},U=vd(),q=U.getQuery(me.graphql.fetchMyLiquidityList,{where:Object.assign(Object.assign({},F),{filterState:Object.assign({filterASymbol:R,filterBSymbol:M},F.filterState)})}),V=Qe(Object.assign({},q));let W=null!==(h=null===(p=null===(u=V.data)||void 0===u?void 0:u.liquidity_list)||void 0===p?void 0:p.lqList)&&void 0!==h?h:[];const Z=!!(null==_?void 0:_.length);return Z?W=[..._]:t&&(W=null!==(x=null===(f=null===(g=null===(m=V.data)||void 0===m?void 0:m.liquidity_list)||void 0===g?void 0:g.lqList)||void 0===f?void 0:f.filter((e=>{var n,i;return t.includes(null!==(i=null===(n=null==e?void 0:e.pair)||void 0===n?void 0:n.chainId)&&void 0!==i?i:0)})))&&void 0!==x?x:[]),In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{pt:12,pb:20,display:"flex",flexDirection:"column",gap:12,[v.breakpoints.up("tablet")]:{py:16,flexDirection:"row",gap:8,px:0,justifyContent:"space-between"}},children:[In.jsx(i,{sx:{[v.breakpoints.up("tablet")]:{mr:"auto"}},children:c}),!w&&In.jsx(fj,{chainId:n,setChainId:o}),T&&In.jsx(xj,{filterList:[{label:"V3",value:"v3"},{label:"V2 & PMM",value:"pmm&v2"}],value:A,onChange:e=>I(e)}),In.jsx(xj,{filterList:[{label:"1d",value:"1"},{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"}],value:S,onChange:e=>L(e)}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(i,{sx:Object.assign({flex:1,display:"flex",alignItems:"center",gap:8},j?{}:{"& > button":{flex:1}}),children:null!==(y=null==d?void 0:d.element)&&void 0!==y?y:In.jsx(Wv,{value:O,onChange:B,searchAddress:(e,t)=>bn(this,void 0,void 0,(function*(){var n;const i=U.getInfiniteQuery(me.graphql.fetchLiquidityList,"currentPage",{where:Object.assign(Object.assign({},F),{filterState:Object.assign({address:e},F.filterState)})}),o=null===(n=(yield C.fetchQuery(i)).liquidity_list)||void 0===n?void 0:n.lqList;return(null==o?void 0:o.length)?In.jsx(Hv,{list:o,onClick:()=>{D(o),t()}}):null}))})}),(Z||!!O.length)&&In.jsxs(i,{sx:{my:0},children:[Z?In.jsx(Dv,{lqList:_,onDeleteTag:()=>D([])}):"",In.jsx(Nv,{tags:O,onDeleteTag:P})]})]})]}),j?In.jsxs(_v,{children:[V.isLoading?In.jsx(qv,{}):"",!V.isLoading&&!(null==W?void 0:W.length)&&!V.error&&In.jsx(Mn,{sx:{mt:40},hasSearch:!!(n&&!w||R||M)}),!!V.error&&In.jsx(Nn,{refresh:V.refetch,sx:{mt:40}}),In.jsx(Pj,{account:e,lqList:W,setOperatePool:s,supportAMM:k||T,getMigrationPairAndMining:l,timeRange:S})]}):In.jsxs(In.Fragment,{children:[In.jsx(Bj,{account:e,lqList:W,loading:V.isLoading,operatePool:r,setOperatePool:s,supportAMM:k||T,onlyV3:"v3"===A,getMigrationPairAndMining:l,timeRange:S}),In.jsx(fg,{loading:V.isLoading,refetch:V.error?V.refetch:void 0,empty:!(null==W?void 0:W.length),hasSearch:!!(n&&!w||R||M)})]})]})}function Nj(e){var{sx:t}=e,n=vn(e,["sx"]);return In.jsx(L,{...n,sx:Object.assign(Object.assign({},t),{display:"flex",flexDirection:"column",overflow:"hidden"})})}function Fj({params:e,scrollRef:t,tokenAndPoolFilter:n,operatePool:o,onOperatePool:r,getMigrationPairAndMining:s}){var l,d,c;const{isMobile:u}=Sd();a();const p=On((e=>e.noDocumentLink)),h=H.useRef(null),{account:m}=hd(),{poolTopTab:g,normalPoolTab:f,almPoolTab:x,multiTokenPoolTab:y,normalTabs:v,almTabs:b,topTabs:j,multiTokenTabs:C,handleChangePoolTab:w}=function(){const[e,t]=$(Aj.NORMAL),[n,i]=$(Ij.ALL),[o,r]=$(Sj.addLiquidity),[a,s]=$(Lj.ALL),{supportAMMV2:l,supportAMMV3:d,notSupportPMM:c,supportCurve:u}=On(),p=Z((()=>{const e=[{key:Aj.NORMAL,value:"Normal"}];return u&&e.push({key:Aj.MULTI_TOKEN,value:"Multi-token"}),e}),[u]),h=Z((()=>[{key:Ij.ALL,value:"All vauls"},{key:Ij.MY,value:"My liquidity"}]),[]),m=Z((()=>{const e=[{key:Sj.addLiquidity,value:"Add Liquidity"},{key:Sj.myLiquidity,value:"My Liquidity"}];return c||e.push({key:Sj.myCreated,value:l||d?"My Pools (PMM)":"My Pools"}),e}),[l,d,c]),g=Z((()=>[{key:Lj.ALL,value:"All pools"},{key:Lj.MY,value:"My liquidity"}]),[]),f=G(!1);return Y((()=>{const e=sessionStorage.getItem(kj),n=sessionStorage.getItem(Tj);e&&n&&!f.current&&(f.current=!0,t(e),e===Aj.NORMAL?r(n):e===Aj.ALM?i(n):e===Aj.MULTI_TOKEN&&s(n))}),[]),{poolTopTab:e,normalPoolTab:o,almPoolTab:n,multiTokenPoolTab:a,topTabs:p,normalTabs:m,almTabs:h,multiTokenTabs:g,handleChangePoolTab:({topTab:e,poolTab:n})=>{t(e),e===Aj.NORMAL?r(n):e===Aj.ALM?i(n):e===Aj.MULTI_TOKEN&&s(n),sessionStorage.setItem(kj,e),sessionStorage.setItem(Tj,n)}}}(),{activeChainId:k,filterChainIds:T,handleChangeActiveChainId:E}=function(){const{chainId:e}=hd(),{onlyChainId:t,defaultChainId:n}=On(),[i,o]=H.useState(t),r=H.useMemo((()=>void 0!==i?[i]:ps(e)?void 0:Object.values(de).filter((e=>!!Number(e)))),[e,i]);return H.useEffect((()=>{const e=Number(sessionStorage.getItem(Ej));e&&o(e)}),[]),H.useEffect((()=>{!sessionStorage.getItem(Ej)&&n&&o(n)}),[n]),{activeChainId:i,filterChainIds:r,handleChangeActiveChainId:e=>{void 0===e?sessionStorage.removeItem(Ej):sessionStorage.setItem(Ej,String(e)),o(e)}}}(),[I,S]=H.useState({pool:Yv[0],type:zv.Remove}),[O,R]=H.useState(o||null),M=e=>{if(r){if(r(e))return}R(e)};return H.useEffect((()=>{R(o||null)}),[o]),In.jsxs(zf,{sx:Object.assign({},u?{p:0}:{display:"flex",gap:12,flex:1}),ref:h,children:[In.jsxs(A,{value:g,onChange:(e,t)=>{t===Aj.NORMAL?w({topTab:t,poolTab:f}):t===Aj.ALM?w({topTab:t,poolTab:x}):t===Aj.MULTI_TOKEN&&w({topTab:t,poolTab:y})},sx:u?{}:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",height:"max-content",maxHeight:"100%"},children:[In.jsxs(i,{sx:Object.assign({},u?void 0:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",pb:16,borderBottomWidth:1,borderBottomColor:"border.main",borderBottomStyle:"solid"}),children:[In.jsx(D,{tabs:j,variant:"default",tabsListSx:Object.assign({justifyContent:"space-between"},u?{mb:12,gap:32}:{borderBottomWidth:0}),tabSx:u?{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===Aj.NORMAL&&In.jsx(wj,{})]}),In.jsx(Nj,{value:Aj.ALM,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:"ALM"}),In.jsx(Nj,{value:Aj.NORMAL,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:In.jsxs(A,{value:f,onChange:(e,t)=>{w({topTab:Aj.NORMAL,poolTab:t})},children:[In.jsx(L,{value:Sj.addLiquidity,children:In.jsx(jj,{account:m,filterChainIds:T,scrollParentRef:null!=t?t:h,activeChainId:k,handleChangeActiveChainId:E,operatePool:O,setOperatePool:M,tokenAndPoolFilter:n,getMigrationPairAndMining:s,children:In.jsx(F,{tabs:v,variant:"inPaperContrast"})})}),In.jsx(L,{value:Sj.myLiquidity,children:In.jsx(Dj,{account:m,filterChainIds:T,activeChainId:k,handleChangeActiveChainId:E,operatePool:O,setOperatePool:M,tokenAndPoolFilter:n,getMigrationPairAndMining:s,children:In.jsx(F,{tabs:v,variant:"inPaperContrast"})})}),In.jsx(L,{value:Sj.myCreated,children:In.jsx(_j,{account:m,filterChainIds:T,activeChainId:k,handleChangeActiveChainId:E,operatePool:O,setOperatePool:M,children:In.jsx(F,{tabs:v,variant:"inPaperContrast"})})}),!p&&In.jsx(Yf,{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},u&&{mt:20})})]})}),In.jsx(Nj,{value:Aj.MULTI_TOKEN,sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:In.jsxs(A,{value:y,onChange:(e,t)=>{w({topTab:Aj.MULTI_TOKEN,poolTab:t})},children:[In.jsx(L,{value:Lj.ALL,children:In.jsx(Kv,{filterChainIds:T,scrollParentRef:null!=t?t:h,activeChainId:k,operateCurvePool:I,setOperateCurvePool:S,tokenAndPoolFilter:n,children:In.jsx(F,{tabs:C,variant:"inPaperContrast"})})}),In.jsx(L,{value:Lj.MY,children:In.jsx(Kv,{filterChainIds:T,scrollParentRef:null!=t?t:h,activeChainId:k,operateCurvePool:I,setOperateCurvePool:S,tokenAndPoolFilter:n,children:In.jsx(F,{tabs:C,variant:"inPaperContrast"})})})]})})]}),g===Aj.NORMAL&&O&&In.jsx(i,{sx:{position:"relative",width:u?"100%":375},children:"AMMV3"===(null===(l=null==O?void 0:O.pool)||void 0===l?void 0:l.type)&&O.pool.chainId?f===Sj.myLiquidity&&(null===(c=null===(d=O.pool.liquidityPositions)||void 0===d?void 0:d[0])||void 0===c?void 0:c.tokenId)?In.jsx(Lv,{baseToken:O.pool.baseToken,quoteToken:O.pool.quoteToken,feeAmount:Number(O.pool.lpFeeRate),tokenId:O.pool.liquidityPositions[0].tokenId,chainId:O.pool.chainId,onClose:()=>M(null)}):In.jsx(Mv,{chainId:O.pool.chainId,baseToken:O.pool.baseToken,quoteToken:O.pool.quoteToken,feeAmount:Number(O.pool.lpFeeRate),onClose:()=>M(null),handleGoToAddLiquidityV3:e=>{Gf.getState().push({type:$f.createPoolAMMV3,params:e})}}):In.jsx(In.Fragment,{children:u?In.jsx(sj,{account:m,onClose:()=>M(null),modal:u,...O}):In.jsx(aj,{account:m,onClose:()=>M(null),...O,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"}})})}),g===Aj.MULTI_TOKEN&&I&&In.jsx(i,{sx:{position:"relative",width:u?"100%":375},children:In.jsx(ab,{operateCurvePool:I,setOperateCurvePool:S})})]})}function Uj({sx:e,onClick:t}){const n=a();return In.jsx(r,{onClick:()=>{t?t():Gf.getState().back()},sx:ne({display:"inline-flex",alignItems:"center",cursor:"pointer"},e),children:In.jsx(i,{sx:{color:n.palette.text.secondary,width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",borderColor:n.palette.border.main,borderStyle:"solid",borderWidth:1,borderRadius:8,backgroundColor:n.palette.background.paper},children:In.jsx(Un.ArrowBack,{})})})}var qj,Vj,Wj,Hj,Zj,zj,$j,Gj,Yj,Qj,Xj,Kj,Jj;function eC(){return eC=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},eC.apply(null,arguments)}const tC=e=>W.createElement("svg",eC({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),qj||(qj=W.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_5229_28889)"})),Vj||(Vj=W.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_5229_28889)"})),Wj||(Wj=W.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_5229_28889)"})),Hj||(Hj=W.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_5229_28889)"})),Zj||(Zj=W.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_5229_28889)"})),zj||(zj=W.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28889)"})),$j||($j=W.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_5229_28889)"})),Gj||(Gj=W.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_5229_28889)"})),Yj||(Yj=W.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_5229_28889)"})),Qj||(Qj=W.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_5229_28889)"})),Xj||(Xj=W.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_5229_28889)"})),Kj||(Kj=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28889)"})),Jj||(Jj=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5229_28889",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint1_linear_5229_28889",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint2_linear_5229_28889",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint3_linear_5229_28889",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint4_linear_5229_28889",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint5_linear_5229_28889",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint6_linear_5229_28889",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint7_linear_5229_28889",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint8_linear_5229_28889",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint9_linear_5229_28889",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint10_linear_5229_28889",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint11_linear_5229_28889",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var nC,iC,oC,rC,aC,sC,lC,dC,cC,uC,pC,hC,mC;function gC(){return gC=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},gC.apply(null,arguments)}const fC=e=>W.createElement("svg",gC({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),nC||(nC=W.createElement("rect",{x:28.5,y:214,width:40,height:6,fill:"url(#paint0_linear_3900_354238)"})),iC||(iC=W.createElement("rect",{x:88.5,y:208,width:40,height:12,fill:"url(#paint1_linear_3900_354238)"})),oC||(oC=W.createElement("rect",{x:148.5,y:201,width:40,height:19,fill:"url(#paint2_linear_3900_354238)"})),rC||(rC=W.createElement("rect",{x:208.5,y:188,width:40,height:32,fill:"url(#paint3_linear_3900_354238)"})),aC||(aC=W.createElement("rect",{x:268.5,y:170,width:40,height:50,fill:"url(#paint4_linear_3900_354238)"})),sC||(sC=W.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_3900_354238)"})),lC||(lC=W.createElement("rect",{width:40,height:6,transform:"matrix(-1 0 0 1 708.5 214)",fill:"url(#paint6_linear_3900_354238)"})),dC||(dC=W.createElement("rect",{width:40,height:12,transform:"matrix(-1 0 0 1 648.5 208)",fill:"url(#paint7_linear_3900_354238)"})),cC||(cC=W.createElement("rect",{width:40,height:19,transform:"matrix(-1 0 0 1 588.5 201)",fill:"url(#paint8_linear_3900_354238)"})),uC||(uC=W.createElement("rect",{width:40,height:32,transform:"matrix(-1 0 0 1 528.5 188)",fill:"url(#paint9_linear_3900_354238)"})),pC||(pC=W.createElement("rect",{width:40,height:50,transform:"matrix(-1 0 0 1 468.5 170)",fill:"url(#paint10_linear_3900_354238)"})),hC||(hC=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_3900_354238)"})),mC||(mC=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_3900_354238",x1:48.5,y1:214,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint1_linear_3900_354238",x1:108.5,y1:208,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint2_linear_3900_354238",x1:168.5,y1:201,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint3_linear_3900_354238",x1:228.5,y1:188,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint4_linear_3900_354238",x1:288.5,y1:170,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint5_linear_3900_354238",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint6_linear_3900_354238",x1:20,y1:0,x2:20,y2:6,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint7_linear_3900_354238",x1:20,y1:0,x2:20,y2:12,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint8_linear_3900_354238",x1:20,y1:0,x2:20,y2:19,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint9_linear_3900_354238",x1:20,y1:0,x2:20,y2:32,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint10_linear_3900_354238",x1:20,y1:0,x2:20,y2:50,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint11_linear_3900_354238",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var xC,yC,vC,bC,jC,CC,wC,kC,TC,EC,AC,IC,SC,LC;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=>W.createElement("svg",OC({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xC||(xC=W.createElement("g",{clipPath:"url(#clip0_5057_344879)"},W.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344879)"}),W.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344879)"}),W.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344879)"}),W.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344879)"}),W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344879)"}),W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344879)"}),W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344879)"}),W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344879)"}),W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344879)"}),W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344879)"}))),yC||(yC=W.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344879)"})),vC||(vC=W.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344879)"})),bC||(bC=W.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344879)"})),jC||(jC=W.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344879)"})),CC||(CC=W.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344879)"})),wC||(wC=W.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344879)"})),kC||(kC=W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344879)"})),TC||(TC=W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344879)"})),EC||(EC=W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344879)"})),AC||(AC=W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344879)"})),IC||(IC=W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344879)"})),SC||(SC=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344879)"})),LC||(LC=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5057_344879",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint1_linear_5057_344879",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint2_linear_5057_344879",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint3_linear_5057_344879",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint4_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint5_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint6_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint7_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint8_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint9_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"white",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})),W.createElement("linearGradient",{id:"paint10_linear_5057_344879",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint11_linear_5057_344879",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint12_linear_5057_344879",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint13_linear_5057_344879",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint14_linear_5057_344879",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint15_linear_5057_344879",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#D0BCFF",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#D0BCFF",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint16_linear_5057_344879",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint17_linear_5057_344879",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint18_linear_5057_344879",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint19_linear_5057_344879",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint20_linear_5057_344879",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint21_linear_5057_344879",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("clipPath",{id:"clip0_5057_344879"},W.createElement("rect",{width:737,height:220,fill:"white"})))));var MC,_C,PC,BC,DC,NC,FC,UC,qC,VC,WC,HC,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=>W.createElement("svg",$C({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),MC||(MC=W.createElement("g",{clipPath:"url(#clip0_5057_344817)"},W.createElement("rect",{x:-10.5,y:160,width:40,height:60,fill:"url(#paint0_linear_5057_344817)"}),W.createElement("rect",{x:49.5,y:120,width:40,height:100,fill:"url(#paint1_linear_5057_344817)"}),W.createElement("rect",{x:109.5,y:60,width:40,height:160,fill:"url(#paint2_linear_5057_344817)"}),W.createElement("rect",{x:169.5,width:40,height:220,fill:"url(#paint3_linear_5057_344817)"}),W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 549.5 200)",fill:"url(#paint4_linear_5057_344817)"}),W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 489.5 180)",fill:"url(#paint5_linear_5057_344817)"}),W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 429.5 160)",fill:"url(#paint6_linear_5057_344817)"}),W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 369.5 120)",fill:"url(#paint7_linear_5057_344817)"}),W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 309.5 60)",fill:"url(#paint8_linear_5057_344817)"}),W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 249.5 0)",fill:"url(#paint9_linear_5057_344817)"}))),_C||(_C=W.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint10_linear_5057_344817)"})),PC||(PC=W.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint11_linear_5057_344817)"})),BC||(BC=W.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint12_linear_5057_344817)"})),DC||(DC=W.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint13_linear_5057_344817)"})),NC||(NC=W.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint14_linear_5057_344817)"})),FC||(FC=W.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint15_linear_5057_344817)"})),UC||(UC=W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint16_linear_5057_344817)"})),qC||(qC=W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint17_linear_5057_344817)"})),VC||(VC=W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint18_linear_5057_344817)"})),WC||(WC=W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint19_linear_5057_344817)"})),HC||(HC=W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint20_linear_5057_344817)"})),ZC||(ZC=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint21_linear_5057_344817)"})),zC||(zC=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5057_344817",x1:9.5,y1:160,x2:9.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint1_linear_5057_344817",x1:69.5,y1:120,x2:69.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint2_linear_5057_344817",x1:129.5,y1:60,x2:129.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint3_linear_5057_344817",x1:189.5,y1:0,x2:189.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint4_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint5_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint6_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint7_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint8_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint9_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#1A1A1B",stopOpacity:.1}),W.createElement("stop",{offset:1,stopColor:"#1A1A1B",stopOpacity:0})),W.createElement("linearGradient",{id:"paint10_linear_5057_344817",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint11_linear_5057_344817",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint12_linear_5057_344817",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint13_linear_5057_344817",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint14_linear_5057_344817",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint15_linear_5057_344817",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint16_linear_5057_344817",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint17_linear_5057_344817",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint18_linear_5057_344817",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint19_linear_5057_344817",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint20_linear_5057_344817",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint21_linear_5057_344817",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("clipPath",{id:"clip0_5057_344817"},W.createElement("rect",{width:737,height:220,fill:"white"})))));var YC,QC,XC,KC,JC,ew,tw,nw,iw,ow,rw,aw,sw;function lw(){return lw=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},lw.apply(null,arguments)}const dw=e=>W.createElement("svg",lw({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),YC||(YC=W.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),QC||(QC=W.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),XC||(XC=W.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),KC||(KC=W.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),JC||(JC=W.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),ew||(ew=W.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"white",fillOpacity:.1})),tw||(tw=W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_5229_28865)"})),nw||(nw=W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_5229_28865)"})),iw||(iw=W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_5229_28865)"})),ow||(ow=W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_5229_28865)"})),rw||(rw=W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_5229_28865)"})),aw||(aw=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_5229_28865)"})),sw||(sw=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5229_28865",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint1_linear_5229_28865",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint2_linear_5229_28865",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint3_linear_5229_28865",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint4_linear_5229_28865",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint5_linear_5229_28865",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var cw,uw,pw,hw,mw,gw,fw,xw,yw,vw,bw,jw,Cw;function ww(){return ww=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},ww.apply(null,arguments)}const kw=e=>W.createElement("svg",ww({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),cw||(cw=W.createElement("rect",{x:28.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),uw||(uw=W.createElement("rect",{x:88.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),pw||(pw=W.createElement("rect",{x:148.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),hw||(hw=W.createElement("rect",{x:208.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),mw||(mw=W.createElement("rect",{x:268.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),gw||(gw=W.createElement("rect",{x:328.5,y:216,width:40,height:4,fill:"#1A1A1B",fillOpacity:.1})),fw||(fw=W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint0_linear_3900_354262)"})),xw||(xw=W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint1_linear_3900_354262)"})),yw||(yw=W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint2_linear_3900_354262)"})),vw||(vw=W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint3_linear_3900_354262)"})),bw||(bw=W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint4_linear_3900_354262)"})),jw||(jw=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint5_linear_3900_354262)"})),Cw||(Cw=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_3900_354262",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint1_linear_3900_354262",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint2_linear_3900_354262",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint3_linear_3900_354262",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint4_linear_3900_354262",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint5_linear_3900_354262",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var Tw,Ew,Aw,Iw,Sw,Lw,Ow,Rw,Mw,_w,Pw,Bw,Dw;function Nw(){return Nw=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},Nw.apply(null,arguments)}const Fw=e=>W.createElement("svg",Nw({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Tw||(Tw=W.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_5229_28987)"})),Ew||(Ew=W.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_5229_28987)"})),Aw||(Aw=W.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_5229_28987)"})),Iw||(Iw=W.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_5229_28987)"})),Sw||(Sw=W.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_5229_28987)"})),Lw||(Lw=W.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_5229_28987)"})),Ow||(Ow=W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_5229_28987)"})),Rw||(Rw=W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_5229_28987)"})),Mw||(Mw=W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_5229_28987)"})),_w||(_w=W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_5229_28987)"})),Pw||(Pw=W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_5229_28987)"})),Bw||(Bw=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_5229_28987)"})),Dw||(Dw=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5229_28987",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint1_linear_5229_28987",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint2_linear_5229_28987",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint3_linear_5229_28987",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint4_linear_5229_28987",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint5_linear_5229_28987",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#B786FD",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#B786FD",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint6_linear_5229_28987",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint7_linear_5229_28987",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint8_linear_5229_28987",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint9_linear_5229_28987",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint10_linear_5229_28987",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint11_linear_5229_28987",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FFE804",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#FFE804",stopOpacity:.04})))));var Uw,qw,Vw,Ww,Hw,Zw,zw,$w,Gw,Yw,Qw,Xw,Kw;function Jw(){return Jw=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},Jw.apply(null,arguments)}const ek=e=>W.createElement("svg",Jw({width:737,height:220,viewBox:"0 0 737 220",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Uw||(Uw=W.createElement("rect",{x:28.5,y:200,width:40,height:20,fill:"url(#paint0_linear_4437_25449)"})),qw||(qw=W.createElement("rect",{x:88.5,y:180,width:40,height:40,fill:"url(#paint1_linear_4437_25449)"})),Vw||(Vw=W.createElement("rect",{x:148.5,y:160,width:40,height:60,fill:"url(#paint2_linear_4437_25449)"})),Ww||(Ww=W.createElement("rect",{x:208.5,y:120,width:40,height:100,fill:"url(#paint3_linear_4437_25449)"})),Hw||(Hw=W.createElement("rect",{x:268.5,y:60,width:40,height:160,fill:"url(#paint4_linear_4437_25449)"})),Zw||(Zw=W.createElement("rect",{x:328.5,width:40,height:220,fill:"url(#paint5_linear_4437_25449)"})),zw||(zw=W.createElement("rect",{width:40,height:20,transform:"matrix(-1 0 0 1 708.5 200)",fill:"url(#paint6_linear_4437_25449)"})),$w||($w=W.createElement("rect",{width:40,height:40,transform:"matrix(-1 0 0 1 648.5 180)",fill:"url(#paint7_linear_4437_25449)"})),Gw||(Gw=W.createElement("rect",{width:40,height:60,transform:"matrix(-1 0 0 1 588.5 160)",fill:"url(#paint8_linear_4437_25449)"})),Yw||(Yw=W.createElement("rect",{width:40,height:100,transform:"matrix(-1 0 0 1 528.5 120)",fill:"url(#paint9_linear_4437_25449)"})),Qw||(Qw=W.createElement("rect",{width:40,height:160,transform:"matrix(-1 0 0 1 468.5 60)",fill:"url(#paint10_linear_4437_25449)"})),Xw||(Xw=W.createElement("rect",{width:40,height:220,transform:"matrix(-1 0 0 1 408.5 0)",fill:"url(#paint11_linear_4437_25449)"})),Kw||(Kw=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_4437_25449",x1:48.5,y1:200,x2:48.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint1_linear_4437_25449",x1:108.5,y1:180,x2:108.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint2_linear_4437_25449",x1:168.5,y1:160,x2:168.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint3_linear_4437_25449",x1:228.5,y1:120,x2:228.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint4_linear_4437_25449",x1:288.5,y1:60,x2:288.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint5_linear_4437_25449",x1:348.5,y1:0,x2:348.5,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#6851B4",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#6851B4",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint6_linear_4437_25449",x1:20,y1:0,x2:20,y2:20,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint7_linear_4437_25449",x1:20,y1:0,x2:20,y2:40,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint8_linear_4437_25449",x1:20,y1:0,x2:20,y2:60,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint9_linear_4437_25449",x1:20,y1:0,x2:20,y2:100,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint10_linear_4437_25449",x1:20,y1:0,x2:20,y2:160,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})),W.createElement("linearGradient",{id:"paint11_linear_4437_25449",x1:20,y1:0,x2:20,y2:220,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EB8D27",stopOpacity:.6}),W.createElement("stop",{offset:1,stopColor:"#EB8D27",stopOpacity:.04})))));var tk,nk;function ik(){const e="https://docs.dodoex.io/product/tutorial/how-to-create-pools#learn-more-about-the-characteristics-of-different-pool-models",t=[{version:nk.standard,title:le._({id:"TJBHlP",message:"Standard"}),description:le._({id:"QNrpkx",message:"Classical AMM-like pool. Suitable for most assets."}),exampleImgUrl:ek,exampleDarkImgUrl:Fw,docUrl:e,initPriceLabel:le._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:le._({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:nk.pegged,title:le._({id:"J7M/DA",message:"Pegged"}),description:le._({id:"RvYEUJ",message:"Suitable for synthetic assets. The liquidity is super concentrated at some price like Curve Finance."}),exampleImgUrl:fC,exampleDarkImgUrl:tC,docUrl:e,initPriceLabel:le._({id:"4ogEAw",message:"Pegged Exchange Rate"}),initPriceTips:le._({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:nk.singleToken,title:le._({id:"34w3mT",message:"Single-Token"}),description:le._({id:"a1AzKr",message:"For those who are looking to sell tokens and only need ask-side liquidity."}),exampleImgUrl:kw,exampleDarkImgUrl:dw,docUrl:e,initPriceLabel:le._({id:"d2CZvA",message:"Initial Price"}),initPriceTips:le._({id:"HGf8fG",message:"You can set the minimum selling price for single-token pools."})},{version:nk.marketMakerPool,title:le._({id:"4vKwIV",message:"Private Pool"}),description:le._({id:"pKjCsP",message:"100% use your own funds and enjoy the maximum degree of flexibility."}),exampleImgUrl:GC,exampleDarkImgUrl:RC,docUrl:e,initPriceLabel:le._({id:"CeLrge",message:"Mid Price"}),initPriceTips:le._({id:"GGPOuT",message:"set current mid price"})}],n=t.reduce(((e,t)=>(e[t.version]=t,e)),{});return{versionList:t,versionMap:n,subPeggedVersionList:ok()}}function ok(){return[{version:tk.DSP,title:le._({id:"D1bhHv",message:"The pool’s market-making price is fixed"}),description:le._({id:"lgE483",message:"Once created, the price cannot be changed. This option applies to assets like ETH-WETH."})},{version:tk.GSP,title:le._({id:"LVzIav",message:"The pool’s market-making price can be adjusted"}),description:le._({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 rk(){return ok().reduce(((e,t)=>(e[t.version]=t,e)),{})}!function(e){e.DSP="dsp",e.GSP="gsp"}(tk||(tk={})),function(e){e.standard="standard",e.singleToken="single-token",e.pegged="pagged",e.marketMakerPool="market-maker-pool"}(nk||(nk={}));const ak="0.3",sk=.01,lk=10,dk="1",ck="0.0000000000001",uk=1e8,pk="1",hk="0.0001",mk="0.1",gk=8;function fk({selectedVersion:e,quoteToken:t,initPrice:n,midPrice:i}){return e===nk.standard?!i||i.isZero()?null:Ps({input:i,decimals:t.decimals}):Ps({input:n,decimals:t.decimals})}function xk({initPrice:e}){const t=new Le(e);if(!t.isFinite()||t.lte(0))return{base:null,quote:null};const n=new Le(1),i=n.dividedBy(n.plus(t)).dp(gk,Le.ROUND_DOWN);return{base:i,quote:n.minus(i).dp(gk,Le.ROUND_DOWN)}}function yk({chainId:e,baseToken:t,quoteToken:n}){const i=ve[e];return!(!t||!n)&&(!(!id(t.address,i.address)||!id(n.address,i.wrappedTokenAddress))||!(!id(t.address,i.wrappedTokenAddress)||!id(n.address,i.address)))}function vk({title:e,children:t,isWaiting:n}){const o=a();return In.jsxs(i,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:n?"-":t}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:e})]})}function bk({status:t,selectedVersion:n,baseToken:o,quoteToken:r,initPrice:a,slippageCoefficient:s,midPrice:l,sx:d}){var c;const{versionMap:u}=ik(),p="waiting"===t,{initPriceLabel:h}=u[n];return o&&r?In.jsx(In.Fragment,{children:In.jsxs(i,{sx:Object.assign({mt:0,display:"flex",alignItems:"stretch",gap:12,opacity:p?.5:1},d),children:[In.jsxs(vk,{title:In.jsx(e,{id:"fSFt4a",message:"Token Pair"}),isWaiting:p,children:[In.jsx(gg,{width:24,height:24,tokens:[o,r]}),o.symbol,"-",r.symbol]}),In.jsx(vk,{title:In.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:p,children:s}),In.jsxs(vk,{title:h,isWaiting:p,children:["1 ",o.symbol," = ",null!==(c=fk({midPrice:l,quoteToken:r,selectedVersion:n,initPrice:a}))&&void 0!==c?c:"-"," ",r.symbol]})]})}):null}var jk,Ck;function wk(){return wk=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},wk.apply(null,arguments)}const kk=e=>W.createElement("svg",wk({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),jk||(jk=W.createElement("g",{clipPath:"url(#clip0_5251_29079)"},W.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)"}),W.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"}),W.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)"}),W.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"}))),Ck||(Ck=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5251_29079",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#EC5A7D",stopOpacity:.3}),W.createElement("stop",{offset:1,stopColor:"#EC5A7D",stopOpacity:0})),W.createElement("linearGradient",{id:"paint1_linear_5251_29079",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#2FBA90",stopOpacity:.3}),W.createElement("stop",{offset:1,stopColor:"#2FBA90",stopOpacity:0})),W.createElement("clipPath",{id:"clip0_5251_29079"},W.createElement("rect",{width:54,height:32,fill:"white"})))));var Tk,Ek;function Ak(){return Ak=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},Ak.apply(null,arguments)}const Ik=e=>W.createElement("svg",Ak({width:54,height:32,viewBox:"0 0 54 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Tk||(Tk=W.createElement("g",{clipPath:"url(#clip0_5251_28999)"},W.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)"}),W.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"}),W.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)"}),W.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"}))),Ek||(Ek=W.createElement("defs",null,W.createElement("linearGradient",{id:"paint0_linear_5251_28999",x1:54.0001,y1:5.72231,x2:54.0001,y2:31.0514,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#FF6187",stopOpacity:.3}),W.createElement("stop",{offset:1,stopColor:"#FF6187",stopOpacity:0})),W.createElement("linearGradient",{id:"paint1_linear_5251_28999",x1:-10303e-8,y1:5.72231,x2:-10372e-8,y2:31.0514,gradientUnits:"userSpaceOnUse"},W.createElement("stop",{stopColor:"#55F9C7",stopOpacity:.3}),W.createElement("stop",{offset:1,stopColor:"#55F9C7",stopOpacity:0})),W.createElement("clipPath",{id:"clip0_5251_28999"},W.createElement("rect",{width:54,height:32,fill:"white"})))));function Sk({height:e,text:t}){return In.jsx(Mn,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:e||261},emptyText:t||le._({id:"uiuMDr",message:"Enter parameters to view the yield curve"})})}const Lk=H.lazy((()=>import("./index-z7Nn7GL4.js"))),Ok=H.lazy((()=>import("./index-BgEhIZm4.js")));var Rk,Mk;function _k({baseToken:t,quoteToken:n,pmmParams:o,pmmModel:r,midPrice:s}){var l,d;const c=a(),{isMobile:u}=Sd(),[p,h]=H.useState(Rk.depth),m=H.useRef(null),[g,f]=H.useState(0),x=null!==(l=null==t?void 0:t.symbol)&&void 0!==l?l:"",y=null!==(d=null==n?void 0:n.symbol)&&void 0!==d?d:"";H.useEffect((()=>{const e=()=>{m&&m.current&&f(m.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[m,s]);const v=p===Rk.depth;if(!s||s.isNaN())return In.jsx(Sk,{height:u?261:v?665:494});const b=c.palette.success.main,j=c.palette.error.main,C=[{key:Rk.liquidity,value:le._({id:"6y2TB3",message:"Liquidity"})},{key:Rk.depth,value:le._({id:"n25Lml",message:"Depth"})}];return In.jsxs(i,{ref:m,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:[In.jsxs(A,{value:p,onChange:(e,t)=>{h(t)},children:[In.jsx(F,{tabs:C,variant:"tag",tabsListSx:{ml:"auto"}}),In.jsx(i,{sx:Object.assign({typography:"h6",mt:8,mb:14,color:"text.secondary"},u?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:In.jsx(e,{id:"tyGEMJ",message:"Amounts"})}),In.jsx(L,{value:Rk.depth,children:g&&In.jsx(H.Suspense,{children:In.jsx(Lk,{width:g,height:u?261:364,chartId:"create-pool-depth-chart",baseTokenSymbol:x,quoteTokenSymbol:y,pmmModel:r,pmmParams:o,midPrice:s,colorMap:{grid:"light"===c.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===c.palette.mode?"#E4E4E4":void 0,leftBg:[0,T(b,.04),1,T(b,.3)],leftLine:b,rightBg:[0,T(j,.04),1,T(j,.3)],rightLine:j,tooltipBg:c.palette.background.paperContrast,tooltipColor:c.palette.text.primary},notShowAmountInput:u})})}),In.jsx(L,{value:Rk.liquidity,children:In.jsx(H.Suspense,{children:In.jsx(Ok,{width:g,height:u?261:364,baseTokenSymbol:x,quoteTokenSymbol:y,pmmModel:r,pmmParams:o,midPrice:s,notShowTipText:!0,colorMap:{grid:"light"===c.palette.mode?"#E4E4E4":void 0,midPriceLine:"light"===c.palette.mode?"#E4E4E4":void 0,leftBg:[0,T(b,.04),1,T(b,.3)],leftLine:b,rightBg:[0,T(j,.04),1,T(j,.3)],rightLine:j,tooltipBg:c.palette.background.paperContrast,tooltipColor:c.palette.text.primary,textColor:c.palette.text.secondary}})})})]}),In.jsx(i,{sx:Object.assign({typography:"h6",mt:6,color:"text.secondary"},u?{transform:"scale(0.66667)",transformOrigin:"top left"}:{}),children:In.jsx(e,{id:"DZULmp",message:"Swap Rate"})}),v?"":In.jsxs(i,{sx:{typography:"h6",mt:24,color:"text.secondary",textAlign:"center"},children:["* ",le._({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:x}})]})]})}!function(e){e[e.liquidity=1]="liquidity",e[e.depth=2]="depth"}(Rk||(Rk={})),function(e){e[e.standard=1]="standard",e[e.singleToken=2]="singleToken",e[e.pagged=3]="pagged",e[e.marketMaker=4]="marketMaker"}(Mk||(Mk={}));const Pk=({selectedVersion:e,baseAmount:t,quoteAmount:n,initPrice:i,slippageCoefficient:o})=>{const r=Z((()=>{const r=[nk.standard,nk.singleToken].includes(e),a=e===nk.singleToken;if(!t||!a&&!n)return;const s=Number(i),l=Number(t),d=Number(n),c=Number(o);return{i:s,k:c,b:l,b0:l,q:d,q0:0!==c&&r?0:d,R:0!==c&&r?1:0}}),[t,i,n,e,o]),a=Z((()=>{if(r)return Ae(r)}),[r]),s=Z((()=>{if(a)return a.getMidPrice()}),[a]);return{pmmParams:r,pmmModel:a,midPrice:s}};function Bk({selectedVersion:e,baseToken:t,quoteToken:n,initPrice:o,slippageCoefficient:r,baseAmount:s,quoteAmount:l}){const c=a(),{isMobile:u}=Sd(),[p,h]=H.useState(!1),{pmmParams:m,pmmModel:g,midPrice:x}=Pk({selectedVersion:e,baseAmount:s,quoteAmount:l,initPrice:o,slippageCoefficient:r});if(!u)return null;const y=le._({id:"FQfStS",message:"Emulator"}),v=le._({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 In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{mx:20,mb:8},children:In.jsxs(i,{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:d,onClick:()=>h(!0),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:c.palette.text.secondary,typography:"body1",fontWeight:600},children:[y,In.jsx(f,{title:v,ml:4,sx:{width:14,height:14}})]}),!x||x.isNaN()?In.jsx(i,{sx:{py:5,typography:"body1"},children:"-"}):"light"===c.palette.mode?In.jsx(kk,{width:"52",height:"32"}):In.jsx(Ik,{width:"52",height:"32"})]})}),In.jsx(Rc,{open:p,onClose:()=>h(!1),modal:!0,title:In.jsxs(i,{children:[y,In.jsx(f,{title:v,ml:4})]}),children:In.jsx(i,{sx:{px:28,pb:20,maxHeight:"calc(80vh - 134px)",overflowY:"auto",overflowX:"hidden"},children:In.jsx(_k,{baseToken:t,quoteToken:n,pmmParams:m,pmmModel:g,midPrice:x})})})]})}function Dk({color:e,backgroundColor:t,tagKey:n}){return In.jsx(i,{sx:{ml:8,px:8,py:2,borderRadius:4,backgroundColor:t,color:e,typography:"h6",fontWeight:500},children:n})}function Nk({isWaiting:t,feeRate:n}){const o=a();return In.jsxs(i,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,width:"50%",opacity:t?.5:1},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":In.jsxs(In.Fragment,{children:[n||"-","%",n===ak&&In.jsx(Dk,{tagKey:le._({id:"/+c6tU",message:"99% Default"}),color:o.palette.purple.main,backgroundColor:T(o.palette.purple.main,.1)})]})}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:In.jsx(e,{id:"Y7rVy0",message:"Fee Rate"})})]})}function Fk({isWaiting:t,selectedVersion:n,baseToken:o,quoteToken:r,initPrice:s,slippageCoefficient:l,baseAmount:d,quoteAmount:c,peggedBaseTokenRatio:u,peggedQuoteTokenRatio:p}){const h=a(),{pmmParams:m,pmmModel:g,midPrice:f}=Pk({selectedVersion:n,baseAmount:d,quoteAmount:c,initPrice:s,slippageCoefficient:l});return In.jsxs(In.Fragment,{children:[!t&&In.jsx(_k,{baseToken:o,quoteToken:r,pmmParams:m,pmmModel:g,midPrice:f}),In.jsxs(i,{sx:{mt:t?0:20,padding:16,borderRadius:8,backgroundColor:h.palette.background.paper,width:"50%",opacity:t?.5:1},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":In.jsxs(In.Fragment,{children:[u,"% ",null==o?void 0:o.symbol," : ",p,"% ",null==r?void 0:r.symbol]})}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:h.palette.text.secondary,mt:8},children:In.jsx(e,{id:"eK0eiF",message:"Initial asset ratio"})})]})]})}function Uk({title:e,children:t,isWaiting:n}){const o=a();return In.jsxs(i,{sx:{padding:16,borderRadius:8,backgroundColor:o.palette.background.paper,flexGrow:1,flexBasis:"100%"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:8,typography:"h5"},children:n?"-":t}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:o.palette.text.secondary,mt:8},children:e})]})}function qk({status:e,selectedVersion:t,baseToken:n,quoteToken:o,initPrice:r,slippageCoefficient:a,baseAmount:s,quoteAmount:l}){var d;const{pmmParams:c,pmmModel:u,midPrice:p}=Pk({selectedVersion:t,baseAmount:s,quoteAmount:l,initPrice:r,slippageCoefficient:a}),{versionMap:h}=ik(),m="waiting"===e,{initPriceLabel:g}=h[t];return In.jsxs(In.Fragment,{children:["running"===e&&In.jsx(_k,{baseToken:n,quoteToken:o,pmmParams:c,pmmModel:u,midPrice:p}),In.jsxs(i,{sx:{mt:20,display:"flex",alignItems:"stretch",gap:12,opacity:m?.5:1},children:[In.jsx(Uk,{title:le._({id:"fSFt4a",message:"Token Pair"}),isWaiting:m,children:n&&o?In.jsxs(In.Fragment,{children:[In.jsx(gg,{width:24,tokens:[n,o],chainId:n.chainId}),n.symbol,"-",o.symbol]}):""}),In.jsx(Uk,{title:g,isWaiting:m,children:n&&o?In.jsxs(In.Fragment,{children:["1 ",n.symbol,"=",null!==(d=fk({midPrice:p,quoteToken:o,selectedVersion:t,initPrice:r}))&&void 0!==d?d:"-"," ",o.symbol]}):""}),In.jsx(Uk,{title:le._({id:"sjn3tj",message:"Slippage Coefficient"}),isWaiting:m,children:a})]})]})}function Vk({isWaiting:t,selectedSubPeggedVersion:n}){var o,r;const s=a(),l=rk();return In.jsxs(i,{sx:{padding:16,borderRadius:8,backgroundColor:s.palette.background.paper,width:"50%",opacity:t?.5:1},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"h5",fontWeight:600},children:t?"-":n&&null!==(r=null===(o=l[n])||void 0===o?void 0:o.title)&&void 0!==r?r:"-"}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,color:s.palette.text.secondary,mt:8},children:In.jsx(e,{id:"XPiFIY",message:"Can the pool price be adjusted?"})})]})}function Wk({index:e,titleKey:t,status:n}){const o=a(),{isMobile:r}=Sd();return In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:Object.assign({mt:28,mb:28,borderTopColor:"border.main",borderTopStyle:"solid",borderTopWidth:1},r?{mt:12,mb:12,display:1===e?"none":"block"}:{})}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",mb:20},children:[In.jsx(i,{sx:{display:"flex",width:"20px",height:"20px",justifyContent:"center",alignItems:"center",flexShrink:0,borderRadius:"50%",backgroundColor:"waiting"===n?o.palette.background.paperDarkContrast:o.palette.secondary.main,typography:"h6",fontWeight:600,textAlign:"center",color:"waiting"===n?o.palette.text.disabled:o.palette.secondary.contrastText},children:"completed"===n?In.jsx(In.Fragment,{children:In.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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}),In.jsx(i,{sx:{ml:8,typography:"body1",fontWeight:600,color:"waiting"===n?o.palette.text.disabled:o.palette.text.primary},children:t})]})]})}function Hk({currentStep:e,isPeggedVersion:t}){const n=a(),{isMobile:o}=Sd();let r="",s="",l="";switch(e){case 0:r=le._({id:"hdIg7i",message:"Select Pool Version"}),l=le._({id:"fw3eYd",message:"ZUNO provides a variety of pool versions to suit your needs."});break;case 1:r=le._({id:"lsg9Mi",message:"Parameter Settings"});break;case 2:t?r=le._({id:"6lss/t",message:"Pricing Model"}):(r=le._({id:"Y7rVy0",message:"Fee Rate"}),s=le._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}));break;case 3:if(!t)throw new Error("type is error");r=le._({id:"Y7rVy0",message:"Fee Rate"}),s=le._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."});break;case 4:if(!t)throw new Error("type is error");r=le._({id:"3ggd2j",message:"Asset ratio within the pool"});break;default:throw new Error(`Invalid Step ${e}`)}return In.jsxs(i,{sx:Object.assign({position:"sticky",top:0,py:20,px:20,backgroundColor:n.palette.background.paper,zIndex:1},o?{}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(i,{sx:{typography:"h5",color:n.palette.text.primary,fontWeight:600},children:r}),s&&In.jsx(f,{title:s,sx:{width:16,height:16}}),In.jsx(i,{sx:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:(t?[0,1,2,3,4]:[0,1,2]).map((t=>In.jsx(i,{sx:{width:12,height:12,borderRadius:12,background:e>=t?n.palette.secondary.main:T(n.palette.primary.main,.1)}},t)))})]}),l&&In.jsx(i,{sx:{mt:8,typography:"body2",color:n.palette.text.secondary},children:l})]})}function Zk({versionItem:t,status:n}){const o=a(),{noDocumentLink:r}=On(),s="light"===o.palette.mode;return"completed"===n?In.jsxs(i,{sx:{backgroundColor:o.palette.background.paper,borderRadius:8,width:"50%",padding:16},children:[In.jsx(i,{sx:{typography:"h5",fontWeight:600,color:o.palette.text.primary},children:t.title}),In.jsx(i,{sx:{typography:"h6",fontWeight:500,mt:8,color:o.palette.text.secondary},children:t.description})]}):In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(i,{sx:{typography:"h4",fontWeight:600},children:t.title}),!r&&In.jsxs(i,{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:t.docUrl,target:"_blank",rel:"noreferrer",children:[In.jsx(e,{id:"TGi+jm",message:"Doc"}),In.jsx("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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"})})]})]}),In.jsx(i,{sx:{position:"relative",width:"100%",minHeight:220},children:In.jsx(i,{component:s?t.exampleImgUrl:t.exampleDarkImgUrl,sx:{marginTop:20,width:"100%"}})})]})}function zk({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 $k(){const{account:e,chainId:t}=hd(),n=Gf((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}=Ls(),a=zk({side:"from",needFindToken:n,tokenList:r,chainId:e}),s=Qe(Object.assign({},Ea.getFetchTokenQuery(o?void 0:e,null==n?void 0:n.address,t))),l=Qe(Object.assign({},Ea.getFetchTokenQuery(o?void 0:e,null==i?void 0:i.address,t)));let d=null,c=!1;d=a.defaultToken,s.data&&(d=s.data,c=s.isLoading);let u=null,p=!1;return u=zk({side:"to",needFindToken:i,occupyToken:d,tokenList:r,chainId:e}).defaultToken,l.data&&(u=l.data,p=l.isLoading),{defaultBaseToken:d,defaultQuoteToken:u,defaultBaseTokenLoading:c,defaultQuoteTokenLoading:p}}({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 Gk({tokens:e}){const{apikey:t}=On(),n=zd(fa.fiatPrice);return Qe({enabled:!!e.length,queryKey:["fetch","fetchFiatPrice",e],queryFn:()=>bn(this,void 0,void 0,(function*(){const i=yield Ot.post(n,{networks:e.map((e=>dd(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 Yk=({selectedVersion:e})=>e===nk.pegged?["0.0001","0.0005","0.002"]:["0.5","0.01","1"];var Qk;function Xk(e,t){return!e||null==t||e.isNaN()?"":e.dp(t,Le.ROUND_DOWN).toString()}function Kk({state:e,fixedRatioPrice:t}){const{selectedVersion:n,baseToken:i,quoteToken:o,baseAmount:r,isFixedRatio:a,leftTokenAddress:s}=e;if(!i||!o)throw new Error("token is required");const l=s===(null==i?void 0:i.address),d=n===nk.standard,c=n===nk.pegged,u=new Le(t);let p=d?ck:l?t:!u.isNaN()&&u.gt(0)?new Le(1).div(u).dp(l?o.decimals:i.decimals).toString():dk;if(d){const e=18-i.decimals+o.decimals;e<String(ck).split(".")[1].length&&(p=new Le(1).div(10**e).toString())}if(c){const n=xk({initPrice:p}),i=n.base?n.base.multipliedBy(100).toString():"",o=n.quote?n.quote.multipliedBy(100).toString():"";return Object.assign(Object.assign({},e),{initPrice:p,fixedRatioPrice:t,peggedBaseTokenRatio:i,peggedQuoteTokenRatio:o})}if(d&&a){const n=new Le(r);if(!n.isNaN()&&!u.isNaN()&&u.gt(0)){const r=l?n.multipliedBy(u):n.div(u);return Object.assign(Object.assign({},e),{initPrice:p,fixedRatioPrice:t,baseAmount:Xk(n,i.decimals),quoteAmount:Xk(r,o.decimals)})}}return Object.assign(Object.assign({},e),{initPrice:p,fixedRatioPrice:t})}function Jk(e,t){var n;switch(t.type){case Qk.SetCurrentStep:{const{payload:n}=t;return e.selectedVersion===nk.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 Qk.SelectNewVersion:{const{payload:i}=t;if(i===e.selectedVersion)return e;let o,r=pk;i===nk.pegged&&(r=hk,o=tk.DSP);let a=ck;i===nk.singleToken?a="":i!==nk.standard&&(a=dk);let s=!0;return i===nk.singleToken&&(s=!1),Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:"",isFixedRatio:s,initPrice:a,fixedRatioPrice:i===nk.singleToken?"":dk,slippageCoefficient:r,isSlippageCoefficientCustomized:!Yk({selectedVersion:t.payload}).includes(r),selectedVersion:t.payload,selectedSubPeggedVersion:o,leftTokenAddress:null===(n=e.baseToken)||void 0===n?void 0:n.address})}case Qk.SelectNewSubPeggedVersion:return Object.assign(Object.assign({},e),{selectedSubPeggedVersion:t.payload});case Qk.UpdateBaseToken:{const n=t.payload;return Object.assign(Object.assign({},e),{baseToken:n,baseAmount:"",leftTokenAddress:null==n?void 0:n.address})}case Qk.UpdateQuoteToken:{const{baseToken:n}=e;return Object.assign(Object.assign({},e),{quoteToken:t.payload,quoteAmount:"",leftTokenAddress:null==n?void 0:n.address})}case Qk.SwitchTokens:{const{selectedVersion:t,baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:r}=e;return t===nk.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 Qk.UpdateBaseAmount:{const n=t.payload,{selectedVersion:i,quoteToken:o,fixedRatioPrice:r,isFixedRatio:a,peggedBaseTokenRatio:s}=e;if(!o)throw new Error("token is required");const l=new Le(n);if(i===nk.pegged){const t=new Le(s).div(100).dp(gk,Le.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:""});const i=l.div(t).minus(l);return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:Xk(i,o.decimals)})}if(i===nk.standard&&a&&r){if(!n)return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:n});const t=function(e,t){const n=new Ie;return n.B=new Le(e.baseAmount),n.i=new Le(e.initPrice),n.k=new Le(e.slippageCoefficient),n.RStatus=1,n.getQuoteByMidPrice(t)}(Object.assign(Object.assign({},e),{baseAmount:n}),new Le(r));return Object.assign(Object.assign({},e),{baseAmount:n,quoteAmount:Xk(t,o.decimals)})}return Object.assign(Object.assign({},e),{baseAmount:n})}case Qk.UpdateQuoteAmount:{const n=t.payload,{selectedVersion:i,baseToken:o,fixedRatioPrice:r,isFixedRatio:a,leftTokenAddress:s,peggedQuoteTokenRatio:l}=e;if(!o)throw new Error("token is required");const d=s===(null==o?void 0:o.address),c=new Le(n);if(i===nk.pegged){const t=new Le(l).div(100).dp(gk,Le.ROUND_DOWN);if(!t.isFinite()||t.lt(0))return Object.assign(Object.assign({},e),{baseAmount:"",quoteAmount:n});const i=c.div(t).minus(c);return Object.assign(Object.assign({},e),{baseAmount:Xk(i,o.decimals),quoteAmount:n})}if(i===nk.standard&&a){const t=new Le(r),i=t.gt(0)?d?c.div(t):c.multipliedBy(t):void 0;return Object.assign(Object.assign({},e),{baseAmount:Xk(i,o.decimals),quoteAmount:n})}return Object.assign(Object.assign({},e),{quoteAmount:n})}case Qk.UpdateIsFixedRatio:return Object.assign(Object.assign({},e),{isFixedRatio:t.payload});case Qk.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:s}=t.payload,l=a&&s?new Le(a).div(s):void 0,d=a&&s?new Le(s).div(a):void 0,c=r?l:d,u=r?o.decimals:i.decimals;return c&&!c.isNaN()?Kk({state:e,fixedRatioPrice:c.dp(u,Le.ROUND_DOWN).toString()}):e}case Qk.UpdateFixedRatioPrice:return Kk({state:e,fixedRatioPrice:t.payload});case Qk.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 Le(i);if(!a.isNaN()&&a.gt(0)){const i=new Le(1).div(a).dp(o?t.decimals:n.decimals);return Kk({state:Object.assign(Object.assign({},e),{leftTokenAddress:r}),fixedRatioPrice:i.toString()})}return Object.assign(Object.assign({},e),{leftTokenAddress:r})}case Qk.UpdateSlippageCoefficient:return Object.assign(Object.assign({},e),{slippageCoefficient:t.payload});case Qk.UpdateIsSlippageCoefficientCustomized:return Object.assign(Object.assign({},e),{isSlippageCoefficientCustomized:t.payload});case Qk.UpdateFeeRate:return Object.assign(Object.assign({},e),{feeRate:t.payload});case Qk.UpdateIsFeeRateCustomized:return Object.assign(Object.assign({},e),{isFeeRateCustomized:t.payload});case Qk.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 Qk.UpdatePeggedBaseTokenRatio:{if(!e.quoteToken)throw new Error("token is required");const n=t.payload,i=new Le(n).dp(gk-2,Le.ROUND_DOWN);if(!i.isFinite()||i.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:"",baseAmount:"",quoteAmount:""});const o=new Le(100).minus(i).dp(gk-2,Le.ROUND_DOWN),r=i.lte(0)?"0":e.baseAmount,a=new Le(r),s=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:Xk(s,e.quoteToken.decimals)})}case Qk.UpdatePeggedQuoteTokenRatio:{if(!e.baseToken)throw new Error("token is required");const n=t.payload,i=new Le(n).dp(gk-2,Le.ROUND_DOWN);if(!i.isFinite()||i.lt(0))return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:"",peggedQuoteTokenRatio:n,baseAmount:"",quoteAmount:""});const o=new Le(100).minus(i).dp(gk-2,Le.ROUND_DOWN),r=i.lte(0)?"0":e.quoteAmount,a=new Le(r),s=a.div(i.div(100)).minus(a);return Object.assign(Object.assign({},e),{peggedBaseTokenRatio:o.lt(0)?"0":o.toString(),peggedQuoteTokenRatio:n,baseAmount:Xk(s,e.baseToken.decimals),quoteAmount:r})}default:throw Error("Unknown action: "+t.type)}}function eT({isSingleTokenVersion:e,leftTokenAddress:t,baseToken:n,quoteToken:i,dispatch:o}){var r,a;const s=Gk({tokens:Z((()=>n&&i?[n,i]:[]),[n,i])}),l=t===(null==n?void 0:n.address),d=n?null===(r=s.data)||void 0===r?void 0:r.get(n.address):void 0,c=i?null===(a=s.data)||void 0===a?void 0:a.get(i.address):void 0,u=Z((()=>{const e=d&&c?new Le(d).div(c):void 0,t=d&&c?new Le(c).div(d):void 0;return l?e:t}),[d,l,c]),p=!u||u.isNaN(),h=!s.isLoading&&!s.isPending&&p;return te((()=>{h&&o({type:Qk.UpdateIsFixedRatio,payload:!1})}),[o,h]),te((()=>{e||d&&o({type:Qk.InitFixedRatioPrice,payload:{baseTokenFiatPrice:d,quoteTokenFiatPrice:c}})}),[d,o,e,c]),{fiatPriceLoading:s.isLoading||s.isPending,currentPrice:u,isErrorPrice:h,isNullPrice:p}}function tT({label:e,value:t}){return In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",mb:16},children:[In.jsx(i,{sx:{color:"text.secondary",mr:8},children:e}),In.jsx(i,{sx:{textAlign:"right",wordBreak:"break-all"},children:t})]})}function nT({on:e,onClose:t,state:n,onConfirm:o,isModify:r,loading:a}){var s,l,d,u,p,h,m;const{chainId:g}=hd(),{versionMap:f}=ik(),{isMobile:x}=Sd(),{title:y,initPriceLabel:v}=f[n.selectedVersion],{midPrice:b}=Pk({selectedVersion:n.selectedVersion,baseAmount:n.baseAmount,quoteAmount:n.quoteAmount,initPrice:n.initPrice,slippageCoefficient:n.slippageCoefficient}),j=rk(),C=n.selectedVersion===nk.pegged;return In.jsx(Rc,{open:e,onClose:t,modal:!0,title:r?le._({id:"dzV+zO",message:"Modify Confirmation"}):le._({id:"tnRI9r",message:"Pool Creation Confirmation"}),children:In.jsxs(i,{sx:{flex:1,px:20,pb:20,display:"flex",flexDirection:"column",justifyContent:"space-between",width:x?void 0:420},children:[In.jsxs(i,{sx:{pt:40,px:8},children:[In.jsx(tT,{label:le._({id:"eE0JZ4",message:"Version"}),value:y}),In.jsx(tT,{label:le._({id:"7m5+6j",message:"Initial Tokens"}),value:In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[In.jsx(Fc,{address:null===(s=n.baseToken)||void 0===s?void 0:s.address,chainId:g,marginRight:8,width:18,height:18}),n.baseAmount||"-"," ",null===(l=n.baseToken)||void 0===l?void 0:l.symbol]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",mt:4},children:[In.jsx(Fc,{address:null===(d=n.quoteToken)||void 0===d?void 0:d.address,chainId:g,marginRight:8,width:18,height:18}),n.quoteAmount||"-"," ",null===(u=n.quoteToken)||void 0===u?void 0:u.symbol]})]})}),In.jsx(tT,{label:le._({id:"sjn3tj",message:"Slippage Coefficient"}),value:n.slippageCoefficient}),In.jsx(tT,{label:v,value:n.baseToken&&n.quoteToken?`1 ${n.baseToken.symbol} = ${fk({midPrice:b,quoteToken:n.quoteToken,selectedVersion:n.selectedVersion,initPrice:n.initPrice})} ${n.quoteToken.symbol}`:""}),C&&In.jsx(tT,{label:le._({id:"6lss/t",message:"Pricing Model"}),value:n.selectedSubPeggedVersion?null===(p=j[n.selectedSubPeggedVersion])||void 0===p?void 0:p.title:"-"}),In.jsx(tT,{label:le._({id:"Y7rVy0",message:"Fee Rate"}),value:`${n.feeRate}%`}),C&&In.jsx(tT,{label:le._({id:"eK0eiF",message:"Initial asset ratio"}),value:In.jsxs(In.Fragment,{children:[n.peggedBaseTokenRatio,"% ",null===(h=n.baseToken)||void 0===h?void 0:h.symbol," : ",n.peggedQuoteTokenRatio,"% ",null===(m=n.quoteToken)||void 0===m?void 0:m.symbol]})})]}),In.jsx(c,{fullWidth:!0,isLoading:a,sx:{mt:30},onClick:o,children:r?le._({id:"7VpPHA",message:"Confirm"}):le._({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"}(Qk||(Qk={}));const iT=({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:i,baseAmount:o,quoteAmount:r,feeRate:a,initPrice:s,slippageCoefficient:l})=>{const{chainId:d,account:c}=hd(),{deadLine:u}=On(),p=ve[d];return{getCreateParams:()=>bn(void 0,void 0,void 0,(function*(){if(!c||!n||!i)return null;let h="";const m=Number(n.decimals),g=Number(i.decimals),f=new Le(a),x=e===nk.marketMakerPool,y=e===nk.standard,v=e===nk.pegged,b=e===nk.pegged&&t===tk.GSP,j={decimals:m,address:n.address},C={decimals:g,address:i.address},w=Lt(o,m).toString(),k=Lt(r||"0",g).toString(),T=x?f.times(100).toNumber():f.times(80).toNumber();let E=x&&y?new Le(r).div(o).dp(g,Le.ROUND_DOWN).toString():new Le(s).toString();if(y){const e=18-n.decimals+i.decimals;e<String(ck).split(".")[1].length&&(E=new Le(1).div(10**e).toString())}const A=Number(l||(v?"0.1":"1")),I=Math.ceil(Date.now()/1e3)+(null!=u?u:3600);let S;const L=[d,j,C,w,k,T,E,A,I];try{e===nk.standard||e===nk.singleToken?S=yield me.encode.createDVMPoolABI(...L):x?S=yield me.encode.createDPPPoolABI(...L):v?S=yield me.encode.createDSPPoolABI(...L):b&&(S=yield me.encode.createGSPPoolABI(d,c,j,C,w,k,T,E,A,I))}catch(e){throw console.error("2.0 CreatePool createPrams error",L,e),h=`2.0 CreatePool createPrams error; ERROR: ${e}`,new Error(h)}if(!S||!S.data)throw h="invalid data",new Error(h);try{const e=p.address.toLocaleLowerCase();return o&&n.address.toLocaleUpperCase()===e?S.value=Cb(o):r&&i.address===e?S.value=Cb(r):S.value=0,S}catch(e){throw console.error("2.0 sendTransaction error",e),h=`2.0 sendTransaction error; ERROR: ${e}`,new Error(h)}}))}},oT=({chainId:t,baseToken:n,quoteToken:o})=>{const r=a();return yk({chainId:t,baseToken:n,quoteToken:o})?In.jsx(i,{sx:{mb:12,py:8,px:12,borderRadius:8,backgroundColor:T(r.palette.error.main,.1),color:r.palette.error.main,textAlign:"center",typography:"h6",fontWeight:500},children:In.jsx(e,{id:"peTryP",message:"{0}-{1} is not supported. Please select another pair.",values:{0:null==n?void 0:n.symbol,1:null==o?void 0:o.symbol}})}):null};function rT({state:t,dispatch:n,openConfirm:i,isPeggedVersion:o,isStandardVersion:r,isSingleTokenVersion:a,fiatPriceLoading:s}){var l,d;const{currentStep:u,selectedVersion:p,baseToken:h,quoteToken:m,baseAmount:g,quoteAmount:f,initPrice:x,slippageCoefficient:y,feeRate:v}=t,b=new Le(g||0),j=new Le(f||0),C=cc(h,{amount:g}),w=cc(m,{amount:f}),k={variant:c.Variant.contained},T=yk({chainId:null!==(d=null===(l=t.baseToken)||void 0===l?void 0:l.chainId)&&void 0!==d?d:1,baseToken:h,quoteToken:m}),E=le._({id:"hXzOVo",message:"Next"}),A=In.jsx(c,{fullWidth:!0,disabled:!0,...k,children:E}),I=In.jsx(c,{variant:c.Variant.contained,fullWidth:!0,onClick:i,children:In.jsx(e,{id:"hYgDIe",message:"Create"})});if(0===u)return In.jsx(c,{fullWidth:!0,...k,onClick:()=>{n({type:Qk.SetCurrentStep,payload:1})},children:E});const S=!h||b.isNaN()||b.lte(0),L=!m||j.isNaN()||j.lte(0);if(1===u){if(T)return A;if(o){if(!h||!m)return A}else{if(S)return A;if(C.needShowTokenStatusButton||C.insufficientBalance)return In.jsx(bb,{status:C,buttonProps:k});if(!a){if(L)return A;if(w.needShowTokenStatusButton||w.insufficientBalance)return In.jsx(bb,{status:w,buttonProps:k})}if(!r){if(!m)return A;const e=new Le(x),t=Math.min(m.decimals,16);if(!x||e.isNaN()||e.lt(`1e-${t}`)||e.gt(uk))return A;const n=new Le(y);if(!y||n.isNaN()||n.lt(0)||n.gt(p===nk.pegged?mk:pk))return A}if(s)return A;if(yk({chainId:h.chainId,baseToken:h,quoteToken:m}))return A}return In.jsx(c,{fullWidth:!0,...k,onClick:()=>{n({type:Qk.SetCurrentStep,payload:2})},children:E})}const O=new Le(v),R=!v||O.isNaN()||O.lt(sk)||O.gt(lk);return 2===u?o?In.jsx(c,{fullWidth:!0,...k,onClick:()=>{n({type:Qk.SetCurrentStep,payload:3})},children:E}):R?A:I:3===u?R?A:In.jsx(c,{fullWidth:!0,...k,onClick:()=>{n({type:Qk.SetCurrentStep,payload:4})},children:E}):4===u?S||L?A:C.needShowTokenStatusButton||C.insufficientBalance?In.jsx(bb,{status:C,buttonProps:k}):w.needShowTokenStatusButton||w.insufficientBalance?In.jsx(bb,{status:w,buttonProps:k}):I:null}function aT({state:t,dispatch:n,isPeggedVersion:o,isStandardVersion:r,isSingleTokenVersion:s,fiatPriceLoading:l}){const{currentStep:d}=t,u=a(),{isMobile:p}=Sd(),h=Wd(),{onlyChainId:m,chainId:g}=hd(),[f,x]=$(!1),{getCreateParams:y}=iT(t),v=Je({mutationFn:()=>bn(this,void 0,void 0,(function*(){const e=yield y();if(!e)return;(yield h.execute(le._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:Dd.TX,desc:"Create pool"},e),{early:!0,metadata:{[t.selectedVersion===nk.marketMakerPool?Od.createDPPPool:t.selectedVersion===nk.pegged?t.selectedSubPeggedVersion===tk.DSP?Od.createDSPPool:Od.createGSPPool:Od.createDVMPool]:"1"}}))===Rd.Submitted&&setTimeout((()=>{Gf.getState().push({type:$f.Pool,params:{tab:Sj.myCreated}})}),100)}))});return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:u.palette.background.paperContrast,px:20,py:20},p?{}:{position:"static",backgroundColor:"transparent",py:0}),children:[1==d&&In.jsx(oT,{chainId:g,baseToken:t.baseToken,quoteToken:t.quoteToken}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[0===d&&p&&In.jsx(c,{variant:c.Variant.second,fullWidth:!0,onClick:()=>{Gf.getState().back()},children:In.jsx(e,{id:"dEgA5A",message:"Cancel"})}),d>0&&In.jsx(c,{variant:c.Variant.second,fullWidth:!0,onClick:()=>{n({type:Qk.SetCurrentStep,payload:d-1})},children:In.jsx(e,{id:"iH8pgl",message:"Back"})}),In.jsx(cx,{chainId:m,variant:c.Variant.contained,fullWidth:!0,includeButton:!0,children:In.jsx(rT,{state:t,dispatch:n,openConfirm:()=>{x(!0)},isPeggedVersion:o,isStandardVersion:r,isSingleTokenVersion:s,fiatPriceLoading:l})})]})]}),In.jsx(nT,{on:f,onClose:()=>x(!1),state:t,isModify:!1,onConfirm:v.mutate,loading:v.isPending})]})}function sT({selected:e}){const t=a();return In.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:[In.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:e?t.palette.success.main:t.palette.text.secondary}),e&&In.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:t.palette.success.main,stroke:t.palette.success.main})]})}function lT({title:e,subTitle:t,description:n,selected:o,onClick:r,children:s,sx:l,titleSx:c}){const u=a();u.palette.mode;return In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",p:20,backgroundColor:u.palette.background.tag,borderWidth:1,borderColor:o?u.palette.primary.main:"transparent",borderStyle:"solid",borderRadius:12,flexWrap:"wrap",justifyContent:"flex-start",textAlign:"left","&:hover":{borderColor:u.palette.primary.main}},l),component:d,onClick:r,children:[In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between",typography:"caption",pr:2,color:u.palette.text.primary},c),children:[e,t,In.jsx(sT,{selected:o})]}),In.jsx(i,{sx:{mt:8,typography:"body2",width:"100%",textAlign:"left",color:o?u.palette.text.primary:u.palette.text.secondary},children:n}),s]})}function dT({errorMsg:e,isCustomized:t,onClick:n,value:o,onChange:r}){const s=a(),l=Z((()=>!(!o||"0"===o||Number(o))),[o]);return In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{py:12,px:20,backgroundColor:s.palette.background.paper,borderColor:t&&e||l?s.palette.error.main:t?s.palette.primary.main:s.palette.border.main,borderWidth:1,borderStyle:"solid",borderRadius:12,display:"flex",alignItems:"center"},onClick:n,children:In.jsx(Rm,{value:t?o:"",onChange:r,suffix:In.jsx(sT,{selected:t}),placeholder:le._({id:"8Tg/JR",message:"Custom"}),sx:{backgroundColor:"transparent","& input":{typography:"body1",height:36,lineHeight:"36px",p:s.spacing(0),color:s.palette.text.primary,"&::placeholder":{color:s.palette.text.disabled,fontWeight:600,typography:"body1",lineHeight:1,position:"relative"}}}})}),e&&In.jsx(i,{sx:{typography:"h6",color:"error.main",mt:6},children:e})]})}const cT=()=>[{title:"0.01%",description:le._({id:"yzjPpo",message:"Fees will be the same as in most other pools."}),value:"0.01"},{title:"0.3%",description:le._({id:"OJOe+K",message:"Set the fee to the same as most other pools"}),value:ak,tag:"99% Default"},{title:"1%",description:"Most suitable for swapping exotic assets.",value:"1"}];function uT(){const e=a();return Z((()=>cT().map((t=>t.value===ak?Object.assign(Object.assign({},t),{tagBackgroundColor:T(e.palette.purple.main,.1),tagColor:e.palette.purple.main}):t))),[e.palette.purple.main])}const pT=e=>{if(!e)return"";const t=new Le(e);return t.isNaN()||!t.lt(sk)&&!t.gt(lk)?"":le._({id:"GSt7YT",message:"The fee rate must be between 0.01% to 10%"})},hT=(e,t)=>{if(!e)return"";const n=new Le(e);if(!n.isNaN()&&(n.lt(0)||n.gt(t===nk.pegged?mk:pk)))switch(t){case nk.standard:case nk.singleToken:case nk.marketMakerPool:return le._({id:"3U+Oti",message:"he slippage coefficient needs to be greater than or equal to 0, and less than or equal to 1."});case nk.pegged:return le._({id:"LDprZB",message:"The slippage coefficient needs to be greater than 0, and less than 0.1."})}return""};function mT({dispatch:t,feeRate:n,isFeeRateCustomized:o}){const r=a(),s=uT(),l=Z((()=>pT(n)||""),[n]);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:[s.map((e=>{const i=!o&&n===e.value;return In.jsx(lT,{title:e.title,description:e.description,onClick:()=>{t({type:Qk.UpdateIsFeeRateCustomized,payload:!1}),t({type:Qk.UpdateFeeRate,payload:e.value})},selected:i,subTitle:e.tag?In.jsx(Dk,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:r.palette.background.paper,borderColor:i?r.palette.primary.main:r.palette.border.main}},e.value)})),In.jsx(i,{sx:{mt:8},children:In.jsx(dT,{errorMsg:l,isCustomized:o,onClick:()=>{t({type:Qk.UpdateFeeRate,payload:""}),t({type:Qk.UpdateIsFeeRateCustomized,payload:!0})},value:n,onChange:e=>{t({type:Qk.UpdateFeeRate,payload:e})}})})]}),In.jsx(i,{sx:{typography:"body2",mt:20,color:"text.secondary",px:20},children:In.jsx(e,{id:"0b0AkA",message:"* Please note that the Fee Rate cannot be modified after the pool is created"})})]})}function gT({on:t,onClose:n,onConfirm:i}){return In.jsx(Rb,{open:t,onClose:n,onConfirm:i,title:le._({id:"t+LmjM",message:"Initial Price Alert"}),modal:!0,children:In.jsx(e,{id:"yXm1vH",message:"The initial price is different from the current market price, which may cause your pool to be arbitraged"})})}const fT=({title:e,children:t,sx:n})=>{const o=a();return In.jsxs(i,{sx:Object.assign({mx:20,display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},n),children:[In.jsx(i,{sx:{typography:"body2",color:o.palette.text.primary,fontWeight:500,display:"flex",alignItems:"center"},children:e}),t]})};function xT({selectedVersion:t,isStandardVersion:n,isSingleTokenVersion:o,isFixedRatio:s,leftTokenAddress:c,baseToken:u,quoteToken:p,fixedRatioPrice:h,dispatch:m,priceInfo:g}){const x=a(),[y,v]=$(!1),{versionMap:b}=ik(),{initPriceLabel:C,initPriceTips:w,initPriceTipsLink:k}=b[t],A=c===(null==u?void 0:u.address),I=A?null==u?void 0:u.symbol:null==p?void 0:p.symbol,S=A?null==p?void 0:p.symbol:null==u?void 0:u.symbol,{currentPrice:L,isErrorPrice:O,isNullPrice:R,fiatPriceLoading:M}=g,_=A?null==p?void 0:p.decimals:null==u?void 0:u.decimals,P=Z((()=>{if(!p)return"";const e=function(e,t,n){if(!t)return"";const i=new Le(t),o=Math.min(n,16),r=Number(`1e-${o}`);if(e!==nk.standard&&!i.isNaN()&&(i.lt(r)||i.gt(uk))){const t=r.toFixed(o);switch(e){case nk.pegged:case nk.singleToken:return le._({id:"P4iKEj",message:"The initial price needs to be greater than {min} and less than 100,000,000",values:{min:t}});case nk.marketMakerPool:return le._({id:"kdzjmC",message:"The mid price needs to be greater than {min} and less than 100,000,000",values:{min:t}})}}return""}(t,h,p.decimals);return e||""}),[h,p,t]),B=Z((()=>!(!h||"0"===h||Number(h))),[h]);return In.jsxs(In.Fragment,{children:[In.jsx(fT,{title:In.jsxs(In.Fragment,{children:[C,w&&In.jsx(f,{title:In.jsxs(In.Fragment,{children:[w,k?In.jsxs(In.Fragment,{children:["\n",In.jsxs(i,{component:"a",href:k,target:"_blank",rel:"noopener noreferrer",sx:{color:"primary.main",textDecoration:"underline"},onClick:e=>{e.stopPropagation()},children:[In.jsx(e,{id:"NgeSlx",message:"Learn More"}),">"]})]}):""]}),ml:4,sx:{width:14,height:14,alignItems:"center"}})]}),sx:{mt:20},children:In.jsxs(i,{sx:{pt:n?11:19,px:19,pb:11,borderWidth:1,borderStyle:"solid",borderColor:P||B?"error.main":x.palette.background.cardInput,borderRadius:8,backgroundColor:x.palette.background.cardInput,display:"flex",flexDirection:"column",alignItems:"stretch",gap:20},children:[n?null:In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{typography:"body2",color:x.palette.text.primary,display:"flex",alignItems:"center"},children:[In.jsxs(i,{sx:{fontWeight:600,color:x.palette.text.disabled,flexShrink:0},children:["1 ",null!=I?I:"-"," ="]}),In.jsx(Rm,{value:h,onChange:e=>{m({type:Qk.UpdateFixedRatioPrice,payload:e})},readOnly:s,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}}}}),In.jsx(i,{sx:{typography:"body2",fontWeight:600,color:x.palette.text.disabled,flexShrink:0},children:null!=S?S:"-"}),In.jsx(i,{sx:{display:"flex",alignItems:"center"},component:d,onClick:()=>{m({type:Qk.ToggleLeftToken})},children:In.jsx(r,{weak:!0,component:Un.Switch,sx:{marginLeft:8,p:x.spacing(2),color:x.palette.text.primary,backgroundColor:T(x.palette.primary.main,.1),borderRadius:"50%"}})})]}),P&&In.jsx(i,{sx:{typography:"h6",color:"error.main",mt:-14},children:P})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:n?"flex-start":"flex-end",typography:"h6",color:x.palette.text.primary,fontWeight:500},children:["=",In.jsx(e,{id:"pdZiL7",message:"Current Market Price:"})," ",M?In.jsx(j,{sx:{borderRadius:4},width:50,height:17}):R?In.jsx(l,{title:In.jsx(e,{id:"mObS+5",message:"Failed to get price of the token"}),children:In.jsx(i,{component:Un.Warn,sx:{width:14,height:14,color:x.palette.error.main,typography:"h6"}})}):Ps({input:L,decimals:_})," ",S,O||o?null:In.jsx(E,{checked:s,onChange:e=>{if(e.target.checked){if(m({type:Qk.UpdateIsFixedRatio,payload:!0}),!_)throw new Error("currentTokenDecimals is undefined");L&&!L.isNaN()&&m({type:Qk.UpdateFixedRatioPrice,payload:L.dp(_,Le.ROUND_DOWN).toString()})}else v(!0)},sx:{ml:8}})]})]})}),In.jsx(gT,{on:y,onClose:()=>v(!1),onConfirm:()=>{m({type:Qk.UpdateIsFixedRatio,payload:!1})}})]})}function yT({selectedVersion:e,selectedSubPeggedVersion:t,baseToken:n,quoteToken:o,initPrice:r,dispatch:s}){var l;const d=a(),{versionMap:c,subPeggedVersionList:u}=ik(),{initPriceLabel:p}=c[e];return n&&o?In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{mt:8,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[In.jsx(i,{sx:{typography:"body2",color:d.palette.text.secondary,fontWeight:500},children:p}),In.jsxs(i,{sx:{typography:"h5",color:d.palette.text.primary,fontWeight:600},children:["1 ",null==n?void 0:n.symbol,"=",null!==(l=fk({midPrice:void 0,quoteToken:o,selectedVersion:e,initPrice:r}))&&void 0!==l?l:"-"," ",o.symbol]})]}),In.jsx(i,{sx:{mt:20,display:"flex",flexDirection:"column",gap:12,px:20},children:u.map((e=>{const n=t===e.version;return In.jsx(lT,{title:e.title,description:e.description,onClick:()=>{s({type:Qk.SelectNewSubPeggedVersion,payload:e.version})},selected:n,subTitle:void 0,sx:{backgroundColor:d.palette.background.paper,borderColor:n?d.palette.primary.main:d.palette.border.main},titleSx:{typography:"body1",fontWeight:600}},e.version)}))})]}):null}function vT({title:e,value:t,onChange:n}){const o=a();return In.jsxs(i,{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:[In.jsx(i,{sx:{color:o.palette.text.primary,typography:"body1",fontWeight:500,flexShrink:0},children:e}),In.jsx(Rm,{value:t,onChange:n,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 bT=({baseToken:t,quoteToken:n,initPrice:o,peggedBaseTokenRatio:r,peggedQuoteTokenRatio:s,baseAmount:l,quoteAmount:d,dispatch:u})=>{var p,h;const m=a(),[g,f]=Z((()=>{const{base:e,quote:t}=xk({initPrice:o});return[e?e.multipliedBy(100).toString():null,t?t.multipliedBy(100).toString():null]}),[o]),x=""===r&&""===s,[y,v]=Z((()=>{var e,i;const r=null!==(e=null==t?void 0:t.decimals)&&void 0!==e?e:0,a=null!==(i=null==n?void 0:n.decimals)&&void 0!==i?i:0,s=new Le(l).dp(r,Le.ROUND_DOWN).multipliedBy(`1e${r}`),c=new Le(d).dp(a,Le.ROUND_DOWN).multipliedBy(`1e${a}`),u=new Le(o).multipliedBy(`1e${18-r+a}`).dp(0,Le.ROUND_DOWN),p=c.lt(s.multipliedBy(u).div(1e18))?c.multipliedBy(1e18).div(u):s,h=new Le(1001);if(h.gt(p))return[new Le(1),"100%"];const m=h.dividedBy(p);return[m,Gs({input:m})]}),[l,null==t?void 0:t.decimals,o,d,null==n?void 0:n.decimals]),b=Z((()=>!!y.lte("0.0000000001")||null!=g&&r===g&&null!=f&&s===f),[y,r,s,g,f]),j=`${null==t?void 0:t.symbol}:${null==n?void 0:n.symbol}=${g}%:${f}%`;return In.jsxs(fT,{title:In.jsx(e,{id:"OuSseo",message:"Ratio Settings"}),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:4},children:[In.jsx(vT,{title:null!==(p=null==t?void 0:t.symbol)&&void 0!==p?p:"",value:r,onChange:e=>{u({type:Qk.UpdatePeggedBaseTokenRatio,payload:e})}}),In.jsx(i,{sx:{color:m.palette.text.primary,typography:"body2",fontWeight:500,width:14,flexShrink:0,flexGrow:0,textAlign:"center"},children:":"}),In.jsx(vT,{title:null!==(h=null==n?void 0:n.symbol)&&void 0!==h?h:"",value:s,onChange:e=>{u({type:Qk.UpdatePeggedQuoteTokenRatio,payload:e})}})]}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,px:19,pt:19,pb:11,borderRadius:16,borderWidth:1,borderColor:b||x?m.palette.border.main:"transparent",borderStyle:"solid",backgroundColor:b||x?m.palette.background.paper:T(m.palette.warning.main,.1)},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[x?null:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8,color:b?m.palette.text.primary:m.palette.warning.main,typography:"body1",fontWeight:600},children:[b?null:In.jsx(Un.Warn,{}),In.jsx(e,{id:"x3muNy",message:"Liquidity Burn Ratio"}),": ",v]}),In.jsx(i,{sx:{color:m.palette.text.secondary,typography:"h6",textAlign:"center","&>strong":{color:b?m.palette.text.primary:m.palette.warning.main}},children:x?In.jsx(e,{id:"pQJBKk",message:"The closer the provided asset ratio is to the recommended ratio ({recommendRatioText}), the smaller the portion burned.",values:{recommendRatioText:j}}):In.jsx(e,{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:j},components:{0:In.jsx("strong",{}),1:In.jsx("br",{})}})})]}),x||!b?In.jsx(c,{variant:c.Variant.outlined,fullWidth:!0,size:c.Size.small,onClick:()=>{u({type:Qk.UpdatePeggedBaseTokenRatio,payload:null!=g?g:""})},sx:{border:`solid 1px ${m.palette.text.primary}`,color:m.palette.text.primary,"&:hover":{background:T(m.palette.text.primary,.1)}},children:In.jsx(e,{id:"NjdGps",message:"Use the recommended ratio"})}):null]})]})};function jT({open:e,onClose:t,afterClose:n,title:o,titleCenter:r,rightSlot:s,canBack:l=!0,children:d,width:c=420,height:u,testId:p}){const h=a(),{isMobile:m}=Sd();return In.jsx(V,{open:e,onClose:t,container:m?document.querySelector(`.${Kh}`):void 0,disableEnforceFocus:!0,children:In.jsxs(i,{sx:Object.assign({backgroundColor:"background.paper",display:"flex",height:u,flexDirection:"column",justifyContent:"center",alignItems:"center",outline:0,overflow:"hidden","& > div":{width:"100%"}},m?{width:"100%",borderRadius:h.spacing(16,16,0,0)}:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:c,maxWidth:"95%",minHeight:200,maxHeight:"80%",borderRadius:16}),"data-testid":p,children:[o?In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:r?"center":"space-between",p:20,width:"100%",boxSizing:"border-box"},children:[In.jsx(i,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:o}),s,!s&&l&&In.jsx(i,{component:Un.Error,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),null==n||n()}})]}):"",d]})})}var CT;function wT(){return wT=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},wT.apply(null,arguments)}const kT=e=>W.createElement("svg",wT({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),CT||(CT=W.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},W.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 TT({dispatch:t,slippageCoefficient:n,selectedVersion:o,isCustomized:r,isStandardVersion:s}){const l=a(),[u,p]=$(!1),[h,m]=$(n),g=function({selectedVersion:e}){const t=a();return Z((()=>{const n=t.palette.background.paperDarkContrast,i=t.palette.text.disabled,o=t.palette.purple.main,r=T(o,.1);return e===nk.pegged?[{tag:"",description:le._({id:"PPqGw9",message:"Applicable to pegged assets with a fixed price and no fluctuation"}),value:"0",title:"K=0",tagBackgroundColor:"transparent",tagColor:"transparent"},{tag:le._({id:"nTWWCZ",message:"Low"}),description:le._({id:"L4nQwl",message:"Suitable for stablecoins with price fluctuations within 0.5%"}),value:"0.0001",title:"K=0.0001",tagBackgroundColor:r,tagColor:o},{tag:le._({id:"agPptk",message:"Medium"}),description:le._({id:"FrP5tr",message:"Suitable for stablecoins with price fluctuations within 2%"}),value:"0.0005",title:"K=0.0005",tagBackgroundColor:n,tagColor:i},{tag:le._({id:"yx/fMc",message:"High"}),description:le._({id:"bC0iyq",message:"Suitable for stablecoins with price fluctuations within 10%"}),value:"0.002",title:"K=0.002",tagBackgroundColor:n,tagColor:i}]:[{tag:le._({id:"agPptk",message:"Medium"}),description:le._({id:"VXTSOE",message:"Suitable for most situations."}),value:"0.5",title:"K=0.5",tagBackgroundColor:n,tagColor:i},{tag:le._({id:"nTWWCZ",message:"Low"}),description:le._({id:"DPi/hO",message:"Results in a relatively fixed price."}),value:"0.01",title:"K=0.01",tagBackgroundColor:n,tagColor:i},{tag:le._({id:"yx/fMc",message:"High"}),description:le._({id:"fKYdE9",message:"Results in a more volatile price."}),value:"1",title:"K=1",tagBackgroundColor:r,tagColor:o}]}),[e,t.palette])}({selectedVersion:o}),[x,y]=$(n);x!==n&&(y(n),m(n));const v=Z((()=>{const e=hT(h,o);return null!=e?e:""}),[o,h]),b=Z((()=>!(!h||"0"===h||Number(h))),[h]),j=Boolean(v)||b||r&&!h;return In.jsxs(In.Fragment,{children:[In.jsx(fT,{title:In.jsxs(In.Fragment,{children:[In.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),In.jsx(f,{title:le._({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:In.jsxs(i,{component:d,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:8,color:l.palette.text.primary,borderRadius:8,backgroundColor:l.palette.background.cardInput,"&:hover":{backgroundColor:l.palette.hover.default},"&[disabled]>svg":{color:l.palette.text.disabled}},disabled:s,onClick:s?void 0:()=>{p(!0)},children:[In.jsx(i,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px"},children:n}),In.jsx(i,{component:kT,sx:{flexShrink:0,width:18,height:18}})]})}),In.jsx(jT,{open:u,onClose:()=>p(!1),title:In.jsxs(i,{children:[In.jsx(e,{id:"sjn3tj",message:"Slippage Coefficient"}),In.jsx(f,{title:le._({id:"+/wf6Z",message:"The smaller the slippage coefficient, the lower the slippage for traders, and the deeper the market depth."}),ml:8})]}),children:In.jsxs(i,{sx:{flex:1,overflowY:"auto"},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:12,p:l.spacing(8,28,28)},children:[g.map((e=>{const n=!r&&h===e.value;return In.jsx(lT,{title:e.title,description:e.description,onClick:()=>{t({type:Qk.UpdateIsSlippageCoefficientCustomized,payload:!1}),m(e.value)},selected:n,subTitle:e.tag?In.jsx(Dk,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:l.palette.background.paper,borderColor:n?l.palette.primary.main:l.palette.border.main},titleSx:{typography:"body1"}},e.value)})),In.jsx(i,{sx:{mt:8},children:In.jsx(dT,{errorMsg:v,isCustomized:r,onClick:()=>{r||m(""),t({type:Qk.UpdateIsSlippageCoefficientCustomized,payload:!0})},value:h,onChange:e=>{m(e)}})})]}),In.jsx(i,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:In.jsx(c,{fullWidth:!0,disabled:j,onClick:()=>{t({type:Qk.UpdateSlippageCoefficient,payload:h}),p(!1)},children:In.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function ET({token:t,oppositeTokenAddress:n,dispatch:o,tokenSelectOnChange:r}){var s;const l=a(),{chainId:c,account:u}=hd(),[p,h]=H.useState(!1),m=Qe(Object.assign({},Ea.getFetchTokenQuery(c,null==t?void 0:t.address,u)));return t?In.jsxs(In.Fragment,{children:[In.jsxs(i,{component:d,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:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{address:t.address,marginRight:0,width:24,height:24,chainId:t.chainId||c,noShowChain:!0,sx:{flexShrink:0}}),In.jsx(i,{sx:{typography:"h5",color:l.palette.text.primary,fontWeight:600,lineHeight:"32px",flexShrink:0},children:t.symbol}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",typography:"h6",fontWeight:500,color:l.palette.text.secondary,wordBreak:"break-all"},children:["(",In.jsx(e,{id:"fsBGk0",message:"Balance"}),": ",!t.address||m.isLoading?In.jsx(O,{}):Ps({input:null===(s=m.data)||void 0===s?void 0:s.balance,decimals:t.decimals}),")"]})]}),In.jsx(i,{component:kT,sx:{flexShrink:0,ml:"auto",width:18,height:18,color:l.palette.text.secondary}})]}),In.jsx(Zm,{value:t,open:p,chainId:c,occupiedAddrs:[n],occupiedChainId:t.chainId,onClose:()=>{h(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return o({type:Qk.SwitchTokens}),void h(!1);r(e),h(!1)}},modal:!0})]}):null}const AT=({baseToken:t,quoteToken:n,dispatch:i})=>{var o,r;return In.jsxs(fT,{title:In.jsx(e,{id:"dmiCGN",message:"Select Token Pair"}),children:[In.jsx(ET,{token:t,oppositeTokenAddress:null!==(o=null==n?void 0:n.address)&&void 0!==o?o:"",dispatch:i,tokenSelectOnChange:e=>{i({type:Qk.UpdateBaseToken,payload:e})}}),In.jsx(ET,{token:n,oppositeTokenAddress:null!==(r=null==t?void 0:t.address)&&void 0!==r?r:"",dispatch:i,tokenSelectOnChange:e=>{i({type:Qk.UpdateQuoteToken,payload:e})}})]})};function IT({selectedVersion:e,dispatch:t}){const n=a(),{isMobile:o}=Sd(),{versionList:r}=ik(),s="light"===n.palette.mode;return In.jsx(i,{sx:{display:"flex",flexDirection:"column",gap:12,px:20},children:r.map((n=>{const r=e===n.version;return In.jsx(lT,{title:n.title,description:n.description,onClick:()=>{t({type:Qk.SelectNewVersion,payload:n.version})},selected:r,children:o&&r&&In.jsx(i,{component:s?n.exampleImgUrl:n.exampleDarkImgUrl,sx:{mt:28,width:"100%",height:88.1}})},n.version)}))})}function ST(){const t=a(),{defaultBaseToken:n,defaultQuoteToken:o}=$k(),{chainId:r}=hd(),[s,l]=H.useReducer(Jk,{currentStep:0,selectedVersion:nk.standard,baseToken:n,quoteToken:o,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:ck,fixedRatioPrice:dk,leftTokenAddress:null==n?void 0:n.address,feeRate:ak,isFeeRateCustomized:!1,slippageCoefficient:pk,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});!n||s.baseToken&&s.baseToken.chainId===r||l({type:Qk.UpdateBaseToken,payload:n}),!o||s.quoteToken&&s.quoteToken.chainId===r||l({type:Qk.UpdateQuoteToken,payload:o});const{isMobile:d}=Sd(),{versionMap:c}=ik(),u=c[s.selectedVersion],p=s.selectedVersion===nk.singleToken,h=s.selectedVersion===nk.standard,m=s.selectedVersion===nk.pegged,g=p?s.quoteToken:s.baseToken,f=p?s.baseToken:s.quoteToken,x=eT({isSingleTokenVersion:p,leftTokenAddress:s.leftTokenAddress,baseToken:s.baseToken,quoteToken:s.quoteToken,dispatch:l}),y=new Le(s.peggedBaseTokenRatio).div(100).dp(gk,Le.ROUND_DOWN),v=new Le(s.peggedQuoteTokenRatio).div(100).dp(gk,Le.ROUND_DOWN),b=m&&y.lte(0),j=m&&v.lte(0),C=In.jsxs(i,{sx:{px:20},children:[In.jsx(og,{canClickBalance:!0,showPercentage:!0,amt:p?s.quoteAmount:s.baseAmount,onInputChange:p?void 0:e=>{l({type:p?Qk.UpdateQuoteAmount:Qk.UpdateBaseAmount,payload:e})},readOnly:p||b,sx:{backgroundColor:"background.cardInput",padding:t.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"},inputReadonlyTooltip:b?le._({id:"t3d3/V",message:"ratio is 0"}):void 0,token:g,occupiedAddrs:f?[f.address]:void 0,occupiedChainId:r,chainId:r,onTokenChange:m?void 0:(e,t)=>{l(t?{type:Qk.SwitchTokens}:{type:p?Qk.UpdateQuoteToken:Qk.UpdateBaseToken,payload:e})}}),In.jsx(ng,{}),In.jsx(og,{canClickBalance:!0,showPercentage:!0,amt:p?s.baseAmount:s.quoteAmount,onInputChange:e=>{l({type:p?Qk.UpdateBaseAmount:Qk.UpdateQuoteAmount,payload:e})},readOnly:h&&s.isFixedRatio&&!!s.fixedRatioPrice||j,sx:{backgroundColor:"background.cardInput",padding:t.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"},inputReadonlyTooltip:j?le._({id:"t3d3/V",message:"ratio is 0"}):le._({id:"5QDjef",message:"The token amount is calculated by initial price."}),token:f,occupiedAddrs:g?[g.address]:void 0,occupiedChainId:r,chainId:r,onTokenChange:(e,t)=>{l(t?{type:Qk.SwitchTokens}:{type:p?Qk.UpdateBaseToken:Qk.UpdateQuoteToken,payload:e})}})]});return In.jsx(zf,{children:In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"flex-start",height:"100%"},d?{}:{height:"auto",overflowX:"auto"}),children:[d?null:In.jsxs(i,{sx:{mr:12,flexGrow:1,display:"block",overflow:"hidden"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:20},children:[In.jsx(Uj,{}),In.jsx(i,{sx:{typography:"caption",fontWeight:600,color:"text.primary",mr:"auto"},children:In.jsx(e,{id:"pHQq+U",message:"Pool Setup"})}),In.jsx(tv,{poolType:"PMM"})]}),In.jsx(Wk,{titleKey:le._({id:"hdIg7i",message:"Select Pool Version"}),index:1,status:0===s.currentStep?"running":"completed"}),In.jsx(Zk,{versionItem:u,status:0===s.currentStep?"running":"completed"},u.version),In.jsx(Wk,{titleKey:le._({id:"lsg9Mi",message:"Parameter Settings"}),index:2,status:0===s.currentStep?"waiting":1===s.currentStep?"running":"completed"}),m?In.jsx(bk,{status:0===s.currentStep?"waiting":1===s.currentStep?"running":"completed",baseToken:s.baseToken,quoteToken:s.quoteToken,initPrice:s.initPrice,slippageCoefficient:s.slippageCoefficient,selectedVersion:s.selectedVersion,midPrice:void 0}):In.jsx(qk,{status:0===s.currentStep?"waiting":1===s.currentStep?"running":"completed",baseToken:s.baseToken,quoteToken:s.quoteToken,initPrice:s.initPrice,slippageCoefficient:s.slippageCoefficient,selectedVersion:s.selectedVersion,baseAmount:s.baseAmount,quoteAmount:s.quoteAmount}),m&&In.jsxs(In.Fragment,{children:[In.jsx(Wk,{titleKey:le._({id:"6lss/t",message:"Pricing Model"}),index:3,status:s.currentStep>2?"completed":2===s.currentStep?"running":"waiting"}),In.jsx(Vk,{isWaiting:s.currentStep<2,selectedSubPeggedVersion:s.selectedSubPeggedVersion})]}),m?In.jsxs(In.Fragment,{children:[In.jsx(Wk,{titleKey:le._({id:"Y7rVy0",message:"Fee Rate"}),index:4,status:s.currentStep>3?"completed":3===s.currentStep?"running":"waiting"}),In.jsx(Nk,{isWaiting:s.currentStep<3,feeRate:s.feeRate})]}):In.jsxs(In.Fragment,{children:[In.jsx(Wk,{titleKey:le._({id:"Y7rVy0",message:"Fee Rate"}),index:3,status:2===s.currentStep?"running":"waiting"}),In.jsx(Nk,{isWaiting:s.currentStep<2,feeRate:s.feeRate})]}),m&&In.jsxs(In.Fragment,{children:[In.jsx(Wk,{titleKey:le._({id:"3ggd2j",message:"Asset ratio within the pool"}),index:5,status:s.currentStep>4?"completed":4===s.currentStep?"running":"waiting"}),In.jsx(Fk,{isWaiting:s.currentStep<4,baseToken:s.baseToken,quoteToken:s.quoteToken,initPrice:s.initPrice,slippageCoefficient:s.slippageCoefficient,selectedVersion:s.selectedVersion,baseAmount:s.baseAmount,quoteAmount:s.quoteAmount,peggedBaseTokenRatio:s.peggedBaseTokenRatio,peggedQuoteTokenRatio:s.peggedQuoteTokenRatio})]})]}),In.jsxs(i,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,borderRadius:0,backgroundColor:"background.paper",minHeight:"100%"},d?{}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto",height:"100%",position:"sticky",top:"0px",overflowY:"hidden"}),children:[In.jsx(Hk,{currentStep:s.currentStep,isPeggedVersion:m}),0===s.currentStep&&In.jsx(IT,{selectedVersion:s.selectedVersion,dispatch:l}),1===s.currentStep&&In.jsxs(In.Fragment,{children:[m?In.jsx(In.Fragment,{children:In.jsx(AT,{baseToken:s.baseToken,quoteToken:s.quoteToken,dispatch:l})}):In.jsxs(In.Fragment,{children:[In.jsx(Bk,{baseToken:s.baseToken,quoteToken:s.quoteToken,initPrice:s.initPrice,slippageCoefficient:s.slippageCoefficient,selectedVersion:s.selectedVersion,baseAmount:s.baseAmount,quoteAmount:s.quoteAmount}),C]}),In.jsx(TT,{dispatch:l,slippageCoefficient:s.slippageCoefficient,selectedVersion:s.selectedVersion,isCustomized:s.isSlippageCoefficientCustomized,isStandardVersion:h}),In.jsx(xT,{selectedVersion:s.selectedVersion,isFixedRatio:s.isFixedRatio,leftTokenAddress:s.leftTokenAddress,baseToken:s.baseToken,quoteToken:s.quoteToken,fixedRatioPrice:s.fixedRatioPrice,dispatch:l,isStandardVersion:h,isSingleTokenVersion:p,priceInfo:x})]}),m&&2===s.currentStep&&In.jsx(yT,{selectedVersion:s.selectedVersion,selectedSubPeggedVersion:s.selectedSubPeggedVersion,baseToken:s.baseToken,quoteToken:s.quoteToken,initPrice:s.initPrice,dispatch:l}),s.currentStep===(m?3:2)&&In.jsx(mT,{dispatch:l,feeRate:s.feeRate,isFeeRateCustomized:s.isFeeRateCustomized}),m&&4===s.currentStep&&In.jsxs(In.Fragment,{children:[In.jsx(Bk,{baseToken:s.baseToken,quoteToken:s.quoteToken,initPrice:s.initPrice,slippageCoefficient:s.slippageCoefficient,selectedVersion:s.selectedVersion,baseAmount:s.baseAmount,quoteAmount:s.quoteAmount}),In.jsx(bT,{dispatch:l,baseToken:s.baseToken,quoteToken:s.quoteToken,peggedBaseTokenRatio:s.peggedBaseTokenRatio,peggedQuoteTokenRatio:s.peggedQuoteTokenRatio,initPrice:s.initPrice,baseAmount:s.baseAmount,quoteAmount:s.quoteAmount}),In.jsx(fT,{title:In.jsx(e,{id:"E4LM3N",message:"Add Initial Liquidity"}),sx:{mt:20},children:In.jsx(i,{sx:{mx:-20},children:C})})]}),In.jsx(i,{sx:Object.assign({pb:160},d?{}:{pb:28})}),In.jsx(aT,{state:s,dispatch:l,isPeggedVersion:m,isStandardVersion:h,isSingleTokenVersion:p,fiatPriceLoading:x.fiatPriceLoading})]})]})})}function LT({open:t,onClose:n,title:o,children:r,singleBtn:a,danger:s,singleBtnText:l,cancelText:d,confirmText:u,disabledConfirm:p,confirmLoading:h,isManualClose:m,onConfirm:g}){const f=jT;return In.jsx(f,{open:t,onClose:n,title:In.jsx(i,{sx:{textAlign:"center"},children:o}),canBack:!1,titleCenter:!0,children:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,width:"100%"},children:[In.jsx(i,{sx:{typography:"body2",color:o?"text.secondary":"text.primary",textAlign:"center",wordBreak:"break-all",mt:20,px:36},children:r}),a?In.jsx(i,{sx:{px:20},children:In.jsx(c,{fullWidth:!0,variant:c.Variant.outlined,danger:s,sx:{mt:32,mb:20},onClick:()=>{n()},children:l||In.jsx(e,{id:"DPfwMq",message:"Done"})})}):In.jsxs(i,{sx:{mt:24,mb:20,mx:20,display:"flex",alignItems:"center","& > button":{flex:1}},children:[In.jsx(c,{variant:c.Variant.second,onClick:()=>{n()},children:d||In.jsx(e,{id:"dEgA5A",message:"Cancel"})}),In.jsx(c,{sx:{ml:8},variant:c.Variant.outlined,danger:s,disabled:p,isLoading:h,onClick:()=>{g&&g(),m||n()},children:u||In.jsx(e,{id:"7VpPHA",message:"Confirm"})})]})]})})}function OT({sx:t,onClick:n}){const o=a();return In.jsxs(r,{onClick:()=>{n?n():Gf.getState().back()},sx:ne({display:"inline-flex",alignItems:"center",cursor:"pointer","& > svg":{mr:10}},t),children:[In.jsx(i,{sx:{color:o.palette.text.secondary,width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",borderColor:o.palette.border.main,borderStyle:"solid",borderWidth:1,borderRadius:"50%",backgroundColor:o.palette.background.paper,mr:6},children:In.jsx(Un.ArrowBack,{})}),In.jsx(e,{id:"CKyk7Q",message:"Go back"})]})}function RT({open:t,onClose:n,alertContent:o,onConfirm:r}){const s=a(),[l,d]=H.useState(!1),u=le._({id:"LQU+Dm",message:"Risk Disclaimer"});return In.jsx(jT,{open:t,onClose:n,title:u,canBack:!1,titleCenter:!0,children:In.jsxs(i,{sx:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[In.jsx(i,{sx:{mb:20,mx:20,maxHeight:275,overflowY:"auto",borderWidth:1,borderRadius:10,borderStyle:"solid",borderColor:"border.main",p:s.spacing(20),typography:"body2",backgroundColor:s.palette.background.input,color:s.palette.text.primary,textAlign:"left"},children:o}),In.jsxs(i,{sx:{padding:20,pt:12,backgroundColor:s.palette.background.paperContrast},children:[In.jsxs(i,{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:[In.jsx(E,{sx:{top:-1},checked:l,onChange:e=>{const{checked:t}=e.target;d(t)}}),In.jsx(i,{children:In.jsx(e,{id:"dqWPbT",message:"I have read, understand, and agree to the <0>Terms of Service</0>.",components:{0:In.jsx("a",{href:"https://docs.dodoex.io/home/terms-of-service",target:"_blank",rel:"noopener noreferrer"})}})})]}),In.jsx(i,{sx:{mt:12,display:"flex",alignItems:"center"},children:In.jsx(c,{sx:{},disabled:!l,fullWidth:!0,onClick:()=>{d(!1),null==r||r()},children:In.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})]})})}function MT({id:e,chainId:t}){var n,i,o,r,a,s,l,d,c,u,p,h,m;const g=t?pa[t]:"",f=vd().getQuery(me.graphql.fetchPool,{id:e||"",where:{refreshNow:!1,chain:g},liquidityWhere:{chain:g,refreshNow:!1,filterState:{address:e}}}),x=Qe(Object.assign(Object.assign({},f),{enabled:!!e})),{pair:y,liquidity_list:v}=null!==(n=x.data)&&void 0!==n?n:{},b=null===(o=null===(i=null==v?void 0:v.lqList)||void 0===i?void 0:i[0])||void 0===o?void 0:o.pair;return Object.assign(Object.assign({},x),{poolDetail:y&&t?Object.assign(Object.assign({},y),{address:y.id,type:y.type,chainId:t,baseToken:Kl(y.baseToken,t),quoteToken:Kl(y.quoteToken,t),miningAddress:null!==(a=null===(r=null==b?void 0:b.miningAddress)||void 0===r?void 0:r[0])&&void 0!==a?a:"",apy:null==b?void 0:b.apy,baseApy:(null==b?void 0:b.apy)?Ys(new Le(null!==(s=b.apy.transactionBaseApy)&&void 0!==s?s:0).plus(null!==(l=b.apy.miningBaseApy)&&void 0!==l?l:0)):void 0,quoteApy:Number(null===(d=null==b?void 0:b.apy)||void 0===d?void 0:d.transactionQuoteApy)||Number(null===(c=null==b?void 0:b.apy)||void 0===c?void 0:c.miningQuoteApy)?Ys(new Le(null!==(p=null===(u=null==b?void 0:b.apy)||void 0===u?void 0:u.transactionQuoteApy)&&void 0!==p?p:0).plus(null!==(m=null===(h=null==b?void 0:b.apy)||void 0===h?void 0:h.miningQuoteApy)&&void 0!==m?m:0)):void 0,isCpPool:!1,cpAddress:void 0,cpLiquidator:void 0,cpCreator:void 0,cpCreatedAtTimestamp:void 0}):null})}function _T({disabled:t,chainId:n,baseStatus:i,quoteStatus:o,onClick:r}){const{account:a}=hd();return a?i.needShowTokenStatusButton||o.needShowTokenStatusButton?In.jsx(bb,{status:i.needShowTokenStatusButton?i:o,buttonProps:{variant:c.Variant.contained,fullWidth:!0}}):In.jsx(c,{variant:c.Variant.contained,fullWidth:!0,disabled:t,onClick:()=>r(),children:In.jsx(e,{id:"7VpPHA",message:"Confirm"})}):In.jsx(cx,{chainId:n,variant:c.Variant.contained,fullWidth:!0,includeButton:!0})}function PT({state:t,pool:n,loading:o}){var r,s;const{baseToken:l,quoteToken:d,baseAmount:u,quoteAmount:p,initPrice:h,slippageCoefficient:m,feeRate:g}=t,f=Qe(Ql.getPMMStateQuery(null==n?void 0:n.chainId,null==n?void 0:n.address,null==n?void 0:n.type,null===(r=null==n?void 0:n.baseToken)||void 0===r?void 0:r.decimals,null===(s=null==n?void 0:n.quoteToken)||void 0===s?void 0:s.decimals)),x=a(),{isMobile:y}=Sd(),{account:v}=hd(),b=Gf(),[j,C]=H.useState(!1),w=f.data&&u?new Le(u).minus(f.data.baseReserve):void 0,k=f.data&&p?new Le(p).minus(f.data.quoteReserve):void 0,T=null==w?void 0:w.lt(0),E=cc(l,{amount:w}),A=cc(d,{amount:k});let I=!n||o||!u||Number(u)<0||!p||Number(p)<0;if(!I&&d){const e=new Le(h),t=Math.min(d.decimals,16);(!h||e.isNaN()||e.lt(`1e-${t}`)||e.gt(uk))&&(I=!0);const n=new Le(m);(!m||n.isNaN()||n.lt(0)||n.gt(pk))&&(I=!0);const i=new Le(g);(!g||i.isNaN()||i.lt(0)||i.gt(lk))&&(I=!0)}const{modifyDPPMutation:S}=Ub({pool:n||void 0});return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:Object.assign(Object.assign({position:"sticky",left:0,right:0,bottom:0,backgroundColor:x.palette.background.paperContrast,px:20,py:20},y?{}:{position:"static",backgroundColor:"transparent",py:0}),{display:"flex",alignItems:"center",gap:8}),children:[y&&!!v&&In.jsx(c,{variant:c.Variant.second,fullWidth:!0,onClick:()=>{b.back()},children:In.jsx(e,{id:"dEgA5A",message:"Cancel"})}),In.jsx(_T,{disabled:I,chainId:null==n?void 0:n.chainId,baseStatus:E,quoteStatus:A,onClick:()=>C(!0)})]}),In.jsx(nT,{on:j,onClose:()=>C(!1),state:t,isModify:!0,loading:S.isPending,onConfirm:()=>{var e,n;S.mutate({txTitle:le._({id:"KRnA5J",message:"Set pool parameters"}),baseAmount:null!==(e=null==w?void 0:w.toString())&&void 0!==e?e:"",quoteAmount:null!==(n=null==k?void 0:k.toString())&&void 0!==n?n:"",isRemove:T,feeRate:t.feeRate,initPrice:t.initPrice,slippageCoefficient:t.slippageCoefficient,submittedBack:()=>{C(!1),b.push({type:$f.Pool,params:{tab:Sj.myCreated}})}})}})]})}function BT({dispatch:t,feeRate:n,isCustomized:o}){const r=a(),[s,l]=H.useState(!1),[d,u]=H.useState(n),p=uT();!d&&n&&u(n);const h=pT(d),m=!(!d||"0"===d||Number(d)),g=Boolean(h)||m||o&&!d;return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:20,px:20},children:[In.jsxs(i,{sx:{fontWeight:500,display:"flex",alignItems:"center"},children:[In.jsx(e,{id:"Y7rVy0",message:"Fee Rate"}),In.jsx(f,{title:le._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8,size:16})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",ml:12},children:[n,"%",In.jsx(c,{variant:c.Variant.tag,sx:{ml:12,fontSize:12},onClick:()=>l(!0),children:In.jsx(e,{id:"ePK91l",message:"Edit"})})]})]}),In.jsx(jT,{open:s,onClose:()=>l(!1),title:In.jsxs(i,{children:[In.jsx(e,{id:"Y7rVy0",message:"Fee Rate"}),In.jsx(f,{title:le._({id:"2vjOqX",message:"Pools with lower transaction fees will attract more traders."}),ml:8})]}),children:In.jsxs(i,{sx:{flex:1,overflowY:"auto"},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:12,p:r.spacing(8,28,28)},children:[p.map((e=>{const n=!o&&d===e.value;return In.jsx(lT,{title:e.title,description:e.description,onClick:()=>{t({type:Qk.UpdateIsFeeRateCustomized,payload:!1}),u(e.value)},selected:n,subTitle:e.tag?In.jsx(Dk,{color:e.tagColor,backgroundColor:e.tagBackgroundColor,tagKey:e.tag}):void 0,sx:{backgroundColor:r.palette.background.paper,borderColor:n?r.palette.primary.main:r.palette.border.main}},e.value)})),In.jsx(i,{sx:{mt:8},children:In.jsx(dT,{errorMsg:h,isCustomized:o,onClick:()=>{o||u(""),t({type:Qk.UpdateIsFeeRateCustomized,payload:!0})},value:d,onChange:e=>{u(e)}})})]}),In.jsx(i,{sx:{position:"sticky",bottom:0,px:20,py:16,backgroundColor:"background.paperContrast"},children:In.jsx(c,{fullWidth:!0,disabled:g,onClick:()=>{t({type:Qk.UpdateFeeRate,payload:d}),l(!1)},children:In.jsx(e,{id:"7VpPHA",message:"Confirm"})})})]})})]})}function DT({titleKey:e}){const t=a();return In.jsxs(In.Fragment,{children:[In.jsx(i,{sx:{mt:28,mb:28,borderTopColor:"divider",borderTopStyle:"solid",borderTopWidth:1}}),In.jsx(i,{sx:{display:"flex",alignItems:"center",mb:20},children:In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:t.palette.text.primary},children:e})})]})}function NT({params:t}){var n,o,r,s;const l=a(),{isMobile:d}=Sd(),{chainId:c}=hd(),[u,p]=H.useState(!1),[h,m]=H.useReducer(Jk,{currentStep:0,selectedVersion:nk.marketMakerPool,baseToken:null,quoteToken:null,baseAmount:"",quoteAmount:"",isFixedRatio:!0,initPrice:dk,fixedRatioPrice:dk,leftTokenAddress:void 0,feeRate:ak,isFeeRateCustomized:!1,slippageCoefficient:pk,isSlippageCoefficientCustomized:!1,peggedBaseTokenRatio:"",peggedQuoteTokenRatio:""});H.useEffect((()=>{p(!window.localStorage.getItem(ys.PoolEditPage))}),[]);const[g,f]=H.useState("inital"),x=MT({id:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),{poolDetail:y}=x,v=vn(x,["poolDetail"]);v.isPending||v.error||y||"inital"!==g||f("open"),!h.baseToken&&(null==y?void 0:y.baseToken)&&m({type:Qk.InitEditParameters,payload:y});const b=Qe(Ql.getPMMStateQuery(null==y?void 0:y.chainId,null==y?void 0:y.address,null==y?void 0:y.type,null===(n=null==y?void 0:y.baseToken)||void 0===n?void 0:n.decimals,null===(o=null==y?void 0:y.quoteToken)||void 0===o?void 0:o.decimals));if(!h.slippageCoefficient&&(null===(s=null===(r=b.data)||void 0===r?void 0:r.pmmParamsBG)||void 0===s?void 0:s.k)){const e=b.data.pmmParamsBG.k.toString(),t=!Yk({selectedVersion:h.selectedVersion}).includes(e);m({type:Qk.UpdateSlippageCoefficient,payload:e}),m({type:Qk.UpdateIsSlippageCoefficientCustomized,payload:t})}!h.baseAmount&&b.data&&(m({type:Qk.UpdateBaseAmount,payload:b.data.baseReserve.toString()}),m({type:Qk.UpdateQuoteAmount,payload:b.data.quoteReserve.toString()})),!h.fixedRatioPrice&&b.data&&m({type:Qk.UpdateFixedRatioPrice,payload:b.data.pmmParamsBG.i.toString()});const C=Qe(Ql.getLPFeeRateQuery(null==y?void 0:y.chainId,null==y?void 0:y.address,null==y?void 0:y.type));if(!h.feeRate&&C.data){const e=C.data.times(100).toString(),t=-1===cT().findIndex((t=>t.value===e));m({type:Qk.UpdateFeeRate,payload:e}),m({type:Qk.UpdateIsFeeRateCustomized,payload:t})}const w=h.selectedVersion===nk.singleToken,k=h.selectedVersion===nk.standard,T=eT({isSingleTokenVersion:w,leftTokenAddress:h.leftTokenAddress,baseToken:h.baseToken,quoteToken:h.quoteToken,dispatch:m}),{versionMap:E}=ik(),A=E[h.selectedVersion],I=!(null==y?void 0:y.baseToken),S=In.jsx(j,{variant:"rounded",width:210,height:60,sx:{padding:16,borderRadius:8}}),L=In.jsx(j,{variant:"rounded",height:167,sx:{mx:20,borderRadius:16}});return In.jsxs(In.Fragment,{children:[In.jsx(zf,{children:In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"flex-start"},d?{height:"100%"}:{height:"auto"}),children:[d?null:In.jsxs(i,{sx:{mr:12,flexGrow:1,display:"block"},children:[In.jsx(OT,{}),In.jsx(i,{sx:{mt:28,typography:"h5",fontWeight:600,color:"text.primary"},children:In.jsx(e,{id:"pHQq+U",message:"Pool Setup"})}),In.jsx(DT,{titleKey:le._({id:"hdIg7i",message:"Select Pool Version"})}),In.jsx(Zk,{versionItem:A,status:"completed"},A.version),In.jsx(DT,{titleKey:le._({id:"lsg9Mi",message:"Parameter Settings"})}),I?S:In.jsx(qk,{status:"running",baseToken:h.baseToken,quoteToken:h.quoteToken,initPrice:h.initPrice,slippageCoefficient:h.slippageCoefficient,selectedVersion:h.selectedVersion,baseAmount:h.baseAmount,quoteAmount:h.quoteAmount}),In.jsx(DT,{titleKey:le._({id:"Y7rVy0",message:"Fee Rate"})}),I?S:In.jsx(Nk,{isWaiting:!1,feeRate:h.feeRate})]}),In.jsxs(i,{sx:Object.assign({flexGrow:1,flexShrink:0,flexBasis:375,backgroundColor:"background.paper"},d?{width:"100%",borderRadius:0,minHeight:"100%"}:{pb:20,borderRadius:16,flexGrow:0,minHeight:"auto"}),children:[In.jsx(i,{sx:Object.assign({top:0,py:20,px:20,backgroundColor:l.palette.background.paper,zIndex:1},d?{position:"sticky"}:{position:"static",borderTopLeftRadius:16,borderTopRightRadius:16}),children:In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:In.jsx(i,{sx:{typography:"h5",color:l.palette.text.primary,fontWeight:600},children:In.jsx(e,{id:"6XYkjc",message:"Edit Parameter Settings"})})})}),I?null:In.jsx(Bk,{baseToken:h.baseToken,quoteToken:h.quoteToken,initPrice:h.initPrice,slippageCoefficient:h.slippageCoefficient,selectedVersion:h.selectedVersion,baseAmount:h.baseAmount,quoteAmount:h.quoteAmount}),I?L:In.jsxs(i,{sx:{px:20},children:[In.jsx(og,{canClickBalance:!0,showPercentage:!0,amt:h.baseAmount,onInputChange:e=>{m({type:Qk.UpdateBaseAmount,payload:e})},readOnly:w,token:h.baseToken,occupiedAddrs:h.quoteToken?[h.quoteToken.address]:void 0,occupiedChainId:c,chainId:c}),In.jsx(ig,{}),In.jsx(og,{canClickBalance:!0,showPercentage:!0,amt:h.quoteAmount,onInputChange:e=>{m({type:Qk.UpdateQuoteAmount,payload:e})},token:h.quoteToken,occupiedAddrs:h.baseToken?[h.baseToken.address]:void 0,occupiedChainId:c,chainId:c})]}),I?null:In.jsxs(In.Fragment,{children:[h.selectedVersion!==nk.standard&&In.jsx(TT,{dispatch:m,slippageCoefficient:h.slippageCoefficient,selectedVersion:h.selectedVersion,isCustomized:h.isSlippageCoefficientCustomized,isStandardVersion:k}),In.jsx(xT,{selectedVersion:h.selectedVersion,isFixedRatio:h.isFixedRatio,leftTokenAddress:h.leftTokenAddress,baseToken:h.baseToken,quoteToken:h.quoteToken,fixedRatioPrice:h.fixedRatioPrice,dispatch:m,isStandardVersion:k,isSingleTokenVersion:w,priceInfo:T}),In.jsx(BT,{dispatch:m,feeRate:h.feeRate,isCustomized:h.isFeeRateCustomized})]}),In.jsx(i,{sx:{pb:160,[l.breakpoints.up("tablet")]:{pb:28}}}),In.jsx(PT,{state:h,pool:y,loading:I})]})]})}),In.jsx(LT,{singleBtn:!0,open:"open"===g,onClose:()=>f("close"),onConfirm:()=>f("close"),title:le._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),In.jsx(RT,{open:u,onClose:()=>{p(!1)},onConfirm:()=>{window.localStorage.setItem(ys.PoolEditPage,"1"),p(!1)},alertContent:In.jsx(e,{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 FT(e){return null==e?0:new Le(e).dp(4,Le.ROUND_DOWN).toNumber()}function UT({unit:t,data:n,masterKey:o,sumKey:r}){const s=a(),l=H.useRef(null),[d,c]=H.useState(null),[u,p]=H.useState(0);H.useEffect((()=>{const e=()=>{l&&l.current&&p(l.current.offsetWidth)};return setTimeout(e,100),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[l]);const h="light"===s.palette.mode?T(s.palette.success.main,.6):s.palette.primary.main,m="#ff9553",g=n[n.length-2],f="date";let x=[];if(null==n?void 0:n.length){let e=n[0][o];n.forEach((t=>{t[o]>e&&(e=t[o])})),x=e?[0,Math.ceil(e/3),Math.ceil(e/3*2),e]:[0]}let y=0;x.forEach((e=>{const t=zs(new Le(e));let n=t.replace(".","").length;t.indexOf(".")>-1&&(n+=.11),n>y&&(y=n)}));const v=10*y+2;return In.jsxs(i,{ref:l,sx:{position:"relative"},children:[In.jsxs(i,{sx:{minHeight:62,mb:10},children:[In.jsxs(i,{sx:{typography:"caption",mb:8},children:[t||In.jsx("span",{children:" "}),_s({input:null==g?void 0:g[r]})]}),In.jsx(i,{sx:{color:"text.secondary"},children:Dt(null==g?void 0:g[f]).format("LL")})]}),In.jsxs(zt,{width:u,height:364,data:n,margin:{top:5,right:10,left:0,bottom:5},children:[In.jsx("defs",{children:n.map(((e,t)=>In.jsxs("linearGradient",{id:`colorBar${e.date}`,x1:"0",x2:"0",y1:"0",y2:"1",children:[In.jsx("stop",{offset:"0%",stopColor:t===n.length-1?m:h}),In.jsx("stop",{offset:"100%",stopColor:T(t===n.length-1?m:h,.04)})]},e.date)))}),In.jsx(Vt,{hide:!0,dataKey:f,axisLine:!1,tickFormatter:e=>Dt(e).format("MM-DD")}),In.jsx(Wt,{orientation:"right",axisLine:!1,ticks:x,width:v,tickFormatter:e=>zs(new Le(e))}),In.jsx($t,{isAnimationActive:!1,content:({active:t,payload:n,label:o})=>{if(!(t&&n&&n.length))return null;const r=Dt(o).format("YYYY-MM-DD")===Dt().format("YYYY-MM-DD");return In.jsxs(i,{sx:{px:10,py:12,maxWidth:240,borderRadius:8,backgroundColor:"background.paperContrast",typography:"h6",color:"text.secondary"},children:[In.jsx(i,{sx:{mr:8},children:Dt(o).format("MM-DD HH:mm")}),In.jsx(i,{children:n[0].value}),r?In.jsx(i,{children:In.jsx(e,{id:"ubzjDN",message:"Real Time"})}):""]})},cursor:!1,coordinate:{x:0,y:0}}),In.jsx(Gt,{dataKey:o,onMouseMove:e=>{c(e[f])},onMouseLeave:()=>{c(null)},children:n.map((e=>In.jsx(Yt,{fill:`url(#colorBar${e.date})`},e.date)))}),d&&In.jsx(Qt,{x:d,stroke:h,strokeDasharray:"3 3"})]})]})}var qT,VT;function WT({poolDetail:e,chart24hDataFirst:t}){var n,o,r,s,l,d,c,u;const p=a(),[h,m]=H.useState(t?qT.volume:qT.depth),g={key:qT.depth,value:le._({id:"n25Lml",message:"Depth"})},f=[{key:qT.volume,value:le._({id:"/cF7Rs",message:"Volume"})},{key:qT.feeRevenue,value:le._({id:"9QjAGB",message:"FeeRevenue"})},{key:qT.traders,value:le._({id:"qDhDFK",message:"Traders"})}];t?f.push(g):f.splice(0,0,g);const x=function({address:e,chainId:t,day:n}){var i,o,r;const a=t?pa[t]:"",s=vd().getQuery(me.graphql.fetchPoolDayData,{where:{pair_address:null!=e?e:"",chain:a,day:n}}),l=Qe(Object.assign(Object.assign({},s),{enabled:!!e&&!!t})),d=null!==(r=null===(o=null===(i=l.data)||void 0===i?void 0:i.dashboard_pairs_day_data)||void 0===o?void 0:o.map((e=>{var t,n;return{volume:FT(null==e?void 0:e.volumeUsd),fee:FT(new Le(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:FT(null==e?void 0:e.tvlUsd)}})))&&void 0!==r?r:[];return Object.assign(Object.assign({},l),{dayDataList:d})}({chainId:null==e?void 0:e.chainId,address:null==e?void 0:e.address,day:30}),y=Qe(Ql.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===(o=null==e?void 0:e.quoteToken)||void 0===o?void 0:o.decimals)),{pmmParamsBG:v}=null!==(r=y.data)&&void 0!==r?r:{},b=v?{i:v.i.toNumber(),k:v.k.toNumber(),b:v.b.toNumber(),b0:v.b0.toNumber(),q:v.q.toNumber(),q0:v.k.isEqualTo(0)?v.q.toNumber():v.q0.toNumber(),R:v.k.isEqualTo(0)?0:v.R}:void 0,j=b?Ae(b):void 0,[C,w]=H.useState(!1),k=C&&(null===(s=y.data)||void 0===s?void 0:s.midPrice)?new Le(1).div(null===(l=y.data)||void 0===l?void 0:l.midPrice):null===(d=y.data)||void 0===d?void 0:d.midPrice;return In.jsx(i,{sx:{mt:24,[p.breakpoints.up("tablet")]:{mt:20,pt:28,borderTop:`1px solid ${p.palette.border.main}`}},children:In.jsxs(A,{value:h,onChange:(e,t)=>m(t),children:[In.jsx(D,{tabs:f,variant:"rounded",tabsListSx:{borderWidth:0,gap:4,mb:24}}),h===qT.depth&&(null==e?void 0:e.baseToken)&&(null==e?void 0:e.quoteToken)?In.jsx(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:In.jsx(HT,{baseToken:null==e?void 0:e.baseToken,quoteToken:null==e?void 0:e.quoteToken,midPrice:k,isSwitchMidPrice:C,setIsSwitchMidPrice:w,showMidPrice:h===qT.depth})}):"",In.jsx(L,{value:qT.depth,children:In.jsx(_k,{baseToken:null!==(c=null==e?void 0:e.baseToken)&&void 0!==c?c:null,quoteToken:null!==(u=null==e?void 0:e.quoteToken)&&void 0!==u?u:null,pmmParams:b,pmmModel:j,midPrice:k})}),In.jsx(L,{value:qT.volume,children:In.jsx(UT,{data:x.dayDataList,masterKey:"volume",sumKey:"volume",unit:"$"})}),In.jsx(L,{value:qT.feeRevenue,children:In.jsx(UT,{data:x.dayDataList,masterKey:"fee",sumKey:"fee",unit:"$"})}),In.jsx(L,{value:qT.traders,children:In.jsx(UT,{data:x.dayDataList,masterKey:"traders",sumKey:"traders",unit:""})})]})})}function HT({baseToken:e,quoteToken:t,midPrice:n,isSwitchMidPrice:o,setIsSwitchMidPrice:a,showMidPrice:s}){const l=null==e?void 0:e.symbol,d=null==t?void 0:t.symbol,c=o?d:l,u=o?l:d;return In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:s?In.jsxs(i,{sx:{mt:4,typography:"body2",color:"text.secondary",wordBreak:"break-all",display:"flex"},children:[`1 ${c} = ${n?_s({input:n,showDecimals:16}):"-"} ${u}`,In.jsx(r,{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:()=>a((e=>!e)),children:In.jsx(i,{component:Un.Switch})})]}):""})}function ZT({poolDetail:t}){var n,o,r;const{isMobile:s}=Sd(),l=a(),c=null==t?void 0:t.chainId;null===(r=Qe(Ql.getPMMStateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(n=null==t?void 0:t.baseToken)||void 0===n?void 0:n.decimals,null===(o=null==t?void 0:t.quoteToken)||void 0===o?void 0:o.decimals)).data)||void 0===r||r.midPrice;const u=function({pool:e}){var t,n,i,o,r,a,s;const{chainId:l,address:d,type:c,baseToken:u,quoteToken:p}=e||{},h=null!=d?d:"",m=l?pa[l]:"",g=null==u?void 0:u.decimals,f=null==p?void 0:p.decimals,x=Qe(Ql.getPMMStateQuery(l,d,c,null==u?void 0:u.decimals,null==p?void 0:p.decimals)),y=null===(t=x.data)||void 0===t?void 0:t.midPrice,v=Qe(Ql.getTotalBaseLpQuery(l,d,c,g)),b=Qe(Ql.getTotalQuoteLpQuery(l,d,c,f)),j=Qe(Ql.getReserveLpQuery(l,d,c,g,f)),C=Qe(Ql.getClassicalTargetQuery(l,d,c,g,f)),w=v.data;let k=b.data;k||b.isLoading||b.error||!w||(k=w);const{baseReserve:T,quoteReserve:E}=j.data||{},A=null===(n=C.data)||void 0===n?void 0:n.baseTarget,I=null===(i=C.data)||void 0===i?void 0:i.quoteTarget,S=Gk({tokens:p?[p]:[]}),L=vd(),O=Qe(Object.assign(Object.assign({},L.getQuery(me.graphql.fetchLiquidityPositions,{id:h,where:{pair:h,liquidityTokenBalance_not:"0",chain:m,refreshNow:!0},miningWhere:{pair:h,liquidityTokenInMining_not:"0",chain:m},first:1e3,orderBy:"liquidityTokenBalance",orderDirection:"desc"})),{enabled:!!d})),{balance:R,mining:M,pair:_}=null!==(o=O.data)&&void 0!==o?o:{};let P=[];const B=p?null===(r=S.data)||void 0===r?void 0:r.get(p.address):void 0;if(R&&M&&_){const{baseLpToken:e,quoteLpToken:t}=_,n=new Map,i=(null==e?void 0:e.id)===(null==t?void 0:t.id);for(const o of R){const{id:r,liquidityTokenBalance:a}=o,s=new Le(null!=a?a:0),[l,u]=r.split("-");let p={id:l,baseSupplied:new Le(0),quoteSupplied:new Le(0)};n.has(p.id)?p=n.get(p.id):n.set(p.id,p);const[,h]=db(s,w,T,A,d,c,g);h&&(i||u===(null==e?void 0:e.id))&&(p.baseSupplied=h);const[,m]=db(s,k,E,I,d,c,f);m&&(i||u===(null==t?void 0:t.id))&&(p.quoteSupplied=m)}for(const o of M){const{id:r,liquidityTokenInMining:a}=o,s=new Le(null!=a?a:0),[l,u]=r.split("-"),[,p]=db(s,w,T,A,d,c,g),[,h]=db(s,k,E,I,d,c,f);if(n.has(l)){const o=n.get(l);p&&(i||u===(null==e?void 0:e.id))&&(o.baseSupplied=p.plus(o.baseSupplied)),h&&(i||u===(null==t?void 0:t.id))&&(o.quoteSupplied=h.plus(o.quoteSupplied))}else{const o={id:l,baseSupplied:new Le(0),quoteSupplied:new Le(0)};p&&(i||u===(null==e?void 0:e.id))&&(o.baseSupplied=p),h&&(i||u===(null==t?void 0:t.id))&&(o.quoteSupplied=h),n.set(o.id,o)}}const o=(null!==(a=null==u?void 0:u.decimals)&&void 0!==a?a:0)>6?6:4,r=(null!==(s=null==p?void 0:p.decimals)&&void 0!==s?s:0)>6?6:4,l=B;n.forEach((e=>{var t,n;P.push({userId:e.id,baseSupplied:e.baseSupplied?_s({input:e.baseSupplied,showDecimals:o}):"0",quoteSupplied:e.quoteSupplied?_s({input:e.quoteSupplied,showDecimals:r}):"0",baseTokenAddress:null!==(t=null==u?void 0:u.address)&&void 0!==t?t:"",quoteTokenAddress:null!==(n=null==p?void 0:p.address)&&void 0!==n?n:"",baseTokenSymbol:Qs(u),quoteTokenSymbol:Qs(p),sharePercentage:y&&T?_s({input:y.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).div(y.multipliedBy(T).plus(null!=E?E:0)).multipliedBy(100),showDecimals:2}):"",dollarValue:null!=l&&y?`$${_s({input:y.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0).multipliedBy(l),showDecimals:2})}`:"-",dollarValueBN:y?y.multipliedBy(e.baseSupplied||0).plus(e.quoteSupplied||0):Le(0)})})),P.sort(((e,t)=>t.dollarValueBN.gt(e.dollarValueBN)?1:-1))}const D=[x,v,b,C,j,S,O],N=function(e){const t=[];if(e.forEach((e=>{e.error&&t.push(e.refetch)})),t.length)return()=>{t.forEach((e=>e()))}}(D),F=D.some((e=>e.isLoading));return Object.assign(Object.assign({},O),{isLoading:F,errorRefetch:N,list:P})}({pool:t}),[p,h]=H.useState(1),m=p*(s?4:8),g=u.list,f=m<g.length,x=g.slice(0,m);return In.jsx(i,{sx:{display:"flex",flexDirection:"column"},children:In.jsx(fg,{refetch:u.error?u.refetch:void 0,loading:u.isLoading&&!(null==x?void 0:x.length),empty:!(null==x?void 0:x.length),children:!!(null==x?void 0:x.length)&&In.jsxs(i,{children:[In.jsx(i,{sx:{overflowX:"auto",minHeight:244},children:In.jsxs(i,{component:"table",sx:{minWidth:"100%"},children:[In.jsx(i,{component:"thead",sx:{position:"sticky",top:0},children:In.jsxs(i,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[In.jsx(i,{component:"th",children:In.jsx(e,{id:"JlIjZf",message:"Liquidity Provider"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"C1qIFl",message:"Liquidity Supplied"})}),In.jsx(i,{component:"th",sx:{"&&":{textAlign:"right"}},children:In.jsx(e,{id:"me2dmq",message:"Value (USD)"})}),In.jsx(i,{component:"th",sx:{"&&":{textAlign:"right"}},children:In.jsx(e,{id:"Z8lGw6",message:"Share"})})]})}),In.jsx(i,{component:"tbody",children:null==x?void 0:x.map((e=>In.jsxs(i,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[In.jsx("td",{children:In.jsx(i,{sx:{display:"flex",alignItems:"center"},children:In.jsx(qm,{address:e.userId,customChainId:c,truncate:!0})})}),In.jsxs("td",{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{address:e.baseTokenAddress,chainId:c,width:18,height:18}),`${e.baseSupplied} ${e.baseTokenSymbol}`]}),In.jsxs(i,{sx:{mt:4,display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{address:e.quoteTokenAddress,chainId:c,width:18,height:18}),`${e.quoteSupplied} ${e.quoteTokenSymbol}`]})]}),In.jsx(i,{component:"td",sx:{textAlign:"right"},children:e.dollarValue}),In.jsx(i,{component:"td",sx:{textAlign:"right"},children:`${e.sharePercentage}%`})]},e.userId)))})]})}),f&&In.jsxs(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:l.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>h((e=>e+1)),children:[In.jsx(e,{id:"yQ2kGp",message:"Load more"}),In.jsx(i,{component:Un.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function zT({address:e,chainId:t}){var n;const i=vd(),o=t?pa[t]:"",r=i.getQuery(me.graphql.fetchPoolDashboard,{where:{pair_address:null!=e?e:"",chain:o}}),a=Qe(Object.assign(Object.assign({},r),{enabled:!!e&&!!t})),s=null===(n=a.data)||void 0===n?void 0:n.dashboard_pairs_detail;return Object.assign(Object.assign({},a),{dashboard:s})}function $T(e,t){if(!e)return"";const n=Dt(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function GT({chainId:e,address:t,symbol:n,amount:o,sx:r}){return In.jsxs(i,{sx:ne({display:"flex",justifyContent:"flex-end",alignItems:"center"},r),children:[t&&In.jsx(i,{sx:{height:16,flexBasis:16,flexGrow:0,flexShrink:0,mr:4},children:In.jsx(Fc,{width:16,height:16,address:t,chainId:e})}),In.jsxs(i,{sx:{textAlign:"right",display:"flex",alignItems:"center"},children:[o," ",In.jsx(i,{sx:{display:"inline-block",maxWidth:"6em",minWidth:"auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"},title:n,children:n})]})]})}function YT({chainId:e,baseToken:t,quoteToken:n,baseAmount:o,quoteAmount:r,vertical:a}){const{isMobile:s}=Sd();return In.jsxs(i,{sx:{mt:4,display:"flex",justifyContent:"flex-end",flexDirection:a?"column":"row",alignItems:a?"flex-end":"center",flexWrap:"wrap",typography:s?"h6":"body1"},children:[t?In.jsx(GT,{chainId:e,address:null==t?void 0:t.address,amount:o,symbol:null==t?void 0:t.symbol}):"-",a?"":In.jsx(i,{sx:{mx:10},children:"/"}),n?In.jsx(GT,{chainId:e,address:null==n?void 0:n.address,amount:r,symbol:null==n?void 0:n.symbol,sx:{mt:a?4:0}}):"-"]})}function QT({label:e,children:t,pairsStatLoading:n,poolDetailLoading:o}){const{isMobile:r}=Sd();return In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between"},children:[In.jsx(i,{sx:{color:"text.secondary",minWidth:"5em",typography:r?"h6":"body1"},children:e}),In.jsx(i,{sx:ne({textAlign:"right",overflow:"hidden","& .title":{typography:r?"body1":"caption",width:"100%"}},n&&!o||!n&&o?{ml:8,flex:1,display:"flex",flexDirection:"column",alignItems:"flex-end","& .title":{display:"flex",justifyContent:"flex-end"}}:{}),children:t})]})}function XT({sx:e}){return In.jsx(j,{sx:Object.assign({width:"100%",maxWidth:237,height:22},e)})}function KT({detail:e,lpFeeRate:t,mtFeeRate:n}){const{isMobile:o}=Sd();return"DPP"===(null==e?void 0:e.type)?null:e&&t&&n?In.jsxs(i,{sx:{color:"text.secondary",typography:o?"h6":"body1"},children:[In.jsx("span",{children:"LP "}),In.jsx("span",{children:Gs({input:t,showDecimals:6})}),In.jsxs("span",{children:[" / ",le._({id:"7C/BwI",message:"Community Treasury"})," "]}),In.jsx("span",{children:Gs({input:new Le(null!=n?n:0).toNumber(),showDecimals:6})})]}):In.jsx(XT,{sx:{mt:4}})}function JT({detail:e}){var t,n,o,r,s,l,d,c,u,p,h,m,g,f,x,y,v,b,j,C,w,k,T,E,A,I,S;const L=a(),{isMobile:O}=Sd(),{baseToken:R,quoteToken:M}=null!=e?e:{},_="DPP"===(null==e?void 0:e.type),P="DSP"===(null==e?void 0:e.type)||"GSP"===(null==e?void 0:e.type),B="CLASSICAL"===(null==e?void 0:e.type),D=zT({address:null==e?void 0:e.address,chainId:null==e?void 0:e.chainId}),N=D.dashboard,F=D.isLoading,U=Qe(Ql.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)),q=F?In.jsx(XT,{}):null===(null==N?void 0:N.totalVolume)||void 0===(null==N?void 0:N.totalVolume)?"-":`$${_s({input:new Le(null==N?void 0:N.totalVolume),showDecimals:2})}`,V=F?In.jsx(XT,{}):N&&(dg(N.totalFee)||dg(N.totalMtFee))?`$${_s({input:new Le(N.totalFee||0).plus(N.totalMtFee||0),showDecimals:2})}`:"-",{account:W}=hd(),H=Qe(Ql.getFeeRateQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,W)),Z=null===(o=H.data)||void 0===o?void 0:o.mtFeeRate,z=null===(r=H.data)||void 0===r?void 0:r.lpFeeRate,$=null==Z?void 0:Z.plus(null!=z?z:0),G=!e,Y=Qe(Ql.getClassicalTargetQuery(null==e?void 0:e.chainId,null==e?void 0:e.address,null==e?void 0:e.type,null===(s=null==e?void 0:e.baseToken)||void 0===s?void 0:s.decimals,null===(l=null==e?void 0:e.quoteToken)||void 0===l?void 0:l.decimals));return In.jsxs(i,{sx:Object.assign({pb:30,position:"relative",overflow:"hidden"},O?{backgroundColor:"background.paper",p:20}:{mt:32}),children:[In.jsxs(i,{sx:{flex:"1 0 50%","& > div + div":{mt:10},"&::after":{content:'""',display:"block",my:20,width:"100%",height:"1px",backgroundColor:"border.main"}},children:[In.jsx(QT,{label:le._({id:"l4Za6X",message:"Total Swap Volume"}),pairsStatLoading:F,children:In.jsx("div",{className:"title",children:q})}),F||!e?In.jsx(XT,{sx:{mt:4}}):In.jsx(YT,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:_s({input:null!==(d=null==N?void 0:N.baseVolumeCumulative)&&void 0!==d?d:0,showDecimals:2}),quoteAmount:_s({input:null!==(c=null==N?void 0:N.quoteVolumeCumulative)&&void 0!==c?c:0,showDecimals:2})}),In.jsx(QT,{label:le._({id:"Z033WN",message:"Total Swap Fee"}),pairsStatLoading:F,children:In.jsx("div",{className:"title",children:V})}),F||!e?In.jsx(XT,{sx:{mt:4}}):In.jsx(YT,{chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:_s({input:new Le(null!==(u=null==N?void 0:N.baseFee)&&void 0!==u?u:0).plus(null!==(p=null==N?void 0:N.baseMtFee)&&void 0!==p?p:0),showDecimals:2}),quoteAmount:_s({input:new Le(null!==(h=null==N?void 0:N.quoteFee)&&void 0!==h?h:0).plus(null!==(m=null==N?void 0:N.quoteMtFee)&&void 0!==m?m:0),showDecimals:2})}),In.jsx(QT,{label:le._({id:"/BbUJ6",message:"Total Number of Traders"}),pairsStatLoading:F,children:F?In.jsx(XT,{sx:{mt:4}}):_s({input:null!==(g=null==N?void 0:N.txUsers)&&void 0!==g?g:0,showDecimals:0})})]}),In.jsxs(i,{sx:{flex:"1 0 50%",overflow:"hidden","& > div + div":{mt:10}},children:[In.jsx(QT,{label:le._({id:"UE2beD",message:"Creator"}),poolDetailLoading:!e,children:e?e.isCpPool?In.jsx(qm,{address:null!==(f=e.cpCreator)&&void 0!==f?f:"",truncate:!0,"data-key":"link",sx:{color:L.palette.text.primary}}):In.jsx(qm,{address:null!==(x=e.creator)&&void 0!==x?x:"",truncate:!0,"data-key":"link",sx:{color:L.palette.text.primary}}):In.jsx(XT,{})}),(null==e?void 0:e.isCpPool)||(null==e?void 0:e.owner)?In.jsx(QT,{label:le._({id:"LtI9AS",message:"Owner"}),poolDetailLoading:G,children:G?In.jsx(XT,{}):(null==e?void 0:e.isCpPool)?In.jsx(qm,{address:null==e?void 0:e.cpCreator,truncate:!0,"data-key":"link",sx:{color:L.palette.text.primary}}):In.jsx(qm,{address:null!==(y=e.owner)&&void 0!==y?y:"",truncate:!0,"data-key":"link",sx:{color:L.palette.text.primary}})}):"",In.jsx(QT,{label:le._({id:"52uNwk",message:"Creation Time"}),poolDetailLoading:G,children:G?In.jsx(XT,{}):$T(1e3*Number((null==e?void 0:e.isCpPool)?e.cpCreatedAtTimestamp||0:e.createdAtTimestamp||0))||"-"}),(null==e?void 0:e.isCpPool)?In.jsxs(In.Fragment,{children:[In.jsx(QT,{label:le._({id:"cDWXuq",message:"Settler"}),poolDetailLoading:G,children:G?In.jsx(XT,{}):In.jsx(qm,{address:(null==e?void 0:e.cpLiquidator)||"",truncate:!0,"data-key":"link",sx:{color:L.palette.text.primary}})}),In.jsx(QT,{label:le._({id:"JuzN3b",message:"Related CrowdPooling"}),poolDetailLoading:G,children:G?In.jsx(XT,{}):In.jsx(qm,{address:null==e?void 0:e.cpAddress,truncate:!0,"data-key":"link",sx:{color:L.palette.text.primary}})})]}):void 0,In.jsxs(QT,{label:le._({id:"Y7rVy0",message:"Fee Rate"}),poolDetailLoading:G,children:[In.jsx("div",{className:"detail-title",style:{textAlign:"right"},children:Gs({input:null==$?void 0:$.toNumber(),showDecimals:6})}),In.jsx(KT,{detail:e,lpFeeRate:z,mtFeeRate:Z})]}),In.jsx(QT,{label:le._({id:"sjn3tj",message:"Slippage Coefficient"}),poolDetailLoading:G,children:G?In.jsx(XT,{}):null===(b=null===(v=U.data)||void 0===v?void 0:v.pmmParamsBG)||void 0===b?void 0:b.k.toString()}),In.jsx(QT,{poolDetailLoading:G,label:B?le._({id:"d8YnVj",message:"Guide Price"}):_?le._({id:"CeLrge",message:"Mid Price"}):P?le._({id:"4ogEAw",message:"Pegged Exchange Rate"}):le._({id:"jjuKOj",message:"Min Price"}),children:G?In.jsx(XT,{}):null!==R&&(P?`1 ${null==R?void 0:R.symbol} = ${null===(w=null===(C=null===(j=U.data)||void 0===j?void 0:j.pmmParamsBG)||void 0===C?void 0:C.i)||void 0===w?void 0:w.toString()} ${null==M?void 0:M.symbol}`:null===(E=null===(T=null===(k=U.data)||void 0===k?void 0:k.pmmParamsBG)||void 0===T?void 0:T.i)||void 0===E?void 0:E.toString())||"-"}),B&&In.jsxs(In.Fragment,{children:[In.jsx(QT,{label:le._({id:"JR7wWw",message:"Equilibrium target"}),poolDetailLoading:G,children:G?In.jsx(XT,{}):In.jsx(In.Fragment,{children:null===(S=null===(I=null===(A=U.data)||void 0===A?void 0:A.pmmParamsBG)||void 0===I?void 0:I.k)||void 0===S?void 0:S.toString()})}),Y.data?In.jsx(YT,{vertical:!0,chainId:e.chainId,baseToken:e.baseToken,quoteToken:e.quoteToken,baseAmount:_s({input:Y.data.baseTarget,showDecimals:2}),quoteAmount:_s({input:Y.data.quoteTarget,showDecimals:2})}):""]})]})]})}function eE(e,t){if(!e)return"";const n=Dt(e);return n.isValid()?n.format("YYYY/MM/DD HH:mm:ss"):""}function tE({amountOut:e,amountIn:t,fromTokenSymbol:n,toTokenSymbol:o}){const[r,a]=H.useState(!1),s=_s({input:t/e,showDecimals:2}),l=_s({input:e/t,showDecimals:2});return In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:["1 ",r?o:n," = ",r?s:l," ",r?n:o,In.jsx(i,{sx:{ml:10,width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"background.paperContrast",borderRadius:"50%"},onClick:()=>a((e=>!e)),children:In.jsx(i,{component:Un.Switch})})]})}function nE({poolDetail:t}){var n,o,r;const{isMobile:s}=Sd(),l=a(),{account:c,chainId:u}=hd(),p=Qe(Ql.getFeeRateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,c)),h=null===(n=p.data)||void 0===n?void 0:n.mtFeeRate,m=null===(o=p.data)||void 0===o?void 0:o.lpFeeRate,g=null==h?void 0:h.plus(null!=m?m:0),f=function({chainId:e,address:t,first:n=50}){var i;const o=e?pa[e]:"",r=vd().getQuery(me.graphql.fetchPoolSwapList,{first:n,orderBy:"timestamp",orderDirection:"desc",where:{pair:t,chain:o}}),a=Qe(Object.assign(Object.assign({},r),{enabled:!!t})),s=null===(i=a.data)||void 0===i?void 0:i.swaps;return Object.assign(Object.assign({},a),{swapList:s})}({address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),[x,y]=H.useState(1),v=x*(s?4:8),b=null!==(r=f.swapList)&&void 0!==r?r:[],j=v<b.length,C=b.slice(0,v);return In.jsx(i,{sx:{display:"flex",flexDirection:"column"},children:In.jsx(fg,{refetch:f.error?f.refetch:void 0,loading:f.isLoading,empty:!(null==C?void 0:C.length),children:!!(null==C?void 0:C.length)&&In.jsxs(i,{children:[In.jsx(i,{sx:{overflowX:"auto",minHeight:244},children:In.jsxs(i,{component:"table",sx:{minWidth:"100%"},children:[In.jsx(i,{component:"thead",sx:{position:"sticky",top:0},children:In.jsxs(i,{component:"tr",sx:{"& th":{p:24,borderBottomWidth:1,typography:"body1",lineHeight:1,textAlign:"left",whiteSpace:"nowrap"}},children:[In.jsx(i,{component:"th",children:In.jsx(e,{id:"LhMjLm",message:"Time"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"UPXmW+",message:"Trader"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"v4nCHK",message:"Paid"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"fZ5Vnu",message:"Received"})}),In.jsx(i,{component:"th",children:In.jsx(e,{id:"a7u1N9",message:"Price"})}),In.jsx(i,{component:"th",sx:{"&&":{textAlign:"right"}},children:In.jsx(e,{id:"Y7rVy0",message:"Fee Rate"})}),In.jsx(i,{component:"th",sx:{"&&":{textAlign:"right"}},children:In.jsx(e,{id:"PLUB/s",message:"Fee"})})]})}),In.jsx(i,{component:"tbody",children:null==C?void 0:C.map((e=>In.jsxs(i,{component:"tr",sx:{"& td":{px:24,py:20,whiteSpace:"nowrap"}},children:[In.jsx("td",{children:eE(1e3*e.timestamp)}),In.jsx("td",{children:In.jsx(qm,{address:e.from,truncate:!0})}),In.jsx("td",{children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{address:e.fromToken.id,chainId:u,width:18,height:18}),`${_s({input:e.amountIn,showDecimals:2})} ${e.fromToken.symbol}`]})}),In.jsx("td",{children:In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{address:e.toToken.id,chainId:u,width:18,height:18}),`${_s({input:e.amountOut,showDecimals:2})} ${e.toToken.symbol}`]})}),In.jsx("td",{children:In.jsx(tE,{amountOut:e.amountOut,amountIn:e.amountIn,fromTokenSymbol:e.fromToken.symbol,toTokenSymbol:e.toToken.symbol})}),In.jsx(i,{component:"td",sx:{textAlign:"right"},children:Gs({input:g})}),In.jsx(i,{component:"td",sx:{textAlign:"right"},children:`${_s({input:new Le(e.amountOut).times(null!=g?g:0)})} ${e.toToken.symbol}`})]},e.id)))})]})}),j&&In.jsxs(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:64,width:"100%",borderStyle:"solid",borderColor:"border.main",borderWidth:l.spacing(1,0,0,0),typography:"body2",color:"text.secondary","&:hover":{color:"text.primary"}},onClick:()=>y((e=>e+1)),children:[In.jsx(e,{id:"yQ2kGp",message:"Load more"}),In.jsx(i,{component:Un.ArrowRight,sx:{transform:"rotate(90deg)"}})]})]})})})}function iE({poolDetail:e}){const{isMobile:t}=Sd(),[n,o]=H.useState(VT.parameters),r=[{key:VT.parameters,value:le._({id:"F18WP3",message:"Parameters"})},{key:VT.swaps,value:le._({id:"EatqP4",message:"Swaps"})}];return e&&"DPP"!==(null==e?void 0:e.type)&&r.push({key:VT.liquidityProviders,value:le._({id:"juypHV",message:"Liquidity Providers"})}),In.jsx(i,{sx:Object.assign({mt:24,backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},t?{}:{mt:32,px:20}),children:In.jsxs(A,{value:n,onChange:(e,t)=>o(t),children:[In.jsx(D,{tabs:r}),In.jsx(L,{value:VT.parameters,children:In.jsx(JT,{detail:e})}),In.jsx(L,{value:VT.swaps,children:In.jsx(nE,{poolDetail:e})}),In.jsx(L,{value:VT.liquidityProviders,children:In.jsx(ZT,{poolDetail:e})})]})})}function oE(){return In.jsx(j,{variant:"rounded",sx:{width:90}})}function rE({poolDetail:t}){var n,o;const r=a(),{isMobile:s}=Sd(),l=zT({address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),d=l.dashboard,c=[{description:le._({id:"Gr2anW",message:"Traders (24H)"}),text:l.isLoading?In.jsx(oE,{}):null===(null==d?void 0:d.txUserNear24h)||void 0===(null==d?void 0:d.txUserNear24h)?"-":zs(new Le(null==d?void 0:d.txUserNear24h))},{description:le._({id:"sTnImq",message:"Total Liquidity"}),text:l.isLoading?In.jsx(oE,{}):null===(null==d?void 0:d.tvl)||void 0===(null==d?void 0:d.tvl)?"-":`$${zs(new Le(null==d?void 0:d.tvl))}`},{description:le._({id:"p7/w10",message:"Volume (24H)"}),text:l.isLoading?In.jsx(oE,{}):null===(null==d?void 0:d.volume)||void 0===(null==d?void 0:d.volume)?"-":`$${zs(new Le(null==d?void 0:d.volume))}`},{description:le._({id:"7X40pG",message:"Fees (24H)"}),text:l.isLoading?In.jsx(oE,{}):null!==!(null==d?void 0:d.feeNear24h)||(null==d?void 0:d.mtFeeNear24h)?`$${zs(new Le(null!==(n=null==d?void 0:d.feeNear24h)&&void 0!==n?n:0).plus(null!==(o=null==d?void 0:d.mtFeeNear24h)&&void 0!==o?o:0))}`:"-",question:l.isLoading?void 0:In.jsxs(i,{sx:{width:198},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsx(e,{id:"OnDEky",message:"LP Fee"}),In.jsx(i,{children:(null==d?void 0:d.feeNear24h)?`$${zs(new Le(null==d?void 0:d.feeNear24h))}`:"-"})]}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsx(e,{id:"pSQ1lM",message:"MT Fee"}),In.jsx(i,{children:(null==d?void 0:d.mtFeeNear24h)?`$${zs(new Le(null==d?void 0:d.mtFeeNear24h))}`:"-"})]})]})}];return In.jsx(i,{sx:Object.assign({display:"grid",gap:12},s?{mt:24,gridTemplateColumns:"repeat(2, 1fr)"}:{mt:32,gridTemplateColumns:"repeat(4, 1fr)"}),children:c.map((e=>In.jsxs(i,{sx:{borderRadius:8,p:16,backgroundColor:"background.paper",border:`1px solid ${r.palette.border.main}`},children:[In.jsx(i,{sx:{typography:"caption",fontWeight:600,lineHeight:"27px"},children:e.text}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary",gap:4},children:[e.description,e.question?In.jsx(im,{title:e.question}):""]})]},e.description)))})}function aE({poolDetail:t,loading:n}){var o,r,s,c;const{address:u}=null!=t?t:{},p=a(),h=Gf(),{account:m}=hd(),{isMobile:g}=Sd(),f=m&&"DPP"===(null==t?void 0:t.type)&&(null===(o=null==t?void 0:t.owner)||void 0===o?void 0:o.toLocaleLowerCase())===m.toLocaleLowerCase(),{supportAMMV2:x,onSharePool:y}=On();return In.jsxs(i,{sx:Object.assign({},g?{pt:24}:{pt:20,display:"flex",alignItems:"center",justifyContent:"space-between"}),children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[(null==t?void 0:t.baseToken)?In.jsx(gg,{tokens:[t.baseToken,t.quoteToken],chainId:t.chainId,width:36,mr:8}):In.jsx(j,{variant:"circular",sx:{width:36,height:36,mr:8}}),In.jsxs(i,{children:[In.jsxs(i,{sx:{typography:"h4"},children:[(null==t?void 0:t.baseToken)?`${null===(r=t.baseToken)||void 0===r?void 0:r.symbol} / ${null===(s=t.quoteToken)||void 0===s?void 0:s.symbol}`:"-",x&&In.jsx(i,{component:"span",sx:{position:"relative",top:-4,ml:4,px:4,py:2,borderRadius:4,fontSize:10,lineHeight:1,fontWeight:600,backgroundColor:T(p.palette.purple.main,.1),color:p.palette.purple.main},children:"PMM"}),In.jsx(Pv,{address:u,chainId:null==t?void 0:t.chainId,hideName:g,sx:{display:"inline-flex",ml:8}}),f&&!g?In.jsx(i,{component:d,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:()=>{h.push({type:$f.ModifyPool,params:{address:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}})},children:In.jsx(e,{id:"ePK91l",message:"Edit"})}):""]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",mr:12},children:In.jsx(qm,{address:null!=u?u:"",truncate:!0,showCopy:!0,iconDarkHover:!0,"data-key":"link",sx:{typography:"body2",color:"text.secondary"},iconSize:14,iconSpace:6,customChainId:null==t?void 0:t.chainId,onShareClick:y&&t?()=>y({chainId:t.chainId,baseToken:t.baseToken,quoteToken:t.quoteToken,poolId:u,apy:t.apy,isSingle:me.utils.singleSideLp(t.type)}):void 0})})]})]}),In.jsxs(i,{sx:g?{display:"flex",alignItems:"center",mt:24}:{textAlign:"right"},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",color:"success.main",typography:"h4"},children:[(null==t?void 0:t.miningAddress)?In.jsx(l,{title:le._({id:"B3mhDR",message:"Add liquidity to obtain LP tokens for mining"}),children:In.jsx("span",{children:"✨ "})}):"",In.jsx(v,{loading:n,loadingSx:{width:100},children:null!==(c=null==t?void 0:t.baseApy)&&void 0!==c?c:"0%"}),(null==t?void 0:t.quoteApy)?`/${null==t?void 0:t.quoteApy}`:""]}),In.jsx(i,{sx:Object.assign({typography:"body2"},g?{ml:4}:{}),children:In.jsx(e,{id:"rSayea",message:"APY"})})]})]})}function sE({chainId:e,shortNumber:t,pieSize:n="default",baseReserve:o=new Le(1),baseAmount:r=new Le(1),quoteAmount:s=new Le(0),baseTokenSymbol:l="-",quoteTokenSymbol:d="-",quoteTokenDecimals:c=18,baseTokenDecimals:u=18,baseTokenAddress:p,quoteTokenAddress:h,baseTvlRate:m,quoteTvlRate:g,disabledAmount:f,disabledRate:x,disabledPercentage:y,loading:v,sx:b,pieRadius:C}){const w=a(),k="small"===n,T=k?6:16,E=C||(k?23:30),A=u>6?6:u>4?4:2,I=c>6?6:c>4?4:2,S=t?zs(new Le(o)):_s({input:o,showDecimals:A}),L=t?zs(new Le(s)):_s({input:s,showDecimals:I});let O=r.plus(s);O=O.lte(0)?new Le(1):O;const R=m||r.div(O).multipliedBy(100).toFixed(2),M=g||s.div(O).multipliedBy(100).toFixed(2),_=r.lte(0)&&s.lte(0),P=w.palette.success.main,B=w.palette.error.main,D=[{name:"base",value:_?1:r.toNumber(),color:P},{name:"quote",value:_?1:s.toNumber(),color:B}];return In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:"column"},b||{}),children:[In.jsx("div",{children:y?"":v?In.jsx(j,{width:46,height:46,variant:"circular"}):In.jsx(Xt,{width:2*E,height:2*E,children:In.jsx(Kt,{isAnimationActive:!1,dataKey:"value",data:D,labelLine:!1,label:!1,outerRadius:E,fill:B,children:D.map(((e,t)=>In.jsx(Yt,{fill:e.color,strokeWidth:0},`cell-${t}`)))})})}),In.jsxs(i,{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:w.palette.purple.main,borderRadius:"50%"},"&:last-child::before":{backgroundColor:B},"&> span.symbol":{display:"inline-block",maxWidth:"6em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"text-bottom"}}},children:[v?In.jsx(j,{width:237,sx:{borderRadius:4}}):In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{children:[In.jsx(i,{className:"symbol",title:l,sx:{typography:"h6"},children:l}),p?In.jsx(qm,{address:p,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),In.jsxs(i,{sx:{textAlign:"right"},children:[f?"":`${S} `,y||x?"":In.jsxs(i,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${R}%)`]})]})]}),v?In.jsx(j,{width:237,sx:{borderRadius:4,marginTop:`${T}px`}}):In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:`${T}px`},children:[In.jsxs(i,{children:[In.jsx(i,{className:"symbol",title:d,sx:{typography:"h6"},children:d}),h?In.jsx(qm,{address:h,customChainId:e,truncate:!0,showCopy:!0,size:"small",iconSpace:4,sx:{typography:"h6",color:"text.secondary"}}):""]}),In.jsxs(i,{sx:{textAlign:"right"},children:[f?"":`${L} `,y||x?"":In.jsxs(i,{sx:{color:"text.secondary",typography:"h6",fontWeight:600},children:[" ",`(${M}%)`]})]})]})]})]})}function lE({poolDetail:t}){var n,o,r,s,l,d,c,u,p;const h=a(),{isMobile:m}=Sd(),g=Qe(Ql.getPMMStateQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(n=null==t?void 0:t.baseToken)||void 0===n?void 0:n.decimals,null===(o=null==t?void 0:t.quoteToken)||void 0===o?void 0:o.decimals)),f=null===(r=g.data)||void 0===r?void 0:r.midPrice,x=Qe(Ql.getReserveLpQuery(null==t?void 0:t.chainId,null==t?void 0:t.address,null==t?void 0:t.type,null===(s=null==t?void 0:t.baseToken)||void 0===s?void 0:s.decimals,null===(l=null==t?void 0:t.quoteToken)||void 0===l?void 0:l.decimals)),{baseReserve:y,quoteReserve:v}=x.data||{},b=y&&f?null==f?void 0:f.multipliedBy(y):void 0,C=v&&f?new Le(v):void 0;let w=b&&C?null==b?void 0:b.plus(C):void 0;w=!w||w.lte(0)?new Le(1):w;const k=b&&b.div(w).multipliedBy(100).toFixed(2),T=C&&C.div(w).multipliedBy(100).toFixed(2);return In.jsxs(i,{sx:{mt:m?24:28},children:[In.jsx(i,{sx:{fontWeight:600},children:In.jsx(e,{id:"sTnImq",message:"Total Liquidity"})}),In.jsxs(i,{sx:{display:"flex",mt:16,backgroundColor:"background.paper",borderRadius:16,overflowX:"auto",border:`1px solid ${h.palette.border.main}`},children:[In.jsx(i,{sx:{flex:m?1:void 0,padding:m?h.spacing(20,30,20,20):h.spacing(20,30,16)},children:In.jsx(sE,{pieRadius:44,baseReserve:y,baseAmount:b,baseTokenDecimals:null===(d=null==t?void 0:t.baseToken)||void 0===d?void 0:d.decimals,quoteAmount:C,baseTvlRate:k,quoteTvlRate:T,chainId:null==t?void 0:t.chainId,quoteTokenDecimals:(null===(c=null==t?void 0:t.quoteToken)||void 0===c?void 0:c.decimals)||void 0,baseTokenSymbol:Qs(null==t?void 0:t.baseToken),quoteTokenSymbol:Qs(null==t?void 0:t.quoteToken),baseTokenAddress:m?null===(u=null==t?void 0:t.baseToken)||void 0===u?void 0:u.address:"",quoteTokenAddress:m?null===(p=null==t?void 0:t.quoteToken)||void 0===p?void 0:p.address:"",shortNumber:!0,disabledRate:!m,disabledAmount:!m,loading:g.isLoading||x.isLoading,sx:m?{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"}}}})}),m?"":In.jsxs(i,{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:[In.jsx("thead",{children:In.jsxs("tr",{children:[In.jsx("th",{children:In.jsx(e,{id:"bUUVED",message:"Asset"})}),In.jsx("th",{children:In.jsx(e,{id:"hcNa1G",message:"Token Amount"})}),In.jsx("th",{children:In.jsx(e,{id:"iaocTt",message:"Ratio"})})]})}),In.jsxs("tbody",{children:[In.jsxs("tr",{children:[In.jsx("td",{children:t?In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{address:t.baseToken.address,width:24,height:24,marginRight:4,chainId:t.chainId}),In.jsxs(i,{children:[t.baseToken.symbol,In.jsx(qm,{address:t.baseToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:t.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):In.jsx(j,{width:100,height:24})}),In.jsx("td",{children:t?zs(new Le(t.baseReserve)):In.jsx(j,{width:50,height:24,sx:{display:"inline-block"}})}),In.jsx("td",{children:g.isLoading?In.jsx(j,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=k?k:"-"}%`})]}),In.jsxs("tr",{children:[In.jsx("td",{children:t?In.jsxs(i,{sx:{display:"flex",alignItems:"center"},children:[In.jsx(Fc,{address:t.quoteToken.address,width:24,height:24,marginRight:4,chainId:t.chainId}),In.jsxs(i,{children:[t.quoteToken.symbol,In.jsx(qm,{address:t.quoteToken.address,truncate:!0,showCopy:!0,size:"small",iconSpace:4,customChainId:t.chainId,sx:{typography:"h6",color:"text.secondary"}})]})]}):In.jsx(j,{width:100,height:24})}),In.jsx("td",{children:t?zs(new Le(t.quoteReserve)):In.jsx(j,{width:50,height:24,sx:{display:"inline-block"}})}),In.jsx("td",{children:g.isLoading?In.jsx(j,{width:50,height:24,sx:{display:"inline-block"}}):`${null!=T?T:"-"}%`})]})]})]})]})]})}function dE({params:t}){var n,o,r,s,l,d,u;const p=Gf(),{isMobile:h}=Sd(),{account:m}=hd(),g=a(),f=MT({id:null==t?void 0:t.address,chainId:null==t?void 0:t.chainId}),{poolDetail:x}=f,y=vn(f,["poolDetail"]),[v,b]=H.useState("inital");y.isPending||y.error||x||"inital"!==v||b("open");const j=x&&"DPP"===x.type&&m&&(null===(n=x.owner)||void 0===n?void 0:n.toLocaleLowerCase())===m.toLocaleLowerCase(),C=x&&"DPP"!==x.type||m&&(null==x?void 0:x.owner)&&x.owner.toLocaleLowerCase()===m.toLocaleLowerCase(),[w,k]=H.useState();x&&void 0===w&&!h&&k(zv.Add);const T=w&&x?Object.assign(Object.assign({},x),{baseLpToken:{id:null===(o=x.baseLpToken)||void 0===o?void 0:o.id,decimals:Number(null!==(s=null===(r=x.baseLpToken)||void 0===r?void 0:r.decimals)&&void 0!==s?s:18)},quoteLpToken:{id:null===(l=x.quoteLpToken)||void 0===l?void 0:l.id,decimals:Number(null!==(u=null===(d=x.quoteLpToken)||void 0===d?void 0:d.decimals)&&void 0!==u?u:18)}}):void 0,E=!!(null==x?void 0:x.miningAddress);return In.jsxs(zf,{sx:h?{p:g.spacing(28,0,C?108:0)}:{p:g.spacing(28,0,40)},children:[In.jsx(OT,{onClick:()=>{p.push({type:$f.Pool})}}),In.jsxs(i,{sx:h?{}:{display:"flex",gap:12,overflow:"hidden"},children:[In.jsxs(i,{sx:{flex:1,overflow:"hidden"},children:[In.jsx(aE,{poolDetail:x,loading:y.isPending}),In.jsx(WT,{poolDetail:x,chart24hDataFirst:!0}),In.jsx(rE,{poolDetail:x}),In.jsx(lE,{poolDetail:x}),In.jsx(iE,{poolDetail:x})]}),h?In.jsx(sj,{account:m,pool:T,operate:w,hasMining:E,modal:!0,onClose:()=>{k(void 0)}}):In.jsx(aj,{account:m,operate:w,hasMining:E,sx:{width:375,height:"max-content",backgroundColor:"background.paper",borderRadius:16,overflow:"hidden"},pool:T,hidePoolInfo:!0})]}),In.jsx(LT,{singleBtn:!0,open:"open"===v,onClose:()=>b("close"),onConfirm:()=>b("close"),title:le._({id:"Da1+Da",message:"Pool not found. Please switch to another network and retry."})}),h&&C&&In.jsx(In.Fragment,{children:In.jsxs(i,{sx:{position:"fixed",bottom:0,left:0,right:0,p:20,display:"grid",gap:"8px",gridTemplateColumns:j?"repeat(3, 1fr)":"repeat(2, 1fr)",backgroundColor:"background.paperContrast"},children:[j?In.jsx(c,{variant:c.Variant.second,onClick:()=>{Gf.getState().push({type:$f.ModifyPool,params:{chainId:x.chainId,address:x.address}})},children:In.jsx(e,{id:"ePK91l",message:"Edit"})}):"",In.jsx(c,{variant:c.Variant.second,onClick:()=>{k(zv.Remove)},children:In.jsx(e,{id:"t/YqKh",message:"Remove"})}),In.jsx(c,{onClick:()=>{k(zv.Add)},children:In.jsx(e,{id:"m16xKo",message:"Add"})})]})})]})}function cE({statuses:t,children:n,buttonProps:o}){var r;if(!t.find((e=>e.needShowTokenStatusButton))&&n)return In.jsx(In.Fragment,{children:n});const a=t.find((e=>e.insufficientBalance));if(a)return In.jsx(c,{fullWidth:!0,disabled:!0,...o,children:In.jsx(e,{id:"m6RmA/",message:"Insufficient {0} balance",values:{0:null===(r=a.token)||void 0===r?void 0:r.symbol}})});const s=t.some((e=>e.isApproving));return In.jsx(i,{sx:{display:"flex",alignItems:"center",gap:4},children:t.map(((t,n)=>{var i,r;let a="";return t.isApproving?a=In.jsx(e,{id:"j2Uisd",message:"Approving"}):(t.needReset||t.needApprove)&&(a=t.approveTitle),a?In.jsx(c,{fullWidth:!0,isLoading:t.isApproving,onClick:t.submitApprove,disabled:t.insufficientBalance||s,...o,children:a},null!==(r=null===(i=t.token)||void 0===i?void 0:i.symbol)&&void 0!==r?r:n):null}))})}function uE({token:t,chainId:n,showChainLogo:o,readonly:r,showChainName:s,logoSize:l=24,chainLogoSize:c=12,side:u,occupiedToken:p,defaultLoadBalance:h,notTokenPickerModal:m,border:g,px:f=20,py:x=8,highlightDefault:y,onTokenClick:v,onTokenChange:b}){var j,C;const{onlyChainId:w}=On(),k=n||w,T=a(),[E,A]=H.useState(!1),I=(null==t?void 0:t.chainId)?us.get(t.chainId):null,S=s&&!!I;return In.jsxs(In.Fragment,{children:[In.jsxs(i,{component:d,sx:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,color:T.palette.text.primary,typography:S?"body2":"body1",fontWeight:600,px:f,py:x,"&:focus-visible":{opacity:.5}},!!g&&{border:`solid 1px ${T.palette.border.main}`,borderRadius:8,"&:hover":{backgroundColor:T.palette.hover.default}}),!(!y||t)&&{backgroundColor:T.palette.primary.main,color:T.palette.primary.contrastText,"&:hover":{opacity:.8}}),onClick:()=>{r||A(!0)},"data-testid":As,children:[!!(null==t?void 0:t.address)&&In.jsx(Fc,{url:null==t?void 0:t.logoURI,address:null!==(j=null==t?void 0:t.address)&&void 0!==j?j:"",chainId:null==t?void 0:t.chainId,noShowChain:!o,width:l,height:l,chainSize:c,logoOffset:10,marginRight:0}),In.jsxs(i,{sx:{flex:1},children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(null==t?void 0:t.address)?In.jsx(In.Fragment,{children:In.jsx(i,{children:null!==(C=null==t?void 0:t.symbol)&&void 0!==C?C:"-"})}):In.jsx(e,{id:"sIPJGT",message:"SELECT TOKEN"}),!r&&In.jsx(i,{component:"svg",width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",sx:{flexShrink:0},children:In.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"})})]}),!!S&&In.jsxs(i,{sx:{display:"flex",alignItems:"center",typography:"h6",color:"text.secondary"},children:[I.name,In.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.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"})})]})]})]}),In.jsx(Zm,{value:t,open:E,side:u,chainId:k,occupiedAddrs:p?[p.address]:void 0,occupiedChainId:null==p?void 0:p.chainId,defaultLoadBalance:h,onClose:()=>{A(!1),v&&v()},onTokenChange:(e,t)=>{A(!1),setTimeout((()=>{!Array.isArray(e)&&b&&b(e,t)}),Sc)},modal:!m})]})}function pE({title:e,disabled:t,children:n}){return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:12,opacity:t?.3:void 0},children:[In.jsx(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",fontWeight:600},children:e}),n]})}!function(e){e[e.depth=1]="depth",e[e.volume=2]="volume",e[e.feeRevenue=3]="feeRevenue",e[e.traders=4]="traders"}(qT||(qT={})),function(e){e[e.parameters=1]="parameters",e[e.swaps=2]="swaps",e[e.liquidityProviders=3]="liquidityProviders"}(VT||(VT={}));const hE=1e-4;function mE({disabled:t,fee:n,onChange:o,feeList:r,hasCustom:s}){const l=a(),[c,u]=H.useState(!1),[p,h]=H.useState(!1),[m,g]=H.useState(""),{isMobile:f}=Sd(),x=!r.includes(n),y=x||p,v=!p&&x&&!!m&&new Le(m).div(100).lt(hE),j=t||v;return In.jsxs(i,{sx:{opacity:t?.3:void 0,fontWeight:600},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:20,py:12,borderWidth:1,borderRadius:12,borderStyle:"solid",borderColor:"border.main"},children:[In.jsx(e,{id:"tMMG40",message:"{0}% fee tier",values:{0:n?new Le(n).times(100).toString():"-"}}),In.jsx(d,{sx:{px:16,py:7,border:`solid 1px ${l.palette.text.primary}`,borderRadius:8,fontWeight:600,color:"text.primary",cursor:j?"default":"pointer",opacity:v?.3:1},disabled:j,onClick:()=>{j||u((e=>!e))},children:c?In.jsx(e,{id:"vLyv1R",message:"Hide"}):In.jsx(e,{id:"ePK91l",message:"Edit"})})]}),c&&In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:Object.assign({mt:12},f?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8,"& > label":{flex:1}}),children:[r.map((e=>{const t=n===e&&!y;return In.jsxs(i,{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"},t&&{color:l.palette.primary.main,borderColor:l.palette.primary.main}),children:[100*e,"%",In.jsx(U,{size:18,checked:t,onChange:(t,n)=>{n&&o(e)}})]},e)})),s&&In.jsxs(i,{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?l.palette.error.main:"text.primary"},y&&{color:l.palette.primary.main,borderColor:l.palette.primary.main}),onClick:()=>{h(!0),g("")},children:[p?In.jsx(b,{value:m,autoFocus:!0,onChange:e=>{const t=e.target.value;isNaN(Number(t))||g(t)},onBlur:()=>{const e=Number(m),t=e?new Le(e).div(100).toNumber():e;t&&t<hE?o(0):m&&(e||0===e)&&o(t),h(!1)},sx:{p:0,flex:1,height:"100%",border:"none",backgroundColor:"none"},inputSx:{p:0}}):In.jsx(In.Fragment,{children:x?(new Le(n).times(100).toNumber()||m)+"%":In.jsx(e,{id:"8Tg/JR",message:"Custom"})}),In.jsx(U,{size:18,checked:y,sx:{flexShrink:0}})]})]}),v&&In.jsxs(i,{sx:{mt:12,display:"flex",alignItems:"center",gap:8,p:8,borderRadius:8,typography:"h6",backgroundColor:T(l.palette.error.main,.1),color:l.palette.error.main},children:[In.jsx(i,{component:Un.ErrorBorder,sx:{width:18,height:18}}),In.jsx(e,{id:"LHxwaD",message:"The fee tier should greater than {0}%",values:{0:100*hE}})]})]})]})}function gE({isExists:t,pair:n,pairAddress:o}){var a,s,d;const{isBalanceLoading:c,isDepositedLoading:u,balance:p,token0Deposited:h,token1Deposited:m,poolTokenPercentage:g}=function({pairAddress:e,pair:t}){var n;const{account:i}=hd(),o=null===(n=null==t?void 0:t.liquidityToken)||void 0===n?void 0:n.chainId,r=Qe(Object.assign(Object.assign({},bt(o,e,i)),{retry:!1})),a=Qe(Object.assign(Object.assign({},jt(o,e)),{retry:!1})),[s,l,d]=H.useMemo((()=>{if(!t||!r.data||!a.data||a.data<r.data)return[void 0,void 0,void 0];const e=an.fromRawAmount(t.liquidityToken,a.data.toString()),n=an.fromRawAmount(t.liquidityToken,r.data.toString());return[new ln(r.data.toString(),a.data.toString()),t.getLiquidityValue(t.token0,e,n,!1),t.getLiquidityValue(t.token1,e,n,!1)]}),[r.data,a.data,t]);return{isBalanceLoading:r.isLoading,isDepositedLoading:r.isLoading||a.isLoading,balance:r.data&&t?Us(r.data.toString(),t.liquidityToken.decimals):void 0,poolTokenPercentage:s?new Le(s.toSignificant(6)):void 0,token0Deposited:l?new Le(l.toSignificant()):void 0,token1Deposited:d?new Le(d.toSignificant()):void 0}}({pairAddress:o,pair:n}),f=g?`${_s({input:g,showDecimals:2,roundingMode:Le.ROUND_HALF_UP})}%`:void 0;return t&&n?In.jsxs(i,{sx:{px:20,py:12,borderWidth:1,borderRadius:8,borderStyle:"solid",borderColor:"border.main"},children:[In.jsx(i,{sx:{typography:"h6",color:"text.secondary"},children:In.jsx(e,{id:"YHc3B+",message:"My Liquidity"})}),In.jsxs(i,{sx:{mt:12,display:"flex",alignItems:"center"},children:[In.jsx(gg,{width:18,height:18,tokens:[n.token0,n.token1],mr:4}),In.jsx(v,{loading:c,loadingProps:{width:50},sx:{mr:4},children:Ps({input:p,decimals:null===(a=n.liquidityToken)||void 0===a?void 0:a.decimals})}),`${n.token0.symbol}/${n.token1.symbol} LP`,In.jsx(l,{title:In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:10,typography:"body2",color:"text.primary"},children:[In.jsx(pb,{address:n.token0.address,chainId:n.token0.chainId,showName:null!==(s=n.token0.symbol)&&void 0!==s?s:"",size:14,offset:4,rightContent:In.jsx(v,{loading:u,loadingProps:{width:50},children:Ps({input:h,decimals:n.token0.decimals})})}),In.jsx(pb,{address:n.token1.address,chainId:n.token1.chainId,showName:null!==(d=n.token1.symbol)&&void 0!==d?d:"",size:14,offset:4,rightContent:In.jsx(v,{loading:u,loadingProps:{width:50},children:Ps({input:m,decimals:n.token1.decimals})})}),In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsx(e,{id:"c4miqE",message:"Pool share"}),In.jsx(v,{loading:u,loadingProps:{width:50},children:f})]})]}),sx:{padding:20,width:256},children:In.jsx(r,{component:Un.DetailBorder,sx:{ml:4,width:16,height:16,cursor:"pointer"}})}),In.jsx(i,{component:"a",target:"_blank",rel:"noopener noreferrer",href:ad(n.liquidityToken.chainId,n.liquidityToken.address,"address"),sx:{ml:4,display:"inline-flex",height:16},children:In.jsx(r,{component:Un.ArrowTopRightBorder,sx:{width:16,height:16}})})]})]}):null}function fE({sx:t,disabled:n,slippage:o,onChangeSlippage:r}){const s=a(),d=o===Jf,[c,u]=$(d?"":new Le(o).times(100).toNumber());return In.jsx(l,{disabled:n,onlyClick:!0,title:In.jsxs(i,{sx:{backgroundColor:s.palette.background.paper,padding:s.spacing(16,20),borderRadius:16,width:375,maxWidth:"90vw",boxSizing:"border-box"},children:[In.jsxs(i,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.primary"},children:[In.jsx("span",{children:In.jsx(e,{id:"lqTDfd",message:"Slippage Tolerance"})}),In.jsxs("span",{children:[d?tx:o&&new Le(o).times(100).toNumber(),"%"]})]}),In.jsxs(i,{sx:{mt:16,display:"flex",alignItems:"center",margin:s.spacing(16,0,0,0)},children:[In.jsx(Kf,{sx:{borderRadius:8,whiteSpace:"nowrap"},onClick:()=>{u(""),r(Jf)},active:d}),In.jsx(b,{placeholder:String(tx),value:c,onChange:e=>{const{value:t}=e.target;u(t),r(t?new Le(t).div(100).toNumber():Jf)},onBlur:()=>{(!d&&new Le(o).gt(.1)||new Le(o).lte(0))&&(u(10),r(.1))},suffix:In.jsx(i,{sx:{mr:16},children:"%"}),sx:{ml:8,"& input":{px:16,py:0,height:"39px"}}})]})]}),sx:{p:0},arrow:!1,placement:"bottom-end",children:In.jsx(_,{sx:Object.assign({width:"max-content",alignItems:"right",margin:s.spacing(0,0,0,"auto"),p:s.spacing(4,12),borderRadius:20,backgroundColor:"background.paperDarkContrast",cursor:"pointer"},t),children:In.jsx(i,{component:Un.Setting,sx:{width:18,height:18,"& path:last-child":{fill:s.palette.text.primary}}})})})}function xE(){var t,n,o;const r=a(),[s,l]=H.useState(.003),[d,u]=H.useState(),[p,h]=H.useState(),[m,g]=H.useState(""),[f,x]=H.useState(""),[y,v]=H.useState(Jf),b=y===Jf?new Le(tx).div(100).toNumber():y,{isMobile:j}=Sd(),{onlyChainId:C}=On(),w=H.useMemo((()=>C||(null==d?void 0:d.chainId)||(null==p?void 0:p.chainId)),[C,d,p]),{pairAddress:k,pair:T,price:E,isInvalidPair:A,invertedPrice:I,priceLoading:S,liquidityMinted:L,shareOfPool:O,isExists:R}=function({baseToken:e,quoteToken:t,baseAmount:n,quoteAmount:i,fee:o}){const[r,a,s]=H.useMemo((()=>{var n,i;if(!e||!t)return[null,null,!1];const o=ve[e.chainId],r=(null===(n=o.address)||void 0===n?void 0:n.toLowerCase())===e.address.toLowerCase(),a=(null===(i=o.address)||void 0===i?void 0:i.toLowerCase())===t.address.toLowerCase(),s=r?o.wrappedTokenAddress:e.address,l=a?o.wrappedTokenAddress:t.address,d=s.toLowerCase()===l.toLowerCase();return d?[null,null,!0]:[new rn(e.chainId,s,e.decimals,e.symbol,e.name),new rn(t.chainId,l,t.decimals,t.symbol,t.name),d]}),[e,t]),l=H.useMemo((()=>{if(!r||!a||void 0===o)return;const e=r.chainId,t=e?ot(e)||vt(e):void 0;return t?sd({factoryAddress:t,tokenA:r,tokenB:a,fee:o}):void 0}),[r,a,o]),{pair:d,price:c,invertedPrice:u,reserveQuery:p,liquidityMinted:h,shareOfPool:m,isExists:g}=Gb({pool:e&&t&&l?{baseToken:e,quoteToken:t,type:"AMMV2",address:l}:void 0,baseAmount:n,quoteAmount:i});return{pairAddress:l,pair:d,isInvalidPair:s,price:c,invertedPrice:u,priceLoading:p.isLoading,liquidityMinted:h,shareOfPool:m,isExists:g}}({baseToken:d,quoteToken:p,baseAmount:m,quoteAmount:f,fee:s}),M=wx(E);if(E&&m&&!E.isEqualTo(null!=M?M:0)&&R){const e=E.times(m).dp(null!==(t=null==p?void 0:p.decimals)&&void 0!==t?t:18);e.isEqualTo(f)||x(e.toString())}const _=w?rt(w)||ct(w):void 0,P=cc(d,{amount:m,contractAddress:_}),B=cc(p,{amount:f,contractAddress:_}),[D,N]=H.useState(!1),F=!d||!p,U=Vb({baseToken:d,quoteToken:p,baseAmount:m,quoteAmount:f,fee:s,isExists:R,slippage:b,successBack:()=>{Gf.getState().push({type:$f.Pool,params:{tab:Sj.myLiquidity}})}});return Y((()=>{console.error("createMutation.error",U.error)}),[U.error]),In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:20,mx:16,pb:20,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"border.main",mb:20,[r.breakpoints.up("tablet")]:{width:600,mx:"auto"}},children:[In.jsx(Uj,{onClick:()=>{Gf.getState().push({type:$f.Pool})}}),In.jsx(i,{sx:{typography:"caption",fontWeight:600,color:"text.primary",mr:"auto"},children:In.jsx(e,{id:"E6MqGy",message:"Add liquidity"})}),In.jsx(tv,{poolType:"AMM V2"})]}),In.jsxs(i,{sx:{pt:20,px:16,position:"relative",overflow:"hidden",backgroundColor:r.palette.background.paper,borderRadius:16,[r.breakpoints.up("tablet")]:{borderWidth:1,borderStyle:"solid",borderColor:"border.main",px:0,mx:"auto",width:600}},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:20,[r.breakpoints.up("tablet")]:{pt:20,px:20,pb:20}},children:[In.jsx(gE,{pair:T,pairAddress:k,isExists:R}),In.jsxs(pE,{title:In.jsx(e,{id:"nxRg31",message:"Select pair"}),children:[In.jsxs(i,{sx:{display:"grid",gridTemplateColumns:j?"repeat(1, 1fr)":"repeat(2, 1fr)",gap:12},children:[In.jsx(uE,{border:!0,highlightDefault:!0,chainId:w,token:d,onTokenChange:(e,t)=>{t?(u(p),h(d),g(""),x("")):(u(e),g(""))},occupiedToken:p}),In.jsx(uE,{border:!0,highlightDefault:!0,chainId:w,token:p,onTokenChange:(e,t)=>{t?(u(p),h(d)):(h(e),x(""))},occupiedToken:d})]}),(!w||nd(w))&&In.jsx(mE,{fee:s,onChange:l,feeList:[1e-4,5e-4,.003],hasCustom:!0,disabled:F})]}),In.jsx(pE,{title:In.jsx(e,{id:"MU9s7M",message:"Deposit amounts"}),disabled:F,children:In.jsxs(i,{children:[In.jsx(og,{sx:{mb:4,pb:28,minHeight:"auto",backgroundColor:"background.cardInput",padding:r.spacing(20,20,28)},inputSx:{backgroundColor:"background.cardInput"},token:d,amt:m,defaultLoadBalance:!0,onInputChange:e=>{var t;g(e);const n=Number(e);R&&E&&n&&x(E.times(e).dp(null!==(t=null==p?void 0:p.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(n=null==p?void 0:p.address)&&void 0!==n?n:""],occupiedChainId:null==p?void 0:p.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:F}),In.jsx(ng,{}),In.jsx(og,{sx:{pb:20,minHeight:"auto",backgroundColor:"background.cardInput",padding:r.spacing(20,20,20)},inputSx:{backgroundColor:"background.cardInput"},token:p,amt:f,defaultLoadBalance:!0,onInputChange:e=>{var t;x(e);const n=Number(e);R&&I&&n&&g(I.times(e).dp(null!==(t=null==d?void 0:d.decimals)&&void 0!==t?t:18).toString())},showMaxBtn:!0,occupiedAddrs:[null!==(o=null==d?void 0:d.address)&&void 0!==o?o:""],occupiedChainId:null==d?void 0:d.chainId,notTokenPickerModal:!0,showPercentage:!0,readOnly:F}),In.jsx(fE,{slippage:y,onChangeSlippage:v,disabled:F,sx:{mt:8}}),In.jsx(Pb,{baseToken:d,quoteToken:p,loading:S,midPrice:E,shareOfPool:O}),!!R&&In.jsxs(i,{sx:{mt:20,p:20,borderRadius:16,backgroundColor:"background.paperContrast",typography:"h6",textAlign:"center","& > b":{fontWeight:600,color:"primary.main"}},children:["🌟",In.jsx("b",{children:In.jsx(e,{id:"e38JNU",message:"Tips:"})})," ",In.jsx(e,{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:Gs({input:s})},components:{0:In.jsx("b",{})}})]})]})})]}),In.jsx(i,{sx:{mt:20,py:16,[r.breakpoints.up("tablet")]:{px:20}},children:In.jsx(cx,{fullWidth:!0,includeButton:!0,size:c.Size.big,disabled:F,chainId:w,children:In.jsx(cE,{statuses:[P,B],buttonProps:{size:c.Size.big},children:In.jsx(c,{fullWidth:!0,size:c.Size.big,disabled:!(d&&p&&m&&f&&!A&&s),onClick:()=>N(!0),children:A?In.jsx(e,{id:"R7D79P",message:"Invalid pair"}):In.jsx(e,{id:"bwSQI0",message:"Supply"})})})})}),In.jsx(Bb,{open:D,onClose:()=>N(!1),slippage:b,baseToken:d,baseAmount:m,quoteToken:p,quoteAmount:f,fee:s,price:E,lpAmount:L,shareOfPool:O,pairAddress:k,createMutation:U})]})]})}const yE=({disabled:e,feeAmount:t,dispatch:n})=>{const o=a(),{isMobile:r}=Sd(),[s,l]=$(!1);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",px:20,py:12,borderWidth:1,borderStyle:"solid",borderColor:o.palette.border.main,borderRadius:12},e?{opacity:.3}:void 0),children:[In.jsx(i,{sx:{typography:"h5",color:o.palette.text.primary},children:t?`${ev[t].label} ${le._({id:"fxRyGG",message:"fee tier"})}`:le._({id:"EU3wU4",message:"Fee tier"})}),In.jsx(c,{size:c.Size.small,variant:c.Variant.outlined,disabled:e,onClick:()=>l((e=>!e)),sx:{color:o.palette.text.primary,border:`solid 1px ${o.palette.text.primary}`},children:s?le._({id:"vLyv1R",message:"Hide"}):le._({id:"ePK91l",message:"Edit"})})]}),s&&In.jsx(i,{sx:Object.assign({},r?{display:"grid",gap:8,gridTemplateColumns:"repeat(2, 1fr)"}:{display:"flex",alignItems:"center",gap:8}),children:[Kx.LOWEST,Kx.LOW,Kx.MEDIUM,Kx.HIGH].map((i=>{const r=t===i;return In.jsxs(c,{size:c.Size.middle,variant:c.Variant.outlined,disabled:e,onClick:()=>{n({type:vv.UpdateFeeAmount,payload:i})},sx:{flexBasis:"50%",flexShrink:1,flexGrow:1,justifyContent:"space-between",px:20,color:r?o.palette.primary.main:o.palette.text.primary,borderRadius:12,borderColor:r?o.palette.primary.main:o.palette.border.main,[o.breakpoints.up("tablet")]:{flexBasis:"25%"}},children:[ev[i].label,r?In.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[In.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:o.palette.primary.main}),In.jsx("rect",{x:"4.5",y:"4.5",width:"9",height:"9",rx:"4.5",fill:o.palette.primary.main,stroke:o.palette.primary.main})]}):In.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:In.jsx("rect",{x:"0.5",y:"0.5",width:"17",height:"17",rx:"8.5",stroke:o.palette.text.secondary})})]},i)}))})]})},vE={neutral1:"#222222",neutral2:"#7D7D7D",accent1:"#FC72FF",critical:"FF5F52",white:"#FFFFFF",surface3:"#22222212",opacity:{hover:.6,click:.4,disabled:.5,enabled:1}},bE=({series:e,xScale:t,yScale:n,xValue:o,yValue:r,fill:a})=>Z((()=>{var s;return In.jsx(i,{component:"path",opacity:.5,stroke:null!=a?a:vE.accent1,fill:null!=a?a:vE.accent1,d:null!==(s=cn().curve(un).x((e=>t(o(e)))).y1((e=>n(r(e)))).y0(n(0))(e.filter((e=>{const n=t(o(e));return n>0&&n<=window.innerWidth}))))&&void 0!==s?s:void 0})}),[a,e,t,o,n,r]),jE=({axisGenerator:e})=>In.jsx("g",{ref:t=>{t&&hn(t).call(e).call((e=>e.select(".domain").remove()))}}),CE=({xScale:e,innerHeight:t,offset:n=0})=>Z((()=>In.jsx(i,{component:"g",transform:`translate(0, ${t+n})`,sx:{"& line":{display:"none"},"& text":{color:vE.neutral2,transform:"translateY(5px)"}},children:In.jsx(jE,{axisGenerator:pn(e).ticks(6)})})),[t,n,e]),wE=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(" "),kE=()=>["m 5 7","v 14","M 0 0","m 9 7","v 14","z"].join(" "),TE=({color:e,size:t=10,margin:n=10})=>In.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 EE=({color:e,d:t})=>In.jsx(i,{component:"path",cursor:"ew-resize",pointerEvents:"none",strokeWidth:3,stroke:e,fill:e,d:t}),AE=({d:e})=>In.jsx(i,{component:"path",cursor:"ew-resize",pointerEvents:"none",stroke:vE.white,opacity:vE.opacity.hover,d:e}),IE=({visible:e,transform:t,children:n})=>In.jsx(i,{component:"g",opacity:e?"1":"0",transform:t,sx:{transition:"opacity 300ms"},children:n}),SE=({y:e,x:t,height:n,width:o,rx:r})=>In.jsx(i,{component:"rect",fill:vE.surface3,y:e,x:t,height:n,width:o,rx:r}),LE=({y:e,transform:t,dominantBaseline:n,children:o})=>In.jsx(i,{component:"text",y:e,textAnchor:"middle",fontSize:"13px",fill:vE.neutral1,transform:t,dominantBaseline:n,children:o}),OE=(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]))},RE=({id:e,xScale:t,interactive:n,brushLabelValue:i,brushExtent:o,setBrushExtent:r,innerWidth:a,innerHeight:s,westHandleColor:l,eastHandleColor:d})=>{const c=G(null),u=G(null),[p,h]=$(o),[m,g]=$(!1),[f,x]=$(!1),y=function(e){const t=G();return Y((()=>{t.current=e}),[e]),t.current}(o),v=z((e=>{const{type:n,selection:i,mode:a}=e;if(!i)return void h(null);const s=i.map(t.invert);"end"!==n||OE(o,s,t)||r(s,a),h(s)}),[t,o,r]);Y((()=>{h(o)}),[o]),Y((()=>{c.current&&(u.current=mn().extent([[Math.max(2,t(0)),0],[a-2,s]]).handleSize(30).filter((()=>n)).on("brush end",v),u.current(hn(c.current)),y&&OE(o,y,t)&&hn(c.current).transition().call(u.current.move,o.map(t)),hn(c.current).selectAll(".selection").attr("stroke","none").attr("fill-opacity","0.1").attr("fill",`url(#${e}-gradient-selection)`))}),[o,v,e,s,a,n,y,t]),Y((()=>{c.current&&u.current&&u.current.move(hn(c.current),o.map(t))}),[o,t]),Y((()=>{g(!0);const e=setTimeout((()=>g(!1)),1500);return()=>clearTimeout(e)}),[p]);const b=p&&t(p[0])>20,j=p&&t(p[1])>a-20,C=p&&(t(p[0])<0||t(p[1])<0),w=p&&(t(p[0])>a||t(p[1])>a),k=p&&t(p[0])>=0&&t(p[0])<=a,T=p&&t(p[1])>=0&&t(p[1])<=a;return Z((()=>In.jsxs(In.Fragment,{children:[In.jsxs("defs",{children:[In.jsxs("linearGradient",{id:`${e}-gradient-selection`,x1:"0%",y1:"100%",x2:"100%",y2:"100%",children:[In.jsx("stop",{stopColor:l}),In.jsx("stop",{stopColor:d,offset:"1"})]}),In.jsx("clipPath",{id:`${e}-brush-clip`,children:In.jsx("rect",{x:"0",y:"0",width:a,height:s})})]}),In.jsx("g",{ref:c,clipPath:`url(#${e}-brush-clip)`,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)}),p&&In.jsxs(In.Fragment,{children:[k?In.jsxs("g",{transform:`translate(${Math.max(0,t(p[0]))}, 0), scale(${b?"-1":"1"}, 1)`,children:[In.jsxs("g",{children:[In.jsx(EE,{color:l,d:wE(s)}),In.jsx(AE,{d:kE()})]}),In.jsxs(IE,{transform:`translate(50,0), scale(${b?"1":"-1"}, 1)`,visible:m||f,children:[In.jsx(SE,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),In.jsx(LE,{transform:"scale(-1, 1)",y:"15",dominantBaseline:"middle",children:i("w",p[0])})]})]}):null,T?In.jsxs("g",{transform:`translate(${t(p[1])}, 0), scale(${j?"-1":"1"}, 1)`,children:[In.jsxs("g",{children:[In.jsx(EE,{color:d,d:wE(s)}),In.jsx(AE,{d:kE()})]}),In.jsxs(IE,{transform:`translate(50,0), scale(${j?"-1":"1"}, 1)`,visible:m||f,children:[In.jsx(SE,{y:"0",x:"-30",height:"30",width:"60",rx:"8"}),In.jsx(LE,{y:"15",dominantBaseline:"middle",children:i("e",p[1])})]})]}):null,C&&In.jsx(TE,{color:l}),w&&In.jsx("g",{transform:`translate(${a}, 0) scale(-1, 1)`,children:In.jsx(TE,{color:d})})]})]})),[i,d,T,j,b,f,e,s,a,p,w,m,C,l,k,t])},ME=({value:e,xScale:t,innerHeight:n})=>Z((()=>In.jsx(i,{component:"line",x1:t(e),y1:"0",x2:t(e),y2:n,sx:{opacity:.5,strokeWidth:2,stroke:vE.neutral1,fill:"none"}})),[e,t,n]);function _E({svg:e,xScale:t,setZoom:n,width:o,height:r,resetBrush:a,showResetButton:s,zoomLevels:l}){const d=G(),[u,p,h,m]=Z((()=>[()=>e&&d.current&&hn(e).transition().call(d.current.scaleBy,2),()=>e&&d.current&&hn(e).transition().call(d.current.scaleBy,.5),()=>e&&d.current&&hn(e).transition().call(d.current.scaleTo,.5),()=>e&&d.current&&hn(e).call(d.current.transform,gn.translate(0,0).scale(1)).transition().call(d.current.scaleTo,.5)]),[e]);return Y((()=>{e&&(d.current=fn().scaleExtent([l.min,l.max]).extent([[0,0],[o,r]]).on("zoom",(({transform:e})=>n(e))),hn(e).call(d.current))}),[r,o,n,e,t,d,l,l.max,l.min]),Y((()=>{h()}),[h,l]),In.jsxs(i,{sx:{display:"grid",gridTemplateColumns:`repeat(${s?3:2}, 1fr)`,gridGap:"6px",position:"absolute",top:"-32px",right:0},children:[s&&In.jsx(c,{size:c.Size.small,sx:{borderRadius:16},onClick:()=>{a(),m()},disabled:!1,children:In.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:[In.jsx("polyline",{points:"1 4 1 10 7 10"}),In.jsx("polyline",{points:"23 20 23 14 17 14"}),In.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"})]})}),In.jsx(c,{size:c.Size.small,sx:{borderRadius:16},onClick:u,disabled:!1,children:In.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:[In.jsx("circle",{cx:"11",cy:"11",r:"8"}),In.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),In.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),In.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),In.jsx(c,{size:c.Size.small,sx:{borderRadius:16},onClick:p,disabled:!1,children:In.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:[In.jsx("circle",{cx:"11",cy:"11",r:"8"}),In.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),In.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})})]})}const PE=e=>e.price0,BE=e=>e.activeLiquidity;function DE({id:e="liquidityChartRangeInput",data:{series:t,current:n},ticksAtLimit:o,styles:r,dimensions:{width:a,height:s},margins:l,interactive:d=!0,brushDomain:c,brushLabels:u,onBrushDomainChange:p,zoomLevels:h}){const m=G(null),[g,f]=$(null),[x,y]=Z((()=>[s-l.top-l.bottom,a-l.left-l.right]),[a,s,l]),{xScale:v,yScale:b}=Z((()=>{const e={xScale:xn().domain([n*h.initialMin,n*h.initialMax]).range([0,y]),yScale:xn().domain([0,yn(t,BE)]).range([x,0])};if(g){const t=g.rescaleX(e.xScale);e.xScale.domain(t.domain())}return e}),[n,h.initialMin,h.initialMax,y,t,x,g]);return Y((()=>{f(null)}),[h]),Y((()=>{c||p(v.domain(),void 0)}),[c,p,v]),In.jsxs(In.Fragment,{children:[In.jsx(_E,{svg:m.current,xScale:v,setZoom:f,width:y,height:s,resetBrush:()=>{p([n*h.initialMin,n*h.initialMax],"reset")},showResetButton:Boolean(o[dx.LOWER]||o[dx.UPPER]),zoomLevels:h}),In.jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${a} ${s}`,style:{overflow:"visible"},children:[In.jsxs("defs",{children:[In.jsx("clipPath",{id:`${e}-chart-clip`,children:In.jsx("rect",{x:"0",y:"0",width:y,height:s})}),c&&In.jsx("mask",{id:`${e}-chart-area-mask`,children:In.jsx("rect",{fill:"white",x:v(c[0]),y:"0",width:v(c[1])-v(c[0]),height:x})})]}),In.jsxs("g",{transform:`translate(${l.left},${l.top})`,children:[In.jsxs("g",{clipPath:`url(#${e}-chart-clip)`,children:[In.jsx(bE,{series:t,xScale:v,yScale:b,xValue:PE,yValue:BE}),c&&In.jsx("g",{mask:`url(#${e}-chart-area-mask)`,children:In.jsx(bE,{series:t,xScale:v,yScale:b,xValue:PE,yValue:BE,fill:r.area.selection})}),In.jsx(ME,{value:n,xScale:v,innerHeight:x}),In.jsx(CE,{xScale:v,innerHeight:x})]}),In.jsx(i,{component:"rect",width:y,height:s,ref:m,sx:{fill:"transparent",cursor:"grab","&:active":{cursor:"grabbing"}}}),In.jsx(RE,{id:e,xScale:v,interactive:d,brushLabelValue:u,brushExtent:null!=c?c:v.domain(),innerWidth:y,innerHeight:x,setBrushExtent:p,westHandleColor:r.brush.handle.west,eastHandleColor:r.brush.handle.east})]})]})]})}const NE=8;function FE(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=Iy(e,t,o),m={liquidityActive:u.liquidityActive,tick:o,liquidityNet:en.BigInt(null!==(l=null===(s=i[n])||void 0===s?void 0:s.liquidityNet)&&void 0!==l?l:""),price0:h.toFixed(NE),sdkPrice:h};r?m.liquidityActive=en.add(u.liquidityActive,en.BigInt(null!==(c=null===(d=i[n])||void 0===d?void 0:d.liquidityNet)&&void 0!==c?c:0)):!r&&en.notEqual(u.liquidityNet,en.BigInt(0))&&(m.liquidityActive=en.subtract(u.liquidityActive,u.liquidityNet)),p.push(m),u=m}return r||(p=p.reverse()),p}const UE=8,qE=(e,t)=>e&&t?Math.floor(e/Jx[t])*Jx[t]:void 0,VE=1e3;function WE(e,t,n,i){const[o,r]=$(0),[a,s]=$([]),{data:l,error:d,isLoading:c}=function(e,t,n,i=0,o){var r;const a=vd(),s=e&&t&&n?My.getAddress(null==e?void 0:e.wrapped,null==t?void 0:t.wrapped,n,void 0,o?Ax[o]:void 0):void 0,l=a.getQuery(ge.graphql.AllV3TicksDocument,{skip:i,first:VE,where:{chain:o?pa[o]:void 0,poolAddress:null!==(r=null==s?void 0:s.toLowerCase())&&void 0!==r?r:void 0,refreshNow:!0,schemaName:"ammv3"}});return Qe(Object.assign(Object.assign({},l),{enabled:!0}))}(e,t,n,o,i),u=null==l?void 0:l.ticks;return Y((()=>{(null==u?void 0:u.length)&&(s((e=>[...e,...u])),(null==u?void 0:u.length)===VE&&r((e=>e+VE)))}),[u]),{isLoading:c||(null==u?void 0:u.length)===VE,error:d,ticks:a}}function HE({currencyA:e,currencyB:t,feeAmount:n}){const{isLoading:i,error:o,data:r}=function(e,t,n,i){var o,r,a;const{chainId:s}=hd(),l=lv(e,t,n),d=null===(o=l[1])||void 0===o?void 0:o.liquidity,c=null===(r=l[1])||void 0===r?void 0:r.sqrtRatioX96,u=null===(a=l[1])||void 0===a?void 0:a.tickCurrent,p=Z((()=>qE(u,n)),[u,n]),{isLoading:h,error:m,ticks:g}=WE(e,t,n,s);return Z((()=>{var n,i,o,r,a;if(!e||!t||void 0===p||l[0]!==sv.EXISTS||!g||0===g.length||h)return{isLoading:h||l[0]===sv.LOADING,error:m,activeTick:p,data:void 0};const s=null==e?void 0:e.wrapped,f=null==t?void 0:t.wrapped,x=g.findIndex((e=>(null==e?void 0:e.tickIdx)&&e.tickIdx>p))-1;if(x<0)return console.log("usePoolTickData","usePoolActiveLiquidity","TickData pivot not found",{token0:s.address,token1:f.address,chainId:s.chainId}),{isLoading:h,error:m,activeTick:p,data:void 0};const y=Iy(s,f,p),v={liquidityActive:en.BigInt(null!==(i=null===(n=l[1])||void 0===n?void 0:n.liquidity)&&void 0!==i?i:0),tick:p,liquidityNet:Number(null===(o=g[x])||void 0===o?void 0:o.tickIdx)===p?en.BigInt(null!==(a=null===(r=g[x])||void 0===r?void 0:r.liquidityNet)&&void 0!==a?a:0):en.BigInt(0),price0:y.toFixed(UE),sdkPrice:y},b=FE(s,f,v,g,x,!0),j=FE(s,f,v,g,x,!1).concat(v).concat(b);return{isLoading:h,error:m,currentTick:u,activeTick:p,liquidity:d,sqrtPriceX96:c,data:j}}),[e,t,p,l,g,h,m,u,d,c])}(e,t,n),a=z((()=>{if(!(null==r?void 0:r.length))return;const e=[];for(let t=0;t<r.length;t++){const n=r[t],i={activeLiquidity:parseFloat(n.liquidityActive.toString()),price0:parseFloat(n.price0)};i.activeLiquidity>0&&e.push(i)}return e}),[r]);return Z((()=>({isLoading:i,error:o,formattedData:i?void 0:a()})),[i,o,a])}const ZE={initialMin:.999,initialMax:1.001,min:1e-5,max:1.5},zE={[Kx.LOWEST]:ZE,[Kx.LOW_200]:ZE,[Kx.LOW_300]:ZE,[Kx.LOW_400]:ZE,[Kx.LOW]:ZE,[Kx.MEDIUM]:{initialMin:.5,initialMax:2,min:1e-5,max:20},[Kx.HIGH]:{initialMin:.5,initialMax:2,min:1e-5,max:20}};function $E({message:e,icon:t}){return In.jsxs(gx,{style:{height:"100%",justifyContent:"center"},children:[t,e&&In.jsx(i,{sx:{mt:20,p:10,typography:"caption",textAlign:"center"},children:e})]})}function GE(){return In.jsx(v,{})}function YE({currencyA:t,currencyB:n,feeAmount:o,ticksAtLimit:r,price:a,priceLower:s,priceUpper:l,onLeftRangeInput:d,onRightRangeInput:c,interactive:u}){const p=t&&n&&(null==t?void 0:t.wrapped.sortsBefore(null==n?void 0:n.wrapped)),{isLoading:h,error:m,formattedData:g}=HE({currencyA:t,currencyB:n,feeAmount:o}),f=z(((e,t)=>{let n=Number(e[0]);const i=Number(e[1]);n<=0&&(n=1/10**6),(!r[p?dx.LOWER:dx.UPPER]||"handle"===t||"reset"===t)&&n>0&&d(n.toFixed(6)),(!r[p?dx.UPPER:dx.LOWER]||"reset"===t)&&i>0&&i<1e35&&c(i.toFixed(6))}),[p,d,c,r]);u=u&&Boolean(null==g?void 0:g.length);const x=Z((()=>{const e=p?s:null==l?void 0:l.invert(),t=p?l:null==s?void 0:s.invert();return e&&t?[parseFloat(null==e?void 0:e.toSignificant(6)),parseFloat(null==t?void 0:t.toSignificant(6))]:void 0}),[p,s,l]),y=z(((e,t)=>{if(!a)return"";if("w"===e&&r[p?dx.LOWER:dx.UPPER])return"0";if("e"===e&&r[p?dx.UPPER:dx.LOWER])return"∞";const n=(t<a?-1:1)*((Math.max(t,a)-Math.min(t,a))/a)*100;return a?`${Ps({input:n,decimals:2})}%`:""}),[p,a,r]),v=!t||!n||void 0===g&&!h&&!m;return In.jsx(fx,{gap:"md",style:{minHeight:"200px"},children:v?In.jsx($E,{message:In.jsx(e,{id:"OZUH85",message:"Your position will appear here."}),icon:In.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:vE.neutral1,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[In.jsx("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),In.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"})]})}):h?In.jsx(GE,{}):m?In.jsx($E,{message:In.jsx(e,{id:"79D0qY",message:"Liquidity data not available."}),icon:In.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:vE.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[In.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"}),In.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}):g&&0!==g.length&&a?In.jsx(i,{sx:{position:"relative",width:"100%",maxHeight:"200px",justifyContent:"center",alignContent:"center"},children:In.jsx(DE,{data:{series:g,current:a},dimensions:{width:560,height:200},margins:{top:10,right:2,bottom:20,left:0},styles:{area:{selection:vE.accent1},brush:{handle:{west:vE.critical,east:vE.accent1}}},interactive:u,brushLabels:y,brushDomain:x,onBrushDomainChange:f,zoomLevels:zE[null!=o?o:Kx.MEDIUM],ticksAtLimit:r})}):In.jsx($E,{message:In.jsx(e,{id:"rH6vg9",message:"There is no liquidity data."}),icon:In.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 24 24",fill:"none",stroke:vE.neutral2,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[In.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),In.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),In.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})})})}const QE=({value:t,decrement:n,increment:o,decrementDisabled:r=!1,incrementDisabled:s=!1,locked:l,onUserInput:d,title:u,tokenA:p,tokenB:h})=>{const m=a(),[g,f]=$(!1),[x,y]=$(""),[v,b]=$(!1),[j,C]=$(!1),w=z((()=>{b(!1),f(!1),d(x)}),[x,d]),k=z((()=>{b(!1),d(n())}),[n,d]),T=z((()=>{b(!1),d(o())}),[o,d]);return Y((()=>{x===t||v||setTimeout((()=>{y(t),C(!0),setTimeout((function(){C(!1)}),1800)}),0)}),[x,v,t]),In.jsx(i,{onFocus:()=>{b(!0),f(!0)},onBlur:w,sx:{width:"100%",py:12,px:20,borderRadius:16,backgroundColor:m.palette.background.cardInput},children:In.jsxs(i,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:[In.jsx(i,{sx:{typography:"body2",fontWeight:600,color:m.palette.text.primary},children:u}),In.jsx(i,{sx:{mt:4,typography:"h6",fontWeight:500,color:m.palette.text.secondary},children:In.jsx(e,{id:"1/LP4K",message:"{tokenB} per {tokenA}",values:{tokenB:h,tokenA:p}})}),In.jsx(Rm,{sx:{mt:12,backgroundColor:m.palette.background.cardInput},value:x,onChange:e=>{y(e)},readOnly:l})]}),In.jsxs(i,{sx:{display:"flex",flexDirection:"column",gap:8},children:[!l&&In.jsx(c,{size:c.Size.small,onClick:T,disabled:s,sx:{px:4,backgroundColor:m.palette.background.paper,"&[disabled]":{cursor:"default"}},children:In.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.jsx("path",{d:"M14.25 9.75H9.75V14.25H8.25V9.75H3.75V8.25H8.25V3.75H9.75V8.25H14.25V9.75Z",fill:r?m.palette.text.disabled:m.palette.text.primary})})}),!l&&In.jsx(c,{size:c.Size.small,onClick:k,disabled:r,sx:{px:4,backgroundColor:m.palette.background.paper,"&[disabled]":{cursor:"default"}},children:In.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:In.jsx("rect",{x:"3.75",y:"8.25",width:"10.5",height:"1.5",fill:r?m.palette.text.disabled:m.palette.text.primary})})})]})]})})},XE=({priceLower:t,priceUpper:n,onLeftRangeInput:o,onRightRangeInput:r,getDecrementLower:a,getIncrementLower:s,getDecrementUpper:l,getIncrementUpper:d,currencyA:c,currencyB:u,feeAmount:p,ticksAtLimit:h})=>{var m,g,f,x;const y=null===(m=null!=c?c:void 0)||void 0===m?void 0:m.wrapped,v=null===(g=null!=u?u:void 0)||void 0===g?void 0:g.wrapped,b=y&&v&&y.sortsBefore(v),j=b?t:null==n?void 0:n.invert(),C=b?n:null==t?void 0:t.invert();return In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8},children:[In.jsx(QE,{value:h[b?dx.LOWER:dx.UPPER]?"0":null!==(f=null==j?void 0:j.toSignificant(8))&&void 0!==f?f:"",onUserInput:o,decrement:b?a:d,increment:b?s:l,decrementDisabled:void 0===j||h[b?dx.LOWER:dx.UPPER],incrementDisabled:void 0===j||h[b?dx.LOWER:dx.UPPER],feeAmount:p,label:j?`${null==u?void 0:u.symbol}`:"-",title:In.jsx(e,{id:"uEoBVI",message:"Low price"}),tokenA:null==c?void 0:c.symbol,tokenB:null==u?void 0:u.symbol}),In.jsx(QE,{value:h[b?dx.UPPER:dx.LOWER]?"∞":null!==(x=null==C?void 0:C.toSignificant(8))&&void 0!==x?x:"",onUserInput:r,decrement:b?l:s,increment:b?d:a,incrementDisabled:void 0===C||h[b?dx.UPPER:dx.LOWER],decrementDisabled:void 0===C||h[b?dx.UPPER:dx.LOWER],feeAmount:p,label:C?`${null==u?void 0:u.symbol}`:"-",tokenA:null==c?void 0:c.symbol,tokenB:null==u?void 0:u.symbol,title:In.jsx(e,{id:"kAC8rT",message:"High price"})})]})};var KE;function JE(){return JE=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},JE.apply(null,arguments)}const eA=e=>W.createElement("svg",JE({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),KE||(KE=W.createElement("g",{id:"ICON/18px/arrow/\\xE6\\x94\\xB6\\xE8\\xB5\\xB7/Dark"},W.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 tA({token:e,oppositeTokenAddress:t,dispatch:n,tokenSelectOnChange:o}){const r=a(),{chainId:s}=hd(),[l,c]=$(!1);return In.jsxs(In.Fragment,{children:[In.jsxs(i,{component:d,sx:{flexBasis:"100%",flexGrow:1,flexShrink:1,display:"flex",alignItems:"center",px:20,py:8,borderRadius:12,borderWidth:1,borderStyle:"solid",borderColor:e?r.palette.border.main:r.palette.primary.main,color:e?r.palette.text.primary:r.palette.primary.contrastText,backgroundColor:e?"transparent":r.palette.primary.main,"&:hover":{borderColor:e?r.palette.border.main:r.palette.primary.main,opacity:.8},[r.breakpoints.up("tablet")]:{flexBasis:"50%"}},onClick:()=>{c(!0)},children:[e?In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:8},children:[In.jsx(Fc,{address:e.address,marginRight:0,width:24,height:24,chainId:e.chainId||s,noShowChain:!0,sx:{flexShrink:0}}),In.jsx(i,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:e.symbol})]}):In.jsx(i,{sx:{typography:"h5",fontWeight:600,lineHeight:"32px",flexShrink:0},children:le._({id:"0RrIzN",message:"Select token"})}),In.jsx(i,{component:eA,sx:{flexShrink:0,ml:"auto",width:18,height:18}})]}),In.jsx(Zm,{value:mv(e),open:l,chainId:s,occupiedAddrs:[t],occupiedChainId:null==e?void 0:e.chainId,onClose:()=>{c(!1)},onTokenChange:(e,t)=>{if(!Array.isArray(e)){if(t)return n({type:vv.UpdateBaseTokenAndClearQuoteToken,payload:e}),void c(!1);o(e),c(!1)}},modal:!0})]})}const nA=({baseToken:e,quoteToken:t,dispatch:n})=>{var o,r;const s=a();return In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",[s.breakpoints.up("tablet")]:{flexWrap:"nowrap"}},children:[In.jsx(tA,{token:e,oppositeTokenAddress:null!==(o=null==t?void 0:t.address)&&void 0!==o?o:"",dispatch:n,tokenSelectOnChange:e=>{n({type:vv.UpdateBaseToken,payload:e})}}),In.jsx(tA,{token:t,oppositeTokenAddress:null!==(r=null==e?void 0:e.address)&&void 0!==r?r:"",dispatch:n,tokenSelectOnChange:e=>{n({type:vv.UpdateQuoteToken,payload:e})}})]})};const iA=[{value:.03,title:"Narrow"},{value:.08,title:"Standard"},{value:.15,title:"Wide"},{value:1,title:"Full"}],oA=e=>{const t=a(),[n,o]=$(null);return In.jsx(i,{sx:{borderRadius:16,borderWidth:1,borderStyle:"solid",borderColor:t.palette.border.main,overflow:"hidden",display:"flex",alignItems:"center",flexWrap:"wrap",alignSelf:"stretch"},children:iA.map(((r,a)=>In.jsxs(i,{component:d,onClick:()=>{o(r.value),e.onSelect(r.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 ${t.palette.border.main}`:"none",borderBottom:a<=1?`1px solid ${t.palette.border.main}`:"none",[t.breakpoints.up("tablet")]:{flexBasis:"25%",borderRight:a===iA.length-1?"none":`1px solid ${t.palette.border.main}`,borderBottom:"none"},backgroundColor:n===r.value?T("#7BF179",.1):"transparent","&:hover":{backgroundColor:T("#7BF179",.1)}},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:t.palette.text.primary},children:r.title}),In.jsx(i,{sx:{typography:"h6",fontWeight:600,color:t.palette.text.primary},children:1===r.value?"∞":`+-${100*r.value}%`})]},r.value)))})};function rA({params:t,handleGoBack:n,handleGoToPoolList:o}){var r,s,l,d,c,u,p,h,m,g;const{chainId:f,account:x}=hd(),y=a(),v=Wd(),{isMobile:b}=Sd(),j=Qe(Object.assign({},Ea.getFetchTokenQuery(f,null==t?void 0:t.from,x))),C=Qe(Object.assign({},Ea.getFetchTokenQuery(f,null==t?void 0:t.to,x))),[w,k]=ee(bv,{baseToken:null,quoteToken:null,feeAmount:(null==t?void 0:t.fee)?Number(null==t?void 0:t.fee):void 0,independentField:lx.CURRENCY_A,typedValue:"",startPriceTypedValue:"",leftRangeTypedValue:"",rightRangeTypedValue:""});Y((()=>{j.data&&k({type:vv.UpdateDefaultBaseToken,payload:j.data})}),[j]),Y((()=>{C.data&&k({type:vv.UpdateDefaultQuoteToken,payload:C.data})}),[C]);const{independentField:E,typedValue:A,startPriceTypedValue:I}=w,{pool:S,ticks:L,dependentField:O,price:R,pricesAtTicks:M,pricesAtLimit:_,parsedAmounts:P,currencyBalances:B,position:D,noLiquidity:N,currencies:F,errorMessage:U,invalidPool:q,invalidRange:V,outOfRange:W,depositADisabled:H,depositBDisabled:G,invertPrice:Q,ticksAtLimit:X,isTaxed:K}=yv({state:w}),J=Z((()=>{var e;return null===(e=Q?null==R?void 0:R.invert():R)||void 0===e?void 0:e.toSignificant()}),[Q,R]),{onFieldAInput:te,onFieldBInput:ne,onLeftRangeInput:ie,onRightRangeInput:oe,onStartPriceInput:re}=jv({noLiquidity:N,dispatch:k}),{slipper:ae,setSlipper:se,slipperValue:de,resetSlipper:ce}=ox({address:void 0,type:"AMMV3"}),ue=!U&&!V,[pe,he]=$(!1),me={[E]:A,[O]:null!==(s=null===(r=P[O])||void 0===r?void 0:r.toSignificant(6))&&void 0!==s?s:""},ge=[lx.CURRENCY_A,lx.CURRENCY_B].reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:Tv(B[t])})),{}),fe=cc(mv(null===(l=P[lx.CURRENCY_A])||void 0===l?void 0:l.currency),{contractAddress:Ix[f],overrideBalance:B[lx.CURRENCY_A]?new Le(B[lx.CURRENCY_A].toSignificant()):void 0,amount:P[lx.CURRENCY_A]?new Le(P[lx.CURRENCY_A].toSignificant()):void 0}),xe=cc(mv(null===(d=P[lx.CURRENCY_B])||void 0===d?void 0:d.currency),{contractAddress:Ix[f],overrideBalance:B[lx.CURRENCY_B]?new Le(B[lx.CURRENCY_B].toSignificant()):void 0,amount:P[lx.CURRENCY_B]?new Le(P[lx.CURRENCY_B].toSignificant()):void 0}),{[dx.LOWER]:ye,[dx.UPPER]:ve}=L,{[dx.LOWER]:be,[dx.UPPER]:je}=M,{getDecrementLower:Ce,getIncrementLower:we,getDecrementUpper:ke,getIncrementUpper:Te,getSetFullRange:Ee}=function({tickLower:e,tickUpper:t,pool:n,state:i,dispatch:o}){const{baseToken:r,quoteToken:a,feeAmount:s}=i,l=Z((()=>null==r?void 0:r.wrapped),[r]),d=Z((()=>null==a?void 0:a.wrapped),[a]);return{getDecrementLower:z((()=>l&&d&&"number"==typeof e&&s?Iy(l,d,e-Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):"number"!=typeof e&&l&&d&&s&&n?Iy(l,d,n.tickCurrent-Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):""),[l,d,e,s,n]),getIncrementLower:z((()=>l&&d&&"number"==typeof e&&s?Iy(l,d,e+Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):"number"!=typeof e&&l&&d&&s&&n?Iy(l,d,n.tickCurrent+Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):""),[l,d,e,s,n]),getDecrementUpper:z((()=>l&&d&&"number"==typeof t&&s?Iy(l,d,t-Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):"number"!=typeof t&&l&&d&&s&&n?Iy(l,d,n.tickCurrent-Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):""),[l,d,t,s,n]),getIncrementUpper:z((()=>l&&d&&"number"==typeof t&&s?Iy(l,d,t+Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):"number"!=typeof t&&l&&d&&s&&n?Iy(l,d,n.tickCurrent+Jx[s]).toSignificant(5,void 0,Lx.ROUND_UP):""),[l,d,t,s,n]),getSetFullRange:z((()=>{o({type:vv.setFullRange,payload:void 0})}),[o])}}({tickLower:ye,tickUpper:ve,pool:S,state:w,dispatch:k}),Ae=z((e=>{if(Ee(),1!==e){if(J){const t=new Le(J),n=t.multipliedBy(1-e),i=t.multipliedBy(1+e);ie(n.dp(5,Le.ROUND_DOWN).toString()),oe(i.dp(5,Le.ROUND_DOWN).toString())}return}const t=_[dx.LOWER];t&&ie(t.toSignificant(5));const n=_[dx.UPPER];n&&oe(n.toSignificant(5))}),[J,Ee,ie,oe,_]),{deadLine:Ie}=On(),Se=Je({mutationFn:()=>bn(this,void 0,void 0,(function*(){if(!x||!f||!D)return;if(!w.baseToken||!w.quoteToken)return;const e=Math.ceil(Date.now()/1e3)+(null!=Ie?Ie:600),t=w.baseToken.isNative?w.baseToken:w.quoteToken.isNative?w.quoteToken:void 0;try{const{calldata:n,value:i}=Zy.addCallParameters(D,{slippageTolerance:Iv(100*de),recipient:x,deadline:e.toString(),useNative:t,createPool:N});let r={to:Ix[f],data:n,value:i};(yield v.execute(le._({id:"8OiU8L",message:"Pool Creation"}),Object.assign({opcode:Dd.TX},r),{early:!1,metadata:{[Od.createAMMV3Pool]:"1"}}))===Rd.Success&&setTimeout((()=>{o()}),100)}catch(e){console.error("onAddMutation",e)}}))});return In.jsxs(In.Fragment,{children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:20,mx:16,pb:20,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"border.main",mb:20,[y.breakpoints.up("tablet")]:{width:600,mx:"auto"}},children:[In.jsx(Uj,{}),In.jsx(i,{sx:{typography:"caption",fontWeight:600,color:"text.primary",mr:"auto"},children:In.jsx(e,{id:"E6MqGy",message:"Add liquidity"})}),In.jsx(tv,{poolType:"AMM V3"})]}),In.jsxs(i,{sx:{px:16,display:"flex",flexDirection:"column",alignItems:"stretch",backgroundColor:y.palette.background.paper,borderRadius:16,[y.breakpoints.up("tablet")]:{borderColor:y.palette.border.main,borderWidth:1,borderStyle:"solid",px:0,mx:"auto",width:600}},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:20,py:20,[y.breakpoints.up("tablet")]:{px:20}},children:[In.jsxs(i,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:12},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:y.palette.text.primary,textAlign:"left"},children:le._({id:"nxRg31",message:"Select pair"})}),In.jsx(nA,{baseToken:w.baseToken,quoteToken:w.quoteToken,dispatch:k}),In.jsx(yE,{disabled:!w.baseToken||!w.quoteToken,feeAmount:w.feeAmount,dispatch:k})]}),In.jsxs(bx,{disabled:!w.feeAmount||q,children:[In.jsxs(i,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:y.palette.text.primary,textAlign:"left"},children:le._({id:"5CZbyC",message:"Set price range"})}),Boolean(w.baseToken&&w.quoteToken)&&In.jsx(Xy,{baseToken:w.baseToken,quoteToken:w.quoteToken,handleRateToggle:()=>{var e,t,n,i,o;X[dx.LOWER]||X[dx.UPPER]||(ie(null!==(t=null===(e=Q?be:null==je?void 0:je.invert())||void 0===e?void 0:e.toSignificant(6))&&void 0!==t?t:""),oe(null!==(i=null===(n=Q?je:null==be?void 0:be.invert())||void 0===n?void 0:n.toSignificant(6))&&void 0!==i?i:""),te(null!==(o=me[lx.CURRENCY_B])&&void 0!==o?o:"")),k({type:vv.ToggleRate,payload:void 0})},sx:b?{flexGrow:0,flexShrink:1,flexBasis:"50%"}:void 0})]}),In.jsx(oA,{onSelect:Ae}),In.jsx(XE,{priceLower:be,priceUpper:je,getDecrementLower:Ce,getIncrementLower:we,getDecrementUpper:ke,getIncrementUpper:Te,onLeftRangeInput:ie,onRightRangeInput:oe,currencyA:w.baseToken,currencyB:w.quoteToken,feeAmount:w.feeAmount,ticksAtLimit:X}),W&&In.jsx(mx,{children:le._({id:"b+KjnH",message:"Your position will not earn fees or be used in trades until the market price moves into your range."})}),V&&In.jsx(mx,{children:le._({id:"Jh223O",message:"Invalid range selected. The min price must be lower than the max price."})})]}),N?In.jsxs(bx,{children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:y.palette.text.primary,textAlign:"left"},children:le._({id:"zeSosD",message:"Starting price"})}),In.jsx(i,{sx:{p:8,borderRadius:8,backgroundColor:T(y.palette.primary.main,.1),typography:"h6",color:y.palette.primary.main},children:le._({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."})}),In.jsx(i,{sx:{px:16,py:12,borderRadius:8,borderWidth:1,borderColor:y.palette.border.main,borderStyle:"solid"},children:In.jsx(Rm,{sx:{backgroundColor:"transparent"},value:I,onChange:re})})]}):In.jsxs(bx,{disabled:!w.feeAmount||q,children:[In.jsxs(i,{sx:{typography:"body1",fontWeight:600,color:y.palette.text.primary,textAlign:"left"},children:[le._({id:"DWd30U",message:"Current price"}),In.jsxs(i,{children:[J," ",le._({id:"b2jAb+",message:"per"})," ",null!==(u=null===(c=w.baseToken)||void 0===c?void 0:c.symbol)&&void 0!==u?u:""]})]}),In.jsx(YE,{currencyA:null!==(p=w.baseToken)&&void 0!==p?p:void 0,currencyB:null!==(h=w.quoteToken)&&void 0!==h?h:void 0,feeAmount:w.feeAmount,ticksAtLimit:X,price:R?parseFloat((Q?R.invert():R).toSignificant(8)):void 0,priceLower:be,priceUpper:je,onLeftRangeInput:ie,onRightRangeInput:oe,interactive:!0})]}),In.jsxs(bx,{disabled:q||V||N&&!I,children:[In.jsx(i,{sx:{typography:"body1",fontWeight:600,color:y.palette.text.primary,textAlign:"left"},children:le._({id:"MU9s7M",message:"Deposit amounts"})}),In.jsxs(i,{children:[In.jsx(Ex,{value:me[lx.CURRENCY_A],onUserInput:te,maxAmount:ge[lx.CURRENCY_A],balance:B[lx.CURRENCY_A],currency:null!==(m=F[lx.CURRENCY_A])&&void 0!==m?m:null,locked:H}),In.jsx(ng,{}),In.jsx(Ex,{value:me[lx.CURRENCY_B],onUserInput:ne,maxAmount:ge[lx.CURRENCY_B],balance:B[lx.CURRENCY_B],currency:null!==(g=F[lx.CURRENCY_B])&&void 0!==g?g:null,locked:G})]}),In.jsx(rx,{value:ae,onChange:se,disabled:!1,type:"AMMV3"})]})]}),In.jsx(i,{sx:{display:"flex",alignItems:"center",py:16,[y.breakpoints.up("tablet")]:{px:20,borderBottomLeftRadius:16,borderBottomRightRadius:16,backgroundColor:y.palette.background.paper}},children:In.jsx(jx,{chainId:f,approvalA:fe,approvalB:xe,parsedAmounts:P,isValid:ue,depositADisabled:H,depositBDisabled:G,errorMessage:U,setShowConfirm:he})}),In.jsx(rv,{parsedAmounts:P,position:D,existingPosition:void 0,priceLower:be,priceUpper:je,outOfRange:W,ticksAtLimit:X,on:pe,onClose:()=>{he(!1)},onConfirm:Se.mutate,loading:Se.isPending})]})]})}function aA(){const{routerPage:e}=On(),t=Gf((e=>e.page)),n=null!=e?e:t;switch(null==n?void 0:n.type){case $f.Pool:return In.jsx(Fj,{params:n.params});case $f.CreatePool:return In.jsx(ST,{});case $f.ModifyPool:return In.jsx(NT,{params:n.params});case $f.PoolDetail:return In.jsx(dE,{params:n.params});case $f.createPoolAMMV2:return In.jsx(xE,{});case $f.createPoolAMMV3:return In.jsx(rA,{params:n.params,handleGoBack:()=>{Gf.getState().push({type:$f.Pool})},handleGoToPoolList:()=>{Gf.getState().push({type:$f.Pool})}});default:return In.jsx(Fj,{params:null==n?void 0:n.params})}}export{xE as A,Fj as B,NT as C,aj as D,Mn as E,Nn as F,sj as G,Vh as M,$f as P,Jm as S,og as T,tm as U,nm as W,Gs as a,Ns as b,Hf as c,Fc as d,Kh as e,zs as f,Zf as g,us as h,Od as i,In as j,Uh as k,Gf as l,ad as m,_s as n,Ps as o,aA as p,rA as q,da as r,ua as s,Mc as t,Df as u,Lv as v,Mv as w,cb as x,ST as y,dE as z};