PageSourceSearch

https://pancakeswap.finance/_next/static/chunks/pages/liquidity/position/[[...positionId]]-f9ffa2ef3a7081a9.js

js pancakeswap.finance collected 2026-10-01 10:14:09 UTC 88,056 bytes, 3 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="55eae9c5-d3f0-42e1-89df-049c57aea3f5",e._sentryDebugIdIdentifier="sentry-dbid-55eae9c5-d3f0-42e1-89df-049c57aea3f5")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7379],{30596:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>a});var i=t(350979),l=t(876089),r=t(2828),o=t(764289),s=t.n(o);let d=()=>(0,i.jsx)(l.A,{LinkComp:s(),children:(0,i.jsx)(r.bV,{title:"404"})});d.chains=[];let a=d},149160:(e,n,t)=>{"use strict";t.d(n,{A:()=>c});var i=t(350979),l=t(769932),r=t(557423),o=t(501823),s=t(605641),d=t(498938);let a=(0,t(680797).I4)(r.A).withConfig({componentId:"sc-bb7aac7a-0"})(["border-radius:8px;padding-left:4px;padding-right:4px;"]);function c(e){let{currencyA:n,handleRateToggle:t}=e,{t:r}=(0,l.A)();return n?(0,i.jsxs)(o.A,{justifyContent:"center",alignItems:"center",children:[(0,i.jsx)(s.A,{mr:"4px",color:"textSubtle",children:r("View prices in")}),(0,i.jsx)(a,{variant:"secondary",scale:"sm",onClick:t,startIcon:(0,i.jsx)(d.A,{color:"primary"}),children:null==n?void 0:n.symbol})]}):null}},245009:(e,n,t)=>{"use strict";t.d(n,{A:()=>u});var i=t(350979),l=t(25963),r=t(680797),o=t(913688),s=t(619005);let d=r.I4.div.withConfig({componentId:"sc-740b37a2-0"})(["align-items:center;color:",";display:flex;justify-content:center;padding-left:4px;padding-right:4px;","{padding-left:8px;padding-right:8px;}","{padding-left:16px;padding-right:16px;}"],e=>{let{theme:n}=e;return n.colors.textDisabled},e=>{let{theme:n}=e;return n.mediaQueries.sm},e=>{let{theme:n}=e;return n.mediaQueries.md}),a=r.I4.ul.withConfig({componentId:"sc-740b37a2-1"})(["align-items:center;display:flex;flex-wrap:wrap;list-style-type:none;a{color:",";&:hover{color:",";}}",""],e=>{let{theme:n}=e;return n.colors.primary},e=>{let{theme:n}=e;return n.colors.primaryBright},o.xe),c=(0,i.jsx)(s.A,{color:"currentColor",width:"24px"}),u=(0,l.forwardRef)((e,n)=>{let t,{separator:r=c,children:o}=e,s=(t=l.Children.toArray(o).filter(e=>(0,l.isValidElement)(e)),t.reduce((e,n,t)=>(t>0&&e.push((0,i.jsx)(d,{"aria-hidden":!0,children:r},`separator-${t}`)),e.push(n),e),[]));return(0,i.jsx)(a,{ref:n,children:s.map((e,n)=>(0,i.jsx)("li",{children:e},`child-${n}`))})})},504304:(e,n,t)=>{"use strict";t.d(n,{E:()=>u});var i=t(350979),l=t(769932),r=t(579518),o=t(605641),s=t(575058),d=t(266283),a=t(810286);let c={textDecoration:"underline dotted",textUnderlineOffset:"0.1em",cursor:"help"},u=e=>{var n,t;let{title:u,currency0:x,currency1:p,price:m,rawPrice:h,...j}=e,{t:y}=(0,l.A)(),f=(0,a.$Y)({mode:"price",price:h}),{targetRef:g,tooltip:A,tooltipVisible:v}=(0,r.A)(f,{placement:"top"});return(0,i.jsxs)(d.k0,{...j,style:{paddingTop:"8px",paddingBottom:"8px",textAlign:"center"},children:[(0,i.jsx)(o.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",mb:"4px",children:u}),f?(0,i.jsxs)(i.Fragment,{children:[v&&A,(0,i.jsx)(s.A,{mb:"4px",ref:g,style:c,children:m})]}):(0,i.jsx)(s.A,{mb:"4px",children:m}),(0,i.jsx)(o.A,{fontSize:"12px",color:"textSubtle",children:y("%assetA% per %assetB%",{assetA:null!=(n=null==x?void 0:x.symbol)?n:"",assetB:null!=(t=null==p?void 0:p.symbol)?t:""})})]})}},536881:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/liquidity/position/[[...positionId]]",function(){return t(821771)}])},561213:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var i=t(350979),l=t(428089);let r=e=>{let{children:n,...t}=e;return(0,i.jsx)(l.Ay,{px:["16px","24px"],mx:"auto",maxWidth:"1200px",...t,children:n})}},609104:(e,n,t)=>{"use strict";t.d(n,{l:()=>v});var i=t(350979),l=t(769932),r=t(421770),o=t(579518),s=t(889948),d=t(673115),a=t(796147),c=t(24153),u=t(605641),x=t(557423),p=t(501823),m=t(226464),h=t(898719),j=t(266283),y=t(303728),f=t(427548);function g(e){let{tokenAmount:n}=e,{t}
1=(0,l.A)(),{tooltip:r,tooltipVisible:d,targetRef:a}=(0,o.A)(t("Combined number of rewards in %symbol% from ALL your positions which are eligible for Merkl rewards.",{symbol:n.currency.symbol}),{placement:"top",trigger:"hover"});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.A,{ref:a,small:!0,children:n.toSignificant(6)}),d&&r]})}let A=()=>{let{t:e}=(0,l.A)();return(0,i.jsx)(d.A,{color:"currentColor",fontSize:"md",external:!0,style:{display:"inline-flex"},href:"https://docs.merkl.xyz/",children:e("Learn more about Merkl")})};function v(e){let{poolAddress:n,poolProtocol:t,chainId:o,notEnoughLiquidity:s,outRange:v,disabled:b}=e,{t:w}=(0,l.A)(),{claimTokenReward:I,isClaiming:k,rewardsPerToken:C,hasMerkl:S}=(0,f.Ay)(n),T=(0,y.Y)({hasMerkl:S,chainId:o,lpAddress:n,poolProtocol:t});return!C.length||!S&&C.every(e=>e.equalTo("0"))?null:(0,i.jsxs)(a.VP,{justifyContent:"space-between",gap:"8px",width:"100%",children:[(0,i.jsxs)(c.eF,{justifyContent:"space-between",children:[(0,i.jsx)(u.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:w("Merkl Rewards")}),(0,i.jsx)(x.A,{disabled:b||k||C.every(e=>e.equalTo("0")),scale:"sm",onClick:I,children:w(k?"Claiming...":"Claim")})]}),(0,i.jsx)(j.k0,{mr:"4px",padding:"16px 8px",children:C.map(e=>(0,i.jsxs)(c.eF,{justifyContent:"space-between",children:[(0,i.jsxs)(p.A,{children:[(0,i.jsx)(h.Z,{currency:e.currency}),(0,i.jsx)(u.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:e.currency.symbol})]}),(0,i.jsx)(p.A,{justifyContent:"center",children:(0,i.jsx)(g,{tokenAmount:e})})]}))}),v?(0,i.jsx)(m.A,{variant:"warning",children:(0,i.jsxs)(m.J,{color:"textSubtle",children:[w("This Merkl campaign is NOT rewarding out-of-range liquidity. To earn rewards, adjust your position."),(0,i.jsx)("br",{}),(0,i.jsx)(A,{})]})}):S?(0,i.jsx)(m.A,{variant:s?"warning":"primary",children:(0,i.jsxs)(m.J,{color:s?"textSubtle":"",children:[(0,i.jsx)(r.x,{i18nKey:s?"This liquidity position will NOT earn any rewards on Merkl due to its total USD value being less than $20. Details <0>here</0>":"This liquidity position is currently earning rewards on Merkl. Details <0>here</0>",components:[(0,i.jsx)(d.A,{fontSize:"md",external:!0,color:"currentColor",style:{display:"inline-flex"},href:null!=T?T:"https://merkl.angle.money/?search=PancakeSwap&status=live%2Csoon"})]}),(0,i.jsx)("br",{}),(0,i.jsx)(A,{})]})}):null]})}},791163:(e,n,t)=>{"use strict";t.d(n,{A:()=>D});var i=t(350979),l=t(769932),r=t(311560),o=t(3197),s=t(557423),d=t(549333),a=t(501823),c=t(990296),u=t(605641),x=t(941672),p=t(490233),m=t(546061),h=t(428089),j=t(38395),y=t(420248),f=t(40064),g=t(25963),A=t(680797),v=t(733775),b=t(378385),w=t(687287),I=t(810286),k=t(155018),C=t(432594),S=t(569019),T=t(228876),B=t(72912),M=t(532537),P=t(53670),q=t(48099),F=t(115843);let z=A.I4.div.withConfig({componentId:"sc-401c5d88-0"})(["display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-end;padding:",";"],e=>{let{selected:n}=e;return n?"0.75rem 0.5rem 0.75rem 1rem":"0.75rem 0.75rem 0.75rem 1rem"}),R=(0,A.I4)(s.A).attrs({variant:"text",scale:"sm"}).withConfig({componentId:"sc-401c5d88-1"})(["padding:0px;"]),D=(0,g.memo)(function(e){var n;let{value:t,onUserInput:A,onInputBlur:D,onPercentInput:E,onMax:$,showQuickInputButton:N=!1,showMaxButton:L,maxAmount:Z,lpPercent:O,label:W,onCurrencySelect:V,currency:U,disableCurrencySelect:X=!1,hideBalance:G=!1,beforeButton:Q,pair:_=null,otherCurrency:K,id:Y,showCommonBases:H,commonBasesType:J,showSearchInput:ee,disabled:en,error:et,showUSDPrice:ei,tokensToShow:el,currencyLoading:er,inputLoading:eo,title:es,hideBalanceComp:ed}=e,{account:ea,solanaAccount:ec}=(0,P.W7)(),eu=(0,S.rL)(null!=ea?ea:void 0,(0,T.F8)(null==U?void 0:U.chainId)&&null!=U?U:void 0),{balance:ex}=(0,M.pd)(ec,(0,T.fT)(null==U?void 0:U.chainId)?null==U?void 0:U.wrapped.address:void 0),ep=(0,g.useMemo)(()=>U?(0,T.F8)(U.chainId)?eu:r.C3.fromRawAmount(U,ex.toString()):void 0,[U,eu,ex]),em=(0,g.useMemo)(()=>(0,T.F8)(null==U?void 0:U.chainId)?!!ea:!!ec,[null==U?void 0:U.chainId,ea,ec]),{t:eh}=(0,l.A)(),ej=_?_.liquidityToken:(null==U?void 0:U.isToken)?U:null,ey=ej?(0,v.QR)(ej.address):null,ef=(0,k.h1)(ei&&null!=U?U:void 0,(0,T.F8)(null==U?void 0:U.chainId)&&void 0!==t&&Number.isFinite(+t)?+t:void 0),eg=(0,B.KL)({mint:null==U?void 0:U.wrapped.address,enabled:ei&&(0,T.fT)(null==U?void 0:U.chainId),amount:void 0!==t&&Number.isFinite(+t)?+t:void 0}),eA=(0,T.F8)(null==U?void 0:U.chainId)?ef:eg,[ev]=(0,d.A)((0,i.jsx)(F.A,{onCurrencySelect:V,selectedCurrency:U,otherSelectedCurrency:K,showCommonBases:H,commonBasesType:J,showSearchInput:ee,tokensToShow:el,mode:Y})),eb=(0,g.useMemo)(()=>({25:Z?Z.multiply(new r.QE(25,100)).toExact():void 0,50:Z?Z.multiply(new r.QE(50,100)).toExact():void 0,75:Z?Z.multiply(new r.QE(75,100)).toExact():void 0}),[Z]),ew=(0,g.useCallback)(e=>{A(e)},[A]),eI=(0,g.useCallback)(()=>{X||ev()},[ev,X]),ek=Z&&t===Z.toExact()||O&&"100"===O,eC=(0,w.wG)(U),eS=!G&&U?eC(ep,6):void 0,eT=!G&&U?null==ep?void 0:ep.toExact():void 0;return(0,i.jsx)(f._z.E3,{id:Y,disabled:en,error:et,value:t,onInputBlur:D,onUserInput:ew,loading:eo,top:(0,i.jsxs)(i.Fragment,{children:[es,(0,i.jsxs)(a.A,{alignItems:"center",children:[Q,(0,i.jsx)(R,{className:"open-currency-select-button","data-dd-action-name":"Select currency",selected:!!U,onClick:eI,children:(0,i.jsxs)(a.A,{alignItems:"center",justifyContent:"space-between",children:[_?(0,i.jsx)(y.g,{currency0:_.token0,currency1:_.token1,size:16,margin:!0}
1):U?"onramp-input"===Y?(0,i.jsx)(C.mt,{currency:U,size:"24px",style:{marginRight:"8px"}}):(0,i.jsx)(j.Z,{currency:U,size:"24px",style:{marginRight:"8px"}}):er?(0,i.jsx)(c.Ay,{width:"24px",height:"24px",variant:"circle"}):null,er?null:_?(0,i.jsxs)(u.A,{id:"pair",bold:!0,children:[null==_?void 0:_.token0.symbol,":",null==_?void 0:_.token1.symbol]}):(0,i.jsx)(u.A,{id:"pair",bold:!0,children:(U&&U.symbol&&U.symbol.length>10?`${U.symbol.slice(0,4)}...${U.symbol.slice(U.symbol.length-5,U.symbol.length)}`:null==U?void 0:U.symbol)||eh("Select a currency")}),!er&&!X&&(0,i.jsx)(x.A,{})]})}),ej&&ey?(0,i.jsxs)(a.A,{style:{gap:"4px"},ml:"4px",alignItems:"center",children:[(0,i.jsx)(p.i,{"data-dd-action-name":"Copy token address",width:"16px",buttonColor:"textSubtle",text:ey,tooltipMessage:eh("Token address copied")}),(0,i.jsx)(q.A,{"data-dd-action-name":"Add to wallet",variant:"text",p:"0",height:"auto",width:"fit-content",tokenAddress:ey,tokenSymbol:ej.symbol,tokenDecimals:ej.decimals,tokenLogo:ej instanceof o.Xs?ej.logoURI:void 0})]}):null]}),em&&!ed&&(0,i.jsx)(I.g3,{currency:null!=U?U:void 0,rawDisplay:eT,"data-dd-action-name":"Token balance",onClick:en?void 0:$,color:"textSubtle",fontSize:"12px",ellipsis:!0,title:!G&&U?eh("Balance: %balance%",{balance:null!=eS?eS:eh("Loading")}):" -",style:{display:"inline",cursor:"pointer"},children:!G&&U?((null==eS||null==(n=eS.replace(".",""))?void 0:n.length)||0)>12?eS:eh("Balance: %balance%",{balance:null!=eS?eS:eh("Loading")}):" -"})]}),bottom:(0,i.jsxs)(i.Fragment,{children:[!!ei&&(0,i.jsx)(a.A,{justifyContent:"flex-end",mr:"1rem",children:(0,i.jsx)(a.A,{maxWidth:"200px",children:eo?(0,i.jsx)(m.A,{width:"14px",height:"14px"}):ei&&Number.isFinite(eA)?(0,i.jsx)(u.A,{fontSize:"12px",color:"textSubtle",ellipsis:!0,children:`~${eA?(0,b.ZV)(eA):0} USD`}):(0,i.jsx)(h.Ay,{height:"18px"})})}),(0,i.jsx)(z,{selected:X,children:em&&U&&(null==ep?void 0:ep.greaterThan(0))&&!en&&"To"!==W&&(0,i.jsxs)(a.A,{alignItems:"right",justifyContent:"right",children:[(null==Z?void 0:Z.greaterThan(0))&&N&&E&&[25,50,75].map(e=>{let n=Z&&"0"!==t&&t===eb[e]||O&&O===e.toString();return(0,i.jsxs)(s.A,{"data-dd-action-name":`Balance percent ${e}`,onClick:()=>{E(e)},scale:"xs",mr:"5px",variant:n?"primary":"secondary",style:{textTransform:"uppercase"},children:[e,"%"]},`btn_quickCurrency${e}`)}),(null==Z?void 0:Z.greaterThan(0))&&L&&(0,i.jsx)(s.A,{"data-dd-action-name":"Balance percent max",onClick:e=>{e.stopPropagation(),e.preventDefault(),null==$||$()},scale:"xs",variant:ek?"primary":"secondary",style:{textTransform:"uppercase"},children:eh("Max.fill-max")})]})})]})})})},821771:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>tN});var i=t(350979),l=t(659197),r=t(428089),o=t(927122),s=t(773465),d=t(627817),a=t(91553),c=t(326848),u=t(25963);let x=()=>{let{data:e,error:n}=(0,a.Lu)(s.SS.routeParams),t=(0,u.useMemo)(()=>e&&e.positionId?e.positionId[0]:null,[e]),i=(0,u.useMemo)(()=>e&&e.positionId?e.positionId[2]:null,[e]);return{routeParams:e,routeError:n,protocol:t,action:i}},p=()=>{let{routeParams:e}=x(),n=(0,c.useRouter)(),t=(0,u.useMemo)(()=>{if(!e||!e.positionId||e.positionId[0]!==l.Zs.InfinityBIN)return null;let[n,t,i]=e.positionId;return{protocol:n,poolId:t,action:i}},[e]),i=(0,u.useCallback)(e=>{var i,l,r,o;if(!t||!Object.values(t).every(e=>void 0!==e))return;let s=(0,d.g)({route:n.route,routeParams:{positionId:t.action?[null!=(i=e.protocol)?i:t.protocol,null!=(l=e.poolId)?l:t.poolId,t.action]:[null!=(r=e.protocol)?r:t.protocol,null!=(o=e.poolId)?o:t.poolId]}});n.replace({pathname:s,query:n.query},void 0,{shallow:!0})},[t,n]);return{...t,updateParams:i}},m=()=>{let{routeParams:e}=x(),n=(0,c.useRouter)(),t=(0,u.useMemo)(()=>{if(!e||!e.positionId||e.positionId[0]!==l.Zs.InfinityCLAMM)return null;let[n,t,i]=e.positionId;return{protocol:n,tokenId:t,action:i}},[e]),i=(0,u.useCallback)(e=>{var i,l,r,o;if(!t||!Object.values(t).every(e=>void 0!==e))return;let s=(0,d.g)({route:n.route,routeParams:{positionId:t.action?[null!=(i=e.protocol)?i:t.protocol,null!=(l=e.tokenId)?l:t.tokenId,t.action]:[null!=(r=e.protocol)?r:t.protocol,null!=(o=e.tokenId)?o:t.tokenId]}});n.replace({pathname:s,query:n.query},void 0,{shallow:!0})},[t,n]);return{...t,updateParams:i}},h=()=>
1{let{routeParams:e}=x(),n=(0,c.useRouter)(),t=(0,u.useMemo)(()=>{if(!e||!e.positionId||e.positionId[0]!==l.Zs.V3||"solana"!==e.positionId[1])return null;let[n,,t,i]=e.positionId;return{protocol:n,poolId:t,mintId:i}},[e]),i=(0,u.useCallback)(e=>{var i,l,r;if(!t||!Object.values(t).every(e=>void 0!==e))return;let o=(0,d.g)({route:n.route,routeParams:{positionId:[null!=(i=e.protocol)?i:t.protocol,"solana",null!=(l=e.poolId)?l:t.poolId,null!=(r=e.mintId)?r:t.mintId]}});n.replace({pathname:o,query:n.query},void 0,{shallow:!0})},[t,n]);return{...t,updateParams:i}};var j=t(87242),y=t.n(j),f=t(30596),g=t(18468),A=t(769932),v=t(807543),b=t(672946),w=t(554945),I=t(485909),k=t(561213),C=t(605641),S=t(150591),T=t(501823),B=t(995315),M=t(24153),P=t(796259),q=t(823585),F=t(38395),z=t(82029),R=t(266283),D=t(791163),E=t(747292),$=t(504304),N=t(114041),L=t(610564),Z=t(981830),O=t(54753),W=t(293765),V=t(687287),U=t(810286),X=t(131619),G=t(262453),Q=t(748520),_=t(52451),K=t(155018),Y=t(829715),H=t(437862),J=t(680797),ee=t(207014),en=t(909725),et=t(835490),ei=t(732170),el=t(850611),er=t(918279),eo=t(150103);J.I4.div.withConfig({componentId:"sc-72f1e92-0"})(["border-radius:16px;border:1px solid ",";background:",";display:flex;flex-direction:column;gap:10px;padding:16px;"],e=>{let{theme:n}=e;return n.colors.cardBorder},e=>{let{theme:n}=e;return n.colors.background}),t(450253),J.I4.div.withConfig({componentId:"sc-f0c4e5b7-0"})(["display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;"]),J.I4.div.withConfig({componentId:"sc-f0c4e5b7-1"})(["display:contents;font-weight:bold;color:",";text-transform:uppercase;"],e=>{let{theme:n}=e;return n.colors.secondary}),J.I4.div.withConfig({componentId:"sc-f0c4e5b7-2"})(["display:contents;font-weight:bold;text-transform:uppercase;"]),J.I4.div.withConfig({componentId:"sc-f0c4e5b7-3"})(["padding:10px 0;text-align:center;vertical-align:middle;"]),J.I4.div.withConfig({componentId:"sc-f0c4e5b7-4"})(["padding:10px 0;text-align:center;"]),J.I4.div.withConfig({componentId:"sc-f0c4e5b7-5"})(["padding:24px;border-top:2px solid ",";overflow:hidden;"],e=>{let{theme:n}=e;return n.colors.cardBorder});var es=t(796898),ed=t(979332),ea=t(893001),ec=t(796147),eu=t(131),ex=t(420248),ep=t(737982),em=t(573271),eh=t(20897),ej=t(784027),ey=t(810498),ef=t(876579);let eg=(0,J.I4)(B.A).withConfig({componentId:"sc-19b245de-0"})(["flex-direction:column;justify-content:flex-start;align-items:flex-start;width:100%;"]),eA=J.I4.div.withConfig({componentId:"sc-19b245de-1"})(["display:flex;gap:8px;font-size:16px;font-weight:600;flex-direction:",";margin-top:4px;"],e=>{let{$isMobile:n}=e;return n?"column":"row"}),ev=e=>{let{currency0:n,currency1:t,tokenId:l,chainId:o,protocol:s,feeTier:d,feeTierBase:a=1e6,isFarming:c=!1,isRemoved:u=!1,isOutOfRange:x=!1,hookData:p,dynamic:m,poolId:h,showPoolFeature:j=!0,size:y="lg",displayLabelOnMobile:f=!0,displayGlobalSettings:g=!1}=e,{t:v}=(0,A.A)(),b=o?(0,ef.Y6)(o):void 0,{isMobile:w}=(0,es.A)(),I=f&&w;return(0,i.jsxs)(eg,{gap:"16px",alignItems:"center",children:[(0,i.jsxs)(B.A,{gap:"12px",columnGap:"12px",style:{width:"100%"},children:[n&&t&&"lg"===y?(0,i.jsx)(T.A,{justifyContent:"center",flexDirection:"column",width:48,children:(0,i.jsx)(eh.hm,{width:48,height:48,variant:"inverted",primaryToken:n,secondaryToken:t.wrapped})}):null,(0,i.jsxs)(T.A,{flexDirection:"column",width:"100%",children:[(0,i.jsxs)(B.A,{gap:"8px",alignItems:"center",children:[n&&t&&"sm"===y?(0,i.jsx)(ex.g,{currency0:n,currency1:t,size:24,innerMargin:"-8px"}):null,(0,i.jsx)(r.Ay,{width:"100%",ml:"8px",children:g?(0,i.jsx)(M.eF,{justifyContent:"space-between",alignItems:"center",flexWrap:"nowrap",children:(0,i.jsxs)(r.Ay,{children:[(0,i.jsx)(C.A,{as:"span",bold:!0,fontSize:"20px",children:`${null==n?void 0:n.symbol} / ${null==t?void 0:t.symbol}`}),l?(0,i.jsxs)(C.A,{as:"span",color:"textSubtle",fontSize:["16px",null,null,"20px"],ml:"4px",children:["#",l.toString()]}):null]})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.A,{as:"span",bold:!0,fontSize:"20px",mr:"4px",children:`${null==n?void 0:n.symbol} / ${null==t?void 0:t.symbol}`}),I?(0,i.jsx)("br",{}):null,l?(0,i.jsxs)(C.A,{as:"span",color:"textSubtle",fontSize:["16px",null,null,"20p
1x"],children:["#",l.toString()]}):null]})})]}),I?null:(0,i.jsxs)(eA,{children:[c&&(0,i.jsx)(ed.A,{variant:"primary60",scale:"sm",children:v("Farming")}),(0,i.jsx)(em.K,{scale:"sm",lowContrast:!0,removed:u,outOfRange:x,protocol:s}),(0,ey.T)(s)?(0,i.jsx)(ep.Eu,{poolId:h,chainId:o,hookData:p}):s&&d?(0,i.jsx)(ea.T,{type:s,fee:d,dynamic:m,denominator:a}):null,(0,i.jsxs)(B.A,{gap:"3px",alignItems:"center",children:[(0,i.jsx)(eu.P,{chainId:o,width:18,mt:"2px"}),(0,i.jsx)(C.A,{color:"textSubtle",textTransform:"uppercase",small:!0,bold:!0,style:{whiteSpace:"nowrap"},children:b?(0,ej.R)(b):null})]})]})]})]}),I?(0,i.jsxs)(B.A,{gap:"8px",flexWrap:"wrap",children:[(0,i.jsxs)(ec.mm,{gap:"4px",children:[(0,i.jsx)(C.A,{fontSize:12,color:"textSubtle",textTransform:"uppercase",bold:!0,children:v("status")}),(0,i.jsxs)(B.A,{gap:"3px",alignItems:"center",children:[(0,i.jsx)(em.K,{scale:"sm",lowContrast:!0,removed:u,outOfRange:x,protocol:s}),c?(0,i.jsx)(ed.A,{variant:"primary60",scale:"sm",mr:"8px",children:v("Farming")}):null]})]}),(0,i.jsxs)(ec.mm,{gap:"4px",children:[(0,i.jsx)(C.A,{fontSize:12,color:"textSubtle",textTransform:"uppercase",bold:!0,children:v("fee tier")}),(0,ey.T)(s)?(0,i.jsx)(ep.Eu,{poolId:h,chainId:o,hookData:p}):s&&d?(0,i.jsx)(ea.T,{type:s,fee:d,dynamic:m,denominator:a}):null]}),(0,i.jsxs)(ec.mm,{gap:"4px",children:[(0,i.jsx)(C.A,{fontSize:12,color:"textSubtle",textTransform:"uppercase",bold:!0,children:v("network")}),(0,i.jsxs)(B.A,{gap:"3px",alignItems:"center",children:[(0,i.jsx)(eu.P,{chainId:o,width:18,mt:"2px"}),(0,i.jsx)(C.A,{color:"textSubtle",textTransform:"uppercase",fontSize:12,bold:!0,children:b?(0,ej.R)(b):null})]})]})]}):null,j&&(0,i.jsx)(B.A,{gap:"16px",children:(0,i.jsx)(z.PoolFeaturesBadge,{poolType:s,hookData:p,fold:!1,labelTextProps:{bold:!0}})})]})};J.I4.div.withConfig({componentId:"sc-d347024f-0"})(["border-radius:16px;border:1px solid ",";background:",";display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:16px;"],e=>{let{theme:n}=e;return n.colors.cardBorder},e=>{let{theme:n}=e;return n.colors.background});var eb=t(862373),ew=t(457258),eI=t(475301),ek=t(178852),eC=t(245009),eS=t(682803),eT=t(843235),eB=t(764289),eM=t.n(eB);let eP=e=>{let{currency0:n,currency1:t,children:r}=e,{t:o}=(0,A.A)(),{routeParams:s,protocol:a}=x(),p=(0,c.useRouter)(),m=(0,u.useRef)(null),h=(0,u.useMemo)(()=>s&&s.positionId&&a&&[l.Zs.InfinityBIN,l.Zs.InfinityCLAMM].includes(a)?(0,d.g)({route:p.route,routeParams:{positionId:(l.Zs.InfinityBIN,[a,null==s?void 0:s.positionId[1]])}}):"",[a,s,p.route]),j=(0,u.useMemo)(()=>{if(!m.current)return!1;let{clientHeight:e}=m.current;return 2*parseInt(window.getComputedStyle(m.current).lineHeight.replace("px",""))<e},[m.current]);return(0,i.jsxs)(eC.A,{ref:m,children:[(0,i.jsx)(eM(),{href:"/liquidity/pools",children:o("Farm")}),j?(0,i.jsx)(eS.A,{items:[{label:`${null==n?void 0:n.symbol} / ${null==t?void 0:t.symbol}`,href:h}],children:(0,i.jsx)(eT.A,{children:(0,i.jsx)(C.A,{color:"primary",children:"..."})})}):(0,i.jsx)(eM(),{href:h,children:`${null==n?void 0:n.symbol} / ${null==t?void 0:t.symbol}`}),r]})};var eq=t(53670),eF=t(265394),ez=t(745332),eR=t(512165);let eD=(0,J.Ay)(v.A).withConfig({componentId:"sc-41146778-0"})(["width:100%;max-width:440px;"]),eE=()=>{var e,n,t,o,s,d;let{t:a,currentLanguage:{locale:c}}=(0,A.A)(),{account:x,chainId:p,isWrongNetwork:h}=(0,eq.W7)(),{tokenId:j}=m(),{position:y}=(0,Z.a)(j,p),{token0:f,token1:g,fee:v,dynamic:J,liquidity:eo,tickLower:es,tickUpper:ed}=y||{},ea=(0,X.G5)(f,p),ec=(0,X.G5)(g,p),{priceLower:eu,priceUpper:ex,base:ep,quote:em,pool:eh,poolId:ej}=(0,H.RI)(y),ey=(0,ew.R4)(p,ej),ef=(0,eI.j)({dynamic:J,lpFee:v,hookData:ey}),eg=(0,u.useMemo)(()=>!!eh&&void 0!==es&&void 0!==ed&&(eh.tickCurrent<es||eh.tickCurrent>ed),[eh,es,ed]),[eA,eC]=(0,u.useState)(!1),{priceLower:eS,priceUpper:eT,base:eB}=(e=>{let{priceLower:n,priceUpper:t,quote:i,base:l,invert:r}=e;return{priceUpper:r?null==n?void 0:n.invert():t,priceLower:r?null==t?void 0:t.invert():n,quote:r?l:i,base:r?i:l}})({priceLower:eu,priceUpper:ex,quote:em,base:ep,invert:eA}
1),{amount0:eM,amount1:eE,deposit0Disabled:e$,deposit1Disabled:eN,invalidRange:eL}=(0,W.h)({token0:ea,token1:ec,tickCurrent:null==eh?void 0:eh.tickCurrent,tickLower:es,tickUpper:ed,sqrtRatioX96:null==eh?void 0:eh.sqrtRatioX96,liquidity:eo}),eZ=(0,V.wG)(ea),eO=(0,V.wG)(ec),eW=(0,K.r0)(ea,{enabled:!!(null==eM?void 0:eM.greaterThan(0))}),eV=(0,K.r0)(ec,{enabled:!!(null==eE?void 0:eE.greaterThan(0))}),eU=ec&&eB?eB.equals(ec):void 0,eX=eU?ea:ec,eG=eU?ec:ea,eQ=eh?eU?eh.token1Price:eh.token0Price:void 0,e_=(0,V.xm)(eS),eK=(0,V.xm)(eT),eY=(0,V.xm)(eQ),eH=(0,O.A)(es,ed,null==eh?void 0:eh.tickSpacing),eJ=(null==ea?void 0:ea.isNative)?ei.Xd:null!=(e=null==ea?void 0:ea.address)?e:ei.Xd,e0=(null==ec?void 0:ec.isNative)?ei.Xd:null!=(n=null==ec?void 0:ec.address)?n:ei.Xd,{inputAmountRaw:e1,outputAmountRaw:e2,inputBalance:e4,outputBalance:e8,onInputAmountChange:e6,onOutputAmountChange:e3,onInputPercentChange:e5,onOutputPercentChange:e7,inputAmount:e9,outputAmount:ne,lastEditCurrency:nn}=(0,eR.o)({currency0:ea,currency1:ec,poolKey:null==y?void 0:y.poolKey,tickLower:es,tickUpper:ed,outOfRange:eg,invalidRange:eL}),nt=(0,u.useMemo)(()=>({[et.O9.CURRENCY_A]:e9,[et.O9.CURRENCY_B]:ne}),[e9,ne]),{errorMessage:ni}=(0,ez.P)({currencyA:ea,currencyB:ec,currencyAAmount:e9,currencyBAmount:ne,allowSingleSide:e$!==eN}),nl=!(eL||ni),[nr]=(0,eb.uZ)()||[eb.C0],{addCLLiquidity:no,attemptingTx:ns}=(0,L.K)(null!=p?p:0,null!=x?x:ei.Xd,eJ,e0),nd=(0,_.PJ)(),{requirePermit:na,requireApprove:nc,permit2Allowance:nu,isApproving:nx,permit:np,revoke:nm,approve:nh}=(0,Q.$)((null==ea?void 0:ea.isNative)||null==e9?void 0:e9.wrapped,(null==eh?void 0:eh.poolType)?(0,ee.B4)(eh.poolType,p):void 0,{overrideChainId:p}),nj=(0,u.useMemo)(()=>nx?G.h$.PENDING:nc?G.h$.NOT_APPROVED:G.h$.APPROVED,[nx,nc]),{requirePermit:ny,requireApprove:nf,permit2Allowance:ng,isApproving:nA,permit:nv,revoke:nb,approve:nw}=(0,Q.$)((null==ec?void 0:ec.isNative)||null==ne?void 0:ne.wrapped,(null==eh?void 0:eh.poolType)?(0,ee.B4)(eh.poolType,p):void 0,{overrideChainId:p}),nI=(0,u.useMemo)(()=>nA?G.h$.PENDING:nf?G.h$.NOT_APPROVED:G.h$.APPROVED,[nA,nf]),nk=(0,u.useCallback)(async()=>{var e,n;let t,i;if(!y||!j||!eh||!ea||!ec||!x||e$&&(null==e9?void 0:e9.greaterThan(0))||eN&&(null==ne?void 0:ne.greaterThan(0))||(null==e9?void 0:e9.equalTo(0))&&(null==ne?void 0:ne.equalTo(0)))return;try{(null==ea?void 0:ea.isNative)||!na||(t=await np()),(null==ec?void 0:ec.isNative)||!ny||(i=await nv())}catch(e){if(nd(e))return;throw e}let[,l]=e9?(0,ek.wQ)(e9,nr):[0n,el.iB],[,r]=ne?(0,ek.wQ)(ne,nr):[0n,el.iB];await no({tokenId:BigInt(j),currency0:ea,currency1:ec,lastEditCurrency:nn,poolKey:y.poolKey,tickLower:y.tickLower,tickUpper:y.tickUpper,sqrtPriceX96:eh.sqrtRatioX96,amount0Desired:null!=(e=null==e9?void 0:e9.quotient)?e:0n,amount1Desired:null!=(n=null==ne?void 0:ne.quotient)?n:0n,recipient:x,amount0Max:l,amount1Max:r,deadline:BigInt(Math.floor(Date.now()/1e3)+1200),token0Permit2Signature:t,token1Permit2Signature:i})},[y,j,eh,ea,ec,x,e9,ne,na,ny,nr,no,nn,nd,np,nv]),nC=nj!==G.h$.APPROVED&&!!eM,nS=nI!==G.h$.APPROVED&&!!eE,nT=(0,u.useMemo)(()=>({[et.O9.CURRENCY_A]:ea,[et.O9.CURRENCY_B]:ec}),[ea,ec]);return p?y?(0,i.jsxs)(k.A,{width:["100%","100%","100%","60rem"],children:[(0,i.jsx)(eP,{currency0:ea,currency1:ec,children:(0,i.jsx)(C.A,{children:a("Increase Liquidity")})}),(0,i.jsx)(eD,{mt:"24px",mx:"auto",children:(0,i.jsxs)(S.A,{children:[(0,i.jsx)(T.A,{alignItems:"center",children:(0,i.jsx)(ev,{showPoolFeature:!1,poolId:ej,tokenId:j?BigInt(j):void 0,protocol:l.Zs.InfinityCLAMM,currency0:ea,currency1:ec,isOutOfRange:eg,chainId:p,dynamic:J,feeTier:v,size:"sm",displayLabelOnMobile:!1,displayGlobalSettings:!0})}),(0,i.jsxs)(R.k0,{mt:"24px",children:[(0,i.jsxs)(T.A,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsxs)(B.A,{gap:"4px",children:[(0,i.jsx)(F.Z,{currency:ea}),(0,i.jsx)(C.A,{color:"textSubtle",children:null==ea?void 0:ea.symbol})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(U.g3,{amount:eM,textAlign:"right",children:null!=(t=eZ(eM))?t:"-"}),(0,i.jsxs)(C.A,{color:"textSubtle",textAlign:"right",small:!0,children:["~$",(0,q.ZV)(null!=(o=(0,en.so)(eM,eW))?o:0)]})]})]}),(0,i.jsxs)(T.A,{mt:"12px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsxs)(B.A,{gap:"4px",children:[(0,i.jsx)(F.Z,{currency:ec}),(0,i.jsx)(C.A,{color:"textSubtle",children:null==ec?void 0:ec.symbol})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(U.g3,{amount:eE,textAlign:"right",children:null!=(s=eO(eE))?s:"-"}),(0,i.jsxs)(C.A,{color:"textSubtle",textAlign:"right",small:!0,children:["~$",(0,q.ZV)(null!=(d=(0,en.so)(eE,eV))?d:0)]})]})]}),(0,i.jsx)(E.A,{style:{margin:"12px 0"}}),(0,i.jsxs)(T.A,{justifyContent:"space-between",children:[(0,i.jsx)(C.A,{color:"textSubtle",children:a("Fee Tier")}
1),(0,i.jsxs)(C.A,{children:[J?"↕️ ":null,(null!=ef?ef:0)/1e4,"%"]})]})]}),(0,i.jsxs)(M.JA,{mt:"20px",children:[(0,i.jsx)(P.y,{children:a("Price Range")}),(0,i.jsx)(z.RateToggle,{currencyA:eG,handleRateToggle:()=>eC(!eA)})]}),(0,i.jsx)(M.eF,{my:"8px",children:(0,i.jsxs)(T.A,{alignItems:"center",justifyContent:"space-between",width:"100%",flexWrap:["wrap","wrap","nowrap"],children:[(0,i.jsx)($.E,{mr:["0","0","16px"],mb:["8px","8px","0"],title:a("MIN PRICE"),price:(0,Y.I)(e_,eH,N.zm.LOWER,c),rawPrice:eS,currency0:eX,currency1:eG}),(0,i.jsx)($.E,{ml:["0","0","16px"],title:a("MAX PRICE"),price:(0,Y.I)(eK,eH,N.zm.UPPER,c),rawPrice:eT,currency0:eX,currency1:eG})]})}),(0,i.jsx)(B.A,{mt:"16px",children:eh&&eX&&eG?(0,i.jsx)($.E,{title:a("Current Price"),currency0:eX,currency1:eG,price:(0,en.$g)(eY,6,c),rawPrice:eQ}):null}),(0,i.jsx)(r.Ay,{mt:"24px",children:(0,i.jsx)(D.A,{id:"add-liquidity-input-tokenA",onUserInput:e6,onPercentInput:e5,onMax:()=>e5(100),value:e1,currency:ea,maxAmount:e4,disabled:e$,showUSDPrice:!0,showMaxButton:!0,showQuickInputButton:!0,disableCurrencySelect:!0})}),(0,i.jsx)(r.Ay,{my:"16px",children:(0,i.jsx)(D.A,{id:"add-liquidity-input-tokenA",onUserInput:e3,onPercentInput:e7,onMax:()=>e7(100),value:e2,currency:ec,maxAmount:e8,showUSDPrice:!0,showMaxButton:!0,showQuickInputButton:!0,disableCurrencySelect:!0,disabled:eN})}),(0,i.jsxs)(M.JA,{my:"16px",children:[(0,i.jsx)(C.A,{color:"textSubtle",children:a("Slippage Tolerance")}),(0,i.jsx)(eF.AK,{})]}),(0,i.jsx)(er.E,{addIsUnsupported:!1,account:null!=x?x:void 0,isWrongNetwork:!!h,approvalA:nj,approvalB:nI,isValid:nl,showApprovalA:nC,approveACallback:nh,currentAllowanceA:nu,revokeACallback:nm,currencies:nT,approveBCallback:nw,currentAllowanceB:ng,revokeBCallback:nb,showApprovalB:nS,parsedAmounts:nt,onClick:nk,attemptingTxn:ns,errorMessage:ni,buttonText:a("Add +"),depositADisabled:e$,depositBDisabled:eN})]})})]}):(0,i.jsx)(I.A,{src:"/images/decorations/3dpan.png",alt:"Pancake illustration",width:120,height:103}):(0,i.jsx)(b.A,{style:{placeItems:"center",minHeight:"50vh"},children:(0,i.jsx)(w.A,{})})};var e$=t(208103),eN=t(2828),eL=t(734658),eZ=t(673115),eO=t(525033),eW=t(609104),eV=t(42142),eU=t(203907),eX=t(70619),eG=t(17581),eQ=t(273523),e_=t(498938),eK=t(149160);let eY=e=>{var n;let{currency0:t,currency1:l,isMobile:r,position:o,activeId:s}=e,{t:d,currentLanguage:{locale:a}}=(0,A.A)(),[c,x]=(0,u.useState)(!1),p=null==o||null==(n=o.poolKey)?void 0:n.parameters.binStep,m=s&&p&&t&&l?(0,eQ.GQ)(s,p,t,l):void 0,h=(0,u.useMemo)(()=>(null==o?void 0:o.minBinId)&&p&&t&&l?(0,eQ.GQ)(o.minBinId,p,t,l):void 0,[null==o?void 0:o.minBinId,p,t,l]),j=(0,u.useMemo)(()=>(null==o?void 0:o.maxBinId)&&p&&t&&l?(0,eQ.GQ)(o.maxBinId,p,t,l):void 0,[null==o?void 0:o.maxBinId,p,t,l]),y=c?null==j?void 0:j.invert():h,f=c?null==h?void 0:h.invert():j,g=c?null==m?void 0:m.invert():m,v=(0,V.xm)(y),b=(0,V.xm)(f),w=(0,V.xm)(g);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"16px",mt:"24px",children:[(0,i.jsx)(C.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:d("Price Range")}),t&&l&&(0,i.jsx)(eK.A,{currencyA:c?l:t,handleRateToggle:()=>x(!c)})]}),(0,i.jsx)(M.eF,{mb:"8px",children:(0,i.jsxs)(T.A,{alignItems:"center",justifyContent:"space-between",width:"100%",flexWrap:["wrap","wrap","nowrap"],children:[(0,i.jsx)($.E,{mr:["0","0","16px"],mb:["8px","8px","0"],title:d("Min Price"),price:(0,en.$g)(v,6,a),rawPrice:y,currency0:c?t:l,currency1:c?l:t}),r?null:(0,i.jsx)(e_.A,{width:"24px",mx:"16px"}),(0,i.jsx)($.E,{ml:["0","0","16px"],title:d("Max Price"),price:(0,en.$g)(b,6,a),rawPrice:f,currency0:c?t:l,currency1:c?l:t})]})}),t&&l?(0,i.jsx)($.E,{title:d("Current Price"),currency0:c?t:l,currency1:c?l:t,price:(0,en.$g)(w,6,a),rawPrice:g}):null]})};var eH=t(557423),eJ=t(905470),e0=t(899188),e1=t(529208),e2=t(341936);(0,J.Ay)(v.A).withConfig({componentId:"sc-f269873-0"})(["border-radius:24px;max-width:858px;width:100%;z-index:1;"]);let e4=(0,J.Ay)(e2.A).withConfig({componentId:"sc-f269873-1"})(["display:flex;flex-direction:column;justify-content:space-between;border-bottom:1px solid ",";","{flex-direction:row;}"],e=>{let{theme:n}=e;return n.colors.cardBorder},e=>{let{theme:n}=e;return n.mediaQueries.sm}),e8=e=>{let{children:n}=e,{isMobile:t}=(0,es.A)();return t?(0,i.jsx)(b.A,{style:{gap:"8px"},mt:"16px",gridTemplateColumns:"1fr 1fr",children:n}):(0,i.jsx)(B.A,{gap:"8px",children:n})},e6=e=>{let{protocol:n,chainId:t,isRemoved:r,poolId:o,tokenId:s,isOwner:a=!0,...c}=e,{t:x}=(0,A.A)(),p=(0,u.useMemo)(()=>o?n===l.Zs.InfinityBIN?(0,d.g)({route:"/liquidity/add/[[...poolId]]",routeParam
1s:{poolId:[t,"infinity",o]},searchParams:{chain:e0.RW[t],[e1.hy]:1}}):(n===l.Zs.InfinityCLAMM||n===l.Zs.InfinitySTABLE)&&s?(0,d.g)({route:"/liquidity/position/[[...positionId]]",routeParams:{positionId:[l.Zs.InfinityCLAMM,Number(s),"increase"]},searchParams:{chain:e0.RW[t],[e1.hy]:1}}):"":"",[t,o,n,s]),m=(0,u.useMemo)(()=>o?n===l.Zs.InfinityBIN?(0,d.g)({route:"/liquidity/position/[[...positionId]]",routeParams:{positionId:[l.Zs.InfinityBIN,o,"decrease"]},searchParams:{chain:e0.RW[t],[e1.hy]:1}}):(n===l.Zs.InfinityCLAMM||n===l.Zs.InfinitySTABLE)&&s?(0,d.g)({route:"/liquidity/position/[[...positionId]]",routeParams:{positionId:[l.Zs.InfinityCLAMM,Number(s),"decrease"]},searchParams:{chain:e0.RW[t],[e1.hy]:1}}):"":"",[o,n,s,t]);return(0,i.jsxs)(e4,{variant:"pale",children:[(0,i.jsx)(ev,{poolId:o,isRemoved:r,protocol:n,chainId:t,tokenId:s,...c}),(0,i.jsxs)(e8,{children:[(0,i.jsx)(eJ.Y,{to:p,children:(0,i.jsx)(eH.A,{width:"100%",disabled:!a,children:x("Add")})}),r?null:(0,i.jsx)(eJ.Y,{to:m,children:(0,i.jsx)(eH.A,{variant:"secondary",width:"100%",disabled:!a,children:x("Remove")})})]})]})},e3=()=>{var e,n;let{t}=(0,A.A)(),{address:s}=(0,eG.F)(),{poolId:d}=p(),{chainId:a}=(0,eq.ax)(),[,c]=(0,e$.W)(d,a),x=(0,H.qX)({poolAddress:d,chainId:a}),m=(0,ew.R4)(a,d),h=(0,eV.rB)({chainId:a,poolId:d}),[j,y]=(0,u.useMemo)(()=>c?[c.token0,c.token1]:[void 0,void 0],[c]),{data:f}=(0,Z.C)(d,a,s),g=(0,u.useMemo)(()=>{var e;return j?eL.eF.fromRawAmount(j,null!=(e=null==f?void 0:f.reserveX)?e:0n):void 0},[j,f]),b=(0,u.useMemo)(()=>{var e;return y?eL.eF.fromRawAmount(y,null!=(e=null==f?void 0:f.reserveY)?e:0n):void 0},[y,f]),w=(0,V.Wu)(g,6),I=(0,V.Wu)(b,6),P=(0,K.r0)(j,{enabled:!!(null==g?void 0:g.greaterThan(0))}),F=(0,K.r0)(y,{enabled:!!(null==b?void 0:b.greaterThan(0))}),z=(0,u.useMemo)(()=>{if(!g&&!b)return;let e=P&&g?P.quote(g):void 0,n=F&&b?F.quote(b):void 0;return e&&n?e.add(n):e||n||void 0},[P,F,g,b]),D=(0,u.useMemo)(()=>(null==g?void 0:g.equalTo(0))&&(null==b?void 0:b.equalTo(0)),[g,b]);return c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eN.bV,{title:`${null==c||null==(e=c.token0)?void 0:e.symbol}-${null==c||null==(n=c.token1)?void 0:n.symbol} Infinity LP #${d}`}),(0,i.jsxs)(k.A,{width:["100%","100%","100%","80rem"],children:[j&&y?(0,i.jsx)(r.Ay,{my:["18px","26px","26px","42px"],children:(0,i.jsxs)(eC.A,{children:[(0,i.jsx)(eZ.A,{href:"/liquidity/pools",children:t("Farm")}),(0,i.jsx)(C.A,{children:`${null==j?void 0:j.symbol} / ${null==y?void 0:y.symbol}`})]})}):null,(0,i.jsxs)(v.A,{style:{maxWidth:"800px"},mx:"auto",children:[(0,i.jsx)(e6,{isFarming:h&&!D,isRemoved:D,protocol:l.Zs.InfinityBIN,poolId:d,currency0:null==c?void 0:c.token0,currency1:null==c?void 0:c.token1,chainId:a,feeTier:null==c?void 0:c.fee,dynamic:null==c?void 0:c.dynamic,hookData:m,isOutOfRange:(null==f?void 0:f.status)===eU.$.INACTIVE}),(0,i.jsxs)(S.A,{children:[(0,i.jsx)(M.eF,{children:(0,i.jsx)(T.A,{alignItems:"center",justifyContent:"space-between",width:"100%",mb:"8px",style:{gap:"16px"},flexWrap:["wrap","wrap","nowrap"],children:(0,i.jsxs)(r.Ay,{width:"100%",mb:["8px","8px",0],position:"relative",children:[x&&f&&(0,i.jsx)(T.A,{position:"absolute",right:0,children:(0,i.jsx)(eX.IV,{pool:x,userPosition:f})}),(0,i.jsxs)(B.A,{gap:"4px",alignItems:"center",children:[(0,i.jsx)(C.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:t("Liquidity")}),(0,i.jsx)(eO.PT,{color:"secondary",text:t("Displayed amounts include fees. In LBAMM pools, accrued fees are added back to the pool reserves.")})]}),(0,i.jsxs)(C.A,{fontSize:"24px",fontWeight:600,mb:"8px",children:["$",(null==z?void 0:z.greaterThan(new eL.fw(1,100)))?z.toFixed(2,{groupSeparator:","}):"-"]}),(0,i.jsxs)(R.k0,{mr:"4px",style:{padding:"12px 16px"},children:[(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:j}),(0,i.jsx)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==j?void 0:j.symbol})]}),(0,i.jsx)(T.A,{justifyContent:"center",children:(0,i.jsx)(U.g3,{amount:g,small:!0,mr:"4px",children:(0,q.ZV)(null!=w?w:"0")})}),(0,i.jsx)(M.JA,{justifyContent:"flex-end",children:(0,i.jsx)(C.A,{fontSize:"10px",color:"textSubtle",mr:"4px",children:g&&P?`~$${P.quote(g).toFixed(2,{groupSeparator:","})}`:""})})]}),(0,i.jsxs)(M.eF,{justifyContent:"space-between",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:y}),(0,i.jsx)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==y?void 0:y.symbol})]}),(0,i.jsx)(T.A,{justifyContent:"center",children:(0,i.jsx)(U.g3,{amount:b,small:!0,mr:"4px",children:(0,q.ZV)(null!=I?I:"0")})}),(0,i.jsx)(M.JA,{justifyContent:"flex-end",children:(0,i.jsx)(C.A,{fontSize:"10px",color:"textSubtle",mr:"4px",children:b&&!b.equalTo(0)&&F?`~$${F.quote(b).toFixed(2,{groupSeparator:","})}`:""})})]})]})]})})}),(0,i.jsxs)(T.A,{flexWrap:["wrap","wrap","wrap","nowrap"],children:[f?(0,i.jsx)(r.Ay,{width:"100%",children:(0,i.jsx)(eY,{currency0:j,currency1:y,position:f,activeId:null==c?void 0:c.activeId,price0:P,price1:F})}):null,(0,i.jsx)(eW.l,{disabled:!s||!(null==f?void 0:f.reserveX)||!(null==f?void 0:f.reserveY),outRange:(null==f?void 0:f.status)===eU.$.INACTIVE,notEnoughLiquidity:!!(z&&z.lessThan(new eL.fw(BigInt(20)*z.decimalScale*z.de
1nominator,null==z?void 0:z.denominator))),poolAddress:d,poolProtocol:l.Zs.InfinityBIN})]})]})]})]})]}):(0,i.jsx)(o.A,{})};var e5=t(549333),e7=t(779243),e9=t(673384),ne=t(698612),nn=t(214885),nt=t(344730),ni=t(555967),nl=t(419041),nr=t(779597),no=t(306411),ns=t(788501),nd=t(733775);let na=e=>{let{currencyQuote:n,currencyBase:t,isMobile:l,priceUpper:r,priceLower:o,inverted:s,pool:d,tickAtLimit:a,setInverted:c}=e,{t:x,currentLanguage:{locale:p}}=(0,A.A)(),m=(0,u.useMemo)(()=>s?{[N.zm.LOWER]:a[N.zm.UPPER],[N.zm.UPPER]:a[N.zm.LOWER]}:a,[a,s]),h=d?s?d.token1Price:d.token0Price:void 0,j=(0,V.xm)(o),y=(0,V.xm)(r),f=(0,V.xm)(h);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"16px",mt:"24px",children:[(0,i.jsx)(C.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:x("Price Range")}),t&&n&&(0,i.jsx)(eK.A,{currencyA:t,handleRateToggle:()=>c(!s)})]}),(0,i.jsx)(M.eF,{mb:"8px",children:(0,i.jsxs)(T.A,{alignItems:"center",justifyContent:"space-between",width:"100%",flexWrap:["wrap","wrap","nowrap"],children:[(0,i.jsx)($.E,{mr:["0","0","16px"],mb:["8px","8px","0"],title:x("Min Price"),price:(0,Y.I)(j,m,N.zm.LOWER,p),rawPrice:o,currency0:n,currency1:t}),l?null:(0,i.jsx)(e_.A,{width:"24px",mx:"16px"}),(0,i.jsx)($.E,{ml:["0","0","16px"],title:x("Max Price"),price:(0,Y.I)(y,m,N.zm.UPPER,p),rawPrice:r,currency0:n,currency1:t})]})}),d&&n&&t?(0,i.jsx)($.E,{title:x("Current Price"),currency0:n,currency1:t,price:(0,en.$g)(f,6,p),rawPrice:h}):null]})},nc=()=>{let{t:e,currentLanguage:{locale:n}}=(0,A.A)(),{account:t,chainId:o}=(0,eq.W7)(),{tokenId:s}=m(),[d,a]=(0,u.useState)(),[c,x]=(0,u.useState)(null),[p,h]=(0,u.useState)(!1),{isLoading:j,position:y}=(0,Z.a)(s,o),{token0:f,token1:g,fee:b,liquidity:I,tickLower:B,tickUpper:P,tokenId:F,poolKey:z}=y||{},D=(0,X.G5)(f,o),E=(0,X.G5)(g,o),{priceLower:$,priceUpper:N,base:L,quote:G,pool:Q,invert:_,inverted:Y}=(0,H.RI)(y),J=z?(0,eQ.Qn)(z):void 0,ee=(0,H.qX)({poolAddress:J,chainId:o}),en=(0,O.A)(B,P,null==Q?void 0:Q.tickSpacing),{feeAmount0:et,feeAmount1:el,totalFiatValue:er}=(0,nt.O)({currency0:D,currency1:E,tokenId:F,poolId:J,tickLower:B,tickUpper:P}),{onCollect:ed,attemptingTx:ea}=(0,ns.A)({chainId:o,onDone:x}),ec=(0,no.tp)(null!=c?c:void 0),{amount0:eu,amount1:ex}=(0,W.h)({token0:D,token1:E,tickCurrent:null==Q?void 0:Q.tickCurrent,tickLower:B,tickUpper:P,sqrtRatioX96:null==Q?void 0:Q.sqrtRatioX96,liquidity:I}),ep=(0,u.useMemo)(()=>!!((null==eu?void 0:eu.greaterThan(0))||(null==et?void 0:et.greaterThan(0))),[eu,et]),em=(0,u.useMemo)(()=>!!((null==ex?void 0:ex.greaterThan(0))||(null==el?void 0:el.greaterThan(0))),[ex,el]),eh=(0,K.r0)(D,{enabled:ep}),ej=(0,K.r0)(E,{enabled:em}),ey=(0,u.useMemo)(()=>{let e,n;if(!eh&&!ej||!eu&&!ex)return null;if(eh&&eu)try{eu.currency.equals(eh.baseCurrency)?e=eh.quote(eu):console.warn("Currency mismatch for price0.quote(positionAmount0)",{positionAmount0Currency:eu.currency.symbol,price0BaseCurrency:eh.baseCurrency.symbol})}catch(e){console.error("Error quoting amount0:",e)}if(ej&&ex)try{ex.currency.equals(ej.baseCurrency)?n=ej.quote(ex):console.warn("Currency mismatch for price1.quote(positionAmount1)",{positionAmount1Currency:ex.currency.symbol,price1BaseCurrency:ej.baseCurrency.symbol})}catch(e){console.error("Error quoting amount1:",e)}return e&&n?e.add(n):e||n||null},[eh,ej,eu,ex]),ef=(0,u.useCallback)(()=>{a(void 0)},[]),eg=(0,u.useMemo)(()=>D&&E&&p?D.isNative?D.wrapped.address:E.isNative?E.wrapped.address:ei.Xd:ei.Xd,[D,E,p]),eA=(0,u.useCallback)(()=>{o&&t&&F&&z&&ed({tokenId:F,poolKey:z,wrapAddress:eg})},[o,t,F,z,ed,eg]),ev=(0,ni.xm)(o),eb=(0,nr.DD)({contract:F?ev:void 0,functionName:"ownerOf",args:(0,u.useMemo)(()=>[Number(F)],[F])}).result,eI=(0,nd.ho)(eb,t)||(0,nd.ho)(null==y?void 0:y.operator,t),ek=Y?et:el,eS=Y?el:et,eT=Y?eu:ex,eB=Y?ex:eu,eM=(0,V.Wu)(eT,6),eP=(0,V.Wu)(eB,6),eF=(0,V.Wu)(ek,4),ez=(0,V.Wu)(eS,4),eR=Y?eh:ej,eD=Y?ej:eh,eE=(0,e9.Qc)(null!=Q?Q:void 0,B,P),e$=0n===I,eO=(0,eV.rB)({chainId:o,poolId:J}),eU=(0,nl.Ay)().wrapped.symbol,eG=(0,u.useCallback)(e=>p?null==e?void 0:e.wrapped.symbol:null==e?void 0:e.symbol,[p]),e_=!!(eI&&D&&E&&(D.isNative&&(null==et?void 0:et.greaterThan(0))||E.isNative&&(null==el?void 0:el.greaterThan(0)))&&!c),eK=(0,ew.R4)(o,J),eY=(0,u.useCallback)(()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(R.k0,{mb:"16px",children:[(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:null==ek?void 0:ek.currency,size:"24px"}),(0,i.jsx)(C.A,{color:"textSubtle",ml:"4px",children:eG(null==ek?void 0:ek.currency)})]}),(0,i.jsx)(U.g3,{amount:ek,children:ek&&null!=eF?eF:"-"})]}),(0,i.jsxs)(M.eF,{justifyContent:"space-between",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:null==eS?void 0:eS.currency,size:"24px"}),(0,i.jsx)(C.A,{color:"textSubtle",ml:"4px",children:eG(null==eS?void 0:eS.currency)})]}),(0,i.jsx)(U.g3,{amount:eS,children:eS&&null!=ez?ez:"-"})]})]}),(0,i.jsx)(C.A,{mb:"16px",px:"16px",children:e("Collecting fees will withdraw currently available fees for you")})]}),[eS,ek,eG,n,e]),eJ=(0,u.useCallback)(()=>(0,i.jsx)(ne.Y,{topContent:eY,bottomContent:()=>(0,i.jsx)(eH.A,{width:"100%",onClick:eA,children:e("Collect")})}),[eA,eY,e]),[e0]=(0,e5.A)((0,i.jsx)(nn.A,{title:e("Claim fees"),attemptingTxn:ea,customOnDismiss:ef,hash:null!=c?c:"",errorMessage:d,content:eJ,pendingText:e("Collecting fees")}),!0,!0,"TransactionConfirmationModalCollectFees"),e1=j||!z,{isMobile:e2}=(0,es.A)(),e4=(0,u.useMemo)(()=>(0,i.jsx)(T.A,{width:"100%",justifyContent:"center",alignItems:"center",minHeight:"200px",mb:"32px",children:(0,i.jsx)(w.A,{})}),[]);return(0,i.jsxs)(i.Fragment,{children:[!e1&&(0,i.jsx)(eN.bV,{title:`${null==G?void 0:G.symbol}-${null==L?void 0:L.symbol} Infinity LP #${s}`}),(0,i.jsx)(k.A,{width:["100%","100%","100%","80rem"],children:e1?e4:(0,i.jsxs)(i.Fragment,{children:[D&&E?(0,i.jsx)(r.Ay,{my:["18px","26px","26px","42px"],children:(0,i.jsxs)(eC.A,{children:[(0,i.jsx)(eZ.A,{href:"/liquidity/pools",children:e("Farm")}),(0,i.jsx)(C.A,{children:`${null==D?void 0:D.symbol} / ${null==E?void 0:E.symbol}`})]})}):null,(0,i.jsxs)(v.A,{style:{maxWidth:"800px"},mx:"auto",children:[o?(0,i.jsx)(e6,{isOwner:eI,isOutOfRange:!eE,isFarming:eO&&!e$,protocol:l.Zs.InfinityCLAMM,currency0:D,currency1:E,chainId:o,feeTier:b,dynamic:null==ee?void 0:ee.isDynamicFee,isRemoved:e$,hookData:eK,poolId:J,tokenId:F?Number(F):void 0}):null,(0,i.jsxs)(S.A,{children:[(0,i.jsx)(M.eF,{children:(0,i.jsxs)(T.A,{alignItems:"center",justifyContent:"space-between",width:"100%",mb:"8px",style:{gap:"16px"},flexWrap:["wrap","wrap","nowrap"],children:[(0,i.jsxs)(r.Ay,{width:"100%",mb:["8px","8px",0],position:"relative",children:[(0,i.jsx)(T.A,{position:"absolute",right:0,children:ee&&y&&(0,i.jsx)(eX.UB,{pool:ee,userPosition:y})}),(0,i.jsx)(C.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:e("Liquidity")}),(0,i.jsxs)(C.A,{fontSize:"24px",fontWeight:600,mb:"8px",children:["$",(null==ey?void 0:ey.greaterThan(new eL.fw(1,100)))?ey.toFixed(2,{groupSeparator:","}):"-"]}),(0,i.jsxs)(R.k0,{mr:"4px",style:{padding:"12px 16px"},children:[(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:G}),(0,i.jsx)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==eT?void 0:eT.currency.symbol})]}),(0,i.jsx)(T.A,{justifyContent:"center",children:(0,i.jsx)(U.g3,{amount:eT,small:!0,mr:"4px",children:(0,q.ZV)(null!=eM?eM:"0")})}),(0,i.jsx)(M.JA,{justifyContent:"flex-end",children:(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",mr:"4px",children:eT&&eR?(()=>{try{if(eT.currency.equals(eR.baseCurrency))return`~$${eR.quote(eT).toFixed(2,{groupSeparator:","})}`}catch(e){console.error("Error quoting positionValueUpper:",e)}return""})():""})})]}),(0,i.jsxs)(M.eF,{justifyContent:"space-between",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:L}),(0,i.jsx)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:null==eB?void 0:eB.currency.symbol})]}),(0,i.jsx)(T.A,{justifyContent:"center",children:(0,i.jsx)(U.g3,{amount:eB,small:!0,mr:"4px",children:(0,q.ZV)(null!=eP?eP:"0")})}),(0,i.jsx)(M.JA,{justifyContent:"flex-end",children:(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",mr:"4px",children:eB&&eD?(()=>{try{if(eB.currency.equals(eD.baseCurrency))return`~$${eD.quote(eB).toFixed(2,{groupSeparator:","})}`}catch(e){console.error("Error quoting positionValueLower:",e)}return""})():""})})]})]})]}),(0,i.jsxs)(r.Ay,{width:"100%",children:[(0,i.jsx)(C.A,{fontSize:"12px",color:"secondary",bold:!0,textTransform:"uppercase",children:e("Unclaimed Fees")}),(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsxs)(C.A,{fontSize:"24px",fontWeight:600,children:["$",(null==er?void 0:er.greaterThan(new eL.fw(1,100)))?er.toFixed(2,{groupSeparator:","}):"-"]}),(0,i.jsx)(eH.A,{scale:"sm",variant:"secondary",disabled:!eI||ea||ec||!((null==et?void 0:et.greaterThan(0))||(null==el?void 0:el.greaterThan(0))||c),onClick:e0,children:c&&!ec?e("Collected"):ec||ea?e("Collecting..."):e("Collect")})]}),(0,i.jsxs)(R.k0,{mr:"4px",style:{padding:"12px 16px"},children:[(0,i.jsxs)(M.eF,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:null==ek?void 0:ek.currency}),(0,i.jsx)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:eG(null==ek?void 0:ek.currency)})]}),(0,i.jsx)(T.A,{justifyContent:"center",children:(0,i.jsx)(U.g3,{amount:ek,small:!0,children:ek&&null!=eF?eF:"-"})}),(0,i.jsx)(M.JA,{justifyContent:"flex-end",children:(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:ek&&eR?(()=>{try{if(ek.currency.equals(eR.baseCurrency))return`~$${eR.quote(ek).toFixed(2,{groupSeparator:","})}`}catch(e){console.error("Error quoting feeValueUpper:",e)}return""})():""})})]}),(0,i.jsxs)(M.eF,{justifyContent:"space-between",children:[(0,i.jsxs)(T.A,{children:[(0,i.jsx)(eo.Zm,{currency:null==eS?void 0:eS.currency}),(0,i.jsx)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokenb-symbol",ml:"4px",children:eG(null==eS?void 0:eS.currency)})]}),(0,i.jsx)(T.A,{justifyContent:"center",children:(0,i.jsx)(U.g3,{amount:eS,small:!0,children:eS&&null!=ez?ez:"-"})}),(0,i.jsx)(M.JA,{justifyContent:"flex-end",children:(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:eS&&eD?(()=>{try{if(eS.currency.equals(eD.baseCurrency))return`~$${eD.quote(eS).toFixed(2,{groupSeparator:","})}`}catch(e){console.error("Error quoting feeValueLower:",e)}return""})():""})})]})]})]})]})}),e_&&(0,i.jsx)(T.A,{mb:"8px",children:(0,i.jsxs)(T.A,{ml:"auto",alignItems:"center",children:[(0,i.jsxs)(C.A,{mr:"8px",children:[e("Collect as")," ",eU]}),(0,i.jsx)(e7.A,{id:"receive-as-wnative",scale:"sm",checked:p,onChange:()=>h(e=>!e)})]})}),(0,i.jsxs)(T.A,{flexWrap:["wrap","wrap","wrap","nowrap"],children:[(0,i.jsx)(r.Ay,{width:"100%",children:(0,i.jsx)(na,{setInverted:_,currencyQuote:G,currencyBase:L,isMobile:e2,priceLower:$,priceUpper:N,pool:Q,inverted:Y,tickAtLimit:en})}),(0,i.jsx)(eW.l,{disabled:!eI,outRange:!eE,notEnoughLiquidity:!!(ey&&ey.lessThan(new eL.fw(BigInt(20)*ey.decimalScale*ey.denominator,null==ey?void 0:ey.denominator))),poolAddress:J,poolProtocol:l.Zs.InfinityCLAMM})]})]})]})]})})]})};var nu=t(179087),nx=t(987212),np=t(614325),nm=t(49563),nh=t(226464),nj=t(962478),ny=t(928768),nf=t(606771),ng=t(259145),nA=t(628838),nv=t(515324);let nb=()=>{var e,n,t,l,r,s,d,a;let{t:x}=(0,A.A)(),{chainId:p}=(0,eq.ax)(),h=(0,c.useRouter)(),{theme:j}=(0,nu.DP)(),{tokenId:y,protocol:f}=m(),{position:g}=(0,Z.a)(y,p),{poolKey:v,token0:b,token1:w,fee:I,liquidity:M,tickLower:F,tickUpper:z}=g||{},D=(null==g?void 0:g.liquidity)===0n,$=(0,X.G5)(b,p),N=(0,X.G5)(w,p),L=(0,V.wG)($),O=(0,V.wG)(N),G=(0,u.useMemo)(()=>v?(0,eQ.Qn)(v):void 0,[v]),[,Q]=(0,e$.W)(G,p),_=(0,eV.rB)({chainId:p,poolId:G}),Y=(0,nl.Ay)(p),[H,J]=(0,u.useState)(50),[ee,et]=(0,u.useState)(!1),{amount0:ei,amount1:er}=(0,W.h)({token0:$,token1:N,tickCurrent:null==Q?void 0:Q.tickCurrent,tickLower:F,tickUpper:z,sqrtRatioX96:null==Q?void 0:Q.sqrtRatioX96,liquidity:M}),[es,ed]=(0,u.useMemo)(()=>
1[null==ei?void 0:ei.multiply(new eL.QE(H,100)),null==er?void 0:er.multiply(new eL.QE(H,100))],[ei,er,H]),[ea,ec]=(0,nt.s)({currency0:$,currency1:N,tokenId:y?BigInt(y):void 0,poolId:G,tickLower:F,tickUpper:z}),eu=(0,u.useMemo)(()=>!!((null==es?void 0:es.greaterThan(0))||(null==ea?void 0:ea.greaterThan(0))),[es,ea]),ex=(0,u.useMemo)(()=>!!((null==ed?void 0:ed.greaterThan(0))||(null==ec?void 0:ec.greaterThan(0))),[ed,ec]),ep=(0,K.r0)($,{enabled:eu}),em=(0,K.r0)(N,{enabled:ex}),eh=(0,u.useMemo)(()=>{var e,n;return ee?(null==$?void 0:$.isNative)?null!=(e=null==$?void 0:$.wrapped.address)?e:nx.Xd:(null==N?void 0:N.isNative)&&null!=(n=null==N?void 0:N.wrapped.address)?n:nx.Xd:nx.Xd},[ee,null==$?void 0:$.isNative,null==$?void 0:$.wrapped.address,null==N?void 0:N.isNative,null==N?void 0:N.wrapped.address]),ej=(0,u.useMemo)(()=>H>0&&H<=100,[H]),ey=(0,u.useCallback)(e=>{J(Math.ceil(e))},[J]),{address:ef}=(0,eG.F)(),{removeLiquidity:eg,attemptingTx:eA}=(0,nf.X)(p,ef,()=>{100===H&&h.push(ny.sV.POSITIONS)}),[ew]=(0,eb.uZ)()||[e1.C0],eI=(0,u.useCallback)(async()=>{if(!g||!y)return;let[e]=es?(0,ek.wQ)(es,ew):[el.iB],[n]=ed?(0,ek.wQ)(ed,ew):[el.iB];await eg({tokenId:BigInt(y),poolKey:g.poolKey,liquidity:g.liquidity*BigInt(H)/100n,amount0Min:e,amount1Min:n,wrapAddress:eh,deadline:BigInt(Math.floor(Date.now()/1e3)+1200),amount0Desired:null==es?void 0:es.quotient,amount1Desired:null==ed?void 0:ed.quotient,currency0:$,currency1:N})},[g,y,es,ew,ed,eg,H,eh,$,N]),eC=(0,u.useMemo)(()=>ef?0===H?x("Enter a percent"):void 0:x("Connect Wallet"),[x,ef,H]),eS=(0,u.useMemo)(()=>!!($&&N&&($.isNative||N.isNative)),[$,N]),[eT,eB]=(0,u.useMemo)(()=>ee?[null==$?void 0:$.wrapped.symbol,null==N?void 0:N.wrapped.symbol]:[null==$?void 0:$.symbol,null==N?void 0:N.symbol],[ee,null==$?void 0:$.symbol,null==N?void 0:N.symbol,null==$?void 0:$.wrapped.symbol,null==N?void 0:N.wrapped.symbol]);return p&&g&&y?(0,i.jsxs)(k.A,{width:["100%","100%","100%","60rem"],children:[(0,i.jsx)(eP,{currency0:$,currency1:N,children:(0,i.jsx)(C.A,{children:x("Remove Liquidity")})}),(0,i.jsx)(nv.ee,{mt:"24px",mx:"auto",children:(0,i.jsxs)(S.A,{children:[(0,i.jsx)(T.A,{alignItems:"center",children:(0,i.jsx)(ev,{showPoolFeature:!1,poolId:G,tokenId:y?BigInt(y):void 0,protocol:f,currency0:$,currency1:N,chainId:p,feeTier:I,dynamic:null==Q?void 0:Q.dynamic,displayLabelOnMobile:!1,size:"sm",isFarming:_,isRemoved:D,isOutOfRange:(null==g?void 0:g.status)===eU.$.INACTIVE})}),(0,i.jsx)(P.y,{mt:"24px",textTransform:"uppercase",children:x("Amount of liquidity to remove")}),(0,i.jsxs)(nv.IV,{mt:"8px",children:[(0,i.jsxs)(C.A,{fontSize:"32px",bold:!0,children:[H,"%"]}),(0,i.jsx)(np.A,{min:0,max:100,name:"remove-position",value:H,onValueChanged:ey}),(0,i.jsx)(B.A,{mt:"16px",gap:"8px",justifyContent:"space-between",children:nA.g.map(e=>(0,i.jsx)(eH.A,{variant:"secondary",scale:["xs",null,null,"sm"],width:"100%",onClick:()=>J(e),children:100===e?x("MAX"):`${e}%`},e))})]}),(0,i.jsx)(T.A,{mt:"24px",mb:"8px",justifyContent:"center",children:(0,i.jsx)(nm.A,{width:"24px",color:"textSubtle"})}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P.y,{mt:"24px",textTransform:"uppercase",children:x("You will receive")}),(0,i.jsxs)(R.k0,{mt:"8px",children:[(0,i.jsxs)(T.A,{justifyContent:"space-between",as:"label",alignItems:"center",children:[(0,i.jsxs)(T.A,{alignItems:"center",children:[(0,i.jsx)(eo.Zm,{currency:$}),(0,i.jsxs)(C.A,{color:"textSubtle",id:"remove-liquidity-tokena-symbol",ml:"4px",children:[x("Pooled")," ",eT]})]}),(0,i.jsx)(U.g3,{amount:es,children:null!=(e=L(es,4))?e:"0"})]}),(0,i.jsx)(T.A,{justifyContent:"flex-end",mb:"8px",children:(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:["~$",(0,q.ZV)(null!=(n=(0,en.so)(es,ep))?n:0)]})}),(0,i.jsxs)(T.A,{justifyContent:"space-between",as:"label",alignItems:"center",children:[(0,i.jsxs)(T.A,{alignItems:"center",children:[(0,i.jsx)(eo.Zm,{currency:N}),(0,i.jsxs)(C.A,{color:"textSubtle",id:"remove-liquidity-tokena-symbol",ml:"4px",children:[x("Pooled")," ",eB]})]}),(0,i.jsx)(U.g3,{amount:ed,children:null!=(t=O(ed,4))?t:"0"})]}),(0,i.jsx)(T.A,{justifyContent:"flex-end",mb:"8px",children:(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:["~$",(0,q.ZV)(null!=(l=(0,en.so)(ed,em))?l:0)]})}),(0,i.jsx)(E.A,{style:{margin:"16px 0"}}),(0,i.jsxs)(T.A,{justifyContent:"space-between",as:"label",alignItems:"center",children:[(0,i.jsxs)(T.A,{alignItems:"center",children:[(0,i.jsx)(eo.Zm,{currency:null==ea?void 0:ea.currency}),(0,i.jsxs)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokena-symbol",ml:"4px",children:[eT," ",x("Fee Earned")]})]}),(0,i.jsx)(U.g3,{amount:ea,children:null!=(r=L(ea,4))?r:"0"})]}),(0,i.jsx)(T.A,{justifyContent:"flex-end",mb:"8px",children:(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:["~$",(0,q.ZV)(null!=(s=(0,en.so)(ea,ep))?s:0)]})}),(0,i.jsxs)(T.A,{justifyContent:"space-between",as:"label",alignItems:"center",children:[(0,i.jsxs)(T.A,{alignItems:"center",children:[(0,i.jsx)(eo.Zm,{currency:null==ec?void 0:ec.currency}),(0,i.jsxs)(C.A,{small:!0,color:"textSubtle",id:"remove-liquidity-tokena-symbol",ml:"4px",children:[eB," ",x("Fee Earned")]})]}),(0,i.jsx)(U.g3,{amount:ec,children:null!=(d=O(ec,4))?d:"0"})]}),(0,i.jsx)(T.A,{justifyContent:"flex-end",mb:"8px",children:(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:["~$",(0,q.ZV)(null!=(a=(0,en.so)(ec,em))?a:0)]})})]})]}),(0,i.jsx)(T.A,{mt:"24px",justifyContent:"space-between",alignItems:"center",children:(0,i.jsx)(n
1h.A,{icon:(0,i.jsx)(nj.A,{color:"yellow"}),variant:"warning",style:{padding:"12px",borderColor:j.colors.v2Warning20},children:(0,i.jsx)(C.A,{fontSize:"14px",children:x("This pool may charge a fee for liquidity actions. Adjust slippage tolerance under Settings as needed.")})})}),(0,i.jsxs)(T.A,{mt:"24px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(C.A,{children:x("Slippage Tolerance")}),(0,i.jsx)(eF.AK,{})]}),eS&&(0,i.jsxs)(T.A,{mt:"24px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(C.A,{children:x("Collect as %nativeSymbol%",{nativeSymbol:Y.wrapped.symbol})}),(0,i.jsx)(e7.A,{scale:"sm",checked:ee,onChange:()=>et(!ee)})]}),(0,i.jsx)(eH.A,{disabled:eA||D||!!eC||!ej,width:"100%",mt:"24px",onClick:()=>{eI(),(0,ng.z_)()},children:D?x("Closed"):null!=eC?eC:x("Remove")})]})})]}):(0,i.jsx)(o.A,{})};var nw=t(512977),nI=t(165073),nk=t(727705),nC=t(772763),nS=t(73921),nT=t(488907),nB=t(59404);let nM=()=>{var e,n,t,l,s,d;let{t:a}=(0,A.A)(),{chainId:x}=(0,eq.ax)(),m=(0,c.useRouter)(),{theme:h}=(0,nu.DP)(),{protocol:j,poolId:y}=p(),[,f]=(0,e$.W)(y,x),g=(0,nI.L)(y,x,"Bin"),v=null==g?void 0:g.data,[b,w]=(0,u.useState)(!1),{address:I}=(0,eG.F)(),{data:B}=(0,nS.t)(I,y,x),M=(0,eV.rB)({chainId:x,poolId:y}),F=null==f?void 0:f.token0,z=null==f?void 0:f.token1,D=(0,V.wG)(F),E=(0,V.wG)(z),$=(0,nl.Ay)(x),[,N]=(0,nT.H4)(),[L,Z]=(0,u.useState)([null!=(e=null==B?void 0:B.minBinId)?e:0,null!=(n=null==B?void 0:B.maxBinId)?n:0]),O=(0,u.useMemo)(()=>{if(!F||!B)return;let[e,n]=L,t=B.reserveOfBins.reduce((t,i)=>i.binId>=e&&i.binId<=n?t+i.reserveX:t,0n);return eL.eF.fromRawAmount(F,null!=t?t:0n)},[B,F,L]),W=(0,u.useMemo)(()=>{if(!z||!B)return;let[e,n]=L,t=B.reserveOfBins.reduce((t,i)=>i.binId>=e&&i.binId<=n?t+i.reserveY:t,0n);return eL.eF.fromRawAmount(z,null!=t?t:0n)},[B,z,L]),X=(0,u.useMemo)(()=>!!(null==O?void 0:O.greaterThan(0)),[O]),G=(0,u.useMemo)(()=>!!(null==W?void 0:W.greaterThan(0)),[W]),Q=(0,K.r0)(F,{enabled:X}),_=(0,K.r0)(z,{enabled:G}),Y=(0,u.useMemo)(()=>(null==B?void 0:B.reserveX)===0n&&(null==B?void 0:B.reserveY)===0n,[B]),H=(0,u.useMemo)(()=>{if(!I)return a("Connect Wallet")},[a,I]);(0,u.useEffect)(()=>{(null==B?void 0:B.minBinId)&&(null==B?void 0:B.maxBinId)&&!L[0]&&!L[1]&&Z([B.minBinId,B.maxBinId])},[B,L]);let J=(0,u.useCallback)(e=>{let[n,t]=Array.isArray(e)?e:[e,e];Z([n,t]),N({lowerBinId:n,upperBinId:t})},[N,Z]),{removeLiquidity:ee,attemptingTx:et}=(0,nk.p)(x,I,()=>{L[0]===(null==B?void 0:B.minBinId)&&L[1]===B.maxBinId&&m.push(ny.sV.POSITIONS)}),[el]=(0,nC.g)(),[er]=(0,eb.uZ)(),es=(0,u.useMemo)(()=>F&&z&&b?F.isNative?F.wrapped.address:z.isNative?z.wrapped.address:ei.Xd:ei.Xd,[b,F,z]),ed=(0,u.useCallback)(async()=>{if(!f||!I||!v||!(null==B?void 0:B.reserveOfBins))return;let e=B.reserveOfBins.filter(e=>e.binId>=L[0]&&e.binId<=L[1]),n=e.map(e=>e.binId),t=e.map(e=>e.userSharesOfBin),i=eL.eF.fromRawAmount(f.token0,e.reduce((e,n)=>e+n.reserveX,0n)),l=eL.eF.fromRawAmount(f.token1,e.reduce((e,n)=>e+n.reserveY,0n)),r=(0,ek.wQ)(i,er)[0],o=(0,ek.wQ)(l,er)[0];console.debug("debug bin position",B.reserveOfBins),await ee({poolKey:v,ids:n,amounts:t,amount0Min:r,amount1Min:o,wrapAddress:es,hookData:void 0,deadline:null!=el?el:BigInt(Math.floor(Date.now()/1e3)+1200),amount0Desired:null==O?void 0:O.quotient,amount1Desired:null==W?void 0:W.quotient,currency0:F,currency1:z})},[I,er,null==B?void 0:B.reserveOfBins,el,f,v,ee,L,es,O,W,F,z]),[{lowerBinId:ea,upperBinId:ec}]=(0,nT.H4)(),eu=(0,u.useMemo)(()=>!ea||!ec||ea>ec||null!=B&&!!B.minBinId&&ea<B.minBinId||null!=B&&!!B.maxBinId&&ea>B.maxBinId||null!=B&&!!B.minBinId&&ec<B.minBinId||null!=B&&!!B.maxBinId&&ec>B.maxBinId||!1,[null==B?void 0:B.maxBinId,null==B?void 0:B.minBinId,ea,ec]);(0,u.useEffect)(()=>{!eu&&ea&&ec&&(L[0]!==ea||L[1]!==ec)&&Z([ea,ec])},[null==B?void 0:B.maxBinId,null==B?void 0:B.minBinId,eu,ea,L,ec]);let ex=(0,nu.aq)();(0,u.useEffect)(()=>{ex&&(null==B?void 0:B.minBinId)&&(null==B?void 0:B.maxBinId)&&(null===ea||null===ec)&&N({lowerBinId:B.minBinId,upperBinId:B.maxBinId})},[null==B?void 0:B.maxBinId,null==B?void 0:B.minBinId,ex,ea,N,ec]);let ep=(0,u.useMemo)(()=>!!(et||Y||H||!O||!W||O.asFraction.add(W.asFraction).equalTo(0)),[et,Y,H,O,W]),em=(0,u.useMemo)(()=>!!(F&&z&&(F.isNative||z.isNative)),[F,z]);return x&&y&&f?(0,i.jsxs)(k.A,{width:["100%","100%","100%","80rem"],children:[(0,i.jsx)(eP,{currency0:F,currency1:z,children:(0,i.jsx)(C.A,{children:a("Remove Liquidity")})}),(0,i.jsx)(nv.Jc,{mt:"24px",mx:"auto",children:(0,i.jsxs)(S.A,{children:[(0,i.jsx)(T.A,{alignItems:"center",children:(0,i.jsx)(ev,{showPoolFeature:!1,poolId:y,protocol:j,currency0:F,currency1:z,chainId:x,feeTier:null==f?void 0:f.fee,dynamic:null==f?void 0:f.dynamic,size:"sm",dis
1playLabelOnMobile:!1,isFarming:M,isRemoved:Y,isOutOfRange:(null==B?void 0:B.status)===eU.$.INACTIVE})}),(0,i.jsx)(P.y,{mt:"24px",textTransform:"uppercase",children:a("Amount of liquidity to remove")}),(0,i.jsxs)(nv.IV,{mt:"8px",children:[(0,i.jsx)(P.y,{textTransform:"uppercase",children:a("price range")}),(null==B?void 0:B.minBinId)&&(null==B?void 0:B.maxBinId)?(0,i.jsxs)(i.Fragment,{children:[B.maxBinId-B.minBinId>1?(0,i.jsx)(r.Ay,{height:"48px",my:"8px",children:(0,i.jsx)(nB.t,{defaultValue:[B.minBinId,B.maxBinId],min:B.minBinId,max:B.maxBinId,value:L,step:1,onChange:J})}):null,(0,i.jsx)(nw.W,{currency0:F,currency1:z,binStep:null==f?void 0:f.binStep,activeBinId:f.activeId,minBinId:null==B?void 0:B.minBinId,maxBinId:null==B?void 0:B.maxBinId})]}):null]}),(0,i.jsx)(T.A,{mt:"24px",mb:"8px",justifyContent:"center",children:(0,i.jsx)(nm.A,{width:"24px",color:"textSubtle"})}),(0,i.jsx)(P.y,{mt:"24px",textTransform:"uppercase",children:a("You will receive")}),(0,i.jsxs)(R.k0,{mt:"8px",children:[(0,i.jsxs)(T.A,{justifyContent:"space-between",as:"label",alignItems:"center",children:[(0,i.jsxs)(T.A,{alignItems:"center",children:[(0,i.jsx)(eo.Zm,{currency:F}),(0,i.jsxs)(C.A,{color:"textSubtle",id:"remove-liquidity-tokena-symbol",ml:"4px",children:[a("Pooled")," ",null==F?void 0:F.symbol]})]}),(0,i.jsx)(U.g3,{amount:O,children:null!=(t=D(O,4))?t:"0"})]}),(0,i.jsx)(T.A,{justifyContent:"flex-end",mb:"8px",children:(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:["~$",(0,q.ZV)(null!=(l=(0,en.so)(O,Q))?l:0)]})}),(0,i.jsxs)(T.A,{justifyContent:"space-between",as:"label",alignItems:"center",children:[(0,i.jsxs)(T.A,{alignItems:"center",children:[(0,i.jsx)(eo.Zm,{currency:z}),(0,i.jsxs)(C.A,{color:"textSubtle",id:"remove-liquidity-tokena-symbol",ml:"4px",children:[a("Pooled")," ",null==z?void 0:z.symbol]})]}),(0,i.jsx)(U.g3,{amount:W,children:null!=(s=E(W,4))?s:"0"})]}),(0,i.jsx)(T.A,{justifyContent:"flex-end",mb:"8px",children:(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",ml:"4px",children:["~$",(0,q.ZV)(null!=(d=(0,en.so)(W,_))?d:0)]})})]}),(0,i.jsx)(nh.A,{variant:"primary",mt:"16px",mb:"8px",children:(0,i.jsx)(C.A,{fontSize:"14px",children:a("Displayed amounts include fees. In LBAMM pools, accrued fees are added back to the pool reserves.")})}),(0,i.jsx)(T.A,{mt:"24px",justifyContent:"space-between",alignItems:"center",children:(0,i.jsx)(nh.A,{icon:(0,i.jsx)(nj.A,{color:"yellow"}),variant:"warning",style:{padding:"12px",borderColor:h.colors.v2Warning20},children:(0,i.jsx)(C.A,{fontSize:"14px",children:a("This pool may charge a fee for liquidity actions. Adjust slippage tolerance under Settings as needed.")})})}),(0,i.jsxs)(T.A,{mt:"24px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(C.A,{children:a("Slippage Tolerance")}),(0,i.jsx)(eF.AK,{})]}),em&&(0,i.jsxs)(T.A,{mt:"24px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(C.A,{children:a("Collect as %nativeSymbol%",{nativeSymbol:$.wrapped.symbol})}),(0,i.jsx)(e7.A,{scale:"sm",checked:b,onChange:()=>w(!b)})]}),eu?(0,i.jsx)(r.Ay,{mt:"8px",children:(0,i.jsx)(nh.A,{variant:"warning",children:(0,i.jsx)(nh.J,{children:a("Invalid range selected.")})})}):null,(0,i.jsx)(eH.A,{disabled:ep,width:"100%",mt:"24px",onClick:()=>{ed(),(0,ng.z_)()},children:Y?a("Closed"):null!=H?H:a("Remove")})]})})]}):(0,i.jsx)(o.A,{})};var nP=t(312680),nq=t(605360),nF=t(814795),nz=t(490233),nR=t(681711),nD=t(619749),nE=t(623208),n$=t(228876),nN=t(290589),nL=t(827666),nZ=t(206284),nO=t(662928),nW=t(638380),nV=t(252146),nU=t(11080);let nX=async(e,n)=>{try{let t=(0,nL.XAG)(e1.nH,new nZ.PublicKey(n)),i=await e.getAccountInfo(t.publicKey,{commitment:"processed"});if(!i)return null;return nL.iY2.decode(i.data)}catch(e){return console.error("Error fetching Solana position info:",e),null}},nG=e=>{let{data:n}=(e=>{let[n]=(0,nV.r)(),t=(0,nW.W)();return(0,nO.I)({queryKey:["solana-v3-position",e,null==n?void 0:n.blockHash],queryFn:()=>nX(t,e),enabled:!!e&&!!t,staleTime:0,refetchInterval:e1.IX,refetchOnWindowFocus:!0})}
1)(e),t=(0,nE.xk)(null==n?void 0:n.poolId.toBase58());return(0,u.useMemo)(()=>n&&t?{...n,status:(0,nU.P)(n,t),protocol:l.Zs.V3,chainId:n$.Cb.SOLANA,token0:(0,nD.ph)(t.mintA),token1:(0,nD.ph)(t.mintB)}:null,[n,t])},nQ=()=>{let{poolId:e,mintId:n}=h(),t=(0,nE.xk)(e),i=nG(n),r=(0,u.useMemo)(()=>(null==t?void 0:t.mintA)?(0,nD.ph)(t.mintA):void 0,[null==t?void 0:t.mintA]),o=(0,u.useMemo)(()=>(null==t?void 0:t.mintB)?(0,nD.ph)(t.mintB):void 0,[null==t?void 0:t.mintB]);return(0,nN.t)((0,u.useMemo)(()=>t?[t]:void 0,[t])),(0,u.useMemo)(()=>{if(r&&o&&t&&i)return{pid:0,nftMint:i.nftMint,lpAddress:eL.cF,protocol:l.Zs.V3,token0:r,token1:o,feeTier:t.feeRate,feeTierBase:1,isFarming:!i.liquidity.isZero()&&i.status!==eU.$.INACTIVE&&!!t.isFarming,poolId:i.poolId.toBase58(),liquidity:BigInt(i.liquidity.toString()),chainId:n$.Cb.SOLANA,tvlUsd:t.tvl.toString(),rawPool:t}},[r,o,t,i])},n_=()=>{var e,n,t,i;let l=nQ(),r=null==l?void 0:l.token0,o=null==l?void 0:l.token1,[s,d,a]=[`${null!=(e=null==r?void 0:r.symbol)?e:""} / ${null!=(n=null==o?void 0:o.symbol)?n:""}`,null!=(t=null==r?void 0:r.symbol)?t:"",null!=(i=null==o?void 0:o.symbol)?i:""];return{poolSymbol:s,currency0:r,currency1:o,symbol0:d,symbol1:a}},nK=()=>{let{t:e}=(0,A.A)(),{poolSymbol:n}=n_(),{isMobile:t}=(0,es.A)();return n&&" / "!==n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eN.bV,{title:e("%poolSymbol% position | PancakeSwap",{poolSymbol:n})}),(0,i.jsxs)(T.A,{justifyContent:"space-between",children:[(0,i.jsxs)(eC.A,{mb:"32px",children:[(0,i.jsx)(eJ.Y,{to:"/liquidity/pools",children:(0,i.jsx)(C.A,{color:"primary60",children:e("Farms")})}),(0,i.jsx)(T.A,{children:(0,i.jsx)(C.A,{mr:"8px",children:n})})]}),(0,i.jsx)(eH.A,{variant:"secondary",children:(0,i.jsx)(nz.i,{text:window.location.href,tooltipMessage:e("Link copied!"),width:"16px",ml:"8px",icon:nR.A,children:e(t?"Copy":"Copy share link")})})]})]}):null};var nY=t(32654),nH=t(770773),nJ=t(854780),n0=t(53847),n1=t(538534),n2=t(91168),n4=t(118708),n8=t(23275);let n6=()=>{var e,n,t,o,s,d,a,c,x;let{t:p}=(0,A.A)(),{mintId:m}=h(),{currency0:j,currency1:y,poolSymbol:f}=n_(),{isMobile:g,isMd:b}=(0,es.A)(),w=g||b,k=(0,n4.md)(eb.fk),M=nQ(),P=(0,u.useMemo)(()=>{var e;let[n,t]=new n2.A(null!=(e=null==M?void 0:M.feeTier)?e:0).toFraction();return new eL.QE(n.toString(),t.toString())},[null==M?void 0:M.feeTier]),[z,R]=(0,n8.$)(),D=(0,u.useMemo)(()=>{var e;if(null==M||null==(e=M.rawPool)?void 0:e.tickCurrent)return parseFloat(nL.P3F.getTickPrice({poolInfo:M.rawPool,tick:M.rawPool.tickCurrent,baseIn:!z}).price.toFixed(18))},[M,z]),E=nG(m);return(0,i.jsx)(v.A,{children:(0,i.jsx)(S.A,{children:(0,i.jsxs)(B.A,{justifyContent:"space-between",alignItems:w?"flex-start":"center",flexDirection:w?"column":"row",gap:"16px",children:[(0,i.jsx)(B.A,{gap:"16px",justifyContent:w?"space-between":"flex-start",flexDirection:"row",width:"100%",children:(0,i.jsxs)(B.A,{flexDirection:"column",gap:"16px",children:[(0,i.jsxs)(B.A,{gap:"12px",alignItems:w?"flex-start":"center",flexDirection:w?"column":"row",children:[(0,i.jsx)(r.Ay,{children:(0,i.jsx)(T.A,{alignItems:"center",justifyContent:"center",position:"relative",children:(0,i.jsx)(ex.g,{currency0:null!=j?j:void 0,currency1:null!=y?y:void 0,size:48,innerMargin:"2px",showChainLogoCurrency1:!0})})}),(0,i.jsxs)(B.A,{gap:"4px",alignItems:"center",children:[(0,i.jsx)(C.A,{bold:!0,fontSize:32,style:{lineHeight:"1"},children:null==j?void 0:j.symbol}),(0,i.jsx)(C.A,{color:"textSubtle",bold:!0,fontSize:32,style:{lineHeight:"1"},children:"/"}),(0,i.jsx)(C.A,{bold:!0,fontSize:32,style:{lineHeight:"1"},children:null==y?void 0:y.symbol})]}),(0,i.jsx)(n1.z,{content:(0,i.jsxs)(B.A,{gap:"4px",flexDirection:"column",minWidth:"150px",children:[(0,i.jsxs)(B.A,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(B.A,{gap:"8px",children:(0,i.jsx)(C.A,{children:p("NFT mint:")})}),(0,i.jsxs)(B.A,{gap:"4px",children:[m?(0,i.jsx)(eZ.A,{target:"_blank",href:(0,nd.cT)(m,"address",k.host),children:(0,i.jsx)(nY.A,{width:16,height:16,color:"primary60"})}):null,(0,i.jsx)(nz.i,{text:null!=(a=null==E?void 0:E.nftMint.toBase58()
1)?a:"",tooltipMessage:p("NFT mint copied"),width:"16px",height:"16px"})]})]}),(0,i.jsxs)(B.A,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsxs)(B.A,{gap:"8px",children:[(0,i.jsx)(F.Z,{currency:null!=j?j:void 0,size:"24px"}),(0,i.jsx)(C.A,{children:null==j?void 0:j.symbol})]}),(null==j?void 0:j.isToken)&&(null==j||null==(e=j.wrapped)?void 0:e.address)&&(0,i.jsxs)(B.A,{gap:"4px",children:[(0,i.jsx)(eZ.A,{target:"_blank",href:(0,nd.cT)(null==j||null==(n=j.wrapped)?void 0:n.address,"address",k.host),children:(0,i.jsx)(nY.A,{width:16,height:16,color:"primary60"})}),(0,i.jsx)(nz.i,{text:null!=(c=null==j||null==(t=j.wrapped)?void 0:t.address)?c:"",tooltipMessage:p("Token address copied"),width:"16px",height:"16px"})]})]}),(0,i.jsxs)(B.A,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsxs)(B.A,{gap:"8px",children:[(0,i.jsx)(F.Z,{currency:null!=y?y:void 0,size:"24px"}),(0,i.jsx)(C.A,{children:null==y?void 0:y.symbol})]}),(null==y?void 0:y.isToken)&&(null==y||null==(o=y.wrapped)?void 0:o.address)&&(0,i.jsxs)(B.A,{gap:"4px",children:[(0,i.jsx)(eZ.A,{target:"_blank",href:(0,nd.cT)(null==y||null==(s=y.wrapped)?void 0:s.address,"address",k.host),children:(0,i.jsx)(nY.A,{width:16,height:16,color:"primary60"})}),(0,i.jsx)(nz.i,{text:null!=(x=null==y||null==(d=y.wrapped)?void 0:d.address)?x:"",tooltipMessage:p("Token address copied"),width:"16px",height:"16px"})]})]})]}),children:(0,i.jsx)(r.Ay,{height:24,width:24,children:(0,i.jsx)(I.A,{width:24,height:24,src:k.icon,alt:k.name})})})]}),(0,i.jsxs)(B.A,{gap:"16px",flexWrap:"wrap",alignItems:"center",alignContent:"center",children:[(0,i.jsx)(ec.mm,{rowGap:"4px",children:(0,i.jsx)(r.Ay,{children:(0,i.jsx)(nJ.Q,{type:l.Zs.V3,percent:P,showType:!1})})}),(null==M?void 0:M.isFarming)?(0,i.jsx)(ed.A,{variant:"primary60",children:p("Farming")}):null,(0,i.jsx)(em.K,{lowContrast:!0,outOfRange:(null==E?void 0:E.status)===eU.$.INACTIVE,removed:null==E?void 0:E.liquidity.isZero()})]})]})}),(0,i.jsxs)(B.A,{gap:"16px",flexDirection:["column",null,"row"],children:[(0,i.jsxs)(r.Ay,{p:"8px 16px",width:"100%",children:[(0,i.jsxs)(B.A,{gap:"8px",alignItems:"center",children:[(0,i.jsx)(C.A,{fontSize:12,bold:!0,color:"textSubtle",textTransform:"uppercase",style:{userSelect:"none"},children:p("Current Price")}),(0,i.jsx)(nH.A,{color:"primary60",onClick:()=>R(!z),style:{cursor:"pointer"}})]}),(0,i.jsxs)(B.A,{mt:"2px",gap:"8px",alignItems:"center",width:"100%",children:[(0,i.jsx)(C.A,{fontSize:28,bold:!0,width:"max-content",children:(0,q.ZV)(Number(null!=D?D:0),{maximumSignificantDigits:6,maxDecimalDisplayDigits:6})}),(0,i.jsx)(C.A,{fontSize:12,color:"textSubtle",textTransform:"uppercase",width:"max-content",children:p("%assetA% = 1 %assetB%",z?{assetA:null==j?void 0:j.symbol,assetB:null==y?void 0:y.symbol}:{assetA:null==y?void 0:y.symbol,assetB:null==j?void 0:j.symbol})})]})]}),(0,i.jsx)(n0.k0,{padding:"8px 16px",children:(0,i.jsxs)(ec.mm,{rowGap:"2px",children:[(0,i.jsx)(B.A,{children:(0,i.jsx)(C.A,{fontSize:12,bold:!0,color:"textSubtle",textTransform:"uppercase",minWidth:"max-content",children:p("Est. APR")})}),M&&E?(0,i.jsx)(eX.uu,{pool:M,userPosition:E,textProps:{fontSize:"32px",fontWeight:600,color:"secondary"}}):null]})})]})]})})})};var n3=t(888178),n5=t(456194),n7=t(218090),n9=t(632259),te=t(393851),tn=t(227432),tt=t(382425),ti=t(397261),tl=t(43838),tr=t(561767),to=t(542160),ts=t(697300),td=t(13978);let ta=e=>{let{position:n,poolInfo:t}=e,{poolId:l}=h(),[o]=(0,n8.$)(),s=!o,{t:d}=(0,A.A)(),a=(0,J.DP)(),{isDark:c}=(0,n3.Ay)(),{formattedData:x,isLoading:p,error:m}=(0,td.O)(l),j=(0,u.useMemo)(()=>{if(!t.price)return 0;let e=new ts.A(t.price);return nL.gyQ.getTickWithPriceAndTickspacing(s?e:new ts.A(1).div(e),t.config.tickSpacing,t.mintA.decimals,t.mintB.decimals)},[t,s]),[y,f,g]=(0,u.useMemo)(()=>{var e;let{tickSpacing:i}=t.config,l=null!=(e=t.tickCurrent)?e:j,r=nL.P3F.nearestUsableTick(l,i);return[r,nL.P3F.nearestUsableTick(n.tickLower,i),nL.P3F.nearestUsableTick(n.tickUpper,i)]},[t.tickCurrent,t.config.tickSpacing,n.tickLower,n.tickUpper,j]),b=(0,u.useMemo)(()=>
1{if(!x||0===x.length)return[];let e=x,n=x.length,t=g-f;if(n/t>=2){let n=.2*t,i=f-n,l=g+n;e=x.filter(e=>e.tick>=i&&e.tick<=l)}return e.sort((e,n)=>s?e.tick-n.tick:n.tick-e.tick)},[x,f,g,s]),[I,k,P]=(0,u.useMemo)(()=>{let{tickSpacing:e}=t.config,n=b.find(e=>e.tick===f),i=b.find(e=>e.tick===y),l=b.find(e=>e.tick===g);return!i&&b.length&&(i=b.reduce((e,n)=>n.tick<y?n.tick>e.tick?n:e:n.tick>y&&Math.abs(n.tick-y)<Math.abs(e.tick-y)?n:e,b[0])),[s?null==n?void 0:n.price0:null==l?void 0:l.price1,s?null==i?void 0:i.price0:null==i?void 0:i.price1,s?null==l?void 0:l.price0:null==n?void 0:n.price1]},[b,y,f,g,s,t.config.tickSpacing]),F=(0,u.useMemo)(()=>{var e;if(!t.tickCurrent)return;let n=nL.P3F.getTickPrice({poolInfo:t,tick:null!=(e=t.tickCurrent)?e:j,baseIn:s}).price.toFixed(18);return 1>Number(n)?(0,q.ZV)(n,{maximumDecimalTrailingZeroes:4}):(0,q.ZV)(n,{maxDecimalDisplayDigits:2})},[t.tickCurrent,j,s]),z=(0,u.useMemo)(()=>y>=f&&y<=g?a.colors.success:a.colors.failure,[y,f,g,a.colors.success,a.colors.failure]),R=(0,u.useMemo)(()=>{let e=0;for(let n of b)n.liquidity>e&&(e=n.liquidity);return e},[b]),[D,E]=(0,u.useState)(void 0),[$,N]=(0,u.useState)(void 0),[L,Z]=(0,u.useState)(void 0);return p?(0,i.jsx)(v.A,{children:(0,i.jsx)(S.A,{children:(0,i.jsx)(T.A,{height:"300px",justifyContent:"center",alignItems:"center",children:(0,i.jsx)(w.A,{})})})}):m||!b.length?(0,i.jsx)(v.A,{children:(0,i.jsx)(S.A,{children:(0,i.jsx)(T.A,{height:"300px",justifyContent:"center",alignItems:"center",children:(0,i.jsx)(C.A,{color:"textSubtle",children:m?"Failed to load chart data":"No liquidity data available"})})})}):(0,i.jsx)(v.A,{style:{alignSelf:"start"},children:(0,i.jsxs)(S.A,{p:32,children:[(0,i.jsx)(tx,{x0:L,x1:D,x2:$,position:n,poolInfo:t,baseIn:s,rangeColor:z}),(0,i.jsx)(n7.u,{width:"100%",height:300,children:(0,i.jsxs)(n9.E,{data:b,barCategoryGap:0,barGap:0,margin:{top:20,right:0,left:0,bottom:8},children:[(0,i.jsx)("defs",{children:(0,i.jsxs)("linearGradient",{id:"liquidityGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,i.jsx)("stop",{offset:"5%",stopColor:c?"rgba(168, 129, 252, 0.8)":"rgba(118, 69, 217, 0.8)",stopOpacity:.8}),(0,i.jsx)("stop",{offset:"95%",stopColor:c?"rgba(168, 129, 252, 0.3)":"rgba(118, 69, 217, 0.3)",stopOpacity:.8})]})}),(0,i.jsx)(te.W,{dataKey:s?"price0":"price1",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:a.colors.textSubtle},tickFormatter:e=>{var n;return null!=(n=(0,n5.e)(e,{precision:2}))?n:""}}),(0,i.jsx)(tn.h,{hide:!0,axisLine:!1,tickLine:!1,domain:[0,R]}),k&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tt.e,{x:k,stroke:a.colors.secondary,strokeWidth:2,children:(0,i.jsx)(ti.J,{value:null!=F?F:"",position:"top",style:{fill:a.colors.secondary,fontSize:"12px",fontWeight:"bold"}})}),(0,i.jsx)(tt.e,{x:k,stroke:a.colors.secondary,strokeWidth:1,shape:e=>(0,i.jsx)(tc,{x1:e.x1,onEffect:Z,baseIn:s})})]}),I&&P&&(0,i.jsx)(tl.T,{x1:I,x2:P,fill:z,fillOpacity:.1}),I&&P&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tt.e,{segment:[{x:I,y:R},{x:P,y:R}],stroke:z,position:"start",strokeWidth:0,shape:e=>(0,i.jsx)(tc,{x1:e.x1,onEffect:E,baseIn:s})}),(0,i.jsx)(tt.e,{segment:[{x:I,y:R},{x:P,y:R}],stroke:z,position:"end",strokeWidth:0,shape:e=>(0,i.jsx)(tu,{x2:e.x2,onEffect:N,baseIn:s})})]}),I&&(0,i.jsx)(tt.e,{position:"start",x:I,stroke:z,strokeWidth:2}),P&&(0,i.jsx)(tt.e,{position:"end",x:P,stroke:z,strokeWidth:2}),(0,i.jsx)(tr.y,{dataKey:"liquidity",fill:"url(#liquidityGradient)",isAnimationActive:!1})]})}),(0,i.jsxs)(M.eF,{justifyContent:"space-between",children:[(0,i.jsxs)(B.A,{alignItems:"center",gap:"4px",children:[(0,i.jsx)(r.Ay,{style:{width:"7px",height:"7px",left:"0px",top:"6px",background:a.colors.secondary,borderRadius:"10px"}}),(0,i.jsxs)(C.A,{fontSize:"12px",lineHeight:1.5,children:[d("Current Price")," "]})]}),(0,i.jsxs)(B.A,{alignItems:"center",gap:"4px",children:[(0,i.jsx)(C.A,{fontSize:"12px",lineHeight:1.5,fontWeight:600,children:F}),(0,i.jsx)(C.A,{fontSize:"12px",lineHeight:1.5,color:"textSubtle",children:d("%subA% per %subB%",{subA:t.mintB.symbol,subB:t.mintA.symbol})})]})]})]})})},tc=e=>{let{x1:n,onEffect:t,baseIn:l}=e;return(0,u.useEffect)(()=>{t(n)},[n,l]),(0,i.jsx)(i.Fragment,{})},tu=e=>{let{x2:n,onEffect:t,baseIn:l}=e;return(0,u.useEffect)(()=>{t(n)},[n,l]),(0,i.jsx)(i.Fragment,{})},tx=e=>{let{position:n,poolInfo:t,baseIn:l,x1:o,x2:s,x0:d,rangeColor:a}=e;return(0,i.jsxs)(ec.mm,{width:"100%",py:"8px",gap:"4px",children:[(0,i.jsx)(tp,{x1:o,x2:s,position:n,baseIn:l,poolInfo:t}),(0,i.jsxs)(r.Ay,{width:"100%",position:"relative",children:[(0,i.jsx)(tm,{}),void 0!==o&&void 0!==s?(0,i.jsx)(tj,{left:o,right:s,rangeColor:a}):null,void 0!==d?(0,i.jsx)(th,{left:d}):null]})]})},tp=e=>{let{x1:n,x2:t,position:l,baseIn:o,poolInfo:s}=e,{minPriceFormatted:d,minPercentage:a,maxPriceFormatted:c,maxPercentage:x}=(0,to.Q)({tickLower:l.tickLower,tickUpper:l.tickUpper,baseIn:o,poolInfo:s}),p="0"!==d?(0,q.ZV)(d,1>Number(d)?{maximumDecimalTrailingZeroes:4}:{maxDecimalDisplayDigits:4}):"0",m="∞"!==c?(0,q.ZV)(c,1>Number(c)?{maximumDecimalTrailingZeroes:4}:{maxDecimalDisplayDigits:4}):"∞",h=(0,u.useRef)(null),j=(0,u.useRef)(null);(0,nu.aq)();let[y,f]=(0,u.useState)(void 0),[g,A]=(0,u.useState)(void 0),v=(0,u.useMemo)(()=>!!y&&!!g&&g+y>t-n,[y,g,n,t]);return(0,u.useEffect)(()=>
1{if(h.current&&j.current){var e,n;f(null==(e=h.current)?void 0:e.clientWidth),A(null==(n=j.current)?void 0:n.clientWidth)}},[n,t]),(0,i.jsx)(r.Ay,{width:"100%",position:"relative",height:"30px",children:(0,i.jsx)(ty,{left:n,right:t,children:(0,i.jsxs)(M.eF,{justifyContent:"space-between",flexWrap:"nowrap",children:[(0,i.jsx)(ec.mm,{alignItems:"flex-start",children:(0,i.jsxs)(tf,{distance:-(null!=y?y:0)/2,enabled:v,children:[(0,i.jsx)(C.A,{fontSize:"12px",lineHeight:1.5,fontWeight:600,ref:h,children:p}),(0,i.jsx)(C.A,{fontSize:"10px",color:"textSubtle",children:a})]})}),(0,i.jsx)(ec.mm,{alignItems:"flex-end",children:(0,i.jsxs)(tf,{distance:(null!=g?g:0)/2,enabled:v,children:[(0,i.jsx)(C.A,{fontSize:"12px",lineHeight:1.5,fontWeight:600,ref:j,children:m}),(0,i.jsx)(C.A,{fontSize:"10px",color:"textSubtle",textAlign:"right",children:x})]})})]})})})},tm=J.Ay.div.withConfig({componentId:"sc-b4190003-0"})(["position:absolute;top:0;left:0;width:100%;height:5px;border-radius:8px;background:",";border:0.5px solid ",";"],e=>{let{theme:n}=e;return n.colors.disabled},e=>{let{theme:n}=e;return n.colors.inputSecondary}),th=J.Ay.div.withConfig({componentId:"sc-b4190003-1"})(["position:absolute;top:-2px;left:","px;width:5px;height:12px;border-radius:16px;background:",";&:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%227%22%20height%3D%227%22%20viewBox%3D%220%200%207%207%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1.14844%202.4598C0.803786%201.79417%201.28689%201%202.03646%201H4.96209C5.71165%201%206.19476%201.79417%205.85011%202.4598L4.38729%205.28495C4.01435%206.00522%202.98419%206.00522%202.61125%205.28495L1.14844%202.4598Z%22%20fill%3D%22%237645D9%22%20stroke%3D%22white%22%2F%3E%3C%2Fsvg%3E);background-size:cover;background-repeat:no-repeat;content:'';position:absolute;top:-5px;left:-1px;width:7px;height:6px;}"],e=>{let{left:n}=e;return n-2.5},e=>{let{theme:n}=e;return n.colors.secondary}),tj=J.Ay.div.withConfig({componentId:"sc-b4190003-2"})(["position:absolute;top:0;left:","px;width:","px;height:5px;border-radius:8px;background:",";"],e=>{let{left:n}=e;return n},e=>{let{right:n,left:t}=e;return n-t},e=>{let{rangeColor:n}=e;return n}),ty=J.Ay.div.withConfig({componentId:"sc-b4190003-3"})(["position:absolute;height:30px;top:0;left:","px;width:","px;"],e=>{let{left:n}=e;return n},e=>{let{right:n,left:t}=e;return n-t}),tf=J.Ay.div.withConfig({componentId:"sc-b4190003-4"})(["",""],e=>{let{distance:n,enabled:t}=e;return t&&`
2    transform: translateX(${n}px);
3  `});var tg=t(371309),tA=t(955647),tv=t(242312),tb=t.n(tv),tw=t(98378),tI=t(59299),tk=t(188882),tC=t(748853),tS=t(200604);let tT=async(e,n)=>{let t=(await e.getTokenLargestAccounts(new nZ.PublicKey(n))).value.find(e=>"1"===e.amount);if(!t)return null;let i=await e.getAccountInfo(t.address);return i?new nZ.PublicKey(i.data.slice(32,64)).toBase58():null},tB=J.Ay.div.withConfig({componentId:"sc-9fc108c3-0"})(["width:100%;height:8px;background:linear-gradient( to right,"," 0% ","%,"," ","% 100% );border-radius:4px;margin:8px 0;"],e=>{let{theme:n,ratio:t}=e;return n.colors.primary},e=>{let{ratio:n}=e;return n},e=>{let{theme:n,ratio:t}=e;return n.colors.secondary},e=>{let{ratio:n}=e;return n}),tM=J.Ay.div.withConfig({componentId:"sc-9fc108c3-1"})(["display:flex;align-items:center;gap:8px;margin-bottom:8px;"]),tP=J.Ay.div.withConfig({componentId:"sc-9fc108c3-2"})([""]),tq=J.Ay.div.withConfig({componentId:"sc-9fc108c3-3"})(["display:flex;gap:16px;margin-top:8px;flex-wrap:wrap;"]),tF=J.Ay.div.withConfig({componentId:"sc-9fc108c3-4"})(["display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:120px;"]),tz=e=>{var n,t;let{position:l,poolInfo:r,...o}=e,{t:s}=(0,A.A)(),{solanaAccount:d}=(0,eq.W7)(),{isOwner:a}=((e,n)=>{let{data:t,isLoading:i}=(e=>{let n=(0,nW.W)();return(0,nO.I)({queryKey:["solana-v3-mint-owner",e],queryFn:async()=>e&&n?tT(n,e):null,enabled:!!e&&!!n,staleTime:1/0})})(e);return{isOwner:!!t&&!!n&&t===n,isLoading:i}})(l.nftMint.toBase58(),d),c=(0,u.useMemo)(()=>(0,nD.ph)((0,nL.c8D)(r.rawPool.mintA)),[r.rawPool.mintA]),x=(0,u.useMemo)(()=>
3(0,nD.ph)((0,nL.c8D)(r.rawPool.mintB)),[r.rawPool.mintB]),{amount0:p,amount1:m}=(0,tw.y)({poolInfo:r.rawPool,tickLower:l.tickLower,tickUpper:l.tickUpper,liquidity:l.liquidity}),{totalUsdValue:h}=(0,tI.T)({poolInfo:r.rawPool,tickLower:l.tickLower,tickUpper:l.tickUpper,liquidity:l.liquidity}),{ratio0:j,ratio1:y}=(0,tw.R)({poolInfo:r.rawPool,tickLower:l.tickLower,tickUpper:l.tickUpper,liquidity:new(tb())(1e4)}),{breakdownRewardInfo:f,totalPendingYield:g}=(0,tk.n)({poolInfo:r,position:l}),b=(0,u.useMemo)(()=>{if(!h)return"$0.0000";let e=h.toNumber();return(0,tC.l)(e)},[h]),w=(0,u.useMemo)(()=>{if(!g)return"$0.0000";let e=g.toNumber();return(0,tC.l)(e)},[g]),I=(0,u.useMemo)(()=>j?`${(0,tA.l9)(j,2)}%`:"0.00%",[j]),k=(0,u.useMemo)(()=>y?`${(0,tA.l9)(y,2)}%`:"0.00%",[y]),F=(0,u.useMemo)(()=>{let e=[];return f.fee.A&&Number(f.fee.A.amount)>0&&e.push({token:(0,nD.ph)(f.fee.A.mint),amount:(0,q.ZV)(Number(f.fee.A.amount)),usdValue:`~$${f.fee.A.amountUSD}`}),f.fee.B&&Number(f.fee.B.amount)>0&&e.push({token:(0,nD.ph)(f.fee.B.mint),amount:(0,q.ZV)(Number(f.fee.B.amount)),usdValue:`~$${f.fee.B.amountUSD}`}),e},[f.fee]),z=(0,u.useMemo)(()=>f.rewards.filter(e=>Number(e.amount)>0).map(e=>({token:(0,nD.ph)(e.mint),amount:(0,q.ZV)(Number(e.amount)),usdValue:`~$${e.amountUSD}`})),[f.rewards]);return(0,i.jsx)(v.A,{...o,children:(0,i.jsx)(S.A,{children:(0,i.jsxs)(ec.mm,{gap:"16px",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(P.y,{textTransform:"uppercase",color:"textSubtle",mb:"8px",children:s("POSITION")}),(0,i.jsx)(C.A,{fontSize:"24px",bold:!0,mb:"16px",children:b}),(0,i.jsxs)(T.A,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsxs)(tM,{children:[(0,i.jsx)(tg.A,{srcs:(0,eh.ig)(c),sizes:"xs",width:24,height:24,style:{borderRadius:"50%"}}),(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",children:null==c?void 0:c.symbol})]}),(0,i.jsxs)(tM,{children:[(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",children:null==x?void 0:x.symbol}),(0,i.jsx)(tg.A,{srcs:(0,eh.ig)(x),sizes:"xs",width:24,height:24,style:{borderRadius:"50%"}})]})]}),(0,i.jsxs)(T.A,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsx)(C.A,{fontSize:"16px",children:(0,q.ZV)(null!=(n=null==p?void 0:p.toExact())?n:0)}),(0,i.jsx)(C.A,{fontSize:"16px",children:(0,q.ZV)(null!=(t=null==m?void 0:m.toExact())?t:0)})]}),(0,i.jsx)(tB,{ratio:j?Number((0,tA.l9)(j,2)):0}),(0,i.jsxs)(T.A,{justifyContent:"space-between",mb:"8px",children:[(0,i.jsx)(C.A,{fontSize:"12px",children:I}),(0,i.jsx)(C.A,{fontSize:"12px",children:k})]}),(0,i.jsxs)(M.JA,{children:[(0,i.jsxs)(C.A,{fontSize:"14px",color:"textSubtle",children:[s("Deposit Ratio"),":"]}),(0,i.jsxs)(C.A,{fontSize:"14px",children:[(0,tA.l9)(j,2),"% ",null==c?void 0:c.symbol," / ",(0,tA.l9)(y,2),"% ",null==x?void 0:x.symbol]})]})]}),(0,i.jsx)(E.A,{}),(0,i.jsxs)(tP,{children:[(0,i.jsx)(P.y,{textTransform:"uppercase",color:"textSubtle",mb:"8px",children:s("EARNINGS")}),(0,i.jsx)(C.A,{fontSize:"24px",bold:!0,mb:"16px",children:w}),F.length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)(C.A,{fontSize:"16px",bold:!0,mb:"8px",children:s("LP Fees")}),(0,i.jsx)(tq,{children:F.map((e,n)=>{var t;return(0,i.jsxs)(tF,{children:[(0,i.jsxs)(B.A,{alignItems:"center",gap:"8px",children:[(0,i.jsx)(tg.A,{srcs:(0,eh.ig)(e.token),sizes:"xs",width:24,height:24,style:{borderRadius:"50%"}}),(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",children:null==(t=e.token)?void 0:t.symbol})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(C.A,{fontSize:"16px",children:e.amount}),(0,i.jsx)(C.A,{fontSize:"12px",color:"textSubtle",children:e.usdValue})]})]},`lp-fee-${n}`)})})]}),z.length>0&&(0,i.jsxs)("div",{style:{marginTop:"16px"},children:[(0,i.jsx)(C.A,{fontSize:"16px",bold:!0,mb:"8px",children:s("Farm Rewards")}),(0,i.jsx)(tq,{children:z.map((e,n)=>{var t;return(0,i.jsxs)(tF,{children:[(0,i.jsxs)(B.A,{alignItems:"center",gap:"8px",children:[(0,i.jsx)(tg.A,{srcs:(0,eh.ig)(e.token),sizes:"xs",width:24,height:24,style:{borderRadius:"50%"}}),(0,i.jsx)(C.A,{fontSize:"14px",color:"textSubtle",children:null==(t=e.token)?void 0:t.symbol})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(C.A,{fontSize:"16px",children:e.amount}),(0,i.jsx)(C.A,{fontSize:"12px",color:"textSubtle",children:e.usdValue})]})]},`farm-reward-${n}`)})})]})]}),a?(0,i.jsx)(tS.u,{detailMode:!0,removed:l.liquidity.isZero(),poolInfo:r,position:l}):null]})})})},tR=(0,J.Ay)(nF.A).withConfig({componentId:"sc-aa68c36d-0"})(["@media screen and (min-width:370px){padding-left:12px;padding-right:12px;}","{padding-left:24px;padding-right:24px;}"],e=>{let{theme:n}=e;return n.mediaQueries.sm}),tD=()=>{let{poolId:e,mintId:n}=h(),t=nG(n),l=nQ(),r=(0,nP.jN)(),[o,s]=(0,u.useState)("solana"),{isMobile:d,isMd:a}=(0,es.A)();return(0,i.jsxs)(nq.S3.Provider,{value:e=>{s(null!=e?e:"solana"),r.setIsOpen(!0)},children:[(0,i.jsx)(tR,{children:(0,i.jsxs)(ec.mm,{gap:["16px",null,null,"32px"],children:[(0,i.jsx)(nK,{}),(0,i.jsx)(n6,{}),(0,i.jsx)(ec.mm,{gap:"lg",children:(0,i.jsxs)(b.A,{gridGap:"24px",gridTemplateColumns:["1fr","1fr","1fr","2fr 1fr"],children:[t&&l&&e&&(0,i.jsx)(ta,{poolId:e,position:t,poolInfo:l.rawPool}),t&&l&&e&&(0,i.jsx)(tz,{position:t,poolInfo:l,style:{order:d||a?-1:0}})]})})]})}),r.isOpen&&(0,i.jsx)(nq.g6,{isOpen:r.isOpen,onDismiss:r.onDismiss,defaultTab:o})]})},tE=()=>
3{let{routeParams:e,routeError:n,protocol:t,action:s}=x();return n?(console.error(n),(0,i.jsx)(f.default,{})):e?"increase"===s?(0,i.jsx)(r.Ay,{my:"24px",children:(0,i.jsx)(eE,{})}):"decrease"===s?(0,i.jsxs)(r.Ay,{my:"24px",children:[t===l.Zs.InfinityCLAMM&&(0,i.jsx)(nb,{}),t===l.Zs.InfinityBIN&&(0,i.jsx)(nM,{})]}):t===l.Zs.InfinityCLAMM?(0,i.jsx)(nc,{}):t===l.Zs.InfinityBIN?(0,i.jsx)(e3,{}):t===l.Zs.V3&&"solana"===e.positionId[1]?(0,i.jsx)(tD,{}):null:(0,i.jsx)(o.A,{})},t$=y()(()=>Promise.resolve(tE),{ssr:!1});t$.chains=g.tx;let tN=t$},876089:(e,n,t)=>{"use strict";t.d(n,{A:()=>x});var i=t(350979),l=t(680797),r=t(25963),o=t(769932),s=t(178405),d=t(575058),a=t(605641),c=t(557423);let u=l.I4.div.withConfig({componentId:"sc-7851d89b-0"})(["align-items:center;display:flex;flex-direction:column;height:calc(100vh - 64px);justify-content:center;"]),x=e=>{let{statusCode:n=404,children:t,LinkComp:l}=e,{t:x}=(0,o.A)(),p=(0,r.createElement)(l,{href:"/",passHref:!0},(0,i.jsx)(c.A,{scale:"sm",children:x("Back Home")}));return(0,i.jsxs)(i.Fragment,{children:[t,(0,i.jsxs)(u,{children:[(0,i.jsx)(s.A,{width:"64px",mb:"8px"}),(0,i.jsx)(d.A,{scale:"xxl",children:n}),(0,i.jsx)(a.A,{mb:"16px",children:x("Oops, page not found.")}),p]})]})}},927122:(e,n,t)=>{"use strict";t.d(n,{A:()=>d});var i=t(350979),l=t(680797),r=t(554945),o=t(814795);let s=(0,l.I4)(o.A).withConfig({componentId:"sc-c1354ddc-0"})(["display:flex;justify-content:center;align-items:center;"]),d=()=>(0,i.jsx)(s,{children:(0,i.jsx)(r.A,{})})}},e=>{e.O(0,[7964,3821,5139,7578,3732,4306,4374,3892,2845,7121,7061,9596,2141,3577,6341,8516,2806,6270,7881,143,2259,3387,6175,2299,7969,7618,2560,7212,1480,6335,4711,9818,7635,64,2775,8269,6283,5018,9508,4712,7287,4641,8686,8837,6010,4522,4586,2911,2269,3484,770,245,7094,7869,2457,1729,7207,6763,3189,604,636,6593,8792],()=>e(e.s=536881)),_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.