@dcl/shop 1.17.1 → 1.17.2-36157867735.commit-7431f7b
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-BNjXw97e.js → Activity-CE6Jeo_T.js} +9 -9
- package/_assets/{AnimatedBackground-kFDegzCM.js → AnimatedBackground-D5MFl62Y.js} +3 -3
- package/_assets/{Assets-D_dCmUv0.js → Assets-COp5lo1c.js} +7 -7
- package/_assets/{Cart-BPv_4JHc.js → Cart-CXTYKHB4.js} +5 -5
- package/_assets/{Collection-2qp7F46n.js → Collection-D6GAA887.js} +7 -7
- package/_assets/{CollectionCarousel-CXiZiW-S.js → CollectionCarousel-C_r2HthR.js} +7 -7
- package/_assets/{Confetti-Bsu2ytMi.js → Confetti-DPZN6qJi.js} +4 -4
- package/_assets/{ConstantsUtil-czCTnHYO.js → ConstantsUtil-C6ody29O.js} +2 -2
- package/_assets/{ContentClient-CIV5rrAt.js → ContentClient-C03rRrUz.js} +2 -2
- package/_assets/{Creator-CIH3WU3e.js → Creator-Chq_3FKW.js} +7 -7
- package/_assets/{CreditPackPicker-Cf2WXrfD.js → CreditPackPicker-yPm96IIv.js} +2 -2
- package/_assets/{CreditRate-DjCL9hVD.js → CreditRate-BxqKLfaA.js} +6 -6
- package/_assets/{DeploymentBuilder-C3NqEfXH.js → DeploymentBuilder-B2QubYgD.js} +2 -2
- package/_assets/{EmotePlaybackBar-Bq7TckV0.js → EmotePlaybackBar-Cp9UGu_L.js} +3 -3
- package/_assets/{ErrorNotice-DSZ4YOzl.js → ErrorNotice-D_6j8-7f.js} +2 -2
- package/_assets/{Event-D__OUwpc.js → Event-v8GnBTyC.js} +2 -2
- package/_assets/{ExchangeController-BlkQV8ix.js → ExchangeController-CE3cQOVu.js} +2 -2
- package/_assets/{Faq-Daw98w_f.js → Faq-Dfduj2eM.js} +2 -2
- package/_assets/{Filters-COsCKlQM.js → Filters-CdMOVmbU.js} +2 -2
- package/_assets/{GetCredits-uaIm_-xy.js → GetCredits-BS--XoK-.js} +2 -2
- package/_assets/{Grow-nApzPG32.js → Grow-CPeuefrF.js} +2 -2
- package/_assets/{HelpersUtil-Dhc8srsx.js → HelpersUtil-B_SruwGa.js} +2 -2
- package/_assets/IssueModal-D_PS_2Xk.js +323 -0
- package/_assets/ItemDetail-DBAHPIQO.js +3090 -0
- package/_assets/{LoadMore-D8gtSgyc.js → LoadMore-CM5ykem-.js} +2 -2
- package/_assets/{ManaPricingBanner-CiV8R5vd.js → ManaPricingBanner-CZzRxND3.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-BNQ_wLgO.js → ManaPricingBanner.styles-B10EKkra.js} +2 -2
- package/_assets/{MyAssets-XbkBS3DE.js → MyAssets-Fhl2lazZ.js} +2 -2
- package/_assets/{MyFavorites-lktPT4tc.js → MyFavorites-DqyQ-SFM.js} +10 -10
- package/_assets/MyStore-B5e7oQJa.js +1691 -0
- package/_assets/{NetworkUtil-BwvINT8v.js → NetworkUtil-iL8rkdmy.js} +2 -2
- package/_assets/{NotFound-CIueRHHs.js → NotFound-sBVYlhk3.js} +2 -2
- package/_assets/NotificationsBell-TdDjFO5P.js +142 -0
- package/_assets/{OutfitDetail-MDYbLLf8.js → OutfitDetail-BBsCNaaP.js} +3 -3
- package/_assets/{OutfitPreview-C52GjMv6.js → OutfitPreview-BTJ-IIEH.js} +3 -3
- package/_assets/{OutfitStudio-uomtfIa1.js → OutfitStudio-DXHZfbf9.js} +10 -10
- package/_assets/{PaymentMethodStep-aQUg-E9d.js → PaymentMethodStep-Ob8YI_SL.js} +5 -5
- package/_assets/{SaleCountdown-BC6cklIs.js → SaleCountdown-KX9dNqTp.js} +2 -2
- package/_assets/{Spinner-NI6IZA5A.js → Spinner-DKskpIEZ.js} +2 -2
- package/_assets/{StoreSettings-BrdRpaVU.js → StoreSettings-Bia_W-8Q.js} +8 -8
- package/_assets/{Success-Bsg9-DNo.js → Success-2dVHPO-2.js} +2 -2
- package/_assets/{SwapController-DVbKfkaS.js → SwapController-CbFqSpFg.js} +2 -2
- package/_assets/{Tooltip-DIRWGOxl.js → Tooltip-DFrRznAp.js} +2 -2
- package/_assets/{TradeService-CK7xu_Fq.js → TradeService-CDS_PfTn.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-BWvDpNTL.js → W3MFrameProviderSingleton-C4KtItmg.js} +4 -4
- package/_assets/{WebCryptoP256-pa_zJ5z4.js → WebCryptoP256-CbiRbOjq.js} +2 -2
- package/_assets/{basic-Mlwb1YPe.js → basic-BufXGp2F.js} +2 -2
- package/_assets/{biconomy-CIvkhhfY.js → biconomy-BR1CMfhe.js} +2 -2
- package/_assets/{browseLayout.styles-D3u_lxUV.js → browseLayout.styles-DF9DTUfO.js} +2 -2
- package/_assets/{browser-BnRQXFFw.js → browser-DqwPlfZs.js} +2 -2
- package/_assets/{browser-ponyfill-Dmn_2mUU.js → browser-ponyfill-DqHLL_k5.js} +2 -2
- package/_assets/{browser-lYIugjhZ.js → browser-qc2dUFk5.js} +2 -2
- package/_assets/{buy-MeE-N2le.js → buy-BiTHthT9.js} +2 -2
- package/_assets/{buy-gasless-ZiYiDzb-.js → buy-gasless-CTp90Dvn.js} +2 -2
- package/_assets/{ccip-D2v4Tmss.js → ccip-DZfLdErH.js} +2 -2
- package/_assets/{ccip-D9Kr5HJY.js → ccip-rfpBm5bL.js} +2 -2
- package/_assets/{chains-CfHTI0IT.js → chains-BWqZ-nYk.js} +2 -2
- package/_assets/{collectionPage.styles-Drt5ivqQ.js → collectionPage.styles-Db2PBFNG.js} +4 -4
- package/_assets/{common-BkGfzbjV.js → common-BfXnUVAM.js} +2 -2
- package/_assets/{controller-B1XkQ-8T.js → controller-ZXDDsCxP.js} +3 -3
- package/_assets/{core-8MNjsO3A.js → core-DfE8LCjh.js} +5 -5
- package/_assets/{createSvgIcon-BKu0ThNd.js → createSvgIcon-BUkltLfu.js} +2 -2
- package/_assets/{crumbs.styles-IWrGqGTW.js → crumbs.styles-R8odPxFR.js} +2 -2
- package/_assets/{custom-RQn4QL1O.js → custom-DKOD0xYg.js} +2 -2
- package/_assets/{data-capture-BCz6ZuJe.js → data-capture-C3eH7C_s.js} +2 -2
- package/_assets/{dcl-schemas-BgQanFex.js → dcl-schemas-BW3BbT5l.js} +2 -2
- package/_assets/{decimals-DQ6egFLl.js → decimals-BI0yoEux.js} +2 -2
- package/_assets/{decimals-Yu9nfiap.js → decimals-DQJMb7J9.js} +2 -2
- package/_assets/{detectExtension-mxrpMjPD.js → detectExtension-C_GbFz5_.js} +2 -2
- package/_assets/{disposePreview-DPlzBDEC.js → disposePreview-5Jddp9do.js} +2 -2
- package/_assets/{email-C9hzZFfn.js → email-D4HLC7wh.js} +7 -7
- package/_assets/{embedded-wallet-sNZ139r3.js → embedded-wallet-CMbzkthX.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-CFDaRZFq.js → emotion-styled.browser.esm-B6eszsio.js} +2 -2
- package/_assets/{engine-t2WwPyT-.js → engine-BA9Hr8Az.js} +2 -2
- package/_assets/{errors-TvhLJhmP.js → errors-DnOSpKoV.js} +2 -2
- package/_assets/{estimate-l1-fee-V6V7FI1H.js → estimate-l1-fee-BZt36dEW.js} +2 -2
- package/_assets/{eth_estimateGas-vmn477Rl.js → eth_estimateGas-mNInGC82.js} +2 -2
- package/_assets/{eth_getStorageAt-BJsh0E1g.js → eth_getStorageAt-CW3VLsR7.js} +2 -2
- package/_assets/{eth_getTransactionCount-DjYi-3h-.js → eth_getTransactionCount-DGbTHobL.js} +2 -2
- package/_assets/{ethereum-CtosgwHU.js → ethereum-Cez4WhJf.js} +2 -2
- package/_assets/{ethers-RdXTApYJ.js → ethers-DGYWmyb1.js} +2 -2
- package/_assets/{events-DcSLjVuU.js → events-YMZCt1yV.js} +2 -2
- package/_assets/{execute-Da7DgAmR.js → execute-CVxgGRa9.js} +3 -3
- package/_assets/{extractIPFS-Cczu9meN.js → extractIPFS-BdalrjY7.js} +2 -2
- package/_assets/{features-C_bdmaJE.js → features-BPD34bt1.js} +2 -2
- package/_assets/{fetchTokenMetadata-7Kgsjbv4.js → fetchTokenMetadata-DOlcjXZI.js} +3 -3
- package/_assets/{field.styles-DDXjryam.js → field.styles-CIXh24AQ.js} +2 -2
- package/_assets/{fortmatic-BPBqqvfl.js → fortmatic-DGrmZpu1.js} +2 -2
- package/_assets/{get-bytecode-Bbw_Evod.js → get-bytecode-N2OV9nFo.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-81lpLPU_.js → get-ecosystem-wallet-info-CVK-PjWL.js} +2 -2
- package/_assets/{getBalance-BgqMuvIf.js → getBalance-BEz0Zoiv.js} +3 -3
- package/_assets/{getInstalledModules-W4RDd7ik.js → getInstalledModules-AznSDC44.js} +2 -2
- package/_assets/{getNFT-anMIImQh.js → getNFT-VxK16uv_.js} +2 -2
- package/_assets/{getNFT-BDhkq7kr.js → getNFT-aR5kSoWa.js} +3 -3
- package/_assets/{grid.styles-D--qOwVq.js → grid.styles-CVQcD_5t.js} +2 -2
- package/_assets/{hashTypedData-CiWRFQn6.js → hashTypedData-ByCdES4z.js} +2 -2
- package/_assets/{hashTypedData-CUDRpwju.js → hashTypedData-ywahqODz.js} +2 -2
- package/_assets/{import-CIZWEISk.js → import-CPlDKdWo.js} +2 -2
- package/_assets/{in-app-BbIysh8c.js → in-app-D43FjnXM.js} +2 -2
- package/_assets/{in-app-wallet-calls-BgxC18Ff.js → in-app-wallet-calls-DmZ4pxIH.js} +2 -2
- package/_assets/{index-DQS3Dydb.js → index-0FaDHGAZ.js} +2 -2
- package/_assets/{index-BKGo_9wu.js → index-7s_cYB0r.js} +2 -2
- package/_assets/{index-DFQS58XE.js → index-B67Ropoe.js} +3 -3
- package/_assets/{index-CM4FAtZl.js → index-B7aqs-FR.js} +2 -2
- package/_assets/{index-BhhO1oEp.js → index-B8kJyL6G.js} +2 -2
- package/_assets/{index-qrz6WiaK.js → index-BAAoctqn.js} +2 -2
- package/_assets/{index-C0EB4Nb3.js → index-BBS-v8LD.js} +17 -17
- package/_assets/{index-8wQks0w8.js → index-BFVKoQeh.js} +2 -2
- package/_assets/{index-B1OJuolS.js → index-BIDkjxTy.js} +2 -2
- package/_assets/{index-hLoLHUKV.js → index-BMak5rZb.js} +2 -2
- package/_assets/{index-BlG9tYXl.js → index-BOyogbet.js} +2 -2
- package/_assets/{index-CjuTKXut.js → index-BUZUNt7Z.js} +2 -2
- package/_assets/{index-BNn-tbAt.js → index-BUnaJjPH.js} +2 -2
- package/_assets/{index-B49OLLy1.js → index-Bf74R1qS.js} +2 -2
- package/_assets/{index-BhGdGiCs.js → index-BfZKaxHs.js} +3 -3
- package/_assets/{index--yUfiOex.js → index-Bf_iGaP5.js} +2 -2
- package/_assets/{index-DTWx6T1S.js → index-BkdjGh-W.js} +2 -2
- package/_assets/{index-BwKvHJ-v.js → index-C2S4XG0R.js} +2 -2
- package/_assets/{index-OhRAcbHT.js → index-C7Le7sHG.js} +2 -2
- package/_assets/{index-DzyghasH.js → index-CA4CUNiy.js} +2 -2
- package/_assets/{index-CeM8omfX.js → index-CHBzdW6M.js} +2 -2
- package/_assets/{index-Dxfnkqq4.js → index-CLpLBvH2.js} +2 -2
- package/_assets/{index-DO6ydGXX.js → index-CNjrqKOs.js} +2 -2
- package/_assets/{index-lQ2m7yUy.js → index-CSuaHD6u.js} +2 -2
- package/_assets/{index-BJvtfv1M.js → index-CT7NzvvO.js} +2 -2
- package/_assets/{index-Zum9uUGy.js → index-CU2OselF.js} +2 -2
- package/_assets/{index-D1S8t2fe.js → index-CY4_MrXH.js} +2 -2
- package/_assets/{index-Cw_s9pOw.js → index-C_2eXgm7.js} +2 -2
- package/_assets/{index-D22FRuvW.js → index-CeLw5QQ-.js} +3 -3
- package/_assets/{index-CtSgRzsY.js → index-CepaElib.js} +2 -2
- package/_assets/{index-ClIQf3ng.js → index-CgfbItO2.js} +2 -2
- package/_assets/{index-BIAEBlSw.js → index-ChIjTbh5.js} +2 -2
- package/_assets/{index-Bc7EMqAf.js → index-Ci4_h86U.js} +2 -2
- package/_assets/{index-BGZlLdrL.js → index-CnfBCYQg.js} +2 -2
- package/_assets/{index-cGB6nHYf.js → index-CtoH5DSl.js} +6 -6
- package/_assets/{index-wOPFghKT.js → index-Cx1doNkB.js} +2 -2
- package/_assets/{index-DfOPi5vf.js → index-CxOeCVBB.js} +3 -3
- package/_assets/{index-BDdcoEFU.js → index-CzV7sMdy.js} +4 -4
- package/_assets/{index-DZEeeDQr.js → index-DCSutgdw.js} +2 -2
- package/_assets/{index-DCdW2yi4.js → index-DIYb1IGB.js} +4 -4
- package/_assets/{index-CvR8He0C.js → index-DR9_Mkt6.js} +2 -2
- package/_assets/{index-B-gdbRSW.js → index-DSwxHrMr.js} +2 -2
- package/_assets/{index-BeH18kmv.js → index-DZ3S9SRN.js} +2 -2
- package/_assets/{index-Bs_f3yhf.js → index-DZ53HgoK.js} +2 -2
- package/_assets/{index-CFBOIeXE.js → index-DZaHlbE_.js} +2 -2
- package/_assets/{index-Cf6ERmsZ.js → index-D_2nYoM8.js} +2 -2
- package/_assets/{index-CZEYeX3l.js → index-DauMTBWE.js} +2 -2
- package/_assets/{index-BmsamR4M.js → index-DhWCbjGh.js} +2 -2
- package/_assets/{index-Dz8UCy0P.js → index-DtS7bQfE.js} +2 -2
- package/_assets/{index-DU6vOlyL.js → index-DyhsaJtc.js} +2 -2
- package/_assets/{index-Dkohypnm.js → index-LRrTgDY0.js} +4 -4
- package/_assets/{index-BRWjazWI.js → index-LxRrm7nL.js} +2 -2
- package/_assets/{index-DOn0iodU.js → index-PFt3YITh.js} +2 -2
- package/_assets/{index-DAysx568.js → index-T6hDl-2V.js} +2 -2
- package/_assets/{index-C5s2ci0r.js → index-Tz82vi2e.js} +2 -2
- package/_assets/{index-CSZAw8dC.js → index-W7W-N49f.js} +2 -2
- package/_assets/{index-Bsw53nId.js → index-ZDiu1J1j.js} +2 -2
- package/_assets/{index-BMjX5Tw6.js → index-bz3DaQP5.js} +2 -2
- package/_assets/{index-M4vJyniz.js → index-cCjjJ8Zd.js} +2 -2
- package/_assets/{index-Cq62ZdRW.js → index-feJ6CP8x.js} +3 -3
- package/_assets/{index-B6895neV.js → index-gfZnCNa6.js} +2 -2
- package/_assets/{index-FfTM_1mz.js → index-guDRvZQ4.js} +2 -2
- package/_assets/{index-CwCEh7Ea.js → index-mzIsCjWs.js} +2 -2
- package/_assets/{index-962zUKU_.js → index-ox01jvxx.js} +2 -2
- package/_assets/index-qTkXqLEk.css +1 -0
- package/_assets/{index-DTVY5scD.js → index-tske-Qm0.js} +2 -2
- package/_assets/index-v6-0TPZX.js +3 -0
- package/_assets/{index-_bcedLK5.js → index-y50hP8_O.js} +2 -2
- package/_assets/{index.es-C1YwoJJN.js → index.es-D61fhzOk.js} +2 -2
- package/_assets/{index.es-YMSgumSf.js → index.es-DUQRyY8V.js} +2 -2
- package/_assets/{index.es-BirWIv1k.js → index.es-DrJv9QY8.js} +2 -2
- package/_assets/{index.es-O8xfjyk3.js → index.es-_SlY0diQ.js} +5 -5
- package/_assets/items-empty-Dtl-YwtZ.js +2 -0
- package/_assets/{jump-DddgnPSC.js → jump-JCYO-k8J.js} +2 -2
- package/_assets/{linkAccount-CHDe6wUT.js → linkAccount-D_xpNX67.js} +2 -2
- package/_assets/{loader-logo-ChNoWI1Z.js → loader-logo-k6aOBN-R.js} +2 -2
- package/_assets/{localBatchGatewayRequest-tSt38JDm.js → localBatchGatewayRequest-T0sFQZ26.js} +2 -2
- package/_assets/{modal.styles-BPDABQCr.js → modal.styles-BAz9vPux.js} +2 -2
- package/_assets/{native-Cxh3QIKd.js → native-Fndcg4e5.js} +2 -2
- package/_assets/{networks-rNqzEIu1.js → networks-BkPPSIG9.js} +2 -2
- package/_assets/{onramp-Cjb0y_EX.js → onramp-DCjZy1Yr.js} +2 -2
- package/_assets/{openzeppelin-Dbgk07uO.js → openzeppelin-DWeyp33R.js} +2 -2
- package/_assets/{ownerOf-ifwSx1wQ.js → ownerOf-D0cjIIIs.js} +2 -2
- package/_assets/{parseNft-BgX116P8.js → parseNft-DCt8GvNK.js} +3 -3
- package/_assets/{parseSignature-B3jn_FVR.js → parseSignature-BbjgUCSK.js} +4 -4
- package/_assets/{parseSignature-Cjx-94kV.js → parseSignature-CtMzBmLG.js} +2 -2
- package/_assets/{passkeys-C14r7a1U.js → passkeys-DUrjX8Ro.js} +2 -2
- package/_assets/{pay-with-exchange-BoqePTss.js → pay-with-exchange-vAQgw-nO.js} +2 -2
- package/_assets/{prepare-contract-call-CVD1LMqZ.js → prepare-contract-call-BitMGE96.js} +2 -2
- package/_assets/{qr-overlay-BaF8O6L7.js → qr-overlay-3Ogvmodj.js} +4 -4
- package/_assets/{react-57wE9FMW.js → react-Ddn-9d83.js} +2 -2
- package/_assets/{receive-_KdL5WbJ.js → receive-UBqFYKku.js} +9 -9
- package/_assets/{resolveImplementation-BIVOA86N.js → resolveImplementation-CoCWI1LK.js} +2 -2
- package/_assets/{resume-buy-RWKNCH2I.js → resume-buy-DqlXnoQq.js} +2 -2
- package/_assets/{resume-name-CVkpKZkm.js → resume-name-B5w3HYnd.js} +2 -2
- package/_assets/{rpc-BuxGvW8N.js → rpc-C-RDZHVf.js} +2 -2
- package/_assets/{sales-empty-BrdJIpZF.js → sales-empty-DFvbsd1W.js} +2 -2
- package/_assets/{search-empty-B9EfPE1P.js → search-empty-D1Tausth.js} +2 -2
- package/_assets/{secp256k1-D98PKoK-.js → secp256k1-By6IQ83k.js} +2 -2
- package/_assets/{secp256k1-DtCcUzXl.js → secp256k1-CAqSDg9Y.js} +2 -2
- package/_assets/{secp256k1-C3mpZkpr.js → secp256k1-CxMxDBug.js} +2 -2
- package/_assets/{send-CPee34BT.js → send-Dg3aA-cT.js} +2 -2
- package/_assets/{send-batch-transaction-CRYeO2Ew.js → send-batch-transaction-CcGULLl4.js} +2 -2
- package/_assets/{send-eip712-transaction-DmUbX1xf.js → send-eip712-transaction-eRcl-w9x.js} +3 -3
- package/_assets/{send-gasless-transaction-Cl9L9F1A.js → send-gasless-transaction-BVE00Z8q.js} +3 -3
- package/_assets/send-transaction-bNnxjmkm.js +3 -0
- package/_assets/{sendMetaTransaction-B7N-qRfh.js → sendMetaTransaction-DaTro9ph.js} +2 -2
- package/_assets/{sendRawTransaction-DAT5LyNo.js → sendRawTransaction-Crv4h2Fe.js} +4 -4
- package/_assets/{sentry-C6Mao8WI.js → sentry-D_8KijKQ.js} +3 -3
- package/_assets/{serializeTransaction-CjRJ0psk.js → serializeTransaction-CPg2ul-G.js} +2 -2
- package/_assets/{session-proposal-ueoRTwfB.js → session-proposal-Di1f8LHY.js} +2 -2
- package/_assets/{session-request-BD9TXTaA.js → session-request-R2yVi8HQ.js} +3 -3
- package/_assets/{sha256-DbvztKVh.js → sha256-BhCi5WIJ.js} +2 -2
- package/_assets/{sha3-5JMjwcQn.js → sha3-CLQFMym7.js} +2 -2
- package/_assets/signin-empty-PXLDIsQk.js +2 -0
- package/_assets/{signing-D8djUTSU.js → signing-BCODmgNV.js} +4 -4
- package/_assets/{skeleton.styles-Bvaum8jS.js → skeleton.styles-anODpKJf.js} +2 -2
- package/_assets/{socials-NQn6q4he.js → socials-DShz1WgZ.js} +2 -2
- package/_assets/{styled-CCNK0K71.js → styled-CbzE9JXd.js} +2 -2
- package/_assets/{swaps-CgWjr3x_.js → swaps-BXF_khPF.js} +2 -2
- package/_assets/{thirdweb-C1alV0QS.js → thirdweb-Cnc0UXDQ.js} +4 -4
- package/_assets/{to-serializable-transaction-BKQS5d49.js → to-serializable-transaction-DzZsdRzk.js} +3 -3
- package/_assets/{totalSupply-CF5FI8lQ.js → totalSupply-D4EQMS5T.js} +2 -2
- package/_assets/{trade-encoding-BV1_7YxJ.js → trade-encoding-BdtZmg5A.js} +2 -2
- package/_assets/{transaction-BVLpkah4.js → transaction-Cbet3IZc.js} +2 -2
- package/_assets/{transactionReceipt-DwjBLtBg.js → transactionReceipt-DSeG56jV.js} +2 -2
- package/_assets/{transactions-DW_nxFG-.js → transactions-B5gQmUHm.js} +2 -2
- package/_assets/useInfiniteGrid-C5wDaoVd.js +2 -0
- package/_assets/{useStore-CJ2zzclt.js → useStore-wU9qkXc9.js} +3 -3
- package/_assets/{useTheme-D3lC36b8.js → useTheme-y50PSrCO.js} +2 -2
- package/_assets/{utils-DyoF2n1_.js → utils-BGzZ7mCg.js} +2 -2
- package/_assets/{verifyHash-D_k8MOkd.js → verifyHash-I86XFFeN.js} +2 -2
- package/_assets/{w3m-modal-BwPY12eH.js → w3m-modal-COSR0Fsr.js} +2 -2
- package/_assets/{w3m-modal-CIfTlIpr.js → w3m-modal-Dz0XFS0k.js} +2 -2
- package/_assets/{wait-for-tx-receipt-BQf97Yv5.js → wait-for-tx-receipt-C3zFGaKb.js} +2 -2
- package/_assets/{wallets-Cor67NYq.js → wallets-BM2FKp9V.js} +6 -6
- package/_assets/{web-connector-AUtPfxac.js → web-connector-DXaUpGnD.js} +4 -4
- package/_assets/{writeContract-_6z0Fw9c.js → writeContract-Bja8jWrS.js} +2 -2
- package/_assets/{zora-sepolia-DFxo1Oif.js → zora-sepolia-B6FH_u_V.js} +2 -2
- package/_assets/{zoraTestnet-B4Lgrc00.js → zoraTestnet-CDn6xrjW.js} +2 -2
- package/index.html +12 -12
- package/package.json +2 -2
- package/_assets/ItemDetail-big_cmBY.js +0 -3411
- package/_assets/MyStore-SSChApNZ.js +0 -1630
- package/_assets/NotificationsBell-BiwzCIb4.js +0 -142
- package/_assets/index-DoXX6TgS.css +0 -1
- package/_assets/index-GCKJ9yxg.js +0 -3
- package/_assets/items-empty-BciJH2B_.js +0 -2
- package/_assets/send-transaction-CydyNIuj.js +0 -3
- package/_assets/signin-empty-Duq453f-.js +0 -2
- package/_assets/useInfiniteGrid-CbPWAhDP.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-CtoH5DSl.js","_assets/react-Ddn-9d83.js","_assets/index-BBS-v8LD.js","_assets/dcl-schemas-BW3BbT5l.js","_assets/sentry-D_8KijKQ.js","_assets/ethers-DGYWmyb1.js","_assets/intl-AKLEHPeO.js","_assets/index-qTkXqLEk.css","_assets/import-CPlDKdWo.js","_assets/buy-BiTHthT9.js","_assets/trade-encoding-BdtZmg5A.js","_assets/sendMetaTransaction-DaTro9ph.js","_assets/modal.styles-BAz9vPux.js","_assets/CreditRate-BxqKLfaA.js","_assets/Faq-Dfduj2eM.js","_assets/sales-empty-DFvbsd1W.js","_assets/field.styles-CIXh24AQ.js","_assets/ManaPricingBanner.styles-B10EKkra.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as Te,t as o,a0 as $e,aK as Pe,a2 as ce,bW as ae,bX as ne,bY as Se,_ as Ce,z as L,av as B,bZ as Fe,X as De,bu as K,I as V,F as Me,b_ as He,Y as T,b$ as Re,c0 as X}from"./index-BBS-v8LD.js";import{r as f,u as We,j as t,d as _e,L as qe}from"./react-Ddn-9d83.js";import{u as Oe,s as ze}from"./sales-empty-DFvbsd1W.js";import{L as Ge}from"./LoadMore-CM5ykem-.js";import{u as $}from"./useInfiniteGrid-C5wDaoVd.js";import{m as le}from"./mana-matic-CEqvSwrJ.js";import{n as Ue}from"./name-glyph-aUugT8vq.js";import{s as Be}from"./signin-empty-PXLDIsQk.js";import"./dcl-schemas-BW3BbT5l.js";import"./sentry-D_8KijKQ.js";import"./ethers-DGYWmyb1.js";import"./intl-AKLEHPeO.js";import"./import-CPlDKdWo.js";import"./buy-BiTHthT9.js";import"./trade-encoding-BdtZmg5A.js";import"./sendMetaTransaction-DaTro9ph.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]="e4dd8118-6263-4893-b583-f12c524794a7",e._sentryDebugIdIdentifier="sentry-dbid-e4dd8118-6263-4893-b583-f12c524794a7")}catch{}})();const Ke=15e3;function Ve(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)<=Ke}function Xe(e){const s=[...e].sort((i,n)=>n.createdAt-i.createdAt),a=[];for(const i of s){const n=a[a.length-1];n&&Ve(n[n.length-1],i)?n.push(i):a.push([i])}return a.map(i=>{var n;return{id:((n=i.find(c=>c.txHash))==null?void 0:n.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:Qe(i),totalCredits:i.reduce((c,l)=>c+l.credits,0),lines:i}})}function Qe(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ye(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ze(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Je(e){const s=[],a=new Map;for(const i of e){const n=Ze(i);if(!n){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 c=a.get(n);if(c){c.quantity+=1,c.credits+=i.credits;continue}const l={key:n,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};a.set(n,l),s.push(l)}return s}function et(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?Ae(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function tt(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function it(e){const a=Xe(e.purchases.filter(tt)).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=e.sales.map(r=>{const p=et(r,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),n=(e.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(e.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),l=(e.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...a,...i,...n,...l].sort((r,p)=>p.createdAt-r.createdAt||(r.id<p.id?-1:1))}function st(e,s){return s==="all"?e:s==="sales"?e.filter(a=>a.kind==="sale"):e.filter(a=>a.kind==="purchase"||a.kind==="credit"||a.kind==="mana-purchase")}const he=e=>e.trim().toLowerCase();function at(e){const s=new Map;for(const a of e??[]){const i=he(a.txHash??"");if(!i)continue;const n=s.get(i);n?n.push(a):s.set(i,[a])}return s}function nt(e,s,a=Date.now()){const i=s.txHash?e.get(he(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const n=i.length===1?rt(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>a);if(c.length===0)return{kind:"credited",credits:n};const l=c.reduce((r,p)=>Math.max(r,p.availableAt),0);return{kind:"pending",credits:n,availableAt:l}}function rt(e){return Ee(e)}function ot(){const e=U(i=>{var n;return(n=i.session)==null?void 0:n.address}),{data:s,isLoading:a}=E({queryKey:["listing-count",e],queryFn:()=>Le({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:a}}const dt="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/credits-product-vs4Q6u6l.svg",Q=Ne`
|
|
3
3
|
0% { background-position: 200% 0; }
|
|
4
4
|
100% { background-position: -200% 0; }
|
|
5
5
|
`,ct=u.section`
|
|
@@ -150,10 +150,10 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
|
|
|
150
150
|
`,D=u.span`
|
|
151
151
|
font-weight: 700;
|
|
152
152
|
color: ${d.colors.softWhite};
|
|
153
|
-
`,
|
|
153
|
+
`,M=u.span`
|
|
154
154
|
font-size: 13px;
|
|
155
155
|
color: ${d.colors.gray4};
|
|
156
|
-
`,
|
|
156
|
+
`,H=u.div`
|
|
157
157
|
display: flex;
|
|
158
158
|
align-items: center;
|
|
159
159
|
gap: 14px;
|
|
@@ -330,7 +330,7 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
|
|
|
330
330
|
border-radius: 10px;
|
|
331
331
|
background: linear-gradient(100deg, var(--skeleton-lo) 30%, var(--skeleton-hi) 50%, var(--skeleton-lo) 70%);
|
|
332
332
|
background-size: 200% 100%;
|
|
333
|
-
animation: ${
|
|
333
|
+
animation: ${Q} 1.3s infinite linear;
|
|
334
334
|
|
|
335
335
|
@media (prefers-reduced-motion: reduce) {
|
|
336
336
|
animation: none;
|
|
@@ -353,7 +353,7 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
|
|
|
353
353
|
border-radius: 6px;
|
|
354
354
|
background: linear-gradient(100deg, var(--skeleton-lo) 30%, var(--skeleton-hi) 50%, var(--skeleton-lo) 70%);
|
|
355
355
|
background-size: 200% 100%;
|
|
356
|
-
animation: ${
|
|
356
|
+
animation: ${Q} 1.3s infinite linear;
|
|
357
357
|
|
|
358
358
|
@media (prefers-reduced-motion: reduce) {
|
|
359
359
|
animation: none;
|
|
@@ -379,7 +379,7 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
|
|
|
379
379
|
border: 1px solid transparent;
|
|
380
380
|
background: linear-gradient(100deg, var(--skeleton-lo) 30%, var(--skeleton-hi) 50%, var(--skeleton-lo) 70%);
|
|
381
381
|
background-size: 200% 100%;
|
|
382
|
-
animation: ${
|
|
382
|
+
animation: ${Q} 1.3s infinite linear;
|
|
383
383
|
|
|
384
384
|
@media (prefers-reduced-motion: reduce) {
|
|
385
385
|
animation: none;
|
|
@@ -396,5 +396,5 @@ import{m as Ae,bH as Ee,x as U,w as E,bV as Le,s as u,a as d,k as Ne,B as $e,t a
|
|
|
396
396
|
height: 26px;
|
|
397
397
|
object-fit: contain;
|
|
398
398
|
}
|
|
399
|
-
`,ee=N.withComponent(qe),jt=f.lazy(()=>Ce(()=>import("./index-cGB6nHYf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],z="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ge(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 fe({children:e}){const s=f.useRef(null),[a,i]=f.useState(null),n=()=>{var l;const c=(l=s.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(yt,{ref:s,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>i(null),onFocus:n,onBlur:()=>i(null),children:[e,a?_e.createPortal(t.jsx(bt,{style:{top:a.top,left:a.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,a=!!e.tradeId||s,{data:i,isLoading:n}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:a,staleTime:5*6e4}),c=a&&n,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=K({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,j=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(W,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(V,{name:"cart",size:20})}),t.jsxs(_,{children:[c?t.jsx(J,{}):t.jsx(q,{title:l,children:l}),e.quantity>1?t.jsx(O,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:j}):t.jsx(N,{children:j})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(_,{children:[t.jsx(q,{title:s,children:s}),t.jsx(O,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Je(e.lines),a=s.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),n=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(H,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:a})]})]}),t.jsxs(M,{children:[t.jsx(R,{"data-status":i,children:n}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:s.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function $t({sale:e}){const{data:s,isLoading:a}=E({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)??o("activity.itemFallback"),n=(s==null?void 0:s.thumbnail)??"",c=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[a?t.jsx(Z,{}):t.jsx(W,{children:n?t.jsx("img",{src:n,alt:i}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[a?t.jsx(J,{}):t.jsx(q,{title:i,children:i}),t.jsx(O,{children:o("activity.boughtFrom",{account:ge(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(H,{children:o("activity.paidWithMana")})]}),t.jsxs(M,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function Tt({sale:e,payout:s}){const{data:a,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),n=(a==null?void 0:a.name)??o("activity.itemFallback"),c=(a==null?void 0:a.thumbnail)??"",l=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(W,{children:c?t.jsx("img",{src:c,alt:n}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(J,{}):t.jsx(q,{title:n,children:n}),t.jsxs(O,{children:[o("activity.soldTo",{account:ge(e.counterparty)}),s.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(H,{children:o("activity.saleLabel")})]}),t.jsxs(M,{children:[t.jsx(R,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",He(s.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Pt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,a=Fe(e.status),i=a==="SETTLED"?o("activity.completed"):a==="FAILED"?o("activity.failed"):a==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),n=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!n;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function j(){if(!(!n||l)){r(!0);try{const m=await Me(e.id,n.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}$.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?($.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?($.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):$.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(xt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(H,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:s})]})]}),t.jsxs(M,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void j(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":a,children:i}),t.jsxs(k,{"data-kind":a==="UNFINISHED"?void 0:"income",children:[a==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(wt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:ze,title:o("activity.emptyTitle"),body:s,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Qt(){const{session:e,signIn:s}=U(),[a,i]=f.useState("all"),[n,c]=We(),l=n.get(z)===de||n.get(G)===At;$e({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=Oe(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),g=!!e&&!l&&a!=="sales",x=!!e&&!l&&a!=="purchases",y=T(["purchases",e==null?void 0:e.address],h=>Se(e.address,e.identity,{first:P,skip:h}),{enabled:g}),b=T(["sales",e==null?void 0:e.address],h=>ae(e.address,{role:"seller",first:P,skip:h}),{enabled:x}),v=T(["credit-orders",e==null?void 0:e.address],h=>ne(e.address,e.identity,{first:P,skip:h}),{enabled:g}),w=T(["mana-purchases",e==null?void 0:e.address],h=>ae(e.address,{role:"buyer",first:P,skip:h}),{enabled:g}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ye=f.useMemo(()=>at(te),[te]),{data:be}=Te(x);if(!e)return t.jsx(Pe,{children:t.jsx(ce,{testId:"activity-signin",icon:Be,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>s()},ctaVariant:"solid",fill:!0})});const ie=st(it({purchases:g?y.items:[],sales:x?b.items:[],creditOrders:g?v.items:[],manaPurchases:g?w.items:[],rate:be}),a),ve=g&&(y.isLoading||v.isLoading||w.isLoading)||x&&b.isLoading,se=g&&(y.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||x&&b.isFetchingNextPage,we=g&&(y.hasNextPage||v.hasNextPage||w.hasNextPage)||x&&b.hasNextPage;function ke(){g&&y.hasNextPage&&y.fetchNextPage(),g&&v.hasNextPage&&v.fetchNextPage(),g&&w.hasNextPage&&w.fetchNextPage(),x&&b.hasNextPage&&b.fetchNextPage()}function je(h){if(i(h),!l)return;const I=new URLSearchParams(n);I.delete(z),I.delete(G),c(I,{replace:!0})}function Ie(){const h=new URLSearchParams(n);h.set(z,de),h.delete(G),c(h,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ht,{children:o("nav.activity")})}),t.jsxs(ut,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(h=>t.jsx(ue,{type:"button",role:"tab","aria-selected":!l&&a===h,"data-active":!l&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>je(h),children:o(`activity.filter.${h}`)},h)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(gt,{"aria-busy":"true"}),children:t.jsx(jt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((h,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(h=>h.kind==="purchase"?t.jsx(Nt,{order:h.order},h.id):h.kind==="credit"?t.jsx(Pt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx($t,{sale:h.sale},h.id):t.jsx(Tt,{sale:h.sale,payout:nt(ye,h.sale)},h.id)),se?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:we,isFetching:se,onLoadMore:ke})]})]})}export{Qt as Activity};
|
|
400
|
-
//# sourceMappingURL=Activity-
|
|
399
|
+
`,ee=N.withComponent(qe),jt=f.lazy(()=>Ce(()=>import("./index-CtoH5DSl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],z="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ge(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 fe({children:e}){const s=f.useRef(null),[a,i]=f.useState(null),n=()=>{var l;const c=(l=s.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(yt,{ref:s,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>i(null),onFocus:n,onBlur:()=>i(null),children:[e,a?_e.createPortal(t.jsx(bt,{style:{top:a.top,left:a.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,a=!!e.tradeId||s,{data:i,isLoading:n}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):X(e.contractAddress,{itemId:e.itemId}),enabled:a,staleTime:5*6e4}),c=a&&n,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=K({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,j=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(W,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(V,{name:"cart",size:20})}),t.jsxs(_,{children:[c?t.jsx(J,{}):t.jsx(q,{title:l,children:l}),e.quantity>1?t.jsx(O,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:j}):t.jsx(N,{children:j})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(_,{children:[t.jsx(q,{title:s,children:s}),t.jsx(O,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Je(e.lines),a=s.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),n=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:a})]})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":i,children:n}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:s.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function Tt({sale:e}){const{data:s,isLoading:a}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>X(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??o("activity.itemFallback"),n=(s==null?void 0:s.thumbnail)??"",c=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[a?t.jsx(Z,{}):t.jsx(W,{children:n?t.jsx("img",{src:n,alt:i}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[a?t.jsx(J,{}):t.jsx(q,{title:i,children:i}),t.jsx(O,{children:o("activity.boughtFrom",{account:ge(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function $t({sale:e,payout:s}){const{data:a,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>X(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),n=(a==null?void 0:a.name)??o("activity.itemFallback"),c=(a==null?void 0:a.thumbnail)??"",l=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(W,{children:c?t.jsx("img",{src:c,alt:n}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(J,{}):t.jsx(q,{title:n,children:n}),t.jsxs(O,{children:[o("activity.soldTo",{account:ge(e.counterparty)}),s.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",Me(s.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Pt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,a=Fe(e.status),i=a==="SETTLED"?o("activity.completed"):a==="FAILED"?o("activity.failed"):a==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),n=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!n;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function j(){if(!(!n||l)){r(!0);try{const m=await He(e.id,n.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}T.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?(T.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?(T.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):T.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(xt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void j(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":a,children:i}),t.jsxs(k,{"data-kind":a==="UNFINISHED"?void 0:"income",children:[a==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(wt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:ze,title:o("activity.emptyTitle"),body:s,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Xt(){const{session:e,signIn:s}=U(),[a,i]=f.useState("all"),[n,c]=We(),l=n.get(z)===de||n.get(G)===At;Te({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=Oe(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),g=!!e&&!l&&a!=="sales",x=!!e&&!l&&a!=="purchases",y=$(["purchases",e==null?void 0:e.address],h=>Se(e.address,e.identity,{first:P,skip:h}),{enabled:g}),b=$(["sales",e==null?void 0:e.address],h=>ae(e.address,{role:"seller",first:P,skip:h}),{enabled:x}),v=$(["credit-orders",e==null?void 0:e.address],h=>ne(e.address,e.identity,{first:P,skip:h}),{enabled:g}),w=$(["mana-purchases",e==null?void 0:e.address],h=>ae(e.address,{role:"buyer",first:P,skip:h}),{enabled:g}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ye=f.useMemo(()=>at(te),[te]),{data:be}=$e(x);if(!e)return t.jsx(Pe,{children:t.jsx(ce,{testId:"activity-signin",icon:Be,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>s()},ctaVariant:"solid",fill:!0})});const ie=st(it({purchases:g?y.items:[],sales:x?b.items:[],creditOrders:g?v.items:[],manaPurchases:g?w.items:[],rate:be}),a),ve=g&&(y.isLoading||v.isLoading||w.isLoading)||x&&b.isLoading,se=g&&(y.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||x&&b.isFetchingNextPage,we=g&&(y.hasNextPage||v.hasNextPage||w.hasNextPage)||x&&b.hasNextPage;function ke(){g&&y.hasNextPage&&y.fetchNextPage(),g&&v.hasNextPage&&v.fetchNextPage(),g&&w.hasNextPage&&w.fetchNextPage(),x&&b.hasNextPage&&b.fetchNextPage()}function je(h){if(i(h),!l)return;const I=new URLSearchParams(n);I.delete(z),I.delete(G),c(I,{replace:!0})}function Ie(){const h=new URLSearchParams(n);h.set(z,de),h.delete(G),c(h,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ht,{children:o("nav.activity")})}),t.jsxs(ut,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(h=>t.jsx(ue,{type:"button",role:"tab","aria-selected":!l&&a===h,"data-active":!l&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>je(h),children:o(`activity.filter.${h}`)},h)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(gt,{"aria-busy":"true"}),children:t.jsx(jt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((h,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(h=>h.kind==="purchase"?t.jsx(Nt,{order:h.order},h.id):h.kind==="credit"?t.jsx(Pt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(Tt,{sale:h.sale},h.id):t.jsx($t,{sale:h.sale,payout:nt(ye,h.sale)},h.id)),se?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:we,isFetching:se,onLoadMore:ke})]})]})}export{Xt as Activity};
|
|
400
|
+
//# sourceMappingURL=Activity-CE6Jeo_T.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-Ddn-9d83.js";import{s as f}from"./index-BBS-v8LD.js";import"./dcl-schemas-BW3BbT5l.js";import"./sentry-D_8KijKQ.js";import"./ethers-DGYWmyb1.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]="9736ce16-809d-4281-8ebb-110e0cb968af",e._sentryDebugIdIdentifier="sentry-dbid-9736ce16-809d-4281-8ebb-110e0cb968af")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -94,5 +94,5 @@ void main() {
|
|
|
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 m=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),
|
|
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"),b=t.getUniformLocation(i,"u_resolution"),w=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(b,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(w,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-D5MFl62Y.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-
|
|
1
|
+
import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-Ddn-9d83.js";import{c as se,r as wt,b as jt,bF as vt,h as Xe,j as Ye,bC as Ct,bd as $t,bb as kt,w as St,c$ as Et,d0 as Rt,s as i,a as t,x as dt,bm as Tt,X as _t,F as ht,t as s,d1 as Mt,bI as We,D as It,I as W,z as V,d2 as ze,E as ge,bl as At,l as Nt,O as Me,bw as Je,Z as Lt,bE as Wt,B as pt,a0 as ut,m as mt,cc as zt,cd as Pt,y as Bt,bR as Ft,ay as Ot,a2 as Ut,a4 as et,a5 as be,aJ as Ht,bS as Dt,bT as Gt}from"./index-BBS-v8LD.js";import{u as qt,s as Kt}from"./search-empty-D1Tausth.js";import{u as Vt,l as Zt,m as Qt,S as Xt,F as Yt,a as Jt}from"./Filters-CdMOVmbU.js";import{R as en,S as tn,a as nn,D as sn,b as an,C as on,c as rn,d as ln,e as cn,M as dn}from"./browseLayout.styles-DF9DTUfO.js";import{L as hn}from"./LoadMore-CM5ykem-.js";import{u as pn}from"./useInfiniteGrid-C5wDaoVd.js";import{E as un}from"./ErrorNotice-D_6j8-7f.js";import{d as mn}from"./dcl-schemas-BW3BbT5l.js";import{s as fn,G as xn,w as gn,S as bn}from"./buy-gasless-CTp90Dvn.js";import{s as yn}from"./buy-BiTHthT9.js";import{u as wn,A as jn,C as vn}from"./trade-encoding-BdtZmg5A.js";import{f as Cn}from"./errors-DnOSpKoV.js";import{J as $n,C as kn,B as Ie}from"./ethers-DGYWmyb1.js";import{z as Sn,D as En,w as Rn,W as Tn,m as _n,n as Mn,o as In,v as An,j as tt}from"./CreditPackPicker-yPm96IIv.js";import{u as Nn,M as Ln,o as Wn,l as zn,R as Pn,c as Bn}from"./loader-logo-k6aOBN-R.js";import{P as Fn}from"./PaymentMethodStep-Ob8YI_SL.js";import{R as nt}from"./resume-name-B5w3HYnd.js";import{R as On}from"./resume-buy-DqlXnoQq.js";import{n as Un}from"./name-glyph-aUugT8vq.js";import{c as Hn}from"./crumbs.styles-R8odPxFR.js";import{n as Dn}from"./Tooltip-DFrRznAp.js";import{G as Gn}from"./grid.styles-CVQcD_5t.js";import"./sentry-D_8KijKQ.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-anODpKJf.js";import"./sendMetaTransaction-DaTro9ph.js";import"./mana-matic-CEqvSwrJ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="7146d367-27a6-4a7c-811d-1e2975af6931",n._sentryDebugIdIdentifier="sentry-dbid-7146d367-27a6-4a7c-811d-1e2975af6931")}catch{}})();function ye(n){const a=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${a}:${r}`}const Z="100000000000000000000",ft=2,Ae=15,qn=/^[a-zA-Z0-9]+$/;function st(n){const a=n.trim();return a.length===0?{ok:!1,reason:"empty"}:qn.test(a)?a.length<ft?{ok:!1,reason:"too-short"}:a.length>Ae?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Kn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,Ae)}const Vn=["function available(string _subdomain) view returns (bool)"],it={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Zn(){return se.chainId===Number(mn.ChainId.MATIC_MAINNET)?it.mainnet:it.sepolia}async function Qn(n,a={}){var g;const{rpc:r,address:h}=Zn(),d=new $n(r),w=new kn(h,Vn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const c=await w.available(n);if((g=a.signal)!=null&&g.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${c}`),c?"available":"taken"}const Xn="https://app.across.to/api";class Qe extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Ke extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ve extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function Yn(n){return $t(Z,n)}async function Jn(n,a,r={}){var g;const h=r.chainId??se.chainId,d=r.provider??"across",w=`${se.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(a)}&chainId=${h}&provider=${d}`,c=await kt(w,{method:"GET",identity:n,metadata:{}});if(!c.ok){let l;try{l=(g=await c.json())==null?void 0:g.code}catch{}throw l==="ROUTE_COST_TOO_HIGH"?new Qe:new Error(`fetchNameCreditRoute ${c.status}`)}return c.json()}function es(n,a){const r=Ie.from(n.availableAmount),d=Ie.from(Z).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:vn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:a.externalCall.target,selector:a.externalCall.selector,data:a.externalCall.data,expiresAt:a.externalCall.expiresAt,salt:a.externalCall.salt},customExternalCallSignature:a.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:Z}}async function ts(n,a={}){const r=Xn,h=a.intervalMs??1e4,d=a.maxAttempts??60;let w={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let c=0;c<d;c++){try{const g=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(g.ok){const l=await g.json(),j=(l.status??"pending").toLowerCase(),b=l.fillTx??l.fillTxnRef??null,C=typeof l.actionsSucceeded=="boolean"?l.actionsSucceeded:null;if(j==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:C};if(j==="refunded"||j==="expired")return{status:j,destinationTxHash:null,actionsSucceeded:!1};w={status:"pending",destinationTxHash:b,actionsSucceeded:C}}}catch{}c<d-1&&await new Promise(g=>setTimeout(g,h))}return w}async function ns(n){const{name:a,identity:r,signer:h}=n,d=b=>{var C;try{(C=n.onProgress)==null||C.call(n,b)}catch{}},w=n.chainId??se.chainId,c=n.provider??"across",g=(n.beneficiary??await h.getAddress()).toLowerCase();let l=null,j="unconfirmed";console.info("[names] register start",{name:a,buyer:g,chainId:w,provider:c}),d("preparing");try{const b=await wt(jt(se.chainId).address),C=Yn(b),m=n.creditsCents!=null?Math.max(1,Math.min(Math.trunc(n.creditsCents),C)):C,k=m<C;console.info("[names] step 1/6 sized reservation",{usdCents:m,fullPriceCents:C,payingWithMana:k,manaRate:b});const x=await Jn(r,a,{chainId:w,provider:c});console.info("[names] step 2/6 route fetched",{target:x.externalCall.target,selector:x.externalCall.selector,provider:x.provider,quoteId:x.quoteId});const y=await vt(r,m,void 0,void 0,a);if(l=y.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:y.credit.id,maxCreditedValue:y.maxCreditedValue}),!k&&Ie.from(y.maxCreditedValue).lt(Z))throw new Error("Credit under-sized for the name price");if(k){const u=Ie.from(Z).sub(y.credit.availableAmount);if(n.maxManaWei!=null&&u.gt(n.maxManaWei.toString()))throw new Error("The MANA needed moved past what was agreed");u.gt(0)&&(d("awaiting-confirmation"),await wn({auth:{kind:jn.Allowance,contractAddress:Xe(Ye.MANAToken,w).address,spenderAddress:Xe(Ye.CreditsManager,w).address,chainId:w},signer:h,requiredWei:BigInt(u.toString())}),console.info("[names] step 3b/6 mana allowance ensured",{gapWei:u.toString()}))}d("awaiting-confirmation");const v=es(y.credit,x);let $;try{$=await fn({chainId:w,buyer:g,signer:h,args:v})}catch(u){if(!(u instanceof xn))throw u;if(u.reason==="relayer-unreachable"){j="unobservable";const N=new Ve;throw N.cause=u,N}$=await yn(w,v,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:$}),d("confirming"),await gn($),j="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:$}),c==="across"){d("registering");const u=await ts($,n.acrossPoll);if(console.info("[names] step 6/6 across status",u),u.status==="pending")return{status:"pending",originTxHash:$};if(u.status==="filled"&&u.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:$}),{status:"pending",originTxHash:$};if(u.status!=="filled"||u.actionsSucceeded!==!0)throw new Ke;return{status:"registered",originTxHash:$,destinationTxHash:u.destinationTxHash}}return{status:"pending",originTxHash:$}}catch(b){if(console.error("[names] register failed — raw error:",b,{name:a,buyer:g,originState:j}),b instanceof bn)return{status:"pending",originTxHash:b.txHash};if(l&&j==="unconfirmed"&&await Ct(r,[l]).catch(()=>{}),b instanceof Qe||b instanceof Ke||b instanceof Ve)throw b;const C=new Error(Cn(b,"Couldn't register the name. Please try again.",{sale:!0}));throw C.cause=b,C}}function ss(){const{data:n}=St({queryKey:["feature-flag","shop-names"],queryFn:()=>Et(Rt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const is=60,as=700,os=25;function rs(n){if(!n)return[];const a=[];for(let r=1;r<=n.length;r++)a.push({text:n.slice(0,r),delay:is});a[a.length-1]={text:n,delay:as};for(let r=n.length-1;r>=1;r--)a.push({text:n.slice(0,r),delay:os});return a}function ls(n){return n.flatMap(rs)}function cs(n,a){const r=p.useMemo(()=>ls(n),[n]),[h,d]=p.useState(0);return p.useEffect(()=>{if(!a||r.length===0)return;const w=setTimeout(()=>d(c=>(c+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(w)},[h,a,r]),!a||r.length===0?"":r[h%r.length].text}const ds="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/name-verified-oGwQ3ntb.svg",hs="#34fee6",ps=i.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -509,7 +509,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-57wE9FMW.js";import{c
|
|
|
509
509
|
font-size: 32px;
|
|
510
510
|
font-weight: 700;
|
|
511
511
|
color: ${t.colors.white};
|
|
512
|
-
`;function Fs({name:n,priceCredits:a,onClose:r}){const{session:h}=dt(),{data:d,isError:w}=Tt(h),c=_t(),g=Ze(),[l,j]=p.useState("confirm"),[b,C]=p.useState(""),[m,k]=p.useState(""),[x,y]=p.useState(!1),[v,$]=p.useState(null),u=(v==null?void 0:v.rail)??"credits",[N,F]=p.useState(null),[re,I]=p.useState(!1),[R,O]=p.useState("preparing"),B=p.useRef(!1),ie=b.trim().toLowerCase()===n.toLowerCase(),T=l==="completing"||x,A=a!=null?ht(a):"—",L=a==null,J=d==null?void 0:d.credits,U=a!=null&&J!=null?a-J:0,z=U>0,H=L?s("names.priceUnavailable"):null,{data:G}=Mt(h),q=(G==null?void 0:G.matic)??0n,D=Rn({priceCents:a!=null?a*We:0,priceManaWei:BigInt(Z),balanceCents:(d==null?void 0:d.balanceCents)??0,manaBalanceWei:q,manaOnlyRail:!1}),S=D.options.some(f=>f.method!=="credits"),P=D.options.find(f=>f.method==="combined"),_=v==null&&S&&!L,M=Nn().packs.slice(0,Ln),{packs:ae,recommended:ee,closesGap:le}=Wn(M,U),K=ae.find(f=>f.id===m)??ee;p.useEffect(()=>{const f=E=>{E.key==="Escape"&&!T&&r()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[T,r]);async function Ne(){if(!h||!ie||L||B.current||u==="credits"&&z)return;B.current=!0;const f=u==="combined"?Math.floor(((v==null?void 0:v.creditsCents)??0)/We):a??null;j("completing"),F(null),O("preparing");try{const E=await ns({name:n,identity:h.identity,signer:h.signer,creditsCents:v==null?void 0:v.creditsCents,maxManaWei:v==null?void 0:v.manaWei,onProgress:O});Me("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Je(a??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:u==="combined"?"credits_and_mana":"credits",value_credits:f,value_usd:Je(f??0),transaction_hash:E.originTxHash??null,settlement:E.status}),c.invalidateQueries({queryKey:["usd-balance"]}),c.invalidateQueries({queryKey:["my-assets"]}),j(E.status==="registered"?"success":"pending")}catch(E){Me(Wt(E)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Lt(E),purchase_type:"name"});const oe=E instanceof Ke,fe=E instanceof Ve;F(E instanceof Qe?s("names.errorRouteCost"):oe?s("names.errorNotRegistered"):fe?s("names.errorSettlementUnknown"):(E==null?void 0:E.message)||s("names.errorGeneric")),I(oe||fe),j("error")}finally{B.current=!1}}p.useEffect(()=>{const f=E=>{E.persisted&&y(!1)};return window.addEventListener("pageshow",f),()=>window.removeEventListener("pageshow",f)},[]);async function te(){if(!(!h||!K||x)){y(!0);try{sessionStorage.removeItem(Pn),sessionStorage.removeItem(On),sessionStorage.setItem(nt,n)}catch{}try{const f=await Bn(K.id,{address:h.address,identity:h.identity});if(f.url){window.location.href=f.url;return}if(!f.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");g(`/credits?order=${encodeURIComponent(f.orderId)}`)}catch(f){Nt(f,{flow:"name_buy_credits"});try{sessionStorage.removeItem(nt)}catch{}F(s("buyModal.error.creditsCheckout")),I(!1),j("error"),y(!1)}}}const ce=l!=="success"&&l!=="pending"&&!_,de=It(h==null?void 0:h.providerType),he=de?2:1,pe=de&&(R==="preparing"||R==="awaiting-confirmation"),Le=pe?1:he,ue=pe?s("names.confirming"):R==="registering"?s("names.registering"):s("names.completing"),me=R==="registering"?s("names.processingRegistering"):null,Q=l==="confirm"&&z&&!S,Y=l==="error"?s("names.errorTitle"):Q?s("names.buyCreditsTitle"):s("names.buyTitle");return e.jsx(ps,{onClick:T?void 0:r,role:"presentation",children:e.jsxs(us,{role:"dialog","aria-modal":"true","aria-label":Y,onClick:f=>f.stopPropagation(),children:[ce&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:Y}),e.jsx(Fe,{onClick:r,disabled:T,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{})]}),Q&&e.jsxs(zs,{children:[e.jsxs(Tn,{children:[e.jsx(_n,{}),e.jsxs(Mn,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:U})})," ",s("names.warningToPurchase"),ge()?null:e.jsxs(e.Fragment,{children:[" ",e.jsx(In,{href:At("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),ge()?e.jsxs(we,{"data-testid":"name-row-iap",children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}):null,ge()?null:e.jsx(e.Fragment,{children:e.jsx(An,{packs:ae,selectedId:K==null?void 0:K.id,onSelect:k,recommendedId:le?ee==null?void 0:ee.id:void 0})}),e.jsxs(Ps,{children:[e.jsx(tt,{"data-variant":"outline",onClick:r,disabled:T,"data-testid":"name-topup-cancel",children:s("buyModal.cancel")}),ge()?null:e.jsx(tt,{"data-variant":"gradient","data-testid":"name-buy-credits",disabled:!h||!K||x,onClick:()=>void te(),children:s("buyModal.buy")})]})]}),l==="confirm"&&!Q&&_&&e.jsx(Fn,{asset:{name:`${n}.dcl.eth`,caption:s("names.subtitle"),thumb:e.jsx(Bs,{"aria-hidden":!0,children:"@"})},priceCredits:a??0,priceCents:(a??0)*We,options:D.options,priceManaWei:BigInt(Z),balanceCredits:(d==null?void 0:d.credits)??0,manaBalanceWei:q,onBuy:f=>{$(f==="combined"&&P?{rail:"combined",creditsCents:P.creditsCents,manaWei:P.manaWei}:{rail:"credits"})},onClose:r,busy:T}),(l==="confirm"||l==="error")&&!Q&&!_&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}),re?e.jsx(De,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(De,{onClick:()=>j("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(bs,{children:[e.jsx(ys,{children:s("names.confirmTitle")}),e.jsx(ws,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${Os(n)}</b>`})}}),e.jsxs(js,{children:[e.jsx(vs,{"aria-hidden":!0,children:"@"}),e.jsx(Cs,{value:b,onChange:f=>C(f.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx($s,{children:".dcl.eth"})]})]}),H?e.jsxs(Ge,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:H})]}):null,e.jsx(De,{onClick:()=>void Ne(),disabled:!ie||!h||L||u==="credits"&&z,children:s("names.buyCta")})]})]}),l==="completing"&&e.jsxs(ks,{children:[e.jsx(Ss,{src:zn,alt:"",width:61,height:61}),e.jsxs(Es,{children:[e.jsx(Rs,{children:ue}),e.jsxs(_s,{children:[e.jsx(Ms,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Is,{"data-testid":"name-progress-count",children:`${Le}/${he}`})]}),me?e.jsx(Ts,{children:me}):null]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.pendingHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(Ge,{"data-tone":"info",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsx(at,{children:e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.successHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(As,{children:[e.jsx(Ns,{"aria-hidden":!0,children:e.jsx(W,{name:"check"})}),e.jsxs(Ls,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsxs(ms,{"data-testid":"name-success-tile",children:[e.jsx(fs,{src:Un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(xs,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(gs,{src:ds,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsxs(at,{children:[e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")}),e.jsx(Ws,{href:se.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function Os(n){return n.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a])}const Us="https://cdn.decentraland.org/@dcl/shop/1.17.1/_assets/identity-icon-C8yAW_Gq.svg",Hs="https://cdn.decentraland.org/@dcl/shop/1.17.1/_assets/world-icon-6xQ-PmmW.svg",Ds="https://cdn.decentraland.org/@dcl/shop/1.17.1/_assets/invite-icon-Bz6lCTuB.svg",Gs="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",qs=i.div`
|
|
512
|
+
`;function Fs({name:n,priceCredits:a,onClose:r}){const{session:h}=dt(),{data:d,isError:w}=Tt(h),c=_t(),g=Ze(),[l,j]=p.useState("confirm"),[b,C]=p.useState(""),[m,k]=p.useState(""),[x,y]=p.useState(!1),[v,$]=p.useState(null),u=(v==null?void 0:v.rail)??"credits",[N,F]=p.useState(null),[re,I]=p.useState(!1),[R,O]=p.useState("preparing"),B=p.useRef(!1),ie=b.trim().toLowerCase()===n.toLowerCase(),T=l==="completing"||x,A=a!=null?ht(a):"—",L=a==null,J=d==null?void 0:d.credits,U=a!=null&&J!=null?a-J:0,z=U>0,H=L?s("names.priceUnavailable"):null,{data:G}=Mt(h),q=(G==null?void 0:G.matic)??0n,D=Rn({priceCents:a!=null?a*We:0,priceManaWei:BigInt(Z),balanceCents:(d==null?void 0:d.balanceCents)??0,manaBalanceWei:q,manaOnlyRail:!1}),S=D.options.some(f=>f.method!=="credits"),P=D.options.find(f=>f.method==="combined"),_=v==null&&S&&!L,M=Nn().packs.slice(0,Ln),{packs:ae,recommended:ee,closesGap:le}=Wn(M,U),K=ae.find(f=>f.id===m)??ee;p.useEffect(()=>{const f=E=>{E.key==="Escape"&&!T&&r()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[T,r]);async function Ne(){if(!h||!ie||L||B.current||u==="credits"&&z)return;B.current=!0;const f=u==="combined"?Math.floor(((v==null?void 0:v.creditsCents)??0)/We):a??null;j("completing"),F(null),O("preparing");try{const E=await ns({name:n,identity:h.identity,signer:h.signer,creditsCents:v==null?void 0:v.creditsCents,maxManaWei:v==null?void 0:v.manaWei,onProgress:O});Me("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Je(a??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:u==="combined"?"credits_and_mana":"credits",value_credits:f,value_usd:Je(f??0),transaction_hash:E.originTxHash??null,settlement:E.status}),c.invalidateQueries({queryKey:["usd-balance"]}),c.invalidateQueries({queryKey:["my-assets"]}),j(E.status==="registered"?"success":"pending")}catch(E){Me(Wt(E)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Lt(E),purchase_type:"name"});const oe=E instanceof Ke,fe=E instanceof Ve;F(E instanceof Qe?s("names.errorRouteCost"):oe?s("names.errorNotRegistered"):fe?s("names.errorSettlementUnknown"):(E==null?void 0:E.message)||s("names.errorGeneric")),I(oe||fe),j("error")}finally{B.current=!1}}p.useEffect(()=>{const f=E=>{E.persisted&&y(!1)};return window.addEventListener("pageshow",f),()=>window.removeEventListener("pageshow",f)},[]);async function te(){if(!(!h||!K||x)){y(!0);try{sessionStorage.removeItem(Pn),sessionStorage.removeItem(On),sessionStorage.setItem(nt,n)}catch{}try{const f=await Bn(K.id,{address:h.address,identity:h.identity});if(f.url){window.location.href=f.url;return}if(!f.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");g(`/credits?order=${encodeURIComponent(f.orderId)}`)}catch(f){Nt(f,{flow:"name_buy_credits"});try{sessionStorage.removeItem(nt)}catch{}F(s("buyModal.error.creditsCheckout")),I(!1),j("error"),y(!1)}}}const ce=l!=="success"&&l!=="pending"&&!_,de=It(h==null?void 0:h.providerType),he=de?2:1,pe=de&&(R==="preparing"||R==="awaiting-confirmation"),Le=pe?1:he,ue=pe?s("names.confirming"):R==="registering"?s("names.registering"):s("names.completing"),me=R==="registering"?s("names.processingRegistering"):null,Q=l==="confirm"&&z&&!S,X=l==="error"?s("names.errorTitle"):Q?s("names.buyCreditsTitle"):s("names.buyTitle");return e.jsx(ps,{onClick:T?void 0:r,role:"presentation",children:e.jsxs(us,{role:"dialog","aria-modal":"true","aria-label":X,onClick:f=>f.stopPropagation(),children:[ce&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:X}),e.jsx(Fe,{onClick:r,disabled:T,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{})]}),Q&&e.jsxs(zs,{children:[e.jsxs(Tn,{children:[e.jsx(_n,{}),e.jsxs(Mn,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:U})})," ",s("names.warningToPurchase"),ge()?null:e.jsxs(e.Fragment,{children:[" ",e.jsx(In,{href:At("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),ge()?e.jsxs(we,{"data-testid":"name-row-iap",children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}):null,ge()?null:e.jsx(e.Fragment,{children:e.jsx(An,{packs:ae,selectedId:K==null?void 0:K.id,onSelect:k,recommendedId:le?ee==null?void 0:ee.id:void 0})}),e.jsxs(Ps,{children:[e.jsx(tt,{"data-variant":"outline",onClick:r,disabled:T,"data-testid":"name-topup-cancel",children:s("buyModal.cancel")}),ge()?null:e.jsx(tt,{"data-variant":"gradient","data-testid":"name-buy-credits",disabled:!h||!K||x,onClick:()=>void te(),children:s("buyModal.buy")})]})]}),l==="confirm"&&!Q&&_&&e.jsx(Fn,{asset:{name:`${n}.dcl.eth`,caption:s("names.subtitle"),thumb:e.jsx(Bs,{"aria-hidden":!0,children:"@"})},priceCredits:a??0,priceCents:(a??0)*We,options:D.options,priceManaWei:BigInt(Z),balanceCredits:(d==null?void 0:d.credits)??0,manaBalanceWei:q,onBuy:f=>{$(f==="combined"&&P?{rail:"combined",creditsCents:P.creditsCents,manaWei:P.manaWei}:{rail:"credits"})},onClose:r,busy:T}),(l==="confirm"||l==="error")&&!Q&&!_&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}),re?e.jsx(De,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(De,{onClick:()=>j("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(bs,{children:[e.jsx(ys,{children:s("names.confirmTitle")}),e.jsx(ws,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${Os(n)}</b>`})}}),e.jsxs(js,{children:[e.jsx(vs,{"aria-hidden":!0,children:"@"}),e.jsx(Cs,{value:b,onChange:f=>C(f.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx($s,{children:".dcl.eth"})]})]}),H?e.jsxs(Ge,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:H})]}):null,e.jsx(De,{onClick:()=>void Ne(),disabled:!ie||!h||L||u==="credits"&&z,children:s("names.buyCta")})]})]}),l==="completing"&&e.jsxs(ks,{children:[e.jsx(Ss,{src:zn,alt:"",width:61,height:61}),e.jsxs(Es,{children:[e.jsx(Rs,{children:ue}),e.jsxs(_s,{children:[e.jsx(Ms,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Is,{"data-testid":"name-progress-count",children:`${Le}/${he}`})]}),me?e.jsx(Ts,{children:me}):null]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.pendingHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(Ge,{"data-tone":"info",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsx(at,{children:e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.successHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(As,{children:[e.jsx(Ns,{"aria-hidden":!0,children:e.jsx(W,{name:"check"})}),e.jsxs(Ls,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsxs(ms,{"data-testid":"name-success-tile",children:[e.jsx(fs,{src:Un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(xs,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(gs,{src:ds,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsxs(at,{children:[e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")}),e.jsx(Ws,{href:se.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function Os(n){return n.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a])}const Us="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/identity-icon-C8yAW_Gq.svg",Hs="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/world-icon-6xQ-PmmW.svg",Ds="https://cdn.decentraland.org/@dcl/shop/1.17.2-36157867735.commit-7431f7b/_assets/invite-icon-Bz6lCTuB.svg",Gs="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",qs=i.div`
|
|
513
513
|
width: 100%;
|
|
514
514
|
min-width: 0;
|
|
515
515
|
`,Ks=i.nav`
|
|
@@ -551,7 +551,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-57wE9FMW.js";import{c
|
|
|
551
551
|
gap: 32px;
|
|
552
552
|
padding-bottom: 32px;
|
|
553
553
|
}
|
|
554
|
-
`,
|
|
554
|
+
`,Xs=i.div`
|
|
555
555
|
position: relative;
|
|
556
556
|
border: 1px solid ${t.colors.magenta};
|
|
557
557
|
border-radius: 24px;
|
|
@@ -568,7 +568,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-57wE9FMW.js";import{c
|
|
|
568
568
|
padding: 40px 20px;
|
|
569
569
|
gap: 28px;
|
|
570
570
|
}
|
|
571
|
-
`,
|
|
571
|
+
`,Ys=i.div`
|
|
572
572
|
display: flex;
|
|
573
573
|
flex-direction: column;
|
|
574
574
|
align-items: center;
|
|
@@ -970,7 +970,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-57wE9FMW.js";import{c
|
|
|
970
970
|
clip: rect(0, 0, 0, 0);
|
|
971
971
|
white-space: nowrap;
|
|
972
972
|
border: 0;
|
|
973
|
-
`,Ci="https://docs.decentraland.org/creator/worlds/about/",$i="https://governance.decentraland.org";function lt(n){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ki({onBack:n}){pt({title:s("seo.names.title"),description:s("seo.names.description")});const{session:a,signIn:r}=dt(),h=Ze(),d=bt(),{pathname:w,search:c}=d,g=d.state,l=typeof(g==null?void 0:g.resumeName)=="string"?g:void 0,j=ss(),{data:b}=ut(),C=b?mt(Z,b):null,[m,k]=p.useState((l==null?void 0:l.resumeName)??""),[x,y]=p.useState("idle"),[v,$]=p.useState(!1),[u,N]=p.useState((l==null?void 0:l.resumeName)??""),[F,re]=p.useState(!!(l!=null&&l.resumeName)),[I,R]=p.useState(()=>{var S;return typeof window<"u"&&!!((S=window.matchMedia)!=null&&S.call(window,"(prefers-reduced-motion: reduce)").matches)});p.useEffect(()=>{var _;const S=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)");if(!S)return;const P=M=>R(M.matches);return S.addEventListener("change",P),()=>S.removeEventListener("change",P)},[]);const O=s("names.placeholderExamples"),B=p.useMemo(()=>O.split(",").map(S=>S.trim()).filter(Boolean),[O]),T=cs(B,!F&&!m&&!I)||s("names.inputPlaceholder"),A=p.useRef(null),[L,J]=p.useState(void 0);p.useLayoutEffect(()=>{A.current&&J(A.current.getBoundingClientRect().width)},[m,T]),p.useEffect(()=>{if(!st(m).ok){y(m.length===0?"idle":"invalid");return}y("checking");const P=new AbortController,_=setTimeout(()=>{(async()=>{try{const M=await Qn(m,{signal:P.signal});y(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;y("error")}})()},400);return()=>{clearTimeout(_),P.abort()}},[m]);const U=st(m),z=U.ok&&(x==="available"||x==="error"),H=j&&z,G=!j&&z;function q(){if(H){if(!a){r();return}$(!0)}}p.useEffect(()=>{l!=null&&l.resumeName&&h(`${w}${c}`,{replace:!0,state:null})},[l==null?void 0:l.resumeName,h,w,c]),p.useEffect(()=>{if(u){if(m.toLowerCase()!==u.toLowerCase()){N("");return}if(!(x==="idle"||x==="checking")){if(!z){N("");return}!j||!a||(N(""),$(!0))}}},[u,m,x,z,j,a]);const D=e.jsxs(e.Fragment,{children:[s("names.claim"),C!=null?e.jsxs(ui,{children:[e.jsx(V,{}),ht(C)]}):null]});return e.jsxs(qs,{"data-testid":"names-page",children:[e.jsxs(Ks,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Vs,{onClick:n,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Zs,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Qs,{children:[e.jsxs(
|
|
973
|
+
`,Ci="https://docs.decentraland.org/creator/worlds/about/",$i="https://governance.decentraland.org";function lt(n){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ki({onBack:n}){pt({title:s("seo.names.title"),description:s("seo.names.description")});const{session:a,signIn:r}=dt(),h=Ze(),d=bt(),{pathname:w,search:c}=d,g=d.state,l=typeof(g==null?void 0:g.resumeName)=="string"?g:void 0,j=ss(),{data:b}=ut(),C=b?mt(Z,b):null,[m,k]=p.useState((l==null?void 0:l.resumeName)??""),[x,y]=p.useState("idle"),[v,$]=p.useState(!1),[u,N]=p.useState((l==null?void 0:l.resumeName)??""),[F,re]=p.useState(!!(l!=null&&l.resumeName)),[I,R]=p.useState(()=>{var S;return typeof window<"u"&&!!((S=window.matchMedia)!=null&&S.call(window,"(prefers-reduced-motion: reduce)").matches)});p.useEffect(()=>{var _;const S=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)");if(!S)return;const P=M=>R(M.matches);return S.addEventListener("change",P),()=>S.removeEventListener("change",P)},[]);const O=s("names.placeholderExamples"),B=p.useMemo(()=>O.split(",").map(S=>S.trim()).filter(Boolean),[O]),T=cs(B,!F&&!m&&!I)||s("names.inputPlaceholder"),A=p.useRef(null),[L,J]=p.useState(void 0);p.useLayoutEffect(()=>{A.current&&J(A.current.getBoundingClientRect().width)},[m,T]),p.useEffect(()=>{if(!st(m).ok){y(m.length===0?"idle":"invalid");return}y("checking");const P=new AbortController,_=setTimeout(()=>{(async()=>{try{const M=await Qn(m,{signal:P.signal});y(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;y("error")}})()},400);return()=>{clearTimeout(_),P.abort()}},[m]);const U=st(m),z=U.ok&&(x==="available"||x==="error"),H=j&&z,G=!j&&z;function q(){if(H){if(!a){r();return}$(!0)}}p.useEffect(()=>{l!=null&&l.resumeName&&h(`${w}${c}`,{replace:!0,state:null})},[l==null?void 0:l.resumeName,h,w,c]),p.useEffect(()=>{if(u){if(m.toLowerCase()!==u.toLowerCase()){N("");return}if(!(x==="idle"||x==="checking")){if(!z){N("");return}!j||!a||(N(""),$(!0))}}},[u,m,x,z,j,a]);const D=e.jsxs(e.Fragment,{children:[s("names.claim"),C!=null?e.jsxs(ui,{children:[e.jsx(V,{}),ht(C)]}):null]});return e.jsxs(qs,{"data-testid":"names-page",children:[e.jsxs(Ks,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Vs,{onClick:n,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Zs,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Qs,{children:[e.jsxs(Xs,{children:[e.jsxs(Ys,{children:[e.jsx(Js,{children:s("names.heroTitle")}),e.jsx(ei,{children:s("names.heroSubtitle")})]}),e.jsxs(ti,{children:[e.jsxs(ni,{"data-testid":"names-input-wrap",children:[e.jsxs(si,{invalid:x==="taken",children:[e.jsxs(ri,{children:[e.jsx(li,{"aria-hidden":!0,children:"@"}),e.jsx(ci,{value:m,onChange:S=>k(Kn(S.target.value)),placeholder:T,"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Ae,onFocus:()=>re(!0),style:{width:L!=null?`${L}px`:void 0}}),e.jsx(ii,{ref:A,"aria-hidden":!0,"data-placeholder":!m||void 0,children:m||T}),e.jsx(di,{children:s("names.suffix")})]}),m.length>0?e.jsxs(hi,{"aria-hidden":!0,children:[m.length,"/",Ae]}):null,e.jsx(gt,{onClick:q,disabled:!H,"data-testid":"names-claim",children:D})]}),x==="taken"?e.jsxs(ai,{role:"status","data-testid":"names-taken",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(oi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null,x==="checking"?e.jsx(ke,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):G?e.jsxs(ke,{tone:"muted",role:"status","data-testid":"names-disabled",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.registrationDisabled")}),e.jsxs(fi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.registrationDisabledLink"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):x==="error"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.checkError")}):x==="invalid"&&!U.ok&&U.reason==="too-short"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.tooShort",{min:ft})}):null]}),e.jsx(pi,{onClick:q,disabled:!H,children:D}),e.jsx(vi,{role:"status","aria-live":"polite",children:x==="available"?s("names.available",{name:m}):""})]})]}),e.jsxs(xi,{children:[e.jsxs(gi,{children:[e.jsx(bi,{children:s("names.whyTitle")}),e.jsx(yi,{children:s("names.whyIntro")})]}),e.jsxs(wi,{children:[e.jsxs(Se,{children:[e.jsx(Ee,{src:Us,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why1Title")}),e.jsx(_e,{children:s("names.why1")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Hs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why2Title")}),e.jsxs(_e,{children:[s("names.why2")," ",e.jsx(ji,{children:s("names.why2Address")})]}),e.jsxs(rt,{href:Ci,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Ds,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why3Title")}),e.jsx(_e,{children:s("names.why3")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Gs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why4Title")}),e.jsx(_e,{children:s("names.why4")}),e.jsxs(rt,{href:$i,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),v?e.jsx(Fs,{name:m,priceCredits:C,onClose:()=>$(!1)}):null]})}const Si=i.p`
|
|
974
974
|
display: flex;
|
|
975
975
|
align-items: center;
|
|
976
976
|
gap: 10px;
|
|
@@ -986,5 +986,5 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-57wE9FMW.js";import{c
|
|
|
986
986
|
background: rgba(211, 51, 51, 0.1);
|
|
987
987
|
color: ${t.colors.err};
|
|
988
988
|
}
|
|
989
|
-
`,ct=48,Ei=["all","on_sale","not_for_sale"],Ri=n=>n?"all":"on_sale",qe=(n,a)=>n?"relevance":a?"discount":"newest";function sa({contracts:n,hideNames:a=!1,seo:r,lockStatus:h}={}){const[d]=yt(),w=Ze(),c=(d.get("q")??"").trim().toLowerCase(),g=(d.get("q")??"").trim();pt(r??{title:g?s("seo.collectibles.searchTitle",{query:g}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const l=Ri(!!c),j=zt(),b=j&&d.get("deals")==="true",C=p.useMemo(()=>({category:"all",status:l,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:qe(!!c,b)}),[l,b,c]),[m,k]=qt(C),{subCategory:x,rarities:y,priceMin:v,priceMax:$,smart:u,sort:N}=m,F=j&&m.deals,I=Pt.map(o=>o.key).filter(o=>!(a&&o==="names")).includes(m.category)?m.category:"all",R=h??(Ei.includes(m.status)?m.status:l);Vt(`${I}:${x??""}`);const[O,B]=p.useState(!1);p.useEffect(()=>{if(!O)return;const o=xe=>{xe.key==="Escape"&&B(!1)};document.addEventListener("keydown",o);const
|
|
990
|
-
//# sourceMappingURL=Assets-
|
|
989
|
+
`,ct=48,Ei=["all","on_sale","not_for_sale"],Ri=n=>n?"all":"on_sale",qe=(n,a)=>n?"relevance":a?"discount":"newest";function sa({contracts:n,hideNames:a=!1,seo:r,lockStatus:h}={}){const[d]=yt(),w=Ze(),c=(d.get("q")??"").trim().toLowerCase(),g=(d.get("q")??"").trim();pt(r??{title:g?s("seo.collectibles.searchTitle",{query:g}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const l=Ri(!!c),j=zt(),b=j&&d.get("deals")==="true",C=p.useMemo(()=>({category:"all",status:l,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:qe(!!c,b)}),[l,b,c]),[m,k]=qt(C),{subCategory:x,rarities:y,priceMin:v,priceMax:$,smart:u,sort:N}=m,F=j&&m.deals,I=Pt.map(o=>o.key).filter(o=>!(a&&o==="names")).includes(m.category)?m.category:"all",R=h??(Ei.includes(m.status)?m.status:l);Vt(`${I}:${x??""}`);const[O,B]=p.useState(!1);p.useEffect(()=>{if(!O)return;const o=xe=>{xe.key==="Escape"&&B(!1)};document.addEventListener("keydown",o);const Y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=Y}},[O]);const ie=n!==void 0&&n.length===0,T=R==="on_sale",A=v&&!Number.isNaN(Number(v))?Number(v):void 0,L=$&&!Number.isNaN(Number($))?Number($):void 0,J=Bt(),U=x?Gt[x]:void 0,z=[...c?[Zt]:[],...F?Qt:Xt],H=z.find(o=>o.key===N)??z[0],G=H.server,q={category:I,rarities:y.length?y:void 0,wearableCategories:U,minPriceCredits:A,maxPriceCredits:L,search:c||void 0,sortBy:G,isSmart:u||void 0,onSale:!0,discounted:F||void 0,listingType:J?void 0:"primary",contractAddresses:n!=null&&n.length?n:void 0},D={category:I,rarities:y.length?y:void 0,wearableCategories:U,search:c||void 0,sortBy:G,isWearableSmart:u||void 0,isOnSale:R==="not_for_sale"?!1:void 0,contractAddresses:n!=null&&n.length?n:void 0},{items:S,total:P,isLoading:_,isPlaceholderData:M,error:ae,hasNextPage:ee,isFetchingNextPage:le,isFetchNextPageError:K,fetchNextPage:Ne}=pn(T?["shop-items",q]:["catalog-items",D],o=>T?Ht({...q,first:ct,skip:o}):Dt({...D,first:ct,skip:o}),{enabled:I!=="names"&&!ie}),te=P,{data:ce,isError:de,isPending:he}=ut(),pe=o=>ce&&o.manaWei?mt(o.manaWei,ce):null,Le=T&&he&&S.some(o=>o.source==="legacy"),ue=_||M||Le,me=_?15:Math.max(S.length,1),Q=p.useRef(null);p.useEffect(()=>{_||M||!c||Q.current===c||(Q.current=c,Me("Shop Searched",{query:c,result_count:te}))},[c,_,M,te]);const X=p.useRef("__init__");p.useEffect(()=>{if(_||M)return;const o=JSON.stringify({category:I,subCategory:x,rarities:y,min:A,max:L,sort:N,status:R,smart:u});if(X.current==="__init__"||X.current===o){X.current=o;return}X.current=o,Me("Shop Applied Filter",{filters:{category:I,sub_category:x,rarities:y,min_price_credits:A??null,max_price_credits:L??null,status:R,smart:u,sort:N},result_count:te})},[I,x,y,A,L,N,R,u,_,M,te]);function f(o){k({category:o,subCategory:null})}function E(o){k({status:o})}function oe(o){k({rarities:y.includes(o)?y.filter(Y=>Y!==o):[...y,o]})}function fe(){k(C)}const ne=[];(A!=null||L!=null)&&ne.push({key:"price",label:s("filter.price"),onRemove:()=>{k({priceMin:"",priceMax:""})}});for(const o of Ft)y.includes(o)&&ne.push({key:`rarity-${o}`,label:Ot(o),onRemove:()=>oe(o)});return u&&ne.push({key:"smart",label:s("filter.smart"),onRemove:()=>k({smart:!1})}),F&&ne.push({key:"deals",label:s("filter.deals"),onRemove:()=>k({deals:!1,sort:qe(!!c,!1)})}),R!==l&&ne.push({key:"status",label:R==="all"?s("filter.statusAll"):R==="on_sale"?s("filter.onSale"):s("filter.notForSale"),onRemove:()=>E(l)}),e.jsxs(en,{"data-testid":"browse",children:[I!=="names"&&e.jsxs(e.Fragment,{children:[O?e.jsx(tn,{onClick:()=>B(!1),"aria-hidden":!0}):null,e.jsxs(nn,{"data-open":O||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(sn,{children:[e.jsx(an,{children:s("assets.filters")}),e.jsx(on,{onClick:()=>B(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(rn,{children:e.jsx(Yt,{category:I,subCategory:x,onCategory:f,onSub:o=>k({subCategory:o}),priceMin:v,priceMax:$,onPriceMin:o=>k({priceMin:o}),onPriceMax:o=>k({priceMax:o}),rarities:y,onToggleRarity:oe,status:R,onStatus:E,hideNames:a,smart:u,onSmart:o=>k({smart:o}),deals:F,onDeals:j?o=>k({deals:o,sort:qe(!!c,o)}):void 0})}),e.jsx(ln,{children:e.jsx(cn,{type:"button",onClick:()=>B(!1),children:s("assets.showItems")})})]})]}),e.jsx(dn,{children:I==="names"?e.jsx(ki,{onBack:()=>f("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Jt,{sort:H.key,sortOptions:z,onSort:o=>k({sort:o}),total:P,loading:_||M,query:c,onOpenFilters:()=>B(!0),chips:ne,onClearChips:fe}),de&&T&&S.some(o=>o.source==="legacy")?e.jsx(Si,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,ae?e.jsx(un,{message:s("assets.loadError"),testId:"browse-error"}):null,!ue&&S.length===0&&!ae?e.jsx(Ut,{testId:"browse-empty",icon:Kt,title:s("assets.empty.title"),body:g?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:g}),s("assets.empty.searchAfter")]}):s("assets.empty.filters"),cta:{label:s("assets.empty.cta"),onClick:()=>w("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(Gn,{"data-testid":"grid",children:ue?e.jsx(et,{count:me}):e.jsxs(e.Fragment,{children:[S.map(o=>{if(!T)return e.jsx(be,{item:o,mode:"view"},ye(o));const Y=o;if(Y.source!=="legacy")return e.jsx(be,{item:o},ye(o));const xe=pe(Y);return xe==null?e.jsx(be,{item:o,mode:"view"},ye(o)):e.jsx(be,{item:{...Y,priceCredits:xe}},ye(o))}),le?e.jsx(et,{count:6}):null]})}),e.jsx(hn,{hasNextPage:ee,isFetching:le,isError:K,onLoadMore:()=>void Ne()})]})]})})]})}export{sa as Assets};
|
|
990
|
+
//# sourceMappingURL=Assets-COp5lo1c.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-
|
|
1
|
+
import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-Ddn-9d83.js";import{s as i,a as z,t as a,z as Ie,F as pe,W as Fe,C as Me,E as Le,bl as Ma,A as Ta,I as Y,n as Je,B as Ia,aj as H,$ as Tt,x as Aa,y as Ea,w as Pa,bm as za,X as Ra,bn as Ba,a0 as _a,bo as qa,bp as Wa,bq as Fa,br as It,a2 as La,bs as Ka,bt as Na,bu as Qa,av as Ke,a3 as Ua,D as Ga,bv as At,O as V,bw as Et,bx as Oa,by as Ha,l as ie,bz as Da,bA as Va,bB as Ya,bC as Ne,bi as Xa,bD as we,bE as Ce,Z as Pt,bF as Ja,h as zt,j as Rt,bG as Za}from"./index-BBS-v8LD.js";import{C as es,b as ts,t as as,a as ss,A as ns,s as Bt,r as _t,i as qt,m as is,c as rs,p as Wt,d as os}from"./CollectionCarousel-C_r2HthR.js";import{M as cs,S as ls,C as ds,H as us,a as hs,T as ps,X as gs,B as xs,b as fs,c as Ft,d as ms,e as Ae,f as bs,g as ys,h as vs,i as Xe,j as he,L as ws,P as Cs,k as Lt,l as Kt,W as js,m as ks,n as Ss,o as $s,A as Ms,p as Ts,q as Is,r as As,s as Es,t as Ps,u as zs,v as Rs,w as Qe,x as Bs,y as _s}from"./CreditPackPicker-yPm96IIv.js";import{m as Te}from"./mana-matic-light-Bl5duieC.js";import{q as qs,s as Ws,g as Fs,t as Ls,u as Ks,A as Ns}from"./trade-encoding-BdtZmg5A.js";import{p as Nt,g as Qs,a as Ue}from"./buy-BiTHthT9.js";import{w as Us,S as Ge,b as Gs,G as Os}from"./buy-gasless-CTp90Dvn.js";import{l as Hs,u as Ds,M as Vs,R as je,o as Ys,r as Xs,c as Js,g as Zs,a as en,p as Qt,b as Oe}from"./loader-logo-k6aOBN-R.js";import{i as tn,a as an}from"./errors-DnOSpKoV.js";import{E as sn}from"./ErrorNotice-D_6j8-7f.js";import"./dcl-schemas-BW3BbT5l.js";import"./sentry-D_8KijKQ.js";import"./ethers-DGYWmyb1.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-DaTro9ph.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new n.Error().stack;d&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[d]="ebcb1288-dcd4-4af0-8020-5169e1deaa23",n._sentryDebugIdIdentifier="sentry-dbid-ebcb1288-dcd4-4af0-8020-5169e1deaa23")}catch{}})();const nn=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -161,7 +161,7 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-57wE9FMW.js";import{s
|
|
|
161
161
|
font-weight: 700;
|
|
162
162
|
color: ${re.text};
|
|
163
163
|
}
|
|
164
|
-
`,
|
|
164
|
+
`,xn=i.p`
|
|
165
165
|
margin: 12px 0 0;
|
|
166
166
|
background: rgba(255, 162, 90, 0.3);
|
|
167
167
|
border-radius: ${z.radius.btn};
|
|
@@ -170,7 +170,7 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-57wE9FMW.js";import{s
|
|
|
170
170
|
font-size: 14px;
|
|
171
171
|
line-height: 1.334;
|
|
172
172
|
color: ${z.colors.text2};
|
|
173
|
-
`;function
|
|
173
|
+
`;function fn(n){const{phase:d,balanceCredits:k,onClose:S}=n,R=d==="processing",U=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),G=d==="processing";return e.jsxs(cs,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ls,{onClick:R?void 0:S,"aria-hidden":!0}),e.jsxs(ds,{"data-tall":G||void 0,children:[e.jsxs(us,{children:[e.jsxs(hs,{children:[e.jsx(ps,{children:U}),!R&&e.jsx(gs,{onClick:S,"aria-label":a("buyModal.close"),children:e.jsx(es,{})})]}),e.jsxs(xs,{children:[e.jsx(fs,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(Ft,{}),e.jsx(ms,{children:pe(k)})]}),n.heldCreditsCount&&(d==="choose"||d==="nofunds")?e.jsx(xn,{"data-testid":"cart-held-notice",children:a("buyModal.heldExplainer",{credits:n.heldCreditsCount,currency:Me.name})}):null]}),d==="choose"&&e.jsxs(Ae,{children:[e.jsxs(gn,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(Ft,{}),pe(n.totalCredits??0)]})]}),e.jsx(Zt,{options:n.options??[],totalCents:n.totalCents??0,shortfall:n.shortfall,onPay:n.onPay??(()=>{})})]}),d==="processing"&&e.jsx(mn,{stage:n.stage??"reserving",step:n.step??1,total:n.total??1,isSelfCustody:!!n.isSelfCustody,signatures:n.signatures}),d==="nofunds"&&e.jsx(bn,{lines:n.lines??[],shortfallCredits:n.shortfallCredits??0,packs:n.packs??[],selectedPack:n.selectedPack??"",onSelectPack:n.onSelectPack??(()=>{}),onBuyPacks:n.onBuyPacks??(()=>{}),onCancel:S}),d==="error"&&e.jsxs(Ae,{children:[e.jsxs(bs,{"data-testid":"buy-error",children:[e.jsx(ys,{src:ts,alt:"",width:64,height:80}),e.jsxs(vs,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",n.heldCredits?e.jsxs(e.Fragment,{children:[n.message?e.jsxs(e.Fragment,{children:[n.message," "]}):null,a("cartCheckout.heldLead",{currency:Me.name}),e.jsx("b",{children:a("cartCheckout.heldBold")}),a("cartCheckout.heldTail",{currency:Me.name})]}):n.message??a("cartCheckout.errorBody")]})]}),n.heldCredits?e.jsx(Xe,{children:e.jsx(he,{"data-variant":"purple","data-full":!0,onClick:S,children:a("cartCheckout.gotIt")})}):e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:S,children:a("buyModal.cancel")}),e.jsx(he,{"data-variant":"purple",onClick:n.onRetry??S,children:a("cartCheckout.tryAgain")})]})]})]})]})}function mn({stage:n,step:d,total:k,isSelfCustody:S,signatures:R}){const U=n==="reserving",G=k>0?Math.min(100,Math.round(d/k*100)):0,O=S&&R&&R.total>1,M=n==="awaiting-signature"?S?O?a("cartCheckout.confirmMultiple",{current:R.current,total:R.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):n==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ae,{"data-processing":!0,children:[e.jsx(ws,{src:Hs,alt:"",width:61,height:61}),e.jsx(Cs,{children:M}),U?e.jsxs(dn,{children:[e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{"data-step":!0,style:{width:`${G}%`}})}),k>1?e.jsxs(un,{children:[d,"/",k]}):null]}):e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{})})]})}function bn({lines:n,shortfallCredits:d,packs:k,selectedPack:S,onSelectPack:R,onBuyPacks:U,onCancel:G}){const O=n.reduce((M,r)=>M+(r.quantity??1),0);return e.jsxs(Ae,{children:[e.jsxs(js,{"data-testid":"nofunds-warning",children:[e.jsx(ks,{}),e.jsxs(Ss,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:O}),Le()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx($s,{href:Ma("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(hn,{children:n.map(M=>{const r=M.quantity??1;return e.jsxs(Ms,{children:[e.jsx(Ts,{children:M.item.thumbnail?e.jsx("img",{src:M.item.thumbnail,alt:""}):null}),e.jsxs(Is,{children:[e.jsxs("div",{children:[e.jsxs(As,{title:M.item.name,children:[M.item.name||a("buyModal.itemFallback"),r>1?e.jsx(pn,{children:a("cartCheckout.qty",{count:r})}):null]}),M.item.creator?e.jsx(Es,{address:M.item.creator}):null]}),e.jsxs(Ps,{children:[e.jsx(zs,{}),e.jsx("span",{children:pe(M.priceCredits*r)})]})]})]},M.item.id)})}),Le()?null:e.jsx(e.Fragment,{children:e.jsx(Rs,{packs:k,selectedId:S||void 0,onSelect:R})}),e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:G,children:a("buyModal.cancel")}),Le()?null:e.jsx(he,{"data-variant":"gradient",onClick:U,children:a("buyModal.buy")})]})]})}const{colors:l,gradients:yn,radius:oe}=z,ea="@media (max-width: 1080px)",E="@media (max-width: 880px)",Gt=i.div`
|
|
174
174
|
max-width: 1510px;
|
|
175
175
|
margin: 0 auto;
|
|
176
176
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -744,5 +744,5 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-57wE9FMW.js";import{s
|
|
|
744
744
|
& section {
|
|
745
745
|
margin-top: 0;
|
|
746
746
|
}
|
|
747
|
-
`;function Ve(n){if(tn(n))return a("errors.rejected");const d=(n.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 oi=12e4;function ci(n){const d=[];return n.unavailable.length&&d.push(a("cart.drop.unavailable",{count:n.unavailable.length})),n.own.length&&d.push(a("cart.drop.own",{count:n.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=n=>n.reduce((d,k)=>d+k.priceCredits*k.quantity,0),$e=n=>n.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Yt=8;function Si(){var St,$t,Mt;Ia({title:a("nav.cart"),noindex:!0});const n=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),S=H(t=>t.decrement),R=H(t=>t.clear),U=H(t=>t.restore),G=H(t=>t.setFittingOpen),O=Tt(t=>t.items),M=Tt(t=>t.toggle),{session:r,signIn:Ze}=Aa(),na=Ea(),ge=Ds().packs.slice(0,Vs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ia=n.some(t=>t.category!=="emote"),{data:Ee}=Pa({queryKey:["upsell-listings"],queryFn:()=>Za({first:40}),staleTime:6e4}),{data:j}=za(r),y=Ra(),X=Sa(),{state:B}=$a(),[ra,ce]=T.useState(null),[et,fe]=T.useState(null),[oa,q]=T.useState(!1),[W,D]=T.useState(null),tt=T.useRef(0),[u,$]=T.useState(null),{data:xe}=Ba(r),{data:le}=_a(!0),[Pe,at]=T.useState(""),de=T.useRef(null),st=qa(n),nt=t=>At(st[t.id]),ze=n.filter(nt),it=n.length>0&&ze.length===0,ca=ze.reduce((t,s)=>t+s.priceCredits*s.quantity,0),la=n.reduce((t,s)=>t+s.quantity,0),da=ze.reduce((t,s)=>t+s.quantity,0),rt=W?W.liveTotalCredits:ca,ua=new Set(n.map(t=>t.id)),ot=((Ee==null?void 0:Ee.items)??[]).filter(t=>!ua.has(t.id)).slice(0,12),ct=T.useMemo(()=>n.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[n]),te=Wa(Yt,{exclude:ct}),lt=Fa({enabled:te.enabled,hasSignal:te.hasSignal,isLoading:te.isLoading,isError:te.isError,personalized:(St=te.result)==null?void 0:St.personalized,rowCount:(($t=te.result)==null?void 0:$t.data.length)??0}),ha=new Map(W==null?void 0:W.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=rt*10,pa=le?It(Re,le):0n,Be=Qe({priceCents:Re,priceManaWei:pa,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n}),ga=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),fa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),xa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Oa,ba=t=>Va(t.contractAddress,String(t.itemId));function be(t){t(),D(null),fe(null),ce(null)}function ya(){$(null),q(!1)}function dt(t){const s=Ye(t),o=Math.max(0,s-me),c=ge.find(h=>h.credits>=o)??ge[ge.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:o}),$({phase:"nofunds",lines:t.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),q(!1)}async function _e(t){if(!r||t.length===0)return;const s=$e(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),h=[];let v="authorize";const f=new Set,I=new Set,L=new Set,F=[];let w=!1;$({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=Zs(s,Nt);let K=0;for(const p of P){$({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:x,maxCreditedValue:b}=await Ya(r.identity,p.units.map(en));p.units.forEach((Q,ne)=>{h.push({salt:x.id,itemId:Q.item.id}),m.push({...p.drafts[ne],credits:[x],maxCreditedValue:b})}),K+=p.units.length}catch(x){if(an(x)){if(h.length){try{await Ne(r.identity,[...new Set(h.map(b=>b.salt))])}catch(b){ie(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw x}}h.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Qs(m).length,ee=p=>N>1?{current:p,total:N}:void 0,_=(p,x)=>$({phase:"processing",stage:p,step:s.length,total:s.length,signatures:ee(x)}),C=p=>p<N?_("awaiting-signature",p+1):_("settling",N);_("awaiting-signature",1);let g=[];const A=new Map,ae=async p=>{const x=await Promise.allSettled(p.map(b=>Us(b)));return x.forEach((b,Q)=>{const ne=A.get(p[Q])??[];b.status==="fulfilled"?(ne.forEach(We=>I.add(We)),F.push(p[Q])):b.reason instanceof Ge||ne.forEach(We=>L.add(We))}),x.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(qs())try{let p=0;g=await Gs({purchases:m,buyer:r.address,signer:r.signer,identity:r.identity,onSigned:()=>_("settling",Math.min(p+1,N)),onBroadcast:({txHash:b,salts:Q})=>{p+=1,A.set(b,Q),Q.forEach(ne=>f.add(ne))},onGroupSettling:({settled:b})=>_("settling",b)});const x=await ae(g);if(x.length&&!x.some(b=>b instanceof Ge))throw x[0];w=!0}catch(p){if(p instanceof Ge)throw await ae([...A.keys()]),p;if(!(p instanceof Os)||!Xa(r.providerType))throw p;g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:x})=>x.forEach(b=>f.add(b)),onSettled:({txHash:x,salts:b})=>{b.forEach(Q=>I.add(Q)),F.push(x)},onReverted:({salts:x})=>x.forEach(b=>L.add(b))})}else g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(x=>f.add(x)),onSettled:({txHash:p,salts:x})=>{x.forEach(b=>I.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(x=>L.add(x))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"credits",no_crypto_step:w,transaction_hash:g[0]??null}),_t(o.map(p=>p.coupon)),qt(y);const ve=de.current;de.current=null,$(null),q(!1);const se={items:c,txHash:g[0]??void 0,txHashes:g,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:se,replace:!0})}catch(m){Ce(m)||ie(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...f].filter(g=>!L.has(g))),{toRelease:K,boughtItemIds:N}=Qt({reservations:h,spent:P,settled:I}),ee=[...P].some(g=>!I.has(g)),_=o.filter(g=>N.includes(g.id)),C=o.filter(g=>!N.includes(g.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((g,A)=>g+A.priceCredits,0)),cart_size:s.length,partial:_.length>0}),K.length)try{await Ne(r.identity,K)}catch(g){ie(g,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),_.length>0){N.forEach(g=>d(g)),D(null),_t(_.map(g=>g.coupon)),qt(y),V("Shop Completed Purchase",{...we(_),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),$({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:ee}),q(!1);return}$({phase:"error",message:ee?void 0:Ve(m),heldCredits:ee})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=de.current;de.current=null,$(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){Ce(t)||ie(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),$({phase:"error",message:Ve(t)}),q(!1)}async function va(t,s,o){const c=zt(Rt.MANAToken,s),h=zt(Rt.CreditsManager,s);await Ks({auth:{kind:Ns.Allowance,contractAddress:c.address,spenderAddress:h.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(le)return le;try{return await y.fetchQuery(Da())}catch{return}}async function wa(t){const s=$e(t).reduce((v,f)=>v+f.usdCents,0),c=(xe??0n)>0n?await pt():le,h=c?It(s,c):0n;return{totalCents:s,manaWei:h}}async function gt(t,s){const o=Ye(t),{totalCents:c,manaWei:h}=await wa(t),v=Qe({priceCents:c,priceManaWei:h,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n});if(s&&v.options.some(f=>f.method===s)){if(s==="credits"){_e(t);return}const f=bt(v,s);await xt(ft(s,t),f,()=>s==="mana"?void yt(t,f):void vt(t,c,h));return}if(v.options.some(f=>f.method==="mana"||f.method==="combined")){$({phase:"choose",lines:t,totalCents:c,manaWei:h}),q(!1);return}if(j!=null&&j.credits<o){dt(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n})}const[ue,ye]=T.useState(null);function ft(t,s){const o=new Map;for(const c of s){const h=is(t,Oe(c));o.set(`${h.chainId}:${h.spender.toLowerCase()}`,h)}return[...o.values()]}async function xt(t,s,o){const c=[];for(const{spender:h,chainId:v}of t){const f=Ws(v,h),I=r?await Fs(f,r.address,s).catch(()=>!0):!0;Ls(r==null?void 0:r.providerType,I)&&c.push(f)}if(c.length===0){o();return}q(!1),mt(c,0,o)}function mt(t,s,o){ye({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function Ca(t){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=u;if(t==="credits"){_e(s);return}const h=bt(qe(u),t);xt(ft(t,s),h,()=>t==="mana"?void yt(s,h):void vt(s,o,c))}async function yt(t,s){if(!r||t.length===0)return;const o=$e(t),c=o.map(f=>({...f.item,priceCredits:f.priceCredits})),h=t.map(f=>({...f.item,priceCredits:f.priceCredits,quantity:f.quantity})),v=()=>$({phase:"processing",stage:"settling",step:o.length,total:o.length});$({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const f=await rs({trades:fa(o),coupons:xa(o),mints:ga(o),buyer:r.address,signer:r.signer,onSigned:v,manaWei:s});t.forEach(I=>d(I.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:f[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(h,f)}catch(f){ht(f,"buy_cart_mana")}}async function vt(t,s,o){if(!r||t.length===0)return;const c=$e(t),h=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),f=Bs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),I=[],L=new Set,F=new Set;$({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const g=c[C],A=w[C],ae=f[C],ve=_s(Math.max(0,g.usdCents-ae),s,o);let se;if(ae<=0)se=Wt(A,[],"0");else{$({phase:"processing",stage:"reserving",step:C+1,total:c.length});const x=g.item,{credit:b,maxCreditedValue:Q}=await Ja(r.identity,ae,A.kind==="trade"?A.trade.id:void 0,x.contractAddress&&x.itemId!=null?{contractAddress:x.contractAddress,itemId:String(x.itemId)}:void 0);I.push({salt:b.id,itemId:x.id}),se=Wt(A,[b],Q)}const p=Nt(se);P.set(p,(P.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(se)}I.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,g]of P){const A=K.get(C);A==null||g<=0n||(m[A]={...m[A],maxCreditedValue:(BigInt(m[A].maxCreditedValue)+g).toString()})}const N=[...P.values()].reduce((C,g)=>C+g,0n);await va(r.signer,os(w[0]),N);const ee=()=>$({phase:"processing",stage:"settling",step:c.length,total:c.length});$({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const _=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:ee,onBroadcast:({salts:C})=>C.forEach(g=>L.add(g)),onReverted:({salts:C})=>C.forEach(g=>F.add(g))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(h),payment_type:"credits_and_mana",transaction_hash:_[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,_)}catch(w){const{toRelease:m}=Qt({reservations:I,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(r.identity,m).catch(()=>{}),I.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function J(t){if(!r){Bt({type:"cart-checkout"}),Ze();return}const s=H.getState().items.filter(nt);if(s.length===0)return;ce(null),fe(null),q(!0);const o=s.reduce((c,h)=>c+h.priceCredits*h.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:me>=o});try{const c=await Xs(s,r.address,ma,await pt(),ba,Ha),h=[...c.unavailable,...c.own];if(h.length&&(h.forEach(v=>d(v.id)),fe(ci(c))),c.buyable.length===0){ce(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){ie(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ce(Ve(c))}finally{q(!1)}}async function wt(){if(W){if(!r){Bt({type:"cart-checkout"}),Ze();return}if(Date.now()-tt.current>oi){D(null),fe(null),await J();return}ce(null),gt(W.buyable)}}async function ja(){if(Pe){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Js(Pe,r?{address:r.address,identity:r.identity}:void 0);if(t.url){window.location.href=t.url;return}if(!t.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");X(`/credits?order=${encodeURIComponent(t.orderId)}`)}catch(t){try{sessionStorage.removeItem(je)}catch{}ie(t,{flow:"cart_buy_credits"}),$({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const Ct=T.useRef(!1);T.useEffect(()=>{if(!r||Ct.current||!as("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[r]);const jt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,de.current=B.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{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const Z=oa||(u==null?void 0:u.phase)==="processing";if(n.length===0&&!u)return e.jsx(Gt,{children:e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(kn,{children:e.jsx(La,{variant:"light",testId:"cart-empty",icon:Ka,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})});const ka=Ys(ge,(u==null?void 0:u.phase)==="nofunds"?u.shortfall:0).packs;return e.jsxs(Gt,{children:[e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vn,{children:[e.jsxs(wn,{children:[e.jsxs(Cn,{children:[e.jsx(Sn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx($n,{children:a("cart.panelTitle",{count:la})}),ia?e.jsxs(Mn,{onClick:()=>G(!0),disabled:Z,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(jn,{children:[e.jsx(Tn,{children:n.map(t=>{const s=ha.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,h=!t.tokenId,v=t.quantity,f=typeof t.available=="number"&&v>=t.available,I=o*v,L=Na(t),F=!!L&&!!O[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(In,{"data-unavailable":P||void 0,children:[e.jsxs(An,{"data-thumb":!0,children:[w?e.jsx(En,{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(Pn,{"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(zn,{children:[e.jsxs(Rn,{"data-desc":!0,children:[w?e.jsx(_n,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Bn,{title:t.name,children:t.name}),t.creator?e.jsx(qn,{address:t.creator,linkToProfile:!0}):null,na&&h?e.jsxs(Hn,{"data-testid":"cart-creator-tag",children:[e.jsx(Dn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Wn,{children:P?e.jsxs(Gn,{children:[e.jsx(On,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(Fn,{children:[e.jsx(Dt,{onClick:()=>be(()=>S(t.id)),disabled:Z||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(Ln,{children:v}),e.jsx(Dt,{onClick:()=>be(()=>k(t.id)),disabled:Z||f,"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(Kn,{children:[e.jsx(Nn,{})," ",e.jsx(Ke,{credits:I}),c?e.jsx(Qn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Un,{children:[L?e.jsx(Vn,{"data-on":F||void 0,onClick:()=>M(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(Yn,{onClick:()=>be(()=>d(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Xn,{children:e.jsx("button",{className:"link",onClick:()=>be(R),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Jn,{children:[e.jsx(Zn,{children:a("cart.purchaseSummary")}),e.jsxs(ei,{children:[e.jsxs(ti,{children:[e.jsx(ai,{children:a("cart.totalItems",{count:da})}),e.jsx(ni,{children:e.jsxs(si,{children:[e.jsx(ii,{})," ",e.jsx(Ke,{credits:rt})]})})]}),e.jsx(Zt,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:W?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||it,onPay:t=>void(W?wt():J(t)),creditsFallback:{label:Z?a("cart.working"):W?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(W?wt():J())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,r?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),W?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(ri,{message:ra})]})]})]})]}),lt===null&&e.jsx(Vt,{"data-testid":"cart-personal-upsell",children:e.jsx(Ua,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Yt})}),lt!==null&&ot.length>0?e.jsx(Vt,{children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ot})}):null,ue&&r?e.jsx(ns,{auth:ue.auth,signer:r.signer,step:{index:ue.index,total:ue.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}=ue;ye(null),t()},onCancel:()=>ye(null),onClose:()=>ye(null)}):null,u?e.jsx(xn,{phase:u.phase,balanceCredits:me,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ya,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ga(r==null?void 0:r.providerType),signatures:u.phase==="processing"?u.signatures:void 0,options:u.phase==="choose"?qe(u).options:void 0,shortfall:u.phase==="choose"?qe(u).manaShortfall:void 0,onPay:Ca,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?Ye(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:ka,selectedPack:Pe,onSelectPack:at,onBuyPacks:()=>void ja(),message:u.phase==="error"?u.message:void 0,heldCredits:u.phase==="error"&&!!u.heldCredits,onRetry:()=>void J()}):null]})}export{Si as Cart};
|
|
748
|
-
//# sourceMappingURL=Cart-
|
|
747
|
+
`;function Ve(n){if(tn(n))return a("errors.rejected");const d=(n.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 oi=12e4;function ci(n){const d=[];return n.unavailable.length&&d.push(a("cart.drop.unavailable",{count:n.unavailable.length})),n.own.length&&d.push(a("cart.drop.own",{count:n.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=n=>n.reduce((d,k)=>d+k.priceCredits*k.quantity,0),$e=n=>n.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Yt=8;function Si(){var St,$t,Mt;Ia({title:a("nav.cart"),noindex:!0});const n=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),S=H(t=>t.decrement),R=H(t=>t.clear),U=H(t=>t.restore),G=H(t=>t.setFittingOpen),O=Tt(t=>t.items),M=Tt(t=>t.toggle),{session:r,signIn:Ze}=Aa(),na=Ea(),ge=Ds().packs.slice(0,Vs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ia=n.some(t=>t.category!=="emote"),{data:Ee}=Pa({queryKey:["upsell-listings"],queryFn:()=>Za({first:40}),staleTime:6e4}),{data:j}=za(r),y=Ra(),X=Sa(),{state:B}=$a(),[ra,ce]=T.useState(null),[et,xe]=T.useState(null),[oa,q]=T.useState(!1),[W,D]=T.useState(null),tt=T.useRef(0),[u,$]=T.useState(null),{data:fe}=Ba(r),{data:le}=_a(!0),[Pe,at]=T.useState(""),de=T.useRef(null),st=qa(n),nt=t=>At(st[t.id]),ze=n.filter(nt),it=n.length>0&&ze.length===0,ca=ze.reduce((t,s)=>t+s.priceCredits*s.quantity,0),la=n.reduce((t,s)=>t+s.quantity,0),da=ze.reduce((t,s)=>t+s.quantity,0),rt=W?W.liveTotalCredits:ca,ua=new Set(n.map(t=>t.id)),ot=((Ee==null?void 0:Ee.items)??[]).filter(t=>!ua.has(t.id)).slice(0,12),ct=T.useMemo(()=>n.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[n]),te=Wa(Yt,{exclude:ct}),lt=Fa({enabled:te.enabled,hasSignal:te.hasSignal,isLoading:te.isLoading,isError:te.isError,personalized:(St=te.result)==null?void 0:St.personalized,rowCount:(($t=te.result)==null?void 0:$t.data.length)??0}),ha=new Map(W==null?void 0:W.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=rt*10,pa=le?It(Re,le):0n,Be=Qe({priceCents:Re,priceManaWei:pa,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n}),ga=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),xa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),fa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Oa,ba=t=>Va(t.contractAddress,String(t.itemId));function be(t){t(),D(null),xe(null),ce(null)}function ya(){$(null),q(!1)}function dt(t){const s=Ye(t),o=Math.max(0,s-me),c=ge.find(h=>h.credits>=o)??ge[ge.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:o}),$({phase:"nofunds",lines:t.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),q(!1)}async function _e(t){if(!r||t.length===0)return;const s=$e(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),h=[];let v="authorize";const x=new Set,I=new Set,L=new Set,F=[];let w=!1;$({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=Zs(s,Nt);let K=0;for(const p of P){$({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:f,maxCreditedValue:b}=await Ya(r.identity,p.units.map(en));p.units.forEach((Q,ne)=>{h.push({salt:f.id,itemId:Q.item.id}),m.push({...p.drafts[ne],credits:[f],maxCreditedValue:b})}),K+=p.units.length}catch(f){if(an(f)){if(h.length){try{await Ne(r.identity,[...new Set(h.map(b=>b.salt))])}catch(b){ie(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw f}}h.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Qs(m).length,ee=p=>N>1?{current:p,total:N}:void 0,_=(p,f)=>$({phase:"processing",stage:p,step:s.length,total:s.length,signatures:ee(f)}),C=p=>p<N?_("awaiting-signature",p+1):_("settling",N);_("awaiting-signature",1);let g=[];const A=new Map,ae=async p=>{const f=await Promise.allSettled(p.map(b=>Us(b)));return f.forEach((b,Q)=>{const ne=A.get(p[Q])??[];b.status==="fulfilled"?(ne.forEach(We=>I.add(We)),F.push(p[Q])):b.reason instanceof Ge||ne.forEach(We=>L.add(We))}),f.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(qs())try{let p=0;g=await Gs({purchases:m,buyer:r.address,signer:r.signer,identity:r.identity,onSigned:()=>_("settling",Math.min(p+1,N)),onBroadcast:({txHash:b,salts:Q})=>{p+=1,A.set(b,Q),Q.forEach(ne=>x.add(ne))},onGroupSettling:({settled:b})=>_("settling",b)});const f=await ae(g);if(f.length&&!f.some(b=>b instanceof Ge))throw f[0];w=!0}catch(p){if(p instanceof Ge)throw await ae([...A.keys()]),p;if(!(p instanceof Os)||!Xa(r.providerType))throw p;g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:f})=>f.forEach(b=>x.add(b)),onSettled:({txHash:f,salts:b})=>{b.forEach(Q=>I.add(Q)),F.push(f)},onReverted:({salts:f})=>f.forEach(b=>L.add(b))})}else g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(f=>x.add(f)),onSettled:({txHash:p,salts:f})=>{f.forEach(b=>I.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(f=>L.add(f))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"credits",no_crypto_step:w,transaction_hash:g[0]??null}),_t(o.map(p=>p.coupon)),qt(y);const ve=de.current;de.current=null,$(null),q(!1);const se={items:c,txHash:g[0]??void 0,txHashes:g,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:se,replace:!0})}catch(m){Ce(m)||ie(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...x].filter(g=>!L.has(g))),{toRelease:K,boughtItemIds:N}=Qt({reservations:h,spent:P,settled:I}),ee=[...P].some(g=>!I.has(g)),_=o.filter(g=>N.includes(g.id)),C=o.filter(g=>!N.includes(g.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((g,A)=>g+A.priceCredits,0)),cart_size:s.length,partial:_.length>0}),K.length)try{await Ne(r.identity,K)}catch(g){ie(g,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),_.length>0){N.forEach(g=>d(g)),D(null),_t(_.map(g=>g.coupon)),qt(y),V("Shop Completed Purchase",{...we(_),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),$({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:ee}),q(!1);return}$({phase:"error",message:ee?void 0:Ve(m),heldCredits:ee})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=de.current;de.current=null,$(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){Ce(t)||ie(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),$({phase:"error",message:Ve(t)}),q(!1)}async function va(t,s,o){const c=zt(Rt.MANAToken,s),h=zt(Rt.CreditsManager,s);await Ks({auth:{kind:Ns.Allowance,contractAddress:c.address,spenderAddress:h.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(le)return le;try{return await y.fetchQuery(Da())}catch{return}}async function wa(t){const s=$e(t).reduce((v,x)=>v+x.usdCents,0),c=(fe??0n)>0n?await pt():le,h=c?It(s,c):0n;return{totalCents:s,manaWei:h}}async function gt(t,s){const o=Ye(t),{totalCents:c,manaWei:h}=await wa(t),v=Qe({priceCents:c,priceManaWei:h,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n});if(s&&v.options.some(x=>x.method===s)){if(s==="credits"){_e(t);return}const x=bt(v,s);await ft(xt(s,t),x,()=>s==="mana"?void yt(t,x):void vt(t,c,h));return}if(v.options.some(x=>x.method==="mana"||x.method==="combined")){$({phase:"choose",lines:t,totalCents:c,manaWei:h}),q(!1);return}if(j!=null&&j.credits<o){dt(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n})}const[ue,ye]=T.useState(null);function xt(t,s){const o=new Map;for(const c of s){const h=is(t,Oe(c));o.set(`${h.chainId}:${h.spender.toLowerCase()}`,h)}return[...o.values()]}async function ft(t,s,o){const c=[];for(const{spender:h,chainId:v}of t){const x=Ws(v,h),I=r?await Fs(x,r.address,s).catch(()=>!0):!0;Ls(r==null?void 0:r.providerType,I)&&c.push(x)}if(c.length===0){o();return}q(!1),mt(c,0,o)}function mt(t,s,o){ye({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function Ca(t){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=u;if(t==="credits"){_e(s);return}const h=bt(qe(u),t);ft(xt(t,s),h,()=>t==="mana"?void yt(s,h):void vt(s,o,c))}async function yt(t,s){if(!r||t.length===0)return;const o=$e(t),c=o.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),v=()=>$({phase:"processing",stage:"settling",step:o.length,total:o.length});$({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const x=await rs({trades:xa(o),coupons:fa(o),mints:ga(o),buyer:r.address,signer:r.signer,onSigned:v,manaWei:s});t.forEach(I=>d(I.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(h,x)}catch(x){ht(x,"buy_cart_mana")}}async function vt(t,s,o){if(!r||t.length===0)return;const c=$e(t),h=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),x=Bs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),I=[],L=new Set,F=new Set;$({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const g=c[C],A=w[C],ae=x[C],ve=_s(Math.max(0,g.usdCents-ae),s,o);let se;if(ae<=0)se=Wt(A,[],"0");else{$({phase:"processing",stage:"reserving",step:C+1,total:c.length});const f=g.item,{credit:b,maxCreditedValue:Q}=await Ja(r.identity,ae,A.kind==="trade"?A.trade.id:void 0,f.contractAddress&&f.itemId!=null?{contractAddress:f.contractAddress,itemId:String(f.itemId)}:void 0);I.push({salt:b.id,itemId:f.id}),se=Wt(A,[b],Q)}const p=Nt(se);P.set(p,(P.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(se)}I.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,g]of P){const A=K.get(C);A==null||g<=0n||(m[A]={...m[A],maxCreditedValue:(BigInt(m[A].maxCreditedValue)+g).toString()})}const N=[...P.values()].reduce((C,g)=>C+g,0n);await va(r.signer,os(w[0]),N);const ee=()=>$({phase:"processing",stage:"settling",step:c.length,total:c.length});$({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const _=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:ee,onBroadcast:({salts:C})=>C.forEach(g=>L.add(g)),onReverted:({salts:C})=>C.forEach(g=>F.add(g))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(h),payment_type:"credits_and_mana",transaction_hash:_[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,_)}catch(w){const{toRelease:m}=Qt({reservations:I,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(r.identity,m).catch(()=>{}),I.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function J(t){if(!r){Bt({type:"cart-checkout"}),Ze();return}const s=H.getState().items.filter(nt);if(s.length===0)return;ce(null),xe(null),q(!0);const o=s.reduce((c,h)=>c+h.priceCredits*h.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:me>=o});try{const c=await Xs(s,r.address,ma,await pt(),ba,Ha),h=[...c.unavailable,...c.own];if(h.length&&(h.forEach(v=>d(v.id)),xe(ci(c))),c.buyable.length===0){ce(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){ie(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ce(Ve(c))}finally{q(!1)}}async function wt(){if(W){if(!r){Bt({type:"cart-checkout"}),Ze();return}if(Date.now()-tt.current>oi){D(null),xe(null),await J();return}ce(null),gt(W.buyable)}}async function ja(){if(Pe){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Js(Pe,r?{address:r.address,identity:r.identity}:void 0);if(t.url){window.location.href=t.url;return}if(!t.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");X(`/credits?order=${encodeURIComponent(t.orderId)}`)}catch(t){try{sessionStorage.removeItem(je)}catch{}ie(t,{flow:"cart_buy_credits"}),$({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const Ct=T.useRef(!1);T.useEffect(()=>{if(!r||Ct.current||!as("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[r]);const jt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,de.current=B.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{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const Z=oa||(u==null?void 0:u.phase)==="processing";if(n.length===0&&!u)return e.jsx(Gt,{children:e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(kn,{children:e.jsx(La,{variant:"light",testId:"cart-empty",icon:Ka,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})});const ka=Ys(ge,(u==null?void 0:u.phase)==="nofunds"?u.shortfall:0).packs;return e.jsxs(Gt,{children:[e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vn,{children:[e.jsxs(wn,{children:[e.jsxs(Cn,{children:[e.jsx(Sn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx($n,{children:a("cart.panelTitle",{count:la})}),ia?e.jsxs(Mn,{onClick:()=>G(!0),disabled:Z,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(jn,{children:[e.jsx(Tn,{children:n.map(t=>{const s=ha.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,h=!t.tokenId,v=t.quantity,x=typeof t.available=="number"&&v>=t.available,I=o*v,L=Na(t),F=!!L&&!!O[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(In,{"data-unavailable":P||void 0,children:[e.jsxs(An,{"data-thumb":!0,children:[w?e.jsx(En,{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(Pn,{"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(zn,{children:[e.jsxs(Rn,{"data-desc":!0,children:[w?e.jsx(_n,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Bn,{title:t.name,children:t.name}),t.creator?e.jsx(qn,{address:t.creator,linkToProfile:!0}):null,na&&h?e.jsxs(Hn,{"data-testid":"cart-creator-tag",children:[e.jsx(Dn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Wn,{children:P?e.jsxs(Gn,{children:[e.jsx(On,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(Fn,{children:[e.jsx(Dt,{onClick:()=>be(()=>S(t.id)),disabled:Z||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(Ln,{children:v}),e.jsx(Dt,{onClick:()=>be(()=>k(t.id)),disabled:Z||x,"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(Kn,{children:[e.jsx(Nn,{})," ",e.jsx(Ke,{credits:I}),c?e.jsx(Qn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Un,{children:[L?e.jsx(Vn,{"data-on":F||void 0,onClick:()=>M(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(Yn,{onClick:()=>be(()=>d(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Xn,{children:e.jsx("button",{className:"link",onClick:()=>be(R),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Jn,{children:[e.jsx(Zn,{children:a("cart.purchaseSummary")}),e.jsxs(ei,{children:[e.jsxs(ti,{children:[e.jsx(ai,{children:a("cart.totalItems",{count:da})}),e.jsx(ni,{children:e.jsxs(si,{children:[e.jsx(ii,{})," ",e.jsx(Ke,{credits:rt})]})})]}),e.jsx(Zt,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:W?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||it,onPay:t=>void(W?wt():J(t)),creditsFallback:{label:Z?a("cart.working"):W?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(W?wt():J())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,r?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),W?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(ri,{message:ra})]})]})]})]}),lt===null&&e.jsx(Vt,{"data-testid":"cart-personal-upsell",children:e.jsx(Ua,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Yt})}),lt!==null&&ot.length>0?e.jsx(Vt,{children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ot})}):null,ue&&r?e.jsx(ns,{auth:ue.auth,signer:r.signer,step:{index:ue.index,total:ue.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}=ue;ye(null),t()},onCancel:()=>ye(null),onClose:()=>ye(null)}):null,u?e.jsx(fn,{phase:u.phase,balanceCredits:me,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ya,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ga(r==null?void 0:r.providerType),signatures:u.phase==="processing"?u.signatures:void 0,options:u.phase==="choose"?qe(u).options:void 0,shortfall:u.phase==="choose"?qe(u).manaShortfall:void 0,onPay:Ca,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?Ye(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:ka,selectedPack:Pe,onSelectPack:at,onBuyPacks:()=>void ja(),message:u.phase==="error"?u.message:void 0,heldCredits:u.phase==="error"&&!!u.heldCredits,onRetry:()=>void J()}):null]})}export{Si as Cart};
|
|
748
|
+
//# sourceMappingURL=Cart-CXTYKHB4.js.map
|