@nivaro/react 0.3.36 → 0.3.37

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 (102) hide show
  1. package/dist/components/slots/CommentsSlot.js +44 -36
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +9 -1
  5. package/dist/shared/components/AgentBadge.js +26 -0
  6. package/dist/shared/components/AgentQuestionsCard.js +198 -0
  7. package/dist/shared/components/ItemEditForm.js +3329 -3263
  8. package/dist/shared/components/McpConnectionScope.js +480 -0
  9. package/dist/shared/components/MyWorkView.js +223 -208
  10. package/dist/shared/components/RecordReadView.js +620 -575
  11. package/dist/shared/components/chat/ChatPanel.js +683 -671
  12. package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
  13. package/dist/shared/components/imports/ImportConsole.js +106 -104
  14. package/dist/shared/components/imports/RunDetailSheet.js +11 -10
  15. package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
  16. package/dist/shared/components/item-edit/FormTour.js +279 -0
  17. package/dist/shared/components/item-edit/GroupSection.js +377 -360
  18. package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
  19. package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
  20. package/dist/shared/components/item-edit/form-density.js +36 -0
  21. package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
  22. package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
  23. package/dist/shared/components/layout-editor/AddPanel.js +349 -192
  24. package/dist/shared/components/layout-editor/DesignNode.js +126 -112
  25. package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
  26. package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
  27. package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
  28. package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
  29. package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
  30. package/dist/shared/components/layout-editor/add-target.js +54 -43
  31. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
  32. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
  33. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
  34. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
  35. package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
  36. package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
  37. package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
  38. package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
  39. package/dist/shared/components/layout-editor/dnd/node.js +115 -105
  40. package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
  41. package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
  42. package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
  43. package/dist/shared/components/layout-editor/even-row.js +86 -0
  44. package/dist/shared/components/layout-editor/field-list.js +99 -0
  45. package/dist/shared/components/layout-editor/format-painter.js +102 -0
  46. package/dist/shared/components/layout-editor/grid-guides.js +15 -13
  47. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
  48. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
  49. package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
  50. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
  51. package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
  52. package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
  53. package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
  54. package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
  55. package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
  56. package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
  57. package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
  58. package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
  59. package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
  60. package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
  61. package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
  62. package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
  63. package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
  64. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
  65. package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
  66. package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
  67. package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
  68. package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
  69. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  70. package/dist/shared/components/layout-editor/pin.js +37 -19
  71. package/dist/shared/components/layout-editor/place-clip.js +257 -0
  72. package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
  73. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
  74. package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
  75. package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
  76. package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
  77. package/dist/shared/components/layout-editor/removed-log.js +151 -0
  78. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
  79. package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
  80. package/dist/shared/components/layout-editor/revert-element.js +140 -0
  81. package/dist/shared/components/layout-editor/section-structure.js +193 -170
  82. package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
  83. package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
  84. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
  85. package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
  86. package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
  87. package/dist/shared/components/layout-editor/shortcuts.js +21 -16
  88. package/dist/shared/components/layout-editor/structure-ops.js +221 -195
  89. package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
  90. package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
  91. package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
  92. package/dist/shared/components/panels/CommentPanel.js +47 -45
  93. package/dist/shared/components/panels/RevisionsPanel.js +66 -64
  94. package/dist/shared/components/panels/TaskPanel.js +395 -332
  95. package/dist/shared/components/profile/AgentsPanel.js +196 -147
  96. package/dist/shared/components/profile/ConnectionRollback.js +329 -0
  97. package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
  98. package/dist/shared/lib/entry-config.js +22 -22
  99. package/dist/shared/lib/form-usage-beacon.js +91 -55
  100. package/dist/shared/lib/layout-lint.js +530 -284
  101. package/dist/shared/lib/layout-resolve.js +58 -44
  102. package/package.json +1 -1
@@ -1,46 +1,48 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { useQueryClient as se, useQuery as oe, useMutation as L } from "@tanstack/react-query";
3
- import { useState as N, useRef as q, useEffect as E, useMemo as ie } from "react";
4
- import { useApiFetchConfig as le, useItemNavigation as ce, useNavigation as me } from "../context.js";
5
- import { useLiveEvent as ue } from "../lib/live.js";
6
- import { useLiveOps as pe, useFreshIds as be } from "../lib/live-ops.js";
7
- import { resolveNotificationTarget as Z, runNotificationTarget as xe } from "../lib/notification-target.js";
8
- import { useOptionalRealtime as he } from "../lib/realtime.js";
9
- import { userErrorMessage as ge } from "../lib/safe-error.js";
10
- import { withinDay as G, slaChip as fe } from "../lib/sla-chip.js";
1
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
+ import { useQueryClient as se, useQuery as oe, useMutation as I } from "@tanstack/react-query";
3
+ import { Bot as ie } from "lucide-react";
4
+ import { useState as N, useRef as L, useEffect as E, useMemo as le } from "react";
5
+ import { useApiFetchConfig as ce, useItemNavigation as me, useNavigation as ue } from "../context.js";
6
+ import { useLiveEvent as pe } from "../lib/live.js";
7
+ import { useLiveOps as be, useFreshIds as xe } from "../lib/live-ops.js";
8
+ import { resolveNotificationTarget as Z, runNotificationTarget as he } from "../lib/notification-target.js";
9
+ import { useOptionalRealtime as ge } from "../lib/realtime.js";
10
+ import { userErrorMessage as fe } from "../lib/safe-error.js";
11
+ import { withinDay as G, slaChip as ke } from "../lib/sla-chip.js";
11
12
  import { cn as A } from "../lib/utils.js";
12
- import { FirstWeekCard as ke } from "./ai/FirstWeekCard.js";
13
- import { TaskDoButton as ye } from "./ai/TaskDo.js";
14
- import { openChatRoom as Ne, canOpenChatRoom as we } from "./chat/chat-core.js";
15
- import { useMyRecordRooms as ve } from "./chat/chat-hooks.js";
16
- import { LearningPathCard as _e } from "./help-videos/viewer/LearningPathCard.js";
17
- import { RequiredVideosCard as Ce } from "./help-videos/viewer/RequiredVideosCard.js";
18
- import { TickerNumber as $e } from "./TickerNumber.js";
19
- import { UserAvatar as Se } from "./UserAvatar.js";
20
- const Te = 8e3, X = ["records", "tasks", "team", "waiting", "notifications"], je = {
13
+ import { AgentQuestionsCard as ye } from "./AgentQuestionsCard.js";
14
+ import { FirstWeekCard as Ne } from "./ai/FirstWeekCard.js";
15
+ import { TaskDoButton as we } from "./ai/TaskDo.js";
16
+ import { openChatRoom as ve, canOpenChatRoom as _e } from "./chat/chat-core.js";
17
+ import { useMyRecordRooms as Ce } from "./chat/chat-hooks.js";
18
+ import { LearningPathCard as $e } from "./help-videos/viewer/LearningPathCard.js";
19
+ import { RequiredVideosCard as Se } from "./help-videos/viewer/RequiredVideosCard.js";
20
+ import { TickerNumber as Te } from "./TickerNumber.js";
21
+ import { UserAvatar as je } from "./UserAvatar.js";
22
+ const Ae = 8e3, X = ["records", "tasks", "team", "waiting", "notifications"], Me = {
21
23
  records: "Waiting on you",
22
24
  tasks: "My tasks",
23
25
  team: "Team tasks",
24
26
  waiting: "Waiting on others",
25
27
  notifications: "Notifications"
26
- }, Ae = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), M = (l) => !!l && String(l).slice(0, 10) < Ae(), Me = {
28
+ }, qe = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), M = (l) => !!l && String(l).slice(0, 10) < qe(), Oe = {
27
29
  alert: "bg-red-500/10 text-red-600 dark:text-red-400",
28
30
  warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
29
31
  neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
30
32
  ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
31
33
  };
32
- function Oe({ sla: l }) {
33
- const c = fe(l);
34
+ function De({ sla: l }) {
35
+ const c = ke(l);
34
36
  return c ? /* @__PURE__ */ e(
35
37
  "span",
36
38
  {
37
39
  "data-sla-chip": c.tone,
38
- className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Me[c.tone]}`,
40
+ className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Oe[c.tone]}`,
39
41
  children: c.label
40
42
  }
41
43
  ) : null;
42
44
  }
43
- function De({ state: l, color: c }) {
45
+ function Fe({ state: l, color: c }) {
44
46
  return l ? /* @__PURE__ */ e(
45
47
  "span",
46
48
  {
@@ -53,162 +55,162 @@ function De({ state: l, color: c }) {
53
55
  }
54
56
  ) : null;
55
57
  }
56
- function O({ label: l, value: c, tone: u }) {
57
- return /* @__PURE__ */ s("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
58
+ function q({ label: l, value: c, tone: u }) {
59
+ return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
58
60
  /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: l }),
59
- /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e($e, { value: c }) })
61
+ /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e(Te, { value: c }) })
60
62
  ] });
61
63
  }
62
- function et({
64
+ function nt({
63
65
  notificationRoutes: l,
64
66
  onOpenPath: c
65
67
  } = {}) {
66
- const { apiBase: u, authHeaders: w, credentials: v } = le(), { open: U } = ce(), _ = me(), h = se(), W = (t) => {
68
+ const { apiBase: u, authHeaders: w, credentials: v } = ce(), { open: W } = me(), _ = ue(), h = se(), U = (r) => {
67
69
  var b, i;
68
- const d = ((b = l == null ? void 0 : l.support) == null ? void 0 : b.call(l, String(t))) ?? ((i = _.consoleUrl) == null ? void 0 : i.call(_, `/support?ticket=${t}`)) ?? `/support?ticket=${t}`;
69
- c ? c(d) : _.navigate(d);
70
- }, D = he(), [R, C] = N(!1), [x, ee] = N(() => {
70
+ const n = ((b = l == null ? void 0 : l.support) == null ? void 0 : b.call(l, String(r))) ?? ((i = _.consoleUrl) == null ? void 0 : i.call(_, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
71
+ c ? c(n) : _.navigate(n);
72
+ }, O = ge(), [R, C] = N(!1), [x, ee] = N(() => {
71
73
  try {
72
- const t = localStorage.getItem("nvr_mywork_sections");
73
- if (t) {
74
- const d = JSON.parse(t);
75
- if (Array.isArray(d == null ? void 0 : d.order) && Array.isArray(d == null ? void 0 : d.hidden)) {
74
+ const r = localStorage.getItem("nvr_mywork_sections");
75
+ if (r) {
76
+ const n = JSON.parse(r);
77
+ if (Array.isArray(n == null ? void 0 : n.order) && Array.isArray(n == null ? void 0 : n.hidden)) {
76
78
  const b = X.map((i, m) => ({
77
79
  k: i,
78
- at: d.order.indexOf(i) >= 0 ? d.order.indexOf(i) : m - 0.5
80
+ at: n.order.indexOf(i) >= 0 ? n.order.indexOf(i) : m - 0.5
79
81
  })).sort((i, m) => i.at - m.at).map((i) => i.k);
80
- return { order: b, hidden: d.hidden.filter((i) => b.includes(i)) };
82
+ return { order: b, hidden: n.hidden.filter((i) => b.includes(i)) };
81
83
  }
82
84
  }
83
85
  } catch {
84
86
  }
85
87
  return { order: [...X], hidden: [] };
86
- }), K = (t) => {
87
- ee(t);
88
+ }), K = (r) => {
89
+ ee(r);
88
90
  try {
89
- localStorage.setItem("nvr_mywork_sections", JSON.stringify(t));
91
+ localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
90
92
  } catch {
91
93
  }
92
- }, [te, re] = N(!1), P = q(0), [$, ae] = N("all"), { data: a, isLoading: de, refetch: Q, isFetching: B } = oe({
94
+ }, [te, re] = N(!1), Q = L(0), [$, ae] = N("all"), { data: a, isLoading: ne, refetch: P, isFetching: B } = oe({
93
95
  queryKey: ["my-work"],
94
96
  queryFn: async () => {
95
- const t = await fetch(`${u}/my-work`, { headers: w, credentials: v });
96
- if (!t.ok) throw new Error("my-work failed");
97
- return (await t.json()).data;
97
+ const r = await fetch(`${u}/my-work`, { headers: w, credentials: v });
98
+ if (!r.ok) throw new Error("my-work failed");
99
+ return (await r.json()).data;
98
100
  },
99
101
  staleTime: 6e4
100
- }), z = q(0), g = q(null), J = () => {
101
- const t = () => {
102
+ }), z = L(0), g = L(null), H = () => {
103
+ const r = () => {
102
104
  g.current = null, z.current = Date.now(), C(!1), h.invalidateQueries({ queryKey: ["my-work"] });
103
- }, d = z.current + Te - Date.now();
104
- g.current || (d <= 0 ? t() : g.current = setTimeout(t, d));
105
+ }, n = z.current + Ae - Date.now();
106
+ g.current || (n <= 0 ? r() : g.current = setTimeout(r, n));
105
107
  };
106
- pe("my-work", J, { debounceMs: 1500 }), ue("notification:new", J, { debounceMs: 1500 }), E(
108
+ be("my-work", H, { debounceMs: 1500 }), pe("notification:new", H, { debounceMs: 1500 }), E(
107
109
  () => () => {
108
110
  g.current && clearTimeout(g.current);
109
111
  },
110
112
  []
111
113
  );
112
- const H = be([
113
- ...((a == null ? void 0 : a.owned) ?? []).map((t) => `o:${t.collection}:${t.item}`),
114
- ...((a == null ? void 0 : a.tasks) ?? []).map((t) => `t:${t.id}`),
115
- ...((a == null ? void 0 : a.team_tasks) ?? []).map((t) => `tt:${t.id}`),
116
- ...((a == null ? void 0 : a.requested) ?? []).map((t) => `r:${t.id}`),
117
- ...((a == null ? void 0 : a.notifications) ?? []).map((t) => `n:${t.id}`)
118
- ]), f = (t) => H.has(t) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", F = ie(() => {
119
- const t = /* @__PURE__ */ new Set();
120
- for (const d of (a == null ? void 0 : a.owned) ?? []) d.collection && t.add(d.collection);
121
- return [...t];
114
+ const J = xe([
115
+ ...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
116
+ ...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
117
+ ...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
118
+ ...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
119
+ ...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
120
+ ]), f = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", D = le(() => {
121
+ const r = /* @__PURE__ */ new Set();
122
+ for (const n of (a == null ? void 0 : a.owned) ?? []) n.collection && r.add(n.collection);
123
+ return [...r];
122
124
  }, [a]);
123
125
  E(() => {
124
- if (!(!D || F.length === 0))
125
- return D.subscribeCollections(F, () => {
126
- const t = Date.now();
127
- t - P.current < 3e4 || (P.current = t, C(!0));
126
+ if (!(!O || D.length === 0))
127
+ return O.subscribeCollections(D, () => {
128
+ const r = Date.now();
129
+ r - Q.current < 3e4 || (Q.current = r, C(!0));
128
130
  });
129
- }, [D, F]);
130
- const V = L({
131
+ }, [O, D]);
132
+ const V = I({
131
133
  // A ticket closes through /support so its requester hears about it.
132
- mutationFn: (t) => fetch(`${u}/${t.kind === "support" ? "support/tickets" : "tasks"}/${t.id}`, {
134
+ mutationFn: (r) => fetch(`${u}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
133
135
  method: "PATCH",
134
136
  headers: { ...w, "content-type": "application/json" },
135
137
  credentials: v,
136
138
  body: JSON.stringify({ status: "done" })
137
139
  }),
138
140
  onSuccess: () => h.invalidateQueries({ queryKey: ["my-work"] })
139
- }), S = L({
140
- mutationFn: async ({ id: t, action: d }) => {
141
- const b = await fetch(`${u}/tasks/${t}/${d}`, {
141
+ }), S = I({
142
+ mutationFn: async ({ id: r, action: n }) => {
143
+ const b = await fetch(`${u}/tasks/${r}/${n}`, {
142
144
  method: "POST",
143
145
  headers: { ...w, "content-type": "application/json" },
144
146
  credentials: v,
145
147
  body: "{}"
146
148
  }), i = await b.json().catch(() => ({}));
147
149
  if (!b.ok) throw new Error(i.error ?? "Failed");
148
- return d;
150
+ return n;
149
151
  },
150
- onSuccess: (t) => {
151
- I(t === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), h.invalidateQueries({ queryKey: ["my-work"] });
152
+ onSuccess: (r) => {
153
+ F(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), h.invalidateQueries({ queryKey: ["my-work"] });
152
154
  },
153
- onError: (t) => I(ge(t, "Failed"))
154
- }), [T, I] = N(null);
155
+ onError: (r) => F(fe(r, "Failed"))
156
+ }), [T, F] = N(null);
155
157
  E(() => {
156
158
  if (!T) return;
157
- const t = setTimeout(() => I(null), 4e3);
158
- return () => clearTimeout(t);
159
+ const r = setTimeout(() => F(null), 4e3);
160
+ return () => clearTimeout(r);
159
161
  }, [T]);
160
- const Y = L({
161
- mutationFn: (t) => fetch(`${u}/notifications/mark-read`, {
162
+ const Y = I({
163
+ mutationFn: (r) => fetch(`${u}/notifications/mark-read`, {
162
164
  method: "POST",
163
165
  headers: { ...w, "content-type": "application/json" },
164
166
  credentials: v,
165
- body: JSON.stringify({ ids: t })
167
+ body: JSON.stringify({ ids: r })
166
168
  }),
167
169
  onSuccess: () => {
168
170
  h.invalidateQueries({ queryKey: ["my-work"] }), h.invalidateQueries({ queryKey: ["notifications"] });
169
171
  }
170
- }), k = (t, d) => {
172
+ }), k = (r, n) => {
171
173
  const b = {
172
- record: (m, r) => (U({ collection: m, itemId: r }), null),
174
+ record: (m, t) => (W({ collection: m, itemId: t }), null),
173
175
  ...l
174
- }, i = Z(t, d, {
176
+ }, i = Z(r, n, {
175
177
  ...b,
176
- record: (m, r) => {
178
+ record: (m, t) => {
177
179
  var p;
178
- return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, m, r)) ?? null;
180
+ return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, m, t)) ?? null;
179
181
  }
180
182
  });
181
183
  if (i) {
182
- xe(i, (m) => c == null ? void 0 : c(m));
184
+ he(i, (m) => c == null ? void 0 : c(m));
183
185
  return;
184
186
  }
185
- t && d && !/^nivaro_/i.test(t) && t !== "__chat__" && U({ collection: t, itemId: d });
186
- }, ne = (t, d) => t && d && !/^nivaro_/i.test(t) && t !== "__chat__" ? !0 : !!Z(t, d, {
187
+ r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && W({ collection: r, itemId: n });
188
+ }, de = (r, n) => r && n && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!Z(r, n, {
187
189
  record: () => null,
188
190
  ...l
189
191
  });
190
- return de || !a ? /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-3 p-6", children: [1, 2, 3, 4].map((t) => /* @__PURE__ */ e("div", { className: "h-16 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, t)) }) : /* @__PURE__ */ s("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
191
- /* @__PURE__ */ e(ke, { onOpenPath: c }),
192
- /* @__PURE__ */ s("div", { className: "flex items-start justify-between", children: [
193
- /* @__PURE__ */ s("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
194
- /* @__PURE__ */ e(O, { label: "Waiting on you", value: a.counts.owned }),
192
+ return ne || !a ? /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-3 p-6", children: [1, 2, 3, 4].map((r) => /* @__PURE__ */ e("div", { className: "h-16 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, r)) }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
193
+ /* @__PURE__ */ e(Ne, { onOpenPath: c }),
194
+ /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
195
+ /* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
196
+ /* @__PURE__ */ e(q, { label: "Waiting on you", value: a.counts.owned }),
195
197
  /* @__PURE__ */ e(
196
- O,
198
+ q,
197
199
  {
198
200
  label: "SLA breached",
199
201
  value: a.counts.owned_breached,
200
202
  tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
201
203
  }
202
204
  ),
203
- /* @__PURE__ */ e(O, { label: "Open tasks", value: a.counts.tasks }),
204
- /* @__PURE__ */ e(O, { label: "Unread notifications", value: a.counts.notifications })
205
+ /* @__PURE__ */ e(q, { label: "Open tasks", value: a.counts.tasks }),
206
+ /* @__PURE__ */ e(q, { label: "Unread notifications", value: a.counts.notifications })
205
207
  ] }),
206
- R && /* @__PURE__ */ s(
208
+ R && /* @__PURE__ */ d(
207
209
  "button",
208
210
  {
209
211
  type: "button",
210
212
  onClick: () => {
211
- C(!1), Q();
213
+ C(!1), P();
212
214
  },
213
215
  className: "ml-3 inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
214
216
  children: [
@@ -222,38 +224,38 @@ function et({
222
224
  {
223
225
  type: "button",
224
226
  onClick: () => {
225
- C(!1), Q();
227
+ C(!1), P();
226
228
  },
227
229
  disabled: B,
228
230
  className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted disabled:opacity-50 dark:border-border",
229
231
  children: B ? "Refreshing…" : "Refresh"
230
232
  }
231
233
  ),
232
- /* @__PURE__ */ s("div", { className: "relative ml-2", children: [
234
+ /* @__PURE__ */ d("div", { className: "relative ml-2", children: [
233
235
  /* @__PURE__ */ e(
234
236
  "button",
235
237
  {
236
238
  type: "button",
237
- onClick: () => re((t) => !t),
239
+ onClick: () => re((r) => !r),
238
240
  className: "rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted dark:border-border",
239
241
  children: "Customize"
240
242
  }
241
243
  ),
242
- te && /* @__PURE__ */ s("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
244
+ te && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
243
245
  /* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
244
- x.order.map((t, d) => {
245
- const b = je[t] ?? t, i = x.hidden.includes(t), m = (r) => {
246
- const p = [...x.order], n = d + r;
247
- n < 0 || n >= p.length || ([p[d], p[n]] = [p[n], p[d]], K({ ...x, order: p }));
246
+ x.order.map((r, n) => {
247
+ const b = Me[r] ?? r, i = x.hidden.includes(r), m = (t) => {
248
+ const p = [...x.order], s = n + t;
249
+ s < 0 || s >= p.length || ([p[n], p[s]] = [p[s], p[n]], K({ ...x, order: p }));
248
250
  };
249
- return /* @__PURE__ */ s("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
251
+ return /* @__PURE__ */ d("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
250
252
  /* @__PURE__ */ e(
251
253
  "button",
252
254
  {
253
255
  type: "button",
254
256
  onClick: () => K({
255
257
  ...x,
256
- hidden: i ? x.hidden.filter((r) => r !== t) : [...x.hidden, t]
258
+ hidden: i ? x.hidden.filter((t) => t !== r) : [...x.hidden, r]
257
259
  }),
258
260
  className: "flex h-4 w-4 items-center justify-center rounded border border-slate-300 text-[10px] dark:border-border",
259
261
  title: i ? "Show section" : "Hide section",
@@ -272,7 +274,7 @@ function et({
272
274
  {
273
275
  type: "button",
274
276
  onClick: () => m(-1),
275
- disabled: d === 0,
277
+ disabled: n === 0,
276
278
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
277
279
  children: "↑"
278
280
  }
@@ -282,12 +284,12 @@ function et({
282
284
  {
283
285
  type: "button",
284
286
  onClick: () => m(1),
285
- disabled: d === x.order.length - 1,
287
+ disabled: n === x.order.length - 1,
286
288
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
287
289
  children: "↓"
288
290
  }
289
291
  )
290
- ] }, t);
292
+ ] }, r);
291
293
  })
292
294
  ] })
293
295
  ] })
@@ -301,24 +303,25 @@ function et({
301
303
  children: T
302
304
  }
303
305
  ),
304
- /* @__PURE__ */ e(Ce, { className: "mb-4" }),
305
- /* @__PURE__ */ e(_e, { className: "mb-4" }),
306
+ /* @__PURE__ */ e(ye, { questions: a.questions ?? [] }),
307
+ /* @__PURE__ */ e(Se, { className: "mb-4" }),
308
+ /* @__PURE__ */ e($e, { className: "mb-4" }),
306
309
  (() => {
307
- const t = {
310
+ const r = {
308
311
  records: () => {
309
- const r = a.owned.filter((o) => G(o.sla)).length, p = a.owned.filter((o) => {
312
+ const t = a.owned.filter((o) => G(o.sla)).length, p = a.owned.filter((o) => {
310
313
  var y;
311
314
  return ((y = o.sla) == null ? void 0 : y.status) === "breached";
312
- }).length, n = $ === "soon" ? a.owned.filter((o) => G(o.sla)) : $ === "breached" ? a.owned.filter((o) => {
315
+ }).length, s = $ === "soon" ? a.owned.filter((o) => G(o.sla)) : $ === "breached" ? a.owned.filter((o) => {
313
316
  var y;
314
317
  return ((y = o.sla) == null ? void 0 : y.status) === "breached";
315
318
  }) : a.owned, j = [
316
319
  { key: "all", label: `All (${a.owned.length})` },
317
- { key: "soon", label: `Warning within 24h (${r})` },
320
+ { key: "soon", label: `Warning within 24h (${t})` },
318
321
  { key: "breached", label: `Breached (${p})` }
319
322
  ];
320
- return /* @__PURE__ */ s("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
321
- /* @__PURE__ */ s("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
323
+ return /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
324
+ /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
322
325
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Waiting on you" }),
323
326
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
324
327
  ] }),
@@ -337,12 +340,12 @@ function et({
337
340
  },
338
341
  o.key
339
342
  )) }) }),
340
- n.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: n.map((o) => /* @__PURE__ */ e(
343
+ s.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: s.map((o) => /* @__PURE__ */ e(
341
344
  "li",
342
345
  {
343
346
  className: f(`o:${o.collection}:${o.item}`),
344
- "data-my-work-fresh": H.has(`o:${o.collection}:${o.item}`) || void 0,
345
- children: /* @__PURE__ */ s(
347
+ "data-my-work-fresh": J.has(`o:${o.collection}:${o.item}`) || void 0,
348
+ children: /* @__PURE__ */ d(
346
349
  "button",
347
350
  {
348
351
  type: "button",
@@ -351,8 +354,8 @@ function et({
351
354
  children: [
352
355
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: o.label }),
353
356
  /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: o.collection.replace(/_/g, " ") }),
354
- /* @__PURE__ */ e(De, { state: o.state, color: o.state_color }),
355
- /* @__PURE__ */ e(Oe, { sla: o.sla })
357
+ /* @__PURE__ */ e(Fe, { state: o.state, color: o.state_color }),
358
+ /* @__PURE__ */ e(De, { sla: o.sla })
356
359
  ]
357
360
  }
358
361
  )
@@ -361,93 +364,105 @@ function et({
361
364
  )) })
362
365
  ] });
363
366
  },
364
- tasks: () => /* @__PURE__ */ s("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
367
+ tasks: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
365
368
  /* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "My tasks" }) }),
366
- a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((r) => /* @__PURE__ */ s(
369
+ a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ d(
367
370
  "li",
368
371
  {
369
- className: A("flex items-center gap-2.5 px-4 py-2", f(`t:${r.id}`)),
372
+ className: A("flex items-center gap-2.5 px-4 py-2", f(`t:${t.id}`)),
370
373
  children: [
371
374
  /* @__PURE__ */ e(
372
375
  "button",
373
376
  {
374
377
  type: "button",
375
378
  title: "Mark done",
376
- onClick: () => V.mutate(r),
379
+ onClick: () => V.mutate(t),
377
380
  disabled: V.isPending,
378
381
  className: "flex h-4 w-4 shrink-0 items-center justify-center rounded border border-slate-300 text-transparent hover:border-emerald-500 hover:text-emerald-500 dark:border-border",
379
382
  children: "✓"
380
383
  }
381
384
  ),
382
- r.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
383
- r.kind === "support" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-white/10 dark:text-slate-300", children: "support" }),
384
- /* @__PURE__ */ s(
385
+ t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
386
+ t.kind === "support" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-white/10 dark:text-slate-300", children: "support" }),
387
+ t.agent_assignee && /* @__PURE__ */ d(
388
+ "span",
389
+ {
390
+ className: "inline-flex shrink-0 items-center gap-1 rounded bg-nvr-cyan/10 px-1 py-px text-[10px] font-medium text-[#0e7490] dark:text-[#67e8f9]",
391
+ "data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
392
+ "data-my-work-agent-task": t.id,
393
+ children: [
394
+ /* @__PURE__ */ e(ie, { className: "h-3 w-3", "aria-hidden": !0 }),
395
+ t.agent_name ?? "Agent"
396
+ ]
397
+ }
398
+ ),
399
+ /* @__PURE__ */ d(
385
400
  "button",
386
401
  {
387
402
  type: "button",
388
- onClick: () => r.kind === "support" ? W(r.id) : k(r.collection, r.item),
403
+ onClick: () => t.kind === "support" ? U(t.id) : k(t.collection, t.item),
389
404
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
390
405
  children: [
391
- r.title,
392
- r.item_label && /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: r.item_label })
406
+ t.title,
407
+ t.item_label && /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: t.item_label })
393
408
  ]
394
409
  }
395
410
  ),
396
411
  /* @__PURE__ */ e(
397
- ye,
412
+ we,
398
413
  {
399
- task: r,
414
+ task: t,
400
415
  isAssignee: !0,
401
416
  compact: !0,
402
417
  onTaskChanged: () => void h.invalidateQueries({ queryKey: ["my-work"] })
403
418
  }
404
419
  ),
405
- r.due_date && /* @__PURE__ */ e(
420
+ t.due_date && /* @__PURE__ */ e(
406
421
  "span",
407
422
  {
408
- className: `text-[11px] tabular-nums ${M(r.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
409
- children: new Date(r.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
423
+ className: `text-[11px] tabular-nums ${M(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
424
+ children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
410
425
  }
411
426
  )
412
427
  ]
413
428
  },
414
- r.id
429
+ t.id
415
430
  )) })
416
431
  ] }),
417
- team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */ s(
432
+ team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */ d(
418
433
  "section",
419
434
  {
420
435
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
421
436
  "data-my-work-team": !0,
422
437
  children: [
423
- /* @__PURE__ */ s("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
438
+ /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
424
439
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Team tasks" }),
425
440
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Waiting with a team you are on — pick one up to make it yours." })
426
441
  ] }),
427
- (a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((r) => /* @__PURE__ */ s(
442
+ (a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ d(
428
443
  "li",
429
444
  {
430
- className: A("flex items-center gap-2.5 px-4 py-2", f(`tt:${r.id}`)),
431
- "data-my-work-team-task": r.id,
445
+ className: A("flex items-center gap-2.5 px-4 py-2", f(`tt:${t.id}`)),
446
+ "data-my-work-team-task": t.id,
432
447
  children: [
433
- r.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
434
- /* @__PURE__ */ s(
448
+ t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
449
+ /* @__PURE__ */ d(
435
450
  "button",
436
451
  {
437
452
  type: "button",
438
- onClick: () => k(r.collection, r.item),
453
+ onClick: () => k(t.collection, t.item),
439
454
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
440
455
  children: [
441
- r.title,
442
- /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [r.team_name, r.item_label].filter(Boolean).join(" · ") })
456
+ t.title,
457
+ /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [t.team_name, t.item_label].filter(Boolean).join(" · ") })
443
458
  ]
444
459
  }
445
460
  ),
446
- r.due_date && /* @__PURE__ */ e(
461
+ t.due_date && /* @__PURE__ */ e(
447
462
  "span",
448
463
  {
449
- className: `text-[11px] tabular-nums ${M(r.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
450
- children: new Date(r.due_date).toLocaleDateString(void 0, {
464
+ className: `text-[11px] tabular-nums ${M(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
465
+ children: new Date(t.due_date).toLocaleDateString(void 0, {
451
466
  timeZone: "UTC"
452
467
  })
453
468
  }
@@ -456,129 +471,129 @@ function et({
456
471
  "button",
457
472
  {
458
473
  type: "button",
459
- onClick: () => S.mutate({ id: r.id, action: "claim" }),
474
+ onClick: () => S.mutate({ id: t.id, action: "claim" }),
460
475
  disabled: S.isPending,
461
476
  className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted dark:border-border",
462
- "data-my-work-claim": r.id,
477
+ "data-my-work-claim": t.id,
463
478
  children: "Pick it up"
464
479
  }
465
480
  )
466
481
  ]
467
482
  },
468
- r.id
483
+ t.id
469
484
  )) })
470
485
  ]
471
486
  }
472
487
  ),
473
488
  waiting: () => {
474
- const r = a.requested ?? [], p = r.filter((n) => M(n.due_date)).length;
475
- return /* @__PURE__ */ s(
489
+ const t = a.requested ?? [], p = t.filter((s) => M(s.due_date)).length;
490
+ return /* @__PURE__ */ d(
476
491
  "section",
477
492
  {
478
493
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
479
494
  "data-my-work-waiting": !0,
480
495
  children: [
481
- /* @__PURE__ */ s("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
482
- /* @__PURE__ */ s("h2", { className: "text-[13px] font-medium", children: [
496
+ /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
497
+ /* @__PURE__ */ d("h2", { className: "text-[13px] font-medium", children: [
483
498
  "Waiting on others",
484
- p > 0 && /* @__PURE__ */ s("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
499
+ p > 0 && /* @__PURE__ */ d("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
485
500
  p,
486
501
  " overdue"
487
502
  ] })
488
503
  ] }),
489
504
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
490
505
  ] }),
491
- r.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: r.map((n) => {
492
- const j = M(n.due_date), o = !!n.nudged_at && Date.now() - new Date(n.nudged_at).getTime() < 20 * 36e5;
493
- return /* @__PURE__ */ s(
506
+ t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((s) => {
507
+ const j = M(s.due_date), o = !!s.nudged_at && Date.now() - new Date(s.nudged_at).getTime() < 20 * 36e5;
508
+ return /* @__PURE__ */ d(
494
509
  "li",
495
510
  {
496
- className: A("flex items-center gap-2.5 px-4 py-2", f(`r:${n.id}`)),
497
- "data-my-work-requested": n.id,
511
+ className: A("flex items-center gap-2.5 px-4 py-2", f(`r:${s.id}`)),
512
+ "data-my-work-requested": s.id,
498
513
  children: [
499
- /* @__PURE__ */ s(
514
+ /* @__PURE__ */ d(
500
515
  "button",
501
516
  {
502
517
  type: "button",
503
- onClick: () => n.kind === "support" ? W(n.id) : k(n.collection, n.item),
518
+ onClick: () => s.kind === "support" ? U(s.id) : k(s.collection, s.item),
504
519
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
505
520
  children: [
506
- n.title,
521
+ s.title,
507
522
  /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
508
- n.assignee_name ?? (n.team_name ? `${n.team_name} team` : "Unassigned"),
509
- n.item_label
523
+ s.assignee_name ?? (s.team_name ? `${s.team_name} team` : "Unassigned"),
524
+ s.item_label
510
525
  ].filter(Boolean).join(" · ") })
511
526
  ]
512
527
  }
513
528
  ),
514
- n.due_date && /* @__PURE__ */ s(
529
+ s.due_date && /* @__PURE__ */ d(
515
530
  "span",
516
531
  {
517
532
  className: `text-[11px] tabular-nums ${j ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
518
533
  children: [
519
534
  j ? "Overdue · " : "",
520
- new Date(n.due_date).toLocaleDateString(void 0, {
535
+ new Date(s.due_date).toLocaleDateString(void 0, {
521
536
  timeZone: "UTC"
522
537
  })
523
538
  ]
524
539
  }
525
540
  ),
526
- n.kind !== "support" && /* @__PURE__ */ e(
541
+ s.kind !== "support" && /* @__PURE__ */ e(
527
542
  "button",
528
543
  {
529
544
  type: "button",
530
- onClick: () => S.mutate({ id: n.id, action: "nudge" }),
545
+ onClick: () => S.mutate({ id: s.id, action: "nudge" }),
531
546
  disabled: S.isPending || o,
532
547
  title: o ? "Already nudged today" : "Send a reminder",
533
548
  className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted disabled:opacity-50 dark:border-border",
534
- "data-my-work-nudge": n.id,
549
+ "data-my-work-nudge": s.id,
535
550
  children: o ? "Nudged" : "Nudge"
536
551
  }
537
552
  )
538
553
  ]
539
554
  },
540
- n.id
555
+ s.id
541
556
  );
542
557
  }) })
543
558
  ]
544
559
  }
545
560
  );
546
561
  },
547
- notifications: () => /* @__PURE__ */ s("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
548
- /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
562
+ notifications: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
563
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
549
564
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Unread notifications" }),
550
565
  a.notifications.length > 0 && /* @__PURE__ */ e(
551
566
  "button",
552
567
  {
553
568
  type: "button",
554
- onClick: () => Y.mutate(a.notifications.map((r) => r.id)),
569
+ onClick: () => Y.mutate(a.notifications.map((t) => t.id)),
555
570
  className: "text-[11px] text-[#00a5cc] hover:underline",
556
571
  children: "Mark all read"
557
572
  }
558
573
  )
559
574
  ] }),
560
- a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((r) => /* @__PURE__ */ s(
575
+ a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ d(
561
576
  "li",
562
577
  {
563
- className: A("flex items-start gap-2.5 px-4 py-2", f(`n:${r.id}`)),
578
+ className: A("flex items-start gap-2.5 px-4 py-2", f(`n:${t.id}`)),
564
579
  children: [
565
580
  /* @__PURE__ */ e(
566
- Se,
581
+ je,
567
582
  {
568
- userId: r.sender,
583
+ userId: t.sender,
569
584
  className: "mt-0.5 h-5 w-5",
570
585
  fallback: /* @__PURE__ */ e("span", { className: "mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-slate-100 text-[9px] font-semibold text-slate-500 dark:bg-muted" })
571
586
  }
572
587
  ),
573
- /* @__PURE__ */ s(
588
+ /* @__PURE__ */ d(
574
589
  "button",
575
590
  {
576
591
  type: "button",
577
- onClick: () => k(r.collection, r.item),
578
- className: ne(r.collection, r.item) ? "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80" : "min-w-0 flex-1 cursor-default text-left",
592
+ onClick: () => k(t.collection, t.item),
593
+ className: de(t.collection, t.item) ? "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80" : "min-w-0 flex-1 cursor-default text-left",
579
594
  children: [
580
- /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: r.subject }),
581
- r.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: r.message })
595
+ /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
596
+ t.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: t.message })
582
597
  ]
583
598
  }
584
599
  ),
@@ -587,56 +602,56 @@ function et({
587
602
  {
588
603
  type: "button",
589
604
  title: "Mark read",
590
- onClick: () => Y.mutate([r.id]),
605
+ onClick: () => Y.mutate([t.id]),
591
606
  className: "text-[11px] text-muted-foreground hover:text-foreground",
592
607
  children: "✓"
593
608
  }
594
609
  )
595
610
  ]
596
611
  },
597
- r.id
612
+ t.id
598
613
  )) })
599
614
  ] })
600
- }, d = new Map(
601
- x.order.filter((r) => !x.hidden.includes(r) && t[r]).map((r) => [r, t[r]()]).filter(([, r]) => r != null)
602
- ), b = [...d.keys()], i = [];
615
+ }, n = new Map(
616
+ x.order.filter((t) => !x.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
617
+ ), b = [...n.keys()], i = [];
603
618
  let m = 0;
604
619
  for (; m < b.length; ) {
605
- const r = b[m];
606
- if (r === "records")
607
- i.push(/* @__PURE__ */ e("div", { children: d.get(r) }, r)), m++;
620
+ const t = b[m];
621
+ if (t === "records")
622
+ i.push(/* @__PURE__ */ e("div", { children: n.get(t) }, t)), m++;
608
623
  else {
609
- const p = [r];
624
+ const p = [t];
610
625
  m + 1 < b.length && b[m + 1] !== "records" && p.push(b[m + 1]), i.push(
611
- /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: p.map((n) => /* @__PURE__ */ e("div", { children: d.get(n) }, n)) }, p.join("+"))
626
+ /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: p.map((s) => /* @__PURE__ */ e("div", { children: n.get(s) }, s)) }, p.join("+"))
612
627
  ), m += p.length;
613
628
  }
614
629
  }
615
630
  return i;
616
631
  })(),
617
- /* @__PURE__ */ e(Fe, {})
632
+ /* @__PURE__ */ e(Ie, {})
618
633
  ] });
619
634
  }
620
- function Fe() {
621
- const l = we(), { rooms: c } = ve(l);
622
- return !l || c.length === 0 ? null : /* @__PURE__ */ s(
635
+ function Ie() {
636
+ const l = _e(), { rooms: c } = Ce(l);
637
+ return !l || c.length === 0 ? null : /* @__PURE__ */ d(
623
638
  "section",
624
639
  {
625
640
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
626
641
  "data-my-work-chat": !0,
627
642
  children: [
628
643
  /* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Record conversations" }) }),
629
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
644
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
630
645
  "button",
631
646
  {
632
647
  type: "button",
633
- onClick: () => Ne(u.room, u.label),
648
+ onClick: () => ve(u.room, u.label),
634
649
  className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
635
650
  "data-my-work-chat-room": u.room,
636
651
  children: [
637
- /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
652
+ /* @__PURE__ */ d("span", { className: "min-w-0 flex-1", children: [
638
653
  /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: u.label }),
639
- u.last_message && /* @__PURE__ */ s("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
654
+ u.last_message && /* @__PURE__ */ d("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
640
655
  u.last_message.sender_name ? `${u.last_message.sender_name}: ` : "",
641
656
  u.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
642
657
  ] })
@@ -651,5 +666,5 @@ function Fe() {
651
666
  );
652
667
  }
653
668
  export {
654
- et as MyWorkView
669
+ nt as MyWorkView
655
670
  };