@abtnode/blocklet-services 1.17.7-beta-20251225-073259-cb6ecf68 → 1.17.7-beta-20251229-085620-84f09930

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 (220) hide show
  1. package/api/index.js +16 -4
  2. package/api/libs/auth/adapters/apple.js +1 -1
  3. package/api/libs/auth/adapters/auth0.js +1 -1
  4. package/api/libs/auth/adapters/github.js +1 -1
  5. package/api/libs/auth/adapters/google.js +1 -1
  6. package/api/middlewares/serve-static-engine.js +179 -0
  7. package/api/routes/env.js +3 -4
  8. package/api/routes/oauth/client.js +7 -5
  9. package/api/services/notification/queue.js +2 -2
  10. package/api/socket/channel/component.js +19 -13
  11. package/api/socket/util.js +6 -1
  12. package/dist/assets/{AdapterDayjs-BUbxoXbD.js → AdapterDayjs-DYIVeXBV.js} +1 -1
  13. package/dist/assets/{Google-Cwpw9PRe.js → Google-D9N2NN29.js} +1 -1
  14. package/dist/assets/{access-control-DwlD3_cw.js → access-control-UTVMJtLa.js} +1 -1
  15. package/dist/assets/{add-component-core-BITgGwN0.js → add-component-core-Cu9Tohbt.js} +31 -31
  16. package/dist/assets/add-resource-CqOi5S87.js +1 -0
  17. package/dist/assets/{addon-C2qdiHVb.js → addon-DSFDYYiP.js} +1 -1
  18. package/dist/assets/{advanced-BosetBVE.js → advanced-CkJs81iC.js} +1 -1
  19. package/dist/assets/{aigne-DbMeOdg9.js → aigne-Dt8mwR8G.js} +1 -1
  20. package/dist/assets/api-FQQlzPOP.js +1 -0
  21. package/dist/assets/{appearance-DhUAX-xn.js → appearance-Bs9dCa2z.js} +1 -1
  22. package/dist/assets/ar-B4BSOV5G.js +7 -0
  23. package/dist/assets/{audit-logs-BHPPGieH.js → audit-logs-Bk0Y0aey.js} +3 -3
  24. package/dist/assets/{authorize-Dfo70g1t.js → authorize-C6B5tUkA.js} +1 -1
  25. package/dist/assets/{base-chart-Cs8rd9f2.js → base-chart-ChBZtUEG.js} +1 -1
  26. package/dist/assets/{base32-CXgP3JJ5.js → base32-BccrNIeO.js} +1 -1
  27. package/dist/assets/{bind-account-Drs3IDFN.js → bind-account-CLV9q3E3.js} +1 -1
  28. package/dist/assets/branding-BGRUKKNR.js +1 -0
  29. package/dist/assets/{branding-ByK6n-fM.js → branding-Cwk5a8ly.js} +1 -1
  30. package/dist/assets/{branding-BhvacExo.js → branding-JmTDNoIq.js} +1 -1
  31. package/dist/assets/{bundle-avatar-DVOaAXid.js → bundle-avatar-CLRiyhwo.js} +1 -1
  32. package/dist/assets/{button-D6RwAFss.js → button-Bfs8GG-V.js} +1 -1
  33. package/dist/assets/{click-to-copy-B2HIKJMV.js → click-to-copy-fgcvdv-u.js} +1 -1
  34. package/dist/assets/cloneDeep-C2rlAYcK.js +1 -0
  35. package/dist/assets/{complete-Djtuko3J.js → complete-Bb_Zgfxn.js} +2 -2
  36. package/dist/assets/{component-UsgyDUkb.js → component-BEiiKeGh.js} +2 -2
  37. package/dist/assets/{config-DuS3gx_m.js → config-CAUPVWd8.js} +2 -2
  38. package/dist/assets/{config-CUYR0yDP.js → config-Crd4mTZS.js} +2 -2
  39. package/dist/assets/{config-Co1ZhGgP.js → config-DEeSuJty.js} +1 -1
  40. package/dist/assets/{config-navigation-DjF2jJY9.js → config-navigation-DcFoMJlj.js} +7 -7
  41. package/dist/assets/{config-space-zEV0JkDF.js → config-space-DVE2CBUC.js} +1 -1
  42. package/dist/assets/{confirm-DTx9f3Ke.js → confirm-BSaTCzrs.js} +1 -1
  43. package/dist/assets/{connect-nknm0LHt.js → connect-B0W5gXFT.js} +1 -1
  44. package/dist/assets/connect-ChbbAHB_.js +5 -0
  45. package/dist/assets/{connect-to-eBtGI4_9.js → connect-to-D7rrqt6m.js} +1 -1
  46. package/dist/assets/{create-passport-svg-BQhmIwWD.js → create-passport-svg-BJX-WFnl.js} +1 -1
  47. package/dist/assets/{createClass-dudiLlP7.js → createClass-CH1sG4Vj.js} +1 -1
  48. package/dist/assets/dashboard-DDFp-UB6.js +103 -0
  49. package/dist/assets/de-EFAP4yzZ.js +7 -0
  50. package/dist/assets/{delete-confirm-HiRqbh9-.js → delete-confirm-BzmT7bQV.js} +1 -1
  51. package/dist/assets/{did-address-DqhneWXa.js → did-address-cHTriZHu.js} +1 -1
  52. package/dist/assets/{domain-Xaa2OTQZ.js → domain-CLaCd92M.js} +1 -1
  53. package/dist/assets/{domain-action-card-BzceZepB.js → domain-action-card-ClVrHE96.js} +2 -2
  54. package/dist/assets/domains-C5X5bi_z.js +1 -0
  55. package/dist/assets/edit-rounded-CnMn6J-D.js +1 -0
  56. package/dist/assets/{email-CaObtYNf.js → email-DddZUTON.js} +2 -2
  57. package/dist/assets/engine-CvmlyswD.js +1 -0
  58. package/dist/assets/es-BqFCfGn2.js +9 -0
  59. package/dist/assets/{exchange-passport-BA6t_lld.js → exchange-passport-CKEOdyU9.js} +1 -1
  60. package/dist/assets/{form-DNo4HCRt.js → form-poId1OU3.js} +1 -1
  61. package/dist/assets/{form-text-input-BjQKx89L.js → form-text-input-DwerOWgK.js} +1 -1
  62. package/dist/assets/fr-CksqMtzK.js +7 -0
  63. package/dist/assets/{fuel-Cr5W3cGy.js → fuel-Bly8lXId.js} +1 -1
  64. package/dist/assets/{gen-access-key-Bw62ox39.js → gen-access-key-5kekGzt_.js} +1 -1
  65. package/dist/assets/{gen-simple-access-key-QTWh5kxW.js → gen-simple-access-key-l4SGe3J5.js} +1 -1
  66. package/dist/assets/get-safe-url-D7ti-zln.js +1 -0
  67. package/dist/assets/hi-Bztwk-sg.js +5 -0
  68. package/dist/assets/{hi-DNSN9klG.js → hi-Cra5bbq9.js} +1 -1
  69. package/dist/assets/{home-iaPbLBtv.js → home-yA5fXQmP.js} +1 -1
  70. package/dist/assets/id-C5p-l7lp.js +7 -0
  71. package/dist/assets/{iframe-C8myLb4U.js → iframe-XKq6kg_r.js} +1 -1
  72. package/dist/assets/{index-CaQnmN3Y.js → index--Zp6K5Sp.js} +1 -1
  73. package/dist/assets/{index-C4nyPKIr.js → index-5haA_ZtH.js} +1 -1
  74. package/dist/assets/{index-9h1okNKA.js → index-9N4EluXF.js} +6 -6
  75. package/dist/assets/{index-D3g5TOJl.js → index-B0wPyjk9.js} +2 -2
  76. package/dist/assets/{index-SCaAOhtj.js → index-B1-cYl7K.js} +2 -2
  77. package/dist/assets/{index-DHvO7Oyu.js → index-BBwTMTLp.js} +1 -1
  78. package/dist/assets/{index-SACCniHf.js → index-BOWGgkTH.js} +4 -4
  79. package/dist/assets/{index-B7jV3her.js → index-BT901ij8.js} +1 -1
  80. package/dist/assets/index-BjqoIwBE.js +281 -0
  81. package/dist/assets/index-BotTPbWD.js +1 -0
  82. package/dist/assets/{index-C2HNVEZ0.js → index-Bt8QUMaz.js} +1 -1
  83. package/dist/assets/index-CGOBEhzW.js +1039 -0
  84. package/dist/assets/{index-BzU09Azd.js → index-CKhKxswY.js} +2 -2
  85. package/dist/assets/{index-CtJhxyJT.js → index-CQqn5TFD.js} +18 -18
  86. package/dist/assets/{index-DeG3Ee92.js → index-CSwcQdlI.js} +1 -1
  87. package/dist/assets/index-Ce9omzTp.js +1 -0
  88. package/dist/assets/{index-CzvNhDIJ.js → index-ChQX9ze3.js} +2 -2
  89. package/dist/assets/{index-BP_Fl0Mu.js → index-CiKhg0ut.js} +1 -1
  90. package/dist/assets/{index-BleAAm7x.js → index-Cu8TdzKM.js} +1 -1
  91. package/dist/assets/{index-YLno1Cst.js → index-CuC130U2.js} +3 -3
  92. package/dist/assets/{index-1azOxnKy.js → index-CvVZvUh7.js} +1 -1
  93. package/dist/assets/{index-CnWFrsC2.js → index-CzlJLWz5.js} +4 -4
  94. package/dist/assets/{index-B5vc0eG5.js → index-D1SIrheh.js} +1 -1
  95. package/dist/assets/{index-Dk6ZABgc.js → index-D95ZNJ3d.js} +1 -1
  96. package/dist/assets/{index-Dnd0o2ng.js → index-DA8b2Fwx.js} +3 -3
  97. package/dist/assets/{index-B8sa2W5r.js → index-DGd0GDc4.js} +6 -6
  98. package/dist/assets/{index-CHuKoofS.js → index-HU-v7OeI.js} +1 -1
  99. package/dist/assets/{index-Bxd7kK_i.js → index-_haoumSc.js} +1 -1
  100. package/dist/assets/{index-DURonUPJ.js → index-pm6H84lU.js} +1 -1
  101. package/dist/assets/index-tgy1TTjM.js +81 -0
  102. package/dist/assets/{index-seQ_ufVM.js → index-v9hCHxKp.js} +1 -1
  103. package/dist/assets/{invitation-DwMnPB2W.js → invitation-OInDimvS.js} +2 -2
  104. package/dist/assets/{invitations-mhxsPoWR.js → invitations-BFTtG6X1.js} +1 -1
  105. package/dist/assets/{invite-DpZe41tL.js → invite-sUgPlE4Z.js} +1 -1
  106. package/dist/assets/{isURL-CASPeQFe.js → isURL-CJrtALFi.js} +1 -1
  107. package/dist/assets/{issue-passport-ClIYXZHr.js → issue-passport-D779MB0S.js} +1 -1
  108. package/dist/assets/{item-B3LlwO_A.js → item-D0S77pRh.js} +1 -1
  109. package/dist/assets/ja-2cGMwCig.js +9 -0
  110. package/dist/assets/ko-DDVloIXx.js +9 -0
  111. package/dist/assets/{landing-page-Cv6belCa.js → landing-page-BoqVRFrg.js} +1 -1
  112. package/dist/assets/{layout-DkW-u1GX.js → layout-BumaOQ7l.js} +1 -1
  113. package/dist/assets/{list-CBP3Lj7-.js → list-Bcp4RDC0.js} +1 -1
  114. package/dist/assets/{list-Dqz9X41o.js → list-C0ACtiK5.js} +1 -1
  115. package/dist/assets/localization-DAkSbh2g.js +1 -0
  116. package/dist/assets/{log-Ch1_gOOt.js → log-CpIPOvLt.js} +1 -1
  117. package/dist/assets/logger-DUjWrC8_.js +1 -0
  118. package/dist/assets/{login-_zzURN5A.js → login-cMKzStm-.js} +1 -1
  119. package/dist/assets/{login-oauth-callback-BiIj9E0o.js → login-oauth-callback-I8wjhibA.js} +1 -1
  120. package/dist/assets/{logo-uploader-BmnoHisE.js → logo-uploader-CeXSNxdi.js} +1 -1
  121. package/dist/assets/{lost-passport-DYnJRD_t.js → lost-passport-VCPPPILz.js} +2 -2
  122. package/dist/assets/{cloneDeep-BbaR0xRl.js → omit-spWLSLbo.js} +1 -1
  123. package/dist/assets/{open-window-Btzsgc7g.js → open-window-DY3mWojp.js} +1 -1
  124. package/dist/assets/{over-due-invoice-payment-BFDFMUwK.js → over-due-invoice-payment-C9HTfbWA.js} +1 -1
  125. package/dist/assets/overview-Bv3cq2I0.js +116 -0
  126. package/dist/assets/passport-DMm48qRk.js +1 -0
  127. package/dist/assets/{passport-item-Dx140DTL.js → passport-item-DD8VG51j.js} +1 -1
  128. package/dist/assets/{permission-HtrJm1h2.js → permission-B3ddwA-4.js} +1 -1
  129. package/dist/assets/{preferences-Dri2a4fE.js → preferences-CmMbfbTw.js} +1 -1
  130. package/dist/assets/profile-embed-DAY5ZrDb.js +1 -0
  131. package/dist/assets/{pt-BPAfyek8.js → pt-BB0AKqMq.js} +1 -1
  132. package/dist/assets/pt-FIIPCfqU.js +5 -0
  133. package/dist/assets/{publish-resource-CruXcF2L.js → publish-resource-DJRigGuM.js} +1 -1
  134. package/dist/assets/{react-beautiful-dnd.esm-89LKdt03.js → react-beautiful-dnd.esm-Bn87vJFI.js} +1 -1
  135. package/dist/assets/ru-BjRgz8OF.js +5 -0
  136. package/dist/assets/{ru-CVlekA3F.js → ru-CnPeybtU.js} +1 -1
  137. package/dist/assets/{runtime-Ck_rDqm2.js → runtime-gljMK2qS.js} +1 -1
  138. package/dist/assets/{sanitize-DyRfEGVu.js → sanitize-yVk8VEIO.js} +1 -1
  139. package/dist/assets/sdk-Be-u0PfZ.js +1 -0
  140. package/dist/assets/security-b4k0fa20.js +22 -0
  141. package/dist/assets/{session-Cm8j8XeZ.js → session-vM0SwFQZ.js} +1 -1
  142. package/dist/assets/{setup-COruOAew.js → setup-BPnqbGIk.js} +1 -1
  143. package/dist/assets/simple-select-6nihrL7w.js +1 -0
  144. package/dist/assets/{spaces-BuZf3GoQ.js → spaces-ypzuCaPe.js} +1 -1
  145. package/dist/assets/{start-D_yHRXzR.js → start-CgUu2djm.js} +1 -1
  146. package/dist/assets/{starting-progress-DahUM5Xo.js → starting-progress-B15yvlvv.js} +1 -1
  147. package/dist/assets/{status-DVjLoqLm.js → status-Cy7fzuR3.js} +1 -1
  148. package/dist/assets/{step-actions-DkehnzsP.js → step-actions-D3sZvhKo.js} +1 -1
  149. package/dist/assets/{studio-D4hiQNwZ.js → studio-D9ZxOiyo.js} +1 -1
  150. package/dist/assets/{switch-CO2el_yA.js → switch-CjDalLJU.js} +1 -1
  151. package/dist/assets/{switch-control-Bw0oiZZh.js → switch-control-CioN_5qg.js} +1 -1
  152. package/dist/assets/{table-tips-C-6Sm2ed.js → table-tips-DEqFBQFt.js} +1 -1
  153. package/dist/assets/{team-DNuHMrzV.js → team-DHhtcW5C.js} +1 -1
  154. package/dist/assets/th-DKiwQ6t6.js +5 -0
  155. package/dist/assets/{traffic-B0WH67Yr.js → traffic-DDO0-htp.js} +1 -1
  156. package/dist/assets/{transfer-BpjPR3S_.js → transfer-CEk3StHa.js} +1 -1
  157. package/dist/assets/{unsubscribe-CzgQXfYP.js → unsubscribe-DZF4NKei.js} +1 -1
  158. package/dist/assets/{use-app-logo-CZWb8lrs.js → use-app-logo-DSdF3M62.js} +1 -1
  159. package/dist/assets/{use-window-close-DDL8fcOm.js → use-window-close-va-vKf7G.js} +1 -1
  160. package/dist/assets/{useAsync-VEqKX7rF.js → useAsync-DVl73fmG.js} +1 -1
  161. package/dist/assets/{useAsync-xXSiXzwr.js → useAsync-Dotoxibi.js} +1 -1
  162. package/dist/assets/{useAsyncRetry--1T7wYe2.js → useAsyncRetry-r8dEPb-x.js} +1 -1
  163. package/dist/assets/{useLocalStorage-BV1BIwfo.js → useLocalStorage-A7dcJ6ce.js} +1 -1
  164. package/dist/assets/{user-center-DndqALOV.js → user-center-C2hlh2we.js} +1 -1
  165. package/dist/assets/{user-follower-Bzb2ZR_9.js → user-follower-BmcrANUM.js} +1 -1
  166. package/dist/assets/{util-DIVJQVg1.js → util-C_d0oDd4.js} +1 -1
  167. package/dist/assets/{util-CVjlaHo_.js → util-D9UZY2ZN.js} +1 -1
  168. package/dist/assets/{vendor-arcblock-CPCSE54a.js → vendor-arcblock-Dr30TSIK.js} +1 -1
  169. package/dist/assets/{vendor-hooks-cYMUGE4V.js → vendor-hooks-qxhUUbW5.js} +1 -1
  170. package/dist/assets/vendor-utils-CxWN1dT3.js +213 -0
  171. package/dist/assets/{vendor-ux-DfSgTRg5.js → vendor-ux-7TwTLXf8.js} +19 -19
  172. package/dist/assets/vi-C4aNShnq.js +5 -0
  173. package/dist/assets/{wait-connect-Be1Dmt0P.js → wait-connect-B2sGoXaJ.js} +1 -1
  174. package/dist/assets/{wizard-components-D3PqSMGt.js → wizard-components-BRsabxoD.js} +2 -2
  175. package/dist/assets/{wizard-BhUdbQos.js → wizard-qaZ9pS3q.js} +1 -1
  176. package/dist/assets/wrap-locale-DGVkhpYh.js +1 -0
  177. package/dist/assets/zh-Cb0McG4r.js +10 -0
  178. package/dist/assets/{zh-B_cpka88.js → zh-D1XHANJI.js} +1 -1
  179. package/dist/assets/zh-tw-PfYv9beR.js +9 -0
  180. package/dist/index.html +1 -1
  181. package/package.json +49 -49
  182. package/dist/assets/add-resource-ENVSA34x.js +0 -1
  183. package/dist/assets/api-C_w0YD2j.js +0 -1
  184. package/dist/assets/ar-BBr9bsOg.js +0 -7
  185. package/dist/assets/branding-B-5oLD-k.js +0 -1
  186. package/dist/assets/connect-BX2QwOaU.js +0 -5
  187. package/dist/assets/dashboard-DbjH3qe4.js +0 -103
  188. package/dist/assets/de-CDBOH3k5.js +0 -7
  189. package/dist/assets/domains-D_GcYdME.js +0 -1
  190. package/dist/assets/engine-BzngvK61.js +0 -1
  191. package/dist/assets/es-BJ8CsIZi.js +0 -9
  192. package/dist/assets/fr-DSXQFpNy.js +0 -7
  193. package/dist/assets/get-safe-url-CqAaHb9L.js +0 -1
  194. package/dist/assets/hi-DLsQ4VdX.js +0 -5
  195. package/dist/assets/id-AzAQyOHL.js +0 -7
  196. package/dist/assets/index-BHa1_Bjz.js +0 -1039
  197. package/dist/assets/index-BNeXCm1B.js +0 -1
  198. package/dist/assets/index-Df4GSKx6.js +0 -1
  199. package/dist/assets/index-DoVbUHDU.js +0 -55
  200. package/dist/assets/index-pAjb_WaG.js +0 -281
  201. package/dist/assets/ja-C3ccbBe-.js +0 -9
  202. package/dist/assets/keyboard-arrow-down-rounded-8U0_i9QO.js +0 -1
  203. package/dist/assets/ko-9Vbo8tR2.js +0 -9
  204. package/dist/assets/localization-gLf4FT3Q.js +0 -1
  205. package/dist/assets/logger-CWnnO-wn.js +0 -1
  206. package/dist/assets/omit-BgmLPtMY.js +0 -1
  207. package/dist/assets/overview-Bf86Sw9l.js +0 -116
  208. package/dist/assets/passport-D6ZhqZ1F.js +0 -1
  209. package/dist/assets/profile-embed-BpG6-Rqz.js +0 -1
  210. package/dist/assets/pt-iqygmSLa.js +0 -5
  211. package/dist/assets/ru-BkfMvpq6.js +0 -5
  212. package/dist/assets/sdk-C3wBexZ2.js +0 -1
  213. package/dist/assets/security-Duf_ZEVi.js +0 -22
  214. package/dist/assets/simple-select-DbXWLzPn.js +0 -1
  215. package/dist/assets/th-D-pgFsDa.js +0 -5
  216. package/dist/assets/vendor-utils-drLlzTVq.js +0 -213
  217. package/dist/assets/vi-BuffIn3I.js +0 -5
  218. package/dist/assets/wrap-locale-DtcRIeKF.js +0 -1
  219. package/dist/assets/zh-CSl2KD_S.js +0 -10
  220. package/dist/assets/zh-tw-BiloxWNq.js +0 -9
@@ -1,4 +1,4 @@
1
- import{B as qr}from"./vendor-utils-drLlzTVq.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-DfSgTRg5.js";import{co as Or,cf as Vr}from"./index-BHa1_Bjz.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
1
+ import{B as qr}from"./vendor-utils-CxWN1dT3.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-7TwTLXf8.js";import{co as Or,cf as Vr}from"./index-CGOBEhzW.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as Q,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Qe,cD as ht,ad as Xe,e4 as gt,e5 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as Ue,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,F as Ct,aC as pe}from"./vendor-utils-drLlzTVq.js";import{H as U,aU as Nt,V as Y,cM as wt,m as Ye,$ as Je,w as Ae,aO as Ze,bh as be,aJ as Rt,aW as Tt,b1 as It,b8 as Et}from"./vendor-ux-DfSgTRg5.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-BHa1_Bjz.js";import{a as X,g as De}from"./vendor-hooks-cYMUGE4V.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-BP_Fl0Mu.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-Dqz9X41o.js";import{i as Pt,e as _t,N as Bt}from"./team-DNuHMrzV.js";import{W as zt}from"./did-address-DqhneWXa.js";import{p as st}from"./util-CVjlaHo_.js";import{D as Wt,g as Mt}from"./traffic-B0WH67Yr.js";import{B as nt}from"./bundle-avatar-DVOaAXid.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-Cm8j8XeZ.js";import"./isURL-CASPeQFe.js";import"./use-app-logo-CZWb8lrs.js";import"./base32-CXgP3JJ5.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./iframe-C8myLb4U.js";import"./index-DURonUPJ.js";import"./index-DBs9Ljax.js";import"./base-chart-Cs8rd9f2.js";import"./index-B5vc0eG5.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-BUbxoXbD.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=X(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),q=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return U.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw U.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&q(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||q(P)},[w,P]);const J={fetch:q,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ut[t],children:t})}const qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=qt(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Yt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Jt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=Y(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Y(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){U.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){U.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Y();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Zt=[{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}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Zt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Y(),l=Qe(),b=x.useMemo(()=>Ye(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,q]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{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"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));q(o),J(a.paging),F(!1)}catch(a){U.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){U.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){U.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
1
+ import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as Q,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Qe,cD as ht,ad as Xe,e4 as gt,e5 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as Ue,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,F as Ct,aB as pe}from"./vendor-utils-CxWN1dT3.js";import{H as U,aU as Nt,V as Y,cM as wt,m as Ye,$ as Ze,w as Ae,aO as Je,bh as be,aK as Rt,aW as Tt,b1 as It,b8 as Et}from"./vendor-ux-7TwTLXf8.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-CGOBEhzW.js";import{a as X,g as De}from"./vendor-hooks-qxhUUbW5.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-CiKhg0ut.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-C0ACtiK5.js";import{i as Pt,e as _t,N as Bt}from"./team-DHhtcW5C.js";import{W as zt}from"./did-address-cHTriZHu.js";import{p as st}from"./util-D9UZY2ZN.js";import{D as Wt,g as Mt}from"./traffic-DDO0-htp.js";import{B as nt}from"./bundle-avatar-CLRiyhwo.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Dr30TSIK.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-vM0SwFQZ.js";import"./isURL-CJrtALFi.js";import"./use-app-logo-DSdF3M62.js";import"./base32-BccrNIeO.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./iframe-XKq6kg_r.js";import"./index-pm6H84lU.js";import"./index-DBs9Ljax.js";import"./base-chart-ChBZtUEG.js";import"./index-D1SIrheh.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DYIVeXBV.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=X(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),q=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},J=await n.getNotificationSendLog({input:se});return F(se),b(J.list),S(J.paging),J.list}catch(D){return U.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw U.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&q(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||q(P)},[w,P]);const Z={fetch:q,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:Z},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ut[t],children:t})}const qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=qt(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Yt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=Y(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Y(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){U.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){U.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Y();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Jt=[{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}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Jt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Y(),l=Qe(),b=x.useMemo(()=>Ye(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,q]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,Z]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{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"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));q(o),Z(a.paging),F(!1)}catch(a){U.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},J=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){U.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){U.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Je,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:J,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak
27
27
  }
28
28
  font-size: 12px;
29
29
  }
30
- `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ns(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function as(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ke.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=Y(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=Y(),{success:b,failed:m,pending:S}=s,h=Jt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,q=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(is,{successRatio:q,failedRatio:M,children:[e.jsxs(Q,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(Q,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(v)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(P)," ",l("notification.sendStatus.pending")]})]}),v>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=X(()=>s==="simple"?ns(t):as(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(et,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(He,{container:!0,spacing:2,children:i.map(l=>e.jsx(He,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const is=ae(N)`
30
+ `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ns(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function as(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ke.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=Y(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=Y(),{success:b,failed:m,pending:S}=s,h=Zt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,q=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(is,{successRatio:q,failedRatio:M,children:[e.jsxs(Q,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(Q,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(v)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(P)," ",l("notification.sendStatus.pending")]})]}),v>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=X(()=>s==="simple"?ns(t):as(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(et,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(He,{container:!0,spacing:2,children:i.map(l=>e.jsx(He,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const is=ae(N)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=Y(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=X(()=>b(t.componentDid)||n,[n,t.componentDid]),v=De({tab:r||"info"}),P=x.useCallback(async(p,g,T=!0,D=[])=>{if(!p.length||!t.id)return;const O=g.length>0?g:t?.receivers?.map(_=>_.receiver);if(!O.length)return;let z=[...p];if(z.includes(E.NOTIFICATION_SEND_CHANNEL.PUSH)&&!rt(n)&&(U.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.PUSH)),z.includes(E.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ot(n)&&(U.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:O,channels:z,resendFailedOnly:T,...z.includes("webhook")&&D.length?{webhookUrls:D}:{}}),U.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),U.error(_.response?_.response.statusText:_.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),F=X(()=>Pt(t),[t]),w=X(()=>_t(t),[t]),q=X(()=>F?t?.actorInfo:[],[t]),M=X(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(Ot,{actors:q,teamDid:M,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:i("notification.body"),value:F?e.jsx(kt,{notification:t,blocklet:n}):e.jsx(Bt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(It,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(et,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const k={info:{label:i("common.basicInfo"),value:"info",component:L},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},$=Object.values(k).map(({label:p,value:g})=>({label:p,value:g})),V=k[v.tab]||k.info,J=p=>{v.tab=p};return e.jsx(Rt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{v.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(rs,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(Tt,{tabs:$,current:v.tab,onChange:J,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(es,{notificationId:t.id,resending:S,handleResend:P}),v.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:S,onResend:P}),v.tab==="info"&&e.jsx(V.component,{})]})]})})}const os=x.memo(ut),rs=ae.div`
48
+ `;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=Y(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=X(()=>b(t.componentDid)||n,[n,t.componentDid]),v=De({tab:r||"info"}),P=x.useCallback(async(p,g,T=!0,D=[])=>{if(!p.length||!t.id)return;const O=g.length>0?g:t?.receivers?.map(_=>_.receiver);if(!O.length)return;let z=[...p];if(z.includes(E.NOTIFICATION_SEND_CHANNEL.PUSH)&&!rt(n)&&(U.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.PUSH)),z.includes(E.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ot(n)&&(U.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:O,channels:z,resendFailedOnly:T,...z.includes("webhook")&&D.length?{webhookUrls:D}:{}}),U.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),U.error(_.response?_.response.statusText:_.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),F=X(()=>Pt(t),[t]),w=X(()=>_t(t),[t]),q=X(()=>F?t?.actorInfo:[],[t]),M=X(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(Ot,{actors:q,teamDid:M,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:i("notification.body"),value:F?e.jsx(kt,{notification:t,blocklet:n}):e.jsx(Bt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(It,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(et,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const k={info:{label:i("common.basicInfo"),value:"info",component:L},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},$=Object.values(k).map(({label:p,value:g})=>({label:p,value:g})),V=k[v.tab]||k.info,Z=p=>{v.tab=p};return e.jsx(Rt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{v.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(rs,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(Tt,{tabs:$,current:v.tab,onChange:Z,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(es,{notificationId:t.id,resending:S,handleResend:P}),v.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:S,onResend:P}),v.tab==="info"&&e.jsx(V.component,{})]})]})})}const os=x.memo(ut),rs=ae.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function ve({blocklet:t=null,label:s=""}){return e.jsx(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function cs(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ds({customTableButtons:t}){const{t:s,locale:n}=Y(),r=Qe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Ye(r,lt()),[r]),[b,m]=x.useState(!1),{data:S,paging:h,blocklet:y,fetch:v,getComponent:P,componentDids:F,inService:w,teamDid:q}=_e(),M=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),J=`notification-records-${y.meta?.did}`,p=Et(J),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),D=X(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),Z=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=D.find(A=>(A.did||A.meta?.did)===u);return e.jsx(ve,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:D,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,I)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[j],renderValue:A=>e.jsx(N,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:A.map(R=>{if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const re=D.find(ne=>(ne.did||ne.meta?.did)===R);return e.jsx(ve,{blocklet:re,label:re?.title||re?.meta?.title},R)})}),onChange:A=>{f[j]=A.target.value,u(f[j],j,I)},children:[e.jsx(Ue,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(Ue,{value:R,children:e.jsx(ve,{blocklet:A,label:A.title||A.meta?.title})},R)})]})]})},customBodyRenderLite:f=>{const u=S[f],j=P(u.componentDid);return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(nt,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Ft,{blocklet:y,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f],{receivers:j}=u;return e.jsx(vt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):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:I=>{I.stopPropagation(),k(u),V("receivers")},children:j.map(I=>{const{receiverUser:A}=I,R=st(A.avatar,q,w);return e.jsx(Je,{alt:A.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(N,{onClick:j=>{j.stopPropagation(),k(u),V("statistics")},children:e.jsx(Ke,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const u=S[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(pt,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,Z[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:$e,fullWidth:!0,logic:je,display:(f,u,j,I)=>e.jsx(cs,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:I,filterValues:$e})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=S[f];return e.jsx(tt,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{T(u=>({...u,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(N,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(us,{isBreakpointsDownSm:i,children:e.jsx(Xe,{theme:l,children:e.jsx(Ze,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:Z,data:S,durable:J,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...p,onRowClick:(f,{dataIndex:u})=>{k(S[u])}},title:e.jsx(ze,{value:g.dateRange,onChange:oe}),customButtons:Ne,components:{TableFilterList:f=>e.jsx(We,{...f,itemComponent:u=>e.jsx(Me,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),L&&e.jsx(os,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const us=ae.div`
95
+ `;function ve({blocklet:t=null,label:s=""}){return e.jsx(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function cs(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ds({customTableButtons:t}){const{t:s,locale:n}=Y(),r=Qe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Ye(r,lt()),[r]),[b,m]=x.useState(!1),{data:S,paging:h,blocklet:y,fetch:v,getComponent:P,componentDids:F,inService:w,teamDid:q}=_e(),M=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),Z=`notification-records-${y.meta?.did}`,p=Et(Z),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),D=X(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),J=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=D.find(A=>(A.did||A.meta?.did)===u);return e.jsx(ve,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:D,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,I)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[j],renderValue:A=>e.jsx(N,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:A.map(R=>{if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const re=D.find(ne=>(ne.did||ne.meta?.did)===R);return e.jsx(ve,{blocklet:re,label:re?.title||re?.meta?.title},R)})}),onChange:A=>{f[j]=A.target.value,u(f[j],j,I)},children:[e.jsx(Ue,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(Ue,{value:R,children:e.jsx(ve,{blocklet:A,label:A.title||A.meta?.title})},R)})]})]})},customBodyRenderLite:f=>{const u=S[f],j=P(u.componentDid);return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(nt,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Ft,{blocklet:y,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f],{receivers:j}=u;return e.jsx(vt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):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:I=>{I.stopPropagation(),k(u),V("receivers")},children:j.map(I=>{const{receiverUser:A}=I,R=st(A.avatar,q,w);return e.jsx(Ze,{alt:A.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(N,{onClick:j=>{j.stopPropagation(),k(u),V("statistics")},children:e.jsx(Ke,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const u=S[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(pt,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,J[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:$e,fullWidth:!0,logic:je,display:(f,u,j,I)=>e.jsx(cs,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:I,filterValues:$e})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=S[f];return e.jsx(tt,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{T(u=>({...u,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(N,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(us,{isBreakpointsDownSm:i,children:e.jsx(Xe,{theme:l,children:e.jsx(Je,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:J,data:S,durable:Z,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...p,onRowClick:(f,{dataIndex:u})=>{k(S[u])}},title:e.jsx(ze,{value:g.dateRange,onChange:oe}),customButtons:Ne,components:{TableFilterList:f=>e.jsx(We,{...f,itemComponent:u=>e.jsx(Me,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),L&&e.jsx(os,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const us=ae.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }
@@ -1,4 +1,4 @@
1
- import{F as oT,G as $m,H as Xm,I as Zm}from"./vendor-hooks-cYMUGE4V.js";import{B as qm}from"./vendor-utils-drLlzTVq.js";import{g as jL,a as JL,r as QL}from"./vendor-react-CTtPmzVP.js";/*! *****************************************************************************
1
+ import{F as oT,G as $m,H as Xm,I as Zm}from"./vendor-hooks-qxhUUbW5.js";import{B as qm}from"./vendor-utils-CxWN1dT3.js";import{g as jL,a as JL,r as QL}from"./vendor-react-CTtPmzVP.js";/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1 +1 @@
1
- import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aT as a}from"./vendor-ux-DfSgTRg5.js";import{V as n}from"./index-BHa1_Bjz.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
1
+ import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aT as a}from"./vendor-ux-7TwTLXf8.js";import{V as n}from"./index-CGOBEhzW.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Dr30TSIK.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
@@ -1,4 +1,4 @@
1
- import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-core-DnR6WYuU.js";import{r as N}from"./vendor-react-CTtPmzVP.js";import{l as b,aM as H,V as W,m as V,k as P}from"./vendor-ux-DfSgTRg5.js";import{b0 as Q,bn as Y,bo as G,bp as O,k as J,bq as K,ae as U,a4 as X,aa as Z,a5 as C,a7 as ee}from"./index-BHa1_Bjz.js";import{ae as ne,Q as oe,I as te}from"./vendor-utils-drLlzTVq.js";import{a as ie}from"./vendor-hooks-cYMUGE4V.js";function L({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=N.isValidElement(t)?t:o.jsx("img",{src:t,alt:e});return o.jsxs(re,{...p,children:[o.jsxs("div",{children:[t&&o.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&o.jsx("div",{className:"footer-brand-name",children:e})]}),i&&o.jsx("div",{className:"footer-brand-desc",children:i})]})}L.propTypes={name:n.node,logo:n.node,description:n.string};const re=b("div")`
1
+ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-core-DnR6WYuU.js";import{r as N}from"./vendor-react-CTtPmzVP.js";import{l as b,aN as H,V as W,m as V,k as P}from"./vendor-ux-7TwTLXf8.js";import{b0 as Q,bn as Y,bo as G,bp as O,k as J,bq as K,ae as U,a4 as X,aa as Z,a5 as M,a7 as ee}from"./index-CGOBEhzW.js";import{ad as ne,Q as oe,I as te}from"./vendor-utils-CxWN1dT3.js";import{a as ie}from"./vendor-hooks-qxhUUbW5.js";function L({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=N.isValidElement(t)?t:o.jsx("img",{src:t,alt:e});return o.jsxs(re,{...p,children:[o.jsxs("div",{children:[t&&o.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&o.jsx("div",{className:"footer-brand-name",children:e})]}),i&&o.jsx("div",{className:"footer-brand-desc",children:i})]})}L.propTypes={name:n.node,logo:n.node,description:n.string};const re=b("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;
@@ -45,7 +45,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
45
45
  }
46
46
  }
47
47
  }
48
- `;function T({links:e=[],flowLayout:t=!1,minColumns:i=1,maxColumns:p=4,...c}){const[d,m]=N.useState(-1),x=Q({key:"md"}),j=e.some(s=>s.items?.length),h=!x&&j&&ne(i)&&i>1&&p>=i,w=h?Math.min(Math.max(e.length,i),p):1,g=({label:s,link:r,icon:l,render:a,props:u})=>{let k=s;if(a)k=a({label:s,link:r,props:u});else if(r&&oe(r)){const M=r.startsWith("http")||r.startsWith("//"),I=G(r)?{}:{target:M?"_blank":"_self",rel:M?"noreferrer noopener":void 0};k=o.jsx("a",{href:r,"aria-label":`Footer link for ${s}`,...I,...u,children:s})}return o.jsxs(o.Fragment,{children:[l&&o.jsx(O,{icon:l,size:20,sx:{mr:.5}}),k]})},$=ie(()=>e?.length?t?e.map((s,r)=>o.jsx("span",{className:"footer-links-item",children:g(s)},r)):h?Y(e,{columns:w}).map((s,r)=>o.jsx("div",{className:"footer-links-column",children:s.filter(l=>l.group).map((l,a)=>{const{items:u}=l;return o.jsxs("div",{className:"footer-links-group",children:[o.jsx("span",{className:"footer-links-item",children:g(l)}),!!u?.length&&o.jsx("div",{className:"footer-links-sub",children:u.map((k,M)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":k.isNew}),children:g(k)},M))})]},a)})},r)):e.map((s,r)=>{const{items:l}=s,a=r===d;return o.jsxs("div",{className:y("footer-links-group",{"footer-links-group--active":a}),onClick:()=>m(d===r?-1:r),children:[o.jsxs("span",{className:"footer-links-item",children:[g(s),!!l?.length&&o.jsx("span",{className:"footer-links-group-expand-icon",children:o.jsx(A,{style:{transform:`rotate(${a?180:0}deg)`}})})]}),!!l?.length&&o.jsx("div",{className:"footer-links-sub",children:l.map((u,k)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":u.isNew}),children:g(u)},k))})]},r)}):null,[e,t,h,d]);return e?.length?o.jsx(se,{columns:w,...c,className:y(c.className,{"footer-links--grouped":j,"footer-links--flow":t,"footer-links--columns":h}),children:o.jsx("div",{className:"footer-links-inner",children:$})}):null}T.propTypes={links:n.arrayOf(n.shape({label:n.string,link:n.string,render:n.func,props:n.object})),flowLayout:n.bool,minColumns:n.number,maxColumns:n.number};const se=b("div",{shouldForwardProp:e=>e!=="columns"})`
48
+ `;function T({links:e=[],flowLayout:t=!1,minColumns:i=1,maxColumns:p=4,...c}){const[d,m]=N.useState(-1),x=Q({key:"md"}),j=e.some(s=>s.items?.length),h=!x&&j&&ne(i)&&i>1&&p>=i,w=h?Math.min(Math.max(e.length,i),p):1,g=({label:s,link:r,icon:l,render:a,props:u})=>{let k=s;if(a)k=a({label:s,link:r,props:u});else if(r&&oe(r)){const C=r.startsWith("http")||r.startsWith("//"),I=G(r)?{}:{target:C?"_blank":"_self",rel:C?"noreferrer noopener":void 0};k=o.jsx("a",{href:r,"aria-label":`Footer link for ${s}`,...I,...u,children:s})}return o.jsxs(o.Fragment,{children:[l&&o.jsx(O,{icon:l,size:20,sx:{mr:.5}}),k]})},$=ie(()=>e?.length?t?e.map((s,r)=>o.jsx("span",{className:"footer-links-item",children:g(s)},r)):h?Y(e,{columns:w}).map((s,r)=>o.jsx("div",{className:"footer-links-column",children:s.filter(l=>l.group).map((l,a)=>{const{items:u}=l;return o.jsxs("div",{className:"footer-links-group",children:[o.jsx("span",{className:"footer-links-item",children:g(l)}),!!u?.length&&o.jsx("div",{className:"footer-links-sub",children:u.map((k,C)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":k.isNew}),children:g(k)},C))})]},a)})},r)):e.map((s,r)=>{const{items:l}=s,a=r===d;return o.jsxs("div",{className:y("footer-links-group",{"footer-links-group--active":a}),onClick:()=>m(d===r?-1:r),children:[o.jsxs("span",{className:"footer-links-item",children:[g(s),!!l?.length&&o.jsx("span",{className:"footer-links-group-expand-icon",children:o.jsx(A,{style:{transform:`rotate(${a?180:0}deg)`}})})]}),!!l?.length&&o.jsx("div",{className:"footer-links-sub",children:l.map((u,k)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":u.isNew}),children:g(u)},k))})]},r)}):null,[e,t,h,d]);return e?.length?o.jsx(se,{columns:w,...c,className:y(c.className,{"footer-links--grouped":j,"footer-links--flow":t,"footer-links--columns":h}),children:o.jsx("div",{className:"footer-links-inner",children:$})}):null}T.propTypes={links:n.arrayOf(n.shape({label:n.string,link:n.string,render:n.func,props:n.object})),flowLayout:n.bool,minColumns:n.number,maxColumns:n.number};const se=b("div",{shouldForwardProp:e=>e!=="columns"})`
49
49
  overflow: hidden;
50
50
  color: ${({theme:e})=>e.palette.text.secondary};
51
51
  .footer-links-inner {
@@ -263,7 +263,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
263
263
  flex-wrap: wrap;
264
264
  gap: 8px;
265
265
  }
266
- `,R=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:D},{name:"standard",support:()=>!0,component:_}],me=R.reduce((e,t)=>({...e,[t.name]:t}),{});function S({...e}){const{brand:t=null,navigation:i=null,socialMedia:p=null,copyright:c=null,links:d=null,layout:m="auto",...x}=e,j=()=>t?o.jsx(L,{...t}):null,h=()=>i?.length?o.jsx(T,{links:i,minColumns:3}):null,w=()=>p?.length?o.jsx(E,{items:p}):null,g=()=>{const l=c?.owner||t?.name;return l?o.jsx(F,{owner:l,year:c?.year||void 0}):null},$=()=>d?.length?o.jsx(T,{flowLayout:!0,links:d}):null,s={brand:j(),navigation:h(),socialMedia:w(),copyright:g(),links:$()};let r=null;if(m==="auto"?r=R.find(l=>l.support(s,e)).component:r=me[m]?.component,!r)throw new Error(`layout ${m} is not supported.`);return o.jsxs(f,{...x,className:y("blocklet__footer",x.className),sx:[{position:"relative"},...Array.isArray(x.sx)?x.sx:[x.sx]],children:[o.jsx(r,{elements:s,data:e}),o.jsx(f,{sx:{position:"absolute",right:16,bottom:0,fontSize:12,color:"transparent","::selection":{background:"#000",color:"#fff"}},children:window?.blocklet?.version})]})}S.propTypes={brand:n.shape({name:n.node,description:n.string,logo:n.node}),navigation:n.arrayOf(n.shape({label:n.node,link:n.string})),socialMedia:n.arrayOf(n.shape({icon:n.node,link:n.string})),copyright:n.shape({owner:n.string,year:n.oneOfType([n.string,n.number])}),links:n.arrayOf(n.shape({label:n.node,link:n.string})),layout:n.oneOf(["auto","standard","plain"])};function q({meta:e={},theme:t={},...i}){const{locale:p,defaultLocale:c}=W()||{},d=B(),m=N.useMemo(()=>{const a=Object.assign({},window.blocklet,e);try{return X(a)}catch(u){return console.error("Failed to format blocklet info",u,a),a}},[e]),x=N.useMemo(()=>V(d,t),[d,t]),j=Z({key:"xs",meta:e,theme:t});if(!m.appName)return null;const{appName:h,appDescription:w,description:g,copyright:$}=m,s=x.palette.background.default,r={footerNav:C({navigation:m?.navigation?.footer,locale:p,defaultLocale:c,section:"footer"})||[],socialMedia:C({navigation:m?.navigation?.social,locale:p,defaultLocale:c,section:"footer"})||[],links:C({navigation:m?.navigation?.bottom,locale:p,defaultLocale:c,section:"footer"})||[]},l={brand:{name:h,description:w||g,logo:j},navigation:ee(r.footerNav,a=>({...a,label:a.title,link:a.link}),"items"),copyright:$,socialMedia:r.socialMedia,links:r.links.map(a=>({...a,label:a.title}))};return o.jsx(P,{theme:x,children:o.jsx(fe,{...l,...te(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:U,theme:n.object};const fe=b(S)`
266
+ `,R=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:D},{name:"standard",support:()=>!0,component:_}],me=R.reduce((e,t)=>({...e,[t.name]:t}),{});function S({...e}){const{brand:t=null,navigation:i=null,socialMedia:p=null,copyright:c=null,links:d=null,layout:m="auto",...x}=e,j=()=>t?o.jsx(L,{...t}):null,h=()=>i?.length?o.jsx(T,{links:i,minColumns:3}):null,w=()=>p?.length?o.jsx(E,{items:p}):null,g=()=>{const l=c?.owner||t?.name;return l?o.jsx(F,{owner:l,year:c?.year||void 0}):null},$=()=>d?.length?o.jsx(T,{flowLayout:!0,links:d}):null,s={brand:j(),navigation:h(),socialMedia:w(),copyright:g(),links:$()};let r=null;if(m==="auto"?r=R.find(l=>l.support(s,e)).component:r=me[m]?.component,!r)throw new Error(`layout ${m} is not supported.`);return o.jsxs(f,{...x,className:y("blocklet__footer",x.className),sx:[{position:"relative"},...Array.isArray(x.sx)?x.sx:[x.sx]],children:[o.jsx(r,{elements:s,data:e}),o.jsx(f,{sx:{position:"absolute",right:16,bottom:0,fontSize:12,color:"transparent","::selection":{background:"#000",color:"#fff"}},children:window?.blocklet?.version})]})}S.propTypes={brand:n.shape({name:n.node,description:n.string,logo:n.node}),navigation:n.arrayOf(n.shape({label:n.node,link:n.string})),socialMedia:n.arrayOf(n.shape({icon:n.node,link:n.string})),copyright:n.shape({owner:n.string,year:n.oneOfType([n.string,n.number])}),links:n.arrayOf(n.shape({label:n.node,link:n.string})),layout:n.oneOf(["auto","standard","plain"])};function q({meta:e={},theme:t={},...i}){const{locale:p,defaultLocale:c}=W()||{},d=B(),m=N.useMemo(()=>{const a=Object.assign({},window.blocklet,e);try{return X(a)}catch(u){return console.error("Failed to format blocklet info",u,a),a}},[e]),x=N.useMemo(()=>V(d,t),[d,t]),j=Z({key:"xs",meta:e,theme:t});if(!m.appName)return null;const{appName:h,appDescription:w,description:g,copyright:$}=m,s=x.palette.background.default,r={footerNav:M({navigation:m?.navigation?.footer,locale:p,defaultLocale:c,section:"footer"})||[],socialMedia:M({navigation:m?.navigation?.social,locale:p,defaultLocale:c,section:"footer"})||[],links:M({navigation:m?.navigation?.bottom,locale:p,defaultLocale:c,section:"footer"})||[]},l={brand:{name:h,description:w||g,logo:j},navigation:ee(r.footerNav,a=>({...a,label:a.title,link:a.link}),"items"),copyright:$,socialMedia:r.socialMedia,links:r.links.map(a=>({...a,label:a.title}))};return o.jsx(P,{theme:x,children:o.jsx(fe,{...l,...te(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:U,theme:n.object};const fe=b(S)`
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};`}
@@ -1,4 +1,4 @@
1
- import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q as V}from"./vendor-hooks-cYMUGE4V.js";import{j as e,ak as t,at as $,b6 as Y,a6 as E,aZ as He,am as G,br as Ge,U as Ye,T as B,a3 as Ke,W as S,z as O,M as J,I as W,dZ as ge,bi as ye,A as Ze,x as Ve,cs as Je,ct as ee,ca as Qe,F as Xe,bZ as es,s as ss}from"./vendor-mui-core-DnR6WYuU.js";import{V as A,aJ as _,aW as ts,aO as ae,b1 as se,H as D,w as N,aN as re,bp as je,q as ve,aU as as,b8 as rs}from"./vendor-ux-DfSgTRg5.js";import{Z as P,C as os,Q as be,c as M,G as X,Y as ns,q as is,J as ls,e as Z,ck as cs}from"./index-BHa1_Bjz.js";import{W as oe}from"./did-address-DqhneWXa.js";import{b as z}from"./team-DNuHMrzV.js";import{r as ne,a as ie,b as le,c as Se,d as Q,e as ds,u as ps,f as us}from"./passport-item-Dx140DTL.js";import{p as Ce}from"./util-CVjlaHo_.js";import{u as ms}from"./use-mobile-BINJTzMb.js";import{v as H}from"./index-CHuKoofS.js";import{w as q,P as fs}from"./permission-HtrJm1h2.js";import{C as xs}from"./Google-Cwpw9PRe.js";import{c as hs}from"./create-passport-svg-BQhmIwWD.js";import{A as gs}from"./vendor-arcblock-CPCSE54a.js";import{G as K,az as ys}from"./vendor-utils-drLlzTVq.js";import{e as we}from"./edit.svg-RRSklUg-.js";import{H as ce,b as js}from"./index-SCaAOhtj.js";import{C as Te}from"./confirm-DTx9f3Ke.js";import{L as Ie}from"./list-header-Cl3jykCe.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-Cm8j8XeZ.js";import"./isURL-CASPeQFe.js";import"./use-app-logo-CZWb8lrs.js";import"./ua-parser-DP5omx3I.js";import"./base32-CXgP3JJ5.js";import"./cloneDeep-BbaR0xRl.js";import"./lock.svg-BgybwZNe.js";const me="info";function De({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=Ue({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(Pe,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Ae,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Le,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(_,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(bs,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ts,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}De.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const bs=$(t)`
1
+ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q as V}from"./vendor-hooks-qxhUUbW5.js";import{j as e,ak as t,at as $,b6 as K,a6 as E,aZ as He,am as G,br as Ge,U as Ke,T as B,a3 as Ye,W as S,z as O,M as J,I as W,dZ as ge,bi as ye,A as Ze,x as Ve,cs as Je,ct as ee,ca as Qe,F as Xe,bZ as es,s as ss}from"./vendor-mui-core-DnR6WYuU.js";import{V as A,aK as _,aW as ts,aO as ae,b1 as se,H as D,w as N,at as re,bp as je,q as ve,aU as as,b8 as rs}from"./vendor-ux-7TwTLXf8.js";import{Z as P,C as os,Q as be,c as M,G as X,Y as ns,q as is,J as ls,e as Z,ck as cs}from"./index-CGOBEhzW.js";import{W as oe}from"./did-address-cHTriZHu.js";import{b as z}from"./team-DHhtcW5C.js";import{r as ne,a as ie,b as le,c as Se,d as Q,e as ds,u as ps,f as us}from"./passport-item-DD8VG51j.js";import{p as Ce}from"./util-D9UZY2ZN.js";import{u as ms}from"./use-mobile-BINJTzMb.js";import{v as H}from"./index-HU-v7OeI.js";import{w as q,P as fs}from"./permission-B3ddwA-4.js";import{C as xs}from"./Google-D9N2NN29.js";import{c as hs}from"./create-passport-svg-BJX-WFnl.js";import{A as gs}from"./vendor-arcblock-Dr30TSIK.js";import{G as Y,ay as ys}from"./vendor-utils-CxWN1dT3.js";import{e as we}from"./edit.svg-RRSklUg-.js";import{H as ce,b as js}from"./index-B1-cYl7K.js";import{C as Te}from"./confirm-BSaTCzrs.js";import{L as Ie}from"./list-header-Cl3jykCe.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-vM0SwFQZ.js";import"./isURL-CJrtALFi.js";import"./use-app-logo-DSdF3M62.js";import"./ua-parser-DP5omx3I.js";import"./base32-BccrNIeO.js";import"./cloneDeep-C2rlAYcK.js";import"./lock.svg-BgybwZNe.js";const me="info";function De({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=Ue({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(Pe,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Ae,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Le,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(_,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(bs,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ts,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}De.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const bs=$(t)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -9,7 +9,7 @@ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q
9
9
  .body {
10
10
  margin-top: 24px;
11
11
  }
12
- `;function Pe({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=ms(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ye,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:Q(s.source)}]}];return e.jsxs(Ss,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Ce(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(B,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ke,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(B,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}Pe.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Ss=$(Y)`
12
+ `;function Pe({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=ms(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ke,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:Q(s.source)}]}];return e.jsxs(Ss,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Ce(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(B,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ye,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(B,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}Pe.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Ss=$(K)`
13
13
  .info-card {
14
14
  margin-bottom: 24px;
15
15
  overflow: hidden;
@@ -87,7 +87,7 @@ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q
87
87
  margin: 0;
88
88
  }
89
89
  }
90
- `,ke=10,Re=1;function Ae({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=v.useState({pageSize:ke,page:Re}),{data:l,loading:r}=V(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=v.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=v.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ds(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(Ge,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>os(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},T={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:T,loading:r,onChange:g})})}Ae.propTypes={passport:S.object.isRequired};function Le({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=v.useState({pageSize:ke,page:Re}),{data:r,loading:n}=V(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=v.useMemo(()=>r?.passports||[],[r?.passports]),m=v.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>Se(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:Q}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(b=>({...b,pageSize:o,page:1})):d.page!==a+1&&l(b=>({...b,page:a+1}))},T=v.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},b){if(T.current?.contains(b.target)){const j=h[o];s(j)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsxs(Y,{spacing:1,children:[e.jsx(He,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:T,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Le.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=ns(),{t:f}=A(),[i,d]=v.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?gs(u.appDid):l,[n,h]=v.useState(r),m=async()=>{const g=[{key:ls.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(T){D.error(T.message)}finally{d(!1)}};return e.jsx(_,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(E,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(xs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:hs({scope:"passport",role:"owner",title:"Owner",issuer:is.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Cs=q(de,"mutate_team"),ws=q(de,"",X);function Ts(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Cs,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Ne=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Ne.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Is=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function ze({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=v.useState(!1),[h,m]=v.useState(p.issuerDid||""),[g,T]=v.useState(p.remark||""),[x,a]=v.useState(K(p.mappings)||[]),o=u.findIndex(j=>j.issuerDid===p.issuerDid),b=async()=>{if(r)return;const j={issuerDid:h,remark:g,mappings:x.map(w=>({...w,to:{...w.to,ttl:w.to.ttl||0}}))},C=[...u];o===-1?C.unshift(j):C[o]=j;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await Z(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(w){n(!1),D.error(te(w))}};return e.jsx(_,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(W,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>b(),color:"primary",disabled:!Is(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(E,{size:16}),l("common.save")]})]}),children:e.jsx(Ds,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:j=>{m(j.target.value)}}),e.jsx(O,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:j=>{T(j.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(j=>{const C=[...j];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((j,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:j.from.passport,onChange:w=>{const{value:k}=w.target;a(L=>{const U=[...L];return U[C].from.passport=k,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Ne,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:w=>{a(k=>{const L=[...k];return L[C].to.role=w.target.value,L})},variant:"outlined",children:i.filter(w=>w.name!=="owner").map(w=>e.jsx(J,{value:w.name,"data-cy":`passport-mapping-select-option-${w.name}`,children:e.jsx("span",{children:w.title||w.name})},w.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(W,{onClick:()=>{a(w=>{const k=[...w];return k.splice(C,1),k})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ds=$.div`
90
+ `,ke=10,Re=1;function Ae({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=v.useState({pageSize:ke,page:Re}),{data:l,loading:r}=V(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=v.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=v.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ds(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(Ge,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>os(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},T={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:T,loading:r,onChange:g})})}Ae.propTypes={passport:S.object.isRequired};function Le({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=v.useState({pageSize:ke,page:Re}),{data:r,loading:n}=V(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=v.useMemo(()=>r?.passports||[],[r?.passports]),m=v.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>Se(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:Q}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(b=>({...b,pageSize:o,page:1})):d.page!==a+1&&l(b=>({...b,page:a+1}))},T=v.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},b){if(T.current?.contains(b.target)){const j=h[o];s(j)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsxs(K,{spacing:1,children:[e.jsx(He,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:T,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Le.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=ns(),{t:f}=A(),[i,d]=v.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?gs(u.appDid):l,[n,h]=v.useState(r),m=async()=>{const g=[{key:ls.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(T){D.error(T.message)}finally{d(!1)}};return e.jsx(_,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(E,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(xs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:hs({scope:"passport",role:"owner",title:"Owner",issuer:is.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Cs=q(de,"mutate_team"),ws=q(de,"",X);function Ts(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Cs,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Ne=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Ne.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Is=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function ze({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=v.useState(!1),[h,m]=v.useState(p.issuerDid||""),[g,T]=v.useState(p.remark||""),[x,a]=v.useState(Y(p.mappings)||[]),o=u.findIndex(j=>j.issuerDid===p.issuerDid),b=async()=>{if(r)return;const j={issuerDid:h,remark:g,mappings:x.map(w=>({...w,to:{...w.to,ttl:w.to.ttl||0}}))},C=[...u];o===-1?C.unshift(j):C[o]=j;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await Z(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(w){n(!1),D.error(te(w))}};return e.jsx(_,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(W,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>b(),color:"primary",disabled:!Is(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(E,{size:16}),l("common.save")]})]}),children:e.jsx(Ds,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:j=>{m(j.target.value)}}),e.jsx(O,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:j=>{T(j.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(j=>{const C=[...j];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((j,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:j.from.passport,onChange:w=>{const{value:k}=w.target;a(L=>{const U=[...L];return U[C].from.passport=k,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Ne,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:w=>{a(k=>{const L=[...k];return L[C].to.role=w.target.value,L})},variant:"outlined",children:i.filter(w=>w.name!=="owner").map(w=>e.jsx(J,{value:w.name,"data-cy":`passport-mapping-select-option-${w.name}`,children:e.jsx("span",{children:w.title||w.name})},w.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(W,{onClick:()=>{a(w=>{const k=[...w];return k.splice(C,1),k})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ds=$.div`
91
91
  .dialog-h1 {
92
92
  font-size: 18px;
93
93
  }
@@ -99,7 +99,7 @@ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q
99
99
  }
100
100
  }
101
101
  }
102
- `;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=v.useState(null),[r,n]=v.useState(!1),[h,m]=v.useState(!1),[g,T]=v.useState(""),x=async o=>{if(r)return;const b=f.findIndex(C=>C.issuerDid===o);b===-1&&D.error("Cannot find passports");const j=[...f];j.splice(b,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:j}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(_,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(As,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(Ie,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ve.toAddress(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(W,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(we,{})}),e.jsx(W,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{mode:h.mode,data:h.data,trustedPassports:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Ps=q(pe,"mutate_team"),ks=q(pe,"",X);function Rs(c){const{inService:s}=P();return s?e.jsx(ks,{...c}):e.jsx(Ps,{...c})}const As=$.div`
102
+ `;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=v.useState(null),[r,n]=v.useState(!1),[h,m]=v.useState(!1),[g,T]=v.useState(""),x=async o=>{if(r)return;const b=f.findIndex(C=>C.issuerDid===o);b===-1&&D.error("Cannot find passports");const j=[...f];j.splice(b,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:j}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(_,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(As,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(Ie,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ve.toAddress(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(W,{onClick:()=>m({mode:"update",data:Y(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(we,{})}),e.jsx(W,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{mode:h.mode,data:h.data,trustedPassports:Y(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Ps=q(pe,"mutate_team"),ks=q(pe,"",X);function Rs(c){const{inService:s}=P();return s?e.jsx(ks,{...c}):e.jsx(Ps,{...c})}const As=$.div`
103
103
  .list {
104
104
  .MuiIconButton-root {
105
105
  svg {
@@ -119,7 +119,7 @@ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q
119
119
  }
120
120
  }
121
121
  }
122
- `;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=v.useState(null),[r,n]=v.useState(!1),[h,m]=v.useState(null),[g,T]=v.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(b=>b.factoryAddress!==o)}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(b){n(!1),D.error(b.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(_,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Bs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(Ie,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(as,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(W,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(we,{})}),e.jsx(W,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ee,{data:h.data,trustedFactories:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const zs=q(ue,"mutate_team"),Es=q(ue,"",X);function Fs(c){const{inService:s}=P();return s?e.jsx(Es,{...c}):e.jsx(zs,{...c})}const Bs=$.div`
122
+ `;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=v.useState(null),[r,n]=v.useState(!1),[h,m]=v.useState(null),[g,T]=v.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(b=>b.factoryAddress!==o)}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(b){n(!1),D.error(b.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(_,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Bs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(Ie,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(as,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(W,{onClick:()=>m({mode:"update",data:Y(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(we,{})}),e.jsx(W,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ee,{data:h.data,trustedFactories:Y(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const zs=q(ue,"mutate_team"),Es=q(ue,"",X);function Fs(c){const{inService:s}=P();return s?e.jsx(Es,{...c}):e.jsx(zs,{...c})}const Bs=$.div`
123
123
  .list {
124
124
  .MuiIconButton-root {
125
125
  svg {
@@ -127,7 +127,7 @@ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q
127
127
  }
128
128
  }
129
129
  }
130
- `;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=v.useState(!1),[h,m]=v.useState(!1),[g,T]=v.useState(!1),[x,a]=v.useState(!1),[o,b]=v.useState(!1),j=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await Z(800),D.success(s("common.configSuccess"))}catch(w){D.error(w.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(fs,{permission:u?"":"mutate_team",role:u?X:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>T(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(E,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{b(!0)},children:s("team.passport.view")})})}),h&&e.jsx(Rs,{onCancel:()=>m(!1)}),g&&e.jsx(Fs,{onCancel:()=>T(!1)}),r&&e.jsx(Ts,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(_,{open:!0,maxWidth:"lg",onClose:()=>b(!1),onBackdropClick:()=>b(!1),onEscapeKeyDown:()=>b(!1),title:s("team.passport.view"),children:e.jsx(js,{createPassportSvg:c,onCancel:()=>b(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Be=qe.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Ce(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Be.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Os({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=ps(),{inService:d}=P(),[l,r]=v.useState(!1),n=`passports-${p}`,h=rs(n),[m,g]=v.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:T,loading:x}=V(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=V(async()=>{const y={};m.role!==xe&&(y.role=m.role),m.status&&(y.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:y,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:y=>D.error(y.message)}),b=y=>T?.find(R=>R.key===y)?.value||0,j=v.useMemo(()=>Object.keys(i).map(y=>({name:y,title:i[y],num:b(y)})),[T,b]),C=v.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Be,{createPassportSvg:c,passport:R,teamDid:p}),e.jsx(t,{children:ne(R.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:y=>ie(y,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:y=>Se(y,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:us}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return R.parentDid?Q("recover"):Q(R.source)}}}],[u,f,a?.passports,p,c,d]),w=y=>{g(I=>({...I,role:y,page:1}))},k=({page:y,rowsPerPage:I,searchText:R})=>{m.pageSize!==I?g(F=>({...F,searchText:"",pageSize:I,page:1})):m.page!==y+1?g(F=>({...F,searchText:"",page:y+1})):m.searchText!==R&&g(F=>({...F,searchText:R,page:1}))},L=v.useRef(null),U=a?.passports||[],Oe=m.searchText?U.filter(y=>y.id.includes(m.searchText)||(y?.user?.fullName||"").includes(m.searchText)):U,Me={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(y,{dataIndex:I},R){if(L.current?.contains(R.target)){const F=a?.passports[I];r(F)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},We=y=>{g(I=>({...I,status:y.target.value,page:1}))},_e=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(es,{size:"small",value:m.status,onChange:We,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(J,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(y=>e.jsx(J,{value:y,sx:{py:1},children:u(`team.passport.statusMap.${y}`)},y))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsxs(Ms,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:j.map(y=>e.jsxs(t,{className:`tab ${m.role===y.name?"active":""}`,onClick:()=>w(y.name),children:[e.jsx("span",{className:"text",children:y.title}),e.jsx(t,{sx:{color:"text.secondary"},children:y.num})]},y.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Oe,columns:C,options:Me,loading:o,onChange:k,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:_e})})]}),l&&e.jsx(De,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Os.propTypes={createPassportSvg:S.func.isRequired};const Ms=ss(t)`
130
+ `;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=v.useState(!1),[h,m]=v.useState(!1),[g,T]=v.useState(!1),[x,a]=v.useState(!1),[o,b]=v.useState(!1),j=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await Z(800),D.success(s("common.configSuccess"))}catch(w){D.error(w.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(fs,{permission:u?"":"mutate_team",role:u?X:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>T(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(E,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{b(!0)},children:s("team.passport.view")})})}),h&&e.jsx(Rs,{onCancel:()=>m(!1)}),g&&e.jsx(Fs,{onCancel:()=>T(!1)}),r&&e.jsx(Ts,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(_,{open:!0,maxWidth:"lg",onClose:()=>b(!1),onBackdropClick:()=>b(!1),onEscapeKeyDown:()=>b(!1),title:s("team.passport.view"),children:e.jsx(js,{createPassportSvg:c,onCancel:()=>b(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Be=qe.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Ce(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Be.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Os({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=ps(),{inService:d}=P(),[l,r]=v.useState(!1),n=`passports-${p}`,h=rs(n),[m,g]=v.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:T,loading:x}=V(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=V(async()=>{const y={};m.role!==xe&&(y.role=m.role),m.status&&(y.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:y,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:y=>D.error(y.message)}),b=y=>T?.find(R=>R.key===y)?.value||0,j=v.useMemo(()=>Object.keys(i).map(y=>({name:y,title:i[y],num:b(y)})),[T,b]),C=v.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Be,{createPassportSvg:c,passport:R,teamDid:p}),e.jsx(t,{children:ne(R.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:y=>ie(y,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:y=>Se(y,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:us}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return R.parentDid?Q("recover"):Q(R.source)}}}],[u,f,a?.passports,p,c,d]),w=y=>{g(I=>({...I,role:y,page:1}))},k=({page:y,rowsPerPage:I,searchText:R})=>{m.pageSize!==I?g(F=>({...F,searchText:"",pageSize:I,page:1})):m.page!==y+1?g(F=>({...F,searchText:"",page:y+1})):m.searchText!==R&&g(F=>({...F,searchText:R,page:1}))},L=v.useRef(null),U=a?.passports||[],Oe=m.searchText?U.filter(y=>y.id.includes(m.searchText)||(y?.user?.fullName||"").includes(m.searchText)):U,Me={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(y,{dataIndex:I},R){if(L.current?.contains(R.target)){const F=a?.passports[I];r(F)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},We=y=>{g(I=>({...I,status:y.target.value,page:1}))},_e=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(es,{size:"small",value:m.status,onChange:We,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(J,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(y=>e.jsx(J,{value:y,sx:{py:1},children:u(`team.passport.statusMap.${y}`)},y))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsxs(Ms,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:j.map(y=>e.jsxs(t,{className:`tab ${m.role===y.name?"active":""}`,onClick:()=>w(y.name),children:[e.jsx("span",{className:"text",children:y.title}),e.jsx(t,{sx:{color:"text.secondary"},children:y.num})]},y.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Oe,columns:C,options:Me,loading:o,onChange:k,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:_e})})]}),l&&e.jsx(De,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Os.propTypes={createPassportSvg:S.func.isRequired};const Ms=ss(t)`
131
131
  .main {
132
132
  .left {
133
133
  width: 256px;
@@ -1,4 +1,4 @@
1
- import{M as m,j as e,Q as c,b0 as B,P as C,ai as E,o as I,bV as P,O as z}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{n as A}from"./vendor-utils-drLlzTVq.js";import{l as p}from"./vendor-ux-DfSgTRg5.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:g})})})})]})}L.Item=m;const v=p(P)`
1
+ import{M as m,j as e,Q as c,b0 as B,P as C,ai as E,o as I,bV as P,O as z}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{n as A}from"./vendor-utils-CxWN1dT3.js";import{l as p}from"./vendor-ux-7TwTLXf8.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:g})})})})]})}L.Item=m;const v=p(P)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1 +1 @@
1
- import{j as i,bX as e,bn as a,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{l}from"./vendor-ux-DfSgTRg5.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
1
+ import{j as i,bX as e,bn as a,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{l}from"./vendor-ux-7TwTLXf8.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};