@abtnode/webapp 1.17.7-beta-20251227-001958-ea2ba3f5 → 1.17.7-beta-20251229-085620-84f09930
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-BdvIhlUS.js → AdapterDayjs-B3EPIF8V.js} +1 -1
- package/dist/assets/{Add-75JKngmd.js → Add-B60k0zLe.js} +1 -1
- package/dist/assets/ArrowDropDown-D9C6bexH.js +1 -0
- package/dist/assets/{Autocomplete-kOONI_Pq.js → Autocomplete-B4QHA8fQ.js} +1 -1
- package/dist/assets/{Breadcrumbs-cTLPSR0j.js → Breadcrumbs-C2AxMEIo.js} +1 -1
- package/dist/assets/{ButtonGroup-CHbmdfp0.js → ButtonGroup-CwgnAVvA.js} +1 -1
- package/dist/assets/{CSSTransition-D4VQqBYl.js → CSSTransition-CTMK0QDG.js} +1 -1
- package/dist/assets/{CallMerge-DlG0KEtx.js → CallMerge-Cdfeu5IS.js} +1 -1
- package/dist/assets/{CardContent-DzGFYCPu.js → CardContent-LxDdD1ia.js} +1 -1
- package/dist/assets/{ChevronLeft-BtZyYDNZ.js → ChevronLeft-BU5D6BrG.js} +1 -1
- package/dist/assets/{ChevronRight-RokC-KBT.js → ChevronRight-BntDfQzc.js} +1 -1
- package/dist/assets/{Clear-1FRwWVql.js → Clear-RDv89tkq.js} +1 -1
- package/dist/assets/{Delete-BwS0ZYTA.js → Delete-BeglY8dh.js} +1 -1
- package/dist/assets/{DeleteOutline-1X_2pN5H.js → DeleteOutline-BDLlQ3k7.js} +1 -1
- package/dist/assets/{Done-CL3etDC5.js → Done-CEn2z4YZ.js} +1 -1
- package/dist/assets/{Edit-CHx0TOIp.js → Edit-B8h0Te5z.js} +1 -1
- package/dist/assets/{ErrorOutline-C1GIrHWO.js → ErrorOutline-C8or5W5q.js} +1 -1
- package/dist/assets/{FilterList-CeGx1Nvy.js → FilterList-CLDlsWBv.js} +1 -1
- package/dist/assets/{Google-C7HwiVx9.js → Google-BjTL7Mbd.js} +1 -1
- package/dist/assets/{HelpOutline-v-SutwQQ.js → HelpOutline-BWiGx-E5.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-CUBW-wSD.js → KeyboardArrowDown-DEp_gv0Q.js} +1 -1
- package/dist/assets/{Launch-DW7r2j3F.js → Launch-dZPSseNQ.js} +1 -1
- package/dist/assets/{Link-JpBA3kOe.js → Link-CysJEW2j.js} +1 -1
- package/dist/assets/{ListItemButton-YCbqUifF.js → ListItemButton-d8kfS6hh.js} +1 -1
- package/dist/assets/{ListSubheader-B7asbL85.js → ListSubheader-fV4wdcMl.js} +1 -1
- package/dist/assets/{LoadingButton-KZUgibtr.js → LoadingButton-BsrnRHRU.js} +1 -1
- package/dist/assets/{MoreVert-CAHrwnnF.js → MoreVert-uETYsy_E.js} +1 -1
- package/dist/assets/{OpenInNew-qP3b9J2q.js → OpenInNew-BCfmTCS5.js} +1 -1
- package/dist/assets/{Refresh-kYd1krYv.js → Refresh-Cm8v0stG.js} +1 -1
- package/dist/assets/{Replay-SZk6LYf7.js → Replay-DHMSlrmF.js} +1 -1
- package/dist/assets/{Search-l7-Pwd1y.js → Search-btz9KaC-.js} +1 -1
- package/dist/assets/{Stepper-BGGXEyEh.js → Stepper-Dxn7bqpJ.js} +1 -1
- package/dist/assets/{TableSearch-7aO3QXBn.js → TableSearch-fEXgtTVk.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CavSDkQH.js → ToggleButtonGroup-C4kzOS0b.js} +1 -1
- package/dist/assets/{UnfoldMore-DGe5-aCR.js → UnfoldMore-DThRR6-N.js} +1 -1
- package/dist/assets/{Verified-D57Ev6tJ.js → Verified-C19edvAZ.js} +1 -1
- package/dist/assets/{VerifiedUser-BVjv0CVW.js → VerifiedUser-K3XyiGA_.js} +1 -1
- package/dist/assets/{ViewList-DnUToii8.js → ViewList-CgjJtd-c.js} +1 -1
- package/dist/assets/{_createAggregator-CvUwaNA9.js → _createAggregator-C6OGob0j.js} +1 -1
- package/dist/assets/{actions-DmtsArNi.js → actions-Cx5UWmFM.js} +2 -2
- package/dist/assets/actions-DLzRFvAK.js +1 -0
- package/dist/assets/{agreement-Cr1FBybU.js → agreement-DkKyZFRL.js} +4 -4
- package/dist/assets/api-BIW3WSyV.js +1 -0
- package/dist/assets/{appearance-349xWfPH.js → appearance-Dy0GAWnb.js} +1 -1
- package/dist/assets/{audit-logs-MqhyOVr_.js → audit-logs-DDH5oZ1m.js} +3 -3
- package/dist/assets/base-chart-BYW3DQfO.js +1 -0
- package/dist/assets/{blocklet-BWp5BZ2L.js → blocklet-DOEd7Lt0.js} +1 -1
- package/dist/assets/{chain-Cs69RHJH.js → chain-DxgLFRf-.js} +1 -1
- package/dist/assets/click-to-copy-DsEvNuW1.js +1 -0
- package/dist/assets/cloneDeep-Cig9fPty.js +1 -0
- package/dist/assets/{config-navigation-CB4CUmS1.js → config-navigation-B1zx14fz.js} +22 -22
- package/dist/assets/{connect-to-BOU_fUy1.js → connect-to-C32I6gO9.js} +3 -3
- package/dist/assets/{cssMode-irya--jO.js → cssMode-CtKJ93fE.js} +1 -1
- package/dist/assets/{de-CCwoF0w2.js → de-EFAP4yzZ.js} +1 -1
- package/dist/assets/{delete-confirm-Czdis-d2.js → delete-confirm-Rx1yldK0.js} +1 -1
- package/dist/assets/{depsEqual-DtNa6mfL.js → depsEqual-CzPGJZq9.js} +1 -1
- package/dist/assets/{detail-aen8Gspk.js → detail-BYhPDlPb.js} +3 -3
- package/dist/assets/{domains-BRAsjXjE.js → domains-oZZ_Ty-9.js} +2 -2
- package/dist/assets/{download-DJuVrKpX.js → download-Dpf3ldu1.js} +1 -1
- package/dist/assets/{edit.svg-H5puV-Kf.js → edit.svg-CuloKtQk.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-BSPYCi-c.js +1 -0
- package/dist/assets/engine-DsZ-2cMT.js +1 -0
- package/dist/assets/{freemarker2-PK6zL7Wa.js → freemarker2-BWRy4jrz.js} +1 -1
- package/dist/assets/{get-safe-url-GMIK5bS7.js → get-safe-url-BgeSRCM1.js} +1 -1
- package/dist/assets/getValidReactChildren-c-3WOl4y.js +1 -0
- package/dist/assets/{graphqlMode-DhfmM5z8.js → graphqlMode-0sRNcgDJ.js} +2 -2
- package/dist/assets/{handlebars-suZg9Rb2.js → handlebars-P_4TmNVs.js} +1 -1
- package/dist/assets/{html-DLf47i1s.js → html-Dhv8md5y.js} +1 -1
- package/dist/assets/{html-title-BhYkXb7K.js → html-title-DD44mmgD.js} +1 -1
- package/dist/assets/{htmlMode-CRO-0abo.js → htmlMode-DopggpcY.js} +1 -1
- package/dist/assets/{iframe-D8OX0v5x.js → iframe-Qu-nVscQ.js} +1 -1
- package/dist/assets/{index-DeYnJhWD.js → index-39sjM7w4.js} +1 -1
- package/dist/assets/{index-Devav5mO.js → index-3bdOGXYz.js} +12 -12
- package/dist/assets/{index-Bq_Xf-WS.js → index-AnwYvOD6.js} +1 -1
- package/dist/assets/{index--sTZZj1Y.js → index-B4-HrO4o.js} +2 -2
- package/dist/assets/index-B7s3fWmd.js +79 -0
- package/dist/assets/{index-BJDBjriy.js → index-BHdJvD_e.js} +4 -4
- package/dist/assets/{index-C43er3Ol.js → index-BU4T_Wvp.js} +1 -1
- package/dist/assets/{index-D94ou7Gi.js → index-BXHaVrfH.js} +2 -2
- package/dist/assets/index-B_uYaYXc.js +87 -0
- package/dist/assets/{index-CjSZc8j3.js → index-BrhUX_qe.js} +1 -1
- package/dist/assets/{index-B0YA0eex.js → index-BsR0_qFa.js} +2 -2
- package/dist/assets/{index-Dk8_eJCH.js → index-C-V9x4q4.js} +17 -17
- package/dist/assets/{index-B9IBU_20.js → index-CBUEmu4p.js} +1 -1
- package/dist/assets/{index-CUYDbdpc.js → index-CK33Cb9C.js} +1 -1
- package/dist/assets/{index-DV1T4J21.js → index-Cnw2Ig5U.js} +2 -2
- package/dist/assets/{index-RvLFbIq0.js → index-Cvq6zZB9.js} +2 -2
- package/dist/assets/index-CwUZ9am0.js +5 -0
- package/dist/assets/index-Czc8yQAA.js +1 -0
- package/dist/assets/{index-BuAy14Fb.js → index-D-xN2OZw.js} +1 -1
- package/dist/assets/{index-BbjlOuR9.js → index-D2KGQYNR.js} +3 -3
- package/dist/assets/{index-Y-QvttbJ.js → index-D78suzy2.js} +95 -95
- package/dist/assets/index-D7HZBvR8.js +1 -0
- package/dist/assets/{index-3eT72yhD.js → index-D7vqSOsg.js} +9 -9
- package/dist/assets/{index-BQYunZVD.js → index-D93L21zf.js} +1 -1
- package/dist/assets/{index-DwIPLdSZ.js → index-D9z9EJRg.js} +17 -17
- package/dist/assets/{index-DkSARRFf.js → index-DHkDWWjb.js} +1 -1
- package/dist/assets/{index-CV64vjhs.js → index-DWxJ8r2D.js} +3 -3
- package/dist/assets/{index-DZVqWhON.js → index-DbU5jvv5.js} +1 -1
- package/dist/assets/{index-0K1n4OCx.js → index-DefsJZKk.js} +2 -2
- package/dist/assets/{index-929LkcAj.js → index-Deye8jzv.js} +8 -8
- package/dist/assets/{index-sa-k6sge.js → index-Dj054slT.js} +1 -1
- package/dist/assets/{index-lJeVBvul.js → index-DlpmIKRl.js} +12 -12
- package/dist/assets/{index-B8RjSIJa.js → index-Do20OM4S.js} +1 -1
- package/dist/assets/{index-CfCUQn4l.js → index-DyaBkuYt.js} +4 -4
- package/dist/assets/{index-LHDtQAe7.js → index-Eiq737ML.js} +1 -1
- package/dist/assets/index-GJu0trt8.js +155 -0
- package/dist/assets/{index-DcB5G7mF.js → index-H0mlKY3H.js} +1 -1
- package/dist/assets/index-JJswhFbD.js +1 -0
- package/dist/assets/{index-C8P0cv0U.js → index-OMPkcLs4.js} +2 -2
- package/dist/assets/{index-HMHQfeWc.js → index-RogGDMH8.js} +9 -9
- package/dist/assets/{index-BLAEccy_.js → index-gGxk5WJM.js} +1 -1
- package/dist/assets/{index-DARZEe4H.js → index-j3UFl5Dq.js} +2 -2
- package/dist/assets/{index-DGClCi00.js → index-qkxVIYPT.js} +11 -11
- package/dist/assets/{index-D-GgAn4D.js → index-uV9pYRNo.js} +1 -1
- package/dist/assets/{index.esm-D4mbID4N.js → index.esm-mNR4f2BF.js} +1 -1
- package/dist/assets/{install-from-url-B3WY31cp.js → install-from-url-D52UYhXy.js} +1 -1
- package/dist/assets/{invitation--cbaLA7C.js → invitation-DlWLyqUv.js} +4 -4
- package/dist/assets/is-path-prefix-equal-BYQbaqqa.js +1 -0
- package/dist/assets/item-LsHOq-zm.js +273 -0
- package/dist/assets/{javascript-ChSXcPeU.js → javascript-DKLJNbgU.js} +1 -1
- package/dist/assets/{jsonMode-BRST5wef.js → jsonMode-6n4xGwpA.js} +1 -1
- package/dist/assets/{liquid-CpSF9izi.js → liquid-BvDNIxXF.js} +1 -1
- package/dist/assets/{list-header-CAyaG0bp.js → list-header-BHsvljit.js} +1 -1
- package/dist/assets/{lock.svg-DtLI8vnk.js → lock.svg-BzF_roTX.js} +1 -1
- package/dist/assets/{log-DZS6nYV_.js → log-CCqXzPvI.js} +2 -2
- package/dist/assets/{lottie-react.esm-D7vuHojB.js → lottie-react.esm-CA2-qLw0.js} +1 -1
- package/dist/assets/{mdx-BWUp_fub.js → mdx-CORwGL2F.js} +1 -1
- package/dist/assets/{memory-ClDXUWJ0.js → memory-DjgLsWG0.js} +1 -1
- package/dist/assets/{metric-DyS1o5oY.js → metric-CNMVZIll.js} +1 -1
- package/dist/assets/omit-BGJcae02.js +1 -0
- package/dist/assets/{overview-BZK8iTTP.js → overview-DZx8sNOc.js} +1 -1
- package/dist/assets/{permission-C73DtYHh.js → permission-CCNK9jT0.js} +1 -1
- package/dist/assets/{preference-A-YVUe6G.js → preference-CL8oQs4K.js} +9 -9
- package/dist/assets/{python-CxcQpe_X.js → python-DNPLg-Zx.js} +1 -1
- package/dist/assets/{raf-schd.esm-DUBpm6hM.js → raf-schd.esm-D_x0x_Qn.js} +1 -1
- package/dist/assets/{razor-CV7jqhrT.js → razor-BXbmyOQh.js} +1 -1
- package/dist/assets/{rotate-session-key-C16BchY6.js → rotate-session-key-B9uPds9f.js} +1 -1
- package/dist/assets/{runtime-DQsAvWqZ.js → runtime-CJZGBtjx.js} +1 -1
- package/dist/assets/schema-DqiLBSd2.js +1 -0
- package/dist/assets/sdk-CSPQYdiI.js +1 -0
- package/dist/assets/{service-DAzvPZkc.js → service-BB7jaRU2.js} +1 -1
- package/dist/assets/{shorten-label-CkQfhtXr.js → shorten-label-D6qdCHBK.js} +1 -1
- package/dist/assets/{simple-select-CuyjHO0U.js → simple-select-ZER_8WgH.js} +1 -1
- package/dist/assets/{spaces-CWPgDpWK.js → spaces-M88xnpCx.js} +1 -1
- package/dist/assets/status-CjV3xdMN.js +1 -0
- package/dist/assets/{status-Dzw7M8P_.js → status-Claw5V5z.js} +1 -1
- package/dist/assets/{switch-control-BclMvWCC.js → switch-control-CVj0L-9B.js} +2 -2
- package/dist/assets/{table-icons-9svpZs1q.js → table-icons-D5BFFDTU.js} +1 -1
- package/dist/assets/{team-j4eaMxpB.js → team-DI44e0Lq.js} +1 -1
- package/dist/assets/{toLower-8m1XzQqH.js → toLower-BR9mSuL0.js} +1 -1
- package/dist/assets/toUpper-cXhRv1n8.js +1 -0
- package/dist/assets/traffic-CtaSaEzh.js +1 -0
- package/dist/assets/{tsMode-CqXYRIKQ.js → tsMode-B4RcWbJF.js} +1 -1
- package/dist/assets/{typescript-KJ8oiy4w.js → typescript-ApR86vo0.js} +1 -1
- package/dist/assets/{url-evaluation-BstEsUAB.js → url-evaluation-Dz0qWdnw.js} +1 -1
- package/dist/assets/{url-join-0c-XnZLH.js → url-join-Bhp_MbCf.js} +1 -1
- package/dist/assets/{use-mobile-9lV1jqC7.js → use-mobile-D6doCW2D.js} +1 -1
- package/dist/assets/{use-mobile-BG1HQZl_.js → use-mobile-p7bScsU1.js} +1 -1
- package/dist/assets/{useAsync-Bbnkcz0c.js → useAsync-DeHRjN-F.js} +1 -1
- package/dist/assets/{useAsyncRetry-DwNYtCt1.js → useAsyncRetry-M7S8bZOZ.js} +1 -1
- package/dist/assets/{useLocalStorage-B2geQn_J.js → useLocalStorage-CGOwOi-p.js} +1 -1
- package/dist/assets/{useThemeProps-CqzVTStV.js → useThemeProps-xpQuNQBO.js} +1 -1
- package/dist/assets/{util-BRuccBUB.js → util-B4XNVjK7.js} +1 -1
- package/dist/assets/{wait-container-C4LPSsIr.js → wait-container-DE5vVesp.js} +3 -3
- package/dist/assets/{without-wallet--pvprqkp.js → without-wallet-CZASlBin.js} +1 -1
- package/dist/assets/wrap-locale-DqDO9Bmx.js +1 -0
- package/dist/assets/{xml-DQZh516a.js → xml-CqiM979f.js} +1 -1
- package/dist/assets/{yaml-CpaHe6nN.js → yaml-CHANqhAV.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-CbIxem1P.js +0 -1
- package/dist/assets/actions-BZl9shku.js +0 -1
- package/dist/assets/api-CZXns3iQ.js +0 -1
- package/dist/assets/base-chart-B_hYrlch.js +0 -1
- package/dist/assets/click-to-copy-CJg25x9s.js +0 -1
- package/dist/assets/cloneDeep-CvglcUIb.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-CaLvcLFC.js +0 -1
- package/dist/assets/engine-C4nmXPyL.js +0 -1
- package/dist/assets/getValidReactChildren-BTFGvhfH.js +0 -1
- package/dist/assets/index-BKwmETrp.js +0 -1
- package/dist/assets/index-CHyDna8x.js +0 -79
- package/dist/assets/index-CK6zgnPU.js +0 -5
- package/dist/assets/index-CL23Woxs.js +0 -87
- package/dist/assets/index-DYn_D6bf.js +0 -155
- package/dist/assets/index-Di8tb0lj.js +0 -1
- package/dist/assets/index-Diu0oJmr.js +0 -1
- package/dist/assets/is-path-prefix-equal-BkAKRgRo.js +0 -1
- package/dist/assets/item-9qWg89Hm.js +0 -273
- package/dist/assets/omit-BgwU28m_.js +0 -1
- package/dist/assets/schema-CutOyNqB.js +0 -1
- package/dist/assets/sdk-vbwSpYyc.js +0 -1
- package/dist/assets/status-D1smxOIE.js +0 -1
- package/dist/assets/toUpper-B5GOxJoT.js +0 -1
- package/dist/assets/traffic-DIOEDjRI.js +0 -1
- package/dist/assets/wrap-locale-D8L6OQkL.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as P,V as E,A as C,j as e,
|
|
1
|
+
import{r as P,V as E,A as C,j as e,Y as W,C as j,cG as I,J as T,w as k,H as u,aH as S,u as U,x as v,ar as N,af as R}from"./index-D78suzy2.js";import{w as b}from"./wrap-locale-DqDO9Bmx.js";import{g as L}from"./get-safe-url-BgeSRCM1.js";import"./index-CBUEmu4p.js";function H({SessionContext:n,webWalletUrl:a,onSuccess:r}){const{api:o,session:t}=P.useContext(n),{t:s,locale:g}=E(),h=C(),{searchParams:l}=new URL(window.location.href),p=l.get("redirect"),f=async(c,w)=>{r(c,w),await t.refresh(),u.success(s("exchangePassport.success")),setTimeout(()=>{if(p){const i=decodeURIComponent(p);i.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?h(i,{replace:!0}):window.location.href=L(i)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},m=c=>{u.error(c.message)},d={},x=l.get("componentId");return x&&(d.componentId=x),t.loading?e.jsx(W,{children:e.jsx(j,{})}):e.jsx(I,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(T,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(k,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:o.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:f,onError:m,locale:g,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:d,extraContent:null,hideCloseButton:!0})})})}const _=b(H);function V(){const{info:n}=U(),a=v(n),r=(o,t)=>{o.sessionToken&&R(t(o.sessionToken))};return e.jsx(_,{SessionContext:N,webWalletUrl:a,onSuccess:r})}export{V as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aG as Ve,j as e,bp as ht,r as x,bF as Y,bh as H,H as q,aI as E,g as gt,o as d,h as ee,av as xt,O as bt,K as N,T as Q,V as X,eQ as ke,P as Fe,it as Ge,bl as Re,aW as Te,U as Ie,bC as Ce,b5 as He,b3 as Ee,C as Qe,f as Ye,f2 as Xe,aQ as Ae,W as jt,au as Je,iu as Ze,v as De,f4 as et,bs as be,fL as tt,dF as yt,s as ae,ah as pe,G as qe,aw as St,iv as vt,iw as Ct,$ as Nt,ix as wt,iy as Rt,iz as Tt,iA as It,N as Et,bz as st,E as At,J as Dt,Q as Ot,S as Lt,R as Ue,iB as kt}from"./index-Y-QvttbJ.js";import{d as Ft,H as nt,g as Pt}from"./index-LHDtQAe7.js";import{S as me}from"./shorten-label-CkQfhtXr.js";import{v as at}from"./index-D-GgAn4D.js";import{T as _t}from"./html-title-BhYkXb7K.js";import{R as Pe}from"./Replay-SZk6LYf7.js";import{R as Bt}from"./Refresh-kYd1krYv.js";import{D as zt,g as Wt}from"./traffic-DIOEDjRI.js";import"./FilterList-CeGx1Nvy.js";import"./CSSTransition-D4VQqBYl.js";import"./emotion-cache.browser.esm-CaLvcLFC.js";import"./index-929LkcAj.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-DtNa6mfL.js";import"./TableSearch-7aO3QXBn.js";import"./Search-l7-Pwd1y.js";import"./Clear-1FRwWVql.js";import"./MoreVert-CAHrwnnF.js";import"./iframe-D8OX0v5x.js";import"./ChevronLeft-BtZyYDNZ.js";import"./ChevronRight-RokC-KBT.js";import"./index-DBii9-f-.js";import"./base-chart-B_hYrlch.js";import"./index-DeYnJhWD.js";import"./AdapterDayjs-BdvIhlUS.js";import"./useThemeProps-CqzVTStV.js";import"./visuallyHidden-Dan1xhjv.js";const Mt=Ve(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Kt=Ve(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),it=x.createContext({}),{Provider:Ht,Consumer:Ks}=it;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=ht(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Y(()=>s.meta?.did,[s]),[j,v]=x.useState([]),[P,F]=x.useState({}),w=Y(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const J={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:j,getReceivers:V,inService:r,teamDid:h};return e.jsx(Ht,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(it);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(gt,{type:Ut[t],children:t})}const $t=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ot(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:xt(i,s)}):"",S=$t(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],rt=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},lt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Vt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:rt(t),enabled:n}},Gt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:lt(t),enabled:n}},Qt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Yt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Jt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},je=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ye=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ct=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(bt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=X();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=ot(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(j=>j!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=X(),m=ot(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[He(t[0],n)," - ",He(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Wt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const es=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];dt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function dt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[i,l]=x.useState(es),[b,m]=x.useState(!0),S=(j,v)=>{v.checked=j.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=j=>{j.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ge,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(j=>e.jsx(Te,{control:e.jsx(Ie,{checked:j.checked,onChange:v=>S(v,j),name:j.value}),label:j.label},j.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:j=>m(j.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:j=>{j.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ut.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ut({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=X(),l=Ye(),b=x.useMemo(()=>Xe(l,ct()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:j,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:tt(c.receiverUser.avatar,h,S)}}));U(o),J(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await j(o);return c?a==="wallet"?Qt(c):a==="email"?Vt(v,c):a==="pushKit"?Gt(v,c):a==="webhook"?Yt(c):!0:!1},[j,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},y=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await y(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await y(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Jt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||yt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=Y(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(jt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:je},filterOptions:{names:O,fullWidth:!0,logic:ye,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(Ze,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),mt=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(Bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ss,{children:e.jsxs(et,{theme:b,children:[e.jsx(nt,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:mt,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ns,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(Kt,{}):e.jsx(Qe,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(Mt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(dt,{loading:n,onCancel:u,onConfirm:I})})]})})})}const ts=x.memo(ut),ss=ae.div`
|
|
1
|
+
import{aF as Ve,j as e,bo as ht,r as x,bE as Q,bg as H,H as q,aH as E,g as gt,o as d,h as ee,au as xt,N as bt,J as N,T as Y,V as X,eP as ke,O as Fe,it as Ge,bk as Re,aV as Te,R as Ie,bB as Ce,b4 as He,b2 as Ee,C as Ye,f as Qe,f1 as Xe,aP as Ae,W as yt,at as Je,iu as Ze,v as De,f3 as et,br as be,fK as tt,dE as jt,s as ae,ag as pe,G as qe,av as St,iv as vt,iw as Ct,$ as Nt,ix as wt,iy as Rt,iz as Tt,iA as It,M as Et,by as st,E as At,I as Dt,P as Ot,S as Lt,Q as Ue,iB as kt}from"./index-D78suzy2.js";import{d as Ft,H as nt,g as Pt}from"./index-Eiq737ML.js";import{S as me}from"./shorten-label-D6qdCHBK.js";import{v as at}from"./index-uV9pYRNo.js";import{T as _t}from"./html-title-DD44mmgD.js";import{R as Pe}from"./Replay-DHMSlrmF.js";import{R as Bt}from"./Refresh-Cm8v0stG.js";import{D as zt,g as Wt}from"./traffic-CtaSaEzh.js";import"./FilterList-CLDlsWBv.js";import"./CSSTransition-CTMK0QDG.js";import"./emotion-cache.browser.esm-BSPYCi-c.js";import"./index-Deye8jzv.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-CzPGJZq9.js";import"./TableSearch-fEXgtTVk.js";import"./Search-btz9KaC-.js";import"./Clear-RDv89tkq.js";import"./MoreVert-uETYsy_E.js";import"./iframe-Qu-nVscQ.js";import"./ChevronLeft-BU5D6BrG.js";import"./ChevronRight-BntDfQzc.js";import"./index-DBii9-f-.js";import"./base-chart-BYW3DQfO.js";import"./index-39sjM7w4.js";import"./AdapterDayjs-B3EPIF8V.js";import"./useThemeProps-xpQuNQBO.js";import"./visuallyHidden-Dan1xhjv.js";const Mt=Ve(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"})),Kt=Ve(e.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),it=x.createContext({}),{Provider:Ht,Consumer:Ks}=it;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=ht(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const J={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Ht,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(it);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(gt,{type:Ut[t],children:t})}const $t=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function ot(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:xt(i,s)}):"",S=$t(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],rt=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},lt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Vt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:rt(t),enabled:n}},Gt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:lt(t),enabled:n}},Yt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Jt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ct=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(bt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=X();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(l=>{const b=ot(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ge,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=X(),m=ot(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[He(t[0],n)," - ",He(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Wt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const es=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];dt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function dt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[i,l]=x.useState(es),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ge,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ye,{size:16}),r("common.confirm")]})]})]})}ut.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ut({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=X(),l=Qe(),b=x.useMemo(()=>Xe(l,ct()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:tt(c.receiverUser.avatar,h,S)}}));U(o),J(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Yt(c):a==="email"?Vt(v,c):a==="pushKit"?Gt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Jt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||jt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(yt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(Ze,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),mt=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(Bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ss,{children:e.jsxs(et,{theme:b,children:[e.jsx(nt,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:mt,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ns,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(Kt,{}):e.jsx(Ye,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(Mt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(dt,{loading:n,onCancel:u,onConfirm:I})})]})})})}const ts=x.memo(ut),ss=ae.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -27,7 +27,7 @@ import{aG as Ve,j as e,bp as ht,r as x,bF as Y,bh as H,H as q,aI as E,g as gt,o
|
|
|
27
27
|
}
|
|
28
28
|
font-size: 12px;
|
|
29
29
|
}
|
|
30
|
-
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function as(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function is(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ke.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=X(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=X(),{success:b,failed:m,pending:S}=s,h=Zt(t),
|
|
30
|
+
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function as(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function is(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ke.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=X(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=X(),{success:b,failed:m,pending:S}=s,h=Zt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,U=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(os,{successRatio:U,failedRatio:M,children:[e.jsxs(Y,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(Y,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(v)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(P)," ",l("notification.sendStatus.pending")]})]}),v>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(De,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=Q(()=>s==="simple"?as(t):is(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(at,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(qe,{container:!0,spacing:2,children:i.map(l=>e.jsx(qe,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const os=ae(N)`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
align-items: flex-start;
|
|
@@ -45,7 +45,7 @@ import{aG as Ve,j as e,bp as ht,r as x,bF as Y,bh as H,H as q,aI as E,g as gt,o
|
|
|
45
45
|
bottom: 0;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`;pt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function pt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=X(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),
|
|
48
|
+
`;pt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function pt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=X(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=Q(()=>b(t.componentDid)||n,[n,t.componentDid]),v=Ae({tab:r||"info"}),P=x.useCallback(async(p,g,T=!0,D=[])=>{if(!p.length||!t.id)return;const O=g.length>0?g:t?.receivers?.map(_=>_.receiver);if(!O.length)return;let z=[...p];if(z.includes(E.NOTIFICATION_SEND_CHANNEL.PUSH)&&!lt(n)&&(q.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.PUSH)),z.includes(E.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!rt(n)&&(q.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:O,channels:z,resendFailedOnly:T,...z.includes("webhook")&&D.length?{webhookUrls:D}:{}}),q.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),q.error(_.response?_.response.statusText:_.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),F=Q(()=>vt(t),[t]),w=Q(()=>Ct(t),[t]),U=Q(()=>F?t?.actorInfo:[],[t]),M=Q(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(wt,{actors:U,teamDid:M,size:32,showName:!0}):e.jsx(Rt,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:i("notification.body"),value:F?e.jsx(Tt,{notification:t,blocklet:n}):e.jsx(It,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(Et,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(at,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const k={info:{label:i("common.basicInfo"),value:"info",component:L},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},$=Object.values(k).map(({label:p,value:g})=>({label:p,value:g})),V=k[v.tab]||k.info,J=p=>{v.tab=p};return e.jsx(Nt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{v.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ls,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(_t,{tabs:$,current:v.tab,onChange:J,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(ts,{notificationId:t.id,resending:S,handleResend:P}),v.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:S,onResend:P}),v.tab==="info"&&e.jsx(V.component,{})]})]})})}const rs=x.memo(pt),ls=ae.div`
|
|
49
49
|
& > .notification-row {
|
|
50
50
|
padding: 0;
|
|
51
51
|
}
|
|
@@ -92,7 +92,7 @@ import{aG as Ve,j as e,bp as ht,r as x,bF as Y,bh as H,H as q,aI as E,g as gt,o
|
|
|
92
92
|
overflow: hidden;
|
|
93
93
|
text-overflow: ellipsis;
|
|
94
94
|
}
|
|
95
|
-
`;function ve({blocklet:t=null,label:s=""}){return e.jsx(cs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(st,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}ft.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ft({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(
|
|
95
|
+
`;function ve({blocklet:t=null,label:s=""}){return e.jsx(cs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(st,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}ft.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ft({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function ds(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function us({customTableButtons:t}){const{t:s,locale:n}=X(),r=Qe(),i=At(r.breakpoints.down("sm")),l=x.useMemo(()=>Xe(r,ct()),[r]),[b,m]=x.useState(!1),{data:S,paging:h,blocklet:y,fetch:v,getComponent:P,componentDids:F,inService:w,teamDid:U}=_e(),M=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),J=`notification-records-${y.meta?.did}`,p=Pt(J),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),D=Q(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),Z=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=D.find(A=>(A.did||A.meta?.did)===u);return e.jsx(ve,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:D,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,I)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(Ot,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Lt,{multiple:!0,value:f[j],renderValue:A=>e.jsx(N,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:A.map(R=>{if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const re=D.find(ne=>(ne.did||ne.meta?.did)===R);return e.jsx(ve,{blocklet:re,label:re?.title||re?.meta?.title},R)})}),onChange:A=>{f[j]=A.target.value,u(f[j],j,I)},children:[e.jsx(Ue,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(Ue,{value:R,children:e.jsx(ve,{blocklet:A,label:A.title||A.meta?.title})},R)})]})]})},customBodyRenderLite:f=>{const u=S[f],j=P(u.componentDid);return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(st,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Dt,{blocklet:y,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f],{receivers:j}=u;return e.jsx(kt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:I=>{I.stopPropagation(),k(u),V("receivers")},children:j.map(I=>{const{receiverUser:A}=I,R=tt(A.avatar,U,w);return e.jsx(Je,{alt:A.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(N,{onClick:j=>{j.stopPropagation(),k(u),V("statistics")},children:e.jsx(Ke,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const u=S[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(ft,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,Z[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:$e,fullWidth:!0,logic:je,display:(f,u,j,I)=>e.jsx(ds,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:I,filterValues:$e})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=S[f];return e.jsx(Ze,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{T(u=>({...u,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(N,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ps,{isBreakpointsDownSm:i,children:e.jsx(et,{theme:l,children:e.jsx(nt,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:Z,data:S,durable:J,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...p,onRowClick:(f,{dataIndex:u})=>{k(S[u])}},title:e.jsx(ze,{value:g.dateRange,onChange:oe}),customButtons:Ne,components:{TableFilterList:f=>e.jsx(We,{...f,itemComponent:u=>e.jsx(Me,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),L&&e.jsx(rs,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const ps=ae.div`
|
|
96
96
|
td.MuiTableCell-footer {
|
|
97
97
|
border: none !important;
|
|
98
98
|
}
|