@abtnode/blocklet-services 1.17.8-beta-20260121-102603-f9d0176f → 1.17.8-beta-20260125-093329-64b43854
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/api/index.js +5 -0
- package/api/libs/connect/session.js +33 -39
- package/api/middlewares/launcher-login.js +1 -2
- package/api/routes/federated.js +1 -2
- package/api/routes/oauth/server.js +1 -2
- package/api/routes/user-session.js +0 -2
- package/api/routes/user.js +61 -41
- package/api/services/auth/connect/destroy-self.js +0 -2
- package/api/services/auth/connect/invite.js +0 -2
- package/api/services/auth/connect/issue-passport.js +0 -2
- package/api/services/auth/connect/receive-transfer-app-owner.js +0 -2
- package/api/services/auth/connect/verify-destroy.js +0 -2
- package/api/services/auth/connect/verify-elevated.js +0 -2
- package/api/services/auth/session.js +1 -36
- package/api/util/user-util.js +1 -2
- package/dist/assets/{AdapterDayjs-QqQc9YbA.js → AdapterDayjs-B5owpIH3.js} +1 -1
- package/dist/assets/{Google-PffSpBc2.js → Google-efeywUOs.js} +1 -1
- package/dist/assets/{access-control-B6JglGtO.js → access-control-BzsCJj-F.js} +1 -1
- package/dist/assets/{actions-DydkTgA0.js → actions-DbuL4r3Z.js} +1 -1
- package/dist/assets/{actions-Do5Z9cxZ.js → actions-Dm98-Dap.js} +2 -2
- package/dist/assets/{add-component-core-CLOpD7CB.js → add-component-core-BKVGCdxY.js} +7 -7
- package/dist/assets/add-resource-Cxa0mbrd.js +1 -0
- package/dist/assets/{addon-CrVdMlFe.js → addon-B1KwZDQ5.js} +1 -1
- package/dist/assets/advanced-B62UUhxe.js +14 -0
- package/dist/assets/{aigne-CeD5Xo7t.js → aigne-jjaGOQQ7.js} +1 -1
- package/dist/assets/{appearance-BJuIABu8.js → appearance-_ZB7EroL.js} +1 -1
- package/dist/assets/{ar-xXK-6slW.js → ar-BJmSv7rn.js} +1 -1
- package/dist/assets/{audit-logs-DxVzMUJK.js → audit-logs-DF2wcdWX.js} +2 -2
- package/dist/assets/{authorize-BxQgoA5F.js → authorize-C6nOsMWm.js} +1 -1
- package/dist/assets/{base-chart-CQOyckBN.js → base-chart-D_u2nVGm.js} +1 -1
- package/dist/assets/{base32-CyUpiYTu.js → base32-D79Y2AcQ.js} +1 -1
- package/dist/assets/{bind-account-D5gBazop.js → bind-account-BIj9FA7d.js} +1 -1
- package/dist/assets/{branding-CDPvtKJm.js → branding-BEGHWROe.js} +1 -1
- package/dist/assets/{branding-CtbvPvdK.js → branding-C86_64it.js} +1 -1
- package/dist/assets/branding-Dqv4_zpD.js +1 -0
- package/dist/assets/{bundle-avatar-2ugE80w1.js → bundle-avatar-Cy8tSSSQ.js} +1 -1
- package/dist/assets/button-DMYwcDVh.js +1 -0
- package/dist/assets/{click-to-copy-CgakrWoh.js → click-to-copy-BCjXD9Nd.js} +1 -1
- package/dist/assets/{collapse-RMuUWnK3.js → collapse-CBrasNzu.js} +1 -1
- package/dist/assets/{complete-B_lyTPVv.js → complete-CCe1VfI6.js} +1 -1
- package/dist/assets/{component-pjnMydek.js → component-DLlaIYmq.js} +2 -2
- package/dist/assets/{config-CyDF6KG9.js → config-BccEmD3I.js} +2 -2
- package/dist/assets/{config-BcCR6bUQ.js → config-C0CmuuRP.js} +1 -1
- package/dist/assets/{config-BsWCoWa6.js → config-CsQBU86s.js} +1 -1
- package/dist/assets/{config-navigation-B36NPLt0.js → config-navigation-D46rq0IX.js} +2 -2
- package/dist/assets/{config-space-DUkjNtdL.js → config-space-DLjHQVCq.js} +1 -1
- package/dist/assets/{confirm-CoDiNrSj.js → confirm-ClxC2cDv.js} +1 -1
- package/dist/assets/{connect-ULEL84iL.js → connect-9CgvkPOq.js} +1 -1
- package/dist/assets/{connect-SOuN9k8I.js → connect-C1q4hvQ3.js} +1 -1
- package/dist/assets/connect-DXjJ46DL.js +5 -0
- package/dist/assets/{connect-to-DnBUF-KE.js → connect-to-CbgQNAwh.js} +1 -1
- package/dist/assets/{content-layout-Dlmn5DW6.js → content-layout-BH_g_OCf.js} +1 -1
- package/dist/assets/{create-passport-svg-BSRyjG0k.js → create-passport-svg-Ct68e5tm.js} +1 -1
- package/dist/assets/{createClass-DKvdNmc_.js → createClass-CeMEAEuP.js} +1 -1
- package/dist/assets/{dashboard-CkDdshHQ.js → dashboard-y1fk-IQM.js} +2 -2
- package/dist/assets/{de-CzlQlDUl.js → de-B2IoQCYX.js} +1 -1
- package/dist/assets/{delete-confirm-Cq9MJasT.js → delete-confirm-CxRbnJU_.js} +1 -1
- package/dist/assets/{did-address-CtvTDc_I.js → did-address-BhAIkFPZ.js} +1 -1
- package/dist/assets/{domain-BOIdkJ_V.js → domain-CMJp7emz.js} +1 -1
- package/dist/assets/{domain-action-card-DuiLZ6sE.js → domain-action-card-CKlATj2V.js} +2 -2
- package/dist/assets/domains-CQs-XM9-.js +1 -0
- package/dist/assets/{email-DN8lH7fV.js → email-CYR31d5d.js} +2 -2
- package/dist/assets/{empty-spinner-DB1GKIOS.js → empty-spinner-DzVQ0tC1.js} +1 -1
- package/dist/assets/engine-ByRLynLu.js +1 -0
- package/dist/assets/{es-BpsyeJfJ.js → es-nlHqTKrO.js} +1 -1
- package/dist/assets/{exchange-passport-BvS_8Ud6.js → exchange-passport-BAD6oRbd.js} +1 -1
- package/dist/assets/{fallback-CuXkR699.js → fallback-CJFJeDKq.js} +1 -1
- package/dist/assets/{form-text-input-BT3t62-a.js → form-text-input-Dq_8KU_Y.js} +2 -2
- package/dist/assets/{form-wrapper-kWYD3nZz.js → form-wrapper-YOmD-sDI.js} +1 -1
- package/dist/assets/{form-CZjONW3r.js → form-zHvITlPG.js} +1 -1
- package/dist/assets/{fr-BawgvFA1.js → fr-LrrW00cI.js} +1 -1
- package/dist/assets/{fuel-dijAR437.js → fuel-CU-CpANh.js} +1 -1
- package/dist/assets/{gen-access-key-DaJCt-T5.js → gen-access-key-Fb9M1v-f.js} +1 -1
- package/dist/assets/{gen-simple-access-key-DLZy8UKi.js → gen-simple-access-key-BgYT9wM-.js} +1 -1
- package/dist/assets/get-safe-url-CCXmZ6Ty.js +1 -0
- package/dist/assets/hi-DxZE2HUh.js +5 -0
- package/dist/assets/{home-ChU7yi5l.js → home-Cy8jLKNF.js} +1 -1
- package/dist/assets/{id-_HQ0of3E.js → id-C3U8Kyb0.js} +1 -1
- package/dist/assets/{iframe-CYVXxx1r.js → iframe-CZ9tjsFz.js} +1 -1
- package/dist/assets/{index-C3UXSk-k.js → index-B-yh2KQb.js} +1 -1
- package/dist/assets/{index-DKeuwD_Y.js → index-B2LgdSh1.js} +15 -15
- package/dist/assets/{index-DswHt4-F.js → index-BJ69cdwn.js} +2 -2
- package/dist/assets/index-BJCzMYyG.js +832 -0
- package/dist/assets/{index-DF1j89BT.js → index-BZxTtTlP.js} +1 -1
- package/dist/assets/{index-Boc2cNQ7.js → index-Bg0Lw3eZ.js} +7 -7
- package/dist/assets/{index-D8oCzSQW.js → index-Bij9abGY.js} +2 -2
- package/dist/assets/{index-CD7hq5dy.js → index-BkgA3JrZ.js} +2 -2
- package/dist/assets/{index-Ci7zZ36D.js → index-BqISx1lI.js} +1 -1
- package/dist/assets/index-BsIQdVmB.js +29 -0
- package/dist/assets/{index-D7Er4cge.js → index-BtHiIOEI.js} +1 -1
- package/dist/assets/index-BtxDkXoY.js +7 -0
- package/dist/assets/{index-Dvc-Bpkc.js → index-CKgbiYHC.js} +2 -2
- package/dist/assets/{index-NHiSMvgy.js → index-CQz-yW1Q.js} +4 -4
- package/dist/assets/{index-Cax1AxL9.js → index-CSdd2W7t.js} +1 -1
- package/dist/assets/{index-CVuESID5.js → index-CYam9iu7.js} +3 -3
- package/dist/assets/{index-s8xAfo-W.js → index-CZc0agHR.js} +1 -1
- package/dist/assets/index-Cb9H09Dz.js +1 -0
- package/dist/assets/{index-B5VPb4FA.js → index-CtCzpHpi.js} +1 -1
- package/dist/assets/{index-iOa1BVMr.js → index-D0VFBmtN.js} +5 -5
- package/dist/assets/{index-CNlJloMN.js → index-D1HHdOwz.js} +2 -2
- package/dist/assets/{index-B9FojAjj.js → index-DDpk_EEp.js} +1 -1
- package/dist/assets/{index-B4A3W4qJ.js → index-DPbBn0Vu.js} +1 -1
- package/dist/assets/{index-C2O2gJSR.js → index-DbbtJMIS.js} +1 -1
- package/dist/assets/index-DgwyiIiW.js +1 -0
- package/dist/assets/{index-BVTsYhIX.js → index-Dh38UJiv.js} +1 -1
- package/dist/assets/{index-Zxy2t-7f.js → index-DvtkahBB.js} +1 -1
- package/dist/assets/{index-BDSBuO5S.js → index-Dw9kO-TK.js} +2 -2
- package/dist/assets/{index-Dn9eNAe6.js → index-E0k6Os1B.js} +1 -1
- package/dist/assets/{index-5Sys1Zsb.js → index-L6md5GCk.js} +2 -2
- package/dist/assets/{index-5RRpshJe.js → index-VTJ4vv2F.js} +7 -7
- package/dist/assets/{index-CZ-qZTKi.js → index-WY8_4PO1.js} +1 -1
- package/dist/assets/{index-uUS1eXYF.js → index-lGLHoHAP.js} +1 -1
- package/dist/assets/{index-WzGP4BGm.js → index-rh1DYsh2.js} +3 -3
- package/dist/assets/{index-B9YNNXOw.js → index-u8Hqob_G.js} +1 -1
- package/dist/assets/{index-C6vJzTmT.js → index-vQWAt26Z.js} +2 -2
- package/dist/assets/{info-outline-rounded-DovRYvXo.js → info-outline-rounded-CTki6xsp.js} +1 -1
- package/dist/assets/{invitation-DAWt0g1f.js → invitation-CrLJgh5y.js} +6 -6
- package/dist/assets/{invitations-B18y415k.js → invitations-Cs7LYbh9.js} +1 -1
- package/dist/assets/invite-B0wKu-K4.js +1 -0
- package/dist/assets/{issue-passport-Dd43b9Se.js → issue-passport-B1azomgq.js} +1 -1
- package/dist/assets/item-CcfCB60B.js +1 -0
- package/dist/assets/{ja-LErFaY57.js → ja-Cv-fddix.js} +1 -1
- package/dist/assets/{ko-D4ub28je.js → ko-Cy3G6t2o.js} +1 -1
- package/dist/assets/{landing-page-CZoTtLnc.js → landing-page-3yvA3dHp.js} +1 -1
- package/dist/assets/{launch-result-message-DJqF-slD.js → launch-result-message-CYcW9uFA.js} +1 -1
- package/dist/assets/{layout-U4Obhm5w.js → layout-DPEeowZp.js} +1 -1
- package/dist/assets/{list-D-9AeBju.js → list-BtmehYr0.js} +2 -2
- package/dist/assets/{list-header-BEZSwSji.js → list-header-DqG9VFur.js} +1 -1
- package/dist/assets/{list-BD3g0v2E.js → list-qef9ITY3.js} +1 -1
- package/dist/assets/localization-VGnaiTRr.js +1 -0
- package/dist/assets/{log-BWxaKOTA.js → log-BDLuou50.js} +1 -1
- package/dist/assets/logger-Cn2_Ur4V.js +1 -0
- package/dist/assets/{login-BWZaWrBW.js → login-BTzBeYdR.js} +1 -1
- package/dist/assets/{login-method-item-aEisznLn.js → login-method-item-T1v3TnPG.js} +1 -1
- package/dist/assets/{login-oauth-callback-CB-osgdG.js → login-oauth-callback-f1uXdv_Y.js} +1 -1
- package/dist/assets/{logo-uploader-DOPycN59.js → logo-uploader-YNwnzUQw.js} +1 -1
- package/dist/assets/{lost-passport-H1fCptmJ.js → lost-passport-Cv4fSebj.js} +2 -2
- package/dist/assets/metadata-BeJTujvj.js +55 -0
- package/dist/assets/{nav-menu-D7Sf6VZj.js → nav-menu-CefEor9d.js} +1 -1
- package/dist/assets/{open-window-By98Pw1o.js → open-window-Cq_Eb4d0.js} +1 -1
- package/dist/assets/over-due-invoice-payment-Cx9nVkCY.js +1 -0
- package/dist/assets/{overview-DEkktSML.js → overview-UWHPi3tV.js} +2 -2
- package/dist/assets/{page-header-qdK3sAJh.js → page-header-DayahqMa.js} +1 -1
- package/dist/assets/passport-D7GEY4wO.js +1 -0
- package/dist/assets/{passport-item-CIv8Q8Ng.js → passport-item-CpICtT-w.js} +1 -1
- package/dist/assets/{permission-B22pCnUb.js → permission-ozcooui7.js} +1 -1
- package/dist/assets/preferences-RHaCYv9t.js +1 -0
- package/dist/assets/profile-embed-BLPUgZl6.js +1 -0
- package/dist/assets/{provider-icon-DbnLu_85.js → provider-icon-Blmpf_9p.js} +1 -1
- package/dist/assets/pt-CLIZ5rGV.js +5 -0
- package/dist/assets/publish-resource-Cn5CEQma.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-D7zp9L4b.js → react-beautiful-dnd.esm-L71UpeRK.js} +1 -1
- package/dist/assets/{react-stripe.esm-B-FTN8ep.js → react-stripe.esm-B1zA7yon.js} +1 -1
- package/dist/assets/{required-DnQpCGsD.js → required-jUJP5eu8.js} +1 -1
- package/dist/assets/ru-DoXNa8xl.js +5 -0
- package/dist/assets/{runtime-MjoLSEeg.js → runtime-CGShJ0Po.js} +1 -1
- package/dist/assets/sdk-C05lZFmW.js +1 -0
- package/dist/assets/{section-CZylgxjz.js → section-BHNJgwmP.js} +1 -1
- package/dist/assets/{security-BtD9TnGk.js → security-_Iru3mSY.js} +1 -1
- package/dist/assets/{session-UEzmH-IS.js → session-DpYXqKUu.js} +1 -1
- package/dist/assets/{setup-Bts0WUxD.js → setup-DCnaHhf3.js} +1 -1
- package/dist/assets/{shorten-label-CuBHsWUR.js → shorten-label-NmLkBKIj.js} +1 -1
- package/dist/assets/{simple-select-C6gRUbia.js → simple-select--uh08-vW.js} +1 -1
- package/dist/assets/{spaces-DtMVp8Fn.js → spaces-gCrHfJB8.js} +1 -1
- package/dist/assets/{start-Dabk9waT.js → start-S0ZFYLEE.js} +1 -1
- package/dist/assets/{starting-progress-Ds2lnMge.js → starting-progress-BSgBADJS.js} +1 -1
- package/dist/assets/{status-CicPnfGJ.js → status-DqZ0B8Xa.js} +1 -1
- package/dist/assets/{step-actions-CnJCnymc.js → step-actions-DxJMBPwi.js} +1 -1
- package/dist/assets/{studio-D7qZJqJ7.js → studio-B2SgpXxn.js} +1 -1
- package/dist/assets/{switch-qh9YpwMi.js → switch-D9wb-oPu.js} +1 -1
- package/dist/assets/{switch-control-C5gj6NIz.js → switch-control-Dl1BCyFd.js} +1 -1
- package/dist/assets/{table-tips-BSl1oNMX.js → table-tips-C5NrUDu8.js} +1 -1
- package/dist/assets/{team-Djzt5BWc.js → team-DXPe7dCA.js} +1 -1
- package/dist/assets/th-DmzEcJam.js +5 -0
- package/dist/assets/theme-mode-toggle-BYQvzsDR.js +1 -0
- package/dist/assets/{traffic-BtuX1qMz.js → traffic-BandB_6R.js} +1 -1
- package/dist/assets/{transfer-UdrQjD9F.js → transfer-Dky9H1bl.js} +1 -1
- package/dist/assets/{unsubscribe-Bj2S8OkH.js → unsubscribe-D0la_6Ib.js} +1 -1
- package/dist/assets/{use-app-logo-DyU2iSXF.js → use-app-logo-0G6x82Xn.js} +1 -1
- package/dist/assets/{use-blocklet-logo-ys-h-CV_.js → use-blocklet-logo-IV_8xnB2.js} +1 -1
- package/dist/assets/{use-mobile-DFkQ5N0b.js → use-mobile-CEr7zhO3.js} +1 -1
- package/dist/assets/{use-mobile-DwGMuJlg.js → use-mobile-DAngW3li.js} +1 -1
- package/dist/assets/{use-mobile-CyUZDIaX.js → use-mobile-kXWiSSQD.js} +1 -1
- package/dist/assets/{use-server-logo-KZn9RrZd.js → use-server-logo-BVKQ1t0s.js} +1 -1
- package/dist/assets/{use-window-close-CT9brY7I.js → use-window-close-C-WcChaL.js} +1 -1
- package/dist/assets/{useAsync-WuOY1bFS.js → useAsync-DRrTtbU_.js} +1 -1
- package/dist/assets/{useAsync-DbIyJl2v.js → useAsync-D_y3bEgl.js} +1 -1
- package/dist/assets/{useAsyncRetry-cAGDIsw4.js → useAsyncRetry-BZ4R17gr.js} +2 -2
- package/dist/assets/useLocalStorage-C5E7FrUa.js +1 -0
- package/dist/assets/{user-center-DLgnUI1s.js → user-center-D-UOqGpV.js} +5 -5
- package/dist/assets/{user-follower-BbQfOSyh.js → user-follower-_9B1O2CU.js} +4 -4
- package/dist/assets/{util-tg9hB6_c.js → util-Bf1lWzn8.js} +1 -1
- package/dist/assets/{util-BCpVIbwL.js → util-Dn9RqFJI.js} +1 -1
- package/dist/assets/utils-eOkzHJzR.js +1 -0
- package/dist/assets/{vendor-arcblock-Xw2zMy0D.js → vendor-arcblock-B6JCofz3.js} +1 -1
- package/dist/assets/vendor-hooks-Bt9Vv36g.js +1 -0
- package/dist/assets/{vendor-mui-core-CV-FnYH_.js → vendor-mui-core-D6nniiQs.js} +2 -2
- package/dist/assets/{vendor-mui-x-DwN6dcQH.js → vendor-mui-x-Ds-5Y7YM.js} +1 -1
- package/dist/assets/{vendor-ux-BGqHwkOM.js → vendor-ux-hzekFYg2.js} +123 -123
- package/dist/assets/vi-6MG7Pp6O.js +5 -0
- package/dist/assets/{wait-connect-BED_xYYA.js → wait-connect-DmtX5SsS.js} +1 -1
- package/dist/assets/wallet-hidden-topbar-OBN14KiV.js +68 -0
- package/dist/assets/{wizard-C6DvqdjM.js → wizard-Q2Vm8Y9G.js} +1 -1
- package/dist/assets/{wizard-components-1u7l8zuE.js → wizard-components-CON7Dump.js} +1 -1
- package/dist/assets/wrap-locale-BGMozDAq.js +1 -0
- package/dist/assets/{zh-DK-_Edsp.js → zh-B9y8LJ3-.js} +1 -1
- package/dist/assets/zh-Dfkd9CXx.js +1 -0
- package/dist/assets/{zh-tw-Us2SjBNr.js → zh-tw-CbtwifV_.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +44 -44
- package/dist/assets/add-resource-ipDE-D6W.js +0 -1
- package/dist/assets/advanced-C3qjZMWH.js +0 -14
- package/dist/assets/branding-Dv3-0Q39.js +0 -1
- package/dist/assets/button-d8gvZuHP.js +0 -1
- package/dist/assets/connect--GxmDNr3.js +0 -5
- package/dist/assets/domains-C5GLc_A-.js +0 -1
- package/dist/assets/engine-Crd5Z3lP.js +0 -1
- package/dist/assets/get-safe-url-czY77v8f.js +0 -1
- package/dist/assets/hi-ClGNxnSL.js +0 -5
- package/dist/assets/index-B4EOqUNT.js +0 -1
- package/dist/assets/index-BOoRVhLj.js +0 -29
- package/dist/assets/index-DGZbt7_m.js +0 -1
- package/dist/assets/index-tRQj1y79.js +0 -6
- package/dist/assets/index-yoaLEniz.js +0 -832
- package/dist/assets/invite-DNSyQ-zG.js +0 -1
- package/dist/assets/item-Cr70mAvV.js +0 -1
- package/dist/assets/joi-browser.min-CUdv8seQ.js +0 -1
- package/dist/assets/joi-browser.min-eEVeW7LC.js +0 -1
- package/dist/assets/localization-ByZI4mSj.js +0 -1
- package/dist/assets/logger-B962sOsB.js +0 -1
- package/dist/assets/metadata-DftwYKum.js +0 -55
- package/dist/assets/over-due-invoice-payment-DeFNS-Us.js +0 -1
- package/dist/assets/passport-BxMVp3TG.js +0 -1
- package/dist/assets/preferences-BY_s4EkY.js +0 -1
- package/dist/assets/profile-embed-DUKyv_oX.js +0 -1
- package/dist/assets/pt-BU7pvSz6.js +0 -5
- package/dist/assets/publish-resource-Be5Gs98x.js +0 -1
- package/dist/assets/ru-CtjyU-qF.js +0 -5
- package/dist/assets/sdk-Dy-R7tw7.js +0 -1
- package/dist/assets/th-C0DkNnMF.js +0 -5
- package/dist/assets/theme-mode-toggle-Jvn37gNg.js +0 -1
- package/dist/assets/useLocalStorage-D8kgfBAn.js +0 -1
- package/dist/assets/vendor-hooks-164oA5kM.js +0 -1
- package/dist/assets/vi-nXB9zTif.js +0 -5
- package/dist/assets/wallet-hidden-topbar-dnCLvPpW.js +0 -68
- package/dist/assets/wrap-locale-C2lxMNe7.js +0 -1
- package/dist/assets/zh-QEwKQjt8.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 xt,al as R,T as X,V as Oe,z as Be,b5 as Ye,bP as ke,bK as De,a6 as Le,R as Re,dH as Fe,aL as Ne,a7 as Je,G as Qe,cC as bt,ae as Ze,e6 as yt,e7 as jt,aT as ae,a_ as $e,n as vt,L as St,y as wt,bN as Rt,M as _e,cA as Ct}from"./vendor-mui-core-CV-FnYH_.js";import{e as ee,l as Tt,w as pe}from"./vendor-utils-BbcnEeJI.js";import{y as $,b8 as kt,V as J,dr as Dt,m as et,E as tt,b3 as Ee,aJ as st,bP as ye,aG as Lt,ba as Nt,bk as Et,bC as It}from"./vendor-ux-BGqHwkOM.js";import{X as At,M as U,ah as He,cS as q,A as Pt,cT as Ve,cU as ge,a3 as Ge}from"./index-yoaLEniz.js";import{a as Y,i as Ie}from"./vendor-hooks-164oA5kM.js";import{S as me}from"./shorten-label-CuBHsWUR.js";import{v as nt}from"./index-B4A3W4qJ.js";import{R as at,A as Ot,S as Bt,a as Ft,B as zt}from"./list-D-9AeBju.js";import{i as Wt,e as Mt,N as Kt}from"./team-Djzt5BWc.js";import{W as qt}from"./did-address-CtvTDc_I.js";import{p as it}from"./util-tg9hB6_c.js";import{D as Ut,g as $t}from"./traffic-BtuX1qMz.js";import{B as ot}from"./bundle-avatar-2ugE80w1.js";import"./vendor-arcblock-Xw2zMy0D.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./session-UEzmH-IS.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-dnCLvPpW.js";import"./theme-mode-toggle-Jvn37gNg.js";import"./use-mobile-CyUZDIaX.js";import"./index-CZ-qZTKi.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-ys-h-CV_.js";import"./use-app-logo-DyU2iSXF.js";import"./base32-CyUpiYTu.js";import"./useAsyncRetry-cAGDIsw4.js";import"./useAsync-WuOY1bFS.js";import"./iframe-CYVXxx1r.js";import"./index-Dn9eNAe6.js";import"./index-DBs9Ljax.js";import"./base-chart-CQOyckBN.js";import"./index-B5VPb4FA.js";import"./vendor-mui-x-DwN6dcQH.js";import"./AdapterDayjs-QqQc9YbA.js";const rt=x.createContext({}),{Provider:_t,Consumer:Qs}=rt;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,v]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Y(()=>s.meta?.did,[s]),[y,S]=x.useState([]),[O,P]=x.useState({}),C=Y(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),_=async({page:p=1,pageSize:g=20,...k}={})=>{if(!h)return[];try{const N={paging:{page:p,pageSize:g},...k,teamDid:h,dateRange:k.dateRange?[U(k.dateRange[0]).toISOString(),U(k.dateRange[1]).toISOString()]:void 0},{dids:E,...z}=N;let B="";E&&E.includes("system")&&(B="system");const ie=E?E.filter(oe=>oe!=="system"):[],se={...z,source:B,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return P(se),b(Z.list),v(Z.paging),Z.list}catch(N){return $.error(N.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});S(p.componentDids)},I=x.useCallback(p=>{const g=s.children.find(k=>k.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),A=async({notificationId:p,receivers:g,channels:k,...N})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:k.map(E=>E==="wallet"?q.WALLET:E==="pushKit"?q.PUSH:E),...N}})},H=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,...k}={})=>{try{const N={paging:{page:p,pageSize:g},...k,userName:k.searchText||"",teamDid:h,dateRange:k.dateRange?[U(k.dateRange[0]).toISOString(),U(k.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:N})}catch(N){throw $.error(N.message),N}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(He.NOTIFICATION_BLOCKLET_UPDATE,p=>{C.has(p.notificationId)&&_(O)},[C,O]),i(He.NOTIFICATION_BLOCKLET_CREATE,p=>{C.has(p.id)||_(O)},[C,O]);const Q={fetch:_,data:l,paging:m,blocklet:s,getComponent:I,resendNotification:A,getUser:H,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(_t,{value:{notificationRecords:Q},children:t})}function ze(){const{notificationRecords:t}=x.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Vt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(kt,{type:Vt[t],children:t})}const Gt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case ge.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case ge.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case ge.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case ge.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Pt(i,s)}):"",v=Gt(t,b,l);return r===Ve.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:v}:r===Ve.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:v,sentTime:m}}const Ae={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Pe=["wallet","pushKit","email"],Xe=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Yt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Zt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},es=(t,s="")=>{if(s&&Pe.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return be(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const i={};return Pe.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),v=be(m);i[l]=v}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=be(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},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ts=t=>{switch(t){case q.WALLET:return"Wallet";case q.PUSH:return"Push Kit";case q.EMAIL:return"Email";case q.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,v=[l,m].filter(Boolean).join(", ");return e.jsx(xt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(X,{color:"inherit",sx:{fontSize:12},children:v}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(R,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(R,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(R,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Ae[i]}}),e.jsx(R,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Ae[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}=J();return e.jsxs(R,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{children:[s,": "]}),t.map(l=>{const b=lt(r,i,{status:l});return e.jsx(Oe,{size:"small",label:e.jsx(R,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}We.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 We({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(ke,{row:!0,children:i.map(m=>e.jsx(De,{control:e.jsx(Le,{checked:t[n].indexOf(m.value??m)>-1,onChange:v=>{const h=[...t];v.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 Te(t){return e.jsx(We,{...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}=J(),m=lt(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(R,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Re,{className:"resend-btn",size:"small",startIcon:e.jsx(Fe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}Me.propTypes={value:d.array.isRequired,onChange:d.func};function Me({value:t,onChange:s}){const{locale:n}=J(),r=U().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,v=x.useCallback(h=>{if(!h.startDate||!h.endDate){$.error("Please select a date range");return}if(U(h.startDate).isAfter(h.endDate)||!U(h.startDate).isValid()||!U(h.endDate).isValid()){$.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(Re,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Ne,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ut,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:$t(r),onChange:v})})]})}Ke.propTypes={itemComponent:d.elementType.isRequired};function Ke({itemComponent:t,...s}){const{t:n}=J();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(R,{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(Dt.TableFilterList,{...s,ItemComponent:t})})]})}function qe({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(Oe,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}qe.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ss=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=J(),[i,l]=x.useState(ss),[b,m]=x.useState(!0),v=(y,S)=>{S.checked=y.target.checked;const O=i.map(P=>({...P,checked:P.value===S.value?S.checked:P.checked}));l(O)},h=y=>{y.stopPropagation(),n({channels:i.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:b})};return e.jsxs(R,{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(R,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(ke,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(De,{control:e.jsx(Le,{checked:y.checked,onChange:S=>v(S,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(R,{className:"resend-config-footer",children:e.jsx(ke,{children:e.jsx(De,{control:e.jsx(Le,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(R,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Re,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Re,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Je,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=J(),l=Qe(),b=x.useMemo(()=>et(l,ut()),[l]),{getReceivers:m,inService:v,teamDid:h,getUser:y,blocklet:S}=ze(),[O,P]=x.useState(!1),[C,_]=x.useState([]),M=Ie({anchorEl:null,position:null}),I=Ie({anchorEl:null,position:null}),[A,H]=x.useState(null),[V,Q]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[k,N]=x.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!O&&t)try{P(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:it(c.receiverUser.avatar,h,v)}}));_(o),Q(a.paging),P(!1)}catch(a){$.error(a.message),P(!1)}};x.useEffect(()=>{z()},[p]);const B=a=>{a.stopPropagation();const o=a.currentTarget;I.anchorEl=o;const c=o.getBoundingClientRect();I.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(Ee,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Fe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,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:k,onRowSelectionChange:(a,o)=>{N(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:w})=>{const[,F=[],G=[],K=[]]=w;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(F,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:F,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Jt(c):a==="email"?Xt(S,c):a==="pushKit"?Yt(S,c):a==="webhook"?Qt(c):!0:!1},[y,S]),Ce=x.useCallback(a=>Zt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,H(null)},u=()=>{I.anchorEl=null,I.position=null},j=async(a,o,c=!0,w="")=>{if(!(!o.length||!a.length))try{s(a,o,c,w),I.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},D=async({channels:a,isResendFailedOnly:o})=>{const c=k.map(w=>C[w].receiver);await j(a,c,o),await xe(.5),u(),N([])},L=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(w){$.error(w.response?w.response.statusText:w.message)}},T=async(a,o,c,w=[],F=!0)=>{if(a.stopPropagation(),es(o,c)>=4){$.warning(r("notification.resendLimit"));return}if(!Pe.includes(c)){await L(o,w,F);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}}H({channel:c});try{const K=await oe(c,o.receiver);await xe(1),H({channel:c,result:K}),(typeof K=="boolean"&&K||Tt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],F),I.anchorEl||(await xe(.5),f()))}catch(K){$.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,w)=>{a.stopPropagation();const F=c.filter(G=>G!==o);g(G=>({...G,[w]:F,page:1}))},le=Y(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=C[a];return o?e.jsxs(R,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(tt,{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(qt,{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:E,fullWidth:!0,logic:ve,display:(a,o,c,w)=>e.jsx(Te,{label:"Wallet",filterList:a,onChange:o,index:c,column:w,filterValues:E})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:w}=C[a];return e.jsx(ce,{status:o,updatedAt:c,reason:w,channel:"wallet",onResend:F=>T(F,C[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:w}=C[a];return e.jsx(ce,{status:o,updatedAt:c,reason:w,channel:"pushkit",onResend:F=>T(F,C[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:E,fullWidth:!0,logic:ve,display:(a,o,c,w)=>e.jsx(Te,{label:"Push Kit",filterList:a,onChange:o,index:c,column:w,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:w}=C[a];return e.jsx(ce,{status:o,updatedAt:c,reason:w,channel:"email",onResend:F=>T(F,C[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:E,fullWidth:!0,logic:ve,display:(a,o,c,w)=>e.jsx(Te,{label:"Email",filterList:a,onChange:o,index:c,column:w,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=C[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[w,F]=c,G=F[0];return e.jsx(R,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(R,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:w},w),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>T(K,C[a],"webhook",[w],!1)})]},w)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=C[a];return e.jsx(at,{value:o,locale:i,shouldUpdate:!0})}}}],[C,i,p,r]),gt=[e.jsx(Me,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ee,{variant:"contained",size:"small",color:"primary",loading:O,startIcon:e.jsx(bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(R,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(Ze,{theme:b,children:[e.jsx(st,{className:"receivers-table",locale:i,loading:O,columns:le,data:C,onChange:Z,options:se,customButtons:gt,components:{TableFilterList:a=>e.jsx(Ke,{...a,itemComponent:o=>e.jsx(qe,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ne,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(is,{children:[e.jsxs(X,{variant:"body1",component:"div",className:"check-title",children:[A?.channel," Checking"]}),e.jsx(R,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ce(A?.channel).map(a=>{const{type:o,pass:c,fail:w}=a;return!A?.result||A?.result?.[o]?e.jsxs(X,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:A?.result?.[o]?ye.success.main:"inherit"},children:[A?.result?e.jsx(yt,{}):e.jsx(Je,{size:12,sx:{color:ye.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:ye.error.main},children:[e.jsx(jt,{}),e.jsx("span",{children:w})]},o)})})]})}),I.anchorEl&&e.jsx(Ne,{open:!!I.anchorEl,anchorReference:"anchorPosition",anchorPosition:I.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:u,onConfirm:D})})]})})})}const ns=x.memo(ft),as=ae.div`
|
|
1
|
+
import{r as x}from"./vendor-react-DX7tU9aY.js";import{j as e,X as d,an as xt,al as R,T as X,V as Oe,z as Be,b5 as Ye,bP as ke,bK as De,a6 as Le,R as Re,dI as Fe,aL as Ne,a7 as Qe,G as Je,cD as bt,ae as Ze,e7 as yt,e8 as jt,aT as ae,a_ as $e,n as vt,L as St,y as wt,bN as Rt,M as _e,cB as Ct}from"./vendor-mui-core-D6nniiQs.js";import{e as ee,l as Tt,w as pe}from"./vendor-utils-BbcnEeJI.js";import{y as $,b7 as kt,V as Q,du as Dt,m as et,E as tt,b2 as Ee,aI as st,bS as ye,aG as Lt,b9 as Nt,bi as Et,bA as It}from"./vendor-ux-hzekFYg2.js";import{X as At,M as U,ah as He,cS as q,A as Pt,cT as Ve,cU as ge,a3 as Ge}from"./index-BJCzMYyG.js";import{a as Y,i as Ie}from"./vendor-hooks-Bt9Vv36g.js";import{S as me}from"./shorten-label-NmLkBKIj.js";import{v as nt}from"./index-DPbBn0Vu.js";import{R as at,A as Ot,S as Bt,a as Ft,B as zt}from"./list-BtmehYr0.js";import{i as Wt,e as Mt,N as Kt}from"./team-DXPe7dCA.js";import{W as qt}from"./did-address-BhAIkFPZ.js";import{p as it}from"./util-Bf1lWzn8.js";import{D as Ut,g as $t}from"./traffic-BandB_6R.js";import{B as ot}from"./bundle-avatar-Cy8tSSSQ.js";import"./vendor-arcblock-B6JCofz3.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./session-DpYXqKUu.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-OBN14KiV.js";import"./theme-mode-toggle-BYQvzsDR.js";import"./use-mobile-kXWiSSQD.js";import"./index-WY8_4PO1.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-IV_8xnB2.js";import"./use-app-logo-0G6x82Xn.js";import"./base32-D79Y2AcQ.js";import"./useAsyncRetry-BZ4R17gr.js";import"./useAsync-DRrTtbU_.js";import"./iframe-CZ9tjsFz.js";import"./index-E0k6Os1B.js";import"./index-DBs9Ljax.js";import"./base-chart-D_u2nVGm.js";import"./index-CtCzpHpi.js";import"./vendor-mui-x-Ds-5Y7YM.js";import"./AdapterDayjs-B5owpIH3.js";const rt=x.createContext({}),{Provider:_t,Consumer:Js}=rt;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,v]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Y(()=>s.meta?.did,[s]),[y,S]=x.useState([]),[O,P]=x.useState({}),C=Y(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),_=async({page:p=1,pageSize:g=20,...k}={})=>{if(!h)return[];try{const N={paging:{page:p,pageSize:g},...k,teamDid:h,dateRange:k.dateRange?[U(k.dateRange[0]).toISOString(),U(k.dateRange[1]).toISOString()]:void 0},{dids:E,...z}=N;let B="";E&&E.includes("system")&&(B="system");const ie=E?E.filter(oe=>oe!=="system"):[],se={...z,source:B,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return P(se),b(Z.list),v(Z.paging),Z.list}catch(N){return $.error(N.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});S(p.componentDids)},I=x.useCallback(p=>{const g=s.children.find(k=>k.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),A=async({notificationId:p,receivers:g,channels:k,...N})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:k.map(E=>E==="wallet"?q.WALLET:E==="pushKit"?q.PUSH:E),...N}})},H=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,...k}={})=>{try{const N={paging:{page:p,pageSize:g},...k,userName:k.searchText||"",teamDid:h,dateRange:k.dateRange?[U(k.dateRange[0]).toISOString(),U(k.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:N})}catch(N){throw $.error(N.message),N}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(He.NOTIFICATION_BLOCKLET_UPDATE,p=>{C.has(p.notificationId)&&_(O)},[C,O]),i(He.NOTIFICATION_BLOCKLET_CREATE,p=>{C.has(p.id)||_(O)},[C,O]);const J={fetch:_,data:l,paging:m,blocklet:s,getComponent:I,resendNotification:A,getUser:H,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(_t,{value:{notificationRecords:J},children:t})}function ze(){const{notificationRecords:t}=x.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Vt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(kt,{type:Vt[t],children:t})}const Gt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case ge.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case ge.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case ge.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case ge.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Pt(i,s)}):"",v=Gt(t,b,l);return r===Ve.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:v}:r===Ve.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:v,sentTime:m}}const Ae={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Pe=["wallet","pushKit","email"],Xe=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Yt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Qt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Jt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Zt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=U().startOf("day");return t.filter(n=>U(n.sendAt).isSame(s,"day")).length},es=(t,s="")=>{if(s&&Pe.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return be(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return be(l)}const i={};return Pe.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),v=be(m);i[l]=v}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=be(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},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ts=t=>{switch(t){case q.WALLET:return"Wallet";case q.PUSH:return"Push Kit";case q.EMAIL:return"Email";case q.WEBHOOK:return"Webhook";default:return""}},ut=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,v=[l,m].filter(Boolean).join(", ");return e.jsx(xt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(X,{color:"inherit",sx:{fontSize:12},children:v}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(R,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(R,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(R,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Ae[i]}}),e.jsx(R,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Ae[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(R,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{children:[s,": "]}),t.map(l=>{const b=lt(r,i,{status:l});return e.jsx(Oe,{size:"small",label:e.jsx(R,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}We.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 We({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Be,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(ke,{row:!0,children:i.map(m=>e.jsx(De,{control:e.jsx(Le,{checked:t[n].indexOf(m.value??m)>-1,onChange:v=>{const h=[...t];v.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 Te(t){return e.jsx(We,{...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=lt(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(R,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Re,{className:"resend-btn",size:"small",startIcon:e.jsx(Fe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}Me.propTypes={value:d.array.isRequired,onChange:d.func};function Me({value:t,onChange:s}){const{locale:n}=Q(),r=U().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,v=x.useCallback(h=>{if(!h.startDate||!h.endDate){$.error("Please select a date range");return}if(U(h.startDate).isAfter(h.endDate)||!U(h.startDate).isValid()||!U(h.endDate).isValid()){$.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(Re,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ge(t[0],n)," - ",Ge(t[1],n)]})}),e.jsx(Ne,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ut,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:$t(r),onChange:v})})]})}Ke.propTypes={itemComponent:d.elementType.isRequired};function Ke({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(R,{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(Dt.TableFilterList,{...s,ItemComponent:t})})]})}function qe({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(Oe,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}qe.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ss=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[i,l]=x.useState(ss),[b,m]=x.useState(!0),v=(y,S)=>{S.checked=y.target.checked;const O=i.map(P=>({...P,checked:P.value===S.value?S.checked:P.checked}));l(O)},h=y=>{y.stopPropagation(),n({channels:i.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:b})};return e.jsxs(R,{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(R,{className:"choose-channel",children:e.jsxs(Be,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(ke,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(De,{control:e.jsx(Le,{checked:y.checked,onChange:S=>v(S,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(R,{className:"resend-config-footer",children:e.jsx(ke,{children:e.jsx(De,{control:e.jsx(Le,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(R,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Re,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Re,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Qe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Q(),l=Je(),b=x.useMemo(()=>et(l,ut()),[l]),{getReceivers:m,inService:v,teamDid:h,getUser:y,blocklet:S}=ze(),[O,P]=x.useState(!1),[C,_]=x.useState([]),M=Ie({anchorEl:null,position:null}),I=Ie({anchorEl:null,position:null}),[A,H]=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:[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),[k,N]=x.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!O&&t)try{P(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:it(c.receiverUser.avatar,h,v)}}));_(o),J(a.paging),P(!1)}catch(a){$.error(a.message),P(!1)}};x.useEffect(()=>{z()},[p]);const B=a=>{a.stopPropagation();const o=a.currentTarget;I.anchorEl=o;const c=o.getBoundingClientRect();I.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(Ee,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Fe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,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:k,onRowSelectionChange:(a,o)=>{N(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:w})=>{const[,F=[],G=[],K=[]]=w;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(F,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:F,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Qt(c):a==="email"?Xt(S,c):a==="pushKit"?Yt(S,c):a==="webhook"?Jt(c):!0:!1},[y,S]),Ce=x.useCallback(a=>Zt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,H(null)},u=()=>{I.anchorEl=null,I.position=null},j=async(a,o,c=!0,w="")=>{if(!(!o.length||!a.length))try{s(a,o,c,w),I.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},D=async({channels:a,isResendFailedOnly:o})=>{const c=k.map(w=>C[w].receiver);await j(a,c,o),await xe(.5),u(),N([])},L=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(w){$.error(w.response?w.response.statusText:w.message)}},T=async(a,o,c,w=[],F=!0)=>{if(a.stopPropagation(),es(o,c)>=4){$.warning(r("notification.resendLimit"));return}if(!Pe.includes(c)){await L(o,w,F);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}}H({channel:c});try{const K=await oe(c,o.receiver);await xe(1),H({channel:c,result:K}),(typeof K=="boolean"&&K||Tt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],F),I.anchorEl||(await xe(.5),f()))}catch(K){$.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,w)=>{a.stopPropagation();const F=c.filter(G=>G!==o);g(G=>({...G,[w]:F,page:1}))},le=Y(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=C[a];return o?e.jsxs(R,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(tt,{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(qt,{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:E,fullWidth:!0,logic:ve,display:(a,o,c,w)=>e.jsx(Te,{label:"Wallet",filterList:a,onChange:o,index:c,column:w,filterValues:E})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:w}=C[a];return e.jsx(ce,{status:o,updatedAt:c,reason:w,channel:"wallet",onResend:F=>T(F,C[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:w}=C[a];return e.jsx(ce,{status:o,updatedAt:c,reason:w,channel:"pushkit",onResend:F=>T(F,C[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:E,fullWidth:!0,logic:ve,display:(a,o,c,w)=>e.jsx(Te,{label:"Push Kit",filterList:a,onChange:o,index:c,column:w,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:w}=C[a];return e.jsx(ce,{status:o,updatedAt:c,reason:w,channel:"email",onResend:F=>T(F,C[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:E,fullWidth:!0,logic:ve,display:(a,o,c,w)=>e.jsx(Te,{label:"Email",filterList:a,onChange:o,index:c,column:w,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=C[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[w,F]=c,G=F[0];return e.jsx(R,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(R,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:w},w),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>T(K,C[a],"webhook",[w],!1)})]},w)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=C[a];return e.jsx(at,{value:o,locale:i,shouldUpdate:!0})}}}],[C,i,p,r]),gt=[e.jsx(Me,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ee,{variant:"contained",size:"small",color:"primary",loading:O,startIcon:e.jsx(bt,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(R,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(Ze,{theme:b,children:[e.jsx(st,{className:"receivers-table",locale:i,loading:O,columns:le,data:C,onChange:Z,options:se,customButtons:gt,components:{TableFilterList:a=>e.jsx(Ke,{...a,itemComponent:o=>e.jsx(qe,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ne,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(is,{children:[e.jsxs(X,{variant:"body1",component:"div",className:"check-title",children:[A?.channel," Checking"]}),e.jsx(R,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ce(A?.channel).map(a=>{const{type:o,pass:c,fail:w}=a;return!A?.result||A?.result?.[o]?e.jsxs(X,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:A?.result?.[o]?ye.success.main:"inherit"},children:[A?.result?e.jsx(yt,{}):e.jsx(Qe,{size:12,sx:{color:ye.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:ye.error.main},children:[e.jsx(jt,{}),e.jsx("span",{children:w})]},o)})})]})}),I.anchorEl&&e.jsx(Ne,{open:!!I.anchorEl,anchorReference:"anchorPosition",anchorPosition:I.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:u,onConfirm:D})})]})})})}const ns=x.memo(ft),as=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 xt,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 os(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 rs(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:q.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:q.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:q.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:q.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ue.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 os(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 rs(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:q.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:q.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:q.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:q.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ue.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(R,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(R,{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=q.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=Q(),{success:b,failed:m,pending:v}=s,h=ts(t),y=n?b.length:b,S=n?m.length:m,O=n?v.length:v,P=async I=>{I.stopPropagation();const A=n?[...new Set([...b,...m].map(H=>H))]:[];await r([t],[],!0,A)},C=y+S,_=C>0?y/C*100:0,M=C>0?S/C*100:0;return e.jsxs(ls,{successRatio:_,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:Ae.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(R,{className:"unsent-area",children:[e.jsxs(R,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(O)," ",l("notification.sendStatus.pending")]})]}),S>0&&e.jsx(R,{className:"resend-btn",children:e.jsx(Ee,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Fe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:P,children:l("notification.resend")})})]})]})}function Ue({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=Y(()=>s==="simple"?os(t):rs(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(nt,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx($e,{container:!0,spacing:2,children:i.map(l=>e.jsx($e,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const ls=ae(R)`
|
|
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 xt,al
|
|
|
45
45
|
bottom: 0;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
`;mt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function mt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=
|
|
48
|
+
`;mt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function mt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=Q(),{getComponent:b,resendNotification:m}=ze(),[v,h]=x.useState(!1),y=Y(()=>b(t.componentDid)||n,[n,t.componentDid]),S=Ie({tab:r||"info"}),O=x.useCallback(async(p,g,k=!0,N=[])=>{if(!p.length||!t.id)return;const E=g.length>0?g:t?.receivers?.map(B=>B.receiver);if(!E.length)return;let z=[...p];if(z.includes(q.PUSH)&&!dt(n)&&($.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(B=>B!==q.PUSH)),z.includes(q.EMAIL)&&!ct(n)&&($.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(B=>B!==q.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:E,channels:z,resendFailedOnly:k,...z.includes("webhook")&&N.length?{webhookUrls:N}:{}}),$.success("Message has been sent!")}catch(B){console.error("handleResend error",{error:B}),$.error(B.response?B.response.statusText:B.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),P=Y(()=>Wt(t),[t]),C=Y(()=>Mt(t),[t]),_=Y(()=>P?t?.actorInfo:[],[t]),M=Y(()=>n?.did||n?.meta?.did||"",[n]);function I(){return[{name:i("notification.from"),value:P&&C?e.jsx(Ot,{actors:_,teamDid:M,size:32,showName:!0}):e.jsx(Bt,{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:P?e.jsx(Ft,{notification:t,blocklet:n}):e.jsx(Kt,{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(nt,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const A={info:{label:i("common.basicInfo"),value:"info",component:I},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},H=Object.values(A).map(({label:p,value:g})=>({label:p,value:g})),V=A[S.tab]||A.info,J=p=>{S.tab=p};return e.jsx(Lt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ds,{children:[e.jsx(R,{className:"tabs",sx:{mx:3},children:e.jsx(Nt,{tabs:H,current:S.tab,onChange:J,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(ns,{notificationId:t.id,resending:v,handleResend:O}),S.tab==="statistics"&&e.jsx(Ue,{statistics:t.statistics,mode:"detail",resending:v,onResend:O}),S.tab==="info"&&e.jsx(V.component,{})]})]})})}const cs=x.memo(mt),ds=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 xt,al
|
|
|
92
92
|
overflow: hidden;
|
|
93
93
|
text-overflow: ellipsis;
|
|
94
94
|
}
|
|
95
|
-
`;function we({blocklet:t=null,label:s=""}){return e.jsx(us,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(ot,{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})})}ht.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ht({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(R,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{children:[s,": "]}),t.map(r=>e.jsx(Oe,{size:"small",label:e.jsx(R,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function ps(t){return e.jsx(We,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function fs({customTableButtons:t}){const{t:s,locale:n}=
|
|
95
|
+
`;function we({blocklet:t=null,label:s=""}){return e.jsx(us,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(ot,{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})})}ht.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function ht({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(R,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{children:[s,": "]}),t.map(r=>e.jsx(Oe,{size:"small",label:e.jsx(R,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function ps(t){return e.jsx(We,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function fs({customTableButtons:t}){const{t:s,locale:n}=Q(),r=Je(),i=St(r.breakpoints.down("sm")),l=x.useMemo(()=>et(r,ut()),[r]),[b,m]=x.useState(!1),{data:v,paging:h,blocklet:y,fetch:S,getComponent:O,componentDids:P,inService:C,teamDid:_}=ze(),M=x.useRef(null),[I,A]=x.useState(null),[H,V]=x.useState("info"),J=`notification-records-${y.meta?.did}`,p=It(J),[g,k]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[U().subtract(1,"month").startOf("day").toDate(),U().endOf("day").toDate()]}),N=Y(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;P.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[P,y]),E=async f=>{try{m(!0),await S(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{E(g)},[g]),x.useEffect(()=>{const f=v.find(u=>u.id===I?.id);I&&f&&A({...f})},[v]);const z=(f,u,j,D)=>{f.stopPropagation();const L=j.filter(T=>T!==u);k(T=>({...T,[D]:L,page:1}))},B=({page:f,rowsPerPage:u,filterList:j})=>{const[D=[],,,,L=[]]=j;g.pageSize!==u?k(T=>({...T,pageSize:u,page:1})):g.page!==f+1?k(T=>({...T,page:f+1})):pe(g.dids,D)?pe(g.severities,L)||k(T=>({...T,severities:L,page:1})):k(T=>({...T,dids:D,page:1}))},ie=x.useCallback(()=>{A(null),V("info")},[]),se=x.useCallback(()=>{S(g)},[S,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 D=N.find(L=>(L.did||L.meta?.did)===u);return e.jsx(we,{blocklet:D,label:D?.title||D?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:N,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,D)=>e.jsxs(Be,{style:{width:"380px"},children:[e.jsx(wt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Rt,{multiple:!0,value:f[j],renderValue:L=>e.jsx(R,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:L.map(T=>{if(T==="system")return e.jsx("span",{children:s("notification.system")},T);const re=N.find(ne=>(ne.did||ne.meta?.did)===T);return e.jsx(we,{blocklet:re,label:re?.title||re?.meta?.title},T)})}),onChange:L=>{f[j]=L.target.value,u(f[j],j,D)},children:[e.jsx(_e,{value:"system",children:s("notification.system")}),N.map(L=>{const T=L.did||L.meta?.did;return e.jsx(_e,{value:T,children:e.jsx(we,{blocklet:L,label:L.title||L.meta?.title})},T)})]})]})},customBodyRenderLite:f=>{const u=v[f],j=O(u.componentDid);return e.jsxs(R,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(ot,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(zt,{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=v[f],{receivers:j}=u;return e.jsx(Ct,{total:j.length,renderSurplus:D=>D<100?e.jsxs("span",{children:["+",D]}):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:D=>{D.stopPropagation(),A(u),V("receivers")},children:j.map(D=>{const{receiverUser:L}=D;if(!L)return null;const T=it(L.avatar,_,C);return e.jsx(tt,{alt:L.fullName,src:`${T}?imageFilter=resize&w=48&h=48`,size:32,did:D.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},D.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=v[f];return e.jsx(R,{onClick:j=>{j.stopPropagation(),A(u),V("statistics")},children:e.jsx(Ue,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=v[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=v[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(ht,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,Z[4].options.filterList,"severities")}}),update:je},filterOptions:{names:Xe,fullWidth:!0,logic:ve,display:(f,u,j,D)=>e.jsx(ps,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:D,filterValues:Xe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=v[f];return e.jsx(at,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{k(u=>({...u,dateRange:f,page:1}))},Ce=[...t||[]];return e.jsxs(R,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(ms,{isBreakpointsDownSm:i,children:e.jsx(Ze,{theme:l,children:e.jsx(st,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:Z,data:v,durable:J,onChange:B,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})=>{A(v[u])}},title:e.jsx(Me,{value:g.dateRange,onChange:oe}),customButtons:Ce,components:{TableFilterList:f=>e.jsx(Ke,{...f,itemComponent:u=>e.jsx(qe,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),I&&e.jsx(cs,{refresh:se,onCancel:ie,notification:I,blocklet:y,tab:H})]})}const ms=ae.div`
|
|
96
96
|
td.MuiTableCell-footer {
|
|
97
97
|
border: none !important;
|
|
98
98
|
}
|