@abtnode/webapp 1.16.52-beta-20251005-235515-42ad5caf → 1.16.52-beta-20251008-091027-c46c73e3
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.
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-Otyd8IOi.js → AdapterDayjs-C6gINgqH.js} +1 -1
- package/dist/assets/{Add-ChrsOU6u.js → Add-dPbKHeLn.js} +1 -1
- package/dist/assets/ArrowDropDown-Be3bZcyt.js +1 -0
- package/dist/assets/{Autocomplete-DdDvM4B8.js → Autocomplete-U07pOLU8.js} +1 -1
- package/dist/assets/{Breadcrumbs-Dx-CLWH9.js → Breadcrumbs-DpW8DIng.js} +1 -1
- package/dist/assets/{ButtonGroup-Dlxq-wXn.js → ButtonGroup--ZOyqj83.js} +1 -1
- package/dist/assets/{CSSTransition-C6MTt_ET.js → CSSTransition-qstc76e3.js} +1 -1
- package/dist/assets/{CallMerge-Dj7njlUs.js → CallMerge-CFrSRyjF.js} +1 -1
- package/dist/assets/{CardContent-CiGWOPho.js → CardContent-CoWF8-L9.js} +1 -1
- package/dist/assets/{ChevronLeft-CJSOX7uQ.js → ChevronLeft-Cdych_Uu.js} +1 -1
- package/dist/assets/{ChevronRight-BCm1j5pb.js → ChevronRight-D2VMJ7Oh.js} +1 -1
- package/dist/assets/{Clear-D6iBrCkP.js → Clear-6C8EREjC.js} +1 -1
- package/dist/assets/{DeleteOutline-DHZhYprK.js → DeleteOutline-D5U5et_K.js} +1 -1
- package/dist/assets/{Done-CcxbD1HB.js → Done-Bf3y0dWi.js} +1 -1
- package/dist/assets/{Edit-DnKlRPjx.js → Edit-CtVdWxmR.js} +1 -1
- package/dist/assets/{ErrorOutline-BXG9b8t3.js → ErrorOutline-56RsJjhK.js} +1 -1
- package/dist/assets/{FilterList-ALm4TjTP.js → FilterList-CapyvwIh.js} +1 -1
- package/dist/assets/{Google-CLUV5yjf.js → Google-CnvD0hyN.js} +1 -1
- package/dist/assets/{HelpOutline-BU0miUjP.js → HelpOutline-Dof0tJu9.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-D_jL4D71.js → KeyboardArrowDown--FBcyhvg.js} +1 -1
- package/dist/assets/{Launch-CwGVDfb6.js → Launch-DIsFV2wm.js} +1 -1
- package/dist/assets/{Link-BNmIO1Bz.js → Link-B6nIPz1r.js} +1 -1
- package/dist/assets/{ListItemButton-OKkCbukQ.js → ListItemButton-MaOJ_0E5.js} +1 -1
- package/dist/assets/{ListSubheader-BjDpw021.js → ListSubheader-DhzPnGE0.js} +1 -1
- package/dist/assets/{LoadingButton-CmgVYBh6.js → LoadingButton-B6rZXwZj.js} +1 -1
- package/dist/assets/{MoreVert-CDrTDdEe.js → MoreVert-Dp4Hmfk8.js} +1 -1
- package/dist/assets/{OpenInNew-LLEJtNQD.js → OpenInNew-DPKZemEz.js} +1 -1
- package/dist/assets/{Refresh-Bu7K3RF4.js → Refresh-Dz_x7lFk.js} +1 -1
- package/dist/assets/{Search-C1NEa9GF.js → Search-rc8KJc7S.js} +1 -1
- package/dist/assets/{Stepper-BbfJhz9G.js → Stepper-Dstk0fsZ.js} +1 -1
- package/dist/assets/{Switch-8xVr9Avh.js → Switch-D0jtrO2J.js} +1 -1
- package/dist/assets/{TableSearch-HOkkYTtr.js → TableSearch-D3FyshOB.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CjJccaVc.js → ToggleButtonGroup-DxB7dso6.js} +1 -1
- package/dist/assets/{UnfoldMore-DYA_9pMa.js → UnfoldMore-DzGv2oId.js} +1 -1
- package/dist/assets/{Verified-dUFIcfu-.js → Verified-CP9kl3XJ.js} +1 -1
- package/dist/assets/{VerifiedUser-CdpBHaRs.js → VerifiedUser-CYoBKyEY.js} +1 -1
- package/dist/assets/{ViewList-CZVHzG2K.js → ViewList-DEZdep6Q.js} +1 -1
- package/dist/assets/{_createAggregator-BMhRrt5i.js → _createAggregator-4UiLeWD5.js} +1 -1
- package/dist/assets/{actions-AYbtGQEE.js → actions-Bm8JwbGy.js} +1 -1
- package/dist/assets/{actions-CSUSlvTH.js → actions-CClKewLL.js} +1 -1
- package/dist/assets/{agreement-U4E60hoR.js → agreement-C9446KRT.js} +1 -1
- package/dist/assets/api-h1s-FxYS.js +1 -0
- package/dist/assets/{appearance-yqMH9mpR.js → appearance-BH3Potcd.js} +1 -1
- package/dist/assets/{audit-logs-B3oK8hdp.js → audit-logs-C9lf0SV6.js} +1 -1
- package/dist/assets/{base-chart-AlImey9n.js → base-chart-CxVbbaim.js} +1 -1
- package/dist/assets/{blocklet-C4IyWuyY.js → blocklet-BDf2tNX8.js} +1 -1
- package/dist/assets/{chain-BR6Rf3Te.js → chain-5lYgUMq7.js} +1 -1
- package/dist/assets/{click-to-copy-C2VyAw1s.js → click-to-copy-CuVGIUxW.js} +1 -1
- package/dist/assets/client-D4Eg5Olg.js +1 -0
- package/dist/assets/cloneDeep-XzOCeokD.js +1 -0
- package/dist/assets/{collapse-DZsx8e3r.js → collapse-CVlWV7o9.js} +1 -1
- package/dist/assets/{config-navigation-Dp3HeFB3.js → config-navigation-CAdsnWSp.js} +3 -3
- package/dist/assets/{connect-to-DDFUcRvj.js → connect-to-DxC6-xvQ.js} +1 -1
- package/dist/assets/{cssMode-BakaRb4-.js → cssMode-CPnj1raa.js} +1 -1
- package/dist/assets/{delete-confirm-CsyLOGNK.js → delete-confirm-Bad8pfMD.js} +1 -1
- package/dist/assets/{depsEqual-DPyx_qIX.js → depsEqual-u2mj6nRP.js} +1 -1
- package/dist/assets/{detail-idOBD4GO.js → detail-CcKyNBmJ.js} +3 -3
- package/dist/assets/{domains-BRl2-nnl.js → domains-B2WtYch6.js} +1 -1
- package/dist/assets/{download-Dgx_RFgz.js → download-CC9g1wMs.js} +1 -1
- package/dist/assets/{edit.svg-C06vMvPI.js → edit.svg-De24SQAd.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-DL7KbD97.js +1 -0
- package/dist/assets/engine-BmaZEssM.js +1 -0
- package/dist/assets/{freemarker2-CnNPpnaO.js → freemarker2-BHTrupD-.js} +1 -1
- package/dist/assets/{get-safe-url-Do-K1MNH.js → get-safe-url-DMCqMU3P.js} +1 -1
- package/dist/assets/getValidReactChildren-2UHUupfL.js +1 -0
- package/dist/assets/{graphqlMode-DmyH5n7b.js → graphqlMode-DXpNRckU.js} +2 -2
- package/dist/assets/{handlebars-Beg4xoYc.js → handlebars-CQt8VRFS.js} +1 -1
- package/dist/assets/{html-CYnVTxt_.js → html-C_GZzW4D.js} +1 -1
- package/dist/assets/{html-title-BQgJB2T_.js → html-title-gfA14Hza.js} +1 -1
- package/dist/assets/{htmlMode-E3OIuQCb.js → htmlMode-DApZBoa9.js} +1 -1
- package/dist/assets/{iframe-DpO6epAi.js → iframe-B-K74Ima.js} +1 -1
- package/dist/assets/{index-DAShQJEH.js → index-1bwaDeGV.js} +1 -1
- package/dist/assets/{index-BjIWwg3f.js → index-7WboZcsK.js} +1 -1
- package/dist/assets/{index-DekFzpUf.js → index-80BW_YIW.js} +1 -1
- package/dist/assets/index-BAi4MM-w.js +1 -0
- package/dist/assets/{index-BjDGJoxz.js → index-BArnNSoo.js} +1 -1
- package/dist/assets/{index-JAsfvX3z.js → index-BQAIHivQ.js} +9 -9
- package/dist/assets/{index-CxQ528RJ.js → index-BRiVLQV1.js} +1 -1
- package/dist/assets/{index-Dw6wM5I2.js → index-BZwkWbN5.js} +1 -1
- package/dist/assets/{index-DzoVbbID.js → index-BjAMc2rv.js} +1 -1
- package/dist/assets/{index-Cgkl4YPL.js → index-Bojjbp_g.js} +1 -1
- package/dist/assets/{index-DAM8GzqU.js → index-BokDZjam.js} +1 -1
- package/dist/assets/{index-CsrOzOlZ.js → index-BpV0O92V.js} +1 -1
- package/dist/assets/{index-C4Tr3HdH.js → index-BtuLKsrG.js} +1 -1
- package/dist/assets/{index-DD2nwEU1.js → index-BvrbqCDY.js} +1 -1
- package/dist/assets/{index-Cza5Tfq5.js → index-C-bFrTB1.js} +3 -3
- package/dist/assets/{index-WxvIhry5.js → index-C2U7TxjB.js} +1 -1
- package/dist/assets/{index-BeqBABF-.js → index-C52WUH1c.js} +1 -1
- package/dist/assets/{index-k6l-_Zyv.js → index-C64L0Fz8.js} +1 -1
- package/dist/assets/{index-0wrB9Q2b.js → index-C8ehsWRK.js} +1 -1
- package/dist/assets/{index-DGWpyM8k.js → index-CNYAt2ni.js} +1 -1
- package/dist/assets/{index-B7t83VRT.js → index-CR2hQAy-.js} +1 -1
- package/dist/assets/{index-D20JQrCq.js → index-CYdZhzhM.js} +1 -1
- package/dist/assets/{index-DjIrsvAm.js → index-CjTVFQxm.js} +1 -1
- package/dist/assets/{index-1rnZZhEj.js → index-Cn13WTJp.js} +1 -1
- package/dist/assets/{index-R9HDiDC7.js → index-Cott-0b4.js} +1 -1
- package/dist/assets/{index-COIBeVFh.js → index-CrhEC2zG.js} +2 -2
- package/dist/assets/{index-CyDkgbqg.js → index-D0xRFYOO.js} +1 -1
- package/dist/assets/{index-DJLMZY0t.js → index-D3ugfj0T.js} +1 -1
- package/dist/assets/{index-CF3ZoBs8.js → index-DJkzeG-H.js} +1 -1
- package/dist/assets/{index-BiM20Cj_.js → index-DPHyV70d.js} +1 -1
- package/dist/assets/{index-DCjN58Xe.js → index-DPcXmhuE.js} +1 -1
- package/dist/assets/{index-Dj4kn6Y9.js → index-DV9sM2J1.js} +1 -1
- package/dist/assets/{index-hEOqd_g2.js → index-DeRZKAnI.js} +1 -1
- package/dist/assets/{index-BfIj58jN.js → index-Dh0ishov.js} +1 -1
- package/dist/assets/{index-C4cl789l.js → index-DqsefFvU.js} +2 -2
- package/dist/assets/{index-BJXA-IiQ.js → index-DrPP_v6g.js} +1 -1
- package/dist/assets/{index-DCPdQJ3N.js → index-GDBbj-TO.js} +3 -3
- package/dist/assets/{index-B4UfNMI3.js → index-IVy-qVYo.js} +4 -4
- package/dist/assets/{index-DAcxMuv2.js → index-OmIEfKoB.js} +1 -1
- package/dist/assets/{index-DYlec05H.js → index-Pqd1Wao1.js} +1 -1
- package/dist/assets/{index-Dd2Wc9vf.js → index-dcUIWboi.js} +1 -1
- package/dist/assets/{index-Du9aaMIs.js → index-j09YnKHJ.js} +1 -1
- package/dist/assets/{index-D-_yZL1v.js → index-jHTuYXfT.js} +3 -3
- package/dist/assets/{index-D9a_iF9A.js → index-uARym9IO.js} +3 -3
- package/dist/assets/{index-COEepcBR.js → index-wluvXkaX.js} +1 -1
- package/dist/assets/{index-CGJPpGas.js → index-zolGCC67.js} +1 -1
- package/dist/assets/{index.esm-BH97_0jB.js → index.esm-BEClAuR8.js} +1 -1
- package/dist/assets/{install-from-url-Ihqq4kP6.js → install-from-url-RS7y8z20.js} +1 -1
- package/dist/assets/{invitation-DfIsP7D9.js → invitation-cjbLR9ie.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-C7NJ4TfM.js → is-path-prefix-equal-CPEdKnJC.js} +1 -1
- package/dist/assets/{item-Cst3LmkU.js → item-Dzy-IslJ.js} +1 -1
- package/dist/assets/{javascript-31wUozMV.js → javascript-CLYRsLVw.js} +1 -1
- package/dist/assets/{jsonMode-6lRERunW.js → jsonMode-C5qvv837.js} +1 -1
- package/dist/assets/{liquid-BrFHQAY8.js → liquid-DLxjxm68.js} +1 -1
- package/dist/assets/{list-header-CvXNXK3D.js → list-header-De6Yh-fe.js} +1 -1
- package/dist/assets/{lock.svg-lsaB9zVc.js → lock.svg-DtrhngcX.js} +1 -1
- package/dist/assets/{log-CiozMak4.js → log-DuF763Qc.js} +1 -1
- package/dist/assets/{lottie-react.esm-Cv-KS9n9.js → lottie-react.esm-Cvo6gckl.js} +1 -1
- package/dist/assets/{mdx-DfXKXNCL.js → mdx-BjOVsdOX.js} +1 -1
- package/dist/assets/{memory-DuBq_PJ3.js → memory-DCHSrmhD.js} +1 -1
- package/dist/assets/{metric-B2bEW37O.js → metric-BIq3jWwM.js} +1 -1
- package/dist/assets/omit-DB5o9YQx.js +1 -0
- package/dist/assets/{overview-DM2hHDzF.js → overview-DuXTvOah.js} +1 -1
- package/dist/assets/{permission-vtgWXUuX.js → permission-Chm5gyJQ.js} +1 -1
- package/dist/assets/{preference-BJrhTLFU.js → preference-BAgQX2-Q.js} +3 -3
- package/dist/assets/{python-BJxf4VRF.js → python-C-Xy0Hjt.js} +1 -1
- package/dist/assets/{raf-schd.esm-B7be68AV.js → raf-schd.esm-BBnnfOh-.js} +1 -1
- package/dist/assets/{razor-BItvb-1p.js → razor-CJsKCG54.js} +1 -1
- package/dist/assets/{rotate-session-key-D2RTFRge.js → rotate-session-key-DAi3mh_7.js} +1 -1
- package/dist/assets/{runtime-B7-mOVum.js → runtime-o3xCE5jz.js} +1 -1
- package/dist/assets/schema-COYqW_57.js +1 -0
- package/dist/assets/sdk-B9_dCjSX.js +1 -0
- package/dist/assets/{service-Dg8U0bVC.js → service-BeQqm7um.js} +1 -1
- package/dist/assets/{shorten-label-Ck4DZuiu.js → shorten-label-BMRVrMa9.js} +1 -1
- package/dist/assets/{simple-select-CcuMBAZC.js → simple-select-Caf2x-kQ.js} +1 -1
- package/dist/assets/{spaces-BNQPJDLC.js → spaces-DIO29tm7.js} +1 -1
- package/dist/assets/{status-BYrioy_H.js → status-CnKP__3u.js} +1 -1
- package/dist/assets/{status-C5XxGHwu.js → status-pqf2Jayn.js} +1 -1
- package/dist/assets/{switch-control-DjjCTBmi.js → switch-control-6tXBi6dn.js} +1 -1
- package/dist/assets/{table-icons-CCxBZHix.js → table-icons-D3qvQed-.js} +1 -1
- package/dist/assets/{team-D_QNBtKM.js → team-KKFpU-b6.js} +1 -1
- package/dist/assets/{toLower-B44kYh9o.js → toLower-5VCjvMXR.js} +1 -1
- package/dist/assets/toUpper-CqJ4HRtA.js +1 -0
- package/dist/assets/{traffic-CzQNVScZ.js → traffic-B6qkQgt8.js} +1 -1
- package/dist/assets/{tsMode-DgORfED1.js → tsMode-Bp5aN5ju.js} +1 -1
- package/dist/assets/{typescript-D8tjLcFr.js → typescript-DNEFn5T-.js} +1 -1
- package/dist/assets/{url-evaluation-CiCB8KZx.js → url-evaluation-Bf6yDtPl.js} +1 -1
- package/dist/assets/{url-join-4O19su_x.js → url-join-BUmg-lRZ.js} +1 -1
- package/dist/assets/{use-mobile-CPSPjkpr.js → use-mobile-Cm3HHVYb.js} +1 -1
- package/dist/assets/{use-mobile-r1kQ_dil.js → use-mobile-D_5S7Emn.js} +1 -1
- package/dist/assets/{useAsync-Dl8sYYDB.js → useAsync-CJ45QdHi.js} +1 -1
- package/dist/assets/{useAsyncRetry-DRdEiQD3.js → useAsyncRetry-BDxKodHB.js} +1 -1
- package/dist/assets/{useLocalStorage-B9WGjsKq.js → useLocalStorage-BJF9LnW1.js} +1 -1
- package/dist/assets/{useThemeProps-DERND8h3.js → useThemeProps-Z9rGY1Iy.js} +1 -1
- package/dist/assets/{util-CwyIEESt.js → util-jinP_8xF.js} +1 -1
- package/dist/assets/{wait-container-BwEBFNWC.js → wait-container-RejefkW9.js} +1 -1
- package/dist/assets/{without-wallet-D8LEwbCc.js → without-wallet-DLRe3zja.js} +1 -1
- package/dist/assets/{wrap-locale-CEPetGvN.js → wrap-locale-00O94sMB.js} +1 -1
- package/dist/assets/{xml-BQKghsq8.js → xml-BwrOgitz.js} +1 -1
- package/dist/assets/{yaml-TM0os0iI.js → yaml-BtfzMc0O.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-ACZNRzrW.js +0 -1
- package/dist/assets/api-DQFDTmvh.js +0 -1
- package/dist/assets/client-D58cFrj8.js +0 -1
- package/dist/assets/cloneDeep-BTOIvJBY.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-C6SKk-sp.js +0 -1
- package/dist/assets/engine-DvXh3IId.js +0 -1
- package/dist/assets/getValidReactChildren-XAWxf6iA.js +0 -1
- package/dist/assets/index-DzXxhiEZ.js +0 -1
- package/dist/assets/omit-DciWr_ec.js +0 -1
- package/dist/assets/schema-C9KAK-4l.js +0 -1
- package/dist/assets/sdk-CMoevznB.js +0 -1
- package/dist/assets/toUpper-vrgvqUl3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bn as gt,r as g,bz as X,bf as H,H as U,aH as D,p as xt,o as d,h as te,at as bt,ay as jt,M as y,T as $,n as Q,eO as Fe,P as Pe,il as Ye,bj as Te,aU as Ie,U as Ee,dI as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,f0 as Je,aP as De,W as yt,as as Ze,im as et,w as Oe,f2 as tt,fo as ye,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,io as Ct,ip as Nt,$ as nt,iq as wt,ir as Rt,is as Tt,it as It,O as Et,bu as it,K as At,Q as Dt,S as Ot,R as $e,iu as Lt,a3 as kt}from"./index-B4UfNMI3.js";import{d as Ft,H as at,g as Pt}from"./index-DAM8GzqU.js";import{R as _e,S as _t}from"./actions-AYbtGQEE.js";import{B as Bt}from"./index-BjDGJoxz.js";import{S as me}from"./shorten-label-Ck4DZuiu.js";import{v as ot}from"./index-DYlec05H.js";import{T as zt}from"./html-title-BQgJB2T_.js";import{R as Wt}from"./Refresh-Bu7K3RF4.js";import{D as Mt,g as Kt}from"./traffic-CzQNVScZ.js";import{u as Ht}from"./use-mobile-r1kQ_dil.js";import"./FilterList-ALm4TjTP.js";import"./CSSTransition-C6MTt_ET.js";import"./emotion-cache.browser.esm-C6SKk-sp.js";import"./index-BfIj58jN.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DPyx_qIX.js";import"./index-CGJPpGas.js";import"./TableSearch-HOkkYTtr.js";import"./Search-C1NEa9GF.js";import"./Clear-D6iBrCkP.js";import"./MoreVert-CDrTDdEe.js";import"./useLocalStorage-B9WGjsKq.js";import"./url-evaluation-CiCB8KZx.js";import"./get-safe-url-Do-K1MNH.js";import"./ButtonGroup-Dlxq-wXn.js";import"./getValidReactChildren-XAWxf6iA.js";import"./permission-vtgWXUuX.js";import"./index.esm-BH97_0jB.js";import"./collapse-DZsx8e3r.js";import"./blocklet-C4IyWuyY.js";import"./Switch-8xVr9Avh.js";import"./iframe-DpO6epAi.js";import"./ChevronLeft-CJSOX7uQ.js";import"./ChevronRight-BCm1j5pb.js";import"./index-DBii9-f-.js";import"./base-chart-AlImey9n.js";import"./index-DAcxMuv2.js";import"./AdapterDayjs-Otyd8IOi.js";import"./useThemeProps-DERND8h3.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],je=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],K=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(K,h.emailSendStatus)||S(M=>({...M,emailSendStatus:K,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const K=i.currentTarget,M=K.getBoundingClientRect();P.anchorEl=K,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const K=await oe(c,o.receiver);await be(1),q({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(K){U.error(K.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
1
|
+
import{aF as Ge,j as e,bn as gt,r as g,bz as X,bf as H,H as U,aH as D,p as xt,o as d,h as te,at as bt,ay as jt,M as y,T as $,n as Q,eO as Fe,P as Pe,il as Ye,bj as Te,aU as Ie,U as Ee,dI as we,b3 as qe,b1 as Ae,C as Xe,f as Qe,f0 as Je,aP as De,W as yt,as as Ze,im as et,w as Oe,f2 as tt,fo as ye,fI as st,dC as St,s as ie,af as pe,G as Ue,au as vt,io as Ct,ip as Nt,$ as nt,iq as wt,ir as Rt,is as Tt,it as It,O as Et,bu as it,K as At,Q as Dt,S as Ot,R as $e,iu as Lt,a3 as kt}from"./index-IVy-qVYo.js";import{d as Ft,H as at,g as Pt}from"./index-BokDZjam.js";import{R as _e,S as _t}from"./actions-Bm8JwbGy.js";import{B as Bt}from"./index-BArnNSoo.js";import{S as me}from"./shorten-label-BMRVrMa9.js";import{v as ot}from"./index-Pqd1Wao1.js";import{T as zt}from"./html-title-gfA14Hza.js";import{R as Wt}from"./Refresh-Dz_x7lFk.js";import{D as Mt,g as Kt}from"./traffic-B6qkQgt8.js";import{u as Ht}from"./use-mobile-D_5S7Emn.js";import"./FilterList-CapyvwIh.js";import"./CSSTransition-qstc76e3.js";import"./emotion-cache.browser.esm-DL7KbD97.js";import"./index-Dh0ishov.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-u2mj6nRP.js";import"./index-zolGCC67.js";import"./TableSearch-D3FyshOB.js";import"./Search-rc8KJc7S.js";import"./Clear-6C8EREjC.js";import"./MoreVert-Dp4Hmfk8.js";import"./useLocalStorage-BJF9LnW1.js";import"./url-evaluation-Bf6yDtPl.js";import"./get-safe-url-DMCqMU3P.js";import"./ButtonGroup--ZOyqj83.js";import"./getValidReactChildren-2UHUupfL.js";import"./permission-Chm5gyJQ.js";import"./index.esm-BEClAuR8.js";import"./collapse-CVlWV7o9.js";import"./blocklet-BDf2tNX8.js";import"./Switch-D0jtrO2J.js";import"./iframe-B-K74Ima.js";import"./ChevronLeft-Cdych_Uu.js";import"./ChevronRight-D2VMJ7Oh.js";import"./index-DBii9-f-.js";import"./base-chart-CxVbbaim.js";import"./index-OmIEfKoB.js";import"./AdapterDayjs-C6gINgqH.js";import"./useThemeProps-Z9rGY1Iy.js";import"./visuallyHidden-Dan1xhjv.js";const qt=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Ut=Ge(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return U.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},q=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h},options:{enableConnectedAccount:!0}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[H(I.dateRange[0]).toISOString(),H(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw U.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:q,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],je=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=H().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){U.error("Please select a date range");return}if(H(f.startDate).isAfter(f.endDate)||!H(f.startDate).isValid()||!H(f.endDate).isValid()){U.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Kt(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,q]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){U.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],K=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(K,h.emailSendStatus)||S(M=>({...M,emailSendStatus:K,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,q(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){U.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const K=i.currentTarget,M=K.getBoundingClientRect();P.anchorEl=K,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}q({channel:c});try{const K=await oe(c,o.receiver);await be(1),q({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(K){U.error(K.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(Ke,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(Ut,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(qt,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as v,j as n,M as a,de as w,n as z,f as p,dl as F}from"./index-
|
|
1
|
+
import{aF as v,j as n,M as a,de as w,n as z,f as p,dl as F}from"./index-IVy-qVYo.js";const k=v(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.996.996 0 0 1 0-1.41L10.59 12 7.7 9.11a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41"}));function r({icon:e=null,title:t="",description:o="",extra:y=null,...b}){return n.jsxs(E,{...b,children:[e,typeof t=="string"?n.jsx(a,{sx:{mt:3,fontSize:22,fontWeight:400,color:"text.primary",textAlign:"center"},children:t}):t,typeof o=="string"?n.jsx(a,{sx:{mt:1,fontSize:14,color:"text.secondary",textAlign:"center"},children:o}):o,n.jsx(a,{sx:{mt:3},children:y})]})}const E=w("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|