@dcl/shop 0.4.1-30929389788.commit-742d29e → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-Db-W7wkQ.js → Activity-GNtRBDkH.js} +1 -1
- package/_assets/{AnimatedBackground-BHa0JOad.js → AnimatedBackground-C4vGO85y.js} +1 -1
- package/_assets/{Assets-DScd8AjN.js → Assets-DUB4VCUr.js} +7 -7
- package/_assets/{Assets.styles-CC9TEJY8.js → Assets.styles-DIh1hG4_.js} +1 -1
- package/_assets/{Authorizations-9juyA8I3.js → Authorizations-gse9z0i5.js} +1 -1
- package/_assets/Cart-xOvVoYwp.js +695 -0
- package/_assets/{CircularProgress-B2Yj4dgv.js → CircularProgress-BZT_u7sL.js} +1 -1
- package/_assets/{Collection-B4RyBoqR.js → Collection-DkMWDyM9.js} +1 -1
- package/_assets/{CollectionCarousel-D7ypS3Z2.js → CollectionCarousel-D-7TqEHy.js} +1 -1
- package/_assets/{Creator-BkdPFwOV.js → Creator-CIj-i2cJ.js} +1 -1
- package/_assets/{ErrorNotice-DSrM0Kf5.js → ErrorNotice-qXSCgBBe.js} +1 -1
- package/_assets/{ExchangeController-CZ-pTf_8.js → ExchangeController-CoWk4iJ_.js} +1 -1
- package/_assets/{GetCredits-B6T0t3Dq.js → GetCredits-91dR46BQ.js} +1 -1
- package/_assets/{HelpersUtil-B3W36CMu.js → HelpersUtil-B_EI8lTR.js} +1 -1
- package/_assets/{ImportListings-C-obFZTv.js → ImportListings-DrIx4tN-.js} +28 -17
- package/_assets/{ItemDetail-D55mpnrl.js → ItemDetail-DneK31a0.js} +11 -11
- package/_assets/{ItemPreview.styles-CL_JxYSc.js → ItemPreview.styles--MP-O7tE.js} +1 -1
- package/_assets/{LoadMore-KA3XXjNw.js → LoadMore-CPg41rwp.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-CUIN233q.js → ManaPricingBanner.styles-4CDYw79q.js} +1 -1
- package/_assets/{MenuList-B06jmSoi.js → MenuList-D5E4Wrvx.js} +1 -1
- package/_assets/{MyAssets-majFLeCV.js → MyAssets-C29gKaZs.js} +2 -2
- package/_assets/{MyFavorites-Das7b58R.js → MyFavorites-CfsWFXpI.js} +2 -2
- package/_assets/{NotFound-C8NgLkkE.js → NotFound-DVmSPOa9.js} +4 -4
- package/_assets/{NotificationsBell-C9KiHXIn.js → NotificationsBell-C_HZmA4_.js} +1 -1
- package/_assets/{OutfitDetail-BEV5iwUF.js → OutfitDetail-BCkHFvPX.js} +1 -1
- package/_assets/{OutfitPreview-BtpC-Cvw.js → OutfitPreview-XyEsGBYa.js} +2 -2
- package/_assets/{OutfitStudio-BAwsIcEz.js → OutfitStudio-D6HxPa0M.js} +1 -1
- package/_assets/{StoreSettings-Bry12GHk.js → StoreSettings-CmI6OJyt.js} +1 -1
- package/_assets/{Success-DQlpklhB.js → Success-CILFVgai.js} +5 -5
- package/_assets/{SwapController-DfkePmG2.js → SwapController-BtZYC1DC.js} +1 -1
- package/_assets/{Tooltip-DfpTXa5S.js → Tooltip-D-dOz9cj.js} +1 -1
- package/_assets/{TradeService-aWHMWz09.js → TradeService-DFGHQuam.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-COoptDqP.js → W3MFrameProviderSingleton-Dd3fipah.js} +3 -3
- package/_assets/{WebCryptoP256-6ZQY6RZ0.js → WebCryptoP256-83ZQlmY9.js} +1 -1
- package/_assets/{authorizations-CVSgo4HG.js → authorizations-3-Mq1Ehl.js} +1 -1
- package/_assets/{basic-Bz0GeBn4.js → basic-BndfWYou.js} +1 -1
- package/_assets/{biconomy-C5qeqZr1.js → biconomy-UoaVnBXL.js} +1 -1
- package/_assets/{browseLayout.styles-Ti-99uf9.js → browseLayout.styles-C2XsX59Z.js} +1 -1
- package/_assets/{builder-BsYNgj_6.js → builder-BCsqID1m.js} +1 -1
- package/_assets/buy-Bs_G6nfA.js +1 -0
- package/_assets/buy-gasless-Cf6hPQpJ.js +1 -0
- package/_assets/{categories-4Q8LpilA.js → categories-CJDomWri.js} +1 -1
- package/_assets/{ccip-ngY9Pe3O.js → ccip-DL1ik4S_.js} +1 -1
- package/_assets/{ccip-ByGEWKIW.js → ccip-LyTNGN_g.js} +1 -1
- package/_assets/{clsx-BqCzxF7Y.js → clsx-CbhzNwHc.js} +1 -1
- package/_assets/{controller-BAmFvFDh.js → controller-DI4T8YXU.js} +2 -2
- package/_assets/{core-6EsT--jS.js → core-DLkqCpDz.js} +4 -4
- package/_assets/{createSvgIcon--jZ8gc0J.js → createSvgIcon-BdIjzl8A.js} +1 -1
- package/_assets/{custom-DgKKywa8.js → custom-DjHlYa2L.js} +1 -1
- package/_assets/{data-capture-Dh5ES4rT.js → data-capture-CCEqsOVC.js} +1 -1
- package/_assets/{email-C6q-B3dn.js → email-MyVfElwc.js} +1 -1
- package/_assets/{embedded-wallet-BFiVutTi.js → embedded-wallet-DGKPNmRz.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-BbqA95lz.js → emotion-styled.browser.esm-B-KYMSCc.js} +1 -1
- package/_assets/{engine-JdtR0nq_.js → engine-P4mrsX3-.js} +1 -1
- package/_assets/{errors-B82qLCfF.js → errors-B5G852-H.js} +1 -1
- package/_assets/{estimate-l1-fee-DgTq3kmb.js → estimate-l1-fee-CZTQo2Yh.js} +1 -1
- package/_assets/{execute-DYEeUtDo.js → execute-CqlntYG8.js} +2 -2
- package/_assets/{features-DZn29VrN.js → features-BstqY0d8.js} +1 -1
- package/_assets/{fetchTokenMetadata-B2WzuDGz.js → fetchTokenMetadata-wr3bODuw.js} +2 -2
- package/_assets/{field.styles-lhxWzP8B.js → field.styles-CeFk4Y5o.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-CrrYWx4r.js → get-ecosystem-wallet-info-BmrdD1ZM.js} +1 -1
- package/_assets/{getBalance-DKA5EVIM.js → getBalance-CGp1VbNi.js} +1 -1
- package/_assets/{getNFT-DHD0aNcW.js → getNFT-BATtEfMr.js} +1 -1
- package/_assets/{getNFT-B0rvj-5L.js → getNFT-Bc7mOqON.js} +1 -1
- package/_assets/{getThemeProps-g3WCjxgX.js → getThemeProps-Cj1ePFOP.js} +1 -1
- package/_assets/{grid.styles-BtnKEF2E.js → grid.styles-4uR2Oqak.js} +1 -1
- package/_assets/{hashTypedData-DTgIOn4m.js → hashTypedData--isNjJrk.js} +1 -1
- package/_assets/{hashTypedData-DfVAP7eV.js → hashTypedData-DmaIP4Ta.js} +1 -1
- package/_assets/{in-app-D5BjEtTB.js → in-app-DkfGauuN.js} +1 -1
- package/_assets/{in-app-wallet-calls-BT8fK-6W.js → in-app-wallet-calls-_oAp4gRk.js} +1 -1
- package/_assets/{index-8ozgSdai.js → index-6-oWZZKk.js} +1 -1
- package/_assets/{index-E_Sf5YwN.js → index-6TyUCKeH.js} +1 -1
- package/_assets/{index-DH_DK-mM.js → index-9uXo0dDW.js} +1 -1
- package/_assets/{index-BHY2HyQM.js → index-B08mxqyH.js} +1 -1
- package/_assets/{index-sKuG_A-e.js → index-B0XZJoRs.js} +3 -3
- package/_assets/{index-CB8W7Wwj.js → index-B3qntzSb.js} +1 -1
- package/_assets/{index-BPvkKSW-.js → index-B4VZ6oCr.js} +1 -1
- package/_assets/{index-Dvezp6E1.js → index-B9aCuD80.js} +1 -1
- package/_assets/{index-orEmQq47.js → index-BF4F4-es.js} +1 -1
- package/_assets/{index-4P2nQJyI.js → index-BHPckyG6.js} +1 -1
- package/_assets/{index-BLkkARF6.js → index-BQEMTtHk.js} +1 -1
- package/_assets/{index-C0ddHSHN.js → index-BQJhzjgB.js} +1 -1
- package/_assets/{index-BMTDcpzP.js → index-BYndrnYs.js} +1 -1
- package/_assets/{index-DRUTgaLt.js → index-BlqD0sjz.js} +1 -1
- package/_assets/{index-CqaRbr-_.js → index-BmlqG1wa.js} +1 -1
- package/_assets/{index-BkdomiVc.js → index-Bq3RaeMg.js} +1 -1
- package/_assets/{index-B2_ymgJB.js → index-CAtB_PCp.js} +2 -2
- package/_assets/{index-C9N9EKtn.js → index-CEec1iYe.js} +82 -73
- package/_assets/{index-CTN9ScLd.js → index-CKuDkHtx.js} +1 -1
- package/_assets/{index-BqO9dnsd.js → index-CNLdKmSV.js} +1 -1
- package/_assets/{index-DikO0beB.js → index-COG_bMzA.js} +1 -1
- package/_assets/{index-DKjypZ0d.js → index-CVTYXB-H.js} +1 -1
- package/_assets/{index-CHfTJRUt.js → index-CwgAx_D_.js} +1 -1
- package/_assets/{index-Bo5hDaOs.js → index-D-cwjSAX.js} +3 -3
- package/_assets/{index-C-ftDX-e.js → index-DA6dfZrr.js} +1 -1
- package/_assets/{index-DvcsAjCH.js → index-DARDndd8.js} +1 -1
- package/_assets/{index-WeqbIhyb.js → index-DA_UmuJW.js} +2 -2
- package/_assets/{index-Ds1p7jFw.js → index-DCcvZO5Y.js} +1 -1
- package/_assets/{index-Dv4PiFul.js → index-DG2jERXm.js} +1 -1
- package/_assets/{index--2K0MJxe.js → index-DI6mFHN_.js} +1 -1
- package/_assets/{index-C2AUAE9K.js → index-DMfeEICj.js} +1 -1
- package/_assets/{index-DmBpUfbw.js → index-DXe6U5Nd.js} +1 -1
- package/_assets/{index-BAhUbAfy.js → index-DYIatsEA.js} +1 -1
- package/_assets/{index-7hZlA6Kw.js → index-DYJqGaxj.js} +2 -2
- package/_assets/{index-BdudZCLc.js → index-Df_MtlRn.js} +1 -1
- package/_assets/{index-D1fC-8ma.js → index-DiwV8Pqc.js} +1 -1
- package/_assets/{index-udXxIsrp.js → index-DwhWwt0R.js} +1 -1
- package/_assets/{index-DMfRi-zb.js → index-GIpFWU31.js} +1 -1
- package/_assets/{index-D2zLCaX2.js → index-Jw4WyTL7.js} +1 -1
- package/_assets/{index-Bbcgp2zA.js → index-Rzy39Nn7.js} +1 -1
- package/_assets/{index-DF_A0o8O.js → index-TXpJyzEO.js} +1 -1
- package/_assets/{index-CMEHJSyR.js → index-TyIfm5pC.js} +1 -1
- package/_assets/{index-ekmXkRNM.js → index-UOqdWcGo.js} +1 -1
- package/_assets/{index-BM4bIAor.js → index-a7lLIynB.js} +1 -1
- package/_assets/{index-3Vz1Ih1G.js → index-bI7YB81Q.js} +1 -1
- package/_assets/{index-CCTN9glk.js → index-g7yoq537.js} +1 -1
- package/_assets/{index-kn5L_xVv.js → index-hFWlaYZc.js} +1 -1
- package/_assets/{index-YCT7FhXc.js → index-hxv9huma.js} +1 -1
- package/_assets/{index-C2lAxjqW.js → index-pUOx764A.js} +1 -1
- package/_assets/{index-DZmHepqu.js → index-qOIpyDqw.js} +3 -3
- package/_assets/{index-BzrS1OGR.js → index-wLhUVrXT.js} +1 -1
- package/_assets/{index.es-BARR4Gun.js → index.es-CleSpdBe.js} +1 -1
- package/_assets/{index.es-i4xjORFb.js → index.es-DSBJgnik.js} +4 -4
- package/_assets/{index.es-BHdSIiaa.js → index.es-DcH5dh4Z.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DQfpwJw7.js → localBatchGatewayRequest-BQaanzyf.js} +1 -1
- package/_assets/{mana-convert-Ck9I-6Uq.js → mana-convert-gdOzEDdP.js} +1 -1
- package/_assets/{mana-rate-QgHuwxlu.js → mana-rate-DFh9C_O1.js} +1 -1
- package/_assets/{networks-d64kKiSV.js → networks-DweEIHqd.js} +1 -1
- package/_assets/{onramp-BecMqi2K.js → onramp-CQin_sc0.js} +1 -1
- package/_assets/{openzeppelin-vjBXjfol.js → openzeppelin-aL0pLCk3.js} +1 -1
- package/_assets/{parseNft-Dy7r5wsa.js → parseNft-C3_Nz5T-.js} +2 -2
- package/_assets/{parseSignature-BRlMdiGA.js → parseSignature-CaUNRWNX.js} +3 -3
- package/_assets/{parseSignature-DksYWj9u.js → parseSignature-DbUWX_0J.js} +1 -1
- package/_assets/{passkeys-BRcHxYax.js → passkeys-ErJmNcK7.js} +1 -1
- package/_assets/{pay-with-exchange-BXSOiFjm.js → pay-with-exchange-IR4P3LG2.js} +1 -1
- package/_assets/{qr-overlay-Cip9DxEt.js → qr-overlay-CdnDwp_H.js} +1 -1
- package/_assets/{receive-CMnJaoeU.js → receive-zGMAuzLF.js} +1 -1
- package/_assets/{resolveImplementation-TWoeiTet.js → resolveImplementation-DBCwfUsj.js} +1 -1
- package/_assets/{rpc-7qzpxegl.js → rpc-DcBDiZd9.js} +1 -1
- package/_assets/{secp256k1-B8mez7iu.js → secp256k1-B-E-jiWl.js} +1 -1
- package/_assets/{secp256k1-Br3S0CFm.js → secp256k1-Dewsd8iM.js} +1 -1
- package/_assets/{secp256k1-DJqg4ZDg.js → secp256k1-Dw0WpBX5.js} +1 -1
- package/_assets/{send-CrNMtB2o.js → send-DDT-5Y8C.js} +1 -1
- package/_assets/{send-batch-transaction-D373Fu0i.js → send-batch-transaction-BurBPeh7.js} +1 -1
- package/_assets/{send-eip712-transaction-CjvjEaqz.js → send-eip712-transaction-D77WUDwd.js} +2 -2
- package/_assets/{send-gasless-transaction-D7k7Z4lZ.js → send-gasless-transaction-CIWAOyRc.js} +2 -2
- package/_assets/{send-transaction-DuSf0Gpa.js → send-transaction-BXhwaD9S.js} +2 -2
- package/_assets/{sendMetaTransaction-ysIA25j6.js → sendMetaTransaction-CrIt0KCG.js} +1 -1
- package/_assets/{sendRawTransaction-DMahEMO3.js → sendRawTransaction-DNK5LA13.js} +3 -3
- package/_assets/{serializeTransaction-Dy_R0gbR.js → serializeTransaction-D3WekrgC.js} +1 -1
- package/_assets/{session-proposal-wFJ_Xq-z.js → session-proposal-BlosSPbJ.js} +1 -1
- package/_assets/{session-request-COH-7UzM.js → session-request-C8iYxI6j.js} +2 -2
- package/_assets/{signing-Ckuyn_e5.js → signing-Bx48W7O-.js} +3 -3
- package/_assets/{socials-FP-fRVu0.js → socials-BSmNv258.js} +1 -1
- package/_assets/{swaps-BxewF7TW.js → swaps-DyNopWtM.js} +1 -1
- package/_assets/{thirdweb-D8fj1r0r.js → thirdweb-Bc1voIUm.js} +3 -3
- package/_assets/{to-serializable-transaction-DfEWI1zg.js → to-serializable-transaction-BXY289Ul.js} +2 -2
- package/_assets/{trade-encoding-psxHAKvo.js → trade-encoding-B7y8VfDo.js} +1 -1
- package/_assets/{transactionReceipt-DIcbPjA9.js → transactionReceipt-DLzKebEg.js} +1 -1
- package/_assets/{transactions-BrwcuhUa.js → transactions-BWXAu1Vp.js} +1 -1
- package/_assets/{useCreditPacks-BxjNjEb5.js → useCreditPacks-CYnMKZmp.js} +1 -1
- package/_assets/{useInfiniteGrid-By91Vng4.js → useInfiniteGrid-ottWIC3k.js} +1 -1
- package/_assets/useManaRate-CPn6JNFj.js +1 -0
- package/_assets/{useStore-Bk_iM1_W.js → useStore-DC77ufHd.js} +1 -1
- package/_assets/useTheme-BOb3XgSe.js +1 -0
- package/_assets/{verifyHash-haNM6fqc.js → verifyHash-B6wVUzvm.js} +1 -1
- package/_assets/{w3m-modal-Bp9zdyll.js → w3m-modal-CYIABu52.js} +1 -1
- package/_assets/{w3m-modal-BPeZqcW1.js → w3m-modal-D0DQYwij.js} +1 -1
- package/_assets/{wait-for-tx-receipt-CGJMUoaQ.js → wait-for-tx-receipt-CzEApn7N.js} +1 -1
- package/_assets/{wallets-BI1VVvky.js → wallets-CQPQ_gpR.js} +5 -5
- package/_assets/{web-connector-B8j0HFRl.js → web-connector-B5U5FrL8.js} +3 -3
- package/_assets/{writeContract-BERJiwjR.js → writeContract-CGlJd1QG.js} +1 -1
- package/_assets/{zoraTestnet-8myH3mD_.js → zoraTestnet-pKTbhMUO.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-DOsuNsch.js +0 -695
- package/_assets/buy-XwnhKGiV.js +0 -1
- package/_assets/buy-gasless-DdQlX-69.js +0 -1
- package/_assets/useManaRate-CJKClAWL.js +0 -1
- package/_assets/useSecondarySales-CjBDIS93.js +0 -1
- package/_assets/useTheme-BT599SB4.js +0 -1
package/_assets/Cart-DOsuNsch.js
DELETED
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
import{j as e,L as Se,r as P,d as ea,b as ta}from"./react-DehiWSvs.js";import{t as le,s as i,e as s,ao as de,aZ as aa,an as sa,I as O,p as Mt,a9 as Ne,m as na,L as Q,ab as dt,n as ia,u as ra,a_ as oa,q as ca,a$ as da,b0 as la,b1 as ua,b2 as ha,o as pa,b3 as lt,O as G,b4 as ut,b5 as ga,l as ae,c as ht,b6 as xa,f as ma,b7 as pt,b8 as Re,b9 as ye,ba as be,bb as gt,a as ve,b as fa,C as We,bc as ya}from"./index-C9N9EKtn.js";import{M as ba,S as va,C as wa,H as Ca,a as ja,T as ka,X as $a,b as Sa,B as Ma,c as Ta,d as xt,e as Ia,f as ke,P as Tt,m as Pa,g as za,h as Aa,i as Ea,j as It,k as $e,L as qa,l as _a,n as mt,o as ft,W as Ba,p as Ra,q as Wa,A as Fa,r as La,s as Ka,t as Ua,u as Na,v as Qa,w as Oa,x as Ha,y as Va,z as Ga,D as Da,E as Ya,F as Ja,G as Xa,I as Za,J as es,K as Fe,N as ts,O as as,Q as ss,R as ns,U as yt,V as bt,Y as is,Z as rs,_ as os}from"./CollectionCarousel-D7ypS3Z2.js";import{u as cs}from"./useManaRate-CJKClAWL.js";import{r as ds}from"./mana-rate-QgHuwxlu.js";import{j as ls,k as us,h as hs,n as ps,i as gs,A as xs}from"./authorizations-CVSgo4HG.js";import{g as ms,b as Le}from"./buy-XwnhKGiV.js";import{b as fs,w as ys,S as vt,G as bs}from"./buy-gasless-DdQlX-69.js";import{u as vs,M as ws,R as we,r as Cs,c as js,p as wt}from"./useCreditPacks-BxjNjEb5.js";import{i as ks,a as $s}from"./errors-B82qLCfF.js";import{E as Ss}from"./ErrorNotice-DSrM0Kf5.js";import{u as Ct}from"./mana-convert-Ck9I-6Uq.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-psxHAKvo.js";import"./sendMetaTransaction-ysIA25j6.js";const{colors:se,radius:Ms}=le,Ts=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`,Is=i.span`
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 22px;
|
|
10
|
-
color: ${se.text2};
|
|
11
|
-
text-transform: capitalize;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,Ps=i.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: 8px;
|
|
17
|
-
/* The list is the modal's elastic region: inside a viewport-capped card it gives up height first, so
|
|
18
|
-
the pack picker, total and Cancel/Buy below it stay on screen without scrolling. The floor is an
|
|
19
|
-
explicit ~one row because a scroll container's automatic minimum size is zero — it would otherwise
|
|
20
|
-
collapse to nothing on a short screen. */
|
|
21
|
-
min-height: 120px;
|
|
22
|
-
max-height: 360px;
|
|
23
|
-
overflow-y: auto;
|
|
24
|
-
width: 100%;
|
|
25
|
-
scrollbar-width: thin;
|
|
26
|
-
scrollbar-color: #a2a2a2 ${se.media};
|
|
27
|
-
|
|
28
|
-
&::-webkit-scrollbar {
|
|
29
|
-
width: 8px;
|
|
30
|
-
}
|
|
31
|
-
&::-webkit-scrollbar-track {
|
|
32
|
-
background: ${se.media};
|
|
33
|
-
border-radius: 10px;
|
|
34
|
-
}
|
|
35
|
-
&::-webkit-scrollbar-thumb {
|
|
36
|
-
background: #a2a2a2;
|
|
37
|
-
border-radius: ${Ms.btn};
|
|
38
|
-
}
|
|
39
|
-
`,zs=i.span`
|
|
40
|
-
margin-left: 8px;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
color: ${se.muted};
|
|
44
|
-
`,As=i.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
gap: 12px;
|
|
49
|
-
padding: 0 0 12px;
|
|
50
|
-
font-size: 14px;
|
|
51
|
-
color: ${se.muted};
|
|
52
|
-
|
|
53
|
-
& strong {
|
|
54
|
-
display: inline-flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 6px;
|
|
57
|
-
font-size: 20px;
|
|
58
|
-
font-weight: 700;
|
|
59
|
-
color: ${se.text};
|
|
60
|
-
}
|
|
61
|
-
`,Es="https://cdn.decentraland.org/@dcl/shop/0.3.1-30929389788.commit-742d29e/_assets/buy-error-22UunaPC.png";function qs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ba,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(va,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(wa,{"data-tall":Y||void 0,children:[e.jsxs(Ca,{children:[e.jsxs(ja,{children:[e.jsx(ka,{children:D}),!W&&e.jsx($a,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Sa,{})})]}),e.jsxs(Ma,{children:[e.jsx(Ta,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Ia,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(As,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Pa(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Bs,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(ke,{children:[e.jsxs(za,{"data-testid":"buy-error",children:[e.jsx(Aa,{src:Es,alt:"",width:64,height:80}),e.jsxs(Ea,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(qa,{src:aa,alt:"",width:61,height:61}),e.jsx(_a,{children:ne}),D?e.jsxs(Ts,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Is,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Bs({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(Ra,{}),e.jsxs(Wa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(Ps,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Fa,{children:[e.jsx(La,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ka,{children:[e.jsxs("div",{children:[e.jsxs(Ua,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(zs,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Na,{address:n.item.creator}):null]}),e.jsxs(Qa,{children:[e.jsx(Oa,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ha,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Va,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ga,{}),e.jsx(Da,{children:de(n.credits)}),e.jsxs(Ya,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Ja,{children:[e.jsxs(Xa,{children:[e.jsx(Za,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(es,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
|
|
62
|
-
max-width: 1510px;
|
|
63
|
-
margin: 0 auto;
|
|
64
|
-
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
65
|
-
the footer rather than leaving a gray strip. Needs .page[data-route="/cart"] to be a flex column. */
|
|
66
|
-
width: 100%;
|
|
67
|
-
flex: 1 0 auto;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
|
|
71
|
-
${T} {
|
|
72
|
-
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
-
}
|
|
74
|
-
`,kt=i.button`
|
|
75
|
-
display: inline-flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
gap: 6px;
|
|
78
|
-
margin: 0 0 16px;
|
|
79
|
-
padding: 0;
|
|
80
|
-
border: 0;
|
|
81
|
-
background: none;
|
|
82
|
-
color: ${r.text2};
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
font-weight: 600;
|
|
85
|
-
letter-spacing: 0.02em;
|
|
86
|
-
text-transform: uppercase;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
transition: color 0.15s ease;
|
|
89
|
-
|
|
90
|
-
&:hover {
|
|
91
|
-
color: ${r.accent};
|
|
92
|
-
}
|
|
93
|
-
& .ico {
|
|
94
|
-
width: 18px;
|
|
95
|
-
height: 18px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
${T} {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
`,Rs=i.div`
|
|
102
|
-
display: grid;
|
|
103
|
-
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
-
gap: 24px;
|
|
105
|
-
align-items: start;
|
|
106
|
-
|
|
107
|
-
${zt} {
|
|
108
|
-
grid-template-columns: 1fr;
|
|
109
|
-
}
|
|
110
|
-
`,$t=i.div`
|
|
111
|
-
position: relative;
|
|
112
|
-
/* The gray band is 733px in Figma (1553-317103) — taller than the panels inside it, deliberately. Without
|
|
113
|
-
this it collapsed to the panels' height, and the page shell's own viewport-filling min-height then padded
|
|
114
|
-
the page out BELOW the cross-sell, so a strip of gray showed under "You might also like" instead of the
|
|
115
|
-
footer. Giving the band its designed height puts the leftover space where the design wants it. */
|
|
116
|
-
min-height: 733px;
|
|
117
|
-
|
|
118
|
-
${T} {
|
|
119
|
-
/* The single-column layout is already taller than the desktop band, and the fixed summary bar sits over
|
|
120
|
-
the bottom of it — a floor here would only add empty gray. */
|
|
121
|
-
min-height: 0;
|
|
122
|
-
}
|
|
123
|
-
`,Ws=i.div`
|
|
124
|
-
min-width: 0;
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-direction: column;
|
|
127
|
-
gap: 12px;
|
|
128
|
-
`,Fs=i.div`
|
|
129
|
-
display: flex;
|
|
130
|
-
align-items: center;
|
|
131
|
-
justify-content: space-between;
|
|
132
|
-
gap: 12px;
|
|
133
|
-
background: ${r.white};
|
|
134
|
-
border-radius: 16px;
|
|
135
|
-
padding: 12px 12px 12px 24px;
|
|
136
|
-
|
|
137
|
-
${T} {
|
|
138
|
-
gap: 8px;
|
|
139
|
-
padding: 12px;
|
|
140
|
-
}
|
|
141
|
-
`,At=i.section`
|
|
142
|
-
min-width: 0;
|
|
143
|
-
background: ${r.white};
|
|
144
|
-
border-radius: 16px;
|
|
145
|
-
padding: 24px;
|
|
146
|
-
|
|
147
|
-
${T} {
|
|
148
|
-
padding: 16px;
|
|
149
|
-
}
|
|
150
|
-
`,Ls=i(At)`
|
|
151
|
-
display: flex;
|
|
152
|
-
flex-direction: column;
|
|
153
|
-
align-items: center;
|
|
154
|
-
justify-content: center;
|
|
155
|
-
gap: 24px;
|
|
156
|
-
min-height: 420px;
|
|
157
|
-
padding: 48px 16px;
|
|
158
|
-
text-align: center;
|
|
159
|
-
color: ${r.text};
|
|
160
|
-
|
|
161
|
-
${le.media.maxWidth("mobile")} {
|
|
162
|
-
min-height: 320px;
|
|
163
|
-
padding: 32px 16px;
|
|
164
|
-
}
|
|
165
|
-
`,Ks=i.div`
|
|
166
|
-
display: flex;
|
|
167
|
-
flex-direction: column;
|
|
168
|
-
align-items: center;
|
|
169
|
-
gap: 12px;
|
|
170
|
-
padding-bottom: 16px;
|
|
171
|
-
`,Us=i.p`
|
|
172
|
-
margin: 0;
|
|
173
|
-
font-size: 24px;
|
|
174
|
-
font-weight: 700;
|
|
175
|
-
line-height: 1.6;
|
|
176
|
-
|
|
177
|
-
${le.media.maxWidth("mobile")} {
|
|
178
|
-
font-size: 20px;
|
|
179
|
-
}
|
|
180
|
-
`,Ns=i.p`
|
|
181
|
-
margin: 0;
|
|
182
|
-
font-size: 20px;
|
|
183
|
-
font-weight: 400;
|
|
184
|
-
line-height: 1.6;
|
|
185
|
-
|
|
186
|
-
${le.media.maxWidth("mobile")} {
|
|
187
|
-
font-size: 16px;
|
|
188
|
-
}
|
|
189
|
-
`,Qs=i(Se)`
|
|
190
|
-
display: inline-flex;
|
|
191
|
-
align-items: center;
|
|
192
|
-
justify-content: center;
|
|
193
|
-
width: 310px;
|
|
194
|
-
max-width: 100%;
|
|
195
|
-
height: 56px;
|
|
196
|
-
padding: 0 12px;
|
|
197
|
-
border-radius: ${Z.card};
|
|
198
|
-
background: ${r.accent};
|
|
199
|
-
color: ${r.softWhite};
|
|
200
|
-
font-size: 15px;
|
|
201
|
-
font-weight: 600;
|
|
202
|
-
line-height: 24px;
|
|
203
|
-
letter-spacing: 0.46px;
|
|
204
|
-
text-transform: uppercase;
|
|
205
|
-
text-decoration: none;
|
|
206
|
-
transition: background 0.15s ease;
|
|
207
|
-
|
|
208
|
-
&:hover {
|
|
209
|
-
background: ${r.accentHover};
|
|
210
|
-
}
|
|
211
|
-
&:focus-visible {
|
|
212
|
-
outline: 2px solid ${r.accent};
|
|
213
|
-
outline-offset: 2px;
|
|
214
|
-
}
|
|
215
|
-
`,Os=i.button`
|
|
216
|
-
display: none;
|
|
217
|
-
|
|
218
|
-
${T} {
|
|
219
|
-
display: inline-flex;
|
|
220
|
-
align-items: center;
|
|
221
|
-
flex-shrink: 0;
|
|
222
|
-
border: 0;
|
|
223
|
-
background: none;
|
|
224
|
-
padding: 0;
|
|
225
|
-
color: ${r.text};
|
|
226
|
-
cursor: pointer;
|
|
227
|
-
|
|
228
|
-
& .ico {
|
|
229
|
-
width: 20px;
|
|
230
|
-
height: 20px;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
`,Hs=i.h1`
|
|
234
|
-
margin: 0;
|
|
235
|
-
font-size: 14px;
|
|
236
|
-
font-weight: 600;
|
|
237
|
-
line-height: 1.57;
|
|
238
|
-
color: ${r.text};
|
|
239
|
-
|
|
240
|
-
${T} {
|
|
241
|
-
flex: 1;
|
|
242
|
-
min-width: 0;
|
|
243
|
-
font-size: 16px;
|
|
244
|
-
}
|
|
245
|
-
`,Vs=i.button`
|
|
246
|
-
display: inline-flex;
|
|
247
|
-
align-items: center;
|
|
248
|
-
justify-content: center;
|
|
249
|
-
gap: 8px;
|
|
250
|
-
height: 40px;
|
|
251
|
-
padding: 0 12px;
|
|
252
|
-
border: 2px solid transparent;
|
|
253
|
-
border-radius: ${Z.btn};
|
|
254
|
-
background:
|
|
255
|
-
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
256
|
-
${Pt.amethyst} border-box;
|
|
257
|
-
color: ${r.accent};
|
|
258
|
-
font-size: 13px;
|
|
259
|
-
font-weight: 600;
|
|
260
|
-
line-height: 24px;
|
|
261
|
-
letter-spacing: 0.46px;
|
|
262
|
-
text-transform: uppercase;
|
|
263
|
-
white-space: nowrap;
|
|
264
|
-
cursor: pointer;
|
|
265
|
-
transition:
|
|
266
|
-
box-shadow 0.15s ease,
|
|
267
|
-
filter 0.15s ease;
|
|
268
|
-
|
|
269
|
-
&:hover:not(:disabled) {
|
|
270
|
-
box-shadow: 0 0 8px 0 rgba(165, 36, 179, 0.35);
|
|
271
|
-
}
|
|
272
|
-
&:active:not(:disabled) {
|
|
273
|
-
filter: brightness(0.97);
|
|
274
|
-
}
|
|
275
|
-
&:disabled {
|
|
276
|
-
opacity: 0.55;
|
|
277
|
-
cursor: default;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
${T} {
|
|
281
|
-
height: 36px;
|
|
282
|
-
padding: 0 10px;
|
|
283
|
-
font-size: 12px;
|
|
284
|
-
}
|
|
285
|
-
`,Gs=i.div`
|
|
286
|
-
display: flex;
|
|
287
|
-
flex-direction: column;
|
|
288
|
-
gap: 24px;
|
|
289
|
-
`,Ds=i.div`
|
|
290
|
-
position: relative;
|
|
291
|
-
display: flex;
|
|
292
|
-
align-items: stretch;
|
|
293
|
-
gap: 12px;
|
|
294
|
-
background: ${r.white};
|
|
295
|
-
border: 1px solid ${r.gray4};
|
|
296
|
-
border-radius: ${Z.card};
|
|
297
|
-
overflow: hidden;
|
|
298
|
-
|
|
299
|
-
&[data-unavailable] [data-thumb] {
|
|
300
|
-
opacity: 0.5;
|
|
301
|
-
}
|
|
302
|
-
&[data-unavailable] [data-check] {
|
|
303
|
-
display: none;
|
|
304
|
-
}
|
|
305
|
-
&[data-unavailable] [data-desc] {
|
|
306
|
-
opacity: 0.7;
|
|
307
|
-
}
|
|
308
|
-
`,Ys=i.div`
|
|
309
|
-
position: relative;
|
|
310
|
-
flex-shrink: 0;
|
|
311
|
-
width: 137.5px;
|
|
312
|
-
height: 137px;
|
|
313
|
-
background: ${r.media};
|
|
314
|
-
border-radius: ${Z.card};
|
|
315
|
-
display: grid;
|
|
316
|
-
place-items: center;
|
|
317
|
-
overflow: hidden;
|
|
318
|
-
|
|
319
|
-
& img {
|
|
320
|
-
width: 83%;
|
|
321
|
-
height: 83%;
|
|
322
|
-
object-fit: contain;
|
|
323
|
-
filter: drop-shadow(0.56px 2.25px 2.8px rgba(0, 0, 0, 0.1));
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
${T} {
|
|
327
|
-
width: 120px;
|
|
328
|
-
height: 120px;
|
|
329
|
-
}
|
|
330
|
-
`,Js=i(Se)`
|
|
331
|
-
position: absolute;
|
|
332
|
-
inset: 0;
|
|
333
|
-
display: grid;
|
|
334
|
-
place-items: center;
|
|
335
|
-
`,Xs=i.span`
|
|
336
|
-
position: absolute;
|
|
337
|
-
top: 7.5px;
|
|
338
|
-
left: 7.5px;
|
|
339
|
-
width: 20px;
|
|
340
|
-
height: 20px;
|
|
341
|
-
border-radius: 50%;
|
|
342
|
-
background: #34ce77;
|
|
343
|
-
display: grid;
|
|
344
|
-
place-items: center;
|
|
345
|
-
`,Zs=i.div`
|
|
346
|
-
flex: 1;
|
|
347
|
-
min-width: 0;
|
|
348
|
-
display: flex;
|
|
349
|
-
flex-direction: column;
|
|
350
|
-
justify-content: space-between;
|
|
351
|
-
gap: 8px;
|
|
352
|
-
padding: 16px 8px;
|
|
353
|
-
|
|
354
|
-
${T} {
|
|
355
|
-
padding: 12px 4px 12px 0;
|
|
356
|
-
}
|
|
357
|
-
`,en=i.div`
|
|
358
|
-
display: flex;
|
|
359
|
-
flex-direction: column;
|
|
360
|
-
gap: 4px;
|
|
361
|
-
min-width: 0;
|
|
362
|
-
padding-right: 64px; /* clear the top-right favourite + remove group */
|
|
363
|
-
`,Et=Ne`
|
|
364
|
-
display: block;
|
|
365
|
-
font-size: 16px;
|
|
366
|
-
font-weight: 600;
|
|
367
|
-
line-height: 1.2;
|
|
368
|
-
color: ${r.text};
|
|
369
|
-
text-decoration: none;
|
|
370
|
-
overflow: hidden;
|
|
371
|
-
text-overflow: ellipsis;
|
|
372
|
-
white-space: nowrap;
|
|
373
|
-
|
|
374
|
-
a&:hover {
|
|
375
|
-
color: ${r.accent};
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
${T} {
|
|
379
|
-
white-space: normal;
|
|
380
|
-
display: -webkit-box;
|
|
381
|
-
-webkit-line-clamp: 2;
|
|
382
|
-
line-clamp: 2;
|
|
383
|
-
-webkit-box-orient: vertical;
|
|
384
|
-
}
|
|
385
|
-
`,tn=i.div`
|
|
386
|
-
${Et};
|
|
387
|
-
`,an=i(Se)`
|
|
388
|
-
${Et};
|
|
389
|
-
`,sn=i(sa)`
|
|
390
|
-
font-size: 10px;
|
|
391
|
-
line-height: 1.43;
|
|
392
|
-
color: ${r.muted};
|
|
393
|
-
|
|
394
|
-
& [data-avatar] {
|
|
395
|
-
display: none;
|
|
396
|
-
}
|
|
397
|
-
& [data-testid='creator-name'] {
|
|
398
|
-
font-size: 10px;
|
|
399
|
-
line-height: 1.43;
|
|
400
|
-
}
|
|
401
|
-
`,nn=i.div`
|
|
402
|
-
display: flex;
|
|
403
|
-
align-items: center;
|
|
404
|
-
justify-content: space-between;
|
|
405
|
-
gap: 12px;
|
|
406
|
-
padding-right: 8px;
|
|
407
|
-
`,rn=i.div`
|
|
408
|
-
display: inline-flex;
|
|
409
|
-
align-items: center;
|
|
410
|
-
gap: 8px;
|
|
411
|
-
padding: 6px;
|
|
412
|
-
border: 0.5px solid ${r.muted2};
|
|
413
|
-
border-radius: ${Z.pill};
|
|
414
|
-
`,St=i.button`
|
|
415
|
-
display: grid;
|
|
416
|
-
place-items: center;
|
|
417
|
-
width: 16px;
|
|
418
|
-
height: 16px;
|
|
419
|
-
padding: 0;
|
|
420
|
-
border: 0;
|
|
421
|
-
background: none;
|
|
422
|
-
color: ${r.text};
|
|
423
|
-
cursor: pointer;
|
|
424
|
-
|
|
425
|
-
&:disabled {
|
|
426
|
-
color: ${r.muted2};
|
|
427
|
-
cursor: default;
|
|
428
|
-
}
|
|
429
|
-
`,on=i.span`
|
|
430
|
-
min-width: 12px;
|
|
431
|
-
font-size: 14px;
|
|
432
|
-
font-weight: 500;
|
|
433
|
-
line-height: 1.2;
|
|
434
|
-
color: ${r.text};
|
|
435
|
-
text-align: center;
|
|
436
|
-
`,cn=i.div`
|
|
437
|
-
display: inline-flex;
|
|
438
|
-
align-items: center;
|
|
439
|
-
gap: 4px;
|
|
440
|
-
/* Always right-aligned: with a stepper present space-between handles it; for secondary/unique lines
|
|
441
|
-
(no stepper) the auto margin keeps the lone price on the right instead of falling to the left. */
|
|
442
|
-
margin-left: auto;
|
|
443
|
-
font-size: 24px;
|
|
444
|
-
font-weight: 600;
|
|
445
|
-
color: ${r.text2};
|
|
446
|
-
|
|
447
|
-
${T} {
|
|
448
|
-
font-size: 20px;
|
|
449
|
-
}
|
|
450
|
-
`,dn=i(Mt)`
|
|
451
|
-
width: 24px;
|
|
452
|
-
height: 24px;
|
|
453
|
-
background: ${r.text};
|
|
454
|
-
|
|
455
|
-
${T} {
|
|
456
|
-
width: 20px;
|
|
457
|
-
height: 20px;
|
|
458
|
-
}
|
|
459
|
-
`,ln=i.span`
|
|
460
|
-
margin-left: 6px;
|
|
461
|
-
font-size: 14px;
|
|
462
|
-
font-weight: 500;
|
|
463
|
-
color: ${r.muted};
|
|
464
|
-
text-decoration: line-through;
|
|
465
|
-
`,un=i.div`
|
|
466
|
-
position: absolute;
|
|
467
|
-
top: 9px;
|
|
468
|
-
right: 7px;
|
|
469
|
-
display: flex;
|
|
470
|
-
align-items: flex-start;
|
|
471
|
-
gap: 12px;
|
|
472
|
-
`,hn=i.span`
|
|
473
|
-
display: inline-flex;
|
|
474
|
-
align-items: center;
|
|
475
|
-
gap: 4px;
|
|
476
|
-
font-size: 12px;
|
|
477
|
-
font-weight: 600;
|
|
478
|
-
line-height: 1;
|
|
479
|
-
text-transform: uppercase;
|
|
480
|
-
color: ${r.text2};
|
|
481
|
-
`,pn=i(O)`
|
|
482
|
-
color: #f48221;
|
|
483
|
-
`,gn=i(Se)`
|
|
484
|
-
font-size: 12px;
|
|
485
|
-
font-weight: 600;
|
|
486
|
-
line-height: 24px;
|
|
487
|
-
letter-spacing: 0.46px;
|
|
488
|
-
text-transform: uppercase;
|
|
489
|
-
text-decoration: underline;
|
|
490
|
-
color: ${r.accent};
|
|
491
|
-
|
|
492
|
-
&:hover {
|
|
493
|
-
color: ${r.accentHover};
|
|
494
|
-
}
|
|
495
|
-
&:focus-visible {
|
|
496
|
-
outline: 2px solid ${r.accent};
|
|
497
|
-
outline-offset: 2px;
|
|
498
|
-
}
|
|
499
|
-
`,xn=i.span`
|
|
500
|
-
align-self: flex-start;
|
|
501
|
-
display: inline-flex;
|
|
502
|
-
align-items: center;
|
|
503
|
-
gap: 4px;
|
|
504
|
-
padding: 2px 4px;
|
|
505
|
-
border-radius: ${Z.chip};
|
|
506
|
-
background: #f4e9ff;
|
|
507
|
-
font-size: 10px;
|
|
508
|
-
font-weight: 400;
|
|
509
|
-
line-height: 14px;
|
|
510
|
-
color: ${r.text};
|
|
511
|
-
`,mn=i(O)`
|
|
512
|
-
width: 11.31px;
|
|
513
|
-
height: 10.94px;
|
|
514
|
-
background: ${r.text};
|
|
515
|
-
`,qt=Ne`
|
|
516
|
-
display: grid;
|
|
517
|
-
place-items: center;
|
|
518
|
-
width: 24px;
|
|
519
|
-
height: 24px;
|
|
520
|
-
padding: 0;
|
|
521
|
-
border: 0;
|
|
522
|
-
background: none;
|
|
523
|
-
color: ${r.muted};
|
|
524
|
-
cursor: pointer;
|
|
525
|
-
transition: color 0.12s ease;
|
|
526
|
-
|
|
527
|
-
&:disabled {
|
|
528
|
-
opacity: 0.5;
|
|
529
|
-
cursor: default;
|
|
530
|
-
}
|
|
531
|
-
`,fn=i.button`
|
|
532
|
-
${qt};
|
|
533
|
-
|
|
534
|
-
&:hover:not(:disabled) {
|
|
535
|
-
color: ${r.text};
|
|
536
|
-
}
|
|
537
|
-
&[data-on] {
|
|
538
|
-
color: ${r.dclRed};
|
|
539
|
-
}
|
|
540
|
-
`,yn=i.button`
|
|
541
|
-
${qt};
|
|
542
|
-
|
|
543
|
-
&:hover:not(:disabled) {
|
|
544
|
-
color: ${r.dclRed};
|
|
545
|
-
}
|
|
546
|
-
`,bn=i.div`
|
|
547
|
-
display: flex;
|
|
548
|
-
gap: 20px;
|
|
549
|
-
margin-top: 16px;
|
|
550
|
-
|
|
551
|
-
& .link {
|
|
552
|
-
font-size: 13px;
|
|
553
|
-
color: ${r.muted};
|
|
554
|
-
font-weight: 600;
|
|
555
|
-
}
|
|
556
|
-
& .link:hover:not(:disabled) {
|
|
557
|
-
color: ${r.text};
|
|
558
|
-
}
|
|
559
|
-
`,vn=i.aside`
|
|
560
|
-
position: sticky;
|
|
561
|
-
top: 172px;
|
|
562
|
-
display: flex;
|
|
563
|
-
flex-direction: column;
|
|
564
|
-
background: ${r.white};
|
|
565
|
-
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.06);
|
|
566
|
-
border-radius: 16px;
|
|
567
|
-
padding: 16px;
|
|
568
|
-
|
|
569
|
-
${zt} {
|
|
570
|
-
position: static;
|
|
571
|
-
}
|
|
572
|
-
${T} {
|
|
573
|
-
position: fixed;
|
|
574
|
-
left: 0;
|
|
575
|
-
right: 0;
|
|
576
|
-
top: auto;
|
|
577
|
-
bottom: 0;
|
|
578
|
-
z-index: 30;
|
|
579
|
-
border: 0;
|
|
580
|
-
border-radius: 16px 16px 0 0;
|
|
581
|
-
box-shadow: 0 -4px 20px rgba(22, 21, 24, 0.12);
|
|
582
|
-
}
|
|
583
|
-
`,wn=i.h2`
|
|
584
|
-
margin: 0 0 24px;
|
|
585
|
-
padding-bottom: 16px;
|
|
586
|
-
border-bottom: 1px solid ${r.gray4};
|
|
587
|
-
font-size: 24px;
|
|
588
|
-
font-weight: 600;
|
|
589
|
-
color: ${r.text};
|
|
590
|
-
|
|
591
|
-
${T} {
|
|
592
|
-
margin-bottom: 12px;
|
|
593
|
-
padding-bottom: 12px;
|
|
594
|
-
}
|
|
595
|
-
`,Cn=i.div`
|
|
596
|
-
display: flex;
|
|
597
|
-
flex-direction: column;
|
|
598
|
-
gap: 12px;
|
|
599
|
-
`,jn=i.div`
|
|
600
|
-
display: flex;
|
|
601
|
-
align-items: flex-start;
|
|
602
|
-
justify-content: space-between;
|
|
603
|
-
gap: 12px;
|
|
604
|
-
`,kn=i.span`
|
|
605
|
-
font-size: 14px;
|
|
606
|
-
font-weight: 600;
|
|
607
|
-
line-height: 1.57;
|
|
608
|
-
color: ${r.muted1};
|
|
609
|
-
`,$n=i.span`
|
|
610
|
-
display: inline-flex;
|
|
611
|
-
align-items: center;
|
|
612
|
-
gap: 8px;
|
|
613
|
-
font-size: 24px;
|
|
614
|
-
font-weight: 700;
|
|
615
|
-
color: ${r.text};
|
|
616
|
-
`,Sn=i.span`
|
|
617
|
-
display: flex;
|
|
618
|
-
flex-direction: column;
|
|
619
|
-
align-items: flex-end;
|
|
620
|
-
justify-content: center;
|
|
621
|
-
gap: 4px;
|
|
622
|
-
`;i.span`
|
|
623
|
-
font-size: 12px;
|
|
624
|
-
font-weight: 400;
|
|
625
|
-
line-height: 1;
|
|
626
|
-
color: ${r.muted};
|
|
627
|
-
`;const Mn=i(Mt)`
|
|
628
|
-
width: 30px;
|
|
629
|
-
height: 30px;
|
|
630
|
-
background: ${r.text};
|
|
631
|
-
-webkit-mask-size: 24px 24px;
|
|
632
|
-
mask-size: 24px 24px;
|
|
633
|
-
-webkit-mask-position: left center;
|
|
634
|
-
mask-position: left center;
|
|
635
|
-
`,Tn=i.button`
|
|
636
|
-
width: 100%;
|
|
637
|
-
height: 56px;
|
|
638
|
-
border: 0;
|
|
639
|
-
border-radius: ${Z.btn};
|
|
640
|
-
background: ${Pt.amethyst};
|
|
641
|
-
color: ${r.softWhite};
|
|
642
|
-
font-size: 15px;
|
|
643
|
-
font-weight: 600;
|
|
644
|
-
letter-spacing: 0.046em;
|
|
645
|
-
text-transform: uppercase;
|
|
646
|
-
cursor: pointer;
|
|
647
|
-
transition:
|
|
648
|
-
background 0.15s ease,
|
|
649
|
-
filter 0.15s ease;
|
|
650
|
-
|
|
651
|
-
&:hover:not(:disabled) {
|
|
652
|
-
background: ${r.accent};
|
|
653
|
-
}
|
|
654
|
-
&:active:not(:disabled) {
|
|
655
|
-
filter: brightness(0.95);
|
|
656
|
-
}
|
|
657
|
-
&:disabled {
|
|
658
|
-
opacity: 0.6;
|
|
659
|
-
cursor: default;
|
|
660
|
-
}
|
|
661
|
-
`,_t=Ne`
|
|
662
|
-
margin: 0;
|
|
663
|
-
font-size: 13px;
|
|
664
|
-
`,Ce=i.p`
|
|
665
|
-
${_t};
|
|
666
|
-
`,In=i(Ss)`
|
|
667
|
-
${_t};
|
|
668
|
-
`,Pn=i.div`
|
|
669
|
-
position: relative;
|
|
670
|
-
/* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
|
|
671
|
-
flex: 1 0 auto;
|
|
672
|
-
margin-top: 48px;
|
|
673
|
-
/* The whole gap from the top of the cross-sell to the "You might also like" heading — the shared
|
|
674
|
-
carousel's own top margin is zeroed below so this padding isn't stacked on top of it. */
|
|
675
|
-
padding: 47px 0 24px;
|
|
676
|
-
|
|
677
|
-
&::before {
|
|
678
|
-
content: '';
|
|
679
|
-
position: absolute;
|
|
680
|
-
top: 0;
|
|
681
|
-
bottom: -80px; /* eat .page's bottom padding so the white reaches the footer */
|
|
682
|
-
left: 50%;
|
|
683
|
-
width: 100vw;
|
|
684
|
-
transform: translateX(-50%);
|
|
685
|
-
background: ${r.bg};
|
|
686
|
-
z-index: 0;
|
|
687
|
-
}
|
|
688
|
-
& > * {
|
|
689
|
-
position: relative;
|
|
690
|
-
z-index: 1;
|
|
691
|
-
}
|
|
692
|
-
& section {
|
|
693
|
-
margin-top: 0;
|
|
694
|
-
}
|
|
695
|
-
`;function Ke(o){if(ks(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ma.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const zn=12e4;function An(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Jn(){na({title:s("nav.cart"),noindex:!0});const o=Q(t=>t.items),l=Q(t=>t.remove),I=Q(t=>t.increment),z=Q(t=>t.decrement),W=Q(t=>t.clear),D=Q(t=>t.restore),Y=Q(t=>t.setFittingOpen),A=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ia(),ue=vs().packs.slice(0,ws);P.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Bt=o.some(t=>t.category!=="emote"),{data:Me}=ra({queryKey:["upsell-listings"],queryFn:()=>ya({first:40}),staleTime:6e4}),{data:$}=oa(n),b=ca(),ee=ea(),{state:J}=ta(),[Rt,ie]=P.useState(null),[Qe,he]=P.useState(null),[Wt,_]=P.useState(!1),[B,H]=P.useState(null),Oe=P.useRef(0),[p,j]=P.useState(null),{data:pe}=da(n),{data:re}=cs(!0),[Te,He]=P.useState(""),oe=P.useRef(null),Ve=la(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Ft=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Lt=o.reduce((t,a)=>t+a.quantity,0),Kt=Ie.reduce((t,a)=>t+a.quantity,0),De=B?B.liveTotalCredits:Ft,Ut=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Ut.has(t.id)).slice(0,12),Nt=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Qt=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Qt,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ot=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Ht=ga,Vt=t=>xa(t.contractAddress,String(t.itemId));function me(t){t(),H(null),he(null),ie(null)}function Gt(){j(null),_(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];He(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),_(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.map(y=>({...y.item,priceCredits:y.priceCredits})),c=t.map(y=>({...y.item,priceCredits:y.priceCredits,quantity:y.quantity})),u=[];let h="authorize";const w=new Set,S=new Set,R=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if($s(M)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ms(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ls()&&!v)try{const m=new Map;f=await fs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>ys(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Be=>S.add(Be)),E.push(f[N])):C.reason instanceof vt||X.forEach(Be=>R.add(Be))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof bs))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>R.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>R.add(x))});t.forEach(m=>l(m.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),_(!1);const _e={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:_e,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!R.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),H(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),_(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),_(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),_(!1)}async function Dt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await gs({auth:{kind:xs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ds(ht.chainId),staleTime:6e4})}catch{return}}async function Yt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Yt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ot(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:R}=at(a,t);await st(S,R,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Jt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(fa(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=us(a,t),u=n?await hs(c,n.address).catch(()=>!0):!0;if(ps(n==null?void 0:n.providerType,u)){_(!1),fe({auth:c,run:d});return}d()}function Xt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>j({phase:"processing",stage:"settling",step:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await is({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=rs(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),R=os(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:_e}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:_e})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+R).toString()},await Dt(n.signer,g[0].trade.chainId);const F=()=>j({phase:"processing",stage:"settling",step:c.length,total:c.length});j({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const K=await Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),H(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),_(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await Cs(a,n.address,Ht,await et(),Vt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(An(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),H(null);return}if(c.orderChanged){H(c),Oe.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{_(!1)}}async function rt(){if(B){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-Oe.current>zn){H(null),he(null),await te();return}ie(null),tt(B.buyable)}}async function Zt(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}_(!0);try{const t=await js(Te,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}ee("/credits")}catch(t){try{sessionStorage.removeItem(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!ts("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Wt||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Ls,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ks,{children:[e.jsx(Us,{children:s("cart.empty.title")}),e.jsx(Ns,{children:s("cart.empty.body")})]}),e.jsx(Qs,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Rs,{children:[e.jsxs(Ws,{children:[e.jsxs(Fs,{children:[e.jsx(Os,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Hs,{children:s("cart.panelTitle",{count:Lt})}),Bt?e.jsxs(Vs,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Gs,{children:o.map(t=>{const a=Nt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,R=ua(t),E=!!R&&!!A[R],q=ha(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Ds,{"data-unavailable":g||void 0,children:[e.jsxs(Ys,{"data-thumb":!0,children:[q?e.jsx(Js,{to:q,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Xs,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(Zs,{children:[e.jsxs(en,{"data-desc":!0,children:[q?e.jsx(an,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(tn,{title:t.name,children:t.name}),t.creator?e.jsx(sn,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(xn,{"data-testid":"cart-creator-tag",children:[e.jsx(mn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(nn,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(hn,{children:[e.jsx(pn,{name:"warning-fill",size:24}),k]}),q?e.jsx(gn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(rn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(on,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(cn,{children:[e.jsx(dn,{})," ",S,c?e.jsx(ln,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(un,{children:[R?e.jsx(fn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:E?"heart-solid":"heart"})}):null,e.jsx(yn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(bn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(vn,{children:[e.jsx(wn,{children:s("cart.purchaseSummary")}),e.jsxs(Cn,{children:[e.jsxs(jn,{children:[e.jsx(kn,{children:s("cart.totalItems",{count:Kt})}),e.jsx(Sn,{children:e.jsxs($n,{children:[e.jsx(Mn,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:B?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(B?rt():te(t))}):e.jsx(Tn,{onClick:()=>void(B?rt():te()),disabled:V||Pe,children:V?s("cart.working"):B?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),B?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(In,{message:Rt})]})]})]})]}),Ye.length>0?e.jsx(Pn,{children:e.jsx(as,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ss,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:ns,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(qs,{phase:p.phase,balanceCredits:ge,onClose:Gt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:pa(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Jt(p).options:void 0,onPay:Xt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:He,onBuyPacks:()=>void Zt(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Jn as Cart};
|