@dcl/shop 0.8.0 → 0.8.1-31008797734.commit-eb2f6cb

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-BpEWDEgt.js → Activity-CapGczIs.js} +5 -5
  2. package/_assets/{AnimatedBackground-whCeMUgc.js → AnimatedBackground-1lH1wjHQ.js} +2 -2
  3. package/_assets/{Assets-CH4B54Xy.js → Assets-DhP8-4kD.js} +7 -7
  4. package/_assets/{Assets.styles-DuSEfvzx.js → Assets.styles-Bt-s2_ut.js} +2 -2
  5. package/_assets/{Authorizations-DTC0viZ7.js → Authorizations-C49I-wsa.js} +1 -1
  6. package/_assets/{Cart-Ccdz2uXK.js → Cart-R0jc0Mtq.js} +2 -2
  7. package/_assets/{CircularProgress-BkDrovgn.js → CircularProgress-oGVz5EPN.js} +1 -1
  8. package/_assets/{Collection-LGp9HIwD.js → Collection-BRryMeDA.js} +3 -3
  9. package/_assets/{CollectionCarousel-CnR1So5p.js → CollectionCarousel-DeIZf2z7.js} +22 -22
  10. package/_assets/{Creator-2jJw01qB.js → Creator-bjXQ5uOB.js} +21 -21
  11. package/_assets/{ErrorNotice-BXWX_0E4.js → ErrorNotice-CaJ4BfpX.js} +1 -1
  12. package/_assets/{ExchangeController-C_NxeYpZ.js → ExchangeController-ylaSPIVN.js} +1 -1
  13. package/_assets/{Faq-BXT0tU5Q.js → Faq-BlN_im0Z.js} +1 -1
  14. package/_assets/{GetCredits-CiVv6zS4.js → GetCredits-Bq109qIo.js} +1 -1
  15. package/_assets/{Grow-d2ucdHqS.js → Grow-AdrGqCKp.js} +1 -1
  16. package/_assets/{HelpersUtil-BsEaPmaI.js → HelpersUtil-DYRUV4ir.js} +1 -1
  17. package/_assets/{ItemDetail-BxGSP-it.js → ItemDetail-CqPBV2Z6.js} +1 -1
  18. package/_assets/LazyEmoteControls-CxMqk8Wm.js +2 -0
  19. package/_assets/{LoadMore-DcIHY8Kf.js → LoadMore-DcFUIXjj.js} +1 -1
  20. package/_assets/{ManaPricingBanner.styles-CxOm66Fo.js → ManaPricingBanner.styles-BO0m_Umj.js} +1 -1
  21. package/_assets/{MyAssets-BozGMHXd.js → MyAssets-BmFw49q2.js} +1 -1
  22. package/_assets/{MyFavorites-wLuasEwD.js → MyFavorites-6RxzTIj2.js} +1 -1
  23. package/_assets/{NotFound-D9deZR03.js → NotFound-B5SrDziU.js} +1 -1
  24. package/_assets/{NotificationsBell-DULYJmKs.js → NotificationsBell-Da1N_v4W.js} +1 -1
  25. package/_assets/{OutfitDetail-B28zoBrk.js → OutfitDetail-C9xS5y3b.js} +1 -1
  26. package/_assets/{OutfitPreview-GRiCEESc.js → OutfitPreview-BavGOcGw.js} +1 -1
  27. package/_assets/{OutfitStudio-D7500MAI.js → OutfitStudio-DvHI7hY9.js} +5 -5
  28. package/_assets/{StoreSettings-DK8rP1ia.js → StoreSettings-D59hqgX9.js} +1 -1
  29. package/_assets/{Success-zZ3HkHoh.js → Success-BgPzwWQz.js} +8 -8
  30. package/_assets/{SwapController-LhvwgYfv.js → SwapController-DDxe_vs9.js} +1 -1
  31. package/_assets/{Tooltip-Dh6dtNV3.js → Tooltip-DNaztCta.js} +1 -1
  32. package/_assets/{TradeService-DjBvwlyu.js → TradeService-CYH4QAmr.js} +1 -1
  33. package/_assets/{W3MFrameProviderSingleton-DyHElSGY.js → W3MFrameProviderSingleton-CpPJKj3w.js} +3 -3
  34. package/_assets/{WebCryptoP256-CGMChTjg.js → WebCryptoP256-C2RAff-9.js} +1 -1
  35. package/_assets/{authorizations-w-yCHVpU.js → authorizations-C14hLxR0.js} +1 -1
  36. package/_assets/{basic-BwriZEC-.js → basic-CdcRV_KC.js} +1 -1
  37. package/_assets/{biconomy-CeViGwXz.js → biconomy-CJTRSa73.js} +1 -1
  38. package/_assets/{builder-CYMYImB0.js → builder-DvCRptIy.js} +1 -1
  39. package/_assets/{buy-DIVuBMot.js → buy-BlM_W6kI.js} +1 -1
  40. package/_assets/{buy-gasless-DIfZSqYX.js → buy-gasless-BfGxYXhk.js} +1 -1
  41. package/_assets/{categories-BbYXk3ti.js → categories-BipVdfM3.js} +38 -32
  42. package/_assets/{ccip-CwIu0LfN.js → ccip-B45ZUnTU.js} +1 -1
  43. package/_assets/{ccip-Sex5PzD_.js → ccip-DaSXseHx.js} +1 -1
  44. package/_assets/{collectionPage.styles-CHbJGgda.js → collectionPage.styles-cfpY_oN5.js} +2 -2
  45. package/_assets/{controller-DfTp5YOO.js → controller-lZ2UgMCg.js} +2 -2
  46. package/_assets/{core-BEK9pA3q.js → core-BaJayjCH.js} +4 -4
  47. package/_assets/{createSvgIcon-CU05oHiV.js → createSvgIcon-DF7XmQgC.js} +1 -1
  48. package/_assets/{custom-BhGswfT_.js → custom-DHI2SWZb.js} +1 -1
  49. package/_assets/{data-capture-nvuZRuzg.js → data-capture-DRojwyQm.js} +1 -1
  50. package/_assets/{email-CieTjR51.js → email-DbjLMCR0.js} +1 -1
  51. package/_assets/{embedded-wallet-CI-r3uDX.js → embedded-wallet-s2SLkWS-.js} +1 -1
  52. package/_assets/{emotion-styled.browser.esm-BlQXcSKx.js → emotion-styled.browser.esm-BvuB9FLv.js} +1 -1
  53. package/_assets/{engine-CHP2eI44.js → engine-C8CwR5vD.js} +1 -1
  54. package/_assets/{errors-BAqCaL6O.js → errors-CkpBP_qL.js} +1 -1
  55. package/_assets/{estimate-l1-fee-D_pdXw9y.js → estimate-l1-fee-sC2wMHxF.js} +1 -1
  56. package/_assets/{execute-BJuyrz_X.js → execute-DfFT0VMF.js} +2 -2
  57. package/_assets/{features-B9o2bxOE.js → features-B4j4EiIm.js} +1 -1
  58. package/_assets/{fetchTokenMetadata-DeEXEM9T.js → fetchTokenMetadata-JvX58EZZ.js} +2 -2
  59. package/_assets/{field.styles-BYH2xB5-.js → field.styles-DT9c-jpk.js} +1 -1
  60. package/_assets/{get-ecosystem-wallet-info-C5KzHIh2.js → get-ecosystem-wallet-info-p-wvOd7m.js} +1 -1
  61. package/_assets/{getBalance-pkY6oxRI.js → getBalance-C7PDKGyV.js} +1 -1
  62. package/_assets/{getNFT-BXJA28mr.js → getNFT-CeUHNQkH.js} +1 -1
  63. package/_assets/{getNFT-CYm9n3Xd.js → getNFT-unPO0gFo.js} +1 -1
  64. package/_assets/{grid.styles-DoBUqqdT.js → grid.styles--OULZO8_.js} +1 -1
  65. package/_assets/{hashTypedData-ONHChmVW.js → hashTypedData-BFsuXzQL.js} +1 -1
  66. package/_assets/{hashTypedData-DpkGfcdz.js → hashTypedData-kUbQfEXm.js} +1 -1
  67. package/_assets/{in-app-GxZkDa12.js → in-app-DWfmO8Q_.js} +1 -1
  68. package/_assets/{in-app-wallet-calls-B91UMKOr.js → in-app-wallet-calls-8wNNNyL8.js} +1 -1
  69. package/_assets/{index--dDDhPCb.js → index-9X8Ovbfy.js} +1 -1
  70. package/_assets/{index-Bzt1xZyM.js → index-B21P_cdc.js} +1 -1
  71. package/_assets/{index-CMV7iaeR.js → index-B30SuUvk.js} +1 -1
  72. package/_assets/{index-OqCfgEJv.js → index-B5V2Mfv7.js} +1 -1
  73. package/_assets/{index-Bk7mlw_4.js → index-B5dmZpx0.js} +1 -1
  74. package/_assets/{index-BX8-GtYO.js → index-B6GXvxon.js} +3 -3
  75. package/_assets/{index-_943ql8C.js → index-B88q9WNj.js} +1 -1
  76. package/_assets/{index-CtybxktV.js → index-BL4gRYk8.js} +1 -1
  77. package/_assets/{index-L_H5aHd6.js → index-BLkWo_Go.js} +1 -1
  78. package/_assets/{index-OxDwxhIP.js → index-BSytKqYf.js} +1 -1
  79. package/_assets/index-BX2ff1lz.js +3390 -0
  80. package/_assets/{index-E7P9-xl1.js → index-BaUjL_QW.js} +1 -1
  81. package/_assets/{index-B6MX4qjW.js → index-BdDjhXGr.js} +3 -3
  82. package/_assets/{index-DhNV3-07.js → index-Bmwk_FdV.js} +1 -1
  83. package/_assets/{index-C5F4093w.js → index-BpqWJGbO.js} +1 -1
  84. package/_assets/{index-BpBengnA.js → index-Br42MJqt.js} +1 -1
  85. package/_assets/{index-B-FT9tly.js → index-Bx-jvfF5.js} +1 -1
  86. package/_assets/{index-DxSEHau1.js → index-C9dJz7_C.js} +1 -1
  87. package/_assets/{index-l4-9ZZLe.js → index-CFZPZumX.js} +3 -3
  88. package/_assets/{index-CrYXAQF7.js → index-CHeOAb8t.js} +1 -1
  89. package/_assets/{index-BYlZ9YbP.js → index-CJxN46d5.js} +1 -1
  90. package/_assets/{index-BWh4oQv2.js → index-CO7DPL5n.js} +1 -1
  91. package/_assets/{index-D3BUTCsu.js → index-CRSZ3s2j.js} +1 -1
  92. package/_assets/{index-73vZ1csI.js → index-CgsHuxXG.js} +1 -1
  93. package/_assets/{index-8TbyLPoA.js → index-ChoD4sDT.js} +2 -2
  94. package/_assets/{index-Cakc_FOK.js → index-Ct7WFTlN.js} +1 -1
  95. package/_assets/{index-DMNGIYYv.js → index-CyKbrkx3.js} +1 -1
  96. package/_assets/{index-BH5LU_4T.js → index-CzMPXy_5.js} +1 -1
  97. package/_assets/{index-BACQuryf.js → index-CzdGMX6J.js} +1 -1
  98. package/_assets/{index-BsE741-i.js → index-D2BcAgcM.js} +1 -1
  99. package/_assets/{index-Bk_uITsR.js → index-D4g9OvJl.js} +1 -1
  100. package/_assets/{index-DGI43LaB.js → index-D9iz0e2C.js} +1 -1
  101. package/_assets/{index-JweqbyGF.js → index-DEixw9nt.js} +2 -2
  102. package/_assets/{index-DOiEVNYb.js → index-DKNHcW37.js} +1 -1
  103. package/_assets/{index-CRQCirWA.js → index-DWj4wDAA.js} +1 -1
  104. package/_assets/{index-BFFeuHAN.js → index-Dqvb_KIH.js} +1 -1
  105. package/_assets/{index-Bmq5dKA-.js → index-DrfYWb8y.js} +1 -1
  106. package/_assets/{index-B49Ra42Y.js → index-DwGUnOIf.js} +2 -2
  107. package/_assets/{index-DPmmgd_P.js → index-DzC2inVj.js} +1 -1
  108. package/_assets/{index-__99MHKr.js → index-IMydr643.js} +2 -2
  109. package/_assets/{index-Cu9CgJO0.js → index-LvIL_l-n.js} +1 -1
  110. package/_assets/{index-D4Aqu34H.js → index-SoZBe0_y.js} +1 -1
  111. package/_assets/{index-De1oZcbD.js → index-ZfyGtYO-.js} +7 -7
  112. package/_assets/{index-BJM0Y8Dj.js → index-gtKOmjie.js} +1 -1
  113. package/_assets/{index-t0T-6ZrA.js → index-iKntYXVT.js} +1 -1
  114. package/_assets/{index-INHGq5Es.js → index-jlroLVaQ.js} +1 -1
  115. package/_assets/{index-DEPPVv3y.js → index-k4pqNBN1.js} +3 -3
  116. package/_assets/{index-DOxWmjOH.js → index-oi06tQTW.js} +1 -1
  117. package/_assets/{index-BkDtNpJ9.js → index-t7HoEVst.js} +1 -1
  118. package/_assets/{index-B4d9kGHc.js → index-u7rLkjFo.js} +1 -1
  119. package/_assets/{index-CIQQJerR.js → index-ukEGQ13w.js} +1 -1
  120. package/_assets/{index-5GNI01Ww.js → index-z4ApZl83.js} +1 -1
  121. package/_assets/{index.es-DD8zy1OU.js → index.es-BQKIKl0W.js} +1 -1
  122. package/_assets/{index.es-DdtYF7po.js → index.es-BfIGmWDo.js} +1 -1
  123. package/_assets/{index.es-7bD3vSL6.js → index.es-q4rveQRm.js} +4 -4
  124. package/_assets/{localBatchGatewayRequest-Cqcm6wSH.js → localBatchGatewayRequest-CAHKJ55d.js} +1 -1
  125. package/_assets/{networks-BsQOwKdI.js → networks-DS2vXM8O.js} +1 -1
  126. package/_assets/{onramp-CutBYUPg.js → onramp-mbiOwW7h.js} +1 -1
  127. package/_assets/{openzeppelin-K-AgEyIf.js → openzeppelin-BQFFlT7c.js} +1 -1
  128. package/_assets/{parseNft-pYm9OVKe.js → parseNft-nX_I3xp0.js} +2 -2
  129. package/_assets/{parseSignature-BrLHTUOQ.js → parseSignature-Ch9ppofj.js} +3 -3
  130. package/_assets/{parseSignature-DnyPA3OO.js → parseSignature-D0_O5-co.js} +1 -1
  131. package/_assets/{passkeys-zi3xVlV1.js → passkeys-DRknHpBt.js} +1 -1
  132. package/_assets/{pay-with-exchange-pvINEHpN.js → pay-with-exchange-Dn_V8cBw.js} +1 -1
  133. package/_assets/{qr-overlay-CLKlyiw2.js → qr-overlay-DbswS99M.js} +1 -1
  134. package/_assets/{receive-BLXAcZ6B.js → receive-oTJ8Y5Fv.js} +1 -1
  135. package/_assets/{resolveImplementation-CfgIWk0L.js → resolveImplementation-LBp3vWrw.js} +1 -1
  136. package/_assets/{rpc-C2ZJH6qL.js → rpc-BnQU2Nrx.js} +1 -1
  137. package/_assets/{secp256k1-BPdRWJXL.js → secp256k1-BWXLazAv.js} +1 -1
  138. package/_assets/{secp256k1--GaGebUJ.js → secp256k1-BkFY1jqh.js} +1 -1
  139. package/_assets/{secp256k1-DQNL-k-L.js → secp256k1-C_L-TT77.js} +1 -1
  140. package/_assets/{send-Cl_aA-ga.js → send-BPCyi9TB.js} +1 -1
  141. package/_assets/{send-batch-transaction-1ElceULH.js → send-batch-transaction-mY-UiFOT.js} +1 -1
  142. package/_assets/{send-eip712-transaction-BV_DsAbU.js → send-eip712-transaction-DRfPDTLF.js} +2 -2
  143. package/_assets/{send-gasless-transaction-eTi92Rfc.js → send-gasless-transaction-CQvMS02f.js} +2 -2
  144. package/_assets/{send-transaction-DWimy5qX.js → send-transaction-DCAhhidV.js} +2 -2
  145. package/_assets/{sendMetaTransaction-B6HBQ8NH.js → sendMetaTransaction-DtQHFBj2.js} +1 -1
  146. package/_assets/{sendRawTransaction-6C6FbT-9.js → sendRawTransaction-_EHuG-5K.js} +3 -3
  147. package/_assets/{serializeTransaction-DJpTnAzh.js → serializeTransaction-CIlFTvLD.js} +1 -1
  148. package/_assets/{session-proposal-B1fE_9QJ.js → session-proposal-Kaq1rakL.js} +1 -1
  149. package/_assets/{session-request-DVlIT2Cz.js → session-request-Bhg3VOB_.js} +2 -2
  150. package/_assets/{signing-C2OtEE_7.js → signing-A5julnDu.js} +3 -3
  151. package/_assets/{socials-CwiK-Oz5.js → socials-DtoQHgT-.js} +1 -1
  152. package/_assets/{styled-INC_AiMB.js → styled-B_wXmJ0m.js} +2 -2
  153. package/_assets/{swaps-Cz6uslns.js → swaps-BovUfBzi.js} +1 -1
  154. package/_assets/{thirdweb-QagPg_5G.js → thirdweb-B9JJ0CvC.js} +3 -3
  155. package/_assets/{to-serializable-transaction-CI3ePtUl.js → to-serializable-transaction-Y_vwOVtu.js} +2 -2
  156. package/_assets/{transactionReceipt-B2jt8_c5.js → transactionReceipt-B9cYMakC.js} +1 -1
  157. package/_assets/{transactions-DuxoNdoM.js → transactions-CyD4useP.js} +1 -1
  158. package/_assets/{useCreditPacks-CeoLpXxe.js → useCreditPacks-CDKB1mCH.js} +1 -1
  159. package/_assets/{useImportable-CHlGR9sz.js → useImportable-DeC43rHX.js} +1 -1
  160. package/_assets/{useInfiniteGrid-D9jUBgv1.js → useInfiniteGrid-LaB4F8oP.js} +1 -1
  161. package/_assets/{useTheme-HGI9qk_L.js → useTheme-B1VaWl6j.js} +1 -1
  162. package/_assets/{verifyHash-BWYK-_oQ.js → verifyHash-CkHXeOHN.js} +1 -1
  163. package/_assets/{w3m-modal-DeCOfGwP.js → w3m-modal-BQ-Br_Vq.js} +1 -1
  164. package/_assets/{w3m-modal-C_cXhjYQ.js → w3m-modal-C7ksBSKz.js} +1 -1
  165. package/_assets/{wait-for-tx-receipt-D52q1hNL.js → wait-for-tx-receipt-Cs1Rwwd_.js} +1 -1
  166. package/_assets/{wallets-BiRgfoDB.js → wallets-DUO7Hcth.js} +5 -5
  167. package/_assets/{web-connector-CI1NmWV2.js → web-connector-Dqtd76KB.js} +3 -3
  168. package/_assets/{writeContract-J3cBsNY4.js → writeContract-XtplIyls.js} +1 -1
  169. package/_assets/{zoraTestnet-zRF1Vikt.js → zoraTestnet-BDLSoP78.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/_assets/LazyEmoteControls-D7IWhRxC.js +0 -2
  173. package/_assets/index-DbCMsBDL.js +0 -3504
@@ -1,10 +1,10 @@
1
- import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as k,aA as j,bR as C,C as G,o as Y,I as Q,A as X,g as W,e as B,d as Z,a2 as q,bV as F,al as J}from"./index-DbCMsBDL.js";import{s as ee,j as U,A as H,g as K,r as te,m as ne,n as ae,o as ie,k as oe}from"./authorizations-w-yCHVpU.js";import{i as se}from"./errors-BAqCaL6O.js";import{E as re}from"./ErrorNotice-BXWX_0E4.js";import{l as ce,m as de,n as le}from"./buy-DIVuBMot.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-B6HBQ8NH.js";import{I as xe,C as ge}from"./ethers-DejfrZ8i.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 M(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-DehiWSvs.js";import{s as e,t as o,b as f,w as k,az as j,bQ as C,C as G,o as Y,I as Q,A as X,g as W,e as B,d as Z,a2 as q,bU as F,ak as J}from"./index-BX2ff1lz.js";import{s as ee,j as U,A as H,g as K,r as te,m as ne,n as ae,o as ie,k as oe}from"./authorizations-C14hLxR0.js";import{i as se}from"./errors-CkpBP_qL.js";import{E as re}from"./ErrorNotice-CaJ4BfpX.js";import{l as ce,m as de,n as le}from"./buy-BlM_W6kI.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-DtQHFBj2.js";import{I as xe,C as ge}from"./ethers-DejfrZ8i.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
- `,V=`
7
+ `,_=`
8
8
  width: 100%;
9
9
  min-height: 56px;
10
10
  display: flex;
@@ -36,20 +36,20 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
36
36
  cursor: default;
37
37
  }
38
38
  `,ve=e.button`
39
- ${V}
39
+ ${_}
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
- ${V}
46
+ ${_}
47
47
  background: ${o.colors.text2};
48
48
 
49
49
  &:hover:not(:disabled) {
50
50
  background: ${o.colors.gray0};
51
51
  }
52
- `,z=e.span`
52
+ `,M=e.span`
53
53
  display: inline-flex;
54
54
  align-items: center;
55
55
  gap: 6px;
@@ -109,9 +109,9 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w 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(z,{children:[t.jsx(k,{}),t.jsx("span",{children:j(M(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(z,{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(z,{children:[t.jsx(k,{}),t.jsx("span",{children:j(M(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(z,{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(M(p.manaCents)),price:j(M(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 Me=Y`
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
- `,ze=e.div`
114
+ `,Me=e.div`
115
115
  position: fixed;
116
116
  inset: 0;
117
117
  z-index: 10000;
@@ -284,12 +284,12 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
284
284
  border-radius: 50%;
285
285
  border: 2px solid rgba(255, 255, 255, 0.5);
286
286
  border-top-color: ${o.colors.white};
287
- animation: ${Me} 0.7s linear infinite;
287
+ animation: ${ze} 0.7s linear infinite;
288
288
 
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 ee({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(ze,{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(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"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(K.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=te(),$=ne(s.provider,m),h=await pe($,m,d,p,{serverURL:K.relayerUrl});return l==null||l(),await ae(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(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`
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 ee({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(Ke,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(De,{"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(K.enabled)try{const d=new xe(p.abi).encodeFunctionData("accept",[u]),m=te(),$=ne(s.provider,m),h=await pe($,m,d,p,{serverURL:K.relayerUrl});return l==null||l(),await ae(h,"the MANA purchase"),h}catch(d){if(d instanceof he&&d.code===ue.USER_DENIED||d instanceof ie)throw d;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",d)}await oe(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`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${He.overlay};
@@ -341,13 +341,13 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
341
341
  align-items: flex-start;
342
342
  justify-content: space-between;
343
343
  gap: 8px;
344
- `,Mt=e.h2`
344
+ `,zt=e.h2`
345
345
  margin: 0;
346
346
  font-size: 20px;
347
347
  font-weight: 600;
348
348
  line-height: 1.6;
349
349
  color: ${r.text};
350
- `,zt=e.button`
350
+ `,Mt=e.button`
351
351
  flex-shrink: 0;
352
352
  border: 0;
353
353
  background: transparent;
@@ -446,7 +446,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
446
446
  gap: 8px;
447
447
  justify-content: center;
448
448
  background: rgba(255, 162, 90, 0.3);
449
- border-radius: ${O.btn};
449
+ border-radius: ${V.btn};
450
450
  padding: 12px 8px;
451
451
  `,Dt=e.p`
452
452
  margin: 0;
@@ -481,14 +481,14 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
481
481
  width: 24px;
482
482
  height: 24px;
483
483
  background: ${r.text};
484
- `,Vt=e.span`
484
+ `,_t=e.span`
485
485
  font-size: 24px;
486
486
  font-weight: 500;
487
487
  color: ${r.text};
488
- `,_t=e.span`
488
+ `,Ot=e.span`
489
489
  font-size: 14px;
490
490
  color: ${r.text};
491
- `,Ot=e.div`
491
+ `,Vt=e.div`
492
492
  display: flex;
493
493
  align-items: center;
494
494
  justify-content: space-between;
@@ -522,7 +522,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w 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: ${O.btn};
525
+ border-radius: ${V.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-DehiWSvs.js";import{s as e,t as o,b as f,w as
538
538
  width: 100%;
539
539
  }
540
540
  &[data-variant='gradient'] {
541
- background: ${_.amethyst};
541
+ background: ${O.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-DehiWSvs.js";import{s as e,t as o,b as f,w as
606
606
  height: 100%;
607
607
  width: 40%;
608
608
  border-radius: 100px;
609
- background: ${_.amethyst};
609
+ background: ${O.amethyst};
610
610
  animation: buy-modal-progress 1.1s ease-in-out infinite;
611
611
 
612
612
  @keyframes buy-modal-progress {
@@ -665,14 +665,14 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w as
665
665
  text-align: center;
666
666
  }
667
667
  }
668
- `,{colors:I,media:A}=o,Ve=e.section`
668
+ `,{colors:I,media:A}=o,_e=e.section`
669
669
  margin-top: 40px;
670
- `,_e=e.div`
670
+ `,Oe=e.div`
671
671
  display: flex;
672
672
  align-items: center;
673
673
  justify-content: space-between;
674
674
  margin-bottom: 20px;
675
- `,Oe=e.h2`
675
+ `,Ve=e.h2`
676
676
  font-size: 22px;
677
677
  font-weight: 700;
678
678
  color: ${I.text};
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as f,w 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(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(D,{"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(J,{item:h},h.id))}),t.jsx(D,{"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{M 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,Mt as T,ct as U,gt as V,Kt as W,zt 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,Dt 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(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{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(D,{"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(J,{item:h},h.id))}),t.jsx(D,{"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,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,Kt 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,Dt 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{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";import{t as ge,F as Be,H as re,G as se,s as i,bB as _e,az as Te,bC as We,b as o,bD as De,bE as ie,B as Ge,ae as fe,V as be,bo as Oe,k as Ke,y as we,bv as qe,bp as He,bq as Ue,I as ae,c as Ve,q as Qe,n as Ye,af as Ze,ai as Je,aj as Xe,ak as A,al as ne,bF as le,bG as et}from"./index-DbCMsBDL.js";import{d as tt,P as ot,C as rt,a as st,b as it,A as at,c as nt,e as lt}from"./collectionPage.styles-CHbJGgda.js";import{g as ct,h as dt,i as ht,j as mt,k as ut,C as xt,l as pt,o as gt,m as ft,n as bt,M as wt,E as vt,p as jt,q as yt,r as Ct,s as kt,t as $t}from"./Assets.styles-DuSEfvzx.js";import{S as ce,R as St,F as Nt,d as Et}from"./categories-BbYXk3ti.js";import{L as de}from"./LoadMore-DcIHY8Kf.js";import{u as he}from"./useInfiniteGrid-D9jUBgv1.js";import{E as W}from"./ErrorNotice-BXWX_0E4.js";import{G as me}from"./grid.styles-DoBUqqdT.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./Tooltip-Dh6dtNV3.js";function Pt(r){const{gridLoading:s,gridError:a,gridCount:n,baselinePending:l,baselineError:c,baselineCount:m}=r;return s?"skeletons":a?"error":n>0?"items":l?"skeletons":c?"error":m===0?"no-creations":"filters"}const{colors:b,radius:ve,media:Ft}=ge,Lt=i.article`
1
+ import{d as pe,j as e,L as Ie,u as Me,e as Be,r as g}from"./react-DehiWSvs.js";import{t as ge,F as ze,H as re,G as se,s as i,bA as _e,ay as Te,bB as We,b as o,bC as De,bD as ie,B as Ge,ae as fe,V as be,bn as Oe,k as Ke,y as we,bu as He,bo as Ue,bp as qe,I as ae,c as Ve,q as Qe,n as Ye,af as Ze,ah as Je,ai as Xe,aj as A,ak as ne,bE as le,bF as et}from"./index-BX2ff1lz.js";import{d as tt,P as ot,C as rt,a as st,b as it,A as at,c as nt,e as lt}from"./collectionPage.styles-cfpY_oN5.js";import{g as ct,h as dt,i as ht,j as mt,k as ut,C as xt,l as pt,o as gt,m as ft,n as bt,M as wt,E as jt,p as vt,q as yt,r as Ct,s as kt,t as $t}from"./Assets.styles-Bt-s2_ut.js";import{S as ce,R as St,F as Nt,e as Et}from"./categories-BipVdfM3.js";import{L as de}from"./LoadMore-DcFUIXjj.js";import{u as he}from"./useInfiniteGrid-LaB4F8oP.js";import{E as W}from"./ErrorNotice-CaJ4BfpX.js";import{G as me}from"./grid.styles--OULZO8_.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";import"./Tooltip-DNaztCta.js";function Pt(r){const{gridLoading:s,gridError:a,gridCount:n,baselinePending:l,baselineError:c,baselineCount:m}=r;return s?"skeletons":a?"error":n>0?"items":l?"skeletons":c?"error":m===0?"no-creations":"filters"}const{colors:b,radius:je,media:Ft}=ge,Lt=i.article`
2
2
  height: 300px;
3
3
  background: ${b.bg};
4
- border-radius: ${ve.card};
4
+ border-radius: ${je.card};
5
5
  overflow: hidden;
6
6
  position: relative;
7
7
  isolation: isolate;
@@ -11,7 +11,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
11
11
  transition: box-shadow 0.15s ease;
12
12
 
13
13
  &::after {
14
- ${Be};
14
+ ${ze};
15
15
  }
16
16
 
17
17
  &:focus-visible {
@@ -61,7 +61,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
61
61
  display: flex;
62
62
  flex-direction: column;
63
63
  gap: 8px;
64
- `,zt=i.h3`
64
+ `,Bt=i.h3`
65
65
  margin: 0;
66
66
  font-weight: 700;
67
67
  font-size: 18px;
@@ -74,7 +74,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
74
74
  ${Ft.maxWidth("mobile")} {
75
75
  font-size: 16px;
76
76
  }
77
- `,Bt=i.div`
77
+ `,zt=i.div`
78
78
  flex: 1;
79
79
  min-height: 0;
80
80
  display: grid;
@@ -122,7 +122,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
122
122
  background: ${b.accent};
123
123
  color: ${b.softWhite};
124
124
  border: 0;
125
- border-radius: ${ve.btn};
125
+ border-radius: ${je.btn};
126
126
  font-weight: 700;
127
127
  font-size: 13px;
128
128
  text-transform: uppercase;
@@ -135,14 +135,14 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
135
135
  &:active {
136
136
  background: ${b.accentActive};
137
137
  }
138
- `;function Ot({collection:r,cover:s,itemCount:a}){const n=pe(),{contractAddress:l,name:c,creator:m}=r,C=s==null||a==null,{data:u}=We(l,C),v=s==null?(u==null?void 0:u.items)??[]:[],f=a??(u==null?void 0:u.total);function w(){n(`/collection/${l}`)}return e.jsxs(Lt,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:w,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),w())},children:[e.jsx(At,{children:s?e.jsx(Rt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):v.length>0?e.jsx(It,{items:v,tinted:!1}):null}),e.jsxs(Mt,{children:[e.jsx(zt,{title:c,children:c}),e.jsxs(Bt,{children:[e.jsxs(_t,{"data-meta":!0,"data-testid":"coll-card-meta",children:[m?e.jsx(Tt,{address:m,linkToProfile:!0}):e.jsx(Wt,{children:" "}),e.jsx(Dt,{children:f==null?"…":o("collectionCard.itemCount",{count:f})})]}),e.jsx(Gt,{"data-view":!0,"data-testid":"coll-card-view",onClick:x=>{x.stopPropagation(),w()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Kt({address:r,className:s=""}){const a=De(),n=ie(c=>c.followed.includes(r.toLowerCase())),l=ie(c=>c.toggle);return!a||!r?null:e.jsx(Ge,{type:"button",size:"sm",variant:n?"ghost":"outline",className:s||void 0,"data-testid":"follow-button","aria-pressed":n,title:n?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>l(r),children:n?o("creator.following"):o("creator.follow")})}const{colors:y,radius:je,media:j}=ge,ye=fe`
138
+ `;function Ot({collection:r,cover:s,itemCount:a}){const n=pe(),{contractAddress:l,name:c,creator:m}=r,C=s==null||a==null,{data:u}=We(l,C),j=s==null?(u==null?void 0:u.items)??[]:[],f=a??(u==null?void 0:u.total);function w(){n(`/collection/${l}`)}return e.jsxs(Lt,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:w,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),w())},children:[e.jsx(At,{children:s?e.jsx(Rt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):j.length>0?e.jsx(It,{items:j,tinted:!1}):null}),e.jsxs(Mt,{children:[e.jsx(Bt,{title:c,children:c}),e.jsxs(zt,{children:[e.jsxs(_t,{"data-meta":!0,"data-testid":"coll-card-meta",children:[m?e.jsx(Tt,{address:m,linkToProfile:!0}):e.jsx(Wt,{children:" "}),e.jsx(Dt,{children:f==null?"…":o("collectionCard.itemCount",{count:f})})]}),e.jsx(Gt,{"data-view":!0,"data-testid":"coll-card-view",onClick:x=>{x.stopPropagation(),w()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Kt({address:r,className:s=""}){const a=De(),n=ie(c=>c.followed.includes(r.toLowerCase())),l=ie(c=>c.toggle);return!a||!r?null:e.jsx(Ge,{type:"button",size:"sm",variant:n?"ghost":"outline",className:s||void 0,"data-testid":"follow-button","aria-pressed":n,title:n?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>l(r),children:n?o("creator.following"):o("creator.follow")})}const{colors:y,radius:ve,media:v}=ge,ye=fe`
139
139
  display: inline-flex;
140
140
  align-items: center;
141
141
  justify-content: center;
142
142
  height: 44px;
143
143
  padding: 0 28px;
144
144
  border: 2px solid ${y.white};
145
- border-radius: ${je.btn};
145
+ border-radius: ${ve.btn};
146
146
  background: transparent;
147
147
  color: ${y.white};
148
148
  font-weight: 600;
@@ -150,9 +150,9 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
150
150
  text-transform: uppercase;
151
151
  letter-spacing: 0.046em;
152
152
  text-decoration: none;
153
- `,qt=i.section`
153
+ `,Ht=i.section`
154
154
  position: relative;
155
- border-radius: ${je.card};
155
+ border-radius: ${ve.card};
156
156
  overflow: hidden;
157
157
  margin-bottom: 24px;
158
158
  min-height: 360px;
@@ -167,14 +167,14 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
167
167
  background: rgba(255, 255, 255, 0.14);
168
168
  }
169
169
 
170
- ${j.maxWidth("mobile")} {
170
+ ${v.maxWidth("mobile")} {
171
171
  min-height: 260px;
172
172
  }
173
- `,Ht=i.div`
173
+ `,Ut=i.div`
174
174
  position: absolute;
175
175
  inset: 0;
176
176
  z-index: 0;
177
- `,Ut=i.img`
177
+ `,qt=i.img`
178
178
  width: 100%;
179
179
  height: 100%;
180
180
  object-fit: cover;
@@ -192,7 +192,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
192
192
  align-items: center;
193
193
  gap: 8px;
194
194
 
195
- ${j.maxWidth("mobile")} {
195
+ ${v.maxWidth("mobile")} {
196
196
  top: 12px;
197
197
  right: 12px;
198
198
  gap: 6px;
@@ -211,7 +211,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
211
211
  width: 36px;
212
212
  height: 36px;
213
213
  }
214
- ${j.maxWidth("mobile")} {
214
+ ${v.maxWidth("mobile")} {
215
215
  & .ico {
216
216
  width: 30px;
217
217
  height: 30px;
@@ -235,7 +235,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
235
235
  width: 16px;
236
236
  height: 16px;
237
237
  }
238
- ${j.maxWidth("mobile")} {
238
+ ${v.maxWidth("mobile")} {
239
239
  width: 28px;
240
240
  height: 28px;
241
241
  & .ico {
@@ -253,7 +253,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
253
253
  gap: 24px;
254
254
  padding: 32px 20px;
255
255
 
256
- ${j.maxWidth("mobile")} {
256
+ ${v.maxWidth("mobile")} {
257
257
  padding: 56px 16px 24px;
258
258
  }
259
259
  `,ue=i.img`
@@ -266,7 +266,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
266
266
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
267
267
  background: #ff4bed;
268
268
 
269
- ${j.maxWidth("mobile")} {
269
+ ${v.maxWidth("mobile")} {
270
270
  width: 88px;
271
271
  height: 88px;
272
272
  }
@@ -277,7 +277,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
277
277
  color: ${y.white};
278
278
  line-height: 1.6;
279
279
 
280
- ${j.maxWidth("mobile")} {
280
+ ${v.maxWidth("mobile")} {
281
281
  font-size: 16px;
282
282
  }
283
283
  `,eo=i.p`
@@ -287,7 +287,7 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
287
287
  line-height: 1.6;
288
288
  max-width: 520px;
289
289
 
290
- ${j.maxWidth("mobile")} {
290
+ ${v.maxWidth("mobile")} {
291
291
  font-size: 14px;
292
292
  }
293
293
  `,to=i.div`
@@ -303,4 +303,4 @@ import{d as pe,j as e,L as Ie,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";i
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,ro={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function so({address:r}){var x,k;const{data:s}=be(r),{data:a}=Oe(r),n=Ke(d=>{var $;return($=d.session)==null?void 0:$.address}),l=!!n&&n.toLowerCase()===r.toLowerCase(),c=(s==null?void 0:s.name)||we(r),m=(k=(x=s==null?void 0:s.avatar)==null?void 0:x.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||tt,u=a==null?void 0:a.description,v=`${Ve.profileUrl}/${r}`,f=qe.filter(d=>a==null?void 0:a.links[d]),w=He(Ue({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(qt,{"aria-label":`${c} storefront`,children:[e.jsxs(Ht,{children:[e.jsx(Ut,{src:C,alt:"",loading:"eager"}),e.jsx(Vt,{"aria-hidden":!0})]}),(f.length>0||l)&&e.jsxs(Qt,{children:[f.map(d=>e.jsx(Yt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[d])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${d}`),"aria-label":o(`creator.link.${d}`),children:e.jsx(ae,{name:ro[d]})},d)),l&&e.jsx(Zt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(ae,{name:"pen"})})]}),e.jsxs(Jt,{children:[m?e.jsx(ue,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(ue,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Xt,{children:c}),u?e.jsx(eo,{children:u}):null]}),e.jsxs(to,{children:[e.jsx(oo,{"data-testid":"creator-hero-view",href:v,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Kt,{address:r,className:"creator-hero__follow"})]})]})]})}const xe=48;function vo(){var te,oe;const{address:r}=Me(),s=pe(),[a]=ze(),n=a.has("collections"),{data:l}=be(r),c=(l==null?void 0:l.name)||(r?we(r):o("creator.fallbackName"));Qe({title:c,description:o("seo.creator.description",{name:c}),image:(oe=(te=l==null?void 0:l.avatar)==null?void 0:te.snapshots)==null?void 0:oe.face256});const[m,C]=g.useState("all"),[u,v]=g.useState(null),[f,w]=g.useState([]),[x,k]=g.useState(""),[d,$]=g.useState(""),[N,R]=g.useState("all"),[I,M]=g.useState(!1),[D,ke]=g.useState("newest"),[P,E]=g.useState(!1);g.useEffect(()=>{if(!P)return;const t=T=>{T.key==="Escape"&&E(!1)};document.addEventListener("keydown",t);const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=h}},[P]);const G=x&&!Number.isNaN(Number(x))?Number(x):void 0,O=d&&!Number.isNaN(Number(d))?Number(d):void 0,$e=u?Et[u]:void 0,Se=(ce.find(t=>t.key===D)??ce[0]).server,K={creator:r,category:m,rarities:f.length?f:void 0,wearableCategories:$e,minPriceCredits:G,maxPriceCredits:O,isWearableSmart:I||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:Se},{items:z,total:Ne,isLoading:Ee,isPlaceholderData:Pe,error:q,hasNextPage:Fe,isFetchingNextPage:H,isFetchNextPageError:Le,fetchNextPage:Ae}=he(["creator-items",K],t=>le({...K,first:xe,skip:t}),{enabled:!!r&&!n}),F=Ye({queryKey:["creator-item-count",r],queryFn:()=>le({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=he(["creator-collections",r],t=>et(r,{first:xe,skip:t}).then(h=>({items:h.collections,total:h.total})),{enabled:!!r&&n});function U(t){C(t),v(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const h=t.toString();s({search:h?`?${h}`:""},{replace:!0})}function Re(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const h=t.toString();s({search:h?`?${h}&collections`:"?collections"},{replace:!0})}function Q(t){w(h=>h.includes(t)?h.filter(T=>T!==t):[...h,t])}function Y(){C("all"),v(null),w([]),k(""),$(""),R("all"),M(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>U("all")}),(G!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of St)f.includes(t)&&S.push({key:`rarity-${t}`,label:Ze(t),onRemove:()=>Q(t)});I&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>M(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>R("all")});const L=Pt({gridLoading:Ee||Pe,gridError:!!q,gridCount:z.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),B=L==="skeletons",{data:Z}=Je(),J=g.useMemo(()=>z.map(t=>({...t,priceCredits:Xe(t,Z)})),[z,Z]),X=t=>t.priceCredits>0||!!t.manaWei,ee=J.filter(X),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(ot,{children:[e.jsxs(rt,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(st,{onClick:()=>s("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(it,{children:c})]}),r?e.jsx(so,{address:r}):null,!n&&!B&&ee.length>0?e.jsx(at,{items:ee,source:"creator"}):null,e.jsxs(ct,{children:[P?e.jsx(dt,{onClick:()=>E(!1),"aria-hidden":!0}):null,e.jsxs(ht,{"data-open":P||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(mt,{children:[e.jsx(ut,{children:o("assets.filters")}),e.jsx(xt,{onClick:()=>E(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(pt,{children:e.jsx(gt,{category:m,subCategory:u,onCategory:U,onSub:v,priceMin:x,priceMax:d,onPriceMin:k,onPriceMax:$,rarities:f,onToggleRarity:Q,status:N,onStatus:R,smart:I,onSmart:M,hideNames:!0,collections:n,onCollections:Re})}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:()=>E(!1),children:o("assets.showItems")})})]}),e.jsx(wt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(nt,{children:e.jsx(lt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(me,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Ot,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(de,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{sort:D,onSort:ke,total:Ne,loading:B,onOpenFilters:()=>E(!0),chips:S,onClearChips:Y}),q?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(me,{"data-testid":"creator-grid",children:B?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[J.map(t=>X(t)?e.jsx(ne,{item:t},t.id):e.jsx(ne,{item:t,mode:"view"},t.id)),H?e.jsx(A,{count:6}):null]})}),e.jsx(de,{hasNextPage:Fe,isFetching:H,isError:Le,onLoadMore:()=>void Ae()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(vt,{"data-testid":"creator-empty-filters",children:[e.jsxs(jt,{children:[e.jsx(yt,{children:o("creator.emptyFilters.title")}),e.jsx(Ct,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(kt,{children:e.jsx($t,{type:"button",onClick:Y,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{vo as Creator,vo as default};
306
+ `,ro={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function so({address:r}){var x,k;const{data:s}=be(r),{data:a}=Oe(r),n=Ke(d=>{var $;return($=d.session)==null?void 0:$.address}),l=!!n&&n.toLowerCase()===r.toLowerCase(),c=(s==null?void 0:s.name)||we(r),m=(k=(x=s==null?void 0:s.avatar)==null?void 0:x.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||tt,u=a==null?void 0:a.description,j=`${Ve.profileUrl}/${r}`,f=He.filter(d=>a==null?void 0:a.links[d]),w=Ue(qe({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(Ht,{"aria-label":`${c} storefront`,children:[e.jsxs(Ut,{children:[e.jsx(qt,{src:C,alt:"",loading:"eager"}),e.jsx(Vt,{"aria-hidden":!0})]}),(f.length>0||l)&&e.jsxs(Qt,{children:[f.map(d=>e.jsx(Yt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[d])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${d}`),"aria-label":o(`creator.link.${d}`),children:e.jsx(ae,{name:ro[d]})},d)),l&&e.jsx(Zt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(ae,{name:"pen"})})]}),e.jsxs(Jt,{children:[m?e.jsx(ue,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(ue,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Xt,{children:c}),u?e.jsx(eo,{children:u}):null]}),e.jsxs(to,{children:[e.jsx(oo,{"data-testid":"creator-hero-view",href:j,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Kt,{address:r,className:"creator-hero__follow"})]})]})]})}const xe=48;function jo(){var te,oe;const{address:r}=Me(),s=pe(),[a]=Be(),n=a.has("collections"),{data:l}=be(r),c=(l==null?void 0:l.name)||(r?we(r):o("creator.fallbackName"));Qe({title:c,description:o("seo.creator.description",{name:c}),image:(oe=(te=l==null?void 0:l.avatar)==null?void 0:te.snapshots)==null?void 0:oe.face256});const[m,C]=g.useState("all"),[u,j]=g.useState(null),[f,w]=g.useState([]),[x,k]=g.useState(""),[d,$]=g.useState(""),[N,R]=g.useState("all"),[I,M]=g.useState(!1),[D,ke]=g.useState("newest"),[P,E]=g.useState(!1);g.useEffect(()=>{if(!P)return;const t=T=>{T.key==="Escape"&&E(!1)};document.addEventListener("keydown",t);const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=h}},[P]);const G=x&&!Number.isNaN(Number(x))?Number(x):void 0,O=d&&!Number.isNaN(Number(d))?Number(d):void 0,$e=u?Et[u]:void 0,Se=(ce.find(t=>t.key===D)??ce[0]).server,K={creator:r,category:m,rarities:f.length?f:void 0,wearableCategories:$e,minPriceCredits:G,maxPriceCredits:O,isWearableSmart:I||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:Se},{items:B,total:Ne,isLoading:Ee,isPlaceholderData:Pe,error:H,hasNextPage:Fe,isFetchingNextPage:U,isFetchNextPageError:Le,fetchNextPage:Ae}=he(["creator-items",K],t=>le({...K,first:xe,skip:t}),{enabled:!!r&&!n}),F=Ye({queryKey:["creator-item-count",r],queryFn:()=>le({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=he(["creator-collections",r],t=>et(r,{first:xe,skip:t}).then(h=>({items:h.collections,total:h.total})),{enabled:!!r&&n});function q(t){C(t),j(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const h=t.toString();s({search:h?`?${h}`:""},{replace:!0})}function Re(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const h=t.toString();s({search:h?`?${h}&collections`:"?collections"},{replace:!0})}function Q(t){w(h=>h.includes(t)?h.filter(T=>T!==t):[...h,t])}function Y(){C("all"),j(null),w([]),k(""),$(""),R("all"),M(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>q("all")}),(G!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of St)f.includes(t)&&S.push({key:`rarity-${t}`,label:Ze(t),onRemove:()=>Q(t)});I&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>M(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>R("all")});const L=Pt({gridLoading:Ee||Pe,gridError:!!H,gridCount:B.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),z=L==="skeletons",{data:Z}=Je(),J=g.useMemo(()=>B.map(t=>({...t,priceCredits:Xe(t,Z)})),[B,Z]),X=t=>t.priceCredits>0||!!t.manaWei,ee=J.filter(X),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(ot,{children:[e.jsxs(rt,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(st,{onClick:()=>s("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(it,{children:c})]}),r?e.jsx(so,{address:r}):null,!n&&!z&&ee.length>0?e.jsx(at,{items:ee,source:"creator"}):null,e.jsxs(ct,{children:[P?e.jsx(dt,{onClick:()=>E(!1),"aria-hidden":!0}):null,e.jsxs(ht,{"data-open":P||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(mt,{children:[e.jsx(ut,{children:o("assets.filters")}),e.jsx(xt,{onClick:()=>E(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(pt,{children:e.jsx(gt,{category:m,subCategory:u,onCategory:q,onSub:j,priceMin:x,priceMax:d,onPriceMin:k,onPriceMax:$,rarities:f,onToggleRarity:Q,status:N,onStatus:R,smart:I,onSmart:M,hideNames:!0,collections:n,onCollections:Re})}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:()=>E(!1),children:o("assets.showItems")})})]}),e.jsx(wt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(nt,{children:e.jsx(lt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(me,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Ot,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(de,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Nt,{sort:D,onSort:ke,total:Ne,loading:z,onOpenFilters:()=>E(!0),chips:S,onClearChips:Y}),H?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(me,{"data-testid":"creator-grid",children:z?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[J.map(t=>X(t)?e.jsx(ne,{item:t},t.id):e.jsx(ne,{item:t,mode:"view"},t.id)),U?e.jsx(A,{count:6}):null]})}),e.jsx(de,{hasNextPage:Fe,isFetching:U,isError:Le,onLoadMore:()=>void Ae()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(jt,{"data-testid":"creator-empty-filters",children:[e.jsxs(vt,{children:[e.jsx(yt,{children:o("creator.emptyFilters.title")}),e.jsx(Ct,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(kt,{children:e.jsx($t,{type:"button",onClick:Y,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{jo as Creator,jo as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-DbCMsBDL.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-DehiWSvs.js";import{I as i}from"./index-BX2ff1lz.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-DyHElSGY.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BX8-GtYO.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-CpPJKj3w.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-B6GXvxon.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-DehiWSvs.js";import{t as e,s as a,b as r,I as f}from"./index-DbCMsBDL.js";const w=a.section`
1
+ import{r as h,j as o}from"./react-DehiWSvs.js";import{t as e,s as a,b as r,I as f}from"./index-BX2ff1lz.js";const w=a.section`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 36px;
@@ -1,4 +1,4 @@
1
- import{d as ue,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,o as q,q as ge,b as n,C as h,k as fe,x as me,R as g,bc as be,A as G,bm as N,bS as we,b6 as H,w as re,I as ye,bT as Q}from"./index-DbCMsBDL.js";import{F as ke}from"./Faq-BXT0tU5Q.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-CeoLpXxe.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.8.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.8.0/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.8.0/_assets/pack-chest-BX_j84xW.webp",Pe="https://cdn.decentraland.org/@dcl/shop/0.8.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.8.0/_assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
1
+ import{d as ue,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,o as q,q as ge,b as n,C as h,k as fe,x as me,R as g,bb as be,A as G,bl as N,bR as we,b5 as H,w as re,I as ye,bS as Q}from"./index-BX2ff1lz.js";import{F as ke}from"./Faq-BlN_im0Z.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-CDKB1mCH.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-CmtP3U6y.js";import"./ethers-DejfrZ8i.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.8.1-31008797734.commit-eb2f6cb/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.8.1-31008797734.commit-eb2f6cb/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.8.1-31008797734.commit-eb2f6cb/_assets/pack-chest-BX_j84xW.webp",Pe="https://cdn.decentraland.org/@dcl/shop/0.8.1-31008797734.commit-eb2f6cb/_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-31008797734.commit-eb2f6cb/_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;