@abtnode/blocklet-services 1.17.8-beta-20260119-102944-6ba93a16 → 1.17.8-beta-20260125-093329-64b43854
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/index.js +5 -0
- package/api/libs/connect/session.js +33 -39
- package/api/middlewares/launcher-login.js +1 -2
- package/api/routes/federated.js +1 -2
- package/api/routes/oauth/server.js +1 -2
- package/api/routes/user-session.js +0 -2
- package/api/routes/user.js +61 -41
- package/api/services/auth/connect/destroy-self.js +0 -2
- package/api/services/auth/connect/invite.js +0 -2
- package/api/services/auth/connect/issue-passport.js +0 -2
- package/api/services/auth/connect/receive-transfer-app-owner.js +0 -2
- package/api/services/auth/connect/verify-destroy.js +0 -2
- package/api/services/auth/connect/verify-elevated.js +0 -2
- package/api/services/auth/session.js +1 -36
- package/api/util/user-util.js +1 -2
- package/dist/assets/{AdapterDayjs-CYW0YvmK.js → AdapterDayjs-B5owpIH3.js} +1 -1
- package/dist/assets/{Google-DKRt92nm.js → Google-efeywUOs.js} +1 -1
- package/dist/assets/{LottiePlayer.modern-CeQuigIa.js → LottiePlayer.modern-CE8erevJ.js} +1 -1
- package/dist/assets/access-control-BzsCJj-F.js +14 -0
- package/dist/assets/{actions-DydkTgA0.js → actions-DbuL4r3Z.js} +1 -1
- package/dist/assets/actions-Dm98-Dap.js +64 -0
- package/dist/assets/{add-component-core-nc1ps0ni.js → add-component-core-BKVGCdxY.js} +21 -21
- package/dist/assets/add-resource-Cxa0mbrd.js +1 -0
- package/dist/assets/{addon-DfWedLEC.js → addon-B1KwZDQ5.js} +1 -1
- package/dist/assets/advanced-B62UUhxe.js +14 -0
- package/dist/assets/{aigne-6nMSoyeQ.js → aigne-jjaGOQQ7.js} +1 -1
- package/dist/assets/api-BMcHDEnt.js +1 -0
- package/dist/assets/appearance-_ZB7EroL.js +1 -0
- package/dist/assets/{ar-DOhYGTlW.js → ar-BJmSv7rn.js} +1 -1
- package/dist/assets/audit-logs-DF2wcdWX.js +35 -0
- package/dist/assets/authorize-C6nOsMWm.js +1 -0
- package/dist/assets/{base-chart-DcZV4ZCI.js → base-chart-D_u2nVGm.js} +1 -1
- package/dist/assets/{base32-7iZvvdX8.js → base32-D79Y2AcQ.js} +1 -1
- package/dist/assets/bind-account-BIj9FA7d.js +1 -0
- package/dist/assets/branding-BEGHWROe.js +40 -0
- package/dist/assets/{branding-CwSyd5WC.js → branding-C86_64it.js} +3 -3
- package/dist/assets/branding-Dqv4_zpD.js +1 -0
- package/dist/assets/bundle-avatar-Cy8tSSSQ.js +1 -0
- package/dist/assets/button-DMYwcDVh.js +1 -0
- package/dist/assets/{click-to-copy-BgIYUMoo.js → click-to-copy-BCjXD9Nd.js} +1 -1
- package/dist/assets/{cloneDeep-YxES7wNt.js → cloneDeep-q2Jbqwkh.js} +1 -1
- package/dist/assets/{collapse-RMuUWnK3.js → collapse-CBrasNzu.js} +1 -1
- package/dist/assets/complete-CCe1VfI6.js +39 -0
- package/dist/assets/{component-CuKviNC8.js → component-DLlaIYmq.js} +37 -37
- package/dist/assets/config-BccEmD3I.js +53 -0
- package/dist/assets/config-C0CmuuRP.js +1 -0
- package/dist/assets/config-CsQBU86s.js +32 -0
- package/dist/assets/{config-navigation-hDihVsjx.js → config-navigation-D46rq0IX.js} +11 -11
- package/dist/assets/config-space-DLjHQVCq.js +1 -0
- package/dist/assets/{confirm-CdVn5WdC.js → confirm-ClxC2cDv.js} +1 -1
- package/dist/assets/connect-9CgvkPOq.js +1 -0
- package/dist/assets/{connect-Dy0Y8HRB.js → connect-C1q4hvQ3.js} +1 -1
- package/dist/assets/connect-DXjJ46DL.js +5 -0
- package/dist/assets/connect-to-CbgQNAwh.js +1 -0
- package/dist/assets/{content-layout-Dlmn5DW6.js → content-layout-BH_g_OCf.js} +1 -1
- package/dist/assets/{create-passport-svg-hldNORaB.js → create-passport-svg-Ct68e5tm.js} +1 -1
- package/dist/assets/{createClass-CgfWUrk8.js → createClass-CeMEAEuP.js} +1 -1
- package/dist/assets/dashboard-y1fk-IQM.js +93 -0
- package/dist/assets/{de-CtKPdGk6.js → de-B2IoQCYX.js} +1 -1
- package/dist/assets/{delete-confirm-CkiUXocp.js → delete-confirm-CxRbnJU_.js} +1 -1
- package/dist/assets/{did-address-CG36eCOx.js → did-address-BhAIkFPZ.js} +1 -1
- package/dist/assets/{domain-CDTeLbkZ.js → domain-CMJp7emz.js} +1 -1
- package/dist/assets/domain-action-card-CKlATj2V.js +28 -0
- package/dist/assets/domains-CQs-XM9-.js +1 -0
- package/dist/assets/email-CYR31d5d.js +17 -0
- package/dist/assets/{empty-spinner-DB1GKIOS.js → empty-spinner-DzVQ0tC1.js} +1 -1
- package/dist/assets/engine-ByRLynLu.js +1 -0
- package/dist/assets/{es-BSYtSZPg.js → es-nlHqTKrO.js} +1 -1
- package/dist/assets/exchange-passport-BAD6oRbd.js +1 -0
- package/dist/assets/{fallback-D-IHOW-7.js → fallback-CJFJeDKq.js} +1 -1
- package/dist/assets/{form-text-input-CPLafaTk.js → form-text-input-Dq_8KU_Y.js} +2 -2
- package/dist/assets/{form-wrapper-kWYD3nZz.js → form-wrapper-YOmD-sDI.js} +1 -1
- package/dist/assets/{form-Co-tgocU.js → form-zHvITlPG.js} +3 -3
- package/dist/assets/{fr-C35fi7h9.js → fr-LrrW00cI.js} +1 -1
- package/dist/assets/{fuel-BFx1ShM2.js → fuel-CU-CpANh.js} +1 -1
- package/dist/assets/gen-access-key-Fb9M1v-f.js +1 -0
- package/dist/assets/gen-simple-access-key-BgYT9wM-.js +1 -0
- package/dist/assets/get-safe-url-CCXmZ6Ty.js +1 -0
- package/dist/assets/hi-DxZE2HUh.js +5 -0
- package/dist/assets/home-Cy8jLKNF.js +1 -0
- package/dist/assets/{id-DoVb0JYr.js → id-C3U8Kyb0.js} +1 -1
- package/dist/assets/{iframe-DUzp97tk.js → iframe-CZ9tjsFz.js} +1 -1
- package/dist/assets/{index-8RHrVCC6.js → index-B-yh2KQb.js} +1 -1
- package/dist/assets/index-B2LgdSh1.js +242 -0
- package/dist/assets/index-BJ69cdwn.js +88 -0
- package/dist/assets/index-BJCzMYyG.js +832 -0
- package/dist/assets/{index-BUhEyicQ.js → index-BZxTtTlP.js} +1 -1
- package/dist/assets/index-Bg0Lw3eZ.js +150 -0
- package/dist/assets/{index-C1fKsLzf.js → index-Bij9abGY.js} +2 -2
- package/dist/assets/index-BkgA3JrZ.js +124 -0
- package/dist/assets/{index-VKjWmvRV.js → index-BqISx1lI.js} +1 -1
- package/dist/assets/index-BsIQdVmB.js +29 -0
- package/dist/assets/{index-CfvGuvbD.js → index-BtHiIOEI.js} +1 -1
- package/dist/assets/index-BtxDkXoY.js +7 -0
- package/dist/assets/{index-DqcciDRh.js → index-CKgbiYHC.js} +2 -2
- package/dist/assets/index-CQz-yW1Q.js +120 -0
- package/dist/assets/{index-Cax1AxL9.js → index-CSdd2W7t.js} +1 -1
- package/dist/assets/{index-D3BuekEe.js → index-CYam9iu7.js} +5 -5
- package/dist/assets/index-CZc0agHR.js +1 -0
- package/dist/assets/index-Cb9H09Dz.js +1 -0
- package/dist/assets/{index-D1Fa760B.js → index-CtCzpHpi.js} +1 -1
- package/dist/assets/index-D0VFBmtN.js +280 -0
- package/dist/assets/{index-3H6a5edM.js → index-D1HHdOwz.js} +2 -2
- package/dist/assets/{index-B9FojAjj.js → index-DDpk_EEp.js} +1 -1
- package/dist/assets/{index-Di2nSesc.js → index-DPbBn0Vu.js} +1 -1
- package/dist/assets/{index-D6pCyJv8.js → index-DbbtJMIS.js} +1 -1
- package/dist/assets/index-DgwyiIiW.js +1 -0
- package/dist/assets/{index-Bo9KtpTY.js → index-Dh38UJiv.js} +1 -1
- package/dist/assets/{index-CqCXPf7W.js → index-DvtkahBB.js} +1 -1
- package/dist/assets/index-Dw9kO-TK.js +7 -0
- package/dist/assets/{index-DFUM0Pvk.js → index-E0k6Os1B.js} +1 -1
- package/dist/assets/index-L6md5GCk.js +6 -0
- package/dist/assets/index-VTJ4vv2F.js +200 -0
- package/dist/assets/{index-CEJb82tA.js → index-WY8_4PO1.js} +1 -1
- package/dist/assets/{index-ZzcJ7eKO.js → index-lGLHoHAP.js} +1 -1
- package/dist/assets/{index-Cx0E03Bs.js → index-rh1DYsh2.js} +3 -3
- package/dist/assets/{index-C_kNXHsF.js → index-u8Hqob_G.js} +1 -1
- package/dist/assets/index-vQWAt26Z.js +81 -0
- package/dist/assets/info-outline-rounded-CTki6xsp.js +1 -0
- package/dist/assets/{invitation-BP8hOEFv.js → invitation-CrLJgh5y.js} +6 -6
- package/dist/assets/{invitations-C8aZLxdl.js → invitations-Cs7LYbh9.js} +2 -2
- package/dist/assets/invite-B0wKu-K4.js +1 -0
- package/dist/assets/issue-passport-B1azomgq.js +1 -0
- package/dist/assets/item-CcfCB60B.js +1 -0
- package/dist/assets/{ja-DZPUwZ9l.js → ja-Cv-fddix.js} +1 -1
- package/dist/assets/{ko-q4i4r9g6.js → ko-Cy3G6t2o.js} +1 -1
- package/dist/assets/{landing-page-JLA-ZD1t.js → landing-page-3yvA3dHp.js} +1 -1
- package/dist/assets/{launch-result-message-DJqF-slD.js → launch-result-message-CYcW9uFA.js} +1 -1
- package/dist/assets/layout-DPEeowZp.js +29 -0
- package/dist/assets/{list-3MUy-8Ol.js → list-BtmehYr0.js} +3 -3
- package/dist/assets/{list-header-BEZSwSji.js → list-header-DqG9VFur.js} +1 -1
- package/dist/assets/list-qef9ITY3.js +2 -0
- package/dist/assets/localization-VGnaiTRr.js +1 -0
- package/dist/assets/{log-Bq445Z1e.js → log-BDLuou50.js} +1 -1
- package/dist/assets/logger-Cn2_Ur4V.js +1 -0
- package/dist/assets/login-BTzBeYdR.js +1 -0
- package/dist/assets/login-method-item-T1v3TnPG.js +1 -0
- package/dist/assets/login-oauth-callback-f1uXdv_Y.js +1 -0
- package/dist/assets/{logo-uploader-CyZuvhwV.js → logo-uploader-YNwnzUQw.js} +1 -1
- package/dist/assets/{lost-passport-BiYg3QQI.js → lost-passport-Cv4fSebj.js} +2 -2
- package/dist/assets/metadata-BeJTujvj.js +55 -0
- package/dist/assets/{nav-menu-DSdXRbfg.js → nav-menu-CefEor9d.js} +1 -1
- package/dist/assets/{omit-Dq0FLBY8.js → omit-vVhnMpHQ.js} +1 -1
- package/dist/assets/{open-window-Dyu79ome.js → open-window-Cq_Eb4d0.js} +1 -1
- package/dist/assets/over-due-invoice-payment-Cx9nVkCY.js +1 -0
- package/dist/assets/overview-UWHPi3tV.js +116 -0
- package/dist/assets/{page-header-qdK3sAJh.js → page-header-DayahqMa.js} +1 -1
- package/dist/assets/passport-D7GEY4wO.js +1 -0
- package/dist/assets/passport-item-CpICtT-w.js +1 -0
- package/dist/assets/{permission-CvrrGfG6.js → permission-ozcooui7.js} +1 -1
- package/dist/assets/preferences-RHaCYv9t.js +1 -0
- package/dist/assets/profile-embed-BLPUgZl6.js +1 -0
- package/dist/assets/provider-icon-Blmpf_9p.js +1 -0
- package/dist/assets/pt-CLIZ5rGV.js +5 -0
- package/dist/assets/publish-resource-Cn5CEQma.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-CWJ5I9Zv.js → react-beautiful-dnd.esm-L71UpeRK.js} +1 -1
- package/dist/assets/{react-stripe.esm-B-FTN8ep.js → react-stripe.esm-B1zA7yon.js} +1 -1
- package/dist/assets/{required-DnQpCGsD.js → required-jUJP5eu8.js} +1 -1
- package/dist/assets/ru-DoXNa8xl.js +5 -0
- package/dist/assets/{runtime-B_ZLP4FF.js → runtime-CGShJ0Po.js} +1 -1
- package/dist/assets/{sanitize-Bzl4lTuH.js → sanitize-BHeUjEo7.js} +1 -1
- package/dist/assets/sdk-C05lZFmW.js +1 -0
- package/dist/assets/{section-CZylgxjz.js → section-BHNJgwmP.js} +1 -1
- package/dist/assets/security-_Iru3mSY.js +22 -0
- package/dist/assets/session-DpYXqKUu.js +1 -0
- package/dist/assets/setup-DCnaHhf3.js +24 -0
- package/dist/assets/{shorten-label-CuBHsWUR.js → shorten-label-NmLkBKIj.js} +1 -1
- package/dist/assets/simple-select--uh08-vW.js +1 -0
- package/dist/assets/{spaces-ix8u0ZiI.js → spaces-gCrHfJB8.js} +1 -1
- package/dist/assets/start-S0ZFYLEE.js +187 -0
- package/dist/assets/{starting-progress-CWp5fTY0.js → starting-progress-BSgBADJS.js} +1 -1
- package/dist/assets/{status-Dn_LKaNp.js → status-DqZ0B8Xa.js} +1 -1
- package/dist/assets/{step-actions-DIZRcnXf.js → step-actions-DxJMBPwi.js} +1 -1
- package/dist/assets/{studio-CVIa8-XY.js → studio-B2SgpXxn.js} +1 -1
- package/dist/assets/{switch-BbyTGEOo.js → switch-D9wb-oPu.js} +1 -1
- package/dist/assets/{switch-control-BRjXGc1d.js → switch-control-Dl1BCyFd.js} +1 -1
- package/dist/assets/{table-tips-Dvmdodc5.js → table-tips-C5NrUDu8.js} +1 -1
- package/dist/assets/team-DXPe7dCA.js +146 -0
- package/dist/assets/th-DmzEcJam.js +5 -0
- package/dist/assets/{theme-mode-toggle-D3bcd10D.js → theme-mode-toggle-BYQvzsDR.js} +1 -1
- package/dist/assets/traffic-BandB_6R.js +1 -0
- package/dist/assets/transfer-Dky9H1bl.js +16 -0
- package/dist/assets/unsubscribe-D0la_6Ib.js +1 -0
- package/dist/assets/{use-app-logo-IRizt64R.js → use-app-logo-0G6x82Xn.js} +1 -1
- package/dist/assets/{use-blocklet-logo-Cf1j7pQz.js → use-blocklet-logo-IV_8xnB2.js} +1 -1
- package/dist/assets/{use-mobile-DFkQ5N0b.js → use-mobile-CEr7zhO3.js} +1 -1
- package/dist/assets/{use-mobile-DwGMuJlg.js → use-mobile-DAngW3li.js} +1 -1
- package/dist/assets/{use-mobile-CyUZDIaX.js → use-mobile-kXWiSSQD.js} +1 -1
- package/dist/assets/{use-server-logo-KZn9RrZd.js → use-server-logo-BVKQ1t0s.js} +1 -1
- package/dist/assets/{use-window-close-Dpj5UcYT.js → use-window-close-C-WcChaL.js} +1 -1
- package/dist/assets/{useAsync-DfiOQMQ_.js → useAsync-DRrTtbU_.js} +1 -1
- package/dist/assets/{useAsync-CkKfnulP.js → useAsync-D_y3bEgl.js} +1 -1
- package/dist/assets/{useAsyncRetry-C4R9ufi-.js → useAsyncRetry-BZ4R17gr.js} +2 -2
- package/dist/assets/{useLocalStorage-BQfIniHX.js → useLocalStorage-C5E7FrUa.js} +1 -1
- package/dist/assets/{user-center-6K47tx8j.js → user-center-D-UOqGpV.js} +5 -5
- package/dist/assets/{user-follower-BwzTutxU.js → user-follower-_9B1O2CU.js} +1 -1
- package/dist/assets/util-Bf1lWzn8.js +1 -0
- package/dist/assets/util-Dn9RqFJI.js +1 -0
- package/dist/assets/utils-eOkzHJzR.js +1 -0
- package/dist/assets/{vendor-arcblock-Dll6qxMT.js → vendor-arcblock-B6JCofz3.js} +1 -1
- package/dist/assets/vendor-hooks-Bt9Vv36g.js +1 -0
- package/dist/assets/{vendor-mui-core-CV-FnYH_.js → vendor-mui-core-D6nniiQs.js} +2 -2
- package/dist/assets/{vendor-mui-x-DwN6dcQH.js → vendor-mui-x-Ds-5Y7YM.js} +1 -1
- package/dist/assets/vendor-utils-BbcnEeJI.js +23 -0
- package/dist/assets/{vendor-ux-CLT2i3Pv.js → vendor-ux-hzekFYg2.js} +123 -123
- package/dist/assets/vi-6MG7Pp6O.js +5 -0
- package/dist/assets/wait-connect-DmtX5SsS.js +1 -0
- package/dist/assets/wallet-hidden-topbar-OBN14KiV.js +68 -0
- package/dist/assets/wizard-Q2Vm8Y9G.js +8 -0
- package/dist/assets/wizard-components-CON7Dump.js +52 -0
- package/dist/assets/wrap-locale-BGMozDAq.js +1 -0
- package/dist/assets/{zh-G2I44gfs.js → zh-B9y8LJ3-.js} +1 -1
- package/dist/assets/{zh-CJ9vCpmv.js → zh-Dfkd9CXx.js} +1 -1
- package/dist/assets/{zh-tw-C4Juvs-i.js → zh-tw-CbtwifV_.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +44 -44
- package/dist/assets/access-control-RI6LQbSm.js +0 -14
- package/dist/assets/actions-BlWED76c.js +0 -64
- package/dist/assets/add-resource-BVOdOQSW.js +0 -1
- package/dist/assets/advanced-CuKHqbLO.js +0 -14
- package/dist/assets/api-B8JXuhVp.js +0 -1
- package/dist/assets/appearance-C9TkbSjV.js +0 -1
- package/dist/assets/audit-logs-DKGke9hI.js +0 -35
- package/dist/assets/authorize-DkSqywe8.js +0 -1
- package/dist/assets/bind-account-DOwM9Nhe.js +0 -1
- package/dist/assets/branding-Cak2s8bn.js +0 -1
- package/dist/assets/branding-lcfxmmPp.js +0 -40
- package/dist/assets/bundle-avatar-DwiOyeMO.js +0 -1
- package/dist/assets/button-uUU4Wycr.js +0 -1
- package/dist/assets/complete-Udiv_yFp.js +0 -39
- package/dist/assets/config-6IwEgT3b.js +0 -32
- package/dist/assets/config-CJwxv2uK.js +0 -1
- package/dist/assets/config-D1OcHGlN.js +0 -53
- package/dist/assets/config-space-DfstlHnF.js +0 -1
- package/dist/assets/connect-CT2vMz6l.js +0 -5
- package/dist/assets/connect-DA7RO2yv.js +0 -1
- package/dist/assets/connect-to-CQMUbQkH.js +0 -1
- package/dist/assets/dashboard-BvI3ii8Z.js +0 -93
- package/dist/assets/domain-action-card-kMPYS2Nj.js +0 -28
- package/dist/assets/domains-TI6o1CvX.js +0 -1
- package/dist/assets/email-DHRHueET.js +0 -17
- package/dist/assets/engine-D_fEFx9_.js +0 -1
- package/dist/assets/exchange-passport-Cc872mjQ.js +0 -1
- package/dist/assets/gen-access-key-DrgLVRbm.js +0 -1
- package/dist/assets/gen-simple-access-key-B24d6k7g.js +0 -1
- package/dist/assets/get-safe-url-beob4f2C.js +0 -1
- package/dist/assets/hi-5fpYJkiW.js +0 -5
- package/dist/assets/home-Dw18IODa.js +0 -1
- package/dist/assets/index--WQuhwJL.js +0 -6
- package/dist/assets/index-2M4w6J9r.js +0 -29
- package/dist/assets/index-B-8044Gs.js +0 -280
- package/dist/assets/index-B6l4xGy5.js +0 -7
- package/dist/assets/index-BOPR4Iyc.js +0 -88
- package/dist/assets/index-BeunkI-Z.js +0 -242
- package/dist/assets/index-Bpic07NM.js +0 -200
- package/dist/assets/index-C4ZzROeE.js +0 -120
- package/dist/assets/index-CXp5SI_f.js +0 -832
- package/dist/assets/index-DH4rC-7M.js +0 -1
- package/dist/assets/index-DKzBOJCu.js +0 -81
- package/dist/assets/index-DL0wTcgx.js +0 -1
- package/dist/assets/index-DWHFecw2.js +0 -150
- package/dist/assets/index-DcW3jqfL.js +0 -6
- package/dist/assets/index-Vf51dp11.js +0 -124
- package/dist/assets/index-bEFOmVth.js +0 -1
- package/dist/assets/info-outline-rounded-DlgANjBB.js +0 -1
- package/dist/assets/invite-Cd5zEHFb.js +0 -1
- package/dist/assets/issue-passport-D7zqv3Al.js +0 -1
- package/dist/assets/item-DNj7ORqk.js +0 -1
- package/dist/assets/joi-browser.min-CUdv8seQ.js +0 -1
- package/dist/assets/joi-browser.min-eEVeW7LC.js +0 -1
- package/dist/assets/layout-Cwvm7lmD.js +0 -29
- package/dist/assets/list-BSXHuqLM.js +0 -2
- package/dist/assets/localization-Dond4H78.js +0 -1
- package/dist/assets/logger-CCAAJ2Xo.js +0 -1
- package/dist/assets/login-dc2t9Qyo.js +0 -1
- package/dist/assets/login-method-item-CyTsqz88.js +0 -1
- package/dist/assets/login-oauth-callback-Bext19kc.js +0 -1
- package/dist/assets/metadata-B2-Ltdko.js +0 -55
- package/dist/assets/over-due-invoice-payment-DzUsy6q0.js +0 -1
- package/dist/assets/overview-0TBmi-_i.js +0 -116
- package/dist/assets/passport-BhEaZ-sr.js +0 -1
- package/dist/assets/passport-item-DHwif94N.js +0 -1
- package/dist/assets/preferences-BBSWzZiT.js +0 -1
- package/dist/assets/profile-embed-shcOdRUI.js +0 -1
- package/dist/assets/provider-icon-DO2PqSth.js +0 -1
- package/dist/assets/pt-BFCHl6F1.js +0 -5
- package/dist/assets/publish-resource-CMuHIOUf.js +0 -1
- package/dist/assets/ru-CSTl62kK.js +0 -5
- package/dist/assets/sdk-CktKu_IW.js +0 -1
- package/dist/assets/security-DHRU8k0u.js +0 -22
- package/dist/assets/session-Bp3LV7zJ.js +0 -1
- package/dist/assets/setup-B6-Ei_3X.js +0 -24
- package/dist/assets/simple-select-nI-W90c_.js +0 -1
- package/dist/assets/start-oRp78RMQ.js +0 -187
- package/dist/assets/team-BTz28XqK.js +0 -146
- package/dist/assets/th-D75Dlluo.js +0 -5
- package/dist/assets/traffic-Cea69sMW.js +0 -1
- package/dist/assets/transfer-BydXCVCg.js +0 -16
- package/dist/assets/unsubscribe-BjAjx-Fl.js +0 -1
- package/dist/assets/util-DkTwHdRu.js +0 -1
- package/dist/assets/util-DySzCymV.js +0 -1
- package/dist/assets/vendor-hooks-DAZ1H6Va.js +0 -1
- package/dist/assets/vendor-utils-BzQg432x.js +0 -23
- package/dist/assets/vi-D1mKYrmb.js +0 -5
- package/dist/assets/wait-connect-q0_7mz_u.js +0 -1
- package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +0 -68
- package/dist/assets/wizard-C5Kl-g70.js +0 -8
- package/dist/assets/wizard-components-DQrlaeeW.js +0 -52
- package/dist/assets/wrap-locale-5DJTJTXP.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as xr}from"./vendor-utils-
|
|
1
|
+
import{B as xr}from"./vendor-utils-BbcnEeJI.js";import{p as ae}from"./vendor-react-DX7tU9aY.js";import{bY as Se,dc as Nr,f as _r,dd as Kr,e as Xe,aL as Tr,de as Ur,df as Br,dg as Je,dh as Dr,ay as Mr,bW as Lr,di as Cr}from"./vendor-ux-hzekFYg2.js";import{cC as Pr,aJ as Vr,aM as Fr}from"./index-BJCzMYyG.js";import{r as $r}from"./index-DvtkahBB.js";var Pe={exports:{}},Re={},er;function Rr(){if(er)return Re;er=1;function p(u){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},p(u)}function b(u,h,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function f(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function g(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),h&&N(u,h)}function N(u,h){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(B,_){return B.__proto__=_,B},N(u,h)}function L(u){var h=n();return function(){var B=e(u),_;if(h){var K=e(this).constructor;_=Reflect.construct(B,arguments,K)}else _=B.apply(this,arguments);return v(this,_)}}function v(u,h){if(h&&(p(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(u)}function s(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,h,S){S||(S=Error);function B(K,W,C){return typeof h=="string"?h:h(K,W,C)}var _=(function(K){g(C,K);var W=L(C);function C(H,ee,Z){var J;return f(this,C),J=W.call(this,B(H,ee,Z)),J.code=u,J}return b(C)})(S);r[u]=_}function q(u,h){if(Array.isArray(u)){var S=u.length;return u=u.map(function(B){return String(B)}),S>2?"one of ".concat(h," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(h," ").concat(u[0]," or ").concat(u[1]):"of ".concat(h," ").concat(u[0])}else return"of ".concat(h," ").concat(String(u))}function O(u,h,S){return u.substr(0,h.length)===h}function A(u,h,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-h.length,S)===h}function j(u,h,S){return typeof S!="number"&&(S=0),S+h.length>u.length?!1:u.indexOf(h,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,h,S){d===void 0&&(d=ke()),d(typeof u=="string","'name' must be a string");var B;typeof h=="string"&&O(h,"not ")?(B="must not be",h=h.replace(/^not /,"")):B="must be";var _;if(A(u," argument"))_="The ".concat(u," ").concat(B," ").concat(q(h,"type"));else{var K=j(u,".")?"property":"argument";_='The "'.concat(u,'" ').concat(K," ").concat(B," ").concat(q(h,"type"))}return _+=". Received type ".concat(p(S)),_},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var B=y.inspect(h);return B.length>128&&(B="".concat(B.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(B)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,h,S){var B;return S&&S.constructor&&S.constructor.name?B="instance of ".concat(S.constructor.name):B="type ".concat(p(S)),"Expected ".concat(u,' to be returned from the "').concat(h,'"')+" function but got ".concat(B,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,h=new Array(u),S=0;S<u;S++)h[S]=arguments[S];d===void 0&&(d=ke()),d(h.length>0,"At least one arg needs to be specified");var B="The ",_=h.length;switch(h=h.map(function(K){return'"'.concat(K,'"')}),_){case 1:B+="".concat(h[0]," argument");break;case 2:B+="".concat(h[0]," and ").concat(h[1]," arguments");break;default:B+=h.slice(0,_-1).join(", "),B+=", and ".concat(h[_-1]," arguments");break}return"".concat(B," must be specified")},TypeError),Re.codes=r,Re}var Ie,rr;function Gr(){if(rr)return Ie;rr=1;function p(E,m){var U=Object.keys(E);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(E);m&&(x=x.filter(function(V){return Object.getOwnPropertyDescriptor(E,V).enumerable})),U.push.apply(U,x)}return U}function b(E){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?p(Object(U),!0).forEach(function(x){f(E,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(U)):p(Object(U)).forEach(function(x){Object.defineProperty(E,x,Object.getOwnPropertyDescriptor(U,x))})}return E}function f(E,m,U){return m=v(m),m in E?Object.defineProperty(E,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):E[m]=U,E}function g(E,m){if(!(E instanceof m))throw new TypeError("Cannot call a class as a function")}function N(E,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(E,v(x.key),x)}}function L(E,m,U){return m&&N(E.prototype,m),Object.defineProperty(E,"prototype",{writable:!1}),E}function v(E){var m=s(E,"string");return u(m)==="symbol"?m:String(m)}function s(E,m){if(u(E)!=="object"||E===null)return E;var U=E[Symbol.toPrimitive];if(U!==void 0){var x=U.call(E,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}function n(E,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(m&&m.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),m&&A(E,m)}function e(E){var m=q();return function(){var x=j(E),V;if(m){var a=j(this).constructor;V=Reflect.construct(x,arguments,a)}else V=x.apply(this,arguments);return r(this,V)}}function r(E,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(E)}function d(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function y(E){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,V)}function V(){return l(x,arguments,j(this).constructor)}return V.prototype=Object.create(x.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),A(V,x)},y(E)}function l(E,m,U){return q()?l=Reflect.construct.bind():l=function(V,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(V,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(E){return Function.toString.call(E).indexOf("[native code]")!==-1}function A(E,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,V){return x.__proto__=V,x},A(E,m)}function j(E){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(E)}function u(E){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(E)}var h=Se(),S=h.inspect,B=Rr(),_=B.codes.ERR_INVALID_ARG_TYPE;function K(E,m,U){return(U===void 0||U>E.length)&&(U=E.length),E.substring(U-m.length,U)===m}function W(E,m){if(m=Math.floor(m),E.length==0||m==0)return"";var U=E.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)E+=E,m--;return E+=E.substring(0,U-E.length),E}var C="",H="",ee="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(E){var m=Object.keys(E),U=Object.create(Object.getPrototypeOf(E));return m.forEach(function(x){U[x]=E[x]}),Object.defineProperty(U,"message",{value:E.message}),U}function oe(E){return S(E,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(E,m,U){var x="",V="",a=0,i="",c=!1,R=oe(E),w=R.split(`
|
|
2
2
|
`),I=oe(m).split(`
|
|
3
3
|
`),D=0,z="";if(U==="strictEqual"&&u(E)==="object"&&u(m)==="object"&&E!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(E)!=="object"||E===null)&&(u(m)!=="object"||m===null)&&(E!==0||m!==0))return"".concat(J[U],`
|
|
4
4
|
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import{r as g}from"./vendor-react-DX7tU9aY.js";import{j as e,z as V,y as O,bN as G,M as X,al as m,X as x,a7 as ke,cu as ve,b3 as Q,A as U,bK as Te,a6 as Ae,aT as P,T as _,cv as Ke,cs as Re,b4 as De,R as Se,cD as Ie}from"./vendor-mui-core-D6nniiQs.js";import{V as S,bi as $,b2 as L,b1 as $e,aG as ne,bC as F,y as Be,bE as z,bA as Ne,N as _e,b8 as Ee,aI as Pe,aH as We}from"./vendor-ux-hzekFYg2.js";import{f as ze}from"./index-DBs9Ljax.js";import{ay as Me,X as I,at as qe,W as oe,A as Ue,ba as Le,V as Fe,aT as ie,aU as ae,aV as re,n as He}from"./index-BJCzMYyG.js";import{r as ce}from"./passport-item-CpICtT-w.js";import{b as W}from"./team-DXPe7dCA.js";import{t as le}from"./arrow-down.svg-Dz9H9vM-.js";import{T as de}from"./index-BtHiIOEI.js";import{C as pe}from"./confirm-ClxC2cDv.js";import{a4 as Ve,z as E}from"./vendor-utils-BbcnEeJI.js";import{u as Oe}from"./session-DpYXqKUu.js";import{C as H}from"./click-to-copy-BCjXD9Nd.js";import{f as Ge}from"./index-BojVbZw0.js";import{D as Xe}from"./delete-confirm-CxRbnJU_.js";import{P as Qe}from"./permission-ozcooui7.js";import{B as Je}from"./bundle-avatar-Cy8tSSSQ.js";import{W as Ye}from"./did-address-BhAIkFPZ.js";import{u as me}from"./use-mobile-CEr7zhO3.js";import{A as Ze}from"./actions-DbuL4r3Z.js";import{T as se}from"./table-tips-C5NrUDu8.js";import{E as et}from"./vendor-hooks-Bt9Vv36g.js";import"./vendor-arcblock-B6JCofz3.js";import"./ua-parser-D6QF1h5N.js";import"./util-Bf1lWzn8.js";import"./base32-D79Y2AcQ.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-OBN14KiV.js";import"./theme-mode-toggle-BYQvzsDR.js";import"./use-mobile-kXWiSSQD.js";import"./index-WY8_4PO1.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-IV_8xnB2.js";import"./use-app-logo-0G6x82Xn.js";import"./vendor-mui-x-Ds-5Y7YM.js";import"./AdapterDayjs-B5owpIH3.js";function J({value:s}){const{t,locale:n}=S(),a=new Date;return new Date(s)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{mode:"daysLeft",value:s,locale:n,type:"all"})}J.propTypes={value:x.string.isRequired};function Y({value:s,onChange:t,...n}){const{t:a}=S(),i=g.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(V,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(O,{children:a("setting.accessKey.authType")}),e.jsx(G,{value:s,onChange:t,fullWidth:!0,label:a("setting.accessKey.authType"),IconComponent:l=>e.jsx(le,{...l,width:20,height:20}),children:i.map(l=>e.jsx(X,{value:l.value,children:e.jsxs(m,{children:[e.jsx("span",{children:l.title}),e.jsx(m,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}Y.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const Z=()=>{const s=Me.roles.filter(i=>i.passport),{inService:t}=I(),{roles:n}=W(),a=[...s,...t?n:[]];return Ve(a,"name").filter(i=>i.name!==qe.OWNER)};function ue(){const{session:s}=Oe(),t=Z();return g.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const a=t.filter(l=>l.name==="guest");return[...t.filter(l=>l.name!=="guest").filter(l=>s.user.passports.find(b=>b.role===l.name)),...a]},[t,s?.user?.passports,s?.user?.role])}function xe({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:a}=W(),{t:i}=S(),[l,b]=g.useState(!1),[p,j]=g.useState(null),u=ue(),K=()=>{b(!1),j(null)},w=async r=>{const{remark:C,passport:f,authType:o}=r;b(!0);const v=await n.createAccessKey({input:{teamDid:a,remark:C.trim(),passport:f,expireAt:r.expireAt?new Date(r.expireAt).getTime():null,authType:o}}),{data:R}=v;s(R),j(null),b(!1)},d={title:`${i("common.create")} ${i("accessKey")}`,description:(r,C,f)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:r.remark,onChange:o=>{C({...r,remark:o.target.value,__disableConfirm:!r.passport||!o.target.value.trim()}),o.target.value.trim()?f(""):f(i("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(O,{sx:{width:"calc(100% - 46px)"},children:i("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"create-access-key-select-passport",value:r.passport,onChange:o=>{const v=o.target.value;f(null),C({...r,passport:v,__disableConfirm:!r.remark||!v})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:l,IconComponent:o=>e.jsx(le,{...o,width:20,height:20}),children:u.map(o=>e.jsx(X,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(Y,{value:r.authType,onChange:o=>{C({...r,authType:o.target.value})}}),e.jsx(de,{placeholder:i("setting.accessKey.expireTime"),value:r.expireAt,onChange:o=>{C({...r,expireAt:o,__disableConfirm:!r.passport||!r.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:w,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(L,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:r=>{r.stopPropagation(),j(d)},className:"rule-action",children:[l?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),i("common.create")]}),p&&e.jsx(pe,{title:p.title,description:p.description,confirm:p.confirm,color:p.color,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}xe.propTypes={remark:x.string,onCreate:x.func};function fe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:a=!0}){const{t:i}=g.useContext($e),[l,b]=g.useState(!1),[p,j]=g.useState(()=>a),u=I(),K=()=>{j(!p)},w=f=>{b(f.target.checked)},d=E(window.location.origin,u?.info?.routing?.adminPath),r=g.useMemo(()=>a?`const Client = require('@blocklet/server-js');
|
|
2
|
+
const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
|
|
3
|
+
const { joinURL } = require('ufo');
|
|
4
|
+
|
|
5
|
+
const { endpoint } = await ensureServerEndpoint("${u.inService?window.blocklet?.appUrl:d}");
|
|
6
|
+
const fullEndpoint = joinURL(endpoint, '/api/gql');
|
|
7
|
+
|
|
8
|
+
const client = new Client(fullEndpoint);
|
|
9
|
+
client.setAuthAccessKey({
|
|
10
|
+
accessKeyId: "${t}",
|
|
11
|
+
accessKeySecret: "${n}",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const rootDid = '${window.blocklet?.appId||window.blocklet?.appPid||"{rootDid}"}';
|
|
15
|
+
const result = await client.getBlocklet(
|
|
16
|
+
{ input: { did: rootDid, attachRuntimeInfo: false } },
|
|
17
|
+
{ headers: { 'x-access-blocklet': rootDid } }
|
|
18
|
+
);
|
|
19
|
+
`:u.inService?`curl -H "Authorization: Bearer ${n}" "${E(window.blocklet?.appUrl,oe,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${E(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),C=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(ne,{title:i("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:(f,o)=>{o!=="backdropClick"&&s()},showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(L,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:i("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(tt,{children:i(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(q,{children:[e.jsx(M,{children:i("setting.accessKey.accessKeyId")}),e.jsx(H,{children:t})]}),e.jsxs(q,{children:[e.jsx(M,{children:i("setting.accessKey.accessKeySecret")}),p?e.jsx(L,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:i("setting.accessKey.showSecret")}):e.jsx(H,{children:n})]}),!p&&e.jsxs(q,{children:[e.jsx(M,{children:`Access Key ${i("setting.accessKey.usage")}`}),e.jsx(F,{code:r,language:"shell",showDefaultText:!1}),C&&e.jsx(F,{code:C,language:"shell",showDefaultText:!1})]}),a&&e.jsx("div",{children:e.jsx(Te,{value:"end",disabled:p,control:e.jsx(Ae,{checked:l,onChange:w}),label:i("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}fe.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const M=P.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
margin-bottom: 8px;
|
|
25
|
+
`,q=P.div`
|
|
26
|
+
margin-bottom: 24px;
|
|
27
|
+
`,tt=P.div`
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
`;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:i=()=>{}}){const{t:l,locale:b}=S(),{api:p}=I(),{teamDid:j}=W(),u=()=>{i()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(r){Be.error(r?.message)}finally{u()}},w=r=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:Ue(r,b),timeAge:Ge(new Date(r),Le(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",w(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(Xe,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:i="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=S(),[K,w]=g.useState(!1),d=ue(),r=()=>{w(!1),b()},C=async o=>{const{accessKeyId:v,remark:R="",passport:h,expireAt:y,authType:B}=o;w(!0),await p.updateAccessKey({input:{teamDid:j,accessKeyId:v,remark:R.trim(),passport:h,expireAt:y?new Date(y).getTime():null,authType:B}}),n(),r()},f={title:`${u("common.update")} ${u("accessKey")}`,description:(o,v,R)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:u("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:o.accessKeyId,disabled:!0}),e.jsx(U,{label:u("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:o.remark,onChange:h=>{v({...o,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(u("setting.accessKey.remarkInvalid"))}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(O,{children:u("setting.accessKey.passport")}),e.jsx(G,{"data-cy":"update-access-key-select-passport",value:o.passport,onChange:h=>{const y=h.target.value;R(null),v({...o,passport:y,__disableConfirm:!o.remark||!y})},fullWidth:!0,label:u("setting.accessKey.passport"),disabled:K,children:d.map(h=>e.jsx(X,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:h.description})]})},h.name))})]}),e.jsx(Y,{disabled:!0,value:o.authType,onChange:h=>{v({...o,authType:h.target.value})}}),e.jsx(de,{placeholder:u("setting.accessKey.expireTime"),value:o.expireAt,onChange:h=>{v({...o,expireAt:h,__disableConfirm:!o.passport||!o.remark||!h})}})]}),confirm:u("common.confirm"),cancel:u("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:a,expireAt:i,authType:l},onConfirm:C,onCancel:r};return e.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,color:f.color,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}ge.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function ye({accessKey:s,onCancel:t}){const{t:n}=S();return e.jsx(ne,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{sx:{maxWidth:800,"@media (max-width: 768px)":{margin:"16px",maxWidth:"calc(100vw - 32px)"}}},fullWidth:!0,children:e.jsx(st,{children:e.jsx(be,{accessKey:s})})})}ye.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const st=P(m)`
|
|
31
|
+
margin-top: -16px;
|
|
32
|
+
|
|
33
|
+
.tabs {
|
|
34
|
+
margin-left: 0;
|
|
35
|
+
margin-right: 0;
|
|
36
|
+
}
|
|
37
|
+
`;function be({accessKey:s}){const{t,locale:n}=S(),{blocklet:a}=Fe(),i=I(),l=Z(),b=me(),p=(a?.children||[]).find(d=>d?.meta?.did===s.componentDid),j=l.find(d=>d.name===s.passport),u=j?j.title:s.passport,K=g.useMemo(()=>i.inService?`curl -H "Authorization: Bearer blocklet-${z(s.accessKeyPublic)}" "${E(window.blocklet?.appUrl,oe,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${z(s.accessKeyPublic)}" "${E(window.location.origin,i?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,i.inService,i?.info?.routing?.adminPath]),w=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ye,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(H,{children:`blocklet-${z(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(m,{children:ce(u,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ie,{showDid:!0,did:s.createdBy,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx($,{value:s.createdAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx($,{value:s.lastUsedAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(J,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...p?[{label:t("setting.accessKey.component"),content:e.jsxs(m,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Je,{blocklet:p,ancestors:[a]}),e.jsx(m,{sx:{ml:"16px",minWidth:0},children:e.jsxs(m,{className:"component-header",children:[e.jsx(m,{className:"component-name",children:He.getDisplayName(p,!0)}),e.jsx(m,{className:"component-version",children:p?.meta?.version})]})})]},p)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(F,{code:K,language:"shell",showDefaultText:!1})}:null].filter(Boolean)}];return e.jsx(nt,{gap:3,children:e.jsx(m,{className:"info-area",children:w.map(d=>e.jsxs(m,{sx:{mb:3},children:[e.jsx(_,{variant:"h6",sx:{mb:1.5},children:d.title}),e.jsx(m,{className:"info-grid",children:d.items.map(r=>e.jsxs(m,{className:"info-item",children:[e.jsx(m,{className:"info-label",children:e.jsx(_,{variant:"subtitle2",color:"textSecondary",children:r.label})}),e.jsx(m,{className:"info-content",sx:{flex:1,minWidth:0,"@media (max-width: 768px)":{width:"100%",flex:"none"}},children:r.content})]},r.label))})]},d.title))})})}be.propTypes={accessKey:x.object.isRequired};const nt=P(Q)`
|
|
38
|
+
.info-card {
|
|
39
|
+
margin-bottom: 24px;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.card-content {
|
|
44
|
+
display: flex;
|
|
45
|
+
gap: 32px;
|
|
46
|
+
padding: 24px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.passport-image {
|
|
50
|
+
width: 150px;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
transition: transform 0.2s ease-in-out;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
transform: scale(1.05);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.info-area {
|
|
61
|
+
flex: 1;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.info-header {
|
|
67
|
+
padding-bottom: 16px;
|
|
68
|
+
border-bottom: 1px solid #eee;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.info-grid {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
gap: 12px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.info-item {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: flex-start;
|
|
80
|
+
gap: 16px;
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
|
|
83
|
+
@media (max-width: 768px) {
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: 8px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.info-label {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
width: 140px;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
|
|
96
|
+
@media (max-width: 768px) {
|
|
97
|
+
width: 100%;
|
|
98
|
+
margin-bottom: 4px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@media (max-width: 480px) {
|
|
102
|
+
width: auto;
|
|
103
|
+
min-width: auto;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.info-content {
|
|
108
|
+
word-break: break-word;
|
|
109
|
+
overflow-wrap: break-word;
|
|
110
|
+
|
|
111
|
+
/* 确保代码块和长文本在移动端正确显示 */
|
|
112
|
+
pre,
|
|
113
|
+
code {
|
|
114
|
+
white-space: pre-wrap;
|
|
115
|
+
word-break: break-all;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* 优化链接在移动端的显示 */
|
|
119
|
+
a {
|
|
120
|
+
word-break: break-all;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@media (max-width: 768px) {
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
line-height: 1.5;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.logs-card {
|
|
130
|
+
.card-header {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 8px;
|
|
134
|
+
padding: 16px 24px;
|
|
135
|
+
border-bottom: 1px solid #eee;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.MuiTimeline-root {
|
|
139
|
+
padding: 24px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.MuiTimelineContent-root {
|
|
143
|
+
padding: 0px 16px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.MuiTimelineDot-root {
|
|
147
|
+
margin: 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`;function ot({isSelf:s=!1,columnSx:t={}}){const{t:n,locale:a}=S(),{api:i,inService:l}=I(),{teamDid:b}=W(),[p,j]=g.useState({}),[u,K]=g.useState(null),[w,d]=g.useState(null),[r,C]=g.useState(null),f=me(),o=Z(),v=g.useRef(null),R=`access-keys-${b}`,h=Ne(R),[y,B]=g.useState({searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:1}),D=et(async()=>{const c={teamDid:b,paging:{page:y.page,pageSize:y.pageSize}};return y.searchText&&(c.remark=y.searchText),await i.getAccessKeys({input:c})},[y.page,y.pageSize,y.searchText]),{loading:je,error:ee}=D,N=g.useMemo(()=>D.value?.list||[],[D.value?.list]),te=g.useMemo(()=>s?["accessKeyId","createdVia","createdBy","createdBy"]:[],[s]),we=g.useMemo(()=>[{label:n("common.name"),name:"remark",options:{customBodyRender:(c,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{className:"remark",sx:_e({display:"flex",alignItems:"center",gap:2},t),children:e.jsx(_,{children:A.remark||"N/A"})})}}},{label:"Access Key ID",name:"accessKeyId",options:{customBodyRender:c=>e.jsx(m,{sx:t,children:e.jsx(Ee,{showDidLogo:!1,children:c})})}},{label:n("common.role"),name:"passport",options:{customBodyRender:c=>{const T=o.find(k=>k.name===c),A=T?T.title:c;return e.jsx(m,{sx:t,children:ce(A,c)})}}},{label:n("common.createdVia"),name:"createdVia",options:{customBodyRender:c=>e.jsx(_,{sx:t,children:c})}},{label:n("setting.accessKey.authType"),name:"authType",options:{customBodyRender:c=>e.jsx(_,{sx:t,children:n(`setting.accessKey.${c}`)})}},{label:n("common.createdAt"),name:"createdAt",options:{customBodyRender:c=>e.jsx(m,{sx:t,children:c?e.jsx($,{value:c,locale:a}):"-"})}},{label:n("common.lastUsedAt"),name:"lastUsedAt",options:{customBodyRender:c=>e.jsx(m,{sx:t,children:c?e.jsx($,{value:c,locale:a}):"-"})}},{label:n("common.expiredAt"),name:"expireAt",options:{customBodyRender:c=>e.jsx(m,{className:"expired-at",sx:t,children:c?e.jsx(J,{value:c}):n("common.neverExpired")})}},{label:n("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:c=>e.jsx(m,{sx:t,children:c?e.jsx(ie,{showDid:!0,did:c,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0,...f&&{minWidth:"unset"}}}):"-"})}},{label:n("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(c,{rowIndex:T})=>{const A=N[T];return e.jsx(m,{sx:t,children:e.jsx(Ze,{"data-cy":"access-key-actions",actions:[{icon:e.jsx(Ke,{}),text:n("common.edit"),onClick:k=>{k.stopPropagation(),C(A)}},{icon:e.jsx(Re,{}),text:n("common.delete"),onClick:k=>{k.stopPropagation(),d(A)}}]})})}}}].filter(c=>!te.includes(c.name)),[N,a,n,o,d,C,t,f,te]),Ce=({page:c,rowsPerPage:T,searchText:A})=>{y.pageSize!==T?B(k=>({...k,pageSize:T,page:1})):y.page!==c+1?B(k=>({...k,searchText:A,page:c+1})):y.searchText!==A&&B(k=>({...k,searchText:A,page:1}))};return ee?e.jsx(De,{severity:"error",children:ze(ee)}):e.jsxs(m,{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:[f?e.jsx(se,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}):null,e.jsx(Pe,{durable:R,durableKeys:["page","rowsPerPage","searchText"],data:N,locale:a,columns:we,className:"pc-access-key-table",options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:y.page-1,rowsPerPage:y.pageSize,count:D.value?.paging?.total||0,searchText:y.searchText,searchDebounceTime:600,onRowClick(c,{dataIndex:T},A){if(v.current?.contains(A.target)){const k=N[T];K(k)}}},loading:je,onChange:Ce,title:f?null:e.jsx(se,{title:n("setting.accessKey.listTitle"),tooltipTitle:n("setting.accessKey.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${a}/access-key`}),customButtons:[e.jsx(Qe,{permission:l?"":"mutate_accessKey",children:e.jsx(xe,{onCreate:c=>{const{accessKeyId:T,accessKeySecret:A,authType:k}=c;j({show:!0,accessKeyId:T,accessKeySecret:A,authType:k})}})}),e.jsx(Se,{variant:"contained",color:"primary",startIcon:e.jsx(Ie,{}),onClick:()=>{D.retry()},children:n("common.refresh")})],emptyNode:e.jsx(We,{children:n("oauth.client.empty")})}),p.show&&e.jsx(fe,{hideSecret:p.authType==="signature",onConfirm:()=>{D.retry(),j({show:!1})},...p}),u&&e.jsx(ye,{onCancel:()=>K(null),accessKey:u}),w&&e.jsx(he,{accessKeyId:w.accessKeyId,time:w.lastUsedAt,remark:w.remark||"N/A",onDelete:D.retry,onClose:()=>d(null)}),r&&e.jsx(ge,{...r,onUpdate:D.retry,onClose:()=>C(null)})]})}ot.propTypes={isSelf:x.bool,columnSx:x.object};export{ot as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u}from"./vendor-react-DX7tU9aY.js";import{X as o,j as e,al as j,aL as z,A,aT as K,
|
|
1
|
+
import{r as u}from"./vendor-react-DX7tU9aY.js";import{X as o,j as e,al as j,aL as z,A,aT as K,cZ as B,I as D,a7 as X,bk as M,ak as W,cH as H}from"./vendor-mui-core-D6nniiQs.js";import{C as G}from"./Google-efeywUOs.js";import{b1 as U}from"./vendor-ux-hzekFYg2.js";import{c as Y}from"./create-passport-svg-Ct68e5tm.js";import{A as Z}from"./vendor-arcblock-B6JCofz3.js";import{n as $}from"./index-BJCzMYyG.js";import{R as J}from"./required-jUJP5eu8.js";import{F as Q}from"./form-wrapper-YOmD-sDI.js";import{L as v}from"./logo-uploader-YNwnzUQw.js";import{A as ee,a as ne,b as te}from"./collapse-CBrasNzu.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(z,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(G,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function N({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}N.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -8,4 +8,4 @@ import{r as u}from"./vendor-react-DX7tU9aY.js";import{X as o,j as e,al as j,aL a
|
|
|
8
8
|
25%, 75% {
|
|
9
9
|
transform: scale(1.1) translateX(3px);
|
|
10
10
|
}
|
|
11
|
-
`,oe={input:N,color:S,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const F=s(y),{editing:I,shaking:E}=F??{},q=l(n,{editing:I}),r=se(n,{editing:I}),t={inputProps:{"data-cy":"schema-form-item-component"},key:y,description:p,editing:I,value:q,onChange:(x,d="change")=>i(n,x,d),componentProps:C,skipButtonDisabled:w,onBlur:()=>c(n)};return n.componentType==="collapse"&&n.children?.length>0?e.jsxs(ee,{children:[e.jsx(ne,{expandIcon:e.jsx(B,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:n.description}),e.jsx(te,{children:n.children.map(x=>e.jsx(V,{item:x,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,formValues:b,disabled:m,loading:f,onCancel:h},x.key))})]}):e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",sx:{color:a&&!q?"error.main":"text.secondary"},children:[p,a&&e.jsx(
|
|
11
|
+
`,oe={input:N,color:S,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const F=s(y),{editing:I,shaking:E}=F??{},q=l(n,{editing:I}),r=se(n,{editing:I}),t={inputProps:{"data-cy":"schema-form-item-component"},key:y,description:p,editing:I,value:q,onChange:(x,d="change")=>i(n,x,d),componentProps:C,skipButtonDisabled:w,onBlur:()=>c(n)};return n.componentType==="collapse"&&n.children?.length>0?e.jsxs(ee,{children:[e.jsx(ne,{expandIcon:e.jsx(B,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:n.description}),e.jsx(te,{children:n.children.map(x=>e.jsx(V,{item:x,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,formValues:b,disabled:m,loading:f,onCancel:h},x.key))})]}):e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",sx:{color:a&&!q?"error.main":"text.secondary"},children:[p,a&&e.jsx(J,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{m||F?.edited||w||i(n,b[y],"edit")},children:e.jsx(r,{...t})}),!R&&e.jsx(j,{className:"form-item-action",style:{marginLeft:0},children:I?e.jsxs(e.Fragment,{children:[F.edited?e.jsx(D,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(n,q,"confirm")},disabled:m||f,sx:{animation:E?`${re} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?e.jsx(X,{size:24}):e.jsx(M,{})}):null,e.jsx(D,{"data-cy":"schema-form-item-cancel",onClick:()=>h(n),style:{paddingLeft:F.edited?4:8},disabled:m||f,size:"large",children:e.jsx(W,{})})]}):null})]})]},y)}function ie({schema:n,loading:s=!1,value:l=void 0,defaultValue:i={},onChange:c,style:m={},disabled:f=!1}){const h=Object.prototype.toString.call(l)==="[object Object]",[b,y]=u.useState([]),[p,a]=u.useState(h?l:i),R=u.useMemo(()=>n.length===1,[n]),g=u.useCallback(r=>b.find(t=>t.key===r),[b]);u.useEffect(()=>{R&&n[0]?.required&&y([{key:n[0].key,editing:!0,initialValue:i[n[0].key]}])},[n,R,i]);const C=u.useCallback(r=>{y(t=>t.find(d=>d.key===r.key)?t.map(d=>d.key===r.key?r:{...d}):[r].concat(t))},[]),w=u.useCallback((r,t,x)=>{const{key:d,secure:_}=r,k=g(d)??{...r};k.editing=!0;const L=p[d]!==t;k.edited=t&&k.initialValue!==t,k.initialValue=i[d];const P={...p,[d]:t};L&&a(P),c({[d]:t},{allValues:P,action:x,currentItem:r}),x==="confirm"&&_&&a({...p,[d]:"__encrypted__"}),x==="confirm"&&(k.initialValue=p[d]),["confirm","cancel"].includes(x)&&(k.editing=!1,k.edited=!1),C(k)},[i,p,c,C,g]),F=u.useCallback((r,{editing:t=!1})=>{const{key:x}=r,d=h?l[x]:p[x];return d==="__encrypted__"?t?"":"******":d},[h,l,p]),I=u.useCallback(r=>{const t=g(r.key);t&&w(r,t.initialValue,"cancel")},[g,w]),E=u.useCallback(r=>{const t=g(r.key);!t||!t.edited||(t.shaking=!0,C(t),setTimeout(()=>{t.shaking=!1,C(t)},500))},[g,C]),q=u.useCallback(r=>{const t=g(r.key);!t||!t.edited?I(r):E(r)},[g,E,I]);return e.jsx(ae,{className:"form",style:m,children:n?.map(r=>{const{hidden:t=!1}=r;return t?null:e.jsx(V,{item:r,findEditingItem:g,getItemValue:F,onFormItemChange:w,onFocusOut:q,formValues:p,disabled:f,loading:s,onCancel:I})})})}ie.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};const ae=K(Q)``;export{ie as S};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import{j as e,z as yr,bN as ye,M as oe,al as m,R as G,X as u,L as ve,bO as vr,I as W,aL as wr,T as A,ak as jr,bP as Se,P as Pe,bK as Ie,a6 as Te,A as Ne,C as Ue,bQ as Cr,bR as kr,V as Re,aZ as Sr,bS as Pr,aT as Z,bT as Ir,a7 as Y,n as ne,G as Tr,bU as Rr,as as Me,b3 as we,bV as Mr,b4 as Ar,bb as Er,bW as zr}from"./vendor-mui-core-D6nniiQs.js";import{r as y,a as Wr,j as Lr,m as Dr}from"./vendor-react-DX7tU9aY.js";import{t as Fe,F as Br,a8 as Or,a4 as Ae,E as $r,z as se,n as H,x as Nr}from"./vendor-utils-BbcnEeJI.js";import{u as Ur,ar as Fr,as as F,at as qr,W as qe,au as _r,j as Hr,av as _e,a4 as le,a5 as Gr,aw as Kr}from"./index-BJCzMYyG.js";import{a as R,j as Yr,r as ce,i as Q,b as M,p as Vr}from"./vendor-hooks-Bt9Vv36g.js";import{t as He}from"./arrow-down.svg-Dz9H9vM-.js";import{b1 as je,F as E,V as L,bb as Zr,aH as Ge,bc as Qr,y as $,a4 as Xr,bd as Jr,be as Ee,G as et,b2 as Ke,a5 as Ce,U as rt,ai as T,Q as tt,S as ot,E as nt,bf as st,bg as it,N as Ye}from"./vendor-ux-hzekFYg2.js";import{N as at}from"./list-BtmehYr0.js";import{d as lt}from"./search-4YYphs0l.js";import{B as ze}from"./bundle-avatar-Cy8tSSSQ.js";import{c as We,T as ct}from"./team-DXPe7dCA.js";import{b as dt,d as ut,a as Ve,c as Ze,e as pt,f as ft,h as ht,q as xt}from"./user-center-D-UOqGpV.js";import{T as ge,O as mt}from"./index-BtxDkXoY.js";import{c as gt}from"./passport-D7GEY4wO.js";import{N as Qe,U as Xe}from"./index-B-yh2KQb.js";import{u as de}from"./use-mobile-DAngW3li.js";import bt from"./index-CZc0agHR.js";import{U as yt,a as vt}from"./user-follower-_9B1O2CU.js";import{f as V}from"./index-DBs9Ljax.js";import{S as Je}from"./switch-D9wb-oPu.js";import{M as er}from"./provider-icon-Blmpf_9p.js";import{U as wt}from"./actions-Dm98-Dap.js";import{x as jt,d as Ct}from"./info-outline-rounded-CTki6xsp.js";import{u as Le}from"./index-u8Hqob_G.js";import kt from"./index-Bg0Lw3eZ.js";import{o as St}from"./vendor-arcblock-B6JCofz3.js";import{D as Pt,a as ie,b as It,S as Tt}from"./index-BsIQdVmB.js";import"./index-BojVbZw0.js";import"./server-logo-notext.svg-CtPRYaCm.js";import"./util-Bf1lWzn8.js";import"./base32-D79Y2AcQ.js";import"./session-DpYXqKUu.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-OBN14KiV.js";import"./theme-mode-toggle-BYQvzsDR.js";import"./use-mobile-kXWiSSQD.js";import"./index-WY8_4PO1.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-IV_8xnB2.js";import"./use-app-logo-0G6x82Xn.js";import"./fallback-CJFJeDKq.js";import"./index-CYam9iu7.js";import"./index-BqISx1lI.js";import"./nav-menu-CefEor9d.js";import"./utils-eOkzHJzR.js";import"./revoke.svg-BF_gJc34.js";import"./google-icon-vNOJy67F.js";import"./use-mobile-CEr7zhO3.js";import"./actions-DbuL4r3Z.js";import"./index-DPbBn0Vu.js";import"./form-text-input-Dq_8KU_Y.js";import"./required-jUJP5eu8.js";import"./form-wrapper-YOmD-sDI.js";import"./edit.svg-BGhTyO6h.js";import"./lock.svg-BOhdQlHW.js";import"./index-BJ69cdwn.js";import"./permission-ozcooui7.js";import"./confirm-ClxC2cDv.js";import"./click-to-copy-BCjXD9Nd.js";import"./invitations-Cs7LYbh9.js";import"./create-passport-svg-Ct68e5tm.js";import"./api-BMcHDEnt.js";import"./table-tips-C5NrUDu8.js";import"./ua-parser-D6QF1h5N.js";import"./sdk-C05lZFmW.js";import"./passkey-rounded-_WDHIZVd.js";import"./login-method-item-T1v3TnPG.js";import"./isEmail-BwGDo3Ws.js";import"./passport-item-CpICtT-w.js";import"./did-address-BhAIkFPZ.js";import"./index-BtHiIOEI.js";import"./vendor-mui-x-Ds-5Y7YM.js";import"./AdapterDayjs-B5owpIH3.js";import"./delete-confirm-CxRbnJU_.js";import"./index-D29L5UKE.js";import"./index-Dh38UJiv.js";function Rt(){let r=new Map;function i({root:s,rootMargin:t,threshold:o}){let h=r.get(s);h||(h=new Map,r.set(s,h));let a=JSON.stringify({rootMargin:t,threshold:o}),p=h.get(a);if(!p){let l=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(n=>{l.get(n.target)?.(n)})},{root:s,rootMargin:t,threshold:o}),entryCallbacks:l},h.set(a,p)}return{observe:(l,x)=>{p.entryCallbacks.set(l,x),p.observer.observe(l)},unobserve:l=>{p.entryCallbacks.delete(l),p.observer.unobserve(l)}}}return{getObserver:i}}var Mt="0px",At=[0],Et=Rt();function zt(r){let i=r?.rootMargin??Mt,s=r?.threshold??At,t=y.useRef(null),o=y.useRef(null),h=y.useRef(null),[a,p]=y.useState(),l=y.useCallback(()=>{let k=t.current;if(!k){p(void 0);return}let v=Et.getObserver({root:o.current,rootMargin:i,threshold:s});v.observe(k,d=>{p(d)}),h.current=v},[i,s]),x=y.useCallback(()=>{let k=h.current,v=t.current;v&&k?.unobserve(v),h.current=null},[]),n=y.useCallback(k=>{x(),t.current=k,l()},[l,x]),f=y.useCallback(k=>{x(),o.current=k,l()},[l,x]);return[n,{entry:a,rootRef:f}]}var Wt=zt;function Lt(r){let[i,s]=Wt(r),t=!!s.entry?.isIntersecting,[o,h]=y.useState(t);return t&&!o&&h(!0),[i,{...s,isVisible:t,wasEverVisible:o}]}var Dt=Lt,Bt=100;function Ot({loading:r,hasNextPage:i,onLoadMore:s,rootMargin:t,disabled:o,delayInMs:h=Bt}){let a=y.useRef(s),[p,{rootRef:l,isVisible:x}]=Dt({rootMargin:t});y.useEffect(()=>{a.current=s},[s]);let n=!o&&!r&&x&&i;return y.useEffect(()=>{if(n){let f=setTimeout(()=>{a.current()},h);return()=>{clearTimeout(f)}}},[n,h]),[p,{rootRef:l}]}var $t=Ot;const me={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};ae.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function ae({severity:r,size:i=8}){return me[r]?e.jsx(m,{component:"span",sx:{display:"inline-block",width:i,height:i,borderRadius:"50%",backgroundColor:me[r]||me.info}}):null}rr.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 rr({theme:r="dark",type:i="button",onSelectType:s,extra:t=void 0,currentTab:o="",loading:h=!1,...a}){const{t:p}=y.useContext(je),l=[{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"}],x=g=>{(g!==o||!h)&&s(g)},n=y.useMemo(()=>{const g={width:"100%",bgcolor:r==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:i==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return i==="line"?Object.assign(g,{}):g},[i,r]),f=(g,j,C)=>e.jsx(G,{disabled:h,onClick:()=>x(g.value),className:`profile-button ${j?"active":""}`,...a,children:g.label},g.value||C),k=(g,j,C)=>e.jsx(G,{variant:"text",disabled:h,onClick:()=>x(g.value),className:`profile-line-button ${j?"active":""}`,...a,children:g.label},g.value||C),v=()=>l?.map((g,j)=>{const C=o===g?.value;return i==="line"?e.jsx(y.Fragment,{children:k(g,C,j)},g.value||j):e.jsx(y.Fragment,{children:f(g,C,j)},g.value||j)}),d=g=>{const{value:j}=g.target;x(j==="all"?"":j)};return i==="select"?e.jsx(yr,{sx:{maxWidth:300},children:e.jsx(ye,{value:o||"all",onChange:d,size:"small",label:"Severity",IconComponent:g=>e.jsx(He,{...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:l.map((g,j)=>e.jsx(oe,{value:g.value||"all",children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ae,{severity:g.value}),g.label]})},g.value||j))})}):e.jsxs(m,{className:"severity-tabs",sx:n,children:[e.jsx(m,{sx:{...i==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),t]})}tr.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function tr({loading:r,paging:i,onChange:s}){const{t}=y.useContext(je),o=ve(l=>l.breakpoints.down("md"));if(i.pageCount<=0||o)return null;const h=(l,x)=>{s({page:x+1})},a=l=>{const x=Number(l.target.value);s({page:1,pageSize:x})},p=i.page-1<=0?0:i.page-1;return e.jsx(m,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(vr,{component:"div",disabled:r,count:i.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:t("pagination.rowsPerPage"),labelDisplayedRows:({from:l,to:x,count:n})=>`${l}–${x} / ${n!==-1?n:`${t()}more than ${x}`}`,rowsPerPage:i.pageSize,onPageChange:h,onRowsPerPageChange:a})})}const Nt=y.memo(tr),Ut={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"/>'},De=6,Be={"& .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}},Ft={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},Oe=()=>({...Ft,width:"calc(50% - 8px)"});or.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 or({onFilterChange:r=()=>{},loading:i=!1,type:s="service",blockletMap:t={},filterType:o="component",selectedId:h=[],severity:a=[],enableMarkAllAsRead:p=!0,unReadCount:l=0,onReadFilterChange:x=()=>{},currentReadFilter:n="all"}){const{t:f}=y.useContext(je),[k,v]=y.useState(null),d=!!k,[g,j]=y.useState(h),[C,D]=y.useState(a),[b,S]=y.useState(!1),[P,q]=y.useState(""),[B,N]=y.useState([]);y.useEffect(()=>{j(h),D(a)},[h,a]);const U=[{label:f("notification.filterType.all"),value:"all"},{label:f("notification.filterType.unread"),value:"unread"}],X=c=>{(c!==n||!i)&&x(c)},K=[{label:f("notification.severityType.info"),value:"info"},{label:f("notification.severityType.success"),value:"success"},{label:f("notification.severityType.warning"),value:"warning"},{label:f("notification.severityType.error"),value:"error"}],J=c=>{v(c.currentTarget),q(""),S(!1)},pe=()=>{v(null)},ee=c=>{const w=g.includes(c)?g.filter(I=>I!==c):[...g,c];j(w),r({id:w,severity:C})},re=c=>{const w=C.includes(c)?C.filter(I=>I!==c):[...C,c];D(w),r({severity:w,id:g})},fe=c=>{q(c.target.value)},he=()=>{S(!b)},_=Wr.useMemo(()=>{if(!t.size)return[];const c=[];return o==="component"&&c.push({label:f("notification.system"),id:"system"}),Array.from(t).forEach(([,w])=>{const I=w.did||w.meta?.did,z=w.title||w.meta?.title||"",O=w.appPid||w.appDid;(o==="component"&&O!==I||o==="entity"&&O===I)&&c.push({label:z,id:I,blocklet:w,ancestors:w.ancestors})}),c},[t,o,f]);y.useEffect(()=>{if(P.trim()==="")N(_);else{const c=P.toLowerCase(),w=_.filter(I=>I.label.toLowerCase().includes(c));N(w)}},[P,_]);const xe=P.trim()!==""||b?B:B.slice(0,De);return e.jsxs(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(m,{sx:{display:"flex",gap:1.5},children:U.map(c=>e.jsxs(G,{disabled:i,onClick:()=>X(c.value),className:`profile-button ${n===c.value?"active":""}`,sx:{...s==="service"&&n===c.value?{color:"secondary.main"}:{},color:"red",fontWeight:n===c.value?"bold":"normal"},children:[c.label,c.value==="unread"&&l>0&&` (${l})`]},c.value))}),e.jsxs(m,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(W,{size:"small",onClick:J,disabled:i,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(E,{icon:Ut,hFlip:!0})}),e.jsx(wr,{open:d,anchorEl:k,onClose:pe,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(m,{children:[e.jsxs(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:f("notification.severity")}),e.jsx(m,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||C.length>0)&&e.jsx(G,{size:"small",onClick:()=>{j([]),D([]),r({severity:[],id:[]})},startIcon:e.jsx(jr,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:f("notification.clear")})})]}),e.jsx(m,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Se,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:K.map(c=>e.jsx(Pe,{elevation:0,sx:Oe(C.includes(c.value)),children:e.jsx(Ie,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},...Be},control:e.jsx(Te,{checked:C.includes(c.value),onChange:()=>re(c.value),disabled:i,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(ae,{severity:c.value}),c.label]})})},c.value))})}),e.jsxs(m,{sx:{mb:2},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:f("notification.from")}),e.jsx(m,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Ne,{size:"small",placeholder:"search",value:P,onChange:fe,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(Ue,{position:"start",sx:{marginRight:"2px"},children:e.jsx(E,{icon:lt})})}}})})]}),e.jsx(Se,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:xe.map(c=>e.jsx(Pe,{elevation:0,sx:Oe(g.includes(c.id)),children:e.jsx(Ie,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},...Be},control:e.jsx(Te,{checked:g.includes(c.id),onChange:()=>ee(c.id),disabled:i,size:"small"}),label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[c.blocklet&&e.jsx(ze,{size:20,blocklet:c.blocklet,ancestors:c.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(A,{noWrap:!0,variant:"body2",component:"span",title:c.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:c.label})]})})},c.id))}),B.length>De&&P.trim()===""&&e.jsx(G,{fullWidth:!0,size:"small",onClick:he,sx:{mt:1},endIcon:b?e.jsx(Cr,{}):e.jsx(kr,{})})]})]})})]})]}),g.length>0||C.length>0?e.jsxs(m,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[C.map(c=>{const w=K.find(I=>I.value===c);return e.jsx(Re,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(ae,{severity:c}),w?w.label:c]}),onDelete:()=>re(c),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${c}`)}),g.map(c=>{const w=_.find(I=>I.id===c);return e.jsx(Re,{label:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx(ze,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:c]}),variant:"outlined",onDelete:()=>ee(c),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${c}`)})]}):null]})}const qt=Z(Ir)`
|
|
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 _t(){const[r,i]=y.useState(!1);y.useEffect(()=>{const t=Fe(()=>{i(window.pageYOffset>300)},200);return window.addEventListener("scroll",t),t(),()=>window.removeEventListener("scroll",t)},[]);const s=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(Sr,{in:r,children:e.jsx(qt,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:s,children:e.jsx(Pr,{})})})}const Ht=Z.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: ${r=>r.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:r})=>r.palette.background.default};
|
|
27
|
+
color: ${({theme:r})=>r.palette.text.primary};
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
border: 1px solid ${({theme:r})=>r.palette.divider} !important;
|
|
30
|
+
}
|
|
31
|
+
.profile-button.active.MuiButtonBase-root,
|
|
32
|
+
.profile-button.active.MuiButtonBase-root:hover {
|
|
33
|
+
color: ${({theme:r})=>r.palette.primary.main};
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
background-color: ${({theme:r})=>ne(r.palette.primary.main,.1)};
|
|
36
|
+
border: 1px solid ${({theme:r})=>ne(r.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:r})=>r.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:r})=>r.palette.text.primary};
|
|
55
|
+
border-bottom: 1px solid ${({theme:r})=>r.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:r})=>r.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
|
+
`;nr.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 nr({blocklets:r=[],context:i,pagination:s=!0,inDialog:t=!1,filterType:o="component",toViewAll:h=()=>{},type:a="service"}){const{data:p,paging:l,refresh:x,loading:n,params:f,onReadNotification:k,componentDids:v,filterUnReadCount:d,initial:g}=i,j=c=>{x({...f,severity:c&&typeof c=="string"?[c]:c||[],paging:{...f.paging,page:1}})},[C]=Lr(),D=R(()=>C.get("id"),[C]),b=ve(c=>c.breakpoints.down("md")),[S,P]=y.useState(0),[q,B]=y.useState(!1),N=y.useMemo(()=>f.read===!1?"unread":"all",[f.read]),U=R(()=>Fe(c=>{if(n)return;const w=p.length,I=p.filter(O=>!We(O)).length;let z={...f,append:!0,paging:{...f.paging,...c,currentPage:(l.currentPage||0)+1}};N==="unread"&&I<w&&c.page>f.paging.page&&(z={...f,append:!0,paging:{...f.paging,...c,page:f.paging.page||1,currentPage:(l.currentPage||0)+1}}),x(z)},500),[p,f,N,l,n,x]);Yr(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!l.currentPage||l.currentPage===1)&&P(l.total)},[l.total,l.currentPage]),y.useEffect(()=>{setTimeout(()=>{const c=document.getElementById(D);c&&c.scrollIntoView({behavior:"smooth",block:"center"}),B(!0)},100),setTimeout(()=>{B(!1)},3e3)},[D]);const X=R(()=>p?.length>0&&p.length<S,[p,S]),K=y.useCallback(c=>{const{blocklet:w={}}=window,I=[w?.did,...(w?.ancestors||[]).map(z=>z)];return v?.includes(c)||I.findIndex(z=>z===c)>-1},[v]),J=y.useMemo(()=>{const c=new Map;return r.length&&r.forEach(w=>{const I=w?.did||w.meta?.did;I&&!c.has(I)&&(w.ancestors=[],c.set(I,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(z=>{c.has(z)||c.set(z,w)})),w?.children?.length>0&&w.children.forEach(z=>{const O=z?.did||z.meta?.did;O&&!c.has(O)&&K(O)&&(z.ancestors=[w],c.set(O,z))})}),c},[r,K]),pe=y.useCallback(()=>{n||U({page:l.page+1})},[l.page,n,U]),[ee]=$t({loading:n,hasNextPage:X,onLoadMore:pe}),re=c=>{!c||We(c)||k(c.id).then(()=>{t&&h()})},fe=({severity:c,id:w})=>{if(n)return;let I={};o==="component"?I={entityId:[],componentDid:w}:o==="entity"&&(I={componentDid:[],entityId:w}),x({...f,severity:c,...I,paging:{...f.paging,page:1}})},he=c=>{if(n)return;let w={...f,paging:{...f.paging,page:1}};c==="unread"?(w.read=!1,w.paging.currentPage=1):w=Br(w,"read"),x(w)},_=R(()=>o==="component"?Array.isArray(f.componentDid)?f.componentDid:[]:o==="entity"?Array.isArray(f.entityId)?f.entityId:[]:[],[f,o]),xe=R(()=>(Array.isArray(f.severity)?f.severity:[])[0]||"",[f.severity]);return e.jsxs(Ht,{inDialog:!!t,children:[t?e.jsx(rr,{currentTab:xe,type:"line",theme:"light",onSelectType:j}):e.jsx(or,{loading:n,blockletMap:J,unReadCount:d,filterType:o,type:a,selectedId:_,onFilterChange:fe,severity:f.severity,onReadFilterChange:he,currentReadFilter:N}),!b&&n?e.jsx(m,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):e.jsx(at,{data:p,blockletMap:J,onReadNotification:re,onReadBatch:k,inDialog:t,highlightId:D,highlight:!t&&q,type:a}),s&&!b?e.jsx(Nt,{loading:n,paging:l,onChange:U}):null,s&&b&&(n||X)?e.jsx(m,{ref:ee,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(Y,{})}):null,!t&&b?e.jsx(_t,{}):null]})}const Gt=y.memo(nr);function ue(r){const{userDid:i=""}={},{session:s}=Ur(),t=R(()=>{if(i)return i;const l=window.location.href,x=Or(l);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:s?.user?.did},[s?.user?.did,i]),o=R(()=>s.user,[s]),h=R(()=>o?t===o?.did:!1,[t,o?.did]),a=ce(async()=>{if(await Fr(()=>s?.initialized),h)return s.user;if(t)return F.user.getUserPublicInfo({did:t})},{refreshDeps:[t,h,s?.initialized,o]}),p=R(()=>o?.passports?.some(l=>l.role===qr.OWNER),[o]);return{currentDid:t,session:s,isMyself:h,user:o,viewUser:a.data,isOwner:p}}function sr({user:r,...i}){const{t:s}=L(),t=Tr(),o=R(()=>{const p=(r?.passports||[]).map(l=>({...l,revoked:l.status===Zr.REVOKED}));return p.sort((l,x)=>l.revoked===x.revoked?0:l.revoked?1:-1),Ae(p.filter(l=>!l.display),"role").concat(Ae(p.filter(l=>l.display),"display.content"))},[r?.passports]),h=R(()=>o?.find(p=>p.name===r.role),[o,r?.role]),a=t.palette.primary.main;return o.length===0?e.jsx(m,{children:e.jsx(Ge,{children:s("userCenter.noPassport")})}):e.jsx(m,{...i,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,...i.sx},children:o.map(p=>e.jsx(dt,{passport:p,user:r,color:window.blocklet.passportColor,createPassportSvg:gt,title:h&&h.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:h&&h.role===p.role?`0px 2px 4px 0px ${a}, 0px 1px 2px -1px ${a}, 0px 0px 0px 1px ${a} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}sr.propTypes={user:u.object.isRequired};function Kt({visible:r,onClose:i,nft:s}){return!r||!s?null:e.jsx(Yt,{children:e.jsx(Rr,{open:r,onClose:i,children:e.jsx(Vt,{onClick:i,children:e.jsx(Qe,{data:Xe(s),address:s.address,inset:!0})})})})}const Yt=Z.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
|
+
`,Vt=Z.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
|
+
`,Zt=r=>({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:ne(r.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:ne(r.palette.background.paper,1)}}}),Qt={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"}},$e="https://main.abtnetwork.io/explorer";function ir({user:r}){const{t:i,locale:s}=L(),t=de(),[o,h]=y.useState({visible:!1,nft:null}),[a,p]=y.useState({anchorEl:null,props:null}),l=b=>{const S=se($e,"assets",b);window.open(S,"_blank")},x=(b,S)=>{let P="";typeof S.data?.value=="string"?P=JSON.parse(S.data?.value)?.domain:P=S.data?.value?.domain,p({anchorEl:b,props:{title:P?`Hey, I just won an NFT at the ${P} event!`:"Hey, I just won an NFT!",url:se($e,"assets",S.address)}})},n=b=>{h({visible:!0,nft:b})},f=Q({page:1,size:20}),k=ce(async(b=f)=>(await $r.get(`${qe}/ocap/listAssets`,{params:{ownerAddress:r.did,...b}})).data,{ready:r?.did&&f,defaultParams:[f],refreshDeps:[r?.did,f]}),{loading:v,data:d}=k,g=d?.page??{cursor:0,next:!1,total:0},j=(b,S)=>{f.page=S,k.run(f)},C=M(b=>[e.jsx(W,{size:"small",className:"mask-item",onClick:S=>{S.stopPropagation(),l(b.address)},children:e.jsx(E,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(W,{size:"small",onClick:S=>{S.stopPropagation(),x(S.currentTarget,b)},className:"mask-item",children:e.jsx(E,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(W,{size:"small",onClick:S=>{S.stopPropagation(),n(b)},className:"mask-item",children:e.jsx(E,{icon:"tabler:eye",fontSize:18})},"view")]),D=R(()=>{if(v){const b=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(S=>e.jsx(Me,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},S));return e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(Me,{width:"20%"}),e.jsx(m,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:b})]})}return e.jsxs(e.Fragment,{children:[e.jsx(A,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:i("userCenter.common.nft")}),d?.assets?.length===0&&!v&&e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Ge,{children:i("userCenter.common.noNFT")})}),e.jsx(m,{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:d?.assets?.map(b=>e.jsxs(m,{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",...t?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(Qe,{data:Xe(b),address:b.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),t?e.jsx(m,{className:"footer-mask",sx:Qt,children:C(b)}):e.jsx(m,{className:"mask",sx:Zt,children:e.jsx(we,{direction:"row",spacing:1,children:C(b)})})]},b.address))}),g.next||f.page>1?e.jsx(Mr,{sx:{display:"flex",justifyContent:"center",mt:2},page:f.page,onChange:j,count:Math.ceil(g.total/f.size),size:"small"}):null,e.jsx(Kt,{visible:o.visible&&!!o.nft,nft:o.nft,onClose:()=>{h({visible:!1,nft:null})}}),e.jsx(Qr,{locale:s,anchorEl:a.anchorEl,onClose:()=>{p({anchorEl:null,props:null})},sharedProps:a.props||{title:"",url:""}})]})},[v,g,f.page,f.size,j,a,o]);return e.jsx(m,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:D})}ir.propTypes={user:u.object.isRequired};function Xt(){const{t:r}=L(),{user:i,isMyself:s,viewUser:t}=ue();return e.jsxs(m,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[s?e.jsxs(m,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(A,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:r("userCenter.passport")}),e.jsx(sr,{user:i})]}):null,e.jsx(ir,{user:s?i:t})]})}const Jt=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function ar({user:r,onSave:i}){const{t:s,changeLocale:t}=L(),o=Q({locale:r.locale,loading:!1}),h=M(async a=>{try{const{value:p}=a.target;o.loading=!0,await F.user.saveProfile({locale:p}),await i("profile"),t(p),o.locale=p}catch(p){$.error(V(p))}finally{o.loading=!1}});return e.jsxs(m,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(m,{children:s("userCenter.commonSetting.locale")}),e.jsx(m,{children:e.jsx(ye,{value:o.locale,onChange:h,size:"small",IconComponent:a=>e.jsx(He,{...a,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||Jt).map(a=>e.jsx(oe,{value:a.code,children:a.name},a.code))})})]})}ar.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function lr({type:r,url:i,enabled:s,onEdit:t,onChange:o,onDelete:h}){return e.jsxs(m,{sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",py:1,px:1.5,gap:.75,borderRadius:1,"& .hover-actions":{opacity:0,transition:"opacity 0.2s"},"&:hover":{backgroundColor:"action.hover","& .hover-actions":{opacity:1}}},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1,flex:1,minWidth:0,cursor:"pointer"},onClick:t,children:[e.jsx(ge,{title:r,children:e.jsx(E,{icon:r==="slack"?"logos:slack-icon":"material-symbols:link-rounded"})}),e.jsx(A,{sx:{color:"text.primary",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),e.jsxs(m,{sx:{minWidth:72,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1},children:[e.jsx(W,{className:"hover-actions",size:"small",onClick:t,sx:{p:0},children:e.jsx(E,{icon:Ve})}),e.jsx(W,{color:"error",onClick:h,size:"small",sx:{p:0},children:e.jsx(E,{icon:Ze})}),e.jsx(Je,{checked:s,onChange:o})]})]})}lr.propTypes={type:u.string.isRequired,url:u.string.isRequired,onEdit:u.func.isRequired,onChange:u.func.isRequired,enabled:u.bool.isRequired,onDelete:u.func.isRequired};function be({onTest:r=H,onDelete:i=H,onSave:s=H,onCancel:t=H,type:o="slack",url:h="",enabled:a=!0,edit:p=!1,webhooks:l=[]}){const{t:x}=L(),n=Q({type:o||"slack",url:h||"",edit:p??!1,enabled:a??!0,error:"",loading:!1}),f=M(()=>n.url?n.type==="slack"&&!_r.isSlackWebhookUrl(n.url)||!Hr(n.url)?(n.error=x("common.invalid"),!1):l.some(C=>C.url===h&&n.url===h?!1:C.url===n.url)?(n.error=x("common.duplicate"),!1):(n.error="",!0):(n.error=x("common.required"),!1)),k=M(()=>{n.edit=!1,n.url=h||"",n.type=o||"slack",n.error="",n.loading=!1,t()}),v=M(async j=>{n.loading=!0,await r(j),n.loading=!1}),d=M(j=>()=>{f()&&j({type:n.type,url:n.url,enabled:n.enabled})}),g=R(()=>n.error?e.jsx(A,{component:"span",color:"error",children:n.error}):n.edit?n.loading?e.jsx(Y,{size:16}):e.jsx(W,{size:"small",onClick:d(v),sx:{mr:-1},children:e.jsx(E,{icon:ut})}):null,[n.error,n.edit,n.loading]);return n.edit?e.jsxs(m,{sx:{display:"flex",gap:1.5,px:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(ye,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!n.edit||n.loading,size:"small",value:n.type,onChange:j=>{n.type=j.target.value},children:[e.jsx(oe,{value:"api",children:x("userCenter.webhook.url")}),e.jsx(oe,{value:"slack",children:x("userCenter.webhook.slack")})]}),e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Ne,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!n.edit||n.loading,fullWidth:!0,size:"small",required:!0,value:n.url,onChange:j=>{n.url=j.target.value,n.error="",f()},error:!!n.error,slotProps:{input:{endAdornment:e.jsx(Ue,{position:"end",children:g})}}}),e.jsx(m,{sx:{display:"flex",gap:.5},children:n.edit?e.jsxs(e.Fragment,{children:[e.jsx(W,{color:"success",onClick:d((...j)=>{s(...j),n.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(E,{icon:Xr})}),e.jsx(W,{color:"error",onClick:k,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(E,{icon:Jr})})]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:()=>{n.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(E,{icon:Ve})}),e.jsx(W,{color:"error",onClick:()=>{i({type:n.type,url:n.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(E,{icon:Ze})})]})})]})]}):e.jsx(lr,{type:n.type,url:n.url,enabled:n.enabled,onEdit:()=>{n.edit=!0},onChange:j=>{n.enabled=j,d((...C)=>s(...C))()},onDelete:()=>{i({type:n.type,url:n.url})}})}be.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool,webhooks:u.array,enabled:u.bool};function te({title:r=void 0,description:i=void 0,value:s,onChange:t,isMobile:o,type:h}){const a=M(p=>{p.stopPropagation()});return e.jsxs(m,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",py:1,px:1.5,gap:.75,borderRadius:1,"&:hover":{backgroundColor:"action.hover"}},children:[e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[h==="push"?e.jsx(E,{icon:"tabler:bell"}):e.jsx(er,{provider:h,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsxs(A,{component:"div",onClick:a,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:o?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:o?"normal":"nowrap"},children:[r,i]})]}),e.jsx(Je,{sx:{minWidth:36,flexShrink:0},checked:s,onChange:t})]})}te.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired,type:u.oneOf(["wallet","email","push"]).isRequired};function cr({user:r,isMobile:i}){const{t:s}=L(),t=Q({showAdd:!1}),o=ce(async()=>await F.user.getUserNotificationConfig(),{refreshDeps:[r],loadingDelay:300}),h=R(()=>({wallet:!0,email:!0,phone:!1,push:!0,...o?.data?.notifications||{}}),[o?.data?.notifications]),a=R(()=>o?.data?.webhooks||[],[o?.data?.webhooks]),p=M(async v=>{try{await F.user.saveUserNotificationConfig(v),$.success(s("userCenter.saveSuccess")),o.run()}catch(d){$.error(V(d))}}),l=M(async(v,d)=>{await p({notifications:{[v]:d}})}),x=async v=>{try{await F.user.testNotificationWebhook(v),$.success(s("userCenter.webhookTested"))}catch(d){$.error(V(d))}},n=M(async v=>{await p({webhooks:a.filter((d,g)=>g!==v)})}),f=M(async(v,d)=>{await p({webhooks:a.map((g,j)=>j===v?d:g)})}),k=M(async v=>{await p({webhooks:[...a,v]}),t.showAdd=!1});return o.error?e.jsx(Ar,{severity:"error",children:o.error.message}):o.loading||!o.data?e.jsx(m,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(Y,{})}):e.jsxs(m,{sx:{display:"flex",flexDirection:"column",".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsxs(m,{sx:{display:"flex",flexDirection:"column",alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}}},children:[e.jsx(te,{value:h.wallet,isMobile:i,type:"wallet",title:s("userCenter.walletNotification"),onChange:v=>l("wallet",v),description:Ee(r)&&e.jsx(et,{did:Ee(r),showQrcode:!1,showAvatar:!i,copyable:!0,compact:!0,responsive:!0,startChars:i?2:6})}),e.jsx(te,{value:h.email,isMobile:i,type:"email",onChange:v=>l("email",v),title:s("userCenter.emailNotification"),description:r?.email&&e.jsx(A,{component:"span",sx:{color:"text.secondary",fontSize:13},children:r?.email})}),e.jsx(te,{isMobile:i,value:h.push,type:"push",title:s("userCenter.pushNotification"),onChange:v=>l("push",v)})]}),e.jsxs(we,{useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[a.map((v,d)=>e.jsx(be,{enabled:v.enabled,onTest:x,onDelete:()=>n(d),onSave:(...g)=>f(d,...g),type:v.type,url:v.url,edit:!1,webhooks:a},`${d}_${v.url}`)),t.showAdd&&e.jsx(be,{onTest:x,onCancel:()=>{t.showAdd=!1},onSave:(...v)=>k(...v),edit:!0,webhooks:a},"add"),e.jsx(Ke,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1,mt:1,ml:1.5},startIcon:e.jsx(E,{icon:pt}),onClick:()=>{t.showAdd=!0},children:s("userCenter.addWebhook")})]})]})}cr.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function dr({item:r}){const i=Ce(),{blocklet:s}=jt(),{confirmApi:t,confirmHolder:o}=_e(),h=Q({loading:!1}),{t:a}=L(),{session:p}=y.use(le),{bindOAuth:l,unbindOAuth:x,setBaseUrl:n,baseUrl:f}=p.useOAuth(),{disconnectPasskey:k,setTargetAppPid:v}=p.usePasskey(),d=R(()=>rt[r?.provider]||"unknown",[r?.provider]),g=M(b=>b?._bind?b.provider===T.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===T.PASSKEY&&i.arcSphere?a("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider&&i.arcSphere?a("userCenter.thirdPartyLogin.mainProviderCantRemove"):"":""),j=M(async()=>{if(r?.provider===T.PASSKEY){await new Promise((b,S)=>{t.open({title:a("userCenter.thirdPartyLogin.disconnectPasskey",{name:d}),content:a("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:d}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(P){k({session:p,connectedAccount:r}).then(b).catch(S),P()},onCancel:b})});return}try{h.loading=!0,await new Promise((b,S)=>{if(r?._bind)t.open({title:a("userCenter.thirdPartyLogin.confirmUnbind",{name:d}),content:a("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:d}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:a("common.cancel"),onConfirm(P){x({session:p,connectedAccount:{...Nr(r,["did","pk"]),showProvider:r.provider,provider:r._rawProvider}}).then(b).catch(S),P()},onCancel:b});else if(r.provider===T.WALLET)t.open({title:a("userCenter.thirdPartyLogin.confirmBindWallet",{name:d}),content:a("userCenter.thirdPartyLogin.confirmBindWalletDescription",{name:d}),confirmButtonText:a("common.confirm"),confirmButtonProps:{color:"primary"},cancelButtonText:a("common.cancel"),onConfirm:P=>{p.bindWallet({onSuccess:b,onCancel:S}),P()},onCancel:b});else{const P=f,q=window?.blocklet;let B="/";const N=tt(q),U=ot(q);N&&U?.appPid&&p?.user?.sourceAppPid&&(B=U.appUrl),n(B),v(s?.appPid),l({session:p,oauthItem:{...r,provider:r._rawProvider}}).then(b).catch(S).finally(()=>{n(P),v()})}})}catch(b){console.error(`Failed to ${r?._bind?"unbind":"bind"} oauth account`,b)}finally{h.loading=!1}}),C=M(b=>b.provider===T.WALLET&&b.did?a("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?a("userCenter.thirdPartyLogin.mainAccount"):b?._bind?a("userCenter.thirdPartyLogin.disconnect"):a("userCenter.thirdPartyLogin.connect")),D=M(b=>b.provider===T.WALLET&&b.did||b.provider===T.PASSKEY&&(i.arcSphere||i.wallet)?!0:!!r._mainProvider,[i.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(m,{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:r?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16}}),e.jsx(m,{sx:{flex:1,display:{xs:r.userInfo?.email||r.did?"none":"block",sm:"block"}},children:d}),r.userInfo?.email||r.did?e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(m,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:r.userInfo?.email||r.did}),r.userInfo?.name?e.jsx(ge,{title:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(nt,{size:36,variant:"circle",shape:"circle",src:r.userInfo?.picture,did:r.did}),e.jsxs(m,{children:[e.jsx(A,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:r.userInfo?.name}),e.jsx(A,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:r.userInfo?.email})]})]}),children:e.jsx(m,{component:E,icon:Ct,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(ge,{title:g(r),placement:"auto",children:e.jsx(m,{children:e.jsx(Ke,{variant:"outlined",size:"small",sx:b=>{const S=b.palette.error.main,P=b.palette.primary.main;return{color:r?._bind?S:P,borderColor:r?._bind?S:P,backgroundColor:"background.default","&:hover":{borderColor:r?._bind?S:P,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:h.loading?null:e.jsx(E,{icon:ft}),onClick:j,disabled:D(r),loading:h.loading,children:C(r)})})}),o]})}dr.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 ur({user:r}){const{session:i}=y.use(le),[s,t]=y.useState({}),{getOAuthConfigs:o}=i.useOAuth(),h=Ce();Vr(async()=>{const l=await o({sourceAppPid:r?.sourceAppPid});t(l)},[r?.sourceAppPid]);const a=R(()=>{const l=Object.keys(s).map(x=>({...s[x],provider:x})).filter(x=>x.enabled);return[{provider:T.WALLET,order:-1},...l,{provider:T.PASSKEY,order:1/0}]},[s]),p=R(()=>{const l=st(r);let x=!1,n="",f=it(r);const k=l.find(d=>d.provider===T.AUTH0);return k&&(k.id.startsWith("google-oauth2|")&&(l.some(d=>d.provider==="google")||(x=!0,n=T.GOOGLE,f===T.AUTH0&&(f=T.GOOGLE))),k.id.startsWith("appleid|")&&(l.some(d=>d.provider===T.APPLE)||(x=!0,n=T.APPLE,f===T.AUTH0&&(f=T.APPLE))),k.id.startsWith("github|")&&(l.some(d=>d.provider===T.GITHUB)||(x=!0,n=T.GITHUB,f===T.AUTH0&&(f=T.GITHUB)))),a.flatMap(d=>{if(d.provider===T.AUTH0&&x)return null;if(d.provider===T.PASSKEY){const j=l.filter(C=>C.provider===T.PASSKEY);return j.length===0?null:j.map(C=>({...d,provider:d.provider,did:C.did,pk:C.pk,userInfo:C.userInfo,_bind:!0,_rawProvider:C.provider,_mainProvider:d.provider===f}))}const g=x&&d.provider===n?l.find(j=>j.provider===T.AUTH0):l.find(j=>j.provider===d.provider);return g?{...d,provider:d.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:d.provider===f}:{...d,provider:d.provider,_rawProvider:d.provider,_mainProvider:d.provider===f}}).filter(d=>!!d).sort((d,g)=>d._mainProvider?-1:d?.order!==void 0&&g?.order!==void 0?d.order-g.order:d?.order!==void 0?-1:1)},[r?.connectedAccounts,a]);return e.jsxs(m,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(l=>e.jsx(dr,{item:l},l?.provider)),h.wallet||h.arcSphere?null:e.jsx(wt,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:H,onError:H,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ur.propTypes={user:u.object.isRequired};function pr({configList:r,onSave:i}){const[s,t]=y.useState(r),{t:o}=L(),h=M(async(a,p)=>{try{const l=await F.user.saveUserPrivacyConfig({[a]:typeof p=="string"?p:!p});t(s.map(x=>({...x,value:l?.[x.key]??x.value}))),$.success(o("userCenter.saveSuccess")),i("privacy")}catch(l){$.error(V(l))}});return y.useEffect(()=>{t(r)},[r]),e.jsx(m,{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(a=>{if(a.isPrivate)return null;const p=!a.value||["all","follower-only"].includes(a.value);return e.jsxs(m,{children:[e.jsx(Le,{checked:p,labelProps:{label:e.jsx(A,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("userCenter.toPublic",{name:a.name})})},size:"small",onChange:l=>{const{checked:x}=l.target;a.followersOnly?h(a.key,x?"all":"private"):h(a.key,x)}},a.key),a.followersOnly&&p&&e.jsx(m,{sx:{pl:3,pt:1},children:e.jsx(Le,{checked:a.value==="follower-only",labelProps:{label:e.jsx(A,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:o("team.userFollowers.followersOnly")})},size:"small",onChange:l=>{const{checked:x}=l.target;h(a.key,x?"follower-only":"all")}})})]})})})}pr.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 fr({onDestroySelf:r=void 0}){const{confirmHolder:i}=_e(),{t:s}=L(),{session:t}=y.use(le),o=M(async()=>{if(!r||typeof r!="function")return;const h=t.withSecondaryAuth(r,{extraParams:{removeUserDid:t?.user?.did,input:{user:{did:t?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await h(),t.logout()}catch(a){$.error(a?.message||s("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(m,{children:e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(m,{children:[e.jsx(A,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:s("userCenter.dangerZone.deleteAccount")}),e.jsx(A,{variant:"caption",sx:{color:"text.secondary"},children:s("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(G,{variant:"contained",color:"error",size:"small",onClick:o,children:s("userCenter.dangerZone.delete")})]})}),i]})}fr.propTypes={onDestroySelf:u.func};function eo(){const r=de({key:"md"}),i=ve(o=>o.breakpoints.down("lg")),s={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},t=R(()=>Ye({},r?s:{}),[r]);return e.jsx(m,{id:"user-center-access-key-setting",sx:{maxWidth:r?"unset":i?"calc(100vw - 300px)":"100%",...r&&{".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:o=>`${o.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...r&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(kt,{isSelf:!0,columnSx:t})})}function hr({onDestroySelf:r=void 0,userCenterTabs:i=[]}){const{t:s}=L(),{user:t,session:o,isMyself:h,isOwner:a}=ue(),l=Ce().arcSphere,x=de({key:"md"}),n=ce(async()=>t&&h?await F.user.getUserPrivacyConfig({did:t.did}):null,{refreshDeps:[t,h],loadingDelay:300}),f=R(()=>i.map(d=>({key:d.value,name:d.label,value:d.protected,isPrivate:d.isPrivate,followersOnly:d.followersOnly})).filter(d=>!d.isPrivate),[i]),k=M(async d=>d==="privacy"?(await n.runAsync(),n.data):(d==="profile"&&await o.refresh(),null));y.useEffect(()=>{const d=window.location.hash.slice(1);d&&document.getElementById(d)?.scrollIntoView({behavior:"smooth"})},[]);const v=R(()=>[l?void 0:{label:s("userCenter.commonSetting.title"),value:"common",content:e.jsx(ar,{user:t,onSave:k})},{label:s("userCenter.notificationManagement"),value:"notification",content:e.jsx(cr,{user:t,isMobile:x})},{label:s("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ur,{user:t})},{label:s("common.accessKeys"),value:"accessKeys",content:e.jsx(eo,{isSelf:!0})},{label:s("common.mcpServers"),value:"mcpServers",content:e.jsx(bt,{})},f.length>0&&{label:s("userCenter.privacyManagement"),value:"privacy",content:e.jsx(pr,{configList:f,onSave:k})},{label:s("userCenter.sessionManagement"),value:"session",content:e.jsx(yt,{user:t,showUser:!1,getUserSessions:d=>F.userSession.getMyLoginSessions({},d)})},!a&&r&&typeof r=="function"?{label:s("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(fr,{onDestroySelf:r}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[t,f,x,a,r]);return h?e.jsx(m,{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(d=>d?e.jsxs(m,{id:d.value,sx:Ye({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},d.sx),children:[e.jsx(A,{sx:{color:"text.primary",fontWeight:600},children:d.label}),e.jsx(m,{sx:{mt:2.5},children:d.content})]},d.value):null)}):null}hr.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const xr=y.createContext({}),{Provider:ro,Consumer:Wn}=xr;function mr({children:r}){const[i]=y.useState(!1),{session:s}=y.use(le),{user:t}=s,[o,h]=y.useState(),a=y.useMemo(()=>t?.didSpace?.endpoint,[t?.didSpace]);y.useEffect(()=>{h(t?.didSpace)},[t?.didSpace]);const p=async()=>{h(void 0)},l=f=>{},x=async f=>{h(f),await l(f.endpoint)},n=!!(a&&o);return e.jsx(ro,{value:{loading:i,spaceGateway:o,session:s,deleteSpaceGateway:p,updateSpaceGateway:x,storageEndpoint:a,settingStorageEndpoint:l,hasStorageEndpoint:n},children:r})}function ke(){return y.use(xr)}mr.propTypes={children:u.node.isRequired};function to(r){const i=r.replace(/\/api\/space\/.+/,""),t=r.replace(/\/$/,"").split("/").at(-4);return se(i,"space",t)}function gr({session:r,spaceGateway:i,spaceStatus:s,refresh:t}){return e.jsxs(we,{direction:"row",spacing:1,children:[s===Pt.DISCONNECTED&&e.jsx(ie,{reconnect:!0,variant:"outlined",session:r,spaceDid:r.user?.didSpace?.did,spaceGatewayUrl:r.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await t()},onError:o=>{console.error(o),$.error(V(o))}}),e.jsx(W,{size:"small",LinkComponent:Er,href:to(i.endpoint),target:"_blank",children:e.jsx(zr,{})})]})}gr.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function br({spaceGateway:r=void 0}){const{t:i}=L(),{updateSpaceGateway:s,session:t}=ke(),o=de(),h=({spaceGateway:a})=>s(a);return e.jsxs(m,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(m,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(A,{sx:{fontSize:"16px",fontWeight:"bold"},children:i("userCenter.storage.spaces.connected.title")}),!o&&e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:t,onSuccess:h})]}),e.jsx(m,{children:r&&e.jsx(It,{endpoint:r.endpoint,deps:[r],selected:!0,footer:!0,action:a=>e.jsx(gr,{session:t,...a})},r.endpoint)}),o&&e.jsx(m,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ie,{connectScope:"user",connectText:i("userCenter.storage.spaces.connected.switch"),session:t,onSuccess:h})})]})}br.propTypes={spaceGateway:u.object};function oo(){const{t:r}=L(),{updateSpaceGateway:i,session:s}=ke(),t=({spaceGateway:o})=>i(o);return e.jsxs(m,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(A,{sx:{fontSize:"16px",fontWeight:"bold"},children:r("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Tt,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(m,{children:e.jsx(ie,{session:s,onSuccess:t})})]})}function no(){const{spaceGateway:r,hasStorageEndpoint:i,loading:s}=ke(),{isMyself:t}=ue();return t?s?e.jsx(St,{relative:"parent",children:e.jsx(Y,{})}):e.jsx(io,{children:e.jsx(m,{sx:{maxWidth:"720px"},children:i?e.jsx(br,{spaceGateway:r}):e.jsx(oo,{})})}):null}function so(){return e.jsx(mr,{children:e.jsx(no,{})})}const io=Z(m)`
|
|
122
|
+
height: 100%;
|
|
123
|
+
overflow-y: auto;
|
|
124
|
+
`;function ao(){const{user:r,isMyself:i,viewUser:s}=ue(),{followed:t}=ht();return e.jsx(m,{children:e.jsx(vt,{teamDid:window?.blocklet?.did||"",user:i?r:s,showInvitees:i,followed:t})})}function lo({tab:r=""}){const{api:i}=Gr(),s=y.useRef(null),t=Dr(),o=r||t.tab,a=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),p=Kr(),l=R(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(n=>({...n,meta:{...n,did:n.did,name:n.name||n.title||"",logo:"logo.png"}}))})),x=async n=>{const{input:f,sessionId:k}=n;try{await i.destroySelf({input:{...f,sessionId:k}})}catch(v){console.error("destroy myself error",v)}};return e.jsx(ct,{mode:"user-center",children:e.jsxs(xt,{ref:s,embed:a==="1",currentTab:o?se(qe,"user",o):"",disableAutoRedirect:o==="settings",children:[o==="notifications"?e.jsx(Gt,{blocklets:[l],context:p}):null,o==="nfts"?e.jsx(Xt,{}):null,o==="settings"?e.jsx(hr,{onDestroySelf:x}):null,o==="did-spaces"?e.jsx(so,{}):null,o==="user-followers"?e.jsx(ao,{}):null,o==="orgs"?e.jsx(mt,{id:t.id||""}):null]})})}lo.propTypes={tab:u.string};export{lo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,al as b,G as U,aY as z,f as W}from"./vendor-mui-core-
|
|
1
|
+
import{j as o,al as b,G as U,aY as z,f as W}from"./vendor-mui-core-D6nniiQs.js";import{r as e,L as H}from"./vendor-react-DX7tU9aY.js";import{b as F,a as L,p as R,B as T}from"./vendor-hooks-Bt9Vv36g.js";import{l as k,V as $,x as G,by as K,F as j,bz as P,m as Y,k as q}from"./vendor-ux-hzekFYg2.js";import{k as Z}from"./fallback-CJFJeDKq.js";import{z as Q}from"./vendor-arcblock-B6JCofz3.js";import{f as J,W as X,G as ee}from"./nav-menu-CefEor9d.js";import{u as D,b as te,s as oe,L as re,N as ie,v as le,z as ne,p as ae,A as se,W as ce}from"./wallet-hidden-topbar-OBN14KiV.js";import{M as de}from"./use-blocklet-logo-IV_8xnB2.js";import{ag as M,F as pe}from"./vendor-utils-BbcnEeJI.js";const me=k(b)`
|
|
2
2
|
padding: 16px 24px;
|
|
3
3
|
border-radius: 8px;
|
|
4
4
|
background-color: ${({theme:t})=>t.palette.background.paper};
|