@abtnode/webapp 1.16.45-beta-20250609-111118-0d252ebe → 1.16.45-beta-20250612-231219-481217be

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 (223) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-BqwbfR-J.js → AdapterDayjs-cAovH2Wn.js} +1 -1
  4. package/dist/assets/{Add-CSGWebd7.js → Add-CDNZP3_0.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-BCCxOUNE.js → ArrowDropDown-DX4axGQA.js} +1 -1
  6. package/dist/assets/{Autocomplete-BRFoT1-d.js → Autocomplete-DpJFKWid.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-B-xYTnoc.js → Breadcrumbs-DvU47lY-.js} +1 -1
  8. package/dist/assets/{ButtonGroup-ClVwTb7r.js → ButtonGroup-pRTDFJWg.js} +1 -1
  9. package/dist/assets/{CSSTransition-DpoNbm4c.js → CSSTransition-DwzJ0puV.js} +1 -1
  10. package/dist/assets/{CallMerge-weq4zXp-.js → CallMerge-C0f2EMe_.js} +1 -1
  11. package/dist/assets/{CardContent-CTAfwoUe.js → CardContent-0awZM1Ns.js} +1 -1
  12. package/dist/assets/{ChevronLeft-DQK-aqqz.js → ChevronLeft-ud_S8L4-.js} +1 -1
  13. package/dist/assets/{ChevronRight-BtkdX9A9.js → ChevronRight-B_-R2Sts.js} +1 -1
  14. package/dist/assets/{Clear-D0I7uWhD.js → Clear-B9P4WqAY.js} +1 -1
  15. package/dist/assets/{Close-6CxneLlA.js → Close-D_k500g1.js} +1 -1
  16. package/dist/assets/{Community-v2_SoLAO.js → Community-C1YZ_Fzm.js} +1 -1
  17. package/dist/assets/{Delete-P4B2dduO.js → Delete-CvkgpWXX.js} +1 -1
  18. package/dist/assets/{DeleteOutline-EQ9bHspP.js → DeleteOutline-C6-UDibg.js} +1 -1
  19. package/dist/assets/{Done-2EsU1aO2.js → Done-oo1eX6tp.js} +1 -1
  20. package/dist/assets/{Edit-frf3Fbx4.js → Edit-D2-hkmp_.js} +1 -1
  21. package/dist/assets/{ErrorOutline-a1DnwqoR.js → ErrorOutline-zNHQAP0N.js} +1 -1
  22. package/dist/assets/{HelpOutline-CBv7x3VM.js → HelpOutline-Dnfzivtx.js} +1 -1
  23. package/dist/assets/{Holiday-CM3JD4xm.js → Holiday-CiEfpBY3.js} +1 -1
  24. package/dist/assets/{Launch-B7fv6nTK.js → Launch-DVq2r1vu.js} +1 -1
  25. package/dist/assets/{Link-CiUEO3cQ.js → Link-CHQGWtG9.js} +1 -1
  26. package/dist/assets/{ListItemButton-ByIRcZGW.js → ListItemButton-LswuUKPc.js} +1 -1
  27. package/dist/assets/{ListSubheader-Yn3XMnVm.js → ListSubheader-Dqc3XTI_.js} +1 -1
  28. package/dist/assets/{LoadingButton-B3es9INs.js → LoadingButton-BlJTr1LL.js} +1 -1
  29. package/dist/assets/{LockIcon-C1gL9Uz4.js → LockIcon-DvcB90iN.js} +1 -1
  30. package/dist/assets/{Meeting-BkxfSXYG.js → Meeting-Bt1FEapI.js} +1 -1
  31. package/dist/assets/{MoreHoriz-3d6Yp_t-.js → MoreHoriz-CQaja3QI.js} +1 -1
  32. package/dist/assets/{MoreVert-C_Ck3fn9.js → MoreVert-Ca16Cnof.js} +1 -1
  33. package/dist/assets/{OffSick-Z9k6qoex.js → OffSick-HYKiIDQw.js} +1 -1
  34. package/dist/assets/{OpenInNew-D79h4Iot.js → OpenInNew-CysIURb4.js} +1 -1
  35. package/dist/assets/{Public-BtS6bdiD.js → Public-D4TSC2Ib.js} +1 -1
  36. package/dist/assets/{Refresh-C1kA8imS.js → Refresh-BNaUmDFT.js} +1 -1
  37. package/dist/assets/{SchemaReference.es-Dfqhb0uS.js → SchemaReference.es-GR-_9bfJ.js} +1 -1
  38. package/dist/assets/{Search-CUm1f8xo.js → Search-BqZFZ5g2.js} +1 -1
  39. package/dist/assets/{Slider-B0hY7ZYB.js → Slider-DkRYH92J.js} +1 -1
  40. package/dist/assets/{Stepper-CEe-v4P_.js → Stepper-DEgX4GTY.js} +1 -1
  41. package/dist/assets/{Switch-D3iZUzda.js → Switch-SGjalYgz.js} +1 -1
  42. package/dist/assets/{TableRow-CQ8RBtid.js → TableRow-D2EIvRB_.js} +1 -1
  43. package/dist/assets/{TableSearch-Uk9kIt7i.js → TableSearch-CAvitNOv.js} +1 -1
  44. package/dist/assets/{ToggleButtonGroup-BrZT8OFC.js → ToggleButtonGroup-BUQPuDr0.js} +1 -1
  45. package/dist/assets/{Verified-DjfvSM3n.js → Verified-CLwd2p1i.js} +1 -1
  46. package/dist/assets/{VerifiedUser-CGB9pAg5.js → VerifiedUser-BlbKkPqo.js} +1 -1
  47. package/dist/assets/{ViewColumn-CcQluqhl.js → ViewColumn-CxnzgopE.js} +1 -1
  48. package/dist/assets/{ViewList-CPkfx4gI.js → ViewList-Dq8vu1UD.js} +1 -1
  49. package/dist/assets/{WorkingRemotely-BMx519Rn.js → WorkingRemotely-C4WjSs8k.js} +1 -1
  50. package/dist/assets/{_createAggregator-Dp2y-Mf_.js → _createAggregator-C775jKSl.js} +1 -1
  51. package/dist/assets/{actions-C8ldDfDc.js → actions-CWQtNrcD.js} +1 -1
  52. package/dist/assets/{actions-CvZtuIOm.js → actions-Dq6DDwe2.js} +1 -1
  53. package/dist/assets/{agreement-4TUvZhY3.js → agreement-DCQc_rAP.js} +1 -1
  54. package/dist/assets/api-DwcaKz2E.js +1 -0
  55. package/dist/assets/{appearance-CztLZ35g.js → appearance-Bp-lCdSt.js} +1 -1
  56. package/dist/assets/ar-D9QEDjY-.js +7 -0
  57. package/dist/assets/{audit-logs-vnwtSLPp.js → audit-logs-CjK3Z08k.js} +1 -1
  58. package/dist/assets/{base-chart-tXWghrta.js → base-chart-YZwnGzYD.js} +1 -1
  59. package/dist/assets/{blocklet-SKmr21o8.js → blocklet-3SnK_ln7.js} +1 -1
  60. package/dist/assets/{brace-fold.es-C8hYDu8C.js → brace-fold.es-BNQlG2nr.js} +1 -1
  61. package/dist/assets/{chain-Cw3CxpIJ.js → chain-B90dDCGq.js} +1 -1
  62. package/dist/assets/{click-to-copy-BBcwV5Sv.js → click-to-copy-a5cMFI-_.js} +1 -1
  63. package/dist/assets/cloneDeep-BmfjF8bM.js +1 -0
  64. package/dist/assets/{closebrackets.es-n7j2YaKC.js → closebrackets.es-CXG4Cd3e.js} +1 -1
  65. package/dist/assets/{codemirror.es-q3z3D3fp.js → codemirror.es-B3B1JR3x.js} +1 -1
  66. package/dist/assets/{collapse-Cy01Qhtt.js → collapse-C2nB1Q0B.js} +1 -1
  67. package/dist/assets/{comment.es-CZaW3Zjc.js → comment.es-BzZcNo5B.js} +1 -1
  68. package/dist/assets/{config-navigation-B4iEyuxN.js → config-navigation-BN6zZFyV.js} +3 -3
  69. package/dist/assets/{connect-to-BbdcjX_x.js → connect-to-CmhbEEvA.js} +1 -1
  70. package/dist/assets/{de-Dv_ApqsF.js → de-BOa43YBF.js} +2 -2
  71. package/dist/assets/{delete-confirm-qy4uClf5.js → delete-confirm-m56IXxYG.js} +1 -1
  72. package/dist/assets/{detail-C_SIxTEY.js → detail-BlHIoIDp.js} +3 -3
  73. package/dist/assets/{dialog.es-BEBI39yG.js → dialog.es-C42Mil04.js} +1 -1
  74. package/dist/assets/{domains-Bql4UA4y.js → domains-CeBkVCNd.js} +2 -2
  75. package/dist/assets/{download-DdDp7qNF.js → download-Bh0sNo9s.js} +1 -1
  76. package/dist/assets/emotion-react.browser.esm-CorLywyT.js +1 -0
  77. package/dist/assets/es-A3ma-OJp.js +9 -0
  78. package/dist/assets/{foldgutter.es-XJVlfA9j.js → foldgutter.es-Jx2Yn3Ns.js} +1 -1
  79. package/dist/assets/fr-I3xKp6I5.js +7 -0
  80. package/dist/assets/{get-safe-url-BHhOK-87.js → get-safe-url-CXFJ7HE5.js} +1 -1
  81. package/dist/assets/{get-safe-url-ZQAisLez.js → get-safe-url-t5_KGb1I.js} +1 -1
  82. package/dist/assets/getValidReactChildren-DuVu0i0i.js +1 -0
  83. package/dist/assets/{hi-Dqbq8i5Y.js → hi-DacRhM8A.js} +1 -1
  84. package/dist/assets/{hint.es-BXYnqh_9.js → hint.es-BoFboqfs.js} +1 -1
  85. package/dist/assets/{hint.es2-mCmWTcSI.js → hint.es2-C9gyljNf.js} +1 -1
  86. package/dist/assets/{id-Bxr8o3Uo.js → id-B7LQAHL7.js} +3 -3
  87. package/dist/assets/{iframe-CVde2I2R.js → iframe-AXVHNW_k.js} +1 -1
  88. package/dist/assets/{index-DzK6OW-H.js → index-4WVfl35V.js} +1 -1
  89. package/dist/assets/{index-DzWDWvao.js → index-B-k7ViK0.js} +1 -1
  90. package/dist/assets/{index-B37Lr7Hg.js → index-B0jcX1RF.js} +1 -1
  91. package/dist/assets/{index-DzcmC4If.js → index-B2F1vMBv.js} +4 -4
  92. package/dist/assets/{index-BkStkax6.js → index-B7K9oQOc.js} +2 -2
  93. package/dist/assets/{index-DNFAdenj.js → index-BA9uj90I.js} +1 -1
  94. package/dist/assets/{index-CIeEDIRZ.js → index-BBjq0j2v.js} +1 -1
  95. package/dist/assets/{index-CEr4LN-P.js → index-BEKDshjS.js} +1 -1
  96. package/dist/assets/{index-Cm6VrPFr.js → index-BGgjrqZC.js} +1 -1
  97. package/dist/assets/{index-BUWOtFDP.js → index-BHBEV8r4.js} +1 -1
  98. package/dist/assets/{index-DTb1YjkO.js → index-BXOD69ua.js} +83 -83
  99. package/dist/assets/{index-CCGiAGPb.js → index-BY88k43C.js} +1 -1
  100. package/dist/assets/{index-CFc2cpAq.js → index-BZeeqqFX.js} +1 -1
  101. package/dist/assets/{index-uw3m84Z2.js → index-Ba15C891.js} +1 -1
  102. package/dist/assets/{index-BKpBz5IS.js → index-BbubXXOK.js} +1 -1
  103. package/dist/assets/{index-omP-_XYV.js → index-C0MwD3ew.js} +1 -1
  104. package/dist/assets/{index-BublfAf3.js → index-CEuPYhl0.js} +1 -1
  105. package/dist/assets/{index-BQOOINkR.js → index-CGpLBTuz.js} +1 -1
  106. package/dist/assets/{index-B6YLm2gY.js → index-CJTCcEXc.js} +1 -1
  107. package/dist/assets/{index-Dg-nEXIR.js → index-CTMjLXVv.js} +1 -1
  108. package/dist/assets/{index-DM5TK3mI.js → index-Ca4fyQU9.js} +1 -1
  109. package/dist/assets/{index-wKRUqEyT.js → index-Cim0AD_y.js} +2 -2
  110. package/dist/assets/{index-D3OlVE0m.js → index-CknB_y2G.js} +1 -1
  111. package/dist/assets/index-Clkrz3Dv.js +41 -0
  112. package/dist/assets/{index-C_5on_zt.js → index-CpywGtnH.js} +1 -1
  113. package/dist/assets/{index-DdAt9jDT.js → index-Cs16EI2i.js} +1 -1
  114. package/dist/assets/{index-BDHvuJA-.js → index-CwcDS29n.js} +5 -5
  115. package/dist/assets/index-D1tieyaZ.js +1 -0
  116. package/dist/assets/{index-Ds-ruyy-.js → index-DDI2W4Tb.js} +1 -1
  117. package/dist/assets/{index-ChSMfUDl.js → index-DGqCsVmc.js} +10 -10
  118. package/dist/assets/{index-DsdaIM1E.js → index-DKeeqPhh.js} +4 -4
  119. package/dist/assets/{index-CViyZjZs.js → index-DNdIaDLR.js} +1 -1
  120. package/dist/assets/{index-DVT--CtL.js → index-DQvxOUyW.js} +3 -3
  121. package/dist/assets/{index-BILcrV-b.js → index-DV2t0rB2.js} +1 -1
  122. package/dist/assets/{index-DTnnZgV3.js → index-DVVxcn_U.js} +1 -1
  123. package/dist/assets/index-DW-mbKeK.js +236 -0
  124. package/dist/assets/{index-BWpZKV7G.js → index-DXbn94TQ.js} +3 -3
  125. package/dist/assets/{index-B6gCUDLy.js → index-Dd8tfIXz.js} +1 -1
  126. package/dist/assets/{index-C562LNdR.js → index-DdwYTOhS.js} +9 -9
  127. package/dist/assets/{index-BLrsx8oH.js → index-DfVhmhNU.js} +1 -1
  128. package/dist/assets/{index-DnLtwT4P.js → index-Dhx2XMvi.js} +1 -1
  129. package/dist/assets/{index-CPBAco4X.js → index-MCMqKG1X.js} +1 -1
  130. package/dist/assets/{index-ooFvSbXR.js → index-NOETvacG.js} +1 -1
  131. package/dist/assets/{index-DRvnuna9.js → index-Vj6hcvqX.js} +1 -1
  132. package/dist/assets/{index-CyCivdc5.js → index-VoBTA_fx.js} +1 -1
  133. package/dist/assets/{index-CZplOWEN.js → index-gYWDzVZB.js} +1 -1
  134. package/dist/assets/{index-C-QDjEC-.js → index-kMvGy1BT.js} +1 -1
  135. package/dist/assets/{index.esm-CB-7UGfI.js → index.esm-S1RHFvfU.js} +1 -1
  136. package/dist/assets/{info-addon.es-DKtNhOCh.js → info-addon.es-BrPERxwM.js} +1 -1
  137. package/dist/assets/{info.es-B7YFO8O9.js → info.es-BG627Djn.js} +1 -1
  138. package/dist/assets/{install-from-url-B9F0r0Uk.js → install-from-url-Kt3o4LBx.js} +1 -1
  139. package/dist/assets/{invitation-BAovnHWT.js → invitation-w4SAH9iP.js} +1 -1
  140. package/dist/assets/is-path-prefix-equal-B5zOew9j.js +1 -0
  141. package/dist/assets/item-B-caRYba.js +277 -0
  142. package/dist/assets/{ja-CJfcqkdo.js → ja-DRQ4Eecl.js} +3 -1
  143. package/dist/assets/{javascript.es-e4wfmIpw.js → javascript.es-BEqQG-X0.js} +1 -1
  144. package/dist/assets/{jump-to-line.es-D1zAOCng.js → jump-to-line.es-K-qNaz4d.js} +1 -1
  145. package/dist/assets/{jump.es-CR1apnMt.js → jump.es-TG1mfYt_.js} +1 -1
  146. package/dist/assets/{ko-BxAazRix.js → ko-CzL3UzwL.js} +3 -1
  147. package/dist/assets/{lint.es-po0cvpDF.js → lint.es-CXlTl58k.js} +1 -1
  148. package/dist/assets/{lint.es2-CIRlGKEU.js → lint.es2-6L_OlSQy.js} +1 -1
  149. package/dist/assets/{lint.es3-CC5QXby4.js → lint.es3-D-7-u1za.js} +1 -1
  150. package/dist/assets/{list-header-D5Klosqn.js → list-header-B8ysM0r4.js} +1 -1
  151. package/dist/assets/{log-DvWjHRjx.js → log-0actLjpa.js} +1 -1
  152. package/dist/assets/{lottie-react.esm-CzS4D97g.js → lottie-react.esm-PsK3z7dD.js} +1 -1
  153. package/dist/assets/{matchbrackets.es-Bh__cUPA.js → matchbrackets.es-DvOANBOF.js} +1 -1
  154. package/dist/assets/{memory-VuyFpRX6.js → memory-Dk-Khjf8.js} +1 -1
  155. package/dist/assets/{metric-sJIuzFdD.js → metric-7dzLcQP8.js} +1 -1
  156. package/dist/assets/{mode.es-b4PvmWPj.js → mode.es-BCPKj5xj.js} +1 -1
  157. package/dist/assets/{mode.es2-B8UlLCtX.js → mode.es2-DcHabWZq.js} +1 -1
  158. package/dist/assets/{mode.es3-CQ9X5NiW.js → mode.es3-DepgrqKR.js} +1 -1
  159. package/dist/assets/omit-BIY56Vm3.js +1 -0
  160. package/dist/assets/{onlineParser.es-mNPHWPcl.js → onlineParser.es-F2aU-24r.js} +1 -1
  161. package/dist/assets/{overview-DptGQrLC.js → overview-D99x1C_L.js} +1 -1
  162. package/dist/assets/{permission-DtbkcHFU.js → permission-BwU5vqVv.js} +1 -1
  163. package/dist/assets/{preference-BIxg48qT.js → preference-B-a8y1-u.js} +3 -3
  164. package/dist/assets/{pt-FpFCyI6v.js → pt-CHKumXYv.js} +3 -3
  165. package/dist/assets/{raf-schd.esm-CyR0PsG3.js → raf-schd.esm-CfDeV_Tv.js} +1 -1
  166. package/dist/assets/refType-RuhvdYnQ.js +1 -0
  167. package/dist/assets/{resource-dialog-DSlsEDCi.js → resource-dialog-B3xpsyIT.js} +5 -5
  168. package/dist/assets/{ru-BuGIFp9h.js → ru-CvkEKhgU.js} +1 -1
  169. package/dist/assets/{runtime-BqyrQzUD.js → runtime-C94CoEdP.js} +1 -1
  170. package/dist/assets/{schema-BD6PrmCO.js → schema-D29PP22L.js} +1 -1
  171. package/dist/assets/sdk-CJFYaDBM.js +1 -0
  172. package/dist/assets/{search.es-BjwGHA7G.js → search.es-Dtiay1-p.js} +1 -1
  173. package/dist/assets/{searchcursor.es-CbJCToER.js → searchcursor.es-B5hHQBpu.js} +1 -1
  174. package/dist/assets/{service-BV2uNns2.js → service-Dwje1JT3.js} +1 -1
  175. package/dist/assets/{shorten-label-BOckTQ1X.js → shorten-label-C3V2RyR1.js} +1 -1
  176. package/dist/assets/{show-hint.es-q9IMwctI.js → show-hint.es-IwvOaNo4.js} +1 -1
  177. package/dist/assets/{simple-select-Dtd0a5G_.js → simple-select-C-hoC-G2.js} +1 -1
  178. package/dist/assets/{spaces-Bqb0c1IC.js → spaces-BqxfgJ6Q.js} +1 -1
  179. package/dist/assets/{status-CoaEXqC8.js → status-YpqmLpg4.js} +1 -1
  180. package/dist/assets/{status-DAsfcIss.js → status-uT90przA.js} +1 -1
  181. package/dist/assets/{sublime.es-Di_Rzzft.js → sublime.es-D6Ae2P0m.js} +1 -1
  182. package/dist/assets/{switch-control-uwHD90eP.js → switch-control-6V55bVbg.js} +1 -1
  183. package/dist/assets/{table-icons-CMF2B4vQ.js → table-icons-DA0sv0Eq.js} +1 -1
  184. package/dist/assets/{team-DbBAK1Lw.js → team-CKufRu0w.js} +1 -1
  185. package/dist/assets/{th-BafLD2wR.js → th-B2BUfjNJ.js} +1 -1
  186. package/dist/assets/{toLower-Bk4Y66nU.js → toLower-J0GcLV1u.js} +1 -1
  187. package/dist/assets/toUpper-CkfbCBIC.js +1 -0
  188. package/dist/assets/{traffic-C8Jrp6CL.js → traffic-D56Ew432.js} +1 -1
  189. package/dist/assets/{url-evaluation-DQ262LSg.js → url-evaluation-D9TCPMS4.js} +1 -1
  190. package/dist/assets/{url-join-IGglLOtK.js → url-join-C88wtrgy.js} +1 -1
  191. package/dist/assets/{use-mobile-YvhVWxe8.js → use-mobile-5Zh9Oud5.js} +1 -1
  192. package/dist/assets/{use-mobile-BoYyduuc.js → use-mobile-C9rByBew.js} +1 -1
  193. package/dist/assets/{useAsync-DbB0tJq1.js → useAsync-DPy_pDJm.js} +1 -1
  194. package/dist/assets/{useAsyncRetry-BLg3v7lI.js → useAsyncRetry-oFyp9pPD.js} +1 -1
  195. package/dist/assets/{useLocalStorage-DQZ59j66.js → useLocalStorage-osYXE-mL.js} +1 -1
  196. package/dist/assets/{useThemeProps-CtXzBlYo.js → useThemeProps-C_6zzxTC.js} +1 -1
  197. package/dist/assets/{util-CUC0Xf5B.js → util-MD5zwT5R.js} +1 -1
  198. package/dist/assets/{vi-BMZxxaJ2.js → vi-BykmwIAT.js} +3 -3
  199. package/dist/assets/{wait-container-GoGxY2Kf.js → wait-container-BbGRQLG4.js} +1 -1
  200. package/dist/assets/{withStyles-_FcG1bkA.js → withStyles-DL-NFbaE.js} +1 -1
  201. package/dist/assets/wrap-locale-BRogPOgW.js +1 -0
  202. package/dist/assets/{zh-DusA4qAT.js → zh-CbCaOuAd.js} +3 -1
  203. package/dist/assets/{zh-tw-BO-QhSNP.js → zh-tw-C9JfiCVV.js} +3 -1
  204. package/dist/index.html +1 -1
  205. package/dist/service-worker.js +1 -1
  206. package/package.json +1 -1
  207. package/dist/assets/api-gAVz4YtD.js +0 -1
  208. package/dist/assets/ar-0ZkmCCuq.js +0 -7
  209. package/dist/assets/cloneDeep-CP0xacDT.js +0 -1
  210. package/dist/assets/emotion-react.browser.esm--gIypTeg.js +0 -1
  211. package/dist/assets/es-D_uF0siv.js +0 -7
  212. package/dist/assets/fr-DVFSQfDp.js +0 -7
  213. package/dist/assets/getValidReactChildren-B-b9MOMT.js +0 -1
  214. package/dist/assets/index-Boprg64p.js +0 -236
  215. package/dist/assets/index-DrBxStif.js +0 -41
  216. package/dist/assets/index-s1CQJTjJ.js +0 -1
  217. package/dist/assets/is-path-prefix-equal-C80Jhu_q.js +0 -1
  218. package/dist/assets/item-CrnjScjy.js +0 -277
  219. package/dist/assets/omit-BEDWXxvr.js +0 -1
  220. package/dist/assets/refType-J5vgZzDX.js +0 -1
  221. package/dist/assets/sdk-gxKU3x6m.js +0 -1
  222. package/dist/assets/toUpper-FI4Si1KF.js +0 -1
  223. package/dist/assets/wrap-locale-B35eVgy7.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bq as St,r as x,bC as Q,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as Xe,aQ as Ze,aw as Nt,h as ne,aB as wt,k as G,K as v,m as X,ej as _e,N as Be,kF as et,bn as Ee,aY as De,U as Ae,ep as we,b7 as Ge,b5 as Oe,C as tt,n as re,f as st,dB as nt,aT as Le,W as Tt,av as at,kG as it,B as ke,kH as ot,g0 as Se,gh as rt,ai as fe,ff as Rt,ax as It,G as Ye,kI as Et,kJ as Dt,D as lt,kK as At,kL as Ot,kM as Lt,kN as kt,R as Pt,bw as ct,O as Ft,S as _t,Q as Je,J as Bt,kO as zt,a4 as Wt}from"./index-DTb1YjkO.js";import{l as Mt,D as dt,g as qt}from"./index-CFc2cpAq.js";import{a as ze,c as Kt}from"./actions-CvZtuIOm.js";import{B as $t}from"./index-DrBxStif.js";import{S as xe}from"./shorten-label-BOckTQ1X.js";import{I as ut}from"./index-BLrsx8oH.js";import{T as Ht}from"./index-DzK6OW-H.js";import{d as Ut}from"./Refresh-C1kA8imS.js";import{D as Vt,g as Gt}from"./traffic-C8Jrp6CL.js";import{u as Yt}from"./use-mobile-BoYyduuc.js";import"./TableRow-CQ8RBtid.js";import"./useThemeProps-CtXzBlYo.js";import"./emotion-react.browser.esm--gIypTeg.js";import"./ViewColumn-CcQluqhl.js";import"./Search-CUm1f8xo.js";import"./Clear-D0I7uWhD.js";import"./Delete-P4B2dduO.js";import"./index-omP-_XYV.js";import"./MoreVert-C_Ck3fn9.js";import"./TableSearch-Uk9kIt7i.js";import"./useLocalStorage-DQZ59j66.js";import"./get-safe-url-BHhOK-87.js";import"./ButtonGroup-ClVwTb7r.js";import"./getValidReactChildren-B-b9MOMT.js";import"./url-evaluation-DQ262LSg.js";import"./permission-DtbkcHFU.js";import"./index.esm-CB-7UGfI.js";import"./collapse-Cy01Qhtt.js";import"./blocklet-SKmr21o8.js";import"./Switch-D3iZUzda.js";import"./iframe-CVde2I2R.js";import"./ChevronLeft-DQK-aqqz.js";import"./ChevronRight-BtkdX9A9.js";import"./index-DRvnuna9.js";import"./base-chart-tXWghrta.js";import"./index-CyCivdc5.js";import"./AdapterDayjs-BqwbfR-J.js";import"./CSSTransition-DpoNbm4c.js";import"./refType-J5vgZzDX.js";const pt=x.createContext({}),{Provider:Jt,Consumer:pn}=pt;function Qt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=Q(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},P=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},k=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},H=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),J=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&P()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:k,resendNotification:I,getUser:H,componentDids:C,getReceivers:J,inService:o,teamDid:f};return e.jsx(Jt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Xt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Xt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Xe()),ts=e;ft=Me.default=(0,es.default)((0,ts.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"}),"CheckCircleOutline");var qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Xe()),as=e;mt=qe.default=(0,ns.default)((0,as.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"}),"Block");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const Pe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Qe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(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})}]:[],ve=(t=[])=>{const s=$().startOf("day");return t.filter(n=>$(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({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 ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Pe[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Pe[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=X();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.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 Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=X(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}$e.propTypes={value:d.array.isRequired,onChange:d.func};function $e({value:t,onChange:s}){const{locale:n}=X(),o=$().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if($(f.startDate).isAfter(f.endDate)||!$(f.startDate).isValid()||!$(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}He.propTypes={itemComponent:d.elementType.isRequired};function He({itemComponent:t,...s}){var r;const{t:n}=X();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{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(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{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}];Ue.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ue.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ue({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=X(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),P=Le({anchorEl:null,position:null}),k=Le({anchorEl:null,position:null}),[I,H]=x.useState(null),[J,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;k.anchorEl=i;const c=i.getBoundingClientRect();k.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(ke,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:J.page-1,rowsPerPage:J.pageSize,count:J.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{P.anchorEl=null,P.position=null,H(null)},de=()=>{k.anchorEl=null,k.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),k.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();P.anchorEl=q,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}H({channel:c});try{const q=await le(c,i.receiver);await ye(1),H({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),k.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=Q(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{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(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),U=[e.jsx($e,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(ke,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:U,components:{TableFilterList:a=>e.jsx(He,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ue,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
1
+ import{bq as St,r as x,bC as Q,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as Xe,aQ as Ze,aw as Nt,h as ne,aB as wt,k as G,K as v,m as X,ej as _e,N as Be,kG as et,bn as Ee,aY as De,U as Ae,ep as we,b7 as Ge,b5 as Oe,C as tt,n as re,f as st,dB as nt,aT as Le,W as Tt,av as at,kH as it,B as Pe,kI as ot,g1 as Se,gi as rt,ai as fe,ff as Rt,ax as It,G as Ye,kJ as Et,kK as Dt,D as lt,kL as At,kM as Ot,kN as Lt,kO as Pt,R as kt,bw as ct,O as Ft,S as _t,Q as Je,J as Bt,kP as zt,a4 as Wt}from"./index-BXOD69ua.js";import{l as Mt,D as dt,g as qt}from"./index-BZeeqqFX.js";import{a as ze,c as Kt}from"./actions-Dq6DDwe2.js";import{B as $t}from"./index-Clkrz3Dv.js";import{S as xe}from"./shorten-label-C3V2RyR1.js";import{I as ut}from"./index-DfVhmhNU.js";import{T as Ht}from"./index-4WVfl35V.js";import{d as Ut}from"./Refresh-BNaUmDFT.js";import{D as Vt,g as Gt}from"./traffic-D56Ew432.js";import{u as Yt}from"./use-mobile-C9rByBew.js";import"./TableRow-D2EIvRB_.js";import"./useThemeProps-C_6zzxTC.js";import"./emotion-react.browser.esm-CorLywyT.js";import"./ViewColumn-CxnzgopE.js";import"./Search-BqZFZ5g2.js";import"./Clear-B9P4WqAY.js";import"./Delete-CvkgpWXX.js";import"./index-C0MwD3ew.js";import"./MoreVert-Ca16Cnof.js";import"./TableSearch-CAvitNOv.js";import"./useLocalStorage-osYXE-mL.js";import"./get-safe-url-t5_KGb1I.js";import"./ButtonGroup-pRTDFJWg.js";import"./getValidReactChildren-DuVu0i0i.js";import"./url-evaluation-D9TCPMS4.js";import"./permission-BwU5vqVv.js";import"./index.esm-S1RHFvfU.js";import"./collapse-C2nB1Q0B.js";import"./blocklet-3SnK_ln7.js";import"./Switch-SGjalYgz.js";import"./iframe-AXVHNW_k.js";import"./ChevronLeft-ud_S8L4-.js";import"./ChevronRight-B_-R2Sts.js";import"./index-Vj6hcvqX.js";import"./base-chart-YZwnGzYD.js";import"./index-VoBTA_fx.js";import"./AdapterDayjs-cAovH2Wn.js";import"./CSSTransition-DwzJ0puV.js";import"./refType-RuhvdYnQ.js";const pt=x.createContext({}),{Provider:Jt,Consumer:pn}=pt;function Qt({children:t,blocklet:s=""}){const{api:n,inService:o,ws:{useSubscription:r}}=St(),[l,b]=x.useState([]),[u,D]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),f=Q(()=>{var p;return(p=s.meta)==null?void 0:p.did},[s]),[C,N]=x.useState([]),[B,z]=x.useState({}),E=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),Y=async({page:p=1,pageSize:S=20,...A}={})=>{if(!f)return[];try{const w={paging:{page:p,pageSize:S},...A,teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0},{dids:O,..._}=w;let Z="";O&&O.includes("system")&&(Z="system");const W=O?O.filter(le=>le!=="system"):[],ae={..._,source:Z,componentDids:W},se=await n.getNotificationSendLog({input:ae});return z(ae),b(se.list),D(se.paging),se.list}catch(w){return V.error(w.message),[]}},k=async()=>{const p=await n.getNotificationComponents({input:{teamDid:f}});N(p.componentDids)},P=x.useCallback(p=>{const S=s.children.find(A=>{var w;return((w=A.meta)==null?void 0:w.did)===p});if(S)return S.ancestors=[s],S},[s]),I=async({notificationId:p,receivers:S,channels:A,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:p,receivers:S,channels:A.map(O=>O==="wallet"?L.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?L.NOTIFICATION_SEND_CHANNEL.PUSH:O),...w}})},H=x.useCallback(async p=>(await n.getUser({input:{teamDid:f,user:{did:p}}})).user,[n,f]),J=x.useCallback(async({page:p=1,pageSize:S=20,...A}={})=>{try{const w={paging:{page:p,pageSize:S},...A,userName:A.searchText||"",teamDid:f,dateRange:A.dateRange?[$(A.dateRange[0]).toISOString(),$(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw V.error(w.message),w}},[n,f]);x.useEffect(()=>{f&&k()},[f]),r(L.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{E.has(p.notificationId)&&Y(B)},[E,B]),r(L.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{E.has(p.id)||Y(B)},[E,B]);const te={fetch:Y,data:l,paging:u,blocklet:s,getComponent:P,resendNotification:I,getUser:H,componentDids:C,getReceivers:J,inService:o,teamDid:f};return e.jsx(Jt,{value:{notificationRecords:te},children:t})}function We(){const{notificationRecords:t}=x.useContext(pt);return t}be.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Xt={info:"primary",success:"success",error:"error",warning:"warning"};function be({severity:t="info"}){return e.jsx(Ct,{type:Xt[t],children:t})}var Me={},Zt=Ze;Object.defineProperty(Me,"__esModule",{value:!0});var ft=Me.default=void 0,es=Zt(Xe()),ts=e;ft=Me.default=(0,es.default)((0,ts.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"}),"CheckCircleOutline");var qe={},ss=Ze;Object.defineProperty(qe,"__esModule",{value:!0});var mt=qe.default=void 0,ns=ss(Xe()),as=e;mt=qe.default=(0,ns.default)((0,as.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"}),"Block");const is=(t,s,n="")=>{if(!n||!s)return"";switch(n){case L.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case L.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ht(t,s,n={}){const{status:o,updatedAt:r,reason:l="",channel:b="wallet"}=n,u=r?t("notification.sendStatus.sentTime",{date:Nt(r,s)}):"",D=is(t,b,l);return o===L.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:D}:o===L.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:D,sentTime:u}}const ke={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Fe=["wallet","pushKit","email"],Qe=["info","success","error","warning"],gt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:o.enabled},xt=t=>{var n,o;const{settings:s}=t;return(o=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:o.enabled},os=(t,s)=>{const n=ne(s,"extra.notifications.email",!0);return{available:gt(t),enabled:n}},rs=(t,s)=>{const n=ne(s,"extra.notifications.push",!0);return{available:xt(t),enabled:n}},ls=t=>({enabled:ne(t,"extra.notifications.wallet",!0)}),cs=t=>({enabled:ne(t,"extra.webhooks",[]).length>0}),ye=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ds=(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})}]:[],ve=(t=[])=>{const s=$().startOf("day");return t.filter(n=>$(n.sendAt).isSame(s,"day")).length},us=(t,s="")=>{if(s&&Fe.includes(s)){const l=`${s}SendRecord`,b=ne(t,l,[]);return ve(b)}const n=ne(t,"webhook",{}),o=Object.keys(n??{})??[];if(s&&o.includes(s)){const l=n[s]??[];return ve(l)}const r={};return Fe.forEach(l=>{const b=`${l}SendRecord`,u=ne(t,b,[]),D=ve(u);r[l]=D}),o.length>0&&o.forEach(l=>{const b=n[l]??[],u=ve(b);r[l]=u}),r},Ce=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Ne=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ps=t=>{switch(t){case L.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case L.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case L.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case L.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},bt=()=>({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 ee({config:t,enableTooltip:s=!0,showTitle:n=!1,children:o}){const{status:r,title:l="",sentTime:b="",reason:u=""}=t,D=[l,u].filter(Boolean).join(", ");return e.jsx(wt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(G,{color:"inherit",sx:{fontSize:12},children:D}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(v,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(v,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(v,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:ke[r],style:{opacity:.15}}),e.jsx(v,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:ke[r]})]}),e.jsx(G,{color:"inherit",sx:{fontSize:12},children:n?l:o})]})})}ee.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ee.defaultProps={enableTooltip:!0,showTitle:!1,children:null};me.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};me.defaultProps={onDelete:()=>{}};function me({list:t,label:s,onDelete:n}){const{t:o,locale:r}=X();return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(l=>{const b=ht(o,r,{status:l});return e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ee,{config:b,enableTooltip:!1,children:b.title})}),onDelete:u=>n(u,l)},l)})]})}Ke.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 Ke({filterList:t,onChange:s,index:n,column:o,filterValues:r,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:l}),e.jsx(Ee,{row:!0,children:r.map(u=>e.jsx(De,{control:e.jsx(Ae,{checked:t[n].indexOf(u.value??u)>-1,onChange:D=>{const f=[...t];D.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(C=>C!==(u.value??u)),s(f[n],n,o)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(u)})},u.value??u))})]})}function Ie(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(ee,{enableTooltip:!1,config:{status:s.status},children:s.label})})}pe.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function pe({status:t,updatedAt:s,reason:n="",channel:o="wallet",onResend:r}){const{t:l,locale:b}=X(),u=ht(l,b,{status:t,updatedAt:s,reason:n,channel:o});return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ee,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:r,children:l("notification.resend")})]})}$e.propTypes={value:d.array.isRequired,onChange:d.func};function $e({value:t,onChange:s}){const{locale:n}=X(),o=$().toDate(),[r,l]=x.useState(null),b=x.useCallback(f=>{l(r?null:f.currentTarget)},[r]),u=!!r,D=x.useCallback(f=>{if(!f.startDate||!f.endDate){V.error("Please select a date range");return}if($(f.startDate).isAfter(f.endDate)||!$(f.startDate).isValid()||!$(f.endDate).isValid()){V.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(G,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(we,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Oe,{open:u,anchorEl:r,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Vt,{open:!0,maxDate:o,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Gt(o),onChange:D})})]})}He.propTypes={itemComponent:d.elementType.isRequired};function He({itemComponent:t,...s}){var r;const{t:n}=X();return!((r=s==null?void 0:s.filterList)!=null&&r.filter(l=>l.length).length)?null:e.jsxs(v,{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(Mt.TableFilterList,{...s,ItemComponent:t})})]})}function Te({label:t,onDelete:s,canDelete:n=()=>!0,...o}){const r=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...o})),e.jsx(_e,{label:t,variant:"outlined",...r&&l?{onDelete:r}:{}})}Te.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Te.defaultProps={canDelete:()=>!0};const fs=[{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}];Ue.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ue.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ue({loading:t=!1,onCancel:s,onConfirm:n}){const{t:o}=X(),[r,l]=x.useState(fs),[b,u]=x.useState(!0),D=(C,N)=>{N.checked=C.target.checked;const B=r.map(z=>({...z,checked:z.value===N.value?N.checked:z.checked}));l(B)},f=C=>{C.stopPropagation(),n({channels:r.filter(N=>N.checked).map(N=>N.value),isResendFailedOnly:b})};return e.jsxs(v,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(G,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:o("notification.config")}),e.jsx(v,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:o("notification.selectChannels")}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:r.map(C=>e.jsx(De,{control:e.jsx(Ae,{checked:C.checked,onChange:N=>D(N,C),name:C.value}),label:C.label},C.value))})]})}),e.jsx(v,{className:"resend-config-footer",children:e.jsx(Ee,{children:e.jsx(De,{control:e.jsx(Ae,{checked:b,onChange:C=>u(C.target.checked)}),label:o("notification.resendFailedOnly")})})}),e.jsxs(v,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(we,{onClick:C=>{C.stopPropagation(),s()},color:"inherit",children:o("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),o("common.confirm")]})]})]})}jt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function jt({notificationId:t,handleResend:s,resending:n=!1}){const{t:o,locale:r}=X(),l=st(),b=x.useMemo(()=>nt(l,bt()),[l]),{getReceivers:u,inService:D,teamDid:f,getUser:C,blocklet:N}=We(),[B,z]=x.useState(!1),[E,Y]=x.useState([]),k=Le({anchorEl:null,position:null}),P=Le({anchorEl:null,position:null}),[I,H]=x.useState(null),[J,te]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,S]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),[A,w]=x.useState([]),O=[{label:o("notification.sendStatus.pending"),value:0,status:"pending"},{label:o("notification.sendStatus.success"),value:1,status:"success"},{label:o("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!B&&t)try{z(!0);const a=await u({notificationId:t,...p}),i=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:rt(c.receiverUser.avatar,f,D)}}));Y(i),te(a.paging),z(!1)}catch(a){V.error(a.message),z(!1)}};x.useEffect(()=>{_()},[p]);const Z=a=>{a.stopPropagation();const i=a.currentTarget;P.anchorEl=i;const c=i.getBoundingClientRect();P.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},W=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Pe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:Z,children:o("notification.resend")})}):null,ae={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:o("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:J.page-1,rowsPerPage:J.pageSize,count:J.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:A,onRowSelectionChange:(a,i)=>{w(i.map(c=>c.dataIndex))},customToolbarSelect:W},se=({page:a,rowsPerPage:i,searchText:c,filterList:y})=>{const[,F=[],K=[],q=[]]=y;p.pageSize!==i?S(M=>({...M,pageSize:i,page:1})):p.page!==a+1?S(M=>({...M,page:a+1})):p.searchText!==c?S(M=>({...M,searchText:c,page:1})):fe(F,p.walletSendStatus)?fe(K,p.pushKitSendStatus)?fe(q,p.emailSendStatus)||S(M=>({...M,emailSendStatus:q,page:1})):S(M=>({...M,pushKitSendStatus:K,page:1})):S(M=>({...M,walletSendStatus:F,page:1}))},le=x.useCallback(async(a,i)=>{if(!i)return!1;const c=await C(i);return c?a==="wallet"?ls(c):a==="email"?os(N,c):a==="pushKit"?rs(N,c):a==="webhook"?cs(c):!0:!1},[C,N]),je=x.useCallback(a=>ds(o,a),[o]),ce=()=>{k.anchorEl=null,k.position=null,H(null)},de=()=>{P.anchorEl=null,P.position=null},ue=async(a,i,c=!0,y="")=>{if(!(!i.length||!a.length))try{s(a,i,c,y),P.anchorEl||(await ye(.5),ce())}catch(F){console.error("handleResend error",{error:F})}},h=async({channels:a,isResendFailedOnly:i})=>{const c=A.map(y=>E[y].receiver);await ue(a,c,i),await ye(.5),de(),w([])},m=async(a,i=[],c=!0)=>{try{await ue(["webhook"],[a.receiver],c,i)}catch(y){V.error(y.response?y.response.statusText:y.message)}},g=async(a,i,c,y=[],F=!0)=>{if(a.stopPropagation(),us(i,c)>=4){V.warning(o("notification.resendLimit"));return}if(!Fe.includes(c)){await m(i,y,F);return}if(a){const q=a.currentTarget,M=q.getBoundingClientRect();k.anchorEl=q,k.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}H({channel:c});try{const q=await le(c,i.receiver);await ye(1),H({channel:c,result:q}),(typeof q=="boolean"&&q||Rt(q)&&Object.values(q).every(M=>!!M))&&(await s([c],[i.receiver],F),P.anchorEl||(await ye(.5),ce()))}catch(q){V.error(q.message)}},j=a=>{S(i=>({...i,dateRange:a,page:1}))},T=(a,i,c,y)=>{a.stopPropagation();const F=c.filter(K=>K!==i);S(K=>({...K,[y]:F,page:1}))},R=Q(()=>[{label:o("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:i,receiver:c}=E[a];return i?e.jsxs(v,{"data-cy":`member-name-${i.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(at,{src:`${i.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(xe,{children:i.fullName})]},c):e.jsx(Tt,{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(me,{list:a,label:"Wallet",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[1].options.filterList,"walletSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Wallet",filterList:a,onChange:i,index:c,column:y,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:i,walletSendAt:c,walletSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"wallet",onResend:F=>g(F,E[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:i,pushKitSendAt:c,pushKitSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>g(F,E[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Push Kit",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[2].options.filterList,"pushKitSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Push Kit",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:i,emailSendAt:c,emailSendFailedReason:y}=E[a];return e.jsx(pe,{status:i,updatedAt:c,reason:y,channel:"email",onResend:F=>g(F,E[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(me,{list:a,label:"Email",onDelete:(i,c)=>{i.stopPropagation(),T(i,c,R[3].options.filterList,"emailSendStatus")}}),update:Ce},filterOptions:{names:O,fullWidth:!0,logic:Ne,display:(a,i,c,y)=>e.jsx(Ie,{label:"Email",filterList:a,onChange:i,index:c,column:y,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:i}=E[a];if(!i)return null;const c=Object.entries(i)[0];if(!c)return null;const[y,F]=c,K=F[0];return e.jsx(v,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(v,{className:"webhook-item",fontSize:12,children:[e.jsx(xe,{maxLength:30,children:y},y),e.jsx(pe,{status:K.status,updatedAt:K.sendAt,reason:K.failedReason,channel:"webhook",onResend:q=>g(q,E[a],"webhook",[y],!1)})]},y)})}}},{label:o("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:i}=E[a];return e.jsx(it,{value:i,locale:r,shouldUpdate:!0})}}}],[E,r,p,o]),U=[e.jsx($e,{value:p.dateRange,onChange:j},"date-picker"),e.jsx(Pe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:o("common.refresh")},"refresh")];return e.jsx(v,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(hs,{children:e.jsxs(ot,{theme:b,children:[e.jsx(dt,{className:"receivers-table",locale:r,loading:B,columns:R,data:E,onChange:se,options:ae,customButtons:U,components:{TableFilterList:a=>e.jsx(He,{...a,itemComponent:i=>e.jsx(Te,{...i,canDelete:()=>!1})})}}),k.anchorEl&&e.jsx(Oe,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:ce,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(gs,{children:[e.jsxs(G,{variant:"body1",component:"div",className:"check-title",children:[I==null?void 0:I.channel," Checking"]}),e.jsx(v,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:je(I==null?void 0:I.channel).map(a=>{var F,K;const{type:i,pass:c,fail:y}=a;return!(I!=null&&I.result)||(F=I==null?void 0:I.result)!=null&&F[i]?e.jsxs(G,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(K=I==null?void 0:I.result)!=null&&K[i]?Se.success.main:"inherit"},children:[I!=null&&I.result?e.jsx(ft,{}):e.jsx(tt,{size:12,sx:{color:Se.primary.main}}),e.jsx("span",{children:c})]},i):e.jsxs(G,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Se.error.main},children:[e.jsx(mt,{}),e.jsx("span",{children:y})]},i)})})]})}),P.anchorEl&&e.jsx(Oe,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:de,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ue,{loading:n,onCancel:de,onConfirm:h})})]})})})}const ms=x.memo(jt),hs=re.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -27,7 +27,7 @@ import{bq as St,r as x,bC as Q,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
27
27
  }
28
28
  font-size: 12px;
29
29
  }
30
- `,he=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function xs(t){const{wallet:s,push:n,email:o,webhook:r}=t;return[{name:"Wallet",value:e.jsx(ie,{item:s})},{name:"Push",value:e.jsx(ie,{item:n})},{name:"Email",value:e.jsx(ie,{item:o})},...r.total>0?[{name:"Webhook",value:e.jsx(ie,{item:r,isWebhook:!0})}]:[]]}function bs(t,s,n){const{wallet:o,push:r,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,item:o,onResend:s})},{name:"Push",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.PUSH,item:r,onResend:s})},{name:"Email",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Re.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Re.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ie.propTypes={item:d.object.isRequired,isWebhook:d.bool};ie.defaultProps={isWebhook:!1};function ie({item:t,isWebhook:s=!1}){const{t:n}=X(),o=s?t.success.length:t.success,r=t.total,l=o===r?"success":"failed";return e.jsx(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(v,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ee,{config:{status:l},enableTooltip:!1,children:[he(o)," / ",he(r)," ",n("notification.sendStatus.success")]})})})}oe.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};oe.defaultProps={isWebhook:!1,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function oe({channel:t,item:s,isWebhook:n=!1,onResend:o,loading:r}){const{t:l}=X(),{success:b,failed:u,pending:D}=s,f=ps(t),C=n?b.length:b,N=n?u.length:u,B=n?D.length:D,z=async k=>{k.stopPropagation();const I=n?[...new Set([...b,...u].map(H=>H))]:[];await o([t],[],!0,I)},E=C+N,Y=E>0?C/E*100:0,P=E>0?N/E*100:0;return e.jsxs(js,{successRatio:Y,failedRatio:P,children:[e.jsxs(G,{variant:"h6",children:[f," (",s.total,")"]}),e.jsxs(G,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Pe.success,fontWeight:600,fontSize:24},children:he(C)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(v,{className:"unsent-area",children:[e.jsxs(v,{children:[e.jsxs(ee,{config:{status:"failed"},enableTooltip:!1,children:[he(N)," ",l("notification.sendStatus.failed")]}),e.jsxs(ee,{config:{status:"pending"},enableTooltip:!1,children:[he(B)," ",l("notification.sendStatus.pending")]})]}),N>0&&e.jsx(v,{className:"resend-btn",children:e.jsx(ke,{size:"small",color:"primary",loading:r,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:z,children:l("notification.resend")})})]})]})}function Re({statistics:t,mode:s="simple",onResend:n,resending:o}){const r=Q(()=>s==="simple"?xs(t):bs(t,n,o),[t,s]);return s==="simple"?e.jsx("div",{children:r.map(l=>e.jsx(ut,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ye,{container:!0,spacing:2,children:r.map(l=>e.jsx(Ye,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const js=re(v)`
30
+ `,he=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function xs(t){const{wallet:s,push:n,email:o,webhook:r}=t;return[{name:"Wallet",value:e.jsx(ie,{item:s})},{name:"Push",value:e.jsx(ie,{item:n})},{name:"Email",value:e.jsx(ie,{item:o})},...r.total>0?[{name:"Webhook",value:e.jsx(ie,{item:r,isWebhook:!0})}]:[]]}function bs(t,s,n){const{wallet:o,push:r,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,item:o,onResend:s})},{name:"Push",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.PUSH,item:r,onResend:s})},{name:"Email",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(oe,{loading:n,channel:L.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Re.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Re.defaultProps={mode:"simple",onResend:()=>{},resending:!1};ie.propTypes={item:d.object.isRequired,isWebhook:d.bool};ie.defaultProps={isWebhook:!1};function ie({item:t,isWebhook:s=!1}){const{t:n}=X(),o=s?t.success.length:t.success,r=t.total,l=o===r?"success":"failed";return e.jsx(v,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(v,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ee,{config:{status:l},enableTooltip:!1,children:[he(o)," / ",he(r)," ",n("notification.sendStatus.success")]})})})}oe.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};oe.defaultProps={isWebhook:!1,channel:L.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function oe({channel:t,item:s,isWebhook:n=!1,onResend:o,loading:r}){const{t:l}=X(),{success:b,failed:u,pending:D}=s,f=ps(t),C=n?b.length:b,N=n?u.length:u,B=n?D.length:D,z=async P=>{P.stopPropagation();const I=n?[...new Set([...b,...u].map(H=>H))]:[];await o([t],[],!0,I)},E=C+N,Y=E>0?C/E*100:0,k=E>0?N/E*100:0;return e.jsxs(js,{successRatio:Y,failedRatio:k,children:[e.jsxs(G,{variant:"h6",children:[f," (",s.total,")"]}),e.jsxs(G,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:ke.success,fontWeight:600,fontSize:24},children:he(C)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(v,{className:"unsent-area",children:[e.jsxs(v,{children:[e.jsxs(ee,{config:{status:"failed"},enableTooltip:!1,children:[he(N)," ",l("notification.sendStatus.failed")]}),e.jsxs(ee,{config:{status:"pending"},enableTooltip:!1,children:[he(B)," ",l("notification.sendStatus.pending")]})]}),N>0&&e.jsx(v,{className:"resend-btn",children:e.jsx(Pe,{size:"small",color:"primary",loading:r,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:z,children:l("notification.resend")})})]})]})}function Re({statistics:t,mode:s="simple",onResend:n,resending:o}){const r=Q(()=>s==="simple"?xs(t):bs(t,n,o),[t,s]);return s==="simple"?e.jsx("div",{children:r.map(l=>e.jsx(ut,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(Ye,{container:!0,spacing:2,children:r.map(l=>e.jsx(Ye,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const js=re(v)`
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
@@ -45,7 +45,7 @@ import{bq as St,r as x,bC as Q,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
45
45
  bottom: 0;
46
46
  }
47
47
  }
48
- `;yt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function yt({notification:t,onCancel:s=()=>{},blocklet:n,tab:o="info"}){const{t:r,locale:l}=X(),{getComponent:b,resendNotification:u}=We(),[D,f]=x.useState(!1),C=Q(()=>b(t.componentDid)||n,[n,t.componentDid]),N=Le({tab:o||"info"}),B=x.useCallback(async(p,S,A=!0,w=[])=>{var Z;if(!p.length||!t.id)return;const O=S.length>0?S:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(W=>W.receiver);if(!O.length)return;let _=[...p];if(_.includes(L.NOTIFICATION_SEND_CHANNEL.PUSH)&&!xt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.PUSH)),_.includes(L.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!gt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Email"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!_.length)try{f(!0),await u({notificationId:t.id,receivers:O,channels:_,resendFailedOnly:A,..._.includes("webhook")&&w.length?{webhookUrls:w}:{}}),V.success("Message has been sent!")}catch(W){console.error("handleResend error",{error:W}),V.error(W.response?W.response.statusText:W.message)}finally{f(!1)}},[n,t.id,t==null?void 0:t.receivers,u,r]),z=Q(()=>Et(t),[t]),E=Q(()=>Dt(t),[t]),Y=Q(()=>z?t==null?void 0:t.actorInfo:[],[t]),P=Q(()=>{var p;return(n==null?void 0:n.did)||((p=n==null?void 0:n.meta)==null?void 0:p.did)||""},[n]);function k(){return[{name:r("notification.from"),value:z&&E?e.jsx(At,{actors:Y,teamDid:P,size:32,showName:!0}):e.jsx(Ot,{size:32,blocklet:C,showName:!0,hideDot:!0})},{name:r("notification.notificationTitle"),value:e.jsx(xe,{maxLength:50,children:t.title})},{name:r("notification.body"),value:z?e.jsx(Lt,{notification:t,blocklet:n}):e.jsx(kt,{notification:t,rows:0})},{name:r("notification.severity"),value:e.jsx(be,{severity:t.severity})},{name:r("notification.createdAt"),value:e.jsx(Pt,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(S=>e.jsx(ut,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:S.name,children:S.value},S.name))}const I={info:{label:r("common.basicInfo"),value:"info",component:k},receivers:{label:r("notification.receiver"),value:"receivers"},statistics:{label:r("notification.statistics"),value:"statistics"}},H=Object.values(I).map(({label:p,value:S})=>({label:p,value:S})),J=I[N.tab]||I.info,te=p=>{N.tab=p};return e.jsx(lt,{title:r("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{N.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(vs,{children:[e.jsx(v,{mx:3,className:"tabs",children:e.jsx(Ht,{tabs:H,current:N.tab,onChange:te,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[N.tab==="receivers"&&e.jsx(ms,{notificationId:t.id,resending:D,handleResend:B}),N.tab==="statistics"&&e.jsx(Re,{statistics:t.statistics,mode:"detail",resending:D,onResend:B}),N.tab==="info"&&e.jsx(J.component,{})]})]})})}const ys=x.memo(yt),vs=re.div`
48
+ `;yt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function yt({notification:t,onCancel:s=()=>{},blocklet:n,tab:o="info"}){const{t:r,locale:l}=X(),{getComponent:b,resendNotification:u}=We(),[D,f]=x.useState(!1),C=Q(()=>b(t.componentDid)||n,[n,t.componentDid]),N=Le({tab:o||"info"}),B=x.useCallback(async(p,S,A=!0,w=[])=>{var Z;if(!p.length||!t.id)return;const O=S.length>0?S:(Z=t==null?void 0:t.receivers)==null?void 0:Z.map(W=>W.receiver);if(!O.length)return;let _=[...p];if(_.includes(L.NOTIFICATION_SEND_CHANNEL.PUSH)&&!xt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.PUSH)),_.includes(L.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!gt(n)&&(V.warning(r("notification.sendStatus.reason.unavailable",{channel:"Email"})),_=_.filter(W=>W!==L.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!_.length)try{f(!0),await u({notificationId:t.id,receivers:O,channels:_,resendFailedOnly:A,..._.includes("webhook")&&w.length?{webhookUrls:w}:{}}),V.success("Message has been sent!")}catch(W){console.error("handleResend error",{error:W}),V.error(W.response?W.response.statusText:W.message)}finally{f(!1)}},[n,t.id,t==null?void 0:t.receivers,u,r]),z=Q(()=>Et(t),[t]),E=Q(()=>Dt(t),[t]),Y=Q(()=>z?t==null?void 0:t.actorInfo:[],[t]),k=Q(()=>{var p;return(n==null?void 0:n.did)||((p=n==null?void 0:n.meta)==null?void 0:p.did)||""},[n]);function P(){return[{name:r("notification.from"),value:z&&E?e.jsx(At,{actors:Y,teamDid:k,size:32,showName:!0}):e.jsx(Ot,{size:32,blocklet:C,showName:!0,hideDot:!0})},{name:r("notification.notificationTitle"),value:e.jsx(xe,{maxLength:50,children:t.title})},{name:r("notification.body"),value:z?e.jsx(Lt,{notification:t,blocklet:n}):e.jsx(Pt,{notification:t,rows:0})},{name:r("notification.severity"),value:e.jsx(be,{severity:t.severity})},{name:r("notification.createdAt"),value:e.jsx(kt,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(S=>e.jsx(ut,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:S.name,children:S.value},S.name))}const I={info:{label:r("common.basicInfo"),value:"info",component:P},receivers:{label:r("notification.receiver"),value:"receivers"},statistics:{label:r("notification.statistics"),value:"statistics"}},H=Object.values(I).map(({label:p,value:S})=>({label:p,value:S})),J=I[N.tab]||I.info,te=p=>{N.tab=p};return e.jsx(lt,{title:r("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{N.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(vs,{children:[e.jsx(v,{mx:3,className:"tabs",children:e.jsx(Ht,{tabs:H,current:N.tab,onChange:te,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[N.tab==="receivers"&&e.jsx(ms,{notificationId:t.id,resending:D,handleResend:B}),N.tab==="statistics"&&e.jsx(Re,{statistics:t.statistics,mode:"detail",resending:D,onResend:B}),N.tab==="info"&&e.jsx(J.component,{})]})]})})}const ys=x.memo(yt),vs=re.div`
49
49
  & > .notification-row {
50
50
  padding: 0;
51
51
  }
@@ -92,7 +92,7 @@ import{bq as St,r as x,bC as Q,bi as $,y as V,A as L,j as e,P as d,T as Ct,aP as
92
92
  overflow: hidden;
93
93
  text-overflow: ellipsis;
94
94
  }
95
- `;function ge({blocklet:t,label:s}){var n;return e.jsx(Ss,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(ct,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ve.defaultProps={onDelete:()=>{}};function Ve({list:t,label:s,onDelete:n}){return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(o=>e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(be,{severity:o})}),onDelete:r=>n(r,o)},o))]})}function Cs(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(be,{severity:s})})}function Ns({customTableButtons:t}){var ue;const{t:s,locale:n}=X(),o=st(),r=x.useMemo(()=>nt(o,bt()),[o]),[l,b]=x.useState(!1),{data:u,paging:D,blocklet:f,fetch:C,getComponent:N,componentDids:B,inService:z,teamDid:E}=We(),Y=x.useRef(null),[P,k]=x.useState(null),[I,H]=x.useState("info"),J=Yt(),[te,p]=x.useState(!1),S=`notification-records-${(ue=f.meta)==null?void 0:ue.did}`,A=qt(S),[w,O]=x.useState({pageSize:A.rowsPerPage||10,page:A.page?A.page+1:1,dids:A.dids||[],dateRange:A.dateRange||[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),_=Q(()=>{if(!f.children||!f.children.length)return[];const h=[];return f.children.forEach(m=>{var j;const g=m.did||((j=m.meta)==null?void 0:j.did);B.includes(g)&&(m.ancestors=[f],h.push(m))}),h},[B,f]),Z=async h=>{try{b(!0),await C(h),b(!1)}finally{b(!1)}};x.useEffect(()=>{Z(w)},[w]),x.useEffect(()=>{const h=u.find(m=>m.id===(P==null?void 0:P.id));P&&h&&k({...h})},[u]);const W=(h,m,g,j)=>{h.stopPropagation();const T=g.filter(R=>R!==m);O(R=>({...R,[j]:T,page:1}))},ae=({page:h,rowsPerPage:m,filterList:g})=>{const[j=[],,,,T=[]]=g;w.pageSize!==m?O(R=>({...R,pageSize:m,page:1})):w.page!==h+1?O(R=>({...R,page:h+1})):fe(w.dids,j)?fe(w.severities,T)||O(R=>({...R,severities:T,page:1})):O(R=>({...R,dids:j,page:1}))},se=x.useCallback(()=>{k(null),H("info")},[]),le=x.useCallback(()=>{C(w)},[C,w]),je=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:h=>h.map((m,g)=>{var T;if(m==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const j=_.find(R=>{var a;return(R.did||((a=R.meta)==null?void 0:a.did))===m});return e.jsx(ge,{blocklet:j,label:(j==null?void 0:j.title)||((T=j==null?void 0:j.meta)==null?void 0:T.title)},m)}),update:(h,m,g)=>(h[g].splice(m,1),h)},filterOptions:{names:_,logic:(h,m)=>m.length?!m.includes(h):!1,display:(h,m,g,j)=>e.jsxs(Be,{style:{width:"380px"},children:[e.jsx(Ft,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(_t,{multiple:!0,value:h[g],renderValue:T=>e.jsx(v,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(R=>{var a;if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const U=_.find(i=>{var y;return(i.did||((y=i.meta)==null?void 0:y.did))===R});return e.jsx(ge,{blocklet:U,label:(U==null?void 0:U.title)||((a=U==null?void 0:U.meta)==null?void 0:a.title)},R)})}),onChange:T=>{h[g]=T.target.value,m(h[g],g,j)},children:[e.jsx(Je,{value:"system",children:s("notification.system")}),_.map(T=>{var U,a;const R=T.did||((U=T.meta)==null?void 0:U.did);return e.jsx(Je,{value:R,children:e.jsx(ge,{blocklet:T,label:T.title||((a=T.meta)==null?void 0:a.title)})},R)})]})]})},customBodyRenderLite:h=>{var j,T;const m=u[h],g=N(m.componentDid);return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(ct,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(Bt,{blocklet:f,size:32}),e.jsx(xe,{maxLength:50,children:((j=g==null?void 0:g.meta)==null?void 0:j.title)||((T=f==null?void 0:f.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h],{receivers:g}=m;return e.jsx(zt,{total:g.length,renderSurplus:j=>j<100?e.jsxs("span",{children:["+",j]}):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:j=>{j.stopPropagation(),k(m),H("receivers")},children:g.map(j=>{const{receiverUser:T}=j,R=rt(T.avatar,E,z);return e.jsx(at,{alt:T.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:j.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},j.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(v,{onClick:g=>{g.stopPropagation(),k(m),H("statistics")},children:e.jsx(Re,{statistics:m.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(xe,{maxLength:50,children:m.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:h=>{const m=u[h];return e.jsx(be,{severity:m.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:h=>e.jsx(Ve,{list:h,label:s("notification.severity"),onDelete:(m,g)=>{m.stopPropagation(),W(m,g,je[4].options.filterList,"severities")}}),update:Ce},filterOptions:{names:Qe,fullWidth:!0,logic:Ne,display:(h,m,g,j)=>e.jsx(Cs,{label:s("notification.severity"),filterList:h,onChange:m,index:g,column:j,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:h=>{const{createdAt:m}=u[h];return e.jsx(it,{value:m,locale:n,shouldUpdate:!0})}}}],ce=h=>{O(m=>({...m,dateRange:h,page:1}))},de=[e.jsxs(v,{display:"flex",alignItems:"center",gap:1.5,children:[e.jsx(Wt,{onClick:()=>p(!0),sx:{p:J?0:void 0},children:e.jsx(Kt,{})},"settings"),J?e.jsx(G,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(v,{ref:Y,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ws,{children:e.jsx(ot,{theme:r,children:e.jsx(dt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:n,columns:je,data:u,durable:S,onChange:ae,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,...A,onRowClick:(h,{dataIndex:m})=>{k(u[m])}},customPreButtons:[e.jsx($e,{value:w.dateRange,onChange:ce})],customButtons:de,components:{TableFilterList:h=>e.jsx(He,{...h,itemComponent:m=>e.jsx(Te,{...m,canDelete:g=>{var T;const j=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(j==null?void 0:j.name)==="sender"}})})}})})}),P&&e.jsx(ys,{refresh:le,onCancel:se,notification:P,blocklet:f,tab:I}),e.jsx(lt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:te,onClose:()=>p(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(v,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx($t,{})})})]})}const ws=re.div`
95
+ `;function ge({blocklet:t,label:s}){var n;return e.jsx(Ss,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(ct,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ve.defaultProps={onDelete:()=>{}};function Ve({list:t,label:s,onDelete:n}){return e.jsxs(v,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(G,{children:[s,": "]}),t.map(o=>e.jsx(_e,{size:"small",label:e.jsx(v,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(be,{severity:o})}),onDelete:r=>n(r,o)},o))]})}function Cs(t){return e.jsx(Ke,{...t,renderLabel:s=>e.jsx(be,{severity:s})})}function Ns({customTableButtons:t}){var ue;const{t:s,locale:n}=X(),o=st(),r=x.useMemo(()=>nt(o,bt()),[o]),[l,b]=x.useState(!1),{data:u,paging:D,blocklet:f,fetch:C,getComponent:N,componentDids:B,inService:z,teamDid:E}=We(),Y=x.useRef(null),[k,P]=x.useState(null),[I,H]=x.useState("info"),J=Yt(),[te,p]=x.useState(!1),S=`notification-records-${(ue=f.meta)==null?void 0:ue.did}`,A=qt(S),[w,O]=x.useState({pageSize:A.rowsPerPage||10,page:A.page?A.page+1:1,dids:A.dids||[],dateRange:A.dateRange||[$().subtract(1,"month").startOf("day").toDate(),$().endOf("day").toDate()]}),_=Q(()=>{if(!f.children||!f.children.length)return[];const h=[];return f.children.forEach(m=>{var j;const g=m.did||((j=m.meta)==null?void 0:j.did);B.includes(g)&&(m.ancestors=[f],h.push(m))}),h},[B,f]),Z=async h=>{try{b(!0),await C(h),b(!1)}finally{b(!1)}};x.useEffect(()=>{Z(w)},[w]),x.useEffect(()=>{const h=u.find(m=>m.id===(k==null?void 0:k.id));k&&h&&P({...h})},[u]);const W=(h,m,g,j)=>{h.stopPropagation();const T=g.filter(R=>R!==m);O(R=>({...R,[j]:T,page:1}))},ae=({page:h,rowsPerPage:m,filterList:g})=>{const[j=[],,,,T=[]]=g;w.pageSize!==m?O(R=>({...R,pageSize:m,page:1})):w.page!==h+1?O(R=>({...R,page:h+1})):fe(w.dids,j)?fe(w.severities,T)||O(R=>({...R,severities:T,page:1})):O(R=>({...R,dids:j,page:1}))},se=x.useCallback(()=>{P(null),H("info")},[]),le=x.useCallback(()=>{C(w)},[C,w]),je=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:h=>h.map((m,g)=>{var T;if(m==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const j=_.find(R=>{var a;return(R.did||((a=R.meta)==null?void 0:a.did))===m});return e.jsx(ge,{blocklet:j,label:(j==null?void 0:j.title)||((T=j==null?void 0:j.meta)==null?void 0:T.title)},m)}),update:(h,m,g)=>(h[g].splice(m,1),h)},filterOptions:{names:_,logic:(h,m)=>m.length?!m.includes(h):!1,display:(h,m,g,j)=>e.jsxs(Be,{style:{width:"380px"},children:[e.jsx(Ft,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(_t,{multiple:!0,value:h[g],renderValue:T=>e.jsx(v,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(R=>{var a;if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const U=_.find(i=>{var y;return(i.did||((y=i.meta)==null?void 0:y.did))===R});return e.jsx(ge,{blocklet:U,label:(U==null?void 0:U.title)||((a=U==null?void 0:U.meta)==null?void 0:a.title)},R)})}),onChange:T=>{h[g]=T.target.value,m(h[g],g,j)},children:[e.jsx(Je,{value:"system",children:s("notification.system")}),_.map(T=>{var U,a;const R=T.did||((U=T.meta)==null?void 0:U.did);return e.jsx(Je,{value:R,children:e.jsx(ge,{blocklet:T,label:T.title||((a=T.meta)==null?void 0:a.title)})},R)})]})]})},customBodyRenderLite:h=>{var j,T;const m=u[h],g=N(m.componentDid);return e.jsxs(v,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(ct,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(Bt,{blocklet:f,size:32}),e.jsx(xe,{maxLength:50,children:((j=g==null?void 0:g.meta)==null?void 0:j.title)||((T=f==null?void 0:f.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h],{receivers:g}=m;return e.jsx(zt,{total:g.length,renderSurplus:j=>j<100?e.jsxs("span",{children:["+",j]}):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:j=>{j.stopPropagation(),P(m),H("receivers")},children:g.map(j=>{const{receiverUser:T}=j,R=rt(T.avatar,E,z);return e.jsx(at,{alt:T.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:j.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},j.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(v,{onClick:g=>{g.stopPropagation(),P(m),H("statistics")},children:e.jsx(Re,{statistics:m.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:h=>{const m=u[h];return e.jsx(xe,{maxLength:50,children:m.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:h=>{const m=u[h];return e.jsx(be,{severity:m.severity})},filter:!0,filterType:"custom",filterList:w.severities??[],customFilterListOptions:{render:h=>e.jsx(Ve,{list:h,label:s("notification.severity"),onDelete:(m,g)=>{m.stopPropagation(),W(m,g,je[4].options.filterList,"severities")}}),update:Ce},filterOptions:{names:Qe,fullWidth:!0,logic:Ne,display:(h,m,g,j)=>e.jsx(Cs,{label:s("notification.severity"),filterList:h,onChange:m,index:g,column:j,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:h=>{const{createdAt:m}=u[h];return e.jsx(it,{value:m,locale:n,shouldUpdate:!0})}}}],ce=h=>{O(m=>({...m,dateRange:h,page:1}))},de=[e.jsxs(v,{display:"flex",alignItems:"center",gap:1.5,children:[e.jsx(Wt,{onClick:()=>p(!0),sx:{p:J?0:void 0},children:e.jsx(Kt,{})},"settings"),J?e.jsx(G,{children:s("common.setting")}):null]}),...t||[]];return e.jsxs(v,{ref:Y,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ws,{children:e.jsx(ot,{theme:r,children:e.jsx(dt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:n,columns:je,data:u,durable:S,onChange:ae,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:D.page-1,rowsPerPage:D.pageSize,count:D.total,...A,onRowClick:(h,{dataIndex:m})=>{P(u[m])}},customPreButtons:[e.jsx($e,{value:w.dateRange,onChange:ce})],customButtons:de,components:{TableFilterList:h=>e.jsx(He,{...h,itemComponent:m=>e.jsx(Te,{...m,canDelete:g=>{var T;const j=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(j==null?void 0:j.name)==="sender"}})})}})})}),k&&e.jsx(ys,{refresh:le,onCancel:se,notification:k,blocklet:f,tab:I}),e.jsx(lt,{title:`${s("common.notification")} ${s("common.setting")}`,fullWidth:!0,maxWidth:"md",open:te,onClose:()=>p(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(v,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx($t,{})})})]})}const ws=re.div`
96
96
  td.MuiTableCell-footer {
97
97
  border: none !important;
98
98
  }
@@ -1,4 +1,4 @@
1
- import{bW as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bl as getDefaultExportFromCjs,n as newStyled,E as useMediaQuery,dx as Skeleton,cS as Img,$ as default_1$1,aB as Tooltip,ep as Button,k as Typography,C as CircularProgress,b8 as styled,al as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fF as ThemeProvider$1,fG as HeaderAddons,fH as Hidden,Y as Center,aP as requireCreateSvgIcon,aQ as interopRequireDefaultExports,fI as Check,d8 as commonjsGlobal,cF as Buffer,bh as React,fj as noop,bB as __vitePreload,dq as styled$1}from"./index-DTb1YjkO.js";import{j as joinUrl}from"./url-join-IGglLOtK.js";import{C as CloseIcon}from"./Close-6CxneLlA.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const P=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),S=P.filter(T=>!T.hasChild),C=T=>{let O;const D=P.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=P.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(S.findIndex(D=>D.key===o));u(S[O].key)}else u(S[T].key)}const I=S.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:S.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:P}){const S=useMediaQuery(j=>j.breakpoints.down("md")),C=S?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[S?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[P&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:S}),!P&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[S&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!S&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:S,blockletMeta:i,blockletSize:C,loading:P})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const P=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:P,children:P})}const MobileTitleStyle=newStyled.div`
1
+ import{bW as createSvgIcon,j as jsxRuntimeExports,r as reactExports,P as PropTypes,bl as getDefaultExportFromCjs,n as newStyled,E as useMediaQuery,dx as Skeleton,cS as Img,$ as default_1$1,aB as Tooltip,ep as Button,k as Typography,C as CircularProgress,b8 as styled,al as useTheme,ff as isObject,dB as deepmerge,dT as StyledEngineProvider,dU as ThemeProvider,fF as ThemeProvider$1,fG as HeaderAddons,fH as Hidden,Y as Center,aP as requireCreateSvgIcon,aQ as interopRequireDefaultExports,fI as Check,d8 as commonjsGlobal,cF as Buffer,bh as React,fj as noop,bB as __vitePreload,dq as styled$1}from"./index-BXOD69ua.js";import{j as joinUrl}from"./url-join-C88wtrgy.js";import{C as CloseIcon}from"./Close-D_k500g1.js";const PriorityHigh=createSvgIcon([jsxRuntimeExports.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),jsxRuntimeExports.jsx("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh"),StepContext=reactExports.createContext(),{Provider}=StepContext,matchPath=(i,s,a=window.location.pathname.replace(/\/$/,"/"))=>i?s?i===a:new RegExp(i).test(a):!1;function StepProvider({children:i,steps:s,mode:a}){const[o,u]=reactExports.useState("");!o&&s.length&&u(s[0].key);const P=s.map(T=>T.children?[{key:T.key,hasChild:!0},T.children.map(O=>({parentKey:T.key,key:O.key}))]:{key:T.key}).flat(1/0),S=P.filter(T=>!T.hasChild),C=T=>{let O;const D=P.findIndex(H=>H.key===o?(O=H.parentKey,!0):!1);if(O===T)return"current";const L=P.findIndex(H=>H.key===T);if(L!==-1){if(L===D)return"current";if(L<D)return"before"}return"after"};function E(T){u(T)}function _(T){if(typeof T=="function"){const O=T(S.findIndex(D=>D.key===o));u(S[O].key)}else u(S[T].key)}const I=S.findIndex(T=>T.key===o);reactExports.useEffect(()=>{if(a==="history"){let T="";s.some(O=>O.children&&O.children.length?O.children.some(D=>matchPath(D.path,D.exact)?(T=D.key,!0):!1):matchPath(O.path,O.exact)?(T=O.key,!0):!1),T&&u(T)}return()=>{}},[s,a]);const j={steps:s,totalStepsCount:S.length,getStepStatus:C,setActiveStepByKey:E,setActiveStepByIndex:_,activeStep:I,canBackToStep:T=>a==="memory"&&I!==0&&T<I};return jsxRuntimeExports.jsx(Provider,{value:j,children:i})}function useStepContext(){return reactExports.useContext(StepContext)}StepProvider.propTypes={children:PropTypes.any.isRequired,steps:PropTypes.array.isRequired,mode:PropTypes.string};StepProvider.defaultProps={mode:"history"};var has=Object.prototype.hasOwnProperty,toString=Object.prototype.toString;function isEmpty(i){if(i==null)return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(i.toString==toString)switch(i.toString()){case"[object File]":case"[object Map]":case"[object Set]":return i.size===0;case"[object Object]":{for(var s in i)if(has.call(i,s))return!1;return!0}}return!1}var lib=isEmpty;const isEmpty$1=getDefaultExportFromCjs(lib),defaultBlockletLogo=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,translations={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},getTranslations=i=>translations[i]?translations[i]:translations.en,getLaunchingText=i=>i==="zh"?"启动":"Launching",getBlockletDisplayName=i=>(i==null?void 0:i.title)||(i==null?void 0:i.name)||"";function AppHeader({blockletMeta:i,subTitle:s,logoUrl:a,locale:o,navLogo:u,loading:P}){const S=useMediaQuery(j=>j.breakpoints.down("md")),C=S?18:48,E=reactExports.useRef(null),[_,I]=reactExports.useState("");return reactExports.useEffect(()=>{E.current&&E.current.offsetHeight>34&&(_===""?I("middle"):_==="middle"&&I("small"))},[_]),jsxRuntimeExports.jsxs(Container$2,{className:_==="small"?"center-mode":"",children:[S?jsxRuntimeExports.jsx("div",{className:"app-icon",children:u}):jsxRuntimeExports.jsxs("div",{className:"app-icon",children:[P&&jsxRuntimeExports.jsx(AppIconSkeleton,{blockletSize:C,isMobile:S}),!P&&jsxRuntimeExports.jsx(AppIcon,{blockletSize:C,logoUrl:a})]}),jsxRuntimeExports.jsxs("div",{className:"header-title",children:[S&&s&&jsxRuntimeExports.jsx("div",{className:"header-title-sub",children:s}),jsxRuntimeExports.jsxs("div",{className:"app-name-content",children:[!S&&jsxRuntimeExports.jsx("div",{className:"launching-context",children:s||getLaunchingText(o)}),jsxRuntimeExports.jsx("div",{className:`header-title-name ${_==="middle"||_==="small"?"middle-size":""}`,ref:E,children:jsxRuntimeExports.jsx(AppTitle,{logoUrl:a,isMobile:S,blockletMeta:i,blockletSize:C,loading:P})})]})]})]})}AppHeader.propTypes={blockletMeta:PropTypes.object,subTitle:PropTypes.any,logoUrl:PropTypes.string,locale:PropTypes.string,navLogo:PropTypes.any,loading:PropTypes.bool};AppHeader.defaultProps={subTitle:"",logoUrl:"",locale:"",navLogo:"",loading:!1,blockletMeta:{}};function AppIconSkeleton({blockletSize:i,isMobile:s}){return s?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:i,height:i})}function AppIcon({logoUrl:i,blockletSize:s}){return jsxRuntimeExports.jsx(Img,{width:s,height:s,src:i,alt:"blocklet icon",fallback:defaultBlockletLogo,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${i}`)}function AppTitle({isMobile:i,logoUrl:s,blockletMeta:a,blockletSize:o,loading:u}){const P=getBlockletDisplayName(a);return u?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):isEmpty$1(a)?jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):i?jsxRuntimeExports.jsxs(MobileTitleStyle,{children:[jsxRuntimeExports.jsx(AppIcon,{blockletSize:o,logoUrl:s}),jsxRuntimeExports.jsx("span",{className:"ellipsis-title",children:getBlockletDisplayName(a)})]}):jsxRuntimeExports.jsx(AppLink,{className:"app-link",target:"_blank",href:joinUrl((a==null?void 0:a.registryUrl)||"",`/blocklets/${a==null?void 0:a.did}`),title:P,children:P})}const MobileTitleStyle=newStyled.div`
2
2
  .ellipsis-title {
3
3
  flex: 1;
4
4
  position: absolute;
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B37Lr7Hg.js","./index-DTb1YjkO.js","./index-Cp6LwWOU.css"])))=>i.map(i=>d[i]);
2
- import{r as p,cv as F,c5 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as j,E as Q,aT as V,e as J,cy as K,v as _,K as x,cz as Y,W as Z,B as I,bc as ee,k as M,cA as $,g as te,cB as se,bB as ae,cC as oe,cD as ne,u as re,w as ie,ap as ce,bz as le,af as pe}from"./index-DTb1YjkO.js";import{d as de}from"./ViewList-CPkfx4gI.js";import{d as ue}from"./Done-2EsU1aO2.js";import{N as me}from"./index-uw3m84Z2.js";import{w as fe}from"./wrap-locale-B35eVgy7.js";import{g as he}from"./get-safe-url-BHhOK-87.js";import{S as xe,a as ge,b as ve}from"./Stepper-CEe-v4P_.js";import"./emotion-react.browser.esm--gIypTeg.js";var P=function(t){if(!t)return 0;var r=q(t).valueOf()-Date.now();return r<0?0:r},be=function(t){return{days:Math.floor(t/864e5),hours:Math.floor(t/36e5)%24,minutes:Math.floor(t/6e4)%60,seconds:Math.floor(t/1e3)%60,milliseconds:Math.floor(t)%1e3}},we=function(t){t===void 0&&(t={});var r=t||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return F(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in t?g:i,m=X(p.useState(function(){return P(a)}),2),f=m[0],u=m[1],o=H(b);p.useEffect(function(){if(!a){u(0);return}u(P(a));var w=setInterval(function(){var n,c=P(a);u(c),c===0&&(clearInterval(w),(n=o.current)===null||n===void 0||n.call(o))},v);return function(){return clearInterval(w)}},[a,v]);var y=p.useMemo(function(){return be(f)},[f]);return[f,y]},k={},ye=O;Object.defineProperty(k,"__esModule",{value:!0});var R=k.default=void 0,je=ye(G()),Se=s;R=k.default=(0,je.default)((0,Se.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:t,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,m]=p.useState(0),f=p.useRef(null),u=n=>{if(n<0||n>t.length-1)return;g(n);const c=f.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),d(n)};p.useEffect(()=>{u(v);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const y=n=>{o=n.touches[0].clientX},w=n=>{const c=n.changedTouches[0],S=o-c.clientX;Math.abs(S)>60&&(S>0?u(b+1):u(b-1))};return s.jsx(Pe,{ref:f,onTouchStart:y,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:t.map((n,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(me,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const Pe=E.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B0jcX1RF.js","./index-BXOD69ua.js","./index-Cp6LwWOU.css"])))=>i.map(i=>d[i]);
2
+ import{r as p,cv as F,c5 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as j,E as Q,aT as V,e as J,cy as K,v as _,K as x,cz as Y,W as Z,B as I,bc as ee,k as M,cA as $,g as te,cB as se,bB as ae,cC as oe,cD as ne,u as re,w as ie,ap as ce,bz as le,af as pe}from"./index-BXOD69ua.js";import{d as de}from"./ViewList-Dq8vu1UD.js";import{d as ue}from"./Done-oo1eX6tp.js";import{N as me}from"./index-Ba15C891.js";import{w as fe}from"./wrap-locale-BRogPOgW.js";import{g as he}from"./get-safe-url-t5_KGb1I.js";import{S as xe,a as ge,b as ve}from"./Stepper-DEgX4GTY.js";import"./emotion-react.browser.esm-CorLywyT.js";var P=function(t){if(!t)return 0;var r=q(t).valueOf()-Date.now();return r<0?0:r},be=function(t){return{days:Math.floor(t/864e5),hours:Math.floor(t/36e5)%24,minutes:Math.floor(t/6e4)%60,seconds:Math.floor(t/1e3)%60,milliseconds:Math.floor(t)%1e3}},we=function(t){t===void 0&&(t={});var r=t||{},l=r.leftTime,i=r.targetDate,d=r.interval,v=d===void 0?1e3:d,b=r.onEnd,g=p.useMemo(function(){return F(l)&&l>0?Date.now()+l:void 0},[l]),a="leftTime"in t?g:i,m=X(p.useState(function(){return P(a)}),2),f=m[0],u=m[1],o=H(b);p.useEffect(function(){if(!a){u(0);return}u(P(a));var w=setInterval(function(){var n,c=P(a);u(c),c===0&&(clearInterval(w),(n=o.current)===null||n===void 0||n.call(o))},v);return function(){return clearInterval(w)}},[a,v]);var y=p.useMemo(function(){return be(f)},[f]);return[f,y]},k={},ye=O;Object.defineProperty(k,"__esModule",{value:!0});var R=k.default=void 0,je=ye(G()),Se=s;R=k.default=(0,je.default)((0,Se.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");function T({list:t,width:r,height:l,cardSpace:i,onSelect:d,defaultIndex:v}){const[b,g]=p.useState(0),[a,m]=p.useState(0),f=p.useRef(null),u=n=>{if(n<0||n>t.length-1)return;g(n);const c=f.current.clientWidth;m(n*(r+i)-(c-r)/2+i*.5),d(n)};p.useEffect(()=>{u(v);const n=c=>c.preventDefault();f.current.addEventListener("touchmove",n,{passive:!1})},[]);let o;const y=n=>{o=n.touches[0].clientX},w=n=>{const c=n.changedTouches[0],S=o-c.clientX;Math.abs(S)>60&&(S>0?u(b+1):u(b-1))};return s.jsx(Pe,{ref:f,onTouchStart:y,onTouchEnd:w,children:s.jsx("div",{className:"card-container",style:{transform:`translate(${-a}px, 0)`},children:t.map((n,c)=>s.jsx("div",{className:`card-item ${c===b?"selected":""}`,style:{width:r,height:l,margin:i/2},onClick:()=>u(c),children:n.display?s.jsx("div",{className:"card-content",children:s.jsx(me,{data:n.display,style:{width:"100%",height:"100%"}})}):s.jsx("div",{className:"card-content",dangerouslySetInnerHTML:{__html:n.src}})},n.id))})})}const Pe=E.div`
3
3
  overflow: hidden;
4
4
  mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
5
5
  overflow: hidden;
@@ -33,7 +33,7 @@ import{r as p,cv as F,c5 as X,cw as H,cx as q,aP as G,aQ as O,j as s,n as E,P as
33
33
  }
34
34
  }
35
35
  }
36
- `;T.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};function ke({icon:t,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(R,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(t)]})}function Te({SessionContext:t,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(t),g=Q(e=>e.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:u}=ne(),{t:o,locale:y}=p.useContext(J),{wallet:w}=K(),[n,c]=p.useState(0),{searchParams:S}=new URL(window.location.href),C=()=>{a.activeStep++},W=e=>{a.user=e.user},A=()=>{C()},z=(e,h)=>{e!=null&&e.passportId&&f(e.passportId),e!=null&&e.sessionToken&&(m.current.sessionToken=h(e.sessionToken)),e!=null&&e.refreshToken&&(m.current.refreshToken=h(e.refreshToken)),a.success=!0,C()},B=async()=>{try{await b.logout()}catch(e){console.warn(e)}},D=async()=>{if(w&&$()){ae(()=>import("./index-B37Lr7Hg.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url).then(h=>{h.call("arcClosePage")});return}await B(),oe(d)&&d({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken});const e=S.get("redirect");if(e){window.location.replace(he(e));return}u(),window.location.replace("/")},U=e=>{a.passport=e.target.value},[N]=we({leftTime:n,onEnd:()=>{D()}}),L=[{label:o("lostPassport.recoverPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(e=>({src:l({scope:e.scope,role:e.role,title:e.scope==="kyc"?e.name:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:e.scope==="kyc"?{key:"Email",value:e.name}:void 0}),name:e.title,id:e.id,display:e.display})),onSelect:e=>U({target:{value:a.user.passportTypes[e].id}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(I,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:o("common.next")})})]}):s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:y,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")}})},{label:o("lostPassport.receivePassport"),content:()=>{var h;const e={receiverDid:a.user.did,passportId:a.passport,teamDid:((h=window==null?void 0:window.blocklet)==null?void 0:h.did)||""};return s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:y,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:e})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(ee,{style:{fontSize:60}})}),s.jsx(M,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(M,{component:"p",variant:"body2",color:"gray",children:w&&$()?o("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:D,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(Ce,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(xe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:L.map(({label:e})=>s.jsx(ge,{children:s.jsx(ve,{StepIconComponent:ke,children:e})},e))}),s.jsx("div",{className:"stepper-content",children:L[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(te,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const Ce=E(se)`
36
+ `;T.propTypes={list:j.array,width:j.number,height:j.number,cardSpace:j.number,onSelect:j.func,defaultIndex:j.number};T.defaultProps={list:"",width:300,height:400,cardSpace:40,onSelect:()=>{},defaultIndex:0};function ke({icon:t,active:r,completed:l}){const i={1:s.jsx(de,{className:"step-icon"}),2:s.jsx(R,{className:"step-icon"}),3:s.jsx(ue,{className:"step-icon"})},d=["step-icon-w"];return r&&d.push("step-icon-w--active"),l&&d.push("step-icon-w--completed"),s.jsx("div",{className:d.join(" "),children:i[String(t)]})}function Te({SessionContext:t,webWalletUrl:r,createPassportSvg:l,passportColor:i,onLogin:d}){const{api:v,session:b}=p.useContext(t),g=Q(e=>e.breakpoints.down("sm")),a=V({user:null,passport:null,success:!1,activeStep:0}),m=p.useRef({sessionToken:"",refreshToken:""}),{setPassportId:f,clearPassportId:u}=ne(),{t:o,locale:y}=p.useContext(J),{wallet:w}=K(),[n,c]=p.useState(0),{searchParams:S}=new URL(window.location.href),C=()=>{a.activeStep++},W=e=>{a.user=e.user},A=()=>{C()},z=(e,h)=>{e!=null&&e.passportId&&f(e.passportId),e!=null&&e.sessionToken&&(m.current.sessionToken=h(e.sessionToken)),e!=null&&e.refreshToken&&(m.current.refreshToken=h(e.refreshToken)),a.success=!0,C()},B=async()=>{try{await b.logout()}catch(e){console.warn(e)}},D=async()=>{if(w&&$()){ae(()=>import("./index-B0jcX1RF.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url).then(h=>{h.call("arcClosePage")});return}await B(),oe(d)&&d({sessionToken:m.current.sessionToken,refreshToken:m.current.refreshToken});const e=S.get("redirect");if(e){window.location.replace(he(e));return}u(),window.location.replace("/")},U=e=>{a.passport=e.target.value},[N]=we({leftTime:n,onEnd:()=>{D()}}),L=[{label:o("lostPassport.recoverPassport"),content:()=>a.user?s.jsxs(x,{className:"select-passport",children:[s.jsxs(x,{my:1,display:"flex",alignItems:"center",className:"user-info",children:[s.jsx(Y,{src:a.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),s.jsxs(x,{children:[s.jsx(x,{className:"name",children:a.user.fullName}),s.jsx(x,{className:"did",mt:1,children:s.jsx(Z,{responsive:!g,compact:g,did:a.user.did})})]})]}),s.jsx("div",{children:s.jsx(T,{width:g?180:230,height:g?240:306,cardSpace:24,list:a.user.passportTypes.map(e=>({src:l({scope:e.scope,role:e.role,title:e.scope==="kyc"?e.name:e.title,issuer:e.issuer.name,issuerDid:e.issuer.id,ownerDid:a.user.did,ownerName:a.user.fullName,ownerAvatarUrl:a.user.avatar,preferredColor:i||"auto",extra:e.scope==="kyc"?{key:"Email",value:e.name}:void 0}),name:e.title,id:e.id,display:e.display})),onSelect:e=>U({target:{value:a.user.passportTypes[e].id}}),defaultIndex:0})}),s.jsx(x,{textAlign:"center",children:s.jsx(I,{variant:"contained",color:"primary",onClick:()=>A(),disabled:!a.passport,children:o("common.next")})})]}):s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-list",forceConnected:!1,autoConnect:!1,checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:W,locale:y,messages:{title:o("lostPassport.recoverDialog.title"),scan:o("lostPassport.recoverDialog.scan"),confirm:o("lostPassport.recoverDialog.confirm"),success:o("lostPassport.recoverDialog.success")}})},{label:o("lostPassport.receivePassport"),content:()=>{var h;const e={receiverDid:a.user.did,passportId:a.passport,teamDid:((h=window==null?void 0:window.blocklet)==null?void 0:h.did)||""};return s.jsx(_,{popup:!0,open:!0,hideCloseButton:!0,className:"connect",action:"lost-passport-issue",checkFn:v.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:z,locale:y,messages:{title:`${o("lostPassport.receiveDialog.title")}`,scan:o("lostPassport.receiveDialog.scan"),confirm:o("lostPassport.receiveDialog.confirm"),success:o("lostPassport.receiveDialog.success")},extraParams:e})}},{label:o("common.complete"),content:()=>(n===0&&c(3e3),s.jsxs(x,{textAlign:"center",children:[s.jsx(x,{mb:3,color:"success.main",children:s.jsx(ee,{style:{fontSize:60}})}),s.jsx(M,{component:"p",variant:"body1",className:"subheader",children:o("issuePassport.dialog.success")}),s.jsx(M,{component:"p",variant:"body2",color:"gray",children:w&&$()?o("issuePassport.dialog.autoClose",{seconds:Math.round(N/1e3)}):o("issuePassport.dialog.autoJump",{seconds:Math.round(N/1e3)})}),s.jsx(I,{style:{marginTop:40},variant:"contained",color:"primary",onClick:D,children:o("issuePassport.dialog.loginWithPassport")})]}))}];return s.jsx(Ce,{children:s.jsxs("div",{className:"stepper",children:[s.jsx(xe,{className:"stepper-progress",alternativeLabel:!0,activeStep:a.activeStep,children:L.map(({label:e})=>s.jsx(ge,{children:s.jsx(ve,{StepIconComponent:ke,children:e})},e))}),s.jsx("div",{className:"stepper-content",children:L[a.activeStep].content()}),!a.success&&s.jsx(x,{textAlign:"center",fontSize:12,children:s.jsx(te,{href:"/",sx:{color:"#4598FA",textDecoration:"none"},children:o("lostPassport.return")})})]})})}const Ce=E(se)`
37
37
  padding-top: 46px;
38
38
  padding-bottom: 46px;
39
39
  height: 100%;
@@ -1,4 +1,4 @@
1
- import{m as D,j as e,R as B,P as u,r as C,N as G,O as Q,S as Y,Q as Z,K as p,A as z,bq as _,br as Ke,aZ as J,t as M,B as F,C as Ae,ae as ue,e as we,D as xe,aY as Se,U as De,n as $,y as Re,aw as H,l as Ie,W as Be,bs as de,bt as fe,bu as he,bv as ye,bw as $e,H as Pe,k as I,bx as _e,aB as E,a4 as pe,aV as me,by as Le,V as Ne,X as ze,x as Ee,u as We,bp as qe,d as Ue,bz as Me}from"./index-DTb1YjkO.js";import{T as Fe}from"./index-DzK6OW-H.js";import He from"./audit-logs-vnwtSLPp.js";import{T as ge,M as Oe}from"./index-DNFAdenj.js";import{r as be,P as Ve}from"./index-ChSMfUDl.js";import{u as L,T as Xe}from"./team-DbBAK1Lw.js";import{g as Ge,D as Qe}from"./index-CFc2cpAq.js";import{d as Ye}from"./Delete-P4B2dduO.js";import{d as Ze}from"./Edit-frf3Fbx4.js";import{E as Je}from"./index-omP-_XYV.js";import{d as et}from"./Add-CSGWebd7.js";import{C as O}from"./index-BQOOINkR.js";import{C as V}from"./click-to-copy-BBcwV5Sv.js";import{f as tt}from"./index-BojVbZw0.js";import{D as st}from"./delete-confirm-qy4uClf5.js";import{P as ot}from"./permission-DtbkcHFU.js";import{u as nt}from"./blocklet-SKmr21o8.js";import{A as at}from"./actions-C8ldDfDc.js";import{u as je}from"./use-mobile-BoYyduuc.js";import{u as it}from"./useAsyncRetry-BLg3v7lI.js";import"./TableSearch-Uk9kIt7i.js";import"./Search-CUm1f8xo.js";import"./Clear-D0I7uWhD.js";import"./useLocalStorage-DQZ59j66.js";import"./index-D3OlVE0m.js";import"./shorten-label-BOckTQ1X.js";import"./ViewList-CPkfx4gI.js";import"./resource-dialog-DSlsEDCi.js";import"./index-CIeEDIRZ.js";import"./use-mobile-YvhVWxe8.js";import"./ListItemButton-ByIRcZGW.js";import"./index-uw3m84Z2.js";import"./emotion-react.browser.esm--gIypTeg.js";import"./index-C_5on_zt.js";import"./Switch-D3iZUzda.js";import"./url-evaluation-DQ262LSg.js";import"./index-BkStkax6.js";import"./OpenInNew-D79h4Iot.js";import"./index-BJHGOv7L.js";import"./HelpOutline-CBv7x3VM.js";import"./index-DnLtwT4P.js";import"./ButtonGroup-ClVwTb7r.js";import"./getValidReactChildren-B-b9MOMT.js";import"./AdapterDayjs-BqwbfR-J.js";import"./useThemeProps-CtXzBlYo.js";import"./CSSTransition-DpoNbm4c.js";import"./refType-J5vgZzDX.js";import"./index-BLrsx8oH.js";import"./Verified-DjfvSM3n.js";import"./DeleteOutline-EQ9bHspP.js";import"./ErrorOutline-a1DnwqoR.js";import"./sdk-gxKU3x6m.js";import"./LockIcon-C1gL9Uz4.js";import"./cloneDeep-CP0xacDT.js";import"./chain-Cw3CxpIJ.js";import"./list-header-D5Klosqn.js";import"./ToggleButtonGroup-BrZT8OFC.js";import"./TableRow-CQ8RBtid.js";import"./ViewColumn-CcQluqhl.js";import"./MoreVert-C_Ck3fn9.js";import"./MoreHoriz-3d6Yp_t-.js";import"./useAsync-DbB0tJq1.js";function ee({value:t}){const{t:s,locale:c}=D(),r=new Date;return new Date(t)<r?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:t,locale:c}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{value:t,locale:c,type:"all"})}ee.propTypes={value:u.string.isRequired};function te({value:t,onChange:s,...c}){const{t:r}=D(),l=C.useMemo(()=>[{value:"signature",title:r("setting.accessKey.signature"),description:r("setting.accessKey.signatureDesc")},{value:"simple",title:r("setting.accessKey.simple"),description:r("setting.accessKey.simpleDesc")}],[r]);return e.jsxs(G,{style:{width:"100%"},variant:"outlined",...c,children:[e.jsx(Q,{children:r("setting.accessKey.authType")}),e.jsx(Y,{value:t,onChange:s,fullWidth:!0,label:r("setting.accessKey.authType"),children:l.map(o=>e.jsx(Z,{value:o.value,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title}),e.jsx(p,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:o.description})]})},o.value))})]})}te.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const W=()=>{const t=z.RBAC_CONFIG.roles.filter(l=>l.passport),{inService:s}=_(),{roles:c}=L(),r=[...t,...s?c:[]];return Ke(r,"name").filter(l=>l.name!==z.ROLES.OWNER)};function se(t){const{remark:s,onCreate:c}=t,{api:r}=_(),{teamDid:l}=L(),{t:o}=D(),[k,g]=C.useState(!1),[d,v]=C.useState(null),x=W(),b=()=>{g(!1),v(null)},y=async a=>{const{remark:j,passport:f,authType:n}=a;g(!0);const h=await r.createAccessKey({input:{teamDid:l,remark:j.trim(),passport:f,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:n}}),{data:S}=h;c(S),v(null),g(!1)},T={title:`${o("common.create")} ${o("accessKey")}`,description:(a,j,f)=>e.jsxs(J,{gap:3,children:[e.jsx(M,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:n=>{j({...a,remark:n.target.value,__disableConfirm:!a.passport||!n.target.value.trim()}),n.target.value.trim()?f(""):f(o("setting.accessKey.remarkInvalid"))}}),e.jsxs(G,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:o("setting.accessKey.passport")}),e.jsx(Y,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:n=>{const h=n.target.value;f(null),j({...a,passport:h,__disableConfirm:!a.remark||!h})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:k,children:x.map(n=>e.jsx(Z,{value:n.name,"data-cy":`create-access-key-passport-option-${n.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:n.title||n.name}),e.jsx(p,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:n.description})]})},n.name))})]}),e.jsx(te,{value:a.authType,onChange:n=>{j({...a,authType:n.target.value})}}),e.jsx(ge,{placeholder:o("setting.accessKey.expireTime"),value:a.expireAt,onChange:n=>{j({...a,expireAt:n,__disableConfirm:!a.passport||!a.remark||!n})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:y,onCancel:b};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(T),className:"rule-action",children:[k?e.jsx(Ae,{size:16}):e.jsx(et,{style:{fontSize:16}}),o("common.create")]}),d&&e.jsx(ue,{title:d.title,description:d.description,confirm:d.confirm,color:d.color,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}se.propTypes={remark:u.string,onCreate:u.func};se.defaultProps={onCreate:()=>{},remark:""};function oe(t){const{onConfirm:s,accessKeyId:c,accessKeySecret:r,hideSecret:l}=t,{t:o}=C.useContext(we),[k,g]=C.useState(!1),[d,v]=C.useState(()=>l),x=()=>{v(!d)},b=a=>{g(a.target.checked)},y=C.useMemo(()=>{var a,j,f,n;return l?`const Client = require('@abtnode/client');
1
+ import{m as D,j as e,R as B,P as u,r as C,N as G,O as Q,S as Y,Q as Z,K as p,A as z,bq as _,br as Ke,aZ as J,t as M,B as F,C as Ae,ae as ue,e as we,D as xe,aY as Se,U as De,n as $,y as Re,aw as H,l as Ie,W as Be,bs as de,bt as fe,bu as he,bv as ye,bw as $e,H as Pe,k as I,bx as _e,aB as E,a4 as pe,aV as me,by as Le,V as Ne,X as ze,x as Ee,u as We,bp as qe,d as Ue,bz as Me}from"./index-BXOD69ua.js";import{T as Fe}from"./index-4WVfl35V.js";import He from"./audit-logs-CjK3Z08k.js";import{T as ge,M as Oe}from"./index-BA9uj90I.js";import{r as be,P as Ve}from"./index-DGqCsVmc.js";import{u as L,T as Xe}from"./team-CKufRu0w.js";import{g as Ge,D as Qe}from"./index-BZeeqqFX.js";import{d as Ye}from"./Delete-CvkgpWXX.js";import{d as Ze}from"./Edit-D2-hkmp_.js";import{E as Je}from"./index-C0MwD3ew.js";import{d as et}from"./Add-CDNZP3_0.js";import{C as O}from"./index-CGpLBTuz.js";import{C as V}from"./click-to-copy-a5cMFI-_.js";import{f as tt}from"./index-BojVbZw0.js";import{D as st}from"./delete-confirm-m56IXxYG.js";import{P as ot}from"./permission-BwU5vqVv.js";import{u as nt}from"./blocklet-3SnK_ln7.js";import{A as at}from"./actions-CWQtNrcD.js";import{u as je}from"./use-mobile-C9rByBew.js";import{u as it}from"./useAsyncRetry-oFyp9pPD.js";import"./TableSearch-CAvitNOv.js";import"./Search-BqZFZ5g2.js";import"./Clear-B9P4WqAY.js";import"./useLocalStorage-osYXE-mL.js";import"./index-CknB_y2G.js";import"./shorten-label-C3V2RyR1.js";import"./ViewList-Dq8vu1UD.js";import"./resource-dialog-B3xpsyIT.js";import"./index-BBjq0j2v.js";import"./use-mobile-5Zh9Oud5.js";import"./ListItemButton-LswuUKPc.js";import"./index-Ba15C891.js";import"./emotion-react.browser.esm-CorLywyT.js";import"./index-CpywGtnH.js";import"./Switch-SGjalYgz.js";import"./url-evaluation-D9TCPMS4.js";import"./index-B7K9oQOc.js";import"./OpenInNew-CysIURb4.js";import"./index-BJHGOv7L.js";import"./HelpOutline-Dnfzivtx.js";import"./index-Dhx2XMvi.js";import"./ButtonGroup-pRTDFJWg.js";import"./getValidReactChildren-DuVu0i0i.js";import"./AdapterDayjs-cAovH2Wn.js";import"./useThemeProps-C_6zzxTC.js";import"./CSSTransition-DwzJ0puV.js";import"./refType-RuhvdYnQ.js";import"./index-DfVhmhNU.js";import"./Verified-CLwd2p1i.js";import"./DeleteOutline-C6-UDibg.js";import"./ErrorOutline-zNHQAP0N.js";import"./sdk-CJFYaDBM.js";import"./LockIcon-DvcB90iN.js";import"./cloneDeep-BmfjF8bM.js";import"./chain-B90dDCGq.js";import"./list-header-B8ysM0r4.js";import"./ToggleButtonGroup-BUQPuDr0.js";import"./TableRow-D2EIvRB_.js";import"./ViewColumn-CxnzgopE.js";import"./MoreVert-Ca16Cnof.js";import"./MoreHoriz-CQaja3QI.js";import"./useAsync-DPy_pDJm.js";function ee({value:t}){const{t:s,locale:c}=D(),r=new Date;return new Date(t)<r?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:t,locale:c}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{value:t,locale:c,type:"all"})}ee.propTypes={value:u.string.isRequired};function te({value:t,onChange:s,...c}){const{t:r}=D(),l=C.useMemo(()=>[{value:"signature",title:r("setting.accessKey.signature"),description:r("setting.accessKey.signatureDesc")},{value:"simple",title:r("setting.accessKey.simple"),description:r("setting.accessKey.simpleDesc")}],[r]);return e.jsxs(G,{style:{width:"100%"},variant:"outlined",...c,children:[e.jsx(Q,{children:r("setting.accessKey.authType")}),e.jsx(Y,{value:t,onChange:s,fullWidth:!0,label:r("setting.accessKey.authType"),children:l.map(o=>e.jsx(Z,{value:o.value,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title}),e.jsx(p,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:o.description})]})},o.value))})]})}te.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const W=()=>{const t=z.RBAC_CONFIG.roles.filter(l=>l.passport),{inService:s}=_(),{roles:c}=L(),r=[...t,...s?c:[]];return Ke(r,"name").filter(l=>l.name!==z.ROLES.OWNER)};function se(t){const{remark:s,onCreate:c}=t,{api:r}=_(),{teamDid:l}=L(),{t:o}=D(),[k,g]=C.useState(!1),[d,v]=C.useState(null),x=W(),b=()=>{g(!1),v(null)},y=async a=>{const{remark:j,passport:f,authType:n}=a;g(!0);const h=await r.createAccessKey({input:{teamDid:l,remark:j.trim(),passport:f,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:n}}),{data:S}=h;c(S),v(null),g(!1)},T={title:`${o("common.create")} ${o("accessKey")}`,description:(a,j,f)=>e.jsxs(J,{gap:3,children:[e.jsx(M,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:n=>{j({...a,remark:n.target.value,__disableConfirm:!a.passport||!n.target.value.trim()}),n.target.value.trim()?f(""):f(o("setting.accessKey.remarkInvalid"))}}),e.jsxs(G,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:o("setting.accessKey.passport")}),e.jsx(Y,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:n=>{const h=n.target.value;f(null),j({...a,passport:h,__disableConfirm:!a.remark||!h})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:k,children:x.map(n=>e.jsx(Z,{value:n.name,"data-cy":`create-access-key-passport-option-${n.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:n.title||n.name}),e.jsx(p,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:n.description})]})},n.name))})]}),e.jsx(te,{value:a.authType,onChange:n=>{j({...a,authType:n.target.value})}}),e.jsx(ge,{placeholder:o("setting.accessKey.expireTime"),value:a.expireAt,onChange:n=>{j({...a,expireAt:n,__disableConfirm:!a.passport||!a.remark||!n})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:y,onCancel:b};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(T),className:"rule-action",children:[k?e.jsx(Ae,{size:16}):e.jsx(et,{style:{fontSize:16}}),o("common.create")]}),d&&e.jsx(ue,{title:d.title,description:d.description,confirm:d.confirm,color:d.color,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}se.propTypes={remark:u.string,onCreate:u.func};se.defaultProps={onCreate:()=>{},remark:""};function oe(t){const{onConfirm:s,accessKeyId:c,accessKeySecret:r,hideSecret:l}=t,{t:o}=C.useContext(we),[k,g]=C.useState(!1),[d,v]=C.useState(()=>l),x=()=>{v(!d)},b=a=>{g(a.target.checked)},y=C.useMemo(()=>{var a,j,f,n;return l?`const Client = require('@abtnode/client');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -1 +1 @@
1
- import{cq as x,r as o,e as g,cr as r,z as u,j as s,K as m,cs as d}from"./index-DTb1YjkO.js";function P(){const a=x(),{blocklets:c,refresh:l}=a,{t:y}=o.useContext(g),p=r.generateKey(),[i]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(p)??{},t=i.get("entityId"),e=i.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:y("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:a,filterType:"entity",type:"server"})]})}export{P as default};
1
+ import{cq as x,r as o,e as g,cr as r,z as u,j as s,K as m,cs as d}from"./index-BXOD69ua.js";function P(){const a=x(),{blocklets:c,refresh:l}=a,{t:y}=o.useContext(g),p=r.generateKey(),[i]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(p)??{},t=i.get("entityId"),e=i.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:y("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:a,filterType:"entity",type:"server"})]})}export{P as default};