@hkyhy/marsun-components-core 0.1.140 → 0.1.141

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.
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
2
  import { notification as Ue, Badge as Fe, Button as D, Drawer as ze, Space as Ee, Checkbox as oe, message as $ } from "antd";
3
- import P from "classnames";
3
+ import R from "classnames";
4
4
  import { forwardRef as Ge, useState as f, useRef as T, useMemo as Se, useCallback as N, useImperativeHandle as $e, useEffect as b } from "react";
5
5
  import { createPortal as Ke } from "react-dom";
6
6
  import { sanitizeInboxHtml as je } from "../sanitizeInboxHtml.js";
@@ -10,7 +10,7 @@ import { filterInboxActionsForHost as Ve, resolveInboxItemActions as We, isInbox
10
10
  import { inboxSceneLabel as Dt, isTerminalActionStatus as Mt, normalizeInboxActions as Ot, resolveInboxSceneKey as It } from "./inboxItemActions.js";
11
11
  import { loadInboxToastPrefs as Xe, shouldToastForMessageType as Ye, saveInboxToastPrefs as Je } from "./toastPrefs.js";
12
12
  import { DEFAULT_INBOX_TOAST_PREFS as Ut } from "./toastPrefs.js";
13
- import n from "./style.module.scss.js";
13
+ import r from "./style.module.scss.js";
14
14
  import { Bell as qe } from "../../../Icons/Bell.js";
15
15
  import se, { SEMANTIC_COLORS as M } from "../../../Tag/SemanticTag.js";
16
16
  import Ze from "../../../StateBar/StateBar.js";
@@ -28,11 +28,11 @@ const at = 6e3, ot = [
28
28
  action: "行动",
29
29
  remind: "提醒"
30
30
  }, st = 300, it = 1500, ct = 72;
31
- function Ce(u) {
31
+ function ke(u) {
32
32
  const o = String(u || "").trim().toLowerCase();
33
33
  return o ? lt[o] || o : "";
34
34
  }
35
- function ke(u) {
35
+ function Be(u) {
36
36
  const o = String(u || "").trim().toLowerCase();
37
37
  return o === "alert" ? M.DANGER : o === "action" ? M.PRIMARY : o === "remind" ? M.WARNING : M.DEFAULT;
38
38
  }
@@ -46,33 +46,33 @@ function mt(u) {
46
46
  try {
47
47
  const o = JSON.parse(u);
48
48
  if (!o || typeof o != "object") return null;
49
- const O = String(o.messageType || o.message_type || "").trim(), x = String(o.title || "").trim(), A = String(o.summary || "").trim();
50
- return !O && !x && !A ? null : {
49
+ const O = String(o.messageType || o.message_type || "").trim(), C = String(o.title || "").trim(), _ = String(o.summary || "").trim();
50
+ return !O && !C && !_ ? null : {
51
51
  messageType: O || void 0,
52
- title: x || void 0,
53
- summary: A || void 0
52
+ title: C || void 0,
53
+ summary: _ || void 0
54
54
  };
55
55
  } catch {
56
56
  return null;
57
57
  }
58
58
  }
59
- const Pt = Ge(function({
59
+ const Rt = Ge(function({
60
60
  fetchInbox: o,
61
61
  markRead: O,
62
- markAllRead: x,
63
- onNavigate: A,
62
+ markAllRead: C,
63
+ onNavigate: _,
64
64
  pollMs: K = 0,
65
65
  locationKey: ie,
66
66
  pageSize: E = 20,
67
- className: xe,
68
- title: Be = "站内信",
67
+ className: Ce,
68
+ title: xe = "站内信",
69
69
  streamPath: j = "/api/v1/msg-center/inbox/stream",
70
70
  getAccessToken: V,
71
71
  onItemAction: ce
72
- }, Re) {
73
- const [W, B] = f(!1), [de, ue] = f(!1), [Q, me] = f(""), [I, H] = f([]), [S, U] = f(0), [fe, X] = f({}), [Y, Pe] = f(""), [F, Ae] = f("all"), [_, _e] = f(() => Xe()), [De, pe] = f(!1), [J, ye] = f(!1), [p, q] = f(null), L = T(null), C = T(null), Z = T(null), y = T(null), ge = T(!1), ve = T(_);
74
- ve.current = _;
75
- const ee = T(1), te = T(!1), R = T(!1), z = Se(
72
+ }, Pe) {
73
+ const [W, x] = f(!1), [de, ue] = f(!1), [Q, me] = f(""), [I, H] = f([]), [S, U] = f(0), [fe, X] = f({}), [Y, Re] = f(""), [F, _e] = f("all"), [A, Ae] = f(() => Xe()), [De, pe] = f(!1), [J, ye] = f(!1), [p, q] = f(null), L = T(null), k = T(null), Z = T(null), y = T(null), ge = T(!1), he = T(A);
74
+ he.current = A;
75
+ const ee = T(1), te = T(!1), P = T(!1), z = Se(
76
76
  () => ({
77
77
  messageType: Y || void 0,
78
78
  unreadOnly: F === "unread" || void 0,
@@ -80,34 +80,34 @@ const Pt = Ge(function({
80
80
  }),
81
81
  [Y, F]
82
82
  ), G = N(async () => {
83
- ue(!0), me(""), ee.current = 1, R.current = !1;
83
+ ue(!0), me(""), ee.current = 1, P.current = !1;
84
84
  try {
85
85
  const e = await o({
86
86
  currentPage: 1,
87
87
  pageSize: E,
88
88
  ...z
89
- }), t = (e == null ? void 0 : e.pageData) || [], r = typeof (e == null ? void 0 : e.total) == "number" ? e.total : t.length;
90
- H(t), R.current = t.length > 0 && t.length < r, U(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), X((e == null ? void 0 : e.unreadByMessageType) || {});
89
+ }), t = (e == null ? void 0 : e.pageData) || [], n = typeof (e == null ? void 0 : e.total) == "number" ? e.total : t.length;
90
+ H(t), P.current = t.length > 0 && t.length < n, U(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), X((e == null ? void 0 : e.unreadByMessageType) || {});
91
91
  } catch (e) {
92
- H([]), R.current = !1, me(e instanceof Error ? e.message : String(e));
92
+ H([]), P.current = !1, me(e instanceof Error ? e.message : String(e));
93
93
  } finally {
94
94
  ue(!1);
95
95
  }
96
- }, [o, E, z]), he = N(async () => {
97
- if (!(te.current || !R.current)) {
96
+ }, [o, E, z]), ve = N(async () => {
97
+ if (!(te.current || !P.current)) {
98
98
  te.current = !0, pe(!0);
99
99
  try {
100
100
  const e = ee.current + 1, t = await o({
101
101
  currentPage: e,
102
102
  pageSize: E,
103
103
  ...z
104
- }), r = (t == null ? void 0 : t.pageData) || [], l = typeof (t == null ? void 0 : t.total) == "number" ? t.total : 0;
104
+ }), n = (t == null ? void 0 : t.pageData) || [], l = typeof (t == null ? void 0 : t.total) == "number" ? t.total : 0;
105
105
  H((i) => {
106
- const s = new Set(i.map((g) => g.id)), m = r.filter((g) => (g == null ? void 0 : g.id) && !s.has(g.id)), h = m.length ? [...i, ...m] : i;
107
- return R.current = m.length > 0 && (l > 0 ? h.length < l : m.length >= E), h;
108
- }), r.length && (ee.current = e), typeof (t == null ? void 0 : t.unreadTotal) == "number" && U(t.unreadTotal), t != null && t.unreadByMessageType && X(t.unreadByMessageType);
106
+ const s = new Set(i.map((g) => g.id)), m = n.filter((g) => (g == null ? void 0 : g.id) && !s.has(g.id)), v = m.length ? [...i, ...m] : i;
107
+ return P.current = m.length > 0 && (l > 0 ? v.length < l : m.length >= E), v;
108
+ }), n.length && (ee.current = e), typeof (t == null ? void 0 : t.unreadTotal) == "number" && U(t.unreadTotal), t != null && t.unreadByMessageType && X(t.unreadByMessageType);
109
109
  } catch {
110
- R.current = !1;
110
+ P.current = !1;
111
111
  } finally {
112
112
  te.current = !1, pe(!1);
113
113
  }
@@ -115,10 +115,10 @@ const Pt = Ge(function({
115
115
  }, [o, E, z]), Me = N(
116
116
  (e) => {
117
117
  const t = e.currentTarget;
118
- t.scrollHeight - t.scrollTop - t.clientHeight <= ct && he();
118
+ t.scrollHeight - t.scrollTop - t.clientHeight <= ct && ve();
119
119
  },
120
- [he]
121
- ), v = N(async () => {
120
+ [ve]
121
+ ), h = N(async () => {
122
122
  try {
123
123
  const e = await o({ currentPage: 1, pageSize: E });
124
124
  U(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), X((e == null ? void 0 : e.unreadByMessageType) || {});
@@ -127,10 +127,10 @@ const Pt = Ge(function({
127
127
  }, [o, E]), ne = N(() => {
128
128
  y.current != null && (window.clearTimeout(y.current), y.current = null), q(null);
129
129
  }, []), Te = N(() => {
130
- ne(), B(!0);
130
+ ne(), x(!0);
131
131
  }, [ne]), be = N(() => {
132
132
  const e = Z.current;
133
- if (Z.current = null, !e || !Ye(ve.current, e.messageType)) return;
133
+ if (Z.current = null, !e || !Ye(he.current, e.messageType)) return;
134
134
  y.current != null && (window.clearTimeout(y.current), y.current = null);
135
135
  const t = `inbox-badge-${e.messageType || "msg"}-${Date.now()}`;
136
136
  q({
@@ -143,15 +143,15 @@ const Pt = Ge(function({
143
143
  }, at);
144
144
  }, []), w = N(
145
145
  (e) => {
146
- e && (Z.current = e, be()), C.current != null && window.clearTimeout(C.current), C.current = window.setTimeout(() => {
147
- C.current = null, v();
146
+ e && (Z.current = e, be()), k.current != null && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
147
+ k.current = null, h();
148
148
  }, it);
149
149
  },
150
- [v, be]
150
+ [h, be]
151
151
  );
152
- $e(Re, () => ({ refreshBadge: v }), [v]), b(() => {
153
- v();
154
- }, [v]), b(() => {
152
+ $e(Pe, () => ({ refreshBadge: h }), [h]), b(() => {
153
+ h();
154
+ }, [h]), b(() => {
155
155
  if (ie !== void 0) {
156
156
  if (!ge.current) {
157
157
  ge.current = !0;
@@ -162,10 +162,10 @@ const Pt = Ge(function({
162
162
  }, [ie, w]), b(() => {
163
163
  if (K <= 0) return;
164
164
  const e = window.setInterval(() => {
165
- v();
165
+ h();
166
166
  }, K);
167
167
  return () => window.clearInterval(e);
168
- }, [K, v]), b(() => {
168
+ }, [K, h]), b(() => {
169
169
  const e = () => {
170
170
  L.current != null && window.clearTimeout(L.current), L.current = window.setTimeout(() => {
171
171
  L.current = null, w();
@@ -178,24 +178,24 @@ const Pt = Ge(function({
178
178
  };
179
179
  }, [w]), b(() => {
180
180
  const e = (t) => {
181
- const r = t.detail;
182
- w((r == null ? void 0 : r.preview) || void 0);
181
+ const n = t.detail;
182
+ w((n == null ? void 0 : n.preview) || void 0);
183
183
  };
184
184
  return window.addEventListener(Le, e), () => window.removeEventListener(Le, e);
185
185
  }, [w]), b(() => {
186
186
  Ue.destroy();
187
187
  }, []), b(() => () => {
188
- C.current != null && (window.clearTimeout(C.current), C.current = null), y.current != null && (window.clearTimeout(y.current), y.current = null);
188
+ k.current != null && (window.clearTimeout(k.current), k.current = null), y.current != null && (window.clearTimeout(y.current), y.current = null);
189
189
  }, []), b(() => {
190
190
  if (j === !1 || typeof V != "function" || typeof window > "u" || typeof EventSource > "u") return;
191
191
  const e = String(j || "/api/v1/msg-center/inbox/stream").trim();
192
- let t = !1, r = null, l = null, i = 0;
192
+ let t = !1, n = null, l = null, i = 0;
193
193
  const s = (c) => {
194
- const k = c, He = typeof (k == null ? void 0 : k.data) == "string" ? mt(k.data) : null;
194
+ const B = c, He = typeof (B == null ? void 0 : B.data) == "string" ? mt(B.data) : null;
195
195
  w(He);
196
196
  }, m = () => {
197
197
  l != null && (window.clearTimeout(l), l = null);
198
- }, h = () => {
198
+ }, v = () => {
199
199
  if (t || l != null) return;
200
200
  const c = Math.min(3e4, 1e3 * 2 ** Math.min(i, 5));
201
201
  i += 1, l = window.setTimeout(() => {
@@ -205,26 +205,26 @@ const Pt = Ge(function({
205
205
  if (t) return;
206
206
  const c = String(V() || "").trim();
207
207
  if (!c) {
208
- h();
208
+ v();
209
209
  return;
210
210
  }
211
- r && (r.removeEventListener("badge", s), r.removeEventListener("inbox", s), r.close(), r = null);
212
- const k = new URL(e, window.location.origin);
213
- k.searchParams.set("access_token", c);
211
+ n && (n.removeEventListener("badge", s), n.removeEventListener("inbox", s), n.close(), n = null);
212
+ const B = new URL(e, window.location.origin);
213
+ B.searchParams.set("access_token", c);
214
214
  try {
215
- r = new EventSource(k.toString());
215
+ n = new EventSource(B.toString());
216
216
  } catch {
217
- h();
217
+ v();
218
218
  return;
219
219
  }
220
- r.addEventListener("badge", s), r.addEventListener("inbox", s), r.onopen = () => {
220
+ n.addEventListener("badge", s), n.addEventListener("inbox", s), n.onopen = () => {
221
221
  i = 0;
222
- }, r.onerror = () => {
223
- t || (r == null || r.close(), r = null, h());
222
+ }, n.onerror = () => {
223
+ t || (n == null || n.close(), n = null, v());
224
224
  };
225
225
  };
226
226
  return g(), () => {
227
- t = !0, m(), r && (r.removeEventListener("badge", s), r.removeEventListener("inbox", s), r.close(), r = null);
227
+ t = !0, m(), n && (n.removeEventListener("badge", s), n.removeEventListener("inbox", s), n.close(), n = null);
228
228
  };
229
229
  }, [j, V, w]), b(() => {
230
230
  W && G();
@@ -239,8 +239,8 @@ const Pt = Ge(function({
239
239
  }),
240
240
  [fe, S]
241
241
  ), re = (e, t) => {
242
- _e((r) => {
243
- const l = { ...r, [e]: t };
242
+ Ae((n) => {
243
+ const l = { ...n, [e]: t };
244
244
  return Je(l), l;
245
245
  });
246
246
  }, ae = async (e, t) => {
@@ -251,60 +251,60 @@ const Pt = Ge(function({
251
251
  $.error(l instanceof Error ? l.message : "标记已读失败");
252
252
  return;
253
253
  }
254
- const r = String(e.href || "").trim();
255
- if (r) {
256
- if (A) {
257
- A(r, e), B(!1);
254
+ const n = String(e.href || "").trim();
255
+ if (n) {
256
+ if (_) {
257
+ _(n, e), x(!1);
258
258
  return;
259
259
  }
260
- r.startsWith("http://") || r.startsWith("https://") ? window.open(r, "_blank", "noopener,noreferrer") : window.location.assign(r), B(!1);
260
+ n.startsWith("http://") || n.startsWith("https://") ? window.open(n, "_blank", "noopener,noreferrer") : window.location.assign(n), x(!1);
261
261
  }
262
262
  }, we = async (e, t) => {
263
263
  if (!t.disabled) {
264
264
  if (ce) {
265
265
  try {
266
- await ce(t.kind, e), B(!1), G(), v();
267
- } catch (r) {
268
- $.error(r instanceof Error ? r.message : "操作失败");
266
+ await ce(t.kind, e), x(!1), G(), h();
267
+ } catch (n) {
268
+ $.error(n instanceof Error ? n.message : "操作失败");
269
269
  }
270
270
  return;
271
271
  }
272
272
  await ae(e);
273
273
  }
274
274
  }, Ie = async () => {
275
- if (!(!x || S <= 0 || J)) {
275
+ if (!(!C || S <= 0 || J)) {
276
276
  ye(!0);
277
277
  try {
278
- const e = await x(), t = typeof (e == null ? void 0 : e.updated) == "number" ? e.updated : void 0;
279
- $.success(typeof t == "number" ? `已清空 ${t} 条未读` : "已清空未读"), await G(), await v();
278
+ const e = await C(), t = typeof (e == null ? void 0 : e.updated) == "number" ? e.updated : void 0;
279
+ $.success(typeof t == "number" ? `已清空 ${t} 条未读` : "已清空未读"), await G(), await h();
280
280
  } catch (e) {
281
281
  $.error(e instanceof Error ? e.message : "清空未读失败");
282
282
  } finally {
283
283
  ye(!1);
284
284
  }
285
285
  }
286
- }, Ne = p ? Ce(p.messageType) : "";
287
- return /* @__PURE__ */ d("div", { className: P(n.bellWrap, xe), children: [
286
+ }, Ne = p ? ke(p.messageType) : "";
287
+ return /* @__PURE__ */ d("div", { className: R(r.bellWrap, Ce), children: [
288
288
  /* @__PURE__ */ a(Fe, { count: S, size: "small", overflowCount: 99, offset: [-4, 4], children: /* @__PURE__ */ a(
289
289
  D,
290
290
  {
291
291
  type: "text",
292
- className: n.bellBtn,
292
+ className: r.bellBtn,
293
293
  icon: /* @__PURE__ */ a(qe, { size: 16, "aria-hidden": !0 }),
294
294
  "aria-label": S > 0 ? `站内信,${S} 条未读` : "站内信",
295
- onClick: () => B(!0)
295
+ onClick: () => x(!0)
296
296
  }
297
297
  ) }),
298
298
  p && typeof document < "u" ? Ke(
299
- /* @__PURE__ */ a("div", { className: n.toastHost, "data-testid": "inbox-live-toast-host", children: /* @__PURE__ */ d(
299
+ /* @__PURE__ */ a("div", { className: r.toastHost, "data-testid": "inbox-live-toast-host", children: /* @__PURE__ */ d(
300
300
  "div",
301
301
  {
302
- className: P(
302
+ className: R(
303
303
  "marsun-inbox-toast",
304
- n.toastNotice,
305
- p.messageType === "alert" && n.accentAlert,
306
- p.messageType === "action" && n.accentAction,
307
- p.messageType === "remind" && n.accentRemind
304
+ r.toastNotice,
305
+ p.messageType === "alert" && r.accentAlert,
306
+ p.messageType === "action" && r.accentAction,
307
+ p.messageType === "remind" && r.accentRemind
308
308
  ),
309
309
  role: "alert",
310
310
  "data-testid": "inbox-live-toast",
@@ -314,7 +314,7 @@ const Pt = Ge(function({
314
314
  "button",
315
315
  {
316
316
  type: "button",
317
- className: n.toastClose,
317
+ className: r.toastClose,
318
318
  "aria-label": "关闭",
319
319
  onClick: (e) => {
320
320
  e.stopPropagation(), ne();
@@ -322,20 +322,20 @@ const Pt = Ge(function({
322
322
  children: "×"
323
323
  }
324
324
  ),
325
- /* @__PURE__ */ d("div", { className: n.toastHead, children: [
326
- /* @__PURE__ */ a("span", { className: n.toastTitle, children: le(p.title) }),
325
+ /* @__PURE__ */ d("div", { className: r.toastHead, children: [
326
+ /* @__PURE__ */ a("span", { className: r.toastTitle, children: le(p.title) }),
327
327
  Ne ? /* @__PURE__ */ a(
328
328
  se,
329
329
  {
330
- color: ke(p.messageType),
331
- className: n.typeTag,
330
+ color: Be(p.messageType),
331
+ className: r.typeTag,
332
332
  children: Ne
333
333
  }
334
334
  ) : null
335
335
  ] }),
336
- /* @__PURE__ */ d("div", { className: n.toastBody, children: [
337
- p.summary ? /* @__PURE__ */ a("div", { className: n.toastDesc, children: le(p.summary) }) : null,
338
- /* @__PURE__ */ a("div", { className: n.toastActions, children: /* @__PURE__ */ a(
336
+ /* @__PURE__ */ d("div", { className: r.toastBody, children: [
337
+ p.summary ? /* @__PURE__ */ a("div", { className: r.toastDesc, children: le(p.summary) }) : null,
338
+ /* @__PURE__ */ a("div", { className: r.toastActions, children: /* @__PURE__ */ a(
339
339
  D,
340
340
  {
341
341
  type: "primary",
@@ -356,12 +356,12 @@ const Pt = Ge(function({
356
356
  /* @__PURE__ */ d(
357
357
  ze,
358
358
  {
359
- title: Be,
359
+ title: xe,
360
360
  open: W,
361
- onClose: () => B(!1),
361
+ onClose: () => x(!1),
362
362
  size: 420,
363
363
  destroyOnClose: !1,
364
- className: n.drawer,
364
+ className: r.drawer,
365
365
  styles: {
366
366
  header: { padding: "12px 16px" },
367
367
  body: { padding: "12px 16px" }
@@ -370,21 +370,21 @@ const Pt = Ge(function({
370
370
  /* @__PURE__ */ a(
371
371
  Ze,
372
372
  {
373
- className: n.typeTabs,
373
+ className: r.typeTabs,
374
374
  size: "small",
375
375
  activeKey: Y || "all",
376
- onChange: (e) => Pe(e === "all" ? "" : e),
376
+ onChange: (e) => Re(e === "all" ? "" : e),
377
377
  stateOption: Oe,
378
378
  isInner: !0
379
379
  }
380
380
  ),
381
- /* @__PURE__ */ d("div", { className: n.filterRow, children: [
381
+ /* @__PURE__ */ d("div", { className: r.filterRow, children: [
382
382
  /* @__PURE__ */ a(
383
383
  et,
384
384
  {
385
385
  size: "small",
386
386
  value: F,
387
- onChange: (e) => Ae(e),
387
+ onChange: (e) => _e(e),
388
388
  options: [
389
389
  { value: "all", label: "全部" },
390
390
  { value: "unread", label: "未读" },
@@ -392,12 +392,12 @@ const Pt = Ge(function({
392
392
  ]
393
393
  }
394
394
  ),
395
- x ? /* @__PURE__ */ a(
395
+ C ? /* @__PURE__ */ a(
396
396
  D,
397
397
  {
398
398
  type: "link",
399
399
  size: "small",
400
- className: n.clearUnreadBtn,
400
+ className: r.clearUnreadBtn,
401
401
  "data-testid": "inbox-clear-unread",
402
402
  loading: J,
403
403
  disabled: S <= 0 || J,
@@ -406,14 +406,14 @@ const Pt = Ge(function({
406
406
  }
407
407
  ) : null
408
408
  ] }),
409
- /* @__PURE__ */ d("div", { className: n.toastPrefs, "data-testid": "inbox-toast-prefs", children: [
410
- /* @__PURE__ */ a("div", { className: n.toastPrefsTitle, children: "消息提示" }),
411
- /* @__PURE__ */ a("p", { className: n.toastPrefsHint, children: "本机浏览器偏好,非租户策略" }),
409
+ /* @__PURE__ */ d("div", { className: r.toastPrefs, "data-testid": "inbox-toast-prefs", children: [
410
+ /* @__PURE__ */ a("div", { className: r.toastPrefsTitle, children: "消息提示" }),
411
+ /* @__PURE__ */ a("p", { className: r.toastPrefsHint, children: "本机浏览器偏好,非租户策略" }),
412
412
  /* @__PURE__ */ d(Ee, { size: 12, wrap: !0, children: [
413
413
  /* @__PURE__ */ a(
414
414
  oe,
415
415
  {
416
- checked: _.alert,
416
+ checked: A.alert,
417
417
  onChange: (e) => re("alert", e.target.checked),
418
418
  children: "预警弹出"
419
419
  }
@@ -421,7 +421,7 @@ const Pt = Ge(function({
421
421
  /* @__PURE__ */ a(
422
422
  oe,
423
423
  {
424
- checked: _.action,
424
+ checked: A.action,
425
425
  onChange: (e) => re("action", e.target.checked),
426
426
  children: "行动弹出"
427
427
  }
@@ -429,40 +429,34 @@ const Pt = Ge(function({
429
429
  /* @__PURE__ */ a(
430
430
  oe,
431
431
  {
432
- checked: _.remind,
432
+ checked: A.remind,
433
433
  onChange: (e) => re("remind", e.target.checked),
434
434
  children: "提醒弹出"
435
435
  }
436
436
  )
437
437
  ] })
438
438
  ] }),
439
- Q ? /* @__PURE__ */ a("p", { className: n.error, children: Q }) : null,
440
- /* @__PURE__ */ a("div", { className: P("inbox-bell-list-pane", n.listPane), children: /* @__PURE__ */ a(tt, { spinning: de && I.length === 0, children: !de && !Q && I.length === 0 ? /* @__PURE__ */ a(nt, { description: "暂无站内信" }) : I.length === 0 ? null : /* @__PURE__ */ d(
439
+ Q ? /* @__PURE__ */ a("p", { className: r.error, children: Q }) : null,
440
+ /* @__PURE__ */ a("div", { className: R("inbox-bell-list-pane", r.listPane), children: /* @__PURE__ */ a(tt, { spinning: de && I.length === 0, children: !de && !Q && I.length === 0 ? /* @__PURE__ */ a(nt, { description: "暂无站内信" }) : I.length === 0 ? null : /* @__PURE__ */ d(
441
441
  rt,
442
442
  {
443
- wrapperClassName: P("inbox-bell-list-scroll", n.listScroll),
444
- className: n.listViewport,
443
+ wrapperClassName: R("inbox-bell-list-scroll", r.listScroll),
444
+ className: r.listViewport,
445
445
  "data-testid": "inbox-bell-list-scroll",
446
446
  onScroll: Me,
447
447
  children: [
448
- /* @__PURE__ */ a("ul", { className: n.list, children: I.map((e) => {
449
- const t = Ce(e.messageType), r = String(e.levelLabel || e.level || "").trim(), l = !!r, i = je(e.bodyHtml), s = Ve(
448
+ /* @__PURE__ */ a("ul", { className: r.list, children: I.map((e) => {
449
+ const t = ke(e.messageType), n = String(e.levelLabel || e.level || "").trim(), l = !!n, i = je(e.bodyHtml), s = Ve(
450
450
  We(e)
451
- ), m = Qe(e), h = dt(e), g = !!s.primary;
451
+ ), m = Qe(e), v = dt(e), g = !!s.primary;
452
452
  return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ d(
453
453
  "div",
454
454
  {
455
- className: P(
456
- n.item,
457
- !e.read && n.itemUnread,
458
- m && n.itemStatic,
459
- e.messageType === "alert" && n.accentAlert,
460
- e.messageType === "action" && n.accentAction,
461
- e.messageType === "remind" && n.accentRemind
455
+ className: R(
456
+ r.item,
457
+ !e.read && r.itemUnread,
458
+ m && r.itemStatic
462
459
  ),
463
- style: e.levelColor ? {
464
- "--inbox-accent": e.levelColor
465
- } : void 0,
466
460
  role: m ? void 0 : "button",
467
461
  tabIndex: m ? void 0 : 0,
468
462
  onClick: m ? void 0 : () => void ae(e),
@@ -470,42 +464,41 @@ const Pt = Ge(function({
470
464
  (c.key === "Enter" || c.key === " ") && (c.preventDefault(), ae(e));
471
465
  },
472
466
  children: [
473
- /* @__PURE__ */ a("div", { className: n.itemRibbon, "aria-hidden": !0 }),
474
- /* @__PURE__ */ d("div", { className: n.itemHeader, children: [
475
- /* @__PURE__ */ d("span", { className: n.itemHeaderLeft, children: [
467
+ /* @__PURE__ */ d("div", { className: r.itemHeader, children: [
468
+ /* @__PURE__ */ d("span", { className: r.itemHeaderLeft, children: [
469
+ /* @__PURE__ */ a("span", { className: r.itemTitle, title: e.title || "(无标题)", children: e.title || "(无标题)" }),
476
470
  t ? /* @__PURE__ */ a(
477
471
  se,
478
472
  {
479
- color: ke(e.messageType),
480
- className: n.typeTag,
473
+ color: Be(e.messageType),
474
+ className: r.typeTag,
481
475
  children: t
482
476
  }
483
- ) : null,
484
- /* @__PURE__ */ a("span", { className: n.itemTitle, title: e.title || "(无标题)", children: e.title || "(无标题)" })
477
+ ) : null
485
478
  ] }),
486
- /* @__PURE__ */ a("span", { className: n.itemTime, children: e.createdAt || "" })
479
+ /* @__PURE__ */ a("span", { className: r.itemTime, children: e.createdAt || "" })
487
480
  ] }),
488
- /* @__PURE__ */ a("div", { className: n.itemBody, children: i ? /* @__PURE__ */ a(
481
+ /* @__PURE__ */ a("div", { className: r.itemBody, children: i ? /* @__PURE__ */ a(
489
482
  "div",
490
483
  {
491
- className: n.itemBodyHtml,
484
+ className: r.itemBodyHtml,
492
485
  dangerouslySetInnerHTML: { __html: i }
493
486
  }
494
- ) : e.summary ? /* @__PURE__ */ a("span", { className: n.itemSummary, children: le(e.summary) }) : null }),
495
- h ? /* @__PURE__ */ a("span", { className: n.itemMeta, children: h }) : null,
496
- l ? /* @__PURE__ */ a("div", { className: n.itemFooterTags, children: /* @__PURE__ */ a(
487
+ ) : e.summary ? /* @__PURE__ */ a("span", { className: r.itemSummary, children: le(e.summary) }) : null }),
488
+ v ? /* @__PURE__ */ a("span", { className: r.itemMeta, children: v }) : null,
489
+ l ? /* @__PURE__ */ a("div", { className: r.itemFooterTags, children: /* @__PURE__ */ a(
497
490
  se,
498
491
  {
499
492
  color: ut(e.levelColor),
500
493
  selected: !0,
501
- className: n.typeTag,
502
- children: r
494
+ className: r.typeTag,
495
+ children: n
503
496
  }
504
497
  ) }) : null,
505
498
  g && s.primary ? /* @__PURE__ */ a(
506
499
  "div",
507
500
  {
508
- className: n.itemActions,
501
+ className: r.itemActions,
509
502
  onClick: (c) => c.stopPropagation(),
510
503
  onKeyDown: (c) => c.stopPropagation(),
511
504
  children: /* @__PURE__ */ d(Ee, { size: 8, wrap: !0, children: [
@@ -534,7 +527,7 @@ const Pt = Ge(function({
534
527
  }
535
528
  ) }, e.id);
536
529
  }) }),
537
- De ? /* @__PURE__ */ a("p", { className: P("inbox-bell-list-footer", n.listFooter), children: "加载中…" }) : null
530
+ De ? /* @__PURE__ */ a("p", { className: R("inbox-bell-list-footer", r.listFooter), children: "加载中…" }) : null
538
531
  ]
539
532
  }
540
533
  ) }) })
@@ -545,7 +538,7 @@ const Pt = Ge(function({
545
538
  });
546
539
  export {
547
540
  Ut as DEFAULT_INBOX_TOAST_PREFS,
548
- Pt as default,
541
+ Rt as default,
549
542
  Ve as filterInboxActionsForHost,
550
543
  Dt as inboxSceneLabel,
551
544
  Qe as isInboxButtonDriven,