@dcl/shop 0.1.0-30635983356.commit-a8e9459 → 0.1.0-30805756836.commit-b10a0ac
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-B4y9NUBI.js → Activity-G9zJvmPI.js} +1 -1
- package/_assets/{AnimatedBackground-CxADM-5J.js → AnimatedBackground-Cj9oFh-J.js} +1 -1
- package/_assets/{Assets-C3cWvBGe.js → Assets-mW5CCWG2.js} +2 -2
- package/_assets/{Assets.styles-SNOULQeJ.js → Assets.styles-Bgn_x0Ss.js} +1 -1
- package/_assets/{Authorizations-CvW5usoP.js → Authorizations-D1k47ikz.js} +1 -1
- package/_assets/Cart-BqOp14he.js +695 -0
- package/_assets/{CircularProgress-C8Q1J2_T.js → CircularProgress-CORSbufO.js} +1 -1
- package/_assets/{Collection-DZgMeY2J.js → Collection-CSLe2ejR.js} +1 -1
- package/_assets/{CollectionCarousel-d3gMIYq5.js → CollectionCarousel-D5pSydH6.js} +1 -1
- package/_assets/{Creator-C3IOB2-s.js → Creator-2epzTmnc.js} +1 -1
- package/_assets/{ErrorNotice-DYkIPemd.js → ErrorNotice-CGArNL-E.js} +1 -1
- package/_assets/{ExchangeController-C7C1Z5An.js → ExchangeController-DYht3_WE.js} +1 -1
- package/_assets/{GetCredits-BtFsihcb.js → GetCredits-CJokFm22.js} +1 -1
- package/_assets/{HelpersUtil-Ckmbyhof.js → HelpersUtil-BTNAIgt_.js} +1 -1
- package/_assets/{ImportListings-BpPDJWn3.js → ImportListings-D7uOag2_.js} +1 -1
- package/_assets/{ItemDetail-BKFZuj-Z.js → ItemDetail-D6AKzbeY.js} +3 -3
- package/_assets/{LoadMore-h8PnRe8Q.js → LoadMore-BaRMKeAe.js} +1 -1
- package/_assets/{MenuList-PMkEwZp8.js → MenuList-Cs4FBYPj.js} +1 -1
- package/_assets/{MyAssets-D68gkWlv.js → MyAssets-D5zEJUBI.js} +1 -1
- package/_assets/{MyFavorites-lzeuyPwU.js → MyFavorites-LArY6a-e.js} +1 -1
- package/_assets/{NotFound-DB_y_Z_s.js → NotFound-ByAg4XFz.js} +1 -1
- package/_assets/{NotificationsBell-CnmtrJ32.js → NotificationsBell-CGFRV5dg.js} +1 -1
- package/_assets/{StoreSettings-CGdGsXfM.js → StoreSettings-B-5h8khw.js} +1 -1
- package/_assets/{Success-BPa6R_y7.js → Success-WtdmYzqq.js} +1 -1
- package/_assets/{SwapController-DTaoSWcm.js → SwapController-B06dfOof.js} +1 -1
- package/_assets/{Tooltip-D6SxCt3L.js → Tooltip-BmUhsRQ4.js} +1 -1
- package/_assets/{TradeService-CWMA10hp.js → TradeService-BBaiKRjC.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-Up9j0_9e.js → W3MFrameProviderSingleton-DgVLAVdI.js} +3 -3
- package/_assets/{WebCryptoP256-DToW1FZN.js → WebCryptoP256-DgRMEbAt.js} +1 -1
- package/_assets/{authorizations-l2pjp6ra.js → authorizations-CF0Jz7zc.js} +1 -1
- package/_assets/{basic-Cty0Hn3n.js → basic-DhtfgC6H.js} +1 -1
- package/_assets/{biconomy-BNQq871u.js → biconomy-DDKaByAB.js} +1 -1
- package/_assets/{browseLayout.styles-BTdWCtmC.js → browseLayout.styles-B4v7hmwf.js} +1 -1
- package/_assets/{builder-Di3-_L-M.js → builder-ChhBoKFF.js} +1 -1
- package/_assets/buy-CmG8tf3H.js +1 -0
- package/_assets/buy-gasless-DSmUCqlW.js +1 -0
- package/_assets/{categories-CllZxtAd.js → categories-CSOiZzd4.js} +1 -1
- package/_assets/{ccip-D_VJyqVH.js → ccip-CJAvou1M.js} +1 -1
- package/_assets/{ccip-BqmnC0MC.js → ccip-LHlVm2wr.js} +1 -1
- package/_assets/{clsx-CWa7LSwg.js → clsx-ZCrIBec8.js} +1 -1
- package/_assets/{controller-NZEGD8Sk.js → controller-DwE4g_2M.js} +2 -2
- package/_assets/{core-Cf89Y33y.js → core-BA8_g96V.js} +4 -4
- package/_assets/{createSvgIcon-BMWFEF8o.js → createSvgIcon-Uk0jby9l.js} +1 -1
- package/_assets/{custom-DevxItCm.js → custom-nMD7l25w.js} +1 -1
- package/_assets/{data-capture-BfmytewB.js → data-capture-BVNWhwZ1.js} +1 -1
- package/_assets/{email-M7-J6szQ.js → email-BZ8uIRtY.js} +1 -1
- package/_assets/{embedded-wallet-wT68YqvA.js → embedded-wallet-DoNYzvwH.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-CUE0cLeS.js → emotion-styled.browser.esm-BFowzigV.js} +1 -1
- package/_assets/{engine-CfkuiYg8.js → engine-qPcXRd9M.js} +1 -1
- package/_assets/{errors-KUxsPjc1.js → errors-BSroDJv9.js} +1 -1
- package/_assets/{estimate-l1-fee-DgEDdWaG.js → estimate-l1-fee-_BDqdTd7.js} +1 -1
- package/_assets/{execute-CRHmgg19.js → execute-BQ1A-drl.js} +2 -2
- package/_assets/{features-Cg8KYE1g.js → features-Bf3CwXQj.js} +1 -1
- package/_assets/{fetchTokenMetadata-Brt7iJuI.js → fetchTokenMetadata-DM7mIFSO.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-DHwNkN-f.js → get-ecosystem-wallet-info-BxLHY-gg.js} +1 -1
- package/_assets/{getBalance-Coyl4v8z.js → getBalance-Cc1LECvV.js} +1 -1
- package/_assets/{getNFT-BKewD_XC.js → getNFT-C3N0w-oZ.js} +1 -1
- package/_assets/{getNFT-BhZQcTHF.js → getNFT-vfcV98co.js} +1 -1
- package/_assets/{getThemeProps-BleO2d8s.js → getThemeProps-KHmQwg_K.js} +1 -1
- package/_assets/{grid.styles-B_J9ea9g.js → grid.styles-DXgszB2_.js} +1 -1
- package/_assets/{hashTypedData-BbVOxwVx.js → hashTypedData-BNo5UTY9.js} +1 -1
- package/_assets/{hashTypedData-wikBKILq.js → hashTypedData-HULEGyjx.js} +1 -1
- package/_assets/{import-DRTXBO-H.js → import-ZIDUEKbG.js} +1 -1
- package/_assets/{in-app-B8k-OxsR.js → in-app-B9iICrzz.js} +1 -1
- package/_assets/{in-app-wallet-calls-D2yLkLKO.js → in-app-wallet-calls-CX2g12F1.js} +1 -1
- package/_assets/{index-BpH8IsVt.js → index-0j8XZkp-.js} +1 -1
- package/_assets/{index-BnwtKDC1.js → index-1d3-x1rh.js} +1 -1
- package/_assets/{index-DkW5d1J_.js → index-8LAOzxc6.js} +1 -1
- package/_assets/{index-D3KlXzVo.js → index-B3eXZooe.js} +1 -1
- package/_assets/{index-BTXvPglS.js → index-B7fpmmRp.js} +1 -1
- package/_assets/{index-BTCix11o.js → index-BDK-ARPZ.js} +1 -1
- package/_assets/{index-B4bY23Ch.js → index-BFwmcdNv.js} +1 -1
- package/_assets/{index-C7RAQf_k.js → index-BJ-5-45E.js} +1 -1
- package/_assets/{index-CvWiBNPK.js → index-BWz3it-f.js} +1 -1
- package/_assets/{index-Bfu_5Xfq.js → index-BcBsWJbF.js} +3 -3
- package/_assets/{index-DzmKFBug.js → index-Bj0T75Zb.js} +1 -1
- package/_assets/{index-DzyAcfNQ.js → index-BkjJan1L.js} +1 -1
- package/_assets/{index-a8qdptJt.js → index-Bm0tlsLz.js} +1 -1
- package/_assets/{index-BnUB8DIO.js → index-BmLor9GB.js} +1 -1
- package/_assets/{index-3TPWDixa.js → index-Bxc2_IRT.js} +1 -1
- package/_assets/{index-xLnNEcRT.js → index-BzrDs4Td.js} +1 -1
- package/_assets/{index-mJus6QV8.js → index-C037yeS-.js} +2 -2
- package/_assets/{index-D519dauQ.js → index-C0tjY7vU.js} +1 -1
- package/_assets/{index-BwMuQO6X.js → index-C4gV4KjJ.js} +1 -1
- package/_assets/{index-D1ByR6fU.js → index-C7lcq4Tv.js} +1 -1
- package/_assets/{index-Cuo7ZZaI.js → index-CEk6kTmL.js} +1 -1
- package/_assets/{index-B0ZCBL9f.js → index-CGETkZSz.js} +1 -1
- package/_assets/{index-DM1pntlB.js → index-CH1d-JeS.js} +1 -1
- package/_assets/{index-D-KNV28z.js → index-CNnBAXWS.js} +1 -1
- package/_assets/{index-BvfmNSpH.js → index-CSA4TC8H.js} +1 -1
- package/_assets/{index-SnatkYlW.js → index-CTgTPfau.js} +47 -47
- package/_assets/{index-CVuxedLW.js → index-CU_IDDYv.js} +1 -1
- package/_assets/{index-CJagtSlr.js → index-Cf5lMjiv.js} +1 -1
- package/_assets/{index-DBbdruUG.js → index-Cf7_dbcw.js} +1 -1
- package/_assets/{index-G3Ryecli.js → index-Cjy5_x2c.js} +1 -1
- package/_assets/{index-C2epIPF0.js → index-CnbvqgkW.js} +1 -1
- package/_assets/{index-BBqenras.js → index-CtBrQu_x.js} +1 -1
- package/_assets/{index-O5vqGJvg.js → index-CyssULnt.js} +2 -2
- package/_assets/{index-a5E5obaq.js → index-DD02_fiR.js} +1 -1
- package/_assets/{index-BEZy2kiZ.js → index-DDer0-bc.js} +1 -1
- package/_assets/{index-CTNKpIIA.js → index-DbyCzlir.js} +2 -2
- package/_assets/{index-CVyf8XnA.js → index-Di2SThjr.js} +1 -1
- package/_assets/{index-CErJOCk2.js → index-DiV5E2Po.js} +1 -1
- package/_assets/{index-BnCW_xNv.js → index-DlHvoEXp.js} +1 -1
- package/_assets/{index-_V3tt-3H.js → index-Ds5bxoqI.js} +3 -3
- package/_assets/{index-BNwHqnqL.js → index-DsBlZ8tD.js} +1 -1
- package/_assets/{index-B0lxP1DD.js → index-FmQQUGYi.js} +1 -1
- package/_assets/{index-Cw6JZm5x.js → index-G3mcVVeX.js} +1 -1
- package/_assets/{index-B8V1K3Kv.js → index-Tgg_ps7g.js} +1 -1
- package/_assets/{index-BWiYg5Rl.js → index-ULQalB3y.js} +1 -1
- package/_assets/{index-BvtRZe5k.js → index-Uq1rqDyA.js} +1 -1
- package/_assets/{index-CndgbGyL.js → index-VRxHxxdJ.js} +1 -1
- package/_assets/{index-BfbzCqVh.js → index-mxM_6Uej.js} +1 -1
- package/_assets/{index-BasWfxS1.js → index-w_HUbD8-.js} +3 -3
- package/_assets/{index-6PDE0uos.js → index-yRkhEq4H.js} +1 -1
- package/_assets/{index-NvkQ05pR.js → index-yvV-m3yt.js} +1 -1
- package/_assets/{index.es-Ssx_pD4W.js → index.es-BB0mhjKh.js} +1 -1
- package/_assets/{index.es-DJ2J7PmC.js → index.es-Cq9-SMU6.js} +1 -1
- package/_assets/{index.es-Dmr4kGvf.js → index.es-DCMF5xca.js} +4 -4
- package/_assets/{localBatchGatewayRequest-DQ23aY3O.js → localBatchGatewayRequest-B7JF9w3d.js} +1 -1
- package/_assets/{mana-convert-BfTFhCWx.js → mana-convert-BLzyDqwI.js} +1 -1
- package/_assets/{mana-rate-DQvXAW-r.js → mana-rate-BuRu4Dbb.js} +1 -1
- package/_assets/{networks-Blk7C537.js → networks-DYC4Jira.js} +1 -1
- package/_assets/{onramp-BviXYSBr.js → onramp-lB0gtFXb.js} +1 -1
- package/_assets/{openzeppelin-6dKRPdCc.js → openzeppelin-DczPwLsZ.js} +1 -1
- package/_assets/{parseNft-CtRKTWE9.js → parseNft-Xx1jcq1t.js} +2 -2
- package/_assets/{parseSignature-DLEbnOTW.js → parseSignature-B_ywiUgW.js} +3 -3
- package/_assets/{parseSignature-BINJ7GPa.js → parseSignature-CvsR0nWX.js} +1 -1
- package/_assets/{passkeys-Bmwq8w9j.js → passkeys-BorDfQEt.js} +1 -1
- package/_assets/{pay-with-exchange-BGI4bEs2.js → pay-with-exchange-D-lAYAST.js} +1 -1
- package/_assets/{qr-overlay-Bf6_zg17.js → qr-overlay-8uLAtEic.js} +1 -1
- package/_assets/{receive-A7FcFUgY.js → receive-BjdE5CiW.js} +1 -1
- package/_assets/{resolveImplementation-BEP8PoBl.js → resolveImplementation-BTVpSr1L.js} +1 -1
- package/_assets/{rpc-Cz8kqv2P.js → rpc-B0EzNjPI.js} +1 -1
- package/_assets/{secp256k1-COS0u8tH.js → secp256k1-C3Bgsx-A.js} +1 -1
- package/_assets/{secp256k1-DkfX7UfL.js → secp256k1-GAuYrMZg.js} +1 -1
- package/_assets/{secp256k1-BICKEbsl.js → secp256k1-QiPyD_fs.js} +1 -1
- package/_assets/{send-C1bOQmru.js → send-BNKRlWjs.js} +1 -1
- package/_assets/{send-batch-transaction-CTKHdu5I.js → send-batch-transaction-Ct4Z2yZa.js} +1 -1
- package/_assets/{send-eip712-transaction-xrNQTMCo.js → send-eip712-transaction-DUKkJwby.js} +2 -2
- package/_assets/{send-gasless-transaction-Ct7GIvVu.js → send-gasless-transaction-CLZsc_C3.js} +2 -2
- package/_assets/{send-transaction-D32Nt_MU.js → send-transaction-DjedQNrB.js} +2 -2
- package/_assets/{sendMetaTransaction-BazAYyjj.js → sendMetaTransaction-Bwds-XF_.js} +1 -1
- package/_assets/{sendRawTransaction-B7gCMfmV.js → sendRawTransaction-CYzsBrK5.js} +3 -3
- package/_assets/{serializeTransaction-CDMVosJ8.js → serializeTransaction-DJcAcQb3.js} +1 -1
- package/_assets/{session-proposal-C7FOdfm-.js → session-proposal-B-D3yWr1.js} +1 -1
- package/_assets/{session-request-Bbpt6ucy.js → session-request-CFw9hsoK.js} +2 -2
- package/_assets/{signing-DHE_GQfk.js → signing-3yV1YTdS.js} +3 -3
- package/_assets/{socials-yuX7-67Q.js → socials-Ux_0_Guq.js} +1 -1
- package/_assets/{swaps-DVEpS93p.js → swaps-Du_IonW5.js} +1 -1
- package/_assets/{thirdweb-DTL_1hCo.js → thirdweb-Dto6kXDX.js} +3 -3
- package/_assets/{to-serializable-transaction-BvJIy5Zl.js → to-serializable-transaction-CCJZxhM6.js} +2 -2
- package/_assets/{trade-encoding-27XruNjb.js → trade-encoding-C5_Qc6q5.js} +1 -1
- package/_assets/{transactionReceipt-BjbJcaw1.js → transactionReceipt-BUOeDR9-.js} +1 -1
- package/_assets/{transactions-CK838wy6.js → transactions-CIX4Ko-U.js} +1 -1
- package/_assets/useCreditPacks-DuYdU54_.js +1 -0
- package/_assets/{useInfiniteGrid-BtKbEsLc.js → useInfiniteGrid-GTSHBqBp.js} +1 -1
- package/_assets/useManaRate-CAVBb8P6.js +1 -0
- package/_assets/{useSecondarySales-H09-0v6A.js → useSecondarySales-keni21Uk.js} +1 -1
- package/_assets/{useStore-C3kED1kY.js → useStore-CNlO4piy.js} +1 -1
- package/_assets/{useTheme-DvS9QiwE.js → useTheme-ucfeAXGm.js} +1 -1
- package/_assets/{verifyHash-3R0ho2ZX.js → verifyHash-G83SSWVH.js} +1 -1
- package/_assets/{w3m-modal-CbE-vkW2.js → w3m-modal-D0kzWk0t.js} +1 -1
- package/_assets/{w3m-modal-DFuSKjsw.js → w3m-modal-K2V3STJK.js} +1 -1
- package/_assets/{wait-for-tx-receipt-BCDL4fay.js → wait-for-tx-receipt-nSP3CsF4.js} +1 -1
- package/_assets/{wallets-B239PApP.js → wallets-CHRtCYWT.js} +5 -5
- package/_assets/{web-connector-Io0X-xXE.js → web-connector-CIcgciEI.js} +3 -3
- package/_assets/{writeContract-CjmZVeKM.js → writeContract-Bu8cH2_h.js} +1 -1
- package/_assets/{zoraTestnet-CKPGiW2H.js → zoraTestnet-B4HBXh-2.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Cart-4EoClBeZ.js +0 -695
- package/_assets/buy-Ac54hNqf.js +0 -1
- package/_assets/buy-gasless-Lul2eVlm.js +0 -1
- package/_assets/useCreditPacks-DBXU0y25.js +0 -1
- package/_assets/useManaRate-Bl28IAka.js +0 -1
package/_assets/Cart-4EoClBeZ.js
DELETED
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
import{j as e,L as be,r as S,b as Ht,a as Vt}from"./react-vyZjIDcS.js";import{t as ne,s as i,e as s,J as se,aj as Gt,G as Dt,I as W,z as bt,H as Re,m as Yt,ak as R,Q as nt,n as Jt,u as Xt,al as Zt,E as ea,am as ta,an as aa,ao as sa,ap as na,y as ia,aq as it,ar as O,as as rt,at as ra,l as J,c as ot,au as oa,h as ca,av as ct,aw as Ie,ax as ze,ay as he,az as dt,a as pe,b as da,C as Ae,aA as la}from"./index-SnatkYlW.js";import{M as ua,S as ha,C as pa,H as ga,a as xa,T as ma,X as fa,b as ya,B as ba,c as va,d as lt,e as wa,f as fe,P as vt,m as Ca,g as ja,h as ka,i as $a,j as wt,k as ye,L as Sa,l as Ma,n as ut,o as ht,W as Ta,p as Pa,q as Ia,A as za,r as Aa,s as qa,t as _a,u as Ba,v as Ea,w as Ra,x as Wa,y as Fa,z as La,D as Ka,E as Na,F as Qa,G as Ua,I as Oa,J as Ha,K as qe,N as Va,O as Ga,Q as Da,R as Ya,U as pt,V as Ja,Y as Xa,Z as Za,_ as es}from"./CollectionCarousel-d3gMIYq5.js";import{u as ts}from"./useManaRate-Bl28IAka.js";import{r as as}from"./mana-rate-DQvXAW-r.js";import{i as ss,j as ns,f as is,n as rs,h as os,A as cs}from"./authorizations-l2pjp6ra.js";import{g as ds,b as _e}from"./buy-Ac54hNqf.js";import{b as ls,w as us,S as hs,G as ps}from"./buy-gasless-Lul2eVlm.js";import{u as gs,M as xs,R as ge,r as ms,c as fs}from"./useCreditPacks-DBXU0y25.js";import{i as ys,a as bs}from"./errors-KUxsPjc1.js";import{E as vs}from"./ErrorNotice-DYkIPemd.js";import{u as gt}from"./mana-convert-BfTFhCWx.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-27XruNjb.js";import"./sendMetaTransaction-BazAYyjj.js";const{colors:X,radius:ws}=ne,Cs=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
`,js=i.span`
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 22px;
|
|
10
|
-
color: ${X.text2};
|
|
11
|
-
text-transform: capitalize;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
`,ks=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 ${X.media};
|
|
27
|
-
|
|
28
|
-
&::-webkit-scrollbar {
|
|
29
|
-
width: 8px;
|
|
30
|
-
}
|
|
31
|
-
&::-webkit-scrollbar-track {
|
|
32
|
-
background: ${X.media};
|
|
33
|
-
border-radius: 10px;
|
|
34
|
-
}
|
|
35
|
-
&::-webkit-scrollbar-thumb {
|
|
36
|
-
background: #a2a2a2;
|
|
37
|
-
border-radius: ${ws.btn};
|
|
38
|
-
}
|
|
39
|
-
`,$s=i.span`
|
|
40
|
-
margin-left: 8px;
|
|
41
|
-
font-size: 13px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
color: ${X.muted};
|
|
44
|
-
`,Ss=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: ${X.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: ${X.text};
|
|
60
|
-
}
|
|
61
|
-
`,Ms="https://cdn.decentraland.org/@dcl/shop/0.1.0-30635983356.commit-a8e9459/_assets/buy-error-22UunaPC.png";function Ts(o){const{phase:l,balanceCredits:$,onClose:M}=o,q=l==="processing",L=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),K=l==="processing";return e.jsxs(ua,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(ha,{onClick:q?void 0:M,"aria-hidden":!0}),e.jsxs(pa,{"data-tall":K||void 0,children:[e.jsxs(ga,{children:[e.jsxs(xa,{children:[e.jsx(ma,{children:L}),!q&&e.jsx(fa,{onClick:M,"aria-label":s("buyModal.close"),children:e.jsx(ya,{})})]}),e.jsxs(ba,{children:[e.jsx(va,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(lt,{}),e.jsx(wa,{children:se($)})]})]}),l==="choose"&&e.jsxs(fe,{children:[e.jsxs(Ss,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(lt,{}),se(o.totalCredits??0)]})]}),e.jsx(vt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const T=Ca(o.totalCents??0,o.totalManaWei??0n);return T!=null?s("buyModal.manaRate",{mana:T.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Ps,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Is,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:M}),l==="error"&&e.jsxs(fe,{children:[e.jsxs(ja,{"data-testid":"buy-error",children:[e.jsx(ka,{src:Ms,alt:"",width:64,height:80}),e.jsxs($a,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",s("cartCheckout.errorBody")]})]}),e.jsxs(wt,{children:[e.jsx(ye,{"data-variant":"outline",onClick:M,children:s("buyModal.cancel")}),e.jsx(ye,{"data-variant":"purple",onClick:o.onRetry??M,children:s("cartCheckout.tryAgain")})]})]})]})]})}function Ps({stage:o,step:l,total:$,isSelfCustody:M,signatures:q}){const L=o==="reserving",K=$>0?Math.min(100,Math.round(l/$*100)):0,T=M&&q&&q.total>1,Z=o==="awaiting-signature"?M?T?s("cartCheckout.confirmMultiple",{current:q.current,total:q.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(fe,{"data-processing":!0,children:[e.jsx(Sa,{src:Gt,alt:"",width:61,height:61}),e.jsx(Ma,{children:Z}),L?e.jsxs(Cs,{children:[e.jsx(ut,{"aria-hidden":!0,children:e.jsx(ht,{"data-step":!0,style:{width:`${K}%`}})}),$>1?e.jsxs(js,{children:[l,"/",$]}):null]}):e.jsx(ut,{"aria-hidden":!0,children:e.jsx(ht,{})})]})}function Is({lines:o,shortfallCredits:l,packs:$,selectedPack:M,onSelectPack:q,onBuyPacks:L,onCancel:K}){const T=$.find(n=>n.id===M),Z=o.reduce((n,E)=>n+(E.quantity??1),0);return e.jsxs(fe,{children:[e.jsxs(Ta,{"data-testid":"nofunds-warning",children:[e.jsx(Pa,{}),e.jsxs(Ia,{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:Z})]})]}),e.jsx(ks,{children:o.map(n=>{const E=n.quantity??1;return e.jsxs(za,{children:[e.jsx(Aa,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(qa,{children:[e.jsxs("div",{children:[e.jsxs(_a,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),E>1?e.jsx($s,{children:s("cartCheckout.qty",{count:E})}):null]}),n.item.creator?e.jsx(Ba,{address:n.item.creator}):null]}),e.jsxs(Ea,{children:[e.jsx(Ra,{}),e.jsx("span",{children:se(n.priceCredits*E)})]})]})]},n.item.id)})}),e.jsx(Wa,{children:$.map(n=>{const E=n.id===M;return e.jsxs(Fa,{"data-testid":"credit-pack","data-on":E||void 0,onClick:()=>q(n.id),children:[e.jsx(La,{}),e.jsx(Ka,{children:se(n.credits)}),e.jsxs(Na,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Qa,{children:[e.jsxs(Ua,{children:[e.jsx(Oa,{}),e.jsx("span",{children:se((T==null?void 0:T.credits)??0)})]}),e.jsxs(Ha,{children:["$",((T==null?void 0:T.usd)??0).toFixed(2)]})]}),e.jsxs(wt,{children:[e.jsx(ye,{"data-variant":"outline",onClick:K,children:s("buyModal.cancel")}),e.jsx(ye,{"data-variant":"gradient",onClick:L,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Ct,radius:H}=ne,jt="@media (max-width: 1080px)",k="@media (max-width: 880px)",xt=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
|
-
${k} {
|
|
72
|
-
padding-bottom: 188px; /* room for the fixed summary bar */
|
|
73
|
-
}
|
|
74
|
-
`,mt=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
|
-
${k} {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
`,zs=i.div`
|
|
102
|
-
display: grid;
|
|
103
|
-
grid-template-columns: minmax(0, 1fr) 615px;
|
|
104
|
-
gap: 24px;
|
|
105
|
-
align-items: start;
|
|
106
|
-
|
|
107
|
-
${jt} {
|
|
108
|
-
grid-template-columns: 1fr;
|
|
109
|
-
}
|
|
110
|
-
`,ft=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
|
-
${k} {
|
|
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
|
-
`,As=i.div`
|
|
124
|
-
min-width: 0;
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-direction: column;
|
|
127
|
-
gap: 12px;
|
|
128
|
-
`,qs=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
|
-
${k} {
|
|
138
|
-
gap: 8px;
|
|
139
|
-
padding: 12px;
|
|
140
|
-
}
|
|
141
|
-
`,kt=i.section`
|
|
142
|
-
min-width: 0;
|
|
143
|
-
background: ${r.white};
|
|
144
|
-
border-radius: 16px;
|
|
145
|
-
padding: 24px;
|
|
146
|
-
|
|
147
|
-
${k} {
|
|
148
|
-
padding: 16px;
|
|
149
|
-
}
|
|
150
|
-
`,_s=i(kt)`
|
|
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
|
-
${ne.media.maxWidth("mobile")} {
|
|
162
|
-
min-height: 320px;
|
|
163
|
-
padding: 32px 16px;
|
|
164
|
-
}
|
|
165
|
-
`,Bs=i.div`
|
|
166
|
-
display: flex;
|
|
167
|
-
flex-direction: column;
|
|
168
|
-
align-items: center;
|
|
169
|
-
gap: 12px;
|
|
170
|
-
padding-bottom: 16px;
|
|
171
|
-
`,Es=i.p`
|
|
172
|
-
margin: 0;
|
|
173
|
-
font-size: 24px;
|
|
174
|
-
font-weight: 700;
|
|
175
|
-
line-height: 1.6;
|
|
176
|
-
|
|
177
|
-
${ne.media.maxWidth("mobile")} {
|
|
178
|
-
font-size: 20px;
|
|
179
|
-
}
|
|
180
|
-
`,Rs=i.p`
|
|
181
|
-
margin: 0;
|
|
182
|
-
font-size: 20px;
|
|
183
|
-
font-weight: 400;
|
|
184
|
-
line-height: 1.6;
|
|
185
|
-
|
|
186
|
-
${ne.media.maxWidth("mobile")} {
|
|
187
|
-
font-size: 16px;
|
|
188
|
-
}
|
|
189
|
-
`,Ws=i(be)`
|
|
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: ${H.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
|
-
`,Fs=i.button`
|
|
216
|
-
display: none;
|
|
217
|
-
|
|
218
|
-
${k} {
|
|
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
|
-
`,Ls=i.h1`
|
|
234
|
-
margin: 0;
|
|
235
|
-
font-size: 14px;
|
|
236
|
-
font-weight: 600;
|
|
237
|
-
line-height: 1.57;
|
|
238
|
-
color: ${r.text};
|
|
239
|
-
|
|
240
|
-
${k} {
|
|
241
|
-
flex: 1;
|
|
242
|
-
min-width: 0;
|
|
243
|
-
font-size: 16px;
|
|
244
|
-
}
|
|
245
|
-
`,Ks=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: ${H.btn};
|
|
254
|
-
background:
|
|
255
|
-
linear-gradient(${r.white}, ${r.white}) padding-box,
|
|
256
|
-
${Ct.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
|
-
${k} {
|
|
281
|
-
height: 36px;
|
|
282
|
-
padding: 0 10px;
|
|
283
|
-
font-size: 12px;
|
|
284
|
-
}
|
|
285
|
-
`,Ns=i.div`
|
|
286
|
-
display: flex;
|
|
287
|
-
flex-direction: column;
|
|
288
|
-
gap: 24px;
|
|
289
|
-
`,Qs=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: ${H.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
|
-
`,Us=i.div`
|
|
309
|
-
position: relative;
|
|
310
|
-
flex-shrink: 0;
|
|
311
|
-
width: 137.5px;
|
|
312
|
-
height: 137px;
|
|
313
|
-
background: ${r.media};
|
|
314
|
-
border-radius: ${H.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
|
-
${k} {
|
|
327
|
-
width: 120px;
|
|
328
|
-
height: 120px;
|
|
329
|
-
}
|
|
330
|
-
`,Os=i(be)`
|
|
331
|
-
position: absolute;
|
|
332
|
-
inset: 0;
|
|
333
|
-
display: grid;
|
|
334
|
-
place-items: center;
|
|
335
|
-
`,Hs=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
|
-
`,Vs=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
|
-
${k} {
|
|
355
|
-
padding: 12px 4px 12px 0;
|
|
356
|
-
}
|
|
357
|
-
`,Gs=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
|
-
`,$t=Re`
|
|
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
|
-
${k} {
|
|
379
|
-
white-space: normal;
|
|
380
|
-
display: -webkit-box;
|
|
381
|
-
-webkit-line-clamp: 2;
|
|
382
|
-
line-clamp: 2;
|
|
383
|
-
-webkit-box-orient: vertical;
|
|
384
|
-
}
|
|
385
|
-
`,Ds=i.div`
|
|
386
|
-
${$t};
|
|
387
|
-
`,Ys=i(be)`
|
|
388
|
-
${$t};
|
|
389
|
-
`,Js=i(Dt)`
|
|
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
|
-
`,Xs=i.div`
|
|
402
|
-
display: flex;
|
|
403
|
-
align-items: center;
|
|
404
|
-
justify-content: space-between;
|
|
405
|
-
gap: 12px;
|
|
406
|
-
padding-right: 8px;
|
|
407
|
-
`,Zs=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: ${H.pill};
|
|
414
|
-
`,yt=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
|
-
`,en=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
|
-
`,tn=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
|
-
${k} {
|
|
448
|
-
font-size: 20px;
|
|
449
|
-
}
|
|
450
|
-
`,an=i(bt)`
|
|
451
|
-
width: 24px;
|
|
452
|
-
height: 24px;
|
|
453
|
-
background: ${r.text};
|
|
454
|
-
|
|
455
|
-
${k} {
|
|
456
|
-
width: 20px;
|
|
457
|
-
height: 20px;
|
|
458
|
-
}
|
|
459
|
-
`,sn=i.span`
|
|
460
|
-
margin-left: 6px;
|
|
461
|
-
font-size: 14px;
|
|
462
|
-
font-weight: 500;
|
|
463
|
-
color: ${r.muted};
|
|
464
|
-
text-decoration: line-through;
|
|
465
|
-
`,nn=i.div`
|
|
466
|
-
position: absolute;
|
|
467
|
-
top: 9px;
|
|
468
|
-
right: 7px;
|
|
469
|
-
display: flex;
|
|
470
|
-
align-items: flex-start;
|
|
471
|
-
gap: 12px;
|
|
472
|
-
`,rn=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
|
-
`,on=i(W)`
|
|
482
|
-
color: #f48221;
|
|
483
|
-
`,cn=i(be)`
|
|
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
|
-
`,dn=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: ${H.chip};
|
|
506
|
-
background: #f4e9ff;
|
|
507
|
-
font-size: 10px;
|
|
508
|
-
font-weight: 400;
|
|
509
|
-
line-height: 14px;
|
|
510
|
-
color: ${r.text};
|
|
511
|
-
`,ln=i(W)`
|
|
512
|
-
width: 11.31px;
|
|
513
|
-
height: 10.94px;
|
|
514
|
-
background: ${r.text};
|
|
515
|
-
`,St=Re`
|
|
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
|
-
`,un=i.button`
|
|
532
|
-
${St};
|
|
533
|
-
|
|
534
|
-
&:hover:not(:disabled) {
|
|
535
|
-
color: ${r.text};
|
|
536
|
-
}
|
|
537
|
-
&[data-on] {
|
|
538
|
-
color: ${r.dclRed};
|
|
539
|
-
}
|
|
540
|
-
`,hn=i.button`
|
|
541
|
-
${St};
|
|
542
|
-
|
|
543
|
-
&:hover:not(:disabled) {
|
|
544
|
-
color: ${r.dclRed};
|
|
545
|
-
}
|
|
546
|
-
`,pn=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
|
-
`,gn=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
|
-
${jt} {
|
|
570
|
-
position: static;
|
|
571
|
-
}
|
|
572
|
-
${k} {
|
|
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
|
-
`,xn=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
|
-
${k} {
|
|
592
|
-
margin-bottom: 12px;
|
|
593
|
-
padding-bottom: 12px;
|
|
594
|
-
}
|
|
595
|
-
`,mn=i.div`
|
|
596
|
-
display: flex;
|
|
597
|
-
flex-direction: column;
|
|
598
|
-
gap: 12px;
|
|
599
|
-
`,fn=i.div`
|
|
600
|
-
display: flex;
|
|
601
|
-
align-items: flex-start;
|
|
602
|
-
justify-content: space-between;
|
|
603
|
-
gap: 12px;
|
|
604
|
-
`,yn=i.span`
|
|
605
|
-
font-size: 14px;
|
|
606
|
-
font-weight: 600;
|
|
607
|
-
line-height: 1.57;
|
|
608
|
-
color: ${r.muted1};
|
|
609
|
-
`,bn=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
|
-
`,vn=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 wn=i(bt)`
|
|
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
|
-
`,Cn=i.button`
|
|
636
|
-
width: 100%;
|
|
637
|
-
height: 56px;
|
|
638
|
-
border: 0;
|
|
639
|
-
border-radius: ${H.btn};
|
|
640
|
-
background: ${Ct.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
|
-
`,Mt=Re`
|
|
662
|
-
margin: 0;
|
|
663
|
-
font-size: 13px;
|
|
664
|
-
`,xe=i.p`
|
|
665
|
-
${Mt};
|
|
666
|
-
`,jn=i(vs)`
|
|
667
|
-
${Mt};
|
|
668
|
-
`,kn=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 Be(o){if(ys(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:ca.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const $n=12e4;function Sn(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 Ee=o=>o.reduce((l,$)=>l+$.priceCredits*$.quantity,0),me=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function On(){Yt({title:s("nav.cart"),noindex:!0});const o=R(t=>t.items),l=R(t=>t.remove),$=R(t=>t.increment),M=R(t=>t.decrement),q=R(t=>t.clear),L=R(t=>t.restore),K=R(t=>t.setFittingOpen),T=nt(t=>t.items),Z=nt(t=>t.toggle),{session:n,signIn:E}=Jt(),ie=gs().packs.slice(0,xs);S.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const Tt=o.some(t=>t.category!=="emote"),{data:ve}=Xt({queryKey:["upsell-listings"],queryFn:()=>la({first:40}),staleTime:6e4}),{data:b}=Zt(n),f=ea(),V=Ht(),{state:N}=Vt(),[Pt,ee]=S.useState(null),[We,re]=S.useState(null),[It,_]=S.useState(!1),[I,Q]=S.useState(null),Fe=S.useRef(0),[p,v]=S.useState(null),{data:oe}=ta(n),{data:te}=ts(!0),[we,Le]=S.useState(""),ae=S.useRef(null),Ke=aa(o),Ne=t=>it(Ke[t.id]),Ce=o.filter(Ne),je=o.length>0&&Ce.length===0,zt=Ce.reduce((t,a)=>t+a.priceCredits*a.quantity,0),At=o.reduce((t,a)=>t+a.quantity,0),qt=Ce.reduce((t,a)=>t+a.quantity,0),Qe=I?I.liveTotalCredits:zt,_t=new Set(o.map(t=>t.id)),Ue=((ve==null?void 0:ve.items)??[]).filter(t=>!_t.has(t.id)).slice(0,12),Bt=new Map(I==null?void 0:I.buyable.map(t=>[t.item.id,t])),ce=(b==null?void 0:b.credits)??0,ke=Qe*10,Et=te?gt(ke,te):0n,de=qe({priceCents:ke,priceManaWei:Et,balanceCents:(b==null?void 0:b.balanceCents)??0,manaBalanceWei:oe??0n}),Rt=t=>t.some(a=>a.acquisition==="store"),$e=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Wt=ra,Ft=t=>oa(t.contractAddress,String(t.itemId));function le(t){t(),Q(null),re(null),ee(null)}function Lt(){v(null),_(!1)}function Oe(t){const a=Ee(t),d=Math.max(0,a-ce),c=ie.find(u=>u.credits>=d)??ie[ie.length-1];Le(c.id),O("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ce,shortfall:d}),v({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),_(!1)}async function Se(t){if(!n||t.length===0)return;const a=me(t),d=a.map(g=>({...g.item,priceCredits:g.priceCredits})),c=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let h="authorize",w=!1;v({phase:"processing",stage:"reserving",step:1,total:a.length});try{const g=[];for(let m=0;m<a.length;m++){const y=a[m];v({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const B=y.acquisition==="trade"?y.trade.id:void 0,Te=y.item.contractAddress&&y.item.itemId!=null?{contractAddress:y.item.contractAddress,itemId:String(y.item.itemId)}:void 0,{credit:Pe,maxCreditedValue:st}=await ct(n.identity,y.usdCents,B,Te);u.push(Pe.id),g.push(y.acquisition==="store"?{kind:"store",item:{collection:y.item.contractAddress,itemId:String(y.item.itemId),priceWei:y.priceWei},credits:[Pe],maxCreditedValue:st,chainId:y.item.chainId}:{kind:"trade",trade:y.trade,credits:[Pe],maxCreditedValue:st})}catch(B){if(bs(B)){if(u.length){try{await Ie(n.identity,u)}catch(Te){J(Te,{flow:"cart_checkout",step:"release"})}f.invalidateQueries({queryKey:["usd-balance"]})}Oe(t);return}throw B}}h="submit";const C=ds(g).length,z=m=>C>1?{current:m,total:C}:void 0,x=(m,y)=>v({phase:"processing",stage:m,step:a.length,total:a.length,signatures:z(y)}),j=m=>m<C?x("awaiting-signature",m+1):x("settling",C);x("awaiting-signature",1);let A=[];const D=g.some(m=>m.kind==="store"),P=g.flatMap(m=>m.kind==="trade"?[m]:[]);if(ss()&&!D)try{A=await ls({purchases:P,buyer:n.address,signer:n.signer,onSigned:()=>j(C)});const y=(await Promise.allSettled(A.map(B=>us(B)))).flatMap(B=>B.status==="rejected"?[B.reason]:[]);if(y.length&&!y.some(B=>B instanceof hs))throw y[0];w=!0}catch(m){if(!(m instanceof ps))throw m;A=await _e({purchases:g,buyer:n.address,signer:n.signer,onSigned:j})}else A=await _e({purchases:g,buyer:n.address,signer:n.signer,onSigned:j});t.forEach(m=>l(m.item.id)),Q(null),O("Shop Completed Purchase",{...ze(d),payment_type:"credits",no_crypto_step:w,transaction_hash:A[0]??null}),Ja(f);const U=ae.current;ae.current=null,v(null),_(!1);const Y={items:c,txHash:A[0]??void 0,txHashes:A,settled:!0,...U?{creditsAdded:U}:{}};V("/success",{state:Y,replace:!0})}catch(g){if(he(g)||J(g,{flow:"cart_checkout",step:h,cart_size:t.length}),O(he(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:dt(g),value_usd:rt(d.reduce((C,z)=>C+z.priceCredits,0)),cart_size:a.length}),u.length){try{await Ie(n.identity,u)}catch(C){J(C,{flow:"cart_checkout",step:"release"})}f.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:Be(g)})}}function He(t,a){f.invalidateQueries({queryKey:["usd-balance"]}),f.invalidateQueries({queryKey:["detail-trade"]}),f.invalidateQueries({queryKey:["shop-item"]}),f.invalidateQueries({queryKey:["owned-token"]}),f.invalidateQueries({queryKey:["public-token"]}),f.invalidateQueries({queryKey:["item-resales"]}),f.invalidateQueries({queryKey:["shop-items"]}),f.invalidateQueries({queryKey:["catalog-items"]}),f.invalidateQueries({queryKey:["my-assets"]}),f.invalidateQueries({queryKey:["purchases"]}),f.invalidateQueries({queryKey:["owned-item-count"]}),f.invalidateQueries({queryKey:["overview-listings"]}),f.invalidateQueries({queryKey:["upsell-listings"]});const d=ae.current;ae.current=null,v(null),_(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};V("/success",{state:c,replace:!0})}function Ve(t,a){he(t)||J(t,{flow:a,step:"submit"}),O(he(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:dt(t)}),v({phase:"error",message:Be(t)}),_(!1)}async function Kt(t,a){const d=pe(Ae.MANAToken,a),c=pe(Ae.CreditsManager,a);await os({auth:{kind:cs.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function Ge(){if(te)return te;try{return await f.fetchQuery({queryKey:["mana-rate",ot.chainId],queryFn:()=>as(ot.chainId),staleTime:6e4})}catch{return}}async function Nt(t){const a=me(t).reduce((h,w)=>h+w.usdCents,0),c=(oe??0n)>0n?await Ge():te,u=c?gt(a,c):0n;return{totalCents:a,manaWei:u}}async function De(t,a){const d=Ee(t),{totalCents:c,manaWei:u}=await Nt(t),h=qe({priceCents:c,priceManaWei:u,balanceCents:(b==null?void 0:b.balanceCents)??0,manaBalanceWei:oe??0n}),w=Rt(t)?{...h,options:h.options.filter(g=>g.method==="credits")}:h;if(a&&w.options.some(g=>g.method===a)){if(a==="credits"){Se(t);return}const{spender:g,chainId:C}=Ye(a,t);await Je(g,C,()=>a==="mana"?void Xe(t):void Ze(t,c,u));return}if(w.options.some(g=>g.method==="mana"||g.method==="combined")){v({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if(b!=null&&b.credits<d){Oe(t);return}Se(t)}function Qt(t){return qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(b==null?void 0:b.balanceCents)??0,manaBalanceWei:oe??0n})}const[Me,ue]=S.useState(null);function Ye(t,a){const d=$e(a)[0].trade;return{spender:t==="mana"?pe(da(d.contract),d.chainId).address:pe(Ae.CreditsManager,d.chainId).address,chainId:d.chainId}}async function Je(t,a,d){const c=ns(a,t),u=n?await is(c,n.address).catch(()=>!0):!0;if(rs(n==null?void 0:n.providerType,u)){_(!1),ue({auth:c,run:d});return}d()}function Ut(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Se(a);return}const{spender:u,chainId:h}=Ye(t,a);Je(u,h,()=>t==="mana"?void Xe(a):void Ze(a,d,c))}async function Xe(t){if(!n||t.length===0)return;const a=me(t),d=a.map(h=>({...h.item,priceCredits:h.priceCredits})),c=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>v({phase:"processing",stage:"settling",step:a.length,total:a.length});v({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await Xa({trades:$e(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),Q(null),O("Shop Completed Purchase",{...ze(d),payment_type:"mana",transaction_hash:h[0]??null}),f.invalidateQueries({queryKey:["mana-balance"]}),He(c,h)}catch(h){Ve(h,"buy_cart_mana")}}async function Ze(t,a,d){if(!n||t.length===0)return;const c=me(t),u=c.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),w=Za(c.map(x=>x.usdCents),(b==null?void 0:b.balanceCents)??0),g=w.reduce((x,j)=>x+j,0),C=es(Math.max(0,a-g),a,d),z=[];v({phase:"processing",stage:"reserving",step:1,total:c.length});try{const x=$e(c),j=[];for(let P=0;P<x.length;P++){const U=w[P];if(U<=0)continue;v({phase:"processing",stage:"reserving",step:P+1,total:x.length});const Y=x[P].item,{credit:m,maxCreditedValue:y}=await ct(n.identity,U,x[P].trade.id,Y.contractAddress&&Y.itemId!=null?{contractAddress:Y.contractAddress,itemId:String(Y.itemId)}:void 0);z.push(m.id),j.push({kind:"trade",trade:x[P].trade,credits:[m],maxCreditedValue:y})}x.forEach((P,U)=>{w[U]<=0&&j.push({kind:"trade",trade:P.trade,credits:[],maxCreditedValue:"0"})}),j[0]={...j[0],maxCreditedValue:(BigInt(j[0].maxCreditedValue)+C).toString()},await Kt(n.signer,x[0].trade.chainId);const A=()=>v({phase:"processing",stage:"settling",step:c.length,total:c.length});v({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const D=await _e({purchases:j,buyer:n.address,signer:n.signer,onSigned:A});t.forEach(P=>l(P.item.id)),Q(null),O("Shop Completed Purchase",{...ze(u),payment_type:"credits_and_mana",transaction_hash:D[0]??null}),f.invalidateQueries({queryKey:["mana-balance"]}),He(h,D)}catch(x){z.length&&(Ie(n.identity,z).catch(()=>{}),f.invalidateQueries({queryKey:["usd-balance"]})),Ve(x,"buy_cart_combined")}}async function G(t){if(!n){pt({type:"cart-checkout"}),E();return}const a=R.getState().items.filter(Ne);if(a.length===0)return;ee(null),re(null),_(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);O("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:rt(d),has_sufficient_credits:ce>=d});try{const c=await ms(a,n.address,Wt,await Ge(),Ft),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),re(Sn(c))),c.buyable.length===0){ee(s("cart.error.noneAvailable")),Q(null);return}if(c.orderChanged){Q(c),Fe.current=Date.now();return}await De(c.buyable,t)}catch(c){J(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ee(Be(c))}finally{_(!1)}}async function et(){if(I){if(!n){pt({type:"cart-checkout"}),E();return}if(Date.now()-Fe.current>$n){Q(null),re(null),await G();return}ee(null),De(I.buyable)}}async function Ot(){if(we){try{sessionStorage.setItem(ge,JSON.stringify(R.getState().items))}catch{}_(!0);try{const t=await fs(we,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}V("/credits")}catch(t){try{sessionStorage.removeItem(ge)}catch{}J(t,{flow:"cart_buy_credits"}),v({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const tt=S.useRef(!1);S.useEffect(()=>{if(!n||tt.current||!Va("cart-checkout"))return;tt.current=!0;const t=setTimeout(()=>void G(),0);return()=>clearTimeout(t)},[n]);const at=S.useRef(!1);S.useEffect(()=>{if(!(N!=null&&N.resumeCheckout)||at.current)return;at.current=!0,ae.current=N.creditsAdded??null;try{const a=sessionStorage.getItem(ge);if(a){sessionStorage.removeItem(ge);const d=JSON.parse(a);Array.isArray(d)&&d.length&&L(d)}}catch{}f.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void G(),0);return()=>clearTimeout(t)},[N==null?void 0:N.resumeCheckout]);const F=It||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(xt,{children:e.jsxs(ft,{children:[e.jsxs(mt,{onClick:()=>V(-1),type:"button",children:[e.jsx(W,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(_s,{"data-testid":"cart-empty",children:[e.jsx(W,{name:"cart-plus",size:110}),e.jsxs(Bs,{children:[e.jsx(Es,{children:s("cart.empty.title")}),e.jsx(Rs,{children:s("cart.empty.body")})]}),e.jsx(Ws,{to:"/assets",children:s("cart.empty.cta")})]})]})}):e.jsxs(xt,{children:[e.jsxs(ft,{children:[e.jsxs(mt,{onClick:()=>V(-1),type:"button",children:[e.jsx(W,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(zs,{children:[e.jsxs(As,{children:[e.jsxs(qs,{children:[e.jsx(Fs,{onClick:()=>V(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(W,{name:"arrow-left"})}),e.jsx(Ls,{children:s("cart.panelTitle",{count:At})}),Tt?e.jsxs(Ks,{onClick:()=>K(!0),disabled:F,children:[e.jsx(W,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(kt,{children:[e.jsx(Ns,{children:o.map(t=>{const a=Bt.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,g=d*h,C=sa(t),z=!!C&&!!T[C],x=na(t),j=Ke[t.id],A=!it(j),D=j==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Qs,{"data-unavailable":A||void 0,children:[e.jsxs(Us,{"data-thumb":!0,children:[x?e.jsx(Os,{to:x,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(Hs,{"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(Vs,{children:[e.jsxs(Gs,{"data-desc":!0,children:[x?e.jsx(Ys,{to:x,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Ds,{title:t.name,children:t.name}),t.creator?e.jsx(Js,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(dn,{"data-testid":"cart-creator-tag",children:[e.jsx(ln,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(Xs,{children:A?e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(on,{name:"warning-fill",size:24}),D]}),x?e.jsx(cn,{to:x,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Zs,{children:[e.jsx(yt,{onClick:()=>le(()=>M(t.id)),disabled:F||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(en,{children:h}),e.jsx(yt,{onClick:()=>le(()=>$(t.id)),disabled:F||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(tn,{children:[e.jsx(an,{})," ",g,c?e.jsx(sn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(nn,{children:[C?e.jsx(un,{"data-on":z||void 0,onClick:()=>Z(t),"aria-label":z?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:z?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(W,{name:z?"heart-solid":"heart"})}):null,e.jsx(hn,{onClick:()=>le(()=>l(t.id)),disabled:F,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(W,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(pn,{children:e.jsx("button",{className:"link",onClick:()=>le(q),disabled:F,children:s("cart.clearCart")})})]})]}),e.jsxs(gn,{children:[e.jsx(xn,{children:s("cart.purchaseSummary")}),e.jsxs(mn,{children:[e.jsxs(fn,{children:[e.jsx(yn,{children:s("cart.totalItems",{count:qt})}),e.jsx(vn,{children:e.jsxs(bn,{children:[e.jsx(wn,{})," ",Qe]})})]}),de.options.length>0||de.manaShortfall?e.jsx(vt,{options:de.options,totalCents:ke,shortfall:de.manaShortfall,creditsLabel:I?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:F||je,onPay:t=>void(I?et():G(t))}):e.jsx(Cn,{onClick:()=>void(I?et():G()),disabled:F||je,children:F?s("cart.working"):I?s("marketCheckout.confirmPurchase"):s("assetCard.buyNow")}),je?e.jsx(xe,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(xe,{className:"muted",children:s("cart.signInHint")}),I?e.jsx(xe,{className:"muted",children:s("cart.priceChanged")}):null,We?e.jsx(xe,{className:"muted",children:We}):null,e.jsx(jn,{message:Pt})]})]})]})]}),Ue.length>0?e.jsx(kn,{children:e.jsx(Ga,{title:s("cart.youMightAlsoLike"),items:Ue})}):null,Me&&n?e.jsx(Da,{auth:Me.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ya,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=Me;ue(null),t()},onCancel:()=>ue(null),onClose:()=>ue(null)}):null,p?e.jsx(Ts,{phase:p.phase,balanceCredits:ce,onClose:Lt,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:ia(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Qt(p).options:void 0,onPay:Ut,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ee(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ie,selectedPack:we,onSelectPack:Le,onBuyPacks:()=>void Ot(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void G()}):null]})}export{On as Cart};
|