@dcl/shop 0.1.0-29942574523.commit-573f25e → 0.1.0-29944279663.commit-001b5a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-CzCwcFdY.js → AnimatedBackground-CPcXx1BG.js} +3 -3
- package/assets/{Assets-BTdyC00C.js → Assets-AjWSopj2.js} +1 -1
- package/assets/{Assets.styles-eeqx94WS.js → Assets.styles-BldKbSnl.js} +26 -27
- package/assets/{Authorizations-BZhmfDD4.js → Authorizations-DN5rReSr.js} +1 -1
- package/assets/Cart-BOomZzFA.js +3 -0
- package/assets/{Cart-Ep_4Wxpy.css → Cart-BqMUti_3.css} +1 -1
- package/assets/{CircularProgress-BivMeg1W.js → CircularProgress-B7vK7bWC.js} +1 -1
- package/assets/{Collection-DQAOAaC9.js → Collection-Op3SrGcQ.js} +1 -1
- package/assets/CollectionCarousel-C2R0_DIx.js +1 -0
- package/assets/{Creator-X75Qvpr4.js → Creator-BXkmnq6l.js} +1 -1
- package/assets/{CssVarsProvider-C0ny30E-.js → CssVarsProvider-CbqPuVyv.js} +1 -1
- package/assets/{ExchangeController-D0l6M3tj.js → ExchangeController-CkwXcZrE.js} +1 -1
- package/assets/GetCredits-DyYrVUsB.js +1 -0
- package/assets/{HelpersUtil-hamZLlhX.js → HelpersUtil-Cd6Cz7k6.js} +1 -1
- package/assets/{ImportListings-BFIpuuBM.js → ImportListings-BqaE2RRj.js} +1 -1
- package/assets/ItemDetail-CXntx0dm.js +78 -0
- package/assets/{LoadMore-BLy9p9ul.js → LoadMore-wolzH5ER.js} +1 -1
- package/assets/MarketCheckout-D_f5rC4e.js +3 -0
- package/assets/MyAssets-CBQJfW0w.js +258 -0
- package/assets/{MyFavorites-Dul-WC6l.js → MyFavorites-DtHDd-wr.js} +1 -1
- package/assets/{MyPurchases-DI0zzNTZ.js → MyPurchases-BBRP2pOD.js} +1 -1
- package/assets/{NotFound-Bdg_iIpB.js → NotFound-CJzX5KFi.js} +1 -1
- package/assets/PrimaryListModal-Bfe2jEqA.js +1 -0
- package/assets/{StoreSettings-2cViRT0c.js → StoreSettings-CCjyP-1z.js} +5 -5
- package/assets/Success-DgDiikPg.js +4 -0
- package/assets/{SwapController-DKBIcDPA.js → SwapController-CtlOMvk3.js} +1 -1
- package/assets/{Tooltip-DJ7HtAmB.js → Tooltip-BtGlCRjR.js} +1 -1
- package/assets/{TradeService-BpWgN8zg.js → TradeService-OKrfHBNk.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-B40OWK0h.js → W3MFrameProviderSingleton-BFTt2bWv.js} +3 -3
- package/assets/{WebCryptoP256-Ccr1DsYO.js → WebCryptoP256-CNNq2h94.js} +1 -1
- package/assets/{authorizations-sU14ILrd.js → authorizations-ChRb35xG.js} +1 -1
- package/assets/{basic-DaSuNoEa.js → basic-O1kzoE_h.js} +1 -1
- package/assets/{biconomy-DmmBzkXG.js → biconomy-NJyzVP4P.js} +1 -1
- package/assets/{buy-BRLq1STf.js → buy-CNc4Y8CN.js} +1 -1
- package/assets/{buy-gasless-hR2bH0iR.js → buy-gasless-wrR0AjfW.js} +1 -1
- package/assets/{cart-checkout-CifIjL1z.js → cart-checkout-BAUaf92R.js} +1 -1
- package/assets/{categories-BPU8ySTe.js → categories-BKqMpg3a.js} +1 -1
- package/assets/{ccip-C1DhAmlP.js → ccip-DzP3mwwB.js} +1 -1
- package/assets/{ccip-pv6qu637.js → ccip-S_59ofbi.js} +1 -1
- package/assets/collection-4y6zy3OY.js +1 -0
- package/assets/{controller-DBPpBNi9.js → controller-CyymDuZ1.js} +2 -2
- package/assets/{core-CftjJZSY.js → core-DpgBxh1f.js} +4 -4
- package/assets/{custom-CLjHEVcz.js → custom-CUYXqRFz.js} +1 -1
- package/assets/{data-capture-ClKTWWBL.js → data-capture-DEtSxXU7.js} +1 -1
- package/assets/{email-Dx9BSTtw.js → email-CZBKdtTz.js} +1 -1
- package/assets/{embedded-wallet-CCKNmFwm.js → embedded-wallet-DI5q9f92.js} +1 -1
- package/assets/{emotion-styled.browser.esm-B6FBNgF3.js → emotion-styled.browser.esm-DSDqSITi.js} +1 -1
- package/assets/{engine-1UaDNb6s.js → engine-H6XTP7Hg.js} +1 -1
- package/assets/{errors-DKFg2ql0.js → errors-gKUnErEU.js} +1 -1
- package/assets/{estimate-l1-fee-cQM6_GVS.js → estimate-l1-fee-CRLseeHD.js} +1 -1
- package/assets/{execute-BuVfiwvM.js → execute-DnoTKwUA.js} +2 -2
- package/assets/{features-ieqkL6m1.js → features-DsCWYm7t.js} +1 -1
- package/assets/{fetchTokenMetadata-D8OWz4cP.js → fetchTokenMetadata-D8xF6Tp2.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-LZLHBFVZ.js → get-ecosystem-wallet-info-eeuY73_c.js} +1 -1
- package/assets/{getBalance-Ck1YHbUL.js → getBalance-D4FtfBuc.js} +1 -1
- package/assets/{getNFT-DYxVn0Et.js → getNFT-CCUV8jjB.js} +1 -1
- package/assets/{getNFT-DnYNAiji.js → getNFT-DsBG7sol.js} +1 -1
- package/assets/{getOverlayAlpha-Jb_9sPPd.js → getOverlayAlpha-DD0MBenH.js} +1 -1
- package/assets/{hashTypedData-BHOeb4kN.js → hashTypedData-D4XcfX8m.js} +1 -1
- package/assets/{hashTypedData-Bqz6FRnB.js → hashTypedData-DY9RW77q.js} +1 -1
- package/assets/{import-CyzZeEcP.js → import-C4A0dOmT.js} +1 -1
- package/assets/{in-app-yMA-tvKO.js → in-app-miryaTIx.js} +1 -1
- package/assets/{in-app-wallet-calls-BJRqCE4k.js → in-app-wallet-calls-BNAeRkM1.js} +1 -1
- package/assets/{index-Dx4oKUoK.js → index-5BCUAQ7G.js} +1 -1
- package/assets/{index-B7YJ2-NC.js → index-B-lOuLL_.js} +1 -1
- package/assets/{index-YX1mo09T.js → index-B0f3YMv0.js} +1 -1
- package/assets/{index-3c-o1deN.js → index-B2KZdX5l.js} +1 -1
- package/assets/{index-LMkzNUyd.js → index-B7Aw3qxP.js} +1 -1
- package/assets/{index-Dil5ESgb.js → index-BHgNE80I.js} +1 -1
- package/assets/{index-Df4qngsG.js → index-BMxVktKR.js} +1 -1
- package/assets/{index-BLpc0PAw.js → index-BPTCeB75.js} +1 -1
- package/assets/{index-LQPmlKJw.js → index-BR9EQbWB.js} +1 -1
- package/assets/{index-BgMPhDEY.js → index-BVDwZ7ux.js} +1 -1
- package/assets/{index-B6Hb0r15.js → index-BaEQqKh7.js} +1 -1
- package/assets/{index-Chx72aoA.js → index-Bd6HRkkM.js} +1 -1
- package/assets/{index-D0tMQ_oG.js → index-BeDPwdIU.js} +1 -1
- package/assets/{index-C0MEN305.js → index-BeF4PcAs.js} +1 -1
- package/assets/{index-DHzasbYL.js → index-Bnxb7s2U.js} +1 -1
- package/assets/index-Bw9Y53F1.css +1 -0
- package/assets/index-C1yBaAe9.js +289 -0
- package/assets/{index-uESxdvPf.js → index-CAtCo41a.js} +1 -1
- package/assets/{index-B55KertC.js → index-CJ72HArz.js} +1 -1
- package/assets/{index-zfsFyt-v.js → index-CKain9CR.js} +1 -1
- package/assets/{index-CO9CUrPm.js → index-CNUSWwhT.js} +2 -2
- package/assets/{index-mc7xea6T.js → index-CS_YGkJS.js} +1 -1
- package/assets/{index-Cenx9VIL.js → index-CUapata6.js} +1 -1
- package/assets/{index-DM6cwvvh.js → index-CW4WLUXF.js} +1 -1
- package/assets/{index-BVjayAtf.js → index-CaKtCSoO.js} +1 -1
- package/assets/{index-0C8jHF02.js → index-CchI9mHk.js} +1 -1
- package/assets/{index-B8PSEU0f.js → index-Cd8SstNC.js} +1 -1
- package/assets/{index-Bxu_HZv7.js → index-Cglxr6xq.js} +1 -1
- package/assets/{index-0Z5nkscP.js → index-CitxiVaF.js} +1 -1
- package/assets/{index-fvb_2ePt.js → index-CpUzfl0K.js} +1 -1
- package/assets/{index-CqYieDft.js → index-CryDMiQl.js} +1 -1
- package/assets/{index-nmCuLAGG.js → index-CvSuJFRB.js} +1 -1
- package/assets/{index-DwFc8v1Z.js → index-D-u-hSI3.js} +1 -1
- package/assets/{index-Dszgr0BR.js → index-D15jEYwr.js} +1 -1
- package/assets/{index-B_fPkyQt.js → index-D4MR9O_F.js} +1 -1
- package/assets/{index-CWcMLN9O.js → index-DBt6hDgv.js} +1 -1
- package/assets/{index-Dc1nvyn9.js → index-DNxKrdux.js} +1 -1
- package/assets/{index-a_8ZLAR0.js → index-DSw2AqET.js} +1 -1
- package/assets/{index-D18uHh6f.js → index-DWxI9Hlb.js} +1 -1
- package/assets/{index-Bc63dzBj.js → index-DXtL9zpK.js} +3 -3
- package/assets/{index-CCr2J09y.js → index-DbySRbMy.js} +2 -2
- package/assets/{index-DSbcS8Gm.js → index-DpDqOxel.js} +1 -1
- package/assets/{index-DPjEYQhJ.js → index-DsrJfyy3.js} +1 -1
- package/assets/{index-BEOJi3Jo.js → index-G8bd0RHd.js} +1 -1
- package/assets/{index-xFOezD9a.js → index-KOeN6JEM.js} +1 -1
- package/assets/{index-CstoEHiD.js → index-U4GunfhO.js} +1 -1
- package/assets/{index-WrHr3vKs.js → index-ZiBxg6FP.js} +2 -2
- package/assets/{index-BlKccc7B.js → index-dBhDm5QH.js} +1 -1
- package/assets/{index-KyO7a8ne.js → index-iruECcYS.js} +3 -3
- package/assets/{index-O1MAeCt1.js → index-k4CkTGxw.js} +1 -1
- package/assets/{index-DJEb_i4T.js → index-rbNc96Al.js} +1 -1
- package/assets/{index-DPm2T7me.js → index-sXacIDUz.js} +3 -3
- package/assets/{index-CVG4mg1H.js → index-wJEgDopC.js} +1 -1
- package/assets/{index.es-CP2cNM9F.js → index.es-BxcQA2dU.js} +1 -1
- package/assets/{index.es-Dy8PEmK4.js → index.es-Cl_XwBUi.js} +4 -4
- package/assets/{index.es-B-uJmNhd.js → index.es-DIuzDiOd.js} +1 -1
- package/assets/{localBatchGatewayRequest-Dg8trW1f.js → localBatchGatewayRequest-DInd0cLm.js} +1 -1
- package/assets/{mana-rate-DtQ8WpoI.js → mana-rate-CQNKlfL0.js} +1 -1
- package/assets/{networks-BaSDToU0.js → networks-Cov5QiMG.js} +1 -1
- package/assets/{onramp-D6REu-OE.js → onramp-hb5ff0As.js} +1 -1
- package/assets/{openzeppelin-DsZ0ZpWh.js → openzeppelin-Bjn2nu6_.js} +1 -1
- package/assets/{parseNft-BrwItloF.js → parseNft-D9LBoQtO.js} +2 -2
- package/assets/{parseSignature-C67g8Ikn.js → parseSignature-L1A1P3GM.js} +1 -1
- package/assets/{parseSignature-CtBPNsAi.js → parseSignature-ePtMgMiu.js} +3 -3
- package/assets/{passkeys-CkVvpC6F.js → passkeys-DmsGOzkI.js} +1 -1
- package/assets/{pay-with-exchange-DDftQXGa.js → pay-with-exchange-AEyKwlqz.js} +1 -1
- package/assets/{qr-overlay-CHyDfEfF.js → qr-overlay-DyUlpaIC.js} +1 -1
- package/assets/{receive-BqeMp3_k.js → receive-DXQR7h-2.js} +1 -1
- package/assets/{resolveImplementation-D6GNwvZn.js → resolveImplementation-BXX46XHe.js} +1 -1
- package/assets/{rpc-D1wZc4pd.js → rpc-DpwEotT8.js} +1 -1
- package/assets/{secp256k1-Cu8gqKOi.js → secp256k1-CAtCZ-Xr.js} +1 -1
- package/assets/{secp256k1-DKdkwurr.js → secp256k1-DXm6hl-z.js} +1 -1
- package/assets/{secp256k1-tM-HU4Wb.js → secp256k1-IsXW7STM.js} +1 -1
- package/assets/{send-C5LlTSZw.js → send-CbWz9hcp.js} +1 -1
- package/assets/{send-batch-transaction-2M20mpyd.js → send-batch-transaction-9mR-y7h4.js} +1 -1
- package/assets/{send-eip712-transaction-DxCA-Uwd.js → send-eip712-transaction-CM2oNuUv.js} +2 -2
- package/assets/{send-gasless-transaction-VjwN2uQK.js → send-gasless-transaction-Dt3TrVjF.js} +2 -2
- package/assets/{send-transaction-Bb0Q9hmN.js → send-transaction-BZ4LJjTi.js} +2 -2
- package/assets/{sendRawTransaction-CED77ONZ.js → sendRawTransaction--x3C4a4M.js} +3 -3
- package/assets/{serializeTransaction-7yAEy3FU.js → serializeTransaction-DkNQBPpa.js} +1 -1
- package/assets/{session-proposal-DGrkZ9Ix.js → session-proposal-C_7oJg4v.js} +1 -1
- package/assets/{session-request-Dg8cFRll.js → session-request-BswrUDyz.js} +2 -2
- package/assets/{signing-DuUwyfpZ.js → signing-Ci_N7XnZ.js} +3 -3
- package/assets/{socials-cbGvEEpM.js → socials-Cy0uuEjD.js} +1 -1
- package/assets/{swaps-EURvYFti.js → swaps-CJefGDGP.js} +1 -1
- package/assets/{thirdweb-D4Tt3SPK.js → thirdweb-_jeY-8oo.js} +3 -3
- package/assets/{to-serializable-transaction-Dh5bAtyQ.js → to-serializable-transaction-z3rODop-.js} +2 -2
- package/assets/{trade-encoding-0IFZ39Tk.js → trade-encoding-DQ3zNCj8.js} +1 -1
- package/assets/{transactionReceipt-DIw9ApVw.js → transactionReceipt-CmnDZJIN.js} +1 -1
- package/assets/{transactions-xAqHSp91.js → transactions-C19bGnmB.js} +1 -1
- package/assets/useCreditPacks-Caur-2iX.js +1 -0
- package/assets/{useInfiniteGrid-BbeLTVdN.js → useInfiniteGrid-CRDFn4if.js} +1 -1
- package/assets/{useStore-PWA7dbNJ.js → useStore-DjC0Mzyl.js} +1 -1
- package/assets/useTheme-4G-3zKnL.js +1 -0
- package/assets/{useTheme-BHtz4hyG.js → useTheme-YjNnj0AZ.js} +1 -1
- package/assets/{verifyHash-sv4aRvH_.js → verifyHash-C_4O6fWL.js} +1 -1
- package/assets/{w3m-modal-D1RMqW5z.js → w3m-modal-C8bpYQNG.js} +1 -1
- package/assets/{w3m-modal-BoTSPCYe.js → w3m-modal-Ckpscz46.js} +1 -1
- package/assets/{wait-for-tx-receipt-CnoUxMtV.js → wait-for-tx-receipt-FMU2_8T4.js} +1 -1
- package/assets/{wallets-Cuqbvnoy.js → wallets-DdObuep1.js} +5 -5
- package/assets/{web-connector-0FomZsHS.js → web-connector-CnDHaN6b.js} +3 -3
- package/assets/{writeContract-Bicvfabo.js → writeContract-C9X9RN9V.js} +1 -1
- package/assets/{zoraTestnet-4QPNkDlh.js → zoraTestnet-d3v06Qdp.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-BicSZMzV.js +0 -3
- package/assets/CollectionCarousel-D_udpdxX.js +0 -1
- package/assets/GetCredits-CMdoboQp.js +0 -1
- package/assets/ItemDetail-C0Sm18Me.js +0 -78
- package/assets/MarketCheckout-DSl7Bl-M.js +0 -3
- package/assets/MyAssets-UFPrjPwu.js +0 -258
- package/assets/PrimaryListModal-CnlMOkG5.js +0 -1
- package/assets/Success-D9l7pr2K.js +0 -4
- package/assets/collection-DhudRI2A.js +0 -1
- package/assets/index-CJ4mXolB.js +0 -289
- package/assets/index-CqYr0ABc.css +0 -1
- package/assets/useCreditPacks-DO-uyk4N.js +0 -1
- package/assets/useTheme-Ciqd957r.js +0 -1
package/index.html
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
<link rel="canonical" href="https://shop.decentraland.org/" />
|
|
17
17
|
|
|
18
18
|
<!-- Favicon: the Decentraland mark (same as the marketplace). -->
|
|
19
|
-
<link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
20
|
-
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
19
|
+
<link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/favicon.ico" sizes="16x16 32x32 48x48" />
|
|
20
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/apple-touch-icon.png" />
|
|
21
21
|
<meta name="apple-mobile-web-app-title" content="DCL Shop" />
|
|
22
|
-
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
22
|
+
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/site.webmanifest" />
|
|
23
23
|
|
|
24
24
|
<!-- Open Graph -->
|
|
25
25
|
<meta property="og:type" content="website" />
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<meta name="twitter:image:alt" content="Decentraland Shop — wearables and emotes for your avatar" />
|
|
49
49
|
|
|
50
50
|
<!-- Sitemap -->
|
|
51
|
-
<link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
51
|
+
<link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/sitemap.xml" />
|
|
52
52
|
|
|
53
53
|
<!-- Warm the 3D preview / fonts -->
|
|
54
54
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
<link rel="preconnect" href="https://wearable-preview.decentraland.org" />
|
|
61
61
|
<link rel="preconnect" href="https://peer.decentraland.zone" crossorigin />
|
|
62
62
|
<link rel="preconnect" href="https://peer.decentraland.org" crossorigin />
|
|
63
|
-
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
64
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
65
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
66
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
67
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
68
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
69
|
-
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
63
|
+
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/index-C1yBaAe9.js"></script>
|
|
64
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/react-BrLDncxD.js">
|
|
65
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/dcl-schemas-BICTSpB5.js">
|
|
66
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/sentry-DYZXk5O5.js">
|
|
67
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/ethers-CLB2z3On.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/intl-CBcMB1D2.js">
|
|
69
|
+
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29944279663.commit-001b5a7/assets/index-Bw9Y53F1.css">
|
|
70
70
|
</head>
|
|
71
71
|
<body>
|
|
72
72
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/shop",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-29944279663.commit-001b5a7",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "Decentraland",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/decentraland/shop.git"
|
|
10
10
|
},
|
|
11
|
-
"commit": "
|
|
11
|
+
"commit": "001b5a736f845dedcf8468e6cbc489141670d7fc"
|
|
12
12
|
}
|
package/assets/Cart-BicSZMzV.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e,r as f,a as Me,u as Ee,L as Z}from"./react-BrLDncxD.js";import{t as a,h as L,j as H,u as Pe,af as v,a as le,d as qe,m as Te,n as Ie,o as Le,I,g as Fe,e as Be,x as G,ah as de,ai as Re,E as A,s as Ae,B as Ue,C as We,w as ze,q as ue,aj as $e,z as he,y as Qe,ak as Ke}from"./index-CJ4mXolB.js";import{a as me}from"./buy-BRLq1STf.js";import{g as Oe,a as Ge,w as De,S as He,G as Je}from"./buy-gasless-hR2bH0iR.js";import{R as D,r as Ve}from"./cart-checkout-CifIjL1z.js";import{u as Ye,c as Xe}from"./useCreditPacks-DO-uyk4N.js";import{l as Ze}from"./loader-logo-BzY9EKdC.js";import{i as es,a as ss}from"./errors-DKFg2ql0.js";import{E as as}from"./ErrorNotice-BDH9xoG4.js";import{C as ts}from"./CollectionCarousel-D_udpdxX.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./authorizations-sU14ILrd.js";import"./index-HN6Rk25C.js";import"./trade-encoding-0IFZ39Tk.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/buy-error-22UunaPC.png";function cs(r){const{phase:n,balanceCredits:h,onClose:m}=r,C=n==="processing",w=n==="error"?a("cartCheckout.errorTitle"):n==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),S=n==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?void 0:m,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${S?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:w}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:m,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:n==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(L,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:H(h)})]})]}),n==="processing"&&e.jsx(ns,{stage:r.stage??"reserving",step:r.step??1,total:r.total??1,isSelfCustody:!!r.isSelfCustody}),n==="nofunds"&&e.jsx(is,{lines:r.lines??[],shortfallCredits:r.shortfallCredits??0,packs:r.packs??[],selectedPack:r.selectedPack??"",onSelectPack:r.onSelectPack??(()=>{}),onBuyPacks:r.onBuyPacks??(()=>{}),onCancel:m}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:m,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:r.onRetry??m,children:a("cartCheckout.tryAgain")})]})]})]})]})}function ns({stage:r,step:n,total:h,isSelfCustody:m}){const C=r==="reserving",w=h>0?Math.min(100,Math.round(n/h*100)):0,S=r==="awaiting-signature"?m?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):r==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:Ze,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:S}),C?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${w}%`}})}),h>1?e.jsxs("span",{className:"cart-checkout__step",children:[n,"/",h]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function is({lines:r,shortfallCredits:n,packs:h,selectedPack:m,onSelectPack:C,onBuyPacks:w,onCancel:S}){const N=h.find(t=>t.id===m),J=r.reduce((t,_)=>t+(_.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,n)})})," ",a("buyModal.warningToPurchase",{count:J})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:r.map(t=>{const _=t.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:t.item.name,children:[t.item.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),t.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:t.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(L,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:H(t.priceCredits*_)})]})]})]},t.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:h.map(t=>{const _=t.id===m;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>C(t.id),children:[e.jsx(L,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:H(t.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",t.usd.toFixed(2),")"]})]},t.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(L,{className:"buy-modal__total-ico"}),e.jsx("span",{children:H((N==null?void 0:N.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((N==null?void 0:N.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:S,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}const os=Ae(Ue)`
|
|
2
|
-
margin-top: 12px;
|
|
3
|
-
`;function _e(r){if(es(r))return a("errors.rejected");const n=(r.message??"").toLowerCase();return n.includes("insufficient")?a("cart.error.insufficient",{currency:We.name}):n.includes("no active listing")||n.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const ls=12e4;function ds(r){const n=[];return r.unavailable.length&&n.push(a("cart.drop.unavailable",{count:r.unavailable.length})),r.own.length&&n.push(a("cart.drop.own",{count:r.own.length})),a("cart.drop.removed",{items:n.join(` ${a("cart.drop.and")} `)})}const ye=r=>r.reduce((n,h)=>n+h.priceCredits*h.quantity,0),us=r=>r.flatMap(n=>Array.from({length:n.quantity},()=>({...n,quantity:1})));function Es(){Pe({title:a("nav.cart"),noindex:!0});const r=v(s=>s.items),n=v(s=>s.remove),h=v(s=>s.increment),m=v(s=>s.decrement),C=v(s=>s.clear),w=v(s=>s.restore),S=v(s=>s.setFittingOpen),N=le(s=>s.items),J=le(s=>s.toggle),{session:t}=qe(),_=Ye().packs.slice(0,3);f.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=r.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:F}=Ie(t),U=Le(),W=Me(),{state:T}=Ee(),[ee,B]=f.useState(null),[be,M]=f.useState(null),[se,z]=f.useState(null),[ge,E]=f.useState(!1),[x,R]=f.useState(null),ae=f.useRef(0),[l,k]=f.useState(null),[Y,te]=f.useState(""),fe=r.reduce((s,c)=>s+c.priceCredits*c.quantity,0),re=r.reduce((s,c)=>s+c.quantity,0),xe=x?x.liveTotalCredits:fe,ke=new Set(r.map(s=>s.id)),ce=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),je=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),$=(F==null?void 0:F.credits)??0,ve=Re;function Q(s){s(),R(null),z(null),M(null)}function Ce(){k(null),E(!1)}function ne(s){const c=ye(s),i=Math.max(0,c-$),p=_.find(d=>d.credits>=i)??_[_.length-1];te(p.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:$,shortfall:i}),k({phase:"nofunds",lines:s.map(d=>({item:d.item,priceCredits:d.priceCredits,quantity:d.quantity})),shortfall:i}),E(!1)}async function Ne(s){if(!t||s.length===0)return;const c=us(s),i=c.map(o=>({...o.item,priceCredits:o.priceCredits})),p=s.map(o=>({...o.item,priceCredits:o.priceCredits,quantity:o.quantity})),d=[];let j="authorize",O=!1;k({phase:"processing",stage:"reserving",step:1,total:c.length});try{const o=[];for(let u=0;u<c.length;u++){const q=c[u];k({phase:"processing",stage:"reserving",step:u+1,total:c.length});try{const{credit:y,maxCreditedValue:X}=await ze(t.identity,q.usdCents,q.trade.id);d.push(y.id),o.push({trade:q.trade,credits:[y],maxCreditedValue:X})}catch(y){if(ss(y)){if(d.length){try{await ue(t.identity,d)}catch(X){A(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw y}}j="submit";const b=()=>k({phase:"processing",stage:"settling",step:c.length,total:c.length});k({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});let g=[];if(Oe())try{g=await Ge({purchases:o,buyer:t.address,signer:t.signer,onSigned:b});const q=(await Promise.allSettled(g.map(y=>De(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(q.length&&!q.some(y=>y instanceof He))throw q[0];O=!0}catch(u){if(!(u instanceof Je))throw u;g=await me({purchases:o,buyer:t.address,signer:t.signer,onSigned:b})}else g=await me({purchases:o,buyer:t.address,signer:t.signer});s.forEach(u=>n(u.item.id)),R(null),G("Shop Completed Purchase",{...$e(i),payment_type:"credits",no_crypto_step:O,transaction_hash:g[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),k(null),E(!1),W("/success",{state:{items:p,txHash:g[0]??void 0,settled:!0},replace:!0})}catch(o){if(he(o)||A(o,{flow:"cart_checkout",step:j,cart_size:s.length}),G(he(o)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:j,error_code:Qe(o),value_usd:de(i.reduce((b,g)=>b+g.priceCredits,0)),cart_size:c.length}),d.length){try{await ue(t.identity,d)}catch(b){A(b,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:_e(o)})}}function ie(s){const c=ye(s);if(F!=null&&F.credits<c){ne(s);return}Ne(s)}async function K(){if(!t){M(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length===0)return;M(null),z(null),E(!0);const c=s.reduce((i,p)=>i+p.priceCredits*p.quantity,0);G("Shop Started Checkout",{cart_size:s.length,cart_value_credits:c,cart_value_usd:de(c),has_sufficient_credits:$>=c});try{B(a("cart.status.reviewing"));const i=await Ve(s,t.address,ve),p=[...i.unavailable,...i.own];if(p.length&&(p.forEach(d=>n(d.id)),z(ds(i))),i.buyable.length===0){M(a("cart.error.noneAvailable")),R(null),B(null);return}if(i.orderChanged){R(i),ae.current=Date.now(),B(null);return}B(null),ie(i.buyable)}catch(i){A(i,{flow:"cart_checkout",step:"review",cart_size:s.length}),M(_e(i)),B(null)}finally{E(!1)}}async function we(){if(x){if(!t){M(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>ls){R(null),z(null),await K();return}M(null),ie(x.buyable)}}async function Se(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(v.getState().items))}catch{}E(!0);try{const s=await Xe(Y,t?{address:t.address,identity:t.identity}:void 0);if(s.url){window.location.href=s.url;return}W("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}A(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{E(!1)}}}const oe=f.useRef(!1);f.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||oe.current)return;oe.current=!0;try{const c=sessionStorage.getItem(D);if(c){sessionStorage.removeItem(D);const i=JSON.parse(c);Array.isArray(i)&&i.length&&w(i)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void K(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const P=ge||(l==null?void 0:l.phase)==="processing";return r.length===0&&!l?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(I,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(os,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>W(-1),type:"button",children:[e.jsx(I,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>W(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(I,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:re})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>S(!0),disabled:P,children:[e.jsx(I,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:r.map(s=>{const c=je.get(s.id),i=c?c.priceCredits:s.priceCredits,p=!!c&&c.priceCredits!==s.priceCredits,d=!s.tokenId,j=s.quantity,O=typeof s.available=="number"&&j>=s.available,o=i*j,b=!!N[s.id],g=s.tokenId??s.itemId,u=s.contractAddress&&g?`/item/${s.contractAddress}/${g}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[u?e.jsx(Z,{className:"checkout__thumb-link",to:u,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[u?e.jsx(Z,{className:"checkout__name",to:u,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Fe,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[d?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>m(s.id)),disabled:P||j<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:j}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>h(s.id)),disabled:P||O,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(L,{className:"checkout__price-ico"})," ",o,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*j}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${b?" is-on":""}`,onClick:()=>J(s),"aria-label":b?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:b?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(I,{name:b?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>n(s.id)),disabled:P,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(I,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>Q(C),disabled:P,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:re})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(L,{className:"checkout__total-ico"})," ",xe]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(x?we():K()),disabled:P,children:P?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),x?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(as,{message:be,className:"checkout__msg"})]})]})]})]}),ce.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ts,{title:a("cart.youMightAlsoLike"),items:ce})}):null,l?e.jsx(cs,{phase:l.phase,balanceCredits:$,onClose:Ce,stage:l.phase==="processing"?l.stage:void 0,step:l.phase==="processing"?l.step:void 0,total:l.phase==="processing"?l.total:void 0,isSelfCustody:Be(t==null?void 0:t.providerType),lines:l.phase==="nofunds"?l.lines:void 0,shortfallCredits:l.phase==="nofunds"?l.shortfall:void 0,packs:_,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Se(),message:l.phase==="error"?l.message:void 0,onRetry:()=>void K()}):null]})}export{Es as Cart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as t}from"./react-BrLDncxD.js";import{t as s,I as k,L as f,A as N}from"./index-CJ4mXolB.js";function A({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{A as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $,b as q,r as i,j as e}from"./react-BrLDncxD.js";import{u as H,t as s,d as Q,o as V,x as g,C as d,E as P,y as I,h as W,r as z}from"./index-CJ4mXolB.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-CifIjL1z.js";import{l as J}from"./loader-logo-BzY9EKdC.js";import{u as Z,p as X,c as ee,i as se}from"./useCreditPacks-DO-uyk4N.js";import{C as te}from"./CircularProgress-BivMeg1W.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/credit-coin-CmcTCd5i.webp",ae="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",C=se()?"mock":"stripe",ce={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function M(l){const r=l;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function je(){H({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const l=$(),{session:r,signIn:m}=Q(),n=V(),[k,S]=q(),{packs:F,isLoading:T}=Z(),[p,o]=i.useState("select"),[c,w]=i.useState(null),[E,R]=i.useState(null),[U,_]=i.useState(null),[K,N]=i.useState(!1),f=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=i.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=i.useCallback(async t=>{o("processing");const a=new AbortController;f.current=a;try{const u=await X(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const j=u.creditsGranted??(c==null?void 0:c.credits)??0;R(j>0?j:null),o("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:j>0?j:null,provider:C}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){l("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const A=sessionStorage.getItem(G);if(A){sessionStorage.removeItem(G);const h=JSON.parse(A),B=h.tokenId??h.itemId;if(h.contractAddress&&B){l(`/item/${h.contractAddress}/${B}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),o("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),_(u.error??s("getCredits.errorGrant",{currency:d.name})),o("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),_(M(u)),o("error")}},[c,r,n,l]),O=i.useCallback(async t=>{if(!r){m();return}_(null),N(!1),w(t),o(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await ee(t.id,{address:r.address,identity:r.identity});if(a.mock)b(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),_(M(a)),o("error")}},[r,m,b]),y=i.useRef(!1);i.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),o("select");return}t&&(o("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),o("select"),w(null),R(null),_(null),N(!1)}const Y=p==="select";return e.jsxs("div",{className:"getcredits",children:[Y&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:J,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:ae,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(W,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:v,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:l,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:l.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:z(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{je as GetCredits,je as default};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-fvb_2ePt.js","assets/react-BrLDncxD.js","assets/dcl-schemas-BICTSpB5.js","assets/index-CJ4mXolB.js","assets/sentry-DYZXk5O5.js","assets/ethers-CLB2z3On.js","assets/intl-CBcMB1D2.js","assets/index-CqYr0ABc.css","assets/emotion-styled.browser.esm-B6FBNgF3.js","assets/useTheme-BHtz4hyG.js","assets/CircularProgress-BivMeg1W.js","assets/index-BlKccc7B.js","assets/useTheme-Ciqd957r.js","assets/CssVarsProvider-C0ny30E-.js","assets/getOverlayAlpha-Jb_9sPPd.js","assets/index-BgMPhDEY.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as pe,r as c,j as e,d as ha,u as _a,L as ya}from"./react-BrLDncxD.js";import{d as Y,n as pa,o as Ge,t,ai as fa,i as ba,b as xa,w as ja,q as ie,x as V,y as Re,z as _e,aj as va,E as le,h as M,j as ne,_ as ye,an as ga,ax as Na,ay as wa,az as ka,aA as Ia,c as fe,aB as Ca,a6 as He,m as R,aC as Aa,I as F,F as O,s as z,aD as Sa,aE as Ma,aF as Pa,G as Ea,af as qe,a as $e,aG as Fa,aH as La,aI as Da,aJ as Ta,aK as Ba,ag as Ra,u as qa,aL as $a,aM as Oa,aN as za,g as Ka,aO as Oe,aP as Wa,B as be,f as Va,J as Qa,ao as Ua,aQ as Ga,aR as Ha,ap as Ja,aS as Ya,aT as Za}from"./index-CJ4mXolB.js";import{d as Q}from"./dcl-schemas-BICTSpB5.js";import{b as ze,c as Xa}from"./buy-BRLq1STf.js";import{S as et,P as at,f as tt}from"./PrimaryListModal-CnlMOkG5.js";import{g as st,b as it,w as rt,S as nt,G as lt}from"./buy-gasless-hR2bH0iR.js";import{u as dt,c as ot}from"./useCreditPacks-DO-uyk4N.js";import{R as Ke}from"./resume-buy-Bf0zIH7y.js";import{a as ct,f as We,i as mt}from"./errors-DKFg2ql0.js";import{E as xe}from"./ErrorNotice-BDH9xoG4.js";import{l as ut}from"./loader-logo-BzY9EKdC.js";import{C as ht}from"./CircularProgress-BivMeg1W.js";import{u as _t,M as yt}from"./MarketCheckout-DSl7Bl-M.js";import{s as pt}from"./address-DrURAr9O.js";import{C as ft}from"./CollectionCarousel-D_udpdxX.js";import{T as Je}from"./Tooltip-DJ7HtAmB.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./authorizations-sU14ILrd.js";import"./index-HN6Rk25C.js";import"./trade-encoding-0IFZ39Tk.js";import"./mana-rate-DtQ8WpoI.js";import"./emotion-CSxEP8yM.js";function bt({item:s,onClose:n,resume:r=!1}){var X,ee;const{session:d}=Y(),{data:o}=pa(d),h=Ge(),g=pe(),j=dt().packs.slice(0,3),[m,l]=c.useState("loading"),[a,N]=c.useState(null),[p,w]=c.useState(""),[L,b]=c.useState(s.priceCredits),[f,D]=c.useState(null),P=c.useRef(null),A=(f==null?void 0:f.credits)??L,Z=(o==null?void 0:o.credits)??0;c.useEffect(()=>{let u=!1;if(!d){l("error"),N(t("buyModal.signInToCheckout"));return}const k=_=>{const I=_-((o==null?void 0:o.credits)??0),x=j.find(T=>T.credits>=I)??j[j.length-1];w(x.id),V("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,I)}),l("nofunds")};return(async()=>{var _,I;try{const x=await fa(s);if(!x)throw new Error("not for sale");if(ba(x,d.address))throw new Error("You can't buy your own listing.");const T=xa((I=(_=x.received)==null?void 0:_[0])==null?void 0:I.amount);if(!Number.isFinite(T)||T<=0)throw new Error("price unavailable");const K=Math.ceil(T/10);if(u)return;if(b(K),o!=null&&o.credits<K){k(K);return}try{const{credit:C,maxCreditedValue:G,usdCents:$}=await ja(d.identity,T,x.id);if(u){ie(d.identity,[C.id]).catch(()=>{});return}P.current=C.id;const ae=Math.ceil($/10);b(ae);const W={trade:x,credit:C,maxCreditedValue:G,usdCents:$,credits:ae};D(W),r?U(W):l("ready")}catch(C){if(u)return;if(ct(C)){k(K);return}throw C}}catch(x){if(u)return;V(_e(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Re(x)}),l("error"),N(We(x,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{u=!0,P.current&&d&&(ie(d.identity,[P.current]).catch(()=>{}),P.current=null)}},[]);async function U(u=f){if(!d||!u)return;l("processing"),N(null);let k=!1;try{const _={trade:u.trade,buyer:d.address,signer:d.signer,credits:[u.credit],maxCreditedValue:u.maxCreditedValue};let I;if(st())try{I=await it(_),await rt(I),k=!0}catch(x){if(x instanceof nt)k=!0;else if(x instanceof lt)I=await ze(_);else throw x}else I=await ze(_);P.current=null,V("Shop Completed Purchase",{...va([s]),payment_type:"credits",no_crypto_step:k,transaction_hash:I??null}),h.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){_e(_)||le(_,{flow:"buy",step:"submit",gasless:k}),ie(d.identity,[u.credit.id]).catch(()=>{}),P.current=null,V(_e(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Re(_)}),h.invalidateQueries({queryKey:["usd-balance"]}),N(We(_,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function de(){if(!(!p||!d)){try{sessionStorage.setItem(Ke,JSON.stringify(s))}catch{}f&&ie(d.identity,[f.credit.id]).catch(()=>{}),P.current=null,l("loading");try{const u=await ot(p,{address:d.address,identity:d.identity});if(u.url){window.location.href=u.url;return}g("/credits")}catch(u){le(u,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ke)}catch{}N(t("buyModal.error.creditsCheckout")),l("error")}}}const q=m==="processing",E=m==="complete"?t("buyModal.titleComplete"):m==="nofunds"?t("buyModal.titleNoFunds"):t("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:s.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:q?void 0:n,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${m==="processing"||m==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:E}),!q&&e.jsx("button",{className:"buy-modal__x",onClick:n,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:m==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(M,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ne(Z)})]})]}),m==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(ht,{size:44})}),m==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(xe,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:n,children:t("buyModal.close")})})]}),m==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,A-Z)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(Ve,{item:s,priceCredits:A}),e.jsx("div",{className:"buy-modal__packs",children:j.map(u=>{const k=u.credits,_=u.id===p;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>w(u.id),children:[e.jsx(M,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ne(k)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",u.usd.toFixed(2),")"]})]},u.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(M,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ne(((X=j.find(u=>u.id===p))==null?void 0:X.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((ee=j.find(u=>u.id===p))==null?void 0:ee.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:n,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void de(),children:t("buyModal.buy")})]})]}),m==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ve,{item:s,priceCredits:A}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void U(),children:t("buyModal.buy")})})]}),m==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:ut,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:r?t("buyModal.completingPurchase"):t("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),m==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:t("getCredits.successTitle")})," ",t("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>g("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:n,children:[t("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function Ve({item:s,priceCredits:n}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:s.name,children:s.name||t("buyModal.itemFallback")}),s.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:t("search.byCreator",{name:s.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(M,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ne(n)})]})]})]})}const xt=c.lazy(async()=>{const[{EmoteControls:s},{Experimental_CssVarsProvider:n},{light:r}]=await Promise.all([ye(()=>import("./index-fvb_2ePt.js").then(d=>d.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ye(()=>import("./index-BlKccc7B.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ye(()=>import("./index-BgMPhDEY.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:d=>e.jsx(n,{theme:r,children:e.jsx(s,{...d})})}});function jt(s){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(xt,{...s})})}function vt({item:s}){const n=Y(f=>{var D;return(D=f.session)==null?void 0:D.address}),{data:r,isLoading:d}=ga(n),o=n&&r?n:"default",h=s.category==="emote",[g,j]=c.useState("item"),m=!h&&g==="item",l=m||!d,[a,N]=c.useState(!0);c.useEffect(()=>{N(!0)},[s.id,m]);const p=!!n&&!!r,w=p&&Na(s,wa(r)),L=ka(s)[0],b=p&&!w&&!h;return e.jsxs(e.Fragment,{children:[l?e.jsx(Ia,{id:"shop-item-preview",contractAddress:s.contractAddress,tokenId:s.tokenId??void 0,itemId:s.tokenId?void 0:s.itemId??void 0,profile:m?void 0:w?o:"default",bodyShape:m||w?void 0:L,type:h?void 0:m?Q.PreviewType.WEARABLE:Q.PreviewType.AVATAR,emote:h||m?void 0:Q.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:h?1.5:void 0,wheelStart:h?100:void 0,dev:fe.chainId===80002,onLoad:()=>N(!1)}):null,!l||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,b&&!m?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:Ca(L)})}):null,h?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(jt,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":t("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:g==="avatar"?"is-active":"","aria-pressed":g==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>j("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:g==="item"?"is-active":"","aria-pressed":g==="item","aria-label":t("itemPreview.item"),onClick:()=>j("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.item")})]})]})]})}function Ye(){return fe.shopServerUrl||(typeof window<"u"?window.location.origin:"")}async function gt(s,n,r){const d=new URLSearchParams({contractAddress:s,itemId:n}),o=`${Ye()}/notify-requests?${d.toString()}`,h=await He(o,{method:"GET",identity:r,metadata:{}});if(!h.ok)throw new Error(`getNotifyRequest ${h.status}`);return h.json()}async function Nt(s,n){const r=`${Ye()}/notify-requests`,d=await He(r,{method:"POST",identity:n,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok)throw new Error(`createNotifyRequest ${d.status}: ${await d.text()}`);await d.json().catch(()=>{})}function Qe(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())}function wt({item:s}){const n=Y(b=>b.session),r=Y(b=>b.signIn),[d,o]=c.useState(""),[h,g]=c.useState(!1),[j,m]=c.useState(!1),[l,a]=c.useState(null),N=!!n&&!!s.contractAddress&&!!s.itemId,{data:p}=R({queryKey:["notify-request",s.contractAddress,s.itemId,n==null?void 0:n.address],enabled:N,queryFn:()=>gt(s.contractAddress,s.itemId,n.identity)});c.useEffect(()=>{p!=null&&p.email&&o(b=>b||p.email)},[p==null?void 0:p.email]),c.useEffect(()=>{if(!n)return;let b=!1;return Aa().then(f=>{!b&&f&&o(D=>D||f)}),()=>{b=!0}},[n]);const w=j||!!(p!=null&&p.subscribed);async function L(b){if(b.preventDefault(),!(!n||!s.itemId||!Qe(d)||h)){g(!0),a(null);try{await Nt({contractAddress:s.contractAddress,itemId:s.itemId,chainId:s.chainId,email:d.trim()},n.identity),m(!0)}catch(f){le(f,{flow:"notify-me",contractAddress:s.contractAddress,itemId:s.itemId}),a(t("notifyMe.error"))}finally{g(!1)}}}return n?w?e.jsxs("div",{className:"notify notify__done","data-testid":"notify-subscribed",children:[e.jsx("span",{className:"notify__done-check","aria-hidden":!0,children:e.jsx(F,{name:"check",size:12})}),e.jsx("span",{className:"notify__done-text",children:t("notifyMe.subscribedBody")})]}):e.jsxs("form",{className:"notify",onSubmit:L,"data-testid":"notify",children:[e.jsx("label",{className:"notify__label",htmlFor:"notify-email",children:t("notifyMe.label")}),e.jsxs("div",{className:"notify__row",children:[e.jsx("input",{id:"notify-email",className:"notify__input",type:"email",inputMode:"email",autoComplete:"email",placeholder:t("notifyMe.placeholder"),value:d,onChange:b=>o(b.target.value),"data-testid":"notify-email"}),e.jsx("button",{type:"submit",className:"notify__btn",disabled:!Qe(d)||h,"data-testid":"notify-submit",children:h?t("notifyMe.working"):t("notifyMe.cta")})]}),e.jsx(xe,{message:l})]}):e.jsx("div",{className:"notify","data-testid":"notify",children:e.jsx("button",{type:"button",className:"notify__signin",onClick:r,"data-testid":"notify-signin",children:t("notifyMe.signInCta")})})}const kt=z.button`
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
gap: 8px;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 40px;
|
|
9
|
-
padding: 0 12px;
|
|
10
|
-
border: 2px solid #c640cd;
|
|
11
|
-
border-radius: 8px;
|
|
12
|
-
background: transparent;
|
|
13
|
-
color: ${O.colors.accent};
|
|
14
|
-
font-family: ${O.font.sans};
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
font-size: 15px;
|
|
17
|
-
line-height: 24px;
|
|
18
|
-
letter-spacing: 0.46px;
|
|
19
|
-
text-transform: uppercase;
|
|
20
|
-
cursor: not-allowed;
|
|
21
|
-
opacity: 0.55;
|
|
22
|
-
transition: opacity 0.15s ease;
|
|
23
|
-
|
|
24
|
-
&:hover,
|
|
25
|
-
&:focus-visible {
|
|
26
|
-
opacity: 0.75;
|
|
27
|
-
}
|
|
28
|
-
&:focus-visible {
|
|
29
|
-
outline: 2px solid ${O.colors.accent};
|
|
30
|
-
outline-offset: 2px;
|
|
31
|
-
}
|
|
32
|
-
`;function It({item:s}){return e.jsx(Je,{block:!0,content:t("makeOffer.comingSoon"),onShow:()=>V("Shop Make Offer Tooltip Shown",{contractAddress:s.contractAddress,itemId:s.itemId}),children:e.jsxs(kt,{type:"button","aria-disabled":!0,onClick:n=>n.preventDefault(),"data-testid":"make-offer",children:[e.jsx(F,{name:"offer",size:20,"aria-hidden":!0}),e.jsx("span",{children:t("makeOffer.cta")})]})})}const Ct=z(Sa)`
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
gap: 1px;
|
|
37
|
-
background: ${O.colors.lineStrong};
|
|
38
|
-
`;function At({contractAddress:s,name:n,items:r,className:d}){const o=pe();if(!s||!n)return null;const h=(r??[]).map(m=>m.thumbnail).filter(m=>!!m).slice(0,4),g=h.slice(0,2),j=h.slice(2,4);return e.jsxs(Ma,{as:"button","data-link":!0,className:d,"data-testid":"creator",onClick:m=>{m.stopPropagation(),o(`/collection/${s}`)},children:[h.length>0?e.jsxs(Ct,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${j.length===0?" collection-collage__row--full":""}`,children:g.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}),j.length>0?e.jsx("span",{className:"collection-collage__row",children:j.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}):null]}):null,e.jsx(Pa,{"data-testid":"creator-name",children:Ea(n)})]})}const St=z(be)`
|
|
39
|
-
margin-top: 6px;
|
|
40
|
-
`,re=z(be)`
|
|
41
|
-
&& {
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 48px;
|
|
44
|
-
font-size: 15px;
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
letter-spacing: 0.46px;
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
gap: 8px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
${O.media.down("lg")} {
|
|
54
|
-
.item-detail__ctas--dual && {
|
|
55
|
-
flex: 1 1 auto;
|
|
56
|
-
width: auto;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`,Mt=z("div")`
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
gap: 10px;
|
|
63
|
-
width: 100%;
|
|
64
|
-
`,Pt=z(be)`
|
|
65
|
-
&& {
|
|
66
|
-
width: 100%;
|
|
67
|
-
height: 44px;
|
|
68
|
-
}
|
|
69
|
-
`,Et=z("p")`
|
|
70
|
-
margin: 4px 0 0;
|
|
71
|
-
font-size: 13px;
|
|
72
|
-
color: ${O.colors.muted};
|
|
73
|
-
|
|
74
|
-
a {
|
|
75
|
-
color: ${O.colors.accent};
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
}
|
|
78
|
-
`;function Ft(s){return Object.values(Q.Rarity).includes(s)}function Lt(s){return s==="male"?t("itemDetail.genderMale"):s==="female"?t("itemDetail.genderFemale"):s==="unisex"?t("itemDetail.genderUnisex"):null}function Ue(s){return s.wearableCategory?s.wearableCategory.replace(/_/g," "):s.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function ls(){var Te;const{contractAddress:s,tokenId:n}=ha(),{state:r}=_a(),d=pe(),o=!!(r!=null&&r.market),h=(r==null?void 0:r.marketPriceCredits)??null,g=qe(i=>i.add),j=qe(i=>i.items),m=$e(i=>i.toggle),{session:l}=Y(),[a,N]=c.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${s}-${n}`,name:"",creator:"",contractAddress:s??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:fe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:n??void 0,tradeId:r==null?void 0:r.tradeId}),[p,w]=c.useState(!1),[L,b]=c.useState(!!(r!=null&&r.resumeBuy));c.useEffect(()=>{r!=null&&r.resumeBuy&&w(!0)},[r==null?void 0:r.resumeBuy]);const{data:f=[],isFetched:D}=R({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>Ua(a.contractAddress,{first:20}).then(i=>i.items)}),P=a.available==null&&!a.tokenId,{data:A,isLoading:Z}=R({queryKey:["shop-item",a.contractAddress,n],enabled:!o&&!!a.contractAddress&&!!n&&(!(r!=null&&r.item)||P),queryFn:()=>Ga(a.contractAddress,n)});c.useEffect(()=>{A&&N(i=>i.tradeId?i.available!=null&&i.wearableCategory?i:{...i,available:i.available??A.available,wearableCategory:i.wearableCategory??A.wearableCategory}:{...A})},[A]);const[U,de]=c.useState(!1),{data:q=""}=R({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Ha(a.contractAddress,a.itemId)}),{data:E}=R({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Ja(a.contractAddress)});c.useEffect(()=>{if(a.name||A||f.length===0)return;const i=n&&f.find(v=>v.tokenId===n||v.itemId===n)||f.find(v=>v.contractAddress===a.contractAddress);i&&N(v=>({...i,tradeId:v.tradeId??i.tradeId}))},[f,A]);const X=c.useMemo(()=>{const i=new Set,v=[];for(const S of f){if(S.id===a.id||a.itemId&&S.itemId===a.itemId||a.tokenId&&S.tokenId===a.tokenId)continue;const Be=`${S.contractAddress}-${S.itemId??S.tokenId??S.id}`;i.has(Be)||(i.add(Be),v.push(S))}return v},[f,a.id,a.itemId,a.tokenId]),{data:ee,isLoading:u}=R({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const i=await Ya(a.contractAddress,a.itemId);return(i==null?void 0:i.id)??null}return null}}),k=a.tradeId??ee??void 0,_=!!k,{data:I}=_t(o),x=c.useMemo(()=>{if(!o||!(r!=null&&r.item))return null;const i=r.item;return i.manaWei?{tradeId:i.tradeId??i.id,listingType:"primary",contractAddress:i.contractAddress,itemId:i.itemId??"",name:i.name,thumbnail:i.thumbnail,rarity:i.rarity,category:i.category,wearableCategory:i.wearableCategory??null,creator:i.creator,manaWei:i.manaWei,available:1,network:i.network,chainId:i.chainId,createdAt:0}:null},[o,r==null?void 0:r.item]),T=o&&h!=null&&!!I&&!!x,K=Fa({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),C=c.useMemo(()=>({...a,tradeId:k,id:k??a.id}),[a,k]),G=j.some(i=>i.id===C.id),$=!C.tokenId,ae=((Te=j.find(i=>i.id===C.id))==null?void 0:Te.quantity)??0,W=$&&typeof a.available=="number"&&ae>=a.available,B=$e(i=>!!i.items[a.id]),je=c.useRef(null);c.useEffect(()=>{!a.name||u||je.current===a.id||(je.current=a.id,V("Shop Viewed Item",{...La(a),for_sale:_}),Da(a))},[a.id,a.name,u,_]);const te=`${s}/${n}`,ve=c.useRef(te);c.useEffect(()=>{ve.current!==te&&(ve.current=te,r!=null&&r.item&&N({...r.item,tradeId:r.tradeId??r.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[te]);function Ze(){!_||ce||u||!$&&G||W||g(C,"item_detail")}const oe=Ft(a.rarity)?a.rarity:Q.Rarity.COMMON,ge=Lt(a.gender),Ne=Ta(a),we=Ba(a.gender),Xe=_&&K,ea=t("itemDetail.moreFromCollection"),ce=Ra(a,l==null?void 0:l.address),se=Ge(),[aa,ke]=c.useState(!1),[ta,Ie]=c.useState(!1),[H,Ce]=c.useState(!1),[sa,Ae]=c.useState(null),{data:y,isLoading:ia}=R({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!o&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?Za(l.address,a.contractAddress,a.tokenId):null});c.useEffect(()=>{y&&N(i=>i.name?i.issuedId?i:{...i,issuedId:y.issuedId}:{id:y.id,name:y.name,creator:"",contractAddress:y.contractAddress,itemId:y.itemId,category:y.category,rarity:y.rarity??"common",network:y.network,chainId:y.chainId,thumbnail:y.image,priceCredits:y.listingPrice??0,gender:null,isSmart:!1,tokenId:y.tokenId,issuedId:y.issuedId,tradeId:y.tradeId})},[y]);const{data:me}=R({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:ce&&!!l&&!!a.itemId,queryFn:async()=>l?(await tt(l.address,l.identity)).find(v=>v.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&v.blockchainItemId===a.itemId)??null:null}),J=!!y,ue=!o&&(ce||J),ra=J?!!(y!=null&&y.isOnSale):_,he=J?y==null?void 0:y.tradeId:k,Se=J?!!y:!!me;async function Me(){await Promise.all([se.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),se.invalidateQueries({queryKey:["detail-trade"]}),se.invalidateQueries({queryKey:["shop-item"]}),se.invalidateQueries({queryKey:["collection-sale-state"]})])}async function Pe(i={}){if(!l||!he)return!1;Ae(null),Ce(!0);try{const v=await Va(he);return await Xa({trade:v,signer:l.signer}),i.silent||Qa.success(t("myAssets.removedFromSale",{name:a.name})),await Me(),!0}catch(v){const S=mt(v);return S||le(v,{flow:"remove-listing",tradeId:he}),Ae(S?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{Ce(!1)}}function Ee(){J?ke(!0):Ie(!0)}async function na(){await Pe({silent:!0})&&Ee()}function Fe(){ke(!1),Ie(!1),Me()}const Le=_?u?t("itemDetail.checking"):W?t("itemDetail.maxInCart"):!$&&G?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),la=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!o,da=!o&&!a.tokenId&&a.available===0,oa=!ue&&_&&!o,ca=o||!ue,ma=Z||!!a.contractAddress&&!D||!a.name&&ia,De=!a.name&&!ma,ua=/^https?:\/\//i.test(a.thumbnail);return qa(De?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:q||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ue(a),creator:pt(a.creator)}),image:ua?a.thumbnail:void 0,type:"product"}:{}),De?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(F,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:t("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:t("itemDetail.notAvailableBody")}),e.jsx(St,{variant:"purple",onClick:()=>d("/assets"),children:t("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":t("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>d("/assets"),children:t("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||t("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx(vt,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:za(oe),color:Oa(oe)},title:$a(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[Ne?e.jsx(F,{name:Ne,size:18,color:"var(--text-2)"}):null,Ue(a)]}),ge?e.jsxs("span",{className:"chip item-detail__chip",children:[we?e.jsx(F,{name:we,size:18,color:"var(--text-2)"}):null,ge]}):null,a.issuedId?e.jsxs("span",{className:"chip item-detail__chip","data-testid":"detail-issued",children:["#",a.issuedId]}):null]}),q?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${U?" is-expanded":""}`,children:q}),q.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>de(i=>!i),children:U?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||E!=null&&E.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.creator")}),e.jsx(Ka,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,E!=null&&E.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.collection")}),e.jsx(At,{contractAddress:a.contractAddress,name:E.name,items:f,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[o||_?e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}):null,o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:h==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:h})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):_?Xe?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(M,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),Oe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:Oe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Wa,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsxs("div",{className:"item-detail__price item-detail__price--none",children:[e.jsx("span",{children:t("itemDetail.notForSale")}),e.jsx(Je,{content:t("itemDetail.notForSaleHint"),children:e.jsx("span",{className:"item-detail__price-info",tabIndex:0,role:"img","aria-label":t("itemDetail.notForSaleHint"),children:e.jsx(F,{name:"info",size:14})})})]})]}),la?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",Q.Rarity.getMaxSupply(oe).toLocaleString()]})]}):da?e.jsx("div",{className:"item-detail__stock-col",children:e.jsx("div",{className:"item-detail__stock-value item-detail__stock-value--out","data-testid":"out-of-stock",children:t("itemDetail.outOfStock")})}):null]})}),e.jsx("div",{className:`item-detail__ctas${ca?" item-detail__ctas--buttons":""}${oa?" item-detail__ctas--dual":""}`,children:o?e.jsxs(re,{variant:"purple",onClick:()=>w(!0),disabled:!T,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),h!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),h]}):null]}):ue?e.jsxs(Mt,{"data-testid":"manage-actions",children:[e.jsx(xe,{message:sa}),ra?e.jsxs(e.Fragment,{children:[e.jsx(re,{variant:"purple",onClick:()=>void na(),disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:H?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(Pt,{variant:"ghost",onClick:()=>void Pe(),disabled:H,children:H?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(re,{variant:"purple",onClick:Ee,disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(Et,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(ya,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):_?e.jsxs(e.Fragment,{children:[e.jsxs(re,{variant:"purple",onClick:()=>w(!0),disabled:u,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}),e.jsxs("button",{className:"item-detail__addcart",onClick:Ze,disabled:u||($?W:G),"aria-label":Le,children:[e.jsx(F,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:Le})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(wt,{item:a}),e.jsx(It,{item:a})]})})]}):e.jsx(Dt,{})})]}),e.jsx(ft,{title:ea,items:X,onViewAll:a.contractAddress?()=>d(`/collection/${a.contractAddress}`):void 0}),p&&o&&x&&I?e.jsx(yt,{listing:x,rate:I,onClose:()=>w(!1),onSold:()=>w(!1)}):p&&!o?e.jsx(bt,{item:C,resume:L,onClose:()=>{w(!1),b(!1)}}):null,aa&&y&&l?e.jsx(et,{asset:y,session:l,onClose:Fe}):null,ta&&me&&l?e.jsx(at,{item:me,session:l,onClose:Fe}):null]})}function Dt(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{ls as ItemDetail,ls as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{m as O,c as S,d as V,n as Y,o as H,t,q as h,h as x,r as M,v as $,C as j,f as D,i as J,w as X,x as y,y as F,z as R,s as Z,B as ee}from"./index-CJ4mXolB.js";import{r as re,a as b}from"./mana-rate-DtQ8WpoI.js";import{a as ae,r as m,j as r}from"./react-BrLDncxD.js";import{b as A}from"./buy-BRLq1STf.js";import{g as te,b as se,w as ie,S as ce,G as ne}from"./buy-gasless-hR2bH0iR.js";import{i as de}from"./errors-DKFg2ql0.js";import{E as oe}from"./ErrorNotice-BDH9xoG4.js";function pe(e=!0){return O({queryKey:["mana-rate",S.chainId],queryFn:()=>re(S.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}const B=Z(ee)`
|
|
2
|
-
flex: 1;
|
|
3
|
-
`;function U(e){if(de(e))return t("errors.rejected");const n=(e.message??"").toLowerCase();return n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:j.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("errors.cantBuyOwn"):t("marketCheckout.error.generic")}function le(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function Ce({listing:e,rate:n,onClose:q,onSold:W}){const{session:i}=V(),{data:d,isError:T}=Y(i),w=H(),g=ae(),[N,k]=m.useState("confirm"),[p,I]=m.useState(t("marketCheckout.lockingPrice")),[z,f]=m.useState(null),[a,G]=m.useState(null),o=m.useRef(null),L=Math.ceil(b(e.manaWei,n)/10);m.useEffect(()=>{let l=!1;if(!i){k("error"),f(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await D(e.tradeId);if(!s)throw new Error("not found");if(J(s,i.address))throw new Error("You can't buy your own listing.");const u=b(e.manaWei,n);if(!Number.isFinite(u)||u<=0)throw new Error("price unavailable");const{credit:v,maxCreditedValue:K,usdCents:P}=await X(i.identity,u,e.tradeId);if(l){h(i.identity,[v.id]).catch(()=>{});return}o.current=v.id,G({trade:s,credit:v,maxCreditedValue:K,usdCents:P,credits:Math.ceil(P/10)}),I("")}catch(s){if(l)return;console.error("[market] authorize failed",s),y(R(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:F(s),value_usd:Math.round(b(e.manaWei,n))/100}),k("error"),f(U(s))}})(),()=>{l=!0,o.current&&i&&(h(i.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const C=!!a&&d!=null&&d.credits<a.credits;async function Q(){if(!i||!a)return;if(C){y("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,g("/credits");return}k("working"),f(null);let l=!1;try{I(t("marketCheckout.confirming"));const c={trade:a.trade,buyer:i.address,signer:i.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(te())try{s=await se(c),await ie(s),l=!0}catch(u){if(u instanceof ce)l=!0;else if(u instanceof ne)s=await A(c);else throw u}else s=await A(c);o.current=null,y("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),w.invalidateQueries({queryKey:["usd-balance"]}),g("/success",{state:{items:[le(e)],txHash:s}})}catch(c){console.error("[market] buy now failed",c),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,y(R(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:F(c),value_usd:a.usdCents/100}),w.invalidateQueries({queryKey:["usd-balance"]}),f(U(c)),k("error");const s=(c.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&W()}}function E(){i&&a&&h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,q()}const _=N==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:_?void 0:E,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),M(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),M(L)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:p||t("marketCheckout.lockingPrice")})]})}),i?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",$(d,T)]}):null,C?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:j.name})}):null,p&&N==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:p}):null,r.jsx(oe,{message:z,className:"mkt-modal__note"}),r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx(B,{variant:"ghost",onClick:E,disabled:_,children:t("buyModal.cancel")}),r.jsx(B,{variant:"purple",onClick:()=>void Q(),disabled:_||!a,children:_?t("marketCheckout.buying"):C?t("nav.getCredits",{currency:j.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{Ce as M,pe as u};
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import{L as ve,b as Ve,r as c,j as t}from"./react-BrLDncxD.js";import{s as a,F as s,I as j,u as Ze,t as r,d as Xe,o as et,G as pe,m as N,B as tt,A as q,x as ue,H as st,f as ot,J as nt,E as rt,c as at,K as it}from"./index-CJ4mXolB.js";import{f as lt}from"./import-CyzZeEcP.js";import{S as ct,P as dt,f as mt}from"./PrimaryListModal-CnlMOkG5.js";import{c as pt}from"./buy-BRLq1STf.js";import{R as G,C as ut,a as ft,F as xt,S as D,b as fe}from"./categories-BPU8ySTe.js";import{L as ht}from"./LoadMore-BLy9p9ul.js";import{D as xe,F as he,R as yt,a as gt,b as bt,c as St,d as wt,S as jt,e as $t,f as Ct,g as It,h as vt,i as kt,j as At,k as Et,C as Tt,l as Ft,m as Rt,n as _t,M as Lt}from"./Assets.styles-eeqx94WS.js";import{u as Ot}from"./useInfiniteGrid-BbeLTVdN.js";import{E as Q}from"./ErrorNotice-BDH9xoG4.js";import{n as ke}from"./emotion-CSxEP8yM.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./mana-rate-DtQ8WpoI.js";import"./index-HN6Rk25C.js";import"./trade-encoding-0IFZ39Tk.js";import"./authorizations-sU14ILrd.js";import"./errors-DKFg2ql0.js";import"./Tooltip-DJ7HtAmB.js";a.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 4px;
|
|
5
|
-
width: 100%;
|
|
6
|
-
`;a.h2`
|
|
7
|
-
margin: 0;
|
|
8
|
-
padding: 4px 4px 2px;
|
|
9
|
-
font-family: ${s.font.sans};
|
|
10
|
-
font-weight: 700;
|
|
11
|
-
font-size: 12px;
|
|
12
|
-
letter-spacing: 0.46px;
|
|
13
|
-
text-transform: uppercase;
|
|
14
|
-
color: ${s.colors.muted};
|
|
15
|
-
`;a("button",ke("selected"))`
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
gap: 10px;
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 40px;
|
|
21
|
-
padding: 4px 12px;
|
|
22
|
-
border: 0;
|
|
23
|
-
border-radius: 8px;
|
|
24
|
-
background: ${({selected:o})=>o?s.colors.media:"transparent"};
|
|
25
|
-
color: ${s.colors.text};
|
|
26
|
-
font-family: ${s.font.sans};
|
|
27
|
-
font-weight: ${({selected:o})=>o?600:400};
|
|
28
|
-
font-size: 14px;
|
|
29
|
-
text-align: left;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
|
|
32
|
-
@media (hover: hover) {
|
|
33
|
-
&:hover {
|
|
34
|
-
background: ${s.colors.media};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
&:focus-visible {
|
|
38
|
-
outline: 2px solid ${s.colors.accent};
|
|
39
|
-
outline-offset: 2px;
|
|
40
|
-
}
|
|
41
|
-
`;a(j)`
|
|
42
|
-
width: 18px;
|
|
43
|
-
height: 18px;
|
|
44
|
-
flex: none;
|
|
45
|
-
color: ${s.colors.muted};
|
|
46
|
-
`;a.div`
|
|
47
|
-
display: flex;
|
|
48
|
-
flex-direction: column;
|
|
49
|
-
gap: 8px;
|
|
50
|
-
width: 100%;
|
|
51
|
-
`;a.span`
|
|
52
|
-
font-family: ${s.font.sans};
|
|
53
|
-
font-weight: 600;
|
|
54
|
-
font-size: 14px;
|
|
55
|
-
line-height: 1.43;
|
|
56
|
-
color: ${s.colors.text};
|
|
57
|
-
padding: 0 4px;
|
|
58
|
-
`;a.div`
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-wrap: wrap;
|
|
61
|
-
gap: 8px;
|
|
62
|
-
padding: 4px;
|
|
63
|
-
`;a("button",ke("selected"))`
|
|
64
|
-
display: inline-flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
gap: 4px;
|
|
67
|
-
padding: 4px 10px;
|
|
68
|
-
border-radius: 6px;
|
|
69
|
-
background: ${({selected:o})=>o?s.colors.text:s.colors.softWhite};
|
|
70
|
-
border: ${({selected:o})=>o?`1px solid ${s.colors.text}`:`0.5px solid ${s.colors.gray4}`};
|
|
71
|
-
color: ${({selected:o})=>o?s.colors.white:s.colors.gray0};
|
|
72
|
-
font-family: ${s.font.sans};
|
|
73
|
-
font-weight: ${({selected:o})=>o?600:400};
|
|
74
|
-
font-size: 12px;
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
|
|
77
|
-
&:hover {
|
|
78
|
-
border-color: ${s.colors.text};
|
|
79
|
-
}
|
|
80
|
-
&:focus-visible {
|
|
81
|
-
outline: 2px solid ${s.colors.accent};
|
|
82
|
-
outline-offset: 2px;
|
|
83
|
-
}
|
|
84
|
-
`;const Pt=a.div`
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: 8px;
|
|
88
|
-
height: 44px;
|
|
89
|
-
padding: 0 12px;
|
|
90
|
-
margin-bottom: 16px;
|
|
91
|
-
border: 1px solid ${s.colors.lineStrong};
|
|
92
|
-
border-radius: ${s.radius.btn};
|
|
93
|
-
background: ${s.colors.white};
|
|
94
|
-
|
|
95
|
-
&:focus-within {
|
|
96
|
-
border-color: ${s.colors.accent};
|
|
97
|
-
}
|
|
98
|
-
`,zt=a(j)`
|
|
99
|
-
width: 18px;
|
|
100
|
-
height: 18px;
|
|
101
|
-
flex: none;
|
|
102
|
-
color: ${s.colors.muted};
|
|
103
|
-
`,Bt=a.input`
|
|
104
|
-
flex: 1;
|
|
105
|
-
min-width: 0;
|
|
106
|
-
border: 0;
|
|
107
|
-
background: none;
|
|
108
|
-
padding: 0;
|
|
109
|
-
font-family: ${s.font.sans};
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
color: ${s.colors.text};
|
|
112
|
-
|
|
113
|
-
&::placeholder {
|
|
114
|
-
color: ${s.colors.muted2};
|
|
115
|
-
}
|
|
116
|
-
&:focus {
|
|
117
|
-
outline: 0;
|
|
118
|
-
}
|
|
119
|
-
`,Kt=a.button`
|
|
120
|
-
display: grid;
|
|
121
|
-
place-items: center;
|
|
122
|
-
width: 24px;
|
|
123
|
-
height: 24px;
|
|
124
|
-
border: 0;
|
|
125
|
-
border-radius: 50%;
|
|
126
|
-
background: ${s.colors.chip};
|
|
127
|
-
color: ${s.colors.text};
|
|
128
|
-
cursor: pointer;
|
|
129
|
-
flex: none;
|
|
130
|
-
|
|
131
|
-
&:focus-visible {
|
|
132
|
-
outline: 2px solid ${s.colors.accent};
|
|
133
|
-
outline-offset: 2px;
|
|
134
|
-
}
|
|
135
|
-
`,Mt=a(j)`
|
|
136
|
-
width: 12px;
|
|
137
|
-
height: 12px;
|
|
138
|
-
`,ye=a.div`
|
|
139
|
-
display: grid;
|
|
140
|
-
grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
|
|
141
|
-
gap: 20px;
|
|
142
|
-
|
|
143
|
-
${s.media.down("sm")} {
|
|
144
|
-
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
145
|
-
gap: 12px;
|
|
146
|
-
}
|
|
147
|
-
`;a.p`
|
|
148
|
-
margin: 24px 0;
|
|
149
|
-
font-family: ${s.font.sans};
|
|
150
|
-
font-size: 14px;
|
|
151
|
-
color: ${s.colors.muted};
|
|
152
|
-
`;const ge=a.div`
|
|
153
|
-
display: flex;
|
|
154
|
-
flex-direction: column;
|
|
155
|
-
align-items: center;
|
|
156
|
-
justify-content: center;
|
|
157
|
-
gap: 6px;
|
|
158
|
-
padding: 72px 24px;
|
|
159
|
-
text-align: center;
|
|
160
|
-
`,be=a.div`
|
|
161
|
-
display: flex;
|
|
162
|
-
align-items: center;
|
|
163
|
-
justify-content: center;
|
|
164
|
-
width: 72px;
|
|
165
|
-
height: 72px;
|
|
166
|
-
margin-bottom: 10px;
|
|
167
|
-
border-radius: 50%;
|
|
168
|
-
background: ${s.colors.navViolet};
|
|
169
|
-
color: ${s.colors.accent};
|
|
170
|
-
`,Se=a.p`
|
|
171
|
-
margin: 0;
|
|
172
|
-
font-family: ${s.font.sans};
|
|
173
|
-
font-size: 18px;
|
|
174
|
-
font-weight: 600;
|
|
175
|
-
color: ${s.colors.text};
|
|
176
|
-
`,we=a.p`
|
|
177
|
-
margin: 0;
|
|
178
|
-
max-width: 360px;
|
|
179
|
-
font-family: ${s.font.sans};
|
|
180
|
-
font-size: 14px;
|
|
181
|
-
line-height: 1.5;
|
|
182
|
-
color: ${s.colors.muted};
|
|
183
|
-
`,Nt=a(ve)`
|
|
184
|
-
margin-top: 12px;
|
|
185
|
-
display: inline-flex;
|
|
186
|
-
align-items: center;
|
|
187
|
-
height: 40px;
|
|
188
|
-
padding: 0 20px;
|
|
189
|
-
border-radius: 8px;
|
|
190
|
-
background: ${s.colors.accent};
|
|
191
|
-
color: #fff;
|
|
192
|
-
font-family: ${s.font.sans};
|
|
193
|
-
font-size: 14px;
|
|
194
|
-
font-weight: 600;
|
|
195
|
-
text-decoration: none;
|
|
196
|
-
cursor: pointer;
|
|
197
|
-
|
|
198
|
-
&:hover {
|
|
199
|
-
background: ${s.colors.accentHover};
|
|
200
|
-
}
|
|
201
|
-
`,qt=a.section`
|
|
202
|
-
max-width: 520px;
|
|
203
|
-
margin: 48px auto;
|
|
204
|
-
text-align: center;
|
|
205
|
-
display: flex;
|
|
206
|
-
flex-direction: column;
|
|
207
|
-
gap: 16px;
|
|
208
|
-
align-items: center;
|
|
209
|
-
`,Gt=a.h1`
|
|
210
|
-
margin: 0;
|
|
211
|
-
font-family: ${s.font.sans};
|
|
212
|
-
font-weight: 700;
|
|
213
|
-
font-size: 24px;
|
|
214
|
-
color: ${s.colors.text};
|
|
215
|
-
`,Dt=a.p`
|
|
216
|
-
margin: 0;
|
|
217
|
-
font-family: ${s.font.sans};
|
|
218
|
-
font-size: 15px;
|
|
219
|
-
color: ${s.colors.muted};
|
|
220
|
-
`,Qt=a(ve)`
|
|
221
|
-
display: flex;
|
|
222
|
-
align-items: center;
|
|
223
|
-
gap: 12px;
|
|
224
|
-
margin-bottom: 16px;
|
|
225
|
-
padding: 12px 16px;
|
|
226
|
-
border-radius: ${s.radius.btn};
|
|
227
|
-
background: ${s.colors.rarityBg};
|
|
228
|
-
color: ${s.colors.text};
|
|
229
|
-
text-decoration: none;
|
|
230
|
-
|
|
231
|
-
&:hover {
|
|
232
|
-
filter: brightness(0.98);
|
|
233
|
-
}
|
|
234
|
-
&:focus-visible {
|
|
235
|
-
outline: 2px solid ${s.colors.accent};
|
|
236
|
-
outline-offset: 2px;
|
|
237
|
-
}
|
|
238
|
-
`,Ht=a.span`
|
|
239
|
-
display: flex;
|
|
240
|
-
flex-direction: column;
|
|
241
|
-
flex: 1;
|
|
242
|
-
min-width: 0;
|
|
243
|
-
font-family: ${s.font.sans};
|
|
244
|
-
`,Ut=a.strong`
|
|
245
|
-
font-weight: 600;
|
|
246
|
-
font-size: 14px;
|
|
247
|
-
color: ${s.colors.text};
|
|
248
|
-
`,Wt=a.span`
|
|
249
|
-
font-size: 12px;
|
|
250
|
-
color: ${s.colors.muted};
|
|
251
|
-
`,Yt=a.span`
|
|
252
|
-
flex: none;
|
|
253
|
-
font-weight: 600;
|
|
254
|
-
font-size: 13px;
|
|
255
|
-
color: ${s.colors.accent};
|
|
256
|
-
text-transform: uppercase;
|
|
257
|
-
letter-spacing: 0.046em;
|
|
258
|
-
`,Jt=48,je=[{key:"wearables",labelKey:"myAssets.sectionWearables",category:"wearable"},{key:"emotes",labelKey:"myAssets.sectionEmotes",category:"emote"},{key:"names",labelKey:"myAssets.sectionNames",category:"ens"},{key:"creations",labelKey:"myAssets.sectionCreations"}],H=[{key:"newest",label:"filterBar.sortNewest",server:"newest"},{key:"name",label:"filterBar.sortName",server:"name"},{key:"cheapest",label:"filterBar.sortCheapest",server:"cheapest"}];function $e(o){return o==="wearables"||o==="emotes"}const Ce={wearables:"wearable",emotes:"emote",names:"names",creations:""},Vt={wearable:"wearables",emote:"emotes",names:"names"};function Ie(o){return{id:o.id,name:o.name,creator:"",contractAddress:o.contractAddress,itemId:o.itemId,category:o.category,rarity:o.rarity??"common",network:o.network,chainId:o.chainId,thumbnail:o.image,priceCredits:o.listingPrice??0,gender:null,isSmart:!1,tokenId:o.tokenId,issuedId:o.issuedId}}function Zt(o,T=0){return{id:`${o.contractAddress}-${o.blockchainItemId}`,name:o.name,creator:"",contractAddress:o.contractAddress,itemId:o.blockchainItemId,category:o.category,rarity:o.rarity,network:"MATIC",chainId:at.chainId,thumbnail:o.thumbnail,priceCredits:T,gender:null,isSmart:!1}}function Ss(){var ce,de;Ze({title:r("nav.myAssets"),noindex:!0});const{session:o,error:T,signIn:Ae,restore:U}=Xe(),F=et(),[Ee,Te]=Ve(),W=Ee.get("section"),l=je.some(e=>e.key===W)?W:"wearables",[m,R]=c.useState("all"),[h,_]=c.useState([]),[p,$]=c.useState(null),[S,Fe]=c.useState("newest"),[C,Y]=c.useState(""),[y,Re]=c.useState(""),[I,g]=c.useState(!1),[_e,Le]=c.useState(!0),[Oe,Pe]=c.useState(!1),[J,V]=c.useState(null),[Z,X]=c.useState(null),[ee,te]=c.useState(null),[ze,se]=c.useState(null);c.useEffect(()=>{U()},[U]),c.useEffect(()=>{const e=setTimeout(()=>Re(C.trim()),300);return()=>clearTimeout(e)},[C]),c.useEffect(()=>{if(!I)return;const e=i=>{i.key==="Escape"&&g(!1)};document.addEventListener("keydown",e);const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=n}},[I]);const u=o==null?void 0:o.address,Be=je.find(e=>e.key===l),v=$e(l),oe=(H.find(e=>e.key===S)??H[0]).server,Ke=m==="on_sale"?r("filter.onSale"):m==="not_for_sale"?r("filter.notForSale"):"",Me=G.filter(e=>h.includes(e)).map(pe).join(", ");function ne(e){Te(n=>{const i=new URLSearchParams(n);return i.set("section",e),i},{replace:!0}),$(null),$e(e)||_([]),g(!1)}function re(e){_(n=>n.includes(e)?n.filter(i=>i!==e):[...n,e])}function Ne(e){const n=Vt[e];n&&ne(n)}const{items:L,total:qe,isLoading:O,isPlaceholderData:P,error:Ge,hasNextPage:De,isFetchingNextPage:ae,fetchNextPage:Qe}=Ot(["my-assets",u,l,m,h,p,y,oe],e=>st(u,{category:Be.category,first:Jt,skip:e,search:y||void 0,rarities:v&&h.length?h:void 0,wearableCategories:l==="wearables"&&p?fe[p]:void 0,emoteCategories:l==="emotes"&&p?fe[p]:void 0,onlyOnSale:m==="on_sale"||void 0,sortBy:oe}).then(n=>({items:n.assets,total:n.total})),{enabled:!!u&&l!=="creations"}),z=c.useMemo(()=>m==="not_for_sale"?L.filter(e=>!e.isOnSale):L,[L,m]),{data:k,isLoading:B,isError:He}=N({queryKey:["publishable-items",u],queryFn:()=>mt(u,o.identity),enabled:!!o&&l==="creations",retry:!1}),K=c.useMemo(()=>[...new Set((k??[]).map(e=>e.contractAddress))],[k]),{data:A}=N({queryKey:["collection-sale-state",u,K],enabled:K.length>0,queryFn:async()=>{const e=await Promise.all(K.map(async i=>[i,await it(i)])),n={};for(const[i,d]of e)for(const[f,x]of Object.entries(d))n[`${i}-${f}`]=x;return n}}),w=e=>A==null?void 0:A[`${e.contractAddress}-${e.blockchainItemId}`],M=c.useMemo(()=>{let e=k??[];if(m==="on_sale"?e=e.filter(i=>{var d;return(d=w(i))==null?void 0:d.isOnSale}):m==="not_for_sale"&&(e=e.filter(i=>{var d;return!((d=w(i))!=null&&d.isOnSale)})),y){const i=y.toLowerCase();e=e.filter(d=>d.name.toLowerCase().includes(i))}const n=[...e];return S==="name"?n.sort((i,d)=>i.name.localeCompare(d.name)):S==="cheapest"&&n.sort((i,d)=>{var f,x;return(((f=w(i))==null?void 0:f.priceCredits)??0)-(((x=w(d))==null?void 0:x.priceCredits)??0)}),n},[k,A,m,y,S]),{data:b}=N({queryKey:["importable",u],queryFn:()=>lt(u),enabled:!!u}),ie=((b==null?void 0:b.creations.length)??0)+((b==null?void 0:b.owned.length)??0);async function le(e,n,i){if(o){se(null),te(i);try{const d=await ot(e);await pt({trade:d,signer:o.signer}),nt.success(r("myAssets.removedFromSale",{name:n})),await F.invalidateQueries({queryKey:["my-assets",o.address]}),await F.invalidateQueries({queryKey:["collection-sale-state"]}),await F.invalidateQueries({queryKey:["publishable-items"]})}catch(d){const f=d,x=(f.message??"").toLowerCase(),me=f.code===4001||x.includes("reject")||x.includes("denied");me||rt(d,{flow:"remove-listing",tradeId:e}),se(me?r("getCredits.errorCanceled"):r("myAssets.removeListingError"))}finally{te(null)}}}if(!o)return t.jsxs(qt,{children:[t.jsx(Gt,{children:r("nav.myAssets")}),t.jsx(Dt,{children:r("myAssets.signInPrompt")}),t.jsx(tt,{variant:"purple",onClick:()=>Ae(),children:r("storeSettings.signIn")}),t.jsx(Q,{message:T})]});const Ue=l==="creations"?B:O||P,We=l==="creations"?M.length:m==="not_for_sale"?z.length:qe,E=[];if(m!=="all"&&E.push({key:"status",label:m==="on_sale"?r("filter.onSale"):r("filter.notForSale"),onRemove:()=>R("all")}),v)for(const e of G)h.includes(e)&&E.push({key:`rarity-${e}`,label:pe(e),onRemove:()=>re(e)});if(v&&p){const e=(de=(ce=ut.find(n=>n.key===Ce[l]))==null?void 0:ce.subs)==null?void 0:de.find(n=>n.key===p);E.push({key:"sub",label:e?r(e.labelKey):p,onRemove:()=>$(null)})}function Ye(){R("all"),_([]),$(null)}const Je=t.jsxs(t.Fragment,{children:[t.jsx(ft,{title:r("myAssets.assetsHeading"),category:Ce[l],subCategory:p,onCategory:Ne,onSub:$,onCollections:()=>ne("creations"),collections:l==="creations",extraLabelKey:"myAssets.sectionCreations",hideAll:!0}),v?t.jsxs(t.Fragment,{children:[t.jsx(xe,{}),t.jsx(he,{title:r("assets.rarity"),open:Oe,onToggle:()=>Pe(e=>!e),summary:Me,headerTestId:"sidebar-section-toggle",children:t.jsx(yt,{"data-testid":"rarity-filter",children:G.map(e=>{const n=h.includes(e);return t.jsxs(gt,{type:"button",selected:n,"aria-pressed":n,onClick:()=>re(e),"data-testid":"rarity-filter-check",children:[t.jsx(bt,{color:s.rarities[e],children:n?t.jsx(St,{name:"check","aria-hidden":!0}):null}),t.jsx(wt,{selected:n,children:e})]},e)})})})]}):null,t.jsx(xe,{}),t.jsx(he,{title:r("filter.status"),open:_e,onToggle:()=>Le(e=>!e),summary:Ke,children:[["all",r("filter.statusAll")],["on_sale",r("filter.onSale")],["not_for_sale",r("filter.notForSale")]].map(([e,n])=>t.jsxs(jt,{children:[t.jsx($t,{type:"radio",name:"myassets-status",checked:m===e,onChange:()=>R(e)}),t.jsx(Ct,{children:n})]},e))})]});return t.jsxs(It,{"data-testid":"my-assets",children:[I?t.jsx(vt,{onClick:()=>g(!1),"aria-hidden":!0}):null,t.jsxs(kt,{className:I?"is-open":"","data-testid":"my-assets-sidebar",children:[t.jsxs(At,{children:[t.jsx(Et,{children:r("assets.filters")}),t.jsx(Tt,{onClick:()=>g(!1),"aria-label":r("assets.closeFilters"),children:"✕"})]}),t.jsx(Ft,{children:Je}),t.jsx(Rt,{children:t.jsx(_t,{type:"button",onClick:()=>g(!1),children:r("assets.showItems")})})]}),t.jsxs(Lt,{children:[t.jsxs(Pt,{children:[t.jsx(zt,{name:"search","aria-hidden":!0}),t.jsx(Bt,{type:"search",value:C,placeholder:r("myAssets.searchPlaceholder"),"aria-label":r("myAssets.searchPlaceholder"),onChange:e=>Y(e.target.value)}),C?t.jsx(Kt,{type:"button","aria-label":r("myAssets.clearSearch"),onClick:()=>Y(""),children:t.jsx(Mt,{name:"close","aria-hidden":!0})}):null]}),ie>0?t.jsxs(Qt,{to:"/import",children:[t.jsx("span",{"aria-hidden":!0,children:"📦"}),t.jsxs(Ht,{children:[t.jsx(Ut,{children:r("myAssets.importTitle")}),t.jsx(Wt,{children:r("myAssets.importSub",{count:ie})})]}),t.jsx(Yt,{children:r("myAssets.import")})]}):null,t.jsx(xt,{sort:S,onSort:Fe,sortOptions:H,total:We,loading:Ue,query:y,onOpenFilters:()=>g(!0),chips:E,onClearChips:Ye}),(l==="creations"?He:Ge)?t.jsx(Q,{message:r("myAssets.ownedError"),testId:"my-assets-error"}):null,t.jsx(Q,{message:ze}),l==="creations"?t.jsxs(t.Fragment,{children:[t.jsx(ye,{"data-testid":"grid",children:B?t.jsx(D,{count:12}):M.map(e=>{const n=w(e),i=!!(n!=null&&n.isOnSale);return t.jsx(q,{item:Zt(e,(n==null?void 0:n.priceCredits)??0),mode:"manage",listed:i,busy:ee===e.id,onList:()=>{ue("Shop Started Listing",{listing_type:"primary",item_id:e.blockchainItemId}),X(e)},onUnlist:()=>{n!=null&&n.tradeId&&le(n.tradeId,e.name,e.id)}},`${e.contractAddress}-${e.blockchainItemId}`)})}),!B&&M.length===0?t.jsxs(ge,{children:[t.jsx(be,{children:t.jsx(j,{name:"pen",size:30,"aria-hidden":!0})}),t.jsx(Se,{children:r("myAssets.emptyCreationsTitle")}),t.jsx(we,{children:r("myAssets.nothingToPublish")})]}):null]}):t.jsxs(t.Fragment,{children:[t.jsxs(ye,{"data-testid":"grid",children:[O||P?t.jsx(D,{count:12}):z.map(e=>l==="names"?t.jsx(q,{item:{...Ie(e),category:"ens"},mode:"view"},e.id):t.jsx(q,{item:Ie(e),mode:"manage",listed:e.isOnSale,busy:ee===e.id,onList:()=>{ue("Shop Started Listing",{listing_type:"secondary",item_id:e.itemId??e.tokenId??null}),V(e)},onUnlist:()=>{e.tradeId&&le(e.tradeId,e.name,e.id)}},e.id)),ae?t.jsx(D,{count:6}):null]}),m!=="not_for_sale"?t.jsx(ht,{hasNextPage:De,isFetching:ae,onLoadMore:()=>void Qe()}):null,!O&&!P&&z.length===0?t.jsxs(ge,{children:[t.jsx(be,{children:t.jsx(j,{name:l==="names"?"website":l==="emotes"?"emote-dance":"cat-upper",size:30,"aria-hidden":!0})}),t.jsx(Se,{children:l==="names"?r("myAssets.emptyNamesTitle"):r("myAssets.emptyOwnedTitle")}),t.jsx(we,{children:l==="names"?r("myAssets.namesEmpty"):r("myAssets.ownedEmpty")}),l!=="names"?t.jsx(Nt,{to:"/assets",children:r("myAssets.emptyBrowse")}):null]}):null]})]}),J?t.jsx(ct,{asset:J,session:o,onClose:()=>V(null)}):null,Z?t.jsx(dt,{item:Z,session:o,onClose:()=>X(null)}):null]})}export{Ss as MyAssets};
|