@parallelworks/tandem-web 0.165.0 → 0.166.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.
@@ -250,6 +250,5 @@ var ue = f(i.AddUserIcon), de = f(i.RemoveUserIcon), fe = f(i.ArchiveIcon), pe =
250
250
  i.CommitIcon;
251
251
  var _e = f(i.ReleaseIcon), ve = f(i.MegaphoneIcon), ye = f(i.SwapIcon), be = f(i.TrashIcon);
252
252
  i.EyeIcon;
253
- var xe = f(i.SuccessIcon), Se = f(i.CancelIcon), Ce = f(i.AgentIcon);
254
- i.ArrowRightIcon;
255
- export { p as AddIcon, ue as AddUserIcon, Ce as AgentIcon, J as AlertIcon, fe as ArchiveIcon, ce as AreaIcon, h as AttachmentIcon, m as BoardIcon, g as BranchIcon, A as BucketIcon, _ as CalendarIcon, Se as CancelIcon, k as ChartIcon, y as CheckIcon, b as ChevronDownIcon, x as ChevronRightIcon, v as ClockIcon, S as CloseIcon, j as CloudIcon, le as CodeHostIcon, C as CommentIcon, ie as CycleIcon, w as DownloadIcon, $ as EditIcon, se as EstimateIcon, E as ExpandIcon, D as FileTextIcon, O as FolderIcon, M as GridIcon, N as HistoryIcon, P as InboxIcon, F as KeyIcon, L as LibraryIcon, he as LinkIcon, R as ListViewIcon, z as MailIcon, ve as MegaphoneIcon, B as MigrationIcon, I as MinimizeIcon, V as NotificationIcon, ee as PriorityIcon, U as ProjectIcon, W as PullRequestIcon, _e as ReleaseIcon, de as RemoveUserIcon, me as RenameIcon, G as RepositoryIcon, pe as RestoreIcon, K as SearchIcon, te as SettingsIcon, q as ShieldIcon, Y as ShrinkIcon, ae as SidePanelIcon, c as StatusIcon, xe as SuccessIcon, ye as SwapIcon, X as TagIcon, oe as TimelineIcon, be as TrashIcon, H as TriageIcon, ge as UnlinkIcon, T as UploadIcon, Z as UserIcon, Q as UsersIcon, ne as WebhookIcon, re as WorkerIcon, u as usePriorityNames };
253
+ var xe = f(i.SuccessIcon), Se = f(i.CancelIcon), Ce = f(i.AgentIcon), we = f(i.ArrowRightIcon);
254
+ export { p as AddIcon, ue as AddUserIcon, Ce as AgentIcon, J as AlertIcon, fe as ArchiveIcon, ce as AreaIcon, we as ArrowRightIcon, h as AttachmentIcon, m as BoardIcon, g as BranchIcon, A as BucketIcon, _ as CalendarIcon, Se as CancelIcon, k as ChartIcon, y as CheckIcon, b as ChevronDownIcon, x as ChevronRightIcon, v as ClockIcon, S as CloseIcon, j as CloudIcon, le as CodeHostIcon, C as CommentIcon, ie as CycleIcon, w as DownloadIcon, $ as EditIcon, se as EstimateIcon, E as ExpandIcon, D as FileTextIcon, O as FolderIcon, M as GridIcon, N as HistoryIcon, P as InboxIcon, F as KeyIcon, L as LibraryIcon, he as LinkIcon, R as ListViewIcon, z as MailIcon, ve as MegaphoneIcon, B as MigrationIcon, I as MinimizeIcon, V as NotificationIcon, ee as PriorityIcon, U as ProjectIcon, W as PullRequestIcon, _e as ReleaseIcon, de as RemoveUserIcon, me as RenameIcon, G as RepositoryIcon, pe as RestoreIcon, K as SearchIcon, te as SettingsIcon, q as ShieldIcon, Y as ShrinkIcon, ae as SidePanelIcon, c as StatusIcon, xe as SuccessIcon, ye as SwapIcon, X as TagIcon, oe as TimelineIcon, be as TrashIcon, H as TriageIcon, ge as UnlinkIcon, T as UploadIcon, Z as UserIcon, Q as UsersIcon, ne as WebhookIcon, re as WorkerIcon, u as usePriorityNames };
@@ -0,0 +1,22 @@
1
+ // src/lib/notificationRead.ts
2
+ function e(e, t, n, r) {
3
+ let i = 0, a = e.notifications.map((e) => {
4
+ if (t && !t.includes(e.id)) return e;
5
+ if (n && !e.readAt) return i--, {
6
+ ...e,
7
+ readAt: r
8
+ };
9
+ if (!n && e.readAt) {
10
+ i++;
11
+ let { readAt: t, ...n } = e;
12
+ return n;
13
+ }
14
+ return e;
15
+ });
16
+ return {
17
+ ...e,
18
+ notifications: a,
19
+ unread: n && !t ? 0 : Math.max(0, e.unread + i)
20
+ };
21
+ }
22
+ export { e as markRead };
@@ -1,75 +1,84 @@
1
1
  import { basePath as e } from "./base.js";
2
2
  import { api as t, unwrap as n } from "../api/client.js";
3
3
  import { notificationsQuery as r, pushSettingsQuery as i } from "../api/queries.js";
4
- import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
5
- import { useTranslations as l } from "use-intl";
6
- import { useMutation as u, useQuery as d, useQueryClient as f } from "@tanstack/react-query";
4
+ import { markRead as a } from "./notificationRead.js";
5
+ import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
6
+ import { useTranslations as u } from "use-intl";
7
+ import { useMutation as d, useQuery as f, useQueryClient as p } from "@tanstack/react-query";
7
8
  // src/lib/notifications.ts
8
- function p(e) {
9
- let i = f();
10
- return u({
9
+ async function m(e, t, n, i) {
10
+ let { queryKey: o } = r(t);
11
+ await e.cancelQueries({ queryKey: o });
12
+ let s = (/* @__PURE__ */ new Date()).toISOString();
13
+ e.setQueryData(o, (e) => e && a(e, n, i, s));
14
+ }
15
+ function h(e) {
16
+ let i = p();
17
+ return d({
11
18
  mutationFn: async (r) => {
12
19
  n(await t.POST("/api/v1/notifications/read", { body: {
13
20
  workspace: e,
14
21
  ...r && { ids: r }
15
- } })), await y(r);
22
+ } })), await x(r);
16
23
  },
24
+ onMutate: (t) => m(i, e, t, !0),
17
25
  onSettled: () => i.invalidateQueries({ queryKey: r(e).queryKey })
18
26
  });
19
27
  }
20
- function m(e) {
21
- let i = f();
22
- return u({
28
+ function g(e) {
29
+ let i = p();
30
+ return d({
23
31
  mutationFn: async (r) => n(await t.POST("/api/v1/notifications/unread", { body: {
24
32
  workspace: e,
25
33
  ids: r
26
34
  } })),
35
+ onMutate: (t) => m(i, e, t, !1),
27
36
  onSettled: () => i.invalidateQueries({ queryKey: r(e).queryKey })
28
37
  });
29
38
  }
30
- function h(e) {
31
- let i = f();
32
- return u({
39
+ function _(e) {
40
+ let i = p();
41
+ return d({
33
42
  mutationFn: async (r) => {
34
43
  n(await t.POST("/api/v1/notifications/archive", { body: {
35
44
  workspace: e,
36
45
  ...r && { ids: r }
37
- } })), r && await y(r);
46
+ } })), r && await x(r);
38
47
  },
39
48
  onSettled: () => i.invalidateQueries({ queryKey: r(e).queryKey })
40
49
  });
41
50
  }
42
- function g(e, t) {
43
- let { data: n } = d(r(e)), { mutate: i } = p(e), a = s(/* @__PURE__ */ new Set()), c = t.toUpperCase(), l = (n?.notifications ?? []).filter((e) => !e.readAt && e.identifier.toUpperCase() === c && !a.current.has(e.id)).map((e) => e.id).join(",");
44
- o(() => {
51
+ function v(e, t) {
52
+ let { data: n } = f(r(e)), { mutate: i } = h(e), a = c(/* @__PURE__ */ new Set()), o = t.toUpperCase(), l = (n?.notifications ?? []).filter((e) => !e.readAt && e.identifier.toUpperCase() === o && !a.current.has(e.id)).map((e) => e.id).join(",");
53
+ s(() => {
45
54
  if (!l) return;
46
55
  let e = l.split(",");
47
56
  for (let t of e) a.current.add(t);
48
57
  i(e);
49
58
  }, [l, i]);
50
59
  }
51
- var _ = () => `${e}/`;
52
- async function v() {
53
- if ("serviceWorker" in navigator) return navigator.serviceWorker.getRegistration(_());
60
+ var y = () => `${e}/`;
61
+ async function b() {
62
+ if ("serviceWorker" in navigator) return navigator.serviceWorker.getRegistration(y());
54
63
  }
55
- async function y(e) {
56
- let t = await v();
64
+ async function x(e) {
65
+ let t = await b();
57
66
  for (let n of await t?.getNotifications() ?? []) (!e || e.includes(n.tag)) && n.close();
58
67
  }
59
- var b = () => typeof window < "u" && "serviceWorker" in navigator && "PushManager" in window && "Notification" in window;
60
- function x(e) {
68
+ var S = () => typeof window < "u" && "serviceWorker" in navigator && "PushManager" in window && "Notification" in window;
69
+ function C(e) {
61
70
  let t = e.replace(/-/g, "+").replace(/_/g, "/");
62
71
  return Uint8Array.from(atob(t + "=".repeat((4 - t.length % 4) % 4)), (e) => e.charCodeAt(0));
63
72
  }
64
- function S(e, t) {
73
+ function w(e, t) {
65
74
  let n = e.options.applicationServerKey;
66
75
  if (!n) return !1;
67
76
  let r = new Uint8Array(n);
68
77
  return r.length === t.length && r.every((e, n) => e === t[n]);
69
78
  }
70
- function C() {
71
- let e = l("notifications.push");
72
- return a(() => ({
79
+ function T() {
80
+ let e = u("notifications.push");
81
+ return o(() => ({
73
82
  title: e.raw("title"),
74
83
  decision_requested: e.raw("decision_requested"),
75
84
  assigned: e.raw("assigned"),
@@ -83,64 +92,64 @@ function C() {
83
92
  fallback: e.raw("fallback")
84
93
  }), [e]);
85
94
  }
86
- async function w(r, i) {
87
- await navigator.serviceWorker.register(`${e}/sw.js`, { scope: _() });
95
+ async function E(r, i) {
96
+ await navigator.serviceWorker.register(`${e}/sw.js`, { scope: y() });
88
97
  let a = await navigator.serviceWorker.ready;
89
98
  a.active?.postMessage({
90
99
  type: "messages",
91
100
  messages: i
92
101
  });
93
- let o = x(r), s = await a.pushManager.getSubscription();
94
- s && !S(s, o) && (await s.unsubscribe(), s = null), s ??= await a.pushManager.subscribe({
102
+ let o = C(r), s = await a.pushManager.getSubscription();
103
+ s && !w(s, o) && (await s.unsubscribe(), s = null), s ??= await a.pushManager.subscribe({
95
104
  userVisibleOnly: !0,
96
105
  applicationServerKey: o
97
106
  }), n(await t.POST("/api/v1/push/subscriptions", { body: { endpoint: s.endpoint } }));
98
107
  }
99
- function T() {
100
- let { data: e } = d(i), n = C(), [r, s] = c("off"), [l, u] = c(!1), f = a(async () => {
101
- if (!b()) return s("unsupported");
108
+ function D() {
109
+ let { data: e } = f(i), n = T(), [r, a] = l("off"), [c, u] = l(!1), d = o(async () => {
110
+ if (!S()) return a("unsupported");
102
111
  if (!e) return;
103
- if (!e.enabled) return s("unavailable");
104
- if (Notification.permission === "denied") return s("denied");
105
- let t = await (await v())?.pushManager.getSubscription();
106
- s(t && Notification.permission === "granted" ? "on" : "off");
112
+ if (!e.enabled) return a("unavailable");
113
+ if (Notification.permission === "denied") return a("denied");
114
+ let t = await (await b())?.pushManager.getSubscription();
115
+ a(t && Notification.permission === "granted" ? "on" : "off");
107
116
  }, [e]);
108
- return o(() => {
109
- f();
110
- }, [f]), {
117
+ return s(() => {
118
+ d();
119
+ }, [d]), {
111
120
  state: r,
112
- pending: l,
113
- enable: a(async () => {
121
+ pending: c,
122
+ enable: o(async () => {
114
123
  if (e?.publicKey) {
115
124
  u(!0);
116
125
  try {
117
- await Notification.requestPermission() === "granted" && await w(e.publicKey, n());
126
+ await Notification.requestPermission() === "granted" && await E(e.publicKey, n());
118
127
  } finally {
119
- u(!1), await f();
128
+ u(!1), await d();
120
129
  }
121
130
  }
122
131
  }, [
123
132
  e,
124
133
  n,
125
- f
134
+ d
126
135
  ]),
127
- disable: a(async () => {
136
+ disable: o(async () => {
128
137
  u(!0);
129
138
  try {
130
- let e = await (await v())?.pushManager.getSubscription();
139
+ let e = await (await b())?.pushManager.getSubscription();
131
140
  e && (await t.DELETE("/api/v1/push/subscriptions", { params: { query: { endpoint: e.endpoint } } }), await e.unsubscribe());
132
141
  } finally {
133
- u(!1), await f();
142
+ u(!1), await d();
134
143
  }
135
- }, [f])
144
+ }, [d])
136
145
  };
137
146
  }
138
- function E() {
139
- let { data: e } = d(i), t = C();
140
- o(() => {
141
- b() && e?.enabled && e.publicKey && Notification.permission === "granted" && v().then(async (n) => {
142
- n && await n.pushManager.getSubscription() && await w(e.publicKey, t());
147
+ function O() {
148
+ let { data: e } = f(i), t = T();
149
+ s(() => {
150
+ S() && e?.enabled && e.publicKey && Notification.permission === "granted" && b().then(async (n) => {
151
+ n && await n.pushManager.getSubscription() && await E(e.publicKey, t());
143
152
  }).catch(() => {});
144
153
  }, [e, t]);
145
154
  }
146
- export { h as useArchiveNotifications, T as usePush, E as usePushSync, g as useReadIssueNotifications, p as useReadNotifications, m as useUnreadNotifications };
155
+ export { _ as useArchiveNotifications, D as usePush, O as usePushSync, v as useReadIssueNotifications, h as useReadNotifications, g as useUnreadNotifications };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.165.0",
3
+ "version": "0.166.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -4,23 +4,23 @@ import { Route as r } from "./notifications.js";
4
4
  import { issueDecisionsQuery as i, issueQuery as a, notificationsQuery as o, teamsQuery as s } from "../../api/queries.js";
5
5
  import { parseApproval as c } from "../../lib/approval.js";
6
6
  import { copyItem as l, useLinkItems as u } from "../../lib/menus.js";
7
- import { ArchiveIcon as d, CheckIcon as f, FileTextIcon as p, InboxIcon as m, PriorityIcon as h, ProjectIcon as g, StatusIcon as _, usePriorityNames as v } from "../../components/icons.js";
8
- import { usePeople as y } from "../../lib/people.js";
9
- import { PersonHoverCard as b } from "../../components/PersonHoverCard.js";
10
- import { Editor as x } from "../../components/Editor.js";
11
- import { DecisionCard as S } from "../../components/AgentWork.js";
7
+ import { ArchiveIcon as d, ArrowRightIcon as f, CheckIcon as p, CodeHostIcon as m, CommentIcon as h, FileTextIcon as g, InboxIcon as _, PriorityIcon as v, ProjectIcon as y, StatusIcon as b, UserIcon as x, usePriorityNames as S } from "../../components/icons.js";
8
+ import { usePeople as C } from "../../lib/people.js";
9
+ import { PersonHoverCard as w } from "../../components/PersonHoverCard.js";
10
+ import { Editor as T } from "../../components/Editor.js";
11
+ import { DecisionCard as E } from "../../components/AgentWork.js";
12
12
  import { useShortcuts as ee } from "../../lib/shortcuts.js";
13
13
  import { useArchiveNotifications as te, useReadNotifications as ne, useUnreadNotifications as re } from "../../lib/notifications.js";
14
- import { plainText as C } from "../../lib/plainText.js";
15
- import { Avatar as w, Button as T, Card as E, EmptyState as D, IconButton as O, RelativeTime as k, buttonClasses as A, menuDivider as j, useOpenMenu as M } from "@parallelworks/ui";
16
- import { useEffect as ie, useMemo as N, useRef as P, useState as ae } from "react";
17
- import { useTranslations as F } from "use-intl";
18
- import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
19
- import { useQuery as z, useSuspenseQuery as oe } from "@tanstack/react-query";
20
- import { ListFilterMenu as se, useListView as B } from "@parallelworks/ui/list";
14
+ import { plainText as D } from "../../lib/plainText.js";
15
+ import { Avatar as O, Button as k, Card as A, EmptyState as j, IconButton as M, RelativeTime as N, buttonClasses as P, menuDivider as F, useOpenMenu as I } from "@parallelworks/ui";
16
+ import { useEffect as ie, useMemo as L, useRef as ae, useState as oe } from "react";
17
+ import { useTranslations as R } from "use-intl";
18
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
19
+ import { useQuery as H, useSuspenseQuery as se } from "@tanstack/react-query";
20
+ import { ListFilterMenu as ce, useListView as U } from "@parallelworks/ui/list";
21
21
  // src/routes/$workspace/notifications.tsx?tsr-split=component
22
- var V = (...e) => e.filter(Boolean).join(" ");
23
- function H(e, t) {
22
+ var W = (...e) => e.filter(Boolean).join(" ");
23
+ function le(e, t) {
24
24
  let n = /* @__PURE__ */ new Map();
25
25
  for (let r of t) {
26
26
  let t = r.projectId ? "project" : r.documentId ? "doc" : "issue", i = r.projectId ? `project:${r.projectId}` : r.documentId ? `doc:${r.documentId}` : r.identifier, a = n.get(i);
@@ -40,7 +40,7 @@ function H(e, t) {
40
40
  }
41
41
  return [...n.values()];
42
42
  }
43
- var U = {
43
+ var G = {
44
44
  decisions: ["decision_requested"],
45
45
  assigned: ["assigned"],
46
46
  comments: ["commented"],
@@ -49,9 +49,9 @@ var U = {
49
49
  updates: ["update_posted"],
50
50
  reminders: ["reminder"],
51
51
  mentions: ["mentioned"]
52
- }, W = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), G = (e) => e.slice(0, e.lastIndexOf("-"));
53
- function ce(e, t) {
54
- let n = F("notifications"), r = N(() => {
52
+ }, K = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), q = (e) => e.slice(0, e.lastIndexOf("-"));
53
+ function ue(e, t) {
54
+ let n = R("notifications"), r = L(() => {
55
55
  let e = [{
56
56
  key: "state",
57
57
  label: n("show"),
@@ -63,11 +63,11 @@ function ce(e, t) {
63
63
  }, {
64
64
  key: "kind",
65
65
  label: n("kind"),
66
- options: Object.keys(U).map((e) => ({
66
+ options: Object.keys(G).map((e) => ({
67
67
  value: e,
68
68
  label: n(`kinds.${e}`)
69
69
  })),
70
- matches: (e, t) => t.some((t) => U[t].includes(e.reason))
70
+ matches: (e, t) => t.some((t) => G[t].includes(e.reason))
71
71
  }], r = t.filter((e) => !e.archivedAt);
72
72
  return r.length > 1 && e.push({
73
73
  key: "team",
@@ -76,21 +76,21 @@ function ce(e, t) {
76
76
  value: e.key,
77
77
  label: e.name
78
78
  })),
79
- matches: (e, t) => !!e.identifier && t.includes(G(e.identifier))
79
+ matches: (e, t) => !!e.identifier && t.includes(q(e.identifier))
80
80
  }), e;
81
81
  }, [n, t]);
82
- return B({
82
+ return U({
83
83
  storageKey: `notifications:${e}`,
84
84
  columns: [],
85
85
  facets: r
86
86
  });
87
87
  }
88
- function K() {
89
- let { workspace: t } = r.useParams(), { issue: i } = r.useSearch(), a = F("notifications"), c = n(), { data: { notifications: l, unread: u } } = oe(o(t));
88
+ function J() {
89
+ let { workspace: t } = r.useParams(), { issue: i } = r.useSearch(), a = R("notifications"), c = n(), { data: { notifications: l, unread: u } } = se(o(t));
90
90
  e(u > 0 ? `${a("title")} (${u})` : a("title"));
91
- let p = ne(t), h = re(t), g = te(t), { data: _ = [] } = z(s(t)), v = ce(t, _), y = v.activeFilterCount > 0, b = (v.filters.state ?? []).includes("unread"), x = v.filters.kind ?? [], S = v.filters.team ?? [], C = N(() => {
92
- let e = l.filter((e) => (x.length === 0 || x.some((t) => U[t]?.includes(e.reason))) && (S.length === 0 || !!e.identifier && S.includes(G(e.identifier))));
93
- return H(t, e).filter((e) => !b || e.unread.length > 0 || e.key === i);
91
+ let f = ne(t), m = re(t), h = te(t), { data: g = [] } = H(s(t)), v = ue(t, g), y = v.activeFilterCount > 0, b = (v.filters.state ?? []).includes("unread"), x = v.filters.kind ?? [], S = v.filters.team ?? [], C = L(() => {
92
+ let e = l.filter((e) => (x.length === 0 || x.some((t) => G[t]?.includes(e.reason))) && (S.length === 0 || !!e.identifier && S.includes(q(e.identifier))));
93
+ return le(t, e).filter((e) => !b || e.unread.length > 0 || e.key === i);
94
94
  }, [
95
95
  t,
96
96
  l,
@@ -98,144 +98,144 @@ function K() {
98
98
  x,
99
99
  S,
100
100
  i
101
- ]), w = C.findIndex((e) => e.key === i), E = w >= 0 ? C[w] : void 0, [k, A] = ae(/* @__PURE__ */ new Set()), j = P(null), M = N(() => C.filter((e) => k.has(e.key)), [C, k]), B = (e) => {
101
+ ]), w = C.findIndex((e) => e.key === i), T = w >= 0 ? C[w] : void 0, [E, D] = oe(/* @__PURE__ */ new Set()), O = ae(null), A = L(() => C.filter((e) => E.has(e.key)), [C, E]), N = (e) => {
102
102
  c({
103
103
  to: "/$workspace/notifications",
104
104
  params: { workspace: t },
105
105
  search: e ? { issue: e.key } : {},
106
106
  replace: !0
107
- }), e && e.unread.length > 0 && p.mutate(e.unread);
108
- }, W = (e) => {
107
+ }), e && e.unread.length > 0 && f.mutate(e.unread);
108
+ }, P = (e) => {
109
109
  let t = e.flatMap((e) => e.unread);
110
- t.length > 0 ? p.mutate(t) : h.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
111
- }, K = (e) => {
112
- if (g.mutate(e.flatMap((e) => e.items.map((e) => e.id))), A(/* @__PURE__ */ new Set()), E && e.includes(E)) {
110
+ t.length > 0 ? f.mutate(t) : m.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
111
+ }, F = (e) => {
112
+ if (h.mutate(e.flatMap((e) => e.items.map((e) => e.id))), D(/* @__PURE__ */ new Set()), T && e.includes(T)) {
113
113
  let t = C.filter((t) => !e.includes(t));
114
- B(t[t.findIndex((e) => C.indexOf(e) > w)] ?? t.at(-1));
114
+ N(t[t.findIndex((e) => C.indexOf(e) > w)] ?? t.at(-1));
115
115
  }
116
- }, q = (e) => c({ to: e.href }), J = M.length > 0 ? M : E ? [E] : [], Y = (e) => A((t) => {
116
+ }, I = (e) => c({ to: e.href }), U = A.length > 0 ? A : T ? [T] : [], K = (e) => D((t) => {
117
117
  let n = new Set(t);
118
118
  return n.has(e.key) ? n.delete(e.key) : n.add(e.key), n;
119
- }), X = (e, t) => {
119
+ }), J = (e, t) => {
120
120
  let [n, r] = e < t ? [e, t] : [t, e];
121
- A(new Set(C.slice(n, r + 1).map((e) => e.key)));
122
- }, Z = (e, t) => {
121
+ D(new Set(C.slice(n, r + 1).map((e) => e.key)));
122
+ }, Y = (e, t) => {
123
123
  let n = C.indexOf(t);
124
- e.metaKey || e.ctrlKey ? (Y(t), j.current = n) : e.shiftKey ? X(j.current ?? (w >= 0 ? w : n), n) : (A(/* @__PURE__ */ new Set()), j.current = n, B(t));
125
- }, Q = (e, t) => {
124
+ e.metaKey || e.ctrlKey ? (K(t), O.current = n) : e.shiftKey ? J(O.current ?? (w >= 0 ? w : n), n) : (D(/* @__PURE__ */ new Set()), O.current = n, N(t));
125
+ }, X = (e, t) => {
126
126
  let n = Math.min(Math.max(w + e, 0), C.length - 1);
127
- t && ((j.current === null || k.size === 0) && (j.current = Math.max(w, 0)), X(j.current, n)), B(C[n]);
127
+ t && ((O.current === null || E.size === 0) && (O.current = Math.max(w, 0)), J(O.current, n)), N(C[n]);
128
128
  };
129
129
  ee({
130
- j: () => Q(1, !1),
131
- k: () => Q(-1, !1),
132
- J: () => Q(1, !0),
133
- K: () => Q(-1, !0),
134
- ArrowDown: (e) => Q(1, e.shiftKey),
135
- ArrowUp: (e) => Q(-1, e.shiftKey),
130
+ j: () => X(1, !1),
131
+ k: () => X(-1, !1),
132
+ J: () => X(1, !0),
133
+ K: () => X(-1, !0),
134
+ ArrowDown: (e) => X(1, e.shiftKey),
135
+ ArrowUp: (e) => X(-1, e.shiftKey),
136
136
  x: () => {
137
- E && (Y(E), j.current = w);
137
+ T && (K(T), O.current = w);
138
138
  },
139
- Enter: () => E && q(E),
140
- e: () => J.length > 0 && K(J),
141
- u: () => J.length > 0 && W(J),
142
- Escape: () => k.size > 0 ? A(/* @__PURE__ */ new Set()) : B(void 0)
139
+ Enter: () => T && I(T),
140
+ e: () => U.length > 0 && F(U),
141
+ u: () => U.length > 0 && P(U),
142
+ Escape: () => E.size > 0 ? D(/* @__PURE__ */ new Set()) : N(void 0)
143
143
  }), ie(() => {
144
- document.getElementById(`inbox-${E?.key}`)?.scrollIntoView({ block: "nearest" });
145
- }, [E]);
146
- let $ = {
147
- select: B,
148
- toggleRead: W,
149
- archiveGroups: K,
150
- openIssue: q,
151
- clickRow: Z,
152
- targetsOf: (e) => k.has(e.key) ? M : (A(/* @__PURE__ */ new Set()), [e])
144
+ document.getElementById(`inbox-${T?.key}`)?.scrollIntoView({ block: "nearest" });
145
+ }, [T]);
146
+ let Z = {
147
+ select: N,
148
+ toggleRead: P,
149
+ archiveGroups: F,
150
+ openIssue: I,
151
+ clickRow: Y,
152
+ targetsOf: (e) => E.has(e.key) ? A : (D(/* @__PURE__ */ new Set()), [e])
153
153
  };
154
- return /* @__PURE__ */ R("div", {
154
+ return /* @__PURE__ */ V("div", {
155
155
  className: "flex h-full flex-col",
156
156
  children: [
157
- /* @__PURE__ */ R("header", {
157
+ /* @__PURE__ */ V("header", {
158
158
  className: "@container flex min-h-12 shrink-0 flex-wrap items-center gap-2 border-b border-border px-4 py-2 md:px-5",
159
159
  children: [
160
- /* @__PURE__ */ L("h1", {
160
+ /* @__PURE__ */ B("h1", {
161
161
  className: "text-sm font-semibold",
162
162
  children: a("title")
163
163
  }),
164
- /* @__PURE__ */ L("span", {
164
+ /* @__PURE__ */ B("span", {
165
165
  className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
166
166
  children: a("unreadCount", { count: u })
167
167
  }),
168
- /* @__PURE__ */ L(se, { view: v }),
169
- u > 0 && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(T, {
168
+ /* @__PURE__ */ B(ce, { view: v }),
169
+ u > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
170
170
  type: "button",
171
171
  size: "sm",
172
- loading: p.isPending,
173
- onClick: () => p.mutate(void 0),
172
+ loading: f.isPending,
173
+ onClick: () => f.mutate(void 0),
174
174
  className: "@max-3xl:hidden",
175
175
  children: a("markAllRead")
176
- }), /* @__PURE__ */ L(O, {
177
- icon: /* @__PURE__ */ L(f, {}),
176
+ }), /* @__PURE__ */ B(M, {
177
+ icon: /* @__PURE__ */ B(p, {}),
178
178
  label: a("markAllRead"),
179
179
  size: "sm",
180
- disabled: p.isPending,
181
- onClick: () => p.mutate(void 0),
180
+ disabled: f.isPending,
181
+ onClick: () => f.mutate(void 0),
182
182
  className: "@3xl:hidden"
183
183
  })] }),
184
- C.some((e) => e.unread.length === 0) && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(T, {
184
+ C.some((e) => e.unread.length === 0) && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
185
185
  type: "button",
186
186
  size: "sm",
187
- loading: g.isPending,
188
- onClick: () => g.mutate(void 0),
187
+ loading: h.isPending,
188
+ onClick: () => h.mutate(void 0),
189
189
  className: "@max-3xl:hidden",
190
190
  children: a("archiveRead")
191
- }), /* @__PURE__ */ L(O, {
192
- icon: /* @__PURE__ */ L(d, {}),
191
+ }), /* @__PURE__ */ B(M, {
192
+ icon: /* @__PURE__ */ B(d, {}),
193
193
  label: a("archiveRead"),
194
194
  size: "sm",
195
- disabled: g.isPending,
196
- onClick: () => g.mutate(void 0),
195
+ disabled: h.isPending,
196
+ onClick: () => h.mutate(void 0),
197
197
  className: "@3xl:hidden"
198
198
  })] })
199
199
  ]
200
200
  }),
201
- M.length > 0 && /* @__PURE__ */ R("div", {
201
+ A.length > 0 && /* @__PURE__ */ V("div", {
202
202
  className: "flex min-h-9 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-human-soft px-4 py-1 text-xs md:px-5",
203
203
  children: [
204
- /* @__PURE__ */ L("span", {
204
+ /* @__PURE__ */ B("span", {
205
205
  className: "font-medium text-human",
206
- children: a("selected", { count: M.length })
206
+ children: a("selected", { count: A.length })
207
207
  }),
208
- M.length < C.length && /* @__PURE__ */ L("button", {
208
+ A.length < C.length && /* @__PURE__ */ B("button", {
209
209
  type: "button",
210
- onClick: () => A(new Set(C.map((e) => e.key))),
210
+ onClick: () => D(new Set(C.map((e) => e.key))),
211
211
  className: "hover:underline",
212
212
  children: a("selectAll", { count: C.length })
213
213
  }),
214
- /* @__PURE__ */ R("div", {
214
+ /* @__PURE__ */ V("div", {
215
215
  className: "ml-auto flex items-center gap-1.5",
216
216
  children: [
217
- /* @__PURE__ */ L(T, {
217
+ /* @__PURE__ */ B(k, {
218
218
  type: "button",
219
219
  size: "sm",
220
- onClick: () => p.mutate(M.flatMap((e) => e.unread)),
221
- disabled: M.every((e) => e.unread.length === 0),
220
+ onClick: () => f.mutate(A.flatMap((e) => e.unread)),
221
+ disabled: A.every((e) => e.unread.length === 0),
222
222
  children: a("markRead")
223
223
  }),
224
- /* @__PURE__ */ L(T, {
224
+ /* @__PURE__ */ B(k, {
225
225
  type: "button",
226
226
  size: "sm",
227
- onClick: () => h.mutate(M.flatMap((e) => e.items.map((e) => e.id))),
227
+ onClick: () => m.mutate(A.flatMap((e) => e.items.map((e) => e.id))),
228
228
  children: a("markUnread")
229
229
  }),
230
- /* @__PURE__ */ L(T, {
230
+ /* @__PURE__ */ B(k, {
231
231
  type: "button",
232
232
  size: "sm",
233
- onClick: () => K(M),
233
+ onClick: () => F(A),
234
234
  children: a("archive")
235
235
  }),
236
- /* @__PURE__ */ L("button", {
236
+ /* @__PURE__ */ B("button", {
237
237
  type: "button",
238
- onClick: () => A(/* @__PURE__ */ new Set()),
238
+ onClick: () => D(/* @__PURE__ */ new Set()),
239
239
  className: "shrink-0 px-1 hover:underline",
240
240
  children: a("clear")
241
241
  })
@@ -243,43 +243,43 @@ function K() {
243
243
  })
244
244
  ]
245
245
  }),
246
- C.length === 0 ? /* @__PURE__ */ L("div", {
246
+ C.length === 0 ? /* @__PURE__ */ B("div", {
247
247
  className: "min-h-0 flex-1 overflow-y-auto p-6",
248
- children: y ? /* @__PURE__ */ L(D, {
249
- icon: /* @__PURE__ */ L(m, {}),
248
+ children: y ? /* @__PURE__ */ B(j, {
249
+ icon: /* @__PURE__ */ B(_, {}),
250
250
  title: a("noneMatch"),
251
- action: /* @__PURE__ */ L(T, {
251
+ action: /* @__PURE__ */ B(k, {
252
252
  type: "button",
253
253
  size: "sm",
254
254
  onClick: v.clearFilters,
255
255
  children: a("showEverything")
256
256
  })
257
- }) : /* @__PURE__ */ L(D, {
258
- icon: /* @__PURE__ */ L(m, {}),
257
+ }) : /* @__PURE__ */ B(j, {
258
+ icon: /* @__PURE__ */ B(_, {}),
259
259
  title: a("emptyTitle"),
260
260
  description: a("emptyDescription")
261
261
  })
262
- }) : /* @__PURE__ */ R("div", {
262
+ }) : /* @__PURE__ */ V("div", {
263
263
  className: "flex min-h-0 flex-1",
264
- children: [/* @__PURE__ */ L("ul", {
264
+ children: [/* @__PURE__ */ B("ul", {
265
265
  "aria-label": a("title"),
266
- className: V("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", E ? "hidden" : "flex"),
267
- children: C.map((e) => /* @__PURE__ */ L(le, {
266
+ className: W("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", T ? "hidden" : "flex"),
267
+ children: C.map((e) => /* @__PURE__ */ B(de, {
268
268
  workspace: t,
269
269
  group: e,
270
- selected: e === E,
271
- picked: k.has(e.key),
272
- actions: $
270
+ selected: e === T,
271
+ picked: E.has(e.key),
272
+ actions: Z
273
273
  }, e.key))
274
- }), /* @__PURE__ */ L("div", {
275
- className: V("min-w-0 flex-1 overflow-y-auto md:block", E ? "block" : "hidden"),
276
- children: E ? /* @__PURE__ */ L(ue, {
274
+ }), /* @__PURE__ */ B("div", {
275
+ className: W("min-w-0 flex-1 overflow-y-auto md:block", T ? "block" : "hidden"),
276
+ children: T ? /* @__PURE__ */ B(Q, {
277
277
  workspace: t,
278
- group: E,
279
- actions: $
280
- }) : /* @__PURE__ */ L("div", {
278
+ group: T,
279
+ actions: Z
280
+ }) : /* @__PURE__ */ B("div", {
281
281
  className: "px-6 py-24",
282
- children: /* @__PURE__ */ L(D, {
282
+ children: /* @__PURE__ */ B(j, {
283
283
  title: a("noneSelected"),
284
284
  description: a("shortcuts")
285
285
  })
@@ -289,8 +289,8 @@ function K() {
289
289
  ]
290
290
  });
291
291
  }
292
- function q(e) {
293
- let t = F("notifications"), n = u();
292
+ function Y(e) {
293
+ let t = R("notifications"), n = u();
294
294
  return (r) => {
295
295
  let [i] = r;
296
296
  return [
@@ -305,22 +305,22 @@ function q(e) {
305
305
  onClick: () => e.archiveGroups(r)
306
306
  },
307
307
  ...r.length === 1 && i ? [
308
- j,
308
+ F,
309
309
  ...n(i.href),
310
310
  ...i.identifier ? [l(t("copyId"), i.identifier)] : []
311
311
  ] : []
312
312
  ];
313
313
  };
314
314
  }
315
- function J(e) {
316
- let { actorName: t } = y(e);
315
+ function X(e) {
316
+ let { actorName: t } = C(e);
317
317
  return (e) => e.actor.kind === "agent" && e.agentName ? e.agentName : t(e.actor);
318
318
  }
319
- function le({ workspace: e, group: n, selected: r, picked: i, actions: a }) {
320
- let o = F("notifications"), { avatarOf: s } = y(e), c = J(e), l = M(), u = q(a), d = n.items[0], f = c(d), p = n.unread.length > 0;
321
- return /* @__PURE__ */ L("li", {
319
+ function de({ workspace: e, group: n, selected: r, picked: i, actions: a }) {
320
+ let o = R("notifications"), { avatarOf: s } = C(e), c = X(e), l = I(), u = Y(a), d = n.items[0], f = c(d), p = n.unread.length > 0;
321
+ return /* @__PURE__ */ B("li", {
322
322
  id: `inbox-${n.key}`,
323
- children: /* @__PURE__ */ R(t, {
323
+ children: /* @__PURE__ */ V(t, {
324
324
  to: "/$workspace/notifications",
325
325
  params: { workspace: e },
326
326
  search: { issue: n.key },
@@ -330,89 +330,132 @@ function le({ workspace: e, group: n, selected: r, picked: i, actions: a }) {
330
330
  },
331
331
  onContextMenu: (e) => l(e, u(a.targetsOf(n))),
332
332
  "aria-current": r || void 0,
333
- className: V("relative flex gap-3 px-2 py-2.5 select-none", i ? "bg-human-soft" : V("rounded-md hover:bg-muted", r && "bg-muted")),
333
+ className: W("relative flex gap-3 px-2 py-2.5 select-none", i ? "bg-human-soft" : W("rounded-md hover:bg-muted", r && "bg-muted")),
334
334
  children: [
335
- i && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("span", {
335
+ i && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
336
336
  className: "absolute inset-y-0 left-0 w-0.5 bg-human",
337
337
  "aria-hidden": !0
338
- }), /* @__PURE__ */ L("span", {
338
+ }), /* @__PURE__ */ B("span", {
339
339
  className: "sr-only",
340
340
  children: o("picked")
341
341
  })] }),
342
- /* @__PURE__ */ L("span", {
342
+ /* @__PURE__ */ B("span", {
343
343
  className: "flex w-2 shrink-0 justify-center pt-2.5",
344
- children: p && /* @__PURE__ */ L("span", {
344
+ children: p && /* @__PURE__ */ B("span", {
345
345
  role: "img",
346
346
  "aria-label": o("unread"),
347
347
  className: "size-2 rounded-full bg-primary"
348
348
  })
349
349
  }),
350
- /* @__PURE__ */ L("span", {
351
- className: V("h-fit shrink-0 rounded-full", i && "ring-1 ring-human/40"),
352
- children: /* @__PURE__ */ L(w, {
350
+ /* @__PURE__ */ B("span", {
351
+ className: W("h-fit shrink-0 rounded-full", i && "ring-1 ring-human/40"),
352
+ children: /* @__PURE__ */ B(fe, {
353
+ notification: d,
353
354
  name: f,
354
- src: s(d.actor.kind, d.actor.handle),
355
- size: "sm",
356
- decorative: !0
355
+ src: s(d.actor.kind, d.actor.handle)
357
356
  })
358
357
  }),
359
- /* @__PURE__ */ R("span", {
358
+ /* @__PURE__ */ V("span", {
360
359
  className: "min-w-0 flex-1",
361
- children: [/* @__PURE__ */ R("span", {
360
+ children: [/* @__PURE__ */ V("span", {
362
361
  className: "flex items-baseline gap-2 text-sm",
363
- children: [
364
- /* @__PURE__ */ L($, { group: n }),
365
- /* @__PURE__ */ L("span", {
366
- className: V("flex-1 truncate", p && "font-medium"),
367
- children: n.issueTitle
368
- }),
369
- /* @__PURE__ */ L(k, {
370
- value: d.createdAt,
371
- format: "compact",
372
- exact: "medium",
373
- className: "shrink-0 text-xs text-muted-foreground"
374
- })
375
- ]
376
- }), /* @__PURE__ */ R("span", {
362
+ children: [/* @__PURE__ */ B($, {
363
+ group: n,
364
+ strong: p
365
+ }), /* @__PURE__ */ B("span", {
366
+ className: W("flex-1 truncate", p ? "font-medium text-foreground" : "text-muted-foreground"),
367
+ children: n.issueTitle
368
+ })]
369
+ }), /* @__PURE__ */ V("span", {
377
370
  className: "mt-0.5 flex gap-2 text-xs text-muted-foreground",
378
- children: [/* @__PURE__ */ R("span", {
371
+ children: [/* @__PURE__ */ V("span", {
379
372
  className: "flex-1 truncate",
380
373
  children: [o(d.reason, {
381
374
  actor: f,
382
375
  agent: d.agentName ?? f,
383
- date: W(d)
384
- }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ R(I, { children: [": ", /* @__PURE__ */ L(Z, { text: d.excerpt })] })]
385
- }), n.items.length > 1 && /* @__PURE__ */ L("span", {
376
+ date: K(d)
377
+ }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(he, { text: d.excerpt })] })]
378
+ }), n.items.length > 1 && /* @__PURE__ */ B("span", {
386
379
  className: "shrink-0",
387
380
  children: o("more", { count: n.items.length - 1 })
388
381
  })]
389
382
  })]
383
+ }),
384
+ /* @__PURE__ */ V("span", {
385
+ className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
386
+ children: [d.status && /* @__PURE__ */ V("span", {
387
+ className: "flex h-4 items-center",
388
+ children: [/* @__PURE__ */ B(b, {
389
+ category: d.status.category,
390
+ step: d.status.step
391
+ }), /* @__PURE__ */ B("span", {
392
+ className: "sr-only",
393
+ children: d.status.name
394
+ })]
395
+ }), /* @__PURE__ */ B(N, {
396
+ value: d.createdAt,
397
+ format: "compact",
398
+ exact: "medium",
399
+ className: "text-xs text-muted-foreground"
400
+ })]
390
401
  })
391
402
  ]
392
403
  })
393
404
  });
394
405
  }
395
- function Y({ workspace: e, identifier: t }) {
396
- let { data: n } = z(a(e, t)), r = v(), { nameOf: i, avatarOf: o } = y(e);
397
- return n ? /* @__PURE__ */ R("section", {
406
+ function Z(e) {
407
+ switch (e.reason) {
408
+ case "assigned": return /* @__PURE__ */ B(x, {});
409
+ case "commented":
410
+ case "mentioned": return /* @__PURE__ */ B(h, {});
411
+ case "status_changed": return e.status?.category === "completed" && e.excerpt === e.status.name ? /* @__PURE__ */ B(p, { className: "text-status-completed" }) : /* @__PURE__ */ B(f, {});
412
+ default: return null;
413
+ }
414
+ }
415
+ function fe({ notification: e, name: t, src: n }) {
416
+ let r = e.actor.kind === "connector" ? e.actor.handle.split(":")[0] : void 0, i = Z(e);
417
+ return /* @__PURE__ */ V("span", {
418
+ className: "relative flex",
419
+ children: [r === "github" || r === "gitlab" ? /* @__PURE__ */ B("span", {
420
+ className: "flex size-5 items-center justify-center rounded-full bg-muted text-foreground",
421
+ children: /* @__PURE__ */ B(m, {
422
+ provider: r,
423
+ className: "size-3.5"
424
+ })
425
+ }) : /* @__PURE__ */ B(O, {
426
+ name: t,
427
+ src: n,
428
+ kind: e.actor.kind === "agent" ? "agent" : "person",
429
+ size: "sm",
430
+ decorative: !0
431
+ }), i && /* @__PURE__ */ B("span", {
432
+ "aria-hidden": !0,
433
+ className: "absolute -right-1.5 -bottom-1.5 flex size-3.5 items-center justify-center rounded-full border border-border bg-card text-muted-foreground [&_svg]:size-2.5",
434
+ children: i
435
+ })]
436
+ });
437
+ }
438
+ function pe({ workspace: e, identifier: t }) {
439
+ let { data: n } = H(a(e, t)), r = S(), { nameOf: i, avatarOf: o } = C(e);
440
+ return n ? /* @__PURE__ */ V("section", {
398
441
  className: "mt-5 rounded-lg border border-border px-4 py-3",
399
- children: [/* @__PURE__ */ R("div", {
442
+ children: [/* @__PURE__ */ V("div", {
400
443
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",
401
444
  children: [
402
- /* @__PURE__ */ R("span", {
445
+ /* @__PURE__ */ V("span", {
403
446
  className: "inline-flex items-center gap-1.5",
404
- children: [/* @__PURE__ */ L(_, {
447
+ children: [/* @__PURE__ */ B(b, {
405
448
  category: n.status.category,
406
449
  step: n.status.step
407
450
  }), n.status.name]
408
451
  }),
409
- n.priority > 0 && /* @__PURE__ */ R("span", {
452
+ n.priority > 0 && /* @__PURE__ */ V("span", {
410
453
  className: "inline-flex items-center gap-1.5",
411
- children: [/* @__PURE__ */ L(h, { priority: n.priority }), r[n.priority]]
454
+ children: [/* @__PURE__ */ B(v, { priority: n.priority }), r[n.priority]]
412
455
  }),
413
- n.assignees.map((e) => /* @__PURE__ */ R("span", {
456
+ n.assignees.map((e) => /* @__PURE__ */ V("span", {
414
457
  className: "inline-flex items-center gap-1.5",
415
- children: [/* @__PURE__ */ L(w, {
458
+ children: [/* @__PURE__ */ B(O, {
416
459
  name: i(e.kind, e.handle),
417
460
  src: o(e.kind, e.handle),
418
461
  size: "xs",
@@ -420,57 +463,57 @@ function Y({ workspace: e, identifier: t }) {
420
463
  }), i(e.kind, e.handle)]
421
464
  }, `${e.kind}:${e.handle}`))
422
465
  ]
423
- }), n.body.trim() && /* @__PURE__ */ L("div", {
466
+ }), n.body.trim() && /* @__PURE__ */ B("div", {
424
467
  className: "mt-3 max-h-72 overflow-y-auto text-sm",
425
- children: /* @__PURE__ */ L(x, {
468
+ children: /* @__PURE__ */ B(T, {
426
469
  value: n.body,
427
470
  editable: !1
428
471
  })
429
472
  })]
430
473
  }) : null;
431
474
  }
432
- function ue({ workspace: e, group: n, actions: r }) {
433
- let i = F("notifications"), { avatarOf: a } = y(e), o = J(e), s = M(), c = q(r);
434
- return /* @__PURE__ */ R("article", {
475
+ function Q({ workspace: e, group: n, actions: r }) {
476
+ let i = R("notifications"), { avatarOf: a } = C(e), o = X(e), s = I(), c = Y(r);
477
+ return /* @__PURE__ */ V("article", {
435
478
  className: "w-full px-4 py-5 md:px-8",
436
479
  onContextMenu: (e) => s(e, c([n])),
437
480
  children: [
438
- /* @__PURE__ */ L("button", {
481
+ /* @__PURE__ */ B("button", {
439
482
  type: "button",
440
483
  onClick: () => r.select(void 0),
441
484
  className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
442
485
  children: i("back")
443
486
  }),
444
- /* @__PURE__ */ L("p", {
487
+ /* @__PURE__ */ B("p", {
445
488
  className: "text-xs text-muted-foreground",
446
- children: /* @__PURE__ */ L($, { group: n })
489
+ children: /* @__PURE__ */ B($, { group: n })
447
490
  }),
448
- /* @__PURE__ */ L("h2", {
491
+ /* @__PURE__ */ B("h2", {
449
492
  className: "mt-0.5 text-sm font-semibold",
450
- children: /* @__PURE__ */ L(t, {
493
+ children: /* @__PURE__ */ B(t, {
451
494
  to: n.href,
452
495
  className: "hover:underline",
453
496
  children: n.issueTitle
454
497
  })
455
498
  }),
456
- /* @__PURE__ */ R("div", {
499
+ /* @__PURE__ */ V("div", {
457
500
  className: "mt-3 flex flex-wrap gap-2",
458
501
  children: [
459
- /* @__PURE__ */ L(t, {
502
+ /* @__PURE__ */ B(t, {
460
503
  to: n.href,
461
- className: A({
504
+ className: P({
462
505
  variant: "primary",
463
506
  size: "sm"
464
507
  }),
465
508
  children: i(n.kind === "project" ? "openProject" : n.kind === "doc" ? "openDoc" : "openIssue")
466
509
  }),
467
- /* @__PURE__ */ L(T, {
510
+ /* @__PURE__ */ B(k, {
468
511
  type: "button",
469
512
  size: "sm",
470
513
  onClick: () => r.toggleRead([n]),
471
514
  children: n.unread.length > 0 ? i("markRead") : i("markUnread")
472
515
  }),
473
- /* @__PURE__ */ L(T, {
516
+ /* @__PURE__ */ B(k, {
474
517
  type: "button",
475
518
  size: "sm",
476
519
  onClick: () => r.archiveGroups([n]),
@@ -478,52 +521,52 @@ function ue({ workspace: e, group: n, actions: r }) {
478
521
  })
479
522
  ]
480
523
  }),
481
- n.identifier && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(Y, {
524
+ n.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(pe, {
482
525
  workspace: e,
483
526
  identifier: n.identifier
484
- }), /* @__PURE__ */ L(Q, {
527
+ }), /* @__PURE__ */ B(ge, {
485
528
  workspace: e,
486
529
  identifier: n.identifier
487
530
  })] }),
488
- /* @__PURE__ */ L(E, {
531
+ /* @__PURE__ */ B(A, {
489
532
  size: "fill",
490
533
  padding: "none",
491
534
  divided: !0,
492
535
  interactive: !1,
493
- render: /* @__PURE__ */ L("ol", {}),
536
+ render: /* @__PURE__ */ B("ol", {}),
494
537
  className: "mt-5 overflow-hidden",
495
538
  children: n.items.map((t) => {
496
539
  let n = o(t);
497
- return /* @__PURE__ */ R("li", {
540
+ return /* @__PURE__ */ V("li", {
498
541
  className: "flex gap-3 px-3 py-3",
499
- children: [/* @__PURE__ */ L(b, {
542
+ children: [/* @__PURE__ */ B(w, {
500
543
  workspace: e,
501
544
  kind: t.actor.kind,
502
545
  handle: t.actor.handle,
503
546
  className: "inline-flex shrink-0 self-start",
504
- children: /* @__PURE__ */ L(w, {
547
+ children: /* @__PURE__ */ B(O, {
505
548
  name: n,
506
549
  src: a(t.actor.kind, t.actor.handle),
507
550
  size: "sm"
508
551
  })
509
- }), /* @__PURE__ */ R("div", {
552
+ }), /* @__PURE__ */ V("div", {
510
553
  className: "min-w-0 flex-1",
511
- children: [/* @__PURE__ */ R("p", {
554
+ children: [/* @__PURE__ */ V("p", {
512
555
  className: "flex items-baseline gap-2 text-sm",
513
- children: [/* @__PURE__ */ L("span", {
514
- className: V("flex-1", !t.readAt && "font-medium"),
556
+ children: [/* @__PURE__ */ B("span", {
557
+ className: W("flex-1", !t.readAt && "font-medium"),
515
558
  children: i(t.reason, {
516
559
  actor: n,
517
560
  agent: t.agentName ?? n,
518
- date: W(t)
561
+ date: K(t)
519
562
  })
520
- }), /* @__PURE__ */ L(k, {
563
+ }), /* @__PURE__ */ B(N, {
521
564
  value: t.createdAt,
522
565
  format: "compact",
523
566
  exact: "medium",
524
567
  className: "text-xs text-muted-foreground"
525
568
  })]
526
- }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ L(X, { text: t.excerpt })]
569
+ }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(me, { text: t.excerpt })]
527
570
  })]
528
571
  }, t.id);
529
572
  })
@@ -531,58 +574,58 @@ function ue({ workspace: e, group: n, actions: r }) {
531
574
  ]
532
575
  });
533
576
  }
534
- function X({ text: e }) {
535
- let t = F("agentWork"), n = c(e);
536
- return n ? /* @__PURE__ */ R("div", {
577
+ function me({ text: e }) {
578
+ let t = R("agentWork"), n = c(e);
579
+ return n ? /* @__PURE__ */ V("div", {
537
580
  className: "mt-1 min-w-0 text-sm text-muted-foreground",
538
581
  children: [
539
- /* @__PURE__ */ L("p", { children: n.agent ? t("approveCommandFor", { agent: n.agent }) : t("approveCommand") }),
540
- /* @__PURE__ */ L("code", {
582
+ /* @__PURE__ */ B("p", { children: n.agent ? t("approveCommandFor", { agent: n.agent }) : t("approveCommand") }),
583
+ /* @__PURE__ */ B("code", {
541
584
  className: "mt-1 block rounded-md bg-muted px-2 py-1 font-mono text-xs break-all whitespace-pre-wrap text-foreground",
542
585
  children: n.command
543
586
  }),
544
- n.reason && /* @__PURE__ */ L("p", {
587
+ n.reason && /* @__PURE__ */ B("p", {
545
588
  className: "mt-1",
546
589
  children: n.reason
547
590
  })
548
591
  ]
549
- }) : /* @__PURE__ */ L("div", {
592
+ }) : /* @__PURE__ */ B("div", {
550
593
  className: "mt-1 min-w-0 text-sm text-muted-foreground",
551
- children: /* @__PURE__ */ L(x, {
594
+ children: /* @__PURE__ */ B(T, {
552
595
  value: e.replace(/<!--[\s\S]*?(-->|$)/g, "").trim(),
553
596
  editable: !1
554
597
  })
555
598
  });
556
599
  }
557
- function Z({ text: e }) {
600
+ function he({ text: e }) {
558
601
  let t = c(e);
559
- return t ? /* @__PURE__ */ L("code", {
602
+ return t ? /* @__PURE__ */ B("code", {
560
603
  className: "font-mono",
561
604
  children: t.command
562
- }) : C(e);
605
+ }) : D(e);
563
606
  }
564
- function Q({ workspace: e, identifier: t }) {
565
- let n = F("notifications"), { data: r = [] } = z(i(e, t)), a = r.filter((e) => !e.answer && !e.canceled);
566
- return a.length === 0 ? null : /* @__PURE__ */ R("section", {
607
+ function ge({ workspace: e, identifier: t }) {
608
+ let n = R("notifications"), { data: r = [] } = H(i(e, t)), a = r.filter((e) => !e.answer && !e.canceled);
609
+ return a.length === 0 ? null : /* @__PURE__ */ V("section", {
567
610
  "aria-label": n("waitingOnYou"),
568
611
  className: "mt-5 space-y-3",
569
- children: [/* @__PURE__ */ L("h3", {
612
+ children: [/* @__PURE__ */ B("h3", {
570
613
  className: "text-xs font-medium text-muted-foreground",
571
614
  children: n("waitingOnYou")
572
- }), a.map((t) => /* @__PURE__ */ L(S, {
615
+ }), a.map((t) => /* @__PURE__ */ B(E, {
573
616
  workspace: e,
574
617
  decision: t
575
618
  }, t.id))]
576
619
  });
577
620
  }
578
- function $({ group: e }) {
579
- let t = F("notifications");
580
- return e.identifier ? /* @__PURE__ */ L("span", {
581
- className: "shrink-0 text-xs text-muted-foreground",
621
+ function $({ group: e, strong: t = !1 }) {
622
+ let n = R("notifications"), r = t ? "font-medium text-foreground" : "text-muted-foreground";
623
+ return e.identifier ? /* @__PURE__ */ B("span", {
624
+ className: W("shrink-0 text-xs", r),
582
625
  children: e.identifier
583
- }) : /* @__PURE__ */ R("span", {
584
- className: "inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
585
- children: [e.kind === "doc" ? /* @__PURE__ */ L(p, { className: "size-3" }) : /* @__PURE__ */ L(g, { className: "size-3" }), t(e.kind === "doc" ? "aboutDoc" : "aboutProject")]
626
+ }) : /* @__PURE__ */ V("span", {
627
+ className: W("inline-flex shrink-0 items-center gap-1 text-xs", r),
628
+ children: [e.kind === "doc" ? /* @__PURE__ */ B(g, { className: "size-3" }) : /* @__PURE__ */ B(y, { className: "size-3" }), n(e.kind === "doc" ? "aboutDoc" : "aboutProject")]
586
629
  });
587
630
  }
588
- export { K as component };
631
+ export { J as component };