@blocklet/ui-react 3.0.9 → 3.0.11

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.
Files changed (51) hide show
  1. package/lib/BlockletStudio/index.js +70 -71
  2. package/lib/ComponentInstaller/index.js +85 -88
  3. package/lib/ComponentInstaller/installer-item.js +47 -53
  4. package/lib/ComponentInstaller/use-component-installed.js +32 -38
  5. package/lib/ComponentManager/components/add-component.js +47 -50
  6. package/lib/ComponentManager/components/publish-component.js +30 -31
  7. package/lib/ComponentManager/components/resource-dialog.js +28 -30
  8. package/lib/Dashboard/index.d.ts +1 -1
  9. package/lib/Dashboard/index.js +59 -61
  10. package/lib/Footer/index.js +51 -52
  11. package/lib/Footer/internal-footer.js +43 -47
  12. package/lib/Footer/layout/standard.js +11 -12
  13. package/lib/Footer/links.js +25 -28
  14. package/lib/Footer/social-media.js +17 -17
  15. package/lib/Header/index.js +81 -83
  16. package/lib/Notifications/Snackbar.js +76 -77
  17. package/lib/Notifications/hooks/use-title.js +34 -34
  18. package/lib/Notifications/utils.js +56 -60
  19. package/lib/UserCenter/components/config-inviter.js +17 -18
  20. package/lib/UserCenter/components/danger-zone.js +49 -52
  21. package/lib/UserCenter/components/nft.js +44 -45
  22. package/lib/UserCenter/components/notification.js +92 -99
  23. package/lib/UserCenter/components/passport.js +22 -22
  24. package/lib/UserCenter/components/privacy.js +6 -6
  25. package/lib/UserCenter/components/settings.js +40 -43
  26. package/lib/UserCenter/components/status-dialog/date-picker.js +7 -8
  27. package/lib/UserCenter/components/status-dialog/index.js +112 -114
  28. package/lib/UserCenter/components/status-selector/duration-menu.js +35 -36
  29. package/lib/UserCenter/components/status-selector/index.js +13 -13
  30. package/lib/UserCenter/components/storage/action.js +21 -22
  31. package/lib/UserCenter/components/storage/delete.js +24 -24
  32. package/lib/UserCenter/components/third-party-login/index.js +53 -53
  33. package/lib/UserCenter/components/third-party-login/third-party-item.js +87 -89
  34. package/lib/UserCenter/components/user-center.js +198 -207
  35. package/lib/UserCenter/components/user-info/metadata.js +343 -353
  36. package/lib/UserCenter/components/user-info/switch-role.js +17 -20
  37. package/lib/UserCenter/components/user-info/user-basic-info.js +79 -82
  38. package/lib/UserCenter/components/user-info/user-info.js +40 -40
  39. package/lib/UserCenter/components/user-info/user-status.js +97 -99
  40. package/lib/UserCenter/components/user-info/utils.js +34 -35
  41. package/lib/UserSessions/components/user-session-info.js +25 -28
  42. package/lib/UserSessions/components/user-sessions.js +169 -181
  43. package/lib/blocklets.js +62 -72
  44. package/lib/common/domain-warning.js +31 -31
  45. package/lib/common/header-addons.d.ts +1 -1
  46. package/lib/common/header-addons.js +49 -53
  47. package/lib/common/notification-addon.js +29 -32
  48. package/lib/common/ws.js +17 -18
  49. package/lib/contexts/config-user-space.js +16 -19
  50. package/lib/utils.js +44 -48
  51. package/package.json +11 -11
@@ -1,27 +1,27 @@
1
- import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
- import { Alert as T, Box as w, CircularProgress as j, Typography as S, Stack as F } from "@mui/material";
3
- import { useMemoizedFn as c, useReactive as B, useRequest as E, useCreation as C } from "ahooks";
4
- import { Icon as G } from "@iconify/react";
5
- import L from "@iconify-icons/material-symbols/add-rounded";
6
- import M from "@arcblock/ux/lib/Switch";
7
- import P from "@arcblock/ux/lib/Button";
1
+ import { jsx as o, jsxs as h } from "react/jsx-runtime";
2
+ import { Alert as z, Box as w, CircularProgress as R, Typography as A, Stack as T } from "@mui/material";
3
+ import { useMemoizedFn as c, useReactive as j, useRequest as F, useCreation as v } from "ahooks";
4
+ import { Icon as B } from "@iconify/react";
5
+ import E from "@iconify-icons/material-symbols/add-rounded";
6
+ import G from "@arcblock/ux/lib/Switch";
7
+ import L from "@arcblock/ux/lib/Button";
8
8
  import f from "@arcblock/ux/lib/Toast";
9
- import { getWalletDid as A } from "@arcblock/ux/lib/SessionUser/libs/utils";
10
- import { translate as U } from "@arcblock/ux/lib/Locale/util";
11
- import { useLocaleContext as _ } from "@arcblock/ux/lib/Locale/context";
12
- import $ from "@arcblock/ux/lib/DID";
13
- import { translations as q } from "../libs/locales.js";
14
- import D from "./webhook-item.js";
15
- import { formatAxiosError as I } from "../libs/utils.js";
16
- import { client as y } from "../../libs/client.js";
17
- function g({
18
- title: a = void 0,
19
- description: s = void 0,
9
+ import { getWalletDid as C } from "@arcblock/ux/lib/SessionUser/libs/utils";
10
+ import { translate as M } from "@arcblock/ux/lib/Locale/util";
11
+ import { useLocaleContext as P } from "@arcblock/ux/lib/Locale/context";
12
+ import U from "@arcblock/ux/lib/DID";
13
+ import { translations as _ } from "../libs/locales.js";
14
+ import b from "./webhook-item.js";
15
+ import { formatAxiosError as S } from "../libs/utils.js";
16
+ import { client as g } from "../../libs/client.js";
17
+ function y({
18
+ title: i = void 0,
19
+ description: n = void 0,
20
20
  value: m,
21
- onChange: i,
22
- isMobile: n
21
+ onChange: a,
22
+ isMobile: s
23
23
  }) {
24
- const t = c((l) => {
24
+ const r = c((l) => {
25
25
  l.stopPropagation();
26
26
  });
27
27
  return /* @__PURE__ */ h(
@@ -33,23 +33,23 @@ function g({
33
33
  gap: 1
34
34
  },
35
35
  children: [
36
- /* @__PURE__ */ r(M, { checked: m, size: "small", onChange: i }),
36
+ /* @__PURE__ */ o(G, { checked: m, size: "small", onChange: a }),
37
37
  /* @__PURE__ */ h(
38
- S,
38
+ A,
39
39
  {
40
- onClick: t,
40
+ onClick: r,
41
41
  sx: {
42
42
  color: "text.primary",
43
43
  fontSize: 14,
44
44
  display: "flex",
45
- flexWrap: n ? "wrap" : "nowrap",
45
+ flexWrap: s ? "wrap" : "nowrap",
46
46
  columnGap: 1,
47
47
  flex: 1,
48
- whiteSpace: n ? "normal" : "nowrap"
48
+ whiteSpace: s ? "normal" : "nowrap"
49
49
  },
50
50
  children: [
51
- a,
52
- s
51
+ i,
52
+ n
53
53
  ]
54
54
  }
55
55
  )
@@ -57,60 +57,53 @@ function g({
57
57
  }
58
58
  );
59
59
  }
60
- function ne({ user: a, isMobile: s }) {
61
- var v, b;
62
- const { locale: m } = _(), i = c((e, o = {}) => U(q, e, m, "en", o)), n = B({
60
+ function ie({ user: i, isMobile: n }) {
61
+ const { locale: m } = P(), a = c((e, t = {}) => M(_, e, m, "en", t)), s = j({
63
62
  showAdd: !1
64
- }), t = E(
65
- async () => await y.user.getUserNotificationConfig(),
63
+ }), r = F(
64
+ async () => await g.user.getUserNotificationConfig(),
66
65
  {
67
- refreshDeps: [a],
66
+ refreshDeps: [i],
68
67
  loadingDelay: 300
69
68
  }
70
- ), l = C(() => {
71
- var e;
72
- return {
73
- wallet: !0,
74
- email: !0,
75
- phone: !1,
76
- push: !0,
77
- ...((e = t == null ? void 0 : t.data) == null ? void 0 : e.notifications) || {}
78
- };
79
- }, [(v = t == null ? void 0 : t.data) == null ? void 0 : v.notifications]), p = C(() => {
80
- var e;
81
- return ((e = t == null ? void 0 : t.data) == null ? void 0 : e.webhooks) || [];
82
- }, [(b = t == null ? void 0 : t.data) == null ? void 0 : b.webhooks]), u = c(async (e) => {
69
+ ), l = v(() => ({
70
+ wallet: !0,
71
+ email: !0,
72
+ phone: !1,
73
+ push: !0,
74
+ ...r?.data?.notifications || {}
75
+ }), [r?.data?.notifications]), p = v(() => r?.data?.webhooks || [], [r?.data?.webhooks]), u = c(async (e) => {
83
76
  try {
84
- await y.user.saveUserNotificationConfig(e), f.success(i("saveSuccess")), t.run();
85
- } catch (o) {
86
- f.error(I(o));
77
+ await g.user.saveUserNotificationConfig(e), f.success(a("saveSuccess")), r.run();
78
+ } catch (t) {
79
+ f.error(S(t));
87
80
  }
88
- }), x = c(async (e, o) => {
81
+ }), x = c(async (e, t) => {
89
82
  await u({
90
83
  notifications: {
91
- [e]: o
84
+ [e]: t
92
85
  }
93
86
  });
94
87
  }), k = async (e) => {
95
88
  try {
96
- await y.user.testNotificationWebhook(e), f.success(i("webhookTested"));
97
- } catch (o) {
98
- f.error(I(o));
89
+ await g.user.testNotificationWebhook(e), f.success(a("webhookTested"));
90
+ } catch (t) {
91
+ f.error(S(t));
99
92
  }
100
- }, W = c(async (e) => {
93
+ }, D = c(async (e) => {
101
94
  await u({
102
- webhooks: p.filter((o, d) => d !== e)
95
+ webhooks: p.filter((t, d) => d !== e)
103
96
  });
104
- }), N = c(async (e, o) => {
97
+ }), I = c(async (e, t) => {
105
98
  await u({
106
- webhooks: p.map((d, R) => R === e ? o : d)
99
+ webhooks: p.map((d, N) => N === e ? t : d)
107
100
  });
108
- }), z = c(async (e) => {
101
+ }), W = c(async (e) => {
109
102
  await u({
110
103
  webhooks: [...p, e]
111
- }), n.showAdd = !1;
104
+ }), s.showAdd = !1;
112
105
  });
113
- return t.error ? /* @__PURE__ */ r(T, { severity: "error", children: t.error.message }) : t.loading || !t.data ? /* @__PURE__ */ r(
106
+ return r.error ? /* @__PURE__ */ o(z, { severity: "error", children: r.error.message }) : r.loading || !r.data ? /* @__PURE__ */ o(
114
107
  w,
115
108
  {
116
109
  sx: {
@@ -119,7 +112,7 @@ function ne({ user: a, isMobile: s }) {
119
112
  alignItems: "center",
120
113
  height: "100px"
121
114
  },
122
- children: /* @__PURE__ */ r(j, {})
115
+ children: /* @__PURE__ */ o(R, {})
123
116
  }
124
117
  ) : /* @__PURE__ */ h(w, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
125
118
  /* @__PURE__ */ h(
@@ -158,54 +151,54 @@ function ne({ user: a, isMobile: s }) {
158
151
  }
159
152
  },
160
153
  children: [
161
- /* @__PURE__ */ r(
162
- g,
154
+ /* @__PURE__ */ o(
155
+ y,
163
156
  {
164
157
  value: l.wallet,
165
- isMobile: s,
166
- title: i("walletNotification"),
158
+ isMobile: n,
159
+ title: a("walletNotification"),
167
160
  onChange: (e) => x("wallet", e.target.checked),
168
- description: A(a) && /* @__PURE__ */ r(
169
- $,
161
+ description: C(i) && /* @__PURE__ */ o(
162
+ U,
170
163
  {
171
- did: A(a),
164
+ did: C(i),
172
165
  showQrcode: !1,
173
- showAvatar: !s,
166
+ showAvatar: !n,
174
167
  copyable: !0,
175
168
  compact: !0,
176
169
  responsive: !0,
177
170
  locale: m,
178
- startChars: s ? 2 : 6
171
+ startChars: n ? 2 : 6
179
172
  }
180
173
  )
181
174
  }
182
175
  ),
183
- /* @__PURE__ */ r(
184
- g,
176
+ /* @__PURE__ */ o(
177
+ y,
185
178
  {
186
179
  value: l.email,
187
- isMobile: s,
180
+ isMobile: n,
188
181
  onChange: (e) => x("email", e.target.checked),
189
- title: i("emailNotification"),
190
- description: (a == null ? void 0 : a.email) && /* @__PURE__ */ r(
191
- S,
182
+ title: a("emailNotification"),
183
+ description: i?.email && /* @__PURE__ */ o(
184
+ A,
192
185
  {
193
186
  component: "span",
194
187
  sx: {
195
188
  color: "text.secondary",
196
189
  fontSize: 13
197
190
  },
198
- children: a == null ? void 0 : a.email
191
+ children: i?.email
199
192
  }
200
193
  )
201
194
  }
202
195
  ),
203
- /* @__PURE__ */ r(
204
- g,
196
+ /* @__PURE__ */ o(
197
+ y,
205
198
  {
206
- isMobile: s,
199
+ isMobile: n,
207
200
  value: l.push,
208
- title: i("pushNotification"),
201
+ title: a("pushNotification"),
209
202
  onChange: (e) => x("push", e.target.checked)
210
203
  }
211
204
  )
@@ -213,7 +206,7 @@ function ne({ user: a, isMobile: s }) {
213
206
  }
214
207
  ),
215
208
  /* @__PURE__ */ h(
216
- F,
209
+ T,
217
210
  {
218
211
  spacing: 1.5,
219
212
  useFlexGap: !0,
@@ -222,32 +215,32 @@ function ne({ user: a, isMobile: s }) {
222
215
  alignItems: "start"
223
216
  },
224
217
  children: [
225
- p.map((e, o) => /* @__PURE__ */ r(
226
- D,
218
+ p.map((e, t) => /* @__PURE__ */ o(
219
+ b,
227
220
  {
228
221
  onTest: k,
229
- onDelete: () => W(o),
230
- onSave: (...d) => N(o, ...d),
222
+ onDelete: () => D(t),
223
+ onSave: (...d) => I(t, ...d),
231
224
  type: e.type,
232
225
  url: e.url,
233
226
  edit: !1
234
227
  },
235
- `${o}_${e.url}`
228
+ `${t}_${e.url}`
236
229
  )),
237
- n.showAdd && /* @__PURE__ */ r(
238
- D,
230
+ s.showAdd && /* @__PURE__ */ o(
231
+ b,
239
232
  {
240
233
  onTest: k,
241
234
  onCancel: () => {
242
- n.showAdd = !1;
235
+ s.showAdd = !1;
243
236
  },
244
- onSave: (...e) => z(...e),
237
+ onSave: (...e) => W(...e),
245
238
  edit: !0
246
239
  },
247
240
  "add"
248
241
  ),
249
- /* @__PURE__ */ r(
250
- P,
242
+ /* @__PURE__ */ o(
243
+ L,
251
244
  {
252
245
  variant: "outlined",
253
246
  size: "small",
@@ -260,11 +253,11 @@ function ne({ user: a, isMobile: s }) {
260
253
  py: 0.5,
261
254
  borderRadius: 1
262
255
  },
263
- startIcon: /* @__PURE__ */ r(G, { icon: L }),
256
+ startIcon: /* @__PURE__ */ o(B, { icon: E }),
264
257
  onClick: () => {
265
- n.showAdd = !0;
258
+ s.showAdd = !0;
266
259
  },
267
- children: i("addWebhook")
260
+ children: a("addWebhook")
268
261
  }
269
262
  )
270
263
  ]
@@ -273,5 +266,5 @@ function ne({ user: a, isMobile: s }) {
273
266
  ] });
274
267
  }
275
268
  export {
276
- ne as default
269
+ ie as default
277
270
  };
@@ -1,9 +1,9 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { Box as s } from "@mui/material";
3
- import y from "@arcblock/ux/lib/Empty";
4
- import { useTheme as g } from "@arcblock/ux/lib/Theme";
5
- import h from "@arcblock/ux/lib/Passport";
6
- import { PASSPORT_STATUS as u } from "@arcblock/ux/lib/Util/constant";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { Box as m } from "@mui/material";
3
+ import x from "@arcblock/ux/lib/Empty";
4
+ import { useTheme as y } from "@arcblock/ux/lib/Theme";
5
+ import g from "@arcblock/ux/lib/Passport";
6
+ import { PASSPORT_STATUS as h } from "@arcblock/ux/lib/Util/constant";
7
7
  import { useMemoizedFn as C, useCreation as l } from "ahooks";
8
8
  import f from "lodash/uniqBy";
9
9
  import { translate as P } from "@arcblock/ux/lib/Locale/util";
@@ -11,23 +11,23 @@ import { useLocaleContext as k } from "@arcblock/ux/lib/Locale/context";
11
11
  import { translations as v } from "../libs/locales.js";
12
12
  import { createPassportSvg as S } from "../libs/utils.js";
13
13
  function D({ user: o, ...a }) {
14
- const { locale: c } = k(), m = C((t, r = {}) => P(v, t, c, "en", r)), d = g(), e = l(() => {
15
- const t = ((o == null ? void 0 : o.passports) || []).map((r) => ({
16
- ...r,
17
- revoked: r.status === u.REVOKED
14
+ const { locale: c } = k(), n = C((r, t = {}) => P(v, r, c, "en", t)), d = y(), e = l(() => {
15
+ const r = (o?.passports || []).map((t) => ({
16
+ ...t,
17
+ revoked: t.status === h.REVOKED
18
18
  }));
19
- return t.sort((r, x) => r.revoked === x.revoked ? 0 : r.revoked ? 1 : -1), f(
20
- t.filter((r) => !r.display),
19
+ return r.sort((t, u) => t.revoked === u.revoked ? 0 : t.revoked ? 1 : -1), f(
20
+ r.filter((t) => !t.display),
21
21
  "role"
22
22
  ).concat(
23
23
  f(
24
- t.filter((r) => r.display),
24
+ r.filter((t) => t.display),
25
25
  "display.content"
26
26
  )
27
27
  );
28
- }, [o == null ? void 0 : o.passports]), p = l(() => e == null ? void 0 : e.find((t) => t.name === o.role), [e, o == null ? void 0 : o.role]), n = d.palette.primary.main;
29
- return e.length === 0 ? /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(y, { children: m("noPassport") }) }) : /* @__PURE__ */ i(
30
- s,
28
+ }, [o?.passports]), p = l(() => e?.find((r) => r.name === o.role), [e, o?.role]), i = d.palette.primary.main;
29
+ return e.length === 0 ? /* @__PURE__ */ s(m, { children: /* @__PURE__ */ s(x, { children: n("noPassport") }) }) : /* @__PURE__ */ s(
30
+ m,
31
31
  {
32
32
  ...a,
33
33
  sx: {
@@ -42,14 +42,14 @@ function D({ user: o, ...a }) {
42
42
  gap: 2.5,
43
43
  ...a.sx
44
44
  },
45
- children: e.map((t) => /* @__PURE__ */ i(
46
- h,
45
+ children: e.map((r) => /* @__PURE__ */ s(
46
+ g,
47
47
  {
48
- passport: t,
48
+ passport: r,
49
49
  user: o,
50
50
  color: window.blocklet.passportColor,
51
51
  createPassportSvg: S,
52
- title: p && p.role === t.role ? m("currentPassport") : "",
52
+ title: p && p.role === r.role ? n("currentPassport") : "",
53
53
  sx: {
54
54
  flexDirection: "column",
55
55
  alignItems: "center",
@@ -62,14 +62,14 @@ function D({ user: o, ...a }) {
62
62
  display: "flex",
63
63
  justifyContent: "center",
64
64
  backgroundColor: "grey.50",
65
- boxShadow: p && p.role === t.role ? `0px 2px 4px 0px ${n}, 0px 1px 2px -1px ${n}, 0px 0px 0px 1px ${n} !important` : "unset"
65
+ boxShadow: p && p.role === r.role ? `0px 2px 4px 0px ${i}, 0px 1px 2px -1px ${i}, 0px 0px 0px 1px ${i} !important` : "unset"
66
66
  },
67
67
  ".passport-item__body": {
68
68
  marginLeft: "0 !important"
69
69
  }
70
70
  }
71
71
  },
72
- t.id
72
+ r.id
73
73
  ))
74
74
  }
75
75
  );
@@ -2,10 +2,10 @@ import { jsx as a } from "react/jsx-runtime";
2
2
  import { Box as f, Typography as x } from "@mui/material";
3
3
  import d from "@arcblock/ux/lib/Switch";
4
4
  import { useState as w } from "react";
5
- import { useMemoizedFn as c } from "ahooks";
5
+ import { useMemoizedFn as l } from "ahooks";
6
6
  import { translate as y } from "@arcblock/ux/lib/Locale/util";
7
7
  import { useLocaleContext as v } from "@arcblock/ux/lib/Locale/context";
8
- import l from "@arcblock/ux/lib/Toast";
8
+ import c from "@arcblock/ux/lib/Toast";
9
9
  import { translations as S } from "../libs/locales.js";
10
10
  import { client as g } from "../../libs/client.js";
11
11
  import { formatAxiosError as b } from "../libs/utils.js";
@@ -13,7 +13,7 @@ function A({
13
13
  configList: n,
14
14
  onSave: m
15
15
  }) {
16
- const [i, u] = w(n), { locale: p } = v(), s = c((r, t = {}) => y(S, r, p, "en", t)), h = c(async (r, t) => {
16
+ const [i, u] = w(n), { locale: p } = v(), s = l((r, t = {}) => y(S, r, p, "en", t)), h = l(async (r, t) => {
17
17
  try {
18
18
  const e = await g.user.saveUserPrivacyConfig({
19
19
  [r]: !t
@@ -21,11 +21,11 @@ function A({
21
21
  u(
22
22
  i.map((o) => ({
23
23
  ...o,
24
- value: (e == null ? void 0 : e[o.key]) ?? o.value
24
+ value: e?.[o.key] ?? o.value
25
25
  }))
26
- ), l.success(s("saveSuccess")), m("privacy");
26
+ ), c.success(s("saveSuccess")), m("privacy");
27
27
  } catch (e) {
28
- l.error(b(e));
28
+ c.error(b(e));
29
29
  }
30
30
  });
31
31
  return /* @__PURE__ */ a(
@@ -1,9 +1,9 @@
1
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
- import { useEffect as v } from "react";
3
- import { Box as l, Typography as x } from "@mui/material";
4
- import { useMemoizedFn as b, useCreation as f } from "ahooks";
5
- import { translate as y } from "@arcblock/ux/lib/Locale/util";
6
- import { useLocaleContext as g } from "@arcblock/ux/lib/Locale/context";
1
+ import { jsx as o, jsxs as g } from "react/jsx-runtime";
2
+ import { useEffect as h } from "react";
3
+ import { Box as i, Typography as v } from "@mui/material";
4
+ import { useMemoizedFn as x, useCreation as f } from "ahooks";
5
+ import { translate as b } from "@arcblock/ux/lib/Locale/util";
6
+ import { useLocaleContext as y } from "@arcblock/ux/lib/Locale/context";
7
7
  import { mergeSx as C } from "@arcblock/ux/lib/Util/style";
8
8
  import S from "@arcblock/react-hooks/lib/useBrowser";
9
9
  import { translations as w } from "../libs/locales.js";
@@ -15,71 +15,68 @@ import M from "./config-profile.js";
15
15
  import U from "./danger-zone.js";
16
16
  import { client as W } from "../../libs/client.js";
17
17
  function O({
18
- user: i,
19
- settings: n,
20
- onSave: m,
21
- isMobile: s,
22
- ...a
18
+ user: n,
19
+ settings: s,
20
+ onSave: a,
21
+ isMobile: l,
22
+ ...m
23
23
  }) {
24
- const { locale: p } = g(), d = S().arcSphere, t = b((o, r = {}) => y(w, o, p, "en", r)), c = f(() => ((n == null ? void 0 : n.userCenterTabs) || []).map((r) => ({
24
+ const { locale: p } = y(), d = S().arcSphere, t = x((e, r = {}) => b(w, e, p, "en", r)), c = f(() => (s?.userCenterTabs || []).map((r) => ({
25
25
  key: r.value,
26
26
  name: r.label,
27
27
  value: r.protected,
28
28
  isPrivate: r.isPrivate
29
- })), [n == null ? void 0 : n.userCenterTabs]), u = f(() => [
29
+ })), [s?.userCenterTabs]), u = f(() => [
30
30
  d ? void 0 : {
31
31
  label: t("commonSetting.title"),
32
32
  value: "common",
33
- content: /* @__PURE__ */ e(M, { user: i, onSave: m })
33
+ content: /* @__PURE__ */ o(M, { user: n, onSave: a })
34
34
  },
35
35
  {
36
36
  label: t("notificationManagement"),
37
37
  value: "notification",
38
- content: /* @__PURE__ */ e(L, { user: i, isMobile: s })
38
+ content: /* @__PURE__ */ o(L, { user: n, isMobile: l })
39
39
  },
40
40
  {
41
41
  label: t("thirdPartyLogin.title"),
42
42
  value: "thirdPartyLogin",
43
- content: /* @__PURE__ */ e(B, { user: i })
43
+ content: /* @__PURE__ */ o(B, { user: n })
44
44
  },
45
45
  {
46
46
  label: t("privacyManagement"),
47
47
  value: "privacy",
48
- content: /* @__PURE__ */ e(P, { configList: c, onSave: m })
48
+ content: /* @__PURE__ */ o(P, { configList: c, onSave: a })
49
49
  },
50
50
  {
51
51
  label: t("sessionManagement"),
52
52
  value: "session",
53
- content: /* @__PURE__ */ e(
53
+ content: /* @__PURE__ */ o(
54
54
  T,
55
55
  {
56
- user: i,
56
+ user: n,
57
57
  showUser: !1,
58
- getUserSessions: (o) => W.userSession.getMyLoginSessions({}, o)
58
+ getUserSessions: (e) => W.userSession.getMyLoginSessions({}, e)
59
59
  }
60
60
  )
61
61
  },
62
62
  {
63
63
  label: t("dangerZone.title"),
64
64
  value: "dangerZone",
65
- content: /* @__PURE__ */ e(U, {}),
65
+ content: /* @__PURE__ */ o(U, {}),
66
66
  sx: {
67
67
  borderColor: "error.main"
68
68
  }
69
69
  }
70
- ].filter(Boolean), [i, c, s]);
71
- return v(() => {
72
- const o = window.location.hash.slice(1);
73
- if (o) {
74
- const r = document.getElementById(o);
75
- r == null || r.scrollIntoView({ behavior: "smooth" });
76
- }
77
- }, []), /* @__PURE__ */ e(
78
- l,
70
+ ].filter(Boolean), [n, c, l]);
71
+ return h(() => {
72
+ const e = window.location.hash.slice(1);
73
+ e && document.getElementById(e)?.scrollIntoView({ behavior: "smooth" });
74
+ }, []), /* @__PURE__ */ o(
75
+ i,
79
76
  {
80
- ...a,
77
+ ...m,
81
78
  sx: {
82
- ...a == null ? void 0 : a.sx,
79
+ ...m?.sx,
83
80
  display: "flex",
84
81
  flexDirection: "column",
85
82
  gap: 2.5,
@@ -88,10 +85,10 @@ function O({
88
85
  },
89
86
  maxWidth: "100%"
90
87
  },
91
- children: u.map((o) => o ? /* @__PURE__ */ h(
92
- l,
88
+ children: u.map((e) => e ? /* @__PURE__ */ g(
89
+ i,
93
90
  {
94
- id: o.value,
91
+ id: e.value,
95
92
  sx: C(
96
93
  {
97
94
  border: "1px solid",
@@ -102,31 +99,31 @@ function O({
102
99
  mb: 5
103
100
  }
104
101
  },
105
- o.sx
102
+ e.sx
106
103
  ),
107
104
  children: [
108
- /* @__PURE__ */ e(
109
- x,
105
+ /* @__PURE__ */ o(
106
+ v,
110
107
  {
111
108
  sx: {
112
109
  color: "text.primary",
113
110
  fontWeight: 600
114
111
  },
115
- children: o.label
112
+ children: e.label
116
113
  }
117
114
  ),
118
- /* @__PURE__ */ e(
119
- l,
115
+ /* @__PURE__ */ o(
116
+ i,
120
117
  {
121
118
  sx: {
122
119
  mt: 2.5
123
120
  },
124
- children: o.content
121
+ children: e.content
125
122
  }
126
123
  )
127
124
  ]
128
125
  },
129
- o.value
126
+ e.value
130
127
  ) : null)
131
128
  }
132
129
  );
@@ -4,7 +4,7 @@ import { FormControl as f, TextField as h, FormHelperText as C } from "@mui/mate
4
4
  import e from "dayjs";
5
5
  import { useCreation as Y } from "ahooks";
6
6
  function T({
7
- value: o,
7
+ value: t,
8
8
  onChange: a,
9
9
  error: n = void 0,
10
10
  helperText: i = void 0,
@@ -12,9 +12,9 @@ function T({
12
12
  timezone: r = void 0
13
13
  }) {
14
14
  const l = p(null), s = e().format("YYYY-MM-DDTHH:mm"), c = Y(() => {
15
- let t = e();
16
- return o && (t = r ? e(o).tz(r) : e(o)), t.format("YYYY-MM-DD HH:mm");
17
- }, [o, r]);
15
+ let o = e();
16
+ return t && (o = r ? e(t).tz(r) : e(t)), o.format("YYYY-MM-DD HH:mm");
17
+ }, [t, r]);
18
18
  return /* @__PURE__ */ d(f, { fullWidth: !0, error: n, children: [
19
19
  /* @__PURE__ */ u(
20
20
  h,
@@ -22,14 +22,13 @@ function T({
22
22
  inputRef: l,
23
23
  type: "datetime-local",
24
24
  value: c,
25
- onChange: (t) => {
26
- a(new Date(t.target.value));
25
+ onChange: (o) => {
26
+ a(new Date(o.target.value));
27
27
  },
28
28
  label: m,
29
29
  error: n,
30
30
  onClick: () => {
31
- var t;
32
- (t = l.current) == null || t.showPicker();
31
+ l.current?.showPicker();
33
32
  },
34
33
  sx: {
35
34
  "& .MuiInputBase-root": {