@m0-foundation/swap-component 0.0.1

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 (240) hide show
  1. package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js +28 -0
  2. package/dist/m0-swap-component/ConstantsUtil-btJ3XIXu.js.map +1 -0
  3. package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js +142 -0
  4. package/dist/m0-swap-component/HelpersUtil-5wkO4kIW.js.map +1 -0
  5. package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js +76 -0
  6. package/dist/m0-swap-component/PhArrowCircleDown-BiDIiYXi.js.map +1 -0
  7. package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js +76 -0
  8. package/dist/m0-swap-component/PhArrowClockwise-BRnlxNUR.js.map +1 -0
  9. package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js +76 -0
  10. package/dist/m0-swap-component/PhArrowDown-Co2hyXIs.js.map +1 -0
  11. package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js +76 -0
  12. package/dist/m0-swap-component/PhArrowLeft-Cb8ijwK6.js.map +1 -0
  13. package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js +76 -0
  14. package/dist/m0-swap-component/PhArrowRight-B9t--Gmh.js.map +1 -0
  15. package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js +76 -0
  16. package/dist/m0-swap-component/PhArrowSquareOut-eGBMEr5T.js.map +1 -0
  17. package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js +76 -0
  18. package/dist/m0-swap-component/PhArrowUp-CjSpT-xh.js.map +1 -0
  19. package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js +76 -0
  20. package/dist/m0-swap-component/PhArrowUpRight-B8u6wk-A.js.map +1 -0
  21. package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js +76 -0
  22. package/dist/m0-swap-component/PhArrowsClockwise-CBcfV6j6.js.map +1 -0
  23. package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js +76 -0
  24. package/dist/m0-swap-component/PhArrowsDownUp-CMVR84b1.js.map +1 -0
  25. package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js +76 -0
  26. package/dist/m0-swap-component/PhArrowsLeftRight-CmXk8rs2.js.map +1 -0
  27. package/dist/m0-swap-component/PhBank-BigtjnS8.js +76 -0
  28. package/dist/m0-swap-component/PhBank-BigtjnS8.js.map +1 -0
  29. package/dist/m0-swap-component/PhBrowser-BOulLD8D.js +76 -0
  30. package/dist/m0-swap-component/PhBrowser-BOulLD8D.js.map +1 -0
  31. package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js +76 -0
  32. package/dist/m0-swap-component/PhCaretDown-BvvZ65ad.js.map +1 -0
  33. package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js +76 -0
  34. package/dist/m0-swap-component/PhCaretLeft-DtwjZbZ7.js.map +1 -0
  35. package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js +76 -0
  36. package/dist/m0-swap-component/PhCaretRight-C8LuSZkO.js.map +1 -0
  37. package/dist/m0-swap-component/PhCaretUp-B2lAObip.js +76 -0
  38. package/dist/m0-swap-component/PhCaretUp-B2lAObip.js.map +1 -0
  39. package/dist/m0-swap-component/PhCheck-DQtuVrQf.js +76 -0
  40. package/dist/m0-swap-component/PhCheck-DQtuVrQf.js.map +1 -0
  41. package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js +76 -0
  42. package/dist/m0-swap-component/PhCircleHalf-CXfZ0QZv.js.map +1 -0
  43. package/dist/m0-swap-component/PhClock-CXsmuc_a.js +76 -0
  44. package/dist/m0-swap-component/PhClock-CXsmuc_a.js.map +1 -0
  45. package/dist/m0-swap-component/PhCompass-Cg-qnMon.js +76 -0
  46. package/dist/m0-swap-component/PhCompass-Cg-qnMon.js.map +1 -0
  47. package/dist/m0-swap-component/PhCopy-kGRKcvb4.js +76 -0
  48. package/dist/m0-swap-component/PhCopy-kGRKcvb4.js.map +1 -0
  49. package/dist/m0-swap-component/PhCreditCard-jYFausLO.js +76 -0
  50. package/dist/m0-swap-component/PhCreditCard-jYFausLO.js.map +1 -0
  51. package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js +76 -0
  52. package/dist/m0-swap-component/PhCurrencyDollar-C8vSY3fy.js.map +1 -0
  53. package/dist/m0-swap-component/PhDesktop-AczlBCho.js +76 -0
  54. package/dist/m0-swap-component/PhDesktop-AczlBCho.js.map +1 -0
  55. package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js +76 -0
  56. package/dist/m0-swap-component/PhDeviceMobile-3rFbdWLA.js.map +1 -0
  57. package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js +76 -0
  58. package/dist/m0-swap-component/PhDotsThree-cJsXXsvY.js.map +1 -0
  59. package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js +76 -0
  60. package/dist/m0-swap-component/PhEnvelope-C1bxHVXw.js.map +1 -0
  61. package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js +76 -0
  62. package/dist/m0-swap-component/PhFunnelSimple-DhqB9fsu.js.map +1 -0
  63. package/dist/m0-swap-component/PhGlobe-BFp6kx95.js +76 -0
  64. package/dist/m0-swap-component/PhGlobe-BFp6kx95.js.map +1 -0
  65. package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js +76 -0
  66. package/dist/m0-swap-component/PhIdentificationCard-BdYxckWB.js.map +1 -0
  67. package/dist/m0-swap-component/PhImage-CXxX5oq3.js +76 -0
  68. package/dist/m0-swap-component/PhImage-CXxX5oq3.js.map +1 -0
  69. package/dist/m0-swap-component/PhInfo-BcuP36hY.js +76 -0
  70. package/dist/m0-swap-component/PhInfo-BcuP36hY.js.map +1 -0
  71. package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js +76 -0
  72. package/dist/m0-swap-component/PhLightbulb-DkWwRl94.js.map +1 -0
  73. package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js +76 -0
  74. package/dist/m0-swap-component/PhMagnifyingGlass-B_fFjslY.js.map +1 -0
  75. package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js +76 -0
  76. package/dist/m0-swap-component/PhPaperPlaneRight-BIzGG3QW.js.map +1 -0
  77. package/dist/m0-swap-component/PhPlus-BGosT2zu.js +76 -0
  78. package/dist/m0-swap-component/PhPlus-BGosT2zu.js.map +1 -0
  79. package/dist/m0-swap-component/PhPower-BMqDnP1n.js +76 -0
  80. package/dist/m0-swap-component/PhPower-BMqDnP1n.js.map +1 -0
  81. package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js +76 -0
  82. package/dist/m0-swap-component/PhPuzzlePiece-DNMpiJNU.js.map +1 -0
  83. package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js +76 -0
  84. package/dist/m0-swap-component/PhQrCode-DrHkqrU4.js.map +1 -0
  85. package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js +76 -0
  86. package/dist/m0-swap-component/PhQuestion-zTfvwqNz.js.map +1 -0
  87. package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js +76 -0
  88. package/dist/m0-swap-component/PhQuestionMark-h3Nk1Yf1.js.map +1 -0
  89. package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js +76 -0
  90. package/dist/m0-swap-component/PhSealCheck-DPPqSt6G.js.map +1 -0
  91. package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js +76 -0
  92. package/dist/m0-swap-component/PhSignOut-CJgnrE_v.js.map +1 -0
  93. package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js +76 -0
  94. package/dist/m0-swap-component/PhSpinner-CMTEIWbw.js.map +1 -0
  95. package/dist/m0-swap-component/PhTrash-CeDVW4am.js +76 -0
  96. package/dist/m0-swap-component/PhTrash-CeDVW4am.js.map +1 -0
  97. package/dist/m0-swap-component/PhUser-lQ9WUtAV.js +76 -0
  98. package/dist/m0-swap-component/PhUser-lQ9WUtAV.js.map +1 -0
  99. package/dist/m0-swap-component/PhVault-EnLnS_IQ.js +76 -0
  100. package/dist/m0-swap-component/PhVault-EnLnS_IQ.js.map +1 -0
  101. package/dist/m0-swap-component/PhWallet-CUeDZydd.js +76 -0
  102. package/dist/m0-swap-component/PhWallet-CUeDZydd.js.map +1 -0
  103. package/dist/m0-swap-component/PhWarning-CokeGZs2.js +76 -0
  104. package/dist/m0-swap-component/PhWarning-CokeGZs2.js.map +1 -0
  105. package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js +76 -0
  106. package/dist/m0-swap-component/PhWarningCircle-vWtA7S0R.js.map +1 -0
  107. package/dist/m0-swap-component/PhX-DwCRIvoc.js +76 -0
  108. package/dist/m0-swap-component/PhX-DwCRIvoc.js.map +1 -0
  109. package/dist/m0-swap-component/data-capture-BmovBbKV.js +573 -0
  110. package/dist/m0-swap-component/data-capture-BmovBbKV.js.map +1 -0
  111. package/dist/m0-swap-component/email-B4niz3Ms.js +445 -0
  112. package/dist/m0-swap-component/email-B4niz3Ms.js.map +1 -0
  113. package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js +988 -0
  114. package/dist/m0-swap-component/embedded-wallet-D6bzjX_K.js.map +1 -0
  115. package/dist/m0-swap-component/features-EhJNVE-M.js +355 -0
  116. package/dist/m0-swap-component/features-EhJNVE-M.js.map +1 -0
  117. package/dist/m0-swap-component/if-defined-2CMpVr2R.js +12 -0
  118. package/dist/m0-swap-component/if-defined-2CMpVr2R.js.map +1 -0
  119. package/dist/m0-swap-component/index-B4xuj7uR.js +965 -0
  120. package/dist/m0-swap-component/index-B4xuj7uR.js.map +1 -0
  121. package/dist/m0-swap-component/index-BVZ66GYf.js +206 -0
  122. package/dist/m0-swap-component/index-BVZ66GYf.js.map +1 -0
  123. package/dist/m0-swap-component/index-BZXyMieH.js +150 -0
  124. package/dist/m0-swap-component/index-BZXyMieH.js.map +1 -0
  125. package/dist/m0-swap-component/index-Bj5sA_Ri.js +252 -0
  126. package/dist/m0-swap-component/index-Bj5sA_Ri.js.map +1 -0
  127. package/dist/m0-swap-component/index-Bs-pPJYj.js +129 -0
  128. package/dist/m0-swap-component/index-Bs-pPJYj.js.map +1 -0
  129. package/dist/m0-swap-component/index-CMS76VPf.js +474 -0
  130. package/dist/m0-swap-component/index-CMS76VPf.js.map +1 -0
  131. package/dist/m0-swap-component/index-CoMTkqee.js +95 -0
  132. package/dist/m0-swap-component/index-CoMTkqee.js.map +1 -0
  133. package/dist/m0-swap-component/index-DE0OtbL2.js +3566 -0
  134. package/dist/m0-swap-component/index-DE0OtbL2.js.map +1 -0
  135. package/dist/m0-swap-component/index-DEG-YczD.js +231 -0
  136. package/dist/m0-swap-component/index-DEG-YczD.js.map +1 -0
  137. package/dist/m0-swap-component/index-DY_Ijq_4.js +4345 -0
  138. package/dist/m0-swap-component/index-DY_Ijq_4.js.map +1 -0
  139. package/dist/m0-swap-component/index-IRpGhIhy.js +9394 -0
  140. package/dist/m0-swap-component/index-IRpGhIhy.js.map +1 -0
  141. package/dist/m0-swap-component/index-Z70nBYWG.js +113 -0
  142. package/dist/m0-swap-component/index-Z70nBYWG.js.map +1 -0
  143. package/dist/m0-swap-component/index-iNFotRMa.js +73 -0
  144. package/dist/m0-swap-component/index-iNFotRMa.js.map +1 -0
  145. package/dist/m0-swap-component/index-n1fooC-v.js +37757 -0
  146. package/dist/m0-swap-component/index-n1fooC-v.js.map +1 -0
  147. package/dist/m0-swap-component/index.esm.js +2 -0
  148. package/dist/m0-swap-component/index.esm.js.map +1 -0
  149. package/dist/m0-swap-component/loader.esm.js.map +1 -0
  150. package/dist/m0-swap-component/m0-swap-component.esm.js +48 -0
  151. package/dist/m0-swap-component/m0-swap-component.esm.js.map +1 -0
  152. package/dist/m0-swap-component/native-CPtqJIn7.js +18 -0
  153. package/dist/m0-swap-component/native-CPtqJIn7.js.map +1 -0
  154. package/dist/m0-swap-component/onramp-BppY2eDR.js +1003 -0
  155. package/dist/m0-swap-component/onramp-BppY2eDR.js.map +1 -0
  156. package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js +639 -0
  157. package/dist/m0-swap-component/pay-with-exchange-BJYQgTMB.js.map +1 -0
  158. package/dist/m0-swap-component/property-BN-VaT99.js +625 -0
  159. package/dist/m0-swap-component/property-BN-VaT99.js.map +1 -0
  160. package/dist/m0-swap-component/receive-BptRM_5_.js +281 -0
  161. package/dist/m0-swap-component/receive-BptRM_5_.js.map +1 -0
  162. package/dist/m0-swap-component/ref-3xALOvo5.js +25 -0
  163. package/dist/m0-swap-component/ref-3xALOvo5.js.map +1 -0
  164. package/dist/m0-swap-component/send-BCyHM4Zr.js +1408 -0
  165. package/dist/m0-swap-component/send-BCyHM4Zr.js.map +1 -0
  166. package/dist/m0-swap-component/socials-BbajCSWV.js +824 -0
  167. package/dist/m0-swap-component/socials-BbajCSWV.js.map +1 -0
  168. package/dist/m0-swap-component/swap-module-5ZLM-vAV.js +140887 -0
  169. package/dist/m0-swap-component/swap-module-5ZLM-vAV.js.map +1 -0
  170. package/dist/m0-swap-component/swap-module.entry.esm.js.map +1 -0
  171. package/dist/m0-swap-component/swap-module.entry.js +15 -0
  172. package/dist/m0-swap-component/swaps-DyGe65DR.js +2121 -0
  173. package/dist/m0-swap-component/swaps-DyGe65DR.js.map +1 -0
  174. package/dist/m0-swap-component/transactions-BZ9l4zt5.js +60 -0
  175. package/dist/m0-swap-component/transactions-BZ9l4zt5.js.map +1 -0
  176. package/dist/m0-swap-component/utils-RCeZbvdb.js +95 -0
  177. package/dist/m0-swap-component/utils-RCeZbvdb.js.map +1 -0
  178. package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js +2097 -0
  179. package/dist/m0-swap-component/w3m-modal-D0HWVPsj.js.map +1 -0
  180. package/dist/m0-swap-component/wui-button-BeTWD3Va.js +223 -0
  181. package/dist/m0-swap-component/wui-button-BeTWD3Va.js.map +1 -0
  182. package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js +65 -0
  183. package/dist/m0-swap-component/wui-email-input-CgnfUH0c.js.map +1 -0
  184. package/dist/m0-swap-component/wui-icon-B0uTDhW-.js +4 -0
  185. package/dist/m0-swap-component/wui-icon-B0uTDhW-.js.map +1 -0
  186. package/dist/m0-swap-component/wui-icon-box-s87lODBB.js +4 -0
  187. package/dist/m0-swap-component/wui-icon-box-s87lODBB.js.map +1 -0
  188. package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js +127 -0
  189. package/dist/m0-swap-component/wui-icon-link-BFpV9kPE.js.map +1 -0
  190. package/dist/m0-swap-component/wui-image-BvjxoR51.js +4 -0
  191. package/dist/m0-swap-component/wui-image-BvjxoR51.js.map +1 -0
  192. package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js +182 -0
  193. package/dist/m0-swap-component/wui-input-amount-CWQfP3RO.js.map +1 -0
  194. package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js +4 -0
  195. package/dist/m0-swap-component/wui-input-text-g0sN4B2y.js.map +1 -0
  196. package/dist/m0-swap-component/wui-link-VqM3wLny.js +123 -0
  197. package/dist/m0-swap-component/wui-link-VqM3wLny.js.map +1 -0
  198. package/dist/m0-swap-component/wui-list-item-BIijofqN.js +170 -0
  199. package/dist/m0-swap-component/wui-list-item-BIijofqN.js.map +1 -0
  200. package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js +119 -0
  201. package/dist/m0-swap-component/wui-list-social-C7GhkRc8.js.map +1 -0
  202. package/dist/m0-swap-component/wui-list-token-C94lmAbT.js +134 -0
  203. package/dist/m0-swap-component/wui-list-token-C94lmAbT.js.map +1 -0
  204. package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js +622 -0
  205. package/dist/m0-swap-component/wui-list-wallet-C7fnQvCW.js.map +1 -0
  206. package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js +4 -0
  207. package/dist/m0-swap-component/wui-loading-spinner-CW2_5SKA.js.map +1 -0
  208. package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js +337 -0
  209. package/dist/m0-swap-component/wui-loading-thumbnail-y3sGkT5j.js.map +1 -0
  210. package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js +3412 -0
  211. package/dist/m0-swap-component/wui-qr-code-DekJTDGf.js.map +1 -0
  212. package/dist/m0-swap-component/wui-separator-DMZIL_Av.js +67 -0
  213. package/dist/m0-swap-component/wui-separator-DMZIL_Av.js.map +1 -0
  214. package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js +4 -0
  215. package/dist/m0-swap-component/wui-shimmer-CVFC8fMx.js.map +1 -0
  216. package/dist/m0-swap-component/wui-text-BS_lZKY4.js +1127 -0
  217. package/dist/m0-swap-component/wui-text-BS_lZKY4.js.map +1 -0
  218. package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js +214 -0
  219. package/dist/m0-swap-component/wui-token-button-CsOFoNJG.js.map +1 -0
  220. package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js +565 -0
  221. package/dist/m0-swap-component/wui-visual-hU2Mkyrv.js.map +1 -0
  222. package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js +459 -0
  223. package/dist/m0-swap-component/wui-wallet-switch-CWbdtfbN.js.map +1 -0
  224. package/dist/types/components/swap-module/balances.d.ts +16 -0
  225. package/dist/types/components/swap-module/chains.d.ts +16 -0
  226. package/dist/types/components/swap-module/store.d.ts +34 -0
  227. package/dist/types/components/swap-module/swap-module.d.ts +113 -0
  228. package/dist/types/components/swap-module/utils/constants.d.ts +7 -0
  229. package/dist/types/components/swap-module/utils/formatters.d.ts +23 -0
  230. package/dist/types/components/swap-module/utils/reown.d.ts +59 -0
  231. package/dist/types/components/swap-module/utils/wallet.d.ts +83 -0
  232. package/dist/types/components.d.ts +165 -0
  233. package/dist/types/index.d.ts +1 -0
  234. package/dist/types/stencil-public-runtime.d.ts +1732 -0
  235. package/loader/cdn.js +1 -0
  236. package/loader/index.cjs.js +1 -0
  237. package/loader/index.d.ts +24 -0
  238. package/loader/index.es2017.js +1 -0
  239. package/loader/index.js +2 -0
  240. package/package.json +60 -0
@@ -0,0 +1,965 @@
1
+ import { d as css, a as i, b, c as customElement, r as resetStyles, h as ChainController, a7 as TransactionsController, n as CoreHelperUtil, a8 as TransactionUtil, R as RouterController, O as OptionsController, o as EventsController, k as getPreferredAccountType, l as W3mFrameRpcConstants, a9 as DateUtil } from './swap-module-5ZLM-vAV.js';
2
+ import { n, r } from './wui-text-BS_lZKY4.js';
3
+ import './wui-icon-box-s87lODBB.js';
4
+ import './wui-link-VqM3wLny.js';
5
+ import { o } from './if-defined-2CMpVr2R.js';
6
+ import './index-BZXyMieH.js';
7
+ import './index-Bs-pPJYj.js';
8
+ import './index-iNFotRMa.js';
9
+
10
+ var TransactionTypePastTense;
11
+ (function (TransactionTypePastTense) {
12
+ TransactionTypePastTense["approve"] = "approved";
13
+ TransactionTypePastTense["bought"] = "bought";
14
+ TransactionTypePastTense["borrow"] = "borrowed";
15
+ TransactionTypePastTense["burn"] = "burnt";
16
+ TransactionTypePastTense["cancel"] = "canceled";
17
+ TransactionTypePastTense["claim"] = "claimed";
18
+ TransactionTypePastTense["deploy"] = "deployed";
19
+ TransactionTypePastTense["deposit"] = "deposited";
20
+ TransactionTypePastTense["execute"] = "executed";
21
+ TransactionTypePastTense["mint"] = "minted";
22
+ TransactionTypePastTense["receive"] = "received";
23
+ TransactionTypePastTense["repay"] = "repaid";
24
+ TransactionTypePastTense["send"] = "sent";
25
+ TransactionTypePastTense["sell"] = "sold";
26
+ TransactionTypePastTense["stake"] = "staked";
27
+ TransactionTypePastTense["trade"] = "swapped";
28
+ TransactionTypePastTense["unstake"] = "unstaked";
29
+ TransactionTypePastTense["withdraw"] = "withdrawn";
30
+ })(TransactionTypePastTense || (TransactionTypePastTense = {}));
31
+
32
+ var styles$4 = css `
33
+ :host > wui-flex {
34
+ display: flex;
35
+ justify-content: center;
36
+ align-items: center;
37
+ position: relative;
38
+ width: 40px;
39
+ height: 40px;
40
+ box-shadow: inset 0 0 0 1px ${({ tokens }) => tokens.core.glass010};
41
+ background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
42
+ }
43
+
44
+ :host([data-no-images='true']) > wui-flex {
45
+ background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
46
+ border-radius: ${({ borderRadius }) => borderRadius[3]} !important;
47
+ }
48
+
49
+ :host > wui-flex wui-image {
50
+ display: block;
51
+ }
52
+
53
+ :host > wui-flex,
54
+ :host > wui-flex wui-image,
55
+ .swap-images-container,
56
+ .swap-images-container.nft,
57
+ wui-image.nft {
58
+ border-top-left-radius: var(--local-left-border-radius);
59
+ border-top-right-radius: var(--local-right-border-radius);
60
+ border-bottom-left-radius: var(--local-left-border-radius);
61
+ border-bottom-right-radius: var(--local-right-border-radius);
62
+ }
63
+
64
+ .swap-images-container {
65
+ position: relative;
66
+ width: 40px;
67
+ height: 40px;
68
+ overflow: hidden;
69
+ }
70
+
71
+ .swap-images-container wui-image:first-child {
72
+ position: absolute;
73
+ width: 40px;
74
+ height: 40px;
75
+ top: 0;
76
+ left: 0%;
77
+ clip-path: inset(0px calc(50% + 2px) 0px 0%);
78
+ }
79
+
80
+ .swap-images-container wui-image:last-child {
81
+ clip-path: inset(0px 0px 0px calc(50% + 2px));
82
+ }
83
+
84
+ .swap-fallback-container {
85
+ position: absolute;
86
+ inset: 0;
87
+ width: 40px;
88
+ height: 40px;
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ }
93
+
94
+ .swap-fallback-container.first {
95
+ clip-path: inset(0px calc(50% + 2px) 0px 0%);
96
+ }
97
+
98
+ .swap-fallback-container.last {
99
+ clip-path: inset(0px 0px 0px calc(50% + 2px));
100
+ }
101
+
102
+ wui-flex.status-box {
103
+ position: absolute;
104
+ right: 0;
105
+ bottom: 0;
106
+ transform: translate(20%, 20%);
107
+ border-radius: ${({ borderRadius }) => borderRadius[4]};
108
+ background-color: ${({ tokens }) => tokens.theme.backgroundPrimary};
109
+ box-shadow: 0 0 0 2px ${({ tokens }) => tokens.theme.backgroundPrimary};
110
+ overflow: hidden;
111
+ width: 16px;
112
+ height: 16px;
113
+ }
114
+ `;
115
+
116
+ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
117
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
118
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
119
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
120
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
121
+ };
122
+ let WuiTransactionVisual = class WuiTransactionVisual extends i {
123
+ constructor() {
124
+ super(...arguments);
125
+ this.images = [];
126
+ this.secondImage = {
127
+ type: undefined,
128
+ url: ''
129
+ };
130
+ this.failedImageUrls = new Set();
131
+ }
132
+ handleImageError(url) {
133
+ return (event) => {
134
+ event.stopPropagation();
135
+ this.failedImageUrls.add(url);
136
+ this.requestUpdate();
137
+ };
138
+ }
139
+ render() {
140
+ const [firstImage, secondImage] = this.images;
141
+ if (!this.images.length) {
142
+ this.dataset['noImages'] = 'true';
143
+ }
144
+ const isLeftNFT = firstImage?.type === 'NFT';
145
+ const isRightNFT = secondImage?.url ? secondImage.type === 'NFT' : isLeftNFT;
146
+ const leftRadius = isLeftNFT ? 'var(--apkt-borderRadius-3)' : 'var(--apkt-borderRadius-5)';
147
+ const rightRadius = isRightNFT ? 'var(--apkt-borderRadius-3)' : 'var(--apkt-borderRadius-5)';
148
+ this.style.cssText = `
149
+ --local-left-border-radius: ${leftRadius};
150
+ --local-right-border-radius: ${rightRadius};
151
+ `;
152
+ return b `<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`;
153
+ }
154
+ templateVisual() {
155
+ const [firstImage, secondImage] = this.images;
156
+ const hasTwoImages = this.images.length === 2;
157
+ if (hasTwoImages && (firstImage?.url || secondImage?.url)) {
158
+ return this.renderSwapImages(firstImage, secondImage);
159
+ }
160
+ if (firstImage?.url && !this.failedImageUrls.has(firstImage.url)) {
161
+ return this.renderSingleImage(firstImage);
162
+ }
163
+ if (firstImage?.type === 'NFT') {
164
+ return this.renderPlaceholderIcon('nftPlaceholder');
165
+ }
166
+ return this.renderPlaceholderIcon('coinPlaceholder');
167
+ }
168
+ renderSwapImages(firstImage, secondImage) {
169
+ return b `<div class="swap-images-container">
170
+ ${firstImage?.url ? this.renderImageOrFallback(firstImage, 'first', true) : null}
171
+ ${secondImage?.url ? this.renderImageOrFallback(secondImage, 'last', true) : null}
172
+ </div>`;
173
+ }
174
+ renderSingleImage(image) {
175
+ return this.renderImageOrFallback(image, undefined, false);
176
+ }
177
+ renderImageOrFallback(image, position, isInSwapContainer = false) {
178
+ if (!image.url) {
179
+ return null;
180
+ }
181
+ if (this.failedImageUrls.has(image.url)) {
182
+ if (isInSwapContainer && position) {
183
+ return this.renderFallbackIconInContainer(position);
184
+ }
185
+ return this.renderFallbackIcon();
186
+ }
187
+ return b `<wui-image
188
+ src=${image.url}
189
+ alt="Transaction image"
190
+ @onLoadError=${this.handleImageError(image.url)}
191
+ ></wui-image>`;
192
+ }
193
+ renderFallbackIconInContainer(position) {
194
+ return b `<div class="swap-fallback-container ${position}">${this.renderFallbackIcon()}</div>`;
195
+ }
196
+ renderFallbackIcon() {
197
+ return b `<wui-icon
198
+ size="xl"
199
+ weight="regular"
200
+ color="default"
201
+ name="networkPlaceholder"
202
+ ></wui-icon>`;
203
+ }
204
+ renderPlaceholderIcon(iconName) {
205
+ return b `<wui-icon size="xl" weight="regular" color="default" name=${iconName}></wui-icon>`;
206
+ }
207
+ templateIcon() {
208
+ let color = 'accent-primary';
209
+ let icon = undefined;
210
+ icon = this.getIcon();
211
+ if (this.status) {
212
+ color = this.getStatusColor();
213
+ }
214
+ if (!icon) {
215
+ return null;
216
+ }
217
+ return b `
218
+ <wui-flex alignItems="center" justifyContent="center" class="status-box">
219
+ <wui-icon-box size="sm" color=${color} icon=${icon}></wui-icon-box>
220
+ </wui-flex>
221
+ `;
222
+ }
223
+ getDirectionIcon() {
224
+ switch (this.direction) {
225
+ case 'in':
226
+ return 'arrowBottom';
227
+ case 'out':
228
+ return 'arrowTop';
229
+ default:
230
+ return undefined;
231
+ }
232
+ }
233
+ getIcon() {
234
+ if (this.onlyDirectionIcon) {
235
+ return this.getDirectionIcon();
236
+ }
237
+ if (this.type === 'trade') {
238
+ return 'swapHorizontal';
239
+ }
240
+ else if (this.type === 'approve') {
241
+ return 'checkmark';
242
+ }
243
+ else if (this.type === 'cancel') {
244
+ return 'close';
245
+ }
246
+ return this.getDirectionIcon();
247
+ }
248
+ getStatusColor() {
249
+ switch (this.status) {
250
+ case 'confirmed':
251
+ return 'success';
252
+ case 'failed':
253
+ return 'error';
254
+ case 'pending':
255
+ return 'inverse';
256
+ default:
257
+ return 'accent-primary';
258
+ }
259
+ }
260
+ };
261
+ WuiTransactionVisual.styles = [styles$4];
262
+ __decorate$4([
263
+ n()
264
+ ], WuiTransactionVisual.prototype, "type", void 0);
265
+ __decorate$4([
266
+ n()
267
+ ], WuiTransactionVisual.prototype, "status", void 0);
268
+ __decorate$4([
269
+ n()
270
+ ], WuiTransactionVisual.prototype, "direction", void 0);
271
+ __decorate$4([
272
+ n({ type: Boolean })
273
+ ], WuiTransactionVisual.prototype, "onlyDirectionIcon", void 0);
274
+ __decorate$4([
275
+ n({ type: Array })
276
+ ], WuiTransactionVisual.prototype, "images", void 0);
277
+ __decorate$4([
278
+ n({ type: Object })
279
+ ], WuiTransactionVisual.prototype, "secondImage", void 0);
280
+ __decorate$4([
281
+ r()
282
+ ], WuiTransactionVisual.prototype, "failedImageUrls", void 0);
283
+ WuiTransactionVisual = __decorate$4([
284
+ customElement('wui-transaction-visual')
285
+ ], WuiTransactionVisual);
286
+
287
+ var styles$3 = css `
288
+ :host {
289
+ width: 100%;
290
+ }
291
+
292
+ :host > wui-flex:first-child {
293
+ align-items: center;
294
+ column-gap: ${({ spacing }) => spacing[2]};
295
+ padding: ${({ spacing }) => spacing[1]} ${({ spacing }) => spacing[2]};
296
+ width: 100%;
297
+ }
298
+
299
+ :host > wui-flex:first-child wui-text:nth-child(1) {
300
+ text-transform: capitalize;
301
+ }
302
+
303
+ wui-transaction-visual {
304
+ width: 40px;
305
+ height: 40px;
306
+ }
307
+
308
+ wui-flex {
309
+ flex: 1;
310
+ }
311
+
312
+ :host wui-flex wui-flex {
313
+ overflow: hidden;
314
+ }
315
+
316
+ :host .description-container wui-text span {
317
+ word-break: break-all;
318
+ }
319
+
320
+ :host .description-container wui-text {
321
+ overflow: hidden;
322
+ }
323
+
324
+ :host .description-separator-icon {
325
+ margin: 0px 6px;
326
+ }
327
+
328
+ :host wui-text > span {
329
+ overflow: hidden;
330
+ display: -webkit-box;
331
+ -webkit-box-orient: vertical;
332
+ -webkit-line-clamp: 1;
333
+ }
334
+ `;
335
+
336
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
337
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
338
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
339
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
340
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
341
+ };
342
+ let WuiTransactionListItem = class WuiTransactionListItem extends i {
343
+ constructor() {
344
+ super(...arguments);
345
+ this.type = 'approve';
346
+ this.onlyDirectionIcon = false;
347
+ this.images = [];
348
+ }
349
+ render() {
350
+ return b `
351
+ <wui-flex>
352
+ <wui-transaction-visual
353
+ .status=${this.status}
354
+ direction=${o(this.direction)}
355
+ type=${this.type}
356
+ .onlyDirectionIcon=${this.onlyDirectionIcon}
357
+ .images=${this.images}
358
+ ></wui-transaction-visual>
359
+ <wui-flex flexDirection="column" gap="1">
360
+ <wui-text variant="lg-medium" color="primary">
361
+ ${TransactionTypePastTense[this.type] || this.type}
362
+ </wui-text>
363
+ <wui-flex class="description-container">
364
+ ${this.templateDescription()} ${this.templateSecondDescription()}
365
+ </wui-flex>
366
+ </wui-flex>
367
+ <wui-text variant="sm-medium" color="secondary"><span>${this.date}</span></wui-text>
368
+ </wui-flex>
369
+ `;
370
+ }
371
+ templateDescription() {
372
+ const description = this.descriptions?.[0];
373
+ return description
374
+ ? b `
375
+ <wui-text variant="md-regular" color="secondary">
376
+ <span>${description}</span>
377
+ </wui-text>
378
+ `
379
+ : null;
380
+ }
381
+ templateSecondDescription() {
382
+ const description = this.descriptions?.[1];
383
+ return description
384
+ ? b `
385
+ <wui-icon class="description-separator-icon" size="sm" name="arrowRight"></wui-icon>
386
+ <wui-text variant="md-regular" color="secondary">
387
+ <span>${description}</span>
388
+ </wui-text>
389
+ `
390
+ : null;
391
+ }
392
+ };
393
+ WuiTransactionListItem.styles = [resetStyles, styles$3];
394
+ __decorate$3([
395
+ n()
396
+ ], WuiTransactionListItem.prototype, "type", void 0);
397
+ __decorate$3([
398
+ n({ type: Array })
399
+ ], WuiTransactionListItem.prototype, "descriptions", void 0);
400
+ __decorate$3([
401
+ n()
402
+ ], WuiTransactionListItem.prototype, "date", void 0);
403
+ __decorate$3([
404
+ n({ type: Boolean })
405
+ ], WuiTransactionListItem.prototype, "onlyDirectionIcon", void 0);
406
+ __decorate$3([
407
+ n()
408
+ ], WuiTransactionListItem.prototype, "status", void 0);
409
+ __decorate$3([
410
+ n()
411
+ ], WuiTransactionListItem.prototype, "direction", void 0);
412
+ __decorate$3([
413
+ n({ type: Array })
414
+ ], WuiTransactionListItem.prototype, "images", void 0);
415
+ WuiTransactionListItem = __decorate$3([
416
+ customElement('wui-transaction-list-item')
417
+ ], WuiTransactionListItem);
418
+
419
+ var styles$2 = css `
420
+ wui-flex {
421
+ position: relative;
422
+ display: inline-flex;
423
+ justify-content: center;
424
+ align-items: center;
425
+ }
426
+
427
+ wui-image {
428
+ border-radius: ${({ borderRadius }) => borderRadius[128]};
429
+ }
430
+
431
+ .fallback-icon {
432
+ color: ${({ tokens }) => tokens.theme.iconInverse};
433
+ border-radius: ${({ borderRadius }) => borderRadius[3]};
434
+ background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
435
+ }
436
+
437
+ .direction-icon,
438
+ .status-image {
439
+ position: absolute;
440
+ right: 0;
441
+ bottom: 0;
442
+ border-radius: ${({ borderRadius }) => borderRadius[128]};
443
+ border: 2px solid ${({ tokens }) => tokens.theme.backgroundPrimary};
444
+ }
445
+
446
+ .direction-icon {
447
+ padding: ${({ spacing }) => spacing['01']};
448
+ color: ${({ tokens }) => tokens.core.iconSuccess};
449
+
450
+ background-color: color-mix(
451
+ in srgb,
452
+ ${({ tokens }) => tokens.core.textSuccess} 30%,
453
+ ${({ tokens }) => tokens.theme.backgroundPrimary} 70%
454
+ );
455
+ }
456
+
457
+ /* -- Sizes --------------------------------------------------- */
458
+ :host([data-size='sm']) > wui-image:not(.status-image),
459
+ :host([data-size='sm']) > wui-flex {
460
+ width: 24px;
461
+ height: 24px;
462
+ }
463
+
464
+ :host([data-size='lg']) > wui-image:not(.status-image),
465
+ :host([data-size='lg']) > wui-flex {
466
+ width: 40px;
467
+ height: 40px;
468
+ }
469
+
470
+ :host([data-size='sm']) .fallback-icon {
471
+ height: 16px;
472
+ width: 16px;
473
+ padding: ${({ spacing }) => spacing[1]};
474
+ }
475
+
476
+ :host([data-size='lg']) .fallback-icon {
477
+ height: 32px;
478
+ width: 32px;
479
+ padding: ${({ spacing }) => spacing[1]};
480
+ }
481
+
482
+ :host([data-size='sm']) .direction-icon,
483
+ :host([data-size='sm']) .status-image {
484
+ transform: translate(40%, 30%);
485
+ }
486
+
487
+ :host([data-size='lg']) .direction-icon,
488
+ :host([data-size='lg']) .status-image {
489
+ transform: translate(40%, 10%);
490
+ }
491
+
492
+ :host([data-size='sm']) .status-image {
493
+ height: 14px;
494
+ width: 14px;
495
+ }
496
+
497
+ :host([data-size='lg']) .status-image {
498
+ height: 20px;
499
+ width: 20px;
500
+ }
501
+
502
+ /* -- Crop effects --------------------------------------------------- */
503
+ .swap-crop-left-image,
504
+ .swap-crop-right-image {
505
+ position: absolute;
506
+ top: 0;
507
+ bottom: 0;
508
+ }
509
+
510
+ .swap-crop-left-image {
511
+ left: 0;
512
+ clip-path: inset(0px calc(50% + 1.5px) 0px 0%);
513
+ }
514
+
515
+ .swap-crop-right-image {
516
+ right: 0;
517
+ clip-path: inset(0px 0px 0px calc(50% + 1.5px));
518
+ }
519
+ `;
520
+
521
+ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
522
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
523
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
524
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
525
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
526
+ };
527
+ const ICON_SIZE = {
528
+ sm: 'xxs',
529
+ lg: 'md'
530
+ };
531
+ let WuiTransactionThumbnail = class WuiTransactionThumbnail extends i {
532
+ constructor() {
533
+ super(...arguments);
534
+ this.type = 'approve';
535
+ this.size = 'lg';
536
+ this.statusImageUrl = '';
537
+ this.images = [];
538
+ }
539
+ render() {
540
+ return b `<wui-flex>${this.templateVisual()} ${this.templateIcon()}</wui-flex>`;
541
+ }
542
+ templateVisual() {
543
+ this.dataset['size'] = this.size;
544
+ switch (this.type) {
545
+ case 'trade':
546
+ return this.swapTemplate();
547
+ case 'fiat':
548
+ return this.fiatTemplate();
549
+ case 'unknown':
550
+ return this.unknownTemplate();
551
+ default:
552
+ return this.tokenTemplate();
553
+ }
554
+ }
555
+ swapTemplate() {
556
+ const [firstImageUrl, secondImageUrl] = this.images;
557
+ const twoImages = this.images.length === 2 && (firstImageUrl || secondImageUrl);
558
+ if (twoImages) {
559
+ return b `
560
+ <wui-image class="swap-crop-left-image" src=${firstImageUrl} alt="Swap image"></wui-image>
561
+ <wui-image class="swap-crop-right-image" src=${secondImageUrl} alt="Swap image"></wui-image>
562
+ `;
563
+ }
564
+ if (firstImageUrl) {
565
+ return b `<wui-image src=${firstImageUrl} alt="Swap image"></wui-image>`;
566
+ }
567
+ return null;
568
+ }
569
+ fiatTemplate() {
570
+ return b `<wui-icon
571
+ class="fallback-icon"
572
+ size=${ICON_SIZE[this.size]}
573
+ name="dollar"
574
+ ></wui-icon>`;
575
+ }
576
+ unknownTemplate() {
577
+ return b `<wui-icon
578
+ class="fallback-icon"
579
+ size=${ICON_SIZE[this.size]}
580
+ name="questionMark"
581
+ ></wui-icon>`;
582
+ }
583
+ tokenTemplate() {
584
+ const [imageUrl] = this.images;
585
+ if (imageUrl) {
586
+ return b `<wui-image src=${imageUrl} alt="Token image"></wui-image> `;
587
+ }
588
+ return b `<wui-icon
589
+ class="fallback-icon"
590
+ name=${this.type === 'nft' ? 'image' : 'coinPlaceholder'}
591
+ ></wui-icon>`;
592
+ }
593
+ templateIcon() {
594
+ if (this.statusImageUrl) {
595
+ return b `<wui-image
596
+ class="status-image"
597
+ src=${this.statusImageUrl}
598
+ alt="Status image"
599
+ ></wui-image>`;
600
+ }
601
+ return b `<wui-icon
602
+ class="direction-icon"
603
+ size=${ICON_SIZE[this.size]}
604
+ name=${this.getTemplateIcon()}
605
+ ></wui-icon>`;
606
+ }
607
+ getTemplateIcon() {
608
+ if (this.type === 'trade') {
609
+ return 'arrowClockWise';
610
+ }
611
+ return 'arrowBottom';
612
+ }
613
+ };
614
+ WuiTransactionThumbnail.styles = [styles$2];
615
+ __decorate$2([
616
+ n()
617
+ ], WuiTransactionThumbnail.prototype, "type", void 0);
618
+ __decorate$2([
619
+ n()
620
+ ], WuiTransactionThumbnail.prototype, "size", void 0);
621
+ __decorate$2([
622
+ n()
623
+ ], WuiTransactionThumbnail.prototype, "statusImageUrl", void 0);
624
+ __decorate$2([
625
+ n({ type: Array })
626
+ ], WuiTransactionThumbnail.prototype, "images", void 0);
627
+ WuiTransactionThumbnail = __decorate$2([
628
+ customElement('wui-transaction-thumbnail')
629
+ ], WuiTransactionThumbnail);
630
+
631
+ var styles$1 = css `
632
+ :host > wui-flex:first-child {
633
+ gap: ${({ spacing }) => spacing[2]};
634
+ padding: ${({ spacing }) => spacing[3]};
635
+ width: 100%;
636
+ }
637
+
638
+ wui-flex {
639
+ display: flex;
640
+ flex: 1;
641
+ }
642
+ `;
643
+
644
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
645
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
646
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
647
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
648
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
649
+ };
650
+ let WuiTransactionListItemLoader = class WuiTransactionListItemLoader extends i {
651
+ render() {
652
+ return b `
653
+ <wui-flex alignItems="center" .padding=${['1', '2', '1', '2']}>
654
+ <wui-shimmer width="40px" height="40px" rounded></wui-shimmer>
655
+ <wui-flex flexDirection="column" gap="1">
656
+ <wui-shimmer width="124px" height="16px" rounded></wui-shimmer>
657
+ <wui-shimmer width="60px" height="14px" rounded></wui-shimmer>
658
+ </wui-flex>
659
+ <wui-shimmer width="24px" height="12px" rounded></wui-shimmer>
660
+ </wui-flex>
661
+ `;
662
+ }
663
+ };
664
+ WuiTransactionListItemLoader.styles = [resetStyles, styles$1];
665
+ WuiTransactionListItemLoader = __decorate$1([
666
+ customElement('wui-transaction-list-item-loader')
667
+ ], WuiTransactionListItemLoader);
668
+
669
+ var styles = css `
670
+ :host {
671
+ min-height: 100%;
672
+ }
673
+
674
+ .group-container[last-group='true'] {
675
+ padding-bottom: ${({ spacing }) => spacing['3']};
676
+ }
677
+
678
+ .contentContainer {
679
+ height: 280px;
680
+ }
681
+
682
+ .contentContainer > wui-icon-box {
683
+ width: 40px;
684
+ height: 40px;
685
+ border-radius: ${({ borderRadius }) => borderRadius['3']};
686
+ }
687
+
688
+ .contentContainer > .textContent {
689
+ width: 65%;
690
+ }
691
+
692
+ .emptyContainer {
693
+ height: 100%;
694
+ }
695
+ `;
696
+
697
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
698
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
699
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
700
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
701
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
702
+ };
703
+ const PAGINATOR_ID = 'last-transaction';
704
+ const LOADING_ITEM_COUNT = 7;
705
+ let W3mActivityList = class W3mActivityList extends i {
706
+ constructor() {
707
+ super();
708
+ this.unsubscribe = [];
709
+ this.paginationObserver = undefined;
710
+ this.page = 'activity';
711
+ this.caipAddress = ChainController.state.activeCaipAddress;
712
+ this.transactionsByYear = TransactionsController.state.transactionsByYear;
713
+ this.loading = TransactionsController.state.loading;
714
+ this.empty = TransactionsController.state.empty;
715
+ this.next = TransactionsController.state.next;
716
+ TransactionsController.clearCursor();
717
+ this.unsubscribe.push(...[
718
+ ChainController.subscribeKey('activeCaipAddress', val => {
719
+ if (val) {
720
+ if (this.caipAddress !== val) {
721
+ TransactionsController.resetTransactions();
722
+ TransactionsController.fetchTransactions(val);
723
+ }
724
+ }
725
+ this.caipAddress = val;
726
+ }),
727
+ ChainController.subscribeKey('activeCaipNetwork', () => {
728
+ this.updateTransactionView();
729
+ }),
730
+ TransactionsController.subscribe(val => {
731
+ this.transactionsByYear = val.transactionsByYear;
732
+ this.loading = val.loading;
733
+ this.empty = val.empty;
734
+ this.next = val.next;
735
+ })
736
+ ]);
737
+ }
738
+ firstUpdated() {
739
+ this.updateTransactionView();
740
+ this.createPaginationObserver();
741
+ }
742
+ updated() {
743
+ this.setPaginationObserver();
744
+ }
745
+ disconnectedCallback() {
746
+ this.unsubscribe.forEach(unsubscribe => unsubscribe());
747
+ }
748
+ render() {
749
+ return b ` ${this.empty ? null : this.templateTransactionsByYear()}
750
+ ${this.loading ? this.templateLoading() : null}
751
+ ${!this.loading && this.empty ? this.templateEmpty() : null}`;
752
+ }
753
+ updateTransactionView() {
754
+ TransactionsController.resetTransactions();
755
+ if (this.caipAddress) {
756
+ TransactionsController.fetchTransactions(CoreHelperUtil.getPlainAddress(this.caipAddress));
757
+ }
758
+ }
759
+ templateTransactionsByYear() {
760
+ const sortedYearKeys = Object.keys(this.transactionsByYear).sort().reverse();
761
+ return sortedYearKeys.map(year => {
762
+ const yearInt = parseInt(year, 10);
763
+ const sortedMonthIndexes = new Array(12)
764
+ .fill(null)
765
+ .map((_, idx) => {
766
+ const groupTitle = TransactionUtil.getTransactionGroupTitle(yearInt, idx);
767
+ const transactions = this.transactionsByYear[yearInt]?.[idx];
768
+ return {
769
+ groupTitle,
770
+ transactions
771
+ };
772
+ })
773
+ .filter(({ transactions }) => transactions)
774
+ .reverse();
775
+ return sortedMonthIndexes.map(({ groupTitle, transactions }, index) => {
776
+ const isLastGroup = index === sortedMonthIndexes.length - 1;
777
+ if (!transactions) {
778
+ return null;
779
+ }
780
+ return b `
781
+ <wui-flex
782
+ flexDirection="column"
783
+ class="group-container"
784
+ last-group="${isLastGroup ? 'true' : 'false'}"
785
+ data-testid="month-indexes"
786
+ >
787
+ <wui-flex
788
+ alignItems="center"
789
+ flexDirection="row"
790
+ .padding=${['2', '3', '3', '3']}
791
+ >
792
+ <wui-text variant="md-medium" color="secondary" data-testid="group-title">
793
+ ${groupTitle}
794
+ </wui-text>
795
+ </wui-flex>
796
+ <wui-flex flexDirection="column" gap="2">
797
+ ${this.templateTransactions(transactions, isLastGroup)}
798
+ </wui-flex>
799
+ </wui-flex>
800
+ `;
801
+ });
802
+ });
803
+ }
804
+ templateRenderTransaction(transaction, isLastTransaction) {
805
+ const { date, descriptions, direction, images, status, type, transfers, isAllNFT } = this.getTransactionListItemProps(transaction);
806
+ return b `
807
+ <wui-transaction-list-item
808
+ date=${date}
809
+ .direction=${direction}
810
+ id=${isLastTransaction && this.next ? PAGINATOR_ID : ''}
811
+ status=${status}
812
+ type=${type}
813
+ .images=${images}
814
+ .onlyDirectionIcon=${isAllNFT || transfers.length === 1}
815
+ .descriptions=${descriptions}
816
+ ></wui-transaction-list-item>
817
+ `;
818
+ }
819
+ templateTransactions(transactions, isLastGroup) {
820
+ return transactions.map((transaction, index) => {
821
+ const isLastTransaction = isLastGroup && index === transactions.length - 1;
822
+ return b `${this.templateRenderTransaction(transaction, isLastTransaction)}`;
823
+ });
824
+ }
825
+ emptyStateActivity() {
826
+ return b `<wui-flex
827
+ class="emptyContainer"
828
+ flexGrow="1"
829
+ flexDirection="column"
830
+ justifyContent="center"
831
+ alignItems="center"
832
+ .padding=${['10', '5', '10', '5']}
833
+ gap="5"
834
+ data-testid="empty-activity-state"
835
+ >
836
+ <wui-icon-box color="default" icon="wallet" size="xl"></wui-icon-box>
837
+ <wui-flex flexDirection="column" alignItems="center" gap="2">
838
+ <wui-text align="center" variant="lg-medium" color="primary">No Transactions yet</wui-text>
839
+ <wui-text align="center" variant="lg-regular" color="secondary"
840
+ >Start trading on dApps <br />
841
+ to grow your wallet!</wui-text
842
+ >
843
+ </wui-flex>
844
+ </wui-flex>`;
845
+ }
846
+ emptyStateAccount() {
847
+ return b `<wui-flex
848
+ class="contentContainer"
849
+ alignItems="center"
850
+ justifyContent="center"
851
+ flexDirection="column"
852
+ gap="4"
853
+ data-testid="empty-account-state"
854
+ >
855
+ <wui-icon-box icon="swapHorizontal" size="lg" color="default"></wui-icon-box>
856
+ <wui-flex
857
+ class="textContent"
858
+ gap="2"
859
+ flexDirection="column"
860
+ justifyContent="center"
861
+ flexDirection="column"
862
+ >
863
+ <wui-text variant="md-regular" align="center" color="primary">No activity yet</wui-text>
864
+ <wui-text variant="sm-regular" align="center" color="secondary"
865
+ >Your next transactions will appear here</wui-text
866
+ >
867
+ </wui-flex>
868
+ <wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
869
+ </wui-flex>`;
870
+ }
871
+ templateEmpty() {
872
+ if (this.page === 'account') {
873
+ return b `${this.emptyStateAccount()}`;
874
+ }
875
+ return b `${this.emptyStateActivity()}`;
876
+ }
877
+ templateLoading() {
878
+ if (this.page === 'activity') {
879
+ return b ` <wui-flex flexDirection="column" width="100%">
880
+ <wui-flex .padding=${['2', '3', '3', '3']}>
881
+ <wui-shimmer width="70px" height="16px" rounded></wui-shimmer>
882
+ </wui-flex>
883
+ <wui-flex flexDirection="column" gap="2" width="100%">
884
+ ${Array(LOADING_ITEM_COUNT)
885
+ .fill(b ` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `)
886
+ .map(item => item)}
887
+ </wui-flex>
888
+ </wui-flex>`;
889
+ }
890
+ return null;
891
+ }
892
+ onReceiveClick() {
893
+ RouterController.push('WalletReceive');
894
+ }
895
+ createPaginationObserver() {
896
+ const { projectId } = OptionsController.state;
897
+ this.paginationObserver = new IntersectionObserver(([element]) => {
898
+ if (element?.isIntersecting && !this.loading) {
899
+ TransactionsController.fetchTransactions(CoreHelperUtil.getPlainAddress(this.caipAddress));
900
+ EventsController.sendEvent({
901
+ type: 'track',
902
+ event: 'LOAD_MORE_TRANSACTIONS',
903
+ properties: {
904
+ address: CoreHelperUtil.getPlainAddress(this.caipAddress),
905
+ projectId,
906
+ cursor: this.next,
907
+ isSmartAccount: getPreferredAccountType(ChainController.state.activeChain) ===
908
+ W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT
909
+ }
910
+ });
911
+ }
912
+ }, {});
913
+ this.setPaginationObserver();
914
+ }
915
+ setPaginationObserver() {
916
+ this.paginationObserver?.disconnect();
917
+ const lastItem = this.shadowRoot?.querySelector(`#${PAGINATOR_ID}`);
918
+ if (lastItem) {
919
+ this.paginationObserver?.observe(lastItem);
920
+ }
921
+ }
922
+ getTransactionListItemProps(transaction) {
923
+ const date = DateUtil.formatDate(transaction?.metadata?.minedAt);
924
+ const transfers = TransactionUtil.mergeTransfers(transaction?.transfers || []);
925
+ const descriptions = TransactionUtil.getTransactionDescriptions(transaction, transfers);
926
+ const transfer = transfers?.[0];
927
+ const isAllNFT = Boolean(transfer) && transfers?.every(item => Boolean(item.nft_info));
928
+ const images = TransactionUtil.getTransactionImages(transfers);
929
+ return {
930
+ date,
931
+ direction: transfer?.direction,
932
+ descriptions,
933
+ isAllNFT,
934
+ images,
935
+ status: transaction.metadata?.status,
936
+ transfers,
937
+ type: transaction.metadata?.operationType
938
+ };
939
+ }
940
+ };
941
+ W3mActivityList.styles = styles;
942
+ __decorate([
943
+ n()
944
+ ], W3mActivityList.prototype, "page", void 0);
945
+ __decorate([
946
+ r()
947
+ ], W3mActivityList.prototype, "caipAddress", void 0);
948
+ __decorate([
949
+ r()
950
+ ], W3mActivityList.prototype, "transactionsByYear", void 0);
951
+ __decorate([
952
+ r()
953
+ ], W3mActivityList.prototype, "loading", void 0);
954
+ __decorate([
955
+ r()
956
+ ], W3mActivityList.prototype, "empty", void 0);
957
+ __decorate([
958
+ r()
959
+ ], W3mActivityList.prototype, "next", void 0);
960
+ W3mActivityList = __decorate([
961
+ customElement('w3m-activity-list')
962
+ ], W3mActivityList);
963
+ //# sourceMappingURL=index-B4xuj7uR.js.map
964
+
965
+ //# sourceMappingURL=index-B4xuj7uR.js.map