@nivaro/react 0.3.67 β†’ 0.3.68

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 (26) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +836 -835
  5. package/dist/shared/components/ConformanceView.js +34 -34
  6. package/dist/shared/components/ReportView.js +196 -196
  7. package/dist/shared/components/SlaRulesView.js +36 -36
  8. package/dist/shared/components/chat/ChatPanel.js +484 -487
  9. package/dist/shared/components/chat/ChatViews.js +66 -66
  10. package/dist/shared/components/chat/RoomParts.js +159 -157
  11. package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
  12. package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
  13. package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
  14. package/dist/shared/components/item-edit/FieldRow.js +87 -87
  15. package/dist/shared/components/item-edit/FilePickerField.js +281 -297
  16. package/dist/shared/components/item-edit/RecordInsights.js +90 -91
  17. package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
  18. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
  19. package/dist/shared/components/panels/AddendumPanel.js +409 -411
  20. package/dist/shared/components/panels/CommentPanel.js +169 -162
  21. package/dist/shared/components/panels/PipelinePanel.js +75 -75
  22. package/dist/shared/components/panels/RevisionsPanel.js +103 -103
  23. package/dist/shared/components/queue/QueueWorklist.js +142 -141
  24. package/dist/shared/lib/format-value.js +15 -15
  25. package/dist/shared/lib/utils.js +58 -53
  26. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
1
  import { jsxs as s, jsx as e, Fragment as Y } from "react/jsx-runtime";
2
- import { useQueryClient as ve, useQuery as z, useMutation as A } from "@tanstack/react-query";
3
- import { MessageSquare as De, ChevronDown as Te, ClipboardPlus as Pe, Pencil as Fe, Trash2 as Re, Check as Me, X as Ie, SmilePlus as ke } from "lucide-react";
2
+ import { useQueryClient as ke, useQuery as z, useMutation as A } from "@tanstack/react-query";
3
+ import { MessageSquare as Te, ChevronDown as Pe, ClipboardPlus as Fe, Pencil as Re, Trash2 as Me, Check as Ie, X as je, SmilePlus as Ne } from "lucide-react";
4
4
  import { useState as N, useRef as U, useEffect as Q, useMemo as V } from "react";
5
- import { createPortal as je } from "react-dom";
5
+ import { createPortal as Oe } from "react-dom";
6
6
  import { toast as I } from "sonner";
7
- import { useNivaroClient as oe, useItemEditAuth as Oe, useDrilldown as Ae } from "../../context.js";
8
- import { useDebounced as Le } from "../../hooks/useDebounced.js";
9
- import { get as W, post as B, patch as Ke, del as Be } from "../../lib/commands.js";
10
- import { usePresenceOnlinePoll as Qe } from "../../lib/presence-live.js";
11
- import { useRecordSignalPeers as ze, useRecordSignalSender as Ue, signalSentence as We } from "../../lib/presence-signals.js";
12
- import { invalidateRecordTasks as Ge } from "../../lib/record-tasks.js";
13
- import { formatRelative as le, titleCase as He, formatDateTime as Xe } from "../../lib/utils.js";
7
+ import { useNivaroClient as oe, useItemEditAuth as Ae, useDrilldown as Le } from "../../context.js";
8
+ import { useDebounced as Ke } from "../../hooks/useDebounced.js";
9
+ import { get as W, post as B, patch as Be, del as Qe } from "../../lib/commands.js";
10
+ import { usePresenceOnlinePoll as ze } from "../../lib/presence-live.js";
11
+ import { useRecordSignalPeers as Ue, useRecordSignalSender as We, signalSentence as Ge } from "../../lib/presence-signals.js";
12
+ import { invalidateRecordTasks as He } from "../../lib/record-tasks.js";
13
+ import { formatRelative as le, formatDateTime as ie, titleCase as Xe } from "../../lib/utils.js";
14
14
  import { AgentBadge as Je } from "../AgentBadge.js";
15
15
  import { AutolinkedText as se } from "../AutolinkedText.js";
16
16
  import { InboundRequestPopover as Ve } from "../integrations/InboundRequest.js";
@@ -18,11 +18,11 @@ import { useFieldComments as Ze } from "../item-edit/field-comments-context.js";
18
18
  import { UserAvatar as Ye } from "../UserAvatar.js";
19
19
  import { Avatar as et, AvatarFallback as tt } from "../ui/avatar.js";
20
20
  import { Button as Z } from "../ui/button.js";
21
- import { Separator as fe } from "../ui/separator.js";
22
- import { Textarea as nt } from "../ui/textarea.js";
23
- import { RecordEventPathSheet as rt } from "./IntegrationActivitySection.js";
24
- const Ne = ["πŸ‘", "βœ…", "πŸ‘€", "πŸŽ‰", "❀️", "πŸ˜‚"];
25
- function at(t) {
21
+ import { Separator as ge } from "../ui/separator.js";
22
+ import { Textarea as at } from "../ui/textarea.js";
23
+ import { RecordEventPathSheet as nt } from "./IntegrationActivitySection.js";
24
+ const we = ["πŸ‘", "βœ…", "πŸ‘€", "πŸŽ‰", "❀️", "πŸ˜‚"];
25
+ function rt(t) {
26
26
  var d, c, h, m;
27
27
  return [(d = t.first_name) == null ? void 0 : d[0], (c = t.last_name) == null ? void 0 : c[0]].filter(Boolean).join("").toUpperCase() || ((m = (h = t.email) == null ? void 0 : h[0]) == null ? void 0 : m.toUpperCase()) || "?";
28
28
  }
@@ -44,7 +44,7 @@ function st({ comment: t }) {
44
44
  "span",
45
45
  {
46
46
  "data-mention-seen": d.seen_at ? "seen" : "unseen",
47
- title: d.seen_at ? `Seen ${Xe(d.seen_at)}` : "Not seen yet",
47
+ title: d.seen_at ? `Seen ${ie(d.seen_at)}` : "Not seen yet",
48
48
  className: d.seen_at ? "text-emerald-600 dark:text-emerald-400" : "text-slate-400",
49
49
  children: [
50
50
  d.seen_at ? "βœ“ " : "",
@@ -58,7 +58,7 @@ function st({ comment: t }) {
58
58
  }
59
59
  );
60
60
  }
61
- function re(t) {
61
+ function ne(t) {
62
62
  return [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email;
63
63
  }
64
64
  function ot({
@@ -88,22 +88,22 @@ function lt(t, l) {
88
88
  const c = t.slice(0, l).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
89
89
  return c ? { start: l - c[2].length - 1, query: c[2] } : null;
90
90
  }
91
- function ge(t) {
91
+ function ye(t) {
92
92
  return t.email.split("@")[0];
93
93
  }
94
- function ae({
94
+ function re({
95
95
  value: t,
96
96
  onChange: l,
97
97
  ...d
98
98
  }) {
99
- const c = oe(), h = U(null), [m, C] = N(null), [y, w] = N(0), v = Le((m == null ? void 0 : m.query) ?? "", 200), { data: q = [] } = z({
99
+ const c = oe(), h = U(null), [m, C] = N(null), [y, w] = N(0), v = Ke((m == null ? void 0 : m.query) ?? "", 200), { data: q = [] } = z({
100
100
  queryKey: ["users", "mention-search", v],
101
101
  queryFn: () => c.request(
102
102
  W("/users", { limit: 8, sort: "first_name", search: v })
103
- ).then((n) => n.data),
103
+ ).then((a) => a.data),
104
104
  enabled: !!m && v.length >= 2,
105
105
  staleTime: 3e4
106
- }), F = Qe(15e3, !!m), { data: E } = z({
106
+ }), F = ze(15e3, !!m), { data: E } = z({
107
107
  queryKey: ["presence-online"],
108
108
  queryFn: () => c.request(
109
109
  W("/presence/online")
@@ -111,25 +111,25 @@ function ae({
111
111
  enabled: !!m,
112
112
  refetchInterval: F,
113
113
  staleTime: 5e3
114
- }), _ = (n) => {
114
+ }), _ = (a) => {
115
115
  var p;
116
- const i = (p = E == null ? void 0 : E.data) == null ? void 0 : p.find((b) => String(b.user_id).toUpperCase() === n.toUpperCase());
116
+ const i = (p = E == null ? void 0 : E.data) == null ? void 0 : p.find((b) => String(b.user_id).toUpperCase() === a.toUpperCase());
117
117
  return i ? i.is_idle || i.away ? 1 : 0 : 2;
118
- }, u = [...q].sort((n, i) => _(n.id) - _(i.id)), { data: D = [] } = z({
118
+ }, u = [...q].sort((a, i) => _(a.id) - _(i.id)), { data: D = [] } = z({
119
119
  queryKey: ["mention-roles"],
120
- queryFn: () => c.request(W("/chat/roles")).then((n) => n.data).catch(() => []),
120
+ queryFn: () => c.request(W("/chat/roles")).then((a) => a.data).catch(() => []),
121
121
  enabled: !!m,
122
122
  staleTime: 5 * 6e4
123
123
  }), S = m ? D.filter(
124
- (n) => n.name.toLowerCase().replace(/\s+/g, "-").startsWith(v.toLowerCase())
124
+ (a) => a.name.toLowerCase().replace(/\s+/g, "-").startsWith(v.toLowerCase())
125
125
  ).slice(0, 3) : [], k = !!m && v.length >= 2 && "owners".startsWith(v.toLowerCase()), T = !!m && v.length >= 2 && (u.length > 0 || k || S.length > 0), o = u.length + (k ? 1 : 0) + S.length, [f, $] = N(null), O = U(null);
126
126
  Q(() => {
127
127
  if (!T || !h.current) {
128
128
  $(null);
129
129
  return;
130
130
  }
131
- const n = h.current.getBoundingClientRect();
132
- $({ top: n.bottom + 4, left: n.left, width: Math.min(n.width, 360) });
131
+ const a = h.current.getBoundingClientRect();
132
+ $({ top: a.bottom + 4, left: a.left, width: Math.min(a.width, 360) });
133
133
  const i = (b) => {
134
134
  var g;
135
135
  (g = O.current) != null && g.contains(b.target) || C(null);
@@ -138,13 +138,13 @@ function ae({
138
138
  window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", p);
139
139
  };
140
140
  }, [T]);
141
- function G(n) {
142
- const i = lt(n.value, n.selectionStart ?? n.value.length);
141
+ function G(a) {
142
+ const i = lt(a.value, a.selectionStart ?? a.value.length);
143
143
  C(i), i || w(0);
144
144
  }
145
- function P(n) {
145
+ function P(a) {
146
146
  if (!m || !h.current) return;
147
- const i = h.current.selectionStart ?? t.length, p = n === "__owners__" ? "@owners " : typeof n == "object" && "role" in n ? `@${n.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${ge(n)} `, b = t.slice(0, m.start) + p + t.slice(i);
147
+ const i = h.current.selectionStart ?? t.length, p = a === "__owners__" ? "@owners " : typeof a == "object" && "role" in a ? `@${a.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${ye(a)} `, b = t.slice(0, m.start) + p + t.slice(i);
148
148
  l(b), C(null), w(0);
149
149
  const g = m.start + p.length;
150
150
  requestAnimationFrame(() => {
@@ -152,38 +152,38 @@ function ae({
152
152
  (j = h.current) == null || j.focus(), (L = h.current) == null || L.setSelectionRange(g, g);
153
153
  });
154
154
  }
155
- function H(n) {
155
+ function H(a) {
156
156
  if (T)
157
- if (n.key === "ArrowDown")
158
- n.preventDefault(), w((i) => (i + 1) % o);
159
- else if (n.key === "ArrowUp")
160
- n.preventDefault(), w((i) => (i - 1 + o) % o);
161
- else if (n.key === "Enter" || n.key === "Tab") {
162
- n.preventDefault();
157
+ if (a.key === "ArrowDown")
158
+ a.preventDefault(), w((i) => (i + 1) % o);
159
+ else if (a.key === "ArrowUp")
160
+ a.preventDefault(), w((i) => (i - 1 + o) % o);
161
+ else if (a.key === "Enter" || a.key === "Tab") {
162
+ a.preventDefault();
163
163
  const i = Math.min(y, o - 1), p = k ? 1 : 0, b = p + u.length;
164
164
  if (k && i === 0) P("__owners__");
165
165
  else if (i >= b) {
166
166
  const g = S[i - b];
167
167
  g && P({ role: g.name });
168
168
  } else P(u[i - p]);
169
- } else n.key === "Escape" && (n.preventDefault(), C(null));
169
+ } else a.key === "Escape" && (a.preventDefault(), C(null));
170
170
  }
171
171
  return /* @__PURE__ */ s("div", { className: "relative", children: [
172
172
  /* @__PURE__ */ e(
173
- nt,
173
+ at,
174
174
  {
175
175
  ...d,
176
176
  ref: h,
177
177
  value: t,
178
- onChange: (n) => {
179
- l(n.target.value), G(n.target);
178
+ onChange: (a) => {
179
+ l(a.target.value), G(a.target);
180
180
  },
181
181
  onKeyDown: H,
182
- onClick: (n) => G(n.currentTarget),
182
+ onClick: (a) => G(a.currentTarget),
183
183
  onBlur: () => setTimeout(() => C(null), 150)
184
184
  }
185
185
  ),
186
- T && f && je(
186
+ T && f && Oe(
187
187
  /* @__PURE__ */ s(
188
188
  "div",
189
189
  {
@@ -191,14 +191,14 @@ function ae({
191
191
  "data-mention-menu": "",
192
192
  className: "fixed z-[110] max-h-60 overflow-y-auto rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-popover",
193
193
  style: { top: f.top, left: f.left, width: f.width },
194
- onMouseDown: (n) => n.preventDefault(),
194
+ onMouseDown: (a) => a.preventDefault(),
195
195
  children: [
196
196
  k && /* @__PURE__ */ s(
197
197
  "button",
198
198
  {
199
199
  type: "button",
200
- onMouseDown: (n) => {
201
- n.preventDefault(), P("__owners__");
200
+ onMouseDown: (a) => {
201
+ a.preventDefault(), P("__owners__");
202
202
  },
203
203
  onMouseEnter: () => w(0),
204
204
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${y === 0 ? "bg-nvr-cyan/10" : ""}`,
@@ -211,70 +211,70 @@ function ae({
211
211
  ]
212
212
  }
213
213
  ),
214
- u.map((n, i) => {
214
+ u.map((a, i) => {
215
215
  var g, j;
216
- const p = k ? i + 1 : i, b = [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email;
216
+ const p = k ? i + 1 : i, b = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email;
217
217
  return /* @__PURE__ */ s(
218
218
  "button",
219
219
  {
220
220
  type: "button",
221
221
  onMouseDown: (L) => {
222
- L.preventDefault(), P(n);
222
+ L.preventDefault(), P(a);
223
223
  },
224
224
  onMouseEnter: () => w(p),
225
225
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${p === y ? "bg-nvr-cyan/10" : ""}`,
226
226
  children: [
227
227
  /* @__PURE__ */ s("span", { className: "relative flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy/80 dark:text-nvr-cyan", children: [
228
- (`${((g = n.first_name) == null ? void 0 : g[0]) ?? ""}${((j = n.last_name) == null ? void 0 : j[0]) ?? ""}`.trim() || n.email[0]).toUpperCase(),
229
- _(n.id) < 2 && /* @__PURE__ */ e(
228
+ (`${((g = a.first_name) == null ? void 0 : g[0]) ?? ""}${((j = a.last_name) == null ? void 0 : j[0]) ?? ""}`.trim() || a.email[0]).toUpperCase(),
229
+ _(a.id) < 2 && /* @__PURE__ */ e(
230
230
  "span",
231
231
  {
232
- "data-mention-presence": _(n.id) === 0 ? "online" : "idle",
233
- title: _(n.id) === 0 ? "Online" : "Idle",
234
- className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${_(n.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
232
+ "data-mention-presence": _(a.id) === 0 ? "online" : "idle",
233
+ title: _(a.id) === 0 ? "Online" : "Idle",
234
+ className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${_(a.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
235
235
  }
236
236
  )
237
237
  ] }),
238
238
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
239
239
  /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: b }),
240
240
  /* @__PURE__ */ s("span", { className: "block truncate text-[11px] text-slate-400", children: [
241
- n.is_out_of_office && /* @__PURE__ */ s("span", { className: "mr-1 rounded bg-amber-100 px-1 py-px text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: [
241
+ a.is_out_of_office && /* @__PURE__ */ s("span", { className: "mr-1 rounded bg-amber-100 px-1 py-px text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: [
242
242
  "OOO",
243
- n.ooo_end ? ` until ${String(n.ooo_end).slice(0, 10)}` : ""
243
+ a.ooo_end ? ` until ${String(a.ooo_end).slice(0, 10)}` : ""
244
244
  ] }),
245
245
  "@",
246
- ge(n),
247
- (n.title || n.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
246
+ ye(a),
247
+ (a.title || a.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
248
248
  " Β· ",
249
- [n.title, n.department].filter(Boolean).join(", ")
249
+ [a.title, a.department].filter(Boolean).join(", ")
250
250
  ] })
251
251
  ] })
252
252
  ] })
253
253
  ]
254
254
  },
255
- n.id
255
+ a.id
256
256
  );
257
257
  }),
258
- S.map((n, i) => {
258
+ S.map((a, i) => {
259
259
  const p = u.length + (k ? 1 : 0) + i;
260
260
  return /* @__PURE__ */ s(
261
261
  "button",
262
262
  {
263
263
  type: "button",
264
264
  onMouseDown: (b) => {
265
- b.preventDefault(), P({ role: n.name });
265
+ b.preventDefault(), P({ role: a.name });
266
266
  },
267
267
  onMouseEnter: () => w(p),
268
268
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${p === y ? "bg-nvr-cyan/10" : ""}`,
269
269
  children: [
270
270
  /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-500/15 text-[10px] font-semibold text-violet-600 dark:text-violet-300", children: "R" }),
271
271
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
272
- /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: n.name }),
272
+ /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: a.name }),
273
273
  /* @__PURE__ */ e("span", { className: "block text-[11px] text-slate-400", children: "Role β€” notifies every member" })
274
274
  ] })
275
275
  ]
276
276
  },
277
- `role-${n.id}`
277
+ `role-${a.id}`
278
278
  );
279
279
  })
280
280
  ]
@@ -284,7 +284,7 @@ function ae({
284
284
  )
285
285
  ] });
286
286
  }
287
- function ye(t) {
287
+ function ve(t) {
288
288
  if (t.kind === "comment") return "people";
289
289
  switch (t.note.source) {
290
290
  case "note":
@@ -312,7 +312,7 @@ function mt({
312
312
  item: d
313
313
  }) {
314
314
  var T;
315
- const c = Ae(), [h, m] = N(!1), C = t.source === "external" && !!t.provider && !t.provider.startsWith(ct), y = oe(), w = ve(), [v, q] = N(!1), F = A({
315
+ const c = Le(), [h, m] = N(!1), C = t.source === "external" && !!t.provider && !t.provider.startsWith(ct), y = oe(), w = ke(), [v, q] = N(!1), F = A({
316
316
  mutationFn: (o) => y.request(B(`/comments/${t.comment_id}/reactions`, { emoji: o })),
317
317
  onSuccess: () => {
318
318
  q(!1), w.invalidateQueries({ queryKey: ["comments-related"] }), w.invalidateQueries({ queryKey: ["row-comment-counts"] });
@@ -373,7 +373,7 @@ function mt({
373
373
  children: t.context
374
374
  }
375
375
  ) : /* @__PURE__ */ e("span", { className: "truncate text-[11px] text-slate-400", children: t.context })),
376
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: le(t.created_at) }),
376
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", "data-tip": ie(t.created_at), children: le(t.created_at) }),
377
377
  t.source === "inbound" && t.inbound && /* @__PURE__ */ e(
378
378
  Ve,
379
379
  {
@@ -443,10 +443,10 @@ function mt({
443
443
  onClick: () => q((o) => !o),
444
444
  className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
445
445
  "aria-label": "Add reaction",
446
- children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
446
+ children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
447
447
  }
448
448
  ),
449
- v && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: Ne.map((o) => /* @__PURE__ */ e(
449
+ v && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: we.map((o) => /* @__PURE__ */ e(
450
450
  "button",
451
451
  {
452
452
  type: "button",
@@ -460,7 +460,7 @@ function mt({
460
460
  ] })
461
461
  ] }),
462
462
  C && t.provider && /* @__PURE__ */ e(
463
- rt,
463
+ nt,
464
464
  {
465
465
  target: h ? {
466
466
  source: t.provider,
@@ -482,7 +482,7 @@ function Mt({
482
482
  onQueueComment: m,
483
483
  onUnsentDraft: C
484
484
  }) {
485
- const y = oe(), { userId: w } = Oe(), v = ve(), q = Ze(), [F, E] = N(!1), _ = U(!1);
485
+ const y = oe(), { userId: w } = Ae(), v = ke(), q = Ze(), [F, E] = N(!1), _ = U(!1);
486
486
  Q(() => {
487
487
  !_.current && c !== void 0 && (_.current = !0, E(c));
488
488
  }, [c]);
@@ -496,16 +496,16 @@ function Mt({
496
496
  if (!(!u.trim() || k)) {
497
497
  T(!0);
498
498
  try {
499
- const a = await y.request(
499
+ const n = await y.request(
500
500
  B("/ai/cleanup", { text: u })
501
501
  );
502
- (r = a.data) != null && r.text && D(a.data.text);
502
+ (r = n.data) != null && r.text && D(n.data.text);
503
503
  } catch {
504
504
  } finally {
505
505
  T(!1);
506
506
  }
507
507
  }
508
- }, f = ze(t, l, "note"), $ = Ue(t, l, "note"), O = U(0);
508
+ }, f = Ue(t, l, "note"), $ = We(t, l, "note"), O = U(0);
509
509
  Q(() => {
510
510
  if (!u.trim()) {
511
511
  O.current && $("stop"), O.current = 0;
@@ -514,49 +514,49 @@ function Mt({
514
514
  const r = Date.now();
515
515
  r - O.current < 2500 || (O.current = r, $("start"));
516
516
  }, [u, $]), Q(() => () => $("stop"), [$]);
517
- const [G, P] = N(null), [H, n] = N(null), [i, p] = N(""), b = !l || l === "new", g = ["comments", t, String(l)], { data: j, isLoading: L, isError: we } = z({
517
+ const [G, P] = N(null), [H, a] = N(null), [i, p] = N(""), b = !l || l === "new", g = ["comments", t, String(l)], { data: j, isLoading: L, isError: _e } = z({
518
518
  queryKey: g,
519
519
  queryFn: () => y.request(W("/comments", { collection: t, item: l })).then((r) => r.data),
520
520
  enabled: !b
521
- }), ie = V(() => (j ?? []).filter((r) => !r.deleted), [j]), { data: _e } = z({
521
+ }), de = V(() => (j ?? []).filter((r) => !r.deleted), [j]), { data: Ce } = z({
522
522
  queryKey: ["comments-related", t, String(l)],
523
523
  queryFn: () => y.request(W("/comments/related", { collection: t, item: l })).then((r) => r.data ?? []).catch(() => []),
524
524
  enabled: !b,
525
525
  staleTime: 3e4
526
- }), de = _e ?? [], R = V(() => {
527
- const r = ie.map((x) => ({ kind: "comment", at: x.created_at, comment: x })), a = de.map((x) => ({ kind: "related", at: x.created_at, note: x }));
528
- return [...r, ...a].sort((x, K) => new Date(K.at).getTime() - new Date(x.at).getTime());
529
- }, [ie, de]), [X, Ce] = N(() => /* @__PURE__ */ new Set()), [J, Se] = N(""), ce = V(() => {
526
+ }), ce = Ce ?? [], R = V(() => {
527
+ const r = de.map((x) => ({ kind: "comment", at: x.created_at, comment: x })), n = ce.map((x) => ({ kind: "related", at: x.created_at, note: x }));
528
+ return [...r, ...n].sort((x, K) => new Date(K.at).getTime() - new Date(x.at).getTime());
529
+ }, [de, ce]), [X, Se] = N(() => /* @__PURE__ */ new Set()), [J, $e] = N(""), me = V(() => {
530
530
  const r = { people: 0, system: 0, integration: 0 };
531
- for (const a of R) r[ye(a)]++;
531
+ for (const n of R) r[ve(n)]++;
532
532
  return r;
533
- }, [R]), me = b ? (h ?? []).length : ce.people, ee = V(() => {
533
+ }, [R]), ue = b ? (h ?? []).length : me.people, ee = V(() => {
534
534
  const r = J.trim().toLowerCase();
535
- return R.filter((a) => X.has(ye(a)) ? !1 : r ? (a.kind === "comment" ? `${a.comment.text} ${re(a.comment.user)}` : `${a.note.text} ${a.note.user_name ?? ""} ${a.note.label} ${a.note.context ?? ""} ${a.note.provider ?? ""}`).toLowerCase().includes(r) : !0);
536
- }, [R, X, J]), $e = (r) => Ce((a) => {
537
- const x = new Set(a);
535
+ return R.filter((n) => X.has(ve(n)) ? !1 : r ? (n.kind === "comment" ? `${n.comment.text} ${ne(n.comment.user)}` : `${n.note.text} ${n.note.user_name ?? ""} ${n.note.label} ${n.note.context ?? ""} ${n.note.provider ?? ""}`).toLowerCase().includes(r) : !0);
536
+ }, [R, X, J]), qe = (r) => Se((n) => {
537
+ const x = new Set(n);
538
538
  return x.has(r) ? x.delete(r) : x.add(r), x;
539
- }), qe = X.size > 0 || J.trim() !== "", te = A({
539
+ }), Ee = X.size > 0 || J.trim() !== "", te = A({
540
540
  mutationFn: (r) => y.request(B("/comments", { collection: t, item: l, text: r })),
541
541
  onSuccess: () => {
542
542
  v.invalidateQueries({ queryKey: g }), D("");
543
543
  },
544
544
  onError: () => I.error("Failed to post comment")
545
- }), ue = A({
546
- mutationFn: ({ id: r, text: a }) => y.request(Ke(`/comments/${r}`, { text: a })),
545
+ }), pe = A({
546
+ mutationFn: ({ id: r, text: n }) => y.request(Be(`/comments/${r}`, { text: n })),
547
547
  onSuccess: () => {
548
548
  v.invalidateQueries({ queryKey: g }), P(null), p("");
549
549
  },
550
550
  onError: () => I.error("Failed to update comment")
551
- }), ne = A({
552
- mutationFn: (r) => y.request(Be(`/comments/${r}`)),
551
+ }), ae = A({
552
+ mutationFn: (r) => y.request(Qe(`/comments/${r}`)),
553
553
  onSuccess: () => v.invalidateQueries({ queryKey: g }),
554
554
  onError: () => I.error("Failed to delete comment")
555
- }), pe = A({
556
- mutationFn: ({ id: r, emoji: a }) => y.request(B(`/comments/${r}/reactions`, { emoji: a })),
555
+ }), xe = A({
556
+ mutationFn: ({ id: r, emoji: n }) => y.request(B(`/comments/${r}/reactions`, { emoji: n })),
557
557
  onSuccess: () => v.invalidateQueries({ queryKey: g }),
558
558
  onError: () => I.error("Failed to react")
559
- }), [xe, he] = N(null), Ee = A({
559
+ }), [he, be] = N(null), De = A({
560
560
  mutationFn: (r) => y.request(
561
561
  B("/tasks", {
562
562
  collection: t,
@@ -566,11 +566,11 @@ function Mt({
566
566
  })
567
567
  ),
568
568
  onSuccess: () => {
569
- Ge(v, t, l), I.success("Task created from comment β€” assigned to you");
569
+ He(v, t, l), I.success("Task created from comment β€” assigned to you");
570
570
  },
571
571
  onError: () => I.error("Could not create a task")
572
572
  });
573
- function be(r) {
573
+ function fe(r) {
574
574
  r.preventDefault(), u.trim() && (b && m ? (m(u.trim()), D("")) : te.mutate(u.trim()));
575
575
  }
576
576
  return (
@@ -592,28 +592,28 @@ function Mt({
592
592
  className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
593
593
  children: [
594
594
  /* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
595
- /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
595
+ /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
596
596
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: d || "Comments" }),
597
- me > 0 && /* @__PURE__ */ e(
597
+ ue > 0 && /* @__PURE__ */ e(
598
598
  "span",
599
599
  {
600
600
  className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400",
601
601
  "data-notes-badge": !0,
602
- children: me
602
+ children: ue
603
603
  }
604
604
  ),
605
605
  /* @__PURE__ */ e(
606
- Te,
606
+ Pe,
607
607
  {
608
608
  className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${F ? " rotate-180" : ""}`
609
609
  }
610
610
  )
611
611
  ] }),
612
612
  !F && !b && R.length > 0 && (() => {
613
- const r = R[0], a = r.kind === "comment" ? re(r.comment.user) : r.note.user_name ?? "System", x = dt(r);
613
+ const r = R[0], n = r.kind === "comment" ? ne(r.comment.user) : r.note.user_name ?? "System", x = dt(r);
614
614
  return x ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
615
615
  /* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
616
- a,
616
+ n,
617
617
  ":"
618
618
  ] }),
619
619
  " ",
@@ -624,9 +624,9 @@ function Mt({
624
624
  }
625
625
  ),
626
626
  F && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: b ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
627
- /* @__PURE__ */ s("form", { onSubmit: be, className: "space-y-2", children: [
627
+ /* @__PURE__ */ s("form", { onSubmit: fe, className: "space-y-2", children: [
628
628
  /* @__PURE__ */ e(
629
- ae,
629
+ re,
630
630
  {
631
631
  value: u,
632
632
  onChange: D,
@@ -641,8 +641,8 @@ function Mt({
641
641
  ] })
642
642
  ] }),
643
643
  (h ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
644
- /* @__PURE__ */ e(fe, {}),
645
- (h ?? []).map((r, a) => /* @__PURE__ */ s(
644
+ /* @__PURE__ */ e(ge, {}),
645
+ (h ?? []).map((r, n) => /* @__PURE__ */ s(
646
646
  "div",
647
647
  {
648
648
  className: "flex items-start gap-2.5 rounded-lg border border-dashed border-amber-200/70 bg-amber-50/40 px-3 py-2 dark:border-amber-500/20 dark:bg-amber-500/5",
@@ -651,13 +651,13 @@ function Mt({
651
651
  /* @__PURE__ */ e("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: r })
652
652
  ]
653
653
  },
654
- a
654
+ n
655
655
  ))
656
656
  ] })
657
657
  ] }) : /* @__PURE__ */ s(Y, { children: [
658
- /* @__PURE__ */ s("form", { onSubmit: be, className: "space-y-2", children: [
658
+ /* @__PURE__ */ s("form", { onSubmit: fe, className: "space-y-2", children: [
659
659
  /* @__PURE__ */ e(
660
- ae,
660
+ re,
661
661
  {
662
662
  value: u,
663
663
  onChange: D,
@@ -691,24 +691,24 @@ function Mt({
691
691
  "data-note-typing": !0,
692
692
  children: [
693
693
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
694
- We(f, "writing a note"),
694
+ Ge(f, "writing a note"),
695
695
  "…"
696
696
  ]
697
697
  }
698
698
  ),
699
- /* @__PURE__ */ e(fe, { className: "my-4" }),
699
+ /* @__PURE__ */ e(ge, { className: "my-4" }),
700
700
  R.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
701
701
  ["people", "system", "integration"].map((r) => {
702
- const a = !X.has(r), x = ce[r];
702
+ const n = !X.has(r), x = me[r];
703
703
  return /* @__PURE__ */ s(
704
704
  "button",
705
705
  {
706
706
  type: "button",
707
- onClick: () => $e(r),
708
- "aria-pressed": a,
707
+ onClick: () => qe(r),
708
+ "aria-pressed": n,
709
709
  "data-notes-filter": r,
710
- disabled: x === 0 && a,
711
- className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${a ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through decoration-slate-300 dark:border-border"} disabled:opacity-50`,
710
+ disabled: x === 0 && n,
711
+ className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${n ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through decoration-slate-300 dark:border-border"} disabled:opacity-50`,
712
712
  title: r === "people" ? "Comments and notes people wrote" : r === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
713
713
  children: [
714
714
  it[r],
@@ -722,14 +722,14 @@ function Mt({
722
722
  "input",
723
723
  {
724
724
  value: J,
725
- onChange: (r) => Se(r.target.value),
725
+ onChange: (r) => $e(r.target.value),
726
726
  placeholder: "Search notes…",
727
727
  "aria-label": "Search notes",
728
728
  "data-notes-search": !0,
729
729
  className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
730
730
  }
731
731
  ),
732
- qe && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
732
+ Ee && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
733
733
  ee.length,
734
734
  " of ",
735
735
  R.length
@@ -741,7 +741,7 @@ function Mt({
741
741
  /* @__PURE__ */ e("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
742
742
  /* @__PURE__ */ e("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
743
743
  ] })
744
- ] }, r)) }) : we ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : R.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ee.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes match β€” clear the search or turn a filter back on." }) : /* @__PURE__ */ e("div", { className: "nvr-stagger-direct space-y-4", children: ee.map((r) => {
744
+ ] }, r)) }) : _e ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : R.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ee.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes match β€” clear the search or turn a filter back on." }) : /* @__PURE__ */ e("div", { className: "nvr-stagger-direct space-y-4", children: ee.map((r) => {
745
745
  if (r.kind === "related")
746
746
  return /* @__PURE__ */ e("div", { className: "nvr-section-enter", children: /* @__PURE__ */ e(
747
747
  mt,
@@ -751,35 +751,42 @@ function Mt({
751
751
  item: String(l)
752
752
  }
753
753
  ) }, r.note.id);
754
- const a = r.comment, x = w === a.user.id, K = G === a.id;
754
+ const n = r.comment, x = w === n.user.id, K = G === n.id;
755
755
  return /* @__PURE__ */ s("div", { className: "nvr-section-enter group flex gap-3", children: [
756
756
  /* @__PURE__ */ e(
757
757
  Ye,
758
758
  {
759
- userId: a.user.id,
759
+ userId: n.user.id,
760
760
  className: "h-8 w-8",
761
- fallback: /* @__PURE__ */ e(et, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ e(tt, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy", children: at(a.user) }) })
761
+ fallback: /* @__PURE__ */ e(et, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ e(tt, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy", children: rt(n.user) }) })
762
762
  }
763
763
  ),
764
764
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
765
765
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
766
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children: re(a.user) }),
767
- /* @__PURE__ */ e(Je, { label: a.via_agent }),
768
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: le(a.created_at) }),
769
- a.updated_at && a.updated_at !== a.created_at && /* @__PURE__ */ e("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
770
- a.field && /* @__PURE__ */ e(
766
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children: ne(n.user) }),
767
+ /* @__PURE__ */ e(Je, { label: n.via_agent }),
768
+ /* @__PURE__ */ e(
769
+ "span",
770
+ {
771
+ className: "text-[11px] text-slate-400",
772
+ "data-tip": ie(n.created_at),
773
+ children: le(n.created_at)
774
+ }
775
+ ),
776
+ n.updated_at && n.updated_at !== n.created_at && /* @__PURE__ */ e("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
777
+ n.field && /* @__PURE__ */ e(
771
778
  ot,
772
779
  {
773
- field: a.field,
774
- label: (q == null ? void 0 : q.labelOf(a.field)) ?? He(a.field),
775
- resolved: !!a.resolved_at,
776
- onJump: q ? () => q.jump(a.field) : void 0
780
+ field: n.field,
781
+ label: (q == null ? void 0 : q.labelOf(n.field)) ?? Xe(n.field),
782
+ resolved: !!n.resolved_at,
783
+ onJump: q ? () => q.jump(n.field) : void 0
777
784
  }
778
785
  ),
779
786
  !K && /* @__PURE__ */ s(
780
787
  "div",
781
788
  {
782
- className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${H === a.id ? "opacity-100" : "opacity-0"}`,
789
+ className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${H === n.id ? "opacity-100" : "opacity-0"}`,
783
790
  children: [
784
791
  /* @__PURE__ */ e(
785
792
  "button",
@@ -788,23 +795,23 @@ function Mt({
788
795
  title: "Make a task from this comment",
789
796
  "aria-label": "Make a task from this comment",
790
797
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
791
- onClick: () => Ee.mutate(a),
792
- children: /* @__PURE__ */ e(Pe, { className: "h-3 w-3" })
798
+ onClick: () => De.mutate(n),
799
+ children: /* @__PURE__ */ e(Fe, { className: "h-3 w-3" })
793
800
  }
794
801
  ),
795
- x && (H === a.id ? /* @__PURE__ */ s(Y, { children: [
802
+ x && (H === n.id ? /* @__PURE__ */ s(Y, { children: [
796
803
  /* @__PURE__ */ e(
797
804
  "button",
798
805
  {
799
806
  type: "button",
800
807
  autoFocus: !0,
801
- disabled: ne.isPending,
802
- "data-comment-delete-confirm": a.id,
808
+ disabled: ae.isPending,
809
+ "data-comment-delete-confirm": n.id,
803
810
  className: "rounded bg-red-600 px-1.5 py-px text-[10.5px] font-medium text-white transition-colors hover:bg-red-700 disabled:opacity-60",
804
- onClick: () => ne.mutate(a.id, {
805
- onSettled: () => n(null)
811
+ onClick: () => ae.mutate(n.id, {
812
+ onSettled: () => a(null)
806
813
  }),
807
- children: ne.isPending ? "Deleting…" : "Delete comment?"
814
+ children: ae.isPending ? "Deleting…" : "Delete comment?"
808
815
  }
809
816
  ),
810
817
  /* @__PURE__ */ e(
@@ -812,7 +819,7 @@ function Mt({
812
819
  {
813
820
  type: "button",
814
821
  className: "rounded px-1.5 py-px text-[10.5px] font-medium text-slate-500 transition-colors hover:bg-slate-100 dark:hover:bg-muted",
815
- onClick: () => n(null),
822
+ onClick: () => a(null),
816
823
  children: "Keep"
817
824
  }
818
825
  )
@@ -825,9 +832,9 @@ function Mt({
825
832
  "aria-label": "Edit comment",
826
833
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
827
834
  onClick: () => {
828
- P(a.id), p(a.text);
835
+ P(n.id), p(n.text);
829
836
  },
830
- children: /* @__PURE__ */ e(Fe, { className: "h-3 w-3" })
837
+ children: /* @__PURE__ */ e(Re, { className: "h-3 w-3" })
831
838
  }
832
839
  ),
833
840
  /* @__PURE__ */ e(
@@ -837,8 +844,8 @@ function Mt({
837
844
  title: "Delete comment",
838
845
  "aria-label": "Delete comment",
839
846
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
840
- onClick: () => n(a.id),
841
- children: /* @__PURE__ */ e(Re, { className: "h-3 w-3" })
847
+ onClick: () => a(n.id),
848
+ children: /* @__PURE__ */ e(Me, { className: "h-3 w-3" })
842
849
  }
843
850
  )
844
851
  ] }))
@@ -848,7 +855,7 @@ function Mt({
848
855
  ] }),
849
856
  K ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
850
857
  /* @__PURE__ */ e(
851
- ae,
858
+ re,
852
859
  {
853
860
  value: i,
854
861
  onChange: p,
@@ -862,10 +869,10 @@ function Mt({
862
869
  {
863
870
  size: "sm",
864
871
  className: "h-7 gap-1.5",
865
- disabled: !i.trim() || ue.isPending,
866
- onClick: () => ue.mutate({ id: a.id, text: i.trim() }),
872
+ disabled: !i.trim() || pe.isPending,
873
+ onClick: () => pe.mutate({ id: n.id, text: i.trim() }),
867
874
  children: [
868
- /* @__PURE__ */ e(Me, { className: "h-3 w-3" }),
875
+ /* @__PURE__ */ e(Ie, { className: "h-3 w-3" }),
869
876
  " Save"
870
877
  ]
871
878
  }
@@ -880,20 +887,20 @@ function Mt({
880
887
  P(null), p("");
881
888
  },
882
889
  children: [
883
- /* @__PURE__ */ e(Ie, { className: "h-3 w-3" }),
890
+ /* @__PURE__ */ e(je, { className: "h-3 w-3" }),
884
891
  " Cancel"
885
892
  ]
886
893
  }
887
894
  )
888
895
  ] })
889
- ] }) : /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600", children: /* @__PURE__ */ e(se, { text: a.text }) }),
890
- !K && /* @__PURE__ */ e(st, { comment: a }),
896
+ ] }) : /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600", children: /* @__PURE__ */ e(se, { text: n.text }) }),
897
+ !K && /* @__PURE__ */ e(st, { comment: n }),
891
898
  !K && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
892
- (a.reactions ?? []).map((M) => /* @__PURE__ */ s(
899
+ (n.reactions ?? []).map((M) => /* @__PURE__ */ s(
893
900
  "button",
894
901
  {
895
902
  type: "button",
896
- onClick: () => pe.mutate({ id: a.id, emoji: M.emoji }),
903
+ onClick: () => xe.mutate({ id: n.id, emoji: M.emoji }),
897
904
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${M.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
898
905
  children: [
899
906
  M.emoji,
@@ -907,18 +914,18 @@ function Mt({
907
914
  "button",
908
915
  {
909
916
  type: "button",
910
- onClick: () => he(xe === a.id ? null : a.id),
917
+ onClick: () => be(he === n.id ? null : n.id),
911
918
  className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
912
919
  "aria-label": "Add reaction",
913
- children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
920
+ children: /* @__PURE__ */ e(Ne, { className: "h-3.5 w-3.5" })
914
921
  }
915
922
  ),
916
- xe === a.id && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: Ne.map((M) => /* @__PURE__ */ e(
923
+ he === n.id && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: we.map((M) => /* @__PURE__ */ e(
917
924
  "button",
918
925
  {
919
926
  type: "button",
920
927
  onClick: () => {
921
- pe.mutate({ id: a.id, emoji: M }), he(null);
928
+ xe.mutate({ id: n.id, emoji: M }), be(null);
922
929
  },
923
930
  className: "rounded-full px-1 text-[14px] hover:bg-muted",
924
931
  children: M
@@ -928,7 +935,7 @@ function Mt({
928
935
  ] })
929
936
  ] })
930
937
  ] })
931
- ] }, a.id);
938
+ ] }, n.id);
932
939
  }) })
933
940
  ] }) })
934
941
  ]
@@ -938,6 +945,6 @@ function Mt({
938
945
  }
939
946
  export {
940
947
  Mt as CommentPanel,
941
- ae as MentionTextarea,
948
+ re as MentionTextarea,
942
949
  dt as notePreviewText
943
950
  };