@abtnode/blocklet-services 1.16.47-beta-20250721-130532-61549a96 → 1.16.47-beta-20250724-080141-d80ab374

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 (283) hide show
  1. package/api/index.js +3 -0
  2. package/api/libs/image.js +5 -1
  3. package/api/routes/access-key.js +59 -0
  4. package/api/routes/oauth/client.js +9 -0
  5. package/api/services/auth/session.js +14 -11
  6. package/api/util/attach-shared-utils.js +11 -8
  7. package/dist/assets/{AdapterDayjs-Dc_cn1Wv.js → AdapterDayjs-DJ-f1i8A.js} +1 -1
  8. package/dist/assets/{Google-BYGsR9Bd.js → Google-BvsSmJCS.js} +3 -3
  9. package/dist/assets/{access-control-oCszV5zC.js → access-control-DgyeLhBf.js} +1 -1
  10. package/dist/assets/actions-CRUvIBLz.js +1 -0
  11. package/dist/assets/{add-component-core-GYYnyhPI.js → add-component-core-CshRctcL.js} +29 -29
  12. package/dist/assets/add-resource-C6AR_ENP.js +1 -0
  13. package/dist/assets/{addon-m7dEcFSm.js → addon-Cioeq7ZM.js} +1 -1
  14. package/dist/assets/{advanced-BhS7b_np.js → advanced-DF-eCD_V.js} +3 -3
  15. package/dist/assets/aigne-DPVDIAAv.js +10 -0
  16. package/dist/assets/api-BfIB6faS.js +1 -0
  17. package/dist/assets/appearance-CL1LSpJB.js +1 -0
  18. package/dist/assets/ar-CcCysAXs.js +7 -0
  19. package/dist/assets/ar-VhkYkk5Z.js +1 -0
  20. package/dist/assets/{arrow-down.svg-6steA5un.js → arrow-down.svg-B9dO_KDq.js} +1 -1
  21. package/dist/assets/{audit-logs-gbfUafHi.js → audit-logs-EC_F2BOT.js} +2 -2
  22. package/dist/assets/{authorize-Bfey1QAy.js → authorize-DgLJOPDK.js} +1 -1
  23. package/dist/assets/{base-chart-u6OIGONc.js → base-chart-2nBOSo9s.js} +1 -1
  24. package/dist/assets/{base32-DBDFptL1.js → base32-TX5fATAF.js} +1 -1
  25. package/dist/assets/branding-7KMxNl9d.js +44 -0
  26. package/dist/assets/{branding-itFeNCQ6.js → branding-B6_aWuFR.js} +2 -2
  27. package/dist/assets/{bundle-avatar-DkLBEfff.js → bundle-avatar-BPnP6pIL.js} +1 -1
  28. package/dist/assets/button-CEiQto3g.js +1 -0
  29. package/dist/assets/{click-to-copy-m7BzOuWH.js → click-to-copy-BqGY_Kr7.js} +1 -1
  30. package/dist/assets/{cloneDeep-BpNWeRQ9.js → cloneDeep-CKVXBkcT.js} +1 -1
  31. package/dist/assets/{collapse-DfvukfIl.js → collapse-jk2ONGPl.js} +1 -1
  32. package/dist/assets/{complete-B4B7REuC.js → complete-zgzlWGY3.js} +4 -4
  33. package/dist/assets/{component-DMzCzNlm.js → component-BiE6SG5y.js} +63 -63
  34. package/dist/assets/{config-D-z5vAfP.js → config-Bra9VdE1.js} +2 -2
  35. package/dist/assets/config-CPpGYWww.js +28 -0
  36. package/dist/assets/{config-D3XTFUmZ.js → config-W_iStCFi.js} +1 -1
  37. package/dist/assets/{config-navigation-CfGhB5-E.js → config-navigation-D63aLfma.js} +9 -9
  38. package/dist/assets/config-space-DFnzGBOV.js +1 -0
  39. package/dist/assets/{confirm-B4BzkG04.js → confirm-5JMMSGdh.js} +1 -1
  40. package/dist/assets/{connect-JlblxSAY.js → connect-55nmllvA.js} +1 -1
  41. package/dist/assets/connect-Cph9RbRv.js +1 -0
  42. package/dist/assets/connect-to-CvyIrlXc.js +1 -0
  43. package/dist/assets/{content-layout-BaDbLmL5.js → content-layout-Mn94hzXe.js} +1 -1
  44. package/dist/assets/{createClass-g8bSPTyV.js → createClass-Ig9AWyIK.js} +1 -1
  45. package/dist/assets/{dashboard-CBpVHcLw.js → dashboard-BXgUTFa6.js} +8 -8
  46. package/dist/assets/de-BTXwRUYy.js +7 -0
  47. package/dist/assets/de-BYci0FoU.js +1 -0
  48. package/dist/assets/{delete-confirm-DhfRzwF1.js → delete-confirm-saPgrAIL.js} +1 -1
  49. package/dist/assets/{did-address-CdYAzzjR.js → did-address-D4l1uYd1.js} +1 -1
  50. package/dist/assets/domain-ClY1yq1j.js +9 -0
  51. package/dist/assets/domain-action-card-Ds6lQa7Z.js +28 -0
  52. package/dist/assets/domains-C_XAIIRT.js +1 -0
  53. package/dist/assets/{dot-OPeVWPUi.js → dot-BOuza8rS.js} +1 -1
  54. package/dist/assets/{email-BTKvn_fl.js → email-D07y9XJo.js} +1 -1
  55. package/dist/assets/empty-DhZfJeme.js +1 -0
  56. package/dist/assets/{empty-spinner-C6wgiyAQ.js → empty-spinner-D_3bEG2p.js} +1 -1
  57. package/dist/assets/engine-Bm7Qp-7f.js +1 -0
  58. package/dist/assets/es-1PoIOrwC.js +1 -0
  59. package/dist/assets/es-DCyLy_vM.js +9 -0
  60. package/dist/assets/{exchange-passport-B-9fNsX9.js → exchange-passport-B0LodWCE.js} +1 -1
  61. package/dist/assets/{form-BX4g8soo.js → form-D55muuDj.js} +1 -1
  62. package/dist/assets/form-text-input-BHd2ybwR.js +11 -0
  63. package/dist/assets/form-wrapper-DuJOKczF.js +99 -0
  64. package/dist/assets/fr-CNGOyo0v.js +7 -0
  65. package/dist/assets/fr-m47FzEWr.js +1 -0
  66. package/dist/assets/{fuel-DYTqXaPb.js → fuel-CYEtfdZk.js} +1 -1
  67. package/dist/assets/gen-access-key-BDWXKS6s.js +1 -0
  68. package/dist/assets/gen-simple-access-key-C-Aym19M.js +1 -0
  69. package/dist/assets/get-safe-url-CZlaSf1L.js +1 -0
  70. package/dist/assets/hi-Dcj1EDTy.js +1 -0
  71. package/dist/assets/hi-DsFnKfzk.js +5 -0
  72. package/dist/assets/{home-BL8xoBlc.js → home-CAJwSYRb.js} +1 -1
  73. package/dist/assets/id-CsK9Cnbo.js +7 -0
  74. package/dist/assets/id-UvUReF_3.js +1 -0
  75. package/dist/assets/{iframe-BTaRNGRY.js → iframe-DCdtoFjc.js} +1 -1
  76. package/dist/assets/{index-lf4wyjkd.js → index-1WiLWIAu.js} +6 -6
  77. package/dist/assets/index-B0pGy8t9.js +55 -0
  78. package/dist/assets/{index-D3qROm47.js → index-B36DERG2.js} +1 -1
  79. package/dist/assets/{index-BC395sak.js → index-B5_zLKFf.js} +1 -1
  80. package/dist/assets/index-BCWYWGPf.js +124 -0
  81. package/dist/assets/{index-CgCJ2qDh.js → index-BGoUXEmc.js} +88 -88
  82. package/dist/assets/{index-DseoFU10.js → index-BL2NEiva.js} +1 -1
  83. package/dist/assets/index-BSJbc4Ic.js +1 -0
  84. package/dist/assets/{index-DjKmasIZ.js → index-B_CAM-3t.js} +2 -2
  85. package/dist/assets/{index-Dy8syryD.js → index-BmCyA4MW.js} +3 -3
  86. package/dist/assets/index-Bzde7Bh8.js +113 -0
  87. package/dist/assets/{index-DyH1BrER.js → index-C7DDH7Uf.js} +10 -10
  88. package/dist/assets/{index-EIX4798q.js → index-C80MI1u_.js} +1 -1
  89. package/dist/assets/index-C8T12jiJ.js +1 -0
  90. package/dist/assets/{index-BaBIefeb.js → index-CGngFFes.js} +1 -1
  91. package/dist/assets/{index-CW67obch.js → index-CRFxmuV0.js} +1 -1
  92. package/dist/assets/index-CZXuMAQy.js +242 -0
  93. package/dist/assets/index-Ce_ilge5.js +271 -0
  94. package/dist/assets/index-CtENECgD.js +11 -0
  95. package/dist/assets/index-Cycplgtw.js +4 -0
  96. package/dist/assets/{index-DUnVGFh6.js → index-CzttGWll.js} +1 -1
  97. package/dist/assets/{index-BUJ5QfC4.js → index-D2MS4PNu.js} +6 -6
  98. package/dist/assets/{index-C-AuC2Mk.js → index-D3pV4Lj0.js} +1 -1
  99. package/dist/assets/{index-DcwzA8G_.js → index-DLHMwUmK.js} +1 -1
  100. package/dist/assets/{index-LvmCZD51.js → index-DpP3MEz0.js} +3 -3
  101. package/dist/assets/{index-D6kePAD5.js → index-DwEMr0X-.js} +6 -6
  102. package/dist/assets/{index-Cbxz8oHT.js → index-ElG08lIx.js} +1 -1
  103. package/dist/assets/{index-cCGBx0sL.js → index-Ft5IyfHH.js} +10 -10
  104. package/dist/assets/{index-D_5DFMMK.js → index-JVicMopH.js} +1 -1
  105. package/dist/assets/{index-SrN5SE_r.js → index-NVKZ_ZUS.js} +1 -1
  106. package/dist/assets/{index-Bo2cFOuR.js → index-UTcxT75j.js} +1 -1
  107. package/dist/assets/index-iY8rmPEZ.js +7 -0
  108. package/dist/assets/{invitation-CC5hPf7T.js → invitation-BEd7MxhL.js} +3 -3
  109. package/dist/assets/{invite-CreQ98MA.js → invite-C2gqMFFc.js} +1 -1
  110. package/dist/assets/isURL-sHTYO46x.js +2 -0
  111. package/dist/assets/{issue-passport-CIYcm6iB.js → issue-passport-ZvHPiNMo.js} +1 -1
  112. package/dist/assets/item-BlUr7rKO.js +1 -0
  113. package/dist/assets/ja-Cw02X6OV.js +1 -0
  114. package/dist/assets/ja-bb6qPt27.js +9 -0
  115. package/dist/assets/ko-DZSgmgs9.js +1 -0
  116. package/dist/assets/ko-DxiDEd1I.js +9 -0
  117. package/dist/assets/{landing-page-DOi_4Ca6.js → landing-page-CTjTjqyj.js} +1 -1
  118. package/dist/assets/{launch-result-message-Dwnqr8Lq.js → launch-result-message-3VxQH2Cy.js} +1 -1
  119. package/dist/assets/{layout-CIen07bA.js → layout-YAJmqZE8.js} +1 -1
  120. package/dist/assets/list-Bty_q29b.js +2 -0
  121. package/dist/assets/{list-B8ZhwNC1.js → list-Y-a4PO0u.js} +2 -2
  122. package/dist/assets/{list-header-CGX6Hi0X.js → list-header-DLhxtl5g.js} +1 -1
  123. package/dist/assets/localization-Bd37mWlD.js +1 -0
  124. package/dist/assets/{log-C9DU0cCG.js → log-B9tZ4qc6.js} +1 -1
  125. package/dist/assets/logger-MT1V7vOw.js +1 -0
  126. package/dist/assets/login-D-903-kb.js +1 -0
  127. package/dist/assets/{login-oauth-callback-C2SqP1bW.js → login-oauth-callback-B8e--CGo.js} +1 -1
  128. package/dist/assets/logo-uploader-BDvl-p1h.js +30 -0
  129. package/dist/assets/lost-passport-C-bcfQGt.js +168 -0
  130. package/dist/assets/observability-hUM5rYTW.js +1 -0
  131. package/dist/assets/{omit-CxEI1_wm.js → omit-CXy6Rymi.js} +1 -1
  132. package/dist/assets/{open-window-RuAUils2.js → open-window-BeKV58_Y.js} +1 -1
  133. package/dist/assets/{over-due-invoice-payment-DhK6jNNQ.js → over-due-invoice-payment-YS7NZYQD.js} +1 -1
  134. package/dist/assets/{overview-BVSh5o7h.js → overview-re3EXfMP.js} +3 -3
  135. package/dist/assets/{page-header-BycH8S9r.js → page-header-DMbjH45Q.js} +1 -1
  136. package/dist/assets/{passport-item-D7sQ_FxN.js → passport-item-8olNdxYA.js} +1 -1
  137. package/dist/assets/{permission-C79TpiNV.js → permission-D-kAjshH.js} +1 -1
  138. package/dist/assets/playground-wmO_IQQj.js +1 -0
  139. package/dist/assets/preferences-Blutv5lP.js +1 -0
  140. package/dist/assets/profile-embed-BOKrgfV5.js +1 -0
  141. package/dist/assets/pt-Yj5llJx7.js +5 -0
  142. package/dist/assets/pt-fKCXneeH.js +1 -0
  143. package/dist/assets/publish-resource-D_O5YA9z.js +1 -0
  144. package/dist/assets/{react-beautiful-dnd.esm-DwkY3sYg.js → react-beautiful-dnd.esm-D2jtRKWT.js} +1 -1
  145. package/dist/assets/{react-stripe.esm-BGPt6Wk8.js → react-stripe.esm-OZTdjjoB.js} +1 -1
  146. package/dist/assets/required-BE3i31mZ.js +6 -0
  147. package/dist/assets/ru-D59vFs72.js +1 -0
  148. package/dist/assets/ru-DaVu35Yr.js +5 -0
  149. package/dist/assets/runtime-BPzGyz-O.js +1 -0
  150. package/dist/assets/{sanitize-DSvGhymV.js → sanitize-DTRB99ZZ.js} +1 -1
  151. package/dist/assets/sdk-C6BkT6-0.js +1 -0
  152. package/dist/assets/section-dVgXR9AT.js +40 -0
  153. package/dist/assets/{security-BwF3YzTL.js → security-DnTqhJwZ.js} +4 -4
  154. package/dist/assets/session-ulvrJT-t.js +1 -0
  155. package/dist/assets/setup-DhVk3qh7.js +30 -0
  156. package/dist/assets/{shorten-label-BKNhALWt.js → shorten-label--tw3nR45.js} +1 -1
  157. package/dist/assets/{simple-select-DiucBfFO.js → simple-select-6w3ryEQx.js} +1 -1
  158. package/dist/assets/{spaces-D2uHzDSf.js → spaces-wJwcbibW.js} +1 -1
  159. package/dist/assets/{start-CCbI2h7_.js → start-DpiGz6e_.js} +1 -1
  160. package/dist/assets/{starting-progress-C2KBufhS.js → starting-progress-DQSw_Bxk.js} +1 -1
  161. package/dist/assets/status-T58XBbiV.js +1 -0
  162. package/dist/assets/{step-actions-C6aMtUZh.js → step-actions-DIkPOD9c.js} +1 -1
  163. package/dist/assets/{studio-B-QwZrdc.js → studio-BYS275wi.js} +1 -1
  164. package/dist/assets/{switch-control-88oLMAWm.js → switch-control-BuqCLgsC.js} +1 -1
  165. package/dist/assets/{table-tips-ZIxKRomr.js → table-tips-DQHiKZsk.js} +1 -1
  166. package/dist/assets/team-BESj-ofA.js +146 -0
  167. package/dist/assets/th-CmipfeuV.js +1 -0
  168. package/dist/assets/th-DEoqTEHf.js +5 -0
  169. package/dist/assets/traffic-Ck4_JTUO.js +1 -0
  170. package/dist/assets/{transfer-DWvn8JDa.js → transfer-D9h-sDAW.js} +2 -2
  171. package/dist/assets/{unsubscribe-DPIGic1H.js → unsubscribe-xEh30JTV.js} +1 -1
  172. package/dist/assets/{use-mobile-BhzP2Rp3.js → use-mobile-CiJJ-F32.js} +1 -1
  173. package/dist/assets/{use-mobile-BtGrkCtZ.js → use-mobile-DXb1p_2Q.js} +1 -1
  174. package/dist/assets/use-promise-window-open-I4QIABtm.js +1 -0
  175. package/dist/assets/{use-server-logo-BFuFRBQG.js → use-server-logo-BoNyOffw.js} +1 -1
  176. package/dist/assets/use-window-close-0exfy1za.js +2 -0
  177. package/dist/assets/{useAsync-DGzYJlYv.js → useAsync-NmGtaPYZ.js} +1 -1
  178. package/dist/assets/{useAsync-DcK0UTnz.js → useAsync-kpO9-9ye.js} +1 -1
  179. package/dist/assets/{useLocalStorage-BRPtTalQ.js → useLocalStorage-oSchpz1c.js} +1 -1
  180. package/dist/assets/user-center-yL13yU5N.js +126 -0
  181. package/dist/assets/{user-sessions-C2LvHnd6.js → user-sessions-7gxEZAmB.js} +1 -1
  182. package/dist/assets/{util-DtXj9fc3.js → util-D52ViY5P.js} +1 -1
  183. package/dist/assets/{util-BGfTex9R.js → util-H8b0otwY.js} +1 -1
  184. package/dist/assets/{vendor-arcblock-B78OG6SS.js → vendor-arcblock-C7W5M07l.js} +1 -1
  185. package/dist/assets/{vendor-hooks-HB6DqcLv.js → vendor-hooks-0NQwJuRY.js} +2 -2
  186. package/dist/assets/{vendor-mui-core-DWYIngcn.js → vendor-mui-core-CiGwt5P_.js} +2 -2
  187. package/dist/assets/{vendor-mui-x-nEbm5eNb.js → vendor-mui-x-CXaju64L.js} +1 -1
  188. package/dist/assets/{vendor-utils-J7aLFpEq.js → vendor-utils-DAj75QpF.js} +1 -1
  189. package/dist/assets/{vendor-ux-Dln42oC3.js → vendor-ux-CF8ziO7Y.js} +81 -80
  190. package/dist/assets/vi-D7Q19sbd.js +5 -0
  191. package/dist/assets/vi-DpNkWLxz.js +1 -0
  192. package/dist/assets/wait-connect-Cll9F6lE.js +1 -0
  193. package/dist/assets/wrap-locale-CsXU2piR.js +1 -0
  194. package/dist/assets/zh-BChkzbvC.js +1 -0
  195. package/dist/assets/{zh-C3O8IIjK.js → zh-BrUcq0vn.js} +1 -1
  196. package/dist/assets/zh-DkzyaEBh.js +10 -0
  197. package/dist/assets/zh-tw-BNjyxfNh.js +9 -0
  198. package/dist/assets/zh-tw-CjDPzOCU.js +1 -0
  199. package/dist/images/aigne-hub.jpg +0 -0
  200. package/dist/images/anthropic.png +0 -0
  201. package/dist/images/bedrock.png +0 -0
  202. package/dist/images/deepseek.png +0 -0
  203. package/dist/images/gemini.png +0 -0
  204. package/dist/images/ollama.png +0 -0
  205. package/dist/images/open-router.png +0 -0
  206. package/dist/images/openai.png +0 -0
  207. package/dist/images/xai.png +0 -0
  208. package/dist/index.html +6 -6
  209. package/dist/service-worker.js +1 -1
  210. package/package.json +47 -47
  211. package/dist/assets/actions-CeSIZN0M.js +0 -1
  212. package/dist/assets/add-resource-vcL8WXJK.js +0 -1
  213. package/dist/assets/api-BV16dSSm.js +0 -1
  214. package/dist/assets/appearance-BF-F41U0.js +0 -1
  215. package/dist/assets/ar-C5ipiHf8.js +0 -7
  216. package/dist/assets/ar-DCQblmBa.js +0 -1
  217. package/dist/assets/branding-Co1T-6R4.js +0 -54
  218. package/dist/assets/button-Cnj6R5bV.js +0 -1
  219. package/dist/assets/config-space-a6OXiuM7.js +0 -1
  220. package/dist/assets/connect-B-9mXcqo.js +0 -1
  221. package/dist/assets/connect-to-BL3HAXmC.js +0 -1
  222. package/dist/assets/de-D2XMSiJO.js +0 -7
  223. package/dist/assets/de-qK31O6-T.js +0 -1
  224. package/dist/assets/domain-action-card-B-0EUHm9.js +0 -28
  225. package/dist/assets/domain-q2p-uq0P.js +0 -9
  226. package/dist/assets/domains-BvFskQMv.js +0 -1
  227. package/dist/assets/engine-DHKpyPwC.js +0 -1
  228. package/dist/assets/es-BbK8BUZe.js +0 -9
  229. package/dist/assets/es-if48ykIx.js +0 -1
  230. package/dist/assets/fr-BGG_0fyt.js +0 -7
  231. package/dist/assets/fr-CgLauWUq.js +0 -1
  232. package/dist/assets/gen-access-key-DVBJadXn.js +0 -2
  233. package/dist/assets/get-safe-url-Ce6hawV-.js +0 -1
  234. package/dist/assets/hi-Xr6quGTW.js +0 -1
  235. package/dist/assets/hi-u6UuLwjV.js +0 -5
  236. package/dist/assets/id-C2MXmMK4.js +0 -1
  237. package/dist/assets/id-CIzxbBpP.js +0 -7
  238. package/dist/assets/index-5klv_mrK.js +0 -4
  239. package/dist/assets/index-B9-tuTku.js +0 -242
  240. package/dist/assets/index-B9GdL3BM.js +0 -124
  241. package/dist/assets/index-BVPDkm__.js +0 -1
  242. package/dist/assets/index-C_CqbmyE.js +0 -7
  243. package/dist/assets/index-CeczUnUx.js +0 -284
  244. package/dist/assets/index-CgRDnxac.js +0 -55
  245. package/dist/assets/index-D8X_0Jj0.js +0 -1
  246. package/dist/assets/index-gkhmzgqt.js +0 -113
  247. package/dist/assets/index-n78OcMXJ.js +0 -11
  248. package/dist/assets/item-C8OCvu8j.js +0 -1
  249. package/dist/assets/ja-Cfsi5Ugj.js +0 -9
  250. package/dist/assets/ja-YE6rPAFZ.js +0 -1
  251. package/dist/assets/ko-D-4Akfw8.js +0 -1
  252. package/dist/assets/ko-DXnv35ZL.js +0 -9
  253. package/dist/assets/list-DZy6xsmU.js +0 -2
  254. package/dist/assets/localization-CKs8paiI.js +0 -1
  255. package/dist/assets/logger-BAwrOeMG.js +0 -1
  256. package/dist/assets/login-Bnu0F5eS.js +0 -1
  257. package/dist/assets/logo-uploader-DgG1moIj.js +0 -133
  258. package/dist/assets/lost-passport-DtNgA2rm.js +0 -168
  259. package/dist/assets/preferences-DfEKF75U.js +0 -1
  260. package/dist/assets/profile-embed-LKUTgx9A.js +0 -1
  261. package/dist/assets/pt-BWEktz2b.js +0 -1
  262. package/dist/assets/pt-bwAs6AHq.js +0 -5
  263. package/dist/assets/publish-resource-BzjWpXe-.js +0 -1
  264. package/dist/assets/ru-BdE3cdVi.js +0 -5
  265. package/dist/assets/ru-CivYXtU3.js +0 -1
  266. package/dist/assets/runtime-Sobb0AXT.js +0 -1
  267. package/dist/assets/sdk-DzqJHXyQ.js +0 -1
  268. package/dist/assets/section-BqJWD2MT.js +0 -41
  269. package/dist/assets/session-BV5HR2vD.js +0 -1
  270. package/dist/assets/setup-Bll35TpG.js +0 -30
  271. package/dist/assets/status-fhCB_pM_.js +0 -1
  272. package/dist/assets/team-DplrCM_m.js +0 -147
  273. package/dist/assets/th-BtarXxEz.js +0 -5
  274. package/dist/assets/th-DmB7Kg4h.js +0 -1
  275. package/dist/assets/traffic-BU5sjdLg.js +0 -1
  276. package/dist/assets/user-center-D4QgyhnU.js +0 -126
  277. package/dist/assets/vi-BMiy6Nrg.js +0 -1
  278. package/dist/assets/vi-CkIA1NEb.js +0 -5
  279. package/dist/assets/wrap-locale-BylAyLRV.js +0 -1
  280. package/dist/assets/zh-Ch3TJh3i.js +0 -10
  281. package/dist/assets/zh-CubVjUHy.js +0 -1
  282. package/dist/assets/zh-tw-Bza_uiUD.js +0 -9
  283. package/dist/assets/zh-tw-oBCLhAEX.js +0 -1
@@ -1,113 +0,0 @@
1
- import{g as Wt,r as v}from"./vendor-react-Dvs43sk9.js";import{j as e,ak as y,z as Q,b6 as me,be as qe,y as V,am as ut,de as Bt,bm as qt,at as ae,b1 as mt,W as h,T as ee,U as Ye,df as pt,b5 as Ke,a5 as Me,Q as Fe,cP as Ge,aN as Ue,a6 as ft,D as ht,a8 as xt,dg as Kt,ad as gt,dh as Mt,di as Ut,bY as st,n as Ht,x as $t,bb as Vt,M as it,cy as Yt,I as Gt,cT as Jt}from"./vendor-mui-core-DWYIngcn.js";import{A as bt,J as Xt,C as Qt,e as le,F as Zt,a4 as je}from"./vendor-utils-J7aLFpEq.js";import{T as te,H as M,n as ce,b as en,h as jt,a0 as tn,au as nn,$ as vt,D as yt,av as ke,a as St,z as sn,L as an}from"./vendor-ux-Dln42oC3.js";import{bw as rn,O as Je,Z as Ct,aH as Rt,F as _e,c as _,ad as Z,p as on,aE as at}from"./index-CgCJ2qDh.js";import{g as ye,b as $,a as se}from"./vendor-hooks-HB6DqcLv.js";import{u as wt,C as J}from"./index.esm-JPZAjt0x.js";import{p as He,k as ln,d as cn,N as dn}from"./team-DplrCM_m.js";import{S as X}from"./section-BqJWD2MT.js";import{A as un,a as mn,b as pn}from"./collapse-DfvukfIl.js";import{S as Se}from"./shorten-label-BKNhALWt.js";import{v as Tt}from"./index-EIX4798q.js";import{R as Nt,A as fn,S as hn,a as xn,B as gn}from"./list-B8ZhwNC1.js";import{W as bn}from"./did-address-CdYAzzjR.js";import{p as It}from"./util-DtXj9fc3.js";import{D as jn,g as vn}from"./traffic-BU5sjdLg.js";import{B as Et}from"./bundle-avatar-DkLBEfff.js";import{u as yn}from"./use-mobile-BhzP2Rp3.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B78OG6SS.js";import"./session-BV5HR2vD.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-DcwzA8G_.js";import"./base32-DBDFptL1.js";import"./dot-OPeVWPUi.js";import"./useAsync-DcK0UTnz.js";import"./iframe-BTaRNGRY.js";import"./index-Cbxz8oHT.js";import"./index-DBs9Ljax.js";import"./base-chart-u6OIGONc.js";import"./index-C-AuC2Mk.js";import"./vendor-mui-x-nEbm5eNb.js";import"./AdapterDayjs-Dc_cn1Wv.js";var Te={exports:{}},Ne={exports:{}},Ie={exports:{}},rt;function Sn(){return rt||(rt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(r){return r==null}n.exports=s.default,n.exports.default=s.default}(Ie,Ie.exports)),Ie.exports}var ot;function Cn(){return ot||(ot=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=u;var t=o(rn()),r=o(Sn());function o(p){return p&&p.__esModule?p:{default:p}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,b=/^[-+]?[0-9]+$/;function u(p,i){(0,t.default)(p),i=i||{};var N=i.allow_leading_zeroes===!1?l:b,I=!i.hasOwnProperty("min")||(0,r.default)(i.min)||p>=i.min,S=!i.hasOwnProperty("max")||(0,r.default)(i.max)||p<=i.max,j=!i.hasOwnProperty("lt")||(0,r.default)(i.lt)||p<i.lt,E=!i.hasOwnProperty("gt")||(0,r.default)(i.gt)||p>i.gt;return N.test(p)&&I&&S&&j&&E}n.exports=s.default,n.exports.default=s.default}(Ne,Ne.exports)),Ne.exports}var lt;function Rn(){return lt||(lt=1,function(n,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=o;var t=r(Cn());function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,t.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}n.exports=s.default,n.exports.default=s.default}(Te,Te.exports)),Te.exports}var wn=Rn();const Tn=Wt(wn),ze={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Nn(){const{api:n}=Je(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=Rt(),l=s?.meta?.did,b=Object.assign({...ze},s?.settings?.notification?.email||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=wt({defaultValues:bt(b,Object.keys(ze))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(a,T,O=!0)=>{try{const{blocklet:D}=await n.configNotification({input:{did:l,notification:JSON.stringify({email:a})}}),re=Object.assign({...ze},D?.settings?.notification?.email||{});I(re),O&&M.success(t("oauth.saveSuccess"))}catch(D){if(O)M.error(D.message||t("oauth.saveFailed"));else throw D}}),Y=$(async(a,T,O)=>{try{i.isDirty&&await E(a,T,!1),await n.sendEmail({input:{did:l,receiver:O,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),M.success(t("notification.email.testSuccess"))}catch(D){M.error(D.message||t("notification.email.testfailed"))}}),z=$((a,T)=>{S.testReceiver="",S.testReceiverError="",r.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(y,{sx:{width:"300px"},children:e.jsx(Q,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:S.testReceiver,onChange:O=>{S.testReceiver=O.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(O){const D=S.testReceiver?.trim();if(!D){S.testReceiverError=t("notification.email.receiverRequired");return}if(!_e(D)){S.testReceiverError=t("notification.email.receiverInvalid");return}S.testReceiverError="",await Y(a,T,D),O()}})}),F=$(a=>{const T=a?.trim();return T?_e(T)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),B=$(a=>{const T=a?.trim();return T?He(T,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),R=$(a=>a?Tn(a)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),q=$(a=>a?.trim()?!0:t("notification.email.userRequired")),K=$(a=>a?.trim()?!0:t("notification.email.passwordRequired")),f=$(a=>a?.trim()&&!He(a,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),w=$(a=>a?.trim()&&!_e(a)?t("notification.email.emailInvalid"):!0),C=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(In,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.email.enable"),my:2.5,children:e.jsx(J,{name:"enabled",control:p,render:({field:a})=>e.jsx(me,{control:e.jsx(qe,{checked:a.value,...a})})})}),e.jsx(X,{title:t("notification.email.from"),children:e.jsx(J,{name:"from",control:p,rules:{validate:j?F:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[a.name],helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.host"),children:e.jsx(J,{name:"host",control:p,rules:{validate:j?B:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.host"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.port"),children:e.jsx(J,{name:"port",control:p,rules:{validate:j?R:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,type:"number",error:!!i.errors[a.name],label:t("notification.email.port"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.user"),children:e.jsx(J,{name:"user",control:p,rules:{validate:j?q:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:t("notification.email.user"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.password"),children:e.jsx(J,{name:"password",control:p,rules:{validate:j?K:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",required:!0,type:"password",error:!!i.errors[a.name],label:t("notification.email.password"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.secure"),children:e.jsx(J,{name:"secure",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(me,{control:e.jsx(qe,{checked:a.value,...a,disabled:!j})})})})}),e.jsxs(un,{children:[e.jsxs(mn,{expandIcon:e.jsx(qt,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(ut,{title:t("notification.email.signatureTooltip"),children:e.jsx(Bt,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(pn,{children:[e.jsx(X,{title:t("notification.email.companyName"),children:e.jsx(J,{name:"companyName",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyName"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyLink"),children:e.jsx(J,{name:"companyLink",control:p,rules:{validate:j?f:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyLink"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.companyAddress"),children:e.jsx(J,{name:"companyAddress",control:p,rules:{validate:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",error:!!i.errors[a.name],label:t("notification.email.companyAddress"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})}),e.jsx(X,{title:t("notification.email.supportEmail"),children:e.jsx(J,{name:"supportEmail",control:p,rules:{validate:j?w:C},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...a,size:"small",type:"email",error:!!i.errors[a.name],label:t("notification.email.supportEmail"),helperText:i.errors[a.name]?.message||" ",disabled:!j})})})})]})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const In=ae(mt)``,We={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function En(){const{api:n}=Je(),{blocklet:s}=Ct(),{t}=te(),{confirmApi:r,confirmHolder:o}=Rt(),l=s?.meta?.did,b=Object.assign({...We},s?.settings?.notification?.pushKit||{}),{handleSubmit:u,control:p,formState:i,watch:N,reset:I}=wt({defaultValues:bt(b,Object.keys(We))}),S=ye({testReceiver:"",testReceiverError:""}),j=N("enabled"),E=$(async(R,q,K=!0)=>{try{const{blocklet:f}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:R})}}),w=Object.assign({...We},f?.settings?.notification?.pushKit||{});I(w),K&&M.success(t("oauth.saveSuccess"))}catch(f){if(K)M.error(f.message||t("oauth.saveFailed"));else throw f}}),Y=$(async(R,q)=>{try{i.isDirty&&await E(R,q,!1);const K=(s?.configs||[]).find(C=>C.key==="BLOCKLET_APP_URL")?.value,f=Xt(Qt(K,_.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),w={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:f}}}};await n.sendPush({input:{did:l,receiver:S.testReceiver,notification:JSON.stringify(w)}}),M.success(t("notification.pushKit.testSuccess"))}catch(K){M.error(K.message||t("notification.pushKit.testfailed"))}}),z=$((R,q)=>{S.testReceiverError="",r.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(y,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(Q,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:S.testReceiver,onChange:K=>{S.testReceiver=K.target.value},error:!!S.testReceiverError,helperText:S.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(K){if(!S.testReceiver?.trim()){S.testReceiverError=t("notification.pushKit.receiverRequired");return}S.testReceiverError="",await Y(R,q),K()}})}),F=$(R=>{const q=R?.trim();return q?He(q)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),B=$(()=>!0);return e.jsxs(y,{children:[e.jsxs(An,{component:"form",onSubmit:u(E),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(X,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(J,{name:"enabled",control:p,render:({field:R})=>e.jsx(me,{control:e.jsx(qe,{checked:R.value,...R})})})}),e.jsx(X,{title:t("notification.pushKit.endpoint"),children:e.jsx(J,{name:"endpoint",control:p,rules:{validate:j?F:B},render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...R,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})})}),e.jsxs(X,{title:t("notification.pushKit.customOptions"),children:[e.jsx(J,{name:"did",control:p,render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...R,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})}),e.jsx(J,{name:"pushPath",control:p,render:({field:R})=>e.jsx(V,{fullWidth:!0,children:e.jsx(Q,{...R,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[R.name],helperText:i.errors[R.name]?.message||" ",disabled:!j})})})]}),e.jsxs(y,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(ce,{variant:"outlined",color:"warning",onClick:u(z),disabled:!j,children:t("oauth.runTest")}),e.jsx(ce,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),o]})}const An=ae(mt)``,ct=[{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(y,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function kn(){const[n,s]=v.useState(ct[0].value),{locale:t}=v.useContext(en),r=se(()=>({email:e.jsx(Nn,{}),pushKit:e.jsx(En,{})}),[t]),o=v.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(y,{children:[e.jsx(jt,{tabs:ct,current:n,onChange:s}),e.jsx(y,{style:o,children:r[n]})]})}const At=v.createContext({}),{Provider:On,Consumer:Fs}=At;function Dn({children:n,blocklet:s=""}){const{api:t,inService:r,ws:{useSubscription:o}}=Je(),[l,b]=v.useState([]),[u,p]=v.useState({total:0,pageSize:20,pageCount:0,page:1}),i=se(()=>s.meta?.did,[s]),[N,I]=v.useState([]),[S,j]=v.useState({}),E=se(()=>l.length?new Set(l.map(f=>f.id)):new Set,[l]),Y=async({page:f=1,pageSize:w=20,...C}={})=>{if(!i)return[];try{const a={paging:{page:f,pageSize:w},...C,teamDid:i,dateRange:C.dateRange?[Z(C.dateRange[0]).toISOString(),Z(C.dateRange[1]).toISOString()]:void 0},{dids:T,...O}=a;let D="";T&&T.includes("system")&&(D="system");const re=T?T.filter(pe=>pe!=="system"):[],ue={...O,source:D,componentDids:re},oe=await t.getNotificationSendLog({input:ue});return j(ue),b(oe.list),p(oe.paging),oe.list}catch(a){return M.error(a.message),[]}},z=async()=>{const f=await t.getNotificationComponents({input:{teamDid:i}});I(f.componentDids)},F=v.useCallback(f=>{const w=s.children.find(C=>C.meta?.did===f);if(w)return w.ancestors=[s],w},[s]),B=async({notificationId:f,receivers:w,channels:C,...a})=>{await t.resendNotification({input:{teamDid:i,notificationId:f,receivers:w,channels:C.map(T=>T==="wallet"?_.NOTIFICATION_SEND_CHANNEL.WALLET:T==="pushKit"?_.NOTIFICATION_SEND_CHANNEL.PUSH:T),...a}})},R=v.useCallback(async f=>(await t.getUser({input:{teamDid:i,user:{did:f}}})).user,[t,i]),q=v.useCallback(async({page:f=1,pageSize:w=20,...C}={})=>{try{const a={paging:{page:f,pageSize:w},...C,userName:C.searchText||"",teamDid:i,dateRange:C.dateRange?[Z(C.dateRange[0]).toISOString(),Z(C.dateRange[1]).toISOString()]:void 0};return await t.getReceivers({input:a})}catch(a){throw M.error(a.message),a}},[t,i]);v.useEffect(()=>{i&&z()},[i]),o(_.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,f=>{E.has(f.notificationId)&&Y(S)},[E,S]),o(_.EVENTS.NOTIFICATION_BLOCKLET_CREATE,f=>{E.has(f.id)||Y(S)},[E,S]);const K={fetch:Y,data:l,paging:u,blocklet:s,getComponent:F,resendNotification:B,getUser:R,componentDids:N,getReceivers:q,inService:r,teamDid:i};return e.jsx(On,{value:{notificationRecords:K},children:n})}function Xe(){const{notificationRecords:n}=v.useContext(At);return n}Ce.propTypes={severity:h.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ln={info:"primary",success:"success",error:"error",warning:"warning"};function Ce({severity:n="info"}){return e.jsx(tn,{type:Ln[n],children:n})}const Pn=(n,s,t="")=>{if(!t||!s)return"";switch(t){case _.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return n("notification.sendStatus.reason.disabled",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return n("notification.sendStatus.reason.unavailable",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return n("notification.sendStatus.reason.notSent",{channel:s});case _.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return n("notification.sendStatus.reason.offline");default:return t}};function kt(n,s,t={}){const{status:r,updatedAt:o,reason:l="",channel:b="wallet"}=t,u=o?n("notification.sendStatus.sentTime",{date:on(o,s)}):"",p=Pn(n,b,l);return r===_.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:n("notification.sendStatus.failed"),sentTime:u,reason:p}:r===_.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:n("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:n("notification.sendStatus.pending"),reason:p,sentTime:u}}const $e={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ve=["wallet","pushKit","email"],dt=["info","success","error","warning"],Ot=n=>{const{settings:s}=n;return s?.notification?.email?.enabled},Dt=n=>{const{settings:s}=n;return s?.notification?.pushKit?.enabled},Fn=(n,s)=>{const t=le(s,"extra.notifications.email",!0);return{available:Ot(n),enabled:t}},_n=(n,s)=>{const t=le(s,"extra.notifications.push",!0);return{available:Dt(n),enabled:t}},zn=n=>({enabled:le(n,"extra.notifications.wallet",!0)}),Wn=n=>({enabled:le(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(s=>{setTimeout(()=>{s()},n*1e3)}),Bn=(n,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:n("notification.sendStatus.reason.available",{channel:s}),fail:n("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:s}),fail:n("notification.sendStatus.reason.disabled",{channel:s})}]:[],Ae=(n=[])=>{const s=Z().startOf("day");return n.filter(t=>Z(t.sendAt).isSame(s,"day")).length},qn=(n,s="")=>{if(s&&Ve.includes(s)){const l=`${s}SendRecord`,b=le(n,l,[]);return Ae(b)}const t=le(n,"webhook",{}),r=Object.keys(t??{})??[];if(s&&r.includes(s)){const l=t[s]??[];return Ae(l)}const o={};return Ve.forEach(l=>{const b=`${l}SendRecord`,u=le(n,b,[]),p=Ae(u);o[l]=p}),r.length>0&&r.forEach(l=>{const b=t[l]??[],u=Ae(b);o[l]=u}),o},Oe=(n,s,t)=>{if(!Array.isArray(n))throw new Error("Invalid filterList or index");return n[t].splice(s,1),n},De=(n,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(n):!1},Kn=n=>{switch(n){case _.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case _.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case _.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case _.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function de({config:n,enableTooltip:s=!0,showTitle:t=!1,children:r=null}){const{status:o,title:l="",sentTime:b="",reason:u=""}=n,p=[l,u].filter(Boolean).join(", ");return e.jsx(ut,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:p}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:$e[o]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:$e[o]}})]}),e.jsx(ee,{color:"inherit",sx:{fontSize:12},children:t?l:r})]})})}de.propTypes={config:h.object.isRequired,enableTooltip:h.bool,showTitle:h.bool,children:h.node};Le.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function Le({list:n,label:s,onDelete:t=()=>{}}){const{t:r,locale:o}=te();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(l=>{const b=kt(r,o,{status:l});return e.jsx(Ye,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(de,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>t(u,l)},l)})]})}Qe.propTypes={filterList:h.array.isRequired,onChange:h.func.isRequired,index:h.number.isRequired,column:h.object.isRequired,filterValues:h.array.isRequired,label:h.string.isRequired,renderLabel:h.func.isRequired};function Qe({filterList:n,onChange:s,index:t,column:r,filterValues:o,label:l,renderLabel:b}){return e.jsxs(V,{className:"filter-container",children:[e.jsx(pt,{component:"legend",children:l}),e.jsx(Ke,{row:!0,children:o.map(u=>e.jsx(me,{control:e.jsx(Me,{checked:n[t].indexOf(u.value??u)>-1,onChange:p=>{const i=[...n];p.target.checked?i[t]=[...i[t],u.value??u]:i[t]=i[t].filter(N=>N!==(u.value??u)),s(i[t],t,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Be(n){return e.jsx(Qe,{...n,renderLabel:s=>e.jsx(de,{enableTooltip:!1,config:{status:s.status},children:s.label})})}xe.propTypes={status:h.number.isRequired,updatedAt:h.string.isRequired,reason:h.string,channel:h.string,onResend:h.func};function xe({status:n,updatedAt:s,reason:t="",channel:r="wallet",onResend:o}){const{t:l,locale:b}=te(),u=kt(l,b,{status:n,updatedAt:s,reason:t,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(de,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Fe,{className:"resend-btn",size:"small",startIcon:e.jsx(Ge,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}Ze.propTypes={value:h.array.isRequired,onChange:h.func};function Ze({value:n,onChange:s}){const{locale:t}=te(),r=Z().toDate(),[o,l]=v.useState(null),b=v.useCallback(i=>{l(o?null:i.currentTarget)},[o]),u=!!o,p=v.useCallback(i=>{if(!i.startDate||!i.endDate){M.error("Please select a date range");return}if(Z(i.startDate).isAfter(i.endDate)||!Z(i.startDate).isValid()||!Z(i.endDate).isValid()){M.error("Invalid date range");return}s([i.startDate,i.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(ee,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Fe,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[at(n[0],t)," - ",at(n[1],t)]})}),e.jsx(Ue,{open:u,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(jn,{open:!0,maxDate:r,initialDateRange:{startDate:n[0],endDate:n[1]},toggle:b,definedRanges:vn(r),onChange:p})})]})}et.propTypes={itemComponent:h.elementType.isRequired};function et({itemComponent:n,...s}){const{t}=te();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:t("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(nn.TableFilterList,{...s,ItemComponent:n})})]})}function tt({label:n,onDelete:s,canDelete:t=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let l=!0;return t&&typeof t=="function"&&(l=t({label:n,...r})),e.jsx(Ye,{label:n,variant:"outlined",...o&&l?{onDelete:o}:{}})}tt.propTypes={label:h.string.isRequired,onDelete:h.func,canDelete:h.func};const Mn=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Pt.propTypes={loading:h.bool,onCancel:h.func,onConfirm:h.func};function Pt({loading:n=!1,onCancel:s=()=>{},onConfirm:t=()=>{}}){const{t:r}=te(),[o,l]=v.useState(Mn),[b,u]=v.useState(!0),p=(N,I)=>{I.checked=N.target.checked;const S=o.map(j=>({...j,checked:j.value===I.value?I.checked:j.checked}));l(S)},i=N=>{N.stopPropagation(),t({channels:o.filter(I=>I.checked).map(I=>I.value),isResendFailedOnly:b})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ee,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(V,{component:"fieldset",variant:"standard",children:[e.jsx(pt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Ke,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(N=>e.jsx(me,{control:e.jsx(Me,{checked:N.checked,onChange:I=>p(I,N),name:N.value}),label:N.label},N.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Ke,{children:e.jsx(me,{control:e.jsx(Me,{checked:b,onChange:N=>u(N.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Fe,{onClick:N=>{N.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Fe,{onClick:i,color:"primary",disabled:n,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[n&&e.jsx(ft,{size:16}),r("common.confirm")]})]})]})}Ft.propTypes={notificationId:h.string.isRequired,handleResend:h.func,resending:h.bool};function Ft({notificationId:n,handleResend:s,resending:t=!1}){const{t:r,locale:o}=te(),l=ht(),b=v.useMemo(()=>xt(l,Lt()),[l]),{getReceivers:u,inService:p,teamDid:i,getUser:N,blocklet:I}=Xe(),[S,j]=v.useState(!1),[E,Y]=v.useState([]),z=ye({anchorEl:null,position:null}),F=ye({anchorEl:null,position:null}),[B,R]=v.useState(null),[q,K]=v.useState({total:0,pageSize:10,pageCount:0,page:1}),[f,w]=v.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),[C,a]=v.useState([]),T=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],O=async()=>{if(!S&&n)try{j(!0);const c=await u({notificationId:n,...f}),d=c.list.map(m=>({...m,receiverUser:{...m.receiverUser,avatar:It(m.receiverUser.avatar,i,p)}}));Y(d),K(c.paging),j(!1)}catch(c){M.error(c.message),j(!1)}};v.useEffect(()=>{O()},[f]);const D=c=>{c.stopPropagation();const d=c.currentTarget;F.anchorEl=d;const m=d.getBoundingClientRect();F.position={top:m.top+window.scrollY,left:m.left+window.scrollX}},re=c=>c.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ce,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:D,children:r("notification.resend")})}):null,ue={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:q.page-1,rowsPerPage:q.pageSize,count:q.total,searchText:f.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:C,onRowSelectionChange:(c,d)=>{a(d.map(m=>m.dataIndex))},customToolbarSelect:re},oe=({page:c,rowsPerPage:d,searchText:m,filterList:k})=>{const[,U=[],ne=[],G=[]]=k;f.pageSize!==d?w(H=>({...H,pageSize:d,page:1})):f.page!==c+1?w(H=>({...H,page:c+1})):f.searchText!==m?w(H=>({...H,searchText:m,page:1})):je(U,f.walletSendStatus)?je(ne,f.pushKitSendStatus)?je(G,f.emailSendStatus)||w(H=>({...H,emailSendStatus:G,page:1})):w(H=>({...H,pushKitSendStatus:ne,page:1})):w(H=>({...H,walletSendStatus:U,page:1}))},pe=v.useCallback(async(c,d)=>{if(!d)return!1;const m=await N(d);return m?c==="wallet"?zn(m):c==="email"?Fn(I,m):c==="pushKit"?_n(I,m):c==="webhook"?Wn(m):!0:!1},[N,I]),Re=v.useCallback(c=>Bn(r,c),[r]),fe=()=>{z.anchorEl=null,z.position=null,R(null)},he=()=>{F.anchorEl=null,F.position=null},g=async(c,d,m=!0,k="")=>{if(!(!d.length||!c.length))try{s(c,d,m,k),F.anchorEl||(await Ee(.5),fe())}catch(U){console.error("handleResend error",{error:U})}},x=async({channels:c,isResendFailedOnly:d})=>{const m=C.map(k=>E[k].receiver);await g(c,m,d),await Ee(.5),he(),a([])},A=async(c,d=[],m=!0)=>{try{await g(["webhook"],[c.receiver],m,d)}catch(k){M.error(k.response?k.response.statusText:k.message)}},L=async(c,d,m,k=[],U=!0)=>{if(c.stopPropagation(),qn(d,m)>=4){M.warning(r("notification.resendLimit"));return}if(!Ve.includes(m)){await A(d,k,U);return}if(c){const G=c.currentTarget,H=G.getBoundingClientRect();z.anchorEl=G,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}R({channel:m});try{const G=await pe(m,d.receiver);await Ee(1),R({channel:m,result:G}),(typeof G=="boolean"&&G||Zt(G)&&Object.values(G).every(H=>!!H))&&(await s([m],[d.receiver],U),F.anchorEl||(await Ee(.5),fe()))}catch(G){M.error(G.message)}},W=c=>{w(d=>({...d,dateRange:c,page:1}))},P=(c,d,m,k)=>{c.stopPropagation();const U=m.filter(ne=>ne!==d);w(ne=>({...ne,[k]:U,page:1}))},ie=se(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:c=>{const{receiverUser:d,receiver:m}=E[c];return d?e.jsxs(y,{"data-cy":`member-name-${d.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(vt,{src:`${d.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:m,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Se,{children:d.fullName})]},m):e.jsx(bn,{size:14,responsive:!1,compact:!0,copyable:!1,did:m})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:f.walletSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Wallet",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[1].options.filterList,"walletSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,k)=>e.jsx(Be,{label:"Wallet",filterList:c,onChange:d,index:m,column:k,filterValues:T})},customBodyRenderLite:c=>{const{walletSendStatus:d,walletSendAt:m,walletSendFailedReason:k}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:k,channel:"wallet",onResend:U=>L(U,E[c],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{pushKitSendStatus:d,pushKitSendAt:m,pushKitSendFailedReason:k}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:k,channel:"pushkit",onResend:U=>L(U,E[c],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:f.pushKitSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Push Kit",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[2].options.filterList,"pushKitSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,k)=>e.jsx(Be,{label:"Push Kit",filterList:c,onChange:d,index:m,column:k,filterValues:T})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{emailSendStatus:d,emailSendAt:m,emailSendFailedReason:k}=E[c];return e.jsx(xe,{status:d,updatedAt:m,reason:k,channel:"email",onResend:U=>L(U,E[c],"email",[],!1)})},filter:!0,filterType:"custom",filterList:f.emailSendStatus??[],customFilterListOptions:{render:c=>e.jsx(Le,{list:c,label:"Email",onDelete:(d,m)=>{d.stopPropagation(),P(d,m,ie[3].options.filterList,"emailSendStatus")}}),update:Oe},filterOptions:{names:T,fullWidth:!0,logic:De,display:(c,d,m,k)=>e.jsx(Be,{label:"Email",filterList:c,onChange:d,index:m,column:k,filterValues:T})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:c=>{const{webhook:d}=E[c];if(!d)return null;const m=Object.entries(d)[0];if(!m)return null;const[k,U]=m,ne=U[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(Se,{maxLength:30,children:k},k),e.jsx(xe,{status:ne.status,updatedAt:ne.sendAt,reason:ne.failedReason,channel:"webhook",onResend:G=>L(G,E[c],"webhook",[k],!1)})]},k)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:c=>{const{createdAt:d}=E[c];return e.jsx(Nt,{value:d,locale:o,shouldUpdate:!0})}}}],[E,o,f,r]),we=[e.jsx(Ze,{value:f.dateRange,onChange:W},"date-picker"),e.jsx(ce,{variant:"contained",size:"small",color:"primary",loading:S,startIcon:e.jsx(Kt,{}),onClick:()=>O(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(Hn,{children:e.jsxs(gt,{theme:b,children:[e.jsx(yt,{className:"receivers-table",locale:o,loading:S,columns:ie,data:E,onChange:oe,options:ue,customButtons:we,components:{TableFilterList:c=>e.jsx(et,{...c,itemComponent:d=>e.jsx(tt,{...d,canDelete:()=>!1})})}}),z.anchorEl&&e.jsx(Ue,{open:!!z.anchorEl,anchorReference:"anchorPosition",anchorPosition:z.position,onClose:fe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs($n,{children:[e.jsxs(ee,{variant:"body1",component:"div",className:"check-title",children:[B?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Re(B?.channel).map(c=>{const{type:d,pass:m,fail:k}=c;return!B?.result||B?.result?.[d]?e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:B?.result?.[d]?ke.success.main:"inherit"},children:[B?.result?e.jsx(Mt,{}):e.jsx(ft,{size:12,sx:{color:ke.primary.main}}),e.jsx("span",{children:m})]},d):e.jsxs(ee,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ke.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:k})]},d)})})]})}),F.anchorEl&&e.jsx(Ue,{open:!!F.anchorEl,anchorReference:"anchorPosition",anchorPosition:F.position,onClose:he,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Pt,{loading:t,onCancel:he,onConfirm:x})})]})})})}const Un=v.memo(Ft),Hn=ae.div`
2
- td.MuiTableCell-footer {
3
- border: none !important;
4
- }
5
- .sent-status-cell {
6
- .resend-btn {
7
- display: none;
8
- }
9
- &:hover {
10
- .resend-btn {
11
- display: flex;
12
- }
13
- }
14
- }
15
- `,$n=ae.div`
16
- padding: 8px 16px;
17
- .check-title {
18
- font-weight: 500;
19
- margin-bottom: 8px;
20
- &::first-letter {
21
- text-transform: uppercase;
22
- }
23
- }
24
- .check-item {
25
- svg {
26
- font-size: 16px;
27
- }
28
- font-size: 12px;
29
- }
30
- `,ve=n=>n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:n;function Vn(n){const{wallet:s,push:t,email:r,webhook:o}=n;return[{name:"Wallet",value:e.jsx(ge,{item:s})},{name:"Push",value:e.jsx(ge,{item:t})},{name:"Email",value:e.jsx(ge,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(ge,{item:o,isWebhook:!0})}]:[]]}function Yn(n,s,t){const{wallet:r,push:o,email:l,webhook:b}=n;return[{name:"Wallet",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(be,{loading:t,channel:_.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}nt.propTypes={statistics:h.object.isRequired,onResend:h.func,mode:h.oneOf(["simple","detail"]),resending:h.bool};ge.propTypes={item:h.object.isRequired,isWebhook:h.bool};function ge({item:n,isWebhook:s=!1}){const{t}=te(),r=s?n.success.length:n.success,o=n.total,l=r===o?"success":"failed";return e.jsx(y,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(de,{config:{status:l},enableTooltip:!1,children:[ve(r)," / ",ve(o)," ",t("notification.sendStatus.success")]})})})}be.propTypes={item:h.object.isRequired,isWebhook:h.bool,channel:h.string,onResend:h.func,loading:h.bool};function be({channel:n=_.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:t=!1,onResend:r=()=>{},loading:o=!1}){const{t:l}=te(),{success:b,failed:u,pending:p}=s,i=Kn(n),N=t?b.length:b,I=t?u.length:u,S=t?p.length:p,j=async F=>{F.stopPropagation();const B=t?[...new Set([...b,...u].map(R=>R))]:[];await r([n],[],!0,B)},E=N+I,Y=E>0?N/E*100:0,z=E>0?I/E*100:0;return e.jsxs(Gn,{successRatio:Y,failedRatio:z,children:[e.jsxs(ee,{variant:"h6",children:[i," (",s.total,")"]}),e.jsxs(ee,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:$e.success,fontWeight:600,fontSize:24},children:ve(N)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(y,{className:"unsent-area",children:[e.jsxs(y,{children:[e.jsxs(de,{config:{status:"failed"},enableTooltip:!1,children:[ve(I)," ",l("notification.sendStatus.failed")]}),e.jsxs(de,{config:{status:"pending"},enableTooltip:!1,children:[ve(S)," ",l("notification.sendStatus.pending")]})]}),I>0&&e.jsx(y,{className:"resend-btn",children:e.jsx(ce,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(Ge,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:j,children:l("notification.resend")})})]})]})}function nt({statistics:n,mode:s="simple",onResend:t=()=>{},resending:r=!1}){const o=se(()=>s==="simple"?Vn(n):Yn(n,t,r),[n,s]);return s==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(Tt,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(st,{container:!0,spacing:2,children:o.map(l=>e.jsx(st,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const Gn=ae(y)`
31
- display: flex;
32
- flex-direction: column;
33
- align-items: flex-start;
34
- padding: 16px;
35
- border-radius: 8px;
36
- background: ${({successRatio:n,failedRatio:s,theme:t})=>n===0&&s===0?t.palette.grey[300]:`linear-gradient(to right, ${Ht(t.palette.success.light,.4)} ${n}%, ${t.palette.grey[100]} ${n}%)`};
37
- transition: 'background 0.5s ease';
38
- cursor: pointer;
39
- .unsent-area {
40
- width: 100%;
41
- position: relative;
42
- .resend-btn {
43
- position: absolute;
44
- right: 0;
45
- bottom: 0;
46
- }
47
- }
48
- `;_t.propTypes={notification:h.object.isRequired,onCancel:h.func,blocklet:h.object.isRequired,tab:h.string};function _t({notification:n,onCancel:s=()=>{},blocklet:t,tab:r="info"}){const{t:o,locale:l}=te(),{getComponent:b,resendNotification:u}=Xe(),[p,i]=v.useState(!1),N=se(()=>b(n.componentDid)||t,[t,n.componentDid]),I=ye({tab:r||"info"}),S=v.useCallback(async(f,w,C=!0,a=[])=>{if(!f.length||!n.id)return;const T=w.length>0?w:n?.receivers?.map(D=>D.receiver);if(!T.length)return;let O=[...f];if(O.includes(_.NOTIFICATION_SEND_CHANNEL.PUSH)&&!Dt(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),O=O.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.PUSH)),O.includes(_.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!Ot(t)&&(M.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),O=O.filter(D=>D!==_.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!O.length)try{i(!0),await u({notificationId:n.id,receivers:T,channels:O,resendFailedOnly:C,...O.includes("webhook")&&a.length?{webhookUrls:a}:{}}),M.success("Message has been sent!")}catch(D){console.error("handleResend error",{error:D}),M.error(D.response?D.response.statusText:D.message)}finally{i(!1)}},[t,n.id,n?.receivers,u,o]),j=se(()=>ln(n),[n]),E=se(()=>cn(n),[n]),Y=se(()=>j?n?.actorInfo:[],[n]),z=se(()=>t?.did||t?.meta?.did||"",[t]);function F(){return[{name:o("notification.from"),value:j&&E?e.jsx(fn,{actors:Y,teamDid:z,size:32,showName:!0}):e.jsx(hn,{size:32,blocklet:N,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(Se,{maxLength:50,children:n.title})},{name:o("notification.body"),value:j?e.jsx(xn,{notification:n,blocklet:t}):e.jsx(dn,{notification:n,rows:0})},{name:o("notification.severity"),value:e.jsx(Ce,{severity:n.severity})},{name:o("notification.createdAt"),value:e.jsx(sn,{value:n.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(w=>e.jsx(Tt,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:w.name,children:w.value},w.name))}const B={info:{label:o("common.basicInfo"),value:"info",component:F},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},R=Object.values(B).map(({label:f,value:w})=>({label:f,value:w})),q=B[I.tab]||B.info,K=f=>{I.tab=f};return e.jsx(St,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{I.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(Xn,{children:[e.jsx(y,{className:"tabs",sx:{mx:3},children:e.jsx(jt,{tabs:R,current:I.tab,onChange:K,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[I.tab==="receivers"&&e.jsx(Un,{notificationId:n.id,resending:p,handleResend:S}),I.tab==="statistics"&&e.jsx(nt,{statistics:n.statistics,mode:"detail",resending:p,onResend:S}),I.tab==="info"&&e.jsx(q.component,{})]})]})})}const Jn=v.memo(_t),Xn=ae.div`
49
- & > .notification-row {
50
- padding: 0;
51
- }
52
-
53
- .tabs {
54
- margin: 0;
55
- }
56
- .body {
57
- margin-top: 16px;
58
- }
59
-
60
- .channel-item {
61
- display: flex;
62
- padding: 4px;
63
- justify-content: flex-start;
64
- align-items: center;
65
- gap: 8px;
66
- > p {
67
- font-size: 15px;
68
- }
69
- .resend-btn {
70
- svg {
71
- font-size: 16px;
72
- }
73
- display: flex;
74
- align-items: center;
75
- font-size: 12px;
76
- cursor: pointer;
77
- &.disabled {
78
- cursor: not-allowed;
79
- color: ${ke.text.disabled};
80
- }
81
- }
82
- }
83
- `;Pe.propTypes={blocklet:h.object,label:h.string};const Qn=ae.div`
84
- display: flex;
85
- justify-items: flex-start;
86
- align-items: center;
87
- gap: 8px;
88
- .name {
89
- display: block;
90
- max-width: 260px;
91
- white-space: nowrap;
92
- overflow: hidden;
93
- text-overflow: ellipsis;
94
- }
95
- `;function Pe({blocklet:n=null,label:s=""}){return e.jsx(Qn,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(Et,{size:24,blocklet:n,ancestors:n.ancestors}),e.jsx("span",{className:"name",children:n.title||n.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}zt.propTypes={list:h.array.isRequired,label:h.string.isRequired,onDelete:h.func};function zt({list:n,label:s,onDelete:t=()=>{}}){return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(ee,{children:[s,": "]}),n.map(r=>e.jsx(Ye,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(Ce,{severity:r})}),onDelete:o=>t(o,r)},r))]})}function Zn(n){return e.jsx(Qe,{...n,renderLabel:s=>e.jsx(Ce,{severity:s})})}function es({customTableButtons:n}){const{t:s,locale:t}=te(),r=ht(),o=v.useMemo(()=>xt(r,Lt()),[r]),[l,b]=v.useState(!1),{data:u,paging:p,blocklet:i,fetch:N,getComponent:I,componentDids:S,inService:j,teamDid:E}=Xe(),Y=v.useRef(null),[z,F]=v.useState(null),[B,R]=v.useState("info"),q=yn(),[K,f]=v.useState(!1),w=`notification-records-${i.meta?.did}`,C=an(w),[a,T]=v.useState({pageSize:C.rowsPerPage||10,page:C.page?C.page+1:1,dids:C.dids||[],dateRange:C.dateRange||[Z().subtract(1,"month").startOf("day").toDate(),Z().endOf("day").toDate()]}),O=se(()=>{if(!i.children||!i.children.length)return[];const g=[];return i.children.forEach(x=>{const A=x.did||x.meta?.did;S.includes(A)&&(x.ancestors=[i],g.push(x))}),g},[S,i]),D=async g=>{try{b(!0),await N(g),b(!1)}finally{b(!1)}};v.useEffect(()=>{D(a)},[a]),v.useEffect(()=>{const g=u.find(x=>x.id===z?.id);z&&g&&F({...g})},[u]);const re=(g,x,A,L)=>{g.stopPropagation();const W=A.filter(P=>P!==x);T(P=>({...P,[L]:W,page:1}))},ue=({page:g,rowsPerPage:x,filterList:A})=>{const[L=[],,,,W=[]]=A;a.pageSize!==x?T(P=>({...P,pageSize:x,page:1})):a.page!==g+1?T(P=>({...P,page:g+1})):je(a.dids,L)?je(a.severities,W)||T(P=>({...P,severities:W,page:1})):T(P=>({...P,dids:L,page:1}))},oe=v.useCallback(()=>{F(null),R("info")},[]),pe=v.useCallback(()=>{N(a)},[N,a]),Re=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:g=>g.map((x,A)=>{if(x==="system")return e.jsx("span",{children:s("notification.system")},`system-${A}`);const L=O.find(W=>(W.did||W.meta?.did)===x);return e.jsx(Pe,{blocklet:L,label:L?.title||L?.meta?.title},x)}),update:(g,x,A)=>(g[A].splice(x,1),g)},filterOptions:{names:O,logic:(g,x)=>x.length?!x.includes(g):!1,display:(g,x,A,L)=>e.jsxs(V,{style:{width:"380px"},children:[e.jsx($t,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Vt,{multiple:!0,value:g[A],renderValue:W=>e.jsx(y,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:W.map(P=>{if(P==="system")return e.jsx("span",{children:s("notification.system")},P);const ie=O.find(we=>(we.did||we.meta?.did)===P);return e.jsx(Pe,{blocklet:ie,label:ie?.title||ie?.meta?.title},P)})}),onChange:W=>{g[A]=W.target.value,x(g[A],A,L)},children:[e.jsx(it,{value:"system",children:s("notification.system")}),O.map(W=>{const P=W.did||W.meta?.did;return e.jsx(it,{value:P,children:e.jsx(Pe,{blocklet:W,label:W.title||W.meta?.title})},P)})]})]})},customBodyRenderLite:g=>{const x=u[g],A=I(x.componentDid);return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[A?e.jsx(Et,{size:32,blocklet:A,ancestors:A.ancestors??[]}):e.jsx(gn,{blocklet:i,size:32}),e.jsx(Se,{maxLength:50,children:A?.meta?.title||i?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g],{receivers:A}=x;return e.jsx(Yt,{total:A.length,renderSurplus:L=>L<100?e.jsxs("span",{children:["+",L]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:L=>{L.stopPropagation(),F(x),R("receivers")},children:A.map(L=>{const{receiverUser:W}=L,P=It(W.avatar,E,j);return e.jsx(vt,{alt:W.fullName,src:`${P}?imageFilter=resize&w=48&h=48`,size:32,did:L.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},L.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(y,{onClick:A=>{A.stopPropagation(),F(x),R("statistics")},children:e.jsx(nt,{statistics:x.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:g=>{const x=u[g];return e.jsx(Se,{maxLength:50,children:x.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:g=>{const x=u[g];return e.jsx(Ce,{severity:x.severity})},filter:!0,filterType:"custom",filterList:a.severities??[],customFilterListOptions:{render:g=>e.jsx(zt,{list:g,label:s("notification.severity"),onDelete:(x,A)=>{x.stopPropagation(),re(x,A,Re[4].options.filterList,"severities")}}),update:Oe},filterOptions:{names:dt,fullWidth:!0,logic:De,display:(g,x,A,L)=>e.jsx(Zn,{label:s("notification.severity"),filterList:g,onChange:x,index:A,column:L,filterValues:dt})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:g=>{const{createdAt:x}=u[g];return e.jsx(Nt,{value:x,locale:t,shouldUpdate:!0})}}}],fe=g=>{T(x=>({...x,dateRange:g,page:1}))},he=[e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(Gt,{onClick:()=>f(!0),sx:{p:q?0:void 0},children:e.jsx(Jt,{})},"settings"),q?e.jsx(ee,{children:s("common.setting")}):null]}),...n||[]];return e.jsxs(y,{ref:Y,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ts,{children:e.jsx(gt,{theme:o,children:e.jsx(yt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:t,columns:Re,data:u,durable:w,onChange:ue,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:p.page-1,rowsPerPage:p.pageSize,count:p.total,...C,onRowClick:(g,{dataIndex:x})=>{F(u[x])}},customPreButtons:[e.jsx(Ze,{value:a.dateRange,onChange:fe})],customButtons:he,components:{TableFilterList:g=>e.jsx(et,{...g,itemComponent:x=>e.jsx(tt,{...x,canDelete:A=>A?.columnNames?.[A?.index||0]?.name==="sender"})})}})})}),z&&e.jsx(Jn,{refresh:pe,onCancel:oe,notification:z,blocklet:i,tab:B}),e.jsx(St,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:K,onClose:()=>f(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(y,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(kn,{})})})]})}const ts=ae.div`
96
- td.MuiTableCell-footer {
97
- border: none !important;
98
- }
99
- .sent-status-cell {
100
- .resend-btn {
101
- display: none;
102
- }
103
- &:hover {
104
- .resend-btn {
105
- display: flex;
106
- }
107
- }
108
- }
109
-
110
- .custom-toobar-btns {
111
- gap: 4px;
112
- }
113
- `;ns.propTypes={blocklet:h.object.isRequired,customTableButtons:h.array};function ns({blocklet:n={},customTableButtons:s=[]}){return e.jsx(Dn,{blocklet:n,children:e.jsx(es,{customTableButtons:s})})}export{ns as default};
@@ -1,11 +0,0 @@
1
- import{r as u}from"./vendor-react-Dvs43sk9.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,bm as B,I as P,a6 as W,bH as M,aj as X,b$ as H}from"./vendor-mui-core-DWYIngcn.js";import{C as $}from"./Google-BYGsR9Bd.js";import{b as G}from"./vendor-ux-Dln42oC3.js";import{aw as U,f as Y}from"./index-CgCJ2qDh.js";import{A as J}from"./vendor-arcblock-B78OG6SS.js";import{F as Q,R as Z,L as v}from"./logo-uploader-DgG1moIj.js";import{A as ee,a as ne,b as te}from"./collapse-DfvukfIl.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx($,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(G),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?J(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:U({title:"Owner",issuer:Y.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
2
- 0%, 100% {
3
- transform: scale(1) translateX(0);
4
- }
5
- 50% {
6
- transform: scale(1.05) translateX(-3px);
7
- }
8
- 25%, 75% {
9
- transform: scale(1.1) translateX(3px);
10
- }
11
- `,oe={input:D,color:T,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const F=s(y),{editing:I,shaking:E}=F??{},q=l(n,{editing:I}),r=se(n,{editing:I}),t={inputProps:{"data-cy":"schema-form-item-component"},key:y,description:p,editing:I,value:q,onChange:(x,d="change")=>i(n,x,d),componentProps:C,skipButtonDisabled:w,onBlur:()=>c(n)};return n.componentType==="collapse"&&n.children?.length>0?e.jsxs(ee,{children:[e.jsx(ne,{expandIcon:e.jsx(B,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:n.description}),e.jsx(te,{children:n.children.map(x=>e.jsx(V,{item:x,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,formValues:b,disabled:m,loading:f,onCancel:h},x.key))})]}):e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",sx:{color:a&&!q?"error.main":"text.secondary"},children:[p,a&&e.jsx(Z,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{m||F?.edited||w||i(n,b[y],"edit")},children:e.jsx(r,{...t})}),!R&&e.jsx(j,{className:"form-item-action",style:{marginLeft:0},children:I?e.jsxs(e.Fragment,{children:[F.edited?e.jsx(P,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(n,q,"confirm")},disabled:m||f,sx:{animation:E?`${re} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?e.jsx(W,{size:24}):e.jsx(M,{})}):null,e.jsx(P,{"data-cy":"schema-form-item-cancel",onClick:()=>h(n),style:{paddingLeft:F.edited?4:8},disabled:m||f,size:"large",children:e.jsx(X,{})})]}):null})]})]},y)}function ie({schema:n,loading:s=!1,value:l=void 0,defaultValue:i={},onChange:c,style:m={},disabled:f=!1}){const h=Object.prototype.toString.call(l)==="[object Object]",[b,y]=u.useState([]),[p,a]=u.useState(h?l:i),R=u.useMemo(()=>n.length===1,[n]),g=u.useCallback(r=>b.find(t=>t.key===r),[b]);u.useEffect(()=>{R&&n[0]?.required&&y([{key:n[0].key,editing:!0,initialValue:i[n[0].key]}])},[n,R,i]);const C=u.useCallback(r=>{y(t=>t.find(d=>d.key===r.key)?t.map(d=>d.key===r.key?r:{...d}):[r].concat(t))},[]),w=u.useCallback((r,t,x)=>{const{key:d,secure:_}=r,k=g(d)??{...r};k.editing=!0;const z=p[d]!==t;k.edited=t&&k.initialValue!==t,k.initialValue=i[d];const N={...p,[d]:t};z&&a(N),c({[d]:t},{allValues:N,action:x,currentItem:r}),x==="confirm"&&_&&a({...p,[d]:"__encrypted__"}),x==="confirm"&&(k.initialValue=p[d]),["confirm","cancel"].includes(x)&&(k.editing=!1,k.edited=!1),C(k)},[i,p,c,C,g]),F=u.useCallback((r,{editing:t=!1})=>{const{key:x}=r,d=h?l[x]:p[x];return d==="__encrypted__"?t?"":"******":d},[h,l,p]),I=u.useCallback(r=>{const t=g(r.key);t&&w(r,t.initialValue,"cancel")},[g,w]),E=u.useCallback(r=>{const t=g(r.key);!t||!t.edited||(t.shaking=!0,C(t),setTimeout(()=>{t.shaking=!1,C(t)},500))},[g,C]),q=u.useCallback(r=>{const t=g(r.key);!t||!t.edited?I(r):E(r)},[g,E,I]);return e.jsx(ae,{className:"form",style:m,children:n?.map(r=>{const{hidden:t=!1}=r;return t?null:e.jsx(V,{item:r,findEditingItem:g,getItemValue:F,onFormItemChange:w,onFocusOut:q,formValues:p,disabled:f,loading:s,onCancel:I})})})}ie.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};const ae=K(Q)``;export{ie as S};