@abtnode/webapp 1.17.5-beta-20251208-123021-e8c53f96 → 1.17.5-beta-20251211-104355-426d7eb6
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-D92-n47b.js → AdapterDayjs-Dcg6AE_r.js} +1 -1
- package/dist/assets/{Add-Dv85KL5N.js → Add-CwJyd37s.js} +1 -1
- package/dist/assets/ArrowDropDown-BoUU1BUL.js +1 -0
- package/dist/assets/{Autocomplete-DVV2RD2A.js → Autocomplete-C6KZatsu.js} +1 -1
- package/dist/assets/{Breadcrumbs-C7NX6NEA.js → Breadcrumbs-Bj53u8dH.js} +1 -1
- package/dist/assets/{ButtonGroup-C6xSllEr.js → ButtonGroup-uhq9NqjP.js} +1 -1
- package/dist/assets/{CSSTransition-BnYuNWzI.js → CSSTransition-5vBScTx4.js} +1 -1
- package/dist/assets/{CallMerge-DYEM4wZM.js → CallMerge-Div7wiLM.js} +1 -1
- package/dist/assets/{CardContent-cV0ZtLFb.js → CardContent-BpUbXRgZ.js} +1 -1
- package/dist/assets/{ChevronLeft-DaNTS9Ry.js → ChevronLeft-CsonlqWZ.js} +1 -1
- package/dist/assets/{ChevronRight-DMRng8w4.js → ChevronRight-slnHJMMM.js} +1 -1
- package/dist/assets/{Clear-DYWNGGPP.js → Clear-By_ldZfu.js} +1 -1
- package/dist/assets/{DeleteOutline-C9hdvFLW.js → DeleteOutline-C9MsS08w.js} +1 -1
- package/dist/assets/{Done-CEq9fQ91.js → Done-D3SMiC_1.js} +1 -1
- package/dist/assets/{Edit-T_ynXw3J.js → Edit-C2kFF9YJ.js} +1 -1
- package/dist/assets/{ErrorOutline-CQZdYJL-.js → ErrorOutline-5-zcM4Ne.js} +1 -1
- package/dist/assets/{FilterList-C0g86vDh.js → FilterList-CjwH8Y-X.js} +1 -1
- package/dist/assets/{Google-sh3pICro.js → Google-DafSaE2h.js} +1 -1
- package/dist/assets/{HelpOutline-CDfUVKlB.js → HelpOutline-BJpW-l3r.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-BCCwKNMP.js → KeyboardArrowDown-TYg9Qprk.js} +1 -1
- package/dist/assets/{Launch-Cy-Ri5E0.js → Launch-BkIcZSam.js} +1 -1
- package/dist/assets/{Link-LRqXezP_.js → Link-FQWyZFOC.js} +1 -1
- package/dist/assets/{ListItemButton-D_BFfEfg.js → ListItemButton-DvmajTMO.js} +1 -1
- package/dist/assets/{ListSubheader-DVUYAhXC.js → ListSubheader-CSUXgXE1.js} +1 -1
- package/dist/assets/{LoadingButton--tsix-yw.js → LoadingButton-DHcTITjP.js} +1 -1
- package/dist/assets/{MoreVert-D2cSYolp.js → MoreVert-DuXHnJM1.js} +1 -1
- package/dist/assets/{OpenInNew-KWw6IL4k.js → OpenInNew-D7AFQ7qH.js} +1 -1
- package/dist/assets/{Refresh-DWTzO6Zf.js → Refresh-BLdRb4dq.js} +1 -1
- package/dist/assets/{Search-soT1P5WL.js → Search-CIrZ9Ibh.js} +1 -1
- package/dist/assets/{Stepper-CO2wnCjY.js → Stepper-NFExDVoU.js} +1 -1
- package/dist/assets/{Switch-CYCG_kxE.js → Switch-CJHN4f7v.js} +1 -1
- package/dist/assets/{TableSearch-BJJrOkE2.js → TableSearch-CXlvTHzu.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Dl-zl-V4.js → ToggleButtonGroup-TztJlMu5.js} +1 -1
- package/dist/assets/{UnfoldMore-XLA7xpTo.js → UnfoldMore-D4wb4PiB.js} +1 -1
- package/dist/assets/{Verified-Blm2AEgo.js → Verified-BIJapS2b.js} +1 -1
- package/dist/assets/{VerifiedUser-DitkeanA.js → VerifiedUser-Bo-g1veK.js} +1 -1
- package/dist/assets/{ViewList-dS2IrLuW.js → ViewList-CKT7zkn0.js} +1 -1
- package/dist/assets/{_createAggregator-CQmKIqh9.js → _createAggregator-xnpdRDuH.js} +1 -1
- package/dist/assets/{actions-C_YtyiJN.js → actions-B_In1OEq.js} +1 -1
- package/dist/assets/actions-DBjGgaan.js +11 -0
- package/dist/assets/{agreement-CB8zAClF.js → agreement-D9n4TVAm.js} +1 -1
- package/dist/assets/api-B50CzjXC.js +1 -0
- package/dist/assets/{appearance-CvBqnNxC.js → appearance-Cme4Q5BD.js} +1 -1
- package/dist/assets/{audit-logs-DG20CWcK.js → audit-logs-C6BCcfl1.js} +1 -1
- package/dist/assets/{base-chart-hRqEcUf1.js → base-chart-CUFc4seL.js} +1 -1
- package/dist/assets/{blocklet-4xcBoALi.js → blocklet-Co-qXCPC.js} +1 -1
- package/dist/assets/{chain-4NohS0Y9.js → chain-BWj1yQol.js} +1 -1
- package/dist/assets/{click-to-copy-Xg1hTHwq.js → click-to-copy-DlpsaegJ.js} +1 -1
- package/dist/assets/cloneDeep-DPJyiVhO.js +1 -0
- package/dist/assets/{collapse-CvIW0hIW.js → collapse-DOmRxR9w.js} +1 -1
- package/dist/assets/{config-navigation-BHLHrDuf.js → config-navigation-3XgnTvq_.js} +3 -3
- package/dist/assets/{connect-to-BzOsNzCo.js → connect-to-Dm8w-7IQ.js} +1 -1
- package/dist/assets/{cssMode-CtAuRBnQ.js → cssMode-BpJODsaG.js} +1 -1
- package/dist/assets/{delete-confirm-CmK028cX.js → delete-confirm-DbYfIB8I.js} +1 -1
- package/dist/assets/{depsEqual-D4SkOvpW.js → depsEqual-BHfyIN1m.js} +1 -1
- package/dist/assets/{detail-39U2ZB1M.js → detail-CDpzlMf3.js} +3 -3
- package/dist/assets/{domains-D2j6_7aU.js → domains-CnqIlWBr.js} +1 -1
- package/dist/assets/{download-fdrmqknu.js → download-BIwYEIAP.js} +1 -1
- package/dist/assets/{edit.svg-BCm3ag4u.js → edit.svg-Cy4wFBH9.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CF7qzYNW.js +1 -0
- package/dist/assets/engine-B8GFtkk-.js +1 -0
- package/dist/assets/{freemarker2-CTfgMDhs.js → freemarker2-BbsoXP_B.js} +1 -1
- package/dist/assets/{get-safe-url-nXPF2sGJ.js → get-safe-url-14Q6Gfeh.js} +1 -1
- package/dist/assets/getValidReactChildren-5khuIcs7.js +1 -0
- package/dist/assets/{graphqlMode-B6W6zwCs.js → graphqlMode-CzqA5BWs.js} +2 -2
- package/dist/assets/{handlebars-DOdON862.js → handlebars-BI7IZI6m.js} +1 -1
- package/dist/assets/{html-DEp9zO-t.js → html-C4s2FhZC.js} +1 -1
- package/dist/assets/{html-title-D-skaBwb.js → html-title-CH-hjuPz.js} +1 -1
- package/dist/assets/{htmlMode-BsvwfKqY.js → htmlMode-D65ghVka.js} +1 -1
- package/dist/assets/{iframe-DyfK1MII.js → iframe-CyW0Gy1t.js} +1 -1
- package/dist/assets/{index-DLm3d5Lz.js → index-55nfVIC0.js} +1 -1
- package/dist/assets/{index-CSmLj9hN.js → index-B0p2z33B.js} +1 -1
- package/dist/assets/{index-C3owZL72.js → index-B2m_raRS.js} +11 -11
- package/dist/assets/{index-Boc_ElPU.js → index-B2poRPnp.js} +2 -2
- package/dist/assets/{index-C9N-dK-U.js → index-B5NwSFOK.js} +1 -1
- package/dist/assets/{index-BsFiddFP.js → index-B5iZbzm_.js} +9 -9
- package/dist/assets/{index-Uf4kWlzq.js → index-BHkNOM9n.js} +1 -1
- package/dist/assets/{index-DCo3tzgk.js → index-BPIqxC-U.js} +2 -2
- package/dist/assets/{index-B9vFJyc6.js → index-BVJHTf7X.js} +1 -1
- package/dist/assets/{index-DaEjX2SO.js → index-BZORkGy0.js} +3 -3
- package/dist/assets/{index-CAfX9jEw.js → index-BZeOf_Tu.js} +1 -1
- package/dist/assets/{index-CFPB3xkO.js → index-Bbu_zE3x.js} +1 -1
- package/dist/assets/{index-ZtBV9VDq.js → index-BfVOZvkh.js} +1 -1
- package/dist/assets/{index-xhxy4seW.js → index-BiQXR3Bm.js} +1 -1
- package/dist/assets/{index-3WfGtOlv.js → index-BmA5kukS.js} +1 -1
- package/dist/assets/{index-CJ-WZj-1.js → index-BoA3EH-W.js} +1 -1
- package/dist/assets/{index-BR2CcckZ.js → index-BqPjiG1G.js} +8 -8
- package/dist/assets/{index-BoBukMl6.js → index-Bu5d1noc.js} +1 -1
- package/dist/assets/{index-BHRDAZr5.js → index-CF3eNUVb.js} +1 -1
- package/dist/assets/{index-DeOpdMmq.js → index-CMtLSLIZ.js} +1 -1
- package/dist/assets/{index-BFwfrWj_.js → index-CND60QrG.js} +1 -1
- package/dist/assets/{index-BqOHFDpP.js → index-CW-42AHU.js} +1 -1
- package/dist/assets/{index-T2sa7QI9.js → index-CbWepdE1.js} +1 -1
- package/dist/assets/{index-CVvQ2yKp.js → index-CeKndEzp.js} +1 -1
- package/dist/assets/{index-Bmeli3vt.js → index-ChAuk3cl.js} +1 -1
- package/dist/assets/{index-RqR7C4_G.js → index-CoLKcvy8.js} +1 -1
- package/dist/assets/{index-Beqyq0Xy.js → index-CoTlorpu.js} +1 -1
- package/dist/assets/{index-D0Nij003.js → index-CqjR4hs8.js} +2 -2
- package/dist/assets/{index-CO1fNIoe.js → index-CwApT1Sd.js} +3 -3
- package/dist/assets/{index-DikEqQbY.js → index-D3hM989k.js} +3 -3
- package/dist/assets/{index-BKYNnQgG.js → index-DFXhXlJk.js} +1 -1
- package/dist/assets/{index-DfJQllIT.js → index-DScXR38D.js} +1 -1
- package/dist/assets/{index-B1omHpBR.js → index-DWcU23-2.js} +1 -1
- package/dist/assets/{index-Bzt3kp1o.js → index-DYJtcdqz.js} +1 -1
- package/dist/assets/{index-BAeHHGc5.js → index-DbucqiHf.js} +1 -1
- package/dist/assets/{index-C1FfiSCs.js → index-DcCauHzD.js} +1 -1
- package/dist/assets/index-DmFddMrj.js +1 -0
- package/dist/assets/{index-D9OyVcfq.js → index-DmlhRLwb.js} +4 -4
- package/dist/assets/{index-DrkFgZdM.js → index-Dmnos1kX.js} +1 -1
- package/dist/assets/{index-Bpl7ZPdw.js → index-DqDJse_r.js} +1 -1
- package/dist/assets/{index-DIdPY5JS.js → index-DvOpuwAA.js} +1 -1
- package/dist/assets/{index-DyCZ__uc.js → index-M2fo3HYF.js} +1 -1
- package/dist/assets/{index-CB9i2iit.js → index-Qj6_gIRY.js} +1 -1
- package/dist/assets/{index-CEA-JNUf.js → index-WZgGKPGR.js} +1 -1
- package/dist/assets/{index-JD_f3m8u.js → index-cF2S-dYj.js} +1 -1
- package/dist/assets/{index-AqKhw9Wu.js → index-sLr5Ytxz.js} +3 -3
- package/dist/assets/{index.esm-Di7pxRR7.js → index.esm-DQbImx_I.js} +1 -1
- package/dist/assets/{install-from-url-BYJQqH88.js → install-from-url-J2LtUMoq.js} +1 -1
- package/dist/assets/{invitation-DhpFShM_.js → invitation-Y_KT9tdR.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-jo7g0Qmd.js → is-path-prefix-equal-R8kSgKPg.js} +1 -1
- package/dist/assets/{item-D6K3xZvf.js → item-BLPIRYzp.js} +1 -1
- package/dist/assets/{javascript-DcFlp6iK.js → javascript-CVc_Qgjn.js} +1 -1
- package/dist/assets/{jsonMode-RPWtRIbN.js → jsonMode-DgyIRwXr.js} +1 -1
- package/dist/assets/{liquid-Dd2yvvP7.js → liquid-D65B7N7C.js} +1 -1
- package/dist/assets/{list-header-BEqD50lj.js → list-header-DnI-B5kv.js} +1 -1
- package/dist/assets/{lock.svg-CqbkAjfs.js → lock.svg-hi5yMnJ1.js} +1 -1
- package/dist/assets/{log-CJyQvDex.js → log-B7iwZqYi.js} +1 -1
- package/dist/assets/{lottie-react.esm-CkMUkUNW.js → lottie-react.esm-DNVXvBzr.js} +1 -1
- package/dist/assets/{mdx-BD-ePdgm.js → mdx-BxX4PI2U.js} +1 -1
- package/dist/assets/{memory-C2g1lVx4.js → memory-vDDFn9lp.js} +1 -1
- package/dist/assets/{metric-Ce6h_fps.js → metric-DQy5zRdQ.js} +1 -1
- package/dist/assets/omit-CyaEv8Dl.js +1 -0
- package/dist/assets/{overview-DIJq7smI.js → overview-p214oVcV.js} +1 -1
- package/dist/assets/{permission-DHDlX-2p.js → permission-DHM_Uhje.js} +1 -1
- package/dist/assets/{preference-BFNujwfR.js → preference-CnzOTj3F.js} +3 -3
- package/dist/assets/{python-CSfuDNWh.js → python-CxsGjqcE.js} +1 -1
- package/dist/assets/{raf-schd.esm-C7cnOwIv.js → raf-schd.esm-5K54oGhm.js} +1 -1
- package/dist/assets/{razor-PrxsK0Yf.js → razor-DyGdbkd6.js} +1 -1
- package/dist/assets/{rotate-session-key-DlCO0JRQ.js → rotate-session-key-D0cclybl.js} +1 -1
- package/dist/assets/{runtime-DGTHh6A9.js → runtime-CA_vnels.js} +1 -1
- package/dist/assets/schema-B-ts56Ax.js +1 -0
- package/dist/assets/sdk-Gp4bri9Y.js +1 -0
- package/dist/assets/{service-Bh0rr8zW.js → service-DA_A2jR4.js} +1 -1
- package/dist/assets/{shorten-label-BS4FNgmI.js → shorten-label-DhnoyJGB.js} +1 -1
- package/dist/assets/{simple-select-Dkbl-a1m.js → simple-select-ooXqK-jE.js} +1 -1
- package/dist/assets/{spaces-BTKqW9YY.js → spaces-pOZOSMK4.js} +1 -1
- package/dist/assets/{status-DTDPbaoZ.js → status-BzJsqaQ5.js} +1 -1
- package/dist/assets/{status-Dgr7tZJl.js → status-CUv1Zltf.js} +1 -1
- package/dist/assets/{switch-control-bRPrVj4O.js → switch-control-CGJvFC5A.js} +1 -1
- package/dist/assets/{table-icons-DaKDKKxZ.js → table-icons-CwKGpe-L.js} +1 -1
- package/dist/assets/{team-DdhNY9E2.js → team-Dmx94iJo.js} +1 -1
- package/dist/assets/{toLower-DC-Tk5Hb.js → toLower-CFmpAjUt.js} +1 -1
- package/dist/assets/toUpper-BejUmrup.js +1 -0
- package/dist/assets/{traffic-9tAQAbVA.js → traffic-C0kPrhjJ.js} +1 -1
- package/dist/assets/{tsMode-B19hnwr8.js → tsMode-jZmbwl1N.js} +1 -1
- package/dist/assets/{typescript-C9cjacUF.js → typescript-dLvCYGkn.js} +1 -1
- package/dist/assets/{url-evaluation-Dm_mNoMs.js → url-evaluation-CwmddBcY.js} +1 -1
- package/dist/assets/{url-join-BgacTiZS.js → url-join-Dsyhdnws.js} +1 -1
- package/dist/assets/{use-mobile-CWB6Jtv1.js → use-mobile-1I4QCh-N.js} +1 -1
- package/dist/assets/{use-mobile-D6E5km4P.js → use-mobile-DqN9gudu.js} +1 -1
- package/dist/assets/{useAsync-CyivJzD4.js → useAsync-CQunl03f.js} +1 -1
- package/dist/assets/{useAsyncRetry-BDLoOcvn.js → useAsyncRetry-CjGr0FZe.js} +1 -1
- package/dist/assets/{useLocalStorage-Df3_jlsm.js → useLocalStorage-B6bhow_S.js} +1 -1
- package/dist/assets/{useThemeProps-R3T9xrvH.js → useThemeProps-DRCiWG5p.js} +1 -1
- package/dist/assets/{util-BDvErAjW.js → util-CJB4l2qD.js} +1 -1
- package/dist/assets/{wait-container-B1wIefva.js → wait-container-Do1jfS7d.js} +1 -1
- package/dist/assets/{without-wallet-DQfnDo2u.js → without-wallet-BR6Y7zpF.js} +1 -1
- package/dist/assets/wrap-locale-CJqYMDgp.js +1 -0
- package/dist/assets/{xml-a8bUYHho.js → xml-CgXlUmBT.js} +1 -1
- package/dist/assets/{yaml-Cp0Ib5KC.js → yaml-Bb8HrmNf.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +2 -2
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-CPeg07nO.js +0 -1
- package/dist/assets/actions-CqTr_UpD.js +0 -11
- package/dist/assets/api-gDzILycU.js +0 -1
- package/dist/assets/cloneDeep-o7Kp18y-.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-B1_0wYNC.js +0 -1
- package/dist/assets/engine-D2zNg6-2.js +0 -1
- package/dist/assets/getValidReactChildren-CIqQKAkN.js +0 -1
- package/dist/assets/index-CpC6KyFR.js +0 -1
- package/dist/assets/omit-dFmEevUc.js +0 -1
- package/dist/assets/schema-CEPuPgwv.js +0 -1
- package/dist/assets/sdk-D8tCPukn.js +0 -1
- package/dist/assets/toUpper-DglD32bj.js +0 -1
- package/dist/assets/wrap-locale-l_P1jXYo.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as Ge,j as e,bo as gt,r as g,bE as J,bg as H,H as q,aH as D,g as xt,o as d,h as ee,au as bt,O as jt,K as C,T as U,V as Q,eO as Fe,P as Pe,ik as Ye,bk as Te,aV as Ie,U as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,at as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,ag as pe,G as Ue,av as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,Q as Ot,S as Lt,R as $e,it as kt,a4 as Ft}from"./index-DaEjX2SO.js";import{d as Pt,H as at,g as _t}from"./index-Uf4kWlzq.js";import{R as _e,S as Bt}from"./actions-CqTr_UpD.js";import{B as zt}from"./index-CJ-WZj-1.js";import{S as me}from"./shorten-label-BS4FNgmI.js";import{v as ot}from"./index-BqOHFDpP.js";import{T as Wt}from"./html-title-D-skaBwb.js";import{R as Mt}from"./Refresh-DWTzO6Zf.js";import{D as Kt,g as Ht}from"./traffic-9tAQAbVA.js";import{u as qt}from"./use-mobile-CWB6Jtv1.js";import"./FilterList-C0g86vDh.js";import"./CSSTransition-BnYuNWzI.js";import"./emotion-cache.browser.esm-B1_0wYNC.js";import"./index-DIdPY5JS.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D4SkOvpW.js";import"./index-CB9i2iit.js";import"./TableSearch-BJJrOkE2.js";import"./Search-soT1P5WL.js";import"./Clear-DYWNGGPP.js";import"./MoreVert-D2cSYolp.js";import"./useLocalStorage-Df3_jlsm.js";import"./url-evaluation-Dm_mNoMs.js";import"./get-safe-url-nXPF2sGJ.js";import"./ButtonGroup-C6xSllEr.js";import"./getValidReactChildren-CIqQKAkN.js";import"./permission-DHDlX-2p.js";import"./index.esm-Di7pxRR7.js";import"./collapse-CvIW0hIW.js";import"./blocklet-4xcBoALi.js";import"./Switch-CYCG_kxE.js";import"./iframe-DyfK1MII.js";import"./ChevronLeft-DaNTS9Ry.js";import"./ChevronRight-DMRng8w4.js";import"./index-DBii9-f-.js";import"./base-chart-hRqEcUf1.js";import"./index-B1omHpBR.js";import"./AdapterDayjs-D92-n47b.js";import"./useThemeProps-R3T9xrvH.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=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:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},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 Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(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:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}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},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(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})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,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:o,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:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{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:o,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(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=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",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{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:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{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:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{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"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.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:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
1
|
+
import{aF as Ge,j as e,bo as gt,r as g,bE as J,bg as H,H as q,aH as D,g as xt,o as d,h as ee,au as bt,O as jt,K as C,T as U,V as Q,eO as Fe,P as Pe,ik as Ye,bk as Te,aV as Ie,U as Ee,bB as Ne,b4 as qe,b2 as Ae,C as Je,f as Qe,f0 as Xe,aP as De,W as yt,at as Ze,il as et,v as Oe,f2 as tt,br as je,fJ as st,dD as St,s as ie,ag as pe,G as Ue,av as vt,im as Ct,io as Nt,$ as nt,ip as wt,iq as Rt,ir as Tt,is as It,N as Et,by as it,E as At,J as Dt,Q as Ot,S as Lt,R as $e,it as kt,a4 as Ft}from"./index-BZORkGy0.js";import{d as Pt,H as at,g as _t}from"./index-BHkNOM9n.js";import{R as _e,S as Bt}from"./actions-DBjGgaan.js";import{B as zt}from"./index-BoA3EH-W.js";import{S as me}from"./shorten-label-DhnoyJGB.js";import{v as ot}from"./index-CW-42AHU.js";import{T as Wt}from"./html-title-CH-hjuPz.js";import{R as Mt}from"./Refresh-BLdRb4dq.js";import{D as Kt,g as Ht}from"./traffic-C0kPrhjJ.js";import{u as qt}from"./use-mobile-1I4QCh-N.js";import"./FilterList-CjwH8Y-X.js";import"./CSSTransition-5vBScTx4.js";import"./emotion-cache.browser.esm-CF7qzYNW.js";import"./index-DvOpuwAA.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BHfyIN1m.js";import"./index-Qj6_gIRY.js";import"./TableSearch-CXlvTHzu.js";import"./Search-CIrZ9Ibh.js";import"./Clear-By_ldZfu.js";import"./MoreVert-DuXHnJM1.js";import"./useLocalStorage-B6bhow_S.js";import"./url-evaluation-CwmddBcY.js";import"./get-safe-url-14Q6Gfeh.js";import"./ButtonGroup-uhq9NqjP.js";import"./getValidReactChildren-5khuIcs7.js";import"./permission-DHM_Uhje.js";import"./index.esm-DQbImx_I.js";import"./collapse-DOmRxR9w.js";import"./blocklet-Co-qXCPC.js";import"./Switch-CJHN4f7v.js";import"./iframe-CyW0Gy1t.js";import"./ChevronLeft-CsonlqWZ.js";import"./ChevronRight-slnHJMMM.js";import"./index-DBii9-f-.js";import"./base-chart-CUFc4seL.js";import"./index-DWcU23-2.js";import"./AdapterDayjs-Dcg6AE_r.js";import"./useThemeProps-DRCiWG5p.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),$t=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:Vt,Consumer:on}=rt;function Gt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=gt(),[l,x]=g.useState([]),[f,y]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),h=J(()=>s.meta?.did,[s]),[b,S]=g.useState([]),[B,_]=g.useState({}),R=J(()=>l.length?new Set(l.map(m=>m.id)):new Set,[l]),$=async({page:m=1,pageSize:N=20,...O}={})=>{if(!h)return[];try{const A={paging:{page:m,pageSize:N},...O,teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0},{dids:w,...L}=A;let P="";w&&w.includes("system")&&(P="system");const ae=w?w.filter(oe=>oe!=="system"):[],se={...L,source:P,componentDids:ae},Z=await n.getNotificationSendLog({input:se});return _(se),x(Z.list),y(Z.paging),Z.list}catch(A){return q.error(A.message),[]}},M=async()=>{const m=await n.getNotificationComponents({input:{teamDid:h}});S(m.componentDids)},k=g.useCallback(m=>{const N=s.children.find(O=>O.meta?.did===m);if(N)return N.ancestors=[s],N},[s]),F=async({notificationId:m,receivers:N,channels:O,...A})=>{await n.resendNotification({input:{teamDid:h,notificationId:m,receivers:N,channels:O.map(w=>w==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:w==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:w),...A}})},V=g.useCallback(async m=>(await n.getUser({input:{teamDid:h,user:{did:m},options:{enableConnectedAccount:!0}}})).user,[n,h]),G=g.useCallback(async({page:m=1,pageSize:N=20,...O}={})=>{try{const A={paging:{page:m,pageSize:N},...O,userName:O.searchText||"",teamDid:h,dateRange:O.dateRange?[H(O.dateRange[0]).toISOString(),H(O.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:A})}catch(A){throw q.error(A.message),A}},[n,h]);g.useEffect(()=>{h&&M()},[h]),o(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,m=>{R.has(m.notificationId)&&$(B)},[R,B]),o(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,m=>{R.has(m.id)||$(B)},[R,B]);const X={fetch:$,data:l,paging:f,blocklet:s,getComponent:k,resendNotification:F,getUser:V,componentDids:b,getReceivers:G,inService:r,teamDid:h};return e.jsx(Vt,{value:{notificationRecords:X},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 Yt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Yt[t],children:t})}const Jt=(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:o,reason:l="",channel:x="wallet"}=n,f=o?t("notification.sendStatus.sentTime",{date:bt(o,s)}):"",y=Jt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:f,reason:y}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:f}:{status:"pending",title:t("notification.sendStatus.pending"),reason:y,sentTime:f}}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},Qt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Xt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Zt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),es=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),ts=(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})}]:[],be=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},ss=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=ee(t,l,[]);return be(x)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const o={};return ke.forEach(l=>{const x=`${l}SendRecord`,f=ee(t,x,[]),y=be(f);o[l]=y}),r.length>0&&r.forEach(l=>{const x=n[l]??[],f=be(x);o[l]=f}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},Se=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ns=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 te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:o,title:l="",sentTime:x="",reason:f=""}=t,y=[l,f].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(U,{color:"inherit",sx:{fontSize:12},children:y}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(C,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[o]}}),e.jsx(C,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[o]}})]}),e.jsx(U,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ve.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ve({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:o}=Q();return e.jsxs(C,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(U,{children:[s,": "]}),t.map(l=>{const x=lt(r,o,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(C,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:x,enableTooltip:!1,children:x.title})}),onDelete:f=>n(f,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:o,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:o.map(f=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(f.value??f)>-1,onChange:y=>{const h=[...t];y.target.checked?h[n]=[...h[n],f.value??f]:h[n]=h[n].filter(b=>b!==(f.value??f)),s(h[n],n,r)},name:f.value??f}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(f)})},f.value??f))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:l,locale:x}=Q(),f=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:f,showTitle:!0}),f.status!=="success"&&e.jsx(Ne,{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:o,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(),[o,l]=g.useState(null),x=g.useCallback(h=>{l(o?null:h.currentTarget)},[o]),f=!!o,y=g.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(U,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ne,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ae,{open:f,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Kt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:y})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(o=>o.length).length?null:e.jsxs(C,{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(Pt.TableFilterList,{...s,ItemComponent:t})})]})}function Ke({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=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",...o&&l?{onDelete:o}:{}})}Ke.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const is=[{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(),[o,l]=g.useState(is),[x,f]=g.useState(!0),y=(b,S)=>{S.checked=b.target.checked;const B=o.map(_=>({..._,checked:_.value===S.value?S.checked:_.checked}));l(B)},h=b=>{b.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(U,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{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:o.map(b=>e.jsx(Ie,{control:e.jsx(Ee,{checked:b.checked,onChange:S=>y(S,b),name:b.value}),label:b.label},b.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:b=>f(b.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ne,{onClick:b=>{b.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ne,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{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:o}=Q(),l=Qe(),x=g.useMemo(()=>Xe(l,ut()),[l]),{getReceivers:f,inService:y,teamDid:h,getUser:b,blocklet:S}=Be(),[B,_]=g.useState(!1),[R,$]=g.useState([]),M=De({anchorEl:null,position:null}),k=De({anchorEl:null,position:null}),[F,V]=g.useState(null),[G,X]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[m,N]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[O,A]=g.useState([]),w=[{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"}],L=async()=>{if(!B&&t)try{_(!0);const i=await f({notificationId:t,...m}),a=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,y)}}));$(a),X(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{L()},[m]);const P=i=>{i.stopPropagation();const a=i.currentTarget;k.anchorEl=a;const c=a.getBoundingClientRect();k.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:P,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:G.page-1,rowsPerPage:G.pageSize,count:G.total,searchText:m.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:O,onRowSelectionChange:(i,a)=>{A(a.map(c=>c.dataIndex))},customToolbarSelect:ae},Z=({page:i,rowsPerPage:a,searchText:c,filterList:v})=>{const[,z=[],Y=[],K=[]]=v;m.pageSize!==a?N(W=>({...W,pageSize:a,page:1})):m.page!==i+1?N(W=>({...W,page:i+1})):m.searchText!==c?N(W=>({...W,searchText:c,page:1})):pe(z,m.walletSendStatus)?pe(Y,m.pushKitSendStatus)?pe(K,m.emailSendStatus)||N(W=>({...W,emailSendStatus:K,page:1})):N(W=>({...W,pushKitSendStatus:Y,page:1})):N(W=>({...W,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,a)=>{if(!a)return!1;const c=await b(a);return c?i==="wallet"?Zt(c):i==="email"?Qt(S,c):i==="pushKit"?Xt(S,c):i==="webhook"?es(c):!0:!1},[b,S]),we=g.useCallback(i=>ts(r,i),[r]),ne=()=>{M.anchorEl=null,M.position=null,V(null)},re=()=>{k.anchorEl=null,k.position=null},ge=async(i,a,c=!0,v="")=>{if(!(!a.length||!i.length))try{s(i,a,c,v),k.anchorEl||(await xe(.5),ne())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:a})=>{const c=O.map(v=>R[v].receiver);await ge(i,c,a),await xe(.5),re(),A([])},u=async(i,a=[],c=!0)=>{try{await ge(["webhook"],[i.receiver],c,a)}catch(v){q.error(v.response?v.response.statusText:v.message)}},j=async(i,a,c,v=[],z=!0)=>{if(i.stopPropagation(),ss(a,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await u(a,v,z);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}V({channel:c});try{const K=await oe(c,a.receiver);await xe(1),V({channel:c,result:K}),(typeof K=="boolean"&&K||St(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[a.receiver],z),k.anchorEl||(await xe(.5),ne()))}catch(K){q.error(K.message)}},I=i=>{N(a=>({...a,dateRange:i,page:1}))},E=(i,a,c,v)=>{i.stopPropagation();const z=c.filter(Y=>Y!==a);N(Y=>({...Y,[v]:z,page:1}))},T=J(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:a,receiver:c}=R[i];return a?e.jsxs(C,{"data-cy":`member-name-${a.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${a.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:a.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:m.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Wallet",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:a,index:c,column:v,filterValues:w})},customBodyRenderLite:i=>{const{walletSendStatus:a,walletSendAt:c,walletSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"wallet",onResend:z=>j(z,R[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:a,pushKitSendAt:c,pushKitSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"pushkit",onResend:z=>j(z,R[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:m.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Push Kit",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:a,emailSendAt:c,emailSendFailedReason:v}=R[i];return e.jsx(ce,{status:a,updatedAt:c,reason:v,channel:"email",onResend:z=>j(z,R[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:m.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(ve,{list:i,label:"Email",onDelete:(a,c)=>{a.stopPropagation(),E(a,c,T[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:w,fullWidth:!0,logic:Se,display:(i,a,c,v)=>e.jsx(Re,{label:"Email",filterList:i,onChange:a,index:c,column:v,filterValues:w})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:a}=R[i];if(!a)return null;const c=Object.entries(a)[0];if(!c)return null;const[v,z]=c,Y=z[0];return e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(C,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:v},v),e.jsx(ce,{status:Y.status,updatedAt:Y.sendAt,reason:Y.failedReason,channel:"webhook",onResend:K=>j(K,R[i],"webhook",[v],!1)})]},v)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:a}=R[i];return e.jsx(et,{value:a,locale:o,shouldUpdate:!0})}}}],[R,o,m,r]),le=[e.jsx(We,{value:m.dateRange,onChange:I},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:B,startIcon:e.jsx(Mt,{}),onClick:()=>L(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(os,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:o,loading:B,columns:T,data:R,onChange:Z,options:se,customButtons:le,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:a=>e.jsx(Ke,{...a,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ae,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:ne,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(rs,{children:[e.jsxs(U,{variant:"body1",component:"div",className:"check-title",children:[F?.channel," Checking"]}),e.jsx(C,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:we(F?.channel).map(i=>{const{type:a,pass:c,fail:v}=i;return!F?.result||F?.result?.[a]?e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:F?.result?.[a]?je.success.main:"inherit"},children:[F?.result?e.jsx($t,{}):e.jsx(Je,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},a):e.jsxs(U,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:je.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:v})]},a)})})]})}),k.anchorEl&&e.jsx(Ae,{open:!!k.anchorEl,anchorReference:"anchorPosition",anchorPosition:k.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:re,onConfirm:p})})]})})})}const as=g.memo(ft),os=ie.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|