@nivaro/react 0.3.66 → 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 (41) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +15 -1
  4. package/dist/index.js +836 -835
  5. package/dist/shared/components/ActivityEntry.js +28 -28
  6. package/dist/shared/components/CollectionBrowserView.js +584 -585
  7. package/dist/shared/components/ConformanceView.js +34 -34
  8. package/dist/shared/components/ItemEditForm.js +1758 -1758
  9. package/dist/shared/components/RecordCompare.js +149 -129
  10. package/dist/shared/components/ReportView.js +196 -196
  11. package/dist/shared/components/SlaRulesView.js +36 -36
  12. package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
  13. package/dist/shared/components/chat/ChatPanel.js +484 -487
  14. package/dist/shared/components/chat/ChatViews.js +66 -66
  15. package/dist/shared/components/chat/RoomParts.js +159 -157
  16. package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
  17. package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
  18. package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
  19. package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
  20. package/dist/shared/components/integrations/console/EventsView.js +22 -24
  21. package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
  22. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
  23. package/dist/shared/components/integrations/console/tone.js +22 -21
  24. package/dist/shared/components/item-edit/FieldRow.js +188 -188
  25. package/dist/shared/components/item-edit/FilePickerField.js +281 -297
  26. package/dist/shared/components/item-edit/GroupSection.js +209 -209
  27. package/dist/shared/components/item-edit/RecordInsights.js +101 -101
  28. package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
  29. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
  30. package/dist/shared/components/panels/AddendumPanel.js +409 -411
  31. package/dist/shared/components/panels/BranchLanes.js +7 -7
  32. package/dist/shared/components/panels/CommentPanel.js +204 -197
  33. package/dist/shared/components/panels/PipelinePanel.js +264 -264
  34. package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
  35. package/dist/shared/components/panels/RevisionsPanel.js +229 -229
  36. package/dist/shared/components/panels/TaskPanel.js +75 -75
  37. package/dist/shared/components/queue/QueueWorklist.js +591 -589
  38. package/dist/shared/lib/compare-value.js +73 -0
  39. package/dist/shared/lib/format-value.js +18 -17
  40. package/dist/shared/lib/utils.js +87 -80
  41. package/package.json +1 -1
@@ -1,19 +1,20 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { useQueryClient as ne, useQuery as G, useQueries as Ne, useMutation as we } from "@tanstack/react-query";
3
- import { Code2 as Se, ChevronDown as Ce, Loader2 as qe, Send as _e } from "lucide-react";
4
- import { useState as L, useRef as Ee, useEffect as V, useMemo as y, Fragment as Le } from "react";
5
- import { toast as X } from "sonner";
6
- import { useNivaroClient as re, useItemNavigation as Oe, useNavigation as Fe } from "../../context.js";
7
- import { get as Z, post as ie } from "../../lib/commands.js";
8
- import { obligationQueryParams as Te, obligationTabsFor as Ke, toneForOutcome as Y, isRoutableRecord as je, attemptsLabel as Ie, lastResponseLabel as De, lastResponseFull as Pe } from "../../lib/obligation-filters.js";
9
- import { serverNow as Ae } from "../../lib/server-clock.js";
10
- import { titleCase as He, cn as d, formatRelative as le, humanHours as Me } from "../../lib/utils.js";
11
- import { EmptyState as ee } from "../EmptyState.js";
12
- import { ErrorSurface as te } from "../ErrorSurface.js";
2
+ import { useQueryClient as le, useQuery as V, useQueries as Ce, useMutation as qe } from "@tanstack/react-query";
3
+ import { Code2 as _e, ChevronDown as Oe, Loader2 as Ee, Send as Le } from "lucide-react";
4
+ import { useState as E, useRef as Fe, useEffect as X, useMemo as y, Fragment as Te } from "react";
5
+ import { toast as Z } from "sonner";
6
+ import { useNivaroClient as se, useItemNavigation as Ke, useNavigation as Ie } from "../../context.js";
7
+ import { get as Y, post as de } from "../../lib/commands.js";
8
+ import { obligationQueryParams as je, obligationTabsFor as Pe, toneForOutcome as ee, isRoutableRecord as De, attemptsLabel as Re, lastResponseLabel as Ae, lastResponseFull as He } from "../../lib/obligation-filters.js";
9
+ import { plainObligationReason as te } from "../../lib/obligation-reason-text.js";
10
+ import { serverNow as Me } from "../../lib/server-clock.js";
11
+ import { titleCase as ce, cn as d, formatRelative as ue, humanHours as Qe } from "../../lib/utils.js";
12
+ import { EmptyState as oe } from "../EmptyState.js";
13
+ import { ErrorSurface as ne } from "../ErrorSurface.js";
13
14
  import { colorPair as ae } from "../QueryTable.js";
14
- import { TipLayer as Qe } from "../TipLayer.js";
15
- import { SimpleSelectXs as I } from "../ui/SimpleSelect.js";
16
- import { SendCurrentDataButton as Re } from "./SendCurrentData.js";
15
+ import { TipLayer as $e } from "../TipLayer.js";
16
+ import { SimpleSelectXs as P } from "../ui/SimpleSelect.js";
17
+ import { SendCurrentDataButton as Be } from "./SendCurrentData.js";
17
18
  const D = {
18
19
  overdue: "Overdue",
19
20
  failed: "Failed",
@@ -22,7 +23,7 @@ const D = {
22
23
  sent: "Sent",
23
24
  missing: "Missing",
24
25
  superseded: "Superseded"
25
- }, Be = [
26
+ }, Ue = [
26
27
  "overdue",
27
28
  "failed",
28
29
  "pending",
@@ -31,53 +32,53 @@ const D = {
31
32
  "missing",
32
33
  "superseded"
33
34
  ];
34
- function oe(o) {
35
- return o === "danger" ? "negative" : o === "warning" ? "warning" : o === "positive" ? "positive" : null;
35
+ function re(n) {
36
+ return n === "danger" ? "negative" : n === "warning" ? "warning" : n === "positive" ? "positive" : null;
36
37
  }
37
- function $e(o) {
38
- const b = new Date(o).getTime() - Ae();
39
- return b > 0 ? `due in ${Me(b / 36e5)}` : le(o);
38
+ function Je(n) {
39
+ const b = new Date(n).getTime() - Me();
40
+ return b > 0 ? `due in ${Qe(b / 36e5)}` : ue(n);
40
41
  }
41
- function Ue({ obligationId: o }) {
42
- const b = re(), c = ne(), [p, x] = L(!1), n = we({
42
+ function We({ obligationId: n }) {
43
+ const b = se(), c = le(), [p, g] = E(!1), a = qe({
43
44
  mutationFn: () => b.request(
44
- ie(`/integration-obligations/${o}/send`)
45
+ de(`/integration-obligations/${n}/send`)
45
46
  ),
46
47
  onSuccess: (l) => {
47
48
  var u;
48
- X.message(((u = l == null ? void 0 : l.data) == null ? void 0 : u.detail) ?? "Sent"), c.invalidateQueries({ queryKey: ["integration-obligations", "summary"] }), c.invalidateQueries({ queryKey: ["integration-obligations", "list"] });
49
+ Z.message(((u = l == null ? void 0 : l.data) == null ? void 0 : u.detail) ?? "Sent"), c.invalidateQueries({ queryKey: ["integration-obligations", "summary"] }), c.invalidateQueries({ queryKey: ["integration-obligations", "list"] });
49
50
  },
50
51
  onError: (l) => {
51
52
  const u = l == null ? void 0 : l.response;
52
- X.error((u == null ? void 0 : u.error) ?? "Send now failed", { duration: 8e3 });
53
+ Z.error((u == null ? void 0 : u.error) ?? "Send now failed", { duration: 8e3 });
53
54
  },
54
- onSettled: () => x(!1)
55
+ onSettled: () => g(!1)
55
56
  });
56
57
  return /* @__PURE__ */ r(
57
58
  "button",
58
59
  {
59
60
  type: "button",
60
61
  "data-obligation-send-now": !0,
61
- disabled: n.isPending,
62
+ disabled: a.isPending,
62
63
  onClick: (l) => {
63
64
  if (l.stopPropagation(), !p) {
64
- x(!0);
65
+ g(!0);
65
66
  return;
66
67
  }
67
- n.mutate();
68
+ a.mutate();
68
69
  },
69
70
  className: d(
70
71
  "ml-2 inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors disabled:opacity-60",
71
72
  p ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
72
73
  ),
73
74
  children: [
74
- n.isPending ? /* @__PURE__ */ t(qe, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(_e, { className: "h-3 w-3" }),
75
+ a.isPending ? /* @__PURE__ */ t(Ee, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(Le, { className: "h-3 w-3" }),
75
76
  p ? "Confirm?" : "Send now"
76
77
  ]
77
78
  }
78
79
  );
79
80
  }
80
- function Je({ open: o, onToggle: b }) {
81
+ function ze({ open: n, onToggle: b }) {
81
82
  return /* @__PURE__ */ r(
82
83
  "button",
83
84
  {
@@ -88,15 +89,15 @@ function Je({ open: o, onToggle: b }) {
88
89
  },
89
90
  className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10.5px] font-medium text-slate-500 transition-colors hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted",
90
91
  children: [
91
- /* @__PURE__ */ t(Se, { className: "h-3 w-3" }),
92
- o ? "Hide request" : "Show request",
93
- /* @__PURE__ */ t(Ce, { className: d("h-3 w-3 transition-transform", o && "rotate-180") })
92
+ /* @__PURE__ */ t(_e, { className: "h-3 w-3" }),
93
+ n ? "Hide request" : "Show request",
94
+ /* @__PURE__ */ t(Oe, { className: d("h-3 w-3 transition-transform", n && "rotate-180") })
94
95
  ]
95
96
  }
96
97
  );
97
98
  }
98
- function We() {
99
- const o = Fe(), b = "/settings?section=integrations", c = o.consoleUrl ? o.consoleUrl(b) : b;
99
+ function Ge() {
100
+ const n = Ie(), b = "/settings?section=integrations", c = n.consoleUrl ? n.consoleUrl(b) : b;
100
101
  if (!c) return null;
101
102
  const p = /^https?:\/\//.test(c);
102
103
  return /* @__PURE__ */ t(
@@ -105,123 +106,126 @@ function We() {
105
106
  href: c,
106
107
  "data-obligations-settings-link": !0,
107
108
  ...p ? { target: "_blank", rel: "noreferrer" } : {},
108
- onClick: (x) => {
109
- p || x.metaKey || x.ctrlKey || (x.preventDefault(), o.navigate(c));
109
+ onClick: (g) => {
110
+ p || g.metaKey || g.ctrlKey || (g.preventDefault(), n.navigate(c));
110
111
  },
111
112
  className: "underline decoration-dotted hover:text-slate-600 dark:hover:text-slate-200",
112
113
  children: "Settings → Integrations"
113
114
  }
114
115
  );
115
116
  }
116
- function ze(o) {
117
- return o.submission_attempts == null ? null : {
118
- attempts: o.submission_attempts,
119
- status: o.submission_status,
120
- last_error: o.submission_last_error,
121
- response: o.submission_response
117
+ function ie(n) {
118
+ return n.record_label ? n.record_label : /^(nivaro|directus)_/i.test(n.collection) ? n.item : ce(n.collection).replace(/s$/, "");
119
+ }
120
+ function Ve(n) {
121
+ return n.submission_attempts == null ? null : {
122
+ attempts: n.submission_attempts,
123
+ status: n.submission_status,
124
+ last_error: n.submission_last_error,
125
+ response: n.submission_response
122
126
  };
123
127
  }
124
- function Ge(o) {
125
- if (!o) return null;
128
+ function Xe(n) {
129
+ if (!n) return null;
126
130
  try {
127
- return JSON.stringify(JSON.parse(o), null, 2);
131
+ return JSON.stringify(JSON.parse(n), null, 2);
128
132
  } catch {
129
- return o;
133
+ return n;
130
134
  }
131
135
  }
132
136
  const q = 50;
133
- function mt({ api: o, className: b }) {
134
- const c = re(), p = ne(), x = Oe(), [n, l] = L({
135
- api: o ?? null,
137
+ function gt({ api: n, className: b }) {
138
+ const c = se(), p = le(), g = Ke(), [a, l] = E({
139
+ api: n ?? null,
136
140
  kind: null,
137
141
  collection: null,
138
142
  outcome: ["overdue", "failed", "missing"],
139
143
  ageHours: null
140
- }), [u, O] = L(1), [se, P] = L(null), A = Ee(o ?? null);
141
- V(() => {
142
- const e = o ?? null;
143
- e !== A.current && (A.current = e, l((a) => ({ ...a, api: e })));
144
- }, [o]);
144
+ }), [u, L] = E(1), [me, R] = E(null), A = Fe(n ?? null);
145
+ X(() => {
146
+ const e = n ?? null;
147
+ e !== A.current && (A.current = e, l((o) => ({ ...o, api: e })));
148
+ }, [n]);
145
149
  const {
146
150
  data: m,
147
151
  isLoading: H,
148
- isError: de
149
- } = G({
152
+ isError: be
153
+ } = V({
150
154
  queryKey: ["integration-obligations", "summary"],
151
- queryFn: () => c.request(Z("/integration-obligations/summary")),
155
+ queryFn: () => c.request(Y("/integration-obligations/summary")),
152
156
  staleTime: 3e4
153
- }), S = (m == null ? void 0 : m.remediation_enabled) === !0, ce = (m == null ? void 0 : m.notifications_enabled) === !0, M = H ? [] : [
154
- !ce && "notifications off",
157
+ }), S = (m == null ? void 0 : m.remediation_enabled) === !0, pe = (m == null ? void 0 : m.notifications_enabled) === !0, M = H ? [] : [
158
+ !pe && "notifications off",
155
159
  !S && "remediation off"
156
- ].filter((e) => !!e), ue = n.outcome.join(",");
157
- V(() => {
158
- O(1), P(null);
159
- }, [n.api, n.kind, n.collection, ue, n.ageHours]);
160
+ ].filter((e) => !!e), ge = a.outcome.join(",");
161
+ X(() => {
162
+ L(1), R(null);
163
+ }, [a.api, a.kind, a.collection, ge, a.ageHours]);
160
164
  const Q = y(
161
165
  () => ({
162
- ...Te(n),
166
+ ...je(a),
163
167
  page: String(u),
164
168
  limit: String(q)
165
169
  }),
166
- [n, u]
170
+ [a, u]
167
171
  ), {
168
172
  data: N,
169
- isLoading: me,
170
- isFetching: be,
171
- isError: pe
172
- } = G({
173
+ isLoading: he,
174
+ isFetching: xe,
175
+ isError: fe
176
+ } = V({
173
177
  queryKey: ["integration-obligations", "list", Q],
174
- queryFn: () => c.request(Z("/integration-obligations", Q)),
178
+ queryFn: () => c.request(Y("/integration-obligations", Q)),
175
179
  staleTime: 15e3,
176
180
  placeholderData: (e) => e
177
- }), R = (m == null ? void 0 : m.data.apis) ?? [], B = o ? R.filter((e) => e.api === o) : R, w = (m == null ? void 0 : m.data.kinds) ?? [], F = n.api ? w.filter((e) => e.api === n.api) : w, ge = y(() => {
181
+ }), $ = (m == null ? void 0 : m.data.apis) ?? [], B = n ? $.filter((e) => e.api === n) : $, w = (m == null ? void 0 : m.data.kinds) ?? [], F = a.api ? w.filter((e) => e.api === a.api) : w, ve = y(() => {
178
182
  const e = /* @__PURE__ */ new Map();
179
- for (const a of w) e.has(a.kind) || e.set(a.kind, a.label);
183
+ for (const o of w) e.has(o.kind) || e.set(o.kind, o.label);
180
184
  return e;
181
- }, [w]), xe = y(() => {
185
+ }, [w]), ke = y(() => {
182
186
  const e = /* @__PURE__ */ new Map();
183
- for (const a of F)
184
- e.has(a.collection) || e.set(a.collection, He(a.collection));
185
- return [...e.entries()].map(([a, i]) => ({ value: a, label: i })).sort((a, i) => a.label.localeCompare(i.label));
186
- }, [F]), h = y(() => Ke(w, n.api), [w, n.api]), $ = y(
187
+ for (const o of F)
188
+ e.has(o.collection) || e.set(o.collection, ce(o.collection));
189
+ return [...e.entries()].map(([o, i]) => ({ value: o, label: i })).sort((o, i) => o.label.localeCompare(i.label));
190
+ }, [F]), f = y(() => Pe(w, a.api), [w, a.api]), U = y(
187
191
  () => new Set(
188
- (n.kind ?? "").split(",").map((e) => e.trim()).filter(Boolean)
192
+ (a.kind ?? "").split(",").map((e) => e.trim()).filter(Boolean)
189
193
  ),
190
- [n.kind]
191
- ), U = (e) => e.length > 0 && e.length === $.size && e.every((a) => $.has(a)), s = U(h.waiting) ? "waiting" : U(h.inbound) ? "inbound" : "all", T = (e) => {
192
- const a = e === "waiting" ? h.waiting : e === "inbound" ? h.inbound : [];
193
- l((i) => ({ ...i, kind: a.length > 0 ? a.join(",") : null }));
194
+ [a.kind]
195
+ ), J = (e) => e.length > 0 && e.length === U.size && e.every((o) => U.has(o)), s = J(f.waiting) ? "waiting" : J(f.inbound) ? "inbound" : "all", T = (e) => {
196
+ const o = e === "waiting" ? f.waiting : e === "inbound" ? f.inbound : [];
197
+ l((i) => ({ ...i, kind: o.length > 0 ? o.join(",") : null }));
194
198
  }, C = (N == null ? void 0 : N.data) ?? [], _ = (N == null ? void 0 : N.total) ?? 0, K = y(
195
199
  () => s === "waiting" ? [...new Set(C.map((e) => e.collection))] : [],
196
200
  [s, C]
197
- ), j = Ne({
201
+ ), I = Ce({
198
202
  queries: K.map((e) => {
199
- const a = C.filter((i) => i.collection === e).map((i) => i.item);
203
+ const o = C.filter((i) => i.collection === e).map((i) => i.item);
200
204
  return {
201
- queryKey: ["integration-obligations", "owners", e, a.slice().sort().join(",")],
205
+ queryKey: ["integration-obligations", "owners", e, o.slice().sort().join(",")],
202
206
  queryFn: () => c.request(
203
- ie(`/pipelines/instance/${e}/owners/batch`, { ids: a })
207
+ de(`/pipelines/instance/${e}/owners/batch`, { ids: o })
204
208
  ).then((i) => i.data ?? {}),
205
- enabled: a.length > 0,
209
+ enabled: o.length > 0,
206
210
  staleTime: 6e4
207
211
  };
208
212
  })
209
- }), J = y(() => {
213
+ }), W = y(() => {
210
214
  const e = {};
211
- return K.forEach((a, i) => {
212
- var k;
213
- const g = (k = j[i]) == null ? void 0 : k.data;
214
- if (g)
215
- for (const [f, v] of Object.entries(g))
216
- e[`${a}:${f}`] = v.map((E) => E.name).join(", ");
215
+ return K.forEach((o, i) => {
216
+ var v;
217
+ const h = (v = I[i]) == null ? void 0 : v.data;
218
+ if (h)
219
+ for (const [x, k] of Object.entries(h))
220
+ e[`${o}:${x}`] = k.map((O) => O.name).join(", ");
217
221
  }), e;
218
- }, [K, j]), he = j.some((e) => e.isLoading), fe = (e) => {
219
- const a = `${e.collection}:${e.item}`;
220
- return a in J ? J[a] || "—" : he ? "…" : "—";
221
- }, ke = 7 + (s === "waiting" ? 1 : 0) + (s === "inbound" ? 1 : 0) + (S ? 1 : 0), W = (e) => l((a) => ({
222
- ...a,
223
- outcome: a.outcome.includes(e) ? a.outcome.filter((i) => i !== e) : [...a.outcome, e]
224
- })), ve = (e) => l((a) => ({ ...a, api: a.api === e ? null : e }));
222
+ }, [K, I]), ye = I.some((e) => e.isLoading), Ne = (e) => {
223
+ const o = `${e.collection}:${e.item}`;
224
+ return o in W ? W[o] || "—" : ye ? "…" : "—";
225
+ }, we = 7 + (s === "waiting" ? 1 : 0) + (s === "inbound" ? 1 : 0) + (S ? 1 : 0), z = (e) => l((o) => ({
226
+ ...o,
227
+ outcome: o.outcome.includes(e) ? o.outcome.filter((i) => i !== e) : [...o.outcome, e]
228
+ })), Se = (e) => l((o) => ({ ...o, api: o.api === e ? null : e }));
225
229
  return /* @__PURE__ */ r("div", { className: d("space-y-4", b), "data-obligations-board": !0, children: [
226
230
  M.length > 0 && /* @__PURE__ */ r(
227
231
  "p",
@@ -231,12 +235,12 @@ function mt({ api: o, className: b }) {
231
235
  children: [
232
236
  M.join(" · "),
233
237
  " — ",
234
- /* @__PURE__ */ t(We, {})
238
+ /* @__PURE__ */ t(Ge, {})
235
239
  ]
236
240
  }
237
241
  ),
238
- de ? /* @__PURE__ */ t(te, { variant: "500", detail: "Could not load the obligations summary." }) : H ? /* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [1, 2, 3].map((e) => /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : B.length === 0 ? /* @__PURE__ */ t(
239
- ee,
242
+ be ? /* @__PURE__ */ t(ne, { variant: "500", detail: "Could not load the obligations summary." }) : H ? /* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [1, 2, 3].map((e) => /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : B.length === 0 ? /* @__PURE__ */ t(
243
+ oe,
240
244
  {
241
245
  title: "No obligations recorded yet",
242
246
  detail: "The reconcile sweep runs every 15 minutes — once an integration has a registered obligation kind and a message comes due, it shows up here."
@@ -252,40 +256,40 @@ function mt({ api: o, className: b }) {
252
256
  "button",
253
257
  {
254
258
  type: "button",
255
- "aria-pressed": n.api === e.api,
256
- onClick: () => ve(e.api),
257
- "data-tip": n.api === e.api ? "Showing only this partner — click to show all" : void 0,
259
+ "aria-pressed": a.api === e.api,
260
+ onClick: () => Se(e.api),
261
+ "data-tip": a.api === e.api ? "Showing only this partner — click to show all" : void 0,
258
262
  className: d(
259
263
  "text-[13px] font-semibold hover:underline",
260
- n.api === e.api ? "text-nvr-cyan" : "text-slate-800 dark:text-foreground"
264
+ a.api === e.api ? "text-nvr-cyan" : "text-slate-800 dark:text-foreground"
261
265
  ),
262
266
  children: e.api
263
267
  }
264
268
  ),
265
269
  e.oldest_unmet && /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: [
266
270
  "oldest unmet ",
267
- le(e.oldest_unmet)
271
+ ue(e.oldest_unmet)
268
272
  ] })
269
273
  ] }),
270
- /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.tiles.map((a) => {
271
- const i = oe(Y(a.outcome)), [g, k] = i ? ae(i) : [null, null], f = n.api === e.api && n.outcome.includes(a.outcome);
274
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.tiles.map((o) => {
275
+ const i = re(ee(o.outcome)), [h, v] = i ? ae(i) : [null, null], x = a.api === e.api && a.outcome.includes(o.outcome);
272
276
  return /* @__PURE__ */ r(
273
277
  "button",
274
278
  {
275
279
  type: "button",
276
- "data-obligation-tile": a.outcome,
277
- "aria-pressed": f,
280
+ "data-obligation-tile": o.outcome,
281
+ "aria-pressed": x,
278
282
  onClick: () => {
279
- l((v) => ({ ...v, api: e.api })), W(a.outcome);
283
+ l((k) => ({ ...k, api: e.api })), z(o.outcome);
280
284
  },
281
- style: g ? {
282
- "--obt": g,
283
- "--obtd": k
285
+ style: h ? {
286
+ "--obt": h,
287
+ "--obtd": v
284
288
  } : void 0,
285
289
  className: d(
286
290
  "min-w-[68px] flex-1 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-left transition dark:border-border dark:bg-card",
287
- g && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]",
288
- f && "ring-2 ring-nvr-cyan/50"
291
+ h && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]",
292
+ x && "ring-2 ring-nvr-cyan/50"
289
293
  ),
290
294
  children: [
291
295
  /* @__PURE__ */ t(
@@ -294,15 +298,15 @@ function mt({ api: o, className: b }) {
294
298
  "data-obligation-tile-count": !0,
295
299
  className: d(
296
300
  "block text-[15px] font-semibold tabular-nums",
297
- g ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-700 dark:text-foreground"
301
+ h ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-700 dark:text-foreground"
298
302
  ),
299
- children: a.count
303
+ children: o.count
300
304
  }
301
305
  ),
302
- /* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: D[a.outcome] ?? a.outcome })
306
+ /* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: D[o.outcome] ?? o.outcome })
303
307
  ]
304
308
  },
305
- a.outcome
309
+ o.outcome
306
310
  );
307
311
  }) })
308
312
  ]
@@ -313,11 +317,11 @@ function mt({ api: o, className: b }) {
313
317
  /* @__PURE__ */ r("div", { "data-obligation-filter": "kind", className: "flex items-center gap-1.5", children: [
314
318
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Kind" }),
315
319
  /* @__PURE__ */ t(
316
- I,
320
+ P,
317
321
  {
318
322
  ariaLabel: "Filter by obligation kind",
319
- value: n.kind ?? "",
320
- onChange: (e) => l((a) => ({ ...a, kind: e || null })),
323
+ value: a.kind ?? "",
324
+ onChange: (e) => l((o) => ({ ...o, kind: e || null })),
321
325
  options: [
322
326
  { value: "", label: "Every kind" },
323
327
  ...F.map((e) => ({ value: e.kind, label: e.label }))
@@ -328,23 +332,23 @@ function mt({ api: o, className: b }) {
328
332
  /* @__PURE__ */ r("div", { "data-obligations-collection-filter": !0, className: "flex items-center gap-1.5", children: [
329
333
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Collection" }),
330
334
  /* @__PURE__ */ t(
331
- I,
335
+ P,
332
336
  {
333
337
  ariaLabel: "Filter by collection",
334
- value: n.collection ?? "",
335
- onChange: (e) => l((a) => ({ ...a, collection: e || null })),
336
- options: [{ value: "", label: "Every collection" }, ...xe]
338
+ value: a.collection ?? "",
339
+ onChange: (e) => l((o) => ({ ...o, collection: e || null })),
340
+ options: [{ value: "", label: "Every collection" }, ...ke]
337
341
  }
338
342
  )
339
343
  ] }),
340
344
  /* @__PURE__ */ r("div", { "data-obligation-filter": "age", className: "flex items-center gap-1.5", children: [
341
345
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Age" }),
342
346
  /* @__PURE__ */ t(
343
- I,
347
+ P,
344
348
  {
345
349
  ariaLabel: "Filter by obligation age",
346
- value: n.ageHours != null ? String(n.ageHours) : "",
347
- onChange: (e) => l((a) => ({ ...a, ageHours: e ? Number(e) : null })),
350
+ value: a.ageHours != null ? String(a.ageHours) : "",
351
+ onChange: (e) => l((o) => ({ ...o, ageHours: e ? Number(e) : null })),
348
352
  options: [
349
353
  { value: "", label: "Any age" },
350
354
  { value: "1", label: "Older than 1 hour" },
@@ -356,17 +360,17 @@ function mt({ api: o, className: b }) {
356
360
  ] }),
357
361
  /* @__PURE__ */ r("div", { "data-obligation-filter": "outcome", className: "flex flex-wrap items-center gap-1", children: [
358
362
  /* @__PURE__ */ t("span", { className: "mr-0.5 text-[11px] text-slate-400 dark:text-muted-foreground", children: "Outcome" }),
359
- Be.map((e) => {
360
- const a = n.outcome.includes(e);
363
+ Ue.map((e) => {
364
+ const o = a.outcome.includes(e);
361
365
  return /* @__PURE__ */ t(
362
366
  "button",
363
367
  {
364
368
  type: "button",
365
- "aria-pressed": a,
366
- onClick: () => W(e),
369
+ "aria-pressed": o,
370
+ onClick: () => z(e),
367
371
  className: d(
368
372
  "inline-flex h-6 items-center rounded-full border px-2 text-[10.5px] font-medium transition-colors",
369
- a ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-slate-500 dark:bg-slate-700 dark:text-slate-100" : "border-transparent text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:text-muted-foreground dark:hover:border-slate-600 dark:hover:bg-slate-800"
373
+ o ? "border-slate-400 bg-slate-100 text-slate-900 dark:border-slate-500 dark:bg-slate-700 dark:text-slate-100" : "border-transparent text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:text-muted-foreground dark:hover:border-slate-600 dark:hover:bg-slate-800"
370
374
  ),
371
375
  children: D[e] ?? e
372
376
  },
@@ -374,7 +378,7 @@ function mt({ api: o, className: b }) {
374
378
  );
375
379
  })
376
380
  ] }),
377
- (n.api || n.kind || n.collection || n.ageHours != null) && /* @__PURE__ */ t(
381
+ (a.api || a.kind || a.collection || a.ageHours != null) && /* @__PURE__ */ t(
378
382
  "button",
379
383
  {
380
384
  type: "button",
@@ -390,7 +394,7 @@ function mt({ api: o, className: b }) {
390
394
  }
391
395
  )
392
396
  ] }),
393
- n.api && (h.waiting.length > 0 || h.inbound.length > 0) && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1", "data-obligation-filter": "tab", children: [
397
+ a.api && (f.waiting.length > 0 || f.inbound.length > 0) && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1", "data-obligation-filter": "tab", children: [
394
398
  /* @__PURE__ */ t(
395
399
  "button",
396
400
  {
@@ -405,7 +409,7 @@ function mt({ api: o, className: b }) {
405
409
  children: "All"
406
410
  }
407
411
  ),
408
- h.waiting.length > 0 && /* @__PURE__ */ t(
412
+ f.waiting.length > 0 && /* @__PURE__ */ t(
409
413
  "button",
410
414
  {
411
415
  type: "button",
@@ -419,7 +423,7 @@ function mt({ api: o, className: b }) {
419
423
  children: "Waiting on a person"
420
424
  }
421
425
  ),
422
- h.inbound.length > 0 && /* @__PURE__ */ t(
426
+ f.inbound.length > 0 && /* @__PURE__ */ t(
423
427
  "button",
424
428
  {
425
429
  type: "button",
@@ -434,13 +438,13 @@ function mt({ api: o, className: b }) {
434
438
  }
435
439
  )
436
440
  ] }),
437
- pe ? /* @__PURE__ */ t(te, { variant: "500", detail: "Could not load obligations for this filter." }) : me ? /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(
441
+ fe ? /* @__PURE__ */ t(ne, { variant: "500", detail: "Could not load obligations for this filter." }) : he ? /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(
438
442
  "div",
439
443
  {
440
444
  className: "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card",
441
445
  "data-obligations-empty": !0,
442
446
  children: /* @__PURE__ */ t(
443
- ee,
447
+ oe,
444
448
  {
445
449
  title: "Nothing outstanding for this filter",
446
450
  detail: "Every message the partner expects, for this outcome, has landed."
@@ -452,7 +456,7 @@ function mt({ api: o, className: b }) {
452
456
  {
453
457
  className: d(
454
458
  "overflow-x-auto rounded-xl border border-slate-200 dark:border-border",
455
- be && "opacity-60 transition-opacity"
459
+ xe && "opacity-60 transition-opacity"
456
460
  ),
457
461
  children: [
458
462
  /* @__PURE__ */ r("table", { className: "w-full text-[12px] tabular-nums", children: [
@@ -469,32 +473,45 @@ function mt({ api: o, className: b }) {
469
473
  S && /* @__PURE__ */ t("th", { className: "px-3 py-1.5 font-medium" })
470
474
  ] }) }),
471
475
  /* @__PURE__ */ t("tbody", { children: C.map((e) => {
472
- const a = oe(Y(e.outcome)), [i, g] = a ? ae(a) : [null, null], k = S && (e.outcome === "failed" || e.outcome === "missing" || e.outcome === "overdue"), f = je(e.collection), v = ze(e), E = s === "inbound" && se === e.id, z = Ge(e.detail);
473
- return /* @__PURE__ */ r(Le, { children: [
476
+ const o = re(ee(e.outcome)), [i, h] = o ? ae(o) : [null, null], v = S && (e.outcome === "failed" || e.outcome === "missing" || e.outcome === "overdue"), x = De(e.collection), k = Ve(e), O = s === "inbound" && me === e.id, G = Xe(e.detail);
477
+ return /* @__PURE__ */ r(Te, { children: [
474
478
  /* @__PURE__ */ r(
475
479
  "tr",
476
480
  {
477
481
  "data-obligation-row": e.id,
478
- "data-obligation-routable": f ? "1" : "0",
482
+ "data-obligation-routable": x ? "1" : "0",
479
483
  className: d(
480
484
  "border-b border-slate-100 last:border-0 dark:border-border/60",
481
- f && "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted"
485
+ x && "cursor-pointer hover:bg-slate-50 dark:hover:bg-muted"
482
486
  ),
483
- onClick: f ? () => x.open({ collection: e.collection, itemId: e.item }) : void 0,
487
+ onClick: x ? () => g.open({ collection: e.collection, itemId: e.item }) : void 0,
484
488
  children: [
485
- /* @__PURE__ */ r("td", { className: "px-3 py-1.5 font-medium text-slate-700 dark:text-slate-200", children: [
486
- e.collection,
487
- " · ",
488
- e.item
489
- ] }),
490
- /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children: ge.get(e.kind) ?? e.kind }),
491
- /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: $e(e.due_at) }),
489
+ /* @__PURE__ */ t(
490
+ "td",
491
+ {
492
+ className: "px-3 py-1.5 font-medium text-slate-700 dark:text-slate-200",
493
+ "data-obligation-record": !0,
494
+ children: x ? /* @__PURE__ */ t(
495
+ "button",
496
+ {
497
+ type: "button",
498
+ onClick: (j) => {
499
+ j.stopPropagation(), g.open({ collection: e.collection, itemId: e.item });
500
+ },
501
+ className: "rounded text-left underline decoration-slate-300 underline-offset-2 hover:decoration-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:decoration-slate-600 dark:hover:decoration-slate-400",
502
+ children: ie(e)
503
+ }
504
+ ) : ie(e)
505
+ }
506
+ ),
507
+ /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children: ve.get(e.kind) ?? e.kind }),
508
+ /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: Je(e.due_at) }),
492
509
  /* @__PURE__ */ t("td", { className: "px-3 py-1.5", "data-obligation-outcome": e.outcome, children: /* @__PURE__ */ r(
493
510
  "span",
494
511
  {
495
512
  style: i ? {
496
513
  "--obt": i,
497
- "--obtd": g
514
+ "--obtd": h
498
515
  } : void 0,
499
516
  className: d(
500
517
  "inline-flex items-center gap-1 font-medium",
@@ -515,19 +532,13 @@ function mt({ api: o, className: b }) {
515
532
  ]
516
533
  }
517
534
  ) }),
518
- /* @__PURE__ */ r(
535
+ /* @__PURE__ */ t(
519
536
  "td",
520
537
  {
521
538
  className: "max-w-[38ch] truncate px-3 py-1.5 text-slate-500 dark:text-muted-foreground",
522
539
  "data-obligation-reason": !0,
523
- "data-tip": e.reason ?? void 0,
524
- children: [
525
- e.reason ?? "—",
526
- e.submission_id != null && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-300 dark:text-slate-600", children: [
527
- "· submission #",
528
- e.submission_id
529
- ] })
530
- ]
540
+ "data-tip": e.reason ? te(e.reason) : void 0,
541
+ children: e.reason ? te(e.reason) : "—"
531
542
  }
532
543
  ),
533
544
  /* @__PURE__ */ t(
@@ -535,7 +546,7 @@ function mt({ api: o, className: b }) {
535
546
  {
536
547
  className: "hidden px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
537
548
  "data-obligations-col-attempts": !0,
538
- children: Ie(v, e.reason)
549
+ children: Re(k, e.reason)
539
550
  }
540
551
  ),
541
552
  /* @__PURE__ */ t(
@@ -543,8 +554,8 @@ function mt({ api: o, className: b }) {
543
554
  {
544
555
  className: "hidden max-w-[28ch] truncate px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
545
556
  "data-obligations-last-response": !0,
546
- "data-tip": Pe(v) ?? void 0,
547
- children: De(e.outcome, v)
557
+ "data-tip": He(k) ?? void 0,
558
+ children: Ae(e.outcome, k)
548
559
  }
549
560
  ),
550
561
  s === "waiting" && /* @__PURE__ */ t(
@@ -552,20 +563,20 @@ function mt({ api: o, className: b }) {
552
563
  {
553
564
  className: "px-3 py-1.5 text-slate-600 dark:text-slate-300",
554
565
  "data-obligations-owner": !0,
555
- children: fe(e)
566
+ children: Ne(e)
556
567
  }
557
568
  ),
558
569
  s === "inbound" && /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-right", children: /* @__PURE__ */ t(
559
- Je,
570
+ ze,
560
571
  {
561
- open: E,
562
- onToggle: () => P((ye) => ye === e.id ? null : e.id)
572
+ open: O,
573
+ onToggle: () => R((j) => j === e.id ? null : e.id)
563
574
  }
564
575
  ) }),
565
576
  S && /* @__PURE__ */ r("td", { className: "px-3 py-1.5 text-right", children: [
566
- k && e.can_resend !== !1 && /* @__PURE__ */ t(Ue, { obligationId: e.id }),
567
- k && e.can_send_current === !0 && /* @__PURE__ */ t(
568
- Re,
577
+ v && e.can_resend !== !1 && /* @__PURE__ */ t(We, { obligationId: e.id }),
578
+ v && e.can_send_current === !0 && /* @__PURE__ */ t(
579
+ Be,
569
580
  {
570
581
  obligationId: e.id,
571
582
  api: e.api,
@@ -583,17 +594,17 @@ function mt({ api: o, className: b }) {
583
594
  ]
584
595
  }
585
596
  ),
586
- E && /* @__PURE__ */ t(
597
+ O && /* @__PURE__ */ t(
587
598
  "tr",
588
599
  {
589
600
  className: "border-b border-slate-100 dark:border-border/60",
590
601
  children: /* @__PURE__ */ t(
591
602
  "td",
592
603
  {
593
- colSpan: ke,
604
+ colSpan: we,
594
605
  className: "bg-slate-50 px-3 py-2 dark:bg-muted",
595
606
  "data-obligations-detail": !0,
596
- children: z ? /* @__PURE__ */ t("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md border border-slate-200 bg-white p-2 font-mono text-[10.5px] leading-4 text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300", children: z }) : /* @__PURE__ */ t("p", { className: "text-[11px] italic text-slate-400 dark:text-muted-foreground", children: "No request detail was stored for this rejection — the reason column above is everything the ledger recorded." })
607
+ children: G ? /* @__PURE__ */ t("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md border border-slate-200 bg-white p-2 font-mono text-[10.5px] leading-4 text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-300", children: G }) : /* @__PURE__ */ t("p", { className: "text-[11px] italic text-slate-400 dark:text-muted-foreground", children: "No request detail was stored for this rejection — the reason column above is everything the ledger recorded." })
597
608
  }
598
609
  )
599
610
  },
@@ -616,7 +627,7 @@ function mt({ api: o, className: b }) {
616
627
  {
617
628
  type: "button",
618
629
  disabled: u <= 1,
619
- onClick: () => O((e) => Math.max(1, e - 1)),
630
+ onClick: () => L((e) => Math.max(1, e - 1)),
620
631
  className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
621
632
  children: "Prev"
622
633
  }
@@ -626,7 +637,7 @@ function mt({ api: o, className: b }) {
626
637
  {
627
638
  type: "button",
628
639
  disabled: u * q >= _,
629
- onClick: () => O((e) => e + 1),
640
+ onClick: () => L((e) => e + 1),
630
641
  className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
631
642
  children: "Next"
632
643
  }
@@ -636,10 +647,11 @@ function mt({ api: o, className: b }) {
636
647
  ]
637
648
  }
638
649
  ),
639
- /* @__PURE__ */ t(Qe, {})
650
+ /* @__PURE__ */ t($e, {})
640
651
  ] });
641
652
  }
642
653
  export {
643
- mt as IntegrationObligationsView,
644
- oe as roleForTone
654
+ gt as IntegrationObligationsView,
655
+ ie as obligationRecordText,
656
+ re as roleForTone
645
657
  };