@abtnode/webapp 1.17.7 → 1.17.8-beta-20260104-120132-cb5b1914

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 (184) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-Bf62_KHd.js → AdapterDayjs-Vs-c78Fd.js} +1 -1
  4. package/dist/assets/{Add-DsCZxomS.js → Add-DDUKFJZu.js} +1 -1
  5. package/dist/assets/ArrowDropDown-D2C1Adnj.js +1 -0
  6. package/dist/assets/{Autocomplete-3RVWHTcY.js → Autocomplete-D16Gs8zB.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-Ce4oQ7Yc.js → Breadcrumbs-Ce4ltGu-.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BBkFKNOE.js → ButtonGroup-BHahRCP8.js} +1 -1
  9. package/dist/assets/{CSSTransition-Bdj4Mjb5.js → CSSTransition-CgzKcQFn.js} +1 -1
  10. package/dist/assets/{CallMerge-DB0zaZAy.js → CallMerge-DxAFzQUN.js} +1 -1
  11. package/dist/assets/{CardContent-DYbZwS2P.js → CardContent-lfT7ngTs.js} +1 -1
  12. package/dist/assets/{ChevronLeft-LUIxb-Gs.js → ChevronLeft-j4acQ5VL.js} +1 -1
  13. package/dist/assets/{ChevronRight-CMxsc1-C.js → ChevronRight-DkMJwq2n.js} +1 -1
  14. package/dist/assets/{Clear-C3sN6cHh.js → Clear-CwtlvQC0.js} +1 -1
  15. package/dist/assets/{Delete-Dfzx-_QK.js → Delete-Go0rVsno.js} +1 -1
  16. package/dist/assets/{DeleteOutline-DpQcJ9uI.js → DeleteOutline-Cb8Q1XUk.js} +1 -1
  17. package/dist/assets/{Done-B-lhh5Lr.js → Done-pmipBbat.js} +1 -1
  18. package/dist/assets/{Edit-BC3nr7bV.js → Edit-CcS7V9Ak.js} +1 -1
  19. package/dist/assets/{ErrorOutline-B8rqfUz9.js → ErrorOutline-DrIyPB6z.js} +1 -1
  20. package/dist/assets/{FilterList-rsYn09vK.js → FilterList-2EXj6a6n.js} +1 -1
  21. package/dist/assets/{Google-DvG9EWSC.js → Google-DktWgt0U.js} +1 -1
  22. package/dist/assets/{HelpOutline-DV_Sx2ni.js → HelpOutline-Hg9WCxla.js} +1 -1
  23. package/dist/assets/{KeyboardArrowDown-DrxfizRQ.js → KeyboardArrowDown-BWVvLKw7.js} +1 -1
  24. package/dist/assets/{Launch-CtQmWL-A.js → Launch-BLe0UBZt.js} +1 -1
  25. package/dist/assets/{Link-DWefbDaG.js → Link-y1h-oO1V.js} +1 -1
  26. package/dist/assets/{ListItemButton-3I3mSJkP.js → ListItemButton-Ce85VoIN.js} +1 -1
  27. package/dist/assets/{ListSubheader-6QF36c7B.js → ListSubheader-BcKYZ8JH.js} +1 -1
  28. package/dist/assets/{LoadingButton-BYeGfUfG.js → LoadingButton-Dcydz6oY.js} +1 -1
  29. package/dist/assets/{MoreVert-trwGA3wl.js → MoreVert-CiOr5AIx.js} +1 -1
  30. package/dist/assets/{OpenInNew-BPFABZ3A.js → OpenInNew-Dk7iCLrt.js} +1 -1
  31. package/dist/assets/{Refresh-BHzztae5.js → Refresh-BobTHUut.js} +1 -1
  32. package/dist/assets/{Replay-DL5tXUkH.js → Replay-Dea3-rmp.js} +1 -1
  33. package/dist/assets/{Search-3NZ8vA4F.js → Search-BZH2Y-GF.js} +1 -1
  34. package/dist/assets/{Stepper-Czt9JHmf.js → Stepper-BIVcZycJ.js} +1 -1
  35. package/dist/assets/{TableSearch-B_n7jlL9.js → TableSearch-qOyd56Ni.js} +1 -1
  36. package/dist/assets/{ToggleButtonGroup-BUuAjiiA.js → ToggleButtonGroup-CATAh5dF.js} +1 -1
  37. package/dist/assets/{UnfoldMore-C_VudNPV.js → UnfoldMore-DVzs5Fd_.js} +1 -1
  38. package/dist/assets/{Verified-Wsp8TANt.js → Verified-DXMVMP7I.js} +1 -1
  39. package/dist/assets/{VerifiedUser-BtmbPbB1.js → VerifiedUser-D4F-7jv5.js} +1 -1
  40. package/dist/assets/{ViewList-B70rgoza.js → ViewList-CbzcdOde.js} +1 -1
  41. package/dist/assets/{_createAggregator-3CFJfow4.js → _createAggregator-Lfp1Ke0G.js} +1 -1
  42. package/dist/assets/{actions-BAAc2dMh.js → actions-CGUgsaws.js} +1 -1
  43. package/dist/assets/{actions-CVw0Ioh6.js → actions-DG35HPVB.js} +1 -1
  44. package/dist/assets/{agreement-CN5OCdHh.js → agreement-Cv-J-Fjv.js} +1 -1
  45. package/dist/assets/api-C_DWrTOw.js +1 -0
  46. package/dist/assets/{appearance-Bg3eFrYH.js → appearance-BZ4JSCZa.js} +1 -1
  47. package/dist/assets/{audit-logs-BqRm_F9G.js → audit-logs-BJKzDQxA.js} +1 -1
  48. package/dist/assets/{base-chart-CLPgrkli.js → base-chart-CwZKJ_pP.js} +1 -1
  49. package/dist/assets/{blocklet-DI09kb3z.js → blocklet-CVUABgLB.js} +1 -1
  50. package/dist/assets/{chain-C3ooT1VP.js → chain-W2rcXV0v.js} +1 -1
  51. package/dist/assets/{click-to-copy-D3DsyQ7B.js → click-to-copy-C9CEoG_G.js} +1 -1
  52. package/dist/assets/cloneDeep-xQSdy3ru.js +1 -0
  53. package/dist/assets/{config-navigation-B2tX-3vU.js → config-navigation-4S-dNGE7.js} +3 -3
  54. package/dist/assets/{connect-to-D2kofpuz.js → connect-to-XIJwhb9Y.js} +2 -2
  55. package/dist/assets/{cssMode-C-HXmW9S.js → cssMode-Du7mCixB.js} +1 -1
  56. package/dist/assets/{delete-confirm-y9uI0hXG.js → delete-confirm-DzRNsfZf.js} +1 -1
  57. package/dist/assets/{depsEqual-AZEPsRt3.js → depsEqual-DGV4LqLy.js} +1 -1
  58. package/dist/assets/{detail-CUJgqlsd.js → detail-BuBPXCBN.js} +3 -3
  59. package/dist/assets/{domains-Ds-t-5cC.js → domains-Dx67UXgN.js} +1 -1
  60. package/dist/assets/{download-CRh8yH_q.js → download-CH7_x1eB.js} +1 -1
  61. package/dist/assets/{edit.svg-BRRfsd3L.js → edit.svg-dSshOuok.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-SC5V9-Mk.js +1 -0
  63. package/dist/assets/engine-C0EQfmPn.js +1 -0
  64. package/dist/assets/{freemarker2-CGpgj78_.js → freemarker2-B9kx0OLY.js} +1 -1
  65. package/dist/assets/{get-safe-url-BR_QU8Dh.js → get-safe-url-BM3lF-2e.js} +1 -1
  66. package/dist/assets/getValidReactChildren-epDyUSMI.js +1 -0
  67. package/dist/assets/{graphqlMode-C9KkLkCB.js → graphqlMode-CkbaDQgp.js} +2 -2
  68. package/dist/assets/{handlebars-D_BNerME.js → handlebars-DUBIehcf.js} +1 -1
  69. package/dist/assets/{html-C8nmUyPA.js → html-COyeeKnL.js} +1 -1
  70. package/dist/assets/{html-title-CHWL92Ab.js → html-title-BmeDpLW7.js} +1 -1
  71. package/dist/assets/{htmlMode-Cbln7vuj.js → htmlMode-Bu-rnyRy.js} +1 -1
  72. package/dist/assets/{iframe-DJmf2DN1.js → iframe-LFRAd_0t.js} +1 -1
  73. package/dist/assets/{index-sdZCV0b1.js → index-B5dTlpQ6.js} +3 -3
  74. package/dist/assets/{index-BeQc3UkQ.js → index-BAG4sFIa.js} +474 -474
  75. package/dist/assets/{index-DqxSKSRU.js → index-BFlu8DSs.js} +1 -1
  76. package/dist/assets/{index-Bl4BVg_B.js → index-BFqzpwMp.js} +3 -3
  77. package/dist/assets/{index-C6cCABCg.js → index-BHBFPu4-.js} +1 -1
  78. package/dist/assets/{index-hAMgv1Ac.js → index-BII0tBQJ.js} +1 -1
  79. package/dist/assets/{index-DiZi9bmR.js → index-BJGsab_w.js} +1 -1
  80. package/dist/assets/{index-D3erh2pC.js → index-BMJQwcrZ.js} +3 -3
  81. package/dist/assets/{index-BHXV_Uyd.js → index-BNneiGbE.js} +1 -1
  82. package/dist/assets/{index-BgCWds86.js → index-B_CFto00.js} +1 -1
  83. package/dist/assets/{index-DNUQq8Bi.js → index-BgREj7bL.js} +1 -1
  84. package/dist/assets/{index-BbeJesOq.js → index-BiHajix6.js} +1 -1
  85. package/dist/assets/{index-aU6di1GB.js → index-BlTw-6BM.js} +1 -1
  86. package/dist/assets/{index--sEMugrz.js → index-BlwUzAku.js} +1 -1
  87. package/dist/assets/{index-CbALc3XH.js → index-Br-U1FnX.js} +1 -1
  88. package/dist/assets/{index-CJ1w1KYa.js → index-Bw9bFr7r.js} +9 -9
  89. package/dist/assets/{index-COUqJ9-z.js → index-C05tV0ZE.js} +1 -1
  90. package/dist/assets/{index-CxvZy8qq.js → index-C0YtVsBZ.js} +1 -1
  91. package/dist/assets/{index-O0QMxlIj.js → index-C2IzEz22.js} +1 -1
  92. package/dist/assets/{index-xcANvyL-.js → index-C81qWcGU.js} +1 -1
  93. package/dist/assets/{index-CODhl4Ao.js → index-C9MSpDFK.js} +1 -1
  94. package/dist/assets/{index--aRvqG_y.js → index-Cae5PiHg.js} +1 -1
  95. package/dist/assets/{index-BDT45MlS.js → index-Cb-DKFcI.js} +1 -1
  96. package/dist/assets/{index-D31fr5VL.js → index-D7So_MpN.js} +1 -1
  97. package/dist/assets/{index-52mqVMFt.js → index-DE_vu8sU.js} +1 -1
  98. package/dist/assets/{index-6nMPypbs.js → index-DLuK9hbg.js} +1 -1
  99. package/dist/assets/{index-ClbnPUTw.js → index-DTbf05gc.js} +1 -1
  100. package/dist/assets/{index-xEJdUfGB.js → index-DZS5ngzW.js} +1 -1
  101. package/dist/assets/{index-2MKd-1Yf.js → index-DkuvHf4y.js} +3 -3
  102. package/dist/assets/{index-DKUJWUc3.js → index-Dn2Htnmc.js} +1 -1
  103. package/dist/assets/{index-BozRXjdh.js → index-K0hgrWRS.js} +1 -1
  104. package/dist/assets/{index-D3Ou3XmE.js → index-UmFQuVKj.js} +1 -1
  105. package/dist/assets/{index-BAreTrrc.js → index-VknOfNJf.js} +1 -1
  106. package/dist/assets/{index-DOgexfV_.js → index-VmjW0dsI.js} +1 -1
  107. package/dist/assets/index-ZOh2DQ-e.js +1 -0
  108. package/dist/assets/{index-BZEpEbZE.js → index-Z_UozIXP.js} +1 -1
  109. package/dist/assets/{index-8mapgkUu.js → index-chjM6enQ.js} +1 -1
  110. package/dist/assets/{index-L59zcQ3y.js → index-fMsDDFcL.js} +1 -1
  111. package/dist/assets/{index-xstE610P.js → index-fVVKWgqI.js} +1 -1
  112. package/dist/assets/{index-D-SnE_aW.js → index-gCoH7vaA.js} +1 -1
  113. package/dist/assets/{index-Fn1MOxir.js → index-qc1lGVZ3.js} +1 -1
  114. package/dist/assets/{index-DOir4J5b.js → index-u_QBRhjP.js} +2 -2
  115. package/dist/assets/{index-BWJoCxfo.js → index-x0PsmbaE.js} +1 -1
  116. package/dist/assets/{index-TBuePazk.js → index-xAYo0tnA.js} +1 -1
  117. package/dist/assets/{index.esm-DWSKQCVf.js → index.esm-Bf_QZb6r.js} +1 -1
  118. package/dist/assets/{install-from-url-DDaq0WfF.js → install-from-url-nk7F4qMd.js} +1 -1
  119. package/dist/assets/{invitation-BtOYVKCc.js → invitation-B_9wi5W5.js} +1 -1
  120. package/dist/assets/{is-path-prefix-equal-DSamcBqo.js → is-path-prefix-equal-CzIiUrel.js} +1 -1
  121. package/dist/assets/{item-DixRT1Ir.js → item-DkZh8Hhp.js} +1 -1
  122. package/dist/assets/{javascript-COnhTyPR.js → javascript-Q7umZWAd.js} +1 -1
  123. package/dist/assets/{jsonMode-B-wg4b0L.js → jsonMode-C6c2lIq6.js} +1 -1
  124. package/dist/assets/{liquid-DkJ8XF8g.js → liquid-CUNhEHdT.js} +1 -1
  125. package/dist/assets/{list-header-CQPLxTLi.js → list-header-iCOCzxwu.js} +1 -1
  126. package/dist/assets/{lock.svg-CfRs8nBP.js → lock.svg-BHzJlnL9.js} +1 -1
  127. package/dist/assets/{log-3m4zIEL-.js → log-fZVSp3m5.js} +1 -1
  128. package/dist/assets/{lottie-react.esm-Ho0K4HxG.js → lottie-react.esm-DdCGF8TN.js} +1 -1
  129. package/dist/assets/{mdx-BaqshKqy.js → mdx-BVwzzx49.js} +1 -1
  130. package/dist/assets/{memory-Bmu9KdH5.js → memory-D5_ocLrh.js} +1 -1
  131. package/dist/assets/{metric-CYgfR-6x.js → metric-CKUrN2-J.js} +1 -1
  132. package/dist/assets/omit-AtPtqkZn.js +1 -0
  133. package/dist/assets/{overview-DPxRgZrc.js → overview-DpaUtqpu.js} +1 -1
  134. package/dist/assets/{permission-fAWDL6eA.js → permission-CHoPVbRo.js} +1 -1
  135. package/dist/assets/{preference-BdCzfdKd.js → preference-ByJourOS.js} +3 -3
  136. package/dist/assets/{python-DDh1Sld9.js → python-DLHaQGBR.js} +1 -1
  137. package/dist/assets/{raf-schd.esm-y75m-HYf.js → raf-schd.esm-CCmBZGJO.js} +1 -1
  138. package/dist/assets/{razor-B6iT4xzc.js → razor-CKWImlfd.js} +1 -1
  139. package/dist/assets/{rotate-session-key-Bh2rfrqq.js → rotate-session-key-DUFrAiqM.js} +1 -1
  140. package/dist/assets/{runtime-Br6d5OIR.js → runtime-DjHvP0dh.js} +1 -1
  141. package/dist/assets/schema-Cs8BMbik.js +1 -0
  142. package/dist/assets/sdk-BgSACA1b.js +1 -0
  143. package/dist/assets/{service-CktTTJWl.js → service-BKneL2po.js} +1 -1
  144. package/dist/assets/{shorten-label-hqt7jmPr.js → shorten-label-Bbwb6iCZ.js} +1 -1
  145. package/dist/assets/{simple-select-CQeor5tC.js → simple-select-Dmadn013.js} +1 -1
  146. package/dist/assets/{spaces-CfDVuFGr.js → spaces-DiNJcyfo.js} +1 -1
  147. package/dist/assets/{status-B5KZ8DJC.js → status-BBz_v2_j.js} +1 -1
  148. package/dist/assets/{status--oG1pao2.js → status-Cjdz-yj2.js} +1 -1
  149. package/dist/assets/{switch-control-Ce7-RZ39.js → switch-control-CUmdJFfi.js} +1 -1
  150. package/dist/assets/{table-icons-CRF7M3DQ.js → table-icons-Cz9AeFAu.js} +1 -1
  151. package/dist/assets/{team-B5ZkAUsr.js → team-CBKW6kF_.js} +1 -1
  152. package/dist/assets/{toLower-D3hDe9vm.js → toLower-CoePqXpD.js} +1 -1
  153. package/dist/assets/toUpper-cyn7A90V.js +1 -0
  154. package/dist/assets/{traffic-DLkNU8lW.js → traffic-BA_E7yI0.js} +1 -1
  155. package/dist/assets/{tsMode-Cgz7fmer.js → tsMode-CFU_SCMw.js} +1 -1
  156. package/dist/assets/{typescript-DeFz7cju.js → typescript-CQJv57lf.js} +1 -1
  157. package/dist/assets/{url-evaluation-CnA0uWcs.js → url-evaluation-2HGMyS33.js} +1 -1
  158. package/dist/assets/{url-join-Di70zMv6.js → url-join-Cb-sLZRl.js} +1 -1
  159. package/dist/assets/{use-mobile-DHdENrRR.js → use-mobile-BZHIPj7_.js} +1 -1
  160. package/dist/assets/{use-mobile-BoSC-OO1.js → use-mobile-CnGwCUj_.js} +1 -1
  161. package/dist/assets/{useAsync-EIK7zv0J.js → useAsync-DOTk7wjs.js} +1 -1
  162. package/dist/assets/{useAsyncRetry-CDmpGaec.js → useAsyncRetry-CsHLaHBL.js} +1 -1
  163. package/dist/assets/{useLocalStorage-CAyV6Ga8.js → useLocalStorage-Cf7Ll0kD.js} +1 -1
  164. package/dist/assets/{useThemeProps-BT_wjfR7.js → useThemeProps-C7GjsUo9.js} +1 -1
  165. package/dist/assets/{util-D64hwso0.js → util-BcCxYadv.js} +1 -1
  166. package/dist/assets/{wait-container-XW4Jhu4r.js → wait-container-Da9bS4MH.js} +1 -1
  167. package/dist/assets/{without-wallet-BasvtIaA.js → without-wallet-C1RpuGzp.js} +1 -1
  168. package/dist/assets/wrap-locale-xftzzPT-.js +1 -0
  169. package/dist/assets/{xml-C_dKn8b3.js → xml-B3UH2gda.js} +1 -1
  170. package/dist/assets/{yaml-BUcCDLGx.js → yaml-z0fSM7T1.js} +1 -1
  171. package/dist/index.html +1 -1
  172. package/package.json +1 -1
  173. package/dist/assets/ArrowDropDown-Cm-Ihf0X.js +0 -1
  174. package/dist/assets/api-DSxoqzJR.js +0 -1
  175. package/dist/assets/cloneDeep-Dt4wqcIj.js +0 -1
  176. package/dist/assets/emotion-cache.browser.esm-D3p6zzp2.js +0 -1
  177. package/dist/assets/engine-PI4c2H--.js +0 -1
  178. package/dist/assets/getValidReactChildren-COj4IOg4.js +0 -1
  179. package/dist/assets/index-CNkhBuLJ.js +0 -1
  180. package/dist/assets/omit-BmEXjsUv.js +0 -1
  181. package/dist/assets/schema-BeTx8rxj.js +0 -1
  182. package/dist/assets/sdk-D4uiEFbJ.js +0 -1
  183. package/dist/assets/toUpper-DLp0iOYu.js +0 -1
  184. package/dist/assets/wrap-locale--ZpyxCeq.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aG as Ve,j as e,bo as ht,r as x,bE as Q,bg as H,H as q,aI as E,g as gt,o as d,h as ee,av as xt,Q as bt,K as N,T as Y,V as X,eP as ke,R as Fe,it as Ge,bk as Re,aV as Te,Y as Ie,bB as Ce,b4 as He,b2 as Ee,C as Ye,f as Qe,f1 as Xe,aQ as Ae,W as yt,au as Je,iu as Ze,v as De,f3 as et,br as be,fK as tt,dE as jt,s as ae,ah as pe,G as qe,aw as St,iv as vt,iw as Ct,$ as Nt,ix as wt,iy as Rt,iz as Tt,iA as It,P as Et,by as st,E as At,M as Dt,S as Ot,U as Lt,X as Ue,iB as kt}from"./index-BeQc3UkQ.js";import{d as Ft,H as nt,g as Pt}from"./index-BZEpEbZE.js";import{S as me}from"./shorten-label-hqt7jmPr.js";import{v as at}from"./index-6nMPypbs.js";import{T as _t}from"./html-title-CHWL92Ab.js";import{R as Pe}from"./Replay-DL5tXUkH.js";import{R as Bt}from"./Refresh-BHzztae5.js";import{D as zt,g as Wt}from"./traffic-DLkNU8lW.js";import"./FilterList-rsYn09vK.js";import"./CSSTransition-Bdj4Mjb5.js";import"./emotion-cache.browser.esm-D3p6zzp2.js";import"./index-O0QMxlIj.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-AZEPsRt3.js";import"./TableSearch-B_n7jlL9.js";import"./Search-3NZ8vA4F.js";import"./Clear-C3sN6cHh.js";import"./MoreVert-trwGA3wl.js";import"./iframe-DJmf2DN1.js";import"./ChevronLeft-LUIxb-Gs.js";import"./ChevronRight-CMxsc1-C.js";import"./index-DBii9-f-.js";import"./base-chart-CLPgrkli.js";import"./index-BAreTrrc.js";import"./AdapterDayjs-Bf62_KHd.js";import"./useThemeProps-BT_wjfR7.js";import"./visuallyHidden-Dan1xhjv.js";const Mt=Ve(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"})),Kt=Ve(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"})),it=x.createContext({}),{Provider:Ht,Consumer:Ks}=it;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=ht(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const J={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Ht,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(it);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(gt,{type:Ut[t],children:t})}const $t=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ot(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:xt(i,s)}):"",S=$t(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],rt=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},lt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Vt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:rt(t),enabled:n}},Gt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:lt(t),enabled:n}},Yt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Jt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ct=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(bt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=X();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(l=>{const b=ot(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=X(),m=ot(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[He(t[0],n)," - ",He(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Wt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const es=[{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}];dt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function dt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[i,l]=x.useState(es),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ge,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ye,{size:16}),r("common.confirm")]})]})]})}ut.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ut({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=X(),l=Qe(),b=x.useMemo(()=>Xe(l,ct()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:tt(c.receiverUser.avatar,h,S)}}));U(o),J(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Yt(c):a==="email"?Vt(v,c):a==="pushKit"?Gt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Jt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||jt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(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:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(Ze,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),mt=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(Bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ss,{children:e.jsxs(et,{theme:b,children:[e.jsx(nt,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:mt,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ns,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(Kt,{}):e.jsx(Ye,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(Mt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(dt,{loading:n,onCancel:u,onConfirm:I})})]})})})}const ts=x.memo(ut),ss=ae.div`
1
+ import{aG as Ve,j as e,bo as ht,r as x,bE as Q,bg as H,H as q,aI as E,g as gt,o as d,h as ee,av as xt,Q as bt,K as N,T as Y,V as X,eP as ke,R as Fe,it as Ge,bk as Re,aV as Te,Y as Ie,bB as Ce,b4 as He,b2 as Ee,C as Ye,f as Qe,f1 as Xe,aQ as Ae,W as yt,au as Je,iu as Ze,v as De,f3 as et,br as be,fK as tt,dE as jt,s as ae,ah as pe,G as qe,aw as St,iv as vt,iw as Ct,$ as Nt,ix as wt,iy as Rt,iz as Tt,iA as It,P as Et,by as st,E as At,M as Dt,S as Ot,U as Lt,X as Ue,iB as kt}from"./index-BAG4sFIa.js";import{d as Ft,H as nt,g as Pt}from"./index-Z_UozIXP.js";import{S as me}from"./shorten-label-Bbwb6iCZ.js";import{v as at}from"./index-DLuK9hbg.js";import{T as _t}from"./html-title-BmeDpLW7.js";import{R as Pe}from"./Replay-Dea3-rmp.js";import{R as Bt}from"./Refresh-BobTHUut.js";import{D as zt,g as Wt}from"./traffic-BA_E7yI0.js";import"./FilterList-2EXj6a6n.js";import"./CSSTransition-CgzKcQFn.js";import"./emotion-cache.browser.esm-SC5V9-Mk.js";import"./index-C2IzEz22.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DGV4LqLy.js";import"./TableSearch-qOyd56Ni.js";import"./Search-BZH2Y-GF.js";import"./Clear-CwtlvQC0.js";import"./MoreVert-CiOr5AIx.js";import"./iframe-LFRAd_0t.js";import"./ChevronLeft-j4acQ5VL.js";import"./ChevronRight-DkMJwq2n.js";import"./index-DBii9-f-.js";import"./base-chart-CwZKJ_pP.js";import"./index-VknOfNJf.js";import"./AdapterDayjs-Vs-c78Fd.js";import"./useThemeProps-C7GjsUo9.js";import"./visuallyHidden-Dan1xhjv.js";const Mt=Ve(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"})),Kt=Ve(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"})),it=x.createContext({}),{Provider:Ht,Consumer:Ks}=it;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=ht(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const J={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Ht,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(it);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(gt,{type:Ut[t],children:t})}const $t=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ot(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:xt(i,s)}):"",S=$t(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],rt=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},lt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Vt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:rt(t),enabled:n}},Gt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:lt(t),enabled:n}},Yt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Jt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ct=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(bt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=X();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(l=>{const b=ot(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=X(),m=ot(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[He(t[0],n)," - ",He(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Wt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const es=[{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}];dt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function dt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[i,l]=x.useState(es),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ge,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ye,{size:16}),r("common.confirm")]})]})]})}ut.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ut({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=X(),l=Qe(),b=x.useMemo(()=>Xe(l,ct()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:tt(c.receiverUser.avatar,h,S)}}));U(o),J(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Yt(c):a==="email"?Vt(v,c):a==="pushKit"?Gt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Jt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||jt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(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:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(Ze,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),mt=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(Bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ss,{children:e.jsxs(et,{theme:b,children:[e.jsx(nt,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:mt,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ns,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(Kt,{}):e.jsx(Ye,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(Mt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(dt,{loading:n,onCancel:u,onConfirm:I})})]})})})}const ts=x.memo(ut),ss=ae.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }