@dcl/shop 0.1.0-30830708286.commit-6900e32 → 0.1.0-30830755583.commit-4658b42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/_assets/{Activity-MnXzrB9W.js → Activity-DkK_V4sh.js} +1 -1
  2. package/_assets/{AnimatedBackground-htl_aksK.js → AnimatedBackground-CQDKI-H_.js} +1 -1
  3. package/_assets/{Assets-CBDYtRid.js → Assets-DT-d-qaQ.js} +11 -11
  4. package/_assets/{Assets.styles-BJpp2Oe0.js → Assets.styles-EoOzQAcv.js} +1 -1
  5. package/_assets/Authorizations-GSUZWQda.js +186 -0
  6. package/_assets/{Cart-e1KMPGgH.js → Cart-fGoe5beM.js} +6 -6
  7. package/_assets/{CircularProgress-nhFw9veT.js → CircularProgress-3u1que6i.js} +5 -5
  8. package/_assets/{Collection--mvJQAHb.js → Collection-vcx-3qSp.js} +5 -5
  9. package/_assets/{CollectionCarousel-CEkqQ1PE.js → CollectionCarousel-DrpF7Bml.js} +7 -7
  10. package/_assets/{Creator-CDsnYW7x.js → Creator-CMtCjYcd.js} +4 -4
  11. package/_assets/{ErrorNotice-FoLpDD1-.js → ErrorNotice-BZqsZ4rX.js} +1 -1
  12. package/_assets/{ExchangeController-C5od18cc.js → ExchangeController-DU88Z9dU.js} +1 -1
  13. package/_assets/{GetCredits-UC4ETtf6.js → GetCredits-C8a5FpoV.js} +8 -8
  14. package/_assets/{HelpersUtil-DN2EdyXJ.js → HelpersUtil-DR2mBYdx.js} +1 -1
  15. package/_assets/{ImportListings-CNRuPtew.js → ImportListings-Du6YU7d7.js} +10 -10
  16. package/_assets/{ItemDetail-Cb5zRdZJ.js → ItemDetail-CXKhhh8X.js} +3 -3
  17. package/_assets/{LoadMore-8od0F5L9.js → LoadMore-Bqx1IcKy.js} +1 -1
  18. package/_assets/{MenuList-DS3r7IBB.js → MenuList-BEvHySxI.js} +1 -1
  19. package/_assets/{MyAssets-Dm7z3LNq.js → MyAssets-CPWoT2VA.js} +1 -1
  20. package/_assets/{MyFavorites-CJ9BdUjm.js → MyFavorites-Igl25Nek.js} +1 -1
  21. package/_assets/{NotFound-B0AaFvrv.js → NotFound-B4Q6cIl5.js} +1 -1
  22. package/_assets/NotificationsBell-BqdBDBcG.js +34 -0
  23. package/_assets/{StoreSettings-BGnmAotG.js → StoreSettings-C_8-hM88.js} +4 -4
  24. package/_assets/{Success-BvFPVtXh.js → Success-GH1eUkKP.js} +10 -10
  25. package/_assets/{SwapController-Ce813SnO.js → SwapController-DqIyjDwe.js} +1 -1
  26. package/_assets/{Tooltip-Dy87pXpy.js → Tooltip-BqiXiZUp.js} +1 -1
  27. package/_assets/{TradeService-BbXC6H5_.js → TradeService-BrwKrYrV.js} +1 -1
  28. package/_assets/{W3MFrameProviderSingleton-CrdKu7xI.js → W3MFrameProviderSingleton-wKXZD-Zq.js} +3 -3
  29. package/_assets/{WebCryptoP256-XeUqCFp1.js → WebCryptoP256-BO1VNOgp.js} +1 -1
  30. package/_assets/{authorizations-E8_0NGng.js → authorizations-Bz3S6EIM.js} +1 -1
  31. package/_assets/{basic-BgmhLeYh.js → basic-EJUnZYJe.js} +1 -1
  32. package/_assets/{biconomy-CoRUSW3F.js → biconomy-DotXQm2m.js} +1 -1
  33. package/_assets/{browseLayout.styles-BuE8ZzH7.js → browseLayout.styles-DKcUvFq-.js} +6 -6
  34. package/_assets/{builder-CSTbRG1g.js → builder-78T8aZCf.js} +1 -1
  35. package/_assets/{buy-CFAg0mL8.js → buy-F7fYGwQJ.js} +1 -1
  36. package/_assets/{buy-gasless-B2L69ya6.js → buy-gasless-BM1gL-pK.js} +1 -1
  37. package/_assets/{categories-wrk9ttY6.js → categories-BU8sQA4o.js} +7 -7
  38. package/_assets/{ccip-YM_kCBLY.js → ccip-C_kT-OVZ.js} +1 -1
  39. package/_assets/{ccip-gnBPW_-R.js → ccip-tCVfGtP3.js} +1 -1
  40. package/_assets/{clsx-CqIwIRCQ.js → clsx-BJUFu5Pv.js} +2 -2
  41. package/_assets/{controller-yZy75Z7P.js → controller-m4Wxh5sS.js} +2 -2
  42. package/_assets/{core-DkD31Zjb.js → core-B1V31SCn.js} +4 -4
  43. package/_assets/{createSvgIcon-CMMzm3U0.js → createSvgIcon-Dj_5_lVz.js} +4 -4
  44. package/_assets/{custom-B-orziPC.js → custom-D1K_TxPK.js} +1 -1
  45. package/_assets/{data-capture-nSLWVv-w.js → data-capture-C1-byNHR.js} +1 -1
  46. package/_assets/{email-Bj103v1P.js → email-roLnzw98.js} +1 -1
  47. package/_assets/{embedded-wallet-BcQlnpmz.js → embedded-wallet-CaSrX8RO.js} +1 -1
  48. package/_assets/{emotion-styled.browser.esm-Cx7yWxVd.js → emotion-styled.browser.esm-B_GcKaUo.js} +1 -1
  49. package/_assets/{engine-DDk1gbcP.js → engine-BQKnbku7.js} +1 -1
  50. package/_assets/{errors-CPDOUeQU.js → errors-BkMwx-kf.js} +1 -1
  51. package/_assets/{estimate-l1-fee-COUDSnTC.js → estimate-l1-fee-C8wjooi8.js} +1 -1
  52. package/_assets/{execute-CmAmYuhz.js → execute-6yOQQvcJ.js} +2 -2
  53. package/_assets/{features-B3EUOZIc.js → features-oMzmfq5l.js} +1 -1
  54. package/_assets/{fetchTokenMetadata-CfOxP6Xt.js → fetchTokenMetadata-BdDn5xlV.js} +2 -2
  55. package/_assets/{get-ecosystem-wallet-info-CT8m7arg.js → get-ecosystem-wallet-info-BJqFfkxV.js} +1 -1
  56. package/_assets/{getBalance-sSJeAfPA.js → getBalance-RNu0dFGc.js} +1 -1
  57. package/_assets/{getNFT-DQ56iXLL.js → getNFT-BZyzOHB8.js} +1 -1
  58. package/_assets/{getNFT-CaRZc3jP.js → getNFT-CULdzRPK.js} +1 -1
  59. package/_assets/{getThemeProps-DMuo3coh.js → getThemeProps-DXnNGMw5.js} +1 -1
  60. package/_assets/{grid.styles-D-gTOGBC.js → grid.styles-BlUHs1Am.js} +1 -1
  61. package/_assets/{hashTypedData-BiYwzMSX.js → hashTypedData-B9S9l2wb.js} +1 -1
  62. package/_assets/{hashTypedData-DTFMLH-r.js → hashTypedData-IHUBPkR0.js} +1 -1
  63. package/_assets/{import-DdbcQXPQ.js → import-HMOgDc9D.js} +1 -1
  64. package/_assets/{in-app-DqFHpjTV.js → in-app-CWL9UnZu.js} +1 -1
  65. package/_assets/{in-app-wallet-calls-DHqdMTHg.js → in-app-wallet-calls-iG9TrQSV.js} +1 -1
  66. package/_assets/{index-Qo51btPd.js → index-0BDpDIn2.js} +1 -1
  67. package/_assets/{index-BoKPwZrb.js → index-0EiwzvGv.js} +1 -1
  68. package/_assets/{index-BJpdqx6Q.js → index-6BrQFoiH.js} +1 -1
  69. package/_assets/{index-Bjtki3zK.js → index-9gH7d1pw.js} +1 -1
  70. package/_assets/{index-Cywb3mZG.js → index-A2WELz1i.js} +1 -1
  71. package/_assets/{index-B1Vw7Ce7.js → index-B5B624ZI.js} +1 -1
  72. package/_assets/{index-DZu4-xVf.js → index-B6og8PZ_.js} +1 -1
  73. package/_assets/{index-WFqqjFcS.js → index-BBbwmK0l.js} +1 -1
  74. package/_assets/{index-B6qnJTMp.js → index-BEnF4ZEt.js} +1 -1
  75. package/_assets/{index-DJeGZsWn.js → index-BI5VO1OO.js} +1 -1
  76. package/_assets/{index-BcG9G8Eg.js → index-BPZFvxpS.js} +1 -1
  77. package/_assets/{index-CeiZi1Mv.js → index-BQnu9AAN.js} +1 -1
  78. package/_assets/{index-CiqXMsjr.js → index-BZYSB-y8.js} +1 -1
  79. package/_assets/{index-B1oCsNE3.js → index-B_LMReRp.js} +3 -3
  80. package/_assets/{index-BbV5I-Nq.js → index-BhiVsshr.js} +1 -1
  81. package/_assets/{index-DIQz8cOu.js → index-BjqyR397.js} +1 -1
  82. package/_assets/{index-BHap0Pt7.js → index-BwhFJbcv.js} +1 -1
  83. package/_assets/{index-uti914D5.js → index-CF9LZ4Pk.js} +1 -1
  84. package/_assets/{index-hDbN63Ln.js → index-CFAC64qh.js} +1 -1
  85. package/_assets/{index-IH5Acvug.js → index-CPtRg_C7.js} +2 -2
  86. package/_assets/{index-ZLrp5Bhh.js → index-CQcgp1iN.js} +26 -26
  87. package/_assets/{index-BxayUwju.js → index-CTzgZDYk.js} +1 -1
  88. package/_assets/{index-DNqM2cRp.js → index-CeL4_s5U.js} +1 -1
  89. package/_assets/{index-m9ABB7av.js → index-CgaQ8N3l.js} +1 -1
  90. package/_assets/{index-BkDnPBy0.js → index-Clwpm5rF.js} +2 -2
  91. package/_assets/{index-axEGwhSI.js → index-CqcnnSEX.js} +1 -1
  92. package/_assets/{index-B-GIGHBi.js → index-CuE5Oadu.js} +1 -1
  93. package/_assets/{index-SLZL1DoR.js → index-D15ZxYWQ.js} +1 -1
  94. package/_assets/{index-Gb1PiPiA.js → index-D6_3K--Q.js} +3 -3
  95. package/_assets/{index-HH9YYVaK.js → index-D6qSnzWv.js} +1 -1
  96. package/_assets/{index-T2J3uY-Z.js → index-DMwxmOC-.js} +2 -2
  97. package/_assets/{index-Dd6JKVr9.js → index-DUFof9sW.js} +1 -1
  98. package/_assets/{index-BPe_F07L.js → index-D_r4rek8.js} +1 -1
  99. package/_assets/{index-BmscqdKV.js → index-DdVd4SPR.js} +1 -1
  100. package/_assets/{index-DY8ZC3eZ.js → index-Dn2HPDMP.js} +1 -1
  101. package/_assets/{index-CBHL2bKV.js → index-DnRSWMRH.js} +1 -1
  102. package/_assets/{index-CBEktmuo.js → index-DvjiRC2A.js} +2 -2
  103. package/_assets/{index-CFcgb0ax.js → index-DyZd30cj.js} +1 -1
  104. package/_assets/{index-CTG34-7k.js → index-NhZwqKdi.js} +1 -1
  105. package/_assets/{index-zJQqEgUQ.js → index-QA15YkrB.js} +1 -1
  106. package/_assets/{index-Dyfkmcym.js → index-SnHJ4jHh.js} +3 -3
  107. package/_assets/{index-DZ_0HpBO.js → index-ZsOxcn-V.js} +1 -1
  108. package/_assets/{index-CgPnggHq.js → index-byCABXEb.js} +1 -1
  109. package/_assets/{index-DOMV_UlQ.js → index-bzRnRmth.js} +1 -1
  110. package/_assets/{index-BuvImOwE.js → index-lPvPUzvE.js} +1 -1
  111. package/_assets/{index-CTFvSyNV.js → index-lx4soo8p.js} +1 -1
  112. package/_assets/{index-B4TEatQl.js → index-r5mI5kyM.js} +1 -1
  113. package/_assets/{index-CbJMa4Yh.js → index-sFbWswBz.js} +1 -1
  114. package/_assets/{index-gzgGbBGj.js → index-sZGu86_-.js} +1 -1
  115. package/_assets/{index-C-mOh_a2.js → index-yl2QMKNC.js} +1 -1
  116. package/_assets/{index-D-ZDvJCP.js → index-zMk1bCKk.js} +2 -2
  117. package/_assets/{index.es-cnYw8KNm.js → index.es-Cery6vYx.js} +4 -4
  118. package/_assets/{index.es-D877V0ui.js → index.es-DC3-p8oq.js} +1 -1
  119. package/_assets/{index.es-CpdpPZ5k.js → index.es-DCKq1Q4u.js} +1 -1
  120. package/_assets/{localBatchGatewayRequest-Cm_Q3xcs.js → localBatchGatewayRequest-CakoVxEr.js} +1 -1
  121. package/_assets/{mana-convert-BD8UMnC-.js → mana-convert-CM0Q2I_C.js} +1 -1
  122. package/_assets/{mana-rate-DsLc4315.js → mana-rate-CeJoK8Ap.js} +1 -1
  123. package/_assets/{networks-BSQfuOw7.js → networks--__aHdrr.js} +1 -1
  124. package/_assets/{onramp-PSISd-iT.js → onramp-wc4LPqM7.js} +1 -1
  125. package/_assets/{openzeppelin-BVepIV31.js → openzeppelin-zwMHXsd3.js} +1 -1
  126. package/_assets/{parseNft-DdQmcS_8.js → parseNft-BUu0QaJy.js} +2 -2
  127. package/_assets/{parseSignature-5g9oB04J.js → parseSignature-BZlrbItT.js} +1 -1
  128. package/_assets/{parseSignature-CtzX7AqF.js → parseSignature-CCc3N6DW.js} +3 -3
  129. package/_assets/{passkeys-tloHjtZY.js → passkeys-CMzs7qc5.js} +1 -1
  130. package/_assets/{pay-with-exchange-DhTTxcu5.js → pay-with-exchange-Dd49V9Dt.js} +1 -1
  131. package/_assets/{qr-overlay-BvHuZZBy.js → qr-overlay-X953Lq1h.js} +1 -1
  132. package/_assets/{receive-BdMbDZpD.js → receive-CYngkOdA.js} +1 -1
  133. package/_assets/{resolveImplementation-CFPs_1ly.js → resolveImplementation-CyNwBdrv.js} +1 -1
  134. package/_assets/{rpc-BGNwjJyh.js → rpc-A101vo1F.js} +1 -1
  135. package/_assets/{secp256k1-DZ2SAej-.js → secp256k1-C1ir3QUf.js} +1 -1
  136. package/_assets/{secp256k1-COhPDJ4u.js → secp256k1-DiREPdz-.js} +1 -1
  137. package/_assets/{secp256k1-705CLADe.js → secp256k1-ZO5i3UBI.js} +1 -1
  138. package/_assets/{send-cMULZVUl.js → send-BjMRCe3K.js} +1 -1
  139. package/_assets/{send-batch-transaction-DKis0-QF.js → send-batch-transaction-Da1R2WBg.js} +1 -1
  140. package/_assets/{send-eip712-transaction-VdYRVrqY.js → send-eip712-transaction-B5gxvF81.js} +2 -2
  141. package/_assets/{send-gasless-transaction-D9DvumJW.js → send-gasless-transaction-BfnxJUcj.js} +2 -2
  142. package/_assets/{send-transaction-CXK5_GYH.js → send-transaction-dG8UnQfd.js} +2 -2
  143. package/_assets/{sendMetaTransaction-CQ1T_6-I.js → sendMetaTransaction-BGqAABs-.js} +1 -1
  144. package/_assets/{sendRawTransaction-DvGIcbqV.js → sendRawTransaction-C5vaHC9F.js} +3 -3
  145. package/_assets/{serializeTransaction-DUdNUuM4.js → serializeTransaction-Cvt7VAIM.js} +1 -1
  146. package/_assets/{session-proposal-nFRfFF1d.js → session-proposal-DA6rberG.js} +1 -1
  147. package/_assets/{session-request-CorlzLX5.js → session-request-BaWpiqBo.js} +2 -2
  148. package/_assets/{signing-VlUa-Oq7.js → signing-Chnvri1K.js} +3 -3
  149. package/_assets/{socials-B5kFlk2f.js → socials-hE6J6zOy.js} +1 -1
  150. package/_assets/{swaps-Yhyu65X0.js → swaps-D_Lt2d6x.js} +1 -1
  151. package/_assets/{thirdweb-80s_5RM_.js → thirdweb-Tb-ufCdH.js} +3 -3
  152. package/_assets/{to-serializable-transaction-BvXKdTbz.js → to-serializable-transaction-W4CacvUz.js} +2 -2
  153. package/_assets/{trade-encoding-BJQNrSRU.js → trade-encoding-B96eH7PK.js} +1 -1
  154. package/_assets/{transactionReceipt-D9UoeNG0.js → transactionReceipt-DnMO0Z8h.js} +1 -1
  155. package/_assets/{transactions-BR_gP4fB.js → transactions-6WSEOyUR.js} +1 -1
  156. package/_assets/useCreditPacks-BZBHQn_t.js +1 -0
  157. package/_assets/{useInfiniteGrid-SEfbanDp.js → useInfiniteGrid-qZQR98Xh.js} +1 -1
  158. package/_assets/useManaRate-oLihTkP0.js +1 -0
  159. package/_assets/{useSecondarySales-BdMq83Pz.js → useSecondarySales-zW5jqf5K.js} +1 -1
  160. package/_assets/{useStore-BC3A7db6.js → useStore-DwuNHIk7.js} +1 -1
  161. package/_assets/{useTheme-BHUAoIEZ.js → useTheme-tTpRSzCd.js} +1 -1
  162. package/_assets/{verifyHash-VvjDkBws.js → verifyHash-Dcr5MdX9.js} +1 -1
  163. package/_assets/{w3m-modal-CU7ELmQd.js → w3m-modal-DMVGcuSf.js} +1 -1
  164. package/_assets/{w3m-modal-ODQEBY_r.js → w3m-modal-DPuioRY2.js} +1 -1
  165. package/_assets/{wait-for-tx-receipt-DUUNmO1K.js → wait-for-tx-receipt-BPEAu1db.js} +1 -1
  166. package/_assets/{wallets-BWg5VZy0.js → wallets-CuSH1SoT.js} +5 -5
  167. package/_assets/{web-connector-B1PoaR_B.js → web-connector-_VNzZMNS.js} +3 -3
  168. package/_assets/{writeContract-Dk_8bpTb.js → writeContract-DHS3WdjH.js} +1 -1
  169. package/_assets/{zoraTestnet-C94OTMqe.js → zoraTestnet-B4hShQFd.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/_assets/Authorizations-lE31EPN4.js +0 -182
  173. package/_assets/NotificationsBell-T4VZFoIu.js +0 -34
  174. package/_assets/useCreditPacks-Diy15u3Q.js +0 -1
  175. package/_assets/useManaRate-DNC9BmC1.js +0 -1
@@ -1,4 +1,4 @@
1
- import{L as N,M as U,N as o,O as n,G as D,x as M}from"./index-ZLrp5Bhh.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-CqIwIRCQ.js";function G(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const K=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,L=M(P||(P=l`
1
+ import{N,O as U,P as o,Q as n,J as D,x as M}from"./index-CQcgp1iN.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-BJUFu5Pv.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
  }
@@ -6,7 +6,7 @@ import{L as N,M as U,N as o,O as n,G as D,x as M}from"./index-ZLrp5Bhh.js";impor
6
6
  100% {
7
7
  transform: rotate(360deg);
8
8
  }
9
- `)),W=M(b||(b=l`
9
+ `)),G=M(b||(b=l`
10
10
  0% {
11
11
  stroke-dasharray: 1px, 200px;
12
12
  stroke-dashoffset: 0;
@@ -21,8 +21,8 @@ import{L as N,M as U,N as o,O as n,G as D,x as M}from"./index-ZLrp5Bhh.js";impor
21
21
  stroke-dasharray: 100px, 200px;
22
22
  stroke-dashoffset: -125px;
23
23
  }
24
- `)),B=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${n(a)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(u,G,e)},O=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
24
+ `)),J=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${n(a)}`],svg:["svg"],circle:["circle",`circle${n(s)}`,d&&"circleDisableShrink"]};return F(u,K,e)},L=v("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${n(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(S||(S=l`
25
25
  animation: ${0} 1.4s linear infinite;
26
- `),L)),V=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Z=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
26
+ `),B)),O=v("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Q=v("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${n(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
27
27
  animation: ${0} 1.4s ease-in-out infinite;
28
- `),W)),J=w.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=U(a,K),c=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=B(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(O,o({className:I(f.root,d),style:o({width:m,height:m},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(V,{className:f.svg,ownerState:c,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:g.jsx(Z,{className:f.circle,style:h,ownerState:c,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{J as C};
28
+ `),G)),A=w.forwardRef(function(e,s){const a=N({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=U(a,W),c=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=J(c),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return g.jsx(L,o({className:I(f.root,d),style:o({width:m,height:m},x,_),ownerState:c,ref:s,role:"progressbar"},y,j,{children:g.jsx(O,{className:f.svg,ownerState:c,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:g.jsx(Q,{className:f.circle,style:h,ownerState:c,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{A as C};
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,ae as J,af as z,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as E,A as ie,ag as se,ah as ne}from"./index-ZLrp5Bhh.js";import{E as ce}from"./ErrorNotice-FoLpDD1-.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-BuE8ZzH7.js";import{u as ve}from"./useStore-BC3A7db6.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-wrk9ttY6.js";import{L as $e}from"./LoadMore-8od0F5L9.js";import{u as Pe}from"./useInfiniteGrid-SEfbanDp.js";import{G as Me}from"./grid.styles-D-gTOGBC.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
1
+ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,ag as J,E,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as z,A as ie,ah as se,ai as ne}from"./index-CQcgp1iN.js";import{E as ce}from"./ErrorNotice-BZqsZ4rX.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-DKcUvFq-.js";import{u as ve}from"./useStore-DwuNHIk7.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-BU8sQA4o.js";import{L as $e}from"./LoadMore-Bqx1IcKy.js";import{u as Pe}from"./useInfiniteGrid-qZQR98Xh.js";import{G as Me}from"./grid.styles-BlUHs1Am.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
2
2
  position: relative;
3
3
  border-radius: ${v.radius.card};
4
4
  overflow: hidden;
@@ -15,12 +15,12 @@ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as
15
15
  position: absolute;
16
16
  inset: 0;
17
17
  z-index: 0;
18
- `,ze=c.img`
18
+ `,Ee=c.img`
19
19
  width: 100%;
20
20
  height: 100%;
21
21
  object-fit: cover;
22
22
  display: block;
23
- `,Ee=c.div`
23
+ `,ze=c.div`
24
24
  position: absolute;
25
25
  inset: 0;
26
26
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
@@ -42,7 +42,7 @@ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as
42
42
  padding: 24px 16px;
43
43
  font-size: 26px;
44
44
  }
45
- `;function Be({name:r,creator:t}){const{data:s}=ve(t),d=(s==null?void 0:s.cover)||le;return e.jsxs(Re,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(Te,{children:[e.jsx(ze,{src:d,alt:"",loading:"eager"}),e.jsx(Ee,{"aria-hidden":!0})]}),e.jsx(Fe,{"data-testid":"collection-hero-title",children:r})]})}const{colors:n,radius:L}=v,Le=c.div`
45
+ `;function Be({name:r,creator:t}){const{data:s}=ve(t),d=(s==null?void 0:s.cover)||le;return e.jsxs(Re,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(Te,{children:[e.jsx(Ee,{src:d,alt:"",loading:"eager"}),e.jsx(ze,{"aria-hidden":!0})]}),e.jsx(Fe,{"data-testid":"collection-hero-title",children:r})]})}const{colors:n,radius:L}=v,Le=c.div`
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  align-items: center;
@@ -116,4 +116,4 @@ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as
116
116
  background: ${n.accent};
117
117
  color: ${n.white};
118
118
  }
119
- `;function He({address:r}){var f,l;const{data:t}=J(r),[s,d]=m.useState(!1);if(!r)return null;const p=(t==null?void 0:t.name)||z(r),g=(l=(f=t==null?void 0:t.avatar)==null?void 0:f.snapshots)==null?void 0:l.face256,h=`${ee.profileUrl}/${r}`,b=de(pe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??r}));async function x(){try{await navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){te(y,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"data-testid":"creator-card",children:[g?e.jsx(B,{src:g,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsx(Ie,{title:p,children:p}),e.jsxs(_e,{type:"button",onClick:()=>void x(),title:s?a("collection.copied"):a("collection.copyAddress"),"aria-label":s?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:z(r)}),e.jsx(X,{name:"copy",size:16})]}),e.jsx(Ge,{"data-testid":"creator-card-view",href:h,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const Ue=48;function at(){var T;const{contractAddress:r}=Y(),t=Z(),[s,d]=m.useState("wearable"),[p,g]=m.useState(null),[h,b]=m.useState([]),[x,f]=m.useState(""),[l,y]=m.useState(""),[S,I]=m.useState("newest"),k=x&&!Number.isNaN(Number(x))?Number(x):void 0,A=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,G=(F.find(o=>o.key===S)??F[0]).server,N={category:s,rarities:h.length?h:void 0,wearableCategories:_,minPriceCredits:k,maxPriceCredits:A,sortBy:G},{items:j,total:H,isLoading:C,error:$,hasNextPage:U,isFetchingNextPage:P,fetchNextPage:q}=Pe(["collection-page",r,N],o=>se(r,{...N,first:Ue,skip:o}),{enabled:!!r}),{data:i}=ae({queryKey:["collection-meta",r],queryFn:()=>ne(r),enabled:!!r,staleTime:5*6e4}),M=(i==null?void 0:i.name)||a("collection.fallbackTitle");re({title:i==null?void 0:i.name,description:i!=null&&i.name?a("seo.collection.description",{name:i.name}):void 0});const R=(i==null?void 0:i.creator)||((T=j[0])==null?void 0:T.creator);function K(o){d(o),g(null)}function W(o){b(u=>u.includes(o)?u.filter(V=>V!==o):[...u,o])}function D(){d("wearable"),g(null),b([]),f(""),y("")}const w=!!(k||A),O=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),Q=s!=="wearable"||!!p||h.length>0||w;return e.jsxs(xe,{"data-testid":"collection-page",children:[e.jsxs(ue,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(me,{onClick:()=>t("/assets"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(ge,{children:M})]}),e.jsx(Be,{name:M,creator:R}),e.jsxs(he,{"data-testid":"browse",children:[e.jsxs(be,{"data-testid":"browse-sidebar",children:[e.jsx(He,{address:R}),e.jsx(ye,{category:s,subCategory:p,onCategory:K,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(fe,{children:[!C&&j.length>0?e.jsx(je,{items:j,source:"collection"}):null,e.jsx(Ce,{rarities:h,onToggleRarity:W,sort:S,onSort:I,total:H,loading:C,anyActive:Q,onClear:D,renderTrailing:o=>e.jsx(we,{panelKey:"price",label:O,active:w,panel:o,children:e.jsxs(Se,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:u=>f(u.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:u=>y(u.target.value)})]}),e.jsx(Ae,{children:a("collection.priceHint",{currency:oe.name})})]})})}),$?e.jsx(ce,{message:a("collection.error")}):null,e.jsx(Me,{"data-testid":"grid",children:C?e.jsx(E,{count:15}):e.jsxs(e.Fragment,{children:[j.map(o=>e.jsx(ie,{item:o},o.id)),P?e.jsx(E,{count:6}):null]})}),e.jsx($e,{hasNextPage:U,isFetching:P,onLoadMore:()=>void q()}),!C&&!$&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{at as Collection,at as default};
119
+ `;function He({address:r}){var f,l;const{data:t}=J(r),[s,d]=m.useState(!1);if(!r)return null;const p=(t==null?void 0:t.name)||E(r),g=(l=(f=t==null?void 0:t.avatar)==null?void 0:f.snapshots)==null?void 0:l.face256,h=`${ee.profileUrl}/${r}`,b=de(pe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??r}));async function x(){try{await navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){te(y,{flow:"copy_creator_address"})}}return e.jsxs(Le,{"data-testid":"creator-card",children:[g?e.jsx(B,{src:g,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsx(Ie,{title:p,children:p}),e.jsxs(_e,{type:"button",onClick:()=>void x(),title:s?a("collection.copied"):a("collection.copyAddress"),"aria-label":s?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:E(r)}),e.jsx(X,{name:"copy",size:16})]}),e.jsx(Ge,{"data-testid":"creator-card-view",href:h,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const Ue=48;function at(){var T;const{contractAddress:r}=Y(),t=Z(),[s,d]=m.useState("wearable"),[p,g]=m.useState(null),[h,b]=m.useState([]),[x,f]=m.useState(""),[l,y]=m.useState(""),[S,I]=m.useState("newest"),k=x&&!Number.isNaN(Number(x))?Number(x):void 0,A=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?Ne[p]:void 0,G=(F.find(o=>o.key===S)??F[0]).server,N={category:s,rarities:h.length?h:void 0,wearableCategories:_,minPriceCredits:k,maxPriceCredits:A,sortBy:G},{items:j,total:H,isLoading:C,error:$,hasNextPage:U,isFetchingNextPage:P,fetchNextPage:q}=Pe(["collection-page",r,N],o=>se(r,{...N,first:Ue,skip:o}),{enabled:!!r}),{data:i}=ae({queryKey:["collection-meta",r],queryFn:()=>ne(r),enabled:!!r,staleTime:5*6e4}),M=(i==null?void 0:i.name)||a("collection.fallbackTitle");re({title:i==null?void 0:i.name,description:i!=null&&i.name?a("seo.collection.description",{name:i.name}):void 0});const R=(i==null?void 0:i.creator)||((T=j[0])==null?void 0:T.creator);function K(o){d(o),g(null)}function W(o){b(u=>u.includes(o)?u.filter(V=>V!==o):[...u,o])}function D(){d("wearable"),g(null),b([]),f(""),y("")}const w=!!(k||A),O=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),Q=s!=="wearable"||!!p||h.length>0||w;return e.jsxs(xe,{"data-testid":"collection-page",children:[e.jsxs(ue,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(me,{onClick:()=>t("/assets"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(ge,{children:M})]}),e.jsx(Be,{name:M,creator:R}),e.jsxs(he,{"data-testid":"browse",children:[e.jsxs(be,{"data-testid":"browse-sidebar",children:[e.jsx(He,{address:R}),e.jsx(ye,{category:s,subCategory:p,onCategory:K,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(fe,{children:[!C&&j.length>0?e.jsx(je,{items:j,source:"collection"}):null,e.jsx(Ce,{rarities:h,onToggleRarity:W,sort:S,onSort:I,total:H,loading:C,anyActive:Q,onClear:D,renderTrailing:o=>e.jsx(we,{panelKey:"price",label:O,active:w,panel:o,children:e.jsxs(Se,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:u=>f(u.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:u=>y(u.target.value)})]}),e.jsx(Ae,{children:a("collection.priceHint",{currency:oe.name})})]})})}),$?e.jsx(ce,{message:a("collection.error")}):null,e.jsx(Me,{"data-testid":"grid",children:C?e.jsx(z,{count:15}):e.jsxs(e.Fragment,{children:[j.map(o=>e.jsx(ie,{item:o},o.id)),P?e.jsx(z,{count:6}):null]})}),e.jsx($e,{hasNextPage:U,isFetching:P,onLoadMore:()=>void q()}),!C&&!$&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{at as Collection,at as default};
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,H as j,bc as C,h as G,x as Y,I as Q,l as X,a as W,C as E,b as Z,bd as J,be as F,A as q}from"./index-ZLrp5Bhh.js";import{s as ee,h as H,A as U,g as K,r as te,m as ne,e as ae}from"./authorizations-E8_0NGng.js";import{i as ie}from"./errors-CPDOUeQU.js";import{E as oe}from"./ErrorNotice-FoLpDD1-.js";import{a as se}from"./buy-CFAg0mL8.js";import{g as re,d as ce}from"./trade-encoding-BJQNrSRU.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-CQ1T_6-I.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.js";const R="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(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>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(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,d=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 l=n-i,f=fe(l,n,s);d>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(l=>l.method==="credits"))==null?void 0:b.method)??((y=c.find(l=>l.method==="combined"))==null?void 0:y.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,m=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(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",be=e.div`
1
+ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,K as j,bd as C,h as G,x as Y,I as Q,l as X,a as W,C as E,b as Z,be as J,bf as F,A as q}from"./index-CQcgp1iN.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-Bz3S6EIM.js";import{i as ie}from"./errors-BkMwx-kf.js";import{E as oe}from"./ErrorNotice-BZqsZ4rX.js";import{a as se}from"./buy-F7fYGwQJ.js";import{g as re,d as ce}from"./trade-encoding-B96eH7PK.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-BGqAABs-.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.js";const R="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(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>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(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,d=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 l=n-i,f=fe(l,n,s);d>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(l=>l.method==="credits"))==null?void 0:b.method)??((y=c.find(l=>l.method==="combined"))==null?void 0:y.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,m=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:m}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(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",be=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -289,7 +289,7 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function gt({auth:a,signer:n,title:i,reason:s,name:d,image:c,icon:p,onAuthorized:h,onCancel:m,onClose:b}){const[y,w]=v.useState(!1),[l,f]=v.useState(null);async function $(){w(!0),f(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){ie(u)?f(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),f(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Ce,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(ze,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(Me,{children:[t.jsx(Ae,{children:i}),t.jsx(We,{onClick:b,disabled:y,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Ie,{"data-testid":"authorize-step-row",children:[t.jsx(Se,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Te,{children:[t.jsx(Ne,{title:d,children:d}),t.jsx(Be,{children:s})]})]}),t.jsx(Ee,{children:g("authorizeStep.note")}),t.jsx(oe,{message:l}),t.jsxs(Re,{children:[t.jsx(Le,{type:"button",onClick:m,disabled:y,children:g("authorizeStep.cancel")}),t.jsx(Pe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Fe,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function ft(a){const[n]=await Ke({...a,trades:[a.trade]});return n}async function Ke(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const m=`${h.chainId}:${h.contract.toLowerCase()}`,b=c.get(m);b?b.push(h):c.set(m,[h])}const p=[];for(const h of c.values())p.push(await De({trades:h,buyer:i,signer:s,onSigned:d}));return p}async function De(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a,c=n[0],p=W(Z(c.contract),c.chainId),h=W(E.MANAToken,c.chainId);await H({auth:{kind:U.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const m=n.map(l=>re(l,i));if(K.enabled)try{const l=new he(p.abi).encodeFunctionData("accept",[m]),f=te(),$=ne(s.provider,f),u=await de($,f,l,p,{serverURL:K.relayerUrl});return d==null||d(),await f.waitForTransaction(u,1,12e4),u}catch(l){if(l instanceof le&&l.code===pe.USER_DENIED)throw l;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",l)}await ae(s.provider,c.chainId);const y=await new ue(p.address,p.abi,s).accept(m,ce(c.chainId));return d==null||d(),(await y.wait()).transactionHash}async function mt(a){const{trade:n,buyer:i,signer:s,credits:d,manaGapWei:c,onBroadcast:p,onReverted:h}=a;if(d.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 m=W(E.MANAToken,n.chainId),b=W(E.CreditsManager,n.chainId);await H({auth:{kind:U.Allowance,contractAddress:m.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(d.reduce((l,f)=>l+BigInt(f.availableAmount),0n)+c).toString();return se({trade:n,buyer:i,signer:s,credits:d,maxCreditedValue:w,onBroadcast:p,onReverted:h})}function bt(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 yt(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:Qe}=o,wt=e.div`
292
+ `;function gt({auth:a,signer:n,title:i,reason:s,name:d,image:c,icon:p,onAuthorized:h,onCancel:m,onClose:b}){const[y,w]=v.useState(!1),[l,f]=v.useState(null);async function $(){w(!0),f(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){ie(u)?f(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),f(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Ce,{onClick:y?void 0:b,role:"presentation",children:t.jsxs(ze,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(Me,{children:[t.jsx(Ae,{children:i}),t.jsx(We,{onClick:b,disabled:y,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Ie,{"data-testid":"authorize-step-row",children:[t.jsx(Se,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Te,{children:[t.jsx(Ne,{title:d,children:d}),t.jsx(Be,{children:s})]})]}),t.jsx(Ee,{children:g("authorizeStep.note")}),t.jsx(oe,{message:l}),t.jsxs(Re,{children:[t.jsx(Le,{type:"button",onClick:m,disabled:y,children:g("authorizeStep.cancel")}),t.jsx(Pe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:y,children:y?t.jsxs(t.Fragment,{children:[t.jsx(Fe,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function ft(a){const[n]=await Ke({...a,trades:[a.trade]});return n}async function Ke(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const m=`${h.chainId}:${h.contract.toLowerCase()}`,b=c.get(m);b?b.push(h):c.set(m,[h])}const p=[];for(const h of c.values())p.push(await De({trades:h,buyer:i,signer:s,onSigned:d}));return p}async function De(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a,c=n[0],p=W(Z(c.contract),c.chainId),h=W(E.MANAToken,c.chainId);await U({auth:{kind:H.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const m=n.map(l=>re(l,i));if(K.enabled)try{const l=new he(p.abi).encodeFunctionData("accept",[m]),f=te(),$=ne(s.provider,f),u=await de($,f,l,p,{serverURL:K.relayerUrl});return d==null||d(),await f.waitForTransaction(u,1,12e4),u}catch(l){if(l instanceof le&&l.code===pe.USER_DENIED)throw l;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",l)}await ae(s.provider,c.chainId);const y=await new ue(p.address,p.abi,s).accept(m,ce(c.chainId));return d==null||d(),(await y.wait()).transactionHash}async function mt(a){const{trade:n,buyer:i,signer:s,credits:d,manaGapWei:c,onBroadcast:p,onReverted:h}=a;if(d.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 m=W(E.MANAToken,n.chainId),b=W(E.CreditsManager,n.chainId);await U({auth:{kind:H.Allowance,contractAddress:m.address,spenderAddress:b.address,chainId:n.chainId},signer:s});const w=(d.reduce((l,f)=>l+BigInt(f.availableAmount),0n)+c).toString();return se({trade:n,buyer:i,signer:s,credits:d,maxCreditedValue:w,onBroadcast:p,onReverted:h})}function bt(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 yt(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:Qe}=o,wt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${Qe.overlay};
@@ -477,11 +477,11 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
477
477
  &[data-on] {
478
478
  border: 4px solid ${r.magenta};
479
479
  }
480
- `,Ht=e(k)`
480
+ `,Ut=e(k)`
481
481
  width: 24px;
482
482
  height: 24px;
483
483
  background: ${r.text};
484
- `,Ut=e.span`
484
+ `,Ht=e.span`
485
485
  font-size: 24px;
486
486
  font-weight: 500;
487
487
  color: ${r.text};
@@ -665,9 +665,9 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
665
665
  text-align: center;
666
666
  }
667
667
  }
668
- `,{colors:I,media:A}=o,He=e.section`
668
+ `,{colors:I,media:A}=o,Ue=e.section`
669
669
  margin-top: 40px;
670
- `,Ue=e.div`
670
+ `,He=e.div`
671
671
  display: flex;
672
672
  align-items: center;
673
673
  justify-content: space-between;
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as
801
801
  opacity: 1;
802
802
  transform: scale(1.1);
803
803
  }
804
- `;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(He,{children:[t.jsxs(Ue,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Ge,{children:[t.jsx(D,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),d>1?t.jsx(Xe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:d}).map((u,x)=>t.jsx(Ze,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{z as $,Tt as A,Mt as B,kt as C,Ut as D,_t as E,Ot as F,Vt as G,$t as H,Gt as I,Yt as J,dt as K,Jt as L,wt as M,ct as N,cn as O,ut as P,gt as Q,T as R,vt as S,Ct as T,rt as U,xt as V,Ft as W,zt as X,Ke as Y,lt as Z,fe as _,jt as a,sn as a0,rn as a1,ft as a2,pt as a3,mt as a4,bt as b,At as c,Wt as d,It as e,St as f,qt as g,en as h,tn as i,Xt as j,Zt as k,nn as l,ht as m,an as n,on as o,yt as p,Kt as q,Nt as r,Bt as s,Et as t,Rt as u,Lt as v,Pt as w,Dt as x,Qt as y,Ht as z};
804
+ `;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(Ue,{children:[t.jsxs(He,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Ge,{children:[t.jsx(D,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),d>1?t.jsx(Xe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:d}).map((u,x)=>t.jsx(Ze,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{z as $,Tt as A,Mt as B,kt as C,Ht as D,_t as E,Ot as F,Vt as G,$t as H,Gt as I,Yt as J,dt as K,Jt as L,wt as M,ct as N,cn as O,ut as P,gt as Q,T as R,vt as S,Ct as T,rt as U,xt as V,Ft as W,zt as X,Ke as Y,lt as Z,fe as _,jt as a,sn as a0,rn as a1,ft as a2,pt as a3,mt as a4,bt as b,At as c,Wt as d,It as e,St as f,qt as g,en as h,tn as i,Xt as j,Zt as k,nn as l,ht as m,an as n,on as o,yt as p,Kt as q,Nt as r,Bt as s,Et as t,Rt as u,Lt as v,Pt as w,Dt as x,Qt as y,Ut as z};
@@ -1,4 +1,4 @@
1
- import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,aA as we,aB as R,aC as _,s as a,aD as je,F as ve,aE as Ce,e as t,aF as W,B as ye,G as q,ae as J,n as $e,af as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,az as Le,aG as Ae}from"./index-ZLrp5Bhh.js";import{d as Me,g as Fe,a as ze,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as Ge,e as He,f as Ue}from"./browseLayout.styles-BuE8ZzH7.js";import{u as De,L as Ke}from"./useStore-BC3A7db6.js";import{c as G,a as Oe,F as Ve,d as Ye,P as Ze,e as qe,H as Je,S as Qe}from"./categories-wrk9ttY6.js";import{L as H}from"./LoadMore-8od0F5L9.js";import{u as U}from"./useInfiniteGrid-SEfbanDp.js";import{E as D}from"./ErrorNotice-FoLpDD1-.js";import{G as K}from"./grid.styles-D-gTOGBC.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=Z,et=a.article`
1
+ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as J,aB as we,aC as R,aD as _,s as a,aE as je,H as ve,aF as Ce,e as t,aG as W,B as ye,J as Z,ag as q,n as $e,E as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,aA as Le,aH as Ae}from"./index-CQcgp1iN.js";import{d as Me,g as Fe,a as ze,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as He,e as Ge,f as Ue}from"./browseLayout.styles-DKcUvFq-.js";import{u as De,L as Ke}from"./useStore-DwuNHIk7.js";import{c as H,a as Oe,F as Ve,d as Ye,P as Je,e as Ze,H as qe,S as Qe}from"./categories-BU8sQA4o.js";import{L as G}from"./LoadMore-Bqx1IcKy.js";import{u as U}from"./useInfiniteGrid-qZQR98Xh.js";import{E as D}from"./ErrorNotice-BZqsZ4rX.js";import{G as K}from"./grid.styles-BlUHs1Am.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=J,et=a.article`
2
2
  height: 300px;
3
3
  background: ${m.bg};
4
4
  border-radius: ${X.card};
@@ -135,7 +135,7 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
135
135
  &:active {
136
136
  background: ${m.accentActive};
137
137
  }
138
- `;function xt({collection:r,cover:i,itemCount:n}){const l=Y(),{contractAddress:x,name:u,creator:f}=r,C=i==null||n==null,{data:d}=Ce(x,C),w=i==null?(d==null?void 0:d.items)??[]:[],g=n??(d==null?void 0:d.total);function b(){l(`/collection/${x}`)}return e.jsxs(et,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[e.jsx(tt,{children:i?e.jsx(it,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):w.length>0?e.jsx(ot,{items:w,tinted:!1}):null}),e.jsxs(at,{children:[e.jsx(rt,{title:u,children:u}),e.jsxs(nt,{children:[e.jsxs(st,{"data-meta":!0,"data-testid":"coll-card-meta",children:[f?e.jsx(ct,{address:f,linkToProfile:!0}):e.jsx(lt,{children:" "}),e.jsx(dt,{children:g==null?"…":t("collectionCard.itemCount",{count:g})})]}),e.jsx(ht,{"data-view":!0,"data-testid":"coll-card-view",onClick:h=>{h.stopPropagation(),b()},tabIndex:-1,children:t("collectionCard.viewCollection")})]})]})]})}function pt({address:r,className:i=""}){const n=W(x=>x.followed.includes(r.toLowerCase())),l=W(x=>x.toggle);return r?e.jsx(ye,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"aria-pressed":n,title:n?t("creator.unfollowTitle"):t("creator.followTitle"),onClick:()=>l(r),children:n?t("creator.following"):t("creator.follow")}):null}const{colors:v,radius:ee,media:j}=Z,te=q`
138
+ `;function xt({collection:r,cover:i,itemCount:n}){const l=Y(),{contractAddress:x,name:u,creator:f}=r,C=i==null||n==null,{data:d}=Ce(x,C),w=i==null?(d==null?void 0:d.items)??[]:[],g=n??(d==null?void 0:d.total);function b(){l(`/collection/${x}`)}return e.jsxs(et,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[e.jsx(tt,{children:i?e.jsx(it,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):w.length>0?e.jsx(ot,{items:w,tinted:!1}):null}),e.jsxs(at,{children:[e.jsx(rt,{title:u,children:u}),e.jsxs(nt,{children:[e.jsxs(st,{"data-meta":!0,"data-testid":"coll-card-meta",children:[f?e.jsx(ct,{address:f,linkToProfile:!0}):e.jsx(lt,{children:" "}),e.jsx(dt,{children:g==null?"…":t("collectionCard.itemCount",{count:g})})]}),e.jsx(ht,{"data-view":!0,"data-testid":"coll-card-view",onClick:h=>{h.stopPropagation(),b()},tabIndex:-1,children:t("collectionCard.viewCollection")})]})]})]})}function pt({address:r,className:i=""}){const n=W(x=>x.followed.includes(r.toLowerCase())),l=W(x=>x.toggle);return r?e.jsx(ye,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"aria-pressed":n,title:n?t("creator.unfollowTitle"):t("creator.followTitle"),onClick:()=>l(r),children:n?t("creator.following"):t("creator.follow")}):null}const{colors:v,radius:ee,media:j}=J,te=Z`
139
139
  display: inline-flex;
140
140
  align-items: center;
141
141
  justify-content: center;
@@ -197,7 +197,7 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
197
197
  right: 12px;
198
198
  gap: 6px;
199
199
  }
200
- `,ie=q`
200
+ `,ie=Z`
201
201
  display: flex;
202
202
  align-items: center;
203
203
  justify-content: center;
@@ -303,4 +303,4 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=Fe(ze({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":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Gt(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=J(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,F=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(G.find(o=>o.key===A)??G[0]).server,z={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:F,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",z],o=>Le({...z,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||F),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(Ge,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(He,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(H,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Ze,{"data-variant":"price",children:[e.jsxs(qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(Je,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(H,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Gt as Creator,Gt as default};
306
+ `,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=q(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=Fe(ze({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":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Ht(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=q(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,F=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(H.find(o=>o.key===A)??H[0]).server,z={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:F,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",z],o=>Le({...z,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||F),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(He,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Je,{"data-variant":"price",children:[e.jsxs(Ze,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(qe,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Ht as Creator,Ht as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-vyZjIDcS.js";import{I as i}from"./index-ZLrp5Bhh.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-vyZjIDcS.js";import{I as i}from"./index-CQcgp1iN.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-CrdKu7xI.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Dyfkmcym.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-wKXZD-Zq.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-SnHJ4jHh.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{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as T,m as he,e as r,h as p,n as ge,D as fe,aq as f,ao as me,l as N,ay as H,I as re,ai as D,z as E,aQ as K}from"./index-ZLrp5Bhh.js";import{R as O}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as je}from"./useCreditPacks-Diy15u3Q.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-BD8UMnC-.js";const P="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830708286.commit-6900e32/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830708286.commit-6900e32/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830708286.commit-6900e32/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830708286.commit-6900e32/_assets/credit-coin-CmcTCd5i.webp",ve="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",Se="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830708286.commit-6900e32/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
1
+ import{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as T,m as he,e as r,h as p,n as ge,D as fe,ar as f,ap as me,l as N,az as H,I as re,aj as D,z as E,aR as K}from"./index-CQcgp1iN.js";import{R as O}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as je}from"./useCreditPacks-BZBHQn_t.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-CM0Q2I_C.js";const P="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830755583.commit-4658b42/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830755583.commit-4658b42/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830755583.commit-4658b42/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830755583.commit-4658b42/_assets/credit-coin-CmcTCd5i.webp",ve="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",Se="https://cdn.decentraland.org/@dcl/shop/0.1.0-30830755583.commit-4658b42/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -136,7 +136,7 @@ import{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
136
136
  gap: 12px;
137
137
  row-gap: 24px;
138
138
  }
139
- `,q=i.button`
139
+ `,X=i.button`
140
140
  position: relative;
141
141
  display: flex;
142
142
  flex-direction: column;
@@ -256,7 +256,7 @@ import{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
256
256
  height: 18px;
257
257
  }
258
258
  }
259
- `,Q=i.span`
259
+ `,q=i.span`
260
260
  display: flex;
261
261
  flex-direction: column;
262
262
  align-items: center;
@@ -266,7 +266,7 @@ import{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
266
266
  ${e.media.maxWidth("mobile")} {
267
267
  padding-top: 16px;
268
268
  }
269
- `,X=i.span`
269
+ `,Q=i.span`
270
270
  display: flex;
271
271
  flex-direction: column;
272
272
  align-items: center;
@@ -392,15 +392,15 @@ import{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
392
392
  max-width: 100%;
393
393
  aspect-ratio: 1;
394
394
  border-radius: 16px;
395
- `,qe=i(F)`
395
+ `,Xe=i(F)`
396
396
  width: 100%;
397
397
  height: 48px;
398
398
  border-radius: ${e.radius.card};
399
- `,Qe=i.p`
399
+ `,qe=i.p`
400
400
  margin: 0;
401
401
  font-family: ${e.font.sans};
402
402
  color: ${e.colors.muted};
403
- `,Xe=i.div`
403
+ `,Qe=i.div`
404
404
  position: absolute;
405
405
  inset: 0;
406
406
  z-index: 1;
@@ -668,4 +668,4 @@ import{b as xe,u as ue,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
668
668
  margin: 0;
669
669
  font-family: ${e.font.sans};
670
670
  color: ${e.colors.err};
671
- `,j=Ce()?"mock":"stripe",te=[P,P,ne,se],kt={pack_5:P,pack_10:P,pack_25:ne,pack_50:se};function ae(a,s){return kt[a.id]??te[s%te.length]}function Ct(a,s){return a.artUrl??ae(a,s)}const jt="https://docs.decentraland.org";function ie(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const m=((s==null?void 0:s.message)??"").toLowerCase();return m.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):m.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function Tt(){var M;he({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=xe(),{session:s,signIn:m}=ge(),o=fe(),[b,x]=ue(),{packs:$,isLoading:y}=be(),[h,u]=l.useState("select"),[c,L]=l.useState(null),[v,W]=l.useState(null),de=(v!=null?(M=$.find(n=>n.credits===v))==null?void 0:M.artUrl:void 0)??$e,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const I=l.useCallback(()=>{x(n=>{const d=new URLSearchParams(n);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[x]),z=l.useCallback(async n=>{u("processing");const d=new AbortController;R.current=d;try{const g=await we(n,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(g.status==="credited"){const w=g.creditsGranted??(c==null?void 0:c.credits)??0;W(w>0?w:null),u("success"),f("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:j}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(O);if(S){sessionStorage.removeItem(O);const G=JSON.parse(S),U=me(G);if(U){a(U,{state:{item:G,resumeBuy:!0}});return}}}catch{}}else g.status==="pending"?(f("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),u("pending")):(f("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(g.error??r("getCredits.errorGrant",{currency:p.name})),u("error"))}catch(g){N(g,{flow:"get_credits",step:"grant",order_id:n}),f("Shop Buy Credits Failed",{step:"grant",error_code:H(g),pack_usd:(c==null?void 0:c.usd)??null}),k(ie(g)),u("error")}},[c,s,o,a]),pe=l.useCallback(async n=>{if(!s){m();return}k(null),_(!1),L(n),u(j==="mock"?"processing":"redirecting"),f("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:j});try{const d=await ke(n.id,{address:s.address,identity:s.identity});if(d.mock)z(d.orderId);else if(d.url)f("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){N(d,{flow:"get_credits",step:"checkout",provider:j}),f("Shop Buy Credits Failed",{step:"checkout",error_code:H(d),pack_usd:n.usd}),k(ie(d)),u("error")}},[s,m,z]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const n=b.get("order");if(b.get("canceled")!=null){A.current=!0,f("Shop Buy Credits Cancelled",{order_id:n,provider:j}),I(),_(!0),u("select");return}n&&(u("processing"),s&&(A.current=!0,I(),z(n)))},[b,s]);function B(){var n;(n=R.current)==null||n.abort(),u("select"),L(null),W(null),k(null),_(!1)}return t.jsxs(Pe,{children:[(h==="select"||h==="redirecting")&&t.jsxs(_e,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(ze,{$hidden:h==="redirecting",children:[t.jsxs(Ae,{children:[t.jsx(Be,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Te,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Fe,{href:jt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(re,{name:"link-out"})]})]})]}),le&&t.jsx(Le,{role:"status",children:r("getCredits.canceledNote")}),t.jsx($t,{packs:$,loading:y,onSelect:n=>void pe(n)})]}),h==="redirecting"&&t.jsxs(Xe,{role:"status","aria-live":"polite",children:[t.jsx(tt,{src:D,alt:"",width:72,height:72}),t.jsx(Ze,{children:r("getCredits.redirecting")})]})]}),h==="processing"&&t.jsxs(et,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:D,alt:"",width:61,height:61}),t.jsxs(it,{children:[t.jsxs(rt,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(nt,{"aria-hidden":!0,children:[t.jsx(ot,{children:t.jsx(at,{})}),t.jsx(dt,{children:"1/1"})]})]})]}),h==="success"&&t.jsxs(ct,{role:"status","aria-live":"polite",children:[t.jsxs(lt,{children:[t.jsx(pt,{src:ve,alt:"",width:60,height:60}),t.jsxs(xt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),v!=null&&t.jsx(ut,{children:t.jsxs(ht,{children:[t.jsx(gt,{src:de,alt:"",width:93,height:93}),t.jsxs(ft,{children:[t.jsx(E,{}),t.jsxs("span",{children:[t.jsx(mt,{children:r("getCredits.creditsAmount",{credits:v,currency:p.name})})," ",t.jsx(bt,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(wt,{children:[t.jsx(C,{"data-variant":"outline",onClick:B,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),h==="pending"&&t.jsxs(Z,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Qe,{children:r("getCredits.pendingBody")}),t.jsxs(ee,{children:[t.jsx(C,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:B,children:r("getCredits.done")})]})]}),h==="error"&&t.jsxs(Z,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(yt,{children:ce}),t.jsx(ee,{children:t.jsx(C,{onClick:B,children:r("getCredits.tryAgain")})})]})]})}function $t({packs:a,loading:s,onSelect:m}){return s?t.jsx(V,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(o=>t.jsxs(q,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Q,{children:[t.jsx(X,{children:t.jsx(Ye,{})}),t.jsx(Ve,{})]}),t.jsx(qe,{})]},o))}):t.jsx(V,{children:a.map((o,b)=>{const x=je(o,a);return t.jsxs(q,{type:"button","data-testid":"pack","data-best":o.bestValue?"true":void 0,onClick:()=>m(o),"aria-label":x?r("getCredits.packAriaBonus",{amount:K(o.credits),usd:o.usd,bonus:x.bonus,baseline:x.baseline}):r("getCredits.packAria",{amount:K(o.credits),usd:o.usd}),children:[o.bestValue&&t.jsxs(We,{children:[t.jsx(re,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(Q,{children:[t.jsxs(X,{children:[t.jsxs(Ie,{children:[t.jsx(E,{}),t.jsx(Me,{children:o.credits})]}),t.jsx(Ge,{children:r("getCredits.packUnit",{currency:p.name})}),t.jsxs(Ue,{"data-empty":x?void 0:"true","aria-hidden":!0,children:[t.jsx(E,{}),t.jsx(Ne,{children:x?x.baseline:0}),x&&t.jsx(He,{children:r("getCredits.packBonus",{bonus:x.bonus})})]})]}),t.jsx(De,{children:t.jsx("img",{src:Ct(o,b),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(o,b))}})})]}),t.jsxs(Ke,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{Tt as GetCredits,Tt as default};
671
+ `,j=Ce()?"mock":"stripe",te=[P,P,ne,se],kt={pack_5:P,pack_10:P,pack_25:ne,pack_50:se};function ae(a,s){return kt[a.id]??te[s%te.length]}function Ct(a,s){return a.artUrl??ae(a,s)}const jt="https://docs.decentraland.org";function ie(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const m=((s==null?void 0:s.message)??"").toLowerCase();return m.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):m.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function Tt(){var M;he({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=xe(),{session:s,signIn:m}=ge(),o=fe(),[b,x]=ue(),{packs:$,isLoading:y}=be(),[h,u]=l.useState("select"),[c,L]=l.useState(null),[v,W]=l.useState(null),de=(v!=null?(M=$.find(n=>n.credits===v))==null?void 0:M.artUrl:void 0)??$e,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const I=l.useCallback(()=>{x(n=>{const d=new URLSearchParams(n);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[x]),z=l.useCallback(async n=>{u("processing");const d=new AbortController;R.current=d;try{const g=await we(n,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(g.status==="credited"){const w=g.creditsGranted??(c==null?void 0:c.credits)??0;W(w>0?w:null),u("success"),f("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:j}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(O);if(S){sessionStorage.removeItem(O);const G=JSON.parse(S),U=me(G);if(U){a(U,{state:{item:G,resumeBuy:!0}});return}}}catch{}}else g.status==="pending"?(f("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),u("pending")):(f("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(g.error??r("getCredits.errorGrant",{currency:p.name})),u("error"))}catch(g){N(g,{flow:"get_credits",step:"grant",order_id:n}),f("Shop Buy Credits Failed",{step:"grant",error_code:H(g),pack_usd:(c==null?void 0:c.usd)??null}),k(ie(g)),u("error")}},[c,s,o,a]),pe=l.useCallback(async n=>{if(!s){m();return}k(null),_(!1),L(n),u(j==="mock"?"processing":"redirecting"),f("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:j});try{const d=await ke(n.id,{address:s.address,identity:s.identity});if(d.mock)z(d.orderId);else if(d.url)f("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){N(d,{flow:"get_credits",step:"checkout",provider:j}),f("Shop Buy Credits Failed",{step:"checkout",error_code:H(d),pack_usd:n.usd}),k(ie(d)),u("error")}},[s,m,z]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const n=b.get("order");if(b.get("canceled")!=null){A.current=!0,f("Shop Buy Credits Cancelled",{order_id:n,provider:j}),I(),_(!0),u("select");return}n&&(u("processing"),s&&(A.current=!0,I(),z(n)))},[b,s]);function B(){var n;(n=R.current)==null||n.abort(),u("select"),L(null),W(null),k(null),_(!1)}return t.jsxs(Pe,{children:[(h==="select"||h==="redirecting")&&t.jsxs(_e,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(ze,{$hidden:h==="redirecting",children:[t.jsxs(Ae,{children:[t.jsx(Be,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Te,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Fe,{href:jt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(re,{name:"link-out"})]})]})]}),le&&t.jsx(Le,{role:"status",children:r("getCredits.canceledNote")}),t.jsx($t,{packs:$,loading:y,onSelect:n=>void pe(n)})]}),h==="redirecting"&&t.jsxs(Qe,{role:"status","aria-live":"polite",children:[t.jsx(tt,{src:D,alt:"",width:72,height:72}),t.jsx(Ze,{children:r("getCredits.redirecting")})]})]}),h==="processing"&&t.jsxs(et,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:D,alt:"",width:61,height:61}),t.jsxs(it,{children:[t.jsxs(rt,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(nt,{"aria-hidden":!0,children:[t.jsx(ot,{children:t.jsx(at,{})}),t.jsx(dt,{children:"1/1"})]})]})]}),h==="success"&&t.jsxs(ct,{role:"status","aria-live":"polite",children:[t.jsxs(lt,{children:[t.jsx(pt,{src:ve,alt:"",width:60,height:60}),t.jsxs(xt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),v!=null&&t.jsx(ut,{children:t.jsxs(ht,{children:[t.jsx(gt,{src:de,alt:"",width:93,height:93}),t.jsxs(ft,{children:[t.jsx(E,{}),t.jsxs("span",{children:[t.jsx(mt,{children:r("getCredits.creditsAmount",{credits:v,currency:p.name})})," ",t.jsx(bt,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(wt,{children:[t.jsx(C,{"data-variant":"outline",onClick:B,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),h==="pending"&&t.jsxs(Z,{role:"status","aria-live":"polite",children:[t.jsx(J,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(qe,{children:r("getCredits.pendingBody")}),t.jsxs(ee,{children:[t.jsx(C,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:B,children:r("getCredits.done")})]})]}),h==="error"&&t.jsxs(Z,{role:"alert",children:[t.jsx(J,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(yt,{children:ce}),t.jsx(ee,{children:t.jsx(C,{onClick:B,children:r("getCredits.tryAgain")})})]})]})}function $t({packs:a,loading:s,onSelect:m}){return s?t.jsx(V,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(o=>t.jsxs(X,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(q,{children:[t.jsx(Q,{children:t.jsx(Ye,{})}),t.jsx(Ve,{})]}),t.jsx(Xe,{})]},o))}):t.jsx(V,{children:a.map((o,b)=>{const x=je(o,a);return t.jsxs(X,{type:"button","data-testid":"pack","data-best":o.bestValue?"true":void 0,onClick:()=>m(o),"aria-label":x?r("getCredits.packAriaBonus",{amount:K(o.credits),usd:o.usd,bonus:x.bonus,baseline:x.baseline}):r("getCredits.packAria",{amount:K(o.credits),usd:o.usd}),children:[o.bestValue&&t.jsxs(We,{children:[t.jsx(re,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(q,{children:[t.jsxs(Q,{children:[t.jsxs(Ie,{children:[t.jsx(E,{}),t.jsx(Me,{children:o.credits})]}),t.jsx(Ge,{children:r("getCredits.packUnit",{currency:p.name})}),t.jsxs(Ue,{"data-empty":x?void 0:"true","aria-hidden":!0,children:[t.jsx(E,{}),t.jsx(Ne,{children:x?x.baseline:0}),x&&t.jsx(He,{children:r("getCredits.packBonus",{bonus:x.bonus})})]})]}),t.jsx(De,{children:t.jsx("img",{src:Ct(o,b),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(o,b))}})})]}),t.jsxs(Ke,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{Tt as GetCredits,Tt as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BJpdqx6Q.js";import{d as g,r as v}from"./index-Dyfkmcym.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CrdKu7xI.js";import{au as y}from"./NetworkUtil-HlUKXKcF.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-6BrQFoiH.js";import{d as g,r as v}from"./index-SnHJ4jHh.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-wKXZD-Zq.js";import{au as y}from"./NetworkUtil-HlUKXKcF.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as R,B as I,z,aq as ne,aP as K,l as W,m as re,n as oe,D as ae,u as de,E as ce}from"./index-ZLrp5Bhh.js";import{i as le,R as pe,f as ge}from"./import-DdbcQXPQ.js";import{u as xe}from"./useSecondarySales-BdMq83Pz.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-CFAg0mL8.js";import"./authorizations-E8_0NGng.js";import"./sendMetaTransaction-CQ1T_6-I.js";import"./trade-encoding-BJQNrSRU.js";import"./mana-rate-DsLc4315.js";import"./mana-convert-BD8UMnC-.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
1
+ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as Q,B as I,z,ar as ne,aQ as K,l as W,m as re,n as oe,D as ae,u as de,F as ce}from"./index-CQcgp1iN.js";import{i as le,R as pe,f as ge}from"./import-HMOgDc9D.js";import{u as xe}from"./useSecondarySales-zW5jqf5K.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-F7fYGwQJ.js";import"./authorizations-Bz3S6EIM.js";import"./sendMetaTransaction-BGqAABs-.js";import"./trade-encoding-B96eH7PK.js";import"./mana-rate-CeJoK8Ap.js";import"./mana-convert-CM0Q2I_C.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
2
2
  0% {
3
3
  transform: scale(0);
4
4
  opacity: 0;
@@ -168,7 +168,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
168
168
  height: 14px;
169
169
  margin: 0;
170
170
  border-width: 2px;
171
- `,Ee=t.span`
171
+ `,Ne=t.span`
172
172
  width: 20px;
173
173
  height: 20px;
174
174
  border-radius: 50%;
@@ -177,9 +177,9 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
177
177
  display: grid;
178
178
  place-items: center;
179
179
  font-size: 12px;
180
- `,Ne=t.p`
180
+ `,Ee=t.p`
181
181
  margin: 12px 0 0;
182
- `;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,P]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,Q)=>Q===a?f?"skipped":"failed":B))}}}n||P("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,E=g.findIndex(n=>n==="active"),N=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(A==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:R.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",E>=0?i("migrate.progressCount",{current:E+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${N}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ee,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ne,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Re,radius:Ae}=S,D="@media (max-width: 620px)",G=t.div`
182
+ `;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[R,A]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,F)=>F===a?f?"skipped":"failed":B))}}}n||A("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,N=g.findIndex(n=>n==="active"),E=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(R==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:Q.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",N>=0?i("migrate.progressCount",{current:N+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${E}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ne,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ee,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Qe,radius:Re}=S,D="@media (max-width: 620px)",G=t.div`
183
183
  max-width: 520px;
184
184
  margin: 0 auto;
185
185
  text-align: center;
@@ -196,13 +196,13 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
196
196
  margin: 4px 0 0;
197
197
  `,V=t(I)`
198
198
  margin-top: 10px;
199
- `,Pe=t.div`
199
+ `,Ae=t.div`
200
200
  max-width: 860px;
201
201
  margin: 0 auto;
202
202
  padding-bottom: 120px;
203
- `,Qe=t.header`
203
+ `,Fe=t.header`
204
204
  margin-bottom: 18px;
205
- `,Fe=t.span`
205
+ `,Pe=t.span`
206
206
  display: inline-block;
207
207
  font-size: 12px;
208
208
  font-weight: 700;
@@ -220,7 +220,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
220
220
  line-height: 1.08;
221
221
  margin: 0 0 10px;
222
222
  `,Ke=t.span`
223
- background: ${Re.amethyst};
223
+ background: ${Qe.amethyst};
224
224
  -webkit-background-clip: text;
225
225
  background-clip: text;
226
226
  color: transparent;
@@ -317,7 +317,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
317
317
  `,Xe=t.div`
318
318
  width: 56px;
319
319
  height: 56px;
320
- border-radius: ${Ae.card};
320
+ border-radius: ${Re.card};
321
321
  overflow: hidden;
322
322
  flex: none;
323
323
  display: grid;
@@ -444,4 +444,4 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
444
444
  flex: 1 1 auto;
445
445
  `,xt=t(I)`
446
446
  padding: 13px 24px;
447
- `,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[P,k]=h.useState({}),[$,E]=h.useState(new Set),[N,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>P[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){E(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function Q(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Pe,{children:[e.jsxs(Qe,{children:[e.jsx(Fe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:R.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:R.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):A.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:F=>f(s.oldTradeId,F.target.value),"aria-label":i("importListings.priceAria",{currency:R.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(F=>({...F,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),N&&o?e.jsx(Be,{queue:N,session:o,onClose:()=>L(null),onDone:Q}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};
447
+ `,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),R=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[A,k]=h.useState({}),[$,N]=h.useState(new Set),[E,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>A[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){N(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function F(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Ae,{children:[e.jsxs(Fe,{children:[e.jsx(Pe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:Q.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:Q.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):R.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:P=>f(s.oldTradeId,P.target.value),"aria-label":i("importListings.priceAria",{currency:Q.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(P=>({...P,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),E&&o?e.jsx(Be,{queue:E,session:o,onClose:()=>L(null),onDone:F}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};