@dcl/shop 0.1.0-29819311586.commit-3ce85a5 → 0.1.0-29820201061.commit-6e93aab

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 (173) hide show
  1. package/assets/{AnimatedBackground-C6HDued7.js → AnimatedBackground-DAWtZAKT.js} +3 -3
  2. package/assets/{Assets-7uXLSoNw.js → Assets-BfwpVa8T.js} +1 -1
  3. package/assets/Cart-BMcaDkFj.js +3 -0
  4. package/assets/{Cart-C75800mc.css → Cart-BU0ex2lY.css} +1 -1
  5. package/assets/{CircularProgress-hz1p9NKk.js → CircularProgress-DbOPAlwJ.js} +1 -1
  6. package/assets/{Collection-DRmm6o7-.js → Collection-D9pgNA_k.js} +1 -1
  7. package/assets/{CollectionCarousel-FF2VKnCi.css → CollectionCarousel-BRpR9AB4.css} +1 -1
  8. package/assets/{CollectionCarousel-Do5ix6VD.js → CollectionCarousel-Bv4JmxDk.js} +1 -1
  9. package/assets/{Creator-CwCVOEmJ.js → Creator-BUh9bTpd.js} +1 -1
  10. package/assets/{CssVarsProvider-C7DqQE-t.js → CssVarsProvider-w2c1yhxv.js} +1 -1
  11. package/assets/{ExchangeController-Zq_jjUSk.js → ExchangeController-SpKxAxin.js} +1 -1
  12. package/assets/{GetCredits-C-iII2L9.js → GetCredits-N_TH5qjR.js} +1 -1
  13. package/assets/{HelpersUtil-eRiM9Nak.js → HelpersUtil-Dk0fX2VO.js} +1 -1
  14. package/assets/{ImportListings-Bgk2Mmaj.js → ImportListings-DeGUWpef.js} +1 -1
  15. package/assets/ItemDetail-oeRcJNYq.js +29 -0
  16. package/assets/{LoadMore-CS8RGFW1.js → LoadMore-CG-U1l6R.js} +1 -1
  17. package/assets/{MarketCheckout-XY4qv1OO.js → MarketCheckout-ok-4xTbs.js} +1 -1
  18. package/assets/{MyAssets-C8b7YCwJ.js → MyAssets-CvtYfSpu.js} +1 -1
  19. package/assets/{MyFavorites-BYEWRbKE.js → MyFavorites-Dd22LHHj.js} +1 -1
  20. package/assets/{MyPurchases-wqVy_Bkw.js → MyPurchases-V1RhxGky.js} +1 -1
  21. package/assets/{NotFound-D4BypoGj.js → NotFound-DiPtPjNv.js} +1 -1
  22. package/assets/{StoreSettings-D9EJPHZI.js → StoreSettings-DnT3y2OO.js} +1 -1
  23. package/assets/{Success-ZazAxkkG.js → Success-Cty_2pyi.js} +1 -1
  24. package/assets/{SwapController-BjW71vDF.js → SwapController-DaN0jm-H.js} +1 -1
  25. package/assets/{TradeService-DKtrXol_.js → TradeService-BvnZvZgd.js} +1 -1
  26. package/assets/{W3MFrameProviderSingleton-B7VYZoUb.js → W3MFrameProviderSingleton-0X-5xnm-.js} +3 -3
  27. package/assets/{WebCryptoP256-pJWLp366.js → WebCryptoP256-CTN3luLA.js} +1 -1
  28. package/assets/{basic-T4VH8T7G.js → basic-QSXc4V2D.js} +1 -1
  29. package/assets/{biconomy-PGFwwGtI.js → biconomy-CqIIitTh.js} +1 -1
  30. package/assets/{buy-CEPUtw6l.js → buy-BB1nNoHF.js} +1 -1
  31. package/assets/{buy-gasless-DFUBpeub.js → buy-gasless-Dk-vGVaA.js} +1 -1
  32. package/assets/cart-checkout-Dq_IfS2V.js +1 -0
  33. package/assets/{categories-CzHfYX4r.js → categories-B5rMzFhG.js} +1 -1
  34. package/assets/{ccip-D39Yw1id.js → ccip-CwgUOIwr.js} +1 -1
  35. package/assets/{ccip-CysEx_-e.js → ccip-DgWVV-Cq.js} +1 -1
  36. package/assets/{collection-ZVT8nPpy.js → collection-Cx_FbJvw.js} +1 -1
  37. package/assets/{controller-BjiC4vCa.js → controller-C-XHoEvy.js} +2 -2
  38. package/assets/{core-Bbl8k9ou.js → core-CfiWie_R.js} +4 -4
  39. package/assets/{custom-BjXRzXnf.js → custom-DKVEEouT.js} +1 -1
  40. package/assets/{data-capture-CPbUe_Mu.js → data-capture-DRU0RrJn.js} +1 -1
  41. package/assets/{decimals-dZROqPVx.js → decimals-ClpY8V96.js} +1 -1
  42. package/assets/{decimals-COagLS8Q.js → decimals-DonBY3ph.js} +1 -1
  43. package/assets/{detectExtension-BXF9RLPM.js → detectExtension-B_mnipYI.js} +1 -1
  44. package/assets/{email-BdCU2aT5.js → email-Du5ktVIv.js} +1 -1
  45. package/assets/{embedded-wallet-DeV-AfMB.js → embedded-wallet-D8702brY.js} +1 -1
  46. package/assets/{emotion-styled.browser.esm-DsmsDcnn.js → emotion-styled.browser.esm-D4okznSw.js} +1 -1
  47. package/assets/{engine-Dyy7i-EK.js → engine-CjhboEJw.js} +1 -1
  48. package/assets/{errors-toZUiz_8.js → errors-DLCfzexO.js} +1 -1
  49. package/assets/{estimate-l1-fee-BnAfP2IW.js → estimate-l1-fee-D65JAyU_.js} +1 -1
  50. package/assets/{eth_estimateGas-Dk2BHGEx.js → eth_estimateGas-Dx8A0rQf.js} +1 -1
  51. package/assets/{eth_getStorageAt-LWy_aLD2.js → eth_getStorageAt-Dn97nH7-.js} +1 -1
  52. package/assets/{eth_getTransactionCount-CQEhUg0n.js → eth_getTransactionCount-BsbZubbz.js} +1 -1
  53. package/assets/{extractIPFS-BjekE5Dx.js → extractIPFS-3p5_lVI2.js} +1 -1
  54. package/assets/{features-BUOntu-v.js → features-CEnnVGh1.js} +1 -1
  55. package/assets/{fetchTokenMetadata-CvhQV09t.js → fetchTokenMetadata-BBl6hFMA.js} +2 -2
  56. package/assets/{get-ecosystem-wallet-info-CHjCFyrH.js → get-ecosystem-wallet-info-DJRhUKR8.js} +1 -1
  57. package/assets/{getBalance-B9mjM7Q1.js → getBalance-BjOc81GX.js} +1 -1
  58. package/assets/{getInstalledModules-Dokr0wx4.js → getInstalledModules-B5lc4vdM.js} +1 -1
  59. package/assets/{getNFT-CBnBQM9G.js → getNFT-CL_MHRMI.js} +2 -2
  60. package/assets/{getNFT-DZMkxOcW.js → getNFT-DzSkkUED.js} +1 -1
  61. package/assets/{getOverlayAlpha-CRsCtRg_.js → getOverlayAlpha-CMi-RtY0.js} +1 -1
  62. package/assets/{hashTypedData-BSaySpON.js → hashTypedData-CtS-a__q.js} +1 -1
  63. package/assets/{hashTypedData-CrkyuxIw.js → hashTypedData-DgGGaq3_.js} +1 -1
  64. package/assets/{import-BJhskE6v.js → import-dApKnRUE.js} +1 -1
  65. package/assets/{in-app-wallet-calls-cZgP0Nkb.js → in-app-wallet-calls-DXDKPfo-.js} +1 -1
  66. package/assets/{index-GthN7FEd.js → index-1iy3MjeD.js} +1 -1
  67. package/assets/{index-0MtqGpF_.js → index-9RhtGjkQ.js} +1 -1
  68. package/assets/{index-CNuVc9dE.js → index-9TPYgQJV.js} +1 -1
  69. package/assets/{index-D4wZsAhr.js → index-AXY2OKOi.js} +1 -1
  70. package/assets/{index-DJHCemxt.js → index-B0dfVx8-.js} +1 -1
  71. package/assets/{index-DZRRiKcW.js → index-BEP5YEOP.js} +1 -1
  72. package/assets/{index-D-jlJbT0.js → index-BKHArmb8.js} +1 -1
  73. package/assets/{index-CaWVq5F1.js → index-BTrFeJpK.js} +1 -1
  74. package/assets/{index-02y48U_Y.js → index-BZrziql9.js} +1 -1
  75. package/assets/{index-Bocj8EP1.js → index-B_gop-2P.js} +2 -2
  76. package/assets/index-BbQ0ahsR.css +1 -0
  77. package/assets/{index-FilzlBF3.js → index-Bdviiw0D.js} +1 -1
  78. package/assets/{index-C6soE2Qj.js → index-BeeqvCzC.js} +1 -1
  79. package/assets/{index-g3oU79Zi.js → index-BfjvLXhz.js} +1 -1
  80. package/assets/{index-DWk32FEl.js → index-Bi5nB_Xd.js} +1 -1
  81. package/assets/{index-CVXefuAq.js → index-BtHD2PwE.js} +1 -1
  82. package/assets/{index-DL5oTXPj.js → index-BtWvPi-C.js} +3 -3
  83. package/assets/{index-CYbVfCP4.js → index-C2ou7t9Z.js} +1 -1
  84. package/assets/{index-DO5JrBgZ.js → index-CC9ohYjq.js} +1 -1
  85. package/assets/{index-Bl2L1ibn.js → index-CDOVd3Or.js} +1 -1
  86. package/assets/{index-kb4PCO3h.js → index-CF8dJQWx.js} +2 -2
  87. package/assets/{index-9ixRbsWW.js → index-COYa4blu.js} +1 -1
  88. package/assets/{index-CS10YTx8.js → index-CTL73XUb.js} +1 -1
  89. package/assets/{index-f5Ry7NJF.js → index-CXCPKgIL.js} +1 -1
  90. package/assets/{index-IcU2Nzi-.js → index-ClOq-XK_.js} +1 -1
  91. package/assets/{index-Cp_NOfvB.js → index-Cldj-HLd.js} +1 -1
  92. package/assets/{index-CBJisr2I.js → index-Ct3-b-XG.js} +1 -1
  93. package/assets/{index-CUs2Ik9f.js → index-D-0UbgZb.js} +1 -1
  94. package/assets/{index-D_TT1IA_.js → index-D-FlYCrT.js} +1 -1
  95. package/assets/{index-D2jE21o9.js → index-D2MCniIy.js} +30 -30
  96. package/assets/{index-BNszBPTr.js → index-D4haZmAC.js} +1 -1
  97. package/assets/{index-B208UX4c.js → index-D82p0tCN.js} +1 -1
  98. package/assets/{index-CbQd59c3.js → index-DAotFwIM.js} +1 -1
  99. package/assets/{index-TnwTqyFy.js → index-DFvNyoxW.js} +1 -1
  100. package/assets/{index-CdZ89joC.js → index-DNyAB5T9.js} +2 -2
  101. package/assets/{index-iTvBkd0G.js → index-DQcdNd4L.js} +1 -1
  102. package/assets/{index-DSJK_i26.js → index-DSMcEg86.js} +1 -1
  103. package/assets/{index-DS3xrgMW.js → index-DW6hvVBk.js} +1 -1
  104. package/assets/{index-DpoNV2HN.js → index-Dd1qZUR_.js} +1 -1
  105. package/assets/{index-Oi6ZR4tM.js → index-Dl878bh3.js} +3 -3
  106. package/assets/{index-kdbM7BPm.js → index-DvCxAuAV.js} +1 -1
  107. package/assets/{index-CKy8YgNe.js → index-E3u-0qkh.js} +1 -1
  108. package/assets/{index-DVNqwg2d.js → index-EpjNSbck.js} +1 -1
  109. package/assets/{index-D7oaM2vZ.js → index-F3bWVhlW.js} +1 -1
  110. package/assets/{index-B89Xjz4I.js → index-LsWSCTxf.js} +1 -1
  111. package/assets/{index-BcGrOhJR.js → index-NmO7Zc6p.js} +1 -1
  112. package/assets/{index-CiNrKxR0.js → index-Nzz-X3JR.js} +1 -1
  113. package/assets/{index-D6hOS3tx.js → index-VljTVp5r.js} +1 -1
  114. package/assets/{index-CkW3JF4B.js → index-kj576VV8.js} +1 -1
  115. package/assets/{index-DYoplOYj.js → index-m3ikjlZ9.js} +1 -1
  116. package/assets/{index-CFiqakvv.js → index-mQ3fD2pW.js} +1 -1
  117. package/assets/{index-CM_3ac_C.js → index-rIXEHCUI.js} +1 -1
  118. package/assets/{index.es-nxWF9ZiM.js → index.es-BKvDPMdj.js} +4 -4
  119. package/assets/{index.es-Ch6S2Gk2.js → index.es-D4zORoHW.js} +1 -1
  120. package/assets/{index.es-axXv0ESL.js → index.es-jAGAALqM.js} +1 -1
  121. package/assets/{localBatchGatewayRequest-Bs3nE-X-.js → localBatchGatewayRequest-DSTbEhrP.js} +1 -1
  122. package/assets/{mana-rate-VLUqXwj8.js → mana-rate-8umEj7_T.js} +1 -1
  123. package/assets/{networks-wkZMvAoy.js → networks-cttqYPBD.js} +1 -1
  124. package/assets/{onramp-SXq1C0nL.js → onramp-O3BTWx9-.js} +1 -1
  125. package/assets/{openzeppelin-DJfYdul8.js → openzeppelin-CQac0BGV.js} +1 -1
  126. package/assets/{ownerOf-Caz8dkdv.js → ownerOf-BNp_oN81.js} +1 -1
  127. package/assets/{parseNft-CAi7ylrV.js → parseNft-CaODLwGA.js} +2 -2
  128. package/assets/{parseSignature-DOZQ4r_s.js → parseSignature-BUlJFwOG.js} +3 -3
  129. package/assets/{parseSignature-CkfsQZjR.js → parseSignature-Bx6QTnH6.js} +1 -1
  130. package/assets/{pay-with-exchange-D6Jfa9dm.js → pay-with-exchange-3gqLKVFv.js} +1 -1
  131. package/assets/{payments-Bqo0NGsO.js → payments-DpS98zAJ.js} +1 -1
  132. package/assets/{qr-overlay-ThBPC7Uy.js → qr-overlay-BTYTNs3e.js} +1 -1
  133. package/assets/{receive-CNeZjKOR.js → receive-GjDfyQpR.js} +1 -1
  134. package/assets/{resolveImplementation-CDlVaAuZ.js → resolveImplementation-C6kQvPP-.js} +1 -1
  135. package/assets/{rpc-CcS3GZe6.js → rpc-DuJlT0HH.js} +1 -1
  136. package/assets/{secp256k1-BHgXbBWD.js → secp256k1-BWbqqT7z.js} +1 -1
  137. package/assets/{secp256k1-BBvPIPwC.js → secp256k1-BmaDbfrn.js} +1 -1
  138. package/assets/{secp256k1-BUjQGvG0.js → secp256k1-CPZ3QzZL.js} +1 -1
  139. package/assets/{send-idVogVYW.js → send-CO-2udGX.js} +1 -1
  140. package/assets/{send-batch-transaction-C3jcqsNl.js → send-batch-transaction-D2YAYdks.js} +1 -1
  141. package/assets/{send-eip712-transaction-Bfjz7Iz2.js → send-eip712-transaction-CcIzmXkO.js} +2 -2
  142. package/assets/{send-gasless-transaction-Dr5uJ-Wj.js → send-gasless-transaction-B_Vu9cKC.js} +2 -2
  143. package/assets/{sendRawTransaction-C1KYrfUQ.js → sendRawTransaction-zZ1gmwwW.js} +3 -3
  144. package/assets/{serializeTransaction-CvcgsI4m.js → serializeTransaction-BLhvSCIg.js} +1 -1
  145. package/assets/{session-proposal-k0vYn6DB.js → session-proposal-CMJwwypi.js} +1 -1
  146. package/assets/{session-request-BSoj00bs.js → session-request-Bnr_sX_J.js} +2 -2
  147. package/assets/{sha256-GGf28ILw.js → sha256-Cz0lQzvl.js} +1 -1
  148. package/assets/{signing-BruyzTll.js → signing-CvokIB4x.js} +4 -4
  149. package/assets/{socials-DgnpFB9X.js → socials-D4DuECHq.js} +1 -1
  150. package/assets/{swaps-D7rw8rzk.js → swaps-D_hLEEKg.js} +1 -1
  151. package/assets/{thirdweb-BrverVav.js → thirdweb-C_WUiq8w.js} +3 -3
  152. package/assets/{totalSupply-CjOtH9Yt.js → totalSupply-V6l7KoX8.js} +1 -1
  153. package/assets/{trade-encoding-BRf1PROY.js → trade-encoding-CxOU66Zo.js} +1 -1
  154. package/assets/{transactionReceipt-tGNKu9ON.js → transactionReceipt-DxcBIxbU.js} +1 -1
  155. package/assets/{transactions-Cm3JbhyS.js → transactions-CT0Iato6.js} +1 -1
  156. package/assets/{useInfiniteGrid-Bi-bhby3.js → useInfiniteGrid-_2151jJs.js} +1 -1
  157. package/assets/{useStore-B3LU4tKp.js → useStore-_juYfQlk.js} +1 -1
  158. package/assets/{useTheme-DTIK1i5i.js → useTheme-CvQWZTyO.js} +1 -1
  159. package/assets/{useTheme-Dz_KHO78.js → useTheme-hl4D5Ddl.js} +1 -1
  160. package/assets/{verifyHash-Bn5i4mdO.js → verifyHash-Ch4HpC7b.js} +1 -1
  161. package/assets/{w3m-modal-D3vDgcvO.js → w3m-modal-CqER6RMY.js} +1 -1
  162. package/assets/{w3m-modal-BCLI7fp2.js → w3m-modal-s_TWH6MQ.js} +1 -1
  163. package/assets/{wait-for-tx-receipt-C8Go00i1.js → wait-for-tx-receipt-CuxFpJ4i.js} +1 -1
  164. package/assets/{wallets-C4pAW_0w.js → wallets-Pcb-CnJi.js} +6 -6
  165. package/assets/{web-connector-BgaCPDbI.js → web-connector-D2Rc0Q2d.js} +3 -3
  166. package/assets/{writeContract-dqxuoVL6.js → writeContract-6OJ2j59X.js} +1 -1
  167. package/assets/{zoraTestnet-DWM_8Oul.js → zoraTestnet-DWGOJRav.js} +1 -1
  168. package/index.html +11 -11
  169. package/package.json +2 -2
  170. package/assets/Cart-pnGNGkP-.js +0 -3
  171. package/assets/ItemDetail-DGdTMP6D.js +0 -29
  172. package/assets/cart-checkout-CeO81KZq.js +0 -1
  173. package/assets/index-Cc7yK5VV.css +0 -1
@@ -1,11 +1,11 @@
1
- import{r as l,j as v}from"./react-yytiy0wi.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29819311586.commit-3ce85a5/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29819311586.commit-3ce85a5/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-yytiy0wi.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820201061.commit-6e93aab/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820201061.commit-6e93aab/assets/DCL_LogoPattern-BryBPc3d.png",b=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
5
5
  v_uv = a_position * 0.5 + 0.5;
6
6
  gl_Position = vec4(a_position, 0.0, 1.0);
7
7
  }
8
- `,b=`
8
+ `,U=`
9
9
  precision highp float;
10
10
 
11
11
  uniform float u_time;
@@ -77,4 +77,4 @@ void main() {
77
77
 
78
78
  gl_FragColor = result;
79
79
  }
80
- `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,U),c=g(e,e.FRAGMENT_SHADER,b);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
80
+ `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,b),c=g(e,e.FRAGMENT_SHADER,U);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
@@ -1 +1 @@
1
- import{u as oe,r as i,j as e}from"./react-yytiy0wi.js";import{u as de,a as ue,t as a,b as B,C as S,A as $,f as me}from"./index-D2jE21o9.js";import{S as G,C as pe,a as _e,R as fe,F as xe,b as Q,c as be}from"./categories-CzHfYX4r.js";import{m as he}from"./mana-rate-VLUqXwj8.js";import{u as ge,M as je}from"./MarketCheckout-XY4qv1OO.js";import{L as Ne}from"./LoadMore-CS8RGFW1.js";import{u as ye}from"./useInfiniteGrid-Bi-bhby3.js";import{E as ve}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-CEPUtw6l.js";import"./trade-encoding-BRf1PROY.js";import"./buy-gasless-DFUBpeub.js";import"./errors-toZUiz_8.js";const Ce=48,n=1e5;function Se(r){return{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei??"0",available:1,network:r.network,chainId:r.chainId,createdAt:0}}function Qe(){const[r]=oe(),l=(r.get("q")??"").trim().toLowerCase(),U=de(),I=(r.get("q")??"").trim();ue({title:I?a("seo.collectibles.searchTitle",{query:I}):a("seo.collectibles.title"),description:a("seo.collectibles.description")});const[p,F]=i.useState("wearable"),[d,k]=i.useState(null),[c,R]=i.useState([]),[x,w]=i.useState(""),[b,M]=i.useState(""),[_,K]=i.useState("newest"),[P,z]=i.useState(!1),[h,f]=i.useState(!1),[L,E]=i.useState(null);i.useEffect(()=>{if(!h)return;const s=t=>{t.key==="Escape"&&f(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[h]);const u=x&&!Number.isNaN(Number(x))?Number(x):void 0,m=b&&!Number.isNaN(Number(b))?Number(b):void 0,D=d?be[d]:void 0,J=(G.find(s=>s.key===_)??G[0]).server,q={category:p,rarities:c.length?c:void 0,wearableCategories:D,minPriceCredits:u,maxPriceCredits:m,search:l||void 0,sortBy:J},{items:g,total:O,isLoading:o,error:X,hasNextPage:Z,isFetchingNextPage:T,fetchNextPage:H}=ye(["unified-listings",q],s=>me({...q,first:Ce,skip:s})),j=O,{data:N,isError:V}=ge(),Y=s=>N&&s.manaWei?he(s.manaWei,N):null,W=i.useRef(null);i.useEffect(()=>{o||!l||W.current===l||(W.current=l,B("Shop Searched",{query:l,result_count:j}))},[l,o,j]);const y=i.useRef("__init__");i.useEffect(()=>{if(o)return;const s=JSON.stringify({category:p,subCategory:d,rarities:c,min:u,max:m,sort:_});if(y.current==="__init__"||y.current===s){y.current=s;return}y.current=s,B("Shop Applied Filter",{filters:{category:p,sub_category:d,rarities:c,min_price_credits:u??null,max_price_credits:m??null,sort:_},result_count:j})},[p,d,c,u,m,_,o,j]);function ee(s){F(s),k(null)}function se(s){R(t=>t.includes(s)?t.filter(A=>A!==s):[...t,s])}function ae(){F("wearable"),k(null),R([]),w(""),M("")}function re(s){const t=g.find(A=>A.id===s.id);t&&t.source==="legacy"&&t.manaWei&&E(Se(t))}function te(){U.invalidateQueries({queryKey:["unified-listings"]})}const v=u!=null?Math.min(u,n):0,C=m!=null?Math.min(m,n):n,ie=v/n*100,ne=C/n*100;function le(s){const t=Math.min(s,C);w(t<=0?"":String(t))}function ce(s){const t=Math.max(s,v);M(t>=n?"":String(t))}return e.jsxs("div",{className:"browse browse--sidebar","data-testid":"browse",children:[h?e.jsx("div",{className:"browse__scrim",onClick:()=>f(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${h?" is-open":""}`,"data-testid":"browse-sidebar",children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:a("assets.filters")}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>f(!1),"aria-label":a("assets.closeFilters"),children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:a("assets.category")}),e.jsx(pe,{category:p,subCategory:d,onCategory:ee,onSub:k}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:a("filter.price")}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.min")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.minPriceAria"),placeholder:"0",value:x,onChange:s=>w(s.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:a("assets.priceTo")}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.max")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.maxPriceAria"),placeholder:"0",value:b,onChange:s=>M(s.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${ie}%`,"--max-pct":`${ne}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:n,value:v,"aria-label":a("assets.minPriceSliderAria"),onChange:s=>le(Number(s.target.value))}),e.jsx("input",{type:"range",min:0,max:n,value:C,"aria-label":a("assets.maxPriceSliderAria"),onChange:s=>ce(Number(s.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),v.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),C.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","data-testid":"sidebar-section-toggle","aria-expanded":P,onClick:()=>z(s=>!s),children:[e.jsx("span",{className:"sidebar__section-label",children:a("assets.rarity")}),e.jsx(_e,{up:P,size:20,color:"var(--muted)"})]}),P?e.jsx("div",{className:"rarity-filter","data-testid":"rarity-filter",children:fe.map(s=>e.jsxs("label",{className:`rarity-filter__check${c.includes(s)?" is-on":""}`,"data-testid":"rarity-filter-check",children:[e.jsx("input",{type:"checkbox",checked:c.includes(s),onChange:()=>se(s)}),e.jsx("span",{children:s})]},s))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:ae,children:a("assets.clearFilters")}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>f(!1),children:a("assets.apply")})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(xe,{sort:_,onSort:K,total:O,loading:o,query:l,onOpenFilters:()=>f(!0)}),V&&g.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:a("assets.marketUnavailable")}):null,X?e.jsx(ve,{message:a("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:o?e.jsx(Q,{count:15}):e.jsxs(e.Fragment,{children:[g.map(s=>s.source==="legacy"?e.jsx($,{item:s,mode:"market",marketPriceCredits:Y(s),onBuyNow:re},s.id):e.jsx($,{item:s},s.id)),T?e.jsx(Q,{count:6}):null]})}),e.jsx(Ne,{hasNextPage:Z,isFetching:T,onLoadMore:()=>void H()}),!o&&g.length===0?e.jsx("p",{className:"muted",children:a("assets.noItems")}):null]}),L&&N?e.jsx(je,{listing:L,rate:N,onClose:()=>E(null),onSold:()=>{E(null),te()}}):null]})}export{Qe as Assets};
1
+ import{u as oe,r as i,j as e}from"./react-yytiy0wi.js";import{u as de,a as ue,t as a,b as B,C as S,A as $,f as me}from"./index-D2MCniIy.js";import{S as G,C as pe,a as _e,R as fe,F as xe,b as Q,c as be}from"./categories-B5rMzFhG.js";import{m as he}from"./mana-rate-8umEj7_T.js";import{u as ge,M as je}from"./MarketCheckout-ok-4xTbs.js";import{L as Ne}from"./LoadMore-CG-U1l6R.js";import{u as ye}from"./useInfiniteGrid-_2151jJs.js";import{E as ve}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-BB1nNoHF.js";import"./trade-encoding-CxOU66Zo.js";import"./buy-gasless-Dk-vGVaA.js";import"./errors-DLCfzexO.js";const Ce=48,n=1e5;function Se(r){return{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei??"0",available:1,network:r.network,chainId:r.chainId,createdAt:0}}function Qe(){const[r]=oe(),l=(r.get("q")??"").trim().toLowerCase(),U=de(),I=(r.get("q")??"").trim();ue({title:I?a("seo.collectibles.searchTitle",{query:I}):a("seo.collectibles.title"),description:a("seo.collectibles.description")});const[p,F]=i.useState("wearable"),[d,k]=i.useState(null),[c,R]=i.useState([]),[x,w]=i.useState(""),[b,M]=i.useState(""),[_,K]=i.useState("newest"),[P,z]=i.useState(!1),[h,f]=i.useState(!1),[L,E]=i.useState(null);i.useEffect(()=>{if(!h)return;const s=t=>{t.key==="Escape"&&f(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[h]);const u=x&&!Number.isNaN(Number(x))?Number(x):void 0,m=b&&!Number.isNaN(Number(b))?Number(b):void 0,D=d?be[d]:void 0,J=(G.find(s=>s.key===_)??G[0]).server,q={category:p,rarities:c.length?c:void 0,wearableCategories:D,minPriceCredits:u,maxPriceCredits:m,search:l||void 0,sortBy:J},{items:g,total:O,isLoading:o,error:X,hasNextPage:Z,isFetchingNextPage:T,fetchNextPage:H}=ye(["unified-listings",q],s=>me({...q,first:Ce,skip:s})),j=O,{data:N,isError:V}=ge(),Y=s=>N&&s.manaWei?he(s.manaWei,N):null,W=i.useRef(null);i.useEffect(()=>{o||!l||W.current===l||(W.current=l,B("Shop Searched",{query:l,result_count:j}))},[l,o,j]);const y=i.useRef("__init__");i.useEffect(()=>{if(o)return;const s=JSON.stringify({category:p,subCategory:d,rarities:c,min:u,max:m,sort:_});if(y.current==="__init__"||y.current===s){y.current=s;return}y.current=s,B("Shop Applied Filter",{filters:{category:p,sub_category:d,rarities:c,min_price_credits:u??null,max_price_credits:m??null,sort:_},result_count:j})},[p,d,c,u,m,_,o,j]);function ee(s){F(s),k(null)}function se(s){R(t=>t.includes(s)?t.filter(A=>A!==s):[...t,s])}function ae(){F("wearable"),k(null),R([]),w(""),M("")}function re(s){const t=g.find(A=>A.id===s.id);t&&t.source==="legacy"&&t.manaWei&&E(Se(t))}function te(){U.invalidateQueries({queryKey:["unified-listings"]})}const v=u!=null?Math.min(u,n):0,C=m!=null?Math.min(m,n):n,ie=v/n*100,ne=C/n*100;function le(s){const t=Math.min(s,C);w(t<=0?"":String(t))}function ce(s){const t=Math.max(s,v);M(t>=n?"":String(t))}return e.jsxs("div",{className:"browse browse--sidebar","data-testid":"browse",children:[h?e.jsx("div",{className:"browse__scrim",onClick:()=>f(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${h?" is-open":""}`,"data-testid":"browse-sidebar",children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:a("assets.filters")}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>f(!1),"aria-label":a("assets.closeFilters"),children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:a("assets.category")}),e.jsx(pe,{category:p,subCategory:d,onCategory:ee,onSub:k}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:a("filter.price")}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.min")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.minPriceAria"),placeholder:"0",value:x,onChange:s=>w(s.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:a("assets.priceTo")}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.max")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.maxPriceAria"),placeholder:"0",value:b,onChange:s=>M(s.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${ie}%`,"--max-pct":`${ne}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:n,value:v,"aria-label":a("assets.minPriceSliderAria"),onChange:s=>le(Number(s.target.value))}),e.jsx("input",{type:"range",min:0,max:n,value:C,"aria-label":a("assets.maxPriceSliderAria"),onChange:s=>ce(Number(s.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),v.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),C.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","data-testid":"sidebar-section-toggle","aria-expanded":P,onClick:()=>z(s=>!s),children:[e.jsx("span",{className:"sidebar__section-label",children:a("assets.rarity")}),e.jsx(_e,{up:P,size:20,color:"var(--muted)"})]}),P?e.jsx("div",{className:"rarity-filter","data-testid":"rarity-filter",children:fe.map(s=>e.jsxs("label",{className:`rarity-filter__check${c.includes(s)?" is-on":""}`,"data-testid":"rarity-filter-check",children:[e.jsx("input",{type:"checkbox",checked:c.includes(s),onChange:()=>se(s)}),e.jsx("span",{children:s})]},s))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:ae,children:a("assets.clearFilters")}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>f(!1),children:a("assets.apply")})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(xe,{sort:_,onSort:K,total:O,loading:o,query:l,onOpenFilters:()=>f(!0)}),V&&g.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:a("assets.marketUnavailable")}):null,X?e.jsx(ve,{message:a("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:o?e.jsx(Q,{count:15}):e.jsxs(e.Fragment,{children:[g.map(s=>s.source==="legacy"?e.jsx($,{item:s,mode:"market",marketPriceCredits:Y(s),onBuyNow:re},s.id):e.jsx($,{item:s},s.id)),T?e.jsx(Q,{count:6}):null]})}),e.jsx(Ne,{hasNextPage:Z,isFetching:T,onLoadMore:()=>void H()}),!o&&g.length===0?e.jsx("p",{className:"muted",children:a("assets.noItems")}):null]}),L&&N?e.jsx(je,{listing:L,rate:N,onClose:()=>E(null),onSold:()=>{E(null),te()}}):null]})}export{Qe as Assets};
@@ -0,0 +1,3 @@
1
+ import{j as e,a as Se,b as Ie,r as f,L as Z}from"./react-yytiy0wi.js";import{t as a,C as S,a8 as R,a as qe,a9 as N,c as ie,d as Le,g as Pe,o as Te,u as Ee,I as L,aa as Be,b as O,ab as de,ac as Fe,D as A,s as Ae,B as Re,j as We,k as Ue,w as ze,q as ue,ad as Ke,y as he,x as Qe,ae as $e}from"./index-D2MCniIy.js";import{a as me}from"./buy-BB1nNoHF.js";import{g as Oe,a as De,w as Ge,S as Je,G as Ve}from"./buy-gasless-Dk-vGVaA.js";import{R as D,r as Ye}from"./cart-checkout-Dq_IfS2V.js";import{C as He,c as Xe}from"./payments-DpS98zAJ.js";import{E as be}from"./ErrorNotice-CKeOu_Oi.js";import{i as Ze,a as es}from"./errors-DLCfzexO.js";import{C as ss}from"./CollectionCarousel-Bv4JmxDk.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CxOU66Zo.js";import"./index-HN6Rk25C.js";function as(t){const{phase:r,balanceCredits:b,onClose:l}=t,x=r==="processing",P=r!=="complete",T=r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),j=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:x?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${j?" buy-modal__card--tall":""}`,children:[P&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:T}),!x&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(S,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:R(b)})]})]}),r==="processing"&&e.jsx(ts,{step:t.step??1,total:t.total??1}),r==="nofunds"&&e.jsx(cs,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(rs,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(be,{message:t.message}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:l,children:a("buyModal.close")})})]})]})]})}function ts({step:t,total:r}){return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:a("buyModal.completingTransaction")}),e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})}),e.jsxs("span",{className:"cart-checkout__step",children:[t,"/",r]})]})]})}function cs({lines:t,shortfallCredits:r,packs:b,selectedPack:l,onSelectPack:x,onBuyPacks:P,onCancel:T}){const j=b.find(c=>c.id===l),J=t.reduce((c,g)=>c+(g.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:J})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const g=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),g>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:g})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(S,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:R(c.priceCredits*g)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:b.map(c=>{const g=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${g?" buy-modal__pack--on":""}`,onClick:()=>x(c.id),children:[e.jsx(S,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:R(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(S,{className:"buy-modal__total-ico"}),e.jsx("span",{children:R((j==null?void 0:j.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((j==null?void 0:j.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:T,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:P,children:a("buyModal.buy")})]})]})}function rs({purchased:t,onMyAssets:r,onTryInWorld:b}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(l=>{const x=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),x>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:x})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(S,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:R(l.priceCredits*x)})]})]},l.id)})})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:b,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const ns=Ae(Re)`
2
+ margin-top: 12px;
3
+ `;function _e(t){if(Ze(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const os=12e4,G=He.slice(0,3),ls=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function is(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}const ye=t=>t.reduce((r,b)=>r+b.priceCredits*b.quantity,0),ds=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function ws(){qe({title:a("nav.cart"),noindex:!0});const t=N(s=>s.items),r=N(s=>s.remove),b=N(s=>s.increment),l=N(s=>s.decrement),x=N(s=>s.clear),P=N(s=>s.restore),T=N(s=>s.setFittingOpen),j=ie(s=>s.items),J=ie(s=>s.toggle),{session:c}=Le(),g=t.some(s=>s.category!=="emote"),{data:V}=Pe({queryKey:["upsell-listings"],queryFn:()=>$e({first:40}),staleTime:6e4}),{data:E}=Te(c),W=Ee(),U=Se(),{state:I}=Ie(),[ee,B]=f.useState(null),[pe,C]=f.useState(null),[se,z]=f.useState(null),[xe,q]=f.useState(!1),[k,F]=f.useState(null),ae=f.useRef(0),[d,w]=f.useState(null),[Y,te]=f.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ke=k?k.liveTotalCredits:je,fe=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!fe.has(s.id)).slice(0,12),ge=new Map(k==null?void 0:k.buyable.map(s=>[s.item.id,s])),K=(E==null?void 0:E.credits)??0,ve=Fe;function Q(s){s(),F(null),z(null),C(null)}function Ne(){w(null),q(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-K),p=G.find(u=>u.credits>=o)??G[G.length-1];te(p.id),O("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:K,shortfall:o}),w({phase:"nofunds",lines:s.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:o}),q(!1)}async function Ce(s){if(!c||s.length===0)return;const n=ds(s),o=n.map(i=>({...i.item,priceCredits:i.priceCredits})),p=s.map(i=>({...i.item,priceCredits:i.priceCredits,quantity:i.quantity})),u=[];let v="authorize",$=!1;w({phase:"processing",step:1,total:n.length});try{const i=[];for(let h=0;h<n.length;h++){const _=n[h];w({phase:"processing",step:h+1,total:n.length});try{const{credit:y,maxCreditedValue:X}=await ze(c.identity,_.usdCents,_.trade.id);u.push(y.id),i.push({trade:_.trade,credits:[y],maxCreditedValue:X})}catch(y){if(es(y)){if(u.length){try{await ue(c.identity,u)}catch(X){A(X,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw y}}v="submit";let m=[];if(Oe())try{m=await De({purchases:i,buyer:c.address,signer:c.signer});const _=(await Promise.allSettled(m.map(y=>Ge(y)))).flatMap(y=>y.status==="rejected"?[y.reason]:[]);if(_.length&&!_.some(y=>y instanceof Je))throw _[0];$=!0}catch(h){if(!(h instanceof Ve))throw h;m=await me({purchases:i,buyer:c.address,signer:c.signer})}else m=await me({purchases:i,buyer:c.address,signer:c.signer});s.forEach(h=>r(h.item.id)),F(null),O("Shop Completed Purchase",{...Ke(o),payment_type:"credits",no_crypto_step:$,transaction_hash:m[0]??null}),W.invalidateQueries({queryKey:["usd-balance"]}),w({phase:"complete",purchased:p})}catch(i){if(he(i)||A(i,{flow:"cart_checkout",step:v,cart_size:s.length}),O(he(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Qe(i),value_usd:de(o.reduce((m,h)=>m+h.priceCredits,0)),cart_size:n.length}),u.length){try{await ue(c.identity,u)}catch(m){A(m,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}w({phase:"error",message:_e(i)})}}function oe(s){const n=ye(s);if(E!=null&&E.credits<n){ne(s);return}Ce(s)}async function H(){if(!c){C(a("buyModal.signInToCheckout"));return}const s=N.getState().items;if(s.length===0)return;C(null),z(null),q(!0);const n=s.reduce((o,p)=>o+p.priceCredits*p.quantity,0);O("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:K>=n});try{B(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),p=[...o.unavailable,...o.own];if(p.length&&(p.forEach(u=>r(u.id)),z(is(o))),o.buyable.length===0){C(a("cart.error.noneAvailable")),F(null),B(null);return}if(o.orderChanged){F(o),ae.current=Date.now(),B(null);return}B(null),oe(o.buyable)}catch(o){A(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),C(_e(o)),B(null)}finally{q(!1)}}async function we(){if(k){if(!c){C(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>os){F(null),z(null),await H();return}C(null),oe(k.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(N.getState().items))}catch{}q(!0);try{const s=await Xe(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}U("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}A(s,{flow:"cart_buy_credits"}),w({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const le=f.useRef(!1);f.useEffect(()=>{if(!(I!=null&&I.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&P(o)}}catch{}W.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void H(),0);return()=>clearTimeout(s)},[I==null?void 0:I.resumeCheckout]);const M=xe||(d==null?void 0:d.phase)==="processing";return t.length===0&&!d?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(L,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ns,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>U(-1),type:"button",children:[e.jsx(L,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("section",{className:"checkout__panel",children:[e.jsxs("div",{className:"checkout__panel-head",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(L,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),g?e.jsxs("button",{className:"checkout__fitting",onClick:()=>T(!0),disabled:M,children:[e.jsx(L,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=ge.get(s.id),o=n?n.priceCredits:s.priceCredits,p=!!n&&n.priceCredits!==s.priceCredits,u=!s.tokenId,v=s.quantity,$=typeof s.available=="number"&&v>=s.available,i=o*v,m=!!j[s.id],h=s.tokenId??s.itemId,_=s.contractAddress&&h?`/item/${s.contractAddress}/${h}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(Z,{className:"checkout__thumb-link",to:_,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(Z,{className:"checkout__name",to:_,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[u?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>l(s.id)),disabled:M||v<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:v}),e.jsx("button",{className:"checkout__step",onClick:()=>Q(()=>b(s.id)),disabled:M||$,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(S,{className:"checkout__price-ico"})," ",i,p?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*v}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${m?" is-on":""}`,onClick:()=>J(s),"aria-label":m?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:m?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(L,{name:m?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>Q(()=>r(s.id)),disabled:M,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(L,{name:"trash",size:24})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>Q(x),disabled:M,children:a("cart.clearCart")}),null]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(S,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(k?we():H()),disabled:M,children:M?a("cart.working"):k?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),k?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(be,{message:pe,className:"checkout__msg"})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:re})}):null,d?e.jsx(as,{phase:d.phase,balanceCredits:K,onClose:Ne,step:d.phase==="processing"?d.step:void 0,total:d.phase==="processing"?d.total:void 0,lines:d.phase==="nofunds"?d.lines:void 0,shortfallCredits:d.phase==="nofunds"?d.shortfall:void 0,packs:G,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:d.phase==="complete"?d.purchased:void 0,onMyAssets:()=>U("/assets?tab=mine"),onTryInWorld:()=>window.open(ls,"_blank","noopener"),message:d.phase==="error"?d.message:void 0}):null]})}export{ws as Cart};
@@ -1 +1 @@
1
- .checkout{max-width:1510px;margin:0 auto}.checkout__back{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:0;border:0;background:none;color:var(--text-2);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;cursor:pointer;transition:color .15s ease}.checkout__back:hover{color:var(--accent)}.checkout__back .ico{width:18px;height:18px}.checkout__body{display:grid;grid-template-columns:minmax(0,1fr) 600px;gap:24px;align-items:start}.checkout__panel{min-width:0;background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px}.checkout__panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.checkout__panel-back{display:none}.checkout__panel-title{margin:0;font-size:18px;font-weight:600;line-height:1.2;color:var(--text)}.checkout__fitting{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 12px;border:2px solid transparent;border-radius:8px;background:linear-gradient(#fff,#fff) padding-box,var(--amethyst) border-box;color:var(--accent);font-size:13px;font-weight:600;line-height:24px;letter-spacing:.46px;text-transform:uppercase;white-space:nowrap;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.checkout__fitting:hover:not(:disabled){box-shadow:0 0 8px #a524b359}.checkout__fitting:active:not(:disabled){filter:brightness(.97)}.checkout__fitting:disabled{opacity:.55;cursor:default}.checkout__fitting-ico{width:24px;height:24px}.checkout__list{display:flex;flex-direction:column;gap:12px}.checkout__card{position:relative;display:flex;align-items:stretch;gap:12px;background:#fff;border:1px solid #cfcdd4;border-radius:12px;overflow:hidden}.checkout__thumb{position:relative;flex-shrink:0;width:137px;height:137px;background:var(--media);border-radius:12px;display:grid;place-items:center;overflow:hidden}.checkout__thumb-link{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}.checkout__thumb img{width:83%;height:83%;object-fit:contain;filter:drop-shadow(.56px 2.25px 2.8px rgba(0,0,0,.1))}.checkout__thumb-check{position:absolute;top:7.5px;left:7.5px;width:20px;height:20px;border-radius:50%;background:#34ce77;display:grid;place-items:center}.checkout__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:16px 8px}.checkout__desc{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:64px}.checkout__name{display:block;font-size:16px;font-weight:600;line-height:1.2;color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a.checkout__name:hover{color:var(--accent)}.checkout__creator{font-size:10px;line-height:1.43;color:var(--muted)}.checkout__creator [data-avatar]{display:none}.checkout__creator [data-testid=creator-name]{font-size:10px;line-height:1.43}.checkout__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:8px}.checkout__stepper{display:inline-flex;align-items:center;gap:8px;padding:6px;border:.5px solid var(--muted-2);border-radius:50px}.checkout__step{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;background:none;color:var(--text);cursor:pointer}.checkout__step:disabled{color:var(--muted-2);cursor:default}.checkout__step svg{width:16px;height:16px}.checkout__qty{min-width:12px;font-size:14px;font-weight:500;line-height:1.2;color:var(--text);text-align:center}.checkout__price{display:inline-flex;align-items:center;gap:4px;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__price-ico{width:24px;height:24px;background:var(--accent)}.checkout__price-was{margin-left:6px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:line-through}.checkout__actions{position:absolute;top:10px;right:10px;display:flex;align-items:center;gap:12px}.checkout__fav,.checkout__remove{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer;transition:color .12s ease}.checkout__fav:hover:not(:disabled){color:var(--text)}.checkout__fav.is-on{color:var(--dcl-red)}.checkout__remove:hover:not(:disabled){color:var(--dcl-red)}.checkout__fav:disabled,.checkout__remove:disabled{opacity:.5;cursor:default}.checkout__utils{display:flex;gap:20px;margin-top:16px}.checkout__utils .link{font-size:13px;color:var(--muted);font-weight:600}.checkout__utils .link:hover:not(:disabled){color:var(--text)}.checkout__summary{position:sticky;top:172px;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px}.checkout__summary-title{margin:0 0 16px;padding-bottom:16px;border-bottom:1px solid #cfcdd4;font-size:20px;font-weight:600;color:var(--text)}.checkout__summary-body{display:flex;flex-direction:column;gap:12px}.checkout__total-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.checkout__total-label{font-size:14px;font-weight:600;color:#5e5b67}.checkout__total-value{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:700;color:var(--text)}.checkout__total-ico{width:24px;height:24px;background:var(--accent)}.checkout__cta{width:100%;height:56px;border:0;border-radius:8px;background:var(--amethyst);color:var(--soft-white);font-size:15px;font-weight:600;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;transition:background .15s ease,filter .15s ease}.checkout__cta:hover:not(:disabled){background:var(--accent)}.checkout__cta:active:not(:disabled){filter:brightness(.95)}.checkout__cta:disabled{opacity:.6;cursor:default}.checkout__msg{margin:0;font-size:13px}.cart-upsell{margin-top:8px}@media(max-width:1080px){.checkout__body{grid-template-columns:1fr}.checkout__summary{position:static}}@media(max-width:880px){.checkout{padding-bottom:188px}.checkout__back{display:none}.checkout__panel{padding:16px}.checkout__panel-head{margin-bottom:16px;gap:8px}.checkout__panel-back{display:inline-flex;align-items:center;flex-shrink:0;border:0;background:none;padding:0;color:var(--text);cursor:pointer}.checkout__panel-back .ico{width:20px;height:20px}.checkout__panel-title{flex:1;min-width:0;font-size:16px}.checkout__fitting{height:36px;padding:0 10px;font-size:12px}.checkout__fitting-ico{width:20px;height:20px}.checkout__thumb{width:120px;height:120px}.checkout__info{padding:12px 4px 12px 0}.checkout__name{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.checkout__price{font-size:20px}.checkout__price-ico{width:20px;height:20px}.checkout__summary{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:30;border:0;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px #1615181f}.checkout__summary-title{margin-bottom:12px;padding-bottom:12px}}.cart-checkout__progress-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.cart-checkout__step{font-size:16px;line-height:22px;color:var(--text-2);text-transform:capitalize;white-space:nowrap}.cart-checkout__scroll{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-y:auto;width:100%;scrollbar-width:thin;scrollbar-color:#a2a2a2 var(--media)}.cart-checkout__scroll::-webkit-scrollbar{width:8px}.cart-checkout__scroll::-webkit-scrollbar-track{background:var(--media);border-radius:10px}.cart-checkout__scroll::-webkit-scrollbar-thumb{background:#a2a2a2;border-radius:8px}.cart-checkout__done{display:flex;flex-direction:column;border:1px solid var(--muted-2);border-radius:16px;padding:24px}.cart-checkout__done-scroll{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow-y:auto}.cart-checkout__done-row{display:flex;align-items:center;gap:12px}.cart-checkout__done-row+.cart-checkout__done-row{border-top:1px solid var(--line);padding-top:12px}.cart-checkout__done-thumb{position:relative;flex-shrink:0;width:96px;height:96px;background:var(--media);border:.13px solid var(--muted-2);border-radius:8px;display:grid;place-items:center;overflow:hidden}.cart-checkout__done-thumb img{width:83%;height:83%;object-fit:contain}.cart-checkout__done-check{position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:4px;background:var(--dcl-red);display:grid;place-items:center}.cart-checkout__done-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:8px;overflow:hidden}.cart-checkout__done-name{font-size:20px;font-weight:600;line-height:1.4;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-creator{font-size:10px;line-height:1.43;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-price{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;padding-right:4px;font-size:24px;font-weight:600;color:var(--text-2)}.cart-checkout__done-price-ico{width:24px;height:24px;background:var(--accent)}.cart-checkout__done-body{display:flex;flex-direction:column;gap:12px}.cart-checkout__done-body .buy-modal__success{flex-direction:row;align-items:center;gap:24px;padding:16px 24px}.cart-checkout__done-body .buy-modal__success-text{text-align:left;font-size:18px}.cart-checkout__done-body .buy-modal__btn{min-width:0}@media(max-width:600px){.cart-checkout__done-body .buy-modal__success{flex-direction:column;gap:12px;padding:16px}.cart-checkout__done-body .buy-modal__success-text{text-align:center}.cart-checkout__done{padding:16px}.cart-checkout__done-thumb{width:72px;height:72px}.cart-checkout__done-name{font-size:16px}.cart-checkout__done-price{font-size:20px}.cart-checkout__done-price-ico{width:20px;height:20px}}
1
+ .checkout{max-width:1510px;margin:0 auto}.checkout__back{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:0;border:0;background:none;color:var(--text-2);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;cursor:pointer;transition:color .15s ease}.checkout__back:hover{color:var(--accent)}.checkout__back .ico{width:18px;height:18px}.checkout__body{display:grid;grid-template-columns:minmax(0,1fr) 600px;gap:24px;align-items:start}.checkout__panel{min-width:0;background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px}.checkout__panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.checkout__panel-back{display:none}.checkout__panel-title{margin:0;font-size:18px;font-weight:600;line-height:1.2;color:var(--text)}.checkout__fitting{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 12px;border:2px solid transparent;border-radius:8px;background:linear-gradient(#fff,#fff) padding-box,var(--amethyst) border-box;color:var(--accent);font-size:13px;font-weight:600;line-height:24px;letter-spacing:.46px;text-transform:uppercase;white-space:nowrap;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.checkout__fitting:hover:not(:disabled){box-shadow:0 0 8px #a524b359}.checkout__fitting:active:not(:disabled){filter:brightness(.97)}.checkout__fitting:disabled{opacity:.55;cursor:default}.checkout__fitting-ico{width:24px;height:24px}.checkout__list{display:flex;flex-direction:column;gap:12px}.checkout__card{position:relative;display:flex;align-items:stretch;gap:12px;background:#fff;border:1px solid #cfcdd4;border-radius:12px;overflow:hidden}.checkout__thumb{position:relative;flex-shrink:0;width:137px;height:137px;background:var(--media);border-radius:12px;display:grid;place-items:center;overflow:hidden}.checkout__thumb-link{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}.checkout__thumb img{width:83%;height:83%;object-fit:contain;filter:drop-shadow(.56px 2.25px 2.8px rgba(0,0,0,.1))}.checkout__thumb-check{position:absolute;top:7.5px;left:7.5px;width:20px;height:20px;border-radius:50%;background:#34ce77;display:grid;place-items:center}.checkout__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:16px 8px}.checkout__desc{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:64px}.checkout__name{display:block;font-size:16px;font-weight:600;line-height:1.2;color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a.checkout__name:hover{color:var(--accent)}.checkout__creator{font-size:10px;line-height:1.43;color:var(--muted)}.checkout__creator [data-avatar]{display:none}.checkout__creator [data-testid=creator-name]{font-size:10px;line-height:1.43}.checkout__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:8px}.checkout__stepper{display:inline-flex;align-items:center;gap:8px;padding:6px;border:.5px solid var(--muted-2);border-radius:50px}.checkout__step{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;background:none;color:var(--text);cursor:pointer}.checkout__step:disabled{color:var(--muted-2);cursor:default}.checkout__step svg{width:16px;height:16px}.checkout__qty{min-width:12px;font-size:14px;font-weight:500;line-height:1.2;color:var(--text);text-align:center}.checkout__price{display:inline-flex;align-items:center;gap:4px;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__price-ico{width:24px;height:24px;background:var(--accent)}.checkout__price-was{margin-left:6px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:line-through}.checkout__actions{position:absolute;top:10px;right:10px;display:flex;align-items:center;gap:12px}.checkout__fav,.checkout__remove{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer;transition:color .12s ease}.checkout__fav:hover:not(:disabled){color:var(--text)}.checkout__fav.is-on{color:var(--dcl-red)}.checkout__remove:hover:not(:disabled){color:var(--dcl-red)}.checkout__fav:disabled,.checkout__remove:disabled{opacity:.5;cursor:default}.checkout__utils{display:flex;gap:20px;margin-top:16px}.checkout__utils .link{font-size:13px;color:var(--muted);font-weight:600}.checkout__utils .link:hover:not(:disabled){color:var(--text)}.checkout__summary{position:sticky;top:172px;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px}.checkout__summary-title{margin:0 0 16px;padding-bottom:16px;border-bottom:1px solid #cfcdd4;font-size:20px;font-weight:600;color:var(--text)}.checkout__summary-body{display:flex;flex-direction:column;gap:12px}.checkout__total-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.checkout__total-label{font-size:14px;font-weight:600;color:#5e5b67}.checkout__total-value{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:700;color:var(--text)}.checkout__total-ico{width:24px;height:24px;background:var(--accent)}.checkout__cta{width:100%;height:56px;border:0;border-radius:8px;background:var(--amethyst);color:var(--soft-white);font-size:15px;font-weight:600;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;transition:background .15s ease,filter .15s ease}.checkout__cta:hover:not(:disabled){background:var(--accent)}.checkout__cta:active:not(:disabled){filter:brightness(.95)}.checkout__cta:disabled{opacity:.6;cursor:default}.checkout__msg{margin:0;font-size:13px}.cart-upsell{margin-top:8px}@media(max-width:1080px){.checkout__body{grid-template-columns:1fr}.checkout__summary{position:static}}@media(max-width:880px){.checkout{padding-bottom:188px}.checkout__back{display:none}.checkout__panel{padding:16px}.checkout__panel-head{margin-bottom:16px;gap:8px}.checkout__panel-back{display:inline-flex;align-items:center;flex-shrink:0;border:0;background:none;padding:0;color:var(--text);cursor:pointer}.checkout__panel-back .ico{width:20px;height:20px}.checkout__panel-title{flex:1;min-width:0;font-size:16px}.checkout__fitting{height:36px;padding:0 10px;font-size:12px}.checkout__fitting-ico{width:20px;height:20px}.checkout__thumb{width:120px;height:120px}.checkout__info{padding:12px 4px 12px 0}.checkout__name{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.checkout__price{font-size:20px}.checkout__price-ico{width:20px;height:20px}.checkout__summary{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:30;border:0;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px #1615181f}.checkout__summary-title{margin-bottom:12px;padding-bottom:12px}}.cart-checkout__progress-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.cart-checkout__step{font-size:16px;line-height:22px;color:var(--text-2);text-transform:capitalize;white-space:nowrap}.cart-checkout__scroll{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-y:auto;width:100%;scrollbar-width:thin;scrollbar-color:#a2a2a2 var(--media)}.cart-checkout__scroll::-webkit-scrollbar{width:8px}.cart-checkout__scroll::-webkit-scrollbar-track{background:var(--media);border-radius:10px}.cart-checkout__scroll::-webkit-scrollbar-thumb{background:#a2a2a2;border-radius:8px}.cart-checkout__done{display:flex;flex-direction:column;border:1px solid var(--muted-2);border-radius:16px;padding:24px}.cart-checkout__done-scroll{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow-y:auto}.cart-checkout__done-row{display:flex;align-items:center;gap:12px}.cart-checkout__done-row+.cart-checkout__done-row{border-top:1px solid var(--line);padding-top:12px}.cart-checkout__done-thumb{position:relative;flex-shrink:0;width:96px;height:96px;background:var(--media);border:.13px solid var(--muted-2);border-radius:8px;display:grid;place-items:center;overflow:hidden}.cart-checkout__done-thumb img{width:83%;height:83%;object-fit:contain}.cart-checkout__done-check{position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:4px;background:var(--dcl-red);display:grid;place-items:center}.cart-checkout__done-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:8px;overflow:hidden}.cart-checkout__done-name{font-size:20px;font-weight:600;line-height:1.4;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__qty-tag{margin-left:6px;font-size:12px;font-weight:600;color:var(--muted)}.cart-checkout__done-creator{font-size:10px;line-height:1.43;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-price{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;padding-right:4px;font-size:24px;font-weight:600;color:var(--text-2)}.cart-checkout__done-price-ico{width:24px;height:24px;background:var(--accent)}.cart-checkout__done-body{display:flex;flex-direction:column;gap:12px}.cart-checkout__done-body .buy-modal__success{flex-direction:row;align-items:center;gap:24px;padding:16px 24px}.cart-checkout__done-body .buy-modal__success-text{text-align:left;font-size:18px}.cart-checkout__done-body .buy-modal__btn{min-width:0}@media(max-width:600px){.cart-checkout__done-body .buy-modal__success{flex-direction:column;gap:12px;padding:16px}.cart-checkout__done-body .buy-modal__success-text{text-align:center}.cart-checkout__done{padding:16px}.cart-checkout__done-thumb{width:72px;height:72px}.cart-checkout__done-name{font-size:16px}.cart-checkout__done-price{font-size:20px}.cart-checkout__done-price-ico{width:20px;height:20px}}
@@ -1,4 +1,4 @@
1
- import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-D2jE21o9.js";import{r as K,j as v}from"./react-yytiy0wi.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
1
+ import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-D2MCniIy.js";import{r as K,j as v}from"./react-yytiy0wi.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as p,d as Q,a as Y}from"./react-yytiy0wi.js";import{af as N,s as f,ag as Z,I as J,t,j as V,D as W,g as X,a as ee,A as ae,ar as te,k as re,as as se}from"./index-D2jE21o9.js";import{E as oe}from"./ErrorNotice-CKeOu_Oi.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-ZVT8nPpy.js";import{u as de}from"./useStore-B3LU4tKp.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,d as ue,b as R,c as ge}from"./categories-CzHfYX4r.js";import{L as xe}from"./LoadMore-CS8RGFW1.js";import{u as he}from"./useInfiniteGrid-Bi-bhby3.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const be=f.section`
1
+ import{j as e,r as p,d as Q,a as Y}from"./react-yytiy0wi.js";import{af as N,s as f,ag as Z,I as J,t,j as V,D as W,g as X,a as ee,A as ae,ar as te,k as re,as as se}from"./index-D2MCniIy.js";import{E as oe}from"./ErrorNotice-CKeOu_Oi.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-Cx_FbJvw.js";import{u as de}from"./useStore-_juYfQlk.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,d as ue,b as R,c as ge}from"./categories-B5rMzFhG.js";import{L as xe}from"./LoadMore-CG-U1l6R.js";import{u as he}from"./useInfiniteGrid-_2151jJs.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const be=f.section`
2
2
  position: relative;
3
3
  border-radius: ${N.radius.card};
4
4
  overflow: hidden;
@@ -1 +1 @@
1
- .collection-carousel{margin-top:64px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:22px;font-weight:700;color:var(--text)}.collection-carousel__viewall{display:inline-flex;align-items:center;gap:4px;background:none;border:0;padding:0;color:var(--accent);font-weight:700;font-size:13px;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__viewall-ico{width:16px;height:16px;transform:rotate(-90deg)}.collection-carousel__viewport{position:relative}.collection-carousel__arrow{position:absolute;top:112px;transform:translateY(-50%);z-index:5;width:53px;height:53px;padding:0;border:0;background:transparent;cursor:pointer;filter:drop-shadow(0 2px 6px rgba(0,0,0,.18));transition:transform .15s ease,filter .15s ease,opacity .15s ease}.collection-carousel__arrow img{display:block;width:100%;height:100%}.collection-carousel__arrow--left{left:-40px}.collection-carousel__arrow--right{right:-40px}.collection-carousel__arrow--left img{transform:scaleX(-1)}.collection-carousel__arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.07)}.collection-carousel__arrow:disabled{opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}@media(max-width:900px){.collection-carousel__arrow{display:none}}.collection-carousel__track{display:flex;gap:16px;overflow-x:auto;padding:12px 10px;margin:0 -10px;scroll-snap-type:x proximity;scrollbar-width:none}.collection-carousel__track::-webkit-scrollbar{display:none}.collection-carousel__track>.card{flex:0 0 281px;scroll-snap-align:start}@media(max-width:720px){.collection-carousel__track>.card{flex:0 0 85%}}.collection-carousel__dots{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:18px}.collection-carousel__dot{width:10px;height:10px;border-radius:50%;border:0;padding:0;background:var(--line-strong);opacity:.5;cursor:pointer;transition:opacity .12s ease,background .12s ease,transform .12s ease}.collection-carousel__dot:hover{opacity:.8}.collection-carousel__dot.is-active{background:var(--accent);opacity:1;transform:scale(1.1)}
1
+ .collection-carousel{margin-top:64px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:22px;font-weight:700;color:var(--text)}.collection-carousel__viewall{display:inline-flex;align-items:center;gap:4px;background:none;border:0;padding:0;color:var(--accent);font-weight:700;font-size:13px;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__viewall-ico{width:16px;height:16px;transform:rotate(-90deg)}.collection-carousel__viewport{position:relative}.collection-carousel__arrow{position:absolute;top:112px;transform:translateY(-50%);z-index:5;width:53px;height:53px;padding:0;border:0;background:transparent;cursor:pointer;filter:drop-shadow(0 2px 6px rgba(0,0,0,.18));transition:transform .15s ease,filter .15s ease,opacity .15s ease}.collection-carousel__arrow img{display:block;width:100%;height:100%}.collection-carousel__arrow--left{left:-53px}.collection-carousel__arrow--right{right:-53px}.collection-carousel__arrow--left img{transform:scaleX(-1)}.collection-carousel__arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.07)}.collection-carousel__arrow:disabled{opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}@media(max-width:900px){.collection-carousel__arrow{display:none}}.collection-carousel__track{display:flex;gap:16px;overflow-x:auto;padding:12px 10px;margin:0 -10px;scroll-snap-type:x proximity;scrollbar-width:none}.collection-carousel__track::-webkit-scrollbar{display:none}.collection-carousel__track>.card{flex:0 0 281px;scroll-snap-align:start}@media(max-width:720px){.collection-carousel__track>.card{flex:0 0 85%}}.collection-carousel__dots{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:18px}.collection-carousel__dot{width:10px;height:10px;border-radius:50%;border:0;padding:0;background:var(--line-strong);opacity:.5;cursor:pointer;transition:opacity .12s ease,background .12s ease,transform .12s ease}.collection-carousel__dot:hover{opacity:.8}.collection-carousel__dot.is-active{background:var(--accent);opacity:1;transform:scale(1.1)}
@@ -1 +1 @@
1
- import{r as o,j as t}from"./react-yytiy0wi.js";import{t as s,I as k,E as f,A as N}from"./index-D2jE21o9.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
1
+ import{r as o,j as t}from"./react-yytiy0wi.js";import{t as s,I as k,E as f,A as N}from"./index-D2MCniIy.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
@@ -1 +1 @@
1
- import{a as K,j as e,L as re,d as se,u as te,r as N}from"./react-yytiy0wi.js";import{av as oe,aw as ce,aa as le,t as a,ax as E,B as ne,ag as D,d as ie,I,j as de,a as me,A as ue,ae as he,ay as ge,k as xe}from"./index-D2jE21o9.js";import{d as _e,g as pe,a as je,A as Ne}from"./collection-ZVT8nPpy.js";import{u as be,L as fe}from"./useStore-B3LU4tKp.js";import{s as O}from"./address-DrURAr9O.js";import{S as $,C as ve,b as w,F as Ce,d as we,c as ke}from"./categories-CzHfYX4r.js";import{L as B}from"./LoadMore-CS8RGFW1.js";import{u as R}from"./useInfiniteGrid-Bi-bhby3.js";import{E as T}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,j=r==null||o==null,{data:i}=oe(m,j),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,j=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(je({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:j,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function ze(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,j]=N.useState("wearable"),[i,p]=N.useState(null),[h,_]=N.useState([]),[d,b]=N.useState(""),[l,f]=N.useState(""),[P,z]=N.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){j(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){j("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(Ne,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{ze as Creator,ze as default};
1
+ import{a as K,j as e,L as re,d as se,u as te,r as N}from"./react-yytiy0wi.js";import{av as oe,aw as ce,aa as le,t as a,ax as E,B as ne,ag as D,d as ie,I,j as de,a as me,A as ue,ae as he,ay as ge,k as xe}from"./index-D2MCniIy.js";import{d as _e,g as pe,a as je,A as Ne}from"./collection-Cx_FbJvw.js";import{u as be,L as fe}from"./useStore-_juYfQlk.js";import{s as O}from"./address-DrURAr9O.js";import{S as $,C as ve,b as w,F as Ce,d as we,c as ke}from"./categories-B5rMzFhG.js";import{L as B}from"./LoadMore-CG-U1l6R.js";import{u as R}from"./useInfiniteGrid-_2151jJs.js";import{E as T}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,j=r==null||o==null,{data:i}=oe(m,j),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,j=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(je({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:j,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function ze(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,j]=N.useState("wearable"),[i,p]=N.useState(null),[h,_]=N.useState([]),[d,b]=N.useState(""),[l,f]=N.useState(""),[P,z]=N.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){j(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){j("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(Ne,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{ze as Creator,ze as default};
@@ -1,4 +1,4 @@
1
- import{b6 as U,b7 as Ue,M as C,b8 as qe,b9 as Ye,W as Qe,ba as Ze,aV as Je,L as R,a_ as K,aZ as Te,bb as a,bc as Xe,bd as Le,T as et,b4 as tt}from"./index-D2jE21o9.js";import{R as rt,g as ot}from"./getOverlayAlpha-CRsCtRg_.js";import{j as T,r as y}from"./react-yytiy0wi.js";import{u as nt,a as Be}from"./useTheme-DTIK1i5i.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Ze,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
1
+ import{b6 as U,b7 as Ue,M as C,b8 as qe,b9 as Ye,W as Qe,ba as Ze,aV as Je,L as R,a_ as K,aZ as Te,bb as a,bc as Xe,bd as Le,T as et,b4 as tt}from"./index-D2MCniIy.js";import{R as rt,g as ot}from"./getOverlayAlpha-CMi-RtY0.js";import{j as T,r as y}from"./react-yytiy0wi.js";import{u as nt,a as Be}from"./useTheme-CvQWZTyO.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Ze,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
2
2
  try {
3
3
  var mode = localStorage.getItem('${s}') || '${o}';
4
4
  var colorScheme = '';
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-B7VYZoUb.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Oi6ZR4tM.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-0X-5xnm-.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Dl878bh3.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1 +1 @@
1
- import{a as T,u as D,r as i,j as e}from"./react-yytiy0wi.js";import{a as V,t,d as O,u as K,b as u,k as n,D as A,x as L,C as Y,r as $}from"./index-D2jE21o9.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as q}from"./cart-checkout-CeO81KZq.js";import{p as Q,c as W,i as z,C as J}from"./payments-Bqo0NGsO.js";import{C as X}from"./CircularProgress-hz1p9NKk.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const C="https://cdn.decentraland.org/@dcl/shop/0.1.0-29819311586.commit-3ce85a5/assets/pack-chips--HnOpf5U.webp",ee="https://cdn.decentraland.org/@dcl/shop/0.1.0-29819311586.commit-3ce85a5/assets/credit-coin-CmcTCd5i.webp",se="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg%20width='61'%20height='61'%20viewBox='0%200%2061%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.5%2061C47.3447%2061%2061%2047.3447%2061%2030.5C61%2013.6553%2047.3447%200%2030.5%200C13.6553%200%200%2013.6553%200%2030.5C0%2047.3447%2013.6553%2061%2030.5%2061Z'%20fill='url(%23gc_paint0)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2001%2054.8997C17.2935%2058.7274%2023.6375%2060.9997%2030.5%2060.9997C37.3625%2060.9997%2043.7065%2058.7274%2048.8%2054.8997H12.2001Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.10013%2048.7997C7.83863%2051.1024%209.89738%2053.1612%2012.2001%2054.8997H48.8001C51.1029%2053.1612%2053.1616%2051.1024%2054.9001%2048.7997H6.10013Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2042.6998H2.5468C3.4923%2044.8805%204.69705%2046.924%206.10005%2048.7997H40.9311V42.6998H40.9158Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6094%2019.8247V42.6997H40.6719L21.6094%2019.8247Z'%20fill='url(%23gc_paint1)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.5468%2042.6997H21.6093V19.8248L2.5468%2042.6997Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2032.025V48.8H54.9L40.9158%2032.025Z'%20fill='url(%23gc_paint2)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9467%2048.8H40.9157V32.025L26.9467%2048.8Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2027.4497C45.127%2027.4497%2048.5408%2024.0359%2048.5408%2019.8247C48.5408%2015.6136%2045.127%2012.1998%2040.9158%2012.1998C36.7046%2012.1998%2033.2908%2015.6136%2033.2908%2019.8247C33.2908%2024.0359%2036.7046%2027.4497%2040.9158%2027.4497Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6092%2015.2497C23.7148%2015.2497%2025.4217%2013.5428%2025.4217%2011.4372C25.4217%209.33166%2023.7148%207.62475%2021.6092%207.62475C19.5036%207.62475%2017.7967%209.33166%2017.7967%2011.4372C17.7967%2013.5428%2019.5036%2015.2497%2021.6092%2015.2497Z'%20fill='%23FFC95B'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='gc_paint0'%20x1='30.5'%20y1='-12.6335'%20x2='-12.6335'%20y2='30.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint1'%20x1='21.6029'%20y1='19.8247'%20x2='21.6029'%20y2='42.6997'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint2'%20x1='40.9111'%20y1='32.025'%20x2='40.9111'%20y2='48.8'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",_=z()?"mock":"stripe",re={pack_5:C,pack_10:C,pack_25:C,pack_50:C},ce="https://docs.decentraland.org";function I(l){const s=l;if((s==null?void 0:s.name)==="AbortError")return t("getCredits.errorCanceled");const p=((s==null?void 0:s.message)??"").toLowerCase();return p.includes("sign in")?t("getCredits.errorSignIn",{currency:n.name}):p.includes("timed out")?t("getCredits.errorTimeout",{currency:n.name}):t("getCredits.errorGeneric")}function _e(){V({title:t("nav.getCredits",{currency:n.name}),noindex:!0});const l=T(),{session:s,signIn:p}=O(),f=K(),[v,S]=D(),[g,d]=i.useState("select"),[a,w]=i.useState(null),[F,E]=i.useState(null),[P,m]=i.useState(null),[H,j]=i.useState(!1),N=i.useRef(null);i.useEffect(()=>()=>{var r;return(r=N.current)==null?void 0:r.abort()},[]);const B=i.useCallback(()=>{S(r=>{const c=new URLSearchParams(r);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[S]),y=i.useCallback(async r=>{d("processing");const c=new AbortController;N.current=c;try{const o=await Q(r,{signal:c.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(o.status==="credited"){const x=o.creditsGranted??(a==null?void 0:a.credits)??0;E(x>0?x:null),d("success"),u("Shop Completed Buy Credits",{order_id:r,pack_usd:(a==null?void 0:a.usd)??null,credits:x>0?x:null,provider:_}),f.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(q)){l("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const R=sessionStorage.getItem(G);if(R){sessionStorage.removeItem(G);const h=JSON.parse(R),M=h.tokenId??h.itemId;if(h.contractAddress&&M){l(`/item/${h.contractAddress}/${M}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else o.status==="pending"?(u("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),f.invalidateQueries({queryKey:["usd-balance"]}),d("pending")):(u("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),m(o.error??t("getCredits.errorGrant",{currency:n.name})),d("error"))}catch(o){A(o,{flow:"get_credits",step:"grant",order_id:r}),u("Shop Buy Credits Failed",{step:"grant",error_code:L(o),pack_usd:(a==null?void 0:a.usd)??null}),m(I(o)),d("error")}},[a,s,f,l]),U=i.useCallback(async r=>{if(!s){p();return}m(null),j(!1),w(r),d(_==="mock"?"processing":"redirecting"),u("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:_});try{const c=await W(r.id,{address:s.address,identity:s.identity});if(c.mock)y(c.orderId);else if(c.url)u("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){A(c,{flow:"get_credits",step:"checkout",provider:_}),u("Shop Buy Credits Failed",{step:"checkout",error_code:L(c),pack_usd:r.usd}),m(I(c)),d("error")}},[s,p,y]),k=i.useRef(!1);i.useEffect(()=>{if(k.current)return;const r=v.get("order");if(v.get("canceled")!=null){k.current=!0,u("Shop Buy Credits Cancelled",{order_id:r,provider:_}),B(),j(!0),d("select");return}r&&(d("processing"),s&&(k.current=!0,B(),y(r)))},[v,s]);function b(){var r;(r=N.current)==null||r.abort(),d("select"),w(null),E(null),m(null),j(!1)}const Z=g==="select";return e.jsxs("div",{className:"getcredits",children:[Z&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:t("getCredits.title",{currency:n.name})}),e.jsxs("p",{className:"getcredits__sub",children:[t("getCredits.subtitle",{currency:n.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ce,target:"_blank",rel:"noreferrer",children:[t("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),g==="select"&&e.jsxs(e.Fragment,{children:[H&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:t("getCredits.canceledNote")}),e.jsx(ae,{onSelect:r=>void U(r)})]}),g==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(X,{size:32}),e.jsx("p",{className:"muted",children:t("getCredits.redirecting")})]}),g==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:te,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:t("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),g==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:se,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:t("getCredits.successTitle")})," ",t("getCredits.successBody",{currency:n.name})]})]}),F!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:ee,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(Y,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:t("getCredits.creditsAmount",{credits:F,currency:n.name})})," ",e.jsx("span",{className:"gc-credits__added",children:t("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:b,children:t("getCredits.buyMore",{currency:n.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:t("getCredits.startShopping")})]})]}),g==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.pendingTitle",{currency:n.name})}),e.jsx("p",{className:"muted",children:t("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:t("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:b,children:t("getCredits.done")})]})]}),g==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:P}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:b,children:t("getCredits.tryAgain")})})]})]})}function ae({onSelect:l}){return e.jsx("div",{className:"packs",children:J.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>l(s),"aria-label":t("getCredits.packAria",{amount:$(s.credits),usd:s.usd}),children:[s.bestValue&&e.jsx("span",{className:"pack__badge",children:t("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:t("getCredits.creditsAmount",{credits:s.credits,currency:n.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:re[s.id]??C,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",s.usd.toFixed(2)]})})]})]},s.id))})}export{_e as GetCredits,_e as default};
1
+ import{a as T,u as D,r as i,j as e}from"./react-yytiy0wi.js";import{a as V,t,d as O,u as K,b as u,k as n,D as A,x as L,C as Y,r as $}from"./index-D2MCniIy.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as q}from"./cart-checkout-Dq_IfS2V.js";import{p as Q,c as W,i as z,C as J}from"./payments-DpS98zAJ.js";import{C as X}from"./CircularProgress-DbOPAlwJ.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const C="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820201061.commit-6e93aab/assets/pack-chips--HnOpf5U.webp",ee="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820201061.commit-6e93aab/assets/credit-coin-CmcTCd5i.webp",se="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg%20width='61'%20height='61'%20viewBox='0%200%2061%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.5%2061C47.3447%2061%2061%2047.3447%2061%2030.5C61%2013.6553%2047.3447%200%2030.5%200C13.6553%200%200%2013.6553%200%2030.5C0%2047.3447%2013.6553%2061%2030.5%2061Z'%20fill='url(%23gc_paint0)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2001%2054.8997C17.2935%2058.7274%2023.6375%2060.9997%2030.5%2060.9997C37.3625%2060.9997%2043.7065%2058.7274%2048.8%2054.8997H12.2001Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.10013%2048.7997C7.83863%2051.1024%209.89738%2053.1612%2012.2001%2054.8997H48.8001C51.1029%2053.1612%2053.1616%2051.1024%2054.9001%2048.7997H6.10013Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2042.6998H2.5468C3.4923%2044.8805%204.69705%2046.924%206.10005%2048.7997H40.9311V42.6998H40.9158Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6094%2019.8247V42.6997H40.6719L21.6094%2019.8247Z'%20fill='url(%23gc_paint1)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.5468%2042.6997H21.6093V19.8248L2.5468%2042.6997Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2032.025V48.8H54.9L40.9158%2032.025Z'%20fill='url(%23gc_paint2)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9467%2048.8H40.9157V32.025L26.9467%2048.8Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2027.4497C45.127%2027.4497%2048.5408%2024.0359%2048.5408%2019.8247C48.5408%2015.6136%2045.127%2012.1998%2040.9158%2012.1998C36.7046%2012.1998%2033.2908%2015.6136%2033.2908%2019.8247C33.2908%2024.0359%2036.7046%2027.4497%2040.9158%2027.4497Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6092%2015.2497C23.7148%2015.2497%2025.4217%2013.5428%2025.4217%2011.4372C25.4217%209.33166%2023.7148%207.62475%2021.6092%207.62475C19.5036%207.62475%2017.7967%209.33166%2017.7967%2011.4372C17.7967%2013.5428%2019.5036%2015.2497%2021.6092%2015.2497Z'%20fill='%23FFC95B'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='gc_paint0'%20x1='30.5'%20y1='-12.6335'%20x2='-12.6335'%20y2='30.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint1'%20x1='21.6029'%20y1='19.8247'%20x2='21.6029'%20y2='42.6997'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint2'%20x1='40.9111'%20y1='32.025'%20x2='40.9111'%20y2='48.8'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",_=z()?"mock":"stripe",re={pack_5:C,pack_10:C,pack_25:C,pack_50:C},ce="https://docs.decentraland.org";function I(l){const s=l;if((s==null?void 0:s.name)==="AbortError")return t("getCredits.errorCanceled");const p=((s==null?void 0:s.message)??"").toLowerCase();return p.includes("sign in")?t("getCredits.errorSignIn",{currency:n.name}):p.includes("timed out")?t("getCredits.errorTimeout",{currency:n.name}):t("getCredits.errorGeneric")}function _e(){V({title:t("nav.getCredits",{currency:n.name}),noindex:!0});const l=T(),{session:s,signIn:p}=O(),f=K(),[v,S]=D(),[g,d]=i.useState("select"),[a,w]=i.useState(null),[F,E]=i.useState(null),[P,m]=i.useState(null),[H,j]=i.useState(!1),N=i.useRef(null);i.useEffect(()=>()=>{var r;return(r=N.current)==null?void 0:r.abort()},[]);const B=i.useCallback(()=>{S(r=>{const c=new URLSearchParams(r);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[S]),y=i.useCallback(async r=>{d("processing");const c=new AbortController;N.current=c;try{const o=await Q(r,{signal:c.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(o.status==="credited"){const x=o.creditsGranted??(a==null?void 0:a.credits)??0;E(x>0?x:null),d("success"),u("Shop Completed Buy Credits",{order_id:r,pack_usd:(a==null?void 0:a.usd)??null,credits:x>0?x:null,provider:_}),f.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(q)){l("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const R=sessionStorage.getItem(G);if(R){sessionStorage.removeItem(G);const h=JSON.parse(R),M=h.tokenId??h.itemId;if(h.contractAddress&&M){l(`/item/${h.contractAddress}/${M}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else o.status==="pending"?(u("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),f.invalidateQueries({queryKey:["usd-balance"]}),d("pending")):(u("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),m(o.error??t("getCredits.errorGrant",{currency:n.name})),d("error"))}catch(o){A(o,{flow:"get_credits",step:"grant",order_id:r}),u("Shop Buy Credits Failed",{step:"grant",error_code:L(o),pack_usd:(a==null?void 0:a.usd)??null}),m(I(o)),d("error")}},[a,s,f,l]),U=i.useCallback(async r=>{if(!s){p();return}m(null),j(!1),w(r),d(_==="mock"?"processing":"redirecting"),u("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:_});try{const c=await W(r.id,{address:s.address,identity:s.identity});if(c.mock)y(c.orderId);else if(c.url)u("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){A(c,{flow:"get_credits",step:"checkout",provider:_}),u("Shop Buy Credits Failed",{step:"checkout",error_code:L(c),pack_usd:r.usd}),m(I(c)),d("error")}},[s,p,y]),b=i.useRef(!1);i.useEffect(()=>{if(b.current)return;const r=v.get("order");if(v.get("canceled")!=null){b.current=!0,u("Shop Buy Credits Cancelled",{order_id:r,provider:_}),B(),j(!0),d("select");return}r&&(d("processing"),s&&(b.current=!0,B(),y(r)))},[v,s]);function k(){var r;(r=N.current)==null||r.abort(),d("select"),w(null),E(null),m(null),j(!1)}const Z=g==="select";return e.jsxs("div",{className:"getcredits",children:[Z&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:t("getCredits.title",{currency:n.name})}),e.jsxs("p",{className:"getcredits__sub",children:[t("getCredits.subtitle",{currency:n.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ce,target:"_blank",rel:"noreferrer",children:[t("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),g==="select"&&e.jsxs(e.Fragment,{children:[H&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:t("getCredits.canceledNote")}),e.jsx(ae,{onSelect:r=>void U(r)})]}),g==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(X,{size:32}),e.jsx("p",{className:"muted",children:t("getCredits.redirecting")})]}),g==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:te,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:t("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),g==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:se,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:t("getCredits.successTitle")})," ",t("getCredits.successBody",{currency:n.name})]})]}),F!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:ee,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(Y,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:t("getCredits.creditsAmount",{credits:F,currency:n.name})})," ",e.jsx("span",{className:"gc-credits__added",children:t("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:k,children:t("getCredits.buyMore",{currency:n.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:t("getCredits.startShopping")})]})]}),g==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.pendingTitle",{currency:n.name})}),e.jsx("p",{className:"muted",children:t("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>l("/assets"),children:t("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:k,children:t("getCredits.done")})]})]}),g==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:P}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:k,children:t("getCredits.tryAgain")})})]})]})}function ae({onSelect:l}){return e.jsx("div",{className:"packs",children:J.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>l(s),"aria-label":t("getCredits.packAria",{amount:$(s.credits),usd:s.usd}),children:[s.bestValue&&e.jsx("span",{className:"pack__badge",children:t("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:t("getCredits.creditsAmount",{credits:s.credits,currency:n.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:re[s.id]??C,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",s.usd.toFixed(2)]})})]})]},s.id))})}export{_e as GetCredits,_e as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CM_3ac_C.js";import{d as g,r as v}from"./index-Oi6ZR4tM.js";import{C as c}from"./ConstantsUtil-BbIzv5xN.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-B7VYZoUb.js";import{au as y}from"./NetworkUtil-CLSFaUe_.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-rIXEHCUI.js";import{d as g,r as v}from"./index-Dl878bh3.js";import{C as c}from"./ConstantsUtil-BbIzv5xN.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-0X-5xnm-.js";import{au as y}from"./NetworkUtil-CLSFaUe_.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{a as K,r as u,j as e,L as B}from"./react-yytiy0wi.js";import{t as s,k as w,B as k,C as L,b as $,D as A,a as P,d as U,u as W,g as O,s as Q,a7 as z}from"./index-D2jE21o9.js";import{i as D,R as Y,f as G}from"./import-BJhskE6v.js";import{s as H}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./buy-CEPUtw6l.js";import"./trade-encoding-BRf1PROY.js";import"./index-HN6Rk25C.js";import"./mana-rate-VLUqXwj8.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,M]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await D(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof Y)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||M("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
1
+ import{a as K,r as u,j as e,L as B}from"./react-yytiy0wi.js";import{t as s,k as w,B as k,C as L,b as $,D as A,a as P,d as U,u as W,g as O,s as Q,a7 as z}from"./index-D2MCniIy.js";import{i as D,R as Y,f as G}from"./import-dApKnRUE.js";import{s as H}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./buy-BB1nNoHF.js";import"./trade-encoding-CxOU66Zo.js";import"./index-HN6Rk25C.js";import"./mana-rate-8umEj7_T.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,M]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await D(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof Y)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||M("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
2
2
  margin-top: 10px;
3
3
  `,V=Q(k)`
4
4
  padding: 13px 24px;
@@ -0,0 +1,29 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-m3ikjlZ9.js","assets/react-yytiy0wi.js","assets/dcl-schemas-BICTSpB5.js","assets/index-D2MCniIy.js","assets/sentry-BPJvc5GU.js","assets/ethers-w2AslR0v.js","assets/intl-CBcMB1D2.js","assets/index-BbQ0ahsR.css","assets/emotion-styled.browser.esm-D4okznSw.js","assets/useTheme-CvQWZTyO.js","assets/CircularProgress-DbOPAlwJ.js","assets/index-DFvNyoxW.js","assets/useTheme-hl4D5Ddl.js","assets/CssVarsProvider-w2c1yhxv.js","assets/getOverlayAlpha-CMi-RtY0.js","assets/index-DQcdNd4L.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
2
+ import{a as re,r as m,j as e,d as $e,b as qe,L as Ve}from"./react-yytiy0wi.js";import{d as le,o as We,u as ze,t as s,ac as Oe,l as Ke,m as Ue,w as Qe,q as X,b as K,x as xe,y as te,ad as Ge,D as ye,C as A,a8 as ee,_ as ie,ag as He,aj as Ye,ai as Je,az as Ze,am as Xe,j as Ae,aA as ea,af as Me,s as de,aB as aa,aC as sa,aD as ta,aE as ia,a9 as ve,c as je,g as O,aF as ra,aG as la,aH as da,aI as na,aJ as ca,ao as oa,a as ma,I as q,aK as ua,aL as _a,aM as ha,aa as pa,aN as fe,aO as ba,B as Se,ar as xa,aP as ya,aQ as va,as as ja,aR as fa}from"./index-D2MCniIy.js";import{d as W}from"./dcl-schemas-BICTSpB5.js";import{b as ge}from"./buy-BB1nNoHF.js";import{g as ga,b as Na,w as wa,S as Ca,G as ka}from"./buy-gasless-Dk-vGVaA.js";import{C as Ia,c as Aa}from"./payments-DpS98zAJ.js";import{R as Ne}from"./resume-buy-Bf0zIH7y.js";import{a as Ma,f as we}from"./errors-DLCfzexO.js";import{E as Sa}from"./ErrorNotice-CKeOu_Oi.js";import{C as Pa}from"./CircularProgress-DbOPAlwJ.js";import{u as Ea,M as Fa}from"./MarketCheckout-ok-4xTbs.js";import{s as La}from"./address-DrURAr9O.js";import{C as Da}from"./CollectionCarousel-Bv4JmxDk.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CxOU66Zo.js";import"./index-HN6Rk25C.js";import"./mana-rate-8umEj7_T.js";const V=Ia.slice(0,3);function Ta({item:r,onClose:c,resume:t=!1}){var k,H;const{session:o}=le(),{data:d}=We(o),p=ze(),y=re(),[u,l]=m.useState("loading"),[v,a]=m.useState(null),[j,S]=m.useState(""),[f,L]=m.useState(r.priceCredits),[w,N]=m.useState(null),g=m.useRef(null),z=(w==null?void 0:w.credits)??f,C=(d==null?void 0:d.credits)??0;m.useEffect(()=>{let n=!1;if(!o){l("error"),a(s("buyModal.signInToCheckout"));return}const x=_=>{const h=_-((d==null?void 0:d.credits)??0),b=V.find(I=>I.credits>=h)??V[V.length-1];S(b.id),K("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,h)}),l("nofunds")};return(async()=>{var _,h;try{const b=await Oe(r);if(!b)throw new Error("not for sale");if(Ke(b,o.address))throw new Error("You can't buy your own listing.");const I=Ue((h=(_=b.received)==null?void 0:_[0])==null?void 0:h.amount);if(!Number.isFinite(I)||I<=0)throw new Error("price unavailable");const R=Math.ceil(I/10);if(n)return;if(L(R),d!=null&&d.credits<R){x(R);return}try{const{credit:P,maxCreditedValue:D,usdCents:$}=await Qe(o.identity,I,b.id);if(n){X(o.identity,[P.id]).catch(()=>{});return}g.current=P.id;const T=Math.ceil($/10);L(T);const Y={trade:b,credit:P,maxCreditedValue:D,usdCents:$,credits:T};N(Y),t?U(Y):l("ready")}catch(P){if(n)return;if(Ma(P)){x(R);return}throw P}}catch(b){if(n)return;K(te(b)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:xe(b)}),l("error"),a(we(b,s("buyModal.error.generic"),{sale:!0}))}})(),()=>{n=!0,g.current&&o&&(X(o.identity,[g.current]).catch(()=>{}),g.current=null)}},[]);async function U(n=w){if(!o||!n)return;l("processing"),a(null);let x=!1;try{const _={trade:n.trade,buyer:o.address,signer:o.signer,credits:[n.credit],maxCreditedValue:n.maxCreditedValue};let h;if(ga())try{h=await Na(_),await wa(h),x=!0}catch(b){if(b instanceof Ca)x=!0;else if(b instanceof ka)h=await ge(_);else throw b}else h=await ge(_);g.current=null,K("Shop Completed Purchase",{...Ge([r]),payment_type:"credits",no_crypto_step:x,transaction_hash:h??null}),p.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){te(_)||ye(_,{flow:"buy",step:"submit",gasless:x}),X(o.identity,[n.credit.id]).catch(()=>{}),g.current=null,K(te(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:xe(_)}),p.invalidateQueries({queryKey:["usd-balance"]}),a(we(_,s("buyModal.error.generic"),{sale:!0})),l("error")}}async function Q(){if(!(!j||!o)){try{sessionStorage.setItem(Ne,JSON.stringify(r))}catch{}w&&X(o.identity,[w.credit.id]).catch(()=>{}),g.current=null,l("loading");try{const n=await Aa(j,{address:o.address,identity:o.identity});if(n.url){window.location.href=n.url;return}y("/credits")}catch(n){ye(n,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ne)}catch{}a(s("buyModal.error.creditsCheckout")),l("error")}}}const G=u==="processing",B=u==="complete"?s("buyModal.titleComplete"):u==="nofunds"?s("buyModal.titleNoFunds"):s("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":s("buyModal.dialogAria",{name:r.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:G?void 0:c,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${u==="processing"||u==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:B}),!G&&e.jsx("button",{className:"buy-modal__x",onClick:c,"aria-label":s("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:u==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(A,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ee(C)})]})]}),u==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(Pa,{size:44})}),u==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Sa,{message:v}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:c,children:s("buyModal.close")})})]}),u==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,z-C)})})," ",s("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(Ce,{item:r,priceCredits:z}),e.jsx("div",{className:"buy-modal__packs",children:V.map(n=>{const x=n.credits,_=n.id===j;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>S(n.id),children:[e.jsx(A,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ee(x)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(A,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ee(((k=V.find(n=>n.id===j))==null?void 0:k.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((H=V.find(n=>n.id===j))==null?void 0:H.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:c,children:s("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void Q(),children:s("buyModal.buy")})]})]}),u==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ce,{item:r,priceCredits:z}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void U(),children:s("buyModal.buy")})})]}),u==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:t?s("buyModal.completingPurchase"):s("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),u==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:s("getCredits.successTitle")})," ",s("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>y("/assets?tab=mine"),children:s("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:c,children:[s("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function Ce({item:r,priceCredits:c}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:r.name,children:r.name||s("buyModal.itemFallback")}),r.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:s("search.byCreator",{name:r.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(A,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ee(c)})]})]})]})}const Ba=m.lazy(async()=>{const[{EmoteControls:r},{Experimental_CssVarsProvider:c},{light:t}]=await Promise.all([ie(()=>import("./index-m3ikjlZ9.js").then(o=>o.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ie(()=>import("./index-DFvNyoxW.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ie(()=>import("./index-DQcdNd4L.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:o=>e.jsx(c,{theme:t,children:e.jsx(r,{...o})})}});function Ra(r){return e.jsx(m.Suspense,{fallback:null,children:e.jsx(Ba,{...r})})}function $a({item:r}){const c=le(N=>{var g;return(g=N.session)==null?void 0:g.address}),{data:t,isLoading:o}=He(c),d=c&&t?c:"default",p=r.category==="emote",[y,u]=m.useState("item"),l=!p&&y==="item",v=l||!o,[a,j]=m.useState(!0);m.useEffect(()=>{j(!0)},[r.id,l]);const S=!!c&&!!t,f=S&&Ye(r,Je(t)),L=Ze(r)[0],w=S&&!f&&!p;return e.jsxs(e.Fragment,{children:[v?e.jsx(Xe,{id:"shop-item-preview",contractAddress:r.contractAddress,tokenId:r.tokenId??void 0,itemId:r.tokenId?void 0:r.itemId??void 0,profile:l?void 0:f?d:"default",bodyShape:l||f?void 0:L,type:p?void 0:l?W.PreviewType.WEARABLE:W.PreviewType.AVATAR,emote:p||l?void 0:W.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:p?1.5:void 0,wheelStart:p?100:void 0,dev:Ae.chainId===80002,onLoad:()=>j(!1)}):null,!v||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,w&&!l?e.jsx("p",{className:"item-preview__note",children:s("itemPreview.shownOnBody",{shape:ea(L)})}):null,p?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(Ra,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":s("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:y==="avatar"?"is-active":"","aria-pressed":y==="avatar","aria-label":s("itemPreview.onAvatar"),onClick:()=>u("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:y==="item"?"is-active":"","aria-pressed":y==="item","aria-label":s("itemPreview.item"),onClick:()=>u("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.item")})]})]})]})}const qa=de(aa)`
3
+ display: flex;
4
+ flex-direction: column;
5
+ overflow: hidden;
6
+ gap: 1px;
7
+ background: ${Me.colors.lineStrong};
8
+ `;function Va({contractAddress:r,name:c,items:t,className:o}){const d=re();if(!r||!c)return null;const p=(t??[]).map(l=>l.thumbnail).filter(l=>!!l).slice(0,4),y=p.slice(0,2),u=p.slice(2,4);return e.jsxs(sa,{as:"button","data-link":!0,className:o,"data-testid":"creator",onClick:l=>{l.stopPropagation(),d(`/collection/${r}`)},children:[p.length>0?e.jsxs(qa,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${u.length===0?" collection-collage__row--full":""}`,children:y.map((l,v)=>e.jsx("img",{src:l,alt:""},v))}),u.length>0?e.jsx("span",{className:"collection-collage__row",children:u.map((l,v)=>e.jsx("img",{src:l,alt:""},v))}):null]}):null,e.jsx(ta,{"data-testid":"creator-name",children:ia(c)})]})}const Wa=de(Se)`
9
+ margin-top: 6px;
10
+ `,ke=de(Se)`
11
+ && {
12
+ width: 100%;
13
+ height: 48px;
14
+ font-size: 15px;
15
+ font-weight: 600;
16
+ letter-spacing: 0.46px;
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ gap: 8px;
21
+ }
22
+
23
+ ${Me.media.down("lg")} {
24
+ .item-detail__ctas--dual && {
25
+ flex: 1 1 auto;
26
+ width: auto;
27
+ }
28
+ }
29
+ `;function za(r){return Object.values(W.Rarity).includes(r)}function Oa(r){return r==="male"?s("itemDetail.genderMale"):r==="female"?s("itemDetail.genderFemale"):r==="unisex"?s("itemDetail.genderUnisex"):null}function Ie(r){return r.wearableCategory?r.wearableCategory.replace(/_/g," "):r.category==="emote"?s("itemDetail.categoryEmote"):s("itemDetail.categoryWearable")}function ms(){var pe;const{contractAddress:r,tokenId:c}=$e(),{state:t}=qe(),o=re(),d=!!(t!=null&&t.market),p=(t==null?void 0:t.marketPriceCredits)??null,y=ve(i=>i.add),u=ve(i=>i.items),l=je(i=>i.toggle),{session:v}=le(),[a,j]=m.useState(()=>t!=null&&t.item?{...t.item,tradeId:t.tradeId??t.item.tradeId}:{id:`${r}-${c}`,name:"",creator:"",contractAddress:r??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:Ae.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:c??void 0,tradeId:t==null?void 0:t.tradeId}),[S,f]=m.useState(!1),[L,w]=m.useState(!!(t!=null&&t.resumeBuy));m.useEffect(()=>{t!=null&&t.resumeBuy&&f(!0)},[t==null?void 0:t.resumeBuy]);const{data:N=[],isFetched:g}=O({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>xa(a.contractAddress,{first:20}).then(i=>i.items)}),z=a.available==null&&!a.tokenId,{data:C,isLoading:U}=O({queryKey:["shop-item",a.contractAddress,c],enabled:!d&&!!a.contractAddress&&!!c&&(!(t!=null&&t.item)||z),queryFn:()=>ya(a.contractAddress,c)});m.useEffect(()=>{C&&j(i=>i.tradeId?i.available!=null&&i.wearableCategory?i:{...i,available:i.available??C.available,wearableCategory:i.wearableCategory??C.wearableCategory}:{...C})},[C]);const[Q,G]=m.useState(!1),{data:B=""}=O({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>va(a.contractAddress,a.itemId)}),{data:k}=O({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>ja(a.contractAddress)});m.useEffect(()=>{if(a.name||C||N.length===0)return;const i=c&&N.find(M=>M.tokenId===c||M.itemId===c)||N.find(M=>M.contractAddress===a.contractAddress);i&&j(M=>({...i,tradeId:M.tradeId??i.tradeId}))},[N,C]);const H=m.useMemo(()=>{const i=new Set,M=[];for(const F of N){if(F.id===a.id||a.itemId&&F.itemId===a.itemId||a.tokenId&&F.tokenId===a.tokenId)continue;const be=`${F.contractAddress}-${F.itemId??F.tokenId??F.id}`;i.has(be)||(i.add(be),M.push(F))}return M},[N,a.id,a.itemId,a.tokenId]),{data:n,isLoading:x}=O({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const i=await fa(a.contractAddress,a.itemId);return(i==null?void 0:i.id)??null}return null}}),_=a.tradeId??n??void 0,h=!!_,{data:b}=Ea(d),I=m.useMemo(()=>{if(!d||!(t!=null&&t.item))return null;const i=t.item;return i.manaWei?{tradeId:i.tradeId??i.id,listingType:"primary",contractAddress:i.contractAddress,itemId:i.itemId??"",name:i.name,thumbnail:i.thumbnail,rarity:i.rarity,category:i.category,wearableCategory:i.wearableCategory??null,creator:i.creator,manaWei:i.manaWei,available:1,network:i.network,chainId:i.chainId,createdAt:0}:null},[d,t==null?void 0:t.item]),R=d&&p!=null&&!!b&&!!I,P=ra({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),D=m.useMemo(()=>({...a,tradeId:_,id:_??a.id}),[a,_]),$=u.some(i=>i.id===D.id),T=!D.tokenId,Y=((pe=u.find(i=>i.id===D.id))==null?void 0:pe.quantity)??0,ae=T&&typeof a.available=="number"&&Y>=a.available,E=je(i=>!!i.items[a.id]),ne=m.useRef(null);m.useEffect(()=>{!a.name||x||ne.current===a.id||(ne.current=a.id,K("Shop Viewed Item",{...la(a),for_sale:h}),da(a))},[a.id,a.name,x,h]);const J=`${r}/${c}`,ce=m.useRef(J);m.useEffect(()=>{ce.current!==J&&(ce.current=J,t!=null&&t.item&&j({...t.item,tradeId:t.tradeId??t.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[J]);function Pe(){!h||Z||x||!T&&$||ae||y(D,"item_detail")}const se=za(a.rarity)?a.rarity:W.Rarity.COMMON,oe=Oa(a.gender),me=na(a),ue=ca(a.gender),Ee=h&&P,Fe=s("itemDetail.moreFromCollection"),Z=oa(a,v==null?void 0:v.address),_e=h?x?s("itemDetail.checking"):ae?s("itemDetail.maxInCart"):!T&&$?s("assetCard.inCart"):s("assetCard.addToCart"):s("itemDetail.notForSale"),Le=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!d,De=!Z&&h&&!d,Te=d||!Z,Be=U||!!a.contractAddress&&!g,he=!a.name&&!Be,Re=/^https?:\/\//i.test(a.thumbnail);return ma(he?{title:s("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:B||s("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ie(a),creator:La(a.creator)}),image:Re?a.thumbnail:void 0,type:"product"}:{}),he?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(q,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:s("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:s("itemDetail.notAvailableBody")}),e.jsx(Wa,{variant:"purple",onClick:()=>o("/assets"),children:s("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":s("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>o("/assets"),children:s("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||s("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx($a,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${E?" is-on":""}`,onClick:()=>l(a),"aria-pressed":E,"aria-label":E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(q,{name:E?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${E?" is-on":""}`,onClick:()=>l(a),"aria-pressed":E,"aria-label":E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(q,{name:E?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:ha(se),color:_a(se)},title:ua(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[me?e.jsx(q,{name:me,size:18,color:"var(--text-2)"}):null,Ie(a)]}),oe?e.jsxs("span",{className:"chip item-detail__chip",children:[ue?e.jsx(q,{name:ue,size:18,color:"var(--text-2)"}):null,oe]}):null]}),B?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${Q?" is-expanded":""}`,children:B}),B.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>G(i=>!i),children:Q?s("itemDetail.showLess"):s("itemDetail.readMore")}):null]}):null,a.creator||k!=null&&k.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.creator")}),e.jsx(pa,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,k!=null&&k.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.collection")}),e.jsx(Va,{contractAddress:a.contractAddress,name:k.name,items:N,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.price")}),d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:p==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(A,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:p})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:s("assetCard.marketPrice")})]}):h?Ee?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(A,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(A,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),fe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:s("assetCard.saleWithDiscount",{pct:fe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(ba,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(A,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:s("itemDetail.notForSale")})]}),Le?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",W.Rarity.getMaxSupply(se).toLocaleString()]})]}):null]})}),e.jsx("div",{className:`item-detail__ctas${Te?" item-detail__ctas--buttons":""}${De?" item-detail__ctas--dual":""}`,children:d?e.jsxs(ke,{variant:"purple",onClick:()=>f(!0),disabled:!R,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),p!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(A,{className:"item-detail__cta-diamond"}),p]}):null]}):Z?e.jsxs("p",{className:"item-detail__own-note muted",children:[s("itemDetail.ownItemPrefix")," ",e.jsx(Ve,{to:"/my-assets",children:s("nav.myAssets")}),s("itemDetail.ownItemSuffix")]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(ke,{variant:"purple",onClick:()=>f(!0),disabled:x,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(A,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Pe,disabled:!h||x||(T?ae:$),"aria-label":_e,children:[e.jsx(q,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:_e})]})]})})]}):e.jsx(Ka,{})})]}),e.jsx(Da,{title:Fe,items:H,onViewAll:a.contractAddress?()=>o(`/collection/${a.contractAddress}`):void 0}),S&&d&&I&&b?e.jsx(Fa,{listing:I,rate:b,onClose:()=>f(!1),onSold:()=>f(!1)}):S&&!d?e.jsx(Ta,{item:D,resume:L,onClose:()=>{f(!1),w(!1)}}):null]})}function Ka(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{ms as ItemDetail,ms as default};
@@ -1,4 +1,4 @@
1
- import{r as l,j as c}from"./react-yytiy0wi.js";import{s as u,B as p,t as d}from"./index-D2jE21o9.js";const a=u.div`
1
+ import{r as l,j as c}from"./react-yytiy0wi.js";import{s as u,B as p,t as d}from"./index-D2MCniIy.js";const a=u.div`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  padding: 28px 0 8px;