@dcl/shop 0.5.0 → 0.5.1-30936450524.commit-699b9ba
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-BNdtDMvf.js +336 -0
- package/_assets/{AnimatedBackground-C4vGO85y.js → AnimatedBackground-DtccR1Yr.js} +2 -2
- package/_assets/{Assets-DUB4VCUr.js → Assets-BPmdORes.js} +11 -11
- package/_assets/{Assets.styles-DIh1hG4_.js → Assets.styles-DGFYQnxw.js} +1 -1
- package/_assets/{Authorizations-gse9z0i5.js → Authorizations-DxyGJ4g6.js} +3 -3
- package/_assets/{Cart-xOvVoYwp.js → Cart-BK5UrFhK.js} +6 -6
- package/_assets/{CircularProgress-BZT_u7sL.js → CircularProgress-DdEjsaZL.js} +1 -1
- package/_assets/{Collection-DkMWDyM9.js → Collection-DqFConie.js} +7 -7
- package/_assets/{CollectionCarousel-D-7TqEHy.js → CollectionCarousel-ChFXFBmM.js} +7 -7
- package/_assets/{Creator-CIj-i2cJ.js → Creator-DrGLyYfy.js} +9 -9
- package/_assets/{ErrorNotice-qXSCgBBe.js → ErrorNotice-BCKaFzga.js} +1 -1
- package/_assets/{ExchangeController-CoWk4iJ_.js → ExchangeController-CvylFMia.js} +1 -1
- package/_assets/{GetCredits-91dR46BQ.js → GetCredits-Dw4w8acm.js} +7 -7
- package/_assets/{HelpersUtil-B_EI8lTR.js → HelpersUtil-_HSkzV2T.js} +1 -1
- package/_assets/{ItemDetail-DneK31a0.js → ItemDetail-Dxa9T_S-.js} +489 -324
- package/_assets/{LoadMore-CPg41rwp.js → LoadMore-D8E5F-8f.js} +1 -1
- package/_assets/ManaPricingBanner.styles-DTnTTvyO.js +74 -0
- package/_assets/{MenuList-D5E4Wrvx.js → MenuList-Jtp545Fi.js} +1 -1
- package/_assets/MyAssets-Db0d2mYm.js +381 -0
- package/_assets/{MyFavorites-CfsWFXpI.js → MyFavorites-B581Hpf-.js} +2 -2
- package/_assets/{NotFound-DVmSPOa9.js → NotFound-B5YyPIK4.js} +1 -1
- package/_assets/{NotificationsBell-C_HZmA4_.js → NotificationsBell-8HxMRP0q.js} +1 -1
- package/_assets/OutfitDetail-cz6cQtz6.js +326 -0
- package/_assets/OutfitPreview-CU2mgvnt.js +6 -0
- package/_assets/{OutfitStudio-D6HxPa0M.js → OutfitStudio-_HyedkEg.js} +50 -50
- package/_assets/{StoreSettings-CmI6OJyt.js → StoreSettings-BGKiUIzy.js} +9 -9
- package/_assets/{Success-CILFVgai.js → Success-RigWZOgD.js} +6 -6
- package/_assets/{SwapController-BtZYC1DC.js → SwapController-BivMb2kn.js} +1 -1
- package/_assets/{Tooltip-D-dOz9cj.js → Tooltip-BFF2_vlu.js} +1 -1
- package/_assets/{TradeService-DFGHQuam.js → TradeService-0TCYki7R.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-Dd3fipah.js → W3MFrameProviderSingleton-B0Higky5.js} +3 -3
- package/_assets/{WebCryptoP256-83ZQlmY9.js → WebCryptoP256-CGkaFniB.js} +1 -1
- package/_assets/{authorizations-3-Mq1Ehl.js → authorizations-zc6Rq7Wn.js} +1 -1
- package/_assets/{basic-BndfWYou.js → basic-DttMuloT.js} +1 -1
- package/_assets/{biconomy-UoaVnBXL.js → biconomy-D4i00Lfc.js} +1 -1
- package/_assets/{browseLayout.styles-C2XsX59Z.js → browseLayout.styles-BdkLZM96.js} +4 -4
- package/_assets/{builder-BCsqID1m.js → builder-D5fMO9fl.js} +1 -1
- package/_assets/{buy-gasless-Cf6hPQpJ.js → buy-gasless-e__YZBZy.js} +1 -1
- package/_assets/buy-hkJbpiOY.js +1 -0
- package/_assets/{categories-CJDomWri.js → categories-B569rNQU.js} +1 -1
- package/_assets/{ccip-DL1ik4S_.js → ccip-CCidJiYF.js} +1 -1
- package/_assets/{ccip-LyTNGN_g.js → ccip-CJTcr6Ak.js} +1 -1
- package/_assets/{clsx-CbhzNwHc.js → clsx-DSmAtJIx.js} +2 -2
- package/_assets/{controller-DI4T8YXU.js → controller-CMLpEAq8.js} +2 -2
- package/_assets/{core-DLkqCpDz.js → core-BIMKRKLD.js} +4 -4
- package/_assets/{createSvgIcon-BdIjzl8A.js → createSvgIcon-mO6bQXvS.js} +1 -1
- package/_assets/{custom-DjHlYa2L.js → custom-VPCzWEDJ.js} +1 -1
- package/_assets/{data-capture-CCEqsOVC.js → data-capture-NhUWYbV9.js} +1 -1
- package/_assets/{email-MyVfElwc.js → email-Clto1rbh.js} +1 -1
- package/_assets/{embedded-wallet-DGKPNmRz.js → embedded-wallet-t8b4yu9z.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-B-KYMSCc.js → emotion-styled.browser.esm-DnvNBX1u.js} +1 -1
- package/_assets/{engine-P4mrsX3-.js → engine-DLv8fLGx.js} +1 -1
- package/_assets/{errors-B5G852-H.js → errors-CZnCfZdx.js} +1 -1
- package/_assets/{estimate-l1-fee-CZTQo2Yh.js → estimate-l1-fee-CJ4pO8UF.js} +1 -1
- package/_assets/{execute-CqlntYG8.js → execute-DlPcikaV.js} +2 -2
- package/_assets/{features-BstqY0d8.js → features-BxKqKAM5.js} +1 -1
- package/_assets/{fetchTokenMetadata-wr3bODuw.js → fetchTokenMetadata-w38JAtHF.js} +2 -2
- package/_assets/{field.styles-CeFk4Y5o.js → field.styles-CFlKswg7.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-BmrdD1ZM.js → get-ecosystem-wallet-info-VnVOeJ1z.js} +1 -1
- package/_assets/{getBalance-CGp1VbNi.js → getBalance-on_xo7HU.js} +1 -1
- package/_assets/{getNFT-BATtEfMr.js → getNFT-CRTR8WTI.js} +1 -1
- package/_assets/{getNFT-Bc7mOqON.js → getNFT-CWzo03nA.js} +1 -1
- package/_assets/{getThemeProps-Cj1ePFOP.js → getThemeProps-B8B_-Rbo.js} +1 -1
- package/_assets/{grid.styles-4uR2Oqak.js → grid.styles-BZkFiBLS.js} +1 -1
- package/_assets/{hashTypedData-DmaIP4Ta.js → hashTypedData-BH6OTW-d.js} +1 -1
- package/_assets/{hashTypedData--isNjJrk.js → hashTypedData-DRMGHRZ0.js} +1 -1
- package/_assets/{in-app-DkfGauuN.js → in-app-Vc6OIIzS.js} +1 -1
- package/_assets/{in-app-wallet-calls-_oAp4gRk.js → in-app-wallet-calls-KLGGFOPI.js} +1 -1
- package/_assets/{index-Jw4WyTL7.js → index-0nqA1JJF.js} +1 -1
- package/_assets/{index-hxv9huma.js → index-4zQsq3fd.js} +1 -1
- package/_assets/{index-B4VZ6oCr.js → index-5ACH-P5G.js} +1 -1
- package/_assets/{index-CNLdKmSV.js → index-6yxWjL1L.js} +2 -2
- package/_assets/{index-B0XZJoRs.js → index-8RpSVOTx.js} +3 -3
- package/_assets/{index-UOqdWcGo.js → index-B-wQ0paE.js} +1 -1
- package/_assets/{index-B08mxqyH.js → index-BCJi5oKJ.js} +1 -1
- package/_assets/{index-DwhWwt0R.js → index-BKEDzKNY.js} +1 -1
- package/_assets/{index-TXpJyzEO.js → index-BPaO_ntB.js} +1 -1
- package/_assets/{index-DCcvZO5Y.js → index-BQwGj32K.js} +1 -1
- package/_assets/{index-pUOx764A.js → index-BS6iKClO.js} +1 -1
- package/_assets/{index-Rzy39Nn7.js → index-BhObZWWG.js} +1 -1
- package/_assets/{index-B3qntzSb.js → index-BkDkQWWI.js} +1 -1
- package/_assets/{index-B9aCuD80.js → index-BqF97xZA.js} +1 -1
- package/_assets/{index-CAtB_PCp.js → index-C-amGj-7.js} +2 -2
- package/_assets/{index-BYndrnYs.js → index-C1U7eBbq.js} +1 -1
- package/_assets/{index-DA6dfZrr.js → index-C2GPCavy.js} +1 -1
- package/_assets/{index-BHPckyG6.js → index-C2q4KTdy.js} +1 -1
- package/_assets/{index-DYIatsEA.js → index-C7ek7oob.js} +1 -1
- package/_assets/{index-qOIpyDqw.js → index-CI0UD5dV.js} +3 -3
- package/_assets/{index-DYJqGaxj.js → index-CJLFJ36W.js} +2 -2
- package/_assets/{index-DG2jERXm.js → index-CNboH-3O.js} +1 -1
- package/_assets/{index-g7yoq537.js → index-Cdvi3pNM.js} +2 -2
- package/_assets/{index-DMfeEICj.js → index-Ceegzko5.js} +1 -1
- package/_assets/{index-CwgAx_D_.js → index-CgA-OcG0.js} +1 -1
- package/_assets/{index-DiwV8Pqc.js → index-Ch8J3QK6.js} +1 -1
- package/_assets/{index-CKuDkHtx.js → index-Cmdx7DKx.js} +1 -1
- package/_assets/{index-9uXo0dDW.js → index-CqPO5kHJ.js} +1 -1
- package/_assets/{index-D-cwjSAX.js → index-CuziOquE.js} +3 -3
- package/_assets/{index-6-oWZZKk.js → index-CzmJnQZH.js} +1 -1
- package/_assets/index-D-7WCtxn.js +3482 -0
- package/_assets/{index-GIpFWU31.js → index-D5RD0vxf.js} +1 -1
- package/_assets/{index-COG_bMzA.js → index-DBZVIZHo.js} +1 -1
- package/_assets/{index-BQJhzjgB.js → index-DHBnEMAt.js} +1 -1
- package/_assets/{index-bI7YB81Q.js → index-DOPFlRgN.js} +1 -1
- package/_assets/{index-wLhUVrXT.js → index-DYWfNXUa.js} +1 -1
- package/_assets/{index-BlqD0sjz.js → index-DkuxSwEU.js} +1 -1
- package/_assets/{index-TyIfm5pC.js → index-DmTmwD6t.js} +1 -1
- package/_assets/{index-Df_MtlRn.js → index-DtsO_iTE.js} +1 -1
- package/_assets/{index-DARDndd8.js → index-DxHGh86B.js} +1 -1
- package/_assets/{index-DXe6U5Nd.js → index-GDLtMazN.js} +1 -1
- package/_assets/{index-BQEMTtHk.js → index-Te89Gq1W.js} +1 -1
- package/_assets/{index-Bq3RaeMg.js → index-Umj2Vke8.js} +1 -1
- package/_assets/{index-6TyUCKeH.js → index-WAyEz3yq.js} +1 -1
- package/_assets/{index-BmlqG1wa.js → index-_KNtvZ03.js} +1 -1
- package/_assets/{index-hFWlaYZc.js → index-cz6Rqk8W.js} +1 -1
- package/_assets/{index-DA_UmuJW.js → index-eog29CgL.js} +2 -2
- package/_assets/{index-CVTYXB-H.js → index-irGTnSKf.js} +1 -1
- package/_assets/{index-a7lLIynB.js → index-jHpuKYUW.js} +1 -1
- package/_assets/{index-DI6mFHN_.js → index-oBbODxgD.js} +1 -1
- package/_assets/index-vsp2ePXO.js +472 -0
- package/_assets/{index-BF4F4-es.js → index-xtIMpr9r.js} +1 -1
- package/_assets/{index.es-DSBJgnik.js → index.es-B7JVZeTo.js} +4 -4
- package/_assets/{index.es-CleSpdBe.js → index.es-CGbqEV93.js} +1 -1
- package/_assets/{index.es-DcH5dh4Z.js → index.es-ClM1Q4-S.js} +1 -1
- package/_assets/{localBatchGatewayRequest-BQaanzyf.js → localBatchGatewayRequest-CKHM638r.js} +1 -1
- package/_assets/{mana-convert-gdOzEDdP.js → mana-convert-dJqmfJfM.js} +1 -1
- package/_assets/{networks-DweEIHqd.js → networks-D4B8rcMf.js} +1 -1
- package/_assets/{onramp-CQin_sc0.js → onramp-BAAYO5Xz.js} +1 -1
- package/_assets/{openzeppelin-aL0pLCk3.js → openzeppelin-tyZlnFgc.js} +1 -1
- package/_assets/{parseNft-C3_Nz5T-.js → parseNft-DmVgwo4R.js} +2 -2
- package/_assets/{parseSignature-DbUWX_0J.js → parseSignature-CCUgv0Xf.js} +1 -1
- package/_assets/{parseSignature-CaUNRWNX.js → parseSignature-Cz4DXMg4.js} +3 -3
- package/_assets/{passkeys-ErJmNcK7.js → passkeys-B-SLcTQC.js} +1 -1
- package/_assets/{pay-with-exchange-IR4P3LG2.js → pay-with-exchange-CPF4Xyar.js} +1 -1
- package/_assets/{qr-overlay-CdnDwp_H.js → qr-overlay-CCgl-rQv.js} +1 -1
- package/_assets/{receive-zGMAuzLF.js → receive-CtyJrIps.js} +1 -1
- package/_assets/{resolveImplementation-DBCwfUsj.js → resolveImplementation-BWEbVpHA.js} +1 -1
- package/_assets/{rpc-DcBDiZd9.js → rpc-9WGO6xiN.js} +1 -1
- package/_assets/{secp256k1-Dw0WpBX5.js → secp256k1-2RfA0szs.js} +1 -1
- package/_assets/{secp256k1-Dewsd8iM.js → secp256k1-CFrW1Y2s.js} +1 -1
- package/_assets/{secp256k1-B-E-jiWl.js → secp256k1-pmcASsb-.js} +1 -1
- package/_assets/{send-DDT-5Y8C.js → send-CMNbsrhM.js} +1 -1
- package/_assets/{send-batch-transaction-BurBPeh7.js → send-batch-transaction-D75RDx36.js} +1 -1
- package/_assets/{send-eip712-transaction-D77WUDwd.js → send-eip712-transaction-BQazlaNl.js} +2 -2
- package/_assets/{send-gasless-transaction-CIWAOyRc.js → send-gasless-transaction-DjoFh0d8.js} +2 -2
- package/_assets/{send-transaction-BXhwaD9S.js → send-transaction-CVFVkU0Z.js} +2 -2
- package/_assets/{sendMetaTransaction-CrIt0KCG.js → sendMetaTransaction-BAlAehuy.js} +1 -1
- package/_assets/{sendRawTransaction-DNK5LA13.js → sendRawTransaction-C4U7kCvT.js} +3 -3
- package/_assets/{serializeTransaction-D3WekrgC.js → serializeTransaction-DaaHRnn4.js} +1 -1
- package/_assets/{session-proposal-BlosSPbJ.js → session-proposal-B8JSXkYh.js} +1 -1
- package/_assets/{session-request-C8iYxI6j.js → session-request-CVuIL0x8.js} +2 -2
- package/_assets/{signing-Bx48W7O-.js → signing-CoqvM4v0.js} +3 -3
- package/_assets/{socials-BSmNv258.js → socials-Ci3QFil3.js} +1 -1
- package/_assets/{swaps-DyNopWtM.js → swaps-Bk85njMT.js} +1 -1
- package/_assets/{thirdweb-Bc1voIUm.js → thirdweb-CTwUbVaf.js} +3 -3
- package/_assets/{to-serializable-transaction-BXY289Ul.js → to-serializable-transaction-BHWda6_Z.js} +2 -2
- package/_assets/{trade-encoding-B7y8VfDo.js → trade-encoding-BDt5HS0k.js} +1 -1
- package/_assets/{transactionReceipt-DLzKebEg.js → transactionReceipt-DVIb0l0k.js} +1 -1
- package/_assets/{transactions-BWXAu1Vp.js → transactions-Dk1TKJgv.js} +1 -1
- package/_assets/{useCreditPacks-CYnMKZmp.js → useCreditPacks-BM-De58w.js} +1 -1
- package/_assets/useImportable-Ce98Ar0U.js +1 -0
- package/_assets/{useInfiniteGrid-ottWIC3k.js → useInfiniteGrid-_3YA45kU.js} +1 -1
- package/_assets/useManaRate-Co5_bB5U.js +1 -0
- package/_assets/{useStore-DC77ufHd.js → useStore-DYpF-pdm.js} +1 -1
- package/_assets/{useTheme-BOb3XgSe.js → useTheme-Br5XE3ab.js} +1 -1
- package/_assets/{verifyHash-B6wVUzvm.js → verifyHash-CJn902Qe.js} +1 -1
- package/_assets/{w3m-modal-CYIABu52.js → w3m-modal-Bq4uD3cn.js} +1 -1
- package/_assets/{w3m-modal-D0DQYwij.js → w3m-modal-iwn664AW.js} +1 -1
- package/_assets/{wait-for-tx-receipt-CzEApn7N.js → wait-for-tx-receipt-mVLKSavl.js} +1 -1
- package/_assets/{wallets-CQPQ_gpR.js → wallets-CUhTDJCi.js} +5 -5
- package/_assets/{web-connector-B5U5FrL8.js → web-connector-1E0uyUrr.js} +3 -3
- package/_assets/{writeContract-CGlJd1QG.js → writeContract-DDr9VQLH.js} +1 -1
- package/_assets/{zoraTestnet-pKTbhMUO.js → zoraTestnet-JZ6ZNHig.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Activity-GNtRBDkH.js +0 -291
- package/_assets/ImportListings-DrIx4tN-.js +0 -472
- package/_assets/ItemPreview.styles--MP-O7tE.js +0 -166
- package/_assets/ManaPricingBanner.styles-4CDYw79q.js +0 -74
- package/_assets/MyAssets-C29gKaZs.js +0 -381
- package/_assets/OutfitDetail-BCkHFvPX.js +0 -357
- package/_assets/OutfitPreview-XyEsGBYa.js +0 -6
- package/_assets/buy-Bs_G6nfA.js +0 -1
- package/_assets/index-CEec1iYe.js +0 -3476
- package/_assets/mana-rate-DFh9C_O1.js +0 -1
- package/_assets/useManaRate-CPn6JNFj.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as u,j as t,L as O,u as
|
|
1
|
+
import{r as u,j as t,L as O,u as Gt,b as qt,d as Wt}from"./react-DehiWSvs.js";import{s as o,t as st,I as M,at as Qt,b as e,w as Y,B as m,ac as vt,n as q,K as Jt,q as Vt,x as wt,u as $t,M as Xt,S as B,au as K,av as Yt,aw as G,Z as Zt,X as te,Y as ee,Q as St,$ as ie,ax as Z,ay as se,az as oe,aA as ae,z as F,aB as kt,aC as Tt,aD as P,j as tt,aE as et,aF as ne,aG as re,aH as de,R as le,aI as ue,aJ as ce,a6 as pe}from"./index-D-7WCtxn.js";import{E as D}from"./ErrorNotice-BCKaFzga.js";import{L as fe}from"./LoadMore-D8E5F-8f.js";import{u as he}from"./useInfiniteGrid-_3YA45kU.js";import{O as me}from"./OutfitPreview-CU2mgvnt.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./disposePreview-DIA1G1eQ.js";const{colors:x,radius:ot,media:xe}=st,ge=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
5
|
-
`,
|
|
5
|
+
`,be=o.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
gap: 8px;
|
|
@@ -25,13 +25,13 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
25
25
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
26
26
|
gap: 10px;
|
|
27
27
|
|
|
28
|
-
${
|
|
28
|
+
${xe.maxWidth("mobile")} {
|
|
29
29
|
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`,ye=o.span`
|
|
32
32
|
height: 190px;
|
|
33
33
|
border-radius: ${ot.card};
|
|
34
|
-
`,
|
|
34
|
+
`,je=o.button`
|
|
35
35
|
position: relative;
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
@@ -58,32 +58,32 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
58
58
|
opacity: 0.5;
|
|
59
59
|
cursor: default;
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,ve=o.img`
|
|
62
62
|
width: 100%;
|
|
63
63
|
aspect-ratio: 1;
|
|
64
64
|
object-fit: cover;
|
|
65
65
|
border-radius: 8px;
|
|
66
66
|
background: ${x.media};
|
|
67
|
-
`,
|
|
67
|
+
`,we=o.span`
|
|
68
68
|
font-size: 13px;
|
|
69
69
|
font-weight: 600;
|
|
70
70
|
white-space: nowrap;
|
|
71
71
|
overflow: hidden;
|
|
72
72
|
text-overflow: ellipsis;
|
|
73
|
-
|
|
73
|
+
`,$e=o.span`
|
|
74
74
|
display: inline-flex;
|
|
75
75
|
align-items: center;
|
|
76
76
|
gap: 4px;
|
|
77
77
|
font-size: 12px;
|
|
78
78
|
color: ${x.muted};
|
|
79
|
-
|
|
79
|
+
`,Se=o(M)`
|
|
80
80
|
position: absolute;
|
|
81
81
|
top: 12px;
|
|
82
82
|
right: 12px;
|
|
83
83
|
color: ${x.accent};
|
|
84
84
|
background: ${x.bg};
|
|
85
85
|
border-radius: 50%;
|
|
86
|
-
`;function
|
|
86
|
+
`;function ke({selectedKeys:r,onPick:h,canPick:f}){const[p,g]=u.useState(""),[j,b]=u.useState("");u.useEffect(()=>{const d=setTimeout(()=>b(p.trim()),300);return()=>clearTimeout(d)},[p]);const{items:s,isLoading:k,isPlaceholderData:w,isError:T,hasNextPage:l,isFetchingNextPage:C,fetchNextPage:I}=he(["outfit-picker",j],d=>Qt({search:j||void 0,category:"wearable",onSale:!0,listingType:"primary",first:24,skip:d,sortBy:"cheapest"})),U=new Set,y=s.filter(d=>{if(!d.itemId)return!1;const $=`${d.contractAddress.toLowerCase()}-${d.itemId}`;return U.has($)?!1:(U.add($),!0)});return t.jsxs(ge,{"data-testid":"outfit-picker",children:[t.jsxs(be,{children:[t.jsx(M,{name:"search",color:st.colors.muted}),t.jsx("input",{value:p,placeholder:e("outfits.studio.searchPlaceholder"),"aria-label":e("outfits.studio.searchPlaceholder"),onChange:d=>g(d.target.value),"data-testid":"outfit-picker-search"})]}),T?t.jsx("p",{className:"muted small",children:e("outfits.errors.generic")}):k||w?t.jsx(xt,{"aria-busy":"true",children:Array.from({length:8},(d,$)=>t.jsx(ye,{className:"skeleton","aria-hidden":!0},$))}):y.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noResults")}):t.jsx(xt,{children:y.map(d=>{const $=`${d.contractAddress.toLowerCase()}-${d.itemId}`,R=r.has($);return t.jsxs(je,{type:"button","data-testid":"outfit-picker-item","data-selected":R||void 0,disabled:!R&&!f(d),onClick:()=>h(d),title:d.name,children:[t.jsx(ve,{src:d.thumbnail,alt:"",loading:"lazy"}),t.jsx(we,{children:d.name}),t.jsxs($e,{children:[t.jsx(Y,{size:12}),d.priceCredits.toLocaleString()]}),R?t.jsx(Se,{name:"check-rounded",size:18}):null]},$)})}),!T&&!k&&!w?t.jsx(fe,{auto:!1,hasNextPage:!!l,isFetching:C,onLoadMore:()=>void I()}):null]})}const{colors:a,radius:v,media:W,z:Te}=st,Ct=o.div`
|
|
87
87
|
max-width: 1200px;
|
|
88
88
|
margin: 0 auto;
|
|
89
89
|
display: flex;
|
|
@@ -99,15 +99,15 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
99
99
|
gap: 14px;
|
|
100
100
|
`,gt=o.h1`
|
|
101
101
|
font-size: 24px;
|
|
102
|
-
`,
|
|
102
|
+
`,It=o.div`
|
|
103
103
|
display: flex;
|
|
104
104
|
align-items: center;
|
|
105
105
|
gap: 12px;
|
|
106
|
-
`,
|
|
106
|
+
`,Et=o.h1`
|
|
107
107
|
font-size: 24px;
|
|
108
108
|
font-weight: 800;
|
|
109
109
|
margin-right: auto;
|
|
110
|
-
`,
|
|
110
|
+
`,Ce=o(O)`
|
|
111
111
|
display: inline-flex;
|
|
112
112
|
align-items: center;
|
|
113
113
|
justify-content: center;
|
|
@@ -137,7 +137,7 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
137
137
|
display: flex;
|
|
138
138
|
flex-direction: column;
|
|
139
139
|
gap: 10px;
|
|
140
|
-
`,
|
|
140
|
+
`,Ie=o.span`
|
|
141
141
|
height: 76px;
|
|
142
142
|
border-radius: ${v.card};
|
|
143
143
|
`,Ee=o.div`
|
|
@@ -157,7 +157,7 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
157
157
|
border-radius: 8px;
|
|
158
158
|
background: ${a.media};
|
|
159
159
|
flex-shrink: 0;
|
|
160
|
-
`,
|
|
160
|
+
`,Le=o.div`
|
|
161
161
|
${Nt};
|
|
162
162
|
overflow: hidden;
|
|
163
163
|
|
|
@@ -167,16 +167,16 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
167
167
|
object-fit: cover;
|
|
168
168
|
display: block;
|
|
169
169
|
}
|
|
170
|
-
`,
|
|
170
|
+
`,Ne=o.span`
|
|
171
171
|
${Nt};
|
|
172
172
|
display: inline-block;
|
|
173
|
-
`,
|
|
173
|
+
`,ze=o.div`
|
|
174
174
|
flex: 1;
|
|
175
175
|
min-width: 0;
|
|
176
176
|
display: flex;
|
|
177
177
|
flex-direction: column;
|
|
178
178
|
gap: 4px;
|
|
179
|
-
`,
|
|
179
|
+
`,Re=o.span`
|
|
180
180
|
font-size: 15px;
|
|
181
181
|
font-weight: 700;
|
|
182
182
|
white-space: nowrap;
|
|
@@ -188,7 +188,7 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
188
188
|
gap: 8px;
|
|
189
189
|
font-size: 13px;
|
|
190
190
|
color: ${a.muted};
|
|
191
|
-
`,
|
|
191
|
+
`,Oe=o.div`
|
|
192
192
|
display: flex;
|
|
193
193
|
align-items: center;
|
|
194
194
|
gap: 8px;
|
|
@@ -197,7 +197,7 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
197
197
|
width: 100%;
|
|
198
198
|
justify-content: flex-end;
|
|
199
199
|
}
|
|
200
|
-
`,
|
|
200
|
+
`,Fe=o.button`
|
|
201
201
|
display: inline-flex;
|
|
202
202
|
align-items: center;
|
|
203
203
|
justify-content: center;
|
|
@@ -218,18 +218,18 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
218
218
|
opacity: 0.5;
|
|
219
219
|
cursor: default;
|
|
220
220
|
}
|
|
221
|
-
`,
|
|
221
|
+
`,Ae=o.div`
|
|
222
222
|
position: fixed;
|
|
223
223
|
inset: 0;
|
|
224
|
-
z-index: ${
|
|
224
|
+
z-index: ${Te.overlay};
|
|
225
225
|
display: grid;
|
|
226
226
|
place-items: center;
|
|
227
227
|
padding: 16px;
|
|
228
|
-
`,
|
|
228
|
+
`,Be=o.div`
|
|
229
229
|
position: absolute;
|
|
230
230
|
inset: 0;
|
|
231
231
|
background: rgba(22, 21, 24, 0.5);
|
|
232
|
-
`,
|
|
232
|
+
`,De=o.div`
|
|
233
233
|
position: relative;
|
|
234
234
|
background: ${a.bg};
|
|
235
235
|
border-radius: ${v.card};
|
|
@@ -239,7 +239,7 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
239
239
|
display: flex;
|
|
240
240
|
flex-direction: column;
|
|
241
241
|
gap: 12px;
|
|
242
|
-
`,
|
|
242
|
+
`,Me=o.h2`
|
|
243
243
|
font-size: 18px;
|
|
244
244
|
font-weight: 800;
|
|
245
245
|
`,Ue=o.div`
|
|
@@ -257,15 +257,15 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
257
257
|
grid-template-columns: 1fr;
|
|
258
258
|
gap: 20px;
|
|
259
259
|
}
|
|
260
|
-
`,
|
|
260
|
+
`,_e=o.div`
|
|
261
261
|
display: flex;
|
|
262
262
|
flex-direction: column;
|
|
263
263
|
gap: 18px;
|
|
264
|
-
`,
|
|
264
|
+
`,Ke=o.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-direction: column;
|
|
267
267
|
gap: 18px;
|
|
268
|
-
`,
|
|
268
|
+
`,Ge=o.div`
|
|
269
269
|
position: relative;
|
|
270
270
|
aspect-ratio: 3 / 4;
|
|
271
271
|
border-radius: 16px;
|
|
@@ -305,10 +305,10 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
305
305
|
letter-spacing: 0.04em;
|
|
306
306
|
text-transform: uppercase;
|
|
307
307
|
color: ${a.muted1};
|
|
308
|
-
`,
|
|
308
|
+
`,We=o.div`
|
|
309
309
|
display: flex;
|
|
310
310
|
gap: 8px;
|
|
311
|
-
`,
|
|
311
|
+
`,Qe=o.button`
|
|
312
312
|
min-height: 44px;
|
|
313
313
|
padding: 0 16px;
|
|
314
314
|
border-radius: ${v.pill};
|
|
@@ -324,7 +324,7 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
324
324
|
background: ${a.accent};
|
|
325
325
|
color: ${a.white};
|
|
326
326
|
}
|
|
327
|
-
`,
|
|
327
|
+
`,Je=o.div`
|
|
328
328
|
width: 240px;
|
|
329
329
|
aspect-ratio: 3 / 4;
|
|
330
330
|
border-radius: ${v.card};
|
|
@@ -346,11 +346,11 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
346
346
|
align-items: center;
|
|
347
347
|
gap: 12px;
|
|
348
348
|
flex-wrap: wrap;
|
|
349
|
-
`,
|
|
349
|
+
`,Xe=o.div`
|
|
350
350
|
display: flex;
|
|
351
351
|
align-items: center;
|
|
352
352
|
gap: 8px;
|
|
353
|
-
`,
|
|
353
|
+
`,Ye=o.input`
|
|
354
354
|
width: 44px;
|
|
355
355
|
height: 44px;
|
|
356
356
|
padding: 2px;
|
|
@@ -366,13 +366,13 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
366
366
|
border: 0;
|
|
367
367
|
border-radius: 4px;
|
|
368
368
|
}
|
|
369
|
-
`,
|
|
369
|
+
`,Ze=o.div`
|
|
370
370
|
display: flex;
|
|
371
371
|
flex-direction: column;
|
|
372
372
|
gap: 2px;
|
|
373
373
|
font-size: 12px;
|
|
374
374
|
color: ${a.muted};
|
|
375
|
-
`,
|
|
375
|
+
`,ti=o.input`
|
|
376
376
|
width: 88px;
|
|
377
377
|
height: 26px;
|
|
378
378
|
padding: 0 6px;
|
|
@@ -386,12 +386,12 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
386
386
|
&[data-invalid] {
|
|
387
387
|
border-color: ${a.errStrong};
|
|
388
388
|
}
|
|
389
|
-
`,
|
|
389
|
+
`,ei=o.div`
|
|
390
390
|
width: 281px;
|
|
391
391
|
max-width: 100%;
|
|
392
|
-
`,
|
|
392
|
+
`,ii=o(m)`
|
|
393
393
|
align-self: flex-start;
|
|
394
|
-
`,
|
|
394
|
+
`,si=o.div`
|
|
395
395
|
display: flex;
|
|
396
396
|
align-items: stretch;
|
|
397
397
|
gap: 8px;
|
|
@@ -412,14 +412,14 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
412
412
|
outline: 2px solid ${a.accent};
|
|
413
413
|
outline-offset: -1px;
|
|
414
414
|
}
|
|
415
|
-
`,
|
|
415
|
+
`,oi=o.ul`
|
|
416
416
|
list-style: none;
|
|
417
417
|
margin: 0;
|
|
418
418
|
padding: 0;
|
|
419
419
|
display: flex;
|
|
420
420
|
flex-direction: column;
|
|
421
421
|
gap: 6px;
|
|
422
|
-
`,
|
|
422
|
+
`,ai=o.li`
|
|
423
423
|
display: flex;
|
|
424
424
|
align-items: center;
|
|
425
425
|
gap: 10px;
|
|
@@ -436,13 +436,13 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
436
436
|
border-radius: 8px;
|
|
437
437
|
background: ${a.media};
|
|
438
438
|
flex-shrink: 0;
|
|
439
|
-
`,
|
|
439
|
+
`,ni=o.img`
|
|
440
440
|
${zt};
|
|
441
441
|
object-fit: cover;
|
|
442
|
-
`,
|
|
442
|
+
`,ri=o.span`
|
|
443
443
|
${zt};
|
|
444
444
|
display: inline-block;
|
|
445
|
-
`,
|
|
445
|
+
`,di=o.span`
|
|
446
446
|
flex: 1;
|
|
447
447
|
min-width: 0;
|
|
448
448
|
font-size: 14px;
|
|
@@ -450,14 +450,14 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
450
450
|
white-space: nowrap;
|
|
451
451
|
overflow: hidden;
|
|
452
452
|
text-overflow: ellipsis;
|
|
453
|
-
`,
|
|
453
|
+
`,li=o.span`
|
|
454
454
|
display: inline-flex;
|
|
455
455
|
align-items: center;
|
|
456
456
|
gap: 4px;
|
|
457
457
|
font-size: 13px;
|
|
458
458
|
color: ${a.muted};
|
|
459
459
|
white-space: nowrap;
|
|
460
|
-
`,
|
|
460
|
+
`,ui=o.div`
|
|
461
461
|
display: flex;
|
|
462
462
|
align-items: center;
|
|
463
463
|
justify-content: space-between;
|
|
@@ -465,13 +465,13 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
465
465
|
border-top: 1px solid ${a.line};
|
|
466
466
|
font-size: 13px;
|
|
467
467
|
font-weight: 700;
|
|
468
|
-
`,
|
|
468
|
+
`,ci=o.span`
|
|
469
469
|
display: inline-flex;
|
|
470
470
|
align-items: center;
|
|
471
471
|
gap: 4px;
|
|
472
472
|
font-size: 15px;
|
|
473
473
|
font-weight: 700;
|
|
474
|
-
`,
|
|
474
|
+
`,pi=o.button`
|
|
475
475
|
display: inline-flex;
|
|
476
476
|
align-items: center;
|
|
477
477
|
justify-content: center;
|
|
@@ -487,14 +487,14 @@ import{r as u,j as t,L as O,u as qt,b as Gt,d as Wt}from"./react-DehiWSvs.js";im
|
|
|
487
487
|
color: ${a.errStrong};
|
|
488
488
|
background: ${a.panel};
|
|
489
489
|
}
|
|
490
|
-
`,
|
|
490
|
+
`,fi=o.div`
|
|
491
491
|
display: flex;
|
|
492
492
|
flex-direction: column;
|
|
493
493
|
gap: 8px;
|
|
494
494
|
padding-top: 16px;
|
|
495
495
|
border-top: 1px solid ${a.line};
|
|
496
|
-
`,
|
|
496
|
+
`,hi=o.div`
|
|
497
497
|
display: flex;
|
|
498
498
|
flex-wrap: wrap;
|
|
499
499
|
gap: 10px;
|
|
500
|
-
`;function Li(){const{id:r}=qt(),{pathname:h}=Gt(),f=G(b=>b.session),p=G(b=>b.signIn),g=Vt();Jt({title:e("outfits.studio.title"),noindex:!0});const j=h.endsWith("/new")?"new":r?"edit":"list";return g==="pending"?t.jsx(z,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?g!=="creator"?t.jsxs(z,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(m,{as:O,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(mi,{}):t.jsx(bi,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(z,{"data-testid":"outfit-studio-signin",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(m,{variant:"purple",onClick:()=>p(),children:e("outfits.studio.signIn")})]})}function hi({outfit:r}){const h=St(r.thumbnailHash);return h?t.jsx(Ie,{style:{background:se(r)},children:t.jsx("img",{src:h,alt:"",loading:"lazy"})}):t.jsx(Le,{"aria-hidden":!0})}function mi(){const r=G(l=>l.session),h=wt(),[f,p]=u.useState(null),[g,j]=u.useState(null),{data:b=[],isLoading:s,isError:k,refetch:w}=$t({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>ue(r.identity)});async function T(l,C){if(r){j(l.id);try{C==="delete"?(await oe(l.id,r.identity),F.success(e("outfits.studio.deleted"))):(await kt({...it(l),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Tt(h)}catch(E){E instanceof R||tt(E,{flow:`outfit-${C}`}),F.error(e(E instanceof R?et(E.code):"outfits.errors.generic"))}finally{j(null),p(null)}}}return t.jsxs(Ct,{"data-testid":"outfit-studio-list",children:[t.jsxs(Et,{children:[t.jsx(It,{children:e("outfits.studio.myOutfits")}),t.jsx(m,{as:O,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(bt,{"aria-busy":"true",children:Array.from({length:3},(l,C)=>t.jsx(Ce,{className:"skeleton","aria-hidden":!0},C))}):k?t.jsxs(z,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void w(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(bt,{children:b.map(l=>t.jsxs(Ee,{"data-testid":"outfit-studio-row","data-published":l.published||void 0,children:[t.jsx(hi,{outfit:l}),t.jsxs(Ne,{children:[t.jsx(ze,{children:l.name||e("outfits.studio.untitled")}),t.jsxs(Pe,{children:[t.jsx(Lt,{"data-state":l.published?"published":"draft",children:l.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:l.items.length})]})]}),t.jsxs(Re,{children:[l.published?t.jsx(m,{as:O,to:`/items/outfits/${l.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(m,{as:O,to:`/outfits/${l.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(Oe,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:g===l.id,onClick:()=>p(l),children:t.jsx(U,{name:"trash",size:18})})]})]},l.id))}),f?t.jsxs(Fe,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ae,{onClick:()=>p(null)}),t.jsxs(Be,{children:[t.jsx(De,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ue,{children:[f.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:g===f.id,onClick:()=>void T(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(m,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:g===f.id,onClick:()=>void T(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(m,{variant:"ghost",onClick:()=>p(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const jt=["image/png","image/jpeg","image/webp"];function xi(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:Z.from,gradientTo:Z.to,published:!1}}function it(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function gi(r){try{const h=sessionStorage.getItem(r);return h?JSON.parse(h):null}catch{return null}}function bi({outfitId:r}){const h=r===null,f=`outfit-draft:${r??"new"}`,p=G(i=>i.session),g=wt(),j=Wt(),[b]=u.useState(()=>gi(f)),[s,k]=u.useState(()=>b??(h?xi():null)),[w,T]=u.useState(!!b),{data:l,isLoading:C,isError:E,refetch:H}=$t({queryKey:["outfit",r,!0],enabled:!h&&!!p,staleTime:0,queryFn:()=>ce(r,p.identity)});u.useEffect(()=>{l&&k(i=>i??it(l))},[l]);function y(i){k(n=>n&&{...n,...i}),T(!0)}u.useEffect(()=>{if(!(!s||!w))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,w,f]),u.useEffect(()=>{if(!w)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[w]),u.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const d=Xt(s??void 0),$=u.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(B)),[s]),P=i=>le((s==null?void 0:s.items)??[],i,d.byKey),at=i=>!!i.itemId&&P(i).length<=q;function Pt(i){!s||!at(i)||y({items:P(i)})}const[Rt,nt]=u.useState(null),I=u.useRef(null),Q=u.useRef(!0);u.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const[M,rt]=u.useState(!1),[Ot,_]=u.useState(null),[V,dt]=u.useState(""),[Ft,lt]=u.useState(null),[S,At]=u.useState();u.useEffect(()=>()=>{I.current&&URL.revokeObjectURL(I.current)},[]);function ut(){const i=re(V);if(!i){lt(e("outfits.studio.importError"));return}lt(null),dt(""),At(i.colors),y({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Bt(i){if(!i||!p)return;if(_(null),!jt.includes(i.type)){_(e("outfits.errors.unsupportedType"));return}if(i.size>ae){_(e("outfits.errors.tooLarge"));return}I.current&&URL.revokeObjectURL(I.current);const n=URL.createObjectURL(i);I.current=n,nt(n),rt(!0);try{const c=await ne(i,p.identity);y({thumbnailHash:c})}catch(c){c instanceof R||tt(c,{flow:"outfit-thumbnail"}),_(e(c instanceof R?et(c.code):"outfits.errors.generic")),I.current&&(URL.revokeObjectURL(I.current),I.current=null),nt(null)}finally{rt(!1)}}const[A,ct]=u.useState(!1),[Dt,pt]=u.useState(null),J=!!s&&s.name.trim().length>0&&s.name.length<=60,Ut=!!s&&K(s.gradientFrom)&&K(s.gradientTo),ft=!!s&&J&&!!s.thumbnailHash&&Ut&&s.items.length>=2&&s.items.length<=q;async function X(i){if(!(!p||!s||A)){ct(!0),pt(null);try{const n=await kt({...s,published:i},p.identity,h?"create":"update");if(!Q.current)return;sessionStorage.removeItem(f),k(it(n)),T(!1),Tt(g),i&&!s.published?(de("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),h&&(g.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof R||tt(n,{flow:"outfit-save"}),pt(e(n instanceof R?et(n.code):"outfits.errors.generic"))}finally{ct(!1)}}}const ht=u.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>d.byKey.get(B(i))).map(i=>i?Yt(i):null).filter(i=>!!i),[s,d.byKey]),Ht=(s==null?void 0:s.bodyShape)==="female"?Zt:(s==null?void 0:s.bodyShape)==="male"?te:void 0;if(!p)return null;if(!s)return E?t.jsxs(z,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void H(),children:e("outfits.detail.retry")})]}):!C&&l===null?t.jsxs(z,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(m,{as:O,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(z,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const mt=Rt??St(s.thumbnailHash),Mt={...s,authorAddress:(p==null?void 0:p.address)??"",createdAt:0,updatedAt:0},_t=s.items.reduce((i,n)=>{var c;return i+(((c=d.byKey.get(B(n)))==null?void 0:c.priceCredits)??0)},0);return t.jsxs(Ct,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Et,{children:[t.jsx(Te,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(U,{name:"arrow-left",size:18})}),t.jsx(It,{children:h?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Lt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(He,{children:[t.jsxs(Me,{children:[t.jsxs(Ke,{"data-testid":"outfit-studio-preview",style:{background:ee(s)},children:[t.jsx(he,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Ht,urns:ht,skin:S==null?void 0:S.skin,hair:S==null?void 0:S.hair,eyes:S==null?void 0:S.eyes,enabled:!d.isLoading}),ht.length===0&&!d.isLoading?t.jsx(qe,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(Ge,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(We,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>y({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(Ve,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(Je,{children:[t.jsx(Xe,{type:"color",value:K(s[i])?s[i]:Z.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>y({[i]:n.target.value.toLowerCase()})}),t.jsxs(Ye,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(Ze,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!K(s[i])||void 0,onChange:n=>{const c=n.target.value.trim().toLowerCase();y({[i]:c.startsWith("#")||c===""?c:`#${c}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.thumbnail")}),mt?t.jsx(Qe,{"data-busy":M||void 0,children:t.jsx("img",{src:mt,alt:""})}):null,t.jsxs(ei,{as:"label",variant:"outline",size:"sm","data-busy":M||void 0,children:[M?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:jt.join(","),hidden:!0,disabled:M,onChange:i=>{var n;return void Bt((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:Ot,testId:"outfit-studio-thumb-error"})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(ti,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(ie,{outfit:Mt,resolution:d})})]})]}),t.jsxs(_e,{children:[t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(ii,{children:[t.jsx(yt,{id:"outfit-import",value:V,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>dt(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ut()},"data-testid":"outfit-studio-import"}),t.jsx(m,{variant:"outline",size:"sm",onClick:ut,disabled:V.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(D,{message:Ft,testId:"outfit-studio-import-error"})]}),t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(yt,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>y({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(L,{children:[t.jsxs(N,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",q,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(si,{children:s.items.map(i=>{const n=B(i),c=d.byKey.get(n);return t.jsxs(oi,{"data-testid":"outfit-studio-selected","data-missing":!c||void 0,children:[c?t.jsx(ai,{src:c.thumbnail,alt:""}):t.jsx(ni,{className:d.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(ri,{className:c?void 0:"muted",children:c?c.name:d.isLoading?"…":e("outfits.card.unavailable")}),c?t.jsxs(di,{children:[t.jsx(Y,{size:12}),c.priceCredits.toLocaleString()]}):null,t.jsx(ci,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>y({items:s.items.filter(Kt=>B(Kt)!==n)}),children:t.jsx(U,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(li,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ui,{children:[t.jsx(Y,{size:14}),_t.toLocaleString()]})]}):null,s.items.length>=q?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(Se,{selectedKeys:$,onPick:Pt,canPick:at})]})]}),t.jsxs(pi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Dt,testId:"outfit-studio-save-error"}),J?!ft&&!s.published?t.jsx("p",{className:"muted small",children:e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs(fi,{children:[t.jsx(m,{variant:"outline","data-testid":"outfit-studio-save",disabled:A||!J,onClick:()=>void X(s.published),children:A?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:A,onClick:()=>void X(!1),children:e("outfits.studio.unpublish")}):t.jsx(m,{variant:"purple","data-testid":"outfit-studio-publish",disabled:A||!ft,onClick:()=>void X(!0),children:e("outfits.studio.publish")})]})]})]})}export{Li as OutfitStudio,Li as default};
|
|
500
|
+
`;function Ni(){const{id:r}=Gt(),{pathname:h}=qt(),f=q(b=>b.session),p=q(b=>b.signIn),g=Jt();Vt({title:e("outfits.studio.title"),noindex:!0});const j=h.endsWith("/new")?"new":r?"edit":"list";return g==="pending"?t.jsx(z,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):f?g!=="creator"?t.jsxs(z,{"data-testid":"outfit-studio-unavailable",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.notAvailable")}),t.jsx(m,{as:O,to:"/overview",variant:"purple",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(xi,{}):t.jsx(yi,{outfitId:j==="edit"?r:null},r??"new"):t.jsxs(z,{"data-testid":"outfit-studio-signin",children:[t.jsx(gt,{children:e("outfits.studio.title")}),t.jsx("p",{className:"muted",children:e("outfits.studio.signInPrompt")}),t.jsx(m,{variant:"purple",onClick:()=>p(),children:e("outfits.studio.signIn")})]})}function mi({outfit:r}){const h=St(r.thumbnailHash);return h?t.jsx(Le,{style:{background:oe(r)},children:t.jsx("img",{src:h,alt:"",loading:"lazy"})}):t.jsx(Ne,{"aria-hidden":!0})}function xi(){const r=q(l=>l.session),h=wt(),[f,p]=u.useState(null),[g,j]=u.useState(null),{data:b=[],isLoading:s,isError:k,refetch:w}=$t({queryKey:["outfits-all"],enabled:!!r,staleTime:3e4,queryFn:()=>ce(r.identity)});async function T(l,C){if(r){j(l.id);try{C==="delete"?(await ae(l.id,r.identity),F.success(e("outfits.studio.deleted"))):(await kt({...it(l),published:!1},r.identity,"update"),F.success(e("outfits.studio.unpublished"))),Tt(h)}catch(I){I instanceof P||tt(I,{flow:`outfit-${C}`}),F.error(e(I instanceof P?et(I.code):"outfits.errors.generic"))}finally{j(null),p(null)}}}return t.jsxs(Ct,{"data-testid":"outfit-studio-list",children:[t.jsxs(It,{children:[t.jsx(Et,{children:e("outfits.studio.myOutfits")}),t.jsx(m,{as:O,to:"/outfits/new",variant:"purple","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),s?t.jsx(bt,{"aria-busy":"true",children:Array.from({length:3},(l,C)=>t.jsx(Ie,{className:"skeleton","aria-hidden":!0},C))}):k?t.jsxs(z,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void w(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx("p",{className:"muted",children:e("outfits.studio.empty")}):t.jsx(bt,{children:b.map(l=>t.jsxs(Ee,{"data-testid":"outfit-studio-row","data-published":l.published||void 0,children:[t.jsx(mi,{outfit:l}),t.jsxs(ze,{children:[t.jsx(Re,{children:l.name||e("outfits.studio.untitled")}),t.jsxs(Pe,{children:[t.jsx(Lt,{"data-state":l.published?"published":"draft",children:l.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:l.items.length})]})]}),t.jsxs(Oe,{children:[l.published?t.jsx(m,{as:O,to:`/items/outfits/${l.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(m,{as:O,to:`/outfits/${l.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(Fe,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:g===l.id,onClick:()=>p(l),children:t.jsx(M,{name:"trash",size:18})})]})]},l.id))}),f?t.jsxs(Ae,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Be,{onClick:()=>p(null)}),t.jsxs(De,{children:[t.jsx(Me,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ue,{children:[f.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:g===f.id,onClick:()=>void T(f,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(m,{variant:f.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:g===f.id,onClick:()=>void T(f,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(m,{variant:"ghost",onClick:()=>p(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const jt=["image/png","image/jpeg","image/webp"];function gi(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:Z.from,gradientTo:Z.to,published:!1}}function it(r){return{id:r.id,name:r.name,thumbnailHash:r.thumbnailHash,items:r.items,bodyShape:r.bodyShape,gradientFrom:r.gradientFrom,gradientTo:r.gradientTo,published:r.published}}function bi(r){try{const h=sessionStorage.getItem(r);return h?JSON.parse(h):null}catch{return null}}function yi({outfitId:r}){const h=r===null,f=`outfit-draft:${r??"new"}`,p=q(i=>i.session),g=wt(),j=Wt(),[b]=u.useState(()=>bi(f)),[s,k]=u.useState(()=>b??(h?gi():null)),[w,T]=u.useState(!!b),{data:l,isLoading:C,isError:I,refetch:U}=$t({queryKey:["outfit",r,!0],enabled:!h&&!!p,staleTime:0,queryFn:()=>pe(r,p.identity)});u.useEffect(()=>{l&&k(i=>i??it(l))},[l]);function y(i){k(n=>n&&{...n,...i}),T(!0)}u.useEffect(()=>{if(!(!s||!w))try{sessionStorage.setItem(f,JSON.stringify(s))}catch{}},[s,w,f]),u.useEffect(()=>{if(!w)return;const i=n=>n.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[w]),u.useEffect(()=>()=>sessionStorage.removeItem(f),[f]);const d=Xt(s??void 0),$=u.useMemo(()=>new Set(((s==null?void 0:s.items)??[]).map(B)),[s]),R=i=>ue((s==null?void 0:s.items)??[],i,d.byKey),at=i=>!!i.itemId&&R(i).length<=G;function Rt(i){!s||!at(i)||y({items:R(i)})}const[Pt,nt]=u.useState(null),E=u.useRef(null),Q=u.useRef(!0);u.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const[H,rt]=u.useState(!1),[Ot,_]=u.useState(null),[J,dt]=u.useState(""),[Ft,lt]=u.useState(null),[S,At]=u.useState();u.useEffect(()=>()=>{E.current&&URL.revokeObjectURL(E.current)},[]);function ut(){const i=de(J);if(!i){lt(e("outfits.studio.importError"));return}lt(null),dt(""),At(i.colors),y({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),F.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Bt(i){if(!i||!p)return;if(_(null),!jt.includes(i.type)){_(e("outfits.errors.unsupportedType"));return}if(i.size>ne){_(e("outfits.errors.tooLarge"));return}E.current&&URL.revokeObjectURL(E.current);const n=URL.createObjectURL(i);E.current=n,nt(n),rt(!0);try{const c=await re(i,p.identity);y({thumbnailHash:c})}catch(c){c instanceof P||tt(c,{flow:"outfit-thumbnail"}),_(e(c instanceof P?et(c.code):"outfits.errors.generic")),E.current&&(URL.revokeObjectURL(E.current),E.current=null),nt(null)}finally{rt(!1)}}const[A,ct]=u.useState(!1),[Dt,pt]=u.useState(null),V=!!s&&s.name.trim().length>0&&s.name.length<=60,Mt=!!s&&K(s.gradientFrom)&&K(s.gradientTo),ft=!!s&&V&&!!s.thumbnailHash&&Mt&&s.items.length>=Yt&&s.items.length<=G;async function X(i){if(!(!p||!s||A)){ct(!0),pt(null);try{const n=await kt({...s,published:i},p.identity,h?"create":"update");if(!Q.current)return;sessionStorage.removeItem(f),k(it(n)),T(!1),Tt(g),i&&!s.published?(le("Shop Outfit Published",{outfit_id:n.id,item_count:n.items.length}),F.success(e("outfits.studio.publishedToast"))):F.success(e("outfits.studio.saved")),h&&(g.setQueryData(["outfit",n.id,!0],n),j(`/outfits/${n.id}/edit`,{replace:!0}))}catch(n){n instanceof P||tt(n,{flow:"outfit-save"}),pt(e(n instanceof P?et(n.code):"outfits.errors.generic"))}finally{ct(!1)}}}const ht=u.useMemo(()=>((s==null?void 0:s.items)??[]).map(i=>d.byKey.get(B(i))).map(i=>i?Zt(i):null).filter(i=>!!i),[s,d.byKey]),Ut=(s==null?void 0:s.bodyShape)==="female"?te:(s==null?void 0:s.bodyShape)==="male"?ee:void 0;if(!p)return null;if(!s)return I?t.jsxs(z,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(m,{variant:"purple",onClick:()=>void U(),children:e("outfits.detail.retry")})]}):!C&&l===null?t.jsxs(z,{"data-testid":"outfit-studio-missing",children:[t.jsx("p",{className:"muted",children:e("outfits.errors.notFound")}),t.jsx(m,{as:O,to:"/outfits/manage",variant:"purple",children:e("outfits.studio.myOutfits")})]}):t.jsx(z,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const mt=Pt??St(s.thumbnailHash),Ht={...s,authorAddress:(p==null?void 0:p.address)??"",createdAt:0,updatedAt:0},_t=s.items.reduce((i,n)=>{var c;return i+(((c=d.byKey.get(B(n)))==null?void 0:c.priceCredits)??0)},0);return t.jsxs(Ct,{"data-testid":"outfit-studio-editor",children:[t.jsxs(It,{children:[t.jsx(Ce,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(M,{name:"arrow-left",size:18})}),t.jsx(Et,{children:h?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(Lt,{"data-state":s.published?"published":"draft",children:s.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(He,{children:[t.jsxs(_e,{children:[t.jsxs(Ge,{"data-testid":"outfit-studio-preview",style:{background:ie(s)},children:[t.jsx(me,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Ut,urns:ht,skin:S==null?void 0:S.skin,hair:S==null?void 0:S.hair,eyes:S==null?void 0:S.eyes,enabled:!d.isLoading}),ht.length===0&&!d.isLoading?t.jsx(qe,{className:"muted",children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(We,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(Qe,{type:"button","data-selected":s.bodyShape===i||void 0,onClick:()=>y({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(Ve,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(Xe,{children:[t.jsx(Ye,{type:"color",value:K(s[i])?s[i]:Z.from,"aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom"),"data-testid":i==="gradientFrom"?"outfit-studio-gradient-from":"outfit-studio-gradient-to",onChange:n=>y({[i]:n.target.value.toLowerCase()})}),t.jsxs(Ze,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(ti,{value:s[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!K(s[i])||void 0,onChange:n=>{const c=n.target.value.trim().toLowerCase();y({[i]:c.startsWith("#")||c===""?c:`#${c}`})}})]})]},i))}),t.jsx("p",{className:"muted small",children:e("outfits.studio.gradientHint")})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.thumbnail")}),mt?t.jsx(Je,{"data-busy":H||void 0,children:t.jsx("img",{src:mt,alt:""})}):null,t.jsxs(ii,{as:"label",variant:"outline",size:"sm","data-busy":H||void 0,children:[H?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:jt.join(","),hidden:!0,disabled:H,onChange:i=>{var n;return void Bt((n=i.target.files)==null?void 0:n[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:Ot,testId:"outfit-studio-thumb-error"})]}),t.jsxs(L,{children:[t.jsx(N,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(ei,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(se,{outfit:Ht,resolution:d})})]})]}),t.jsxs(Ke,{children:[t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(si,{children:[t.jsx(yt,{id:"outfit-import",value:J,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>dt(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ut()},"data-testid":"outfit-studio-import"}),t.jsx(m,{variant:"outline",size:"sm",onClick:ut,disabled:J.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx("p",{className:"muted small",children:e("outfits.studio.importHint")}),t.jsx(D,{message:Ft,testId:"outfit-studio-import-error"})]}),t.jsxs(L,{children:[t.jsx(N,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(yt,{id:"outfit-name",value:s.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>y({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(L,{children:[t.jsxs(N,{as:"span",children:[e("outfits.studio.items")," (",s.items.length,"/",G,")"]}),s.items.length===0?t.jsx("p",{className:"muted small",children:e("outfits.studio.noItems")}):t.jsx(oi,{children:s.items.map(i=>{const n=B(i),c=d.byKey.get(n);return t.jsxs(ai,{"data-testid":"outfit-studio-selected","data-missing":!c||void 0,children:[c?t.jsx(ni,{src:c.thumbnail,alt:""}):t.jsx(ri,{className:d.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(di,{className:c?void 0:"muted",children:c?c.name:d.isLoading?"…":e("outfits.card.unavailable")}),c?t.jsxs(li,{children:[t.jsx(Y,{size:12}),c.priceCredits.toLocaleString()]}):null,t.jsx(pi,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>y({items:s.items.filter(Kt=>B(Kt)!==n)}),children:t.jsx(M,{name:"trash",size:16})})]},n)})}),s.items.length>0?t.jsxs(ui,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs(ci,{children:[t.jsx(Y,{size:14}),_t.toLocaleString()]})]}):null,s.items.length>=G?t.jsx("p",{className:"muted small",children:e("outfits.studio.maxItems")}):null]}),t.jsx(ke,{selectedKeys:$,onPick:Rt,canPick:at})]})]}),t.jsxs(fi,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Dt,testId:"outfit-studio-save-error"}),V?!ft&&!s.published?t.jsx("p",{className:"muted small",children:e("outfits.errors.notPublishable")}):null:t.jsx("p",{className:"muted small",children:e("outfits.studio.needName")}),t.jsxs(hi,{children:[t.jsx(m,{variant:"outline","data-testid":"outfit-studio-save",disabled:A||!V,onClick:()=>void X(s.published),children:A?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),s.published?t.jsx(m,{variant:"purple","data-testid":"outfit-studio-unpublish",disabled:A,onClick:()=>void X(!1),children:e("outfits.studio.unpublish")}):t.jsx(m,{variant:"purple","data-testid":"outfit-studio-publish",disabled:A||!ft,onClick:()=>void X(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ni as OutfitStudio,Ni as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t as
|
|
1
|
+
import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t as w,s as a,o as ce,B as q,q as de,n as pe,x as ue,I as N,z as F}from"./index-D-7WCtxn.js";import{u as ge,d as me,t as xe,L as he,i as A,a as f,s as fe}from"./useStore-DYpF-pdm.js";import{E as M}from"./ErrorNotice-BCKaFzga.js";import{F as j}from"./field.styles-CFlKswg7.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const ve="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/template-cover-1-BETekfHg.jpeg",be="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/template-cover-2-Dni9s0i_.jpeg",je=Object.assign({"../assets/creator-covers/template-cover-1.jpeg":ve,"../assets/creator-covers/template-cover-2.jpeg":be}),v=Object.entries(je).sort(([r],[u])=>r.localeCompare(u)).map(([r,u])=>({name:r.split("/").pop(),url:u})),we=ce`
|
|
2
2
|
to {
|
|
3
3
|
transform: rotate(360deg);
|
|
4
4
|
}
|
|
@@ -7,7 +7,7 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
gap: 12px;
|
|
10
|
-
color: ${
|
|
10
|
+
color: ${w.colors.muted};
|
|
11
11
|
|
|
12
12
|
&[data-direction='row'] {
|
|
13
13
|
flex-direction: row;
|
|
@@ -20,9 +20,9 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
20
20
|
flex: none;
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
border-style: solid;
|
|
23
|
-
border-color: ${
|
|
24
|
-
border-top-color: ${
|
|
25
|
-
animation: ${
|
|
23
|
+
border-color: ${w.colors.line};
|
|
24
|
+
border-top-color: ${w.colors.accent};
|
|
25
|
+
animation: ${we} 0.8s linear infinite;
|
|
26
26
|
|
|
27
27
|
&[data-size='small'] {
|
|
28
28
|
width: 18px;
|
|
@@ -46,11 +46,11 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
46
46
|
`,$e=a.span`
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
font-weight: 600;
|
|
49
|
-
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:n,radius:_e,media:G}=
|
|
49
|
+
`;function ye({label:r,size:u="medium",direction:S="column",className:k}){return t.jsxs(Se,{className:k,"data-testid":"spinner-box","data-direction":S,role:"status","aria-live":"polite","aria-label":r?void 0:s("spinner.loading"),children:[t.jsx(ke,{"data-testid":"spinner-box-ring","data-size":u,"aria-hidden":!0}),r?t.jsx($e,{children:r}):null]})}const{colors:n,radius:_e,media:G}=w,Ee=a(ye)`
|
|
50
50
|
display: grid;
|
|
51
51
|
place-items: center;
|
|
52
52
|
min-height: 60vh;
|
|
53
|
-
`,
|
|
53
|
+
`,ze=a(q)`
|
|
54
54
|
align-self: center;
|
|
55
55
|
min-width: 200px;
|
|
56
56
|
margin-top: 8px;
|
|
@@ -84,7 +84,7 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
84
84
|
resize: vertical;
|
|
85
85
|
min-height: 88px;
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,Ne=a.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: baseline;
|
|
90
90
|
justify-content: space-between;
|
|
@@ -236,4 +236,4 @@ import{j as t,L as oe,d as le,r as l}from"./react-DehiWSvs.js";import{b as s,t a
|
|
|
236
236
|
${G.maxWidth("mobile")} {
|
|
237
237
|
width: 100%;
|
|
238
238
|
}
|
|
239
|
-
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function Ke(){de({title:s("seo.storeSettings.title"),noindex:!0});const{session:r,signIn:u}=pe(),S=le(),k=ue(),p=r==null?void 0:r.address,{data:$,isLoading:K}=ge(p),[o,g]=l.useState(W),[C,H]=l.useState(W),[y,x]=l.useState(),[h,I]=l.useState(!1),[c,_]=l.useState(null),[b,J]=l.useState({}),T=l.useRef(null);l.useEffect(()=>{if($){const e=me($);g(e),H(e),x(void 0),_(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[$]),l.useEffect(()=>{let e=!1;return Promise.all(v.map(async i=>[i.name,await xe(i.url)])).then(i=>{e||J(Object.fromEntries(i))}).catch(()=>{}),()=>{e=!0}},[]);const E=l.useMemo(()=>{const e=v.find(d=>o.coverName===`cover/${d.name}`);if(e)return e.name;const i=o.coverHash?v.find(d=>b[d.name]===o.coverHash):void 0;return i==null?void 0:i.name},[o.coverName,o.coverHash,b]);l.useEffect(()=>{c!=null&&c.hash&&v.some(e=>b[e.name]===c.hash)&&_(null)},[b,c]);const B=y!==void 0&&y>V,Q=l.useMemo(()=>he.filter(e=>!A(e,o.links[e])),[o.links]),U=B||Q.length>0,
|
|
239
|
+
`,V=1e6,W={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function Y(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function Ke(){de({title:s("seo.storeSettings.title"),noindex:!0});const{session:r,signIn:u}=pe(),S=le(),k=ue(),p=r==null?void 0:r.address,{data:$,isLoading:K}=ge(p),[o,g]=l.useState(W),[C,H]=l.useState(W),[y,x]=l.useState(),[h,I]=l.useState(!1),[c,_]=l.useState(null),[b,J]=l.useState({}),T=l.useRef(null);l.useEffect(()=>{if($){const e=me($);g(e),H(e),x(void 0),_(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[$]),l.useEffect(()=>{let e=!1;return Promise.all(v.map(async i=>[i.name,await xe(i.url)])).then(i=>{e||J(Object.fromEntries(i))}).catch(()=>{}),()=>{e=!0}},[]);const E=l.useMemo(()=>{const e=v.find(d=>o.coverName===`cover/${d.name}`);if(e)return e.name;const i=o.coverHash?v.find(d=>b[d.name]===o.coverHash):void 0;return i==null?void 0:i.name},[o.coverName,o.coverHash,b]);l.useEffect(()=>{c!=null&&c.hash&&v.some(e=>b[e.name]===c.hash)&&_(null)},[b,c]);const B=y!==void 0&&y>V,Q=l.useMemo(()=>he.filter(e=>!A(e,o.links[e])),[o.links]),U=B||Q.length>0,z=l.useMemo(()=>JSON.stringify(o)!==JSON.stringify(C),[o,C]),X=z&&!U&&!h;if(l.useEffect(()=>{if(!z)return;const e=i=>{i.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[z]),!r)return t.jsxs(O,{"data-signin":!0,"aria-label":s("storeSettings.title"),children:[t.jsx(D,{children:s("storeSettings.title")}),t.jsx("p",{className:"muted",children:s("storeSettings.signInPrompt")}),t.jsx(ze,{variant:"purple",onClick:u,children:s("storeSettings.signIn")})]});function Z(e,i){x(void 0),g(d=>({...d,cover:i,coverName:`cover/${e}`,coverHash:""}))}const ee=["image/png","image/jpeg","image/webp"];function te(e){var P;const i=(P=e.target.files)==null?void 0:P[0];if(!i||!ee.includes(i.type))return;x(i.size);const d=`cover/${i.name}`,m=new FileReader;m.onload=()=>{const R=m.result;_({url:R,name:d,hash:""}),g(re=>({...re,cover:R,coverName:d,coverHash:""}))},m.readAsDataURL(i)}function ie(){c&&(x(void 0),g(e=>({...e,cover:c.url,coverName:c.name,coverHash:c.hash})))}function se(e,i){const d=i?(f[e]+i).replace(/\s/g,""):"";g(m=>({...m,links:{...m.links,[e]:d}}))}function ne(e){const i=o.links[e];return e==="website"?i:i.replace(f[e],"")}async function ae(){if(!(!p||!r)){I(!0);try{await fe(p,o,r.identity),H(o),x(void 0),await k.invalidateQueries({queryKey:["store",p.toLowerCase()]}),F.success(s("storeSettings.saved")),S(`/items/creator/${p}`)}catch{F.error(s("storeSettings.saveError"))}finally{I(!1)}}}return t.jsxs(O,{"aria-label":s("storeSettings.title"),children:[t.jsxs(Ne,{children:[t.jsxs(Le,{children:[p?t.jsx(Ce,{to:`/items/creator/${p}`,title:s("storeSettings.back"),"aria-label":s("storeSettings.back"),children:t.jsx(N,{name:"arrow-left"})}):null,t.jsx(D,{children:s("storeSettings.title")})]}),p?t.jsxs(He,{href:`/items/creator/${p}`,target:"_blank",rel:"noopener noreferrer",children:[s("storeSettings.seeAsGuest"),t.jsx(N,{name:"external-link"})]}):null]}),K?t.jsx(Ee,{size:"large",label:s("storeSettings.loading")}):t.jsxs(t.Fragment,{children:[t.jsxs(j,{children:[t.jsx("span",{className:"field__label",children:s("storeSettings.cover")}),t.jsxs(Be,{role:"group","aria-label":s("storeSettings.cover"),children:[v.map(e=>{const i=E===e.name;return t.jsx(L,{type:"button","data-testid":"cover-picker-tile","data-selected":i,"aria-pressed":i,onClick:()=>Z(e.name,e.url),children:t.jsx("img",{src:e.url,alt:"",loading:"lazy"})},e.name)}),c?t.jsx(L,{type:"button","data-testid":"cover-picker-tile","data-variant":"custom","data-selected":!E,"aria-pressed":!E,onClick:ie,children:t.jsx("img",{src:c.url,alt:""})}):null,t.jsxs(L,{type:"button","data-testid":"cover-picker-tile","data-variant":"upload",onClick:()=>{var e;return(e=T.current)==null?void 0:e.click()},children:[t.jsx(N,{name:"upload"}),t.jsx("span",{children:s("storeSettings.upload")})]}),t.jsx(Pe,{ref:T,type:"file",accept:"image/png, image/jpeg, image/webp","data-testid":"cover-picker-input",onChange:te})]}),B?t.jsx(M,{message:s("storeSettings.sizeError",{max:Y(V),current:Y(y)})}):null]}),t.jsxs(j,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.description")}),t.jsx("textarea",{value:o.description,rows:4,disabled:h,onChange:e=>g(i=>({...i,description:e.target.value}))})]}),t.jsxs(j,{as:"label",children:[t.jsx("span",{className:"field__label",children:s("storeSettings.website")}),t.jsx("input",{type:"url",value:o.links.website,placeholder:f.website,disabled:h,onChange:e=>g(i=>({...i,links:{...i.links,website:e.target.value.replace(/\s/g,"")}}))}),A("website",o.links.website)?null:t.jsx(M,{message:s("storeSettings.linkError",{value:f.website})})]}),["twitter","discord","facebook"].map(e=>t.jsxs(j,{as:"label",children:[t.jsx("span",{className:"field__label",children:s(`storeSettings.${e}`)}),t.jsxs(Ie,{children:[t.jsx(Te,{children:f[e]}),t.jsx("input",{type:"text",value:ne(e),disabled:h,onChange:i=>se(e,i.target.value)})]})]},e)),t.jsx(Re,{children:t.jsx(Fe,{variant:"purple","data-testid":"store-settings-save",onClick:()=>void ae(),disabled:!X,children:h?s("storeSettings.saving"):s("storeSettings.save")})})]})]})}export{Ke as StoreSettings,Ke as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-DQ3AciL_.js","_assets/react-DehiWSvs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as t,_ as I,t as F,
|
|
2
|
+
import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as t,_ as I,t as F,w as _,aq as O,ac as W,n as D,q,b as n,v as U,C as V,ar as H,c as B,B as J,as as X}from"./index-D-7WCtxn.js";import{w as G,S as K}from"./buy-gasless-e__YZBZy.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./authorizations-zc6Rq7Wn.js";import"./sendMetaTransaction-BAlAehuy.js";import"./trade-encoding-BDt5HS0k.js";const Q=t.div`
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
5
5
|
/**
|
|
@@ -125,12 +125,12 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
125
125
|
width: 30px;
|
|
126
126
|
height: 30px;
|
|
127
127
|
color: ${s.text};
|
|
128
|
-
`,
|
|
128
|
+
`,he=t.p`
|
|
129
129
|
display: inline-flex;
|
|
130
130
|
align-items: baseline;
|
|
131
131
|
gap: 6px;
|
|
132
132
|
margin: 0;
|
|
133
|
-
`,
|
|
133
|
+
`,pe=t.span`
|
|
134
134
|
font-size: 24px;
|
|
135
135
|
font-weight: 700;
|
|
136
136
|
text-transform: capitalize;
|
|
@@ -201,7 +201,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
201
201
|
font-weight: 600;
|
|
202
202
|
font-size: 13px;
|
|
203
203
|
color: ${s.muted};
|
|
204
|
-
`,
|
|
204
|
+
`,ve=t(O)`
|
|
205
205
|
position: relative;
|
|
206
206
|
z-index: 1;
|
|
207
207
|
color: ${s.muted};
|
|
@@ -210,7 +210,7 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
210
210
|
& [data-avatar] {
|
|
211
211
|
display: none;
|
|
212
212
|
}
|
|
213
|
-
`,
|
|
213
|
+
`,ye=t.div`
|
|
214
214
|
flex-shrink: 0;
|
|
215
215
|
display: flex;
|
|
216
216
|
align-items: center;
|
|
@@ -293,4 +293,4 @@ import{r as g,j as e,b as P,d as N,N as M}from"./react-DehiWSvs.js";import{s as
|
|
|
293
293
|
`,R=t(J)`
|
|
294
294
|
min-width: 160px;
|
|
295
295
|
text-align: center;
|
|
296
|
-
`;function Ae(c){return null}const Se=c=>new Promise(r=>setTimeout(r,c));function Ie(c,r){const[i,a]=g.useState(c?"pending":"confirmed"),x=r?`${r.owner}-${r.contractAddress}-${r.itemId}`:"";return g.useEffect(()=>{if(!c)return;let l=!1;return(async()=>{let f=!1;for(let o=0;o<20&&!l;o++)try{await G(c,{timeoutMs:15e3}),f=!0;break}catch(
|
|
296
|
+
`;function Ae(c){return null}const Se=c=>new Promise(r=>setTimeout(r,c));function Ie(c,r){const[i,a]=g.useState(c?"pending":"confirmed"),x=r?`${r.owner}-${r.contractAddress}-${r.itemId}`:"";return g.useEffect(()=>{if(!c)return;let l=!1;return(async()=>{let f=!1;for(let o=0;o<20&&!l;o++)try{await G(c,{timeoutMs:15e3}),f=!0;break}catch(y){if(y instanceof K)continue;l||a("failed");return}if(!l){if(!f){a("timed-out");return}if(!r){a("confirmed");return}a("indexing");for(let o=0;o<40&&!l;o++){if(await X(r.owner,r.contractAddress,r.itemId)){l||a("confirmed");return}await Se(3e3)}l||a("timed-out")}})(),()=>{l=!0}},[c,x]),i}const Le=B.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump",Te=B.chainId===80002?"https://amoy.polygonscan.com/tx/":"https://polygonscan.com/tx/";function Ue(){var S;const{state:c,search:r}=P(),i=c??Ae(),a=N(),{session:x}=D(),l=i==null?void 0:i.txHash,v=(i==null?void 0:i.items)??[],f=i!=null&&i.creditsAdded&&i.creditsAdded>0?i.creditsAdded:null,o=v[0],y=x!=null&&x.address&&(o!=null&&o.contractAddress)&&(o!=null&&o.itemId)?{owner:x.address,contractAddress:o.contractAddress,itemId:o.itemId}:null,u=Ie(i!=null&&i.settled?void 0:l,y);q({title:n("seo.success.title"),noindex:!0});const p=v;if(p.length===0)return e.jsx(M,{to:"/items",replace:!0});const A=p[0],w=(S=i==null?void 0:i.txHashes)!=null&&S.length?i.txHashes:l?[l]:[],h=w.length>0&&U(x==null?void 0:x.providerType)?w.map((d,k)=>e.jsx(ne,{href:`${Te}${d}`,target:"_blank",rel:"noreferrer",children:w.length>1?n("success.viewTransactionNumbered",{n:k+1,total:w.length}):n("success.viewTransaction")},d)):null;return u!=="confirmed"?e.jsx(L,{children:e.jsx(ee,{children:u==="pending"||u==="indexing"?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"spinner","aria-hidden":!0}),e.jsx(C,{children:u==="indexing"?n("success.finalizing"):n("success.processing")}),e.jsx(z,{children:u==="indexing"?e.jsxs(e.Fragment,{children:[n("success.indexingBefore")," ",p.length===1?e.jsx("strong",{children:A.name}):n("success.itemCount",{count:p.length})," ",n("success.indexingAfter")]}):e.jsxs(e.Fragment,{children:[n("success.confirmingBefore")," ",p.length===1?e.jsx("strong",{children:A.name}):n("success.itemCount",{count:p.length})," ",n("success.confirmingAfter")]})}),h?e.jsx(b,{children:h}):null]}):u==="timed-out"?e.jsxs(e.Fragment,{children:[e.jsx(C,{children:n("success.stillProcessingTitle")}),e.jsxs(z,{children:[n("success.timedOutBefore")," ",e.jsx("button",{className:"link",onClick:()=>a("/activity"),children:n("nav.activity")})," ",n("success.timedOutAfter")]}),h?e.jsx(b,{children:h}):null,e.jsxs(T,{children:[e.jsx(R,{variant:"purple",onClick:()=>a("/activity"),children:n("success.viewActivity")}),e.jsx(R,{variant:"ghost",onClick:()=>a("/items"),children:n("success.keepShopping")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{children:n("success.failedTitle")}),e.jsx(z,{children:n("success.failedBody")}),h?e.jsx(b,{children:h}):null,e.jsx(T,{children:e.jsx(R,{variant:"purple",onClick:()=>a("/items"),children:n("success.backToShop")})})]})})}):e.jsxs(L,{children:[e.jsx(Z,{}),e.jsxs(ie,{children:[e.jsxs(se,{role:"status",children:[e.jsx(re,{"aria-hidden":!0,children:e.jsxs("svg",{viewBox:"0 0 60 60",width:"60",height:"60",children:[e.jsx("circle",{cx:"30",cy:"30",r:"30",fill:"#34ce77"}),e.jsx("path",{d:"M18 31l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxs(oe,{children:[e.jsx("b",{children:n("success.bannerTitle")})," ",n("success.bannerBody")]})]}),e.jsxs(ce,{children:[f?e.jsxs(le,{"data-testid":"success-credits",children:[e.jsx(xe,{}),e.jsxs(he,{children:[e.jsx(pe,{children:n("getCredits.creditsAmount",{credits:f,currency:V.name})})," ",e.jsx(ue,{children:n("getCredits.creditsAdded")})]})]}):null,p.map((d,k)=>{const $=d.quantity??1;return e.jsxs(ae,{children:[k>0?e.jsx(de,{"aria-hidden":!0}):null,e.jsxs(fe,{children:[e.jsxs(ge,{children:[d.thumbnail?e.jsx("img",{src:d.thumbnail,alt:""}):null,e.jsx(me,{"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(je,{children:[e.jsxs(we,{title:d.name,children:[d.name||n("buyModal.itemFallback"),$>1?e.jsx(be,{children:n("cartCheckout.qty",{count:$})}):null]}),d.creator?e.jsx(ve,{address:d.creator,linkToProfile:!0}):null]}),e.jsxs(ye,{children:[e.jsx(ke,{}),e.jsx("span",{children:H(d.priceCredits*$)})]})]})]},d.id)})]}),h?e.jsx(b,{"data-receipt":!0,children:h}):null,e.jsxs($e,{children:[e.jsx(Ce,{"data-variant":"ghost",onClick:()=>a("/my-items"),children:n("success.myAssets")}),e.jsxs(ze,{"data-variant":"ruby",href:Le,target:"_blank",rel:"noreferrer",children:[n("success.tryInWorld"),e.jsx(Re,{"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]})]})}export{Ue as Success,Ue as default};
|