@dcl/shop 0.1.0-29869835587.commit-e6e6578 → 0.1.0-29920979542.commit-4d76953
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/{AnimatedBackground-BvysF8a0.js → AnimatedBackground-CKOyKuq9.js} +1 -1
- package/assets/Assets-ByJM1y5V.js +758 -0
- package/assets/Assets.styles-DD1YIA0w.js +503 -0
- package/assets/Cart-gPQahIus.js +3 -0
- package/assets/{CircularProgress-Bf7cTa84.js → CircularProgress-CtItbytk.js} +5 -5
- package/assets/{Collection-BFUSn0Z_.js → Collection-CLdWIwei.js} +1 -1
- package/assets/{CollectionCarousel-BaK4BZqg.js → CollectionCarousel-B_IpHIiN.js} +1 -1
- package/assets/{ConstantsUtil-CJUlyS7R.js → ConstantsUtil-CPwpahR3.js} +1 -1
- package/assets/{ContentClient-B6BvDsXj.js → ContentClient-BjQkITL0.js} +1 -1
- package/assets/{Creator-CTfg9WAL.js → Creator-VHIhb2gU.js} +1 -1
- package/assets/{CssVarsProvider-DQXUaIP8.js → CssVarsProvider-jpijQ72F.js} +1 -1
- package/assets/{DeploymentBuilder-Cp9K3LCu.js → DeploymentBuilder-D-b1kMax.js} +1 -1
- package/assets/{ErrorNotice-C7soUjRV.js → ErrorNotice-DDr3KjIH.js} +1 -1
- package/assets/{ExchangeController-H99cRhIr.js → ExchangeController-Co5yzjlz.js} +1 -1
- package/assets/GetCredits-BpKdDGUc.js +1 -0
- package/assets/{HelpersUtil-CN9OoRaT.js → HelpersUtil-BcUQ676Q.js} +1 -1
- package/assets/ImportListings-B47G6K7L.js +5 -0
- package/assets/ItemDetail-BOp9RNpW.js +78 -0
- package/assets/{LoadMore-QYabEF53.js → LoadMore-kFcJ8c6R.js} +1 -1
- package/assets/MarketCheckout-CS9k9P56.js +3 -0
- package/assets/MyAssets-ag2xjktG.js +258 -0
- package/assets/{MyFavorites-CCbFgdqL.js → MyFavorites-DjUSaIK2.js} +1 -1
- package/assets/MyPurchases-CzDlMrSh.js +200 -0
- package/assets/{NetworkUtil-Xp0fNa8X.js → NetworkUtil-CM7JZPbs.js} +1 -1
- package/assets/{NotFound-ViHzr3Nr.js → NotFound-Bvrv72pX.js} +1 -1
- package/assets/PrimaryListModal-Dcjz3ZJl.js +1 -0
- package/assets/{StoreSettings-BnHjda9z.js → StoreSettings-Cin3qrlR.js} +5 -5
- package/assets/{Success-CbfD54bz.js → Success-nfqeCH24.js} +2 -2
- package/assets/{SwapController-Tfj7j5wZ.js → SwapController-CU_5jEa7.js} +1 -1
- package/assets/Tooltip-zQgqv_WS.js +48 -0
- package/assets/{TradeService-kxdTGO_i.js → TradeService-_0nAkSNj.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-BWjqHbac.js → W3MFrameProviderSingleton-MS8QbMhJ.js} +3 -3
- package/assets/{WebCryptoP256-8HU24K3x.js → WebCryptoP256-CPTxXHRL.js} +1 -1
- package/assets/{basic-DX-B5_bS.js → basic-Tf3II1zc.js} +1 -1
- package/assets/biconomy-DZCRr_z3.js +1 -0
- package/assets/{browser-9oFjBwrz.js → browser-7Z6Tx7yC.js} +1 -1
- package/assets/{browser-ponyfill-DMgE6PM5.js → browser-ponyfill-C_hn4Jen.js} +1 -1
- package/assets/browser-ponyfill-iWQHRc9C.js +1 -0
- package/assets/buy-B9BIW0Jt.js +1 -0
- package/assets/buy-gasless-DbZJNUIF.js +1 -0
- package/assets/{cart-checkout-C3WNM4cy.js → cart-checkout-B7LsaJk_.js} +1 -1
- package/assets/{categories-DQ55lr2p.js → categories-BltWZ-Er.js} +33 -33
- package/assets/{ccip-CYEnvd4I.js → ccip-Cc36BWjI.js} +1 -1
- package/assets/ccip-Do2tH0oQ.js +1 -0
- package/assets/{chains-CpxWadaj.js → chains-DOpzCPsr.js} +1 -1
- package/assets/collection-D7CncqdI.js +1 -0
- package/assets/{common-l22vMua4.js → common-BO9A6Obt.js} +1 -1
- package/assets/controller-DCaEQPE3.js +2 -0
- package/assets/{core-BtRDOtev.js → core-_W1O6dAM.js} +4 -4
- package/assets/{custom-DiiPEfeO.js → custom-BjaMQzvQ.js} +1 -1
- package/assets/{data-capture-BFGedRFL.js → data-capture-Dpsgkm1n.js} +1 -1
- package/assets/decimals-8h3d0d0Q.js +1 -0
- package/assets/decimals-z4vOxece.js +1 -0
- package/assets/detectExtension-Cvy4AYwr.js +1 -0
- package/assets/{email-D8YhsjSC.js → email-BIl3hlZ2.js} +1 -1
- package/assets/{embedded-wallet-CIVu6rdk.js → embedded-wallet-CHCE_nfA.js} +1 -1
- package/assets/emotion-styled.browser.esm-DP-xjC5M.js +1 -0
- package/assets/engine-CbJiHKp8.js +1 -0
- package/assets/{errors-BLIsDEoc.js → errors-BrsnEff4.js} +1 -1
- package/assets/estimate-l1-fee-DEmTi_Xz.js +1 -0
- package/assets/eth_estimateGas-BhQqpdnq.js +1 -0
- package/assets/eth_getStorageAt-CqeWdstl.js +1 -0
- package/assets/eth_getTransactionCount-Ca9PbmYY.js +1 -0
- package/assets/eth_sendRawTransaction-DPdnXbFR.js +1 -0
- package/assets/{ethereum-CkPyqOMA.js → ethereum-C3MAoMFC.js} +1 -1
- package/assets/{ethers-BeFqf2KO.js → ethers-CeDRuWE-.js} +1 -1
- package/assets/execute-2c6JVbQ7.js +2 -0
- package/assets/extractIPFS-HvQvYdM-.js +1 -0
- package/assets/{features-CFz8G3yF.js → features-CxUBJMFm.js} +1 -1
- package/assets/fetchTokenMetadata-DS7xbFh8.js +2 -0
- package/assets/{fortmatic-DhmlcDbL.js → fortmatic-udOxQk4J.js} +1 -1
- package/assets/get-bytecode-mfFuNYuc.js +1 -0
- package/assets/get-ecosystem-wallet-info-CpGKVIMs.js +1 -0
- package/assets/getBalance-DVC-Vuqr.js +2 -0
- package/assets/getInstalledModules-BNHlcIGs.js +1 -0
- package/assets/getNFT-CSbrXFvE.js +2 -0
- package/assets/getNFT-qJLfFykV.js +1 -0
- package/assets/{getOverlayAlpha-B_CoLTSj.js → getOverlayAlpha-DOBThdqC.js} +1 -1
- package/assets/{hashTypedData-DHR5yJit.js → hashTypedData-B4_iMbvS.js} +1 -1
- package/assets/{hashTypedData-BYNsvxyc.js → hashTypedData-dhsewv5B.js} +1 -1
- package/assets/import-C5j6Wx_d.js +1 -0
- package/assets/in-app-1Ryel-eO.js +1 -0
- package/assets/in-app-wallet-calls-CffLwIeA.js +1 -0
- package/assets/{index-CaHcCfyv.js → index-4eD2NdIO.js} +1 -1
- package/assets/index-6RadCnK_.js +2 -0
- package/assets/{index-CwWLPHI8.js → index-8mbANljx.js} +1 -1
- package/assets/index-BA2L6eSl.css +1 -0
- package/assets/{index-BDfpUFpd.js → index-BOwlzThi.js} +1 -1
- package/assets/{index-Cr7q_wI-.js → index-BdfhcS1O.js} +1 -1
- package/assets/{index-DJsdR_Dh.js → index-BmVq_L-1.js} +1 -1
- package/assets/{index-DkfyzgR8.js → index-BoYovC-T.js} +1 -1
- package/assets/{index-QMzB_9kT.js → index-BpbWCyB4.js} +1 -1
- package/assets/index-BsWlzlq1.js +4 -0
- package/assets/index-BsYYLNpm.js +1 -0
- package/assets/{index-CcJuo_B4.js → index-BukPqvyW.js} +1 -1
- package/assets/{index-PGZV0u8x.js → index-Bv7ES646.js} +1 -1
- package/assets/{index-DfnBxBKK.js → index-C-5O3A8t.js} +2 -2
- package/assets/{index-CN5ZLDnc.js → index-C-P3yFpA.js} +1 -1
- package/assets/index-C-zT6j6Q.js +2 -0
- package/assets/{index-FUu8bz4c.js → index-C1RUJcK5.js} +4 -4
- package/assets/{index-BtmcJRGy.js → index-C8ZENK8t.js} +1 -1
- package/assets/{index-BmxotHif.js → index-CABKIgjm.js} +1 -1
- package/assets/{index-pbhVNuOA.js → index-CAp_8XyK.js} +1 -1
- package/assets/{index--JSSHFMQ.js → index-CFkKMhmf.js} +1 -1
- package/assets/{index-BCGZozX2.js → index-CGKFKFa5.js} +1 -1
- package/assets/{index-Cuf2In7m.js → index-CGtI8pSN.js} +1 -1
- package/assets/{index-CTwiT5J0.js → index-CHTy8tIL.js} +1 -1
- package/assets/{index-g3sxw2b2.js → index-COJ-kKXu.js} +2 -2
- package/assets/{index-DGOaB47n.js → index-CQbgtHPx.js} +1 -1
- package/assets/{index-Do7lLz-O.js → index-C_P8UXnh.js} +1 -1
- package/assets/{index-goSkKmOv.js → index-C_wB7Cn-.js} +1 -1
- package/assets/{index-Bk6ayCIs.js → index-CjTTlJEo.js} +1 -1
- package/assets/{index-CtzfdSwK.js → index-Co247DcD.js} +1 -1
- package/assets/{index-B3vzzuVP.js → index-CpetmNFi.js} +1 -1
- package/assets/{index-Dp3Py-Ws.js → index-Cq0eRfqs.js} +1 -1
- package/assets/{index-BMFRmVon.js → index-CtUSW-Bf.js} +1 -1
- package/assets/{index-CXYokVDz.js → index-CvPKxvVT.js} +1 -1
- package/assets/{index-tKIgdudq.js → index-CvUlVzEh.js} +1 -1
- package/assets/index-Cw_zTgKJ.js +289 -0
- package/assets/{index-dYP5cvK2.js → index-Cx_FuvLh.js} +1 -1
- package/assets/{index-fOZ3JG1l.js → index-D7-fYmTC.js} +1 -1
- package/assets/{index-Y6b_vUQr.js → index-DDH_k4kE.js} +1 -1
- package/assets/{index-Cuq6iGY1.js → index-DDcyCRGs.js} +1 -1
- package/assets/{index-B4p2eLga.js → index-DEDR_sJL.js} +1 -1
- package/assets/{index-BfnFZQqu.js → index-DJVoIGkn.js} +1 -1
- package/assets/{index-07n_zhYq.js → index-DJZlClFe.js} +1 -1
- package/assets/{index-Cmi7sq59.js → index-DNI-bcwo.js} +1 -1
- package/assets/{index-BSjx8-a9.js → index-DPhmZ0Is.js} +1 -1
- package/assets/{index-CdfmzGmf.js → index-DZ7nTG5K.js} +1 -1
- package/assets/index-DeN7zJP6.js +2 -0
- package/assets/{index-2yTqM9xZ.js → index-DhSzX-CI.js} +1 -1
- package/assets/{index-CWuMb79R.js → index-DhoYZdLQ.js} +3 -3
- package/assets/{index-IqrjnIQ9.js → index-Dj-dQr5B.js} +1 -1
- package/assets/{index-BQwZ_U1w.js → index-Dnt0S0mL.js} +1 -1
- package/assets/{index-Da6whmyR.js → index-DobQjFvC.js} +1 -1
- package/assets/{index-C7SiFPEi.js → index-Drt6Trho.js} +1 -1
- package/assets/{index-CI-AD5iw.js → index-DtQgf-Kz.js} +1 -1
- package/assets/{index-BufR0bxC.js → index-LAd_iywb.js} +1 -1
- package/assets/{index-BuMOiAUw.js → index-LE62Wpkl.js} +1 -1
- package/assets/{index-mfpj9mGL.js → index-QNpfh38n.js} +1 -1
- package/assets/index-SIMFr-pa.js +3 -0
- package/assets/{index-C7VPGrdO.js → index-ULH0loBs.js} +1 -1
- package/assets/{index-Cv6TsksD.js → index-VGkdjss0.js} +1 -1
- package/assets/{index-BDRB8FDm.js → index-dlW_0FAj.js} +1 -1
- package/assets/{index-htvE856q.js → index-fBrY7bRL.js} +1 -1
- package/assets/{index-B4OkjZ5Z.js → index-nWE7w6GR.js} +3 -3
- package/assets/{index-gvpjFbR1.js → index-yxsQFb8G.js} +1 -1
- package/assets/{index-C_jKIil3.js → index-zY0h-QLU.js} +1 -1
- package/assets/{index.es-BsTkmkjS.js → index.es-BqINDpai.js} +1 -1
- package/assets/{index.es-Dvmu0NoU.js → index.es-DT0e-8F6.js} +4 -4
- package/assets/index.es-aQzlORue.js +1 -0
- package/assets/linkAccount-Coo42zCf.js +1 -0
- package/assets/loader-logo-BzY9EKdC.js +1 -0
- package/assets/{localBatchGatewayRequest-Cej95COc.js → localBatchGatewayRequest-CW07fVpY.js} +1 -1
- package/assets/{mana-rate-Disk-ReT.js → mana-rate-zpYtmb1D.js} +1 -1
- package/assets/{native-BMBZUPnx.js → native-0dhyeu0o.js} +1 -1
- package/assets/{networks-Dapm2cWP.js → networks-h5NQDWsI.js} +1 -1
- package/assets/{onramp-DLQLHSLI.js → onramp-BX2NU_qB.js} +1 -1
- package/assets/openzeppelin-PtKZTHIi.js +1 -0
- package/assets/ownerOf-DZ5adWxQ.js +1 -0
- package/assets/parseNft-PrcFp1dy.js +2 -0
- package/assets/{parseSignature-BUx9b-zW.js → parseSignature-773UBBmK.js} +14 -14
- package/assets/{parseSignature-O3FZfUUc.js → parseSignature-CCoh-bOo.js} +1 -1
- package/assets/passkeys-BpPvCZon.js +1 -0
- package/assets/{pay-with-exchange-DaiVhZAg.js → pay-with-exchange-gDj4lADp.js} +1 -1
- package/assets/prepare-contract-call-C3igYCn_.js +26 -0
- package/assets/{qr-overlay-CGmkZvV0.js → qr-overlay-DtSlNNS5.js} +3 -3
- package/assets/{react-C51i12iP.js → react-BMZSDQJw.js} +1 -1
- package/assets/{receive-DVL3YCyE.js → receive-DSZFrYHX.js} +1 -1
- package/assets/resolveImplementation-CbU1L1Fc.js +1 -0
- package/assets/{rpc-q1fg-PaK.js → rpc-BDqeZL2i.js} +2 -2
- package/assets/{secp256k1-Dj-unqH_.js → secp256k1-BZe2znzk.js} +1 -1
- package/assets/secp256k1-CknJ3w21.js +1 -0
- package/assets/{secp256k1-DT5nTJQH.js → secp256k1-pNAGLswQ.js} +1 -1
- package/assets/{send-CjhoocaG.js → send-DRd_OEaR.js} +1 -1
- package/assets/send-batch-transaction-D7eoe7U7.js +1 -0
- package/assets/send-eip712-transaction-fOYbA_CA.js +2 -0
- package/assets/send-gasless-transaction-Cxhl4UgI.js +2 -0
- package/assets/send-transaction-BoSey3h6.js +2 -0
- package/assets/{sendRawTransaction-CxX-WJOv.js → sendRawTransaction-2HzfqXtJ.js} +3 -3
- package/assets/{sentry-DKBoGDXH.js → sentry-8SzFotJj.js} +1 -1
- package/assets/{serializeTransaction-KtBgxNjB.js → serializeTransaction-DehzIoon.js} +1 -1
- package/assets/session-proposal-CXtYJ600.js +1 -0
- package/assets/session-request-Bzoc3aWY.js +2 -0
- package/assets/sha256-CDuVPJMW.js +1 -0
- package/assets/signing-BuFUwBsg.js +5 -0
- package/assets/{socials-BqxUUXtR.js → socials-DzFO5cs6.js} +1 -1
- package/assets/{swaps-EDZta6zk.js → swaps-DDj52bDn.js} +1 -1
- package/assets/thirdweb-CLT7AbaR.js +27 -0
- package/assets/to-serializable-transaction-3rHBxT_2.js +2 -0
- package/assets/totalSupply-qMyfSB-2.js +1 -0
- package/assets/transaction-DiMmwD2W.js +1 -0
- package/assets/transactionReceipt-D2-apwad.js +1 -0
- package/assets/{transactions-CGvL3Aj1.js → transactions-BzNf4QDf.js} +1 -1
- package/assets/types-DC0Zmj1B.js +1 -0
- package/assets/useCreditPacks-CCExEWAo.js +1 -0
- package/assets/useInfiniteGrid-CpG_Ao97.js +1 -0
- package/assets/{useStore-CQIJvFZA.js → useStore-IaDRl00u.js} +2 -2
- package/assets/useTheme-Y_Ojpcr-.js +1 -0
- package/assets/useTheme-tg-omw8T.js +1 -0
- package/assets/{utils-CBfcEx8F.js → utils-DLyVQGg1.js} +1 -1
- package/assets/{verifyHash-2hJaw2xF.js → verifyHash-4UFZIpQG.js} +1 -1
- package/assets/{w3m-modal-DZpfNka8.js → w3m-modal-D0oIAAHh.js} +1 -1
- package/assets/{w3m-modal-CXTIrAhw.js → w3m-modal-DuWRb-89.js} +1 -1
- package/assets/wait-for-tx-receipt-4BEbGWQp.js +1 -0
- package/assets/wallet-kind-Cg4yayUr.js +1 -0
- package/assets/wallets-K1dHuOGH.js +13 -0
- package/assets/web-connector-6Dl638uy.js +9 -0
- package/assets/{writeContract-CJkUo9D7.js → writeContract-DO4OjsR8.js} +1 -1
- package/assets/{zora-sepolia-CKT05Lph.js → zora-sepolia-sSAsjV_j.js} +1 -1
- package/assets/{zoraTestnet-CRD_79WO.js → zoraTestnet-DTqS-Os0.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Assets-DoUIRoSX.js +0 -503
- package/assets/Cart-Cyj_u0xP.js +0 -3
- package/assets/GetCredits-BqhYAHL0.js +0 -1
- package/assets/ImportListings-CCQDdZMF.js +0 -5
- package/assets/ItemDetail-C6EEFa3M.js +0 -78
- package/assets/MarketCheckout-B1QbAQBC.js +0 -50
- package/assets/MyAssets-FkZXy017.css +0 -1
- package/assets/MyAssets-gjvqMgx3.js +0 -7
- package/assets/MyPurchases-D04-_M8f.js +0 -3
- package/assets/PrimaryListModal-D6DU8-ZC.js +0 -1
- package/assets/biconomy-DIiiyQwz.js +0 -1
- package/assets/browser-ponyfill-Djb5Py6a.js +0 -1
- package/assets/buy-C5_gzZWJ.js +0 -1
- package/assets/buy-gasless-Cxx1jwuH.js +0 -1
- package/assets/ccip-BafcYzQ9.js +0 -1
- package/assets/collection-DHOETntw.js +0 -1
- package/assets/controller-B80HcZCL.js +0 -2
- package/assets/decimals-Cdn10TAV.js +0 -1
- package/assets/decimals-DCazhsdS.js +0 -1
- package/assets/detectExtension-BSAkQ0I6.js +0 -1
- package/assets/emotion-styled.browser.esm-ClqtCiJQ.js +0 -1
- package/assets/engine-DsQHyohE.js +0 -1
- package/assets/estimate-l1-fee-Cna0j8C0.js +0 -1
- package/assets/eth_estimateGas-A7dV8Dq8.js +0 -1
- package/assets/eth_getStorageAt-DVqXAuzZ.js +0 -1
- package/assets/eth_getTransactionCount-DLrwUt6V.js +0 -1
- package/assets/extractIPFS-Dq1wghef.js +0 -1
- package/assets/fetchTokenMetadata-BTRazXId.js +0 -2
- package/assets/get-ecosystem-wallet-info-B8H2bbhI.js +0 -1
- package/assets/getBalance-BewKvJ6T.js +0 -2
- package/assets/getInstalledModules-ByFUGStC.js +0 -1
- package/assets/getNFT-1nUsfQAJ.js +0 -1
- package/assets/getNFT-BuDjU8-b.js +0 -2
- package/assets/import-CWsWpkUA.js +0 -1
- package/assets/in-app-wallet-calls-Fj_OJpWi.js +0 -1
- package/assets/index-B04ndUbB.js +0 -2
- package/assets/index-BBuZMaWr.js +0 -231
- package/assets/index-CzDOjIXr.js +0 -2
- package/assets/index-DH3Yzbz3.js +0 -1
- package/assets/index-Dhu9IXc1.js +0 -3
- package/assets/index-PISx9bvm.css +0 -1
- package/assets/index-nRbKhfJe.js +0 -2
- package/assets/index.es-CiHN99GO.js +0 -1
- package/assets/loader-logo-CK-TcJ-S.js +0 -1
- package/assets/openzeppelin-B2ua0Itn.js +0 -1
- package/assets/ownerOf-DOppg2jR.js +0 -1
- package/assets/parseNft-D_8M9mfO.js +0 -2
- package/assets/passkeys-CW4jmTtA.js +0 -1
- package/assets/resolveImplementation-06H3horI.js +0 -1
- package/assets/secp256k1-D6rN1PGV.js +0 -1
- package/assets/send-batch-transaction-Bbiva6rb.js +0 -1
- package/assets/send-eip712-transaction-NxK7USDp.js +0 -2
- package/assets/send-gasless-transaction-x5mofsoE.js +0 -2
- package/assets/session-proposal-KoaDAo-a.js +0 -1
- package/assets/session-request-CSef7ndM.js +0 -2
- package/assets/sha256-DkPvB4om.js +0 -1
- package/assets/signing-B9F_g0GG.js +0 -30
- package/assets/thirdweb-D99mQjH-.js +0 -27
- package/assets/totalSupply-BhpAtMjH.js +0 -1
- package/assets/trade-encoding-CWytSFjw.js +0 -1
- package/assets/transactionReceipt-OilL7-NS.js +0 -1
- package/assets/useInfiniteGrid-CpiD11c4.js +0 -1
- package/assets/useTheme-6tr3eE7K.js +0 -1
- package/assets/useTheme-Dpdkvivv.js +0 -1
- package/assets/wait-for-tx-receipt-Dt-8wYDQ.js +0 -1
- package/assets/wallet-kind-B9P1TeIH.js +0 -1
- package/assets/wallets-v6YyPYY8.js +0 -15
- package/assets/web-connector-DBKfHuJF.js +0 -9
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import{L as ve,a as Ze,r as c,j as t}from"./react-BMZSDQJw.js";import{s as a,y as s,I as j,u as Je,t as r,g as Xe,j as et,z as pe,e as K,B as tt,A as N,q as ue,D as st,f as ot,E as nt,x as rt,c as at,F as it}from"./index-Cw_zTgKJ.js";import{f as lt}from"./import-C5j6Wx_d.js";import{S as ct,P as dt,f as mt}from"./PrimaryListModal-Dcjz3ZJl.js";import{c as pt}from"./buy-B9BIW0Jt.js";import{R as G,C as ut,a as ft,F as xt,S as D,b as fe}from"./categories-BltWZ-Er.js";import{L as ht}from"./LoadMore-kFcJ8c6R.js";import{D as xe,F as he,R as yt,a as gt,b as bt,c as St,d as wt,S as jt,e as $t,f as Ct,g as It,h as vt,i as kt,j as At,k as Et,C as Tt,l as Ft,m as Rt,n as _t,M as Lt}from"./Assets.styles-DD1YIA0w.js";import{u as Ot}from"./useInfiniteGrid-CpG_Ao97.js";import{E as Q}from"./ErrorNotice-DDr3KjIH.js";import{n as ke}from"./emotion-CSxEP8yM.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";import"./mana-rate-zpYtmb1D.js";import"./index-HN6Rk25C.js";import"./wallet-kind-Cg4yayUr.js";import"./errors-BrsnEff4.js";import"./Tooltip-zQgqv_WS.js";a.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
`;a.h2`
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 4px 4px 2px;
|
|
9
|
+
font-family: ${s.font.sans};
|
|
10
|
+
font-weight: 700;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
letter-spacing: 0.46px;
|
|
13
|
+
text-transform: uppercase;
|
|
14
|
+
color: ${s.colors.muted};
|
|
15
|
+
`;a("button",ke("selected"))`
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 10px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 40px;
|
|
21
|
+
padding: 4px 12px;
|
|
22
|
+
border: 0;
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
background: ${({selected:o})=>o?s.colors.media:"transparent"};
|
|
25
|
+
color: ${s.colors.text};
|
|
26
|
+
font-family: ${s.font.sans};
|
|
27
|
+
font-weight: ${({selected:o})=>o?600:400};
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
text-align: left;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
|
|
32
|
+
@media (hover: hover) {
|
|
33
|
+
&:hover {
|
|
34
|
+
background: ${s.colors.media};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
&:focus-visible {
|
|
38
|
+
outline: 2px solid ${s.colors.accent};
|
|
39
|
+
outline-offset: 2px;
|
|
40
|
+
}
|
|
41
|
+
`;a(j)`
|
|
42
|
+
width: 18px;
|
|
43
|
+
height: 18px;
|
|
44
|
+
flex: none;
|
|
45
|
+
color: ${s.colors.muted};
|
|
46
|
+
`;a.div`
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 8px;
|
|
50
|
+
width: 100%;
|
|
51
|
+
`;a.span`
|
|
52
|
+
font-family: ${s.font.sans};
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
line-height: 1.43;
|
|
56
|
+
color: ${s.colors.text};
|
|
57
|
+
padding: 0 4px;
|
|
58
|
+
`;a.div`
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
padding: 4px;
|
|
63
|
+
`;a("button",ke("selected"))`
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 4px;
|
|
67
|
+
padding: 4px 10px;
|
|
68
|
+
border-radius: 6px;
|
|
69
|
+
background: ${({selected:o})=>o?s.colors.text:s.colors.softWhite};
|
|
70
|
+
border: ${({selected:o})=>o?`1px solid ${s.colors.text}`:`0.5px solid ${s.colors.gray4}`};
|
|
71
|
+
color: ${({selected:o})=>o?s.colors.white:s.colors.gray0};
|
|
72
|
+
font-family: ${s.font.sans};
|
|
73
|
+
font-weight: ${({selected:o})=>o?600:400};
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
border-color: ${s.colors.text};
|
|
79
|
+
}
|
|
80
|
+
&:focus-visible {
|
|
81
|
+
outline: 2px solid ${s.colors.accent};
|
|
82
|
+
outline-offset: 2px;
|
|
83
|
+
}
|
|
84
|
+
`;const Pt=a.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
height: 44px;
|
|
89
|
+
padding: 0 12px;
|
|
90
|
+
margin-bottom: 16px;
|
|
91
|
+
border: 1px solid ${s.colors.lineStrong};
|
|
92
|
+
border-radius: ${s.radius.btn};
|
|
93
|
+
background: ${s.colors.white};
|
|
94
|
+
|
|
95
|
+
&:focus-within {
|
|
96
|
+
border-color: ${s.colors.accent};
|
|
97
|
+
}
|
|
98
|
+
`,zt=a(j)`
|
|
99
|
+
width: 18px;
|
|
100
|
+
height: 18px;
|
|
101
|
+
flex: none;
|
|
102
|
+
color: ${s.colors.muted};
|
|
103
|
+
`,Bt=a.input`
|
|
104
|
+
flex: 1;
|
|
105
|
+
min-width: 0;
|
|
106
|
+
border: 0;
|
|
107
|
+
background: none;
|
|
108
|
+
padding: 0;
|
|
109
|
+
font-family: ${s.font.sans};
|
|
110
|
+
font-size: 14px;
|
|
111
|
+
color: ${s.colors.text};
|
|
112
|
+
|
|
113
|
+
&::placeholder {
|
|
114
|
+
color: ${s.colors.muted2};
|
|
115
|
+
}
|
|
116
|
+
&:focus {
|
|
117
|
+
outline: 0;
|
|
118
|
+
}
|
|
119
|
+
`,Mt=a.button`
|
|
120
|
+
display: grid;
|
|
121
|
+
place-items: center;
|
|
122
|
+
width: 24px;
|
|
123
|
+
height: 24px;
|
|
124
|
+
border: 0;
|
|
125
|
+
border-radius: 50%;
|
|
126
|
+
background: ${s.colors.chip};
|
|
127
|
+
color: ${s.colors.text};
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
flex: none;
|
|
130
|
+
|
|
131
|
+
&:focus-visible {
|
|
132
|
+
outline: 2px solid ${s.colors.accent};
|
|
133
|
+
outline-offset: 2px;
|
|
134
|
+
}
|
|
135
|
+
`,qt=a(j)`
|
|
136
|
+
width: 12px;
|
|
137
|
+
height: 12px;
|
|
138
|
+
`,ye=a.div`
|
|
139
|
+
display: grid;
|
|
140
|
+
grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
|
|
141
|
+
gap: 20px;
|
|
142
|
+
|
|
143
|
+
${s.media.down("sm")} {
|
|
144
|
+
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
145
|
+
gap: 12px;
|
|
146
|
+
}
|
|
147
|
+
`;a.p`
|
|
148
|
+
margin: 24px 0;
|
|
149
|
+
font-family: ${s.font.sans};
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
color: ${s.colors.muted};
|
|
152
|
+
`;const ge=a.div`
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
gap: 6px;
|
|
158
|
+
padding: 72px 24px;
|
|
159
|
+
text-align: center;
|
|
160
|
+
`,be=a.div`
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
width: 72px;
|
|
165
|
+
height: 72px;
|
|
166
|
+
margin-bottom: 10px;
|
|
167
|
+
border-radius: 50%;
|
|
168
|
+
background: ${s.colors.navViolet};
|
|
169
|
+
color: ${s.colors.accent};
|
|
170
|
+
`,Se=a.p`
|
|
171
|
+
margin: 0;
|
|
172
|
+
font-family: ${s.font.sans};
|
|
173
|
+
font-size: 18px;
|
|
174
|
+
font-weight: 600;
|
|
175
|
+
color: ${s.colors.text};
|
|
176
|
+
`,we=a.p`
|
|
177
|
+
margin: 0;
|
|
178
|
+
max-width: 360px;
|
|
179
|
+
font-family: ${s.font.sans};
|
|
180
|
+
font-size: 14px;
|
|
181
|
+
line-height: 1.5;
|
|
182
|
+
color: ${s.colors.muted};
|
|
183
|
+
`,Kt=a(ve)`
|
|
184
|
+
margin-top: 12px;
|
|
185
|
+
display: inline-flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
height: 40px;
|
|
188
|
+
padding: 0 20px;
|
|
189
|
+
border-radius: 8px;
|
|
190
|
+
background: ${s.colors.accent};
|
|
191
|
+
color: #fff;
|
|
192
|
+
font-family: ${s.font.sans};
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
font-weight: 600;
|
|
195
|
+
text-decoration: none;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
|
|
198
|
+
&:hover {
|
|
199
|
+
background: ${s.colors.accentHover};
|
|
200
|
+
}
|
|
201
|
+
`,Nt=a.section`
|
|
202
|
+
max-width: 520px;
|
|
203
|
+
margin: 48px auto;
|
|
204
|
+
text-align: center;
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
gap: 16px;
|
|
208
|
+
align-items: center;
|
|
209
|
+
`,Gt=a.h1`
|
|
210
|
+
margin: 0;
|
|
211
|
+
font-family: ${s.font.sans};
|
|
212
|
+
font-weight: 700;
|
|
213
|
+
font-size: 24px;
|
|
214
|
+
color: ${s.colors.text};
|
|
215
|
+
`,Dt=a.p`
|
|
216
|
+
margin: 0;
|
|
217
|
+
font-family: ${s.font.sans};
|
|
218
|
+
font-size: 15px;
|
|
219
|
+
color: ${s.colors.muted};
|
|
220
|
+
`,Qt=a(ve)`
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
gap: 12px;
|
|
224
|
+
margin-bottom: 16px;
|
|
225
|
+
padding: 12px 16px;
|
|
226
|
+
border-radius: ${s.radius.btn};
|
|
227
|
+
background: ${s.colors.rarityBg};
|
|
228
|
+
color: ${s.colors.text};
|
|
229
|
+
text-decoration: none;
|
|
230
|
+
|
|
231
|
+
&:hover {
|
|
232
|
+
filter: brightness(0.98);
|
|
233
|
+
}
|
|
234
|
+
&:focus-visible {
|
|
235
|
+
outline: 2px solid ${s.colors.accent};
|
|
236
|
+
outline-offset: 2px;
|
|
237
|
+
}
|
|
238
|
+
`,Ut=a.span`
|
|
239
|
+
display: flex;
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
flex: 1;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
font-family: ${s.font.sans};
|
|
244
|
+
`,Ht=a.strong`
|
|
245
|
+
font-weight: 600;
|
|
246
|
+
font-size: 14px;
|
|
247
|
+
color: ${s.colors.text};
|
|
248
|
+
`,Wt=a.span`
|
|
249
|
+
font-size: 12px;
|
|
250
|
+
color: ${s.colors.muted};
|
|
251
|
+
`,Yt=a.span`
|
|
252
|
+
flex: none;
|
|
253
|
+
font-weight: 600;
|
|
254
|
+
font-size: 13px;
|
|
255
|
+
color: ${s.colors.accent};
|
|
256
|
+
text-transform: uppercase;
|
|
257
|
+
letter-spacing: 0.046em;
|
|
258
|
+
`,Vt=48,je=[{key:"wearables",labelKey:"myAssets.sectionWearables",category:"wearable"},{key:"emotes",labelKey:"myAssets.sectionEmotes",category:"emote"},{key:"names",labelKey:"myAssets.sectionNames",category:"ens"},{key:"creations",labelKey:"myAssets.sectionCreations"}],U=[{key:"newest",label:"filterBar.sortNewest",server:"newest"},{key:"name",label:"filterBar.sortName",server:"name"},{key:"cheapest",label:"filterBar.sortCheapest",server:"cheapest"}];function $e(o){return o==="wearables"||o==="emotes"}const Ce={wearables:"wearable",emotes:"emote",names:"names",creations:""},Zt={wearable:"wearables",emote:"emotes",names:"names"};function Ie(o){return{id:o.id,name:o.name,creator:"",contractAddress:o.contractAddress,itemId:o.itemId,category:o.category,rarity:o.rarity??"common",network:o.network,chainId:o.chainId,thumbnail:o.image,priceCredits:o.listingPrice??0,gender:null,isSmart:!1,tokenId:o.tokenId,issuedId:o.issuedId}}function Jt(o,T=0){return{id:`${o.contractAddress}-${o.blockchainItemId}`,name:o.name,creator:"",contractAddress:o.contractAddress,itemId:o.blockchainItemId,category:o.category,rarity:o.rarity,network:"MATIC",chainId:at.chainId,thumbnail:o.thumbnail,priceCredits:T,gender:null,isSmart:!1}}function bs(){var ce,de;Je({title:r("nav.myAssets"),noindex:!0});const{session:o,error:T,signIn:Ae,restore:H}=Xe(),F=et(),[Ee,Te]=Ze(),W=Ee.get("section"),l=je.some(e=>e.key===W)?W:"wearables",[m,R]=c.useState("all"),[h,_]=c.useState([]),[p,$]=c.useState(null),[S,Fe]=c.useState("newest"),[C,Y]=c.useState(""),[y,Re]=c.useState(""),[I,g]=c.useState(!1),[_e,Le]=c.useState(!0),[Oe,Pe]=c.useState(!1),[V,Z]=c.useState(null),[J,X]=c.useState(null),[ee,te]=c.useState(null),[ze,se]=c.useState(null);c.useEffect(()=>{H()},[H]),c.useEffect(()=>{const e=setTimeout(()=>Re(C.trim()),300);return()=>clearTimeout(e)},[C]),c.useEffect(()=>{if(!I)return;const e=i=>{i.key==="Escape"&&g(!1)};document.addEventListener("keydown",e);const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=n}},[I]);const u=o==null?void 0:o.address,Be=je.find(e=>e.key===l),v=$e(l),oe=(U.find(e=>e.key===S)??U[0]).server,Me=m==="on_sale"?r("filter.onSale"):m==="not_for_sale"?r("filter.notForSale"):"",qe=G.filter(e=>h.includes(e)).map(pe).join(", ");function ne(e){Te(n=>{const i=new URLSearchParams(n);return i.set("section",e),i},{replace:!0}),$(null),$e(e)||_([]),g(!1)}function re(e){_(n=>n.includes(e)?n.filter(i=>i!==e):[...n,e])}function Ke(e){const n=Zt[e];n&&ne(n)}const{items:L,total:Ne,isLoading:O,isPlaceholderData:P,error:Ge,hasNextPage:De,isFetchingNextPage:ae,fetchNextPage:Qe}=Ot(["my-assets",u,l,m,h,p,y,oe],e=>st(u,{category:Be.category,first:Vt,skip:e,search:y||void 0,rarities:v&&h.length?h:void 0,wearableCategories:l==="wearables"&&p?fe[p]:void 0,emoteCategories:l==="emotes"&&p?fe[p]:void 0,onlyOnSale:m==="on_sale"||void 0,sortBy:oe}).then(n=>({items:n.assets,total:n.total})),{enabled:!!u&&l!=="creations"}),z=c.useMemo(()=>m==="not_for_sale"?L.filter(e=>!e.isOnSale):L,[L,m]),{data:k,isLoading:B,isError:Ue}=K({queryKey:["publishable-items",u],queryFn:()=>mt(u,o.identity),enabled:!!o&&l==="creations",retry:!1}),M=c.useMemo(()=>[...new Set((k??[]).map(e=>e.contractAddress))],[k]),{data:A}=K({queryKey:["collection-sale-state",u,M],enabled:M.length>0,queryFn:async()=>{const e=await Promise.all(M.map(async i=>[i,await it(i)])),n={};for(const[i,d]of e)for(const[f,x]of Object.entries(d))n[`${i}-${f}`]=x;return n}}),w=e=>A==null?void 0:A[`${e.contractAddress}-${e.blockchainItemId}`],q=c.useMemo(()=>{let e=k??[];if(m==="on_sale"?e=e.filter(i=>{var d;return(d=w(i))==null?void 0:d.isOnSale}):m==="not_for_sale"&&(e=e.filter(i=>{var d;return!((d=w(i))!=null&&d.isOnSale)})),y){const i=y.toLowerCase();e=e.filter(d=>d.name.toLowerCase().includes(i))}const n=[...e];return S==="name"?n.sort((i,d)=>i.name.localeCompare(d.name)):S==="cheapest"&&n.sort((i,d)=>{var f,x;return(((f=w(i))==null?void 0:f.priceCredits)??0)-(((x=w(d))==null?void 0:x.priceCredits)??0)}),n},[k,A,m,y,S]),{data:b}=K({queryKey:["importable",u],queryFn:()=>lt(u),enabled:!!u}),ie=((b==null?void 0:b.creations.length)??0)+((b==null?void 0:b.owned.length)??0);async function le(e,n,i){if(o){se(null),te(i);try{const d=await ot(e);await pt({trade:d,signer:o.signer}),nt.success(r("myAssets.removedFromSale",{name:n})),await F.invalidateQueries({queryKey:["my-assets",o.address]}),await F.invalidateQueries({queryKey:["collection-sale-state"]}),await F.invalidateQueries({queryKey:["publishable-items"]})}catch(d){const f=d,x=(f.message??"").toLowerCase(),me=f.code===4001||x.includes("reject")||x.includes("denied");me||rt(d,{flow:"remove-listing",tradeId:e}),se(me?r("getCredits.errorCanceled"):r("myAssets.removeListingError"))}finally{te(null)}}}if(!o)return t.jsxs(Nt,{children:[t.jsx(Gt,{children:r("nav.myAssets")}),t.jsx(Dt,{children:r("myAssets.signInPrompt")}),t.jsx(tt,{variant:"purple",onClick:()=>Ae(),children:r("storeSettings.signIn")}),t.jsx(Q,{message:T})]});const He=l==="creations"?B:O||P,We=l==="creations"?q.length:m==="not_for_sale"?z.length:Ne,E=[];if(m!=="all"&&E.push({key:"status",label:m==="on_sale"?r("filter.onSale"):r("filter.notForSale"),onRemove:()=>R("all")}),v)for(const e of G)h.includes(e)&&E.push({key:`rarity-${e}`,label:pe(e),onRemove:()=>re(e)});if(v&&p){const e=(de=(ce=ut.find(n=>n.key===Ce[l]))==null?void 0:ce.subs)==null?void 0:de.find(n=>n.key===p);E.push({key:"sub",label:e?r(e.labelKey):p,onRemove:()=>$(null)})}function Ye(){R("all"),_([]),$(null)}const Ve=t.jsxs(t.Fragment,{children:[t.jsx(ft,{title:r("myAssets.assetsHeading"),category:Ce[l],subCategory:p,onCategory:Ke,onSub:$,onCollections:()=>ne("creations"),collections:l==="creations",extraLabelKey:"myAssets.sectionCreations",hideAll:!0}),v?t.jsxs(t.Fragment,{children:[t.jsx(xe,{}),t.jsx(he,{title:r("assets.rarity"),open:Oe,onToggle:()=>Pe(e=>!e),summary:qe,headerTestId:"sidebar-section-toggle",children:t.jsx(yt,{"data-testid":"rarity-filter",children:G.map(e=>{const n=h.includes(e);return t.jsxs(gt,{type:"button",selected:n,"aria-pressed":n,onClick:()=>re(e),"data-testid":"rarity-filter-check",children:[t.jsx(bt,{color:s.rarities[e],children:n?t.jsx(St,{name:"check","aria-hidden":!0}):null}),t.jsx(wt,{selected:n,children:e})]},e)})})})]}):null,t.jsx(xe,{}),t.jsx(he,{title:r("filter.status"),open:_e,onToggle:()=>Le(e=>!e),summary:Me,children:[["all",r("filter.statusAll")],["on_sale",r("filter.onSale")],["not_for_sale",r("filter.notForSale")]].map(([e,n])=>t.jsxs(jt,{children:[t.jsx($t,{type:"radio",name:"myassets-status",checked:m===e,onChange:()=>R(e)}),t.jsx(Ct,{children:n})]},e))})]});return t.jsxs(It,{"data-testid":"my-assets",children:[I?t.jsx(vt,{onClick:()=>g(!1),"aria-hidden":!0}):null,t.jsxs(kt,{className:I?"is-open":"","data-testid":"my-assets-sidebar",children:[t.jsxs(At,{children:[t.jsx(Et,{children:r("assets.filters")}),t.jsx(Tt,{onClick:()=>g(!1),"aria-label":r("assets.closeFilters"),children:"✕"})]}),t.jsx(Ft,{children:Ve}),t.jsx(Rt,{children:t.jsx(_t,{type:"button",onClick:()=>g(!1),children:r("assets.showItems")})})]}),t.jsxs(Lt,{children:[t.jsxs(Pt,{children:[t.jsx(zt,{name:"search","aria-hidden":!0}),t.jsx(Bt,{type:"search",value:C,placeholder:r("myAssets.searchPlaceholder"),"aria-label":r("myAssets.searchPlaceholder"),onChange:e=>Y(e.target.value)}),C?t.jsx(Mt,{type:"button","aria-label":r("myAssets.clearSearch"),onClick:()=>Y(""),children:t.jsx(qt,{name:"close","aria-hidden":!0})}):null]}),ie>0?t.jsxs(Qt,{to:"/import",children:[t.jsx("span",{"aria-hidden":!0,children:"📦"}),t.jsxs(Ut,{children:[t.jsx(Ht,{children:r("myAssets.importTitle")}),t.jsx(Wt,{children:r("myAssets.importSub",{count:ie})})]}),t.jsx(Yt,{children:r("myAssets.import")})]}):null,t.jsx(xt,{sort:S,onSort:Fe,sortOptions:U,total:We,loading:He,query:y,onOpenFilters:()=>g(!0),chips:E,onClearChips:Ye}),(l==="creations"?Ue:Ge)?t.jsx(Q,{message:r("myAssets.ownedError"),testId:"my-assets-error"}):null,t.jsx(Q,{message:ze}),l==="creations"?t.jsxs(t.Fragment,{children:[t.jsx(ye,{"data-testid":"grid",children:B?t.jsx(D,{count:12}):q.map(e=>{const n=w(e),i=!!(n!=null&&n.isOnSale);return t.jsx(N,{item:Jt(e,(n==null?void 0:n.priceCredits)??0),mode:"manage",listed:i,busy:ee===e.id,onList:()=>{ue("Shop Started Listing",{listing_type:"primary",item_id:e.blockchainItemId}),X(e)},onUnlist:()=>{n!=null&&n.tradeId&&le(n.tradeId,e.name,e.id)}},`${e.contractAddress}-${e.blockchainItemId}`)})}),!B&&q.length===0?t.jsxs(ge,{children:[t.jsx(be,{children:t.jsx(j,{name:"pen",size:30,"aria-hidden":!0})}),t.jsx(Se,{children:r("myAssets.emptyCreationsTitle")}),t.jsx(we,{children:r("myAssets.nothingToPublish")})]}):null]}):t.jsxs(t.Fragment,{children:[t.jsxs(ye,{"data-testid":"grid",children:[O||P?t.jsx(D,{count:12}):z.map(e=>l==="names"?t.jsx(N,{item:{...Ie(e),category:"ens"},mode:"view"},e.id):t.jsx(N,{item:Ie(e),mode:"manage",listed:e.isOnSale,busy:ee===e.id,onList:()=>{ue("Shop Started Listing",{listing_type:"secondary",item_id:e.itemId??e.tokenId??null}),Z(e)},onUnlist:()=>{e.tradeId&&le(e.tradeId,e.name,e.id)}},e.id)),ae?t.jsx(D,{count:6}):null]}),m!=="not_for_sale"?t.jsx(ht,{hasNextPage:De,isFetching:ae,onLoadMore:()=>void Qe()}):null,!O&&!P&&z.length===0?t.jsxs(ge,{children:[t.jsx(be,{children:t.jsx(j,{name:l==="names"?"website":l==="emotes"?"emote-dance":"cat-upper",size:30,"aria-hidden":!0})}),t.jsx(Se,{children:l==="names"?r("myAssets.emptyNamesTitle"):r("myAssets.emptyOwnedTitle")}),t.jsx(we,{children:l==="names"?r("myAssets.namesEmpty"):r("myAssets.ownedEmpty")}),l!=="names"?t.jsx(Kt,{to:"/assets",children:r("myAssets.emptyBrowse")}):null]}):null]})]}),V?t.jsx(ct,{asset:V,session:o,onClose:()=>Z(null)}):null,J?t.jsx(dt,{item:J,session:o,onClose:()=>X(null)}):null]})}export{bs as MyAssets};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as n,j as s,L as m}from"./react-
|
|
1
|
+
import{r as n,j as s,L as m}from"./react-BMZSDQJw.js";import{u as c,t,a as l,I as d,A as p,s as v,B as x}from"./index-Cw_zTgKJ.js";import{L as u}from"./LoadMore-kFcJ8c6R.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";const h=v(x)`
|
|
2
2
|
margin-top: 12px;
|
|
3
3
|
`,r=24;function E(){c({title:t("nav.myFavorites"),noindex:!0});const a=l(e=>Object.values(e.items)),[i,o]=n.useState(r);return a.length===0?s.jsxs("div",{className:"favorites-empty",children:[s.jsx(d,{name:"heart",size:40,color:"var(--muted-2)"}),s.jsx("p",{className:"favorites-empty__title",children:t("myFavorites.emptyTitle")}),s.jsx("p",{className:"muted",children:t("myFavorites.emptyBody")}),s.jsx(h,{as:m,to:"/assets",variant:"purple",children:t("notFound.cta")})]}):s.jsxs("section",{className:"favorites",children:[s.jsxs("div",{className:"favorites__head",children:[s.jsx("h1",{children:t("nav.myFavorites")}),s.jsx("span",{className:"favorites__count",children:t("myFavorites.itemCount",{count:a.length})})]}),s.jsx("div",{className:"grid",children:a.slice(0,i).map(e=>s.jsx(p,{item:e},e.id))}),s.jsx(u,{hasNextPage:i<a.length,isFetching:!1,onLoadMore:()=>o(e=>e+r)})]})}export{E as MyFavorites};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import{j as e,L as y}from"./react-BMZSDQJw.js";import{s as i,B as w,y as r,S as k,u as $,t as d,g as v,I as x,a3 as I,l as j,e as P,a4 as L}from"./index-Cw_zTgKJ.js";import{L as N}from"./LoadMore-kFcJ8c6R.js";import{u as E}from"./useInfiniteGrid-CpG_Ao97.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";const T=15e3;function C(t,n){return t.txHash&&n.txHash?t.txHash===n.txHash:t.txHash||n.txHash?!1:t.status===n.status&&Math.abs(t.createdAt-n.createdAt)<=T}function D(t){const n=[...t].sort((s,o)=>o.createdAt-s.createdAt),a=[];for(const s of n){const o=a[a.length-1];o&&C(o[o.length-1],s)?o.push(s):a.push([s])}return a.map(s=>{var o;return{id:((o=s.find(c=>c.txHash))==null?void 0:o.txHash)??s[s.length-1].id,createdAt:Math.max(...s.map(c=>c.createdAt)),status:s.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:s.reduce((c,u)=>c+u.credits,0),lines:s}})}function H(t){const n=[],a=new Map;for(const s of t)if(s.tradeId){const o=a.get(s.tradeId);if(o){o.quantity+=1,o.credits+=s.credits;continue}const c={key:s.tradeId,tradeId:s.tradeId,quantity:1,credits:s.credits};a.set(s.tradeId,c),n.push(c)}else n.push({key:s.id,tradeId:null,quantity:1,credits:s.credits});return n}const m=k`
|
|
2
|
+
0% { background-position: 200% 0; }
|
|
3
|
+
100% { background-position: -200% 0; }
|
|
4
|
+
`,S=i.section`
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
`,z=i.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: baseline;
|
|
10
|
+
gap: 12px;
|
|
11
|
+
margin-bottom: 20px;
|
|
12
|
+
`,A=i.h1`
|
|
13
|
+
font-family: ${r.font.sans};
|
|
14
|
+
margin: 0;
|
|
15
|
+
`,q=i.span`
|
|
16
|
+
color: ${r.colors.muted};
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
`,M=i.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 16px;
|
|
22
|
+
max-width: 760px;
|
|
23
|
+
`,F=i.div`
|
|
24
|
+
background: ${r.colors.white};
|
|
25
|
+
border: 1px solid ${r.colors.line};
|
|
26
|
+
border-radius: 16px;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
`,G=i.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
padding: 14px 18px;
|
|
34
|
+
background: ${r.colors.softWhite};
|
|
35
|
+
border-bottom: 1px solid ${r.colors.line};
|
|
36
|
+
|
|
37
|
+
${r.media.down("mobile")} {
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
}
|
|
40
|
+
`,O=i.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 2px;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
`,B=i.span`
|
|
46
|
+
font-weight: 700;
|
|
47
|
+
color: ${r.colors.text};
|
|
48
|
+
`,R=i.span`
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
color: ${r.colors.muted};
|
|
51
|
+
`,W=i.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 14px;
|
|
55
|
+
`,_=i.span`
|
|
56
|
+
font-size: 11px;
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
text-transform: uppercase;
|
|
59
|
+
letter-spacing: 0.03em;
|
|
60
|
+
padding: 4px 10px;
|
|
61
|
+
border-radius: ${r.radius.pill};
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
|
|
64
|
+
&[data-status='SETTLED'] {
|
|
65
|
+
background: rgba(30, 166, 114, 0.14);
|
|
66
|
+
color: ${r.colors.okStrong};
|
|
67
|
+
}
|
|
68
|
+
&[data-status='PENDING'] {
|
|
69
|
+
background: rgba(245, 166, 35, 0.16);
|
|
70
|
+
color: #b5790a;
|
|
71
|
+
}
|
|
72
|
+
`,U=i.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 5px;
|
|
76
|
+
font-weight: 800;
|
|
77
|
+
color: ${r.colors.text};
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
|
|
80
|
+
.ccy-mark {
|
|
81
|
+
width: 16px;
|
|
82
|
+
height: 16px;
|
|
83
|
+
}
|
|
84
|
+
`,K=i.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
`,b=i.div`
|
|
88
|
+
display: grid;
|
|
89
|
+
grid-template-columns: 52px 1fr auto;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: 14px;
|
|
92
|
+
padding: 12px 18px;
|
|
93
|
+
text-decoration: none;
|
|
94
|
+
color: inherit;
|
|
95
|
+
|
|
96
|
+
& + & {
|
|
97
|
+
border-top: 1px solid ${r.colors.line};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&[data-link='true'] {
|
|
101
|
+
transition: background 0.15s;
|
|
102
|
+
}
|
|
103
|
+
&[data-link='true']:hover {
|
|
104
|
+
background: ${r.colors.media};
|
|
105
|
+
}
|
|
106
|
+
&[data-link='true']:focus-visible {
|
|
107
|
+
outline: 2px solid ${r.colors.accent};
|
|
108
|
+
outline-offset: -2px;
|
|
109
|
+
}
|
|
110
|
+
`,Q=i.div`
|
|
111
|
+
width: 52px;
|
|
112
|
+
height: 52px;
|
|
113
|
+
border-radius: 10px;
|
|
114
|
+
background: ${r.colors.media};
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
color: ${r.colors.muted2};
|
|
120
|
+
|
|
121
|
+
img {
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
object-fit: contain;
|
|
125
|
+
}
|
|
126
|
+
`,X=i.div`
|
|
127
|
+
width: 52px;
|
|
128
|
+
height: 52px;
|
|
129
|
+
border-radius: 10px;
|
|
130
|
+
background: linear-gradient(100deg, ${r.colors.media} 30%, ${r.colors.panel} 50%, ${r.colors.media} 70%);
|
|
131
|
+
background-size: 200% 100%;
|
|
132
|
+
animation: ${m} 1.3s infinite linear;
|
|
133
|
+
|
|
134
|
+
@media (prefers-reduced-motion: reduce) {
|
|
135
|
+
animation: none;
|
|
136
|
+
}
|
|
137
|
+
`,Z=i.div`
|
|
138
|
+
min-width: 0;
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
gap: 2px;
|
|
142
|
+
`,J=i.span`
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
text-overflow: ellipsis;
|
|
147
|
+
`,V=i.span`
|
|
148
|
+
display: inline-block;
|
|
149
|
+
width: 140px;
|
|
150
|
+
max-width: 60%;
|
|
151
|
+
height: 12px;
|
|
152
|
+
border-radius: 6px;
|
|
153
|
+
background: linear-gradient(100deg, ${r.colors.media} 30%, ${r.colors.panel} 50%, ${r.colors.media} 70%);
|
|
154
|
+
background-size: 200% 100%;
|
|
155
|
+
animation: ${m} 1.3s infinite linear;
|
|
156
|
+
|
|
157
|
+
@media (prefers-reduced-motion: reduce) {
|
|
158
|
+
animation: none;
|
|
159
|
+
}
|
|
160
|
+
`,Y=i.span`
|
|
161
|
+
font-size: 13px;
|
|
162
|
+
color: ${r.colors.muted};
|
|
163
|
+
`,ee=i.div`
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 4px;
|
|
167
|
+
font-weight: 700;
|
|
168
|
+
color: ${r.colors.text};
|
|
169
|
+
white-space: nowrap;
|
|
170
|
+
|
|
171
|
+
.ccy-mark {
|
|
172
|
+
width: 14px;
|
|
173
|
+
height: 14px;
|
|
174
|
+
}
|
|
175
|
+
`,h=i.div`
|
|
176
|
+
height: 132px;
|
|
177
|
+
border-radius: 16px;
|
|
178
|
+
border: 1px solid transparent;
|
|
179
|
+
background: linear-gradient(100deg, ${r.colors.media} 30%, ${r.colors.panel} 50%, ${r.colors.media} 70%);
|
|
180
|
+
background-size: 200% 100%;
|
|
181
|
+
animation: ${m} 1.3s infinite linear;
|
|
182
|
+
|
|
183
|
+
@media (prefers-reduced-motion: reduce) {
|
|
184
|
+
animation: none;
|
|
185
|
+
}
|
|
186
|
+
`,g=i.div`
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
align-items: center;
|
|
190
|
+
gap: 8px;
|
|
191
|
+
text-align: center;
|
|
192
|
+
padding: 90px 20px;
|
|
193
|
+
min-height: 50vh;
|
|
194
|
+
`,f=i.p`
|
|
195
|
+
font-size: 22px;
|
|
196
|
+
font-weight: 700;
|
|
197
|
+
margin: 6px 0 0;
|
|
198
|
+
`,te=i(w)`
|
|
199
|
+
margin-top: 12px;
|
|
200
|
+
`,ne=b.withComponent(y),se=24;function re(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ie({item:t}){const{data:n,isLoading:a}=P({queryKey:["trade-display",t.tradeId],queryFn:()=>L(t.tradeId),enabled:!!t.tradeId,staleTime:3e5}),s=!!t.tradeId&&a,o=(n==null?void 0:n.name)??d("myPurchases.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",u=(n==null?void 0:n.tokenId)??(n==null?void 0:n.itemId)??"",l=n!=null&&n.contractAddress&&u?`/item/${n.contractAddress}/${u}`:void 0,p=e.jsxs(e.Fragment,{children:[s?e.jsx(X,{}):e.jsx(Q,{children:c?e.jsx("img",{src:c,alt:o}):e.jsx(x,{name:"cart",size:20})}),e.jsxs(Z,{children:[s?e.jsx(V,{}):e.jsx(J,{title:o,children:o}),t.quantity>1?e.jsx(Y,{children:d("myPurchases.quantity",{count:t.quantity})}):null]}),e.jsxs(ee,{children:[e.jsx(j,{className:"ccy-mark"})," ",t.credits]})]});return l?e.jsx(ne,{to:l,"data-link":"true",children:p}):e.jsx(b,{children:p})}function oe({order:t}){const n=H(t.lines),a=n.reduce((s,o)=>s+o.quantity,0);return e.jsxs(F,{"data-testid":"purchase-order",children:[e.jsxs(G,{children:[e.jsxs(O,{children:[e.jsx(B,{children:re(t.createdAt)}),e.jsx(R,{children:d("myPurchases.itemCount",{count:a})})]}),e.jsxs(W,{children:[e.jsx(_,{"data-status":t.status,children:t.status==="PENDING"?d("myPurchases.processing"):d("myPurchases.completed")}),e.jsxs(U,{children:[e.jsx(j,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(K,{children:n.map(s=>e.jsx(ie,{item:s},s.key))})]})}function he(){$({title:d("nav.myPurchases"),noindex:!0});const{session:t}=v(),{items:n,isLoading:a,hasNextPage:s,isFetchingNextPage:o,fetchNextPage:c}=E(["purchases",t==null?void 0:t.address],l=>I(t.address,t.identity,{first:se,skip:l}),{enabled:!!t});if(!t)return e.jsxs(g,{children:[e.jsx(x,{name:"cart",size:40,color:"var(--muted-2)"}),e.jsx(f,{children:d("myPurchases.signInTitle")}),e.jsx("p",{className:"muted",children:d("myPurchases.signInBody")})]});const u=D(n.filter(l=>l.status!=="EXPIRED"));return!a&&u.length===0?e.jsxs(g,{children:[e.jsx(x,{name:"cart",size:40,color:"var(--muted-2)"}),e.jsx(f,{children:d("myPurchases.emptyTitle")}),e.jsx("p",{className:"muted",children:d("myPurchases.emptyBody")}),e.jsx(te,{as:y,to:"/assets",variant:"purple",children:d("notFound.cta")})]}):e.jsxs(S,{children:[e.jsxs(z,{children:[e.jsx(A,{children:d("nav.myPurchases")}),a?null:e.jsx(q,{children:d("myPurchases.orderCount",{count:u.length})})]}),e.jsx(M,{children:a?Array.from({length:3}).map((l,p)=>e.jsx(h,{},p)):e.jsxs(e.Fragment,{children:[u.map(l=>e.jsx(oe,{order:l},l.id)),o?e.jsx(h,{}):null]})}),e.jsx(N,{hasNextPage:s,isFetching:o,onLoadMore:()=>void c()})]})}export{he as MyPurchases};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as ee}from"./sentry-
|
|
1
|
+
import{p as ee}from"./sentry-8SzFotJj.js";const ae="2.54.1";let T={getDocsUrl:({docsBaseUrl:r,docsPath:e="",docsSlug:t})=>e?`${r??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${ae}`};class o extends Error{constructor(e,t={}){var p;const n=(()=>{var u;return t.cause instanceof o?t.cause.details:(u=t.cause)!=null&&u.message?t.cause.message:t.details})(),a=t.cause instanceof o&&t.cause.docsPath||t.docsPath,s=(p=T.getDocsUrl)==null?void 0:p.call(T,{...t,docsPath:a}),i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...T.version?[`Version: ${T.version}`]:[]].join(`
|
|
2
2
|
`);super(i,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=ae}walk(e){return se(this,e)}}function se(r,e){return e!=null&&e(r)?r:r&&typeof r=="object"&&"cause"in r&&r.cause!==void 0?se(r.cause,e):e?null:r}class oe extends o{constructor({max:e,min:t,signed:n,size:a,value:s}){super(`Number "${s}" is not in safe ${a?`${a*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class Ke extends o{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class fe extends o{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class me extends o{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function ie(r,{strict:e=!0}={}){return!r||typeof r!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(r):r.startsWith("0x")}function te(r){return ie(r,{strict:!1})?Math.ceil((r.length-2)/2):r.length}function v(r,{dir:e="left"}={}){let t=typeof r=="string"?r.replace("0x",""):r,n=0;for(let a=0;a<t.length-1&&t[e==="left"?a:t.length-a-1].toString()==="0";a++)n++;return t=e==="left"?t.slice(n):t.slice(0,t.length-n),typeof r=="string"?(t.length===1&&e==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}class Ve extends o{constructor({offset:e,position:t,size:n}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class ue extends o{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class Ye extends o{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function g(r,{dir:e,size:t=32}={}){return typeof r=="string"?he(r,{dir:e,size:t}):ye(r,{dir:e,size:t})}function he(r,{dir:e,size:t=32}={}){if(t===null)return r;const n=r.replace("0x","");if(n.length>t*2)throw new ue({size:Math.ceil(n.length/2),targetSize:t,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function ye(r,{dir:e,size:t=32}={}){if(t===null)return r;if(r.length>t)throw new ue({size:r.length,targetSize:t,type:"bytes"});const n=new Uint8Array(t);for(let a=0;a<t;a++){const s=e==="right";n[s?a:t-a-1]=r[s?a:r.length-a-1]}return n}const ge=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function Xe(r,e={}){return typeof r=="number"||typeof r=="bigint"?le(r,e):typeof r=="string"?Te(r,e):typeof r=="boolean"?Ee(r,e):ce(r,e)}function Ee(r,e={}){const t=`0x${Number(r)}`;return typeof e.size=="number"?(y(t,{size:e.size}),g(t,{size:e.size})):t}function ce(r,e={}){let t="";for(let a=0;a<r.length;a++)t+=ge[r[a]];const n=`0x${t}`;return typeof e.size=="number"?(y(n,{size:e.size}),g(n,{dir:"right",size:e.size})):n}function le(r,e={}){const{signed:t,size:n}=e,a=BigInt(r);let s;n?t?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof r=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&t?-s-1n:0;if(s&&a>s||a<i){const u=typeof r=="bigint"?"n":"";throw new oe({max:s?`${s}${u}`:void 0,min:`${i}${u}`,signed:t,size:n,value:`${r}${u}`})}const p=`0x${(t&&a<0?(1n<<BigInt(n*8))+BigInt(a):a).toString(16)}`;return n?g(p,{size:n}):p}const Ne=new TextEncoder;function Te(r,e={}){const t=Ne.encode(r);return ce(t,e)}const ve=new TextEncoder;function Je(r,e={}){return typeof r=="number"||typeof r=="bigint"?Oe(r,e):typeof r=="boolean"?we(r,e):ie(r)?O(r,e):Ae(r,e)}function we(r,e={}){const t=new Uint8Array(1);return t[0]=Number(r),typeof e.size=="number"?(y(t,{size:e.size}),g(t,{size:e.size})):t}const m={zero:48,nine:57,A:65,F:70,a:97,f:102};function re(r){if(r>=m.zero&&r<=m.nine)return r-m.zero;if(r>=m.A&&r<=m.F)return r-(m.A-10);if(r>=m.a&&r<=m.f)return r-(m.a-10)}function O(r,e={}){let t=r;e.size&&(y(t,{size:e.size}),t=g(t,{dir:"right",size:e.size}));let n=t.slice(2);n.length%2&&(n=`0${n}`);const a=n.length/2,s=new Uint8Array(a);for(let i=0,p=0;i<a;i++){const u=re(n.charCodeAt(p++)),E=re(n.charCodeAt(p++));if(u===void 0||E===void 0)throw new o(`Invalid byte sequence ("${n[p-2]}${n[p-1]}" in "${n}").`);s[i]=u*16+E}return s}function Oe(r,e){const t=le(r,e);return O(t)}function Ae(r,e={}){const t=ve.encode(r);return typeof e.size=="number"?(y(t,{size:e.size}),g(t,{dir:"right",size:e.size})):t}function y(r,{size:e}){if(te(r)>e)throw new me({givenSize:te(r),maxSize:e})}function Qe(r,e){const t={to:e},n=t.to;return n==="number"?Me(r,t):n==="bigint"?de(r,t):n==="string"?Ce(r,t):n==="boolean"?xe(r,t):O(r,t)}function de(r,e={}){const{signed:t}=e;e.size&&y(r,{size:e.size});const n=BigInt(r);if(!t)return n;const a=(r.length-2)/2,s=(1n<<BigInt(a)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(a*2,"f")}`)-1n}function xe(r,e={}){let t=r;if(e.size&&(y(t,{size:e.size}),t=v(t)),v(t)==="0x00")return!1;if(v(t)==="0x01")return!0;throw new fe(t)}function Me(r,e={}){const t=de(r,e),n=Number(t);if(!Number.isSafeInteger(n))throw new oe({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${t}n`});return n}function Ce(r,e={}){let t=O(r);return e.size&&(y(t,{size:e.size}),t=v(t,{dir:"right"})),new TextDecoder().decode(t)}const Ze={gwei:9,wei:18},Re={ether:-9,wei:9};function Se(r,e){let t=r.toString();const n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(e,"0");let[a,s]=[t.slice(0,t.length-e),t.slice(t.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${a||"0"}${s?`.${s}`:""}`}function w(r,e="wei"){return Se(r,Re[e])}class pe extends o{constructor({cause:e,message:t}={}){var a;const n=(a=t==null?void 0:t.replace("execution reverted: ",""))==null?void 0:a.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(pe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Pe extends o{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${w(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Pe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class _e extends o{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${w(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(_e,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Ie extends o{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(Ie,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class $e extends o{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
3
3
|
`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty($e,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Ue extends o{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Ue,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class De extends o{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
4
4
|
`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(De,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class je extends o{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(je,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Le extends o{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Le,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ze extends o{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ze,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Be extends o{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${w(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${w(n)} gwei`:""}).`].join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,L as n}from"./react-
|
|
1
|
+
import{j as t,L as n}from"./react-BMZSDQJw.js";import{u as s,t as o,I as e,B as a}from"./index-Cw_zTgKJ.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";function c(){return s({title:o("seo.notFound.title"),noindex:!0}),t.jsxs("div",{className:"notfound","data-testid":"notfound",children:[t.jsx(e,{name:"cart",className:"notfound__ico"}),t.jsx("h1",{className:"notfound__title",children:o("notFound.title")}),t.jsx("p",{className:"muted",children:o("notFound.body")}),t.jsx(a,{as:n,to:"/assets",variant:"purple",children:o("notFound.cta")})]})}export{c as NotFound,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as w,a2 as K,j as M,t as a,l as P,B as f,C as j,p as E,q as C,E as $,x as T,r as O}from"./index-Cw_zTgKJ.js";import{d as q}from"./dcl-schemas-BICTSpB5.js";import{u as F,r as m,j as s}from"./react-BMZSDQJw.js";import{a as H,b as X,s as J,i as V,e as Y,c as z}from"./wallet-kind-Cg4yayUr.js";import{f as R}from"./errors-BrsnEff4.js";import{E as U}from"./ErrorNotice-DDr3KjIH.js";const I=()=>`${w.builderServerUrl}/v1`;function B(e){return Array.isArray(e)?e:"results"in e&&Array.isArray(e.results)?e.results:"data"in e&&Array.isArray(e.data)?e.data:[]}async function Q(e,r){const t=await K(e,{method:"GET",identity:r,metadata:{}});if(!t.ok)throw new Error(`builder-server ${t.status}: ${await t.text()}`);const l=await t.json();return l.data??l}function Z(e,r){const t=r-e;return t>0?t:0}function ee(e){var r,t,l,i,n;return((t=(r=e.data)==null?void 0:r.wearable)==null?void 0:t.category)??((i=(l=e.data)==null?void 0:l.emote)==null?void 0:i.category)??((n=e.data)==null?void 0:n.category)??e.type??"wearable"}function A(e){return`${I()}/storage/contents/${e}`}function S(e,r){if(!e)return"";if(/^https?:\/\//.test(e))return e;const t=r==null?void 0:r[e];return t?A(t):/^(ba|Qm)/.test(e)?A(e):""}async function se(e,r){try{const t=await fetch(`${I()}/items/${e}/${r}/contents`);if(!t.ok)return{};const l=await t.json();return l.data??l}catch{return{}}}async function ae(e,r,t){const l=S(e.thumbnail,e.contents)||S("thumbnail.png",e.contents);if(l)return l;if(r&&t){const i=await se(r,t);return S(e.thumbnail,i)||S("thumbnail.png",i)||S("image.png",i)}return""}async function te(e,r){const t=`${I()}/${e.toLowerCase()}/collections?is_published=true`,l=await Q(t,r);return B(l).filter(i=>i.is_published&&!!i.contract_address).map(i=>({id:i.id,name:i.name,contractAddress:i.contract_address.toLowerCase(),isPublished:i.is_published,isApproved:i.is_approved,minters:(i.minters??[]).map(n=>n.toLowerCase())}))}async function re(e,r){const t=`${I()}/collections/${e.id}/items`,l=await Q(t,r);return(await Promise.all(B(l).map(async n=>{const x=n.rarity??"common",y=Number(n.total_supply??0)||0;let o;try{o=q.Rarity.getMaxSupply(x)}catch{o=0}const _=(n.contract_address??e.contractAddress).toLowerCase(),p=n.blockchain_item_id??"";return{id:n.id,collectionId:e.id,collectionName:e.name,contractAddress:_,blockchainItemId:p,name:n.name,category:ee(n),rarity:x,thumbnail:await ae(n,_,p),type:n.type??"wearable",isPublished:n.is_published??e.isPublished,isApproved:n.is_approved??e.isApproved,totalSupply:y,maxSupply:o,remainingSupply:Z(y,o),minters:e.minters}}))).filter(ie)}function ie(e){return e.isPublished&&e.isApproved&&e.blockchainItemId!==""&&e.blockchainItemId!=null&&e.remainingSupply>0}async function he(e,r){const t=await te(e,r);return(await Promise.all(t.map(async i=>{try{return await re(i,r)}catch{return[]}}))).flat()}const ne=1e3*60*60*24*182;function ye({asset:e,session:r,onClose:t}){const l=M(),i=F(),[n,x]=m.useState("10"),[y,o]=m.useState(null),[_,p]=m.useState(null),[u,N]=m.useState(!1),[h,v]=m.useState(null);async function k(){p(null);const c=Number(n);if(!Number.isInteger(c)||c<=0){p(a("sellModal.errorWholeNumber"));return}N(!0);try{o(a("sellModal.statusPreparing")),await H({signer:r.signer,contractAddress:e.contractAddress,chainId:e.chainId}),o(a("sellModal.statusListing"));const g=await X({signer:r.signer,nft:{contractAddress:e.contractAddress,tokenId:e.tokenId,network:e.network,chainId:e.chainId},usdPrice:c/10,expiresAtMs:Date.now()+ne});o(a("sellModal.statusPublishing")),await E(g,r.identity),o(null),v(c),C("Shop Listed Item",{item_id:e.itemId??e.tokenId??null,contract_address:e.contractAddress,price_credits:c,price_usd:c/10,listing_type:"secondary",is_primary:!1}),$.success(a("sellModal.toastOnSale",{name:e.name})),l.invalidateQueries({queryKey:["my-assets",r.address]})}catch(g){T(g,{flow:"list_secondary"}),C("Shop Listing Failed",{listing_type:"secondary",error_code:O(g)}),p(R(g,a("sellModal.errorGeneric"))),o(null)}finally{N(!1)}}function L(){t(),i(`/item/${e.contractAddress}/${e.tokenId}`)}return h!==null?s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:a("sellModal.successTitle")}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:[a("sellModal.listedFor")," ",s.jsxs("strong",{children:[s.jsx(P,{className:"ccy-mark"})," ",h]})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,children:a("getCredits.done")}),s.jsx(f,{variant:"purple",onClick:L,children:a("sellModal.viewInShop")})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal","data-testid":"modal",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("h2",{className:"modal__title",children:a("sellModal.listTitle",{name:e.name})}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsxs("label",{className:"field",children:[s.jsx("span",{children:a("sellModal.priceLabel",{currency:j.name})}),s.jsx("input",{type:"number",min:"1",step:"1",value:n,onChange:c=>x(c.target.value),disabled:u})]}),s.jsx("p",{className:"muted small",children:a("sellModal.pricedInWhole",{currency:j.name,currencySingular:j.nameSingular})}),y?s.jsx("p",{className:"muted",children:y}):null,s.jsx(U,{message:_}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,disabled:u,children:a("sellModal.cancel")}),s.jsx(f,{onClick:()=>void k(),disabled:u,children:u?a("sellModal.listing"):a("sellModal.putOnSale")})]})]})})}const le=1e3*60*60*24*182;function ge({item:e,session:r,onClose:t}){const l=M(),i=F(),[n,x]=m.useState("10"),[y,o]=m.useState(null),[_,p]=m.useState(null),[u,N]=m.useState(!1),[h,v]=m.useState(null),[k,L]=m.useState(null),c=w.chainId,g=J(r.providerType);m.useEffect(()=>{let d=!1;return(async()=>{try{const b=await V({contractAddress:e.contractAddress,chainId:c});d||v(b)}catch{d||v(!1)}})(),()=>{d=!0}},[e.contractAddress,c]);async function W(){p(null);const d=Number(n);if(!Number.isInteger(d)||d<=0){p(a("primaryList.errorWholeNumber"));return}N(!0);try{h||(o(a("primaryList.statusEnabling")),await Y({signer:r.signer,contractAddress:e.contractAddress,chainId:c}),v(!0)),o(a("primaryList.statusPublishing"));const b=await z({signer:r.signer,item:{contractAddress:e.contractAddress,itemId:e.blockchainItemId,network:q.Network.MATIC,chainId:c},usdPrice:d/10,uses:e.remainingSupply,expiresAtMs:Date.now()+le});o(a("primaryList.statusFinishing")),await E(b,r.identity),o(null),L(d),C("Shop Listed Item",{item_id:e.blockchainItemId,contract_address:e.contractAddress,price_credits:d,price_usd:d/10,listing_type:"primary",is_primary:!0}),$.success(a("primaryList.toastOnSale",{name:e.name})),l.invalidateQueries({queryKey:["publishable-items"]}),l.invalidateQueries({queryKey:["collection-sale-state"]})}catch(b){T(b,{flow:"list_primary"}),C("Shop Listing Failed",{listing_type:"primary",error_code:O(b)}),p(R(b,a("primaryList.errorGeneric"))),o(null)}finally{N(!1)}}function D(){t(),i(`/item/${e.contractAddress}/${e.blockchainItemId}`)}const G=u?a("primaryList.listing"):h===!1?a("primaryList.enableAndPutOnSale"):a("primaryList.putOnSale");return k!==null?s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:a("primaryList.successTitle")}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:[a("primaryList.listedFor")," ",s.jsxs("strong",{children:[s.jsx(P,{className:"ccy-mark"})," ",k]})," ",a("primaryList.dotAvailable",{count:e.remainingSupply})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,children:a("getCredits.done")}),s.jsx(f,{variant:"purple",onClick:D,children:a("primaryList.viewInShop")})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:s.jsxs("div",{className:"modal","data-testid":"modal",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("h2",{className:"modal__title",children:a("primaryList.publishTitle",{name:e.name})}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"muted small",children:a("primaryList.fromCollection",{collectionName:e.collectionName,count:e.remainingSupply})}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:a("primaryList.priceLabel",{currency:j.name})}),s.jsx("input",{type:"number",min:"1",step:"1",value:n,onChange:d=>x(d.target.value),disabled:u})]}),s.jsx("p",{className:"muted small",children:a("primaryList.pricedInWhole",{currency:j.name,currencySingular:j.nameSingular})}),h===!1&&!u?g?s.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeConfirm",{collectionName:e.collectionName})}):s.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeManaged",{collectionName:e.collectionName})}):h===!0&&!u?g?s.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyConfirm")}):s.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyManaged")}):null,y?s.jsx("p",{className:"muted",children:y}):null,s.jsx(U,{message:_}),s.jsxs("div",{className:"modal__actions",children:[s.jsx(f,{variant:"ghost",onClick:t,disabled:u,children:a("primaryList.cancel")}),s.jsx(f,{onClick:()=>void W(),disabled:u||h===null,children:h===null?a("primaryList.checking"):G})]})]})})}export{ge as P,ye as S,he as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s,u as se,r as n,L as te}from"./react-
|
|
1
|
+
import{j as s,u as se,r as n,L as te}from"./react-BMZSDQJw.js";import{t as a,y,s as _,S as ae,u as ie,g as re,j as ne,I as E,B as P,E as R}from"./index-Cw_zTgKJ.js";import{u as oe,d as le,t as ce,L as de,i as B,a as v,s as me}from"./useStore-IaDRl00u.js";import{E as M}from"./ErrorNotice-DDr3KjIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-CeDRuWE-.js";import"./intl-CBcMB1D2.js";const ue="https://cdn.decentraland.org/@dcl/shop/0.1.0-29920979542.commit-4d76953/assets/template-cover-1-BETekfHg.jpeg",pe="https://cdn.decentraland.org/@dcl/shop/0.1.0-29920979542.commit-4d76953/assets/template-cover-2-Dni9s0i_.jpeg",ge=Object.assign({"../assets/creator-covers/template-cover-1.jpeg":ue,"../assets/creator-covers/template-cover-2.jpeg":pe}),h=Object.entries(ge).sort(([i],[d])=>i.localeCompare(d)).map(([i,d])=>({name:i.split("/").pop(),url:d})),ve=ae`
|
|
2
2
|
to {
|
|
3
3
|
transform: rotate(360deg);
|
|
4
4
|
}
|
|
@@ -7,7 +7,7 @@ import{j as s,u as se,r as n,L as te}from"./react-C51i12iP.js";import{t as a,a2
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
gap: 12px;
|
|
10
|
-
color: ${
|
|
10
|
+
color: ${y.colors.muted};
|
|
11
11
|
|
|
12
12
|
&[data-direction='row'] {
|
|
13
13
|
flex-direction: row;
|
|
@@ -20,8 +20,8 @@ import{j as s,u as se,r as n,L as te}from"./react-C51i12iP.js";import{t as a,a2
|
|
|
20
20
|
flex: none;
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
border-style: solid;
|
|
23
|
-
border-color: ${
|
|
24
|
-
border-top-color: ${
|
|
23
|
+
border-color: ${y.colors.line};
|
|
24
|
+
border-top-color: ${y.colors.accent};
|
|
25
25
|
animation: ${ve} 0.8s linear infinite;
|
|
26
26
|
|
|
27
27
|
&[data-size='small'] {
|
|
@@ -50,4 +50,4 @@ import{j as s,u as se,r as n,L as te}from"./react-C51i12iP.js";import{t as a,a2
|
|
|
50
50
|
align-self: center;
|
|
51
51
|
min-width: 200px;
|
|
52
52
|
margin-top: 8px;
|
|
53
|
-
`,O=1e6,A={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function D(i){return`${(i/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function
|
|
53
|
+
`,O=1e6,A={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function D(i){return`${(i/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function Le(){ie({title:a("seo.storeSettings.title"),noindex:!0});const{session:i,signIn:d}=re(),b=se(),j=ne(),c=i==null?void 0:i.address,{data:S,isLoading:F}=oe(c),[r,m]=n.useState(A),[C,L]=n.useState(A),[k,p]=n.useState(),[g,$]=n.useState(!1),[o,N]=n.useState(null),[f,V]=n.useState({}),z=n.useRef(null);n.useEffect(()=>{if(S){const e=le(S);m(e),L(e),p(void 0),N(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[S]),n.useEffect(()=>{let e=!1;return Promise.all(h.map(async t=>[t.name,await ce(t.url)])).then(t=>{e||V(Object.fromEntries(t))}).catch(()=>{}),()=>{e=!0}},[]);const x=n.useMemo(()=>{const e=h.find(l=>r.coverName===`cover/${l.name}`);if(e)return e.name;const t=r.coverHash?h.find(l=>f[l.name]===r.coverHash):void 0;return t==null?void 0:t.name},[r.coverName,r.coverHash,f]);n.useEffect(()=>{o!=null&&o.hash&&h.some(e=>f[e.name]===o.hash)&&N(null)},[f,o]);const I=k!==void 0&&k>O,Y=n.useMemo(()=>de.filter(e=>!B(e,r.links[e])),[r.links]),K=I||Y.length>0,w=n.useMemo(()=>JSON.stringify(r)!==JSON.stringify(C),[r,C]),q=w&&!K&&!g;if(n.useEffect(()=>{if(!w)return;const e=t=>{t.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[w]),!i)return s.jsxs("section",{className:"store-settings store-settings--signin","aria-label":a("storeSettings.title"),children:[s.jsx("h1",{className:"store-settings__title",children:a("storeSettings.title")}),s.jsx("p",{className:"muted",children:a("storeSettings.signInPrompt")}),s.jsx(be,{variant:"purple",onClick:d,children:a("storeSettings.signIn")})]});function G(e,t){p(void 0),m(l=>({...l,cover:t,coverName:`cover/${e}`,coverHash:""}))}const J=["image/png","image/jpeg","image/webp"];function Q(e){var H;const t=(H=e.target.files)==null?void 0:H[0];if(!t||!J.includes(t.type))return;p(t.size);const l=`cover/${t.name}`,u=new FileReader;u.onload=()=>{const T=u.result;N({url:T,name:l,hash:""}),m(ee=>({...ee,cover:T,coverName:l,coverHash:""}))},u.readAsDataURL(t)}function U(){o&&(p(void 0),m(e=>({...e,cover:o.url,coverName:o.name,coverHash:o.hash})))}function W(e,t){const l=t?(v[e]+t).replace(/\s/g,""):"";m(u=>({...u,links:{...u.links,[e]:l}}))}function X(e){const t=r.links[e];return e==="website"?t:t.replace(v[e],"")}async function Z(){if(!(!c||!i)){$(!0);try{await me(c,r,i.identity),L(r),p(void 0),await j.invalidateQueries({queryKey:["store",c.toLowerCase()]}),R.success(a("storeSettings.saved")),b(`/assets/creator/${c}`)}catch{R.error(a("storeSettings.saveError"))}finally{$(!1)}}}return s.jsxs("section",{className:"store-settings","aria-label":a("storeSettings.title"),children:[s.jsxs("div",{className:"store-settings__head",children:[s.jsxs("div",{className:"store-settings__heading",children:[c?s.jsx(te,{className:"store-settings__back",to:`/assets/creator/${c}`,title:a("storeSettings.back"),"aria-label":a("storeSettings.back"),children:s.jsx(E,{name:"arrow-left"})}):null,s.jsx("h1",{className:"store-settings__title",children:a("storeSettings.title")})]}),c?s.jsxs("a",{className:"store-settings__guest",href:`/assets/creator/${c}`,target:"_blank",rel:"noopener noreferrer",children:[a("storeSettings.seeAsGuest"),s.jsx(E,{name:"external-link"})]}):null]}),F?s.jsx(_e,{size:"large",label:a("storeSettings.loading"),className:"store-settings__loading"}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"field",children:[s.jsx("span",{className:"field__label",children:a("storeSettings.cover")}),s.jsxs("div",{className:"cover-picker",role:"group","aria-label":a("storeSettings.cover"),children:[h.map(e=>{const t=x===e.name;return s.jsx("button",{type:"button",className:`cover-picker__tile${t?" is-selected":""}`,"data-testid":"cover-picker-tile","data-selected":t,"aria-pressed":t,onClick:()=>G(e.name,e.url),children:s.jsx("img",{src:e.url,alt:"",loading:"lazy"})},e.name)}),o?s.jsx("button",{type:"button",className:`cover-picker__tile cover-picker__tile--custom${x?"":" is-selected"}`,"data-testid":"cover-picker-tile","data-variant":"custom","data-selected":!x,"aria-pressed":!x,onClick:U,children:s.jsx("img",{src:o.url,alt:""})}):null,s.jsxs("button",{type:"button",className:"cover-picker__tile cover-picker__upload","data-testid":"cover-picker-tile","data-variant":"upload",onClick:()=>{var e;return(e=z.current)==null?void 0:e.click()},children:[s.jsx(E,{name:"upload"}),s.jsx("span",{children:a("storeSettings.upload")})]}),s.jsx("input",{ref:z,type:"file",accept:"image/png, image/jpeg, image/webp",className:"cover-picker__input","data-testid":"cover-picker-input",onChange:Q})]}),I?s.jsx(M,{message:a("storeSettings.sizeError",{max:D(O),current:D(k)})}):null]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{className:"field__label",children:a("storeSettings.description")}),s.jsx("textarea",{value:r.description,rows:4,disabled:g,onChange:e=>m(t=>({...t,description:e.target.value}))})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{className:"field__label",children:a("storeSettings.website")}),s.jsx("input",{type:"url",value:r.links.website,placeholder:v.website,disabled:g,onChange:e=>m(t=>({...t,links:{...t.links,website:e.target.value.replace(/\s/g,"")}}))}),B("website",r.links.website)?null:s.jsx(M,{message:a("storeSettings.linkError",{value:v.website})})]}),["twitter","discord","facebook"].map(e=>s.jsxs("label",{className:"field",children:[s.jsx("span",{className:"field__label",children:a(`storeSettings.${e}`)}),s.jsxs("div",{className:"field__prefixed",children:[s.jsx("span",{className:"field__prefix",children:v[e]}),s.jsx("input",{type:"text",value:X(e),disabled:g,onChange:t=>W(e,t.target.value)})]})]},e)),s.jsx("div",{className:"store-settings__actions",children:s.jsx(P,{variant:"purple",className:"store-settings__save","data-testid":"store-settings-save",onClick:()=>void Z(),disabled:!q,children:g?a("storeSettings.saving"):a("storeSettings.save")})})]})]})}export{Le as StoreSettings,Le as default};
|