@abtnode/blocklet-services 1.17.8-beta-20260116-080047-9fdd00d3 → 1.17.8-beta-20260119-102944-6ba93a16
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/dist/assets/{AdapterDayjs-BI3dme25.js → AdapterDayjs-CYW0YvmK.js} +1 -1
- package/dist/assets/{Google-BMSeyXdi.js → Google-DKRt92nm.js} +1 -1
- package/dist/assets/{access-control-CSfPgD_B.js → access-control-RI6LQbSm.js} +1 -1
- package/dist/assets/{actions-Ng-YRTer.js → actions-BlWED76c.js} +2 -2
- package/dist/assets/{actions-Dktj9pEF.js → actions-DydkTgA0.js} +1 -1
- package/dist/assets/{add-component-core-DOIm-W83.js → add-component-core-nc1ps0ni.js} +32 -32
- package/dist/assets/{add-resource-_wuuBiJJ.js → add-resource-BVOdOQSW.js} +1 -1
- package/dist/assets/{addon-N_sS-Sx6.js → addon-DfWedLEC.js} +1 -1
- package/dist/assets/{advanced-BhbxG-_n.js → advanced-CuKHqbLO.js} +2 -2
- package/dist/assets/{aigne-DElJAbjP.js → aigne-6nMSoyeQ.js} +1 -1
- package/dist/assets/{appearance-D71HSeGD.js → appearance-C9TkbSjV.js} +1 -1
- package/dist/assets/{ar-BHqjWgUQ.js → ar-DOhYGTlW.js} +1 -1
- package/dist/assets/{audit-logs-Ci_HlT4m.js → audit-logs-DKGke9hI.js} +2 -2
- package/dist/assets/{authorize-DQERA3Vv.js → authorize-DkSqywe8.js} +1 -1
- package/dist/assets/{base-chart-DWXZOkNE.js → base-chart-DcZV4ZCI.js} +1 -1
- package/dist/assets/{base32-Cpvj2sD4.js → base32-7iZvvdX8.js} +1 -1
- package/dist/assets/{bind-account-BIzFrnLk.js → bind-account-DOwM9Nhe.js} +1 -1
- package/dist/assets/branding-Cak2s8bn.js +1 -0
- package/dist/assets/{branding-BHJqY7Mz.js → branding-CwSyd5WC.js} +1 -1
- package/dist/assets/{branding-DAdwbyWZ.js → branding-lcfxmmPp.js} +1 -1
- package/dist/assets/{bundle-avatar-sDqev1Fh.js → bundle-avatar-DwiOyeMO.js} +1 -1
- package/dist/assets/button-uUU4Wycr.js +1 -0
- package/dist/assets/{click-to-copy-RBTqACSW.js → click-to-copy-BgIYUMoo.js} +1 -1
- package/dist/assets/{collapse-DWmyzfnW.js → collapse-RMuUWnK3.js} +1 -1
- package/dist/assets/{complete-D6XDZtnV.js → complete-Udiv_yFp.js} +1 -1
- package/dist/assets/{component-B2qSKMGx.js → component-CuKviNC8.js} +2 -2
- package/dist/assets/{config-oF-A1tKe.js → config-6IwEgT3b.js} +1 -1
- package/dist/assets/{config-Ca5tnO9j.js → config-CJwxv2uK.js} +1 -1
- package/dist/assets/{config-fYkZxdEr.js → config-D1OcHGlN.js} +4 -4
- package/dist/assets/{config-navigation-BEYJ5bSz.js → config-navigation-hDihVsjx.js} +2 -2
- package/dist/assets/{config-space-HmsYCb6s.js → config-space-DfstlHnF.js} +1 -1
- package/dist/assets/{confirm-DQYDHHdS.js → confirm-CdVn5WdC.js} +1 -1
- package/dist/assets/{connect-COLwEMSx.js → connect-CT2vMz6l.js} +3 -3
- package/dist/assets/{connect-ydb7rKXe.js → connect-DA7RO2yv.js} +1 -1
- package/dist/assets/{connect-BeWeBwCA.js → connect-Dy0Y8HRB.js} +1 -1
- package/dist/assets/{connect-to-C3ac4B-g.js → connect-to-CQMUbQkH.js} +1 -1
- package/dist/assets/{content-layout-CanSZTqf.js → content-layout-Dlmn5DW6.js} +1 -1
- package/dist/assets/{create-passport-svg-De1vqcmo.js → create-passport-svg-hldNORaB.js} +1 -1
- package/dist/assets/{createClass-CRUn7w67.js → createClass-CgfWUrk8.js} +1 -1
- package/dist/assets/{dashboard-BZiea8Z_.js → dashboard-BvI3ii8Z.js} +2 -2
- package/dist/assets/{de-QUGQFv2K.js → de-CtKPdGk6.js} +1 -1
- package/dist/assets/{delete-confirm-CpaOkuin.js → delete-confirm-CkiUXocp.js} +1 -1
- package/dist/assets/{did-address-DRYM96gB.js → did-address-CG36eCOx.js} +1 -1
- package/dist/assets/{domain-D9Kc4Rgt.js → domain-CDTeLbkZ.js} +1 -1
- package/dist/assets/{domain-action-card-ugKl692S.js → domain-action-card-kMPYS2Nj.js} +1 -1
- package/dist/assets/domains-TI6o1CvX.js +1 -0
- package/dist/assets/{email-DDyG3qPR.js → email-DHRHueET.js} +2 -2
- package/dist/assets/{empty-spinner-ChYvCNCV.js → empty-spinner-DB1GKIOS.js} +1 -1
- package/dist/assets/engine-D_fEFx9_.js +1 -0
- package/dist/assets/{es-C4w6cL07.js → es-BSYtSZPg.js} +1 -1
- package/dist/assets/{exchange-passport-DoiXZo5M.js → exchange-passport-Cc872mjQ.js} +1 -1
- package/dist/assets/{fallback-CZRO9TTQ.js → fallback-D-IHOW-7.js} +1 -1
- package/dist/assets/{form--iZWaH7Y.js → form-Co-tgocU.js} +1 -1
- package/dist/assets/{form-text-input-Cs-LuCu0.js → form-text-input-CPLafaTk.js} +1 -1
- package/dist/assets/{form-wrapper-EixE0Jkw.js → form-wrapper-kWYD3nZz.js} +1 -1
- package/dist/assets/{fr-Bq3UipEu.js → fr-C35fi7h9.js} +1 -1
- package/dist/assets/{fuel-C85y6XSK.js → fuel-BFx1ShM2.js} +1 -1
- package/dist/assets/{gen-access-key-DxF-VBeV.js → gen-access-key-DrgLVRbm.js} +1 -1
- package/dist/assets/{gen-simple-access-key-Cxq1_uy6.js → gen-simple-access-key-B24d6k7g.js} +1 -1
- package/dist/assets/get-safe-url-beob4f2C.js +1 -0
- package/dist/assets/{hi-DGZy0DLh.js → hi-5fpYJkiW.js} +1 -1
- package/dist/assets/{home-EzPPxjBW.js → home-Dw18IODa.js} +1 -1
- package/dist/assets/{id-DOzDilAf.js → id-DoVb0JYr.js} +1 -1
- package/dist/assets/{iframe-C5nvJ0m0.js → iframe-DUzp97tk.js} +1 -1
- package/dist/assets/{index-B3ArnS-X.js → index--WQuhwJL.js} +1 -1
- package/dist/assets/{index-Cw8Yly1u.js → index-2M4w6J9r.js} +1 -1
- package/dist/assets/{index-D3fA5iF-.js → index-3H6a5edM.js} +1 -1
- package/dist/assets/{index-_uJPC7_n.js → index-8RHrVCC6.js} +1 -1
- package/dist/assets/{index-BM9QepzF.js → index-B-8044Gs.js} +22 -11
- package/dist/assets/{index-Ba_SJ3UV.js → index-B6l4xGy5.js} +2 -2
- package/dist/assets/{index-CbZQvtgh.js → index-B9FojAjj.js} +1 -1
- package/dist/assets/{index-BQFgfBFX.js → index-BOPR4Iyc.js} +2 -2
- package/dist/assets/{index-VlFqUdI2.js → index-BUhEyicQ.js} +1 -1
- package/dist/assets/{index-DGU5RA0-.js → index-BeunkI-Z.js} +3 -3
- package/dist/assets/{index-_bvucGkF.js → index-Bo9KtpTY.js} +1 -1
- package/dist/assets/{index-r7svI4rK.js → index-Bpic07NM.js} +7 -7
- package/dist/assets/{index-BuucS_rQ.js → index-C1fKsLzf.js} +1 -1
- package/dist/assets/{index-D_ymA2Th.js → index-C4ZzROeE.js} +5 -5
- package/dist/assets/{index-sb6EjUcD.js → index-CEJb82tA.js} +1 -1
- package/dist/assets/{index-Ca33rdd_.js → index-CXp5SI_f.js} +82 -82
- package/dist/assets/{index-zkaWHEAS.js → index-C_kNXHsF.js} +1 -1
- package/dist/assets/{index-DvQIPWQ6.js → index-Cax1AxL9.js} +1 -1
- package/dist/assets/{index-Ca5zgzpl.js → index-CfvGuvbD.js} +1 -1
- package/dist/assets/{index-BbO4pSmm.js → index-CqCXPf7W.js} +1 -1
- package/dist/assets/{index-p0MfrvgW.js → index-Cx0E03Bs.js} +1 -1
- package/dist/assets/{index-CL5ZGYlc.js → index-D3BuekEe.js} +3 -3
- package/dist/assets/{index-D4_8N2le.js → index-D6pCyJv8.js} +1 -1
- package/dist/assets/{index-Ddl9fWMP.js → index-DFUM0Pvk.js} +1 -1
- package/dist/assets/{index-B3fG443w.js → index-DH4rC-7M.js} +1 -1
- package/dist/assets/{index-B2PeJoug.js → index-DKzBOJCu.js} +2 -2
- package/dist/assets/index-DL0wTcgx.js +1 -0
- package/dist/assets/{index-C9V4aWeM.js → index-DWHFecw2.js} +4 -4
- package/dist/assets/{index-Dxb3MonW.js → index-DcW3jqfL.js} +1 -1
- package/dist/assets/{index-CxOxF1pg.js → index-Di2nSesc.js} +1 -1
- package/dist/assets/{index-CiCryHDZ.js → index-DqcciDRh.js} +2 -2
- package/dist/assets/{index-DCxNOCc2.js → index-VKjWmvRV.js} +1 -1
- package/dist/assets/{index-DVOweIMx.js → index-Vf51dp11.js} +1 -1
- package/dist/assets/{index-2AyCotIy.js → index-ZzcJ7eKO.js} +1 -1
- package/dist/assets/{index-Bwibx9MU.js → index-bEFOmVth.js} +1 -1
- package/dist/assets/{info-outline-rounded-DVdLJtdi.js → info-outline-rounded-DlgANjBB.js} +1 -1
- package/dist/assets/{invitation-CUluW5mi.js → invitation-BP8hOEFv.js} +1 -1
- package/dist/assets/invitations-C8aZLxdl.js +3 -0
- package/dist/assets/{invite-zC3nU84H.js → invite-Cd5zEHFb.js} +1 -1
- package/dist/assets/{issue-passport-B_pYDft0.js → issue-passport-D7zqv3Al.js} +1 -1
- package/dist/assets/{item-DoUn7xhc.js → item-DNj7ORqk.js} +1 -1
- package/dist/assets/{ja-DMq-YXDX.js → ja-DZPUwZ9l.js} +1 -1
- package/dist/assets/{ko-BrYbXurh.js → ko-q4i4r9g6.js} +1 -1
- package/dist/assets/{landing-page-BJAji-kI.js → landing-page-JLA-ZD1t.js} +1 -1
- package/dist/assets/{launch-result-message-B2nhmkKt.js → launch-result-message-DJqF-slD.js} +1 -1
- package/dist/assets/{layout-CydCBGqn.js → layout-Cwvm7lmD.js} +1 -1
- package/dist/assets/{list-BIwaCPhs.js → list-3MUy-8Ol.js} +2 -2
- package/dist/assets/{list-CO8Xp7iX.js → list-BSXHuqLM.js} +1 -1
- package/dist/assets/{list-header-DQZTNnUc.js → list-header-BEZSwSji.js} +1 -1
- package/dist/assets/localization-Dond4H78.js +1 -0
- package/dist/assets/{log-JZXyzrRA.js → log-Bq445Z1e.js} +1 -1
- package/dist/assets/logger-CCAAJ2Xo.js +1 -0
- package/dist/assets/{login-CU5Tw5QB.js → login-dc2t9Qyo.js} +1 -1
- package/dist/assets/{login-method-item-KhJ672kA.js → login-method-item-CyTsqz88.js} +1 -1
- package/dist/assets/{login-oauth-callback-Bz7N73Sg.js → login-oauth-callback-Bext19kc.js} +1 -1
- package/dist/assets/{logo-uploader-DjKJkvts.js → logo-uploader-CyZuvhwV.js} +1 -1
- package/dist/assets/{lost-passport-CyJVtH1V.js → lost-passport-BiYg3QQI.js} +1 -1
- package/dist/assets/{metadata-CkzdOpl3.js → metadata-B2-Ltdko.js} +1 -1
- package/dist/assets/{nav-menu-5M0Q4jYU.js → nav-menu-DSdXRbfg.js} +1 -1
- package/dist/assets/{open-window-DphH3aTv.js → open-window-Dyu79ome.js} +1 -1
- package/dist/assets/over-due-invoice-payment-DzUsy6q0.js +1 -0
- package/dist/assets/{overview-CGIG2I_w.js → overview-0TBmi-_i.js} +1 -1
- package/dist/assets/{page-header-B0HpJClf.js → page-header-qdK3sAJh.js} +1 -1
- package/dist/assets/{passport-DKYg_d4G.js → passport-BhEaZ-sr.js} +1 -1
- package/dist/assets/{passport-item-CjcqN_g-.js → passport-item-DHwif94N.js} +1 -1
- package/dist/assets/{permission-DhyiLNfC.js → permission-CvrrGfG6.js} +1 -1
- package/dist/assets/preferences-BBSWzZiT.js +1 -0
- package/dist/assets/profile-embed-shcOdRUI.js +1 -0
- package/dist/assets/{provider-icon-DX-QfJQN.js → provider-icon-DO2PqSth.js} +1 -1
- package/dist/assets/{pt-Dl6732JN.js → pt-BFCHl6F1.js} +1 -1
- package/dist/assets/{publish-resource-vCC9AfJK.js → publish-resource-CMuHIOUf.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-bkXlrjYw.js → react-beautiful-dnd.esm-CWJ5I9Zv.js} +1 -1
- package/dist/assets/{react-stripe.esm-BBCEegrE.js → react-stripe.esm-B-FTN8ep.js} +1 -1
- package/dist/assets/{required-11pmtzQr.js → required-DnQpCGsD.js} +1 -1
- package/dist/assets/{ru-CVUeN9AX.js → ru-CSTl62kK.js} +1 -1
- package/dist/assets/{runtime-BjKYEBG_.js → runtime-B_ZLP4FF.js} +1 -1
- package/dist/assets/sdk-CktKu_IW.js +1 -0
- package/dist/assets/{section-ewv0pNWr.js → section-CZylgxjz.js} +1 -1
- package/dist/assets/{security-Xrnc8Gqe.js → security-DHRU8k0u.js} +1 -1
- package/dist/assets/{session-lE2gmzzF.js → session-Bp3LV7zJ.js} +1 -1
- package/dist/assets/{setup-p5LUFpYK.js → setup-B6-Ei_3X.js} +1 -1
- package/dist/assets/{shorten-label-1iJcvGQT.js → shorten-label-CuBHsWUR.js} +1 -1
- package/dist/assets/{simple-select-BKXEgxog.js → simple-select-nI-W90c_.js} +1 -1
- package/dist/assets/{spaces-Ckljlc4d.js → spaces-ix8u0ZiI.js} +1 -1
- package/dist/assets/{start-BE-C9MhV.js → start-oRp78RMQ.js} +1 -1
- package/dist/assets/{starting-progress-DC-J-5Os.js → starting-progress-CWp5fTY0.js} +1 -1
- package/dist/assets/{status-DR5t3VVx.js → status-Dn_LKaNp.js} +1 -1
- package/dist/assets/{step-actions-CArEuzNw.js → step-actions-DIZRcnXf.js} +1 -1
- package/dist/assets/{studio-BEzAGvQT.js → studio-CVIa8-XY.js} +1 -1
- package/dist/assets/{switch-CmVFEdik.js → switch-BbyTGEOo.js} +1 -1
- package/dist/assets/{switch-control-DbLHF-NB.js → switch-control-BRjXGc1d.js} +1 -1
- package/dist/assets/{table-tips-DQIh1EQR.js → table-tips-Dvmdodc5.js} +1 -1
- package/dist/assets/{team-7-48iuwj.js → team-BTz28XqK.js} +1 -1
- package/dist/assets/{th-32eBNQes.js → th-D75Dlluo.js} +1 -1
- package/dist/assets/theme-mode-toggle-D3bcd10D.js +1 -0
- package/dist/assets/{traffic-Dwd2RNqG.js → traffic-Cea69sMW.js} +1 -1
- package/dist/assets/{transfer-BwnSX6wY.js → transfer-BydXCVCg.js} +1 -1
- package/dist/assets/unsubscribe-BjAjx-Fl.js +1 -0
- package/dist/assets/{use-app-logo-BzsLZwwK.js → use-app-logo-IRizt64R.js} +1 -1
- package/dist/assets/{use-blocklet-logo-BWPJOOVd.js → use-blocklet-logo-Cf1j7pQz.js} +1 -1
- package/dist/assets/{use-mobile-DgmmfWdl.js → use-mobile-CyUZDIaX.js} +1 -1
- package/dist/assets/{use-mobile-BSL5RsRd.js → use-mobile-DFkQ5N0b.js} +1 -1
- package/dist/assets/{use-mobile-TAIHvgoJ.js → use-mobile-DwGMuJlg.js} +1 -1
- package/dist/assets/{use-server-logo-BLcfNvrR.js → use-server-logo-KZn9RrZd.js} +1 -1
- package/dist/assets/{use-window-close-D2_118dJ.js → use-window-close-Dpj5UcYT.js} +1 -1
- package/dist/assets/{useAsyncRetry-B-Txlvk6.js → useAsyncRetry-C4R9ufi-.js} +1 -1
- package/dist/assets/{useLocalStorage-D6axLnAi.js → useLocalStorage-BQfIniHX.js} +1 -1
- package/dist/assets/{user-center-DBscV1le.js → user-center-6K47tx8j.js} +5 -5
- package/dist/assets/{user-follower-Di51icra.js → user-follower-BwzTutxU.js} +1 -1
- package/dist/assets/{util-DCHBQZpP.js → util-DkTwHdRu.js} +1 -1
- package/dist/assets/{util-ad0rjUA1.js → util-DySzCymV.js} +1 -1
- package/dist/assets/{vendor-arcblock-ivFYo5vP.js → vendor-arcblock-Dll6qxMT.js} +1 -1
- package/dist/assets/{vendor-mui-core-D7t4vMS5.js → vendor-mui-core-CV-FnYH_.js} +1 -1
- package/dist/assets/{vendor-mui-x-BpPw6UfF.js → vendor-mui-x-DwN6dcQH.js} +1 -1
- package/dist/assets/{vendor-ux-Dl3wVbv_.js → vendor-ux-CLT2i3Pv.js} +2 -2
- package/dist/assets/{vi-DF8IinAc.js → vi-D1mKYrmb.js} +1 -1
- package/dist/assets/{wait-connect-DOIonmAv.js → wait-connect-q0_7mz_u.js} +1 -1
- package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +68 -0
- package/dist/assets/{wizard-CrkxQgBY.js → wizard-C5Kl-g70.js} +1 -1
- package/dist/assets/{wizard-components-BzPyRFRt.js → wizard-components-DQrlaeeW.js} +1 -1
- package/dist/assets/wrap-locale-5DJTJTXP.js +1 -0
- package/dist/assets/{zh-DQQBhbva.js → zh-CJ9vCpmv.js} +1 -1
- package/dist/assets/{zh-ByJkLAV1.js → zh-G2I44gfs.js} +1 -1
- package/dist/assets/{zh-tw-34G9tsUP.js → zh-tw-C4Juvs-i.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +31 -31
- package/dist/assets/branding-D-ShZ8m2.js +0 -1
- package/dist/assets/button-B_Qd9K_t.js +0 -1
- package/dist/assets/domains-B9b2gmbn.js +0 -1
- package/dist/assets/engine-L1SEogaX.js +0 -1
- package/dist/assets/get-safe-url-D4zRnTpF.js +0 -1
- package/dist/assets/index-BoJbHOhC.js +0 -1
- package/dist/assets/invitations-gJ3uAWGN.js +0 -3
- package/dist/assets/localization-BYdi6ljV.js +0 -1
- package/dist/assets/logger-BMHd-C1S.js +0 -1
- package/dist/assets/over-due-invoice-payment-DD_j5vb4.js +0 -1
- package/dist/assets/preferences-DHjRWgwZ.js +0 -1
- package/dist/assets/profile-embed-Gc79_Dhj.js +0 -1
- package/dist/assets/sdk-CXEy5Pgp.js +0 -1
- package/dist/assets/theme-mode-toggle-BltDSXhy.js +0 -1
- package/dist/assets/unsubscribe-CP0mTwWi.js +0 -1
- package/dist/assets/wallet-hidden-topbar-DKISAPb3.js +0 -68
- package/dist/assets/wrap-locale-BJF_SaOe.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as mt,al as N,T as Q,V as ke,z as Fe,b5 as Ve,bP as Re,bK as Te,a6 as Ie,R as Ce,dH as Pe,aL as Ee,a7 as Ge,G as Qe,cC as ht,ae as Xe,e6 as gt,e7 as xt,aT as ae,a_ as qe,n as bt,L as yt,y as jt,bN as St,M as He,cA as vt}from"./vendor-mui-core-D7t4vMS5.js";import{e as ee,l as Ct,w as pe}from"./vendor-utils-BzQg432x.js";import{Q as H,b9 as Nt,W as Y,dq as wt,m as Ye,U as Je,b4 as Ae,aQ as Ze,bP as be,aO as Rt,bb as Tt,bk as It,bC as Et}from"./vendor-ux-Dl3wVbv_.js";import{W as At,M as q,c as E,B as Dt,_ as Ue}from"./index-Ca33rdd_.js";import{a as X,i as De}from"./vendor-hooks-DAZ1H6Va.js";import{S as me}from"./shorten-label-1iJcvGQT.js";import{v as et}from"./index-CxOxF1pg.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-BIwaCPhs.js";import{i as Pt,e as _t,N as Bt}from"./team-7-48iuwj.js";import{W as zt}from"./did-address-DRYM96gB.js";import{p as st}from"./util-DCHBQZpP.js";import{D as Wt,g as Mt}from"./traffic-Dwd2RNqG.js";import{B as nt}from"./bundle-avatar-sDqev1Fh.js";import"./vendor-arcblock-ivFYo5vP.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./session-lE2gmzzF.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-DKISAPb3.js";import"./theme-mode-toggle-BltDSXhy.js";import"./use-mobile-DgmmfWdl.js";import"./index-sb6EjUcD.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-BWPJOOVd.js";import"./use-app-logo-BzsLZwwK.js";import"./base32-Cpvj2sD4.js";import"./useAsyncRetry-B-Txlvk6.js";import"./useAsync-DfiOQMQ_.js";import"./iframe-C5nvJ0m0.js";import"./index-Ddl9fWMP.js";import"./index-DBs9Ljax.js";import"./base-chart-DWXZOkNE.js";import"./index-D1Fa760B.js";import"./vendor-mui-x-BpPw6UfF.js";import"./AdapterDayjs-BI3dme25.js";const at=x.createContext({}),{Provider:Kt,Consumer:Qs}=at;function qt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=X(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=X(()=>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?[q(T.dateRange[0]).toISOString(),q(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 H.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?[q(T.dateRange[0]).toISOString(),q(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw H.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(Kt,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ht[t],children:t})}const Ut=(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 it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=Ut(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"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=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=q().startOf("day");return t.filter(n=>q(n.sendAt).isSame(s,"day")).length},Yt=(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},Jt=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""}},lt=()=>({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(mt,{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}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(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(Ve,{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}=Y(),m=it(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}=Y(),r=q().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){H.error("Please select a date range");return}if(q(h.startDate).isAfter(h.endDate)||!q(h.startDate).isValid()||!q(h.endDate).isValid()){H.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:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Y();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(wt.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 Zt=[{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}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Zt),[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(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(Ve,{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(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Y(),l=Qe(),b=x.useMemo(()=>Ye(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({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:[q().subtract(1,"month").startOf("day").toDate(),q().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:st(c.receiverUser.avatar,h,S)}}));U(o),J(a.paging),F(!1)}catch(a){H.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(Ae,{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"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(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){H.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){H.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||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){H.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=X(()=>[{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(zt,{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(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),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(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:ft,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(ss,{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(gt,{}):e.jsx(Ge,{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(xt,{}),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(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
|
|
1
|
+
import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as mt,al as N,T as X,V as ke,z as Fe,b5 as Ve,bP as Re,bK as Te,a6 as Ie,R as Ce,dH as Pe,aL as Ee,a7 as Ge,G as Xe,cC as ht,ae as Ye,e6 as gt,e7 as xt,aT as ae,a_ as He,n as bt,L as yt,y as jt,bN as St,M as qe,cA as vt}from"./vendor-mui-core-CV-FnYH_.js";import{e as ee,l as Ct,w as pe}from"./vendor-utils-BzQg432x.js";import{Q as q,ba as Nt,W as Q,ds as wt,m as Qe,U as Je,b5 as Ae,aR as Ze,bR as be,aO as Rt,bc as Tt,bm as It,bE as Et}from"./vendor-ux-CLT2i3Pv.js";import{W as At,M as H,c as E,B as Dt,_ as Ue}from"./index-CXp5SI_f.js";import{a as Y,i as De}from"./vendor-hooks-DAZ1H6Va.js";import{S as me}from"./shorten-label-CuBHsWUR.js";import{v as et}from"./index-Di2nSesc.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-3MUy-8Ol.js";import{i as Pt,e as _t,N as Bt}from"./team-BTz28XqK.js";import{W as zt}from"./did-address-CG36eCOx.js";import{p as st}from"./util-DkTwHdRu.js";import{D as Wt,g as Mt}from"./traffic-Cea69sMW.js";import{B as nt}from"./bundle-avatar-DwiOyeMO.js";import"./vendor-arcblock-Dll6qxMT.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./session-Bp3LV7zJ.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-joIVZ1nl.js";import"./theme-mode-toggle-D3bcd10D.js";import"./use-mobile-CyUZDIaX.js";import"./index-CEJb82tA.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./use-app-logo-IRizt64R.js";import"./base32-7iZvvdX8.js";import"./useAsyncRetry-C4R9ufi-.js";import"./useAsync-DfiOQMQ_.js";import"./iframe-DUzp97tk.js";import"./index-DFUM0Pvk.js";import"./index-DBs9Ljax.js";import"./base-chart-DcZV4ZCI.js";import"./index-D1Fa760B.js";import"./vendor-mui-x-DwN6dcQH.js";import"./AdapterDayjs-CYW0YvmK.js";const at=x.createContext({}),{Provider:Kt,Consumer:Xs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Y(()=>s.meta?.did,[s]),[y,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:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const qt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:qt[t],children:t})}const Ut=(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 it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=Ut(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"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Xt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Yt=(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},Qt=(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},Jt=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""}},lt=()=>({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(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(X,{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(X,{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}=Q();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{children:[s,": "]}),t.map(l=>{const b=it(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(Ve,{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}=Q(),m=it(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}=Q(),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(X,{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:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Q();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(wt.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 Zt=[{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}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[i,l]=x.useState(Zt),[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(X,{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(Ve,{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(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Q(),l=Xe(),b=x.useMemo(()=>Qe(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({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:st(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(Ae,{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"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Xt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Yt(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(),Qt(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||Ct(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(zt,{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(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),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(ts,{children:e.jsxs(Ye,{theme:b,children:[e.jsx(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:ft,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(ss,{children:[e.jsxs(X,{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(X,{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(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(X,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),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(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
|
|
2
2
|
td.MuiTableCell-footer {
|
|
3
3
|
border: none !important;
|
|
4
4
|
}
|
|
@@ -27,7 +27,7 @@ import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as mt,al
|
|
|
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 ns(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 as(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}=
|
|
30
|
+
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ns(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 as(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}=Q(),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}=Q(),{success:b,failed:m,pending:S}=s,h=Jt(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(is,{successRatio:U,failedRatio:M,children:[e.jsxs(X,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(X,{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(Ae,{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=Y(()=>s==="simple"?ns(t):as(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(et,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(He,{container:!0,spacing:2,children:i.map(l=>e.jsx(He,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const is=ae(N)`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
align-items: flex-start;
|
|
@@ -45,7 +45,7 @@ import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as mt,al
|
|
|
45
45
|
bottom: 0;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=
|
|
48
|
+
`;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=Q(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=Y(()=>b(t.componentDid)||n,[n,t.componentDid]),v=De({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)&&!rt(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)&&!ot(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=Y(()=>Pt(t),[t]),w=Y(()=>_t(t),[t]),U=Y(()=>F?t?.actorInfo:[],[t]),M=Y(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(Ot,{actors:U,teamDid:M,size:32,showName:!0}):e.jsx(Lt,{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(kt,{notification:t,blocklet:n}):e.jsx(Bt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(It,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(et,{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(Rt,{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(rs,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(Tt,{tabs:$,current:v.tab,onChange:J,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(es,{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 os=x.memo(ut),rs=ae.div`
|
|
49
49
|
& > .notification-row {
|
|
50
50
|
padding: 0;
|
|
51
51
|
}
|
|
@@ -92,7 +92,7 @@ import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as mt,al
|
|
|
92
92
|
overflow: hidden;
|
|
93
93
|
text-overflow: ellipsis;
|
|
94
94
|
}
|
|
95
|
-
`;function ve({blocklet:t=null,label:s=""}){return e.jsx(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{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})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({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(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{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})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{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 cs(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ds({customTableButtons:t}){const{t:s,locale:n}=Q(),r=Xe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Qe(r,lt()),[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=Et(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=Y(()=>{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(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{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(qe,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(qe,{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(nt,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Ft,{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(vt,{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=st(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(pt,{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(cs,{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(tt,{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(us,{isBreakpointsDownSm:i,children:e.jsx(Ye,{theme:l,children:e.jsx(Ze,{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(os,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const us=ae.div`
|
|
96
96
|
td.MuiTableCell-footer {
|
|
97
97
|
border: none !important;
|
|
98
98
|
}
|
|
@@ -117,4 +117,4 @@ import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as mt,al
|
|
|
117
117
|
flex-wrap: wrap;
|
|
118
118
|
gap: 8px;
|
|
119
119
|
}
|
|
120
|
-
`;ps.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};function ps({blocklet:t={},customTableButtons:s=[]}){return e.jsx(
|
|
120
|
+
`;ps.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};function ps({blocklet:t={},customTableButtons:s=[]}){return e.jsx(Ht,{blocklet:t,children:e.jsx(ds,{customTableButtons:s})})}export{ps as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as H,ac as Y}from"./vendor-utils-BzQg432x.js";import{az as U,aA as B,aB as M,aC as F,aD as v}from"./index-
|
|
1
|
+
import{B as H,ac as Y}from"./vendor-utils-BzQg432x.js";import{az as U,aA as B,aB as M,aC as F,aD as v}from"./index-CXp5SI_f.js";import{e as N}from"./vendor-react-DX7tU9aY.js";var a={},$={},x;function w(){if(x)return $;x=1;var _=Object.create,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,T=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,D=(s,f,p,c)=>{if(f&&typeof f=="object"||typeof f=="function")for(var u=y(f),d=0,O=u.length,h;d<O;d++)h=u[d],!S.call(s,h)&&h!==p&&r(s,h,{get:(P=>f[P]).bind(null,h),enumerable:!(c=t(f,h))||c.enumerable});return s},l=(s,f,p)=>(p=s!=null?_(T(s)):{},D(f||!s||!s.__esModule?r(p,"default",{value:s,enumerable:!0}):p,s));return $.__toESM=l,$}var b={},k;function q(){if(k)return b;k=1;const _=w();let r=B(),t=U;t=_.__toESM(t);const y="did:abt:",T=l=>{try{if((0,r.isHexStrict)(l))return H.from((0,r.stripHexPrefix)(l),"hex");let s=(0,r.fromBase58)(l.replace(y,""));for(;s.length<26;)s=H.concat([H.from([0]),s]);return s}catch(s){throw new Error(`Cannot convert DID string to byte array: ${s.message}`)}},S=(l,s)=>(0,t.default)((0,r.toBN)(l).toString(2),s,"0"),D=(l,s)=>{const f=l.replace(/^0x/i,"");return typeof s=="number"&&s%2===0?(0,t.default)(l,s,"0"):f.length%2===0?f:`0${f}`};return b.DID_PREFIX=y,b.toBits=S,b.toBytes=T,b.toStrictHex=D,b}var m={};const X=N(Y);var C;function V(){if(C)return m;C=1;const _=w(),r=q();let t=v(),y=B(),T=M;T=_.__toESM(T);let S=X;S=_.__toESM(S);let D=F;D=_.__toESM(D);const l={pk:"key",address:"encoding"},s={role:t.types.RoleType.ROLE_ACCOUNT,pk:t.types.KeyType.ED25519,hash:t.types.HashType.SHA3,address:t.types.EncodingType.BASE58},f={role:t.types.RoleType.ROLE_PASSKEY,pk:t.types.KeyType.PASSKEY,hash:t.types.HashType.SHA2,address:t.types.EncodingType.BASE58},p={role:t.types.RoleType.ROLE_ACCOUNT,pk:t.types.KeyType.ETHEREUM,hash:t.types.HashType.KECCAK,address:t.types.EncodingType.BASE16},c=o=>{const e=["pk","hash","address"];return(0,S.default)((0,D.default)(o,e),(0,D.default)(p,e))},u=o=>{const e=(0,y.toAddress)(o);return/^(0x)?[0-9a-f]{40}$/i.test(e)?/^(0x|0X)?[0-9a-f]{40}$/.test(e)||/^(0x|0X)?[0-9A-F]{40}$/.test(e)?!0:d(e):!1},d=o=>{const e=o.replace(/^0x/i,""),i=t.Hasher.Keccak.hash256(e.toLowerCase()).replace(/^0x/i,"");for(let n=0;n<40;n++)if(parseInt(i[n],16)>7&&e[n].toUpperCase()!==e[n]||parseInt(i[n],16)<=7&&e[n].toLowerCase()!==e[n])return!1;return!0},O=o=>{if(typeof o>"u")return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(o))throw new Error(`Given address "${o}" is not a valid Ethereum address.`);const e=o.toLowerCase().replace(/^0x/i,""),i=t.Hasher.Keccak.hash256(e).replace(/^0x/i,"");let n="0x";for(let E=0;E<e.length;E++)parseInt(i[E],16)>7?n+=e[E].toUpperCase():n+=e[E];return n};function h(o={}){let e={};["default","arcblock"].includes(o)?e=s:["eth","ethereum"].includes(o)?e=p:["passkey"].includes(o)?e=f:e={...s,...o};const{role:i,pk:n,hash:E,address:R}=e;Object.keys(e).forEach(A=>{const L=(0,T.default)(`${l[A]||A}Type`);if(Object.values(t.types[L]).includes(e[A])===!1)throw new Error(`Unsupported ${A} type: ${e[A]}`)});const I={role:i,pk:n,hash:E,address:R};return c(I)===!1&&[t.types.RoleType.ROLE_NODE,t.types.RoleType.ROLE_VALIDATOR,t.types.RoleType.ROLE_TETHER,t.types.RoleType.ROLE_SWAP].includes(I.role)&&(I.hash=t.types.HashType.SHA2),I}h.toJSON=o=>Object.keys(o).reduce((e,i)=>{const n=(0,T.default)(`${l[i]||i}Type`);return e[i]=Object.keys(t.types[n])[Object.values(t.types[n]).indexOf(o[i])],e},{}),h.fromJSON=o=>Object.keys(o).reduce((e,i)=>{const n=(0,T.default)(`${l[i]||i}Type`),E=Object.keys(t.types[n]);return e[i]=Object.values(t.types[n])[E.indexOf(o[i])],e},{});const P=o=>{const e=h(o),i=`${r.toBits(e.role,6)}${r.toBits(e.pk,5)}${r.toBits(e.hash,5)}`;return r.toStrictHex((0,y.stripHexPrefix)((0,y.numberToHex)(parseInt(i,2))),4)},g=o=>{let e={};try{if(u(o))e=p;else{const i=r.toBytes(o).slice(0,2),n=r.toBits(new y.BN(r.toStrictHex(H.from(i).toString("hex")),16),16),E=n.slice(0,6),R=n.slice(6,11),I=n.slice(11,16);e={role:parseInt(E,2),pk:parseInt(R,2),hash:parseInt(I,2),address:(0,y.isHex)((0,y.toAddress)(o))?t.types.EncodingType.BASE16:t.types.EncodingType.BASE58}}return Object.keys(e).forEach(i=>{Object.values(t.types[`${(0,T.default)(l[i]||i)}Type`]).includes(e[i])===!1&&delete e[i]}),e}catch{return e}},j=o=>{const e=g(o);return Object.keys(e).reduce((i,n)=>{const E=t.types[`${(0,T.default)(l[n]||n)}Type`];return i[n]=Object.keys(E).find(R=>E[R]===e[n]),i},{})};return m.DID_TYPE_ARCBLOCK=s,m.DID_TYPE_ETHEREUM=p,m.DID_TYPE_PASSKEY=f,m.DidType=h,m.fromTypeInfo=P,m.isEthereumDid=u,m.isEthereumType=c,m.toChecksumAddress=O,m.toTypeInfo=g,m.toTypeInfoStr=j,m}var K;function W(){if(K)return a;K=1;const _=q(),r=V();let t=v(),y=B();const T=(p,c)=>{const u=r.DidType(c),d=(0,t.getSigner)(u.pk).getPublicKey(p);return S(d.indexOf("0x")===0?d:`0x${d}`,u)},S=(p,c)=>{const u=r.DidType(c);return D((0,t.getHasher)(u.hash)(p,1),u)},D=(p,c)=>{const u=r.DidType(c),d=(0,y.stripHexPrefix)(p).slice(0,40),O=(0,t.getHasher)(u.hash),h=r.fromTypeInfo(u),P=`0x${h}${d}${(0,y.stripHexPrefix)(O(`0x${h}${d}`,1)).slice(0,8)}`;return r.isEthereumType(u)?r.toChecksumAddress(`0x${p.slice(-40)}`):u.address===t.types.EncodingType.BASE58?(0,y.toBase58)(P):P},l=(p,c=t.types.RoleType.ROLE_ACCOUNT)=>{const u=Object.keys(t.types.RoleType),d=Object.values(t.types.RoleType);if(d.indexOf(c)===-1)throw new Error(`Unsupported role type ${c} when gen ddi from hash`);return D(p,r.DidType({role:t.types.RoleType[u[d.indexOf(c)]]}))},s=(p,c)=>f(p)===!1?!1:S(c,r.toTypeInfo(p))===p.replace(_.DID_PREFIX,""),f=p=>{if(!p)return!1;const c=(0,y.toAddress)(String(p)),{hash:u}=r.toTypeInfo(c);if(typeof u>"u")return!1;if(r.isEthereumDid(c))return!0;const d=(0,t.getHasher)(u),O=_.toBytes(c),h=_.toStrictHex(H.from(O.slice(0,22)).toString("hex"));return _.toStrictHex(H.from(O.slice(22,26)).toString("hex"))===(0,y.stripHexPrefix)(d(`0x${h}`,1)).slice(0,8)};return a.DID_PREFIX=_.DID_PREFIX,a.DID_TYPE_ARCBLOCK=r.DID_TYPE_ARCBLOCK,a.DID_TYPE_ETHEREUM=r.DID_TYPE_ETHEREUM,a.DID_TYPE_PASSKEY=r.DID_TYPE_PASSKEY,a.DidType=r.DidType,a.fromHash=l,a.fromPublicKey=S,a.fromPublicKeyHash=D,a.fromSecretKey=T,a.fromTypeInfo=r.fromTypeInfo,a.isEthereumDid=r.isEthereumDid,a.isEthereumType=r.isEthereumType,a.isFromPublicKey=s,a.isValid=f,a.toAddress=y.toAddress,a.toDid=y.toDid,a.toStrictHex=_.toStrictHex,a.toTypeInfo=r.toTypeInfo,a.toTypeInfoStr=r.toTypeInfoStr,a.types=t.types,a}export{X as a,W as r};
|