@nivaro/react 0.3.64 → 0.3.66

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 (74) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +62 -8
  4. package/dist/shared/components/CollectionBrowserView.js +3127 -3204
  5. package/dist/shared/components/ConformanceView.js +235 -221
  6. package/dist/shared/components/DataTable.js +478 -459
  7. package/dist/shared/components/ItemEditForm.js +4842 -4500
  8. package/dist/shared/components/MyWorkView.js +124 -113
  9. package/dist/shared/components/PageRenderer.js +146 -138
  10. package/dist/shared/components/ProfileView.js +483 -472
  11. package/dist/shared/components/RecordDrilldownSheet.js +73 -65
  12. package/dist/shared/components/ReportView.js +1100 -1094
  13. package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
  14. package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
  15. package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
  16. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
  17. package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
  18. package/dist/shared/components/bulk/bulk-field-options.js +29 -23
  19. package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
  20. package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
  21. package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
  22. package/dist/shared/components/integrations/SendCurrentData.js +126 -0
  23. package/dist/shared/components/item-edit/CatalogPickerField.js +1535 -1440
  24. package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
  25. package/dist/shared/components/item-edit/FieldRow.js +413 -403
  26. package/dist/shared/components/item-edit/GroupSection.js +555 -538
  27. package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
  28. package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
  29. package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
  31. package/dist/shared/components/item-edit/PlanGrid.js +783 -724
  32. package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
  33. package/dist/shared/components/item-edit/RecordInsights.js +113 -111
  34. package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
  35. package/dist/shared/components/item-edit/RelationCombobox.js +398 -364
  36. package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
  37. package/dist/shared/components/item-edit/UserChip.js +264 -229
  38. package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -0
  39. package/dist/shared/components/item-edit/collision-format.js +37 -0
  40. package/dist/shared/components/item-edit/field-a11y.js +25 -0
  41. package/dist/shared/components/item-edit/header-path-preview.js +52 -0
  42. package/dist/shared/components/item-edit/line-merge.js +84 -0
  43. package/dist/shared/components/item-edit/line-midair.js +94 -87
  44. package/dist/shared/components/item-edit/move-guard.js +17 -0
  45. package/dist/shared/components/item-edit/picker-search.js +27 -16
  46. package/dist/shared/components/item-edit/rail-width.js +8 -0
  47. package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
  48. package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
  49. package/dist/shared/components/panels/CommentPanel.js +142 -136
  50. package/dist/shared/components/panels/ItemLockBanner.js +246 -240
  51. package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
  52. package/dist/shared/components/panels/RevisionsPanel.js +106 -102
  53. package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
  54. package/dist/shared/components/panels/SlaClock.js +90 -68
  55. package/dist/shared/components/queue/QueueItemSheet.js +94 -87
  56. package/dist/shared/components/queue/QueueWorklist.js +1522 -1347
  57. package/dist/shared/components/queue/worklist-csv.js +75 -0
  58. package/dist/shared/components/queue/worklist-helpers.js +20 -0
  59. package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
  60. package/dist/shared/lib/bulk-copy.js +17 -0
  61. package/dist/shared/lib/cbv-export.js +122 -0
  62. package/dist/shared/lib/delete-offer.js +13 -0
  63. package/dist/shared/lib/error-hints.js +1 -0
  64. package/dist/shared/lib/leave-guard.js +41 -26
  65. package/dist/shared/lib/list-link.js +72 -56
  66. package/dist/shared/lib/live-queries.js +32 -30
  67. package/dist/shared/lib/moved-notice.js +25 -0
  68. package/dist/shared/lib/notification-target.js +56 -54
  69. package/dist/shared/lib/obligation-banner.js +11 -8
  70. package/dist/shared/lib/obligation-reason-text.js +6 -6
  71. package/dist/shared/lib/quick-filter-cascade.js +29 -19
  72. package/dist/shared/lib/sort-cycle.js +6 -0
  73. package/dist/shared/lib/summary-mode.js +59 -41
  74. package/package.json +1 -1
@@ -1,19 +1,20 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { useQuery as z, useQueries as ve, useQueryClient as ye, useMutation as Ne } from "@tanstack/react-query";
3
- import { Code2 as we, ChevronDown as Se, Loader2 as Ce, Send as Ee } from "lucide-react";
4
- import { useState as q, useRef as Le, useEffect as G, useMemo as v, Fragment as Oe } from "react";
5
- import { toast as V } from "sonner";
6
- import { useNivaroClient as oe, useItemNavigation as qe, useNavigation as Fe } from "../../context.js";
7
- import { get as X, post as ne } from "../../lib/commands.js";
8
- import { obligationQueryParams as _e, obligationTabsFor as Te, toneForOutcome as Z, isRoutableRecord as je, attemptsLabel as Ke, lastResponseLabel as Ie, lastResponseFull as Pe } from "../../lib/obligation-filters.js";
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
9
  import { serverNow as Ae } from "../../lib/server-clock.js";
10
- import { titleCase as De, cn as d, formatRelative as re, humanHours as He } from "../../lib/utils.js";
11
- import { EmptyState as Y } from "../EmptyState.js";
12
- import { ErrorSurface as ee } from "../ErrorSurface.js";
13
- import { colorPair as te } from "../QueryTable.js";
14
- import { TipLayer as Me } from "../TipLayer.js";
15
- import { SimpleSelectXs as K } from "../ui/SimpleSelect.js";
16
- const I = {
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";
13
+ 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";
17
+ const D = {
17
18
  overdue: "Overdue",
18
19
  failed: "Failed",
19
20
  pending: "Pending",
@@ -21,7 +22,7 @@ const I = {
21
22
  sent: "Sent",
22
23
  missing: "Missing",
23
24
  superseded: "Superseded"
24
- }, Re = [
25
+ }, Be = [
25
26
  "overdue",
26
27
  "failed",
27
28
  "pending",
@@ -30,53 +31,53 @@ const I = {
30
31
  "missing",
31
32
  "superseded"
32
33
  ];
33
- function ae(n) {
34
- return n === "danger" ? "negative" : n === "warning" ? "warning" : n === "positive" ? "positive" : null;
34
+ function oe(o) {
35
+ return o === "danger" ? "negative" : o === "warning" ? "warning" : o === "positive" ? "positive" : null;
35
36
  }
36
- function $e(n) {
37
- const b = new Date(n).getTime() - Ae();
38
- return b > 0 ? `due in ${He(b / 36e5)}` : re(n);
37
+ function $e(o) {
38
+ const b = new Date(o).getTime() - Ae();
39
+ return b > 0 ? `due in ${Me(b / 36e5)}` : le(o);
39
40
  }
40
- function Be({ obligationId: n }) {
41
- const b = oe(), c = ye(), [x, o] = q(!1), u = Ne({
41
+ function Ue({ obligationId: o }) {
42
+ const b = re(), c = ne(), [p, x] = L(!1), n = we({
42
43
  mutationFn: () => b.request(
43
- ne(`/integration-obligations/${n}/send`)
44
+ ie(`/integration-obligations/${o}/send`)
44
45
  ),
45
46
  onSuccess: (l) => {
46
- var p;
47
- V.message(((p = l == null ? void 0 : l.data) == null ? void 0 : p.detail) ?? "Sent"), c.invalidateQueries({ queryKey: ["integration-obligations", "summary"] }), c.invalidateQueries({ queryKey: ["integration-obligations", "list"] });
47
+ 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"] });
48
49
  },
49
50
  onError: (l) => {
50
- const p = l == null ? void 0 : l.response;
51
- V.error((p == null ? void 0 : p.error) ?? "Send now failed", { duration: 8e3 });
51
+ const u = l == null ? void 0 : l.response;
52
+ X.error((u == null ? void 0 : u.error) ?? "Send now failed", { duration: 8e3 });
52
53
  },
53
- onSettled: () => o(!1)
54
+ onSettled: () => x(!1)
54
55
  });
55
56
  return /* @__PURE__ */ r(
56
57
  "button",
57
58
  {
58
59
  type: "button",
59
60
  "data-obligation-send-now": !0,
60
- disabled: u.isPending,
61
+ disabled: n.isPending,
61
62
  onClick: (l) => {
62
- if (l.stopPropagation(), !x) {
63
- o(!0);
63
+ if (l.stopPropagation(), !p) {
64
+ x(!0);
64
65
  return;
65
66
  }
66
- u.mutate();
67
+ n.mutate();
67
68
  },
68
69
  className: d(
69
70
  "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",
70
- x ? "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"
71
+ 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"
71
72
  ),
72
73
  children: [
73
- u.isPending ? /* @__PURE__ */ t(Ce, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(Ee, { className: "h-3 w-3" }),
74
- x ? "Confirm?" : "Send now"
74
+ n.isPending ? /* @__PURE__ */ t(qe, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(_e, { className: "h-3 w-3" }),
75
+ p ? "Confirm?" : "Send now"
75
76
  ]
76
77
  }
77
78
  );
78
79
  }
79
- function Qe({ open: n, onToggle: b }) {
80
+ function Je({ open: o, onToggle: b }) {
80
81
  return /* @__PURE__ */ r(
81
82
  "button",
82
83
  {
@@ -87,160 +88,160 @@ function Qe({ open: n, onToggle: b }) {
87
88
  },
88
89
  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",
89
90
  children: [
90
- /* @__PURE__ */ t(we, { className: "h-3 w-3" }),
91
- n ? "Hide request" : "Show request",
92
- /* @__PURE__ */ t(Se, { className: d("h-3 w-3 transition-transform", n && "rotate-180") })
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") })
93
94
  ]
94
95
  }
95
96
  );
96
97
  }
97
- function Ue() {
98
- const n = Fe(), b = "/settings?section=integrations", c = n.consoleUrl ? n.consoleUrl(b) : b;
98
+ function We() {
99
+ const o = Fe(), b = "/settings?section=integrations", c = o.consoleUrl ? o.consoleUrl(b) : b;
99
100
  if (!c) return null;
100
- const x = /^https?:\/\//.test(c);
101
+ const p = /^https?:\/\//.test(c);
101
102
  return /* @__PURE__ */ t(
102
103
  "a",
103
104
  {
104
105
  href: c,
105
106
  "data-obligations-settings-link": !0,
106
- ...x ? { target: "_blank", rel: "noreferrer" } : {},
107
- onClick: (o) => {
108
- x || o.metaKey || o.ctrlKey || (o.preventDefault(), n.navigate(c));
107
+ ...p ? { target: "_blank", rel: "noreferrer" } : {},
108
+ onClick: (x) => {
109
+ p || x.metaKey || x.ctrlKey || (x.preventDefault(), o.navigate(c));
109
110
  },
110
111
  className: "underline decoration-dotted hover:text-slate-600 dark:hover:text-slate-200",
111
112
  children: "Settings → Integrations"
112
113
  }
113
114
  );
114
115
  }
115
- function Je(n) {
116
- return n.submission_attempts == null ? null : {
117
- attempts: n.submission_attempts,
118
- status: n.submission_status,
119
- last_error: n.submission_last_error,
120
- response: n.submission_response
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
121
122
  };
122
123
  }
123
- function We(n) {
124
- if (!n) return null;
124
+ function Ge(o) {
125
+ if (!o) return null;
125
126
  try {
126
- return JSON.stringify(JSON.parse(n), null, 2);
127
+ return JSON.stringify(JSON.parse(o), null, 2);
127
128
  } catch {
128
- return n;
129
+ return o;
129
130
  }
130
131
  }
131
- const E = 50;
132
- function dt({ api: n, className: b }) {
133
- const c = oe(), x = qe(), [o, u] = q({
134
- api: n ?? null,
132
+ 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,
135
136
  kind: null,
136
137
  collection: null,
137
138
  outcome: ["overdue", "failed", "missing"],
138
139
  ageHours: null
139
- }), [l, p] = q(1), [ie, P] = q(null), A = Le(n ?? null);
140
- G(() => {
141
- const e = n ?? null;
142
- e !== A.current && (A.current = e, u((a) => ({ ...a, api: e })));
143
- }, [n]);
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
145
  const {
145
146
  data: m,
146
- isLoading: D,
147
- isError: le
148
- } = z({
147
+ isLoading: H,
148
+ isError: de
149
+ } = G({
149
150
  queryKey: ["integration-obligations", "summary"],
150
- queryFn: () => c.request(X("/integration-obligations/summary")),
151
+ queryFn: () => c.request(Z("/integration-obligations/summary")),
151
152
  staleTime: 3e4
152
- }), S = (m == null ? void 0 : m.remediation_enabled) === !0, se = (m == null ? void 0 : m.notifications_enabled) === !0, H = D ? [] : [
153
- !se && "notifications off",
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",
154
155
  !S && "remediation off"
155
- ].filter((e) => !!e), de = o.outcome.join(",");
156
- G(() => {
157
- p(1), P(null);
158
- }, [o.api, o.kind, o.collection, de, o.ageHours]);
159
- const M = v(
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
+ const Q = y(
160
161
  () => ({
161
- ..._e(o),
162
- page: String(l),
163
- limit: String(E)
162
+ ...Te(n),
163
+ page: String(u),
164
+ limit: String(q)
164
165
  }),
165
- [o, l]
166
+ [n, u]
166
167
  ), {
167
- data: y,
168
- isLoading: ce,
169
- isFetching: ue,
170
- isError: me
171
- } = z({
172
- queryKey: ["integration-obligations", "list", M],
173
- queryFn: () => c.request(X("/integration-obligations", M)),
168
+ data: N,
169
+ isLoading: me,
170
+ isFetching: be,
171
+ isError: pe
172
+ } = G({
173
+ queryKey: ["integration-obligations", "list", Q],
174
+ queryFn: () => c.request(Z("/integration-obligations", Q)),
174
175
  staleTime: 15e3,
175
176
  placeholderData: (e) => e
176
- }), R = (m == null ? void 0 : m.data.apis) ?? [], $ = n ? R.filter((e) => e.api === n) : R, N = (m == null ? void 0 : m.data.kinds) ?? [], F = o.api ? N.filter((e) => e.api === o.api) : N, be = v(() => {
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(() => {
177
178
  const e = /* @__PURE__ */ new Map();
178
- for (const a of N) e.has(a.kind) || e.set(a.kind, a.label);
179
+ for (const a of w) e.has(a.kind) || e.set(a.kind, a.label);
179
180
  return e;
180
- }, [N]), pe = v(() => {
181
+ }, [w]), xe = y(() => {
181
182
  const e = /* @__PURE__ */ new Map();
182
183
  for (const a of F)
183
- e.has(a.collection) || e.set(a.collection, De(a.collection));
184
+ e.has(a.collection) || e.set(a.collection, He(a.collection));
184
185
  return [...e.entries()].map(([a, i]) => ({ value: a, label: i })).sort((a, i) => a.label.localeCompare(i.label));
185
- }, [F]), h = v(() => Te(N, o.api), [N, o.api]), B = v(
186
+ }, [F]), h = y(() => Ke(w, n.api), [w, n.api]), $ = y(
186
187
  () => new Set(
187
- (o.kind ?? "").split(",").map((e) => e.trim()).filter(Boolean)
188
+ (n.kind ?? "").split(",").map((e) => e.trim()).filter(Boolean)
188
189
  ),
189
- [o.kind]
190
- ), Q = (e) => e.length > 0 && e.length === B.size && e.every((a) => B.has(a)), s = Q(h.waiting) ? "waiting" : Q(h.inbound) ? "inbound" : "all", _ = (e) => {
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) => {
191
192
  const a = e === "waiting" ? h.waiting : e === "inbound" ? h.inbound : [];
192
- u((i) => ({ ...i, kind: a.length > 0 ? a.join(",") : null }));
193
- }, C = (y == null ? void 0 : y.data) ?? [], L = (y == null ? void 0 : y.total) ?? 0, T = v(
193
+ l((i) => ({ ...i, kind: a.length > 0 ? a.join(",") : null }));
194
+ }, C = (N == null ? void 0 : N.data) ?? [], _ = (N == null ? void 0 : N.total) ?? 0, K = y(
194
195
  () => s === "waiting" ? [...new Set(C.map((e) => e.collection))] : [],
195
196
  [s, C]
196
- ), j = ve({
197
- queries: T.map((e) => {
197
+ ), j = Ne({
198
+ queries: K.map((e) => {
198
199
  const a = C.filter((i) => i.collection === e).map((i) => i.item);
199
200
  return {
200
201
  queryKey: ["integration-obligations", "owners", e, a.slice().sort().join(",")],
201
202
  queryFn: () => c.request(
202
- ne(`/pipelines/instance/${e}/owners/batch`, { ids: a })
203
+ ie(`/pipelines/instance/${e}/owners/batch`, { ids: a })
203
204
  ).then((i) => i.data ?? {}),
204
205
  enabled: a.length > 0,
205
206
  staleTime: 6e4
206
207
  };
207
208
  })
208
- }), U = v(() => {
209
+ }), J = y(() => {
209
210
  const e = {};
210
- return T.forEach((a, i) => {
211
- var w;
212
- const g = (w = j[i]) == null ? void 0 : w.data;
211
+ return K.forEach((a, i) => {
212
+ var k;
213
+ const g = (k = j[i]) == null ? void 0 : k.data;
213
214
  if (g)
214
- for (const [f, k] of Object.entries(g))
215
- e[`${a}:${f}`] = k.map((O) => O.name).join(", ");
215
+ for (const [f, v] of Object.entries(g))
216
+ e[`${a}:${f}`] = v.map((E) => E.name).join(", ");
216
217
  }), e;
217
- }, [T, j]), ge = j.some((e) => e.isLoading), xe = (e) => {
218
+ }, [K, j]), he = j.some((e) => e.isLoading), fe = (e) => {
218
219
  const a = `${e.collection}:${e.item}`;
219
- return a in U ? U[a] || "—" : ge ? "…" : "—";
220
- }, he = 7 + (s === "waiting" ? 1 : 0) + (s === "inbound" ? 1 : 0) + (S ? 1 : 0), J = (e) => u((a) => ({
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) => ({
221
222
  ...a,
222
223
  outcome: a.outcome.includes(e) ? a.outcome.filter((i) => i !== e) : [...a.outcome, e]
223
- })), fe = (e) => u((a) => ({ ...a, api: a.api === e ? null : e }));
224
+ })), ve = (e) => l((a) => ({ ...a, api: a.api === e ? null : e }));
224
225
  return /* @__PURE__ */ r("div", { className: d("space-y-4", b), "data-obligations-board": !0, children: [
225
- H.length > 0 && /* @__PURE__ */ r(
226
+ M.length > 0 && /* @__PURE__ */ r(
226
227
  "p",
227
228
  {
228
229
  "data-obligations-switch-status": !0,
229
230
  className: "text-[11px] text-slate-400 dark:text-muted-foreground",
230
231
  children: [
231
- H.join(" · "),
232
+ M.join(" · "),
232
233
  " — ",
233
- /* @__PURE__ */ t(Ue, {})
234
+ /* @__PURE__ */ t(We, {})
234
235
  ]
235
236
  }
236
237
  ),
237
- le ? /* @__PURE__ */ t(ee, { variant: "500", detail: "Could not load the obligations summary." }) : D ? /* @__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)) }) : $.length === 0 ? /* @__PURE__ */ t(
238
- Y,
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,
239
240
  {
240
241
  title: "No obligations recorded yet",
241
242
  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."
242
243
  }
243
- ) : /* @__PURE__ */ t("div", { className: "space-y-3", children: $.map((e) => /* @__PURE__ */ r(
244
+ ) : /* @__PURE__ */ t("div", { className: "space-y-3", children: B.map((e) => /* @__PURE__ */ r(
244
245
  "div",
245
246
  {
246
247
  "data-obligation-api": e.api,
@@ -251,23 +252,23 @@ function dt({ api: n, className: b }) {
251
252
  "button",
252
253
  {
253
254
  type: "button",
254
- "aria-pressed": o.api === e.api,
255
- onClick: () => fe(e.api),
256
- "data-tip": o.api === e.api ? "Showing only this partner — click to show all" : void 0,
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,
257
258
  className: d(
258
259
  "text-[13px] font-semibold hover:underline",
259
- o.api === e.api ? "text-nvr-cyan" : "text-slate-800 dark:text-foreground"
260
+ n.api === e.api ? "text-nvr-cyan" : "text-slate-800 dark:text-foreground"
260
261
  ),
261
262
  children: e.api
262
263
  }
263
264
  ),
264
265
  e.oldest_unmet && /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: [
265
266
  "oldest unmet ",
266
- re(e.oldest_unmet)
267
+ le(e.oldest_unmet)
267
268
  ] })
268
269
  ] }),
269
270
  /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.tiles.map((a) => {
270
- const i = ae(Z(a.outcome)), [g, w] = i ? te(i) : [null, null], f = o.api === e.api && o.outcome.includes(a.outcome);
271
+ const i = oe(Y(a.outcome)), [g, k] = i ? ae(i) : [null, null], f = n.api === e.api && n.outcome.includes(a.outcome);
271
272
  return /* @__PURE__ */ r(
272
273
  "button",
273
274
  {
@@ -275,11 +276,11 @@ function dt({ api: n, className: b }) {
275
276
  "data-obligation-tile": a.outcome,
276
277
  "aria-pressed": f,
277
278
  onClick: () => {
278
- u((k) => ({ ...k, api: e.api })), J(a.outcome);
279
+ l((v) => ({ ...v, api: e.api })), W(a.outcome);
279
280
  },
280
281
  style: g ? {
281
282
  "--obt": g,
282
- "--obtd": w
283
+ "--obtd": k
283
284
  } : void 0,
284
285
  className: d(
285
286
  "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",
@@ -298,7 +299,7 @@ function dt({ api: n, className: b }) {
298
299
  children: a.count
299
300
  }
300
301
  ),
301
- /* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: I[a.outcome] ?? a.outcome })
302
+ /* @__PURE__ */ t("span", { className: "block text-[10px] uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: D[a.outcome] ?? a.outcome })
302
303
  ]
303
304
  },
304
305
  a.outcome
@@ -312,11 +313,11 @@ function dt({ api: n, className: b }) {
312
313
  /* @__PURE__ */ r("div", { "data-obligation-filter": "kind", className: "flex items-center gap-1.5", children: [
313
314
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Kind" }),
314
315
  /* @__PURE__ */ t(
315
- K,
316
+ I,
316
317
  {
317
318
  ariaLabel: "Filter by obligation kind",
318
- value: o.kind ?? "",
319
- onChange: (e) => u((a) => ({ ...a, kind: e || null })),
319
+ value: n.kind ?? "",
320
+ onChange: (e) => l((a) => ({ ...a, kind: e || null })),
320
321
  options: [
321
322
  { value: "", label: "Every kind" },
322
323
  ...F.map((e) => ({ value: e.kind, label: e.label }))
@@ -327,23 +328,23 @@ function dt({ api: n, className: b }) {
327
328
  /* @__PURE__ */ r("div", { "data-obligations-collection-filter": !0, className: "flex items-center gap-1.5", children: [
328
329
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Collection" }),
329
330
  /* @__PURE__ */ t(
330
- K,
331
+ I,
331
332
  {
332
333
  ariaLabel: "Filter by collection",
333
- value: o.collection ?? "",
334
- onChange: (e) => u((a) => ({ ...a, collection: e || null })),
335
- options: [{ value: "", label: "Every collection" }, ...pe]
334
+ value: n.collection ?? "",
335
+ onChange: (e) => l((a) => ({ ...a, collection: e || null })),
336
+ options: [{ value: "", label: "Every collection" }, ...xe]
336
337
  }
337
338
  )
338
339
  ] }),
339
340
  /* @__PURE__ */ r("div", { "data-obligation-filter": "age", className: "flex items-center gap-1.5", children: [
340
341
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-muted-foreground", children: "Age" }),
341
342
  /* @__PURE__ */ t(
342
- K,
343
+ I,
343
344
  {
344
345
  ariaLabel: "Filter by obligation age",
345
- value: o.ageHours != null ? String(o.ageHours) : "",
346
- onChange: (e) => u((a) => ({ ...a, ageHours: e ? Number(e) : null })),
346
+ value: n.ageHours != null ? String(n.ageHours) : "",
347
+ onChange: (e) => l((a) => ({ ...a, ageHours: e ? Number(e) : null })),
347
348
  options: [
348
349
  { value: "", label: "Any age" },
349
350
  { value: "1", label: "Older than 1 hour" },
@@ -355,29 +356,29 @@ function dt({ api: n, className: b }) {
355
356
  ] }),
356
357
  /* @__PURE__ */ r("div", { "data-obligation-filter": "outcome", className: "flex flex-wrap items-center gap-1", children: [
357
358
  /* @__PURE__ */ t("span", { className: "mr-0.5 text-[11px] text-slate-400 dark:text-muted-foreground", children: "Outcome" }),
358
- Re.map((e) => {
359
- const a = o.outcome.includes(e);
359
+ Be.map((e) => {
360
+ const a = n.outcome.includes(e);
360
361
  return /* @__PURE__ */ t(
361
362
  "button",
362
363
  {
363
364
  type: "button",
364
365
  "aria-pressed": a,
365
- onClick: () => J(e),
366
+ onClick: () => W(e),
366
367
  className: d(
367
368
  "inline-flex h-6 items-center rounded-full border px-2 text-[10.5px] font-medium transition-colors",
368
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"
369
370
  ),
370
- children: I[e] ?? e
371
+ children: D[e] ?? e
371
372
  },
372
373
  e
373
374
  );
374
375
  })
375
376
  ] }),
376
- (o.api || o.kind || o.collection || o.ageHours != null) && /* @__PURE__ */ t(
377
+ (n.api || n.kind || n.collection || n.ageHours != null) && /* @__PURE__ */ t(
377
378
  "button",
378
379
  {
379
380
  type: "button",
380
- onClick: () => u((e) => ({
381
+ onClick: () => l((e) => ({
381
382
  api: null,
382
383
  kind: null,
383
384
  collection: null,
@@ -389,14 +390,14 @@ function dt({ api: n, className: b }) {
389
390
  }
390
391
  )
391
392
  ] }),
392
- o.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: [
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: [
393
394
  /* @__PURE__ */ t(
394
395
  "button",
395
396
  {
396
397
  type: "button",
397
398
  "data-obligations-tab": "all",
398
399
  "aria-pressed": s === "all",
399
- onClick: () => _("all"),
400
+ onClick: () => T("all"),
400
401
  className: d(
401
402
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",
402
403
  s === "all" ? "border-nvr-cyan bg-nvr-cyan/10 text-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"
@@ -410,7 +411,7 @@ function dt({ api: n, className: b }) {
410
411
  type: "button",
411
412
  "data-obligations-tab": "waiting",
412
413
  "aria-pressed": s === "waiting",
413
- onClick: () => _("waiting"),
414
+ onClick: () => T("waiting"),
414
415
  className: d(
415
416
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",
416
417
  s === "waiting" ? "border-nvr-cyan bg-nvr-cyan/10 text-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"
@@ -424,7 +425,7 @@ function dt({ api: n, className: b }) {
424
425
  type: "button",
425
426
  "data-obligations-tab": "inbound",
426
427
  "aria-pressed": s === "inbound",
427
- onClick: () => _("inbound"),
428
+ onClick: () => T("inbound"),
428
429
  className: d(
429
430
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[10.5px] font-medium transition-colors",
430
431
  s === "inbound" ? "border-nvr-cyan bg-nvr-cyan/10 text-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"
@@ -433,13 +434,13 @@ function dt({ api: n, className: b }) {
433
434
  }
434
435
  )
435
436
  ] }),
436
- me ? /* @__PURE__ */ t(ee, { variant: "500", detail: "Could not load obligations for this filter." }) : ce ? /* @__PURE__ */ t("div", { className: "h-24 animate-pulse rounded-xl bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(
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(
437
438
  "div",
438
439
  {
439
440
  className: "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card",
440
441
  "data-obligations-empty": !0,
441
442
  children: /* @__PURE__ */ t(
442
- Y,
443
+ ee,
443
444
  {
444
445
  title: "Nothing outstanding for this filter",
445
446
  detail: "Every message the partner expects, for this outcome, has landed."
@@ -451,7 +452,7 @@ function dt({ api: n, className: b }) {
451
452
  {
452
453
  className: d(
453
454
  "overflow-x-auto rounded-xl border border-slate-200 dark:border-border",
454
- ue && "opacity-60 transition-opacity"
455
+ be && "opacity-60 transition-opacity"
455
456
  ),
456
457
  children: [
457
458
  /* @__PURE__ */ r("table", { className: "w-full text-[12px] tabular-nums", children: [
@@ -468,8 +469,8 @@ function dt({ api: n, className: b }) {
468
469
  S && /* @__PURE__ */ t("th", { className: "px-3 py-1.5 font-medium" })
469
470
  ] }) }),
470
471
  /* @__PURE__ */ t("tbody", { children: C.map((e) => {
471
- const a = ae(Z(e.outcome)), [i, g] = a ? te(a) : [null, null], w = S && (e.outcome === "failed" || e.outcome === "missing" || e.outcome === "overdue"), f = je(e.collection), k = Je(e), O = s === "inbound" && ie === e.id, W = We(e.detail);
472
- return /* @__PURE__ */ r(Oe, { children: [
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: [
473
474
  /* @__PURE__ */ r(
474
475
  "tr",
475
476
  {
@@ -486,7 +487,7 @@ function dt({ api: n, className: b }) {
486
487
  " · ",
487
488
  e.item
488
489
  ] }),
489
- /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children: be.get(e.kind) ?? e.kind }),
490
+ /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-600 dark:text-slate-300", children: ge.get(e.kind) ?? e.kind }),
490
491
  /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: $e(e.due_at) }),
491
492
  /* @__PURE__ */ t("td", { className: "px-3 py-1.5", "data-obligation-outcome": e.outcome, children: /* @__PURE__ */ r(
492
493
  "span",
@@ -510,7 +511,7 @@ function dt({ api: n, className: b }) {
510
511
  )
511
512
  }
512
513
  ),
513
- I[e.outcome] ?? e.outcome
514
+ D[e.outcome] ?? e.outcome
514
515
  ]
515
516
  }
516
517
  ) }),
@@ -534,7 +535,7 @@ function dt({ api: n, className: b }) {
534
535
  {
535
536
  className: "hidden px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
536
537
  "data-obligations-col-attempts": !0,
537
- children: Ke(k, e.reason)
538
+ children: Ie(v, e.reason)
538
539
  }
539
540
  ),
540
541
  /* @__PURE__ */ t(
@@ -542,8 +543,8 @@ function dt({ api: n, className: b }) {
542
543
  {
543
544
  className: "hidden max-w-[28ch] truncate px-3 py-1.5 text-slate-500 dark:text-muted-foreground lg:table-cell",
544
545
  "data-obligations-last-response": !0,
545
- "data-tip": Pe(k) ?? void 0,
546
- children: Ie(e.outcome, k)
546
+ "data-tip": Pe(v) ?? void 0,
547
+ children: De(e.outcome, v)
547
548
  }
548
549
  ),
549
550
  s === "waiting" && /* @__PURE__ */ t(
@@ -551,31 +552,48 @@ function dt({ api: n, className: b }) {
551
552
  {
552
553
  className: "px-3 py-1.5 text-slate-600 dark:text-slate-300",
553
554
  "data-obligations-owner": !0,
554
- children: xe(e)
555
+ children: fe(e)
555
556
  }
556
557
  ),
557
558
  s === "inbound" && /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-right", children: /* @__PURE__ */ t(
558
- Qe,
559
+ Je,
559
560
  {
560
- open: O,
561
- onToggle: () => P((ke) => ke === e.id ? null : e.id)
561
+ open: E,
562
+ onToggle: () => P((ye) => ye === e.id ? null : e.id)
562
563
  }
563
564
  ) }),
564
- S && /* @__PURE__ */ t("td", { className: "px-3 py-1.5 text-right", children: w && /* @__PURE__ */ t(Be, { obligationId: e.id }) })
565
+ 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,
569
+ {
570
+ obligationId: e.id,
571
+ api: e.api,
572
+ className: "ml-2",
573
+ onSent: () => {
574
+ p.invalidateQueries({
575
+ queryKey: ["integration-obligations", "summary"]
576
+ }), p.invalidateQueries({
577
+ queryKey: ["integration-obligations", "list"]
578
+ });
579
+ }
580
+ }
581
+ )
582
+ ] })
565
583
  ]
566
584
  }
567
585
  ),
568
- O && /* @__PURE__ */ t(
586
+ E && /* @__PURE__ */ t(
569
587
  "tr",
570
588
  {
571
589
  className: "border-b border-slate-100 dark:border-border/60",
572
590
  children: /* @__PURE__ */ t(
573
591
  "td",
574
592
  {
575
- colSpan: he,
593
+ colSpan: ke,
576
594
  className: "bg-slate-50 px-3 py-2 dark:bg-muted",
577
595
  "data-obligations-detail": !0,
578
- children: W ? /* @__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: W }) : /* @__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." })
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." })
579
597
  }
580
598
  )
581
599
  },
@@ -584,21 +602,21 @@ function dt({ api: n, className: b }) {
584
602
  ] }, e.id);
585
603
  }) })
586
604
  ] }),
587
- L > E && /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-t border-slate-200 px-3 py-1.5 text-[11px] text-slate-400 dark:border-border dark:text-muted-foreground", children: [
605
+ _ > q && /* @__PURE__ */ r("div", { className: "flex items-center justify-between border-t border-slate-200 px-3 py-1.5 text-[11px] text-slate-400 dark:border-border dark:text-muted-foreground", children: [
588
606
  /* @__PURE__ */ r("span", { children: [
589
- (l - 1) * E + 1,
607
+ (u - 1) * q + 1,
590
608
  "–",
591
- Math.min(l * E, L),
609
+ Math.min(u * q, _),
592
610
  " of ",
593
- L
611
+ _
594
612
  ] }),
595
613
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
596
614
  /* @__PURE__ */ t(
597
615
  "button",
598
616
  {
599
617
  type: "button",
600
- disabled: l <= 1,
601
- onClick: () => p((e) => Math.max(1, e - 1)),
618
+ disabled: u <= 1,
619
+ onClick: () => O((e) => Math.max(1, e - 1)),
602
620
  className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
603
621
  children: "Prev"
604
622
  }
@@ -607,8 +625,8 @@ function dt({ api: n, className: b }) {
607
625
  "button",
608
626
  {
609
627
  type: "button",
610
- disabled: l * E >= L,
611
- onClick: () => p((e) => e + 1),
628
+ disabled: u * q >= _,
629
+ onClick: () => O((e) => e + 1),
612
630
  className: "rounded border border-slate-200 px-2 py-0.5 disabled:opacity-40 dark:border-border",
613
631
  children: "Next"
614
632
  }
@@ -618,10 +636,10 @@ function dt({ api: n, className: b }) {
618
636
  ]
619
637
  }
620
638
  ),
621
- /* @__PURE__ */ t(Me, {})
639
+ /* @__PURE__ */ t(Qe, {})
622
640
  ] });
623
641
  }
624
642
  export {
625
- dt as IntegrationObligationsView,
626
- ae as roleForTone
643
+ mt as IntegrationObligationsView,
644
+ oe as roleForTone
627
645
  };