@abtnode/blocklet-services 1.16.44-beta-20250520-104453-912ed737 → 1.16.44-beta-20250524-065731-c62fd374
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/services/mcp/server.js +18 -3
- package/dist/assets/{AdapterDayjs-Bck9Dv3l.js → AdapterDayjs-DnsMePpQ.js} +1 -1
- package/dist/assets/{ArrowDropDown-BleCy3ti.js → ArrowDropDown-Dzy2X1bv.js} +1 -1
- package/dist/assets/{CheckCircle-XrJDG94y.js → CheckCircle-DA1-Q3VQ.js} +1 -1
- package/dist/assets/{ChevronLeft-BlDLI-Qo.js → ChevronLeft-C7-bj_BM.js} +1 -1
- package/dist/assets/{ChevronRight-DkPaON7R.js → ChevronRight-CA18V4hg.js} +1 -1
- package/dist/assets/{Community-BCL2L7ib.js → Community-BnAsVqMr.js} +1 -1
- package/dist/assets/{DeleteOutline-Cj7UhBbF.js → DeleteOutline-DIXSGJ49.js} +1 -1
- package/dist/assets/{Done-UEZFWnHj.js → Done-BHbsILFJ.js} +1 -1
- package/dist/assets/{Download-CsoZ8yOi.js → Download-CmhNaqwS.js} +1 -1
- package/dist/assets/{Edit-Bj4m2hpD.js → Edit-CNRD5aKM.js} +1 -1
- package/dist/assets/{EditIcon-Dffk7mPL.js → EditIcon-8BXW1OHp.js} +1 -1
- package/dist/assets/{Email-CdSNK0eA.js → Email-BirbvqZ3.js} +1 -1
- package/dist/assets/{Error-BwUoSWOt.js → Error-DDQf7Wzw.js} +1 -1
- package/dist/assets/{ExpandLess-CjIzahHO.js → ExpandLess-D15nWpBQ.js} +1 -1
- package/dist/assets/{Google-BON6upKi.js → Google-BEEvQjkX.js} +1 -1
- package/dist/assets/{Holiday-enHMZqEf.js → Holiday-C4KRd5t6.js} +1 -1
- package/dist/assets/Home-C8za96Ud.js +1 -0
- package/dist/assets/{InfoOutlined-uoMMChNE.js → InfoOutlined-Cxpk0UTX.js} +1 -1
- package/dist/assets/{Launch-rj4Kr2rA.js → Launch-CKr_eo1b.js} +1 -1
- package/dist/assets/{LaunchOutlined-0gUfY-5D.js → LaunchOutlined-Drryv7vp.js} +1 -1
- package/dist/assets/{Location-By12Z3Te.js → Location-DxPzfR_p.js} +1 -1
- package/dist/assets/{LockIcon-98CKEIBe.js → LockIcon-DFb6sSpT.js} +1 -1
- package/dist/assets/{Meeting-CLeFWDkY.js → Meeting-DCL_ygud.js} +1 -1
- package/dist/assets/{MoreHoriz-3SNxR36h.js → MoreHoriz-CKCGMlB8.js} +1 -1
- package/dist/assets/{OffSick-dUm363rs.js → OffSick-DvgkmCUP.js} +1 -1
- package/dist/assets/{Phone--BSu-btI.js → Phone-BkOMNOMO.js} +1 -1
- package/dist/assets/{PlayArrow-BHO_DqT2.js → PlayArrow-CrmMAssx.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DTf-Tya5.js → QuestionMarkCircle-DTGyWFVS.js} +1 -1
- package/dist/assets/{Timezone-YZ0dMUEr.js → Timezone-D91Of94T.js} +1 -1
- package/dist/assets/{TuneOutlined-BvtfOd23.js → TuneOutlined-Dp4gMD_8.js} +1 -1
- package/dist/assets/{ViewList-BvucdDXZ.js → ViewList-ByzGtByR.js} +1 -1
- package/dist/assets/{WorkingRemotely-BX7rgbEY.js → WorkingRemotely-CpchWcXV.js} +1 -1
- package/dist/assets/{access-control-C9ZsDLlM.js → access-control-CHRw2bbp.js} +1 -1
- package/dist/assets/{actions-BWSNMC_c.js → actions-XNIU_ion.js} +1 -1
- package/dist/assets/{add-component-core-Dd9KPcvp.js → add-component-core-eEjKF53n.js} +33 -33
- package/dist/assets/{add-resource-BHmsfuUO.js → add-resource-W-ML3m5q.js} +1 -1
- package/dist/assets/{addon-CaGk2PdY.js → addon-DGwzoD-f.js} +1 -1
- package/dist/assets/{advanced-DlILcrRl.js → advanced-CPhRkaAJ.js} +2 -2
- package/dist/assets/appearance-Bgtb4-LE.js +1 -0
- package/dist/assets/ar-CHiV3Onz.js +1 -0
- package/dist/assets/{ar-C_INBNFD.js → ar-T0OvMFDJ.js} +2 -2
- package/dist/assets/{audit-logs-DfXh1JQZ.js → audit-logs-DCTnwVQT.js} +3 -3
- package/dist/assets/authorize-0cAl16_K.js +1 -0
- package/dist/assets/base-chart-D6qRW4Yg.js +1 -0
- package/dist/assets/{base32-BnPQ4q4v.js → base32-DEQDAhbh.js} +1 -1
- package/dist/assets/branding-6OsQw5QJ.js +40 -0
- package/dist/assets/{branding-CbgACClH.js → branding-Bv8Tk-Am.js} +1 -1
- package/dist/assets/bundle-avatar-WoSDDX0E.js +1 -0
- package/dist/assets/button-D7WVH4Bm.js +1 -0
- package/dist/assets/click-to-copy-DsH0RQVg.js +1 -0
- package/dist/assets/{collapse-iOiHn4dy.js → collapse-DRHShQoZ.js} +1 -1
- package/dist/assets/complete-BJLGhmnP.js +39 -0
- package/dist/assets/{component-amc-22MQ.js → component-BFi7evus.js} +2 -2
- package/dist/assets/{config-D3UduD_R.js → config-BfjiZ8-q.js} +2 -2
- package/dist/assets/{config-B_jIm01w.js → config-C77UXU2G.js} +1 -1
- package/dist/assets/{config-navigation-PoVJgHNU.js → config-navigation-BkfKynqT.js} +6 -6
- package/dist/assets/config-space-DID86BbB.js +1 -0
- package/dist/assets/{confirm-DaR0Yx39.js → confirm-BnRcXvxs.js} +1 -1
- package/dist/assets/connect-DJCBGsCy.js +1 -0
- package/dist/assets/connect-DyhNsjIB.js +5 -0
- package/dist/assets/connect-to-BYS6M9JU.js +1 -0
- package/dist/assets/{content-layout--sy9JlYZ.js → content-layout-fV4nyVb5.js} +1 -1
- package/dist/assets/dark-animation-DhFa8I7D.js +1 -0
- package/dist/assets/dashboard-RTzIKcnI.js +239 -0
- package/dist/assets/de-BWtUXhCw.js +1 -0
- package/dist/assets/{de-EYXdEi3Y.js → de-WYW4JJdA.js} +2 -2
- package/dist/assets/default-animation-DARmPWCI.js +1 -0
- package/dist/assets/{delete-confirm-DHB0S_Co.js → delete-confirm-2yiel8lV.js} +1 -1
- package/dist/assets/{did-address-mv0Qw7hC.js → did-address-2a_50VlM.js} +1 -1
- package/dist/assets/domain-B7QeQ3KX.js +9 -0
- package/dist/assets/domain-action-card-CLEjpu-P.js +28 -0
- package/dist/assets/domains-Bu0iN_az.js +1 -0
- package/dist/assets/dot-itVN8XTt.js +7 -0
- package/dist/assets/{email-DiuMAA8U.js → email-9sDMxuoB.js} +2 -2
- package/dist/assets/{empty-spinner-BZw_ShnT.js → empty-spinner-BdaCO6xq.js} +1 -1
- package/dist/assets/es-B6GuFK3b.js +1 -0
- package/dist/assets/{es-3jqVamM8.js → es-DaHPJdAX.js} +2 -2
- package/dist/assets/{exchange-passport-Bcw--2wm.js → exchange-passport-CzmhafoN.js} +1 -1
- package/dist/assets/fr-DjhyyiEi.js +1 -0
- package/dist/assets/{fr-CUcR-yNv.js → fr-Sdn9hi8k.js} +2 -2
- package/dist/assets/{fuel-BitXgq2D.js → fuel-D_QIEw1n.js} +1 -1
- package/dist/assets/gen-access-key-BmDWpAif.js +2 -0
- package/dist/assets/get-safe-url-BdFxF8pA.js +1 -0
- package/dist/assets/get-safe-url-DfW-qoLB.js +1 -0
- package/dist/assets/hi-CtKbt1J4.js +1 -0
- package/dist/assets/{hi-DNldhMTl.js → hi-dJuR0lt2.js} +2 -2
- package/dist/assets/{home-jh95SgT7.js → home-DtVAZY8s.js} +1 -1
- package/dist/assets/id-CCuL3FP-.js +1 -0
- package/dist/assets/{id-CmSIFhX-.js → id-DuYS34H0.js} +2 -2
- package/dist/assets/{iframe-BlPuY8Pu.js → iframe-dmrNn49R.js} +1 -1
- package/dist/assets/{index-CleFkLt8.js → index-B4CzEaVv.js} +1 -1
- package/dist/assets/{index-CZOVduSH.js → index-B4rUFDP9.js} +1 -1
- package/dist/assets/{index-YuW8IExe.js → index-B6g_NzxF.js} +22 -22
- package/dist/assets/index-BctwEFbW.js +55 -0
- package/dist/assets/index-Bhwq-PC6.js +284 -0
- package/dist/assets/{index-BdH_4Yfe.js → index-BmXcRfZR.js} +1 -1
- package/dist/assets/index-Bw-rbXJI.js +6 -0
- package/dist/assets/index-C2wxmxz2.js +1 -0
- package/dist/assets/{index-DYlN9Brg.js → index-C5N0NjEs.js} +12 -12
- package/dist/assets/{index-Bv8sds6g.js → index-CBALX7k4.js} +1 -1
- package/dist/assets/{index-Bi-YrbEk.js → index-CGHej0Ek.js} +4 -4
- package/dist/assets/index-CT4keHaK.js +1 -0
- package/dist/assets/index-CtxraYdM.js +113 -0
- package/dist/assets/{index-C849wD9b.js → index-D2uDBC1o.js} +1 -1
- package/dist/assets/{index-CqRVUIz0.js → index-D45FqXMt.js} +3 -3
- package/dist/assets/{index-BWshat_T.js → index-DBBjaba5.js} +7 -7
- package/dist/assets/{index-hjv3dFXZ.js → index-DLdz4ykT.js} +1 -1
- package/dist/assets/{index-Cgdb1aGn.js → index-DdKYu9HL.js} +10 -10
- package/dist/assets/index-Dq_lSUqL.js +1 -0
- package/dist/assets/{index-D3Od1Ju7.js → index-DtsBFtZP.js} +9 -9
- package/dist/assets/{index-C0w1ugDi.js → index-J3Tqz9ZT.js} +1 -1
- package/dist/assets/{index-DbsXFWms.js → index-RsjqbOR7.js} +1 -1
- package/dist/assets/{index-BXkKeWVW.js → index-Z_7QgoWt.js} +2 -2
- package/dist/assets/{index-CmQOzzP8.js → index-iB7JyXwh.js} +1 -1
- package/dist/assets/index-iphP5FWX.js +10 -0
- package/dist/assets/{invitation-BtuI3wbb.js → invitation-DG9MWQbS.js} +5 -5
- package/dist/assets/invite-DLCj8sz9.js +1 -0
- package/dist/assets/{issue-passport-DGinrMdr.js → issue-passport-BWxVIA89.js} +1 -1
- package/dist/assets/item-CUEEdtq7.js +2 -0
- package/dist/assets/ja-ACgKScTi.js +1 -0
- package/dist/assets/{ja-D-vAGmH7.js → ja-Dh60q0r5.js} +2 -2
- package/dist/assets/{ko-DpdamIdS.js → ko-CoqvBZUf.js} +2 -2
- package/dist/assets/ko-gvJH4zFR.js +1 -0
- package/dist/assets/{landing-page-D_TLvQ3s.js → landing-page-DErP-951.js} +1 -1
- package/dist/assets/{launch-result-message-Eea5FZDm.js → launch-result-message-FuvJDCvp.js} +1 -1
- package/dist/assets/{layout-0pbi4f6l.js → layout-BpHPXY7v.js} +1 -1
- package/dist/assets/{list-C_1TcitB.js → list-95F7XaG9.js} +6 -6
- package/dist/assets/list-TUiipUoi.js +2 -0
- package/dist/assets/{list-header-DNFbdM3a.js → list-header-xt282ZMS.js} +1 -1
- package/dist/assets/localization-Dale72UG.js +1 -0
- package/dist/assets/{log-DnUF9orj.js → log-aS7wDHYq.js} +1 -1
- package/dist/assets/logger-DRlJhYNs.js +1 -0
- package/dist/assets/{login-Boq_S2S7.js → login-BEhRbdo1.js} +1 -1
- package/dist/assets/{login-oauth-callback-CuSXnq1m.js → login-oauth-callback-T6cLlJXo.js} +1 -1
- package/dist/assets/{logo-uploader-DtAT8iaJ.js → logo-uploader-CLz5RPTu.js} +5 -5
- package/dist/assets/lost-passport-C2TUuANu.js +168 -0
- package/dist/assets/{open-window-DXP1LoPD.js → open-window-xER4N-kf.js} +1 -1
- package/dist/assets/{overview-DHcHPq6g.js → overview-CSLXBT0F.js} +2 -2
- package/dist/assets/{page-header-PO_g4wSK.js → page-header-IRqa6Qvs.js} +1 -1
- package/dist/assets/{passport-item-NMGbWwTG.js → passport-item-hLzOrz7-.js} +1 -1
- package/dist/assets/{permission-BfddnDBs.js → permission-BkpeOUF9.js} +1 -1
- package/dist/assets/preferences-CaXn4vHX.js +1 -0
- package/dist/assets/profile-embed-DP-NpR-H.js +1 -0
- package/dist/assets/{pt-CEcOQeEC.js → pt-DCcbs0d0.js} +2 -2
- package/dist/assets/pt-DzswFIpl.js +1 -0
- package/dist/assets/publish-resource-BImGOxGu.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-0e7VDGmi.js → react-beautiful-dnd.esm-CXMxXaUW.js} +1 -1
- package/dist/assets/ru-EZJWVu3M.js +1 -0
- package/dist/assets/{ru-83xhwzPD.js → ru-WYTV5VzH.js} +2 -2
- package/dist/assets/runtime-BdS45sOH.js +1 -0
- package/dist/assets/sdk-DeUOtvaE.js +1 -0
- package/dist/assets/{section-C1TPQFRq.js → section-BB6hVmdO.js} +1 -1
- package/dist/assets/{security-BuN2nUoZ.js → security-bFZAakv0.js} +4 -4
- package/dist/assets/{session-DUt5rVEy.js → session-E0e-X6-a.js} +1 -1
- package/dist/assets/setup-DMmxE-ov.js +30 -0
- package/dist/assets/{shorten-label-Bf7YQUd6.js → shorten-label-DPIZ5X7v.js} +1 -1
- package/dist/assets/{simple-select-DwWEI_ZU.js → simple-select-CN3fsa56.js} +1 -1
- package/dist/assets/slicedToArray-DmqXMnHT.js +2 -0
- package/dist/assets/{spaces-MprwX1Iq.js → spaces-BKlIkPYo.js} +1 -1
- package/dist/assets/start-BXBhW0EF.js +187 -0
- package/dist/assets/{starting-progress-BJCVRFkE.js → starting-progress-CyKicFZc.js} +1 -1
- package/dist/assets/{status-Bo92foK0.js → status-CIwF9IiE.js} +1 -1
- package/dist/assets/{step-actions-D__rjlW_.js → step-actions-Cy_Wn9XZ.js} +1 -1
- package/dist/assets/{studio-kVKG7W3n.js → studio-BSiEg8xP.js} +1 -1
- package/dist/assets/{switch-control-BgwZFVCJ.js → switch-control-DzZXz9Ks.js} +1 -1
- package/dist/assets/{table-tips-nPiIcvAy.js → table-tips-BP0JTpDH.js} +1 -1
- package/dist/assets/th-Bn3Ch7SK.js +1 -0
- package/dist/assets/{th-BQLlyW1N.js → th-Da4lMKTX.js} +2 -2
- package/dist/assets/traffic-Bz2-5BjC.js +1 -0
- package/dist/assets/{transfer-U9z5JNMl.js → transfer-CZ88q7e8.js} +1 -1
- package/dist/assets/{unsubscribe-BmAshFCd.js → unsubscribe-Dc0yE6SM.js} +1 -1
- package/dist/assets/{use-blocklet-logo-3VH4RBTr.js → use-blocklet-logo-DeL5Lmpn.js} +1 -1
- package/dist/assets/{use-mobile-JEGQfLZ2.js → use-mobile-BAa0wi8o.js} +1 -1
- package/dist/assets/{use-mobile-ZAS6Si4t.js → use-mobile-C21X4TYN.js} +1 -1
- package/dist/assets/use-server-logo-CxuMvwKh.js +1 -0
- package/dist/assets/useAsync-510ntT1B.js +1 -0
- package/dist/assets/{useLocalStorage-DotMjDUB.js → useLocalStorage-DvcK7KsP.js} +1 -1
- package/dist/assets/{user-center-8aoMSkJ_.js → user-center-3TxDrG6m.js} +15 -14
- package/dist/assets/{util-CiTimo-i.js → util-IzAdTupy.js} +1 -1
- package/dist/assets/{util-CuK9uaNS.js → util-KGAW0YJ4.js} +1 -1
- package/dist/assets/{vendor-arcblock-Ca95GLVH.js → vendor-arcblock-CUb0jDdY.js} +86 -86
- package/dist/assets/{vendor-hooks-DpwFseeF.js → vendor-hooks-BgUTpb6X.js} +1 -1
- package/dist/assets/{vendor-mui-core-Bh-qMRq3.js → vendor-mui-core-BV2FUxWJ.js} +22 -22
- package/dist/assets/{vendor-mui-x-CQTjfcpn.js → vendor-mui-x-Bo-XOtzq.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-D0L9YnHn.js → vendor-ux-did-connect-DprdyYny.js} +148 -148
- package/dist/assets/{vi-DgWAr6FA.js → vi-BxzaqoH9.js} +2 -2
- package/dist/assets/vi-CgnGroV4.js +1 -0
- package/dist/assets/wrap-locale-BjqARXGJ.js +1 -0
- package/dist/assets/zh-BWgwGxeZ.js +1 -0
- package/dist/assets/{zh-BL80PoOh.js → zh-Do6onry4.js} +2 -2
- package/dist/assets/{zh-tw-Dg5z1DFE.js → zh-tw-BNgoHsYW.js} +2 -2
- package/dist/assets/zh-tw-Ciod1pFs.js +1 -0
- package/dist/images/mcp/claude.webp +0 -0
- package/dist/images/mcp/cline.png +0 -0
- package/dist/images/mcp/cursor.png +0 -0
- package/dist/images/mcp/default.png +0 -0
- package/dist/images/mcp/enconvo.png +0 -0
- package/dist/images/mcp/roocline.png +0 -0
- package/dist/images/mcp/windsurf.png +0 -0
- package/dist/images/mcp/witsy.png +0 -0
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +34 -34
- package/dist/assets/ServerLogo-CEsILJl5.js +0 -1
- package/dist/assets/appearance-D1sGjeMk.js +0 -1
- package/dist/assets/ar-BRKjvO8p.js +0 -1
- package/dist/assets/authorize-mEHpiCQH.js +0 -1
- package/dist/assets/branding-BHziMdwk.js +0 -40
- package/dist/assets/bundle-avatar-D7QQIJpo.js +0 -1
- package/dist/assets/button-DXOAf3Np.js +0 -1
- package/dist/assets/click-to-copy-DtGgy9Ua.js +0 -1
- package/dist/assets/complete-CKdswLjZ.js +0 -39
- package/dist/assets/config-space-D-DWHYER.js +0 -1
- package/dist/assets/connect-CVfkW49h.js +0 -1
- package/dist/assets/connect-CvEHPjqh.js +0 -5
- package/dist/assets/connect-to-DrhAN5Nn.js +0 -1
- package/dist/assets/dashboard-B_QqB4aw.js +0 -239
- package/dist/assets/de-D3cg0t9f.js +0 -1
- package/dist/assets/domain-BR9srj-p.js +0 -9
- package/dist/assets/domain-action-card-DtwNOaxH.js +0 -28
- package/dist/assets/domains-Bg_t1pz-.js +0 -1
- package/dist/assets/dot-D3X4DSlo.js +0 -7
- package/dist/assets/es-DPjqApVE.js +0 -1
- package/dist/assets/fr-Dscs9WsP.js +0 -1
- package/dist/assets/gen-access-key-CrHniwdW.js +0 -2
- package/dist/assets/get-safe-url-BRocR2aJ.js +0 -1
- package/dist/assets/get-safe-url-DYtntqqo.js +0 -1
- package/dist/assets/hi-B8D3j6bs.js +0 -1
- package/dist/assets/id-DWMMQI0G.js +0 -1
- package/dist/assets/index-BDcuaL48.js +0 -113
- package/dist/assets/index-BO7CJLK3.js +0 -284
- package/dist/assets/index-B_y3Xcdb.js +0 -55
- package/dist/assets/index-D0TzEmpA.js +0 -6
- package/dist/assets/index-DO4zGWKz.js +0 -1
- package/dist/assets/index-RDZtjGNC.js +0 -1
- package/dist/assets/index-c0hdujdn.js +0 -10
- package/dist/assets/invite-CelTXbxx.js +0 -1
- package/dist/assets/item-BhN-qZd_.js +0 -2
- package/dist/assets/ja-3LoBq68U.js +0 -1
- package/dist/assets/ko-B2dxwXDl.js +0 -1
- package/dist/assets/list-DKIkIMue.js +0 -2
- package/dist/assets/localization-CpjVJ6VE.js +0 -1
- package/dist/assets/logger-jMgD3u5g.js +0 -1
- package/dist/assets/lost-passport-DuJeKcGu.js +0 -168
- package/dist/assets/preferences-Nt4L8Zgv.js +0 -1
- package/dist/assets/profile-embed-C9nHKFrf.js +0 -1
- package/dist/assets/pt-eei1_Z4R.js +0 -1
- package/dist/assets/publish-resource-BL83FldI.js +0 -1
- package/dist/assets/ru-ZKgT6XdU.js +0 -1
- package/dist/assets/runtime-FDEoUn52.js +0 -1
- package/dist/assets/sdk-CytUSheP.js +0 -1
- package/dist/assets/setup-BB0XLqW9.js +0 -30
- package/dist/assets/slicedToArray-BSaY8ui4.js +0 -2
- package/dist/assets/start-C7CIzLBY.js +0 -187
- package/dist/assets/th-CG5eLRZo.js +0 -1
- package/dist/assets/traffic-Cd92p-Xb.js +0 -35
- package/dist/assets/useAsync-CDjYBiwf.js +0 -1
- package/dist/assets/useAsync-dC0jHVWO.js +0 -1
- package/dist/assets/vi-CoZs3B42.js +0 -1
- package/dist/assets/wrap-locale-QBHz1ECC.js +0 -1
- package/dist/assets/zh-CgkeS2I3.js +0 -1
- package/dist/assets/zh-tw-CuakNRcW.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as m}from"./vendor-react-DEoibe3W.js";import{a as k,Y as T,as as M,bN as P,j as R}from"./vendor-ux-did-connect-DprdyYny.js";import{l as v}from"./vendor-hooks-BgUTpb6X.js";import{j as e,aa as s,ab as C,ak as j,al as B,bo as E,br as L,bn as W,q as D,be as A,I as _,y as z,H as q}from"./vendor-mui-core-BV2FUxWJ.js";import{d as F}from"./Launch-CKr_eo1b.js";import{a as U}from"./api-BjteVZFg.js";import{T as K}from"./table-tips-BP0JTpDH.js";import{D as w}from"./index-B6g_NzxF.js";import{u as N}from"./dashboard-RTzIKcnI.js";import"./vendor-utils-rHXShPKm.js";import"./lottie-web-jYmAQWuC.js";import"./InfoOutlined-Cxpk0UTX.js";import"./use-mobile-C21X4TYN.js";import"./vendor-arcblock-CUb0jDdY.js";import"./useLocalStorage-DvcK7KsP.js";import"./index-8eXqqyHQ.js";import"./confirm-BnRcXvxs.js";import"./PlayArrow-CrmMAssx.js";import"./get-safe-url-BdFxF8pA.js";import"./session-E0e-X6-a.js";import"./use-blocklet-logo-DeL5Lmpn.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BAa0wi8o.js";function y({endpoint:a}){const[i,r]=m.useState("mcp-link"),h=w(),{api:g}=w(),{teamDid:p}=N(),{t:u,locale:d}=k(),{data:o,run:b,loading:x}=v(()=>g.createAccessKey({input:{teamDid:p,passport:R.SERVER_ROLES.ADMIN,authType:"simple",remark:"Generated by MCP Servers"}}),{manual:!0}),{imgPrefix:t}=h,n=m.useMemo(()=>[{icon:e.jsx(s,{sx:{width:20,height:20},children:"🔗"}),value:"mcp-link",label:"MCP Link"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/claude.webp`,alt:"Claude",sx:{width:20,height:20}}),value:"claude",label:"Claude"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cursor.png`,alt:"Cursor",sx:{width:20,height:20}}),value:"cursor",label:"Cursor"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/cline.png`,alt:"Cline",sx:{width:20,height:20}}),value:"cline",label:"Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/roocline.png`,alt:"Roo Cline",sx:{width:20,height:20}}),value:"roo-cline",label:"Roo Cline"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/windsurf.png`,alt:"Windsurf",sx:{width:20,height:20}}),value:"windsurf",label:"Windsurf"},{icon:e.jsx(s,{component:"img",src:`${t}/mcp/witsy.png`,alt:"Witsy",sx:{width:20,height:20}}),value:"witsy",label:"Witsy"}],[t]),l=n.find(c=>c.value===i),f=m.useMemo(()=>{var c;return(c=o==null?void 0:o.data)==null?void 0:c.accessKeySecret},[o]),$=m.useMemo(()=>!f&&i!=="mcp-link",[f,i]),S=c=>{const I=`npx @blocklet/install-mcp@latest i ${a} --client ${c} --streamableHTTP --oauth2Bearer ${f}`;switch(c){case"cursor":case"claude":case"cline":case"roo-cline":case"windsurf":case"witsy":return I;case"mcp-link":default:return a}};return e.jsxs(s,{children:[e.jsx(M,{tabs:n,current:i,onChange:r,scrollButtons:"auto",iconPosition:"start"}),e.jsxs(s,{children:[e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(s,{component:"h2",children:i==="mcp-link"?l==null?void 0:l.label:`${l==null?void 0:l.label} ${u("installCommand")}`}),i!=="mcp-link"&&e.jsx(A,{href:`https://www.arcblock.io/docs/blocklet-developer/${d}/mcp-${i}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(_,{size:"small",children:e.jsx(F,{})})})]}),e.jsxs(s,{position:"relative",sx:{"& .codeblock__inner":{overflow:"auto !important"}},children:[e.jsx(P,{code:S(i),language:"shell",style:{margin:0}}),$&&e.jsx(s,{position:"absolute",top:0,right:0,left:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",sx:{bgcolor:"action.active",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",zIndex:1},children:x?e.jsx(C,{}):e.jsx(z,{variant:"contained",color:"primary",onClick:b,size:"small",children:`${u("common.generate")} ${u("command")}`})})]})]})]})}y.propTypes={endpoint:q.string.isRequired};function ge(){var x;const[a,i]=m.useState(null),{t:r,locale:h}=k(),g=`${(x=window==null?void 0:window.blocklet)==null?void 0:x.appUrl}/.well-known/service/mcp/servers`,{data:p,loading:u,error:d}=v(()=>Promise.all([U.get(g)])),o=m.useMemo(()=>{var t,n;return((n=(t=p==null?void 0:p[0])==null?void 0:t.data)==null?void 0:n.servers)||[]},[p]);m.useEffect(()=>{o!=null&&o.length&&i(o.find(t=>{var n;return t.did===((n=window==null?void 0:window.blocklet)==null?void 0:n.did)})||o[0])},[o]);const b=t=>{const n=t.target.value;i(o.find(l=>l.did===n))};return u?e.jsx(s,{children:e.jsx(C,{})}):d?e.jsx(j,{color:"error",children:d==null?void 0:d.message}):o!=null&&o.length?e.jsxs(B,{gap:2,sx:{maxWidth:1200},children:[e.jsx(K,{title:r("mcp.listTitle"),tooltipTitle:r("mcp.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${h}/mcp-server`}),e.jsxs(E,{fullWidth:!0,children:[e.jsx(L,{id:"server-select-label",children:r("mcp.available")}),e.jsx(W,{labelId:"server-select-label",value:(a==null?void 0:a.did)||"",label:r("mcp.available"),onChange:b,children:o.map(t=>e.jsx(D,{value:t.did,children:e.jsxs(s,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(T,{variant:"rounded",shape:"square",did:t.did,src:t.logo,size:20}),e.jsx(s,{sx:{fontSize:14},children:t.name})]})},t.did))})]}),a&&e.jsx(y,{endpoint:a.endpoint})]}):e.jsx(j,{color:"warning",children:r("mcp.noServer")})}export{ge as default};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import{g as Ut,r as C}from"./vendor-react-DEoibe3W.js";import{ah as ue,al as ht,j as e,aa as T,O as te,bs as ge,bt as We,bo as Y,ad as xt,H as x,a9 as Je,T as ae,E as Qe,bz as gt,bQ as Ke,bR as qe,y as Le,b3 as Me,ab as bt,bI as jt,Y as vt,cp as yt,m as Ht,bb as dt,br as Vt,bn as Yt,q as ut,bY as Gt,I as Jt}from"./vendor-mui-core-BV2FUxWJ.js";import{J as St,z as Qt,A as Xt,e as fe,aB as ye,C as Zt}from"./vendor-utils-rHXShPKm.js";import{a as re,a6 as Ct,Z as q,bQ as es,B as me,b2 as ts,as as wt,j as W,b7 as ss,r as Xe,bR as ns,Y as Tt,a7 as Rt,bn as Ae,am as Nt,W as is,bu as as}from"./vendor-ux-did-connect-DprdyYny.js";import{D as Ze,G as Et,aA as It,aB as X,y as se,n as rs,K as pt}from"./index-B6g_NzxF.js";import{a as Te,u as V,f as ce}from"./vendor-hooks-BgUTpb6X.js";import{a as et,b as os}from"./dashboard-RTzIKcnI.js";import{l as ls,v as ke}from"./vendor-arcblock-CUb0jDdY.js";import{f as $e,i as cs,d as ds}from"./use-blocklet-logo-DeL5Lmpn.js";import{A as us,a as ps,d as fs,b as ms}from"./collapse-DRHShQoZ.js";import{S as ee}from"./section-BB6hVmdO.js";import{S as Re}from"./shorten-label-DPIZ5X7v.js";import{I as At}from"./index-CBALX7k4.js";import{R as Ot,A as hs,S as xs,a as gs,b as bs,B as js}from"./list-95F7XaG9.js";import{W as vs}from"./did-address-2a_50VlM.js";import{p as Dt}from"./util-IzAdTupy.js";import{D as ys,g as Ss}from"./traffic-Bz2-5BjC.js";import{B as Lt}from"./bundle-avatar-WoSDDX0E.js";import{u as Cs}from"./use-mobile-C21X4TYN.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DvcK7KsP.js";import"./index-8eXqqyHQ.js";import"./confirm-BnRcXvxs.js";import"./PlayArrow-CrmMAssx.js";import"./get-safe-url-BdFxF8pA.js";import"./session-E0e-X6-a.js";import"./InfoOutlined-Cxpk0UTX.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BAa0wi8o.js";import"./index-D2uDBC1o.js";import"./CheckCircle-DA1-Q3VQ.js";import"./index-iphP5FWX.js";import"./Phone-BkOMNOMO.js";import"./Location-DxPzfR_p.js";import"./Email-BirbvqZ3.js";import"./Timezone-D91Of94T.js";import"./base32-DEQDAhbh.js";import"./iframe-dmrNn49R.js";import"./LaunchOutlined-Drryv7vp.js";import"./ChevronLeft-C7-bj_BM.js";import"./ChevronRight-CA18V4hg.js";import"./index-iB7JyXwh.js";import"./base-chart-D6qRW4Yg.js";import"./index-J3Tqz9ZT.js";import"./vendor-mui-x-Bo-XOtzq.js";import"./AdapterDayjs-DnsMePpQ.js";var Ue={exports:{}},He={exports:{}},Ve={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;function s(r){return r==null}n.exports=t.default,n.exports.default=t.default})(Ve,Ve.exports);var ws=Ve.exports;(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var s=o(ls),r=o(ws);function o(h){return h&&h.__esModule?h:{default:h}}var l=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,y=/^[-+]?[0-9]+$/;function p(h,i){(0,s.default)(h),i=i||{};var A=i.allow_leading_zeroes===!1?l:y,O=!i.hasOwnProperty("min")||(0,r.default)(i.min)||h>=i.min,R=!i.hasOwnProperty("max")||(0,r.default)(i.max)||h<=i.max,S=!i.hasOwnProperty("lt")||(0,r.default)(i.lt)||h<i.lt,D=!i.hasOwnProperty("gt")||(0,r.default)(i.gt)||h>i.gt;return A.test(h)&&O&&R&&S&&D}n.exports=t.default,n.exports.default=t.default})(He,He.exports);var Ts=He.exports;(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var s=r(Ts);function r(l){return l&&l.__esModule?l:{default:l}}function o(l){return(0,s.default)(l,{allow_leading_zeroes:!1,min:0,max:65535})}n.exports=t.default,n.exports.default=t.default})(Ue,Ue.exports);var Rs=Ue.exports;const Ns=Ut(Rs),Fe={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Es(){var N,E,P;const{api:n}=Ze(),{blocklet:t}=Et(),{t:s}=re(),{confirmApi:r,confirmHolder:o}=Ct(),l=(N=t==null?void 0:t.meta)==null?void 0:N.did,y=Object.assign({...Fe},((P=(E=t==null?void 0:t.settings)==null?void 0:E.notification)==null?void 0:P.email)||{}),{handleSubmit:p,control:h,formState:i,watch:A,reset:O}=It({defaultValues:St(y,Object.keys(Fe))}),R=Te({testReceiver:"",testReceiverError:""}),S=A("enabled"),D=V(async(a,m,$=!0)=>{var U,oe;try{const{blocklet:le}=await n.configNotification({input:{did:l,notification:JSON.stringify({email:a})}}),pe=Object.assign({...Fe},((oe=(U=le==null?void 0:le.settings)==null?void 0:U.notification)==null?void 0:oe.email)||{});O(pe),$&&q.success(s("oauth.saveSuccess"))}catch(le){if($)q.error(le.message||s("oauth.saveFailed"));else throw le}}),G=V(async(a,m,$)=>{try{i.isDirty&&await D(a,m,!1),await n.sendEmail({input:{did:l,receiver:$,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),q.success(s("notification.email.testSuccess"))}catch(U){q.error(U.message||s("notification.email.testfailed"))}}),z=V((a,m)=>{R.testReceiver="",R.testReceiverError="",r.open({title:s("notification.email.testSendEmail"),content:()=>e.jsx(T,{sx:{width:"300px"},children:e.jsx(te,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:s("notification.email.inputTestReceiver"),value:R.testReceiver,onChange:$=>{R.testReceiver=$.target.value},error:!!R.testReceiverError,helperText:R.testReceiverError||" "})}),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),async onConfirm($){var oe;const U=(oe=R.testReceiver)==null?void 0:oe.trim();if(!U){R.testReceiverError=s("notification.email.receiverRequired");return}if(!ke(U)){R.testReceiverError=s("notification.email.receiverInvalid");return}R.testReceiverError="",await G(a,m,U),$()}})}),B=V(a=>{const m=a==null?void 0:a.trim();return m?ke(m)?!0:s("notification.email.fromInvalid"):s("notification.email.fromRequired")}),_=V(a=>{const m=a==null?void 0:a.trim();return m?$e(m,{require_host:!1,protocols:[]})?!0:s("notification.email.hostInvalid"):s("notification.email.hostRequired")}),M=V(a=>a?Ns(a)?!0:s("notification.email.portInvalid"):s("notification.email.portRequired")),J=V(a=>a!=null&&a.trim()?!0:s("notification.email.userRequired")),ie=V(a=>a!=null&&a.trim()?!0:s("notification.email.passwordRequired")),c=V(a=>a!=null&&a.trim()&&!$e(a,{protocols:["http","https"],require_protocol:!0})?s("notification.email.linkInvalid"):!0),g=V(a=>a!=null&&a.trim()&&!ke(a)?s("notification.email.emailInvalid"):!0),j=V(()=>!0);return e.jsxs(T,{children:[e.jsxs(Is,{component:"form",onSubmit:p(D),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(ee,{title:s("notification.email.enable"),my:2.5,children:e.jsx(X,{name:"enabled",control:h,render:({field:a})=>e.jsx(ge,{control:e.jsx(We,{checked:a.value,...a})})})}),e.jsx(ee,{title:s("notification.email.from"),children:e.jsx(X,{name:"from",control:h,rules:{validate:S?B:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",required:!0,label:s("notification.email.from"),error:!!i.errors[a.name],helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.host"),children:e.jsx(X,{name:"host",control:h,rules:{validate:S?_:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:s("notification.email.host"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.port"),children:e.jsx(X,{name:"port",control:h,rules:{validate:S?M:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",required:!0,type:"number",error:!!i.errors[a.name],label:s("notification.email.port"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.user"),children:e.jsx(X,{name:"user",control:h,rules:{validate:S?J:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",required:!0,error:!!i.errors[a.name],label:s("notification.email.user"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.password"),children:e.jsx(X,{name:"password",control:h,rules:{validate:S?ie:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",required:!0,type:"password",error:!!i.errors[a.name],label:s("notification.email.password"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.secure"),children:e.jsx(X,{name:"secure",control:h,rules:{validate:j},render:({field:a})=>e.jsx(Y,{fullWidth:!0,children:e.jsx(ge,{control:e.jsx(We,{checked:a.value,...a,disabled:!S})})})})}),e.jsxs(us,{children:[e.jsxs(ps,{expandIcon:e.jsx(fs,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[s("notification.email.signature"),e.jsx(xt,{title:s("notification.email.signatureTooltip"),children:e.jsx(es,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ms,{children:[e.jsx(ee,{title:s("notification.email.companyName"),children:e.jsx(X,{name:"companyName",control:h,rules:{validate:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",error:!!i.errors[a.name],label:s("notification.email.companyName"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.companyLink"),children:e.jsx(X,{name:"companyLink",control:h,rules:{validate:S?c:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",error:!!i.errors[a.name],label:s("notification.email.companyLink"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.companyAddress"),children:e.jsx(X,{name:"companyAddress",control:h,rules:{validate:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",error:!!i.errors[a.name],label:s("notification.email.companyAddress"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})}),e.jsx(ee,{title:s("notification.email.supportEmail"),children:e.jsx(X,{name:"supportEmail",control:h,rules:{validate:S?g:j},render:({field:a})=>{var m;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...a,size:"small",type:"email",error:!!i.errors[a.name],label:s("notification.email.supportEmail"),helperText:((m=i.errors[a.name])==null?void 0:m.message)||" ",disabled:!S})})}})})]})]}),e.jsxs(T,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(me,{variant:"outlined",color:"warning",onClick:p(z),disabled:!S,children:s("oauth.runTest")}),e.jsx(me,{type:"submit",variant:"contained",disabled:!i.isDirty,children:s("oauth.save")})]})]}),o]})}const Is=ue(ht)``,Be={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function As(){var M,J,ie;const{api:n}=Ze(),{blocklet:t}=Et(),{t:s}=re(),{confirmApi:r,confirmHolder:o}=Ct(),l=(M=t==null?void 0:t.meta)==null?void 0:M.did,y=Object.assign({...Be},((ie=(J=t==null?void 0:t.settings)==null?void 0:J.notification)==null?void 0:ie.pushKit)||{}),{handleSubmit:p,control:h,formState:i,watch:A,reset:O}=It({defaultValues:St(y,Object.keys(Be))}),R=Te({testReceiver:"",testReceiverError:""}),S=A("enabled"),D=V(async(c,g,j=!0)=>{var N,E;try{const{blocklet:P}=await n.configNotification({input:{did:l,notification:JSON.stringify({pushKit:c})}}),a=Object.assign({...Be},((E=(N=P==null?void 0:P.settings)==null?void 0:N.notification)==null?void 0:E.pushKit)||{});O(a),j&&q.success(s("oauth.saveSuccess"))}catch(P){if(j)q.error(P.message||s("oauth.saveFailed"));else throw P}}),G=V(async(c,g)=>{var j,N,E;try{i.isDirty&&await D(c,g,!1);const P=(j=((t==null?void 0:t.configs)||[]).find($=>$.key==="BLOCKLET_APP_URL"))==null?void 0:j.value,a=Qt(Xt(P,"/.well-known/service/blocklet/logo"),{v:(N=t==null?void 0:t.meta)==null?void 0:N.version,t:new Date((t==null?void 0:t.updatedAt)||0).getTime()}),m={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:t==null?void 0:t.appDid,fullName:(E=t==null?void 0:t.meta)==null?void 0:E.title,avatar:a}}}};await n.sendPush({input:{did:l,receiver:R.testReceiver,notification:JSON.stringify(m)}}),q.success(s("notification.pushKit.testSuccess"))}catch(P){q.error(P.message||s("notification.pushKit.testfailed"))}}),z=V((c,g)=>{R.testReceiverError="",r.open({title:s("notification.pushKit.testSend"),content:()=>e.jsx(T,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(te,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:s("notification.pushKit.inputTestReceiver"),value:R.testReceiver,onChange:j=>{R.testReceiver=j.target.value},error:!!R.testReceiverError,helperText:R.testReceiverError||" "})}),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),async onConfirm(j){var E;if(!((E=R.testReceiver)==null?void 0:E.trim())){R.testReceiverError=s("notification.pushKit.receiverRequired");return}R.testReceiverError="",await G(c,g),j()}})}),B=V(c=>{const g=c==null?void 0:c.trim();return g?$e(g)?!0:s("notification.pushKit.endpointInvalid"):s("notification.pushKit.endpointRequired")}),_=V(()=>!0);return e.jsxs(T,{children:[e.jsxs(Os,{component:"form",onSubmit:p(D),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(ee,{title:s("notification.pushKit.enable"),my:2.5,children:e.jsx(X,{name:"enabled",control:h,render:({field:c})=>e.jsx(ge,{control:e.jsx(We,{checked:c.value,...c})})})}),e.jsx(ee,{title:s("notification.pushKit.endpoint"),children:e.jsx(X,{name:"endpoint",control:h,rules:{validate:S?B:_},render:({field:c})=>{var g;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...c,size:"small",required:!0,label:s("notification.pushKit.endpoint"),error:!!i.errors[c.name],helperText:((g=i.errors[c.name])==null?void 0:g.message)||" ",disabled:!S})})}})}),e.jsxs(ee,{title:s("notification.pushKit.customOptions"),children:[e.jsx(X,{name:"did",control:h,render:({field:c})=>{var g;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...c,size:"small",label:s("notification.pushKit.did"),error:!!i.errors[c.name],helperText:((g=i.errors[c.name])==null?void 0:g.message)||" ",disabled:!S})})}}),e.jsx(X,{name:"pushPath",control:h,render:({field:c})=>{var g;return e.jsx(Y,{fullWidth:!0,children:e.jsx(te,{...c,size:"small",label:s("notification.pushKit.pushPath"),error:!!i.errors[c.name],helperText:((g=i.errors[c.name])==null?void 0:g.message)||" ",disabled:!S})})}})]}),e.jsxs(T,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(me,{variant:"outlined",color:"warning",onClick:p(z),disabled:!S,children:s("oauth.runTest")}),e.jsx(me,{type:"submit",variant:"contained",disabled:!i.isDirty,children:s("oauth.save")})]})]}),o]})}const Os=ue(ht)``,ft=[{label:e.jsx(T,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:e.jsx(T,{textAlign:"center",width:"100%",children:"Push Kit"}),value:"pushKit"}];function Ds(){const[n,t]=C.useState(ft[0].value),{locale:s}=C.useContext(ts),r=ce(()=>({email:e.jsx(Es,{}),pushKit:e.jsx(As,{})}),[s]),o=C.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(T,{children:[e.jsx(wt,{tabs:ft,current:n,onChange:t}),e.jsx(T,{style:o,children:r[n]})]})}const Pt=C.createContext({}),{Provider:Ls,Consumer:oi}=Pt;function Ps({children:n,blocklet:t=""}){const{api:s,inService:r,ws:{useSubscription:o}}=Ze(),[l,y]=C.useState([]),[p,h]=C.useState({total:0,pageSize:20,pageCount:0,page:1}),i=ce(()=>{var c;return(c=t.meta)==null?void 0:c.did},[t]),[A,O]=C.useState([]),[R,S]=C.useState({}),D=ce(()=>l.length?new Set(l.map(c=>c.id)):new Set,[l]),G=async({page:c=1,pageSize:g=20,...j}={})=>{if(!i)return[];try{const N={paging:{page:c,pageSize:g},...j,teamDid:i,dateRange:j.dateRange?[se(j.dateRange[0]).toISOString(),se(j.dateRange[1]).toISOString()]:void 0},{dids:E,...P}=N;let a="";E&&E.includes("system")&&(a="system");const m=E?E.filter(oe=>oe!=="system"):[],$={...P,source:a,componentDids:m},U=await s.getNotificationSendLog({input:$});return S($),y(U.list),h(U.paging),U.list}catch(N){return q.error(N.message),[]}},z=async()=>{const c=await s.getNotificationComponents({input:{teamDid:i}});O(c.componentDids)},B=C.useCallback(c=>{const g=t.children.find(j=>{var N;return((N=j.meta)==null?void 0:N.did)===c});if(g)return g.ancestors=[t],g},[t]),_=async({notificationId:c,receivers:g,channels:j,...N})=>{await s.resendNotification({input:{teamDid:i,notificationId:c,receivers:g,channels:j.map(E=>E==="wallet"?W.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?W.NOTIFICATION_SEND_CHANNEL.PUSH:E),...N}})},M=C.useCallback(async c=>(await s.getUser({input:{teamDid:i,user:{did:c}}})).user,[s,i]),J=C.useCallback(async({page:c=1,pageSize:g=20,...j}={})=>{try{const N={paging:{page:c,pageSize:g},...j,userName:j.searchText||"",teamDid:i,dateRange:j.dateRange?[se(j.dateRange[0]).toISOString(),se(j.dateRange[1]).toISOString()]:void 0};return await s.getReceivers({input:N})}catch(N){throw q.error(N.message),N}},[s,i]);C.useEffect(()=>{i&&z()},[i]),o(W.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,c=>{D.has(c.notificationId)&&G(R)},[D,R]),o(W.EVENTS.NOTIFICATION_BLOCKLET_CREATE,c=>{D.has(c.id)||G(R)},[D,R]);const ie={fetch:G,data:l,paging:p,blocklet:t,getComponent:B,resendNotification:_,getUser:M,componentDids:A,getReceivers:J,inService:r,teamDid:i};return e.jsx(Ls,{value:{notificationRecords:ie},children:n})}function tt(){const{notificationRecords:n}=C.useContext(Pt);return n}Ne.propTypes={severity:x.oneOf(Object.values(["info","success","error","warning"])).isRequired};const _s={info:"primary",success:"success",error:"error",warning:"warning"};function Ne({severity:n="info"}){return e.jsx(ss,{type:_s[n],children:n})}var st={},ks=Je;Object.defineProperty(st,"__esModule",{value:!0});var _t=st.default=void 0,Fs=ks(Xe()),Bs=e;_t=st.default=(0,Fs.default)((0,Bs.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var nt={},zs=Je;Object.defineProperty(nt,"__esModule",{value:!0});var kt=nt.default=void 0,Ws=zs(Xe()),Ks=e;kt=nt.default=(0,Ws.default)((0,Ks.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var it={},qs=Je;Object.defineProperty(it,"__esModule",{value:!0});var Ft=it.default=void 0,Ms=qs(Xe()),$s=e;Ft=it.default=(0,Ms.default)((0,$s.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const Us=(n,t,s="")=>{if(!s||!t)return"";switch(s){case W.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return n("notification.sendStatus.reason.disabled",{channel:t});case W.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return n("notification.sendStatus.reason.unavailable",{channel:t});case W.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return n("notification.sendStatus.reason.notSent",{channel:t});case W.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return n("notification.sendStatus.reason.offline");default:return s}};function Bt(n,t,s={}){const{status:r,updatedAt:o,reason:l="",channel:y="wallet"}=s,p=o?n("notification.sendStatus.sentTime",{date:rs(o,t)}):"",h=Us(n,y,l);return r===W.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:n("notification.sendStatus.failed"),sentTime:p,reason:h}:r===W.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:n("notification.sendStatus.success"),sentTime:p}:{status:"pending",title:n("notification.sendStatus.pending"),reason:h,sentTime:p}}const Ye={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Ge=["wallet","pushKit","email"],mt=["info","success","error","warning"],zt=n=>{var s,r;const{settings:t}=n;return(r=(s=t==null?void 0:t.notification)==null?void 0:s.email)==null?void 0:r.enabled},Wt=n=>{var s,r;const{settings:t}=n;return(r=(s=t==null?void 0:t.notification)==null?void 0:s.pushKit)==null?void 0:r.enabled},Hs=(n,t)=>{const s=fe(t,"extra.notifications.email",!0);return{available:zt(n),enabled:s}},Vs=(n,t)=>{const s=fe(t,"extra.notifications.push",!0);return{available:Wt(n),enabled:s}},Ys=n=>({enabled:fe(n,"extra.notifications.wallet",!0)}),Gs=n=>({enabled:fe(n,"extra.webhooks",[]).length>0}),Ee=(n=3)=>new Promise(t=>{setTimeout(()=>{t()},n*1e3)}),Js=(n,t)=>t==="wallet"||t==="webhook"?[{channel:t,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:t}),fail:n("notification.sendStatus.reason.disabled",{channel:t})}]:t==="pushKit"||t==="email"?[{channel:t,type:"available",pass:n("notification.sendStatus.reason.available",{channel:t}),fail:n("notification.sendStatus.reason.unavailable",{channel:t})},{channel:t,type:"enabled",pass:n("notification.sendStatus.reason.enabled",{channel:t}),fail:n("notification.sendStatus.reason.disabled",{channel:t})}]:[],Ie=(n=[])=>{const t=se().startOf("day");return n.filter(s=>se(s.sendAt).isSame(t,"day")).length},Qs=(n,t="")=>{if(t&&Ge.includes(t)){const l=`${t}SendRecord`,y=fe(n,l,[]);return Ie(y)}const s=fe(n,"webhook",{}),r=Object.keys(s??{})??[];if(t&&r.includes(t)){const l=s[t]??[];return Ie(l)}const o={};return Ge.forEach(l=>{const y=`${l}SendRecord`,p=fe(n,y,[]),h=Ie(p);o[l]=h}),r.length>0&&r.forEach(l=>{const y=s[l]??[],p=Ie(y);o[l]=p}),o},Oe=(n,t,s)=>{if(!Array.isArray(n))throw new Error("Invalid filterList or index");return n[s].splice(t,1),n},De=(n,t)=>{if(!Array.isArray(t))throw new Error("filters must be an array");return t.length?!t.includes(n):!1},Xs=n=>{switch(n){case W.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case W.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case W.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case W.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},Kt=()=>({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 de({config:n,enableTooltip:t=!0,showTitle:s=!1,children:r}){const{status:o,title:l="",sentTime:y="",reason:p=""}=n,h=[l,p].filter(Boolean).join(", ");return e.jsx(xt,{title:t?e.jsxs(e.Fragment,{children:[e.jsx(ae,{color:"inherit",sx:{fontSize:12},children:h}),e.jsx("span",{children:y})]}):null,arrow:!0,placement:"top",children:e.jsxs(T,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(T,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(T,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Ye[o],style:{opacity:.15}}),e.jsx(T,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Ye[o]})]}),e.jsx(ae,{color:"inherit",sx:{fontSize:12},children:s?l:r})]})})}de.propTypes={config:x.object.isRequired,enableTooltip:x.bool,showTitle:x.bool,children:x.node};de.defaultProps={enableTooltip:!0,showTitle:!1,children:null};Se.propTypes={list:x.array.isRequired,label:x.string.isRequired,onDelete:x.func};Se.defaultProps={onDelete:()=>{}};function Se({list:n,label:t,onDelete:s}){const{t:r,locale:o}=re();return e.jsxs(T,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(ae,{children:[t,": "]}),n.map(l=>{const y=Bt(r,o,{status:l});return e.jsx(Qe,{size:"small",label:e.jsx(T,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(de,{config:y,enableTooltip:!1,children:y.title})}),onDelete:p=>s(p,l)},l)})]})}at.propTypes={filterList:x.array.isRequired,onChange:x.func.isRequired,index:x.number.isRequired,column:x.object.isRequired,filterValues:x.array.isRequired,label:x.string.isRequired,renderLabel:x.func.isRequired};function at({filterList:n,onChange:t,index:s,column:r,filterValues:o,label:l,renderLabel:y}){return e.jsxs(Y,{className:"filter-container",children:[e.jsx(gt,{component:"legend",children:l}),e.jsx(Ke,{row:!0,children:o.map(p=>e.jsx(ge,{control:e.jsx(qe,{checked:n[s].indexOf(p.value??p)>-1,onChange:h=>{const i=[...n];h.target.checked?i[s]=[...i[s],p.value??p]:i[s]=i[s].filter(A=>A!==(p.value??p)),t(i[s],s,r)},name:p.value??p}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:y(p)})},p.value??p))})]})}function ze(n){return e.jsx(at,{...n,renderLabel:t=>e.jsx(de,{enableTooltip:!1,config:{status:t.status},children:t.label})})}ve.propTypes={status:x.number.isRequired,updatedAt:x.string.isRequired,reason:x.string,channel:x.string,onResend:x.func};function ve({status:n,updatedAt:t,reason:s="",channel:r="wallet",onResend:o}){const{t:l,locale:y}=re(),p=Bt(l,y,{status:n,updatedAt:t,reason:s,channel:r});return e.jsxs(T,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(de,{config:p,showTitle:!0}),p.status!=="success"&&e.jsx(Le,{className:"resend-btn",size:"small",startIcon:e.jsx(et,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:l("notification.resend")})]})}rt.propTypes={value:x.array.isRequired,onChange:x.func};function rt({value:n,onChange:t}){const{locale:s}=re(),r=se().toDate(),[o,l]=C.useState(null),y=C.useCallback(i=>{l(o?null:i.currentTarget)},[o]),p=!!o,h=C.useCallback(i=>{if(!i.startDate||!i.endDate){q.error("Please select a date range");return}if(se(i.startDate).isAfter(i.endDate)||!se(i.startDate).isValid()||!se(i.endDate).isValid()){q.error("Invalid date range");return}t([i.startDate,i.endDate]),l(null)},[t]);return e.jsxs("div",{children:[e.jsx(ae,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Le,{onClick:y,variant:"outlined",size:"small",color:"inherit",children:[pt(n[0],s)," - ",pt(n[1],s)]})}),e.jsx(Me,{open:p,anchorEl:o,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(ys,{open:!0,maxDate:r,initialDateRange:{startDate:n[0],endDate:n[1]},toggle:y,definedRanges:Ss(r),onChange:h})})]})}ot.propTypes={itemComponent:x.elementType.isRequired};function ot({itemComponent:n,...t}){var o;const{t:s}=re();return!((o=t==null?void 0:t.filterList)!=null&&o.filter(l=>l.length).length)?null:e.jsxs(T,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:s("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(ns.TableFilterList,{...t,ItemComponent:n})})]})}function Pe({label:n,onDelete:t,canDelete:s=()=>!0,...r}){const o=t&&typeof t=="function"?t:void 0;let l=!0;return s&&typeof s=="function"&&(l=s({label:n,...r})),e.jsx(Qe,{label:n,variant:"outlined",...o&&l?{onDelete:o}:{}})}Pe.propTypes={label:x.string.isRequired,onDelete:x.func,canDelete:x.func};Pe.defaultProps={canDelete:()=>!0};const Zs=[{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}];lt.propTypes={loading:x.bool,onCancel:x.func,onConfirm:x.func};lt.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function lt({loading:n=!1,onCancel:t,onConfirm:s}){const{t:r}=re(),[o,l]=C.useState(Zs),[y,p]=C.useState(!0),h=(A,O)=>{O.checked=A.target.checked;const R=o.map(S=>({...S,checked:S.value===O.value?O.checked:S.checked}));l(R)},i=A=>{A.stopPropagation(),s({channels:o.filter(O=>O.checked).map(O=>O.value),isResendFailedOnly:y})};return e.jsxs(T,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(ae,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(T,{className:"choose-channel",children:e.jsxs(Y,{component:"fieldset",variant:"standard",children:[e.jsx(gt,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Ke,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(A=>e.jsx(ge,{control:e.jsx(qe,{checked:A.checked,onChange:O=>h(O,A),name:A.value}),label:A.label},A.value))})]})}),e.jsx(T,{className:"resend-config-footer",children:e.jsx(Ke,{children:e.jsx(ge,{control:e.jsx(qe,{checked:y,onChange:A=>p(A.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(T,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Le,{onClick:A=>{A.stopPropagation(),t()},color:"inherit",children:r("common.cancel")}),e.jsxs(Le,{onClick:i,color:"primary",disabled:n,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[n&&e.jsx(bt,{size:16}),r("common.confirm")]})]})]})}qt.propTypes={notificationId:x.string.isRequired,handleResend:x.func,resending:x.bool};function qt({notificationId:n,handleResend:t,resending:s=!1}){const{t:r,locale:o}=re(),l=jt(),y=C.useMemo(()=>vt(l,Kt()),[l]),{getReceivers:p,inService:h,teamDid:i,getUser:A,blocklet:O}=tt(),[R,S]=C.useState(!1),[D,G]=C.useState([]),z=Te({anchorEl:null,position:null}),B=Te({anchorEl:null,position:null}),[_,M]=C.useState(null),[J,ie]=C.useState({total:0,pageSize:10,pageCount:0,page:1}),[c,g]=C.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[se().subtract(1,"month").startOf("day").toDate(),se().endOf("day").toDate()]}),[j,N]=C.useState([]),E=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],P=async()=>{if(!R&&n)try{S(!0);const d=await p({notificationId:n,...c}),u=d.list.map(f=>({...f,receiverUser:{...f.receiverUser,avatar:Dt(f.receiverUser.avatar,i,h)}}));G(u),ie(d.paging),S(!1)}catch(d){q.error(d.message),S(!1)}};C.useEffect(()=>{P()},[c]);const a=d=>{d.stopPropagation();const u=d.currentTarget;B.anchorEl=u;const f=u.getBoundingClientRect();B.position={top:f.top+window.scrollY,left:f.left+window.scrollX}},m=d=>d.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(me,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(et,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:r("notification.resend")})}):null,$={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:J.page-1,rowsPerPage:J.pageSize,count:J.total,searchText:c.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:j,onRowSelectionChange:(d,u)=>{N(u.map(f=>f.dataIndex))},customToolbarSelect:m},U=({page:d,rowsPerPage:u,searchText:f,filterList:L})=>{const[,K=[],Z=[],Q=[]]=L;c.pageSize!==u?g(H=>({...H,pageSize:u,page:1})):c.page!==d+1?g(H=>({...H,page:d+1})):c.searchText!==f?g(H=>({...H,searchText:f,page:1})):ye(K,c.walletSendStatus)?ye(Z,c.pushKitSendStatus)?ye(Q,c.emailSendStatus)||g(H=>({...H,emailSendStatus:Q,page:1})):g(H=>({...H,pushKitSendStatus:Z,page:1})):g(H=>({...H,walletSendStatus:K,page:1}))},oe=C.useCallback(async(d,u)=>{if(!u)return!1;const f=await A(u);return f?d==="wallet"?Ys(f):d==="email"?Hs(O,f):d==="pushKit"?Vs(O,f):d==="webhook"?Gs(f):!0:!1},[A,O]),le=C.useCallback(d=>Js(r,d),[r]),pe=()=>{z.anchorEl=null,z.position=null,M(null)},be=()=>{B.anchorEl=null,B.position=null},je=async(d,u,f=!0,L="")=>{if(!(!u.length||!d.length))try{t(d,u,f,L),B.anchorEl||(await Ee(.5),pe())}catch(K){console.error("handleResend error",{error:K})}},v=async({channels:d,isResendFailedOnly:u})=>{const f=j.map(L=>D[L].receiver);await je(d,f,u),await Ee(.5),be(),N([])},b=async(d,u=[],f=!0)=>{try{await je(["webhook"],[d.receiver],f,u)}catch(L){q.error(L.response?L.response.statusText:L.message)}},w=async(d,u,f,L=[],K=!0)=>{if(d.stopPropagation(),Qs(u,f)>=4){q.warning(r("notification.resendLimit"));return}if(!Ge.includes(f)){await b(u,L,K);return}if(d){const Q=d.currentTarget,H=Q.getBoundingClientRect();z.anchorEl=Q,z.position={top:H.top+window.scrollY,left:H.left+window.scrollX}}M({channel:f});try{const Q=await oe(f,u.receiver);await Ee(1),M({channel:f,result:Q}),(typeof Q=="boolean"&&Q||Zt(Q)&&Object.values(Q).every(H=>!!H))&&(await t([f],[u.receiver],K),B.anchorEl||(await Ee(.5),pe()))}catch(Q){q.error(Q.message)}},I=d=>{g(u=>({...u,dateRange:d,page:1}))},k=(d,u,f,L)=>{d.stopPropagation();const K=f.filter(Z=>Z!==u);g(Z=>({...Z,[L]:K,page:1}))},F=ce(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:d=>{const{receiverUser:u,receiver:f}=D[d];return u?e.jsxs(T,{"data-cy":`member-name-${u.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(Tt,{src:`${u.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:f,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(Re,{children:u.fullName})]},f):e.jsx(vs,{size:14,responsive:!1,compact:!0,copyable:!1,did:f})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:c.walletSendStatus??[],customFilterListOptions:{render:d=>e.jsx(Se,{list:d,label:"Wallet",onDelete:(u,f)=>{u.stopPropagation(),k(u,f,F[1].options.filterList,"walletSendStatus")}}),update:Oe},filterOptions:{names:E,fullWidth:!0,logic:De,display:(d,u,f,L)=>e.jsx(ze,{label:"Wallet",filterList:d,onChange:u,index:f,column:L,filterValues:E})},customBodyRenderLite:d=>{const{walletSendStatus:u,walletSendAt:f,walletSendFailedReason:L}=D[d];return e.jsx(ve,{status:u,updatedAt:f,reason:L,channel:"wallet",onResend:K=>w(K,D[d],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:d=>{const{pushKitSendStatus:u,pushKitSendAt:f,pushKitSendFailedReason:L}=D[d];return e.jsx(ve,{status:u,updatedAt:f,reason:L,channel:"pushkit",onResend:K=>w(K,D[d],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:c.pushKitSendStatus??[],customFilterListOptions:{render:d=>e.jsx(Se,{list:d,label:"Push Kit",onDelete:(u,f)=>{u.stopPropagation(),k(u,f,F[2].options.filterList,"pushKitSendStatus")}}),update:Oe},filterOptions:{names:E,fullWidth:!0,logic:De,display:(d,u,f,L)=>e.jsx(ze,{label:"Push Kit",filterList:d,onChange:u,index:f,column:L,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:d=>{const{emailSendStatus:u,emailSendAt:f,emailSendFailedReason:L}=D[d];return e.jsx(ve,{status:u,updatedAt:f,reason:L,channel:"email",onResend:K=>w(K,D[d],"email",[],!1)})},filter:!0,filterType:"custom",filterList:c.emailSendStatus??[],customFilterListOptions:{render:d=>e.jsx(Se,{list:d,label:"Email",onDelete:(u,f)=>{u.stopPropagation(),k(u,f,F[3].options.filterList,"emailSendStatus")}}),update:Oe},filterOptions:{names:E,fullWidth:!0,logic:De,display:(d,u,f,L)=>e.jsx(ze,{label:"Email",filterList:d,onChange:u,index:f,column:L,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:d=>{const{webhook:u}=D[d];if(!u)return null;const f=Object.entries(u)[0];if(!f)return null;const[L,K]=f,Z=K[0];return e.jsx(T,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(T,{className:"webhook-item",fontSize:12,children:[e.jsx(Re,{maxLength:30,children:L},L),e.jsx(ve,{status:Z.status,updatedAt:Z.sendAt,reason:Z.failedReason,channel:"webhook",onResend:Q=>w(Q,D[d],"webhook",[L],!1)})]},L)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:d=>{const{createdAt:u}=D[d];return e.jsx(Ot,{value:u,locale:o,shouldUpdate:!0})}}}],[D,o,c,r]),ne=[e.jsx(rt,{value:c.dateRange,onChange:I},"date-picker"),e.jsx(me,{variant:"contained",size:"small",color:"primary",loading:R,startIcon:e.jsx(Ft,{}),onClick:()=>P(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(T,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(tn,{children:e.jsxs(yt,{theme:y,children:[e.jsx(Rt,{className:"receivers-table",locale:o,loading:R,columns:F,data:D,onChange:U,options:$,customButtons:ne,components:{TableFilterList:d=>e.jsx(ot,{...d,itemComponent:u=>e.jsx(Pe,{...u,canDelete:()=>!1})})}}),z.anchorEl&&e.jsx(Me,{open:!!z.anchorEl,anchorReference:"anchorPosition",anchorPosition:z.position,onClose:pe,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(sn,{children:[e.jsxs(ae,{variant:"body1",component:"div",className:"check-title",children:[_==null?void 0:_.channel," Checking"]}),e.jsx(T,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:le(_==null?void 0:_.channel).map(d=>{var K,Z;const{type:u,pass:f,fail:L}=d;return!(_!=null&&_.result)||(K=_==null?void 0:_.result)!=null&&K[u]?e.jsxs(ae,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(Z=_==null?void 0:_.result)!=null&&Z[u]?Ae.success.main:"inherit"},children:[_!=null&&_.result?e.jsx(_t,{}):e.jsx(bt,{size:12,sx:{color:Ae.primary.main}}),e.jsx("span",{children:f})]},u):e.jsxs(ae,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:Ae.error.main},children:[e.jsx(kt,{}),e.jsx("span",{children:L})]},u)})})]})}),B.anchorEl&&e.jsx(Me,{open:!!B.anchorEl,anchorReference:"anchorPosition",anchorPosition:B.position,onClose:be,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(lt,{loading:s,onCancel:be,onConfirm:v})})]})})})}const en=C.memo(qt),tn=ue.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
|
+
`,sn=ue.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
|
+
`,Ce=n=>n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:n;function nn(n){const{wallet:t,push:s,email:r,webhook:o}=n;return[{name:"Wallet",value:e.jsx(he,{item:t})},{name:"Push",value:e.jsx(he,{item:s})},{name:"Email",value:e.jsx(he,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(he,{item:o,isWebhook:!0})}]:[]]}function an(n,t,s){const{wallet:r,push:o,email:l,webhook:y}=n;return[{name:"Wallet",value:e.jsx(xe,{loading:s,channel:W.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:t})},{name:"Push",value:e.jsx(xe,{loading:s,channel:W.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:t})},{name:"Email",value:e.jsx(xe,{loading:s,channel:W.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:t})},...y.total>0?[{name:"Webhook",value:e.jsx(xe,{loading:s,channel:W.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:y,isWebhook:!0,onResend:t})}]:[]]}_e.propTypes={statistics:x.object.isRequired,onResend:x.func,mode:x.oneOf(["simple","detail"]),resending:x.bool};_e.defaultProps={mode:"simple",onResend:()=>{},resending:!1};he.propTypes={item:x.object.isRequired,isWebhook:x.bool};he.defaultProps={isWebhook:!1};function he({item:n,isWebhook:t=!1}){const{t:s}=re(),r=t?n.success.length:n.success,o=n.total,l=r===o?"success":"failed";return e.jsx(T,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(T,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(de,{config:{status:l},enableTooltip:!1,children:[Ce(r)," / ",Ce(o)," ",s("notification.sendStatus.success")]})})})}xe.propTypes={item:x.object.isRequired,isWebhook:x.bool,channel:x.string,onResend:x.func,loading:x.bool};xe.defaultProps={isWebhook:!1,channel:W.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function xe({channel:n,item:t,isWebhook:s=!1,onResend:r,loading:o}){const{t:l}=re(),{success:y,failed:p,pending:h}=t,i=Xs(n),A=s?y.length:y,O=s?p.length:p,R=s?h.length:h,S=async B=>{B.stopPropagation();const _=s?[...new Set([...y,...p].map(M=>M))]:[];await r([n],[],!0,_)},D=A+O,G=D>0?A/D*100:0,z=D>0?O/D*100:0;return e.jsxs(rn,{successRatio:G,failedRatio:z,children:[e.jsxs(ae,{variant:"h6",children:[i," (",t.total,")"]}),e.jsxs(ae,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Ye.success,fontWeight:600,fontSize:24},children:Ce(A)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(T,{className:"unsent-area",children:[e.jsxs(T,{children:[e.jsxs(de,{config:{status:"failed"},enableTooltip:!1,children:[Ce(O)," ",l("notification.sendStatus.failed")]}),e.jsxs(de,{config:{status:"pending"},enableTooltip:!1,children:[Ce(R)," ",l("notification.sendStatus.pending")]})]}),O>0&&e.jsx(T,{className:"resend-btn",children:e.jsx(me,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(et,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:S,children:l("notification.resend")})})]})]})}function _e({statistics:n,mode:t="simple",onResend:s,resending:r}){const o=ce(()=>t==="simple"?nn(n):an(n,s,r),[n,t]);return t==="simple"?e.jsx("div",{children:o.map(l=>e.jsx(At,{style:{alignItems:"flex-start",marginBottom:t==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(dt,{container:!0,spacing:2,children:o.map(l=>e.jsx(dt,{item:!0,md:4,sm:6,xs:12,children:l.value},l.name))})}const rn=ue(T)`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
padding: 16px;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
background: ${({successRatio:n,failedRatio:t,theme:s})=>n===0&&t===0?s.palette.grey[300]:`linear-gradient(to right, ${Ht(s.palette.success.light,.4)} ${n}%, ${s.palette.grey[100]} ${n}%)`};
|
|
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
|
+
`;Mt.propTypes={notification:x.object.isRequired,onCancel:x.func,blocklet:x.object.isRequired,tab:x.string};function Mt({notification:n,onCancel:t=()=>{},blocklet:s,tab:r="info"}){const{t:o,locale:l}=re(),{getComponent:y,resendNotification:p}=tt(),[h,i]=C.useState(!1),A=ce(()=>y(n.componentDid)||s,[s,n.componentDid]),O=Te({tab:r||"info"}),R=C.useCallback(async(c,g,j=!0,N=[])=>{var a;if(!c.length||!n.id)return;const E=g.length>0?g:(a=n==null?void 0:n.receivers)==null?void 0:a.map(m=>m.receiver);if(!E.length)return;let P=[...c];if(P.includes(W.NOTIFICATION_SEND_CHANNEL.PUSH)&&!Wt(s)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),P=P.filter(m=>m!==W.NOTIFICATION_SEND_CHANNEL.PUSH)),P.includes(W.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!zt(s)&&(q.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),P=P.filter(m=>m!==W.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!P.length)try{i(!0),await p({notificationId:n.id,receivers:E,channels:P,resendFailedOnly:j,...P.includes("webhook")&&N.length?{webhookUrls:N}:{}}),q.success("Message has been sent!")}catch(m){console.error("handleResend error",{error:m}),q.error(m.response?m.response.statusText:m.message)}finally{i(!1)}},[s,n.id,n==null?void 0:n.receivers,p,o]),S=ce(()=>cs(n),[n]),D=ce(()=>ds(n),[n]),G=ce(()=>S?n==null?void 0:n.actorInfo:[],[n]),z=ce(()=>{var c;return(s==null?void 0:s.did)||((c=s==null?void 0:s.meta)==null?void 0:c.did)||""},[s]);function B(){return[{name:o("notification.from"),value:S&&D?e.jsx(hs,{actors:G,teamDid:z,size:32,showName:!0}):e.jsx(xs,{size:32,blocklet:A,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(Re,{maxLength:50,children:n.title})},{name:o("notification.body"),value:S?e.jsx(gs,{notification:n,blocklet:s}):e.jsx(bs,{notification:n,rows:0})},{name:o("notification.severity"),value:e.jsx(Ne,{severity:n.severity})},{name:o("notification.createdAt"),value:e.jsx(is,{value:n.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(At,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const _={info:{label:o("common.basicInfo"),value:"info",component:B},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},M=Object.values(_).map(({label:c,value:g})=>({label:c,value:g})),J=_[O.tab]||_.info,ie=c=>{O.tab=c};return e.jsx(Nt,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{O.tab="info",t()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(ln,{children:[e.jsx(T,{mx:3,className:"tabs",children:e.jsx(wt,{tabs:M,current:O.tab,onChange:ie,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[O.tab==="receivers"&&e.jsx(en,{notificationId:n.id,resending:h,handleResend:R}),O.tab==="statistics"&&e.jsx(_e,{statistics:n.statistics,mode:"detail",resending:h,onResend:R}),O.tab==="info"&&e.jsx(J.component,{})]})]})})}const on=C.memo(Mt),ln=ue.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: ${Ae.text.disabled};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;we.propTypes={blocklet:x.object,label:x.string};we.defaultProps={blocklet:null,label:""};const cn=ue.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 we({blocklet:n,label:t}){var s;return e.jsx(cn,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(Lt,{size:24,blocklet:n,ancestors:n.ancestors}),e.jsx("span",{className:"name",children:n.title||((s=n.meta)==null?void 0:s.title)})]}):e.jsx("span",{className:"name",children:t})})}ct.propTypes={list:x.array.isRequired,label:x.string.isRequired,onDelete:x.func};ct.defaultProps={onDelete:()=>{}};function ct({list:n,label:t,onDelete:s}){return e.jsxs(T,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(ae,{children:[t,": "]}),n.map(r=>e.jsx(Qe,{size:"small",label:e.jsx(T,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(Ne,{severity:r})}),onDelete:o=>s(o,r)},r))]})}function dn(n){return e.jsx(at,{...n,renderLabel:t=>e.jsx(Ne,{severity:t})})}function un({customTableButtons:n}){var je;const{t,locale:s}=re(),r=jt(),o=C.useMemo(()=>vt(r,Kt()),[r]),[l,y]=C.useState(!1),{data:p,paging:h,blocklet:i,fetch:A,getComponent:O,componentDids:R,inService:S,teamDid:D}=tt(),G=C.useRef(null),[z,B]=C.useState(null),[_,M]=C.useState("info"),J=Cs(),[ie,c]=C.useState(!1),g=`notification-records-${(je=i.meta)==null?void 0:je.did}`,j=as(g),[N,E]=C.useState({pageSize:j.rowsPerPage||10,page:j.page?j.page+1:1,dids:j.dids||[],dateRange:j.dateRange||[se().subtract(1,"month").startOf("day").toDate(),se().endOf("day").toDate()]}),P=ce(()=>{if(!i.children||!i.children.length)return[];const v=[];return i.children.forEach(b=>{var I;const w=b.did||((I=b.meta)==null?void 0:I.did);R.includes(w)&&(b.ancestors=[i],v.push(b))}),v},[R,i]),a=async v=>{try{y(!0),await A(v),y(!1)}finally{y(!1)}};C.useEffect(()=>{a(N)},[N]),C.useEffect(()=>{const v=p.find(b=>b.id===(z==null?void 0:z.id));z&&v&&B({...v})},[p]);const m=(v,b,w,I)=>{v.stopPropagation();const k=w.filter(F=>F!==b);E(F=>({...F,[I]:k,page:1}))},$=({page:v,rowsPerPage:b,filterList:w})=>{const[I=[],,,,k=[]]=w;N.pageSize!==b?E(F=>({...F,pageSize:b,page:1})):N.page!==v+1?E(F=>({...F,page:v+1})):ye(N.dids,I)?ye(N.severities,k)||E(F=>({...F,severities:k,page:1})):E(F=>({...F,dids:I,page:1}))},U=C.useCallback(()=>{B(null),M("info")},[]),oe=C.useCallback(()=>{A(N)},[A,N]),le=[{label:t("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:v=>v.map((b,w)=>{var k;if(b==="system")return e.jsx("span",{children:t("notification.system")},`system-${w}`);const I=P.find(F=>{var d;return(F.did||((d=F.meta)==null?void 0:d.did))===b});return e.jsx(we,{blocklet:I,label:(I==null?void 0:I.title)||((k=I==null?void 0:I.meta)==null?void 0:k.title)},b)}),update:(v,b,w)=>(v[w].splice(b,1),v)},filterOptions:{names:P,logic:(v,b)=>b.length?!b.includes(v):!1,display:(v,b,w,I)=>e.jsxs(Y,{style:{width:"380px"},children:[e.jsx(Vt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(Yt,{multiple:!0,value:v[w],renderValue:k=>e.jsx(T,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:k.map(F=>{var d;if(F==="system")return e.jsx("span",{children:t("notification.system")},F);const ne=P.find(u=>{var L;return(u.did||((L=u.meta)==null?void 0:L.did))===F});return e.jsx(we,{blocklet:ne,label:(ne==null?void 0:ne.title)||((d=ne==null?void 0:ne.meta)==null?void 0:d.title)},F)})}),onChange:k=>{v[w]=k.target.value,b(v[w],w,I)},children:[e.jsx(ut,{value:"system",children:t("notification.system")}),P.map(k=>{var ne,d;const F=k.did||((ne=k.meta)==null?void 0:ne.did);return e.jsx(ut,{value:F,children:e.jsx(we,{blocklet:k,label:k.title||((d=k.meta)==null?void 0:d.title)})},F)})]})]})},customBodyRenderLite:v=>{var I,k;const b=p[v],w=O(b.componentDid);return e.jsxs(T,{display:"flex",alignItems:"center",gap:1,children:[w?e.jsx(Lt,{size:32,blocklet:w,ancestors:w.ancestors??[]}):e.jsx(js,{blocklet:i,size:32}),e.jsx(Re,{maxLength:50,children:((I=w==null?void 0:w.meta)==null?void 0:I.title)||((k=i==null?void 0:i.meta)==null?void 0:k.title)})]})}}},{label:t("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:v=>{const b=p[v],{receivers:w}=b;return e.jsx(Gt,{total:w.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(),B(b),M("receivers")},children:w.map(I=>{const{receiverUser:k}=I,F=Dt(k.avatar,D,S);return e.jsx(Tt,{alt:k.fullName,src:`${F}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:t("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:v=>{const b=p[v];return e.jsx(T,{onClick:w=>{w.stopPropagation(),B(b),M("statistics")},children:e.jsx(_e,{statistics:b.statistics})})}}},{label:t("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:v=>{const b=p[v];return e.jsx(Re,{maxLength:50,children:b.title})}}},{label:t("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:v=>{const b=p[v];return e.jsx(Ne,{severity:b.severity})},filter:!0,filterType:"custom",filterList:N.severities??[],customFilterListOptions:{render:v=>e.jsx(ct,{list:v,label:t("notification.severity"),onDelete:(b,w)=>{b.stopPropagation(),m(b,w,le[4].options.filterList,"severities")}}),update:Oe},filterOptions:{names:mt,fullWidth:!0,logic:De,display:(v,b,w,I)=>e.jsx(dn,{label:t("notification.severity"),filterList:v,onChange:b,index:w,column:I,filterValues:mt})}}},{label:t("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:v=>{const{createdAt:b}=p[v];return e.jsx(Ot,{value:b,locale:s,shouldUpdate:!0})}}}],pe=v=>{E(b=>({...b,dateRange:v,page:1}))},be=[e.jsxs(T,{display:"flex",alignItems:"center",gap:1.5,children:[e.jsx(Jt,{onClick:()=>c(!0),sx:{p:J?0:void 0},children:e.jsx(os,{})},"settings"),J?e.jsx(ae,{children:t("common.setting")}):null]}),...n||[]];return e.jsxs(T,{ref:G,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(pn,{children:e.jsx(yt,{theme:o,children:e.jsx(Rt,{className:"main-table",verticalKeyWidth:100,loading:l,locale:s,columns:le,data:p,durable:g,onChange:$,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...j,onRowClick:(v,{dataIndex:b})=>{B(p[b])}},customPreButtons:[e.jsx(rt,{value:N.dateRange,onChange:pe})],customButtons:be,components:{TableFilterList:v=>e.jsx(ot,{...v,itemComponent:b=>e.jsx(Pe,{...b,canDelete:w=>{var k;const I=(k=w==null?void 0:w.columnNames)==null?void 0:k[(w==null?void 0:w.index)||0];return(I==null?void 0:I.name)==="sender"}})})}})})}),z&&e.jsx(on,{refresh:oe,onCancel:U,notification:z,blocklet:i,tab:_}),e.jsx(Nt,{title:`${t("common.notification")} ${t("common.setting")}`,fullWidth:!0,maxWidth:"md",open:ie,onClose:()=>c(!1),PaperProps:{style:{minHeight:"500px"}},children:e.jsx(T,{sx:{mt:"-16px",overflowY:"hidden"},children:e.jsx(Ds,{})})})]})}const pn=ue.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
|
+
`;$t.propTypes={blocklet:x.object.isRequired,customTableButtons:x.array};$t.defaultProps={customTableButtons:[]};function $t({blocklet:n={},customTableButtons:t}){return e.jsx(Ps,{blocklet:n,children:e.jsx(un,{customTableButtons:t})})}export{$t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./vendor-react-DEoibe3W.js";import{j as L}from"./vendor-mui-core-
|
|
1
|
+
import"./vendor-react-DEoibe3W.js";import{j as L}from"./vendor-mui-core-BV2FUxWJ.js";var t=function(e){return L.jsxs("svg",{...e,children:[L.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.152 10.6417L31.72 0L13.288 10.6417V24.7942L1 31.8887V53.1722L19.432 63.8139L31.6902 56.7366L31.72 56.7538L31.7498 56.7366L44.008 63.8139L62.44 53.1722V31.8887L50.152 24.7942V10.6417ZM60.52 32.9972L48.232 25.9027V11.7502L31.72 2.21703L15.208 11.7502V25.9028L2.92 32.9972V52.0636L19.432 61.5968L31.6902 54.5196L31.72 54.5368L31.7498 54.5196L44.008 61.5968L60.52 52.0636V32.9972Z",fill:"url(#paint0_linear_615_426)"}),L.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.1521 24.8307L31.7201 14.189L13.2881 24.8307V46.1141L31.7201 56.7558L50.1521 46.1141V24.8307ZM15.2081 25.9392L31.7201 16.406L48.2321 25.9392V45.0056L31.7201 54.5388L15.2081 45.0056V25.9392ZM28.5464 23.0464C28.6641 22.6342 29.0408 22.3501 29.4695 22.3501H33.9707C34.3993 22.3501 34.776 22.6342 34.8938 23.0464L35.7504 26.0447L37.8696 27.2681L40.8945 26.5109C41.3103 26.4068 41.7447 26.591 41.959 26.9622L44.2096 30.8604C44.424 31.2316 44.3662 31.6998 44.0682 32.0079L41.8999 34.2489V36.6959L44.0682 38.9369C44.3662 39.245 44.424 39.7133 44.2096 40.0845L41.959 43.9827C41.7447 44.3539 41.3103 44.538 40.8945 44.4339L37.8696 43.6767L35.7504 44.9002L34.8938 47.8984C34.776 48.3106 34.3993 48.5947 33.9707 48.5947H29.4695C29.0408 48.5947 28.6641 48.3106 28.5464 47.8984L27.6897 44.9002L25.5706 43.6767L22.5457 44.4339C22.1299 44.538 21.6955 44.3539 21.4812 43.9827L19.2305 40.0845C19.0162 39.7133 19.0739 39.245 19.372 38.9369L21.5402 36.6959V34.2489L19.372 32.0079C19.0739 31.6998 19.0162 31.2316 19.2305 30.8604L21.4812 26.9622C21.6955 26.591 22.1299 26.4068 22.5457 26.5109L25.5706 27.2681L27.6897 26.0447L28.5464 23.0464ZM28.9861 27.5132C29.2018 27.3887 29.3607 27.1851 29.4292 26.9456L30.1936 24.2701H33.2466L34.011 26.9456C34.0794 27.1851 34.2383 27.3887 34.4541 27.5132L37.2459 29.1251C37.4617 29.2497 37.7174 29.2855 37.9591 29.225L40.6583 28.5493L42.1848 31.1932L40.25 33.193C40.0768 33.372 39.9799 33.6114 39.9799 33.8605V37.0843C39.9799 37.3334 40.0768 37.5728 40.25 37.7518L42.1848 39.7516L40.6583 42.3955L37.9591 41.7198C37.7174 41.6593 37.4617 41.6951 37.2459 41.8197L34.4541 43.4316C34.2383 43.5561 34.0794 43.7597 34.011 43.9992L33.2466 46.6747H30.1936L29.4292 43.9992C29.3607 43.7597 29.2018 43.5561 28.9861 43.4316L26.1942 41.8197C25.9785 41.6951 25.7228 41.6593 25.4811 41.7198L22.7819 42.3955L21.2554 39.7516L23.1902 37.7518C23.3634 37.5728 23.4602 37.3334 23.4602 37.0843V33.8605C23.4602 33.6114 23.3634 33.372 23.1902 33.193L21.2554 31.1932L22.7819 28.5493L25.4811 29.225C25.7228 29.2855 25.9785 29.2497 26.1942 29.1251L28.9861 27.5132ZM31.7201 41.6407C28.3134 41.6407 25.5517 38.8791 25.5517 35.4724C25.5517 32.0657 28.3134 29.3041 31.7201 29.3041C35.1268 29.3041 37.8884 32.0657 37.8884 35.4724C37.8884 38.8791 35.1268 41.6407 31.7201 41.6407ZM35.9684 35.4724C35.9684 37.8187 34.0664 39.7207 31.7201 39.7207C29.3738 39.7207 27.4717 37.8187 27.4717 35.4724C27.4717 33.1261 29.3738 31.2241 31.7201 31.2241C34.0664 31.2241 35.9684 33.1261 35.9684 35.4724Z",fill:"url(#paint1_linear_615_426)"}),L.jsxs("defs",{children:[L.jsxs("linearGradient",{id:"paint0_linear_615_426",x1:"31.72",y1:"95.7208",x2:"95.488",y2:"34.3249",gradientUnits:"userSpaceOnUse",children:[L.jsx("stop",{stopColor:"#0FA4B7"}),L.jsx("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),L.jsx("stop",{offset:"1",stopColor:"#2BE0D7"})]}),L.jsxs("linearGradient",{id:"paint1_linear_615_426",x1:"28.4374",y1:"99.2464",x2:"98.7613",y2:"44.9372",gradientUnits:"userSpaceOnUse",children:[L.jsx("stop",{stopColor:"#0FA4B7"}),L.jsx("stop",{offset:"0.494757",stopColor:"#1DC1C7"}),L.jsx("stop",{offset:"1",stopColor:"#2BE0D7"})]})]})]})};t.defaultProps={width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var s=function(e){return L.jsx("svg",{...e,children:L.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})})};s.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};export{s as E,t as S};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-D2t-u0YU.js","assets/vendor-react-DEoibe3W.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as e,aa as n,bb as g,T as S,O as U,bu as q,bs as W,bv as H,cI as L,y as O,ah as I,ai as N,cm as J,dA as X,dB as K,I as Y,dC as Q,e as Z,c0 as ee}from"./vendor-mui-core-
|
|
2
|
+
import{j as e,aa as n,bb as g,T as S,O as U,bu as q,bs as W,bv as H,cI as L,y as O,ah as I,ai as N,cm as J,dA as X,dB as K,I as Y,dC as Q,e as Z,c0 as ee}from"./vendor-mui-core-BV2FUxWJ.js";import{r as b}from"./vendor-react-DEoibe3W.js";import{H as te,a as B,e as re,i as ie,b as oe}from"./vendor-hooks-BgUTpb6X.js";import{T as ae,bt as se,_}from"./vendor-ux-did-connect-DprdyYny.js";import{aP as ne}from"./vendor-utils-rHXShPKm.js";import{getAIKitComponent as le}from"./index-CGHej0Ek.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CUb0jDdY.js";import"./index-Bs1kxR8_.js";import"./index-B6g_NzxF.js";import"./index-DVQCgvFb.js";const F=b.createContext({}),D=()=>b.useContext(F);function de({children:t,restrictions:c,i18n:s,theme:o}){const[l,f]=te({loading:!1}),x=a=>f(j=>({...j,loading:a})),p=b.useMemo(()=>({...l,onLoading:x,restrictions:c,i18n:s}),[l]);return e.jsx(ae,{theme:o,children:e.jsx(F.Provider,{value:p,children:t})})}const ce=["1024x1024","1024x1792","1792x1024"],xe=["256x256","512x512","1024x1024"],ue=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function me({onSubmit:t}){const{loading:c,i18n:s}=D(),o=B({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),l=()=>{const a=JSON.parse(JSON.stringify(o));Object.values(o).every(y=>!!y)&&t(a)},{run:f}=re(l,{wait:500}),x={width:"100%",pl:1,pr:1},p=o.model==="dall-e-2"?xe:ce;return e.jsxs(pe,{onSubmit:a=>a.preventDefault(),children:[e.jsx(n,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(g,{container:!0,gap:2.5,children:[e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:s("aiImagePrompt")}),e.jsx(U,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:s("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:o.prompt??"",onChange:a=>{a.stopPropagation(),o.prompt=a.target.value},inputProps:{maxLength:1e3}})]}),e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageModel")}`}),e.jsx(q,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:o.model,onChange:a=>{o.number=1,o.size="1024x1024",o.model=a.target.value},children:ue.map(a=>e.jsx(W,{value:a.value,control:e.jsx(H,{size:"small"}),label:a.label},a.label))})]}),e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageSize")}: ${o.size}`}),e.jsx(g,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(n,{flex:1,children:e.jsx(n,{...x,children:e.jsx(L,{size:"small",min:0,max:p.length-1,step:1,value:p.findIndex(a=>a==o.size),onChange:(a,j)=>{o.size=p[j]}})})})})]}),o.model==="dall-e-2"&&e.jsxs(g,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageNumber")}: ${o.number}`}),e.jsx(n,{...x,children:e.jsx(L,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:o.number,onChange:(a,j)=>{a.stopPropagation(),o.number=Number(j)}})})]})]})}),e.jsx(O,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:f,disabled:c,children:s(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const pe=I(n)`
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
height: 100%;
|
|
@@ -93,7 +93,7 @@ import{j as e,aa as n,bb as g,T as S,O as U,bu as q,bs as W,bv as H,cI as L,y as
|
|
|
93
93
|
& path:last-child {
|
|
94
94
|
fill: white;
|
|
95
95
|
}
|
|
96
|
-
`,je=b.lazy(()=>_(()=>import("./lottie-react.esm-D2t-u0YU.js"),__vite__mapDeps([0,1])).then(t=>({default:t.Player})));function T({src:t}){return e.jsx(je,{src:t,loop:!0,autoplay:!0})}function ye({options:t,handleApi:c,onSelect:s,onFinish:o,onClose:l,isMobile:f}){const{loading:x,onLoading:p,restrictions:a,i18n:j}=D(),[d,y]=b.useState([]),[
|
|
96
|
+
`,je=b.lazy(()=>_(()=>import("./lottie-react.esm-D2t-u0YU.js"),__vite__mapDeps([0,1])).then(t=>({default:t.Player})));function T({src:t}){return e.jsx(je,{src:t,loop:!0,autoplay:!0})}function ye({options:t,handleApi:c,onSelect:s,onFinish:o,onClose:l,isMobile:f}){const{loading:x,onLoading:p,restrictions:a,i18n:j}=D(),[d,y]=b.useState([]),[u,k]=b.useState(),P=Z(),z=a==null?void 0:a.maxNumberOfFiles,[m,A]=b.useState({}),h=B({}),R=Object.keys(h).filter(r=>h[r]),E={xs:6,sm:6};b.useEffect(()=>{u&&!m.error&&_(()=>import("./lottie-error-CMOXHtBH.js"),[]).then(r=>{A(i=>({...i,error:r.default}))}),t&&!d.length&&!m.loading&&_(()=>import("./lottie-loading-o-GBrhM9.js"),[]).then(r=>{A(i=>({...i,loading:r.default}))}),!t&&!m.welcome&&_(()=>import("./lottie-welcome-C9B95FIi.js"),[]).then(r=>{A(i=>({...i,welcome:r.default}))})},[u,t,d.length,m]),ie(async()=>{var r;if(t){k(void 0),p(!0);try{const i=await c({...t,responseFormat:"b64_json"});if(i.data){const w=(i.data||[]).map(C=>({src:`data:image/png;base64,${C.b64Json||C.b64_json}`,width:t.size?Number((t.size||"").split("x")[0]):1024,alt:t.prompt}));y(d?[...w,...d]:w)}else k(i)}catch(i){console.error("AIImage generate error: ",i),k(((r=i==null?void 0:i.response)==null?void 0:r.data)||i)}finally{p(!1),o()}}},[t==null?void 0:t.number,t==null?void 0:t.prompt,t==null?void 0:t.size]);const $=r=>{const i=Object.keys(h).filter(w=>h[w]);if(z?i.length<z:!0)h[r]?h[r]=!1:h[r]=!0;else{const w=i.pop();w!==r&&(h[w]=!1),h[r]=!h[r]}},M=r=>{if(d){const i=d.findIndex(v=>v.src===r);i>-1&&(h[r]=!1,d.splice(i,1),y([...d]))}},V=()=>{var i,v;const r={width:((i=document.querySelector(".photo-item img"))==null?void 0:i.offsetWidth)||0,height:((v=document.querySelector(".photo-item img"))==null?void 0:v.offsetHeight)||0};return e.jsx(e.Fragment,{children:Array.from({length:(t==null?void 0:t.number)||1}).map((w,C)=>b.createElement(g,{item:!0,...E,key:C},e.jsx(N,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...r}})))})},G=()=>u?e.jsxs(n,{width:300,height:300,m:"auto",children:[m.error&&e.jsx(T,{src:m.error},"error"),e.jsx(n,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:u==null?void 0:u.message})]}):d&&Array.isArray(d)&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx(n,{flexGrow:1,sx:{height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(ve,{sx:f?{p:0,border:"none !important"}:{p:2},children:e.jsxs(g,{spacing:2,container:!0,className:"photo-wrapper",children:[x&&e.jsx(V,{}),d.map((r,i)=>b.createElement(g,{item:!0,...E,key:r.src,className:"photo-item"},e.jsx(he,{...r,selected:h[r.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:h[r.src]?`2px solid ${P.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{$(r.src)},onDelete:()=>{M(r.src)}})))]})})}),e.jsxs(n,{sx:{mt:2,display:"flex",justifyContent:l?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[l&&typeof l=="function"&&e.jsx(O,{color:"primary",variant:"outlined",onClick:l,children:e.jsx(ee,{})}),e.jsx(O,{color:"primary",variant:"contained",disabled:!R.length||x,onClick:()=>{const r=ne(d,"src");s(R.map(i=>r[i]))},children:R.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):t?e.jsx(n,{width:220,height:220,m:"auto",children:m.loading&&e.jsx(T,{src:m.loading},"loading")}):e.jsx(n,{width:300,height:300,m:"auto",children:m.welcome&&e.jsx(T,{src:m.welcome},"welcome")});return e.jsx(we,{children:G()})}const we=I(n)`
|
|
97
97
|
min-height: 100%;
|
|
98
98
|
display: flex;
|
|
99
99
|
flex-direction: column;
|
|
@@ -158,4 +158,4 @@ import{j as e,aa as n,bb as g,T as S,O as U,bu as q,bs as W,bv as H,cI as L,y as
|
|
|
158
158
|
color: #9397a1;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
`;function Be({onSelect:t,api:c,restrictions:s,i18n:o,theme:l}){const[f,x]=b.useState(),[p,a]=b.useState(!1),j=()=>x(void 0),d=()=>a(!1),y=oe(document.body);let
|
|
161
|
+
`;function Be({onSelect:t,api:c,restrictions:s,i18n:o,theme:l}){const[f,x]=b.useState(),[p,a]=b.useState(!1),j=()=>x(void 0),d=()=>a(!1),y=oe(document.body);let u=!!(y&&y.width<768);if(!le())return e.jsx(n,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center",children:o("aiKitRequired")});const k=!u||u&&!p,P=!u||u&&p,z=u?d:!1;return e.jsx(de,{restrictions:s,i18n:o,theme:l,children:e.jsx(n,{sx:{display:"flex",width:"100%",height:"100%",bgcolor:"background.default"},children:e.jsxs(g,{container:!0,sx:{flexGrow:1,height:"100%"},children:[e.jsx(g,{item:!0,xs:12,sm:4,sx:{borderRight:u?"none":m=>`1px solid ${m.palette.divider}`,display:k?"unset":"none"},children:e.jsx(n,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:e.jsx(me,{onSubmit:(...m)=>{a(!0),x(...m)}})})}),e.jsx(g,{item:!0,xs:12,sm:8,sx:{height:"100%",overflow:"hidden",p:2,display:P?"unset":"none"},children:e.jsx(ye,{isMobile:u,options:f,handleApi:c,onSelect:t,onFinish:j,onClose:z})})]})})})}export{Be as default};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{r as b}from"./vendor-react-DEoibe3W.js";import{a as D,
|
|
1
|
+
import{r as b}from"./vendor-react-DEoibe3W.js";import{a as D,W as R,j as ie,B as z,b2 as be,am as pe,bN as re,Z as je,aA as Ce,bu as ke,c3 as Ke,b4 as ve,a7 as Te,a0 as Ae}from"./vendor-ux-did-connect-DprdyYny.js";import{d as we}from"./Edit-CNRD5aKM.js";import{f as Se}from"./index-8eXqqyHQ.js";import{r as me}from"./passport-item-hLzOrz7-.js";import{D as B,n as M,aL as De,G as Ie,f as Re}from"./index-B6g_NzxF.js";import{u as $}from"./dashboard-RTzIKcnI.js";import{j as e,H as x,bo as O,br as G,bn as H,q as V,aa as f,al as Q,O as E,ab as Be,bs as $e,bR as _e,ah as P,T as N,ad as ce,ak as Ne}from"./vendor-mui-core-BV2FUxWJ.js";import{O as Pe,a0 as We}from"./vendor-arcblock-CUb0jDdY.js";import{T as ue}from"./index-B4CzEaVv.js";import{C as xe}from"./confirm-BnRcXvxs.js";import{a0 as Le}from"./vendor-utils-rHXShPKm.js";import{C as F}from"./click-to-copy-DsH0RQVg.js";import{D as Ue}from"./delete-confirm-2yiel8lV.js";import{P as qe}from"./permission-BkpeOUF9.js";import{l as ze,y as Me}from"./vendor-hooks-BgUTpb6X.js";import{U as Ee,C as Fe,I as Oe}from"./index-iphP5FWX.js";import{B as Ge}from"./bundle-avatar-WoSDDX0E.js";import{p as He}from"./util-IzAdTupy.js";import{W as le}from"./did-address-2a_50VlM.js";import{A as Ve}from"./actions-XNIU_ion.js";import{u as Qe}from"./use-mobile-C21X4TYN.js";import{T as de}from"./table-tips-BP0JTpDH.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-DvcK7KsP.js";import"./PlayArrow-CrmMAssx.js";import"./get-safe-url-BdFxF8pA.js";import"./session-E0e-X6-a.js";import"./use-blocklet-logo-DeL5Lmpn.js";import"./InfoOutlined-Cxpk0UTX.js";import"./dot-itVN8XTt.js";import"./useAsync-510ntT1B.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BAa0wi8o.js";import"./vendor-mui-x-Bo-XOtzq.js";import"./AdapterDayjs-DnsMePpQ.js";import"./Phone-BkOMNOMO.js";import"./Location-DxPzfR_p.js";import"./Email-BirbvqZ3.js";import"./Timezone-D91Of94T.js";import"./base32-DEQDAhbh.js";import"./MoreHoriz-CKCGMlB8.js";function Z({value:t}){const{t:s,locale:m}=D(),l=new Date;return new Date(t)<l?e.jsxs("span",{style:{color:"red"},children:[e.jsx(R,{value:t,locale:m}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx(R,{value:t,locale:m,type:"all"})}Z.propTypes={value:x.string.isRequired};function J({value:t,onChange:s,...m}){const{t:l}=D(),d=b.useMemo(()=>[{value:"signature",title:l("setting.accessKey.signature"),description:l("setting.accessKey.signatureDesc")},{value:"simple",title:l("setting.accessKey.simple"),description:l("setting.accessKey.simpleDesc")}],[l]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...m,children:[e.jsx(G,{children:l("setting.accessKey.authType")}),e.jsx(H,{value:t,onChange:s,fullWidth:!0,label:l("setting.accessKey.authType"),children:d.map(o=>e.jsx(V,{value:o.value,children:e.jsxs(f,{children:[e.jsx("span",{children:o.title}),e.jsx(f,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:o.description})]})},o.value))})]})}J.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const L=()=>{const t=ie.RBAC_CONFIG.roles.filter(d=>d.passport),{inService:s}=B(),{roles:m}=$(),l=[...t,...s?m:[]];return Le(l,"name").filter(d=>d.name!==ie.ROLES.OWNER)};function X(t){const{remark:s,onCreate:m}=t,{api:l}=B(),{teamDid:d}=$(),{t:o}=D(),[k,j]=b.useState(!1),[c,h]=b.useState(null),y=L(),T=()=>{j(!1),h(null)},K=async a=>{const{remark:v,passport:r,authType:n}=a;j(!0);const u=await l.createAccessKey({input:{teamDid:d,remark:v.trim(),passport:r,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:n}}),{data:S}=u;m(S),h(null),j(!1)},g={title:`${o("common.create")} ${o("accessKey")}`,description:(a,v,r)=>e.jsxs(Q,{gap:3,children:[e.jsx(E,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:n=>{v({...a,remark:n.target.value,__disableConfirm:!a.passport||!n.target.value.trim()}),n.target.value.trim()?r(""):r(o("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:o("setting.accessKey.passport")}),e.jsx(H,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:n=>{const u=n.target.value;r(null),v({...a,passport:u,__disableConfirm:!a.remark||!u})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:k,children:y.map(n=>e.jsx(V,{value:n.name,"data-cy":`create-access-key-passport-option-${n.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:n.title||n.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:n.description})]})},n.name))})]}),e.jsx(J,{value:a.authType,onChange:n=>{v({...a,authType:n.target.value})}}),e.jsx(ue,{placeholder:o("setting.accessKey.expireTime"),value:a.expireAt,onChange:n=>{v({...a,expireAt:n,__disableConfirm:!a.passport||!a.remark||!n})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:K,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(z,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>h(g),className:"rule-action",children:[k?e.jsx(Be,{size:16}):e.jsx(Pe,{style:{fontSize:16}}),o("common.create")]}),c&&e.jsx(xe,{title:c.title,description:c.description,confirm:c.confirm,color:c.color,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}X.propTypes={remark:x.string,onCreate:x.func};X.defaultProps={onCreate:()=>{},remark:""};function Y(t){const{onConfirm:s,accessKeyId:m,accessKeySecret:l,hideSecret:d}=t,{t:o}=b.useContext(be),[k,j]=b.useState(!1),[c,h]=b.useState(()=>d),y=()=>{h(!c)},T=a=>{j(a.target.checked)},K=b.useMemo(()=>{var a;return d?`const Client = require('@abtnode/client');
|
|
2
2
|
|
|
3
3
|
const client = new Client(fullEndpoint);
|
|
4
4
|
client.setAuthAccessKey({
|
|
5
5
|
accessKeyId: "${m}",
|
|
6
6
|
accessKeySecret: "${l}",
|
|
7
7
|
});
|
|
8
|
-
`:`curl -H "Authorization: Bearer ${l}" "${(a=window.blocklet)==null?void 0:a.appUrl}/.well-known/service/api/did/session"`},[d,m,l]),g=b.useMemo(()=>{var a;return d?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${m} --access-secret ${l} {blockletPath}/.blocklet/bundle;`:null},[d,m,l]);return e.jsxs(pe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(
|
|
8
|
+
`:`curl -H "Authorization: Bearer ${l}" "${(a=window.blocklet)==null?void 0:a.appUrl}/.well-known/service/api/did/session"`},[d,m,l]),g=b.useMemo(()=>{var a;return d?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${m} --access-secret ${l} {blockletPath}/.blocklet/bundle;`:null},[d,m,l]);return e.jsxs(pe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(z,{disabled:d?!k:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ze,{children:o(d?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(q,{children:[e.jsx(U,{children:o("setting.accessKey.accessKeyId")}),e.jsx(F,{children:m})]}),e.jsxs(q,{children:[e.jsx(U,{children:o("setting.accessKey.accessKeySecret")}),c?e.jsx(z,{"data-cy":"show-secret-btn",color:"primary",onClick:y,children:o("setting.accessKey.showSecret")}):e.jsx(F,{children:l})]}),!c&&e.jsxs(q,{children:[e.jsx(U,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(re,{code:K,language:"javascript"}),g&&e.jsx(re,{code:g,language:"bash"})]}),d&&e.jsx("div",{children:e.jsx($e,{value:"end",disabled:c,control:e.jsx(_e,{checked:k,onChange:T}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}Y.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};Y.defaultProps={onConfirm:()=>{},hideSecret:!0};const U=P.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
align-items: center;
|
|
12
12
|
font-size: 16px;
|
|
13
13
|
margin-bottom: 8px;
|
|
14
|
-
`,
|
|
14
|
+
`,q=P.div`
|
|
15
15
|
margin-bottom: 24px;
|
|
16
|
-
`,
|
|
16
|
+
`,Ze=P.div`
|
|
17
17
|
font-size: 16px;
|
|
18
18
|
font-weight: bold;
|
|
19
|
-
`;function ee(t){const{t:s,locale:m}=D(),{api:l}=B(),{teamDid:d}=$(),{accessKeyId:o,time:k,remark:j,onDelete:c=()=>{},onClose:h=()=>{}}=t,y=()=>{h()},T=async()=>{try{await l.deleteAccessKey({input:{teamDid:d,accessKeyId:o}}),c()}catch(a){je.error(a==null?void 0:a.message)}finally{y()}},K=a=>({key:`<b>${o}</b>`,name:`<b>${j}</b>`,time:M(a,m),timeAge:
|
|
19
|
+
`;function ee(t){const{t:s,locale:m}=D(),{api:l}=B(),{teamDid:d}=$(),{accessKeyId:o,time:k,remark:j,onDelete:c=()=>{},onClose:h=()=>{}}=t,y=()=>{h()},T=async()=>{try{await l.deleteAccessKey({input:{teamDid:d,accessKeyId:o}}),c()}catch(a){je.error(a==null?void 0:a.message)}finally{y()}},K=a=>({key:`<b>${o}</b>`,name:`<b>${j}</b>`,time:M(a,m),timeAge:We(new Date(a),De(m))}),g={keyName:j,title:s("setting.accessKey.title"),description:k?`${s("setting.accessKey.description",K(k))}`:`${s("setting.accessKey.descriptionNoTime",{key:`<b>${o}</b>`,name:`<b>${j}</b>`})}`,confirmPlaceholder:s("setting.accessKey.confirm_desc",{name:j}),confirm:s("common.delConfirm"),cancel:s("common.cancel"),onConfirm:T,onCancel:y};return e.jsx(Ue,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}ee.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};ee.defaultProps={onDelete:()=>{},onClose:()=>{}};function te(t){const{accessKeyId:s,remark:m,onUpdate:l,passport:d,expireAt:o,authType:k,onClose:j}=t,{api:c}=B(),{teamDid:h}=$(),{t:y}=D(),[T,K]=b.useState(!1),g=L(),a=()=>{K(!1),j()},v=async n=>{const{accessKeyId:u,remark:S="",passport:p,expireAt:I,authType:W}=n;K(!0),await c.updateAccessKey({input:{teamDid:h,accessKeyId:u,remark:S.trim(),passport:p,expireAt:I?new Date(I).getTime():null,authType:W}}),l(),a()},r={title:`${y("common.update")} ${y("accessKey")}`,description:(n,u,S)=>e.jsxs(Q,{gap:3,children:[e.jsx(E,{label:y("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:n.accessKeyId,disabled:!0}),e.jsx(E,{label:y("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:n.remark,onChange:p=>{u({...n,remark:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?S(""):S(y("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{children:y("setting.accessKey.passport")}),e.jsx(H,{"data-cy":"update-access-key-select-passport",value:n.passport,onChange:p=>{const I=p.target.value;S(null),u({...n,passport:I,__disableConfirm:!n.remark||!I})},fullWidth:!0,label:y("setting.accessKey.passport"),disabled:T,children:g.map(p=>e.jsx(V,{value:p.name,"data-cy":`update-access-key-passport-option-${p.name}`,children:e.jsxs(f,{children:[e.jsx("span",{children:p.title||p.name}),e.jsx(f,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:p.description})]})},p.name))})]}),e.jsx(J,{disabled:!0,value:n.authType,onChange:p=>{u({...n,authType:p.target.value})}}),e.jsx(ue,{placeholder:y("setting.accessKey.expireTime"),value:n.expireAt,onChange:p=>{u({...n,expireAt:p,__disableConfirm:!n.passport||!n.remark||!p})}})]}),confirm:y("common.confirm"),cancel:y("common.cancel"),color:"primary",params:{accessKeyId:s,remark:m,passport:d,expireAt:o,authType:k},onConfirm:v,onCancel:a};return e.jsx(xe,{title:r.title,description:r.description,confirm:r.confirm,color:r.color,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})}te.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};te.defaultProps={onUpdate:()=>{},remark:"",passport:"",expireAt:"",authType:"signature",onClose:()=>{}};function se({accessKey:t,onCancel:s}){const{t:m}=D();return e.jsx(pe,{title:m("accessKey"),onClose:s,open:!0,PaperProps:{style:{maxWidth:800}},fullWidth:!0,children:e.jsx(Je,{children:e.jsx(ye,{accessKey:t})})})}se.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};se.defaultProps={};const Je=P(f)`
|
|
20
20
|
margin-top: -16px;
|
|
21
21
|
|
|
22
22
|
.tabs {
|
|
23
23
|
margin-left: 0;
|
|
24
24
|
margin-right: 0;
|
|
25
25
|
}
|
|
26
|
-
`;function ye({accessKey:t}){var a,v;const{t:s,locale:m}=D(),{api:l}=B(),{teamDid:d}=$(),{blocklet:o}=Ie(),k=
|
|
26
|
+
`;function ye({accessKey:t}){var a,v;const{t:s,locale:m}=D(),{api:l}=B(),{teamDid:d}=$(),{blocklet:o}=Ie(),k=L(),j=b.useCallback(async r=>r?(await l.getUser({input:{teamDid:d,user:{did:r}}})).user:null,[l,d]),c=ze(()=>j(t.createdBy),{}),h=((o==null?void 0:o.children)||[]).find(r=>{var n;return((n=r==null?void 0:r.meta)==null?void 0:n.did)===t.componentDid}),y=b.useMemo(()=>{var r;return He((r=c==null?void 0:c.data)==null?void 0:r.avatar,d,!0)},[(a=c==null?void 0:c.data)==null?void 0:a.avatar,d]),T=k.find(r=>r.name===t.passport),K=T?T.title:t.passport,g=[{title:s("common.baseInfo"),items:[{label:s("setting.accessKey.accessKeyId"),content:e.jsx(le,{did:t.accessKeyId,showQrcode:!0})},...t.authType==="simple"?[{label:s("setting.accessKey.accessKeySecret"),content:e.jsx(F,{children:`blocklet-${Ce.toBase58(t.accessKeyPublic)}`})}]:[],{label:s("common.role"),content:e.jsx(f,{children:me(K,t.passport)})},{label:s("common.createdVia"),content:t.createdVia},{label:s("common.createdBy"),content:c!=null&&c.data?e.jsx(f,{sx:{display:"flex",alignItems:"center",".MuiAvatar-root":{width:32,height:32}},children:e.jsx(Ee,{user:{...c.data,avatar:y},showDid:!0,cardType:Fe.Detailed,infoType:Oe.Minimal,sx:{border:0,padding:0}})}):t.createdBy?e.jsx(le,{did:t.createdBy,showQrcode:!0}):"-"}]},{title:s("common.timeInfo"),items:[{label:s("common.createdAt"),content:t.createdAt?e.jsx(R,{value:t.createdAt,type:"all",locale:m}):"-"},{label:s("common.lastUsedAt"),content:t.lastUsedAt?e.jsx(R,{value:t.lastUsedAt,type:"all",locale:m}):"-"},{label:s("common.expiredAt"),content:t.expireAt?e.jsx(Z,{value:t.expireAt}):s("common.neverExpired")}]},{title:s("common.otherInfo"),items:[{label:s("setting.accessKey.authType"),content:t.authType},{label:s("common.remark"),content:t.remark},...t.authType!=="signature"?[{label:s("setting.accessKey.resourceType"),content:t.resourceType||"-"},{label:s("setting.accessKey.resourceId"),content:t.resourceId||"-"}]:[],...h?[{label:s("setting.accessKey.component"),content:e.jsxs(f,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Ge,{blocklet:h,ancestors:[o]}),e.jsx(f,{ml:"16px",sx:{minWidth:0},children:e.jsxs(f,{className:"component-header",children:[e.jsx(f,{className:"component-name",children:Re.getDisplayName(h,!0)}),e.jsx(f,{className:"component-version",children:(v=h==null?void 0:h.meta)==null?void 0:v.version})]})})]},h)}]:[]]}];return e.jsx(Xe,{gap:3,children:e.jsx(f,{className:"info-area",children:g.map(r=>e.jsxs(f,{mb:3,children:[e.jsx(N,{variant:"h6",sx:{mb:1.5},children:r.title}),e.jsx(f,{className:"info-grid",children:r.items.map(n=>e.jsxs(f,{className:"info-item",children:[e.jsx(f,{className:"info-label",children:e.jsx(N,{variant:"subtitle2",color:"textSecondary",children:n.label})}),e.jsx(f,{children:n.content})]},n.label))})]},r.title))})})}ye.propTypes={accessKey:x.object.isRequired};const Xe=P(Q)`
|
|
27
27
|
.info-card {
|
|
28
28
|
margin-bottom: 24px;
|
|
29
29
|
overflow: hidden;
|
|
@@ -96,4 +96,4 @@ client.setAuthAccessKey({
|
|
|
96
96
|
margin: 0;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
`;function
|
|
99
|
+
`;function zt(){var oe,ae;const{t,locale:s}=D(),{api:m,inService:l}=B(),{teamDid:d}=$(),[o,k]=b.useState({}),[j,c]=b.useState(null),[h,y]=b.useState(null),[T,K]=b.useState(null),g=Qe(),a=L(),v=b.useRef(null),r=`access-keys-${d}`,n=ke(r),[u,S]=b.useState({searchText:n.searchText||"",pageSize:n.rowsPerPage||10,page:1}),p=Me(async()=>await m.getAccessKeys({input:{teamDid:d,paging:{page:u.page,pageSize:u.pageSize}}}),[u.page,u.pageSize]),{loading:I,error:W}=p,_=b.useMemo(()=>{var i;return((i=p.value)==null?void 0:i.list)||[]},[(oe=p.value)==null?void 0:oe.list]),fe=b.useMemo(()=>[{label:t("common.name"),name:"remark",options:{customBodyRender:(i,{rowIndex:A})=>{const w=_[A];return e.jsx(f,{display:"flex",alignItems:"center",gap:2,children:e.jsx(N,{children:w.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:i=>e.jsx(Ke,{showDidLogo:!1,children:i})}},{label:t("common.role"),name:"passport",options:{customBodyRender:i=>{const A=a.find(C=>C.name===i),w=A?A.title:i;return e.jsx(f,{children:me(w,i)})}}},{label:t("common.createdVia"),name:"createdVia",options:{customBodyRender:i=>e.jsx(N,{children:i})}},{label:t("setting.accessKey.authType"),name:"authType",options:{customBodyRender:i=>e.jsx(N,{children:t(`setting.accessKey.${i}`)})}},{label:t("common.createdAt"),name:"createdAt",options:{customBodyRender:i=>e.jsx(ce,{title:M(i,s),children:i?e.jsx(R,{value:i,locale:s}):"-"})}},{label:t("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:i=>e.jsx(ce,{title:M(i,s),children:i?e.jsx(R,{value:i,locale:s}):"-"})}},{label:t("common.expiredAt"),name:"expireAt",options:{customBodyRender:i=>i?e.jsx(Z,{value:i}):t("common.neverExpired")}},{label:t("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(i,{rowIndex:A})=>{const w=_[A];return e.jsx(Ve,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(we,{}),text:t("common.edit"),onClick:C=>{C.stopPropagation(),K(w)}},{icon:e.jsx(ve,{}),text:t("common.delete"),onClick:C=>{C.stopPropagation(),y(w)}}]})}}}],[_,s,t,a,y,K]),he=({page:i,rowsPerPage:A,searchText:w})=>{u.pageSize!==A?S(C=>({...C,searchText:"",pageSize:A,page:1})):u.page!==i+1?S(C=>({...C,searchText:"",page:i+1})):u.searchText!==w&&S(C=>({...C,searchText:w,page:1}))},ne=u.searchText?_.filter(i=>i.accessKeyId.toLowerCase().includes(u.searchText.toLowerCase())||(i.remark||"").toLowerCase().includes(u.searchText.toLowerCase())):_;return W?e.jsx(Ne,{severity:"error",children:Se(W)}):e.jsxs(f,{ref:v,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[g?e.jsx(de,{title:t("setting.accessKey.listTitle"),tooltipTitle:t("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${s}/access-key`}):null,e.jsx(Te,{durable:r,durableKeys:["page","rowsPerPage"],data:ne,columns:fe,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:u.page-1,rowsPerPage:u.pageSize,count:((ae=p.value)==null?void 0:ae.count)||0,searchDebounceTime:600,onRowClick(i,{dataIndex:A},w){var C;if((C=v.current)!=null&&C.contains(w.target)){const ge=ne[A];c(ge)}}},loading:I,onChange:he,title:g?null:e.jsx(de,{title:t("setting.accessKey.listTitle"),tooltipTitle:t("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${s}/access-key`}),customButtons:[e.jsx(qe,{permission:l?"":"mutate_accessKey",children:e.jsx(X,{onCreate:i=>{const{accessKeyId:A,accessKeySecret:w,authType:C}=i;k({show:!0,accessKeyId:A,accessKeySecret:w,authType:C})}})})],emptyNode:e.jsx(Ae,{children:t("oauth.client.empty")})}),o.show&&e.jsx(Y,{hideSecret:o.authType==="signature",onConfirm:()=>{p.retry(),k({show:!1})},...o}),j&&e.jsx(se,{onCancel:()=>c(null),accessKey:j}),h&&e.jsx(ee,{accessKeyId:h.accessKeyId,time:h.lastUsedAt,remark:h.remark||"N/A",onDelete:p.retry,onClose:()=>y(null)}),T&&e.jsx(te,{...T,onUpdate:p.retry,onClose:()=>K(null)})]})}export{zt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,ab as S,aa as c,H as d,ah as g}from"./vendor-mui-core-
|
|
1
|
+
import{j as t,ab as S,aa as c,H as d,ah as g}from"./vendor-mui-core-BV2FUxWJ.js";import{r as y}from"./vendor-react-DEoibe3W.js";import{b2 as v,C as w,B as m}from"./vendor-ux-did-connect-DprdyYny.js";import{P}from"./page-header-IRqa6Qvs.js";import{G as T}from"./index-B6g_NzxF.js";import{u as B}from"./config-space-DID86BbB.js";import{C as E,D as b,a as D}from"./connect-to-BYS6M9JU.js";import{S as u}from"./step-actions-Cy_Wn9XZ.js";import{S as G}from"./layout-BpHPXY7v.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-BgUTpb6X.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CUb0jDdY.js";import"./spaces-BKlIkPYo.js";import"./api-BjteVZFg.js";import"./index-8eXqqyHQ.js";import"./DeleteOutline-DIXSGJ49.js";import"./use-mobile-BAa0wi8o.js";import"./content-layout-fV4nyVb5.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=y.useContext(v),{blocklet:e}=T(),{spaceGateway:f,settingStorageEndpoint:C,updateSpaceGateway:j,hasStorageEndpoint:h,loading:o,storageEndpoint:s}=B();return o?t.jsx(w,{relative:"parent",children:t.jsx(S,{})}):t.jsxs(N,{children:[t.jsx("div",{className:"header",children:t.jsx(P,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:h?t.jsx(E,{spaceGateway:f,settingStorageEndpoint:C}):t.jsx(b,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(D,{onConnect:j,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(m,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(m,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:d.func,onPrevious:d.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const N=g(G)`
|
|
2
2
|
height: 100%;
|
|
3
3
|
overflow-y: auto;
|
|
4
4
|
`;export{l as default};
|