@nivaro/react 0.2.54 → 0.2.55

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 (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
@@ -1,92 +1,93 @@
1
1
  import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { useQueryClient as se, useQuery as oe, useMutation as F } from "@tanstack/react-query";
2
+ import { useQueryClient as se, useQuery as oe, useMutation as D } from "@tanstack/react-query";
3
3
  import { useState as N, useRef as q, useEffect as E, useMemo as ie } from "react";
4
4
  import { useApiFetchConfig as le, useItemNavigation as ce, useNavigation as me } from "../context.js";
5
- import { resolveNotificationTarget as Z, runNotificationTarget as ue } from "../lib/notification-target.js";
6
- import { useLiveEvent as pe } from "../lib/live.js";
7
- import { useLiveOps as be, useFreshIds as xe } from "../lib/live-ops.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
8
  import { useOptionalRealtime as he } from "../lib/realtime.js";
9
9
  import { withinDay as G, slaChip as ge } from "../lib/sla-chip.js";
10
- import { cn as O } from "../lib/utils.js";
11
- import { openChatRoom as fe, canOpenChatRoom as ke } from "./chat/chat-core.js";
12
- import { useMyRecordRooms as ye } from "./chat/chat-hooks.js";
13
- import { LearningPathCard as Ne } from "./help-videos/viewer/LearningPathCard.js";
14
- import { RequiredVideosCard as we } from "./help-videos/viewer/RequiredVideosCard.js";
15
- import { TickerNumber as ve } from "./TickerNumber.js";
16
- import { UserAvatar as _e } from "./UserAvatar.js";
17
- const Ce = 8e3, X = ["records", "tasks", "team", "waiting", "notifications"], $e = {
10
+ import { cn as A } from "../lib/utils.js";
11
+ import { FirstWeekCard as fe } from "./ai/FirstWeekCard.js";
12
+ import { openChatRoom as ke, canOpenChatRoom as ye } from "./chat/chat-core.js";
13
+ import { useMyRecordRooms as Ne } from "./chat/chat-hooks.js";
14
+ import { LearningPathCard as we } from "./help-videos/viewer/LearningPathCard.js";
15
+ import { RequiredVideosCard as ve } from "./help-videos/viewer/RequiredVideosCard.js";
16
+ import { TickerNumber as _e } from "./TickerNumber.js";
17
+ import { UserAvatar as Ce } from "./UserAvatar.js";
18
+ const $e = 8e3, X = ["records", "tasks", "team", "waiting", "notifications"], Se = {
18
19
  records: "Waiting on you",
19
20
  tasks: "My tasks",
20
21
  team: "Team tasks",
21
22
  waiting: "Waiting on others",
22
23
  notifications: "Notifications"
23
- }, Se = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), A = (l) => !!l && String(l).slice(0, 10) < Se(), Te = {
24
+ }, Te = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), M = (l) => !!l && String(l).slice(0, 10) < Te(), je = {
24
25
  alert: "bg-red-500/10 text-red-600 dark:text-red-400",
25
26
  warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
26
27
  neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
27
28
  ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
28
29
  };
29
- function je({ sla: l }) {
30
- const m = ge(l);
31
- return m ? /* @__PURE__ */ e(
30
+ function Ae({ sla: l }) {
31
+ const c = ge(l);
32
+ return c ? /* @__PURE__ */ e(
32
33
  "span",
33
34
  {
34
- "data-sla-chip": m.tone,
35
- className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Te[m.tone]}`,
36
- children: m.label
35
+ "data-sla-chip": c.tone,
36
+ className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${je[c.tone]}`,
37
+ children: c.label
37
38
  }
38
39
  ) : null;
39
40
  }
40
- function Oe({ state: l, color: m }) {
41
+ function Me({ state: l, color: c }) {
41
42
  return l ? /* @__PURE__ */ e(
42
43
  "span",
43
44
  {
44
45
  className: "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
45
46
  style: {
46
- backgroundColor: m ? `${m}22` : "rgba(100,116,139,.12)",
47
- color: m ?? void 0
47
+ backgroundColor: c ? `${c}22` : "rgba(100,116,139,.12)",
48
+ color: c ?? void 0
48
49
  },
49
50
  children: l.replace(/_/g, " ")
50
51
  }
51
52
  ) : null;
52
53
  }
53
- function M({ label: l, value: m, tone: u }) {
54
+ function O({ label: l, value: c, tone: u }) {
54
55
  return /* @__PURE__ */ s("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
55
56
  /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: l }),
56
- /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e(ve, { value: m }) })
57
+ /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e(_e, { value: c }) })
57
58
  ] });
58
59
  }
59
- function Ve({
60
+ function Ze({
60
61
  notificationRoutes: l,
61
- onOpenPath: m
62
+ onOpenPath: c
62
63
  } = {}) {
63
- const { apiBase: u, authHeaders: w, credentials: v } = le(), { open: U } = ce(), _ = me(), h = se(), P = (t) => {
64
+ const { apiBase: u, authHeaders: w, credentials: v } = le(), { open: U } = ce(), _ = me(), h = se(), W = (t) => {
64
65
  var b, i;
65
66
  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}`;
66
- m ? m(d) : _.navigate(d);
67
- }, I = he(), [R, C] = N(!1), [x, ee] = N(() => {
67
+ c ? c(d) : _.navigate(d);
68
+ }, F = he(), [R, C] = N(!1), [x, ee] = N(() => {
68
69
  try {
69
70
  const t = localStorage.getItem("nvr_mywork_sections");
70
71
  if (t) {
71
72
  const d = JSON.parse(t);
72
73
  if (Array.isArray(d == null ? void 0 : d.order) && Array.isArray(d == null ? void 0 : d.hidden)) {
73
- const b = X.map((i, c) => ({
74
+ const b = X.map((i, m) => ({
74
75
  k: i,
75
- at: d.order.indexOf(i) >= 0 ? d.order.indexOf(i) : c - 0.5
76
- })).sort((i, c) => i.at - c.at).map((i) => i.k);
76
+ at: d.order.indexOf(i) >= 0 ? d.order.indexOf(i) : m - 0.5
77
+ })).sort((i, m) => i.at - m.at).map((i) => i.k);
77
78
  return { order: b, hidden: d.hidden.filter((i) => b.includes(i)) };
78
79
  }
79
80
  }
80
81
  } catch {
81
82
  }
82
83
  return { order: [...X], hidden: [] };
83
- }), W = (t) => {
84
+ }), K = (t) => {
84
85
  ee(t);
85
86
  try {
86
87
  localStorage.setItem("nvr_mywork_sections", JSON.stringify(t));
87
88
  } catch {
88
89
  }
89
- }, [te, re] = N(!1), K = q(0), [$, ae] = N("all"), { data: a, isLoading: de, refetch: Q, isFetching: B } = oe({
90
+ }, [te, re] = N(!1), P = q(0), [$, ae] = N("all"), { data: a, isLoading: de, refetch: Q, isFetching: B } = oe({
90
91
  queryKey: ["my-work"],
91
92
  queryFn: async () => {
92
93
  const t = await fetch(`${u}/my-work`, { headers: w, credentials: v });
@@ -97,34 +98,34 @@ function Ve({
97
98
  }), z = q(0), g = q(null), J = () => {
98
99
  const t = () => {
99
100
  g.current = null, z.current = Date.now(), C(!1), h.invalidateQueries({ queryKey: ["my-work"] });
100
- }, d = z.current + Ce - Date.now();
101
+ }, d = z.current + $e - Date.now();
101
102
  g.current || (d <= 0 ? t() : g.current = setTimeout(t, d));
102
103
  };
103
- be("my-work", J, { debounceMs: 1500 }), pe("notification:new", J, { debounceMs: 1500 }), E(
104
+ pe("my-work", J, { debounceMs: 1500 }), ue("notification:new", J, { debounceMs: 1500 }), E(
104
105
  () => () => {
105
106
  g.current && clearTimeout(g.current);
106
107
  },
107
108
  []
108
109
  );
109
- const H = xe([
110
+ const H = be([
110
111
  ...((a == null ? void 0 : a.owned) ?? []).map((t) => `o:${t.collection}:${t.item}`),
111
112
  ...((a == null ? void 0 : a.tasks) ?? []).map((t) => `t:${t.id}`),
112
113
  ...((a == null ? void 0 : a.team_tasks) ?? []).map((t) => `tt:${t.id}`),
113
114
  ...((a == null ? void 0 : a.requested) ?? []).map((t) => `r:${t.id}`),
114
115
  ...((a == null ? void 0 : a.notifications) ?? []).map((t) => `n:${t.id}`)
115
- ]), f = (t) => H.has(t) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", L = ie(() => {
116
+ ]), f = (t) => H.has(t) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = ie(() => {
116
117
  const t = /* @__PURE__ */ new Set();
117
118
  for (const d of (a == null ? void 0 : a.owned) ?? []) d.collection && t.add(d.collection);
118
119
  return [...t];
119
120
  }, [a]);
120
121
  E(() => {
121
- if (!(!I || L.length === 0))
122
- return I.subscribeCollections(L, () => {
122
+ if (!(!F || I.length === 0))
123
+ return F.subscribeCollections(I, () => {
123
124
  const t = Date.now();
124
- t - K.current < 3e4 || (K.current = t, C(!0));
125
+ t - P.current < 3e4 || (P.current = t, C(!0));
125
126
  });
126
- }, [I, L]);
127
- const V = F({
127
+ }, [F, I]);
128
+ const V = D({
128
129
  // A ticket closes through /support so its requester hears about it.
129
130
  mutationFn: (t) => fetch(`${u}/${t.kind === "support" ? "support/tickets" : "tasks"}/${t.id}`, {
130
131
  method: "PATCH",
@@ -133,7 +134,7 @@ function Ve({
133
134
  body: JSON.stringify({ status: "done" })
134
135
  }),
135
136
  onSuccess: () => h.invalidateQueries({ queryKey: ["my-work"] })
136
- }), S = F({
137
+ }), S = D({
137
138
  mutationFn: async ({ id: t, action: d }) => {
138
139
  const b = await fetch(`${u}/tasks/${t}/${d}`, {
139
140
  method: "POST",
@@ -145,16 +146,16 @@ function Ve({
145
146
  return d;
146
147
  },
147
148
  onSuccess: (t) => {
148
- D(t === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), h.invalidateQueries({ queryKey: ["my-work"] });
149
+ L(t === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), h.invalidateQueries({ queryKey: ["my-work"] });
149
150
  },
150
- onError: (t) => D(t instanceof Error ? t.message : "Failed")
151
- }), [T, D] = N(null);
151
+ onError: (t) => L(t instanceof Error ? t.message : "Failed")
152
+ }), [T, L] = N(null);
152
153
  E(() => {
153
154
  if (!T) return;
154
- const t = setTimeout(() => D(null), 4e3);
155
+ const t = setTimeout(() => L(null), 4e3);
155
156
  return () => clearTimeout(t);
156
157
  }, [T]);
157
- const Y = F({
158
+ const Y = D({
158
159
  mutationFn: (t) => fetch(`${u}/notifications/mark-read`, {
159
160
  method: "POST",
160
161
  headers: { ...w, "content-type": "application/json" },
@@ -166,17 +167,17 @@ function Ve({
166
167
  }
167
168
  }), k = (t, d) => {
168
169
  const b = {
169
- record: (c, r) => (U({ collection: c, itemId: r }), null),
170
+ record: (m, r) => (U({ collection: m, itemId: r }), null),
170
171
  ...l
171
172
  }, i = Z(t, d, {
172
173
  ...b,
173
- record: (c, r) => {
174
+ record: (m, r) => {
174
175
  var p;
175
- return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, c, r)) ?? null;
176
+ return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, m, r)) ?? null;
176
177
  }
177
178
  });
178
179
  if (i) {
179
- ue(i, (c) => m == null ? void 0 : m(c));
180
+ xe(i, (m) => c == null ? void 0 : c(m));
180
181
  return;
181
182
  }
182
183
  t && d && !/^nivaro_/i.test(t) && t !== "__chat__" && U({ collection: t, itemId: d });
@@ -185,19 +186,20 @@ function Ve({
185
186
  ...l
186
187
  });
187
188
  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: [
189
+ /* @__PURE__ */ e(fe, { onOpenPath: c }),
188
190
  /* @__PURE__ */ s("div", { className: "flex items-start justify-between", children: [
189
191
  /* @__PURE__ */ s("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
190
- /* @__PURE__ */ e(M, { label: "Waiting on you", value: a.counts.owned }),
192
+ /* @__PURE__ */ e(O, { label: "Waiting on you", value: a.counts.owned }),
191
193
  /* @__PURE__ */ e(
192
- M,
194
+ O,
193
195
  {
194
196
  label: "SLA breached",
195
197
  value: a.counts.owned_breached,
196
198
  tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
197
199
  }
198
200
  ),
199
- /* @__PURE__ */ e(M, { label: "Open tasks", value: a.counts.tasks }),
200
- /* @__PURE__ */ e(M, { label: "Unread notifications", value: a.counts.notifications })
201
+ /* @__PURE__ */ e(O, { label: "Open tasks", value: a.counts.tasks }),
202
+ /* @__PURE__ */ e(O, { label: "Unread notifications", value: a.counts.notifications })
201
203
  ] }),
202
204
  R && /* @__PURE__ */ s(
203
205
  "button",
@@ -238,16 +240,16 @@ function Ve({
238
240
  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: [
239
241
  /* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
240
242
  x.order.map((t, d) => {
241
- const b = $e[t] ?? t, i = x.hidden.includes(t), c = (r) => {
243
+ const b = Se[t] ?? t, i = x.hidden.includes(t), m = (r) => {
242
244
  const p = [...x.order], n = d + r;
243
- n < 0 || n >= p.length || ([p[d], p[n]] = [p[n], p[d]], W({ ...x, order: p }));
245
+ n < 0 || n >= p.length || ([p[d], p[n]] = [p[n], p[d]], K({ ...x, order: p }));
244
246
  };
245
247
  return /* @__PURE__ */ s("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
246
248
  /* @__PURE__ */ e(
247
249
  "button",
248
250
  {
249
251
  type: "button",
250
- onClick: () => W({
252
+ onClick: () => K({
251
253
  ...x,
252
254
  hidden: i ? x.hidden.filter((r) => r !== t) : [...x.hidden, t]
253
255
  }),
@@ -267,7 +269,7 @@ function Ve({
267
269
  "button",
268
270
  {
269
271
  type: "button",
270
- onClick: () => c(-1),
272
+ onClick: () => m(-1),
271
273
  disabled: d === 0,
272
274
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
273
275
  children: "↑"
@@ -277,7 +279,7 @@ function Ve({
277
279
  "button",
278
280
  {
279
281
  type: "button",
280
- onClick: () => c(1),
282
+ onClick: () => m(1),
281
283
  disabled: d === x.order.length - 1,
282
284
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
283
285
  children: "↓"
@@ -297,8 +299,8 @@ function Ve({
297
299
  children: T
298
300
  }
299
301
  ),
302
+ /* @__PURE__ */ e(ve, { className: "mb-4" }),
300
303
  /* @__PURE__ */ e(we, { className: "mb-4" }),
301
- /* @__PURE__ */ e(Ne, { className: "mb-4" }),
302
304
  (() => {
303
305
  const t = {
304
306
  records: () => {
@@ -347,8 +349,8 @@ function Ve({
347
349
  children: [
348
350
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: o.label }),
349
351
  /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: o.collection.replace(/_/g, " ") }),
350
- /* @__PURE__ */ e(Oe, { state: o.state, color: o.state_color }),
351
- /* @__PURE__ */ e(je, { sla: o.sla })
352
+ /* @__PURE__ */ e(Me, { state: o.state, color: o.state_color }),
353
+ /* @__PURE__ */ e(Ae, { sla: o.sla })
352
354
  ]
353
355
  }
354
356
  )
@@ -362,7 +364,7 @@ function Ve({
362
364
  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(
363
365
  "li",
364
366
  {
365
- className: O("flex items-center gap-2.5 px-4 py-2", f(`t:${r.id}`)),
367
+ className: A("flex items-center gap-2.5 px-4 py-2", f(`t:${r.id}`)),
366
368
  children: [
367
369
  /* @__PURE__ */ e(
368
370
  "button",
@@ -381,7 +383,7 @@ function Ve({
381
383
  "button",
382
384
  {
383
385
  type: "button",
384
- onClick: () => r.kind === "support" ? P(r.id) : k(r.collection, r.item),
386
+ onClick: () => r.kind === "support" ? W(r.id) : k(r.collection, r.item),
385
387
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
386
388
  children: [
387
389
  r.title,
@@ -392,7 +394,7 @@ function Ve({
392
394
  r.due_date && /* @__PURE__ */ e(
393
395
  "span",
394
396
  {
395
- className: `text-[11px] tabular-nums ${A(r.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
397
+ className: `text-[11px] tabular-nums ${M(r.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
396
398
  children: new Date(r.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
397
399
  }
398
400
  )
@@ -414,7 +416,7 @@ function Ve({
414
416
  (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(
415
417
  "li",
416
418
  {
417
- className: O("flex items-center gap-2.5 px-4 py-2", f(`tt:${r.id}`)),
419
+ className: A("flex items-center gap-2.5 px-4 py-2", f(`tt:${r.id}`)),
418
420
  "data-my-work-team-task": r.id,
419
421
  children: [
420
422
  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" }),
@@ -433,7 +435,7 @@ function Ve({
433
435
  r.due_date && /* @__PURE__ */ e(
434
436
  "span",
435
437
  {
436
- className: `text-[11px] tabular-nums ${A(r.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
438
+ className: `text-[11px] tabular-nums ${M(r.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
437
439
  children: new Date(r.due_date).toLocaleDateString(void 0, {
438
440
  timeZone: "UTC"
439
441
  })
@@ -458,7 +460,7 @@ function Ve({
458
460
  }
459
461
  ),
460
462
  waiting: () => {
461
- const r = a.requested ?? [], p = r.filter((n) => A(n.due_date)).length;
463
+ const r = a.requested ?? [], p = r.filter((n) => M(n.due_date)).length;
462
464
  return /* @__PURE__ */ s(
463
465
  "section",
464
466
  {
@@ -476,18 +478,18 @@ function Ve({
476
478
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
477
479
  ] }),
478
480
  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) => {
479
- const j = A(n.due_date), o = !!n.nudged_at && Date.now() - new Date(n.nudged_at).getTime() < 20 * 36e5;
481
+ const j = M(n.due_date), o = !!n.nudged_at && Date.now() - new Date(n.nudged_at).getTime() < 20 * 36e5;
480
482
  return /* @__PURE__ */ s(
481
483
  "li",
482
484
  {
483
- className: O("flex items-center gap-2.5 px-4 py-2", f(`r:${n.id}`)),
485
+ className: A("flex items-center gap-2.5 px-4 py-2", f(`r:${n.id}`)),
484
486
  "data-my-work-requested": n.id,
485
487
  children: [
486
488
  /* @__PURE__ */ s(
487
489
  "button",
488
490
  {
489
491
  type: "button",
490
- onClick: () => n.kind === "support" ? P(n.id) : k(n.collection, n.item),
492
+ onClick: () => n.kind === "support" ? W(n.id) : k(n.collection, n.item),
491
493
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
492
494
  children: [
493
495
  n.title,
@@ -547,10 +549,10 @@ function Ve({
547
549
  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(
548
550
  "li",
549
551
  {
550
- className: O("flex items-start gap-2.5 px-4 py-2", f(`n:${r.id}`)),
552
+ className: A("flex items-start gap-2.5 px-4 py-2", f(`n:${r.id}`)),
551
553
  children: [
552
554
  /* @__PURE__ */ e(
553
- _e,
555
+ Ce,
554
556
  {
555
557
  userId: r.sender,
556
558
  className: "mt-0.5 h-5 w-5",
@@ -587,37 +589,37 @@ function Ve({
587
589
  }, d = new Map(
588
590
  x.order.filter((r) => !x.hidden.includes(r) && t[r]).map((r) => [r, t[r]()]).filter(([, r]) => r != null)
589
591
  ), b = [...d.keys()], i = [];
590
- let c = 0;
591
- for (; c < b.length; ) {
592
- const r = b[c];
592
+ let m = 0;
593
+ for (; m < b.length; ) {
594
+ const r = b[m];
593
595
  if (r === "records")
594
- i.push(/* @__PURE__ */ e("div", { children: d.get(r) }, r)), c++;
596
+ i.push(/* @__PURE__ */ e("div", { children: d.get(r) }, r)), m++;
595
597
  else {
596
598
  const p = [r];
597
- c + 1 < b.length && b[c + 1] !== "records" && p.push(b[c + 1]), i.push(
599
+ m + 1 < b.length && b[m + 1] !== "records" && p.push(b[m + 1]), i.push(
598
600
  /* @__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("+"))
599
- ), c += p.length;
601
+ ), m += p.length;
600
602
  }
601
603
  }
602
604
  return i;
603
605
  })(),
604
- /* @__PURE__ */ e(Ae, {})
606
+ /* @__PURE__ */ e(Oe, {})
605
607
  ] });
606
608
  }
607
- function Ae() {
608
- const l = ke(), { rooms: m } = ye(l);
609
- return !l || m.length === 0 ? null : /* @__PURE__ */ s(
609
+ function Oe() {
610
+ const l = ye(), { rooms: c } = Ne(l);
611
+ return !l || c.length === 0 ? null : /* @__PURE__ */ s(
610
612
  "section",
611
613
  {
612
614
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
613
615
  "data-my-work-chat": !0,
614
616
  children: [
615
617
  /* @__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" }) }),
616
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: m.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
618
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
617
619
  "button",
618
620
  {
619
621
  type: "button",
620
- onClick: () => fe(u.room, u.label),
622
+ onClick: () => ke(u.room, u.label),
621
623
  className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
622
624
  "data-my-work-chat-room": u.room,
623
625
  children: [
@@ -638,5 +640,5 @@ function Ae() {
638
640
  );
639
641
  }
640
642
  export {
641
- Ve as MyWorkView
643
+ Ze as MyWorkView
642
644
  };