@abtnode/blocklet-services 1.16.52-beta-20251003-083412-fdfc4e36 → 1.16.52-beta-20251005-235515-42ad5caf
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/libs/connect/session.js +16 -1
- package/api/middlewares/check-running.js +9 -8
- package/api/middlewares/ensure-org-enabled.js +17 -0
- package/api/routes/blocklet.js +3 -3
- package/api/routes/user.js +175 -1
- package/api/services/auth/connect/switch-passport.js +2 -1
- package/api/services/auth/session.js +30 -0
- package/dist/assets/{AdapterDayjs-CAaLcejt.js → AdapterDayjs-wck-CfDF.js} +1 -1
- package/dist/assets/{Google-BMeng9mn.js → Google-BFauCF2k.js} +1 -1
- package/dist/assets/{access-control-BbcaXOFy.js → access-control-0wy7XAQb.js} +1 -1
- package/dist/assets/{actions-DbBJOD0d.js → actions-B4VXcSRp.js} +1 -1
- package/dist/assets/{add-component-core--Z5nF5rL.js → add-component-core-BM7p_09p.js} +23 -23
- package/dist/assets/add-resource-DbQFT7Gg.js +1 -0
- package/dist/assets/{addon-CnJnEleb.js → addon-CUvC0k6Y.js} +1 -1
- package/dist/assets/{advanced-DlEH3ib_.js → advanced-BhCewgzQ.js} +3 -3
- package/dist/assets/{aigne-CnGxZFk3.js → aigne-BQckonxP.js} +1 -1
- package/dist/assets/api-rC33aBSs.js +1 -0
- package/dist/assets/{appearance-DKR3ZZ-t.js → appearance-CjrhZWhd.js} +1 -1
- package/dist/assets/ar-CHd3xUx5.js +7 -0
- package/dist/assets/{arrow-down.svg-B_TkYBj9.js → arrow-down.svg-f3YCmAji.js} +1 -1
- package/dist/assets/{audit-logs-CY22RcFd.js → audit-logs-CASGp36e.js} +2 -2
- package/dist/assets/{authorize-DoJw-6hl.js → authorize-CkVYs-vE.js} +1 -1
- package/dist/assets/{base-chart-BbbiwJIa.js → base-chart-UFWO9a3P.js} +1 -1
- package/dist/assets/{base32-CgLd9kUN.js → base32-Cyneng4p.js} +1 -1
- package/dist/assets/{bind-account-CKozG7iQ.js → bind-account-D6KenxOW.js} +1 -1
- package/dist/assets/{branding-T8GaJvdM.js → branding-BVr5wVa5.js} +5 -5
- package/dist/assets/{branding-DqgDW-Pg.js → branding-CHhPscOd.js} +2 -2
- package/dist/assets/branding-DLDF3ZZP.js +1 -0
- package/dist/assets/{bundle-avatar-BALJ_pZQ.js → bundle-avatar-BpummNxa.js} +1 -1
- package/dist/assets/button-DGHIlhos.js +1 -0
- package/dist/assets/{click-to-copy-CVHuu877.js → click-to-copy-B379bwP3.js} +1 -1
- package/dist/assets/{cloneDeep-E2Pxqpbv.js → cloneDeep-LRq4Ya2k.js} +1 -1
- package/dist/assets/{collapse-DhGi244c.js → collapse-DJGzUM1Q.js} +1 -1
- package/dist/assets/complete-CQkeXJPL.js +39 -0
- package/dist/assets/{component-tJC1J22-.js → component-DWN2cI-c.js} +34 -34
- package/dist/assets/{config-CuaqTz1E.js → config-BgdQYz7Z.js} +2 -2
- package/dist/assets/{config-DkBKIb7u.js → config-CPB45HHq.js} +4 -4
- package/dist/assets/{config-CiixR7JW.js → config-CRxOjKmb.js} +1 -1
- package/dist/assets/config-navigation-D1TBA90f.js +40 -0
- package/dist/assets/config-space-DpOC6rFp.js +1 -0
- package/dist/assets/{confirm-BUTyrkJR.js → confirm-BfJfcPyj.js} +1 -1
- package/dist/assets/{connect-C2T5mJpT.js → connect-BbLXTlyu.js} +1 -1
- package/dist/assets/{connect-CwCzBgdq.js → connect-ZcwxKVuN.js} +1 -1
- package/dist/assets/{connect-to-C62UBG81.js → connect-to-Skv-ek56.js} +1 -1
- package/dist/assets/{content-layout-CaGd-JXO.js → content-layout-B9tc9LCL.js} +1 -1
- package/dist/assets/create-passport-svg-DosyhcHP.js +1 -0
- package/dist/assets/{createClass-BuhPvJV8.js → createClass-HFwzUuOB.js} +1 -1
- package/dist/assets/dashboard-DJ6Tc_2L.js +106 -0
- package/dist/assets/de-CD44Obtw.js +7 -0
- package/dist/assets/{delete-confirm-zH2oZyqM.js → delete-confirm-DNg1Z1xV.js} +1 -1
- package/dist/assets/{did-address-CeTjTMC4.js → did-address-Dbg_LiWL.js} +1 -1
- package/dist/assets/{domain-BmzmdNfA.js → domain-3JvbKqlt.js} +1 -1
- package/dist/assets/{domain-action-card-BM27YVmt.js → domain-action-card-BixPviaZ.js} +2 -2
- package/dist/assets/domains-D8QMeppe.js +1 -0
- package/dist/assets/{email-vdkECdsC.js → email-C6m1mnbN.js} +1 -1
- package/dist/assets/{empty-spinner-CkCqfxFX.js → empty-spinner-LXNYl6_1.js} +1 -1
- package/dist/assets/engine-DkWTqqhM.js +1 -0
- package/dist/assets/es-DNFAt0y7.js +9 -0
- package/dist/assets/{exchange-passport-DdKgNabQ.js → exchange-passport-BraV0EOe.js} +1 -1
- package/dist/assets/{form-DD1zzF-R.js → form-BIoto8u8.js} +1 -1
- package/dist/assets/form-text-input-BgpOkOYh.js +11 -0
- package/dist/assets/{form-wrapper-DNqXvSru.js → form-wrapper-Dt1iJZge.js} +1 -1
- package/dist/assets/fr-C9xE9tD4.js +7 -0
- package/dist/assets/{fuel-h75SX900.js → fuel-Dwo_gklT.js} +1 -1
- package/dist/assets/gen-access-key-DuRApUI5.js +1 -0
- package/dist/assets/{gen-simple-access-key-Bq7DCyW7.js → gen-simple-access-key-xXyYChfi.js} +1 -1
- package/dist/assets/get-safe-url-HFT553nb.js +1 -0
- package/dist/assets/hi-D_0DFJcS.js +5 -0
- package/dist/assets/{home-B3HQdfZf.js → home-D0rR9_38.js} +1 -1
- package/dist/assets/id-BgJjfH2L.js +7 -0
- package/dist/assets/iframe-COascK-f.js +1 -0
- package/dist/assets/{index-Dr9NaKfR.js → index-3ePiAFIp.js} +1 -1
- package/dist/assets/{index-BjcHj49D.js → index-A5fXAFXl.js} +1 -1
- package/dist/assets/{index-BtHqqZ50.js → index-AMzbVwE1.js} +1 -1
- package/dist/assets/{index-C_YGTMJ4.js → index-B3o5bPY9.js} +1 -1
- package/dist/assets/{index-Chi1YHs4.js → index-BAMrdOx5.js} +1 -1
- package/dist/assets/{index-BVRSxJRS.js → index-BO080WnZ.js} +1 -1
- package/dist/assets/index-BU5Qj_Uf.js +93 -0
- package/dist/assets/index-BiMTr9N1.js +6 -0
- package/dist/assets/index-BkMwz7Ha.js +281 -0
- package/dist/assets/{index-CZkVe8t1.js → index-BoF74OVD.js} +12 -12
- package/dist/assets/{index-6IwthDxj.js → index-BrrIKxMS.js} +1 -1
- package/dist/assets/{index-3xeMR-Qg.js → index-Bx-RW9vi.js} +1 -1
- package/dist/assets/{index-CKsy2_Ph.js → index-CARCeLG0.js} +2 -2
- package/dist/assets/index-CX8XMi66.js +1 -0
- package/dist/assets/{index-BzFZ1zhO.js → index-CjUelepA.js} +1 -1
- package/dist/assets/{index-BNDipwdR.js → index-Cv0WQg6r.js} +3 -3
- package/dist/assets/{index-BiLQGAIi.js → index-DKQpQSIL.js} +2 -2
- package/dist/assets/index-DKp1VidC.js +7 -0
- package/dist/assets/index-DOTZtBXk.js +113 -0
- package/dist/assets/{index-ImKSuLO2.js → index-DXDOA6wf.js} +2 -2
- package/dist/assets/{index-CmjYsAgT.js → index-DcGTEgwU.js} +4 -4
- package/dist/assets/index-DnsQF6x_.js +1 -0
- package/dist/assets/{index-BYry2QZ3.js → index-Ds4S1_JK.js} +3 -3
- package/dist/assets/index-DsZw1jDU.js +1039 -0
- package/dist/assets/{index-DbXxI_D0.js → index-IYdn8PnM.js} +1 -1
- package/dist/assets/index-Z8qCN0P1.js +200 -0
- package/dist/assets/{index-CzlhyS8_.js → index-cc7PDHui.js} +1 -1
- package/dist/assets/{index-BluBXQJ4.js → index-d3X4O8S1.js} +4 -4
- package/dist/assets/{index-KJrnzKIu.js → index-g1J2WU69.js} +1 -1
- package/dist/assets/index-o5365tSi.js +124 -0
- package/dist/assets/{index-CD_JYNBB.js → index-pMD5HObM.js} +10 -10
- package/dist/assets/{index-C2DPoZpQ.js → index-un8ZaNww.js} +5 -5
- package/dist/assets/{index-CGXZRmKt.js → index-yINGgTD8.js} +6 -6
- package/dist/assets/{invitation-CMi0GWFt.js → invitation-HIuSHONR.js} +7 -7
- package/dist/assets/invitations-Bol3LHDV.js +3 -0
- package/dist/assets/invite--kfNCB-y.js +1 -0
- package/dist/assets/{isURL-CSKc4kTl.js → isURL-NLB1KXWU.js} +1 -1
- package/dist/assets/issue-passport-DEKfDU5Q.js +1 -0
- package/dist/assets/{item-DsH8hlQV.js → item-8d2bomfb.js} +1 -1
- package/dist/assets/ja-SFs9TI5a.js +9 -0
- package/dist/assets/ko-CHdBh-EI.js +9 -0
- package/dist/assets/{landing-page-CAdZF71_.js → landing-page-BKWBeaB2.js} +1 -1
- package/dist/assets/{launch-result-message-B0--4ubW.js → launch-result-message-DW948RfZ.js} +1 -1
- package/dist/assets/{layout-CN4YohUY.js → layout-BCGFP2fM.js} +1 -1
- package/dist/assets/{list-Bf1rfvw3.js → list-CLnYaffq.js} +2 -2
- package/dist/assets/{list-2lBZBVJD.js → list-CjwYZK4C.js} +2 -2
- package/dist/assets/{list-header-DlrmpNef.js → list-header-DMpz8A8v.js} +1 -1
- package/dist/assets/localization-D4M90esB.js +1 -0
- package/dist/assets/{log-CKMWqM_9.js → log-CwhRn7dG.js} +1 -1
- package/dist/assets/logger-GZGSMwyW.js +1 -0
- package/dist/assets/login-D6vdg4tV.js +1 -0
- package/dist/assets/{login-oauth-callback-B4wL5LK5.js → login-oauth-callback-DNSbhkTX.js} +1 -1
- package/dist/assets/{logo-uploader-CgW-ljTo.js → logo-uploader-CehwiZZl.js} +2 -2
- package/dist/assets/{lost-passport-BiaJ8Qil.js → lost-passport-JcRjjJMu.js} +3 -3
- package/dist/assets/{observability-3BjnzXRV.js → observability-pdEZhjSl.js} +1 -1
- package/dist/assets/{omit-r-0RLWOV.js → omit-BQZKecPT.js} +1 -1
- package/dist/assets/{open-window-BAToG1Zw.js → open-window-5tX5UogI.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-D4EbV_XU.js → over-due-invoice-payment-BQTpVcW4.js} +1 -1
- package/dist/assets/overview-8cijjh6D.js +85 -0
- package/dist/assets/{page-header-DP0csqkR.js → page-header-DvSb4Cmz.js} +1 -1
- package/dist/assets/passport-dBKTMShn.js +1 -0
- package/dist/assets/{passport-item-DTKCI96Q.js → passport-item-DybXmjDL.js} +1 -1
- package/dist/assets/{permission-DWlLl3B8.js → permission-DPZmpN88.js} +1 -1
- package/dist/assets/{playground-BEhnKrD-.js → playground-C0bWoIDS.js} +1 -1
- package/dist/assets/preferences-CSIWwAIC.js +1 -0
- package/dist/assets/profile-embed-Dxmu0kHv.js +1 -0
- package/dist/assets/pt-BJowi6tZ.js +5 -0
- package/dist/assets/publish-resource-BEWgZsl5.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-9QLg1KOC.js → react-beautiful-dnd.esm-BbVphn6n.js} +1 -1
- package/dist/assets/{react-stripe.esm-DWiCVD55.js → react-stripe.esm-C51Uah32.js} +1 -1
- package/dist/assets/{required-BUAaYcMZ.js → required-BT8zXV8U.js} +1 -1
- package/dist/assets/ru-DTjDV3Pw.js +5 -0
- package/dist/assets/runtime-Dw23IX1l.js +1 -0
- package/dist/assets/{sanitize-mRppk1lK.js → sanitize-C5jEFDvG.js} +1 -1
- package/dist/assets/sdk-BIWRdmX9.js +1 -0
- package/dist/assets/{section-CCfmWVdK.js → section-ZPKr6_ii.js} +1 -1
- package/dist/assets/{security-D--MQBTg.js → security-D_vkAC2F.js} +1 -1
- package/dist/assets/session-tOfkTx-G.js +1 -0
- package/dist/assets/{setup-BS5cDalg.js → setup-eJiK00ap.js} +1 -1
- package/dist/assets/{shorten-label-DAXPWCI6.js → shorten-label-DVy6K5I7.js} +1 -1
- package/dist/assets/simple-select-BeAlThKq.js +1 -0
- package/dist/assets/{spaces-6iUrdnzs.js → spaces-f3sezu1Y.js} +1 -1
- package/dist/assets/start-tshF2U2D.js +187 -0
- package/dist/assets/starting-progress-CNhbI5kz.js +40 -0
- package/dist/assets/status-aauXt2lH.js +1 -0
- package/dist/assets/{step-actions-3Nz2nPoP.js → step-actions-B_qluS-3.js} +1 -1
- package/dist/assets/{studio-C6g9y1mS.js → studio-ahebVj52.js} +1 -1
- package/dist/assets/{switch-control-Bs2D4JNi.js → switch-control-B8BKalcv.js} +1 -1
- package/dist/assets/{table-tips-B1dFVdej.js → table-tips-CIe4hASP.js} +1 -1
- package/dist/assets/team-DJZO6TyJ.js +146 -0
- package/dist/assets/th-A3GLGlJ1.js +5 -0
- package/dist/assets/traffic-Dh4U8pnc.js +1 -0
- package/dist/assets/{transfer-B90XYpQX.js → transfer-CuvzwKCQ.js} +1 -1
- package/dist/assets/{unsubscribe-DBJXxz9h.js → unsubscribe-B1yTQQGf.js} +1 -1
- package/dist/assets/{use-app-logo-Cs4SrcDi.js → use-app-logo-CqD9SoXr.js} +1 -1
- package/dist/assets/{use-mobile-BW9mTiYC.js → use-mobile-BQQpAf3i.js} +1 -1
- package/dist/assets/{use-mobile-B_fpUHD7.js → use-mobile-D6YQgajG.js} +1 -1
- package/dist/assets/{use-server-logo-R848M-JH.js → use-server-logo-ClR4qaF0.js} +1 -1
- package/dist/assets/{use-window-close-Dk0lXOqo.js → use-window-close-CLNOz9Uq.js} +1 -1
- package/dist/assets/{useAsync-DkQHu4t4.js → useAsync-DVtDVEv6.js} +1 -1
- package/dist/assets/{useAsync-DoI7Qt9M.js → useAsync-fWwm3Jbj.js} +1 -1
- package/dist/assets/{useAsyncRetry-DNTidBXG.js → useAsyncRetry-EEjDgDMR.js} +1 -1
- package/dist/assets/{useLocalStorage-BzRs3x-K.js → useLocalStorage-BPSCf_zz.js} +1 -1
- package/dist/assets/user-center-DDfna1uE.js +126 -0
- package/dist/assets/user-follower-Cc-51q-9.js +32 -0
- package/dist/assets/{user-sessions-DqMaEduy.js → user-sessions-DkchVQBO.js} +1 -1
- package/dist/assets/{util-C8ahPkmT.js → util-B8Xud4vY.js} +1 -1
- package/dist/assets/{util-CRzq0bMY.js → util-D8KMfML_.js} +1 -1
- package/dist/assets/{vendor-arcblock-BhtOu00C.js → vendor-arcblock-CSGgL93G.js} +1 -1
- package/dist/assets/{vendor-hooks-BtDnIwBH.js → vendor-hooks-BlA8TRnZ.js} +2 -2
- package/dist/assets/vendor-mui-core-DRxbhqaK.js +250 -0
- package/dist/assets/{vendor-mui-x-DWX99wt-.js → vendor-mui-x-Qp6zkx78.js} +1 -1
- package/dist/assets/{vendor-utils-CVwaKsP9.js → vendor-utils-CUDP56Ff.js} +1 -1
- package/dist/assets/{vendor-ux-Cfhaj-oj.js → vendor-ux-CDOuCaX1.js} +3 -3
- package/dist/assets/vi-DGXwnYQW.js +5 -0
- package/dist/assets/{wait-connect-E47qTAaT.js → wait-connect-CGOeOXHL.js} +1 -1
- package/dist/assets/{wizard-2kfr1LiF.js → wizard-B7NraPoW.js} +1 -1
- package/dist/assets/{wizard-components-De0Ol72d.js → wizard-components-Bl0PwqPC.js} +7 -7
- package/dist/assets/wrap-locale-BQiQiZG-.js +1 -0
- package/dist/assets/zh-CJ0qBy8e.js +10 -0
- package/dist/assets/{zh-Du23hKEW.js → zh-DQ2rCoQ5.js} +1 -1
- package/dist/assets/zh-tw-Cs-zRk58.js +9 -0
- package/dist/index.html +6 -6
- package/dist/service-worker.js +1 -1
- package/package.json +32 -32
- package/dist/assets/add-resource-DRGO7kDY.js +0 -1
- package/dist/assets/api-BUbloWod.js +0 -1
- package/dist/assets/ar-DDKSNNIB.js +0 -7
- package/dist/assets/branding-Dc9wDqPm.js +0 -1
- package/dist/assets/button-BG8yGG9e.js +0 -1
- package/dist/assets/complete-Td6_SOPf.js +0 -39
- package/dist/assets/config-navigation-BFl1_q-j.js +0 -40
- package/dist/assets/config-space-B8dCR8jO.js +0 -1
- package/dist/assets/dashboard-B0Fy6SmC.js +0 -106
- package/dist/assets/de-C5jW-Aco.js +0 -7
- package/dist/assets/domains-CEkJn9DL.js +0 -1
- package/dist/assets/engine-CCa9THLZ.js +0 -1
- package/dist/assets/es-DnE5Se03.js +0 -9
- package/dist/assets/form-text-input-CqoNK3mi.js +0 -11
- package/dist/assets/fr-BpXortYf.js +0 -7
- package/dist/assets/gen-access-key-BZebBcUZ.js +0 -1
- package/dist/assets/get-safe-url-CeMtySPx.js +0 -1
- package/dist/assets/hi-CeUu25BW.js +0 -5
- package/dist/assets/id-BugYMmLN.js +0 -7
- package/dist/assets/iframe-ASQIizLx.js +0 -1
- package/dist/assets/index-6B51asLP.js +0 -292
- package/dist/assets/index-BIIL1VhU.js +0 -1039
- package/dist/assets/index-BlTmYBsg.js +0 -124
- package/dist/assets/index-CmsJ8Fn7.js +0 -1
- package/dist/assets/index-DBJZdu-W.js +0 -113
- package/dist/assets/index-Dn4pwRtk.js +0 -1
- package/dist/assets/index-DwQNuuxR.js +0 -283
- package/dist/assets/index-ajyKTkxP.js +0 -7
- package/dist/assets/invite-DpA2tJ_s.js +0 -1
- package/dist/assets/issue-passport-B0QyEUjC.js +0 -1
- package/dist/assets/ja-DaREJWmX.js +0 -9
- package/dist/assets/ko-DGXdpX64.js +0 -9
- package/dist/assets/localization-D12SXxDi.js +0 -1
- package/dist/assets/logger-CsgnUk8i.js +0 -1
- package/dist/assets/login-y-09uRl4.js +0 -1
- package/dist/assets/overview-C734Rasc.js +0 -85
- package/dist/assets/preferences-DTgCHjY9.js +0 -1
- package/dist/assets/profile-embed-4R2fOO01.js +0 -1
- package/dist/assets/pt-CIqefLTL.js +0 -5
- package/dist/assets/publish-resource-CHMkx0I2.js +0 -1
- package/dist/assets/ru-B4h3WudR.js +0 -5
- package/dist/assets/runtime-CUzpUEb5.js +0 -1
- package/dist/assets/sdk-CxjuM-ya.js +0 -1
- package/dist/assets/session-B_RHNjCZ.js +0 -1
- package/dist/assets/simple-select-BHPmFba3.js +0 -1
- package/dist/assets/start-ByPfhiAj.js +0 -187
- package/dist/assets/starting-progress-CxdsmebW.js +0 -40
- package/dist/assets/status-DA0S9WgZ.js +0 -1
- package/dist/assets/team-CcIOrTIk.js +0 -146
- package/dist/assets/th-BjttL5p9.js +0 -5
- package/dist/assets/traffic-KIPRLJPY.js +0 -1
- package/dist/assets/user-center-bNIwz7Mp.js +0 -126
- package/dist/assets/user-follower-UoHvZnoE.js +0 -32
- package/dist/assets/vendor-mui-core-BIZOanxj.js +0 -250
- package/dist/assets/vi-C-IhikR1.js +0 -5
- package/dist/assets/wrap-locale-Ck3zJtU5.js +0 -1
- package/dist/assets/zh-CWvcoHsp.js +0 -10
- package/dist/assets/zh-tw-D_73qm-O.js +0 -9
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import{j as e,y as Pt,bc as Pe,M as ie,ak as x,Q as H,W as u,J as pe,c1 as Rt,I as $,aN as It,T as I,aj as Tt,b5 as Le,P as Be,b6 as Q,a5 as We,z as Qe,A as Je,ci as At,bh as Mt,U as je,db as zt,dc as Et,at as X,dd as Lt,a6 as Z,n as ae,D as Bt,de as Wt,ar as Oe,b1 as Re,df as Ot,aX as Dt,am as Ce,bq as Nt,br as ye,a$ as $t,cW as Ut}from"./vendor-mui-core-DRxbhqaK.js";import{r as y,a as Ft,u as _t,j as qt}from"./vendor-react-Dvs43sk9.js";import{t as Xe,Z as Ht,a8 as Gt,R as De,D as Kt,C as le,n as V,A as Yt}from"./vendor-utils-CUDP56Ff.js";import{a as Vt,F as Zt,bw as Qt,c as Ie,W as Jt,bx as Xt,aW as Te,U as xe,bd as er,by as tr,a6 as rr,aY as nr,a7 as or,bz as sr}from"./index-DsZw1jDU.js";import{a as R,h as et,k as ee,g as G,b as E,j as ir}from"./vendor-hooks-BlA8TRnZ.js";import{l as tt}from"./arrow-down.svg-f3YCmAji.js";import{c as Ae,P as O,T as W,aw as ar,k as rt,ax as lr,H as q,ay as cr,az as dr,aA as Ne,f as ur,n as nt,e as Me,aB as pr,aC as M,C as xr,B as fr,$ as ot,aD as hr,aE as gr,A as mr,o as ce,I as $e,j as br,a1 as Ue}from"./vendor-ux-CDOuCaX1.js";import{N as yr}from"./list-CjwYZK4C.js";import{d as vr}from"./search-4YYphs0l.js";import{B as Fe}from"./bundle-avatar-BpummNxa.js";import{h as _e,T as wr}from"./team-DJZO6TyJ.js";import{b as jr,d as Cr,a as Sr,c as kr,e as Pr,f as Rr,h as Ir,_ as Tr}from"./user-center-DDfna1uE.js";import{T as qe,O as Ar}from"./index-BiMTr9N1.js";import{c as Mr}from"./passport-dBKTMShn.js";import{N as st,U as it}from"./index-un8ZaNww.js";import{u as te}from"./use-mobile-D6YQgajG.js";import zr from"./index-CjUelepA.js";import{f as J}from"./index-DBs9Ljax.js";import{u as Se}from"./index-A5fXAFXl.js";import{U as ve}from"./user-sessions-DkchVQBO.js";import Er from"./index-yINGgTD8.js";import{o as Lr}from"./vendor-arcblock-CSGgL93G.js";import{c as Br,b as de,a as Wr,S as Or}from"./index-Ds4S1_JK.js";import"./index-BrrIKxMS.js";import"./index-BojVbZw0.js";import{U as Dr}from"./user-follower-Cc-51q-9.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-AMzbVwE1.js";import"./util-D8KMfML_.js";import"./base32-Cyneng4p.js";import"./session-tOfkTx-G.js";import"./isURL-NLB1KXWU.js";import"./use-app-logo-CqD9SoXr.js";import"./index-d3X4O8S1.js";import"./use-mobile-BQQpAf3i.js";import"./actions-B4VXcSRp.js";import"./index-IYdn8PnM.js";import"./form-text-input-BgpOkOYh.js";import"./required-BT8zXV8U.js";import"./form-wrapper-Dt1iJZge.js";import"./edit.svg-DycWG9v3.js";import"./lock.svg-COUP8tyO.js";import"./index-BU5Qj_Uf.js";import"./permission-DPZmpN88.js";import"./confirm-BfJfcPyj.js";import"./click-to-copy-B379bwP3.js";import"./invitations-Bol3LHDV.js";import"./create-passport-svg-DosyhcHP.js";import"./api-rC33aBSs.js";import"./table-tips-CIe4hASP.js";import"./passport-item-DybXmjDL.js";import"./did-address-Dbg_LiWL.js";import"./index-CX8XMi66.js";import"./vendor-mui-x-Qp6zkx78.js";import"./AdapterDayjs-wck-CfDF.js";import"./delete-confirm-DNg1Z1xV.js";import"./index-DRYJ0xIl.js";function Nr(){let t=new Map;function n({root:s,rootMargin:o,threshold:i}){let a=t.get(s);a||(a=new Map,t.set(s,a));let l=JSON.stringify({rootMargin:o,threshold:i}),p=a.get(l);if(!p){let r=new Map;p={observer:new IntersectionObserver(f=>{f.forEach(h=>{r.get(h.target)?.(h)})},{root:s,rootMargin:o,threshold:i}),entryCallbacks:r},a.set(l,p)}return{observe:(r,f)=>{p.entryCallbacks.set(r,f),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:n}}var $r="0px",Ur=[0],Fr=Nr();function _r(t){let n=t?.rootMargin??$r,s=t?.threshold??Ur,o=y.useRef(null),i=y.useRef(null),a=y.useRef(null),[l,p]=y.useState(),r=y.useCallback(()=>{let C=o.current;if(!C){p(void 0);return}let v=Fr.getObserver({root:i.current,rootMargin:n,threshold:s});v.observe(C,c=>{p(c)}),a.current=v},[n,s]),f=y.useCallback(()=>{let C=a.current,v=o.current;v&&C?.unobserve(v),a.current=null},[]),h=y.useCallback(C=>{f(),o.current=C,r()},[r,f]),m=y.useCallback(C=>{f(),i.current=C,r()},[r,f]);return[h,{entry:l,rootRef:m}]}var qr=_r;function Hr(t){let[n,s]=qr(t),o=!!s.entry?.isIntersecting,[i,a]=y.useState(o);return o&&!i&&a(!0),[n,{...s,isVisible:o,wasEverVisible:i}]}var Gr=Hr,Kr=100;function Yr({loading:t,hasNextPage:n,onLoadMore:s,rootMargin:o,disabled:i,delayInMs:a=Kr}){let l=y.useRef(s),[p,{rootRef:r,isVisible:f}]=Gr({rootMargin:o});y.useEffect(()=>{l.current=s},[s]);let h=!i&&!t&&f&&n;return y.useEffect(()=>{if(h){let m=setTimeout(()=>{l.current()},a);return()=>{clearTimeout(m)}}},[h,a]),[p,{rootRef:r}]}var Vr=Yr;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ue.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ue({severity:t,size:n=8}){return we[t]?e.jsx(x,{component:"span",sx:{display:"inline-block",width:n,height:n,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}at.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function at({theme:t="dark",type:n="button",onSelectType:s,extra:o=void 0,currentTab:i="",loading:a=!1,...l}){const{t:p}=y.useContext(Ae),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],f=g=>{(g!==i||!a)&&s(g)},h=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:n==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return n==="line"?Object.assign(g,{}):g},[n,t]),m=(g,S,T)=>e.jsx(H,{disabled:a,onClick:()=>f(g.value),className:`profile-button ${S?"active":""}`,...l,children:g.label},g.value||T),C=(g,S,T)=>e.jsx(H,{variant:"text",disabled:a,onClick:()=>f(g.value),className:`profile-line-button ${S?"active":""}`,...l,children:g.label},g.value||T),v=()=>r?.map((g,S)=>{const T=i===g?.value;return n==="line"?e.jsx(y.Fragment,{children:C(g,T,S)},g.value||S):e.jsx(y.Fragment,{children:m(g,T,S)},g.value||S)}),c=g=>{const{value:S}=g.target;f(S==="all"?"":S)};return n==="select"?e.jsx(Pt,{sx:{maxWidth:300},children:e.jsx(Pe,{value:i||"all",onChange:c,size:"small",label:"Severity",IconComponent:g=>e.jsx(tt,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ie,{value:g.value||"all",children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ue,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(x,{className:"severity-tabs",sx:h,children:[e.jsx(x,{sx:{...n==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),o]})}lt.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function lt({loading:t,paging:n,onChange:s}){const{t:o}=y.useContext(Ae),i=pe(r=>r.breakpoints.down("md"));if(n.pageCount<=0||i)return null;const a=(r,f)=>{s({page:f+1})},l=r=>{const f=Number(r.target.value);s({page:1,pageSize:f})},p=n.page-1<=0?0:n.page-1;return e.jsx(x,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(Rt,{component:"div",disabled:t,count:n.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:o("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:f,count:h})=>`${r}–${f} / ${h!==-1?h:`${o()}more than ${f}`}`,rowsPerPage:n.pageSize,onPageChange:a,onRowsPerPageChange:l})})}const Zr=y.memo(lt),Qr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},He=6,Ge={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Jr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Ke=()=>({...Jr,width:"calc(50% - 8px)"});ct.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function ct({onFilterChange:t=()=>{},loading:n=!1,type:s="service",blockletMap:o={},filterType:i="component",selectedId:a=[],severity:l=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:f=()=>{},currentReadFilter:h="all"}){const{t:m}=y.useContext(Ae),[C,v]=y.useState(null),c=!!C,[g,S]=y.useState(a),[T,P]=y.useState(l),[b,z]=y.useState(!1),[L,F]=y.useState(""),[N,j]=y.useState([]);y.useEffect(()=>{S(a),P(l)},[a,l]);const k=[{label:m("notification.filterType.all"),value:"all"},{label:m("notification.filterType.unread"),value:"unread"}],D=d=>{(d!==h||!n)&&f(d)},K=[{label:m("notification.severityType.info"),value:"info"},{label:m("notification.severityType.success"),value:"success"},{label:m("notification.severityType.warning"),value:"warning"},{label:m("notification.severityType.error"),value:"error"}],re=d=>{v(d.currentTarget),F(""),z(!1)},he=()=>{v(null)},ne=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(w),t({id:w,severity:T})},oe=d=>{const w=T.includes(d)?T.filter(A=>A!==d):[...T,d];P(w),t({severity:w,id:g})},ge=d=>{F(d.target.value)},me=()=>{z(!b)},Y=Ft.useMemo(()=>{if(!o.size)return[];const d=[];return i==="component"&&d.push({label:m("notification.system"),id:"system"}),Array.from(o).forEach(([,w])=>{const A=w.did||w.meta?.did,B=w.title||w.meta?.title||"",_=w.appPid||w.appDid;(i==="component"&&_!==A||i==="entity"&&_===A)&&d.push({label:B,id:A,blocklet:w,ancestors:w.ancestors})}),d},[o,i,m]);y.useEffect(()=>{if(L.trim()==="")j(Y);else{const d=L.toLowerCase(),w=Y.filter(A=>A.label.toLowerCase().includes(d));j(w)}},[L,Y]);const be=L.trim()!==""||b?N:N.slice(0,He);return e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(x,{sx:{display:"flex",gap:1.5},children:k.map(d=>e.jsxs(H,{disabled:n,onClick:()=>D(d.value),className:`profile-button ${h===d.value?"active":""}`,sx:{...s==="service"&&h===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:h===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(x,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx($,{size:"small",onClick:re,disabled:n,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(O,{icon:Qr,hFlip:!0})}),e.jsx(It,{open:c,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(x,{children:[e.jsxs(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:m("notification.severity")}),e.jsx(x,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||T.length>0)&&e.jsx(H,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Tt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:m("notification.clear")})})]}),e.jsx(x,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(d=>e.jsx(Be,{elevation:0,sx:Ke(T.includes(d.value)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Ge},control:e.jsx(We,{checked:T.includes(d.value),onChange:()=>oe(d.value),disabled:n,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ue,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(x,{sx:{mb:2},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:m("notification.from")}),e.jsx(x,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:L,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Je,{position:"start",sx:{marginRight:"2px"},children:e.jsx(O,{icon:vr})})}}})})]}),e.jsx(Le,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:Ke(g.includes(d.id)),children:e.jsx(Q,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Ge},control:e.jsx(We,{checked:g.includes(d.id),onChange:()=>ne(d.id),disabled:n,size:"small"}),label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx(Fe,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),N.length>He&&L.trim()===""&&e.jsx(H,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(At,{}):e.jsx(Mt,{})})]})]})})]})]}),g.length>0||T.length>0?e.jsxs(x,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[T.map(d=>{const w=K.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ue,{severity:d}),w?w.label:d]}),onDelete:()=>oe(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=Y.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(Fe,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>ne(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Xr=X(Lt)`
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 20px;
|
|
4
|
+
right: 20px;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
@media (max-width: 600px) {
|
|
7
|
+
bottom: 16px;
|
|
8
|
+
right: 16px;
|
|
9
|
+
transform: scale(0.9);
|
|
10
|
+
}
|
|
11
|
+
`;function en(){const[t,n]=y.useState(!1);y.useEffect(()=>{const o=Xe(()=>{n(window.pageYOffset>300)},200);return window.addEventListener("scroll",o),o(),()=>window.removeEventListener("scroll",o)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(zt,{in:t,children:e.jsx(Xr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Et,{})})})}const tn=X.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: ${t=>t.inDialog?0:"24px"};
|
|
15
|
+
.MuiContainer-root {
|
|
16
|
+
padding-right: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.profile-button.MuiButtonBase-root {
|
|
20
|
+
border-radius: 9999px;
|
|
21
|
+
margin-right: 2px;
|
|
22
|
+
padding: 5px 12px;
|
|
23
|
+
line-height: 22px;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
border: 1px solid transparent;
|
|
26
|
+
background-color: ${({theme:t})=>t.palette.background.default};
|
|
27
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
border: 1px solid ${({theme:t})=>t.palette.divider} !important;
|
|
30
|
+
}
|
|
31
|
+
.profile-button.active.MuiButtonBase-root,
|
|
32
|
+
.profile-button.active.MuiButtonBase-root:hover {
|
|
33
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
background-color: ${({theme:t})=>ae(t.palette.primary.main,.1)};
|
|
36
|
+
border: 1px solid ${({theme:t})=>ae(t.palette.primary.main,.24)} !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.profile-button.MuiButtonBase-root:hover {
|
|
40
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.profile-line-button.MuiButtonBase-root {
|
|
44
|
+
margin-right: 2px;
|
|
45
|
+
color: ${({theme:t})=>t.palette.text.secondary};
|
|
46
|
+
padding: 5px 12px;
|
|
47
|
+
line-height: 22px;
|
|
48
|
+
font-size: 13px;
|
|
49
|
+
border: none !important;
|
|
50
|
+
border-radius: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.profile-line-button.active.MuiButtonBase-root {
|
|
54
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
55
|
+
border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.profile-button.MuiButtonBase-root:last-of-type,
|
|
59
|
+
.profile-line-button.MuiButtonBase-root {
|
|
60
|
+
margin-right: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.profile-line-button.MuiButtonBase-root:hover {
|
|
64
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
65
|
+
background-color: unset;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
* {
|
|
69
|
+
scrollbar-width: none; /* Firefox */
|
|
70
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
*::-webkit-scrollbar {
|
|
74
|
+
display: none; /* Chrome, Safari and Opera */
|
|
75
|
+
}
|
|
76
|
+
`;dt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function dt({blocklets:t=[],context:n,pagination:s=!0,inDialog:o=!1,filterType:i="component",toViewAll:a=()=>{},type:l="service"}){const{data:p,paging:r,refresh:f,loading:h,params:m,onReadNotification:C,componentDids:v,filterUnReadCount:c,initial:g}=n,S=d=>{f({...m,severity:d&&typeof d=="string"?[d]:d||[],paging:{...m.paging,page:1}})},[T]=_t(),P=R(()=>T.get("id"),[T]),b=pe(d=>d.breakpoints.down("md")),[z,L]=y.useState(0),[F,N]=y.useState(!1),j=y.useMemo(()=>m.read===!1?"unread":"all",[m.read]),k=R(()=>Xe(d=>{if(h)return;const w=p.length,A=p.filter(_=>!_e(_)).length;let B={...m,append:!0,paging:{...m.paging,...d,currentPage:(r.currentPage||0)+1}};j==="unread"&&A<w&&d.page>m.paging.page&&(B={...m,append:!0,paging:{...m.paging,...d,page:m.paging.page||1,currentPage:(r.currentPage||0)+1}}),f(B)},500),[p,m,j,r,h,f]);et(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&L(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),N(!0)},100),setTimeout(()=>{N(!1)},3e3)},[P]);const D=R(()=>p?.length>0&&p.length<z,[p,z]),K=y.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(B=>B)];return v?.includes(d)||A.findIndex(B=>B===d)>-1},[v]),re=y.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(B=>{d.has(B)||d.set(B,w)})),w?.children?.length>0&&w.children.forEach(B=>{const _=B?.did||B.meta?.did;_&&!d.has(_)&&K(_)&&(B.ancestors=[w],d.set(_,B))})}),d},[t,K]),he=y.useCallback(()=>{h||k({page:r.page+1})},[r.page,h,k]),[ne]=Vr({loading:h,hasNextPage:D,onLoadMore:he}),oe=d=>{!d||_e(d)||C(d.id).then(()=>{o&&a()})},ge=({severity:d,id:w})=>{if(h)return;let A={};i==="component"?A={entityId:[],componentDid:w}:i==="entity"&&(A={componentDid:[],entityId:w}),f({...m,severity:d,...A,paging:{...m.paging,page:1}})},me=d=>{if(h)return;let w={...m,paging:{...m.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=Ht(w,"read"),f(w)},Y=R(()=>i==="component"?Array.isArray(m.componentDid)?m.componentDid:[]:i==="entity"?Array.isArray(m.entityId)?m.entityId:[]:[],[m,i]),be=R(()=>(Array.isArray(m.severity)?m.severity:[])[0]||"",[m.severity]);return e.jsxs(tn,{inDialog:!!o,children:[o?e.jsx(at,{currentTab:be,type:"line",theme:"light",onSelectType:S}):e.jsx(ct,{loading:h,blockletMap:re,unReadCount:c,filterType:i,type:l,selectedId:Y,onFilterChange:ge,severity:m.severity,onReadFilterChange:me,currentReadFilter:j}),!b&&h?e.jsx(x,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):e.jsx(yr,{data:p,blockletMap:re,onReadNotification:oe,onReadBatch:C,inDialog:o,highlightId:P,highlight:!o&&F,type:l}),s&&!b?e.jsx(Zr,{loading:h,paging:r,onChange:k}):null,s&&b&&(h||D)?e.jsx(x,{ref:ne,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Z,{})}):null,!o&&b?e.jsx(en,{}):null]})}const rn=y.memo(dt),U=new Qt;function fe(t){const{userDid:n=""}={},{session:s}=Vt(),o=R(()=>{if(n)return n;const r=window.location.href,f=Gt(r);return f?.did?Array.isArray(f.did)?f.did[0]:f.did:s?.user?.did},[s?.user?.did,n]),i=R(()=>s.user,[s]),a=R(()=>i?o===i?.did:!1,[o,i?.did]),l=ee(async()=>{if(await Zt(()=>s?.initialized),a)return s.user;if(o)return U.user.getUserPublicInfo({did:o})},{refreshDeps:[o,a,s?.initialized,i]}),p=R(()=>i.passports?.some(r=>r.role===Ie.ROLES.OWNER),[i]);return{currentDid:o,session:s,isMyself:a,user:i,viewUser:l.data,isOwner:p}}function ut({user:t,...n}){const{t:s}=W(),o=Bt(),i=R(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===ar.REVOKED}));return p.sort((r,f)=>r.revoked===f.revoked?0:r.revoked?1:-1),De(p.filter(r=>!r.display),"role").concat(De(p.filter(r=>r.display),"display.content"))},[t?.passports]),a=R(()=>i?.find(p=>p.name===t.role),[i,t?.role]),l=o.palette.primary.main;return i.length===0?e.jsx(x,{children:e.jsx(rt,{children:s("userCenter.noPassport")})}):e.jsx(x,{...n,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...n.sx},children:i.map(p=>e.jsx(jr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Mr,title:a&&a.role===p.role?s("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:a&&a.role===p.role?`0px 2px 4px 0px ${l}, 0px 1px 2px -1px ${l}, 0px 0px 0px 1px ${l} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ut.propTypes={user:u.object.isRequired};function nn({visible:t,onClose:n,nft:s}){return!t||!s?null:e.jsx(on,{children:e.jsx(Wt,{open:t,onClose:n,children:e.jsx(sn,{onClick:n,children:e.jsx(st,{data:it(s),address:s.address,inset:!0})})})})}const on=X.div`
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
.mask {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mask {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
background: rgba(0, 0, 0, 0.6);
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transition: opacity 0.2s;
|
|
100
|
+
}
|
|
101
|
+
`,sn=X.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
height: 100vh;
|
|
106
|
+
width: 100vw;
|
|
107
|
+
|
|
108
|
+
img,
|
|
109
|
+
object {
|
|
110
|
+
max-width: 90vw;
|
|
111
|
+
max-height: 75vh;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nft-display--inset {
|
|
115
|
+
> .MuiBox-root,
|
|
116
|
+
.nft-display__loading {
|
|
117
|
+
width: 75vmin;
|
|
118
|
+
height: 75vmin;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,an=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:ae(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:ae(t.palette.background.paper,1)}}}),ln={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},Ye="https://main.abtnetwork.io/explorer";function pt({user:t}){const{t:n}=W(),s=te(),[o,i]=y.useState({visible:!1,nft:null}),[a,l]=y.useState({anchorEl:null,props:null}),p=P=>{const b=le(Ye,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,l({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:le(Ye,"assets",b.address)}})},f=P=>{i({visible:!0,nft:P})},h=G({page:1,size:20}),m=ee(async(P=h)=>(await Kt.get(`${Ie.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{ready:t?.did&&h,defaultParams:[h],refreshDeps:[t?.did,h]}),{loading:C,data:v}=m,c=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{h.page=b,m.run(h)},S=E(P=>[e.jsx($,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(O,{icon:"tabler:link",fontSize:18})},"link"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx($,{size:"small",onClick:b=>{b.stopPropagation(),f(P)},className:"mask-item",children:e.jsx(O,{icon:"tabler:eye",fontSize:18})},"view")]),T=R(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(Oe,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Oe,{width:"20%"}),e.jsx(x,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:n("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(rt,{children:n("userCenter.common.noNFT")})}),e.jsx(x,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(x,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...s?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(st,{data:it(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),s?e.jsx(x,{className:"footer-mask",sx:ln,children:S(P)}):e.jsx(x,{className:"mask",sx:an,children:e.jsx(Re,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),c.next||h.page>1?e.jsx(Ot,{sx:{display:"flex",justifyContent:"center",mt:2},page:h.page,onChange:g,count:Math.ceil(c.total/h.size),size:"small"}):null,e.jsx(nn,{visible:o.visible&&!!o.nft,nft:o.nft,onClose:()=>{i({visible:!1,nft:null})}}),e.jsx(lr,{anchorEl:a.anchorEl,onClose:()=>{l({anchorEl:null,props:null})},sharedProps:a.props||{title:"",url:""}})]})},[C,c,h.page,h.size,g,a,o]);return e.jsx(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:T})}pt.propTypes={user:u.object.isRequired};function cn(){const{t}=W(),{user:n,isMyself:s,viewUser:o}=fe();return e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(x,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ut,{user:n})]}):null,e.jsx(pt,{user:s?n:o})]})}const dn=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function xt({user:t,onSave:n}){const{t:s,changeLocale:o}=W(),i=G({locale:t.locale,loading:!1}),a=E(async l=>{try{const{value:p}=l.target;i.loading=!0,await U.user.saveProfile({locale:p}),await n("profile"),o(p),i.locale=p}catch(p){q.error(J(p))}finally{i.loading=!1}});return e.jsxs(x,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(x,{children:s("userCenter.commonSetting.locale")}),e.jsx(x,{children:e.jsx(Pe,{value:i.locale,onChange:a,size:"small",IconComponent:l=>e.jsx(tt,{...l,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||dn).map(l=>e.jsx(ie,{value:l.code,children:l.name},l.code))})})]})}xt.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function ke({onTest:t=V,onDelete:n=V,onSave:s=V,onCancel:o=V,type:i="slack",url:a="",edit:l=!1}){const{t:p}=W(),r=G({type:i||"slack",url:a||"",edit:l??!1,error:"",loading:!1}),f=E(()=>r.url?Jt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),h=E(()=>{r.edit=!1,r.url=a||"",r.type=i||"slack",r.error="",r.loading=!1,o()}),m=E(async c=>{r.loading=!0,await t(c),r.loading=!1}),C=E(c=>()=>{f()&&c({type:r.type,url:r.url})}),v=R(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(Z,{size:16}):e.jsx($,{size:"small",onClick:C(m),sx:{mr:-1},children:e.jsx(O,{icon:Cr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(x,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(Pe,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:c=>{r.type=c.target.value},children:[e.jsx(ie,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ie,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:c=>{r.url=c.target.value,f()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Je,{position:"end",children:v})}}}),e.jsx(x,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"success",onClick:C((...c)=>{s(...c),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:cr})}),e.jsx($,{color:"error",onClick:h,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:dr})})]}):e.jsxs(e.Fragment,{children:[e.jsx($,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:Sr})}),e.jsx($,{color:"error",onClick:()=>{n({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(O,{icon:kr})})]})})]})]})}ke.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function se({title:t=void 0,description:n=void 0,value:s,onChange:o,isMobile:i}){const a=E(l=>{l.stopPropagation()});return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Se,{checked:s,size:"small",onChange:o}),e.jsxs(I,{component:"div",onClick:a,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:i?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:i?"normal":"nowrap"},children:[t,n]})]})}se.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function ft({user:t,isMobile:n}){const{t:s}=W(),o=G({showAdd:!1}),i=ee(async()=>await U.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),a=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...i?.data?.notifications||{}}),[i?.data?.notifications]),l=R(()=>i?.data?.webhooks||[],[i?.data?.webhooks]),p=E(async v=>{try{await U.user.saveUserNotificationConfig(v),q.success(s("userCenter.saveSuccess")),i.run()}catch(c){q.error(J(c))}}),r=E(async(v,c)=>{await p({notifications:{[v]:c}})}),f=async v=>{try{await U.user.testNotificationWebhook(v),q.success(s("userCenter.webhookTested"))}catch(c){q.error(J(c))}},h=E(async v=>{await p({webhooks:l.filter((c,g)=>g!==v)})}),m=E(async(v,c)=>{await p({webhooks:l.map((g,S)=>S===v?c:g)})}),C=E(async v=>{await p({webhooks:[...l,v]}),o.showAdd=!1});return i.error?e.jsx(Dt,{severity:"error",children:i.error.message}):i.loading||!i.data?e.jsx(x,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Z,{})}):e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(se,{value:a.wallet,isMobile:n,title:s("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(ur,{did:Ne(t),showQrcode:!1,showAvatar:!n,copyable:!0,compact:!0,responsive:!0,startChars:n?2:6})}),e.jsx(se,{value:a.email,isMobile:n,onChange:v=>r("email",v.target.checked),title:s("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(se,{isMobile:n,value:a.push,title:s("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Re,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[l.map((v,c)=>e.jsx(ke,{onTest:f,onDelete:()=>h(c),onSave:(...g)=>m(c,...g),type:v.type,url:v.url,edit:!1},`${c}_${v.url}`)),o.showAdd&&e.jsx(ke,{onTest:f,onCancel:()=>{o.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(nt,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(O,{icon:Pr}),onClick:()=>{o.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}ft.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function ht({item:t}){const n=Me(),{blocklet:s}=Xt(),{confirmApi:o,confirmHolder:i}=Te(),a=G({loading:!1}),{t:l}=W(),{session:p}=y.use(xe),{bindOAuth:r,unbindOAuth:f,setBaseUrl:h,baseUrl:m}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),c=R(()=>pr[t?.provider]||"unknown",[t?.provider]),g=E(b=>b?._bind?b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY&&n.arcSphere?l("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&n.arcSphere?l("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),S=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,z)=>{o.open({title:l("userCenter.thirdPartyLogin.disconnectPasskey",{name:c}),content:l("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){C({session:p,connectedAccount:t}).then(b).catch(z),L()},onCancel:b})});return}try{a.loading=!0,await new Promise((b,z)=>{if(t?._bind)o.open({title:l("userCenter.thirdPartyLogin.confirmUnbind",{name:c}),content:l("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:c}),confirmButtonText:l("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:l("common.cancel"),onConfirm(L){f({session:p,connectedAccount:{...Yt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),L()},onCancel:b});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:b,onCancel:z});else{const L=m,F=window?.blocklet;let N="/";const j=xr(F),k=fr(F);j&&k?.appPid&&p?.user?.sourceAppPid&&(N=k.appUrl),h(N),v(s?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{h(L),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{a.loading=!1}}),T=E(b=>b.provider===M.WALLET&&b.did?l("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?l("userCenter.thirdPartyLogin.mainAccount"):b?._bind?l("userCenter.thirdPartyLogin.disconnect"):l("userCenter.thirdPartyLogin.connect")),P=E(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(n.arcSphere||n.wallet)?!0:!!t._mainProvider,[n.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(x,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(er,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(x,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:c}),t.userInfo?.email||t.did?e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(x,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(qe,{title:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(x,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]}),children:e.jsx(x,{component:O,icon:tr,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(qe,{title:g(t),placement:"auto",children:e.jsx(x,{children:e.jsx(nt,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,L=b.palette.primary.main;return{color:t?._bind?z:L,borderColor:t?._bind?z:L,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:L,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:a.loading?null:e.jsx(O,{icon:Rr}),onClick:S,disabled:P(t),loading:a.loading,children:T(t)})})}),i]})}ht.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function gt({user:t}){const{session:n}=y.use(xe),[s,o]=y.useState({}),{getOAuthConfigs:i}=n.useOAuth(),a=Me();ir(async()=>{const r=await i({sourceAppPid:t?.sourceAppPid});o(r)},[t?.sourceAppPid]);const l=R(()=>{const r=Object.keys(s).map(f=>({...s[f],provider:f})).filter(f=>f.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[s]),p=R(()=>{const r=hr(t);let f=!1,h="",m=gr(t);const C=r.find(c=>c.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(c=>c.provider==="google")||(f=!0,h=M.GOOGLE,m===M.AUTH0&&(m=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(c=>c.provider===M.APPLE)||(f=!0,h=M.APPLE,m===M.AUTH0&&(m=M.APPLE))),C.id.startsWith("github|")&&(r.some(c=>c.provider===M.GITHUB)||(f=!0,h=M.GITHUB,m===M.AUTH0&&(m=M.GITHUB)))),l.map(c=>{if(c.provider===M.AUTH0&&f)return null;const g=f&&c.provider===h?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===c.provider);return g?{...c,provider:c.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:c.provider===m}:{...c,provider:c.provider,_rawProvider:c.provider,_mainProvider:c.provider===m}}).filter(c=>!(!c||c.provider===M.PASSKEY&&!c.did)).sort((c,g)=>c._mainProvider?-1:c?.order!==void 0&&g?.order!==void 0?c.order-g.order:c?.order!==void 0?-1:1)},[t?.connectedAccounts,l]);return e.jsxs(x,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(ht,{item:r},r?.provider)),a.wallet||a.arcSphere?null:e.jsx(rr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:V,onError:V,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}gt.propTypes={user:u.object.isRequired};function mt({configList:t,onSave:n}){const[s,o]=y.useState(t),{t:i}=W(),a=E(async(l,p)=>{try{const r=await U.user.saveUserPrivacyConfig({[l]:typeof p=="string"?p:!p});o(s.map(f=>({...f,value:r?.[f.key]??f.value}))),q.success(i("userCenter.saveSuccess")),n("privacy")}catch(r){q.error(J(r))}});return y.useEffect(()=>{o(t)},[t]),e.jsx(x,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:s.map(l=>{if(l.isPrivate)return null;const p=!l.value||["all","follower-only"].includes(l.value);return e.jsxs(x,{children:[e.jsx(Se,{checked:p,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("userCenter.toPublic",{name:l.name})})},size:"small",onChange:r=>{const{checked:f}=r.target;l.followersOnly?a(l.key,f?"all":"private"):a(l.key,f)}},l.key),l.followersOnly&&p&&e.jsx(x,{sx:{pl:3,pt:1},children:e.jsx(Se,{checked:l.value==="follower-only",labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:i("team.userFollowers.followersOnly")})},size:"small",onChange:r=>{const{checked:f}=r.target;a(l.key,f?"follower-only":"all")}})})]})})})}mt.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function bt({user:t,sessionUser:n}){const s=R(()=>(t?.passports||[])?.find(o=>o.name===n.role),[t?.passports,n?.role]);return e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),e.jsxs(x,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ce,{title:n.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),e.jsx(je,{label:s?.title||s?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(Ce,{title:n.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}bt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const un=()=>Promise.resolve(""),Ve=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ze={display:"flex",justifyContent:"flex-end",textAlign:"right"},pn=new nr({concurrency:1}),ze=y.memo(({userSession:t,isMobile:n=!1})=>{const s=G({loading:!0,ipRegion:""}),{t:o}=W();y.useEffect(()=>{pn.add(async()=>{try{s.ipRegion=await un(t.lastLoginIp)}finally{s.loading=!1}})},[s,t.lastLoginIp]);const i=R(()=>n?{display:"flex",justifyContent:"flex-end"}:{},[n]);return e.jsx(x,{...n&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:s.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:s.ipRegion}),e.jsx(Ue,{size:16,className:"ip-address",style:i,children:t.lastLoginIp||o("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{size:16,className:"ip-address",style:i,children:t.lastLoginIp||o("userCenter.unknown")}),s.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(Z,{size:12,color:"inherit"})}):null]})})});ze.propTypes={userSession:u.object.isRequired,isMobile:u.bool};ze.defaultProps={isMobile:!1};function yt({user:t,showAction:n=!0,showUser:s=!0,getUserSessions:o,showOffline:i=!1}){const a=G({status:"online",page:1,pageSize:10}),l=G({online:0,expired:0,offline:0}),p=mr(),{t:r,locale:f}=W(),h=te({key:"md"}),m=pe(j=>j.breakpoints.down("lg")),{confirmApi:C,confirmHolder:v}=Te(),c=E(async()=>{const j=await o({page:a.page,pageSize:a.pageSize,status:a.status}),k=j?.paging?.total||0;return l[a.status]=k,{total:k,list:j?.list||[]}});et(async()=>{const j=await o({page:1,pageSize:1,status:"expired"});l.expired=j?.paging?.total||0;const k=await o({page:1,pageSize:1,status:"offline"});l.offline=k?.paging?.total||0});const g=ee(c,{refreshDeps:[a.status,a.page,a.pageSize]}),S=R(()=>g.data?.list||[],[g.data?.list]),T=R(()=>{const{status:j}=a;return j==="online"?l[j]<=1:l[j]===0},[S,p]),P=R(()=>ce({},h?Ze:{}),[h]),b=E(({visitorId:j})=>{C.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=a,{list:D=[]}=g.data||{},K=D.length||0;k>1&&K===1&&(a.page=Math.max(k-1,1)),g.refresh(),C.close()}})}),z=E(()=>{C.open({title:r("userCenter.logoutAllSession",{type:r(a.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(a.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await U.user.logout({status:a.status,visitorId:p,includeFederated:!0}),a.page=1,g.refresh(),C.close()}})}),L=[];n&&L.push(e.jsx(Ce,{title:r("userCenter.logoutAllTips",{type:r(a.status)}),children:e.jsx(H,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:z,disabled:T,children:r("userCenter.logoutAll",{type:r(a.status)})})},"logoutAll"));const F=R(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:a.page-1,rowsPerPage:a.pageSize,count:g.data?.total||0}),[g.data?.total,a.page,a.pageSize]),N=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.os?.name,D.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=S[j],D=Ve(k?.ua);return e.jsx(x,{sx:P,children:[D.browser?.name,D.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.extra?.walletOS?k.extra.walletOS.toUpperCase():r("userCenter.unknown")})}}},s&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:ce({minWidth:150,maxWidth:250},h?Ze:{}),children:e.jsx(bt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.createdAt?e.jsx($e,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!i&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:k.status==="expired"?r("userCenter.expired"):e.jsx($e,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(ze,{userSession:k,isMobile:h})}}},n&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=S[j];return e.jsx(x,{sx:P,children:e.jsx(H,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>b({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(x,{className:"pc-user-sessions",sx:{maxWidth:h?"unset":m?"calc(100vw - 300px)":"100%",...h&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...h&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[v,e.jsx(br,{count:g.data?.total||0,data:S,columns:N,customButtons:L,options:F,locale:f,loading:g.loading,className:"pc-user-sessions-table",title:e.jsxs(Nt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{a.status=j.target.value},children:[e.jsx(Q,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.online,")"]})]})}),e.jsx(Q,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.expired,")"]})]})}),i?e.jsx(Q,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:a.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",l.offline,")"]})]})}):null]}),onChange:j=>{a.page=j.page+1,a.pageSize=j.rowsPerPage}})]})}yt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function vt({onDestroySelf:t=void 0}){const{confirmHolder:n}=Te(),{t:s}=W(),{session:o}=y.use(xe),i=E(async()=>{if(!t||typeof t!="function")return;const a=o.withSecondaryAuth(t,{extraParams:{removeUserDid:o?.user?.did,input:{user:{did:o?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await a(),o.logout()}catch(l){q.error(l?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(x,{children:e.jsxs(x,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(x,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(H,{variant:"contained",color:"error",size:"small",onClick:i,children:s("userCenter.dangerZone.delete")})]})}),n]})}vt.propTypes={onDestroySelf:u.func};function xn(){const t=te({key:"md"}),n=pe(i=>i.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},o=R(()=>ce({},t?s:{}),[t]);return e.jsx(x,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":n?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:i=>`${i.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Er,{isSelf:!0,columnSx:o})})}function wt({onDestroySelf:t=void 0,userCenterTabs:n=[]}){const{t:s}=W(),{user:o,session:i,isMyself:a,isOwner:l}=fe(),r=Me().arcSphere,f=te({key:"md"}),h=ee(async()=>o&&a?await U.user.getUserPrivacyConfig({did:o.did}):null,{refreshDeps:[o,a],loadingDelay:300}),m=R(()=>n.map(c=>({key:c.value,name:c.label,value:c.protected,isPrivate:c.isPrivate,followersOnly:c.followersOnly})),[n]),C=E(async c=>c==="privacy"?(await h.runAsync(),h.data):(c==="profile"&&await i.refresh(),null));y.useEffect(()=>{const c=window.location.hash.slice(1);c&&document.getElementById(c)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[r?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(xt,{user:o,onSave:C})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(ft,{user:o,isMobile:f})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(gt,{user:o})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(xn,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(zr,{})},{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(mt,{configList:m,onSave:C})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:o,showUser:!1,getUserSessions:c=>U.userSession.getMyLoginSessions({},c)})},!l&&t&&typeof t=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(vt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[o,m,f,l,t]);return a?e.jsx(x,{className:"user-center-settings",sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},"@media (min-width: 1200px) and (max-width: 1260px)":{maxWidth:750},"@media (min-width: 1100px) and (max-width: 1199px)":{maxWidth:650},"@media (min-width: 1000px) and (max-width: 1099px)":{maxWidth:600},"@media (max-width: 1049px)":{maxWidth:"100%"}},children:v.map(c=>c?e.jsxs(x,{id:c.value,sx:ce({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},c.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:c.label}),e.jsx(x,{sx:{mt:2.5},children:c.content})]},c.value):null)}):null}wt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const jt=y.createContext({}),{Provider:fn,Consumer:Ro}=jt;function Ct({children:t}){const[n]=y.useState(!1),{session:s}=y.use(xe),{user:o}=s,[i,a]=y.useState(),l=y.useMemo(()=>o?.didSpace?.endpoint,[o?.didSpace]);y.useEffect(()=>{a(o?.didSpace)},[o?.didSpace]);const p=async()=>{a(void 0)},r=m=>{},f=async m=>{a(m),await r(m.endpoint)},h=!!(l&&i);return e.jsx(fn,{value:{loading:n,spaceGateway:i,session:s,deleteSpaceGateway:p,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:r,hasStorageEndpoint:h},children:t})}function Ee(){return y.use(jt)}Ct.propTypes={children:u.node.isRequired};function hn(t){const n=t.replace(/\/api\/space\/.+/,""),o=t.replace(/\/$/,"").split("/").at(-4);return le(n,"space",o)}function St({session:t,spaceGateway:n,spaceStatus:s,refresh:o}){return e.jsxs(Re,{direction:"row",spacing:1,children:[s===Br.DISCONNECTED&&e.jsx(de,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await o()},onError:i=>{console.error(i),q.error(J(i))}}),e.jsx($,{size:"small",LinkComponent:$t,href:hn(n.endpoint),target:"_blank",children:e.jsx(Ut,{})})]})}St.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function kt({spaceGateway:t=void 0}){const{t:n}=W(),{updateSpaceGateway:s,session:o}=Ee(),i=te(),a=({spaceGateway:l})=>s(l);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(x,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:n("userCenter.storage.spaces.connected.title")}),!i&&e.jsx(de,{connectScope:"user",connectText:n("userCenter.storage.spaces.connected.switch"),session:o,onSuccess:a})]}),e.jsx(x,{children:t&&e.jsx(Wr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:l=>e.jsx(St,{session:o,...l})},t.endpoint)}),i&&e.jsx(x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(de,{connectScope:"user",connectText:n("userCenter.storage.spaces.connected.switch"),session:o,onSuccess:a})})]})}kt.propTypes={spaceGateway:u.object};function gn(){const{t}=W(),{updateSpaceGateway:n,session:s}=Ee(),o=({spaceGateway:i})=>n(i);return e.jsxs(x,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Or,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(x,{children:e.jsx(de,{session:s,onSuccess:o})})]})}function mn(){const{spaceGateway:t,hasStorageEndpoint:n,loading:s}=Ee(),{isMyself:o}=fe();return o?s?e.jsx(Lr,{relative:"parent",children:e.jsx(Z,{})}):e.jsx(yn,{children:e.jsx(x,{sx:{maxWidth:"720px"},children:n?e.jsx(kt,{spaceGateway:t}):e.jsx(gn,{})})}):null}function bn(){return e.jsx(Ct,{children:e.jsx(mn,{})})}const yn=X(x)`
|
|
122
|
+
height: 100%;
|
|
123
|
+
overflow-y: auto;
|
|
124
|
+
`;function vn(){const{user:t,isMyself:n,viewUser:s}=fe(),{followed:o}=Ir();return e.jsx(x,{children:e.jsx(Dr,{teamDid:window?.blocklet?.did||"",user:n?t:s,showInvitees:n,followed:o})})}function wn({tab:t=""}){const{api:n}=or(),s=y.useRef(null),o=qt(),i=t||o.tab,l=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),p=sr(),r=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(h=>({...h,meta:{...h,did:h.did,name:h.name||h.title||"",logo:"logo.png"}}))})),f=async h=>{const{input:m,sessionId:C}=h;try{await n.destroySelf({input:{...m,sessionId:C}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(wr,{mode:"user-center",children:e.jsxs(Tr,{ref:s,embed:l==="1",currentTab:i?le(Ie.WELLKNOWN_SERVICE_PATH_PREFIX,"user",i):"",disableAutoRedirect:i==="settings",children:[i==="notifications"?e.jsx(rn,{blocklets:[r],context:p}):null,i==="nfts"?e.jsx(cn,{}):null,i==="settings"?e.jsx(wt,{onDestroySelf:f}):null,i==="did-spaces"?e.jsx(bn,{}):null,i==="user-followers"?e.jsx(vn,{}):null,i==="orgs"?e.jsx(Ar,{id:o.id||""}):null]})})}wn.propTypes={tab:u.string};export{wn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a,D as M,T as _,ce as
|
|
1
|
+
import{j as a,D as M,T as _,ce as T,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as Y,av as B,f as C,b$ as J,ch as K}from"./vendor-mui-core-DRxbhqaK.js";import{r as d,k as L,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aU as te}from"./index-DsZw1jDU.js";import{e as ie}from"./vendor-hooks-BlA8TRnZ.js";import{M as re,l as m,X as A,Z as S}from"./vendor-ux-CDOuCaX1.js";import{z as oe}from"./vendor-arcblock-CSGgL93G.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|
|
@@ -12,7 +12,7 @@ import{j as a,D as M,T as _,ce as L,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as
|
|
|
12
12
|
0px 1px 4px rgba(0, 0, 0, 0.3),
|
|
13
13
|
0px 0px 20px rgba(0, 0, 0, 0.1);
|
|
14
14
|
}
|
|
15
|
-
`;function ce({images:e,links:i,prefix:t="/images",addons:r=void 0,logo:s=void 0,...l}){const o=M(),n=
|
|
15
|
+
`;function ce({images:e,links:i,prefix:t="/images",addons:r=void 0,logo:s=void 0,...l}){const o=M(),n=L(),c=(x,p)=>new RegExp(`/${p}`).test(n.pathname);return a.jsxs(he,{...l,children:[a.jsx(z,{to:"/",className:"sidebar-logo",children:s||a.jsx(A,{showText:!1,size:20})}),i.map(({url:x,name:p,title:b,showBadge:g})=>{const f=c(x,p);return a.jsxs(pe,{component:z,selected:f,to:x,children:[a.jsx(ne,{name:e[p],size:36,color:f?"#00c2c4":o.typography.color.main,prefix:t,showBadge:g}),a.jsx(_,{component:"span",className:"menu-title",children:b})]},x)}),a.jsx("div",{style:{flex:1}}),r]})}const he=d.memo(m("div")`
|
|
16
16
|
flex: 1;
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
@@ -33,7 +33,7 @@ import{j as a,D as M,T as _,ce as L,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as
|
|
|
33
33
|
display: block;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`),
|
|
36
|
+
`),V="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",pe=m(W)`
|
|
37
37
|
&& {
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
@@ -41,14 +41,14 @@ import{j as a,D as M,T as _,ce as L,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
width: 100%;
|
|
43
43
|
transition: all 200ms ease-in-out;
|
|
44
|
-
background: ${e=>e.selected?
|
|
44
|
+
background: ${e=>e.selected?V:""};
|
|
45
45
|
padding: 24px 0;
|
|
46
|
-
border-left: 2px solid ${e=>e.selected?
|
|
46
|
+
border-left: 2px solid ${e=>e.selected?T.A700:"transparent"};
|
|
47
47
|
border-radius: 0;
|
|
48
48
|
|
|
49
49
|
&:hover {
|
|
50
|
-
background: ${
|
|
51
|
-
border-left-color: ${
|
|
50
|
+
background: ${V};
|
|
51
|
+
border-left-color: ${T.A700};
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.menu-title {
|
|
@@ -160,7 +160,7 @@ import{j as a,D as M,T as _,ce as L,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as
|
|
|
160
160
|
box-shadow: 2px 16px 10px 0 rgba(0, 0, 0, ${e=>e.theme.palette.mode==="light"?.05:.5});
|
|
161
161
|
border: 0;
|
|
162
162
|
}
|
|
163
|
-
`;function be({links:e=[],brand:i="",description:t="",images:r,title:s="Home",brandAddon:l=void 0,headerAddon:o=void 0,prefix:n="/images",fullWidth:c=!1,contentLayout:x="column",className:p="",homeUrl:b="/",logo:g=void 0,children:f,...P}){const w=ie(document.body)?.width||0,[v,F]=d.useState(w>=960?"permanent":"temporary"),[k,y]=d.useState(v==="permanent");d.useEffect(()=>{const N=w>=960?"permanent":"temporary";F(N),y(N!=="temporary")},[w]);const $=()=>{y(!k)},j=c||x==="row";return a.jsxs(me,{className:`dashboard ${p}`,...P,children:[a.jsx(E,{title:`${s}-${i}`}),a.jsx(ue,{className:"dashboard__header",onToggleMenu:$,brand:i,brandAddon:l,description:t,addons:o,homeUrl:b,logo:g}),a.jsxs(h,{className:"dashboard__body",sx:{display:"flex"},children:[a.jsx(Y,{variant:v,className:"drawer",classes:{paper:"drawerPaper"},open:k,onClose:$,ModalProps:{disablePortal:!0,keepMounted:!0},children:a.jsx(ce,{className:"dashboard__sidebar",images:r,links:e,prefix:n,logo:g})}),a.jsxs(h,{className:"dashboard__main",children:[a.jsx(B,{maxWidth:j?!1:"lg",className:"dashboard__content",children:f}),a.jsx(S,{})]})]})]})}function
|
|
163
|
+
`;function be({links:e=[],brand:i="",description:t="",images:r,title:s="Home",brandAddon:l=void 0,headerAddon:o=void 0,prefix:n="/images",fullWidth:c=!1,contentLayout:x="column",className:p="",homeUrl:b="/",logo:g=void 0,children:f,...P}){const w=ie(document.body)?.width||0,[v,F]=d.useState(w>=960?"permanent":"temporary"),[k,y]=d.useState(v==="permanent");d.useEffect(()=>{const N=w>=960?"permanent":"temporary";F(N),y(N!=="temporary")},[w]);const $=()=>{y(!k)},j=c||x==="row";return a.jsxs(me,{className:`dashboard ${p}`,...P,children:[a.jsx(E,{title:`${s}-${i}`}),a.jsx(ue,{className:"dashboard__header",onToggleMenu:$,brand:i,brandAddon:l,description:t,addons:o,homeUrl:b,logo:g}),a.jsxs(h,{className:"dashboard__body",sx:{display:"flex"},children:[a.jsx(Y,{variant:v,className:"drawer",classes:{paper:"drawerPaper"},open:k,onClose:$,ModalProps:{disablePortal:!0,keepMounted:!0},children:a.jsx(ce,{className:"dashboard__sidebar",images:r,links:e,prefix:n,logo:g})}),a.jsxs(h,{className:"dashboard__main",children:[a.jsx(B,{maxWidth:j?!1:"lg",className:"dashboard__content",children:f}),a.jsx(S,{})]})]})]})}function U({routerLinkComponent:e,to:i,external:t=!1,children:r,...s}){return t?a.jsx("a",{href:i,...s,children:r}):a.jsx(e,{to:i,...s,children:r})}function R({...e}){return a.jsx(U,{routerLinkComponent:z,...e})}function ge({className:e="",...i}){const t=i.external&&typeof e=="function"?e({}):e;return a.jsx(U,{routerLinkComponent:ee,className:t,...i})}function D(e,i){if(e.children?.length)return fe(e,i);const{url:t,icon:r,title:s,showBadge:l,external:o,active:n}=e;return a.jsx("li",{className:"layout-sidebar-item",children:a.jsxs(ge,{external:o,to:t,className:({isActive:c})=>C("layout-sidebar-link",{"layout-sidebar-link--active":o?n:c}),children:[r&&a.jsx("span",{className:`layout-sidebar-icon ${l?"layout-sidebar-badge":""}`,children:r}),a.jsx(_,{component:"span",className:"layout-sidebar-link-text",children:s})]})},`${t}-${i}`)}function fe(e,i){return a.jsxs("li",{className:"layout-sidebar-group",children:[a.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),a.jsx("ul",{children:e.children.map(D)})]},`group-${e.title}-${i}`)}function I({links:e,addons:i=void 0,dense:t=!1,...r}){return a.jsxs(je,{...r,className:C({"layout-sidebar-dense":t}),children:[a.jsx("ul",{children:e.map(D)}),a.jsx("div",{style:{flex:1}}),i]})}const ye="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",je=m("div")`
|
|
164
164
|
display: flex;
|
|
165
165
|
flex-direction: column;
|
|
166
166
|
ul {
|
|
@@ -285,7 +285,7 @@ import{j as a,D as M,T as _,ce as L,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as
|
|
|
285
285
|
margin-top: 16px;
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
`;function we({closeMenu:e,...i}){const t=
|
|
288
|
+
`;function we({closeMenu:e,...i}){const t=L();return d.useEffect(()=>{e()},[t]),a.jsx(te,{...i})}function G(e,i){return e.map(t=>t.children?.length?{...t,label:t.title,children:G(t.children,i)}:{...t,label:a.jsx(R,{to:t.url,external:t.external,children:t.title}),active:t.external?t.active:!!ae({path:t.url,end:!1},i.pathname)})}function ke({title:e="Home",headerProps:i={},links:t=[],sidebarWidth:r=120,fullWidth:s=!1,dense:l="auto",footerProps:o={},sx:n={},children:c,hideHtmlTitle:x=!1,...p}){const b=M(),{inFullPage:g,showToggleButton:f,headerVisible:P,footerVisible:w,sidebarVisible:v,toggleFullPage:F}=se(),k=L(),y=d.useMemo(()=>G(t,k),[k,t]),$=y.some(u=>!!u.children?.length),j=l==="auto"?y.length>=8||$:l,N=C("dashboard",{"dashboard-dense":j},p.className),O={homeLink:u=>a.jsx(R,{to:window.blocklet?.prefix||"/",children:u}),...i};return d.useEffect(()=>{const{searchParams:u}=new URL(window.location.href);u.get("inviter")&&window.localStorage.setItem("inviter",u.get("inviter"))},[]),a.jsxs(ve,{sx:n,...p,className:N,sidebarWidth:r,children:[!x&&a.jsx(E,{title:e},e),P&&a.jsx($e,{...O,className:"dashboard-header",children:t?.length?({isMobile:u,closeMenu:Q})=>u?a.jsx(we,{mode:"inline",items:y,closeMenu:Q,bgColor:"transparent",activeTextColor:b.palette.primary.main}):null:null}),a.jsxs(h,{className:"dashboard-body",sx:{display:"flex"},children:[!!t?.length&&v&&a.jsx(h,{className:"dashboard-sidebar",sx:{display:{xs:"none",md:"block"}},children:j?a.jsx(I,{links:t,dense:j}):a.jsx(h,{className:"dashboard-sidebar-container",children:a.jsx(I,{links:t,dense:j})})}),a.jsxs(h,{className:"dashboard-main",id:"arc__dashboard-main",children:[f&&a.jsx(h,{sx:{position:"absolute",top:4,right:4,display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,color:"#fff",bgcolor:"rgba(158,158,158, 0.6);",borderRadius:1,cursor:"pointer"},onClick:F,children:g?a.jsx(J,{style:{fontSize:18}}):a.jsx(K,{style:{fontSize:18}})}),a.jsx(B,{className:"dashboard-content",id:"arc__dashboard-content",...s&&{maxWidth:!1},children:c}),w&&a.jsx(S,{dark:b.palette.mode==="dark",...o})]})]})]})}const ve=m(h)`
|
|
289
289
|
&.dashboard {
|
|
290
290
|
display: flex;
|
|
291
291
|
flex-direction: column;
|
|
@@ -345,4 +345,4 @@ import{j as a,D as M,T as _,ce as L,Q as W,cf as X,aV as Z,ak as h,cg as q,aU as
|
|
|
345
345
|
.header-container {
|
|
346
346
|
max-width: 100%;
|
|
347
347
|
}
|
|
348
|
-
`;function
|
|
348
|
+
`;function Le({legacy:e=!0,...i}){return e?a.jsx(be,{...i}):a.jsx(le,{children:a.jsx(ke,{...i})})}export{se as d,Le as x};
|