@dcl/shop 0.1.0-30362815497.commit-35ecdbf → 0.1.0-30381444187.commit-e5b9f13
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-DYOikZol.js → Activity-B63zG8uY.js} +1 -1
- package/assets/{AnimatedBackground-HX4woz1t.js → AnimatedBackground-CWPdO0WE.js} +1 -1
- package/assets/{Assets-trIla3fm.js → Assets-WnaUem5h.js} +4 -4
- package/assets/{Assets.styles-BN81sFiL.js → Assets.styles-Dmhspue_.js} +1 -1
- package/assets/{Authorizations-9b3idzYV.js → Authorizations-CAStHHID.js} +1 -1
- package/assets/{Button-BeodHck0.js → Button-BDUHWtxg.js} +2 -2
- package/assets/{Cart-DgJ2dSls.js → Cart-D-YOXeH9.js} +1 -1
- package/assets/{CircularProgress-DBX8-bxs.js → CircularProgress-CpOs7g9a.js} +1 -1
- package/assets/{Collection-BoptXS-5.js → Collection-9Fu4_XnC.js} +1 -1
- package/assets/{CollectionCarousel-Dsbypx_Q.js → CollectionCarousel-CzvvuUUw.js} +3 -3
- package/assets/{ConstantsUtil-CqaPdSAF.js → ConstantsUtil-DTrOBzCe.js} +1 -1
- package/assets/{ContentClient-0BEnf6CP.js → ContentClient-jyMKirlf.js} +1 -1
- package/assets/{Creator-Bt88BMiE.js → Creator-3NXIbePD.js} +1 -1
- package/assets/{DeploymentBuilder-Df9ZJakk.js → DeploymentBuilder-j08uBP-r.js} +1 -1
- package/assets/{ErrorNotice-D_Z5OVFI.js → ErrorNotice-BG40E5Ff.js} +1 -1
- package/assets/{ExchangeController-Bh5MbgEF.js → ExchangeController-CL_gVqSw.js} +1 -1
- package/assets/{GetCredits-CbPLtnWt.js → GetCredits-DSK7zyc2.js} +1 -1
- package/assets/{HelpersUtil-Bj2jMRhF.js → HelpersUtil-BfapKZKr.js} +1 -1
- package/assets/ImportListings-DZs_dFSO.js +5 -0
- package/assets/{ItemDetail-BrPctSLd.js → ItemDetail-D49gDAwf.js} +25 -25
- package/assets/{LoadMore-Cp-E67xI.js → LoadMore-DTUpuDyu.js} +1 -1
- package/assets/MarketCheckout-CoUO17KO.js +3 -0
- package/assets/{MenuList-CGv6Hx3E.js → MenuList-DQbLlN7L.js} +1 -1
- package/assets/{MyAssets-CCRHQYFa.js → MyAssets-DJ0hwGXR.js} +16 -16
- package/assets/{MyFavorites-CdD42WhZ.js → MyFavorites-D3n_-d0Z.js} +1 -1
- package/assets/{NetworkUtil-DQZGJzap.js → NetworkUtil-C1aEwuOK.js} +1 -1
- package/assets/{NotFound-C-faFC1M.js → NotFound-MMFCqdKn.js} +1 -1
- package/assets/{NotificationsBell-BoZQHliJ.js → NotificationsBell-CNLR9ard.js} +1 -1
- package/assets/{StoreSettings-LxpZbXrk.js → StoreSettings-CdSK69sU.js} +1 -1
- package/assets/{Success-DuDT9YWk.js → Success-KKN_AjMe.js} +2 -2
- package/assets/{SwapController-DCarrY7n.js → SwapController-BNkoWTIp.js} +1 -1
- package/assets/{Tooltip-QUx-0PAd.js → Tooltip-CBuz_rc2.js} +5 -5
- package/assets/{TradeService-WOpUOCj5.js → TradeService-Dm_ASWCN.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-DvD-aezH.js → W3MFrameProviderSingleton-CeSRgOaN.js} +3 -3
- package/assets/{WebCryptoP256-KHg0PT8E.js → WebCryptoP256-GalvwmvU.js} +1 -1
- package/assets/{authorizations-CUAi4uqJ.js → authorizations-Ds7LRLV0.js} +1 -1
- package/assets/{basic-Bf_YtlYZ.js → basic-D_j1sfcj.js} +1 -1
- package/assets/{biconomy-ClJBQv0E.js → biconomy-YD94PgiS.js} +1 -1
- package/assets/{browser-BgOlLsTO.js → browser-CTzRZpIE.js} +1 -1
- package/assets/browser-ponyfill-6L1OGOLN.js +1 -0
- package/assets/{browser-ponyfill-CMZ3i8tY.js → browser-ponyfill-CI1-rMvf.js} +1 -1
- package/assets/{builder-BFcfggvn.js → builder-Cc8g4-4q.js} +1 -1
- package/assets/{buy-Tme1UHVf.js → buy-DnSS_Kop.js} +1 -1
- package/assets/buy-gasless-9Zn1yAMk.js +1 -0
- package/assets/{cart-checkout-D8_UxnB9.js → cart-checkout-BAugwPm6.js} +1 -1
- package/assets/{categories-CV5P_HZd.js → categories-BI9AXlDF.js} +1 -1
- package/assets/{ccip-BQ1iXCKX.js → ccip-CiESIEiQ.js} +1 -1
- package/assets/{ccip-Dt6AwyXx.js → ccip-bHN-8eS1.js} +1 -1
- package/assets/{chains-Bk8fyLPj.js → chains-Znt1BTfw.js} +1 -1
- package/assets/collection-DE3QnCpW.js +1 -0
- package/assets/{common-CI-kmbOq.js → common-D9tSChDa.js} +1 -1
- package/assets/{controller-DINKBWbu.js → controller-B2JIau8v.js} +2 -2
- package/assets/{core-BAP8R3XC.js → core-3cHR7yu5.js} +4 -4
- package/assets/{custom--eKw29PB.js → custom-BFV9Niby.js} +1 -1
- package/assets/{data-capture-B1VKtAVM.js → data-capture-DTqon_Ye.js} +1 -1
- package/assets/decimals-Bmvg-V50.js +1 -0
- package/assets/{decimals-CIbX1tiW.js → decimals-C4nLn1ac.js} +1 -1
- package/assets/{detectExtension-DObVoAzH.js → detectExtension-BgMIFAUw.js} +1 -1
- package/assets/{email-BLadXpqP.js → email-CN7CWhKF.js} +1 -1
- package/assets/{embedded-wallet-BcP4ehoH.js → embedded-wallet-Q6nTAiGf.js} +1 -1
- package/assets/{emotion-styled.browser.esm-CWNG-OnU.js → emotion-styled.browser.esm-DU8E1n2c.js} +1 -1
- package/assets/{engine-DNXrnXBq.js → engine-DoRvgWV1.js} +1 -1
- package/assets/{errors-DCLH44Ym.js → errors-CG6pp58g.js} +1 -1
- package/assets/estimate-l1-fee-DIch6QAI.js +1 -0
- package/assets/eth_estimateGas-JYqF9U1i.js +1 -0
- package/assets/{eth_getStorageAt-y8U-lfEv.js → eth_getStorageAt--oQrWy0Q.js} +1 -1
- package/assets/eth_getTransactionCount-BEhAgz2O.js +1 -0
- package/assets/{ethereum-D72JFjbG.js → ethereum-3zUUm4Pr.js} +1 -1
- package/assets/{ethers-BteKixT0.js → ethers-CtVvB8eG.js} +1 -1
- package/assets/{execute-DZFWrHQq.js → execute-UcJesME5.js} +2 -2
- package/assets/{extractIPFS-BVwwoxM1.js → extractIPFS-BmriCqG8.js} +1 -1
- package/assets/{features-CU8DRP_5.js → features-B53I2xTg.js} +1 -1
- package/assets/{fetchTokenMetadata-qukyHCda.js → fetchTokenMetadata-CqYkUkwH.js} +2 -2
- package/assets/{fortmatic-uodRBNqF.js → fortmatic-DM_o40Lo.js} +1 -1
- package/assets/{get-bytecode-PhqNpgKV.js → get-bytecode-C6TlbHJu.js} +1 -1
- package/assets/get-ecosystem-wallet-info-HoRTPbSm.js +1 -0
- package/assets/{getBalance-BYFNEbEM.js → getBalance-BMDqICQz.js} +2 -2
- package/assets/{getInstalledModules-DS4FSkHX.js → getInstalledModules-BLQxYEXn.js} +1 -1
- package/assets/{getNFT-CozT-FPO.js → getNFT-6TA-E6XX.js} +2 -2
- package/assets/getNFT-WdF3UG1j.js +1 -0
- package/assets/getThemeProps-HByDG2pD.js +1 -0
- package/assets/{hashTypedData-COw4MIw7.js → hashTypedData-BGvyK_O1.js} +1 -1
- package/assets/{hashTypedData-Shyia_b5.js → hashTypedData-ug9gj3v5.js} +1 -1
- package/assets/import-CZZ9-DX_.js +1 -0
- package/assets/{in-app-h5Z8xJLI.js → in-app-BXpVuL_f.js} +1 -1
- package/assets/{in-app-wallet-calls-DndrTTgL.js → in-app-wallet-calls-Cw2KNfOh.js} +1 -1
- package/assets/{index-DLY0JksW.js → index-2RpQo6sW.js} +1 -1
- package/assets/{index-CFFpa2x2.js → index-2jouHGho.js} +1 -1
- package/assets/{index-D6_4iqAn.js → index-8wx1oJ_F.js} +1 -1
- package/assets/{index-CPpRxy1r.js → index-B0SdAX-m.js} +1 -1
- package/assets/{index-5TQ09pWW.js → index-B1saYH84.js} +1 -1
- package/assets/{index-CdccZQ_A.js → index-B2DUxMjO.js} +1 -1
- package/assets/{index-Cr75_Qxi.js → index-B5JNl4HC.js} +1 -1
- package/assets/index-B6MKNzS8.js +1 -0
- package/assets/{index-BrDLym1R.js → index-B7jIFcHs.js} +2 -2
- package/assets/{index-rsuER-il.js → index-BBeW5CPj.js} +1 -1
- package/assets/{index-CJIwpbLW.js → index-BDwWglvl.js} +1 -1
- package/assets/{index-_DXp_lqm.js → index-BEmTYNSG.js} +1 -1
- package/assets/{index-C3SS5bz4.js → index-BG7lZdfP.js} +1 -1
- package/assets/{index-D2m2DNID.js → index-BHPkQDns.js} +1 -1
- package/assets/{index-DLsq0JOY.js → index-BOMAmQU7.js} +1 -1
- package/assets/{index-CkyS_Z8N.js → index-BQe1IsNb.js} +2 -2
- package/assets/{index-Ded3SJr4.js → index-BTV13rXH.js} +1 -1
- package/assets/{index-CMYPEZgT.js → index-BZ6S4-Qy.js} +1 -1
- package/assets/{index-C4-ffFyv.js → index-BeeMSgi1.js} +1 -1
- package/assets/{index-Dj9Oj7O6.js → index-Bq0YYsbG.js} +1 -1
- package/assets/{index-B-IGbYzs.js → index-BqPcUFuz.js} +1 -1
- package/assets/{index-5PxxT_Hi.js → index-BvrGtJes.js} +1 -1
- package/assets/{index-Dj-l-ING.js → index-C0ACz6_-.js} +1 -1
- package/assets/{index-m8asLu1c.js → index-C68XxPCY.js} +1 -1
- package/assets/{index-Cs14qqbg.js → index-C7TVyPoU.js} +1 -1
- package/assets/{index-CpnWgZnn.js → index-CDEPMu43.js} +3 -3
- package/assets/{index-CQzsOUTd.js → index-CEcu6qlS.js} +2 -2
- package/assets/{index-8yB_Vwf0.js → index-CKSJdo5m.js} +1 -1
- package/assets/{index-D7uajZIF.js → index-CSZuXP_O.js} +1 -1
- package/assets/{index-CNI9E71C.js → index-CYMsLttB.js} +1 -1
- package/assets/{index-C97Z675S.js → index-CaR23uYb.js} +1 -1
- package/assets/{index-D-DRci2G.js → index-CeKksx_X.js} +1 -1
- package/assets/{index-TRWztzJI.js → index-CjpRvZkq.js} +1 -1
- package/assets/{index-nJZkl4yb.js → index-CkWJ4sTo.js} +1 -1
- package/assets/{index-DZwpOX3I.js → index-CmgZ4NMC.js} +1 -1
- package/assets/{index-B-7JnJnf.js → index-CmgoqHgW.js} +1 -1
- package/assets/{index-DIlrszNn.js → index-Cy8JAEGy.js} +1 -1
- package/assets/{index-CxnwYMKU.js → index-D0fJ7qrq.js} +1 -1
- package/assets/{index-isk6Q4SE.js → index-D7r-KbUN.js} +1 -1
- package/assets/{index-B20SJjGI.js → index-D95ZUsPD.js} +1 -1
- package/assets/{index-CuziAoAD.js → index-D9gz4wTG.js} +1 -1
- package/assets/{index-RTTHiCT2.js → index-DGIUeX6X.js} +1 -1
- package/assets/{index-DSv4T_PT.js → index-DaGhU6Uz.js} +1 -1
- package/assets/{index-CjxT1gx4.js → index-DiGXPxzb.js} +1 -1
- package/assets/{index-BkDBPQKr.js → index-DpXleRYB.js} +1 -1
- package/assets/{index-DonfdwAp.js → index-DqLpZ4oP.js} +1 -1
- package/assets/{index-zSTykcGn.js → index-Dr9lSl0n.js} +1 -1
- package/assets/{index-PrsXxs3B.js → index-ExvBrBJ4.js} +2 -2
- package/assets/{index-D-sEcKqr.js → index-F-n6GV2b.js} +1 -1
- package/assets/{index-ClGkpWPa.js → index-F_0Er667.js} +2 -2
- package/assets/{index-CFuHjg6U.js → index-Fe4H2sUE.js} +1 -1
- package/assets/{index-CnqcuprG.js → index-FvnJRnD5.js} +3 -3
- package/assets/{index-FJnVr04j.js → index-G_lkaThL.js} +1 -1
- package/assets/{index-BSeusSHl.js → index-TmxHL85j.js} +11 -11
- package/assets/{index-vYDwCibh.js → index-Y77Y_U0L.js} +1 -1
- package/assets/{index-a0GqAWet.js → index-Z5LdHVdI.js} +1 -1
- package/assets/{index-0df2_JuN.js → index-_hV86vSn.js} +1 -1
- package/assets/{index-CF84ORMp.js → index-b39aIkkP.js} +1 -1
- package/assets/{index-DySNHqeZ.js → index-euFuE7ah.js} +1 -1
- package/assets/{index-iGJTuv1I.js → index-gxa5wyAJ.js} +3 -3
- package/assets/{index-9s4_sQX7.js → index-m5R1RgvV.js} +1 -1
- package/assets/{index-DQWUa_ga.js → index-ogLhf7-S.js} +1 -1
- package/assets/{index-CVi7PdPM.js → index-tFmbSlHL.js} +1 -1
- package/assets/{index.es-CsZiAUYy.js → index.es-CmoiU8SE.js} +1 -1
- package/assets/{index.es-CsQSB3db.js → index.es-DD7iT23u.js} +4 -4
- package/assets/{index.es-Do3Y7r2K.js → index.es-DDEozdoq.js} +1 -1
- package/assets/{linkAccount-6BFCh5cx.js → linkAccount-BR5_llhd.js} +1 -1
- package/assets/{localBatchGatewayRequest-CbxoLL2f.js → localBatchGatewayRequest-BGfmM9P7.js} +1 -1
- package/assets/{mana-rate-BJbe6lgb.js → mana-rate-C8zn6Vfu.js} +1 -1
- package/assets/{native-15jVjX8Y.js → native-BSpg_u0K.js} +1 -1
- package/assets/{networks-Dpsd0s9-.js → networks-CBAVrHYh.js} +1 -1
- package/assets/{onramp-DaQ4owbO.js → onramp-dft5bcN9.js} +1 -1
- package/assets/{openzeppelin-6LOIfZsS.js → openzeppelin-WekOcr_Z.js} +1 -1
- package/assets/{ownerOf-CFrKicrH.js → ownerOf-D9UDfElT.js} +1 -1
- package/assets/{parseNft-DM4WbrF2.js → parseNft-DTV6iT7B.js} +2 -2
- package/assets/{parseSignature-DJ5B7dkH.js → parseSignature-C7rL0b_w.js} +3 -3
- package/assets/{parseSignature-CJECbqyJ.js → parseSignature-DmkHq9fC.js} +1 -1
- package/assets/{passkeys-D0bGzkR-.js → passkeys--Px7LRhh.js} +1 -1
- package/assets/{pay-with-exchange-DGD6NZUT.js → pay-with-exchange-CMQeyenn.js} +1 -1
- package/assets/{prepare-contract-call-DUVOtgM0.js → prepare-contract-call-CHrp3EL4.js} +1 -1
- package/assets/{qr-overlay-C57bRh8h.js → qr-overlay-Dz377WEQ.js} +3 -3
- package/assets/{react-B36MyIP_.js → react-BW1xvPTF.js} +1 -1
- package/assets/{receive-Dig0fUc0.js → receive-CpDxltQB.js} +1 -1
- package/assets/{resolveImplementation-D_fazAjd.js → resolveImplementation-CFOrDNcu.js} +1 -1
- package/assets/{rpc-ChD_4MbV.js → rpc-CjfGBkRY.js} +1 -1
- package/assets/{secp256k1-N6PNU3bA.js → secp256k1-C77TwNwR.js} +1 -1
- package/assets/{secp256k1-BClwNS_R.js → secp256k1-DSadr9B6.js} +1 -1
- package/assets/{secp256k1-CJyNFsNt.js → secp256k1-Dgs0hNIB.js} +1 -1
- package/assets/{send-DAWm3Jv2.js → send-BMIoBrdl.js} +1 -1
- package/assets/{send-batch-transaction-Dg_fuCoW.js → send-batch-transaction-CZ5LHGtL.js} +1 -1
- package/assets/{send-eip712-transaction-BfQDidJ0.js → send-eip712-transaction-DmvWUFiv.js} +2 -2
- package/assets/send-gasless-transaction-DxLNFATn.js +2 -0
- package/assets/{send-transaction-CfoJI6V6.js → send-transaction-DVEripxy.js} +2 -2
- package/assets/{sendMetaTransaction-DEU_Xtzf.js → sendMetaTransaction-7YAoB-pL.js} +1 -1
- package/assets/{sendRawTransaction-ZYIm5xd5.js → sendRawTransaction-BXyfyJLD.js} +3 -3
- package/assets/{sentry-gZJVwIqQ.js → sentry-BV_ZSgtd.js} +1 -1
- package/assets/{serializeTransaction-CzSGVGz4.js → serializeTransaction-BkF9WfrN.js} +1 -1
- package/assets/{session-proposal-B0DQCL8Q.js → session-proposal-DoIVwtwv.js} +1 -1
- package/assets/{session-request-D7PK8aVZ.js → session-request-C3QQi3mV.js} +2 -2
- package/assets/{sha256-DDEIajFz.js → sha256-BImz_UXn.js} +1 -1
- package/assets/{signing-B8VyPC00.js → signing-BInyigJZ.js} +3 -3
- package/assets/{socials-KoDapNpC.js → socials-HN5nwNut.js} +1 -1
- package/assets/{swaps-BlxZRFZr.js → swaps-Dbu6ix4y.js} +1 -1
- package/assets/{thirdweb-DJf-EEOv.js → thirdweb-DY9iSWOj.js} +3 -3
- package/assets/{to-serializable-transaction-B1lQjM9d.js → to-serializable-transaction-DFrgce7C.js} +2 -2
- package/assets/{totalSupply-CGOKYv2C.js → totalSupply-D4j1WOYW.js} +1 -1
- package/assets/{trade-encoding-DXoI04Mc.js → trade-encoding-CcRCeIpG.js} +1 -1
- package/assets/{transaction-C_LVUDbA.js → transaction-BOS1fhp8.js} +1 -1
- package/assets/{transactionReceipt-kDTd5JL7.js → transactionReceipt-5vjrQVvz.js} +1 -1
- package/assets/{transactions-CehNE2A8.js → transactions-DLwOfx7v.js} +1 -1
- package/assets/useCreditPacks-Dft_m4Vq.js +1 -0
- package/assets/{useInfiniteGrid-dBP53DpO.js → useInfiniteGrid-pff93KiW.js} +1 -1
- package/assets/useManaRate-C5mRxzeC.js +1 -0
- package/assets/useSecondarySales-BRJGIRwF.js +1 -0
- package/assets/{useStore-Duh496VH.js → useStore-CV_90SkB.js} +2 -2
- package/assets/useTheme-cgcgN0ze.js +1 -0
- package/assets/{utils-swuB5ZX6.js → utils-B7rjkjB1.js} +1 -1
- package/assets/{verifyHash-PdDaV25N.js → verifyHash-BJDJ-yWB.js} +1 -1
- package/assets/{w3m-modal-Bt6VN9EP.js → w3m-modal-C_4vaAKJ.js} +1 -1
- package/assets/{w3m-modal-CywSQTgA.js → w3m-modal-Cs01ZX0b.js} +1 -1
- package/assets/{wait-for-tx-receipt-Cw3p4OOt.js → wait-for-tx-receipt-CYy9IgHg.js} +1 -1
- package/assets/{wallets-BqGvfAVQ.js → wallets-D4ZcCkX2.js} +5 -5
- package/assets/{web-connector-CwUgIh1D.js → web-connector-p1b6xGQr.js} +3 -3
- package/assets/{writeContract-BCO99ptR.js → writeContract-Cl5bVpey.js} +1 -1
- package/assets/{zora-sepolia-BltAzWAs.js → zora-sepolia-CVS3owSi.js} +1 -1
- package/assets/{zoraTestnet-81flFamw.js → zoraTestnet-Dg220Oc3.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/ImportListings-Dza88Ul5.js +0 -5
- package/assets/MarketCheckout-ClTJqeTN.js +0 -3
- package/assets/browser-ponyfill-lfpnveOA.js +0 -1
- package/assets/buy-gasless-BdW9VEKq.js +0 -1
- package/assets/collection-CHWj8iQW.js +0 -1
- package/assets/decimals-CS6j__sw.js +0 -1
- package/assets/estimate-l1-fee-qYVfWmvo.js +0 -1
- package/assets/eth_estimateGas-D2jEM0E-.js +0 -1
- package/assets/eth_getTransactionCount-CME439qZ.js +0 -1
- package/assets/get-ecosystem-wallet-info-CE-anDO0.js +0 -1
- package/assets/getNFT-2J_9TTUS.js +0 -1
- package/assets/getThemeProps-G_RkUSWj.js +0 -1
- package/assets/import-BgvjaGsU.js +0 -1
- package/assets/index-DpPUc0sl.js +0 -1
- package/assets/send-gasless-transaction-ZUIH6xn8.js +0 -2
- package/assets/useCreditPacks-Dg3_30xn.js +0 -1
- package/assets/useManaRate-CY5PbqWB.js +0 -1
- package/assets/useTheme-BRdkaoFm.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b,j as e,L as _,e as dt}from"./react-
|
|
1
|
+
import{r as b,j as e,L as _,e as dt}from"./react-BW1xvPTF.js";import{s as l,K as o,R as lt,B as ht,x as ut,t as d,u as xt,n as j,I as g,aG as B,aH as G,aI as pt,C as v,aJ as mt,an as E,S as Q,A as gt,aK as ft,aL as X}from"./index-TmxHL85j.js";import{a as yt}from"./mana-rate-C8zn6Vfu.js";import{u as bt}from"./useManaRate-C5mRxzeC.js";import{L as jt}from"./LoadMore-DTUpuDyu.js";import{u as f}from"./useInfiniteGrid-pff93KiW.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";const vt=15e3;function kt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=vt}function wt(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&kt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,u)=>c+u.credits,0),lines:a}})}function It(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function At(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?yt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function $t(t){const s=wt(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=At(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),u=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...u].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Pt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const J=t=>t.trim().toLowerCase();function Lt(t){const i=new Map;for(const s of t??[]){const a=J(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Nt(t,i,s=Date.now()){const a=i.txHash?t.get(J(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Et(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const u=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:u}}function Et(t){return Math.floor(t/10)}const Tt="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/credits-product-vs4Q6u6l.svg",T=lt`
|
|
2
2
|
0% { background-position: 200% 0; }
|
|
3
3
|
100% { background-position: -200% 0; }
|
|
4
4
|
`,Ct=l.section`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-
|
|
1
|
+
import{r as l,j as v}from"./react-BW1xvPTF.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/DCL_LogoPattern-BryBPc3d.png",b=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{u as Le,r as f,j as e,b as tt}from"./react-BW1xvPTF.js";import{m as W,h as nt,c as st,v as ot,s,K as t,u as ie,a as rt,b as Be,A as Fe,y as it,t as o,I as T,C as F,d as ye,j as J,k as at,l as lt,x as We,L as ct,M as te,aM as dt,aN as pt}from"./index-TmxHL85j.js";import{u as ft}from"./useSecondarySales-BRJGIRwF.js";import{r as ht,m as xt,a as He}from"./mana-rate-C8zn6Vfu.js";import{u as Ue}from"./useManaRate-C5mRxzeC.js";import{g as ut,h as mt,i as gt,j as bt,k as yt,C as wt,l as jt,o as vt,m as Ct,n as $t,M as kt,E as St,p as Et,q as Tt,r as It,s as _t,t as Rt,u as zt}from"./Assets.styles-Dmhspue_.js";import{d as we,R as At,F as Nt,S as je,b as Mt}from"./categories-BI9AXlDF.js";import{L as Pt}from"./LoadMore-DTUpuDyu.js";import{M as Lt}from"./MarketCheckout-CoUO17KO.js";import{u as Bt}from"./useInfiniteGrid-pff93KiW.js";import{E as Ft}from"./ErrorNotice-BG40E5Ff.js";import{d as Wt}from"./dcl-schemas-BICTSpB5.js";import{u as Ht,G as Ut,w as Ot,S as Dt}from"./buy-gasless-9Zn1yAMk.js";import{s as Gt}from"./buy-DnSS_Kop.js";import{i as qt}from"./trade-encoding-CcRCeIpG.js";import{f as Vt}from"./errors-CG6pp58g.js";import{J as Kt,C as Zt,B as re}from"./ethers-CtVvB8eG.js";import{l as Qt}from"./loader-logo-BzY9EKdC.js";import{n as Jt}from"./emotion-CSxEP8yM.js";import"./sentry-BV_ZSgtd.js";import"./intl-CBcMB1D2.js";import"./Tooltip-CBuz_rc2.js";import"./authorizations-Ds7LRLV0.js";import"./sendMetaTransaction-7YAoB-pL.js";function ne(n){const r=n.source??"item",l=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${r}:${l}`}const H="100000000000000000000",Oe=2,X=15,Xt=/^[a-zA-Z0-9]+$/;function ve(n){const r=n.trim();return r.length===0?{ok:!1,reason:"empty"}:Xt.test(r)?r.length<Oe?{ok:!1,reason:"too-short"}:r.length>X?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Yt(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,X)}const en=["function available(string _subdomain) view returns (bool)"],Ce={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function tn(){return W.chainId===Wt.ChainId.MATIC_MAINNET?Ce.mainnet:Ce.sepolia}async function nn(n,r={}){var a;const{rpc:l,address:h}=tn(),u=new Kt(l),c=new Zt(h,en,u);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${l}`);const x=await c.available(n);if((a=r.signal)!=null&&a.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const sn="https://app.across.to/api";class De extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function on(n){return xt(H,n)}async function rn(n,r,l={}){var a;const h=l.chainId??W.chainId,u=l.provider??"across",c=`${W.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(r)}&chainId=${h}&provider=${u}`,x=await ot(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let d;try{d=(a=await x.json())==null?void 0:a.code}catch{}throw d==="ROUTE_COST_TOO_HIGH"?new De:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function an(n,r){const l=re.from(n.availableAmount),u=re.from(H).sub(l);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:qt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:r.externalCall.target,selector:r.externalCall.selector,data:r.externalCall.data,expiresAt:r.externalCall.expiresAt,salt:r.externalCall.salt},customExternalCallSignature:r.customExternalCallSignature,maxUncreditedValue:u.isNegative()?"0":u.toString(),maxCreditedValue:H}}async function ln(n,r={}){const l=sn,h=r.intervalMs??1e4,u=r.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<u;x++){try{const a=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${n}`);if(a.ok){const d=await a.json(),p=(d.status??"pending").toLowerCase(),w=d.fillTx??d.fillTxnRef??null,m=d.actionsSucceeded!==!1;if(p==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:m};if(p==="refunded"||p==="expired")return{status:p,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:m}}}catch{}x<u-1&&await new Promise(a=>setTimeout(a,h))}return c}async function cn(n){const{name:r,identity:l,signer:h}=n,u=n.chainId??W.chainId,c=n.provider??"across",x=(n.beneficiary??await h.getAddress()).toLowerCase();let a=null,d=!1;console.info("[names] register start",{name:r,buyer:x,chainId:u,provider:c});try{const p=await ht(u),w=on(p);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:p});const m=await rn(l,r,{chainId:u,provider:c});console.info("[names] step 2/6 route fetched",{target:m.externalCall.target,selector:m.externalCall.selector,provider:m.provider,quoteId:m.quoteId});const C=await nt(l,w);if(a=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),re.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const $=an(C.credit,m);let b;try{b=await Ht({chainId:u,buyer:x,signer:h,args:$})}catch(y){if(!(y instanceof Ut))throw y;b=await Gt(u,$,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:b}),await Ot(b),d=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:b}),c==="across"){const y=await ln(b,n.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:b};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:b,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:b}}catch(p){if(console.error("[names] register failed — raw error:",p,{name:r,buyer:x,originConfirmed:d}),p instanceof Dt)return{status:"pending",originTxHash:p.txHash};throw a&&!d&&await st(l,[a]).catch(()=>{}),p instanceof De?p:new Error(Vt(p,"Couldn't register the name. Please try again.",{sale:!0}))}}const dn=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -366,10 +366,10 @@ import{a as Fe,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D a
|
|
|
366
366
|
flex: none;
|
|
367
367
|
color: ${t.colors.dclRed};
|
|
368
368
|
}
|
|
369
|
-
`;function zn({name:n,priceCredits:r,onClose:l}){const{session:h}=ie(),{data:u,isError:c}=rt(h),x=
|
|
369
|
+
`;function zn({name:n,priceCredits:r,onClose:l}){const{session:h}=ie(),{data:u,isError:c}=rt(h),x=Be(),a=Le(),[d,p]=f.useState("confirm"),[w,m]=f.useState(""),[C,$]=f.useState(null),b=f.useRef(!1),y=w.trim().toLowerCase()===n.toLowerCase(),S=d==="completing",j=r!=null?Fe(r):"—";f.useEffect(()=>{const g=R=>{R.key==="Escape"&&!S&&l()};document.addEventListener("keydown",g);const Y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=Y}},[S,l]);async function E(){if(!(!h||!y||b.current)){b.current=!0,p("completing"),$(null);try{await cn({name:n,identity:h.identity,signer:h.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:r??null}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),p("success")}catch(g){J(lt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:at(g),purchase_type:"name"}),$((g==null?void 0:g.message)||o("names.errorGeneric")),p("error")}finally{b.current=!1}}}const k=d!=="success",I=it(h==null?void 0:h.providerType);return e.jsx(dn,{onClick:S?void 0:l,role:"presentation",children:e.jsxs(pn,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[k&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(ke,{children:d==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(Se,{onClick:l,disabled:S,"aria-label":o("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(Ee,{children:[o("names.myCreditsBalance")," ",e.jsx(F,{})," ",ye(u,c)]}),e.jsx(Te,{})]}),(d==="confirm"||d==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(Ie,{children:[e.jsx(_e,{"aria-hidden":!0,children:"@"}),e.jsxs(Re,{children:[e.jsxs(ze,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ae,{children:o("names.subtitle")})]}),e.jsxs(Ne,{children:[e.jsx(F,{}),j]})]}),d==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Rn,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>p("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(fn,{children:[e.jsx(hn,{children:o("names.confirmTitle")}),e.jsx(xn,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${An(n)}</b>`})}}),e.jsxs(un,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(gn,{value:w,onChange:g=>m(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(bn,{children:".dcl.eth"})]})]}),e.jsx(Me,{onClick:()=>void E(),disabled:!y||!h,children:o("names.buyCta")})]})]}),d==="completing"&&e.jsxs(yn,{children:[e.jsx(wn,{src:Qt,alt:"",width:56,height:56}),e.jsx(jn,{children:I?o("names.confirming"):o("names.completing")}),e.jsxs(vn,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx($n,{children:"1/1"})]})]}),d==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(ke,{children:o("names.successHeaderTitle")}),e.jsx(Se,{onClick:l,"aria-label":o("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(Ee,{children:[o("names.myCreditsBalance")," ",e.jsx(F,{})," ",ye(u,c)]}),e.jsx(Te,{}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(En,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(Ie,{style:{marginTop:20},children:[e.jsx(_e,{"aria-hidden":!0,children:"@"}),e.jsxs(Re,{children:[e.jsxs(ze,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ae,{children:o("names.subtitle")})]}),e.jsxs(Ne,{children:[e.jsx(F,{}),j]})]}),e.jsxs(Tn,{children:[e.jsx(In,{onClick:()=>{l(),a("/my-assets")},children:o("names.myItems")}),e.jsx(_n,{href:W.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function An(n){return n.replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/identity-B4DXDuJP.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/world-B-9aPlxu.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/invite-BfwIhP2C.webp",Ln="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/governance-DnazlIjy.webp",Bn=s.div`
|
|
370
370
|
width: 100%;
|
|
371
371
|
min-width: 0;
|
|
372
|
-
`,
|
|
372
|
+
`,Fn=s.nav`
|
|
373
373
|
display: flex;
|
|
374
374
|
align-items: center;
|
|
375
375
|
gap: 6px;
|
|
@@ -784,4 +784,4 @@ import{a as Fe,r as f,j as e,b as tt}from"./react-B36MyIP_.js";import{c as W,D a
|
|
|
784
784
|
clip: rect(0, 0, 0, 0);
|
|
785
785
|
white-space: nowrap;
|
|
786
786
|
border: 0;
|
|
787
|
-
`,hs="https://docs.decentraland.org/creator/worlds/about/",xs="https://governance.decentraland.org";function us(n){const r=typeof window<"u"?window.location.hostname:"";return`${r.endsWith("decentraland.org")?"https://decentraland.org":r.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ms({onBack:n}){We({title:o("seo.names.title"),description:o("seo.names.description")});const{session:r,signIn:l}=ie(),{data:h}=Ue(),u=h?He(H,h):null,[c,x]=f.useState(""),[a,d]=f.useState("idle"),[p,w]=f.useState(!1),m=f.useRef(null),[C,$]=f.useState(void 0);f.useLayoutEffect(()=>{m.current&&$(m.current.offsetWidth)},[c]),f.useEffect(()=>{if(!ve(c).ok){d(c.length===0?"idle":"invalid");return}d("checking");const k=new AbortController,I=setTimeout(()=>{(async()=>{try{const g=await nn(c,{signal:k.signal});d(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;d("error")}})()},400);return()=>{clearTimeout(I),k.abort()}},[c]);const b=ve(c),y=b.ok&&(a==="available"||a==="error");function S(){if(y){if(!r){l();return}w(!0)}}const j=e.jsxs(e.Fragment,{children:[o("names.claim"),u!=null?e.jsxs(rs,{children:[e.jsx(B,{}),Be(u)]}):null]});return e.jsxs(Ln,{"data-testid":"names-page",children:[e.jsxs(Bn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(Wn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Hn,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Un,{children:[e.jsxs(On,{children:[e.jsxs(Dn,{children:[e.jsx(Gn,{children:o("names.heroTitle")}),e.jsx(qn,{children:o("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Kn,{children:[e.jsxs(Zn,{invalid:a==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:c,onChange:E=>x(Yt(E.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Qn,{ref:m,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(ns,{children:o("names.suffix")})]}),c.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[c.length,"/",X]}):null,e.jsx(Ge,{onClick:S,disabled:!y,"data-testid":"names-claim",children:j})]}),a==="taken"?e.jsxs(Jn,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(Xn,{href:us(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(os,{onClick:S,disabled:!y,children:j}),a==="checking"?e.jsx(se,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):a==="error"?e.jsx(se,{tone:"muted",role:"status",children:o("names.checkError")}):a==="invalid"&&!b.ok&&b.reason==="too-short"?e.jsx(se,{tone:"muted",role:"status",children:o("names.tooShort",{min:Oe})}):null,e.jsx(fs,{role:"status","aria-live":"polite",children:a==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:o("names.whyTitle")}),e.jsx(cs,{children:o("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(q,{children:[e.jsx(V,{src:Nn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why1Title")}),e.jsx(Q,{children:o("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Mn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why2Title")}),e.jsxs(Q,{children:[o("names.why2")," ",e.jsx(ps,{children:o("names.why2Address")})]}),e.jsxs(Pe,{href:hs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Pn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why3Title")}),e.jsx(Q,{children:o("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Fn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why4Title")}),e.jsx(Q,{children:o("names.why4")}),e.jsxs(Pe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),p?e.jsx(zn,{name:c,priceCredits:u,onClose:()=>w(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",oe=48;function bs(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function Us(){const[n]=tt(),r=Fe(),l=(n.get("q")??"").trim().toLowerCase(),h=Le(),{session:u,signIn:c}=ie(),x=(n.get("q")??"").trim();We({title:x?o("seo.collectibles.searchTitle",{query:x}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[a,d]=f.useState("wearable"),[p,w]=f.useState(null),[m,C]=f.useState([]),[$,b]=f.useState(""),[y,S]=f.useState(""),[j,E]=f.useState("on_sale"),[k,I]=f.useState(!1),[g,Y]=f.useState("newest"),[R,A]=f.useState(!1),[ae,ee]=f.useState(null);f.useEffect(()=>{if(!R)return;const i=L=>{L.key==="Escape"&&A(!1)};document.addEventListener("keydown",i);const v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=v}},[R]);const U=j==="on_sale",N=$&&!Number.isNaN(Number($))?Number($):void 0,M=y&&!Number.isNaN(Number(y))?Number(y):void 0,qe=ft(),le=p?Pt[p]:void 0,ce=(we.find(i=>i.key===g)??we[0]).server,de={category:a,rarities:m.length?m:void 0,wearableCategories:le,minPriceCredits:N,maxPriceCredits:M,search:l||void 0,sortBy:ce,isSmart:k||void 0,onSale:!0,listingType:qe?void 0:"primary"},pe={category:a,rarities:m.length?m:void 0,wearableCategories:le,search:l||void 0,sortBy:ce,isWearableSmart:k||void 0,isOnSale:j==="not_for_sale"?!1:void 0},{items:P,total:fe,isLoading:_,isPlaceholderData:z,error:he,hasNextPage:Ve,isFetchingNextPage:xe,fetchNextPage:Ke}=Lt(U?["shop-items",de]:["catalog-items",pe],i=>U?dt({...de,first:oe,skip:i}):pt({...pe,first:oe,skip:i}),{enabled:a!=="names"}),O=fe,ue=_||z,Ze=_?15:Math.min(Math.max(P.length,1),oe),{data:D,isError:Qe}=Ue(),Je=i=>D&&i.manaWei?He(i.manaWei,D):null,me=f.useRef(null);f.useEffect(()=>{_||z||!l||me.current===l||(me.current=l,J("Shop Searched",{query:l,result_count:O}))},[l,_,z,O]);const G=f.useRef("__init__");f.useEffect(()=>{if(_||z)return;const i=JSON.stringify({category:a,subCategory:p,rarities:m,min:N,max:M,sort:g,status:j,smart:k});if(G.current==="__init__"||G.current===i){G.current=i;return}G.current=i,J("Shop Applied Filter",{filters:{category:a,sub_category:p,rarities:m,min_price_credits:N??null,max_price_credits:M??null,status:j,smart:k,sort:g},result_count:O})},[a,p,m,N,M,g,j,k,_,z,O]);function ge(i){d(i),w(null)}function be(i){C(v=>v.includes(i)?v.filter(L=>L!==i):[...v,i])}function Xe(){d("wearable"),w(null),C([]),b(""),S(""),E("on_sale"),I(!1)}function Ye(i){const v=P.find(L=>L.id===i.id);if(!(!v||v.source!=="legacy"||!v.manaWei)){if(!u){c();return}ee(bs(v))}}function et(){h.invalidateQueries({queryKey:["shop-items"]})}const F=[];(N!=null||M!=null)&&F.push({key:"price",label:o("filter.price"),onRemove:()=>{b(""),S("")}});for(const i of Nt)m.includes(i)&&F.push({key:`rarity-${i}`,label:ct(i),onRemove:()=>be(i)});return k&&F.push({key:"smart",label:o("filter.smart"),onRemove:()=>I(!1)}),j!=="on_sale"&&F.push({key:"status",label:j==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(mt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(gt,{onClick:()=>A(!1),"aria-hidden":!0}):null,e.jsxs(bt,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(yt,{children:[e.jsx(wt,{children:o("assets.filters")}),e.jsx(jt,{onClick:()=>A(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(vt,{children:e.jsx(Ct,{category:a,subCategory:p,onCategory:ge,onSub:w,priceMin:$,priceMax:y,onPriceMin:b,onPriceMax:S,rarities:m,onToggleRarity:be,status:j,onStatus:E,smart:k,onSmart:I})}),e.jsx($t,{children:e.jsx(kt,{type:"button",onClick:()=>A(!1),children:o("assets.showItems")})})]})]}),e.jsx(St,{children:a==="names"?e.jsx(ms,{onBack:()=>ge("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Mt,{sort:g,onSort:Y,total:fe,loading:_||z,query:l,onOpenFilters:()=>A(!0),chips:F,onClearChips:Xe}),Qe&&U&&P.some(i=>i.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,he?e.jsx(Bt,{message:o("assets.loadError"),testId:"browse-error"}):null,!ue&&P.length===0&&!he?e.jsxs(Et,{"data-testid":"browse-empty",children:[e.jsx(Tt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(_t,{children:o("assets.empty.title")}),e.jsx(Rt,{children:x?e.jsxs(e.Fragment,{children:[o("assets.empty.searchBefore"),e.jsx("b",{children:x}),o("assets.empty.searchAfter")]}):o("assets.empty.filters")})]}),e.jsx(zt,{children:e.jsx(At,{type:"button",onClick:()=>r("/overview"),children:o("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid","data-testid":"grid",children:ue?e.jsx(je,{count:Ze}):e.jsxs(e.Fragment,{children:[P.map(i=>{if(!U)return e.jsx(te,{item:i,mode:"view"},ne(i));const v=i;return v.source==="legacy"?e.jsx(te,{item:v,mode:"market",marketPriceCredits:Je(v),onBuyNow:Ye},ne(i)):e.jsx(te,{item:i},ne(i))}),xe?e.jsx(je,{count:6}):null]})}),e.jsx(Ft,{hasNextPage:Ve,isFetching:xe,onLoadMore:()=>void Ke()})]})]})}),ae&&D?e.jsx(ht,{listing:ae,rate:D,onClose:()=>ee(null),onSold:()=>{ee(null),et()}}):null]})}export{Us as Assets};
|
|
787
|
+
`,hs="https://docs.decentraland.org/creator/worlds/about/",xs="https://governance.decentraland.org";function us(n){const r=typeof window<"u"?window.location.hostname:"";return`${r.endsWith("decentraland.org")?"https://decentraland.org":r.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ms({onBack:n}){We({title:o("seo.names.title"),description:o("seo.names.description")});const{session:r,signIn:l}=ie(),{data:h}=Ue(),u=h?He(H,h):null,[c,x]=f.useState(""),[a,d]=f.useState("idle"),[p,w]=f.useState(!1),m=f.useRef(null),[C,$]=f.useState(void 0);f.useLayoutEffect(()=>{m.current&&$(m.current.offsetWidth)},[c]),f.useEffect(()=>{if(!ve(c).ok){d(c.length===0?"idle":"invalid");return}d("checking");const k=new AbortController,I=setTimeout(()=>{(async()=>{try{const g=await nn(c,{signal:k.signal});d(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;d("error")}})()},400);return()=>{clearTimeout(I),k.abort()}},[c]);const b=ve(c),y=b.ok&&(a==="available"||a==="error");function S(){if(y){if(!r){l();return}w(!0)}}const j=e.jsxs(e.Fragment,{children:[o("names.claim"),u!=null?e.jsxs(rs,{children:[e.jsx(F,{}),Fe(u)]}):null]});return e.jsxs(Bn,{"data-testid":"names-page",children:[e.jsxs(Fn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(Wn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Hn,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Un,{children:[e.jsxs(On,{children:[e.jsxs(Dn,{children:[e.jsx(Gn,{children:o("names.heroTitle")}),e.jsx(qn,{children:o("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Kn,{children:[e.jsxs(Zn,{invalid:a==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:c,onChange:E=>x(Yt(E.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Qn,{ref:m,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(ns,{children:o("names.suffix")})]}),c.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[c.length,"/",X]}):null,e.jsx(Ge,{onClick:S,disabled:!y,"data-testid":"names-claim",children:j})]}),a==="taken"?e.jsxs(Jn,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(Xn,{href:us(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(os,{onClick:S,disabled:!y,children:j}),a==="checking"?e.jsx(se,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):a==="error"?e.jsx(se,{tone:"muted",role:"status",children:o("names.checkError")}):a==="invalid"&&!b.ok&&b.reason==="too-short"?e.jsx(se,{tone:"muted",role:"status",children:o("names.tooShort",{min:Oe})}):null,e.jsx(fs,{role:"status","aria-live":"polite",children:a==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:o("names.whyTitle")}),e.jsx(cs,{children:o("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(q,{children:[e.jsx(V,{src:Nn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why1Title")}),e.jsx(Q,{children:o("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Mn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why2Title")}),e.jsxs(Q,{children:[o("names.why2")," ",e.jsx(ps,{children:o("names.why2Address")})]}),e.jsxs(Pe,{href:hs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Pn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why3Title")}),e.jsx(Q,{children:o("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Ln,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why4Title")}),e.jsx(Q,{children:o("names.why4")}),e.jsxs(Pe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),p?e.jsx(zn,{name:c,priceCredits:u,onClose:()=>w(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",oe=48;function bs(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function Os(){const[n]=tt(),r=Le(),l=(n.get("q")??"").trim().toLowerCase(),h=Be(),{session:u,signIn:c}=ie(),x=(n.get("q")??"").trim();We({title:x?o("seo.collectibles.searchTitle",{query:x}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[a,d]=f.useState("wearable"),[p,w]=f.useState(null),[m,C]=f.useState([]),[$,b]=f.useState(""),[y,S]=f.useState(""),[j,E]=f.useState("on_sale"),[k,I]=f.useState(!1),[g,Y]=f.useState("newest"),[R,A]=f.useState(!1),[ae,ee]=f.useState(null);f.useEffect(()=>{if(!R)return;const i=B=>{B.key==="Escape"&&A(!1)};document.addEventListener("keydown",i);const v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=v}},[R]);const U=j==="on_sale",N=$&&!Number.isNaN(Number($))?Number($):void 0,M=y&&!Number.isNaN(Number(y))?Number(y):void 0,qe=ft(),le=p?Mt[p]:void 0,ce=(we.find(i=>i.key===g)??we[0]).server,de={category:a,rarities:m.length?m:void 0,wearableCategories:le,minPriceCredits:N,maxPriceCredits:M,search:l||void 0,sortBy:ce,isSmart:k||void 0,onSale:!0,listingType:qe?void 0:"primary"},pe={category:a,rarities:m.length?m:void 0,wearableCategories:le,search:l||void 0,sortBy:ce,isWearableSmart:k||void 0,isOnSale:j==="not_for_sale"?!1:void 0},{items:P,total:fe,isLoading:_,isPlaceholderData:z,error:he,hasNextPage:Ve,isFetchingNextPage:xe,fetchNextPage:Ke}=Bt(U?["shop-items",de]:["catalog-items",pe],i=>U?dt({...de,first:oe,skip:i}):pt({...pe,first:oe,skip:i}),{enabled:a!=="names"}),O=fe,ue=_||z,Ze=_?15:Math.min(Math.max(P.length,1),oe),{data:D,isError:Qe}=Ue(),Je=i=>D&&i.manaWei?He(i.manaWei,D):null,me=f.useRef(null);f.useEffect(()=>{_||z||!l||me.current===l||(me.current=l,J("Shop Searched",{query:l,result_count:O}))},[l,_,z,O]);const G=f.useRef("__init__");f.useEffect(()=>{if(_||z)return;const i=JSON.stringify({category:a,subCategory:p,rarities:m,min:N,max:M,sort:g,status:j,smart:k});if(G.current==="__init__"||G.current===i){G.current=i;return}G.current=i,J("Shop Applied Filter",{filters:{category:a,sub_category:p,rarities:m,min_price_credits:N??null,max_price_credits:M??null,status:j,smart:k,sort:g},result_count:O})},[a,p,m,N,M,g,j,k,_,z,O]);function ge(i){d(i),w(null)}function be(i){C(v=>v.includes(i)?v.filter(B=>B!==i):[...v,i])}function Xe(){d("wearable"),w(null),C([]),b(""),S(""),E("on_sale"),I(!1)}function Ye(i){const v=P.find(B=>B.id===i.id);if(!(!v||v.source!=="legacy"||!v.manaWei)){if(!u){c();return}ee(bs(v))}}function et(){h.invalidateQueries({queryKey:["shop-items"]})}const L=[];(N!=null||M!=null)&&L.push({key:"price",label:o("filter.price"),onRemove:()=>{b(""),S("")}});for(const i of At)m.includes(i)&&L.push({key:`rarity-${i}`,label:ct(i),onRemove:()=>be(i)});return k&&L.push({key:"smart",label:o("filter.smart"),onRemove:()=>I(!1)}),j!=="on_sale"&&L.push({key:"status",label:j==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(ut,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(mt,{onClick:()=>A(!1),"aria-hidden":!0}):null,e.jsxs(gt,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(bt,{children:[e.jsx(yt,{children:o("assets.filters")}),e.jsx(wt,{onClick:()=>A(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(jt,{children:e.jsx(vt,{category:a,subCategory:p,onCategory:ge,onSub:w,priceMin:$,priceMax:y,onPriceMin:b,onPriceMax:S,rarities:m,onToggleRarity:be,status:j,onStatus:E,smart:k,onSmart:I})}),e.jsx(Ct,{children:e.jsx($t,{type:"button",onClick:()=>A(!1),children:o("assets.showItems")})})]})]}),e.jsx(kt,{children:a==="names"?e.jsx(ms,{onBack:()=>ge("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{sort:g,onSort:Y,total:fe,loading:_||z,query:l,onOpenFilters:()=>A(!0),chips:L,onClearChips:Xe}),Qe&&U&&P.some(i=>i.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,he?e.jsx(Ft,{message:o("assets.loadError"),testId:"browse-error"}):null,!ue&&P.length===0&&!he?e.jsxs(St,{"data-testid":"browse-empty",children:[e.jsx(Et,{src:gs,alt:""}),e.jsxs(Tt,{children:[e.jsx(It,{children:o("assets.empty.title")}),e.jsx(_t,{children:x?e.jsxs(e.Fragment,{children:[o("assets.empty.searchBefore"),e.jsx("b",{children:x}),o("assets.empty.searchAfter")]}):o("assets.empty.filters")})]}),e.jsx(Rt,{children:e.jsx(zt,{type:"button",onClick:()=>r("/overview"),children:o("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid","data-testid":"grid",children:ue?e.jsx(je,{count:Ze}):e.jsxs(e.Fragment,{children:[P.map(i=>{if(!U)return e.jsx(te,{item:i,mode:"view"},ne(i));const v=i;return v.source==="legacy"?e.jsx(te,{item:v,mode:"market",marketPriceCredits:Je(v),onBuyNow:Ye},ne(i)):e.jsx(te,{item:i},ne(i))}),xe?e.jsx(je,{count:6}):null]})}),e.jsx(Pt,{hasNextPage:Ve,isFetching:xe,onLoadMore:()=>void Ke()})]})]})}),ae&&D?e.jsx(Lt,{listing:ae,rate:D,onClose:()=>ee(null),onSold:()=>{ee(null),et()}}):null]})}export{Os as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,j as t}from"./react-
|
|
1
|
+
import{r as $,j as t}from"./react-BW1xvPTF.js";import{R as C,a as oe,C as ie,c as ne}from"./categories-BI9AXlDF.js";import{T as se}from"./Tooltip-CBuz_rc2.js";import{K as e,s as o,I as m,t as s,L as re,e as v}from"./index-TmxHL85j.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as q,r as D}from"./react-
|
|
1
|
+
import{j as t,L as q,r as D}from"./react-BW1xvPTF.js";import{s as a,B as M,K as o,R as I,x as B,t as e,u as F,y as K,I as f,C as G,S as P,n as w,b as Q,m as H,U as k,J as O,N as $}from"./index-TmxHL85j.js";import{b as W,c as _,d as J,f as U,s as X,h as V}from"./authorizations-Ds7LRLV0.js";import{a as Y}from"./builder-Cc8g4-4q.js";import{f as Z}from"./errors-CG6pp58g.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-7YAoB-pL.js";const tt=I`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
3
|
`,it=I`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bc as Xe,bd as Ye,
|
|
1
|
+
import{bc as Xe,bd as Ye,F as Ge,be as qe,Y as G,Z as b,$ as z,W as ee,X as se,bf as Ze,a2 as H,R as le,V as Ce,bg as be,bh as we,bi as w,a1 as Re,bj as Je,T as Qe,aU as eo,E as oo,a0 as B,bk as to,bl as J}from"./index-TmxHL85j.js";import{r as l,j as T,R as Y}from"./react-BW1xvPTF.js";function Me(e){var o,t,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(o=0;o<n;o++)e[o]&&(t=Me(e[o]))&&(i&&(i+=" "),i+=t)}else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function no(){for(var e,o,t=0,i="",n=arguments.length;t<n;t++)(e=arguments[t])&&(o=Me(e))&&(i&&(i+=" "),i+=o);return i}const io=["className","component"];function ao(e={}){const{themeId:o,defaultTheme:t,defaultClassName:i="MuiBox-root",generateClassName:n}=e,a=Xe("div",{shouldForwardProp:u=>u!=="theme"&&u!=="sx"&&u!=="as"})(Ye);return l.forwardRef(function(c,p){const f=Ge(t),g=qe(c),{className:m,component:v="div"}=g,h=G(g,io);return T.jsx(a,b({as:v,ref:p,className:no(m,n?n(i):i),theme:o&&f[o]||f},h))})}function ae(e,o){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},ae(e,o)}function ro(e,o){e.prototype=Object.create(o.prototype),e.prototype.constructor=e,ae(e,o)}const ge=Y.createContext(null);function so(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ce(e,o){var t=function(a){return o&&l.isValidElement(a)?o(a):a},i=Object.create(null);return e&&l.Children.map(e,function(n){return n}).forEach(function(n){i[n.key]=t(n)}),i}function lo(e,o){e=e||{},o=o||{};function t(f){return f in o?o[f]:e[f]}var i=Object.create(null),n=[];for(var a in e)a in o?n.length&&(i[a]=n,n=[]):n.push(a);var r,u={};for(var c in o){if(i[c])for(r=0;r<i[c].length;r++){var p=i[c][r];u[i[c][r]]=t(p)}u[c]=t(c)}for(r=0;r<n.length;r++)u[n[r]]=t(n[r]);return u}function A(e,o,t){return t[o]!=null?t[o]:e.props[o]}function co(e,o){return ce(e.children,function(t){return l.cloneElement(t,{onExited:o.bind(null,t),in:!0,appear:A(t,"appear",e),enter:A(t,"enter",e),exit:A(t,"exit",e)})})}function uo(e,o,t){var i=ce(e.children),n=lo(o,i);return Object.keys(n).forEach(function(a){var r=n[a];if(l.isValidElement(r)){var u=a in o,c=a in i,p=o[a],f=l.isValidElement(p)&&!p.props.in;c&&(!u||f)?n[a]=l.cloneElement(r,{onExited:t.bind(null,r),in:!0,exit:A(r,"exit",e),enter:A(r,"enter",e)}):!c&&u&&!f?n[a]=l.cloneElement(r,{in:!1}):c&&u&&l.isValidElement(p)&&(n[a]=l.cloneElement(r,{onExited:t.bind(null,r),in:p.props.in,exit:A(r,"exit",e),enter:A(r,"enter",e)}))}}),n}var po=Object.values||function(e){return Object.keys(e).map(function(o){return e[o]})},fo={component:"div",childFactory:function(o){return o}},ue=(function(e){ro(o,e);function o(i,n){var a;a=e.call(this,i,n)||this;var r=a.handleExited.bind(so(a));return a.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},a}var t=o.prototype;return t.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},t.componentWillUnmount=function(){this.mounted=!1},o.getDerivedStateFromProps=function(n,a){var r=a.children,u=a.handleExited,c=a.firstRender;return{children:c?co(n,u):uo(n,r,u),firstRender:!1}},t.handleExited=function(n,a){var r=ce(this.props.children);n.key in r||(n.props.onExited&&n.props.onExited(a),this.mounted&&this.setState(function(u){var c=b({},u.children);return delete c[n.key],{children:c}}))},t.render=function(){var n=this.props,a=n.component,r=n.childFactory,u=G(n,["component","childFactory"]),c=this.state.contextValue,p=po(this.state.children).map(r);return delete u.appear,delete u.enter,delete u.exit,a===null?Y.createElement(ge.Provider,{value:c},p):Y.createElement(ge.Provider,{value:c},Y.createElement(a,u,p))},o})(Y.Component);ue.propTypes={};ue.defaultProps=fo;function ho(e){const{className:o,classes:t,pulsate:i=!1,rippleX:n,rippleY:a,rippleSize:r,in:u,onExited:c,timeout:p}=e,[f,g]=l.useState(!1),m=z(o,t.ripple,t.rippleVisible,i&&t.ripplePulsate),v={width:r,height:r,top:-(r/2)+a,left:-(r/2)+n},h=z(t.child,f&&t.childLeaving,i&&t.childPulsate);return!u&&!f&&g(!0),l.useEffect(()=>{if(!u&&c!=null){const C=setTimeout(c,p);return()=>{clearTimeout(C)}}},[c,u,p]),T.jsx("span",{className:m,style:v,children:T.jsx("span",{className:h})})}const E=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),bo=["center","classes","className"];let oe=e=>e,me,xe,ve,ye;const re=550,go=80,mo=le(me||(me=oe`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0.1;
|
|
@@ -71,4 +71,4 @@ import{bc as Xe,bd as Ye,q as Ge,be as qe,Y as G,Z as b,$ as z,W as ee,X as se,b
|
|
|
71
71
|
animation-iteration-count: infinite;
|
|
72
72
|
animation-delay: 200ms;
|
|
73
73
|
}
|
|
74
|
-
`),E.rippleVisible,mo,re,({theme:e})=>e.transitions.easing.easeInOut,E.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,E.child,E.childLeaving,xo,re,({theme:e})=>e.transitions.easing.easeInOut,E.childPulsate,vo,({theme:e})=>e.transitions.easing.easeInOut),Ro=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiTouchRipple"}),{center:n=!1,classes:a={},className:r}=i,u=G(i,bo),[c,p]=l.useState([]),f=l.useRef(0),g=l.useRef(null);l.useEffect(()=>{g.current&&(g.current(),g.current=null)},[c]);const m=l.useRef(!1),v=Ze(),h=l.useRef(null),C=l.useRef(null),_=l.useCallback(d=>{const{pulsate:R,rippleX:x,rippleY:y,rippleSize:L,cb:O}=d;p(M=>[...M,T.jsx(Co,{classes:{ripple:z(a.ripple,E.ripple),rippleVisible:z(a.rippleVisible,E.rippleVisible),ripplePulsate:z(a.ripplePulsate,E.ripplePulsate),child:z(a.child,E.child),childLeaving:z(a.childLeaving,E.childLeaving),childPulsate:z(a.childPulsate,E.childPulsate)},timeout:re,pulsate:R,rippleX:x,rippleY:y,rippleSize:L},f.current)]),f.current+=1,g.current=O},[a]),V=l.useCallback((d={},R={},x=()=>{})=>{const{pulsate:y=!1,center:L=n||R.pulsate,fakeElement:O=!1}=R;if((d==null?void 0:d.type)==="mousedown"&&m.current){m.current=!1;return}(d==null?void 0:d.type)==="touchstart"&&(m.current=!0);const M=O?null:C.current,D=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,j,F;if(L||d===void 0||d.clientX===0&&d.clientY===0||!d.clientX&&!d.touches)P=Math.round(D.width/2),j=Math.round(D.height/2);else{const{clientX:W,clientY:k}=d.touches&&d.touches.length>0?d.touches[0]:d;P=Math.round(W-D.left),j=Math.round(k-D.top)}if(L)F=Math.sqrt((2*D.width**2+D.height**2)/3),F%2===0&&(F+=1);else{const W=Math.max(Math.abs((M?M.clientWidth:0)-P),P)*2+2,k=Math.max(Math.abs((M?M.clientHeight:0)-j),j)*2+2;F=Math.sqrt(W**2+k**2)}d!=null&&d.touches?h.current===null&&(h.current=()=>{_({pulsate:y,rippleX:P,rippleY:j,rippleSize:F,cb:x})},v.start(go,()=>{h.current&&(h.current(),h.current=null)})):_({pulsate:y,rippleX:P,rippleY:j,rippleSize:F,cb:x})},[n,_,v]),S=l.useCallback(()=>{V({},{pulsate:!0})},[V]),I=l.useCallback((d,R)=>{if(v.clear(),(d==null?void 0:d.type)==="touchend"&&h.current){h.current(),h.current=null,v.start(0,()=>{I(d,R)});return}h.current=null,p(x=>x.length>0?x.slice(1):x),g.current=R},[v]);return l.useImperativeHandle(t,()=>({pulsate:S,start:V,stop:I}),[S,V,I]),T.jsx(yo,b({className:z(E.root,a.root,r),ref:C},u,{children:T.jsx(ue,{component:null,exit:!0,children:c})}))});function Mo(e){return Ce("MuiButtonBase",e)}const zo=ee("MuiButtonBase",["root","disabled","focusVisible"]),Eo=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Bo=e=>{const{disabled:o,focusVisible:t,focusVisibleClassName:i,classes:n}=e,r=Re({root:["root",o&&"disabled",t&&"focusVisible"]},Mo,n);return t&&i&&(r.root+=` ${i}`),r},To=H("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,o)=>o.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${zo.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),$o=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiButtonBase"}),{action:n,centerRipple:a=!1,children:r,className:u,component:c="button",disabled:p=!1,disableRipple:f=!1,disableTouchRipple:g=!1,focusRipple:m=!1,LinkComponent:v="a",onBlur:h,onClick:C,onContextMenu:_,onDragLeave:V,onFocus:S,onFocusVisible:I,onKeyDown:d,onKeyUp:R,onMouseDown:x,onMouseLeave:y,onMouseUp:L,onTouchEnd:O,onTouchMove:M,onTouchStart:D,tabIndex:P=0,TouchRippleProps:j,touchRippleRef:F,type:W}=i,k=G(i,Eo),K=l.useRef(null),$=l.useRef(null),Ee=be($,F),{isFocusVisibleRef:pe,onFocus:Be,onBlur:Te,ref:$e}=we(),[U,q]=l.useState(!1);p&&U&&q(!1),l.useImperativeHandle(n,()=>({focusVisible:()=>{q(!0),K.current.focus()}}),[]);const[te,Ie]=l.useState(!1);l.useEffect(()=>{Ie(!0)},[]);const Pe=te&&!f&&!p;l.useEffect(()=>{U&&m&&!f&&te&&$.current.pulsate()},[f,m,U,te]);function N(s,fe,Ke=g){return w(he=>(fe&&fe(he),!Ke&&$.current&&$.current[s](he),!0))}const ke=N("start",x),Ne=N("stop",_),Ve=N("stop",V),Se=N("stop",L),Le=N("stop",s=>{U&&s.preventDefault(),y&&y(s)}),De=N("start",D),je=N("stop",O),Fe=N("stop",M),_e=N("stop",s=>{Te(s),pe.current===!1&&q(!1),h&&h(s)},!1),Oe=w(s=>{K.current||(K.current=s.currentTarget),Be(s),pe.current===!0&&(q(!0),I&&I(s)),S&&S(s)}),ne=()=>{const s=K.current;return c&&c!=="button"&&!(s.tagName==="A"&&s.href)},ie=l.useRef(!1),We=w(s=>{m&&!ie.current&&U&&$.current&&s.key===" "&&(ie.current=!0,$.current.stop(s,()=>{$.current.start(s)})),s.target===s.currentTarget&&ne()&&s.key===" "&&s.preventDefault(),d&&d(s),s.target===s.currentTarget&&ne()&&s.key==="Enter"&&!p&&(s.preventDefault(),C&&C(s))}),Ue=w(s=>{m&&s.key===" "&&$.current&&U&&!s.defaultPrevented&&(ie.current=!1,$.current.stop(s,()=>{$.current.pulsate(s)})),R&&R(s),C&&s.target===s.currentTarget&&ne()&&s.key===" "&&!s.defaultPrevented&&C(s)});let Z=c;Z==="button"&&(k.href||k.to)&&(Z=v);const X={};Z==="button"?(X.type=W===void 0?"button":W,X.disabled=p):(!k.href&&!k.to&&(X.role="button"),p&&(X["aria-disabled"]=p));const Ae=be(t,$e,K),de=b({},i,{centerRipple:a,component:c,disabled:p,disableRipple:f,disableTouchRipple:g,focusRipple:m,tabIndex:P,focusVisible:U}),He=Bo(de);return T.jsxs(To,b({as:Z,className:z(He.root,u),ownerState:de,onBlur:_e,onClick:C,onContextMenu:Ne,onFocus:Oe,onKeyDown:We,onKeyUp:Ue,onMouseDown:ke,onMouseLeave:Le,onMouseUp:Se,onDragLeave:Ve,onTouchEnd:je,onTouchMove:Fe,onTouchStart:De,ref:Ae,tabIndex:p?-1:P,type:W},X,k,{children:[r,Pe?T.jsx(Ro,b({ref:Ee,center:a},j)):null]}))}),Io=ee("MuiBox",["root"]),Po=eo(),Uo=ao({themeId:Qe,defaultTheme:Po,defaultClassName:Io.root,generateClassName:Je.generate});function ko(e){return Ce("MuiButton",e)}const Q=ee("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),No=l.createContext({}),Vo=l.createContext(void 0),So=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Lo=e=>{const{color:o,disableElevation:t,fullWidth:i,size:n,variant:a,classes:r}=e,u={root:["root",a,`${a}${B(o)}`,`size${B(n)}`,`${a}Size${B(n)}`,`color${B(o)}`,t&&"disableElevation",i&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${B(n)}`],endIcon:["icon","endIcon",`iconSize${B(n)}`]},c=Re(u,ko,r);return b({},r,c)},ze=e=>b({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Do=H($o,{shouldForwardProp:e=>to(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`${t.variant}${B(t.color)}`],o[`size${B(t.size)}`],o[`${t.variant}Size${B(t.size)}`],t.color==="inherit"&&o.colorInherit,t.disableElevation&&o.disableElevation,t.fullWidth&&o.fullWidth]}})(({theme:e,ownerState:o})=>{var t,i;const n=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],a=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return b({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":b({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="text"&&o.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="outlined"&&o.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[o.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:a,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},o.variant==="contained"&&o.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[o.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[o.color].main}}),"&:active":b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Q.focusVisible}`]:b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Q.disabled}`]:b({color:(e.vars||e).palette.action.disabled},o.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},o.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},o.variant==="text"&&{padding:"6px 8px"},o.variant==="text"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].main},o.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},o.variant==="outlined"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[o.color].mainChannel} / 0.5)`:`1px solid ${J.alpha(e.palette[o.color].main,.5)}`},o.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(t=(i=e.palette).getContrastText)==null?void 0:t.call(i,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:n,boxShadow:(e.vars||e).shadows[2]},o.variant==="contained"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].contrastText,backgroundColor:(e.vars||e).palette[o.color].main},o.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},o.size==="small"&&o.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},o.size==="small"&&o.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},o.size==="small"&&o.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},o.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Q.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Q.disabled}`]:{boxShadow:"none"}}),jo=H("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.startIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},ze(e))),Fo=H("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.endIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},ze(e))),Ao=l.forwardRef(function(o,t){const i=l.useContext(No),n=l.useContext(Vo),a=oo(i,o),r=se({props:a,name:"MuiButton"}),{children:u,color:c="primary",component:p="button",className:f,disabled:g=!1,disableElevation:m=!1,disableFocusRipple:v=!1,endIcon:h,focusVisibleClassName:C,fullWidth:_=!1,size:V="medium",startIcon:S,type:I,variant:d="text"}=r,R=G(r,So),x=b({},r,{color:c,component:p,disabled:g,disableElevation:m,disableFocusRipple:v,fullWidth:_,size:V,type:I,variant:d}),y=Lo(x),L=S&&T.jsx(jo,{className:y.startIcon,ownerState:x,children:S}),O=h&&T.jsx(Fo,{className:y.endIcon,ownerState:x,children:h}),M=n||"";return T.jsxs(Do,b({ownerState:x,className:z(i.className,y.root,f,M),component:p,disabled:g,focusRipple:!v,focusVisibleClassName:z(y.focusVisible,C),ref:t,type:I},R,{classes:y,children:[L,u,O]}))});export{No as B,ge as T,ro as _,Vo as a,$o as b,Ao as c,Uo as d};
|
|
74
|
+
`),E.rippleVisible,mo,re,({theme:e})=>e.transitions.easing.easeInOut,E.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,E.child,E.childLeaving,xo,re,({theme:e})=>e.transitions.easing.easeInOut,E.childPulsate,vo,({theme:e})=>e.transitions.easing.easeInOut),Ro=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiTouchRipple"}),{center:n=!1,classes:a={},className:r}=i,u=G(i,bo),[c,p]=l.useState([]),f=l.useRef(0),g=l.useRef(null);l.useEffect(()=>{g.current&&(g.current(),g.current=null)},[c]);const m=l.useRef(!1),v=Ze(),h=l.useRef(null),C=l.useRef(null),_=l.useCallback(d=>{const{pulsate:R,rippleX:x,rippleY:y,rippleSize:L,cb:O}=d;p(M=>[...M,T.jsx(Co,{classes:{ripple:z(a.ripple,E.ripple),rippleVisible:z(a.rippleVisible,E.rippleVisible),ripplePulsate:z(a.ripplePulsate,E.ripplePulsate),child:z(a.child,E.child),childLeaving:z(a.childLeaving,E.childLeaving),childPulsate:z(a.childPulsate,E.childPulsate)},timeout:re,pulsate:R,rippleX:x,rippleY:y,rippleSize:L},f.current)]),f.current+=1,g.current=O},[a]),V=l.useCallback((d={},R={},x=()=>{})=>{const{pulsate:y=!1,center:L=n||R.pulsate,fakeElement:O=!1}=R;if((d==null?void 0:d.type)==="mousedown"&&m.current){m.current=!1;return}(d==null?void 0:d.type)==="touchstart"&&(m.current=!0);const M=O?null:C.current,D=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,F,j;if(L||d===void 0||d.clientX===0&&d.clientY===0||!d.clientX&&!d.touches)P=Math.round(D.width/2),F=Math.round(D.height/2);else{const{clientX:W,clientY:k}=d.touches&&d.touches.length>0?d.touches[0]:d;P=Math.round(W-D.left),F=Math.round(k-D.top)}if(L)j=Math.sqrt((2*D.width**2+D.height**2)/3),j%2===0&&(j+=1);else{const W=Math.max(Math.abs((M?M.clientWidth:0)-P),P)*2+2,k=Math.max(Math.abs((M?M.clientHeight:0)-F),F)*2+2;j=Math.sqrt(W**2+k**2)}d!=null&&d.touches?h.current===null&&(h.current=()=>{_({pulsate:y,rippleX:P,rippleY:F,rippleSize:j,cb:x})},v.start(go,()=>{h.current&&(h.current(),h.current=null)})):_({pulsate:y,rippleX:P,rippleY:F,rippleSize:j,cb:x})},[n,_,v]),S=l.useCallback(()=>{V({},{pulsate:!0})},[V]),I=l.useCallback((d,R)=>{if(v.clear(),(d==null?void 0:d.type)==="touchend"&&h.current){h.current(),h.current=null,v.start(0,()=>{I(d,R)});return}h.current=null,p(x=>x.length>0?x.slice(1):x),g.current=R},[v]);return l.useImperativeHandle(t,()=>({pulsate:S,start:V,stop:I}),[S,V,I]),T.jsx(yo,b({className:z(E.root,a.root,r),ref:C},u,{children:T.jsx(ue,{component:null,exit:!0,children:c})}))});function Mo(e){return Ce("MuiButtonBase",e)}const zo=ee("MuiButtonBase",["root","disabled","focusVisible"]),Eo=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Bo=e=>{const{disabled:o,focusVisible:t,focusVisibleClassName:i,classes:n}=e,r=Re({root:["root",o&&"disabled",t&&"focusVisible"]},Mo,n);return t&&i&&(r.root+=` ${i}`),r},To=H("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,o)=>o.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${zo.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),$o=l.forwardRef(function(o,t){const i=se({props:o,name:"MuiButtonBase"}),{action:n,centerRipple:a=!1,children:r,className:u,component:c="button",disabled:p=!1,disableRipple:f=!1,disableTouchRipple:g=!1,focusRipple:m=!1,LinkComponent:v="a",onBlur:h,onClick:C,onContextMenu:_,onDragLeave:V,onFocus:S,onFocusVisible:I,onKeyDown:d,onKeyUp:R,onMouseDown:x,onMouseLeave:y,onMouseUp:L,onTouchEnd:O,onTouchMove:M,onTouchStart:D,tabIndex:P=0,TouchRippleProps:F,touchRippleRef:j,type:W}=i,k=G(i,Eo),K=l.useRef(null),$=l.useRef(null),Ee=be($,j),{isFocusVisibleRef:pe,onFocus:Be,onBlur:Te,ref:$e}=we(),[U,q]=l.useState(!1);p&&U&&q(!1),l.useImperativeHandle(n,()=>({focusVisible:()=>{q(!0),K.current.focus()}}),[]);const[te,Ie]=l.useState(!1);l.useEffect(()=>{Ie(!0)},[]);const Pe=te&&!f&&!p;l.useEffect(()=>{U&&m&&!f&&te&&$.current.pulsate()},[f,m,U,te]);function N(s,fe,Ke=g){return w(he=>(fe&&fe(he),!Ke&&$.current&&$.current[s](he),!0))}const ke=N("start",x),Ne=N("stop",_),Ve=N("stop",V),Se=N("stop",L),Le=N("stop",s=>{U&&s.preventDefault(),y&&y(s)}),De=N("start",D),Fe=N("stop",O),je=N("stop",M),_e=N("stop",s=>{Te(s),pe.current===!1&&q(!1),h&&h(s)},!1),Oe=w(s=>{K.current||(K.current=s.currentTarget),Be(s),pe.current===!0&&(q(!0),I&&I(s)),S&&S(s)}),ne=()=>{const s=K.current;return c&&c!=="button"&&!(s.tagName==="A"&&s.href)},ie=l.useRef(!1),We=w(s=>{m&&!ie.current&&U&&$.current&&s.key===" "&&(ie.current=!0,$.current.stop(s,()=>{$.current.start(s)})),s.target===s.currentTarget&&ne()&&s.key===" "&&s.preventDefault(),d&&d(s),s.target===s.currentTarget&&ne()&&s.key==="Enter"&&!p&&(s.preventDefault(),C&&C(s))}),Ue=w(s=>{m&&s.key===" "&&$.current&&U&&!s.defaultPrevented&&(ie.current=!1,$.current.stop(s,()=>{$.current.pulsate(s)})),R&&R(s),C&&s.target===s.currentTarget&&ne()&&s.key===" "&&!s.defaultPrevented&&C(s)});let Z=c;Z==="button"&&(k.href||k.to)&&(Z=v);const X={};Z==="button"?(X.type=W===void 0?"button":W,X.disabled=p):(!k.href&&!k.to&&(X.role="button"),p&&(X["aria-disabled"]=p));const Ae=be(t,$e,K),de=b({},i,{centerRipple:a,component:c,disabled:p,disableRipple:f,disableTouchRipple:g,focusRipple:m,tabIndex:P,focusVisible:U}),He=Bo(de);return T.jsxs(To,b({as:Z,className:z(He.root,u),ownerState:de,onBlur:_e,onClick:C,onContextMenu:Ne,onFocus:Oe,onKeyDown:We,onKeyUp:Ue,onMouseDown:ke,onMouseLeave:Le,onMouseUp:Se,onDragLeave:Ve,onTouchEnd:Fe,onTouchMove:je,onTouchStart:De,ref:Ae,tabIndex:p?-1:P,type:W},X,k,{children:[r,Pe?T.jsx(Ro,b({ref:Ee,center:a},F)):null]}))}),Io=ee("MuiBox",["root"]),Po=eo(),Uo=ao({themeId:Qe,defaultTheme:Po,defaultClassName:Io.root,generateClassName:Je.generate});function ko(e){return Ce("MuiButton",e)}const Q=ee("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),No=l.createContext({}),Vo=l.createContext(void 0),So=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Lo=e=>{const{color:o,disableElevation:t,fullWidth:i,size:n,variant:a,classes:r}=e,u={root:["root",a,`${a}${B(o)}`,`size${B(n)}`,`${a}Size${B(n)}`,`color${B(o)}`,t&&"disableElevation",i&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${B(n)}`],endIcon:["icon","endIcon",`iconSize${B(n)}`]},c=Re(u,ko,r);return b({},r,c)},ze=e=>b({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Do=H($o,{shouldForwardProp:e=>to(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`${t.variant}${B(t.color)}`],o[`size${B(t.size)}`],o[`${t.variant}Size${B(t.size)}`],t.color==="inherit"&&o.colorInherit,t.disableElevation&&o.disableElevation,t.fullWidth&&o.fullWidth]}})(({theme:e,ownerState:o})=>{var t,i;const n=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],a=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return b({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":b({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="text"&&o.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="outlined"&&o.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[o.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:J.alpha(e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},o.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:a,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},o.variant==="contained"&&o.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[o.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[o.color].main}}),"&:active":b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Q.focusVisible}`]:b({},o.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Q.disabled}`]:b({color:(e.vars||e).palette.action.disabled},o.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},o.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},o.variant==="text"&&{padding:"6px 8px"},o.variant==="text"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].main},o.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},o.variant==="outlined"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[o.color].mainChannel} / 0.5)`:`1px solid ${J.alpha(e.palette[o.color].main,.5)}`},o.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(t=(i=e.palette).getContrastText)==null?void 0:t.call(i,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:n,boxShadow:(e.vars||e).shadows[2]},o.variant==="contained"&&o.color!=="inherit"&&{color:(e.vars||e).palette[o.color].contrastText,backgroundColor:(e.vars||e).palette[o.color].main},o.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},o.size==="small"&&o.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},o.size==="small"&&o.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},o.size==="small"&&o.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},o.size==="large"&&o.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},o.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Q.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Q.disabled}`]:{boxShadow:"none"}}),Fo=H("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.startIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},ze(e))),jo=H("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.endIcon,o[`iconSize${B(t.size)}`]]}})(({ownerState:e})=>b({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},ze(e))),Ao=l.forwardRef(function(o,t){const i=l.useContext(No),n=l.useContext(Vo),a=oo(i,o),r=se({props:a,name:"MuiButton"}),{children:u,color:c="primary",component:p="button",className:f,disabled:g=!1,disableElevation:m=!1,disableFocusRipple:v=!1,endIcon:h,focusVisibleClassName:C,fullWidth:_=!1,size:V="medium",startIcon:S,type:I,variant:d="text"}=r,R=G(r,So),x=b({},r,{color:c,component:p,disabled:g,disableElevation:m,disableFocusRipple:v,fullWidth:_,size:V,type:I,variant:d}),y=Lo(x),L=S&&T.jsx(Fo,{className:y.startIcon,ownerState:x,children:S}),O=h&&T.jsx(jo,{className:y.endIcon,ownerState:x,children:h}),M=n||"";return T.jsxs(Do,b({ownerState:x,className:z(i.className,y.root,f,M),component:p,disabled:g,focusRipple:!v,focusVisibleClassName:z(y.focusVisible,C),ref:t,type:I},R,{classes:y,children:[L,u,O]}))});export{No as B,ge as T,ro as _,Vo as a,$o as b,Ao as c,Uo as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as j,a as pa,u as _a,L as te}from"./react-B36MyIP_.js";import{t,k as K,m as G,ak as ga,h as ba,ai as P,Q as Ue,e as fa,u as va,w as xa,x as Ca,al as ja,am as ka,I as A,an as Na,l as wa,j as Ma,ao as Oe,E as B,ap as $e,aq as Sa,J as O,b as qa,D as Ve,y as pe,ar as _e,G as se,F as De,g as ne,a as Pa,C as ge,c as Ge,as as Aa}from"./index-BSeusSHl.js";import{P as Ye,m as Xe,W as Ia,c as be,t as Ra,C as Fa,A as Ta,a as Ea,s as He,i as Wa,b as La,d as Ba,e as Ka}from"./CollectionCarousel-Dsbypx_Q.js";import{u as Qa}from"./useManaRate-CY5PbqWB.js";import{u as Je,r as za}from"./mana-rate-BJbe6lgb.js";import{a as Ua,j as Oa,h as $a,n as Va,i as Da,A as Ga}from"./authorizations-CUAi4uqJ.js";import{a as fe}from"./buy-Tme1UHVf.js";import{a as Ha,w as Ja,S as Ya,G as Xa}from"./buy-gasless-BdW9VEKq.js";import{R as re,r as Za}from"./cart-checkout-D8_UxnB9.js";import{u as et,M as at,c as tt}from"./useCreditPacks-Dg3_30xn.js";import{l as st}from"./loader-logo-BzY9EKdC.js";import{i as nt,a as rt}from"./errors-DCLH44Ym.js";import{E as ct}from"./ErrorNotice-D_Z5OVFI.js";import"./sentry-gZJVwIqQ.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-BteKixT0.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DXoI04Mc.js";import"./sendMetaTransaction-DEU_Xtzf.js";const it="https://cdn.decentraland.org/@dcl/shop/0.1.0-30362815497.commit-35ecdbf/assets/buy-error-22UunaPC.png";function ot(c){const{phase:o,balanceCredits:C,onClose:N}=c,I=o==="processing",T=o==="error"?t("cartCheckout.errorTitle"):o==="nofunds"?t("cartCheckout.titleNoFunds"):o==="choose"?t("buyModal.choosePayment"):t("cartCheckout.titleBuy"),E=o==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:I?void 0:N,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${E?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:T}),!I&&e.jsx("button",{className:"buy-modal__x",onClick:N,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:o==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(K,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:G(C)})]})]}),o==="choose"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"cart-checkout__choose-total",children:[e.jsx("span",{children:t("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(K,{className:"buy-modal__balance-ico"}),G(c.totalCredits??0)]})]}),e.jsx(Ye,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const M=Xe(c.totalCents??0,c.totalManaWei??0n);return M!=null?t("buyModal.manaRate",{mana:M.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),o==="processing"&&e.jsx(lt,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),o==="nofunds"&&e.jsx(dt,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:N}),o==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:it,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:t("cartCheckout.errorHeadline")})," ",t("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:N,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:c.onRetry??N,children:t("cartCheckout.tryAgain")})]})]})]})]})}function lt({stage:c,step:o,total:C,isSelfCustody:N}){const I=c==="reserving",T=C>0?Math.min(100,Math.round(o/C*100)):0,E=c==="awaiting-signature"?N?t("buyModal.confirmToContinue"):t("buyModal.completingTransaction"):c==="settling"?t("buyModal.completingTransaction"):t("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:st,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:E}),I?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${T}%`}})}),C>1?e.jsxs("span",{className:"cart-checkout__step",children:[o,"/",C]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function dt({lines:c,shortfallCredits:o,packs:C,selectedPack:N,onSelectPack:I,onBuyPacks:T,onCancel:E}){const M=C.find(n=>n.id===N),ie=c.reduce((n,q)=>n+(q.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(Ia,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,o)})})," ",t("buyModal.warningToPurchase",{count:ie})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:c.map(n=>{const q=n.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:n.item.name,children:[n.item.name||t("buyModal.itemFallback"),q>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:t("cartCheckout.qty",{count:q})}):null]}),n.item.creator?e.jsx(ga,{address:n.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(K,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:G(n.priceCredits*q)})]})]})]},n.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:C.map(n=>{const q=n.id===N;return e.jsxs("button",{className:`buy-modal__pack${q?" buy-modal__pack--on":""}`,onClick:()=>I(n.id),children:[e.jsx(K,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:G(n.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(K,{className:"buy-modal__total-ico"}),e.jsx("span",{children:G((M==null?void 0:M.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((M==null?void 0:M.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:E,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:T,children:t("buyModal.buy")})]})]})}function ve(c){if(nt(c))return t("errors.rejected");const o=(c.message??"").toLowerCase();return o.includes("insufficient")?t("cart.error.insufficient",{currency:qa.name}):o.includes("no active listing")||o.includes("your own listing")?t("cart.error.listingChanged"):t("marketCheckout.error.generic")}const ut=12e4;function ht(c){const o=[];return c.unavailable.length&&o.push(t("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&o.push(t("cart.drop.own",{count:c.own.length})),t("cart.drop.removed",{items:o.join(` ${t("cart.drop.and")} `)})}const xe=c=>c.reduce((o,C)=>o+C.priceCredits*C.quantity,0),ce=c=>c.flatMap(o=>Array.from({length:o.quantity},()=>({...o,quantity:1})));function It(){ba({title:t("nav.cart"),noindex:!0});const c=P(a=>a.items),o=P(a=>a.remove),C=P(a=>a.increment),N=P(a=>a.decrement),I=P(a=>a.clear),T=P(a=>a.restore),E=P(a=>a.setFittingOpen),M=Ue(a=>a.items),ie=Ue(a=>a.toggle),{session:n,signIn:q}=fa(),H=et().packs.slice(0,at);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Ze=c.some(a=>a.category!=="emote"),{data:oe}=va({queryKey:["upsell-listings"],queryFn:()=>Aa({first:40}),staleTime:6e4}),{data:f}=xa(n),y=Ca(),Q=pa(),{state:W}=_a(),[ea,$]=j.useState(null),[Ce,J]=j.useState(null),[aa,S]=j.useState(!1),[w,L]=j.useState(null),je=j.useRef(0),[u,g]=j.useState(null),{data:V}=ja(n),{data:le}=Qa(!0),[de,ke]=j.useState(""),D=j.useRef(null),Ne=ka(c),we=a=>Oe(Ne[a.id]),ue=c.filter(we),he=c.length>0&&ue.length===0,ta=ue.reduce((a,s)=>a+s.priceCredits*s.quantity,0),sa=c.reduce((a,s)=>a+s.quantity,0),na=ue.reduce((a,s)=>a+s.quantity,0),Me=w?w.liveTotalCredits:ta,ra=new Set(c.map(a=>a.id)),Se=((oe==null?void 0:oe.items)??[]).filter(a=>!ra.has(a.id)).slice(0,12),ca=new Map(w==null?void 0:w.buyable.map(a=>[a.item.id,a])),Y=(f==null?void 0:f.credits)??0,X=Me*10,qe=le?Je(X,le):0n,Z=be({priceCents:X,priceManaWei:qe,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n}),Pe=Xe(X,qe),Ae=Pe!=null?t("buyModal.manaRate",{mana:Pe.toLocaleString("en",{maximumFractionDigits:2})}):null,ia=Sa;function ee(a){a(),L(null),J(null),$(null)}function oa(){g(null),S(!1)}function Ie(a){const s=xe(a),i=Math.max(0,s-Y),r=H.find(l=>l.credits>=i)??H[H.length-1];ke(r.id),B("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:Y,shortfall:i}),g({phase:"nofunds",lines:a.map(l=>({item:l.item,priceCredits:l.priceCredits,quantity:l.quantity})),shortfall:i}),S(!1)}async function me(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(m=>({...m.item,priceCredits:m.priceCredits})),r=a.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),l=[];let d="authorize",p=!1;g({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[];for(let x=0;x<s.length;x++){const b=s[x];g({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const{credit:v,maxCreditedValue:U}=await Ve(n.identity,b.usdCents,b.trade.id);l.push(v.id),m.push({trade:b.trade,credits:[v],maxCreditedValue:U})}catch(v){if(rt(v)){if(l.length){try{await pe(n.identity,l)}catch(U){O(U,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}Ie(a);return}throw v}}d="submit";const k=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let _=[];if(Ua())try{_=await Ha({purchases:m,buyer:n.address,signer:n.signer,onSigned:k});const b=(await Promise.allSettled(_.map(v=>Ja(v)))).flatMap(v=>v.status==="rejected"?[v.reason]:[]);if(b.length&&!b.some(v=>v instanceof Ya))throw b[0];p=!0}catch(x){if(!(x instanceof Xa))throw x;_=await fe({purchases:m,buyer:n.address,signer:n.signer,onSigned:k})}else _=await fe({purchases:m,buyer:n.address,signer:n.signer});a.forEach(x=>o(x.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"credits",no_crypto_step:p,transaction_hash:_[0]??null}),Wa(y);const h=D.current;D.current=null,g(null),S(!1);const F={items:r,txHash:_[0]??void 0,settled:!0,...h?{creditsAdded:h}:{}};Q("/success",{state:F,replace:!0})}catch(m){if(se(m)||O(m,{flow:"cart_checkout",step:d,cart_size:a.length}),B(se(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:De(m),value_usd:$e(i.reduce((k,_)=>k+_.priceCredits,0)),cart_size:s.length}),l.length){try{await pe(n.identity,l)}catch(k){O(k,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}g({phase:"error",message:ve(m)})}}function Re(a,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 i=D.current;D.current=null,g(null),S(!1);const r={items:a,txHash:s[0]??void 0,settled:!0,...i?{creditsAdded:i}:{}};Q("/success",{state:r,replace:!0})}function Fe(a,s){se(a)||O(a,{flow:s,step:"submit"}),B(se(a)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:De(a)}),g({phase:"error",message:ve(a)}),S(!1)}async function la(a,s){const i=ne(ge.MANAToken,s),r=ne(ge.CreditsManager,s);await Da({auth:{kind:Ga.Allowance,contractAddress:i.address,spenderAddress:r.address,chainId:s},signer:a})}async function da(a){const s=ce(a).reduce((d,p)=>d+p.usdCents,0),i=(V??0n)>0n;let r=le;if(!r&&i)try{r=await y.fetchQuery({queryKey:["mana-rate",Ge.chainId],queryFn:()=>za(Ge.chainId),staleTime:6e4})}catch{r=void 0}const l=r?Je(s,r):0n;return{totalCents:s,manaWei:l}}async function Te(a,s){const i=xe(a),{totalCents:r,manaWei:l}=await da(a),d=be({priceCents:r,priceManaWei:l,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n});if(s&&d.options.some(p=>p.method===s)){if(s==="credits"){me(a);return}const{spender:p,chainId:m}=Ee(s,a);await We(p,m,()=>s==="mana"?void Le(a):void Be(a,r,l));return}if(d.options.some(p=>p.method==="mana"||p.method==="combined")){g({phase:"choose",lines:a,totalCents:r,manaWei:l}),S(!1);return}if(f!=null&&f.credits<i){Ie(a);return}me(a)}function ua(a){return be({priceCents:a.totalCents,priceManaWei:a.manaWei,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n})}const[ye,ae]=j.useState(null);function Ee(a,s){const i=s[0].trade;return{spender:a==="mana"?ne(Pa(i.contract),i.chainId).address:ne(ge.CreditsManager,i.chainId).address,chainId:i.chainId}}async function We(a,s,i){const r=Oa(s,a),l=n?await $a(r,n.address).catch(()=>!0):!0;if(Va(n==null?void 0:n.providerType,l)){S(!1),ae({auth:r,run:i});return}i()}function ha(a){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:i,manaWei:r}=u;if(a==="credits"){me(s);return}const{spender:l,chainId:d}=Ee(a,s);We(l,d,()=>a==="mana"?void Le(s):void Be(s,i,r))}async function Le(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(d=>({...d.item,priceCredits:d.priceCredits})),r=a.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),l=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const d=await La({trades:s.map(p=>p.trade),buyer:n.address,signer:n.signer,onSigned:l});a.forEach(p=>o(p.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"mana",transaction_hash:d[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(r,d)}catch(d){Fe(d,"buy_cart_mana")}}async function Be(a,s,i){if(!n||a.length===0)return;const r=ce(a),l=r.map(h=>({...h.item,priceCredits:h.priceCredits})),d=a.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),p=Ba(r.map(h=>h.usdCents),(f==null?void 0:f.balanceCents)??0),m=p.reduce((h,F)=>h+F,0),k=Ka(Math.max(0,s-m),s,i),_=[];g({phase:"processing",stage:"reserving",step:1,total:r.length});try{const h=[];for(let b=0;b<r.length;b++){const v=p[b];if(v<=0)continue;g({phase:"processing",stage:"reserving",step:b+1,total:r.length});const{credit:U,maxCreditedValue:ya}=await Ve(n.identity,v,r[b].trade.id);_.push(U.id),h.push({trade:r[b].trade,credits:[U],maxCreditedValue:ya})}r.forEach((b,v)=>{p[v]<=0&&h.push({trade:b.trade,credits:[],maxCreditedValue:"0"})}),h[0]={...h[0],maxCreditedValue:(BigInt(h[0].maxCreditedValue)+k).toString()},await la(n.signer,r[0].trade.chainId);const F=()=>g({phase:"processing",stage:"settling",step:r.length,total:r.length});g({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const x=await fe({purchases:h,buyer:n.address,signer:n.signer,onSigned:F});a.forEach(b=>o(b.item.id)),L(null),B("Shop Completed Purchase",{..._e(l),payment_type:"credits_and_mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(d,x)}catch(h){_.length&&(pe(n.identity,_).catch(()=>{}),y.invalidateQueries({queryKey:["usd-balance"]})),Fe(h,"buy_cart_combined")}}async function z(a){if(!n){He({type:"cart-checkout"}),q();return}const s=P.getState().items.filter(we);if(s.length===0)return;$(null),J(null),S(!0);const i=s.reduce((r,l)=>r+l.priceCredits*l.quantity,0);B("Shop Started Checkout",{cart_size:s.length,cart_value_credits:i,cart_value_usd:$e(i),has_sufficient_credits:Y>=i});try{const r=await Za(s,n.address,ia),l=[...r.unavailable,...r.own];if(l.length&&(l.forEach(d=>o(d.id)),J(ht(r))),r.buyable.length===0){$(t("cart.error.noneAvailable")),L(null);return}if(r.orderChanged){L(r),je.current=Date.now();return}await Te(r.buyable,a)}catch(r){O(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),$(ve(r))}finally{S(!1)}}async function Ke(){if(w){if(!n){He({type:"cart-checkout"}),q();return}if(Date.now()-je.current>ut){L(null),J(null),await z();return}$(null),Te(w.buyable)}}async function ma(){if(de){try{sessionStorage.setItem(re,JSON.stringify(P.getState().items))}catch{}S(!0);try{const a=await tt(de,n?{address:n.address,identity:n.identity}:void 0);if(a.url){window.location.href=a.url;return}Q("/credits")}catch(a){try{sessionStorage.removeItem(re)}catch{}O(a,{flow:"cart_buy_credits"}),g({phase:"error",message:t("buyModal.error.creditsCheckout")})}finally{S(!1)}}}const Qe=j.useRef(!1);j.useEffect(()=>{if(!n||Qe.current||!Ra("cart-checkout"))return;Qe.current=!0;const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[n]);const ze=j.useRef(!1);j.useEffect(()=>{if(!(W!=null&&W.resumeCheckout)||ze.current)return;ze.current=!0,D.current=W.creditsAdded??null;try{const s=sessionStorage.getItem(re);if(s){sessionStorage.removeItem(re);const i=JSON.parse(s);Array.isArray(i)&&i.length&&T(i)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[W==null?void 0:W.resumeCheckout]);const R=aa||(u==null?void 0:u.phase)==="processing";return c.length===0&&!u?e.jsx("div",{className:"checkout checkout--empty",children:e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("section",{className:"checkout__panel cart-empty","data-testid":"cart-empty",children:[e.jsx(A,{name:"cart-plus",size:110,className:"cart-empty__icon"}),e.jsxs("div",{className:"cart-empty__text",children:[e.jsx("p",{className:"cart-empty__title",children:t("cart.empty.title")}),e.jsx("p",{className:"cart-empty__body",children:t("cart.empty.body")})]}),e.jsx(te,{className:"cart-empty__cta",to:"/assets",children:t("cart.empty.cta")})]})]})}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>Q(-1),type:"button","aria-label":t("cart.goBack"),children:e.jsx(A,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:t("cart.panelTitle",{count:sa})}),Ze?e.jsxs("button",{className:"checkout__fitting",onClick:()=>E(!0),disabled:R,children:[e.jsx(A,{name:"fitting-room"}),t("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:c.map(a=>{const s=ca.get(a.id),i=s?s.priceCredits:a.priceCredits,r=!!s&&s.priceCredits!==a.priceCredits,l=!a.tokenId,d=a.quantity,p=typeof a.available=="number"&&d>=a.available,m=i*d,k=!!M[a.id],_=Na(a),h=Ne[a.id],F=!Oe(h),x=h==="sold-out"?t("cart.availability.soldOut"):t("cart.availability.unavailable");return e.jsxs("div",{className:`checkout__card${F?" is-unavailable":""}`,children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(te,{className:"checkout__thumb-link",to:_,state:{item:a,tradeId:a.tradeId},"aria-label":a.name,children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null}):a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null,e.jsx("span",{className:"checkout__thumb-check","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("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(te,{className:"checkout__name",to:_,state:{item:a,tradeId:a.tradeId},title:a.name,children:a.name}):e.jsx("div",{className:"checkout__name",title:a.name,children:a.name}),a.creator?e.jsx(wa,{address:a.creator,className:"checkout__creator",linkToProfile:!0}):null,l?e.jsxs("span",{className:"checkout__creator-tag","data-testid":"cart-creator-tag",children:[e.jsx(A,{name:"buy-from-creator",className:"checkout__creator-tag-ico","aria-hidden":!0}),t("cart.creatorTag")]}):null]}),e.jsx("div",{className:"checkout__foot",children:F?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"checkout__unavailable",children:[e.jsx(A,{name:"warning-fill",size:24,className:"checkout__warn","aria-hidden":!0}),x]}),_?e.jsx(te,{className:"checkout__resales",to:_,state:{item:a,tradeId:a.tradeId},children:t("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>N(a.id)),disabled:R||d<=1,"aria-label":t("cart.decreaseQuantity",{name:a.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("span",{className:"checkout__qty",children:d}),e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>C(a.id)),disabled:R||p,"aria-label":t("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("div",{className:"checkout__price",children:[e.jsx(K,{className:"checkout__price-ico"})," ",m,r?e.jsx("span",{className:"checkout__price-was",children:a.priceCredits*d}):null]})]})})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${k?" is-on":""}`,onClick:()=>ie(a),"aria-label":k?t("cart.removeFromFavorites",{name:a.name}):t("cart.addToFavorites",{name:a.name}),title:k?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(A,{name:k?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>ee(()=>o(a.id)),disabled:R,"aria-label":t("cart.remove",{name:a.name}),title:t("cart.removeTitle"),children:e.jsx(A,{name:"trash",size:24})})]})]},a.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>ee(I),disabled:R,children:t("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:t("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:t("cart.totalItems",{count:na})}),e.jsxs("span",{className:"checkout__total-side",children:[e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(K,{className:"checkout__total-ico"})," ",Me]}),Ae&&(V??0n)>0n?e.jsx("span",{className:"checkout__total-rate","data-testid":"cart-mana-rate",children:Ae}):null]})]}),Z.options.length>0||Z.manaShortfall?e.jsx(Ye,{options:Z.options,totalCents:X,shortfall:Z.manaShortfall,creditsLabel:w?t("marketCheckout.confirmPurchase"):t("cart.buyWithCredits"),busy:R||he,onPay:a=>void(w?Ke():z(a))}):e.jsx("button",{className:"checkout__cta",onClick:()=>void(w?Ke():z()),disabled:R||he,children:R?t("cart.working"):w?t("marketCheckout.confirmPurchase"):t("assetCard.buyNow")}),he?e.jsx("p",{className:"muted checkout__msg",children:t("cart.allUnavailable")}):null,n?null:e.jsx("p",{className:"muted checkout__msg",children:t("cart.signInHint")}),w?e.jsx("p",{className:"muted checkout__msg",children:t("cart.priceChanged")}):null,Ce?e.jsx("p",{className:"muted checkout__msg",children:Ce}):null,e.jsx(ct,{message:ea,className:"checkout__msg"})]})]})]})]}),Se.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(Fa,{title:t("cart.youMightAlsoLike"),items:Se})}):null,ye&&n?e.jsx(Ta,{auth:ye.auth,signer:n.signer,title:t("authorizeStep.manaTitle"),name:t("authorizeStep.manaName"),reason:t("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ea,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:a}=ye;ae(null),a()},onCancel:()=>ae(null),onClose:()=>ae(null)}):null,u?e.jsx(ot,{phase:u.phase,balanceCredits:Y,onClose:oa,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:Ma(n==null?void 0:n.providerType),options:u.phase==="choose"?ua(u).options:void 0,onPay:ha,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?xe(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:H,selectedPack:de,onSelectPack:ke,onBuyPacks:()=>void ma(),message:u.phase==="error"?u.message:void 0,onRetry:()=>void z()}):null]})}export{It as Cart};
|
|
1
|
+
import{j as e,r as j,u as pa,a as _a,L as te}from"./react-BW1xvPTF.js";import{t,C as K,A as G,ak as ga,x as ba,ai as P,Q as Ue,u as fa,n as va,a as xa,b as Ca,al as ja,am as ka,I as A,an as Na,z as wa,y as Ma,ao as Oe,j as B,ap as $e,aq as Sa,J as O,e as qa,h as Ve,c as pe,ar as _e,l as se,k as De,o as ne,q as Pa,r as ge,m as Ge,as as Aa}from"./index-TmxHL85j.js";import{P as Ye,m as Xe,W as Ia,c as be,t as Ra,C as Ta,A as Fa,a as Ea,s as He,i as Wa,b as La,d as Ba,e as Ka}from"./CollectionCarousel-CzvvuUUw.js";import{u as Qa}from"./useManaRate-C5mRxzeC.js";import{u as Je,r as za}from"./mana-rate-C8zn6Vfu.js";import{g as Ua,j as Oa,h as $a,n as Va,i as Da,A as Ga}from"./authorizations-Ds7LRLV0.js";import{a as fe}from"./buy-DnSS_Kop.js";import{a as Ha,w as Ja,S as Ya,G as Xa}from"./buy-gasless-9Zn1yAMk.js";import{R as re,r as Za}from"./cart-checkout-BAugwPm6.js";import{u as et,M as at,c as tt}from"./useCreditPacks-Dft_m4Vq.js";import{l as st}from"./loader-logo-BzY9EKdC.js";import{i as nt,a as rt}from"./errors-CG6pp58g.js";import{E as ct}from"./ErrorNotice-BG40E5Ff.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CcRCeIpG.js";import"./sendMetaTransaction-7YAoB-pL.js";const it="https://cdn.decentraland.org/@dcl/shop/0.1.0-30381444187.commit-e5b9f13/assets/buy-error-22UunaPC.png";function ot(c){const{phase:o,balanceCredits:C,onClose:N}=c,I=o==="processing",F=o==="error"?t("cartCheckout.errorTitle"):o==="nofunds"?t("cartCheckout.titleNoFunds"):o==="choose"?t("buyModal.choosePayment"):t("cartCheckout.titleBuy"),E=o==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:I?void 0:N,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${E?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:F}),!I&&e.jsx("button",{className:"buy-modal__x",onClick:N,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:o==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(K,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:G(C)})]})]}),o==="choose"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"cart-checkout__choose-total",children:[e.jsx("span",{children:t("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(K,{className:"buy-modal__balance-ico"}),G(c.totalCredits??0)]})]}),e.jsx(Ye,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const M=Xe(c.totalCents??0,c.totalManaWei??0n);return M!=null?t("buyModal.manaRate",{mana:M.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),o==="processing"&&e.jsx(lt,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),o==="nofunds"&&e.jsx(dt,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:N}),o==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:it,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:t("cartCheckout.errorHeadline")})," ",t("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:N,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:c.onRetry??N,children:t("cartCheckout.tryAgain")})]})]})]})]})}function lt({stage:c,step:o,total:C,isSelfCustody:N}){const I=c==="reserving",F=C>0?Math.min(100,Math.round(o/C*100)):0,E=c==="awaiting-signature"?N?t("buyModal.confirmToContinue"):t("buyModal.completingTransaction"):c==="settling"?t("buyModal.completingTransaction"):t("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:st,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:E}),I?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${F}%`}})}),C>1?e.jsxs("span",{className:"cart-checkout__step",children:[o,"/",C]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function dt({lines:c,shortfallCredits:o,packs:C,selectedPack:N,onSelectPack:I,onBuyPacks:F,onCancel:E}){const M=C.find(n=>n.id===N),ie=c.reduce((n,q)=>n+(q.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsx(Ia,{className:"buy-modal__warning-ico"}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,o)})})," ",t("buyModal.warningToPurchase",{count:ie})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:c.map(n=>{const q=n.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:n.item.name,children:[n.item.name||t("buyModal.itemFallback"),q>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:t("cartCheckout.qty",{count:q})}):null]}),n.item.creator?e.jsx(ga,{address:n.item.creator,className:"buy-modal__asset-creator"}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(K,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:G(n.priceCredits*q)})]})]})]},n.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:C.map(n=>{const q=n.id===N;return e.jsxs("button",{className:`buy-modal__pack${q?" buy-modal__pack--on":""}`,onClick:()=>I(n.id),children:[e.jsx(K,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:G(n.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(K,{className:"buy-modal__total-ico"}),e.jsx("span",{children:G((M==null?void 0:M.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((M==null?void 0:M.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:E,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:F,children:t("buyModal.buy")})]})]})}function ve(c){if(nt(c))return t("errors.rejected");const o=(c.message??"").toLowerCase();return o.includes("insufficient")?t("cart.error.insufficient",{currency:qa.name}):o.includes("no active listing")||o.includes("your own listing")?t("cart.error.listingChanged"):t("marketCheckout.error.generic")}const ut=12e4;function ht(c){const o=[];return c.unavailable.length&&o.push(t("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&o.push(t("cart.drop.own",{count:c.own.length})),t("cart.drop.removed",{items:o.join(` ${t("cart.drop.and")} `)})}const xe=c=>c.reduce((o,C)=>o+C.priceCredits*C.quantity,0),ce=c=>c.flatMap(o=>Array.from({length:o.quantity},()=>({...o,quantity:1})));function It(){ba({title:t("nav.cart"),noindex:!0});const c=P(a=>a.items),o=P(a=>a.remove),C=P(a=>a.increment),N=P(a=>a.decrement),I=P(a=>a.clear),F=P(a=>a.restore),E=P(a=>a.setFittingOpen),M=Ue(a=>a.items),ie=Ue(a=>a.toggle),{session:n,signIn:q}=fa(),H=et().packs.slice(0,at);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Ze=c.some(a=>a.category!=="emote"),{data:oe}=va({queryKey:["upsell-listings"],queryFn:()=>Aa({first:40}),staleTime:6e4}),{data:f}=xa(n),y=Ca(),Q=pa(),{state:W}=_a(),[ea,$]=j.useState(null),[Ce,J]=j.useState(null),[aa,S]=j.useState(!1),[w,L]=j.useState(null),je=j.useRef(0),[u,g]=j.useState(null),{data:V}=ja(n),{data:le}=Qa(!0),[de,ke]=j.useState(""),D=j.useRef(null),Ne=ka(c),we=a=>Oe(Ne[a.id]),ue=c.filter(we),he=c.length>0&&ue.length===0,ta=ue.reduce((a,s)=>a+s.priceCredits*s.quantity,0),sa=c.reduce((a,s)=>a+s.quantity,0),na=ue.reduce((a,s)=>a+s.quantity,0),Me=w?w.liveTotalCredits:ta,ra=new Set(c.map(a=>a.id)),Se=((oe==null?void 0:oe.items)??[]).filter(a=>!ra.has(a.id)).slice(0,12),ca=new Map(w==null?void 0:w.buyable.map(a=>[a.item.id,a])),Y=(f==null?void 0:f.credits)??0,X=Me*10,qe=le?Je(X,le):0n,Z=be({priceCents:X,priceManaWei:qe,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n}),Pe=Xe(X,qe),Ae=Pe!=null?t("buyModal.manaRate",{mana:Pe.toLocaleString("en",{maximumFractionDigits:2})}):null,ia=Sa;function ee(a){a(),L(null),J(null),$(null)}function oa(){g(null),S(!1)}function Ie(a){const s=xe(a),i=Math.max(0,s-Y),r=H.find(l=>l.credits>=i)??H[H.length-1];ke(r.id),B("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:Y,shortfall:i}),g({phase:"nofunds",lines:a.map(l=>({item:l.item,priceCredits:l.priceCredits,quantity:l.quantity})),shortfall:i}),S(!1)}async function me(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(m=>({...m.item,priceCredits:m.priceCredits})),r=a.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),l=[];let d="authorize",p=!1;g({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[];for(let x=0;x<s.length;x++){const b=s[x];g({phase:"processing",stage:"reserving",step:x+1,total:s.length});try{const{credit:v,maxCreditedValue:U}=await Ve(n.identity,b.usdCents,b.trade.id);l.push(v.id),m.push({trade:b.trade,credits:[v],maxCreditedValue:U})}catch(v){if(rt(v)){if(l.length){try{await pe(n.identity,l)}catch(U){O(U,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}Ie(a);return}throw v}}d="submit";const k=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let _=[];if(Ua())try{_=await Ha({purchases:m,buyer:n.address,signer:n.signer,onSigned:k});const b=(await Promise.allSettled(_.map(v=>Ja(v)))).flatMap(v=>v.status==="rejected"?[v.reason]:[]);if(b.length&&!b.some(v=>v instanceof Ya))throw b[0];p=!0}catch(x){if(!(x instanceof Xa))throw x;_=await fe({purchases:m,buyer:n.address,signer:n.signer,onSigned:k})}else _=await fe({purchases:m,buyer:n.address,signer:n.signer});a.forEach(x=>o(x.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"credits",no_crypto_step:p,transaction_hash:_[0]??null}),Wa(y);const h=D.current;D.current=null,g(null),S(!1);const T={items:r,txHash:_[0]??void 0,settled:!0,...h?{creditsAdded:h}:{}};Q("/success",{state:T,replace:!0})}catch(m){if(se(m)||O(m,{flow:"cart_checkout",step:d,cart_size:a.length}),B(se(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:De(m),value_usd:$e(i.reduce((k,_)=>k+_.priceCredits,0)),cart_size:s.length}),l.length){try{await pe(n.identity,l)}catch(k){O(k,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}g({phase:"error",message:ve(m)})}}function Re(a,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 i=D.current;D.current=null,g(null),S(!1);const r={items:a,txHash:s[0]??void 0,settled:!0,...i?{creditsAdded:i}:{}};Q("/success",{state:r,replace:!0})}function Te(a,s){se(a)||O(a,{flow:s,step:"submit"}),B(se(a)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:De(a)}),g({phase:"error",message:ve(a)}),S(!1)}async function la(a,s){const i=ne(ge.MANAToken,s),r=ne(ge.CreditsManager,s);await Da({auth:{kind:Ga.Allowance,contractAddress:i.address,spenderAddress:r.address,chainId:s},signer:a})}async function da(a){const s=ce(a).reduce((d,p)=>d+p.usdCents,0),i=(V??0n)>0n;let r=le;if(!r&&i)try{r=await y.fetchQuery({queryKey:["mana-rate",Ge.chainId],queryFn:()=>za(Ge.chainId),staleTime:6e4})}catch{r=void 0}const l=r?Je(s,r):0n;return{totalCents:s,manaWei:l}}async function Fe(a,s){const i=xe(a),{totalCents:r,manaWei:l}=await da(a),d=be({priceCents:r,priceManaWei:l,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n});if(s&&d.options.some(p=>p.method===s)){if(s==="credits"){me(a);return}const{spender:p,chainId:m}=Ee(s,a);await We(p,m,()=>s==="mana"?void Le(a):void Be(a,r,l));return}if(d.options.some(p=>p.method==="mana"||p.method==="combined")){g({phase:"choose",lines:a,totalCents:r,manaWei:l}),S(!1);return}if(f!=null&&f.credits<i){Ie(a);return}me(a)}function ua(a){return be({priceCents:a.totalCents,priceManaWei:a.manaWei,balanceCents:(f==null?void 0:f.balanceCents)??0,manaBalanceWei:V??0n})}const[ye,ae]=j.useState(null);function Ee(a,s){const i=s[0].trade;return{spender:a==="mana"?ne(Pa(i.contract),i.chainId).address:ne(ge.CreditsManager,i.chainId).address,chainId:i.chainId}}async function We(a,s,i){const r=Oa(s,a),l=n?await $a(r,n.address).catch(()=>!0):!0;if(Va(n==null?void 0:n.providerType,l)){S(!1),ae({auth:r,run:i});return}i()}function ha(a){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:i,manaWei:r}=u;if(a==="credits"){me(s);return}const{spender:l,chainId:d}=Ee(a,s);We(l,d,()=>a==="mana"?void Le(s):void Be(s,i,r))}async function Le(a){if(!n||a.length===0)return;const s=ce(a),i=s.map(d=>({...d.item,priceCredits:d.priceCredits})),r=a.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),l=()=>g({phase:"processing",stage:"settling",step:s.length,total:s.length});g({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const d=await La({trades:s.map(p=>p.trade),buyer:n.address,signer:n.signer,onSigned:l});a.forEach(p=>o(p.item.id)),L(null),B("Shop Completed Purchase",{..._e(i),payment_type:"mana",transaction_hash:d[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(r,d)}catch(d){Te(d,"buy_cart_mana")}}async function Be(a,s,i){if(!n||a.length===0)return;const r=ce(a),l=r.map(h=>({...h.item,priceCredits:h.priceCredits})),d=a.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),p=Ba(r.map(h=>h.usdCents),(f==null?void 0:f.balanceCents)??0),m=p.reduce((h,T)=>h+T,0),k=Ka(Math.max(0,s-m),s,i),_=[];g({phase:"processing",stage:"reserving",step:1,total:r.length});try{const h=[];for(let b=0;b<r.length;b++){const v=p[b];if(v<=0)continue;g({phase:"processing",stage:"reserving",step:b+1,total:r.length});const{credit:U,maxCreditedValue:ya}=await Ve(n.identity,v,r[b].trade.id);_.push(U.id),h.push({trade:r[b].trade,credits:[U],maxCreditedValue:ya})}r.forEach((b,v)=>{p[v]<=0&&h.push({trade:b.trade,credits:[],maxCreditedValue:"0"})}),h[0]={...h[0],maxCreditedValue:(BigInt(h[0].maxCreditedValue)+k).toString()},await la(n.signer,r[0].trade.chainId);const T=()=>g({phase:"processing",stage:"settling",step:r.length,total:r.length});g({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const x=await fe({purchases:h,buyer:n.address,signer:n.signer,onSigned:T});a.forEach(b=>o(b.item.id)),L(null),B("Shop Completed Purchase",{..._e(l),payment_type:"credits_and_mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),Re(d,x)}catch(h){_.length&&(pe(n.identity,_).catch(()=>{}),y.invalidateQueries({queryKey:["usd-balance"]})),Te(h,"buy_cart_combined")}}async function z(a){if(!n){He({type:"cart-checkout"}),q();return}const s=P.getState().items.filter(we);if(s.length===0)return;$(null),J(null),S(!0);const i=s.reduce((r,l)=>r+l.priceCredits*l.quantity,0);B("Shop Started Checkout",{cart_size:s.length,cart_value_credits:i,cart_value_usd:$e(i),has_sufficient_credits:Y>=i});try{const r=await Za(s,n.address,ia),l=[...r.unavailable,...r.own];if(l.length&&(l.forEach(d=>o(d.id)),J(ht(r))),r.buyable.length===0){$(t("cart.error.noneAvailable")),L(null);return}if(r.orderChanged){L(r),je.current=Date.now();return}await Fe(r.buyable,a)}catch(r){O(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),$(ve(r))}finally{S(!1)}}async function Ke(){if(w){if(!n){He({type:"cart-checkout"}),q();return}if(Date.now()-je.current>ut){L(null),J(null),await z();return}$(null),Fe(w.buyable)}}async function ma(){if(de){try{sessionStorage.setItem(re,JSON.stringify(P.getState().items))}catch{}S(!0);try{const a=await tt(de,n?{address:n.address,identity:n.identity}:void 0);if(a.url){window.location.href=a.url;return}Q("/credits")}catch(a){try{sessionStorage.removeItem(re)}catch{}O(a,{flow:"cart_buy_credits"}),g({phase:"error",message:t("buyModal.error.creditsCheckout")})}finally{S(!1)}}}const Qe=j.useRef(!1);j.useEffect(()=>{if(!n||Qe.current||!Ra("cart-checkout"))return;Qe.current=!0;const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[n]);const ze=j.useRef(!1);j.useEffect(()=>{if(!(W!=null&&W.resumeCheckout)||ze.current)return;ze.current=!0,D.current=W.creditsAdded??null;try{const s=sessionStorage.getItem(re);if(s){sessionStorage.removeItem(re);const i=JSON.parse(s);Array.isArray(i)&&i.length&&F(i)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const a=setTimeout(()=>void z(),0);return()=>clearTimeout(a)},[W==null?void 0:W.resumeCheckout]);const R=aa||(u==null?void 0:u.phase)==="processing";return c.length===0&&!u?e.jsx("div",{className:"checkout checkout--empty",children:e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("section",{className:"checkout__panel cart-empty","data-testid":"cart-empty",children:[e.jsx(A,{name:"cart-plus",size:110,className:"cart-empty__icon"}),e.jsxs("div",{className:"cart-empty__text",children:[e.jsx("p",{className:"cart-empty__title",children:t("cart.empty.title")}),e.jsx("p",{className:"cart-empty__body",children:t("cart.empty.body")})]}),e.jsx(te,{className:"cart-empty__cta",to:"/assets",children:t("cart.empty.cta")})]})]})}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>Q(-1),type:"button",children:[e.jsx(A,{name:"arrow-left"}),t("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>Q(-1),type:"button","aria-label":t("cart.goBack"),children:e.jsx(A,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:t("cart.panelTitle",{count:sa})}),Ze?e.jsxs("button",{className:"checkout__fitting",onClick:()=>E(!0),disabled:R,children:[e.jsx(A,{name:"fitting-room"}),t("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:c.map(a=>{const s=ca.get(a.id),i=s?s.priceCredits:a.priceCredits,r=!!s&&s.priceCredits!==a.priceCredits,l=!a.tokenId,d=a.quantity,p=typeof a.available=="number"&&d>=a.available,m=i*d,k=!!M[a.id],_=Na(a),h=Ne[a.id],T=!Oe(h),x=h==="sold-out"?t("cart.availability.soldOut"):t("cart.availability.unavailable");return e.jsxs("div",{className:`checkout__card${T?" is-unavailable":""}`,children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(te,{className:"checkout__thumb-link",to:_,state:{item:a,tradeId:a.tradeId},"aria-label":a.name,children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null}):a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:a.name}):null,e.jsx("span",{className:"checkout__thumb-check","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("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(te,{className:"checkout__name",to:_,state:{item:a,tradeId:a.tradeId},title:a.name,children:a.name}):e.jsx("div",{className:"checkout__name",title:a.name,children:a.name}),a.creator?e.jsx(wa,{address:a.creator,className:"checkout__creator",linkToProfile:!0}):null,l?e.jsxs("span",{className:"checkout__creator-tag","data-testid":"cart-creator-tag",children:[e.jsx(A,{name:"buy-from-creator",className:"checkout__creator-tag-ico","aria-hidden":!0}),t("cart.creatorTag")]}):null]}),e.jsx("div",{className:"checkout__foot",children:T?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"checkout__unavailable",children:[e.jsx(A,{name:"warning-fill",size:24,className:"checkout__warn","aria-hidden":!0}),x]}),_?e.jsx(te,{className:"checkout__resales",to:_,state:{item:a,tradeId:a.tradeId},children:t("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>N(a.id)),disabled:R||d<=1,"aria-label":t("cart.decreaseQuantity",{name:a.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("span",{className:"checkout__qty",children:d}),e.jsx("button",{className:"checkout__step",onClick:()=>ee(()=>C(a.id)),disabled:R||p,"aria-label":t("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("div",{className:"checkout__price",children:[e.jsx(K,{className:"checkout__price-ico"})," ",m,r?e.jsx("span",{className:"checkout__price-was",children:a.priceCredits*d}):null]})]})})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${k?" is-on":""}`,onClick:()=>ie(a),"aria-label":k?t("cart.removeFromFavorites",{name:a.name}):t("cart.addToFavorites",{name:a.name}),title:k?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(A,{name:k?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>ee(()=>o(a.id)),disabled:R,"aria-label":t("cart.remove",{name:a.name}),title:t("cart.removeTitle"),children:e.jsx(A,{name:"trash",size:24})})]})]},a.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>ee(I),disabled:R,children:t("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:t("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:t("cart.totalItems",{count:na})}),e.jsxs("span",{className:"checkout__total-side",children:[e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(K,{className:"checkout__total-ico"})," ",Me]}),Ae&&(V??0n)>0n?e.jsx("span",{className:"checkout__total-rate","data-testid":"cart-mana-rate",children:Ae}):null]})]}),Z.options.length>0||Z.manaShortfall?e.jsx(Ye,{options:Z.options,totalCents:X,shortfall:Z.manaShortfall,creditsLabel:w?t("marketCheckout.confirmPurchase"):t("cart.buyWithCredits"),busy:R||he,onPay:a=>void(w?Ke():z(a))}):e.jsx("button",{className:"checkout__cta",onClick:()=>void(w?Ke():z()),disabled:R||he,children:R?t("cart.working"):w?t("marketCheckout.confirmPurchase"):t("assetCard.buyNow")}),he?e.jsx("p",{className:"muted checkout__msg",children:t("cart.allUnavailable")}):null,n?null:e.jsx("p",{className:"muted checkout__msg",children:t("cart.signInHint")}),w?e.jsx("p",{className:"muted checkout__msg",children:t("cart.priceChanged")}):null,Ce?e.jsx("p",{className:"muted checkout__msg",children:Ce}):null,e.jsx(ct,{message:ea,className:"checkout__msg"})]})]})]})]}),Se.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(Ta,{title:t("cart.youMightAlsoLike"),items:Se})}):null,ye&&n?e.jsx(Fa,{auth:ye.auth,signer:n.signer,title:t("authorizeStep.manaTitle"),name:t("authorizeStep.manaName"),reason:t("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ea,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:a}=ye;ae(null),a()},onCancel:()=>ae(null),onClose:()=>ae(null)}):null,u?e.jsx(ot,{phase:u.phase,balanceCredits:Y,onClose:oa,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:Ma(n==null?void 0:n.providerType),options:u.phase==="choose"?ua(u).options:void 0,onPay:ha,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?xe(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:H,selectedPack:de,onSelectPack:ke,onBuyPacks:()=>void ma(),message:u.phase==="error"?u.message:void 0,onRetry:()=>void z()}):null]})}export{It as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{V as N,W as U,X as w,Y as z,Z as o,$ as E,a0 as c,a1 as I,a2 as g,a3 as D,R}from"./index-
|
|
1
|
+
import{V as N,W as U,X as w,Y as z,Z as o,$ as E,a0 as c,a1 as I,a2 as g,a3 as D,R}from"./index-TmxHL85j.js";import{r as W,j as v}from"./react-BW1xvPTF.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,V=R(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as O,
|
|
1
|
+
import{j as e,r as p,d as O,u as Q}from"./react-BW1xvPTF.js";import{K as N,s as v,ay as Y,az as E,I as Z,t,m as V,J as W,n as X,x as ee,M as ae,aA as te,e as re,aB as se}from"./index-TmxHL85j.js";import{E as oe}from"./ErrorNotice-BG40E5Ff.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DE3QnCpW.js";import{u as de}from"./useStore-CV_90SkB.js";import{d as F,a as me,F as pe,e as ue,S as R,b as ge}from"./categories-BI9AXlDF.js";import{L as xe}from"./LoadMore-DTUpuDyu.js";import{u as he}from"./useInfiniteGrid-pff93KiW.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as w}from"./react-
|
|
1
|
+
import{j as e,r as w}from"./react-BW1xvPTF.js";import{s as l,K as s,t as f,C as R,A as j,aO as C,e as Q,R as D,I as K,J as O,o as $,r as _,q as U,aP as B,M as G}from"./index-TmxHL85j.js";import{s as H,i as P,A as T,a as L,r as J,m as V,e as Y}from"./authorizations-Ds7LRLV0.js";import{i as Z}from"./errors-CG6pp58g.js";import{E as q}from"./ErrorNotice-BG40E5Ff.js";import{b as X}from"./buy-DnSS_Kop.js";import{d as ee,f as te}from"./trade-encoding-CcRCeIpG.js";import{s as ne,M as ae,E as re}from"./sendMetaTransaction-7YAoB-pL.js";import{I as se,C as oe}from"./ethers-CtVvB8eG.js";const I="shop:resume_after_signin",ie=900*1e3;function Oe(n){try{sessionStorage.setItem(I,JSON.stringify({...n,at:Date.now()}))}catch{}}function Ue(n){let t;try{t=sessionStorage.getItem(I)}catch{return null}if(!t)return null;try{sessionStorage.removeItem(I)}catch{}let a;try{a=JSON.parse(t)}catch{return null}return!a||a.type!==n||typeof a.at!="number"||Date.now()-a.at>ie?null:a.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:a.path}}function ce(n,t){return(n+t-1n)/t}function le(n,t,a){return n<=0||t<=0?0n:n>=t?a:ce(a*BigInt(n),BigInt(t))}function Ge(n){var m,x,y;const t=Number.isFinite(n.priceCents)?Math.max(0,Math.trunc(n.priceCents)):0,a=Number.isFinite(n.balanceCents)?Math.max(0,Math.trunc(n.balanceCents)):0,r=n.priceManaWei>0n?n.priceManaWei:0n,i=n.manaBalanceWei>0n?n.manaBalanceWei:0n;if(t<=0)return{options:[],preferred:null,manaShortfall:null};const o=[];if(a>=t&&o.push({method:"credits",creditsCents:t,manaWei:0n}),r>0n&&a>0&&a<t){const c=t-a,g=le(c,t,r);i>=g&&o.push({method:"combined",creditsCents:a,manaWei:g})}r>0n&&i>=r&&o.push({method:"mana",creditsCents:0,manaWei:r});const d=((m=o.find(c=>c.method==="credits"))==null?void 0:m.method)??((x=o.find(c=>c.method==="combined"))==null?void 0:x.method)??((y=o.find(c=>c.method==="mana"))==null?void 0:y.method)??null,b=!o.some(c=>c.method==="mana"||c.method==="combined")&&r>0n&&i>0n?{manaWei:i,manaCents:de(i,t,r),priceCents:t}:null;return{options:o,preferred:d,manaShortfall:b}}function de(n,t,a){return Number(n*BigInt(t)/a)}function He(n,t){let a=Number.isFinite(t)?Math.max(0,Math.trunc(t)):0;return n.map(r=>{const i=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0,o=Math.min(i,a);return a-=o,o})}function k(n){return Number.isFinite(n)?Math.max(0,n)/10:0}function Je(n,t){return n.options.find(a=>a.method===t)??null}function Ve(n,t){if(!Number.isFinite(n)||n<=0||t<=0n)return null;const a=n/10;return Number(t)/1e18/a}const N="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ue=l.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -109,7 +109,7 @@ import{j as e,r as w}from"./react-B36MyIP_.js";import{n as l,K as s,t as f,k as
|
|
|
109
109
|
line-height: 1.4;
|
|
110
110
|
color: ${s.colors.muted};
|
|
111
111
|
text-align: center;
|
|
112
|
-
`;function Ye({options:n,totalCents:t,onPay:a,busy:r=!1,rateNote:
|
|
112
|
+
`;function Ye({options:n,totalCents:t,onPay:a,busy:r=!1,rateNote:i,creditsLabel:o,shortfall:d}){return e.jsxs(ue,{children:[n.map(u=>u.method==="credits"?e.jsxs(he,{type:"button","data-testid":"pay-with-credits",onClick:()=>a("credits"),disabled:r,children:[e.jsx("span",{children:o??f("buyModal.buy")}),e.jsxs(M,{children:[e.jsx(R,{}),e.jsx("span",{children:j(k(u.creditsCents))})]})]},"credits"):u.method==="mana"?e.jsxs(W,{type:"button","data-testid":"pay-with-mana",onClick:()=>a("mana"),disabled:r,children:[e.jsx("span",{children:f("buyModal.buyWithMana")}),e.jsxs(M,{children:[e.jsx(z,{children:e.jsx("img",{src:N,alt:"","aria-hidden":!0})}),e.jsx("span",{children:C(u.manaWei)})]})]},"mana"):e.jsxs(W,{type:"button","data-testid":"pay-with-combined",onClick:()=>a("combined"),disabled:r,children:[e.jsx("span",{children:f("buyModal.buyWith")}),e.jsxs(M,{children:[e.jsx(R,{}),e.jsx("span",{children:j(k(u.creditsCents))}),e.jsx(fe,{children:"+"}),e.jsx(z,{children:e.jsx("img",{src:N,alt:"","aria-hidden":!0})}),e.jsx("span",{children:C(u.manaWei)}),e.jsx(pe,{children:"MANA"})]})]},"combined")),d?e.jsxs(e.Fragment,{children:[e.jsxs(W,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[e.jsx("span",{children:f("buyModal.buyWithMana")}),e.jsxs(M,{children:[e.jsx(z,{children:e.jsx("img",{src:N,alt:"","aria-hidden":!0})}),e.jsx("span",{children:C(d.manaWei)})]})]},"mana-short"),e.jsx(me,{"data-testid":"mana-shortfall-note",children:f("buyModal.manaWorth",{mana:C(d.manaWei),credits:j(k(d.manaCents)),price:j(k(d.priceCents)),currency:Q.name})})]}):null,i?e.jsx(xe,{"data-testid":"mana-rate-note",children:i}):null,e.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:t})]})}function Ze(n,t){const a=(r,...i)=>void n.invalidateQueries({queryKey:t?[r,...i]:[r]});n.invalidateQueries({queryKey:["usd-balance"]}),n.invalidateQueries({queryKey:["detail-trade"]}),n.invalidateQueries({queryKey:["shop-item"]}),a("owned-token",t==null?void 0:t.contractAddress,t==null?void 0:t.tokenId),a("public-token",t==null?void 0:t.contractAddress,t==null?void 0:t.tokenId),a("item-resales",t==null?void 0:t.contractAddress,t==null?void 0:t.itemId),n.invalidateQueries({queryKey:["shop-items"]}),n.invalidateQueries({queryKey:["catalog-items"]}),n.invalidateQueries({queryKey:["overview-listings"]}),n.invalidateQueries({queryKey:["upsell-listings"]}),n.invalidateQueries({queryKey:["my-assets"]}),n.invalidateQueries({queryKey:["purchases"]}),n.invalidateQueries({queryKey:["owned-item-count"]})}const ge=D`
|
|
113
113
|
to { transform: rotate(360deg); }
|
|
114
114
|
`,be=l.div`
|
|
115
115
|
position: fixed;
|
|
@@ -289,4 +289,4 @@ import{j as e,r as w}from"./react-B36MyIP_.js";import{n as l,K as s,t as f,k as
|
|
|
289
289
|
@media (prefers-reduced-motion: reduce) {
|
|
290
290
|
animation: none;
|
|
291
291
|
}
|
|
292
|
-
`;function qe({auth:n,signer:t,title:a,reason:r,name:
|
|
292
|
+
`;function qe({auth:n,signer:t,title:a,reason:r,name:i,image:o,icon:d,onAuthorized:u,onCancel:b,onClose:m}){const[x,y]=w.useState(!1),[c,g]=w.useState(null);async function v(){y(!0),g(null);try{await H({auth:n,signer:t,active:!0}),u()}catch(h){Z(h)?g(f("authorizeStep.errorRejected")):(O(h,{flow:"authorize_step",kind:n.kind}),g(f("authorizeStep.errorGeneric"))),y(!1)}}return e.jsx(be,{onClick:x?void 0:m,role:"presentation",children:e.jsxs(ye,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":a,children:[e.jsxs(we,{children:[e.jsx(ve,{children:a}),e.jsx(je,{onClick:m,disabled:x,"aria-label":f("authorizeStep.close"),children:e.jsx(K,{name:"close",className:"ico"})})]}),e.jsxs(Ce,{"data-testid":"authorize-step-row",children:[e.jsx(ke,{children:o?e.jsx("img",{src:o,alt:""}):d}),e.jsxs(Me,{children:[e.jsx($e,{title:i,children:i}),e.jsx(Ae,{children:r})]})]}),e.jsx(Ne,{children:f("authorizeStep.note")}),e.jsx(q,{message:c}),e.jsxs(We,{children:[e.jsx(ze,{type:"button",onClick:b,disabled:x,children:f("authorizeStep.cancel")}),e.jsx(_e,{type:"button","data-testid":"authorize-step-action",onClick:()=>void v(),disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(Ie,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function Xe(n){const[t]=await Se({...n,trades:[n.trade]});return t}async function Se(n){const{trades:t,buyer:a,signer:r,onSigned:i}=n;if(t.length===0)throw new Error("No items to buy");const o=new Map;for(const u of t){const b=`${u.chainId}:${u.contract.toLowerCase()}`,m=o.get(b);m?m.push(u):o.set(b,[u])}const d=[];for(const u of o.values())d.push(await Ee({trades:u,buyer:a,signer:r,onSigned:i}));return d}async function Ee(n){const{trades:t,buyer:a,signer:r,onSigned:i}=n,o=t[0],d=$(U(o.contract),o.chainId),u=$(_.MANAToken,o.chainId);await P({auth:{kind:T.Allowance,contractAddress:u.address,spenderAddress:d.address,chainId:o.chainId},signer:r});const b=t.map(c=>ee(c,a));if(L.enabled)try{const c=new se(d.abi).encodeFunctionData("accept",[b]),g=J(),v=V(r.provider,g),h=await ne(v,g,c,d,{serverURL:L.relayerUrl});return i==null||i(),await g.waitForTransaction(h,1,12e4),h}catch(c){if(c instanceof ae&&c.code===re.USER_DENIED)throw c;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",c)}await Y(r.provider,o.chainId);const x=await new oe(d.address,d.abi,r).accept(b,te(o.chainId));return i==null||i(),(await x.wait()).transactionHash}async function et(n){const{trade:t,buyer:a,signer:r,credits:i,manaGapWei:o}=n;if(i.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(o<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const d=$(_.MANAToken,t.chainId),u=$(_.CreditsManager,t.chainId);await P({auth:{kind:T.Allowance,contractAddress:d.address,spenderAddress:u.address,chainId:t.chainId},signer:r});const m=(i.reduce((x,y)=>x+BigInt(y.availableAmount),0n)+o).toString();return X({trade:t,buyer:a,signer:r,credits:i,maxCreditedValue:m})}function tt({className:n}){return e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:n,children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"#691fa9",strokeWidth:"1.8"}),e.jsx("path",{d:"M12 7v6",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"16.5",r:"1.1",fill:"#691fa9"})]})}function nt({title:n,items:t,onViewAll:a}){const r=w.useRef(null),[i,o]=w.useState(1),[d,u]=w.useState(0),[b,m]=w.useState(!0),[x,y]=w.useState(!1),c=w.useCallback(()=>{const h=r.current;if(!h)return;const{scrollLeft:p,scrollWidth:S,clientWidth:A}=h,E=Math.max(1,Math.ceil(S/A));o(E),u(Math.min(E-1,Math.round(p/A))),m(p<=1),y(p+A>=S-1)},[]);if(w.useEffect(()=>{c();const h=r.current;if(h)return h.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{h.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,t.length]),t.length===0)return null;function g(h){const p=r.current;p&&p.scrollBy({left:h*p.clientWidth,behavior:"smooth"})}function v(h){const p=r.current;p&&p.scrollTo({left:h*p.clientWidth,behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:n}),a?e.jsxs("button",{className:"collection-carousel__viewall",onClick:a,children:[f("collectionCarousel.viewAll"),e.jsx(K,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),e.jsxs("div",{className:"collection-carousel__viewport",children:[e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>g(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:b,children:e.jsx("img",{src:B,alt:"","aria-hidden":!0})}),e.jsx("div",{className:"collection-carousel__track",ref:r,children:t.map(h=>e.jsx(G,{item:h},h.id))}),e.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>g(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:x,children:e.jsx("img",{src:B,alt:"","aria-hidden":!0})})]}),i>1?e.jsx("div",{className:"collection-carousel__dots","aria-label":f("collectionCarousel.pages"),children:Array.from({length:i}).map((h,p)=>e.jsx("button",{className:`collection-carousel__dot${p===d?" is-active":""}`,"aria-label":f("collectionCarousel.goToPage",{page:p+1}),"aria-current":p===d?"true":void 0,onClick:()=>v(p)},p))}):null]})}export{qe as A,nt as C,Ye as P,tt as W,N as a,Se as b,Ge as c,He as d,le as e,k as f,Xe as g,Je as h,Ze as i,et as j,Ve as m,Oe as s,Ue as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./sentry-
|
|
1
|
+
import{p as t}from"./sentry-BV_ZSgtd.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
|