@abtnode/blocklet-services 1.16.49-beta-20250819-084933-3bcbd851 → 1.16.49-beta-20250821-102221-1b7283d6

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 (244) hide show
  1. package/api/libs/connect/session.js +4 -4
  2. package/api/services/analytics/index.js +8 -5
  3. package/api/services/auth/connect/connect-to-did-spaces-for-user.js +5 -5
  4. package/api/services/auth/connect/migrate-app-to-struct-v2.js +1 -1
  5. package/api/state/profile.js +1 -1
  6. package/api/util/blocklet-utils.js +2 -2
  7. package/dist/assets/{AdapterDayjs-DQyL5DVQ.js → AdapterDayjs-VDBijwaM.js} +1 -1
  8. package/dist/assets/{Google-C3EYOLRU.js → Google-Sm1AunGv.js} +1 -1
  9. package/dist/assets/{access-control-CuUB1GoU.js → access-control-CKo7ApzQ.js} +1 -1
  10. package/dist/assets/{actions-DnpJX6lQ.js → actions-Bf4UKTeu.js} +1 -1
  11. package/dist/assets/{add-component-core-JXDWXmkX.js → add-component-core-2s4YrHkE.js} +7 -7
  12. package/dist/assets/add-resource-B5ESeEdz.js +1 -0
  13. package/dist/assets/{addon-D99FdIJX.js → addon-Cbd_t8fg.js} +1 -1
  14. package/dist/assets/{advanced-CGlqr3Vl.js → advanced-Bgj7amLL.js} +2 -2
  15. package/dist/assets/{aigne-DceTN7Rt.js → aigne-D5HIKgzm.js} +1 -1
  16. package/dist/assets/api-IUmhrtIY.js +1 -0
  17. package/dist/assets/{appearance-fnwZybsp.js → appearance-_Bk4EnMK.js} +1 -1
  18. package/dist/assets/{ar-B5ZCU4Ws.js → ar-BvKie2ZN.js} +1 -1
  19. package/dist/assets/{arrow-down.svg-BcoTeNyX.js → arrow-down.svg-DaFWY5aq.js} +1 -1
  20. package/dist/assets/{audit-logs-Dzq32Y_L.js → audit-logs-Bh4pY_tu.js} +2 -2
  21. package/dist/assets/authorize--3SKB1wC.js +1 -0
  22. package/dist/assets/{base-chart-CBzZ3RX9.js → base-chart-DZz4r8-E.js} +1 -1
  23. package/dist/assets/base32-BkgeFkJa.js +1 -0
  24. package/dist/assets/bind-account-CoQBu2J9.js +1 -0
  25. package/dist/assets/branding-7dpJRuU0.js +1 -0
  26. package/dist/assets/{branding-g04aJopG.js → branding-CuAzEVpH.js} +2 -2
  27. package/dist/assets/{branding-BgclUoWJ.js → branding-Spk8WElf.js} +5 -5
  28. package/dist/assets/{bundle-avatar-VT8FLC3N.js → bundle-avatar-CopjjSKq.js} +1 -1
  29. package/dist/assets/button-DEDR-8Tu.js +1 -0
  30. package/dist/assets/{click-to-copy-LMYjlbUz.js → click-to-copy-CVpUD4ji.js} +1 -1
  31. package/dist/assets/{cloneDeep-KmDjD-jP.js → cloneDeep-DqaMBldf.js} +1 -1
  32. package/dist/assets/{collapse-XWrflTSv.js → collapse-C-BNkgS6.js} +1 -1
  33. package/dist/assets/{complete-BnL-RLHX.js → complete-BJT8H_Qd.js} +2 -2
  34. package/dist/assets/{component-B20Ffd5t.js → component-Ds8koLEG.js} +3 -3
  35. package/dist/assets/{config-BV0yp1Ym.js → config-CPOsDUsI.js} +1 -1
  36. package/dist/assets/{config-DRsQLuMp.js → config-DE3v72_z.js} +3 -3
  37. package/dist/assets/{config-CJHA8pSh.js → config-_-5NHvON.js} +2 -2
  38. package/dist/assets/{config-navigation-CR3DV4xf.js → config-navigation-C-4ZP-lf.js} +11 -11
  39. package/dist/assets/{config-space-BzTYceTE.js → config-space-CtK2sF5f.js} +1 -1
  40. package/dist/assets/confirm-Bax75YdO.js +7 -0
  41. package/dist/assets/{connect-BaSUwW0G.js → connect-Csks8pFO.js} +1 -1
  42. package/dist/assets/{connect-Dvl9nMFJ.js → connect-DY6itK40.js} +1 -1
  43. package/dist/assets/connect-to-DBq3ktB8.js +1 -0
  44. package/dist/assets/{content-layout-yAb710pQ.js → content-layout-DoBqUAz1.js} +1 -1
  45. package/dist/assets/createClass-D9kGlylC.js +1 -0
  46. package/dist/assets/{dashboard-CuNuXf3l.js → dashboard-CbwKTvVC.js} +6 -6
  47. package/dist/assets/{de-Bt2QRaGQ.js → de-C9BQPFcm.js} +1 -1
  48. package/dist/assets/{delete-confirm-DTjAa9xG.js → delete-confirm-Db0zAWAY.js} +1 -1
  49. package/dist/assets/{did-address-CY4nLJqm.js → did-address-CcsL3-Qm.js} +1 -1
  50. package/dist/assets/{domain-C8-oT2Wp.js → domain-CHD8k2pC.js} +1 -1
  51. package/dist/assets/domain-action-card-DtOm7RPt.js +28 -0
  52. package/dist/assets/domains-CePn01LF.js +1 -0
  53. package/dist/assets/{email-BXcDoVMA.js → email-B1F9_dDw.js} +3 -3
  54. package/dist/assets/{empty-spinner-CvzdEO93.js → empty-spinner-BMVhld2Z.js} +1 -1
  55. package/dist/assets/engine-UogTYMtu.js +1 -0
  56. package/dist/assets/{es-RcHRYKIM.js → es-DPjcV6cX.js} +1 -1
  57. package/dist/assets/{exchange-passport-BJ2cvp1M.js → exchange-passport-B90C9g4T.js} +1 -1
  58. package/dist/assets/{form-Df41zlMi.js → form-o2cQtSfF.js} +2 -2
  59. package/dist/assets/{form-text-input-DHhw6HI1.js → form-text-input-DJPCEDjA.js} +1 -1
  60. package/dist/assets/{form-wrapper-DihET07L.js → form-wrapper-CHYdE4By.js} +1 -1
  61. package/dist/assets/{fr-CQKeqjRX.js → fr-ButkVdgL.js} +1 -1
  62. package/dist/assets/{fuel-D_lR2dCI.js → fuel-mxa8OZsa.js} +1 -1
  63. package/dist/assets/gen-access-key-BgQp83Fx.js +1 -0
  64. package/dist/assets/gen-simple-access-key-DbEHuHKs.js +1 -0
  65. package/dist/assets/get-safe-url-BNFAIq84.js +1 -0
  66. package/dist/assets/hdkey-Dszfv2Lm.js +62 -0
  67. package/dist/assets/hi-CLqQ4LHH.js +5 -0
  68. package/dist/assets/{home-YcebrtVr.js → home-C03NbY1T.js} +1 -1
  69. package/dist/assets/{id-B2v2gNB3.js → id-B6zyYCjr.js} +1 -1
  70. package/dist/assets/iframe-CZx2enRR.js +1 -0
  71. package/dist/assets/{index-Pzk7QDI_.js → index-B2R6qrmp.js} +1 -1
  72. package/dist/assets/index-B5ss4uTe.js +271 -0
  73. package/dist/assets/index-BF7bSwjJ.js +1022 -0
  74. package/dist/assets/{index-I45i29I1.js → index-BFQdM_lT.js} +1 -1
  75. package/dist/assets/{index-C2CNlq3a.js → index-BIfpX-Mq.js} +1 -1
  76. package/dist/assets/index-BUlqbV5J.js +124 -0
  77. package/dist/assets/index-BhhsbfbV.js +1 -0
  78. package/dist/assets/{index-BbOvyzfE.js → index-BtkFo6d6.js} +1 -1
  79. package/dist/assets/{index-CV12n3b0.js → index-Bzij4iIk.js} +1 -1
  80. package/dist/assets/{index-DYgvuymH.js → index-C-DpXzH8.js} +1 -1
  81. package/dist/assets/{index-BusluHY3.js → index-CJubEPJw.js} +12 -12
  82. package/dist/assets/{index-Bx4IaUHc.js → index-CLmp-nsJ.js} +6 -6
  83. package/dist/assets/index-CZjtHtZ4.js +1 -0
  84. package/dist/assets/{index-D4wH7CER.js → index-CcHUYWYZ.js} +6 -6
  85. package/dist/assets/{index-Q_U4JZ73.js → index-CqAqyoyD.js} +1 -1
  86. package/dist/assets/index-CrDQcn26.js +6 -0
  87. package/dist/assets/index-D9F9PzFc.js +113 -0
  88. package/dist/assets/{index-yRvJst1p.js → index-DGpFay7j.js} +10 -10
  89. package/dist/assets/{index-DeQPqRmy.js → index-DKALSagn.js} +2 -2
  90. package/dist/assets/{index-CX5AEYFR.js → index-DO8dY30H.js} +1 -1
  91. package/dist/assets/index-DQ5bllFt.js +55 -0
  92. package/dist/assets/index-DQmcrxe_.js +1 -0
  93. package/dist/assets/{index-DHaiY3PI.js → index-DT3k66ox.js} +1 -1
  94. package/dist/assets/index-D_t0hM3n.js +30 -0
  95. package/dist/assets/{index-DQ3_Wuxe.js → index-DnMPdyj-.js} +1 -1
  96. package/dist/assets/{index-Bv7qQ-8a.js → index-MgFhlLet.js} +1 -1
  97. package/dist/assets/{index-DtDUB9t6.js → index-R8yzPJ8-.js} +1 -1
  98. package/dist/assets/{index-COzISRvj.js → index-TDbD3rO2.js} +9 -9
  99. package/dist/assets/index-_fIzCi4b.js +7 -0
  100. package/dist/assets/{index-BNm1HXpF.js → index-wKz_l66R.js} +11 -11
  101. package/dist/assets/{invitation-Cic0zA9s.js → invitation-Py8TsLWL.js} +3 -3
  102. package/dist/assets/{invite-EVcEzrIF.js → invite-CrcJXNQ_.js} +1 -1
  103. package/dist/assets/{isURL-BZcSl4qG.js → isURL-CH4qUEqk.js} +2 -2
  104. package/dist/assets/{issue-passport-B3O3mNxG.js → issue-passport-BrCzpb_k.js} +1 -1
  105. package/dist/assets/{item-BJ_EimT6.js → item-pMF7ItdE.js} +1 -1
  106. package/dist/assets/{ja-BweNHYYv.js → ja-5mnOXG6B.js} +1 -1
  107. package/dist/assets/{ko-BrUV9qyv.js → ko-Msmkvh9O.js} +1 -1
  108. package/dist/assets/landing-page-tr6cY26r.js +1 -0
  109. package/dist/assets/{launch-result-message-CFuQ3Maq.js → launch-result-message-BhJWVXUs.js} +1 -1
  110. package/dist/assets/{layout-DTue3JyF.js → layout-BTWkyZIA.js} +1 -1
  111. package/dist/assets/list-D9c57rY9.js +4 -0
  112. package/dist/assets/{list-header-bAafK8zK.js → list-header-BQx81X9X.js} +1 -1
  113. package/dist/assets/list-u8QyXkOA.js +103 -0
  114. package/dist/assets/localization-DiI2Nbuc.js +1 -0
  115. package/dist/assets/{log-DiR01oV7.js → log-atnf1Umh.js} +1 -1
  116. package/dist/assets/logger-yrkSQn8c.js +1 -0
  117. package/dist/assets/login-CKylUR0F.js +1 -0
  118. package/dist/assets/{login-oauth-callback-D2Bc3xAH.js → login-oauth-callback-5DVKz_Jh.js} +1 -1
  119. package/dist/assets/{logo-uploader-BayOewpo.js → logo-uploader-DbxANvEK.js} +2 -2
  120. package/dist/assets/{lost-passport-flvvhlNS.js → lost-passport-pzKFXIgF.js} +2 -2
  121. package/dist/assets/{observability-DUV9CYIA.js → observability-F2NkCkza.js} +1 -1
  122. package/dist/assets/{omit-DdJriebF.js → omit-BM-5z5qE.js} +1 -1
  123. package/dist/assets/{open-window-Cj2XU2ZE.js → open-window-DM0S-jzk.js} +1 -1
  124. package/dist/assets/{over-due-invoice-payment-DveCusKe.js → over-due-invoice-payment-CvZTMHvs.js} +1 -1
  125. package/dist/assets/{overview-BCygf-5_.js → overview-phdRvAI_.js} +2 -2
  126. package/dist/assets/{page-header-BtdOLX8d.js → page-header-CSMnIoYZ.js} +1 -1
  127. package/dist/assets/passport-item-Ml3CykE7.js +1 -0
  128. package/dist/assets/{permission-BPBzp1tm.js → permission-D9Anejwj.js} +1 -1
  129. package/dist/assets/{playground-Doy13-fN.js → playground-CTvnZW2L.js} +1 -1
  130. package/dist/assets/preferences-DClQtBed.js +1 -0
  131. package/dist/assets/profile-embed-CIuOCLMD.js +1 -0
  132. package/dist/assets/pt-D1bjCfHu.js +5 -0
  133. package/dist/assets/publish-resource-DrVZkMgt.js +1 -0
  134. package/dist/assets/{react-beautiful-dnd.esm-DR1a-vn2.js → react-beautiful-dnd.esm-CYy644iX.js} +1 -1
  135. package/dist/assets/{react-stripe.esm-DJ2wjb7C.js → react-stripe.esm-CLg1-THR.js} +1 -1
  136. package/dist/assets/{required-2qxcR9JF.js → required-CobBjKC9.js} +1 -1
  137. package/dist/assets/ru-DcnfcUY4.js +5 -0
  138. package/dist/assets/runtime-BfAbZoi3.js +1 -0
  139. package/dist/assets/{sanitize-t-NsAK4g.js → sanitize-NVxeYIWy.js} +1 -1
  140. package/dist/assets/sdk-DkOKBbdA.js +1 -0
  141. package/dist/assets/{section-D4T7FV6C.js → section-Dq8SB7lh.js} +1 -1
  142. package/dist/assets/{security-BAcM8QUq.js → security-DulYEnHf.js} +3 -3
  143. package/dist/assets/session-COCrt-qG.js +1 -0
  144. package/dist/assets/{setup-Cs_D4O1K.js → setup-CHgFauXU.js} +1 -1
  145. package/dist/assets/{shorten-label-BfHH-3ih.js → shorten-label-BHlFrl9P.js} +1 -1
  146. package/dist/assets/{simple-select-DIgPQFb4.js → simple-select-rm53gQ69.js} +1 -1
  147. package/dist/assets/{spaces-CU7Gi53i.js → spaces-CvL1Uwkd.js} +1 -1
  148. package/dist/assets/{start-Ds4Of13F.js → start-BhGEcDw9.js} +1 -1
  149. package/dist/assets/{starting-progress-BTMrLOch.js → starting-progress-mgdXXqlr.js} +1 -1
  150. package/dist/assets/status-v5BitGK5.js +1 -0
  151. package/dist/assets/{step-actions-DDyCXELh.js → step-actions-C48J0mE1.js} +1 -1
  152. package/dist/assets/{studio-CYLOXolI.js → studio-iYVCEWav.js} +1 -1
  153. package/dist/assets/{switch-control-CAUrltdD.js → switch-control-BR8H_fdm.js} +1 -1
  154. package/dist/assets/{table-tips-BNjmTVFL.js → table-tips-BP283GGZ.js} +1 -1
  155. package/dist/assets/team-BVaQVRGX.js +146 -0
  156. package/dist/assets/th-C2mNGstJ.js +5 -0
  157. package/dist/assets/traffic-CMbIGtyi.js +1 -0
  158. package/dist/assets/{transfer-2ba_g--R.js → transfer-WHnS-w5n.js} +1 -1
  159. package/dist/assets/{unsubscribe-B0KWDak0.js → unsubscribe-flFhRa0X.js} +1 -1
  160. package/dist/assets/{use-app-logo-pyV6ZPrc.js → use-app-logo-Cb6MS9by.js} +1 -1
  161. package/dist/assets/{use-mobile-BcHeqFSk.js → use-mobile-C_DcJ5SZ.js} +1 -1
  162. package/dist/assets/{use-mobile-BmKySh5X.js → use-mobile-DM4d_PLd.js} +1 -1
  163. package/dist/assets/{use-server-logo-CFQEMdB-.js → use-server-logo-Cxah39TH.js} +1 -1
  164. package/dist/assets/{use-window-close-PwuafSt8.js → use-window-close-DpgRKaaP.js} +1 -1
  165. package/dist/assets/{useAsync-BrjQTmBf.js → useAsync-BrMo9m7W.js} +1 -1
  166. package/dist/assets/{useAsync-C0iFIKqR.js → useAsync-CsYRBczg.js} +1 -1
  167. package/dist/assets/{useAsyncRetry-BmdG-NgH.js → useAsyncRetry-D4-sRZN-.js} +1 -1
  168. package/dist/assets/useLocalStorage-DqhgzGNT.js +1 -0
  169. package/dist/assets/user-center-BrV7Sqsj.js +126 -0
  170. package/dist/assets/user-sessions-DMHiVE2_.js +1 -0
  171. package/dist/assets/{util-BW0qhGTg.js → util-CU3dCXzc.js} +1 -1
  172. package/dist/assets/{util-Dceeaiqy.js → util-CmTchaCE.js} +1 -1
  173. package/dist/assets/{vendor-arcblock-D_Dm09bZ.js → vendor-arcblock-B7AoUs4o.js} +139 -138
  174. package/dist/assets/{vendor-hooks-9cd36rYd.js → vendor-hooks-BRXKH6Nb.js} +1 -1
  175. package/dist/assets/{vendor-mui-core-DV92LEhm.js → vendor-mui-core-B7zoO8f5.js} +1 -1
  176. package/dist/assets/{vendor-mui-x-8McV6Pkb.js → vendor-mui-x-Qph0dQcg.js} +1 -1
  177. package/dist/assets/vendor-utils-DtY42AM-.js +213 -0
  178. package/dist/assets/{vendor-ux-C9Q7otQi.js → vendor-ux-B7q8W4Pg.js} +11 -11
  179. package/dist/assets/vi-C4AydA45.js +5 -0
  180. package/dist/assets/{wait-connect-CZLL86-A.js → wait-connect-bu1NVn-9.js} +1 -1
  181. package/dist/assets/{wizard-B45wL4-0.js → wizard-E9dqLz0c.js} +1 -1
  182. package/dist/assets/{wizard-components-DtebwiYw.js → wizard-components-DRUX-bqp.js} +3 -3
  183. package/dist/assets/wrap-locale-C1S0zrtd.js +1 -0
  184. package/dist/assets/{zh-BaEjqGHy.js → zh-BG6k4eXG.js} +2 -2
  185. package/dist/assets/{zh-DBSThusI.js → zh-CwK2Wb9a.js} +1 -1
  186. package/dist/assets/{zh-tw-xcyHbP3V.js → zh-tw-6SDy5fyY.js} +2 -2
  187. package/dist/index.html +6 -6
  188. package/dist/service-worker.js +1 -1
  189. package/package.json +33 -33
  190. package/dist/assets/add-resource-DfcJCfFx.js +0 -1
  191. package/dist/assets/api-ZbpPN5Q9.js +0 -1
  192. package/dist/assets/authorize-Cp-IEkvY.js +0 -1
  193. package/dist/assets/base32-rvunYmjt.js +0 -1
  194. package/dist/assets/bind-account-DWpWB9oY.js +0 -1
  195. package/dist/assets/branding-C1Ia1UuG.js +0 -1
  196. package/dist/assets/button-DTxgdpBB.js +0 -1
  197. package/dist/assets/confirm-DTV46cI2.js +0 -7
  198. package/dist/assets/connect-to-DqRnkSJR.js +0 -1
  199. package/dist/assets/createClass-BMZZ4tvt.js +0 -1
  200. package/dist/assets/domain-action-card-CEOtRquC.js +0 -28
  201. package/dist/assets/domains-UcvU4SNI.js +0 -1
  202. package/dist/assets/engine-D80vWtQO.js +0 -1
  203. package/dist/assets/gen-access-key-CceVm9CK.js +0 -1
  204. package/dist/assets/gen-simple-access-key-DBtfSm_M.js +0 -1
  205. package/dist/assets/get-safe-url-C-ga6boD.js +0 -1
  206. package/dist/assets/hi-C3FQ6j4Z.js +0 -5
  207. package/dist/assets/iframe-yWzH7Y70.js +0 -1
  208. package/dist/assets/index-9RuhtmiE.js +0 -7
  209. package/dist/assets/index-B8oq6zxb.js +0 -1
  210. package/dist/assets/index-BPLFlpyZ.js +0 -1
  211. package/dist/assets/index-Bpx_SHfH.js +0 -124
  212. package/dist/assets/index-BwWh6qt0.js +0 -113
  213. package/dist/assets/index-CBuBVmWe.js +0 -1020
  214. package/dist/assets/index-CJ69vsWG.js +0 -271
  215. package/dist/assets/index-DMpO3u1o.js +0 -29
  216. package/dist/assets/index-DTwsbX7O.js +0 -55
  217. package/dist/assets/index-Dib9OV0s.js +0 -6
  218. package/dist/assets/index-GUfN0pBe.js +0 -62
  219. package/dist/assets/index-OkiS9ggb.js +0 -1
  220. package/dist/assets/landing-page-CEwZuo6C.js +0 -1
  221. package/dist/assets/list-DFvUHI6u.js +0 -103
  222. package/dist/assets/list-DKV7bt8d.js +0 -2
  223. package/dist/assets/localization-BAcpaWtp.js +0 -1
  224. package/dist/assets/logger-__gJZTBC.js +0 -1
  225. package/dist/assets/login-DcV8dmSg.js +0 -1
  226. package/dist/assets/passport-item-Bej8KfmX.js +0 -1
  227. package/dist/assets/preferences-f1ltD9jG.js +0 -1
  228. package/dist/assets/profile-embed-DKKNp824.js +0 -1
  229. package/dist/assets/pt-DopXhOk4.js +0 -5
  230. package/dist/assets/publish-resource-Ce_uMtZk.js +0 -1
  231. package/dist/assets/ru-pXOMfITZ.js +0 -5
  232. package/dist/assets/runtime-EaR7CQWh.js +0 -1
  233. package/dist/assets/sdk-D0Pm334j.js +0 -1
  234. package/dist/assets/session-DW40g2df.js +0 -1
  235. package/dist/assets/status-D4MGFqcv.js +0 -1
  236. package/dist/assets/team-C8yfeoct.js +0 -146
  237. package/dist/assets/th-Dt7avnjd.js +0 -5
  238. package/dist/assets/traffic-BjVQYor-.js +0 -1
  239. package/dist/assets/useLocalStorage-BRaJWH_j.js +0 -1
  240. package/dist/assets/user-center-V4qQZYhM.js +0 -126
  241. package/dist/assets/user-sessions-DYh09QrL.js +0 -1
  242. package/dist/assets/vendor-utils-CddrUZ58.js +0 -213
  243. package/dist/assets/vi-BbB_zl6_.js +0 -5
  244. package/dist/assets/wrap-locale-FkxlVw29.js +0 -1
@@ -1,4 +1,4 @@
1
- import{W as o,j as n,ak as f,f as y,bf as I,av as j,D as S}from"./vendor-mui-core-DV92LEhm.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,a1 as A,T as B,m as L,D as W}from"./vendor-ux-C9Q7otQi.js";import{aQ as H,a_ as Y,a$ as C,k as Z,b0 as Q,b1 as V,b2 as G,ai as J,b3 as N,b4 as K}from"./index-CBuBVmWe.js";import{Y as P,I as U,Z as X}from"./vendor-utils-CddrUZ58.js";import{a as ee}from"./vendor-hooks-9cd36rYd.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")`
1
+ import{W as o,j as n,ak as f,f as y,bf as S,av as j,D as _}from"./vendor-mui-core-B7zoO8f5.js";import{r as v}from"./vendor-react-Dvs43sk9.js";import{l as k,aj as A,T as B,y as L,a6 as W}from"./vendor-ux-B7q8W4Pg.js";import{aT as H,b1 as Y,b2 as C,k as Z,b3 as V,b4 as G,b5 as J,aj as K,b6 as N,b7 as P}from"./index-BF7bSwjJ.js";import{Y as Q,I as U,Z as X}from"./vendor-utils-DtY42AM-.js";import{a as ee}from"./vendor-hooks-BRXKH6Nb.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
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;
@@ -45,7 +45,7 @@ import{W as o,j as n,ak as f,f as y,bf as I,av as j,D as S}from"./vendor-mui-cor
45
45
  }
46
46
  }
47
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&&P(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&&U(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?Y(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")`
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&&Q(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&&U(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?Y(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(S,{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
49
  overflow: hidden;
50
50
  color: ${({theme:e})=>e.palette.text.secondary};
51
51
  .footer-links-inner {
@@ -211,7 +211,7 @@ import{W as o,j as n,ak as f,f as y,bf as I,av as j,D as S}from"./vendor-mui-cor
211
211
  ${e=>e.theme.breakpoints.down("md")} {
212
212
  gap: 12px;
213
213
  }
214
- `;function D({owner:e="ArcBlock",year:t=`${new Date().getFullYear()}`,...i}){return n.jsxs(ie,{...i,children:["Copyright © ",t," ",e]})}D.propTypes={owner:o.string,year:o.string};const ie=k("p")`
214
+ `;function R({owner:e="ArcBlock",year:t=`${new Date().getFullYear()}`,...i}){return n.jsxs(ie,{...i,children:["Copyright © ",t," ",e]})}R.propTypes={owner:o.string,year:o.string};const ie=k("p")`
215
215
  display: flex;
216
216
  align-items: center;
217
217
  margin: 0;
@@ -237,7 +237,7 @@ import{W as o,j as n,ak as f,f as y,bf as I,av as j,D as S}from"./vendor-mui-cor
237
237
  margin: 0 auto;
238
238
  }
239
239
  }
240
- `;function R({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]})})]})})}R.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
+ `;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")`
241
241
  padding: 32px 0 24px 0;
242
242
  .footer-brand-name,
243
243
  .footer-brand-desc {
@@ -263,8 +263,8 @@ import{W as o,j as n,ak as f,f as y,bf as I,av as j,D as S}from"./vendor-mui-cor
263
263
  flex-wrap: wrap;
264
264
  gap: 8px;
265
265
  }
266
- `,F=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:E},{name:"standard",support:()=>!0,component:R}],ae=F.reduce((e,t)=>({...e,[t.name]:t}),{});function _({...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(O,{items:p}):null,a=()=>{const r=c?.owner||t?.name;return r?n.jsx(D,{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})]})}_.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={},...i}){const{locale:p}=B()||{},c=S(),d=v.useMemo(()=>{const r=Object.assign({},window.blocklet,e);try{return G(r)}catch(h){return console.error("Failed to format blocklet info",h,r),r}},[e]),x=v.useMemo(()=>L(c,t),[c,t]),g=J({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:K(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,...X(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:V,theme:o.object};const pe=k(_)`
266
+ `,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 q({...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(O,{items:p}):null,a=()=>{const r=c?.owner||t?.name;return r?n.jsx(R,{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})]})}q.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 I({meta:e={},theme:t={},...i}){const{locale:p}=B()||{},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(()=>L(c,t),[c,t]),g=K({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:P(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,...X(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}I.propTypes={meta:G,theme:o.object};const pe=k(q)`
267
267
  ${({$bordered:e,theme:t})=>`border-top: 1px solid ${e&&t.palette.divider};`}
268
268
  color: ${({theme:e})=>e.palette.text.secondary};
269
269
  ${({$bgcolor:e})=>e&&`background-color: ${e};`}
270
- `,he=A(Q(q),{FallbackComponent:Z});export{he as Z};
270
+ `,he=A(V(I),{FallbackComponent:Z});export{he as Z};
@@ -0,0 +1 @@
1
+ import{j as t,at as r}from"./vendor-mui-core-B7zoO8f5.js";import{r as s}from"./vendor-react-Dvs43sk9.js";import{G as a}from"./vendor-ux-B7q8W4Pg.js";import{t as n}from"./index-BF7bSwjJ.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.js";function l(){const{t:o}=s.useContext(a);return t.jsx(i,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const i=r.main``;export{l as default};
@@ -1,4 +1,4 @@
1
- import{r as b}from"./vendor-react-Dvs43sk9.js";import{j as e,y as V,x as X,bb as G,M as Q,ak as d,W as u,a6 as ke,cf as ve,b1 as Y,z as U,b6 as we,a5 as Te,at as P,T as N,cg as Ae,c9 as Ke,aX as Re}from"./vendor-mui-core-DV92LEhm.js";import{T as D,C as B,n as F,c as De,b as ie,k as H,H as Se,Z as Ie,o as Be,a0 as $e,L as Ee,I as Ne}from"./vendor-ux-C9Q7otQi.js";import{f as _e}from"./index-DBs9Ljax.js";import{B as ae,a as re,l as ce}from"./index-CX5AEYFR.js";import{a as le}from"./passport-item-Bej8KfmX.js";import{c as W,Y as I,p as Pe,aB as Le,a7 as We,f as ze}from"./index-CBuBVmWe.js";import{u as L}from"./team-C8yfeoct.js";import{T as de}from"./index-Bv7qQ-8a.js";import{C as pe}from"./confirm-DTV46cI2.js";import{R as qe,C as _}from"./vendor-utils-CddrUZ58.js";import{u as Me}from"./session-DW40g2df.js";import{C as O}from"./click-to-copy-LMYjlbUz.js";import{f as Ue}from"./index-BojVbZw0.js";import{D as Fe}from"./delete-confirm-DTjAa9xG.js";import{P as He}from"./permission-BPBzp1tm.js";import{l as z}from"./vendor-arcblock-D_Dm09bZ.js";import{B as Oe}from"./bundle-avatar-VT8FLC3N.js";import{W as Ve}from"./did-address-CY4nLJqm.js";import{A as Xe}from"./actions-DnpJX6lQ.js";import{u as Ge}from"./use-mobile-BcHeqFSk.js";import{T as oe}from"./table-tips-BNjmTVFL.js";import{q as Qe}from"./vendor-hooks-9cd36rYd.js";import"./lottie-web-4koyQiv_.js";import"./util-Dceeaiqy.js";import"./base32-rvunYmjt.js";import"./isURL-BZcSl4qG.js";import"./use-app-logo-pyV6ZPrc.js";import"./arrow-down.svg-BcoTeNyX.js";import"./vendor-mui-x-8McV6Pkb.js";import"./AdapterDayjs-DQyL5DVQ.js";function Z({value:s}){const{t,locale:n}=D(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}Z.propTypes={value:u.string.isRequired};function J({value:s,onChange:t,...n}){const{t:i}=D(),o=b.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(V,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(X,{children:i("setting.accessKey.authType")}),e.jsx(G,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),children:o.map(c=>e.jsx(Q,{value:c.value,children:e.jsxs(d,{children:[e.jsx("span",{children:c.title}),e.jsx(d,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:c.description})]})},c.value))})]})}J.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const ee=()=>{const s=W.RBAC_CONFIG.roles.filter(o=>o.passport),{inService:t}=I(),{roles:n}=L(),i=[...s,...t?n:[]];return qe(i,"name").filter(o=>o.name!==W.ROLES.OWNER)};function me(){const{session:s}=Me(),t=ee();return b.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(c=>c.name==="guest");return[...t.filter(c=>c.name!=="guest").filter(c=>s.user.passports.find(g=>g.role===c.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ue({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=L(),{t:o}=D(),[c,g]=b.useState(!1),[x,v]=b.useState(null),p=me(),K=()=>{g(!1),v(null)},h=async l=>{const{remark:C,passport:y,authType:a}=l;g(!0);const w=await n.createAccessKey({input:{teamDid:i,remark:C.trim(),passport:y,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:a}}),{data:R}=w;s(R),v(null),g(!1)},m={title:`${o("common.create")} ${o("accessKey")}`,description:(l,C,y)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(U,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:a=>{C({...l,remark:a.target.value,__disableConfirm:!l.passport||!a.target.value.trim()}),a.target.value.trim()?y(""):y(o("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:o("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:a=>{const w=a.target.value;y(null),C({...l,passport:w,__disableConfirm:!l.remark||!w})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:c,children:p.map(a=>e.jsx(Q,{value:a.name,"data-cy":`create-access-key-passport-option-${a.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:a.title||a.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:a.description})]})},a.name))})]}),e.jsx(J,{value:l.authType,onChange:a=>{C({...l,authType:a.target.value})}}),e.jsx(de,{placeholder:o("setting.accessKey.expireTime"),value:l.expireAt,onChange:a=>{C({...l,expireAt:a,__disableConfirm:!l.passport||!l.remark||!a})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:h,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(m),className:"rule-action",children:[c?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),o("common.create")]}),x&&e.jsx(pe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}ue.propTypes={remark:u.string,onCreate:u.func};function xe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:o}=b.useContext(De),[c,g]=b.useState(!1),[x,v]=b.useState(()=>i),p=I(),K=()=>{v(!x)},h=y=>{g(y.target.checked)},m=_(window.location.origin,p?.info?.routing?.adminPath),l=b.useMemo(()=>i?`const Client = require('@abtnode/client');
1
+ import{r as b}from"./vendor-react-Dvs43sk9.js";import{j as e,y as V,x as G,bb as X,M as Q,ak as d,W as u,a6 as ke,ck as ve,b1 as Z,z as U,b6 as we,a5 as Te,at as P,T as N,cl as Ae,c9 as Ke,aX as Re}from"./vendor-mui-core-B7zoO8f5.js";import{T as D,a5 as B,D as F,G as De,F as ie,N as H,H as Se,ah as Ie,C as Be,ai as $e,ab as Ee,a9 as Ne}from"./vendor-ux-B7q8W4Pg.js";import{f as _e}from"./index-DBs9Ljax.js";import{B as ae,a as re,l as ce}from"./index-DO8dY30H.js";import{r as le}from"./passport-item-Ml3CykE7.js";import{c as L,Z as I,p as Pe,aE as We,a8 as Le,K as z,f as ze}from"./index-BF7bSwjJ.js";import{u as W}from"./team-BVaQVRGX.js";import{T as de}from"./index-MgFhlLet.js";import{C as pe}from"./confirm-Bax75YdO.js";import{R as qe,C as _}from"./vendor-utils-DtY42AM-.js";import{u as Me}from"./session-COCrt-qG.js";import{C as O}from"./click-to-copy-CVpUD4ji.js";import{f as Ue}from"./index-BojVbZw0.js";import{D as Fe}from"./delete-confirm-Db0zAWAY.js";import{P as He}from"./permission-D9Anejwj.js";import{B as Oe}from"./bundle-avatar-CopjjSKq.js";import{W as Ve}from"./did-address-CcsL3-Qm.js";import{A as Ge}from"./actions-Bf4UKTeu.js";import{u as Xe}from"./use-mobile-C_DcJ5SZ.js";import{T as oe}from"./table-tips-BP283GGZ.js";import{q as Qe}from"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./util-CmTchaCE.js";import"./base32-BkgeFkJa.js";import"./vendor-arcblock-B7AoUs4o.js";import"./isURL-CH4qUEqk.js";import"./use-app-logo-Cb6MS9by.js";import"./arrow-down.svg-DaFWY5aq.js";import"./vendor-mui-x-Qph0dQcg.js";import"./AdapterDayjs-VDBijwaM.js";function J({value:s}){const{t,locale:n}=D(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}J.propTypes={value:u.string.isRequired};function Y({value:s,onChange:t,...n}){const{t:i}=D(),o=b.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(V,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(X,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),children:o.map(c=>e.jsx(Q,{value:c.value,children:e.jsxs(d,{children:[e.jsx("span",{children:c.title}),e.jsx(d,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:c.description})]})},c.value))})]})}Y.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const ee=()=>{const s=L.RBAC_CONFIG.roles.filter(o=>o.passport),{inService:t}=I(),{roles:n}=W(),i=[...s,...t?n:[]];return qe(i,"name").filter(o=>o.name!==L.ROLES.OWNER)};function me(){const{session:s}=Me(),t=ee();return b.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(c=>c.name==="guest");return[...t.filter(c=>c.name!=="guest").filter(c=>s.user.passports.find(g=>g.role===c.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ue({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=W(),{t:o}=D(),[c,g]=b.useState(!1),[x,v]=b.useState(null),p=me(),K=()=>{g(!1),v(null)},h=async l=>{const{remark:C,passport:y,authType:a}=l;g(!0);const w=await n.createAccessKey({input:{teamDid:i,remark:C.trim(),passport:y,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:a}}),{data:R}=w;s(R),v(null),g(!1)},m={title:`${o("common.create")} ${o("accessKey")}`,description:(l,C,y)=>e.jsxs(Z,{sx:{gap:3},children:[e.jsx(U,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:a=>{C({...l,remark:a.target.value,__disableConfirm:!l.passport||!a.target.value.trim()}),a.target.value.trim()?y(""):y(o("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:o("setting.accessKey.passport")}),e.jsx(X,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:a=>{const w=a.target.value;y(null),C({...l,passport:w,__disableConfirm:!l.remark||!w})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:c,children:p.map(a=>e.jsx(Q,{value:a.name,"data-cy":`create-access-key-passport-option-${a.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:a.title||a.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:a.description})]})},a.name))})]}),e.jsx(Y,{value:l.authType,onChange:a=>{C({...l,authType:a.target.value})}}),e.jsx(de,{placeholder:o("setting.accessKey.expireTime"),value:l.expireAt,onChange:a=>{C({...l,expireAt:a,__disableConfirm:!l.passport||!l.remark||!a})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:h,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(m),className:"rule-action",children:[c?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),o("common.create")]}),x&&e.jsx(pe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}ue.propTypes={remark:u.string,onCreate:u.func};function xe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:o}=b.useContext(De),[c,g]=b.useState(!1),[x,v]=b.useState(()=>i),p=I(),K=()=>{v(!x)},h=y=>{g(y.target.checked)},m=_(window.location.origin,p?.info?.routing?.adminPath),l=b.useMemo(()=>i?`const Client = require('@blocklet/server-js');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -16,7 +16,7 @@ const result = await client.getBlocklet(
16
16
  { input: { did: rootDid, attachRuntimeInfo: false } },
17
17
  { headers: { 'x-access-blocklet': rootDid } }
18
18
  );
19
- `:p.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,W.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(m,"/api/did/session")}"`,[i,t,n,p.inService,m]),C=b.useMemo(()=>i?`blocklet deploy --endpoint ${p.inService?window.blocklet?.appUrl:m} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[i,t,n,p.inService,m]);return e.jsxs(ie,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:i?!c:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ye,{children:o(i?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(O,{children:t})]}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),x?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:o("setting.accessKey.showSecret")}):e.jsx(O,{children:n})]}),!x&&e.jsxs(M,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(H,{code:l,language:"shell"}),C&&e.jsx(H,{code:C,language:"shell"})]}),i&&e.jsx("div",{children:e.jsx(we,{value:"end",disabled:x,control:e.jsx(Te,{checked:c,onChange:h}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}xe.propTypes={accessKeyId:u.string.isRequired,accessKeySecret:u.string.isRequired,onConfirm:u.func,hideSecret:u.bool};const q=P.div`
19
+ `:p.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,L.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(m,"/api/did/session")}"`,[i,t,n,p.inService,m]),C=b.useMemo(()=>i?`blocklet deploy --endpoint ${p.inService?window.blocklet?.appUrl:m} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[i,t,n,p.inService,m]);return e.jsxs(ie,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:i?!c:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ze,{children:o(i?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(O,{children:t})]}),e.jsxs(M,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),x?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:o("setting.accessKey.showSecret")}):e.jsx(O,{children:n})]}),!x&&e.jsxs(M,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(H,{code:l,language:"shell"}),C&&e.jsx(H,{code:C,language:"shell"})]}),i&&e.jsx("div",{children:e.jsx(we,{value:"end",disabled:x,control:e.jsx(Te,{checked:c,onChange:h}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}xe.propTypes={accessKeyId:u.string.isRequired,accessKeySecret:u.string.isRequired,onConfirm:u.func,hideSecret:u.bool};const q=P.div`
20
20
  display: flex;
21
21
  justify-content: space-between;
22
22
  align-items: center;
@@ -24,17 +24,17 @@ const result = await client.getBlocklet(
24
24
  margin-bottom: 8px;
25
25
  `,M=P.div`
26
26
  margin-bottom: 24px;
27
- `,Ye=P.div`
27
+ `,Ze=P.div`
28
28
  font-size: 16px;
29
29
  font-weight: bold;
30
- `;function fe({accessKeyId:s,time:t,remark:n,onDelete:i=()=>{},onClose:o=()=>{}}){const{t:c,locale:g}=D(),{api:x}=I(),{teamDid:v}=L(),p=()=>{o()},K=async()=>{try{await x.deleteAccessKey({input:{teamDid:v,accessKeyId:s}}),i()}catch(l){Se.error(l?.message)}finally{p()}},h=l=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Pe(l,g),timeAge:Ue(new Date(l),Le(g))}),m={keyName:n,title:c("setting.accessKey.title"),description:t?`${c("setting.accessKey.description",h(t))}`:`${c("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:c("setting.accessKey.confirm_desc",{name:n}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:K,onCancel:p};return e.jsx(Fe,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})}fe.propTypes={accessKeyId:u.string.isRequired,time:u.string.isRequired,remark:u.string.isRequired,onDelete:u.func,onClose:u.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:i="",expireAt:o="",authType:c="signature",onClose:g=()=>{}}){const{api:x}=I(),{teamDid:v}=L(),{t:p}=D(),[K,h]=b.useState(!1),m=me(),l=()=>{h(!1),g()},C=async a=>{const{accessKeyId:w,remark:R="",passport:f,expireAt:j,authType:$}=a;h(!0),await x.updateAccessKey({input:{teamDid:v,accessKeyId:w,remark:R.trim(),passport:f,expireAt:j?new Date(j).getTime():null,authType:$}}),n(),l()},y={title:`${p("common.update")} ${p("accessKey")}`,description:(a,w,R)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(U,{label:p("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:a.accessKeyId,disabled:!0}),e.jsx(U,{label:p("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:a.remark,onChange:f=>{w({...a,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?R(""):R(p("setting.accessKey.remarkInvalid"))}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:p("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"update-access-key-select-passport",value:a.passport,onChange:f=>{const j=f.target.value;R(null),w({...a,passport:j,__disableConfirm:!a.remark||!j})},fullWidth:!0,label:p("setting.accessKey.passport"),disabled:K,children:m.map(f=>e.jsx(Q,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(J,{disabled:!0,value:a.authType,onChange:f=>{w({...a,authType:f.target.value})}}),e.jsx(de,{placeholder:p("setting.accessKey.expireTime"),value:a.expireAt,onChange:f=>{w({...a,expireAt:f,__disableConfirm:!a.passport||!a.remark||!f})}})]}),confirm:p("common.confirm"),cancel:p("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:i,expireAt:o,authType:c},onConfirm:C,onCancel:l};return e.jsx(pe,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}ge.propTypes={accessKeyId:u.string.isRequired,remark:u.string,passport:u.string,expireAt:u.string,authType:u.string,onUpdate:u.func,onClose:u.func};function he({accessKey:s,onCancel:t}){const{t:n}=D();return e.jsx(ie,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(Ze,{children:e.jsx(ye,{accessKey:s})})})}he.propTypes={accessKey:u.object.isRequired,onCancel:u.func.isRequired};const Ze=P(d)`
30
+ `;function fe({accessKeyId:s,time:t,remark:n,onDelete:i=()=>{},onClose:o=()=>{}}){const{t:c,locale:g}=D(),{api:x}=I(),{teamDid:v}=W(),p=()=>{o()},K=async()=>{try{await x.deleteAccessKey({input:{teamDid:v,accessKeyId:s}}),i()}catch(l){Se.error(l?.message)}finally{p()}},h=l=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Pe(l,g),timeAge:Ue(new Date(l),We(g))}),m={keyName:n,title:c("setting.accessKey.title"),description:t?`${c("setting.accessKey.description",h(t))}`:`${c("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:c("setting.accessKey.confirm_desc",{name:n}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:K,onCancel:p};return e.jsx(Fe,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})}fe.propTypes={accessKeyId:u.string.isRequired,time:u.string.isRequired,remark:u.string.isRequired,onDelete:u.func,onClose:u.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:i="",expireAt:o="",authType:c="signature",onClose:g=()=>{}}){const{api:x}=I(),{teamDid:v}=W(),{t:p}=D(),[K,h]=b.useState(!1),m=me(),l=()=>{h(!1),g()},C=async a=>{const{accessKeyId:w,remark:R="",passport:f,expireAt:j,authType:$}=a;h(!0),await x.updateAccessKey({input:{teamDid:v,accessKeyId:w,remark:R.trim(),passport:f,expireAt:j?new Date(j).getTime():null,authType:$}}),n(),l()},y={title:`${p("common.update")} ${p("accessKey")}`,description:(a,w,R)=>e.jsxs(Z,{sx:{gap:3},children:[e.jsx(U,{label:p("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:a.accessKeyId,disabled:!0}),e.jsx(U,{label:p("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:a.remark,onChange:f=>{w({...a,remark:f.target.value,__disableConfirm:!f.target.value.trim()}),f.target.value.trim()?R(""):R(p("setting.accessKey.remarkInvalid"))}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:p("setting.accessKey.passport")}),e.jsx(X,{"data-cy":"update-access-key-select-passport",value:a.passport,onChange:f=>{const j=f.target.value;R(null),w({...a,passport:j,__disableConfirm:!a.remark||!j})},fullWidth:!0,label:p("setting.accessKey.passport"),disabled:K,children:m.map(f=>e.jsx(Q,{value:f.name,"data-cy":`update-access-key-passport-option-${f.name}`,children:e.jsxs(d,{children:[e.jsx("span",{children:f.title||f.name}),e.jsx(d,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:f.description})]})},f.name))})]}),e.jsx(Y,{disabled:!0,value:a.authType,onChange:f=>{w({...a,authType:f.target.value})}}),e.jsx(de,{placeholder:p("setting.accessKey.expireTime"),value:a.expireAt,onChange:f=>{w({...a,expireAt:f,__disableConfirm:!a.passport||!a.remark||!f})}})]}),confirm:p("common.confirm"),cancel:p("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:i,expireAt:o,authType:c},onConfirm:C,onCancel:l};return e.jsx(pe,{title:y.title,description:y.description,confirm:y.confirm,color:y.color,cancel:y.cancel,params:y.params,onConfirm:y.onConfirm,onCancel:y.onCancel})}ge.propTypes={accessKeyId:u.string.isRequired,remark:u.string,passport:u.string,expireAt:u.string,authType:u.string,onUpdate:u.func,onClose:u.func};function he({accessKey:s,onCancel:t}){const{t:n}=D();return e.jsx(ie,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(Je,{children:e.jsx(ye,{accessKey:s})})})}he.propTypes={accessKey:u.object.isRequired,onCancel:u.func.isRequired};const Je=P(d)`
31
31
  margin-top: -16px;
32
32
 
33
33
  .tabs {
34
34
  margin-left: 0;
35
35
  margin-right: 0;
36
36
  }
37
- `;function ye({accessKey:s}){const{t,locale:n}=D(),{blocklet:i}=We(),o=I(),c=ee(),g=(i?.children||[]).find(h=>h?.meta?.did===s.componentDid),x=c.find(h=>h.name===s.passport),v=x?x.title:s.passport,p=b.useMemo(()=>o.inService?`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,W.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,o?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,o.inService,o?.info?.routing?.adminPath]),K=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ve,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(O,{children:`blocklet-${z.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(d,{children:le(v,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ae,{showDid:!0,did:s.createdBy,cardType:ce.Detailed,infoType:re.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(Z,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...g?[{label:t("setting.accessKey.component"),content:e.jsxs(d,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Oe,{blocklet:g,ancestors:[i]}),e.jsx(d,{sx:{ml:"16px",minWidth:0},children:e.jsxs(d,{className:"component-header",children:[e.jsx(d,{className:"component-name",children:ze.getDisplayName(g,!0)}),e.jsx(d,{className:"component-version",children:g?.meta?.version})]})})]},g)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:p,language:"shell"})}:null].filter(Boolean)}];return e.jsx(Je,{gap:3,children:e.jsx(d,{className:"info-area",children:K.map(h=>e.jsxs(d,{sx:{mb:3},children:[e.jsx(N,{variant:"h6",sx:{mb:1.5},children:h.title}),e.jsx(d,{className:"info-grid",children:h.items.map(m=>e.jsxs(d,{className:"info-item",children:[e.jsx(d,{className:"info-label",children:e.jsx(N,{variant:"subtitle2",color:"textSecondary",children:m.label})}),e.jsx(d,{sx:{flex:1,minWidth:0},children:m.content})]},m.label))})]},h.title))})})}ye.propTypes={accessKey:u.object.isRequired};const Je=P(Y)`
37
+ `;function ye({accessKey:s}){const{t,locale:n}=D(),{blocklet:i}=Le(),o=I(),c=ee(),g=(i?.children||[]).find(h=>h?.meta?.did===s.componentDid),x=c.find(h=>h.name===s.passport),v=x?x.title:s.passport,p=b.useMemo(()=>o.inService?`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,L.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${z.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,o?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,o.inService,o?.info?.routing?.adminPath]),K=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ve,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(O,{children:`blocklet-${z.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(d,{children:le(v,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ae,{showDid:!0,did:s.createdBy,cardType:ce.Detailed,infoType:re.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(J,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...g?[{label:t("setting.accessKey.component"),content:e.jsxs(d,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Oe,{blocklet:g,ancestors:[i]}),e.jsx(d,{sx:{ml:"16px",minWidth:0},children:e.jsxs(d,{className:"component-header",children:[e.jsx(d,{className:"component-name",children:ze.getDisplayName(g,!0)}),e.jsx(d,{className:"component-version",children:g?.meta?.version})]})})]},g)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:p,language:"shell"})}:null].filter(Boolean)}];return e.jsx(Ye,{gap:3,children:e.jsx(d,{className:"info-area",children:K.map(h=>e.jsxs(d,{sx:{mb:3},children:[e.jsx(N,{variant:"h6",sx:{mb:1.5},children:h.title}),e.jsx(d,{className:"info-grid",children:h.items.map(m=>e.jsxs(d,{className:"info-item",children:[e.jsx(d,{className:"info-label",children:e.jsx(N,{variant:"subtitle2",color:"textSecondary",children:m.label})}),e.jsx(d,{sx:{flex:1,minWidth:0},children:m.content})]},m.label))})]},h.title))})})}ye.propTypes={accessKey:u.object.isRequired};const Ye=P(Z)`
38
38
  .info-card {
39
39
  margin-bottom: 24px;
40
40
  overflow: hidden;
@@ -107,4 +107,4 @@ const result = await client.getBlocklet(
107
107
  margin: 0;
108
108
  }
109
109
  }
110
- `;function et({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:i}=D(),{api:o,inService:c}=I(),{teamDid:g}=L(),[x,v]=b.useState({}),[p,K]=b.useState(null),[h,m]=b.useState(null),[l,C]=b.useState(null),y=Ge(),a=ee(),w=b.useRef(null),R=`access-keys-${g}`,f=Ie(R),[j,$]=b.useState({searchText:f.searchText||"",pageSize:f.rowsPerPage||10,page:1}),S=Qe(async()=>{const r={teamDid:g,paging:{page:j.page,pageSize:j.pageSize}};return await o.getAccessKeys({input:r})},[j.page,j.pageSize]),{loading:be,error:te}=S,E=b.useMemo(()=>S.value?.list||[],[S.value?.list]),se=b.useMemo(()=>s?["accessKeyId","createdVia","createdBy","createdBy"]:[],[s]),je=b.useMemo(()=>[{label:n("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:T})=>{const A=E[T];return e.jsx(d,{className:"remark",sx:Be({display:"flex",alignItems:"center",gap:2},t),children:e.jsx(N,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(d,{sx:t,children:e.jsx($e,{showDidLogo:!1,children:r})})}},{label:n("common.role"),name:"passport",options:{customBodyRender:r=>{const T=a.find(k=>k.name===r),A=T?T.title:r;return e.jsx(d,{sx:t,children:le(A,r)})}}},{label:n("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(N,{sx:t,children:r})}},{label:n("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(N,{sx:t,children:n(`setting.accessKey.${r}`)})}},{label:n("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(d,{sx:t,children:r?e.jsx(B,{value:r,locale:i}):"-"})}},{label:n("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(d,{sx:t,children:r?e.jsx(B,{value:r,locale:i}):"-"})}},{label:n("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>e.jsx(d,{className:"expired-at",sx:t,children:r?e.jsx(Z,{value:r}):n("common.neverExpired")})}},{label:n("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:r=>e.jsx(d,{sx:t,children:r?e.jsx(ae,{showDid:!0,did:r,cardType:ce.Detailed,infoType:re.Minimal,sx:{border:0,padding:0,...y&&{minWidth:"unset"}}}):"-"})}},{label:n("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(r,{rowIndex:T})=>{const A=E[T];return e.jsx(d,{sx:t,children:e.jsx(Xe,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(Ae,{}),text:n("common.edit"),onClick:k=>{k.stopPropagation(),C(A)}},{icon:e.jsx(Ke,{}),text:n("common.delete"),onClick:k=>{k.stopPropagation(),m(A)}}]})})}}}].filter(r=>!se.includes(r.name)),[E,i,n,a,m,C,t,y,se]),Ce=({page:r,rowsPerPage:T,searchText:A})=>{j.pageSize!==T?$(k=>({...k,searchText:"",pageSize:T,page:1})):j.page!==r+1?$(k=>({...k,searchText:"",page:r+1})):j.searchText!==A&&$(k=>({...k,searchText:A,page:1}))},ne=j.searchText?E.filter(r=>r.accessKeyId.toLowerCase().includes(j.searchText.toLowerCase())||(r.remark||"").toLowerCase().includes(j.searchText.toLowerCase())):E;return te?e.jsx(Re,{severity:"error",children:_e(te)}):e.jsxs(d,{ref:w,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[y?e.jsx(oe,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${i}/access-key`}):null,e.jsx(Ee,{durable:R,durableKeys:["page","rowsPerPage"],data:ne,columns:je,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:j.page-1,rowsPerPage:j.pageSize,count:S.value?.paging?.total||0,searchDebounceTime:600,onRowClick(r,{dataIndex:T},A){if(w.current?.contains(A.target)){const k=ne[T];K(k)}}},loading:be,onChange:Ce,title:y?null:e.jsx(oe,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${i}/access-key`}),customButtons:[e.jsx(He,{permission:c?"":"mutate_accessKey",children:e.jsx(ue,{onCreate:r=>{const{accessKeyId:T,accessKeySecret:A,authType:k}=r;v({show:!0,accessKeyId:T,accessKeySecret:A,authType:k})}})})],emptyNode:e.jsx(Ne,{children:n("oauth.client.empty")})}),x.show&&e.jsx(xe,{hideSecret:x.authType==="signature",onConfirm:()=>{S.retry(),v({show:!1})},...x}),p&&e.jsx(he,{onCancel:()=>K(null),accessKey:p}),h&&e.jsx(fe,{accessKeyId:h.accessKeyId,time:h.lastUsedAt,remark:h.remark||"N/A",onDelete:S.retry,onClose:()=>m(null)}),l&&e.jsx(ge,{...l,onUpdate:S.retry,onClose:()=>C(null)})]})}et.propTypes={isSelf:u.bool,columnSx:u.object};export{et as default};
110
+ `;function et({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:i}=D(),{api:o,inService:c}=I(),{teamDid:g}=W(),[x,v]=b.useState({}),[p,K]=b.useState(null),[h,m]=b.useState(null),[l,C]=b.useState(null),y=Xe(),a=ee(),w=b.useRef(null),R=`access-keys-${g}`,f=Ie(R),[j,$]=b.useState({searchText:f.searchText||"",pageSize:f.rowsPerPage||10,page:1}),S=Qe(async()=>{const r={teamDid:g,paging:{page:j.page,pageSize:j.pageSize}};return await o.getAccessKeys({input:r})},[j.page,j.pageSize]),{loading:be,error:te}=S,E=b.useMemo(()=>S.value?.list||[],[S.value?.list]),se=b.useMemo(()=>s?["accessKeyId","createdVia","createdBy","createdBy"]:[],[s]),je=b.useMemo(()=>[{label:n("common.name"),name:"remark",options:{customBodyRender:(r,{rowIndex:T})=>{const A=E[T];return e.jsx(d,{className:"remark",sx:Be({display:"flex",alignItems:"center",gap:2},t),children:e.jsx(N,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:r=>e.jsx(d,{sx:t,children:e.jsx($e,{showDidLogo:!1,children:r})})}},{label:n("common.role"),name:"passport",options:{customBodyRender:r=>{const T=a.find(k=>k.name===r),A=T?T.title:r;return e.jsx(d,{sx:t,children:le(A,r)})}}},{label:n("common.createdVia"),name:"createdVia",options:{customBodyRender:r=>e.jsx(N,{sx:t,children:r})}},{label:n("setting.accessKey.authType"),name:"authType",options:{customBodyRender:r=>e.jsx(N,{sx:t,children:n(`setting.accessKey.${r}`)})}},{label:n("common.createdAt"),name:"createdAt",options:{customBodyRender:r=>e.jsx(d,{sx:t,children:r?e.jsx(B,{value:r,locale:i}):"-"})}},{label:n("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:r=>e.jsx(d,{sx:t,children:r?e.jsx(B,{value:r,locale:i}):"-"})}},{label:n("common.expiredAt"),name:"expireAt",options:{customBodyRender:r=>e.jsx(d,{className:"expired-at",sx:t,children:r?e.jsx(J,{value:r}):n("common.neverExpired")})}},{label:n("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:r=>e.jsx(d,{sx:t,children:r?e.jsx(ae,{showDid:!0,did:r,cardType:ce.Detailed,infoType:re.Minimal,sx:{border:0,padding:0,...y&&{minWidth:"unset"}}}):"-"})}},{label:n("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(r,{rowIndex:T})=>{const A=E[T];return e.jsx(d,{sx:t,children:e.jsx(Ge,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(Ae,{}),text:n("common.edit"),onClick:k=>{k.stopPropagation(),C(A)}},{icon:e.jsx(Ke,{}),text:n("common.delete"),onClick:k=>{k.stopPropagation(),m(A)}}]})})}}}].filter(r=>!se.includes(r.name)),[E,i,n,a,m,C,t,y,se]),Ce=({page:r,rowsPerPage:T,searchText:A})=>{j.pageSize!==T?$(k=>({...k,searchText:"",pageSize:T,page:1})):j.page!==r+1?$(k=>({...k,searchText:"",page:r+1})):j.searchText!==A&&$(k=>({...k,searchText:A,page:1}))},ne=j.searchText?E.filter(r=>r.accessKeyId.toLowerCase().includes(j.searchText.toLowerCase())||(r.remark||"").toLowerCase().includes(j.searchText.toLowerCase())):E;return te?e.jsx(Re,{severity:"error",children:_e(te)}):e.jsxs(d,{ref:w,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[y?e.jsx(oe,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${i}/access-key`}):null,e.jsx(Ee,{durable:R,durableKeys:["page","rowsPerPage"],data:ne,columns:je,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:j.page-1,rowsPerPage:j.pageSize,count:S.value?.paging?.total||0,searchDebounceTime:600,onRowClick(r,{dataIndex:T},A){if(w.current?.contains(A.target)){const k=ne[T];K(k)}}},loading:be,onChange:Ce,title:y?null:e.jsx(oe,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${i}/access-key`}),customButtons:[e.jsx(He,{permission:c?"":"mutate_accessKey",children:e.jsx(ue,{onCreate:r=>{const{accessKeyId:T,accessKeySecret:A,authType:k}=r;v({show:!0,accessKeyId:T,accessKeySecret:A,authType:k})}})})],emptyNode:e.jsx(Ne,{children:n("oauth.client.empty")})}),x.show&&e.jsx(xe,{hideSecret:x.authType==="signature",onConfirm:()=>{S.retry(),v({show:!1})},...x}),p&&e.jsx(he,{onCancel:()=>K(null),accessKey:p}),h&&e.jsx(fe,{accessKeyId:h.accessKeyId,time:h.lastUsedAt,remark:h.remark||"N/A",onDelete:S.retry,onClose:()=>m(null)}),l&&e.jsx(ge,{...l,onUpdate:S.retry,onClose:()=>C(null)})]})}et.propTypes={isSelf:u.bool,columnSx:u.object};export{et as default};
@@ -1 +1 @@
1
- import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-DV92LEhm.js";import{T as f}from"./vendor-ux-C9Q7otQi.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-CBuBVmWe.js";import"./vendor-utils-CddrUZ58.js";import"./vendor-hooks-9cd36rYd.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D_Dm09bZ.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 I(){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{I as default};
1
+ import{j as t,ak as s,T as n,W as i}from"./vendor-mui-core-B7zoO8f5.js";import{T as f}from"./vendor-ux-B7q8W4Pg.js";import{L as g,r as k}from"./vendor-react-Dvs43sk9.js";import"./index-BF7bSwjJ.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-BRXKH6Nb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.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 I(){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{I as default};
@@ -0,0 +1,6 @@
1
+ import{j as e,W as u,a6 as z,T as j,at as _e,D as We,cG as J,ao as V,cH as Ge,ak as h,b1 as G,a$ as Ke,s as fe,cI as be,cw as Fe,am as ge,cs as Ye,M as F,aO as Y,bW as $e,aP as $,Q as qe,bh as He,aR as Qe,cJ as Xe,cK as Je,cL as Ve,cM as Ze,c1 as he}from"./vendor-mui-core-B7zoO8f5.js";import{k as ke,j as je,a as ue}from"./vendor-hooks-BRXKH6Nb.js";import{r as b,u as et}from"./vendor-react-Dvs43sk9.js";import{a8 as O,Z as L,ao as E,X as N,aM as tt,aN as st,aD as nt,c as I,v as ot}from"./index-BF7bSwjJ.js";import{H as B,T as D,G as at,ak as q,ab as rt,ac as it,D as le,L as ct}from"./vendor-ux-B7q8W4Pg.js";import{u as lt}from"./use-mobile-C_DcJ5SZ.js";import{a as H,d as Ce,a1 as dt,c as pt,D as we,C as me}from"./vendor-utils-DtY42AM-.js";import{o as Be}from"./vendor-arcblock-B7AoUs4o.js";import{b as ut,u as mt,D as xt,c as de,a as ft}from"./index-D_t0hM3n.js";import"./index-C-DpXzH8.js";import"./index-BojVbZw0.js";import"./api-IUmhrtIY.js";import{u as De,C as gt,D as ht,a as St}from"./connect-to-DBq3ktB8.js";import{b as yt,c as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-CvL1Uwkd.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-Bzij4iIk.js";import{E as Et}from"./index-DT3k66ox.js";import{x as Tt}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-BNFAIq84.js";import{S as It}from"./switch-control-BR8H_fdm.js";import{C as Rt,u as Pt}from"./config-space-CtK2sF5f.js";import{L as ye}from"./list-header-BQx81X9X.js";import"./lottie-web-4koyQiv_.js";import"./index-BtkFo6d6.js";async function vt({blockletDid:t,nodeApi:n,spaceGateways:o}){let s=!1;const r=await Promise.all(o.map(async a=>{let{name:c}=a;const i=await yt(a.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...a,name:c}}));return s&&await Promise.all(r.filter(a=>a.did).map(a=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function At({refresh:t}={}){const{blocklet:n}=O(),o=n?.meta?.did,{api:s}=L();return ke(async()=>{if(!o)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:o}});return await vt({blockletDid:o,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[o,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function Ee({deps:t,setLoading:n,backupDate:o}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=O(),[r,a]=b.useState([]),{api:c}=L(),[i,d]=b.useMemo(()=>o?[E(o).startOf("day").toISOString(),E(o).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[o]),l=Ce(async()=>{try{if(n(!0),!s){a([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});a(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{n(!1)}},1e3);return je(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:n}=Ee(),[o,s]=b.useState({message:"",progress:0,completed:!1}),r=L(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(n?.length&&dt(n[0]?.status)){const[c]=n;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[n]),o}function Ot({deps:t=[],setLoading:n=()=>{}}={}){const{blocklet:o}=O(),[s,r]=b.useState([]),{api:a}=L(),c=b.useCallback(Ce(async()=>{if(!a||!o?.meta?.did){r([]);return}try{n(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:o.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{n(!1)}},1e3),[]);return je(async()=>(await c(),()=>{c.cancel()}),[o?.meta?.did].concat(t)),{backupSummary:s}}const Te=b.createContext({}),{Provider:Lt,Consumer:bs}=Te;function Ie({children:t}){const{t:n}=D(),{api:o}=L(),{blocklet:s}=O(),[r,a]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=At({refresh:c}),g=pt(d),m=zt({appDid:s?.appDid}),p=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=Ee({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ot({deps:[ee]}),[_,M]=b.useState(d?.find(f=>f.endpoint===p)),T=s?.settings?.autoBackup,P=()=>{i(f=>!f)},ne=()=>{te(f=>f+1)},oe=()=>{y(f=>f+1)},K=async f=>{await o.updateAutoBackup({input:{did:s.meta.did,autoBackup:f}})},X=async()=>{await o.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(f,A)=>{try{x(R=>{const v=[...R];return v.push({...f,loading:!0}),v}),await o.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:f}}),p!==A&&await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:A}]}}),M(f),P(),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(v=>[...v].filter(W=>W.did!==f.did)),R}},re=async f=>{f&&(f.endpoint===p&&(await o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),T?.enabled&&await K({enabled:!1})),await o.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:f?.did}}),x(A=>{const R=[...A];return R.splice(R.indexOf(f),1),R}),M(f),P())},ie=async f=>{await Promise.all([o.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:f.did},spaceGateway:f}}),p!==f.endpoint&&o.configBlocklet({input:{did:[s.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:f.endpoint}]}})]),B.success(n("storage.spaces.connectedWithName",{name:f?.name??"DID Spaces"})),P()},C=f=>f?.endpoint===p;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:g,spaceGatewayIsSelected:C,updateAutoBackup:K,abortBlockletBackup:X,backupEndpoint:p,backupProgress:m,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:a,backupsLoading:k,autoBackup:T},children:t})}Ie.propTypes={children:u.any.isRequired};function U(){return b.useContext(Te)}function Re({...t}){const{blocklet:n}=O(),{info:o}=L(),{t:s}=D(),r=De({blocklet:n}),a=tt(o),{spaceGateways:c,addSpaceGateway:i}=U(),d={checkFn:we.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:a,extraParams:{appPid:n.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:o.did}},l=async({endpoint:g,name:m,did:p})=>{const k=await kt(g);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===g)){B.error(s("storage.spaces.gateway.add.duplicate",{name:m}));return}await i({name:m,did:p,url:k,endpoint:g},g)},x=async({spaceGateway:g})=>{try{await l(g)}catch(m){console.error(m),B.error(Q(m))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Ut(){const{api:t}=L(),{blocklet:n}=O(),{data:o,loading:s}=ke(()=>t.getBlocklet({input:{did:n?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!n?.meta?.did,refreshDeps:[n?.meta?.did]});return{blocklet:o?.blocklet??null,loading:s}}function Pe({...t}){const{t:n}=b.useContext(at),{blocklet:o,loading:s}=Ut();if(o?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),a=o.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:n("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,o.diskInfo.app)},{key:"dataDir",name:n("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,o.diskInfo.data)},{key:"logDir",name:n("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,o.diskInfo.log)},{key:"cacheDir",name:n("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,o.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(z,{}):e.jsx(j,{children:n("blocklet.diskInfo.empty")})}const Mt=_e(j)``;function ve(){const{t}=D(),{setBackupDate:n,backupSummary:o}=U(),s=mt({key:"lg"}),r=b.useRef(null),a=We(),c=b.useCallback(l=>{n(l)},[n]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),g=new Map(o.map(p=>[p.date,{date:p.date,successCount:p.successCount,errorCount:p.errorCount}])),m=[];for(let p=x.clone();E(p).isBefore(l);p=p.add(1,"day")){const k=p.format("YYYY-MM-DD");m.push(g.get(k)||{date:k,successCount:0,errorCount:0})}return m},[o]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
2
+ `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:J[600]},{min:-9,max:-6,color:J[500]},{min:-6,max:-3,color:J[400]},{min:-3,max:-1,color:J[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:V[300]},{min:3,max:6,color:V[400]},{min:6,max:9,color:V[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:V[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:Ge[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(h,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(h,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Et,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(h,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(G,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Nt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:n="",createdAt:o}){const{t:s}=D(),r=t===I.BACKUPS.STATUS.PROGRESS&&E().diff(o,"hours")>=I.BACKUPS.TIMEOUT_HOURS,a=r&&s("common.timeoutError"),c=t===I.BACKUPS.STATUS.PROGRESS&&!r,i=t===I.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(q,{type:"success",children:s("common.succeeded")}):e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:s("common.failed")}),e.jsx(ge,{style:{display:"flex",alignItems:"center",flexShrink:0},title:n||a,children:e.jsx(be,{children:e.jsx(Ye,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:u.string.isRequired,message:u.string,createdAt:u.string.isRequired};function ze({metadata:t={}}){const{t:n}=D();if(H(t))return e.jsx(q,{type:"success",children:n("common.succeeded")});const o=t.count||0,s=t.size||0,r=Tt(s,{iec:!0}),a=e.jsxs(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[n("common.fileCount"),": ",o]}),e.jsxs(j,{variant:"body2",children:[n("common.fileSize"),": ",r]})]});return e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:n("common.succeeded")}),e.jsx(Nt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(be,{children:e.jsx(Fe,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ze.propTypes={metadata:u.object};function Oe(){const{t,locale:n}=D(),{spaceGateways:o,backups:s,backupsLoading:r}=U(),a=b.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:x,createdAt:g}=s[i],m=x===I.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=I.BACKUPS.TIMEOUT_HOURS,p=x===I.BACKUPS.STATUS.SUCCEEDED&&!m,k=l||o.find(w=>d?.includes(xe(w?.endpoint)))?.name||"Unknown DID Space";return p?e.jsx(Ke,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:x,createdAt:g,metadata:m}=d,p=l===I.BACKUPS.STATUS.PROGRESS&&E().diff(g,"hours")>=I.BACKUPS.TIMEOUT_HOURS,k=l===I.BACKUPS.STATUS.PROGRESS&&!p,w=l===I.BACKUPS.STATUS.SUCCEEDED&&!p;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(ze,{metadata:m}):e.jsx(Ae,{status:l,message:x,createdAt:g})}}}],[s,o,t]),c=b.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:r,data:s,columns:a,emptyNode:t("storage.spaces.record.emptyData",n),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function _t(){const{t}=D();return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(xt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(Re,{})]}),e.jsxs(h,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(ve,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Le({spaceGateway:t,onConfirm:n=()=>{},onCancel:o=()=>{}}){const{t:s}=D(),[r,a]=b.useState(!1),[c,i]=b.useState(!1),d=(g,m)=>{g?.preventDefault(),g?.stopPropagation(),a(m)},l=async g=>{try{g?.stopPropagation(),i(!0),await n?.(t),a(!1)}catch(m){console.error(m),B.error(`${s("storage.space.gateway.delete.failed")}: ${Q(m)}`)}finally{a(!1),i(!1)}},x=g=>{d(g,!1),o?.(g)};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{color:"red",onClick:g=>d(g,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx($e,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(it,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:x,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Le.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool}).isRequired,onConfirm:u.func,onCancel:u.func};function Ue({spaceGateway:t,selected:n,onDelete:o=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=U(),[d,l]=b.useState(null),{t:x}=D(),[g,m]=b.useState(!1),p=(S,y)=>{S.stopPropagation(),S.preventDefault(),l(y&&S.currentTarget)},k=async S=>{try{m(!0),p(S,!1),await s(t)}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}},w=async S=>{try{m(!0),p(S,!1),await i()}catch(y){console.error(y),B.error(y.message)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[g||t?.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(qe,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>p(S,!0),...c,children:e.jsx(He,{})}),e.jsxs(Qe,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:S=>p(S,!1),children:[e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(t.endpoint?Ct(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Xe,{fontSize:"small"})}),e.jsx($,{children:x("common.open")})]}),e.jsxs(F,{onClick:S=>{p(S,!1),window.open(Se(wt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Je,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!n&&r&&e.jsxs(F,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(F,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ze,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Le,{spaceGateway:t,onConfirm:async()=>{l(null),await o?.(t)},onCancel:()=>l(null)})]})]})}Ue.propTypes={spaceGateway:u.shape({name:u.string.isRequired,url:u.string.isRequired,protected:u.bool,endpoint:u.string.isRequired,loading:u.bool}).isRequired,selected:u.bool.isRequired,enableSwitchToSpace:u.bool,onDelete:u.func,onConnect:u.func,backupInProgress:u.bool};const Wt=fe(({className:t,...n})=>e.jsx(ge,{...n,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Me({spaceGateway:t,spaceStatus:n,selected:o,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=O(),{api:l,info:{did:x}}=L(),{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S}=De({blocklet:d}),{backupProgress:y,updateSpaceGateway:Z,deleteSpaceGateway:ee,refreshBackupSummary:te,refreshBackups:se}=U(),[_,M]=b.useState(!1),[T,P]=b.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:m},i),scan:c("storage.spaces.authorize.scan",{appName:m},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{P(C=>({...C,open:!1}))}}),ne=o&&!_&&n===de.DISCONNECTED,oe=o&&!_&&!t.loading&&n===de.CONNECTED,K=o&&_&&n===de.CONNECTED&&y?.progress>=0,X=async()=>{try{if(await Bt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}P(C=>({...C,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:we.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:g,appName:m,appDescription:p,scopes:k,appUrl:w,referrer:S,nodeDid:x,spaceDid:t.did}}))},ae=async(C,f)=>{const A=f(C.endpoint),R=xe(A),v=C.space?f(C.space):{};if(t.did&&R!==t.did){P(Ne=>({...Ne,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),s?.(new Error(W),t);return}const ce={...t,name:v.name??"DID Space",did:v.did??xe(A),endpoint:A};await Z(ce),P(W=>({...W,open:!1})),s?.(null,ce)},re=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},ie=async()=>{try{await ee(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return b.useEffect(()=>{y?.completed?(o&&(y?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):y.message&&a?.(new Error(y?.message),t),y.progress=0,y.message=""),M(!1),te(),se()):y.progress&&M(!0)},[y]),e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[oe&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:re,children:c("storage.spaces.strategy.backupNow")}),ne&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:X,children:c("storage.spaces.disconnected.reconnectNow")}),K&&e.jsx(Wt,{title:y?.message&&e.jsx(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:y.message})}),children:e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:y?.progress,size:14,sx:{mr:1}}),y?.progress,"%"]})}),e.jsx(ot,{forceConnected:!1,saveConnect:!1,prefix:T.prefix,open:T.open,popup:!0,action:T.action,baseUrl:T.baseUrl,checkFn:T.checkFn,onSuccess:ae,onClose:T.onClose,checkTimeout:T.checkTimeout,extraParams:T.extraParams,messages:T.messages,locale:i},"get-endpoint")]}),e.jsx(Ue,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:o,onDelete:ie,onConnect:X,enableSwitchToSpace:y?.completed||H(y?.message),backupInProgress:K})]})}Me.propTypes={spaceGateway:u.shape({did:u.string.isRequired,name:u.string.isRequired,url:u.string.isRequired,endpoint:u.string.isRequired,protected:u.bool,loading:u.bool}).isRequired,spaceStatus:u.string.isRequired,selected:u.bool.isRequired,onConnected:u.func,onDeleted:u.func,onBackedUp:u.func};function Gt({...t}){const{t:n}=D();return e.jsxs(h,{...t,children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("storage.spaces.backup.records")})}),e.jsx(ve,{}),e.jsx(Oe,{})]})}function Kt({...t}){const{t:n}=D(),{autoBackup:o,updateAutoBackup:s}=U(),r=async()=>{try{const a=!o?.enabled;await s({enabled:a}),B.success(n(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(It,{checked:!!o?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:n("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function Ft(){const{t}=D(),{spaceGateways:n,spaceGatewaysLoading:o,spaceGatewayIsSelected:s}=U(),r=o&&!n?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(Me,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:x=>x&&l()});return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(Kt,{}),e.jsx(Re,{})]}),e.jsx(h,{sx:{mt:2},children:r?e.jsx(h,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(z,{})}):e.jsx(he,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:n.map(c=>e.jsx(he,{size:{xs:12,md:6},children:e.jsx(ft,{endpoint:c.endpoint,selected:s(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(Gt,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Yt(){const{spaceGatewaysFirstLoading:t,spaceGateways:n}=U();return t?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):H(n)?e.jsx(_t,{}):e.jsx(Ft,{})}function $t(){return e.jsx(Ie,{children:e.jsx(Yt,{})})}function qt(){const{spaceGateway:t,settingStorageEndpoint:n,updateSpaceGateway:o,hasStorageEndpoint:s,loading:r,storageEndpoint:a}=Pt(),c=ue(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Be,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(h,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(gt,{spaceGateway:t,settingStorageEndpoint:n}):e.jsx(ht,{}),e.jsx(h,{sx:c,children:e.jsx(St,{onConnect:o,storageEndpoint:a})})]})}function Ht(){const{t}=D();return e.jsxs(Rt,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(qt,{})]})}function Qt({navOrientation:t="vertical",...n}){const{t:o,locale:s}=D(),{blocklet:r}=O(),a=lt({key:"md"}),[c,i]=et(),d=c.get("tab")||"backup",l=a?"horizontal":t,x=ue(()=>{const w=[{label:o("common.backup"),value:"backup"}],S=r?.capabilities?.didSpace;return(S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:o("common.storage"),value:"storage"}),w},[s,l]),m=ue(()=>({backup:e.jsx($t,{}),storage:e.jsx(Ht,{})}))[d],p=w=>{i(S=>(w==="backup"?S.delete("tab"):S.set("tab",w),S))};if(x.length<=1)return e.jsx(pe,{children:m});const k=e.jsx(ct,{tabs:x,current:d,orientation:l,onChange:p,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(h,{...n,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(h,{sx:{flexShrink:0},children:e.jsx(ye,{left:k})}),e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(pe,{sx:{mt:1},children:m})})]})});if(l==="horizontal")return e.jsxs(h,{...n,children:[e.jsx(ye,{left:k}),e.jsx(pe,{sx:{mt:2},children:m})]})}Qt.propTypes={navOrientation:u.oneOf(["vertical","horizontal"])};const pe=fe(h)`
3
+ position: relative;
4
+ min-height: 66vh;
5
+ overflow: hidden;
6
+ `;export{Qt as default};
@@ -0,0 +1,113 @@
1
+ import{g as Wt,r as v}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as y,z as Q,b6 as me,be as Ke,y as V,am as ut,d1 as Bt,bm as Kt,at as ae,b1 as mt,W as h,T as ee,U as Ge,d2 as pt,b5 as qe,a5 as Me,Q as Fe,d3 as Je,aN as Ue,a6 as ft,D as ht,d4 as qt,ad as xt,d5 as Mt,d6 as Ut,c1 as st,n as Ht,x as $t,bb as Vt,M as it,cz as Gt,I as Jt,d7 as Yt}from"./vendor-mui-core-B7zoO8f5.js";import{A as gt,J as Xt,C as Qt,e as le,F as Zt,a4 as je}from"./vendor-utils-DtY42AM-.js";import{T as te,H as M,D as ce,G as en,L as bt,ak as tn,aJ as nn,y as jt,$ as vt,ab as yt,aK as Oe,F as St,a5 as sn,ah as an}from"./vendor-ux-B7q8W4Pg.js";import{aF as rn,Z as Ye,a8 as Ct,aU as Rt,M as _e,c as _,ao as Z,p as on,aO as at}from"./index-BF7bSwjJ.js";import{g as ye,b as $,a as se}from"./vendor-hooks-BRXKH6Nb.js";import{u as wt,C as Y}from"./index.esm-JPZAjt0x.js";import{i as He}from"./isURL-CH4qUEqk.js";import{S as X}from"./section-Dq8SB7lh.js";import{A as ln,a as cn,b as dn}from"./collapse-C-BNkgS6.js";import{S as Se}from"./shorten-label-BHlFrl9P.js";import{v as Tt}from"./index-Bzij4iIk.js";import{R as Nt,A as un,S as mn,a as pn,B as fn}from"./list-u8QyXkOA.js";import{j as hn,c as xn,N as gn}from"./team-BVaQVRGX.js";import{W as bn}from"./did-address-CcsL3-Qm.js";import{p as It}from"./util-CmTchaCE.js";import{D as jn,g as vn}from"./traffic-CMbIGtyi.js";import{B as Et}from"./bundle-avatar-CopjjSKq.js";import{u as yn}from"./use-mobile-C_DcJ5SZ.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B7AoUs4o.js";import"./required-CobBjKC9.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DO8dY30H.js";import"./session-COCrt-qG.js";import"./use-app-logo-Cb6MS9by.js";import"./base32-BkgeFkJa.js";import"./useAsyncRetry-D4-sRZN-.js";import"./useAsync-BrMo9m7W.js";import"./iframe-CZx2enRR.js";import"./index-DQmcrxe_.js";import"./index-DBs9Ljax.js";import"./base-chart-DZz4r8-E.js";import"./index-DT3k66ox.js";import"./vendor-mui-x-Qph0dQcg.js";import"./AdapterDayjs-VDBijwaM.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=Wt(wn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Nn(){const{api:n}=Ye(),{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:gt(b,Object.keys(ze))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(a,T,k=!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),k&&M.success(t("oauth.saveSuccess"))}catch(D){if(k)M.error(D.message||t("oauth.saveFailed"));else throw D}}),G=$(async(a,T,k)=>{try{i.isDirty&&await E(a,T,!1),await n.sendEmail({input:{did:l,receiver:k,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(Q,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.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){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 G(a,T,D),k()}})}),F=$(a=>{const T=a?.trim();return T?_e(T)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),B=$(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")),K=$(a=>a?.trim()?!0:t("notification.email.userRequired")),q=$(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(Y,{name:"enabled",control:p,render:({field:a})=>e.jsx(me,{control:e.jsx(Ke,{checked:a.value,...a})})})}),e.jsx(X,{title:t("notification.email.from"),children:e.jsx(Y,{name:"from",control:p,rules:{validate:j?F:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"host",control:p,rules:{validate:j?B:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"port",control:p,rules:{validate:j?R:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"user",control:p,rules:{validate:j?K:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"password",control:p,rules:{validate:j?q:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"secure",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(Ke,{checked:a.value,...a,disabled:!j})})})})}),e.jsxs(ln,{children:[e.jsxs(cn,{expandIcon:e.jsx(Kt,{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(Bt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(dn,{children:[e.jsx(X,{title:t("notification.email.companyName"),children:e.jsx(Y,{name:"companyName",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"companyLink",control:p,rules:{validate:j?f:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"companyAddress",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"supportEmail",control:p,rules:{validate:j?w:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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)``,We={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function En(){const{api:n}=Ye(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=Rt(),l=s?.meta?.did,b=Object.assign({...We},s?.settings?.notification?.pushKit||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=wt({defaultValues:gt(b,Object.keys(We))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(R,K,q=!0)=>{try{const{blocklet:f}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:R})}}),w=Object.assign({...We},f?.settings?.notification?.pushKit||{});I(w),q&&M.success(t("oauth.saveSuccess"))}catch(f){if(q)M.error(f.message||t("oauth.saveFailed"));else throw f}}),G=$(async(R,K)=>{try{i.isDirty&&await E(R,K,!1);const q=(s?.configs||[]).find(C=>C.key==="BLOCKLET_APP_URL")?.value,f=Xt(Qt(q,_.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(q){M.error(q.message||t("notification.pushKit.testfailed"))}}),z=$((R,K)=>{S.testReceiverError="",r.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(y,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(Q,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:S.testReceiver,onChange:q=>{S.testReceiver=q.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(q){if(!S.testReceiver?.trim()){S.testReceiverError=t("notification.pushKit.receiverRequired");return}S.testReceiverError="",await G(R,K),q()}})}),F=$(R=>{const K=R?.trim();return K?He(K)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),B=$(()=>!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(Y,{name:"enabled",control:p,render:({field:R})=>e.jsx(me,{control:e.jsx(Ke,{checked:R.value,...R})})})}),e.jsx(X,{title:t("notification.pushKit.endpoint"),children:e.jsx(Y,{name:"endpoint",control:p,rules:{validate:j?F:B},render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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(Y,{name:"did",control:p,render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...R,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})}),e.jsx(Y,{name:"pushPath",control:p,render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...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 On(){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(bt,{tabs:ct,current:n,onChange:s}),e.jsx(y,{style:o,children:r[n]})]})}const At=v.createContext({}),{Provider:kn,Consumer:Ws}=At;function Dn({children:n,blocklet:s=""}){const{api:t,inService:r,ws:{useSubscription:o}}=Ye(),[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]),G=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?[Z(C.dateRange[0]).toISOString(),Z(C.dateRange[1]).toISOString()]:void 0},{dids:T,...k}=a;let D="";T&&T.includes("system")&&(D="system");const re=T?T.filter(pe=>pe!=="system"):[],ue={...k,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]),B=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]),K=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?[Z(C.dateRange[0]).toISOString(),Z(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)&&G(S)},[E,S]),o(_.EVENTS.NOTIFICATION_BLOCKLET_CREATE,f=>{E.has(f.id)||G(S)},[E,S]);const q={fetch:G,data:l,paging:u,blocklet:s,getComponent:F,resendNotification:B,getUser:R,componentDids:N,getReceivers:K,inService:r,teamDid:i};return e.jsx(kn,{value:{notificationRecords:q},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 Ot(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"],kt=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:kt(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)}),Wn=n=>({enabled:le(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(s=>{setTimeout(()=>{s()},n*1e3)}),Bn=(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=Z().startOf("day");return n.filter(t=>Z(t.sendAt).isSame(s,"day")).length},Kn=(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},ke=(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},qn=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=Ot(r,o,{status:l});return e.jsx(Ge,{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)})]})}Qe.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 Qe({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(qe,{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 Be(n){return e.jsx(Qe,{...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=Ot(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(Je,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Ze.propTypes={value:h.array.isRequired,onChange:h.func};function Ze({value:n,onChange:s}){const{locale:t}=te(),r=Z().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(Z(i.startDate).isAfter(i.endDate)||!Z(i.startDate).isValid()||!Z(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(Ge,{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(qe,{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(qe,{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(()=>jt(l,Lt()),[l]),{getReceivers:u,inService:p,teamDid:i,getUser:N,blocklet:I}=Xe(),[S,j]=v.useState(!1),[E,G]=v.useState([]),z=ye({anchorEl:null,position:null}),F=ye({anchorEl:null,position:null}),[B,R]=v.useState(null),[K,q]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[f,w]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Z().subtract(1,"month").startOf("day").toDate(),Z().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"}],k=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)}}));G(d),q(c.paging),j(!1)}catch(c){M.error(c.message),j(!1)}};v.useEffect(()=>{k()},[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(Je,{}),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:K.page-1,rowsPerPage:K.pageSize,count:K.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:O})=>{const[,U=[],ne=[],J=[]]=O;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(J,f.emailSendStatus)||w(H=>({...H,emailSendStatus:J,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"?Wn(m):!0:!1},[N,I]),Re=v.useCallback(c=>Bn(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,O="")=>{if(!(!d.length||!c.length))try{s(c,d,m,O),F.anchorEl||(await Ee(.5),fe())}catch(U){console.error("handleResend error",{error:U})}},x=async({channels:c,isResendFailedOnly:d})=>{const m=C.map(O=>E[O].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(O){M.error(O.response?O.response.statusText:O.message)}},L=async(c,d,m,O=[],U=!0)=>{if(c.stopPropagation(),Kn(d,m)>=4){M.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await A(d,O,U);return}if(c){const J=c.currentTarget,H=J.getBoundingClientRect();z.anchorEl=J,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}R({channel:m});try{const J=await pe(m,d.receiver);await Ee(1),R({channel:m,result:J}),(typeof J=="boolean"&&J||Zt(J)&&Object.values(J).every(H=>!!H))&&(await s([m],[d.receiver],U),F.anchorEl||(await Ee(.5),fe()))}catch(J){M.error(J.message)}},W=c=>{w(d=>({...d,dateRange:c,page:1}))},P=(c,d,m,O)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);w(ne=>({...ne,[O]: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:ke},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,O)=>e.jsx(Be,{label:"Wallet",filterList:c,onChange:d,index:m,column:O,filterValues:T})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:O}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:O,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:O}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:O,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:ke},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,O)=>e.jsx(Be,{label:"Push Kit",filterList:c,onChange:d,index:m,column:O,filterValues:T})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:O}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:O,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:ke},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,O)=>e.jsx(Be,{label:"Email",filterList:c,onChange:d,index:m,column:O,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[O,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:O},O),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:J=>L(J,E[c],"webhook",[O],!1)})]},O)})}}},{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(Ze,{value:f.dateRange,onChange:W},"date-picker"),e.jsx(ce,{variant:"contained",size:"small",color:"primary",loading:S,startIcon:e.jsx(qt,{}),onClick:()=>k(),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(xt,{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:[B?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Re(B?.channel).map(c=>{const{type:d,pass:m,fail:O}=c;return!B?.result||B?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:B?.result?.[d]?Oe.success.main:"inherit"},children:[B?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:Oe.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:Oe.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:O})]},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 Gn(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=qn(n),N=t?b.length:b,I=t?u.length:u,S=t?p.length:p,j=async F=>{F.stopPropagation();const B=t?[...new Set([...b,...u].map(R=>R))]:[];await r([n],[],!0,B)},E=N+I,G=E>0?N/E*100:0,z=E>0?I/E*100:0;return e.jsxs(Jn,{successRatio:G,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(Je,{}),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):Gn(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 Jn=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 k=[...f];if(k.includes(_.NOTIFICATION_SEND_CHANNEL.PUSH)&&!Dt(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),k=k.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.PUSH)),k.includes(_.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!kt(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),k=k.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!k.length)try{i(!0),await u({notificationId:n.id,receivers:T,channels:k,resendFailedOnly:C,...k.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(()=>hn(n),[n]),E=se(()=>xn(n),[n]),G=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(un,{actors:G,teamDid:z,size:32,showName:!0}):e.jsx(mn,{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(pn,{notification:n,blocklet:t}):e.jsx(gn,{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 B={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(B).map(({label:f,value:w})=>({label:f,value:w})),K=B[I.tab]||B.info,q=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(bt,{tabs:R,current:I.tab,onChange:q,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(K.component,{})]})]})})}const Yn=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: ${Oe.text.disabled};
80
+ }
81
+ }
82
+ }
83
+ `;Pe.propTypes={blocklet:h.object,label:h.string};const Qn=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(Qn,{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(Ge,{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 Zn(n){return e.jsx(Qe,{...n,renderLabel:s=>e.jsx(Ce,{severity:s})})}function es({customTableButtons:n}){const{t:s,locale:t}=te(),r=ht(),o=v.useMemo(()=>jt(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(),G=v.useRef(null),[z,F]=v.useState(null),[B,R]=v.useState("info"),K=yn(),[q,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||[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),k=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 W=A.filter(P=>P!==x);T(P=>({...P,[L]:W,page:1}))},ue=({page:g,rowsPerPage:x,filterList:A})=>{const[L=[],,,,W=[]]=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,W)||T(P=>({...P,severities:W,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=k.find(W=>(W.did||W.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:k,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:W=>e.jsx(y,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:W.map(P=>{if(P==="system")return e.jsx("span",{children:s("notification.system")},P);const ie=k.find(we=>(we.did||we.meta?.did)===P);return e.jsx(Pe,{blocklet:ie,label:ie?.title||ie?.meta?.title},P)})}),onChange:W=>{g[A]=W.target.value,x(g[A],A,L)},children:[e.jsx(it,{value:"system",children:s("notification.system")}),k.map(W=>{const P=W.did||W.meta?.did;return e.jsx(it,{value:P,children:e.jsx(Pe,{blocklet:W,label:W.title||W.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(fn,{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(Gt,{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:W}=L,P=It(W.avatar,E,j);return e.jsx(vt,{alt:W.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:ke},filterOptions:{names:dt,fullWidth:!0,logic:De,display:(g,x,A,L)=>e.jsx(Zn,{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(Jt,{onClick:()=>f(!0),sx:{p:K?0:void 0},children:e.jsx(Yt,{})},"settings"),K?e.jsx(ee,{children:s("common.setting")}):null]}),...n||[]];return e.jsxs(y,{ref:G,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ts,{children:e.jsx(xt,{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(Ze,{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(Yn,{refresh:pe,onCancel:oe,notification:z,blocklet:i,tab:B}),e.jsx(St,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:q,onClose:()=>f(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(y,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(On,{})})})]})}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};