@dcl/shop 1.12.2-34971053975.commit-a7f84c8 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-B6ikNqvo.js → Activity-DG1X3r7j.js} +6 -6
- package/_assets/{AnimatedBackground-BMb7rvun.js → AnimatedBackground-BnW4jNQ_.js} +6 -6
- package/_assets/{Assets-DgMWcGQE.js → Assets-CamziJEW.js} +3 -3
- package/_assets/{Authorizations-B7xAIeF_.js → Authorizations-qhSo3l9v.js} +2 -2
- package/_assets/{Cart-CwBcJxTr.js → Cart-BdU4pPj2.js} +2 -2
- package/_assets/{Collection-DlHBHW6I.js → Collection-EQ6zO1YD.js} +2 -2
- package/_assets/{CollectionCarousel-BEo7WSno.js → CollectionCarousel-Crm-0uNM.js} +3 -3
- package/_assets/{Confetti-Dn8-JEM9.js → Confetti-BqpIfMO9.js} +4 -4
- package/_assets/{ConstantsUtil-BfeVP8OX.js → ConstantsUtil-BCzF6n74.js} +2 -2
- package/_assets/{ContentClient-BgiyWvaC.js → ContentClient-DJLeN-Hu.js} +2 -2
- package/_assets/{Creator-CVDhc4KI.js → Creator-C1ewJ_rt.js} +3 -3
- package/_assets/{DeploymentBuilder-CVfMLlHa.js → DeploymentBuilder-CtSJAkCg.js} +2 -2
- package/_assets/{EmotePlaybackBar-B62YEt9G.js → EmotePlaybackBar-DJ1CBzQj.js} +5 -5
- package/_assets/{ErrorNotice-CWVZqiKm.js → ErrorNotice-DFD2N4ZG.js} +2 -2
- package/_assets/{Event-DnCv7Xg4.js → Event-CGEg1Njh.js} +2 -2
- package/_assets/{ExchangeController-_gA6u_p7.js → ExchangeController-LNJTGsI4.js} +2 -2
- package/_assets/{Faq-ZShU0n7U.js → Faq-DBi3GpFN.js} +2 -2
- package/_assets/{GetCredits-Bj2YvP67.js → GetCredits-CilUrWIp.js} +2 -2
- package/_assets/{Grow-Crvwr5n9.js → Grow-DSgnoOPE.js} +2 -2
- package/_assets/{HelpersUtil-CuAlXmSB.js → HelpersUtil-CN_E4fkk.js} +2 -2
- package/_assets/ItemDetail-C-HJA8Wl.js +3751 -0
- package/_assets/{LoadMore-YxufSP26.js → LoadMore-C13YO4Ex.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-Bp7LjYRJ.js → ManaPricingBanner.styles-CiQXNidr.js} +2 -2
- package/_assets/{MyAssets-DaodAqcp.js → MyAssets-D1kA_br4.js} +2 -2
- package/_assets/{MyFavorites-Veqwi_3D.js → MyFavorites-Bg2VKyPe.js} +2 -2
- package/_assets/{NetworkUtil-BeQH6gwx.js → NetworkUtil-D1Xckx5t.js} +2 -2
- package/_assets/{NotFound-CVLknwBX.js → NotFound-Cciyw0_a.js} +2 -2
- package/_assets/{NotificationsBell-vJAXfuHR.js → NotificationsBell-DwmpPTnq.js} +13 -13
- package/_assets/{OutfitDetail-BEKvifMp.js → OutfitDetail-kCQ6HeTm.js} +2 -2
- package/_assets/{OutfitPreview-9sitM8AO.js → OutfitPreview-BHGSS1-V.js} +2 -2
- package/_assets/{OutfitStudio-Cj_PBpbg.js → OutfitStudio-BO_xeG9Z.js} +2 -2
- package/_assets/{StoreSettings-cnSJnEoU.js → StoreSettings-CjEaFFjf.js} +3 -3
- package/_assets/{Success-DSjHbwsm.js → Success-BOXdwFix.js} +2 -2
- package/_assets/{SwapController-D1yNpizk.js → SwapController-7Q3mgAr3.js} +2 -2
- package/_assets/{TradeService-C-Sp4nAs.js → TradeService-DoF1sJfB.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-DJCn0B4B.js → W3MFrameProviderSingleton-BLGKJTAV.js} +4 -4
- package/_assets/{WebCryptoP256-DdwSJwak.js → WebCryptoP256-DY58fkES.js} +2 -2
- package/_assets/{authorizations-DWBedPPC.js → authorizations-j1Fdv_CY.js} +2 -2
- package/_assets/{basic-F8T3s2s0.js → basic-ikWsaw57.js} +2 -2
- package/_assets/{biconomy-BYnpHohE.js → biconomy-D7jszzZX.js} +2 -2
- package/_assets/{browseLayout.styles-CUa0JgI7.js → browseLayout.styles-CzgQMQ68.js} +2 -2
- package/_assets/{browser-_u-u7Oe_.js → browser-BYr_ioqH.js} +2 -2
- package/_assets/{browser-BiTB4Srk.js → browser-Dhl29U0F.js} +2 -2
- package/_assets/{browser-ponyfill-CJDpXLMh.js → browser-ponyfill-DgxLup8s.js} +2 -2
- package/_assets/{builder-Dha-HVpq.js → builder-Qpv88cHd.js} +2 -2
- package/_assets/{buy-D5xK_7jz.js → buy-BKz4g0wV.js} +2 -2
- package/_assets/{buy-gasless-B2eSXOhX.js → buy-gasless-BxHAW80t.js} +2 -2
- package/_assets/{categories-CQewJ4Uc.js → categories-D8j8Cra5.js} +2 -2
- package/_assets/{ccip-CoPrnICo.js → ccip-BFtRvUNC.js} +2 -2
- package/_assets/{ccip-Cf1Ojagp.js → ccip-DUsbF98O.js} +2 -2
- package/_assets/{chains-hPvY0FLa.js → chains-ZMlAuLDk.js} +2 -2
- package/_assets/collectionPage.styles-DrR8c6dI.js +41 -0
- package/_assets/{common-BgWhpEag.js → common-M02sneWF.js} +2 -2
- package/_assets/{controller-D87zYpDU.js → controller-brAlSuK8.js} +3 -3
- package/_assets/{core-IQh9m55M.js → core-CoWTi1UJ.js} +5 -5
- package/_assets/{createSvgIcon-O6Ung3cJ.js → createSvgIcon-BiPKRVst.js} +2 -2
- package/_assets/{crumbs.styles-Cqk5FLiw.js → crumbs.styles-DZV0yuAO.js} +2 -2
- package/_assets/{custom-fzVZr1mw.js → custom-DkR7MyWb.js} +2 -2
- package/_assets/{data-capture-6sabeqek.js → data-capture-C0QIYOtX.js} +2 -2
- package/_assets/{dcl-schemas-CKztSOGI.js → dcl-schemas-CEEV5Gwi.js} +2 -2
- package/_assets/{decimals-BsQudh4A.js → decimals-BmQMEd9E.js} +2 -2
- package/_assets/{decimals-QMRaj8A4.js → decimals-DKsfBHpK.js} +2 -2
- package/_assets/{detectExtension-eFuiXBqe.js → detectExtension-DGFEfcbz.js} +2 -2
- package/_assets/{disposePreview-CRyPyKKT.js → disposePreview-Bfh9aU_J.js} +2 -2
- package/_assets/{email-D4EyTUe7.js → email-C0rayVJd.js} +2 -2
- package/_assets/{embedded-wallet-C2D3EAb1.js → embedded-wallet-5MeCyUdE.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-CpBJ03i2.js → emotion-styled.browser.esm-LN9zOfwH.js} +2 -2
- package/_assets/{engine-BbOCbSlD.js → engine-Cf1QmTJQ.js} +2 -2
- package/_assets/{errors-Bg8qsU53.js → errors-BByokafR.js} +2 -2
- package/_assets/{estimate-l1-fee-D0jvE3mx.js → estimate-l1-fee-CcLIvwfc.js} +2 -2
- package/_assets/{eth_estimateGas-CQNX7NuJ.js → eth_estimateGas-DdbpRto-.js} +2 -2
- package/_assets/{eth_getStorageAt-D0NnJlij.js → eth_getStorageAt-Ci_AjjHg.js} +2 -2
- package/_assets/{eth_getTransactionCount-CVuUWiNN.js → eth_getTransactionCount-0JPW5DGu.js} +2 -2
- package/_assets/{ethereum-6iw3lFOZ.js → ethereum-DYUSvH6v.js} +2 -2
- package/_assets/{ethers-BsaABekR.js → ethers-BfnXvuxS.js} +2 -2
- package/_assets/{events-C4OPCmQP.js → events-DOXOcxVW.js} +2 -2
- package/_assets/{execute-CgxmdyBm.js → execute-R31vI0PP.js} +3 -3
- package/_assets/{extractIPFS-C7dZUA2N.js → extractIPFS-Bg2FU7gW.js} +2 -2
- package/_assets/{features-mKpIPTnS.js → features-DqkSLGWe.js} +2 -2
- package/_assets/{fetchTokenMetadata-W7uHvfeQ.js → fetchTokenMetadata-COh3nbBL.js} +3 -3
- package/_assets/{field.styles-BOtOsc-J.js → field.styles-BeUcGp3j.js} +2 -2
- package/_assets/{fortmatic-BEQagSCY.js → fortmatic-BeVunzky.js} +2 -2
- package/_assets/{get-bytecode-rNyaD7v6.js → get-bytecode-BpKcUepk.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-CIF0vnWX.js → get-ecosystem-wallet-info-CUi7n-IS.js} +2 -2
- package/_assets/{getBalance-BkvZMo_t.js → getBalance-UTTv1le_.js} +3 -3
- package/_assets/{getInstalledModules-BgDYjPss.js → getInstalledModules-Ds73OBjY.js} +2 -2
- package/_assets/{getNFT-CvB3KXgJ.js → getNFT-BhmiyvWi.js} +3 -3
- package/_assets/{getNFT-B9d1ULLA.js → getNFT-f75LggPF.js} +2 -2
- package/_assets/{grid.styles-BYhO5kl4.js → grid.styles-C29Nyu4C.js} +2 -2
- package/_assets/{hashTypedData-BePwOHrb.js → hashTypedData-DVQd-ytO.js} +2 -2
- package/_assets/{hashTypedData-Dl6tw3EV.js → hashTypedData-mvCKC6OS.js} +2 -2
- package/_assets/{in-app-xLEGGOxw.js → in-app-D7v4pJbk.js} +2 -2
- package/_assets/{in-app-wallet-calls-Y2q1hEWu.js → in-app-wallet-calls-CWLUbme4.js} +2 -2
- package/_assets/{index-BPmph_y2.js → index-7EA3n-EN.js} +2 -2
- package/_assets/index-7XMZRNJw.css +1 -0
- package/_assets/{index-5R1NH3hO.js → index-8a4ejD-E.js} +2 -2
- package/_assets/{index-gvhfk3Kf.js → index-B3kapPCX.js} +2 -2
- package/_assets/{index-CrQTd_Vt.js → index-B3qB_Szq.js} +2 -2
- package/_assets/{index-s6EBI2aX.js → index-BA3YuPkE.js} +2 -2
- package/_assets/{index-BLwUrxaM.js → index-BFGJWrau.js} +2 -2
- package/_assets/{index-BBc3X6XF.js → index-BFHMpeS5.js} +320 -320
- package/_assets/{index-BTy5TIkz.js → index-BUhRMj0k.js} +3 -3
- package/_assets/{index-OaamUQLA.js → index-BXSuEdHw.js} +2 -2
- package/_assets/{index-DExh-qiO.js → index-BiOyGp0x.js} +2 -2
- package/_assets/{index-Dr7jRd9A.js → index-BjhkePbM.js} +4 -4
- package/_assets/{index-CJGZvhoi.js → index-Bn9MxyNx.js} +2 -2
- package/_assets/{index-DcqsKEsF.js → index-Bpnh2mhD.js} +2 -2
- package/_assets/{index-BvkN1JGf.js → index-Br346hMc.js} +4 -4
- package/_assets/{index-DJkU_5N3.js → index-BvE5kQP5.js} +2 -2
- package/_assets/{index-CVV8mr-f.js → index-BwbCTrgE.js} +2 -2
- package/_assets/{index-C5gt-xEm.js → index-BzsMKIPi.js} +2 -2
- package/_assets/{index-Bd664zE6.js → index-C-3S-aR_.js} +2 -2
- package/_assets/{index-BTtbpRCO.js → index-C2gDgpYx.js} +2 -2
- package/_assets/{index-B7zg3iXU.js → index-C38OW2pe.js} +2 -2
- package/_assets/{index-CwDHbFrE.js → index-C4BR3a3M.js} +2 -2
- package/_assets/{index-DYql6z0j.js → index-C6MOg2oW.js} +2 -2
- package/_assets/{index-xHMVqN46.js → index-C7JAEpsR.js} +2 -2
- package/_assets/{index-B3dFnJQP.js → index-C7Ns1jUN.js} +2 -2
- package/_assets/{index-CG6n56be.js → index-C9F2T2G5.js} +2 -2
- package/_assets/{index-CRNomRFG.js → index-C9m77YrW.js} +2 -2
- package/_assets/{index-wjxY48Yl.js → index-CFWOoo0n.js} +2 -2
- package/_assets/{index-k1aOSuhb.js → index-CQTuHkt6.js} +4 -4
- package/_assets/{index-DPWoZxpF.js → index-CQi6hJSY.js} +2 -2
- package/_assets/{index-BHU0VbfL.js → index-CRi7V83H.js} +3 -3
- package/_assets/{index-C4KUTBCy.js → index-CZoaQxuM.js} +2 -2
- package/_assets/{index-Dnk8czQv.js → index-Cg1q_1rC.js} +2 -2
- package/_assets/{index-C284vC1D.js → index-CiZNMvJ9.js} +2 -2
- package/_assets/{index-Cd6atmT5.js → index-CktWkqok.js} +2 -2
- package/_assets/{index-Bc0x7wx0.js → index-CmHI48j2.js} +2 -2
- package/_assets/{index-DF0Z9gru.js → index-CnTq-D0F.js} +2 -2
- package/_assets/{index-KOw8Pyjo.js → index-CzHeD3Wi.js} +2 -2
- package/_assets/{index-D2VIT3xx.js → index-D-fNU-mX.js} +3 -3
- package/_assets/{index-Dm1LzUJg.js → index-D0CCESX5.js} +2 -2
- package/_assets/{index-DUqa7_dx.js → index-D15i9Snb.js} +2 -2
- package/_assets/{index-CY2qhmNH.js → index-D2yjRgpK.js} +2 -2
- package/_assets/{index-Db7v2JAh.js → index-D3An-1P9.js} +2 -2
- package/_assets/{index-B_X1F7fX.js → index-DAgkANiI.js} +2 -2
- package/_assets/{index-BEQnNfRX.js → index-DC12bna3.js} +2 -2
- package/_assets/{index-BDHBYg9U.js → index-DJDZ2D_0.js} +2 -2
- package/_assets/{index-t6AoMEJd.js → index-DLA2XG0B.js} +2 -2
- package/_assets/{index-BNSQiuue.js → index-DLdrzeCo.js} +2 -2
- package/_assets/{index-Bzs9W9Xf.js → index-DNJCrjPc.js} +2 -2
- package/_assets/{index-BT-HHXrw.js → index-DTDLF1_e.js} +2 -2
- package/_assets/{index-Bz3QM6R_.js → index-DV2ikJ7P.js} +2 -2
- package/_assets/{index-De3Ourso.js → index-DckWaHRB.js} +2 -2
- package/_assets/{index-CMwT-EMo.js → index-DmPseRWb.js} +2 -2
- package/_assets/{index-B2N1TlZf.js → index-DmkxnRhi.js} +2 -2
- package/_assets/{index-F-PZn4me.js → index-Dw660D76.js} +3 -3
- package/_assets/{index-BJu0G-Ry.js → index-Dwm1aZW_.js} +2 -2
- package/_assets/{index-DAK-djOp.js → index-N6jOuY9E.js} +2 -2
- package/_assets/{index-DA1NP8Ju.js → index-R_aZBTVq.js} +2 -2
- package/_assets/{index-CrX0Yz5L.js → index-TSMki3gy.js} +2 -2
- package/_assets/{index-B4sJodB8.js → index-V2l1pvfO.js} +2 -2
- package/_assets/{index-COocIzMl.js → index-Y6LX2zPm.js} +2 -2
- package/_assets/{index-D5Du4xGQ.js → index-_o4B93Wv.js} +2 -2
- package/_assets/{index-CWzVzsYx.js → index-aTHzb-UU.js} +2 -2
- package/_assets/{index-CnxpIcjg.js → index-f-rhyCiZ.js} +2 -2
- package/_assets/{index-BmNHZBRl.js → index-nZh7HqkX.js} +2 -2
- package/_assets/{index-lmuWdSJU.js → index-qLV9obfb.js} +2 -2
- package/_assets/{index-OYOhdV0y.js → index-u07BnOHT.js} +2 -2
- package/_assets/{index-CAR9wmvw.js → index-vRZTC-Kx.js} +2 -2
- package/_assets/{index.es-D_pn-sSx.js → index.es-B8O7hyLV.js} +2 -2
- package/_assets/{index.es-CAomYnsN.js → index.es-BPHop57M.js} +2 -2
- package/_assets/{index.es-B4j-BNrr.js → index.es-Cfi7R05N.js} +5 -5
- package/_assets/{index.es-xs2jYw5E.js → index.es-d0bre8FY.js} +2 -2
- package/_assets/items-empty-Cmf8VL2A.js +2 -0
- package/_assets/{jump-C9PIzJMo.js → jump-ZJB-DBny.js} +2 -2
- package/_assets/{linkAccount-BbYoROZZ.js → linkAccount-CagwoTkM.js} +2 -2
- package/_assets/{localBatchGatewayRequest-C1oGJkvn.js → localBatchGatewayRequest-aw27Bp6C.js} +2 -2
- package/_assets/{native-D9_vWjzw.js → native-D_b-Jjxn.js} +2 -2
- package/_assets/{networks-D-8eSR4f.js → networks-Cz_KXKTD.js} +2 -2
- package/_assets/{onramp-CJNj90av.js → onramp-BgSxVi_X.js} +2 -2
- package/_assets/{openzeppelin-DqgAToDp.js → openzeppelin-HT89Dmzp.js} +2 -2
- package/_assets/{ownerOf-Dt-ag82o.js → ownerOf-BAQuOyZw.js} +2 -2
- package/_assets/{parseNft-DUoA2cf9.js → parseNft-BLggk1FL.js} +3 -3
- package/_assets/{parseSignature--ghdQtU2.js → parseSignature-BgAg7p_1.js} +2 -2
- package/_assets/{parseSignature-DEThZFaN.js → parseSignature-DvERMuu5.js} +4 -4
- package/_assets/{passkeys-CGWK9Quy.js → passkeys-Cz2GemtB.js} +2 -2
- package/_assets/{pay-with-exchange-BouUEn78.js → pay-with-exchange-CqWdb7la.js} +2 -2
- package/_assets/{prepare-contract-call-Cxatn87X.js → prepare-contract-call-DWYd_dpp.js} +2 -2
- package/_assets/{qr-overlay-CTxRGEIz.js → qr-overlay-D0QgP5Gm.js} +4 -4
- package/_assets/{react-CJ0-yyn7.js → react-CfmD1IrY.js} +2 -2
- package/_assets/{receive-DVMKwcdo.js → receive-DX9IzAKR.js} +2 -2
- package/_assets/{resolveImplementation-a3DBQ8m8.js → resolveImplementation-1LdC9vyT.js} +2 -2
- package/_assets/{resume-buy-Bq0nVPcE.js → resume-buy-DbTQ4Y00.js} +2 -2
- package/_assets/{rpc-B0RZ-vtD.js → rpc-CS7-9nns.js} +2 -2
- package/_assets/{sales-empty-bGF50GDf.js → sales-empty-DW40FYSx.js} +2 -2
- package/_assets/{search-empty-tgZpxVpX.js → search-empty-BWTzk53_.js} +2 -2
- package/_assets/{secp256k1-1jgJmYWx.js → secp256k1-CkttYbi-.js} +2 -2
- package/_assets/{secp256k1-JJlVLcuk.js → secp256k1-KrI-5aSb.js} +2 -2
- package/_assets/{secp256k1-BxaRnytz.js → secp256k1-bprmllwr.js} +2 -2
- package/_assets/{send-DMTfvSnB.js → send-D3QhjtsL.js} +2 -2
- package/_assets/{send-batch-transaction-BVT1kCg_.js → send-batch-transaction-hJ59Esjd.js} +2 -2
- package/_assets/{send-eip712-transaction-B3M5RWsD.js → send-eip712-transaction-D4Lq-5w3.js} +3 -3
- package/_assets/{send-gasless-transaction-L4j1ZusH.js → send-gasless-transaction-BjCUBumO.js} +3 -3
- package/_assets/{send-transaction-BbDZEBSv.js → send-transaction-BNTrOtZy.js} +3 -3
- package/_assets/{sendMetaTransaction-BhpPcSya.js → sendMetaTransaction-C43xk9UA.js} +2 -2
- package/_assets/{sendRawTransaction-DoZqg8jx.js → sendRawTransaction-imHapPG5.js} +4 -4
- package/_assets/{sentry-D5q6Jl_E.js → sentry-TFqjegNi.js} +3 -3
- package/_assets/{serializeTransaction-CKZVZu41.js → serializeTransaction-CxiUwXNH.js} +2 -2
- package/_assets/{session-proposal-CXoYD_S4.js → session-proposal-DJZiGtMS.js} +2 -2
- package/_assets/{session-request-CVNcyjpe.js → session-request-DT1Fe144.js} +3 -3
- package/_assets/{sha256-B7YAclKN.js → sha256-BMvUBSH_.js} +2 -2
- package/_assets/{sha3-BhaNbge-.js → sha3-DE1CUjCa.js} +2 -2
- package/_assets/{signing-BhjVqedK.js → signing-3pb9u9PC.js} +4 -4
- package/_assets/{skeleton.styles-BBTzNQBL.js → skeleton.styles-6rsyfkX0.js} +2 -2
- package/_assets/{socials-CwtPBLJA.js → socials-5B1SW8BM.js} +2 -2
- package/_assets/{styled-UgoNAbpl.js → styled-DKHbz6uI.js} +2 -2
- package/_assets/{swaps-Bnpjv3io.js → swaps-DXoDHWlZ.js} +2 -2
- package/_assets/{thirdweb-CjXdOXcl.js → thirdweb-BXLB_paW.js} +4 -4
- package/_assets/{to-serializable-transaction-DW6Rxq_m.js → to-serializable-transaction-FSmJ1Nj5.js} +3 -3
- package/_assets/{totalSupply-DjGpB4tZ.js → totalSupply-DlcDAex0.js} +2 -2
- package/_assets/{transaction-DuJWq6eX.js → transaction-CKWKk0bi.js} +2 -2
- package/_assets/{transactionReceipt-8SAHHVSP.js → transactionReceipt-DBgTpvGb.js} +2 -2
- package/_assets/{transactions-CKBlMfJD.js → transactions-IudKghIO.js} +2 -2
- package/_assets/{useCreditPacks-CBkUPkUM.js → useCreditPacks-BPkAbyaH.js} +2 -2
- package/_assets/{useInfiniteGrid-DHrXE4eM.js → useInfiniteGrid-jWb4qfov.js} +2 -2
- package/_assets/{useStore-ckE2dxkp.js → useStore-sOfyAYYH.js} +3 -3
- package/_assets/{useTheme-CyUvY5YF.js → useTheme-Ds6wDviC.js} +2 -2
- package/_assets/{utils-wnY81oYl.js → utils-TFUg72P3.js} +2 -2
- package/_assets/{verifyHash-DMMueGNF.js → verifyHash-FEw82g1n.js} +2 -2
- package/_assets/{w3m-modal-C1fyEGvy.js → w3m-modal-D8L08ctG.js} +2 -2
- package/_assets/{w3m-modal-BCGJhbtp.js → w3m-modal-KPmLwiWO.js} +2 -2
- package/_assets/{wait-for-tx-receipt-D41lpt1M.js → wait-for-tx-receipt-CGKLIxi9.js} +2 -2
- package/_assets/{wallet-gc8JT2Jk.js → wallet-BtqgAQr1.js} +2 -2
- package/_assets/{wallets-_qhdmZdK.js → wallets-BhFxMvJm.js} +6 -6
- package/_assets/{web-connector-SZx3KLiq.js → web-connector-CrKLYCKx.js} +4 -4
- package/_assets/{writeContract-DNkvql92.js → writeContract-CvBZWpQi.js} +2 -2
- package/_assets/{zora-sepolia-Zq3rr1_u.js → zora-sepolia-H-kXK_Ns.js} +2 -2
- package/_assets/{zoraTestnet-U_RmMDCL.js → zoraTestnet-C5OnuHau.js} +2 -2
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/ItemDetail-2gzLCIOg.js +0 -3751
- package/_assets/collectionPage.styles-DyHk1tDQ.js +0 -41
- package/_assets/index-Bv15foVK.css +0 -1
- package/_assets/items-empty-C7avnipb.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{$ as we,bO as Ie,y as U,v as A,bP as Ae,d as o,e as l,w as Ee,x as Le,c as r,O as Ne,I as T,bQ as se,bR as ne,bS as $e,_ as Pe,Q as Te,z as E,av as K,bT as Se,A as Ce,br as B,K as Fe,bU as De,E as N,bV as Me,bW as Q}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-Bn9MxyNx.js","_assets/react-CfmD1IrY.js","_assets/index-BFHMpeS5.js","_assets/dcl-schemas-CEEV5Gwi.js","_assets/sentry-TFqjegNi.js","_assets/ethers-BfnXvuxS.js","_assets/intl-AKLEHPeO.js","_assets/index-7XMZRNJw.css","_assets/sales-empty-DW40FYSx.js","_assets/buy-BKz4g0wV.js","_assets/authorizations-j1Fdv_CY.js","_assets/sendMetaTransaction-C43xk9UA.js","_assets/ManaPricingBanner.styles-CiQXNidr.js","_assets/Faq-DBi3GpFN.js","_assets/field.styles-BeUcGp3j.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as we,bO as Ie,y as U,v as A,bP as Ae,d as o,e as l,w as Ee,x as Le,c as r,O as Ne,I as T,bQ as se,bR as ne,bS as $e,_ as Pe,Q as Te,z as E,av as K,bT as Se,A as Ce,br as B,K as Fe,bU as De,E as N,bV as Me,bW as Q}from"./index-BFHMpeS5.js";import{r as g,a as He,j as t,e as Oe,L as Re}from"./react-CfmD1IrY.js";import{u as qe,s as ze}from"./sales-empty-DW40FYSx.js";import{L as _e}from"./LoadMore-C13YO4Ex.js";import{u as $}from"./useInfiniteGrid-jWb4qfov.js";import{m as de}from"./mana-matic-CEqvSwrJ.js";import{n as We}from"./name-glyph-aUugT8vq.js";import"./dcl-schemas-CEEV5Gwi.js";import"./sentry-TFqjegNi.js";import"./ethers-BfnXvuxS.js";import"./intl-AKLEHPeO.js";import"./buy-BKz4g0wV.js";import"./authorizations-j1Fdv_CY.js";import"./sendMetaTransaction-C43xk9UA.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4c8da3ef-2877-4d79-88fd-6e30fae0dd30",e._sentryDebugIdIdentifier="sentry-dbid-4c8da3ef-2877-4d79-88fd-6e30fae0dd30")}catch{}})();const Ge=15e3;function Ue(e,s){return e.txHash&&s.txHash?e.txHash===s.txHash:e.txHash||s.txHash?!1:e.status===s.status&&Math.abs(e.createdAt-s.createdAt)<=Ge}function Ke(e){const s=[...e].sort((i,d)=>d.createdAt-i.createdAt),n=[];for(const i of s){const d=n[n.length-1];d&&Ue(d[d.length-1],i)?d.push(i):n.push([i])}return n.map(i=>{var d;return{id:((d=i.find(a=>a.txHash))==null?void 0:d.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(a=>a.createdAt)),status:Be(i),totalCredits:i.reduce((a,h)=>a+h.credits,0),lines:i}})}function Be(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Qe(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ve(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Xe(e){const s=[],n=new Map;for(const i of e){const d=Ve(i);if(!d){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits});continue}const a=n.get(d);if(a){a.quantity+=1,a.credits+=i.credits;continue}const h={key:d,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};n.set(d,h),s.push(h)}return s}function Ye(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?we(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Ze(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function Je(e){const n=Ke(e.purchases.filter(Ze)).map(c=>({kind:"purchase",id:`purchase:${c.id}`,createdAt:c.createdAt,order:c})),i=e.sales.map(c=>{const x=Ye(c,e.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),d=(e.creditOrders??[]).filter(c=>c.status!=="failed"&&c.status!=="abandoned").map(c=>({kind:"credit",id:`credit:${c.id}`,createdAt:c.createdAt,order:c})),a=new Set(e.purchases.filter(c=>c.txHash).map(c=>c.txHash.toLowerCase())),h=(e.manaPurchases??[]).filter(c=>!a.has(c.txHash.toLowerCase())).map(c=>({kind:"mana-purchase",id:`mana-purchase:${c.id}`,createdAt:c.createdAt,sale:c}));return[...n,...i,...d,...h].sort((c,x)=>x.createdAt-c.createdAt||(c.id<x.id?-1:1))}function et(e,s){return s==="all"?e:s==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const ce=e=>e.trim().toLowerCase();function tt(e){const s=new Map;for(const n of e??[]){const i=ce(n.txHash??"");if(!i)continue;const d=s.get(i);d?d.push(n):s.set(i,[n])}return s}function it(e,s,n=Date.now()){const i=s.txHash?e.get(ce(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const d=i.length===1?st(i[0].netCents):null,a=i.filter(c=>!c.available&&c.availableAt>n);if(a.length===0)return{kind:"credited",credits:d};const h=a.reduce((c,x)=>Math.max(c,x.availableAt),0);return{kind:"pending",credits:d,availableAt:h}}function st(e){return Ie(e)}function nt(){const e=U(i=>{var d;return(d=i.session)==null?void 0:d.address}),{data:s,isLoading:n}=A({queryKey:["listing-count",e],queryFn:()=>Ae({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const at="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/credits-product-vs4Q6u6l.svg",V=Ee`
|
|
3
3
|
0% { background-position: 200% 0; }
|
|
4
4
|
100% { background-position: -200% 0; }
|
|
5
5
|
`,rt=l.section`
|
|
@@ -357,11 +357,11 @@ import{$ as we,bO as Ie,y as U,v as A,bP as Ae,d as o,e as l,w as Ee,x as Le,c a
|
|
|
357
357
|
@media (prefers-reduced-motion: reduce) {
|
|
358
358
|
animation: none;
|
|
359
359
|
}
|
|
360
|
-
`,
|
|
360
|
+
`,yt=l.div`
|
|
361
361
|
display: flex;
|
|
362
362
|
flex-direction: column;
|
|
363
363
|
align-items: center;
|
|
364
|
-
`,
|
|
364
|
+
`,bt=l.div`
|
|
365
365
|
display: flex;
|
|
366
366
|
flex-direction: column;
|
|
367
367
|
align-items: center;
|
|
@@ -385,5 +385,5 @@ import{$ as we,bO as Ie,y as U,v as A,bP as Ae,d as o,e as l,w as Ee,x as Le,c a
|
|
|
385
385
|
height: 26px;
|
|
386
386
|
object-fit: contain;
|
|
387
387
|
}
|
|
388
|
-
`,J=L.withComponent(Re),wt=g.lazy(()=>Pe(()=>import("./index-CJGZvhoi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],W="section",oe="listings",G="view",At="migrate";function I(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function pe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function me({children:e}){const s=g.useRef(null),[n,i]=g.useState(null),d=()=>{var h;const a=(h=s.current)==null?void 0:h.getBoundingClientRect();a&&i({top:a.bottom+8,left:a.left+a.width/2})};return t.jsxs(mt,{ref:s,tabIndex:0,onMouseEnter:d,onMouseLeave:()=>i(null),onFocus:d,onBlur:()=>i(null),children:[e,n?Oe.createPortal(t.jsx(gt,{style:{top:n.top,left:n.left},role:"tooltip",children:r("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:d}=A({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Me(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),a=n&&d,h=(i==null?void 0:i.name)??r("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",x=B({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[a?t.jsx(Y,{}):t.jsx(R,{children:c?t.jsx("img",{src:c,alt:h}):t.jsx(T,{name:"cart",size:20})}),t.jsxs(q,{children:[a?t.jsx(Z,{}):t.jsx(z,{title:h,children:h}),e.quantity>1?t.jsx(_,{children:r("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]});return x?t.jsx(J,{to:x,"data-link":"true",children:f}):t.jsx(L,{children:f})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(L,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:We,alt:""})}),t.jsxs(q,{children:[t.jsx(z,{title:s,children:s}),t.jsx(_,{children:r("activity.nameRegistration")})]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Xe(e.lines),n=s.reduce((a,h)=>a+h.quantity,0),i=Qe(e.status),d=i==="SETTLED"?r("activity.completed"):i==="FAILED"?r("activity.failed"):r("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.purchaseLabel")," · ",r("activity.itemCount",{count:n})]})]}),t.jsxs(H,{children:[t.jsx(O,{"data-status":i,children:d}),t.jsxs(k,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(ft,{children:r("activity.purchaseFailedNote")}):null,t.jsx(X,{children:s.map(a=>a.registeredName?t.jsx(Lt,{item:a},a.key):t.jsx(Et,{item:a},a.key))})]})}function $t({sale:e}){const{data:s,isLoading:n}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??r("activity.itemFallback"),d=(s==null?void 0:s.thumbnail)??"",a=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,h=t.jsxs(t.Fragment,{children:[n?t.jsx(Y,{}):t.jsx(R,{children:d?t.jsx("img",{src:d,alt:i}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(q,{children:[n?t.jsx(Z,{}):t.jsx(z,{title:i,children:i}),t.jsx(_,{children:r("activity.boughtFrom",{account:pe(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(O,{"data-status":"SETTLED",children:r("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(ue,{src:de,alt:"MANA"})})]})]})]}),t.jsx(X,{children:a?t.jsx(J,{to:a,"data-link":"true",children:h}):t.jsx(L,{children:h})})]})}function Pt({sale:e,payout:s}){const{data:n,isLoading:i}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),d=(n==null?void 0:n.name)??r("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",h=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,c=t.jsxs(t.Fragment,{children:[i?t.jsx(Y,{}):t.jsx(R,{children:a?t.jsx("img",{src:a,alt:d}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(q,{children:[i?t.jsx(Z,{}):t.jsx(z,{title:d,children:d}),t.jsxs(_,{children:[r("activity.soldTo",{account:pe(e.counterparty)}),s.kind==="pending"?` · ${r("activity.payoutPendingOn",{date:I(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(O,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?r("activity.payoutPending"):r("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(ue,{src:de,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(E,{className:"ccy-mark"})," +",Fe(s.credits)]}):t.jsx(k,{"data-kind":"income",children:r("activity.payoutCredited")})]})]}),t.jsx(X,{children:h?t.jsx(J,{to:h,"data-link":"true",children:c}):t.jsx(L,{children:c})})]})}function Tt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Se(e.status),i=n==="SETTLED"?r("activity.completed"):n==="FAILED"?r("activity.failed"):n==="UNFINISHED"?r("activity.unfinished"):r("activity.processing"),d=U(p=>p.session),a=Ce(),[h,c]=g.useState(!1),x=e.status==="initiated"&&!!d;g.useEffect(()=>{const p=()=>c(!1);return window.addEventListener("pageshow",p),()=>window.removeEventListener("pageshow",p)},[]);async function f(){if(!(!d||h)){c(!0);try{const p=await De(e.id,d.identity);if(p.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(p.url)){window.location.href=p.url;return}N.error(r("activity.resumeUnavailable"))}else p.kind==="expired"?(N.info(r("activity.resumeExpired")),a.invalidateQueries({queryKey:["credit-orders"]})):p.kind==="paid"?(N.success(r("activity.resumePaid")),a.invalidateQueries({queryKey:["credit-orders"]})):N.error(r("activity.resumeUnavailable"));c(!1)}catch{c(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(pt,{children:t.jsx("img",{src:at,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.creditPurchaseLabel")," · ",r("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[x?t.jsx(xt,{type:"button",onClick:()=>void f(),disabled:h,"data-testid":"resume-order",children:h?r("activity.resuming"):r("activity.resume")}):null,t.jsx(O,{"data-status":n,children:i}),t.jsxs(k,{"data-kind":n==="UNFINISHED"?void 0:"income",children:[n==="UNFINISHED"?"":"+",t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:r("activity.emptyAllBody"),purchases:r("activity.emptyPurchasesBody"),sales:r("activity.emptySalesBody")}[e];return t.jsx(bt,{children:t.jsx(Te,{testId:`activity-empty-${e}`,icon:ze,title:r("activity.emptyTitle"),body:s,cta:{label:r("assets.empty.cta"),to:"/items"}})})}function Bt(){const{session:e}=U(),[s,n]=g.useState("all"),[i,d]=He(),a=i.get(W)===oe||i.get(G)===At;Le({title:a?r("seo.import.title"):r("nav.activity"),noindex:!0});const{count:h}=qe(),{count:c}=nt(),f=h!==void 0&&c!==void 0&&(h>0||c>0||a),p=!!e&&!a&&s!=="sales",m=!!e&&!a&&s!=="purchases",b=$(["purchases",e==null?void 0:e.address],u=>$e(e.address,e.identity,{first:P,skip:u}),{enabled:p}),y=$(["sales",e==null?void 0:e.address],u=>se(e.address,{role:"seller",first:P,skip:u}),{enabled:m}),v=$(["credit-orders",e==null?void 0:e.address],u=>ne(e.address,e.identity,{first:P,skip:u}),{enabled:p}),j=$(["mana-purchases",e==null?void 0:e.address],u=>se(e.address,{role:"buyer",first:P,skip:u}),{enabled:p}),{data:ee}=A({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(u=>u.payouts),enabled:m,staleTime:6e4}),ge=g.useMemo(()=>tt(ee),[ee]),{data:fe}=Ne(m);if(!e)return t.jsxs(yt,{children:[t.jsx(T,{name:"clock",size:40,color:o.colors.muted2}),t.jsx(vt,{children:r("activity.signInTitle")}),t.jsx(jt,{children:r("activity.signInBody")})]});const te=et(Je({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?j.items:[],rate:fe}),s),be=p&&(b.isLoading||v.isLoading||j.isLoading)||m&&y.isLoading,ie=p&&(b.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||m&&y.isFetchingNextPage,ye=p&&(b.hasNextPage||v.hasNextPage||j.hasNextPage)||m&&y.hasNextPage;function ve(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&j.hasNextPage&&j.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function je(u){if(n(u),!a)return;const w=new URLSearchParams(i);w.delete(W),w.delete(G),d(w,{replace:!0})}function ke(){const u=new URLSearchParams(i);u.set(W,oe),u.delete(G),d(u,{replace:!0})}return t.jsxs(rt,{children:[t.jsx(ot,{children:t.jsx(dt,{children:r("nav.activity")})}),t.jsxs(ct,{role:"tablist","aria-label":r("nav.activity"),children:[It.map(u=>t.jsx(le,{type:"button",role:"tab","aria-selected":!a&&s===u,"data-active":!a&&s===u,"data-testid":`activity-filter-${u}`,onClick:()=>je(u),children:r(`activity.filter.${u}`)},u)),f?t.jsxs(lt,{type:"button",role:"tab","aria-selected":a,"data-active":a,"data-testid":"activity-filter-migrate","aria-label":h?r("activity.migrate.chipAria",{count:h}):void 0,onClick:ke,children:[r("activity.migrate.chip"),h?t.jsx(ut,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:h}):null]}):null]}),a?t.jsx(g.Suspense,{fallback:t.jsx(ht,{"aria-busy":"true"}),children:t.jsx(wt,{})}):be?t.jsx(ae,{children:Array.from({length:5}).map((u,w)=>t.jsx(re,{},w))}):te.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(ae,{children:[te.map(u=>u.kind==="purchase"?t.jsx(Nt,{order:u.order},u.id):u.kind==="credit"?t.jsx(Tt,{order:u.order},u.id):u.kind==="mana-purchase"?t.jsx($t,{sale:u.sale},u.id):t.jsx(Pt,{sale:u.sale,payout:it(ge,u.sale)},u.id)),ie?t.jsx(re,{}):null]}),t.jsx(_e,{hasNextPage:ye,isFetching:ie,onLoadMore:ve})]})]})}export{Bt as Activity};
|
|
389
|
-
//# sourceMappingURL=Activity-
|
|
388
|
+
`,J=L.withComponent(Re),wt=g.lazy(()=>Pe(()=>import("./index-Bn9MxyNx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],W="section",oe="listings",G="view",At="migrate";function I(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function pe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function me({children:e}){const s=g.useRef(null),[n,i]=g.useState(null),d=()=>{var h;const a=(h=s.current)==null?void 0:h.getBoundingClientRect();a&&i({top:a.bottom+8,left:a.left+a.width/2})};return t.jsxs(mt,{ref:s,tabIndex:0,onMouseEnter:d,onMouseLeave:()=>i(null),onFocus:d,onBlur:()=>i(null),children:[e,n?Oe.createPortal(t.jsx(gt,{style:{top:n.top,left:n.left},role:"tooltip",children:r("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:d}=A({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Me(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),a=n&&d,h=(i==null?void 0:i.name)??r("activity.itemFallback"),c=(i==null?void 0:i.thumbnail)??"",x=B({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[a?t.jsx(Y,{}):t.jsx(R,{children:c?t.jsx("img",{src:c,alt:h}):t.jsx(T,{name:"cart",size:20})}),t.jsxs(q,{children:[a?t.jsx(Z,{}):t.jsx(z,{title:h,children:h}),e.quantity>1?t.jsx(_,{children:r("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]});return x?t.jsx(J,{to:x,"data-link":"true",children:f}):t.jsx(L,{children:f})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(L,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:We,alt:""})}),t.jsxs(q,{children:[t.jsx(z,{title:s,children:s}),t.jsx(_,{children:r("activity.nameRegistration")})]}),t.jsxs(he,{children:[t.jsx(E,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Xe(e.lines),n=s.reduce((a,h)=>a+h.quantity,0),i=Qe(e.status),d=i==="SETTLED"?r("activity.completed"):i==="FAILED"?r("activity.failed"):r("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.purchaseLabel")," · ",r("activity.itemCount",{count:n})]})]}),t.jsxs(H,{children:[t.jsx(O,{"data-status":i,children:d}),t.jsxs(k,{children:[t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(ft,{children:r("activity.purchaseFailedNote")}):null,t.jsx(X,{children:s.map(a=>a.registeredName?t.jsx(Lt,{item:a},a.key):t.jsx(Et,{item:a},a.key))})]})}function $t({sale:e}){const{data:s,isLoading:n}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??r("activity.itemFallback"),d=(s==null?void 0:s.thumbnail)??"",a=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,h=t.jsxs(t.Fragment,{children:[n?t.jsx(Y,{}):t.jsx(R,{children:d?t.jsx("img",{src:d,alt:i}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(q,{children:[n?t.jsx(Z,{}):t.jsx(z,{title:i,children:i}),t.jsx(_,{children:r("activity.boughtFrom",{account:pe(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(O,{"data-status":"SETTLED",children:r("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(ue,{src:de,alt:"MANA"})})]})]})]}),t.jsx(X,{children:a?t.jsx(J,{to:a,"data-link":"true",children:h}):t.jsx(L,{children:h})})]})}function Pt({sale:e,payout:s}){const{data:n,isLoading:i}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),d=(n==null?void 0:n.name)??r("activity.itemFallback"),a=(n==null?void 0:n.thumbnail)??"",h=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,c=t.jsxs(t.Fragment,{children:[i?t.jsx(Y,{}):t.jsx(R,{children:a?t.jsx("img",{src:a,alt:d}):t.jsx(T,{name:"offer",size:20})}),t.jsxs(q,{children:[i?t.jsx(Z,{}):t.jsx(z,{title:d,children:d}),t.jsxs(_,{children:[r("activity.soldTo",{account:pe(e.counterparty)}),s.kind==="pending"?` · ${r("activity.payoutPendingOn",{date:I(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsx(M,{children:r("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(O,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?r("activity.payoutPending"):r("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(ue,{src:de,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(E,{className:"ccy-mark"})," +",Fe(s.credits)]}):t.jsx(k,{"data-kind":"income",children:r("activity.payoutCredited")})]})]}),t.jsx(X,{children:h?t.jsx(J,{to:h,"data-link":"true",children:c}):t.jsx(L,{children:c})})]})}function Tt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Se(e.status),i=n==="SETTLED"?r("activity.completed"):n==="FAILED"?r("activity.failed"):n==="UNFINISHED"?r("activity.unfinished"):r("activity.processing"),d=U(p=>p.session),a=Ce(),[h,c]=g.useState(!1),x=e.status==="initiated"&&!!d;g.useEffect(()=>{const p=()=>c(!1);return window.addEventListener("pageshow",p),()=>window.removeEventListener("pageshow",p)},[]);async function f(){if(!(!d||h)){c(!0);try{const p=await De(e.id,d.identity);if(p.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(p.url)){window.location.href=p.url;return}N.error(r("activity.resumeUnavailable"))}else p.kind==="expired"?(N.info(r("activity.resumeExpired")),a.invalidateQueries({queryKey:["credit-orders"]})):p.kind==="paid"?(N.success(r("activity.resumePaid")),a.invalidateQueries({queryKey:["credit-orders"]})):N.error(r("activity.resumeUnavailable"));c(!1)}catch{c(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(pt,{children:t.jsx("img",{src:at,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:I(e.createdAt)}),t.jsxs(M,{children:[r("activity.creditPurchaseLabel")," · ",r("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[x?t.jsx(xt,{type:"button",onClick:()=>void f(),disabled:h,"data-testid":"resume-order",children:h?r("activity.resuming"):r("activity.resume")}):null,t.jsx(O,{"data-status":n,children:i}),t.jsxs(k,{"data-kind":n==="UNFINISHED"?void 0:"income",children:[n==="UNFINISHED"?"":"+",t.jsx(E,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:r("activity.emptyAllBody"),purchases:r("activity.emptyPurchasesBody"),sales:r("activity.emptySalesBody")}[e];return t.jsx(yt,{children:t.jsx(Te,{testId:`activity-empty-${e}`,icon:ze,title:r("activity.emptyTitle"),body:s,cta:{label:r("assets.empty.cta"),to:"/items"}})})}function Bt(){const{session:e}=U(),[s,n]=g.useState("all"),[i,d]=He(),a=i.get(W)===oe||i.get(G)===At;Le({title:a?r("seo.import.title"):r("nav.activity"),noindex:!0});const{count:h}=qe(),{count:c}=nt(),f=h!==void 0&&c!==void 0&&(h>0||c>0||a),p=!!e&&!a&&s!=="sales",m=!!e&&!a&&s!=="purchases",y=$(["purchases",e==null?void 0:e.address],u=>$e(e.address,e.identity,{first:P,skip:u}),{enabled:p}),b=$(["sales",e==null?void 0:e.address],u=>se(e.address,{role:"seller",first:P,skip:u}),{enabled:m}),v=$(["credit-orders",e==null?void 0:e.address],u=>ne(e.address,e.identity,{first:P,skip:u}),{enabled:p}),j=$(["mana-purchases",e==null?void 0:e.address],u=>se(e.address,{role:"buyer",first:P,skip:u}),{enabled:p}),{data:ee}=A({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(u=>u.payouts),enabled:m,staleTime:6e4}),ge=g.useMemo(()=>tt(ee),[ee]),{data:fe}=Ne(m);if(!e)return t.jsxs(bt,{children:[t.jsx(T,{name:"clock",size:40,color:o.colors.muted2}),t.jsx(vt,{children:r("activity.signInTitle")}),t.jsx(jt,{children:r("activity.signInBody")})]});const te=et(Je({purchases:p?y.items:[],sales:m?b.items:[],creditOrders:p?v.items:[],manaPurchases:p?j.items:[],rate:fe}),s),ye=p&&(y.isLoading||v.isLoading||j.isLoading)||m&&b.isLoading,ie=p&&(y.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||m&&b.isFetchingNextPage,be=p&&(y.hasNextPage||v.hasNextPage||j.hasNextPage)||m&&b.hasNextPage;function ve(){p&&y.hasNextPage&&y.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&j.hasNextPage&&j.fetchNextPage(),m&&b.hasNextPage&&b.fetchNextPage()}function je(u){if(n(u),!a)return;const w=new URLSearchParams(i);w.delete(W),w.delete(G),d(w,{replace:!0})}function ke(){const u=new URLSearchParams(i);u.set(W,oe),u.delete(G),d(u,{replace:!0})}return t.jsxs(rt,{children:[t.jsx(ot,{children:t.jsx(dt,{children:r("nav.activity")})}),t.jsxs(ct,{role:"tablist","aria-label":r("nav.activity"),children:[It.map(u=>t.jsx(le,{type:"button",role:"tab","aria-selected":!a&&s===u,"data-active":!a&&s===u,"data-testid":`activity-filter-${u}`,onClick:()=>je(u),children:r(`activity.filter.${u}`)},u)),f?t.jsxs(lt,{type:"button",role:"tab","aria-selected":a,"data-active":a,"data-testid":"activity-filter-migrate","aria-label":h?r("activity.migrate.chipAria",{count:h}):void 0,onClick:ke,children:[r("activity.migrate.chip"),h?t.jsx(ut,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:h}):null]}):null]}),a?t.jsx(g.Suspense,{fallback:t.jsx(ht,{"aria-busy":"true"}),children:t.jsx(wt,{})}):ye?t.jsx(ae,{children:Array.from({length:5}).map((u,w)=>t.jsx(re,{},w))}):te.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(ae,{children:[te.map(u=>u.kind==="purchase"?t.jsx(Nt,{order:u.order},u.id):u.kind==="credit"?t.jsx(Tt,{order:u.order},u.id):u.kind==="mana-purchase"?t.jsx($t,{sale:u.sale},u.id):t.jsx(Pt,{sale:u.sale,payout:it(ge,u.sale)},u.id)),ie?t.jsx(re,{}):null]}),t.jsx(_e,{hasNextPage:be,isFetching:ie,onLoadMore:ve})]})]})}export{Bt as Activity};
|
|
389
|
+
//# sourceMappingURL=Activity-DG1X3r7j.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as d}from"./react-
|
|
1
|
+
import{r as u,j as d}from"./react-CfmD1IrY.js";import{e as f}from"./index-BFHMpeS5.js";import"./dcl-schemas-CEEV5Gwi.js";import"./sentry-TFqjegNi.js";import"./ethers-BfnXvuxS.js";import"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="c05a119d-be5f-4d5e-aaea-b9f280f44d32",e._sentryDebugIdIdentifier="sentry-dbid-c05a119d-be5f-4d5e-aaea-b9f280f44d32")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -77,11 +77,11 @@ void main() {
|
|
|
77
77
|
|
|
78
78
|
gl_FragColor = result;
|
|
79
79
|
}
|
|
80
|
-
`;function p(e,a,n){const r=e.createShader(a);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(console.error("Shader compile error:",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function B(e,a,n){const r=e.createProgram();return r?(e.attachShader(r,a),e.attachShader(r,n),e.linkProgram(r),e.getProgramParameter(r,e.LINK_STATUS)?r:(console.error("Program link error:",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function F(e,a,n){const r=e.createTexture();if(!r)return null;e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{n!=null&&n()||(e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.generateMipmap(e.TEXTURE_2D))},o.src=a,r}const C=
|
|
80
|
+
`;function p(e,a,n){const r=e.createShader(a);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(console.error("Shader compile error:",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function B(e,a,n){const r=e.createProgram();return r?(e.attachShader(r,a),e.attachShader(r,n),e.linkProgram(r),e.getProgramParameter(r,e.LINK_STATUS)?r:(console.error("Program link error:",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function F(e,a,n){const r=e.createTexture();if(!r)return null;e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{n!=null&&n()||(e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.generateMipmap(e.TEXTURE_2D))},o.src=a,r}const C=f.div`
|
|
81
81
|
position: absolute;
|
|
82
82
|
inset: 0;
|
|
83
83
|
overflow: hidden;
|
|
84
|
-
`,k=
|
|
84
|
+
`,k=f.div`
|
|
85
85
|
position: absolute;
|
|
86
86
|
inset: 0;
|
|
87
87
|
width: 100%;
|
|
@@ -89,10 +89,10 @@ void main() {
|
|
|
89
89
|
background-size: cover;
|
|
90
90
|
background-position: center;
|
|
91
91
|
background-repeat: no-repeat;
|
|
92
|
-
`,V=
|
|
92
|
+
`,V=f.canvas`
|
|
93
93
|
position: absolute;
|
|
94
94
|
inset: 0;
|
|
95
95
|
width: 100%;
|
|
96
96
|
height: 100%;
|
|
97
|
-
`;function K({patternTiling:e=1.66}){const a=u.useRef(null),n=u.useRef(0),r=u.useRef(e);return r.current=e,u.useEffect(()=>{var _;const o=a.current;if(!o||(_=window.matchMedia)!=null&&_.call(window,"(prefers-reduced-motion: reduce)").matches)return;const t=o.getContext("webgl",{alpha:!1,antialias:!1});if(!t)return;const c=p(t,t.VERTEX_SHADER,L),s=p(t,t.FRAGMENT_SHADER,I);if(!c||!s){c&&t.deleteShader(c),s&&t.deleteShader(s);return}const i=B(t,c,s);if(!i){t.deleteShader(c),t.deleteShader(s);return}const
|
|
98
|
-
//# sourceMappingURL=AnimatedBackground-
|
|
97
|
+
`;function K({patternTiling:e=1.66}){const a=u.useRef(null),n=u.useRef(0),r=u.useRef(e);return r.current=e,u.useEffect(()=>{var _;const o=a.current;if(!o||(_=window.matchMedia)!=null&&_.call(window,"(prefers-reduced-motion: reduce)").matches)return;const t=o.getContext("webgl",{alpha:!1,antialias:!1});if(!t)return;const c=p(t,t.VERTEX_SHADER,L),s=p(t,t.FRAGMENT_SHADER,I);if(!c||!s){c&&t.deleteShader(c),s&&t.deleteShader(s);return}const i=B(t,c,s);if(!i){t.deleteShader(c),t.deleteShader(s);return}const m=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),w=t.getUniformLocation(i,"u_resolution"),b=t.getUniformLocation(i,"u_overlayTex"),A=t.getUniformLocation(i,"u_overlayTiling"),v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);let g=!1;const h=F(t,P,()=>g),S=()=>{const l=window.devicePixelRatio||1,E=o.clientWidth*l,x=o.clientHeight*l;(o.width!==E||o.height!==x)&&(o.width=E,o.height=x)},U=performance.now()/1e3,y=()=>{S(),t.viewport(0,0,o.width,o.height),t.useProgram(i),t.uniform1f(R,performance.now()/1e3-U),t.uniform2f(w,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(b,0),t.enableVertexAttribArray(m),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(m,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),n.current=requestAnimationFrame(y)},T=l=>{l.preventDefault(),cancelAnimationFrame(n.current),o.style.opacity="0"};return o.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(y),()=>{g=!0,cancelAnimationFrame(n.current),o.removeEventListener("webglcontextlost",T),t.deleteProgram(i),t.deleteShader(c),t.deleteShader(s),t.deleteBuffer(v),t.deleteTexture(h)}},[]),d.jsxs(C,{"aria-hidden":!0,children:[d.jsx(k,{style:{backgroundImage:`url(${D})`}}),d.jsx(V,{ref:a})]})}export{K as default};
|
|
98
|
+
//# sourceMappingURL=AnimatedBackground-BnW4jNQ_.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,u as Ve,j as e,a as dt}from"./react-
|
|
1
|
+
import{r as u,u as Ve,j as e,a as dt}from"./react-CfmD1IrY.js";import{f as Z,Y as ht,Z as pt,bD as ut,bz as ft,aH as mt,g as xt,v as gt,cF as bt,cG as yt,e as i,d as t,y as Ze,bl as wt,A as vt,K as $e,c as s,s as jt,I as _,z as D,cH as he,bj as Ct,ak as ce,bt as We,bC as $t,bB as kt,x as Qe,O as Ke,$ as Je,cI as St,a0 as Et,ay as Tt,Q as Rt,S as Be,R as te,aP as _t,bM as It}from"./index-BFHMpeS5.js";import{u as Lt,s as Nt}from"./search-empty-BWTzk53_.js";import{i as At,u as zt,j as Mt,S as Wt,R as Bt,a as Pt,b as Ft,c as Ot,D as Ut,d as Ht,C as Dt,e as Gt,F as qt,f as Vt,g as Zt,M as Qt,h as Kt}from"./browseLayout.styles-CzgQMQ68.js";import{L as Jt}from"./LoadMore-C13YO4Ex.js";import{u as Xt}from"./useInfiniteGrid-jWb4qfov.js";import{n as Yt,S as en}from"./categories-D8j8Cra5.js";import{E as tn}from"./ErrorNotice-DFD2N4ZG.js";import{d as nn}from"./dcl-schemas-CEEV5Gwi.js";import{s as sn,G as on,w as an,S as rn}from"./buy-gasless-BxHAW80t.js";import{t as ln,u as cn}from"./buy-BKz4g0wV.js";import{f as dn}from"./errors-BByokafR.js";import{J as hn,C as pn,B as ke}from"./ethers-BfnXvuxS.js";import{n as un}from"./name-glyph-aUugT8vq.js";import{c as fn}from"./crumbs.styles-DZV0yuAO.js";import{G as mn}from"./grid.styles-C29Nyu4C.js";import"./sentry-TFqjegNi.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-6rsyfkX0.js";import"./authorizations-j1Fdv_CY.js";import"./sendMetaTransaction-C43xk9UA.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="f4b9c919-14d4-421e-9613-6e1366cc24bd",n._sentryDebugIdIdentifier="sentry-dbid-f4b9c919-14d4-421e-9613-6e1366cc24bd")}catch{}})();function ne(n){const o=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${o}:${r}`}const K="100000000000000000000",Xe=2,de=15,xn=/^[a-zA-Z0-9]+$/;function Pe(n){const o=n.trim();return o.length===0?{ok:!1,reason:"empty"}:xn.test(o)?o.length<Xe?{ok:!1,reason:"too-short"}:o.length>de?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function gn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,de)}const bn=["function available(string _subdomain) view returns (bool)"],Fe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function yn(){return Z.chainId===Number(nn.ChainId.MATIC_MAINNET)?Fe.mainnet:Fe.sepolia}async function wn(n,o={}){var m;const{rpc:r,address:h}=yn(),d=new hn(r),b=new pn(h,bn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const l=await b.available(n);if((m=o.signal)!=null&&m.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${l}`),l?"available":"taken"}const vn="https://app.across.to/api";class Te extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Se extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ee extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function jn(n){return mt(K,n)}async function Cn(n,o,r={}){var m;const h=r.chainId??Z.chainId,d=r.provider??"across",b=`${Z.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${h}&provider=${d}`,l=await xt(b,{method:"GET",identity:n,metadata:{}});if(!l.ok){let c;try{c=(m=await l.json())==null?void 0:m.code}catch{}throw c==="ROUTE_COST_TOO_HIGH"?new Te:new Error(`fetchNameCreditRoute ${l.status}`)}return l.json()}function $n(n,o){const r=ke.from(n.availableAmount),d=ke.from(K).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:cn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:K}}async function kn(n,o={}){const r=vn,h=o.intervalMs??1e4,d=o.maxAttempts??60;let b={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let l=0;l<d;l++){try{const m=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(m.ok){const c=await m.json(),y=(c.status??"pending").toLowerCase(),f=c.fillTx??c.fillTxnRef??null,j=typeof c.actionsSucceeded=="boolean"?c.actionsSucceeded:null;if(y==="filled")return{status:"filled",destinationTxHash:f,actionsSucceeded:j};if(y==="refunded"||y==="expired")return{status:y,destinationTxHash:null,actionsSucceeded:!1};b={status:"pending",destinationTxHash:f,actionsSucceeded:j}}}catch{}l<d-1&&await new Promise(m=>setTimeout(m,h))}return b}async function Sn(n){const{name:o,identity:r,signer:h}=n,d=f=>{var j;try{(j=n.onProgress)==null||j.call(n,f)}catch{}},b=n.chainId??Z.chainId,l=n.provider??"across",m=(n.beneficiary??await h.getAddress()).toLowerCase();let c=null,y="unconfirmed";console.info("[names] register start",{name:o,buyer:m,chainId:b,provider:l}),d("preparing");try{const f=await ht(pt(Z.chainId).address),j=jn(f);console.info("[names] step 1/6 sized reservation",{usdCents:j,manaRate:f});const C=await Cn(r,o,{chainId:b,provider:l});console.info("[names] step 2/6 route fetched",{target:C.externalCall.target,selector:C.externalCall.selector,provider:C.provider,quoteId:C.quoteId});const x=await ut(r,j,void 0,void 0,o);if(c=x.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:x.credit.id,maxCreditedValue:x.maxCreditedValue}),ke.from(x.maxCreditedValue).lt(K))throw new Error("Credit under-sized for the name price");d("awaiting-confirmation");const S=$n(x.credit,C);let p;try{p=await sn({chainId:b,buyer:m,signer:h,args:S})}catch(g){if(!(g instanceof on))throw g;if(g.reason==="relayer-unreachable"){y="unobservable";const I=new Ee;throw I.cause=g,I}p=await ln(b,S,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:p}),d("confirming"),await an(p),y="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:p}),l==="across"){d("registering");const g=await kn(p,n.acrossPoll);if(console.info("[names] step 6/6 across status",g),g.status==="pending")return{status:"pending",originTxHash:p};if(g.status==="filled"&&g.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:p}),{status:"pending",originTxHash:p};if(g.status!=="filled"||g.actionsSucceeded!==!0)throw new Se;return{status:"registered",originTxHash:p,destinationTxHash:g.destinationTxHash}}return{status:"pending",originTxHash:p}}catch(f){if(console.error("[names] register failed — raw error:",f,{name:o,buyer:m,originState:y}),f instanceof rn)return{status:"pending",originTxHash:f.txHash};if(c&&y==="unconfirmed"&&await ft(r,[c]).catch(()=>{}),f instanceof Te||f instanceof Se||f instanceof Ee)throw f;const j=new Error(dn(f,"Couldn't register the name. Please try again.",{sale:!0}));throw j.cause=f,j}}function En(){const{data:n}=gt({queryKey:["feature-flag","shop-names"],queryFn:()=>bt(yt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const Tn=60,Rn=700,_n=25;function In(n){if(!n)return[];const o=[];for(let r=1;r<=n.length;r++)o.push({text:n.slice(0,r),delay:Tn});o[o.length-1]={text:n,delay:Rn};for(let r=n.length-1;r>=1;r--)o.push({text:n.slice(0,r),delay:_n});return o}function Ln(n){return n.flatMap(In)}function Nn(n,o){const r=u.useMemo(()=>Ln(n),[n]),[h,d]=u.useState(0);return u.useEffect(()=>{if(!o||r.length===0)return;const b=setTimeout(()=>d(l=>(l+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(b)},[h,o,r]),!o||r.length===0?"":r[h%r.length].text}const An="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/name-verified-oGwQ3ntb.svg",zn="#34fee6",Mn=i.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -458,7 +458,7 @@ import{r as u,u as Ve,j as e,a as dt}from"./react-CJ0-yyn7.js";import{f as Z,Y a
|
|
|
458
458
|
color: ${t.colors.accent};
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
`;function rs({name:n,priceCredits:o,onClose:r}){const{session:h}=Ze(),{data:d,isError:b}=wt(h),l=vt(),m=Ve(),[c,y]=u.useState("confirm"),[f,j]=u.useState(""),[C,x]=u.useState(null),[S,p]=u.useState(!1),[g,I]=u.useState("preparing"),L=u.useRef(!1),N=f.trim().toLowerCase()===n.toLowerCase(),E=c==="completing",F=o!=null?$e(o):"—",$=o==null,k=d==null?void 0:d.credits,A=o!=null&&k!=null?o-k:0,T=A>0,G=$?s("names.priceUnavailable"):T?s("names.insufficientCredits",{credits:$e(A)}):null;u.useEffect(()=>{const w=O=>{O.key==="Escape"&&!E&&r()};document.addEventListener("keydown",w);const P=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=P}},[E,r]);async function z(){if(!(!h||!N||$||T||L.current)){L.current=!0,y("completing"),x(null),I("preparing");try{const w=await Sn({name:n,identity:h.identity,signer:h.signer,onProgress:I});ce("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:We(o??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,value_usd:We(o??0),transaction_hash:w.originTxHash??null,settlement:w.status}),l.invalidateQueries({queryKey:["usd-balance"]}),l.invalidateQueries({queryKey:["my-assets"]}),y(w.status==="registered"?"success":"pending")}catch(w){ce(kt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:$t(w),purchase_type:"name"});const P=w instanceof Se,O=w instanceof Ee;x(w instanceof Te?s("names.errorRouteCost"):P?s("names.errorNotRegistered"):O?s("names.errorSettlementUnknown"):(w==null?void 0:w.message)||s("names.errorGeneric")),p(P||O),y("error")}finally{L.current=!1}}}const M=c!=="success"&&c!=="pending",v=jt(h==null?void 0:h.providerType),W=v?2:1,B=v&&(g==="preparing"||g==="awaiting-confirmation"),R=B?1:W,J=B?s("names.confirming"):s("names.completing"),Q=g==="registering"?s("names.processingRegistering"):null;return e.jsx(Mn,{onClick:E?void 0:r,role:"presentation",children:e.jsxs(Wn,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[M&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:c==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(fe,{onClick:r,disabled:E,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{})]}),(c==="confirm"||c==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),F]})]}),c==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ce,{children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),S?e.jsx(je,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(je,{onClick:()=>y("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Un,{children:[e.jsx(Hn,{children:s("names.confirmTitle")}),e.jsx(Dn,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${ls(n)}</b>`})}}),e.jsxs(Gn,{children:[e.jsx(qn,{"aria-hidden":!0,children:"@"}),e.jsx(Vn,{value:f,onChange:w=>j(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(f.length,8)}ch`}}),e.jsx(Zn,{children:".dcl.eth"})]})]}),G?e.jsxs(Ce,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:G})]}):null,e.jsx(je,{onClick:()=>void z(),disabled:!N||!h||$||T,children:s("names.buyCta")})]})]}),c==="completing"&&e.jsxs(Qn,{children:[e.jsx(Kn,{src:Ct,alt:"",width:61,height:61}),e.jsxs(Jn,{children:[e.jsx(Xn,{children:J}),e.jsxs(es,{children:[e.jsx(ts,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(ns,{"data-testid":"name-progress-count",children:`${R}/${W}`})]}),Q?e.jsx(Yn,{children:Q}):null]})]}),c==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.pendingHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(Ce,{"data-tone":"info",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),F]})]}),e.jsx(Ue,{children:e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")})})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.successHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(ss,{children:[e.jsx(is,{"aria-hidden":!0,children:e.jsx(_,{name:"check"})}),e.jsxs(os,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsxs(Bn,{"data-testid":"name-success-tile",children:[e.jsx(Pn,{src:un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(Fn,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(On,{src:An,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),F]})]}),e.jsxs(Ue,{children:[e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")}),e.jsx(as,{href:Z.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function ls(n){return n.replace(/[&<>"']/g,o=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[o])}const cs="https://cdn.decentraland.org/@dcl/shop/1.12.2-34971053975.commit-a7f84c8/_assets/identity-icon-C8yAW_Gq.svg",ds="https://cdn.decentraland.org/@dcl/shop/1.12.2-34971053975.commit-a7f84c8/_assets/world-icon-6xQ-PmmW.svg",hs="https://cdn.decentraland.org/@dcl/shop/1.12.2-34971053975.commit-a7f84c8/_assets/invite-icon-Bz6lCTuB.svg",ps="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",us=i.div`
|
|
461
|
+
`;function rs({name:n,priceCredits:o,onClose:r}){const{session:h}=Ze(),{data:d,isError:b}=wt(h),l=vt(),m=Ve(),[c,y]=u.useState("confirm"),[f,j]=u.useState(""),[C,x]=u.useState(null),[S,p]=u.useState(!1),[g,I]=u.useState("preparing"),L=u.useRef(!1),N=f.trim().toLowerCase()===n.toLowerCase(),E=c==="completing",F=o!=null?$e(o):"—",$=o==null,k=d==null?void 0:d.credits,A=o!=null&&k!=null?o-k:0,T=A>0,G=$?s("names.priceUnavailable"):T?s("names.insufficientCredits",{credits:$e(A)}):null;u.useEffect(()=>{const w=O=>{O.key==="Escape"&&!E&&r()};document.addEventListener("keydown",w);const P=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=P}},[E,r]);async function z(){if(!(!h||!N||$||T||L.current)){L.current=!0,y("completing"),x(null),I("preparing");try{const w=await Sn({name:n,identity:h.identity,signer:h.signer,onProgress:I});ce("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:We(o??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,value_usd:We(o??0),transaction_hash:w.originTxHash??null,settlement:w.status}),l.invalidateQueries({queryKey:["usd-balance"]}),l.invalidateQueries({queryKey:["my-assets"]}),y(w.status==="registered"?"success":"pending")}catch(w){ce(kt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:$t(w),purchase_type:"name"});const P=w instanceof Se,O=w instanceof Ee;x(w instanceof Te?s("names.errorRouteCost"):P?s("names.errorNotRegistered"):O?s("names.errorSettlementUnknown"):(w==null?void 0:w.message)||s("names.errorGeneric")),p(P||O),y("error")}finally{L.current=!1}}}const M=c!=="success"&&c!=="pending",v=jt(h==null?void 0:h.providerType),W=v?2:1,B=v&&(g==="preparing"||g==="awaiting-confirmation"),R=B?1:W,J=B?s("names.confirming"):s("names.completing"),Q=g==="registering"?s("names.processingRegistering"):null;return e.jsx(Mn,{onClick:E?void 0:r,role:"presentation",children:e.jsxs(Wn,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[M&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:c==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(fe,{onClick:r,disabled:E,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{})]}),(c==="confirm"||c==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),F]})]}),c==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ce,{children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),S?e.jsx(je,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(je,{onClick:()=>y("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Un,{children:[e.jsx(Hn,{children:s("names.confirmTitle")}),e.jsx(Dn,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${ls(n)}</b>`})}}),e.jsxs(Gn,{children:[e.jsx(qn,{"aria-hidden":!0,children:"@"}),e.jsx(Vn,{value:f,onChange:w=>j(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(f.length,8)}ch`}}),e.jsx(Zn,{children:".dcl.eth"})]})]}),G?e.jsxs(Ce,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:G})]}):null,e.jsx(je,{onClick:()=>void z(),disabled:!N||!h||$||T,children:s("names.buyCta")})]})]}),c==="completing"&&e.jsxs(Qn,{children:[e.jsx(Kn,{src:Ct,alt:"",width:61,height:61}),e.jsxs(Jn,{children:[e.jsx(Xn,{children:J}),e.jsxs(es,{children:[e.jsx(ts,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(ns,{"data-testid":"name-progress-count",children:`${R}/${W}`})]}),Q?e.jsx(Yn,{children:Q}):null]})]}),c==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.pendingHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(Ce,{"data-tone":"info",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),F]})]}),e.jsx(Ue,{children:e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")})})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.successHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(ss,{children:[e.jsx(is,{"aria-hidden":!0,children:e.jsx(_,{name:"check"})}),e.jsxs(os,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsxs(Bn,{"data-testid":"name-success-tile",children:[e.jsx(Pn,{src:un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(Fn,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(On,{src:An,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),F]})]}),e.jsxs(Ue,{children:[e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")}),e.jsx(as,{href:Z.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function ls(n){return n.replace(/[&<>"']/g,o=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[o])}const cs="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/identity-icon-C8yAW_Gq.svg",ds="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/world-icon-6xQ-PmmW.svg",hs="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/invite-icon-Bz6lCTuB.svg",ps="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",us=i.div`
|
|
462
462
|
width: 100%;
|
|
463
463
|
min-width: 0;
|
|
464
464
|
`,fs=i.nav`
|
|
@@ -936,4 +936,4 @@ import{r as u,u as Ve,j as e,a as dt}from"./react-CJ0-yyn7.js";import{f as Z,Y a
|
|
|
936
936
|
color: ${t.colors.err};
|
|
937
937
|
}
|
|
938
938
|
`,qe=48,Zs=["all","on_sale","not_for_sale"],Qs=n=>n?"all":"on_sale";function gi({contracts:n,hideNames:o=!1,seo:r,lockStatus:h}={}){const[d]=dt(),b=Ve(),l=(d.get("q")??"").trim().toLowerCase(),m=(d.get("q")??"").trim();Qe(r??{title:m?s("seo.collectibles.searchTitle",{query:m}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const c=Qs(!!l),y=St(),f=y&&d.get("deals")==="true",j=u.useMemo(()=>({category:"all",status:c,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:f?"discount":"newest"}),[c,f]),[C,x]=Lt(j),{subCategory:S,rarities:p,priceMin:g,priceMax:I,smart:L,sort:N}=C,E=y&&C.deals,$=At.map(a=>a.key).filter(a=>!(o&&a==="names")).includes(C.category)?C.category:"all",k=h??(Zs.includes(C.status)?C.status:c);zt(`${$}:${S??""}`);const[A,T]=u.useState(!1);u.useEffect(()=>{if(!A)return;const a=ee=>{ee.key==="Escape"&&T(!1)};document.addEventListener("keydown",a);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",a),document.body.style.overflow=H}},[A]);const G=n!==void 0&&n.length===0,z=k==="on_sale",M=g&&!Number.isNaN(Number(g))?Number(g):void 0,v=I&&!Number.isNaN(Number(I))?Number(I):void 0,W=Et(),B=S?en[S]:void 0,R=E?Mt:Wt,J=(R.find(a=>a.key===N)??R[0]).server,Q={category:$,rarities:p.length?p:void 0,wearableCategories:B,minPriceCredits:M,maxPriceCredits:v,search:l||void 0,sortBy:J,isSmart:L||void 0,onSale:!0,discounted:E||void 0,listingType:W?void 0:"primary",contractAddresses:n!=null&&n.length?n:void 0},w={category:$,rarities:p.length?p:void 0,wearableCategories:B,search:l||void 0,sortBy:J,isWearableSmart:L||void 0,isOnSale:k==="not_for_sale"?!1:void 0,contractAddresses:n!=null&&n.length?n:void 0},{items:P,total:O,isLoading:U,isPlaceholderData:q,error:Re,hasNextPage:tt,isFetchingNextPage:_e,isFetchNextPageError:nt,fetchNextPage:st}=Xt(z?["shop-items",Q]:["catalog-items",w],a=>z?_t({...Q,first:qe,skip:a}):It({...w,first:qe,skip:a}),{enabled:$!=="names"&&!G}),X=O,{data:Ie,isError:it,isPending:ot}=Ke(),at=a=>Ie&&a.manaWei?Je(a.manaWei,Ie):null,rt=z&&ot&&P.some(a=>a.source==="legacy"),Le=U||q||rt,lt=U?15:Math.max(P.length,1),Ne=u.useRef(null);u.useEffect(()=>{U||q||!l||Ne.current===l||(Ne.current=l,ce("Shop Searched",{query:l,result_count:X}))},[l,U,q,X]);const Y=u.useRef("__init__");u.useEffect(()=>{if(U||q)return;const a=JSON.stringify({category:$,subCategory:S,rarities:p,min:M,max:v,sort:N,status:k,smart:L});if(Y.current==="__init__"||Y.current===a){Y.current=a;return}Y.current=a,ce("Shop Applied Filter",{filters:{category:$,sub_category:S,rarities:p,min_price_credits:M??null,max_price_credits:v??null,status:k,smart:L,sort:N},result_count:X})},[$,S,p,M,v,N,k,L,U,q,X]);function Ae(a){x({category:a,subCategory:null})}function ze(a){x({status:a})}function Me(a){x({rarities:p.includes(a)?p.filter(H=>H!==a):[...p,a]})}function ct(){x(j)}const V=[];(M!=null||v!=null)&&V.push({key:"price",label:s("filter.price"),onRemove:()=>{x({priceMin:"",priceMax:""})}});for(const a of Bt)p.includes(a)&&V.push({key:`rarity-${a}`,label:Tt(a),onRemove:()=>Me(a)});return L&&V.push({key:"smart",label:s("filter.smart"),onRemove:()=>x({smart:!1})}),E&&V.push({key:"deals",label:s("filter.deals"),onRemove:()=>x({deals:!1,sort:"newest"})}),k!==c&&V.push({key:"status",label:k==="all"?s("filter.statusAll"):k==="on_sale"?s("filter.onSale"):s("filter.notForSale"),onRemove:()=>ze(c)}),e.jsxs(Pt,{"data-testid":"browse",children:[$!=="names"&&e.jsxs(e.Fragment,{children:[A?e.jsx(Ft,{onClick:()=>T(!1),"aria-hidden":!0}):null,e.jsxs(Ot,{"data-open":A||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(Ut,{children:[e.jsx(Ht,{children:s("assets.filters")}),e.jsx(Dt,{onClick:()=>T(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(Gt,{children:e.jsx(qt,{category:$,subCategory:S,onCategory:Ae,onSub:a=>x({subCategory:a}),priceMin:g,priceMax:I,onPriceMin:a=>x({priceMin:a}),onPriceMax:a=>x({priceMax:a}),rarities:p,onToggleRarity:Me,status:k,onStatus:ze,hideNames:o,smart:L,onSmart:a=>x({smart:a}),deals:E,onDeals:y?a=>x(a?{deals:!0,sort:"discount"}:{deals:!1,sort:"newest"}):void 0})}),e.jsx(Vt,{children:e.jsx(Zt,{type:"button",onClick:()=>T(!1),children:s("assets.showItems")})})]})]}),e.jsx(Qt,{children:$==="names"?e.jsx(qs,{onBack:()=>Ae("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{sort:N,sortOptions:R,onSort:a=>x({sort:a}),total:O,loading:U||q,query:l,onOpenFilters:()=>T(!0),chips:V,onClearChips:ct}),it&&z&&P.some(a=>a.source==="legacy")?e.jsx(Vs,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,Re?e.jsx(tn,{message:s("assets.loadError"),testId:"browse-error"}):null,!Le&&P.length===0&&!Re?e.jsx(Rt,{testId:"browse-empty",icon:Nt,title:s("assets.empty.title"),body:m?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:m}),s("assets.empty.searchAfter")]}):s("assets.empty.filters"),cta:{label:s("assets.empty.cta"),onClick:()=>b("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(mn,{"data-testid":"grid",children:Le?e.jsx(Be,{count:lt}):e.jsxs(e.Fragment,{children:[P.map(a=>{if(!z)return e.jsx(te,{item:a,mode:"view"},ne(a));const H=a;if(H.source!=="legacy")return e.jsx(te,{item:a},ne(a));const ee=at(H);return ee==null?e.jsx(te,{item:a,mode:"view"},ne(a)):e.jsx(te,{item:{...H,priceCredits:ee}},ne(a))}),_e?e.jsx(Be,{count:6}):null]})}),e.jsx(Jt,{hasNextPage:tt,isFetching:_e,isError:nt,onLoadMore:()=>void st()})]})]})})]})}export{gi as Assets};
|
|
939
|
-
//# sourceMappingURL=Assets-
|
|
939
|
+
//# sourceMappingURL=Assets-CamziJEW.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as P,r as B}from"./react-
|
|
1
|
+
import{j as e,L as P,r as B}from"./react-CfmD1IrY.js";import{d as o,e as n,B as K,w as F,x as Q,c as i,y as H,s as X,I as v,z as V,v as k,A as Z,f as J,D as U,E as T,n as Y,F as tt,G as D}from"./index-BFHMpeS5.js";import{a as et,b as it,c as C,d as ot,e as at,s as nt,f as st}from"./authorizations-j1Fdv_CY.js";import{f as rt}from"./builder-Qpv88cHd.js";import{m as M}from"./mana-matic-CEqvSwrJ.js";import{f as ct}from"./errors-BByokafR.js";import"./dcl-schemas-CEEV5Gwi.js";import"./sentry-TFqjegNi.js";import"./ethers-BfnXvuxS.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-C43xk9UA.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="5faa2296-661d-40e4-9bff-218c02419a2d",t._sentryDebugIdIdentifier="sentry-dbid-5faa2296-661d-40e4-9bff-218c02419a2d")}catch{}})();const lt=F`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,dt=F`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -189,4 +189,4 @@ import{j as e,L as P,r as B}from"./react-CJ0-yyn7.js";import{d as o,e as n,B as
|
|
|
189
189
|
`,q=n(K)`
|
|
190
190
|
margin-top: 12px;
|
|
191
191
|
`;function y({descriptor:t,owner:s,signer:r,name:a,description:c,image:d,icon:m,revokeOnly:$=!1}){const g=Z(),[z,j]=B.useState(!1),{data:u,isLoading:l,refetch:h}=k({queryKey:["authorization",t.id,s],queryFn:()=>st(t,s),staleTime:3e4});async function p(){if(z||l)return;const w=!u;j(!0);try{await nt({auth:t,signer:r,active:w}),await h(),g.setQueryData(["authorization",t.id,s],w),T.success(w?i("authorizations.toastActivated",{name:a}):i("authorizations.toastDeactivated",{name:a}))}catch(I){Y(I,{flow:"authorizations",step:w?"grant":"revoke"}),T.error(ct(I,i("authorizations.errorGeneric")))}finally{j(!1)}}if($&&u===!1)return null;const f=l?i("authorizations.checking"):u?i("authorizations.active"):i("authorizations.inactive");return e.jsxs(gt,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[e.jsx(ft,{children:d?e.jsx("img",{src:d,alt:""}):m}),e.jsxs(xt,{children:[e.jsx(yt,{title:a,children:a}),e.jsx(bt,{children:c})]}),e.jsxs(jt,{children:[e.jsx(zt,{"data-active":!!u,children:f}),z?e.jsx(vt,{"aria-label":i("authorizations.working")}):e.jsx(wt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?i("authorizations.deactivateAria",{name:a}):i("authorizations.activateAria",{name:a}),disabled:l,onClick:()=>void p()})]})]})}const b=500,G=10,$t=b*G;async function O(t,s){const r=await D(t,{category:s,first:b}),a=Math.min(Math.ceil(r.total/b),G),c=await Promise.all(Array.from({length:Math.max(0,a-1)},(d,m)=>D(t,{category:s,first:b,skip:(m+1)*b})));return{assets:[...r.assets,...c.flatMap(d=>d.assets)],truncated:r.total>$t}}function Ct(t){return k({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([O(t,"wearable"),O(t,"emote")]),a=new Map;for(const c of[...s.assets,...r.assets]){const d=c.contractAddress.toLowerCase();a.has(d)||a.set(d,c)}return{collections:[...a.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function At(t){return k({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:tt})}function Et(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const a=U(t);return a===t?i("authorizations.collectionFallback"):a}function It(t,s){return k({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await rt(t,s),a=new Map;for(const c of r){const d=c.contractAddress.toLowerCase();a.has(d)||a.set(d,c)}return[...a.values()]}})}function Ft(){Q({title:i("authorizations.title"),noindex:!0});const{session:t,signIn:s}=H(),r=J.chainId,a=X(t==null?void 0:t.providerType),{data:c,isLoading:d}=Ct(a?t==null?void 0:t.address:void 0),{data:m,isLoading:$}=At(!!a&&!!(t!=null&&t.address)),{data:g,isLoading:z}=It(a?t==null?void 0:t.address:void 0,a?t==null?void 0:t.identity:void 0);if(!t)return e.jsxs(N,{children:[e.jsx(v,{name:"info",size:40,color:o.colors.muted2}),e.jsx(R,{children:i("authorizations.signInTitle")}),e.jsx(W,{children:i("authorizations.signInBody")}),e.jsx(q,{variant:"white",onClick:()=>s(),children:i("storeSettings.signIn")})]});if(!a)return e.jsxs(N,{children:[e.jsx(v,{name:"check",size:40,color:o.colors.ok}),e.jsx(R,{children:i("authorizations.managedTitle")}),e.jsx(W,{children:i("authorizations.managedBody")}),e.jsx(q,{as:P,to:"/items",variant:"white",children:i("authorizations.managedCta")})]});const j=et(r),u=it(r);return e.jsxs(ut,{children:[e.jsxs(ht,{children:[e.jsx(pt,{children:i("authorizations.title")}),e.jsx(mt,{children:i("authorizations.intro")})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.buyingTitle")}),e.jsxs(x,{children:[e.jsx(y,{descriptor:j,owner:t.address,signer:t.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:e.jsx(V,{className:"ccy-mark"})}),e.jsx(y,{descriptor:u,owner:t.address,signer:t.signer,name:i("authorizations.manaName"),description:i("authorizations.manaDesc"),icon:e.jsx(L,{src:M,alt:"","aria-hidden":!0})}),C(u).map(l=>e.jsx(y,{descriptor:l,owner:t.address,signer:t.signer,name:`${i("authorizations.manaName")} ${i("authorizations.previousVersion")}`,description:i("authorizations.manaDesc"),icon:e.jsx(L,{src:M,alt:"","aria-hidden":!0}),revokeOnly:!0},l.id))]})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.sellingTitle")}),c!=null&&c.truncated?e.jsx(kt,{"data-testid":"authorizations-selling-truncated",children:i("authorizations.sellingTruncated",{count:c.scanned})}):null,d||$?e.jsx(x,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((l,h)=>e.jsx(S,{"aria-hidden":!0},h))}):c&&c.collections.length>0?e.jsx(x,{children:c.collections.flatMap(l=>{const h=ot(l.contractAddress,r);return[h,...C(h)].map((p,f)=>e.jsx(y,{descriptor:p,owner:t.address,signer:t.signer,name:Et(l.contractAddress,m),description:i("authorizations.sellingDesc"),image:l.image,icon:e.jsx(v,{name:"pen",size:18}),revokeOnly:f>0},p.id))})}):e.jsx(_,{children:i("authorizations.sellingEmpty")})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.mintingTitle")}),z?e.jsx(x,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((l,h)=>e.jsx(S,{"aria-hidden":!0},h))}):g&&g.length>0?e.jsx(x,{children:g.flatMap(l=>{const h=at(l.contractAddress,r);return[h,...C(h)].map((p,f)=>e.jsx(y,{descriptor:p,owner:t.address,signer:t.signer,name:l.name||i("authorizations.collectionFallback"),description:i("authorizations.mintingDesc"),icon:e.jsx(v,{name:"pen",size:18}),revokeOnly:f>0},p.id))})}):e.jsx(_,{children:i("authorizations.mintingEmpty")})]})]})}export{Ft as Authorizations};
|
|
192
|
-
//# sourceMappingURL=Authorizations-
|
|
192
|
+
//# sourceMappingURL=Authorizations-qhSo3l9v.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as Qt,r as T,u as ma,b as fa}from"./react-
|
|
1
|
+
import{j as e,L as Qt,r as T,u as ma,b as fa}from"./react-CfmD1IrY.js";import{e as i,d as E,c as a,z as Pe,K as ae,bi as Fe,C as Me,bj as ya,J as Le,bk as ba,H as va,I as Y,o as Xe,x as wa,ai as H,N as jt,y as Ca,a0 as ja,v as ka,bl as $a,A as Sa,bm as Ma,O as Ta,bn as Pa,bo as kt,Q as Ia,bp as Aa,bq as za,br as Ea,av as Ke,s as Ba,bs as $t,ak as V,bt as St,bu as Ra,bv as _a,n as re,bw as qa,bx as Wa,by as Fa,bz as Ne,a2 as La,bA as we,bB as Ce,bC as Mt,bD as Ka,k as Tt,m as Pt,bE as Na}from"./index-BFHMpeS5.js";import{M as Qa,S as Ua,C as Ga,H as Oa,a as Ha,T as Da,X as Va,b as Ya,B as Ja,c as Xa,d as It,e as Za,f as Ie,g as es,h as ts,i as as,j as ss,k as Je,l as pe,L as ns,P as is,m as At,n as zt,W as rs,o as os,p as cs,q as ls,A as ds,r as us,s as hs,t as ps,u as gs,v as xs,w as ms,x as fs,y as ys,z as bs,D as vs,E as ws,F as Cs,G as js,I as ks,J as $s,K as Ss,N as Qe,O as Ms,Q as Ts,R as Ps,U as Et,V as Bt,Y as Is,Z as As,_ as zs,$ as Es,a0 as Rt,a1 as Bs}from"./CollectionCarousel-Crm-0uNM.js";import{m as Te}from"./mana-matic-light-Bl5duieC.js";import{l as Rs,n as _s,f as qs,o as Ws,h as Fs,A as Ls}from"./authorizations-j1Fdv_CY.js";import{p as _t,g as Ks,h as Ue}from"./buy-BKz4g0wV.js";import{w as Ns,S as Ge,b as Qs,G as Us}from"./buy-gasless-BxHAW80t.js";import{u as Gs,M as Os,R as je,r as Hs,c as Ds,g as Vs,a as Ys,p as qt,b as Oe}from"./useCreditPacks-BPkAbyaH.js";import{i as Js,a as Xs}from"./errors-BByokafR.js";import{E as Zs}from"./ErrorNotice-DFD2N4ZG.js";import"./dcl-schemas-CEEV5Gwi.js";import"./sentry-TFqjegNi.js";import"./ethers-BfnXvuxS.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-C43xk9UA.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new r.Error().stack;d&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[d]="68361dc4-4786-4303-a9ac-9202bbc78aec",r._sentryDebugIdIdentifier="sentry-dbid-68361dc4-4786-4303-a9ac-9202bbc78aec")}catch{}})();const en=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -745,4 +745,4 @@ import{j as e,L as Qt,r as T,u as ma,b as fa}from"./react-CJ0-yyn7.js";import{e
|
|
|
745
745
|
margin-top: 0;
|
|
746
746
|
}
|
|
747
747
|
`;function Ve(r){if(Js(r))return a("errors.rejected");const d=(r.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Me.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ni=12e4;function ii(r){const d=[];return r.unavailable.length&&d.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&d.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=r=>r.reduce((d,k)=>d+k.priceCredits*k.quantity,0),Se=r=>r.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function wi(){var Ct;wa({title:a("nav.cart"),noindex:!0});const r=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),$=H(t=>t.decrement),B=H(t=>t.clear),U=H(t=>t.restore),O=H(t=>t.setFittingOpen),A=jt(t=>t.items),J=jt(t=>t.toggle),{session:n,signIn:G}=Ca(),Yt=ja(),ge=Gs().packs.slice(0,Os);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Jt=r.some(t=>t.category!=="emote"),{data:Ae}=ka({queryKey:["upsell-listings"],queryFn:()=>Na({first:40}),staleTime:6e4}),{data:j}=$a(n),b=Sa(),X=ma(),{state:R}=fa(),[Xt,le]=T.useState(null),[Ze,xe]=T.useState(null),[Zt,_]=T.useState(!1),[q,D]=T.useState(null),et=T.useRef(0),[h,S]=T.useState(null),{data:me}=Ma(n),{data:de}=Ta(!0),[ze,tt]=T.useState(""),ue=T.useRef(null),at=Pa(r),st=t=>$t(at[t.id]),Ee=r.filter(st),nt=r.length>0&&Ee.length===0,ea=Ee.reduce((t,s)=>t+s.priceCredits*s.quantity,0),ta=r.reduce((t,s)=>t+s.quantity,0),aa=Ee.reduce((t,s)=>t+s.quantity,0),it=q?q.liveTotalCredits:ea,sa=new Set(r.map(t=>t.id)),rt=((Ae==null?void 0:Ae.items)??[]).filter(t=>!sa.has(t.id)).slice(0,12),na=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),fe=(j==null?void 0:j.credits)??0,Be=it*10,ia=de?kt(Be,de):0n,Re=Qe({priceCents:Be,priceManaWei:ia,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:me??0n}),ra=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),oa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),ca=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),la=Ra,da=t=>Wa(t.contractAddress,String(t.itemId));function ye(t){t(),D(null),xe(null),le(null)}function ua(){S(null),_(!1)}function ot(t){const s=Ye(t),o=Math.max(0,s-fe),c=ge.find(u=>u.credits>=o)??ge[ge.length-1];tt(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:fe,shortfall:o}),S({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:o}),_(!1)}async function _e(t){if(!n||t.length===0)return;const s=Se(t),o=s.map(f=>({...f.item,priceCredits:f.priceCredits})),c=t.map(f=>({...f.item,priceCredits:f.priceCredits,quantity:f.quantity})),u=[];let v="authorize";const g=new Set,M=new Set,L=new Set,W=[];let w=!1;S({phase:"processing",stage:"reserving",step:1,total:s.length});try{const f=[],z=Vs(s,_t);let K=0;for(const p of z){S({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:m,maxCreditedValue:y}=await Fa(n.identity,p.units.map(Ys));p.units.forEach((Q,ie)=>{u.push({salt:m.id,itemId:Q.item.id}),f.push({...p.drafts[ie],credits:[m],maxCreditedValue:y})}),K+=p.units.length}catch(m){if(Xs(m)){if(u.length){try{await Ne(n.identity,[...new Set(u.map(y=>y.salt))])}catch(y){re(y,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}ot(t);return}throw m}}u.length&&b.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Ks(f).length,te=p=>N>1?{current:p,total:N}:void 0,F=(p,m)=>S({phase:"processing",stage:p,step:s.length,total:s.length,signatures:te(m)}),C=p=>p<N?F("awaiting-signature",p+1):F("settling",N);F("awaiting-signature",1);let x=[];const P=new Map,se=async p=>{const m=await Promise.allSettled(p.map(y=>Ns(y)));return m.forEach((y,Q)=>{const ie=P.get(p[Q])??[];y.status==="fulfilled"?(ie.forEach(We=>M.add(We)),W.push(p[Q])):y.reason instanceof Ge||ie.forEach(We=>L.add(We))}),m.flatMap(y=>y.status==="rejected"?[y.reason]:[])};if(Rs())try{let p=0;x=await Qs({purchases:f,buyer:n.address,signer:n.signer,identity:n.identity,onSigned:()=>F("settling",Math.min(p+1,N)),onBroadcast:({txHash:y,salts:Q})=>{p+=1,P.set(y,Q),Q.forEach(ie=>g.add(ie))},onGroupSettling:({settled:y})=>F("settling",y)});const m=await se(x);if(m.length&&!m.some(y=>y instanceof Ge))throw m[0];w=!0}catch(p){if(p instanceof Ge)throw await se([...P.keys()]),p;if(!(p instanceof Us)||!La(n.providerType))throw p;x=await Ue({purchases:f,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:m})=>m.forEach(y=>g.add(y)),onSettled:({txHash:m,salts:y})=>{y.forEach(Q=>M.add(Q)),W.push(m)},onReverted:({salts:m})=>m.forEach(y=>L.add(y))})}else x=await Ue({purchases:f,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(m=>g.add(m)),onSettled:({txHash:p,salts:m})=>{m.forEach(y=>M.add(y)),W.push(p)},onReverted:({salts:p})=>p.forEach(m=>L.add(m))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"credits",no_crypto_step:w,transaction_hash:x[0]??null}),Bt(b);const ve=ue.current;ue.current=null,S(null),_(!1);const ne={items:c,txHash:x[0]??void 0,txHashes:x,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:ne,replace:!0})}catch(f){Ce(f)||re(f,{flow:"cart_checkout",step:v,cart_size:t.length});const z=new Set([...g].filter(x=>!L.has(x))),{toRelease:K,boughtItemIds:N}=qt({reservations:u,spent:z,settled:M}),te=[...z].some(x=>!M.has(x)),F=o.filter(x=>N.includes(x.id)),C=o.filter(x=>!N.includes(x.id));if(V(Ce(f)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Mt(f),value_usd:St(C.reduce((x,P)=>x+P.priceCredits,0)),cart_size:s.length,partial:F.length>0}),K.length)try{await Ne(n.identity,K)}catch(x){re(x,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),F.length>0){N.forEach(x=>d(x)),D(null),Bt(b),V("Shop Completed Purchase",{...we(F),payment_type:"credits",no_crypto_step:w,transaction_hash:W[0]??null,partial:!0}),S({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:te}),_(!1);return}S({phase:"error",message:te?void 0:Ve(f),heldCredits:te})}}function ct(t,s){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const o=ue.current;ue.current=null,S(null),_(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function lt(t,s){Ce(t)||re(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Mt(t)}),S({phase:"error",message:Ve(t)}),_(!1)}async function ha(t,s,o){const c=Tt(Pt.MANAToken,s),u=Tt(Pt.CreditsManager,s);await Fs({auth:{kind:Ls.Allowance,contractAddress:c.address,spenderAddress:u.address,chainId:s},signer:t,requiredWei:o})}async function dt(){if(de)return de;try{return await b.fetchQuery(qa())}catch{return}}async function pa(t){const s=Se(t).reduce((v,g)=>v+g.usdCents,0),c=(me??0n)>0n?await dt():de,u=c?kt(s,c):0n;return{totalCents:s,manaWei:u}}async function ut(t,s){const o=Ye(t),{totalCents:c,manaWei:u}=await pa(t),v=Qe({priceCents:c,priceManaWei:u,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:me??0n});if(s&&v.options.some(g=>g.method===s)){if(s==="credits"){_e(t);return}const g=xt(v,s);await pt(ht(s,t),g,()=>s==="mana"?void mt(t,g):void ft(t,c,u));return}if(v.options.some(g=>g.method==="mana"||g.method==="combined")){S({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if(j!=null&&j.credits<o){ot(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:me??0n})}const[he,be]=T.useState(null);function ht(t,s){const o=new Map;for(const c of s){const u=Is(t,Oe(c));o.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...o.values()]}async function pt(t,s,o){const c=[];for(const{spender:u,chainId:v}of t){const g=_s(v,u),M=n?await qs(g,n.address,s).catch(()=>!0):!0;Ws(n==null?void 0:n.providerType,M)&&c.push(g)}if(c.length===0){o();return}_(!1),gt(c,0,o)}function gt(t,s,o){be({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?gt(t,s+1,o):o()})}function xt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function ga(t){if((h==null?void 0:h.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=h;if(t==="credits"){_e(s);return}const u=xt(qe(h),t);pt(ht(t,s),u,()=>t==="mana"?void mt(s,u):void ft(s,o,c))}async function mt(t,s){if(!n||t.length===0)return;const o=Se(t),c=o.map(g=>({...g.item,priceCredits:g.priceCredits})),u=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),v=()=>S({phase:"processing",stage:"settling",step:o.length,total:o.length});S({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const g=await As({trades:oa(o),coupons:ca(o),mints:ra(o),buyer:n.address,signer:n.signer,onSigned:v,manaWei:s});t.forEach(M=>d(M.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:g[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),ct(u,g)}catch(g){lt(g,"buy_cart_mana")}}async function ft(t,s,o){if(!n||t.length===0)return;const c=Se(t),u=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),g=zs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),M=[],L=new Set,W=new Set;S({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),f=[],z=new Map,K=new Map;for(let C=0;C<c.length;C++){const x=c[C],P=w[C],se=g[C],ve=Es(Math.max(0,x.usdCents-se),s,o);let ne;if(se<=0)ne=Rt(P,[],"0");else{S({phase:"processing",stage:"reserving",step:C+1,total:c.length});const m=x.item,{credit:y,maxCreditedValue:Q}=await Ka(n.identity,se,P.kind==="trade"?P.trade.id:void 0,m.contractAddress&&m.itemId!=null?{contractAddress:m.contractAddress,itemId:String(m.itemId)}:void 0);M.push({salt:y.id,itemId:m.id}),ne=Rt(P,[y],Q)}const p=_t(ne);z.set(p,(z.get(p)??0n)+ve),K.has(p)||K.set(p,f.length),f.push(ne)}M.length&&b.invalidateQueries({queryKey:["usd-balance"]});for(const[C,x]of z){const P=K.get(C);P==null||x<=0n||(f[P]={...f[P],maxCreditedValue:(BigInt(f[P].maxCreditedValue)+x).toString()})}const N=[...z.values()].reduce((C,x)=>C+x,0n);await ha(n.signer,Bs(w[0]),N);const te=()=>S({phase:"processing",stage:"settling",step:c.length,total:c.length});S({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const F=await Ue({purchases:f,buyer:n.address,signer:n.signer,onSigned:te,onBroadcast:({salts:C})=>C.forEach(x=>L.add(x)),onReverted:({salts:C})=>C.forEach(x=>W.add(x))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(u),payment_type:"credits_and_mana",transaction_hash:F[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),ct(v,F)}catch(w){const{toRelease:f}=qt({reservations:M,spent:new Set([...L].filter(z=>!W.has(z))),settled:new Set});f.length&&Ne(n.identity,f).catch(()=>{}),M.length&&b.invalidateQueries({queryKey:["usd-balance"]}),lt(w,"buy_cart_combined")}}async function Z(t){if(!n){Et({type:"cart-checkout"}),G();return}const s=H.getState().items.filter(st);if(s.length===0)return;le(null),xe(null),_(!0);const o=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:St(o),has_sufficient_credits:fe>=o});try{const c=await Hs(s,n.address,la,await dt(),da,_a),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(v=>d(v.id)),xe(ii(c))),c.buyable.length===0){le(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),et.current=Date.now();return}await ut(c.buyable,t)}catch(c){re(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),le(Ve(c))}finally{_(!1)}}async function yt(){if(q){if(!n){Et({type:"cart-checkout"}),G();return}if(Date.now()-et.current>ni){D(null),xe(null),await Z();return}le(null),ut(q.buyable)}}async function xa(){if(ze){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}_(!0);try{const t=await Ds(ze,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(je)}catch{}re(t,{flow:"cart_buy_credits"}),S({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const bt=T.useRef(!1);T.useEffect(()=>{if(!n||bt.current||!Ms("cart-checkout"))return;bt.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const vt=T.useRef(!1);T.useEffect(()=>{if(!(R!=null&&R.resumeCheckout)||vt.current)return;vt.current=!0,ue.current=R.creditsAdded??null;try{const s=sessionStorage.getItem(je);if(s){sessionStorage.removeItem(je);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[R==null?void 0:R.resumeCheckout]);const wt=T.useRef(!1);T.useEffect(()=>{if(!(R!=null&&R.startCheckout)||wt.current)return;wt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[R==null?void 0:R.startCheckout]);const ee=Zt||(h==null?void 0:h.phase)==="processing";return r.length===0&&!h?e.jsx(Ft,{children:e.jsxs(Kt,{children:[e.jsxs(Lt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(vn,{children:e.jsx(Ia,{variant:"light",testId:"cart-empty",icon:Aa,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})}):e.jsxs(Ft,{children:[e.jsxs(Kt,{children:[e.jsxs(Lt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(mn,{children:[e.jsxs(fn,{children:[e.jsxs(yn,{children:[e.jsx(wn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx(Cn,{children:a("cart.panelTitle",{count:ta})}),Jt?e.jsxs(jn,{onClick:()=>O(!0),disabled:ee,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(bn,{children:[e.jsx(kn,{children:r.map(t=>{const s=na.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,v=t.quantity,g=typeof t.available=="number"&&v>=t.available,M=o*v,L=za(t),W=!!L&&!!A[L],w=Ea(t),f=at[t.id],z=!$t(f),K=f==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs($n,{"data-unavailable":z||void 0,children:[e.jsxs(Sn,{"data-thumb":!0,children:[w?e.jsx(Mn,{to:w,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Tn,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Pn,{children:[e.jsxs(In,{"data-desc":!0,children:[w?e.jsx(zn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(An,{title:t.name,children:t.name}),t.creator?e.jsx(En,{address:t.creator,linkToProfile:!0}):null,Yt&&u?e.jsxs(Qn,{"data-testid":"cart-creator-tag",children:[e.jsx(Un,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Bn,{children:z?e.jsxs(Kn,{children:[e.jsx(Nn,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Rn,{children:[e.jsx(Nt,{onClick:()=>ye(()=>$(t.id)),disabled:ee||v<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(_n,{children:v}),e.jsx(Nt,{onClick:()=>ye(()=>k(t.id)),disabled:ee||g,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(qn,{children:[e.jsx(Wn,{})," ",e.jsx(Ke,{credits:M}),c?e.jsx(Fn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Ln,{children:[L?e.jsx(Gn,{"data-on":W||void 0,onClick:()=>J(t),"aria-label":W?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:W?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:W?"heart-solid":"heart"})}):null,e.jsx(On,{onClick:()=>ye(()=>d(t.id)),disabled:ee,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Hn,{children:e.jsx("button",{className:"link",onClick:()=>ye(B),disabled:ee,children:a("cart.clearCart")})})]})]}),e.jsxs(Dn,{children:[e.jsx(Vn,{children:a("cart.purchaseSummary")}),e.jsxs(Yn,{children:[e.jsxs(Jn,{children:[e.jsx(Xn,{children:a("cart.totalItems",{count:aa})}),e.jsx(ei,{children:e.jsxs(Zn,{children:[e.jsx(ti,{})," ",e.jsx(Ke,{credits:it})]})})]}),e.jsx(Gt,{options:Re.options,totalCents:Be,shortfall:Re.manaShortfall,showCreditsAmount:!1,creditsLabel:q?a("marketCheckout.confirmPurchase"):Re.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:ee||nt,onPay:t=>void(q?yt():Z(t)),creditsFallback:{label:ee?a("cart.working"):q?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(q?yt():Z())}}),nt?e.jsx($e,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx($e,{className:"muted",children:a("cart.signInHint")}),q?e.jsx($e,{className:"muted",children:a("cart.priceChanged")}):null,Ze?e.jsx($e,{className:"muted",children:Ze}):null,e.jsx(ai,{message:Xt})]})]})]})]}),rt.length>0?e.jsx(si,{children:e.jsx(Ts,{title:a("cart.youMightAlsoLike"),items:rt})}):null,he&&n?e.jsx(Ps,{auth:he.auth,signer:n.signer,step:{index:he.index,total:he.total},title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Te,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=he;be(null),t()},onCancel:()=>be(null),onClose:()=>be(null)}):null,h?e.jsx(hn,{phase:h.phase,balanceCredits:fe,heldCreditsCount:((Ct=j==null?void 0:j.held)==null?void 0:Ct.credits)??null,onClose:ua,stage:h.phase==="processing"?h.stage:void 0,step:h.phase==="processing"?h.step:void 0,total:h.phase==="processing"?h.total:void 0,isSelfCustody:Ba(n==null?void 0:n.providerType),signatures:h.phase==="processing"?h.signatures:void 0,options:h.phase==="choose"?qe(h).options:void 0,shortfall:h.phase==="choose"?qe(h).manaShortfall:void 0,onPay:ga,totalCents:h.phase==="choose"?h.totalCents:void 0,totalManaWei:h.phase==="choose"?h.manaWei:void 0,totalCredits:h.phase==="choose"?Ye(h.lines):void 0,lines:h.phase==="nofunds"?h.lines:void 0,shortfallCredits:h.phase==="nofunds"?h.shortfall:void 0,packs:ge,selectedPack:ze,onSelectPack:tt,onBuyPacks:()=>void xa(),message:h.phase==="error"?h.message:void 0,heldCredits:h.phase==="error"&&!!h.heldCredits,onRetry:()=>void Z()}):null]})}export{wi as Cart};
|
|
748
|
-
//# sourceMappingURL=Cart-
|
|
748
|
+
//# sourceMappingURL=Cart-BdU4pPj2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as h,d as se,u as oe}from"./react-
|
|
1
|
+
import{j as e,r as h,d as se,u as oe}from"./react-CfmD1IrY.js";import{d as x,e as u,n as re,I as ae,w as ie,c as r,a5 as K,D as F,bK as ne,bL as le,f as ce,bZ as de,v as ue,x as me,ay as pe,Q as fe,S as W,R as he,bM as be,b_ as xe}from"./index-BFHMpeS5.js";import{E as ge}from"./ErrorNotice-DFD2N4ZG.js";import{d as ye,P as ve,C as je,a as E,b as we,S as Ce}from"./collectionPage.styles-DrR8c6dI.js";import{u as ke}from"./useStore-sOfyAYYH.js";import{u as Se,S as G,R as $e,a as Ne,b as Ee,c as Ie,D as Fe,d as Me,C as Re,e as _e,F as Te,f as Ae,g as Pe,M as De,h as Le}from"./browseLayout.styles-CzgQMQ68.js";import{L as Be}from"./LoadMore-C13YO4Ex.js";import{u as ze}from"./useInfiniteGrid-jWb4qfov.js";import{u as Oe,s as We}from"./search-empty-BWTzk53_.js";import{S as Ge}from"./categories-D8j8Cra5.js";import{G as Ue}from"./grid.styles-C29Nyu4C.js";import"./dcl-schemas-CEEV5Gwi.js";import"./sentry-TFqjegNi.js";import"./ethers-BfnXvuxS.js";import"./intl-AKLEHPeO.js";import"./crumbs.styles-DZV0yuAO.js";import"./skeleton.styles-6rsyfkX0.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new o.Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="eb6a25d0-d960-4d0a-85b0-1c90dcedbb0d",o._sentryDebugIdIdentifier="sentry-dbid-eb6a25d0-d960-4d0a-85b0-1c90dcedbb0d")}catch{}})();const Ke=u.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${x.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -131,4 +131,4 @@ import{j as e,r as h,d as se,u as oe}from"./react-CJ0-yyn7.js";import{d as x,e a
|
|
|
131
131
|
background: ${j.blackBtn};
|
|
132
132
|
}
|
|
133
133
|
`;function lt({address:o}){var d,n;const{data:s}=K(o);if(!o)return null;const i=(s==null?void 0:s.name)||F(o),l=(n=(d=s==null?void 0:s.avatar)==null?void 0:d.snapshots)==null?void 0:n.face256,a=`${ce.profileUrl}/${o}`,m=ne(le({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??o}));return e.jsxs(at,{"data-testid":"creator-card",children:[l?e.jsx(U,{src:l,alt:"",loading:"eager",style:{backgroundColor:m}}):e.jsx(U,{as:"span","aria-hidden":!0,style:{backgroundColor:m}}),e.jsx(it,{title:i,children:i}),e.jsx(ot,{value:o,label:r("collection.copyAddress"),flow:"copy_creator_address",testId:"creator-card-copy",children:e.jsx("span",{children:F(o)})}),e.jsx(nt,{"data-testid":"creator-card-view",href:a,target:"_blank",rel:"noopener noreferrer",children:r("collection.viewProfile")})]})}const ct=48,dt=["all","on_sale","not_for_sale"];function Et(){var O;const{contractAddress:o}=se(),s=oe(),i=h.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[l,a]=Oe(i),{category:m,subCategory:d,rarities:n,priceMin:b,priceMax:f,smart:C,sort:M}=l,g=dt.includes(l.status)?l.status:"all",R=t=>a({status:t});Se(`${m}:${d??""}`);const[w,y]=h.useState(!1);h.useEffect(()=>{if(!w)return;const t=te=>{te.key==="Escape"&&y(!1)};document.addEventListener("keydown",t);const N=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=N}},[w]);const _=b&&!Number.isNaN(Number(b))?Number(b):void 0,T=f&&!Number.isNaN(Number(f))?Number(f):void 0,q=d?Ge[d]:void 0,H=(G.find(t=>t.key===M)??G[0]).server,A={contractAddress:o,category:m,rarities:n.length?n:void 0,wearableCategories:q,minPriceCredits:_,maxPriceCredits:T,isWearableSmart:C||void 0,isOnSale:g==="all"?void 0:g==="on_sale",sortBy:H},{items:Q,total:Z,isLoading:k,error:P,hasNextPage:V,isFetchingNextPage:D,isFetchNextPageError:J,fetchNextPage:X}=ze(["collection-page",A],t=>be({...A,first:ct,skip:t}),{enabled:!!o}),S=de(Q),{data:c}=ue({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),L=(c==null?void 0:c.name)||r("collection.fallbackTitle");me({title:c==null?void 0:c.name,description:c!=null&&c.name?r("seo.collection.description",{name:c.name}):void 0});const p=(c==null?void 0:c.creator)||((O=S[0])==null?void 0:O.creator),{data:$}=K(p),Y=($==null?void 0:$.name)||(p?F(p):"");function ee(t){a({category:t,subCategory:null})}function B(t){a({rarities:n.includes(t)?n.filter(N=>N!==t):[...n,t]})}function z(){a(i)}const v=[];(_!=null||T!=null)&&v.push({key:"price",label:r("filter.price"),onRemove:()=>{a({priceMin:"",priceMax:""})}});for(const t of $e)n.includes(t)&&v.push({key:`rarity-${t}`,label:pe(t),onRemove:()=>B(t)});return C&&v.push({key:"smart",label:r("filter.smart"),onRemove:()=>a({smart:!1})}),g!=="all"&&v.push({key:"status",label:g==="on_sale"?r("filter.onSale"):r("filter.notForSale"),onRemove:()=>R("all")}),e.jsxs(ve,{"data-testid":"collection-page",children:[e.jsxs(je,{"aria-label":r("collection.breadcrumbAria"),children:[e.jsx(E,{onClick:()=>s("/items"),children:r("collection.breadcrumb")}),p?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"/"}),e.jsx(E,{onClick:()=>s(`/items/creator/${p}`),children:Y}),e.jsx("span",{children:"/"}),e.jsx(E,{onClick:()=>s(`/items/creator/${p}?collections`),children:r("categories.collections")})]}):null,e.jsx("span",{children:"/"}),e.jsx(we,{children:L})]}),e.jsx(Ve,{name:L,creator:p}),e.jsxs(Ne,{"data-testid":"browse",children:[w?e.jsx(Ee,{onClick:()=>y(!1),"aria-hidden":!0}):null,e.jsxs(Ce,{children:[e.jsx(lt,{address:p}),e.jsxs(Ie,{"data-open":w||void 0,"data-static":!0,"data-testid":"browse-sidebar",children:[e.jsxs(Fe,{children:[e.jsx(Me,{children:r("assets.filters")}),e.jsx(Re,{onClick:()=>y(!1),"aria-label":r("assets.closeFilters"),children:"✕"})]}),e.jsx(_e,{children:e.jsx(Te,{category:m,subCategory:d,onCategory:ee,onSub:t=>a({subCategory:t}),priceMin:b,priceMax:f,onPriceMin:t=>a({priceMin:t}),onPriceMax:t=>a({priceMax:t}),rarities:n,onToggleRarity:B,status:g,onStatus:R,smart:C,onSmart:t=>a({smart:t}),hideNames:!0})}),e.jsx(Ae,{children:e.jsx(Pe,{type:"button",onClick:()=>y(!1),children:r("assets.showItems")})})]})]}),e.jsxs(De,{children:[e.jsx(Le,{sort:M,onSort:t=>a({sort:t}),total:Z,loading:k,onOpenFilters:()=>y(!0),chips:v,onClearChips:z}),P?e.jsx(ge,{message:r("collection.error")}):null,!k&&!P&&S.length===0?e.jsx(fe,{testId:"collection-empty",icon:We,title:r("assets.empty.title"),body:r("collection.empty"),cta:{label:r("filterBar.clearAll"),onClick:z}}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{"data-testid":"grid",children:k?e.jsx(W,{count:15}):e.jsxs(e.Fragment,{children:[S.map(t=>e.jsx(he,{item:t},t.id)),D?e.jsx(W,{count:6}):null]})}),e.jsx(Be,{hasNextPage:V,isFetching:D,isError:J,onLoadMore:()=>void X()})]})]})]})]})}export{Et as Collection,Et as default};
|
|
134
|
-
//# sourceMappingURL=Collection-
|
|
134
|
+
//# sourceMappingURL=Collection-EQ6zO1YD.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as C,j as r}from"./react-
|
|
1
|
+
import{r as C,j as r}from"./react-CfmD1IrY.js";import{s as ne,h as S,A as N,g as j,r as L,m as X,j as U,k as K}from"./authorizations-j1Fdv_CY.js";import{i as ie}from"./errors-BByokafR.js";import{d as l,e as n,w as oe,c as k,I as Q,n as E,aJ as re,bO as q,ce as se,k as A,m as M,aO as G,a2 as de,a3 as J,z as P,au as ce,cf as le,cg as H,R as he}from"./index-BFHMpeS5.js";import{E as pe}from"./ErrorNotice-DFD2N4ZG.js";import{j as ue,k as ge,l as fe,m as xe,n as me,o as I,q as be,s as we}from"./buy-BKz4g0wV.js";import{a as ve,w as ye,S as ke,G as Ce}from"./buy-gasless-BxHAW80t.js";import{M as B,E as F,s as Y}from"./sendMetaTransaction-C43xk9UA.js";import{C as Z}from"./ethers-BfnXvuxS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="349f8150-3a1f-4d16-b2f8-46009b7c18ab",t._sentryDebugIdIdentifier="sentry-dbid-349f8150-3a1f-4d16-b2f8-46009b7c18ab")}catch{}})();const $="shop:resume_after_signin",Ae=900*1e3;function gt(t){try{sessionStorage.setItem($,JSON.stringify({...t,at:Date.now()}))}catch{}}function ft(t){let e;try{e=sessionStorage.getItem($)}catch{return null}if(!e)return null;try{sessionStorage.removeItem($)}catch{}let a;try{a=JSON.parse(e)}catch{return null}return!a||a.type!==t||typeof a.at!="number"||Date.now()-a.at>Ae?null:a.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:a.path}}function xt(t,e){const a=(o,...u)=>void t.invalidateQueries({queryKey:e?[o,...u]:[o]});t.invalidateQueries({queryKey:["usd-balance"]}),t.invalidateQueries({queryKey:["detail-trade"]}),t.invalidateQueries({queryKey:["shop-item"]}),a("owned-token",e==null?void 0:e.contractAddress,e==null?void 0:e.tokenId),a("public-token",e==null?void 0:e.contractAddress,e==null?void 0:e.tokenId),a("item-resales",e==null?void 0:e.contractAddress,e==null?void 0:e.itemId),t.invalidateQueries({queryKey:["shop-items"]}),t.invalidateQueries({queryKey:["catalog-items"]}),t.invalidateQueries({queryKey:["overview-listings"]}),t.invalidateQueries({queryKey:["upsell-listings"]}),t.invalidateQueries({queryKey:["my-assets"]}),t.invalidateQueries({queryKey:["purchases"]}),t.invalidateQueries({queryKey:["owned-item-count"]})}const Me=oe`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,Te=n.div`
|
|
4
4
|
position: fixed;
|
|
@@ -184,7 +184,7 @@ import{r as C,j as r}from"./react-CJ0-yyn7.js";import{s as ne,h as S,A as N,g as
|
|
|
184
184
|
@media (prefers-reduced-motion: reduce) {
|
|
185
185
|
animation: none;
|
|
186
186
|
}
|
|
187
|
-
`;function mt({auth:t,signer:e,step:a,title:o,reason:u,name:c,image:m,icon:f,onAuthorized:x,onCancel:w,onClose:b}){const[p,g]=C.useState(!1),[s,y]=C.useState(null);async function h(){g(!0),y(null);try{await ne({auth:t,signer:e,active:!0}),x()}catch(d){ie(d)?y(k("authorizeStep.errorRejected")):(E(d,{flow:"authorize_step",kind:t.kind}),y(k("authorizeStep.errorGeneric"))),g(!1)}}return r.jsx(Te,{onClick:p?void 0:b,role:"presentation","data-testid":"authorize-step-scrim",children:r.jsxs(je,{onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":o,children:[r.jsxs(ze,{children:[r.jsx(We,{children:o}),a&&a.total>1?r.jsx(Ie,{"data-testid":"authorize-step-count",children:k("authorizeStep.stepOf",{index:a.index,total:a.total})}):null,r.jsx(Ee,{onClick:b,disabled:p,"aria-label":k("authorizeStep.close"),children:r.jsx(Q,{name:"close",className:"ico"})})]}),r.jsxs($e,{"data-testid":"authorize-step-row",children:[r.jsx(Se,{children:m?r.jsx("img",{src:m,alt:""}):f}),r.jsxs(Ne,{children:[r.jsx(Pe,{title:c,children:c}),r.jsx(Be,{children:u})]})]}),r.jsx(Fe,{children:k("authorizeStep.note")}),r.jsx(pe,{message:s}),r.jsxs(Ve,{children:[r.jsx(De,{type:"button",onClick:w,disabled:p,children:k("authorizeStep.cancel")}),r.jsx(Oe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void h(),disabled:p,children:p?r.jsxs(r.Fragment,{children:[r.jsx(qe,{"aria-hidden":!0}),k("authorizeStep.authorizing")]}):k("authorizeStep.authorize")})]})]})})}const bt="data:image/webp;base64,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",wt="https://cdn.decentraland.org/@dcl/shop/1.12.2-34971053975.commit-a7f84c8/_assets/buy-error-22UunaPC.png";function He(t,e){return(t+e-1n)/e}function Re(t,e,a){return t<=0||e<=0?0n:t>=e?a:He(a*BigInt(t),BigInt(e))}function vt(t){var b,p,g;const e=Number.isFinite(t.priceCents)?Math.max(0,Math.trunc(t.priceCents)):0,a=Number.isFinite(t.balanceCents)?Math.max(0,Math.trunc(t.balanceCents)):0,o=t.priceManaWei>0n?t.priceManaWei:0n,u=t.manaBalanceWei>0n?t.manaBalanceWei:0n;if(e<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];a>=e&&c.push({method:"credits",creditsCents:e,credits:re(e),manaWei:0n});const m=q(a)*se;if(o>0n&&m>0&&m<e){const s=e-m,y=Re(s,e,o);u>=y&&c.push({method:"combined",creditsCents:m,credits:q(m),manaWei:y})}o>0n&&u>=o&&c.push({method:"mana",creditsCents:0,credits:0,manaWei:o});const f=((b=c.find(s=>s.method==="credits"))==null?void 0:b.method)??((p=c.find(s=>s.method==="combined"))==null?void 0:p.method)??((g=c.find(s=>s.method==="mana"))==null?void 0:g.method)??null,w=!c.some(s=>s.method==="mana"||s.method==="combined")&&o>0n&&u>0n?{manaWei:u,manaCents:Le(u,e,o),priceCents:e}:null;return{options:c,preferred:f,manaShortfall:w}}function Le(t,e,a){return Number(t*BigInt(e)/a)}function yt(t,e){let a=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return t.map(o=>{const u=Number.isFinite(o)?Math.max(0,Math.trunc(o)):0,c=Math.min(u,a);return a-=c,c})}function kt(t,e){return t.options.find(a=>a.method===e)??null}async function Ct(t){const[e]=await _({...t,trades:[t.trade],coupons:t.coupon?{[t.trade.id]:t.coupon}:void 0});return e}async function At(t){const[e]=await _({...t,trades:[],mints:[t.mint]});return e}async function _(t){const{trades:e,coupons:a,mints:o=[],buyer:u,signer:c,onSigned:m,manaWei:f}=t;if(e.length===0&&o.length===0)throw new Error("No items to buy");const x=new Map;for(const p of e){const g=`${p.chainId}:${p.contract.toLowerCase()}:${a!=null&&a[p.id]?"coupon":"plain"}`,s=x.get(g);s?s.push(p):x.set(g,[p])}const w=new Map;for(const p of o){const g=w.get(p.chainId);g?g.push(p):w.set(p.chainId,[p])}const b=[];for(const p of x.values()){const g=a?p.map(s=>a[s.id]).filter(s=>s!=null):[];b.push(await Xe({trades:p,coupons:g.length?g:void 0,buyer:u,signer:c,onSigned:m,requiredManaWei:f}))}for(const[p,g]of w){const s=f??g.reduce((y,h)=>y+BigInt(h.item.priceWei),0n);b.push(await Ue({mints:g,chainId:p,buyer:u,signer:c,onSigned:m,requiredManaWei:s}))}return b}async function Xe(t){const{trades:e,coupons:a,buyer:o,signer:u,onSigned:c,requiredManaWei:m}=t,f=e[0],x=A(G(f.contract),f.chainId),w=A(M.MANAToken,f.chainId);await S({auth:{kind:N.Allowance,contractAddress:w.address,spenderAddress:x.address,chainId:f.chainId},signer:u,requiredWei:m});const b=e.map(h=>ge(h,o));if(a!=null&&a.length&&a.length!==e.length)throw new Error(`acceptWithCoupon needs one coupon per trade, got ${a.length} for ${e.length} trades`);const p=a!=null&&a.length?a.map((h,d)=>fe(h,e[d].sent.length)):void 0;if(j.enabled)try{const{selector:h,data:d}=p?xe(e,a??[],o,x.abi):me(e,o,x.abi),v=h+d.slice(2),T=L(),z=X(u.provider,T),O=await Y(z,T,v,x,{serverURL:j.relayerUrl});return c==null||c(),await U(O,"the MANA purchase"),O}catch(h){if(h instanceof B&&h.code===F.USER_DENIED||h instanceof K)throw h;E(h,{flow:"buy_mana",step:"gasless_fallback"})}await J(u.provider,f.chainId);const g=new Z(x.address,x.abi,u),s=p?await g.acceptWithCoupon(b,p,I(f.chainId)):await g.accept(b,I(f.chainId));return c==null||c(),(await s.wait()).transactionHash}async function Ue(t){const{mints:e,chainId:a,buyer:o,signer:u,onSigned:c,requiredManaWei:m}=t,f=A(M.CollectionStore,a),x=A(M.MANAToken,a),w=e.map(s=>s.item);if(await S({auth:{kind:N.Allowance,contractAddress:x.address,spenderAddress:f.address,chainId:a},signer:u,requiredWei:m}),j.enabled)try{const s=be(w,o,f.abi),y=L(),h=X(u.provider,y),d=await Y(h,y,s,f,{serverURL:j.relayerUrl});return c==null||c(),await U(d,"the MANA purchase"),d}catch(s){if(s instanceof B&&s.code===F.USER_DENIED||s instanceof K)throw s;E(s,{flow:"buy_mint_mana",step:"gasless_fallback"})}await J(u.provider,a);const p=await new Z(f.address,f.abi,u).buy(we(w,o),I(a));return c==null||c(),(await p.wait()).transactionHash}async function Mt(t){const{trade:e,coupon:a,...o}=t;return ee({target:{kind:"trade",trade:e,coupon:a},...o})}async function Tt(t){const{mint:e,...a}=t;return ee({target:{kind:"store",mint:e},...a})}async function ee(t){const{target:e,buyer:a,signer:o,credits:u,manaGapWei:c,providerType:m,onBroadcast:f,onReverted:x,onUnobservable:w}=t;if(u.length===0)throw new Error("No credits to spend — use the MANA-only rail for that");if(c<=0n)throw new Error("No MANA gap to cover — use the credits-only rail for that");const b=te(e),p=A(M.MANAToken,b),g=A(M.CreditsManager,b);await S({auth:{kind:N.Allowance,contractAddress:p.address,spenderAddress:g.address,chainId:b},signer:o,requiredWei:c});const y=(u.reduce((d,v)=>d+BigInt(v.availableAmount),0n)+c).toString(),h=Ke(e,u,y);if(j.enabled){let d;try{return d=await ve({purchase:h,buyer:a,signer:o}),f==null||f({txHash:d}),await ye(d),d}catch(v){if(v instanceof B&&v.code===F.USER_DENIED||v instanceof ke)throw v;if(!(v instanceof Ce))throw d&&(x==null||x({txHash:d})),v;if(v.reason==="relayer-unreachable")throw w==null||w(),v;if(!de(m))throw v;E(v,{flow:"buy_credits_and_mana",step:"gasless_fallback"})}}return ue({purchase:h,buyer:a,signer:o,onBroadcast:f,onReverted:x})}function te(t){return t.kind==="trade"?t.trade.chainId:t.mint.chainId}function Ke(t,e,a){return t.kind==="trade"?{kind:"trade",trade:t.trade,coupon:t.coupon,credits:e,maxCreditedValue:a}:{kind:"store",item:t.mint.item,chainId:t.mint.chainId,credits:e,maxCreditedValue:a}}function jt(t,e){const a=te(e);return t==="combined"?{spender:A(M.CreditsManager,a).address,chainId:a}:{spender:e.kind==="trade"?A(G(e.trade.contract),a).address:A(M.CollectionStore,a).address,chainId:a}}function zt(t){return r.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...t,children:r.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function Wt(t){return r.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...t,children:r.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:i,gradients:V,radius:ae,z:Qe}=l,Et=n.div`
|
|
187
|
+
`;function mt({auth:t,signer:e,step:a,title:o,reason:u,name:c,image:m,icon:f,onAuthorized:x,onCancel:w,onClose:b}){const[p,g]=C.useState(!1),[s,y]=C.useState(null);async function h(){g(!0),y(null);try{await ne({auth:t,signer:e,active:!0}),x()}catch(d){ie(d)?y(k("authorizeStep.errorRejected")):(E(d,{flow:"authorize_step",kind:t.kind}),y(k("authorizeStep.errorGeneric"))),g(!1)}}return r.jsx(Te,{onClick:p?void 0:b,role:"presentation","data-testid":"authorize-step-scrim",children:r.jsxs(je,{onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":o,children:[r.jsxs(ze,{children:[r.jsx(We,{children:o}),a&&a.total>1?r.jsx(Ie,{"data-testid":"authorize-step-count",children:k("authorizeStep.stepOf",{index:a.index,total:a.total})}):null,r.jsx(Ee,{onClick:b,disabled:p,"aria-label":k("authorizeStep.close"),children:r.jsx(Q,{name:"close",className:"ico"})})]}),r.jsxs($e,{"data-testid":"authorize-step-row",children:[r.jsx(Se,{children:m?r.jsx("img",{src:m,alt:""}):f}),r.jsxs(Ne,{children:[r.jsx(Pe,{title:c,children:c}),r.jsx(Be,{children:u})]})]}),r.jsx(Fe,{children:k("authorizeStep.note")}),r.jsx(pe,{message:s}),r.jsxs(Ve,{children:[r.jsx(De,{type:"button",onClick:w,disabled:p,children:k("authorizeStep.cancel")}),r.jsx(Oe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void h(),disabled:p,children:p?r.jsxs(r.Fragment,{children:[r.jsx(qe,{"aria-hidden":!0}),k("authorizeStep.authorizing")]}):k("authorizeStep.authorize")})]})]})})}const bt="data:image/webp;base64,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",wt="https://cdn.decentraland.org/@dcl/shop/1.13.0/_assets/buy-error-22UunaPC.png";function He(t,e){return(t+e-1n)/e}function Re(t,e,a){return t<=0||e<=0?0n:t>=e?a:He(a*BigInt(t),BigInt(e))}function vt(t){var b,p,g;const e=Number.isFinite(t.priceCents)?Math.max(0,Math.trunc(t.priceCents)):0,a=Number.isFinite(t.balanceCents)?Math.max(0,Math.trunc(t.balanceCents)):0,o=t.priceManaWei>0n?t.priceManaWei:0n,u=t.manaBalanceWei>0n?t.manaBalanceWei:0n;if(e<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];a>=e&&c.push({method:"credits",creditsCents:e,credits:re(e),manaWei:0n});const m=q(a)*se;if(o>0n&&m>0&&m<e){const s=e-m,y=Re(s,e,o);u>=y&&c.push({method:"combined",creditsCents:m,credits:q(m),manaWei:y})}o>0n&&u>=o&&c.push({method:"mana",creditsCents:0,credits:0,manaWei:o});const f=((b=c.find(s=>s.method==="credits"))==null?void 0:b.method)??((p=c.find(s=>s.method==="combined"))==null?void 0:p.method)??((g=c.find(s=>s.method==="mana"))==null?void 0:g.method)??null,w=!c.some(s=>s.method==="mana"||s.method==="combined")&&o>0n&&u>0n?{manaWei:u,manaCents:Le(u,e,o),priceCents:e}:null;return{options:c,preferred:f,manaShortfall:w}}function Le(t,e,a){return Number(t*BigInt(e)/a)}function yt(t,e){let a=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return t.map(o=>{const u=Number.isFinite(o)?Math.max(0,Math.trunc(o)):0,c=Math.min(u,a);return a-=c,c})}function kt(t,e){return t.options.find(a=>a.method===e)??null}async function Ct(t){const[e]=await _({...t,trades:[t.trade],coupons:t.coupon?{[t.trade.id]:t.coupon}:void 0});return e}async function At(t){const[e]=await _({...t,trades:[],mints:[t.mint]});return e}async function _(t){const{trades:e,coupons:a,mints:o=[],buyer:u,signer:c,onSigned:m,manaWei:f}=t;if(e.length===0&&o.length===0)throw new Error("No items to buy");const x=new Map;for(const p of e){const g=`${p.chainId}:${p.contract.toLowerCase()}:${a!=null&&a[p.id]?"coupon":"plain"}`,s=x.get(g);s?s.push(p):x.set(g,[p])}const w=new Map;for(const p of o){const g=w.get(p.chainId);g?g.push(p):w.set(p.chainId,[p])}const b=[];for(const p of x.values()){const g=a?p.map(s=>a[s.id]).filter(s=>s!=null):[];b.push(await Xe({trades:p,coupons:g.length?g:void 0,buyer:u,signer:c,onSigned:m,requiredManaWei:f}))}for(const[p,g]of w){const s=f??g.reduce((y,h)=>y+BigInt(h.item.priceWei),0n);b.push(await Ue({mints:g,chainId:p,buyer:u,signer:c,onSigned:m,requiredManaWei:s}))}return b}async function Xe(t){const{trades:e,coupons:a,buyer:o,signer:u,onSigned:c,requiredManaWei:m}=t,f=e[0],x=A(G(f.contract),f.chainId),w=A(M.MANAToken,f.chainId);await S({auth:{kind:N.Allowance,contractAddress:w.address,spenderAddress:x.address,chainId:f.chainId},signer:u,requiredWei:m});const b=e.map(h=>ge(h,o));if(a!=null&&a.length&&a.length!==e.length)throw new Error(`acceptWithCoupon needs one coupon per trade, got ${a.length} for ${e.length} trades`);const p=a!=null&&a.length?a.map((h,d)=>fe(h,e[d].sent.length)):void 0;if(j.enabled)try{const{selector:h,data:d}=p?xe(e,a??[],o,x.abi):me(e,o,x.abi),v=h+d.slice(2),T=L(),z=X(u.provider,T),O=await Y(z,T,v,x,{serverURL:j.relayerUrl});return c==null||c(),await U(O,"the MANA purchase"),O}catch(h){if(h instanceof B&&h.code===F.USER_DENIED||h instanceof K)throw h;E(h,{flow:"buy_mana",step:"gasless_fallback"})}await J(u.provider,f.chainId);const g=new Z(x.address,x.abi,u),s=p?await g.acceptWithCoupon(b,p,I(f.chainId)):await g.accept(b,I(f.chainId));return c==null||c(),(await s.wait()).transactionHash}async function Ue(t){const{mints:e,chainId:a,buyer:o,signer:u,onSigned:c,requiredManaWei:m}=t,f=A(M.CollectionStore,a),x=A(M.MANAToken,a),w=e.map(s=>s.item);if(await S({auth:{kind:N.Allowance,contractAddress:x.address,spenderAddress:f.address,chainId:a},signer:u,requiredWei:m}),j.enabled)try{const s=be(w,o,f.abi),y=L(),h=X(u.provider,y),d=await Y(h,y,s,f,{serverURL:j.relayerUrl});return c==null||c(),await U(d,"the MANA purchase"),d}catch(s){if(s instanceof B&&s.code===F.USER_DENIED||s instanceof K)throw s;E(s,{flow:"buy_mint_mana",step:"gasless_fallback"})}await J(u.provider,a);const p=await new Z(f.address,f.abi,u).buy(we(w,o),I(a));return c==null||c(),(await p.wait()).transactionHash}async function Mt(t){const{trade:e,coupon:a,...o}=t;return ee({target:{kind:"trade",trade:e,coupon:a},...o})}async function Tt(t){const{mint:e,...a}=t;return ee({target:{kind:"store",mint:e},...a})}async function ee(t){const{target:e,buyer:a,signer:o,credits:u,manaGapWei:c,providerType:m,onBroadcast:f,onReverted:x,onUnobservable:w}=t;if(u.length===0)throw new Error("No credits to spend — use the MANA-only rail for that");if(c<=0n)throw new Error("No MANA gap to cover — use the credits-only rail for that");const b=te(e),p=A(M.MANAToken,b),g=A(M.CreditsManager,b);await S({auth:{kind:N.Allowance,contractAddress:p.address,spenderAddress:g.address,chainId:b},signer:o,requiredWei:c});const y=(u.reduce((d,v)=>d+BigInt(v.availableAmount),0n)+c).toString(),h=Ke(e,u,y);if(j.enabled){let d;try{return d=await ve({purchase:h,buyer:a,signer:o}),f==null||f({txHash:d}),await ye(d),d}catch(v){if(v instanceof B&&v.code===F.USER_DENIED||v instanceof ke)throw v;if(!(v instanceof Ce))throw d&&(x==null||x({txHash:d})),v;if(v.reason==="relayer-unreachable")throw w==null||w(),v;if(!de(m))throw v;E(v,{flow:"buy_credits_and_mana",step:"gasless_fallback"})}}return ue({purchase:h,buyer:a,signer:o,onBroadcast:f,onReverted:x})}function te(t){return t.kind==="trade"?t.trade.chainId:t.mint.chainId}function Ke(t,e,a){return t.kind==="trade"?{kind:"trade",trade:t.trade,coupon:t.coupon,credits:e,maxCreditedValue:a}:{kind:"store",item:t.mint.item,chainId:t.mint.chainId,credits:e,maxCreditedValue:a}}function jt(t,e){const a=te(e);return t==="combined"?{spender:A(M.CreditsManager,a).address,chainId:a}:{spender:e.kind==="trade"?A(G(e.trade.contract),a).address:A(M.CollectionStore,a).address,chainId:a}}function zt(t){return r.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...t,children:r.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function Wt(t){return r.jsx("svg",{viewBox:"0 0 20 20",width:"24",height:"24","aria-hidden":!0,...t,children:r.jsx("path",{fill:"#f48221",d:"M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm0-8a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Z"})})}const{colors:i,gradients:V,radius:ae,z:Qe}=l,Et=n.div`
|
|
188
188
|
position: fixed;
|
|
189
189
|
inset: 0;
|
|
190
190
|
z-index: ${Qe.overlay};
|
|
@@ -848,4 +848,4 @@ import{r as C,j as r}from"./react-CJ0-yyn7.js";import{s as ne,h as S,A as N,g as
|
|
|
848
848
|
transform: scale(1.1);
|
|
849
849
|
}
|
|
850
850
|
`;function ba({title:t,items:e,onViewAll:a}){const o=C.useRef(null),[u,c]=C.useState(1),[m,f]=C.useState(0),[x,w]=C.useState(!0),[b,p]=C.useState(!1),g=C.useCallback(()=>{const h=o.current;if(!h)return;const{scrollLeft:d,scrollWidth:v,clientWidth:T}=h,z=Math.max(1,Math.ceil(v/T));c(z),f(Math.min(z-1,Math.round(d/T))),w(d<=1),p(d+T>=v-1)},[]);if(C.useEffect(()=>{g();const h=o.current;if(h)return h.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),()=>{h.removeEventListener("scroll",g),window.removeEventListener("resize",g)}},[g,e.length]),e.length===0)return null;function s(h){const d=o.current;d&&d.scrollBy({left:h*d.clientWidth,behavior:"smooth"})}function y(h){const d=o.current;d&&d.scrollTo({left:h*d.clientWidth,behavior:"smooth"})}return r.jsxs(Je,{"data-testid":"carousel",children:[r.jsxs(Ye,{children:[r.jsx(Ze,{children:t}),a?r.jsxs(_e,{onClick:a,children:[k("collectionCarousel.viewAll"),r.jsx(et,{name:"chevron-down",size:16})]}):null]}),r.jsxs(tt,{children:[r.jsx(R,{"data-side":"left",onClick:()=>s(-1),"aria-label":k("collectionCarousel.scrollLeft"),disabled:x,children:r.jsx("img",{src:H,alt:"","aria-hidden":!0})}),r.jsx(at,{ref:o,children:e.map(h=>r.jsx(he,{item:h},h.id))}),r.jsx(R,{"data-side":"right",onClick:()=>s(1),"aria-label":k("collectionCarousel.scrollRight"),disabled:b,children:r.jsx("img",{src:H,alt:"","aria-hidden":!0})})]}),u>1?r.jsx(nt,{"aria-label":k("collectionCarousel.pages"),children:Array.from({length:u}).map((h,d)=>r.jsx(it,{"data-active":d===m||void 0,"aria-label":k("collectionCarousel.goToPage",{page:d+1}),"aria-current":d===m?"true":void 0,onClick:()=>y(d)},d))}):null]})}export{Re as $,Ht as A,Ft as B,$t as C,bt as D,ta as E,aa as F,na as G,St as H,ia as I,oa as J,ra as K,ca as L,Et as M,vt as N,ft as O,ua as P,ba as Q,mt as R,It as S,Pt as T,gt as U,xt as V,Gt as W,Bt as X,jt as Y,_ as Z,yt as _,Nt as a,Ke as a0,te as a1,xa as a2,ma as a3,da as a4,kt as a5,Ct as a6,At as a7,Mt as a8,Tt as a9,zt as b,Vt as c,Dt as d,Ot as e,qt as f,la as g,ha as h,wt as i,pa as j,sa as k,Ge as l,ga as m,fa as n,Wt as o,Jt as p,Yt as q,Rt as r,Lt as s,Xt as t,Ut as u,Kt as v,Qt as w,Zt as x,_t as y,ea as z};
|
|
851
|
-
//# sourceMappingURL=CollectionCarousel-
|
|
851
|
+
//# sourceMappingURL=CollectionCarousel-Crm-0uNM.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-
|
|
2
|
-
import{e as s,_ as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-BPHop57M.js","_assets/react-CfmD1IrY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as s,_ as a}from"./index-BFHMpeS5.js";import{r as n,j as i}from"./react-CfmD1IrY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b7d62935-9a92-4818-8ab8-edea23d45ddd",e._sentryDebugIdIdentifier="sentry-dbid-b7d62935-9a92-4818-8ab8-edea23d45ddd")}catch{}})();const o=s.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|
|
@@ -14,5 +14,5 @@ import{e as s,_ as a}from"./index-BBc3X6XF.js";import{r as n,j as i}from"./react
|
|
|
14
14
|
*/
|
|
15
15
|
z-index: -1;
|
|
16
16
|
pointer-events: none;
|
|
17
|
-
`,d=n.lazy(async()=>{const[{default:e},{default:t}]=await Promise.all([a(()=>import("./index.es-
|
|
18
|
-
//# sourceMappingURL=Confetti-
|
|
17
|
+
`,d=n.lazy(async()=>{const[{default:e},{default:t}]=await Promise.all([a(()=>import("./index.es-BPHop57M.js"),__vite__mapDeps([0,1])),a(()=>import("./confettiAnimation-Btd6HRFo.js"),[])]);return{default:()=>i.jsx(e,{animationData:t,loop:1})}});function u(){const[e]=n.useState(()=>{var t;return!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)});return e?i.jsx(o,{"aria-hidden":!0,"data-testid":"confetti",children:i.jsx(n.Suspense,{fallback:null,children:i.jsx(d,{})})}):null}export{u as C};
|
|
18
|
+
//# sourceMappingURL=Confetti-BqpIfMO9.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o}from"./sentry-
|
|
2
|
-
//# sourceMappingURL=ConstantsUtil-
|
|
1
|
+
import{p as o}from"./sentry-TFqjegNi.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="212e6b2b-00bf-4961-b68b-1d32c6f901a6",e._sentryDebugIdIdentifier="sentry-dbid-212e6b2b-00bf-4961-b68b-1d32c6f901a6")}catch{}})();var n={};const r={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof o<"u"&&typeof n<"u"?n.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{r as C};
|
|
2
|
+
//# sourceMappingURL=ConstantsUtil-BCzF6n74.js.map
|