@dcl/shop 1.4.2-31321117785.commit-e69ddc8 → 1.4.2-31321833858.commit-d05a541

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 (219) hide show
  1. package/_assets/{Activity-vUciLqTf.js → Activity-DsalM-e5.js} +24 -24
  2. package/_assets/{AnimatedBackground-D8EE4gIZ.js → AnimatedBackground-BOrNsqN1.js} +1 -1
  3. package/_assets/{Assets-DeNWsLcJ.js → Assets-QOoWiQL0.js} +2 -2
  4. package/_assets/{Assets.styles-9eZKD8s9.js → Assets.styles-CSP5Wb2u.js} +1 -1
  5. package/_assets/{Authorizations-CuKbIbof.js → Authorizations-C7ZkQpU3.js} +1 -1
  6. package/_assets/{Cart-DRGswNIT.js → Cart-CwXY-en-.js} +1 -1
  7. package/_assets/{CircularProgress-417O120F.js → CircularProgress-DJGW52uC.js} +1 -1
  8. package/_assets/{Collection-DIl5sMmU.js → Collection-Dw81a56N.js} +4 -4
  9. package/_assets/{CollectionCarousel-C6Qurv1c.js → CollectionCarousel-mhAYGnTb.js} +19 -19
  10. package/_assets/{Confetti-C-W2Wx7a.js → Confetti-BJzwqwTF.js} +1 -1
  11. package/_assets/{ConstantsUtil-B-N7tmhJ.js → ConstantsUtil-S9Rc8iab.js} +1 -1
  12. package/_assets/{ContentClient-31_9Q5IS.js → ContentClient-ljReoKyO.js} +1 -1
  13. package/_assets/{Creator-DNk4uxt9.js → Creator-D9b4j61f.js} +1 -1
  14. package/_assets/{DeploymentBuilder-DQuYAFLI.js → DeploymentBuilder-DSxp43uX.js} +1 -1
  15. package/_assets/{ErrorNotice-DivoNxAh.js → ErrorNotice-B_DnZnpz.js} +1 -1
  16. package/_assets/{ExchangeController-BcX3uUH7.js → ExchangeController-BnL43Mxg.js} +1 -1
  17. package/_assets/{Faq-SbSZ_ven.js → Faq-BkoPMwLV.js} +1 -1
  18. package/_assets/{GetCredits-BiezC23h.js → GetCredits-CetTDoCs.js} +1 -1
  19. package/_assets/{Grow-CRDOnWnS.js → Grow-DL6epSiS.js} +1 -1
  20. package/_assets/{HelpersUtil-B1FOZLKI.js → HelpersUtil-BL1YqLJc.js} +1 -1
  21. package/_assets/{ItemDetail-B8BxXpKv.js → ItemDetail-VFYUF0mL.js} +1 -1
  22. package/_assets/LazyEmoteControls-BGRwSFAr.js +2 -0
  23. package/_assets/{LoadMore-Bj3YyMIu.js → LoadMore-DAmGHMVW.js} +1 -1
  24. package/_assets/{ManaPricingBanner.styles-DaNuAlQd.js → ManaPricingBanner.styles-2dMknEFN.js} +1 -1
  25. package/_assets/{MyAssets-Bf6l8btr.js → MyAssets-BSO8VWKY.js} +2 -2
  26. package/_assets/{MyFavorites-B0xCRFDV.js → MyFavorites-DHhBkxx8.js} +1 -1
  27. package/_assets/{NetworkUtil-B0TAHRVW.js → NetworkUtil-CmFj23VB.js} +1 -1
  28. package/_assets/{NotFound-Mb8CPlkq.js → NotFound-DH7CCo8Z.js} +1 -1
  29. package/_assets/{NotificationsBell-BviPOVne.js → NotificationsBell-C-ZXxEiI.js} +1 -1
  30. package/_assets/{OutfitDetail-Ci5MgpAF.js → OutfitDetail-CFY6HZm6.js} +45 -45
  31. package/_assets/{OutfitPreview-C0o9HFjd.js → OutfitPreview-DS6GhxsN.js} +1 -1
  32. package/_assets/{OutfitStudio-UF3Nq1dn.js → OutfitStudio-NVNd-hvf.js} +8 -8
  33. package/_assets/{StoreSettings-BZR8VCrX.js → StoreSettings-CrZZUE9j.js} +21 -21
  34. package/_assets/{Success-BdnhPfxX.js → Success-B-MnwiE5.js} +1 -1
  35. package/_assets/{SwapController-DnTd3a5J.js → SwapController-Dbqbv3yv.js} +1 -1
  36. package/_assets/{Tooltip-DyT9Nmx6.js → Tooltip-BV1YJ2nx.js} +1 -1
  37. package/_assets/{TradeService-BU5sYL5A.js → TradeService-BDhWL-iC.js} +1 -1
  38. package/_assets/{W3MFrameProviderSingleton-DK8M6L_d.js → W3MFrameProviderSingleton-DkDY_Uhq.js} +3 -3
  39. package/_assets/{WebCryptoP256-D8fnuOYK.js → WebCryptoP256-dZsiPxua.js} +1 -1
  40. package/_assets/authorizations-DdXEl4SH.js +1 -0
  41. package/_assets/{basic-B5dlNOvx.js → basic-BxS4xyCI.js} +1 -1
  42. package/_assets/{biconomy-DkX-xo0j.js → biconomy-ChyCaDhZ.js} +1 -1
  43. package/_assets/{builder-C5qlb5g7.js → builder-aNj3KtnQ.js} +1 -1
  44. package/_assets/{buy-DPUp0il9.js → buy-ITSy499E.js} +1 -1
  45. package/_assets/buy-gasless-Qwo4-LdH.js +1 -0
  46. package/_assets/{categories-rIrLyLhy.js → categories-C_3TBHB6.js} +1 -1
  47. package/_assets/{ccip-BwI-jEx0.js → ccip-DSAZ1Drq.js} +1 -1
  48. package/_assets/{ccip-BDTNQTNt.js → ccip-q9rBWRrW.js} +1 -1
  49. package/_assets/{chains-D2oWbaWg.js → chains-C3ogoGMY.js} +1 -1
  50. package/_assets/{collectionPage.styles-DyZ6yfVA.js → collectionPage.styles-lQ1i3kYb.js} +4 -4
  51. package/_assets/{common-BAvH8GHQ.js → common-Du-luxO1.js} +1 -1
  52. package/_assets/{controller-Cuvny8mm.js → controller-CjHTogUM.js} +2 -2
  53. package/_assets/{core-d_w0otml.js → core-BLRurbyU.js} +4 -4
  54. package/_assets/{createSvgIcon-Sv_6XDk_.js → createSvgIcon-DPRU4ebA.js} +1 -1
  55. package/_assets/{custom-D3ThyY6Q.js → custom-DESM1TBo.js} +1 -1
  56. package/_assets/{data-capture-CIAiYYr_.js → data-capture-Xahs7XND.js} +1 -1
  57. package/_assets/decimals-CA4WCN0k.js +1 -0
  58. package/_assets/{decimals-CZsb_Tk_.js → decimals-CN36TWfs.js} +1 -1
  59. package/_assets/{detectExtension-rsF4cbdU.js → detectExtension-D5bfb7Ei.js} +1 -1
  60. package/_assets/{email-DYTNNiw_.js → email-BnVyGQjo.js} +1 -1
  61. package/_assets/{embedded-wallet-CaxCIqyZ.js → embedded-wallet-BZeoh5V4.js} +1 -1
  62. package/_assets/{emotion-styled.browser.esm-D-zA0hBW.js → emotion-styled.browser.esm-ScvFm9x7.js} +1 -1
  63. package/_assets/{engine-B6Wkto0L.js → engine-B-fLoDkH.js} +1 -1
  64. package/_assets/{errors-BgGl4_vk.js → errors-DXSAwVw4.js} +1 -1
  65. package/_assets/{estimate-l1-fee-CwRQP56r.js → estimate-l1-fee-BjJ_4KQn.js} +1 -1
  66. package/_assets/{eth_estimateGas-B0JtMXaP.js → eth_estimateGas-VGXN9rx1.js} +1 -1
  67. package/_assets/{eth_getStorageAt-BWiaTHYk.js → eth_getStorageAt-xHOtLw9t.js} +1 -1
  68. package/_assets/{eth_getTransactionCount-DxkkCESB.js → eth_getTransactionCount-DeOan_M2.js} +1 -1
  69. package/_assets/{ethereum-BQu4alQE.js → ethereum-wAQ6oI96.js} +1 -1
  70. package/_assets/{ethers-DYJhhXPV.js → ethers-CHvw3dSr.js} +1 -1
  71. package/_assets/{execute-CnNCm8P6.js → execute-DA2F3yom.js} +2 -2
  72. package/_assets/{extractIPFS-DcAd3dA4.js → extractIPFS-DYEe95Fe.js} +1 -1
  73. package/_assets/{features-Dy0GUX0N.js → features-P2l_M4a9.js} +1 -1
  74. package/_assets/{fetchTokenMetadata-D1q-pnnU.js → fetchTokenMetadata-C1e9utql.js} +2 -2
  75. package/_assets/{field.styles-DaRdJ0Y8.js → field.styles-DUhp2XSE.js} +1 -1
  76. package/_assets/{get-bytecode-G9ucw6r2.js → get-bytecode-C_QCCMoR.js} +1 -1
  77. package/_assets/get-ecosystem-wallet-info-D6ZqL22k.js +1 -0
  78. package/_assets/{getBalance-DzL2VWrp.js → getBalance-BRp_O879.js} +2 -2
  79. package/_assets/{getInstalledModules-9JIeedPe.js → getInstalledModules-TqMZVwQW.js} +1 -1
  80. package/_assets/getNFT-CxoCzDMN.js +1 -0
  81. package/_assets/{getNFT-gbQFtRNR.js → getNFT-D5BgP1-B.js} +2 -2
  82. package/_assets/{grid.styles-BLNJxnwJ.js → grid.styles-8zRUQugb.js} +1 -1
  83. package/_assets/{hashTypedData-cmcOA8ay.js → hashTypedData-BVfCehOr.js} +1 -1
  84. package/_assets/{hashTypedData-C5SQ50I6.js → hashTypedData-DYCRMzzm.js} +1 -1
  85. package/_assets/{in-app-BxN-iatR.js → in-app-DkcHZ10N.js} +1 -1
  86. package/_assets/{in-app-wallet-calls-NBQL4XFJ.js → in-app-wallet-calls-gnS8ZYX9.js} +1 -1
  87. package/_assets/{index-B23IgafR.js → index--uTyu0uz.js} +1 -1
  88. package/_assets/{index-CCvG9DBk.js → index-1ZLnfNGq.js} +1 -1
  89. package/_assets/{index-DtYqvBS-.js → index-2mvOLhCu.js} +1 -1
  90. package/_assets/{index-BaqALAx-.js → index-B-uyLfLW.js} +1 -1
  91. package/_assets/{index-RtOMytms.js → index-BElLBIDw.js} +1 -1
  92. package/_assets/{index-BnGs2U1H.js → index-BHVZE5-w.js} +1 -1
  93. package/_assets/{index-D3xGDSz7.js → index-BHiuk7dd.js} +1 -1
  94. package/_assets/{index-DwmB1OcJ.js → index-BKE2sklY.js} +1 -1
  95. package/_assets/{index-yXUgI3Y8.js → index-BR-AXZqF.js} +1 -1
  96. package/_assets/{index-218Sej3Q.js → index-BTUwiZLK.js} +1 -1
  97. package/_assets/{index-BGS9C_i9.js → index-BVWvbmB_.js} +24 -24
  98. package/_assets/{index-DdsbGkyj.js → index-BYvgoigv.js} +1 -1
  99. package/_assets/{index-DLdpXsvH.js → index-B_1v6F0h.js} +1 -1
  100. package/_assets/{index-B4PGHKPV.js → index-B_3Ca4N6.js} +2 -2
  101. package/_assets/{index-CF4Ku7YV.js → index-BcxEq2Er.js} +1 -1
  102. package/_assets/{index-BDawxd7K.js → index-BhcJRwSw.js} +1 -1
  103. package/_assets/{index-CmTDUoFL.js → index-BiNtOaPH.js} +1 -1
  104. package/_assets/{index-2NVhi815.js → index-Bl3tllG2.js} +1 -1
  105. package/_assets/{index-M8Qhipno.js → index-BqTYxdMG.js} +1 -1
  106. package/_assets/{index-Btob1yJ2.js → index-BsZqUcMW.js} +1 -1
  107. package/_assets/{index-BcyBTPof.js → index-BtXchQlE.js} +1 -1
  108. package/_assets/{index-DiSEimfZ.js → index-CA_m9eDM.js} +1 -1
  109. package/_assets/{index-BzMH2n9V.js → index-CEBe8Ks-.js} +1 -1
  110. package/_assets/{index-C-qoWK2S.js → index-CI91n7ZK.js} +1 -1
  111. package/_assets/{index-L88EKwUU.js → index-CKQ7PP9t.js} +1 -1
  112. package/_assets/{index-BuoSbTCz.js → index-CNjkfqno.js} +1 -1
  113. package/_assets/{index-CrGGUg7V.js → index-CSuR3VTG.js} +1 -1
  114. package/_assets/{index-roUOVZsO.js → index-CVdDq8EF.js} +1 -1
  115. package/_assets/{index-_wt2ox1t.js → index-CYTl2aV_.js} +1 -1
  116. package/_assets/{index-CO6uIjyC.js → index-CaWADU3A.js} +3 -3
  117. package/_assets/{index-B_A3LHnA.js → index-ChtghJjk.js} +1 -1
  118. package/_assets/{index-BOct49Vj.js → index-CstxEm24.js} +1 -1
  119. package/_assets/{index-BUpfB8FR.js → index-CtmBq3lY.js} +1 -1
  120. package/_assets/{index-CfsDDDtE.js → index-CtnJfdje.js} +1 -1
  121. package/_assets/{index-DJfImPGN.js → index-CuEcRXk2.js} +1 -1
  122. package/_assets/{index-v-oeqUfd.js → index-Cy3K6TbO.js} +1 -1
  123. package/_assets/{index-DspCdG2m.js → index-D0Sno89y.js} +1 -1
  124. package/_assets/{index-BUzs9scd.js → index-D3Cq4bqb.js} +1 -1
  125. package/_assets/{index-B5DFOtWx.js → index-DBV70okV.js} +1 -1
  126. package/_assets/{index-DGNm9Eym.js → index-DFbLJk0v.js} +1 -1
  127. package/_assets/{index-DzIDFWT0.js → index-DIXd4yr6.js} +3 -3
  128. package/_assets/{index-DYYZp072.js → index-DJj7DNI5.js} +2 -2
  129. package/_assets/{index-Db0xJokm.js → index-DKik1tqf.js} +1 -1
  130. package/_assets/{index-KhBWlDLt.js → index-DNaUH0hG.js} +1 -1
  131. package/_assets/{index-JUSoFFJD.js → index-DOUhX2vd.js} +1 -1
  132. package/_assets/{index-D8XCi3aX.js → index-DWB648gE.js} +2 -2
  133. package/_assets/{index-Bhtj7hDK.js → index-DbCIRxku.js} +3 -3
  134. package/_assets/{index-xqoDvYsT.js → index-DfVwZLZv.js} +1 -1
  135. package/_assets/{index-D1IqEWjK.js → index-Di93FjoO.js} +1 -1
  136. package/_assets/{index-DDi4NQb2.js → index-DoPvIZFo.js} +1 -1
  137. package/_assets/{index-BC1Wsxp3.js → index-Dziv-ztL.js} +1 -1
  138. package/_assets/{index-gbLpvk0M.js → index-KCnWqTid.js} +1 -1
  139. package/_assets/{index-X7MvWQQb.js → index-LLZCscV-.js} +1 -1
  140. package/_assets/{index-BaxEHXOM.js → index-RzZ2o1PM.js} +1 -1
  141. package/_assets/{index-DwYM9TXB.js → index-UKBE5ufT.js} +1 -1
  142. package/_assets/{index-gqd47qxW.js → index-WtEb8Dou.js} +1 -1
  143. package/_assets/{index-Bfp0Y4Pw.js → index-XsdlViAm.js} +1 -1
  144. package/_assets/{index-C5D0KpNA.js → index-hraIPyUK.js} +2 -2
  145. package/_assets/{index-5O7asnX4.js → index-nyMFoZlx.js} +1 -1
  146. package/_assets/{index-C6tCZwI6.js → index-oGGEVx4e.js} +1 -1
  147. package/_assets/{index-B8fBx8-w.js → index-pGuWMonI.js} +1 -1
  148. package/_assets/{index-CIfAYGCp.js → index-xmwrM1gX.js} +1 -1
  149. package/_assets/{index.es-C6y0J8Tt.js → index.es-1C-91fa0.js} +1 -1
  150. package/_assets/{index.es-CzazB5gL.js → index.es-BSWBrpQe.js} +4 -4
  151. package/_assets/{index.es-CSI3hDuw.js → index.es-dMv11h1g.js} +1 -1
  152. package/_assets/{linkAccount-Dqh7KxX0.js → linkAccount-BPOjpDQF.js} +1 -1
  153. package/_assets/{localBatchGatewayRequest-BE9sc6Bj.js → localBatchGatewayRequest-DQhTBRSh.js} +1 -1
  154. package/_assets/{native-BqatX2SO.js → native-DDD_yqs5.js} +1 -1
  155. package/_assets/{networks-BTCxpPfq.js → networks-DuFCMSqt.js} +1 -1
  156. package/_assets/{onramp-BRQHD09i.js → onramp-CB-lwIcL.js} +1 -1
  157. package/_assets/{openzeppelin-Duoy0McU.js → openzeppelin-BEzK-ytM.js} +1 -1
  158. package/_assets/{ownerOf-D2bgWPl4.js → ownerOf-CR0b_ZWL.js} +1 -1
  159. package/_assets/{parseNft-L35iDsLu.js → parseNft-CeR_0mFl.js} +2 -2
  160. package/_assets/{parseSignature-D82Px8bB.js → parseSignature-BXY4fDlp.js} +3 -3
  161. package/_assets/{parseSignature-BW4RUQHL.js → parseSignature-DvIu4faj.js} +1 -1
  162. package/_assets/{passkeys-CWRdzOgW.js → passkeys-DoXc4Xy7.js} +1 -1
  163. package/_assets/{pay-with-exchange-e9qqe6Il.js → pay-with-exchange-D3YRwRnQ.js} +1 -1
  164. package/_assets/{prepare-contract-call-DDUXPPWf.js → prepare-contract-call-CuOouwzZ.js} +1 -1
  165. package/_assets/{qr-overlay-Dfuos3Dx.js → qr-overlay-BKsCOIA8.js} +1 -1
  166. package/_assets/{receive-BZ2k6lzF.js → receive-B1KBfflU.js} +1 -1
  167. package/_assets/{resolveImplementation-zyU9nNFG.js → resolveImplementation-rJZA8R7-.js} +1 -1
  168. package/_assets/{rpc-D5Y8gbEs.js → rpc-z-_gajTg.js} +1 -1
  169. package/_assets/{secp256k1-CKOpdK2z.js → secp256k1-CEt2uVIa.js} +1 -1
  170. package/_assets/{secp256k1-Em6pk7JJ.js → secp256k1-DzPEUahX.js} +1 -1
  171. package/_assets/{secp256k1-CmtsAL4o.js → secp256k1-Eu_UrDZQ.js} +1 -1
  172. package/_assets/{send-BIFJ211N.js → send-BP56Pjq2.js} +1 -1
  173. package/_assets/{send-batch-transaction-DOXxOqep.js → send-batch-transaction-E8tR0aO1.js} +1 -1
  174. package/_assets/{send-eip712-transaction-BH50-BBC.js → send-eip712-transaction-6B8BaRp6.js} +2 -2
  175. package/_assets/send-gasless-transaction-BC0vYYGz.js +2 -0
  176. package/_assets/{send-transaction-sMQ2fCJ1.js → send-transaction-Cyj6alac.js} +2 -2
  177. package/_assets/{sendMetaTransaction-BzjGNyNr.js → sendMetaTransaction-CxjN2iMp.js} +1 -1
  178. package/_assets/{sendRawTransaction-BHReQOjp.js → sendRawTransaction-BZMjypDx.js} +3 -3
  179. package/_assets/{sentry-ByNeKxg1.js → sentry-CUdtSPei.js} +1 -1
  180. package/_assets/{serializeTransaction-wTVp_UPB.js → serializeTransaction-DdLuDvZh.js} +1 -1
  181. package/_assets/{session-proposal-D7dUDP4A.js → session-proposal-Cb_IdGgx.js} +1 -1
  182. package/_assets/{session-request-yXC_poMj.js → session-request-CuiTHTkf.js} +2 -2
  183. package/_assets/{sha256-DlvyKk25.js → sha256-DsP9u1VJ.js} +1 -1
  184. package/_assets/{signing-tozip71V.js → signing-B_TMY__g.js} +3 -3
  185. package/_assets/{skeleton.styles-BkIQo-2n.js → skeleton.styles-BZ8ZgFLU.js} +1 -1
  186. package/_assets/{socials-BqCKUUee.js → socials-DDD9uvpM.js} +1 -1
  187. package/_assets/{styled-D09jxUGQ.js → styled-KLwzgdoB.js} +1 -1
  188. package/_assets/{swaps-CD2yvr5k.js → swaps-CjqUbBfb.js} +1 -1
  189. package/_assets/{thirdweb-CVmDBG2O.js → thirdweb-0rujUNSl.js} +3 -3
  190. package/_assets/{to-serializable-transaction-D11t4_Ix.js → to-serializable-transaction-NCusZ8xl.js} +2 -2
  191. package/_assets/{totalSupply-BZAL3oCm.js → totalSupply-u5fgMBD-.js} +1 -1
  192. package/_assets/{transaction-DdagAX_X.js → transaction-C8mfivVb.js} +1 -1
  193. package/_assets/{transactionReceipt-C_HbaTZp.js → transactionReceipt-BHjPvP-A.js} +1 -1
  194. package/_assets/{transactions-oSY8W1hd.js → transactions-D0YLE766.js} +1 -1
  195. package/_assets/{useCreditPacks-USUUNSOp.js → useCreditPacks-DhRruCBh.js} +1 -1
  196. package/_assets/{useImportable-CrCX6e-b.js → useImportable-COXp75Oi.js} +1 -1
  197. package/_assets/{useInfiniteGrid-Cw-ORqbZ.js → useInfiniteGrid-CPaNhKNU.js} +1 -1
  198. package/_assets/{useStore-CfjE2pXy.js → useStore-a0qe_EW2.js} +2 -2
  199. package/_assets/useTheme-DgGKATWA.js +1 -0
  200. package/_assets/{utils-BjezQJkW.js → utils-ClNpRN95.js} +1 -1
  201. package/_assets/{verifyHash-BRfBGsvp.js → verifyHash-Czkmjbtb.js} +1 -1
  202. package/_assets/{w3m-modal-2MMPp63l.js → w3m-modal-CCQZ28h5.js} +1 -1
  203. package/_assets/{w3m-modal-C4kBiIJJ.js → w3m-modal-XkqIwsWW.js} +1 -1
  204. package/_assets/{wait-for-tx-receipt-CqYuxxBM.js → wait-for-tx-receipt-umHQbgNk.js} +1 -1
  205. package/_assets/{wallets-DzlLDHLy.js → wallets-dFWYb-aD.js} +5 -5
  206. package/_assets/{web-connector-5tLEu31t.js → web-connector-B6I8EGFj.js} +3 -3
  207. package/_assets/{writeContract-DK1RD1Dv.js → writeContract-C2tbGQyL.js} +1 -1
  208. package/_assets/{zora-sepolia-Bj4K3_p8.js → zora-sepolia-CIZA49Ti.js} +1 -1
  209. package/_assets/{zoraTestnet-ZxpHk1Ex.js → zoraTestnet-Chf9u3j4.js} +1 -1
  210. package/index.html +11 -11
  211. package/package.json +2 -2
  212. package/_assets/LazyEmoteControls-DFo4LVof.js +0 -2
  213. package/_assets/authorizations-CGsXmKlT.js +0 -1
  214. package/_assets/buy-gasless-HWNzfRM9.js +0 -1
  215. package/_assets/decimals-B0alSDDy.js +0 -1
  216. package/_assets/get-ecosystem-wallet-info-B3hjPPro.js +0 -1
  217. package/_assets/getNFT-DT3yCCbz.js +0 -1
  218. package/_assets/send-gasless-transaction-DoMxo8So.js +0 -2
  219. package/_assets/useTheme-hg2AifFk.js +0 -1
@@ -1,29 +1,29 @@
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,v as M,R as re,l as le,y as de,b as s,S as _,U as F,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 Ce,A as z,aa as Ie,ab as Ee,ac as ze,ad as Le,ae as We,af as Oe}from"./index-BGS9C_i9.js";import{E as H}from"./ErrorNotice-DivoNxAh.js";import{E as Se}from"./LazyEmoteControls-DFo4LVof.js";import{O as Ae}from"./OutfitPreview-C0o9HFjd.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-ByNeKxg1.js";import"./ethers-DYJhhXPV.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:n,radius:f,media:r,gradients:Fe}=ae,K=t.div`
1
+ import{L as $,d as ae,j as e,r as h}from"./react-BYHuwl8r.js";import{t as se,s as t,I as j,O as ne,P as oe,B as w,Q as re,v as _,R as le,l as de,y as ce,b as s,S as H,U as T,V as he,W as pe,X as me,Y as ue,Z as xe,$ as ge,a0 as fe,a1 as be,a2 as ye,a3 as ve,a4 as je,a5 as we,a6 as $e,a7 as ke,a8 as Ce,a9 as Ie,A as z,aa as Ee,ab as ze,ac as Le,ad as We,ae as Oe,af as Se}from"./index-BVWvbmB_.js";import{E as K}from"./ErrorNotice-B_DnZnpz.js";import{E as Ae}from"./LazyEmoteControls-BGRwSFAr.js";import{O as Fe}from"./OutfitPreview-DS6GhxsN.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-CUdtSPei.js";import"./ethers-CHvw3dSr.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:n,radius:g,media:r,gradients:Te}=se,q=t.div`
2
2
  max-width: 1721px;
3
3
  margin: 0 auto;
4
4
  /* The page's bottom padding is 56px, but the phone CTA bar is sticky and has its own bottom padding for the safe area.
5
5
  * The bar's shadow would otherwise float over the footer, so the page's padding is reduced to match the bar's height. */
6
6
  margin-bottom: -56px;
7
- `,Te=t.nav`
7
+ `,Pe=t.nav`
8
8
  display: flex;
9
9
  align-items: center;
10
10
  gap: 8px;
11
11
  font-size: 13px;
12
12
  color: ${n.gray4};
13
13
  margin-bottom: 18px;
14
- `,T=t(k)`
14
+ `,P=t($)`
15
15
  color: ${n.gray4};
16
16
 
17
17
  &:hover {
18
18
  color: ${n.white};
19
19
  }
20
- `,Pe=t.span`
20
+ `,Re=t.span`
21
21
  color: ${n.softWhite};
22
22
  font-weight: 600;
23
23
  overflow: hidden;
24
24
  white-space: nowrap;
25
25
  text-overflow: ellipsis;
26
- `,q=t.div`
26
+ `,D=t.div`
27
27
  display: grid;
28
28
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
29
29
  gap: 40px;
@@ -37,7 +37,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
37
37
  height: auto;
38
38
  min-height: 0;
39
39
  }
40
- `,D=t.div`
40
+ `,U=t.div`
41
41
  position: relative;
42
42
  border-radius: 24px;
43
43
  overflow: hidden;
@@ -63,7 +63,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
63
63
  inset: 0;
64
64
  pointer-events: none;
65
65
  }
66
- `,Re=t.div`
66
+ `,Be=t.div`
67
67
  position: absolute;
68
68
  inset: 0;
69
69
  pointer-events: none;
@@ -71,18 +71,18 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
71
71
  & [class*='MuiBox'] {
72
72
  pointer-events: auto;
73
73
  }
74
- `,Be=t.img`
74
+ `,Ne=t.img`
75
75
  position: absolute;
76
76
  inset: 0;
77
77
  width: 100%;
78
78
  height: 100%;
79
79
  object-fit: contain;
80
- `,U=t.div`
80
+ `,V=t.div`
81
81
  display: flex;
82
82
  flex-direction: column;
83
83
  gap: 15px;
84
84
  min-height: 0;
85
- `,Ne=t.h1`
85
+ `,Me=t.h1`
86
86
  font-size: 28px;
87
87
  font-weight: 600;
88
88
  color: ${n.softWhite};
@@ -92,13 +92,13 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
92
92
  font-size: 20px;
93
93
  line-height: 24px;
94
94
  }
95
- `,Me=t.p`
95
+ `,_e=t.p`
96
96
  font-size: 12px;
97
97
  font-weight: 500;
98
98
  letter-spacing: 0.04em;
99
99
  text-transform: uppercase;
100
100
  color: ${n.gray4};
101
- `,_e=t.div`
101
+ `,He=t.div`
102
102
  flex: 0 1 auto;
103
103
  min-height: 0;
104
104
  overflow-y: auto;
@@ -114,19 +114,19 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
114
114
  padding: 0;
115
115
  margin: 0;
116
116
  }
117
- `,He=t.ul`
117
+ `,Ke=t.ul`
118
118
  list-style: none;
119
119
  margin: 0;
120
120
  padding: 0;
121
121
  display: flex;
122
122
  flex-direction: column;
123
123
  gap: 10px;
124
- `,Ke=t.li`
124
+ `,qe=t.li`
125
125
  position: relative;
126
126
  display: flex;
127
127
  align-items: stretch;
128
128
  gap: 14px;
129
- border-radius: ${f.card};
129
+ border-radius: ${g.card};
130
130
  background: rgba(0, 0, 0, 0.4);
131
131
  color: ${n.softWhite};
132
132
  overflow: hidden;
@@ -142,7 +142,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
142
142
  z-index: 5;
143
143
  pointer-events: none;
144
144
  border-radius: inherit;
145
- ${se};
145
+ ${ne};
146
146
  opacity: 0;
147
147
  transition: opacity 0.3s ease;
148
148
  }
@@ -150,7 +150,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
150
150
  @media (hover: hover) {
151
151
  &:hover,
152
152
  &:focus-within {
153
- ${ne};
153
+ ${oe};
154
154
  transform: scale(1.015);
155
155
  /* Above the neighbouring rows while zoomed, or the next card paints over the growth. */
156
156
  z-index: 6;
@@ -177,15 +177,15 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
177
177
  &[data-state='missing'] {
178
178
  opacity: 0.55;
179
179
  }
180
- `,qe=t(k)`
180
+ `,De=t($)`
181
181
  position: absolute;
182
182
  inset: 0;
183
183
  z-index: 1;
184
- `,De=t.img`
184
+ `,Ue=t.img`
185
185
  width: 96px;
186
186
  height: 96px;
187
187
  object-fit: cover;
188
- border-radius: ${f.card};
188
+ border-radius: ${g.card};
189
189
  background: ${n.media};
190
190
  flex-shrink: 0;
191
191
 
@@ -193,10 +193,10 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
193
193
  width: 88px;
194
194
  height: 88px;
195
195
  }
196
- `,Ue=t.span`
196
+ `,Ve=t.span`
197
197
  width: 96px;
198
198
  height: 96px;
199
- border-radius: ${f.card};
199
+ border-radius: ${g.card};
200
200
  background: ${n.media};
201
201
  flex-shrink: 0;
202
202
 
@@ -204,7 +204,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
204
204
  width: 88px;
205
205
  height: 88px;
206
206
  }
207
- `,P=t.div`
207
+ `,R=t.div`
208
208
  flex: 1;
209
209
  min-width: 0;
210
210
  display: flex;
@@ -218,7 +218,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
218
218
  white-space: nowrap;
219
219
  overflow: hidden;
220
220
  text-overflow: ellipsis;
221
- `,Ve=t(k)`
221
+ `,Qe=t($)`
222
222
  position: relative;
223
223
  z-index: 2;
224
224
  align-self: flex-start;
@@ -229,27 +229,27 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
229
229
  color: ${n.softWhite};
230
230
  text-decoration: underline;
231
231
  }
232
- `,R=t.span`
232
+ `,B=t.span`
233
233
  display: flex;
234
234
  align-items: center;
235
235
  gap: 6px;
236
236
  margin-top: 2px;
237
- `,Qe=t.span`
237
+ `,Ge=t.span`
238
238
  display: inline-flex;
239
239
  align-items: center;
240
240
  gap: 5px;
241
241
  font-size: 16px;
242
242
  font-weight: 600;
243
243
  white-space: nowrap;
244
- `,v=t.span`
244
+ `,y=t.span`
245
245
  font-size: 12px;
246
246
  font-weight: 400;
247
247
  padding: 2px 8px;
248
- border-radius: ${f.chip};
248
+ border-radius: ${g.chip};
249
249
  background: rgba(255, 255, 255, 0.14);
250
250
  color: ${n.softWhite};
251
251
  white-space: nowrap;
252
- `,Ge=t.span`
252
+ `,Xe=t.span`
253
253
  display: flex;
254
254
  align-items: center;
255
255
  gap: 3px;
@@ -258,7 +258,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
258
258
  ${r.maxWidth("mobile")} {
259
259
  display: none;
260
260
  }
261
- `,j=t(oe)`
261
+ `,v=t(re)`
262
262
  border-radius: 6px;
263
263
 
264
264
  &[data-variant='smart'],
@@ -274,17 +274,17 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
274
274
  &[data-variant='icon'] .ico {
275
275
  color: ${n.softWhite};
276
276
  }
277
- `,Xe=t.p`
277
+ `,Ye=t.p`
278
278
  margin: 0;
279
279
  font-size: 13px;
280
280
  color: ${n.gray4};
281
- `,Ye=t.div`
281
+ `,Ze=t.div`
282
282
  display: flex;
283
283
  flex-direction: column;
284
284
  align-items: flex-start;
285
285
  gap: 12px;
286
286
  padding: 8px 0;
287
- `,Ze=t.div`
287
+ `,Je=t.div`
288
288
  display: flex;
289
289
  flex-direction: column;
290
290
  gap: 12px;
@@ -305,7 +305,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
305
305
  background: ${n.accent};
306
306
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
307
307
  }
308
- `,Je=t.div`
308
+ `,et=t.div`
309
309
  display: flex;
310
310
  align-items: center;
311
311
  justify-content: space-between;
@@ -314,20 +314,20 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
314
314
  /* The phone CTA carries the price itself (the Figma bar). */
315
315
  display: none;
316
316
  }
317
- `,et=t.span`
317
+ `,tt=t.span`
318
318
  font-size: 14px;
319
319
  font-weight: 600;
320
320
  letter-spacing: 0.04em;
321
321
  text-transform: uppercase;
322
322
  color: ${n.gray4};
323
- `,tt=t.span`
323
+ `,it=t.span`
324
324
  display: inline-flex;
325
325
  align-items: center;
326
326
  gap: 6px;
327
327
  font-size: 26px;
328
328
  font-weight: 800;
329
329
  color: ${n.softWhite};
330
- `,it=t($)`
330
+ `,at=t(w)`
331
331
  width: 100%;
332
332
  min-height: 52px;
333
333
  border-radius: 16px;
@@ -337,7 +337,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
337
337
  gap: 10px;
338
338
 
339
339
  && {
340
- background: ${Fe.buyBtn};
340
+ background: ${Te.buyBtn};
341
341
  }
342
342
  &&::before {
343
343
  content: none;
@@ -347,9 +347,9 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
347
347
  }
348
348
 
349
349
  ${r.maxWidth("mobile")} {
350
- border-radius: ${f.pill};
350
+ border-radius: ${g.pill};
351
351
  }
352
- `,at=t.span`
352
+ `,st=t.span`
353
353
  display: none;
354
354
 
355
355
  ${r.maxWidth("mobile")} {
@@ -358,7 +358,7 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
358
358
  gap: 5px;
359
359
  font-size: 16px;
360
360
  }
361
- `,B=t.div`
361
+ `,N=t.div`
362
362
  min-height: 52vh;
363
363
  display: flex;
364
364
  flex-direction: column;
@@ -367,11 +367,11 @@ import{L as k,d as ie,j as e,r as h}from"./react-BYHuwl8r.js";import{t as ae,s a
367
367
  text-align: center;
368
368
  gap: 14px;
369
369
  color: ${n.softWhite};
370
- `,st=t(w)`
370
+ `,nt=t(j)`
371
371
  opacity: 0.4;
372
- `,nt=t.h1`
372
+ `,ot=t.h1`
373
373
  font-size: 24px;
374
- `,ot=t.p`
374
+ `,rt=t.p`
375
375
  margin: 0;
376
376
  color: ${n.gray4};
377
- `,N="outfit-detail-preview";function yt(){const{id:i}=ie(),o=M(y=>y.session),c=re(),b=c==="creator",{data:l,isError:C,refetch:m}=le({queryKey:["outfit",i,b],enabled:F()&&!!i,staleTime:6e4,queryFn:()=>Oe(i,b&&o?o.identity:void 0)}),d=!F()||!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")})]}):C?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=Ie(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:b,totalCredits:l,addOutfit:C,isAdding:m}=he(i,o),d=M(a=>{var g;return(g=a.session)==null?void 0:g.address}),y=pe(a=>a.items),W=h.useMemo(()=>new Set(y.map(me)),[y]),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 I=h.useMemo(()=>i.items.map(a=>{const g=xe(a),E=o.byKey.get(g)??null;return{key:g,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(()=>I.map(a=>a.item).filter(a=>!!a),[I]),A=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:A,tryOnCategories:J}),ee=i.items.length,te=!o.isLoading&&!o.isError,x=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&&A.length===0?e.jsx(Be,{src:O,alt:i.name}):e.jsx(Ae,{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.jsx(_e,{children:e.jsx(He,{children:I.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(Ce,{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))})}),e.jsxs(Ze,{"data-testid":"outfit-detail-ctabar",children:[te&&c.ownListing.length>0?e.jsx(Xe,{children:s("outfits.detail.yourListingHint")}):null,x>0&&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:C,disabled:m||x===0,"aria-busy":m||void 0,children:[m?s("outfits.card.adding"):x>0?s("outfits.detail.addCount",{count:x}):b>0?s("outfits.detail.nothingToAdd"):s("outfits.card.unavailable"),!m&&x>0?e.jsxs(at,{children:[e.jsx(z,{size:16}),l.toLocaleString()]}):null]})]})]})]})]})]})}export{yt as OutfitDetail,yt as default};
377
+ `,M="outfit-detail-preview";function vt(){const{id:i}=ae(),o=_(c=>c.session),l=le(),f=l==="creator",{data:d,isError:k,refetch:C}=de({queryKey:["outfit",i,f],enabled:T()&&!!i,staleTime:6e4,queryFn:()=>Se(i,f&&o?o.identity:void 0)}),p=!T()||!i||d===null&&l!=="pending";return ce(p?{title:s("seo.outfit.notFoundTitle"),noindex:!0}:d?{title:d.name,image:H(d.thumbnailHash)??void 0}:{}),p?e.jsxs(N,{"data-testid":"outfit-notfound",children:[e.jsx(nt,{name:"cart",size:44}),e.jsx(ot,{children:s("outfits.detail.notFoundTitle")}),e.jsx(rt,{children:s("outfits.detail.notFoundBody")}),e.jsx(w,{as:$,to:"/items",variant:"purple",children:s("notFound.cta")})]}):k?e.jsxs(N,{"data-testid":"outfit-detail-error",children:[e.jsx(K,{message:s("outfits.errors.generic")}),e.jsx(w,{variant:"purple",onClick:()=>void C(),children:s("outfits.detail.retry")})]}):d?e.jsx(dt,{outfit:d}):e.jsx(q,{"aria-busy":"true","data-testid":"outfit-detail-loading",children:e.jsxs(D,{children:[e.jsx(U,{children:e.jsx("span",{className:"skeleton",style:{position:"absolute",inset:0},"aria-hidden":!0})}),e.jsxs(V,{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 lt({item:i}){const o=Ee(i),l=ze(i.gender);return e.jsxs(Xe,{children:[i.rarity?e.jsx(v,{"data-variant":"rarity",style:{background:Oe(i.rarity)},title:We(i.rarity),children:Le(i.rarity)}):null,i.isSmart?e.jsxs(v,{"data-variant":"smart",children:[e.jsx(j,{name:"smart",size:13}),s("assetCard.smart")]}):null,o?e.jsx(v,{"data-variant":"icon",children:e.jsx(j,{name:o})}):null,l?e.jsx(v,{"data-variant":"icon",children:e.jsx(j,{name:l})}):null]})}function dt({outfit:i}){const o=he(i),{split:l,availableCount:f,totalCredits:d,outfitCredits:k,addOutfit:C,isAdding:p}=pe(i,o),c=_(a=>{var x;return(x=a.session)==null?void 0:x.address}),W=me(a=>a.items),O=h.useMemo(()=>new Set(W.map(ue)),[W]),S=H(i.thumbnailHash),A=h.useRef(null);h.useEffect(()=>{A.current!==i.id&&(A.current=i.id,xe("Shop Outfit Viewed",{outfit_id:i.id,item_count:i.items.length}))},[i.id,i.items.length]);const I=h.useMemo(()=>i.items.map(a=>{const x=ge(a),E=o.byKey.get(x)??null;return{key:x,item:E,state:E?fe(E,{address:c,cartKeys:O}):"missing"}}),[i,o.byKey,c,O]),{data:Q,isFetched:G}=be(c),X=!c||G,Y=!!c&&!!Q,Z=i.bodyShape==="female"?ye:i.bodyShape==="male"?ve:void 0,m=h.useMemo(()=>I.map(a=>a.item).filter(a=>!!a),[I]),F=h.useMemo(()=>je(m),[m]),J=h.useMemo(()=>!!we(m),[m]),ee=h.useMemo(()=>m.map(a=>$e(a)??"").filter(Boolean),[m]),u=ke({address:c,tryOnUrns:F,tryOnCategories:ee}),te=i.items.length,ie=!o.isLoading&&!o.isError,b=l.purchasable.length;return e.jsxs(q,{"data-testid":"outfit-detail",children:[e.jsxs(Pe,{"aria-label":s("outfits.detail.breadcrumbAria"),children:[e.jsx(P,{to:"/overview",children:s("nav.overview")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(P,{to:"/overview",children:s("outfits.detail.breadcrumbLooks")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Re,{children:i.name})]}),e.jsxs(D,{children:[e.jsx(U,{"data-testid":"outfit-detail-preview",style:{background:Ce(i)},children:S&&!o.isLoading&&F.length===0?e.jsx(Ne,{src:S,alt:i.name}):e.jsx(Fe,{id:M,profile:u.profile,bodyShape:u.bodyShape??(Y?void 0:Z),urns:u.urns,skin:u.skin,hair:u.hair,eyes:u.eyes,enabled:X&&!u.isLoading&&!o.isLoading,controls:J?e.jsx(Be,{"data-testid":"outfit-emote-controls",children:e.jsx(Ae,{wearablePreviewId:M,hideFrameInput:!0})}):null})}),e.jsxs(V,{children:[e.jsx(Me,{children:i.name}),e.jsx(_e,{"data-testid":"outfit-detail-meta",children:s("outfits.detail.itemsCount",{count:te})}),o.isError?e.jsxs(Ze,{children:[e.jsx(K,{message:s("outfits.detail.resolveError"),testId:"outfit-detail-resolve-error"}),e.jsx(w,{variant:"outline","data-testid":"outfit-detail-retry",onClick:o.retry,children:s("outfits.detail.retry")})]}):e.jsxs(e.Fragment,{children:[e.jsx(He,{children:e.jsx(Ke,{children:I.map(a=>e.jsx(qe,{"data-testid":"outfit-detail-item","data-state":a.state,children:a.item?e.jsxs(e.Fragment,{children:[e.jsx(De,{to:`/item/${a.item.contractAddress}/${a.item.itemId}`,state:{item:a.item},"aria-label":a.item.name}),e.jsx(Ue,{src:a.item.thumbnail,alt:"",loading:"lazy"}),e.jsxs(R,{children:[e.jsx(L,{children:a.item.name}),a.item.creator?e.jsx(Qe,{to:`/items/creator/${a.item.creator}`,children:e.jsx(Ie,{address:a.item.creator})}):null,e.jsxs(B,{children:[a.state!=="unavailable"?e.jsxs(Ge,{children:[e.jsx(z,{size:15}),a.item.priceCredits.toLocaleString()]}):null,a.state==="unavailable"?e.jsx(y,{children:s("outfits.card.unavailable")}):a.state==="own_listing"?e.jsx(y,{children:s("outfits.detail.yourListing")}):a.state==="in_cart"?e.jsx(y,{children:s("outfits.detail.inCart")}):null,e.jsx(lt,{item:a.item})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{className:o.isLoading?"skeleton":void 0,"aria-hidden":!0}),e.jsx(R,{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(B,{children:e.jsx(y,{children:s("outfits.card.unavailable")})})]})})]})},a.key))})}),e.jsxs(Je,{"data-testid":"outfit-detail-ctabar",children:[ie&&l.ownListing.length>0?e.jsx(Ye,{children:s("outfits.detail.yourListingHint")}):null,m.length>0&&e.jsxs(et,{children:[e.jsx(tt,{children:s("outfits.detail.totalPrice")}),o.isLoading?e.jsx("span",{className:"skeleton",style:{width:64,height:26},"aria-hidden":!0}):e.jsxs(it,{children:[e.jsx(z,{size:22}),k.toLocaleString()]})]}),o.isLoading?e.jsx("span",{className:"skeleton",style:{width:"100%",height:52,borderRadius:26},"aria-hidden":!0}):e.jsxs(at,{variant:"purple","data-testid":"outfit-detail-cta",onClick:C,disabled:p||b===0,"aria-busy":p||void 0,children:[p?s("outfits.card.adding"):b>0?s("outfits.detail.addCount",{count:b}):f>0?s("outfits.detail.nothingToAdd"):s("outfits.card.unavailable"),!p&&b>0?e.jsxs(st,{children:[e.jsx(z,{size:16}),d.toLocaleString()]}):null]})]})]})]})]})]})}export{vt as OutfitDetail,vt as default};
@@ -1,4 +1,4 @@
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-BGS9C_i9.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-BVWvbmB_.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;
@@ -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,aZ as Zt,b as e,A as ot,B as x,K as Ct,v as X,R as te,y as ee,D as It,l as Et,V as ie,$ as z,a_ as V,a$ as se,b0 as oe,b1 as J,a4 as re,a5 as ae,a2 as ne,a3 as de,S as Lt,a8 as le,b2 as rt,b3 as ue,b4 as ce,b5 as pe,F as N,b6 as Rt,b7 as zt,b8 as A,k as at,b9 as nt,ba as he,bb as fe,bc as xe,Z as me,bd as ge,be,af as ye}from"./index-BGS9C_i9.js";import{E as U}from"./ErrorNotice-DivoNxAh.js";import{L as je}from"./LoadMore-Bj3YyMIu.js";import{u as ve}from"./useInfiniteGrid-Cw-ORqbZ.js";import{O as we}from"./OutfitPreview-C0o9HFjd.js";import{T as $e}from"./skeleton.styles-BkIQo-2n.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-ByNeKxg1.js";import"./ethers-DYJhhXPV.js";import"./intl-CBcMB1D2.js";import"./disposePreview-5vjiqVZ0.js";const{colors:m,radius:Y,media:ke}=lt,Se=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,aZ as Zt,b as e,A as ot,B as x,K as Ct,v as X,R as te,y as ee,D as It,l as Et,V as ie,$ as z,a_ as V,a$ as se,b0 as oe,b1 as J,a4 as re,a5 as ae,a2 as ne,a3 as de,S as Lt,a8 as le,b2 as rt,b3 as ue,b4 as ce,b5 as pe,F as N,b6 as Rt,b7 as zt,b8 as A,h as at,b9 as nt,ba as he,bb as fe,bc as xe,Z as me,bd as ge,be,af as ye}from"./index-BVWvbmB_.js";import{E as U}from"./ErrorNotice-B_DnZnpz.js";import{L as je}from"./LoadMore-DAmGHMVW.js";import{u as ve}from"./useInfiniteGrid-CPaNhKNU.js";import{O as we}from"./OutfitPreview-DS6GhxsN.js";import{T as $e}from"./skeleton.styles-BZ8ZgFLU.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-CUdtSPei.js";import"./ethers-CHvw3dSr.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;
@@ -53,7 +53,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
53
53
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
54
54
  gap: 10px;
55
55
 
56
- ${ke.maxWidth("mobile")} {
56
+ ${Se.maxWidth("mobile")} {
57
57
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
58
58
  }
59
59
  `,Ee=s.span`
@@ -111,7 +111,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
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:S,hasNextPage:E,isFetchingNextPage:Z,fetchNextPage:k}=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(Se,{"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"})]}),S?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)})}),!S&&!I&&!u?t.jsx(je,{auto:!1,hasNextPage:!!E,isFetching:Z,onLoadMore:()=>void k()}):null]})}const{colors:a,radius:$,media:B,z:Fe}=lt,Pt=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:a,radius:$,media:B,z:Fe}=lt,Pt=s.div`
115
115
  max-width: 1200px;
116
116
  margin: 0 auto;
117
117
  display: flex;
@@ -167,7 +167,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
167
167
  background: rgba(30, 166, 114, 0.35);
168
168
  color: ${a.white};
169
169
  }
170
- `,kt=s.div`
170
+ `,St=s.div`
171
171
  display: flex;
172
172
  flex-direction: column;
173
173
  gap: 10px;
@@ -437,7 +437,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
437
437
  flex: 1;
438
438
  min-width: 0;
439
439
  }
440
- `,St=s.input`
440
+ `,kt=s.input`
441
441
  height: 44px;
442
442
  padding: 0 14px;
443
443
  border: 1px solid ${a.lineStrong};
@@ -527,7 +527,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
527
527
  gap: 4px;
528
528
  font-size: 15px;
529
529
  font-weight: 700;
530
- `,ki=s.button`
530
+ `,Si=s.button`
531
531
  display: inline-flex;
532
532
  align-items: center;
533
533
  justify-content: center;
@@ -543,7 +543,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
543
543
  color: ${a.dclRed};
544
544
  background: rgba(255, 255, 255, 0.14);
545
545
  }
546
- `,Si=s.div`
546
+ `,ki=s.div`
547
547
  display: flex;
548
548
  flex-direction: column;
549
549
  gap: 8px;
@@ -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(Me,{style:{background:ce(n)},children:t.jsx("img",{src:f,alt:"",loading:"lazy"})}):t.jsx(De,{"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,S){if(n){j(u.id);try{S==="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||at(E,{flow:`outfit-${S}`}),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(kt,{"aria-busy":"true",children:Array.from({length:3},(u,S)=>t.jsx(Be,{className:"skeleton","aria-hidden":!0},S))}):R?t.jsxs(O,{children:[t.jsx(U,{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(kt,{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(Ue,{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:rt.from,gradientTo:rt.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:S,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 k(i){R(r=>r&&{...r,...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=r=>r.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)||k({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),k({items:i.items,...i.bodyShape?{bodyShape:i.bodyShape}:{}}),N.success(e("outfits.studio.importSuccess",{count:i.items.length}))}async function Dt(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 r=URL.createObjectURL(i);L.current=r,ut(r),ct(!0);try{const p=await fe(i,c.identity);k({thumbnailHash:p})}catch(p){p instanceof A||at(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[D,xt]=d.useState(!1),[Ut,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 r=g.byKey.get(z(i));return!r||se(r)}),bt=!!o&&it&&!!o.thumbnailHash&&Kt&&gt&&o.items.length>=oe&&o.items.length<=J;async function st(i){if(!(!c||!o||D)){xt(!0),mt(null);try{const r=await Rt({...o,published:i},c.identity,f?"create":"update");if(!tt.current)return;sessionStorage.removeItem(h),R(dt(r)),I(!1),zt(y),i&&!o.published?(me("Shop Outfit Published",{outfit_id:r.id,item_count:r.items.length}),N.success(e("outfits.studio.publishedToast"))):N.success(e("outfits.studio.saved")),f&&(y.setQueryData(["outfit",r.id,!0],r),j(`/outfits/${r.id}/edit`,{replace:!0}))}catch(r){r instanceof A||at(r,{flow:"outfit-save"}),mt(e(r instanceof A?nt(r.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(()=>re(Q),[Q]),_t=d.useMemo(()=>{const i=ae(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(U,{message:e("outfits.errors.generic")}),t.jsx(x,{variant:"white",onClick:()=>void Z(),children:e("outfits.detail.retry")})]}):!S&&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,r)=>{var p;return i+(((p=g.byKey.get(z(r)))==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(ri,{type:"button","data-selected":o.bodyShape===i||void 0,onClick:()=>k({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]:rt.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:r=>k({[i]:r.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:r=>{const p=r.target.value.trim().toLowerCase();k({[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(ai,{"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 r;return void Dt((r=i.target.files)==null?void 0:r[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx(w,{children:e("outfits.studio.thumbnailHint")}),t.jsx(U,{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(St,{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(U,{message:Ht,testId:"outfit-studio-import-error"})]}),t.jsxs(P,{children:[t.jsx(W,{htmlFor:"outfit-name",children:e("outfits.studio.name")}),t.jsx(St,{id:"outfit-name",value:o.name,maxLength:60,placeholder:e("outfits.studio.namePlaceholder"),onChange:i=>k({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 r=z(i),p=g.byKey.get(r);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")}),r===_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(ki,{type:"button","aria-label":e("outfits.studio.remove"),title:e("outfits.studio.remove"),onClick:()=>k({items:o.items.filter(Vt=>z(Vt)!==r)}),children:t.jsx(K,{name:"trash",size:16})})]},r)})}),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(Si,{"data-testid":"outfit-studio-savebar",children:[t.jsx(U,{message:Ut,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:D||!it,onClick:()=>void st(o.published),children:D?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),o.published?t.jsx(x,{variant:"white","data-testid":"outfit-studio-unpublish",disabled:D,onClick:()=>void st(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"white","data-testid":"outfit-studio-publish",disabled:D||!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(De,{"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||at(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(U,{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(Ue,{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:rt.from,gradientTo:rt.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(r=>r&&{...r,...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=r=>r.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 Dt(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 r=URL.createObjectURL(i);L.current=r,ut(r),ct(!0);try{const p=await fe(i,c.identity);S({thumbnailHash:p})}catch(p){p instanceof A||at(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[D,xt]=d.useState(!1),[Ut,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 r=g.byKey.get(z(i));return!r||se(r)}),bt=!!o&&it&&!!o.thumbnailHash&&Kt&&gt&&o.items.length>=oe&&o.items.length<=J;async function st(i){if(!(!c||!o||D)){xt(!0),mt(null);try{const r=await Rt({...o,published:i},c.identity,f?"create":"update");if(!tt.current)return;sessionStorage.removeItem(h),R(dt(r)),I(!1),zt(y),i&&!o.published?(me("Shop Outfit Published",{outfit_id:r.id,item_count:r.items.length}),N.success(e("outfits.studio.publishedToast"))):N.success(e("outfits.studio.saved")),f&&(y.setQueryData(["outfit",r.id,!0],r),j(`/outfits/${r.id}/edit`,{replace:!0}))}catch(r){r instanceof A||at(r,{flow:"outfit-save"}),mt(e(r instanceof A?nt(r.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(()=>re(Q),[Q]),_t=d.useMemo(()=>{const i=ae(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(U,{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,r)=>{var p;return i+(((p=g.byKey.get(z(r)))==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(ri,{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]:rt.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:r=>S({[i]:r.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:r=>{const p=r.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(ai,{"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 r;return void Dt((r=i.target.files)==null?void 0:r[0])},"data-testid":"outfit-studio-thumb-input"})]}),t.jsx(w,{children:e("outfits.studio.thumbnailHint")}),t.jsx(U,{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(U,{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 r=z(i),p=g.byKey.get(r);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")}),r===_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)!==r)}),children:t.jsx(K,{name:"trash",size:16})})]},r)})}),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(U,{message:Ut,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:D||!it,onClick:()=>void st(o.published),children:D?e("outfits.studio.saving"):e("outfits.studio.saveDraft")}),o.published?t.jsx(x,{variant:"white","data-testid":"outfit-studio-unpublish",disabled:D,onClick:()=>void st(!1),children:e("outfits.studio.unpublish")}):t.jsx(x,{variant:"white","data-testid":"outfit-studio-publish",disabled:D||!bt,onClick:()=>void st(!0),children:e("outfits.studio.publish")})]})]})]})}export{Ki as OutfitStudio,Ki as default};