@dcl/shop 0.1.0 → 0.1.1-30909439604.commit-4721d83
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-BwdIaUnW.js → Activity-CiQm3fPZ.js} +7 -7
- package/_assets/{AnimatedBackground-DP8XKTVN.js → AnimatedBackground-BFRTkuDo.js} +1 -1
- package/_assets/{Assets-Degiynxt.js → Assets--cn5UbRN.js} +50 -50
- package/_assets/{Assets.styles-CmDKBB8r.js → Assets.styles-CkJWzjdk.js} +1 -1
- package/_assets/{Authorizations-CJeq3VNJ.js → Authorizations-Cqqxn9wD.js} +7 -7
- package/_assets/{Cart-DsUb4sI3.js → Cart-ByLo0Q5U.js} +12 -12
- package/_assets/{CircularProgress-CNroeQ3o.js → CircularProgress-Cv24wKWu.js} +5 -5
- package/_assets/Collection-DbZpN_eH.js +119 -0
- package/_assets/{CollectionCarousel-D36c6dts.js → CollectionCarousel-DKVvizGs.js} +7 -7
- package/_assets/{ConstantsUtil-Dfwpy1eP.js → ConstantsUtil-CNJ3pGKv.js} +1 -1
- package/_assets/{ContentClient-D6ofwSpu.js → ContentClient-BJFWm8Bs.js} +1 -1
- package/_assets/Creator-CtdwyJXl.js +306 -0
- package/_assets/{DeploymentBuilder-ku3det23.js → DeploymentBuilder-CXBC22K0.js} +1 -1
- package/_assets/{ErrorNotice-COIh7ro4.js → ErrorNotice-51eOicue.js} +1 -1
- package/_assets/{ExchangeController-DOL-_brz.js → ExchangeController--vn2md5b.js} +1 -1
- package/_assets/{GetCredits-BkjOQ5or.js → GetCredits-CnE9Mkj3.js} +10 -10
- package/_assets/{HelpersUtil-2hZP33Du.js → HelpersUtil-Dg90boC1.js} +1 -1
- package/_assets/ImportListings-BxeqcxAE.js +461 -0
- package/_assets/{ItemDetail-D57x9bXl.js → ItemDetail-CqkeMLxu.js} +251 -281
- package/_assets/LoadMore-BolkAKn7.js +7 -0
- package/_assets/ManaPricingBanner.styles-DKUacHFQ.js +74 -0
- package/_assets/{MenuList-d6ca0DH6.js → MenuList-D4kLbIwO.js} +2 -2
- package/_assets/MyAssets-v3gryjCk.js +381 -0
- package/_assets/{MyFavorites-DxYh88wB.js → MyFavorites-Bg2hc3VG.js} +2 -2
- package/_assets/{NetworkUtil-HlUKXKcF.js → NetworkUtil-Dh3JWXso.js} +1 -1
- package/_assets/{NotFound-DA15lCMu.js → NotFound-R9sTwMQk.js} +1 -1
- package/_assets/{NotificationsBell-C8r1c8mg.js → NotificationsBell-BoefPrvQ.js} +1 -1
- package/_assets/StoreSettings-GYoZCBBR.js +239 -0
- package/_assets/Success-CGQGJeM-.js +296 -0
- package/_assets/{SwapController-CRz8E17o.js → SwapController-BcfprLwB.js} +1 -1
- package/_assets/{Tooltip-D92WFEmr.js → Tooltip-CoMCVLgL.js} +1 -1
- package/_assets/{TradeService-DIWR3GwD.js → TradeService-Be5Jm26-.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BuQKbZaF.js → W3MFrameProviderSingleton-BLAdE798.js} +3 -3
- package/_assets/{WebCryptoP256-BFDAPngw.js → WebCryptoP256-B2g3GckQ.js} +1 -1
- package/_assets/{authorizations-BNs0emga.js → authorizations-FkFZVBeE.js} +1 -1
- package/_assets/{basic-C6XisVyZ.js → basic-DEelCa7C.js} +1 -1
- package/_assets/{biconomy-09nDKxxN.js → biconomy-BuAmKMqp.js} +1 -1
- package/_assets/{browseLayout.styles-CTl6D_zv.js → browseLayout.styles-6Bx0cPB_.js} +6 -6
- package/_assets/{browser-BGlawS--.js → browser-CMge1DAk.js} +1 -1
- package/_assets/{browser-ponyfill-Dm9rZGtt.js → browser-ponyfill-DdemUjDS.js} +1 -1
- package/_assets/{builder-C8hUH3RB.js → builder-Z4iUHEpn.js} +1 -1
- package/_assets/{buy-Cl7snZzi.js → buy-DiLzTHFT.js} +1 -1
- package/_assets/{buy-gasless-DVLP7U8S.js → buy-gasless-Cn4_YLUa.js} +1 -1
- package/_assets/{categories-BGGjSLd9.js → categories-Byz019bF.js} +8 -8
- package/_assets/{ccip-Dx_KcJBs.js → ccip-CCZIckpG.js} +1 -1
- package/_assets/{ccip-DLDLk2fK.js → ccip-DUqe0wPP.js} +1 -1
- package/_assets/{chains-DjVUcpdx.js → chains-DwiEm2Ny.js} +1 -1
- package/_assets/{clsx-BY1AO2V7.js → clsx-sy6nSRXN.js} +2 -2
- package/_assets/{common-BzdjGk0Y.js → common-ChK99Sbg.js} +1 -1
- package/_assets/confettiAnimation-BpyTLLuX.js +1 -0
- package/_assets/{controller-ZqrzYJ4o.js → controller-D2U901D4.js} +2 -2
- package/_assets/{core-CWR04nJr.js → core-BqndrHwC.js} +4 -4
- package/_assets/{createSvgIcon-BUIodiet.js → createSvgIcon-nAlfqqgf.js} +5 -5
- package/_assets/{custom-DMjRmtpL.js → custom-DJvYgxJy.js} +1 -1
- package/_assets/{data-capture-SoaOqGRY.js → data-capture-CLOU8jih.js} +1 -1
- package/_assets/{decimals-rMqzXjFU.js → decimals-C49MnWnC.js} +1 -1
- package/_assets/decimals-DenLQ0L2.js +1 -0
- package/_assets/{detectExtension-0JcORGBX.js → detectExtension-Bs6N_T7E.js} +1 -1
- package/_assets/{email-i8v6FMCW.js → email-BxF_EMmd.js} +1 -1
- package/_assets/{embedded-wallet-DBT_Ev8g.js → embedded-wallet-6IYwV5B_.js} +1 -1
- package/_assets/emotion-styled.browser.esm-9O-_UQ_M.js +1 -0
- package/_assets/{engine-Bn2HNIpq.js → engine-CDTFOGA6.js} +1 -1
- package/_assets/{errors-Ce5OngHE.js → errors-sJnX14Ki.js} +1 -1
- package/_assets/estimate-l1-fee-B4XbNvFY.js +1 -0
- package/_assets/eth_estimateGas-DaegCW9w.js +1 -0
- package/_assets/{eth_getStorageAt-DIGus6Ic.js → eth_getStorageAt-g-V8ByC9.js} +1 -1
- package/_assets/eth_getTransactionCount-ChnmCar0.js +1 -0
- package/_assets/{ethereum-7duKFA0R.js → ethereum-DdnrEX6r.js} +1 -1
- package/_assets/{ethers-CXBJm_wN.js → ethers-rFeF6PNV.js} +1 -1
- package/_assets/{execute-DO9Rpu0c.js → execute-D8YtDqpj.js} +2 -2
- package/_assets/{extractIPFS-CTs5XnuT.js → extractIPFS-DiQ3ktqZ.js} +1 -1
- package/_assets/{features-5tSUGHg0.js → features-B8MZg8q9.js} +1 -1
- package/_assets/{fetchTokenMetadata-CHnDbBcr.js → fetchTokenMetadata-Cn6UkNbd.js} +2 -2
- package/_assets/field.styles-o0yoMx97.js +70 -0
- package/_assets/{fortmatic-CCMQbesB.js → fortmatic-ZrVXe0if.js} +1 -1
- package/_assets/{get-bytecode-Bg8NviKV.js → get-bytecode-B5xpAv7a.js} +1 -1
- package/_assets/get-ecosystem-wallet-info-DyEERgSx.js +1 -0
- package/_assets/{getBalance-BU5lPIM1.js → getBalance-pdi104jy.js} +2 -2
- package/_assets/{getInstalledModules-KP-LSI0j.js → getInstalledModules-vRyVzBkY.js} +1 -1
- package/_assets/{getNFT-Ctbterca.js → getNFT-ChdTpPL_.js} +2 -2
- package/_assets/getNFT-JwHQ_s5F.js +1 -0
- package/_assets/{getThemeProps-xrG7EYWl.js → getThemeProps-CFDZlxj4.js} +1 -1
- package/_assets/{grid.styles-B1mDfzvi.js → grid.styles-DVBPQuRz.js} +1 -1
- package/_assets/{hashTypedData-DaCcjWXS.js → hashTypedData-2Z2_gEL6.js} +1 -1
- package/_assets/{hashTypedData-BiojmScK.js → hashTypedData-DP9JOjjX.js} +1 -1
- package/_assets/{in-app-Sb-fFEpv.js → in-app-CRH3jQep.js} +1 -1
- package/_assets/{in-app-wallet-calls-BYLiaB1J.js → in-app-wallet-calls-Dp9TxCgN.js} +1 -1
- package/_assets/{index-BbxUYBIl.js → index--coIj_2Q.js} +2 -2
- package/_assets/{index-BV7d8LIf.js → index-5o0_4PJn.js} +1 -1
- package/_assets/{index-CcRW7qMf.js → index-6_pDklk8.js} +1 -1
- package/_assets/{index-BBM5Da88.js → index-72R1sLRe.js} +1 -1
- package/_assets/{index-CcrwUr4B.js → index-B1YUW9FQ.js} +2 -2
- package/_assets/index-B2O7rGJL.js +1 -0
- package/_assets/{index-BCG-_RTT.js → index-B8_IX_3e.js} +1 -1
- package/_assets/{index-Cw22meEP.js → index-BGPVOBHa.js} +1 -1
- package/_assets/{index-DQ2tXB-9.js → index-BHMMC_4O.js} +1 -1
- package/_assets/{index-DmGcqzuR.js → index-BLpG8mks.js} +1 -1
- package/_assets/{index-CD9t0mSF.js → index-BRGDK96N.js} +1 -1
- package/_assets/{index-BzC7P3rh.js → index-BUbZ4ieP.js} +1 -1
- package/_assets/{index-BdWG2PoE.js → index-BWXsvDqD.js} +1 -1
- package/_assets/{index-CKo0vnRV.js → index-BZWNTqaV.js} +1 -1
- package/_assets/{index-DjcstBXY.js → index-BaUli81x.js} +1 -1
- package/_assets/index-Bbgy14tN.js +1 -0
- package/_assets/index-BiIZh9R9.js +2820 -0
- package/_assets/{index-CE-Z89iI.js → index-BkP6Akod.js} +1 -1
- package/_assets/{index-8EYFemjW.js → index-BszwI7-F.js} +1 -1
- package/_assets/{index-CEP90DOS.js → index-BtLL7F-4.js} +1 -1
- package/_assets/{index-DC-Z7MbP.js → index-BtkxBg3h.js} +2 -2
- package/_assets/{index-DWFCwLfs.js → index-Bu5mtkuE.js} +1 -1
- package/_assets/{index-6HemuoHH.js → index-C-E_Jk-6.js} +1 -1
- package/_assets/{index-Bb2mLVTh.js → index-C4AfvPtb.js} +1 -1
- package/_assets/{index-CSqaG5Rs.js → index-CBrp3dUZ.js} +1 -1
- package/_assets/{index-DgMAf2q5.js → index-CCoJpS6M.js} +1 -1
- package/_assets/{index-DMKhInQc.js → index-CDCj0Qak.js} +2 -2
- package/_assets/{index-DvlgcdsJ.js → index-CJ03r2wd.js} +1 -1
- package/_assets/{index-hesFTmUX.js → index-CY1VUN_S.js} +1 -1
- package/_assets/{index-DgKHc2Pp.js → index-CYEynknO.js} +1 -1
- package/_assets/{index-OiKTI-o_.js → index-CZQ-Avg8.js} +1 -1
- package/_assets/{index-BNnLGudB.js → index-ClSZl7Vh.js} +1 -1
- package/_assets/{index-3x98-rKq.js → index-CsEaqK5K.js} +1 -1
- package/_assets/{index-DbkHKS7K.js → index-Csd0nRMS.js} +2 -2
- package/_assets/{index-BpA1I7hL.js → index-CwLvQ9MJ.js} +1 -1
- package/_assets/{index-cSAleFRI.js → index-CyyhNrl2.js} +1 -1
- package/_assets/{index-CSu0sG0T.js → index-D0JhTMR7.js} +1 -1
- package/_assets/{index-CrlwRjah.js → index-D29EUWHC.js} +1 -1
- package/_assets/{index-BsQQxLJN.js → index-D3OKsJLK.js} +1 -1
- package/_assets/{index-DLEx9ISf.js → index-D9Dv7ZRq.js} +1 -1
- package/_assets/{index-PJSp7ijP.js → index-DDqqXhJL.js} +3 -3
- package/_assets/{index-BQG7R5QF.js → index-DGuNIM9a.js} +1 -1
- package/_assets/{index-Cv-5v5Ze.js → index-DHFAjoyI.js} +1 -1
- package/_assets/{index-BgKl-ydS.js → index-DXe1QzPN.js} +1 -1
- package/_assets/{index-CcZyuO92.js → index-DaBMwl5V.js} +1 -1
- package/_assets/{index-C6rpfPMS.js → index-DbyPzhzJ.js} +1 -1
- package/_assets/{index-BIJ2qchS.js → index-Det24uTr.js} +3 -3
- package/_assets/{index-BEtbI0Zv.js → index-Dhe2yejG.js} +1 -1
- package/_assets/{index-B4EKT3oF.js → index-DitauyL5.js} +1 -1
- package/_assets/{index-DFzHpbP5.js → index-DkdxS38k.js} +1 -1
- package/_assets/{index-DyGnajSZ.js → index-DkmumT6q.js} +1 -1
- package/_assets/{index-CviVJpxw.js → index-DquJiMJI.js} +1 -1
- package/_assets/{index-Bor4cMvk.js → index-Duy_bLYT.js} +1 -1
- package/_assets/{index-qVmIz0zn.js → index-Dz7l4WRb.js} +1 -1
- package/_assets/{index-ZoIpzYhg.js → index-PfgUlDb3.js} +1 -1
- package/_assets/{index-RSxxMPji.js → index-Rjrwrr8k.js} +1 -1
- package/_assets/{index-BNEWEGXe.js → index-ThwwXj7K.js} +1 -1
- package/_assets/{index-DNaX9VGC.js → index-UOQDoXBN.js} +1 -1
- package/_assets/index-XMkvXJnG.js +2 -0
- package/_assets/{index-Cso0PIKg.js → index-efx_UGwj.js} +3 -3
- package/_assets/{index-D20v1ehb.js → index-hBIDXrfA.js} +1 -1
- package/_assets/{index-Fyrl3bgj.js → index-jDLQZQqn.js} +1 -1
- package/_assets/{index-DETprG7w.js → index-klYUwFTu.js} +1 -1
- package/_assets/index.es-CWcx_MPC.js +11 -0
- package/_assets/{index.es-4ugP_xPq.js → index.es-DGdQax5Y.js} +1 -1
- package/_assets/{index.es-DWjGiGDB.js → index.es-DWEmsLX5.js} +4 -4
- package/_assets/{index.es-BWoKVfSl.js → index.es-gS9A1DPX.js} +1 -1
- package/_assets/{linkAccount-D303ryxj.js → linkAccount-DktwtO-V.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DxATZPfq.js → localBatchGatewayRequest-DoA6w-sg.js} +1 -1
- package/_assets/{mana-convert-BAmJatVq.js → mana-convert-8bdglmK2.js} +1 -1
- package/_assets/{mana-rate-COZYJ-5D.js → mana-rate-pg062I50.js} +1 -1
- package/_assets/{native-BbO8hggJ.js → native-DUHK6GYV.js} +1 -1
- package/_assets/{networks-BgOd8fAQ.js → networks-CS3wn-YQ.js} +1 -1
- package/_assets/{onramp-C1zk7UMI.js → onramp-_fU1CUPx.js} +1 -1
- package/_assets/{openzeppelin-JqnI3fjU.js → openzeppelin-Byo7VjiL.js} +1 -1
- package/_assets/{ownerOf-B0AowHTZ.js → ownerOf-9FPRCliB.js} +1 -1
- package/_assets/parseNft-f2SijHni.js +2 -0
- package/_assets/{parseSignature-DDl2oW2S.js → parseSignature-7zbxP3S5.js} +3 -3
- package/_assets/{parseSignature-Zp5jbuFC.js → parseSignature-B4bdR_8K.js} +1 -1
- package/_assets/{passkeys-D630VzP0.js → passkeys--fWD2NEw.js} +1 -1
- package/_assets/{pay-with-exchange-DB12e4gP.js → pay-with-exchange-Dk9Xcd3H.js} +1 -1
- package/_assets/{prepare-contract-call-BreQKHF6.js → prepare-contract-call-CUP20AbD.js} +1 -1
- package/_assets/{qr-overlay-BFMFKV4B.js → qr-overlay-DkdnRl_0.js} +3 -3
- package/_assets/{react-vyZjIDcS.js → react-IQWs2nb4.js} +1 -1
- package/_assets/{receive-C0p5nZhH.js → receive-C29mXrSs.js} +1 -1
- package/_assets/{resolveImplementation-Cpqxrq_P.js → resolveImplementation-Brjkq9B3.js} +1 -1
- package/_assets/{rpc-BGoWvIYj.js → rpc-Oikc4qrs.js} +1 -1
- package/_assets/{secp256k1-CxwkeDtE.js → secp256k1-CUWzbXuP.js} +1 -1
- package/_assets/{secp256k1-JugqR1gN.js → secp256k1-WT42JaIN.js} +1 -1
- package/_assets/{secp256k1-DN4fbJll.js → secp256k1-v_OYVKpT.js} +1 -1
- package/_assets/{send-DQo6irxp.js → send-CSdyFqol.js} +1 -1
- package/_assets/{send-batch-transaction-BwQeKmX0.js → send-batch-transaction-BlExRlz8.js} +1 -1
- package/_assets/{send-eip712-transaction-Di3Pi2C5.js → send-eip712-transaction-DyfTHBv1.js} +2 -2
- package/_assets/send-gasless-transaction-Daukbk69.js +2 -0
- package/_assets/{send-transaction-CboskMcL.js → send-transaction-kmfCvyrI.js} +2 -2
- package/_assets/{sendMetaTransaction-DfeiXpP_.js → sendMetaTransaction-BA-2MGdZ.js} +1 -1
- package/_assets/{sendRawTransaction-BgAwN3aK.js → sendRawTransaction-CTjGjbSv.js} +3 -3
- package/_assets/{sentry-B35L1FdR.js → sentry-DvOx8Rfb.js} +1 -1
- package/_assets/{serializeTransaction-Cn_3vzYE.js → serializeTransaction-BmaoI9rx.js} +1 -1
- package/_assets/{session-proposal-B7rpIMJh.js → session-proposal-nGkLb8fO.js} +1 -1
- package/_assets/{session-request--BJtbaZK.js → session-request-QSI6Jos8.js} +2 -2
- package/_assets/{sha256-NdAeiB0X.js → sha256-Dx4Jqb1P.js} +1 -1
- package/_assets/{signing-DiwulEsw.js → signing-VekuwpLK.js} +3 -3
- package/_assets/{socials-054eJtzB.js → socials-BkZgS9yz.js} +1 -1
- package/_assets/{swaps-BPYOHTwx.js → swaps-CAZTnQ-D.js} +1 -1
- package/_assets/{thirdweb-bX_k_ayM.js → thirdweb-Xk7WShny.js} +3 -3
- package/_assets/{to-serializable-transaction-caU-fqUx.js → to-serializable-transaction-C5BoASVF.js} +2 -2
- package/_assets/{totalSupply-BVfGieGk.js → totalSupply-CLQexq9U.js} +1 -1
- package/_assets/{trade-encoding-CXbhpVj8.js → trade-encoding-DgV-A2zO.js} +1 -1
- package/_assets/{transaction-8aHmZ7ni.js → transaction-ToPxlTkC.js} +1 -1
- package/_assets/{transactionReceipt-BzQM-iWX.js → transactionReceipt-BHGI1PBX.js} +1 -1
- package/_assets/{transactions-UfEKiBWb.js → transactions-paKZZL-W.js} +1 -1
- package/_assets/useCreditPacks-CaE-vAPX.js +1 -0
- package/_assets/useInfiniteGrid-CeEt3Zid.js +1 -0
- package/_assets/useManaRate-D4_9UlI5.js +1 -0
- package/_assets/{useSecondarySales-BUPg_0HB.js → useSecondarySales-3tEx5YvY.js} +1 -1
- package/_assets/{useStore-j0moew7P.js → useStore-ByHpJuVH.js} +2 -2
- package/_assets/useTheme-xAwBEFWH.js +1 -0
- package/_assets/{utils-jd03xFBb.js → utils-BgbaLlfC.js} +1 -1
- package/_assets/{verifyHash-BlPjp8uI.js → verifyHash-uE8nq1-h.js} +1 -1
- package/_assets/{w3m-modal-CJSqLQbS.js → w3m-modal-BWkASM7Q.js} +1 -1
- package/_assets/{w3m-modal-B1fkdBpv.js → w3m-modal-CIhzAZkD.js} +1 -1
- package/_assets/{wait-for-tx-receipt-nJ13gHYr.js → wait-for-tx-receipt-Ban9Kz9f.js} +1 -1
- package/_assets/{wallets-BfXeGzQ3.js → wallets-COZ4xX__.js} +5 -5
- package/_assets/{web-connector-D6DeRRYN.js → web-connector-gi_cmfjU.js} +3 -3
- package/_assets/{writeContract-D1XhZg5B.js → writeContract-MVlwq6Xg.js} +1 -1
- package/_assets/{zora-sepolia-Bt1F-uU9.js → zora-sepolia-BOt0KLBF.js} +1 -1
- package/_assets/{zoraTestnet-YWrqaPWn.js → zoraTestnet-BcRH2RHD.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Collection-CP0tfCsZ.js +0 -119
- package/_assets/Creator-CWs_Cx5f.js +0 -306
- package/_assets/ImportListings-DryzCKJV.js +0 -447
- package/_assets/LoadMore-BsvftUzw.js +0 -7
- package/_assets/MyAssets-OTnYju0y.js +0 -258
- package/_assets/StoreSettings-2jXFUoeV.js +0 -253
- package/_assets/Success-2HbLWhw3.js +0 -276
- package/_assets/decimals-CTAJwKFW.js +0 -1
- package/_assets/emotion-styled.browser.esm-C5sYTDtN.js +0 -1
- package/_assets/estimate-l1-fee-BYqkQ2bZ.js +0 -1
- package/_assets/eth_estimateGas-BfIHMLbI.js +0 -1
- package/_assets/eth_getTransactionCount-CmmgCgZ1.js +0 -1
- package/_assets/get-ecosystem-wallet-info-43Mjiw6m.js +0 -1
- package/_assets/getNFT-bNpY4yta.js +0 -1
- package/_assets/import-DbH_aWZX.js +0 -1
- package/_assets/index-9H7pG6F1.js +0 -1
- package/_assets/index-B3FH4SmC.js +0 -1
- package/_assets/index-CVMO2zcQ.js +0 -2
- package/_assets/index-Cn-oc3fB.js +0 -2835
- package/_assets/parseNft-yDYimY68.js +0 -2
- package/_assets/send-gasless-transaction-CCblCzAN.js +0 -2
- package/_assets/useCreditPacks-Ceg0Oam0.js +0 -1
- package/_assets/useInfiniteGrid-YGnKZcnB.js +0 -1
- package/_assets/useManaRate-BhMxx3e3.js +0 -1
- package/_assets/useTheme-cGCeJmwR.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{j as i,L as _,r as
|
|
1
|
+
import{j as i,L as _,r as P}from"./react-IQWs2nb4.js";import{s as n,B as W,t as a,l as R,m as F,e,n as G,o as O,I as z,p as B,u as w,q as K,c as Q,v as H,w as A,k as X,x as Z,y as T}from"./index-BiIZh9R9.js";import{a as J,b as U,c as V,d as Y,s as tt,f as it}from"./authorizations-FkFZVBeE.js";import{f as et}from"./builder-Z4iUHEpn.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-sJnX14Ki.js";import"./sentry-DvOx8Rfb.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-rFeF6PNV.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BA-2MGdZ.js";const nt=R`
|
|
2
2
|
to { transform: rotate(360deg); }
|
|
3
|
-
`,st=
|
|
3
|
+
`,st=R`
|
|
4
4
|
to { background-position: -200% 0; }
|
|
5
5
|
`,rt=n.section`
|
|
6
6
|
width: 100%;
|
|
@@ -48,7 +48,7 @@ import{j as i,L as _,r as F}from"./react-vyZjIDcS.js";import{s as n,B as G,t as
|
|
|
48
48
|
grid-template-columns: 44px 1fr;
|
|
49
49
|
grid-row-gap: 10px;
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,E=n.div`
|
|
52
52
|
height: 74px;
|
|
53
53
|
border-radius: 16px;
|
|
54
54
|
background: linear-gradient(100deg, #efeef2 30%, #e2e0e7 50%, #efeef2 70%);
|
|
@@ -110,7 +110,7 @@ import{j as i,L as _,r as F}from"./react-vyZjIDcS.js";import{s as n,B as G,t as
|
|
|
110
110
|
grid-column: 1 / -1;
|
|
111
111
|
justify-self: start;
|
|
112
112
|
}
|
|
113
|
-
`,
|
|
113
|
+
`,bt=n.button`
|
|
114
114
|
position: relative;
|
|
115
115
|
width: 46px;
|
|
116
116
|
height: 26px;
|
|
@@ -150,7 +150,7 @@ import{j as i,L as _,r as F}from"./react-vyZjIDcS.js";import{s as n,B as G,t as
|
|
|
150
150
|
outline: 2px solid ${a.colors.accent};
|
|
151
151
|
outline-offset: 2px;
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,zt=n.span`
|
|
154
154
|
width: 16px;
|
|
155
155
|
height: 16px;
|
|
156
156
|
border-radius: 50%;
|
|
@@ -181,6 +181,6 @@ import{j as i,L as _,r as F}from"./react-vyZjIDcS.js";import{s as n,B as G,t as
|
|
|
181
181
|
font-size: 22px;
|
|
182
182
|
font-weight: 700;
|
|
183
183
|
margin: 6px 0 0;
|
|
184
|
-
`,M=n(
|
|
184
|
+
`,M=n(W)`
|
|
185
185
|
margin-top: 12px;
|
|
186
|
-
`;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=
|
|
186
|
+
`;function j({descriptor:t,owner:s,signer:r,name:o,description:c,image:l,icon:p}){const v=K(),[h,y]=P.useState(!1),{data:u,isLoading:m,refetch:d}=w({queryKey:["authorization",t.id,s],queryFn:()=>it(t,s),staleTime:3e4});async function g(){if(h||m)return;const b=!u;y(!0);try{await tt({auth:t,signer:r,active:b}),await d(),v.setQueryData(["authorization",t.id,s],b),A.success(b?e("authorizations.toastActivated",{name:o}):e("authorizations.toastDeactivated",{name:o}))}catch($){X($,{flow:"authorizations",step:b?"grant":"revoke"}),A.error(at($,e("authorizations.errorGeneric")))}finally{y(!1)}}const D=m?e("authorizations.checking"):u?e("authorizations.active"):e("authorizations.inactive");return i.jsxs(ut,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[i.jsx(pt,{children:l?i.jsx("img",{src:l,alt:""}):p}),i.jsxs(mt,{children:[i.jsx(gt,{title:o,children:o}),i.jsx(xt,{children:c})]}),i.jsxs(yt,{children:[i.jsx(ft,{"data-active":!!u,children:D}),h?i.jsx(zt,{"aria-label":e("authorizations.working")}):i.jsx(bt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?e("authorizations.deactivateAria",{name:o}):e("authorizations.activateAria",{name:o}),disabled:m,onClick:()=>void g()})]})]})}const f=500,q=10,wt=f*q;async function N(t,s){const r=await T(t,{category:s,first:f}),o=Math.min(Math.ceil(r.total/f),q),c=await Promise.all(Array.from({length:Math.max(0,o-1)},(l,p)=>T(t,{category:s,first:f,skip:(p+1)*f})));return{assets:[...r.assets,...c.flatMap(l=>l.assets)],truncated:r.total>wt}}function vt(t){return w({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([N(t,"wearable"),N(t,"emote")]),o=new Map;for(const c of[...s.assets,...r.assets]){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return{collections:[...o.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function kt(t){return w({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:Z})}function Ct(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const o=H(t);return o===t?e("authorizations.collectionFallback"):o}function $t(t,s){return w({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await et(t,s),o=new Map;for(const c of r){const l=c.contractAddress.toLowerCase();o.has(l)||o.set(l,c)}return[...o.values()]}})}function _t(){F({title:e("authorizations.title"),noindex:!0});const{session:t,signIn:s}=G(),r=Q.chainId,o=O(t==null?void 0:t.providerType),{data:c,isLoading:l}=vt(o?t==null?void 0:t.address:void 0),{data:p,isLoading:v}=kt(!!o&&!!(t!=null&&t.address)),{data:h,isLoading:y}=$t(o?t==null?void 0:t.address:void 0,o?t==null?void 0:t.identity:void 0);if(!t)return i.jsxs(S,{children:[i.jsx(z,{name:"info",size:40,color:a.colors.muted2}),i.jsx(L,{children:e("authorizations.signInTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.signInBody")}),i.jsx(M,{variant:"purple",onClick:()=>s(),children:e("storeSettings.signIn")})]});if(!o)return i.jsxs(S,{children:[i.jsx(z,{name:"check",size:40,color:a.colors.ok}),i.jsx(L,{children:e("authorizations.managedTitle")}),i.jsx("p",{className:"muted",children:e("authorizations.managedBody")}),i.jsx(M,{as:_,to:"/assets",variant:"purple",children:e("authorizations.managedCta")})]});const u=J(r),m=U(r);return i.jsxs(rt,{children:[i.jsxs(ct,{children:[i.jsx(lt,{children:e("authorizations.title")}),i.jsx(dt,{children:e("authorizations.intro")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.buyingTitle")}),i.jsxs(x,{children:[i.jsx(j,{descriptor:u,owner:t.address,signer:t.signer,name:e("authorizations.creditsName"),description:e("authorizations.creditsDesc"),icon:i.jsx(B,{className:"ccy-mark"})}),i.jsx(j,{descriptor:m,owner:t.address,signer:t.signer,name:e("authorizations.manaName"),description:e("authorizations.manaDesc"),icon:i.jsx(ht,{src:ot,alt:"","aria-hidden":!0})})]})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.sellingTitle")}),c!=null&&c.truncated?i.jsx(jt,{"data-testid":"authorizations-selling-truncated",children:e("authorizations.sellingTruncated",{count:c.scanned})}):null,l||v?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(E,{"aria-hidden":!0},g))}):c&&c.collections.length>0?i.jsx(x,{children:c.collections.map(d=>i.jsx(j,{descriptor:V(d.contractAddress,r),owner:t.address,signer:t.signer,name:Ct(d.contractAddress,p),description:e("authorizations.sellingDesc"),image:d.image,icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.sellingEmpty")})]}),i.jsxs(k,{children:[i.jsx(C,{children:e("authorizations.mintingTitle")}),y?i.jsx(x,{"aria-busy":"true","aria-label":e("authorizations.checking"),children:Array.from({length:3}).map((d,g)=>i.jsx(E,{"aria-hidden":!0},g))}):h&&h.length>0?i.jsx(x,{children:h.map(d=>i.jsx(j,{descriptor:Y(d.contractAddress,r),owner:t.address,signer:t.signer,name:d.name||e("authorizations.collectionFallback"),description:e("authorizations.mintingDesc"),icon:i.jsx(z,{name:"pen",size:18})},d.contractAddress))}):i.jsx(I,{children:e("authorizations.mintingEmpty")})]})]})}export{_t as Authorizations};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as Se,r as P,b as ea,
|
|
1
|
+
import{j as e,L as Se,r as P,b as ea,u as ta}from"./react-IQWs2nb4.js";import{t as le,s as i,e as s,Y as de,ai as aa,X as sa,I as H,p as Mt,G as Ne,m as na,aj as Q,J as dt,n as ia,u as ra,ak as oa,q as ca,al as da,am as la,an as ua,ao as ha,o as pa,ap as lt,aq as G,ar as ut,as as ga,k as ae,c as ht,at as xa,f as ma,au as pt,av as _e,aw as ye,ax as be,ay as gt,a as ve,b as fa,C as We,az as ya}from"./index-BiIZh9R9.js";import{M as ba,S as va,C as wa,H as Ca,a as ja,T as ka,X as $a,b as Sa,B as Ma,c as Ta,d as xt,e as Ia,f as ke,P as Tt,m as Pa,g as za,h as Aa,i as Ea,j as It,k as $e,L as qa,l as Ba,n as mt,o as ft,W as Ra,p as _a,q as Wa,A as Fa,r as La,s as Ka,t as Ua,u as Na,v as Qa,w as Ha,x as Oa,y as Va,z as Ga,D as Ya,E as Da,F as Ja,G as Xa,I as Za,J as es,K as Fe,N as ts,O as as,Q as ss,R as ns,U as yt,V as bt,Y as is,Z as rs,_ as os}from"./CollectionCarousel-DKVvizGs.js";import{u as cs}from"./useManaRate-D4_9UlI5.js";import{r as ds}from"./mana-rate-pg062I50.js";import{i as ls,j as us,f as hs,n as ps,h as gs,A as xs}from"./authorizations-FkFZVBeE.js";import{g as ms,b as Le}from"./buy-DiLzTHFT.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-Cn4_YLUa.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-CaE-vAPX.js";import{i as ks,a as $s}from"./errors-sJnX14Ki.js";import{E as Ss}from"./ErrorNotice-51eOicue.js";import{u as Ct}from"./mana-convert-8bdglmK2.js";import"./sentry-DvOx8Rfb.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-rFeF6PNV.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DgV-A2zO.js";import"./sendMetaTransaction-BA-2MGdZ.js";const{colors:se,radius:Ms}=le,Ts=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
58
58
|
font-weight: 700;
|
|
59
59
|
color: ${se.text};
|
|
60
60
|
}
|
|
61
|
-
`,Es="https://cdn.decentraland.org/@dcl/shop/0.1.
|
|
61
|
+
`,Es="https://cdn.decentraland.org/@dcl/shop/0.1.1-30909439604.commit-4721d83/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(ba,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(va,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(wa,{"data-tall":D||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:Y}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Sa,{})})]}),e.jsxs(Ma,{children:[e.jsx(Ta,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ia,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(As,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Pa(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Bs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Rs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(za,{"data-testid":"buy-error",children:[e.jsx(Aa,{src:Es,alt:"",width:64,height:80}),e.jsxs(Ea,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Bs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(qa,{src:aa,alt:"",width:61,height:61}),e.jsx(Ba,{children:ne}),Y?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Is,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Rs({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ra,{"data-testid":"nofunds-warning",children:[e.jsx(_a,{}),e.jsxs(Wa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(Ps,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Fa,{children:[e.jsx(La,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ka,{children:[e.jsxs("div",{children:[e.jsxs(Ua,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(zs,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Na,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Oa,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Va,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ga,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Da,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Ja,{children:[e.jsxs(Xa,{children:[e.jsx(Za,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(es,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:D,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:Y,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
62
|
max-width: 1510px;
|
|
63
63
|
margin: 0 auto;
|
|
64
64
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -168,7 +168,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
168
168
|
align-items: center;
|
|
169
169
|
gap: 12px;
|
|
170
170
|
padding-bottom: 16px;
|
|
171
|
-
`,
|
|
171
|
+
`,Us=i.p`
|
|
172
172
|
margin: 0;
|
|
173
173
|
font-size: 24px;
|
|
174
174
|
font-weight: 700;
|
|
@@ -177,7 +177,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
177
177
|
${le.media.maxWidth("mobile")} {
|
|
178
178
|
font-size: 20px;
|
|
179
179
|
}
|
|
180
|
-
`,
|
|
180
|
+
`,Ns=i.p`
|
|
181
181
|
margin: 0;
|
|
182
182
|
font-size: 20px;
|
|
183
183
|
font-weight: 400;
|
|
@@ -286,7 +286,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
286
286
|
display: flex;
|
|
287
287
|
flex-direction: column;
|
|
288
288
|
gap: 24px;
|
|
289
|
-
`,
|
|
289
|
+
`,Ys=i.div`
|
|
290
290
|
position: relative;
|
|
291
291
|
display: flex;
|
|
292
292
|
align-items: stretch;
|
|
@@ -305,7 +305,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
305
305
|
&[data-unavailable] [data-desc] {
|
|
306
306
|
opacity: 0.7;
|
|
307
307
|
}
|
|
308
|
-
`,
|
|
308
|
+
`,Ds=i.div`
|
|
309
309
|
position: relative;
|
|
310
310
|
flex-shrink: 0;
|
|
311
311
|
width: 137.5px;
|
|
@@ -360,7 +360,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
360
360
|
gap: 4px;
|
|
361
361
|
min-width: 0;
|
|
362
362
|
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
-
`,Et=
|
|
363
|
+
`,Et=Ne`
|
|
364
364
|
display: block;
|
|
365
365
|
font-size: 16px;
|
|
366
366
|
font-weight: 600;
|
|
@@ -512,7 +512,7 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
512
512
|
width: 11.31px;
|
|
513
513
|
height: 10.94px;
|
|
514
514
|
background: ${r.text};
|
|
515
|
-
`,qt=
|
|
515
|
+
`,qt=Ne`
|
|
516
516
|
display: grid;
|
|
517
517
|
place-items: center;
|
|
518
518
|
width: 24px;
|
|
@@ -658,13 +658,13 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
658
658
|
opacity: 0.6;
|
|
659
659
|
cursor: default;
|
|
660
660
|
}
|
|
661
|
-
`,
|
|
661
|
+
`,Bt=Ne`
|
|
662
662
|
margin: 0;
|
|
663
663
|
font-size: 13px;
|
|
664
664
|
`,Ce=i.p`
|
|
665
|
-
${
|
|
665
|
+
${Bt};
|
|
666
666
|
`,In=i(Ss)`
|
|
667
|
-
${
|
|
667
|
+
${Bt};
|
|
668
668
|
`,Pn=i.div`
|
|
669
669
|
position: relative;
|
|
670
670
|
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,b as ea,a as ta}from"./react-vyZjIDcS.js";import{t
|
|
|
692
692
|
& section {
|
|
693
693
|
margin-top: 0;
|
|
694
694
|
}
|
|
695
|
-
`;function Ke(o){if(ks(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ma.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const zn=12e4;function An(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ne=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Jn(){na({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ia(),ue=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:Me}=ra({queryKey:["upsell-listings"],queryFn:()=>ya({first:40}),staleTime:6e4}),{data:$}=oa(n),b=ca(),ee=ea(),{state:J}=ta(),[_t,ie]=P.useState(null),[Qe,he]=P.useState(null),[Wt,R]=P.useState(!1),[B,O]=P.useState(null),He=P.useRef(0),[p,j]=P.useState(null),{data:pe}=da(n),{data:re}=cs(!0),[Te,Oe]=P.useState(""),oe=P.useRef(null),Ve=la(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Ft=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Lt=o.reduce((t,a)=>t+a.quantity,0),Kt=Ie.reduce((t,a)=>t+a.quantity,0),De=B?B.liveTotalCredits:Ft,Nt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Ut=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Qt=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Qt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Ot=ga,Vt=t=>xa(t.contractAddress,String(t.itemId));function me(t){t(),O(null),he(null),ie(null)}function Gt(){j(null),R(!1)}function Je(t){const a=Ne(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Oe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),R(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:U,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:U.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[U],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[U],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await _e(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ms(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),N=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ls()&&!v)try{const m=new Map;f=await fs({purchases:N,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:U})=>{m.set(C,U),U.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>ys(C)));x.forEach((C,U)=>{const X=m.get(f[U])??[];C.status==="fulfilled"?(X.forEach(Be=>S.add(Be)),E.push(f[U])):C.reason instanceof vt||X.forEach(Be=>_.add(Be))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof bs))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>_.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>_.add(x))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),R(!1);const Re={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Re,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!_.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,N)=>v+N.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await _e(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),O(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),R(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),R(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),R(!1)}async function Dt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await gs({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ds(ht.chainId),staleTime:6e4})}catch{return}}async function Yt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ne(t),{totalCents:c,manaWei:u}=await Yt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:_}=at(a,t);await st(S,_,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),R(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Jt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(fa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=us(a,t),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){R(!1),fe({auth:c,run:d});return}d()}function Xt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await is({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=rs(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),_=os(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const N=g[f].item,{credit:ce,maxCreditedValue:Re}=await pt(n.identity,v,g[f].trade.id,N.contractAddress&&N.itemId!=null?{contractAddress:N.contractAddress,itemId:String(N.itemId)}:void 0);E.push({salt:ce.id,itemId:N.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Re})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Dt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&_e(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),R(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await Cs(a,n.address,Ot,await et(),Vt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(An(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),He.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{R(!1)}}async function rt(){if(B){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-He.current>zn){O(null),he(null),await te();return}ie(null),tt(B.buyable)}}async function Zt(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}R(!0);try{const t=await js(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{R(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!ts("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ls,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Ks,{children:[e.jsx(Ns,{children:s("cart.empty.title")}),e.jsx(Us,{children:s("cart.empty.body")})]}),e.jsx(Qs,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(_s,{children:[e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsx(Hs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Os,{children:s("cart.panelTitle",{count:Lt})}),Bt?e.jsxs(Vs,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Gs,{children:o.map(t=>{const a=Ut.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,_=ua(t),E=!!_&&!!A[_],q=ha(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ds,{"data-unavailable":g||void 0,children:[e.jsxs(Ys,{"data-thumb":!0,children:[q?e.jsx(Js,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Xs,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Zs,{children:[e.jsxs(en,{"data-desc":!0,children:[q?e.jsx(an,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(tn,{title:t.name,children:t.name}),t.creator?e.jsx(sn,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(xn,{"data-testid":"cart-creator-tag",children:[e.jsx(mn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(nn,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(hn,{children:[e.jsx(pn,{name:"warning-fill",size:24}),k]}),q?e.jsx(gn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(rn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(on,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("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(cn,{children:[e.jsx(dn,{})," ",S,c?e.jsx(ln,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(un,{children:[_?e.jsx(fn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(yn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(bn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(vn,{children:[e.jsx(wn,{children:s("cart.purchaseSummary")}),e.jsxs(Cn,{children:[e.jsxs(jn,{children:[e.jsx(kn,{children:s("cart.totalItems",{count:Kt})}),e.jsx(Sn,{children:e.jsxs($n,{children:[e.jsx(Mn,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:B?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(B?rt():te(t))}):e.jsx(Tn,{onClick:()=>void(B?rt():te()),disabled:V||Pe,children:V?s("cart.working"):B?s("marketCheckout.confirmPurchase"):s("assetCard.buyNow")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),B?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(In,{message:_t})]})]})]})]}),Ye.length>0?e.jsx(Pn,{children:e.jsx(as,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ss,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:ns,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(qs,{phase:p.phase,balanceCredits:ge,onClose:Gt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Jt(p).options:void 0,onPay:Xt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ne(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:Oe,onBuyPacks:()=>void Zt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Jn as Cart};
|
|
695
|
+
`;function Ke(o){if(ks(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ma.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const zn=12e4;function An(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Jn(){na({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),Y=Q(t=>t.restore),D=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ia(),ue=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Rt=o.some(t=>t.category!=="emote"),{data:Me}=ra({queryKey:["upsell-listings"],queryFn:()=>ya({first:40}),staleTime:6e4}),{data:$}=oa(n),b=ca(),ee=ea(),{state:J}=ta(),[_t,ie]=P.useState(null),[Qe,he]=P.useState(null),[Wt,B]=P.useState(!1),[R,O]=P.useState(null),He=P.useRef(0),[p,j]=P.useState(null),{data:pe}=da(n),{data:re}=cs(!0),[Te,Oe]=P.useState(""),oe=P.useRef(null),Ve=la(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Ft=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Lt=o.reduce((t,a)=>t+a.quantity,0),Kt=Ie.reduce((t,a)=>t+a.quantity,0),Ye=R?R.liveTotalCredits:Ft,Ut=new Set(o.map(t=>t.id)),De=((Me==null?void 0:Me.items)??[]).filter(t=>!Ut.has(t.id)).slice(0,12),Nt=new Map(R==null?void 0:R.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=Ye*10,Qt=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Qt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Ot=ga,Vt=t=>xa(t.contractAddress,String(t.itemId));function me(t){t(),O(null),he(null),ie(null)}function Gt(){j(null),B(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];Oe(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),B(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,_=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await _e(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ms(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ls()&&!v)try{const m=new Map;f=await fs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>ys(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Re=>S.add(Re)),E.push(f[N])):C.reason instanceof vt||X.forEach(Re=>_.add(Re))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof bs))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>_.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>_.add(x))});t.forEach(m=>l(m.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),B(!1);const Be={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Be,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!_.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await _e(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),O(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),B(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),B(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),B(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await gs({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ds(ht.chainId),staleTime:6e4})}catch{return}}async function Dt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Dt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:_}=at(a,t);await st(S,_,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),B(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Jt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(fa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=us(a,t),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){B(!1),fe({auth:c,run:d});return}d()}function Xt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await is({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),O(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=rs(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),_=os(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:Be}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Be})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+_).toString()},await Yt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),O(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&_e(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),B(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await Cs(a,n.address,Ot,await et(),Vt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(An(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),O(null);return}if(c.orderChanged){O(c),He.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{B(!1)}}async function rt(){if(R){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-He.current>zn){O(null),he(null),await te();return}ie(null),tt(R.buyable)}}async function Zt(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}B(!0);try{const t=await js(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{B(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!ts("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&Y(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ls,{"data-testid":"cart-empty",children:[e.jsx(H,{name:"cart-plus",size:110}),e.jsxs(Ks,{children:[e.jsx(Us,{children:s("cart.empty.title")}),e.jsx(Ns,{children:s("cart.empty.body")})]}),e.jsx(Qs,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(H,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(_s,{children:[e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsx(Hs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(H,{name:"arrow-left"})}),e.jsx(Os,{children:s("cart.panelTitle",{count:Lt})}),Rt?e.jsxs(Vs,{onClick:()=>D(!0),disabled:V,children:[e.jsx(H,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Gs,{children:o.map(t=>{const a=Nt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,_=ua(t),E=!!_&&!!A[_],q=ha(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ys,{"data-unavailable":g||void 0,children:[e.jsxs(Ds,{"data-thumb":!0,children:[q?e.jsx(Js,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Xs,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Zs,{children:[e.jsxs(en,{"data-desc":!0,children:[q?e.jsx(an,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(tn,{title:t.name,children:t.name}),t.creator?e.jsx(sn,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(xn,{"data-testid":"cart-creator-tag",children:[e.jsx(mn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(nn,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(hn,{children:[e.jsx(pn,{name:"warning-fill",size:24}),k]}),q?e.jsx(gn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(rn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(on,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("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(cn,{children:[e.jsx(dn,{})," ",S,c?e.jsx(ln,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(un,{children:[_?e.jsx(fn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(H,{name:E?"heart-solid":"heart"})}):null,e.jsx(yn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(H,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(bn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(vn,{children:[e.jsx(wn,{children:s("cart.purchaseSummary")}),e.jsxs(Cn,{children:[e.jsxs(jn,{children:[e.jsx(kn,{children:s("cart.totalItems",{count:Kt})}),e.jsx(Sn,{children:e.jsxs($n,{children:[e.jsx(Mn,{})," ",Ye]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:R?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(R?rt():te(t))}):e.jsx(Tn,{onClick:()=>void(R?rt():te()),disabled:V||Pe,children:V?s("cart.working"):R?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),R?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(In,{message:_t})]})]})]})]}),De.length>0?e.jsx(Pn,{children:e.jsx(as,{title:s("cart.youMightAlsoLike"),items:De})}):null,qe&&n?e.jsx(ss,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:ns,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(qs,{phase:p.phase,balanceCredits:ge,onClose:Gt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Jt(p).options:void 0,onPay:Xt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:Oe,onBuyPacks:()=>void Zt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Jn as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N,
|
|
1
|
+
import{A as N,D as E,E as o,F as n,G as $,l as M}from"./index-BiIZh9R9.js";import{r as U,j as g}from"./react-IQWs2nb4.js";import{g as w,a as z,c as F,b as I,s as v}from"./clsx-sy6nSRXN.js";function G(r){return w("MuiCircularProgress",r)}z("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,b,S,D;const t=44,W=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ import{N,O as U,P as o,Q as n,J as D,x as M}from"./index-Cn-oc3fB.js";import{r a
|
|
|
6
6
|
100% {
|
|
7
7
|
transform: rotate(360deg);
|
|
8
8
|
}
|
|
9
|
-
`)),
|
|
9
|
+
`)),A=M(b||(b=l`
|
|
10
10
|
0% {
|
|
11
11
|
stroke-dasharray: 1px, 200px;
|
|
12
12
|
stroke-dashoffset: 0;
|
|
@@ -21,8 +21,8 @@ import{N,O as U,P as o,Q as n,J as D,x as M}from"./index-Cn-oc3fB.js";import{r a
|
|
|
21
21
|
stroke-dasharray: 100px, 200px;
|
|
22
22
|
stroke-dashoffset: -125px;
|
|
23
23
|
}
|
|
24
|
-
`)),
|
|
24
|
+
`)),B=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${n(a)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return I(u,G,e)},L=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&$(S||(S=l`
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
|
-
`),
|
|
26
|
+
`),W)),V=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Z=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&$(D||(D=l`
|
|
27
27
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
-
`),
|
|
28
|
+
`),A)),O=U.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=E(a,K),c=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=B(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(L,o({className:F(f.root,d),style:o({width:m,height:m},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(V,{className:f.svg,ownerState:c,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:g.jsx(Z,{className:f.circle,style:h,ownerState:c,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{O as C};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import{j as e,r as m,d as Z,b as J}from"./react-IQWs2nb4.js";import{t as v,s as c,ac as X,v as T,I as ee,e as a,c as te,k as ae,u as re,m as oe,f as ie,S as F,K as se,ad as ne,ae as ce}from"./index-BiIZh9R9.js";import{E as le}from"./ErrorNotice-51eOicue.js";import{d as de,g as pe,a as xe,P as ue,C as me,b as ge,c as he,B as be,S as fe,M as je,A as ve}from"./browseLayout.styles-6Bx0cPB_.js";import{u as ye}from"./useStore-ByHpJuVH.js";import{S as z,C as Ce,F as we,c as Se,P as ke,d as Ne,H as Pe,e as $e}from"./categories-Byz019bF.js";import{L as Ae}from"./LoadMore-BolkAKn7.js";import{u as Me}from"./useInfiniteGrid-CeEt3Zid.js";import{G as Ee}from"./grid.styles-DVBPQuRz.js";import"./sentry-DvOx8Rfb.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-rFeF6PNV.js";import"./intl-CBcMB1D2.js";const Re=c.section`
|
|
2
|
+
position: relative;
|
|
3
|
+
border-radius: ${v.radius.card};
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
margin-bottom: 24px;
|
|
6
|
+
min-height: 200px;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
|
|
11
|
+
${v.media.maxWidth("mobile")} {
|
|
12
|
+
min-height: 140px;
|
|
13
|
+
}
|
|
14
|
+
`,Te=c.div`
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
|
+
z-index: 0;
|
|
18
|
+
`,Fe=c.img`
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
object-fit: cover;
|
|
22
|
+
display: block;
|
|
23
|
+
`,ze=c.div`
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset: 0;
|
|
26
|
+
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
|
|
27
|
+
`,Be=c.h1`
|
|
28
|
+
position: relative;
|
|
29
|
+
z-index: 1;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 32px 24px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
color: ${v.colors.white};
|
|
34
|
+
font-size: 40px;
|
|
35
|
+
font-weight: 800;
|
|
36
|
+
line-height: 1.2;
|
|
37
|
+
letter-spacing: 0.02em;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
|
|
40
|
+
|
|
41
|
+
${v.media.maxWidth("mobile")} {
|
|
42
|
+
padding: 24px 16px;
|
|
43
|
+
font-size: 26px;
|
|
44
|
+
}
|
|
45
|
+
`;function Le({name:r,creator:t}){const{data:s}=ye(t),d=(s==null?void 0:s.cover)||de;return e.jsxs(Re,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(Te,{children:[e.jsx(Fe,{src:d,alt:"",loading:"eager"}),e.jsx(ze,{"aria-hidden":!0})]}),e.jsx(Be,{"data-testid":"collection-hero-title",children:r})]})}const{colors:n,radius:L}=v,Ie=c.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
text-align: center;
|
|
50
|
+
gap: 12px;
|
|
51
|
+
padding-bottom: 24px;
|
|
52
|
+
/* Lift so the avatar half-overlaps the 24px-below cover hero (24px + half the 110px avatar). */
|
|
53
|
+
margin-top: -79px;
|
|
54
|
+
margin-bottom: 8px;
|
|
55
|
+
border-bottom: 1px solid ${n.line};
|
|
56
|
+
`,B=c.img`
|
|
57
|
+
display: block;
|
|
58
|
+
width: 110px;
|
|
59
|
+
height: 110px;
|
|
60
|
+
border-radius: 50%;
|
|
61
|
+
object-fit: cover;
|
|
62
|
+
border: 5px solid ${n.white};
|
|
63
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
|
|
64
|
+
background: #ff4bed;
|
|
65
|
+
`,_e=c.h2`
|
|
66
|
+
margin: 0;
|
|
67
|
+
font-size: 20px;
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
line-height: 1.3;
|
|
70
|
+
color: ${n.text};
|
|
71
|
+
max-width: 100%;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
`,Ge=c.button`
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 8px;
|
|
79
|
+
padding: 4px 8px;
|
|
80
|
+
border: 0;
|
|
81
|
+
border-radius: ${L.btn};
|
|
82
|
+
background: none;
|
|
83
|
+
color: ${n.muted};
|
|
84
|
+
font: inherit;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
transition:
|
|
88
|
+
color 0.15s ease,
|
|
89
|
+
background 0.15s ease;
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
color: ${n.text};
|
|
93
|
+
background: ${n.media};
|
|
94
|
+
}
|
|
95
|
+
`,He=c.a`
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 44px;
|
|
101
|
+
padding: 0 20px;
|
|
102
|
+
border: 2px solid ${n.accent};
|
|
103
|
+
border-radius: ${L.btn};
|
|
104
|
+
background: transparent;
|
|
105
|
+
color: ${n.accent};
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
font-size: 13px;
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
letter-spacing: 0.046em;
|
|
110
|
+
text-decoration: none;
|
|
111
|
+
transition:
|
|
112
|
+
background 0.15s ease,
|
|
113
|
+
color 0.15s ease;
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
background: ${n.accent};
|
|
117
|
+
color: ${n.white};
|
|
118
|
+
}
|
|
119
|
+
`;function Ue({address:r}){var f,l;const{data:t}=X(r),[s,d]=m.useState(!1);if(!r)return null;const p=(t==null?void 0:t.name)||T(r),g=(l=(f=t==null?void 0:t.avatar)==null?void 0:f.snapshots)==null?void 0:l.face256,h=`${te.profileUrl}/${r}`,b=pe(xe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??r}));async function x(){try{await navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){ae(y,{flow:"copy_creator_address"})}}return e.jsxs(Ie,{"data-testid":"creator-card",children:[g?e.jsx(B,{src:g,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsx(_e,{title:p,children:p}),e.jsxs(Ge,{type:"button",onClick:()=>void x(),title:s?a("collection.copied"):a("collection.copyAddress"),"aria-label":s?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:T(r)}),e.jsx(ee,{name:"copy",size:16})]}),e.jsx(He,{"data-testid":"creator-card-view",href:h,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const Ke=48;function rt(){var R;const{contractAddress:r}=Z(),t=J(),[s,d]=m.useState("wearable"),[p,g]=m.useState(null),[h,b]=m.useState([]),[x,f]=m.useState(""),[l,y]=m.useState(""),[S,I]=m.useState("newest"),k=x&&!Number.isNaN(Number(x))?Number(x):void 0,N=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?$e[p]:void 0,G=(z.find(o=>o.key===S)??z[0]).server,P={category:s,rarities:h.length?h:void 0,wearableCategories:_,minPriceCredits:k,maxPriceCredits:N,sortBy:G},{items:j,total:H,isLoading:C,error:$,hasNextPage:U,isFetchingNextPage:A,isFetchNextPageError:K,fetchNextPage:q}=Me(["collection-page",r,P],o=>ne(r,{...P,first:Ke,skip:o}),{enabled:!!r}),{data:i}=re({queryKey:["collection-meta",r],queryFn:()=>ce(r),enabled:!!r,staleTime:5*6e4}),M=(i==null?void 0:i.name)||a("collection.fallbackTitle");oe({title:i==null?void 0:i.name,description:i!=null&&i.name?a("seo.collection.description",{name:i.name}):void 0});const E=(i==null?void 0:i.creator)||((R=j[0])==null?void 0:R.creator);function W(o){d(o),g(null)}function D(o){b(u=>u.includes(o)?u.filter(Y=>Y!==o):[...u,o])}function O(){d("wearable"),g(null),b([]),f(""),y("")}const w=!!(k||N),Q=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),V=s!=="wearable"||!!p||h.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(me,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(ge,{onClick:()=>t("/assets"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(he,{children:M})]}),e.jsx(Le,{name:M,creator:E}),e.jsxs(be,{"data-testid":"browse",children:[e.jsxs(fe,{"data-testid":"browse-sidebar",children:[e.jsx(Ue,{address:E}),e.jsx(Ce,{category:s,subCategory:p,onCategory:W,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(je,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(we,{rarities:h,onToggleRarity:D,sort:S,onSort:I,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:o=>e.jsx(Se,{panelKey:"price",label:Q,active:w,panel:o,children:e.jsxs(ke,{"data-variant":"price",children:[e.jsxs(Ne,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:u=>f(u.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:l,onChange:u=>y(u.target.value)})]}),e.jsx(Pe,{children:a("collection.priceHint",{currency:ie.name})})]})})}),$?e.jsx(le,{message:a("collection.error")}):null,e.jsx(Ee,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[j.map(o=>e.jsx(se,{item:o},o.id)),A?e.jsx(F,{count:6}):null]})}),e.jsx(Ae,{hasNextPage:U,isFetching:A,isError:K,onLoadMore:()=>void q()}),!C&&!$&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{rt as Collection,rt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,r as v}from"./react-
|
|
1
|
+
import{j as t,r as v}from"./react-IQWs2nb4.js";import{s as e,t as o,e as g,p as k,Y as j,aW as C,f as Y,l as G,I as Q,k as X,a as W,C as E,b as Z,bj as J,bk as F,K as q}from"./index-BiIZh9R9.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-FkFZVBeE.js";import{i as ie}from"./errors-sJnX14Ki.js";import{E as oe}from"./ErrorNotice-51eOicue.js";import{a as se}from"./buy-DiLzTHFT.js";import{g as re,a as ce}from"./trade-encoding-DgV-A2zO.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-BA-2MGdZ.js";import{I as he,C as ue}from"./ethers-rFeF6PNV.js";const R="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,f=fe(l,n,s);d>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(l=>l.method==="credits"))==null?void 0:b.method)??((y=c.find(l=>l.method==="combined"))==null?void 0:y.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,m=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="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",be=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -109,7 +109,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
|
|
|
109
109
|
line-height: 1.4;
|
|
110
110
|
color: ${o.colors.muted};
|
|
111
111
|
text-align: center;
|
|
112
|
-
`;function ut({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:d,creditsLabel:c,shortfall:p}){return t.jsxs(be,{children:[a.map(h=>h.method==="credits"?t.jsxs(ye,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??g("buyModal.buy")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))})]})]},"credits"):h.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(B,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))}),t.jsx(ve,{children:"+"}),t.jsx(B,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)}),t.jsx(we,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(B,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx($e,{"data-testid":"mana-shortfall-note",children:g("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:
|
|
112
|
+
`;function ut({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:d,creditsLabel:c,shortfall:p}){return t.jsxs(be,{children:[a.map(h=>h.method==="credits"?t.jsxs(ye,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??g("buyModal.buy")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))})]})]},"credits"):h.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(B,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))}),t.jsx(ve,{children:"+"}),t.jsx(B,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)}),t.jsx(we,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(B,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx($e,{"data-testid":"mana-shortfall-note",children:g("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:Y.name})})]}):null,d?t.jsx(ke,{"data-testid":"mana-rate-note",children:d}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function xt(a,n){const i=(s,...d)=>void a.invalidateQueries({queryKey:n?[s,...d]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const je=G`
|
|
113
113
|
to { transform: rotate(360deg); }
|
|
114
114
|
`,Ce=e.div`
|
|
115
115
|
position: fixed;
|
|
@@ -501,11 +501,11 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
|
|
|
501
501
|
font-size: 24px;
|
|
502
502
|
font-weight: 700;
|
|
503
503
|
color: ${r.text};
|
|
504
|
-
`,
|
|
504
|
+
`,Yt=e(k)`
|
|
505
505
|
width: 30px;
|
|
506
506
|
height: 30px;
|
|
507
507
|
background: ${r.text};
|
|
508
|
-
`,
|
|
508
|
+
`,Gt=e.span`
|
|
509
509
|
font-size: 14px;
|
|
510
510
|
font-weight: 600;
|
|
511
511
|
color: ${r.muted1};
|
|
@@ -696,7 +696,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
|
|
|
696
696
|
}
|
|
697
697
|
`,Ve=e(Q)`
|
|
698
698
|
transform: rotate(-90deg);
|
|
699
|
-
`,
|
|
699
|
+
`,Ye=e.div`
|
|
700
700
|
position: relative;
|
|
701
701
|
`,D=e.button`
|
|
702
702
|
position: absolute;
|
|
@@ -745,7 +745,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
|
|
|
745
745
|
${A.maxWidth("lg")} {
|
|
746
746
|
display: none;
|
|
747
747
|
}
|
|
748
|
-
`,
|
|
748
|
+
`,Ge=e.div`
|
|
749
749
|
display: grid;
|
|
750
750
|
grid-auto-flow: column;
|
|
751
751
|
grid-auto-columns: calc((100% - 64px) / 5);
|
|
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
|
|
|
801
801
|
opacity: 1;
|
|
802
802
|
transform: scale(1.1);
|
|
803
803
|
}
|
|
804
|
-
`;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(Ue,{children:[t.jsxs(He,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(
|
|
804
|
+
`;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(Ue,{children:[t.jsxs(He,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Ye,{children:[t.jsx(D,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ge,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),d>1?t.jsx(Xe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:d}).map((u,x)=>t.jsx(Ze,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{z as $,Tt as A,Mt as B,kt as C,Ht as D,_t as E,Ot as F,Vt as G,$t as H,Yt as I,Gt as J,dt as K,Jt as L,wt as M,ct as N,cn as O,ut as P,gt as Q,T as R,vt as S,Ct as T,rt as U,xt as V,Ft as W,zt as X,Ke as Y,lt as Z,fe as _,jt as a,sn as a0,rn as a1,ft as a2,pt as a3,mt as a4,bt as b,At as c,Wt as d,It as e,St as f,qt as g,en as h,tn as i,Xt as j,Zt as k,nn as l,ht as m,an as n,on as o,yt as p,Kt as q,Nt as r,Bt as s,Et as t,Rt as u,Lt as v,Pt as w,Dt as x,Qt as y,Ut as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t}from"./sentry-
|
|
1
|
+
import{p as t}from"./sentry-DvOx8Rfb.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as z}from"./react-vyZjIDcS.js";import{r as W}from"./index-DgKHc2Pp.js";function Y(o,f){for(var S=0;S<f.length;S++){const P=f[S];if(typeof P!="string"&&!Array.isArray(P)){for(const h in P)if(h!=="default"&&!(h in o)){const m=Object.getOwnPropertyDescriptor(P,h);m&&Object.defineProperty(o,h,m.get?m:{enumerable:!0,get:()=>P[h]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var O={},L={},D={},U={},H;function G(){if(H)return U;H=1,Object.defineProperty(U,"__esModule",{value:!0}),U.createFetchComponent=P;const o=new Set([400,401,403,404]),f=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]);async function S(h,m,y){var $;const{timeout:g,retryDelay:d,abortController:F}=y,q=F.signal;let M=y.attempts,w,A;do{w=void 0,A=void 0;let C=null;try{g&&(C=setTimeout(()=>F.abort(),g)),--M,w=await fetch(h,m)}catch(n){A=n}finally{C&&clearTimeout(C)}if(w&&(w.ok||o.has(w.status))||q.aborted||M===0)break;w&&await(($=w.body)==null?void 0:$.cancel().catch(()=>{})),await new Promise(n=>setTimeout(n,d))}while(!0);if(q.aborted)throw new Error("Request aborted (timed out)");if(!w)throw A;return w}function P(h){const m=h==null?void 0:h.defaultHeaders;async function y(g,d){const{timeout:F,method:q="GET",retryDelay:M=0,abortController:w,attempts:A,...$}={...h==null?void 0:h.defaultFetcherOptions,...d},C=w||new AbortController,n=f.has(q.toUpperCase())?A??1:1,e={...$,method:q,signal:C.signal};return m&&(e.headers={...m,...$.headers||{}}),S(g,e,{timeout:F,retryDelay:M,attempts:n,abortController:C})}return{fetch:y}}return U}var Q;function X(){return Q||(Q=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var f=G();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return f.createFetchComponent}})})(D)),D}const J="0.0.0-development",K={version:J};var V;function Z(){return V||(V=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const f=X(),S=K;function P(){return S.version}o.getCurrentVersion=P;function h(n,e,i=""){for(const r in n){if(!n.hasOwnProperty(r)||n[r]===null||n[r]===void 0)continue;const t=i?`${i}[${r}]`:r;n[r]instanceof Date?e.append(t,n[r].toISOString()):n[r]instanceof Array?n[r].forEach((a,s)=>{const c=`${t}[${s}]`;h(a,e,c)}):typeof n[r]=="object"?h(n[r],e,t):e.append(t,n[r].toString())}return e}o.addModelToFormData=h;function m(n){return Array.from(new Set(n))}o.MAX_URL_LENGTH=2048;async function y({baseUrl:n,path:e,queryParams:i,fetcher:r,uniqueBy:t,options:a}){r=r||(0,f.createFetchComponent)();const s=q({baseUrl:n,path:e,queryParams:i}),c=new Map;for(const u of s)(await(await r.fetch(u,{...a,headers:{"Content-Type":"application/json"}})).json()).forEach(E=>c.set(t?E[t]:c.size,E));return Array.from(c.values())}o.splitAndFetch=y;const g=7;async function d({baseUrl:n,path:e,queryParams:i,elementsProperty:r,uniqueBy:t,options:a,fetcher:s}){s=s||(0,f.createFetchComponent)();const u=q({baseUrl:n,path:e,queryParams:i,reservedParams:new Map([["offset",g]])}),b=new Map;let E=!1;for(let v=0;v<u.length&&!E;v++){let l=u[v];for(;l&&!E;)try{const p=(await s.fetch(l,a)).json();p[r].forEach(j=>b.set(j[t],j));const _=p.pagination.next;l=_?new URL(_,l).toString():void 0}catch{E=!0}}return Array.from(b.values())}o.splitAndFetchPaginated=d;function F({queryParams:n,baseUrl:e,path:i,reservedParams:r}){const t="name"in n?new Map([[n.name,n.values]]):n;if(t.size===0)return[new C(e+i,t,r)];const s=Array.from(t.entries()).map(([l,p])=>[l,m(p)]).sort(([l,p],[T,_])=>p.length-_.length),c=new C(e+i,new Map,r);for(let l=0;l<s.length-1;l++){const[p,T]=s[l];if(!c.canSetParams(p,T))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");c.setParams(p,T)}let u=C.clone(c);const[b,E]=s[s.length-1],v=[];for(const l of E)u.canAddParam(b,l)||(v.push(u),u=C.clone(c)),u.addParam(b,l);return v.push(u),v}o.splitValuesIntoManyQueryBuilders=F;function q(n){return F(n).map(i=>i.toString())}o.splitValuesIntoManyQueries=q;function M(n){if(!n)return new Map;const e=Object.entries(n).filter(([i,r])=>!!r).map(([i,r])=>{const t=i.endsWith("s")?i.slice(0,-1):i;let a;if(Array.isArray(r))a=[...r].filter(A).map(s=>`${s}`);else if(A(r))a=[`${r}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[t,a]}).filter(([i,r])=>r.length>0);return new Map(e)}o.convertFiltersToQueryParams=M;function w(n,e){const i={...n==null?void 0:n.headers,...e==null?void 0:e.headers};return{...n,...e,headers:i}}o.mergeRequestOptions=w;function A(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function $(n){return n=n.trim(),!n.startsWith("https://")&&!n.startsWith("http://")&&(n="https://"+n),n.endsWith("/")&&(n=n.slice(0,-1)),n}o.sanitizeUrl=$;class C{constructor(e,i=new Map,r=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=r,this.length=this.calculateUrlLength(i,r)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const r=this.queryParams.get(e),t=r||[];return t.push(i),this.queryParams.set(e,t),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const r=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(r,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(r=>`${r}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[r,t]of this.queryParams)for(const a of t)i?e+=`&${r}=${a}`:(e+=`?${r}=${a}`,i=!0);return e}calculateUrlLength(e,i){let r=this.baseUrl.length;for(const[t,a]of i)this.queryParams.has(t)||(r+=t.length+2+a);for(const[t,a]of e)r+=this.calculateAddedLength(t,a);return r}static clone(e){return new C(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,r)=>i+r.length,0)}}o.QueryBuilder=C})(L)),L}var R={},I;function x(){if(I)return R;I=1,Object.defineProperty(R,"__esModule",{value:!0}),R.retry=void 0;async function o(f,S,P,h){for(;P>0;)try{return await S()}catch(m){if(P--,P>0)console.info(`Failed to ${f}. Still have ${P} attempt/s left. Will try again in ${h}`),await new Promise(y=>setTimeout(y,h));else throw m}throw new Error("Please specify more than one attempt for the retry function")}return R.retry=o,R}var N;function ee(){if(N)return O;N=1,Object.defineProperty(O,"__esModule",{value:!0}),O.createContentClient=O.downloadContent=void 0;const o=W(),f=Z(),S=x();async function P(m,y,g,d){const{attempts:F=3,retryDelay:q=500}=d||{},M=d!=null&&d.timeout?{timeout:d.timeout}:{};return(0,S.retry)(`fetch file with hash ${g} from ${y}`,async()=>{const w=await m.fetch(`${y}/${g}`,M),A=new Uint8Array(await w.arrayBuffer());if(!(d!=null&&d.avoidChecks)&&(g.startsWith("Qm")?await(0,o.hashV0)(A):await(0,o.hashV1)(A))!==g)throw new Error(`Failed to fetch file with hash ${g} from ${y}`);return A},F,q)}O.downloadContent=P;function h(m){const{fetcher:y,logger:g}=m,d=(0,f.sanitizeUrl)(m.url),F=m==null?void 0:m.parallelConfig;async function q(t,a,s){const c=new AbortController,u=c.signal,b=(0,f.mergeRequestOptions)(s,{signal:u});return new Promise(async E=>{let v=t.length;const l=()=>{v--,v===0&&E([])},p=T=>T&&Array.isArray(T)&&T.length>0?(c.abort(),E(T),!0):!1;t.forEach(async T=>{try{const _=(0,f.sanitizeUrl)(T),j=await y.fetch(`${_}${a}`,b);if(u.aborted){l();return}const k=await j.json();p(k)||l()}catch(_){u.aborted||g==null||g.warn(`Failed to fetch from ${T}:`,_),l()}})})}async function M(t,a,s){const u=(await Promise.allSettled(t.map(async l=>{try{const p=(0,f.sanitizeUrl)(l);return await(await y.fetch(`${p}${a}`,s)).json()}catch(p){return g==null||g.warn(`Failed to fetch from ${l}:`,p),[]}}))).filter(l=>l.status==="fulfilled").map(l=>l.value||[]),b=u.flatMap(l=>l),E=u.filter(l=>l.length===0).length,v=new Map;return b.forEach(l=>{(!v.has(l.id)||l.timestamp>v.get(l.id).timestamp)&&v.set(l.id,l)}),{entities:Array.from(v.values()),emptyResults:E}}async function w(t,a){const s=new FormData;s.append("entityId",t.entityId),(0,f.addModelToFormData)(t.authChain,s,"authChain");const c=await i(Array.from(t.files.keys()),a);for(const[u,b]of t.files)(!c.has(u)||u===t.entityId)&&s.append(u,new Blob([b]),u);return s}async function A(t,a){const s=await w(t,a),c=(0,f.mergeRequestOptions)(a||{},{body:s,method:"POST"});return await y.fetch(`${d}/entities`,c)}async function $(t,a){if(t.length===0)return Promise.reject("You must set at least one pointer.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:t}),method:"POST",headers:{"Content-Type":"application/json"}});return(await y.fetch(`${d}/entities/active`,s)).json()}async function C(t,a){if(t.length===0)return Promise.reject("You must set at least one id.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({ids:t}),method:"POST",headers:{"Content-Type":"application/json"}}),c=(a==null?void 0:a.parallel)||F;return c!=null&&c.urls&&(c==null?void 0:c.urls.length)>0?q([d,...c.urls],"/entities/active",s):(await y.fetch(`${d}/entities/active`,s)).json()}async function n(t,a){const s=await C([t],a);return s.length===0?Promise.reject(`Failed to find an entity with id '${t}'.`):s[0]}function e(t,a){return t.length===0?Promise.reject("You must set at least one cid."):(0,f.splitAndFetch)({fetcher:y,options:a,baseUrl:d,path:"/available-content",queryParams:{name:"cid",values:t},uniqueBy:"cid"})}async function i(t,a){const c=(await e(t,a)).filter(u=>u.available).map(({cid:u})=>u);return new Set(c)}async function r(t,a){const s=(a==null?void 0:a.parallel)||F;if(!(s!=null&&s.urls)||s.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const c=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:[t]}),method:"POST",headers:{"Content-Type":"application/json"}}),u=[d,...s.urls],{entities:b,emptyResults:E}=await M(u,"/entities/active",c);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const v=Math.max(...b.map(_=>_.timestamp)),l=b.filter(_=>_.timestamp===v),p=b.filter(_=>_.timestamp<v);return{isConsistent:p.length===0&&E===0,upToDateEntities:l.length>0?l:void 0,outdatedEntities:p.length>0?p:void 0}}return{buildEntityFormDataForDeployment:w,fetchEntitiesByPointers:$,fetchEntitiesByIds:C,fetchEntityById:n,downloadContent:(t,a)=>P(y,d+"/contents",t,a),deploy:A,isContentAvailable:e,checkPointerConsistency:r}}return O.createContentClient=h,O}var B=ee();const te=z(B),ae=Y({__proto__:null,default:te},[B]);export{ae as C};
|
|
1
|
+
import{g as z}from"./react-IQWs2nb4.js";import{r as W}from"./index-CYEynknO.js";function Y(o,f){for(var S=0;S<f.length;S++){const P=f[S];if(typeof P!="string"&&!Array.isArray(P)){for(const h in P)if(h!=="default"&&!(h in o)){const m=Object.getOwnPropertyDescriptor(P,h);m&&Object.defineProperty(o,h,m.get?m:{enumerable:!0,get:()=>P[h]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var O={},L={},D={},U={},H;function G(){if(H)return U;H=1,Object.defineProperty(U,"__esModule",{value:!0}),U.createFetchComponent=P;const o=new Set([400,401,403,404]),f=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]);async function S(h,m,y){var $;const{timeout:g,retryDelay:d,abortController:F}=y,q=F.signal;let M=y.attempts,w,A;do{w=void 0,A=void 0;let C=null;try{g&&(C=setTimeout(()=>F.abort(),g)),--M,w=await fetch(h,m)}catch(n){A=n}finally{C&&clearTimeout(C)}if(w&&(w.ok||o.has(w.status))||q.aborted||M===0)break;w&&await(($=w.body)==null?void 0:$.cancel().catch(()=>{})),await new Promise(n=>setTimeout(n,d))}while(!0);if(q.aborted)throw new Error("Request aborted (timed out)");if(!w)throw A;return w}function P(h){const m=h==null?void 0:h.defaultHeaders;async function y(g,d){const{timeout:F,method:q="GET",retryDelay:M=0,abortController:w,attempts:A,...$}={...h==null?void 0:h.defaultFetcherOptions,...d},C=w||new AbortController,n=f.has(q.toUpperCase())?A??1:1,e={...$,method:q,signal:C.signal};return m&&(e.headers={...m,...$.headers||{}}),S(g,e,{timeout:F,retryDelay:M,attempts:n,abortController:C})}return{fetch:y}}return U}var Q;function X(){return Q||(Q=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.createFetchComponent=void 0;var f=G();Object.defineProperty(o,"createFetchComponent",{enumerable:!0,get:function(){return f.createFetchComponent}})})(D)),D}const J="0.0.0-development",K={version:J};var V;function Z(){return V||(V=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.QueryBuilder=o.sanitizeUrl=o.mergeRequestOptions=o.convertFiltersToQueryParams=o.splitValuesIntoManyQueries=o.splitValuesIntoManyQueryBuilders=o.splitAndFetchPaginated=o.splitAndFetch=o.MAX_URL_LENGTH=o.addModelToFormData=o.getCurrentVersion=void 0;const f=X(),S=K;function P(){return S.version}o.getCurrentVersion=P;function h(n,e,i=""){for(const r in n){if(!n.hasOwnProperty(r)||n[r]===null||n[r]===void 0)continue;const t=i?`${i}[${r}]`:r;n[r]instanceof Date?e.append(t,n[r].toISOString()):n[r]instanceof Array?n[r].forEach((a,s)=>{const c=`${t}[${s}]`;h(a,e,c)}):typeof n[r]=="object"?h(n[r],e,t):e.append(t,n[r].toString())}return e}o.addModelToFormData=h;function m(n){return Array.from(new Set(n))}o.MAX_URL_LENGTH=2048;async function y({baseUrl:n,path:e,queryParams:i,fetcher:r,uniqueBy:t,options:a}){r=r||(0,f.createFetchComponent)();const s=q({baseUrl:n,path:e,queryParams:i}),c=new Map;for(const u of s)(await(await r.fetch(u,{...a,headers:{"Content-Type":"application/json"}})).json()).forEach(E=>c.set(t?E[t]:c.size,E));return Array.from(c.values())}o.splitAndFetch=y;const g=7;async function d({baseUrl:n,path:e,queryParams:i,elementsProperty:r,uniqueBy:t,options:a,fetcher:s}){s=s||(0,f.createFetchComponent)();const u=q({baseUrl:n,path:e,queryParams:i,reservedParams:new Map([["offset",g]])}),b=new Map;let E=!1;for(let v=0;v<u.length&&!E;v++){let l=u[v];for(;l&&!E;)try{const p=(await s.fetch(l,a)).json();p[r].forEach(j=>b.set(j[t],j));const _=p.pagination.next;l=_?new URL(_,l).toString():void 0}catch{E=!0}}return Array.from(b.values())}o.splitAndFetchPaginated=d;function F({queryParams:n,baseUrl:e,path:i,reservedParams:r}){const t="name"in n?new Map([[n.name,n.values]]):n;if(t.size===0)return[new C(e+i,t,r)];const s=Array.from(t.entries()).map(([l,p])=>[l,m(p)]).sort(([l,p],[T,_])=>p.length-_.length),c=new C(e+i,new Map,r);for(let l=0;l<s.length-1;l++){const[p,T]=s[l];if(!c.canSetParams(p,T))throw new Error("This library can split one query param into many HTTP requests, but it can't split more than one. You will need to do that on the client side.");c.setParams(p,T)}let u=C.clone(c);const[b,E]=s[s.length-1],v=[];for(const l of E)u.canAddParam(b,l)||(v.push(u),u=C.clone(c)),u.addParam(b,l);return v.push(u),v}o.splitValuesIntoManyQueryBuilders=F;function q(n){return F(n).map(i=>i.toString())}o.splitValuesIntoManyQueries=q;function M(n){if(!n)return new Map;const e=Object.entries(n).filter(([i,r])=>!!r).map(([i,r])=>{const t=i.endsWith("s")?i.slice(0,-1):i;let a;if(Array.isArray(r))a=[...r].filter(A).map(s=>`${s}`);else if(A(r))a=[`${r}`];else throw new Error("Query params must be either a string, a number, a boolean or an array of the types just mentioned");return[t,a]}).filter(([i,r])=>r.length>0);return new Map(e)}o.convertFiltersToQueryParams=M;function w(n,e){const i={...n==null?void 0:n.headers,...e==null?void 0:e.headers};return{...n,...e,headers:i}}o.mergeRequestOptions=w;function A(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"}function $(n){return n=n.trim(),!n.startsWith("https://")&&!n.startsWith("http://")&&(n="https://"+n),n.endsWith("/")&&(n=n.slice(0,-1)),n}o.sanitizeUrl=$;class C{constructor(e,i=new Map,r=new Map){this.baseUrl=e,this.queryParams=i,this.reservedParams=r,this.length=this.calculateUrlLength(i,r)}canAddParam(e,i){return this.length+e.length+i.length+2<o.MAX_URL_LENGTH}addParam(e,i){if(!this.canAddParam(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);const r=this.queryParams.get(e),t=r||[];return t.push(i),this.queryParams.set(e,t),this.length+=this.calculateAddedLength(e,[i]),this}canSetParams(e,i){const r=new Map([...this.queryParams,[e,i]]);return this.calculateUrlLength(r,this.reservedParams)<o.MAX_URL_LENGTH}setParams(e,i){if(!this.canSetParams(e,i))throw new Error(`You can't add this parameter '${e}', since it would exceed the max url length`);return this.queryParams.set(e,i.map(r=>`${r}`)),this.length=this.calculateUrlLength(this.queryParams,this.reservedParams),this}setParam(e,i){return this.setParams(e,[i]),this}toString(){let e=this.baseUrl,i=!1;for(const[r,t]of this.queryParams)for(const a of t)i?e+=`&${r}=${a}`:(e+=`?${r}=${a}`,i=!0);return e}calculateUrlLength(e,i){let r=this.baseUrl.length;for(const[t,a]of i)this.queryParams.has(t)||(r+=t.length+2+a);for(const[t,a]of e)r+=this.calculateAddedLength(t,a);return r}static clone(e){return new C(e.baseUrl,new Map(e.queryParams),e.reservedParams)}calculateAddedLength(e,i){return this.calculateArrayLength(i)+(e.length+2)*i.length}calculateArrayLength(e){return e.map(i=>`${i}`).reduce((i,r)=>i+r.length,0)}}o.QueryBuilder=C})(L)),L}var R={},I;function x(){if(I)return R;I=1,Object.defineProperty(R,"__esModule",{value:!0}),R.retry=void 0;async function o(f,S,P,h){for(;P>0;)try{return await S()}catch(m){if(P--,P>0)console.info(`Failed to ${f}. Still have ${P} attempt/s left. Will try again in ${h}`),await new Promise(y=>setTimeout(y,h));else throw m}throw new Error("Please specify more than one attempt for the retry function")}return R.retry=o,R}var N;function ee(){if(N)return O;N=1,Object.defineProperty(O,"__esModule",{value:!0}),O.createContentClient=O.downloadContent=void 0;const o=W(),f=Z(),S=x();async function P(m,y,g,d){const{attempts:F=3,retryDelay:q=500}=d||{},M=d!=null&&d.timeout?{timeout:d.timeout}:{};return(0,S.retry)(`fetch file with hash ${g} from ${y}`,async()=>{const w=await m.fetch(`${y}/${g}`,M),A=new Uint8Array(await w.arrayBuffer());if(!(d!=null&&d.avoidChecks)&&(g.startsWith("Qm")?await(0,o.hashV0)(A):await(0,o.hashV1)(A))!==g)throw new Error(`Failed to fetch file with hash ${g} from ${y}`);return A},F,q)}O.downloadContent=P;function h(m){const{fetcher:y,logger:g}=m,d=(0,f.sanitizeUrl)(m.url),F=m==null?void 0:m.parallelConfig;async function q(t,a,s){const c=new AbortController,u=c.signal,b=(0,f.mergeRequestOptions)(s,{signal:u});return new Promise(async E=>{let v=t.length;const l=()=>{v--,v===0&&E([])},p=T=>T&&Array.isArray(T)&&T.length>0?(c.abort(),E(T),!0):!1;t.forEach(async T=>{try{const _=(0,f.sanitizeUrl)(T),j=await y.fetch(`${_}${a}`,b);if(u.aborted){l();return}const k=await j.json();p(k)||l()}catch(_){u.aborted||g==null||g.warn(`Failed to fetch from ${T}:`,_),l()}})})}async function M(t,a,s){const u=(await Promise.allSettled(t.map(async l=>{try{const p=(0,f.sanitizeUrl)(l);return await(await y.fetch(`${p}${a}`,s)).json()}catch(p){return g==null||g.warn(`Failed to fetch from ${l}:`,p),[]}}))).filter(l=>l.status==="fulfilled").map(l=>l.value||[]),b=u.flatMap(l=>l),E=u.filter(l=>l.length===0).length,v=new Map;return b.forEach(l=>{(!v.has(l.id)||l.timestamp>v.get(l.id).timestamp)&&v.set(l.id,l)}),{entities:Array.from(v.values()),emptyResults:E}}async function w(t,a){const s=new FormData;s.append("entityId",t.entityId),(0,f.addModelToFormData)(t.authChain,s,"authChain");const c=await i(Array.from(t.files.keys()),a);for(const[u,b]of t.files)(!c.has(u)||u===t.entityId)&&s.append(u,new Blob([b]),u);return s}async function A(t,a){const s=await w(t,a),c=(0,f.mergeRequestOptions)(a||{},{body:s,method:"POST"});return await y.fetch(`${d}/entities`,c)}async function $(t,a){if(t.length===0)return Promise.reject("You must set at least one pointer.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:t}),method:"POST",headers:{"Content-Type":"application/json"}});return(await y.fetch(`${d}/entities/active`,s)).json()}async function C(t,a){if(t.length===0)return Promise.reject("You must set at least one id.");const s=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({ids:t}),method:"POST",headers:{"Content-Type":"application/json"}}),c=(a==null?void 0:a.parallel)||F;return c!=null&&c.urls&&(c==null?void 0:c.urls.length)>0?q([d,...c.urls],"/entities/active",s):(await y.fetch(`${d}/entities/active`,s)).json()}async function n(t,a){const s=await C([t],a);return s.length===0?Promise.reject(`Failed to find an entity with id '${t}'.`):s[0]}function e(t,a){return t.length===0?Promise.reject("You must set at least one cid."):(0,f.splitAndFetch)({fetcher:y,options:a,baseUrl:d,path:"/available-content",queryParams:{name:"cid",values:t},uniqueBy:"cid"})}async function i(t,a){const c=(await e(t,a)).filter(u=>u.available).map(({cid:u})=>u);return new Set(c)}async function r(t,a){const s=(a==null?void 0:a.parallel)||F;if(!(s!=null&&s.urls)||s.urls.length===0)throw new Error("Parallel configuration is required for checking pointer consistency");const c=(0,f.mergeRequestOptions)(a||{},{body:JSON.stringify({pointers:[t]}),method:"POST",headers:{"Content-Type":"application/json"}}),u=[d,...s.urls],{entities:b,emptyResults:E}=await M(u,"/entities/active",c);if(b.length===0)return{isConsistent:!0,upToDateEntities:void 0,outdatedEntities:void 0};const v=Math.max(...b.map(_=>_.timestamp)),l=b.filter(_=>_.timestamp===v),p=b.filter(_=>_.timestamp<v);return{isConsistent:p.length===0&&E===0,upToDateEntities:l.length>0?l:void 0,outdatedEntities:p.length>0?p:void 0}}return{buildEntityFormDataForDeployment:w,fetchEntitiesByPointers:$,fetchEntitiesByIds:C,fetchEntityById:n,downloadContent:(t,a)=>P(y,d+"/contents",t,a),deploy:A,isContentAvailable:e,checkPointerConsistency:r}}return O.createContentClient=h,O}var B=ee();const te=z(B),ae=Y({__proto__:null,default:te},[B]);export{ae as C};
|