@dcl/shop 1.0.2-31061650925.commit-fa244eb → 1.0.2-31061952187.commit-8d8b09e

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.
Files changed (175) hide show
  1. package/_assets/{Activity-DAMRT2bN.js → Activity-D_fQdZon.js} +8 -8
  2. package/_assets/{AnimatedBackground-N_wcSf6D.js → AnimatedBackground-C9W4RBcZ.js} +1 -1
  3. package/_assets/{Assets-7wgiv5MU.js → Assets-CvZql_4R.js} +2 -2
  4. package/_assets/{Assets.styles-9R6ppWqo.js → Assets.styles-BBWJCcMx.js} +1 -1
  5. package/_assets/{Authorizations-DCP2Yevg.js → Authorizations-DVwQ95Ww.js} +1 -1
  6. package/_assets/{Cart-CpLaRQWb.js → Cart-CBLHJRVj.js} +6 -6
  7. package/_assets/{CircularProgress-BYXbDw8X.js → CircularProgress-D09608yv.js} +1 -1
  8. package/_assets/{Collection-CA94Ylrk.js → Collection-DllncUVv.js} +10 -10
  9. package/_assets/{CollectionCarousel-BkFV4le7.js → CollectionCarousel-B9HmGuVb.js} +6 -6
  10. package/_assets/{Confetti-D7bsXMqQ.js → Confetti-Dl6FT7nL.js} +1 -1
  11. package/_assets/{Creator-DWKYxWTB.js → Creator-BreBnKPX.js} +5 -5
  12. package/_assets/{ErrorNotice-CCsvrT3H.js → ErrorNotice-OUNK486K.js} +1 -1
  13. package/_assets/{ExchangeController-KIbY1TeV.js → ExchangeController-Cp3qbfAM.js} +1 -1
  14. package/_assets/{Faq-YyrvPI25.js → Faq-DXtTtsuA.js} +1 -1
  15. package/_assets/{GetCredits-gCz6CMY3.js → GetCredits-BhRNCaTG.js} +10 -10
  16. package/_assets/{Grow-B6W2xyXd.js → Grow-DXdR0gI9.js} +1 -1
  17. package/_assets/{HelpersUtil-BmHoBPAz.js → HelpersUtil-rQp5uDAx.js} +1 -1
  18. package/_assets/{ItemDetail-DsP2PTh3.js → ItemDetail-clRbfaLQ.js} +28 -28
  19. package/_assets/LazyEmoteControls-B7UYn8xk.js +2 -0
  20. package/_assets/{LoadMore-ChGcAM1i.js → LoadMore-jSNRJiwZ.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-CZgGH3OR.js → ManaPricingBanner.styles-vDUAKLLe.js} +1 -1
  22. package/_assets/{MyAssets-jgTQywGo.js → MyAssets-CsWhc-qa.js} +4 -4
  23. package/_assets/{MyFavorites-B_oQzUR9.js → MyFavorites-BLrz2vwY.js} +1 -1
  24. package/_assets/{NotFound-CjDp1Ys_.js → NotFound-DP4nosOd.js} +1 -1
  25. package/_assets/{NotificationsBell-Dkr9JB0w.js → NotificationsBell-ARziPv8W.js} +1 -1
  26. package/_assets/OutfitDetail-CLmuEgB3.js +374 -0
  27. package/_assets/{OutfitPreview-J5m3e8Gl.js → OutfitPreview-PWdXvCaE.js} +2 -2
  28. package/_assets/{OutfitStudio-xpf5tPAA.js → OutfitStudio-Cx3Xm6ff.js} +11 -11
  29. package/_assets/{StoreSettings-BkFED3xP.js → StoreSettings-BQtEgWRm.js} +21 -21
  30. package/_assets/{Success-lmJVKgtL.js → Success-BWfI3_Mu.js} +1 -1
  31. package/_assets/{SwapController-DKvQsgHw.js → SwapController-Bf58lQ6b.js} +1 -1
  32. package/_assets/{Tooltip-BBYuQHQb.js → Tooltip-BDmKiALz.js} +1 -1
  33. package/_assets/{TradeService-CkbprpVw.js → TradeService-Yecm1OxI.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-6oL2Do5B.js → W3MFrameProviderSingleton-BQyeyr-U.js} +3 -3
  35. package/_assets/{WebCryptoP256-6t0_XFco.js → WebCryptoP256-Ou_F2OJp.js} +1 -1
  36. package/_assets/{authorizations-CbXH-W_L.js → authorizations-B3AvOvOm.js} +1 -1
  37. package/_assets/{basic-DSLXBfxu.js → basic-DTDRwam-.js} +1 -1
  38. package/_assets/{biconomy-DKrndD59.js → biconomy-DaLi1O64.js} +1 -1
  39. package/_assets/{builder-CVMQir9d.js → builder-DxumJmKw.js} +1 -1
  40. package/_assets/{buy-BllmT-mt.js → buy-BHkfYJLe.js} +1 -1
  41. package/_assets/{buy-gasless-BuzErI_K.js → buy-gasless-BfTEWjT9.js} +1 -1
  42. package/_assets/{categories-Bjf-PXbG.js → categories-D23W_J-A.js} +1 -1
  43. package/_assets/{ccip-DI15Urx-.js → ccip-DGVhZCZ4.js} +1 -1
  44. package/_assets/{ccip-DyRqdu6M.js → ccip-qhHiv1gU.js} +1 -1
  45. package/_assets/{collectionPage.styles-BgKDi1Aa.js → collectionPage.styles-CoEdrsfq.js} +3 -3
  46. package/_assets/{controller-BSVA5WKe.js → controller-DGtmLk4f.js} +2 -2
  47. package/_assets/{core-CflNwoXZ.js → core-BAqS3vu7.js} +4 -4
  48. package/_assets/{createSvgIcon-BCgRSx6l.js → createSvgIcon-Bm9nxGqG.js} +2 -2
  49. package/_assets/{custom-ekboJ4XZ.js → custom-MaGTnz7S.js} +1 -1
  50. package/_assets/{data-capture-C00Edv8o.js → data-capture-5Vi1cyBa.js} +1 -1
  51. package/_assets/{email-D7bKqbcO.js → email-BG6hRXMo.js} +1 -1
  52. package/_assets/{embedded-wallet-BgZe_e0-.js → embedded-wallet-CfnknCH8.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-BsZP4P-B.js → emotion-styled.browser.esm-CoxAZUrJ.js} +1 -1
  54. package/_assets/{engine-Cnqy1olA.js → engine-nQGCV50K.js} +1 -1
  55. package/_assets/{errors-BXmP5k3l.js → errors-DZ_QWsza.js} +1 -1
  56. package/_assets/{estimate-l1-fee-9ryWwmxC.js → estimate-l1-fee-CVpJ9ym5.js} +1 -1
  57. package/_assets/{execute-CY4XWL-J.js → execute-DFvUDrLY.js} +2 -2
  58. package/_assets/{features-MG4MlDMD.js → features-BXUedULM.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-qCCUs6iE.js → fetchTokenMetadata-CkQcnzmO.js} +2 -2
  60. package/_assets/{field.styles-DEvu6yNO.js → field.styles-PE4ZasC2.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-DEImAnzE.js → get-ecosystem-wallet-info-CRLH8I6C.js} +1 -1
  62. package/_assets/{getBalance-J5grsfOj.js → getBalance-CiV48JsZ.js} +1 -1
  63. package/_assets/{getNFT-ByNh7y6k.js → getNFT-C3ucNb89.js} +1 -1
  64. package/_assets/{getNFT-Dm5aL9u2.js → getNFT-CV3N9TTA.js} +1 -1
  65. package/_assets/{grid.styles-CtrXwvIr.js → grid.styles-hOZTJ80g.js} +1 -1
  66. package/_assets/{hashTypedData-CgttwS7E.js → hashTypedData-BtF2J233.js} +1 -1
  67. package/_assets/{hashTypedData-BxKbqj1M.js → hashTypedData-gTABcRB5.js} +1 -1
  68. package/_assets/{in-app-DF-fkkCZ.js → in-app-CSDr4Blb.js} +1 -1
  69. package/_assets/{in-app-wallet-calls-D9z1I0uV.js → in-app-wallet-calls-Crivl9zc.js} +1 -1
  70. package/_assets/{index-BybKxZca.js → index-1oceTWwb.js} +3 -3
  71. package/_assets/{index-Fn-DLeUg.js → index-9_4ZEs3N.js} +1 -1
  72. package/_assets/{index-C5fUw5Ha.js → index-9x1mGBeU.js} +1 -1
  73. package/_assets/{index-DXpGefPo.js → index-BBbwMaBz.js} +1 -1
  74. package/_assets/{index-BiSRuBrK.js → index-BNBzDf6z.js} +1 -1
  75. package/_assets/{index-CjSsletQ.js → index-BTDIKmoC.js} +1 -1
  76. package/_assets/{index-CuZ7SJno.js → index-Bg_gOSx_.js} +1 -1
  77. package/_assets/{index-BFgGvh7x.js → index-BniGBCAO.js} +1 -1
  78. package/_assets/{index-DbCIWeQF.js → index-Bs4LvV4K.js} +2 -2
  79. package/_assets/{index-B6xwPPMs.js → index-C0pcaEQl.js} +1 -1
  80. package/_assets/{index-BDPRDW4c.js → index-C23D_vyT.js} +1 -1
  81. package/_assets/{index-C0xt2SIQ.js → index-C5Evg5sh.js} +1 -1
  82. package/_assets/{index-D7foy_c1.js → index-C7hpB9s1.js} +3 -3
  83. package/_assets/{index-zG9t0hxJ.js → index-CGBg3yUz.js} +11 -11
  84. package/_assets/{index--tlhUPhu.js → index-CHf7lsmp.js} +1 -1
  85. package/_assets/{index-B7sgFJOZ.js → index-CHolIX6U.js} +1 -1
  86. package/_assets/{index-D7dTUoYt.js → index-CKUuopSw.js} +12 -12
  87. package/_assets/{index-Z6tclw43.js → index-CS27am7J.js} +1 -1
  88. package/_assets/{index-BlIt7KpC.js → index-Cf-gi-Qq.js} +1 -1
  89. package/_assets/{index-C2s-_3dE.js → index-CkGO7qOd.js} +1 -1
  90. package/_assets/{index-BcW0TBOx.js → index-ClUPCoEW.js} +1 -1
  91. package/_assets/{index-gbxeK1C-.js → index-CmY0V0eX.js} +1 -1
  92. package/_assets/{index-BKC-pfo2.js → index-CvwosU6Y.js} +1 -1
  93. package/_assets/{index-B7Mvi-Fg.js → index-CwRTjZPC.js} +3 -3
  94. package/_assets/{index-lIySTE8R.js → index-CyRHowbs.js} +1 -1
  95. package/_assets/{index-CpxvlmGa.js → index-D5eMvKb_.js} +1 -1
  96. package/_assets/{index-7eX0SEVb.js → index-D769FdFr.js} +1 -1
  97. package/_assets/{index-CszjRehO.js → index-D7LYoLo4.js} +1 -1
  98. package/_assets/{index-CAj85Mcv.js → index-DKHMu0o3.js} +1 -1
  99. package/_assets/{index-CuZGDrIM.js → index-DKdQUEzy.js} +1 -1
  100. package/_assets/{index-DYQXXAKt.js → index-DLFQdlEW.js} +1 -1
  101. package/_assets/{index-Cbj1bJsc.js → index-DSuiX4WG.js} +1 -1
  102. package/_assets/{index-BSmKDErh.js → index-DXRL-4ld.js} +1 -1
  103. package/_assets/{index-BZNkhtbZ.js → index-DY1xBku2.js} +1 -1
  104. package/_assets/{index-D_a1Dj89.js → index-DdmULNRk.js} +2 -2
  105. package/_assets/{index-DVJFosyx.js → index-DgOiZShm.js} +1 -1
  106. package/_assets/{index-BsD9lKdu.js → index-Dh85kccn.js} +1 -1
  107. package/_assets/{index-CkHS5p_Q.js → index-DjTNPtj2.js} +1 -1
  108. package/_assets/{index-CIKoh-oU.js → index-DkV5TYom.js} +1 -1
  109. package/_assets/{index-DRjhhI6j.js → index-DnJJn52L.js} +1 -1
  110. package/_assets/{index-CKXjZ-Kd.js → index-DoGz07sk.js} +1 -1
  111. package/_assets/{index-D20327nw.js → index-Dp2641E3.js} +1 -1
  112. package/_assets/{index-CbQYrUIv.js → index-DwX-9Zo4.js} +1 -1
  113. package/_assets/{index-BcQ98rhd.js → index-EKmmXx1j.js} +1 -1
  114. package/_assets/{index-gmA5M3R1.js → index-HAEoS9R6.js} +1 -1
  115. package/_assets/{index-DlewIau_.js → index-ItjVcw1b.js} +1 -1
  116. package/_assets/{index-B5TGt1q8.js → index-KWEbYeSY.js} +1 -1
  117. package/_assets/{index-CAzui_hj.js → index-S0X-BG2b.js} +1 -1
  118. package/_assets/{index-C6RxhKIE.js → index-UyXkCiLs.js} +1 -1
  119. package/_assets/{index-Dc_jl2yy.js → index-hKv-BpxY.js} +1 -1
  120. package/_assets/{index-CgKz1pmK.js → index-qGMuaBIs.js} +1 -1
  121. package/_assets/{index-D5jN8YQk.js → index-wRmEiTlP.js} +2 -2
  122. package/_assets/{index.es-BOuSF7GL.js → index.es-DnMGDxtr.js} +1 -1
  123. package/_assets/{index.es-6tzroQMk.js → index.es-g_bB-nFv.js} +1 -1
  124. package/_assets/{index.es-11O0MAa5.js → index.es-wpL2Ycto.js} +4 -4
  125. package/_assets/{localBatchGatewayRequest-CByVkxJB.js → localBatchGatewayRequest-DtELSHiE.js} +1 -1
  126. package/_assets/{networks-CLAHX11r.js → networks-ZmRqsvV6.js} +1 -1
  127. package/_assets/{onramp-X6DWjNa-.js → onramp-Bffl3qa3.js} +1 -1
  128. package/_assets/{openzeppelin-DWrLU4le.js → openzeppelin-BmH-LNci.js} +1 -1
  129. package/_assets/{parseNft-C0F1eSr9.js → parseNft-PSjb4qKi.js} +2 -2
  130. package/_assets/{parseSignature-Cfa0bf3p.js → parseSignature-D947kFfv.js} +3 -3
  131. package/_assets/{parseSignature-B1BDTVRI.js → parseSignature-IigTmAp7.js} +1 -1
  132. package/_assets/{passkeys-Bq7ndAcy.js → passkeys-BsJVcpuM.js} +1 -1
  133. package/_assets/{pay-with-exchange-DU8q52b9.js → pay-with-exchange-CU_HZd9F.js} +1 -1
  134. package/_assets/{qr-overlay-2pcgXiq0.js → qr-overlay-EMShc5uE.js} +1 -1
  135. package/_assets/{receive-UZ0WD1OR.js → receive-CO6WElZa.js} +1 -1
  136. package/_assets/{resolveImplementation-C5KIPshP.js → resolveImplementation-CUngPhAv.js} +1 -1
  137. package/_assets/{rpc-q5JetAPC.js → rpc-BqH_VMy9.js} +1 -1
  138. package/_assets/{secp256k1-C79pdbKP.js → secp256k1-CTsmRKJj.js} +1 -1
  139. package/_assets/{secp256k1-C35ing1J.js → secp256k1-D7kpLshE.js} +1 -1
  140. package/_assets/{secp256k1-CYrjGZQC.js → secp256k1-DneM3aYG.js} +1 -1
  141. package/_assets/{send-_ymraJKw.js → send-DnwW2LgN.js} +1 -1
  142. package/_assets/{send-batch-transaction-DkYVZ1xj.js → send-batch-transaction-BgJnfEM8.js} +1 -1
  143. package/_assets/{send-eip712-transaction-BzZBuy56.js → send-eip712-transaction-Cw3ykz5y.js} +2 -2
  144. package/_assets/{send-gasless-transaction-ByRZPFH6.js → send-gasless-transaction-BjGhnCwR.js} +2 -2
  145. package/_assets/{send-transaction-CUkh0xRu.js → send-transaction-COKVeGfk.js} +2 -2
  146. package/_assets/{sendMetaTransaction-De85nOcx.js → sendMetaTransaction-Bp3kwdLJ.js} +1 -1
  147. package/_assets/{sendRawTransaction-D5RykxPX.js → sendRawTransaction-eVli2oE3.js} +3 -3
  148. package/_assets/{serializeTransaction-EYy94JNM.js → serializeTransaction-CIM9i_-w.js} +1 -1
  149. package/_assets/{session-proposal-Bf_Po3Sl.js → session-proposal-KGl_Ah2b.js} +1 -1
  150. package/_assets/{session-request-DEDmAqA-.js → session-request-VAEXTksW.js} +2 -2
  151. package/_assets/{signing-DqKP5KUZ.js → signing-Cgx49_1X.js} +3 -3
  152. package/_assets/{skeleton.styles-CVQk0siV.js → skeleton.styles-BXNXDWEi.js} +1 -1
  153. package/_assets/{socials-3pLrS-E7.js → socials-oKAOeF-k.js} +1 -1
  154. package/_assets/{styled-8pFgehSd.js → styled-pD_2hanx.js} +1 -1
  155. package/_assets/{swaps-C-dgABl9.js → swaps-BcAY_D99.js} +1 -1
  156. package/_assets/{thirdweb-C6_KggNb.js → thirdweb-ChAqWFCO.js} +3 -3
  157. package/_assets/{to-serializable-transaction-BWUJjZdO.js → to-serializable-transaction-D9qGbcrS.js} +2 -2
  158. package/_assets/{transactionReceipt-DmwkwkkP.js → transactionReceipt-BMw52z-f.js} +1 -1
  159. package/_assets/{transactions-BSJMdJi4.js → transactions-CeENvGIt.js} +1 -1
  160. package/_assets/{useCreditPacks-DQxqJepP.js → useCreditPacks-BcavayJ3.js} +1 -1
  161. package/_assets/{useImportable-Co0AaRPY.js → useImportable-CqnIvzif.js} +1 -1
  162. package/_assets/{useInfiniteGrid-UHC0Jjfu.js → useInfiniteGrid-BjEQAabI.js} +1 -1
  163. package/_assets/{useTheme-B-55uBZP.js → useTheme-BnnteKI4.js} +1 -1
  164. package/_assets/{verifyHash-BGJh7VH4.js → verifyHash-CuRmy06R.js} +1 -1
  165. package/_assets/{w3m-modal-CwXD068w.js → w3m-modal-BvOCJx7k.js} +1 -1
  166. package/_assets/{w3m-modal-CjXODL26.js → w3m-modal-CkBFH4cA.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-DRA8zhkS.js → wait-for-tx-receipt-B2KaPYJT.js} +1 -1
  168. package/_assets/{wallets-DOXRX-PZ.js → wallets-CpXU08d2.js} +5 -5
  169. package/_assets/{web-connector-CXxJTFl4.js → web-connector-BHRkWbB9.js} +3 -3
  170. package/_assets/{writeContract-BdEWRAPa.js → writeContract-DNDGvg0r.js} +1 -1
  171. package/_assets/{zoraTestnet-CzfX948o.js → zoraTestnet-CCn01jlp.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/LazyEmoteControls-lVtDIvME.js +0 -2
  175. package/_assets/OutfitDetail-BNlw-NwV.js +0 -334
@@ -0,0 +1,374 @@
1
+ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s as t,I as w,O as se,P as ne,B as $,Q as oe,o as M,R as re,v as le,x as de,b as s,S as _,U as A,V as ce,W as he,X as pe,Y as me,Z as ue,$ as xe,a0 as ge,a1 as fe,a2 as be,a3 as ye,a4 as ve,a5 as je,a6 as we,a7 as $e,a8 as ke,a9 as Ie,z,aa as Ce,ab as Ee,ac as ze,ad as Le,ae as We,af as Oe}from"./index-CKUuopSw.js";import{E as H}from"./ErrorNotice-OUNK486K.js";import{E as Se}from"./LazyEmoteControls-B7UYn8xk.js";import{O as Fe}from"./OutfitPreview-PWdXvCaE.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:n,radius:g,media:r,gradients:Ae}=ae,K=t.div`
2
+ max-width: 1721px;
3
+ margin: 0 auto;
4
+ `,Te=t.nav`
5
+ display: flex;
6
+ align-items: center;
7
+ gap: 8px;
8
+ font-size: 13px;
9
+ color: ${n.gray4};
10
+ margin-bottom: 18px;
11
+ `,T=t(k)`
12
+ color: ${n.gray4};
13
+
14
+ &:hover {
15
+ color: ${n.white};
16
+ }
17
+ `,Pe=t.span`
18
+ color: ${n.softWhite};
19
+ font-weight: 600;
20
+ overflow: hidden;
21
+ white-space: nowrap;
22
+ text-overflow: ellipsis;
23
+ `,q=t.div`
24
+ display: grid;
25
+ grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
26
+ gap: 40px;
27
+ align-items: stretch;
28
+ height: calc(100dvh - 240px);
29
+ min-height: 520px;
30
+
31
+ ${r.maxWidth("mobile")} {
32
+ grid-template-columns: 1fr;
33
+ gap: 16px;
34
+ height: auto;
35
+ min-height: 0;
36
+ }
37
+ `,D=t.div`
38
+ position: relative;
39
+ border-radius: 24px;
40
+ overflow: hidden;
41
+ background: ${n.media};
42
+
43
+ /* Full-bleed square on phones (Figma): the artwork runs edge to edge, so the panel gives up both its
44
+ radius and the page's 16px gutter. */
45
+ ${r.maxWidth("mobile")} {
46
+ aspect-ratio: 1 / 1;
47
+ margin: 0 -16px;
48
+ border-radius: 0;
49
+ }
50
+
51
+ & iframe {
52
+ width: 100%;
53
+ height: 100%;
54
+ border: 0;
55
+ display: block;
56
+ }
57
+
58
+ [data-preview-viewport] {
59
+ position: absolute;
60
+ inset: 0;
61
+ pointer-events: none;
62
+ }
63
+ `,Re=t.div`
64
+ position: absolute;
65
+ inset: 0;
66
+ pointer-events: none;
67
+
68
+ & [class*='MuiBox'] {
69
+ pointer-events: auto;
70
+ }
71
+ `,Be=t.img`
72
+ position: absolute;
73
+ inset: 0;
74
+ width: 100%;
75
+ height: 100%;
76
+ object-fit: contain;
77
+ `,U=t.div`
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 15px;
81
+ min-height: 0;
82
+ `,Ne=t.h1`
83
+ font-size: 28px;
84
+ font-weight: 600;
85
+ color: ${n.softWhite};
86
+ overflow-wrap: anywhere;
87
+
88
+ ${r.maxWidth("mobile")} {
89
+ font-size: 20px;
90
+ line-height: 24px;
91
+ }
92
+ `,Me=t.p`
93
+ font-size: 12px;
94
+ font-weight: 500;
95
+ letter-spacing: 0.04em;
96
+ text-transform: uppercase;
97
+ color: ${n.gray4};
98
+ `,_e=t.div`
99
+ flex: 0 1 auto;
100
+ min-height: 0;
101
+ overflow-y: auto;
102
+ /* Breathing room INSIDE the scroller (with the matching negative margin re-aligning the cards):
103
+ the hover zoom + ring + glow would otherwise be cropped by the overflow clip. */
104
+ padding: 8px 10px;
105
+ margin: -8px -10px;
106
+ scrollbar-width: thin;
107
+ scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
108
+
109
+ ${r.maxWidth("mobile")} {
110
+ overflow: visible;
111
+ padding: 0;
112
+ margin: 0;
113
+ }
114
+ `,He=t.ul`
115
+ list-style: none;
116
+ margin: 0;
117
+ padding: 0;
118
+ display: flex;
119
+ flex-direction: column;
120
+ gap: 10px;
121
+ `,Ke=t.li`
122
+ position: relative;
123
+ display: flex;
124
+ align-items: stretch;
125
+ gap: 14px;
126
+ border-radius: ${g.card};
127
+ background: rgba(0, 0, 0, 0.4);
128
+ color: ${n.softWhite};
129
+ overflow: hidden;
130
+ isolation: isolate;
131
+ transition:
132
+ box-shadow 0.35s ease,
133
+ transform 0.25s ease;
134
+
135
+ &::before {
136
+ content: '';
137
+ position: absolute;
138
+ inset: 0;
139
+ z-index: 5;
140
+ pointer-events: none;
141
+ border-radius: inherit;
142
+ ${se};
143
+ opacity: 0;
144
+ transition: opacity 0.3s ease;
145
+ }
146
+
147
+ @media (hover: hover) {
148
+ &:hover,
149
+ &:focus-within {
150
+ ${ne};
151
+ transform: scale(1.015);
152
+ /* Above the neighbouring rows while zoomed, or the next card paints over the growth. */
153
+ z-index: 6;
154
+ }
155
+ &:hover::before,
156
+ &:focus-within::before {
157
+ opacity: 1;
158
+ }
159
+ }
160
+
161
+ @media (prefers-reduced-motion: reduce) {
162
+ transition: none;
163
+
164
+ &:hover,
165
+ &:focus-within {
166
+ transform: none;
167
+ }
168
+ &::before {
169
+ transition: none;
170
+ }
171
+ }
172
+
173
+ &[data-state='unavailable'],
174
+ &[data-state='missing'] {
175
+ opacity: 0.55;
176
+ }
177
+ `,qe=t(k)`
178
+ position: absolute;
179
+ inset: 0;
180
+ z-index: 1;
181
+ `,De=t.img`
182
+ width: 96px;
183
+ height: 96px;
184
+ object-fit: cover;
185
+ border-radius: ${g.card};
186
+ background: ${n.media};
187
+ flex-shrink: 0;
188
+
189
+ ${r.maxWidth("mobile")} {
190
+ width: 88px;
191
+ height: 88px;
192
+ }
193
+ `,Ue=t.span`
194
+ width: 96px;
195
+ height: 96px;
196
+ border-radius: ${g.card};
197
+ background: ${n.media};
198
+ flex-shrink: 0;
199
+
200
+ ${r.maxWidth("mobile")} {
201
+ width: 88px;
202
+ height: 88px;
203
+ }
204
+ `,P=t.div`
205
+ flex: 1;
206
+ min-width: 0;
207
+ display: flex;
208
+ flex-direction: column;
209
+ justify-content: center;
210
+ gap: 3px;
211
+ padding: 10px 14px 10px 0;
212
+ `,L=t.span`
213
+ font-size: 14px;
214
+ font-weight: 600;
215
+ white-space: nowrap;
216
+ overflow: hidden;
217
+ text-overflow: ellipsis;
218
+ `,Ve=t(k)`
219
+ position: relative;
220
+ z-index: 2;
221
+ align-self: flex-start;
222
+ font-size: 13px;
223
+ color: ${n.gray4};
224
+
225
+ &:hover {
226
+ color: ${n.softWhite};
227
+ text-decoration: underline;
228
+ }
229
+ `,R=t.span`
230
+ display: flex;
231
+ align-items: center;
232
+ gap: 6px;
233
+ margin-top: 2px;
234
+ `,Qe=t.span`
235
+ display: inline-flex;
236
+ align-items: center;
237
+ gap: 5px;
238
+ font-size: 16px;
239
+ font-weight: 600;
240
+ white-space: nowrap;
241
+ `,v=t.span`
242
+ font-size: 12px;
243
+ font-weight: 400;
244
+ padding: 2px 8px;
245
+ border-radius: ${g.chip};
246
+ background: rgba(255, 255, 255, 0.14);
247
+ color: ${n.softWhite};
248
+ white-space: nowrap;
249
+ `,Ge=t.span`
250
+ display: flex;
251
+ align-items: center;
252
+ gap: 3px;
253
+ margin-left: auto;
254
+
255
+ ${r.maxWidth("mobile")} {
256
+ display: none;
257
+ }
258
+ `,j=t(oe)`
259
+ border-radius: 6px;
260
+
261
+ &[data-variant='smart'],
262
+ &[data-variant='icon'] {
263
+ background: rgba(22, 21, 24, 0.55);
264
+ color: ${n.softWhite};
265
+ }
266
+ &[data-variant='smart'] {
267
+ gap: 2px;
268
+ text-transform: uppercase;
269
+ letter-spacing: 0.02em;
270
+ }
271
+ &[data-variant='icon'] .ico {
272
+ color: ${n.softWhite};
273
+ }
274
+ `,Xe=t.p`
275
+ margin-top: 8px;
276
+ font-size: 13px;
277
+ color: ${n.gray4};
278
+ `,Ye=t.div`
279
+ display: flex;
280
+ flex-direction: column;
281
+ align-items: flex-start;
282
+ gap: 12px;
283
+ padding: 8px 0;
284
+ `,Ze=t.div`
285
+ display: flex;
286
+ flex-direction: column;
287
+ gap: 12px;
288
+ padding-top: 12px;
289
+ border-top: 1px solid rgba(255, 255, 255, 0.3);
290
+
291
+ ${r.maxWidth("mobile")} {
292
+ /* Sticky, not fixed: it rides the viewport bottom while the list is longer than the screen,
293
+ then STOPS at the list's end (its natural place as the column's last child) when the user
294
+ scrolls on toward the footer. Negative margin restores the full-bleed bar inside the page's
295
+ 16px gutter. */
296
+ position: sticky;
297
+ bottom: 0;
298
+ z-index: 5;
299
+ margin: 40px -16px 0;
300
+ padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
301
+ border-top: 0;
302
+ background: ${n.accent};
303
+ box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
304
+ }
305
+ `,Je=t.div`
306
+ display: flex;
307
+ align-items: center;
308
+ justify-content: space-between;
309
+
310
+ ${r.maxWidth("mobile")} {
311
+ /* The phone CTA carries the price itself (the Figma bar). */
312
+ display: none;
313
+ }
314
+ `,et=t.span`
315
+ font-size: 14px;
316
+ font-weight: 600;
317
+ letter-spacing: 0.04em;
318
+ text-transform: uppercase;
319
+ color: ${n.gray4};
320
+ `,tt=t.span`
321
+ display: inline-flex;
322
+ align-items: center;
323
+ gap: 6px;
324
+ font-size: 26px;
325
+ font-weight: 800;
326
+ color: ${n.softWhite};
327
+ `,it=t($)`
328
+ width: 100%;
329
+ min-height: 52px;
330
+ border-radius: 16px;
331
+ display: inline-flex;
332
+ align-items: center;
333
+ justify-content: center;
334
+ gap: 10px;
335
+
336
+ && {
337
+ background: ${Ae.buyBtn};
338
+ }
339
+ &&::before {
340
+ content: none;
341
+ }
342
+ &&:hover:not(:disabled) {
343
+ background-image: linear-gradient(${n.dclRed}, ${n.dclRed});
344
+ }
345
+
346
+ ${r.maxWidth("mobile")} {
347
+ border-radius: ${g.pill};
348
+ }
349
+ `,at=t.span`
350
+ display: none;
351
+
352
+ ${r.maxWidth("mobile")} {
353
+ display: inline-flex;
354
+ align-items: center;
355
+ gap: 5px;
356
+ font-size: 16px;
357
+ }
358
+ `,B=t.div`
359
+ min-height: 52vh;
360
+ display: flex;
361
+ flex-direction: column;
362
+ align-items: center;
363
+ justify-content: center;
364
+ text-align: center;
365
+ gap: 14px;
366
+ color: ${n.softWhite};
367
+ `,st=t(w)`
368
+ opacity: 0.4;
369
+ `,nt=t.h1`
370
+ font-size: 24px;
371
+ `,ot=t.p`
372
+ margin: 0;
373
+ color: ${n.gray4};
374
+ `,N="outfit-detail-preview";function yt(){const{id:i}=ie(),o=M(b=>b.session),c=re(),f=c==="creator",{data:l,isError:I,refetch:m}=le({queryKey:["outfit",i,f],enabled:A()&&!!i,staleTime:6e4,queryFn:()=>Oe(i,f&&o?o.identity:void 0)}),d=!A()||!i||l===null&&c!=="pending";return de(d?{title:s("seo.outfit.notFoundTitle"),noindex:!0}:l?{title:l.name,image:_(l.thumbnailHash)??void 0}:{}),d?e.jsxs(B,{"data-testid":"outfit-notfound",children:[e.jsx(st,{name:"cart",size:44}),e.jsx(nt,{children:s("outfits.detail.notFoundTitle")}),e.jsx(ot,{children:s("outfits.detail.notFoundBody")}),e.jsx($,{as:k,to:"/items",variant:"purple",children:s("notFound.cta")})]}):I?e.jsxs(B,{"data-testid":"outfit-detail-error",children:[e.jsx(H,{message:s("outfits.errors.generic")}),e.jsx($,{variant:"purple",onClick:()=>void m(),children:s("outfits.detail.retry")})]}):l?e.jsx(lt,{outfit:l}):e.jsx(K,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(q,{children:[e.jsx(D,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(U,{children:[e.jsx("span",{className:"skeleton",style:{width:"60%",height:32},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"40%",height:16},"aria-hidden":!0}),e.jsx("span",{className:"skeleton",style:{width:"100%",height:48},"aria-hidden":!0})]})]})})}function rt({item:i}){const o=Ce(i),c=Ee(i.gender);return e.jsxs(Ge,{children:[i.rarity?e.jsx(j,{"data-variant":"rarity",style:{background:We(i.rarity)},title:Le(i.rarity),children:ze(i.rarity)}):null,i.isSmart?e.jsxs(j,{"data-variant":"smart",children:[e.jsx(w,{name:"smart",size:13}),s("assetCard.smart")]}):null,o?e.jsx(j,{"data-variant":"icon",children:e.jsx(w,{name:o})}):null,c?e.jsx(j,{"data-variant":"icon",children:e.jsx(w,{name:c})}):null]})}function lt({outfit:i}){const o=ce(i),{split:c,availableCount:f,totalCredits:l,addOutfit:I,isAdding:m}=he(i,o),d=M(a=>{var x;return(x=a.session)==null?void 0:x.address}),b=pe(a=>a.items),W=h.useMemo(()=>new Set(b.map(me)),[b]),O=_(i.thumbnailHash),S=h.useRef(null);h.useEffect(()=>{S.current!==i.id&&(S.current=i.id,ue("Shop Outfit Viewed",{outfit_id:i.id,item_count:i.items.length}))},[i.id,i.items.length]);const C=h.useMemo(()=>i.items.map(a=>{const x=xe(a),E=o.byKey.get(x)??null;return{key:x,item:E,state:E?ge(E,{address:d,cartKeys:W}):"missing"}}),[i,o.byKey,d,W]),{data:V,isFetched:Q}=fe(d),G=!d||Q,X=!!d&&!!V,Y=i.bodyShape==="female"?be:i.bodyShape==="male"?ye:void 0,u=h.useMemo(()=>C.map(a=>a.item).filter(a=>!!a),[C]),F=h.useMemo(()=>ve(u),[u]),Z=h.useMemo(()=>!!je(u),[u]),J=h.useMemo(()=>u.map(a=>we(a)??"").filter(Boolean),[u]),p=$e({address:d,tryOnUrns:F,tryOnCategories:J}),ee=i.items.length,te=!o.isLoading&&!o.isError,y=c.purchasable.length;return e.jsxs(K,{"data-testid":"outfit-detail",children:[e.jsxs(Te,{"aria-label":s("outfits.detail.breadcrumbAria"),children:[e.jsx(T,{to:"/overview",children:s("nav.overview")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(T,{to:"/overview",children:s("outfits.detail.breadcrumbLooks")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pe,{children:i.name})]}),e.jsxs(q,{children:[e.jsx(D,{"data-testid":"outfit-detail-preview",style:{background:ke(i)},children:O&&!o.isLoading&&F.length===0?e.jsx(Be,{src:O,alt:i.name}):e.jsx(Fe,{id:N,profile:p.profile,bodyShape:p.bodyShape??(X?void 0:Y),urns:p.urns,skin:p.skin,hair:p.hair,eyes:p.eyes,enabled:G&&!p.isLoading&&!o.isLoading,controls:Z?e.jsx(Re,{"data-testid":"outfit-emote-controls",children:e.jsx(Se,{wearablePreviewId:N,hideFrameInput:!0})}):null})}),e.jsxs(U,{children:[e.jsx(Ne,{children:i.name}),e.jsx(Me,{"data-testid":"outfit-detail-meta",children:s("outfits.detail.itemsCount",{count:ee})}),o.isError?e.jsxs(Ye,{children:[e.jsx(H,{message:s("outfits.detail.resolveError"),testId:"outfit-detail-resolve-error"}),e.jsx($,{variant:"outline","data-testid":"outfit-detail-retry",onClick:o.retry,children:s("outfits.detail.retry")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(_e,{children:[e.jsx(He,{children:C.map(a=>e.jsx(Ke,{"data-testid":"outfit-detail-item","data-state":a.state,children:a.item?e.jsxs(e.Fragment,{children:[e.jsx(qe,{to:`/item/${a.item.contractAddress}/${a.item.itemId}`,state:{item:a.item},"aria-label":a.item.name}),e.jsx(De,{src:a.item.thumbnail,alt:"",loading:"lazy"}),e.jsxs(P,{children:[e.jsx(L,{children:a.item.name}),a.item.creator?e.jsx(Ve,{to:`/items/creator/${a.item.creator}`,children:e.jsx(Ie,{address:a.item.creator})}):null,e.jsxs(R,{children:[a.state!=="unavailable"?e.jsxs(Qe,{children:[e.jsx(z,{size:15}),a.item.priceCredits.toLocaleString()]}):null,a.state==="unavailable"?e.jsx(v,{children:s("outfits.card.unavailable")}):a.state==="own_listing"?e.jsx(v,{children:s("outfits.detail.yourListing")}):a.state==="in_cart"?e.jsx(v,{children:s("outfits.detail.inCart")}):null,e.jsx(rt,{item:a.item})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{className:o.isLoading?"skeleton":void 0,"aria-hidden":!0}),e.jsx(P,{children:o.isLoading?e.jsx(L,{children:e.jsx("span",{className:"skeleton",style:{display:"block",width:"70%",height:14}})}):e.jsxs(e.Fragment,{children:[e.jsx(L,{children:s("outfits.card.unavailable")}),e.jsx(R,{children:e.jsx(v,{children:s("outfits.card.unavailable")})})]})})]})},a.key))}),te&&c.ownListing.length>0?e.jsx(Xe,{children:s("outfits.detail.yourListingHint")}):null]}),e.jsxs(Ze,{"data-testid":"outfit-detail-ctabar",children:[e.jsxs(Je,{children:[e.jsx(et,{children:s("outfits.detail.totalPrice")}),o.isLoading?e.jsx("span",{className:"skeleton",style:{width:64,height:26},"aria-hidden":!0}):e.jsxs(tt,{children:[e.jsx(z,{size:22}),l.toLocaleString()]})]}),o.isLoading?e.jsx("span",{className:"skeleton",style:{width:"100%",height:52,borderRadius:26},"aria-hidden":!0}):e.jsxs(it,{variant:"purple","data-testid":"outfit-detail-cta",onClick:I,disabled:m||y===0,"aria-busy":m||void 0,children:[m?s("outfits.card.adding"):y>0?s("outfits.detail.addCount",{count:y}):f>0?s("outfits.detail.nothingToAdd"):s("outfits.card.unavailable"),!m&&y>0?e.jsxs(at,{children:[e.jsx(z,{size:16}),l.toLocaleString()]}):null]})]})]})]})]})]})}export{yt as OutfitDetail,yt as default};
@@ -1,6 +1,6 @@
1
- import{r,j as n}from"./react-BYHuwl8r.js";import{d as v}from"./dcl-schemas-CmtP3U6y.js";import{s as P,Y as R,ah as F,c as O,ai as S,b as B}from"./index-D7dTUoYt.js";import{d as W}from"./disposePreview-5vjiqVZ0.js";const H=P.div`
1
+ import{r,j as n}from"./react-BYHuwl8r.js";import{d as g}from"./dcl-schemas-CmtP3U6y.js";import{s as P,X as R,ag as F,c as O,ah as S,b as B}from"./index-CKUuopSw.js";import{d as W}from"./disposePreview-5vjiqVZ0.js";const H=P.div`
2
2
  position: absolute;
3
3
  inset: 0;
4
4
  display: grid;
5
5
  place-items: center;
6
- `;function q({id:a,profile:i,bodyShape:g,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=R(t=>t.fittingOpen),{ref:h,active:x}=F(),e=c&&s.length>0&&x&&!E,y=s.length>0?s[0].includes(":amoy:"):O.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[b,m]=r.useState(!1);r.useEffect(()=>{if(!e){m(!1);return}let t=0,I=0;const p=()=>{document.getElementById(a)?m(!0):I++<300&&(t=requestAnimationFrame(p))};return p(),()=>cancelAnimationFrame(t)},[e,a]);const u=r.useRef(null);return r.useEffect(()=>{if(e)return()=>{W(u.current),u.current=null}},[e]),n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:h,"data-preview-viewport":!0,"aria-hidden":!0}),e?n.jsx(S,{id:a,profile:i,bodyShape:g,urns:s,skin:l,hair:f,eyes:d,type:v.PreviewType.AVATAR,emote:v.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:y,onLoad:()=>{var t;o(!0),u.current=((t=document.getElementById(a))==null?void 0:t.contentWindow)??null}},i):null,b?w:null,c&&s.length===0?null:!e||!j?n.jsx(H,{"aria-busy":"true","aria-label":B("spinner.loading"),children:n.jsx("span",{className:"spinner","aria-hidden":!0})}):null]})}export{q as O};
6
+ `;function q({id:a,profile:i,bodyShape:v,urns:s,enabled:c=!0,skin:l,hair:f,eyes:d,controls:w}){const E=R(t=>t.fittingOpen),{ref:h,active:x}=F(),e=c&&s.length>0&&x&&!E,y=s.length>0?s[0].includes(":amoy:"):O.chainId===80002,[j,o]=r.useState(!1),A=s.join(",");r.useEffect(()=>{o(!1)},[A,i,l,f,d]),r.useEffect(()=>{e&&o(!1)},[e]);const[b,m]=r.useState(!1);r.useEffect(()=>{if(!e){m(!1);return}let t=0,I=0;const p=()=>{document.getElementById(a)?m(!0):I++<300&&(t=requestAnimationFrame(p))};return p(),()=>cancelAnimationFrame(t)},[e,a]);const u=r.useRef(null);return r.useEffect(()=>{if(e)return()=>{W(u.current),u.current=null}},[e]),n.jsxs(n.Fragment,{children:[n.jsx("div",{ref:h,"data-preview-viewport":!0,"aria-hidden":!0}),e?n.jsx(S,{id:a,profile:i,bodyShape:v,urns:s,skin:l,hair:f,eyes:d,type:g.PreviewType.AVATAR,emote:g.PreviewEmote.FASHION,disableBackground:!0,disableFadeEffect:!0,dev:y,onLoad:()=>{var t;o(!0),u.current=((t=document.getElementById(a))==null?void 0:t.contentWindow)??null}},i):null,b?w:null,c&&s.length===0?null:!e||!j?n.jsx(H,{"aria-busy":"true","aria-label":B("spinner.loading"),children:n.jsx("span",{className:"spinner","aria-hidden":!0})}):null]})}export{q as O};
@@ -1,4 +1,4 @@
1
- import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";import{s,t as lt,I as K,aI as Zt,b as e,z as ot,B as x,K as Ct,o as X,S as te,x as ee,A as It,v as Et,W as ie,a0 as z,aJ as V,aK as se,aL as oe,aM as J,a5 as ae,a6 as re,a3 as ne,a4 as de,U as Lt,a9 as le,aN as at,aO as ue,aP as ce,aQ as pe,E as N,aR as Rt,aS as zt,aT as A,F as rt,aU as nt,aV as he,aW as fe,aX as xe,$ as me,aY as ge,aZ as be,ag as ye}from"./index-D7dTUoYt.js";import{E as D}from"./ErrorNotice-CCsvrT3H.js";import{L as je}from"./LoadMore-ChGcAM1i.js";import{u as ve}from"./useInfiniteGrid-UHC0Jjfu.js";import{O as we}from"./OutfitPreview-J5m3e8Gl.js";import{T as $e}from"./skeleton.styles-CVQk0siV.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:m,radius:Y,media:Se}=lt,ke=s.div`
1
+ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";import{s,t as lt,I as K,aG as Zt,b as e,z as ot,B as x,K as Ct,o as X,R as te,x as ee,A as It,v as Et,V as ie,$ as z,aH as V,aI as se,aJ as oe,aK as J,a4 as ae,a5 as re,a2 as ne,a3 as de,S as Lt,a8 as le,aL as at,aM as ue,aN as ce,aO as pe,E as N,aP as Rt,aQ as zt,aR as A,F as rt,aS as nt,aT as he,aU as fe,aV as xe,Z as me,aW as ge,aX as be,af as ye}from"./index-CKUuopSw.js";import{E as D}from"./ErrorNotice-OUNK486K.js";import{L as je}from"./LoadMore-jSNRJiwZ.js";import{u as ve}from"./useInfiniteGrid-BjEQAabI.js";import{O as we}from"./OutfitPreview-PWdXvCaE.js";import{T as $e}from"./skeleton.styles-BXNXDWEi.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:m,radius:Y,media:Se}=lt,ke=s.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -98,20 +98,20 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
98
98
  white-space: nowrap;
99
99
  overflow: hidden;
100
100
  text-overflow: ellipsis;
101
- `,We=s.span`
101
+ `,Pe=s.span`
102
102
  display: inline-flex;
103
103
  align-items: center;
104
104
  gap: 4px;
105
105
  font-size: 12px;
106
106
  color: ${m.gray4};
107
- `,Pe=s(K)`
107
+ `,We=s(K)`
108
108
  position: absolute;
109
109
  top: 12px;
110
110
  right: 12px;
111
111
  color: ${m.accent};
112
112
  background: ${m.white};
113
113
  border-radius: 50%;
114
- `,Oe=[{key:"wearable",labelKey:"categories.wearables"},{key:"emote",labelKey:"categories.emotes"}];function Ae({selectedKeys:n,onPick:f,canPick:h}){const[c,y]=d.useState("wearable"),[j,b]=d.useState(""),[o,R]=d.useState("");d.useEffect(()=>{const l=setTimeout(()=>R(j.trim()),300);return()=>clearTimeout(l)},[j]);const{items:C,isLoading:I,isPlaceholderData:u,isError:k,hasNextPage:E,isFetchingNextPage:Z,fetchNextPage:S}=ve(["outfit-picker",c,o],l=>Zt({search:o||void 0,category:c,onSale:!0,listingType:"primary",first:24,skip:l,sortBy:"cheapest"})),g=e(c==="emote"?"outfits.studio.searchEmotes":"outfits.studio.searchWearables"),_=new Set,M=C.filter(l=>{if(!l.itemId)return!1;const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`;return _.has(v)?!1:(_.add(v),!0)});return t.jsxs(ke,{"data-testid":"outfit-picker",children:[t.jsx(Ce,{role:"group","aria-label":e("outfits.studio.pickerCategory"),"data-testid":"outfit-picker-category",children:Oe.map(({key:l,labelKey:v})=>t.jsx(Ie,{type:"button","data-category":l,"data-selected":c===l||void 0,"aria-pressed":c===l,onClick:()=>{y(l),b("")},children:e(v)},l))}),t.jsxs(Te,{children:[t.jsx(K,{name:"search",color:lt.colors.muted}),t.jsx("input",{value:j,placeholder:g,"aria-label":g,onChange:l=>b(l.target.value),"data-testid":"outfit-picker-search"})]}),k?t.jsx(vt,{children:e("outfits.errors.generic")}):I||u?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:8},(l,v)=>t.jsx(Ee,{className:"skeleton","aria-hidden":!0},v))}):M.length===0?t.jsx(vt,{children:e("outfits.studio.noResults")}):t.jsx(wt,{children:M.map(l=>{const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`,U=n.has(v);return t.jsxs(Le,{type:"button","data-testid":"outfit-picker-item","data-selected":U||void 0,disabled:!U&&!h(l),onClick:()=>f(l),title:l.name,children:[t.jsx(Re,{src:l.thumbnail,alt:"",loading:"lazy"}),t.jsx(ze,{children:l.name}),t.jsxs(We,{children:[t.jsx(ot,{size:12}),l.priceCredits.toLocaleString()]}),U?t.jsx(Pe,{name:"check-rounded",size:18}):null]},v)})}),!k&&!I&&!u?t.jsx(je,{auto:!1,hasNextPage:!!E,isFetching:Z,onLoadMore:()=>void S()}):null]})}const{colors:r,radius:$,media:B,z:Fe}=lt,Wt=s.div`
114
+ `,Oe=[{key:"wearable",labelKey:"categories.wearables"},{key:"emote",labelKey:"categories.emotes"}];function Ae({selectedKeys:n,onPick:f,canPick:h}){const[c,y]=d.useState("wearable"),[j,b]=d.useState(""),[o,R]=d.useState("");d.useEffect(()=>{const l=setTimeout(()=>R(j.trim()),300);return()=>clearTimeout(l)},[j]);const{items:C,isLoading:I,isPlaceholderData:u,isError:k,hasNextPage:E,isFetchingNextPage:Z,fetchNextPage:S}=ve(["outfit-picker",c,o],l=>Zt({search:o||void 0,category:c,onSale:!0,listingType:"primary",first:24,skip:l,sortBy:"cheapest"})),g=e(c==="emote"?"outfits.studio.searchEmotes":"outfits.studio.searchWearables"),_=new Set,H=C.filter(l=>{if(!l.itemId)return!1;const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`;return _.has(v)?!1:(_.add(v),!0)});return t.jsxs(ke,{"data-testid":"outfit-picker",children:[t.jsx(Ce,{role:"group","aria-label":e("outfits.studio.pickerCategory"),"data-testid":"outfit-picker-category",children:Oe.map(({key:l,labelKey:v})=>t.jsx(Ie,{type:"button","data-category":l,"data-selected":c===l||void 0,"aria-pressed":c===l,onClick:()=>{y(l),b("")},children:e(v)},l))}),t.jsxs(Te,{children:[t.jsx(K,{name:"search",color:lt.colors.muted}),t.jsx("input",{value:j,placeholder:g,"aria-label":g,onChange:l=>b(l.target.value),"data-testid":"outfit-picker-search"})]}),k?t.jsx(vt,{children:e("outfits.errors.generic")}):I||u?t.jsx(wt,{"aria-busy":"true",children:Array.from({length:8},(l,v)=>t.jsx(Ee,{className:"skeleton","aria-hidden":!0},v))}):H.length===0?t.jsx(vt,{children:e("outfits.studio.noResults")}):t.jsx(wt,{children:H.map(l=>{const v=`${l.contractAddress.toLowerCase()}-${l.itemId}`,M=n.has(v);return t.jsxs(Le,{type:"button","data-testid":"outfit-picker-item","data-selected":M||void 0,disabled:!M&&!h(l),onClick:()=>f(l),title:l.name,children:[t.jsx(Re,{src:l.thumbnail,alt:"",loading:"lazy"}),t.jsx(ze,{children:l.name}),t.jsxs(Pe,{children:[t.jsx(ot,{size:12}),l.priceCredits.toLocaleString()]}),M?t.jsx(We,{name:"check-rounded",size:18}):null]},v)})}),!k&&!I&&!u?t.jsx(je,{auto:!1,hasNextPage:!!E,isFetching:Z,onLoadMore:()=>void S()}):null]})}const{colors:r,radius:$,media:B,z:Fe}=lt,Pt=s.div`
115
115
  max-width: 1200px;
116
116
  margin: 0 auto;
117
117
  display: flex;
@@ -133,7 +133,7 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
133
133
  margin: 0;
134
134
  font-size: 13px;
135
135
  color: ${r.gray4};
136
- `,Pt=s.div`
136
+ `,Wt=s.div`
137
137
  display: flex;
138
138
  align-items: center;
139
139
  gap: 12px;
@@ -174,7 +174,7 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
174
174
  `,Be=s.span`
175
175
  height: 76px;
176
176
  border-radius: ${$.card};
177
- `,Me=s.div`
177
+ `,He=s.div`
178
178
  display: flex;
179
179
  align-items: center;
180
180
  gap: 14px;
@@ -191,7 +191,7 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
191
191
  border-radius: 8px;
192
192
  background: ${r.media};
193
193
  flex-shrink: 0;
194
- `,Ue=s.div`
194
+ `,Me=s.div`
195
195
  ${Ft};
196
196
  overflow: hidden;
197
197
 
@@ -201,7 +201,7 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
201
201
  object-fit: cover;
202
202
  display: block;
203
203
  }
204
- `,He=s.span`
204
+ `,Ue=s.span`
205
205
  ${Ft};
206
206
  display: inline-block;
207
207
  `,De=s.div`
@@ -331,11 +331,11 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
331
331
  text-align: center;
332
332
  color: ${r.softWhite};
333
333
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
334
- `,W=s.div`
334
+ `,P=s.div`
335
335
  display: flex;
336
336
  flex-direction: column;
337
337
  gap: 8px;
338
- `,P=s.label`
338
+ `,W=s.label`
339
339
  font-size: 13px;
340
340
  font-weight: 700;
341
341
  letter-spacing: 0.04em;
@@ -553,4 +553,4 @@ import{r as d,j as t,L as F,d as Jt,a as Xt,b as Yt}from"./react-BYHuwl8r.js";im
553
553
  display: flex;
554
554
  flex-wrap: wrap;
555
555
  gap: 10px;
556
- `;function Ki(){const{id:n}=Jt(),{pathname:f}=Xt(),h=X(b=>b.session),c=X(b=>b.signIn),y=te();ee({title:e("outfits.studio.title"),noindex:!0});const j=f.endsWith("/new")?"new":n?"edit":"list";return y==="pending"?t.jsx(O,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):h?y!=="creator"?t.jsxs(O,{"data-testid":"outfit-studio-unavailable",children:[t.jsx($t,{children:e("outfits.studio.title")}),t.jsx(w,{children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:F,to:"/overview",variant:"white",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(Ii,{}):t.jsx(Ri,{outfitId:j==="edit"?n:null},n??"new"):t.jsxs(O,{"data-testid":"outfit-studio-signin",children:[t.jsx($t,{children:e("outfits.studio.title")}),t.jsx(w,{children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"white",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Ci({outfit:n}){const f=Lt(n.thumbnailHash);return f?t.jsx(Ue,{style:{background:ce(n)},children:t.jsx("img",{src:f,alt:"",loading:"lazy"})}):t.jsx(He,{"aria-hidden":!0})}function Ii(){const n=X(u=>u.session),f=It(),[h,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:o,isError:R,refetch:C}=Et({queryKey:["outfits-all"],enabled:!!n,staleTime:3e4,queryFn:()=>be(n.identity)});async function I(u,k){if(n){j(u.id);try{k==="delete"?(await pe(u.id,n.identity),N.success(e("outfits.studio.deleted"))):(await Rt({...dt(u),published:!1},n.identity,"update"),N.success(e("outfits.studio.unpublished"))),zt(f)}catch(E){E instanceof A||rt(E,{flow:`outfit-${k}`}),N.error(e(E instanceof A?nt(E.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Wt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Pt,{children:[t.jsx(Ot,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:F,to:"/outfits/new",variant:"white","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),o?t.jsx(St,{"aria-busy":"true",children:Array.from({length:3},(u,k)=>t.jsx(Be,{className:"skeleton","aria-hidden":!0},k))}):R?t.jsxs(O,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"white",onClick:()=>void C(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx(w,{children:e("outfits.studio.empty")}):t.jsx(St,{children:b.map(u=>t.jsxs(Me,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Ci,{outfit:u}),t.jsxs(De,{children:[t.jsx(Ke,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(_e,{children:[t.jsx(At,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ge,{children:[u.published?t.jsx(x,{as:F,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:F,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(qe,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),h?t.jsxs(Qe,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ve,{onClick:()=>c(null)}),t.jsxs(Je,{children:[t.jsx(Xe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ye,{children:[h.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===h.id,onClick:()=>void I(h,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:h.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===h.id,onClick:()=>void I(h,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const Tt=["image/png","image/jpeg","image/webp"];function Ei(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:at.from,gradientTo:at.to,published:!1}}function dt(n){return{id:n.id,name:n.name,thumbnailHash:n.thumbnailHash,items:n.items,bodyShape:n.bodyShape,gradientFrom:n.gradientFrom,gradientTo:n.gradientTo,published:n.published}}function Li(n){try{const f=sessionStorage.getItem(n);return f?JSON.parse(f):null}catch{return null}}function Ri({outfitId:n}){const f=n===null,h=`outfit-draft:${n??"new"}`,c=X(i=>i.session),y=It(),j=Yt(),[b]=d.useState(()=>Li(h)),[o,R]=d.useState(()=>b??(f?Ei():null)),[C,I]=d.useState(!!b),{data:u,isLoading:k,isError:E,refetch:Z}=Et({queryKey:["outfit",n,!0],enabled:!f&&!!c,staleTime:0,queryFn:()=>ye(n,c.identity)});d.useEffect(()=>{u&&R(i=>i??dt(u))},[u]);function S(i){R(a=>a&&{...a,...i}),I(!0)}d.useEffect(()=>{if(!(!o||!C))try{sessionStorage.setItem(h,JSON.stringify(o))}catch{}},[o,C,h]),d.useEffect(()=>{if(!C)return;const i=a=>a.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[C]),d.useEffect(()=>()=>sessionStorage.removeItem(h),[h]);const g=ie(o??void 0),_=d.useMemo(()=>new Set(((o==null?void 0:o.items)??[]).map(z)),[o]),M=i=>ge((o==null?void 0:o.items)??[],i,g.byKey),l=i=>!!i.itemId&&M(i).length<=J;function v(i){!o||!l(i)||S({items:M(i)})}const[U,ut]=d.useState(null),L=d.useRef(null),tt=d.useRef(!0);d.useEffect(()=>(tt.current=!0,()=>{tt.current=!1}),[]);const[G,ct]=d.useState(!1),[Bt,q]=d.useState(null),[et,pt]=d.useState(""),[Mt,ht]=d.useState(null),[T,Ut]=d.useState();d.useEffect(()=>()=>{L.current&&URL.revokeObjectURL(L.current)},[]);function ft(){const i=xe(et);if(!i){ht(e("outfits.studio.importError"));return}ht(null),pt(""),Ut(i.colors),S({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),N.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ht(i){if(!i||!c)return;if(q(null),!Tt.includes(i.type)){q(e("outfits.errors.unsupportedType"));return}if(i.size>he){q(e("outfits.errors.tooLarge"));return}L.current&&URL.revokeObjectURL(L.current);const a=URL.createObjectURL(i);L.current=a,ut(a),ct(!0);try{const p=await fe(i,c.identity);S({thumbnailHash:p})}catch(p){p instanceof A||rt(p,{flow:"outfit-thumbnail"}),q(e(p instanceof A?nt(p.code):"outfits.errors.generic")),L.current&&(URL.revokeObjectURL(L.current),L.current=null),ut(null)}finally{ct(!1)}}const[H,xt]=d.useState(!1),[Dt,mt]=d.useState(null),it=!!o&&o.name.trim().length>0&&o.name.length<=60,Kt=!!o&&V(o.gradientFrom)&&V(o.gradientTo),gt=!!o&&o.items.some(i=>{const a=g.byKey.get(z(i));return!a||se(a)}),bt=!!o&&it&&!!o.thumbnailHash&&Kt&&gt&&o.items.length>=oe&&o.items.length<=J;async function st(i){if(!(!c||!o||H)){xt(!0),mt(null);try{const a=await Rt({...o,published:i},c.identity,f?"create":"update");if(!tt.current)return;sessionStorage.removeItem(h),R(dt(a)),I(!1),zt(y),i&&!o.published?(me("Shop Outfit Published",{outfit_id:a.id,item_count:a.items.length}),N.success(e("outfits.studio.publishedToast"))):N.success(e("outfits.studio.saved")),f&&(y.setQueryData(["outfit",a.id,!0],a),j(`/outfits/${a.id}/edit`,{replace:!0}))}catch(a){a instanceof A||rt(a,{flow:"outfit-save"}),mt(e(a instanceof A?nt(a.code):"outfits.errors.generic"))}finally{xt(!1)}}}const Q=d.useMemo(()=>((o==null?void 0:o.items)??[]).map(i=>g.byKey.get(z(i))).filter(i=>!!i),[o,g.byKey]),yt=d.useMemo(()=>ae(Q),[Q]),_t=d.useMemo(()=>{const i=re(Q);return i!=null&&i.itemId?z({contractAddress:i.contractAddress,itemId:i.itemId}):null},[Q]),Gt=(o==null?void 0:o.bodyShape)==="female"?ne:(o==null?void 0:o.bodyShape)==="male"?de:void 0;if(!c)return null;if(!o)return E?t.jsxs(O,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"white",onClick:()=>void Z(),children:e("outfits.detail.retry")})]}):!k&&u===null?t.jsxs(O,{"data-testid":"outfit-studio-missing",children:[t.jsx(w,{children:e("outfits.errors.notFound")}),t.jsx(x,{as:F,to:"/outfits/manage",variant:"white",children:e("outfits.studio.myOutfits")})]}):t.jsx(O,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const jt=U??Lt(o.thumbnailHash),qt={...o,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Qt=o.items.reduce((i,a)=>{var p;return i+(((p=g.byKey.get(z(a)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Wt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Pt,{children:[t.jsx(Ne,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(Ot,{children:f?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(At,{"data-state":o.published?"published":"draft",children:o.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Ze,{children:[t.jsxs(ti,{children:[t.jsxs(ii,{"data-testid":"outfit-studio-preview",style:{background:le(o)},children:[t.jsx(we,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Gt,urns:yt,skin:T==null?void 0:T.skin,hair:T==null?void 0:T.hair,eyes:T==null?void 0:T.eyes,enabled:!g.isLoading}),yt.length===0&&!g.isLoading?t.jsx(si,{children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(W,{children:[t.jsx(P,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(oi,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ai,{type:"button","data-selected":o.bodyShape===i||void 0,onClick:()=>S({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(W,{children:[t.jsx(P,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(ni,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(di,{children:[t.jsx(li,{type:"color",value:V(o[i])?o[i]:at.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:a=>S({[i]:a.target.value.toLowerCase()})}),t.jsxs(ui,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(ci,{value:o[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!V(o[i])||void 0,onChange:a=>{const p=a.target.value.trim().toLowerCase();S({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx(w,{children:e("outfits.studio.gradientHint")})]}),t.jsxs(W,{children:[t.jsx(P,{as:"span",children:e("outfits.studio.thumbnail")}),jt?t.jsx(ri,{"data-busy":G||void 0,children:t.jsx("img",{src:jt,alt:""})}):null,t.jsxs(hi,{as:"label",variant:"outline",size:"sm","data-busy":G||void 0,children:[G?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:Tt.join(","),hidden:!0,disabled:G,onChange:i=>{var a;return void Ht((a=i.target.files)==null?void 0:a[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx(w,{children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:Bt,testId:"outfit-studio-thumb-error"})]}),t.jsxs(W,{children:[t.jsx(P,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(pi,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(ue,{outfit:qt,resolution:g})})]})]}),t.jsxs(ei,{children:[t.jsxs(W,{children:[t.jsx(P,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(fi,{children:[t.jsx(kt,{id:"outfit-import",value:et,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>pt(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:et.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx(w,{children:e("outfits.studio.importHint")}),t.jsx(D,{message:Mt,testId:"outfit-studio-import-error"})]}),t.jsxs(W,{children:[t.jsx(P,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(kt,{id:"outfit-name",value:o.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>S({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(W,{children:[t.jsxs(P,{as:"span",children:[e("outfits.studio.items")," (",o.items.length,"/",J,")"]}),o.items.length===0?t.jsx(w,{children:e("outfits.studio.noItems")}):t.jsx(xi,{children:o.items.map(i=>{const a=z(i),p=g.byKey.get(a);return t.jsxs(mi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(gi,{src:p.thumbnail,alt:""}):t.jsx(bi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(yi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?t.jsx($e,{className:"skeleton",width:96,"aria-hidden":!0}):e("outfits.card.unavailable")}),a===_t?t.jsx(ji,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(vi,{children:[t.jsx(ot,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(Si,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>S({items:o.items.filter(Vt=>z(Vt)!==a)}),children:t.jsx(K,{name:"trash",size:16})})]},a)})}),o.items.length>0?t.jsxs(wi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs($i,{children:[t.jsx(ot,{size:14}),Qt.toLocaleString()]})]}):null,o.items.length>=J?t.jsx(w,{children:e("outfits.studio.maxItems")}):null]}),t.jsx(Ae,{selectedKeys:_,onPick:v,canPick:l})]})]}),t.jsxs(ki,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Dt,testId:"outfit-studio-save-error"}),it?!bt&&!o.published?t.jsx(w,{"data-testid":"outfit-studio-publish-hint",children:!gt&&o.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx(w,{children:e("outfits.studio.needName")}),t.jsxs(Ti,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:H||!it,onClick:()=>void st(o.published),children:H?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),o.published?t.jsx(x,{variant:"white","data-testid":"outfit-studio-unpublish",disabled:H,onClick:()=>void st(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"white","data-testid":"outfit-studio-publish",disabled:H||!bt,onClick:()=>void st(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ki as OutfitStudio,Ki as default};
556
+ `;function Ki(){const{id:n}=Jt(),{pathname:f}=Xt(),h=X(b=>b.session),c=X(b=>b.signIn),y=te();ee({title:e("outfits.studio.title"),noindex:!0});const j=f.endsWith("/new")?"new":n?"edit":"list";return y==="pending"?t.jsx(O,{"aria-busy":"true","data-testid":"outfit-studio-loading",children:t.jsx("span",{className:"spinner","aria-hidden":!0})}):h?y!=="creator"?t.jsxs(O,{"data-testid":"outfit-studio-unavailable",children:[t.jsx($t,{children:e("outfits.studio.title")}),t.jsx(w,{children:e("outfits.studio.notAvailable")}),t.jsx(x,{as:F,to:"/overview",variant:"white",children:e("outfits.studio.backToShop")})]}):j==="list"?t.jsx(Ii,{}):t.jsx(Ri,{outfitId:j==="edit"?n:null},n??"new"):t.jsxs(O,{"data-testid":"outfit-studio-signin",children:[t.jsx($t,{children:e("outfits.studio.title")}),t.jsx(w,{children:e("outfits.studio.signInPrompt")}),t.jsx(x,{variant:"white",onClick:()=>c(),children:e("outfits.studio.signIn")})]})}function Ci({outfit:n}){const f=Lt(n.thumbnailHash);return f?t.jsx(Me,{style:{background:ce(n)},children:t.jsx("img",{src:f,alt:"",loading:"lazy"})}):t.jsx(Ue,{"aria-hidden":!0})}function Ii(){const n=X(u=>u.session),f=It(),[h,c]=d.useState(null),[y,j]=d.useState(null),{data:b=[],isLoading:o,isError:R,refetch:C}=Et({queryKey:["outfits-all"],enabled:!!n,staleTime:3e4,queryFn:()=>be(n.identity)});async function I(u,k){if(n){j(u.id);try{k==="delete"?(await pe(u.id,n.identity),N.success(e("outfits.studio.deleted"))):(await Rt({...dt(u),published:!1},n.identity,"update"),N.success(e("outfits.studio.unpublished"))),zt(f)}catch(E){E instanceof A||rt(E,{flow:`outfit-${k}`}),N.error(e(E instanceof A?nt(E.code):"outfits.errors.generic"))}finally{j(null),c(null)}}}return t.jsxs(Pt,{"data-testid":"outfit-studio-list",children:[t.jsxs(Wt,{children:[t.jsx(Ot,{children:e("outfits.studio.myOutfits")}),t.jsx(x,{as:F,to:"/outfits/new",variant:"white","data-testid":"outfit-studio-new",children:e("outfits.studio.new")})]}),o?t.jsx(St,{"aria-busy":"true",children:Array.from({length:3},(u,k)=>t.jsx(Be,{className:"skeleton","aria-hidden":!0},k))}):R?t.jsxs(O,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"white",onClick:()=>void C(),children:e("outfits.detail.retry")})]}):b.length===0?t.jsx(w,{children:e("outfits.studio.empty")}):t.jsx(St,{children:b.map(u=>t.jsxs(He,{"data-testid":"outfit-studio-row","data-published":u.published||void 0,children:[t.jsx(Ci,{outfit:u}),t.jsxs(De,{children:[t.jsx(Ke,{children:u.name||e("outfits.studio.untitled")}),t.jsxs(_e,{children:[t.jsx(At,{"data-state":u.published?"published":"draft",children:u.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")}),e("outfits.card.items",{count:u.items.length})]})]}),t.jsxs(Ge,{children:[u.published?t.jsx(x,{as:F,to:`/items/outfits/${u.id}`,variant:"ghost",size:"sm",children:e("outfits.studio.view")}):null,t.jsx(x,{as:F,to:`/outfits/${u.id}/edit`,variant:"outline",size:"sm","data-testid":"outfit-studio-edit",children:e("outfits.studio.edit")}),t.jsx(qe,{type:"button","data-testid":"outfit-studio-delete","aria-label":e("outfits.studio.confirmDelete"),disabled:y===u.id,onClick:()=>c(u),children:t.jsx(K,{name:"trash",size:18})})]})]},u.id))}),h?t.jsxs(Qe,{role:"dialog","aria-modal":"true","aria-label":e("outfits.studio.deleteTitle"),"data-testid":"outfit-studio-confirm",children:[t.jsx(Ve,{onClick:()=>c(null)}),t.jsxs(Je,{children:[t.jsx(Xe,{children:e("outfits.studio.deleteTitle")}),t.jsx("p",{className:"muted",children:e("outfits.studio.deleteBody")}),t.jsxs(Ye,{children:[h.published?t.jsx(x,{variant:"purple","data-testid":"outfit-studio-confirm-unpublish",disabled:y===h.id,onClick:()=>void I(h,"unpublish"),children:e("outfits.studio.unpublish")}):null,t.jsx(x,{variant:h.published?"outline":"purple","data-testid":"outfit-studio-confirm-delete",disabled:y===h.id,onClick:()=>void I(h,"delete"),children:e("outfits.studio.confirmDelete")}),t.jsx(x,{variant:"ghost",onClick:()=>c(null),children:e("outfits.studio.cancel")})]})]})]}):null]})}const Tt=["image/png","image/jpeg","image/webp"];function Ei(){return{id:crypto.randomUUID(),name:"",thumbnailHash:"",items:[],bodyShape:"unisex",gradientFrom:at.from,gradientTo:at.to,published:!1}}function dt(n){return{id:n.id,name:n.name,thumbnailHash:n.thumbnailHash,items:n.items,bodyShape:n.bodyShape,gradientFrom:n.gradientFrom,gradientTo:n.gradientTo,published:n.published}}function Li(n){try{const f=sessionStorage.getItem(n);return f?JSON.parse(f):null}catch{return null}}function Ri({outfitId:n}){const f=n===null,h=`outfit-draft:${n??"new"}`,c=X(i=>i.session),y=It(),j=Yt(),[b]=d.useState(()=>Li(h)),[o,R]=d.useState(()=>b??(f?Ei():null)),[C,I]=d.useState(!!b),{data:u,isLoading:k,isError:E,refetch:Z}=Et({queryKey:["outfit",n,!0],enabled:!f&&!!c,staleTime:0,queryFn:()=>ye(n,c.identity)});d.useEffect(()=>{u&&R(i=>i??dt(u))},[u]);function S(i){R(a=>a&&{...a,...i}),I(!0)}d.useEffect(()=>{if(!(!o||!C))try{sessionStorage.setItem(h,JSON.stringify(o))}catch{}},[o,C,h]),d.useEffect(()=>{if(!C)return;const i=a=>a.preventDefault();return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[C]),d.useEffect(()=>()=>sessionStorage.removeItem(h),[h]);const g=ie(o??void 0),_=d.useMemo(()=>new Set(((o==null?void 0:o.items)??[]).map(z)),[o]),H=i=>ge((o==null?void 0:o.items)??[],i,g.byKey),l=i=>!!i.itemId&&H(i).length<=J;function v(i){!o||!l(i)||S({items:H(i)})}const[M,ut]=d.useState(null),L=d.useRef(null),tt=d.useRef(!0);d.useEffect(()=>(tt.current=!0,()=>{tt.current=!1}),[]);const[G,ct]=d.useState(!1),[Bt,q]=d.useState(null),[et,pt]=d.useState(""),[Ht,ht]=d.useState(null),[T,Mt]=d.useState();d.useEffect(()=>()=>{L.current&&URL.revokeObjectURL(L.current)},[]);function ft(){const i=xe(et);if(!i){ht(e("outfits.studio.importError"));return}ht(null),pt(""),Mt(i.colors),S({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),N.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Ut(i){if(!i||!c)return;if(q(null),!Tt.includes(i.type)){q(e("outfits.errors.unsupportedType"));return}if(i.size>he){q(e("outfits.errors.tooLarge"));return}L.current&&URL.revokeObjectURL(L.current);const a=URL.createObjectURL(i);L.current=a,ut(a),ct(!0);try{const p=await fe(i,c.identity);S({thumbnailHash:p})}catch(p){p instanceof A||rt(p,{flow:"outfit-thumbnail"}),q(e(p instanceof A?nt(p.code):"outfits.errors.generic")),L.current&&(URL.revokeObjectURL(L.current),L.current=null),ut(null)}finally{ct(!1)}}const[U,xt]=d.useState(!1),[Dt,mt]=d.useState(null),it=!!o&&o.name.trim().length>0&&o.name.length<=60,Kt=!!o&&V(o.gradientFrom)&&V(o.gradientTo),gt=!!o&&o.items.some(i=>{const a=g.byKey.get(z(i));return!a||se(a)}),bt=!!o&&it&&!!o.thumbnailHash&&Kt&&gt&&o.items.length>=oe&&o.items.length<=J;async function st(i){if(!(!c||!o||U)){xt(!0),mt(null);try{const a=await Rt({...o,published:i},c.identity,f?"create":"update");if(!tt.current)return;sessionStorage.removeItem(h),R(dt(a)),I(!1),zt(y),i&&!o.published?(me("Shop Outfit Published",{outfit_id:a.id,item_count:a.items.length}),N.success(e("outfits.studio.publishedToast"))):N.success(e("outfits.studio.saved")),f&&(y.setQueryData(["outfit",a.id,!0],a),j(`/outfits/${a.id}/edit`,{replace:!0}))}catch(a){a instanceof A||rt(a,{flow:"outfit-save"}),mt(e(a instanceof A?nt(a.code):"outfits.errors.generic"))}finally{xt(!1)}}}const Q=d.useMemo(()=>((o==null?void 0:o.items)??[]).map(i=>g.byKey.get(z(i))).filter(i=>!!i),[o,g.byKey]),yt=d.useMemo(()=>ae(Q),[Q]),_t=d.useMemo(()=>{const i=re(Q);return i!=null&&i.itemId?z({contractAddress:i.contractAddress,itemId:i.itemId}):null},[Q]),Gt=(o==null?void 0:o.bodyShape)==="female"?ne:(o==null?void 0:o.bodyShape)==="male"?de:void 0;if(!c)return null;if(!o)return E?t.jsxs(O,{children:[t.jsx(D,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"white",onClick:()=>void Z(),children:e("outfits.detail.retry")})]}):!k&&u===null?t.jsxs(O,{"data-testid":"outfit-studio-missing",children:[t.jsx(w,{children:e("outfits.errors.notFound")}),t.jsx(x,{as:F,to:"/outfits/manage",variant:"white",children:e("outfits.studio.myOutfits")})]}):t.jsx(O,{"aria-busy":"true",children:t.jsx("span",{className:"spinner","aria-hidden":!0})});const jt=M??Lt(o.thumbnailHash),qt={...o,authorAddress:(c==null?void 0:c.address)??"",createdAt:0,updatedAt:0},Qt=o.items.reduce((i,a)=>{var p;return i+(((p=g.byKey.get(z(a)))==null?void 0:p.priceCredits)??0)},0);return t.jsxs(Pt,{"data-testid":"outfit-studio-editor",children:[t.jsxs(Wt,{children:[t.jsx(Ne,{to:"/outfits/manage","aria-label":e("outfits.studio.myOutfits"),"data-testid":"outfit-studio-back",children:t.jsx(K,{name:"arrow-left",size:18})}),t.jsx(Ot,{children:f?e("outfits.studio.new"):e("outfits.studio.editTitle")}),t.jsx(At,{"data-state":o.published?"published":"draft",children:o.published?e("outfits.studio.publishedState"):e("outfits.studio.draft")})]}),t.jsxs(Ze,{children:[t.jsxs(ti,{children:[t.jsxs(ii,{"data-testid":"outfit-studio-preview",style:{background:le(o)},children:[t.jsx(we,{id:"outfit-studio-preview-frame",profile:"default",bodyShape:Gt,urns:yt,skin:T==null?void 0:T.skin,hair:T==null?void 0:T.hair,eyes:T==null?void 0:T.eyes,enabled:!g.isLoading}),yt.length===0&&!g.isLoading?t.jsx(si,{children:e("outfits.studio.previewEmpty")}):null]}),t.jsxs(P,{children:[t.jsx(W,{as:"span",children:e("outfits.studio.bodyShape")}),t.jsx(oi,{role:"group","aria-label":e("outfits.studio.bodyShape"),children:["unisex","male","female"].map(i=>t.jsx(ai,{type:"button","data-selected":o.bodyShape===i||void 0,onClick:()=>S({bodyShape:i}),children:e(`outfits.studio.shape.${i}`)},i))})]}),t.jsxs(P,{children:[t.jsx(W,{as:"span",children:e("outfits.studio.gradient")}),t.jsx(ni,{children:["gradientFrom","gradientTo"].map(i=>t.jsxs(di,{children:[t.jsx(li,{type:"color",value:V(o[i])?o[i]:at.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:a=>S({[i]:a.target.value.toLowerCase()})}),t.jsxs(ui,{children:[t.jsx("span",{children:e(i==="gradientFrom"?"outfits.studio.gradientTop":"outfits.studio.gradientBottom")}),t.jsx(ci,{value:o[i],maxLength:7,spellCheck:!1,placeholder:"#000000","aria-label":e(i==="gradientFrom"?"outfits.studio.gradientTopHex":"outfits.studio.gradientBottomHex"),"data-invalid":!V(o[i])||void 0,onChange:a=>{const p=a.target.value.trim().toLowerCase();S({[i]:p.startsWith("#")||p===""?p:`#${p}`})}})]})]},i))}),t.jsx(w,{children:e("outfits.studio.gradientHint")})]}),t.jsxs(P,{children:[t.jsx(W,{as:"span",children:e("outfits.studio.thumbnail")}),jt?t.jsx(ri,{"data-busy":G||void 0,children:t.jsx("img",{src:jt,alt:""})}):null,t.jsxs(hi,{as:"label",variant:"outline",size:"sm","data-busy":G||void 0,children:[G?e("outfits.studio.uploading"):e("outfits.studio.upload"),t.jsx("input",{type:"file",accept:Tt.join(","),hidden:!0,disabled:G,onChange:i=>{var a;return void Ut((a=i.target.files)==null?void 0:a[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx(w,{children:e("outfits.studio.thumbnailHint")}),t.jsx(D,{message:Bt,testId:"outfit-studio-thumb-error"})]}),t.jsxs(P,{children:[t.jsx(W,{as:"span",children:e("outfits.studio.cardPreview")}),t.jsx(pi,{"data-testid":"outfit-studio-card-preview",onClickCapture:i=>{i.preventDefault(),i.stopPropagation()},children:t.jsx(ue,{outfit:qt,resolution:g})})]})]}),t.jsxs(ei,{children:[t.jsxs(P,{children:[t.jsx(W,{htmlFor:"outfit-import",children:e("outfits.studio.import")}),t.jsxs(fi,{children:[t.jsx(kt,{id:"outfit-import",value:et,spellCheck:!1,placeholder:e("outfits.studio.importPlaceholder"),onChange:i=>pt(i.target.value),onKeyDown:i=>{i.key==="Enter"&&ft()},"data-testid":"outfit-studio-import"}),t.jsx(x,{variant:"outline",size:"sm",onClick:ft,disabled:et.trim()==="","data-testid":"outfit-studio-import-apply",children:e("outfits.studio.importApply")})]}),t.jsx(w,{children:e("outfits.studio.importHint")}),t.jsx(D,{message:Ht,testId:"outfit-studio-import-error"})]}),t.jsxs(P,{children:[t.jsx(W,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(kt,{id:"outfit-name",value:o.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>S({name:i.target.value}),"data-testid":"outfit-studio-name"})]}),t.jsxs(P,{children:[t.jsxs(W,{as:"span",children:[e("outfits.studio.items")," (",o.items.length,"/",J,")"]}),o.items.length===0?t.jsx(w,{children:e("outfits.studio.noItems")}):t.jsx(xi,{children:o.items.map(i=>{const a=z(i),p=g.byKey.get(a);return t.jsxs(mi,{"data-testid":"outfit-studio-selected","data-missing":!p||void 0,children:[p?t.jsx(gi,{src:p.thumbnail,alt:""}):t.jsx(bi,{className:g.isLoading?"skeleton":void 0,"aria-hidden":!0}),t.jsx(yi,{className:p?void 0:"muted",children:p?p.name:g.isLoading?t.jsx($e,{className:"skeleton",width:96,"aria-hidden":!0}):e("outfits.card.unavailable")}),a===_t?t.jsx(ji,{"data-testid":"outfit-studio-plays-in-preview",children:e("outfits.studio.playsInPreview")}):null,p?t.jsxs(vi,{children:[t.jsx(ot,{size:12}),p.priceCredits.toLocaleString()]}):null,t.jsx(Si,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>S({items:o.items.filter(Vt=>z(Vt)!==a)}),children:t.jsx(K,{name:"trash",size:16})})]},a)})}),o.items.length>0?t.jsxs(wi,{"data-testid":"outfit-studio-total",children:[t.jsx("span",{children:e("outfits.detail.totalPrice")}),t.jsxs($i,{children:[t.jsx(ot,{size:14}),Qt.toLocaleString()]})]}):null,o.items.length>=J?t.jsx(w,{children:e("outfits.studio.maxItems")}):null]}),t.jsx(Ae,{selectedKeys:_,onPick:v,canPick:l})]})]}),t.jsxs(ki,{"data-testid":"outfit-studio-savebar",children:[t.jsx(D,{message:Dt,testId:"outfit-studio-save-error"}),it?!bt&&!o.published?t.jsx(w,{"data-testid":"outfit-studio-publish-hint",children:!gt&&o.items.length>0?e("outfits.studio.needsWearable"):e("outfits.errors.notPublishable")}):null:t.jsx(w,{children:e("outfits.studio.needName")}),t.jsxs(Ti,{children:[t.jsx(x,{variant:"outline","data-testid":"outfit-studio-save",disabled:U||!it,onClick:()=>void st(o.published),children:U?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),o.published?t.jsx(x,{variant:"white","data-testid":"outfit-studio-unpublish",disabled:U,onClick:()=>void st(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"white","data-testid":"outfit-studio-publish",disabled:U||!bt,onClick:()=>void st(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ki as OutfitStudio,Ki as default};