@orbs-network/spot-react 0.0.107 → 0.0.108

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.
@@ -1,4 +1,4 @@
1
- (function(R,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],C):(R=typeof globalThis<"u"?globalThis:R||self,C(R.SpotReact={},R.jsxRuntime,R.React,R.ReactDOM))})(this,(function(R,C,M,Os){"use strict";var sq=Object.defineProperty;var q5=R=>{throw TypeError(R)};var aq=(R,C,M)=>C in R?sq(R,C,{enumerable:!0,configurable:!0,writable:!0,value:M}):R[C]=M;var td=(R,C,M)=>aq(R,typeof C!="symbol"?C+"":C,M),Pm=(R,C,M)=>C.has(R)||q5("Cannot "+M);var N=(R,C,M)=>(Pm(R,C,"read from private field"),M?M.call(R):C.get(R)),le=(R,C,M)=>C.has(R)?q5("Cannot add the same private member more than once"):C instanceof WeakSet?C.add(R):C.set(R,M),J=(R,C,M,Os)=>(Pm(R,C,"write to private field"),Os?Os.call(R,M):C.set(R,M),M),Se=(R,C,M)=>(Pm(R,C,"access private method"),M);var rd=(R,C,M,Os)=>({set _(sd){J(R,C,sd,M)},get _(){return N(R,C,Os)}});var bn,ba,B5,ya,ks,Ao,F5,So,Cs,Po,O5,ga,U5,xa,Io,Fr,wa,Bt,Sc,va,Xr,Zn,D5,nr,_e,Pc,Wt,Ea,Bo,Vn,Ts,Ic,Fo,Oo,ka,Ca,As,Uo,We,Oc,Im,Bm,Fm,Om,Um,Dm,_m,K5,_5,Bc,yn,qt,Ta,gn,Fs,M5,Wn,Qr,Fc,N5,qn,Ss,sr,Kn,Yn,nd,Mm,L5,xn,z5,mt,Ps,Is,Do,_o,Bs,Mo,No,R5;function sd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Et=sd(M),Pe={SpookySwap:{chainName:"ftm",chainId:250,twapVersion:4,twapAddress:"0xd3B290FEB04E353d1821bc0a12397FdEa9a846C0",lensAddress:"0x0221EfDF1Fd3212AF87F23cceB7693a65fAF1d7f",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwap",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0xdF7CCd5fc7077E9de5f27a7b7bfDC837c82f8496",exchangeType:"ExchangeV2",pathfinderKey:""},SpookySwapSonic:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwapSonic",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0x6699bE3aF75e5c1B807b1031dBde6dA9A67739F3",exchangeType:"ExchangeV2",pathfinderKey:""},QuickSwap:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:"QuickSwap,QuickSwapV3"},QuickSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0xb7a3d74895bfd3aff6780525e36d79fcf26a895f",exchangeType:"ExchangeV2",pathfinderKey:""},Chronos:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Chronos",partner:"Orbs:TWAP:Chronos",exchangeAddress:"0x0178e50adAF3b925F27aC518FCd952CE7F9A3B36",exchangeType:"ExchangeV2",pathfinderKey:"Chronos Stable,Chronos Volatile,Chronos V3"},BaseSwap:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BaseSwap",partner:"Orbs:TWAP:BaseSwap",exchangeAddress:"0xAca3155c17530C4aA96746F226fcC049658490d2",exchangeType:"ExchangeV2",pathfinderKey:"BaseSwap,BaseSwapX"},Arbidex:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Arbidex",partner:"Orbs:TWAP:Arbidex",exchangeAddress:"0x49d21052f4695d16C7cce6eF561301Aa4d840420",exchangeType:"ExchangeV2",pathfinderKey:"Arbidex Classic,Arbidex Quantum"},Thena:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Thena",partner:"Orbs:TWAP:Thena",exchangeAddress:"0x2B2fABDbfa4a15da0d351F947C14F4520db0bDc1",exchangeType:"ExchangeV2",pathfinderKey:"43,47"},PancakeSwap:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0x1A2bb6B75D58b740d88413ef4840D6fa3F637940",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapArbitrum:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapLinea:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},Lynex:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"Lynex",partner:"Orbs:TWAP:Lynex",exchangeAddress:"0x04C06C96d7D19977156016DD408B5992af0570a2",exchangeType:"ExchangeV2",pathfinderKey:"19,18"},SyncSwap:{chainName:"zkSync",chainId:324,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"SyncSwap",partner:"Orbs:TWAP:SyncSwap",exchangeAddress:"0x422623a40c42f026Ed33A9910078Aa843FD66e27",exchangeType:"ExchangeV2",pathfinderKey:"2,3"},Retro:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Retro",partner:"Orbs:TWAP:Retro",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2",pathfinderKey:"retro,retro-v3"},SushiArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiArb",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiBase",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiEth:{chainName:"eth",chainId:1,twapVersion:4,twapAddress:"0xb1ed8BCAD1EaC8a1DF0764700472391800D12946",lensAddress:"0x0967f448c4d4dbd14c355E635AE9CbF68cc44A60",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:200,name:"SushiEth",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiKatana:{chainName:"katana",chainId:747474,twapVersion:4,twapAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",lensAddress:"0x1579EED0527781B1A748043AA1f59a3858Ace4a7",takers:["0xF74437A3Fc45a518640828E5D6A3E8c9A9BbDC3a","0x07A6C715063e94c0D95e809efefFCbF4EBEdfD55"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiKatana",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x92209481507e6B2d14C9b5b70Ed287024177220E",exchangeType:"ExchangeV2",pathfinderKey:""},DragonSwap:{chainName:"sei",chainId:1329,twapVersion:4,twapAddress:"0xde737dB24548F8d41A4a3Ca2Bac8aaaDc4DBA099",lensAddress:"0xa1376f2Bb80D3cF6c2D8ebEf34b3d122e9af4020",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"DragonSwap",partner:"Orbs:TWAP:DragonSwap",exchangeAddress:"0xf2F933FafbDB97062CfA3c447ff373e76A90Efd6",exchangeType:"ExchangeV2",pathfinderKey:""},TeaFi:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"TeaFi",partner:"Orbs:TWAP:TeaFi",exchangeAddress:"0xE9D3b4Cf5B0CC392e78C1a4DD9885D449EEF9793",exchangeType:"ParaswapExchange",pathfinderKey:"AaveV2,AaveV3,AaveV3Stata,AngleStakedStableEUR,AngleStakedStableUSD,ApeSwap,AugustusRFQ,BalancerV2,ComethSwap,CurveV1,CurveV1Factory,CurveV1StableNg,CurveV2,Dfyn,DODOV2,Dystopia,Hashflow,IronV2,JarvisV6,KyberDmm,QuickSwap,QuickSwapV3,Retro,SushiSwap,SushiSwapV3,SwaapV2,Synapse,UniswapV2,UniswapV3,WaultFinance,Wmatic,WooFiV2,wUSDM"},SparkDEX:{chainName:"flare",chainId:14,twapVersion:4,twapAddress:"0x9D70B0b90915Bb8b9bdAC7e6a7e6435bBF1feC4D",lensAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SparkDEX",partner:"Orbs:TWAP:SparkDEX",exchangeAddress:"0xe59c53C76bB7EEc01401A18fA8215B94bC65Bf56",exchangeType:"P2Exchange"},Ramses:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Ramses",partner:"Orbs:TWAP:Ramses",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:""},SwapX:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SwapX",partner:"Orbs:TWAP:SwapX",exchangeAddress:"0xDA902994b7F7a1ecDd8De02E4a17dbFF2E6F67b7",exchangeType:"ExchangeV2",pathfinderKey:""},H2Finance:{chainName:"cronos-zkevm",chainId:388,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"H2Finance",partner:"Orbs:TWAP:H2Finance",exchangeAddress:"0x2f1f10dc311722Be609e6B427bF3FBac6e44093B",exchangeType:"ExchangeV2"},Shadow:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Shadow",partner:"Orbs:TWAP:Shadow",exchangeAddress:"0x69e3c891450161b7BF27f181eE85E7bAE69E5b07",exchangeType:"ExchangeV2"},Kodiak:{chainName:"berachain",chainId:80094,twapVersion:4,twapAddress:"0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E",lensAddress:"0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Kodiak",partner:"Orbs:TWAP:Kodiak",exchangeAddress:"0x69B7aE1250B8d1309954CaD65b6607ae478Ec6eE",exchangeType:"ExchangeV2"},OmniBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"OmniBase",partner:"Orbs:TWAP:OmniBase",exchangeAddress:"0x54435FcFDF3A08150Ed799b6EF472A20a432303F",exchangeType:"ParaswapExchange"},OmniArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"OmniArb",partner:"Orbs:TWAP:OmniArb",exchangeAddress:"0xF0607785424d342Cceb33E708f4579CA97a3b392",exchangeType:"ParaswapExchange"},BlackholeAvax:{chainName:"avax",chainId:43114,twapVersion:4,twapAddress:"0xf77Ad005aBF7e31f669ce89a6568B2f39Ca92cDe",lensAddress:"0x48466B82Ce1575c5c9eCa168ac1090048dD47fA3",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BlackholeAvax",partner:"Orbs:TWAP:BlackholeAvax",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2"},NewEraBnb:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"NewEraBnb",partner:"Orbs:TWAP:NewEraBnb",exchangeAddress:"0xA22D7Df24d9Ea4D4EF6dC96b2204bd550430eC42",exchangeType:"ExchangeV2"}},Y5=[{constant:!1,inputs:[{name:"wad",type:"uint256"}],name:"withdraw",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[],name:"deposit",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"dst",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"}],Z5=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",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:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],X5=JSON.parse('[{"inputs":[{"internalType":"address","name":"_iweth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"name":"OrderBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"OrderCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"}],"name":"OrderCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstAmountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"srcFilledAmount","type":"uint256"}],"name":"OrderFilled","type":"event"},{"inputs":[],"name":"MIN_BID_DELAY_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_OUTBID_PERCENT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_BASE","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALE_BID_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_CANCELED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_COMPLETED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"_ask","type":"tuple"}],"name":"ask","outputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"bid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"book","outputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"fill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"iweth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"makerOrders","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"order","outputs":[{"components":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"internalType":"struct OrderLib.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"orderIdsByMaker","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"prune","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"status","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]'),Q5=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"cancel",inputs:[{name:"digests",type:"bytes32[]",internalType:"bytes32[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"hashTypedData",inputs:[{name:"structHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"digest",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"repermitWitnessTransferFrom",inputs:[{name:"permit",type:"tuple",internalType:"struct RePermitLib.RePermitTransferFrom",components:[{name:"permitted",type:"tuple",internalType:"struct RePermitLib.TokenPermissions",components:[{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"}]},{name:"request",type:"tuple",internalType:"struct RePermitLib.TransferRequest",components:[{name:"to",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"signer",type:"address",internalType:"address"},{name:"witness",type:"bytes32",internalType:"bytes32"},{name:"witnessTypeString",type:"string",internalType:"string"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"spent",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"event",name:"Cancel",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"digest",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"Spend",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"permitHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"totalSpent",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"Canceled",inputs:[]},{type:"error",name:"Expired",inputs:[]},{type:"error",name:"InsufficientAllowance",inputs:[]},{type:"error",name:"InvalidShortString",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"StringTooLong",inputs:[{name:"str",type:"string",internalType:"string"}]}],zm=Y5,J5=Z5,Rm=Q5,Hm=X5;var ge=(e=>(e.TWAP="TWAP",e.LIMIT="LIMIT",e.STOP_LOSS="STOP_LOSS",e.TAKE_PROFIT="TAKE_PROFIT",e))(ge||{}),ut=(e=>(e.Open="OPEN",e.Cancelled="CANCELLED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(ut||{}),ar=(e=>(e.All="ALL",e.Open="OPEN",e.Cancelled="CANCELLED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(ar||{}),$t=(e=>(e[e.Minutes=6e4]="Minutes",e[e.Hours=36e5]="Hours",e[e.Weeks=6048e5]="Weeks",e[e.Days=864e5]="Days",e[e.Months=2592e6]="Months",e[e.Years=31536e6]="Years",e))($t||{}),Re=(e=>(e.LIMIT="limit",e.TWAP_LIMIT="twap-limit",e.TWAP_MARKET="twap-market",e.TAKE_PROFIT="take-profit",e.STOP_LOSS_LIMIT="stop-loss-limit",e.STOP_LOSS_MARKET="stop-loss-market",e))(Re||{}),Jr=(e=>(e.Arbidex="arbidex",e.Blackhole="blackhole",e.Chronos="chronos",e.Dragon="dragon",e.Kodiak="kodiak",e.Lynex="lynex",e.Nami="nami",e.Newera="newera",e.Omni="omni",e.Pancake="pancake",e.Quick="quick",e.Ramses="ramses",e.Shadow="shadow",e.Spark="spark",e.Spooky="spooky",e.Swapx="swapx",e.Teafi="teafi",e.Thena="thena",e.Yowie="yowie",e.Pangolin="pangolin",e.Sushiswap="sushiswap",e.Agent="agent",e))(Jr||{}),Dt=(e=>(e[e.EMPTY_LIMIT_PRICE=0]="EMPTY_LIMIT_PRICE",e[e.MAX_CHUNKS=1]="MAX_CHUNKS",e[e.MIN_CHUNKS=2]="MIN_CHUNKS",e[e.MIN_TRADE_SIZE=3]="MIN_TRADE_SIZE",e[e.MAX_FILL_DELAY=4]="MAX_FILL_DELAY",e[e.MIN_FILL_DELAY=5]="MIN_FILL_DELAY",e[e.MAX_ORDER_DURATION=6]="MAX_ORDER_DURATION",e[e.MIN_ORDER_DURATION=7]="MIN_ORDER_DURATION",e[e.MISSING_LIMIT_PRICE=8]="MISSING_LIMIT_PRICE",e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE=9]="STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE",e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE=10]="TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE",e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE=11]="TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE",e[e.EMPTY_TRIGGER_PRICE=12]="EMPTY_TRIGGER_PRICE",e[e.INSUFFICIENT_BALANCE=13]="INSUFFICIENT_BALANCE",e[e.MAX_ORDER_SIZE=14]="MAX_ORDER_SIZE",e[e.MIN_TRADE_SIZE_ERROR=15]="MIN_TRADE_SIZE_ERROR",e))(Dt||{});const xt="0x0000000000000000000000000000000000000000",Ft={eth:{id:1,name:"Ethereum",shortname:"eth",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://eth.llamarpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://etherscan.io",eip1559:!0},bsc:{id:56,name:"BinanceSmartChain",shortname:"bsc",native:{address:xt,symbol:"BNB",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},wToken:{symbol:"WBNB",address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},publicRpcUrl:"https://bsc-dataseed.binance.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/bsc_2.svg",explorer:"https://bscscan.com",eip1559:!1},poly:{id:137,name:"Polygon",shortname:"poly",native:{address:xt,symbol:"POL",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png"},wToken:{symbol:"WPOL",address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270.png"},publicRpcUrl:"https://polygon-rpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/polygon.svg",explorer:"https://polygonscan.com",eip1559:!0},arb:{id:42161,name:"Arbitrum",shortname:"arb",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://arb1.arbitrum.io/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/arbitrum.svg",explorer:"https://arbiscan.io",eip1559:!0},sei:{id:1329,name:"Sei",shortname:"sei",native:{address:xt,symbol:"SEI",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png"},wToken:{symbol:"WSEI",address:"0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://evm-rpc.sei-apis.com",logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png",explorer:"https://seitrace.com",eip1559:!1},avax:{id:43114,name:"Avalanche",shortname:"avax",native:{address:xt,symbol:"AVAX",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg"},wToken:{symbol:"WAVAX",address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7.png"},publicRpcUrl:"https://api.avax.network/ext/bc/C/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg",explorer:"https://snowtrace.io",eip1559:!0},ftm:{id:250,name:"Fantom",shortname:"ftm",native:{address:xt,symbol:"FTM",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg"},wToken:{symbol:"WFTM",address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x4e15361fd6b4bb609fa63c81a2be19d873717870.png"},publicRpcUrl:"https://rpc.ftm.tools",logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg",explorer:"https://ftmscan.com",eip1559:!0},base:{id:8453,name:"Base",shortname:"base",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.base.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/base.svg",explorer:"https://basescan.org",eip1559:!1},linea:{id:59144,name:"Linea",shortname:"linea",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.linea.build",logoUrl:"https://lineascan.build/images/logo.svg",explorer:"https://lineascan.build",eip1559:!1},zksync:{id:324,name:"zksync",shortname:"zksync",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.era.zksync.io",logoUrl:"https://raw.githubusercontent.com/matter-labs/zksync/0a4ca2145a0c95b5bafa84c2f095c644907a8825/zkSyncLogo.svg",explorer:"https://explorer.zksync.io/",eip1559:!0},zkevm:{id:1101,name:"zkevm",shortname:"zkevm",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zkevm-rpc.com",logoUrl:"https://user-images.githubusercontent.com/18598517/235932702-bc47eae5-d672-4dd9-9da2-8ea8f51a93f3.png",explorer:"https://zkevm.polygonscan.com/",eip1559:!0},manta:{id:169,name:"manta",shortname:"manta",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg"},wToken:{symbol:"WETH",address:"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://pacific-rpc.manta.network/http",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg",explorer:"https://manta.socialscan.io/",eip1559:!0},blast:{id:81457,name:"blast",shortname:"blast",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast"},wToken:{symbol:"WETH",address:"0x4300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.ankr.com/blast",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast",explorer:"https://blastscan.io/",eip1559:!0},sonic:{id:146,name:"sonic",shortname:"sonic",native:{address:xt,symbol:"S",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},wToken:{symbol:"WS",address:"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},publicRpcUrl:"https://rpc.soniclabs.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic",explorer:"https://www.sonicscan.org/",eip1559:!0},scroll:{id:534352,name:"scroll",shortname:"scroll",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll"},wToken:{symbol:"WETH",address:"0x5300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://scroll-rpc.publicnode.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll",explorer:"https://scrollscan.com/",eip1559:!0},zircuit:{id:48900,name:"Zircuit",shortname:"zircuit",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"hhttps://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zircuit-mainnet.drpc.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://explorer.zircuit.com/",eip1559:!0},flare:{id:14,name:"flare",shortname:"flare",native:{address:xt,symbol:"FLR",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48"},wToken:{symbol:"WFLR",address:"0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d",decimals:18,logoUrl:"https://res.cloudinary.com/sparkdex/image/upload/q_100/v1/website-assets/coins/wflr?_a=DATAg1AAZAA0"},publicRpcUrl:"https://flare.network",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48",explorer:"https://flarescan.com",eip1559:!0},cronosZkEvm:{id:388,name:"Cronos zkEVM",shortname:"cronosZkEvm",native:{address:"0x000000000000000000000000000000000000800a",symbol:"zkCRO",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},wToken:{symbol:"wzkCRO",address:"0xC1bF55EE54E16229d9b369a5502Bfe5fC9F20b6d",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},publicRpcUrl:"https://rpc.zkevm.cronos.org",logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png",explorer:"https://explorer.zkevm.cronos.org",eip1559:!0},katana:{id:747474,name:"Katana",shortname:"katana",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://katana.network/assets/katana-logo.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://katana.network/assets/weth-logo.svg"},publicRpcUrl:"https://rpc.katana.network",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://explorer.katana.garden",eip1559:!0},bera:{id:80094,name:"Bera",shortname:"bera",native:{address:xt,symbol:"BERA",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/24647.png"},wToken:{symbol:"WBERA",address:"0x6969696969696969696969696969696969696969",decimals:18,logoUrl:"https://berascan.com/token/images/wrappedbera_ofc_64.png"},publicRpcUrl:"wss://rpc.berachain-apis.com",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://berascan.com",eip1559:!0},monad:{id:143,name:"Monad",shortname:"monad",native:{address:xt,symbol:"MONAD",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png"},wToken:{symbol:"WMON",address:"0x3bd359c1119da7da1d913d1c4d2b7c461115433a",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/70784/standard/wmon.png?1766028904"},publicRpcUrl:"https://monad-mainnet.drpc.org",logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png",explorer:"https://monad.network",eip1559:!0}};var ew=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ad=Math.ceil,yr=Math.floor,Kt="[BigNumber Error] ",$m=Kt+"Number primitive has more than 15 significant digits: ",Ur=1e14,we=14,od=9007199254740991,id=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Xn=1e7,St=1e9;function Gm(e){var t,r,n,s=w.prototype={constructor:w,toString:null,valueOf:null},a=new w(1),o=20,i=4,c=-7,l=21,u=-1e7,d=1e7,f=!1,m=1,b=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",v=!0;function w(h,y){var x,A,B,F,_,k,I,D,U=this;if(!(U instanceof w))return new w(h,y);if(y==null){if(h&&h._isBigNumber===!0){U.s=h.s,!h.c||h.e>d?U.c=U.e=null:h.e<u?U.c=[U.e=0]:(U.e=h.e,U.c=h.c.slice());return}if((k=typeof h=="number")&&h*0==0){if(U.s=1/h<0?(h=-h,-1):1,h===~~h){for(F=0,_=h;_>=10;_/=10,F++);F>d?U.c=U.e=null:(U.e=F,U.c=[h]);return}D=String(h)}else{if(!ew.test(D=String(h)))return n(U,D,k);U.s=D.charCodeAt(0)==45?(D=D.slice(1),-1):1}(F=D.indexOf("."))>-1&&(D=D.replace(".","")),(_=D.search(/e/i))>0?(F<0&&(F=_),F+=+D.slice(_+1),D=D.substring(0,_)):F<0&&(F=D.length)}else{if(ct(y,2,E.length,"Base"),y==10&&v)return U=new w(h),L(U,o+U.e+1,i);if(D=String(h),k=typeof h=="number"){if(h*0!=0)return n(U,D,k,y);if(U.s=1/h<0?(D=D.slice(1),-1):1,w.DEBUG&&D.replace(/^0\.0*|\./,"").length>15)throw Error($m+h)}else U.s=D.charCodeAt(0)===45?(D=D.slice(1),-1):1;for(x=E.slice(0,y),F=_=0,I=D.length;_<I;_++)if(x.indexOf(A=D.charAt(_))<0){if(A=="."){if(_>F){F=I;continue}}else if(!B&&(D==D.toUpperCase()&&(D=D.toLowerCase())||D==D.toLowerCase()&&(D=D.toUpperCase()))){B=!0,_=-1,F=0;continue}return n(U,String(h),k,y)}k=!1,D=r(D,y,10,U.s),(F=D.indexOf("."))>-1?D=D.replace(".",""):F=D.length}for(_=0;D.charCodeAt(_)===48;_++);for(I=D.length;D.charCodeAt(--I)===48;);if(D=D.slice(_,++I)){if(I-=_,k&&w.DEBUG&&I>15&&(h>od||h!==yr(h)))throw Error($m+U.s*h);if((F=F-_-1)>d)U.c=U.e=null;else if(F<u)U.c=[U.e=0];else{if(U.e=F,U.c=[],_=(F+1)%we,F<0&&(_+=we),_<I){for(_&&U.c.push(+D.slice(0,_)),I-=we;_<I;)U.c.push(+D.slice(_,_+=we));_=we-(D=D.slice(_)).length}else _-=I;for(;_--;D+="0");U.c.push(+D)}}else U.c=[U.e=0]}w.clone=Gm,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var y,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(y="DECIMAL_PLACES")&&(x=h[y],ct(x,0,St,y),o=x),h.hasOwnProperty(y="ROUNDING_MODE")&&(x=h[y],ct(x,0,8,y),i=x),h.hasOwnProperty(y="EXPONENTIAL_AT")&&(x=h[y],x&&x.pop?(ct(x[0],-St,0,y),ct(x[1],0,St,y),c=x[0],l=x[1]):(ct(x,-St,St,y),c=-(l=x<0?-x:x))),h.hasOwnProperty(y="RANGE"))if(x=h[y],x&&x.pop)ct(x[0],-St,-1,y),ct(x[1],1,St,y),u=x[0],d=x[1];else if(ct(x,-St,St,y),x)u=-(d=x<0?-x:x);else throw Error(Kt+y+" cannot be zero: "+x);if(h.hasOwnProperty(y="CRYPTO"))if(x=h[y],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=x;else throw f=!x,Error(Kt+"crypto unavailable");else f=x;else throw Error(Kt+y+" not true or false: "+x);if(h.hasOwnProperty(y="MODULO_MODE")&&(x=h[y],ct(x,0,9,y),m=x),h.hasOwnProperty(y="POW_PRECISION")&&(x=h[y],ct(x,0,St,y),b=x),h.hasOwnProperty(y="FORMAT"))if(x=h[y],typeof x=="object")g=x;else throw Error(Kt+y+" not an object: "+x);if(h.hasOwnProperty(y="ALPHABET"))if(x=h[y],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))v=x.slice(0,10)=="0123456789",E=x;else throw Error(Kt+y+" invalid: "+x)}else throw Error(Kt+"Object expected: "+h);return{DECIMAL_PLACES:o,ROUNDING_MODE:i,EXPONENTIAL_AT:[c,l],RANGE:[u,d],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:b,FORMAT:g,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var y,x,A=h.c,B=h.e,F=h.s;e:if({}.toString.call(A)=="[object Array]"){if((F===1||F===-1)&&B>=-St&&B<=St&&B===yr(B)){if(A[0]===0){if(B===0&&A.length===1)return!0;break e}if(y=(B+1)%we,y<1&&(y+=we),String(A[0]).length==y){for(y=0;y<A.length;y++)if(x=A[y],x<0||x>=Ur||x!==yr(x))break e;if(x!==0)return!0}}}else if(A===null&&B===null&&(F===null||F===1||F===-1))return!0;throw Error(Kt+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return T(arguments,-1)},w.minimum=w.min=function(){return T(arguments,1)},w.random=(function(){var h=9007199254740992,y=Math.random()*h&2097151?function(){return yr(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var A,B,F,_,k,I=0,D=[],U=new w(a);if(x==null?x=o:ct(x,0,St),_=ad(x/we),f)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(_*=2));I<_;)k=A[I]*131072+(A[I+1]>>>11),k>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),A[I]=B[0],A[I+1]=B[1]):(D.push(k%1e14),I+=2);I=_/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(_*=7);I<_;)k=(A[I]&31)*281474976710656+A[I+1]*1099511627776+A[I+2]*4294967296+A[I+3]*16777216+(A[I+4]<<16)+(A[I+5]<<8)+A[I+6],k>=9e15?crypto.randomBytes(7).copy(A,I):(D.push(k%1e14),I+=7);I=_/7}else throw f=!1,Error(Kt+"crypto unavailable");if(!f)for(;I<_;)k=y(),k<9e15&&(D[I++]=k%1e14);for(_=D[--I],x%=we,_&&x&&(k=id[we-x],D[I]=yr(_/k)*k);D[I]===0;D.pop(),I--);if(I<0)D=[F=0];else{for(F=-1;D[0]===0;D.splice(0,1),F-=we);for(I=1,k=D[0];k>=10;k/=10,I++);I<we&&(F-=we-I)}return U.e=F,U.c=D,U}})(),w.sum=function(){for(var h=1,y=arguments,x=new w(y[0]);h<y.length;)x=x.plus(y[h++]);return x},r=(function(){var h="0123456789";function y(x,A,B,F){for(var _,k=[0],I,D=0,U=x.length;D<U;){for(I=k.length;I--;k[I]*=A);for(k[0]+=F.indexOf(x.charAt(D++)),_=0;_<k.length;_++)k[_]>B-1&&(k[_+1]==null&&(k[_+1]=0),k[_+1]+=k[_]/B|0,k[_]%=B)}return k.reverse()}return function(x,A,B,F,_){var k,I,D,U,z,H,j,Q,pe=x.indexOf("."),be=o,ie=i;for(pe>=0&&(U=b,b=0,x=x.replace(".",""),Q=new w(A),H=Q.pow(x.length-pe),b=U,Q.c=y(wn(xr(H.c),H.e,"0"),10,B,h),Q.e=Q.c.length),j=y(x,A,B,_?(k=E,h):(k=h,E)),D=U=j.length;j[--U]==0;j.pop());if(!j[0])return k.charAt(0);if(pe<0?--D:(H.c=j,H.e=D,H.s=F,H=t(H,Q,be,ie,B),j=H.c,z=H.r,D=H.e),I=D+be+1,pe=j[I],U=B/2,z=z||I<0||j[I+1]!=null,z=ie<4?(pe!=null||z)&&(ie==0||ie==(H.s<0?3:2)):pe>U||pe==U&&(ie==4||z||ie==6&&j[I-1]&1||ie==(H.s<0?8:7)),I<1||!j[0])x=z?wn(k.charAt(1),-be,k.charAt(0)):k.charAt(0);else{if(j.length=I,z)for(--B;++j[--I]>B;)j[I]=0,I||(++D,j=[1].concat(j));for(U=j.length;!j[--U];);for(pe=0,x="";pe<=U;x+=k.charAt(j[pe++]));x=wn(x,D,k.charAt(0))}return x}})(),t=(function(){function h(A,B,F){var _,k,I,D,U=0,z=A.length,H=B%Xn,j=B/Xn|0;for(A=A.slice();z--;)I=A[z]%Xn,D=A[z]/Xn|0,_=j*I+D*H,k=H*I+_%Xn*Xn+U,U=(k/F|0)+(_/Xn|0)+j*D,A[z]=k%F;return U&&(A=[U].concat(A)),A}function y(A,B,F,_){var k,I;if(F!=_)I=F>_?1:-1;else for(k=I=0;k<F;k++)if(A[k]!=B[k]){I=A[k]>B[k]?1:-1;break}return I}function x(A,B,F,_){for(var k=0;F--;)A[F]-=k,k=A[F]<B[F]?1:0,A[F]=k*_+A[F]-B[F];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,B,F,_,k){var I,D,U,z,H,j,Q,pe,be,ie,de,Oe,X,ve,Me,je,it,Ae=A.s==B.s?1:-1,Ee=A.c,ye=B.c;if(!Ee||!Ee[0]||!ye||!ye[0])return new w(!A.s||!B.s||(Ee?ye&&Ee[0]==ye[0]:!ye)?NaN:Ee&&Ee[0]==0||!ye?Ae*0:Ae/0);for(pe=new w(Ae),be=pe.c=[],D=A.e-B.e,Ae=F+D+1,k||(k=Ur,D=gr(A.e/we)-gr(B.e/we),Ae=Ae/we|0),U=0;ye[U]==(Ee[U]||0);U++);if(ye[U]>(Ee[U]||0)&&D--,Ae<0)be.push(1),z=!0;else{for(ve=Ee.length,je=ye.length,U=0,Ae+=2,H=yr(k/(ye[0]+1)),H>1&&(ye=h(ye,H,k),Ee=h(Ee,H,k),je=ye.length,ve=Ee.length),X=je,ie=Ee.slice(0,je),de=ie.length;de<je;ie[de++]=0);it=ye.slice(),it=[0].concat(it),Me=ye[0],ye[1]>=k/2&&Me++;do{if(H=0,I=y(ye,ie,je,de),I<0){if(Oe=ie[0],je!=de&&(Oe=Oe*k+(ie[1]||0)),H=yr(Oe/Me),H>1)for(H>=k&&(H=k-1),j=h(ye,H,k),Q=j.length,de=ie.length;y(j,ie,Q,de)==1;)H--,x(j,je<Q?it:ye,Q,k),Q=j.length,I=1;else H==0&&(I=H=1),j=ye.slice(),Q=j.length;if(Q<de&&(j=[0].concat(j)),x(ie,j,de,k),de=ie.length,I==-1)for(;y(ye,ie,je,de)<1;)H++,x(ie,je<de?it:ye,de,k),de=ie.length}else I===0&&(H++,ie=[0]);be[U++]=H,ie[0]?ie[de++]=Ee[X]||0:(ie=[Ee[X]],de=1)}while((X++<ve||ie[0]!=null)&&Ae--);z=ie[0]!=null,be[0]||be.splice(0,1)}if(k==Ur){for(U=1,Ae=be[0];Ae>=10;Ae/=10,U++);L(pe,F+(pe.e=U+D*we-1)+1,_,z)}else pe.e=D,pe.r=+z;return pe}})();function S(h,y,x,A){var B,F,_,k,I;if(x==null?x=i:ct(x,0,8),!h.c)return h.toString();if(B=h.c[0],_=h.e,y==null)I=xr(h.c),I=A==1||A==2&&(_<=c||_>=l)?Dc(I,_):wn(I,_,"0");else if(h=L(new w(h),y,x),F=h.e,I=xr(h.c),k=I.length,A==1||A==2&&(y<=F||F<=c)){for(;k<y;I+="0",k++);I=Dc(I,F)}else if(y-=_+(A===2&&F>_),I=wn(I,F,"0"),F+1>k){if(--y>0)for(I+=".";y--;I+="0");}else if(y+=F-k,y>0)for(F+1==k&&(I+=".");y--;I+="0");return h.s<0&&B?"-"+I:I}function T(h,y){for(var x,A,B=1,F=new w(h[0]);B<h.length;B++)A=new w(h[B]),(!A.s||(x=Us(F,A))===y||x===0&&F.s===y)&&(F=A);return F}function O(h,y,x){for(var A=1,B=y.length;!y[--B];y.pop());for(B=y[0];B>=10;B/=10,A++);return(x=A+x*we-1)>d?h.c=h.e=null:x<u?h.c=[h.e=0]:(h.e=x,h.c=y),h}n=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,y=/^([^.]+)\.$/,x=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,_,k,I){var D,U=k?_:_.replace(B,"");if(A.test(U))F.s=isNaN(U)?null:U<0?-1:1;else{if(!k&&(U=U.replace(h,function(z,H,j){return D=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!I||I==D?H:z}),I&&(D=I,U=U.replace(y,"$1").replace(x,"0.$1")),_!=U))return new w(U,D);if(w.DEBUG)throw Error(Kt+"Not a"+(I?" base "+I:"")+" number: "+_);F.s=null}F.c=F.e=null}})();function L(h,y,x,A){var B,F,_,k,I,D,U,z=h.c,H=id;if(z){e:{for(B=1,k=z[0];k>=10;k/=10,B++);if(F=y-B,F<0)F+=we,_=y,I=z[D=0],U=yr(I/H[B-_-1]%10);else if(D=ad((F+1)/we),D>=z.length)if(A){for(;z.length<=D;z.push(0));I=U=0,B=1,F%=we,_=F-we+1}else break e;else{for(I=k=z[D],B=1;k>=10;k/=10,B++);F%=we,_=F-we+B,U=_<0?0:yr(I/H[B-_-1]%10)}if(A=A||y<0||z[D+1]!=null||(_<0?I:I%H[B-_-1]),A=x<4?(U||A)&&(x==0||x==(h.s<0?3:2)):U>5||U==5&&(x==4||A||x==6&&(F>0?_>0?I/H[B-_]:0:z[D-1])%10&1||x==(h.s<0?8:7)),y<1||!z[0])return z.length=0,A?(y-=h.e+1,z[0]=H[(we-y%we)%we],h.e=-y||0):z[0]=h.e=0,h;if(F==0?(z.length=D,k=1,D--):(z.length=D+1,k=H[we-F],z[D]=_>0?yr(I/H[B-_]%H[_])*k:0),A)for(;;)if(D==0){for(F=1,_=z[0];_>=10;_/=10,F++);for(_=z[0]+=k,k=1;_>=10;_/=10,k++);F!=k&&(h.e++,z[0]==Ur&&(z[0]=1));break}else{if(z[D]+=k,z[D]!=Ur)break;z[D--]=0,k=1}for(F=z.length;z[--F]===0;z.pop());}h.e>d?h.c=h.e=null:h.e<u&&(h.c=[h.e=0])}return h}function P(h){var y,x=h.e;return x===null?h.toString():(y=xr(h.c),y=x<=c||x>=l?Dc(y,x):wn(y,x,"0"),h.s<0?"-"+y:y)}return s.absoluteValue=s.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},s.comparedTo=function(h,y){return Us(this,new w(h,y))},s.decimalPlaces=s.dp=function(h,y){var x,A,B,F=this;if(h!=null)return ct(h,0,St),y==null?y=i:ct(y,0,8),L(new w(F),h+F.e+1,y);if(!(x=F.c))return null;if(A=((B=x.length-1)-gr(this.e/we))*we,B=x[B])for(;B%10==0;B/=10,A--);return A<0&&(A=0),A},s.dividedBy=s.div=function(h,y){return t(this,new w(h,y),o,i)},s.dividedToIntegerBy=s.idiv=function(h,y){return t(this,new w(h,y),0,1)},s.exponentiatedBy=s.pow=function(h,y){var x,A,B,F,_,k,I,D,U,z=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Kt+"Exponent not an integer: "+P(h));if(y!=null&&(y=new w(y)),k=h.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!h.c||!h.c[0])return U=new w(Math.pow(+P(z),k?h.s*(2-Uc(h)):+P(h))),y?U.mod(y):U;if(I=h.s<0,y){if(y.c?!y.c[0]:!y.s)return new w(NaN);A=!I&&z.isInteger()&&y.isInteger(),A&&(z=z.mod(y))}else{if(h.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||k&&z.c[1]>=24e7:z.c[0]<8e13||k&&z.c[0]<=9999975e7)))return F=z.s<0&&Uc(h)?-0:0,z.e>-1&&(F=1/F),new w(I?1/F:F);b&&(F=ad(b/we+2))}for(k?(x=new w(.5),I&&(h.s=1),D=Uc(h)):(B=Math.abs(+P(h)),D=B%2),U=new w(a);;){if(D){if(U=U.times(z),!U.c)break;F?U.c.length>F&&(U.c.length=F):A&&(U=U.mod(y))}if(B){if(B=yr(B/2),B===0)break;D=B%2}else if(h=h.times(x),L(h,h.e+1,1),h.e>14)D=Uc(h);else{if(B=+P(h),B===0)break;D=B%2}z=z.times(z),F?z.c&&z.c.length>F&&(z.c.length=F):A&&(z=z.mod(y))}return A?U:(I&&(U=a.div(U)),y?U.mod(y):F?L(U,b,i,_):U)},s.integerValue=function(h){var y=new w(this);return h==null?h=i:ct(h,0,8),L(y,y.e+1,h)},s.isEqualTo=s.eq=function(h,y){return Us(this,new w(h,y))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(h,y){return Us(this,new w(h,y))>0},s.isGreaterThanOrEqualTo=s.gte=function(h,y){return(y=Us(this,new w(h,y)))===1||y===0},s.isInteger=function(){return!!this.c&&gr(this.e/we)>this.c.length-2},s.isLessThan=s.lt=function(h,y){return Us(this,new w(h,y))<0},s.isLessThanOrEqualTo=s.lte=function(h,y){return(y=Us(this,new w(h,y)))===-1||y===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(h,y){var x,A,B,F,_=this,k=_.s;if(h=new w(h,y),y=h.s,!k||!y)return new w(NaN);if(k!=y)return h.s=-y,_.plus(h);var I=_.e/we,D=h.e/we,U=_.c,z=h.c;if(!I||!D){if(!U||!z)return U?(h.s=-y,h):new w(z?_:NaN);if(!U[0]||!z[0])return z[0]?(h.s=-y,h):new w(U[0]?_:i==3?-0:0)}if(I=gr(I),D=gr(D),U=U.slice(),k=I-D){for((F=k<0)?(k=-k,B=U):(D=I,B=z),B.reverse(),y=k;y--;B.push(0));B.reverse()}else for(A=(F=(k=U.length)<(y=z.length))?k:y,k=y=0;y<A;y++)if(U[y]!=z[y]){F=U[y]<z[y];break}if(F&&(B=U,U=z,z=B,h.s=-h.s),y=(A=z.length)-(x=U.length),y>0)for(;y--;U[x++]=0);for(y=Ur-1;A>k;){if(U[--A]<z[A]){for(x=A;x&&!U[--x];U[x]=y);--U[x],U[A]+=Ur}U[A]-=z[A]}for(;U[0]==0;U.splice(0,1),--D);return U[0]?O(h,U,D):(h.s=i==3?-1:1,h.c=[h.e=0],h)},s.modulo=s.mod=function(h,y){var x,A,B=this;return h=new w(h,y),!B.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||B.c&&!B.c[0]?new w(B):(m==9?(A=h.s,h.s=1,x=t(B,h,0,3),h.s=A,x.s*=A):x=t(B,h,0,m),h=B.minus(x.times(h)),!h.c[0]&&m==1&&(h.s=B.s),h)},s.multipliedBy=s.times=function(h,y){var x,A,B,F,_,k,I,D,U,z,H,j,Q,pe,be,ie=this,de=ie.c,Oe=(h=new w(h,y)).c;if(!de||!Oe||!de[0]||!Oe[0])return!ie.s||!h.s||de&&!de[0]&&!Oe||Oe&&!Oe[0]&&!de?h.c=h.e=h.s=null:(h.s*=ie.s,!de||!Oe?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(A=gr(ie.e/we)+gr(h.e/we),h.s*=ie.s,I=de.length,z=Oe.length,I<z&&(Q=de,de=Oe,Oe=Q,B=I,I=z,z=B),B=I+z,Q=[];B--;Q.push(0));for(pe=Ur,be=Xn,B=z;--B>=0;){for(x=0,H=Oe[B]%be,j=Oe[B]/be|0,_=I,F=B+_;F>B;)D=de[--_]%be,U=de[_]/be|0,k=j*D+U*H,D=H*D+k%be*be+Q[F]+x,x=(D/pe|0)+(k/be|0)+j*U,Q[F--]=D%pe;Q[F]=x}return x?++A:Q.splice(0,1),O(h,Q,A)},s.negated=function(){var h=new w(this);return h.s=-h.s||null,h},s.plus=function(h,y){var x,A=this,B=A.s;if(h=new w(h,y),y=h.s,!B||!y)return new w(NaN);if(B!=y)return h.s=-y,A.minus(h);var F=A.e/we,_=h.e/we,k=A.c,I=h.c;if(!F||!_){if(!k||!I)return new w(B/0);if(!k[0]||!I[0])return I[0]?h:new w(k[0]?A:B*0)}if(F=gr(F),_=gr(_),k=k.slice(),B=F-_){for(B>0?(_=F,x=I):(B=-B,x=k),x.reverse();B--;x.push(0));x.reverse()}for(B=k.length,y=I.length,B-y<0&&(x=I,I=k,k=x,y=B),B=0;y;)B=(k[--y]=k[y]+I[y]+B)/Ur|0,k[y]=Ur===k[y]?0:k[y]%Ur;return B&&(k=[B].concat(k),++_),O(h,k,_)},s.precision=s.sd=function(h,y){var x,A,B,F=this;if(h!=null&&h!==!!h)return ct(h,1,St),y==null?y=i:ct(y,0,8),L(new w(F),h,y);if(!(x=F.c))return null;if(B=x.length-1,A=B*we+1,B=x[B]){for(;B%10==0;B/=10,A--);for(B=x[0];B>=10;B/=10,A++);}return h&&F.e+1>A&&(A=F.e+1),A},s.shiftedBy=function(h){return ct(h,-od,od),this.times("1e"+h)},s.squareRoot=s.sqrt=function(){var h,y,x,A,B,F=this,_=F.c,k=F.s,I=F.e,D=o+4,U=new w("0.5");if(k!==1||!_||!_[0])return new w(!k||k<0&&(!_||_[0])?NaN:_?F:1/0);if(k=Math.sqrt(+P(F)),k==0||k==1/0?(y=xr(_),(y.length+I)%2==0&&(y+="0"),k=Math.sqrt(+y),I=gr((I+1)/2)-(I<0||I%2),k==1/0?y="5e"+I:(y=k.toExponential(),y=y.slice(0,y.indexOf("e")+1)+I),x=new w(y)):x=new w(k+""),x.c[0]){for(I=x.e,k=I+D,k<3&&(k=0);;)if(B=x,x=U.times(B.plus(t(F,B,D,1))),xr(B.c).slice(0,k)===(y=xr(x.c)).slice(0,k))if(x.e<I&&--k,y=y.slice(k-3,k+1),y=="9999"||!A&&y=="4999"){if(!A&&(L(B,B.e+o+2,0),B.times(B).eq(F))){x=B;break}D+=4,k+=4,A=1}else{(!+y||!+y.slice(1)&&y.charAt(0)=="5")&&(L(x,x.e+o+2,1),h=!x.times(x).eq(F));break}}return L(x,x.e+o+1,i,h)},s.toExponential=function(h,y){return h!=null&&(ct(h,0,St),h++),S(this,h,y,1)},s.toFixed=function(h,y){return h!=null&&(ct(h,0,St),h=h+this.e+1),S(this,h,y)},s.toFormat=function(h,y,x){var A,B=this;if(x==null)h!=null&&y&&typeof y=="object"?(x=y,y=null):h&&typeof h=="object"?(x=h,h=y=null):x=g;else if(typeof x!="object")throw Error(Kt+"Argument not an object: "+x);if(A=B.toFixed(h,y),B.c){var F,_=A.split("."),k=+x.groupSize,I=+x.secondaryGroupSize,D=x.groupSeparator||"",U=_[0],z=_[1],H=B.s<0,j=H?U.slice(1):U,Q=j.length;if(I&&(F=k,k=I,I=F,Q-=F),k>0&&Q>0){for(F=Q%k||k,U=j.substr(0,F);F<Q;F+=k)U+=D+j.substr(F,k);I>0&&(U+=D+j.slice(F)),H&&(U="-"+U)}A=z?U+(x.decimalSeparator||"")+((I=+x.fractionGroupSize)?z.replace(new RegExp("\\d{"+I+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):z):U}return(x.prefix||"")+A+(x.suffix||"")},s.toFraction=function(h){var y,x,A,B,F,_,k,I,D,U,z,H,j=this,Q=j.c;if(h!=null&&(k=new w(h),!k.isInteger()&&(k.c||k.s!==1)||k.lt(a)))throw Error(Kt+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+P(k));if(!Q)return new w(j);for(y=new w(a),D=x=new w(a),A=I=new w(a),H=xr(Q),F=y.e=H.length-j.e-1,y.c[0]=id[(_=F%we)<0?we+_:_],h=!h||k.comparedTo(y)>0?F>0?y:D:k,_=d,d=1/0,k=new w(H),I.c[0]=0;U=t(k,y,0,1),B=x.plus(U.times(A)),B.comparedTo(h)!=1;)x=A,A=B,D=I.plus(U.times(B=D)),I=B,y=k.minus(U.times(B=y)),k=B;return B=t(h.minus(x),A,0,1),I=I.plus(B.times(D)),x=x.plus(B.times(A)),I.s=D.s=j.s,F=F*2,z=t(D,A,F,i).minus(j).abs().comparedTo(t(I,x,F,i).minus(j).abs())<1?[D,A]:[I,x],d=_,z},s.toNumber=function(){return+P(this)},s.toPrecision=function(h,y){return h!=null&&ct(h,1,St),S(this,h,y,2)},s.toString=function(h){var y,x=this,A=x.s,B=x.e;return B===null?A?(y="Infinity",A<0&&(y="-"+y)):y="NaN":(h==null?y=B<=c||B>=l?Dc(xr(x.c),B):wn(xr(x.c),B,"0"):h===10&&v?(x=L(new w(x),o+B+1,i),y=wn(xr(x.c),x.e,"0")):(ct(h,2,E.length,"Base"),y=r(wn(xr(x.c),B,"0"),10,h,A,!0)),A<0&&x.c[0]&&(y="-"+y)),y},s.valueOf=s.toJSON=function(){return P(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&w.set(e),w}function gr(e){var t=e|0;return e>0||e===t?t:t-1}function xr(e){for(var t,r,n=1,s=e.length,a=e[0]+"";n<s;){for(t=e[n++]+"",r=we-t.length;r--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function Us(e,t){var r,n,s=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(r=s&&!s[0],n=a&&!a[0],r||n)return r?n?0:-i:o;if(o!=i)return o;if(r=o<0,n=c==l,!s||!a)return n?0:!s^r?1:-1;if(!n)return c>l^r?1:-1;for(i=(c=s.length)<(l=a.length)?c:l,o=0;o<i;o++)if(s[o]!=a[o])return s[o]>a[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function ct(e,t,r,n){if(e<t||e>r||e!==yr(e))throw Error(Kt+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Uc(e){var t=e.c.length-1;return gr(e.e/we)==t&&e.c[t]%2!=0}function Dc(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function wn(e,t,r){var n,s;if(t<0){for(s=r+".";++t;s+=r);e=s+e}else if(n=e.length,++t>n){for(s=r,t-=n;--t;s+=r);e+=s}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var G=Gm();const Sa=(e,t)=>{if(!e||!t)return"";const r=G(10).pow(e||0);return G(t).times(r).idiv(r).div(r).toFixed()};G(0),G(1),G(10),G(1e18);function Ds(e,t){return e==t||e.toLowerCase()==t.toLowerCase()}const _s=e=>!!Zm.find(t=>Ds(t,e||""));function tw(e){return[$t.Years,$t.Months,$t.Weeks,$t.Days,$t.Hours,$t.Minutes].find(r=>r<=e)||$t.Minutes}const Qn=e=>e?e.value*e.unit:0,rw=e=>!e||e==="NaN"?"0":G(e).decimalPlaces(0).toFixed(),Ms=e=>Object.values(Ft).find(t=>t.id===e),nw=e=>{if(!e)return;const t=e.map(a=>_t(a)),r=Object.entries(Xm).filter(([a])=>t.includes(a)).flatMap(([,a])=>a),n=e.map(a=>a.exchangeAddress),s=new Set([...n,...r].map(a=>a.toLowerCase()));return Array.from(s)},cd=(e,t)=>e.version===1?(e.fillDelay||0)*1e3+fh(t):(e.fillDelay||0)*1e3,zo=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),jm=e=>Ch().filter(t=>t.name===e).map(t=>t.chainId),ld=(e="",t="",r=18,n=18)=>{if(!G(e||0).gt(0)||!G(t||0).gt(0))return"";const s=Sa(r,e),a=Sa(n,t);return G(a).div(s).toFixed()},Vm=(e,t,r)=>{if(e.type===Re.TWAP_MARKET)return"";const n=Sa(t,e.srcAmountPerTrade),s=Sa(r,e.dstMinAmountPerTrade);return G(s).div(n).toFixed()},Wm=(e,t,r)=>{if(e.type===Re.TWAP_MARKET)return"";const n=Sa(t,e.srcAmountPerTrade),s=Sa(r,e.triggerPricePerTrade);return G(s).div(n).toFixed()},sw="https://order-sink-dev.orbs.network",aw="https://order-sink.orbs.network";let ud;const ow=e=>{ud=e},Ro=()=>{const e=zo("env");return e==="prod"?!1:e==="dev"?!0:ud==="prod"?!1:ud==="dev"},dd=()=>Ro()?sw:aw,iw=100,cw=1,_c=300*1e3,Pa=365*24*60*60*1e3,pd=300*1e3,qm=new Date(_c).getMinutes(),fd=e=>`https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`,Dr="https://hub.orbs.network/api/apikey/subgraphs/id",Km={[Ft.eth.id]:`${Dr}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,[Ft.bsc.id]:`${Dr}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,[Ft.poly.id]:`${Dr}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,[Ft.arb.id]:`${Dr}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,[Ft.base.id]:`${Dr}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,[Ft.sei.id]:`${Dr}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,[Ft.linea.id]:`${Dr}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,[Ft.sonic.id]:`${Dr}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,[Ft.ftm.id]:`${Dr}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,[Ft.katana.id]:`${Dr}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,[Ft.avax.id]:`${Dr}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,[Ft.bera.id]:fd("berachain"),[Ft.flare.id]:fd("flare"),[Ft.cronosZkEvm.id]:fd("cronos-zkevm")},Ym="0x0000000000000000000000000000000000000000",Zm=[Ym,"0x0000000000000000000000000000000000001010","0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0x000000000000000000000000000000000000dEaD","0x000000000000000000000000000000000000800A","0x000000000000000000000000000000000000800a"],Mc="115792089237316195423570985008687907853269984665640564039457584007913129639935",_t=e=>`${e.name}_${e.chainId}`,Xm={[_t(Pe.SushiArb)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Pe.SushiBase)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Pe.SushiEth)]:["0xc55943Fa6509004B2903ED8F8ab7347BfC47D0bA","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Pe.PancakeSwap)]:["0xb2BAFe188faD927240038cC4FfF2d771d8A58905","0xE2a0c3b9aD19A18c4bBa7fffBe5bC1b0E58Db1CE"],[_t(Pe.PancakeSwapArbitrum)]:["0xE20167871dB616DdfFD0Fd870d9bC068C350DD1F","0x807488ADAD033e95C438F998277bE654152594dc"],[_t(Pe.PancakeSwapBase)]:["0x10ed1F36e4eBE76E161c9AADDa20BE841bc0082c","0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Pe.PancakeSwapLinea)]:["0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Pe.QuickSwap)]:["0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF"],[_t(Pe.Thena)]:["0xc2aBC02acd77Bb2407efA22348dA9afC8B375290"],[_t(Pe.Lynex)]:["0x72e3e1fD5D2Ee2F1C2Eb695206D490a1D45C3835"],[_t(Pe.DragonSwap)]:["0x101e1B65Bb516FB5f4547C80BAe0b51f1b8D7a22"],[_t(Pe.SpookySwapSonic)]:["0xAd97B770ad64aE47fc7d64B3bD820dCDbF9ff7DA"],[_t(Pe.SpookySwap)]:["0x3924d62219483015f982b160d48c0fa5Fd436Cba"],[_t(Pe.SwapX)]:["0xE5012eBDe5e26EE3Ea41992154731a03023CF274"]},Nc={unit:$t.Minutes,value:qm},lw=.25,uw="100",md="RePermitWitnessTransferFrom",Qm={RePermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:"Order"}],Exchange:[{name:"adapter",type:"address"},{name:"ref",type:"address"},{name:"share",type:"uint32"},{name:"data",type:"bytes"}],Input:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"maxAmount",type:"uint256"}],Order:[{name:"reactor",type:"address"},{name:"executor",type:"address"},{name:"exchange",type:"Exchange"},{name:"swapper",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"chainid",type:"uint256"},{name:"exclusivity",type:"uint32"},{name:"epoch",type:"uint32"},{name:"slippage",type:"uint32"},{name:"freshness",type:"uint32"},{name:"input",type:"Input"},{name:"output",type:"Output"}],Output:[{name:"token",type:"address"},{name:"limit",type:"uint256"},{name:"stop",type:"uint256"},{name:"recipient",type:"address"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},Jm={RePermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:"Order"}],Exchange:[{name:"adapter",type:"address"},{name:"ref",type:"address"},{name:"share",type:"uint32"},{name:"data",type:"bytes"}],Input:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"maxAmount",type:"uint256"}],Order:[{name:"reactor",type:"address"},{name:"executor",type:"address"},{name:"exchange",type:"Exchange"},{name:"swapper",type:"address"},{name:"nonce",type:"uint256"},{name:"start",type:"uint256"},{name:"deadline",type:"uint256"},{name:"chainid",type:"uint256"},{name:"exclusivity",type:"uint32"},{name:"epoch",type:"uint32"},{name:"slippage",type:"uint32"},{name:"freshness",type:"uint32"},{name:"input",type:"Input"},{name:"output",type:"Output"}],Output:[{name:"token",type:"address"},{name:"limit",type:"uint256"},{name:"triggerLower",type:"uint256"},{name:"triggerUpper",type:"uint256"},{name:"recipient",type:"address"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},hd="https://www.orbs.com/dtwap-and-dlimit-faq/",dw="https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP",pw="https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg",fw="https://www.orbs.com/assets/img/common/logo.svg",mw="https://www.orbs.com/",hw="https://www.orbs.com/dtwap-dlimit-disclaimer";var Ia=(e=>(e.FRESHNESS="freshness",e.MIN_CHUNK_SIZE_USD="minChunkSizeUsd",e.ENV="env",e.DURATION="duration",e.IGNORE_ERRORS="ignore-errors",e))(Ia||{});const eh="-5",th="10",rh="-10",nh="5",bw="Something went wrong";function yw(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}function gw(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const xw={1:{dex:{sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},14:{dex:{spark:{type:"default:spark",adapter:"0xB18c633B6584A33E45a8840a759f56dF17117b1D",fee:"0xaeA8C3e1a129A77686E115b1a46D9aD8405F7D2b"}}},56:{dex:{thena:{type:"default:odos-v2",adapter:"0xB75218ba5A99bF57Fd02556B70F05A4A0f1Dbe67",fee:"0x15eBc8b5b3877512FFF23650188694A9a8891FAc"},pancake:{type:"p2:pancakeswap-v2",adapter:"0x654272F7e6e6E912D38650f783eFd44452fD6ee5",fee:"0x37A957f10F458e0d7fDECBE2917971b57F15c927"},newera:{type:"default:odos-v2",adapter:"0x845f459271D800f6Ab32D78400b8Aa18414E80b0",fee:"0x4E7454909eB6D539111D56b50d68897E933D2d11"}}},137:{dex:{quick:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"},teafi:{type:"paraswap:paraswap-v5",adapter:"0xe95db7a60164B112C64cE67bA8587b1d4a0E0D29",fee:"0x04Ff96e2c4D62b5771795d307AD679a25b3D2D50"}}},143:{dex:{yowie:{type:"default:openocean-v2",adapter:"0x18bc9533c3539073B9A9acF12b0AbF7cB73e0F1f",fee:"0x6AF3eE77A3A3257777F5649aFa611b4C7Fd975Ef"},pangolin:{type:"default:kyber-v2",adapter:"0xd7D9CAA2910f49F37AC3447f5cAd27153944354A",fee:"0xde92da99D188Ceb54A11ec711EF52D808A6260B5"}}},146:{dex:{spooky:{type:"default:magpie-v3",adapter:"0xdCee7FDdB932104329d528144Cd17A408722B7e2",fee:"0x840Df4684B35BC68BcdA3F6707A3c82A0D662f8b"},swapx:{type:"default:openocean-v2",adapter:"0xecc733D6F6f2DEa341832D650E30822118884FEb",fee:"0x6E03f7BC0f141894612AA017796096399623895F"},shadow:{type:"default:magpie-v3",adapter:"0x5f3E5F6ACCfc65243A01Da3E93b5A700285592C3",fee:"0xb9e3751fAF3187E1bC468E56a707a8A91754460e"}}},1329:{dex:{dragon:{type:"default:dragon",adapter:"0x02d9d5882129241b67ec21Ebc2C86e1BE9BC9890",fee:"0x0dc1E0525202b32e89bA78ed55b1e5cEdB751334"},nami:{type:"default:openocean-v2",adapter:"0x2D4A1237A98f8cb03C3C85960e859aA44036a306",fee:"0xeB58450e23632003f013568703F54446070E2E80"}}},8453:{dex:{quick:{type:"default:kyber-v2",adapter:"0xc73F03c929A123Ee2f3A98EC18BB240f03980AE5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"},sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},42161:{dex:{arbidex:{type:"default:odos-v2",adapter:"0xa734b32151108139e48dCA06eE721538d90A9Ef6",fee:"0xa0c11852f8A44e32F9EC10AD25986A53842f72Ca"},ramses:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xB5BaCB60ECDa0bEF809B2A26eC9B4B926835D7af"},omni:{type:"paraswap:paraswap-v5",adapter:"0xa1baE146161223cd9dCa7137F68eb385934130BE",fee:"0xba5291526c30B097E9F1Fd1Be301E2ab6E0782aa"},chronos:{type:"default:odos-v2",adapter:"0x4Ff90F32aceD08b3e3257B018EA495Fd1Bfe4455",fee:"0x5729af83240EFecAa18eafaAE82961c2DD045Dbe"},sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},43114:{dex:{blackhole:{type:"default:kyber-v2",adapter:"0x426ec4bc0d58B80959CDE77576a1942dd40592Fa",fee:"0x7f8B62520D9B5DA0ED517cc36e8dcb2a356f1928"},pangolin:{type:"default:kyber-v2",adapter:"0xd7D9CAA2910f49F37AC3447f5cAd27153944354A",fee:"0xde92da99D188Ceb54A11ec711EF52D808A6260B5"}}},59144:{dex:{lynex:{type:"default:openocean",adapter:"0x4FF6A97A67fe395212f168f011D71fE79E4396f2",fee:"0xcb36ed1B1BfAD8F7FC9651f52d21f04A68677423"}}},80094:{dex:{kodiak:{type:"default:kodiak",adapter:"0xBbaa527Aac00b1Ee9A3909D4D8c4447630E29B1F",fee:"0xBA47Ec15aFbCF6e7e9F52900632049530bB6bAe4"}}},747474:{dex:{sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},"*":{wm:"0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000",repermit:"0x00002a9C4D9497df5Bd31768eC5d30eEf5405000",cosigner:"0x0007ec53404c423C935e830ec21903e184690000",reactor:"0x0006a959430e8fBB858D81B2D1140B0ae5c26001",executor:"0x000eBA869d76C618ddc4A6D685A0820A620Ce002",refinery:"0x000E474c0D7084EAA35A501035E73269f4b009A5",salt:{wm:"0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152",repermit:"0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7",cosigner:"0x37576f2ac1d2a602f00777611edf6f0cbc27611b0980b29bc7856fa79b2b8073",reactor:"0x034169222370f2fd587ef8998082d762cceef58a272330215f5110ec0d76d400",executor:"0xea139bc421fa5e272bed3db74233b2e02077e0aacf8b855f87961e98f2fb467f",refinery:"0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec"}}};var bd,sh;function ww(){if(sh)return bd;sh=1;const e=xw,t=s=>gw(`./out/${s}.sol/${s}.json`).abi,r=()=>({wm:t("WM"),repermit:t("RePermit"),reactor:t("OrderReactor"),executor:t("Executor"),refinery:t("Refinery"),adapter:t("DefaultDexAdapter")});function n(s,a){if(!s||!(a!=null&&a.trim()))return;const{dex:o,...i}=e["*"]??{},c=e[s];if(!c)return;const{dex:l,...u}=c,d=l==null?void 0:l[a];if(d)return{...i,...u,...d}}return bd={config:n,abis:r,raw:e},bd}var ah=ww();const oh=(e,t,r)=>{if(!e||!t||!r)return;const n=G(e).times(t),s=G(10).pow(r);return n.div(s).toFixed(0)},ih=(e,t,r,n)=>{if(r||!n||!e||!t)return G(0).toString();const s=G(e).times(G(t)),a=G(10).pow(n),o=s.div(a);return G.max(1,o).integerValue(G.ROUND_FLOOR).toFixed(0)},ch=(e,t,r,n)=>{if(e===ge.TWAP||e===ge.LIMIT)return"0";if(!n||!t||!r)return;const s=G(t).times(G(r)),a=G(10).pow(n),o=s.div(a);return G.max(1,o).integerValue(G.ROUND_FLOOR).toFixed(0)||"0"},lh=(e,t,r,n)=>{const s=Qn(r)*2*t,a=zo(Ia.DURATION),o=tw(a?Number(a):s);return a?{unit:o,value:Number(G(Number(a)/o).toFixed(2))}:n||(e===ge.LIMIT?{unit:$t.Days,value:7}:e===ge.STOP_LOSS||e===ge.TAKE_PROFIT?{unit:$t.Days,value:1}:{unit:o,value:Number(G(s/o).toFixed(2))})},uh=(e,t,r)=>t!==ge.TWAP?1:r!==void 0?r:e,dh=(e,t,r,n)=>{if(!t||!r||!n)return 1;const a=G(r).times(t).div(n).integerValue(G.ROUND_FLOOR).toNumber(),o=Math.floor(Pa/2/Qn(e));return Math.max(1,Math.min(a,o))},ph=(e,t)=>e+Qn(t)+6e4,fh=e=>e.bidDelaySeconds*1e3*2,mh=(e="",t=0)=>!e||!t?"0":G(e).div(t).integerValue(G.ROUND_FLOOR).toFixed(0),vw=(e,t)=>({isError:!(e.unit===Nc.unit&&e.value===Nc.value)&&Qn(e)*t>Pa,value:Math.floor(Pa/t)}),hh=(e="",t="",r)=>{if(r===ge.STOP_LOSS)return{isError:G(t||0).gte(G(e||0)),value:e}},bh=(e="",t="",r)=>{if(r===ge.TAKE_PROFIT)return{isError:G(t||0).lte(G(e||0)),value:e}},yh=(e="",t="",r=!1,n)=>{if(!r&&n===ge.STOP_LOSS)return{isError:G(t||0).gte(G(e||0)),value:e}},gh=(e="",t="",r=!1,n)=>{if(!r&&n===ge.TAKE_PROFIT)return{isError:G(t||0).gte(G(e||0)),value:e}},xh=(e,t)=>e===ge.STOP_LOSS||e===ge.TAKE_PROFIT?{isError:Qn(t)>5184e6,value:5184e6}:{isError:Qn(t)>Pa,value:Pa},wh=e=>({isError:Qn(e)<pd,value:pd}),vh=e=>({isError:Qn(e)<_c,value:_c}),Eh=(e,t,r)=>({isError:G(t||0).multipliedBy(e||0).isLessThan(r),value:r}),kh=(e,t,r)=>({isError:r===ge.TWAP&&G(e).isGreaterThan(t),value:t}),Ew=(e,t)=>{if(e===Jr.Pancake)switch(t){case 56:return Pe.PancakeSwap;case 42161:return Pe.PancakeSwapArbitrum;case 8453:return Pe.PancakeSwapBase;case 59144:return Pe.PancakeSwapLinea;default:return Pe.PancakeSwap}if(e===Jr.Sushiswap)switch(t){case 1:return Pe.SushiEth;case 42161:return Pe.SushiArb;case 137:return Pe.SushiBase;case 747474:return Pe.SushiKatana;default:return Pe.SushiEth}if(e===Jr.Quick)switch(t){case 137:return Pe.QuickSwap;case 8453:return Pe.QuickSwapBase;default:return Pe.QuickSwap}if(e===Jr.Thena)switch(t){case 56:return Pe.Thena;default:return Pe.Thena}if(e===Jr.Spooky)switch(t){case 250:return Pe.SpookySwap;case 146:return Pe.SpookySwapSonic;default:return Pe.SpookySwap}if(e===Jr.Lynex)switch(t){case 59144:return Pe.Lynex;default:return Pe.Lynex}if(e===Jr.Swapx)switch(t){case 146:return Pe.SwapX;default:return Pe.SwapX}if(e===Jr.Blackhole)switch(t){case 43114:return Pe.BlackholeAvax;default:return Pe.BlackholeAvax}},yd=(e,t=0)=>{const{abi:r,...n}=ah.config(t,e);return{...n,partner:e,twapConfig:Ew(e,t)}},Ch=()=>{const e=ah.raw;return Object.entries(e).filter(([t])=>t!=="*").flatMap(([t,r])=>{const n=r==null?void 0:r.dex;return!n||typeof n!="object"?[]:Object.entries(n).map(([s])=>({chainId:Number(t),name:s,config:yd(s,Number(t))}))}).sort((t,r)=>t.name.localeCompare(r.name))},Th=e=>{const t=zo(Ia.MIN_CHUNK_SIZE_USD);return t?parseInt(t):e},Ah=({marketPrice:e,typedInputAmount:t,srcUsd1Token:r,marketPriceLoading:n,triggerPriceError:s,limitPriceError:a,tradesError:o,fillDelayError:i,durationError:c,balanceError:l,minTradeSizeError:u})=>{if(!zo(Ia.IGNORE_ERRORS)&&!(G(e||0).isZero()||G(t||0).isZero()||G(r||"0").isZero()||n))return u||s||a||o||i||c||l},Sh=(e,t)=>{const r=Date.now().toString(),n=parseInt((e/1e3).toFixed(0)),s=rw(t/1e3),a=zo(Ia.FRESHNESS),o=a?parseInt(a):60;return{nonce:r,epoch:n,deadline:s,freshness:o}},kw=({chainId:e,srcToken:t,dstToken:r,srcAmount:n,deadlineMillis:s,fillDelayMillis:a,slippage:o,account:i,srcAmountPerTrade:c,dstMinAmountPerTrade:l="0",triggerAmountPerTrade:u="0",config:d,module:f})=>{const{nonce:m,epoch:b,deadline:g,freshness:E}=Sh(a,s),v=f===ge.TAKE_PROFIT?Mc:u,w=f===ge.TAKE_PROFIT?u:l,S={permitted:{token:t,amount:n},spender:d.reactor,nonce:m,deadline:g,witness:{reactor:d.reactor,executor:d.executor,exchange:{adapter:d.adapter,ref:d.fee,share:0,data:"0x"},swapper:i,nonce:m,deadline:g,chainid:e,exclusivity:0,epoch:b,slippage:o,freshness:E,input:{token:t,amount:c,maxAmount:n},output:{token:r,limit:G(w||0).toFixed(),stop:G(v||0).toFixed(),recipient:i}}};return{domain:{name:"RePermit",version:"1",chainId:e,verifyingContract:d.repermit},order:S,types:Qm,primaryType:md}},Cw=({chainId:e,srcToken:t,dstToken:r,srcAmount:n,deadlineMillis:s,fillDelayMillis:a,slippage:o,account:i,srcAmountPerTrade:c,dstMinAmountPerTrade:l="0",triggerAmountPerTrade:u="0",config:d,module:f,feePercentage:m})=>{const{nonce:b,epoch:g,deadline:E,freshness:v}=Sh(a,s),w=Math.floor(Date.now()/1e3).toString(),S=l,T=m*100,O=f===ge.STOP_LOSS?u:"0",L=f===ge.TAKE_PROFIT?u:"0",P={permitted:{token:t,amount:n},spender:d.reactor,nonce:b,deadline:E,witness:{reactor:d.reactor,executor:d.executor,exchange:{adapter:d.adapter,ref:d.fee,share:T,data:"0x"},swapper:i,nonce:b,start:w,deadline:E,chainid:e,exclusivity:0,epoch:g,slippage:o,freshness:v,input:{token:t,amount:c,maxAmount:n},output:{token:r,limit:G(S||0).toFixed(),triggerLower:G(O||0).toFixed(),triggerUpper:G(L||0).toFixed(),recipient:i}}};return{domain:{name:"RePermit",version:"1",chainId:e,verifyingContract:d.repermit},order:P,types:Jm,primaryType:md}},Ph=e=>Ro()?Cw(e):kw(e),Tw={version:"1.10.0"},Aw=`https://bi.orbs.network/putes/twap-ui-${.7}`,Ih=Tw.version;let gd="unknown";function Bh(e){gd=e}function xd(){const e=Math.random().toString(36).substring(2,16),t=Math.random().toString(36).substring(2,16),r=Date.now().toString(36);return`id_${e+t+r}`}const Sw=(e,t,r)=>{var n,s,a,o,i,c,l,u,d;return{spotVersion:Ih,partner:e.partner,adapter:e.adapter,cosigner:e.cosigner,executor:e.executor,fee:e.fee,reactor:e.reactor,refinery:e.refinery,repermit:e.repermit,router:e.router,type:e.type,wm:e.wm,chainName:((n=e.twapConfig)==null?void 0:n.chainName)||"",chainId:r||0,twapVersion:((s=e.twapConfig)==null?void 0:s.twapVersion)||0,twapAddress:((a=e.twapConfig)==null?void 0:a.twapAddress)||"",lensAddress:((o=e.twapConfig)==null?void 0:o.lensAddress)||"",bidDelaySeconds:((i=e.twapConfig)==null?void 0:i.bidDelaySeconds)||0,minChunkSizeUsd:t,name:((c=e.twapConfig)==null?void 0:c.name)||"",exchangeAddress:((l=e.twapConfig)==null?void 0:l.exchangeAddress)||"",exchangeType:((u=e.twapConfig)==null?void 0:u.exchangeType)||"",pathfinderKey:((d=e.twapConfig)==null?void 0:d.pathfinderKey)||""}},Fh=async e=>{try{await fetch(Aw,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then()}catch(t){console.error("Failed to send BI",t)}};class Pw{constructor(){td(this,"timeout");td(this,"config");td(this,"data",{_id:xd()})}async updateAndSend(t={},r=!1,n){try{this.data={...this.data,...t},r?(await Fh(this.data),n==null||n()):(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{Fh(this.data),n==null||n()},1e3))}catch(s){console.error("Failed to update and send BI",s)}}onCancelOrderRequest(t,r){this.updateAndSend({cancelOrderIdsV1:r===1?t:void 0,cancelOrderIdsV2:r===2?t:void 0,action:"cancel order",cancelOrderSuccess:!1,cancelOrderTxHash:void 0,actionError:void 0})}onCancelOrderSuccess(t){this.updateAndSend({cancelOrderTxHash:t,cancelOrderSuccess:!0})}onCancelOrderError(t){this.onTxError(t)}onWrapSuccess(t){this.updateAndSend({wrapTxHash:t})}onWrapRequest(){this.updateAndSend({action:"wrap"})}onWrapError(t){this.onTxError(t)}onApproveRequest(){this.updateAndSend({action:"approve"})}onApproveSuccess(t){this.updateAndSend({approvalTxHash:t})}onApproveError(t){this.onTxError(t)}onCrash(t){var r;this.updateAndSend({action:"crash",actionError:((r=t==null?void 0:t.message)==null?void 0:r.toLowerCase())||(t==null?void 0:t.toLowerCase())})}onTxError(t){var n;const r=((n=t==null?void 0:t.message)==null?void 0:n.toLowerCase())||(t==null?void 0:t.toLowerCase());this.updateAndSend({actionError:r})}onRequestOrder({account:t,chainId:r,module:n,srcToken:s,dstToken:a,fromTokenAmount:o,srcChunkAmount:i,minDstAmountOutPerTrade:c="",triggerPricePerTrade:l="",deadline:u,fillDelay:d,slippage:f,isMarketOrder:m,chunksAmount:b}){this.updateAndSend({toTokenAddress:a.address,toTokenSymbol:a.symbol,fromTokenAddress:s.address,fromTokenSymbol:s.symbol,fromTokenAmount:o,chunksAmount:b,srcChunkAmount:i,minDstAmountOutPerTrade:c,triggerPricePerTrade:l,deadline:u,fillDelay:d,slippage:f,chainId:r,walletAddress:t,module:n,orderType:m?"market":"limit",actionError:void 0})}onSignOrderRequest(t){this.updateAndSend({action:"sign order",order:t})}onSignOrderError(t){this.onTxError(t)}onSignOrderSuccess(t){this.updateAndSend({action:"sign order",signature:t})}init(t,r,n){var s;this.config=t,n!==((s=this.data)==null?void 0:s.chainId)&&(this.data={_id:xd(),action:"module-import",uiVersion:gd,...Sw(t,r,n),origin:window.location.origin},this.updateAndSend(this.data))}onCreateOrderError(t){this.onTxError(t)}onCreateOrderRequest(){this.updateAndSend({action:"create order"})}async onCreateOrderSuccess(t){this.updateAndSend({orderHash:t,orderSuccess:!0},void 0,()=>{this.data={_id:xd(),action:"reset",uiVersion:gd,origin:this.data.origin,spotVersion:Ih,partner:this.data.partner,adapter:this.data.adapter,cosigner:this.data.cosigner,executor:this.data.executor,fee:this.data.fee,reactor:this.data.reactor,refinery:this.data.refinery,repermit:this.data.repermit,router:this.data.router,type:this.data.type,wm:this.data.wm,chainName:this.data.chainName||"",chainId:this.data.chainId||0,twapVersion:this.data.twapVersion||0,twapAddress:this.data.twapAddress||"",lensAddress:this.data.lensAddress||"",bidDelaySeconds:this.data.bidDelaySeconds||0,minChunkSizeUsd:this.data.minChunkSizeUsd||0,name:this.data.name||"",exchangeAddress:this.data.exchangeAddress||"",exchangeType:this.data.exchangeType||"",pathfinderKey:this.data.pathfinderKey||""}})}onLoad(){this.updateAndSend({action:"module-import",origin:window.location.origin})}}const dt=new Pw,Iw=e=>{var i;const t=G(e.order.witness.output.limit||0).gt(1),r=e.order.witness.output.stop,n=e.order.witness.output.triggerUpper,s=G(r||0).eq(Mc)||G(n||0).gt(0),a=G(r||0).gt(0),o=((i=e.metadata.chunks)==null?void 0:i.length)||G(e.order.witness.input.maxAmount).div(G(e.order.witness.input.amount)).toNumber();return s?Re.TAKE_PROFIT:a?t?Re.STOP_LOSS_LIMIT:Re.STOP_LOSS_MARKET:t?o>1&&t?Re.TWAP_LIMIT:t?Re.LIMIT:Re.TWAP_MARKET:Re.TWAP_MARKET},Bw=e=>{var s;const t=((s=e.metadata.chunks)==null?void 0:s.filter(a=>a.status==="success").length)||0,r=e.metadata.expectedChunks||0,n=G(t).dividedBy(r).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},Fw=(e,t)=>e.metadata.status==="completed"||t>=99?ut.Completed:["pending","eligible"].includes(e.metadata.status)?ut.Open:e.metadata.description.toLowerCase()==="cancelled by contract"?ut.Cancelled:ut.Expired,Ow=e=>{var r;return(((r=e.metadata.chunks)==null?void 0:r.filter(n=>n.status==="success"))||[]).map(n=>({inAmount:n.inAmount,outAmount:n.outAmount,timestamp:new Date(n.timestamp).getTime(),txHash:n.txHash}))},Uw=(e,t)=>{var n;const r=e.length;return r>=t&&((n=e[r-1])==null?void 0:n.timestamp)||0},Dw=e=>G(e.metadata.displayOnlyInputTokenPriceUSD).dividedBy(1e18).toFixed(),wd=e=>Number(e.order.witness.output.limit)===1?"":e.order.witness.output.limit,_w=e=>{const{triggerLower:t="0",triggerUpper:r="0"}=e.order.witness.output,n=wd(e),s=e.metadata.expectedChunks||1,a=G(r||0).gt(0);return{dstMinAmountPerTrade:n,triggerPricePerTrade:a?r:t,dstMinAmountTotal:G(n).multipliedBy(s).toFixed()}},Mw=e=>{const t=wd(e),r=G(e.order.witness.output.stop||0).eq(Mc),n=e.metadata.expectedChunks||1;return{dstMinAmountPerTrade:r?"":t,triggerPricePerTrade:r?t:G(e.order.witness.output.stop||"").toFixed(),dstMinAmountTotal:r?"":G(t).multipliedBy(n).toFixed()}},Nw=e=>Ro()?_w(e):Mw(e),vd=e=>{const t=Bw(e),r=wd(e),n=e.metadata.expectedChunks||1,s=Ow(e);return{id:e.hash,hash:e.hash,version:2,type:Iw(e),maker:e.order.witness.swapper,progress:t,srcAmountFilled:s.reduce((a,o)=>a.plus(o.inAmount),new G(0)).toFixed()||"",dstAmountFilled:s.reduce((a,o)=>a.plus(o.outAmount),new G(0)).toFixed()||"",fills:s,srcTokenAddress:e.order.witness.input.token,dstTokenAddress:e.order.witness.output.token,orderDollarValueIn:Dw(e),fillDelay:e.order.witness.epoch*1e3,deadline:Number(e.order.deadline)*1e3,createdAt:new Date(e.timestamp).getTime(),srcAmount:e.order.witness.input.maxAmount,srcAmountPerTrade:e.order.witness.input.amount,totalTradesAmount:n,isMarketPrice:G(r||0).lte(1),chainId:e.order.witness.chainid,filledOrderTimestamp:Uw(s,n),status:Fw(e,t),rawOrder:e,...Nw(e)}},Lw=async({chainId:e,signal:t,account:r,exchange:n})=>{try{if(!r)return[];const s=n?`&exchange=${n}`:"";return(await(await fetch(`${dd()}/orders?swapper=${r}&chainId=${e}${s}`,{signal:t})).json()).orders.map(vd)}catch{return[]}},Oh=async(e,t)=>{try{const r={signature:t,order:e,status:"pending"};dt.onCreateOrderRequest();const n=await fetch(`${dd()}/orders/new`,{method:"POST",body:JSON.stringify(r)}),s=await n.json().catch(()=>({}));if(!n.ok||!(s!=null&&s.success)){const o=(s==null?void 0:s.message)??n.statusText??"Request failed",i=(s==null?void 0:s.code)??n.status;throw new Error(`error:${o}, code:${i}`)}const a=vd(s.signedOrder);return dt.onCreateOrderSuccess(a.id),a}catch(r){throw dt.onCreateOrderError(r),console.error(r),r}},vn=(e,t)=>e&&e.length?e.map(t||(r=>`${r}`)):void 0,zw=e=>{if(e)return Km[e]},Ed=async({chainId:e,buildQuery:t,extractResults:r,signal:n,retries:s=1,limit:a=1e3,page:o})=>{const i=zw(e);if(!i)throw new Vw;const c=async d=>{let f=0;for(;f<=s;)try{const m=await fetch(i,{method:"POST",body:JSON.stringify({query:d}),signal:n,headers:{"Content-Type":"application/json"}});if(!m.ok)throw new Error(`HTTP error: ${m.status}`);const b=await m.json();if(b.errors)throw new Error(b.errors[0].message);return r(b)}catch(m){if(f===s)throw m;await new Promise(b=>setTimeout(b,500*2**f)),f++}return[]};let l=0;const u=[];if(o!==void 0){const d=t(o,a);try{return await c(d)}catch{console.warn(`Page ${o} failed, retrying one final time...`);try{return await c(d)}catch{return[]}}}for(;;){const d=t(l,a);let f;try{f=await c(d)}catch{console.warn(`Page ${l} failed, retrying one final time...`);try{f=await c(d)}catch{return u}}if(u.push(...f),f.length<a)break;l++}return u},Uh=e=>e.map(t=>({inAmount:t.srcAmountIn,outAmount:t.dstAmountOut,timestamp:t.timestamp,txHash:t.transactionHash})),Dh=(e,t)=>{const r=G(e||0).gt(1);return!r&&t===1?Re.TWAP_MARKET:t>1&&r?Re.TWAP_LIMIT:r?Re.LIMIT:Re.TWAP_MARKET},Rw=(e,t,r,n)=>{var f;const s=Uh(r||[]),a=new G(e.ask_srcAmount||0).div(e.ask_srcBidAmount).integerValue(G.ROUND_FLOOR).toNumber(),i=(r==null?void 0:r.length)===a?(f=r==null?void 0:r[(r==null?void 0:r.length)-1])==null?void 0:f.timestamp:void 0,c=s.reduce((m,b)=>m.plus(b.inAmount),new G(0)).toFixed(),l=s.reduce((m,b)=>m.plus(b.outAmount),new G(0)).toFixed(),u=_h(e.ask_srcAmount,c),d=Dh(e.ask_dstMinAmount,a);return{version:1,id:e.Contract_id.toString(),hash:"",type:Dh(e.ask_dstMinAmount,a),srcTokenAddress:e.ask_srcToken,dstTokenAddress:e.ask_dstToken,exchangeAddress:e.exchange,twapAddress:e.twapAddress,maker:e.maker,progress:u,dstAmountFilled:l,srcAmountFilled:c,orderDollarValueIn:G(e.dollarValueIn||0).toFixed(6),srcAmount:e.ask_srcAmount,dstMinAmountTotal:G(e.ask_dstMinAmount).multipliedBy(a).toString(),fills:s,fillDelay:e.ask_fillDelay,deadline:e.ask_deadline*1e3,createdAt:new Date(e.timestamp).getTime(),dstMinAmountPerTrade:G(e.ask_dstMinAmount).eq(1)?"":e.ask_dstMinAmount,triggerPricePerTrade:"",srcAmountPerTrade:e.ask_srcBidAmount,txHash:e.transactionHash,totalTradesAmount:a,isMarketPrice:[Re.TWAP_MARKET].includes(d),chainId:t,filledOrderTimestamp:i||0,status:n,rawOrder:e}},Hw=e=>{var d;if(!e)return"";const t=vn(e.accounts,f=>`"${f.toLowerCase()}"`),r=vn(nw(e.configs),f=>`"${f.toLowerCase()}"`),n=vn(e.inTokenSymbols,f=>`"${f.toUpperCase()}"`),s=vn(e.outTokenSymbols,f=>`"${f.toUpperCase()}"`),a=vn(e.inTokenAddresses,f=>`"${f.toLowerCase()}"`),o=vn(e.outTokenAddresses,f=>`"${f.toLowerCase()}"`),i=vn(e.transactionHashes,f=>`"${f.toLowerCase()}"`),c=vn(e.orderIds,f=>`"${f}"`),l=r!=null&&r.length?"":vn((d=e.configs)==null?void 0:d.map(f=>f.twapAddress),f=>`"${f.toLowerCase()}"`),u=e.minDollarValueIn;return[r?`exchange_in: [${r.join(", ")}]`:"",l?`twapAddress_in: [${l.join(", ")}]`:"",t?`maker_in: [${t.join(", ")}]`:"",i?`transactionHash_in: [${i.join(", ")}]`:"",c?`Contract_id_in: [${c.join(", ")}]`:"",u?`dollarValueIn_gte: ${u}`:"",n?`srcTokenSymbol_in: [${n.join(", ")}]`:"",s?`dstTokenSymbol_in: [${s.join(", ")}]`:"",a?`srcTokenAddress_in: [${a.join(", ")}]`:"",o?`dstTokenAddress_in: [${o.join(", ")}]`:"",e!=null&&e.startDate?`blockTimestamp_gte: ${e.startDate}`:"",e!=null&&e.endDate?`blockTimestamp_lte: ${e.endDate}`:"",(e==null?void 0:e.orderType)==="limit"?"ask_dstMinAmount_gt: 1":"",(e==null?void 0:e.orderType)==="market"?"ask_dstMinAmount_lte: 1":""].filter(Boolean).join(", ")};async function $w({chainId:e,signal:t,page:r,limit:n,filters:s}){const a=n||1e3,o=Hw(s);return await Ed({chainId:e,signal:t,limit:a,page:r,buildQuery:(c,l)=>`
1
+ (function(R,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],C):(R=typeof globalThis<"u"?globalThis:R||self,C(R.SpotReact={},R.jsxRuntime,R.React,R.ReactDOM))})(this,(function(R,C,M,Os){"use strict";var sq=Object.defineProperty;var q5=R=>{throw TypeError(R)};var aq=(R,C,M)=>C in R?sq(R,C,{enumerable:!0,configurable:!0,writable:!0,value:M}):R[C]=M;var td=(R,C,M)=>aq(R,typeof C!="symbol"?C+"":C,M),Pm=(R,C,M)=>C.has(R)||q5("Cannot "+M);var N=(R,C,M)=>(Pm(R,C,"read from private field"),M?M.call(R):C.get(R)),le=(R,C,M)=>C.has(R)?q5("Cannot add the same private member more than once"):C instanceof WeakSet?C.add(R):C.set(R,M),J=(R,C,M,Os)=>(Pm(R,C,"write to private field"),Os?Os.call(R,M):C.set(R,M),M),Se=(R,C,M)=>(Pm(R,C,"access private method"),M);var rd=(R,C,M,Os)=>({set _(sd){J(R,C,sd,M)},get _(){return N(R,C,Os)}});var bn,ba,B5,ya,ks,Ao,F5,So,Cs,Po,O5,ga,U5,xa,Io,Fr,wa,Bt,Sc,va,Xr,Zn,D5,nr,_e,Pc,Wt,Ea,Bo,Vn,Ts,Ic,Fo,Oo,ka,Ca,As,Uo,We,Oc,Im,Bm,Fm,Om,Um,Dm,_m,K5,_5,Bc,yn,qt,Ta,gn,Fs,M5,Wn,Qr,Fc,N5,qn,Ss,sr,Kn,Yn,nd,Mm,L5,xn,z5,mt,Ps,Is,Do,_o,Bs,Mo,No,R5;function sd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Et=sd(M),Pe={SpookySwap:{chainName:"ftm",chainId:250,twapVersion:4,twapAddress:"0xd3B290FEB04E353d1821bc0a12397FdEa9a846C0",lensAddress:"0x0221EfDF1Fd3212AF87F23cceB7693a65fAF1d7f",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwap",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0xdF7CCd5fc7077E9de5f27a7b7bfDC837c82f8496",exchangeType:"ExchangeV2",pathfinderKey:""},SpookySwapSonic:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SpookySwapSonic",partner:"Orbs:TWAP:SpookySwap",exchangeAddress:"0x6699bE3aF75e5c1B807b1031dBde6dA9A67739F3",exchangeType:"ExchangeV2",pathfinderKey:""},QuickSwap:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:"QuickSwap,QuickSwapV3"},QuickSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"QuickSwap",partner:"Orbs:TWAP:QuickSwap",exchangeAddress:"0xb7a3d74895bfd3aff6780525e36d79fcf26a895f",exchangeType:"ExchangeV2",pathfinderKey:""},Chronos:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Chronos",partner:"Orbs:TWAP:Chronos",exchangeAddress:"0x0178e50adAF3b925F27aC518FCd952CE7F9A3B36",exchangeType:"ExchangeV2",pathfinderKey:"Chronos Stable,Chronos Volatile,Chronos V3"},BaseSwap:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BaseSwap",partner:"Orbs:TWAP:BaseSwap",exchangeAddress:"0xAca3155c17530C4aA96746F226fcC049658490d2",exchangeType:"ExchangeV2",pathfinderKey:"BaseSwap,BaseSwapX"},Arbidex:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Arbidex",partner:"Orbs:TWAP:Arbidex",exchangeAddress:"0x49d21052f4695d16C7cce6eF561301Aa4d840420",exchangeType:"ExchangeV2",pathfinderKey:"Arbidex Classic,Arbidex Quantum"},Thena:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Thena",partner:"Orbs:TWAP:Thena",exchangeAddress:"0x2B2fABDbfa4a15da0d351F947C14F4520db0bDc1",exchangeType:"ExchangeV2",pathfinderKey:"43,47"},PancakeSwap:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0x1A2bb6B75D58b740d88413ef4840D6fa3F637940",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapArbitrum:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},PancakeSwapLinea:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"PancakeSwap",partner:"Orbs:TWAP:PancakeSwap",exchangeAddress:"0xb37cB9A058c03081Ae6EF934313588cD53d408e7",exchangeType:"P2Exchange",pathfinderKey:""},Lynex:{chainName:"linea",chainId:59144,twapVersion:4,twapAddress:"0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78",lensAddress:"0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"Lynex",partner:"Orbs:TWAP:Lynex",exchangeAddress:"0x04C06C96d7D19977156016DD408B5992af0570a2",exchangeType:"ExchangeV2",pathfinderKey:"19,18"},SyncSwap:{chainName:"zkSync",chainId:324,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:100,name:"SyncSwap",partner:"Orbs:TWAP:SyncSwap",exchangeAddress:"0x422623a40c42f026Ed33A9910078Aa843FD66e27",exchangeType:"ExchangeV2",pathfinderKey:"2,3"},Retro:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Retro",partner:"Orbs:TWAP:Retro",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2",pathfinderKey:"retro,retro-v3"},SushiArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiArb",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiBase",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiEth:{chainName:"eth",chainId:1,twapVersion:4,twapAddress:"0xb1ed8BCAD1EaC8a1DF0764700472391800D12946",lensAddress:"0x0967f448c4d4dbd14c355E635AE9CbF68cc44A60",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:200,name:"SushiEth",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad",exchangeType:"ExchangeV2",pathfinderKey:""},SushiKatana:{chainName:"katana",chainId:747474,twapVersion:4,twapAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",lensAddress:"0x1579EED0527781B1A748043AA1f59a3858Ace4a7",takers:["0xF74437A3Fc45a518640828E5D6A3E8c9A9BbDC3a","0x07A6C715063e94c0D95e809efefFCbF4EBEdfD55"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"SushiKatana",partner:"Orbs:TWAP:Sushi",exchangeAddress:"0x92209481507e6B2d14C9b5b70Ed287024177220E",exchangeType:"ExchangeV2",pathfinderKey:""},DragonSwap:{chainName:"sei",chainId:1329,twapVersion:4,twapAddress:"0xde737dB24548F8d41A4a3Ca2Bac8aaaDc4DBA099",lensAddress:"0xa1376f2Bb80D3cF6c2D8ebEf34b3d122e9af4020",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"DragonSwap",partner:"Orbs:TWAP:DragonSwap",exchangeAddress:"0xf2F933FafbDB97062CfA3c447ff373e76A90Efd6",exchangeType:"ExchangeV2",pathfinderKey:""},TeaFi:{chainName:"poly",chainId:137,twapVersion:4,twapAddress:"0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4",lensAddress:"0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"TeaFi",partner:"Orbs:TWAP:TeaFi",exchangeAddress:"0xE9D3b4Cf5B0CC392e78C1a4DD9885D449EEF9793",exchangeType:"ParaswapExchange",pathfinderKey:"AaveV2,AaveV3,AaveV3Stata,AngleStakedStableEUR,AngleStakedStableUSD,ApeSwap,AugustusRFQ,BalancerV2,ComethSwap,CurveV1,CurveV1Factory,CurveV1StableNg,CurveV2,Dfyn,DODOV2,Dystopia,Hashflow,IronV2,JarvisV6,KyberDmm,QuickSwap,QuickSwapV3,Retro,SushiSwap,SushiSwapV3,SwaapV2,Synapse,UniswapV2,UniswapV3,WaultFinance,Wmatic,WooFiV2,wUSDM"},SparkDEX:{chainName:"flare",chainId:14,twapVersion:4,twapAddress:"0x9D70B0b90915Bb8b9bdAC7e6a7e6435bBF1feC4D",lensAddress:"0xf2d96E7BE676153d202e1453804E2749923C7c5b",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SparkDEX",partner:"Orbs:TWAP:SparkDEX",exchangeAddress:"0xe59c53C76bB7EEc01401A18fA8215B94bC65Bf56",exchangeType:"P2Exchange"},Ramses:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"Ramses",partner:"Orbs:TWAP:Ramses",exchangeAddress:"0x8FCc245209bE85C49D738D0CE5613F74E5d91E86",exchangeType:"ParaswapExchange",pathfinderKey:""},SwapX:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"SwapX",partner:"Orbs:TWAP:SwapX",exchangeAddress:"0xDA902994b7F7a1ecDd8De02E4a17dbFF2E6F67b7",exchangeType:"ExchangeV2",pathfinderKey:""},H2Finance:{chainName:"cronos-zkevm",chainId:388,twapVersion:4,twapAddress:"0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68",lensAddress:"0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9",takers:["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC","0xBE452F03Be354CAC397C3F0c8397672067D44531"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"H2Finance",partner:"Orbs:TWAP:H2Finance",exchangeAddress:"0x2f1f10dc311722Be609e6B427bF3FBac6e44093B",exchangeType:"ExchangeV2"},Shadow:{chainName:"sonic",chainId:146,twapVersion:4,twapAddress:"0x8963992816b4EafE5a22b7DB2A99513c18be9afA",lensAddress:"0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D",takers:["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913","0x504f6E10173249dD22491829D98862Cf81DeF79E"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Shadow",partner:"Orbs:TWAP:Shadow",exchangeAddress:"0x69e3c891450161b7BF27f181eE85E7bAE69E5b07",exchangeType:"ExchangeV2"},Kodiak:{chainName:"berachain",chainId:80094,twapVersion:4,twapAddress:"0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E",lensAddress:"0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"Kodiak",partner:"Orbs:TWAP:Kodiak",exchangeAddress:"0x69B7aE1250B8d1309954CaD65b6607ae478Ec6eE",exchangeType:"ExchangeV2"},OmniBase:{chainName:"base",chainId:8453,twapVersion:4,twapAddress:"0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55",lensAddress:"0x6313188c1909b161074D62E43105faC9B756A23e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:10,name:"OmniBase",partner:"Orbs:TWAP:OmniBase",exchangeAddress:"0x54435FcFDF3A08150Ed799b6EF472A20a432303F",exchangeType:"ParaswapExchange"},OmniArb:{chainName:"arb",chainId:42161,twapVersion:4,twapAddress:"0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3",lensAddress:"0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"OmniArb",partner:"Orbs:TWAP:OmniArb",exchangeAddress:"0xF0607785424d342Cceb33E708f4579CA97a3b392",exchangeType:"ParaswapExchange"},BlackholeAvax:{chainName:"avax",chainId:43114,twapVersion:4,twapAddress:"0xf77Ad005aBF7e31f669ce89a6568B2f39Ca92cDe",lensAddress:"0x48466B82Ce1575c5c9eCa168ac1090048dD47fA3",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"BlackholeAvax",partner:"Orbs:TWAP:BlackholeAvax",exchangeAddress:"0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F",exchangeType:"ExchangeV2"},NewEraBnb:{chainName:"bsc",chainId:56,twapVersion:4,twapAddress:"0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994",lensAddress:"0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264",takers:["0xA05405b6340A7F43dC5835351BFC4f5b1F028359","0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"],bidDelaySeconds:60,minChunkSizeUsd:50,name:"NewEraBnb",partner:"Orbs:TWAP:NewEraBnb",exchangeAddress:"0xA22D7Df24d9Ea4D4EF6dC96b2204bd550430eC42",exchangeType:"ExchangeV2"}},Y5=[{constant:!1,inputs:[{name:"wad",type:"uint256"}],name:"withdraw",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[],name:"deposit",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"dst",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"src",type:"address"},{indexed:!1,name:"wad",type:"uint256"}],name:"Withdrawal",type:"event"}],Z5=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",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:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],X5=JSON.parse('[{"inputs":[{"internalType":"address","name":"_iweth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"name":"OrderBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"OrderCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"}],"name":"OrderCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstAmountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"srcFilledAmount","type":"uint256"}],"name":"OrderFilled","type":"event"},{"inputs":[],"name":"MIN_BID_DELAY_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_OUTBID_PERCENT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_BASE","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALE_BID_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_CANCELED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_COMPLETED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"_ask","type":"tuple"}],"name":"ask","outputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"bid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"book","outputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"fill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"iweth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"makerOrders","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"order","outputs":[{"components":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"internalType":"struct OrderLib.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"orderIdsByMaker","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"prune","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"status","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]'),Q5=[{type:"constructor",inputs:[],stateMutability:"nonpayable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"cancel",inputs:[{name:"digests",type:"bytes32[]",internalType:"bytes32[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"hashTypedData",inputs:[{name:"structHash",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"digest",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"repermitWitnessTransferFrom",inputs:[{name:"permit",type:"tuple",internalType:"struct RePermitLib.RePermitTransferFrom",components:[{name:"permitted",type:"tuple",internalType:"struct RePermitLib.TokenPermissions",components:[{name:"token",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"}]},{name:"request",type:"tuple",internalType:"struct RePermitLib.TransferRequest",components:[{name:"to",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{name:"signer",type:"address",internalType:"address"},{name:"witness",type:"bytes32",internalType:"bytes32"},{name:"witnessTypeString",type:"string",internalType:"string"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"spent",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"event",name:"Cancel",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"digest",type:"bytes32",indexed:!1,internalType:"bytes32"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"Spend",inputs:[{name:"signer",type:"address",indexed:!0,internalType:"address"},{name:"permitHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"totalSpent",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"Canceled",inputs:[]},{type:"error",name:"Expired",inputs:[]},{type:"error",name:"InsufficientAllowance",inputs:[]},{type:"error",name:"InvalidShortString",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"StringTooLong",inputs:[{name:"str",type:"string",internalType:"string"}]}],zm=Y5,J5=Z5,Rm=Q5,Hm=X5;var ge=(e=>(e.TWAP="TWAP",e.LIMIT="LIMIT",e.STOP_LOSS="STOP_LOSS",e.TAKE_PROFIT="TAKE_PROFIT",e))(ge||{}),ut=(e=>(e.Open="OPEN",e.Cancelled="CANCELLED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(ut||{}),ar=(e=>(e.All="ALL",e.Open="OPEN",e.Cancelled="CANCELLED",e.Completed="COMPLETED",e.Expired="EXPIRED",e))(ar||{}),$t=(e=>(e[e.Minutes=6e4]="Minutes",e[e.Hours=36e5]="Hours",e[e.Weeks=6048e5]="Weeks",e[e.Days=864e5]="Days",e[e.Months=2592e6]="Months",e[e.Years=31536e6]="Years",e))($t||{}),Re=(e=>(e.LIMIT="limit",e.TWAP_LIMIT="twap-limit",e.TWAP_MARKET="twap-market",e.TAKE_PROFIT="take-profit",e.STOP_LOSS_LIMIT="stop-loss-limit",e.STOP_LOSS_MARKET="stop-loss-market",e))(Re||{}),Jr=(e=>(e.Arbidex="arbidex",e.Blackhole="blackhole",e.Chronos="chronos",e.Dragon="dragon",e.Kodiak="kodiak",e.Lynex="lynex",e.Nami="nami",e.Newera="newera",e.Omni="omni",e.Pancake="pancake",e.Quick="quick",e.Ramses="ramses",e.Shadow="shadow",e.Spark="spark",e.Spooky="spooky",e.Swapx="swapx",e.Teafi="teafi",e.Thena="thena",e.Yowie="yowie",e.Pangolin="pangolin",e.Sushiswap="sushiswap",e.Agent="agent",e))(Jr||{}),Dt=(e=>(e[e.EMPTY_LIMIT_PRICE=0]="EMPTY_LIMIT_PRICE",e[e.MAX_CHUNKS=1]="MAX_CHUNKS",e[e.MIN_CHUNKS=2]="MIN_CHUNKS",e[e.MIN_TRADE_SIZE=3]="MIN_TRADE_SIZE",e[e.MAX_FILL_DELAY=4]="MAX_FILL_DELAY",e[e.MIN_FILL_DELAY=5]="MIN_FILL_DELAY",e[e.MAX_ORDER_DURATION=6]="MAX_ORDER_DURATION",e[e.MIN_ORDER_DURATION=7]="MIN_ORDER_DURATION",e[e.MISSING_LIMIT_PRICE=8]="MISSING_LIMIT_PRICE",e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE=9]="STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE",e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE=10]="TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE",e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE=11]="TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE",e[e.EMPTY_TRIGGER_PRICE=12]="EMPTY_TRIGGER_PRICE",e[e.INSUFFICIENT_BALANCE=13]="INSUFFICIENT_BALANCE",e[e.MAX_ORDER_SIZE=14]="MAX_ORDER_SIZE",e[e.MIN_TRADE_SIZE_ERROR=15]="MIN_TRADE_SIZE_ERROR",e))(Dt||{});const xt="0x0000000000000000000000000000000000000000",Ft={eth:{id:1,name:"Ethereum",shortname:"eth",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://eth.llamarpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://etherscan.io",eip1559:!0},bsc:{id:56,name:"BinanceSmartChain",shortname:"bsc",native:{address:xt,symbol:"BNB",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},wToken:{symbol:"WBNB",address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"},publicRpcUrl:"https://bsc-dataseed.binance.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/bsc_2.svg",explorer:"https://bscscan.com",eip1559:!1},poly:{id:137,name:"Polygon",shortname:"poly",native:{address:xt,symbol:"POL",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png"},wToken:{symbol:"WPOL",address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270.png"},publicRpcUrl:"https://polygon-rpc.com",logoUrl:"https://app.1inch.io/assets/images/network-logos/polygon.svg",explorer:"https://polygonscan.com",eip1559:!0},arb:{id:42161,name:"Arbitrum",shortname:"arb",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://arb1.arbitrum.io/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/arbitrum.svg",explorer:"https://arbiscan.io",eip1559:!0},sei:{id:1329,name:"Sei",shortname:"sei",native:{address:xt,symbol:"SEI",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png"},wToken:{symbol:"WSEI",address:"0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://evm-rpc.sei-apis.com",logoUrl:"https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png",explorer:"https://seitrace.com",eip1559:!1},avax:{id:43114,name:"Avalanche",shortname:"avax",native:{address:xt,symbol:"AVAX",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg"},wToken:{symbol:"WAVAX",address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7.png"},publicRpcUrl:"https://api.avax.network/ext/bc/C/rpc",logoUrl:"https://app.1inch.io/assets/images/network-logos/avalanche.svg",explorer:"https://snowtrace.io",eip1559:!0},ftm:{id:250,name:"Fantom",shortname:"ftm",native:{address:xt,symbol:"FTM",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg"},wToken:{symbol:"WFTM",address:"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0x4e15361fd6b4bb609fa63c81a2be19d873717870.png"},publicRpcUrl:"https://rpc.ftm.tools",logoUrl:"https://app.1inch.io/assets/images/network-logos/fantom.svg",explorer:"https://ftmscan.com",eip1559:!0},base:{id:8453,name:"Base",shortname:"base",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.base.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/base.svg",explorer:"https://basescan.org",eip1559:!1},linea:{id:59144,name:"Linea",shortname:"linea",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.linea.build",logoUrl:"https://lineascan.build/images/logo.svg",explorer:"https://lineascan.build",eip1559:!1},zksync:{id:324,name:"zksync",shortname:"zksync",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://mainnet.era.zksync.io",logoUrl:"https://raw.githubusercontent.com/matter-labs/zksync/0a4ca2145a0c95b5bafa84c2f095c644907a8825/zkSyncLogo.svg",explorer:"https://explorer.zksync.io/",eip1559:!0},zkevm:{id:1101,name:"zkevm",shortname:"zkevm",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zkevm-rpc.com",logoUrl:"https://user-images.githubusercontent.com/18598517/235932702-bc47eae5-d672-4dd9-9da2-8ea8f51a93f3.png",explorer:"https://zkevm.polygonscan.com/",eip1559:!0},manta:{id:169,name:"manta",shortname:"manta",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg"},wToken:{symbol:"WETH",address:"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://pacific-rpc.manta.network/http",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_manta.jpg",explorer:"https://manta.socialscan.io/",eip1559:!0},blast:{id:81457,name:"blast",shortname:"blast",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast"},wToken:{symbol:"WETH",address:"0x4300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://rpc.ankr.com/blast",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_blast",explorer:"https://blastscan.io/",eip1559:!0},sonic:{id:146,name:"sonic",shortname:"sonic",native:{address:xt,symbol:"S",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},wToken:{symbol:"WS",address:"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic"},publicRpcUrl:"https://rpc.soniclabs.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_sonic",explorer:"https://www.sonicscan.org/",eip1559:!0},scroll:{id:534352,name:"scroll",shortname:"scroll",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll"},wToken:{symbol:"WETH",address:"0x5300000000000000000000000000000000000004",decimals:18,logoUrl:"https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://scroll-rpc.publicnode.com",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_scroll",explorer:"https://scrollscan.com/",eip1559:!0},zircuit:{id:48900,name:"Zircuit",shortname:"zircuit",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg"},wToken:{symbol:"WETH",address:"0x4200000000000000000000000000000000000006",decimals:18,logoUrl:"hhttps://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"},publicRpcUrl:"https://zircuit-mainnet.drpc.org",logoUrl:"https://app.1inch.io/assets/images/network-logos/ethereum.svg",explorer:"https://explorer.zircuit.com/",eip1559:!0},flare:{id:14,name:"flare",shortname:"flare",native:{address:xt,symbol:"FLR",decimals:18,logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48"},wToken:{symbol:"WFLR",address:"0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d",decimals:18,logoUrl:"https://res.cloudinary.com/sparkdex/image/upload/q_100/v1/website-assets/coins/wflr?_a=DATAg1AAZAA0"},publicRpcUrl:"https://flare.network",logoUrl:"https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48",explorer:"https://flarescan.com",eip1559:!0},cronosZkEvm:{id:388,name:"Cronos zkEVM",shortname:"cronosZkEvm",native:{address:"0x000000000000000000000000000000000000800a",symbol:"zkCRO",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},wToken:{symbol:"wzkCRO",address:"0xC1bF55EE54E16229d9b369a5502Bfe5fC9F20b6d",decimals:18,logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png"},publicRpcUrl:"https://rpc.zkevm.cronos.org",logoUrl:"https://cryptologos.cc/logos/cronos-cro-logo.png",explorer:"https://explorer.zkevm.cronos.org",eip1559:!0},katana:{id:747474,name:"Katana",shortname:"katana",native:{address:xt,symbol:"ETH",decimals:18,logoUrl:"https://katana.network/assets/katana-logo.svg"},wToken:{symbol:"WETH",address:"0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62",decimals:18,logoUrl:"https://katana.network/assets/weth-logo.svg"},publicRpcUrl:"https://rpc.katana.network",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://explorer.katana.garden",eip1559:!0},bera:{id:80094,name:"Bera",shortname:"bera",native:{address:xt,symbol:"BERA",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/24647.png"},wToken:{symbol:"WBERA",address:"0x6969696969696969696969696969696969696969",decimals:18,logoUrl:"https://berascan.com/token/images/wrappedbera_ofc_64.png"},publicRpcUrl:"wss://rpc.berachain-apis.com",logoUrl:"https://katana.network/assets/katana-logo.svg",explorer:"https://berascan.com",eip1559:!0},monad:{id:143,name:"Monad",shortname:"monad",native:{address:xt,symbol:"MONAD",decimals:18,logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png"},wToken:{symbol:"WMON",address:"0x3bd359c1119da7da1d913d1c4d2b7c461115433a",decimals:18,logoUrl:"https://assets.coingecko.com/coins/images/70784/standard/wmon.png?1766028904"},publicRpcUrl:"https://monad-mainnet.drpc.org",logoUrl:"https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png",explorer:"https://monad.network",eip1559:!0}};var ew=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ad=Math.ceil,yr=Math.floor,Kt="[BigNumber Error] ",$m=Kt+"Number primitive has more than 15 significant digits: ",Ur=1e14,we=14,od=9007199254740991,id=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Xn=1e7,St=1e9;function Gm(e){var t,r,n,s=w.prototype={constructor:w,toString:null,valueOf:null},a=new w(1),o=20,i=4,c=-7,l=21,u=-1e7,d=1e7,f=!1,m=1,b=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",v=!0;function w(h,y){var x,A,B,F,_,k,I,D,U=this;if(!(U instanceof w))return new w(h,y);if(y==null){if(h&&h._isBigNumber===!0){U.s=h.s,!h.c||h.e>d?U.c=U.e=null:h.e<u?U.c=[U.e=0]:(U.e=h.e,U.c=h.c.slice());return}if((k=typeof h=="number")&&h*0==0){if(U.s=1/h<0?(h=-h,-1):1,h===~~h){for(F=0,_=h;_>=10;_/=10,F++);F>d?U.c=U.e=null:(U.e=F,U.c=[h]);return}D=String(h)}else{if(!ew.test(D=String(h)))return n(U,D,k);U.s=D.charCodeAt(0)==45?(D=D.slice(1),-1):1}(F=D.indexOf("."))>-1&&(D=D.replace(".","")),(_=D.search(/e/i))>0?(F<0&&(F=_),F+=+D.slice(_+1),D=D.substring(0,_)):F<0&&(F=D.length)}else{if(ct(y,2,E.length,"Base"),y==10&&v)return U=new w(h),L(U,o+U.e+1,i);if(D=String(h),k=typeof h=="number"){if(h*0!=0)return n(U,D,k,y);if(U.s=1/h<0?(D=D.slice(1),-1):1,w.DEBUG&&D.replace(/^0\.0*|\./,"").length>15)throw Error($m+h)}else U.s=D.charCodeAt(0)===45?(D=D.slice(1),-1):1;for(x=E.slice(0,y),F=_=0,I=D.length;_<I;_++)if(x.indexOf(A=D.charAt(_))<0){if(A=="."){if(_>F){F=I;continue}}else if(!B&&(D==D.toUpperCase()&&(D=D.toLowerCase())||D==D.toLowerCase()&&(D=D.toUpperCase()))){B=!0,_=-1,F=0;continue}return n(U,String(h),k,y)}k=!1,D=r(D,y,10,U.s),(F=D.indexOf("."))>-1?D=D.replace(".",""):F=D.length}for(_=0;D.charCodeAt(_)===48;_++);for(I=D.length;D.charCodeAt(--I)===48;);if(D=D.slice(_,++I)){if(I-=_,k&&w.DEBUG&&I>15&&(h>od||h!==yr(h)))throw Error($m+U.s*h);if((F=F-_-1)>d)U.c=U.e=null;else if(F<u)U.c=[U.e=0];else{if(U.e=F,U.c=[],_=(F+1)%we,F<0&&(_+=we),_<I){for(_&&U.c.push(+D.slice(0,_)),I-=we;_<I;)U.c.push(+D.slice(_,_+=we));_=we-(D=D.slice(_)).length}else _-=I;for(;_--;D+="0");U.c.push(+D)}}else U.c=[U.e=0]}w.clone=Gm,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(h){var y,x;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(y="DECIMAL_PLACES")&&(x=h[y],ct(x,0,St,y),o=x),h.hasOwnProperty(y="ROUNDING_MODE")&&(x=h[y],ct(x,0,8,y),i=x),h.hasOwnProperty(y="EXPONENTIAL_AT")&&(x=h[y],x&&x.pop?(ct(x[0],-St,0,y),ct(x[1],0,St,y),c=x[0],l=x[1]):(ct(x,-St,St,y),c=-(l=x<0?-x:x))),h.hasOwnProperty(y="RANGE"))if(x=h[y],x&&x.pop)ct(x[0],-St,-1,y),ct(x[1],1,St,y),u=x[0],d=x[1];else if(ct(x,-St,St,y),x)u=-(d=x<0?-x:x);else throw Error(Kt+y+" cannot be zero: "+x);if(h.hasOwnProperty(y="CRYPTO"))if(x=h[y],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=x;else throw f=!x,Error(Kt+"crypto unavailable");else f=x;else throw Error(Kt+y+" not true or false: "+x);if(h.hasOwnProperty(y="MODULO_MODE")&&(x=h[y],ct(x,0,9,y),m=x),h.hasOwnProperty(y="POW_PRECISION")&&(x=h[y],ct(x,0,St,y),b=x),h.hasOwnProperty(y="FORMAT"))if(x=h[y],typeof x=="object")g=x;else throw Error(Kt+y+" not an object: "+x);if(h.hasOwnProperty(y="ALPHABET"))if(x=h[y],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))v=x.slice(0,10)=="0123456789",E=x;else throw Error(Kt+y+" invalid: "+x)}else throw Error(Kt+"Object expected: "+h);return{DECIMAL_PLACES:o,ROUNDING_MODE:i,EXPONENTIAL_AT:[c,l],RANGE:[u,d],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:b,FORMAT:g,ALPHABET:E}},w.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var y,x,A=h.c,B=h.e,F=h.s;e:if({}.toString.call(A)=="[object Array]"){if((F===1||F===-1)&&B>=-St&&B<=St&&B===yr(B)){if(A[0]===0){if(B===0&&A.length===1)return!0;break e}if(y=(B+1)%we,y<1&&(y+=we),String(A[0]).length==y){for(y=0;y<A.length;y++)if(x=A[y],x<0||x>=Ur||x!==yr(x))break e;if(x!==0)return!0}}}else if(A===null&&B===null&&(F===null||F===1||F===-1))return!0;throw Error(Kt+"Invalid BigNumber: "+h)},w.maximum=w.max=function(){return T(arguments,-1)},w.minimum=w.min=function(){return T(arguments,1)},w.random=(function(){var h=9007199254740992,y=Math.random()*h&2097151?function(){return yr(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var A,B,F,_,k,I=0,D=[],U=new w(a);if(x==null?x=o:ct(x,0,St),_=ad(x/we),f)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(_*=2));I<_;)k=A[I]*131072+(A[I+1]>>>11),k>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),A[I]=B[0],A[I+1]=B[1]):(D.push(k%1e14),I+=2);I=_/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(_*=7);I<_;)k=(A[I]&31)*281474976710656+A[I+1]*1099511627776+A[I+2]*4294967296+A[I+3]*16777216+(A[I+4]<<16)+(A[I+5]<<8)+A[I+6],k>=9e15?crypto.randomBytes(7).copy(A,I):(D.push(k%1e14),I+=7);I=_/7}else throw f=!1,Error(Kt+"crypto unavailable");if(!f)for(;I<_;)k=y(),k<9e15&&(D[I++]=k%1e14);for(_=D[--I],x%=we,_&&x&&(k=id[we-x],D[I]=yr(_/k)*k);D[I]===0;D.pop(),I--);if(I<0)D=[F=0];else{for(F=-1;D[0]===0;D.splice(0,1),F-=we);for(I=1,k=D[0];k>=10;k/=10,I++);I<we&&(F-=we-I)}return U.e=F,U.c=D,U}})(),w.sum=function(){for(var h=1,y=arguments,x=new w(y[0]);h<y.length;)x=x.plus(y[h++]);return x},r=(function(){var h="0123456789";function y(x,A,B,F){for(var _,k=[0],I,D=0,U=x.length;D<U;){for(I=k.length;I--;k[I]*=A);for(k[0]+=F.indexOf(x.charAt(D++)),_=0;_<k.length;_++)k[_]>B-1&&(k[_+1]==null&&(k[_+1]=0),k[_+1]+=k[_]/B|0,k[_]%=B)}return k.reverse()}return function(x,A,B,F,_){var k,I,D,U,z,H,j,Q,pe=x.indexOf("."),be=o,ie=i;for(pe>=0&&(U=b,b=0,x=x.replace(".",""),Q=new w(A),H=Q.pow(x.length-pe),b=U,Q.c=y(wn(xr(H.c),H.e,"0"),10,B,h),Q.e=Q.c.length),j=y(x,A,B,_?(k=E,h):(k=h,E)),D=U=j.length;j[--U]==0;j.pop());if(!j[0])return k.charAt(0);if(pe<0?--D:(H.c=j,H.e=D,H.s=F,H=t(H,Q,be,ie,B),j=H.c,z=H.r,D=H.e),I=D+be+1,pe=j[I],U=B/2,z=z||I<0||j[I+1]!=null,z=ie<4?(pe!=null||z)&&(ie==0||ie==(H.s<0?3:2)):pe>U||pe==U&&(ie==4||z||ie==6&&j[I-1]&1||ie==(H.s<0?8:7)),I<1||!j[0])x=z?wn(k.charAt(1),-be,k.charAt(0)):k.charAt(0);else{if(j.length=I,z)for(--B;++j[--I]>B;)j[I]=0,I||(++D,j=[1].concat(j));for(U=j.length;!j[--U];);for(pe=0,x="";pe<=U;x+=k.charAt(j[pe++]));x=wn(x,D,k.charAt(0))}return x}})(),t=(function(){function h(A,B,F){var _,k,I,D,U=0,z=A.length,H=B%Xn,j=B/Xn|0;for(A=A.slice();z--;)I=A[z]%Xn,D=A[z]/Xn|0,_=j*I+D*H,k=H*I+_%Xn*Xn+U,U=(k/F|0)+(_/Xn|0)+j*D,A[z]=k%F;return U&&(A=[U].concat(A)),A}function y(A,B,F,_){var k,I;if(F!=_)I=F>_?1:-1;else for(k=I=0;k<F;k++)if(A[k]!=B[k]){I=A[k]>B[k]?1:-1;break}return I}function x(A,B,F,_){for(var k=0;F--;)A[F]-=k,k=A[F]<B[F]?1:0,A[F]=k*_+A[F]-B[F];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,B,F,_,k){var I,D,U,z,H,j,Q,pe,be,ie,de,Oe,X,ve,Me,je,it,Ae=A.s==B.s?1:-1,Ee=A.c,ye=B.c;if(!Ee||!Ee[0]||!ye||!ye[0])return new w(!A.s||!B.s||(Ee?ye&&Ee[0]==ye[0]:!ye)?NaN:Ee&&Ee[0]==0||!ye?Ae*0:Ae/0);for(pe=new w(Ae),be=pe.c=[],D=A.e-B.e,Ae=F+D+1,k||(k=Ur,D=gr(A.e/we)-gr(B.e/we),Ae=Ae/we|0),U=0;ye[U]==(Ee[U]||0);U++);if(ye[U]>(Ee[U]||0)&&D--,Ae<0)be.push(1),z=!0;else{for(ve=Ee.length,je=ye.length,U=0,Ae+=2,H=yr(k/(ye[0]+1)),H>1&&(ye=h(ye,H,k),Ee=h(Ee,H,k),je=ye.length,ve=Ee.length),X=je,ie=Ee.slice(0,je),de=ie.length;de<je;ie[de++]=0);it=ye.slice(),it=[0].concat(it),Me=ye[0],ye[1]>=k/2&&Me++;do{if(H=0,I=y(ye,ie,je,de),I<0){if(Oe=ie[0],je!=de&&(Oe=Oe*k+(ie[1]||0)),H=yr(Oe/Me),H>1)for(H>=k&&(H=k-1),j=h(ye,H,k),Q=j.length,de=ie.length;y(j,ie,Q,de)==1;)H--,x(j,je<Q?it:ye,Q,k),Q=j.length,I=1;else H==0&&(I=H=1),j=ye.slice(),Q=j.length;if(Q<de&&(j=[0].concat(j)),x(ie,j,de,k),de=ie.length,I==-1)for(;y(ye,ie,je,de)<1;)H++,x(ie,je<de?it:ye,de,k),de=ie.length}else I===0&&(H++,ie=[0]);be[U++]=H,ie[0]?ie[de++]=Ee[X]||0:(ie=[Ee[X]],de=1)}while((X++<ve||ie[0]!=null)&&Ae--);z=ie[0]!=null,be[0]||be.splice(0,1)}if(k==Ur){for(U=1,Ae=be[0];Ae>=10;Ae/=10,U++);L(pe,F+(pe.e=U+D*we-1)+1,_,z)}else pe.e=D,pe.r=+z;return pe}})();function S(h,y,x,A){var B,F,_,k,I;if(x==null?x=i:ct(x,0,8),!h.c)return h.toString();if(B=h.c[0],_=h.e,y==null)I=xr(h.c),I=A==1||A==2&&(_<=c||_>=l)?Dc(I,_):wn(I,_,"0");else if(h=L(new w(h),y,x),F=h.e,I=xr(h.c),k=I.length,A==1||A==2&&(y<=F||F<=c)){for(;k<y;I+="0",k++);I=Dc(I,F)}else if(y-=_+(A===2&&F>_),I=wn(I,F,"0"),F+1>k){if(--y>0)for(I+=".";y--;I+="0");}else if(y+=F-k,y>0)for(F+1==k&&(I+=".");y--;I+="0");return h.s<0&&B?"-"+I:I}function T(h,y){for(var x,A,B=1,F=new w(h[0]);B<h.length;B++)A=new w(h[B]),(!A.s||(x=Us(F,A))===y||x===0&&F.s===y)&&(F=A);return F}function O(h,y,x){for(var A=1,B=y.length;!y[--B];y.pop());for(B=y[0];B>=10;B/=10,A++);return(x=A+x*we-1)>d?h.c=h.e=null:x<u?h.c=[h.e=0]:(h.e=x,h.c=y),h}n=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,y=/^([^.]+)\.$/,x=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,_,k,I){var D,U=k?_:_.replace(B,"");if(A.test(U))F.s=isNaN(U)?null:U<0?-1:1;else{if(!k&&(U=U.replace(h,function(z,H,j){return D=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!I||I==D?H:z}),I&&(D=I,U=U.replace(y,"$1").replace(x,"0.$1")),_!=U))return new w(U,D);if(w.DEBUG)throw Error(Kt+"Not a"+(I?" base "+I:"")+" number: "+_);F.s=null}F.c=F.e=null}})();function L(h,y,x,A){var B,F,_,k,I,D,U,z=h.c,H=id;if(z){e:{for(B=1,k=z[0];k>=10;k/=10,B++);if(F=y-B,F<0)F+=we,_=y,I=z[D=0],U=yr(I/H[B-_-1]%10);else if(D=ad((F+1)/we),D>=z.length)if(A){for(;z.length<=D;z.push(0));I=U=0,B=1,F%=we,_=F-we+1}else break e;else{for(I=k=z[D],B=1;k>=10;k/=10,B++);F%=we,_=F-we+B,U=_<0?0:yr(I/H[B-_-1]%10)}if(A=A||y<0||z[D+1]!=null||(_<0?I:I%H[B-_-1]),A=x<4?(U||A)&&(x==0||x==(h.s<0?3:2)):U>5||U==5&&(x==4||A||x==6&&(F>0?_>0?I/H[B-_]:0:z[D-1])%10&1||x==(h.s<0?8:7)),y<1||!z[0])return z.length=0,A?(y-=h.e+1,z[0]=H[(we-y%we)%we],h.e=-y||0):z[0]=h.e=0,h;if(F==0?(z.length=D,k=1,D--):(z.length=D+1,k=H[we-F],z[D]=_>0?yr(I/H[B-_]%H[_])*k:0),A)for(;;)if(D==0){for(F=1,_=z[0];_>=10;_/=10,F++);for(_=z[0]+=k,k=1;_>=10;_/=10,k++);F!=k&&(h.e++,z[0]==Ur&&(z[0]=1));break}else{if(z[D]+=k,z[D]!=Ur)break;z[D--]=0,k=1}for(F=z.length;z[--F]===0;z.pop());}h.e>d?h.c=h.e=null:h.e<u&&(h.c=[h.e=0])}return h}function P(h){var y,x=h.e;return x===null?h.toString():(y=xr(h.c),y=x<=c||x>=l?Dc(y,x):wn(y,x,"0"),h.s<0?"-"+y:y)}return s.absoluteValue=s.abs=function(){var h=new w(this);return h.s<0&&(h.s=1),h},s.comparedTo=function(h,y){return Us(this,new w(h,y))},s.decimalPlaces=s.dp=function(h,y){var x,A,B,F=this;if(h!=null)return ct(h,0,St),y==null?y=i:ct(y,0,8),L(new w(F),h+F.e+1,y);if(!(x=F.c))return null;if(A=((B=x.length-1)-gr(this.e/we))*we,B=x[B])for(;B%10==0;B/=10,A--);return A<0&&(A=0),A},s.dividedBy=s.div=function(h,y){return t(this,new w(h,y),o,i)},s.dividedToIntegerBy=s.idiv=function(h,y){return t(this,new w(h,y),0,1)},s.exponentiatedBy=s.pow=function(h,y){var x,A,B,F,_,k,I,D,U,z=this;if(h=new w(h),h.c&&!h.isInteger())throw Error(Kt+"Exponent not an integer: "+P(h));if(y!=null&&(y=new w(y)),k=h.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!h.c||!h.c[0])return U=new w(Math.pow(+P(z),k?h.s*(2-Uc(h)):+P(h))),y?U.mod(y):U;if(I=h.s<0,y){if(y.c?!y.c[0]:!y.s)return new w(NaN);A=!I&&z.isInteger()&&y.isInteger(),A&&(z=z.mod(y))}else{if(h.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||k&&z.c[1]>=24e7:z.c[0]<8e13||k&&z.c[0]<=9999975e7)))return F=z.s<0&&Uc(h)?-0:0,z.e>-1&&(F=1/F),new w(I?1/F:F);b&&(F=ad(b/we+2))}for(k?(x=new w(.5),I&&(h.s=1),D=Uc(h)):(B=Math.abs(+P(h)),D=B%2),U=new w(a);;){if(D){if(U=U.times(z),!U.c)break;F?U.c.length>F&&(U.c.length=F):A&&(U=U.mod(y))}if(B){if(B=yr(B/2),B===0)break;D=B%2}else if(h=h.times(x),L(h,h.e+1,1),h.e>14)D=Uc(h);else{if(B=+P(h),B===0)break;D=B%2}z=z.times(z),F?z.c&&z.c.length>F&&(z.c.length=F):A&&(z=z.mod(y))}return A?U:(I&&(U=a.div(U)),y?U.mod(y):F?L(U,b,i,_):U)},s.integerValue=function(h){var y=new w(this);return h==null?h=i:ct(h,0,8),L(y,y.e+1,h)},s.isEqualTo=s.eq=function(h,y){return Us(this,new w(h,y))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(h,y){return Us(this,new w(h,y))>0},s.isGreaterThanOrEqualTo=s.gte=function(h,y){return(y=Us(this,new w(h,y)))===1||y===0},s.isInteger=function(){return!!this.c&&gr(this.e/we)>this.c.length-2},s.isLessThan=s.lt=function(h,y){return Us(this,new w(h,y))<0},s.isLessThanOrEqualTo=s.lte=function(h,y){return(y=Us(this,new w(h,y)))===-1||y===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(h,y){var x,A,B,F,_=this,k=_.s;if(h=new w(h,y),y=h.s,!k||!y)return new w(NaN);if(k!=y)return h.s=-y,_.plus(h);var I=_.e/we,D=h.e/we,U=_.c,z=h.c;if(!I||!D){if(!U||!z)return U?(h.s=-y,h):new w(z?_:NaN);if(!U[0]||!z[0])return z[0]?(h.s=-y,h):new w(U[0]?_:i==3?-0:0)}if(I=gr(I),D=gr(D),U=U.slice(),k=I-D){for((F=k<0)?(k=-k,B=U):(D=I,B=z),B.reverse(),y=k;y--;B.push(0));B.reverse()}else for(A=(F=(k=U.length)<(y=z.length))?k:y,k=y=0;y<A;y++)if(U[y]!=z[y]){F=U[y]<z[y];break}if(F&&(B=U,U=z,z=B,h.s=-h.s),y=(A=z.length)-(x=U.length),y>0)for(;y--;U[x++]=0);for(y=Ur-1;A>k;){if(U[--A]<z[A]){for(x=A;x&&!U[--x];U[x]=y);--U[x],U[A]+=Ur}U[A]-=z[A]}for(;U[0]==0;U.splice(0,1),--D);return U[0]?O(h,U,D):(h.s=i==3?-1:1,h.c=[h.e=0],h)},s.modulo=s.mod=function(h,y){var x,A,B=this;return h=new w(h,y),!B.c||!h.s||h.c&&!h.c[0]?new w(NaN):!h.c||B.c&&!B.c[0]?new w(B):(m==9?(A=h.s,h.s=1,x=t(B,h,0,3),h.s=A,x.s*=A):x=t(B,h,0,m),h=B.minus(x.times(h)),!h.c[0]&&m==1&&(h.s=B.s),h)},s.multipliedBy=s.times=function(h,y){var x,A,B,F,_,k,I,D,U,z,H,j,Q,pe,be,ie=this,de=ie.c,Oe=(h=new w(h,y)).c;if(!de||!Oe||!de[0]||!Oe[0])return!ie.s||!h.s||de&&!de[0]&&!Oe||Oe&&!Oe[0]&&!de?h.c=h.e=h.s=null:(h.s*=ie.s,!de||!Oe?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(A=gr(ie.e/we)+gr(h.e/we),h.s*=ie.s,I=de.length,z=Oe.length,I<z&&(Q=de,de=Oe,Oe=Q,B=I,I=z,z=B),B=I+z,Q=[];B--;Q.push(0));for(pe=Ur,be=Xn,B=z;--B>=0;){for(x=0,H=Oe[B]%be,j=Oe[B]/be|0,_=I,F=B+_;F>B;)D=de[--_]%be,U=de[_]/be|0,k=j*D+U*H,D=H*D+k%be*be+Q[F]+x,x=(D/pe|0)+(k/be|0)+j*U,Q[F--]=D%pe;Q[F]=x}return x?++A:Q.splice(0,1),O(h,Q,A)},s.negated=function(){var h=new w(this);return h.s=-h.s||null,h},s.plus=function(h,y){var x,A=this,B=A.s;if(h=new w(h,y),y=h.s,!B||!y)return new w(NaN);if(B!=y)return h.s=-y,A.minus(h);var F=A.e/we,_=h.e/we,k=A.c,I=h.c;if(!F||!_){if(!k||!I)return new w(B/0);if(!k[0]||!I[0])return I[0]?h:new w(k[0]?A:B*0)}if(F=gr(F),_=gr(_),k=k.slice(),B=F-_){for(B>0?(_=F,x=I):(B=-B,x=k),x.reverse();B--;x.push(0));x.reverse()}for(B=k.length,y=I.length,B-y<0&&(x=I,I=k,k=x,y=B),B=0;y;)B=(k[--y]=k[y]+I[y]+B)/Ur|0,k[y]=Ur===k[y]?0:k[y]%Ur;return B&&(k=[B].concat(k),++_),O(h,k,_)},s.precision=s.sd=function(h,y){var x,A,B,F=this;if(h!=null&&h!==!!h)return ct(h,1,St),y==null?y=i:ct(y,0,8),L(new w(F),h,y);if(!(x=F.c))return null;if(B=x.length-1,A=B*we+1,B=x[B]){for(;B%10==0;B/=10,A--);for(B=x[0];B>=10;B/=10,A++);}return h&&F.e+1>A&&(A=F.e+1),A},s.shiftedBy=function(h){return ct(h,-od,od),this.times("1e"+h)},s.squareRoot=s.sqrt=function(){var h,y,x,A,B,F=this,_=F.c,k=F.s,I=F.e,D=o+4,U=new w("0.5");if(k!==1||!_||!_[0])return new w(!k||k<0&&(!_||_[0])?NaN:_?F:1/0);if(k=Math.sqrt(+P(F)),k==0||k==1/0?(y=xr(_),(y.length+I)%2==0&&(y+="0"),k=Math.sqrt(+y),I=gr((I+1)/2)-(I<0||I%2),k==1/0?y="5e"+I:(y=k.toExponential(),y=y.slice(0,y.indexOf("e")+1)+I),x=new w(y)):x=new w(k+""),x.c[0]){for(I=x.e,k=I+D,k<3&&(k=0);;)if(B=x,x=U.times(B.plus(t(F,B,D,1))),xr(B.c).slice(0,k)===(y=xr(x.c)).slice(0,k))if(x.e<I&&--k,y=y.slice(k-3,k+1),y=="9999"||!A&&y=="4999"){if(!A&&(L(B,B.e+o+2,0),B.times(B).eq(F))){x=B;break}D+=4,k+=4,A=1}else{(!+y||!+y.slice(1)&&y.charAt(0)=="5")&&(L(x,x.e+o+2,1),h=!x.times(x).eq(F));break}}return L(x,x.e+o+1,i,h)},s.toExponential=function(h,y){return h!=null&&(ct(h,0,St),h++),S(this,h,y,1)},s.toFixed=function(h,y){return h!=null&&(ct(h,0,St),h=h+this.e+1),S(this,h,y)},s.toFormat=function(h,y,x){var A,B=this;if(x==null)h!=null&&y&&typeof y=="object"?(x=y,y=null):h&&typeof h=="object"?(x=h,h=y=null):x=g;else if(typeof x!="object")throw Error(Kt+"Argument not an object: "+x);if(A=B.toFixed(h,y),B.c){var F,_=A.split("."),k=+x.groupSize,I=+x.secondaryGroupSize,D=x.groupSeparator||"",U=_[0],z=_[1],H=B.s<0,j=H?U.slice(1):U,Q=j.length;if(I&&(F=k,k=I,I=F,Q-=F),k>0&&Q>0){for(F=Q%k||k,U=j.substr(0,F);F<Q;F+=k)U+=D+j.substr(F,k);I>0&&(U+=D+j.slice(F)),H&&(U="-"+U)}A=z?U+(x.decimalSeparator||"")+((I=+x.fractionGroupSize)?z.replace(new RegExp("\\d{"+I+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):z):U}return(x.prefix||"")+A+(x.suffix||"")},s.toFraction=function(h){var y,x,A,B,F,_,k,I,D,U,z,H,j=this,Q=j.c;if(h!=null&&(k=new w(h),!k.isInteger()&&(k.c||k.s!==1)||k.lt(a)))throw Error(Kt+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+P(k));if(!Q)return new w(j);for(y=new w(a),D=x=new w(a),A=I=new w(a),H=xr(Q),F=y.e=H.length-j.e-1,y.c[0]=id[(_=F%we)<0?we+_:_],h=!h||k.comparedTo(y)>0?F>0?y:D:k,_=d,d=1/0,k=new w(H),I.c[0]=0;U=t(k,y,0,1),B=x.plus(U.times(A)),B.comparedTo(h)!=1;)x=A,A=B,D=I.plus(U.times(B=D)),I=B,y=k.minus(U.times(B=y)),k=B;return B=t(h.minus(x),A,0,1),I=I.plus(B.times(D)),x=x.plus(B.times(A)),I.s=D.s=j.s,F=F*2,z=t(D,A,F,i).minus(j).abs().comparedTo(t(I,x,F,i).minus(j).abs())<1?[D,A]:[I,x],d=_,z},s.toNumber=function(){return+P(this)},s.toPrecision=function(h,y){return h!=null&&ct(h,1,St),S(this,h,y,2)},s.toString=function(h){var y,x=this,A=x.s,B=x.e;return B===null?A?(y="Infinity",A<0&&(y="-"+y)):y="NaN":(h==null?y=B<=c||B>=l?Dc(xr(x.c),B):wn(xr(x.c),B,"0"):h===10&&v?(x=L(new w(x),o+B+1,i),y=wn(xr(x.c),x.e,"0")):(ct(h,2,E.length,"Base"),y=r(wn(xr(x.c),B,"0"),10,h,A,!0)),A<0&&x.c[0]&&(y="-"+y)),y},s.valueOf=s.toJSON=function(){return P(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&w.set(e),w}function gr(e){var t=e|0;return e>0||e===t?t:t-1}function xr(e){for(var t,r,n=1,s=e.length,a=e[0]+"";n<s;){for(t=e[n++]+"",r=we-t.length;r--;t="0"+t);a+=t}for(s=a.length;a.charCodeAt(--s)===48;);return a.slice(0,s+1||1)}function Us(e,t){var r,n,s=e.c,a=t.c,o=e.s,i=t.s,c=e.e,l=t.e;if(!o||!i)return null;if(r=s&&!s[0],n=a&&!a[0],r||n)return r?n?0:-i:o;if(o!=i)return o;if(r=o<0,n=c==l,!s||!a)return n?0:!s^r?1:-1;if(!n)return c>l^r?1:-1;for(i=(c=s.length)<(l=a.length)?c:l,o=0;o<i;o++)if(s[o]!=a[o])return s[o]>a[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function ct(e,t,r,n){if(e<t||e>r||e!==yr(e))throw Error(Kt+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Uc(e){var t=e.c.length-1;return gr(e.e/we)==t&&e.c[t]%2!=0}function Dc(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function wn(e,t,r){var n,s;if(t<0){for(s=r+".";++t;s+=r);e=s+e}else if(n=e.length,++t>n){for(s=r,t-=n;--t;s+=r);e+=s}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var G=Gm();const Sa=(e,t)=>{if(!e||!t)return"";const r=G(10).pow(e||0);return G(t).times(r).idiv(r).div(r).toFixed()};G(0),G(1),G(10),G(1e18);function Ds(e,t){return e==t||e.toLowerCase()==t.toLowerCase()}const _s=e=>!!Zm.find(t=>Ds(t,e||""));function tw(e){return[$t.Years,$t.Months,$t.Weeks,$t.Days,$t.Hours,$t.Minutes].find(r=>r<=e)||$t.Minutes}const Qn=e=>e?e.value*e.unit:0,rw=e=>!e||e==="NaN"?"0":G(e).decimalPlaces(0).toFixed(),Ms=e=>Object.values(Ft).find(t=>t.id===e),nw=e=>{if(!e)return;const t=e.map(a=>_t(a)),r=Object.entries(Xm).filter(([a])=>t.includes(a)).flatMap(([,a])=>a),n=e.map(a=>a.exchangeAddress),s=new Set([...n,...r].map(a=>a.toLowerCase()));return Array.from(s)},cd=(e,t)=>e.version===1?(e.fillDelay||0)*1e3+fh(t):(e.fillDelay||0)*1e3,zo=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),jm=e=>Ch().filter(t=>t.name===e).map(t=>t.chainId),ld=(e="",t="",r=18,n=18)=>{if(!G(e||0).gt(0)||!G(t||0).gt(0))return"";const s=Sa(r,e),a=Sa(n,t);return G(a).div(s).toFixed()},Vm=(e,t,r)=>{if(e.type===Re.TWAP_MARKET)return"";const n=Sa(t,e.srcAmountPerTrade),s=Sa(r,e.dstMinAmountPerTrade);return G(s).div(n).toFixed()},Wm=(e,t,r)=>{if(e.type===Re.TWAP_MARKET)return"";const n=Sa(t,e.srcAmountPerTrade),s=Sa(r,e.triggerPricePerTrade);return G(s).div(n).toFixed()},sw="https://order-sink-dev.orbs.network",aw="https://order-sink.orbs.network";let ud;const ow=e=>{ud=e},Ro=()=>{const e=zo("env");return e==="prod"?!1:e==="dev"?!0:ud==="prod"?!1:ud==="dev"},dd=()=>Ro()?sw:aw,iw=100,cw=1,_c=300*1e3,Pa=365*24*60*60*1e3,pd=300*1e3,qm=new Date(_c).getMinutes(),fd=e=>`https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`,Dr="https://hub.orbs.network/api/apikey/subgraphs/id",Km={[Ft.eth.id]:`${Dr}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,[Ft.bsc.id]:`${Dr}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,[Ft.poly.id]:`${Dr}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,[Ft.arb.id]:`${Dr}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,[Ft.base.id]:`${Dr}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,[Ft.sei.id]:`${Dr}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,[Ft.linea.id]:`${Dr}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,[Ft.sonic.id]:`${Dr}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,[Ft.ftm.id]:`${Dr}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,[Ft.katana.id]:`${Dr}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,[Ft.avax.id]:`${Dr}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,[Ft.bera.id]:fd("berachain"),[Ft.flare.id]:fd("flare"),[Ft.cronosZkEvm.id]:fd("cronos-zkevm")},Ym="0x0000000000000000000000000000000000000000",Zm=[Ym,"0x0000000000000000000000000000000000001010","0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","0x000000000000000000000000000000000000dEaD","0x000000000000000000000000000000000000800A","0x000000000000000000000000000000000000800a"],Mc="115792089237316195423570985008687907853269984665640564039457584007913129639935",_t=e=>`${e.name}_${e.chainId}`,Xm={[_t(Pe.SushiArb)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Pe.SushiBase)]:["0x846F2B29ef314bF3D667981b4ffdADc5B858312a","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Pe.SushiEth)]:["0xc55943Fa6509004B2903ED8F8ab7347BfC47D0bA","0x08c41f5D1C844061f6D952E25827eeAA576c6536"],[_t(Pe.PancakeSwap)]:["0xb2BAFe188faD927240038cC4FfF2d771d8A58905","0xE2a0c3b9aD19A18c4bBa7fffBe5bC1b0E58Db1CE"],[_t(Pe.PancakeSwapArbitrum)]:["0xE20167871dB616DdfFD0Fd870d9bC068C350DD1F","0x807488ADAD033e95C438F998277bE654152594dc"],[_t(Pe.PancakeSwapBase)]:["0x10ed1F36e4eBE76E161c9AADDa20BE841bc0082c","0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Pe.PancakeSwapLinea)]:["0x3A9df3eE209b802D0337383f5abCe3204d623588"],[_t(Pe.QuickSwap)]:["0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF"],[_t(Pe.Thena)]:["0xc2aBC02acd77Bb2407efA22348dA9afC8B375290"],[_t(Pe.Lynex)]:["0x72e3e1fD5D2Ee2F1C2Eb695206D490a1D45C3835"],[_t(Pe.DragonSwap)]:["0x101e1B65Bb516FB5f4547C80BAe0b51f1b8D7a22"],[_t(Pe.SpookySwapSonic)]:["0xAd97B770ad64aE47fc7d64B3bD820dCDbF9ff7DA"],[_t(Pe.SpookySwap)]:["0x3924d62219483015f982b160d48c0fa5Fd436Cba"],[_t(Pe.SwapX)]:["0xE5012eBDe5e26EE3Ea41992154731a03023CF274"]},Nc={unit:$t.Minutes,value:qm},lw=.25,uw="100",md="RePermitWitnessTransferFrom",Qm={RePermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:"Order"}],Exchange:[{name:"adapter",type:"address"},{name:"ref",type:"address"},{name:"share",type:"uint32"},{name:"data",type:"bytes"}],Input:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"maxAmount",type:"uint256"}],Order:[{name:"reactor",type:"address"},{name:"executor",type:"address"},{name:"exchange",type:"Exchange"},{name:"swapper",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"chainid",type:"uint256"},{name:"exclusivity",type:"uint32"},{name:"epoch",type:"uint32"},{name:"slippage",type:"uint32"},{name:"freshness",type:"uint32"},{name:"input",type:"Input"},{name:"output",type:"Output"}],Output:[{name:"token",type:"address"},{name:"limit",type:"uint256"},{name:"stop",type:"uint256"},{name:"recipient",type:"address"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},Jm={RePermitWitnessTransferFrom:[{name:"permitted",type:"TokenPermissions"},{name:"spender",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"witness",type:"Order"}],Exchange:[{name:"adapter",type:"address"},{name:"ref",type:"address"},{name:"share",type:"uint32"},{name:"data",type:"bytes"}],Input:[{name:"token",type:"address"},{name:"amount",type:"uint256"},{name:"maxAmount",type:"uint256"}],Order:[{name:"reactor",type:"address"},{name:"executor",type:"address"},{name:"exchange",type:"Exchange"},{name:"swapper",type:"address"},{name:"nonce",type:"uint256"},{name:"start",type:"uint256"},{name:"deadline",type:"uint256"},{name:"chainid",type:"uint256"},{name:"exclusivity",type:"uint32"},{name:"epoch",type:"uint32"},{name:"slippage",type:"uint32"},{name:"freshness",type:"uint32"},{name:"input",type:"Input"},{name:"output",type:"Output"}],Output:[{name:"token",type:"address"},{name:"limit",type:"uint256"},{name:"triggerLower",type:"uint256"},{name:"triggerUpper",type:"uint256"},{name:"recipient",type:"address"}],TokenPermissions:[{name:"token",type:"address"},{name:"amount",type:"uint256"}]},hd="https://www.orbs.com/dtwap-and-dlimit-faq/",dw="https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP",pw="https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg",fw="https://www.orbs.com/assets/img/common/logo.svg",mw="https://www.orbs.com/",hw="https://www.orbs.com/dtwap-dlimit-disclaimer";var Ia=(e=>(e.FRESHNESS="freshness",e.MIN_CHUNK_SIZE_USD="minChunkSizeUsd",e.ENV="env",e.DURATION="duration",e.IGNORE_ERRORS="ignore-errors",e))(Ia||{});const eh="-5",th="10",rh="-10",nh="5",bw="Something went wrong";function yw(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}function gw(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const xw={1:{dex:{sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},14:{dex:{spark:{type:"default:spark",adapter:"0xB18c633B6584A33E45a8840a759f56dF17117b1D",fee:"0xaeA8C3e1a129A77686E115b1a46D9aD8405F7D2b"}}},56:{dex:{thena:{type:"default:odos-v2",adapter:"0xB75218ba5A99bF57Fd02556B70F05A4A0f1Dbe67",fee:"0x15eBc8b5b3877512FFF23650188694A9a8891FAc"},pancake:{type:"p2:pancakeswap-v2",adapter:"0x654272F7e6e6E912D38650f783eFd44452fD6ee5",fee:"0x37A957f10F458e0d7fDECBE2917971b57F15c927"},newera:{type:"default:odos-v2",adapter:"0x845f459271D800f6Ab32D78400b8Aa18414E80b0",fee:"0x4E7454909eB6D539111D56b50d68897E933D2d11"}}},137:{dex:{quick:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"},teafi:{type:"paraswap:paraswap-v5",adapter:"0xe95db7a60164B112C64cE67bA8587b1d4a0E0D29",fee:"0x04Ff96e2c4D62b5771795d307AD679a25b3D2D50"}}},143:{dex:{yowie:{type:"default:openocean-v2",adapter:"0x18bc9533c3539073B9A9acF12b0AbF7cB73e0F1f",fee:"0x6AF3eE77A3A3257777F5649aFa611b4C7Fd975Ef"},pangolin:{type:"default:kyber-v2",adapter:"0xd7D9CAA2910f49F37AC3447f5cAd27153944354A",fee:"0xde92da99D188Ceb54A11ec711EF52D808A6260B5"}}},146:{dex:{spooky:{type:"default:magpie-v3",adapter:"0xdCee7FDdB932104329d528144Cd17A408722B7e2",fee:"0x840Df4684B35BC68BcdA3F6707A3c82A0D662f8b"},swapx:{type:"default:openocean-v2",adapter:"0xecc733D6F6f2DEa341832D650E30822118884FEb",fee:"0x6E03f7BC0f141894612AA017796096399623895F"},shadow:{type:"default:magpie-v3",adapter:"0x5f3E5F6ACCfc65243A01Da3E93b5A700285592C3",fee:"0xb9e3751fAF3187E1bC468E56a707a8A91754460e"}}},1329:{dex:{dragon:{type:"default:dragon",adapter:"0x02d9d5882129241b67ec21Ebc2C86e1BE9BC9890",fee:"0x0dc1E0525202b32e89bA78ed55b1e5cEdB751334"},nami:{type:"default:openocean-v2",adapter:"0x2D4A1237A98f8cb03C3C85960e859aA44036a306",fee:"0xeB58450e23632003f013568703F54446070E2E80"}}},8453:{dex:{quick:{type:"default:kyber-v2",adapter:"0xc73F03c929A123Ee2f3A98EC18BB240f03980AE5",fee:"0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f"},sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},42161:{dex:{arbidex:{type:"default:odos-v2",adapter:"0xa734b32151108139e48dCA06eE721538d90A9Ef6",fee:"0xa0c11852f8A44e32F9EC10AD25986A53842f72Ca"},ramses:{type:"paraswap:paraswap-v5",adapter:"0x023fD6848234f2655818705237F77F02215FEfe5",fee:"0xB5BaCB60ECDa0bEF809B2A26eC9B4B926835D7af"},omni:{type:"paraswap:paraswap-v5",adapter:"0xa1baE146161223cd9dCa7137F68eb385934130BE",fee:"0xba5291526c30B097E9F1Fd1Be301E2ab6E0782aa"},chronos:{type:"default:odos-v2",adapter:"0x4Ff90F32aceD08b3e3257B018EA495Fd1Bfe4455",fee:"0x5729af83240EFecAa18eafaAE82961c2DD045Dbe"},sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},43114:{dex:{blackhole:{type:"default:kyber-v2",adapter:"0x426ec4bc0d58B80959CDE77576a1942dd40592Fa",fee:"0x7f8B62520D9B5DA0ED517cc36e8dcb2a356f1928"},pangolin:{type:"default:kyber-v2",adapter:"0xd7D9CAA2910f49F37AC3447f5cAd27153944354A",fee:"0xde92da99D188Ceb54A11ec711EF52D808A6260B5"}}},59144:{dex:{lynex:{type:"default:openocean",adapter:"0x4FF6A97A67fe395212f168f011D71fE79E4396f2",fee:"0xcb36ed1B1BfAD8F7FC9651f52d21f04A68677423"}}},80094:{dex:{kodiak:{type:"default:kodiak",adapter:"0xBbaa527Aac00b1Ee9A3909D4D8c4447630E29B1F",fee:"0xBA47Ec15aFbCF6e7e9F52900632049530bB6bAe4"}}},747474:{dex:{sushiswap:{type:"default:sushi",router:"0xAC4c6e212A361c968F1725b4d055b47E63F80b75",adapter:"0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5",fee:"0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc"}}},"*":{wm:"0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000",repermit:"0x00002a9C4D9497df5Bd31768eC5d30eEf5405000",cosigner:"0x0007ec53404c423C935e830ec21903e184690000",reactor:"0x0006a959430e8fBB858D81B2D1140B0ae5c26001",executor:"0x000eBA869d76C618ddc4A6D685A0820A620Ce002",refinery:"0x000E474c0D7084EAA35A501035E73269f4b009A5",salt:{wm:"0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152",repermit:"0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7",cosigner:"0x37576f2ac1d2a602f00777611edf6f0cbc27611b0980b29bc7856fa79b2b8073",reactor:"0x034169222370f2fd587ef8998082d762cceef58a272330215f5110ec0d76d400",executor:"0xea139bc421fa5e272bed3db74233b2e02077e0aacf8b855f87961e98f2fb467f",refinery:"0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec"}}};var bd,sh;function ww(){if(sh)return bd;sh=1;const e=xw,t=s=>gw(`./out/${s}.sol/${s}.json`).abi,r=()=>({wm:t("WM"),repermit:t("RePermit"),reactor:t("OrderReactor"),executor:t("Executor"),refinery:t("Refinery"),adapter:t("DefaultDexAdapter")});function n(s,a){if(!s||!(a!=null&&a.trim()))return;const{dex:o,...i}=e["*"]??{},c=e[s];if(!c)return;const{dex:l,...u}=c,d=l==null?void 0:l[a];if(d)return{...i,...u,...d}}return bd={config:n,abis:r,raw:e},bd}var ah=ww();const oh=(e,t,r)=>{if(!e||!t||!r)return;const n=G(e).times(t),s=G(10).pow(r);return n.div(s).toFixed(0)},ih=(e,t,r,n)=>{if(r||!n||!e||!t)return G(0).toString();const s=G(e).times(G(t)),a=G(10).pow(n),o=s.div(a);return G.max(1,o).integerValue(G.ROUND_FLOOR).toFixed(0)},ch=(e,t,r,n)=>{if(e===ge.TWAP||e===ge.LIMIT)return"0";if(!n||!t||!r)return;const s=G(t).times(G(r)),a=G(10).pow(n),o=s.div(a);return G.max(1,o).integerValue(G.ROUND_FLOOR).toFixed(0)||"0"},lh=(e,t,r,n)=>{const s=Qn(r)*2*t,a=zo(Ia.DURATION),o=tw(a?Number(a):s);return a?{unit:o,value:Number(G(Number(a)/o).toFixed(2))}:n||(e===ge.LIMIT?{unit:$t.Days,value:7}:e===ge.STOP_LOSS||e===ge.TAKE_PROFIT?{unit:$t.Days,value:1}:{unit:o,value:Number(G(s/o).toFixed(2))})},uh=(e,t,r)=>t!==ge.TWAP?1:r!==void 0?r:e,dh=(e,t,r,n)=>{if(!t||!r||!n)return 1;const a=G(r).times(t).div(n).integerValue(G.ROUND_FLOOR).toNumber(),o=Math.floor(Pa/2/Qn(e));return Math.max(1,Math.min(a,o))},ph=(e,t)=>e+Qn(t)+6e4,fh=e=>e.bidDelaySeconds*1e3*2,mh=(e="",t=0)=>!e||!t?"0":G(e).div(t).integerValue(G.ROUND_FLOOR).toFixed(0),vw=(e,t)=>({isError:!(e.unit===Nc.unit&&e.value===Nc.value)&&Qn(e)*t>Pa,value:Math.floor(Pa/t)}),hh=(e="",t="",r)=>{if(r===ge.STOP_LOSS)return{isError:G(t||0).gte(G(e||0)),value:e}},bh=(e="",t="",r)=>{if(r===ge.TAKE_PROFIT)return{isError:G(t||0).lte(G(e||0)),value:e}},yh=(e="",t="",r=!1,n)=>{if(!r&&n===ge.STOP_LOSS)return{isError:G(t||0).gte(G(e||0)),value:e}},gh=(e="",t="",r=!1,n)=>{if(!r&&n===ge.TAKE_PROFIT)return{isError:G(t||0).gte(G(e||0)),value:e}},xh=(e,t)=>e===ge.STOP_LOSS||e===ge.TAKE_PROFIT?{isError:Qn(t)>5184e6,value:5184e6}:{isError:Qn(t)>Pa,value:Pa},wh=e=>({isError:Qn(e)<pd,value:pd}),vh=e=>({isError:Qn(e)<_c,value:_c}),Eh=(e,t,r)=>({isError:G(t||0).multipliedBy(e||0).isLessThan(r),value:r}),kh=(e,t,r)=>({isError:r===ge.TWAP&&G(e).isGreaterThan(t),value:t}),Ew=(e,t)=>{if(e===Jr.Pancake)switch(t){case 56:return Pe.PancakeSwap;case 42161:return Pe.PancakeSwapArbitrum;case 8453:return Pe.PancakeSwapBase;case 59144:return Pe.PancakeSwapLinea;default:return Pe.PancakeSwap}if(e===Jr.Sushiswap)switch(t){case 1:return Pe.SushiEth;case 42161:return Pe.SushiArb;case 137:return Pe.SushiBase;case 747474:return Pe.SushiKatana;default:return Pe.SushiEth}if(e===Jr.Quick)switch(t){case 137:return Pe.QuickSwap;case 8453:return Pe.QuickSwapBase;default:return Pe.QuickSwap}if(e===Jr.Thena)switch(t){case 56:return Pe.Thena;default:return Pe.Thena}if(e===Jr.Spooky)switch(t){case 250:return Pe.SpookySwap;case 146:return Pe.SpookySwapSonic;default:return Pe.SpookySwap}if(e===Jr.Lynex)switch(t){case 59144:return Pe.Lynex;default:return Pe.Lynex}if(e===Jr.Swapx)switch(t){case 146:return Pe.SwapX;default:return Pe.SwapX}if(e===Jr.Blackhole)switch(t){case 43114:return Pe.BlackholeAvax;default:return Pe.BlackholeAvax}},yd=(e,t=0)=>{const{abi:r,...n}=ah.config(t,e);return{...n,partner:e,twapConfig:Ew(e,t)}},Ch=()=>{const e=ah.raw;return Object.entries(e).filter(([t])=>t!=="*").flatMap(([t,r])=>{const n=r==null?void 0:r.dex;return!n||typeof n!="object"?[]:Object.entries(n).map(([s])=>({chainId:Number(t),name:s,config:yd(s,Number(t))}))}).sort((t,r)=>t.name.localeCompare(r.name))},Th=e=>{const t=zo(Ia.MIN_CHUNK_SIZE_USD);return t?parseInt(t):e},Ah=({marketPrice:e,typedInputAmount:t,srcUsd1Token:r,marketPriceLoading:n,triggerPriceError:s,limitPriceError:a,tradesError:o,fillDelayError:i,durationError:c,balanceError:l,minTradeSizeError:u})=>{if(!zo(Ia.IGNORE_ERRORS)&&!(G(e||0).isZero()||G(t||0).isZero()||G(r||"0").isZero()||n))return u||s||a||o||i||c||l},Sh=(e,t)=>{const r=Date.now().toString(),n=parseInt((e/1e3).toFixed(0)),s=rw(t/1e3),a=zo(Ia.FRESHNESS),o=a?parseInt(a):60;return{nonce:r,epoch:n,deadline:s,freshness:o}},kw=({chainId:e,srcToken:t,dstToken:r,srcAmount:n,deadlineMillis:s,fillDelayMillis:a,slippage:o,account:i,srcAmountPerTrade:c,dstMinAmountPerTrade:l="0",triggerAmountPerTrade:u="0",config:d,module:f})=>{const{nonce:m,epoch:b,deadline:g,freshness:E}=Sh(a,s),v=f===ge.TAKE_PROFIT?Mc:u,w=f===ge.TAKE_PROFIT?u:l,S={permitted:{token:t,amount:n},spender:d.reactor,nonce:m,deadline:g,witness:{reactor:d.reactor,executor:d.executor,exchange:{adapter:d.adapter,ref:d.fee,share:0,data:"0x"},swapper:i,nonce:m,deadline:g,chainid:e,exclusivity:0,epoch:b,slippage:o,freshness:E,input:{token:t,amount:c,maxAmount:n},output:{token:r,limit:G(w||0).toFixed(),stop:G(v||0).toFixed(),recipient:i}}};return{domain:{name:"RePermit",version:"1",chainId:e,verifyingContract:d.repermit},order:S,types:Qm,primaryType:md}},Cw=({chainId:e,srcToken:t,dstToken:r,srcAmount:n,deadlineMillis:s,fillDelayMillis:a,slippage:o,account:i,srcAmountPerTrade:c,dstMinAmountPerTrade:l="0",triggerAmountPerTrade:u="0",config:d,module:f,feePercentage:m})=>{const{nonce:b,epoch:g,deadline:E,freshness:v}=Sh(a,s),w=Math.floor(Date.now()/1e3).toString(),S=l,T=m*100,O=f===ge.STOP_LOSS?u:"0",L=f===ge.TAKE_PROFIT?u:"0",P={permitted:{token:t,amount:n},spender:d.reactor,nonce:b,deadline:E,witness:{reactor:d.reactor,executor:d.executor,exchange:{adapter:d.adapter,ref:d.fee,share:T,data:"0x"},swapper:i,nonce:b,start:w,deadline:E,chainid:e,exclusivity:0,epoch:g,slippage:o,freshness:v,input:{token:t,amount:c,maxAmount:n},output:{token:r,limit:G(S||0).toFixed(),triggerLower:G(O||0).toFixed(),triggerUpper:G(L||0).toFixed(),recipient:i}}};return{domain:{name:"RePermit",version:"1",chainId:e,verifyingContract:d.repermit},order:P,types:Jm,primaryType:md}},Ph=e=>Ro()?Cw(e):kw(e),Tw={version:"1.10.0"},Aw=`https://bi.orbs.network/putes/twap-ui-${.7}`,Ih=Tw.version;let gd="unknown";function Bh(e){gd=e}function xd(){const e=Math.random().toString(36).substring(2,16),t=Math.random().toString(36).substring(2,16),r=Date.now().toString(36);return`id_${e+t+r}`}const Sw=(e,t,r)=>{var n,s,a,o,i,c,l,u,d;return{spotVersion:Ih,partner:e.partner,adapter:e.adapter,cosigner:e.cosigner,executor:e.executor,fee:e.fee,reactor:e.reactor,refinery:e.refinery,repermit:e.repermit,router:e.router,type:e.type,wm:e.wm,chainName:((n=e.twapConfig)==null?void 0:n.chainName)||"",chainId:r||0,twapVersion:((s=e.twapConfig)==null?void 0:s.twapVersion)||0,twapAddress:((a=e.twapConfig)==null?void 0:a.twapAddress)||"",lensAddress:((o=e.twapConfig)==null?void 0:o.lensAddress)||"",bidDelaySeconds:((i=e.twapConfig)==null?void 0:i.bidDelaySeconds)||0,minChunkSizeUsd:t,name:((c=e.twapConfig)==null?void 0:c.name)||"",exchangeAddress:((l=e.twapConfig)==null?void 0:l.exchangeAddress)||"",exchangeType:((u=e.twapConfig)==null?void 0:u.exchangeType)||"",pathfinderKey:((d=e.twapConfig)==null?void 0:d.pathfinderKey)||""}},Fh=async e=>{try{await fetch(Aw,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then()}catch(t){console.error("Failed to send BI",t)}};class Pw{constructor(){td(this,"timeout");td(this,"config");td(this,"data",{_id:xd()})}async updateAndSend(t={},r=!1,n){try{this.data={...this.data,...t},r?(await Fh(this.data),n==null||n()):(clearTimeout(this.timeout),this.timeout=setTimeout(()=>{Fh(this.data),n==null||n()},1e3))}catch(s){console.error("Failed to update and send BI",s)}}onCancelOrderRequest(t,r){this.updateAndSend({cancelOrderIdsV1:r===1?t:void 0,cancelOrderIdsV2:r===2?t:void 0,action:"cancel order",cancelOrderSuccess:!1,cancelOrderTxHash:void 0,actionError:void 0})}onCancelOrderSuccess(t){this.updateAndSend({cancelOrderTxHash:t,cancelOrderSuccess:!0})}onCancelOrderError(t){this.onTxError(t)}onWrapSuccess(t){this.updateAndSend({wrapTxHash:t})}onWrapRequest(){this.updateAndSend({action:"wrap"})}onWrapError(t){this.onTxError(t)}onApproveRequest(){this.updateAndSend({action:"approve"})}onApproveSuccess(t){this.updateAndSend({approvalTxHash:t})}onApproveError(t){this.onTxError(t)}onCrash(t){var r;this.updateAndSend({action:"crash",actionError:((r=t==null?void 0:t.message)==null?void 0:r.toLowerCase())||(t==null?void 0:t.toLowerCase())})}onTxError(t){var n;const r=((n=t==null?void 0:t.message)==null?void 0:n.toLowerCase())||(t==null?void 0:t.toLowerCase());this.updateAndSend({actionError:r})}onRequestOrder({account:t,chainId:r,module:n,srcToken:s,dstToken:a,fromTokenAmount:o,srcChunkAmount:i,minDstAmountOutPerTrade:c="",triggerPricePerTrade:l="",deadline:u,fillDelay:d,slippage:f,isMarketOrder:m,chunksAmount:b}){this.updateAndSend({toTokenAddress:a.address,toTokenSymbol:a.symbol,fromTokenAddress:s.address,fromTokenSymbol:s.symbol,fromTokenAmount:o,chunksAmount:b,srcChunkAmount:i,minDstAmountOutPerTrade:c,triggerPricePerTrade:l,deadline:u,fillDelay:d,slippage:f,chainId:r,walletAddress:t,module:n,orderType:m?"market":"limit",actionError:void 0})}onSignOrderRequest(t){this.updateAndSend({action:"sign order",order:t})}onSignOrderError(t){this.onTxError(t)}onSignOrderSuccess(t){this.updateAndSend({action:"sign order",signature:t})}init(t,r,n){var s;this.config=t,n!==((s=this.data)==null?void 0:s.chainId)&&(this.data={_id:xd(),action:"module-import",uiVersion:gd,...Sw(t,r,n),origin:window.location.origin},this.updateAndSend(this.data))}onCreateOrderError(t){this.onTxError(t)}onCreateOrderRequest(){this.updateAndSend({action:"create order"})}async onCreateOrderSuccess(t){this.updateAndSend({orderHash:t,orderSuccess:!0},void 0,()=>{this.data={_id:xd(),action:"reset",uiVersion:gd,origin:this.data.origin,spotVersion:Ih,partner:this.data.partner,adapter:this.data.adapter,cosigner:this.data.cosigner,executor:this.data.executor,fee:this.data.fee,reactor:this.data.reactor,refinery:this.data.refinery,repermit:this.data.repermit,router:this.data.router,type:this.data.type,wm:this.data.wm,chainName:this.data.chainName||"",chainId:this.data.chainId||0,twapVersion:this.data.twapVersion||0,twapAddress:this.data.twapAddress||"",lensAddress:this.data.lensAddress||"",bidDelaySeconds:this.data.bidDelaySeconds||0,minChunkSizeUsd:this.data.minChunkSizeUsd||0,name:this.data.name||"",exchangeAddress:this.data.exchangeAddress||"",exchangeType:this.data.exchangeType||"",pathfinderKey:this.data.pathfinderKey||""}})}onLoad(){this.updateAndSend({action:"module-import",origin:window.location.origin})}}const dt=new Pw,Iw=e=>{var i;const t=G(e.order.witness.output.limit||0).gt(1),r=e.order.witness.output.stop,n=e.order.witness.output.triggerUpper,s=G(r||0).eq(Mc)||G(n||0).gt(0),a=G(r||0).gt(0),o=((i=e.metadata.chunks)==null?void 0:i.length)||G(e.order.witness.input.maxAmount).div(G(e.order.witness.input.amount)).toNumber();return s?Re.TAKE_PROFIT:a?t?Re.STOP_LOSS_LIMIT:Re.STOP_LOSS_MARKET:t?o>1&&t?Re.TWAP_LIMIT:t?Re.LIMIT:Re.TWAP_MARKET:Re.TWAP_MARKET},Bw=e=>{var s;const t=((s=e.metadata.chunks)==null?void 0:s.filter(a=>a.status==="success").length)||0,r=e.metadata.expectedChunks||0,n=G(t).dividedBy(r).toNumber();return n>=.99?100:n<=0?0:Number((n*100).toFixed(2))},Fw=(e,t)=>e.metadata.status==="completed"||t>=99?ut.Completed:["pending","eligible"].includes(e.metadata.status)?ut.Open:e.metadata.description.toLowerCase()==="cancelled by contract"?ut.Cancelled:ut.Expired,Ow=e=>{var r;return(((r=e.metadata.chunks)==null?void 0:r.filter(n=>n.status==="success"))||[]).map(n=>({inAmount:n.inAmount,outAmount:n.outAmount,timestamp:new Date(n.timestamp).getTime(),txHash:n.txHash}))},Uw=(e,t)=>{var n;const r=e.length;return r>=t&&((n=e[r-1])==null?void 0:n.timestamp)||0},Dw=e=>G(e.metadata.displayOnlyInputTokenPriceUSD).dividedBy(1e18).toFixed(),wd=e=>Number(e.order.witness.output.limit)===1?"":e.order.witness.output.limit,_w=e=>{const{triggerLower:t="0",triggerUpper:r="0"}=e.order.witness.output,n=wd(e),s=e.metadata.expectedChunks||1,a=G(r||0).gt(0);return{dstMinAmountPerTrade:n,triggerPricePerTrade:a?r:t,dstMinAmountTotal:G(n).multipliedBy(s).toFixed()}},Mw=e=>{const t=wd(e),r=G(e.order.witness.output.stop||0).eq(Mc),n=e.metadata.expectedChunks||1;return{dstMinAmountPerTrade:r?"":t,triggerPricePerTrade:r?t:G(e.order.witness.output.stop||"").toFixed(),dstMinAmountTotal:r?"":G(t).multipliedBy(n).toFixed()}},Nw=e=>Ro()?_w(e):Mw(e),vd=e=>{const t=Bw(e),r=wd(e),n=e.metadata.expectedChunks||1,s=Ow(e);return{id:e.hash,hash:e.hash,version:2,type:Iw(e),maker:e.order.witness.swapper,progress:t,srcAmountFilled:s.reduce((a,o)=>a.plus(o.inAmount),new G(0)).toFixed()||"",dstAmountFilled:s.reduce((a,o)=>a.plus(o.outAmount),new G(0)).toFixed()||"",fills:s,srcTokenAddress:e.order.witness.input.token,dstTokenAddress:e.order.witness.output.token,orderDollarValueIn:Dw(e),fillDelay:e.order.witness.epoch*1e3,deadline:Number(e.order.deadline)*1e3,createdAt:new Date(e.timestamp).getTime(),srcAmount:e.order.witness.input.maxAmount,srcAmountPerTrade:e.order.witness.input.amount,totalTradesAmount:n,isMarketPrice:G(r||0).lte(1),chainId:e.order.witness.chainid,filledOrderTimestamp:Uw(s,n),status:Fw(e,t),rawOrder:e,...Nw(e)}},Lw=async({chainId:e,signal:t,account:r,exchange:n})=>{try{if(!r)return[];const s=n?`&exchange=${n}`:"";return(await(await fetch(`${dd()}/orders?swapper=${r}&chainId=${e}${s}`,{signal:t})).json()).orders.map(vd)}catch{return[]}},Oh=async(e,t)=>{try{const r={signature:t,order:e,status:"pending"};dt.onCreateOrderRequest();const n=await fetch(`${dd()}/orders/new`,{method:"POST",body:JSON.stringify(r)}),s=await n.json().catch(()=>({}));if(!n.ok||!(s!=null&&s.success)){const o=(s==null?void 0:s.message)??n.statusText??"Request failed",i=(s==null?void 0:s.code)??n.status;throw new Error(`error:${o}, code:${i}`)}const a=vd(s.signedOrder);return dt.onCreateOrderSuccess(a.id),a}catch(r){throw dt.onCreateOrderError(r),console.error(r),r}},vn=(e,t)=>e&&e.length?e.map(t||(r=>`${r}`)):void 0,zw=e=>{if(e)return Km[e]},Ed=async({chainId:e,buildQuery:t,extractResults:r,signal:n,retries:s=1,limit:a=1e3,page:o})=>{const i=zw(e);if(!i)throw new Vw;const c=async d=>{let f=0;for(;f<=s;)try{const m=await fetch(i,{method:"POST",body:JSON.stringify({query:d}),signal:n,headers:{"Content-Type":"application/json"}});if(!m.ok)throw new Error(`HTTP error: ${m.status}`);const b=await m.json();if(b.errors)throw new Error(b.errors[0].message);return r(b)}catch(m){if(f===s)throw m;await new Promise(b=>setTimeout(b,500*2**f)),f++}return[]};let l=0;const u=[];if(o!==void 0){const d=t(o,a);try{return await c(d)}catch{console.warn(`Page ${o} failed, retrying one final time...`);try{return await c(d)}catch{return[]}}}for(;;){const d=t(l,a);let f;try{f=await c(d)}catch{console.warn(`Page ${l} failed, retrying one final time...`);try{f=await c(d)}catch{return u}}if(u.push(...f),f.length<a)break;l++}return u},Uh=e=>e.map(t=>({inAmount:t.srcAmountIn,outAmount:t.dstAmountOut,timestamp:t.timestamp,txHash:t.transactionHash})),Dh=(e,t)=>{const r=G(e||0).gt(1);return!r&&t===1?Re.TWAP_MARKET:t>1&&r?Re.TWAP_LIMIT:r?Re.LIMIT:Re.TWAP_MARKET},Rw=(e,t,r,n)=>{var f;const s=Uh(r||[]),a=new G(e.ask_srcAmount||0).div(e.ask_srcBidAmount).integerValue(G.ROUND_FLOOR).toNumber(),i=(r==null?void 0:r.length)===a?(f=r==null?void 0:r[(r==null?void 0:r.length)-1])==null?void 0:f.timestamp:void 0,c=s.reduce((m,b)=>m.plus(b.inAmount),new G(0)).toFixed(),l=s.reduce((m,b)=>m.plus(b.outAmount),new G(0)).toFixed(),u=_h(e.ask_srcAmount,c),d=Dh(e.ask_dstMinAmount,a);return{version:1,id:e.Contract_id.toString(),hash:"",type:Dh(e.ask_dstMinAmount,a),srcTokenAddress:e.ask_srcToken,dstTokenAddress:e.ask_dstToken,exchangeAddress:e.exchange,twapAddress:e.twapAddress,maker:e.maker,progress:u,dstAmountFilled:l,srcAmountFilled:c,orderDollarValueIn:G(e.dollarValueIn||0).toFixed(6),srcAmount:e.ask_srcAmount,dstMinAmountTotal:G(e.ask_dstMinAmount).multipliedBy(a).toString(),fills:s,fillDelay:e.ask_fillDelay,deadline:e.ask_deadline*1e3,createdAt:new Date(e.timestamp).getTime(),dstMinAmountPerTrade:G(e.ask_dstMinAmount).eq(1)?"":e.ask_dstMinAmount,triggerPricePerTrade:"",srcAmountPerTrade:e.ask_srcBidAmount,txHash:e.transactionHash,totalTradesAmount:a,isMarketPrice:[Re.TWAP_MARKET].includes(d),chainId:t,filledOrderTimestamp:i||0,status:n,rawOrder:e}},Hw=e=>{var d;if(!e)return"";const t=vn(e.accounts,f=>`"${f.toLowerCase()}"`),r=vn(nw(e.configs),f=>`"${f.toLowerCase()}"`),n=vn(e.inTokenSymbols,f=>`"${f.toUpperCase()}"`),s=vn(e.outTokenSymbols,f=>`"${f.toUpperCase()}"`),a=vn(e.inTokenAddresses,f=>`"${f.toLowerCase()}"`),o=vn(e.outTokenAddresses,f=>`"${f.toLowerCase()}"`),i=vn(e.transactionHashes,f=>`"${f.toLowerCase()}"`),c=vn(e.orderIds,f=>`"${f}"`),l=r!=null&&r.length?"":vn((d=e.configs)==null?void 0:d.map(f=>f.twapAddress),f=>`"${f.toLowerCase()}"`),u=e.minDollarValueIn;return[r?`exchange_in: [${r.join(", ")}]`:"",l?`twapAddress_in: [${l.join(", ")}]`:"",t?`maker_in: [${t.join(", ")}]`:"",i?`transactionHash_in: [${i.join(", ")}]`:"",c?`Contract_id_in: [${c.join(", ")}]`:"",u?`dollarValueIn_gte: ${u}`:"",n?`srcTokenSymbol_in: [${n.join(", ")}]`:"",s?`dstTokenSymbol_in: [${s.join(", ")}]`:"",a?`srcTokenAddress_in: [${a.join(", ")}]`:"",o?`dstTokenAddress_in: [${o.join(", ")}]`:"",e!=null&&e.startDate?`blockTimestamp_gte: ${e.startDate}`:"",e!=null&&e.endDate?`blockTimestamp_lte: ${e.endDate}`:"",(e==null?void 0:e.orderType)==="limit"?"ask_dstMinAmount_gt: 1":"",(e==null?void 0:e.orderType)==="market"?"ask_dstMinAmount_lte: 1":""].filter(Boolean).join(", ")};async function $w({chainId:e,signal:t,page:r,limit:n,filters:s}){const a=n||1e3,o=Hw(s);return await Ed({chainId:e,signal:t,limit:a,page:r,buildQuery:(c,l)=>`
2
2
  {
3
3
  orderCreateds(
4
4
  ${o?`where: { ${o} }`:""},
@@ -61,7 +61,7 @@
61
61
  dollarValueOut
62
62
  }
63
63
  }
64
- `,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class Vw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Ww=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{try{const a=await $w({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([jw({chainId:e,orders:a,signal:t}),Gw({chainId:e,orders:a,signal:t})]),c=a.map(u=>{const d=o==null?void 0:o.filter(f=>f.TWAP_id===Number(u.Contract_id)&&Ds(f.exchange,u.exchange)&&Ds(f.twapAddress,u.twapAddress));return Rw(u,e,d,qw(u,d||[],i))}).sort((u,d)=>d.createdAt-u.createdAt),l=new Set;return c.filter(u=>l.has(u.id)?!1:(l.add(u.id),!0))}catch{return[]}},qw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ds(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Uh(t).reduce((c,l)=>c.plus(l.inAmount),new G(0)).toFixed(),o=_h(e.ask_srcAmount,a);return Kw(o,e.ask_deadline*1e3,n)},_h=(e,t)=>{if(!t||!e)return 0;const r=G(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Kw=(e,t,r)=>e===100?ut.Completed:r==="CANCELLED"?ut.Cancelled:r==="COMPLETED"?ut.Completed:t>Date.now()?ut.Open:ut.Expired,Mh=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Ww({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:s.twapConfig?[s.twapConfig]:[]}}):Promise.resolve([]),Lw({chainId:r,signal:e,account:a,exchange:s==null?void 0:s.adapter})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Yw={version:"0.0.107"};var Ba=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Zw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xw=(B5=class{constructor(){le(this,bn,Zw);le(this,ba,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,ba)&&e!==N(this,bn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,bn),provider:e}),J(this,bn,e),process.env.NODE_ENV!=="production"&&J(this,ba,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&J(this,ba,!0),N(this,bn).setTimeout(e,t)}clearTimeout(e){N(this,bn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&J(this,ba,!0),N(this,bn).setInterval(e,t)}clearInterval(e){N(this,bn).clearInterval(e)}},bn=new WeakMap,ba=new WeakMap,B5),Ns=new Xw;function Qw(e){setTimeout(e,0)}var Ls=typeof window>"u"||"Deno"in globalThis;function Gt(){}function Jw(e,t){return typeof e=="function"?e(t):e}function Cd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jn(e,t){return typeof e=="function"?e(t):e}function wr(e,t){return typeof e=="function"?e(t):e}function Lh(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==Td(o,t.options))return!1}else if(!Ho(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function zh(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(zs(t.options.mutationKey)!==zs(a))return!1}else if(!Ho(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Td(e,t){return((t==null?void 0:t.queryKeyHashFn)||zs)(e)}function zs(e){return JSON.stringify(e,(t,r)=>Sd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Ho(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ho(e[r],t[r])):!1}var e3=Object.prototype.hasOwnProperty;function Ad(e,t){if(e===t)return e;const r=Rh(e)&&Rh(t);if(!r&&!(Sd(e)&&Sd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:e3.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=Ad(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Lc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Rh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sd(e){if(!Hh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Hh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Hh(e){return Object.prototype.toString.call(e)==="[object Object]"}function t3(e){return new Promise(t=>{Ns.setTimeout(t,e)})}function Pd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ad(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Ad(e,t)}return t}function r3(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function n3(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var zc=Symbol();function $h(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===zc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gh(e,t){return typeof e=="function"?e(...t):!!e}var s3=(F5=class extends Ba{constructor(){super();le(this,ya);le(this,ks);le(this,Ao);J(this,Ao,t=>{if(!Ls&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,ks)||this.setEventListener(N(this,Ao))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,ks))==null||t.call(this),J(this,ks,void 0))}setEventListener(t){var r;J(this,Ao,t),(r=N(this,ks))==null||r.call(this),J(this,ks,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,ya)!==t&&(J(this,ya,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,ya)=="boolean"?N(this,ya):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ya=new WeakMap,ks=new WeakMap,Ao=new WeakMap,F5),Id=new s3;function Bd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var a3=Qw;function o3(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=a3;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=o3(),i3=(O5=class extends Ba{constructor(){super();le(this,So,!0);le(this,Cs);le(this,Po);J(this,Po,t=>{if(!Ls&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,Cs)||this.setEventListener(N(this,Po))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Cs))==null||t.call(this),J(this,Cs,void 0))}setEventListener(t){var r;J(this,Po,t),(r=N(this,Cs))==null||r.call(this),J(this,Cs,t(this.setOnline.bind(this)))}setOnline(t){N(this,So)!==t&&(J(this,So,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,So)}},So=new WeakMap,Cs=new WeakMap,Po=new WeakMap,O5),Rc=new i3;function c3(e){return Math.min(1e3*2**e,3e4)}function jh(e){return(e??"online")==="online"?Rc.isOnline():!0}var Fd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vh(e){let t=!1,r=0,n;const s=Bd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new Fd(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>Id.isFocused()&&(e.networkMode==="always"||Rc.isOnline())&&e.canRun(),u=()=>jh(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},m=()=>new Promise(g=>{var E;n=v=>{(a()||l())&&g(v)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Ls?0:3),S=e.retryDelay??c3,T=typeof S=="function"?S(r,v):S,O=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,v);if(t||!O){f(v);return}r++,(L=e.onFail)==null||L.call(e,r,v),t3(T).then(()=>l()?void 0:m()).then(()=>{t?f(v):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():m().then(b),s)}}var Wh=(U5=class{constructor(){le(this,ga)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cd(this.gcTime)&&J(this,ga,Ns.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ls?1/0:300*1e3))}clearGcTimeout(){N(this,ga)&&(Ns.clearTimeout(N(this,ga)),J(this,ga,void 0))}},ga=new WeakMap,U5),l3=(D5=class extends Wh{constructor(t){super();le(this,Xr);le(this,xa);le(this,Io);le(this,Fr);le(this,wa);le(this,Bt);le(this,Sc);le(this,va);J(this,va,!1),J(this,Sc,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,wa,t.client),J(this,Fr,N(this,wa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,xa,Yh(this.options)),this.state=t.state??N(this,xa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,Sc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Yh(this.options);r.data!==void 0&&(this.setState(Kh(r.data,r.dataUpdatedAt)),J(this,xa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Fr).remove(this)}setData(t,r){const n=Pd(this.state.data,t,this.options);return Se(this,Xr,Zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Se(this,Xr,Zn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,xa))}isActive(){return this.observers.some(t=>wr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Jn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Nh(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,va)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Xr,Zn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,m,b,g,E,v,w,S;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(O=>O.options.queryFn);T&&this.setOptions(T.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(J(this,va,!0),n.signal)})},a=()=>{const T=$h(this.options,r),L=(()=>{const P={client:N(this,wa),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return J(this,va,!1),this.options.persister?this.options.persister(T,L,this):T(L)},i=(()=>{const T={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,wa),state:this.state,fetchFn:a};return s(T),T})();(l=this.options.behavior)==null||l.onFetch(i,this),J(this,Io,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Xr,Zn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),J(this,Bt,Vh({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof Fd&&T.revert&&this.setState({...N(this,Io),fetchStatus:"idle"}),n.abort()},onFail:(T,O)=>{Se(this,Xr,Zn).call(this,{type:"failed",failureCount:T,error:O})},onPause:()=>{Se(this,Xr,Zn).call(this,{type:"pause"})},onContinue:()=>{Se(this,Xr,Zn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const T=await N(this,Bt).start();if(T===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(T),(m=(f=N(this,Fr).config).onSuccess)==null||m.call(f,T,this),(g=(b=N(this,Fr).config).onSettled)==null||g.call(b,T,this.state.error,this),T}catch(T){if(T instanceof Fd){if(T.silent)return N(this,Bt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Se(this,Xr,Zn).call(this,{type:"error",error:T}),(v=(E=N(this,Fr).config).onError)==null||v.call(E,T,this),(S=(w=N(this,Fr).config).onSettled)==null||S.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},xa=new WeakMap,Io=new WeakMap,Fr=new WeakMap,wa=new WeakMap,Bt=new WeakMap,Sc=new WeakMap,va=new WeakMap,Xr=new WeakSet,Zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qh(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Kh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,Io,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Fr).notify({query:this,type:"updated",action:t})})},D5);function qh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Yh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var u3=(_5=class extends Ba{constructor(t,r){super();le(this,We);le(this,nr);le(this,_e);le(this,Pc);le(this,Wt);le(this,Ea);le(this,Bo);le(this,Vn);le(this,Ts);le(this,Ic);le(this,Fo);le(this,Oo);le(this,ka);le(this,Ca);le(this,As);le(this,Uo,new Set);this.options=r,J(this,nr,t),J(this,Ts,null),J(this,Vn,Bd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,_e).addObserver(this),Zh(N(this,_e),this.options)?Se(this,We,Oc).call(this):this.updateResult(),Se(this,We,Om).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Od(N(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Od(N(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,We,Um).call(this),Se(this,We,Dm).call(this),N(this,_e).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,_e);if(this.options=N(this,nr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wr(this.options.enabled,N(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,We,_m).call(this),N(this,_e).setOptions(this.options),r._defaulted&&!Lc(this.options,r)&&N(this,nr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,_e),observer:this});const s=this.hasListeners();s&&Xh(N(this,_e),n,this.options,r)&&Se(this,We,Oc).call(this),this.updateResult(),s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||Jn(this.options.staleTime,N(this,_e))!==Jn(r.staleTime,N(this,_e)))&&Se(this,We,Im).call(this);const a=Se(this,We,Bm).call(this);s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||a!==N(this,As))&&Se(this,We,Fm).call(this,a)}getOptimisticResult(t){const r=N(this,nr).getQueryCache().build(N(this,nr),t),n=this.createResult(r,t);return p3(this,n)&&(J(this,Wt,n),J(this,Bo,this.options),J(this,Ea,N(this,_e).state)),n}getCurrentResult(){return N(this,Wt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Vn).status==="pending"&&N(this,Vn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,Uo).add(t)}getCurrentQuery(){return N(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,nr).defaultQueryOptions(t),n=N(this,nr).getQueryCache().build(N(this,nr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,We,Oc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Wt)))}createResult(t,r){var y;const n=N(this,_e),s=this.options,a=N(this,Wt),o=N(this,Ea),i=N(this,Bo),l=t!==n?t.state:N(this,Pc),{state:u}=t;let d={...u},f=!1,m;if(r._optimisticResults){const x=this.hasListeners(),A=!x&&Zh(t,r),B=x&&Xh(t,n,r,s);(A||B)&&(d={...d,...qh(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:E}=d;m=d.data;let v=!1;if(r.placeholderData!==void 0&&m===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof r.placeholderData=="function"?r.placeholderData((y=N(this,Oo))==null?void 0:y.state.data,N(this,Oo)):r.placeholderData,x!==void 0&&(E="success",m=Pd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&r.select===N(this,Ic))m=N(this,Fo);else try{J(this,Ic,r.select),m=r.select(m),m=Pd(a==null?void 0:a.data,m,r),J(this,Fo,m),J(this,Ts,null)}catch(x){J(this,Ts,x)}N(this,Ts)&&(b=N(this,Ts),m=N(this,Fo),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",S=E==="pending",T=E==="error",O=S&&w,L=m!==void 0,h={status:E,fetchStatus:d.fetchStatus,isPending:S,isSuccess:E==="success",isError:T,isInitialLoading:O,isLoading:O,data:m,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:T&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&L,isStale:Ud(t,r),refetch:this.refetch,promise:N(this,Vn),isEnabled:wr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{h.status==="error"?F.reject(h.error):h.data!==void 0&&F.resolve(h.data)},A=()=>{const F=J(this,Vn,h.promise=Bd());x(F)},B=N(this,Vn);switch(B.status){case"pending":t.queryHash===n.queryHash&&x(B);break;case"fulfilled":(h.status==="error"||h.data!==B.value)&&A();break;case"rejected":(h.status!=="error"||h.error!==B.reason)&&A();break}}return h}updateResult(){const t=N(this,Wt),r=this.createResult(N(this,_e),this.options);if(J(this,Ea,N(this,_e).state),J(this,Bo,this.options),N(this,Ea).data!==void 0&&J(this,Oo,N(this,_e)),Lc(r,t))return;J(this,Wt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,Uo).size)return!0;const o=new Set(a??N(this,Uo));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,Wt)).some(i=>{const c=i;return N(this,Wt)[c]!==t[c]&&o.has(c)})};Se(this,We,K5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,We,Om).call(this)}},nr=new WeakMap,_e=new WeakMap,Pc=new WeakMap,Wt=new WeakMap,Ea=new WeakMap,Bo=new WeakMap,Vn=new WeakMap,Ts=new WeakMap,Ic=new WeakMap,Fo=new WeakMap,Oo=new WeakMap,ka=new WeakMap,Ca=new WeakMap,As=new WeakMap,Uo=new WeakMap,We=new WeakSet,Oc=function(t){Se(this,We,_m).call(this);let r=N(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},Im=function(){Se(this,We,Um).call(this);const t=Jn(this.options.staleTime,N(this,_e));if(Ls||N(this,Wt).isStale||!Cd(t))return;const n=Nh(N(this,Wt).dataUpdatedAt,t)+1;J(this,ka,Ns.setTimeout(()=>{N(this,Wt).isStale||this.updateResult()},n))},Bm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,_e)):this.options.refetchInterval)??!1},Fm=function(t){Se(this,We,Dm).call(this),J(this,As,t),!(Ls||wr(this.options.enabled,N(this,_e))===!1||!Cd(N(this,As))||N(this,As)===0)&&J(this,Ca,Ns.setInterval(()=>{(this.options.refetchIntervalInBackground||Id.isFocused())&&Se(this,We,Oc).call(this)},N(this,As)))},Om=function(){Se(this,We,Im).call(this),Se(this,We,Fm).call(this,Se(this,We,Bm).call(this))},Um=function(){N(this,ka)&&(Ns.clearTimeout(N(this,ka)),J(this,ka,void 0))},Dm=function(){N(this,Ca)&&(Ns.clearInterval(N(this,Ca)),J(this,Ca,void 0))},_m=function(){const t=N(this,nr).getQueryCache().build(N(this,nr),this.options);if(t===N(this,_e))return;const r=N(this,_e);J(this,_e,t),J(this,Pc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},K5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,Wt))}),N(this,nr).getQueryCache().notify({query:N(this,_e),type:"observerResultsUpdated"})})},_5);function d3(e,t){return wr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zh(e,t){return d3(e,t)||e.state.data!==void 0&&Od(e,t,t.refetchOnMount)}function Od(e,t,r){if(wr(t.enabled,e)!==!1&&Jn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ud(e,t)}return!1}function Xh(e,t,r,n){return(e!==t||wr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ud(e,r)}function Ud(e,t){return wr(t.enabled,e)!==!1&&e.isStaleByTime(Jn(t.staleTime,e))}function p3(e,t){return!Lc(e.getCurrentResult(),t)}function Qh(e){return{onFetch:(t,r)=>{var u,d,f,m,b;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=$h(t.options,t.fetchOptions),w=async(S,T,O)=>{if(g)return Promise.reject();if(T==null&&S.pages.length)return Promise.resolve(S);const P=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:T,direction:O?"backward":"forward",meta:t.options.meta};return E(A),A})(),h=await v(P),{maxPages:y}=t.options,x=O?n3:r3;return{pages:x(S.pages,h,y),pageParams:x(S.pageParams,T,y)}};if(s&&a.length){const S=s==="backward",T=S?f3:Jh,O={pages:a,pageParams:o},L=T(n,O);i=await w(O,L,S)}else{const S=e??a.length;do{const T=c===0?o[0]??n.initialPageParam:Jh(n,i);if(c>0&&T==null)break;i=await w(i,T),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Jh(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function f3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var m3=(M5=class extends Wh{constructor(t){super();le(this,gn);le(this,Bc);le(this,yn);le(this,qt);le(this,Ta);J(this,Bc,t.client),this.mutationId=t.mutationId,J(this,qt,t.mutationCache),J(this,yn,[]),this.state=t.state||e1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,yn).includes(t)||(N(this,yn).push(t),this.clearGcTimeout(),N(this,qt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,yn,N(this,yn).filter(r=>r!==t)),this.scheduleGc(),N(this,qt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,yn).length||(this.state.status==="pending"?this.scheduleGc():N(this,qt).remove(this))}continue(){var t;return((t=N(this,Ta))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,b,g,E,v,w,S,T,O,L,P,h,y;const r=()=>{Se(this,gn,Fs).call(this,{type:"continue"})},n={client:N(this,Bc),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,Ta,Vh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,A)=>{Se(this,gn,Fs).call(this,{type:"failed",failureCount:x,error:A})},onPause:()=>{Se(this,gn,Fs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,qt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,Ta).canStart();try{if(s)r();else{Se(this,gn,Fs).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,qt).config).onMutate)==null?void 0:i.call(o,t,this,n));const A=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));A!==this.state.context&&Se(this,gn,Fs).call(this,{type:"pending",context:A,variables:t,isPaused:a})}const x=await N(this,Ta).start();return await((d=(u=N(this,qt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,n)),await((g=(b=N(this,qt).config).onSettled)==null?void 0:g.call(b,x,null,this.state.variables,this.state.context,this,n)),await((v=(E=this.options).onSettled)==null?void 0:v.call(E,x,null,t,this.state.context,n)),Se(this,gn,Fs).call(this,{type:"success",data:x}),x}catch(x){try{throw await((S=(w=N(this,qt).config).onError)==null?void 0:S.call(w,x,t,this.state.context,this,n)),await((O=(T=this.options).onError)==null?void 0:O.call(T,x,t,this.state.context,n)),await((P=(L=N(this,qt).config).onSettled)==null?void 0:P.call(L,void 0,x,this.state.variables,this.state.context,this,n)),await((y=(h=this.options).onSettled)==null?void 0:y.call(h,void 0,x,t,this.state.context,n)),x}finally{Se(this,gn,Fs).call(this,{type:"error",error:x})}}finally{N(this,qt).runNext(this)}}},Bc=new WeakMap,yn=new WeakMap,qt=new WeakMap,Ta=new WeakMap,gn=new WeakSet,Fs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{N(this,yn).forEach(n=>{n.onMutationUpdate(t)}),N(this,qt).notify({mutation:this,type:"updated",action:t})})},M5);function e1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var h3=(N5=class extends Ba{constructor(t={}){super();le(this,Wn);le(this,Qr);le(this,Fc);this.config=t,J(this,Wn,new Set),J(this,Qr,new Map),J(this,Fc,0)}build(t,r,n){const s=new m3({client:t,mutationCache:this,mutationId:++rd(this,Fc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,Wn).add(t);const r=Hc(t);if(typeof r=="string"){const n=N(this,Qr).get(r);n?n.push(t):N(this,Qr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,Wn).delete(t)){const r=Hc(t);if(typeof r=="string"){const n=N(this,Qr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Qr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Hc(t);if(typeof r=="string"){const n=N(this,Qr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Hc(t);if(typeof r=="string"){const s=(n=N(this,Qr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,Wn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,Wn).clear(),N(this,Qr).clear()})}getAll(){return Array.from(N(this,Wn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>zh(r,n))}findAll(t={}){return this.getAll().filter(r=>zh(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Gt))))}},Wn=new WeakMap,Qr=new WeakMap,Fc=new WeakMap,N5);function Hc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var b3=(L5=class extends Ba{constructor(t,r){super();le(this,Yn);le(this,qn);le(this,Ss);le(this,sr);le(this,Kn);J(this,qn,t),this.setOptions(r),this.bindMethods(),Se(this,Yn,nd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,qn).defaultMutationOptions(t),Lc(this.options,r)||N(this,qn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,sr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&zs(r.mutationKey)!==zs(this.options.mutationKey)?this.reset():((n=N(this,sr))==null?void 0:n.state.status)==="pending"&&N(this,sr).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,sr))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,Yn,nd).call(this),Se(this,Yn,Mm).call(this,t)}getCurrentResult(){return N(this,Ss)}reset(){var t;(t=N(this,sr))==null||t.removeObserver(this),J(this,sr,void 0),Se(this,Yn,nd).call(this),Se(this,Yn,Mm).call(this)}mutate(t,r){var n;return J(this,Kn,r),(n=N(this,sr))==null||n.removeObserver(this),J(this,sr,N(this,qn).getMutationCache().build(N(this,qn),this.options)),N(this,sr).addObserver(this),N(this,sr).execute(t)}},qn=new WeakMap,Ss=new WeakMap,sr=new WeakMap,Kn=new WeakMap,Yn=new WeakSet,nd=function(){var r;const t=((r=N(this,sr))==null?void 0:r.state)??e1();J(this,Ss,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Mm=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Kn)&&this.hasListeners()){const u=N(this,Ss).variables,d=N(this,Ss).context,f={client:N(this,qn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Kn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Kn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Kn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Kn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Ss))})})},L5),y3=(z5=class extends Ba{constructor(t={}){super();le(this,xn);this.config=t,J(this,xn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??Td(s,r);let o=this.get(a);return o||(o=new l3({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,xn).has(t.queryHash)||(N(this,xn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,xn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,xn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,xn).get(t)}getAll(){return[...N(this,xn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Lh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Lh(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},xn=new WeakMap,z5),g3=(R5=class{constructor(e={}){le(this,mt);le(this,Ps);le(this,Is);le(this,Do);le(this,_o);le(this,Bs);le(this,Mo);le(this,No);J(this,mt,e.queryCache||new y3),J(this,Ps,e.mutationCache||new h3),J(this,Is,e.defaultOptions||{}),J(this,Do,new Map),J(this,_o,new Map),J(this,Bs,0)}mount(){rd(this,Bs)._++,N(this,Bs)===1&&(J(this,Mo,Id.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,mt).onFocus())})),J(this,No,Rc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,mt).onOnline())})))}unmount(){var e,t;rd(this,Bs)._--,N(this,Bs)===0&&((e=N(this,Mo))==null||e.call(this),J(this,Mo,void 0),(t=N(this,No))==null||t.call(this),J(this,No,void 0))}isFetching(e){return N(this,mt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Ps).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,mt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,mt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Jn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,mt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,mt).get(n.queryHash),a=s==null?void 0:s.state.data,o=Jw(t,a);if(o!==void 0)return N(this,mt).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>N(this,mt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,mt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,mt);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,mt);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>N(this,mt).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Gt).catch(Gt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,mt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>N(this,mt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,mt).build(this,t);return r.isStaleByTime(Jn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e.behavior=Qh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e.behavior=Qh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rc.isOnline()?N(this,Ps).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,mt)}getMutationCache(){return N(this,Ps)}getDefaultOptions(){return N(this,Is)}setDefaultOptions(e){J(this,Is,e)}setQueryDefaults(e,t){N(this,Do).set(zs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Do).values()],r={};return t.forEach(n=>{Ho(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,_o).set(zs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,_o).values()],r={};return t.forEach(n=>{Ho(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Is).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Td(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Is).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,mt).clear(),N(this,Ps).clear()}},mt=new WeakMap,Ps=new WeakMap,Is=new WeakMap,Do=new WeakMap,_o=new WeakMap,Bs=new WeakMap,Mo=new WeakMap,No=new WeakMap,R5),t1=Et.createContext(void 0),Dd=e=>{const t=Et.useContext(t1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},x3=({client:e,children:t})=>(Et.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),C.jsx(t1.Provider,{value:e,children:t})),r1=Et.createContext(!1),w3=()=>Et.useContext(r1);r1.Provider;function v3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E3=Et.createContext(v3()),k3=()=>Et.useContext(E3),C3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},T3=e=>{Et.useEffect(()=>{e.clearReset()},[e])},A3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Gh(r,[e.error,n])),S3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},P3=(e,t)=>e.isLoading&&e.isFetching&&!t,I3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,n1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function B3(e,t,r){var d,f,m,b,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=w3(),s=k3(),a=Dd(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",S3(o),C3(o,s),T3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=Et.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(Et.useSyncExternalStore(Et.useCallback(E=>{const v=u?c.subscribe(kt.batchCalls(E)):Gt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Et.useEffect(()=>{c.setOptions(o)},[o,c]),I3(o,l))throw n1(o,c,s);if(A3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((b=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||b.call(m,o,l),o.experimental_prefetchInRender&&!Ls&&P3(l,n)){const E=i?n1(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(Gt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function F3(e,t){return B3(e,u3)}function en(e,t){const r=Dd(),[n]=Et.useState(()=>new b3(r,e));Et.useEffect(()=>{n.setOptions(e)},[n,e]);const s=Et.useSyncExternalStore(Et.useCallback(o=>n.subscribe(kt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=Et.useCallback((o,i)=>{n.mutate(o,i).catch(Gt)},[n]);if(s.error&&Gh(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const O3=M.createContext(null),_d={didCatch:!1,error:null};class U3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_d}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(_d)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&D3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(_d)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(O3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function D3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const s1=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(m=>m(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},_3=(e=>e?s1(e):s1),M3=e=>e;function N3(e,t=M3){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const a1=e=>{const t=_3(e),r=n=>N3(t,n);return Object.assign(r,t),r},L3=(e=>e?a1(e):a1),Md={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},ee=L3((e,t)=>({state:Md,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...Md.swapExecution,...r}}})),resetState:r=>{e({state:{...Md,currentTime:Date.now(),swapExecution:{...t().state.swapExecution,acceptedMarketPrice:void 0,acceptedSrcAmount:void 0},isMarketOrder:t().state.isMarketOrder,...r}}),setTimeout(()=>{t().resetSwapExecution()},1e3)}}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Le=e=>`orbs_${e}`;function $o({children:e,className:t=""}){return C.jsx("p",{className:`${t} ${Le("Text")}`,children:e})}const o1=M.createContext({});function z3({children:e,...t}){return C.jsx(o1.Provider,{value:t,children:e})}const tn=()=>M.useContext(o1);var pt=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(pt||{});const R3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return C.jsx("div",{className:`${Le("Spinner")} ${e}`,style:a})};function $c({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return C.jsxs("div",{className:`${Le("TradeStepLayout")} ${e}`,children:[C.jsxs("div",{className:Le("TradeStepLayoutHeader"),children:[C.jsx(V3,{}),s&&C.jsx($o,{className:Le("TradeStepLayoutTitle"),children:s})]}),t&&C.jsx("div",{className:Le("TradeStepLayoutBody"),children:t}),C.jsx(H3,{link:r,text:n}),a]})}const H3=({link:e,text:t})=>{const{swapStatus:r}=tn();return!e&&!t?null:C.jsxs("div",{className:Le("TradeStepLayoutFooter"),children:[C.jsx(q3,{}),e?C.jsx($3,{link:e,text:t}):r===pt.FAILED?void 0:C.jsx($o,{children:t})]})},$3=({link:e,text:t})=>C.jsx("a",{target:"_blank",className:Le("TradeStepLayoutFooterLink"),href:e,children:t});function G3(){const{components:e}=tn();return e.SuccessIcon?e.SuccessIcon:C.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Le("TradeStepLayoutSuccessIcon"),children:[C.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),C.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function j3(){const{components:e}=tn();return e.FailedIcon?e.FailedIcon:C.jsxs("svg",{className:Le("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[C.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),C.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const V3=()=>{const{swapStatus:e}=tn();return e===pt.SUCCESS?C.jsx(G3,{}):e===pt.FAILED?C.jsx(j3,{}):C.jsx(W3,{})},W3=()=>{const{components:e}=tn();return e.Loader?e.Loader:C.jsx(R3,{size:60,borderWidth:5,className:Le("TradeStepLayoutSpinner")})},q3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=tn();return r!==pt.LOADING||e===1?null:C.jsx("div",{className:Le("StepIndicator"),children:C.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Le("StepIndicatorLine")})})},K3=({error:e,footerLink:t,footerText:r})=>C.jsx($c,{footerLink:t,footerText:r,body:e||C.jsx("p",{className:Le("FailedContentMsg"),children:"Something went wrong"}),className:Le("FailedContent")});function Y3(){return C.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Le("TradepPreviewIcon"),children:C.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const i1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=tn();return C.jsxs("div",{className:Le("TradePreview"),children:[C.jsx(c1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&C.jsxs(C.Fragment,{children:[C.jsx(Y3,{}),C.jsx(c1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},c1=({token:e,amount:t,Logo:r})=>C.jsxs("div",{className:Le("TradePreviewToken"),children:[r||C.jsx("img",{src:e==null?void 0:e.logoUrl,className:Le("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),C.jsxs($o,{children:[t," ",e==null?void 0:e.symbol]})]});function Z3({title:e,footerLink:t,footerText:r,hideTokens:n}){return C.jsx($c,{title:e,className:Le("Success"),body:!n&&C.jsx(i1,{}),footerLink:t,footerText:r})}const l1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return C.jsx("div",{className:`${Le("FlexColumn")} ${n}`,style:a,children:r})};function u1({styles:e={},className:t=""}){return C.jsx("div",{style:e,className:`${Le("SkeletonLoader")} ${t}`})}const X3=()=>C.jsxs("div",{className:`${Le("MainContentLoader")}`,children:[C.jsx(u1,{className:`${Le("MainContentCircleLoader")}`}),C.jsx(u1,{className:`${Le("MainContentRectengularLoader")}`})]}),Q3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=tn(),d=C.jsx(p1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?C.jsx(J3,{}):C.jsxs(l1,{children:[d,C.jsx(X3,{})]}):C.jsx(l1,{children:d})},d1=({amount:e,token:t,usd:r,title:n,Logo:s})=>C.jsxs("div",{className:`${Le("MainToken")}`,children:[C.jsxs("div",{className:`${Le("MainTokenLeft")}`,children:[C.jsx($o,{className:`${Le("MainTokenTitle")}`,children:n}),C.jsx($o,{className:` ${Le("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&C.jsx("div",{className:` ${Le("MainTokenUsd")}`,children:r})]}),s||C.jsx("div",{className:` ${Le("MainTokenLogo")}`,children:t!=null&&t.logoUrl?C.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function J3(){const{currentStep:e}=tn();return e?C.jsx($c,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:C.jsx(i1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const p1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>C.jsxs("div",{className:`${Le("Main")}`,children:[C.jsx(d1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),C.jsx(d1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),es=e=>C.jsx(z3,{...e,children:C.jsx(e8,{})}),e8=()=>{const{swapStatus:e,components:t,className:r}=tn();return C.jsx("div",{className:`${Le("SwapFlow")} ${r}`,children:e===pt.SUCCESS?t==null?void 0:t.Success:e===pt.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};es.Success=Z3,es.Failed=K3,es.Main=Q3,es.StepLayout=$c;var Rs=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Rs||{});const t8="1.2.3";let Yt=class Nm extends Error{constructor(t,r={}){var o;const n=r.cause instanceof Nm?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,s=r.cause instanceof Nm&&r.cause.docsPath||r.docsPath,a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${t8}`].join(`
64
+ `,extractResults:d=>{var f;return(((f=d.data)==null?void 0:f.orderFilleds)||[]).map(m=>({...m,timestamp:new Date(m.timestamp).getTime()}))}})};class Vw extends Error{constructor(){super("No graph endpoint found"),this.name="NoGraphEndpointError"}}const Ww=async({chainId:e,signal:t,page:r,limit:n,filters:s})=>{try{const a=await $w({chainId:e,signal:t,page:r,limit:n,filters:s}),[o,i]=await Promise.all([jw({chainId:e,orders:a,signal:t}),Gw({chainId:e,orders:a,signal:t})]),c=a.map(u=>{const d=o==null?void 0:o.filter(f=>f.TWAP_id===Number(u.Contract_id)&&Ds(f.exchange,u.exchange)&&Ds(f.twapAddress,u.twapAddress));return Rw(u,e,d,qw(u,d||[],i))}).sort((u,d)=>d.createdAt-u.createdAt),l=new Set;return c.filter(u=>l.has(u.id)?!1:(l.add(u.id),!0))}catch{return[]}},qw=(e,t,r)=>{var i;const n=(i=r==null?void 0:r.find(c=>c.twapId===e.Contract_id.toString()&&Ds(c.twapAddress,e.twapAddress)))==null?void 0:i.status,a=Uh(t).reduce((c,l)=>c.plus(l.inAmount),new G(0)).toFixed(),o=_h(e.ask_srcAmount,a);return Kw(o,e.ask_deadline*1e3,n)},_h=(e,t)=>{if(!t||!e)return 0;const r=G(t).dividedBy(e).toNumber();return r>=.99?100:r<=0?0:Number((r*100).toFixed(2))},Kw=(e,t,r)=>e===100?ut.Completed:r==="CANCELLED"?ut.Cancelled:r==="COMPLETED"?ut.Completed:t>Date.now()?ut.Open:ut.Expired,Mh=async({signal:e,page:t,chainId:r,limit:n,config:s,account:a})=>(await Promise.all([s?Ww({chainId:r,signal:e,page:t,limit:n,filters:{accounts:[a],configs:s.twapConfig?[s.twapConfig]:[]}}):Promise.resolve([]),Lw({chainId:r,signal:e,account:a,exchange:s==null?void 0:s.adapter})]).then(([c,l])=>[...c,...l])).sort((c,l)=>l.createdAt-c.createdAt),Yw={version:"0.0.108"};var Ba=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Zw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xw=(B5=class{constructor(){le(this,bn,Zw);le(this,ba,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&N(this,ba)&&e!==N(this,bn)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:N(this,bn),provider:e}),J(this,bn,e),process.env.NODE_ENV!=="production"&&J(this,ba,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&J(this,ba,!0),N(this,bn).setTimeout(e,t)}clearTimeout(e){N(this,bn).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&J(this,ba,!0),N(this,bn).setInterval(e,t)}clearInterval(e){N(this,bn).clearInterval(e)}},bn=new WeakMap,ba=new WeakMap,B5),Ns=new Xw;function Qw(e){setTimeout(e,0)}var Ls=typeof window>"u"||"Deno"in globalThis;function Gt(){}function Jw(e,t){return typeof e=="function"?e(t):e}function Cd(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jn(e,t){return typeof e=="function"?e(t):e}function wr(e,t){return typeof e=="function"?e(t):e}function Lh(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:i}=e;if(o){if(n){if(t.queryHash!==Td(o,t.options))return!1}else if(!Ho(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||a&&!a(t))}function zh(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(zs(t.options.mutationKey)!==zs(a))return!1}else if(!Ho(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Td(e,t){return((t==null?void 0:t.queryKeyHashFn)||zs)(e)}function zs(e){return JSON.stringify(e,(t,r)=>Sd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Ho(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ho(e[r],t[r])):!1}var e3=Object.prototype.hasOwnProperty;function Ad(e,t){if(e===t)return e;const r=Rh(e)&&Rh(t);if(!r&&!(Sd(e)&&Sd(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,i=r?new Array(o):{};let c=0;for(let l=0;l<o;l++){const u=r?l:a[l],d=e[u],f=t[u];if(d===f){i[u]=d,(r?l<s:e3.call(e,u))&&c++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){i[u]=f;continue}const m=Ad(d,f);i[u]=m,m===d&&c++}return s===o&&c===s?e:i}function Lc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Rh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sd(e){if(!Hh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Hh(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Hh(e){return Object.prototype.toString.call(e)==="[object Object]"}function t3(e){return new Promise(t=>{Ns.setTimeout(t,e)})}function Pd(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ad(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Ad(e,t)}return t}function r3(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function n3(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var zc=Symbol();function $h(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===zc&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gh(e,t){return typeof e=="function"?e(...t):!!e}var s3=(F5=class extends Ba{constructor(){super();le(this,ya);le(this,ks);le(this,Ao);J(this,Ao,t=>{if(!Ls&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,ks)||this.setEventListener(N(this,Ao))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,ks))==null||t.call(this),J(this,ks,void 0))}setEventListener(t){var r;J(this,Ao,t),(r=N(this,ks))==null||r.call(this),J(this,ks,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){N(this,ya)!==t&&(J(this,ya,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof N(this,ya)=="boolean"?N(this,ya):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ya=new WeakMap,ks=new WeakMap,Ao=new WeakMap,F5),Id=new s3;function Bd(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var a3=Qw;function o3(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=a3;const a=i=>{t?e.push(i):s(()=>{r(i)})},o=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||o()}return c},batchCalls:i=>(...c)=>{a(()=>{i(...c)})},schedule:a,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=o3(),i3=(O5=class extends Ba{constructor(){super();le(this,So,!0);le(this,Cs);le(this,Po);J(this,Po,t=>{if(!Ls&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){N(this,Cs)||this.setEventListener(N(this,Po))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Cs))==null||t.call(this),J(this,Cs,void 0))}setEventListener(t){var r;J(this,Po,t),(r=N(this,Cs))==null||r.call(this),J(this,Cs,t(this.setOnline.bind(this)))}setOnline(t){N(this,So)!==t&&(J(this,So,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return N(this,So)}},So=new WeakMap,Cs=new WeakMap,Po=new WeakMap,O5),Rc=new i3;function c3(e){return Math.min(1e3*2**e,3e4)}function jh(e){return(e??"online")==="online"?Rc.isOnline():!0}var Fd=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vh(e){let t=!1,r=0,n;const s=Bd(),a=()=>s.status!=="pending",o=g=>{var E;if(!a()){const v=new Fd(g);f(v),(E=e.onCancel)==null||E.call(e,v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>Id.isFocused()&&(e.networkMode==="always"||Rc.isOnline())&&e.canRun(),u=()=>jh(e.networkMode)&&e.canRun(),d=g=>{a()||(n==null||n(),s.resolve(g))},f=g=>{a()||(n==null||n(),s.reject(g))},m=()=>new Promise(g=>{var E;n=v=>{(a()||l())&&g(v)},(E=e.onPause)==null||E.call(e)}).then(()=>{var g;n=void 0,a()||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(a())return;let g;const E=r===0?e.initialPromise:void 0;try{g=E??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var L;if(a())return;const w=e.retry??(Ls?0:3),S=e.retryDelay??c3,T=typeof S=="function"?S(r,v):S,O=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,v);if(t||!O){f(v);return}r++,(L=e.onFail)==null||L.call(e,r,v),t3(T).then(()=>l()?void 0:m()).then(()=>{t?f(v):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:u,start:()=>(u()?b():m().then(b),s)}}var Wh=(U5=class{constructor(){le(this,ga)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cd(this.gcTime)&&J(this,ga,Ns.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ls?1/0:300*1e3))}clearGcTimeout(){N(this,ga)&&(Ns.clearTimeout(N(this,ga)),J(this,ga,void 0))}},ga=new WeakMap,U5),l3=(D5=class extends Wh{constructor(t){super();le(this,Xr);le(this,xa);le(this,Io);le(this,Fr);le(this,wa);le(this,Bt);le(this,Sc);le(this,va);J(this,va,!1),J(this,Sc,t.defaultOptions),this.setOptions(t.options),this.observers=[],J(this,wa,t.client),J(this,Fr,N(this,wa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,J(this,xa,Yh(this.options)),this.state=t.state??N(this,xa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Bt))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,Sc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Yh(this.options);r.data!==void 0&&(this.setState(Kh(r.data,r.dataUpdatedAt)),J(this,xa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Fr).remove(this)}setData(t,r){const n=Pd(this.state.data,t,this.options);return Se(this,Xr,Zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Se(this,Xr,Zn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=N(this,Bt))==null?void 0:n.promise;return(s=N(this,Bt))==null||s.cancel(t),r?r.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,xa))}isActive(){return this.observers.some(t=>wr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Jn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Nh(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=N(this,Bt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(N(this,Bt)&&(N(this,va)?N(this,Bt).cancel({revert:!0}):N(this,Bt).cancelRetry()),this.scheduleGc()),N(this,Fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Xr,Zn).call(this,{type:"invalidate"})}async fetch(t,r){var c,l,u,d,f,m,b,g,E,v,w,S;if(this.state.fetchStatus!=="idle"&&((c=N(this,Bt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,Bt))return N(this,Bt).continueRetry(),N(this,Bt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(O=>O.options.queryFn);T&&this.setOptions(T.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(J(this,va,!0),n.signal)})},a=()=>{const T=$h(this.options,r),L=(()=>{const P={client:N(this,wa),queryKey:this.queryKey,meta:this.meta};return s(P),P})();return J(this,va,!1),this.options.persister?this.options.persister(T,L,this):T(L)},i=(()=>{const T={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,wa),state:this.state,fetchFn:a};return s(T),T})();(l=this.options.behavior)==null||l.onFetch(i,this),J(this,Io,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&Se(this,Xr,Zn).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta}),J(this,Bt,Vh({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:T=>{T instanceof Fd&&T.revert&&this.setState({...N(this,Io),fetchStatus:"idle"}),n.abort()},onFail:(T,O)=>{Se(this,Xr,Zn).call(this,{type:"failed",failureCount:T,error:O})},onPause:()=>{Se(this,Xr,Zn).call(this,{type:"pause"})},onContinue:()=>{Se(this,Xr,Zn).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const T=await N(this,Bt).start();if(T===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(T),(m=(f=N(this,Fr).config).onSuccess)==null||m.call(f,T,this),(g=(b=N(this,Fr).config).onSettled)==null||g.call(b,T,this.state.error,this),T}catch(T){if(T instanceof Fd){if(T.silent)return N(this,Bt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Se(this,Xr,Zn).call(this,{type:"error",error:T}),(v=(E=N(this,Fr).config).onError)==null||v.call(E,T,this),(S=(w=N(this,Fr).config).onSettled)==null||S.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},xa=new WeakMap,Io=new WeakMap,Fr=new WeakMap,wa=new WeakMap,Bt=new WeakMap,Sc=new WeakMap,va=new WeakMap,Xr=new WeakSet,Zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qh(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Kh(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return J(this,Io,t.manual?s:void 0),s;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),N(this,Fr).notify({query:this,type:"updated",action:t})})},D5);function qh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jh(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Yh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var u3=(_5=class extends Ba{constructor(t,r){super();le(this,We);le(this,nr);le(this,_e);le(this,Pc);le(this,Wt);le(this,Ea);le(this,Bo);le(this,Vn);le(this,Ts);le(this,Ic);le(this,Fo);le(this,Oo);le(this,ka);le(this,Ca);le(this,As);le(this,Uo,new Set);this.options=r,J(this,nr,t),J(this,Ts,null),J(this,Vn,Bd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,_e).addObserver(this),Zh(N(this,_e),this.options)?Se(this,We,Oc).call(this):this.updateResult(),Se(this,We,Om).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Od(N(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Od(N(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,We,Um).call(this),Se(this,We,Dm).call(this),N(this,_e).removeObserver(this)}setOptions(t){const r=this.options,n=N(this,_e);if(this.options=N(this,nr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wr(this.options.enabled,N(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,We,_m).call(this),N(this,_e).setOptions(this.options),r._defaulted&&!Lc(this.options,r)&&N(this,nr).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,_e),observer:this});const s=this.hasListeners();s&&Xh(N(this,_e),n,this.options,r)&&Se(this,We,Oc).call(this),this.updateResult(),s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||Jn(this.options.staleTime,N(this,_e))!==Jn(r.staleTime,N(this,_e)))&&Se(this,We,Im).call(this);const a=Se(this,We,Bm).call(this);s&&(N(this,_e)!==n||wr(this.options.enabled,N(this,_e))!==wr(r.enabled,N(this,_e))||a!==N(this,As))&&Se(this,We,Fm).call(this,a)}getOptimisticResult(t){const r=N(this,nr).getQueryCache().build(N(this,nr),t),n=this.createResult(r,t);return p3(this,n)&&(J(this,Wt,n),J(this,Bo,this.options),J(this,Ea,N(this,_e).state)),n}getCurrentResult(){return N(this,Wt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Vn).status==="pending"&&N(this,Vn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){N(this,Uo).add(t)}getCurrentQuery(){return N(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=N(this,nr).defaultQueryOptions(t),n=N(this,nr).getQueryCache().build(N(this,nr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Se(this,We,Oc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Wt)))}createResult(t,r){var y;const n=N(this,_e),s=this.options,a=N(this,Wt),o=N(this,Ea),i=N(this,Bo),l=t!==n?t.state:N(this,Pc),{state:u}=t;let d={...u},f=!1,m;if(r._optimisticResults){const x=this.hasListeners(),A=!x&&Zh(t,r),B=x&&Xh(t,n,r,s);(A||B)&&(d={...d,...qh(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:E}=d;m=d.data;let v=!1;if(r.placeholderData!==void 0&&m===void 0&&E==="pending"){let x;a!=null&&a.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(x=a.data,v=!0):x=typeof r.placeholderData=="function"?r.placeholderData((y=N(this,Oo))==null?void 0:y.state.data,N(this,Oo)):r.placeholderData,x!==void 0&&(E="success",m=Pd(a==null?void 0:a.data,x,r),f=!0)}if(r.select&&m!==void 0&&!v)if(a&&m===(o==null?void 0:o.data)&&r.select===N(this,Ic))m=N(this,Fo);else try{J(this,Ic,r.select),m=r.select(m),m=Pd(a==null?void 0:a.data,m,r),J(this,Fo,m),J(this,Ts,null)}catch(x){J(this,Ts,x)}N(this,Ts)&&(b=N(this,Ts),m=N(this,Fo),g=Date.now(),E="error");const w=d.fetchStatus==="fetching",S=E==="pending",T=E==="error",O=S&&w,L=m!==void 0,h={status:E,fetchStatus:d.fetchStatus,isPending:S,isSuccess:E==="success",isError:T,isInitialLoading:O,isLoading:O,data:m,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:T&&!L,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:T&&L,isStale:Ud(t,r),refetch:this.refetch,promise:N(this,Vn),isEnabled:wr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const x=F=>{h.status==="error"?F.reject(h.error):h.data!==void 0&&F.resolve(h.data)},A=()=>{const F=J(this,Vn,h.promise=Bd());x(F)},B=N(this,Vn);switch(B.status){case"pending":t.queryHash===n.queryHash&&x(B);break;case"fulfilled":(h.status==="error"||h.data!==B.value)&&A();break;case"rejected":(h.status!=="error"||h.error!==B.reason)&&A();break}}return h}updateResult(){const t=N(this,Wt),r=this.createResult(N(this,_e),this.options);if(J(this,Ea,N(this,_e).state),J(this,Bo,this.options),N(this,Ea).data!==void 0&&J(this,Oo,N(this,_e)),Lc(r,t))return;J(this,Wt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!N(this,Uo).size)return!0;const o=new Set(a??N(this,Uo));return this.options.throwOnError&&o.add("error"),Object.keys(N(this,Wt)).some(i=>{const c=i;return N(this,Wt)[c]!==t[c]&&o.has(c)})};Se(this,We,K5).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,We,Om).call(this)}},nr=new WeakMap,_e=new WeakMap,Pc=new WeakMap,Wt=new WeakMap,Ea=new WeakMap,Bo=new WeakMap,Vn=new WeakMap,Ts=new WeakMap,Ic=new WeakMap,Fo=new WeakMap,Oo=new WeakMap,ka=new WeakMap,Ca=new WeakMap,As=new WeakMap,Uo=new WeakMap,We=new WeakSet,Oc=function(t){Se(this,We,_m).call(this);let r=N(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},Im=function(){Se(this,We,Um).call(this);const t=Jn(this.options.staleTime,N(this,_e));if(Ls||N(this,Wt).isStale||!Cd(t))return;const n=Nh(N(this,Wt).dataUpdatedAt,t)+1;J(this,ka,Ns.setTimeout(()=>{N(this,Wt).isStale||this.updateResult()},n))},Bm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,_e)):this.options.refetchInterval)??!1},Fm=function(t){Se(this,We,Dm).call(this),J(this,As,t),!(Ls||wr(this.options.enabled,N(this,_e))===!1||!Cd(N(this,As))||N(this,As)===0)&&J(this,Ca,Ns.setInterval(()=>{(this.options.refetchIntervalInBackground||Id.isFocused())&&Se(this,We,Oc).call(this)},N(this,As)))},Om=function(){Se(this,We,Im).call(this),Se(this,We,Fm).call(this,Se(this,We,Bm).call(this))},Um=function(){N(this,ka)&&(Ns.clearTimeout(N(this,ka)),J(this,ka,void 0))},Dm=function(){N(this,Ca)&&(Ns.clearInterval(N(this,Ca)),J(this,Ca,void 0))},_m=function(){const t=N(this,nr).getQueryCache().build(N(this,nr),this.options);if(t===N(this,_e))return;const r=N(this,_e);J(this,_e,t),J(this,Pc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},K5=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(N(this,Wt))}),N(this,nr).getQueryCache().notify({query:N(this,_e),type:"observerResultsUpdated"})})},_5);function d3(e,t){return wr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zh(e,t){return d3(e,t)||e.state.data!==void 0&&Od(e,t,t.refetchOnMount)}function Od(e,t,r){if(wr(t.enabled,e)!==!1&&Jn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ud(e,t)}return!1}function Xh(e,t,r,n){return(e!==t||wr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ud(e,r)}function Ud(e,t){return wr(t.enabled,e)!==!1&&e.isStaleByTime(Jn(t.staleTime,e))}function p3(e,t){return!Lc(e.getCurrentResult(),t)}function Qh(e){return{onFetch:(t,r)=>{var u,d,f,m,b;const n=t.options,s=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let g=!1;const E=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=$h(t.options,t.fetchOptions),w=async(S,T,O)=>{if(g)return Promise.reject();if(T==null&&S.pages.length)return Promise.resolve(S);const P=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:T,direction:O?"backward":"forward",meta:t.options.meta};return E(A),A})(),h=await v(P),{maxPages:y}=t.options,x=O?n3:r3;return{pages:x(S.pages,h,y),pageParams:x(S.pageParams,T,y)}};if(s&&a.length){const S=s==="backward",T=S?f3:Jh,O={pages:a,pageParams:o},L=T(n,O);i=await w(O,L,S)}else{const S=e??a.length;do{const T=c===0?o[0]??n.initialPageParam:Jh(n,i);if(c>0&&T==null)break;i=await w(i,T),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var g,E;return(E=(g=t.options).persister)==null?void 0:E.call(g,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=l}}}function Jh(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function f3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var m3=(M5=class extends Wh{constructor(t){super();le(this,gn);le(this,Bc);le(this,yn);le(this,qt);le(this,Ta);J(this,Bc,t.client),this.mutationId=t.mutationId,J(this,qt,t.mutationCache),J(this,yn,[]),this.state=t.state||e1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,yn).includes(t)||(N(this,yn).push(t),this.clearGcTimeout(),N(this,qt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){J(this,yn,N(this,yn).filter(r=>r!==t)),this.scheduleGc(),N(this,qt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,yn).length||(this.state.status==="pending"?this.scheduleGc():N(this,qt).remove(this))}continue(){var t;return((t=N(this,Ta))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,c,l,u,d,f,m,b,g,E,v,w,S,T,O,L,P,h,y;const r=()=>{Se(this,gn,Fs).call(this,{type:"continue"})},n={client:N(this,Bc),meta:this.options.meta,mutationKey:this.options.mutationKey};J(this,Ta,Vh({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(x,A)=>{Se(this,gn,Fs).call(this,{type:"failed",failureCount:x,error:A})},onPause:()=>{Se(this,gn,Fs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,qt).canRun(this)}));const s=this.state.status==="pending",a=!N(this,Ta).canStart();try{if(s)r();else{Se(this,gn,Fs).call(this,{type:"pending",variables:t,isPaused:a}),await((i=(o=N(this,qt).config).onMutate)==null?void 0:i.call(o,t,this,n));const A=await((l=(c=this.options).onMutate)==null?void 0:l.call(c,t,n));A!==this.state.context&&Se(this,gn,Fs).call(this,{type:"pending",context:A,variables:t,isPaused:a})}const x=await N(this,Ta).start();return await((d=(u=N(this,qt).config).onSuccess)==null?void 0:d.call(u,x,t,this.state.context,this,n)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,x,t,this.state.context,n)),await((g=(b=N(this,qt).config).onSettled)==null?void 0:g.call(b,x,null,this.state.variables,this.state.context,this,n)),await((v=(E=this.options).onSettled)==null?void 0:v.call(E,x,null,t,this.state.context,n)),Se(this,gn,Fs).call(this,{type:"success",data:x}),x}catch(x){try{throw await((S=(w=N(this,qt).config).onError)==null?void 0:S.call(w,x,t,this.state.context,this,n)),await((O=(T=this.options).onError)==null?void 0:O.call(T,x,t,this.state.context,n)),await((P=(L=N(this,qt).config).onSettled)==null?void 0:P.call(L,void 0,x,this.state.variables,this.state.context,this,n)),await((y=(h=this.options).onSettled)==null?void 0:y.call(h,void 0,x,t,this.state.context,n)),x}finally{Se(this,gn,Fs).call(this,{type:"error",error:x})}}finally{N(this,qt).runNext(this)}}},Bc=new WeakMap,yn=new WeakMap,qt=new WeakMap,Ta=new WeakMap,gn=new WeakSet,Fs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{N(this,yn).forEach(n=>{n.onMutationUpdate(t)}),N(this,qt).notify({mutation:this,type:"updated",action:t})})},M5);function e1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var h3=(N5=class extends Ba{constructor(t={}){super();le(this,Wn);le(this,Qr);le(this,Fc);this.config=t,J(this,Wn,new Set),J(this,Qr,new Map),J(this,Fc,0)}build(t,r,n){const s=new m3({client:t,mutationCache:this,mutationId:++rd(this,Fc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){N(this,Wn).add(t);const r=Hc(t);if(typeof r=="string"){const n=N(this,Qr).get(r);n?n.push(t):N(this,Qr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,Wn).delete(t)){const r=Hc(t);if(typeof r=="string"){const n=N(this,Qr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&N(this,Qr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Hc(t);if(typeof r=="string"){const n=N(this,Qr).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Hc(t);if(typeof r=="string"){const s=(n=N(this,Qr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{N(this,Wn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,Wn).clear(),N(this,Qr).clear()})}getAll(){return Array.from(N(this,Wn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>zh(r,n))}findAll(t={}){return this.getAll().filter(r=>zh(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Gt))))}},Wn=new WeakMap,Qr=new WeakMap,Fc=new WeakMap,N5);function Hc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var b3=(L5=class extends Ba{constructor(t,r){super();le(this,Yn);le(this,qn);le(this,Ss);le(this,sr);le(this,Kn);J(this,qn,t),this.setOptions(r),this.bindMethods(),Se(this,Yn,nd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=N(this,qn).defaultMutationOptions(t),Lc(this.options,r)||N(this,qn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,sr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&zs(r.mutationKey)!==zs(this.options.mutationKey)?this.reset():((n=N(this,sr))==null?void 0:n.state.status)==="pending"&&N(this,sr).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=N(this,sr))==null||t.removeObserver(this)}onMutationUpdate(t){Se(this,Yn,nd).call(this),Se(this,Yn,Mm).call(this,t)}getCurrentResult(){return N(this,Ss)}reset(){var t;(t=N(this,sr))==null||t.removeObserver(this),J(this,sr,void 0),Se(this,Yn,nd).call(this),Se(this,Yn,Mm).call(this)}mutate(t,r){var n;return J(this,Kn,r),(n=N(this,sr))==null||n.removeObserver(this),J(this,sr,N(this,qn).getMutationCache().build(N(this,qn),this.options)),N(this,sr).addObserver(this),N(this,sr).execute(t)}},qn=new WeakMap,Ss=new WeakMap,sr=new WeakMap,Kn=new WeakMap,Yn=new WeakSet,nd=function(){var r;const t=((r=N(this,sr))==null?void 0:r.state)??e1();J(this,Ss,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},Mm=function(t){kt.batch(()=>{var r,n,s,a,o,i,c,l;if(N(this,Kn)&&this.hasListeners()){const u=N(this,Ss).variables,d=N(this,Ss).context,f={client:N(this,qn),meta:this.options.meta,mutationKey:this.options.mutationKey};(t==null?void 0:t.type)==="success"?((n=(r=N(this,Kn)).onSuccess)==null||n.call(r,t.data,u,d,f),(a=(s=N(this,Kn)).onSettled)==null||a.call(s,t.data,null,u,d,f)):(t==null?void 0:t.type)==="error"&&((i=(o=N(this,Kn)).onError)==null||i.call(o,t.error,u,d,f),(l=(c=N(this,Kn)).onSettled)==null||l.call(c,void 0,t.error,u,d,f))}this.listeners.forEach(u=>{u(N(this,Ss))})})},L5),y3=(z5=class extends Ba{constructor(t={}){super();le(this,xn);this.config=t,J(this,xn,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??Td(s,r);let o=this.get(a);return o||(o=new l3({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){N(this,xn).has(t.queryHash)||(N(this,xn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=N(this,xn).get(t.queryHash);r&&(t.destroy(),r===t&&N(this,xn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,xn).get(t)}getAll(){return[...N(this,xn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Lh(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Lh(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},xn=new WeakMap,z5),g3=(R5=class{constructor(e={}){le(this,mt);le(this,Ps);le(this,Is);le(this,Do);le(this,_o);le(this,Bs);le(this,Mo);le(this,No);J(this,mt,e.queryCache||new y3),J(this,Ps,e.mutationCache||new h3),J(this,Is,e.defaultOptions||{}),J(this,Do,new Map),J(this,_o,new Map),J(this,Bs,0)}mount(){rd(this,Bs)._++,N(this,Bs)===1&&(J(this,Mo,Id.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,mt).onFocus())})),J(this,No,Rc.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,mt).onOnline())})))}unmount(){var e,t;rd(this,Bs)._--,N(this,Bs)===0&&((e=N(this,Mo))==null||e.call(this),J(this,Mo,void 0),(t=N(this,No))==null||t.call(this),J(this,No,void 0))}isFetching(e){return N(this,mt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Ps).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,mt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=N(this,mt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Jn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return N(this,mt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=N(this,mt).get(n.queryHash),a=s==null?void 0:s.state.data,o=Jw(t,a);if(o!==void 0)return N(this,mt).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>N(this,mt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=N(this,mt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=N(this,mt);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=N(this,mt);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>N(this,mt).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Gt).catch(Gt)}invalidateQueries(e,t={}){return kt.batch(()=>(N(this,mt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>N(this,mt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=N(this,mt).build(this,t);return r.isStaleByTime(Jn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e.behavior=Qh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e.behavior=Qh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rc.isOnline()?N(this,Ps).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,mt)}getMutationCache(){return N(this,Ps)}getDefaultOptions(){return N(this,Is)}setDefaultOptions(e){J(this,Is,e)}setQueryDefaults(e,t){N(this,Do).set(zs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Do).values()],r={};return t.forEach(n=>{Ho(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){N(this,_o).set(zs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,_o).values()],r={};return t.forEach(n=>{Ho(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Is).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Td(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Is).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,mt).clear(),N(this,Ps).clear()}},mt=new WeakMap,Ps=new WeakMap,Is=new WeakMap,Do=new WeakMap,_o=new WeakMap,Bs=new WeakMap,Mo=new WeakMap,No=new WeakMap,R5),t1=Et.createContext(void 0),Dd=e=>{const t=Et.useContext(t1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},x3=({client:e,children:t})=>(Et.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),C.jsx(t1.Provider,{value:e,children:t})),r1=Et.createContext(!1),w3=()=>Et.useContext(r1);r1.Provider;function v3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E3=Et.createContext(v3()),k3=()=>Et.useContext(E3),C3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},T3=e=>{Et.useEffect(()=>{e.clearReset()},[e])},A3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Gh(r,[e.error,n])),S3=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},P3=(e,t)=>e.isLoading&&e.isFetching&&!t,I3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,n1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function B3(e,t,r){var d,f,m,b,g;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=w3(),s=k3(),a=Dd(),o=a.defaultQueryOptions(e);(f=(d=a.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=n?"isRestoring":"optimistic",S3(o),C3(o,s),T3(s);const i=!a.getQueryCache().get(o.queryHash),[c]=Et.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(Et.useSyncExternalStore(Et.useCallback(E=>{const v=u?c.subscribe(kt.batchCalls(E)):Gt;return c.updateResult(),v},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Et.useEffect(()=>{c.setOptions(o)},[o,c]),I3(o,l))throw n1(o,c,s);if(A3({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((b=(m=a.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||b.call(m,o,l),o.experimental_prefetchInRender&&!Ls&&P3(l,n)){const E=i?n1(o,c,s):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;E==null||E.catch(Gt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function F3(e,t){return B3(e,u3)}function en(e,t){const r=Dd(),[n]=Et.useState(()=>new b3(r,e));Et.useEffect(()=>{n.setOptions(e)},[n,e]);const s=Et.useSyncExternalStore(Et.useCallback(o=>n.subscribe(kt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=Et.useCallback((o,i)=>{n.mutate(o,i).catch(Gt)},[n]);if(s.error&&Gh(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}const O3=M.createContext(null),_d={didCatch:!1,error:null};class U3 extends M.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_d}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(_d)}}componentDidCatch(t,r){var n,s;(n=(s=this.props).onError)===null||n===void 0||n.call(s,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:s}=this.props;if(n&&r.error!==null&&D3(t.resetKeys,s)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:s,prev:t.resetKeys,reason:"keys"}),this.setState(_d)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:s}=this.props,{didCatch:a,error:o}=this.state;let i=t;if(a){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")i=r(c);else if(n)i=M.createElement(n,c);else if(s!==void 0)i=s;else throw o}return M.createElement(O3.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function D3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const s1=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(m=>m(t,f))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,s,i);return i},_3=(e=>e?s1(e):s1),M3=e=>e;function N3(e,t=M3){const r=M.useSyncExternalStore(e.subscribe,M.useCallback(()=>t(e.getState()),[e,t]),M.useCallback(()=>t(e.getInitialState()),[e,t]));return M.useDebugValue(r),r}const a1=e=>{const t=_3(e),r=n=>N3(t,n);return Object.assign(r,t),r},L3=(e=>e?a1(e):a1),Md={disclaimerAccepted:!0,currentTime:Date.now(),swapExecution:{}},ee=L3((e,t)=>({state:Md,updateState:r=>e(n=>({state:{...n.state,...r}})),updateSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...n.state.swapExecution,...r}}})),resetSwapExecution:r=>e(n=>({state:{...n.state,swapExecution:{...Md.swapExecution,...r}}})),resetState:r=>{e({state:{...Md,currentTime:Date.now(),swapExecution:{...t().state.swapExecution,acceptedMarketPrice:void 0,acceptedSrcAmount:void 0},isMarketOrder:t().state.isMarketOrder,...r}}),setTimeout(()=>{t().resetSwapExecution()},1e3)}}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".orbs_OrbsLogo{object-fit:contain;display:inline}.orbs_PoweredBy{border-radius:8px;margin-left:auto;margin-right:auto}.orbs_PoweredBy a{display:flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}.orbs_PoweredBy span{font-size:14px}.orbs_PoweredBy .orbs_OrbsLogo{margin-left:6px;margin-right:6px;width:18px;height:18px}.orbs_Text{margin:0;padding:0}.orbs_Spinner{width:var(--size, 38px);height:var(--size, 38px);border:var(--border-width, 3px) solid var(--border-color, white);border-bottom-color:var(--bottom-border-color, rgba(255, 255, 255, .2));border-radius:50%;display:inline-block;box-sizing:border-box;animation:orbs_rotation 1s linear infinite}@keyframes orbs_rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.orbs_TradeStepLayout{--layout-min-height: 220px;--layout-width: 100%;--layout-display: flex;--layout-direction: column;--layout-align: center;--layout-overflow: visible;display:var(--layout-display);flex-direction:var(--layout-direction);align-items:var(--layout-align);width:var(--layout-width);min-height:var(--layout-min-height);overflow:var(--layout-overflow)}.orbs_TradeStepLayoutBody{--body-gap: 20px;--body-margin-top: 30px;--body-width: 100%;--body-display: flex;--body-direction: column;--body-align: center;--body-overflow: visible;gap:var(--body-gap);align-items:var(--body-align);display:var(--body-display);flex-direction:var(--body-direction);width:var(--body-width);margin-top:var(--body-margin-top);overflow:var(--body-overflow)}.orbs_TradeStepLayoutHeader{--header-gap: 30px;--header-display: flex;--header-direction: column;--header-align: center;--header-justify: center;--header-overflow: visible;display:var(--header-display);flex-direction:var(--header-direction);align-items:var(--header-align);justify-content:var(--header-justify);gap:var(--header-gap);overflow:var(--header-overflow)}.orbs_TradeStepLayoutTitle{--title-font-size: 18px;--title-font-weight: 500;--title-line-height: normal;--title-color: inherit;--title-text-align: center;--title-margin: 0;--title-padding: 0;font-size:var(--title-font-size);font-weight:var(--title-font-weight);line-height:var(--title-line-height);color:var(--title-color);text-align:var(--title-text-align);margin:var(--title-margin);padding:var(--title-padding)}.orbs_StepIndicator{--indicator-display: flex;--indicator-align: center;--indicator-justify: flex-start;--indicator-height: 7px;--indicator-width: 120px;--indicator-border-radius: 999px;--indicator-bg-color: white;--indicator-margin-bottom: 20px;--indicator-position: relative;--indicator-overflow: hidden;--indicator-border: none;--indicator-box-shadow: none;display:var(--indicator-display);align-items:var(--indicator-align);justify-content:var(--indicator-justify);height:var(--indicator-height);width:var(--indicator-width);border-radius:var(--indicator-border-radius);overflow:var(--indicator-overflow);background-color:var(--indicator-bg-color);margin-bottom:var(--indicator-margin-bottom);position:var(--indicator-position);border:var(--indicator-border);box-shadow:var(--indicator-box-shadow)}.orbs_StepIndicatorLine{--line-height: 100%;--line-bg-color: black;--line-position: absolute;--line-top: 0;--line-left: 0;--line-right: 0;--line-bottom: 0;--line-transition: all .3s ease;--line-border-radius: inherit;--line-box-shadow: none;height:var(--line-height);background-color:var(--line-bg-color);position:var(--line-position);top:var(--line-top);left:var(--line-left);right:var(--line-right);bottom:var(--line-bottom);transition:var(--line-transition);border-radius:var(--line-border-radius);box-shadow:var(--line-box-shadow)}.orbs_TradeStepLayoutFooter{--footer-display: flex;--footer-align: center;--footer-justify: center;--footer-direction: column;--footer-margin-top: auto;--footer-padding-top: 30px;--footer-width: 100%;--footer-overflow: visible;--footer-border-top: none;display:var(--footer-display);align-items:var(--footer-align);justify-content:var(--footer-justify);flex-direction:var(--footer-direction);margin-top:var(--footer-margin-top);padding-top:var(--footer-padding-top);width:var(--footer-width);overflow:var(--footer-overflow);border-top:var(--footer-border-top)}.orbs_TradeStepLayoutFooter p{--footer-text-font-size: 15px;--footer-text-line-height: normal;--footer-text-color: inherit;--footer-text-margin: 0;--footer-text-padding: 0;font-size:var(--footer-text-font-size);line-height:var(--footer-text-line-height);color:var(--footer-text-color);margin:var(--footer-text-margin);padding:var(--footer-text-padding)}.orbs_TradeStepLayoutFooterLink{--link-color: inherit;--link-text-decoration: none;--link-font-size: 15px;--link-text-align: center;--link-margin: auto;--link-outline: none;--link-line-height: normal;--link-padding: 0;--link-transition: color .2s ease;--link-hover-color: inherit;--link-hover-text-decoration: underline;color:var(--link-color);text-decoration:var(--link-text-decoration);font-size:var(--link-font-size);text-align:var(--link-text-align);margin-left:var(--link-margin);margin-right:var(--link-margin);outline:var(--link-outline);line-height:var(--link-line-height);padding:var(--link-padding);transition:var(--link-transition)}.orbs_TradeStepLayoutFooterLink:hover{color:var(--link-hover-color);text-decoration:var(--link-hover-text-decoration)}.orbs_TradeStepLayoutSuccessIcon{--success-icon-display: flex;--success-icon-justify: center;--success-icon-align: center;--success-icon-width: 60px;--success-icon-height: 60px;--success-icon-border-radius: 50%;--success-icon-overflow: visible;--success-icon-bg-color: transparent;--success-icon-border: none;--success-icon-box-shadow: none;display:var(--success-icon-display);justify-content:var(--success-icon-justify);align-items:var(--success-icon-align);width:var(--success-icon-width);height:var(--success-icon-height);border-radius:var(--success-icon-border-radius);overflow:var(--success-icon-overflow);background-color:var(--success-icon-bg-color);border:var(--success-icon-border);box-shadow:var(--success-icon-box-shadow)}.orbs_TradeStepLayoutErrorIcon{--error-icon-width: 80px;--error-icon-height: 80px;--error-icon-display: flex;--error-icon-justify: center;--error-icon-align: center;--error-icon-overflow: visible;--error-icon-bg-color: transparent;--error-icon-border: none;--error-icon-box-shadow: none;width:var(--error-icon-width);height:var(--error-icon-height);display:var(--error-icon-display);justify-content:var(--error-icon-justify);align-items:var(--error-icon-align);overflow:var(--error-icon-overflow);background-color:var(--error-icon-bg-color);border:var(--error-icon-border);box-shadow:var(--error-icon-box-shadow)}.orbs_FailedContentMsg{font-size:22px;font-weight:500}.orbs_TradePreview{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.orbs_TradePreviewToken{display:flex;align-items:center;gap:6px;max-width:calc(50% - 30px)}.orbs_TradePreviewToken p{--token-font-size: 15px;--token-white-space: nowrap;--token-overflow: hidden;--token-text-overflow: ellipsis;--token-flex: 1;--token-margin: 0;--token-padding: 0;font-size:var(--token-font-size);white-space:var(--token-white-space);overflow:var(--token-overflow);text-overflow:var(--token-text-overflow);flex:var(--token-flex);margin:var(--token-margin)}.orbs_TradepPreviewIcon{width:22px;height:22px}.orbs_TradepPreviewLogo{width:24px;height:24px;border-radius:50%;overflow:hidden}.orbs_FlexRow{display:flex;flex-direction:row}.orbs_FlexColumn{display:flex;flex-direction:column}@keyframes orbs_skeletonAnimation{0%{opacity:.2}to{opacity:.4}}.orbs_SkeletonLoader{animation:orbs_skeletonAnimation 1s linear infinite alternate;background-color:#fff}.orbs_Main-wrapper{width:100%}.orbs_Main{width:100%;display:flex;flex-direction:column;gap:28px}.orbs_MainToken{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;gap:8px}.orbs_MainTokenLeft{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.orbs_MainTokenUsd{display:flex;align-items:center;gap:5px}.orbs_MainTokenUsd small{font-size:12px;opacity:.6}.orbs_MainContentLoader{width:100%;display:flex;gap:15px;align-items:center;margin-top:20px}.orbs_MainContentRectengularLoader{flex:1;height:20px;max-width:250px;border-radius:20px}.orbs_MainContentCircleLoader{width:30px;height:30px;border-radius:50%}.orbs_MainTokenLogo{--width: 40px;--height: 40px;width:var(--width);height:var(--height)}.orbs_MainTokenLogo img{width:100%;height:100%;object-fit:cover}.orbs_SwapFlow{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.orbs_SwapFlow *{box-sizing:border-box}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Le=e=>`orbs_${e}`;function $o({children:e,className:t=""}){return C.jsx("p",{className:`${t} ${Le("Text")}`,children:e})}const o1=M.createContext({});function z3({children:e,...t}){return C.jsx(o1.Provider,{value:t,children:e})}const tn=()=>M.useContext(o1);var pt=(e=>(e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILED=3]="FAILED",e))(pt||{});const R3=({className:e="",size:t=38,borderWidth:r=3,borderColor:n="white",bottomBorderColor:s="rgba(255, 255, 255, 0.2)"})=>{const a={"--size":`${t}px`,"--border-width":`${r}px`,"--border-color":n,"--bottom-border-color":s};return C.jsx("div",{className:`${Le("Spinner")} ${e}`,style:a})};function $c({className:e="",body:t,footerLink:r,footerText:n,title:s,children:a}){return C.jsxs("div",{className:`${Le("TradeStepLayout")} ${e}`,children:[C.jsxs("div",{className:Le("TradeStepLayoutHeader"),children:[C.jsx(V3,{}),s&&C.jsx($o,{className:Le("TradeStepLayoutTitle"),children:s})]}),t&&C.jsx("div",{className:Le("TradeStepLayoutBody"),children:t}),C.jsx(H3,{link:r,text:n}),a]})}const H3=({link:e,text:t})=>{const{swapStatus:r}=tn();return!e&&!t?null:C.jsxs("div",{className:Le("TradeStepLayoutFooter"),children:[C.jsx(q3,{}),e?C.jsx($3,{link:e,text:t}):r===pt.FAILED?void 0:C.jsx($o,{children:t})]})},$3=({link:e,text:t})=>C.jsx("a",{target:"_blank",className:Le("TradeStepLayoutFooterLink"),href:e,children:t});function G3(){const{components:e}=tn();return e.SuccessIcon?e.SuccessIcon:C.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",className:Le("TradeStepLayoutSuccessIcon"),children:[C.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#00C853"}),C.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#00C853",d:"M5 8l2 2 4-4"})]})}function j3(){const{components:e}=tn();return e.FailedIcon?e.FailedIcon:C.jsxs("svg",{className:Le("TradeStepLayoutErrorIcon"),viewBox:"0 0 16 16",fill:"none",children:[C.jsx("circle",{cx:"8",cy:"8",r:"7",strokeWidth:"1.5",stroke:"#FF3D00"}),C.jsx("path",{strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",stroke:"#FF3D00",d:"M8 4v5M8 11h.01"})]})}const V3=()=>{const{swapStatus:e}=tn();return e===pt.SUCCESS?C.jsx(G3,{}):e===pt.FAILED?C.jsx(j3,{}):C.jsx(W3,{})},W3=()=>{const{components:e}=tn();return e.Loader?e.Loader:C.jsx(R3,{size:60,borderWidth:5,className:Le("TradeStepLayoutSpinner")})},q3=()=>{const{totalSteps:e,currentStepIndex:t=0,swapStatus:r}=tn();return r!==pt.LOADING||e===1?null:C.jsx("div",{className:Le("StepIndicator"),children:C.jsx("div",{style:{width:`${100/(e||0)}%`,left:`${t*100/(e||0)}%`},className:Le("StepIndicatorLine")})})},K3=({error:e,footerLink:t,footerText:r})=>C.jsx($c,{footerLink:t,footerText:r,body:e||C.jsx("p",{className:Le("FailedContentMsg"),children:"Something went wrong"}),className:Le("FailedContent")});function Y3(){return C.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",className:Le("TradepPreviewIcon"),children:C.jsx("path",{fillRule:"evenodd",d:"M4 8a.5.5 0 01.5-.5h5.793L8.146 5.354a.5.5 0 11.708-.708l3 3a.5.5 0 010 .708l-3 3a.5.5 0 01-.708-.708L10.293 8.5H4.5A.5.5 0 014 8z"})})}const i1=({inTokenOnly:e})=>{const{inToken:t,outToken:r,inAmount:n,outAmount:s,components:a}=tn();return C.jsxs("div",{className:Le("TradePreview"),children:[C.jsx(c1,{token:t,amount:n,Logo:a==null?void 0:a.SrcTokenLogo}),!e&&C.jsxs(C.Fragment,{children:[C.jsx(Y3,{}),C.jsx(c1,{token:r,amount:s,Logo:a==null?void 0:a.DstTokenLogo})]})]})},c1=({token:e,amount:t,Logo:r})=>C.jsxs("div",{className:Le("TradePreviewToken"),children:[r||C.jsx("img",{src:e==null?void 0:e.logoUrl,className:Le("TradepPreviewLogo"),alt:`${e==null?void 0:e.symbol} logo`}),C.jsxs($o,{children:[t," ",e==null?void 0:e.symbol]})]});function Z3({title:e,footerLink:t,footerText:r,hideTokens:n}){return C.jsx($c,{title:e,className:Le("Success"),body:!n&&C.jsx(i1,{}),footerLink:t,footerText:r})}const l1=({$gap:e=10,$alignItems:t="flex-start",children:r,className:n="",customStyles:s={}})=>{const a={gap:`${e}px`,alignItems:t,width:"100%",...s};return C.jsx("div",{className:`${Le("FlexColumn")} ${n}`,style:a,children:r})};function u1({styles:e={},className:t=""}){return C.jsx("div",{style:e,className:`${Le("SkeletonLoader")} ${t}`})}const X3=()=>C.jsxs("div",{className:`${Le("MainContentLoader")}`,children:[C.jsx(u1,{className:`${Le("MainContentCircleLoader")}`}),C.jsx(u1,{className:`${Le("MainContentRectengularLoader")}`})]}),Q3=({fromTitle:e,toTitle:t,inUsd:r,outUsd:n})=>{const{swapStatus:s,outAmount:a,inAmount:o,inToken:i,outToken:c,components:l,totalSteps:u}=tn(),d=C.jsx(p1,{fromTitle:e,inUsd:r,inToken:i,toTitle:t,outUsd:n,outToken:c,inAmount:o,outAmount:a,SrcTokenLogo:l.SrcTokenLogo,DstTokenLogo:l.DstTokenLogo});return s?u?C.jsx(J3,{}):C.jsxs(l1,{children:[d,C.jsx(X3,{})]}):C.jsx(l1,{children:d})},d1=({amount:e,token:t,usd:r,title:n,Logo:s})=>C.jsxs("div",{className:`${Le("MainToken")}`,children:[C.jsxs("div",{className:`${Le("MainTokenLeft")}`,children:[C.jsx($o,{className:`${Le("MainTokenTitle")}`,children:n}),C.jsx($o,{className:` ${Le("MainTokenAmount")}`,children:`${e&&Number(e)>0?e:""} ${(t==null?void 0:t.symbol)||""}`}),r&&C.jsx("div",{className:` ${Le("MainTokenUsd")}`,children:r})]}),s||C.jsx("div",{className:` ${Le("MainTokenLogo")}`,children:t!=null&&t.logoUrl?C.jsx("img",{src:t==null?void 0:t.logoUrl,alt:"Token logo"}):null})]});function J3(){const{currentStep:e}=tn();return e?C.jsx($c,{footerLink:e.footerLink,footerText:e.footerText,title:e.title,body:e.hideTokens?void 0:C.jsx(i1,{inTokenOnly:e==null?void 0:e.inTokenOnly})}):null}const p1=({fromTitle:e,inUsd:t,inToken:r,toTitle:n,outUsd:s,outToken:a,inAmount:o,outAmount:i,SrcTokenLogo:c,DstTokenLogo:l})=>C.jsxs("div",{className:`${Le("Main")}`,children:[C.jsx(d1,{title:e||"Swap from",usd:t,token:r,amount:o,Logo:c}),C.jsx(d1,{title:n||"Swap to",usd:s,token:a,amount:i,Logo:l})]}),es=e=>C.jsx(z3,{...e,children:C.jsx(e8,{})}),e8=()=>{const{swapStatus:e,components:t,className:r}=tn();return C.jsx("div",{className:`${Le("SwapFlow")} ${r}`,children:e===pt.SUCCESS?t==null?void 0:t.Success:e===pt.FAILED?t==null?void 0:t.Failed:t==null?void 0:t.Main})};es.Success=Z3,es.Failed=K3,es.Main=Q3,es.StepLayout=$c;var Rs=(e=>(e.WRAP="wrap",e.APPROVE="approve",e.CREATE="create",e))(Rs||{});const t8="1.2.3";let Yt=class Nm extends Error{constructor(t,r={}){var o;const n=r.cause instanceof Nm?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,s=r.cause instanceof Nm&&r.cause.docsPath||r.docsPath,a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${t8}`].join(`
65
65
  `);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.shortMessage=t}};function En(e,t){const r=e.exec(t);return r==null?void 0:r.groups}const f1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,m1=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,h1=/^\(.+?\).*?$/,b1=/^tuple(?<array>(\[(\d*)\])*)$/;function Nd(e){let t=e.type;if(b1.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let s=0;s<r;s++){const a=e.components[s];t+=Nd(a),s<r-1&&(t+=", ")}const n=En(b1,e.type);return t+=`)${(n==null?void 0:n.array)||""}`,Nd({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Fa(e){let t="";const r=e.length;for(let n=0;n<r;n++){const s=e[n];t+=Nd(s),n!==r-1&&(t+=", ")}return t}function Gc(e){var t;return e.type==="function"?`function ${e.name}(${Fa(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Fa(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Fa(e.inputs)})`:e.type==="error"?`error ${e.name}(${Fa(e.inputs)})`:e.type==="constructor"?`constructor(${Fa(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const y1=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function r8(e){return y1.test(e)}function n8(e){return En(y1,e)}const g1=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function s8(e){return g1.test(e)}function a8(e){return En(g1,e)}const x1=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function o8(e){return x1.test(e)}function i8(e){return En(x1,e)}const w1=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function jc(e){return w1.test(e)}function c8(e){return En(w1,e)}const v1=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function l8(e){return v1.test(e)}function u8(e){return En(v1,e)}const E1=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function d8(e){return E1.test(e)}function p8(e){return En(E1,e)}const f8=/^receive\(\) external payable$/;function m8(e){return f8.test(e)}const k1=new Set(["memory","indexed","storage","calldata"]),h8=new Set(["indexed"]),Ld=new Set(["calldata","memory","storage"]);class b8 extends Yt{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class y8 extends Yt{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class g8 extends Yt{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class x8 extends Yt{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class w8 extends Yt{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class v8 extends Yt{constructor({param:t,name:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class E8 extends Yt{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class k8 extends Yt{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class C8 extends Yt{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Oa extends Yt{constructor({signature:t,type:r}){super(`Invalid ${r} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class T8 extends Yt{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class A8 extends Yt{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class S8 extends Yt{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class P8 extends Yt{constructor({current:t,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function I8(e,t,r){let n="";if(r)for(const s of Object.entries(r)){if(!s)continue;let a="";for(const o of s[1])a+=`[${o.type}${o.name?`:${o.name}`:""}]`;n+=`(${s[0]}{${a}})`}return t?`${t}:${e}${n}`:`${e}${n}`}const zd=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Rd(e,t={}){if(o8(e))return B8(e,t);if(s8(e))return F8(e,t);if(r8(e))return O8(e,t);if(l8(e))return U8(e,t);if(d8(e))return D8(e);if(m8(e))return{type:"receive",stateMutability:"payable"};throw new T8({signature:e})}function B8(e,t={}){const r=i8(e);if(!r)throw new Oa({signature:e,type:"function"});const n=or(r.parameters),s=[],a=n.length;for(let i=0;i<a;i++)s.push(kn(n[i],{modifiers:Ld,structs:t,type:"function"}));const o=[];if(r.returns){const i=or(r.returns),c=i.length;for(let l=0;l<c;l++)o.push(kn(i[l],{modifiers:Ld,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:s,outputs:o}}function F8(e,t={}){const r=a8(e);if(!r)throw new Oa({signature:e,type:"event"});const n=or(r.parameters),s=[],a=n.length;for(let o=0;o<a;o++)s.push(kn(n[o],{modifiers:h8,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:s}}function O8(e,t={}){const r=n8(e);if(!r)throw new Oa({signature:e,type:"error"});const n=or(r.parameters),s=[],a=n.length;for(let o=0;o<a;o++)s.push(kn(n[o],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:s}}function U8(e,t={}){const r=u8(e);if(!r)throw new Oa({signature:e,type:"constructor"});const n=or(r.parameters),s=[],a=n.length;for(let o=0;o<a;o++)s.push(kn(n[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:s}}function D8(e){const t=p8(e);if(!t)throw new Oa({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const _8=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,M8=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,N8=/^u?int$/;function kn(e,t){var d,f;const r=I8(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(zd.has(r))return zd.get(r);const n=h1.test(e),s=En(n?M8:_8,e);if(!s)throw new w8({param:e});if(s.name&&z8(s.name))throw new v8({param:e,name:s.name});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},i=(t==null?void 0:t.structs)??{};let c,l={};if(n){c="tuple";const m=or(s.type),b=[],g=m.length;for(let E=0;E<g;E++)b.push(kn(m[E],{structs:i}));l={components:b}}else if(s.type in i)c="tuple",l={components:i[s.type]};else if(N8.test(s.type))c=`${s.type}256`;else if(s.type==="address payable")c="address";else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!C1(c))throw new g8({type:c});if(s.modifier){if(!((f=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&f.call(d,s.modifier)))throw new E8({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(Ld.has(s.modifier)&&!R8(c,!!s.array))throw new k8({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const u={type:`${c}${s.array??""}`,...a,...o,...l};return zd.set(r,u),u}function or(e,t=[],r="",n=0){const s=e.trim().length;for(let a=0;a<s;a++){const o=e[a],i=e.slice(a+1);switch(o){case",":return n===0?or(i,[...t,r.trim()]):or(i,t,`${r}${o}`,n);case"(":return or(i,t,`${r}${o}`,n+1);case")":return or(i,t,`${r}${o}`,n-1);default:return or(i,t,`${r}${o}`,n)}}if(r==="")return t;if(n!==0)throw new P8({current:r,depth:n});return t.push(r.trim()),t}function C1(e){return e==="address"||e==="bool"||e==="function"||e==="string"||f1.test(e)||m1.test(e)}const L8=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function z8(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||f1.test(e)||m1.test(e)||L8.test(e)}function R8(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Hd(e){const t={},r=e.length;for(let o=0;o<r;o++){const i=e[o];if(!jc(i))continue;const c=c8(i);if(!c)throw new Oa({signature:i,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const b=l[f].trim();if(!b)continue;const g=kn(b,{type:"struct"});u.push(g)}if(!u.length)throw new A8({signature:i});t[c.name]=u}const n={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[i,c]=s[o];n[i]=T1(c,t)}return n}const H8=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function T1(e=[],t={},r=new Set){const n=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(h1.test(o.type))n.push(o);else{const c=En(H8,o.type);if(!(c!=null&&c.type))throw new C8({abiParameter:o});const{array:l,type:u}=c;if(u in t){if(r.has(u))throw new S8({type:u});n.push({...o,type:`tuple${l??""}`,components:T1(t[u],t,new Set([...r,u]))})}else if(C1(u))n.push(o);else throw new y8({type:u})}}return n}function A1(e){const t=Hd(e),r=[],n=e.length;for(let s=0;s<n;s++){const a=e[s];jc(a)||r.push(Rd(a,t))}return r}function S1(e){let t;if(typeof e=="string")t=Rd(e);else{const r=Hd(e),n=e.length;for(let s=0;s<n;s++){const a=e[s];if(!jc(a)){t=Rd(a,r);break}}}if(!t)throw new b8({signature:e});return t}function P1(e){const t=[];if(typeof e=="string"){const r=or(e),n=r.length;for(let s=0;s<n;s++)t.push(kn(r[s],{modifiers:k1}))}else{const r=Hd(e),n=e.length;for(let s=0;s<n;s++){const a=e[s];if(jc(a))continue;const o=or(a),i=o.length;for(let c=0;c<i;c++)t.push(kn(o[c],{modifiers:k1,structs:r}))}}if(t.length===0)throw new x8({params:e});return t}function se(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const s=e[r];return typeof s=="function"?s:a=>t(e,a)}function _r(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new tv(e.type);return`${e.name}(${Vc(e.inputs,{includeName:t})})`}function Vc(e,{includeName:t=!1}={}){return e?e.map(r=>$8(r,{includeName:t})).join(t?", ":","):""}function $8(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Vc(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Mr(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function lt(e){return Mr(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const I1="2.43.3";let Go={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${I1}`},$=class Lm extends Error{constructor(t,r={}){var i;const n=(()=>{var c;return r.cause instanceof Lm?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),s=r.cause instanceof Lm&&r.cause.docsPath||r.docsPath,a=(i=Go.getDocsUrl)==null?void 0:i.call(Go,{...r,docsPath:s}),o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...Go.version?[`Version: ${Go.version}`]:[]].join(`
66
66
  `);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=I1}walk(t){return B1(this,t)}};function B1(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?B1(e.cause,t):t?null:e}class G8 extends ${constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
67
67
  `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class F1 extends ${constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`