@nivaro/react 0.3.100 → 0.3.102

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 (32) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +46 -3
  4. package/dist/index.js +623 -620
  5. package/dist/shared/components/ActivityEntry.js +5 -5
  6. package/dist/shared/components/CollectionBrowserView.js +183 -175
  7. package/dist/shared/components/ItemEditForm.js +2708 -2704
  8. package/dist/shared/components/JobsTray.js +74 -63
  9. package/dist/shared/components/NotificationBell.js +80 -73
  10. package/dist/shared/components/TipLayer.js +56 -41
  11. package/dist/shared/components/cbv-file-label.js +46 -0
  12. package/dist/shared/components/integrations/console/SignalCard.js +40 -40
  13. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
  14. package/dist/shared/components/integrations/console/drill/status.js +23 -18
  15. package/dist/shared/components/item-edit/RecordInsights.js +86 -86
  16. package/dist/shared/components/item-edit/header-path-preview.js +46 -34
  17. package/dist/shared/components/notifications/DeliveryChips.js +1 -2
  18. package/dist/shared/components/panels/BackgroundMove.js +152 -85
  19. package/dist/shared/components/panels/PipelinePanel.js +602 -594
  20. package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
  21. package/dist/shared/components/profile/DayTimeline.js +145 -140
  22. package/dist/shared/components/profile/PersonAccess.js +679 -383
  23. package/dist/shared/components/profile/PersonActivity.js +404 -427
  24. package/dist/shared/components/profile/PersonDidPanel.js +248 -134
  25. package/dist/shared/components/profile/PersonProfile.js +33 -32
  26. package/dist/shared/components/profile/journey-view.js +166 -0
  27. package/dist/shared/lib/activity-sentence.js +319 -236
  28. package/dist/shared/lib/jobs-tray.js +60 -41
  29. package/dist/shared/lib/move-failure.js +16 -6
  30. package/dist/shared/lib/obligation-banner.js +16 -16
  31. package/dist/shared/lib/partner-failure.js +44 -32
  32. package/package.json +1 -1
@@ -1,50 +1,50 @@
1
- var jn = Object.defineProperty;
2
- var Qn = (t, e, r) => e in t ? jn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var it = (t, e, r) => Qn(t, typeof e != "symbol" ? e + "" : e, r);
1
+ var Kn = Object.defineProperty;
2
+ var Wn = (t, e, r) => e in t ? Kn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var lt = (t, e, r) => Wn(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { jsx as n, jsxs as i, Fragment as Se } from "react/jsx-runtime";
5
- import { useQueryClient as ze, useQuery as be, useMutation as je } from "@tanstack/react-query";
6
- import { ArrowRight as wt, Loader2 as ve, Check as tt, GitBranch as ot, AlertTriangle as Vt, ChevronDown as Fe, Send as Xt, Users as Yt, Undo2 as Kn, Minus as Wn, UserPlus as zn, X as Jt, Zap as Zt, Search as Hn } from "lucide-react";
7
- import { useState as Q, useRef as de, useEffect as _e, useMemo as Je, Suspense as en, useCallback as tn, lazy as Gn, Fragment as Vn } from "react";
5
+ import { useQueryClient as Ve, useQuery as be, useMutation as Qe } from "@tanstack/react-query";
6
+ import { ArrowRight as Nt, Loader2 as ye, Check as rt, GitBranch as dt, AlertTriangle as Vt, ChevronDown as Fe, Send as Xt, Users as Yt, Undo2 as zn, Minus as Hn, UserPlus as Gn, X as Jt, Zap as Zt, Search as Vn } from "lucide-react";
7
+ import { useState as Q, useRef as ce, useEffect as _e, useMemo as et, Suspense as en, useCallback as tn, lazy as Xn, Fragment as Yn } from "react";
8
8
  import { toast as V } from "sonner";
9
9
  import { useNivaroClient as Pe, useItemEditAuth as nn } from "../../context.js";
10
- import { get as ye, post as We, del as Xn } from "../../lib/commands.js";
11
- import { errorToastOptions as rn, toastError as Yn } from "../../lib/error-toast.js";
10
+ import { get as we, post as Ge, del as Jn } from "../../lib/commands.js";
11
+ import { errorToastOptions as rn, toastError as Zn } from "../../lib/error-toast.js";
12
+ import { partnerMoveFailure as an, partnerMoveReading as sn } from "../../lib/move-failure.js";
12
13
  import { OPEN_MOVE_STATE_EVENT as Lt } from "../../lib/move-state.js";
13
- import { useRecordSignalWhile as an, useRecordSignalPeers as Jn, signalSentence as Zn } from "../../lib/presence-signals.js";
14
- import { RUN_TRANSITION_EVENT as Ze } from "../../lib/run-transition.js";
15
- import { partnerMoveFailure as sn } from "../../lib/move-failure.js";
14
+ import { useRecordSignalWhile as on, useRecordSignalPeers as er, signalSentence as tr } from "../../lib/presence-signals.js";
15
+ import { RUN_TRANSITION_EVENT as tt } from "../../lib/run-transition.js";
16
16
  import { userErrorMessage as Ae } from "../../lib/safe-error.js";
17
- import { serverNow as er } from "../../lib/server-clock.js";
18
- import { userCardQuery as tr } from "../../lib/user-cards.js";
19
- import { cn as ge, titleCase as nr, toLocalDateString as rr, formatRelative as kt, formatDateTime as Et, humanHours as ar } from "../../lib/utils.js";
20
- import { PushReadinessChip as sr } from "../integrations/RecordIntegrationPreview.js";
21
- import { useHeaderFold as ir } from "../item-edit/HeaderTools.js";
22
- import { invalidateRecordInsights as Ee, invalidateRecordData as Ie } from "../item-edit/RecordInsights.js";
23
- import { UserChip as on } from "../item-edit/UserChip.js";
24
- import { OwnerAvatars as or } from "../queue/OwnerAvatars.js";
25
- import { UserAvatar as lr } from "../UserAvatar.js";
26
- import { Button as ue } from "../ui/button.js";
27
- import { DropdownMenu as ct, DropdownMenuTrigger as ut, DropdownMenuContent as mt, DropdownMenuGroup as It, DropdownMenuSeparator as pt, DropdownMenuItem as Xe, DropdownMenuLabel as dr } from "../ui/dropdown-menu.js";
28
- import { Popover as Nt, PopoverTrigger as _t, PopoverContent as St } from "../ui/popover.js";
17
+ import { serverNow as nr } from "../../lib/server-clock.js";
18
+ import { userCardQuery as rr } from "../../lib/user-cards.js";
19
+ import { cn as ge, titleCase as ar, toLocalDateString as sr, formatRelative as _t, formatDateTime as Et, humanHours as ir } from "../../lib/utils.js";
20
+ import { PushReadinessChip as or } from "../integrations/RecordIntegrationPreview.js";
21
+ import { useHeaderFold as lr } from "../item-edit/HeaderTools.js";
22
+ import { invalidateRecordInsights as Ie, invalidateRecordData as je } from "../item-edit/RecordInsights.js";
23
+ import { UserChip as ln } from "../item-edit/UserChip.js";
24
+ import { OwnerAvatars as dr } from "../queue/OwnerAvatars.js";
25
+ import { UserAvatar as cr } from "../UserAvatar.js";
26
+ import { Button as pe } from "../ui/button.js";
27
+ import { DropdownMenu as mt, DropdownMenuTrigger as pt, DropdownMenuContent as ft, DropdownMenuGroup as It, DropdownMenuSeparator as ht, DropdownMenuItem as Je, DropdownMenuLabel as ur } from "../ui/dropdown-menu.js";
28
+ import { Popover as St, PopoverTrigger as Ct, PopoverContent as $t } from "../ui/popover.js";
29
29
  import { Skeleton as Me } from "../ui/skeleton.js";
30
- import { TooltipProvider as ln, Tooltip as ft, TooltipTrigger as ht, TooltipContent as bt } from "../ui/tooltip.js";
31
- import { isAccessRefusal as dn, deniedToastAction as cn, WhyOwnersButton as cr } from "./AccessInsights.js";
32
- import { runningMovePoll as un, useRunEnded as mn, startedInBackground as pn, pendingOptIn as fn, sameMoveId as gt, runningMoveTip as ur, RunningMoveNotice as mr, MoveProblemNotice as pr } from "./BackgroundMove.js";
33
- import { BranchLanes as fr } from "./BranchLanes.js";
34
- import { landingState as hr, landingSkipGroups as br, joinLabels as jt } from "./landing-state.js";
35
- import { distinctAdvisories as hn, MoveAdvisoryNotice as bn, REFUSAL_FIX_ACTIONS as gr, useRecordFixAction as xr } from "./MoveAdvisory.js";
36
- import { MoveToStatePanel as vr } from "./MoveToStatePanel.js";
37
- import { SlaClockLine as yr } from "./SlaClock.js";
38
- const gn = Gn(
30
+ import { TooltipProvider as dn, Tooltip as bt, TooltipTrigger as gt, TooltipContent as xt } from "../ui/tooltip.js";
31
+ import { isAccessRefusal as cn, deniedToastAction as un, WhyOwnersButton as mr } from "./AccessInsights.js";
32
+ import { runningMovePoll as mn, useRunEnded as pn, startedInBackground as fn, pendingOptIn as hn, sameMoveId as vt, runningMoveTip as pr, unansweredHoldTip as bn, RunningMoveNotice as fr, MoveProblemNotice as hr } from "./BackgroundMove.js";
33
+ import { BranchLanes as br } from "./BranchLanes.js";
34
+ import { landingState as gr, landingSkipGroups as xr, joinLabels as jt } from "./landing-state.js";
35
+ import { distinctAdvisories as gn, MoveAdvisoryNotice as xn, REFUSAL_FIX_ACTIONS as vr, useRecordFixAction as yr } from "./MoveAdvisory.js";
36
+ import { MoveToStatePanel as wr } from "./MoveToStatePanel.js";
37
+ import { SlaClockLine as kr } from "./SlaClock.js";
38
+ const vn = Xn(
39
39
  () => import("./TransitionRequirementsDialog.js").then((t) => ({
40
40
  default: t.TransitionRequirementsDialog
41
41
  }))
42
42
  );
43
- function Ct(t, e) {
43
+ function Tt(t, e) {
44
44
  const r = t || "System";
45
45
  return e.on_behalf_of_name ? `${r}, for ${e.on_behalf_of_name}` : r;
46
46
  }
47
- function wr(t) {
47
+ function Nr(t) {
48
48
  if (t.transition) return null;
49
49
  const e = (t.comment ?? "").trim();
50
50
  if (!e.startsWith("{")) return null;
@@ -58,14 +58,14 @@ function wr(t) {
58
58
  }
59
59
  return null;
60
60
  }
61
- function Ye(t) {
61
+ function Ze(t) {
62
62
  return !(t.first_name || t.last_name || t.user_email);
63
63
  }
64
- function xt(t) {
64
+ function yt(t) {
65
65
  const e = (t.comment ?? "").trim().toLowerCase();
66
66
  return t.origin === "import" || e.startsWith("import:") ? "Imported" : t.origin === "integration" ? "By an integration" : /-state-sync$/.test(e) || e.startsWith("legacy-") ? "Synced from another system" : e === "state-merge" || e === "instance-migration" ? "Moved by an admin script" : "Moved automatically";
67
67
  }
68
- function vt(t) {
68
+ function wt(t) {
69
69
  if (t.transition_text) return t.transition_text;
70
70
  if (t.transition_label) return `Rule: ${t.transition_label}`;
71
71
  const e = (t.comment ?? "").trim(), r = /^auto: (.+)$/i.exec(e);
@@ -79,11 +79,11 @@ const Qt = {
79
79
  rate_limited: "the partner asked us to slow down",
80
80
  unknown: "the partner refused it"
81
81
  };
82
- function kr(t) {
83
- const e = Math.ceil((new Date(t).getTime() - er()) / 6e4);
82
+ function _r(t) {
83
+ const e = Math.ceil((new Date(t).getTime() - nr()) / 6e4);
84
84
  return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
85
85
  }
86
- function Nr({ held: t }) {
86
+ function Sr({ held: t }) {
87
87
  return t.length === 0 ? null : /* @__PURE__ */ n(
88
88
  "div",
89
89
  {
@@ -108,7 +108,7 @@ function Nr({ held: t }) {
108
108
  }
109
109
  ),
110
110
  /* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
111
- e.retry_at ? `It tries the same push again ${kr(e.retry_at)}. ` : "It will not send the same push again on its own. ",
111
+ e.retry_at ? `It tries the same push again ${_r(e.retry_at)}. ` : "It will not send the same push again on its own. ",
112
112
  "Fix the record so what it sends changes, retry the push, or move the record by hand.",
113
113
  e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
114
114
  ] })
@@ -117,40 +117,40 @@ function Nr({ held: t }) {
117
117
  }
118
118
  );
119
119
  }
120
- function xn(t) {
120
+ function yn(t) {
121
121
  var r;
122
122
  const e = t == null ? void 0 : t.response;
123
123
  return ((e == null ? void 0 : e.code) ?? ((r = e == null ? void 0 : e.data) == null ? void 0 : r.code)) === "TRANSITION_DUPLICATE";
124
124
  }
125
- function vn(t) {
125
+ function wn(t) {
126
126
  var r;
127
127
  const e = t;
128
128
  return (e == null ? void 0 : e.status) === 422 && ((r = e.response) == null ? void 0 : r.error) === "TRANSITION_REQUIREMENTS" ? e.response.requirements ?? [] : null;
129
129
  }
130
- function nt(t) {
130
+ function at(t) {
131
131
  var s;
132
132
  const e = t == null ? void 0 : t.response, r = (e == null ? void 0 : e.code) ?? ((s = e == null ? void 0 : e.data) == null ? void 0 : s.code);
133
133
  return typeof r == "string" ? r : null;
134
134
  }
135
- function yn(t) {
136
- if (nt(t) !== "RECORD_LOCKED") return null;
135
+ function kn(t) {
136
+ if (at(t) !== "RECORD_LOCKED") return null;
137
137
  const e = t == null ? void 0 : t.response, r = e != null && e.data && typeof e.data == "object" ? e.data : e;
138
138
  if ((r == null ? void 0 : r.move_anyway) !== !0) return null;
139
139
  const s = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
140
140
  return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${s ?? "Someone else"} is editing this record right now.`, holder: s };
141
141
  }
142
- function wn(t, e) {
142
+ function Nn(t, e) {
143
143
  var m, h, p;
144
- const r = nt(t), s = t == null ? void 0 : t.response, o = ((m = s == null ? void 0 : s.fix) == null ? void 0 : m.action) ?? ((p = (h = s == null ? void 0 : s.data) == null ? void 0 : h.fix) == null ? void 0 : p.action), c = typeof o == "string" && o.trim() || (r ? gr[r] : void 0);
144
+ const r = at(t), s = t == null ? void 0 : t.response, o = ((m = s == null ? void 0 : s.fix) == null ? void 0 : m.action) ?? ((p = (h = s == null ? void 0 : s.data) == null ? void 0 : h.fix) == null ? void 0 : p.action), c = typeof o == "string" && o.trim() || (r ? vr[r] : void 0);
145
145
  return !r || !c ? null : { code: r, actionKey: c, transitionId: e.transition_id, comment: e.comment };
146
146
  }
147
- const _r = 600;
148
- function kn(t) {
149
- const e = ze(), [r, s] = Q(!1), o = de(!0);
147
+ const Cr = 600;
148
+ function _n(t) {
149
+ const e = Ve(), [r, s] = Q(!1), o = ce(!0);
150
150
  _e(() => (o.current = !0, () => {
151
151
  o.current = !1;
152
152
  }), []);
153
- const c = de(t);
153
+ const c = ce(t);
154
154
  c.current = t;
155
155
  const m = tn(async () => {
156
156
  s(!0);
@@ -158,15 +158,15 @@ function kn(t) {
158
158
  await e.refetchQueries({ queryKey: [...c.current], type: "active" });
159
159
  } catch {
160
160
  }
161
- await new Promise((h) => setTimeout(h, _r)), o.current && s(!1);
161
+ await new Promise((h) => setTimeout(h, Cr)), o.current && s(!1);
162
162
  }, [e]);
163
163
  return { settling: r, settle: m };
164
164
  }
165
- const Ue = 1500, Kt = 4e3;
166
- class Sr {
165
+ const Be = 1500, Kt = 4e3;
166
+ class $r {
167
167
  constructor() {
168
- it(this, "seen", null);
169
- it(this, "fresh", /* @__PURE__ */ new Map());
168
+ lt(this, "seen", null);
169
+ lt(this, "fresh", /* @__PURE__ */ new Map());
170
170
  }
171
171
  /** Feed the ids on offer now. */
172
172
  observe(e, r) {
@@ -180,7 +180,7 @@ class Sr {
180
180
  /** The pointer is on the button. */
181
181
  enter(e, r) {
182
182
  const s = this.fresh.get(String(e).toUpperCase());
183
- s && !s.left && r - s.at < Ue && (s.hovered = !0);
183
+ s && !s.left && r - s.at < Be && (s.hovered = !0);
184
184
  }
185
185
  /** The pointer left the button. */
186
186
  leave(e) {
@@ -190,38 +190,38 @@ class Sr {
190
190
  /** Still inert (no state change)? */
191
191
  inert(e, r) {
192
192
  const s = this.fresh.get(String(e).toUpperCase());
193
- return !s || r - s.at >= Kt ? !1 : r - s.at < Ue || s.hovered && !s.left;
193
+ return !s || r - s.at >= Kt ? !1 : r - s.at < Be || s.hovered && !s.left;
194
194
  }
195
195
  /** A press: true = let it through. A press inside the window counts as the pointer being there. */
196
196
  press(e, r) {
197
197
  const s = String(e).toUpperCase(), o = this.fresh.get(s);
198
- return o ? r - o.at < Ue ? (o.hovered = !0, o.left = !1, !1) : o.hovered && !o.left && r - o.at < Kt ? !1 : (this.fresh.delete(s), !0) : !0;
198
+ return o ? r - o.at < Be ? (o.hovered = !0, o.left = !1, !1) : o.hovered && !o.left && r - o.at < Kt ? !1 : (this.fresh.delete(s), !0) : !0;
199
199
  }
200
200
  /** Inside its time window (drawn dimmed)? */
201
201
  timed(e, r) {
202
202
  const s = this.fresh.get(String(e).toUpperCase());
203
- return !!s && r - s.at < Ue;
203
+ return !!s && r - s.at < Be;
204
204
  }
205
205
  /** Any button still inside its time window? */
206
206
  hasTimed(e) {
207
- for (const r of this.fresh.values()) if (e - r.at < Ue) return !0;
207
+ for (const r of this.fresh.values()) if (e - r.at < Be) return !0;
208
208
  return !1;
209
209
  }
210
210
  reset() {
211
211
  this.seen = null, this.fresh.clear();
212
212
  }
213
213
  }
214
- function Nn(t, e) {
215
- const r = de(null);
216
- r.current || (r.current = new Sr());
217
- const s = r.current, o = de(e);
214
+ function Sn(t, e) {
215
+ const r = ce(null);
216
+ r.current || (r.current = new $r());
217
+ const s = r.current, o = ce(e);
218
218
  o.current !== e && (o.current = e, s.reset());
219
219
  const [, c] = Q(0), m = t ? t.join(",") : null;
220
- return Je(() => {
220
+ return et(() => {
221
221
  t && s.observe(t, Date.now());
222
222
  }, [s, m]), _e(() => {
223
223
  if (!s.hasTimed(Date.now())) return;
224
- const h = setTimeout(() => c((p) => p + 1), Ue + 20);
224
+ const h = setTimeout(() => c((p) => p + 1), Be + 20);
225
225
  return () => clearTimeout(h);
226
226
  }, [s, m]), {
227
227
  dimmed: (h) => s.timed(h, Date.now()),
@@ -233,58 +233,58 @@ function Nn(t, e) {
233
233
  })
234
234
  };
235
235
  }
236
- function _n(t, e) {
236
+ function Cn(t, e) {
237
237
  return ["approval-brief", t, String(e)];
238
238
  }
239
- function Sn(t, e, r) {
239
+ function $n(t, e, r) {
240
240
  return t.request(
241
- ye(`/pipelines/instance/${e}/${r}/approval-brief`)
241
+ we(`/pipelines/instance/${e}/${r}/approval-brief`)
242
242
  ).then((s) => s.data);
243
243
  }
244
- function Cr(t) {
244
+ function Tr(t) {
245
245
  return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
246
246
  }
247
247
  function Wt(t) {
248
248
  return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
249
249
  }
250
- function $r(t) {
250
+ function qr(t) {
251
251
  const e = Math.max(0, Math.floor(Number(t) || 0));
252
252
  return e === 0 ? "today" : e === 1 ? "1 day ago" : `${e} days ago`;
253
253
  }
254
- function Tr(t, e, r = 40) {
254
+ function Mr(t, e, r = 40) {
255
255
  const s = (x) => x == null || x === "" ? "" : String(x), o = s(t), c = s(e), m = (x) => x === "" ? "(empty)" : x;
256
- if (t === void 0) return { old: null, new: lt(m(c), 0, r) };
256
+ if (t === void 0) return { old: null, new: ct(m(c), 0, r) };
257
257
  if (o.length <= r && c.length <= r) return { old: m(o), new: m(c) };
258
258
  let h = 0;
259
259
  for (; h < o.length && h < c.length && o[h] === c[h]; ) h++;
260
260
  const p = h > r / 2 ? h - Math.floor(r / 3) : 0;
261
- return { old: lt(m(o), p, r), new: lt(m(c), p, r) };
261
+ return { old: ct(m(o), p, r), new: ct(m(c), p, r) };
262
262
  }
263
- function lt(t, e, r) {
263
+ function ct(t, e, r) {
264
264
  const s = Math.min(e, Math.max(0, t.length - r)), o = t.slice(s, s + r);
265
265
  return `${s > 0 ? "…" : ""}${o}${s + r < t.length ? "…" : ""}`;
266
266
  }
267
- const qr = 4e3;
268
- function Cn(t, e) {
269
- const r = Pe(), s = ze();
267
+ const Rr = 4e3;
268
+ function Tn(t, e) {
269
+ const r = Pe(), s = Ve();
270
270
  return tn(async () => {
271
271
  try {
272
272
  const o = await Promise.race([
273
273
  s.fetchQuery({
274
- queryKey: _n(t, e),
275
- queryFn: () => Sn(r, t, e),
274
+ queryKey: Cn(t, e),
275
+ queryFn: () => $n(r, t, e),
276
276
  staleTime: 0,
277
277
  retry: !1
278
278
  }),
279
- new Promise((c) => setTimeout(() => c(null), qr))
279
+ new Promise((c) => setTimeout(() => c(null), Rr))
280
280
  ]);
281
- return Cr(o == null ? void 0 : o.lines);
281
+ return Tr(o == null ? void 0 : o.lines);
282
282
  } catch {
283
283
  return [];
284
284
  }
285
285
  }, [r, s, t, e]);
286
286
  }
287
- function $n({ lines: t }) {
287
+ function qn({ lines: t }) {
288
288
  return t.length === 0 ? null : /* @__PURE__ */ i(
289
289
  "div",
290
290
  {
@@ -300,18 +300,18 @@ function $n({ lines: t }) {
300
300
  }
301
301
  );
302
302
  }
303
- function He(t, e, r) {
303
+ function Xe(t, e, r) {
304
304
  if (!r) return !1;
305
305
  const s = e.find(
306
306
  (c) => String(c.id).toUpperCase() === String(r).toUpperCase()
307
307
  ), o = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
308
308
  return !!s && !!o && o.sort < s.sort;
309
309
  }
310
- function $t(t, e, r) {
310
+ function qt(t, e, r) {
311
311
  var o;
312
312
  if (!t) return !1;
313
313
  if ((((o = t.order_partners) == null ? void 0 : o.length) ?? 0) > 0) return !0;
314
- if (He(t, e, r)) return !1;
314
+ if (Xe(t, e, r)) return !1;
315
315
  const s = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
316
316
  return !!(s != null && s.is_terminal) && !/(^|_)cancel/i.test(String(s.key ?? ""));
317
317
  }
@@ -323,7 +323,7 @@ const zt = {
323
323
  blue: "border-sky-200 bg-sky-50 text-sky-800 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-300",
324
324
  purple: "border-violet-200 bg-violet-50 text-violet-800 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-300"
325
325
  };
326
- function Mr({ flags: t }) {
326
+ function Pr({ flags: t }) {
327
327
  return !t || t.length === 0 ? null : /* @__PURE__ */ n(Se, { children: t.map((e) => /* @__PURE__ */ i(
328
328
  "span",
329
329
  {
@@ -343,7 +343,7 @@ function Mr({ flags: t }) {
343
343
  function Ht(t) {
344
344
  return t.replace(/\s+IIP$/i, "");
345
345
  }
346
- function Tn({
346
+ function Mn({
347
347
  collection: t,
348
348
  item: e,
349
349
  tx: r
@@ -351,7 +351,7 @@ function Tn({
351
351
  const s = Pe(), o = (r == null ? void 0 : r.order_partners) ?? [], { data: c } = be({
352
352
  queryKey: ["push-preflight", t, e, "t", (r == null ? void 0 : r.id) ?? ""],
353
353
  queryFn: () => s.request(
354
- ye(`/integration-preview/${t}/${encodeURIComponent(e)}/preflight`, {
354
+ we(`/integration-preview/${t}/${encodeURIComponent(e)}/preflight`, {
355
355
  transition_id: (r == null ? void 0 : r.id) ?? ""
356
356
  })
357
357
  ).then((p) => p.data),
@@ -372,35 +372,35 @@ function Tn({
372
372
  }
373
373
  );
374
374
  }
375
- function qn(t) {
375
+ function Rn(t) {
376
376
  return t != null && t.instance ? (t.available_transitions ?? []).some(
377
377
  (e) => {
378
378
  var r;
379
- return He(e, t.states ?? [], (r = t.instance) == null ? void 0 : r.current_state);
379
+ return Xe(e, t.states ?? [], (r = t.instance) == null ? void 0 : r.current_state);
380
380
  }
381
381
  ) : !1;
382
382
  }
383
- function Mn(t, e, r, s) {
383
+ function Pn(t, e, r, s) {
384
384
  if (!s || s.size === 0) return t;
385
385
  const o = new Set([...s.keys()].map((c) => String(c).toUpperCase()));
386
386
  return t.filter(
387
- (c) => !(!c.to_previous && o.has(String(c.to_state).toUpperCase()) && He(c, e, r))
387
+ (c) => !(!c.to_previous && o.has(String(c.to_state).toUpperCase()) && Xe(c, e, r))
388
388
  );
389
389
  }
390
- function Rn(t, e, r) {
390
+ function Fn(t, e, r) {
391
391
  var p, x, k, R, _, U;
392
392
  const s = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
393
393
  (j) => j.id === e
394
394
  ), o = r == null ? void 0 : r.data, c = ((p = o == null ? void 0 : o.new_state) == null ? void 0 : p.id) ?? ((x = o == null ? void 0 : o.instance) == null ? void 0 : x.current_state) ?? null, m = ((k = o == null ? void 0 : o.new_state) == null ? void 0 : k.label) ?? (s ? (_ = (R = t == null ? void 0 : t.states) == null ? void 0 : R.find((j) => j.id === s.to_state)) == null ? void 0 : _.label : void 0) ?? null, h = ((U = t == null ? void 0 : t.instance) == null ? void 0 : U.current_state) ?? null;
395
395
  return h && c && String(h) === String(c) ? "Nothing moved" : s != null && s.label && m ? `${s.label} — now ${m}` : m ? `Moved to ${m}` : s != null && s.label ? `${s.label} done` : "Transition executed";
396
396
  }
397
- const Rr = 1200;
398
- function Pn(t) {
397
+ const Fr = 1200;
398
+ function An(t) {
399
399
  const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
400
400
  let r = !1;
401
401
  const s = setTimeout(() => {
402
402
  r = !0, V.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
403
- }, Rr);
403
+ }, Fr);
404
404
  return {
405
405
  /** Options for the result toast: replaces the loading one when shown. */
406
406
  done: () => (clearTimeout(s), r ? { id: e, duration: 7e3 } : {}),
@@ -410,7 +410,7 @@ function Pn(t) {
410
410
  }
411
411
  };
412
412
  }
413
- function et(t, e, r) {
413
+ function nt(t, e, r) {
414
414
  for (const s of [
415
415
  "pipeline-owners-resolved",
416
416
  "pipeline-instance-owners",
@@ -418,7 +418,7 @@ function et(t, e, r) {
418
418
  ])
419
419
  t.invalidateQueries({ queryKey: [s, e, r] });
420
420
  }
421
- function Pr(t, e, r) {
421
+ function Ar(t, e, r) {
422
422
  var h;
423
423
  if (!e) return null;
424
424
  const s = new Map(r.map((p) => [String(p.id).toUpperCase(), p.sort])), o = [...t].sort(
@@ -438,21 +438,21 @@ function Ne({ className: t }) {
438
438
  }
439
439
  );
440
440
  }
441
- function Be(t, e = "button") {
441
+ function Le(t, e = "button") {
442
442
  return t.advisory ? {
443
443
  "data-move-blocked": t.advisory.code,
444
444
  "aria-description": t.advisory.message,
445
445
  ...e === "button" ? { "data-tip": t.advisory.message } : {}
446
446
  } : {};
447
447
  }
448
- const Fn = "border-amber-300 text-slate-700 dark:border-amber-500/40 dark:text-slate-200";
449
- function yt({
448
+ const On = "border-amber-300 text-slate-700 dark:border-amber-500/40 dark:text-slate-200";
449
+ function kt({
450
450
  moves: t,
451
451
  nameOf: e
452
452
  }) {
453
- const r = hn(t);
454
- return r.map(({ advisory: s, moves: o }) => /* @__PURE__ */ i(Vn, { children: [
455
- /* @__PURE__ */ n(pt, {}),
453
+ const r = gn(t);
454
+ return r.map(({ advisory: s, moves: o }) => /* @__PURE__ */ i(Yn, { children: [
455
+ /* @__PURE__ */ n(ht, {}),
456
456
  /* @__PURE__ */ i(
457
457
  "div",
458
458
  {
@@ -472,11 +472,11 @@ function yt({
472
472
  )
473
473
  ] }, `${s.code}:${s.message}`));
474
474
  }
475
- function An(t, e, r) {
475
+ function Dn(t, e, r) {
476
476
  const s = String(t.comment_mode ?? "none");
477
- return s === "optional" || s === "required" || $t(t, e, r);
477
+ return s === "optional" || s === "required" || qt(t, e, r);
478
478
  }
479
- function Fr({ entry: t }) {
479
+ function Or({ entry: t }) {
480
480
  const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
481
481
  return /* @__PURE__ */ i(
482
482
  "div",
@@ -485,7 +485,7 @@ function Fr({ entry: t }) {
485
485
  "data-send-back-notice": !0,
486
486
  children: [
487
487
  /* @__PURE__ */ n(
488
- Kn,
488
+ zn,
489
489
  {
490
490
  "aria-hidden": !0,
491
491
  className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
@@ -495,16 +495,16 @@ function Fr({ entry: t }) {
495
495
  /* @__PURE__ */ n("p", { className: "whitespace-pre-line break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: t.comment }),
496
496
  /* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
497
497
  "Sent back by ",
498
- Ct(e, t),
498
+ Tt(e, t),
499
499
  " · ",
500
- kt(t.timestamp)
500
+ _t(t.timestamp)
501
501
  ] })
502
502
  ] })
503
503
  ]
504
504
  }
505
505
  );
506
506
  }
507
- function On({
507
+ function Un({
508
508
  collection: t,
509
509
  item: e,
510
510
  offer: r,
@@ -513,12 +513,12 @@ function On({
513
513
  className: c,
514
514
  style: m
515
515
  }) {
516
- const [h, p] = Q(""), { action: x, isLoading: k, run: R } = xr(t, e, r.actionKey), _ = je({
516
+ const [h, p] = Q(""), { action: x, isLoading: k, run: R } = yr(t, e, r.actionKey), _ = Qe({
517
517
  mutationFn: () => R(h),
518
518
  onSuccess: () => {
519
519
  V.success(`${(x == null ? void 0 : x.label) ?? "Done"} — trying again`), s();
520
520
  },
521
- onError: (j) => Yn(j, `${(x == null ? void 0 : x.label) ?? "The fix"} failed`)
521
+ onError: (j) => Zn(j, `${(x == null ? void 0 : x.label) ?? "The fix"} failed`)
522
522
  });
523
523
  if (k || !x) return null;
524
524
  const U = !_.isPending && (!x.require_reason || h.trim().length > 0);
@@ -550,7 +550,7 @@ function On({
550
550
  ),
551
551
  /* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
552
552
  /* @__PURE__ */ n(
553
- ue,
553
+ pe,
554
554
  {
555
555
  type: "button",
556
556
  size: "sm",
@@ -561,7 +561,7 @@ function On({
561
561
  }
562
562
  ),
563
563
  /* @__PURE__ */ i(
564
- ue,
564
+ pe,
565
565
  {
566
566
  type: "button",
567
567
  size: "sm",
@@ -569,7 +569,7 @@ function On({
569
569
  disabled: !U,
570
570
  onClick: () => _.mutate(),
571
571
  children: [
572
- _.isPending && /* @__PURE__ */ n(ve, { className: "h-3 w-3 animate-spin" }),
572
+ _.isPending && /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }),
573
573
  x.label,
574
574
  ", then try again"
575
575
  ]
@@ -599,11 +599,11 @@ function Re({
599
599
  t
600
600
  );
601
601
  }
602
- function dt(t) {
602
+ function ut(t) {
603
603
  const e = Math.floor(t / 6e4);
604
- return e < 60 ? `${Math.max(1, e)}m` : ar(t / 36e5);
604
+ return e < 60 ? `${Math.max(1, e)}m` : ir(t / 36e5);
605
605
  }
606
- function Ar({
606
+ function Dr({
607
607
  history: t,
608
608
  completedAt: e
609
609
  }) {
@@ -627,7 +627,7 @@ function Ar({
627
627
  /* @__PURE__ */ i("div", { className: "mb-1 flex items-center justify-between", children: [
628
628
  /* @__PURE__ */ n("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Time in step" }),
629
629
  /* @__PURE__ */ i("p", { className: "text-[10px] tabular-nums text-slate-400 dark:text-slate-500", children: [
630
- dt(c),
630
+ ut(c),
631
631
  " total",
632
632
  e ? "" : " · so far"
633
633
  ] })
@@ -637,7 +637,7 @@ function Ar({
637
637
  return /* @__PURE__ */ i(
638
638
  "div",
639
639
  {
640
- "data-tip": `${m.label} — ${dt(m.ms)}${m.current ? " (current)" : ""}`,
640
+ "data-tip": `${m.label} — ${ut(m.ms)}${m.current ? " (current)" : ""}`,
641
641
  className: "relative flex min-w-[8px] items-center overflow-hidden border-r border-white/60 last:border-r-0 dark:border-black/30",
642
642
  style: {
643
643
  width: `${h}%`,
@@ -647,7 +647,7 @@ function Ar({
647
647
  h >= 14 && /* @__PURE__ */ i("span", { className: "truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
648
648
  m.label,
649
649
  " · ",
650
- dt(m.ms)
650
+ ut(m.ms)
651
651
  ] }),
652
652
  m.current && /* @__PURE__ */ n(
653
653
  "span",
@@ -663,7 +663,7 @@ function Ar({
663
663
  }) })
664
664
  ] });
665
665
  }
666
- function Or({
666
+ function Ur({
667
667
  states: t,
668
668
  allTransitions: e,
669
669
  availableTransitions: r,
@@ -673,7 +673,7 @@ function Or({
673
673
  skippedStates: m
674
674
  }) {
675
675
  var K;
676
- const h = de(null);
676
+ const h = ce(null);
677
677
  _e(() => {
678
678
  const f = h.current;
679
679
  if (!f || f.scrollWidth <= f.clientWidth) return;
@@ -689,26 +689,26 @@ function Or({
689
689
  const R = (() => {
690
690
  if (c)
691
691
  return t.filter((b) => c.has(b.id) || p.has(b.id) || b.id === s).filter((b) => {
692
- const q = b.stage_visibility ?? "always";
693
- return q === "hide" ? !1 : q === "hide_unless_active" ? p.has(b.id) || b.id === s : !0;
694
- }).sort((b, q) => b.sort - q.sort);
692
+ const M = b.stage_visibility ?? "always";
693
+ return M === "hide" ? !1 : M === "hide_unless_active" ? p.has(b.id) || b.id === s : !0;
694
+ }).sort((b, M) => b.sort - M.sort);
695
695
  if (e.length === 0) {
696
696
  const b = /* @__PURE__ */ new Set([...p]);
697
- return s && b.add(s), t.filter((q) => b.has(q.id)).sort((q, ee) => q.sort - ee.sort);
697
+ return s && b.add(s), t.filter((M) => b.has(M.id)).sort((M, ee) => M.sort - ee.sort);
698
698
  }
699
699
  const f = new Set(
700
700
  o.filter((b) => b.from_state).map((b) => `${b.from_state}:${b.to_state}`)
701
701
  ), v = new Set(o.map((b) => b.from_state).filter(Boolean)), g = e.filter((b) => b.from_state !== null), $ = /* @__PURE__ */ new Map();
702
702
  for (const b of g) {
703
- const q = b.from_state;
704
- if (v.has(q) && !f.has(`${q}:${b.to_state}`)) continue;
705
- const ee = $.get(q) ?? [];
706
- ee.push(b.to_state), $.set(q, ee);
703
+ const M = b.from_state;
704
+ if (v.has(M) && !f.has(`${M}:${b.to_state}`)) continue;
705
+ const ee = $.get(M) ?? [];
706
+ ee.push(b.to_state), $.set(M, ee);
707
707
  }
708
708
  if (s) {
709
- const b = g.filter((q) => q.from_state === s).map((q) => q.to_state);
709
+ const b = g.filter((M) => M.from_state === s).map((M) => M.to_state);
710
710
  $.set(s, [
711
- .../* @__PURE__ */ new Set([...r.map((q) => q.to_state), ...b])
711
+ .../* @__PURE__ */ new Set([...r.map((M) => M.to_state), ...b])
712
712
  ]);
713
713
  }
714
714
  const T = /* @__PURE__ */ new Set(), X = t.filter((b) => b.is_initial).map((b) => b.id);
@@ -716,14 +716,14 @@ function Or({
716
716
  const b = X.shift();
717
717
  if (!T.has(b)) {
718
718
  T.add(b);
719
- for (const q of $.get(b) ?? []) T.has(q) || X.push(q);
719
+ for (const M of $.get(b) ?? []) T.has(M) || X.push(M);
720
720
  }
721
721
  }
722
722
  const u = /* @__PURE__ */ new Set([...T, ...p]);
723
723
  return s && u.add(s), t.filter((b) => u.has(b.id)).filter((b) => {
724
- const q = b.stage_visibility ?? "always";
725
- return q === "hide" ? !1 : q === "hide_unless_active" ? p.has(b.id) || b.id === s : !0;
726
- }).sort((b, q) => b.sort - q.sort);
724
+ const M = b.stage_visibility ?? "always";
725
+ return M === "hide" ? !1 : M === "hide_unless_active" ? p.has(b.id) || b.id === s : !0;
726
+ }).sort((b, M) => b.sort - M.sort);
727
727
  })();
728
728
  if (R.length < 2) return null;
729
729
  const _ = R.findIndex((f) => f.id === s), U = new Map(R.map((f, v) => [f.id, v])), j = new Map(t.map((f) => [f.id, f.label]));
@@ -737,10 +737,10 @@ function Or({
737
737
  }
738
738
  function re(f) {
739
739
  var v, g, $, T;
740
- return Ye(f) ? /* @__PURE__ */ n(Zt, { className: "inline h-2.5 w-2.5", "aria-label": xt(f) }) : ((((v = f.first_name) == null ? void 0 : v[0]) ?? "") + (((g = f.last_name) == null ? void 0 : g[0]) ?? "")).toUpperCase() || ((T = ($ = f.user_email) == null ? void 0 : $[0]) == null ? void 0 : T.toUpperCase()) || "?";
740
+ return Ze(f) ? /* @__PURE__ */ n(Zt, { className: "inline h-2.5 w-2.5", "aria-label": yt(f) }) : ((((v = f.first_name) == null ? void 0 : v[0]) ?? "") + (((g = f.last_name) == null ? void 0 : g[0]) ?? "")).toUpperCase() || ((T = ($ = f.user_email) == null ? void 0 : $[0]) == null ? void 0 : T.toUpperCase()) || "?";
741
741
  }
742
742
  function ae(f) {
743
- return Ct([f.first_name, f.last_name].filter(Boolean).join(" ") || f.user_email, f);
743
+ return Tt([f.first_name, f.last_name].filter(Boolean).join(" ") || f.user_email, f);
744
744
  }
745
745
  const F = /* @__PURE__ */ new Map();
746
746
  for (const f of [...o].sort(
@@ -755,11 +755,11 @@ function Or({
755
755
  }
756
756
  }
757
757
  function E(f) {
758
- const v = j.get(f.from_state ?? "") ?? "the previous step", g = j.get(f.to_state) ?? "the next step", $ = Ye(f) ? "it moved automatically" : `${ae(f)} moved it`;
758
+ const v = j.get(f.from_state ?? "") ?? "the previous step", g = j.get(f.to_state) ?? "the next step", $ = Ze(f) ? "it moved automatically" : `${ae(f)} moved it`;
759
759
  return `Passed over on ${Et(f.timestamp)} — ${$} straight from ${v} to ${g}`;
760
760
  }
761
- return /* @__PURE__ */ n(ln, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: h, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: R.map((f, v) => {
762
- const g = f.id === s, $ = p.has(f.id), T = $ && !g && (_ < 0 || v < _), X = $ && !g && !T, u = !$ && !g ? F.get(f.id) : void 0, b = !$ && !g ? m == null ? void 0 : m.get(f.id) : void 0, q = u || b ? [...u ? [E(u)] : [], ...b ?? []] : void 0, ee = q !== void 0, W = f.color ?? "#94a3b8", ce = v === R.length - 1, xe = ce ? null : R[v + 1], le = xe ? ne(f.id, xe.id) : [];
761
+ return /* @__PURE__ */ n(dn, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: h, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: R.map((f, v) => {
762
+ const g = f.id === s, $ = p.has(f.id), T = $ && !g && (_ < 0 || v < _), X = $ && !g && !T, u = !$ && !g ? F.get(f.id) : void 0, b = !$ && !g ? m == null ? void 0 : m.get(f.id) : void 0, M = u || b ? [...u ? [E(u)] : [], ...b ?? []] : void 0, ee = M !== void 0, W = f.color ?? "#94a3b8", ue = v === R.length - 1, xe = ue ? null : R[v + 1], de = xe ? ne(f.id, xe.id) : [];
763
763
  return /* @__PURE__ */ i("div", { className: "flex flex-1 items-start", children: [
764
764
  /* @__PURE__ */ i("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
765
765
  /* @__PURE__ */ n(
@@ -774,12 +774,12 @@ function Or({
774
774
  border: g || T ? "none" : ee ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
775
775
  boxShadow: g ? `0 0 0 3px white, 0 0 0 5px ${W}` : void 0
776
776
  },
777
- children: T ? /* @__PURE__ */ n(tt, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : g ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : ee ? /* @__PURE__ */ n(Wn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
777
+ children: T ? /* @__PURE__ */ n(rt, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : g ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : ee ? /* @__PURE__ */ n(Hn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
778
778
  },
779
779
  g ? "cur" : T ? "done" : ee ? "skip" : "todo"
780
780
  ),
781
- ee ? /* @__PURE__ */ i(ft, { children: [
782
- /* @__PURE__ */ n(ht, { asChild: !0, children: /* @__PURE__ */ n(
781
+ ee ? /* @__PURE__ */ i(bt, { children: [
782
+ /* @__PURE__ */ n(gt, { asChild: !0, children: /* @__PURE__ */ n(
783
783
  "span",
784
784
  {
785
785
  className: "w-full cursor-help break-words text-center leading-snug",
@@ -794,9 +794,9 @@ function Or({
794
794
  children: f.label
795
795
  }
796
796
  ) }),
797
- /* @__PURE__ */ i(bt, { className: "max-w-[260px]", children: [
797
+ /* @__PURE__ */ i(xt, { className: "max-w-[260px]", children: [
798
798
  /* @__PURE__ */ n("p", { className: "text-[11px] font-medium", children: "Skipped for this record" }),
799
- q.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: q.map((O) => /* @__PURE__ */ n("li", { children: O }, O)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
799
+ M.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: M.map((D) => /* @__PURE__ */ n("li", { children: D }, D)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
800
800
  ] })
801
801
  ] }) : /* @__PURE__ */ n(
802
802
  "span",
@@ -815,15 +815,15 @@ function Or({
815
815
  }
816
816
  )
817
817
  ] }),
818
- !ce && /* @__PURE__ */ i("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
818
+ !ue && /* @__PURE__ */ i("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
819
819
  (() => {
820
- const O = T ? `${W}55` : "#e8ecf0";
820
+ const D = T ? `${W}55` : "#e8ecf0";
821
821
  return /* @__PURE__ */ i("div", { className: "flex w-full shrink-0 items-center", children: [
822
822
  /* @__PURE__ */ n(
823
823
  "div",
824
824
  {
825
825
  className: "h-0.5 flex-1 rounded-l-sm",
826
- style: { backgroundColor: O }
826
+ style: { backgroundColor: D }
827
827
  }
828
828
  ),
829
829
  /* @__PURE__ */ n(
@@ -834,18 +834,18 @@ function Or({
834
834
  height: 0,
835
835
  borderTop: "3px solid transparent",
836
836
  borderBottom: "3px solid transparent",
837
- borderLeft: `5px solid ${O}`
837
+ borderLeft: `5px solid ${D}`
838
838
  }
839
839
  }
840
840
  )
841
841
  ] });
842
842
  })(),
843
- le.map((O) => {
844
- const Y = O.from_state !== f.id, z = Math.abs(
845
- (U.get(O.to_state) ?? 0) - (U.get(O.from_state ?? "") ?? 0)
846
- ) > 1 ? j.get(O.to_state) ?? "" : null;
847
- return /* @__PURE__ */ i(ft, { children: [
848
- /* @__PURE__ */ n(ht, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
843
+ de.map((D) => {
844
+ const Y = D.from_state !== f.id, z = Math.abs(
845
+ (U.get(D.to_state) ?? 0) - (U.get(D.from_state ?? "") ?? 0)
846
+ ) > 1 ? j.get(D.to_state) ?? "" : null;
847
+ return /* @__PURE__ */ i(bt, { children: [
848
+ /* @__PURE__ */ n(gt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
849
849
  /* @__PURE__ */ i(
850
850
  "span",
851
851
  {
@@ -853,45 +853,45 @@ function Or({
853
853
  style: { color: Y ? "#d97706" : "#475569" },
854
854
  children: [
855
855
  Y && "↩ ",
856
- re(O)
856
+ re(D)
857
857
  ]
858
858
  }
859
859
  ),
860
- /* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: kt(O.timestamp) })
860
+ /* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: _t(D.timestamp) })
861
861
  ] }) }),
862
- /* @__PURE__ */ i(bt, { side: "top", className: "space-y-0.5 text-[12px]", children: [
863
- Ye(O) ? /* @__PURE__ */ i(Se, { children: [
862
+ /* @__PURE__ */ i(xt, { side: "top", className: "space-y-0.5 text-[12px]", children: [
863
+ Ze(D) ? /* @__PURE__ */ i(Se, { children: [
864
864
  /* @__PURE__ */ i("p", { className: "font-medium", children: [
865
865
  Y ? "↩ Sent back · " : "",
866
- xt(O)
866
+ yt(D)
867
867
  ] }),
868
- vt(O) && /* @__PURE__ */ n("p", { className: "max-w-[280px] text-muted-foreground", children: vt(O) })
868
+ wt(D) && /* @__PURE__ */ n("p", { className: "max-w-[280px] text-muted-foreground", children: wt(D) })
869
869
  ] }) : /* @__PURE__ */ i("p", { className: "font-medium", children: [
870
870
  Y ? "↩ Sent back by" : "Approved by",
871
871
  " ",
872
- ae(O)
872
+ ae(D)
873
873
  ] }),
874
874
  z && /* @__PURE__ */ i("p", { className: "text-muted-foreground", children: [
875
875
  "→ straight to ",
876
876
  z
877
877
  ] }),
878
- /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Et(O.timestamp) })
878
+ /* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Et(D.timestamp) })
879
879
  ] })
880
- ] }, O.id);
880
+ ] }, D.id);
881
881
  })
882
882
  ] })
883
883
  ] }, f.id);
884
884
  }) }) }) });
885
885
  }
886
- function Dr({ history: t }) {
886
+ function Br({ history: t }) {
887
887
  return t.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: t.map((e) => {
888
- const r = Ye(e), s = r ? xt(e) : Ct([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), o = wr(e), c = e.comment && !r && !o ? e.comment : null, m = o ?? (r ? vt(e) : null);
888
+ const r = Ze(e), s = r ? yt(e) : Tt([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), o = Nr(e), c = e.comment && !r && !o ? e.comment : null, m = o ?? (r ? wt(e) : null);
889
889
  return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
890
890
  /* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
891
891
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
892
892
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
893
893
  e.from_state_label ? /* @__PURE__ */ n(Re, { label: e.from_state_label, color: e.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
894
- /* @__PURE__ */ n(wt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
894
+ /* @__PURE__ */ n(Nt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
895
895
  /* @__PURE__ */ n(Re, { label: e.to_state_label, color: e.to_state_color, small: !0 })
896
896
  ] }),
897
897
  c && /* @__PURE__ */ i("p", { className: "mt-1 text-slate-500 italic", children: [
@@ -909,7 +909,7 @@ function Dr({ history: t }) {
909
909
  s,
910
910
  m ? ` · ${m}` : "",
911
911
  " · ",
912
- kt(e.timestamp)
912
+ _t(e.timestamp)
913
913
  ]
914
914
  }
915
915
  )
@@ -917,8 +917,8 @@ function Dr({ history: t }) {
917
917
  ] }, e.id);
918
918
  }) });
919
919
  }
920
- function Ur({ value: t, onChange: e }) {
921
- const r = Pe(), [s, o] = Q(!1), [c, m] = Q(""), [h, p] = Q(""), x = de(null), k = de(null);
920
+ function Lr({ value: t, onChange: e }) {
921
+ const r = Pe(), [s, o] = Q(!1), [c, m] = Q(""), [h, p] = Q(""), x = ce(null), k = ce(null);
922
922
  _e(() => {
923
923
  s ? setTimeout(() => {
924
924
  var F;
@@ -930,7 +930,7 @@ function Ur({ value: t, onChange: e }) {
930
930
  const { data: R, isLoading: _ } = be({
931
931
  queryKey: ["users", "async-search", h],
932
932
  queryFn: () => r.request(
933
- ye("/users", {
933
+ we("/users", {
934
934
  limit: 50,
935
935
  sort: "first_name",
936
936
  ...h ? { search: h } : {}
@@ -939,13 +939,13 @@ function Ur({ value: t, onChange: e }) {
939
939
  enabled: s,
940
940
  staleTime: 3e4
941
941
  }), { data: U } = be({
942
- ...tr(r, t),
942
+ ...rr(r, t),
943
943
  enabled: !!t,
944
944
  staleTime: 5 * 6e4
945
945
  }), j = R ?? [], ne = U ?? j.find((F) => F.id === t) ?? null, re = ne ? [ne.first_name, ne.last_name].filter(Boolean).join(" ").trim() || ne.email : t ? "Selected person" : null, ae = (F) => [F.first_name, F.last_name].filter(Boolean).join(" ").trim();
946
- return /* @__PURE__ */ i(Nt, { open: s, onOpenChange: o, children: [
946
+ return /* @__PURE__ */ i(St, { open: s, onOpenChange: o, children: [
947
947
  /* @__PURE__ */ i("div", { className: "relative flex h-8 w-full", children: [
948
- /* @__PURE__ */ n(_t, { asChild: !0, children: /* @__PURE__ */ i(
948
+ /* @__PURE__ */ n(Ct, { asChild: !0, children: /* @__PURE__ */ i(
949
949
  "button",
950
950
  {
951
951
  type: "button",
@@ -968,9 +968,9 @@ function Ur({ value: t, onChange: e }) {
968
968
  }
969
969
  )
970
970
  ] }),
971
- /* @__PURE__ */ i(St, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
971
+ /* @__PURE__ */ i($t, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
972
972
  /* @__PURE__ */ n("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ i("div", { className: "relative", children: [
973
- /* @__PURE__ */ n(Hn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
973
+ /* @__PURE__ */ n(Vn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
974
974
  /* @__PURE__ */ n(
975
975
  "input",
976
976
  {
@@ -983,7 +983,7 @@ function Ur({ value: t, onChange: e }) {
983
983
  )
984
984
  ] }) }),
985
985
  /* @__PURE__ */ n("div", { className: "max-h-56 overflow-y-auto py-1", children: _ ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
986
- /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5 animate-spin" }),
986
+ /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }),
987
987
  "Loading…"
988
988
  ] }) : j.length === 0 ? /* @__PURE__ */ n("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : j.map((F) => {
989
989
  const E = ae(F), K = E ? `${E} (${F.email})` : F.email, f = F.id === t;
@@ -997,7 +997,7 @@ function Ur({ value: t, onChange: e }) {
997
997
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] hover:bg-slate-50 ${f ? "font-medium text-slate-800" : "text-slate-600"}`,
998
998
  children: [
999
999
  /* @__PURE__ */ n(
1000
- tt,
1000
+ rt,
1001
1001
  {
1002
1002
  className: `h-3.5 w-3.5 shrink-0 ${f ? "text-nvr-cyan" : "opacity-0"}`
1003
1003
  }
@@ -1017,7 +1017,7 @@ function Gt({
1017
1017
  email: r,
1018
1018
  initials: s
1019
1019
  }) {
1020
- return /* @__PURE__ */ n(on, { userId: t, children: /* @__PURE__ */ i(
1020
+ return /* @__PURE__ */ n(ln, { userId: t, children: /* @__PURE__ */ i(
1021
1021
  "button",
1022
1022
  {
1023
1023
  type: "button",
@@ -1025,7 +1025,7 @@ function Gt({
1025
1025
  className: "group/owner flex min-w-0 flex-1 items-center gap-2.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
1026
1026
  children: [
1027
1027
  /* @__PURE__ */ n(
1028
- lr,
1028
+ cr,
1029
1029
  {
1030
1030
  userId: t,
1031
1031
  alt: e,
@@ -1041,16 +1041,16 @@ function Gt({
1041
1041
  }
1042
1042
  ) });
1043
1043
  }
1044
- function Br({
1044
+ function Er({
1045
1045
  collection: t,
1046
1046
  item: e,
1047
1047
  states: r,
1048
1048
  currentStateId: s,
1049
1049
  returned: o = !1
1050
1050
  }) {
1051
- var se, G, qe, Oe;
1052
- const c = Pe(), m = ze(), { isAdmin: h } = nn(), [p, x] = Q(!1), [k, R] = Q(""), [_, U] = Q(""), [j, ne] = Q(!1), re = ["pipeline-instance-owners", t, e], ae = ["pipeline-owners-can-add", t, e], F = () => c.request(
1053
- ye(`/pipelines/instance/${t}/${e}/owners`)
1051
+ var ie, H, qe, Oe;
1052
+ const c = Pe(), m = Ve(), { isAdmin: h } = nn(), [p, x] = Q(!1), [k, R] = Q(""), [_, U] = Q(""), [j, ne] = Q(!1), re = ["pipeline-instance-owners", t, e], ae = ["pipeline-owners-can-add", t, e], F = () => c.request(
1053
+ we(`/pipelines/instance/${t}/${e}/owners`)
1054
1054
  ).then((a) => {
1055
1055
  var I;
1056
1056
  return m.setQueryData(ae, ((I = a.meta) == null ? void 0 : I.can_add) ?? null), a;
@@ -1068,27 +1068,27 @@ function Br({
1068
1068
  }), v = typeof f == "boolean" ? f : h, { data: g, isLoading: $ } = be({
1069
1069
  queryKey: ["pipeline-all-owners", t, e],
1070
1070
  queryFn: () => c.request(
1071
- ye(`/pipelines/instance/${t}/${e}/owners/all`)
1071
+ we(`/pipelines/instance/${t}/${e}/owners/all`)
1072
1072
  ).then((a) => a.data ?? null),
1073
1073
  enabled: !!s,
1074
1074
  staleTime: 3e4
1075
- }), T = new Set((E ?? []).map((a) => a.user)), X = s ? (((se = g == null ? void 0 : g[s]) == null ? void 0 : se.owners) ?? []).filter((a) => !T.has(a.id)) : [], u = new Map(
1076
- (s ? ((G = g == null ? void 0 : g[s]) == null ? void 0 : G.unavailable) ?? [] : []).map((a) => [
1075
+ }), T = new Set((E ?? []).map((a) => a.user)), X = s ? (((ie = g == null ? void 0 : g[s]) == null ? void 0 : ie.owners) ?? []).filter((a) => !T.has(a.id)) : [], u = new Map(
1076
+ (s ? ((H = g == null ? void 0 : g[s]) == null ? void 0 : H.unavailable) ?? [] : []).map((a) => [
1077
1077
  String(a.id).toUpperCase(),
1078
1078
  a
1079
1079
  ])
1080
- ), b = X.length + ((E == null ? void 0 : E.length) ?? 0), q = !!((qe = r.find((a) => a.id === s)) != null && qe.is_initial), ee = !K && !$, { data: W } = be({
1080
+ ), b = X.length + ((E == null ? void 0 : E.length) ?? 0), M = !!((qe = r.find((a) => a.id === s)) != null && qe.is_initial), ee = !K && !$, { data: W } = be({
1081
1081
  queryKey: ["pipeline-record-creator", t, e],
1082
1082
  queryFn: () => c.request(
1083
- ye(`/pipelines/instance/${t}/${e}/creator`)
1083
+ we(`/pipelines/instance/${t}/${e}/creator`)
1084
1084
  ).then((a) => a.data ?? null),
1085
- enabled: q && ee && b === 0,
1085
+ enabled: M && ee && b === 0,
1086
1086
  staleTime: 6e4
1087
- }), ce = q && b === 0 && (W != null && W.name) ? W : null, xe = () => {
1087
+ }), ue = M && b === 0 && (W != null && W.name) ? W : null, xe = () => {
1088
1088
  m.invalidateQueries({ queryKey: re }), m.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
1089
- }, le = je({
1089
+ }, de = Qe({
1090
1090
  mutationFn: () => c.request(
1091
- We(`/pipelines/instance/${t}/${e}/owners`, {
1091
+ Ge(`/pipelines/instance/${t}/${e}/owners`, {
1092
1092
  user: k,
1093
1093
  state: _ || void 0
1094
1094
  })
@@ -1098,8 +1098,8 @@ function Br({
1098
1098
  },
1099
1099
  // The server's reason (a 403 says why), not a bare status phrase.
1100
1100
  onError: (a) => V.error(Ae(a, "Failed to add owner"))
1101
- }), O = je({
1102
- mutationFn: (a) => c.request(Xn(`/pipelines/instance-owners/${a.id}`)),
1101
+ }), D = Qe({
1102
+ mutationFn: (a) => c.request(Jn(`/pipelines/instance-owners/${a.id}`)),
1103
1103
  onSuccess: (a, I) => {
1104
1104
  xe();
1105
1105
  const Z = [I.first_name, I.last_name].filter(Boolean).join(" ") || I.email;
@@ -1107,7 +1107,7 @@ function Br({
1107
1107
  action: {
1108
1108
  label: "Undo",
1109
1109
  onClick: () => void c.request(
1110
- We(`/pipelines/instance/${t}/${e}/owners`, {
1110
+ Ge(`/pipelines/instance/${t}/${e}/owners`, {
1111
1111
  user: I.user,
1112
1112
  state: I.state || void 0
1113
1113
  })
@@ -1117,8 +1117,8 @@ function Br({
1117
1117
  },
1118
1118
  onError: (a) => V.error(Ae(a, "Failed to remove owner"))
1119
1119
  }), Y = (a) => {
1120
- var J, fe;
1121
- const I = ((J = a.first_name) == null ? void 0 : J[0]) ?? "", Z = ((fe = a.last_name) == null ? void 0 : fe[0]) ?? "";
1120
+ var J, he;
1121
+ const I = ((J = a.first_name) == null ? void 0 : J[0]) ?? "", Z = ((he = a.last_name) == null ? void 0 : he[0]) ?? "";
1122
1122
  return (`${I}${Z}`.trim() || a.email[0] || "?").toUpperCase();
1123
1123
  }, z = (a) => {
1124
1124
  var I;
@@ -1129,14 +1129,14 @@ function Br({
1129
1129
  /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
1130
1130
  /* @__PURE__ */ n(Yt, { className: "h-3.5 w-3.5" }),
1131
1131
  "Owners",
1132
- K || $ ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : ce ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
1132
+ K || $ ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : ue ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
1133
1133
  "(",
1134
1134
  b,
1135
1135
  ")"
1136
1136
  ] })
1137
1137
  ] }),
1138
1138
  /* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
1139
- s && /* @__PURE__ */ n(cr, { collection: t, itemId: String(e) }),
1139
+ s && /* @__PURE__ */ n(mr, { collection: t, itemId: String(e) }),
1140
1140
  !p && v && /* @__PURE__ */ i(
1141
1141
  "button",
1142
1142
  {
@@ -1144,7 +1144,7 @@ function Br({
1144
1144
  onClick: () => x(!0),
1145
1145
  className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
1146
1146
  children: [
1147
- /* @__PURE__ */ n(zn, { className: "h-3 w-3" }),
1147
+ /* @__PURE__ */ n(Gn, { className: "h-3 w-3" }),
1148
1148
  "Add"
1149
1149
  ]
1150
1150
  }
@@ -1152,24 +1152,24 @@ function Br({
1152
1152
  ] })
1153
1153
  ] }),
1154
1154
  K || $ ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
1155
- /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5 animate-spin" }),
1155
+ /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }),
1156
1156
  "Resolving owners…"
1157
- ] }) : ce ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1157
+ ] }) : ue ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1158
1158
  o ? "Back with" : "With",
1159
1159
  " ",
1160
- /* @__PURE__ */ n(on, { userId: ce.id, children: /* @__PURE__ */ n(
1160
+ /* @__PURE__ */ n(ln, { userId: ue.id, children: /* @__PURE__ */ n(
1161
1161
  "button",
1162
1162
  {
1163
1163
  type: "button",
1164
- "aria-label": `${ce.name} — profile`,
1164
+ "aria-label": `${ue.name} — profile`,
1165
1165
  className: "rounded font-medium text-slate-700 underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:text-foreground",
1166
- children: ce.name
1166
+ children: ue.name
1167
1167
  }
1168
1168
  ) })
1169
1169
  ] }) : b === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ i("div", { className: "space-y-px", children: [
1170
1170
  X.map((a) => {
1171
- var J, fe;
1172
- const I = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, Z = (`${((J = a.first_name) == null ? void 0 : J[0]) ?? ""}${((fe = a.last_name) == null ? void 0 : fe[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
1171
+ var J, he;
1172
+ const I = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, Z = (`${((J = a.first_name) == null ? void 0 : J[0]) ?? ""}${((he = a.last_name) == null ? void 0 : he[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
1173
1173
  return /* @__PURE__ */ i(
1174
1174
  "div",
1175
1175
  {
@@ -1186,8 +1186,8 @@ function Br({
1186
1186
  "shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-medium",
1187
1187
  l.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
1188
1188
  ),
1189
- "data-tip": l.delegate ? `${I} is ${Le[l.reason] ?? l.reason} — ${l.delegate.name} covers` : `${I} is ${Le[l.reason] ?? l.reason} and can't approve this step`,
1190
- children: l.delegate ? `${Le[l.reason] ?? l.reason} · ${l.delegate.name} covers` : Le[l.reason] ?? l.reason
1189
+ "data-tip": l.delegate ? `${I} is ${Ee[l.reason] ?? l.reason} — ${l.delegate.name} covers` : `${I} is ${Ee[l.reason] ?? l.reason} and can't approve this step`,
1190
+ children: l.delegate ? `${Ee[l.reason] ?? l.reason} · ${l.delegate.name} covers` : Ee[l.reason] ?? l.reason
1191
1191
  }
1192
1192
  ) : null;
1193
1193
  })(),
@@ -1225,8 +1225,8 @@ function Br({
1225
1225
  {
1226
1226
  type: "button",
1227
1227
  "aria-label": `Remove ${[a.first_name, a.last_name].filter(Boolean).join(" ") || a.email} as an owner`,
1228
- disabled: O.isPending,
1229
- onClick: () => O.mutate(a),
1228
+ disabled: D.isPending,
1229
+ onClick: () => D.mutate(a),
1230
1230
  className: "shrink-0 rounded p-0.5 text-slate-300 opacity-0 transition-all hover:text-red-500 focus-visible:opacity-100 group-hover:opacity-100",
1231
1231
  children: /* @__PURE__ */ n(Jt, { className: "h-3 w-3" })
1232
1232
  }
@@ -1238,9 +1238,9 @@ function Br({
1238
1238
  ] }),
1239
1239
  p && /* @__PURE__ */ i("div", { className: "mt-3 space-y-2 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3", children: [
1240
1240
  /* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
1241
- /* @__PURE__ */ n(Ur, { value: k, onChange: R }),
1242
- h ? /* @__PURE__ */ i(Nt, { open: j, onOpenChange: ne, children: [
1243
- /* @__PURE__ */ n(_t, { asChild: !0, children: /* @__PURE__ */ i(
1241
+ /* @__PURE__ */ n(Lr, { value: k, onChange: R }),
1242
+ h ? /* @__PURE__ */ i(St, { open: j, onOpenChange: ne, children: [
1243
+ /* @__PURE__ */ n(Ct, { asChild: !0, children: /* @__PURE__ */ i(
1244
1244
  "button",
1245
1245
  {
1246
1246
  type: "button",
@@ -1251,9 +1251,9 @@ function Br({
1251
1251
  ]
1252
1252
  }
1253
1253
  ) }),
1254
- /* @__PURE__ */ n(St, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((a) => a.id)].map((a) => {
1254
+ /* @__PURE__ */ n($t, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((a) => a.id)].map((a) => {
1255
1255
  var J;
1256
- const I = a === "" ? "All states" : ((J = r.find((fe) => fe.id === a)) == null ? void 0 : J.label) ?? a;
1256
+ const I = a === "" ? "All states" : ((J = r.find((he) => he.id === a)) == null ? void 0 : J.label) ?? a;
1257
1257
  return /* @__PURE__ */ n(
1258
1258
  "button",
1259
1259
  {
@@ -1273,7 +1273,7 @@ function Br({
1273
1273
  ] }) : /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "Hands off the current step." }),
1274
1274
  /* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2 pt-0.5", children: [
1275
1275
  /* @__PURE__ */ n(
1276
- ue,
1276
+ pe,
1277
1277
  {
1278
1278
  type: "button",
1279
1279
  size: "sm",
@@ -1286,30 +1286,30 @@ function Br({
1286
1286
  }
1287
1287
  ),
1288
1288
  /* @__PURE__ */ n(
1289
- ue,
1289
+ pe,
1290
1290
  {
1291
1291
  type: "button",
1292
1292
  size: "sm",
1293
1293
  className: "h-7 text-[12px]",
1294
- disabled: !k || le.isPending,
1295
- onClick: () => le.mutate(),
1296
- children: le.isPending ? /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5 animate-spin" }) : "Add"
1294
+ disabled: !k || de.isPending,
1295
+ onClick: () => de.mutate(),
1296
+ children: de.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : "Add"
1297
1297
  }
1298
1298
  )
1299
1299
  ] })
1300
1300
  ] })
1301
1301
  ] });
1302
1302
  }
1303
- function Dn(t, e, r, s) {
1303
+ function Bn(t, e, r, s) {
1304
1304
  if (!t || !(r != null && r.length)) return null;
1305
1305
  const c = new Map(r.map((p) => [String(p.id).toUpperCase(), p])).get(String(t.to_state).toUpperCase()), m = Number(e == null ? void 0 : e.sort);
1306
1306
  if (!c || !Number.isFinite(m) || !(Number(c.sort) > m)) return null;
1307
- const h = hr(String(t.to_state), r, s);
1307
+ const h = gr(String(t.to_state), r, s);
1308
1308
  return h && h.skipped.length > 0 ? h : null;
1309
1309
  }
1310
- function Un({ landing: t }) {
1310
+ function Ln({ landing: t }) {
1311
1311
  if (!t || t.skipped.length === 0) return null;
1312
- const e = br(t);
1312
+ const e = xr(t);
1313
1313
  if (e.length === 1) {
1314
1314
  const r = e[0];
1315
1315
  return /* @__PURE__ */ i(
@@ -1351,12 +1351,12 @@ function Un({ landing: t }) {
1351
1351
  }
1352
1352
  );
1353
1353
  }
1354
- const Le = {
1354
+ const Ee = {
1355
1355
  out: "out of office",
1356
1356
  suspended: "suspended",
1357
1357
  redacted: "redacted"
1358
1358
  };
1359
- function Lr({
1359
+ function Ir({
1360
1360
  collection: t,
1361
1361
  item: e,
1362
1362
  states: r,
@@ -1365,7 +1365,7 @@ function Lr({
1365
1365
  const o = Pe(), [c, m] = Q(!1), { data: h, isLoading: p } = be({
1366
1366
  queryKey: ["pipeline-all-owners", t, e],
1367
1367
  queryFn: () => o.request(
1368
- ye(`/pipelines/instance/${t}/${e}/owners/all`)
1368
+ we(`/pipelines/instance/${t}/${e}/owners/all`)
1369
1369
  ).then((k) => k.data ?? null),
1370
1370
  enabled: c,
1371
1371
  staleTime: 3e4
@@ -1373,8 +1373,8 @@ function Lr({
1373
1373
  var R;
1374
1374
  return !h || ((R = h[k.id]) == null ? void 0 : R.on_path) !== !1;
1375
1375
  }).sort((k, R) => k.sort - R.sort);
1376
- return /* @__PURE__ */ i(Nt, { open: c, onOpenChange: m, children: [
1377
- /* @__PURE__ */ n(_t, { asChild: !0, children: /* @__PURE__ */ n(
1376
+ return /* @__PURE__ */ i(St, { open: c, onOpenChange: m, children: [
1377
+ /* @__PURE__ */ n(Ct, { asChild: !0, children: /* @__PURE__ */ n(
1378
1378
  "button",
1379
1379
  {
1380
1380
  type: "button",
@@ -1384,7 +1384,7 @@ function Lr({
1384
1384
  children: /* @__PURE__ */ n(Yt, { className: "h-3.5 w-3.5" })
1385
1385
  }
1386
1386
  ) }),
1387
- /* @__PURE__ */ i(St, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
1387
+ /* @__PURE__ */ i($t, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
1388
1388
  /* @__PURE__ */ i("div", { className: "border-b border-slate-100 px-4 py-3", children: [
1389
1389
  /* @__PURE__ */ n("p", { className: "text-[12px] font-semibold text-slate-700", children: "Approval Chain" }),
1390
1390
  /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-400 mt-0.5", children: "Owners per pipeline state" })
@@ -1415,13 +1415,13 @@ function Lr({
1415
1415
  // Radix tooltip with zero delay — native `title` waits on
1416
1416
  // the OS hover timer, and a truncated reason needs its
1417
1417
  // full text the moment the cursor lands on it.
1418
- /* @__PURE__ */ n(ln, { delayDuration: 0, children: /* @__PURE__ */ i(ft, { children: [
1419
- /* @__PURE__ */ n(ht, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
1418
+ /* @__PURE__ */ n(dn, { delayDuration: 0, children: /* @__PURE__ */ i(bt, { children: [
1419
+ /* @__PURE__ */ n(gt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
1420
1420
  /* @__PURE__ */ n("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-dashed border-slate-300 px-2 py-0.5 text-[10.5px] font-medium text-slate-400 dark:border-slate-600 dark:text-slate-500", children: "Skipped" }),
1421
1421
  j.length > 0 && /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: j.join(" · ") })
1422
1422
  ] }) }),
1423
1423
  /* @__PURE__ */ i(
1424
- bt,
1424
+ xt,
1425
1425
  {
1426
1426
  side: "bottom",
1427
1427
  align: "start",
@@ -1434,11 +1434,11 @@ function Lr({
1434
1434
  )
1435
1435
  ] }) })
1436
1436
  ) : /* @__PURE__ */ i(Se, { children: [
1437
- /* @__PURE__ */ n(or, { owners: R, max: 10, emptyLabel: "—" }),
1437
+ /* @__PURE__ */ n(dr, { owners: R, max: 10, emptyLabel: "—" }),
1438
1438
  ne.map((v) => /* @__PURE__ */ i(
1439
1439
  "span",
1440
1440
  {
1441
- "data-tip": `${v.name} is ${Le[v.reason] ?? v.reason}${v.delegate ? ` — ${v.delegate.name} covers${v.delegate.expires_at ? ` until ${rr(v.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1441
+ "data-tip": `${v.name} is ${Ee[v.reason] ?? v.reason}${v.delegate ? ` — ${v.delegate.name} covers${v.delegate.expires_at ? ` until ${sr(v.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1442
1442
  className: ge(
1443
1443
  "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
1444
1444
  v.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
@@ -1462,7 +1462,7 @@ function Lr({
1462
1462
  ] }) : /* @__PURE__ */ i("span", { className: "opacity-80", children: [
1463
1463
  " ",
1464
1464
  "· ",
1465
- Le[v.reason] ?? v.reason
1465
+ Ee[v.reason] ?? v.reason
1466
1466
  ] })
1467
1467
  ]
1468
1468
  },
@@ -1478,7 +1478,7 @@ function Lr({
1478
1478
  ] })
1479
1479
  ] });
1480
1480
  }
1481
- function Na({
1481
+ function Sa({
1482
1482
  collection: t,
1483
1483
  item: e,
1484
1484
  defaultExpanded: r,
@@ -1492,7 +1492,7 @@ function Na({
1492
1492
  asRole: k
1493
1493
  }) {
1494
1494
  return e === "new" ? null : /* @__PURE__ */ n(
1495
- Er,
1495
+ jr,
1496
1496
  {
1497
1497
  collection: t,
1498
1498
  item: e,
@@ -1509,14 +1509,14 @@ function Na({
1509
1509
  `${t}:${e}`
1510
1510
  );
1511
1511
  }
1512
- function Bn({
1512
+ function En({
1513
1513
  collection: t,
1514
1514
  item: e,
1515
1515
  omitLines: r
1516
1516
  }) {
1517
1517
  const s = Pe(), { data: o } = be({
1518
- queryKey: _n(t, e),
1519
- queryFn: () => Sn(s, t, e),
1518
+ queryKey: Cn(t, e),
1519
+ queryFn: () => $n(s, t, e),
1520
1520
  staleTime: 3e4,
1521
1521
  retry: !1
1522
1522
  });
@@ -1527,7 +1527,7 @@ function Bn({
1527
1527
  /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
1528
1528
  " ",
1529
1529
  "(",
1530
- $r(o.days_in_state),
1530
+ qr(o.days_in_state),
1531
1531
  "):",
1532
1532
  " ",
1533
1533
  o.changed_total === 0 && o.comments === 0 && o.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(Se, { children: [
@@ -1556,14 +1556,14 @@ function Bn({
1556
1556
  ] }),
1557
1557
  o.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
1558
1558
  o.field_changes.slice(0, 5).map((p) => {
1559
- const x = Tr(p.old, p.new);
1559
+ const x = Mr(p.old, p.new);
1560
1560
  return /* @__PURE__ */ i(
1561
1561
  "p",
1562
1562
  {
1563
1563
  "data-brief-change": p.field,
1564
1564
  className: "text-[11px] text-slate-500 dark:text-muted-foreground",
1565
1565
  children: [
1566
- /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label || nr(p.field) }),
1566
+ /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label || ar(p.field) }),
1567
1567
  p.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
1568
1568
  ":",
1569
1569
  " ",
@@ -1605,7 +1605,7 @@ function Bn({
1605
1605
  ))
1606
1606
  ] });
1607
1607
  }
1608
- function Er({
1608
+ function jr({
1609
1609
  collection: t,
1610
1610
  item: e,
1611
1611
  defaultExpanded: r,
@@ -1618,29 +1618,29 @@ function Er({
1618
1618
  addendumView: x,
1619
1619
  asRole: k
1620
1620
  }) {
1621
- var At, Ot, Dt;
1622
- const R = Pe(), _ = ze(), { isAdmin: U } = nn(), [j, ne] = Q(0), re = de(null);
1621
+ var Dt, Ut, Bt;
1622
+ const R = Pe(), _ = Ve(), { isAdmin: U } = nn(), [j, ne] = Q(0), re = ce(null);
1623
1623
  _e(() => {
1624
1624
  if (!U) return;
1625
1625
  const d = (N) => {
1626
1626
  const C = N.detail;
1627
- !C || C.claimed || C.collection !== t || String(C.item) !== String(e) || (C.claimed = !0, $(!0), ne((D) => D + 1), setTimeout(
1627
+ !C || C.claimed || C.collection !== t || String(C.item) !== String(e) || (C.claimed = !0, $(!0), ne((O) => O + 1), setTimeout(
1628
1628
  () => {
1629
- var D;
1630
- return (D = re.current) == null ? void 0 : D.scrollIntoView({ block: "center", behavior: "smooth" });
1629
+ var O;
1630
+ return (O = re.current) == null ? void 0 : O.scrollIntoView({ block: "center", behavior: "smooth" });
1631
1631
  },
1632
1632
  80
1633
1633
  ));
1634
1634
  };
1635
1635
  return window.addEventListener(Lt, d), () => window.removeEventListener(Lt, d);
1636
1636
  }, [U, t, e]);
1637
- const [ae, F] = Q(""), [E, K] = Q(null), [f, v] = Q(!1), [g, $] = Q(!1), [T, X] = Q(null), [u, b] = Q(null), [q, ee] = Q(null), [W, ce] = Q([]), xe = Cn(t, String(e));
1638
- an(t, e, "transition", !!E || !!T);
1639
- const le = Jn(t, e, "transition"), O = de(!1);
1637
+ const [ae, F] = Q(""), [E, K] = Q(null), [f, v] = Q(!1), [g, $] = Q(!1), [T, X] = Q(null), [u, b] = Q(null), [M, ee] = Q(null), [W, ue] = Q([]), xe = Tn(t, String(e));
1638
+ on(t, e, "transition", !!E || !!T);
1639
+ const de = er(t, e, "transition"), D = ce(!1);
1640
1640
  _e(() => {
1641
- !O.current && r !== void 0 && (O.current = !0, $(r));
1641
+ !D.current && r !== void 0 && (D.current = !0, $(r));
1642
1642
  }, [r]);
1643
- const Y = de(!1), z = (d) => {
1643
+ const Y = ce(!1), z = (d) => {
1644
1644
  Y.current || (Y.current = !0, b(null), P.mutate(d, {
1645
1645
  onSettled: (N, C) => {
1646
1646
  if (C) {
@@ -1652,54 +1652,54 @@ function Er({
1652
1652
  });
1653
1653
  }
1654
1654
  }));
1655
- }, se = async (d, N) => {
1656
- var pe, he;
1655
+ }, ie = async (d, N) => {
1656
+ var fe, me;
1657
1657
  if (Y.current || a != null && a.running_move) return;
1658
1658
  if (E === d) {
1659
1659
  K(null);
1660
1660
  return;
1661
1661
  }
1662
- if (!(N != null && N.cleared) && ((a == null ? void 0 : a.available_transitions) ?? []).some((oe) => oe.id === d && oe.advisory)) {
1662
+ if (!(N != null && N.cleared) && ((a == null ? void 0 : a.available_transitions) ?? []).some((le) => le.id === d && le.advisory)) {
1663
1663
  K(null), b(null), ee(d), _.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
1664
1664
  return;
1665
1665
  }
1666
1666
  if (ee(null), h) {
1667
1667
  Y.current = !0;
1668
- let oe = !1;
1668
+ let le = !1;
1669
1669
  try {
1670
- oe = await h();
1670
+ le = await h();
1671
1671
  } finally {
1672
1672
  Y.current = !1;
1673
1673
  }
1674
- if (!oe) return;
1674
+ if (!le) return;
1675
1675
  }
1676
- const C = (H ?? []).find((oe) => oe.id === d), D = String((C == null ? void 0 : C.comment_mode) ?? "none"), te = $t(C, (a == null ? void 0 : a.states) ?? [], (pe = a == null ? void 0 : a.instance) == null ? void 0 : pe.current_state);
1677
- if (D !== "optional" && D !== "required") {
1678
- if (C && !He(C, (a == null ? void 0 : a.states) ?? [], (he = a == null ? void 0 : a.instance) == null ? void 0 : he.current_state)) {
1676
+ const C = (G ?? []).find((le) => le.id === d), O = String((C == null ? void 0 : C.comment_mode) ?? "none"), te = qt(C, (a == null ? void 0 : a.states) ?? [], (fe = a == null ? void 0 : a.instance) == null ? void 0 : fe.current_state);
1677
+ if (O !== "optional" && O !== "required") {
1678
+ if (C && !Xe(C, (a == null ? void 0 : a.states) ?? [], (me = a == null ? void 0 : a.instance) == null ? void 0 : me.current_state)) {
1679
1679
  Y.current = !0;
1680
- let oe = [];
1680
+ let le = [];
1681
1681
  try {
1682
- oe = await xe();
1682
+ le = await xe();
1683
1683
  } finally {
1684
1684
  Y.current = !1;
1685
1685
  }
1686
- if (oe.length > 0 || te) {
1687
- ce(oe), K(d);
1686
+ if (le.length > 0 || te) {
1687
+ ue(le), K(d);
1688
1688
  return;
1689
1689
  }
1690
1690
  }
1691
1691
  if (te) {
1692
- ce([]), K(d);
1692
+ ue([]), K(d);
1693
1693
  return;
1694
1694
  }
1695
1695
  z({ transition_id: d });
1696
1696
  return;
1697
1697
  }
1698
- ce([]), K(d);
1699
- }, G = k ? ["pipeline-instance", t, e, k] : ["pipeline-instance", t, e], { settling: qe, settle: Oe } = kn(G), { data: a, isLoading: I } = be({
1700
- queryKey: G,
1698
+ ue([]), K(d);
1699
+ }, H = k ? ["pipeline-instance", t, e, k] : ["pipeline-instance", t, e], { settling: qe, settle: Oe } = _n(H), { data: a, isLoading: I } = be({
1700
+ queryKey: H,
1701
1701
  queryFn: () => R.request(
1702
- ye(
1702
+ we(
1703
1703
  `/pipelines/instance/${t}/${e}${k ? `?as_role=${encodeURIComponent(k)}` : ""}`
1704
1704
  )
1705
1705
  ).then(
@@ -1713,12 +1713,12 @@ function Er({
1713
1713
  }
1714
1714
  ),
1715
1715
  staleTime: 1e4,
1716
- refetchInterval: (d) => un(d.state.data)
1716
+ refetchInterval: (d) => mn(d.state.data)
1717
1717
  });
1718
- mn(!!(a != null && a.running_move), () => {
1719
- Ee(_, t, String(e)), Ie(_, t, String(e)), et(_, t, String(e));
1718
+ pn(!!(a != null && a.running_move), () => {
1719
+ Ie(_, t, String(e)), je(_, t, String(e)), nt(_, t, String(e));
1720
1720
  });
1721
- const Z = Nn(
1721
+ const Z = Sn(
1722
1722
  a ? (a.available_transitions ?? []).map((d) => String(d.id)) : null,
1723
1723
  `${t}:${e}`
1724
1724
  );
@@ -1730,50 +1730,50 @@ function Er({
1730
1730
  }),
1731
1731
  [_, t, e]
1732
1732
  );
1733
- const { data: J, isLoading: fe } = be({
1733
+ const { data: J, isLoading: he } = be({
1734
1734
  queryKey: ["pipeline-all-owners", t, e],
1735
1735
  queryFn: () => R.request(
1736
- ye(`/pipelines/instance/${t}/${e}/owners/all`)
1736
+ we(`/pipelines/instance/${t}/${e}/owners/all`)
1737
1737
  ).then((d) => d.data ?? null),
1738
1738
  // Also when a send back is on offer: its target may be a chain step this record skipped.
1739
1739
  // And while a move is being confirmed: the panel names where it really lands.
1740
- enabled: (g || qn(a) || !!E) && !!(a != null && a.instance),
1740
+ enabled: (g || Rn(a) || !!E) && !!(a != null && a.instance),
1741
1741
  staleTime: 3e4
1742
- }), l = Je(() => {
1742
+ }), l = et(() => {
1743
1743
  if (!J) return null;
1744
1744
  const d = Object.entries(J);
1745
1745
  return d.length === 0 || d.every(([, N]) => N.on_path === void 0) ? null : new Set(d.filter(([, N]) => N.on_path !== !1).map(([N]) => N));
1746
- }, [J]), y = Je(() => {
1746
+ }, [J]), y = et(() => {
1747
1747
  if (!J) return null;
1748
1748
  const d = /* @__PURE__ */ new Map();
1749
1749
  for (const [N, C] of Object.entries(J))
1750
1750
  C.skipped && d.set(N, C.skip_reasons ?? []);
1751
1751
  return d;
1752
- }, [J]), w = je({
1753
- mutationFn: () => R.request(We(`/pipelines/instance/${t}/${e}/start`, {})),
1752
+ }, [J]), w = Qe({
1753
+ mutationFn: () => R.request(Ge(`/pipelines/instance/${t}/${e}/start`, {})),
1754
1754
  onSuccess: () => {
1755
- _.invalidateQueries({ queryKey: G }), V.success("Pipeline started");
1755
+ _.invalidateQueries({ queryKey: H }), V.success("Pipeline started");
1756
1756
  },
1757
1757
  onError: () => V.error("Failed to start pipeline")
1758
- }), P = je({
1758
+ }), P = Qe({
1759
1759
  mutationFn: ({
1760
1760
  transition_id: d,
1761
1761
  comment: N,
1762
1762
  reviewed: C,
1763
- lock_ack: D
1763
+ lock_ack: O
1764
1764
  }) => R.request(
1765
- We(`/pipelines/instance/${t}/${e}/transition`, {
1765
+ Ge(`/pipelines/instance/${t}/${e}/transition`, {
1766
1766
  transition_id: d,
1767
1767
  comment: N,
1768
1768
  ...C ? { reviewed: !0 } : {},
1769
- ...D ? { lock_ack: !0 } : {},
1770
- ...fn(a == null ? void 0 : a.available_transitions, d)
1769
+ ...O ? { lock_ack: !0 } : {},
1770
+ ...hn(a == null ? void 0 : a.available_transitions, d)
1771
1771
  })
1772
1772
  ),
1773
1773
  onMutate: (d) => {
1774
1774
  var N;
1775
1775
  return {
1776
- slow: Pn(
1776
+ slow: An(
1777
1777
  (N = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
1778
1778
  (C) => C.id === d.transition_id
1779
1779
  )) == null ? void 0 : N.label
@@ -1781,30 +1781,30 @@ function Er({
1781
1781
  };
1782
1782
  },
1783
1783
  onSuccess: (d, N, C) => {
1784
- _.invalidateQueries({ queryKey: G }), t === "nivaro_addendums" && _.invalidateQueries({ queryKey: ["addendums"] }), Ee(_, t, String(e)), Ie(_, t, String(e)), et(_, t, String(e)), b(null), F(""), K(null), X(null);
1785
- const D = pn(d);
1786
- D ? V.info(
1787
- `${D.transition_label ?? "The move"} started. You will be told if it does not go through.`,
1784
+ _.invalidateQueries({ queryKey: H }), t === "nivaro_addendums" && _.invalidateQueries({ queryKey: ["addendums"] }), Ie(_, t, String(e)), je(_, t, String(e)), nt(_, t, String(e)), b(null), F(""), K(null), X(null);
1785
+ const O = fn(d);
1786
+ O ? V.info(
1787
+ `${O.transition_label ?? "The move"} started. You will be told if it does not go through.`,
1788
1788
  C == null ? void 0 : C.slow.done()
1789
- ) : V.success(Rn(a, N.transition_id, d), C == null ? void 0 : C.slow.done());
1789
+ ) : V.success(Fn(a, N.transition_id, d), C == null ? void 0 : C.slow.done());
1790
1790
  },
1791
1791
  onError: (d, N, C) => {
1792
- var oe, Ke;
1793
- if (C == null || C.slow.fail(), xn(d)) {
1794
- _.invalidateQueries({ queryKey: G });
1792
+ var le, ze;
1793
+ if (C == null || C.slow.fail(), yn(d)) {
1794
+ _.invalidateQueries({ queryKey: H });
1795
1795
  return;
1796
1796
  }
1797
- if (nt(d) === "TRANSITION_RUNNING") {
1798
- _.invalidateQueries({ queryKey: G }), K(null), X(null), V.info(Ae(d, "This move is already running on this record."));
1797
+ if (at(d) === "TRANSITION_RUNNING") {
1798
+ _.invalidateQueries({ queryKey: H }), K(null), X(null), V.info(Ae(d, "This move is already running on this record."));
1799
1799
  return;
1800
1800
  }
1801
- const D = yn(d);
1802
- if (D) {
1801
+ const O = kn(d);
1802
+ if (O) {
1803
1803
  K(null);
1804
- const ke = ((oe = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
1804
+ const ke = ((le = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
1805
1805
  (A) => A.id === N.transition_id
1806
- )) == null ? void 0 : oe.label) ?? "Move";
1807
- V.warning(D.message, {
1806
+ )) == null ? void 0 : le.label) ?? "Move";
1807
+ V.warning(O.message, {
1808
1808
  id: `nvr-locked-move:${t}:${String(e)}`,
1809
1809
  duration: 2e4,
1810
1810
  action: {
@@ -1816,7 +1816,7 @@ function Er({
1816
1816
  });
1817
1817
  return;
1818
1818
  }
1819
- const te = vn(d);
1819
+ const te = wn(d);
1820
1820
  if (te) {
1821
1821
  X((ke) => ({
1822
1822
  payload: te,
@@ -1826,47 +1826,51 @@ function Er({
1826
1826
  }));
1827
1827
  return;
1828
1828
  }
1829
- const pe = d == null ? void 0 : d.response;
1830
- b(wn(d, N));
1831
- const he = sn(
1829
+ const fe = d == null ? void 0 : d.response;
1830
+ b(Nn(d, N));
1831
+ const me = an(
1832
1832
  d,
1833
- (Ke = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
1833
+ (ze = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
1834
1834
  (ke) => ke.id === N.transition_id
1835
- )) == null ? void 0 : Ke.label
1835
+ )) == null ? void 0 : ze.label
1836
1836
  );
1837
- V.error((he == null ? void 0 : he.title) ?? Ae(d, "Failed to execute transition"), {
1837
+ V.error((me == null ? void 0 : me.title) ?? Ae(d, "Failed to execute transition"), {
1838
1838
  duration: 12e3,
1839
1839
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
1840
- ...rn(d, { action: "Transition" }),
1841
- ...he ? { description: he.description } : {},
1840
+ // A partner's refusal copies what the toast said and the other system's answer as
1841
+ // stored, never the generic reading of a 422.
1842
+ ...rn(me ? sn(d, me) : d, {
1843
+ action: "Transition"
1844
+ }),
1845
+ ...me ? { description: me.description } : {},
1842
1846
  // #1867: a refusal carries "Why?" — the role, owner or access rule
1843
1847
  // that stopped it, and who can change it.
1844
- ...dn(d) ? {
1845
- action: cn(R, {
1848
+ ...cn(d) ? {
1849
+ action: un(R, {
1846
1850
  collection: t,
1847
1851
  itemId: String(e),
1848
1852
  action: "transition",
1849
1853
  transitionId: N.transition_id
1850
1854
  })
1851
1855
  } : {}
1852
- }), X(null), K(null), Ee(_, t, String(e)), Ie(_, t, String(e)), (pe == null ? void 0 : pe.status) === 409 && _.invalidateQueries({ queryKey: G });
1856
+ }), X(null), K(null), Ie(_, t, String(e)), je(_, t, String(e)), (fe == null ? void 0 : fe.status) === 409 && _.invalidateQueries({ queryKey: H });
1853
1857
  }
1854
- }), B = de(se);
1855
- B.current = se;
1856
- const ie = de((a == null ? void 0 : a.available_transitions) ?? []);
1857
- if (ie.current = (a == null ? void 0 : a.available_transitions) ?? [], _e(() => {
1858
+ }), B = ce(ie);
1859
+ B.current = ie;
1860
+ const oe = ce((a == null ? void 0 : a.available_transitions) ?? []);
1861
+ if (oe.current = (a == null ? void 0 : a.available_transitions) ?? [], _e(() => {
1858
1862
  const d = (N) => {
1859
1863
  const C = N.detail;
1860
1864
  if (!C || C.claimed || C.collection !== t || String(C.item) !== String(e)) return;
1861
1865
  C.claimed = !0;
1862
- const D = String(C.transition_id).toUpperCase(), te = ie.current.find((pe) => String(pe.id).toUpperCase() === D);
1866
+ const O = String(C.transition_id).toUpperCase(), te = oe.current.find((fe) => String(fe.id).toUpperCase() === O);
1863
1867
  if (!te) {
1864
1868
  V.error("That step is not available from where the record is now");
1865
1869
  return;
1866
1870
  }
1867
1871
  B.current(te.id);
1868
1872
  };
1869
- return window.addEventListener(Ze, d), () => window.removeEventListener(Ze, d);
1873
+ return window.addEventListener(tt, d), () => window.removeEventListener(tt, d);
1870
1874
  }, [t, e]), I)
1871
1875
  return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ i("div", { className: "flex w-full items-center gap-2.5 px-5 py-3.5", children: [
1872
1876
  /* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
@@ -1875,80 +1879,80 @@ function Er({
1875
1879
  /* @__PURE__ */ n(Me, { className: "ml-auto h-3.5 w-3.5 rounded" })
1876
1880
  ] }) });
1877
1881
  if (!(a != null && a.binding)) return null;
1878
- const { instance: M, available_transitions: H, history: S, states: L } = a, Ce = new Map((L ?? []).map((d) => [d.id, d])), we = (M == null ? void 0 : M.current_state_obj) ?? null, me = E ? (H ?? []).find((d) => d.id === E) : null, Ln = me ? Ce.get(me.to_state) : null, Ge = Dn(me, we, L, J), rt = (Ge == null ? void 0 : Ge.state) ?? Ln, En = M != null && M.completed_at && H ? H.filter(
1879
- (d) => d.from_state && String(d.from_state).toUpperCase() === String(M.current_state).toUpperCase()
1880
- ) : null, De = M != null && M.completed_at ? En ?? [] : Mn(
1881
- H ?? [],
1882
+ const { instance: q, available_transitions: G, history: S, states: L } = a, ve = new Map((L ?? []).map((d) => [d.id, d])), Ce = (q == null ? void 0 : q.current_state_obj) ?? null, se = E ? (G ?? []).find((d) => d.id === E) : null, In = se ? ve.get(se.to_state) : null, Ye = Bn(se, Ce, L, J), st = (Ye == null ? void 0 : Ye.state) ?? In, jn = q != null && q.completed_at && G ? G.filter(
1883
+ (d) => d.from_state && String(d.from_state).toUpperCase() === String(q.current_state).toUpperCase()
1884
+ ) : null, De = q != null && q.completed_at ? jn ?? [] : Pn(
1885
+ G ?? [],
1882
1886
  L ?? [],
1883
- M == null ? void 0 : M.current_state,
1887
+ q == null ? void 0 : q.current_state,
1884
1888
  y
1885
- ), at = De.length > 0, Tt = hn(De), Qe = q ? De.find((d) => d.id === q) : null, $e = (a == null ? void 0 : a.running_move) ?? null, Ve = $e ? null : (a == null ? void 0 : a.last_move_problem) ?? null, qt = Ve ? De.find((d) => gt(d.id, Ve.transition_id)) : null, Mt = (d, N = !1) => {
1889
+ ), it = De.length > 0, Mt = gn(De), Ke = M ? De.find((d) => d.id === M) : null, $e = (a == null ? void 0 : a.running_move) ?? null, We = $e ? null : (a == null ? void 0 : a.last_move_problem) ?? null, Rt = We ? De.find((d) => vt(d.id, We.transition_id)) : null, Pt = (d, N = !1) => {
1886
1890
  const C = /* @__PURE__ */ new Map();
1887
- for (const D of d) {
1888
- const te = C.get(D.label) ?? [];
1889
- te.push(D), C.set(D.label, te);
1891
+ for (const O of d) {
1892
+ const te = C.get(O.label) ?? [];
1893
+ te.push(O), C.set(O.label, te);
1890
1894
  }
1891
- return Array.from(C.entries()).map(([D, te]) => {
1892
- var Ke, ke;
1893
- const pe = ((Ke = te[0]) == null ? void 0 : Ke.color) ?? null, he = te.some((A) => A.id === E), oe = (A) => pe ? A ? { backgroundColor: pe, borderColor: pe } : { borderColor: pe, color: pe } : void 0;
1895
+ return Array.from(C.entries()).map(([O, te]) => {
1896
+ var ze, ke;
1897
+ const fe = ((ze = te[0]) == null ? void 0 : ze.color) ?? null, me = te.some((A) => A.id === E), le = (A) => fe ? A ? { backgroundColor: fe, borderColor: fe } : { borderColor: fe, color: fe } : void 0;
1894
1898
  if (te.length === 1) {
1895
- const A = te[0], Te = P.isPending && ((ke = P.variables) == null ? void 0 : ke.transition_id) === A.id || gt($e == null ? void 0 : $e.transition_id, A.id);
1896
- return /* @__PURE__ */ i(
1897
- ue,
1899
+ const A = te[0], Te = P.isPending && ((ke = P.variables) == null ? void 0 : ke.transition_id) === A.id || vt($e == null ? void 0 : $e.transition_id, A.id), Ue = bn(We, A.id), He = /* @__PURE__ */ i(
1900
+ pe,
1898
1901
  {
1899
1902
  size: "sm",
1900
- variant: he && !A.advisory ? "default" : "outline",
1903
+ variant: me && !A.advisory ? "default" : "outline",
1901
1904
  className: ge(
1902
1905
  N ? "h-7 text-[11px]" : "text-[12px]",
1903
1906
  "gap-1.5 data-[fresh=true]:opacity-60",
1904
- A.advisory && Fn
1907
+ A.advisory && On
1905
1908
  ),
1906
- style: A.advisory ? void 0 : oe(he),
1907
- disabled: P.isPending || qe || !!$e,
1909
+ style: A.advisory ? void 0 : le(me),
1910
+ disabled: P.isPending || qe || !!$e || !!Ue,
1908
1911
  "aria-disabled": Z.dimmed(A.id) || void 0,
1909
1912
  "data-fresh": Z.dimmed(A.id) || void 0,
1910
1913
  ...Z.bind(A.id),
1911
- ...Be(A),
1914
+ ...Le(A),
1912
1915
  onClick: () => {
1913
- Z.press(A.id) && se(A.id);
1916
+ Z.press(A.id) && ie(A.id);
1914
1917
  },
1915
1918
  children: [
1916
- Te ? /* @__PURE__ */ n(ve, { className: "h-3 w-3 animate-spin" }) : A.advisory && /* @__PURE__ */ n(Ne, {}),
1917
- D
1919
+ Te ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : A.advisory && /* @__PURE__ */ n(Ne, {}),
1920
+ O
1918
1921
  ]
1919
1922
  },
1920
- D
1923
+ O
1921
1924
  );
1925
+ return Ue ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": Ue, "data-move-held": !0, children: He }, O) : He;
1922
1926
  }
1923
- return /* @__PURE__ */ i(ct, { children: [
1924
- /* @__PURE__ */ n(ut, { asChild: !0, children: /* @__PURE__ */ i(
1925
- ue,
1927
+ return /* @__PURE__ */ i(mt, { children: [
1928
+ /* @__PURE__ */ n(pt, { asChild: !0, children: /* @__PURE__ */ i(
1929
+ pe,
1926
1930
  {
1927
1931
  size: "sm",
1928
- variant: he ? "default" : "outline",
1932
+ variant: me ? "default" : "outline",
1929
1933
  className: `${N ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1930
- style: oe(he),
1934
+ style: le(me),
1931
1935
  disabled: P.isPending || qe || !!$e,
1932
1936
  children: [
1933
1937
  te.every((A) => A.advisory) && /* @__PURE__ */ n(Ne, {}),
1934
- D,
1938
+ O,
1935
1939
  /* @__PURE__ */ n(Fe, { className: "h-3 w-3" })
1936
1940
  ]
1937
1941
  }
1938
1942
  ) }),
1939
- /* @__PURE__ */ i(mt, { align: "start", children: [
1943
+ /* @__PURE__ */ i(ft, { align: "start", children: [
1940
1944
  [...te].sort(
1941
1945
  (A, Te) => {
1942
- var Ut, Bt;
1943
- return (((Ut = Ce.get(A.to_state)) == null ? void 0 : Ut.sort) ?? 999) - (((Bt = Ce.get(Te.to_state)) == null ? void 0 : Bt.sort) ?? 999);
1946
+ var Ue, He;
1947
+ return (((Ue = ve.get(A.to_state)) == null ? void 0 : Ue.sort) ?? 999) - (((He = ve.get(Te.to_state)) == null ? void 0 : He.sort) ?? 999);
1944
1948
  }
1945
1949
  ).map((A) => {
1946
1950
  var Te;
1947
1951
  return /* @__PURE__ */ i(
1948
- Xe,
1952
+ Je,
1949
1953
  {
1950
- onSelect: () => se(A.id),
1951
- ...Be(A, "menu"),
1954
+ onSelect: () => ie(A.id),
1955
+ ...Le(A, "menu"),
1952
1956
  children: [
1953
1957
  A.color && /* @__PURE__ */ n(
1954
1958
  "span",
@@ -1957,7 +1961,7 @@ function Er({
1957
1961
  style: { backgroundColor: A.color }
1958
1962
  }
1959
1963
  ),
1960
- ((Te = Ce.get(A.to_state)) == null ? void 0 : Te.label) ?? A.to_state,
1964
+ ((Te = ve.get(A.to_state)) == null ? void 0 : Te.label) ?? A.to_state,
1961
1965
  A.advisory && /* @__PURE__ */ n(Ne, { className: "ml-auto" })
1962
1966
  ]
1963
1967
  },
@@ -1965,20 +1969,20 @@ function Er({
1965
1969
  );
1966
1970
  }),
1967
1971
  /* @__PURE__ */ n(
1968
- yt,
1972
+ kt,
1969
1973
  {
1970
1974
  moves: te,
1971
1975
  nameOf: (A) => {
1972
1976
  var Te;
1973
- return ((Te = Ce.get(A.to_state)) == null ? void 0 : Te.label) ?? A.to_state;
1977
+ return ((Te = ve.get(A.to_state)) == null ? void 0 : Te.label) ?? A.to_state;
1974
1978
  }
1975
1979
  }
1976
1980
  )
1977
1981
  ] })
1978
- ] }, D);
1982
+ ] }, O);
1979
1983
  });
1980
- }, st = u ? /* @__PURE__ */ n(
1981
- On,
1984
+ }, ot = u ? /* @__PURE__ */ n(
1985
+ Un,
1982
1986
  {
1983
1987
  collection: t,
1984
1988
  item: String(e),
@@ -1986,70 +1990,70 @@ function Er({
1986
1990
  onDismiss: () => b(null),
1987
1991
  onFixed: () => z({ transition_id: u.transitionId, comment: u.comment })
1988
1992
  }
1989
- ) : null, In = g && !m && !!M && at, Rt = (d) => /* @__PURE__ */ i(Se, { children: [
1990
- Tt.map(({ advisory: N, moves: C }) => /* @__PURE__ */ n(
1991
- bn,
1993
+ ) : null, Qn = g && !m && !!q && it, Ft = (d) => /* @__PURE__ */ i(Se, { children: [
1994
+ Mt.map(({ advisory: N, moves: C }) => /* @__PURE__ */ n(
1995
+ xn,
1992
1996
  {
1993
1997
  collection: t,
1994
1998
  item: String(e),
1995
1999
  advisory: N,
1996
- armedMove: Qe && C.some((D) => D.id === Qe.id) ? {
1997
- id: Qe.id,
1998
- label: Qe.label,
1999
- confirms: An(Qe, L ?? [], M == null ? void 0 : M.current_state)
2000
+ armedMove: Ke && C.some((O) => O.id === Ke.id) ? {
2001
+ id: Ke.id,
2002
+ label: Ke.label,
2003
+ confirms: Dn(Ke, L ?? [], q == null ? void 0 : q.current_state)
2000
2004
  } : null,
2001
- stops: Tt.length > 1 ? [...new Set(C.map((D) => D.label))] : void 0,
2005
+ stops: Mt.length > 1 ? [...new Set(C.map((O) => O.label))] : void 0,
2002
2006
  className: d ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0,
2003
2007
  onDismiss: () => ee(null),
2004
- onFixed: (D) => {
2005
- ee(null), _.invalidateQueries({ queryKey: G }), D && se(D.id, { cleared: !0 });
2008
+ onFixed: (O) => {
2009
+ ee(null), _.invalidateQueries({ queryKey: H }), O && ie(O.id, { cleared: !0 });
2006
2010
  }
2007
2011
  },
2008
2012
  `${N.code}:${N.message}`
2009
2013
  )),
2010
2014
  $e && /* @__PURE__ */ n(
2011
- mr,
2015
+ fr,
2012
2016
  {
2013
2017
  run: $e,
2014
2018
  className: d ? "rounded-lg border border-sky-200/80 px-3 dark:border-sky-500/20" : void 0
2015
2019
  }
2016
2020
  ),
2017
- Ve && /* @__PURE__ */ n(
2018
- pr,
2021
+ We && /* @__PURE__ */ n(
2022
+ hr,
2019
2023
  {
2020
- problem: Ve,
2024
+ problem: We,
2021
2025
  retryDisabled: P.isPending || qe,
2022
- onRetry: qt ? () => void se(qt.id) : void 0,
2026
+ onRetry: Rt ? () => void ie(Rt.id) : void 0,
2023
2027
  className: d ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0
2024
2028
  }
2025
2029
  )
2026
- ] }), Pt = Pr(S ?? [], M == null ? void 0 : M.current_state, L ?? []), Ft = /* @__PURE__ */ i("div", { className: "space-y-3 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3.5", children: [
2030
+ ] }), At = Ar(S ?? [], q == null ? void 0 : q.current_state, L ?? []), Ot = /* @__PURE__ */ i("div", { className: "space-y-3 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3.5", children: [
2027
2031
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
2028
2032
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
2029
- me && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: me.label }),
2030
- we && rt && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2031
- /* @__PURE__ */ n(Re, { label: we.label, color: we.color, small: !0 }),
2032
- /* @__PURE__ */ n(wt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2033
- /* @__PURE__ */ n(Re, { label: rt.label, color: rt.color, small: !0 })
2033
+ se && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: se.label }),
2034
+ Ce && st && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2035
+ /* @__PURE__ */ n(Re, { label: Ce.label, color: Ce.color, small: !0 }),
2036
+ /* @__PURE__ */ n(Nt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2037
+ /* @__PURE__ */ n(Re, { label: st.label, color: st.color, small: !0 })
2034
2038
  ] })
2035
2039
  ] }),
2036
- /* @__PURE__ */ n(Un, { landing: Ge }),
2037
- /* @__PURE__ */ n(Tn, { collection: t, item: String(e), tx: me }),
2038
- /* @__PURE__ */ n(Bn, { collection: t, item: e, omitLines: W }),
2039
- /* @__PURE__ */ n($n, { lines: W }),
2040
+ /* @__PURE__ */ n(Ln, { landing: Ye }),
2041
+ /* @__PURE__ */ n(Mn, { collection: t, item: String(e), tx: se }),
2042
+ /* @__PURE__ */ n(En, { collection: t, item: e, omitLines: W }),
2043
+ /* @__PURE__ */ n(qn, { lines: W }),
2040
2044
  /* @__PURE__ */ n(
2041
2045
  "input",
2042
2046
  {
2043
2047
  type: "text",
2044
2048
  value: ae,
2045
2049
  onChange: (d) => F(d.target.value),
2046
- placeholder: String((me == null ? void 0 : me.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
2050
+ placeholder: String((se == null ? void 0 : se.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
2047
2051
  className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
2048
2052
  }
2049
2053
  ),
2050
2054
  /* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
2051
2055
  /* @__PURE__ */ n(
2052
- ue,
2056
+ pe,
2053
2057
  {
2054
2058
  type: "button",
2055
2059
  size: "sm",
@@ -2060,19 +2064,19 @@ function Er({
2060
2064
  }
2061
2065
  ),
2062
2066
  /* @__PURE__ */ n(
2063
- ue,
2067
+ pe,
2064
2068
  {
2065
2069
  type: "button",
2066
2070
  size: "sm",
2067
2071
  className: "h-7 gap-1.5 text-[12px]",
2068
- disabled: P.isPending || !!$e || String((me == null ? void 0 : me.comment_mode) ?? "") === "required" && ae.trim() === "",
2072
+ disabled: P.isPending || !!$e || String((se == null ? void 0 : se.comment_mode) ?? "") === "required" && ae.trim() === "",
2069
2073
  onClick: () => z({
2070
2074
  transition_id: E,
2071
2075
  comment: ae.trim() || void 0
2072
2076
  }),
2073
- children: P.isPending ? /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(Se, { children: [
2074
- /* @__PURE__ */ n("span", { children: W.length > 0 && me ? `${me.label} anyway` : "Confirm" }),
2075
- /* @__PURE__ */ n(tt, { className: "h-3 w-3" })
2077
+ children: P.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(Se, { children: [
2078
+ /* @__PURE__ */ n("span", { children: W.length > 0 && se ? `${se.label} anyway` : "Confirm" }),
2079
+ /* @__PURE__ */ n(rt, { className: "h-3 w-3" })
2076
2080
  ] })
2077
2081
  }
2078
2082
  )
@@ -2093,13 +2097,13 @@ function Er({
2093
2097
  onKeyDown: (d) => (d.key === "Enter" || d.key === " ") && $((N) => !N),
2094
2098
  className: "flex w-full cursor-pointer items-center gap-2.5 px-5 py-3.5 transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
2095
2099
  children: [
2096
- /* @__PURE__ */ n(ot, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
2100
+ /* @__PURE__ */ n(dt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
2097
2101
  /* @__PURE__ */ n("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: s || "Pipeline" }),
2098
2102
  /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
2099
2103
  x && /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400", children: "Addendum workflow" }),
2100
- we && /* @__PURE__ */ n(Re, { label: we.label, color: we.color }),
2101
- /* @__PURE__ */ n(Mr, { flags: a == null ? void 0 : a.flags }),
2102
- (((At = a == null ? void 0 : a.auto_held) == null ? void 0 : At.length) ?? 0) > 0 && /* @__PURE__ */ i(
2104
+ Ce && /* @__PURE__ */ n(Re, { label: Ce.label, color: Ce.color }),
2105
+ /* @__PURE__ */ n(Pr, { flags: a == null ? void 0 : a.flags }),
2106
+ (((Dt = a == null ? void 0 : a.auto_held) == null ? void 0 : Dt.length) ?? 0) > 0 && /* @__PURE__ */ i(
2103
2107
  "span",
2104
2108
  {
2105
2109
  className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400",
@@ -2116,22 +2120,22 @@ function Er({
2116
2120
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse shrink-0" }),
2117
2121
  "Addendum in review"
2118
2122
  ] }),
2119
- le.length > 0 && /* @__PURE__ */ i(
2123
+ de.length > 0 && /* @__PURE__ */ i(
2120
2124
  "span",
2121
2125
  {
2122
2126
  className: "flex items-center gap-1 rounded-full border border-sky-200 bg-sky-50 px-2 py-0.5 text-[11px] font-medium text-sky-700 dark:border-sky-500/20 dark:bg-sky-500/10 dark:text-sky-300",
2123
2127
  "data-pipeline-approving": !0,
2124
2128
  children: [
2125
2129
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
2126
- Zn(le, "approving")
2130
+ tr(de, "approving")
2127
2131
  ]
2128
2132
  }
2129
2133
  )
2130
2134
  ] }),
2131
2135
  /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", onClick: (d) => d.stopPropagation(), children: [
2132
- !g && at && !c && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: Mt(De, !0) }),
2133
- !g && !M && (a == null ? void 0 : a.binding) && /* @__PURE__ */ i(
2134
- ue,
2136
+ !g && it && !c && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: Pt(De, !0) }),
2137
+ !g && !q && (a == null ? void 0 : a.binding) && /* @__PURE__ */ i(
2138
+ pe,
2135
2139
  {
2136
2140
  size: "sm",
2137
2141
  variant: "outline",
@@ -2141,18 +2145,18 @@ function Er({
2141
2145
  },
2142
2146
  disabled: w.isPending,
2143
2147
  children: [
2144
- w.isPending ? /* @__PURE__ */ n(ve, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(ot, { className: "h-3 w-3" }),
2148
+ w.isPending ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(dt, { className: "h-3 w-3" }),
2145
2149
  "Start"
2146
2150
  ]
2147
2151
  }
2148
2152
  ),
2149
2153
  o && ((a == null ? void 0 : a.binding) || (a == null ? void 0 : a.instance)) && /* @__PURE__ */ n(
2150
- Lr,
2154
+ Ir,
2151
2155
  {
2152
2156
  collection: t,
2153
2157
  item: e,
2154
2158
  states: L ?? [],
2155
- currentStateId: ((Ot = a == null ? void 0 : a.instance) == null ? void 0 : Ot.current_state) ?? null
2159
+ currentStateId: ((Ut = a == null ? void 0 : a.instance) == null ? void 0 : Ut.current_state) ?? null
2156
2160
  }
2157
2161
  )
2158
2162
  ] }),
@@ -2168,19 +2172,19 @@ function Er({
2168
2172
  ]
2169
2173
  }
2170
2174
  ),
2171
- !In && Rt(!1),
2172
- !g && E && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ft }),
2173
- !g && st && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: st }),
2174
- Pt && !(M != null && M.completed_at) && /* @__PURE__ */ n(Fr, { entry: Pt }),
2175
+ !Qn && Ft(!1),
2176
+ !g && E && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ot }),
2177
+ !g && ot && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: ot }),
2178
+ At && !(q != null && q.completed_at) && /* @__PURE__ */ n(Or, { entry: At }),
2175
2179
  g && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
2176
- /* @__PURE__ */ n(Nr, { held: (a == null ? void 0 : a.auto_held) ?? [] }),
2180
+ /* @__PURE__ */ n(Sr, { held: (a == null ? void 0 : a.auto_held) ?? [] }),
2177
2181
  p && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-amber-100 bg-amber-50 px-5 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/10", children: [
2178
2182
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
2179
2183
  /* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
2180
2184
  ] }),
2181
- M ? /* @__PURE__ */ i("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
2185
+ q ? /* @__PURE__ */ i("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
2182
2186
  (L ?? []).length > 1 && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2183
- fe ? (
2187
+ he ? (
2184
2188
  // Path pruning arrives with the owners query — rendering
2185
2189
  // the UNPRUNED track first meant every state briefly
2186
2190
  // showed, then snapped into formation. Hold a same-height
@@ -2193,35 +2197,35 @@ function Er({
2193
2197
  /* @__PURE__ */ n(Me, { className: "ml-2 h-3 w-24" })
2194
2198
  ] })
2195
2199
  ) : /* @__PURE__ */ n(
2196
- Or,
2200
+ Ur,
2197
2201
  {
2198
2202
  states: L,
2199
2203
  allTransitions: (a == null ? void 0 : a.all_transitions) ?? [],
2200
- availableTransitions: H ?? [],
2201
- currentStateId: M.current_state,
2204
+ availableTransitions: G ?? [],
2205
+ currentStateId: q.current_state,
2202
2206
  history: S ?? [],
2203
2207
  onPathIds: l,
2204
2208
  skippedStates: y
2205
2209
  }
2206
2210
  ),
2207
- (a == null ? void 0 : a.branches) && /* @__PURE__ */ n(fr, { data: a.branches }),
2211
+ (a == null ? void 0 : a.branches) && /* @__PURE__ */ n(br, { data: a.branches }),
2208
2212
  /* @__PURE__ */ n(
2209
- Ar,
2213
+ Dr,
2210
2214
  {
2211
2215
  history: S ?? [],
2212
- completedAt: M.completed_at
2216
+ completedAt: q.completed_at
2213
2217
  }
2214
2218
  )
2215
2219
  ] }),
2216
2220
  /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2217
- !M.completed_at && /* @__PURE__ */ n(yr, { collection: t, itemId: String(e) }),
2221
+ !q.completed_at && /* @__PURE__ */ n(kr, { collection: t, itemId: String(e) }),
2218
2222
  /* @__PURE__ */ n(
2219
- Br,
2223
+ Er,
2220
2224
  {
2221
2225
  collection: t,
2222
2226
  item: e,
2223
2227
  states: L ?? [],
2224
- currentStateId: ((Dt = a == null ? void 0 : a.instance) == null ? void 0 : Dt.current_state) ?? null,
2228
+ currentStateId: ((Bt = a == null ? void 0 : a.instance) == null ? void 0 : Bt.current_state) ?? null,
2225
2229
  returned: ((a == null ? void 0 : a.history) ?? []).some(
2226
2230
  (d) => {
2227
2231
  var N;
@@ -2231,11 +2235,11 @@ function Er({
2231
2235
  }
2232
2236
  )
2233
2237
  ] }),
2234
- at && !m && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2235
- Rt(!0),
2236
- /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children: Mt(De) }),
2237
- E && Ft,
2238
- st
2238
+ it && !m && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2239
+ Ft(!0),
2240
+ /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children: Pt(De) }),
2241
+ E && Ot,
2242
+ ot
2239
2243
  ] }),
2240
2244
  /* @__PURE__ */ i("div", { className: "px-5 py-3", children: [
2241
2245
  /* @__PURE__ */ i(
@@ -2264,18 +2268,18 @@ function Er({
2264
2268
  ]
2265
2269
  }
2266
2270
  ),
2267
- f && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(Dr, { history: S ?? [] }) })
2271
+ f && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(Br, { history: S ?? [] }) })
2268
2272
  ] }),
2269
2273
  U && (L ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", ref: re, children: /* @__PURE__ */ n(
2270
- vr,
2274
+ wr,
2271
2275
  {
2272
2276
  collection: t,
2273
2277
  item: e,
2274
2278
  states: L ?? [],
2275
- currentStateId: M.current_state ?? null,
2279
+ currentStateId: q.current_state ?? null,
2276
2280
  openSignal: j,
2277
2281
  onMoved: () => {
2278
- _.invalidateQueries({ queryKey: G }), _.invalidateQueries({
2282
+ _.invalidateQueries({ queryKey: H }), _.invalidateQueries({
2279
2283
  queryKey: ["pipeline-instance", t, e]
2280
2284
  });
2281
2285
  }
@@ -2284,7 +2288,7 @@ function Er({
2284
2288
  ] }) : /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
2285
2289
  /* @__PURE__ */ n("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
2286
2290
  /* @__PURE__ */ i(
2287
- ue,
2291
+ pe,
2288
2292
  {
2289
2293
  size: "sm",
2290
2294
  variant: "outline",
@@ -2292,7 +2296,7 @@ function Er({
2292
2296
  onClick: () => w.mutate(),
2293
2297
  disabled: w.isPending,
2294
2298
  children: [
2295
- w.isPending ? /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(ot, { className: "h-3.5 w-3.5" }),
2299
+ w.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(dt, { className: "h-3.5 w-3.5" }),
2296
2300
  "Start Pipeline"
2297
2301
  ]
2298
2302
  }
@@ -2303,7 +2307,7 @@ function Er({
2303
2307
  }
2304
2308
  ),
2305
2309
  T && /* @__PURE__ */ n(en, { fallback: null, children: /* @__PURE__ */ n(
2306
- gn,
2310
+ vn,
2307
2311
  {
2308
2312
  payload: T.payload,
2309
2313
  transitionId: T.transitionId,
@@ -2325,14 +2329,14 @@ function Er({
2325
2329
  ) })
2326
2330
  ] });
2327
2331
  }
2328
- function _a({
2332
+ function Ca({
2329
2333
  collection: t,
2330
2334
  item: e,
2331
2335
  onBeforeTransition: r,
2332
2336
  wrap: s = !0
2333
2337
  }) {
2334
2338
  return e === "new" ? null : /* @__PURE__ */ n(
2335
- Ir,
2339
+ Qr,
2336
2340
  {
2337
2341
  collection: t,
2338
2342
  item: e,
@@ -2341,15 +2345,15 @@ function _a({
2341
2345
  }
2342
2346
  );
2343
2347
  }
2344
- function Ir({
2348
+ function Qr({
2345
2349
  collection: t,
2346
2350
  item: e,
2347
2351
  onBeforeTransition: r,
2348
2352
  wrap: s = !0
2349
2353
  }) {
2350
- const o = Pe(), c = ze(), [m, h] = Q(""), [p, x] = Q(null), [k, R] = Q(null), [_, U] = Q(null), [j, ne] = Q(null), [re, ae] = Q([]), F = Cn(t, String(e));
2351
- an(t, e, "transition", !!p || !!k);
2352
- const E = de(null), K = ir(E, !s), f = de(!1), v = (l) => {
2354
+ const o = Pe(), c = Ve(), [m, h] = Q(""), [p, x] = Q(null), [k, R] = Q(null), [_, U] = Q(null), [j, ne] = Q(null), [re, ae] = Q([]), F = Tn(t, String(e));
2355
+ on(t, e, "transition", !!p || !!k);
2356
+ const E = ce(null), K = lr(E, !s), f = ce(!1), v = (l) => {
2353
2357
  f.current || (f.current = !0, U(null), W.mutate(l, {
2354
2358
  onSettled: (y, w) => {
2355
2359
  if (w) {
@@ -2362,38 +2366,38 @@ function Ir({
2362
2366
  }
2363
2367
  }));
2364
2368
  }, g = async (l, y) => {
2365
- var ie, M;
2369
+ var oe, q;
2366
2370
  if (f.current || u != null && u.running_move) return;
2367
2371
  if (p === l) {
2368
2372
  x(null);
2369
2373
  return;
2370
2374
  }
2371
- if (!(y != null && y.cleared) && ((u == null ? void 0 : u.available_transitions) ?? []).some((H) => H.id === l && H.advisory)) {
2375
+ if (!(y != null && y.cleared) && ((u == null ? void 0 : u.available_transitions) ?? []).some((G) => G.id === l && G.advisory)) {
2372
2376
  x(null), U(null), ne(l), c.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
2373
2377
  return;
2374
2378
  }
2375
2379
  if (ne(null), r) {
2376
2380
  f.current = !0;
2377
- let H = !1;
2381
+ let G = !1;
2378
2382
  try {
2379
- H = await r();
2383
+ G = await r();
2380
2384
  } finally {
2381
2385
  f.current = !1;
2382
2386
  }
2383
- if (!H) return;
2387
+ if (!G) return;
2384
2388
  }
2385
- const w = (le ?? []).find((H) => H.id === l), P = String((w == null ? void 0 : w.comment_mode) ?? "none"), B = $t(w, (u == null ? void 0 : u.states) ?? [], (ie = u == null ? void 0 : u.instance) == null ? void 0 : ie.current_state);
2389
+ const w = (de ?? []).find((G) => G.id === l), P = String((w == null ? void 0 : w.comment_mode) ?? "none"), B = qt(w, (u == null ? void 0 : u.states) ?? [], (oe = u == null ? void 0 : u.instance) == null ? void 0 : oe.current_state);
2386
2390
  if (P !== "optional" && P !== "required") {
2387
- if (w && !He(w, (u == null ? void 0 : u.states) ?? [], (M = u == null ? void 0 : u.instance) == null ? void 0 : M.current_state)) {
2391
+ if (w && !Xe(w, (u == null ? void 0 : u.states) ?? [], (q = u == null ? void 0 : u.instance) == null ? void 0 : q.current_state)) {
2388
2392
  f.current = !0;
2389
- let H = [];
2393
+ let G = [];
2390
2394
  try {
2391
- H = await F();
2395
+ G = await F();
2392
2396
  } finally {
2393
2397
  f.current = !1;
2394
2398
  }
2395
- if (H.length > 0 || B) {
2396
- ae(H), x(l);
2399
+ if (G.length > 0 || B) {
2400
+ ae(G), x(l);
2397
2401
  return;
2398
2402
  }
2399
2403
  }
@@ -2405,10 +2409,10 @@ function Ir({
2405
2409
  return;
2406
2410
  }
2407
2411
  ae([]), x(l);
2408
- }, $ = ["pipeline-instance", t, e], { settling: T, settle: X } = kn($), { data: u } = be({
2412
+ }, $ = ["pipeline-instance", t, e], { settling: T, settle: X } = _n($), { data: u } = be({
2409
2413
  queryKey: $,
2410
2414
  queryFn: () => o.request(
2411
- ye(`/pipelines/instance/${t}/${e}`)
2415
+ we(`/pipelines/instance/${t}/${e}`)
2412
2416
  ).then(
2413
2417
  (l) => l.data ?? {
2414
2418
  instance: null,
@@ -2420,47 +2424,47 @@ function Ir({
2420
2424
  }
2421
2425
  ),
2422
2426
  staleTime: 1e4,
2423
- refetchInterval: (l) => un(l.state.data)
2427
+ refetchInterval: (l) => mn(l.state.data)
2424
2428
  });
2425
- mn(!!(u != null && u.running_move), () => {
2426
- Ee(c, t, String(e)), Ie(c, t, String(e)), et(c, t, String(e));
2429
+ pn(!!(u != null && u.running_move), () => {
2430
+ Ie(c, t, String(e)), je(c, t, String(e)), nt(c, t, String(e));
2427
2431
  });
2428
- const b = Nn(
2432
+ const b = Sn(
2429
2433
  u ? (u.available_transitions ?? []).map((l) => String(l.id)) : null,
2430
2434
  `${t}:${e}`
2431
- ), { data: q } = be({
2435
+ ), { data: M } = be({
2432
2436
  queryKey: ["pipeline-all-owners", t, e],
2433
2437
  queryFn: () => o.request(
2434
- ye(`/pipelines/instance/${t}/${e}/owners/all`)
2438
+ we(`/pipelines/instance/${t}/${e}/owners/all`)
2435
2439
  ).then((l) => l.data ?? null),
2436
2440
  // Also while a move is being confirmed: the panel names where it really lands.
2437
- enabled: qn(u) || !!p,
2441
+ enabled: Rn(u) || !!p,
2438
2442
  staleTime: 3e4
2439
- }), ee = Je(() => {
2440
- if (!q) return null;
2443
+ }), ee = et(() => {
2444
+ if (!M) return null;
2441
2445
  const l = /* @__PURE__ */ new Map();
2442
- for (const [y, w] of Object.entries(q))
2446
+ for (const [y, w] of Object.entries(M))
2443
2447
  w.skipped && l.set(y, w.skip_reasons ?? []);
2444
2448
  return l;
2445
- }, [q]), W = je({
2449
+ }, [M]), W = Qe({
2446
2450
  mutationFn: ({
2447
2451
  transition_id: l,
2448
2452
  comment: y,
2449
2453
  reviewed: w,
2450
2454
  lock_ack: P
2451
2455
  }) => o.request(
2452
- We(`/pipelines/instance/${t}/${e}/transition`, {
2456
+ Ge(`/pipelines/instance/${t}/${e}/transition`, {
2453
2457
  transition_id: l,
2454
2458
  comment: y,
2455
2459
  ...w ? { reviewed: !0 } : {},
2456
2460
  ...P ? { lock_ack: !0 } : {},
2457
- ...fn(u == null ? void 0 : u.available_transitions, l)
2461
+ ...hn(u == null ? void 0 : u.available_transitions, l)
2458
2462
  })
2459
2463
  ),
2460
2464
  onMutate: (l) => {
2461
2465
  var y;
2462
2466
  return {
2463
- slow: Pn(
2467
+ slow: An(
2464
2468
  (y = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
2465
2469
  (w) => w.id === l.transition_id
2466
2470
  )) == null ? void 0 : y.label
@@ -2468,29 +2472,29 @@ function Ir({
2468
2472
  };
2469
2473
  },
2470
2474
  onSuccess: (l, y, w) => {
2471
- c.invalidateQueries({ queryKey: $ }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Ee(c, t, String(e)), Ie(c, t, String(e)), et(c, t, String(e)), U(null), h(""), x(null), R(null);
2472
- const P = pn(l);
2475
+ c.invalidateQueries({ queryKey: $ }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Ie(c, t, String(e)), je(c, t, String(e)), nt(c, t, String(e)), U(null), h(""), x(null), R(null);
2476
+ const P = fn(l);
2473
2477
  P ? V.info(
2474
2478
  `${P.transition_label ?? "The move"} started. You will be told if it does not go through.`,
2475
2479
  w == null ? void 0 : w.slow.done()
2476
- ) : V.success(Rn(u, y.transition_id, l), w == null ? void 0 : w.slow.done());
2480
+ ) : V.success(Fn(u, y.transition_id, l), w == null ? void 0 : w.slow.done());
2477
2481
  },
2478
2482
  onError: (l, y, w) => {
2479
- var H, S;
2480
- if (w == null || w.slow.fail(), xn(l)) {
2483
+ var G, S;
2484
+ if (w == null || w.slow.fail(), yn(l)) {
2481
2485
  c.invalidateQueries({ queryKey: $ });
2482
2486
  return;
2483
2487
  }
2484
- if (nt(l) === "TRANSITION_RUNNING") {
2488
+ if (at(l) === "TRANSITION_RUNNING") {
2485
2489
  c.invalidateQueries({ queryKey: $ }), x(null), R(null), V.info(Ae(l, "This move is already running on this record."));
2486
2490
  return;
2487
2491
  }
2488
- const P = yn(l);
2492
+ const P = kn(l);
2489
2493
  if (P) {
2490
2494
  x(null);
2491
- const L = ((H = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
2492
- (Ce) => Ce.id === y.transition_id
2493
- )) == null ? void 0 : H.label) ?? "Move";
2495
+ const L = ((G = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
2496
+ (ve) => ve.id === y.transition_id
2497
+ )) == null ? void 0 : G.label) ?? "Move";
2494
2498
  V.warning(P.message, {
2495
2499
  id: `nvr-locked-move:${t}:${String(e)}`,
2496
2500
  duration: 2e4,
@@ -2503,7 +2507,7 @@ function Ir({
2503
2507
  });
2504
2508
  return;
2505
2509
  }
2506
- const B = vn(l);
2510
+ const B = wn(l);
2507
2511
  if (B) {
2508
2512
  R((L) => ({
2509
2513
  payload: B,
@@ -2513,49 +2517,53 @@ function Ir({
2513
2517
  }));
2514
2518
  return;
2515
2519
  }
2516
- const ie = l == null ? void 0 : l.response;
2517
- U(wn(l, y));
2518
- const M = sn(
2520
+ const oe = l == null ? void 0 : l.response;
2521
+ U(Nn(l, y));
2522
+ const q = an(
2519
2523
  l,
2520
2524
  (S = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
2521
2525
  (L) => L.id === y.transition_id
2522
2526
  )) == null ? void 0 : S.label
2523
2527
  );
2524
- V.error((M == null ? void 0 : M.title) ?? Ae(l, "Failed to execute transition"), {
2528
+ V.error((q == null ? void 0 : q.title) ?? Ae(l, "Failed to execute transition"), {
2525
2529
  duration: 12e3,
2526
2530
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
2527
- ...rn(l, { action: "Transition" }),
2528
- ...M ? { description: M.description } : {},
2531
+ // A partner's refusal copies what the toast said and the other system's answer as
2532
+ // stored, never the generic reading of a 422.
2533
+ ...rn(q ? sn(l, q) : l, {
2534
+ action: "Transition"
2535
+ }),
2536
+ ...q ? { description: q.description } : {},
2529
2537
  // #1867: a refusal carries "Why?" — the role, owner or access rule
2530
2538
  // that stopped it, and who can change it.
2531
- ...dn(l) ? {
2532
- action: cn(o, {
2539
+ ...cn(l) ? {
2540
+ action: un(o, {
2533
2541
  collection: t,
2534
2542
  itemId: String(e),
2535
2543
  action: "transition",
2536
2544
  transitionId: y.transition_id
2537
2545
  })
2538
2546
  } : {}
2539
- }), R(null), x(null), Ee(c, t, String(e)), Ie(c, t, String(e)), (ie == null ? void 0 : ie.status) === 409 && c.invalidateQueries({ queryKey: $ });
2547
+ }), R(null), x(null), Ie(c, t, String(e)), je(c, t, String(e)), (oe == null ? void 0 : oe.status) === 409 && c.invalidateQueries({ queryKey: $ });
2540
2548
  }
2541
- }), ce = de(g);
2542
- ce.current = g;
2543
- const xe = de((u == null ? void 0 : u.available_transitions) ?? []);
2549
+ }), ue = ce(g);
2550
+ ue.current = g;
2551
+ const xe = ce((u == null ? void 0 : u.available_transitions) ?? []);
2544
2552
  if (xe.current = (u == null ? void 0 : u.available_transitions) ?? [], _e(() => {
2545
2553
  const l = (y) => {
2546
2554
  const w = y.detail;
2547
2555
  if (!w || w.claimed || w.collection !== t || String(w.item) !== String(e)) return;
2548
2556
  w.claimed = !0;
2549
- const P = String(w.transition_id).toUpperCase(), B = xe.current.find((ie) => String(ie.id).toUpperCase() === P);
2557
+ const P = String(w.transition_id).toUpperCase(), B = xe.current.find((oe) => String(oe.id).toUpperCase() === P);
2550
2558
  if (!B) {
2551
2559
  V.error("That step is not available from where the record is now");
2552
2560
  return;
2553
2561
  }
2554
- ce.current(B.id);
2562
+ ue.current(B.id);
2555
2563
  };
2556
- return window.addEventListener(Ze, l), () => window.removeEventListener(Ze, l);
2564
+ return window.addEventListener(tt, l), () => window.removeEventListener(tt, l);
2557
2565
  }, [t, e]), !(u != null && u.binding) || !(u != null && u.instance)) return null;
2558
- const le = Mn(
2566
+ const de = Pn(
2559
2567
  (u.available_transitions ?? []).filter(
2560
2568
  (l) => !u.instance.completed_at || l.from_state && String(l.from_state).toUpperCase() === String(u.instance.current_state).toUpperCase()
2561
2569
  ),
@@ -2563,18 +2571,18 @@ function Ir({
2563
2571
  u.instance.current_state,
2564
2572
  u.instance.completed_at ? null : ee
2565
2573
  );
2566
- if (le.length === 0) return null;
2567
- const O = new Map((u.states ?? []).map((l) => [l.id, l])), Y = u.instance.current_state_obj ?? null, z = p ? le.find((l) => l.id === p) : null, se = j ? le.find((l) => l.id === j) : null, G = u.running_move ?? null, qe = G ? ur(G) : void 0, Oe = z ? O.get(z.to_state) : null, a = Dn(z, Y, u.states ?? [], q), I = (a == null ? void 0 : a.state) ?? Oe, Z = /* @__PURE__ */ new Map();
2568
- for (const l of le) {
2574
+ if (de.length === 0) return null;
2575
+ const D = new Map((u.states ?? []).map((l) => [l.id, l])), Y = u.instance.current_state_obj ?? null, z = p ? de.find((l) => l.id === p) : null, ie = j ? de.find((l) => l.id === j) : null, H = u.running_move ?? null, qe = H ? pr(H) : void 0, Oe = z ? D.get(z.to_state) : null, a = Bn(z, Y, u.states ?? [], M), I = (a == null ? void 0 : a.state) ?? Oe, Z = /* @__PURE__ */ new Map();
2576
+ for (const l of de) {
2569
2577
  const y = Z.get(l.label) ?? [];
2570
2578
  y.push(l), Z.set(l.label, y);
2571
2579
  }
2572
2580
  const J = (l) => [...l].sort(
2573
2581
  (y, w) => {
2574
2582
  var P, B;
2575
- return (((P = O.get(y.to_state)) == null ? void 0 : P.sort) ?? 999) - (((B = O.get(w.to_state)) == null ? void 0 : B.sort) ?? 999);
2583
+ return (((P = D.get(y.to_state)) == null ? void 0 : P.sort) ?? 999) - (((B = D.get(w.to_state)) == null ? void 0 : B.sort) ?? 999);
2576
2584
  }
2577
- ), fe = (() => {
2585
+ ), he = (() => {
2578
2586
  var w, P, B;
2579
2587
  const l = (w = E.current) == null ? void 0 : w.getBoundingClientRect();
2580
2588
  if (!l) return 600;
@@ -2582,31 +2590,31 @@ function Ir({
2582
2590
  return Math.max(260, Math.min(600, l.right - ((y == null ? void 0 : y.left) ?? 0) - 12));
2583
2591
  })();
2584
2592
  return /* @__PURE__ */ i("div", { ref: E, className: "relative", "data-tip": qe, children: [
2585
- K ? /* @__PURE__ */ i(ct, { children: [
2586
- /* @__PURE__ */ n(ut, { asChild: !0, children: /* @__PURE__ */ i(
2587
- ue,
2593
+ K ? /* @__PURE__ */ i(mt, { children: [
2594
+ /* @__PURE__ */ n(pt, { asChild: !0, children: /* @__PURE__ */ i(
2595
+ pe,
2588
2596
  {
2589
2597
  size: "sm",
2590
2598
  variant: "outline",
2591
2599
  className: "shrink-0 gap-1.5 text-[12px]",
2592
- disabled: W.isPending || T || !!G,
2600
+ disabled: W.isPending || T || !!H,
2593
2601
  "data-transitions-folded": !0,
2594
2602
  children: [
2595
- W.isPending || G ? /* @__PURE__ */ n(ve, { className: "h-3 w-3 animate-spin" }) : le.every((l) => l.advisory) && /* @__PURE__ */ n(Ne, {}),
2603
+ W.isPending || H ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : de.every((l) => l.advisory) && /* @__PURE__ */ n(Ne, {}),
2596
2604
  "Actions",
2597
2605
  /* @__PURE__ */ n(Fe, { className: "h-3 w-3" })
2598
2606
  ]
2599
2607
  }
2600
2608
  ) }),
2601
- /* @__PURE__ */ i(mt, { align: "end", className: "min-w-[200px]", children: [
2609
+ /* @__PURE__ */ i(ft, { align: "end", className: "min-w-[200px]", children: [
2602
2610
  Array.from(Z.entries()).map(
2603
2611
  ([l, y], w, P) => y.length === 1 ? /* @__PURE__ */ i(It, { children: [
2604
- w > 0 && P[w - 1][1].length > 1 && /* @__PURE__ */ n(pt, {}),
2612
+ w > 0 && P[w - 1][1].length > 1 && /* @__PURE__ */ n(ht, {}),
2605
2613
  /* @__PURE__ */ i(
2606
- Xe,
2614
+ Je,
2607
2615
  {
2608
2616
  onSelect: () => g(y[0].id),
2609
- ...Be(y[0], "menu"),
2617
+ ...Le(y[0], "menu"),
2610
2618
  children: [
2611
2619
  y[0].color && /* @__PURE__ */ n(
2612
2620
  "span",
@@ -2621,15 +2629,15 @@ function Ir({
2621
2629
  }
2622
2630
  )
2623
2631
  ] }, l) : /* @__PURE__ */ i(It, { children: [
2624
- w > 0 && /* @__PURE__ */ n(pt, {}),
2625
- /* @__PURE__ */ n(dr, { className: "text-[11px] text-muted-foreground", children: l }),
2632
+ w > 0 && /* @__PURE__ */ n(ht, {}),
2633
+ /* @__PURE__ */ n(ur, { className: "text-[11px] text-muted-foreground", children: l }),
2626
2634
  J(y).map((B) => {
2627
- var ie;
2635
+ var oe;
2628
2636
  return /* @__PURE__ */ i(
2629
- Xe,
2637
+ Je,
2630
2638
  {
2631
2639
  onSelect: () => g(B.id),
2632
- ...Be(B, "menu"),
2640
+ ...Le(B, "menu"),
2633
2641
  children: [
2634
2642
  B.color && /* @__PURE__ */ n(
2635
2643
  "span",
@@ -2638,7 +2646,7 @@ function Ir({
2638
2646
  style: { backgroundColor: B.color }
2639
2647
  }
2640
2648
  ),
2641
- ((ie = O.get(B.to_state)) == null ? void 0 : ie.label) ?? B.to_state,
2649
+ ((oe = D.get(B.to_state)) == null ? void 0 : oe.label) ?? B.to_state,
2642
2650
  B.advisory && /* @__PURE__ */ n(Ne, { className: "ml-auto" })
2643
2651
  ]
2644
2652
  },
@@ -2648,12 +2656,12 @@ function Ir({
2648
2656
  ] }, l)
2649
2657
  ),
2650
2658
  /* @__PURE__ */ n(
2651
- yt,
2659
+ kt,
2652
2660
  {
2653
- moves: le,
2661
+ moves: de,
2654
2662
  nameOf: (l) => {
2655
2663
  var y, w;
2656
- return (((y = Z.get(l.label)) == null ? void 0 : y.length) ?? 0) > 1 ? ((w = O.get(l.to_state)) == null ? void 0 : w.label) ?? l.to_state : l.label;
2664
+ return (((y = Z.get(l.label)) == null ? void 0 : y.length) ?? 0) > 1 ? ((w = D.get(l.to_state)) == null ? void 0 : w.label) ?? l.to_state : l.label;
2657
2665
  }
2658
2666
  }
2659
2667
  )
@@ -2663,42 +2671,42 @@ function Ir({
2663
2671
  {
2664
2672
  className: s ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
2665
2673
  children: Array.from(Z.entries()).map(([l, y]) => {
2666
- var M, H;
2674
+ var q, G;
2667
2675
  const w = y.some((S) => {
2668
2676
  var L;
2669
2677
  return (((L = S.order_partners) == null ? void 0 : L.length) ?? 0) > 0;
2670
- }), P = w ? null : ((M = y[0]) == null ? void 0 : M.color) ?? null, B = y.some((S) => S.id === p), ie = (S) => P ? S ? { backgroundColor: P, borderColor: P } : { borderColor: P, color: P } : void 0;
2678
+ }), P = w ? null : ((q = y[0]) == null ? void 0 : q.color) ?? null, B = y.some((S) => S.id === p), oe = (S) => P ? S ? { backgroundColor: P, borderColor: P } : { borderColor: P, color: P } : void 0;
2671
2679
  if (y.length === 1) {
2672
- const S = y[0], L = gt(G == null ? void 0 : G.transition_id, S.id), Ce = W.isPending && ((H = W.variables) == null ? void 0 : H.transition_id) === S.id || L, we = /* @__PURE__ */ i(
2673
- ue,
2680
+ const S = y[0], L = vt(H == null ? void 0 : H.transition_id, S.id), ve = bn(H ? null : u.last_move_problem, S.id), Ce = W.isPending && ((G = W.variables) == null ? void 0 : G.transition_id) === S.id || L, se = /* @__PURE__ */ i(
2681
+ pe,
2674
2682
  {
2675
2683
  size: "sm",
2676
2684
  variant: B && !S.advisory ? "default" : "outline",
2677
2685
  className: ge(
2678
2686
  "gap-1.5 text-[12px] data-[fresh=true]:opacity-60",
2679
- S.advisory && Fn
2687
+ S.advisory && On
2680
2688
  ),
2681
- style: S.advisory ? void 0 : ie(B),
2682
- disabled: W.isPending || T || !!G,
2689
+ style: S.advisory ? void 0 : oe(B),
2690
+ disabled: W.isPending || T || !!H || !!ve,
2683
2691
  "data-move-running": L || void 0,
2684
2692
  "aria-disabled": b.dimmed(S.id) || void 0,
2685
2693
  "data-fresh": b.dimmed(S.id) || void 0,
2686
2694
  ...b.bind(S.id),
2687
- ...Be(S),
2695
+ ...Le(S),
2688
2696
  onClick: () => {
2689
2697
  b.press(S.id) && g(S.id);
2690
2698
  },
2691
2699
  children: [
2692
- Ce ? /* @__PURE__ */ n(ve, { className: "h-3 w-3 animate-spin" }) : S.advisory ? /* @__PURE__ */ n(Ne, {}) : w && /* @__PURE__ */ n(Xt, { className: "h-3 w-3", "aria-hidden": !0 }),
2700
+ Ce ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : S.advisory ? /* @__PURE__ */ n(Ne, {}) : w && /* @__PURE__ */ n(Xt, { className: "h-3 w-3", "aria-hidden": !0 }),
2693
2701
  l
2694
2702
  ]
2695
2703
  },
2696
2704
  l
2697
2705
  );
2698
- return S.pushes && S.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2699
- we,
2706
+ return ve ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": ve, "data-move-held": !0, children: se }, l) : S.pushes && S.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2707
+ se,
2700
2708
  /* @__PURE__ */ n(
2701
- sr,
2709
+ or,
2702
2710
  {
2703
2711
  collection: t,
2704
2712
  itemId: e,
@@ -2707,17 +2715,17 @@ function Ir({
2707
2715
  compact: !0
2708
2716
  }
2709
2717
  )
2710
- ] }, l) : we;
2718
+ ] }, l) : se;
2711
2719
  }
2712
- return /* @__PURE__ */ i(ct, { children: [
2713
- /* @__PURE__ */ n(ut, { asChild: !0, children: /* @__PURE__ */ i(
2714
- ue,
2720
+ return /* @__PURE__ */ i(mt, { children: [
2721
+ /* @__PURE__ */ n(pt, { asChild: !0, children: /* @__PURE__ */ i(
2722
+ pe,
2715
2723
  {
2716
2724
  size: "sm",
2717
2725
  variant: B ? "default" : "outline",
2718
2726
  className: "gap-1.5 text-[12px]",
2719
- style: ie(B),
2720
- disabled: W.isPending || T || !!G,
2727
+ style: oe(B),
2728
+ disabled: W.isPending || T || !!H,
2721
2729
  children: [
2722
2730
  y.every((S) => S.advisory) && /* @__PURE__ */ n(Ne, {}),
2723
2731
  l,
@@ -2725,14 +2733,14 @@ function Ir({
2725
2733
  ]
2726
2734
  }
2727
2735
  ) }),
2728
- /* @__PURE__ */ i(mt, { align: "start", children: [
2736
+ /* @__PURE__ */ i(ft, { align: "start", children: [
2729
2737
  J(y).map((S) => {
2730
2738
  var L;
2731
2739
  return /* @__PURE__ */ i(
2732
- Xe,
2740
+ Je,
2733
2741
  {
2734
2742
  onSelect: () => g(S.id),
2735
- ...Be(S, "menu"),
2743
+ ...Le(S, "menu"),
2736
2744
  children: [
2737
2745
  S.color && /* @__PURE__ */ n(
2738
2746
  "span",
@@ -2741,7 +2749,7 @@ function Ir({
2741
2749
  style: { backgroundColor: S.color }
2742
2750
  }
2743
2751
  ),
2744
- ((L = O.get(S.to_state)) == null ? void 0 : L.label) ?? S.to_state,
2752
+ ((L = D.get(S.to_state)) == null ? void 0 : L.label) ?? S.to_state,
2745
2753
  S.advisory && /* @__PURE__ */ n(Ne, { className: "ml-auto" })
2746
2754
  ]
2747
2755
  },
@@ -2749,12 +2757,12 @@ function Ir({
2749
2757
  );
2750
2758
  }),
2751
2759
  /* @__PURE__ */ n(
2752
- yt,
2760
+ kt,
2753
2761
  {
2754
2762
  moves: y,
2755
2763
  nameOf: (S) => {
2756
2764
  var L;
2757
- return ((L = O.get(S.to_state)) == null ? void 0 : L.label) ?? S.to_state;
2765
+ return ((L = D.get(S.to_state)) == null ? void 0 : L.label) ?? S.to_state;
2758
2766
  }
2759
2767
  }
2760
2768
  )
@@ -2767,21 +2775,21 @@ function Ir({
2767
2775
  "div",
2768
2776
  {
2769
2777
  className: "absolute right-0 top-full z-50 mt-1 space-y-3 rounded-lg border border-slate-200 bg-white shadow-lg dark:bg-card dark:border-border p-3.5",
2770
- style: { width: fe },
2778
+ style: { width: he },
2771
2779
  children: [
2772
2780
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
2773
2781
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
2774
2782
  z && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: z.label }),
2775
2783
  Y && I && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
2776
2784
  /* @__PURE__ */ n(Re, { label: Y.label, color: Y.color, small: !0 }),
2777
- /* @__PURE__ */ n(wt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2785
+ /* @__PURE__ */ n(Nt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
2778
2786
  /* @__PURE__ */ n(Re, { label: I.label, color: I.color, small: !0 })
2779
2787
  ] })
2780
2788
  ] }),
2781
- /* @__PURE__ */ n(Un, { landing: a }),
2782
- /* @__PURE__ */ n(Tn, { collection: t, item: String(e), tx: z }),
2783
- /* @__PURE__ */ n(Bn, { collection: t, item: e, omitLines: re }),
2784
- /* @__PURE__ */ n($n, { lines: re }),
2789
+ /* @__PURE__ */ n(Ln, { landing: a }),
2790
+ /* @__PURE__ */ n(Mn, { collection: t, item: String(e), tx: z }),
2791
+ /* @__PURE__ */ n(En, { collection: t, item: e, omitLines: re }),
2792
+ /* @__PURE__ */ n(qn, { lines: re }),
2785
2793
  /* @__PURE__ */ n(
2786
2794
  "input",
2787
2795
  {
@@ -2794,7 +2802,7 @@ function Ir({
2794
2802
  ),
2795
2803
  /* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
2796
2804
  /* @__PURE__ */ n(
2797
- ue,
2805
+ pe,
2798
2806
  {
2799
2807
  type: "button",
2800
2808
  size: "sm",
@@ -2805,19 +2813,19 @@ function Ir({
2805
2813
  }
2806
2814
  ),
2807
2815
  /* @__PURE__ */ n(
2808
- ue,
2816
+ pe,
2809
2817
  {
2810
2818
  type: "button",
2811
2819
  size: "sm",
2812
2820
  className: "h-7 gap-1.5 text-[12px]",
2813
- disabled: W.isPending || !!G || String((z == null ? void 0 : z.comment_mode) ?? "") === "required" && m.trim() === "",
2821
+ disabled: W.isPending || !!H || String((z == null ? void 0 : z.comment_mode) ?? "") === "required" && m.trim() === "",
2814
2822
  onClick: () => v({
2815
2823
  transition_id: p,
2816
2824
  comment: m.trim() || void 0
2817
2825
  }),
2818
- children: W.isPending ? /* @__PURE__ */ n(ve, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(Se, { children: [
2826
+ children: W.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(Se, { children: [
2819
2827
  /* @__PURE__ */ n("span", { children: re.length > 0 && z ? `${z.label} anyway` : "Confirm" }),
2820
- /* @__PURE__ */ n(tt, { className: "h-3 w-3" })
2828
+ /* @__PURE__ */ n(rt, { className: "h-3 w-3" })
2821
2829
  ] })
2822
2830
  }
2823
2831
  )
@@ -2825,20 +2833,20 @@ function Ir({
2825
2833
  ]
2826
2834
  }
2827
2835
  ),
2828
- (se == null ? void 0 : se.advisory) && !p && /* @__PURE__ */ n(
2829
- bn,
2836
+ (ie == null ? void 0 : ie.advisory) && !p && /* @__PURE__ */ n(
2837
+ xn,
2830
2838
  {
2831
2839
  floating: !0,
2832
2840
  collection: t,
2833
2841
  item: String(e),
2834
- advisory: se.advisory,
2842
+ advisory: ie.advisory,
2835
2843
  armedMove: {
2836
- id: se.id,
2837
- label: se.label,
2838
- confirms: An(se, u.states ?? [], u.instance.current_state)
2844
+ id: ie.id,
2845
+ label: ie.label,
2846
+ confirms: Dn(ie, u.states ?? [], u.instance.current_state)
2839
2847
  },
2840
2848
  className: "absolute right-0 top-full z-50 mt-1",
2841
- style: { width: fe },
2849
+ style: { width: he },
2842
2850
  onDismiss: () => ne(null),
2843
2851
  onFixed: (l) => {
2844
2852
  ne(null), c.invalidateQueries({ queryKey: $ }), l && g(l.id, { cleared: !0 });
@@ -2846,19 +2854,19 @@ function Ir({
2846
2854
  }
2847
2855
  ),
2848
2856
  _ && !p && /* @__PURE__ */ n(
2849
- On,
2857
+ Un,
2850
2858
  {
2851
2859
  collection: t,
2852
2860
  item: String(e),
2853
2861
  offer: _,
2854
2862
  className: "absolute right-0 top-full z-50 mt-1 shadow-lg",
2855
- style: { width: fe },
2863
+ style: { width: he },
2856
2864
  onDismiss: () => U(null),
2857
2865
  onFixed: () => v({ transition_id: _.transitionId, comment: _.comment })
2858
2866
  }
2859
2867
  ),
2860
2868
  k && /* @__PURE__ */ n(en, { fallback: null, children: /* @__PURE__ */ n(
2861
- gn,
2869
+ vn,
2862
2870
  {
2863
2871
  payload: k.payload,
2864
2872
  transitionId: k.transitionId,
@@ -2881,26 +2889,26 @@ function Ir({
2881
2889
  ] });
2882
2890
  }
2883
2891
  export {
2884
- Ue as FRESH_BUTTON_MS,
2892
+ Be as FRESH_BUTTON_MS,
2885
2893
  Kt as FRESH_HOVER_MAX_MS,
2886
- Sr as FreshButtonGuard,
2887
- Na as PipelinePanel,
2888
- _a as PipelineTransitionButtons,
2889
- gr as REFUSAL_FIX_ACTIONS,
2890
- Mr as RecordFlagChips,
2891
- Rr as SLOW_MOVE_MS,
2892
- $t as asksFirst,
2893
- $r as briefAgeText,
2894
- Tr as briefDiffPair,
2894
+ $r as FreshButtonGuard,
2895
+ Sa as PipelinePanel,
2896
+ Ca as PipelineTransitionButtons,
2897
+ vr as REFUSAL_FIX_ACTIONS,
2898
+ Pr as RecordFlagChips,
2899
+ Fr as SLOW_MOVE_MS,
2900
+ qt as asksFirst,
2901
+ qr as briefAgeText,
2902
+ Mr as briefDiffPair,
2895
2903
  Wt as briefLineKey,
2896
- Cr as briefWarnings,
2897
- xn as isDuplicateTransition,
2898
- Pr as latestSendBack,
2899
- yn as lockedMoveOffer,
2900
- nt as refusalCode,
2901
- wn as refusalFixFor,
2902
- Pn as slowMoveToast,
2903
- vn as transitionRequirementsFromError,
2904
- Rn as transitionToastText,
2905
- Mn as withoutSkippedSendBacks
2904
+ Tr as briefWarnings,
2905
+ yn as isDuplicateTransition,
2906
+ Ar as latestSendBack,
2907
+ kn as lockedMoveOffer,
2908
+ at as refusalCode,
2909
+ Nn as refusalFixFor,
2910
+ An as slowMoveToast,
2911
+ wn as transitionRequirementsFromError,
2912
+ Fn as transitionToastText,
2913
+ Pn as withoutSkippedSendBacks
2906
2914
  };