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ACjB,SAACe,EAAAA,GAAU,CAACE,IAAI,KAAKgB,QAAQ,S,UAC3B,SAAChC,EAAAA,EAAI,CAACC,UAAU,SAASiC,WAAY,I,SAClCrE,EAAE,uBAIPW,IAAcM,EAAAA,GAAAA,SAChB,SAACgB,EAAAA,GAAS,CAACC,QAAQ,Y,UACjB,SAACe,EAAAA,GAAU,CAACE,IAAI,KAAKgB,QAAQ,S,UAC3B,UAAChC,EAAAA,EAAI,CAACC,UAAU,S,UACbpC,EAAE,YACH,SAACsE,EAAAA,EAAI,WAIT,KAEJtC,a","sources":["webpack://_N_E/?7d08","webpack://_N_E/./src/views/PoolFinder/index.tsx","webpack://_N_E/./src/pages/find.tsx"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/find\",\n function () {\n return require(\"private-next-pages/find.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/find\"])\n });\n }\n ","import { useCallback, useEffect, useState } from 'react'\nimport { Currency, ETHER, JSBI, TokenAmount } from '@pancakeswap/sdk'\nimport { Button, ChevronDownIcon, Text, AddIcon, useModal } from '@pancakeswap/uikit'\nimport styled from 'styled-components'\nimport { useTranslation } from 'contexts/Localization'\nimport { NextLinkFromReactRouter } from 'components/NextLink'\nimport { useAccount } from 'wagmi'\nimport { BIG_INT_ZERO } from 'config/constants/exchange'\nimport { LightCard } from '../../components/Card'\nimport { AutoColumn, ColumnCenter } from '../../components/Layout/Column'\nimport { CurrencyLogo } from '../../components/Logo'\nimport { MinimalPositionCard } from '../../components/PositionCard'\nimport Row from '../../components/Layout/Row'\nimport CurrencySearchModal from '../../components/SearchModal/CurrencySearchModal'\nimport { PairState, usePair } from '../../hooks/usePairs'\nimport { usePairAdder } from '../../state/user/hooks'\nimport { useTokenBalance } from '../../state/wallet/hooks'\nimport { currencyId } from '../../utils/currencyId'\nimport Dots from '../../components/Loader/Dots'\nimport { AppHeader, AppBody } from '../../components/App'\nimport Page from '../Page'\n\nenum Fields {\n TOKEN0 = 0,\n TOKEN1 = 1,\n}\n\nconst StyledButton = styled(Button)`\n background-color: ${({ theme }) => theme.colors.input};\n color: ${({ theme }) => theme.colors.text};\n box-shadow: none;\n border-radius: 4px;\n`\n\nexport default function PoolFinder() {\n const { address : account } = useAccount()\n const { t } = useTranslation()\n\n const [activeField, setActiveField] = useState(Fields.TOKEN1)\n const [currency0, setCurrency0] = useState(ETHER)\n const [currency1, setCurrency1] = useState(null)\n\n const [pairState, pair] = usePair(currency0 ?? undefined, currency1 ?? undefined)\n const addPair = usePairAdder()\n useEffect(() => {\n if (pair) {\n addPair(pair)\n }\n }, [pair, addPair])\n\n const validPairNoLiquidity: boolean =\n pairState === PairState.NOT_EXISTS ||\n Boolean(\n pairState === PairState.EXISTS &&\n pair &&\n JSBI.equal(pair.reserve0.raw, BIG_INT_ZERO) &&\n JSBI.equal(pair.reserve1.raw, BIG_INT_ZERO),\n )\n\n const position: TokenAmount | undefined = useTokenBalance(account ?? undefined, pair?.liquidityToken)\n const hasPosition = Boolean(position && JSBI.greaterThan(position.raw, BIG_INT_ZERO))\n\n const handleCurrencySelect = useCallback(\n (currency: Currency) => {\n if (activeField === Fields.TOKEN0) {\n setCurrency0(currency)\n } else {\n setCurrency1(currency)\n }\n },\n [activeField],\n )\n\n const prerequisiteMessage = (\n \n \n {!account ? t('Connect to a wallet to find pools') : t('Select a token to find your liquidity.')}\n \n \n )\n\n const [onPresentCurrencyModal] = useModal(\n ,\n true,\n true,\n 'selectCurrencyModal',\n )\n\n return (\n \n \n \n \n }\n onClick={() => {\n onPresentCurrencyModal()\n setActiveField(Fields.TOKEN0)\n }}\n >\n {currency0 ? (\n \n \n {currency0.symbol}\n \n ) : (\n {t('Select a Token')}\n )}\n \n\n \n \n \n\n }\n onClick={() => {\n onPresentCurrencyModal()\n setActiveField(Fields.TOKEN1)\n }}\n >\n {currency1 ? (\n \n \n {currency1.symbol}\n \n ) : (\n {t('Select a Token')}\n )}\n \n\n {currency0 && currency1 ? (\n pairState === PairState.EXISTS ? (\n hasPosition && pair ? (\n <>\n \n \n \n ) : (\n \n \n {t('You don’t have liquidity in this pool yet.')}\n \n {t('Add Liquidity')}\n \n \n \n )\n ) : validPairNoLiquidity ? (\n \n \n {t('No pool found.')}\n \n {t('Create pool')}\n \n \n \n ) : pairState === PairState.INVALID ? (\n \n \n \n {t('Invalid pair.')}\n \n \n \n ) : pairState === PairState.LOADING ? (\n \n \n \n {t('Loading')}\n \n \n \n \n ) : null\n ) : (\n prerequisiteMessage\n )}\n \n\n {/* */}\n \n \n )\n}\n","import PoolFinder from '../views/PoolFinder'\n\nexport default PoolFinder\n"],"names":["window","__NEXT_P","push","Fields","TOKEN0","TOKEN1","StyledButton","styled","Button","theme","colors","input","text","address","useAccount","useTranslation","t","useState","activeField","setActiveField","ETHER","currency0","setCurrency0","currency1","setCurrency1","usePair","undefined","pairState","pair","addPair","usePairAdder","useEffect","validPairNoLiquidity","PairState","Boolean","JSBI","reserve0","raw","BIG_INT_ZERO","reserve1","position","useTokenBalance","account","liquidityToken","hasPosition","handleCurrencySelect","useCallback","currency","prerequisiteMessage","LightCard","padding","Text","textAlign","onPresentCurrencyModal","useModal","CurrencySearchModal","onCurrencySelect","showCommonBases","selectedCurrency","Page","AppBody","AppHeader","title","subtitle","backTo","AutoColumn","style","gap","endIcon","ChevronDownIcon","onClick","Row","CurrencyLogo","ml","symbol","ColumnCenter","AddIcon","as","MinimalPositionCard","NextLinkFromReactRouter","to","variant","width","justify","currencyId","fontWeight","Dots"],"sourceRoot":""}