@dcl/shop 0.8.1-31011914733.commit-0303b0f → 0.9.0

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/{Activity-DGqf6vtH.js → Activity-ChFWLt2k.js} +9 -9
  2. package/_assets/{AnimatedBackground-DYvwYlNX.js → AnimatedBackground-CgqvFCZP.js} +1 -1
  3. package/_assets/{Assets-BIhyhEpJ.js → Assets-Bhh3K7eo.js} +21 -21
  4. package/_assets/{Assets.styles-BEwmRTV4.js → Assets.styles-DwvAA7Fx.js} +15 -15
  5. package/_assets/{Authorizations-CgtzIHfa.js → Authorizations-BYvz0lRD.js} +1 -1
  6. package/_assets/{Cart-k3bkiglX.js → Cart-DAXjBdJW.js} +2 -2
  7. package/_assets/{CircularProgress-B7QTjxqg.js → CircularProgress-DWAcbKVy.js} +1 -1
  8. package/_assets/{Collection-CIBOTqpS.js → Collection-DhzN8qEX.js} +2 -2
  9. package/_assets/{CollectionCarousel-aBELR_tf.js → CollectionCarousel-DoFMOPnJ.js} +21 -21
  10. package/_assets/{Creator-DXbJoM5n.js → Creator-ffFVB812.js} +6 -6
  11. package/_assets/{ErrorNotice-8bHn1hfP.js → ErrorNotice-CD3QThL8.js} +1 -1
  12. package/_assets/{ExchangeController-BV3dQlup.js → ExchangeController-8WzQHcYP.js} +1 -1
  13. package/_assets/{Faq-DNu30-Jv.js → Faq-Bxgy5XAq.js} +1 -1
  14. package/_assets/{GetCredits-9vsaKO2k.js → GetCredits-BikyjTuD.js} +11 -11
  15. package/_assets/{Grow-OxzXVVhg.js → Grow-B_PKoaeX.js} +1 -1
  16. package/_assets/{HelpersUtil-NjrztWi6.js → HelpersUtil-TiNOVD81.js} +1 -1
  17. package/_assets/{ItemDetail-tYnpUH4x.js → ItemDetail-Cz_1bxfd.js} +1 -1
  18. package/_assets/LazyEmoteControls-YqpacGjJ.js +2 -0
  19. package/_assets/{LoadMore-CwQ5CTJq.js → LoadMore-D3-F6XWb.js} +1 -1
  20. package/_assets/{ManaPricingBanner.styles-Bc06axQv.js → ManaPricingBanner.styles-BBwxQBv1.js} +3 -3
  21. package/_assets/{MyAssets-B0Mjtokt.js → MyAssets-sQM2Pl5T.js} +1 -1
  22. package/_assets/{MyFavorites-Cw_mmcDj.js → MyFavorites-CTeRjr79.js} +1 -1
  23. package/_assets/{NotFound-An1qy2HJ.js → NotFound-BPPWf_VH.js} +1 -1
  24. package/_assets/{NotificationsBell-DQLaaXFc.js → NotificationsBell-B3llSjmx.js} +1 -1
  25. package/_assets/{OutfitDetail-BsbdpKHB.js → OutfitDetail-CIf5JfoP.js} +1 -1
  26. package/_assets/{OutfitPreview-zqj27b-1.js → OutfitPreview-Dsyy7b3g.js} +1 -1
  27. package/_assets/{OutfitStudio-BF3ZInz5.js → OutfitStudio-DP0te92W.js} +1 -1
  28. package/_assets/{StoreSettings-Dsw9PcCY.js → StoreSettings-CC7mEGPS.js} +1 -1
  29. package/_assets/{Success-DzSr1ZKs.js → Success-DlelWtIG.js} +1 -1
  30. package/_assets/{SwapController-c0ZMV7-y.js → SwapController-B5KKcuAl.js} +1 -1
  31. package/_assets/{Tooltip-AFYoHds5.js → Tooltip-BE30N5-7.js} +1 -1
  32. package/_assets/{TradeService-K7nSBrHI.js → TradeService-BoB_gVPn.js} +1 -1
  33. package/_assets/{W3MFrameProviderSingleton-BvhBpuKR.js → W3MFrameProviderSingleton-DIMdAQZt.js} +3 -3
  34. package/_assets/{WebCryptoP256-uR3swvrR.js → WebCryptoP256-LtmPnNr1.js} +1 -1
  35. package/_assets/{authorizations-D4wI085M.js → authorizations-D50ifPOO.js} +1 -1
  36. package/_assets/{basic-BPisXakk.js → basic-DW06A0op.js} +1 -1
  37. package/_assets/{biconomy-CvHs_GN7.js → biconomy-B6nO3Zkg.js} +1 -1
  38. package/_assets/{builder-CkJrDc5k.js → builder-Bo-EM0RQ.js} +1 -1
  39. package/_assets/{buy-BeDHfPC-.js → buy-P_iceS6H.js} +1 -1
  40. package/_assets/{buy-gasless-DINFD15F.js → buy-gasless-CJuE25uZ.js} +1 -1
  41. package/_assets/{categories-kKk2jGpz.js → categories-Dp28MR0O.js} +1 -1
  42. package/_assets/{ccip-Umb7T-xD.js → ccip-Bc6U1KND.js} +1 -1
  43. package/_assets/{ccip-74NajMIb.js → ccip-BwaWeiLm.js} +1 -1
  44. package/_assets/{collectionPage.styles-tZrmrhPT.js → collectionPage.styles-CmHnGfxY.js} +2 -2
  45. package/_assets/{controller-DGdZ6Mn-.js → controller-CWm3gowZ.js} +2 -2
  46. package/_assets/{core-CNlDVTsP.js → core-BWhmsygd.js} +4 -4
  47. package/_assets/{createSvgIcon-Ce14xVZm.js → createSvgIcon-b1stkBYH.js} +1 -1
  48. package/_assets/{custom-Dv8Lo1kL.js → custom-DRBIOTbP.js} +1 -1
  49. package/_assets/{data-capture-5ClKTSe8.js → data-capture-CT-lqFOV.js} +1 -1
  50. package/_assets/{email-CiIvohkt.js → email-CR6obY4d.js} +1 -1
  51. package/_assets/{embedded-wallet-Cv54Jked.js → embedded-wallet-DVRatI7f.js} +1 -1
  52. package/_assets/{emotion-styled.browser.esm-BDjD0BzD.js → emotion-styled.browser.esm-B6pcOIbM.js} +1 -1
  53. package/_assets/{engine-BSj9q-aH.js → engine-CE3TrAwc.js} +1 -1
  54. package/_assets/{errors-COaDYYX2.js → errors-CUmo51Xe.js} +1 -1
  55. package/_assets/{estimate-l1-fee-6I-Z51za.js → estimate-l1-fee-BHbXIM2m.js} +1 -1
  56. package/_assets/{execute-B6hfBxSa.js → execute-CrlI-ZoX.js} +2 -2
  57. package/_assets/{features-BJpZyJij.js → features-DHFgAFMQ.js} +1 -1
  58. package/_assets/{fetchTokenMetadata-ARrwD89L.js → fetchTokenMetadata-B1AQEAsF.js} +2 -2
  59. package/_assets/{field.styles-BjYlzCrg.js → field.styles-CHc5xfgz.js} +1 -1
  60. package/_assets/{get-ecosystem-wallet-info-9HmWzdfL.js → get-ecosystem-wallet-info-DfHFnl32.js} +1 -1
  61. package/_assets/{getBalance-32RCC6W6.js → getBalance-BnbAmEdr.js} +1 -1
  62. package/_assets/{getNFT-Bdzdl0tm.js → getNFT-0CpAOl-E.js} +1 -1
  63. package/_assets/{getNFT-Bvh35NBt.js → getNFT-D2PaeZsW.js} +1 -1
  64. package/_assets/{grid.styles-C5FdGoZt.js → grid.styles-CrucuXuJ.js} +1 -1
  65. package/_assets/{hashTypedData-C1J-Yu5X.js → hashTypedData-B8k-gScw.js} +1 -1
  66. package/_assets/{hashTypedData-Cd2jo0fu.js → hashTypedData-BCvEU0S5.js} +1 -1
  67. package/_assets/{in-app-B12bHXEw.js → in-app-CcIH4HM6.js} +1 -1
  68. package/_assets/{in-app-wallet-calls-C6NnLiF5.js → in-app-wallet-calls-CnOcHJ01.js} +1 -1
  69. package/_assets/{index-CVHBMZma.js → index--VgcQeCR.js} +63 -63
  70. package/_assets/{index-D1hB2lFW.js → index-3M42GOPZ.js} +1 -1
  71. package/_assets/{index-s_bfhZ6F.js → index-6vhSQR2z.js} +1 -1
  72. package/_assets/{index-D2_T8MLY.js → index-8B-Wb5Gs.js} +1 -1
  73. package/_assets/{index-BFBo1N5P.js → index-B7wTH-DB.js} +1 -1
  74. package/_assets/{index--Ye27Vx_.js → index-B8PhacFo.js} +1 -1
  75. package/_assets/{index-Fivnn7mf.js → index-B8vVRjFK.js} +1 -1
  76. package/_assets/{index-CpJZJukx.js → index-BCuH5vDs.js} +2 -2
  77. package/_assets/{index-BngbLeyt.js → index-BFOZ3aLa.js} +2 -2
  78. package/_assets/{index-CxfuGaDv.js → index-BI4j8w-k.js} +1 -1
  79. package/_assets/{index-BHNHvbUP.js → index-BWcbRKsN.js} +1 -1
  80. package/_assets/{index-dixEk7jd.js → index-BWnP3oRT.js} +1 -1
  81. package/_assets/{index-CMpfBNnD.js → index-BX10o-2b.js} +1 -1
  82. package/_assets/{index-Do3GSrTN.js → index-B_tbfHPr.js} +3 -3
  83. package/_assets/{index-DpSVgnb5.js → index-Bge5LXXj.js} +1 -1
  84. package/_assets/{index-DM4ZKIDP.js → index-C05a-Cz3.js} +1 -1
  85. package/_assets/{index-DIELA4su.js → index-C3ey0KMz.js} +1 -1
  86. package/_assets/{index-0XvBS5zv.js → index-C49WimIh.js} +1 -1
  87. package/_assets/{index-BQE4xPAY.js → index-C8Wp6BQ6.js} +1 -1
  88. package/_assets/{index-B0AXM_VY.js → index-CBH551Gx.js} +1 -1
  89. package/_assets/{index-C3FbBJ0B.js → index-CONd_BVx.js} +1 -1
  90. package/_assets/{index-CsM5PUdn.js → index-CTub7-Ub.js} +2 -2
  91. package/_assets/{index-CN92MtoS.js → index-CUwEs_3M.js} +1 -1
  92. package/_assets/{index-B984MHyM.js → index-CXSMynFH.js} +1 -1
  93. package/_assets/index-CaGVgZr4.js +3390 -0
  94. package/_assets/{index-CWqCDmmG.js → index-CcANwB8y.js} +1 -1
  95. package/_assets/{index-B01yzeQ8.js → index-Cxo1Qt__.js} +1 -1
  96. package/_assets/{index-Dyrrv-jJ.js → index-D-zwysSB.js} +1 -1
  97. package/_assets/{index-DX4C1Af8.js → index-D1rVnf7n.js} +1 -1
  98. package/_assets/{index-KoOOqA3z.js → index-D4jb9JvP.js} +1 -1
  99. package/_assets/{index-CK9g-jse.js → index-DACSd1Ih.js} +1 -1
  100. package/_assets/{index-C4hDSOGl.js → index-DU5Y-mU3.js} +1 -1
  101. package/_assets/{index-DygpMJS7.js → index-DWGvhYgt.js} +3 -3
  102. package/_assets/{index-Bl9A4aCY.js → index-DWpkVsfu.js} +1 -1
  103. package/_assets/{index-Bbo2skmn.js → index-DXpDmLZT.js} +1 -1
  104. package/_assets/{index-CC-AzsUH.js → index-DXvaEQEd.js} +1 -1
  105. package/_assets/{index-Cx6dOZTN.js → index-DcoiEdkj.js} +3 -3
  106. package/_assets/{index-CJlYjYNZ.js → index-DhS5vBsK.js} +1 -1
  107. package/_assets/{index-BRh_MAtG.js → index-Dr_tDOG_.js} +1 -1
  108. package/_assets/{index-xl5neHLR.js → index-GIH-0f2z.js} +1 -1
  109. package/_assets/{index-Y8dCmAYo.js → index-N9ZM65Qw.js} +1 -1
  110. package/_assets/{index-CEmq93Ky.js → index-RLkC6q3l.js} +1 -1
  111. package/_assets/{index-BrlzlDYY.js → index-V3x8m1-s.js} +1 -1
  112. package/_assets/{index-BXgz5CqZ.js → index-YNiHVcjG.js} +1 -1
  113. package/_assets/{index-aXb_PvXT.js → index-YSlX9Bkm.js} +1 -1
  114. package/_assets/{index-f74S-M7s.js → index-dIsHoFgJ.js} +1 -1
  115. package/_assets/{index-D4N_qlW4.js → index-oJ0V0naw.js} +1 -1
  116. package/_assets/{index-B9aOPYnq.js → index-qJ1SpPme.js} +2 -2
  117. package/_assets/{index-srBAWpfF.js → index-qLM4Jgop.js} +1 -1
  118. package/_assets/{index-9Q-G51o6.js → index-wOCAFvTe.js} +1 -1
  119. package/_assets/{index-CO7GzJir.js → index-xwkEolrS.js} +1 -1
  120. package/_assets/{index-BhKN5EIF.js → index-yM8zB6af.js} +1 -1
  121. package/_assets/{index.es-B_wTHOdN.js → index.es-B28PvdoO.js} +1 -1
  122. package/_assets/{index.es-sJaJm3UW.js → index.es-DQCMyrCJ.js} +1 -1
  123. package/_assets/{index.es-BzqwSDFf.js → index.es-S9JJTmrE.js} +4 -4
  124. package/_assets/{localBatchGatewayRequest-Ca5n5qCv.js → localBatchGatewayRequest-Pb3BP9CQ.js} +1 -1
  125. package/_assets/{networks-iVGk0JJM.js → networks-BmSU0xcf.js} +1 -1
  126. package/_assets/{onramp-C4kGKm8k.js → onramp-DfnXxsOV.js} +1 -1
  127. package/_assets/{openzeppelin-Cq0U5Yj-.js → openzeppelin-oZ__TBbl.js} +1 -1
  128. package/_assets/{parseNft-DxFyV4vL.js → parseNft-BPR5bkzt.js} +2 -2
  129. package/_assets/{parseSignature-CGjLk_wy.js → parseSignature-C2f1qwgR.js} +3 -3
  130. package/_assets/{parseSignature-COtTJutO.js → parseSignature-Eoge2CGI.js} +1 -1
  131. package/_assets/{passkeys-DaKZKc5X.js → passkeys-BF0IbJwr.js} +1 -1
  132. package/_assets/{pay-with-exchange-C9uv-ieY.js → pay-with-exchange-DOwnXfO2.js} +1 -1
  133. package/_assets/{qr-overlay-CQQySlBn.js → qr-overlay-nSSLmPST.js} +1 -1
  134. package/_assets/{receive-BBhp5SjJ.js → receive-sixNVM8i.js} +1 -1
  135. package/_assets/{resolveImplementation-BhoUOPQQ.js → resolveImplementation-DkMJJDI-.js} +1 -1
  136. package/_assets/{rpc-DTh3KIva.js → rpc-BrCTz5Qm.js} +1 -1
  137. package/_assets/{secp256k1-DbjmQrSL.js → secp256k1-BdUoxiXs.js} +1 -1
  138. package/_assets/{secp256k1-D3oKlH7Y.js → secp256k1-C16_XTC1.js} +1 -1
  139. package/_assets/{secp256k1-DDJ2_Bsx.js → secp256k1-CR7oQoP9.js} +1 -1
  140. package/_assets/{send-B38BS5L-.js → send-CtHTa-Zr.js} +1 -1
  141. package/_assets/{send-batch-transaction-CKNSzTrU.js → send-batch-transaction-Cs3B1O70.js} +1 -1
  142. package/_assets/{send-eip712-transaction-CQkqFshV.js → send-eip712-transaction-DIkXnwtQ.js} +2 -2
  143. package/_assets/{send-gasless-transaction-0E-pHV_D.js → send-gasless-transaction-Cse8VKrG.js} +2 -2
  144. package/_assets/{send-transaction-DUvtCNaC.js → send-transaction-BvF4P9KI.js} +2 -2
  145. package/_assets/{sendMetaTransaction-BUU2XPaW.js → sendMetaTransaction-DkiH6liR.js} +1 -1
  146. package/_assets/{sendRawTransaction-DSl2j5Tv.js → sendRawTransaction-C-jKwFfH.js} +3 -3
  147. package/_assets/{serializeTransaction-GOaI2-vB.js → serializeTransaction-BuSbsw2P.js} +1 -1
  148. package/_assets/{session-proposal-B31UMpQa.js → session-proposal-kYbIH83K.js} +1 -1
  149. package/_assets/{session-request-CXbKG_CB.js → session-request-BI_hmJVZ.js} +2 -2
  150. package/_assets/{signing-Bzt09eMi.js → signing-C3dpYGa5.js} +3 -3
  151. package/_assets/{socials-CNNRzT2N.js → socials-BOiLEX6l.js} +1 -1
  152. package/_assets/{styled-f0hxr1BX.js → styled-DINE9MQ0.js} +1 -1
  153. package/_assets/{swaps-Dm6opnzM.js → swaps-CECeDvBd.js} +1 -1
  154. package/_assets/{thirdweb-BsryIfzq.js → thirdweb-D2iyq9jE.js} +3 -3
  155. package/_assets/{to-serializable-transaction-CspH4HXW.js → to-serializable-transaction-DwQmyJRI.js} +2 -2
  156. package/_assets/{transactionReceipt-LkdfOGrW.js → transactionReceipt-B0Yyuulc.js} +1 -1
  157. package/_assets/{transactions-CHt9afcL.js → transactions-CVa0yXiE.js} +1 -1
  158. package/_assets/{useCreditPacks-DW-oKsgc.js → useCreditPacks-j0KzNBHB.js} +1 -1
  159. package/_assets/{useImportable-4rP-UQqs.js → useImportable-DZHzdDAY.js} +1 -1
  160. package/_assets/{useInfiniteGrid-Cjl-Omaq.js → useInfiniteGrid-DguU-cIJ.js} +1 -1
  161. package/_assets/{useTheme-Dh6eiJOj.js → useTheme-Cs4_ikeG.js} +1 -1
  162. package/_assets/{verifyHash--XBApVq4.js → verifyHash-BQDUL2qR.js} +1 -1
  163. package/_assets/{w3m-modal-dINBeQa2.js → w3m-modal-75q9wyXn.js} +1 -1
  164. package/_assets/{w3m-modal-cc9RBS7W.js → w3m-modal-CdAFLwAH.js} +1 -1
  165. package/_assets/{wait-for-tx-receipt-CW92WmOA.js → wait-for-tx-receipt-BcAkEAve.js} +1 -1
  166. package/_assets/{wallets-DgijLpqw.js → wallets-CA-bESDl.js} +5 -5
  167. package/_assets/{web-connector-C3GRXbj_.js → web-connector-CkPmzzva.js} +3 -3
  168. package/_assets/{writeContract-B4uhDk93.js → writeContract-CK1yAi7p.js} +1 -1
  169. package/_assets/{zoraTestnet-CXJJv6qS.js → zoraTestnet-aF35aj2M.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/_assets/LazyEmoteControls-BW-FF_VV.js +0 -2
  173. package/_assets/index-V7aSbkHg.js +0 -3390
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,e as Zt,d as ea}from"./react-OEOSdkUk.js";import{t as le,s as i,b as a,aD as de,b9 as ta,aC as aa,I as H,z as St,ah as Ke,x as sa,S as Q,aj as ot,o as na,q as ia,v as ra,ba as oa,A as ca,bb as da,ak as la,bc as ua,bd as ct,be as ha,bf as pa,y as ga,bg as dt,V as G,bh as lt,bi as xa,F as ae,r as ma,c as ut,bj as fa,C as ya,bk as ht,bl as Be,bm as ba,bn as fe,bo as ye,bp as pt,g as be,f as va,h as Re,bq as wa}from"./index-V7aSbkHg.js";import{M as Ca,S as ja,C as ka,H as Sa,a as $a,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as $t,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Da,y as Ya,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-aBELR_tf.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-D4wI085M.js";import{g as fs,j as We}from"./buy-BeDHfPC-.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-DINFD15F.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-DW-oKsgc.js";import{i as Ss,a as $s}from"./errors-COaDYYX2.js";import{E as Ms}from"./ErrorNotice-8bHn1hfP.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BUU2XPaW.js";const{colors:se,radius:Ts}=le,Is=i.div`
1
+ import{j as e,L as Se,r as P,e as Zt,d as ea}from"./react-OEOSdkUk.js";import{t as le,s as i,b as a,aD as de,ba as ta,aC as aa,I as H,z as St,ah as Ke,x as sa,S as Q,aj as ot,o as na,q as ia,v as ra,bb as oa,A as ca,bc as da,ak as la,bd as ua,be as ct,bf as ha,bg as pa,y as ga,bh as dt,V as G,bi as lt,bj as xa,F as ae,r as ma,c as ut,bk as fa,C as ya,bl as ht,bm as Be,bn as ba,bo as fe,bp as ye,bq as pt,g as be,f as va,h as Re,br as wa}from"./index-CaGVgZr4.js";import{M as Ca,S as ja,C as ka,H as Sa,a as $a,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as $t,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Da,y as Ya,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-DoFMOPnJ.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-D50ifPOO.js";import{g as fs,j as We}from"./buy-P_iceS6H.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-CJuE25uZ.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-j0KzNBHB.js";import{i as Ss,a as $s}from"./errors-CUmo51Xe.js";import{E as Ms}from"./ErrorNotice-CD3QThL8.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DkiH6liR.js";const{colors:se,radius:Ts}=le,Is=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -58,7 +58,7 @@ import{j as e,L as Se,r as P,e as Zt,d as ea}from"./react-OEOSdkUk.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,qs="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":Y||void 0,children:[e.jsxs(Sa,{children:[e.jsxs($a,{children:[e.jsx(Ma,{children:D}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx($t,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),D?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Da,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ya,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
61
+ `,qs="https://cdn.decentraland.org/@dcl/shop/0.9.0/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":Y||void 0,children:[e.jsxs(Sa,{children:[e.jsxs($a,{children:[e.jsx(Ma,{children:D}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx($t,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),D?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Da,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ya,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
62
62
  max-width: 1510px;
63
63
  margin: 0 auto;
64
64
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -1,4 +1,4 @@
1
- import{ad as N,ae as w,af as o,ag as n,ah as D,w as M}from"./index-V7aSbkHg.js";import{r as U,j as g}from"./react-OEOSdkUk.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-f0hxr1BX.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
1
+ import{ad as N,ae as w,af as o,ag as n,ah as D,w as M}from"./index-CaGVgZr4.js";import{r as U,j as g}from"./react-OEOSdkUk.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-DINE9MQ0.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=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 h,a as J,e as X}from"./react-OEOSdkUk.js";import{t as b,s,br as ee,Y as te,D as T,bs as ae,bt as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,am as z,an as de,bu as pe,bv as xe}from"./index-V7aSbkHg.js";import{E as me}from"./ErrorNotice-8bHn1hfP.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-tZrmrhPT.js";import{S as L,C as je,F as ye,c as Ce,P as we,d as $e,H as ke,e as Ne}from"./categories-kKk2jGpz.js";import{L as Pe}from"./LoadMore-CwQ5CTJq.js";import{u as Se}from"./useInfiniteGrid-Cjl-Omaq.js";import{G as Ae}from"./grid.styles-C5FdGoZt.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const Me=s.section`
1
+ import{j as e,r as h,a as J,e as X}from"./react-OEOSdkUk.js";import{t as b,s,bs as ee,Y as te,D as T,bt as ae,bu as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,am as z,an as de,bv as pe,bw as xe}from"./index-CaGVgZr4.js";import{E as me}from"./ErrorNotice-CD3QThL8.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-CmHnGfxY.js";import{S as L,C as je,F as ye,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-Dp28MR0O.js";import{L as Pe}from"./LoadMore-D3-F6XWb.js";import{u as Se}from"./useInfiniteGrid-DguU-cIJ.js";import{G as Ae}from"./grid.styles-CrucuXuJ.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const Me=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -159,4 +159,4 @@ import{j as e,r as h,a as J,e as X}from"./react-OEOSdkUk.js";import{t as b,s,br
159
159
  visibility: visible;
160
160
  }
161
161
  }
162
- `,qe=48;function it(){var R;const{contractAddress:o}=J(),t=X(),[n,d]=h.useState("wearable"),[p,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[l,y]=h.useState(""),[k,W]=h.useState("newest"),N=x&&!Number.isNaN(Number(x))?Number(x):void 0,P=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,G=(L.find(i=>i.key===k)??L[0]).server,S={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:P,sortBy:G},{items:j,total:H,isLoading:C,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:Y,fetchNextPage:q}=Se(["collection-page",o,S],i=>pe(o,{...S,first:qe,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),E=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const F=(r==null?void 0:r.creator)||((R=j[0])==null?void 0:R.creator);function D(i){d(i),u(null)}function K(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function O(){d("wearable"),u(null),f([]),v(""),y("")}const w=!!(N||P),Q=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),V=n!=="wearable"||!!p||g.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:E})]}),e.jsx(ze,{name:E,creator:F}),e.jsxs(He,{"data-testid":"browse",children:[e.jsxs(Ye,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:F}),e.jsx(je,{category:n,subCategory:p,onCategory:D,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(Ue,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(ye,{rarities:g,onToggleRarity:K,sort:k,onSort:W,total:H,loading:C,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(Ce,{panelKey:"price",label:Q,active:w,panel:i,children:e.jsxs(we,{"data-variant":"price",children:[e.jsxs($e,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:m=>v(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:l,onChange:m=>y(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Ae,{"data-testid":"grid",children:C?e.jsx(z,{count:15}):e.jsxs(e.Fragment,{children:[j.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(z,{count:6}):null]})}),e.jsx(Pe,{hasNextPage:U,isFetching:M,isError:Y,onLoadMore:()=>void q()}),!C&&!A&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{it as Collection,it as default};
162
+ `,qe=48;function it(){var R;const{contractAddress:o}=J(),t=X(),[n,d]=h.useState("wearable"),[p,u]=h.useState(null),[g,f]=h.useState([]),[x,v]=h.useState(""),[l,y]=h.useState(""),[k,W]=h.useState("newest"),N=x&&!Number.isNaN(Number(x))?Number(x):void 0,P=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,G=(L.find(i=>i.key===k)??L[0]).server,S={category:n,rarities:g.length?g:void 0,wearableCategories:_,minPriceCredits:N,maxPriceCredits:P,sortBy:G},{items:j,total:H,isLoading:w,error:A,hasNextPage:U,isFetchingNextPage:M,isFetchNextPageError:Y,fetchNextPage:q}=Se(["collection-page",o,S],i=>pe(o,{...S,first:qe,skip:i}),{enabled:!!o}),{data:r}=ne({queryKey:["collection-meta",o],queryFn:()=>xe(o),enabled:!!o,staleTime:5*6e4}),E=(r==null?void 0:r.name)||a("collection.fallbackTitle");ce({title:r==null?void 0:r.name,description:r!=null&&r.name?a("seo.collection.description",{name:r.name}):void 0});const F=(r==null?void 0:r.creator)||((R=j[0])==null?void 0:R.creator);function D(i){d(i),u(null)}function K(i){f(m=>m.includes(i)?m.filter(Z=>Z!==i):[...m,i])}function O(){d("wearable"),u(null),f([]),v(""),y("")}const C=!!(N||P),Q=C?`${x||"0"}–${l||"∞"}`:a("filter.price"),V=n!=="wearable"||!!p||g.length>0||C;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(ge,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(be,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(fe,{children:E})]}),e.jsx(ze,{name:E,creator:F}),e.jsxs(He,{"data-testid":"browse",children:[e.jsxs(Ye,{"data-testid":"browse-sidebar",children:[e.jsx(_e,{address:F}),e.jsx(je,{category:n,subCategory:p,onCategory:D,onSub:u,title:a("collection.category"),flat:!0})]}),e.jsxs(Ue,{children:[!w&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(ye,{rarities:g,onToggleRarity:K,sort:k,onSort:W,total:H,loading:w,anyActive:V,onClear:O,renderTrailing:i=>e.jsx(we,{panelKey:"price",label:Q,active:C,panel:i,children:e.jsxs(Ce,{"data-variant":"price",children:[e.jsxs($e,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:m=>v(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMax"),placeholder:a("collection.priceMaxPlaceholder"),value:l,onChange:m=>y(m.target.value)})]}),e.jsx(ke,{children:a("collection.priceHint",{currency:le.name})})]})})}),A?e.jsx(me,{message:a("collection.error")}):null,e.jsx(Ae,{"data-testid":"grid",children:w?e.jsx(z,{count:15}):e.jsxs(e.Fragment,{children:[j.map(i=>e.jsx(de,{item:i},i.id)),M?e.jsx(z,{count:6}):null]})}),e.jsx(Pe,{hasNextPage:U,isFetching:M,isError:Y,onLoadMore:()=>void q()}),!w&&!A&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{it as Collection,it as default};
@@ -1,10 +1,10 @@
1
- import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as k,aD as j,bU as C,C as Y,w as G,I as Q,F as X,g as W,h as B,f as Z,ap as q,a5 as J,bY as F,an as ee}from"./index-V7aSbkHg.js";import{s as te,f as U,A as H,g as D,r as ne,m as ae,i as ie,j as oe}from"./authorizations-D4wI085M.js";import{i as se}from"./errors-COaDYYX2.js";import{E as re}from"./ErrorNotice-8bHn1hfP.js";import{l as ce,m as de,n as le}from"./buy-BeDHfPC-.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-BUU2XPaW.js";import{I as xe,C as ge}from"./ethers-lk3HAbPB.js";const R="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
1
+ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as k,aD as j,bV as C,C as G,w as Y,I as Q,F as X,g as W,h as B,f as Z,ap as q,a5 as J,bZ as F,an as ee}from"./index-CaGVgZr4.js";import{s as te,f as U,A as H,g as D,r as ne,m as ae,i as ie,j as oe}from"./authorizations-D50ifPOO.js";import{i as se}from"./errors-CUmo51Xe.js";import{E as re}from"./ErrorNotice-CD3QThL8.js";import{l as ce,m as de,n as le}from"./buy-P_iceS6H.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-DkiH6liR.js";import{I as xe,C as ge}from"./ethers-lk3HAbPB.js";const R="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
5
5
  align-items: stretch;
6
6
  width: 100%;
7
- `,_=`
7
+ `,V=`
8
8
  width: 100%;
9
9
  min-height: 56px;
10
10
  display: flex;
@@ -36,14 +36,14 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
36
36
  cursor: default;
37
37
  }
38
38
  `,ve=e.button`
39
- ${_}
39
+ ${V}
40
40
  background: ${o.gradients.amethyst};
41
41
 
42
42
  &:hover:not(:disabled) {
43
43
  filter: brightness(1.08);
44
44
  }
45
45
  `,N=e.button`
46
- ${_}
46
+ ${V}
47
47
  background: ${o.colors.text2};
48
48
 
49
49
  &:hover:not(:disabled) {
@@ -109,7 +109,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
109
109
  line-height: 1.4;
110
110
  color: ${o.colors.muted};
111
111
  text-align: center;
112
- `;function xt({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:l,creditsLabel:c,shortfall:p,showCreditsAmount:x=!0}){return t.jsxs(we,{children:[a.map(u=>u.method==="credits"?t.jsxs(ve,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??f("buyModal.buy")}),x?t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))})]}):null]},"credits"):u.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))}),t.jsx($e,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)}),t.jsx(ke,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx(Ce,{"data-testid":"mana-shortfall-note",children:f("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:Y.name})})]}):null,l?t.jsx(je,{"data-testid":"mana-rate-note",children:l}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function gt(a,n){const i=(s,...l)=>void a.invalidateQueries({queryKey:n?[s,...l]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const ze=G`
112
+ `;function xt({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:l,creditsLabel:c,shortfall:p,showCreditsAmount:x=!0}){return t.jsxs(we,{children:[a.map(u=>u.method==="credits"?t.jsxs(ve,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??f("buyModal.buy")}),x?t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))})]}):null]},"credits"):u.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:f("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(u.creditsCents))}),t.jsx($e,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(u.manaWei)}),t.jsx(ke,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:f("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx(Ce,{"data-testid":"mana-shortfall-note",children:f("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:G.name})})]}):null,l?t.jsx(je,{"data-testid":"mana-rate-note",children:l}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function gt(a,n){const i=(s,...l)=>void a.invalidateQueries({queryKey:n?[s,...l]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const ze=Y`
113
113
  to { transform: rotate(360deg); }
114
114
  `,Me=e.div`
115
115
  position: fixed;
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function ft({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await te({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Me,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(De,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function mt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(D.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=ne(),$=ae(s.provider,m),h=await pe($,m,d,p,{serverURL:D.relayerUrl});return l==null||l(),await ie(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof oe)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await q(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function bt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function wt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:He}=o,vt=e.div`
292
+ `;function ft({auth:a,signer:n,title:i,reason:s,name:l,image:c,icon:p,onAuthorized:x,onCancel:u,onClose:b}){const[y,w]=v.useState(!1),[d,m]=v.useState(null);async function $(){w(!0),m(null);try{await te({auth:a,signer:n,active:!0}),x()}catch(h){se(h)?m(f("authorizeStep.errorRejected")):(X(h,{flow:"authorize_step",kind:a.kind}),m(f("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Me,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(Ae,{onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(We,{children:[t.jsx(Ie,{children:i}),t.jsx(Se,{onClick:b,disabled:y,"aria-label":f("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Te,{"data-testid":"authorize-step-row",children:[t.jsx(Ne,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Be,{title:l,children:l}),t.jsx(Re,{children:s})]})]}),t.jsx(Le,{children:f("authorizeStep.note")}),t.jsx(re,{message:d}),t.jsxs(Pe,{children:[t.jsx(Fe,{type:"button",onClick:u,disabled:y,children:f("authorizeStep.cancel")}),t.jsx(De,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{"aria-hidden":!0}),f("authorizeStep.authorizing")]}):f("authorizeStep.authorize")})]})]})})}async function mt(a){const[n]=await Qe({...a,trades:[a.trade]});return n}async function Qe(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const x of n){const u=`${x.chainId}:${x.contract.toLowerCase()}`,b=c.get(u);b?b.push(x):c.set(u,[x])}const p=[];for(const x of c.values())p.push(await Ue({trades:x,buyer:i,signer:s,onSigned:l}));return p}async function Ue(a){const{trades:n,buyer:i,signer:s,onSigned:l}=a,c=n[0],p=W(Z(c.contract),c.chainId),x=W(B.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:x.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const u=n.map(d=>de(d,i));if(D.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=ne(),$=ae(s.provider,m),h=await pe($,m,d,p,{serverURL:D.relayerUrl});return l==null||l(),await ie(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof oe)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await q(s.provider,c.chainId);const y=await new ge(p.address,p.abi,s).accept(u,le(c.chainId));return l==null||l(),(await y.wait()).transactionHash}async function bt(a){const{trade:n,buyer:i,signer:s,credits:l,manaGapWei:c,onBroadcast:p,onReverted:x}=a;if(l.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const u=W(B.MANAToken,n.chainId),b=W(B.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:u.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(l.reduce((d,m)=>d+BigInt(m.availableAmount),0n)+c).toString();return ce({trade:n,buyer:i,signer:s,credits:l,maxCreditedValue:w,onBroadcast:p,onReverted:x})}function yt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function wt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:_,radius:O,z:He}=o,vt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${He.overlay};
@@ -446,7 +446,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
446
446
  gap: 8px;
447
447
  justify-content: center;
448
448
  background: rgba(255, 162, 90, 0.3);
449
- border-radius: ${V.btn};
449
+ border-radius: ${O.btn};
450
450
  padding: 12px 8px;
451
451
  `,Kt=e.p`
452
452
  margin: 0;
@@ -481,27 +481,27 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
481
481
  width: 24px;
482
482
  height: 24px;
483
483
  background: ${r.text};
484
- `,_t=e.span`
484
+ `,Vt=e.span`
485
485
  font-size: 24px;
486
486
  font-weight: 500;
487
487
  color: ${r.text};
488
- `,Ot=e.span`
488
+ `,_t=e.span`
489
489
  font-size: 14px;
490
490
  color: ${r.text};
491
- `,Vt=e.div`
491
+ `,Ot=e.div`
492
492
  display: flex;
493
493
  align-items: center;
494
494
  justify-content: space-between;
495
495
  border-top: 1px solid ${r.gray4};
496
496
  padding-top: 12px;
497
- `,Yt=e.div`
497
+ `,Gt=e.div`
498
498
  display: flex;
499
499
  align-items: center;
500
500
  gap: 8px;
501
501
  font-size: 24px;
502
502
  font-weight: 700;
503
503
  color: ${r.text};
504
- `,Gt=e(k)`
504
+ `,Yt=e(k)`
505
505
  width: 30px;
506
506
  height: 30px;
507
507
  background: ${r.text};
@@ -522,7 +522,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
522
522
  /* Let the CTAs shrink so their min-content can't widen the modal past the viewport on mobile. */
523
523
  min-width: 0;
524
524
  height: 46px;
525
- border-radius: ${V.btn};
525
+ border-radius: ${O.btn};
526
526
  border: 0;
527
527
  cursor: pointer;
528
528
  font-size: 15px;
@@ -538,7 +538,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
538
538
  width: 100%;
539
539
  }
540
540
  &[data-variant='gradient'] {
541
- background: ${O.amethyst};
541
+ background: ${_.amethyst};
542
542
  color: ${r.softWhite};
543
543
  }
544
544
  &[data-variant='outline'] {
@@ -606,7 +606,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
606
606
  height: 100%;
607
607
  width: 40%;
608
608
  border-radius: 100px;
609
- background: ${O.amethyst};
609
+ background: ${_.amethyst};
610
610
  animation: buy-modal-progress 1.1s ease-in-out infinite;
611
611
 
612
612
  @keyframes buy-modal-progress {
@@ -665,18 +665,18 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
665
665
  text-align: center;
666
666
  }
667
667
  }
668
- `,{colors:I,media:A}=o,_e=e.section`
668
+ `,{colors:I,media:A}=o,Ve=e.section`
669
669
  margin-top: 40px;
670
- `,Oe=e.div`
670
+ `,_e=e.div`
671
671
  display: flex;
672
672
  align-items: center;
673
673
  justify-content: space-between;
674
674
  margin-bottom: 20px;
675
- `,Ve=e.h2`
675
+ `,Oe=e.h2`
676
676
  font-size: 22px;
677
677
  font-weight: 700;
678
678
  color: ${I.text};
679
- `,Ye=e.button`
679
+ `,Ge=e.button`
680
680
  display: inline-flex;
681
681
  align-items: center;
682
682
  gap: 4px;
@@ -694,7 +694,7 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
694
694
  &:hover {
695
695
  text-decoration: underline;
696
696
  }
697
- `,Ge=e(Q)`
697
+ `,Ye=e(Q)`
698
698
  transform: rotate(-90deg);
699
699
  `,Xe=e.div`
700
700
  position: relative;
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-OEOSdkUk.js";import{s as e,t as o,b as f,z as
801
801
  opacity: 1;
802
802
  transform: scale(1.1);
803
803
  }
804
- `;function dn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:L,clientWidth:S}=h,P=Math.max(1,Math.ceil(L/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=L-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ye,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ge,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(K,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(ee,{item:h},h.id))}),t.jsx(K,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{z as $,Nt as A,At as B,$t as C,_t as D,Ot as E,Vt as F,Yt as G,jt as H,Gt as I,Xt as J,lt as K,Jt as L,vt as M,dt as N,dn as O,xt as P,ft as Q,T as R,kt as S,zt as T,ct as U,gt as V,Dt as W,Mt as X,Qe as Y,pt as Z,be as _,Ct as a,rn as a0,cn as a1,mt as a2,ht as a3,bt as a4,yt as b,Wt as c,It as d,St as e,Tt as f,en as g,tn as h,nn as i,Zt as j,qt as k,an as l,ut as m,on as n,sn as o,wt as p,Kt as q,Et as r,Bt as s,Rt as t,Lt as u,Pt as v,Ft as w,Qt as x,Ut as y,Ht as z};
804
+ `;function dn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,x]=v.useState(0),[u,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const h=s.current;if(!h)return;const{scrollLeft:g,scrollWidth:L,clientWidth:S}=h,P=Math.max(1,Math.ceil(L/S));c(P),x(Math.min(P-1,Math.round(g/S))),b(g<=1),w(g+S>=L-1)},[]);if(v.useEffect(()=>{d();const h=s.current;if(h)return h.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{h.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function m(h){const g=s.current;g&&g.scrollBy({left:h*g.clientWidth,behavior:"smooth"})}function $(h){const g=s.current;g&&g.scrollTo({left:h*g.clientWidth,behavior:"smooth"})}return t.jsxs(Ve,{children:[t.jsxs(_e,{children:[t.jsx(Oe,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[f("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(K,{"data-side":"left",onClick:()=>m(-1),"aria-label":f("collectionCarousel.scrollLeft"),disabled:u,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(h=>t.jsx(ee,{item:h},h.id))}),t.jsx(K,{"data-side":"right",onClick:()=>m(1),"aria-label":f("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(qe,{"aria-label":f("collectionCarousel.pages"),children:Array.from({length:l}).map((h,g)=>t.jsx(Je,{"data-active":g===p||void 0,"aria-label":f("collectionCarousel.goToPage",{page:g+1}),"aria-current":g===p?"true":void 0,onClick:()=>$(g)},g))}):null]})}export{z as $,Nt as A,At as B,$t as C,Vt as D,_t as E,Ot as F,Gt as G,jt as H,Yt as I,Xt as J,lt as K,Jt as L,vt as M,dt as N,dn as O,xt as P,ft as Q,T as R,kt as S,zt as T,ct as U,gt as V,Dt as W,Mt as X,Qe as Y,pt as Z,be as _,Ct as a,rn as a0,cn as a1,mt as a2,ht as a3,bt as a4,yt as b,Wt as c,It as d,St as e,Tt as f,en as g,tn as h,nn as i,Zt as j,qt as k,an as l,ut as m,on as n,sn as o,wt as p,Kt as q,Et as r,Bt as s,Rt as t,Lt as u,Pt as v,Ft as w,Qt as x,Ut as y,Ht as z};
@@ -1,7 +1,7 @@
1
- import{e as de,j as e,L as Fe,a as Le,u as Me,r as L}from"./react-OEOSdkUk.js";import{u as Ae}from"./useUrlFilters-DABDXRpV.js";import{t as he,J as Ie,L as Z,K as X,s,bE as Re,aC as _e,bF as ze,b as o,bG as Be,bH as ee,B as Te,ah as me,Y as pe,br as We,o as De,D as xe,by as Ge,bs as Oe,bt as Ke,I as te,c as Ue,x as He,v as qe,ai as Ve,ak as Je,al as Ye,am as M,an as oe,bI as re,bJ as Qe}from"./index-V7aSbkHg.js";import{d as Ze,P as Xe,C as et,a as tt,b as ot,A as rt,c as it,e as st}from"./collectionPage.styles-tZrmrhPT.js";import{g as at,h as nt,i as lt,j as ct,k as dt,C as ht,l as mt,o as pt,m as xt,n as ut,M as gt,E as ft,p as bt,q as wt,r as vt,s as yt,t as jt}from"./Assets.styles-BEwmRTV4.js";import{S as ie,R as Ct,F as kt,e as $t}from"./categories-kKk2jGpz.js";import{L as se}from"./LoadMore-CwQ5CTJq.js";import{u as ae}from"./useInfiniteGrid-Cjl-Omaq.js";import{E as _}from"./ErrorNotice-8bHn1hfP.js";import{G as ne}from"./grid.styles-C5FdGoZt.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./Tooltip-AFYoHds5.js";function St(r){const{gridLoading:i,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:g}=r;return i?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":g===0?"no-creations":"filters"}const{colors:b,radius:ue,media:Nt}=he,Et=s.article`
1
+ import{e as de,j as e,L as Fe,a as Le,u as Me,r as L}from"./react-OEOSdkUk.js";import{u as Ae}from"./useUrlFilters-DABDXRpV.js";import{t as he,J as Ie,L as Z,K as X,s,bF as Re,aC as _e,bG as ze,b as o,bH as Be,bI as ee,B as Te,ah as me,Y as pe,bs as We,o as De,D as ue,bz as Ge,bt as Ke,bu as Oe,I as te,c as Ue,x as He,v as qe,ai as Ve,ak as Je,al as Ye,am as M,an as oe,bJ as re,bK as Qe}from"./index-CaGVgZr4.js";import{d as Ze,P as Xe,C as et,a as tt,b as ot,A as rt,c as it,e as st}from"./collectionPage.styles-CmHnGfxY.js";import{g as at,h as nt,i as lt,j as ct,k as dt,C as ht,l as mt,o as pt,m as ut,n as xt,M as gt,E as ft,p as bt,q as wt,r as vt,s as yt,t as jt}from"./Assets.styles-DwvAA7Fx.js";import{S as ie,R as Ct,F as kt,e as $t}from"./categories-Dp28MR0O.js";import{L as se}from"./LoadMore-D3-F6XWb.js";import{u as ae}from"./useInfiniteGrid-DguU-cIJ.js";import{E as _}from"./ErrorNotice-CD3QThL8.js";import{G as ne}from"./grid.styles-CrucuXuJ.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BE30N5-7.js";function St(r){const{gridLoading:i,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:g}=r;return i?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":g===0?"no-creations":"filters"}const{colors:b,radius:xe,media:Nt}=he,Et=s.article`
2
2
  height: 300px;
3
3
  background: ${b.bg};
4
- border-radius: ${ue.card};
4
+ border-radius: ${xe.card};
5
5
  overflow: hidden;
6
6
  position: relative;
7
7
  isolation: isolate;
@@ -122,7 +122,7 @@ import{e as de,j as e,L as Fe,a as Le,u as Me,r as L}from"./react-OEOSdkUk.js";i
122
122
  background: ${b.accent};
123
123
  color: ${b.softWhite};
124
124
  border: 0;
125
- border-radius: ${ue.btn};
125
+ border-radius: ${xe.btn};
126
126
  font-weight: 700;
127
127
  font-size: 13px;
128
128
  text-transform: uppercase;
@@ -170,11 +170,11 @@ import{e as de,j as e,L as Fe,a as Le,u as Me,r as L}from"./react-OEOSdkUk.js";i
170
170
  ${v.maxWidth("mobile")} {
171
171
  min-height: 260px;
172
172
  }
173
- `,Ot=s.div`
173
+ `,Kt=s.div`
174
174
  position: absolute;
175
175
  inset: 0;
176
176
  z-index: 0;
177
- `,Kt=s.img`
177
+ `,Ot=s.img`
178
178
  width: 100%;
179
179
  height: 100%;
180
180
  object-fit: cover;
@@ -303,4 +303,4 @@ import{e as de,j as e,L as Fe,a as Le,u as Me,r as L}from"./react-OEOSdkUk.js";i
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,eo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function to({address:r}){var m,j;const{data:i}=pe(r),{data:a}=We(r),l=De(p=>{var $;return($=p.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(i==null?void 0:i.name)||xe(r),g=(j=(m=i==null?void 0:i.avatar)==null?void 0:m.snapshots)==null?void 0:j.face256,y=(a==null?void 0:a.cover)||Ze,n=a==null?void 0:a.description,f=`${Ue.profileUrl}/${r}`,w=Ge.filter(p=>a==null?void 0:a.links[p]),h=Oe(Ke({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(Gt,{"aria-label":`${d} storefront`,children:[e.jsxs(Ot,{children:[e.jsx(Kt,{src:y,alt:"",loading:"eager"}),e.jsx(Ut,{"aria-hidden":!0})]}),(w.length>0||c)&&e.jsxs(Ht,{children:[w.map(p=>e.jsx(qt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[p])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${p}`),"aria-label":o(`creator.link.${p}`),children:e.jsx(te,{name:eo[p]})},p)),c&&e.jsx(Vt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Jt,{children:[g?e.jsx(le,{src:g,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Yt,{children:d}),n?e.jsx(Qt,{children:n}):null]}),e.jsxs(Zt,{children:[e.jsx(Xt,{"data-testid":"creator-hero-view",href:f,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Dt,{address:r,className:"creator-hero__follow"})]})]})]})}const oo=["all","on_sale","not_for_sale"],ce=48;function wo(){var Y,Q;const{address:r}=Le(),i=de(),[a]=Me(),l=a.has("collections"),{data:c}=pe(r),d=(c==null?void 0:c.name)||(r?xe(r):o("creator.fallbackName"));He({title:d,description:o("seo.creator.description",{name:d}),image:(Q=(Y=c==null?void 0:c.avatar)==null?void 0:Y.snapshots)==null?void 0:Q.face256});const g=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[y,n]=Ae(g),{category:f,subCategory:w,rarities:h,priceMin:m,priceMax:j,smart:p,sort:$}=y,S=oo.includes(y.status)?y.status:"all",z=t=>n({status:t}),[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Pe=>{Pe.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=u}},[E]);const B=m&&!Number.isNaN(Number(m))?Number(m):void 0,T=j&&!Number.isNaN(Number(j))?Number(j):void 0,we=w?$t[w]:void 0,ve=(ie.find(t=>t.key===$)??ie[0]).server,W={creator:r,category:f,rarities:h.length?h:void 0,wearableCategories:we,minPriceCredits:B,maxPriceCredits:T,isWearableSmart:p||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ve},{items:A,total:ye,isLoading:je,isPlaceholderData:Ce,error:D,hasNextPage:ke,isFetchingNextPage:G,isFetchNextPageError:$e,fetchNextPage:Se}=ae(["creator-items",W],t=>re({...W,first:ce,skip:t}),{enabled:!!r&&!l}),P=qe({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),x=ae(["creator-collections",r],t=>Qe(r,{first:ce,skip:t}).then(u=>({items:u.collections,total:u.total})),{enabled:!!r&&l});function O(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ne(){const t=new URLSearchParams(a);t.delete("collections");const u=t.toString();i({search:u?`?${u}`:""},{replace:!0})}function Ee(){if(l){Ne();return}const t=new URLSearchParams(a);t.delete("collections");const u=t.toString();i({search:u?`?${u}&collections`:"?collections"},{replace:!0})}function K(t){n({rarities:h.includes(t)?h.filter(u=>u!==t):[...h,t]})}function U(){n(g)}const k=[];(f==="wearable"||f==="emote")&&k.push({key:"category",label:o(f==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>O("all")}),(B!=null||T!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Ct)h.includes(t)&&k.push({key:`rarity-${t}`,label:Ve(t),onRemove:()=>K(t)});p&&k.push({key:"smart",label:o("filter.smart"),onRemove:()=>n({smart:!1})}),S!=="all"&&k.push({key:"status",label:S==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>z("all")});const F=St({gridLoading:je||Ce,gridError:!!D,gridCount:A.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),I=F==="skeletons",{data:H}=Je(),q=L.useMemo(()=>A.map(t=>({...t,priceCredits:Ye(t,H)})),[A,H]),V=t=>t.priceCredits>0||!!t.manaWei,J=q.filter(V),R=F==="items"||F==="skeletons"?null:F;return e.jsxs(Xe,{children:[e.jsxs(et,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(tt,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(ot,{children:d})]}),r?e.jsx(to,{address:r}):null,!l&&!I&&J.length>0?e.jsx(rt,{items:J,source:"creator"}):null,e.jsxs(at,{children:[E?e.jsx(nt,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(lt,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(ct,{children:[e.jsx(dt,{children:o("assets.filters")}),e.jsx(ht,{onClick:()=>N(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(mt,{children:e.jsx(pt,{category:f,subCategory:w,onCategory:O,onSub:t=>n({subCategory:t}),priceMin:m,priceMax:j,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:K,status:S,onStatus:z,smart:p,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Ee})}),e.jsx(xt,{children:e.jsx(ut,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(gt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(it,{children:e.jsx(st,{children:x.isLoading?"…":o("creator.collectionsCount",{count:x.total})})}),x.error?e.jsx(_,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:x.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[x.items.map(t=>e.jsx(Wt,{collection:t,itemCount:t.itemCount},t.contractAddress)),x.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(se,{hasNextPage:x.hasNextPage,isFetching:x.isFetchingNextPage,isError:x.isFetchNextPageError,onLoadMore:()=>void x.fetchNextPage()}),!x.isLoading&&!x.error&&x.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(kt,{sort:$,onSort:t=>n({sort:t}),total:ye,loading:I,onOpenFilters:()=>N(!0),chips:k,onClearChips:U}),D?e.jsx(_,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:I?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[q.map(t=>V(t)?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),G?e.jsx(M,{count:6}):null]})}),e.jsx(se,{hasNextPage:ke,isFetching:G,isError:$e,onLoadMore:()=>void Se()}),R==="error"?e.jsx(_,{message:o("creator.error"),testId:"creator-empty-error"}):R==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):R==="filters"?e.jsxs(ft,{"data-testid":"creator-empty-filters",children:[e.jsxs(bt,{children:[e.jsx(wt,{children:o("creator.emptyFilters.title")}),e.jsx(vt,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(yt,{children:e.jsx(jt,{type:"button",onClick:U,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{wo as Creator,wo as default};
306
+ `,eo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function to({address:r}){var m,j;const{data:i}=pe(r),{data:a}=We(r),l=De(p=>{var $;return($=p.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(i==null?void 0:i.name)||ue(r),g=(j=(m=i==null?void 0:i.avatar)==null?void 0:m.snapshots)==null?void 0:j.face256,y=(a==null?void 0:a.cover)||Ze,n=a==null?void 0:a.description,f=`${Ue.profileUrl}/${r}`,w=Ge.filter(p=>a==null?void 0:a.links[p]),h=Ke(Oe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(Gt,{"aria-label":`${d} storefront`,children:[e.jsxs(Kt,{children:[e.jsx(Ot,{src:y,alt:"",loading:"eager"}),e.jsx(Ut,{"aria-hidden":!0})]}),(w.length>0||c)&&e.jsxs(Ht,{children:[w.map(p=>e.jsx(qt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[p])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${p}`),"aria-label":o(`creator.link.${p}`),children:e.jsx(te,{name:eo[p]})},p)),c&&e.jsx(Vt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Jt,{children:[g?e.jsx(le,{src:g,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Yt,{children:d}),n?e.jsx(Qt,{children:n}):null]}),e.jsxs(Zt,{children:[e.jsx(Xt,{"data-testid":"creator-hero-view",href:f,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Dt,{address:r,className:"creator-hero__follow"})]})]})]})}const oo=["all","on_sale","not_for_sale"],ce=48;function wo(){var Y,Q;const{address:r}=Le(),i=de(),[a]=Me(),l=a.has("collections"),{data:c}=pe(r),d=(c==null?void 0:c.name)||(r?ue(r):o("creator.fallbackName"));He({title:d,description:o("seo.creator.description",{name:d}),image:(Q=(Y=c==null?void 0:c.avatar)==null?void 0:Y.snapshots)==null?void 0:Q.face256});const g=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[y,n]=Ae(g),{category:f,subCategory:w,rarities:h,priceMin:m,priceMax:j,smart:p,sort:$}=y,S=oo.includes(y.status)?y.status:"all",z=t=>n({status:t}),[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Pe=>{Pe.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const x=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=x}},[E]);const B=m&&!Number.isNaN(Number(m))?Number(m):void 0,T=j&&!Number.isNaN(Number(j))?Number(j):void 0,we=w?$t[w]:void 0,ve=(ie.find(t=>t.key===$)??ie[0]).server,W={creator:r,category:f,rarities:h.length?h:void 0,wearableCategories:we,minPriceCredits:B,maxPriceCredits:T,isWearableSmart:p||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ve},{items:A,total:ye,isLoading:je,isPlaceholderData:Ce,error:D,hasNextPage:ke,isFetchingNextPage:G,isFetchNextPageError:$e,fetchNextPage:Se}=ae(["creator-items",W],t=>re({...W,first:ce,skip:t}),{enabled:!!r&&!l}),P=qe({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),u=ae(["creator-collections",r],t=>Qe(r,{first:ce,skip:t}).then(x=>({items:x.collections,total:x.total})),{enabled:!!r&&l});function K(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ne(){const t=new URLSearchParams(a);t.delete("collections");const x=t.toString();i({search:x?`?${x}`:""},{replace:!0})}function Ee(){if(l){Ne();return}const t=new URLSearchParams(a);t.delete("collections");const x=t.toString();i({search:x?`?${x}&collections`:"?collections"},{replace:!0})}function O(t){n({rarities:h.includes(t)?h.filter(x=>x!==t):[...h,t]})}function U(){n(g)}const k=[];(f==="wearable"||f==="emote")&&k.push({key:"category",label:o(f==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>K("all")}),(B!=null||T!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Ct)h.includes(t)&&k.push({key:`rarity-${t}`,label:Ve(t),onRemove:()=>O(t)});p&&k.push({key:"smart",label:o("filter.smart"),onRemove:()=>n({smart:!1})}),S!=="all"&&k.push({key:"status",label:S==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>z("all")});const F=St({gridLoading:je||Ce,gridError:!!D,gridCount:A.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),I=F==="skeletons",{data:H}=Je(),q=L.useMemo(()=>A.map(t=>({...t,priceCredits:Ye(t,H)})),[A,H]),V=t=>t.priceCredits>0||!!t.manaWei,J=q.filter(V),R=F==="items"||F==="skeletons"?null:F;return e.jsxs(Xe,{children:[e.jsxs(et,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(tt,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(ot,{children:d})]}),r?e.jsx(to,{address:r}):null,!l&&!I&&J.length>0?e.jsx(rt,{items:J,source:"creator"}):null,e.jsxs(at,{children:[E?e.jsx(nt,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(lt,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(ct,{children:[e.jsx(dt,{children:o("assets.filters")}),e.jsx(ht,{onClick:()=>N(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(mt,{children:e.jsx(pt,{category:f,subCategory:w,onCategory:K,onSub:t=>n({subCategory:t}),priceMin:m,priceMax:j,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:O,status:S,onStatus:z,smart:p,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Ee})}),e.jsx(ut,{children:e.jsx(xt,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(gt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(it,{children:e.jsx(st,{children:u.isLoading?"…":o("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(_,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:u.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(t=>e.jsx(Wt,{collection:t,itemCount:t.itemCount},t.contractAddress)),u.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(se,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,isError:u.isFetchNextPageError,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(kt,{sort:$,onSort:t=>n({sort:t}),total:ye,loading:I,onOpenFilters:()=>N(!0),chips:k,onClearChips:U}),D?e.jsx(_,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:I?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[q.map(t=>V(t)?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),G?e.jsx(M,{count:6}):null]})}),e.jsx(se,{hasNextPage:ke,isFetching:G,isError:$e,onLoadMore:()=>void Se()}),R==="error"?e.jsx(_,{message:o("creator.error"),testId:"creator-empty-error"}):R==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):R==="filters"?e.jsxs(ft,{"data-testid":"creator-empty-filters",children:[e.jsxs(bt,{children:[e.jsx(wt,{children:o("creator.emptyFilters.title")}),e.jsx(vt,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(yt,{children:e.jsx(jt,{type:"button",onClick:U,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{wo as Creator,wo as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-OEOSdkUk.js";import{I as i}from"./index-V7aSbkHg.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-OEOSdkUk.js";import{I as i}from"./index-CaGVgZr4.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
@@ -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-BvhBpuKR.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Do3GSrTN.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-DIMdAQZt.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-B_tbfHPr.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,4 +1,4 @@
1
- import{r as h,j as o}from"./react-OEOSdkUk.js";import{t as e,s as a,b as r,I as f}from"./index-V7aSbkHg.js";const w=a.section`
1
+ import{r as h,j as o}from"./react-OEOSdkUk.js";import{t as e,s as a,b as r,I as f}from"./index-CaGVgZr4.js";const w=a.section`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 36px;
@@ -1,4 +1,4 @@
1
- import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t as e,w as F,x as ge,b as n,C as h,o as fe,A as me,V as g,bf as be,F as G,bp as N,bV as we,b9 as H,z as re,I as ye,bW as Q}from"./index-V7aSbkHg.js";import{F as ke}from"./Faq-DNu30-Jv.js";import{R as V}from"./resume-buy-Bf0zIH7y.js";import{u as ve,a as Ce,R as $e,c as je,i as Se,b as Ae}from"./useCreditPacks-DW-oKsgc.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/pack-chest-BX_j84xW.webp",Pe="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/credit-coin-CmcTCd5i.webp",Re="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="https://cdn.decentraland.org/@dcl/shop/0.8.1-31011914733.commit-0303b0f/_assets/packs-backdrop-BcXiUPeP.webp",D="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
1
+ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t as e,w as F,x as ge,b as n,C as h,o as fe,A as me,V as g,bg as be,F as G,bq as N,bW as we,ba as H,z as re,I as ye,bX as Q}from"./index-CaGVgZr4.js";import{F as ke}from"./Faq-Bxgy5XAq.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as ve,a as Ce,R as $e,c as je,i as Se,b as Ae}from"./useCreditPacks-j0KzNBHB.js";import"./sentry-B60WY-np.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-lk3HAbPB.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.9.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.9.0/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.9.0/_assets/pack-chest-BX_j84xW.webp",Pe="https://cdn.decentraland.org/@dcl/shop/0.9.0/_assets/credit-coin-CmcTCd5i.webp",Re="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="https://cdn.decentraland.org/@dcl/shop/0.9.0/_assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -144,7 +144,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
144
144
  line-height: 1.6;
145
145
  color: ${e.colors.media};
146
146
  text-align: center;
147
- `,K=i.div`
147
+ `,O=i.div`
148
148
  display: grid;
149
149
  grid-template-columns: repeat(4, minmax(0, 1fr));
150
150
  gap: 24px;
@@ -160,7 +160,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
160
160
  gap: 12px;
161
161
  row-gap: 24px;
162
162
  }
163
- `,O=i.button`
163
+ `,V=i.button`
164
164
  position: relative;
165
165
  display: flex;
166
166
  flex-direction: column;
@@ -199,9 +199,9 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
199
199
  inset: 0;
200
200
  border-radius: inherit;
201
201
  pointer-events: none;
202
- -webkit-mask: ${D};
202
+ -webkit-mask: ${K};
203
203
  -webkit-mask-composite: xor;
204
- mask: ${D};
204
+ mask: ${K};
205
205
  mask-composite: exclude;
206
206
  transition: opacity 0.15s ease;
207
207
  }
@@ -342,7 +342,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
342
342
  font-size: 32px;
343
343
  line-height: 24px;
344
344
  }
345
- `,Ve=i.span`
345
+ `,De=i.span`
346
346
  font-family: ${e.font.sans};
347
347
  font-size: 20px;
348
348
  font-weight: 500;
@@ -354,7 +354,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
354
354
  font-size: 16px;
355
355
  line-height: 12px;
356
356
  }
357
- `,De=i.span`
357
+ `,Ke=i.span`
358
358
  display: block;
359
359
  width: 70%;
360
360
  aspect-ratio: 1;
@@ -365,7 +365,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
365
365
  height: 100%;
366
366
  object-fit: contain;
367
367
  }
368
- `,Ke=i.span`
368
+ `,Oe=i.span`
369
369
  display: flex;
370
370
  align-items: center;
371
371
  justify-content: center;
@@ -389,7 +389,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
389
389
  letter-spacing: 0.46px;
390
390
  color: ${e.colors.text2};
391
391
  text-transform: uppercase;
392
- `,Oe=F`
392
+ `,Ve=F`
393
393
  to {
394
394
  background-position: -200% 0;
395
395
  }
@@ -402,7 +402,7 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
402
402
  rgba(255, 255, 255, 0.08) 70%
403
403
  );
404
404
  background-size: 200% 100%;
405
- animation: ${Oe} 1.4s infinite linear;
405
+ animation: ${Ve} 1.4s infinite linear;
406
406
 
407
407
  @media (prefers-reduced-motion: reduce) {
408
408
  animation: none;
@@ -703,4 +703,4 @@ import{e as ue,u as xe,r as l,j as t}from"./react-OEOSdkUk.js";import{s as i,t a
703
703
  margin: 0;
704
704
  font-family: ${e.font.sans};
705
705
  color: ${e.colors.err};
706
- `,C=Se()?"mock":"stripe",te=[A,A,ne,se],jt={pack_5:A,pack_10:A,pack_25:ne,pack_50:se};function ae(d,s){return jt[d.id]??te[s%te.length]}function St(d,s){return d.artUrl??ae(d,s)}const At=[{question:"faq.buyers.whatAreQ",answer:"faq.buyers.whatAreA"},{question:"faq.buyers.whatCanIBuyQ",answer:"faq.buyers.whatCanIBuyA"},{question:"faq.buyers.whereBuyQ",answer:"faq.buyers.whereBuyA"},{question:"faq.buyers.whereUseQ",answer:"faq.buyers.whereUseA"},{question:"faq.buyers.expireQ",answer:"faq.buyers.expireA"},{question:"faq.buyers.transferQ",answer:"faq.buyers.transferA"}];function ie(d){const s=d;if((s==null?void 0:s.name)==="AbortError")return n("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?n("getCredits.errorSignIn",{currency:h.name}):f.includes("timed out")?n("getCredits.errorTimeout",{currency:h.name}):n("getCredits.errorGeneric")}function It(){var L;ge({title:n("nav.getCredits",{currency:h.name}),noindex:!0});const d=ue(),{session:s,signIn:f}=fe(),o=me(),[m,b]=xe(),{packs:$,isLoading:y}=ve(),[u,p]=l.useState("select"),[c,q]=l.useState(null),[j,E]=l.useState(null),de=(j!=null?(L=$.find(r=>r.credits===j))==null?void 0:L.artUrl:void 0)??Pe,[ce,k]=l.useState(null),[le,R]=l.useState(!1),T=l.useRef(null);l.useEffect(()=>()=>{var r;return(r=T.current)==null?void 0:r.abort()},[]);const W=l.useCallback(()=>{b(r=>{const a=new URLSearchParams(r);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[b]),_=l.useCallback(async r=>{p("processing");const a=new AbortController;T.current=a;try{const x=await Ce(r,{signal:a.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(x.status==="credited"){const w=x.creditsGranted??(c==null?void 0:c.credits)??0;E(w>0?w:null),p("success"),g("Shop Completed Buy Credits",{order_id:r,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem($e)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};d("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(V);if(S){sessionStorage.removeItem(V);const U=JSON.parse(S),M=be(U);if(M){d(M,{state:{item:U,resumeBuy:!0}});return}}}catch{}}else x.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),p("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(x.error??n("getCredits.errorGrant",{currency:h.name})),p("error"))}catch(x){G(x,{flow:"get_credits",step:"grant",order_id:r}),g("Shop Buy Credits Failed",{step:"grant",error_code:N(x),pack_usd:(c==null?void 0:c.usd)??null}),k(ie(x)),p("error")}},[c,s,o,d]),pe=l.useCallback(async r=>{if(!s){f();return}k(null),R(!1),q(r),p(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:C});try{const a=await je(r.id,{address:s.address,identity:s.identity});if(a.mock)_(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){G(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:N(a),pack_usd:r.usd}),k(ie(a)),p("error")}},[s,f,_]),B=l.useRef(!1),I=l.useRef(null);l.useEffect(()=>{if(B.current)return;const r=m.get("order");if(m.get("canceled")!=null){B.current=!0,g("Shop Buy Credits Cancelled",{order_id:r,provider:C}),r&&s&&we(r,s.identity),W(),R(!0),p("select");return}r&&(p("processing"),s&&(B.current=!0,W(),_(r)))},[m,s]);function z(){var r;(r=T.current)==null||r.abort(),p("select"),q(null),E(null),k(null),R(!1)}function he(){const r=I.current;if(!r)return;const a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;r.scrollIntoView({behavior:a?"auto":"smooth",block:"center"}),r.focus({preventScroll:!0})}return t.jsxs(_e,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Be,{"data-testid":"credits-hero",children:[t.jsx(ze,{"aria-hidden":!0}),t.jsxs(Fe,{children:[t.jsxs(Ee,{$hidden:u==="redirecting",children:[t.jsxs(We,{children:[t.jsx(Ie,{children:n("getCredits.title")}),t.jsxs(Le,{children:[t.jsx(Ue,{children:n("getCredits.subtitle")}),t.jsx(Me,{type:"button",onClick:he,"data-testid":"credits-learn-more",children:n("getCredits.learnMore")})]})]}),le&&t.jsx(Ge,{role:"status",children:n("getCredits.canceledNote")}),t.jsx(Pt,{packs:$,loading:y,onSelect:r=>void pe(r)})]}),u==="redirecting"&&t.jsxs(tt,{role:"status","aria-live":"polite",children:[t.jsx(st,{src:H,alt:"",width:72,height:72}),t.jsx(it,{children:n("getCredits.redirecting")})]})]}),t.jsx(qe,{ref:I,tabIndex:-1,"data-testid":"credits-faq",children:t.jsx(ke,{title:"faq.title",entries:At,tone:"on-dark"})})]}),u==="processing"&&t.jsxs(nt,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:H,alt:"",width:61,height:61}),t.jsxs(ot,{children:[t.jsxs(at,{children:[t.jsx("strong",{children:n("getCredits.processing")}),"…"]}),t.jsxs(dt,{"aria-hidden":!0,children:[t.jsx(lt,{children:t.jsx(pt,{})}),t.jsx(ht,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(ut,{role:"status","aria-live":"polite",children:[t.jsxs(xt,{children:[t.jsx(gt,{src:Re,alt:"",width:60,height:60}),t.jsxs(ft,{children:[t.jsx("strong",{children:n("getCredits.successTitle")})," ",n("getCredits.successBody",{currency:h.name})]})]}),j!=null&&t.jsx(mt,{children:t.jsxs(bt,{children:[t.jsx(wt,{src:de,alt:"",width:93,height:93}),t.jsxs(yt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(kt,{children:n("getCredits.creditsAmount",{credits:j,currency:h.name})})," ",t.jsx(vt,{children:n("getCredits.creditsAdded")})]})]})]})}),t.jsxs(Ct,{children:[t.jsx(v,{"data-variant":"outline",onClick:z,children:n("getCredits.buyMore",{currency:h.name})}),t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(Z,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:n("getCredits.pendingTitle",{currency:h.name})}),t.jsx(et,{children:n("getCredits.pendingBody")}),t.jsxs(ee,{children:[t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")}),t.jsx(v,{"data-variant":"outline",onClick:z,children:n("getCredits.done")})]})]}),u==="error"&&t.jsxs(Z,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:n("getCredits.errorTitle")}),t.jsx($t,{children:ce}),t.jsx(ee,{children:t.jsx(v,{onClick:z,children:n("getCredits.tryAgain")})})]})]})}function Pt({packs:d,loading:s,onSelect:f}){return s?t.jsx(K,{"aria-busy":"true","aria-label":n("getCredits.packsLoading",{currency:h.name}),children:[0,1,2,3].map(o=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsxs(X,{children:[t.jsx(Ye,{}),t.jsx(Xe,{})]}),t.jsx(Ze,{})]}),t.jsx(Je,{})]},o))}):t.jsx(K,{children:d.map((o,m)=>{const b=Ae(o,d);return t.jsxs(O,{type:"button","data-testid":"pack","data-best":o.bestValue?"true":void 0,onClick:()=>f(o),"aria-label":b?n("getCredits.packAriaBonus",{amount:Q(o.credits),usd:o.usd,bonus:b.bonus,baseline:b.baseline}):n("getCredits.packAria",{amount:Q(o.credits),usd:o.usd}),children:[o.bestValue&&t.jsxs(Ne,{children:[t.jsx(ye,{name:"star-rounded"}),n("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(X,{children:[t.jsxs(He,{children:[t.jsx(re,{}),t.jsx(Qe,{children:o.credits})]}),t.jsx(Ve,{children:n("getCredits.packUnit",{currency:h.name})})]}),t.jsx(De,{children:t.jsx("img",{src:St(o,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(o,m))}})})]}),t.jsxs(Ke,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{It as GetCredits,It as default};
706
+ `,C=Se()?"mock":"stripe",te=[A,A,ne,se],jt={pack_5:A,pack_10:A,pack_25:ne,pack_50:se};function ae(d,s){return jt[d.id]??te[s%te.length]}function St(d,s){return d.artUrl??ae(d,s)}const At=[{question:"faq.buyers.whatAreQ",answer:"faq.buyers.whatAreA"},{question:"faq.buyers.whatCanIBuyQ",answer:"faq.buyers.whatCanIBuyA"},{question:"faq.buyers.whereBuyQ",answer:"faq.buyers.whereBuyA"},{question:"faq.buyers.whereUseQ",answer:"faq.buyers.whereUseA"},{question:"faq.buyers.expireQ",answer:"faq.buyers.expireA"},{question:"faq.buyers.transferQ",answer:"faq.buyers.transferA"}];function ie(d){const s=d;if((s==null?void 0:s.name)==="AbortError")return n("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?n("getCredits.errorSignIn",{currency:h.name}):f.includes("timed out")?n("getCredits.errorTimeout",{currency:h.name}):n("getCredits.errorGeneric")}function It(){var L;ge({title:n("nav.getCredits",{currency:h.name}),noindex:!0});const d=ue(),{session:s,signIn:f}=fe(),o=me(),[m,b]=xe(),{packs:$,isLoading:y}=ve(),[u,p]=l.useState("select"),[c,q]=l.useState(null),[j,E]=l.useState(null),de=(j!=null?(L=$.find(r=>r.credits===j))==null?void 0:L.artUrl:void 0)??Pe,[ce,k]=l.useState(null),[le,R]=l.useState(!1),T=l.useRef(null);l.useEffect(()=>()=>{var r;return(r=T.current)==null?void 0:r.abort()},[]);const W=l.useCallback(()=>{b(r=>{const a=new URLSearchParams(r);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[b]),_=l.useCallback(async r=>{p("processing");const a=new AbortController;T.current=a;try{const x=await Ce(r,{signal:a.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(x.status==="credited"){const w=x.creditsGranted??(c==null?void 0:c.credits)??0;E(w>0?w:null),p("success"),g("Shop Completed Buy Credits",{order_id:r,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem($e)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};d("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(D);if(S){sessionStorage.removeItem(D);const U=JSON.parse(S),M=be(U);if(M){d(M,{state:{item:U,resumeBuy:!0}});return}}}catch{}}else x.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),p("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(x.error??n("getCredits.errorGrant",{currency:h.name})),p("error"))}catch(x){G(x,{flow:"get_credits",step:"grant",order_id:r}),g("Shop Buy Credits Failed",{step:"grant",error_code:N(x),pack_usd:(c==null?void 0:c.usd)??null}),k(ie(x)),p("error")}},[c,s,o,d]),pe=l.useCallback(async r=>{if(!s){f();return}k(null),R(!1),q(r),p(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:C});try{const a=await je(r.id,{address:s.address,identity:s.identity});if(a.mock)_(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){G(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:N(a),pack_usd:r.usd}),k(ie(a)),p("error")}},[s,f,_]),B=l.useRef(!1),I=l.useRef(null);l.useEffect(()=>{if(B.current)return;const r=m.get("order");if(m.get("canceled")!=null){B.current=!0,g("Shop Buy Credits Cancelled",{order_id:r,provider:C}),r&&s&&we(r,s.identity),W(),R(!0),p("select");return}r&&(p("processing"),s&&(B.current=!0,W(),_(r)))},[m,s]);function z(){var r;(r=T.current)==null||r.abort(),p("select"),q(null),E(null),k(null),R(!1)}function he(){const r=I.current;if(!r)return;const a=window.matchMedia("(prefers-reduced-motion: reduce)").matches;r.scrollIntoView({behavior:a?"auto":"smooth",block:"center"}),r.focus({preventScroll:!0})}return t.jsxs(_e,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Be,{"data-testid":"credits-hero",children:[t.jsx(ze,{"aria-hidden":!0}),t.jsxs(Fe,{children:[t.jsxs(Ee,{$hidden:u==="redirecting",children:[t.jsxs(We,{children:[t.jsx(Ie,{children:n("getCredits.title")}),t.jsxs(Le,{children:[t.jsx(Ue,{children:n("getCredits.subtitle")}),t.jsx(Me,{type:"button",onClick:he,"data-testid":"credits-learn-more",children:n("getCredits.learnMore")})]})]}),le&&t.jsx(Ge,{role:"status",children:n("getCredits.canceledNote")}),t.jsx(Pt,{packs:$,loading:y,onSelect:r=>void pe(r)})]}),u==="redirecting"&&t.jsxs(tt,{role:"status","aria-live":"polite",children:[t.jsx(st,{src:H,alt:"",width:72,height:72}),t.jsx(it,{children:n("getCredits.redirecting")})]})]}),t.jsx(qe,{ref:I,tabIndex:-1,"data-testid":"credits-faq",children:t.jsx(ke,{title:"faq.title",entries:At,tone:"on-dark"})})]}),u==="processing"&&t.jsxs(nt,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:H,alt:"",width:61,height:61}),t.jsxs(ot,{children:[t.jsxs(at,{children:[t.jsx("strong",{children:n("getCredits.processing")}),"…"]}),t.jsxs(dt,{"aria-hidden":!0,children:[t.jsx(lt,{children:t.jsx(pt,{})}),t.jsx(ht,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(ut,{role:"status","aria-live":"polite",children:[t.jsxs(xt,{children:[t.jsx(gt,{src:Re,alt:"",width:60,height:60}),t.jsxs(ft,{children:[t.jsx("strong",{children:n("getCredits.successTitle")})," ",n("getCredits.successBody",{currency:h.name})]})]}),j!=null&&t.jsx(mt,{children:t.jsxs(bt,{children:[t.jsx(wt,{src:de,alt:"",width:93,height:93}),t.jsxs(yt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(kt,{children:n("getCredits.creditsAmount",{credits:j,currency:h.name})})," ",t.jsx(vt,{children:n("getCredits.creditsAdded")})]})]})]})}),t.jsxs(Ct,{children:[t.jsx(v,{"data-variant":"outline",onClick:z,children:n("getCredits.buyMore",{currency:h.name})}),t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(Z,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:n("getCredits.pendingTitle",{currency:h.name})}),t.jsx(et,{children:n("getCredits.pendingBody")}),t.jsxs(ee,{children:[t.jsx(v,{onClick:()=>d("/items"),children:n("getCredits.startShopping")}),t.jsx(v,{"data-variant":"outline",onClick:z,children:n("getCredits.done")})]})]}),u==="error"&&t.jsxs(Z,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:n("getCredits.errorTitle")}),t.jsx($t,{children:ce}),t.jsx(ee,{children:t.jsx(v,{onClick:z,children:n("getCredits.tryAgain")})})]})]})}function Pt({packs:d,loading:s,onSelect:f}){return s?t.jsx(O,{"aria-busy":"true","aria-label":n("getCredits.packsLoading",{currency:h.name}),children:[0,1,2,3].map(o=>t.jsxs(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsxs(X,{children:[t.jsx(Ye,{}),t.jsx(Xe,{})]}),t.jsx(Ze,{})]}),t.jsx(Je,{})]},o))}):t.jsx(O,{children:d.map((o,m)=>{const b=Ae(o,d);return t.jsxs(V,{type:"button","data-testid":"pack","data-best":o.bestValue?"true":void 0,onClick:()=>f(o),"aria-label":b?n("getCredits.packAriaBonus",{amount:Q(o.credits),usd:o.usd,bonus:b.bonus,baseline:b.baseline}):n("getCredits.packAria",{amount:Q(o.credits),usd:o.usd}),children:[o.bestValue&&t.jsxs(Ne,{children:[t.jsx(ye,{name:"star-rounded"}),n("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(X,{children:[t.jsxs(He,{children:[t.jsx(re,{}),t.jsx(Qe,{children:o.credits})]}),t.jsx(De,{children:n("getCredits.packUnit",{currency:h.name})})]}),t.jsx(Ke,{children:t.jsx("img",{src:St(o,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(o,m))}})})]}),t.jsxs(Oe,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{It as GetCredits,It as default};