@abtnode/blocklet-services 1.17.7 → 1.17.8-beta-20260106-113136-b3c09e14
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/routes/blocklet.js +26 -2
- package/api/util/blocklet-utils.js +15 -0
- package/dist/assets/{AdapterDayjs-CIz_EOtQ.js → AdapterDayjs-DafRMFLg.js} +1 -1
- package/dist/assets/Community-3AO97CCq.js +1 -0
- package/dist/assets/{Google-UUKF9aLU.js → Google-DRu937I3.js} +1 -1
- package/dist/assets/Holiday-CqSw2e8m.js +1 -0
- package/dist/assets/Meeting-DKbNRI16.js +1 -0
- package/dist/assets/OffSick-BvEREz3_.js +1 -0
- package/dist/assets/WorkingRemotely-DNtYHcSB.js +1 -0
- package/dist/assets/{access-control-BvVaKG93.js → access-control-cgo5Z15_.js} +1 -1
- package/dist/assets/{add-component-core-DuwLtUBl.js → add-component-core-BfzNEcS5.js} +7 -7
- package/dist/assets/{add-resource-DSF4-AYI.js → add-resource-CYRgZ1ps.js} +1 -1
- package/dist/assets/addon-qN24wAb4.js +14 -0
- package/dist/assets/advanced-1Vu6rcXU.js +14 -0
- package/dist/assets/{aigne-B-7qxD7r.js → aigne-D6MrXXCU.js} +1 -1
- package/dist/assets/api-DwxIBXZs.js +1 -0
- package/dist/assets/{appearance-DpKwY0o1.js → appearance-DOQHBg9p.js} +1 -1
- package/dist/assets/arrow-down.svg-7ME6T1BL.js +1 -0
- package/dist/assets/{audit-logs-BW1TvN0z.js → audit-logs-ISyoqJFp.js} +2 -2
- package/dist/assets/{authorize-BwNdnPft.js → authorize-B9RLEFal.js} +1 -1
- package/dist/assets/{base-chart-ChBZtUEG.js → base-chart-DhxjAyBU.js} +1 -1
- package/dist/assets/base32-_D4eWUeh.js +1 -0
- package/dist/assets/bind-account-CLIjYy96.js +1 -0
- package/dist/assets/{branding-40UKivXV.js → branding-C81Kt22j.js} +1 -1
- package/dist/assets/{branding-CUwzFTtf.js → branding-iwUveEf5.js} +2 -2
- package/dist/assets/branding-myiZl37D.js +1 -0
- package/dist/assets/{bundle-avatar-DJ_-4AO_.js → bundle-avatar-Cc_6nw01.js} +1 -1
- package/dist/assets/button-D-lyR9BW.js +1 -0
- package/dist/assets/{click-to-copy-CBd8B_uk.js → click-to-copy-CMo42VnK.js} +1 -1
- package/dist/assets/cloneDeep-BY8zW7hH.js +1 -0
- package/dist/assets/{complete-DCZaPQL5.js → complete-CJ_buCAS.js} +4 -4
- package/dist/assets/{component-CIlZ9gz_.js → component-Dip3v1Iq.js} +3 -3
- package/dist/assets/config-44sI5I0w.js +53 -0
- package/dist/assets/{config-DCwReZ_J.js → config-D5KnWqfn.js} +1 -1
- package/dist/assets/{config-BFSglxmm.js → config-D8XZj8JI.js} +2 -2
- package/dist/assets/{config-navigation-D47x55_t.js → config-navigation-Ni0iczgA.js} +8 -8
- package/dist/assets/config-space-B6_f52sE.js +1 -0
- package/dist/assets/{confirm-DQlu79Sm.js → confirm-Lb1MrAdS.js} +1 -1
- package/dist/assets/connect-0OZVqJvc.js +1 -0
- package/dist/assets/connect-B9GQZEi7.js +5 -0
- package/dist/assets/connect-BV6BUhDJ.css +1 -0
- package/dist/assets/connect-JAX_oP3o.js +5 -0
- package/dist/assets/{connect-to-B_iWUbwW.js → connect-to-Djgj6TLg.js} +1 -1
- package/dist/assets/{create-passport-svg-BwkPTICE.js → create-passport-svg-5AYzBKFb.js} +1 -1
- package/dist/assets/createClass-DXYd7BIe.js +1 -0
- package/dist/assets/{dashboard-Bu3a5Px4.js → dashboard-C0l2IWWH.js} +7 -7
- package/dist/assets/{delete-confirm-BIuv3oO4.js → delete-confirm-tbfLqDBI.js} +1 -1
- package/dist/assets/did-address-CsOJBoiY.js +1 -0
- package/dist/assets/{domain--lKnmb8L.js → domain-CnhOsdmM.js} +1 -1
- package/dist/assets/{domain-action-card-B5bWcTCx.js → domain-action-card-BsdHbhEi.js} +2 -2
- package/dist/assets/domains-DRP2VSvO.js +1 -0
- package/dist/assets/edit.svg-CTE5eATX.js +1 -0
- package/dist/assets/email-Dt_DGuhf.js +17 -0
- package/dist/assets/engine-BXGX_w-S.js +1 -0
- package/dist/assets/exchange-passport-DztKvBat.js +1 -0
- package/dist/assets/{form-DcGl-E0U.js → form-DoC8uBcB.js} +3 -3
- package/dist/assets/{form-text-input-DNXpKwew.js → form-text-input-XjloVwBd.js} +2 -2
- package/dist/assets/{fuel-tsazXQKp.js → fuel-IaJHNPPW.js} +1 -1
- package/dist/assets/gen-access-key-BJlDqEhI.js +1 -0
- package/dist/assets/gen-simple-access-key-lyiUw0C-.js +1 -0
- package/dist/assets/get-safe-url-BiNPujaX.js +1 -0
- package/dist/assets/google-icon-vNOJy67F.js +1 -0
- package/dist/assets/{home-BN59HeAP.js → home-Bs_5YPbK.js} +1 -1
- package/dist/assets/{iframe-CC7bnIjL.js → iframe-Dqu4MSyW.js} +1 -1
- package/dist/assets/{index-ByMKy0IO.js → index-1HKgA-fz.js} +1 -1
- package/dist/assets/{index-keEY0SLH.js → index-B10SG1vs.js} +1 -1
- package/dist/assets/{index-CbjFdIdE.js → index-B4KKUWng.js} +2 -2
- package/dist/assets/{index-Bg5uZrWj.js → index-B4YCnemd.js} +1 -1
- package/dist/assets/index-B6DWjLJS.js +281 -0
- package/dist/assets/{index-H8MAN7us.js → index-B7_VUEoc.js} +1 -1
- package/dist/assets/index-B9LF8Bep.js +1 -0
- package/dist/assets/index-BDH_LtJL.js +1 -0
- package/dist/assets/{index-5n0QAOjO.js → index-BGhqVqit.js} +1 -1
- package/dist/assets/{index-D4cbtlCM.js → index-BNhv-9xy.js} +3 -3
- package/dist/assets/{index-BmeJ3mXz.js → index-BSZtxRM0.js} +2 -2
- package/dist/assets/{index-CLao_b9r.js → index-BWDWEkUF.js} +1 -1
- package/dist/assets/{index-CH-EXqMX.js → index-BWL6HE0j.js} +1 -1
- package/dist/assets/{index-D3AsXyHs.js → index-B_SjLIbT.js} +7 -7
- package/dist/assets/{index-mL2PjDd3.js → index-BhhZ8IDZ.js} +13 -13
- package/dist/assets/{index-JhIOETr8.js → index-BkePHcyK.js} +9 -9
- package/dist/assets/{index-DlTghgU6.js → index-BmXPp3DU.js} +1 -1
- package/dist/assets/{index-D1SIrheh.js → index-BsohFwTm.js} +1 -1
- package/dist/assets/index-CI_uwh_J.js +81 -0
- package/dist/assets/index-CQgzjKgB.js +1039 -0
- package/dist/assets/{index-Bc7P9fwl.js → index-CRZM3CKo.js} +2 -2
- package/dist/assets/index-CbiyJRV7.js +1 -0
- package/dist/assets/{index-BJ6le4Td.js → index-Cp0b8q3A.js} +1 -1
- package/dist/assets/{index-DJEbIkF6.js → index-Cq6z7yeF.js} +4 -4
- package/dist/assets/index-DT5AXPVB.js +200 -0
- package/dist/assets/{index-CNUfol2K.js → index-DctZHPFL.js} +1 -1
- package/dist/assets/{index-D0cfNfgL.js → index-Dfx19arA.js} +6 -6
- package/dist/assets/index-DhHvANH8.js +93 -0
- package/dist/assets/index-DrCTi6nm.css +1 -0
- package/dist/assets/{index-ETdrsXsn.js → index-G6Vk78zE.js} +3 -3
- package/dist/assets/{index-DMjWlw40.js → index-TYwJnR0n.js} +23 -23
- package/dist/assets/{index-CoWxyxJt.js → index-dbYkWwF4.js} +1 -1
- package/dist/assets/index-vP1T6V7V.js +120 -0
- package/dist/assets/info-outline-rounded-BIwvgXCK.js +1 -0
- package/dist/assets/invitation-CYFN9u5t.js +177 -0
- package/dist/assets/invitations-jY13RXbI.js +3 -0
- package/dist/assets/invite-D72FvaiG.js +1 -0
- package/dist/assets/{isURL-D4WfF4w_.js → isURL-CJRImg0N.js} +2 -2
- package/dist/assets/issue-passport-BfqkJF3W.js +1 -0
- package/dist/assets/{item-CwiqvF0e.js → item-5ZWPft2s.js} +1 -1
- package/dist/assets/landing-page-DRtId3hN.js +1 -0
- package/dist/assets/{layout-CdGgFfY4.js → layout-Be1KH57_.js} +1 -1
- package/dist/assets/{list-CVN6FKdL.js → list-CHI1rCEg.js} +3 -3
- package/dist/assets/list-CQtiNSih.js +2 -0
- package/dist/assets/localization-CKE-bHgd.js +1 -0
- package/dist/assets/lock.svg-CiT4rEpi.js +1 -0
- package/dist/assets/{log-Cox3P5_L.js → log-BfCFT05M.js} +1 -1
- package/dist/assets/logger-DU7baop2.js +1 -0
- package/dist/assets/login-BtsH3IvI.js +1 -0
- package/dist/assets/{login-oauth-callback-zq4hRJXC.js → login-oauth-callback-Ds4uYiRr.js} +1 -1
- package/dist/assets/{logo-uploader-6T6d75Q6.js → logo-uploader-lepUW_D7.js} +3 -3
- package/dist/assets/{lost-passport-DviehTF2.js → lost-passport-BtN3h1ya.js} +2 -2
- package/dist/assets/omit-CCIQ0Qdi.js +1 -0
- package/dist/assets/{open-window-_3kVydQ2.js → open-window-CNt8gsrN.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-rAHkUVgY.js → over-due-invoice-payment-7TbnqqKX.js} +1 -1
- package/dist/assets/{overview-DSB1dlE4.js → overview-Be3tncsL.js} +3 -3
- package/dist/assets/passport-CkJ4B4CG.js +1 -0
- package/dist/assets/passport-item-Bhbm8_m6.js +1 -0
- package/dist/assets/{permission-CcdJMHov.js → permission-BHvrn0M5.js} +1 -1
- package/dist/assets/preferences-TFWtUYLy.js +1 -0
- package/dist/assets/profile-embed-B9f9hlSS.js +1 -0
- package/dist/assets/provider-icon-DQY2_LaP.js +1 -0
- package/dist/assets/publish-resource-CyvkVMG_.js +1 -0
- package/dist/assets/question-mark-circle.svg-GhTaklFN.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-DDZ1XDH7.js → react-beautiful-dnd.esm-D0JKrMDl.js} +4 -4
- package/dist/assets/revoke.svg-DUoaRyPZ.js +1 -0
- package/dist/assets/runtime-npJC4gp_.js +1 -0
- package/dist/assets/{sanitize-yVk8VEIO.js → sanitize-C-shWbtD.js} +1 -1
- package/dist/assets/sdk-CoWDgSLO.js +1 -0
- package/dist/assets/security-nSKpCl8B.js +22 -0
- package/dist/assets/server-logo-notext.svg-BLAdvsmP.js +1 -0
- package/dist/assets/{session-D-wwXXFW.js → session-C2ZBRIpv.js} +1 -1
- package/dist/assets/{setup-CgcKBlmf.js → setup-krkSJpAg.js} +1 -1
- package/dist/assets/simple-select-i16Vwzvl.js +1 -0
- package/dist/assets/{spaces-DGJd1uEt.js → spaces-BdZ_Rv3s.js} +1 -1
- package/dist/assets/start-y3zrboBQ.js +187 -0
- package/dist/assets/{starting-progress-DpUpXo1N.js → starting-progress-DI-J-VlX.js} +1 -1
- package/dist/assets/status-B8pB_mTB.js +1 -0
- package/dist/assets/{step-actions-BKMeYA5x.js → step-actions-B1ufIDaK.js} +1 -1
- package/dist/assets/{studio-BzkFXY4W.js → studio-1jwq0HOw.js} +1 -1
- package/dist/assets/{switch-CWBW7iKo.js → switch-CetbUrYR.js} +1 -1
- package/dist/assets/{switch-control-D9D8FbX3.js → switch-control-_85hc9FG.js} +1 -1
- package/dist/assets/{table-tips-B9_goTLn.js → table-tips-CMt22HEy.js} +1 -1
- package/dist/assets/team-DDjNXwXE.js +146 -0
- package/dist/assets/{traffic-DsUQQR3F.js → traffic-mcbpWOFq.js} +1 -1
- package/dist/assets/transfer-C66c3bWd.js +16 -0
- package/dist/assets/unsubscribe-Cvz0OKhq.js +1 -0
- package/dist/assets/{use-app-logo-BKJ912HX.js → use-app-logo-BuyF983S.js} +1 -1
- package/dist/assets/use-server-logo-Pbr_UuiI.js +1 -0
- package/dist/assets/{use-window-close-BVOSCf9h.js → use-window-close-B16QghYq.js} +1 -1
- package/dist/assets/{useAsync-DVl73fmG.js → useAsync-BVTh1KYj.js} +1 -1
- package/dist/assets/{useAsync-Dotoxibi.js → useAsync-ZGLJQow7.js} +1 -1
- package/dist/assets/{useAsyncRetry-r8dEPb-x.js → useAsyncRetry-BMmRgSGm.js} +1 -1
- package/dist/assets/{useLocalStorage-BmGa-RG8.js → useLocalStorage-De-EuH_M.js} +1 -1
- package/dist/assets/user-center-DQSoqc_z.js +125 -0
- package/dist/assets/user-follower-TTyja_sV.js +32 -0
- package/dist/assets/{util-DQmPydCJ.js → util-DuMKfKo8.js} +1 -1
- package/dist/assets/{util-CznlXimv.js → util-Ff3hwYmy.js} +1 -1
- package/dist/assets/{vendor-arcblock-DyliHtVF.js → vendor-arcblock-Cnwtqa7s.js} +19 -19
- package/dist/assets/{vendor-hooks-qxhUUbW5.js → vendor-hooks-BQWlJm53.js} +2 -2
- package/dist/assets/{vendor-utils-CxWN1dT3.js → vendor-utils-DCMKu06e.js} +3 -3
- package/dist/assets/{vendor-ux-IiqHAjMq.js → vendor-ux-B0gV9NvH.js} +92 -95
- package/dist/assets/{wait-connect-Co7Po2HJ.js → wait-connect-CRZmfXOA.js} +1 -1
- package/dist/assets/{wizard-tGxr6THv.js → wizard-B41kI39b.js} +1 -1
- package/dist/assets/{wizard-components-qCiwxNk8.js → wizard-components-Bn72hVOe.js} +2 -2
- package/dist/assets/wrap-locale-CF46rj6q.js +1 -0
- package/dist/assets/{zh-DL3Su93_.js → zh-BmX_fuoi.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +49 -49
- package/dist/assets/Community-CELsDteM.js +0 -1
- package/dist/assets/Holiday-DOCjSYjH.js +0 -1
- package/dist/assets/Meeting-BAXt_LiK.js +0 -1
- package/dist/assets/OffSick-BGEr8Nkc.js +0 -1
- package/dist/assets/WorkingRemotely-BcneAIXG.js +0 -1
- package/dist/assets/addon-CAO5ZUVe.js +0 -14
- package/dist/assets/advanced-D-_qy4C4.js +0 -14
- package/dist/assets/api-FQQlzPOP.js +0 -1
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +0 -1
- package/dist/assets/base32-CmNHdxL7.js +0 -1
- package/dist/assets/bind-account-DOG2XJ6s.js +0 -1
- package/dist/assets/branding-lvlhWE2R.js +0 -1
- package/dist/assets/button-82FUWQ2H.js +0 -1
- package/dist/assets/cloneDeep-C2rlAYcK.js +0 -1
- package/dist/assets/config-Dzr61Ovu.js +0 -53
- package/dist/assets/config-space-D2mAEqFL.js +0 -1
- package/dist/assets/connect-Dd7NRVCL.js +0 -1
- package/dist/assets/connect-II0vWvpi.js +0 -5
- package/dist/assets/createClass-DVDZaC6q.js +0 -1
- package/dist/assets/did-address-h4uLp20A.js +0 -1
- package/dist/assets/domains-DTnBb4pb.js +0 -1
- package/dist/assets/edit.svg-RRSklUg-.js +0 -1
- package/dist/assets/email-bOQg3Ln3.js +0 -17
- package/dist/assets/engine-_hdQizRi.js +0 -1
- package/dist/assets/exchange-passport-B8J1z6zW.js +0 -1
- package/dist/assets/gen-access-key-DrfFQLFL.js +0 -1
- package/dist/assets/gen-simple-access-key-CnP2yUd7.js +0 -1
- package/dist/assets/get-safe-url-DaqBo3hv.js +0 -1
- package/dist/assets/index-55ZI5Xlz.js +0 -200
- package/dist/assets/index-BDmLm9RE.js +0 -93
- package/dist/assets/index-BORuOqqa.js +0 -1
- package/dist/assets/index-ByEZTgqv.js +0 -120
- package/dist/assets/index-CXyo5mo3.js +0 -1
- package/dist/assets/index-DG0EDext.js +0 -1039
- package/dist/assets/index-DPByvHrj.js +0 -281
- package/dist/assets/index-DZyT0N9R.js +0 -81
- package/dist/assets/index-DrVXX4fX.css +0 -1
- package/dist/assets/invitation-0lU4EchQ.js +0 -177
- package/dist/assets/invitations-CSnyD-Wp.js +0 -3
- package/dist/assets/invite-8i_Oru_O.js +0 -1
- package/dist/assets/issue-passport-Br15qs7n.js +0 -1
- package/dist/assets/landing-page-q4NMkyjD.js +0 -1
- package/dist/assets/list-NP-91JKf.js +0 -2
- package/dist/assets/localization-DAE0Xt60.js +0 -1
- package/dist/assets/lock.svg-BgybwZNe.js +0 -1
- package/dist/assets/logger-BKK0qIc9.js +0 -1
- package/dist/assets/login-2zmJhcBe.js +0 -1
- package/dist/assets/omit-spWLSLbo.js +0 -1
- package/dist/assets/passport-DzlmGAGE.js +0 -1
- package/dist/assets/passport-item-DdvT-U5C.js +0 -1
- package/dist/assets/preferences-B3FTkTJx.js +0 -1
- package/dist/assets/profile-embed-Ds6zLGgv.js +0 -1
- package/dist/assets/publish-resource-CAbbkAX0.js +0 -1
- package/dist/assets/question-mark-circle.svg-CByEVDhb.js +0 -1
- package/dist/assets/revoke.svg-CNl4LAbv.js +0 -1
- package/dist/assets/runtime-BKJMYAui.js +0 -1
- package/dist/assets/sdk-DkjNLRKY.js +0 -1
- package/dist/assets/security-3Y4MabOo.js +0 -22
- package/dist/assets/server-logo-notext.svg-xZ-i1SpD.js +0 -1
- package/dist/assets/simple-select-qqtCC0US.js +0 -1
- package/dist/assets/start-Cu_Xr7Yd.js +0 -187
- package/dist/assets/status-qiMZo73y.js +0 -1
- package/dist/assets/team-DvyWlb8W.js +0 -146
- package/dist/assets/transfer-BU2gLE9m.js +0 -16
- package/dist/assets/unsubscribe-DpfMHut2.js +0 -1
- package/dist/assets/use-server-logo-Cv1kAPgB.js +0 -1
- package/dist/assets/user-center-8NTN-2CY.js +0 -125
- package/dist/assets/user-follower-C-xe6Fqb.js +0 -32
- package/dist/assets/wrap-locale-BdDblHwV.js +0 -1
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q as Z}from"./vendor-hooks-qxhUUbW5.js";import{j as e,ak as t,at as $,b6 as Y,a6 as E,aZ as He,am as G,br as Ge,U as Ye,T as B,a3 as Ke,W as S,z as O,M as J,I as _,dZ as ge,bi as ye,A as Ve,x as Ze,cs as Je,ct as ee,ca as Qe,F as Xe,bZ as es,s as ss}from"./vendor-mui-core-DnR6WYuU.js";import{V as A,aL as W,aX as ts,aP as ae,b2 as se,H as D,w as N,au as re,bq as je,q as ve,aV as as,b9 as rs}from"./vendor-ux-IiqHAjMq.js";import{Z as P,C as os,Q as be,c as M,G as X,Y as ns,q as is,J as ls,e as V,ck as cs}from"./index-DG0EDext.js";import{W as oe}from"./did-address-h4uLp20A.js";import{b as z}from"./team-DvyWlb8W.js";import{r as ne,a as ie,b as le,c as Se,d as Q,e as ds,u as ps,f as us}from"./passport-item-DdvT-U5C.js";import{p as Ce}from"./util-DQmPydCJ.js";import{u as ms}from"./use-mobile-BINJTzMb.js";import{O as H}from"./index-ByMKy0IO.js";import{w as q,P as fs}from"./permission-CcdJMHov.js";import{C as xs}from"./Google-UUKF9aLU.js";import{c as hs}from"./create-passport-svg-BwkPTICE.js";import{A as gs}from"./vendor-arcblock-DyliHtVF.js";import{G as K,ay as ys}from"./vendor-utils-CxWN1dT3.js";import{e as we}from"./edit.svg-RRSklUg-.js";import{H as ce,b as js}from"./index-BDmLm9RE.js";import{C as Te}from"./confirm-DQlu79Sm.js";import{L as Ie}from"./list-header-Cl3jykCe.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-D-wwXXFW.js";import"./isURL-D4WfF4w_.js";import"./use-app-logo-BKJ912HX.js";import"./ua-parser-DP5omx3I.js";import"./base32-CmNHdxL7.js";import"./cloneDeep-C2rlAYcK.js";import"./lock.svg-BgybwZNe.js";const me="info";function De({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=Ue({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(Pe,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Ae,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Le,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(W,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(bs,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ts,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}De.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const bs=$(t)`
|
|
2
|
-
margin-top: -16px;
|
|
3
|
-
|
|
4
|
-
.tabs {
|
|
5
|
-
margin-left: 0;
|
|
6
|
-
margin-right: 0;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.body {
|
|
10
|
-
margin-top: 24px;
|
|
11
|
-
}
|
|
12
|
-
`;function Pe({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=ms(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ye,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:Q(s.source)}]}];return e.jsxs(Ss,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Ce(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(B,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ke,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(B,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}Pe.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Ss=$(Y)`
|
|
13
|
-
.info-card {
|
|
14
|
-
margin-bottom: 24px;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.card-content {
|
|
19
|
-
display: flex;
|
|
20
|
-
gap: 32px;
|
|
21
|
-
padding: 24px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.passport-image {
|
|
25
|
-
flex-shrink: 0;
|
|
26
|
-
transition: transform 0.2s ease-in-out;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
transform: scale(1.05);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.info-area {
|
|
35
|
-
flex: 1;
|
|
36
|
-
width: 100%;
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
gap: 16px;
|
|
40
|
-
overflow: auto;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.info-header {
|
|
44
|
-
padding-bottom: 16px;
|
|
45
|
-
border-bottom: 1px solid;
|
|
46
|
-
border-color: ${({theme:c})=>c.palette.divider};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.info-grid {
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
gap: 8px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.info-item {
|
|
56
|
-
display: flex;
|
|
57
|
-
gap: 8px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.info-label {
|
|
61
|
-
flex-shrink: 0;
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
gap: 8px;
|
|
65
|
-
width: 100px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.logs-card {
|
|
69
|
-
.card-header {
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: center;
|
|
72
|
-
gap: 8px;
|
|
73
|
-
padding: 16px 24px;
|
|
74
|
-
border-bottom: 1px solid;
|
|
75
|
-
border-color: ${({theme:c})=>c.palette.divider};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.MuiTimeline-root {
|
|
79
|
-
padding: 24px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.MuiTimelineContent-root {
|
|
83
|
-
padding: 0px 16px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.MuiTimelineDot-root {
|
|
87
|
-
margin: 0;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
`,ke=10,Re=1;function Ae({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=v.useState({pageSize:ke,page:Re}),{data:l,loading:r}=Z(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=v.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=v.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ds(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(Ge,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>os(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},T={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:T,loading:r,onChange:g})})}Ae.propTypes={passport:S.object.isRequired};function Le({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=v.useState({pageSize:ke,page:Re}),{data:r,loading:n}=Z(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=v.useMemo(()=>r?.passports||[],[r?.passports]),m=v.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>Se(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:Q}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(b=>({...b,pageSize:o,page:1})):d.page!==a+1&&l(b=>({...b,page:a+1}))},T=v.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},b){if(T.current?.contains(b.target)){const j=h[o];s(j)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsxs(Y,{spacing:1,children:[e.jsx(He,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:T,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Le.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=ns(),{t:f}=A(),[i,d]=v.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?gs(u.appDid):l,[n,h]=v.useState(r),m=async()=>{const g=[{key:ls.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(T){D.error(T.message)}finally{d(!1)}};return e.jsx(W,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(E,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(xs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:hs({scope:"passport",role:"owner",title:"Owner",issuer:is.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Cs=q(de,"mutate_team"),ws=q(de,"",X);function Ts(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Cs,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Ne=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Ne.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Is=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function ze({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=v.useState(!1),[h,m]=v.useState(p.issuerDid||""),[g,T]=v.useState(p.remark||""),[x,a]=v.useState(K(p.mappings)||[]),o=u.findIndex(j=>j.issuerDid===p.issuerDid),b=async()=>{if(r)return;const j={issuerDid:h,remark:g,mappings:x.map(w=>({...w,to:{...w.to,ttl:w.to.ttl||0}}))},C=[...u];o===-1?C.unshift(j):C[o]=j;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await V(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(w){n(!1),D.error(te(w))}};return e.jsx(W,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>b(),color:"primary",disabled:!Is(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(E,{size:16}),l("common.save")]})]}),children:e.jsx(Ds,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:j=>{m(j.target.value)}}),e.jsx(O,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:j=>{T(j.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(j=>{const C=[...j];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((j,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:j.from.passport,onChange:w=>{const{value:k}=w.target;a(L=>{const U=[...L];return U[C].from.passport=k,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Ne,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:w=>{a(k=>{const L=[...k];return L[C].to.role=w.target.value,L})},variant:"outlined",children:i.filter(w=>w.name!=="owner").map(w=>e.jsx(J,{value:w.name,"data-cy":`passport-mapping-select-option-${w.name}`,children:e.jsx("span",{children:w.title||w.name})},w.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(_,{onClick:()=>{a(w=>{const k=[...w];return k.splice(C,1),k})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ds=$.div`
|
|
91
|
-
.dialog-h1 {
|
|
92
|
-
font-size: 18px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.list {
|
|
96
|
-
.MuiIconButton-root {
|
|
97
|
-
svg {
|
|
98
|
-
fill: #bfbfbf;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
`;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=v.useState(null),[r,n]=v.useState(!1),[h,m]=v.useState(!1),[g,T]=v.useState(""),x=async o=>{if(r)return;const b=f.findIndex(C=>C.issuerDid===o);b===-1&&D.error("Cannot find passports");const j=[...f];j.splice(b,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:j}}),await V(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(As,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(Ie,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ve.toAddress(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(we,{})}),e.jsx(_,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{mode:h.mode,data:h.data,trustedPassports:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Ps=q(pe,"mutate_team"),ks=q(pe,"",X);function Rs(c){const{inService:s}=P();return s?e.jsx(ks,{...c}):e.jsx(Ps,{...c})}const As=$.div`
|
|
103
|
-
.list {
|
|
104
|
-
.MuiIconButton-root {
|
|
105
|
-
svg {
|
|
106
|
-
fill: #bfbfbf;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
`;var Ls=ys();const fe=$e(Ls);function Ee({onCancel:c,onSuccess:s,data:p={},trustedFactories:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=vs({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:p.factoryAddress||"",remark:p.remark||"",role:p.passport?.role||"member",ttlPolicy:p.passport?.ttlPolicy||"never",ttl:fe(+p.passport?.ttl||365*24*60*60*1e3),error:""}),h=u.findIndex(a=>a.factoryAddress===p.factoryAddress),m=async()=>{if(r.loading)return;const{factoryAddress:a,remark:o,role:b,ttlPolicy:j,ttl:C}=r,w={factoryAddress:a,remark:o,passport:{role:b,ttlPolicy:j,ttl:j==="never"?0:fe(C)}},k=[...u];h===-1?k.unshift(w):k[h]=w;try{n({loading:!0}),await f.configTrustedFactories({input:{teamDid:d,trustedFactories:k}}),await V(800),D.success(l("common.saveSuccess")),s()}catch(L){console.error(L),D.error(te(L))}finally{n({loading:!1})}};v.useEffect(()=>{const a=r.fetched.find(b=>b.address===r.factoryAddress),o=r.errored.find(b=>b.address===r.factoryAddress);ve.isValid(r.factoryAddress)&&!r.fetching&&!a&&!o&&(n({fetching:!0}),cs(M.MAIN_CHAIN_ENDPOINT).getFactoryState({address:r.factoryAddress}).then(j=>{j.state?n({fetching:!1,fetched:[...r.fetched.filter(C=>C.address!==r.factoryAddress),j.state],remark:j.state.name}):n({fetching:!1,errored:[...r.errored.filter(C=>C.address!==r.factoryAddress),{address:r.factoryAddress}],error:l("team.passport.factory404",r)})}).catch(j=>{console.error(j),n({fetching:!1,error:te(j)})}))},[r.factoryAddress,r.fetching]);let g=r.error;const T=r.factoryAddress?r.errored.find(a=>a.address===r.factoryAddress):null;!g&&T&&(g=l("team.passport.factory404",r));const x=r.factoryAddress?r.fetched.find(a=>a.address===r.factoryAddress):null;return!g&&x&&(g=x.description),g||(g=l("team.passport.factoryAddressTip")),e.jsx(W,{title:l("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>m(),color:"primary",disabled:!r.factoryAddress||!r.remark||!r.role||r.loading||r.error||T,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[r.loading&&e.jsx(E,{size:16}),l("common.save")]})]}),children:e.jsx(Ns,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,error:!!r.error||!!T,"data-cy":"input-factory-address",label:l("team.passport.factoryAddress"),helperText:g,value:r.factoryAddress,onChange:a=>{n({factoryAddress:a.target.value,error:""})},slotProps:{input:{endAdornment:r.fetching?e.jsx(Ve,{position:"end",children:e.jsx(E,{size:16})}):null}}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:l("common.remark"),value:r.remark,onChange:a=>{n({remark:a.target.value})}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:l("team.passport.role"),select:!0,value:r.role,onChange:a=>{n({role:a.target.value})},variant:"outlined",children:i.filter(a=>a.name!=="owner").map(a=>e.jsx(J,{value:a.name,"data-cy":`passport-role-select-option-${a.name}`,children:e.jsx("span",{children:a.title||a.name})},a.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Ze,{children:l("team.passport.ttl")}),e.jsxs(Je,{color:"primary",size:"small",value:r.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(a,o)=>n({ttlPolicy:o}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(G,{title:l("team.passport.ttlNeverTip"),children:e.jsx(B,{children:l("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(G,{title:l("team.passport.ttlMintTip"),children:e.jsx(B,{children:l("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(G,{title:l("team.passport.ttlExchangeTip"),children:e.jsx(B,{children:l("team.passport.ttlExchange")})})})]}),r.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(Qe,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:r.ttl,onChange:a=>{n({ttl:a.target.value})}}),e.jsx(Xe,{children:l("team.passport.ttlTip")})]})]})]})})})}Ee.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedFactories:S.array,data:S.object};const Ns=$.div`
|
|
111
|
-
.dialog-h1 {
|
|
112
|
-
font-size: 18px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.list {
|
|
116
|
-
.MuiIconButton-root {
|
|
117
|
-
svg {
|
|
118
|
-
fill: #bfbfbf;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=v.useState(null),[r,n]=v.useState(!1),[h,m]=v.useState(null),[g,T]=v.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(b=>b.factoryAddress!==o)}}),await V(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(b){n(!1),D.error(b.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Bs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(Ie,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(je,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:T,searchClose:()=>T(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(as,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(we,{})}),e.jsx(_,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ee,{data:h.data,trustedFactories:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const zs=q(ue,"mutate_team"),Es=q(ue,"",X);function Fs(c){const{inService:s}=P();return s?e.jsx(Es,{...c}):e.jsx(zs,{...c})}const Bs=$.div`
|
|
123
|
-
.list {
|
|
124
|
-
.MuiIconButton-root {
|
|
125
|
-
svg {
|
|
126
|
-
fill: #bfbfbf;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
`;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=v.useState(!1),[h,m]=v.useState(!1),[g,T]=v.useState(!1),[x,a]=v.useState(!1),[o,b]=v.useState(!1),j=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await V(800),D.success(s("common.configSuccess"))}catch(w){D.error(w.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(fs,{permission:u?"":"mutate_team",role:u?X:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>T(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(E,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{b(!0)},children:s("team.passport.view")})})}),h&&e.jsx(Rs,{onCancel:()=>m(!1)}),g&&e.jsx(Fs,{onCancel:()=>T(!1)}),r&&e.jsx(Ts,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(W,{open:!0,maxWidth:"lg",onClose:()=>b(!1),onBackdropClick:()=>b(!1),onEscapeKeyDown:()=>b(!1),title:s("team.passport.view"),children:e.jsx(js,{createPassportSvg:c,onCancel:()=>b(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Be=qe.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Ce(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Be.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Os({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=ps(),{inService:d}=P(),[l,r]=v.useState(!1),n=`passports-${p}`,h=rs(n),[m,g]=v.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:T,loading:x}=Z(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=Z(async()=>{const y={};m.role!==xe&&(y.role=m.role),m.status&&(y.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:y,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:y=>D.error(y.message)}),b=y=>T?.find(R=>R.key===y)?.value||0,j=v.useMemo(()=>Object.keys(i).map(y=>({name:y,title:i[y],num:b(y)})),[T,b]),C=v.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Be,{createPassportSvg:c,passport:R,teamDid:p}),e.jsx(t,{children:ne(R.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:y=>ie(y,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:y=>Se(y,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:us}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(y,{rowIndex:I})=>{const R=a?.passports[I];return R.parentDid?Q("recover"):Q(R.source)}}}],[u,f,a?.passports,p,c,d]),w=y=>{g(I=>({...I,role:y,page:1}))},k=({page:y,rowsPerPage:I,searchText:R})=>{m.pageSize!==I?g(F=>({...F,searchText:"",pageSize:I,page:1})):m.page!==y+1?g(F=>({...F,searchText:"",page:y+1})):m.searchText!==R&&g(F=>({...F,searchText:R,page:1}))},L=v.useRef(null),U=a?.passports||[],Oe=m.searchText?U.filter(y=>y.id.includes(m.searchText)||(y?.user?.fullName||"").includes(m.searchText)):U,Me={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(y,{dataIndex:I},R){if(L.current?.contains(R.target)){const F=a?.passports[I];r(F)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},_e=y=>{g(I=>({...I,status:y.target.value,page:1}))},We=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(es,{size:"small",value:m.status,onChange:_e,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(J,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(y=>e.jsx(J,{value:y,sx:{py:1},children:u(`team.passport.statusMap.${y}`)},y))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(E,{})})}):e.jsxs(Ms,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:j.map(y=>e.jsxs(t,{className:`tab ${m.role===y.name?"active":""}`,onClick:()=>w(y.name),children:[e.jsx("span",{className:"text",children:y.title}),e.jsx(t,{sx:{color:"text.secondary"},children:y.num})]},y.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Oe,columns:C,options:Me,loading:o,onChange:k,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:We})})]}),l&&e.jsx(De,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Os.propTypes={createPassportSvg:S.func.isRequired};const Ms=ss(t)`
|
|
131
|
-
.main {
|
|
132
|
-
.left {
|
|
133
|
-
width: 256px;
|
|
134
|
-
flex-shrink: 0;
|
|
135
|
-
|
|
136
|
-
.tabs {
|
|
137
|
-
padding-top: 16px;
|
|
138
|
-
.tab {
|
|
139
|
-
display: flex;
|
|
140
|
-
justify-content: space-between;
|
|
141
|
-
align-items: center;
|
|
142
|
-
padding: 8px 16px;
|
|
143
|
-
transition: background 0.4s;
|
|
144
|
-
|
|
145
|
-
width: 256px;
|
|
146
|
-
height: 36px;
|
|
147
|
-
border-radius: 8px;
|
|
148
|
-
|
|
149
|
-
cursor: pointer;
|
|
150
|
-
user-select: none;
|
|
151
|
-
|
|
152
|
-
&:nth-child(n + 2) {
|
|
153
|
-
margin-top: 24px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
&.active {
|
|
157
|
-
background-color: ${({theme:c})=>c.palette.grey[100]};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
&:hover {
|
|
161
|
-
background-color: ${({theme:c})=>c.palette.grey[100]};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.text {
|
|
165
|
-
font-weight: 400;
|
|
166
|
-
font-size: 16px;
|
|
167
|
-
line-height: 19px;
|
|
168
|
-
color: ${({theme:c})=>c.palette.text.primary};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.badge {
|
|
172
|
-
display: flex;
|
|
173
|
-
flex-shrink: 0;
|
|
174
|
-
justify-content: center;
|
|
175
|
-
align-items: center;
|
|
176
|
-
width: 20px;
|
|
177
|
-
height: 20px;
|
|
178
|
-
border-radius: 100%;
|
|
179
|
-
color: #fff;
|
|
180
|
-
background: #666666;
|
|
181
|
-
font-size: 10px;
|
|
182
|
-
font-weight: 400;
|
|
183
|
-
&.is-rect {
|
|
184
|
-
width: auto;
|
|
185
|
-
border-radius: 8px;
|
|
186
|
-
padding: 0 4px;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
@media (max-width: ${c=>c.theme.breakpoints.values.md}px) {
|
|
192
|
-
display: none;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
.right {
|
|
196
|
-
flex: 1;
|
|
197
|
-
overflow: auto;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
`;export{Os as default};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import{r as j,g as ge}from"./vendor-react-CTtPmzVP.js";import{j as o,T as H,z as $,x as ye,cs as ve,ct as Y,ca as je,F as Ce,bf as Te,aZ as Fe,a6 as U,W as C,bX as be,a5 as we,I as K,at as Z,ak as B,Q as Se,bi as Be,J as De,am as Re}from"./vendor-mui-core-DnR6WYuU.js";import{Z as E,aL as ae,G as le,c as Ne}from"./index-DG0EDext.js";import{V as M,aL as ce,w as L,H as z,a1 as ee,ba as Pe}from"./vendor-ux-IiqHAjMq.js";import{e as ue}from"./edit.svg-RRSklUg-.js";import{C as He}from"./lock.svg-BgybwZNe.js";import{G as Ie,T as Le}from"./vendor-utils-CxWN1dT3.js";import{f as pe}from"./index-DBs9Ljax.js";import{b as de}from"./team-DvyWlb8W.js";import{w as me,P as Ee}from"./permission-CcdJMHov.js";import{C as Me}from"./confirm-DQlu79Sm.js";const _e=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));var A={exports:{}},W={exports:{}},te;function ke(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};W.exports=m}()),W.exports}var V,re;function ne(){if(re)return V;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return V=u,V}/*!
|
|
2
|
-
* Determine if an object is a Buffer
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/var O,se;function qe(){if(se)return O;se=1,O=function(a){return a!=null&&(u(a)||m(a)||!!a._isBuffer)};function u(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function m(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&u(a.slice(0,0))}return O}var ie;function $e(){return ie||(ie=1,function(){var u=ke(),m=ne().utf8,a=qe(),c=ne().bin,l=function(p,d){p.constructor==String?d&&d.encoding==="binary"?p=c.stringToBytes(p):p=m.stringToBytes(p):a(p)?p=Array.prototype.slice.call(p,0):!Array.isArray(p)&&p.constructor!==Uint8Array&&(p=p.toString());for(var s=u.bytesToWords(p),f=p.length*8,n=1732584193,t=-271733879,r=-1732584194,e=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[f>>>5]|=128<<f%32,s[(f+64>>>9<<4)+14]=f;for(var v=l._ff,g=l._gg,y=l._hh,h=l._ii,i=0;i<s.length;i+=16){var F=n,D=t,R=r,w=e;n=v(n,t,r,e,s[i+0],7,-680876936),e=v(e,n,t,r,s[i+1],12,-389564586),r=v(r,e,n,t,s[i+2],17,606105819),t=v(t,r,e,n,s[i+3],22,-1044525330),n=v(n,t,r,e,s[i+4],7,-176418897),e=v(e,n,t,r,s[i+5],12,1200080426),r=v(r,e,n,t,s[i+6],17,-1473231341),t=v(t,r,e,n,s[i+7],22,-45705983),n=v(n,t,r,e,s[i+8],7,1770035416),e=v(e,n,t,r,s[i+9],12,-1958414417),r=v(r,e,n,t,s[i+10],17,-42063),t=v(t,r,e,n,s[i+11],22,-1990404162),n=v(n,t,r,e,s[i+12],7,1804603682),e=v(e,n,t,r,s[i+13],12,-40341101),r=v(r,e,n,t,s[i+14],17,-1502002290),t=v(t,r,e,n,s[i+15],22,1236535329),n=g(n,t,r,e,s[i+1],5,-165796510),e=g(e,n,t,r,s[i+6],9,-1069501632),r=g(r,e,n,t,s[i+11],14,643717713),t=g(t,r,e,n,s[i+0],20,-373897302),n=g(n,t,r,e,s[i+5],5,-701558691),e=g(e,n,t,r,s[i+10],9,38016083),r=g(r,e,n,t,s[i+15],14,-660478335),t=g(t,r,e,n,s[i+4],20,-405537848),n=g(n,t,r,e,s[i+9],5,568446438),e=g(e,n,t,r,s[i+14],9,-1019803690),r=g(r,e,n,t,s[i+3],14,-187363961),t=g(t,r,e,n,s[i+8],20,1163531501),n=g(n,t,r,e,s[i+13],5,-1444681467),e=g(e,n,t,r,s[i+2],9,-51403784),r=g(r,e,n,t,s[i+7],14,1735328473),t=g(t,r,e,n,s[i+12],20,-1926607734),n=y(n,t,r,e,s[i+5],4,-378558),e=y(e,n,t,r,s[i+8],11,-2022574463),r=y(r,e,n,t,s[i+11],16,1839030562),t=y(t,r,e,n,s[i+14],23,-35309556),n=y(n,t,r,e,s[i+1],4,-1530992060),e=y(e,n,t,r,s[i+4],11,1272893353),r=y(r,e,n,t,s[i+7],16,-155497632),t=y(t,r,e,n,s[i+10],23,-1094730640),n=y(n,t,r,e,s[i+13],4,681279174),e=y(e,n,t,r,s[i+0],11,-358537222),r=y(r,e,n,t,s[i+3],16,-722521979),t=y(t,r,e,n,s[i+6],23,76029189),n=y(n,t,r,e,s[i+9],4,-640364487),e=y(e,n,t,r,s[i+12],11,-421815835),r=y(r,e,n,t,s[i+15],16,530742520),t=y(t,r,e,n,s[i+2],23,-995338651),n=h(n,t,r,e,s[i+0],6,-198630844),e=h(e,n,t,r,s[i+7],10,1126891415),r=h(r,e,n,t,s[i+14],15,-1416354905),t=h(t,r,e,n,s[i+5],21,-57434055),n=h(n,t,r,e,s[i+12],6,1700485571),e=h(e,n,t,r,s[i+3],10,-1894986606),r=h(r,e,n,t,s[i+10],15,-1051523),t=h(t,r,e,n,s[i+1],21,-2054922799),n=h(n,t,r,e,s[i+8],6,1873313359),e=h(e,n,t,r,s[i+15],10,-30611744),r=h(r,e,n,t,s[i+6],15,-1560198380),t=h(t,r,e,n,s[i+13],21,1309151649),n=h(n,t,r,e,s[i+4],6,-145523070),e=h(e,n,t,r,s[i+11],10,-1120210379),r=h(r,e,n,t,s[i+2],15,718787259),t=h(t,r,e,n,s[i+9],21,-343485551),n=n+F>>>0,t=t+D>>>0,r=r+R>>>0,e=e+w>>>0}return u.endian([n,t,r,e])};l._ff=function(p,d,s,f,n,t,r){var e=p+(d&s|~d&f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._gg=function(p,d,s,f,n,t,r){var e=p+(d&f|s&~f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._hh=function(p,d,s,f,n,t,r){var e=p+(d^s^f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._ii=function(p,d,s,f,n,t,r){var e=p+(s^(d|~f))+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._blocksize=16,l._digestsize=16,A.exports=function(p,d){if(p==null)throw new Error("Illegal argument "+p);var s=u.wordsToBytes(l(p,d));return d&&d.asBytes?s:d&&d.asString?c.bytesToString(s):u.bytesToHex(s)}}()),A.exports}var ze=$e();const Ae=ge(ze);function G({teamDid:u,onCancel:m,onSuccess:a,onError:c=()=>{},mode:l="create",item:p={},orgId:d=""}){const{api:s}=E(),[f,n]=j.useState(!1),[t,r]=j.useState(""),{t:e}=M(),[i,v]=j.useState(p.title||""),[g,y]=j.useState(p.description||""),[h,F]=j.useState(p?.extra?.display||"builtin"),[D,R]=j.useState(p?.extra?.types?p.extra.types.join(","):""),w=async()=>{const x=i.trim();if(!x){r(e("team.passport.error.titleEmpty"));return}if(x.length>64){r(e("team.passport.error.titleTooLong",{length:64}));return}const N=g.replace(/\n/g," ");if(!N){r(e("team.passport.error.descriptionEmpty"));return}const I=l==="create"?Ae(d?`${d}-${x}`:x):p.name;r(null),n(!0);try{if(l==="create"){const S={teamDid:u,name:I,title:x,description:N,...d?{orgId:d}:{}};h==="custom"&&(S.extra=JSON.stringify({display:"custom",types:D.split(",")})),await s.createRole({input:S})}else{const S={teamDid:u,role:{name:I,title:x,description:N},...d?{orgId:d}:{}};await s.updateRole({input:S})}a()}catch(S){const k=pe(S);r(k),c(S)}finally{n(!1)}},_=o.jsxs("div",{children:[l==="update"&&o.jsx(H,{component:"div",style:{paddingTop:16},children:o.jsx($,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:p.name,disabled:!0})}),o.jsx(H,{component:"div",style:{marginTop:16},children:o.jsx($,{label:e("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:i,onChange:x=>{r(null),v(x.target.value)},disabled:l==="update"||f,helperText:e("team.passport.create.titleTip")})}),o.jsx(H,{component:"div",style:{marginTop:16,marginBottom:16},children:o.jsx($,{label:e("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:g,onChange:x=>{r(null),y(x.target.value)},disabled:f,multiline:!0,rows:3})}),l==="create"&&o.jsxs("div",{style:{marginBottom:16},children:[o.jsx(ye,{children:e("common.display")}),o.jsxs(ve,{color:"primary",size:"small",value:h,exclusive:!0,style:{marginTop:16},disabled:f,onChange:(x,N)=>F(N),"data-cy":"input-role-display",children:[o.jsx(Y,{value:"builtin","data-cy":"input-role-display-builtin",children:o.jsx(H,{children:e("team.passport.displayBuiltin")})}),o.jsx(Y,{value:"custom","data-cy":"input-role-display-custom",children:o.jsx(H,{children:e("team.passport.displayCustom")})})]}),h==="custom"&&o.jsxs(o.Fragment,{children:[o.jsx(je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:D,disabled:f,onChange:x=>{R(x.target.value)}}),o.jsx(Ce,{children:e("team.passport.typesTip")})]})]})]});return o.jsxs(ce,{title:l==="create"?e("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:m,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[o.jsx(L,{onClick:m,color:"inherit",children:e("common.cancel")}),o.jsxs(L,{"data-cy":"mutate-role-confirm",onClick:w,color:"primary",disabled:f,variant:"contained",autoFocus:!0,children:[f&&o.jsx(U,{size:16}),e(l==="create"?"common.create":"common.update")]})]}),children:[o.jsx(Te,{component:"div",children:_}),!!t&&o.jsx(Fe,{severity:"error",style:{width:"100%",margin:0},children:t})]})}G.propTypes={teamDid:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["create","update"]),item:C.object,orgId:C.string};function J({onCancel:u,onSuccess:m,onDelete:a,roleName:c,roles:l=void 0,hasPermission:p=!1,orgId:d=""}){const{api:s}=E(),{roles:f,permissions:n,teamDid:t,refresh:r,isNodeTeam:e}=de(),{t:i}=M(),[v,g]=j.useState([]),[y,h]=j.useState(!1),[F,D]=j.useState(null),[R,w]=j.useState(!1),_=j.useMemo(()=>l||f,[l,f]),x=Ie(_.find(T=>T.name===c)),N=ae(c),I=async T=>{if(!R)try{w(!0),await s.deleteRole({input:{teamDid:t,name:T}}),a()}catch(b){z.error(b.message)}finally{w(!1),D(null)}},S=async(T,b)=>{const fe=(await s.getPermissionsByRole({input:{teamDid:T,role:{name:b}}})).permissions||[],xe=n.map(X=>({...X,bind:fe.some(he=>he.name===X.name)}));g(xe)},k=async()=>{w(!0);const T=v.filter(b=>b.bind).map(b=>b.name);try{await s.updatePermissionsForRole({input:{teamDid:t,roleName:x.name,grantNames:T}}),z.success(i("common.saveSuccess")),m()}catch(b){z.error(pe(b))}finally{w(!1)}};j.useEffect(()=>{t&&c&&S(t,c)},[t,c]);const q=e||!p;let Q=null;return e&&(Q=o.jsxs("div",{className:"bind",children:[o.jsx("div",{className:"title",children:i("common.permission")}),o.jsx("div",{className:"list",children:v.filter(T=>q?T.bind:!0).map(T=>o.jsx("div",{className:"item",children:o.jsx(be,{control:o.jsx(we,{disabled:q,checked:T.bind,onChange:()=>{g(b=>b.map(P=>(P.name===T.name&&(P.bind=!P.bind),P)))},name:T.name}),label:T.description})}))})]})),o.jsxs(ce,{title:i("common.passport"),onClose:u,open:!0,fullWidth:!0,toolbar:p&&!N&&o.jsxs(o.Fragment,{children:[o.jsx(K,{onClick:()=>h(x),"data-cy":`edit-passport-${x.name}`,size:"large",children:o.jsx(ue,{fill:"#bfbfbf"})}),o.jsx(K,{onClick:()=>D({title:i("team.passport.delete.title"),description:i("team.passport.delete.description",{name:x.title}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{I(x.name)},onCancel:()=>{w(!1),D(null)}}),"data-cy":`delete-passport-${x.name}`,size:"large",children:o.jsx(_e,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:e&&!q&&o.jsxs(o.Fragment,{children:[o.jsx(L,{onClick:u,color:"inherit",children:i("common.cancel")}),o.jsxs(L,{onClick:k,color:"primary",disabled:R||!x,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[R&&o.jsx(U,{size:16}),i("common.save")]})]}),children:[o.jsxs(Ue,{children:[!x&&o.jsx(Ze,{children:o.jsx(U,{})}),x&&o.jsxs("div",{className:"dialog-content",children:[o.jsxs("div",{className:"header",children:[o.jsx("div",{className:"title",children:x.title}),o.jsx("div",{className:"description",style:{marginTop:e?16:48},children:x.description})]}),Q]})]}),y&&o.jsx(G,{teamDid:t,onCancel:()=>h(null),onSuccess:()=>{h(null),d?m():r()},mode:"update",roleName:y.name,item:y,orgId:d}),F&&o.jsx(Me,{title:F.title,description:F.description,confirm:F.confirm,cancel:F.cancel,params:F.params,onConfirm:F.onConfirm,onCancel:F.onCancel})]})}const We=me(J,"mutate_team"),Ve=me(J,"",le);function Oe(u){const{inService:m}=E();return m?o.jsx(Ve,{...u}):o.jsx(We,{...u})}J.propTypes={roleName:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onDelete:C.func.isRequired,hasPermission:C.bool,roles:C.array,orgId:C.string};const Ue=Z.div`
|
|
7
|
-
.header {
|
|
8
|
-
.title {
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
font-size: 24px;
|
|
11
|
-
line-height: 28px;
|
|
12
|
-
color: ${({theme:u})=>u.palette.text.primary};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.description {
|
|
16
|
-
margin-top: 16px;
|
|
17
|
-
font-weight: 400;
|
|
18
|
-
font-size: 16px;
|
|
19
|
-
line-height: 19px;
|
|
20
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.bind {
|
|
25
|
-
margin-top: 24px;
|
|
26
|
-
.title {
|
|
27
|
-
font-weight: 400;
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
line-height: 19px;
|
|
30
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
31
|
-
margin-bottom: 24px;
|
|
32
|
-
}
|
|
33
|
-
.item {
|
|
34
|
-
margin-top: 24px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.MuiFormControlLabel-label {
|
|
38
|
-
font-weight: 400;
|
|
39
|
-
font-size: 16px;
|
|
40
|
-
line-height: 19px;
|
|
41
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.PrivateSwitchBase-root-45 {
|
|
45
|
-
padding: 0;
|
|
46
|
-
padding-right: 12px;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`,Ze=Z.div`
|
|
50
|
-
flex: 1;
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
align-items: center;
|
|
54
|
-
height: 200px;
|
|
55
|
-
`,oe=j.memo(({field:u,value:m,copyable:a})=>{const{local:c}=M();return m?o.jsxs(B,{onClick:l=>l.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1},children:[u?o.jsxs(ee,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[u,":"]}):null,o.jsx(ee,{variant:"body1",children:o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(Re,{title:m,children:o.jsx("span",{className:"value-ellipsis",children:m})}),a?o.jsx(Pe,{content:Le(m),locale:c,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null}),Ge=j.memo(({role:u={},createPassportSvg:m,onUpdate:a,passportProps:c={},actions:l=null})=>{const{inService:p}=E(),d=De(f=>f.breakpoints.down("md")),s=j.useMemo(()=>u.name&&!Ne.ROLES[u.name.toUpperCase()],[u]);return o.jsxs(B,{"data-cy":`passport-${u.name}`,className:"item",onClick:()=>a(u),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:m({title:u.title,ownerName:"Your Name",width:"150px",...c})}}),o.jsxs(B,{className:"title",sx:{ml:3},children:[o.jsx(oe,{value:u.title}),s?o.jsx(oe,{value:u.name,copyable:!0}):null]})]}),!d&&o.jsx(B,{className:"description",children:u.description}),l||o.jsx(Ee,{permission:p?"":"mutate_team",role:p?le:[],children:o.jsx("div",{className:"action",children:ae(u.name)?o.jsx(He,{}):o.jsx(ue,{})})})]},u.name)});function Je({createPassportSvg:u}){const{roles:m,teamIssuerDid:a,teamName:c,refresh:l,passportColor:p,teamDid:d,isNodeTeam:s}=de(),{t:f}=M(),[n,t]=j.useState(!1),[r,e]=j.useState(!1);return o.jsxs(Qe,{sx:{mt:0},children:[o.jsx(B,{sx:{display:"flex",justifyContent:"flex-end"},children:!s&&o.jsxs(Se,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[o.jsx(Be,{style:{fontSize:16,marginRight:4}}),f("team.passport.create.title")]})}),o.jsx(B,{className:"list",children:m.map(i=>o.jsx(Ge,{role:i,createPassportSvg:u,onUpdate:e,passportProps:{issuer:c,issuerDid:a,ownerDid:a,preferredColor:p}}))}),r&&o.jsx(Oe,{onCancel:()=>e(!1),onSuccess:()=>{e(!1),l()},onDelete:()=>{e(!1),l()},mode:"update",roleName:r.name,item:r}),n&&o.jsx(G,{teamDid:d,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const Qe=Z(B)`
|
|
56
|
-
.list {
|
|
57
|
-
.item {
|
|
58
|
-
padding: 12px;
|
|
59
|
-
margin: 12px -12px;
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
transition: box-shadow 0.4s;
|
|
62
|
-
&:hover {
|
|
63
|
-
box-shadow: 0 0 10px 4px rgba(0, 0, 0, 0.1);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.value-ellipsis {
|
|
67
|
-
display: inline-block;
|
|
68
|
-
max-width: 290px;
|
|
69
|
-
white-space: nowrap;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
text-overflow: ellipsis;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.title {
|
|
76
|
-
font-weight: 400;
|
|
77
|
-
font-size: 18px;
|
|
78
|
-
line-height: 21px;
|
|
79
|
-
color: ${({theme:u})=>u.palette.text.primary};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.description {
|
|
83
|
-
flex: 1;
|
|
84
|
-
margin-left: 24px;
|
|
85
|
-
margin-right: 24px;
|
|
86
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.action {
|
|
90
|
-
fill: ${({theme:u})=>u.palette.text.secondary};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`;Je.propTypes={createPassportSvg:C.func.isRequired};export{Qe as D,_e as H,G as M,Ge as P,J as a,Je as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aU as a}from"./vendor-ux-IiqHAjMq.js";import{V as n}from"./index-DG0EDext.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DyliHtVF.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as X,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Xe,cD as ht,ad as Qe,e4 as gt,e5 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as qe,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,F as Ct,aB as pe}from"./vendor-utils-CxWN1dT3.js";import{H as q,aV as Nt,V as Y,cN as wt,m as Ye,$ as Ze,w as Ae,aP as Je,bi as be,aL as Rt,aX as Tt,b2 as It,b9 as Et}from"./vendor-ux-IiqHAjMq.js";import{Z as At,Q as H,c as E,C as Dt,a1 as Ue}from"./index-DG0EDext.js";import{a as Q,g as De}from"./vendor-hooks-qxhUUbW5.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-CLao_b9r.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-CVN6FKdL.js";import{i as Pt,e as _t,N as Bt}from"./team-DvyWlb8W.js";import{W as zt}from"./did-address-h4uLp20A.js";import{p as st}from"./util-DQmPydCJ.js";import{D as Wt,g as Mt}from"./traffic-DsUQQR3F.js";import{B as nt}from"./bundle-avatar-DJ_-4AO_.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DyliHtVF.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-D-wwXXFW.js";import"./isURL-D4WfF4w_.js";import"./use-app-logo-BKJ912HX.js";import"./base32-CmNHdxL7.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./iframe-CC7bnIjL.js";import"./index-BJ6le4Td.js";import"./index-DBs9Ljax.js";import"./base-chart-ChBZtUEG.js";import"./index-D1SIrheh.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-CIz_EOtQ.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=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=Q(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},J=await n.getNotificationSendLog({input:se});return F(se),b(J.list),S(J.paging),J.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 Z={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:Z},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)}),Qt=(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},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},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},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}=Y();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}=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=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}=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 Jt=[{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(Jt),[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}=Y(),l=Xe(),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,Z]=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),Z(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},J=({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=>Qt(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(),Yt(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=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(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(Qe,{theme:b,children:[e.jsx(Je,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:J,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
|
-
td.MuiTableCell-footer {
|
|
3
|
-
border: none !important;
|
|
4
|
-
}
|
|
5
|
-
.sent-status-cell {
|
|
6
|
-
.resend-btn {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
&:hover {
|
|
10
|
-
.resend-btn {
|
|
11
|
-
display: flex;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`,ss=ae.div`
|
|
16
|
-
padding: 8px 16px;
|
|
17
|
-
.check-title {
|
|
18
|
-
font-weight: 500;
|
|
19
|
-
margin-bottom: 8px;
|
|
20
|
-
&::first-letter {
|
|
21
|
-
text-transform: uppercase;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.check-item {
|
|
25
|
-
svg {
|
|
26
|
-
font-size: 16px;
|
|
27
|
-
}
|
|
28
|
-
font-size: 12px;
|
|
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}=Y(),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}=Y(),{success:b,failed:m,pending:S}=s,h=Zt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,U=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(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=Q(()=>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
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
align-items: flex-start;
|
|
34
|
-
padding: 16px;
|
|
35
|
-
border-radius: 8px;
|
|
36
|
-
background: ${({successRatio:t,failedRatio:s,theme:n})=>t===0&&s===0?n.palette.grey[300]:`linear-gradient(to right, ${bt(n.palette.success.light,.4)} ${t}%, ${n.palette.grey[100]} ${t}%)`};
|
|
37
|
-
transition: 'background 0.5s ease';
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
.unsent-area {
|
|
40
|
-
width: 100%;
|
|
41
|
-
position: relative;
|
|
42
|
-
.resend-btn {
|
|
43
|
-
position: absolute;
|
|
44
|
-
right: 0;
|
|
45
|
-
bottom: 0;
|
|
46
|
-
}
|
|
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}=Y(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=Q(()=>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=Q(()=>Pt(t),[t]),w=Q(()=>_t(t),[t]),U=Q(()=>F?t?.actorInfo:[],[t]),M=Q(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(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,Z=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:Z,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
|
-
& > .notification-row {
|
|
50
|
-
padding: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.tabs {
|
|
54
|
-
margin: 0;
|
|
55
|
-
}
|
|
56
|
-
.body {
|
|
57
|
-
margin-top: 16px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.channel-item {
|
|
61
|
-
display: flex;
|
|
62
|
-
padding: 4px;
|
|
63
|
-
justify-content: flex-start;
|
|
64
|
-
align-items: center;
|
|
65
|
-
gap: 8px;
|
|
66
|
-
> p {
|
|
67
|
-
font-size: 15px;
|
|
68
|
-
}
|
|
69
|
-
.resend-btn {
|
|
70
|
-
svg {
|
|
71
|
-
font-size: 16px;
|
|
72
|
-
}
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
font-size: 12px;
|
|
76
|
-
cursor: pointer;
|
|
77
|
-
&.disabled {
|
|
78
|
-
cursor: not-allowed;
|
|
79
|
-
color: ${be.text.disabled};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`;ve.propTypes={blocklet:d.object,label:d.string};const ls=ae.div`
|
|
84
|
-
display: flex;
|
|
85
|
-
justify-items: flex-start;
|
|
86
|
-
align-items: center;
|
|
87
|
-
gap: 8px;
|
|
88
|
-
.name {
|
|
89
|
-
display: block;
|
|
90
|
-
max-width: 260px;
|
|
91
|
-
white-space: nowrap;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
text-overflow: ellipsis;
|
|
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(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}=Y(),r=Xe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Ye(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"),Z=`notification-records-${y.meta?.did}`,p=Et(Z),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),D=Q(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),J=[{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(Ze,{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,J[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(Qe,{theme:l,children:e.jsx(Je,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:J,data:S,durable:Z,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
|
-
td.MuiTableCell-footer {
|
|
97
|
-
border: none !important;
|
|
98
|
-
}
|
|
99
|
-
.sent-status-cell {
|
|
100
|
-
.resend-btn {
|
|
101
|
-
display: none;
|
|
102
|
-
}
|
|
103
|
-
&:hover {
|
|
104
|
-
.resend-btn {
|
|
105
|
-
display: flex;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.custom-toobar-btns {
|
|
111
|
-
gap: 4px;
|
|
112
|
-
}
|
|
113
|
-
.custom-toobar-title-inner {
|
|
114
|
-
display: flex;
|
|
115
|
-
justify-content: ${({isBreakpointsDownSm:t})=>t?"space-between":"flex-end"};
|
|
116
|
-
padding-right: ${({isBreakpointsDownSm:t})=>t?"0":"8px"};
|
|
117
|
-
flex-wrap: wrap;
|
|
118
|
-
gap: 8px;
|
|
119
|
-
}
|
|
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};
|