@abtnode/blocklet-services 1.16.46-beta-20250704-234926-09d872ad → 1.16.46-beta-20250706-075512-de1b046b

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 (266) hide show
  1. package/dist/assets/AdapterDayjs-XSKQGIOn.js +3 -0
  2. package/dist/assets/{Community-B_rRcH4k.js → Community-CcMMU0U0.js} +1 -1
  3. package/dist/assets/{Google-if7RtO8D.js → Google-DEJzh5qu.js} +1 -1
  4. package/dist/assets/{Holiday-DET7Gz33.js → Holiday-CQ56q1Zn.js} +1 -1
  5. package/dist/assets/{Meeting-D-dNfxru.js → Meeting-BloE6sJb.js} +1 -1
  6. package/dist/assets/{OffSick-MDwLewaS.js → OffSick-BDgahXbb.js} +1 -1
  7. package/dist/assets/{WorkingRemotely-BmHz2B2e.js → WorkingRemotely-Dy2yEuOf.js} +1 -1
  8. package/dist/assets/access-control-BCwE1yaW.js +14 -0
  9. package/dist/assets/{actions-DzwK3TZX.js → actions-C2acYZqU.js} +1 -1
  10. package/dist/assets/{add-component-core-D76Zubeq.js → add-component-core-BFbARhO9.js} +19 -19
  11. package/dist/assets/add-resource-DOrkE3yq.js +1 -0
  12. package/dist/assets/addon-DTMrz0XJ.js +14 -0
  13. package/dist/assets/{advanced-D6zLG63b.js → advanced-C6q3rX82.js} +3 -3
  14. package/dist/assets/api-B7LEhzE2.js +1 -0
  15. package/dist/assets/appearance-Cb9WLLnL.js +1 -0
  16. package/dist/assets/arrow-down.svg-ChoF_uzO.js +1 -0
  17. package/dist/assets/{audit-logs-CdG4bSHH.js → audit-logs-tRP7Ir6c.js} +3 -3
  18. package/dist/assets/authorize-CKa1qwqR.js +1 -0
  19. package/dist/assets/{base-chart-CYYG4HBW.js → base-chart-DN6icVvl.js} +1 -1
  20. package/dist/assets/base32-BCg8oKIC.js +1 -0
  21. package/dist/assets/branding-BfFZn4oO.js +40 -0
  22. package/dist/assets/{branding-_WV1QAAs.js → branding-Cr2G9cD7.js} +6 -6
  23. package/dist/assets/bundle-avatar-Xp52QSf2.js +1 -0
  24. package/dist/assets/button-V9BmeTRn.js +1 -0
  25. package/dist/assets/click-to-copy-CT3GMLFE.js +1 -0
  26. package/dist/assets/cloneDeep-C4F9EbDd.js +1 -0
  27. package/dist/assets/{collapse-hSqt1R5N.js → collapse-cchwlIcj.js} +1 -1
  28. package/dist/assets/complete-R8Z3eD81.js +39 -0
  29. package/dist/assets/{component-DKjuvHj4.js → component-CMmOvKYP.js} +8 -8
  30. package/dist/assets/config-BV6XReOP.js +1 -0
  31. package/dist/assets/{config-CUi0elhI.js → config-Drzui8W3.js} +2 -2
  32. package/dist/assets/{config-navigation-Ha3M5G4P.js → config-navigation-lVp-1ugd.js} +7 -7
  33. package/dist/assets/config-space-D9QgW6OB.js +1 -0
  34. package/dist/assets/confirm-CDf7UR9D.js +7 -0
  35. package/dist/assets/connect-Bnz0r5Wi.js +5 -0
  36. package/dist/assets/connect-Dy-g9TU9.js +1 -0
  37. package/dist/assets/connect-to-sTkrNSP4.js +1 -0
  38. package/dist/assets/{content-layout-QCcsYBSN.js → content-layout-C0J5I0TX.js} +1 -1
  39. package/dist/assets/createClass-CBJCc0i0.js +1 -0
  40. package/dist/assets/dashboard-D2WUGp4d.js +106 -0
  41. package/dist/assets/delete-confirm-Db5_a_ND.js +1 -0
  42. package/dist/assets/did-address-6ebqvNNq.js +1 -0
  43. package/dist/assets/domain-D3NSNHzA.js +9 -0
  44. package/dist/assets/domain-action-card-XBKx5ZEq.js +28 -0
  45. package/dist/assets/domains-DDnUseHb.js +1 -0
  46. package/dist/assets/{dot-BXCAJPqI.js → dot-DfSvSTo2.js} +1 -1
  47. package/dist/assets/{edit.svg-DhSbRuoX.js → edit.svg-D-deOViK.js} +1 -1
  48. package/dist/assets/email-D9yKsyjd.js +18 -0
  49. package/dist/assets/{empty-spinner-Iuhp-DUy.js → empty-spinner-DlvM3tDM.js} +1 -1
  50. package/dist/assets/engine-CqzMzhBR.js +1 -0
  51. package/dist/assets/exchange-passport-Bi7Za8uz.js +1 -0
  52. package/dist/assets/{form-mylhS1ms.js → form-Cv425yYf.js} +3 -3
  53. package/dist/assets/fuel-B8dyWYCs.js +32 -0
  54. package/dist/assets/gen-access-key-CGYvJ1k7.js +2 -0
  55. package/dist/assets/get-safe-url-HSOeeYs_.js +1 -0
  56. package/dist/assets/github-icon-CH2zo-td.js +1 -0
  57. package/dist/assets/home-DxujM2Op.js +1 -0
  58. package/dist/assets/iframe-BxB-nDw4.js +1 -0
  59. package/dist/assets/index-B0xpDUsO.js +1019 -0
  60. package/dist/assets/index-BFT0qxie.js +1 -0
  61. package/dist/assets/index-BGsWoTbW.js +113 -0
  62. package/dist/assets/index-BLIgZ0kx.js +269 -0
  63. package/dist/assets/{index-DareKNWL.js → index-BfwIRDCT.js} +2 -2
  64. package/dist/assets/index-BojVbZw0.js +1 -0
  65. package/dist/assets/index-BpkAJRJ3.js +16 -0
  66. package/dist/assets/index-Bu80qBT0.js +77 -0
  67. package/dist/assets/{index-Bvup9KK2.js → index-C-vjjw9E.js} +1 -1
  68. package/dist/assets/index-C35qnTxV.js +1 -0
  69. package/dist/assets/{index-CJSRV-xv.js → index-CK4-I4Dt.js} +5 -5
  70. package/dist/assets/{index-y3-0A2va.js → index-CMkvpy46.js} +23 -23
  71. package/dist/assets/{index-troycNLC.js → index-COypY_9V.js} +13 -13
  72. package/dist/assets/{index-HJ9bCmon.js → index-CWV__hd3.js} +1 -1
  73. package/dist/assets/index-CYFNAQl1.js +284 -0
  74. package/dist/assets/index-CeqM1ZpW.js +1 -0
  75. package/dist/assets/index-Cm7r5rvw.js +348 -0
  76. package/dist/assets/{index-DjNdCKSK.js → index-Cwk7U-s7.js} +9 -9
  77. package/dist/assets/{index-CxOcEJip.js → index-DIBGQQQm.js} +7 -7
  78. package/dist/assets/index-DNQJZcPj.js +55 -0
  79. package/dist/assets/index-DRLhEfAl.js +1 -0
  80. package/dist/assets/index-DRYJ0xIl.js +7 -0
  81. package/dist/assets/{index-CMf86-QO.js → index-DbIUA2zH.js} +1 -1
  82. package/dist/assets/index-DjfjJ3Fo.js +1 -0
  83. package/dist/assets/index-DrVXX4fX.css +1 -0
  84. package/dist/assets/index-DuEs5obm.js +7 -0
  85. package/dist/assets/{index-CuVvB-Cv.js → index-Dy-MET-d.js} +1 -1
  86. package/dist/assets/index-GF3HOour.js +4 -0
  87. package/dist/assets/index-If1MEgvU.js +29 -0
  88. package/dist/assets/{index-CsOZO30I.js → index-Iv2oisWn.js} +2 -2
  89. package/dist/assets/index-JZtXFT6r.js +1 -0
  90. package/dist/assets/{index-DQ2ZPkAL.js → index-LLcbh8Mm.js} +2 -2
  91. package/dist/assets/{index-BmzIIRpf.js → index-MGxe3V9B.js} +1 -1
  92. package/dist/assets/index-PN2leRF6.js +102 -0
  93. package/dist/assets/index-f_f4wJSK.js +1 -0
  94. package/dist/assets/index-fy1uK_IR.js +1 -0
  95. package/dist/assets/{index-CGtM1j0R.js → index-qmAWfCpk.js} +1 -1
  96. package/dist/assets/{index.esm-CkOXP-jL.js → index.esm-BONQrRCU.js} +1 -1
  97. package/dist/assets/invitation-B34gciAx.js +177 -0
  98. package/dist/assets/invite-ByfXPpkh.js +1 -0
  99. package/dist/assets/issue-passport-CF7kjIha.js +1 -0
  100. package/dist/assets/item-CT17goAk.js +1 -0
  101. package/dist/assets/landing-page-8lE7kpfr.js +1 -0
  102. package/dist/assets/{launch-result-message-Cxe_kPrP.js → launch-result-message-B0akHCFQ.js} +1 -1
  103. package/dist/assets/{layout-DkPyTaVW.js → layout-Df4ylgze.js} +2 -2
  104. package/dist/assets/list-BqjxSFj_.js +103 -0
  105. package/dist/assets/{list-header-CxfG7AtB.js → list-header-BbJpGLxs.js} +1 -1
  106. package/dist/assets/list-yWg6vRtr.js +2 -0
  107. package/dist/assets/localization-CJcbV1c6.js +1 -0
  108. package/dist/assets/{lock.svg-BRQnEAKL.js → lock.svg-xPuKHQ-O.js} +1 -1
  109. package/dist/assets/{log-DZVsi88y.js → log-B8snR1zU.js} +1 -1
  110. package/dist/assets/logger-BwL8cVCo.js +1 -0
  111. package/dist/assets/login-LEjGUnmy.js +1 -0
  112. package/dist/assets/login-oauth-callback-VnZviVo0.js +1 -0
  113. package/dist/assets/logo-uploader-C_Xk3axk.js +133 -0
  114. package/dist/assets/{lost-passport-BmeRKwmT.js → lost-passport-D6MwfL4M.js} +4 -4
  115. package/dist/assets/{lottie-react.esm-k2Km8DK4.js → lottie-react.esm-Bqal_rmd.js} +1 -1
  116. package/dist/assets/omit-LyexeK2n.js +1 -0
  117. package/dist/assets/open-window-BVAimsZ8.js +1 -0
  118. package/dist/assets/over-due-invoice-payment-DjR5rU46.js +1 -0
  119. package/dist/assets/{overview-D-oWyxxM.js → overview-Dr0GLBll.js} +3 -3
  120. package/dist/assets/{page-header-C3zFQU72.js → page-header-Dhv5B-BX.js} +2 -2
  121. package/dist/assets/passport-item-Cvgw81pu.js +1 -0
  122. package/dist/assets/{permission-BT6A_5g7.js → permission-CKmU8Z_5.js} +1 -1
  123. package/dist/assets/preferences-CojjhPk8.js +1 -0
  124. package/dist/assets/profile-embed-CzLWocm3.js +1 -0
  125. package/dist/assets/publish-resource-CCEV3Bm_.js +1 -0
  126. package/dist/assets/{question-mark-circle.svg-Dsn3tw38.js → question-mark-circle.svg-YsMacl4Q.js} +1 -1
  127. package/dist/assets/{raf-schd.esm-Cy5s98oK.js → raf-schd.esm-BZ5FB5HD.js} +1 -1
  128. package/dist/assets/{react-beautiful-dnd.esm-B7r3OKKK.js → react-beautiful-dnd.esm-C53HbB7P.js} +1 -1
  129. package/dist/assets/{react-stripe.esm-iz31a8Oy.js → react-stripe.esm-DdI1E_2N.js} +1 -1
  130. package/dist/assets/runtime-Bjcp30CT.js +1 -0
  131. package/dist/assets/{sanitize-CNYhE_fv.js → sanitize-Be9_TGIg.js} +1 -1
  132. package/dist/assets/sdk-BI2up0A5.js +1 -0
  133. package/dist/assets/{section-DG_88Iq9.js → section-Be6GDkk8.js} +1 -1
  134. package/dist/assets/{security-C3JSOgkl.js → security-DYUzNKac.js} +4 -4
  135. package/dist/assets/{server-logo-notext.svg-BDfKF66U.js → server-logo-notext.svg-BqCXmsOm.js} +1 -1
  136. package/dist/assets/session-Bj1hMOts.js +1 -0
  137. package/dist/assets/setup-D_EJHnh2.js +30 -0
  138. package/dist/assets/{shorten-label-CMcbJgkJ.js → shorten-label-Ba-bmb_4.js} +1 -1
  139. package/dist/assets/{simple-select-FEjR7w5_.js → simple-select-CGk0N_bX.js} +1 -1
  140. package/dist/assets/spaces-C1fb5NDx.js +1 -0
  141. package/dist/assets/start-wlEhUSyq.js +187 -0
  142. package/dist/assets/starting-progress-IzrgfSED.js +40 -0
  143. package/dist/assets/status-CwzJOHQ-.js +1 -0
  144. package/dist/assets/{step-actions-C2pOiZon.js → step-actions-DZNamIJE.js} +1 -1
  145. package/dist/assets/studio-CMWQYNVG.js +6 -0
  146. package/dist/assets/switch-control-Z293FB2U.js +18 -0
  147. package/dist/assets/table-tips-GxhBg0e3.js +1 -0
  148. package/dist/assets/traffic-CbhaWm03.js +1 -0
  149. package/dist/assets/transfer-B5jo0mhi.js +16 -0
  150. package/dist/assets/unsubscribe-CQgLMQmM.js +1 -0
  151. package/dist/assets/{use-blocklet-logo-BEiiWhw_.js → use-blocklet-logo-BKc9E-_L.js} +6 -6
  152. package/dist/assets/{use-mobile-CbxgT1_q.js → use-mobile-BmXUeM1i.js} +1 -1
  153. package/dist/assets/{use-mobile-KernkJ0t.js → use-mobile-DspJgIrG.js} +1 -1
  154. package/dist/assets/{use-server-logo-CnmK6Efi.js → use-server-logo-7qMC4vqP.js} +1 -1
  155. package/dist/assets/useAsync-COkfundQ.js +1 -0
  156. package/dist/assets/{useAsync-sAAs4CGb.js → useAsync-fxvoN33w.js} +1 -1
  157. package/dist/assets/useLocalStorage-DvM3QMYe.js +1 -0
  158. package/dist/assets/{useSetState-BO0mlssA.js → useSetState-BWrXo9eH.js} +1 -1
  159. package/dist/assets/user-center-BAHrlllm.js +77 -0
  160. package/dist/assets/user-center-C8GAilfL.js +81 -0
  161. package/dist/assets/user-sessions-DVo9LBeI.js +1 -0
  162. package/dist/assets/util-C6EYY0RW.js +1 -0
  163. package/dist/assets/util-fjAejugL.js +1 -0
  164. package/dist/assets/vendor-arcblock-D026EX-Z.js +1419 -0
  165. package/dist/assets/vendor-hooks-CFpNP5Ql.js +7 -0
  166. package/dist/assets/{vendor-mui-core-CB7usZvs.js → vendor-mui-core-BWI0_sKe.js} +2 -2
  167. package/dist/assets/{vendor-mui-x-Cn6DlQME.js → vendor-mui-x-Bwa_JtSa.js} +1 -1
  168. package/dist/assets/{vendor-react-BvXSmFbV.js → vendor-react-x2lQvn4m.js} +1 -1
  169. package/dist/assets/{vendor-utils-eI_TRB_9.js → vendor-utils-Vke2d2wu.js} +2 -2
  170. package/dist/assets/vendor-ux-DVPR2iDY.js +1564 -0
  171. package/dist/assets/{vendor-ux-did-connect-C3VYvpKG.css → vendor-ux-DYcPPYq2.css} +1 -1
  172. package/dist/assets/wrap-locale-CVw8KKu9.js +1 -0
  173. package/dist/assets/zh-BAK9QZ79.js +1 -0
  174. package/dist/index.html +9 -9
  175. package/dist/service-worker.js +1 -1
  176. package/package.json +32 -32
  177. package/dist/assets/AdapterDayjs-C4xA34Wo.js +0 -3
  178. package/dist/assets/access-control-DiMFm5vm.js +0 -14
  179. package/dist/assets/add-resource-QtPySaVp.js +0 -1
  180. package/dist/assets/addon-BlQzxfa9.js +0 -14
  181. package/dist/assets/api-Cux33v3g.js +0 -1
  182. package/dist/assets/appearance-ALezezqS.js +0 -1
  183. package/dist/assets/authorize-Bf6tuW6d.js +0 -1
  184. package/dist/assets/base32-ApkcljBe.js +0 -1
  185. package/dist/assets/branding-DMgflqsR.js +0 -40
  186. package/dist/assets/bundle-avatar-ZXyAO7K1.js +0 -1
  187. package/dist/assets/button-HKPEWKSE.js +0 -1
  188. package/dist/assets/click-to-copy-C9F3ippp.js +0 -1
  189. package/dist/assets/cloneDeep-D_6REFFg.js +0 -1
  190. package/dist/assets/complete-TvShCSjx.js +0 -39
  191. package/dist/assets/config-B_jSftWs.js +0 -1
  192. package/dist/assets/config-space-Bf5mw5iZ.js +0 -1
  193. package/dist/assets/confirm-ChzBz5HU.js +0 -7
  194. package/dist/assets/connect-ClCSSq0i.js +0 -5
  195. package/dist/assets/connect-DvZ8YtIj.js +0 -1
  196. package/dist/assets/connect-to-BHJ-dAXD.js +0 -1
  197. package/dist/assets/createClass-DrvVCDPe.js +0 -1
  198. package/dist/assets/dashboard-BObw3ALy.js +0 -106
  199. package/dist/assets/delete-confirm-BR2J5ZDD.js +0 -1
  200. package/dist/assets/did-address-D3Egz-BH.js +0 -1
  201. package/dist/assets/domain-DcVIImSr.js +0 -9
  202. package/dist/assets/domain-action-card-DhD_cXV_.js +0 -28
  203. package/dist/assets/domains-ou456zE4.js +0 -1
  204. package/dist/assets/email-Dl0EXVcw.js +0 -18
  205. package/dist/assets/engine-sqdrhsce.js +0 -1
  206. package/dist/assets/exchange-passport-BSJ3G8lf.js +0 -1
  207. package/dist/assets/fuel-Bd06KJQe.js +0 -32
  208. package/dist/assets/gen-access-key-m-8Jt1Hc.js +0 -2
  209. package/dist/assets/get-safe-url-BH99736U.js +0 -1
  210. package/dist/assets/home-bdgdtKT6.js +0 -1
  211. package/dist/assets/iframe-B0Sl1srb.js +0 -1
  212. package/dist/assets/index-B3QNvDDj.js +0 -746
  213. package/dist/assets/index-BZR3BNLz.js +0 -1
  214. package/dist/assets/index-BqGWM_OW.js +0 -77
  215. package/dist/assets/index-BxJtY5Kv.js +0 -284
  216. package/dist/assets/index-CFeWjGB5.js +0 -55
  217. package/dist/assets/index-CrwOcYsE.js +0 -1
  218. package/dist/assets/index-Cx0gea65.js +0 -4
  219. package/dist/assets/index-DH-srZsa.js +0 -113
  220. package/dist/assets/index-DiZ-o7if.js +0 -1
  221. package/dist/assets/index-DrCTi6nm.css +0 -1
  222. package/dist/assets/index-fEBO3Gzc.js +0 -1
  223. package/dist/assets/index-k7k0SQbv.js +0 -1
  224. package/dist/assets/index-ks-YsRmg.js +0 -7
  225. package/dist/assets/invitation-DbN-YRUm.js +0 -177
  226. package/dist/assets/invite-CIXrj-3X.js +0 -1
  227. package/dist/assets/issue-passport-r6T68j--.js +0 -1
  228. package/dist/assets/item-Bd0ii0Us.js +0 -1
  229. package/dist/assets/list-DXrUx08c.js +0 -2
  230. package/dist/assets/list-DlvWPWYw.js +0 -103
  231. package/dist/assets/localization-Bz_iVajc.js +0 -1
  232. package/dist/assets/logger-CCGgFyYA.js +0 -1
  233. package/dist/assets/login-JGAKiqpV.js +0 -1
  234. package/dist/assets/login-oauth-callback-DqS91pc0.js +0 -1
  235. package/dist/assets/logo-uploader-X2TJccsm.js +0 -133
  236. package/dist/assets/omit-D-CdbK9w.js +0 -1
  237. package/dist/assets/open-window-DcAQjlEr.js +0 -1
  238. package/dist/assets/over-due-invoice-payment-CqC6F7wx.js +0 -1
  239. package/dist/assets/passport-item-CFSqpoVC.js +0 -1
  240. package/dist/assets/preferences-Bp3snrNx.js +0 -1
  241. package/dist/assets/profile-embed-DdOuqHl9.js +0 -1
  242. package/dist/assets/publish-resource-QE-lbMIo.js +0 -1
  243. package/dist/assets/runtime-D3F-K4em.js +0 -1
  244. package/dist/assets/sdk-fQbwfdKO.js +0 -1
  245. package/dist/assets/session-CEzfQzQW.js +0 -1
  246. package/dist/assets/setup-80ncmxUI.js +0 -30
  247. package/dist/assets/spaces-BEQecBKs.js +0 -1
  248. package/dist/assets/start-CeGPz6-6.js +0 -187
  249. package/dist/assets/starting-progress-ACb9l4Xf.js +0 -40
  250. package/dist/assets/status-Ci7ywBRs.js +0 -1
  251. package/dist/assets/studio-CAziGLSY.js +0 -6
  252. package/dist/assets/switch-control-B_6jQTpz.js +0 -18
  253. package/dist/assets/table-tips-Dmnk1ZGp.js +0 -1
  254. package/dist/assets/traffic-BVI8c87H.js +0 -1
  255. package/dist/assets/transfer-BnJYdOTH.js +0 -16
  256. package/dist/assets/unsubscribe-Bt8dn_fv.js +0 -1
  257. package/dist/assets/useAsync--s_vBMXH.js +0 -1
  258. package/dist/assets/useLocalStorage-DmhYFNPM.js +0 -1
  259. package/dist/assets/user-center-DeDT-eSp.js +0 -77
  260. package/dist/assets/util-BA-_-Cnq.js +0 -1
  261. package/dist/assets/util-C7Sp_ClB.js +0 -1
  262. package/dist/assets/vendor-arcblock-B55HFGqZ.js +0 -2399
  263. package/dist/assets/vendor-hooks-BA23GwO5.js +0 -7
  264. package/dist/assets/vendor-ux-did-connect-soajAeMx.js +0 -1702
  265. package/dist/assets/wrap-locale-DXvoSw5L.js +0 -1
  266. package/dist/assets/zh-C8_JX25l.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as t,ak as s,T as n,$ as i}from"./vendor-mui-core-BWI0_sKe.js";import{T as f}from"./vendor-ux-DVPR2iDY.js";import{L as g,r as k}from"./vendor-react-x2lQvn4m.js";import"./index-B0xpDUsO.js";import"./vendor-utils-Vke2d2wu.js";import"./vendor-hooks-CFpNP5Ql.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D026EX-Z.js";const l=(e,o)=>[e,...Array.isArray(o)?o:[o]],a=(e=2)=>({overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"});function p({sx:e={},...o}){const r=l({display:"flex",flexWrap:"wrap",mx:-1},e);return t.jsx(s,{sx:r,...o})}p.propTypes={sx:i.object};function w({icon:e}){const[o,r]=k.useState(!1);return!e||o?null:typeof e=="string"?t.jsx(s,{component:"img",src:e,alt:"",sx:{width:1,height:1},onError:()=>r(!0)}):e}w.propTypes={icon:i.oneOfType([i.string,i.node]).isRequired};function b({title:e,desc:o,extra:r,cover:c,icon:d,to:x,sx:h}){const m=l({position:"relative",flexBasis:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},maxWidth:{xs:"100%",sm:"50%",md:"33.33%",lg:"25%"},mb:{xs:2,md:6},px:1},h);return t.jsx(s,{sx:m,children:t.jsx(s,{component:g,to:x,target:"_blank",sx:{display:"flex",flexDirection:"column",gap:1,height:1,pt:0,color:"inherit",textDecoration:"none",borderRadius:1,cursor:"pointer"},children:t.jsxs(s,{children:[t.jsxs(s,{sx:{position:"relative"},children:[c,d&&t.jsx(s,{sx:{position:"absolute",top:44,left:16,zIndex:1,width:56,height:56},children:t.jsx(w,{icon:d})})]}),t.jsx(n,{sx:{mt:1,fontSize:"1.25rem",fontWeight:600,...a()},children:e}),o&&t.jsx(n,{variant:"body2",sx:{my:1,...a(),color:"text.secondary"},children:o}),r]})})})}b.propTypes={title:i.string.isRequired,desc:i.string.isRequired,extra:i.node.isRequired,cover:i.string.isRequired,icon:i.string.isRequired,to:i.string.isRequired,sx:i.object.isRequired};const j="/.well-known/service/static/assets/doc-board-bg-DWZHV9Ng.png";function u({board:e,sx:o,...r}){return t.jsx(b,{date:e.createdAt,sx:o,to:e.link,title:e.title,desc:e.desc,cover:t.jsx(s,{sx:{position:"relative",paddingTop:`${9/16*100}%`,border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(s,{component:"img",src:j,alt:"",sx:{position:"absolute",top:0,left:0,width:1,filter:c=>c.palette.mode==="dark"?"brightness(0.28) contrast(1.1)":"none"}})}),icon:e.icon,...r})}u.propTypes={board:i.object.isRequired,sx:i.object.isRequired};function $(){const{locale:e}=f(),o=[{id:"1",title:"Blocklet Platform",desc:"Guide to understand and build on our blocklet platform",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/blocklet-developer/${e}/getting-started`},{id:"2",title:"Create Blocklet",desc:"Build blocklet with just one command line.",icon:"https://www.arcblock.io/favicon.ico",link:`https://www.arcblock.io/docs/createblocklet/${e}/quick-start`},{id:"3",title:"Blocklet Launcher",desc:"Streamlining Blocklet Launching.",icon:"https://www.arcblock.io/docs/uploads/5a4f4716bc8061532a535fe816a9169c.png",link:`https://www.arcblock.io/docs/launcher/${e}/launcher-welcome`},{id:"4",title:"DID Spaces",desc:"Digital Spaces for Decentralized Identity (DID)",icon:"https://www.arcblock.io/docs/uploads/3a8b142d7c940c57eced71eddba2ff19.png",link:`https://www.arcblock.io/docs/did-spaces/${e}/did-spaces-getting-started`},{id:"5",title:"DID Wallet",desc:"DID Wallet Support docs",icon:"https://www.arcblock.io/docs/uploads/59ddb28f405ee670428e5fe1ff12d104.png",link:`https://www.arcblock.io/docs/did-wallet/${e}/get-started`},{id:"6",title:"DID Names",desc:"Naming Service based on NFT and verifiable credentials",icon:"https://www.didnames.io/favicon.ico?imageFilter=resize&w=32",link:`https://www.arcblock.io/docs/did-domain/${e}/did-domain-faq`},{id:"7",title:"Blockchain",desc:"The ledger for ArcBlock ecosystem",icon:"https://www.arcblock.io/docs/uploads/4a20c152faae0f104ed0815ff3b8b48b.png",link:`https://www.arcblock.io/docs/blockchain/${e}/blockchain-how-to-guides`},{id:"8",title:"DID Connect",desc:"The open protocol and development kit for connecting users and dapps",icon:"https://www.arcblock.io/docs/uploads/d189118f89b56e9d5b03ad5a0212a4ab.png",link:`https://www.arcblock.io/docs/did-connect/${e}/developer-guides`}];return t.jsx(p,{children:o.map(r=>t.jsx(u,{board:r},r.id))})}export{$ as default};
@@ -0,0 +1,113 @@
1
+ import{g as Bt,r as v}from"./vendor-react-x2lQvn4m.js";import{j as e,ak as y,G as Z,b6 as me,bb as qe,E as V,am as ut,d3 as Wt,bi as qt,at as ae,b1 as mt,$ as h,T as ee,Y as Ye,d4 as pt,b5 as Ke,C as Me,V as Fe,d5 as Ge,aN as Ue,p as ft,J as ht,a8 as xt,d6 as Kt,ac as gt,d7 as Mt,d8 as Ut,bY as st,n as Ht,D as $t,bu as Vt,M as it,cB as Yt,I as Gt,d9 as Jt}from"./vendor-mui-core-BWI0_sKe.js";import{A as bt,J as Xt,C as Zt,c as le,F as Qt,a4 as je}from"./vendor-utils-Vke2d2wu.js";import{T as te,H as M,n as ce,b as en,j as jt,Z as tn,ar as nn,$ as vt,C as yt,as as ke,a as St,z as sn,L as an}from"./vendor-ux-DVPR2iDY.js";import{bj as rn,_ as Je,Y as Ct,aN as Rt,F as _e,c as _,ad as Q,p as on,aE as at}from"./index-B0xpDUsO.js";import{g as ye,a as $,f as se}from"./vendor-hooks-CFpNP5Ql.js";import{u as wt,C as J}from"./index.esm-BONQrRCU.js";import{o as He,j as ln,d as cn,N as dn}from"./use-blocklet-logo-BKc9E-_L.js";import{S as X}from"./section-Be6GDkk8.js";import{A as un,a as mn,b as pn}from"./collapse-cchwlIcj.js";import{S as Se}from"./shorten-label-Ba-bmb_4.js";import{v as Tt}from"./index-Dy-MET-d.js";import{R as Nt,A as fn,S as hn,a as xn,B as gn}from"./list-BqjxSFj_.js";import{W as bn}from"./did-address-6ebqvNNq.js";import{p as It}from"./util-C6EYY0RW.js";import{D as jn,g as vn}from"./traffic-CbhaWm03.js";import{B as Et}from"./bundle-avatar-Xp52QSf2.js";import{u as yn}from"./use-mobile-BmXUeM1i.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D026EX-Z.js";import"./session-Bj1hMOts.js";import"./server-logo-notext.svg-BqCXmsOm.js";import"./index-JZtXFT6r.js";import"./base32-BCg8oKIC.js";import"./dot-DfSvSTo2.js";import"./useAsync-fxvoN33w.js";import"./iframe-BxB-nDw4.js";import"./index-DRLhEfAl.js";import"./index-DBs9Ljax.js";import"./base-chart-DN6icVvl.js";import"./index-DbIUA2zH.js";import"./vendor-mui-x-Bwa_JtSa.js";import"./AdapterDayjs-XSKQGIOn.js";var Te={exports:{}},Ne={exports:{}},Ie={exports:{}},rt;function Sn(){return rt||(rt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(r){return r==null}n.exports=s.default,n.exports.default=s.default}(Ie,Ie.exports)),Ie.exports}var ot;function Cn(){return ot||(ot=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=u;var t=o(rn()),r=o(Sn());function o(p){return p&&p.__esModule?p:{default:p}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,b=/^[-+]?[0-9]+$/;function u(p,i){(0,t.default)(p),i=i||{};var N=i.allow_leading_zeroes===!1?l:b,I=!i.hasOwnProperty("min")||(0,r.default)(i.min)||p>=i.min,S=!i.hasOwnProperty("max")||(0,r.default)(i.max)||p<=i.max,j=!i.hasOwnProperty("lt")||(0,r.default)(i.lt)||p<i.lt,E=!i.hasOwnProperty("gt")||(0,r.default)(i.gt)||p>i.gt;return N.test(p)&&I&&S&&j&&E}n.exports=s.default,n.exports.default=s.default}(Ne,Ne.exports)),Ne.exports}var lt;function Rn(){return lt||(lt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=o;var t=r(Cn());function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,t.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}n.exports=s.default,n.exports.default=s.default}(Te,Te.exports)),Te.exports}var wn=Rn();const Tn=Bt(wn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Nn(){const{api:n}=Je(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=Rt(),l=s?.meta?.did,b=Object.assign({...ze},s?.settings?.notification?.email||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=wt({defaultValues:bt(b,Object.keys(ze))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(a,T,O=!0)=>{try{const{blocklet:D}=await n.configNotification({input:{did:l,notification:JSON.stringify({email:a})}}),re=Object.assign({...ze},D?.settings?.notification?.email||{});I(re),O&&M.success(t("oauth.saveSuccess"))}catch(D){if(O)M.error(D.message||t("oauth.saveFailed"));else throw D}}),Y=$(async(a,T,O)=>{try{i.isDirty&&await E(a,T,!1),await n.sendEmail({input:{did:l,receiver:O,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),M.success(t("notification.email.testSuccess"))}catch(D){M.error(D.message||t("notification.email.testfailed"))}}),z=$((a,T)=>{S.testReceiver="",S.testReceiverError="",r.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(y,{sx:{width:"300px"},children:e.jsx(Z,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:S.testReceiver,onChange:O=>{S.testReceiver=O.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(O){const D=S.testReceiver?.trim();if(!D){S.testReceiverError=t("notification.email.receiverRequired");return}if(!_e(D)){S.testReceiverError=t("notification.email.receiverInvalid");return}S.testReceiverError="",await Y(a,T,D),O()}})}),F=$(a=>{const T=a?.trim();return T?_e(T)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),W=$(a=>{const T=a?.trim();return T?He(T,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),R=$(a=>a?Tn(a)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),q=$(a=>a?.trim()?!0:t("notification.email.userRequired")),K=$(a=>a?.trim()?!0:t("notification.email.passwordRequired")),f=$(a=>a?.trim()&&!He(a,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),w=$(a=>a?.trim()&&!_e(a)?t("notification.email.emailInvalid"):!0),C=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(In,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.email.enable"),my:2.5,children:e.jsx(J,{name:"enabled",control:p,render:({field:a})=>e.jsx(me,{control:e.jsx(qe,{checked:a.value,...a})})})}),e.jsx(X,{title:t("notification.email.from"),children:e.jsx(J,{name:"from",control:p,rules:{validate:j?F:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[a.name],helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.host"),children:e.jsx(J,{name:"host",control:p,rules:{validate:j?W:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.host"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.port"),children:e.jsx(J,{name:"port",control:p,rules:{validate:j?R:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,type:"number",error:!!i.errors[a.name],label:t("notification.email.port"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.user"),children:e.jsx(J,{name:"user",control:p,rules:{validate:j?q:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.user"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.password"),children:e.jsx(J,{name:"password",control:p,rules:{validate:j?K:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",required:!0,type:"password",error:!!i.errors[a.name],label:t("notification.email.password"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.secure"),children:e.jsx(J,{name:"secure",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(qe,{checked:a.value,...a,disabled:!j})})})})}),e.jsxs(un,{children:[e.jsxs(mn,{expandIcon:e.jsx(qt,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(ut,{title:t("notification.email.signatureTooltip"),children:e.jsx(Wt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(pn,{children:[e.jsx(X,{title:t("notification.email.companyName"),children:e.jsx(J,{name:"companyName",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyName"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyLink"),children:e.jsx(J,{name:"companyLink",control:p,rules:{validate:j?f:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyLink"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyAddress"),children:e.jsx(J,{name:"companyAddress",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyAddress"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.supportEmail"),children:e.jsx(J,{name:"supportEmail",control:p,rules:{validate:j?w:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...a,size:"small",type:"email",error:!!i.errors[a.name],label:t("notification.email.supportEmail"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})})]})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const In=ae(mt)``,Be={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function En(){const{api:n}=Je(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=Rt(),l=s?.meta?.did,b=Object.assign({...Be},s?.settings?.notification?.pushKit||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=wt({defaultValues:bt(b,Object.keys(Be))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(R,q,K=!0)=>{try{const{blocklet:f}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:R})}}),w=Object.assign({...Be},f?.settings?.notification?.pushKit||{});I(w),K&&M.success(t("oauth.saveSuccess"))}catch(f){if(K)M.error(f.message||t("oauth.saveFailed"));else throw f}}),Y=$(async(R,q)=>{try{i.isDirty&&await E(R,q,!1);const K=(s?.configs||[]).find(C=>C.key==="BLOCKLET_APP_URL")?.value,f=Xt(Zt(K,_.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),w={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:f}}}};await n.sendPush({input:{did:l,receiver:S.testReceiver,notification:JSON.stringify(w)}}),M.success(t("notification.pushKit.testSuccess"))}catch(K){M.error(K.message||t("notification.pushKit.testfailed"))}}),z=$((R,q)=>{S.testReceiverError="",r.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(y,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(Z,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:S.testReceiver,onChange:K=>{S.testReceiver=K.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(K){if(!S.testReceiver?.trim()){S.testReceiverError=t("notification.pushKit.receiverRequired");return}S.testReceiverError="",await Y(R,q),K()}})}),F=$(R=>{const q=R?.trim();return q?He(q)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),W=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(An,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(J,{name:"enabled",control:p,render:({field:R})=>e.jsx(me,{control:e.jsx(qe,{checked:R.value,...R})})})}),e.jsx(X,{title:t("notification.pushKit.endpoint"),children:e.jsx(J,{name:"endpoint",control:p,rules:{validate:j?F:W},render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...R,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})})}),e.jsxs(X,{title:t("notification.pushKit.customOptions"),children:[e.jsx(J,{name:"did",control:p,render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...R,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})}),e.jsx(J,{name:"pushPath",control:p,render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Z,{...R,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const An=ae(mt)``,ct=[{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function kn(){const[n,s]=v.useState(ct[0].value),{locale:t}=v.useContext(en),r=se(()=>({email:e.jsx(Nn,{}),pushKit:e.jsx(En,{})}),[t]),o=v.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(y,{children:[e.jsx(jt,{tabs:ct,current:n,onChange:s}),e.jsx(y,{style:o,children:r[n]})]})}const At=v.createContext({}),{Provider:On,Consumer:Fs}=At;function Dn({children:n,blocklet:s=""}){const{api:t,inService:r,ws:{useSubscription:o}}=Je(),[l,b]=v.useState([]),[u,p]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),i=se(()=>s.meta?.did,[s]),[N,I]=v.useState([]),[S,j]=v.useState({}),E=se(()=>l.length?new Set(l.map(f=>f.id)):new Set,[l]),Y=async({page:f=1,pageSize:w=20,...C}={})=>{if(!i)return[];try{const a={paging:{page:f,pageSize:w},...C,teamDid:i,dateRange:C.dateRange?[Q(C.dateRange[0]).toISOString(),Q(C.dateRange[1]).toISOString()]:void 0},{dids:T,...O}=a;let D="";T&&T.includes("system")&&(D="system");const re=T?T.filter(pe=>pe!=="system"):[],ue={...O,source:D,componentDids:re},oe=await t.getNotificationSendLog({input:ue});return j(ue),b(oe.list),p(oe.paging),oe.list}catch(a){return M.error(a.message),[]}},z=async()=>{const f=await t.getNotificationComponents({input:{teamDid:i}});I(f.componentDids)},F=v.useCallback(f=>{const w=s.children.find(C=>C.meta?.did===f);if(w)return w.ancestors=[s],w},[s]),W=async({notificationId:f,receivers:w,channels:C,...a})=>{await t.resendNotification({input:{teamDid:i,notificationId:f,receivers:w,channels:C.map(T=>T==="wallet"?_.NOTIFICATION_SEND_CHANNEL.WALLET:T==="pushKit"?_.NOTIFICATION_SEND_CHANNEL.PUSH:T),...a}})},R=v.useCallback(async f=>(await t.getUser({input:{teamDid:i,user:{did:f}}})).user,[t,i]),q=v.useCallback(async({page:f=1,pageSize:w=20,...C}={})=>{try{const a={paging:{page:f,pageSize:w},...C,userName:C.searchText||"",teamDid:i,dateRange:C.dateRange?[Q(C.dateRange[0]).toISOString(),Q(C.dateRange[1]).toISOString()]:void 0};return await t.getReceivers({input:a})}catch(a){throw M.error(a.message),a}},[t,i]);v.useEffect(()=>{i&&z()},[i]),o(_.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,f=>{E.has(f.notificationId)&&Y(S)},[E,S]),o(_.EVENTS.NOTIFICATION_BLOCKLET_CREATE,f=>{E.has(f.id)||Y(S)},[E,S]);const K={fetch:Y,data:l,paging:u,blocklet:s,getComponent:F,resendNotification:W,getUser:R,componentDids:N,getReceivers:q,inService:r,teamDid:i};return e.jsx(On,{value:{notificationRecords:K},children:n})}function Xe(){const{notificationRecords:n}=v.useContext(At);return n}Ce.propTypes={severity:h.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ln={info:"primary",success:"success",error:"error",warning:"warning"};function Ce({severity:n="info"}){return e.jsx(tn,{type:Ln[n],children:n})}const Pn=(n,s,t="")=>{if(!t||!s)return"";switch(t){case _.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return n("notification.sendStatus.reason.disabled",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return n("notification.sendStatus.reason.unavailable",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return n("notification.sendStatus.reason.notSent",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return n("notification.sendStatus.reason.offline");default:return t}};function kt(n,s,t={}){const{status:r,updatedAt:o,reason:l="",channel:b="wallet"}=t,u=o?n("notification.sendStatus.sentTime",{date:on(o,s)}):"",p=Pn(n,b,l);return r===_.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:n("notification.sendStatus.failed"),sentTime:u,reason:p}:r===_.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:n("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:n("notification.sendStatus.pending"),reason:p,sentTime:u}}const $e={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ve=["wallet","pushKit","email"],dt=["info","success","error","warning"],Ot=n=>{const{settings:s}=n;return s?.notification?.email?.enabled},Dt=n=>{const{settings:s}=n;return s?.notification?.pushKit?.enabled},Fn=(n,s)=>{const t=le(s,"extra.notifications.email",!0);return{available:Ot(n),enabled:t}},_n=(n,s)=>{const t=le(s,"extra.notifications.push",!0);return{available:Dt(n),enabled:t}},zn=n=>({enabled:le(n,"extra.notifications.wallet",!0)}),Bn=n=>({enabled:le(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(s=>{setTimeout(()=>{s()},n*1e3)}),Wn=(n,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:n("notification.sendStatus.reason.available",{channel:s}),fail:n("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:[],Ae=(n=[])=>{const s=Q().startOf("day");return n.filter(t=>Q(t.sendAt).isSame(s,"day")).length},qn=(n,s="")=>{if(s&&Ve.includes(s)){const l=`${s}SendRecord`,b=le(n,l,[]);return Ae(b)}const t=le(n,"webhook",{}),r=Object.keys(t??{})??[];if(s&&r.includes(s)){const l=t[s]??[];return Ae(l)}const o={};return Ve.forEach(l=>{const b=`${l}SendRecord`,u=le(n,b,[]),p=Ae(u);o[l]=p}),r.length>0&&r.forEach(l=>{const b=t[l]??[],u=Ae(b);o[l]=u}),o},Oe=(n,s,t)=>{if(!Array.isArray(n))throw new Error("Invalid filterList or index");return n[t].splice(s,1),n},De=(n,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(n):!1},Kn=n=>{switch(n){case _.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case _.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case _.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case _.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function de({config:n,enableTooltip:s=!0,showTitle:t=!1,children:r=null}){const{status:o,title:l="",sentTime:b="",reason:u=""}=n,p=[l,u].filter(Boolean).join(", ");return e.jsx(ut,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:p}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:$e[o]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:$e[o]}})]}),e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:t?l:r})]})})}de.propTypes={config:h.object.isRequired,enableTooltip:h.bool,showTitle:h.bool,children:h.node};Le.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function Le({list:n,label:s,onDelete:t=()=>{}}){const{t:r,locale:o}=te();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(l=>{const b=kt(r,o,{status:l});return e.jsx(Ye,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(de,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>t(u,l)},l)})]})}Ze.propTypes={filterList:h.array.isRequired,onChange:h.func.isRequired,index:h.number.isRequired,column:h.object.isRequired,filterValues:h.array.isRequired,label:h.string.isRequired,renderLabel:h.func.isRequired};function Ze({filterList:n,onChange:s,index:t,column:r,filterValues:o,label:l,renderLabel:b}){return e.jsxs(V,{className:"filter-container",children:[e.jsx(pt,{component:"legend",children:l}),e.jsx(Ke,{row:!0,children:o.map(u=>e.jsx(me,{control:e.jsx(Me,{checked:n[t].indexOf(u.value??u)>-1,onChange:p=>{const i=[...n];p.target.checked?i[t]=[...i[t],u.value??u]:i[t]=i[t].filter(N=>N!==(u.value??u)),s(i[t],t,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function We(n){return e.jsx(Ze,{...n,renderLabel:s=>e.jsx(de,{enableTooltip:!1,config:{status:s.status},children:s.label})})}xe.propTypes={status:h.number.isRequired,updatedAt:h.string.isRequired,reason:h.string,channel:h.string,onResend:h.func};function xe({status:n,updatedAt:s,reason:t="",channel:r="wallet",onResend:o}){const{t:l,locale:b}=te(),u=kt(l,b,{status:n,updatedAt:s,reason:t,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(de,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Fe,{className:"resend-btn",size:"small",startIcon:e.jsx(Ge,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Qe.propTypes={value:h.array.isRequired,onChange:h.func};function Qe({value:n,onChange:s}){const{locale:t}=te(),r=Q().toDate(),[o,l]=v.useState(null),b=v.useCallback(i=>{l(o?null:i.currentTarget)},[o]),u=!!o,p=v.useCallback(i=>{if(!i.startDate||!i.endDate){M.error("Please select a date range");return}if(Q(i.startDate).isAfter(i.endDate)||!Q(i.startDate).isValid()||!Q(i.endDate).isValid()){M.error("Invalid date range");return}s([i.startDate,i.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(ee,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Fe,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[at(n[0],t)," - ",at(n[1],t)]})}),e.jsx(Ue,{open:u,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(jn,{open:!0,maxDate:r,initialDateRange:{startDate:n[0],endDate:n[1]},toggle:b,definedRanges:vn(r),onChange:p})})]})}et.propTypes={itemComponent:h.elementType.isRequired};function et({itemComponent:n,...s}){const{t}=te();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:t("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(nn.TableFilterList,{...s,ItemComponent:n})})]})}function tt({label:n,onDelete:s,canDelete:t=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return t&&typeof t=="function"&&(l=t({label:n,...r})),e.jsx(Ye,{label:n,variant:"outlined",...o&&l?{onDelete:o}:{}})}tt.propTypes={label:h.string.isRequired,onDelete:h.func,canDelete:h.func};const Mn=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Pt.propTypes={loading:h.bool,onCancel:h.func,onConfirm:h.func};function Pt({loading:n=!1,onCancel:s=()=>{},onConfirm:t=()=>{}}){const{t:r}=te(),[o,l]=v.useState(Mn),[b,u]=v.useState(!0),p=(N,I)=>{I.checked=N.target.checked;const S=o.map(j=>({...j,checked:j.value===I.value?I.checked:j.checked}));l(S)},i=N=>{N.stopPropagation(),t({channels:o.filter(I=>I.checked).map(I=>I.value),isResendFailedOnly:b})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ee,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(V,{component:"fieldset",variant:"standard",children:[e.jsx(pt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Ke,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(N=>e.jsx(me,{control:e.jsx(Me,{checked:N.checked,onChange:I=>p(I,N),name:N.value}),label:N.label},N.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Ke,{children:e.jsx(me,{control:e.jsx(Me,{checked:b,onChange:N=>u(N.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Fe,{onClick:N=>{N.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Fe,{onClick:i,color:"primary",disabled:n,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[n&&e.jsx(ft,{size:16}),r("common.confirm")]})]})]})}Ft.propTypes={notificationId:h.string.isRequired,handleResend:h.func,resending:h.bool};function Ft({notificationId:n,handleResend:s,resending:t=!1}){const{t:r,locale:o}=te(),l=ht(),b=v.useMemo(()=>xt(l,Lt()),[l]),{getReceivers:u,inService:p,teamDid:i,getUser:N,blocklet:I}=Xe(),[S,j]=v.useState(!1),[E,Y]=v.useState([]),z=ye({anchorEl:null,position:null}),F=ye({anchorEl:null,position:null}),[W,R]=v.useState(null),[q,K]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[f,w]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Q().subtract(1,"month").startOf("day").toDate(),Q().endOf("day").toDate()]}),[C,a]=v.useState([]),T=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],O=async()=>{if(!S&&n)try{j(!0);const c=await u({notificationId:n,...f}),d=c.list.map(m=>({...m,receiverUser:{...m.receiverUser,avatar:It(m.receiverUser.avatar,i,p)}}));Y(d),K(c.paging),j(!1)}catch(c){M.error(c.message),j(!1)}};v.useEffect(()=>{O()},[f]);const D=c=>{c.stopPropagation();const d=c.currentTarget;F.anchorEl=d;const m=d.getBoundingClientRect();F.position={top:m.top+window.scrollY,left:m.left+window.scrollX}},re=c=>c.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ce,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:D,children:r("notification.resend")})}):null,ue={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:q.page-1,rowsPerPage:q.pageSize,count:q.total,searchText:f.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:C,onRowSelectionChange:(c,d)=>{a(d.map(m=>m.dataIndex))},customToolbarSelect:re},oe=({page:c,rowsPerPage:d,searchText:m,filterList:k})=>{const[,U=[],ne=[],G=[]]=k;f.pageSize!==d?w(H=>({...H,pageSize:d,page:1})):f.page!==c+1?w(H=>({...H,page:c+1})):f.searchText!==m?w(H=>({...H,searchText:m,page:1})):je(U,f.walletSendStatus)?je(ne,f.pushKitSendStatus)?je(G,f.emailSendStatus)||w(H=>({...H,emailSendStatus:G,page:1})):w(H=>({...H,pushKitSendStatus:ne,page:1})):w(H=>({...H,walletSendStatus:U,page:1}))},pe=v.useCallback(async(c,d)=>{if(!d)return!1;const m=await N(d);return m?c==="wallet"?zn(m):c==="email"?Fn(I,m):c==="pushKit"?_n(I,m):c==="webhook"?Bn(m):!0:!1},[N,I]),Re=v.useCallback(c=>Wn(r,c),[r]),fe=()=>{z.anchorEl=null,z.position=null,R(null)},he=()=>{F.anchorEl=null,F.position=null},g=async(c,d,m=!0,k="")=>{if(!(!d.length||!c.length))try{s(c,d,m,k),F.anchorEl||(await Ee(.5),fe())}catch(U){console.error("handleResend error",{error:U})}},x=async({channels:c,isResendFailedOnly:d})=>{const m=C.map(k=>E[k].receiver);await g(c,m,d),await Ee(.5),he(),a([])},A=async(c,d=[],m=!0)=>{try{await g(["webhook"],[c.receiver],m,d)}catch(k){M.error(k.response?k.response.statusText:k.message)}},L=async(c,d,m,k=[],U=!0)=>{if(c.stopPropagation(),qn(d,m)>=4){M.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await A(d,k,U);return}if(c){const G=c.currentTarget,H=G.getBoundingClientRect();z.anchorEl=G,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}R({channel:m});try{const G=await pe(m,d.receiver);await Ee(1),R({channel:m,result:G}),(typeof G=="boolean"&&G||Qt(G)&&Object.values(G).every(H=>!!H))&&(await s([m],[d.receiver],U),F.anchorEl||(await Ee(.5),fe()))}catch(G){M.error(G.message)}},B=c=>{w(d=>({...d,dateRange:c,page:1}))},P=(c,d,m,k)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);w(ne=>({...ne,[k]:U,page:1}))},ie=se(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:c=>{const{receiverUser:d,receiver:m}=E[c];return d?e.jsxs(y,{"data-cy":`member-name-${d.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(vt,{src:`${d.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:m,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Se,{children:d.fullName})]},m):e.jsx(bn,{size:14,responsive:!1,compact:!0,copyable:!1,did:m})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:f.walletSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Wallet",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[1].options.filterList,"walletSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,k)=>e.jsx(We,{label:"Wallet",filterList:c,onChange:d,index:m,column:k,filterValues:T})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:k}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:k,channel:"wallet",onResend:U=>L(U,E[c],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{pushKitSendStatus:d,pushKitSendAt:m,pushKitSendFailedReason:k}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:k,channel:"pushkit",onResend:U=>L(U,E[c],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:f.pushKitSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Push Kit",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[2].options.filterList,"pushKitSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,k)=>e.jsx(We,{label:"Push Kit",filterList:c,onChange:d,index:m,column:k,filterValues:T})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:k}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:k,channel:"email",onResend:U=>L(U,E[c],"email",[],!1)})},filter:!0,filterType:"custom",filterList:f.emailSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Email",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[3].options.filterList,"emailSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,k)=>e.jsx(We,{label:"Email",filterList:c,onChange:d,index:m,column:k,filterValues:T})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{webhook:d}=E[c];if(!d)return null;const m=Object.entries(d)[0];if(!m)return null;const[k,U]=m,ne=U[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(Se,{maxLength:30,children:k},k),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:G=>L(G,E[c],"webhook",[k],!1)})]},k)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:c=>{const{createdAt:d}=E[c];return e.jsx(Nt,{value:d,locale:o,shouldUpdate:!0})}}}],[E,o,f,r]),we=[e.jsx(Qe,{value:f.dateRange,onChange:B},"date-picker"),e.jsx(ce,{variant:"contained",size:"small",color:"primary",loading:S,startIcon:e.jsx(Kt,{}),onClick:()=>O(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(Hn,{children:e.jsxs(gt,{theme:b,children:[e.jsx(yt,{className:"receivers-table",locale:o,loading:S,columns:ie,data:E,onChange:oe,options:ue,customButtons:we,components:{TableFilterList:c=>e.jsx(et,{...c,itemComponent:d=>e.jsx(tt,{...d,canDelete:()=>!1})})}}),z.anchorEl&&e.jsx(Ue,{open:!!z.anchorEl,anchorReference:"anchorPosition",anchorPosition:z.position,onClose:fe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs($n,{children:[e.jsxs(ee,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Re(W?.channel).map(c=>{const{type:d,pass:m,fail:k}=c;return!W?.result||W?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[d]?ke.success.main:"inherit"},children:[W?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:ke.primary.main}}),e.jsx("span",{children:m})]},d):e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ke.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:k})]},d)})})]})}),F.anchorEl&&e.jsx(Ue,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:he,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Pt,{loading:t,onCancel:he,onConfirm:x})})]})})})}const Un=v.memo(Ft),Hn=ae.div`
2
+ td.MuiTableCell-footer {
3
+ border: none !important;
4
+ }
5
+ .sent-status-cell {
6
+ .resend-btn {
7
+ display: none;
8
+ }
9
+ &:hover {
10
+ .resend-btn {
11
+ display: flex;
12
+ }
13
+ }
14
+ }
15
+ `,$n=ae.div`
16
+ padding: 8px 16px;
17
+ .check-title {
18
+ font-weight: 500;
19
+ margin-bottom: 8px;
20
+ &::first-letter {
21
+ text-transform: uppercase;
22
+ }
23
+ }
24
+ .check-item {
25
+ svg {
26
+ font-size: 16px;
27
+ }
28
+ font-size: 12px;
29
+ }
30
+ `,ve=n=>n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:n;function Vn(n){const{wallet:s,push:t,email:r,webhook:o}=n;return[{name:"Wallet",value:e.jsx(ge,{item:s})},{name:"Push",value:e.jsx(ge,{item:t})},{name:"Email",value:e.jsx(ge,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(ge,{item:o,isWebhook:!0})}]:[]]}function Yn(n,s,t){const{wallet:r,push:o,email:l,webhook:b}=n;return[{name:"Wallet",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}nt.propTypes={statistics:h.object.isRequired,onResend:h.func,mode:h.oneOf(["simple","detail"]),resending:h.bool};ge.propTypes={item:h.object.isRequired,isWebhook:h.bool};function ge({item:n,isWebhook:s=!1}){const{t}=te(),r=s?n.success.length:n.success,o=n.total,l=r===o?"success":"failed";return e.jsx(y,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(de,{config:{status:l},enableTooltip:!1,children:[ve(r)," / ",ve(o)," ",t("notification.sendStatus.success")]})})})}be.propTypes={item:h.object.isRequired,isWebhook:h.bool,channel:h.string,onResend:h.func,loading:h.bool};function be({channel:n=_.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:t=!1,onResend:r=()=>{},loading:o=!1}){const{t:l}=te(),{success:b,failed:u,pending:p}=s,i=Kn(n),N=t?b.length:b,I=t?u.length:u,S=t?p.length:p,j=async F=>{F.stopPropagation();const W=t?[...new Set([...b,...u].map(R=>R))]:[];await r([n],[],!0,W)},E=N+I,Y=E>0?N/E*100:0,z=E>0?I/E*100:0;return e.jsxs(Gn,{successRatio:Y,failedRatio:z,children:[e.jsxs(ee,{variant:"h6",children:[i," (",s.total,")"]}),e.jsxs(ee,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:$e.success,fontWeight:600,fontSize:24},children:ve(N)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(y,{className:"unsent-area",children:[e.jsxs(y,{children:[e.jsxs(de,{config:{status:"failed"},enableTooltip:!1,children:[ve(I)," ",l("notification.sendStatus.failed")]}),e.jsxs(de,{config:{status:"pending"},enableTooltip:!1,children:[ve(S)," ",l("notification.sendStatus.pending")]})]}),I>0&&e.jsx(y,{className:"resend-btn",children:e.jsx(ce,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:j,children:l("notification.resend")})})]})]})}function nt({statistics:n,mode:s="simple",onResend:t=()=>{},resending:r=!1}){const o=se(()=>s==="simple"?Vn(n):Yn(n,t,r),[n,s]);return s==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(Tt,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(st,{container:!0,spacing:2,children:o.map(l=>e.jsx(st,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const Gn=ae(y)`
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: flex-start;
34
+ padding: 16px;
35
+ border-radius: 8px;
36
+ background: ${({successRatio:n,failedRatio:s,theme:t})=>n===0&&s===0?t.palette.grey[300]:`linear-gradient(to right, ${Ht(t.palette.success.light,.4)} ${n}%, ${t.palette.grey[100]} ${n}%)`};
37
+ transition: 'background 0.5s ease';
38
+ cursor: pointer;
39
+ .unsent-area {
40
+ width: 100%;
41
+ position: relative;
42
+ .resend-btn {
43
+ position: absolute;
44
+ right: 0;
45
+ bottom: 0;
46
+ }
47
+ }
48
+ `;_t.propTypes={notification:h.object.isRequired,onCancel:h.func,blocklet:h.object.isRequired,tab:h.string};function _t({notification:n,onCancel:s=()=>{},blocklet:t,tab:r="info"}){const{t:o,locale:l}=te(),{getComponent:b,resendNotification:u}=Xe(),[p,i]=v.useState(!1),N=se(()=>b(n.componentDid)||t,[t,n.componentDid]),I=ye({tab:r||"info"}),S=v.useCallback(async(f,w,C=!0,a=[])=>{if(!f.length||!n.id)return;const T=w.length>0?w:n?.receivers?.map(D=>D.receiver);if(!T.length)return;let O=[...f];if(O.includes(_.NOTIFICATION_SEND_CHANNEL.PUSH)&&!Dt(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),O=O.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.PUSH)),O.includes(_.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!Ot(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),O=O.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!O.length)try{i(!0),await u({notificationId:n.id,receivers:T,channels:O,resendFailedOnly:C,...O.includes("webhook")&&a.length?{webhookUrls:a}:{}}),M.success("Message has been sent!")}catch(D){console.error("handleResend error",{error:D}),M.error(D.response?D.response.statusText:D.message)}finally{i(!1)}},[t,n.id,n?.receivers,u,o]),j=se(()=>ln(n),[n]),E=se(()=>cn(n),[n]),Y=se(()=>j?n?.actorInfo:[],[n]),z=se(()=>t?.did||t?.meta?.did||"",[t]);function F(){return[{name:o("notification.from"),value:j&&E?e.jsx(fn,{actors:Y,teamDid:z,size:32,showName:!0}):e.jsx(hn,{size:32,blocklet:N,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(Se,{maxLength:50,children:n.title})},{name:o("notification.body"),value:j?e.jsx(xn,{notification:n,blocklet:t}):e.jsx(dn,{notification:n,rows:0})},{name:o("notification.severity"),value:e.jsx(Ce,{severity:n.severity})},{name:o("notification.createdAt"),value:e.jsx(sn,{value:n.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(w=>e.jsx(Tt,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:w.name,children:w.value},w.name))}const W={info:{label:o("common.basicInfo"),value:"info",component:F},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},R=Object.values(W).map(({label:f,value:w})=>({label:f,value:w})),q=W[I.tab]||W.info,K=f=>{I.tab=f};return e.jsx(St,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{I.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(Xn,{children:[e.jsx(y,{className:"tabs",sx:{mx:3},children:e.jsx(jt,{tabs:R,current:I.tab,onChange:K,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[I.tab==="receivers"&&e.jsx(Un,{notificationId:n.id,resending:p,handleResend:S}),I.tab==="statistics"&&e.jsx(nt,{statistics:n.statistics,mode:"detail",resending:p,onResend:S}),I.tab==="info"&&e.jsx(q.component,{})]})]})})}const Jn=v.memo(_t),Xn=ae.div`
49
+ & > .notification-row {
50
+ padding: 0;
51
+ }
52
+
53
+ .tabs {
54
+ margin: 0;
55
+ }
56
+ .body {
57
+ margin-top: 16px;
58
+ }
59
+
60
+ .channel-item {
61
+ display: flex;
62
+ padding: 4px;
63
+ justify-content: flex-start;
64
+ align-items: center;
65
+ gap: 8px;
66
+ > p {
67
+ font-size: 15px;
68
+ }
69
+ .resend-btn {
70
+ svg {
71
+ font-size: 16px;
72
+ }
73
+ display: flex;
74
+ align-items: center;
75
+ font-size: 12px;
76
+ cursor: pointer;
77
+ &.disabled {
78
+ cursor: not-allowed;
79
+ color: ${ke.text.disabled};
80
+ }
81
+ }
82
+ }
83
+ `;Pe.propTypes={blocklet:h.object,label:h.string};const Zn=ae.div`
84
+ display: flex;
85
+ justify-items: flex-start;
86
+ align-items: center;
87
+ gap: 8px;
88
+ .name {
89
+ display: block;
90
+ max-width: 260px;
91
+ white-space: nowrap;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ }
95
+ `;function Pe({blocklet:n=null,label:s=""}){return e.jsx(Zn,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(Et,{size:24,blocklet:n,ancestors:n.ancestors}),e.jsx("span",{className:"name",children:n.title||n.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}zt.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function zt({list:n,label:s,onDelete:t=()=>{}}){return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(r=>e.jsx(Ye,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(Ce,{severity:r})}),onDelete:o=>t(o,r)},r))]})}function Qn(n){return e.jsx(Ze,{...n,renderLabel:s=>e.jsx(Ce,{severity:s})})}function es({customTableButtons:n}){const{t:s,locale:t}=te(),r=ht(),o=v.useMemo(()=>xt(r,Lt()),[r]),[l,b]=v.useState(!1),{data:u,paging:p,blocklet:i,fetch:N,getComponent:I,componentDids:S,inService:j,teamDid:E}=Xe(),Y=v.useRef(null),[z,F]=v.useState(null),[W,R]=v.useState("info"),q=yn(),[K,f]=v.useState(!1),w=`notification-records-${i.meta?.did}`,C=an(w),[a,T]=v.useState({pageSize:C.rowsPerPage||10,page:C.page?C.page+1:1,dids:C.dids||[],dateRange:C.dateRange||[Q().subtract(1,"month").startOf("day").toDate(),Q().endOf("day").toDate()]}),O=se(()=>{if(!i.children||!i.children.length)return[];const g=[];return i.children.forEach(x=>{const A=x.did||x.meta?.did;S.includes(A)&&(x.ancestors=[i],g.push(x))}),g},[S,i]),D=async g=>{try{b(!0),await N(g),b(!1)}finally{b(!1)}};v.useEffect(()=>{D(a)},[a]),v.useEffect(()=>{const g=u.find(x=>x.id===z?.id);z&&g&&F({...g})},[u]);const re=(g,x,A,L)=>{g.stopPropagation();const B=A.filter(P=>P!==x);T(P=>({...P,[L]:B,page:1}))},ue=({page:g,rowsPerPage:x,filterList:A})=>{const[L=[],,,,B=[]]=A;a.pageSize!==x?T(P=>({...P,pageSize:x,page:1})):a.page!==g+1?T(P=>({...P,page:g+1})):je(a.dids,L)?je(a.severities,B)||T(P=>({...P,severities:B,page:1})):T(P=>({...P,dids:L,page:1}))},oe=v.useCallback(()=>{F(null),R("info")},[]),pe=v.useCallback(()=>{N(a)},[N,a]),Re=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:g=>g.map((x,A)=>{if(x==="system")return e.jsx("span",{children:s("notification.system")},`system-${A}`);const L=O.find(B=>(B.did||B.meta?.did)===x);return e.jsx(Pe,{blocklet:L,label:L?.title||L?.meta?.title},x)}),update:(g,x,A)=>(g[A].splice(x,1),g)},filterOptions:{names:O,logic:(g,x)=>x.length?!x.includes(g):!1,display:(g,x,A,L)=>e.jsxs(V,{style:{width:"380px"},children:[e.jsx($t,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Vt,{multiple:!0,value:g[A],renderValue:B=>e.jsx(y,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:B.map(P=>{if(P==="system")return e.jsx("span",{children:s("notification.system")},P);const ie=O.find(we=>(we.did||we.meta?.did)===P);return e.jsx(Pe,{blocklet:ie,label:ie?.title||ie?.meta?.title},P)})}),onChange:B=>{g[A]=B.target.value,x(g[A],A,L)},children:[e.jsx(it,{value:"system",children:s("notification.system")}),O.map(B=>{const P=B.did||B.meta?.did;return e.jsx(it,{value:P,children:e.jsx(Pe,{blocklet:B,label:B.title||B.meta?.title})},P)})]})]})},customBodyRenderLite:g=>{const x=u[g],A=I(x.componentDid);return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[A?e.jsx(Et,{size:32,blocklet:A,ancestors:A.ancestors??[]}):e.jsx(gn,{blocklet:i,size:32}),e.jsx(Se,{maxLength:50,children:A?.meta?.title||i?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g],{receivers:A}=x;return e.jsx(Yt,{total:A.length,renderSurplus:L=>L<100?e.jsxs("span",{children:["+",L]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:L=>{L.stopPropagation(),F(x),R("receivers")},children:A.map(L=>{const{receiverUser:B}=L,P=It(B.avatar,E,j);return e.jsx(vt,{alt:B.fullName,src:`${P}?imageFilter=resize&w=48&h=48`,size:32,did:L.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},L.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(y,{onClick:A=>{A.stopPropagation(),F(x),R("statistics")},children:e.jsx(nt,{statistics:x.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(Se,{maxLength:50,children:x.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:g=>{const x=u[g];return e.jsx(Ce,{severity:x.severity})},filter:!0,filterType:"custom",filterList:a.severities??[],customFilterListOptions:{render:g=>e.jsx(zt,{list:g,label:s("notification.severity"),onDelete:(x,A)=>{x.stopPropagation(),re(x,A,Re[4].options.filterList,"severities")}}),update:Oe},filterOptions:{names:dt,fullWidth:!0,logic:De,display:(g,x,A,L)=>e.jsx(Qn,{label:s("notification.severity"),filterList:g,onChange:x,index:A,column:L,filterValues:dt})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:g=>{const{createdAt:x}=u[g];return e.jsx(Nt,{value:x,locale:t,shouldUpdate:!0})}}}],fe=g=>{T(x=>({...x,dateRange:g,page:1}))},he=[e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Gt,{onClick:()=>f(!0),sx:{p:q?0:void 0},children:e.jsx(Jt,{})},"settings"),q?e.jsx(ee,{children:s("common.setting")}):null]}),...n||[]];return e.jsxs(y,{ref:Y,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ts,{children:e.jsx(gt,{theme:o,children:e.jsx(yt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:t,columns:Re,data:u,durable:w,onChange:ue,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:p.page-1,rowsPerPage:p.pageSize,count:p.total,...C,onRowClick:(g,{dataIndex:x})=>{F(u[x])}},customPreButtons:[e.jsx(Qe,{value:a.dateRange,onChange:fe})],customButtons:he,components:{TableFilterList:g=>e.jsx(et,{...g,itemComponent:x=>e.jsx(tt,{...x,canDelete:A=>A?.columnNames?.[A?.index||0]?.name==="sender"})})}})})}),z&&e.jsx(Jn,{refresh:pe,onCancel:oe,notification:z,blocklet:i,tab:W}),e.jsx(St,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:K,onClose:()=>f(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(y,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(kn,{})})})]})}const ts=ae.div`
96
+ td.MuiTableCell-footer {
97
+ border: none !important;
98
+ }
99
+ .sent-status-cell {
100
+ .resend-btn {
101
+ display: none;
102
+ }
103
+ &:hover {
104
+ .resend-btn {
105
+ display: flex;
106
+ }
107
+ }
108
+ }
109
+
110
+ .custom-toobar-btns {
111
+ gap: 4px;
112
+ }
113
+ `;ns.propTypes={blocklet:h.object.isRequired,customTableButtons:h.array};function ns({blocklet:n={},customTableButtons:s=[]}){return e.jsx(Dn,{blocklet:n,children:e.jsx(es,{customTableButtons:s})})}export{ns as default};
@@ -0,0 +1,269 @@
1
+ import{$ as o,j as n,ak as f,o as y,bc as I,av as j,J as _,a8 as A}from"./vendor-mui-core-BWI0_sKe.js";import{r as v}from"./vendor-react-x2lQvn4m.js";import{m as k,X as B,T as L,D as W}from"./vendor-ux-DVPR2iDY.js";import{aM as H,aR as V,aS as C,aT as X,aU as Y,k as Z,aV as J,a8 as U,aW as N,aX as G}from"./index-B0xpDUsO.js";import{Z as K,I as P,Y as Q}from"./vendor-utils-Vke2d2wu.js";import{f as ee}from"./vendor-hooks-CFpNP5Ql.js";function z({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=v.isValidElement(t)?t:n.jsx("img",{src:t,alt:e});return n.jsxs(ne,{...p,children:[n.jsxs("div",{children:[t&&n.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&n.jsx("div",{className:"footer-brand-name",children:e})]}),i&&n.jsx("div",{className:"footer-brand-desc",children:i})]})}z.propTypes={name:o.node,logo:o.node,description:o.string};const ne=k("div")`
2
+ display: flex;
3
+ flex-direction: column;
4
+ font-size: 14px;
5
+ a {
6
+ text-decoration: none;
7
+ color: inherit;
8
+ }
9
+ > div:first-of-type {
10
+ display: flex;
11
+ align-items: center;
12
+ }
13
+ .footer-brand-logo {
14
+ display: flex;
15
+ align-items: center;
16
+ margin-right: 12px;
17
+ line-height: 1;
18
+ img,
19
+ svg {
20
+ width: auto;
21
+ height: 40px;
22
+ max-height: 40px;
23
+ }
24
+ }
25
+ .footer-brand-name {
26
+ font-size: 18px;
27
+ color: ${e=>e.theme.palette.grey[900]};
28
+ }
29
+ .footer-brand-desc {
30
+ white-space: pre-line;
31
+ margin-top: 16px;
32
+ color: ${e=>e.theme.palette.text.secondary};
33
+ }
34
+
35
+ ${e=>e.theme.breakpoints.down("sm")} {
36
+ width: auto;
37
+ }
38
+
39
+ ${e=>e.theme.breakpoints.down("md")} {
40
+ .footer-brand-logo {
41
+ img,
42
+ svg {
43
+ height: 32px;
44
+ max-height: 32px;
45
+ }
46
+ }
47
+ }
48
+ `;function M({links:e=[],flowLayout:t=!1,columns:i,...p}){const[c,d]=v.useState(-1),x=H({key:"md"}),g=e.some(a=>a.items?.length),b=!x&&g&&K(i)&&i>1,u=({label:a,link:s,icon:l,render:m,props:r})=>{let h=a;if(m)h=m({label:a,link:s,props:r});else if(s&&P(s)){const $=s.startsWith("http")||s.startsWith("//");h=n.jsx("a",{href:s,"aria-label":`Footer link for ${a}`,target:$?"_blank":"_self",rel:$?"noreferrer noopener":void 0,...r,children:a})}return n.jsxs(n.Fragment,{children:[l&&n.jsx(C,{icon:l,size:20,sx:{mr:.5}}),h]})},w=ee(()=>e?.length?t?e.map((a,s)=>n.jsx("span",{className:"footer-links-item",children:u(a)},s)):b?V(e,{columns:i}).map((a,s)=>n.jsx("div",{className:"footer-links-column",children:a.filter(l=>l.group).map((l,m)=>{const{items:r}=l;return n.jsxs("div",{className:"footer-links-group",children:[n.jsx("span",{className:"footer-links-item",children:u(l)}),!!r?.length&&n.jsx("div",{className:"footer-links-sub",children:r.map((h,$)=>n.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":h.isNew}),children:u(h)},$))})]},m)})},s)):e.map((a,s)=>{const{items:l}=a,m=s===c;return n.jsxs("div",{className:y("footer-links-group",{"footer-links-group--active":m}),onClick:()=>d(c===s?-1:s),children:[n.jsxs("span",{className:"footer-links-item",children:[u(a),!!l?.length&&n.jsx("span",{className:"footer-links-group-expand-icon",children:n.jsx(I,{style:{transform:`rotate(${m?180:0}deg)`}})})]}),!!l?.length&&n.jsx("div",{className:"footer-links-sub",children:l.map((r,h)=>n.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":r.isNew}),children:u(r)},h))})]},s)}):null,[e,t,b,c]);return e?.length?n.jsx(oe,{...p,className:y(p.className,{"footer-links--grouped":g,"footer-links--flow":t,"footer-links--columns":b}),children:n.jsx("div",{className:"footer-links-inner",children:w})}):null}M.propTypes={links:o.arrayOf(o.shape({label:o.string,link:o.string,render:o.func,props:o.object})),flowLayout:o.bool,columns:o.number.isRequired};const oe=k("div")`
49
+ overflow: hidden;
50
+ color: ${({theme:e})=>e.palette.text.secondary};
51
+ .footer-links-inner {
52
+ display: flex;
53
+ justify-content: space-between;
54
+ margin: 0 -8px;
55
+ }
56
+ .footer-links-group,
57
+ .footer-links-sub {
58
+ display: flex;
59
+ flex-direction: column;
60
+ }
61
+ .footer-links-group-expand-icon {
62
+ display: none;
63
+ position: absolute;
64
+ right: 16px;
65
+ top: 50%;
66
+ transform: translate(0, -50%);
67
+ line-height: 1;
68
+ svg {
69
+ width: auto;
70
+ height: 0.75em;
71
+ }
72
+ }
73
+ .footer-links-item {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ position: relative;
77
+ padding: 6px 8px;
78
+ font-size: 14px;
79
+ &--new::after {
80
+ content: 'New';
81
+ color: ${({theme:e})=>e.palette.info.main};
82
+ background-color: ${({theme:e})=>e.palette.info.light};
83
+ padding: 1px 8px;
84
+ border-radius: 10px/50%;
85
+ margin-left: 8px;
86
+ }
87
+ }
88
+ &.footer-links--grouped {
89
+ .footer-links-group {
90
+ > .footer-links-item {
91
+ font-weight: 600;
92
+ color: ${({theme:e})=>e.palette.text.primary};
93
+ }
94
+ .footer-links-sub {
95
+ margin-top: 8px;
96
+ }
97
+ }
98
+ }
99
+ a {
100
+ display: inline-block;
101
+ max-width: 150px;
102
+ color: inherit;
103
+ text-decoration: none;
104
+ transition: color 0.2s ease-in-out;
105
+ &:hover {
106
+ color: ${({theme:e})=>e.palette.text.primary};
107
+ }
108
+ }
109
+ /* columns 布局 */
110
+ &.footer-links--columns {
111
+ .footer-links-inner {
112
+ gap: 96px;
113
+ }
114
+ .footer-links-column {
115
+ display: flex;
116
+ flex-direction: column;
117
+ }
118
+ .footer-links-group {
119
+ .footer-links-sub {
120
+ margin-top: 2px;
121
+ margin-bottom: 12px;
122
+ }
123
+ }
124
+ }
125
+
126
+ /* flow 布局 */
127
+ &.footer-links--flow {
128
+ display: inline-flex;
129
+ .footer-links-inner {
130
+ justify-content: center;
131
+ flex-wrap: wrap;
132
+ margin: 0 -8px;
133
+ .footer-links-item {
134
+ padding: 0 8px;
135
+ }
136
+ .footer-links-item + .footer-links-item::before {
137
+ content: '';
138
+ position: absolute;
139
+ left: 0;
140
+ top: 50%;
141
+ transform: translate(0, -50%);
142
+ height: 1em;
143
+ border-left: 1px solid ${e=>e.theme.palette.text.secondary};
144
+ }
145
+ }
146
+ }
147
+
148
+ /* 移动端样式 */
149
+ ${e=>e.theme.breakpoints.down("md")} {
150
+ .footer-links-inner {
151
+ flex-direction: column;
152
+ margin: 0;
153
+ }
154
+ .footer-links-sub {
155
+ display: none;
156
+ }
157
+ .footer-links-group {
158
+ position: relative;
159
+ padding: 12px 0;
160
+ .footer-links-item .footer-links-group-expand-icon {
161
+ display: inline-block;
162
+ }
163
+ }
164
+ .footer-links-group + .footer-links-group {
165
+ border-top: 1px solid ${e=>e.theme.palette.grey[200]};
166
+ }
167
+ .footer-links-group--active {
168
+ .footer-links-sub {
169
+ display: flex;
170
+ flex-direction: row;
171
+ flex-wrap: wrap;
172
+ .footer-links-item {
173
+ flex: 0 0 50%;
174
+ }
175
+ }
176
+ }
177
+ .footer-links-item {
178
+ padding-left: 0;
179
+ padding-right: 0;
180
+ font-size: 13px;
181
+ }
182
+ &.footer-links--grouped {
183
+ .footer-links-group {
184
+ > .footer-links-item {
185
+ font-size: 14px;
186
+ }
187
+ }
188
+ }
189
+
190
+ &.footer-links--flow {
191
+ .footer-links-inner {
192
+ flex-direction: row;
193
+ }
194
+ }
195
+ }
196
+ `;function R({items:e=null,...t}){return e?.length?n.jsx(te,{...t,children:e.map((i,p)=>n.jsx("a",{href:i.link,target:"_blank","aria-label":`Social media icon${i.title?` for ${i.title}`:""}`,rel:"noreferrer",children:n.jsx(C,{icon:i.icon||i.title,size:24,component:"span"})},p))}):null}R.propTypes={items:o.arrayOf(o.shape({icon:o.string,link:o.string}))};const te=k("div")`
197
+ display: inline-flex;
198
+ flex-wrap: wrap;
199
+ align-items: center;
200
+ justify-content: center;
201
+ gap: 20px;
202
+ a {
203
+ color: ${e=>e.theme.palette.text.secondary};
204
+ text-decoration: none;
205
+ transition: color 0.2s ease-in-out;
206
+ &:hover {
207
+ color: ${({theme:e})=>e.palette.text.primary};
208
+ }
209
+ }
210
+ ${e=>e.theme.breakpoints.down("md")} {
211
+ gap: 12px;
212
+ }
213
+ `;function O({owner:e="ArcBlock",year:t=`${new Date().getFullYear()}`,...i}){return n.jsxs(ie,{...i,children:["Copyright © ",t," ",e]})}O.propTypes={owner:o.string,year:o.string};const ie=k("p")`
214
+ display: flex;
215
+ align-items: center;
216
+ margin: 0;
217
+ font-size: 13px;
218
+ `;function T({children:e=null,autoCenter:t=!1,...i}){return e?n.jsx(re,{...i,className:y(i.className,{"footer-row-auto-center":t}),children:e}):null}T.propTypes={children:o.any,autoCenter:o.bool};const re=k(f)`
219
+ display: flex;
220
+ justify-content: space-between;
221
+ & + & {
222
+ margin-top: 24px;
223
+ }
224
+ &.footer-row-auto-center > *:only-child {
225
+ margin: 0 auto;
226
+ }
227
+
228
+ ${({theme:e})=>e.breakpoints.down("md")} {
229
+ align-items: stretch;
230
+ flex-direction: column;
231
+ gap: ${({theme:e})=>e.spacing(1)};
232
+ > * {
233
+ flex: 1 0 100%;
234
+ }
235
+ &.footer-row-auto-center > * {
236
+ margin: 0 auto;
237
+ }
238
+ }
239
+ `;function D({elements:e,data:t,className:i="",...p}){const c=!!t.navigation?.length;let d=null;return c?d=n.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between"},children:[n.jsxs(f,{sx:{flex:"1 1 auto",paddingRight:{xs:0,md:3},display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2,pb:3},children:[n.jsx(f,{children:e.brand}),n.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),n.jsx(f,{sx:({palette:x})=>({mb:3,borderTop:{xs:`1px solid ${x.grey[200]}`,md:0}}),children:e.navigation})]}):d=n.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:"space-between",gap:2,pb:3},children:[n.jsx(f,{children:e.brand}),n.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),n.jsx(se,{...p,className:y({"footer--with-navs":c},i),children:n.jsxs(j,{style:{padding:0},children:[d,n.jsx(f,{sx:{pt:3,borderTop:1,borderColor:"divider"}}),n.jsx(j,{children:n.jsxs(T,{autoCenter:!0,children:[e.copyright,e.links]})})]})})}D.propTypes={elements:o.shape({brand:o.element,navigation:o.element,socialMedia:o.element,copyright:o.element,links:o.element}).isRequired,data:o.object.isRequired,className:o.string};const se=k("div")`
240
+ padding: 32px 0 24px 0;
241
+ .footer-brand-name,
242
+ .footer-brand-desc {
243
+ display: none;
244
+ }
245
+ &.footer--with-navs {
246
+ ${e=>e.theme.breakpoints.up("md")} {
247
+ .footer-brand-desc {
248
+ max-width: 360px;
249
+ display: block;
250
+ }
251
+ }
252
+ }
253
+ && .footer-brand-logo {
254
+ margin-right: 0;
255
+ }
256
+ `;function E({elements:e,data:t,...i}){return n.jsx(le,{...i,children:n.jsx(j,{style:{padding:0},children:n.jsxs(j,{className:"plain-layout-container",children:[e.links&&n.jsxs(T,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!e.links&&n.jsxs(n.Fragment,{children:[v.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})})}E.propTypes={elements:o.shape({brand:o.element,navigation:o.element,socialMedia:o.element,copyright:o.element,links:o.element}).isRequired,data:o.object.isRequired};const le=k("div")`
257
+ padding: 24px 0;
258
+ .plain-layout-container {
259
+ display: flex;
260
+ justify-content: space-between;
261
+ align-items: center;
262
+ flex-wrap: wrap;
263
+ gap: 8px;
264
+ }
265
+ `,F=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:E},{name:"standard",support:()=>!0,component:D}],ae=F.reduce((e,t)=>({...e,[t.name]:t}),{});function S({...e}){const{brand:t=null,navigation:i=null,socialMedia:p=null,copyright:c=null,links:d=null,layout:x="auto",...g}=e,b=()=>t?n.jsx(z,{...t}):null,u=()=>i?.length?n.jsx(M,{links:i,columns:3}):null,w=()=>p?.length?n.jsx(R,{items:p}):null,a=()=>{const r=c?.owner||t?.name;return r?n.jsx(O,{owner:r,year:c?.year||void 0}):null},s=()=>d?.length?n.jsx(M,{flowLayout:!0,links:d}):null,l={brand:b(),navigation:u(),socialMedia:w(),copyright:a(),links:s()};let m=null;if(x==="auto"?m=F.find(r=>r.support(l,e)).component:m=ae[x]?.component,!m)throw new Error(`layout ${x} is not supported.`);return n.jsxs(f,{...g,className:y("blocklet__footer",g.className),sx:[{position:"relative"},...Array.isArray(g.sx)?g.sx:[g.sx]],children:[n.jsx(m,{elements:l,data:e}),n.jsx(f,{sx:{position:"absolute",right:16,bottom:0,fontSize:12,color:"transparent","::selection":{background:"#000",color:"#fff"}},children:window?.blocklet?.version})]})}S.propTypes={brand:o.shape({name:o.node,description:o.string,logo:o.node}),navigation:o.arrayOf(o.shape({label:o.node,link:o.string})),socialMedia:o.arrayOf(o.shape({icon:o.node,link:o.string})),copyright:o.shape({owner:o.string,year:o.oneOfType([o.string,o.number])}),links:o.arrayOf(o.shape({label:o.node,link:o.string})),layout:o.oneOf(["auto","standard","plain"])};function q({meta:e={},theme:t=null,...i}){const{locale:p}=L()||{},c=_(),d=v.useMemo(()=>{const r=Object.assign({},window.blocklet,e);try{return J(r)}catch(h){return console.error("Failed to format blocklet info",h,r),r}},[e]),x=v.useMemo(()=>A(c,t),[c,t]),g=U({key:"xs",meta:e,theme:t});if(!d.appName)return null;const{appName:b,appDescription:u,description:w,copyright:a}=d,s=x.palette.background.default,l={footerNav:N(d?.navigation?.footer,p)||[],socialMedia:N(d?.navigation?.social,p)||[],links:N(d?.navigation?.bottom,p)||[]},m={brand:{name:b,description:u||w,logo:g},navigation:G(l.footerNav,r=>({...r,label:r.title,link:r.link}),"items"),copyright:a,socialMedia:l.socialMedia,links:l.links.map(r=>({...r,label:r.title}))};return n.jsx(W,{theme:x,children:n.jsx(pe,{...m,...Q(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:Y,theme:o.object};const pe=k(S)`
266
+ ${({$bordered:e,theme:t})=>`border-top: 1px solid ${e&&t.palette.divider};`}
267
+ color: ${({theme:e})=>e.palette.text.secondary};
268
+ ${({$bgcolor:e})=>e&&`background-color: ${e};`}
269
+ `,he=B(X(q),{FallbackComponent:Z});export{he as Z};