@24city/web-console 0.1.2 → 0.2.0

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 (53) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/GUIDELINES.md +223 -0
  3. package/README.md +70 -11
  4. package/dist/account/index.js +2 -2
  5. package/dist/chunks/console-layout-DH-aROYp.js +209 -0
  6. package/dist/chunks/page-YBG0dEN1.js +111 -0
  7. package/dist/chunks/scale-smFifpMm.js +26 -0
  8. package/dist/chunks/{stale-build-DUKkQHuu.js → stale-build-DG-Tb2RA.js} +24 -20
  9. package/dist/chunks/status-tag-BrLUhH6Z.js +87 -0
  10. package/dist/chunks/text-link-BAKoHe5o.js +64 -0
  11. package/dist/chunks/unsupported-browser-Dwq1mNRy.js +48 -0
  12. package/dist/chunks/upgrade-modal-DgChxbLm.js +667 -0
  13. package/dist/chunks/{wallet-badge-CnyMLpUO.js → wallet-badge-dVrO6py9.js} +118 -118
  14. package/dist/chunks/waterfall-CQG8aVdx.js +613 -0
  15. package/dist/data/index.d.ts +2 -0
  16. package/dist/data/index.js +6 -0
  17. package/dist/data/metric-card.d.ts +41 -0
  18. package/dist/data/status-tag.d.ts +18 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +160 -120
  21. package/dist/layout/index.js +1 -1
  22. package/dist/list/choice-cards.d.ts +29 -0
  23. package/dist/list/content-square.d.ts +50 -0
  24. package/dist/list/filter-dropdown.d.ts +43 -0
  25. package/dist/list/filter-panel.d.ts +94 -0
  26. package/dist/list/index.d.ts +7 -0
  27. package/dist/list/index.js +27 -0
  28. package/dist/list/list-toolbar.d.ts +56 -0
  29. package/dist/list/waterfall-layout.d.ts +11 -0
  30. package/dist/list/waterfall.d.ts +13 -0
  31. package/dist/page/index.d.ts +2 -0
  32. package/dist/page/index.js +19 -15
  33. package/dist/page/page.d.ts +21 -2
  34. package/dist/page/select-label.d.ts +11 -0
  35. package/dist/page/unsupported-browser.d.ts +2 -0
  36. package/dist/runtime/browser-support.d.ts +6 -0
  37. package/dist/runtime/index.d.ts +1 -0
  38. package/dist/runtime/index.js +38 -37
  39. package/dist/runtime/providers.d.ts +1 -1
  40. package/dist/styles.css +1993 -576
  41. package/dist/testing/guard.d.ts +25 -0
  42. package/dist/testing/guard.js +95 -38
  43. package/dist/theme/index.d.ts +1 -0
  44. package/dist/theme/index.js +29 -25
  45. package/dist/theme/scale.d.ts +34 -0
  46. package/dist/vite.d.ts +24 -0
  47. package/dist/vite.js +24 -0
  48. package/package.json +18 -2
  49. package/dist/chunks/console-layout-BibioK5M.js +0 -198
  50. package/dist/chunks/error-boundary-D3qiD7ov.js +0 -35
  51. package/dist/chunks/page-BaitnD--.js +0 -89
  52. package/dist/chunks/text-link-FTsBp_QU.js +0 -54
  53. package/dist/chunks/upgrade-modal-_psMAWRK.js +0 -667
@@ -1,13 +1,13 @@
1
1
  import { jsx as s, jsxs as m, Fragment as me } from "react/jsx-runtime";
2
2
  import { useState as B, useRef as pe, useCallback as Se, useEffect as Te } from "react";
3
- import { Skeleton as re, Button as b, Toast as _e, Modal as Ae, Avatar as Pe, Popover as xe, Tooltip as Le } from "@douyinfe/semi-ui";
3
+ import { Skeleton as ce, Button as b, Toast as _e, Modal as Ae, Avatar as xe, Popover as Pe, Tooltip as Le } from "@douyinfe/semi-ui";
4
4
  import { IconUser as D, IconCrown as Ee, IconGift as Ie, IconChevronRight as V, IconUserGroup as ie, IconChevronUp as $e, IconChevronDown as ze, IconTick as Oe } from "@douyinfe/semi-icons";
5
5
  import { useNavigate as J } from "react-router";
6
- import { a as fe, b as g } from "./context-CaVim6ZO.js";
6
+ import { a as ye, b as g } from "./context-CaVim6ZO.js";
7
7
  import { q as v, k as Be, a as De, t as he, w as Me, l as Fe, u as F, g as Re, f as le } from "./logout-signal-CiD_zY5M.js";
8
- import { useQueryClient as ye, useQuery as P } from "@tanstack/react-query";
8
+ import { useQueryClient as fe, useQuery as x } from "@tanstack/react-query";
9
9
  import { notifyCustomerSessionChanged as be } from "@24city/web-runtime/session-sync";
10
- const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_27", We = "_card_am2co_74", Ye = "_identity_am2co_84", Ge = "_who_am2co_92", je = "_nameRow_am2co_101", Qe = "_name_am2co_101", Ve = "_planChip_am2co_118", He = "_diamond_am2co_148", Xe = "_spaceToggle_am2co_156", Je = "_spaceStatic_am2co_157", Ze = "_spaceSwitchText_am2co_178", et = "_spaceName_am2co_184", tt = "_spaceType_am2co_190", nt = "_spaceList_am2co_200", at = "_spaceOption_am2co_209", st = "_spaceCheck_am2co_231", ot = "_plan_am2co_118", ct = "_links_am2co_243", rt = "_link_am2co_243", it = "_linkIcon_am2co_281", lt = "_linkLabel_am2co_292", dt = "_linkArrow_am2co_297", ut = "_divider_am2co_303", mt = "_logout_am2co_309", l = {
10
+ const Ue = "_trigger_mz24a_6", Ke = "_avatarWrap_mz24a_27", qe = "_avatar_mz24a_27", We = "_card_mz24a_80", Ye = "_identity_mz24a_90", Ge = "_who_mz24a_98", je = "_nameRow_mz24a_107", Qe = "_name_mz24a_107", Ve = "_planChip_mz24a_124", He = "_diamond_mz24a_154", Xe = "_spaceToggle_mz24a_162", Je = "_spaceStatic_mz24a_163", Ze = "_spaceSwitchText_mz24a_184", et = "_spaceName_mz24a_190", tt = "_spaceType_mz24a_196", nt = "_spaceList_mz24a_206", at = "_spaceOption_mz24a_215", st = "_spaceCheck_mz24a_237", ot = "_plan_mz24a_124", rt = "_links_mz24a_249", ct = "_link_mz24a_249", it = "_linkIcon_mz24a_287", lt = "_linkLabel_mz24a_298", dt = "_linkArrow_mz24a_303", ut = "_divider_mz24a_309", mt = "_logout_mz24a_315", l = {
11
11
  trigger: Ue,
12
12
  avatarWrap: Ke,
13
13
  avatar: qe,
@@ -27,39 +27,39 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
27
27
  spaceOption: at,
28
28
  spaceCheck: st,
29
29
  plan: ot,
30
- links: ct,
31
- link: rt,
30
+ links: rt,
31
+ link: ct,
32
32
  linkIcon: it,
33
33
  linkLabel: lt,
34
34
  linkArrow: dt,
35
35
  divider: ut,
36
36
  logout: mt
37
- }, pt = ["profile", "subscription", "points"], _t = (e) => pt.includes(e), N = (e, t) => `${e}/account/${t}`, Mn = (e, t) => t === `${e}/account` || t.startsWith(`${e}/account/`), O = (e) => `account-${e}`, x = {
37
+ }, pt = ["profile", "subscription", "points"], _t = (e) => pt.includes(e), w = (e, t) => `${e}/account/${t}`, Mn = (e, t) => t === `${e}/account` || t.startsWith(`${e}/account/`), O = (e) => `account-${e}`, P = {
38
38
  profile: O("profile"),
39
39
  subscription: O("subscription"),
40
40
  points: O("points")
41
- }, ft = /^[a-z][a-z0-9-]{0,31}$/, ht = (e) => {
41
+ }, yt = /^[a-z][a-z0-9-]{0,31}$/, ht = (e) => {
42
42
  const t = e.accountSections ?? [], n = /* @__PURE__ */ new Set();
43
43
  for (const a of t) {
44
- if (!ft.test(a.key))
44
+ if (!yt.test(a.key))
45
45
  throw new Error(`个人中心分区 key 不合法:${a.key}(小写字母开头,只含小写字母、数字和连字符)`);
46
46
  if (_t(a.key)) throw new Error(`个人中心分区 key 与内置分区重名:${a.key}`);
47
47
  if (n.has(a.key)) throw new Error(`个人中心分区 key 重复:${a.key}`);
48
48
  n.add(a.key);
49
49
  }
50
50
  return t;
51
- }, yt = (e, t = []) => ({
51
+ }, ft = (e, t = []) => ({
52
52
  key: "personal",
53
53
  label: "个人中心",
54
54
  items: [
55
- { key: x.profile, label: "账号与安全", to: N(e, "profile"), icon: D },
56
- { key: x.subscription, label: "订阅与套餐", to: N(e, "subscription"), icon: Ee },
57
- { key: x.points, label: "积分与明细", to: N(e, "points"), icon: Ie },
55
+ { key: P.profile, label: "账号与安全", to: w(e, "profile"), icon: D },
56
+ { key: P.subscription, label: "订阅与套餐", to: w(e, "subscription"), icon: Ee },
57
+ { key: P.points, label: "积分与明细", to: w(e, "points"), icon: Ie },
58
58
  ...t.map(
59
59
  (n) => ({
60
60
  key: O(n.key),
61
61
  label: n.label,
62
- to: N(e, n.key),
62
+ to: w(e, n.key),
63
63
  icon: n.icon
64
64
  })
65
65
  )
@@ -76,23 +76,23 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
76
76
  return new Set(
77
77
  [...t].filter((n) => e.every((a) => a.benefits.some((o) => o.key === n && o.limit === null)))
78
78
  );
79
- }, wt = (e, t = [], n = {}) => {
79
+ }, Nt = (e, t = [], n = {}) => {
80
80
  var u;
81
- const a = n.benefitCopy ?? [], o = kt(t), c = [];
82
- for (const r of [...e.benefits, ...t.flatMap((p) => p.benefits)])
83
- !c.includes(r.key) && !o.has(r.key) && c.push(r.key);
81
+ const a = n.benefitCopy ?? [], o = kt(t), r = [];
82
+ for (const c of [...e.benefits, ...t.flatMap((p) => p.benefits)])
83
+ !r.includes(c.key) && !o.has(c.key) && r.push(c.key);
84
84
  const d = [];
85
- for (const r of [...c].sort((p, _) => de(a, p) - de(a, _) || c.indexOf(p) - c.indexOf(_))) {
86
- const p = e.benefits.find((h) => h.key === r);
85
+ for (const c of [...r].sort((p, _) => de(a, p) - de(a, _) || r.indexOf(p) - r.indexOf(_))) {
86
+ const p = e.benefits.find((h) => h.key === c);
87
87
  if (p) {
88
88
  d.push({ text: gt(a, p), included: !0 });
89
89
  continue;
90
90
  }
91
- const _ = (u = ge(a, r)) == null ? void 0 : u.off;
91
+ const _ = (u = ge(a, c)) == null ? void 0 : u.off;
92
92
  _ && d.push({ text: _, included: !1 });
93
93
  }
94
94
  return d;
95
- }, H = (e) => e.planName || e.planCode, Nt = (e) => e.isDefault || !e.currentPeriodEnd ? "长期有效" : `有效期至 ${Be(e.currentPeriodEnd)}`, vt = 1440 * 60 * 1e3, Ct = (e, t = Date.now()) => {
95
+ }, H = (e) => e.planName || e.planCode, wt = (e) => e.isDefault || !e.currentPeriodEnd ? "长期有效" : `有效期至 ${Be(e.currentPeriodEnd)}`, vt = 1440 * 60 * 1e3, Ct = (e, t = Date.now()) => {
96
96
  if (e.isDefault || !e.currentPeriodEnd) return null;
97
97
  const n = Date.parse(e.currentPeriodEnd);
98
98
  return Number.isFinite(n) ? Math.max(0, Math.ceil((n - t) / vt)) : null;
@@ -103,26 +103,26 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
103
103
  if (typeof e != "object" || e === null) return;
104
104
  const t = e.focusPlan;
105
105
  return typeof t == "string" && t ? t : void 0;
106
- }, Pt = (e) => `${At(e)}${Tt[e.billingPeriod]}`, xt = (e) => {
106
+ }, xt = (e) => `${At(e)}${Tt[e.billingPeriod]}`, Pt = (e) => {
107
107
  const t = e.prices.filter((o) => o.amountCents > 0), n = t.filter((o) => o.billingPeriod === "month");
108
- return (n.length ? n : t).reduce((o, c) => !o || c.amountCents < o.amountCents ? c : o, null);
108
+ return (n.length ? n : t).reduce((o, r) => !o || r.amountCents < o.amountCents ? r : o, null);
109
109
  }, Lt = (e, t, n) => {
110
110
  const o = (e ?? []).filter(
111
- (c) => c.spaceType === t && !c.isDefault && (n === null || c.tier > n)
112
- ).map((c) => ({ plan: c, price: xt(c) }));
111
+ (r) => r.spaceType === t && !r.isDefault && (n === null || r.tier > n)
112
+ ).map((r) => ({ plan: r, price: Pt(r) }));
113
113
  return o.sort(
114
- (c, d) => {
115
- var u, r;
116
- return c.plan.tier - d.plan.tier || (((u = c.price) == null ? void 0 : u.amountCents) ?? Number.MAX_SAFE_INTEGER) - (((r = d.price) == null ? void 0 : r.amountCents) ?? Number.MAX_SAFE_INTEGER);
114
+ (r, d) => {
115
+ var u, c;
116
+ return r.plan.tier - d.plan.tier || (((u = r.price) == null ? void 0 : u.amountCents) ?? Number.MAX_SAFE_INTEGER) - (((c = d.price) == null ? void 0 : c.amountCents) ?? Number.MAX_SAFE_INTEGER);
117
117
  }
118
118
  ), o[0] ?? null;
119
119
  }, Wn = (e) => e == null ? void 0 : e.filter((t) => t.spaceType === "team" && !t.isDefault).sort((t, n) => t.tier - n.tier)[0], Et = (e, t) => e == null ? void 0 : e.find((n) => n.code === t.planCode), It = (e, t = [], n = {}) => {
120
120
  if (!e) return ["积分按月发放", "24.city 全产品通用"];
121
121
  const a = [];
122
122
  e.monthlyPoints > 0 && a.push(`每月 ${v(e.monthlyPoints)} 积分`);
123
- for (const o of wt(e, t, n).filter((c) => c.included).slice(0, 2)) a.push(o.text);
123
+ for (const o of Nt(e, t, n).filter((r) => r.included).slice(0, 2)) a.push(o.text);
124
124
  return a.length < 2 && a.push("24.city 全产品通用"), a;
125
- }, $t = "_promo_10uzf_6", zt = "_member_10uzf_7", Ot = "_plain_10uzf_8", Bt = "_promoArt_10uzf_28", Dt = "_promoBody_10uzf_38", Mt = "_promoTitle_10uzf_44", Ft = "_promoText_10uzf_55", Rt = "_cta_10uzf_63", Ut = "_ctaButton_10uzf_69", Kt = "_ctaTag_10uzf_89", qt = "_ownerOnly_10uzf_106", Wt = "_memberArt_10uzf_122", Yt = "_memberBody_10uzf_132", Gt = "_memberEyebrow_10uzf_139", jt = "_memberTitle_10uzf_145", Qt = "_memberMeta_10uzf_159", Vt = "_memberCta_10uzf_166", Ht = "_plainBody_10uzf_200", Xt = "_plainText_10uzf_207", Jt = "_retry_10uzf_212", Zt = "_loading_10uzf_216", en = "_assets_10uzf_224", tn = "_asset_10uzf_224", nn = "_coin_10uzf_279", an = "_assetLabel_10uzf_287", sn = "_assetValue_10uzf_291", on = "_assetArrow_10uzf_299", cn = "_assetDivider_10uzf_312", i = {
125
+ }, $t = "_promo_62y38_6", zt = "_member_62y38_7", Ot = "_plain_62y38_8", Bt = "_promoArt_62y38_28", Dt = "_promoBody_62y38_38", Mt = "_promoTitle_62y38_44", Ft = "_promoText_62y38_55", Rt = "_cta_62y38_63", Ut = "_ctaButton_62y38_69", Kt = "_ctaTag_62y38_89", qt = "_ownerOnly_62y38_106", Wt = "_memberArt_62y38_122", Yt = "_memberBody_62y38_132", Gt = "_memberEyebrow_62y38_139", jt = "_memberTitle_62y38_145", Qt = "_memberMeta_62y38_159", Vt = "_memberCta_62y38_166", Ht = "_plainBody_62y38_200", Xt = "_plainText_62y38_207", Jt = "_retry_62y38_212", Zt = "_loading_62y38_216", en = "_assets_62y38_224", tn = "_asset_62y38_224", nn = "_coin_62y38_279", an = "_assetLabel_62y38_287", sn = "_assetValue_62y38_291", on = "_assetArrow_62y38_299", rn = "_assetDivider_62y38_312", i = {
126
126
  promo: $t,
127
127
  member: zt,
128
128
  plain: Ot,
@@ -150,13 +150,13 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
150
150
  assetLabel: an,
151
151
  assetValue: sn,
152
152
  assetArrow: on,
153
- assetDivider: cn
154
- }, rn = x.points, ee = x.subscription, ln = ({ membership: e, text: t, onOpen: n }) => {
153
+ assetDivider: rn
154
+ }, cn = P.points, ee = P.subscription, ln = ({ membership: e, text: t, onOpen: n }) => {
155
155
  const { canBuy: a, offer: o } = e;
156
156
  return a ? /* @__PURE__ */ m("span", { className: i.cta, children: [
157
157
  /* @__PURE__ */ s(b, { theme: "light", type: "tertiary", block: !0, className: i.ctaButton, onClick: () => n(ee), children: t }),
158
158
  o != null && o.price ? /* @__PURE__ */ m("span", { className: i.ctaTag, children: [
159
- Pt(o.price),
159
+ xt(o.price),
160
160
  "起"
161
161
  ] }) : null
162
162
  ] }) : /* @__PURE__ */ s("span", { className: i.ownerOnly, children: "请团队所有者在统一账号中心续费" });
@@ -167,7 +167,7 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
167
167
  }) => {
168
168
  const { wallet: a } = e, o = a.isPending ? "…" : a.data ? v(a.data.availablePoints) : "暂不可用";
169
169
  return /* @__PURE__ */ m("div", { className: i.assets, children: [
170
- /* @__PURE__ */ m(b, { theme: "borderless", type: "tertiary", className: i.asset, "aria-label": `可用积分 ${o},查看积分与明细`, onClick: () => n(rn), children: [
170
+ /* @__PURE__ */ m(b, { theme: "borderless", type: "tertiary", className: i.asset, "aria-label": `可用积分 ${o},查看积分与明细`, onClick: () => n(cn), children: [
171
171
  /* @__PURE__ */ s("span", { className: i.coin, "aria-hidden": "true" }),
172
172
  /* @__PURE__ */ s("span", { className: i.assetLabel, children: "积分" }),
173
173
  /* @__PURE__ */ s("span", { className: i.assetValue, children: o }),
@@ -182,9 +182,9 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
182
182
  ] }) : null
183
183
  ] });
184
184
  }, dn = ({ membership: e, onOpen: t }) => {
185
- const n = fe(), { state: a, offer: o, currentPlan: c, subscription: d } = e;
185
+ const n = ye(), { state: a, offer: o, currentPlan: r, subscription: d } = e;
186
186
  if (a.kind === "loading")
187
- return /* @__PURE__ */ s("div", { className: i.loading, children: /* @__PURE__ */ s(re, { loading: !0, active: !0, placeholder: /* @__PURE__ */ s(re.Paragraph, { rows: 3 }) }) });
187
+ return /* @__PURE__ */ s("div", { className: i.loading, children: /* @__PURE__ */ s(ce, { loading: !0, active: !0, placeholder: /* @__PURE__ */ s(ce.Paragraph, { rows: 3 }) }) });
188
188
  if (a.kind === "error")
189
189
  return /* @__PURE__ */ m("div", { className: i.plain, children: [
190
190
  /* @__PURE__ */ m("div", { className: i.plainBody, children: [
@@ -194,7 +194,7 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
194
194
  /* @__PURE__ */ s(q, { membership: e, onOpen: t })
195
195
  ] });
196
196
  if (a.kind === "member") {
197
- const { subscription: h, daysLeft: y } = a, S = y !== null && y <= St, T = (c == null ? void 0 : c.monthlyPoints) ?? 0;
197
+ const { subscription: h, daysLeft: f } = a, S = f !== null && f <= St, T = (r == null ? void 0 : r.monthlyPoints) ?? 0;
198
198
  return /* @__PURE__ */ m("div", { className: i.member, "data-expiring": S ? "true" : "false", children: [
199
199
  /* @__PURE__ */ s("span", { className: i.memberArt, "aria-hidden": "true" }),
200
200
  /* @__PURE__ */ m("div", { className: i.memberBody, children: [
@@ -203,7 +203,7 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
203
203
  T > 0 ? ` · 每月 ${v(T)} 积分` : ""
204
204
  ] }),
205
205
  /* @__PURE__ */ s("span", { className: i.memberTitle, children: H(h) }),
206
- /* @__PURE__ */ s("span", { className: i.memberMeta, children: Nt(h) }),
206
+ /* @__PURE__ */ s("span", { className: i.memberMeta, children: wt(h) }),
207
207
  e.canBuy ? /* @__PURE__ */ s(b, { theme: "light", type: "tertiary", size: "small", className: i.memberCta, onClick: () => t(ee), children: S ? "立即续费" : o ? "续费或升级" : "续费" }) : null
208
208
  ] }),
209
209
  /* @__PURE__ */ s(
@@ -211,31 +211,31 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
211
211
  {
212
212
  membership: e,
213
213
  onOpen: t,
214
- extra: y === null ? void 0 : { label: y === 0 ? "今天到期" : `剩余 ${y} 天`, tone: S ? "warning" : void 0 }
214
+ extra: f === null ? void 0 : { label: f === 0 ? "今天到期" : `剩余 ${f} 天`, tone: S ? "warning" : void 0 }
215
215
  }
216
216
  )
217
217
  ] });
218
218
  }
219
- const u = a.kind === "team-expired", r = u ? "团队版已到期" : o ? `升级${o.plan.name},畅享更多` : "开通会员畅享", p = u ? "续费后团队成员继续共用套餐和积分" : It(o == null ? void 0 : o.plan, e.plans.data ?? [], n).join(" · "), _ = u ? 0 : (c == null ? void 0 : c.monthlyPoints) ?? 0;
219
+ const u = a.kind === "team-expired", c = u ? "团队版已到期" : o ? `升级${o.plan.name},畅享更多` : "开通会员畅享", p = u ? "续费后团队成员继续共用套餐和积分" : It(o == null ? void 0 : o.plan, e.plans.data ?? [], n).join(" · "), _ = u ? 0 : (r == null ? void 0 : r.monthlyPoints) ?? 0;
220
220
  return /* @__PURE__ */ m("div", { className: i.promo, "data-tone": u ? "team" : "free", children: [
221
221
  /* @__PURE__ */ s("span", { className: i.promoArt, "aria-hidden": "true" }),
222
222
  /* @__PURE__ */ m("div", { className: i.promoBody, children: [
223
- /* @__PURE__ */ s("span", { className: i.promoTitle, children: r }),
223
+ /* @__PURE__ */ s("span", { className: i.promoTitle, children: c }),
224
224
  /* @__PURE__ */ s("span", { className: i.promoText, children: p }),
225
225
  /* @__PURE__ */ s(ln, { membership: e, text: u ? "续费团队版" : "立即开通会员", onOpen: t })
226
226
  ] }),
227
227
  /* @__PURE__ */ s(q, { membership: e, onOpen: t, extra: _ > 0 ? { label: `免费版每月赠 ${v(_)}` } : void 0 })
228
228
  ] });
229
229
  }, un = "个人空间", M = (e) => e.type === "team", X = (e) => e.type === "personal" ? un : e.name || e.slug, mn = { owner: "所有者", admin: "管理员", member: "成员" }, Yn = (e) => e ? mn[e] ?? "" : "", pn = (e) => !!(e && (e.type === "personal" || e.role === "owner")), _n = () => {
230
- const [e, t] = B(!1), n = ye(), { accountApi: a, config: o } = g(), c = async () => {
230
+ const [e, t] = B(!1), n = fe(), { accountApi: a, config: o } = g(), r = async () => {
231
231
  if (e) return;
232
232
  t(!0), De();
233
233
  let u = o.routes.publicHome;
234
234
  try {
235
- const { endSessionUrl: r } = await a.logout();
236
- r && (u = r);
237
- } catch (r) {
238
- if (!he(r, 401)) {
235
+ const { endSessionUrl: c } = await a.logout();
236
+ c && (u = c);
237
+ } catch (c) {
238
+ if (!he(c, 401)) {
239
239
  Me(), _e.error("退出失败,请重试"), t(!1);
240
240
  return;
241
241
  }
@@ -251,10 +251,10 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
251
251
  okText: "退出登录",
252
252
  cancelText: "取消",
253
253
  okButtonProps: { type: "danger" },
254
- onOk: c
254
+ onOk: r
255
255
  });
256
- }, logout: c, pending: e };
257
- }, W = (e) => typeof e == "object" && e !== null && !Array.isArray(e), fn = (e) => {
256
+ }, logout: r, pending: e };
257
+ }, W = (e) => typeof e == "object" && e !== null && !Array.isArray(e), yn = (e) => {
258
258
  if (!he(e, 403) || !W(e) || !W(e.response)) return !1;
259
259
  const t = e.response.data;
260
260
  return W(t) && t.reason === "team_subscription_required";
@@ -264,58 +264,58 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
264
264
  subscription: (e, t) => ["product-subscription", e, t],
265
265
  plans: ["product-plans"]
266
266
  }, hn = () => {
267
- const { accountApi: e } = g(), { session: t, spaces: n } = F(), a = (t == null ? void 0 : t.activeSpaceId) ?? "", o = (t == null ? void 0 : t.globalUserId) ?? "", c = (t == null ? void 0 : t.purpose) === "user" && !!(a && o), d = n.find((_) => _.id === a), u = P({
267
+ const { accountApi: e } = g(), { session: t, spaces: n } = F(), a = (t == null ? void 0 : t.activeSpaceId) ?? "", o = (t == null ? void 0 : t.globalUserId) ?? "", r = (t == null ? void 0 : t.purpose) === "user" && !!(a && o), d = n.find((_) => _.id === a), u = x({
268
268
  queryKey: L.profile(o),
269
269
  queryFn: () => e.getProfile(),
270
270
  enabled: !!o,
271
271
  staleTime: 1 / 0
272
- }), r = P({
272
+ }), c = x({
273
273
  queryKey: L.wallet(a, o),
274
274
  queryFn: () => e.getWallet(),
275
- enabled: c
276
- }), p = P({
275
+ enabled: r
276
+ }), p = x({
277
277
  queryKey: L.subscription(a, o),
278
278
  queryFn: () => e.getSubscription(),
279
- enabled: c
279
+ enabled: r
280
280
  });
281
- return { session: t, allowed: c, activeSpace: d, activeSpaceId: a, globalUserId: o, profile: u, wallet: r, subscription: p };
282
- }, yn = 5 * 6e4, bn = (e) => {
281
+ return { session: t, allowed: r, activeSpace: d, activeSpaceId: a, globalUserId: o, profile: u, wallet: c, subscription: p };
282
+ }, fn = 5 * 6e4, bn = (e) => {
283
283
  const { accountApi: t } = g();
284
- return P({
284
+ return x({
285
285
  queryKey: L.plans,
286
286
  queryFn: () => t.getPlans(),
287
287
  enabled: e,
288
- staleTime: yn
288
+ staleTime: fn
289
289
  });
290
290
  }, ke = () => {
291
- var y;
292
- const { config: e } = g(), t = hn(), { activeSpace: n, subscription: a, allowed: o } = t, c = bn(o), d = n ? M(n) : !1, u = d ? "team" : "personal";
293
- let r;
294
- !o || a.isPending ? r = { kind: "loading" } : a.isError ? r = fn(a.error) ? { kind: "team-expired" } : { kind: "error" } : !a.data || a.data.isDefault ? r = { kind: "free", subscription: a.data ?? null } : r = { kind: "member", subscription: a.data, daysLeft: Ct(a.data) };
295
- const p = r.kind === "free" || r.kind === "member" ? ((y = r.subscription) == null ? void 0 : y.tier) ?? null : null, _ = r.kind === "free" || r.kind === "member" || r.kind === "team-expired" ? Lt(c.data, u, p) : null, h = (r.kind === "free" || r.kind === "member") && r.subscription ? Et(c.data, r.subscription) : void 0;
291
+ var f;
292
+ const { config: e } = g(), t = hn(), { activeSpace: n, subscription: a, allowed: o } = t, r = bn(o), d = n ? M(n) : !1, u = d ? "team" : "personal";
293
+ let c;
294
+ !o || a.isPending ? c = { kind: "loading" } : a.isError ? c = yn(a.error) ? { kind: "team-expired" } : { kind: "error" } : !a.data || a.data.isDefault ? c = { kind: "free", subscription: a.data ?? null } : c = { kind: "member", subscription: a.data, daysLeft: Ct(a.data) };
295
+ const p = c.kind === "free" || c.kind === "member" ? ((f = c.subscription) == null ? void 0 : f.tier) ?? null : null, _ = c.kind === "free" || c.kind === "member" || c.kind === "team-expired" ? Lt(r.data, u, p) : null, h = (c.kind === "free" || c.kind === "member") && c.subscription ? Et(r.data, c.subscription) : void 0;
296
296
  return {
297
297
  ...t,
298
- plans: c,
299
- state: r,
298
+ plans: r,
299
+ state: c,
300
300
  offer: _,
301
301
  currentPlan: h,
302
302
  team: d,
303
303
  /** 个人空间是自己的;团队空间只有所有者能买(STD-BILLING-001) */
304
304
  canBuy: pn(n),
305
305
  /** 「订阅与套餐」的站内地址 */
306
- subscriptionPath: N(e.routes.app, "subscription")
306
+ subscriptionPath: w(e.routes.app, "subscription")
307
307
  };
308
308
  }, gn = () => {
309
- const e = ye(), t = Re(), { session: n } = F(), { accountApi: a } = g(), [o, c] = B(!1), d = pe(0), u = n == null ? void 0 : n.activeSpaceId, r = Se(
309
+ const e = fe(), t = Re(), { session: n } = F(), { accountApi: a } = g(), [o, r] = B(!1), d = pe(0), u = n == null ? void 0 : n.activeSpaceId, c = Se(
310
310
  async (p) => {
311
311
  if (!p || p === u || o) return;
312
312
  const _ = ++d.current;
313
- c(!0);
313
+ r(!0);
314
314
  try {
315
315
  if (await e.cancelQueries(), e.clear(), (await a.switchSpace(p)).activeSpaceId !== p) throw new Error("空间切换响应与请求不一致");
316
- const y = await le(a);
316
+ const f = await le(a);
317
317
  if (d.current !== _) return;
318
- t.setContext(y), be();
318
+ t.setContext(f), be();
319
319
  } catch {
320
320
  if (d.current !== _) return;
321
321
  try {
@@ -325,46 +325,46 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
325
325
  e.clear(), t.clear({ unavailable: !0 });
326
326
  }
327
327
  } finally {
328
- d.current === _ && c(!1);
328
+ d.current === _ && r(!1);
329
329
  }
330
330
  },
331
331
  [a, u, t, e, o]
332
332
  );
333
- return { switching: o, switchSpace: r };
334
- }, Y = "我的账号", kn = 80, wn = 200, G = ({ space: e }) => /* @__PURE__ */ m(me, { children: [
333
+ return { switching: o, switchSpace: c };
334
+ }, Y = "我的账号", kn = 80, Nn = 200, G = ({ space: e }) => /* @__PURE__ */ m(me, { children: [
335
335
  /* @__PURE__ */ s("span", { className: l.spaceName, children: X(e) }),
336
336
  M(e) ? /* @__PURE__ */ s("span", { className: l.spaceType, children: "团队" }) : null
337
- ] }), ue = ({ nickName: e, member: t, size: n }) => /* @__PURE__ */ s("span", { className: l.avatarWrap, "data-member": t ? "true" : "false", "data-size": n > 40 ? "large" : "small", children: /* @__PURE__ */ s(Pe, { size: "small", shape: "circle", className: l.avatar, style: { width: n, height: n }, children: e ? Array.from(e)[0] : /* @__PURE__ */ s(D, { "aria-hidden": "true" }) }) }), Nn = ({ state: e }) => e.kind === "member" ? /* @__PURE__ */ m("span", { className: l.planChip, "data-tone": "member", children: [
337
+ ] }), ue = ({ nickName: e, member: t, size: n }) => /* @__PURE__ */ s("span", { className: l.avatarWrap, "data-member": t ? "true" : "false", "data-size": n > 40 ? "large" : "small", children: /* @__PURE__ */ s(xe, { size: "small", shape: "circle", className: l.avatar, style: { width: n, height: n }, children: e ? Array.from(e)[0] : /* @__PURE__ */ s(D, { "aria-hidden": "true" }) }) }), wn = ({ state: e }) => e.kind === "member" ? /* @__PURE__ */ m("span", { className: l.planChip, "data-tone": "member", children: [
338
338
  /* @__PURE__ */ s("span", { className: l.diamond, "aria-hidden": "true" }),
339
339
  H(e.subscription)
340
340
  ] }) : e.kind === "free" ? /* @__PURE__ */ s("span", { className: l.planChip, "data-tone": "free", children: e.subscription ? H(e.subscription) : "未开通" }) : e.kind === "team-expired" ? /* @__PURE__ */ s("span", { className: l.planChip, "data-tone": "warning", children: "团队版已到期" }) : null, Gn = ({ personal: e, selectedKey: t, onOpen: n }) => {
341
- var ce;
342
- const { config: a } = g(), o = fe(), c = J(), d = e ?? yt(a.routes.app, ht(o)), u = ke(), { profile: r, state: p } = u, { session: _, spaces: h } = F(), { confirmLogout: y, pending: S } = _n(), { switching: T, switchSpace: we } = gn(), [R, E] = B(!1), [U, I] = B(!1), A = pe(void 0), K = ((ce = r.data) == null ? void 0 : ce.nickName) ?? "", $ = K || (r.isPending ? "" : Y), te = (_ == null ? void 0 : _.activeSpaceId) ?? "", k = h.find((f) => f.id === te), ne = h.length > 1, ae = p.kind === "member", C = () => {
341
+ var re;
342
+ const { config: a } = g(), o = ye(), r = J(), d = e ?? ft(a.routes.app, ht(o)), u = ke(), { profile: c, state: p } = u, { session: _, spaces: h } = F(), { confirmLogout: f, pending: S } = _n(), { switching: T, switchSpace: Ne } = gn(), [R, E] = B(!1), [U, I] = B(!1), A = pe(void 0), K = ((re = c.data) == null ? void 0 : re.nickName) ?? "", $ = K || (c.isPending ? "" : Y), te = (_ == null ? void 0 : _.activeSpaceId) ?? "", k = h.find((y) => y.id === te), ne = h.length > 1, ae = p.kind === "member", C = () => {
343
343
  A.current !== void 0 && (window.clearTimeout(A.current), A.current = void 0);
344
344
  };
345
345
  Te(() => C, []);
346
346
  const z = () => {
347
347
  C(), E(!1), I(!1);
348
- }, Ne = () => {
348
+ }, we = () => {
349
349
  C(), A.current = window.setTimeout(() => E(!0), kn);
350
350
  }, se = () => {
351
351
  C(), A.current = window.setTimeout(() => {
352
352
  E(!1), I(!1);
353
- }, wn);
354
- }, oe = (f) => {
353
+ }, Nn);
354
+ }, oe = (y) => {
355
355
  if (z(), n) {
356
- n(f);
356
+ n(y);
357
357
  return;
358
358
  }
359
- const w = d.items.find((Ce) => Ce.key === f);
360
- w && c(w.to);
359
+ const N = d.items.find((Ce) => Ce.key === y);
360
+ N && r(N.to);
361
361
  }, ve = /* @__PURE__ */ m("div", { className: l.card, role: "dialog", "aria-label": "账号", onMouseEnter: C, onMouseLeave: se, children: [
362
362
  /* @__PURE__ */ m("div", { className: l.identity, children: [
363
363
  /* @__PURE__ */ s(ue, { nickName: K, member: ae, size: 52 }),
364
364
  /* @__PURE__ */ m("div", { className: l.who, children: [
365
365
  /* @__PURE__ */ m("div", { className: l.nameRow, children: [
366
366
  /* @__PURE__ */ s("span", { className: l.name, title: $ || Y, children: $ || Y }),
367
- /* @__PURE__ */ s(Nn, { state: p })
367
+ /* @__PURE__ */ s(wn, { state: p })
368
368
  ] }),
369
369
  k ? ne ? /* @__PURE__ */ m(
370
370
  b,
@@ -375,7 +375,7 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
375
375
  className: l.spaceToggle,
376
376
  "aria-expanded": U,
377
377
  "aria-label": `当前空间:${X(k)},切换空间`,
378
- onClick: () => I((f) => !f),
378
+ onClick: () => I((y) => !y),
379
379
  children: [
380
380
  M(k) ? /* @__PURE__ */ s(ie, { "aria-hidden": "true" }) : /* @__PURE__ */ s(D, { "aria-hidden": "true" }),
381
381
  /* @__PURE__ */ s(G, { space: k }),
@@ -389,8 +389,8 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
389
389
  ] }) : null
390
390
  ] })
391
391
  ] }),
392
- ne && U ? /* @__PURE__ */ s("div", { className: l.spaceList, role: "group", "aria-label": "切换空间", children: h.map((f) => {
393
- const w = f.id === te;
392
+ ne && U ? /* @__PURE__ */ s("div", { className: l.spaceList, role: "group", "aria-label": "切换空间", children: h.map((y) => {
393
+ const N = y.id === te;
394
394
  return /* @__PURE__ */ m(
395
395
  b,
396
396
  {
@@ -398,36 +398,36 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
398
398
  type: "tertiary",
399
399
  block: !0,
400
400
  className: l.spaceOption,
401
- "aria-current": w ? "true" : void 0,
402
- disabled: T && !w,
401
+ "aria-current": N ? "true" : void 0,
402
+ disabled: T && !N,
403
403
  onClick: () => {
404
- w || (z(), we(f.id));
404
+ N || (z(), Ne(y.id));
405
405
  },
406
406
  children: [
407
- /* @__PURE__ */ s("span", { className: l.spaceCheck, children: w ? /* @__PURE__ */ s(Oe, { "aria-hidden": "true" }) : null }),
408
- /* @__PURE__ */ s(G, { space: f })
407
+ /* @__PURE__ */ s("span", { className: l.spaceCheck, children: N ? /* @__PURE__ */ s(Oe, { "aria-hidden": "true" }) : null }),
408
+ /* @__PURE__ */ s(G, { space: y })
409
409
  ]
410
410
  },
411
- f.id
411
+ y.id
412
412
  );
413
413
  }) }) : null,
414
414
  /* @__PURE__ */ s("div", { className: l.plan, children: /* @__PURE__ */ s(dn, { membership: u, onOpen: oe }) }),
415
- /* @__PURE__ */ s("div", { className: l.links, role: "group", "aria-label": d.label, children: d.items.map((f) => /* @__PURE__ */ m(
415
+ /* @__PURE__ */ s("div", { className: l.links, role: "group", "aria-label": d.label, children: d.items.map((y) => /* @__PURE__ */ m(
416
416
  b,
417
417
  {
418
418
  theme: "borderless",
419
419
  type: "tertiary",
420
420
  block: !0,
421
421
  className: l.link,
422
- "aria-current": f.key === t ? "page" : void 0,
423
- onClick: () => oe(f.key),
422
+ "aria-current": y.key === t ? "page" : void 0,
423
+ onClick: () => oe(y.key),
424
424
  children: [
425
- f.icon ? /* @__PURE__ */ s("span", { className: l.linkIcon, "aria-hidden": "true", children: /* @__PURE__ */ s(f.icon, {}) }) : null,
426
- /* @__PURE__ */ s("span", { className: l.linkLabel, children: f.label }),
425
+ y.icon ? /* @__PURE__ */ s("span", { className: l.linkIcon, "aria-hidden": "true", children: /* @__PURE__ */ s(y.icon, {}) }) : null,
426
+ /* @__PURE__ */ s("span", { className: l.linkLabel, children: y.label }),
427
427
  /* @__PURE__ */ s(V, { className: l.linkArrow, "aria-hidden": "true" })
428
428
  ]
429
429
  },
430
- f.key
430
+ y.key
431
431
  )) }),
432
432
  /* @__PURE__ */ s("div", { className: l.divider, "aria-hidden": "true" }),
433
433
  /* @__PURE__ */ s(
@@ -439,14 +439,14 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
439
439
  className: l.logout,
440
440
  disabled: S,
441
441
  onClick: () => {
442
- z(), y();
442
+ z(), f();
443
443
  },
444
444
  children: "退出登录"
445
445
  }
446
446
  )
447
447
  ] });
448
448
  return /* @__PURE__ */ s(
449
- xe,
449
+ Pe,
450
450
  {
451
451
  trigger: "custom",
452
452
  visible: R,
@@ -466,17 +466,17 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
466
466
  "aria-haspopup": "dialog",
467
467
  "aria-expanded": R,
468
468
  loading: T,
469
- onMouseEnter: Ne,
469
+ onMouseEnter: we,
470
470
  onMouseLeave: se,
471
471
  onClick: () => {
472
- C(), E((f) => !f), R && I(!1);
472
+ C(), E((y) => !y), R && I(!1);
473
473
  },
474
474
  children: /* @__PURE__ */ s(ue, { nickName: K, member: ae, size: 34 })
475
475
  }
476
476
  )
477
477
  }
478
478
  );
479
- }, vn = "_upgrade_ea6lf_2", Cn = "_crown_ea6lf_25", Sn = "_text_ea6lf_37", j = {
479
+ }, vn = "_upgrade_1dxl7_2", Cn = "_crown_1dxl7_25", Sn = "_text_1dxl7_37", j = {
480
480
  upgrade: vn,
481
481
  crown: Cn,
482
482
  text: Sn
@@ -484,17 +484,17 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
484
484
  const { config: e } = g(), t = J(), { state: n, canBuy: a } = ke();
485
485
  if (!a || n.kind !== "free" && n.kind !== "team-expired") return null;
486
486
  const o = n.kind === "team-expired" ? "续费团队版" : "开通会员";
487
- return /* @__PURE__ */ m(b, { theme: "light", type: "tertiary", className: j.upgrade, onClick: () => t(N(e.routes.app, "subscription")), children: [
487
+ return /* @__PURE__ */ m(b, { theme: "light", type: "tertiary", className: j.upgrade, onClick: () => t(w(e.routes.app, "subscription")), children: [
488
488
  /* @__PURE__ */ s("span", { className: j.crown, "aria-hidden": "true" }),
489
489
  /* @__PURE__ */ s("span", { className: j.text, children: o })
490
490
  ] });
491
- }, Tn = "_wallet_weimr_2", An = "_coin_weimr_25", Pn = "_value_weimr_32", Q = {
491
+ }, Tn = "_wallet_e6uma_2", An = "_coin_e6uma_25", xn = "_value_e6uma_32", Q = {
492
492
  wallet: Tn,
493
493
  coin: An,
494
- value: Pn
494
+ value: xn
495
495
  }, Qn = () => {
496
- const { accountApi: e, config: t } = g(), { session: n } = F(), a = J(), o = (n == null ? void 0 : n.activeSpaceId) ?? "", c = (n == null ? void 0 : n.globalUserId) ?? "", d = P({
497
- queryKey: L.wallet(o, c),
496
+ const { accountApi: e, config: t } = g(), { session: n } = F(), a = J(), o = (n == null ? void 0 : n.activeSpaceId) ?? "", r = (n == null ? void 0 : n.globalUserId) ?? "", d = x({
497
+ queryKey: L.wallet(o, r),
498
498
  queryFn: () => e.getWallet(),
499
499
  enabled: !!n,
500
500
  refetchOnWindowFocus: !0
@@ -508,7 +508,7 @@ const Ue = "_trigger_am2co_6", Ke = "_avatarWrap_am2co_27", qe = "_avatar_am2co_
508
508
  type: "tertiary",
509
509
  className: Q.wallet,
510
510
  "aria-label": d.data ? `积分 ${u}` : u,
511
- onClick: () => a(N(t.routes.app, "points")),
511
+ onClick: () => a(w(t.routes.app, "points")),
512
512
  children: [
513
513
  /* @__PURE__ */ s("span", { className: Q.coin, "aria-hidden": "true" }),
514
514
  /* @__PURE__ */ s("span", { className: Q.value, children: u })
@@ -526,13 +526,13 @@ export {
526
526
  Rn as G,
527
527
  X as H,
528
528
  Yn as I,
529
- xt as J,
529
+ Pt as J,
530
530
  Lt as K,
531
531
  hn as L,
532
532
  _n as M,
533
533
  ke as N,
534
534
  bn as O,
535
- x as P,
535
+ P,
536
536
  gn as Q,
537
537
  bt as U,
538
538
  Qn as W,
@@ -542,24 +542,24 @@ export {
542
542
  dn as d,
543
543
  jn as e,
544
544
  L as f,
545
- N as g,
546
- yt as h,
545
+ w as g,
546
+ ft as h,
547
547
  pn as i,
548
548
  Et as j,
549
549
  Wn as k,
550
- wt as l,
550
+ Nt as l,
551
551
  At as m,
552
- Pt as n,
552
+ xt as n,
553
553
  Mn as o,
554
554
  _t as p,
555
555
  M as q,
556
- fn as r,
556
+ yn as r,
557
557
  Z as s,
558
558
  It as t,
559
559
  O as u,
560
560
  Ct as v,
561
561
  qn as w,
562
562
  Kn as x,
563
- Nt as y,
563
+ wt as y,
564
564
  H as z
565
565
  };