PageSourceSearch

https://pancakeswap.finance/_next/static/chunks/pages/liquidity/create/[...selectId]-e79eb33f83b64921.js

js pancakeswap.finance collected 2026-10-01 10:14:06 UTC 103,291 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75db540c-3d69-481e-bd9a-1070dd0c4192",e._sentryDebugIdIdentifier="sentry-dbid-75db540c-3d69-481e-bd9a-1070dd0c4192")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7423],{19292:(e,t,n)=>{"use strict";n.d(t,{D:()=>A});var i=n(350979),l=n(769932),r=n(25963),s=n(680797),o=n(245009),a=n(673115),d=n(605641),u=n(326848),c=n(905470),p=n(490345),h=n(227159),m=n(53670),x=n(228876),v=n(835490),y=n(873433);let f=(0,s.Ay)(c.Y).withConfig({componentId:"sc-94307960-0"})(["&:hover{text-decoration:underline;}"]),A=()=>{var e;let t=(0,u.useRouter)(),{t:n}=(0,l.A)(),{chainId:s}=(0,m.ax)(),c=(0,r.useMemo)(()=>(0,x.hL)(s),[s]),{isInfinitySupported:A,isV2Supported:g,isV3Supported:C}=(0,y.S)(),b=A(s),j=(0,r.useCallback)(e=>e===v.TE.Infinity?b:e===v.TE.V3?C(s):e!==v.TE.V2||g(s),[s,b,g,C]),{protocolName:w,routeParams:k}=(0,p.gG)(),R=null==k||null==(e=k.selectId)?void 0:e[1],I=(0,r.useCallback)(e=>{var n,i;let l=e.value;if(!j(l))return;let r=null==k||null==(n=k.selectId)?void 0:n[2],s=null==k||null==(i=k.selectId)?void 0:i[3];r&&s?t.push(`/liquidity/create/${c}/${l}/${r}/${s}`):t.push(`/liquidity/create/${c}/${l}`)},[t,c,k,j]);return(0,i.jsxs)(o.A,{mb:"32px",children:[(0,i.jsx)(a.A,{href:"/liquidity/pools",children:(0,i.jsx)(d.A,{color:"primary60",children:n("Farms")})}),(0,i.jsx)(f,{to:"/liquidity/create",children:(0,i.jsx)(d.A,{color:"primary60",children:n("Create Liquidity Pool")})}),R&&(0,i.jsx)(h.r,{tabs:[{value:v.TE.Infinity,label:"Infinity",disabled:!b},{value:v.TE.V3,label:"V3",disabled:!C(s)},{value:v.TE.V2,label:"V2",disabled:!g(s)}],defaultTab:{value:w,label:w,disabled:!b},onTabChange:I})]})}},41811:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(350979);n(25963);var l=n(257057);let r=e=>(0,i.jsx)(l.A,{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17 4C18.5 4 19 4.5 19 6L19 8C20.1046 8 21 8.89543 21 10L21 17C21 19 20 20 17.999 20H6C4 20 3 19 3 17L3 7C3 5.5 4.5 4 6 4L17 4ZM5 7C5 6.44772 5.44772 6 6 6L19 6L19 8L6 8C5.44772 8 5 7.55229 5 7ZM17 16C18 16 19.001 15 19 14C18.999 13 18 12 17 12C16 12 15 13 15 14C15 15 16 16 17 16Z"})})},114041:(e,t,n)=>{"use strict";n.d(t,{Fr:()=>i,Lx:()=>r,gN:()=>l,nr:()=>s,zm:()=>o});var i=function(e){return e.COMMUNITY="Community",e.CORE="Core",e.BINANCE="Binance",e.AUTO="Auto",e}({}),l=function(e){return e.PENDING="pending",e.OPEN="open",e.CLOSE="close",e.CLAIMABLE="claimable",e}({});let r={Idle:"idle",Fetching:"pending",Fetched:"success",Failed:"error"},s=e=>!!(null==e?void 0:e.maximumAmountIn)&&!(null==e?void 0:e.route);var o=function(e){return e.LOWER="LOWER",e.UPPER="UPPER",e}({})},186757:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var i=n(25963),l=n(569019),r=n(241439),s=n(17581);let o=e=>{let{address:t}=(0,s.F)(),n=(0,l.Sd)(t,e,null==e?void 0:e.chainId);return(0,i.useMemo)(()=>(0,r.r)(n),[n])}},221197:(e,t,n)=>{"use strict";n.d(t,{j:()=>i});let i=[{inputs:[],name:"feeGrowthGlobal0X128",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"feeGrowthGlobal1X128",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"liquidity",outputs:[{internalType:"uint128",name:"",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"observations",outputs:[{internalType:"uint32",name:"blockTimestamp",type:"uint32"},{internalType:"int56",name:"tickCumulative",type:"int56"},{internalType:"uint160",name:"secondsPerLiquidityCumulativeX128",type:"uint160"},{internalType:"bool",name:"initialized",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"key",type:"bytes32"}],name:"positions",outputs:[{internalType:"uint128",name:"_liquidity",type:"uint128"},{internalType:"uint256",name:"feeGrowthInside0LastX128",type:"uint256"},{internalType:"uint256",name:"feeGrowthInside1LastX128",type:"uint256"},{internalType:"uint128",name:"tokensOwed0",type:"uint128"},{internalType:"uint128",name:"tokensOwed1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"protocolFees",outputs:[{internalType:"uint128",name:"token0",type:"uint128"},{internalType:"uint128",name:"token1",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"slot0",outputs:[{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"},{internalType:"int24",name:"tick",type:"int24"},{internalType:"uint16",name:"observationIndex",type:"uint16"},{internalType:"uint16",name:"observationCardinality",type:"uint16"},{internalType:"uint16",name:"observationCardinalityNext",type:"uint16"},{internalType:"uint32",name:"feeProtocol",type:"uint32"},{internalType:"bool",name:"unlocked",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"int16",name:"wordPosition",type:"int16"}],name:"tickBitmap",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"int24",name:"tick",type:"int24"}],name:"ticks",outputs:[{internalType:"uint128",name:"liquidityGross",type:"uint128"},{internalType:"int128",name:"liquidityNet",type:"int128"},{internalType:"uint256",name:"feeGrowthOutside0X128",type:"uint256"},{internalType:"uint256",name:"feeGrowthOutside1X128",type:"uint256"},{internalType:"int56",name:"tickCumulativeOutside",type:"int56"},{internalType:"uint160",name:"secondsPerLiquidityOutsideX128",type:"uint160"},{internalType:"uint32",name:"secondsOutside",type:"uint32"},{internalType:"bool",name:"initialized",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"fee",outputs:[{internalType:"uint24",name:"",type:"uint24"}],stateMutability:"view",type:"function"}]},227159:(e,t,n)=>{"use strict";n.d(t,{r:()=>c});var i=n(350979),l=n(769932),r=n(995315),s=n(557423),o=n(25963),a=n(680797);let d=(0,a.Ay)(r.A).attrs({flexWrap:"wrap",gap:"4px"}).withConfig({componentId:"sc-ef4f9161-0"})(["background-color:",";border-radius:",";padding:1px;width:fit-content;box-shadow:",";"],e=>{let{theme:t}=e;return t.colors.input},e=>{let{theme:t}=e;return t.radii.default},e=>{let{theme:t}=e;return t.shadows.inset}),u=(0,a.Ay)(s.A).attrs(e=>{let{$isActive:t,disabled:n}=e;return{scale:"sm",variant:t&&!n?"subtle":"light"}}).withConfig({componentId:"sc-ef4f9161-1"}
1)(["height:32px;font-size:14px;padding:0 12px;",""],e=>{let{disabled:t}=e;return t&&(0,a.AH)(["opacity:0.5;cursor:not-allowed;background-color:transparent;&:hover{opacity:0.5;}"])}),c=e=>{let{tabs:t=["3m","6m","1Y","All"],defaultTab:n="3m",onTabChange:r,...s}=e,{t:a}=(0,l.A)(),[c,p]=(0,o.useState)(n),h=(0,o.useCallback)(e=>{p(e),null==r||r(e)},[r]);return(0,o.useEffect)(()=>{n&&n!==c&&p(n)},[n]),(0,i.jsx)(d,{role:"tablist","aria-label":a("Select a tab"),...s,children:t.map(e=>{var t;let n="object"==typeof e&&"object"==typeof c?e.value===c.value:e===c;return(0,i.jsx)(u,{role:"tab",id:`tab-${JSON.stringify(e)}`,$isActive:n,"aria-selected":n,"aria-controls":`tabpanel-${JSON.stringify(e)}`,onClick:()=>h(e),disabled:!!("object"==typeof e&&e.disabled),children:"string"==typeof e?e:null!=(t=e.label)?t:e.value},JSON.stringify(e))})})}},247821:(e,t,n)=>{"use strict";n.d(t,{H:()=>i.H9});var i=n(559180)},252146:(e,t,n)=>{"use strict";n.d(t,{r:()=>s});var i=n(118708),l=n(25963),r=n(984566);let s=()=>{let[e,t]=(0,i.fp)(r.w);return[e,(0,l.useCallback)(e=>{(null==e?void 0:e.status)==="success"&&t({blockHash:e.blockHash,confirmedTime:Date.now()})},[t])]}},253110:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var i=n(432222),l=n(680797),r=n(913688);let s={SM:"sm",MD:"md"},o=e=>{let{scale:t}=e;switch(t){case s.SM:return"24px";case s.MD:default:return"32px"}},a=e=>{let{scale:t}=e;switch(t){case s.SM:return"12px";case s.MD:default:return"20px"}},d=l.I4.input.attrs({type:"radio"}).withConfig({shouldForwardProp:i.Ay}).withConfig({componentId:"sc-9e7c89ab-0"})(["appearance:none;overflow:hidden;cursor:pointer;position:relative;display:inline-block;height:",";width:",";vertical-align:middle;transition:background-color 0.2s ease-in-out;border:",";border-radius:50%;background-color:",";box-shadow:",';&:after{border-radius:50%;content:"";height:',";left:6px;position:absolute;top:6px;width:",";}&:hover:not(:disabled):not(:checked){box-shadow:",";}&:focus{outline:none;box-shadow:",";}&:checked{border:0;background-color:",";&:after{background-color:",";}}&:disabled{border:0;cursor:default;opacity:0.6;}",""],o,o,e=>{let{theme:t}=e;return t.isDark?`solid 1px ${t.colors.disabled}`:"0"},e=>{let{theme:t}=e;return t.colors.cardBorder},e=>{let{theme:t}=e;return t.shadows.inset},a,a,e=>{let{theme:t}=e;return t.shadows.focus},e=>{let{theme:t}=e;return t.shadows.focus},e=>{let{theme:t}=e;return t.colors.success},e=>{let{theme:t}=e;return t.radio.handleBackground},r.xe);d.defaultProps={scale:s.MD,m:0};let u=d},265449:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(350979);n(25963);var l=n(257057);let r=e=>(0,i.jsx)(l.A,{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{d:"M17.65 6.35C16.02 4.72 13.71 3.78 11.17 4.04C7.50002 4.41 4.48002 7.39 4.07002 11.06C3.52002 15.91 7.27002 20 12 20C15.19 20 17.93 18.13 19.21 15.44C19.53 14.77 19.05 14 18.31 14C17.94 14 17.59 14.2 17.43 14.53C16.3 16.96 13.59 18.5 10.63 17.84C8.41002 17.35 6.62002 15.54 6.15002 13.32C5.31002 9.44 8.26002 6 12 6C13.66 6 15.14 6.69 16.22 7.78L14.71 9.29C14.08 9.92 14.52 11 15.41 11H19C19.55 11 20 10.55 20 10V6.41C20 5.52 18.92 5.07 18.29 5.7L17.65 6.35Z"})})},274584:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(350979);n(25963);var l=n(257057);let r=e=>(0,i.jsx)(l.A,{viewBox:"0 0 24 24",...e,children:(0,i.jsx)("path",{d:"M4.47 20.9999H19.53C21.07 20.9999 22.03 19.3299 21.26 17.9999L13.73 4.98993C12.96 3.65993 11.04 3.65993 10.27 4.98993L2.74 17.9999C1.97 19.3299 2.93 20.9999 4.47 20.9999ZM12 13.9999C11.45 13.9999 11 13.5499 11 12.9999V10.9999C11 10.4499 11.45 9.99993 12 9.99993C12.55 9.99993 13 10.4499 13 10.9999V12.9999C13 13.5499 12.55 13.9999 12 13.9999ZM13 17.9999H11V15.9999H13V17.9999Z"})})},285684:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>nq});var i=n(350979),l=n(927122),r=n(490345),s=n(87242),o=n.n(s),a=n(18468),d=n(19292),u=n(25963),c=n(672946),p=n(554945),h=n(807543),m=n(150591),x=n(796147),v=n(559307),y=n(530957),f=n(662949),A=n(273523),g=n(769932),C=n(428089),b=n(995315),j=n(796259),w=n(525033),k=n(67002),R=n(205899),I=n(605641),E=n(265349),S=n(687287),T=n(100862),N=n(488907),U=n(228876),O=n(469398);let M=e=>{let{...t}=e,{t:n}=(0,g.A)(),[l,r]=(0,T.QG)(),[s,o]=(0,T.CJ)(),{currency0:a,currency1:d}=(0,O.Z)(),c=a&&!(0,U.fT)(a.chainId)?a:void 0,p=d&&!(0,U.fT)(d.chainId)?d:void 0,[h]=(0,T.ui)(),[m]=(0,N.h2)(),x=(0,u.useMemo)(()=>null===l||!!l&&l>=Number(A.AL)&&l<=Number(A.sE),[l]),v=(0,S.hx)(c,p),y=(0,S.hx)(p,c),f=(0,u.useCallback)(e=>{if(r(""===e?null:Number(e)),h&&""!==e&&null!==s&&c&&p){let t=m?y(h):v(h);if(!t||t.numerator<=0n)return void o(null);o((0,A.qf)(m?t.invert():t,Number(e)))}},[s,c,p,m,o,r,h,v,y]),[M,B]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{M||null!==l||(r(10),B(!0))},[l,M,r]),(0,i.jsxs)(C.Ay,{...t,children:[(0,i.jsxs)(b.A,{gap:"4px",children:[(0,i.jsx)(j.y,{mb:"8px",children:n("Bin Step")}),(0,i.jsx)(w.PT,{placement:"auto",mb:"8px",color:"secondary",text:n("A bin represents 0.01% price change. BinSpacing of 3 implies 1.0001^3 price change between two consecutive bins")})]}),(0,i.jsx)(k.R,{className:R.inputContainerVariants({error:!x}),children:(0,i.jsx)(k.R,{display:"flex",flexDirection:"row",flexWrap:"nowrap",color:"text",px:"16px",py:"8px",children:(0,i.jsx)(E.p,{fontSize:"20px",align:"left",value:null!=l?l:"",onUserInput:f,min:A.AL.toString(),max:A.sE.toString(),pattern:"^[0-9]*$",error:!x,placeholder:n("Numerical Value")})})}),!x&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(I.A,{mt:"8px",color:"failure",small:!0,children:n("Bin Step must be between %min% and %max%",{min:A.AL.toString(),max:A.sE.toString()})})})]})};var B=n(727353);let _=e=>{let{...t}=e,{t:n}=(0,g.A)(),[l,r]=(0,T.Iq)(),s=(0,u.useMemo)(()=>null===l||l>=Number(A.nA)&&l<=Number(A.LH),[l]),[o,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{o||null!==l||(r(1),a(!0))},[l,r,o]),(0,i.jsxs)(C.Ay,{...t,children:[(0,i.jsxs)(b.A,{gap:"4px",children:[(0,i.jsx)(j.y,{mb:"8px",children:n("TickSpacing")}),(0,i.jsx)(w.PT,{mb:"8px",placement:"auto",color:"secondary",text:n("A tick represents 0.01% price change. Ticks divisible by TickSpacing can only be initialised e.g., with TickSpacing of 3, every 3rd tick must be initialized , i.e., ..., -6, -3, 0, 3, 6, …")})]}),(0,i.jsx)(B.A,{value:null!=l?l:"",onChange:e=>r(""===e.target.value?null:Number(e.target.value)),min:A.nA.toString(),max:A.LH.toString(),isError:!s,placeholder:"0",inputMode:"decimal"}),!s&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(I.A,{mt:"8px",color:"failure",small:!0,children:n("Tick Spacing must be between %min% and %max%",{min:A.nA.toString(),max:A.LH.toString()})})})]})};var L=n(726072),P=n(512928),Y=n(457258),q=n(796898),D=n(501823),V=n(779243),$=n(253110),F=n(53847),W=n(747292),z=n(673115),H=n(28192),Q=n(32654),G=n(490233),Z=n(557423),X=n(312680),J=n(979480),K=n(579518),ee=n(127243),et=n(348221),en=n(680797);let ei=(0,en.Ay)(C.Ay).withConfig({componentId:"sc-d38fb7cd-0"})(["border-radius:999px;font-size:14px;padding:4px 8px;width:fit-content;display:flex;align-items:center;user-select:none;"]),el=e=>{let{isVerified:t,showNonVerified:n=!1}
1=e,{t:l}=(0,g.A)(),{targetRef:r,tooltip:s,tooltipVisible:o}=(0,K.A)(l(t?"Contract is verified on block explorer":"Contract is not verified on block explorer"));return t||n?(0,i.jsxs)(ei,{ref:r,backgroundColor:t?"success":"disabled",color:t?"background":"inverted",children:[t?(0,i.jsxs)(i.Fragment,{children:[l("Verified"),(0,i.jsx)(ee.A,{width:"14px",color:"background",ml:"3px"})]}):l("Non-Verified"),o&&s]}):null},er=e=>{let{isUpgradable:t}=e,{t:n}=(0,g.A)(),{targetRef:l,tooltip:r,tooltipVisible:s}=(0,K.A)(n(t?"Contract is designed to be upgradeable. Future behavior may differ from current implementation. Select at your own risk":"Contract is not upgradeable. You can expect consistent behavior over time"));return(0,i.jsxs)(ei,{ref:l,backgroundColor:t?"failure":"success",color:"background",children:[t?(0,i.jsx)(i.Fragment,{children:n("Upgradable")}):(0,i.jsxs)(i.Fragment,{children:[n("Non-upgradable")," ",(0,i.jsx)(et.A,{color:"background",ml:"3px"})]}),s&&r]})};var es=n(966983),eo=n(575058),ea=n(869594),ed=n.n(ea),eu=n(179087),ec=n(407811),ep=n(876397);let eh=e=>{let{placeholder:t="All",data:n,value:l,onChange:r}=e,{theme:s}=(0,eu.DP)(),[o,a]=(0,u.useState)(!1),d=(0,u.useCallback)(e=>r(e.value),[r]);return(0,i.jsx)(ep.m,{$isShow:o,children:(0,i.jsx)(ec.K,{multiple:!0,style:{backgroundColor:s.colors.input},panelStyle:{backgroundColor:s.colors.input},scrollHeight:"30vh",options:n,isShowSelectAll:!1,placeholder:t,value:l,onChange:d,onShow:()=>a(!0),onHide:()=>a(!1)})})};var em=n(399832),ex=n(575457),ev=n(733775),ey=n(29545);let ef=e=>{let{hook:t}=e,n=(e=>(0,u.useMemo)(()=>{let t=[];return(null==e?void 0:e.poolType)&&t.push(null==e?void 0:e.poolType),(null==e?void 0:e.category)&&t.push(...null==e?void 0:e.category),t},[null==e?void 0:e.poolType,null==e?void 0:e.category]))(t);return(0,i.jsx)(i.Fragment,{children:n&&n.map(e=>Object.values(A.KG).includes(e)?(0,i.jsx)(ey.cQ,{poolType:e}):(0,i.jsx)(ey.RI,{children:(0,i.jsx)(I.A,{color:"textSubtle",small:!0,children:e})}))})},eA=(0,en.Ay)(C.Ay).withConfig({componentId:"sc-a66cb797-0"})(["padding:16px;background-color:",";border:1px solid ",";border-radius:",";&:first-of-type{margin-top:140px;}&:only-of-type{margin-top:0;}","{&:first-of-type{margin-top:0;}}"],e=>{let{theme:t}=e;return t.colors.backgroundAlt},e=>{let{theme:t}=e;return t.colors.cardBorder},e=>{let{theme:t}=e;return t.radii["20px"]},e=>{let{theme:t}=e;return t.mediaQueries.sm}),eg=e=>{let{onClick:t,hookData:n}=e,{t:l}=(0,g.A)(),{isMobile:r}=(0,q.A)();return(0,i.jsxs)(eA,{children:[(0,i.jsxs)(D.A,{justifyContent:"space-between",flexDirection:["column","column","row"],children:[(0,i.jsxs)(I.A,{bold:!0,children:[" ",n.name," "]}),(0,i.jsx)(b.A,{gap:"5px",mt:["10px","10px","0"],flexWrap:"wrap",children:(0,i.jsx)(ef,{hook:n})})]}),(0,i.jsxs)(b.A,{mt:"16px",justifyContent:"space-between",gap:"12px",children:[(0,i.jsx)(C.Ay,{maxWidth:"70%",children:(0,i.jsx)(I.A,{color:"textSubtle",small:!0,style:{lineBreak:"auto"},children:(0,ev.EJ)(n.description,r?100:220)})}),(0,i.jsx)(C.Ay,{children:(0,i.jsxs)(Z.A,{onClick:t,children:[" ",l("Select")," "]})})]}),(0,i.jsx)(b.A,{mt:"16px",gap:"5px",alignItems:"center",justifyContent:r?"space-between":"normal",children:(0,i.jsx)(em.A,{href:n.github,small:!0,icon:(0,i.jsx)(ex.A,{width:"16px"}),style:{cursor:"pointer"},children:l("Learn More")})})]})},eC=(0,en.Ay)(es.Bs).withConfig({componentId:"sc-8b91ecd-0"})(["width:100%;max-height:80vh;display:flex;flex-direction:column;","{min-height:auto;min-width:720px;max-width:820px !important;}"],e=>{let{theme:t}=e;return t.mediaQueries.md}),eb=(0,en.Ay)(es.cw).withConfig({componentId:"sc-8b91ecd-1"})(["padding:8px;","{padding:24px;}background-color:",";overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"],e=>{let{theme:t}=e;return t.mediaQueries.sm},e=>{let{theme:t}=e;return t.colors.backgroundDisabled}),ej=(0,en.Ay)(b.A).withConfig({componentId:"sc-8b91ecd-2"})(["& > div{max-width:100%;}","{& > div{max-width:50%;}}"],e=>{let{theme:t}=e;return t.mediaQueries.sm}),ew=Object.keys(A.jq).map(e=>({label:A.jq[e],value:e})),ek=e=>{let{onDismiss:t,isOpen:n,closeOnOverlayClick:l=!0,data:r,onItemClick:s}=e,{t:o}=(0,g.A)(),{isMobile:a}=(0,q.A)(),[d,c]=(0,u.useState)(),[p,h]=(0,u.useState)(),m=(0,u.useMemo)(()=>r.filter(e=>(!(null==p?void 0:p.length)||!e.poolType||p.includes(e.poolType))&&(!(null==d?void 0:d.length)||!e.category||ed()(d.map(e=>A.jq[e]),e.category).length)),[d,r,p]),x=(0,u.useCallback)(()=>{c([]),h(void 0)},[]);return(0,i.jsx)(X.aF,{onDismiss:t,isOpen:n,closeOnOverlayClick:l,children:(0,i.jsxs)(eC,{children:[(0,i.jsxs)(es.rQ,{style:{border:"none"},children:[(0,i.jsx)(es.wt,{children:(0,i.jsx)(eo.A,{padding:"0px",children:o("Hook List (%hooksCount%)",{hooksCount:m.length})})}),(0,i.jsx)(es.s_,{onDismiss:t})]}),(0,i.jsx)(ej,{padding:"0 16px 16px",gap:"24px",children:(0,i.jsx)(eh,{placeholder:o("All categories"),onChange:c,data:ew,value:d})}),(0,i.jsx)(eb,{alignItems:"center",justifyContent:"center",children:m.length?(0,i.jsx)(b.A,{flexDirection:"column",gap:"12px",children:m.map(e=>(0,i.jsx)(eg,{hookData:e,onClick:()=>s(e)},`${e.address}`))}):(0,i.jsxs)(C.Ay,{minHeight:"30vh",children:[(0,i.jsx)(I.A,{color:"textSubtle",size:"sm",children:o("No hooks available with the selected filters")}),(0,i.jsx)(Z.A,{variant:"textPrimary60",scale:"xs",p:"16px",onClick:x,children:o("Reset filters")})]})})]})})};var eR=n(563190);let eI=e=>(0,i.jsx)(I.A,{color:"#7A6EAA",fontSize:"12px",bold:!0,textTransform:"uppercase",...e}),eE=e=>{var t;let{selectedHook:n}=e,{t:l}=(0,g.A)(),r=null!=(t=null==n?void 0:n.learnMoreLink)?t:null==n?void 0:n.github;return(null==n?void 0:n.name)?(0,i.jsxs)(b.A,{flexDirection:"column",gap:"8px",children:[(0,i.jsxs)(b.A,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(eI,{children:l("Hook Name")}),r&&(0,i.jsx)(z.A,{href:r,target:"_blank",rel:"noopener noreferrer",children:(0,i.jsxs)(H.A,{scale:"xs",variant:"textPrimary60",children:[l("Hook details"),(0,i.jsx)(Q.A,{ml:"4px",color:"primary60",width:"18px"})]})})]}),(0,i.jsx)(I.A,{children:n.name})]}):null},eS=e=>{let{selectedHook:t}=e;return(0,i.jsx)(b.A,{gap:"8px",flexWrap:"wrap",children:(0,i.jsx)(ef,{hook:t})})},eT=e=>{let{address:t="",children:n}=e,{t:l}=(0,g.A)();return(0,i.jsxs)(b.A,{flexDirection:"column",gap:"8px",children:[(0,i.jsxs)(b.A,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(eI,{children:l("Hook Address")}),(0,i.jsx)(G.i,{text:t,tooltipMessage:l("Copied to clipboard"),buttonColor:"primary60",children:(0,i.jsx)(I.A,{color:"primary60",bold:!0,fontSize:"12px",mr:"4px",children:l("Copy address")})})]}),null!=n?n:(0,i.jsx)(I.A,{style:{wordBreak:"break-all"},children:t})]})},eN=e=>{let{selectedHook:t}=e;return t?(0,i.jsxs)(b.A,{gap:"8px",children:[(0,i.jsx)(el,{isVerified:null==t?void 0:t.isVerified,showNonVerified:!0}),(null==t?void 0:t.isVerified)&&(0,i.jsx)(er,{isUpgradable:t.isUpgradable})]}):null},eU=e=>{let{selectedHook:t,onOpen:n}=e,{t:l}=(0,g.A)(),r={scale:J.C.MD,width:"100%",onClick:n};return(0,i.jsxs)(b.A,{flexDirection:"column",gap:"8px",children:[(0,i.jsx)(eI,{children:l("Import from List")}),t?(0,i.jsx)(Z.A,{variant:"secondary",...r,children:l("Change Hook")}):(0,i.jsx)(Z.A,{variant:"primary",...r,children:l("Select Hook")})]})}
1,eO=e=>{let{onHookChange:t}=e,n=(0,X.jN)(),{onDismiss:l,onOpen:s}=n,{chainId:o}=(0,r.i0)(),[a,d]=(0,eR.$)(t),[c]=(0,T.fk)(),p=(0,Y.SA)(o,c),h=(0,u.useCallback)(e=>{d(e),l()},[l,d]);return(0,i.jsxs)(b.A,{gap:"8px",flexDirection:"column",children:[a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eE,{selectedHook:a}),(0,i.jsx)(eS,{selectedHook:a}),(0,i.jsx)(W.A,{}),(0,i.jsx)(eT,{address:a.address}),(0,i.jsx)(eN,{selectedHook:a}),(0,i.jsx)(W.A,{})]}):null,(0,i.jsx)(eU,{selectedHook:a,onOpen:s}),n.isOpen?(0,i.jsx)(ek,{...n,data:p,onItemClick:h}):null]})};var eM=n(805017),eB=n(92292),e_=n(553588),eL=n(2889),eP=n(943460);let eY=(0,en.Ay)(B.A).withConfig({componentId:"sc-fe45afeb-0"})(["box-shadow:",";"],e=>{let{theme:t,$isDanger:n}=e;return n?t.shadows.danger:""}),eq=e=>{let{onHookChange:t}=e,{t:n}=(0,g.A)(),l=(0,u.useRef)(null),r=(0,u.useRef)(!1),{manualHookAddress:s,manualHook:o,setManualHook:a,isVerifing:d}=(0,eP.v)(t),c=null==o?void 0:o.isVerified;return(0,u.useLayoutEffect)(()=>{var e,t;if(d&&(null==(e=l.current)?void 0:e.disabled)){r.current=!0;return}!d&&r.current&&(r.current=!1,null==(t=l.current)||t.focus())},[d]),(0,i.jsxs)(b.A,{flexDirection:"column",gap:"8px",children:[(0,i.jsx)(eT,{address:null==o?void 0:o.address,children:(0,i.jsxs)(C.Ay,{position:"relative",children:[(0,i.jsx)(eY,{ref:l,value:s,onChange:e=>a(e.target.value),placeholder:n("Hook Contract Address"),$isDanger:""!==s&&!(0,eL.P)(s),style:{paddingRight:s?"40px":"10px"},disabled:d}),s?(0,i.jsx)(C.Ay,{position:"absolute",right:"14px",top:"50%",style:{transform:"translateY(-50%)"},children:d?(0,i.jsx)(eM.m,{}):c?(0,i.jsx)(e_.A,{color:"success"}):(0,i.jsx)(eB.A,{color:"failure"})}):null]})}),(0,i.jsx)(eN,{selectedHook:o}),!(0,eL.P)(s)&&s&&(0,i.jsx)(I.A,{color:"failure",children:n("Invalid hook address")}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.A,{}),(0,i.jsx)(eE,{selectedHook:o}),(0,i.jsx)(eS,{selectedHook:o})]})]})};var eD=n(324812);let eV=e=>{let{onHookChange:t,onHookEnabledChange:n,...l}=e,{t:r}=(0,g.A)(),{isXs:s}=(0,q.A)(),[o,a]=(0,eD.h)(),[d,c]=(0,eD.o)(),[,p]=(0,T.ae)(),h=(0,u.useCallback)(e=>{c(e),"manual"===e&&p(null)},[c]),m=(0,u.useCallback)(()=>{let e=!o;a(e),null==n||n(e)},[o,n,a]);return(0,i.jsxs)(C.Ay,{...l,children:[(0,i.jsxs)(D.A,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(j.y,{children:r("Enable Hook Settings")}),null!==o?(0,i.jsx)(V.A,{scale:"md",checked:o,onChange:m}):null]}),(0,i.jsx)(v.x,{mt:"12px",disabled:!o,children:(0,i.jsx)(F.Al,{padding:"16px",children:(0,i.jsxs)(x.mm,{gap:"8px",children:[(0,i.jsxs)(b.A,{gap:"24px",flexDirection:s?"column":"row",children:[(0,i.jsxs)(D.A,{alignItems:"center",children:[(0,i.jsx)("label",{htmlFor:"radio-hook-selection-1",children:(0,i.jsx)(I.A,{mr:"8px",style:{whiteSpace:"nowrap"},children:r("Select from List")})}),(0,i.jsx)($.A,{scale:"sm",id:"radio-hook-selection-1",name:"radio-hook-selection",onChange:()=>h("list"),checked:"list"===d})]}),(0,i.jsxs)(D.A,{alignItems:"center",children:[(0,i.jsx)("label",{htmlFor:"radio-hook-selection-2",children:(0,i.jsx)(I.A,{mr:"8px",children:r("Manually")})}),(0,i.jsx)($.A,{ml:"8px",scale:"sm",id:"radio-hook-selection-2",name:"radio-hook-selection",onChange:()=>h("manual"),checked:"manual"===d})]})]}),o&&d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.A,{}),(0,i.jsx)(C.Ay,{children:"manual"===d?(0,i.jsx)(eq,{onHookChange:t}):(0,i.jsx)(eO,{onHookChange:t})})]}):null]})})})]})},e$=()=>{let[,e]=(0,eR.$)(),{setManualHook:t}=(0,eP.v)(),[,n]=(0,eD.h)(),[,i]=(0,eD.o)();return(0,u.useCallback)(()=>{t(void 0),e(void 0),i("list"),n(!1)},[n,t])},eF=e=>{let{...t}=e,[n,l]=(0,T.tQ)(),[s,o]=(0,eR.$)(),[,a]=(0,eD.h)(),[d,c]=(0,eD.o)(),{chainId:p}=(0,r.i0)(),[h]=(0,T.fk)(),m=(0,Y.dg)(p,h),x=e$(),v=(0,u.useCallback)(e=>{l((0,P.g4)(e)?"dynamic":"static")},[l]),y=(0,u.useCallback)(e=>{e||"dynamic"!==n||l("static")},[l,n]);return(0,u.useEffect)(()=>{"dynamic"===n&&"list"===d?(s||o(m),a(!0),c("list"),s&&s.poolType!==h&&(o(void 0),a(!1),l("static"))):"static"===n&&(0,P.g4)(s)&&x()},[m,n,s,o,a,c,l,h,d,x]),(0,i.jsx)(eV,{onHookEnabledChange:y,onHookChange:v,...t})};
1var eW=n(892977),ez=n(924330),eH=n(842807),eQ=n(182063),eG=n(404510);let eZ=e=>{let{...t}=e,{t:n}=(0,g.A)(),{chainId:l}=(0,r.i0)(),{baseCurrency:s,quoteCurrency:o}=(0,O.Z)(),{handleBaseCurrencySelect:a,handleQuoteCurrencySelect:d}=(()=>{let{updateParams:e}=(0,r.i0)(),{baseCurrency:t,quoteCurrency:n}=(0,O.Z)(),{resetAmounts:i,switchDepositAmounts:l}=(0,eG.d9)(),s=(0,u.useCallback)(r=>{(null==n?void 0:n.isNative)&&r.isNative||(null==n?void 0:n.isToken)&&r.isToken&&n.address.toLowerCase()===r.address.toLowerCase()?(e({currencyIdA:(0,eQ.A)(n),currencyIdB:(0,eQ.A)(t)}),l()):(e({currencyIdA:(0,eQ.A)(r)}),i())},[n,e,t,l,i]),o=(0,u.useCallback)(r=>{(null==t?void 0:t.isNative)&&r.isNative||(null==t?void 0:t.isToken)&&r.isToken&&t.address.toLowerCase()===r.address.toLowerCase()?(e({currencyIdA:(0,eQ.A)(n),currencyIdB:(0,eQ.A)(t)}),l()):(e({currencyIdB:(0,eQ.A)(r)}),i())},[t,e,n,l,i]);return{baseCurrency:t,quoteCurrency:n,handleBaseCurrencySelect:s,handleQuoteCurrencySelect:o}})(),{isXs:c}=(0,q.A)();return(0,i.jsxs)(C.Ay,{...t,children:[(0,i.jsx)(j.y,{mb:"8px",children:n("Choose Token Pair")}),(0,i.jsxs)(b.A,{gap:"4px",width:"100%",mb:"8px",alignItems:"center",flexDirection:c?"column":"row",children:[(0,i.jsx)(ez.y,{id:"create-liquidity-form-select-base-currency",chainId:l,selectedCurrency:s,otherSelectedCurrency:o,onCurrencySelect:a,showCommonBases:!0,commonBasesType:eH.AS.LIQUIDITY,hideBalance:!0}),(0,i.jsx)(eW.A,{color:"textSubtle"}),(0,i.jsx)(ez.y,{id:"create-liquidity-form-select-quote-currency",chainId:l,selectedCurrency:o,otherSelectedCurrency:s,onCurrencySelect:d,showCommonBases:!0,commonBasesType:eH.AS.LIQUIDITY,hideBalance:!0})]})]})};var eX=n(465840),eJ=n(770773),eK=n(326763),e0=n(205765),e1=n(955647),e9=n(91168),e2=n(810286),e6=n(519901),e3=n(112788),e8=n(898719),e5=n(287183);let e7=RegExp("^\\d*(?:\\\\[.])?\\d*$"),e4=e=>{let{...t}=e,{t:n}=(0,g.A)(),{quoteCurrency:l,baseCurrency:s,currency0:o,currency1:a}=(0,O.Z)(),{isBin:d}=(0,e5.lb)(),[c,p]=(0,T.ui)(),[h]=(0,T.QG)(),[m,x]=(0,T.CJ)(),[,v]=(0,N.H4)(),[,y]=(0,N.N_)(),{isMobile:f,isTablet:w}=(0,q.A)(),k=f||w?12:7,R=(0,u.useMemo)(()=>(0,ev.EJ)(null==l?void 0:l.symbol,k),[l,k]),E=(0,u.useMemo)(()=>(0,ev.EJ)(null==s?void 0:s.symbol,k),[s,k]),U=(0,eu.aq)(),[M]=(0,N.h2)(),B=(0,eu.Sz)(M),[_,L]=(0,u.useState)(!1),{switchCurrencies:P}=(0,r.i0)(),[,,Y]=(0,e6.r)(o,a),D=(0,u.useMemo)(()=>Y?M?Y.invert():Y:void 0,[Y,M]),V=(0,S.xm)(D),$=(0,S.hx)(o,a),F=(0,S.hx)(a,o),W=(0,u.useCallback)(e=>{if(d&&null!==h){let t=M?F(new e9.A(e).toJSON()):$(new e9.A(e).toJSON());!t||t.numerator<=0n?x(null):x((0,A.qf)(M?t.invert():t,h))}},[h,M,d,$,F,x]),z=(0,u.useCallback)(e=>{if(null!==e)if(""===e)p(null),d?(x(null),v({lowerBinId:null,upperBinId:null})):y({lowerTick:null,upperTick:null});else{let t=new e9.A(e).toJSON();p(t),W(t)}},[d,x,v,p,y,W]);(0,u.useEffect)(()=>{U&&!_&&s&&l&&d&&null!==h&&null!==c&&(W(c),L(!0))},[d,h,c,x,m,s,l,U,M,z,W,_]),(0,u.useEffect)(()=>{if(U&&B!==M&&null!==c){let e=B?(0,e3.m)(l,s,c.toString()):(0,e3.m)(s,l,c.toString()),t=null==e?void 0:e.invert();z((null==t?void 0:t.denominator)?t.toFixed(8):null)}},[B,M,U,c,z,l,s]);let H=(0,u.useCallback)(()=>{if(V){let e=(0,e1.$g)(V);e&&z(e)}},[V,z]),{tooltip:Q,tooltipVisible:G,targetRef:Z}=(0,K.A)(n("The price is an estimation of the current market price. Please verify before using it."),{avoidToStopPropagation:!0});return(0,i.jsxs)(C.Ay,{...t,children:[(0,i.jsxs)(b.A,{gap:"4px",mb:"8px",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",children:[(0,i.jsx)(b.A,{mt:["16px","16px","16px","16px","16px","0"],gap:"5px",alignItems:"center",children:(0,i.jsx)(j.y,{children:n("Set Starting Price")})}),Y&&(0,i.jsxs)(b.A,{gap:"4px",alignItems:"center",flexWrap:"wrap",children:[(0,i.jsxs)("div",{ref:Z,children:[(0,i.jsxs)(tt,{onClick:H,children:[(0,i.jsx)("span",{children:n("Use Market Price")}),(0,i.jsx)(eB.A,{color:"primary60",width:"18px"})]}),G&&Q]}),(0,i.jsxs)(b.A,{gap:"4px",alignItems:"center",flexWrap:"wrap",children:[(0,i.jsxs)(e2.g3,{mode:"price",price:D,color:"textSubtle",small:!0,bold:!0,children:[(0,e1.$g)(V)," "]}),(0,i.jsx)(I.A,{color:"textSubtle",small:!0,children:n("%assetA% = 1 %assetB%",{assetA:M?null==o?void 0:o.symbol:null==a?void 0:a.symbol,assetB:M?null==a?void 0:a.symbol:null==o?void 0:o.symbol})}),(0,i.jsx)(eJ.A,{role:"button",color:"primary60",onClick:P,style:{cursor:"pointer"}})]})]})]}),(0,i.jsx)(te,{value:c,onUserInput:z,unit:R,baseUnit:E,currency:l})]})},te=e=>{let{value:t,onUserInput:n,unit:l,baseUnit:r,currency:s}=e,{t:o}=(0,g.A)(),[a,d]=(0,u.useState)(t),c=(0,eu.aq)();(0,u.useEffect)(()=>
1{if(c){if(null===t&&null!==a)return void d(null);if(null!==t&&null!==a&&parseFloat(a)!==parseFloat(t)&&!String(t).endsWith("."))return void d(t);null===a&&null!==t&&d(t)}},[a,c,t]);let p=(0,u.useCallback)(e=>{let t=e.replace(/,/g,".");if(""===t||e7.test((0,e0.N)(t))){if(d(t),t.endsWith("."))return;n(t)}},[n]);return(0,i.jsxs)(b.A,{gap:"8px",alignItems:"center",children:[(0,i.jsx)(C.Ay,{style:{flex:1,minWidth:0},children:(0,i.jsx)(eK.A,{value:null!=a?a:"",onUserInput:p,appendComponent:s?(0,i.jsx)(e8.Z,{currency:s,size:"24px",showChainLogo:!0}):null,unit:(0,i.jsx)(I.A,{color:"textSubtle",bold:!0,children:l}),placeholder:"0.00",inputProps:{style:{height:"24px"},step:"any",pattern:"^[0-9]*[.,]?[0-9]{0,18}$",inputMode:"decimal"}})}),r&&(0,i.jsx)(I.A,{color:"textSubtle",bold:!0,style:{whiteSpace:"nowrap"},children:o("= 1 %asset%",{asset:r})})]})},tt=(0,en.Ay)(Z.A).attrs({scale:"xs",variant:"text"}).withConfig({componentId:"sc-2640c907-0"})(["height:24px;padding:4px 8px;font-size:12px;font-weight:600;border-radius:8px;display:flex;align-items:center;gap:4px;background:transparent;border:2px solid ",";color:",";"],e=>{let{theme:t}=e;return t.colors.primary},e=>{let{theme:t}=e;return t.colors.primary60});var tn=n(734658),ti=n(18201),tl=n(23644),tr=n(186757);let ts=e=>{let{chainId:t,baseCurrency:n,quoteCurrency:l,handleDepositAmountChange:r,inputValue0:s,inputValue1:o,addOnly:a,isDepositEnabled:d,isDeposit0Enabled:c,isDeposit1Enabled:p,...h}=e,{t:m}=(0,g.A)(),[v]=(0,N.h2)(),y=(0,tr.Y)(n),f=(0,tr.Y)(l);(0,S.yx)(n),(0,S.yx)(l);let A=(0,S.wG)(n),b=(0,S.wG)(l),w=(0,u.useCallback)(e=>{r(e,+!!v)},[v,r]),k=(0,u.useCallback)(e=>{r(e,+!v)},[v,r]),[R,I]=(0,u.useMemo)(()=>v?[p,c]:[c,p],[v,c,p]),[E,T]=(0,u.useMemo)(()=>v?[o,s]:[s,o],[v,s,o]),U=!d||!R,O=!d||!I;return(0,i.jsx)(C.Ay,{...h,children:(0,i.jsxs)(x.mm,{gap:"8px",children:[(0,i.jsx)(tl.S,{currency:n}),(0,i.jsx)(tl.S,{currency:l}),(0,i.jsx)(ti.A,{id:"infinity-add-liquidity-input-base-currency",title:(0,i.jsx)(j.y,{children:m("Deposit Amount")}),onUserInput:w,showMaxButton:!0,defaultValue:d?R?null!=E?E:"":m(a?"The price range is outside current pool price":"The starting price is outside the specified price range"):m(a?"Set price range first":"Set starting price and price range first"),onPercentInput:e=>{var t;let n=null==y?void 0:y.multiply(new tn.QE(e,100));w(n&&null!=(t=A(n))?t:"")},currency:n,showUSDPrice:!0,showQuickInputButton:!0,disabled:U,showCommonBases:!0,showSearchInput:!0,disableCurrencySelect:!0,maxAmount:y,onMax:()=>{var e;return U?void 0:w(y&&null!=(e=A(y))?e:"")}}),(0,i.jsx)(ti.A,{id:"infinity-add-liquidity-input-quote-currency",title:(0,i.jsx)(i.Fragment,{children:"\xa0"}),onUserInput:k,showMaxButton:!0,defaultValue:d?I?null!=T?T:"":m(a?"The price range is outside current pool price":"The starting price is outside the specified price range"):m(a?"Set price range first":"Set starting price and price range first"),onPercentInput:e=>{var t;let n=null==f?void 0:f.multiply(new tn.QE(e,100));k(n&&null!=(t=b(n))?t:"")},currency:l,showUSDPrice:!0,showQuickInputButton:!0,disabled:O,showCommonBases:!0,showSearchInput:!0,maxAmount:f,onMax:()=>{var e;return O?void 0:k(f&&null!=(e=b(f))?e:"")},disableCurrencySelect:!0})]})})},to=e=>{let{...t}=e,{chainId:n}=(0,r.i0)(),{baseCurrency:l,quoteCurrency:s}=(0,O.Z)(),o=l&&!(0,U.fT)(l.chainId)?l:void 0,a=s&&!(0,U.fT)(s.chainId)?s:void 0,{handleDepositAmountChange:d,inputValue0:u,inputValue1:c}=(0,eG.d9)(),{isDeposit0Enabled:p,isDepositEnabled:h,isDeposit1Enabled:m}=(0,eG.wp)();return(0,i.jsx)(C.Ay,{children:(0,i.jsx)(ts,{...t,chainId:n,baseCurrency:o,quoteCurrency:a,handleDepositAmountChange:d,inputValue0:u,inputValue1:c,isDepositEnabled:h,isDeposit0Enabled:p,isDeposit1Enabled:m})})};var ta=n(430586),td=n(812297),tu=n(819324),tc=n(53670),tp=n(873433);let th=e=>{let{...t}=e,{t:n}=(0,g.A)(),{chainId:l}=(0,tc.ax)(),{isInfinityBinSupported:r}=(0,tp.S)(),s=r(l),[o,a]=(0,T.fk)(),[,d]=(0,T.ui)(),c=(0,e5.tS)(),p=(0,e5.Td)(),h=e$(),m=(0,u.useCallback)(e=>{o!==e&&(a(e),d(null),"CL"===e?p():c(),h())},[o,p,c,a,d,h]);(0,u.useEffect)(()=>{s||"Bin"!==o||m("CL")},[s,o,m]);let x=(0,u.useCallback)(e=>{m(0===e?"CL":"Bin")},[m]),v=+("CL"!==o);return(0,i.jsxs)(C.Ay,{...t,children:[(0,i.jsxs)(b.A,{gap:"4px",children:[(0,i.jsx)(j.y,{mb:"8px",children:n("Pool Type")}),(0,i.jsx)(w.PT,{placement:"auto",mb:"8px",color:"secondary",text:(0,i.jsxs)(i.Fragment,{children:[n(s?"PancakeSwap Infinity supports both CLAMM (Concentrated Liquidity AMM) and LBAMM (Liquidity Book AMM) pools.":"PancakeSwap Infinity supports CLAMM (Concentrated Liquidity AMM) pools on this chain."),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)(ta.A,{href:"https://docs.pancakeswap.finance/trade/pancakeswap-infinity/pool-types",fontSize:"14px",children:n("Learn More")})]})})]}),s?(0,i.jsxs)(td.A,{activeIndex:v,onItemClick:x,variant:"subtle",fullWidth:!0,children:[(0,i.jsx)(tu.A,{height:"38px",children:n("CLAMM")}),(0,i.jsx)(tu.A,{height:"38px",children:n("LBAMM")})]}):(0,i.jsx)(td.A,{activeIndex:0,variant:"subtle",fullWidth:!0,children:[(0,i.jsx)(tu.A,{height:"38px",children:n("CLAMM")},"clamm")]})]})};var tm=n(24153),tx=n(970911),tv=n(512977),ty=n(344035),tf=n(673384),tA=n(403607),tg=n(702356),tC=n(479132),tb=n(140874);let tj=e=>{let{...t}=e,{t:n}=(0,g.A)(),{baseCurrency:l,quoteCurrency:s}=(0,O.Z)(),{switchCurrencies:o}=(0,r.i0)(),{poolType:a}=(0,e5.lb)(),[d]=(0,T.CJ)(),[c]=(0,T.QG)(),[p]=(0,T.Iq)(),h=(0,tb.O)(),{minBinId:m,max
1BinId:y}=(0,tC.v)(),f=(0,u.useMemo)(()=>null!==c&&c>=Number(A.AL)&&c<=Number(A.sE)&&parseFloat(c.toString())===c,[c]),b=l&&!(0,U.fT)(l.chainId)?l:void 0,w=s&&!(0,U.fT)(s.chainId)?s:void 0,{quickAction:k,handleQuickAction:R}=((e,t,n,i)=>{let[{lowerTick:l,upperTick:r},s]=(0,N.N_)(),[o,a]=(0,u.useMemo)(()=>e&&t?(0,tn.Uy)([e,t]):[void 0,void 0],[e,t]),d=(0,u.useCallback)(()=>{null!==l&&n&&(y(null),s({lowerTick:(0,tf.Yp)(l+n,n)}))},[l,n,s]),c=(0,u.useCallback)(()=>{null!==l&&n&&(y(null),s({lowerTick:(0,tf.Yp)(l-n,n)}))},[l,n,s]),p=(0,u.useCallback)(()=>{null!==r&&n&&(y(null),s({upperTick:(0,tf.Yp)(r+n,n)}))},[r,n,s]),h=(0,u.useCallback)(()=>{null!==r&&n&&(y(null),s({upperTick:(0,tf.Yp)(r-n,n)}))},[r,n,s]),m=(0,u.useCallback)(i=>{if(!n||!e||!t)return;if(y(null),""===i)return void s({lowerTick:null});let l=(0,e3.m)(e,t,i);if(void 0===l)return;(0,tn.lV)(e,t)||(l=l.invert());let r=(0,tA.We)(l,n);void 0!==r&&s({lowerTick:r})},[n,s,e,t]),x=(0,u.useCallback)(i=>{if(!n||!e||!t)return;if(y(null),""===i)return void s({upperTick:null});let l=(0,e3.m)(e,t,i);if(void 0===l)return;(0,tn.lV)(e,t)||(l=l.invert());let r=(0,tA.We)(l,n);void 0!==r&&s({upperTick:r})},[n,e,t,s]),[v,y]=(0,u.useState)(null),f=(0,tg.V)(null!=n?n:void 0);return{onLowerIncrement:d,onLowerDecrement:c,onUpperIncrement:p,onUpperDecrement:h,onLowerUserInput:m,onUpperUserInput:x,quickAction:v,handleQuickAction:(0,u.useCallback)((e,t)=>{if(!n||!o||!a||!i||i.equalTo(0))return;if(y(e),100===e)return void s({lowerTick:f.LOWER,upperTick:f.UPPER});let{initialMin:l,initialMax:r}=t,d=(0,tn.lV)(i.baseCurrency,i.quoteCurrency)?i:i.invert(),u=(0,e3.m)(o,a,new e9.A(d.denominator?d.toFixed(18):0).times(null!=l?l:1).toString()),c=(0,e3.m)(o,a,new e9.A(d.denominator?d.toFixed(18):0).times(null!=r?r:1).toString());if(u&&c)s({lowerTick:(0,tA.We)(u,n),upperTick:(0,tA.We)(c,n)})},[i,o,a,s,n,f])}})(b,w,p,h);return(0,i.jsx)(C.Ay,{...t,children:(0,i.jsxs)(x.mm,{gap:"16px",children:[(0,i.jsxs)(tm.JA,{children:[(0,i.jsx)(j.y,{children:n("Set Price Range")}),(0,i.jsx)(tx.r.RateToggle,{currencyA:b,handleRateToggle:o})]}),"Bin"===a?(0,i.jsx)(v.x,{disabled:!d||!f,children:(0,i.jsx)(tv.W,{currency0:b,currency1:w,binStep:c,activeBinId:d,minBinId:m,maxBinId:y})}):null,"CL"===a?(0,i.jsx)(v.x,{disabled:!p,children:(0,i.jsx)(ty.I,{currentPrice:h,baseCurrency:b,quoteCurrency:w,tickSpacing:null!=p?p:void 0,quickAction:k,handleQuickAction:R})}):null]})})};var tw=n(226464),tk=n(928768),tR=n(326848),tI=n(226972),tE=n(662928),tS=n(792118);let tT=(e,t)=>{let n=(0,u.useMemo)(()=>t?(0,tS.Rt)({chainId:t}):void 0,[t]);return(0,tE.I)({queryKey:["isPoolInitialized",e],queryFn:()=>(0,A.HE)(n,e),enabled:!!e&&!!n})},tN=()=>{let{t:e}=(0,g.A)(),t=(0,tI.P)(),{chainId:n}=(0,r.i0)(),{data:l}=tT(t,n),s=(0,tR.useRouter)(),o=(0,u.useCallback)(()=>{n&&t&&s.push((0,tk.Lg)({chainId:n,poolId:(0,A.Qn)(t)}))},[n,t,s]),{isXs:a}=(0,q.A)();return l?(0,i.jsx)(tw.A,{variant:"success",icon:(0,i.jsx)(eB.A,{width:"24px",color:"#02919D"}),action:(0,i.jsx)(Z.A,{mt:"8px",width:"100%",onClick:o,endIcon:a?(0,i.jsx)(eW.A,{color:"invertedContrast",width:"24px"}):null,disabled:!!(n&&tk.nn[n]),children:e("Add Liquidity")}),actionInline:!a,children:(0,i.jsx)(I.A,{color:"text",children:e("A pool with the selected configuration already exists.")})}):null};var tU=n(796416);let tO=(0,en.Ay)(C.Ay).withConfig({componentId:"sc-defb3db5-0"})(["display:grid;grid-column-gap:32px;grid-row-gap:16px;grid-template-columns:1fr;grid-template-rows:max-content;grid-auto-flow:row;","{grid-template-columns:1fr 1fr;}"],e=>{let{theme:t}=e;return t.mediaQueries.xl});(0,en.Ay)(C.Ay).withConfig({componentId:"sc-defb3db5-1"})(["","{display:grid;grid-template-columns:1fr 2fr;grid-column-gap:32px;grid-row-gap:16px;grid-template-rows:max-content;grid-auto-flow:row;}"],e=>{let{theme:t}=e;return t.mediaQueries.xl});var tM=n(265394);let tB=e=>{let{...t}=e,{t:n}=(0,g.A)();return(0,i.jsx)(C.Ay,{...t,children:(0,i.jsxs)(b.A,{justifyContent:"space-between",alignItems:"center",gap:"8px",children:[(0,i.jsx)(I.A,{children:n("Slippage Tolerance")}),(0,i.jsx)(tM.AK,{})]})})},t_=()=>{let{chainId:e}
1=(0,r.i0)(),{isBin:t,isCl:n,startPrice:l,feeLevel:s,isDynamic:o}=(0,e5.lb)(),{lowerBinId:a,upperBinId:d}=(0,e5.qS)(),{lowerTick:A,upperTick:g}=(0,e5.Wp)(),{data:C}=tT((0,tI.P)(),e),b=(0,u.useMemo)(()=>t?null!==a&&null!==d:null!==A&&null!==g,[t,a,d,A,g]);return e?(0,i.jsxs)(c.A,{gridTemplateColumns:["1fr","1fr","1fr","repeat(2, 1fr)"],style:{gap:"24px"},children:[(0,i.jsx)(h.A,{style:{height:"fit-content"},children:(0,i.jsx)(m.A,{children:(0,i.jsxs)(x.mm,{gap:"24px",children:[(0,i.jsx)(eZ,{}),(0,i.jsxs)(tO,{children:[(0,i.jsx)(th,{}),t&&(0,i.jsx)(M,{}),n&&(0,i.jsx)(_,{})]}),(0,i.jsx)(L.L,{allowCustomFee:!0}),(0,i.jsx)(eF,{}),(0,i.jsx)(tN,{})]})})}),(0,i.jsx)(h.A,{children:(0,i.jsx)(m.A,{children:(0,i.jsx)(v.x,{disabled:C||!o&&(0,y.A)(s),children:(0,i.jsxs)(x.mm,{gap:["16px",null,null,"24px"],children:[(0,i.jsx)(e4,{}),(0,i.jsx)(v.x,{disabled:!l,children:(0,i.jsxs)(x.mm,{gap:["16px",null,null,"24px"],children:[(0,i.jsx)(tj,{}),t&&(0,i.jsx)(f.k,{})]})}),(0,i.jsx)(v.x,{disabled:!l||!b,children:(0,i.jsxs)(x.mm,{gap:["16px",null,null,"24px"],children:[(0,i.jsx)(to,{}),(0,i.jsx)(tB,{}),(0,i.jsx)(eX.u,{}),(0,i.jsx)(tU.P7,{})]})})]})})})})]}):(0,i.jsx)(c.A,{style:{placeItems:"center",minHeight:"50vh"},children:(0,i.jsx)(p.A,{})})};var tL=n(659197),tP=n(835490);let tY=RegExp("^\\d*(?:\\\\[.])?\\d*$"),tq=e=>{let{startPrice:t,setStartPrice:n,switchCurrencies:l,...s}=e,{t:o}=(0,g.A)(),{quoteCurrency:a,baseCurrency:d,currency0:c,currency1:p}=(0,O.Z)(),{isMobile:h,isTablet:m}=(0,q.A)(),x=h||m?12:7,v=(0,u.useMemo)(()=>(0,ev.EJ)(null==a?void 0:a.symbol,x),[a,x]),y=(0,u.useMemo)(()=>(0,ev.EJ)(null==d?void 0:d.symbol,x),[d,x]),f=(0,eu.aq)(),[A]=(0,N.h2)(),w=(0,eu.Sz)(A),{switchCurrencies:k}=(0,r.i0)(),[,,R]=(0,e6.r)(c,p),E=(0,u.useMemo)(()=>R?A?R.invert():R:void 0,[R,A]),T=(0,S.xm)(E),{minPrice:U,maxPrice:M}=(0,u.useMemo)(()=>{if(!d||!a)return{minPrice:void 0,maxPrice:void 0};let e=(0,tf.y1)(d,a,tf.gy.MIN_TICK+1),t=(0,tf.y1)(d,a,tf.gy.MAX_TICK-1);return{minPrice:A?e.invert():e,maxPrice:A?t.invert():t}},[A,d,a]),B=(0,u.useCallback)(e=>{if(null!==e){if(""===e)return void n("");if(M&&U){let t=new e9.A(U.toFixed(18)),i=new e9.A(M.toFixed(18)),l=e9.A.min(t,i),r=e9.A.max(t,i);n(e9.A.max(l,e9.A.min(r,new e9.A(e))).toJSON());return}n(new e9.A(e).toJSON())}},[n,M,U]);(0,u.useEffect)(()=>{if(f&&w!==A&&null!==t){let e=d||void 0,n=a||void 0,i=w?(0,e3.m)(n,e,t.toString()):(0,e3.m)(e,n,t.toString()),l=null==i?void 0:i.invert();B((null==l?void 0:l.denominator)?l.toFixed(8):null)}},[w,A,f,t,B,a,d]);let _=(0,u.useCallback)(()=>{if(T){let e=(0,e1.$g)(T);e&&B(e)}},[T,B]),{tooltip:L,tooltipVisible:P,targetRef:Y}=(0,K.A)(o("The price is an estimation of the current market price. Please verify before using it."),{avoidToStopPropagation:!0});return(0,i.jsxs)(C.Ay,{...s,children:[(0,i.jsxs)(b.A,{gap:"8px",mb:"8px",justifyContent:"space-between",flexWrap:"wrap",children:[(0,i.jsx)(b.A,{gap:"5px",alignItems:"center",children:(0,i.jsx)(j.y,{children:o("Set Starting Price")})}),R&&(0,i.jsxs)(b.A,{gap:"4px",alignItems:"center",flexWrap:"wrap",children:[(0,i.jsxs)("div",{ref:Y,children:[(0,i.jsxs)(tV,{onClick:_,children:[(0,i.jsx)("span",{children:o("Use Market Price")}),(0,i.jsx)(eB.A,{color:"primary60",width:"18px"})]}),P&&L]}),(0,i.jsxs)(b.A,{gap:"4px",alignItems:"center",flexWrap:"wrap",children:[(0,i.jsxs)(e2.g3,{mode:"price",price:E,color:"textSubtle",small:!0,bold:!0,children:[(0,e1.$g)(T)," "]}),(0,i.jsx)(I.A,{color:"textSubtle",small:!0,children:o("%assetA% = 1 %assetB%",{assetA:A?null==c?void 0:c.symbol:null==p?void 0:p.symbol,assetB:A?null==p?void 0:p.symbol:null==c?void 0:c.symbol})}),(0,i.jsx)(eJ.A,{role:"button",color:"primary60",onClick:l||k,style:{cursor:"pointer"}})]})]})]}),(0,i.jsx)(tD,{value:t,onUserInput:B,unit:v,baseUnit:y,currency:a})]})},tD=e=>{let{value:t,onUserInput:n,unit:l,baseUnit:r,currency:s}=e,{t:o}=(0,g.A)(),[a,d]=(0,u.useState)(t),c=(0,eu.aq)();(0,u.useEffect)(()=>{if(c){if(null===t&&null!==a)return void d(null);if(null!==t&&null!==a&&!new e9.A(a).eq(new e9.A(t))&&!String(t).endsWith("."))return void d(t);null===a&&null!==t&&d(t)}},[a,c,t]);let p=(0,u.useCallback)(e=>{let t=e.replace(/,/g,".");if(""===t||tY.test((0,e0.N)(t))){if(d(t),t.endsWith("."))return;n(t)}},[n]);return(0,i.jsxs)(b.A,{gap:"8px",alignItems:"center",children:[(0,i.jsx)(C.Ay,{style:{flex:1,minWidth:0},children:(0,i.jsx)(eK.A,{value:null!=a?a:"",onUserInput:p,appendComponent:s?(0,i.jsx)(e8.Z,{currency:s,size:"24px",showChainLogo:!0}):null,unit:(0,i.jsx)(I.A,{color:"textSubtle",bold:!0,children:l}),placeholder:"0.00",inputProps:{style:{height:"24px"},step:"any",pattern:"^[0-9]*[.,]?[0-9]{0,18}$",inputMode:"decimal"}})}),r&&(0,i.jsx)(I.A,{color:"textSubtle",bold:!0,style:{whiteSpace:"nowrap"},children:o("= 1 %asset%",{asset:r})})]})},tV=(0,en.Ay)(Z.A).attrs({scale:"xs",variant:"text"}).withConfig({componentId:"sc-dead548c-0"}
1)(["height:24px;padding:4px 8px;font-size:12px;font-weight:600;border-radius:8px;display:flex;align-items:center;gap:4px;background:transparent;border:2px solid ",";color:",";"],e=>{let{theme:t}=e;return t.colors.primary},e=>{let{theme:t}=e;return t.colors.primary60});var t$=n(311560),tF=n(145142);let tW=e=>{var t,n;let{currencies:l,onFieldAInput:r,onFieldBInput:s,formattedAmounts:o,maxAmounts:a,depositADisabled:d,depositBDisabled:u,...c}=e,{t:p}=(0,g.A)(),h=(0,S.wG)(l[tP.O9.CURRENCY_A]),m=(0,S.wG)(l[tP.O9.CURRENCY_B]);return(0,i.jsx)(C.Ay,{...c,children:(0,i.jsxs)(x.mm,{gap:"8px",children:[(0,i.jsx)(tF.A,{locked:d,children:(0,i.jsx)(ti.A,{showUSDPrice:!0,maxAmount:a[tP.O9.CURRENCY_A],onMax:()=>{var e;let t=a[tP.O9.CURRENCY_A];r(t&&null!=(e=h(t))?e:"")},onPercentInput:e=>{var t,n;let i=null==(t=a[tP.O9.CURRENCY_A])?void 0:t.multiply(new t$.QE(e,100));r(i&&null!=(n=h(i))?n:"")},disableCurrencySelect:!0,defaultValue:null!=(t=o[tP.O9.CURRENCY_A])?t:"0",onUserInput:r,showQuickInputButton:!0,showMaxButton:!0,currency:l[tP.O9.CURRENCY_A],id:"create-pool-input-tokena",title:(0,i.jsx)(j.y,{children:p("Deposit Amount")})})}),(0,i.jsx)(tF.A,{locked:u,children:(0,i.jsx)(ti.A,{showUSDPrice:!0,maxAmount:a[tP.O9.CURRENCY_B],onMax:()=>{var e;let t=a[tP.O9.CURRENCY_B];s(t&&null!=(e=m(t))?e:"")},onPercentInput:e=>{var t,n;let i=null==(t=a[tP.O9.CURRENCY_B])?void 0:t.multiply(new t$.QE(e,100));s(i&&null!=(n=m(i))?n:"")},disableCurrencySelect:!0,defaultValue:null!=(n=o[tP.O9.CURRENCY_B])?n:"0",onUserInput:s,showQuickInputButton:!0,showMaxButton:!0,currency:l[tP.O9.CURRENCY_B],id:"create-pool-input-tokenb",title:(0,i.jsx)(i.Fragment,{children:"\xa0"})})})]})})};var tz=n(284178),tH=n(37735),tQ=n(68092),tG=n(343954),tZ=n(918279),tX=n(241439),tJ=n(259145),tK=n(862373),t0=n(782038),t1=n(555967),t9=n(262453),t2=n(64523),t6=n(427866),t3=n(661742),t8=n(805939),t5=n(334404),t7=n(495964),t4=n(236088),ne=n(909114),nt=n(772763),nn=n(178852),ni=n(663257),nl=n(909725),nr=n(306411),ns=n(189346),no=n(420636),na=n(868491),nd=n(269644),nu=n(206016),nc=n(721665);let np=e=>{let{protocol:t}=e,{t:n}=(0,g.A)(),{isMobile:l}=(0,q.A)(),{chainId:s}=(0,r.i0)(),{baseCurrency:o,quoteCurrency:a}=(0,O.Z)(),[d]=(0,T.LI)(),c=(0,u.useMemo)(()=>{if(s&&t&&o&&a)return t===tL.Zs.V2?(0,nc.e6)({chainId:s,protocol:tL.Zs.V2,token0:o,token1:a}):(0,U.fT)(s)?(0,nc.e6)({chainId:s,protocol:tL.Zs.V3,token0:o,token1:a,feeTier:null!=d?d:void 0}):(0,nc.e6)({chainId:s,protocol:tL.Zs.V3,token0:o,token1:a,feeTier:d?1e4*d:void 0})},[s,t,o,a,d]);return(0,i.jsx)(tw.A,{variant:"success",icon:(0,i.jsx)(eB.A,{width:"24px",color:"#02919D"}),action:(0,i.jsx)(Z.A,{as:"a",mt:"8px",width:"100%",href:c,disabled:!!(s&&tk.nn[s]),children:n("Add Liquidity")}),actionInline:!l,children:(0,i.jsx)(I.A,{small:!0,children:n("A pool with selected settings already exists. Please add liquidity instead.")})})};var nh=n(68317);let nm=()=>{let{currencies:e,leftRangeTypedValue:t,rightRangeTypedValue:n,startPriceTypedValue:l,formattedAmounts:s,maxAmounts:o,depositADisabled:a,depositBDisabled:d,noLiquidity:c,buttons:p,rangeSelector:y,previewModal:f,onStartPriceInput:A,onFieldAInput:w,onFieldBInput:k,switchCurrencies:R}=(()=>{let{t:e}=(0,g.A)(),t=(0,tR.useRouter)(),{account:n,chainId:l,isWrongNetwork:s}=(0,tc.W7)(),{data:o}=(0,t7.G)(),{onOpen:a,isOpen:d,onDismiss:c}=(0,X.jN)(),{toastError:p}=(0,t5.d)(),h=(0,tK.xf)(),[m]=(0,tK.uZ)(),[v]=(0,nt.g)(),{switchCurrencies:y}=(0,r.i0)(),{baseCurrency:f,quoteCurrency:A}=(0,O.Z)(),[w]=(0,T.LI)(),k=(0,u.useMemo)(()=>{if(w&&tQ.J.includes(w))return 1e4*w},[w]),[R,E]=(0,u.useState)(""),[N,U]=(0,u.useState)(!1),[M,B]=(0,u.useState)(),[_,L]=(0,u.useState)(!1),[P,Y]=(0,u.useState)(),q=(0,u.useRef)(!1),[D,V]=(0,u.useState)(null),[$,F]=(0,u.useState)(void 0),{sendTransactionAsync:W}=(0,t4.s)(),{maxFeePerGas:z,maxPriorityFeePerGas:Q}=(0,ne.N)(l),G=(0,nr.OQ)(),J=(0,tz.VF)(),K=(0,tz.oU)(),{independentField:ee,typedValue:et,startPriceTypedValue:en,leftRangeTypedValue:ei,rightRangeTypedValue:el}=K,{pool:er,ticks:es,dependentField:eo,price:ea,pricesAtTicks:ed,parsedAmounts:eu,currencyBalances:ec,position:ep,noLiquidity:eh,currencies:em,errorMessage:ex,invalidPool:ey,invalidRange:ef,outOfRange:eA,depositADisabled:eg,depositBDisabled:eC,invertPrice:eb,ticksAtLimit:ej,tickSpaceLimits:ew}=(0,tH.A)(null!=f?f:void 0,null!=A?A:void 0,k,null!=f?f:void 0,void 0,K),{shouldBlock:ek}=(0,t0.Wd)(null==em?void 0:em.CURRENCY_A,null==em?void 0:em.CURRENCY_B),eR=(0,u.useMemo)(()=>ea?eb?ea.invert():ea:void 0,[ea,eb]),eI=(0,S.xm)(eR),eE=(0,S.wG)(null==em?void 0:em.CURRENCY_A),eS=(0,S.wG)(null==em?void 0:em.CURRENCY_B),eT=(0,u.useMemo)(()=>({[tP.O9.CURRENCY_A]:eE,[tP.O9.CURRENCY_B]:eS}),[eE,eS]),eN=(0,u.useMemo)(()=>{var e;return{[ee]:et,[eo]:null!=(e=eT[eo](eu[eo],6))?e:""}},[ee,et,eo,eu,eT]),eU=(0,u.useMemo)(()=>[tP.O9.CURRENCY_A,tP.O9.CURRENCY_B].reduce((e,t)=>
1({...e,[t]:(0,tX.r)(ec[t])}),{}),[ec]),eO=(0,t1.TA)(),eM=null==eO?void 0:eO.address,{approvalState:eB,approveCallback:e_,revokeCallback:eL,currentAllowance:eP}=(0,t9.en)(eu[tP.O9.CURRENCY_A],eM),{approvalState:eY,approveCallback:eq,revokeCallback:eD,currentAllowance:eV}=(0,t9.en)(eu[tP.O9.CURRENCY_B],eM),e$=(0,u.useMemo)(()=>eB!==t9.h$.APPROVED&&!!eu[tP.O9.CURRENCY_A],[eB,eu]),eF=(0,u.useMemo)(()=>eY!==t9.h$.APPROVED&&!!eu[tP.O9.CURRENCY_B],[eY,eu]),{[t8.z.LOWER]:eW,[t8.z.UPPER]:ez}=es,{[t8.z.LOWER]:eH,[t8.z.UPPER]:eQ}=ed,eG=!!(f&&A&&(0,tn.DW)(f.wrapped,A.wrapped)),eZ=eG?eH:null==eQ?void 0:eQ.invert(),eX=eG?eQ:null==eH?void 0:eH.invert(),eK=(0,u.useMemo)(()=>ej[eG?t8.z.LOWER:t8.z.UPPER]||(null==ew?void 0:ew[t8.z.LOWER])!==void 0&&eZ&&(0,tf.dt)(eZ)<=ew[t8.z.LOWER]?"0":(0,no.$)(eZ),[eG,eZ,ew,ej]),e0=(0,u.useMemo)(()=>ej[eG?t8.z.UPPER:t8.z.LOWER]?"∞":(null==ew?void 0:ew[t8.z.LOWER])!==void 0&&eX&&(0,tf.dt)(eX)<=ew[t8.z.LOWER]?"0":(null==ew?void 0:ew[t8.z.UPPER])!==void 0&&eX&&(0,tf.dt)(eX)>=ew[t8.z.UPPER]?"∞":(0,no.$)(eX),[eG,eX,ew,ej]),{onFieldAInput:e1,onFieldBInput:e9,onLeftRangeInput:e6,onRightRangeInput:e8,onStartPriceInput:e5,onBothRangeInput:e7}=(0,tG.i)(eh,!1),e4=(0,u.useCallback)(()=>{var e,t;y(),ei&&el&&"boolean"!=typeof ei&&"boolean"!=typeof el&&e7({leftTypedValue:el.invert(),rightTypedValue:ei.invert()}),e1(null!=(e=eS(eu[tP.O9.CURRENCY_B],6))?e:""),e9(null!=(t=eE(eu[tP.O9.CURRENCY_A],6))?t:"")},[eE,eS,y,ei,el,e7,eu,e1,e9]),{getDecrementLower:te,getIncrementLower:tt,getDecrementUpper:ti,getIncrementUpper:tl,getSetFullRange:tr}=(0,t6.U)(null!=f?f:void 0,null!=A?A:void 0,k,eW,ez,er),ts=(0,u.useCallback)((e,t)=>{e7({leftTypedValue:(0,e3.m)(null==f?void 0:f.wrapped,null==A?void 0:A.wrapped,e),rightTypedValue:(0,e3.m)(null==f?void 0:f.wrapped,null==A?void 0:A.wrapped,t)})},[f,A,e7]),to=(0,u.useCallback)(e=>{e6((0,e3.m)(null==f?void 0:f.wrapped,null==A?void 0:A.wrapped,e))},[f,A,e6]),ta=(0,u.useCallback)(e=>{e8((0,e3.m)(null==f?void 0:f.wrapped,null==A?void 0:A.wrapped,e))},[f,A,e8]),td=(0,u.useCallback)(e=>{if(Y(void 0),!e)return void F(void 0);let t=ea?parseFloat((eb?ea.invert():ea).toSignificant(8)):void 0;if(t){let n=t*e.initialMin,i=t*e.initialMax;ts(n.toString(),i.toString())}},[ea,eb,ts]),tu=(0,u.useCallback)((e,t)=>{if(V(e),null!==e)if(100===e)F(void 0),L(!0),Y(100),q.current=!0;else{var n;k&&(null==(n=nu.T[k])?void 0:n[e])?(F(void 0),td(nu.T[k][e])):(F(t),td(t)),Y(e),q.current=!0}},[k,td,L]),tp=(0,u.useCallback)(async()=>{var i;if((0,tJ.aF)(),!l||!o||!n||!eM||!eO||!f||!A||!ep||!v)return;if((null==ep?void 0:ep.liquidity)===0n)return void B(e("The liquidity of this position is 0. Please try increasing the amount."));let r=(null==f?void 0:f.isNative)?f:(null==A?void 0:A.isNative)?A:void 0,{calldata:s,value:a}=tf.uy.addCallParameters(ep,{slippageTolerance:(0,nn.aW)(m),recipient:n,deadline:v.toString(),useNative:r,createPool:eh});U(!0);let d={data:s,to:eM,value:(0,ni.uU)(a),account:n};null==(i=(0,tS.Qr)({chainId:l}))||i.estimateGas(d).then(n=>{W({...d,gas:(0,ev.KL)(n),maxFeePerGas:z,maxPriorityFeePerGas:Q}).then(async e=>{var n,i,l,r,s,o;(0,tJ.Mg)();let a=(0,nl.cf)(null!=(s=null==(i=eu[tP.O9.CURRENCY_A])||null==(n=i.quotient)?void 0:n.toString())?s:"0",f.decimals,4),d=(0,nl.cf)(null!=(o=null==(r=eu[tP.O9.CURRENCY_B])||null==(l=r.quotient)?void 0:l.toString())?o:"0",A.decimals,4);U(!1),G({hash:e},{type:"add-liquidity-v3",summary:`Add ${a} ${null==f?void 0:f.symbol} and ${d} ${null==A?void 0:A.symbol}`}),E(e),J(e),t.push("/liquidity/pools")}).catch(t=>{console.error("Failed to send transaction",t),(0,ns.U)(t)||(B((0,na.w)(t,e)),p(e("Error"),(0,t3.rV)(t))),U(!1)})})},[n,G,m,f,l,v,eM,eh,J,eu,ep,eO,A,W,z,Q,o,e,t,p]),th=(0,u.useCallback)(()=>{h?tp():a(),(0,tJ.uL)()},[h,tp,a]);(0,u.useEffect)(()=>{L(!1)},[f,A,k]),(0,u.useEffect)(()=>{k&&(Y(void 0),e7({leftTypedValue:void 0,rightTypedValue:void 0}))},[k]),(0,u.useEffect)(()=>{!q.current&&P?(Y(void 0),V(null),F(void 0)):q.current&&(q.current=!1)},[q,P,ei,el]);let tx=(0,i.jsx)(tZ.E,{addIsUnsupported:ek,account:null!=n?n:void 0,isWrongNetwork:!!s,approvalA:eB,approvalB:eY,isValid:!ex&&!ef,showApprovalA:e$,approveACallback:e_,currentAllowanceA:eP,revokeACallback:eL,currencies:em,showApprovalB:eF,approveBCallback:eq,currentAllowanceB:eV,revokeBCallback:eD,parsedAmounts:eu,onClick:th,attemptingTxn:N,errorMessage:ex,buttonText:e("Add"),depositADisabled:eg,depositBDisabled:eC}),tv=(0,i.jsxs)(x.mm,{gap:"8px",children:[(0,i.jsx)(j.y,{children:e("Set Price Range")}),!_&&(0,i.jsx)(t2.A,{priceLower:eH,priceUpper:eQ,getDecrementLower:te,getIncrementLower:tt,getDecrementUpper:ti,getIncrementUpper:tl,onLeftRangeInput:e6,onRightRangeInput:e8,currencyA:f,currencyB:A,feeAmount:k,ticksAtLimit:ej,tickSpaceLimits:ew,quickAction:null!=P?P:null,handleQuickAction:tu}),_&&(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsxs)(C.Ay,{children:[(0,i.jsx)(I.A,{fontSize:"16px",children:e("Efficiency Comparison")}),(0,i.jsx)(I.A,{color:"textSubtle",children:e("Full range positions may earn less fees than concentrated positions.")}),(0,i.jsx)(Z.A,{mt:"16px",onClick:()=>{L(!1),tr(),Y(100)},scale:"md",variant:"danger",children:e("I understand")})]})}),eA?(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsx)(tm.JA,{children:(0,i.jsx)(I.A,{ml:"12px",fontSize:"12px",children:e("Your position will not earn fees or be used in trades until the market price moves into your range.")})})}):null,ef?(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsx)(tw.J,{children:e("Invalid range selected. The min price must be lower than the max price.")})}):null]}),ty=(0,u.useMemo)(()=>(0,i.jsx)(nd.M,{currencies:em,parsedAmounts:eu,onConfirm:tp,isOpen:d,onDismiss:c,feeTier:k?`${(k/1e4).toFixed(2)}%`:void 0,details:{priceRange:(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(b.A,{gap:"4px",alignItems:"center",children:[(0,i.jsxs)(x.mm,{children:[(0,i.jsxs)("div",{children:[eK," - ",e0]}),(0,i.jsx)("div",{children:e("%assetA% = 1 %assetB%",{assetA:null==A?void 0:A.symbol,assetB:null==f?void 0:f.symbol})})]}),(0,i.jsx)(H.A,{variant:"text",scale:"sm",onClick:e4,children:(0,i.jsx)(eJ.A,{color:"textSubtle"})})]})}
1),startPrice:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e2.g3,{mode:"price",price:eR,as:"span",children:null==eI?void 0:eI.toSignificant(6)})," ",e("%assetA% = 1 %assetB%",{assetA:null==A?void 0:A.symbol,assetB:null==f?void 0:f.symbol})]})}}),[em,eu,tp,d,c,k,eR,eI,f,A,e,eK,e0,e4]);return{formState:K,currencies:em,leftRangeTypedValue:ei,rightRangeTypedValue:el,startPriceTypedValue:en,formattedAmounts:eN,maxAmounts:eU,depositADisabled:eg,depositBDisabled:eC,noLiquidity:eh,buttons:tx,rangeSelector:tv,previewModal:ty,onBothRangePriceInput:ts,onLeftRangePriceInput:to,onRightRangePriceInput:ta,onFieldAInput:e1,onFieldBInput:e9,onStartPriceInput:e5,switchCurrencies:e4}})(),[E]=(0,T.LI)(),N=(0,eu.d7)(!1===c&&!!E,400),U=e[tP.O9.CURRENCY_A]&&e[tP.O9.CURRENCY_B];return(0,i.jsxs)(C.Ay,{maxWidth:[null,null,null,"560px"],mx:"auto",children:[(0,i.jsx)(h.A,{children:(0,i.jsx)(m.A,{children:(0,i.jsxs)(x.mm,{gap:"24px",children:[(0,i.jsx)(eZ,{}),(0,i.jsx)(v.x,{disabled:!U,children:(0,i.jsx)(nh.L,{})}),N&&U&&(0,i.jsx)(np,{protocol:tL.Zs.V3}),(0,i.jsx)(v.x,{disabled:N||!U,children:(0,i.jsx)(tq,{startPrice:l,setStartPrice:A,switchCurrencies:R})}),(0,i.jsx)(v.x,{disabled:N||!U||!l||!E,children:y}),(0,i.jsx)(v.x,{disabled:N||!U||!l||!E||!t||!n,children:(0,i.jsx)(tW,{currencies:e,onFieldAInput:w,onFieldBInput:k,formattedAmounts:s,maxAmounts:o,depositADisabled:a,depositBDisabled:d})}),(0,i.jsxs)(v.x,{disabled:N||!U||!l||!E||!t||!n,children:[(0,i.jsx)(tB,{}),(0,i.jsx)(eX.u,{})]}),(0,i.jsx)(v.x,{disabled:N||!U||!l||!E||!t||!n,children:p})]})})}),f]})};var nx=n(814795),nv=n(568272),ny=n(518400),nf=n(286750),nA=n(443634),ng=n(970645),nC=n(183693),nb=n(296123),nj=n(899297),nw=n(856870),nk=n(859886);let nR=(0,en.Ay)(C.Ay).withConfig({componentId:"sc-e47ff9c2-0"})(["border:1px solid ",";background-color:",";padding:8px 16px;border-radius:16px;"],e=>{let{theme:t}=e;return t.colors.cardBorder},e=>{let{theme:t}=e;return t.colors.textSubtle}),nI=()=>{let{t:e}=(0,g.A)(),{currencies:t,formattedAmounts:n,maxAmounts:l,noLiquidity:r,buttons:s,previewModal:o,onFieldAInput:a,onFieldBInput:d}=(()=>{let{t:e,currentLanguage:{locale:t}}=(0,g.A)(),n=(0,tR.useRouter)(),{account:l,chainId:r,isWrongNetwork:s}=(0,tc.W7)(),{data:o}=(0,t7.G)(),{onOpen:a,isOpen:d,onDismiss:c}=(0,X.jN)(),{toastError:p}=(0,t5.d)(),{data:h}=(0,nv.Y)(),m=(0,tK.xf)(),[v]=(0,tK.uZ)(),[y]=(0,nt.g)(),{baseCurrency:f,quoteCurrency:A}=(0,O.Z)(),C=f&&!(0,U.fT)(f.chainId)?f:void 0,b=A&&!(0,U.fT)(A.chainId)?A:void 0,[j]=(0,T.ui)(),w=(0,nr.OQ)(),k=(0,ny.Ep)(),[{attemptingTxn:R,liquidityErrorMessage:I,txHash:E},N]=(0,u.useState)({attemptingTxn:!1,liquidityErrorMessage:void 0,txHash:void 0}),M=(0,nn.hj)(),{independentField:B,typedValue:_,otherTypedValue:L}=(0,nf.uE)(),{dependentField:P,currencies:Y,currencyBalances:q,noLiquidity:V,isOneWeiAttack:$,pairState:F}=(0,nA.L)(null!=C?C:void 0,null!=b?b:void 0),{shouldBlock:W}=(0,t0.Wd)(null==Y?void 0:Y.CURRENCY_A,null==Y?void 0:Y.CURRENCY_B),{onFieldAInput:z,onFieldBInput:H}=(0,nA.B)(V),Q=(0,u.useMemo)(()=>[tP.O9.CURRENCY_A,tP.O9.CURRENCY_B].reduce((e,t)=>({...e,[t]:(0,tX.r)(q[t])}),{}),[q]),G=(0,S.dm)("1",null==C?void 0:C.wrapped),J=(0,S.dm)(null!=j?j:"",null==b?void 0:b.wrapped),K=(0,u.useMemo)(()=>{if(C&&b&&j&&G&&J)return new t$.Rm(G,J)},[C,b,j,G,J]),ee=(0,S.dm)(_,Y[B]),et=(0,S.wG)(Y[tP.O9.CURRENCY_A]),en=(0,S.wG)(Y[tP.O9.CURRENCY_B]),ei=(0,u.useMemo)(()=>{if(ee){let e=null==ee?void 0:ee.wrapped,[t,n]=[null==C?void 0:C.wrapped,null==b?void 0:b.wrapped];if(t&&n&&e&&K){let i=P===tP.O9.CURRENCY_B?b:C,l=P===tP.O9.CURRENCY_B?K.priceOf(t).quote(e):K.priceOf(n).quote(e);return(null==i?void 0:i.isNative)?t$.eF.fromRawAmount(i,l.quotient):l}}},[P,ee,K,C,b]),el=(0,u.useMemo)(()=>({[tP.O9.CURRENCY_A]:B===tP.O9.CURRENCY_A?ee:ei,[tP.O9.CURRENCY_B]:B===tP.O9.CURRENCY_A?ei:ee}),[ei,ee,B]),er=(0,u.useMemo)(()=>{var t,n;if(!l)return e("Connect Wallet");if(F===nk.CN.INVALID)return e("Choose a valid pair");let{[tP.O9.CURRENCY_A]:i,[tP.O9.CURRENCY_B]:r}=el;if(i&&r&&(null==q||null==(t=q[tP.O9.CURRENCY_A])?void 0:t.equalTo(0))&&(null==q||null==(n=q[tP.O9.CURRENCY_B])?void 0:n.equalTo(0)))return e("No token balance")},[l,F,el,q,e]),es=(0,u.useMemo)(()=>{var t,n,i,l;let{[tP.O9.CURRENCY_A]:r,[tP.O9.CURRENCY_B]:s}=el;return el[tP.O9.CURRENCY_A]&&el[tP.O9.CURRENCY_B]?r&&(null==q||null==(t=q[tP.O9.CURRENCY_A])?void 0:t.lessThan(r))?e("Insufficient %symbol% balance",{symbol:null==(i=Y[tP.O9.CURRENCY_A])?void 0:i.symbol}):s&&(null==q||null==(n=q[tP.O9.CURRENCY_B])?void 0:n.lessThan(s))?e("Insufficient %symbol% balance",{symbol:null==(l=Y[tP.O9.CURRENCY_B])?void 0:l.symbol}):void 0:e("Enter an amount")},[el,q,Y,e]),eo=(0,u.useMemo)(()=>
1{if(V){let{[tP.O9.CURRENCY_A]:e,[tP.O9.CURRENCY_B]:t}=el;return e&&t?new t$.gm(e.currency,t.currency,e.quotient,t.quotient):void 0}if(!K||K.reserve0.quotient===ng.CL||K.reserve1.quotient===ng.CL)return;let e=null==C?void 0:C.wrapped;return e?K.priceOf(e):void 0},[C,V,K,el]),ea=(0,S.xm)(eo),ed=(0,u.useMemo)(()=>K&&(0,ev.Bz)(t$.Rm.getAddress(K.token0,K.token1),"address",r)||void 0,[K,r]),eu=P===tP.O9.CURRENCY_A?et:en,ec=(0,u.useMemo)(()=>{var e;return{[B]:_,[P]:null!=(e=eu(el[P],6))?e:""}},[P,B,el,_,eu]),ep=(0,u.useMemo)(()=>{var n,i,l,r;return e("Supplying %amountA% %symbolA% and %amountB% %symbolB%",{amountA:(0,nl.N)(el[tP.O9.CURRENCY_A],4,t),symbolA:null!=(l=null==(n=Y[tP.O9.CURRENCY_A])?void 0:n.symbol)?l:"",amountB:(0,nl.N)(el[tP.O9.CURRENCY_B],4,t),symbolB:null!=(r=null==(i=Y[tP.O9.CURRENCY_B])?void 0:i.symbol)?r:""})},[Y,t,el,e]),{approvalState:eh,approveCallback:ex,revokeCallback:ey,currentAllowance:ef}=(0,t9.en)(el[tP.O9.CURRENCY_A],r?ng.U5[r]:void 0),{approvalState:eA,approveCallback:eg,revokeCallback:eC,currentAllowance:eb}=(0,t9.en)(el[tP.O9.CURRENCY_B],r&&ng.U5[r]),ej=!er&&!es,ew=(0,u.useMemo)(()=>null!=er?er:es,[er,es]),ek=!ej||eh!==t9.h$.APPROVED||eA!==t9.h$.APPROVED,eR=eh===t9.h$.NOT_APPROVED||eh===t9.h$.PENDING,eI=eA===t9.h$.NOT_APPROVED||eA===t9.h$.PENDING,eE=(eR||eI)&&ej,eS=(0,u.useCallback)(async()=>{var t,i,s,a,d,u,c,m;let x,g,C,b;if((0,tJ.aF)(),!r||!l||!M||!o)return;let{[tP.O9.CURRENCY_A]:j,[tP.O9.CURRENCY_B]:R}=el;if(!j||!R||!f||!A||!y)return;let I={[tP.O9.CURRENCY_A]:(0,nn.wQ)(j,V?0:v)[0],[tP.O9.CURRENCY_B]:(0,nn.wQ)(R,V?0:v)[0]};if((null==f?void 0:f.isNative)||(null==A?void 0:A.isNative)){let e=null==A?void 0:A.isNative;x=M.estimateGas.addLiquidityETH,g=M.write.addLiquidityETH,C=[null!=(a=null==(s=e?f:A)||null==(i=s.wrapped)?void 0:i.address)?a:"",(e?j:R).quotient.toString(),I[e?tP.O9.CURRENCY_A:tP.O9.CURRENCY_B].toString(),I[e?tP.O9.CURRENCY_B:tP.O9.CURRENCY_A].toString(),l,y],b=(e?R:j).quotient}else x=M.estimateGas.addLiquidity,g=M.write.addLiquidity,C=[null!=(c=null==f||null==(d=f.wrapped)?void 0:d.address)?c:"",null!=(m=null==A||null==(u=A.wrapped)?void 0:u.address)?m:"",j.quotient.toString(),R.quotient.toString(),I[tP.O9.CURRENCY_A].toString(),I[tP.O9.CURRENCY_B].toString(),l,y],b=null;N({attemptingTxn:!0,liquidityErrorMessage:void 0,txHash:void 0}),await (null==(t=x(C,b?{value:b,account:M.account,chain:M.chain}:{account:M.account,chain:M.chain}).then(e=>g(C,{...b?{value:b}:{},gas:(0,ev.KL)(e),gasPrice:h}).then(async e=>{var t,i,l,r;N({attemptingTxn:!1,liquidityErrorMessage:void 0,txHash:e}),(0,tJ.Mg)();let s=null==(t=Y[tP.O9.CURRENCY_A])?void 0:t.symbol,o=null!=(l=et(el[tP.O9.CURRENCY_A],3))?l:"-",a=null==(i=Y[tP.O9.CURRENCY_B])?void 0:i.symbol,d=null!=(r=en(el[tP.O9.CURRENCY_B],3))?r:"-";w({hash:e},{summary:`Add ${o} ${s} and ${d} ${a}`,translatableSummary:{text:"Add %amountA% %symbolA% and %amountB% %symbolB%",data:{amountA:o,symbolA:s,amountB:d,symbolB:a}},type:"add-liquidity"}),K&&k(K),n.push("/liquidity/pools")})))?void 0:t.catch(t=>{t&&!(0,ns.U)(t)&&((0,ns.v)(t),console.error("Add Liquidity failed",t,C,b),p(e("Error"),(0,t3.rV)(t))),N({attemptingTxn:!1,liquidityErrorMessage:t&&!(0,ns.U)(t)?e("Add liquidity failed: %message%",{message:(0,na.w)(t,e)}):void 0,txHash:void 0})}))},[l,f,r,y,V,el,k,w,v,Y,h,K,A,n,M,e,p,o]),eT=(0,u.useMemo)(()=>W?(0,i.jsx)(Z.A,{disabled:!0,mb:"4px",children:e("Unsupported Asset")}):l?s?(0,i.jsx)(nC.O,{}):(0,i.jsxs)(x.mm,{gap:"md",children:[(0,i.jsx)(nj.A,{approvalA:eh,approvalB:eA,showFieldAApproval:eR,showFieldBApproval:eI,approveACallback:ex,approveBCallback:eg,revokeACallback:ey,revokeBCallback:eC,currencies:Y,currentAllowanceA:ef,currentAllowanceB:eb,shouldShowApprovalGroup:eE}),$?(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsxs)(D.A,{flexDirection:"column",children:[(0,i.jsx)(tw.J,{children:e("Adding liquidity to this V2 pair is currently not available on PancakeSwap UI. Please follow the instructions to resolve it using blockchain explorer.")}),(0,i.jsx)(ta.A,{href:"https://docs.pancakeswap.finance/products/pancakeswap-exchange/faq#why-cant-i-add-liquidity-to-a-pair-i-just-created",mt:"0.25rem",children:e("Learn more how to fix")}),(0,i.jsx)(em.A,{useBscCoinFallback:r?nw.jc.includes(r):void 0,href:ed,mt:"0.25rem",children:e("View pool on explorer")})]})}):null,(0,i.jsx)(nC.O,{variant:ek?"danger":"primary",onClick:()=>{m?eS():a(),(0,tJ.uL)()},disabled:ek,children:ew||e("Add")})]}):(0,i.jsx)(nb.A,{width:"100%"}),[l,W,eh,eA,ex,eg,r,Y,ef,eb,m,$,s,eS,ey,eC,eE,e,ek,ew,a,ed,eR,eI]),eN=(0,u.useMemo)(()=>
1(0,i.jsx)(nd.M,{currencies:Y,parsedAmounts:el,onConfirm:eS,isOpen:d,onDismiss:c,feeTier:"0.25%",details:{startPrice:f&&A?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e2.g3,{mode:"price",price:eo,as:"span",children:null==ea?void 0:ea.toSignificant(6)})," ",e("%assetA% = 1 %assetB%",{assetA:null==A?void 0:A.symbol,assetB:null==f?void 0:f.symbol})]}):void 0}}),[Y,el,eS,d,c,eo,ea,f,A,e]);return{currencies:Y,pair:K,currencyBalances:q,noLiquidity:V,maxAmounts:Q,formattedAmounts:ec,pendingText:ep,buttons:eT,previewModal:eN,addIsUnsupported:W,errorText:ew,buttonDisabled:ek,approvalA:eh,approvalB:eA,showFieldAApproval:eR,showFieldBApproval:eI,shouldShowApprovalGroup:eE,onAdd:eS,onFieldAInput:z,onFieldBInput:H,approveACallback:ex,approveBCallback:eg,revokeACallback:ey,revokeBCallback:eC}})(),c=(0,eu.d7)(!1===r,400),p=t[tP.O9.CURRENCY_A]&&t[tP.O9.CURRENCY_B],[y,f]=(0,T.ui)();return(0,i.jsxs)(C.Ay,{maxWidth:[null,null,null,"560px"],mx:"auto",children:[(0,i.jsx)(h.A,{children:(0,i.jsx)(m.A,{children:(0,i.jsxs)(x.mm,{gap:"24px",children:[(0,i.jsx)(eZ,{}),c&&p&&(0,i.jsx)(np,{protocol:tL.Zs.V2}),(0,i.jsx)(v.x,{disabled:c||!p,children:(0,i.jsxs)(b.A,{flexDirection:["column","column","row"],gap:"8px",justifyContent:"space-between",children:[(0,i.jsxs)(C.Ay,{children:[(0,i.jsx)(j.y,{children:e("Fee Level")}),(0,i.jsx)(nR,{mt:"16px",children:(0,i.jsx)(I.A,{color:"invertedContrast",bold:!0,children:"0.25%"})})]}),(0,i.jsx)(tq,{startPrice:null!=y?y:"",setStartPrice:f})]})}),(0,i.jsx)(v.x,{disabled:c||!p||!y,children:(0,i.jsx)(tW,{currencies:t,onFieldAInput:a,onFieldBInput:d,formattedAmounts:n,maxAmounts:l,depositADisabled:!1,depositBDisabled:!1})}),(0,i.jsxs)(v.x,{disabled:c||!p||!y,children:[(0,i.jsx)(tB,{}),(0,i.jsx)(eX.u,{})]}),(0,i.jsx)(v.x,{disabled:c||!p||!y,children:s})]})})}),o]})};var nE=n(445603),nS=n(767365),nT=n(586348),nN=n(549333),nU=n(72181),nO=n(354117),nM=n(522722),nB=n(570295);let n_=()=>{let{currencies:e,leftRangeTypedValue:t,rightRangeTypedValue:n,startPriceTypedValue:l,formattedAmounts:s,maxAmounts:o,depositADisabled:a,depositBDisabled:d,noLiquidity:c,buttons:p,rangeSelector:y,previewModal:f,onStartPriceInput:A,onFieldAInput:w,onFieldBInput:k,switchCurrencies:R}=(()=>{let{t:e}=(0,g.A)(),t=(0,tR.useRouter)(),{solanaAccount:n,isWrongNetwork:l}=(0,tc.W7)(),{onOpen:s,isOpen:o,onDismiss:a}=(0,X.jN)(),d=(0,tK.xf)(),{switchCurrencies:c}=(0,r.i0)(),{baseCurrency:p,quoteCurrency:h}=(0,O.Z)(),[m]=(0,T.LI)(),[v,y]=(0,u.useState)(""),[f,A]=(0,u.useState)(!1),[w,k]=(0,u.useState)(),[R,E]=(0,u.useState)(!1),[S,N]=(0,u.useState)(),U=(0,u.useRef)(!1),[M,B]=(0,u.useState)(null),[_,L]=(0,u.useState)(void 0),[P]=(0,nN.A)((0,i.jsx)(nM.A,{title:e("Add Liquidity"),subTitle:w}),!0,!0,"solana-clmm-add-liquidity-error-modal"),Y=(0,tz.oU)(),{independentField:q,typedValue:D,startPriceTypedValue:V,leftRangeTypedValue:$,rightRangeTypedValue:F}=Y,{ticks:W,dependentField:z,price:Q,pricesAtTicks:G,parsedAmounts:J,currencyBalances:K,noLiquidity:ee,currencies:et,errorMessage:en,invalidRange:ei,outOfRange:el,depositADisabled:er,depositBDisabled:es,invertPrice:eo,ticksAtLimit:ea,tickSpaceLimits:ed,pool:eu}=(0,nE.r)(null!=p?p:void 0,null!=h?h:void 0,null!=m?m:void 0,null!=p?p:void 0,void 0,Y),ec=(0,nr.OQ)(),ep=(0,u.useMemo)(()=>{var e,t;return{[q]:D,[z]:null!=(t=null==(e=J[z])?void 0:e.toSignificant(6))?t:""}},[q,D,z,J]),eh=(0,u.useMemo)(()=>[tP.O9.CURRENCY_A,tP.O9.CURRENCY_B].reduce((e,t)=>({...e,[t]:(0,tX.Z)(K[t])}),{}),[K]),{[t8.z.LOWER]:em,[t8.z.UPPER]:ex}=W,{[t8.z.LOWER]:ev,[t8.z.UPPER]:ey}=G,ef=(0,u.useMemo)(()=>!!p&&!!h&&(0,tn.DW)(p,h),[p,h]),eA=(0,u.useMemo)(()=>ea[ef?t8.z.LOWER:t8.z.UPPER]||(null==ed?void 0:ed[t8.z.LOWER])!==void 0&&ev&&(0,tf.dt)(ev)<=ed[t8.z.LOWER]?"0":(0,no.$)(ev),[ef,ev,ed,ea]),eg=(0,u.useMemo)(()=>ea[ef?t8.z.UPPER:t8.z.LOWER]?"∞":(null==ed?void 0:ed[t8.z.LOWER])!==void 0&&ey&&(0,tf.dt)(ey)<=ed[t8.z.LOWER]?"0":(null==ed?void 0:ed[t8.z.UPPER])!==void 0&&ey&&(0,tf.dt)(ey)>=ed[t8.z.UPPER]?"∞":(0,no.$)(ey),[ef,ey,ed,ea]),{onFieldAInput:eC,onFieldBInput:eb,onLeftRangeInput:ej,onRightRangeInput:ew,onStartPriceInput:ek,onBothRangeInput:eR}=(0,tG.i)(ee,!1),eI=(0,u.useCallback)(()=>{var e,t,n,i;c(),$&&F&&"boolean"!=typeof $&&"boolean"!=typeof F&&eR({leftTypedValue:F.invert(),rightTypedValue:$.invert()}),eC(null!=(n=null==(e=J[tP.O9.CURRENCY_B])?void 0:e.toSignificant(6))?n:""),eb(null!=(i=null==(t=J[tP.O9.CURRENCY_A])?void 0:t.toSignificant(6))?i:"")},[c,$,F,eR,J,eC,eb]),{getDecrementLower:eE,getIncrementLower:eS,getDecrementUpper:eT,getIncrementUpper:eN,getSetFullRange:eU}=(0,nB.i)(null!=p?p:void 0,null!=h?h:void 0,m,em,ex,eu),eO=(0,u.useCallback)((e,t)=>{eR({leftTypedValue:(0,e3.m)(null==p?void 0:p.wrapped,null==h?void 0:h.wrapped,e),rightTypedValue:(0,e3.m)(null==p?void 0:p.wrapped,null==h?void 0:h.wrapped,t)})},[p,h,eR]),eM=(0,u.useCallback)(e=>{ej((0,e3.m)(null==p?void 0:p.wrapped,null==h?void 0:h.wrapped,e))},[ej,p,h]),eB=(0,u.useCallback)(e=>{ew((0,e3.m)(null==p?void 0:p.wrapped,null==h?void 0:h.wrapped,e))},[ew,p,h]),e_=(0,u.useCallback)(e=>{if(N(void 0),!e)return void L(void 0);let t=Q?parseFloat((eo?Q.invert():Q).toSignificant(8)):void 0;if(t){let n=t*e.initialMin,i=t*e.initialMax;eO(n.toString(),i.toString())}},[Q,eo,eO]),eL=(0,u.useCallback)((e,t)=>{if(B(e),null!==e)if(100===e)L(void 0),E(!0),N(100),U.current=!0;else{var n;m&&(null==(n=nu.T[m])?void 0:n[e])?(L(void 0),e_(nu.T[m][e])):(L(t),e_(t)),N(e),U.current=!0}},[m,e_,E]),eP=(0,nU.h)(),eY=(0,nO.$)(),eq=(0,u.useCallback)(e=>{var n,i,l,r,s,o;A(!1),(0,tJ.Mg)(),y(e);let a=p?(0,nl.cf)(null!=(s=null==(i=J[tP.O9.CURRENCY_A])||null==(n=i.quotient)?void 0:n.toString())?s:"0",p.decimals,4):0,d=h?(0,nl.cf)(null!=(o=null==(r=J[tP.O9.CURRENCY_B])||null==(l=r.quotient)?void 0:l.toString())?o:"0",null==h?void 0:h.decimals,4):0;ec({hash:e},{type:"add-liquidity-v3",summary:`Add ${a} ${null==p?void 0:p.symbol} and ${d} ${null==h?void 0:h.symbol}`}),t.push("/liquidity/pools")},[t,ec,p,h,J]),eD=(0,u.useCallback)(async()=>
1{if((0,tJ.aF)(),!p||!h||!Q||!m)return void k(e("Missing required information"));try{A(!0);let e=ef?p.wrapped:h.wrapped,t=ef?h.wrapped:p.wrapped,{buildData:n}=await eP({mintA:e,mintB:t,tradeFeeRate:m,initialPrice:parseFloat(Q.toSignificant(18)),position:"number"==typeof em&&"number"==typeof ex?{tickLower:em,tickUpper:ex,amountA:J[ef?tP.O9.CURRENCY_A:tP.O9.CURRENCY_B],amountB:J[ef?tP.O9.CURRENCY_B:tP.O9.CURRENCY_A]}:void 0}),i=await eY({createBuildData:n,independentField:q,dependentField:z,parsedAmounts:J,ticks:W,poolInfo:null==n?void 0:n.extInfo.mockPoolInfo,onTxUpdate:e=>{var t;eq(null==(t=e[0])?void 0:t.txId)}});setTimeout(()=>{let e="txId"in i?i.txId:"txIds"in i?i.txIds[0]:"";eq(e)},1e4)}catch(e){A(!1),k((null==e?void 0:e.message)||String(e)),P(),a()}},[a,P,eq,eY,z,q,W,ef,p,h,Q,m,e,eP,J,em,ex]),eV=(0,u.useCallback)(()=>{d?eD():s(),(0,tJ.uL)()},[d,eD,s]);(0,u.useEffect)(()=>{E(!1)},[p,h,m]),(0,u.useEffect)(()=>{m&&(N(void 0),eR({leftTypedValue:void 0,rightTypedValue:void 0}))},[m]),(0,u.useEffect)(()=>{!U.current&&S?(N(void 0),B(null),L(void 0)):U.current&&(U.current=!1)},[U,S,$,F]);let e$=(0,i.jsx)(nS.N,{addIsUnsupported:!1,addIsWarning:!1,account:null!=n?n:void 0,isWrongNetwork:!!l,isValid:!en&&!ei,parsedAmounts:J,onClick:eV,attemptingTxn:f,errorMessage:en,buttonText:e("Add"),depositADisabled:er,depositBDisabled:es}),eF=(0,i.jsxs)(x.mm,{gap:"8px",children:[(0,i.jsx)(j.y,{children:e("Set Price Range")}),!R&&(0,i.jsx)(nT.L,{priceLower:ev,priceUpper:ey,getDecrementLower:eE,getIncrementLower:eS,getDecrementUpper:eT,getIncrementUpper:eN,onLeftRangeInput:ej,onRightRangeInput:ew,currencyA:p,currencyB:h,feeAmount:null!=m?m:void 0,ticksAtLimit:ea,tickSpaceLimits:ed,quickAction:null!=S?S:null,handleQuickAction:eL}),R&&(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsxs)(C.Ay,{children:[(0,i.jsx)(I.A,{fontSize:"16px",children:e("Efficiency Comparison")}),(0,i.jsx)(I.A,{color:"textSubtle",children:e("Full range positions may earn less fees than concentrated positions.")}),(0,i.jsx)(Z.A,{mt:"16px",onClick:()=>{E(!1),eU(),N(100)},scale:"md",variant:"danger",children:e("I understand")})]})}),el?(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsx)(tm.JA,{children:(0,i.jsx)(I.A,{ml:"12px",fontSize:"12px",children:e("Your position will not earn fees or be used in trades until the market price moves into your range.")})})}):null,ei?(0,i.jsx)(tw.A,{variant:"warning",children:(0,i.jsx)(tw.J,{children:e("Invalid range selected. The min price must be lower than the max price.")})}):null]}),eW=(0,u.useMemo)(()=>(0,i.jsx)(nd.M,{currencies:et,parsedAmounts:J,onConfirm:eD,isOpen:o,onDismiss:a,feeTier:m?`${(m/1e4).toFixed(2)}%`:void 0,attemptingTxn:f,details:{priceRange:(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(b.A,{gap:"4px",alignItems:"center",children:[(0,i.jsxs)(x.mm,{children:[(0,i.jsxs)("div",{children:[eA," - ",eg]}),(0,i.jsx)("div",{children:e("%assetA% = 1 %assetB%",{assetA:null==h?void 0:h.symbol,assetB:null==p?void 0:p.symbol})})]}),(0,i.jsx)(H.A,{variant:"text",scale:"sm",onClick:eI,children:(0,i.jsx)(eJ.A,{color:"textSubtle"})})]})}),startPrice:(0,i.jsxs)(i.Fragment,{children:[eo?null==Q?void 0:Q.invert().toSignificant(6):null==Q?void 0:Q.toSignificant(6)," ",e("%assetA% = 1 %assetB%",{assetA:null==h?void 0:h.symbol,assetB:null==p?void 0:p.symbol})]})}}),[f,eo,eA,eg,eI,et,J,eD,o,a,m,Q,p,h,e]);return{formState:Y,currencies:et,leftRangeTypedValue:$,rightRangeTypedValue:F,startPriceTypedValue:V,formattedAmounts:ep,maxAmounts:eh,depositADisabled:er,depositBDisabled:es,noLiquidity:ee,buttons:e$,rangeSelector:eF,previewModal:eW,onBothRangePriceInput:eO,onLeftRangePriceInput:eM,onRightRangePriceInput:eB,onFieldAInput:eC,onFieldBInput:eb,onStartPriceInput:ek,switchCurrencies:eI}})(),[E]=(0,T.LI)(),S=(0,u.useMemo)(()=>!1===c&&!!E,[E,c]),N=e[tP.O9.CURRENCY_A]&&e[tP.O9.CURRENCY_B],{[tP.O9.CURRENCY_A]:U,[tP.O9.CURRENCY_B]:M}=e;return(0,i.jsxs)(C.Ay,{maxWidth:[null,null,null,"560px"],mx:"auto",children:[(0,i.jsx)(h.A,{children:(0,i.jsx)(m.A,{children:(0,i.jsxs)(x.mm,{gap:"24px",children:[(0,i.jsx)(eZ,{}
1),(0,i.jsx)(v.x,{disabled:!N,children:(0,i.jsx)(nh.L,{baseCurrency:U,quoteCurrency:M,feeAmount:null!=E?E:void 0})}),S&&N&&(0,i.jsx)(np,{protocol:tL.Zs.V3}),(0,i.jsx)(v.x,{disabled:S||!N,children:(0,i.jsx)(tq,{startPrice:l,setStartPrice:A,switchCurrencies:R})}),(0,i.jsx)(v.x,{disabled:S||!N||!l||!E,children:y}),(0,i.jsx)(v.x,{disabled:S||!N||!l||!E||!t||!n,children:(0,i.jsx)(tW,{currencies:e,onFieldAInput:w,onFieldBInput:k,formattedAmounts:s,maxAmounts:o,depositADisabled:a,depositBDisabled:d})}),(0,i.jsx)(v.x,{disabled:S||!N||!l||!E||!t||!n,children:p})]})})}),f]})},nL=(0,en.Ay)(C.Ay).withConfig({componentId:"sc-7439ef6c-0"})(["background:",";"],e=>{let{theme:t}=e;return t.colors.backgroundPage}),nP=()=>{let{routeParams:e,protocolName:t}=(0,r.gG)(),{chainId:n}=(0,tc.ax)(),{baseCurrency:s}=(0,O.Z)();return((0,r.Tf)(),e)?(0,i.jsx)(nL,{children:(0,i.jsxs)(nx.A,{children:[(0,i.jsx)(d.D,{}),(0,i.jsx)(C.Ay,{mt:"24px",children:t===tP.TE.Infinity?(0,i.jsx)(t_,{}):t===tP.TE.V3?(0,U.fT)(n)||(0,U.fT)(null==s?void 0:s.chainId)?(0,i.jsx)(n_,{}):(0,i.jsx)(nm,{}):t===tP.TE.V2?(0,i.jsx)(nI,{}):null})]})}):(0,i.jsx)(l.A,{})},nY=o()(()=>Promise.resolve(nP),{ssr:!1});nY.chains=a.tx,nY.screen=!0;let nq=nY},286750:(e,t,n)=>{"use strict";n.d(t,{AK:()=>c,Ib:()=>h,Zg:()=>x,uE:()=>m});var i=n(25963),l=n(233764),r=n(656862),s=n(118708),o=n(835490),a=n(902609);let d={independentField:o.O9.CURRENCY_A,typedValue:"",otherTypedValue:""},u=(0,l.vy)(d,e=>e.addCase(a.J,()=>d).addCase(a.$,(e,t)=>{let{payload:{field:n,typedValue:i,noLiquidity:l}}=t;return l?n===e.independentField?{...e,independentField:n,typedValue:i}:{...e,independentField:n,typedValue:i,otherTypedValue:e.typedValue}:{...e,independentField:n,typedValue:i,otherTypedValue:""}})),c=()=>(0,r.um)(d,u),p=(0,i.createContext)({formAtom:c()}),h=p.Provider;function m(){let e=(0,i.useContext)(p);return(0,s.md)(e.formAtom)}function x(){let e=(0,i.useContext)(p);return(0,s.Xr)(e.formAtom)}},314807:(e,t,n)=>{"use strict";n.d(t,{x:()=>r});var i=n(573536);let l=n(923727).env.NEXT_PUBLIC_REWARD_API_ENDPOINT||"https://infinity.pancakeswap.com/",r=(0,i.Ay)({baseUrl:l});r.use({async onResponse(e){let{response:t}=e;if(t.status>=400){var n;throw Error((null==(n=t.headers.get("content-type"))?void 0:n.includes("json"))?await t.clone().json():await t.clone().text())}}})},314811:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var i=function(e){return e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID",e}({})},335403:(e,t,n)=>{"use strict";n.d(t,{D_:()=>i,Oy:()=>l,h5:()=>r});var i=function(e){return e[e.SWAP=0]="SWAP",e[e.MINT=1]="MINT",e[e.BURN=2]="BURN",e}({}),l=function(e){return e[e.V3=0]="V3",e[e.V2=1]="V2",e}({}),r=function(e){return e[e.daily=0]="daily",e[e.weekly=1]="weekly",e[e.monthly=2]="monthly",e}({})},344035:(e,t,n)=>{"use strict";n.d(t,{I:()=>m});var i=n(350979),l=n(734658),r=n(796147),s=n(970911),o=n(841643),a=n(687287),d=n(411207),u=n(386182),c=n(25963),p=n(488907),h=n(312779);let m=e=>{let{baseCurrency:t,quoteCurrency:n,tickSpacing:m,currentPrice:x,quickAction:v,handleQuickAction:y}=e,[f]=(0,p.h2)(),[{lowerTick:A,upperTick:g}]=(0,p.N_)(),C=(0,c.useMemo)(()=>null!==A&&null!==g,[A,g]),{onLowerDecrement:b,onLowerIncrement:j,onUpperDecrement:w,onUpperIncrement:k,onLowerUserInput:R,onUpperUserInput:I}=(0,u.w)(t,n,m,x),[E,S]=(0,c.useMemo)(()=>t&&n?(0,l.Uy)([t,n]):[void 0,void 0],[t,n]),T=(0,a.f6)(E,S),N=(0,c.useCallback)(e=>(0,h.N)(T(e)),[T]),{minPrice:U,maxPrice:O}=(0,d.d)(t,n,null!=m?m:void 0,N),[M,B,_,L,P,Y]=(0,c.useMemo)(()=>f?[k,w,j,b,I,R]:[b,j,w,k,R,I],[f,b,j,w,k,R,I]);return(0,i.jsxs)(r.mm,{gap:"8px",children:[(0,i.jsx)(o.z,{baseCurrency:t,quoteCurrency:n,minPrice:U,maxPrice:O,onMinPriceDecrement:M,onMinPriceIncrement:B,onMaxPriceDecrement:_,onMaxPriceIncrement:L,onMinPriceUserInput:P,onMaxPriceUserInput:Y}),(0,i.jsx)(s.r.PriceRangePicker,{tickSpacing:m,value:C?v:void 0,onChange:y})]})}},386182:(e,t,n)=>{"use strict";n.d(t,{w:()=>p});var i=n(734658),l=n(673384),r=n(91168),s=n(687287),o=n(403607),a=n(112788),d=n(25963),u=n(488907),c=n(702356);let p=(e,t,n,p)=>{let[{lowerTick:h,upperTick:m},x]=(0,u.N_)(),v=(0,s.hx)(e,t),[y,f]=(0,d.useMemo)(()=>e&&t?(0,i.Uy)([e,t]):[void 0,void 0],[e,t]),A=(0,d.useCallback)(()=>{null!==h&&n&&(R(null),x({lowerTick:(0,l.Yp)(h+n,n)}))},[h,n,x]),g=(0,d.useCallback)(()=>{null!==h&&n&&(R(null),x({lowerTick:(0,l.Yp)(h-n,n)}))},[h,n,x]),C=(0,d.useCallback)(()=>{null!==m&&n&&(R(null),x({upperTick:(0,l.Yp)(m+n,n)}))},[m,n,x]),b=(0,d.useCallback)(()=>{null!==m&&n&&(R(null),x({upperTick:(0,l.Yp)(m-n,n)}))},[m,n,x]),j=(0,d.useCallback)(l=>{if(!n||!e||!t)return;if(R(null),""===l)return void x({lowerTick:null});let r=v(l);if(void 0===r)return;(0,i.lV)(e,t)||(r=r.invert());let s=(0,o.We)(r,n);void 0!==s&&x({lowerTick:s})},[n,x,e,t,v]),w=(0,d.useCallback)(l=>{if(!n||!e||!t)return;if(R(null),""===l)return void x({upperTick:null});let r=v(l);if(void 0===r)return;(0,i.lV)(e,t)||(r=r.invert());let s=(0,o.We)(r,n);void 0!==s&&x({upperTick:s})},[n,e,t,x,v]),[k,R]=(0,d.useState)(null),I=(0,c.V)(null!=n?n:void 0);return{onLowerIncrement:A,onLowerDecrement:g,onUpperIncrement:C,onUpperDecrement:b,onLower
1UserInput:j,onUpperUserInput:w,quickAction:k,handleQuickAction:(0,d.useCallback)((e,t)=>{if(!n||!y||!f||!p||p.equalTo(0))return;if(R(e),100===e)return void x({lowerTick:I.LOWER,upperTick:I.UPPER});let{initialMin:l,initialMax:s}=t,d=(0,i.lV)(p.baseCurrency,p.quoteCurrency)?p:p.invert(),u=(0,a.m)(y,f,new r.A(d.denominator?d.toFixed(18):0).times(null!=l?l:1).toString()),c=(0,a.m)(y,f,new r.A(d.denominator?d.toFixed(18):0).times(null!=s?s:1).toString());if(u&&c)x({lowerTick:(0,o.We)(u,n),upperTick:(0,o.We)(c,n)})},[p,y,f,x,n,I])}}},403607:(e,t,n)=>{"use strict";n.d(t,{We:()=>s,y1:()=>o});var i=n(213527),l=n(734658),r=n(673384);function s(e,t){let n;if(!e||!t||"boolean"==typeof e)return;let i=(0,r.r_)(e.numerator,e.denominator);return n=i>=r.gy.MAX_SQRT_RATIO?r.gy.MAX_TICK:i<=r.gy.MIN_SQRT_RATIO?r.gy.MIN_TICK:function(e){let[t]=(0,l.Uy)([e.baseCurrency,e.quoteCurrency]),n=t.equals(e.baseCurrency),i=n?(0,r.r_)(e.numerator,e.denominator):(0,r.r_)(e.denominator,e.numerator),s=r.gy.getTickAtSqrtRatio(i),a=o(e.baseCurrency,e.quoteCurrency,s+1);return n?!e.lessThan(a)&&s++:!e.greaterThan(a)&&s++,s}(e),(0,r.Yp)(n,t)}function o(e,t,n){let s=r.gy.getSqrtRatioAtTick(n),o=s*s,[a]=(0,l.Uy)([e,t]);return a.equals(e)?new l.gm(e,t,i.CI,o):new l.gm(e,t,o,i.CI)}},533078:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(350979);n(25963);var l=n(257057);let r=e=>(0,i.jsx)(l.A,{viewBox:"0 0 15 18",...e,children:(0,i.jsx)("path",{d:"M6.58116 9.79562L5.28966 8.50937C5.12225 8.34195 4.93033 8.25912 4.71391 8.26087C4.4975 8.26262 4.30565 8.34713 4.13838 8.5144C3.97097 8.68181 3.88726 8.87563 3.88726 9.09584C3.88726 9.31604 3.97097 9.50986 4.13838 9.67727L5.92338 11.4844C6.1083 11.6691 6.32391 11.7615 6.57023 11.7615C6.81654 11.7615 7.03215 11.6691 7.21707 11.4844L10.873 7.82818C11.0403 7.66091 11.
11239 7.46906 11.1239 7.25265C11.1239 7.03623 11.0403 6.84431 10.873 6.6769C10.7056 6.50963 10.5101 6.42599 10.2864 6.42599C10.0626 6.42599 9.86715 6.50963 9.69988 6.6769L6.58116 9.79562ZM7.49992 17.4799C7.40192 17.4799 7.30224 17.4753 7.20088 17.4663C7.09938 17.4573 7.00518 17.4364 6.91826 17.4037C4.98349 16.7698 3.42956 15.5878 2.25648 13.8578C1.08354 12.1276 0.49707 10.2532 0.49707 8.2344V4.34393C0.49707 3.95631 0.602143 3.61032 0.812289 3.30596C1.02258 3.00161 1.30521 2.78235 1.66016 2.64818L6.84738 0.66193C7.06147 0.578513 7.27898 0.536804 7.49992 0.536804C7.72085 0.536804 7.93836 0.578513 8.15245 0.66193L13.3397 2.64818C13.6946 2.78235 13.9772 3.00161 14.1875 3.30596C14.3977 3.61032 14.5028 3.95631 14.5028 4.34393V8.2344C14.5028 10.2532 13.9163 12.1276 12.7434 13.8578C11.5703 15.5878 10.0163 16.7698 8.08157 17.4037C7.99465 17.4364 7.90045 17.4573 7.79895 17.4663C7.69759 17.4753 7.59792 17.4799 7.49992 17.4799Z",fill:"currentColor"})})},546061:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var i=n(680797),l=n(428089);let r=(0,i.I4)(l.Ay).withConfig({componentId:"sc-c2f7f062-0"})(["border-radius:50%;border:2px solid ",";border-top:2px solid transparent;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);}}@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}"],e=>{let{theme:t}=e;return t.colors.textDisabled});r.defaultProps={width:"20px",height:"20px"};let s=r},559180:(e,t,n)=>{"use strict";n.d(t,{H9:()=>p,k1:()=>y});var i=n(228876),l=n(311560),r=n(670420),s=n(760013),o=n.n(s),a=n(449229);let d={[i.nU.BSC]:"smartchain",[i.nU.ETHEREUM]:"ethereum",[i.nU.ARBITRUM_ONE]:"arbitrum",[i.nU.ZKSYNC]:"zksync",[i.nU.BASE]:"base",[i.nU.LINEA]:"linea",[i.nU.OPBNB]:"opbnb",[i.nU.MONAD_MAINNET]:"monad",[i.nU.ROBINHOOD]:"robinhood",[i.nU.ARC]:"arc"},u=o()(e=>e&&d[e.chainId]?`https://assets-cdn.trustwallet.com/blockchains/${d[e.chainId]}/assets/${(0,a.b)(e.address)}/logo.png`:null,e=>`${null==e?void 0:e.chainId}#${null==e?void 0:e.address}`),c=o()((e,t)=>e&&t&&d[t]?`https://assets-cdn.trustwallet.com/blockchains/${d[t]}/assets/${(0,a.b)(e)}/logo.png`:null,(e,t)=>`${t}#${e}`),p={[i.nU.BSC]:"",[i.nU.ETHEREUM]:"eth",[i.nU.ARBITRUM_ONE]:"arbitrum",[i.nU.ZKSYNC]:"zksync",[i.nU.LINEA]:"linea",[i.nU.BASE]:"base",[i.nU.OPBNB]:"opbnb",[i.nU.MONAD_MAINNET]:"monad",[i.nU.MONAD_TESTNET]:"monad-testnet",[i.nU.ROBINHOOD]:"robinhood",[i.nU.ARC]:"arc",[i.Cb.SOLANA]:"solana"},h=e=>{let t;if(!Object.keys(p).includes(String(e.chainId)))return null;if(e.chainId===i.Cb.SOLANA)t=e.address;else if(e.chainId===i.nU.ROBINHOOD)t=e.address.toLowerCase();else try{t=(0,a.b)(e.address)}catch{return null}return`https://tokens.pancakeswap.finance/images/${e.chainId===i.nU.BSC?"":`${p[e.chainId]}/`}${t}.png`},m=[r.E8.usdt,r.E8.usdc,r.x_.cake,r.x_.usdv,r.E8.wbtc,r.E8.weth,l.s6[i.nU.BSC],r.x_.busd,r.E8.dai].map(e=>{let{symbol:t}=e;return t}),x=o()(e=>v(null==e?void 0:e.symbol),e=>`logoUrls#${null==e?void 0:e.chainId}#${null==e?void 0:e.symbol}`),v=o()(e=>e&&m.includes(e)?`https://tokens.pancakeswap.finance/images/symbol/${e.toLocaleLowerCase()}.png`:void 0,e=>`logoUrls#symbol#${e}`);o()(function(e){let{useTrustWallet:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=u(null==e?void 0:e.wrapped),i=e?h(e.wrapped):null;return[x(e),t?n:void 0,i].filter(e=>!!e)},(e,t)=>{var n;return`logoUrls#${null==e?void 0:e.chainId}#${null==e||null==(n=e.wrapped)?void 0:n.address}#${t?JSON.stringify(t):""}`});let y=o()(function(e){let{useTrustWallet:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[];let{chainId:n,address:i,symbol:l}=e,r=c(i,n),s=n&&i?h({chainId:n,address:i}):null;return[v(l),t?r:void 0,s].filter(e=>!!e)},(e,t)=>`logoUrls#${null==e?void 0:e.chainId}#${null==e?void 0:e.symbol}#${null==e?void 0:e.address}#${t?JSON.stringify(t):""}`)},608998:(e,t,n)=>{"use strict";n.d(t,{w:()=>s});var i=n(530957),l=n(985148);let r=(0,n(781649).getLogger)("error-report");function s(e){let t,{asyncFn:n,maxRetries:s=3,delayMs:o=1e3,fallbackValue:a,errorReportKey:d,shared:u=!1,sharedTtlMs:c=6e4}=e,p=(0,l.eU)(0),h=(e,i)=>{if(!u)return n(e,i);let l=Date.now();if(t&&l-t.at<c)return t.promise;let r=n(e,new AbortController().signal).catch(e=>{throw(null==t?void 0:t.promise)===r&&(t=void 0),e});return t={at:l,promise:r},r},m=(0,l.eU)(async(e,t)=>{let{signal:n}=t;e(p);let l=0;for(;l<s;)try{return await h(e,n)}catch(e){if(d&&r.error(d,{reason:"Async function failed",message:e instanceof Error?e.message:String(e),stack:e instanceof Error?e.stack:void 0}),++l>
1=s){if(!(0,i.A)(a))try{if("function"==typeof a)return await a();return a}catch{return}throw e}await new Promise(e=>setTimeout(e,o))}throw Error("Retries exhausted")});return(0,l.eU)(e=>e(m),(e,n)=>{t=void 0,n(p,e=>e+1)})}},650176:(e,t,n)=>{"use strict";n.d(t,{I6:()=>f,Q2:()=>y,Tw:()=>v,f$:()=>A});var i=n(673384),l=n(662928),r=n(126294),s=n(221197),o=n(529208),a=n(53670),d=n(25963),u=n(779597),c=n(792118),p=n(530957),h=n(314811);class m{static getPoolAddress(e,t,n,l){this.addresses.length>this.MAX_ENTRIES&&(this.addresses=this.addresses.slice(0,this.MAX_ENTRIES/2));let{address:r}=t,{address:s}=n,o=`${e}:${r}:${s}:${l.toString()}`,a=this.addresses.find(e=>e.key===o);if(a)return a.address;let d={key:o,address:(0,i.kT)({deployerAddress:e,tokenA:t,tokenB:n,fee:l})};return this.addresses.unshift(d),d.address}static getPool(e,t,n,l,r,s,o){this.pools.length>this.MAX_ENTRIES&&(this.pools=this.pools.slice(0,this.MAX_ENTRIES/2));let a=this.pools.find(i=>i.token0===e&&i.token1===t&&i.fee===n&&i.sqrtRatioX96===l&&i.liquidity===r&&i.tickCurrent===s);if(a)return a;let d=new i.bC(e,t,n,l,r,s);return d.feeProtocol=o,this.pools.unshift(d),d}}function x(e,t,n,i){if(i)return[h.S.LOADING,null];if(!e||e.some(e=>(0,p.A)(e))||!t||!n)return[h.S.INVALID,null];let[l,r,s]=e,{result:o}=t,a=n.result;if(!o||void 0===a)return[h.S.NOT_EXISTS,null];let[d,u,,,,c]=o;if(!d||0n===d)return[h.S.NOT_EXISTS,null];try{let e=m.getPool(l,r,s,d,a,u,c);return[h.S.EXISTS,e]}catch(e){return console.error("Error when constructing the pool",e),[h.S.INVALID,null]}}function v(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{chainId:n}=(0,a.ax)(),l=(0,d.useMemo)(()=>{var t,n;return null==(n=e.find(e=>{let[t]=e;return null==t?void 0:t.wrapped.chainId}))||null==(t=n[0])?void 0:t.wrapped.chainId},[e]),r=null!=l?l:n,o=(0,d.useMemo)(()=>r?e.map(e=>{let[t,n,i]=e;if(t&&n&&i){let e=t.wrapped,l=n.wrapped;if(e.equals(l))return;return e.sortsBefore(l)?[e,l,i]:[l,e,i]}}):Array(e.length),[r,e]),c=(0,d.useMemo)(()=>{let e=r&&i.Is[r];return e?o.map(t=>t&&m.getPoolAddress(e,...t)):Array(o.length)},[r,o]),{compactAddresses:p,originalToCompactIndex:h}=(0,d.useMemo)(()=>{let e=[],t=new Map;return c.forEach((n,i)=>{n&&(t.set(i,e.length),e.push(n))}),{compactAddresses:e,originalToCompactIndex:t}},[c]),v=p.length>0,{data:y,isLoading:f}=(0,u.Dd)({addresses:p,chainId:r,abi:s.j,functionName:"slot0",options:{enabled:v,watch:t}}),{data:A,isLoading:g}=(0,u.Dd)({addresses:p,chainId:r,abi:s.j,functionName:"liquidity",options:{enabled:v,watch:t}});return(0,d.useMemo)(()=>e.map((e,t)=>{let n=h.get(t),i=void 0!==n?null==y?void 0:y[n]:void 0,l=void 0!==n?null==A?void 0:A[n]:void 0;return x(o[t],i,l,f||g)}),[A,e,y,o,f,g,h])}function y(e,t,n){let i=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return v((0,d.useMemo)(()=>[[e,t,n]],[e,t,n]),i)[0]}function f(e){let t=(0,d.useMemo)(()=>e.map(e=>{let[t,n,i]=e;if(t&&n&&i){let e=t.wrapped,l=n.wrapped;if(e.equals(l))return;return e.sortsBefore(l)?[e,l,i]:[l,e,i]}}),[e]),n=(0,d.useMemo)(()=>t.reduce((e,t)=>{var n;if(!t)return e;let{chainId:l}=t[0],r=i.Is[l];if(!r)return e;let s=m.getPoolAddress(r,...t);return e[l]=null!=(n=e[l])?n:[],e[l].push(s),e},{}),[t]),a=(0,d.useMemo)(()=>Object.keys(n),[n]),u=(0,d.useMemo)(()=>a.flatMap(e=>n[e]).join(","),[a,n]),{data:p}=(0,l.I)({queryKey:["v3PoolInfo",a.join(","),u],queryFn:async()=>(await Promise.all(a.map(async e=>{let t=n[e],i=(0,c.Rt)({chainId:Number(e)}),l=t.map(e=>({address:e,abi:s.j,functionName:"slot0"})),r=t.map(e=>({address:e,abi:s.j,functionName:"liquidity"}));try{let n=await i.multicall({contracts:[...l,...r],allowFailure:!0}),s=n.slice(0,t.length),o=n.slice(t.length),a=[],d=[];return t.forEach((e,t)=>{let n=s[t],i=o[t],l="success"===n.status&&"success"===i.status;a.push(l?n.result:void 0),d.push(l?i.result:void 0)}),{[e]:{slot0:a,liquidity:d}}}catch(t){return console.error(`Error fetching data for chainId ${e}:`,t),{[e]:{slot0:void 0,liquidity:void 0}}}}))).reduce((e,t)=>{let n=Object.keys(t)[0];return e[n]=t[n],e},{}),enabled:(null==a?void 0:a.length)>0,placeholderData:r.rX,...o.MU,...o.Od});return(0,d.useMemo)(()=>{let n={};return e.map((e,i)=>{var l;let r=t[i];if(!r)return x(void 0,void 0,void 0,!1);let[s]=r;n[s.chainId]=(null!=(l=n[s.chainId])?l:-1)+1;let{slot0:o=[],liquidity:a=[]}=(null==p?void 0:p[s.chainId])||{},d=o[n[s.chainId]],u=a[n[s.chainId]];return x(r,void 0!==d?{result:d}:void 0,void 0!==u?{result:u}:void 0,!1)})},[e,t,p])}function A(e,t,n){return f((0,d.useMemo)(()=>[[e,t,n]],[e,t,n]))[0]}m.MAX_ENTRIES=128,m.pools=[],m.addresses=[]}
1,656302:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(311560),l=n(25963),r=n(779597),s=n(555967);let o=function(e){var t,n;let o=(0,s.dV)((null==e?void 0:e.isToken)?e.address:void 0),a=null==(n=(0,r.DD)({contract:o,functionName:"totalSupply"}))||null==(t=n.result)?void 0:t.toString();return(0,l.useMemo)(()=>(null==e?void 0:e.isToken)&&a?i.eF.fromRawAmount(e,a):void 0,[e,a])}},689612:(e,t,n)=>{"use strict";n.d(t,{K:()=>r});var i=n(459247),l=n(425576);function r(e){let t=(0,l._Q)(),n=(0,l.lh)(),r=!1;return function(s){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r||(r=!0,(0,i.yU)("core_data_operation",()=>({...o,operation:e,outcome:s,duration_ms:Math.round((0,l.lh)()-n),start_ms:Math.round(n-t.started_at_ms),completed_ms:Math.round((0,l.lh)()-t.started_at_ms)}),void 0,t))}}},728844:(e,t,n)=>{"use strict";n.d(t,{x:()=>b});var i=n(228876),l=n(782739),r=n(893130),s=n(899188),o=n(209208),a=n(760013),d=n.n(a),u=n(25963),c=n(695055),p=n(617921),h=n(524099),m=n(779623),x=n(680116),v=n(545416),y=n(532649),f=n(660193),A=n(697115),g=n(53670);let C=d()(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return s.rY.reduce((t,n)=>({...t,[n.id]:(0,h.l)({chain:n,transport:e&&window.ethereum?(0,m.I)(window.ethereum):(0,p.v)([...o.I[n.id].map(e=>(0,x.L)(e,{timeout:15e3}))]),batch:{multicall:{batchSize:204800,wait:16}},pollingInterval:6e3})}),{})});function b(e){let{chainId:t}=(0,g.ax)(),n=null!=e?e:t,s=(0,A.e)({chainId:n}),o=(0,g.NM)(),a=(0,l.hm)(n);return{waitForTransaction:(0,u.useCallback)(async e=>{var t;let l=null!=(t=null==e?void 0:e.chainId)?t:n,d=async()=>{try{if(l&&C(o)[l]){let t=await C(o)[l].getTransactionReceipt({hash:e.hash});return"success"===t.status&&a(),t}if(!s)return;let t=await s.getTransactionReceipt({hash:e.hash});return"success"===t.status&&a(),t}catch(i){var t,n;if(i instanceof v.Kz)throw new c.dw(`Transaction not found: ${e.hash}`);if(i instanceof v.Kc)throw new c.dw(`Transaction receipt not found: ${e.hash}`);if(i instanceof y.l)throw new c.dw(`Block not found for transaction: ${e.hash}`);else if(i instanceof v.WA)throw new c.dw(`Timeout reached when fetching transaction receipt: ${e.hash}`);else if(i instanceof f.Ci&&((null==(t=i.details)?void 0:t.includes("Load failed"))||(null==(n=i.details)?void 0:n.includes("Failed to fetch"))))throw new c.dw(`Network error when request to ${i.url} failed: ${i.status}, ${i.details}`);throw i}},u=(l?i.vf[l]:r.J3)*1e3+1e3;return(0,c.cJ)(d,{n:10,base:u,delay:u,factor:1.5}).promise},[n,s,a,o])}}},755677:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/liquidity/create/[...selectId]",function(){return n(285684)}])},774900:(e,t,n)=>{"use strict";n.d(t,{D$:()=>o,L1:()=>r.L1,pg:()=>a,uP:()=>r.uP});var i=n(913076),l=n(573536),r=n(169516);let s={async onResponse(e){let{response:t}=e;if(t.status>=400){var n;throw Error((null==(n=t.headers.get("content-type"))?void 0:n.includes("json"))?await t.clone().json():await t.clone().text())}}},o=(0,l.Ay)({baseUrl:"https://explorer.pancakeswap.com/api"});o.use(s),o.use({onRequest(e){let{request:t}=e;return i.o.request(t)}});let a=(0,l.Ay)({baseUrl:"https://sol-explorer.pancakeswap.com/api"});a.use(s)},835490:(e,t,n)=>{"use strict";n.d(t,{O9:()=>i,TE:()=>l,nN:()=>r});var i=function(e){return e.CURRENCY_A="CURRENCY_A",e.CURRENCY_B="CURRENCY_B",e}({}),l=function(e){return e.Infinity="infinity",e.V3="v3",e.V2="v2",e.StableSwap="stableSwap",e}({});let r=["infinity","v3","v2","stableSwap"]},859886:(e,t,n)=>{"use strict";n.d(t,{CN:()=>a,ek:()=>u,hM:()=>d});var i=n(311560),l=n(25963),r=n(779597),s=n(452301),o=n(53670),a=function(e){return e[e.LOADING=0]="LOADING",e[e.NOT_EXISTS=1]="NOT_EXISTS",e[e.EXISTS=2]="EXISTS",e[e.INVALID=3]="INVALID",e}({});function d(e){let{chainId:t}=(0,o.ax)(),n=(0,l.useMemo)(()=>e.map(e=>{let[n,i]=e;return[(0,s.dc)(n,t),(0,s.dc)(i,t)]}),[t,e]),a=(0,l.useMemo)(()=>n.map(e=>{let[t,n]=e;try{return t&&n&&!t.equals(n)?i.Rm.getAddress(t,n):void 0}catch(e){console.error(e.msg,`- pairAddresses: ${null==t?void 0:t.address}-${null==n?void 0:n.address}`,`chainId: ${null==t?void 0:t.chainId}`);return}}),[n]),d=(0,r._l)({addresses:a,abi:i.a9,functionName:"getReserves"});return(0,l.useMemo)(()=>d.map((e,t)=>{let{result:l,loading:r}=e,s=n[t][0],o=n[t][1];if(r)return[0,null];
1if(!s||!o||s.equals(o))return[3,null];if(!l)return[1,null];let[a,d]=l,[u,c]=s.sortsBefore(o)?[s,o]:[o,s];return[2,new i.Rm(i.eF.fromRawAmount(u,a.toString()),i.eF.fromRawAmount(c,d.toString()))]}),[d,n])}function u(e,t){return d((0,l.useMemo)(()=>[[e,t]],[e,t]))[0]}},902609:(e,t,n)=>{"use strict";n.d(t,{$:()=>l,J:()=>r});var i=n(233764);let l=(0,i.VP)("mint/typeInputMint"),r=(0,i.VP)("mint/resetMintState")},913076:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});class i{static shouldUsePreview(){return!1}static url(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.origin,n=new URL(e);if(["explorer.pancakeswap.com","qa-explorer.pancakeswap.com"].includes(n.hostname)&&(n.hostname=i.shouldUsePreview()?"qa-explorer.pancakeswap.com":"explorer.pancakeswap.com"),i.shouldUsePreview()&&t&&n.origin!==t){let e=new URL(`/api/explorer${n.pathname.replace(/^\/api/,"")}`,t);return e.search=n.search,e}return i.shouldUsePreview()&&n.searchParams.set("preview","1"),n}static request(e){return new Request(i.url(e.url),e)}static fetch(e,t){return fetch(i.url(e),t)}}},924330:(e,t,n)=>{"use strict";n.d(t,{y:()=>z});var i=n(350979),l=n(769932),r=n(831868),s=n(549333),o=n(428089),a=n(605641),d=n(501823),u=n(941672),c=n(378385),p=n(955647),h=n(179087),m=n(857036),x=n(966983),v=n(796898),y=n(282304),f=n(575058),A=n(557423),g=n(249452),C=n(25963),b=n(735872),j=n(334804),w=n(3197),k=n(405213),R=n(970645),I=n(767385),E=n(53670),S=n(326848),T=n(118708),N=n(680797),U=n(102342),O=n(830640),M=n(842807),B=n(129166);let _=N.I4.div.withConfig({componentId:"sc-c3c100fb-0"})(["width:100%;background-color:",";text-align:center;"],e=>{let{theme:t}=e;return t.colors.backgroundAlt}),L=(0,N.I4)(x.Bs).withConfig({componentId:"sc-c3c100fb-1"})(["width:100%;min-width:320px;max-width:420px !important;min-height:calc(var(--vh,1vh) * 90);","{min-height:auto;}"],e=>{let{theme:t}=e;return t.mediaQueries.md}),P=(0,N.I4)(x.cw).withConfig({componentId:"sc-c3c100fb-2"})(["padding:24px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]);function Y(e){var t;let{onDismiss:n=()=>null,onCurrencySelect:r,selectedCurrency:s,otherSelectedCurrency:o,showCommonBases:a=!0,commonBasesType:d,showSearchInput:u,tokensToShow:c,chainId:p,showNative:N=!0,showMultichainBalances:Y=!1,enableMultichainSearch:q=!1}=e,[D,V]=(0,C.useState)(M.Yg.search),$=(0,C.useCallback)(e=>{null==n||n(),null==r||r(e)},[n,r]);!function(e){let{chainId:t}=(0,E.ax)(),n=e||t,[,i]=(0,j.pE)(),l=(0,S.useRouter)(),r=(0,C.useMemo)(()=>R.nt.some(e=>l.pathname.startsWith(e)),[l.pathname]),s=(0,j.gJ)(),o=(0,b.Nn)(n),a=(0,T.md)(b.Ys),d=(0,b.f6)(n);(0,C.useEffect)(()=>{s&&i((0,m.KA)())},[i,s]);let u=(0,m.jU)(i),c=(0,C.useMemo)(()=>Object.keys(o).sort(),[o]);(0,k.E)({queries:c.map(e=>{let t=a[e],n=!(null==t?void 0:t.current)&&!(null==t?void 0:t.loadingRequestId)&&!(null==t?void 0:t.error),i=r&&s;return{queryKey:["token-list",e],queryFn:()=>u(e).catch(t=>{throw console.debug("list fetching error",e,t),t}),retry:1,enabled:s&&(n||i),refetchInterval:!!i&&6e5,staleTime:6e5,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1}})}),(0,k.E)({queries:I.An.map(e=>{let t=a[e];return{queryKey:["token-list-unsupported",e],queryFn:()=>u(e).catch(t=>{throw console.debug("unsupported list fetching error",e,t),t}),retry:1,enabled:s&&!(null==t?void 0:t.current)&&!(null==t?void 0:t.loadingRequestId)&&!(null==t?void 0:t.error),refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1}})}),(0,C.useEffect)(()=>{s&&Object.keys(o).forEach(e=>{let t=o[e];if(t.current&&t.pendingUpdate)switch((0,w.NJ)(t.current.version,t.pendingUpdate.version)){case w.bD.NONE:throw Error("unexpected no version bump");case w.bD.PATCH:case w.bD.MINOR:case w.bD.MAJOR:i((0,m.CG)(e))}})},[i,o,d,s])}(p);let F=(0,h.Sz)(D),[W,z]=(0,C.useState)(),[H,Q]=(0,C.useState)(),[G,Z]=(0,C.useState)(),{t:X}=(0,l.A)(),[,J]=(0,j.pE)(),K=(0,b.mC)(),ee=!!(G&&(null==(t=K[G])?void 0:t.loadingRequestId)),et=(0,m.jU)(J),[en,ei]=(0,C.useState)(null),el=(0,C.useCallback)(()=>{!ee&&G&&(ei(null),et(G).then(()=>{J((0,m.c6)(G)),V(M.Yg.manage)}
1).catch(e=>{ei(e.message),J((0,m.tK)(G))}))},[ee,J,et,G]),er={[M.Yg.search]:{title:X("Select a Token"),onBack:void 0},[M.Yg.manage]:{title:X("Manage"),onBack:()=>V(M.Yg.search)},[M.Yg.importToken]:{title:X("Import Tokens"),onBack:()=>V(F&&F!==M.Yg.importToken?F:M.Yg.search)},[M.Yg.importList]:{title:X("Import List"),onBack:()=>V(M.Yg.search)}},{isMobile:es}=(0,v.A)(),eo=(0,C.useRef)(null),[ea,ed]=(0,C.useState)(void 0);(0,C.useEffect)(()=>{eo.current&&ed(eo.current.offsetHeight-300)},[]);let[eu,ec]=(0,C.useState)(null==s?void 0:s.chainId);return(0,i.jsxs)(L,{drag:!!es&&"y",dragConstraints:{top:0,bottom:600},dragElastic:{top:0},dragSnapToOrigin:!0,onDragStart:()=>{eo.current&&(eo.current.style.animation="none")},onDragEnd:(e,t)=>{t.velocity.y>y.G8&&n&&n()},ref:eo,children:[(0,i.jsxs)(x.rQ,{children:[(0,i.jsxs)(x.wt,{children:[er[D].onBack&&(0,i.jsx)(x.jR,{onBack:er[D].onBack}),(0,i.jsx)(f.A,{children:er[D].title})]}),(0,i.jsx)(x.s_,{onDismiss:n})]}),(0,i.jsxs)(P,{children:[D===M.Yg.search?(0,i.jsx)(B.A,{selectedChainId:p,setSelectedChainId:ec,onCurrencySelect:$,selectedCurrency:s,otherSelectedCurrency:o,showCommonBases:a,commonBasesType:d,showSearchInput:u,showImportView:()=>V(M.Yg.importToken),setImportToken:z,height:ea,tokensToShow:c,showNative:N,showMultichainBalances:Y,enableMultichainSearch:q}):D===M.Yg.importToken&&W?(0,i.jsx)(U.A,{tokens:[W],handleCurrencySelect:$,chainId:p}):D===M.Yg.importList&&H&&G?(0,i.jsx)(g.q,{onAddList:el,addError:en,listURL:G,listLogoURI:null==H?void 0:H.logoURI,listName:null==H?void 0:H.name,listTokenLength:null==H?void 0:H.tokens.length}):D===M.Yg.manage?(0,i.jsx)(O.A,{setModalView:V,setImportToken:e=>z(e),setImportList:Q,setListUrl:Z,chainId:p}):"",D===M.Yg.search&&(0,i.jsx)(_,{children:(0,i.jsx)(A.A,{scale:"sm",variant:"text",onClick:()=>V(M.Yg.manage),className:"list-token-manage-button",children:X("Manage Tokens")})})]})]})}var q=n(155018),D=n(427554),V=n(17581),$=n(320669),F=n(150103);let W=(0,N.Ay)(r.T).withConfig({componentId:"sc-80829266-0"})(["min-width:auto;"]),z=e=>{var t;let{onCurrencySelect:n,selectedCurrency:h,otherSelectedCurrency:m,showCommonBases:x,commonBasesType:v,hideBalance:y,chainId:f,tokensToShow:A,showNative:g,...C}=e,{address:b}=(0,V.F)(),j=(0,D.V)(!y&&h?h:void 0),{t:w}=(0,l.A)(),[k]=(0,s.A)((0,i.jsx)(Y,{tokensToShow:A,onCurrencySelect:n,selectedCurrency:h,otherSelectedCurrency:m,showCommonBases:x,commonBasesType:v,chainId:f,showNative:g})),R=(0,q.HW)(j&&h?h:void 0,Number(null==j?void 0:j.toExact()),{enabled:!!(null==j?void 0:j.greaterThan(0))});return(0,i.jsxs)(o.Ay,{width:"100%",...C,children:[(0,i.jsxs)(W,{p:0,onClick:k,children:[(0,i.jsx)(r.F,{justifyContent:"space-between",children:(0,i.jsx)(a.A,{id:"pair",color:h?void 0:"text",children:h?(0,i.jsxs)(d.A,{alignItems:"center",justifyContent:"space-between",children:[(0,i.jsx)(F.Zm,{currency:h,size:"24px",style:{marginRight:"8px"},showChainLogo:!0}),(0,i.jsx)(a.A,{id:"pair",bold:!0,ellipsis:!0,pr:"16px",children:h&&h.symbol&&h.symbol.length>20?`${h.symbol.slice(0,4)}...${h.symbol.slice(h.symbol.length-5,h.symbol.length)}`:null==h?void 0:h.symbol})]}):(0,i.jsx)(i.Fragment,{children:w("Select")})})}),(0,i.jsx)(u.A,{color:"text",className:"down-icon"})]}),b&&!!h&&!y&&(0,i.jsxs)(o.Ay,{children:[(0,i.jsxs)($.eF,{justify:"space-between",gap:"2px",children:[(0,i.jsxs)(a.A,{color:"textSubtle",fontSize:"12px",children:[w("Balance"),":"]}),(0,i.jsx)(a.A,{fontSize:"12px",children:null!=(t=(0,p.ej)(j,6))?t:w("Loading")})]}),(0,i.jsxs)($.JA,{children:[(0,i.jsx)("div",{}),R&&Number.isFinite(R)&&(0,i.jsxs)(a.A,{fontSize:"12px",color:"textSubtle",children:["~$",(0,c.ZV)(R)]})]})]})]})}},927122:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(350979),l=n(680797),r=n(554945),s=n(814795);let o=(0,l.I4)(s.A).withConfig({componentId:"sc-c1354ddc-0"})(["display:flex;justify-content:center;align-items:center;"]),a=()=>(0,i.jsx)(o,{children:(0,i.jsx)(r.A,{})})},984566:(e,t,n)=>{"use strict";n.d(t,{w:()=>i});let i=(0,n(985148).eU)(null)}},e=>{e.O(0,[3821,5139,7578,3732,4306,4374,3892,2845,7121,7061,9596,2141,8516,5958,7585,7212,1480,6335,4711,9818,7635,64,8269,6283,5018,9508,4712,7287,8686,8837,6010,4522,4586,2269,770,1729,3189,3527,8528,8157,636,6593,8792],()=>e(e.s=755677)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.