@abtnode/webapp 1.16.51 → 1.16.52-beta-20250909-073849-4e392ab1

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 (201) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-V7RXKqyP.js → AdapterDayjs-D65E_hJW.js} +1 -1
  4. package/dist/assets/{Add-7-eXJOKT.js → Add-BuxBWbKv.js} +1 -1
  5. package/dist/assets/ArrowDropDown-C9tvAge6.js +1 -0
  6. package/dist/assets/{Autocomplete-CWbaCMBc.js → Autocomplete-CWNFguFL.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-BeUS9EzN.js → Breadcrumbs-C7nUb_aq.js} +1 -1
  8. package/dist/assets/{ButtonGroup-88wnT1Nl.js → ButtonGroup-Ca-yV-4C.js} +1 -1
  9. package/dist/assets/{CSSTransition-BhKCAa_k.js → CSSTransition-BtkiOWZC.js} +1 -1
  10. package/dist/assets/{CallMerge-DyslC22y.js → CallMerge-D2kp3kEl.js} +1 -1
  11. package/dist/assets/{CardContent-CWjONtVx.js → CardContent-CCKBriwF.js} +1 -1
  12. package/dist/assets/{ChevronLeft-DsCa_2Hj.js → ChevronLeft-zMXGyPG9.js} +1 -1
  13. package/dist/assets/{ChevronRight-Dh1NhSQh.js → ChevronRight-BrTU-Laa.js} +1 -1
  14. package/dist/assets/{Clear-vz3__EK4.js → Clear-CfUqGbT5.js} +1 -1
  15. package/dist/assets/{DeleteOutline-BQz9po9Q.js → DeleteOutline-CdS_T1n7.js} +1 -1
  16. package/dist/assets/{Done-Bk5S0dZ-.js → Done-BMzUfIev.js} +1 -1
  17. package/dist/assets/{Edit-ZWYQTIT_.js → Edit-s_UOOLA4.js} +1 -1
  18. package/dist/assets/{ErrorOutline-CWTup7vD.js → ErrorOutline-3Uoca5Wu.js} +1 -1
  19. package/dist/assets/{FilterList-DOLZBYMl.js → FilterList-oCTR8mcc.js} +1 -1
  20. package/dist/assets/{Google-DjCWLWBZ.js → Google-RsZHy3xt.js} +1 -1
  21. package/dist/assets/{HelpOutline-BIIJduw6.js → HelpOutline-Ba2mBnVG.js} +1 -1
  22. package/dist/assets/{Launch-DOQcWt9h.js → Launch-Dj1HRwwB.js} +1 -1
  23. package/dist/assets/{Link-D0HMFRxo.js → Link-D7GjIXxD.js} +1 -1
  24. package/dist/assets/{ListItemButton-hdq-8LOD.js → ListItemButton-B9OsRNX2.js} +1 -1
  25. package/dist/assets/{ListSubheader-OXmzqw9E.js → ListSubheader-BNfIC8TR.js} +1 -1
  26. package/dist/assets/{LoadingButton-Dd30R6FK.js → LoadingButton-C2x1AgPO.js} +1 -1
  27. package/dist/assets/{MoreVert-CRSB-gtE.js → MoreVert-DLy2w-Ib.js} +1 -1
  28. package/dist/assets/{OpenInNew-nb9brzvh.js → OpenInNew-XVhTNbF5.js} +1 -1
  29. package/dist/assets/{Refresh-DpCUQ-hQ.js → Refresh-D39GYnGD.js} +1 -1
  30. package/dist/assets/{Search-Caj8zEyB.js → Search-BRG28-bq.js} +1 -1
  31. package/dist/assets/{Stepper-xU4PwGHV.js → Stepper-D3o-ipys.js} +1 -1
  32. package/dist/assets/{Switch-Cr0eK23s.js → Switch-BLUHXgom.js} +1 -1
  33. package/dist/assets/{TableSearch-BVy-Zwre.js → TableSearch-Cuohy6oG.js} +1 -1
  34. package/dist/assets/{ToggleButtonGroup-DfdLS7WR.js → ToggleButtonGroup-C6GsXzIq.js} +1 -1
  35. package/dist/assets/{Verified-QBG89RkJ.js → Verified-Sbsjq85f.js} +1 -1
  36. package/dist/assets/{VerifiedUser-DRV2TIup.js → VerifiedUser-BYFzI6ca.js} +1 -1
  37. package/dist/assets/{ViewList-D3SEslCd.js → ViewList-BPHxMt8z.js} +1 -1
  38. package/dist/assets/{_createAggregator-C1jyyLx1.js → _createAggregator-DroWaLq8.js} +1 -1
  39. package/dist/assets/{actions-PgvlZmiV.js → actions-CRcVnE0o.js} +1 -1
  40. package/dist/assets/{actions-BhT4KCkB.js → actions-pGu7rB8t.js} +1 -1
  41. package/dist/assets/{agreement-DA33xTFi.js → agreement-uOUtZf-O.js} +1 -1
  42. package/dist/assets/api-rtaXucQX.js +1 -0
  43. package/dist/assets/{appearance-BPq1UJTg.js → appearance-uCnPBecX.js} +1 -1
  44. package/dist/assets/{ar-CPI6kJBB.js → ar-DGfbWcRb.js} +1 -1
  45. package/dist/assets/{audit-logs-Ctg35AJy.js → audit-logs-Betoa8v-.js} +2 -2
  46. package/dist/assets/{base-chart-Dx4PwDO4.js → base-chart-CU08SDh8.js} +1 -1
  47. package/dist/assets/{blocklet-CdI4-ak7.js → blocklet-CE5XgbbR.js} +1 -1
  48. package/dist/assets/chain-fyEjDjKA.js +6 -0
  49. package/dist/assets/{click-to-copy-C8Sc78ZH.js → click-to-copy-DBwd2qVy.js} +1 -1
  50. package/dist/assets/client-BqXjUJmr.js +1 -0
  51. package/dist/assets/cloneDeep-_TP0P9Bh.js +1 -0
  52. package/dist/assets/{collapse-BmNnb9sz.js → collapse-DYizojFh.js} +1 -1
  53. package/dist/assets/config-navigation-DdVCj7lN.js +457 -0
  54. package/dist/assets/{connect-to-DfZIDYiw.js → connect-to-BHJ6ZISO.js} +5 -5
  55. package/dist/assets/{cssMode-BF4q4okU.js → cssMode-BoRMkbtc.js} +1 -1
  56. package/dist/assets/{de-DXdF82Jr.js → de-DGZI-Bsh.js} +1 -1
  57. package/dist/assets/{delete-confirm-D-z4OiCT.js → delete-confirm-CEQXI_Kb.js} +1 -1
  58. package/dist/assets/{depsEqual-Cr14y622.js → depsEqual-ciSeh1BA.js} +1 -1
  59. package/dist/assets/{detail-DST4nwih.js → detail-jVJpntfg.js} +3 -3
  60. package/dist/assets/{domains-DrwaxbvS.js → domains-B4zPTt82.js} +1 -1
  61. package/dist/assets/{download-OPjh7Dhu.js → download-DbzpWKEp.js} +1 -1
  62. package/dist/assets/{edit.svg-BhoBkiKe.js → edit.svg-CUba2Jvc.js} +1 -1
  63. package/dist/assets/emotion-cache.browser.esm-Btm_v21f.js +1 -0
  64. package/dist/assets/engine-DvqNxRv5.js +1 -0
  65. package/dist/assets/{es-Cdb297yS.js → es-CMwFpp7C.js} +1 -1
  66. package/dist/assets/{fr-CQValz_y.js → fr-eKsI9Vcp.js} +1 -1
  67. package/dist/assets/{freemarker2-CsYcx0mG.js → freemarker2-BNa_PMdu.js} +1 -1
  68. package/dist/assets/{get-safe-url-D4QANS7R.js → get-safe-url-BKVSUfZ3.js} +1 -1
  69. package/dist/assets/getValidReactChildren-pQYfZHaB.js +1 -0
  70. package/dist/assets/{graphqlMode-CEuXGwU0.js → graphqlMode-BLg3m8OF.js} +2 -2
  71. package/dist/assets/{handlebars-UHGxvaSD.js → handlebars-CdbDI-cc.js} +1 -1
  72. package/dist/assets/{hi-CAensap9.js → hi-C0JqybmN.js} +1 -1
  73. package/dist/assets/{html-C1vTBkRn.js → html-BvZdPiaT.js} +1 -1
  74. package/dist/assets/{html-title-CMu--CLy.js → html-title-BHx37gaF.js} +1 -1
  75. package/dist/assets/{htmlMode-BggN4Rb6.js → htmlMode-B7CW9X1N.js} +1 -1
  76. package/dist/assets/{id-6AFgcYKj.js → id-DHF6PX-M.js} +1 -1
  77. package/dist/assets/{iframe-CvI--k7K.js → iframe-BeqfTz4i.js} +1 -1
  78. package/dist/assets/{index-gXZxZJIx.js → index-1S2JWh7l.js} +1 -1
  79. package/dist/assets/{index-BwjlL2Kh.js → index-2e0gieTu.js} +1 -1
  80. package/dist/assets/{index-gFJpaRWb.js → index-2mNTnhuF.js} +1 -1
  81. package/dist/assets/{index-PupDr-tS.js → index-3kgC1Nym.js} +1 -1
  82. package/dist/assets/{index-fVX8tL-Q.js → index-6GBe1q15.js} +3 -3
  83. package/dist/assets/{index-JPRaNDiB.js → index-7AUqhPuK.js} +1 -1
  84. package/dist/assets/{index-DN15vW-d.js → index-9VZ-yso9.js} +1 -1
  85. package/dist/assets/{index-CJBx_cpm.js → index-B4634Y1P.js} +1 -1
  86. package/dist/assets/{index-BcZW_Njr.js → index-B8K3eja9.js} +1 -1
  87. package/dist/assets/{index-e4cQdlVT.js → index-BBKncSQI.js} +1 -1
  88. package/dist/assets/{index-CcPSAXJC.js → index-BBwTny8t.js} +1 -1
  89. package/dist/assets/{index-COelK26a.js → index-BD-zoT5J.js} +4 -4
  90. package/dist/assets/{index-6cB3i_74.js → index-BJTXvu7V.js} +1 -1
  91. package/dist/assets/{index-zmLURVwA.js → index-BNgNadZA.js} +1 -1
  92. package/dist/assets/{index-KlyXfxtH.js → index-BTth0Avx.js} +1 -1
  93. package/dist/assets/{index-Cjda8MxV.js → index-BYmI15t3.js} +1 -1
  94. package/dist/assets/{index-CaVHeI69.js → index-BcIr2X1S.js} +34 -34
  95. package/dist/assets/{index-CIYlTEmt.js → index-BfwrW--S.js} +1 -1
  96. package/dist/assets/{index-D_HvYLZX.js → index-BhYH8ghA.js} +2 -2
  97. package/dist/assets/{index-D2gjCQvJ.js → index-BkGSdfE5.js} +3 -3
  98. package/dist/assets/{index-hwjSVkr9.js → index-BoBJzeiT.js} +1 -1
  99. package/dist/assets/{index-DVP4mis5.js → index-CKQB1o8K.js} +1 -1
  100. package/dist/assets/{index-Cfv8rye0.js → index-CKjp5Lom.js} +1 -1
  101. package/dist/assets/{index-CIUJRz-P.js → index-CUrsgDRV.js} +1 -1
  102. package/dist/assets/{index-BEUFNuBP.js → index-CX3EW1PD.js} +1 -1
  103. package/dist/assets/{index-oN0VLX7B.js → index-Ca0ZcUgz.js} +1 -1
  104. package/dist/assets/{index-B1mp7zTp.js → index-Cgo1ijTq.js} +1 -1
  105. package/dist/assets/{index-BrouHktD.js → index-Cl5-xO-O.js} +1 -1
  106. package/dist/assets/{index-B8SKOyVZ.js → index-CxTqh5oG.js} +1 -1
  107. package/dist/assets/{index-DlumR6-r.js → index-CzWTJYeS.js} +1 -1
  108. package/dist/assets/{index-BCjznEDD.js → index-D7lzrhp6.js} +215 -215
  109. package/dist/assets/{index-DJt0P9UZ.js → index-D9c_n0Zn.js} +1 -1
  110. package/dist/assets/{index-TD9tpMf3.js → index-DKLXZtmN.js} +1 -1
  111. package/dist/assets/{index-BNMMf79b.js → index-DZdX_ov1.js} +1 -1
  112. package/dist/assets/{index-BcCAYOEg.js → index-DfljrMq-.js} +1 -1
  113. package/dist/assets/{index-Cbv8PaaQ.js → index-DleR_te_.js} +1 -1
  114. package/dist/assets/{index-UUvY9lTK.js → index-GpweUAuu.js} +1 -1
  115. package/dist/assets/{index-DxswKF4l.js → index-KviLu8sL.js} +1 -1
  116. package/dist/assets/{index-CXFs83DK.js → index-OaoSeey4.js} +3 -3
  117. package/dist/assets/{index-CwJTlpdS.js → index-Zsmw8O9i.js} +2 -2
  118. package/dist/assets/{index-DWNLuD8k.js → index-g1FfUVZs.js} +3 -3
  119. package/dist/assets/index-h4tM9WQ3.js +1 -0
  120. package/dist/assets/{index-C5Qu9Vfw.js → index-mURPOBxV.js} +1 -1
  121. package/dist/assets/{index-BVkuT-iA.js → index-nbDfygKJ.js} +9 -9
  122. package/dist/assets/{index-DFNWDU08.js → index-vZ0X00a7.js} +1 -1
  123. package/dist/assets/{index.esm-BMMBbvkk.js → index.esm-BJXte6-L.js} +1 -1
  124. package/dist/assets/{install-from-url-BVVKjfjP.js → install-from-url-CtLp7MLy.js} +1 -1
  125. package/dist/assets/{invitation-COAlxja2.js → invitation-DQv8HAq6.js} +1 -1
  126. package/dist/assets/{is-path-prefix-equal-DXaCbZpO.js → is-path-prefix-equal-BIFyL0Ru.js} +1 -1
  127. package/dist/assets/{item-C-IQVzix.js → item-DimcdRAg.js} +9 -9
  128. package/dist/assets/{ja-D59y1sZ9.js → ja-c-6MaUg1.js} +1 -1
  129. package/dist/assets/{javascript-Bgq9DttZ.js → javascript-CwbxIHEQ.js} +1 -1
  130. package/dist/assets/{jsonMode-gicj4lsZ.js → jsonMode-DLbgXAH0.js} +1 -1
  131. package/dist/assets/{ko-DlSyClni.js → ko-CTFi4Ndk.js} +1 -1
  132. package/dist/assets/{liquid-Ci2GleTa.js → liquid-q1OjFgE0.js} +1 -1
  133. package/dist/assets/{list-header-Bimu_qjE.js → list-header-BB26rDnk.js} +1 -1
  134. package/dist/assets/{log-Do7yF-hd.js → log-C6UozWKv.js} +1 -1
  135. package/dist/assets/{lottie-react.esm-DfMKPb7z.js → lottie-react.esm-SyXHnE8o.js} +1 -1
  136. package/dist/assets/{mdx-eB0FmO6P.js → mdx-DHgnA-tS.js} +1 -1
  137. package/dist/assets/{memory-BCE6QiNB.js → memory-YxMv8BQK.js} +1 -1
  138. package/dist/assets/{metric-Bk0iXTai.js → metric-DreAuOrl.js} +1 -1
  139. package/dist/assets/omit-Cqu-CgYq.js +1 -0
  140. package/dist/assets/{overview-DltjzkWj.js → overview-DUGPpH_y.js} +1 -1
  141. package/dist/assets/{permission-nS6Be9Zz.js → permission-BcnxfENO.js} +1 -1
  142. package/dist/assets/{preference-BcV3F-Xa.js → preference-YGKAVWVr.js} +3 -3
  143. package/dist/assets/{pt-C_3CX1PR.js → pt-QkdDdQuw.js} +1 -1
  144. package/dist/assets/{python-EI0UxD3D.js → python-BI4r0Wbo.js} +1 -1
  145. package/dist/assets/{raf-schd.esm-D8Xvrzgn.js → raf-schd.esm-DiR_lSIX.js} +1 -1
  146. package/dist/assets/{razor-BSy3NnVc.js → razor-BY4SRdR7.js} +1 -1
  147. package/dist/assets/{rotate-session-key-6xIXKXc3.js → rotate-session-key-CRqisNwo.js} +1 -1
  148. package/dist/assets/{ru-FBGLUlo5.js → ru-swMH4bvc.js} +1 -1
  149. package/dist/assets/{runtime-Dxydq6o1.js → runtime-BANAk_eI.js} +1 -1
  150. package/dist/assets/schema-_5vI79Rv.js +1 -0
  151. package/dist/assets/sdk-D1MrqeFi.js +1 -0
  152. package/dist/assets/{service-BiVWc9jf.js → service-XYcHOpXT.js} +1 -1
  153. package/dist/assets/{shorten-label-1yenXb9Y.js → shorten-label-C2TvZwiB.js} +1 -1
  154. package/dist/assets/{simple-select-Bt3Ltwm7.js → simple-select-5PaLI5iC.js} +1 -1
  155. package/dist/assets/{spaces-BnSCxjeY.js → spaces-BjltrgOM.js} +1 -1
  156. package/dist/assets/{status-CXAtxXK1.js → status-BGZp6E2_.js} +1 -1
  157. package/dist/assets/{status-BYLk6wlC.js → status-BId3C3tR.js} +1 -1
  158. package/dist/assets/{switch-control-D5SPzkUx.js → switch-control-93IAc2BI.js} +1 -1
  159. package/dist/assets/{table-icons-BGs1mthN.js → table-icons--cM-zbAz.js} +1 -1
  160. package/dist/assets/{team-BlgLSbQd.js → team-D9qX7mGm.js} +1 -1
  161. package/dist/assets/{th-DmSMYMH5.js → th-DuqieD90.js} +1 -1
  162. package/dist/assets/{toLower-BiqFoOo1.js → toLower-DdXVIYtI.js} +1 -1
  163. package/dist/assets/toUpper-BZzsNTfW.js +1 -0
  164. package/dist/assets/{traffic-d8ue0hO5.js → traffic-CQiQ0sPg.js} +1 -1
  165. package/dist/assets/{tsMode-DFSmR0ZD.js → tsMode-riDB0Svo.js} +1 -1
  166. package/dist/assets/{typescript-Dvh-IrHb.js → typescript-DevS6KNa.js} +1 -1
  167. package/dist/assets/{url-evaluation-DFEEqTh-.js → url-evaluation-BZtvoS6V.js} +1 -1
  168. package/dist/assets/{url-join-Dra-Zi4G.js → url-join-15mVE4xQ.js} +1 -1
  169. package/dist/assets/{use-mobile-FV0M1ZqW.js → use-mobile-C3Kt9jiO.js} +1 -1
  170. package/dist/assets/{use-mobile-BOq_qktK.js → use-mobile-C3R5m8C9.js} +1 -1
  171. package/dist/assets/{useAsync-B7FuCRJD.js → useAsync-CnNdbLcF.js} +1 -1
  172. package/dist/assets/{useAsyncRetry-C1rqgcS3.js → useAsyncRetry-CKdA5B4J.js} +1 -1
  173. package/dist/assets/{useLocalStorage-BjyUhOL-.js → useLocalStorage-BacdU7Dw.js} +1 -1
  174. package/dist/assets/{useThemeProps-BZz8f5dF.js → useThemeProps-DoaWGRR_.js} +1 -1
  175. package/dist/assets/{util-vH7l3iJe.js → util-BTYi57HE.js} +1 -1
  176. package/dist/assets/{vi-CjDg6MoB.js → vi-42QzvOuM.js} +1 -1
  177. package/dist/assets/{wait-container-4i1AkyPx.js → wait-container-Cf2fBIo1.js} +1 -1
  178. package/dist/assets/{without-wallet-CG4TWMeN.js → without-wallet-BmXN4c0R.js} +1 -1
  179. package/dist/assets/wrap-locale-CRCmG_2i.js +1 -0
  180. package/dist/assets/{xml-7zq5MXwn.js → xml-DkReoolA.js} +1 -1
  181. package/dist/assets/{yaml-DdyDZl-6.js → yaml-D5EuAiQc.js} +1 -1
  182. package/dist/assets/{zh-DaR6QxjC.js → zh-C-k4DKK-.js} +1 -1
  183. package/dist/assets/{zh-tw-DaxtX1HY.js → zh-tw-Dxa4oubT.js} +1 -1
  184. package/dist/index.html +1 -1
  185. package/dist/service-worker.js +1 -1
  186. package/package.json +1 -1
  187. package/dist/assets/ArrowDropDown-B9aDIKPi.js +0 -1
  188. package/dist/assets/api-BMlRo0OB.js +0 -1
  189. package/dist/assets/chain-CXX76TQL.js +0 -6
  190. package/dist/assets/client-ChcYsV1G.js +0 -1
  191. package/dist/assets/cloneDeep-CQZK-s_V.js +0 -1
  192. package/dist/assets/config-navigation-8rTODeF1.js +0 -457
  193. package/dist/assets/emotion-cache.browser.esm-JDbaITlA.js +0 -1
  194. package/dist/assets/engine-siiM_CrH.js +0 -1
  195. package/dist/assets/getValidReactChildren-BK9M6ULL.js +0 -1
  196. package/dist/assets/index-ee21MdrR.js +0 -1
  197. package/dist/assets/omit-DZngMfUZ.js +0 -1
  198. package/dist/assets/schema-BYsNslfD.js +0 -1
  199. package/dist/assets/sdk-BLZzaYH6.js +0 -1
  200. package/dist/assets/toUpper-BMdlX8ly.js +0 -1
  201. package/dist/assets/wrap-locale-CCw957fx.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ie as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ig as et,v as Oe,f1 as tt,fo as ye,fI as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ih as Ct,ii as Nt,$ as nt,ij as wt,ik as Rt,il as Tt,im as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,io as Lt,a4 as kt}from"./index-BCjznEDD.js";import{d as Ft,H as at,g as Pt}from"./index-zmLURVwA.js";import{R as _e,S as _t}from"./actions-BhT4KCkB.js";import{B as Bt}from"./index-DlumR6-r.js";import{S as me}from"./shorten-label-1yenXb9Y.js";import{v as ot}from"./index-CcPSAXJC.js";import{T as zt}from"./html-title-CMu--CLy.js";import{R as Wt}from"./Refresh-DpCUQ-hQ.js";import{D as Mt,g as Ht}from"./traffic-d8ue0hO5.js";import{u as Kt}from"./use-mobile-FV0M1ZqW.js";import"./FilterList-DOLZBYMl.js";import"./CSSTransition-BhKCAa_k.js";import"./emotion-cache.browser.esm-JDbaITlA.js";import"./index-DVP4mis5.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Cr14y622.js";import"./index-BNMMf79b.js";import"./TableSearch-BVy-Zwre.js";import"./Search-Caj8zEyB.js";import"./Clear-vz3__EK4.js";import"./MoreVert-CRSB-gtE.js";import"./useLocalStorage-BjyUhOL-.js";import"./url-evaluation-DFEEqTh-.js";import"./get-safe-url-D4QANS7R.js";import"./ButtonGroup-88wnT1Nl.js";import"./getValidReactChildren-BK9M6ULL.js";import"./permission-nS6Be9Zz.js";import"./index.esm-BMMBbvkk.js";import"./collapse-BmNnb9sz.js";import"./blocklet-CdI4-ak7.js";import"./Switch-Cr0eK23s.js";import"./iframe-CvI--k7K.js";import"./ChevronLeft-DsCa_2Hj.js";import"./ChevronRight-Dh1NhSQh.js";import"./index-DBii9-f-.js";import"./base-chart-Dx4PwDO4.js";import"./index-JPRaNDiB.js";import"./AdapterDayjs-V7RXKqyP.js";import"./useThemeProps-BZz8f5dF.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),qt=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):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:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{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(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.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(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"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(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[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(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
1
+ import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as U,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ih as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ii as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as Ue,av as vt,ij as Ct,ik as Nt,$ as nt,il as wt,im as Rt,io as Tt,ip as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,iq as Lt,a4 as kt}from"./index-D7lzrhp6.js";import{d as Ft,H as at,g as Pt}from"./index-BNgNadZA.js";import{R as _e,S as _t}from"./actions-pGu7rB8t.js";import{B as Bt}from"./index-CzWTJYeS.js";import{S as me}from"./shorten-label-C2TvZwiB.js";import{v as ot}from"./index-BBwTny8t.js";import{T as zt}from"./html-title-BHx37gaF.js";import{R as Wt}from"./Refresh-D39GYnGD.js";import{D as Mt,g as Ht}from"./traffic-CQiQ0sPg.js";import{u as Kt}from"./use-mobile-C3Kt9jiO.js";import"./FilterList-oCTR8mcc.js";import"./CSSTransition-BtkiOWZC.js";import"./emotion-cache.browser.esm-Btm_v21f.js";import"./index-CKQB1o8K.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-ciSeh1BA.js";import"./index-DZdX_ov1.js";import"./TableSearch-Cuohy6oG.js";import"./Search-BRG28-bq.js";import"./Clear-CfUqGbT5.js";import"./MoreVert-DLy2w-Ib.js";import"./useLocalStorage-BacdU7Dw.js";import"./url-evaluation-BZtvoS6V.js";import"./get-safe-url-BKVSUfZ3.js";import"./ButtonGroup-Ca-yV-4C.js";import"./getValidReactChildren-pQYfZHaB.js";import"./permission-BcnxfENO.js";import"./index.esm-BJXte6-L.js";import"./collapse-DYizojFh.js";import"./blocklet-CE5XgbbR.js";import"./Switch-BLUHXgom.js";import"./iframe-BeqfTz4i.js";import"./ChevronLeft-zMXGyPG9.js";import"./ChevronRight-BrTU-Laa.js";import"./index-DBii9-f-.js";import"./base-chart-CU08SDh8.js";import"./index-7AUqhPuK.js";import"./AdapterDayjs-D65E_hJW.js";import"./useThemeProps-DoaWGRR_.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):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:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{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(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.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(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const H=await oe(c,o.receiver);await be(1),q({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){U.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"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(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[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(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o a
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 rs(t){const{wallet:s,push:n,email:r,webhook:a}=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})},...a.total>0?[{name:"Webhook",value:e.jsx(de,{item:a,isWebhook:!0})}]:[]]}function ls(t,s,n){const{wallet:r,push:a,email:l,webhook:x}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.PUSH,item:a,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,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}=Q(),r=s?t.success.length:t.success,a=t.total,l=r===a?"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(se,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(a)," ",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=D.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:a=!1}){const{t:l}=Q(),{success:x,failed:u,pending:T}=s,f=ss(t),v=n?x.length:x,C=n?u.length:u,F=n?T.length:T,_=async L=>{L.stopPropagation();const W=n?[...new Set([...x,...u].map(U=>U))]:[];await r([t],[],!0,W)},N=v+C,V=N>0?v/N*100:0,P=N>0?C/N*100:0;return e.jsxs(cs,{successRatio:V,failedRatio:P,children:[e.jsxs($,{variant:"h6",children:[f," (",s.total,")"]}),e.jsxs($,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Le.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(y,{className:"unsent-area",children:[e.jsxs(y,{children:[e.jsxs(se,{config:{status:"failed"},enableTooltip:!1,children:[fe(C)," ",l("notification.sendStatus.failed")]}),e.jsxs(se,{config:{status:"pending"},enableTooltip:!1,children:[fe(F)," ",l("notification.sendStatus.pending")]})]}),C>0&&e.jsx(y,{className:"resend-btn",children:e.jsx(Oe,{size:"small",color:"primary",loading:a,variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const a=X(()=>s==="simple"?rs(t):ls(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:a.map(l=>e.jsx(ot,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(qe,{container:!0,spacing:2,children:a.map(l=>e.jsx(qe,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const cs=ie(y)`
30
+ `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function rs(t){const{wallet:s,push:n,email:r,webhook:a}=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})},...a.total>0?[{name:"Webhook",value:e.jsx(de,{item:a,isWebhook:!0})}]:[]]}function ls(t,s,n){const{wallet:r,push:a,email:l,webhook:x}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.PUSH,item:a,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:D.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,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}=Q(),r=s?t.success.length:t.success,a=t.total,l=r===a?"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(se,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(a)," ",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=D.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:a=!1}){const{t:l}=Q(),{success:x,failed:u,pending:T}=s,f=ss(t),v=n?x.length:x,C=n?u.length:u,F=n?T.length:T,_=async L=>{L.stopPropagation();const W=n?[...new Set([...x,...u].map(q=>q))]:[];await r([t],[],!0,W)},N=v+C,V=N>0?v/N*100:0,P=N>0?C/N*100:0;return e.jsxs(cs,{successRatio:V,failedRatio:P,children:[e.jsxs($,{variant:"h6",children:[f," (",s.total,")"]}),e.jsxs($,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Le.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(y,{className:"unsent-area",children:[e.jsxs(y,{children:[e.jsxs(se,{config:{status:"failed"},enableTooltip:!1,children:[fe(C)," ",l("notification.sendStatus.failed")]}),e.jsxs(se,{config:{status:"pending"},enableTooltip:!1,children:[fe(F)," ",l("notification.sendStatus.pending")]})]}),C>0&&e.jsx(y,{className:"resend-btn",children:e.jsx(Oe,{size:"small",color:"primary",loading:a,variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const a=X(()=>s==="simple"?rs(t):ls(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:a.map(l=>e.jsx(ot,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ue,{container:!0,spacing:2,children:a.map(l=>e.jsx(Ue,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const cs=ie(y)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o a
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;mt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function mt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:a,locale:l}=Q(),{getComponent:x,resendNotification:u}=Be(),[T,f]=g.useState(!1),v=X(()=>x(t.componentDid)||n,[n,t.componentDid]),C=De({tab:r||"info"}),F=g.useCallback(async(h,S,I=!0,w=[])=>{if(!h.length||!t.id)return;const E=S.length>0?S:t?.receivers?.map(B=>B.receiver);if(!E.length)return;let k=[...h];if(k.includes(D.NOTIFICATION_SEND_CHANNEL.PUSH)&&!dt(n)&&(q.warning(a("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),k=k.filter(B=>B!==D.NOTIFICATION_SEND_CHANNEL.PUSH)),k.includes(D.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ct(n)&&(q.warning(a("notification.sendStatus.reason.unavailable",{channel:"Email"})),k=k.filter(B=>B!==D.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!k.length)try{f(!0),await u({notificationId:t.id,receivers:E,channels:k,resendFailedOnly:I,...k.includes("webhook")&&w.length?{webhookUrls:w}:{}}),q.success("Message has been sent!")}catch(B){console.error("handleResend error",{error:B}),q.error(B.response?B.response.statusText:B.message)}finally{f(!1)}},[n,t.id,t?.receivers,u,a]),_=X(()=>Ct(t),[t]),N=X(()=>Nt(t),[t]),V=X(()=>_?t?.actorInfo:[],[t]),P=X(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:a("notification.from"),value:_&&N?e.jsx(wt,{actors:V,teamDid:P,size:32,showName:!0}):e.jsx(Rt,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:a("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:a("notification.body"),value:_?e.jsx(Tt,{notification:t,blocklet:n}):e.jsx(It,{notification:t,rows:0})},{name:a("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:a("notification.createdAt"),value:e.jsx(Et,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(S=>e.jsx(ot,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:S.name,children:S.value},S.name))}const W={info:{label:a("common.basicInfo"),value:"info",component:L},receivers:{label:a("notification.receiver"),value:"receivers"},statistics:{label:a("notification.statistics"),value:"statistics"}},U=Object.values(W).map(({label:h,value:S})=>({label:h,value:S})),Y=W[C.tab]||W.info,Z=h=>{C.tab=h};return e.jsx(nt,{title:a("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{C.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(us,{children:[e.jsx(y,{className:"tabs",sx:{mx:3},children:e.jsx(zt,{tabs:U,current:C.tab,onChange:Z,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[C.tab==="receivers"&&e.jsx(is,{notificationId:t.id,resending:T,handleResend:F}),C.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:T,onResend:F}),C.tab==="info"&&e.jsx(Y.component,{})]})]})})}const ds=g.memo(mt),us=ie.div`
48
+ `;mt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function mt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:a,locale:l}=Q(),{getComponent:x,resendNotification:u}=Be(),[T,f]=g.useState(!1),v=X(()=>x(t.componentDid)||n,[n,t.componentDid]),C=De({tab:r||"info"}),F=g.useCallback(async(h,S,I=!0,w=[])=>{if(!h.length||!t.id)return;const E=S.length>0?S:t?.receivers?.map(B=>B.receiver);if(!E.length)return;let k=[...h];if(k.includes(D.NOTIFICATION_SEND_CHANNEL.PUSH)&&!dt(n)&&(U.warning(a("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),k=k.filter(B=>B!==D.NOTIFICATION_SEND_CHANNEL.PUSH)),k.includes(D.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ct(n)&&(U.warning(a("notification.sendStatus.reason.unavailable",{channel:"Email"})),k=k.filter(B=>B!==D.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!k.length)try{f(!0),await u({notificationId:t.id,receivers:E,channels:k,resendFailedOnly:I,...k.includes("webhook")&&w.length?{webhookUrls:w}:{}}),U.success("Message has been sent!")}catch(B){console.error("handleResend error",{error:B}),U.error(B.response?B.response.statusText:B.message)}finally{f(!1)}},[n,t.id,t?.receivers,u,a]),_=X(()=>Ct(t),[t]),N=X(()=>Nt(t),[t]),V=X(()=>_?t?.actorInfo:[],[t]),P=X(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:a("notification.from"),value:_&&N?e.jsx(wt,{actors:V,teamDid:P,size:32,showName:!0}):e.jsx(Rt,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:a("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:a("notification.body"),value:_?e.jsx(Tt,{notification:t,blocklet:n}):e.jsx(It,{notification:t,rows:0})},{name:a("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:a("notification.createdAt"),value:e.jsx(Et,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(S=>e.jsx(ot,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:S.name,children:S.value},S.name))}const W={info:{label:a("common.basicInfo"),value:"info",component:L},receivers:{label:a("notification.receiver"),value:"receivers"},statistics:{label:a("notification.statistics"),value:"statistics"}},q=Object.values(W).map(({label:h,value:S})=>({label:h,value:S})),Y=W[C.tab]||W.info,Z=h=>{C.tab=h};return e.jsx(nt,{title:a("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{C.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(us,{children:[e.jsx(y,{className:"tabs",sx:{mx:3},children:e.jsx(zt,{tabs:q,current:C.tab,onChange:Z,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[C.tab==="receivers"&&e.jsx(is,{notificationId:t.id,resending:T,handleResend:F}),C.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:T,onResend:F}),C.tab==="info"&&e.jsx(Y.component,{})]})]})})}const ds=g.memo(mt),us=ie.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o a
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function Ne({blocklet:t=null,label:s=""}){return e.jsx(ps,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(it,{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})})}ht.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ht({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(r=>e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:a=>n(a,r)},r))]})}function fs(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ms({customTableButtons:t}){const{t:s,locale:n}=Q(),r=Qe(),a=g.useMemo(()=>Je(r,ut()),[r]),[l,x]=g.useState(!1),{data:u,paging:T,blocklet:f,fetch:v,getComponent:C,componentDids:F,inService:_,teamDid:N}=Be(),V=g.useRef(null),[P,L]=g.useState(null),[W,U]=g.useState("info"),Y=Kt(),[Z,h]=g.useState(!1),S=`notification-records-${f.meta?.did}`,I=Pt(S),[w,E]=g.useState({pageSize:I.rowsPerPage||10,page:I.page?I.page+1:1,dids:I.dids||[],dateRange:I.dateRange||[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),k=X(()=>{if(!f.children||!f.children.length)return[];const m=[];return f.children.forEach(p=>{const b=p.did||p.meta?.did;F.includes(b)&&(p.ancestors=[f],m.push(p))}),m},[F,f]),B=async m=>{try{x(!0),await v(m),x(!1)}finally{x(!1)}};g.useEffect(()=>{B(w)},[w]),g.useEffect(()=>{const m=u.find(p=>p.id===P?.id);P&&m&&L({...m})},[u]);const ae=(m,p,b,R)=>{m.stopPropagation();const O=b.filter(A=>A!==p);E(A=>({...A,[R]:O,page:1}))},ne=({page:m,rowsPerPage:p,filterList:b})=>{const[R=[],,,,O=[]]=b;w.pageSize!==p?E(A=>({...A,pageSize:p,page:1})):w.page!==m+1?E(A=>({...A,page:m+1})):pe(w.dids,R)?pe(w.severities,O)||E(A=>({...A,severities:O,page:1})):E(A=>({...A,dids:R,page:1}))},ee=g.useCallback(()=>{L(null),U("info")},[]),oe=g.useCallback(()=>{v(w)},[v,w]),ge=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:m=>m.map((p,b)=>{if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${b}`);const R=k.find(O=>(O.did||O.meta?.did)===p);return e.jsx(Ne,{blocklet:R,label:R?.title||R?.meta?.title},p)}),update:(m,p,b)=>(m[b].splice(p,1),m)},filterOptions:{names:k,logic:(m,p)=>p.length?!p.includes(m):!1,display:(m,p,b,R)=>e.jsxs(Pe,{style:{width:"380px"},children:[e.jsx(Dt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ot,{multiple:!0,value:m[b],renderValue:O=>e.jsx(y,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:O.map(A=>{if(A==="system")return e.jsx("span",{children:s("notification.system")},A);const J=k.find(xe=>(xe.did||xe.meta?.did)===A);return e.jsx(Ne,{blocklet:J,label:J?.title||J?.meta?.title},A)})}),onChange:O=>{m[b]=O.target.value,p(m[b],b,R)},children:[e.jsx($e,{value:"system",children:s("notification.system")}),k.map(O=>{const A=O.did||O.meta?.did;return e.jsx($e,{value:A,children:e.jsx(Ne,{blocklet:O,label:O.title||O.meta?.title})},A)})]})]})},customBodyRenderLite:m=>{const p=u[m],b=C(p.componentDid);return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[b?e.jsx(it,{size:32,blocklet:b,ancestors:b.ancestors??[]}):e.jsx(At,{blocklet:f,size:32}),e.jsx(me,{maxLength:50,children:b?.meta?.title||f?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:m=>{const p=u[m],{receivers:b}=p;return e.jsx(Lt,{total:b.length,renderSurplus:R=>R<100?e.jsxs("span",{children:["+",R]}):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:R=>{R.stopPropagation(),L(p),U("receivers")},children:b.map(R=>{const{receiverUser:O}=R,A=st(O.avatar,N,_);return e.jsx(Ze,{alt:O.fullName,src:`${A}?imageFilter=resize&w=48&h=48`,size:32,did:R.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},R.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:m=>{const p=u[m];return e.jsx(y,{onClick:b=>{b.stopPropagation(),L(p),U("statistics")},children:e.jsx(Ke,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:m=>{const p=u[m];return e.jsx(me,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:m=>{const p=u[m];return e.jsx(he,{severity:p.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:m=>e.jsx(ht,{list:m,label:s("notification.severity"),onDelete:(p,b)=>{p.stopPropagation(),ae(p,b,ge[4].options.filterList,"severities")}}),update:Se},filterOptions:{names:Ve,fullWidth:!0,logic:ve,display:(m,p,b,R)=>e.jsx(fs,{label:s("notification.severity"),filterList:m,onChange:p,index:b,column:R,filterValues:Ve})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:m=>{const{createdAt:p}=u[m];return e.jsx(et,{value:p,locale:n,shouldUpdate:!0})}}}],re=m=>{E(p=>({...p,dateRange:m,page:1}))},le=[e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(kt,{onClick:()=>h(!0),sx:{p:Y?0:void 0},children:e.jsx(_t,{})},"settings"),Y?e.jsx($,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(y,{ref:V,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(hs,{children:e.jsx(tt,{theme:a,children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:l,locale:n,columns:ge,data:u,durable:S,onChange:ne,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:T.page-1,rowsPerPage:T.pageSize,count:T.total,...I,onRowClick:(m,{dataIndex:p})=>{L(u[p])}},customPreButtons:[e.jsx(We,{value:w.dateRange,onChange:re})],customButtons:le,components:{TableFilterList:m=>e.jsx(Me,{...m,itemComponent:p=>e.jsx(He,{...p,canDelete:b=>b?.columnNames?.[b?.index||0]?.name==="sender"})})}})})}),P&&e.jsx(ds,{refresh:oe,onCancel:ee,notification:P,blocklet:f,tab:W}),e.jsx(nt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:Z,onClose:()=>h(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(y,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(Bt,{})})})]})}const hs=ie.div`
95
+ `;function Ne({blocklet:t=null,label:s=""}){return e.jsx(ps,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(it,{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})})}ht.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ht({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(r=>e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:a=>n(a,r)},r))]})}function fs(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ms({customTableButtons:t}){const{t:s,locale:n}=Q(),r=Qe(),a=g.useMemo(()=>Je(r,ut()),[r]),[l,x]=g.useState(!1),{data:u,paging:T,blocklet:f,fetch:v,getComponent:C,componentDids:F,inService:_,teamDid:N}=Be(),V=g.useRef(null),[P,L]=g.useState(null),[W,q]=g.useState("info"),Y=Kt(),[Z,h]=g.useState(!1),S=`notification-records-${f.meta?.did}`,I=Pt(S),[w,E]=g.useState({pageSize:I.rowsPerPage||10,page:I.page?I.page+1:1,dids:I.dids||[],dateRange:I.dateRange||[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),k=X(()=>{if(!f.children||!f.children.length)return[];const m=[];return f.children.forEach(p=>{const b=p.did||p.meta?.did;F.includes(b)&&(p.ancestors=[f],m.push(p))}),m},[F,f]),B=async m=>{try{x(!0),await v(m),x(!1)}finally{x(!1)}};g.useEffect(()=>{B(w)},[w]),g.useEffect(()=>{const m=u.find(p=>p.id===P?.id);P&&m&&L({...m})},[u]);const ae=(m,p,b,R)=>{m.stopPropagation();const O=b.filter(A=>A!==p);E(A=>({...A,[R]:O,page:1}))},ne=({page:m,rowsPerPage:p,filterList:b})=>{const[R=[],,,,O=[]]=b;w.pageSize!==p?E(A=>({...A,pageSize:p,page:1})):w.page!==m+1?E(A=>({...A,page:m+1})):pe(w.dids,R)?pe(w.severities,O)||E(A=>({...A,severities:O,page:1})):E(A=>({...A,dids:R,page:1}))},ee=g.useCallback(()=>{L(null),q("info")},[]),oe=g.useCallback(()=>{v(w)},[v,w]),ge=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:m=>m.map((p,b)=>{if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${b}`);const R=k.find(O=>(O.did||O.meta?.did)===p);return e.jsx(Ne,{blocklet:R,label:R?.title||R?.meta?.title},p)}),update:(m,p,b)=>(m[b].splice(p,1),m)},filterOptions:{names:k,logic:(m,p)=>p.length?!p.includes(m):!1,display:(m,p,b,R)=>e.jsxs(Pe,{style:{width:"380px"},children:[e.jsx(Dt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Ot,{multiple:!0,value:m[b],renderValue:O=>e.jsx(y,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:O.map(A=>{if(A==="system")return e.jsx("span",{children:s("notification.system")},A);const J=k.find(xe=>(xe.did||xe.meta?.did)===A);return e.jsx(Ne,{blocklet:J,label:J?.title||J?.meta?.title},A)})}),onChange:O=>{m[b]=O.target.value,p(m[b],b,R)},children:[e.jsx($e,{value:"system",children:s("notification.system")}),k.map(O=>{const A=O.did||O.meta?.did;return e.jsx($e,{value:A,children:e.jsx(Ne,{blocklet:O,label:O.title||O.meta?.title})},A)})]})]})},customBodyRenderLite:m=>{const p=u[m],b=C(p.componentDid);return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[b?e.jsx(it,{size:32,blocklet:b,ancestors:b.ancestors??[]}):e.jsx(At,{blocklet:f,size:32}),e.jsx(me,{maxLength:50,children:b?.meta?.title||f?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:m=>{const p=u[m],{receivers:b}=p;return e.jsx(Lt,{total:b.length,renderSurplus:R=>R<100?e.jsxs("span",{children:["+",R]}):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:R=>{R.stopPropagation(),L(p),q("receivers")},children:b.map(R=>{const{receiverUser:O}=R,A=st(O.avatar,N,_);return e.jsx(Ze,{alt:O.fullName,src:`${A}?imageFilter=resize&w=48&h=48`,size:32,did:R.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},R.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:m=>{const p=u[m];return e.jsx(y,{onClick:b=>{b.stopPropagation(),L(p),q("statistics")},children:e.jsx(Ke,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:m=>{const p=u[m];return e.jsx(me,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:m=>{const p=u[m];return e.jsx(he,{severity:p.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:m=>e.jsx(ht,{list:m,label:s("notification.severity"),onDelete:(p,b)=>{p.stopPropagation(),ae(p,b,ge[4].options.filterList,"severities")}}),update:Se},filterOptions:{names:Ve,fullWidth:!0,logic:ve,display:(m,p,b,R)=>e.jsx(fs,{label:s("notification.severity"),filterList:m,onChange:p,index:b,column:R,filterValues:Ve})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:m=>{const{createdAt:p}=u[m];return e.jsx(et,{value:p,locale:n,shouldUpdate:!0})}}}],re=m=>{E(p=>({...p,dateRange:m,page:1}))},le=[e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(kt,{onClick:()=>h(!0),sx:{p:Y?0:void 0},children:e.jsx(_t,{})},"settings"),Y?e.jsx($,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(y,{ref:V,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(hs,{children:e.jsx(tt,{theme:a,children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:l,locale:n,columns:ge,data:u,durable:S,onChange:ne,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:T.page-1,rowsPerPage:T.pageSize,count:T.total,...I,onRowClick:(m,{dataIndex:p})=>{L(u[p])}},customPreButtons:[e.jsx(We,{value:w.dateRange,onChange:re})],customButtons:le,components:{TableFilterList:m=>e.jsx(Me,{...m,itemComponent:p=>e.jsx(He,{...p,canDelete:b=>b?.columnNames?.[b?.index||0]?.name==="sender"})})}})})}),P&&e.jsx(ds,{refresh:oe,onCancel:ee,notification:P,blocklet:f,tab:W}),e.jsx(nt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:Z,onClose:()=>h(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(y,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(Bt,{})})})]})}const hs=ie.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }