@nivaro/react 0.3.75 → 0.3.77

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.
@@ -3,34 +3,34 @@ var hn = (t, e, r) => e in t ? fn(t, e, { enumerable: !0, configurable: !0, writ
3
3
  var We = (t, e, r) => hn(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { jsx as n, jsxs as i, Fragment as be } from "react/jsx-runtime";
5
5
  import { useQueryClient as Re, useQuery as le, useMutation as qe } from "@tanstack/react-query";
6
- import { ArrowRight as rt, Loader2 as pe, Check as je, GitBranch as ze, AlertTriangle as bn, ChevronDown as _e, Send as qt, Users as Rt, Minus as gn, UserPlus as xn, X as Mt, Zap as Pt, Search as yn } from "lucide-react";
7
- import { useState as j, useRef as ae, useEffect as he, useMemo as Be, Suspense as Dt, useCallback as Ft, lazy as wn } from "react";
6
+ import { ArrowRight as rt, Loader2 as pe, Check as je, GitBranch as ze, AlertTriangle as bn, ChevronDown as _e, Send as qt, Users as Rt, Undo2 as gn, Minus as xn, UserPlus as yn, X as Mt, Zap as Pt, Search as wn } from "lucide-react";
7
+ import { useState as j, useRef as ae, useEffect as he, useMemo as Be, Suspense as Dt, useCallback as Ft, lazy as vn } from "react";
8
8
  import { toast as X } from "sonner";
9
- import { useNivaroClient as xe, useItemEditAuth as vn } from "../../context.js";
10
- import { get as ce, post as Se, del as kn } from "../../lib/commands.js";
11
- import { errorToastOptions as At, toastError as Nn } from "../../lib/error-toast.js";
12
- import { useRecordSignalWhile as Ot, useRecordSignalPeers as _n, signalSentence as Sn } from "../../lib/presence-signals.js";
9
+ import { useNivaroClient as xe, useItemEditAuth as kn } from "../../context.js";
10
+ import { get as ce, post as Se, del as Nn } from "../../lib/commands.js";
11
+ import { errorToastOptions as At, toastError as _n } from "../../lib/error-toast.js";
12
+ import { useRecordSignalWhile as Ot, useRecordSignalPeers as Sn, signalSentence as Cn } from "../../lib/presence-signals.js";
13
13
  import { RUN_TRANSITION_EVENT as Le } from "../../lib/run-transition.js";
14
14
  import { userErrorMessage as Me } from "../../lib/safe-error.js";
15
- import { serverNow as Cn } from "../../lib/server-clock.js";
16
- import { userCardQuery as $n } from "../../lib/user-cards.js";
17
- import { cn as ge, titleCase as Tn, toLocalDateString as qn, formatRelative as at, formatDateTime as yt, humanHours as Rn } from "../../lib/utils.js";
18
- import { PushReadinessChip as Mn } from "../integrations/RecordIntegrationPreview.js";
19
- import { useHeaderFold as Pn } from "../item-edit/HeaderTools.js";
15
+ import { serverNow as $n } from "../../lib/server-clock.js";
16
+ import { userCardQuery as Tn } from "../../lib/user-cards.js";
17
+ import { cn as ge, titleCase as qn, toLocalDateString as Rn, formatRelative as at, formatDateTime as yt, humanHours as Mn } from "../../lib/utils.js";
18
+ import { PushReadinessChip as Pn } from "../integrations/RecordIntegrationPreview.js";
19
+ import { useHeaderFold as Dn } from "../item-edit/HeaderTools.js";
20
20
  import { invalidateRecordInsights as Ee, invalidateRecordData as Pe } from "../item-edit/RecordInsights.js";
21
21
  import { UserChip as Ut } from "../item-edit/UserChip.js";
22
- import { OwnerAvatars as Dn } from "../queue/OwnerAvatars.js";
23
- import { UserAvatar as Fn } from "../UserAvatar.js";
22
+ import { OwnerAvatars as Fn } from "../queue/OwnerAvatars.js";
23
+ import { UserAvatar as An } from "../UserAvatar.js";
24
24
  import { Button as re } from "../ui/button.js";
25
- import { DropdownMenu as Ve, DropdownMenuTrigger as Xe, DropdownMenuContent as Ye, DropdownMenuGroup as wt, DropdownMenuSeparator as vt, DropdownMenuItem as Oe, DropdownMenuLabel as An } from "../ui/dropdown-menu.js";
25
+ import { DropdownMenu as Ve, DropdownMenuTrigger as Xe, DropdownMenuContent as Ye, DropdownMenuGroup as wt, DropdownMenuSeparator as vt, DropdownMenuItem as Oe, DropdownMenuLabel as On } from "../ui/dropdown-menu.js";
26
26
  import { Popover as st, PopoverTrigger as it, PopoverContent as lt } from "../ui/popover.js";
27
27
  import { Skeleton as we } from "../ui/skeleton.js";
28
28
  import { TooltipProvider as Bt, Tooltip as Je, TooltipTrigger as Ze, TooltipContent as et } from "../ui/tooltip.js";
29
- import { isAccessRefusal as Lt, deniedToastAction as Et, WhyOwnersButton as On } from "./AccessInsights.js";
30
- import { BranchLanes as Un } from "./BranchLanes.js";
31
- import { landingState as Bn, landingSkipGroups as Ln, joinLabels as kt } from "./landing-state.js";
32
- import { SlaClockLine as En } from "./SlaClock.js";
33
- const jt = wn(
29
+ import { isAccessRefusal as Lt, deniedToastAction as Et, WhyOwnersButton as Un } from "./AccessInsights.js";
30
+ import { BranchLanes as Bn } from "./BranchLanes.js";
31
+ import { landingState as Ln, landingSkipGroups as En, joinLabels as kt } from "./landing-state.js";
32
+ import { SlaClockLine as jn } from "./SlaClock.js";
33
+ const jt = vn(
34
34
  () => import("./TransitionRequirementsDialog.js").then((t) => ({
35
35
  default: t.TransitionRequirementsDialog
36
36
  }))
@@ -39,7 +39,7 @@ function ot(t, e) {
39
39
  const r = t || "System";
40
40
  return e.on_behalf_of_name ? `${r}, for ${e.on_behalf_of_name}` : r;
41
41
  }
42
- function jn(t) {
42
+ function In(t) {
43
43
  if (t.transition) return null;
44
44
  const e = (t.comment ?? "").trim();
45
45
  if (!e.startsWith("{")) return null;
@@ -74,11 +74,11 @@ const Nt = {
74
74
  rate_limited: "the partner asked us to slow down",
75
75
  unknown: "the partner refused it"
76
76
  };
77
- function In(t) {
78
- const e = Math.ceil((new Date(t).getTime() - Cn()) / 6e4);
77
+ function Kn(t) {
78
+ const e = Math.ceil((new Date(t).getTime() - $n()) / 6e4);
79
79
  return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
80
80
  }
81
- function Kn({ held: t }) {
81
+ function Qn({ held: t }) {
82
82
  return t.length === 0 ? null : /* @__PURE__ */ n(
83
83
  "div",
84
84
  {
@@ -103,7 +103,7 @@ function Kn({ held: t }) {
103
103
  }
104
104
  ),
105
105
  /* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
106
- e.retry_at ? `It tries the same push again ${In(e.retry_at)}. ` : "It will not send the same push again on its own. ",
106
+ e.retry_at ? `It tries the same push again ${Kn(e.retry_at)}. ` : "It will not send the same push again on its own. ",
107
107
  "Fix the record so what it sends changes, retry the push, or move the record by hand.",
108
108
  e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
109
109
  ] })
@@ -134,17 +134,17 @@ function Wt(t) {
134
134
  const a = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
135
135
  return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${a ?? "Someone else"} is editing this record right now.`, holder: a };
136
136
  }
137
- const Qn = {
137
+ const Wn = {
138
138
  PRIORITY_REQUIRED: "priority",
139
139
  // A held record does not move forward (efp-ops hold-gate, army 11): taking
140
140
  // the hold off is one deliberate, noted step, then the move is tried again.
141
141
  ON_HOLD: "remove-hold"
142
142
  };
143
143
  function zt(t, e) {
144
- const r = Qt(t), a = r ? Qn[r] : void 0;
144
+ const r = Qt(t), a = r ? Wn[r] : void 0;
145
145
  return !r || !a ? null : { code: r, actionKey: a, transitionId: e.transition_id, comment: e.comment };
146
146
  }
147
- const Wn = 600;
147
+ const zn = 600;
148
148
  function Ht(t) {
149
149
  const e = Re(), [r, a] = j(!1), l = ae(!0);
150
150
  he(() => (l.current = !0, () => {
@@ -158,12 +158,12 @@ function Ht(t) {
158
158
  await e.refetchQueries({ queryKey: [...c.current], type: "active" });
159
159
  } catch {
160
160
  }
161
- await new Promise((b) => setTimeout(b, Wn)), l.current && a(!1);
161
+ await new Promise((b) => setTimeout(b, zn)), l.current && a(!1);
162
162
  }, [e]);
163
163
  return { settling: r, settle: m };
164
164
  }
165
165
  const $e = 1500, _t = 4e3;
166
- class zn {
166
+ class Hn {
167
167
  constructor() {
168
168
  We(this, "seen", null);
169
169
  We(this, "fresh", /* @__PURE__ */ new Map());
@@ -213,7 +213,7 @@ class zn {
213
213
  }
214
214
  function Gt(t, e) {
215
215
  const r = ae(null);
216
- r.current || (r.current = new zn());
216
+ r.current || (r.current = new Hn());
217
217
  const a = r.current, l = ae(e);
218
218
  l.current !== e && (l.current = e, a.reset());
219
219
  const [, c] = j(0), m = t ? t.join(",") : null;
@@ -241,17 +241,17 @@ function Xt(t, e, r) {
241
241
  ce(`/pipelines/instance/${e}/${r}/approval-brief`)
242
242
  ).then((a) => a.data);
243
243
  }
244
- function Hn(t) {
244
+ function Gn(t) {
245
245
  return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
246
246
  }
247
247
  function St(t) {
248
248
  return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
249
249
  }
250
- function Gn(t) {
250
+ function Vn(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 Vn(t, e, r = 40) {
254
+ function Xn(t, e, r = 40) {
255
255
  const a = (_) => _ == null || _ === "" ? "" : String(_), l = a(t), c = a(e), m = (_) => _ === "" ? "(empty)" : _;
256
256
  if (t === void 0) return { old: null, new: He(m(c), 0, r) };
257
257
  if (l.length <= r && c.length <= r) return { old: m(l), new: m(c) };
@@ -264,7 +264,7 @@ function He(t, e, r) {
264
264
  const a = Math.min(e, Math.max(0, t.length - r)), l = t.slice(a, a + r);
265
265
  return `${a > 0 ? "…" : ""}${l}${a + r < t.length ? "…" : ""}`;
266
266
  }
267
- const Xn = 4e3;
267
+ const Yn = 4e3;
268
268
  function Yt(t, e) {
269
269
  const r = xe(), a = Re();
270
270
  return Ft(async () => {
@@ -276,9 +276,9 @@ function Yt(t, e) {
276
276
  staleTime: 0,
277
277
  retry: !1
278
278
  }),
279
- new Promise((c) => setTimeout(() => c(null), Xn))
279
+ new Promise((c) => setTimeout(() => c(null), Yn))
280
280
  ]);
281
- return Hn(l == null ? void 0 : l.lines);
281
+ return Gn(l == null ? void 0 : l.lines);
282
282
  } catch {
283
283
  return [];
284
284
  }
@@ -394,13 +394,13 @@ function an(t, e, r) {
394
394
  ), l = r == null ? void 0 : r.data, c = ((h = l == null ? void 0 : l.new_state) == null ? void 0 : h.id) ?? ((_ = l == null ? void 0 : l.instance) == null ? void 0 : _.current_state) ?? null, m = ((k = l == null ? void 0 : l.new_state) == null ? void 0 : k.label) ?? (a ? (q = (w = t == null ? void 0 : t.states) == null ? void 0 : w.find((B) => B.id === a.to_state)) == null ? void 0 : q.label : void 0) ?? null, b = ((F = t == null ? void 0 : t.instance) == null ? void 0 : F.current_state) ?? null;
395
395
  return b && c && String(b) === String(c) ? "Nothing moved" : a != null && a.label && m ? `${a.label} — now ${m}` : m ? `Moved to ${m}` : a != null && a.label ? `${a.label} done` : "Transition executed";
396
396
  }
397
- const Yn = 1200;
397
+ const Jn = 1200;
398
398
  function sn(t) {
399
399
  const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
400
400
  let r = !1;
401
401
  const a = setTimeout(() => {
402
402
  r = !0, X.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
403
- }, Yn);
403
+ }, Jn);
404
404
  return {
405
405
  /** Options for the result toast: replaces the loading one when shown. */
406
406
  done: () => (clearTimeout(a), r ? { id: e, duration: 7e3 } : {}),
@@ -418,7 +418,7 @@ function ln(t, e, r) {
418
418
  ])
419
419
  t.invalidateQueries({ queryKey: [a, e, r] });
420
420
  }
421
- function Jn(t, e, r) {
421
+ function Zn(t, e, r) {
422
422
  var b;
423
423
  if (!e) return null;
424
424
  const a = new Map(r.map((h) => [String(h.id).toUpperCase(), h.sort])), l = [...t].sort(
@@ -428,21 +428,30 @@ function Jn(t, e, r) {
428
428
  const c = a.get(String(l.from_state).toUpperCase()), m = a.get(String(l.to_state).toUpperCase());
429
429
  return c == null || m == null || m >= c ? null : l;
430
430
  }
431
- function Zn({ entry: t }) {
431
+ function er({ entry: t }) {
432
432
  const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
433
433
  return /* @__PURE__ */ i(
434
434
  "div",
435
435
  {
436
- className: "mx-5 mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/30 dark:bg-amber-500/10",
436
+ className: "flex items-start gap-2.5 border-t border-amber-200/80 bg-amber-50/70 px-4 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/[0.06]",
437
437
  "data-send-back-notice": !0,
438
438
  children: [
439
- /* @__PURE__ */ i("p", { className: "text-[12px] font-medium text-amber-900 dark:text-amber-200", children: [
440
- "Sent back by ",
441
- ot(e, t),
442
- " · ",
443
- at(t.timestamp)
444
- ] }),
445
- /* @__PURE__ */ n("p", { className: "mt-0.5 whitespace-pre-line text-[13px] text-amber-950 dark:text-amber-100", children: t.comment })
439
+ /* @__PURE__ */ n(
440
+ gn,
441
+ {
442
+ "aria-hidden": !0,
443
+ className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
444
+ }
445
+ ),
446
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
447
+ /* @__PURE__ */ n("p", { className: "whitespace-pre-line break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: t.comment }),
448
+ /* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
449
+ "Sent back by ",
450
+ ot(e, t),
451
+ " · ",
452
+ at(t.timestamp)
453
+ ] })
454
+ ] })
446
455
  ]
447
456
  }
448
457
  );
@@ -472,7 +481,7 @@ function on({
472
481
  onSuccess: () => {
473
482
  Pe(h, t, e), X.success(`${(w == null ? void 0 : w.label) ?? "Done"} — trying again`), a();
474
483
  },
475
- onError: (A) => Nn(A, `${(w == null ? void 0 : w.label) ?? "The fix"} failed`)
484
+ onError: (A) => _n(A, `${(w == null ? void 0 : w.label) ?? "The fix"} failed`)
476
485
  });
477
486
  if (q || !w) return null;
478
487
  const B = !F.isPending && (!w.require_reason || _.trim().length > 0);
@@ -555,9 +564,9 @@ function ve({
555
564
  }
556
565
  function Ge(t) {
557
566
  const e = Math.floor(t / 6e4);
558
- return e < 60 ? `${Math.max(1, e)}m` : Rn(t / 36e5);
567
+ return e < 60 ? `${Math.max(1, e)}m` : Mn(t / 36e5);
559
568
  }
560
- function er({
569
+ function tr({
561
570
  history: t,
562
571
  completedAt: e
563
572
  }) {
@@ -617,7 +626,7 @@ function er({
617
626
  }) })
618
627
  ] });
619
628
  }
620
- function tr({
629
+ function nr({
621
630
  states: t,
622
631
  allTransitions: e,
623
632
  availableTransitions: r,
@@ -728,7 +737,7 @@ function tr({
728
737
  border: N || d ? "none" : E ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
729
738
  boxShadow: N ? `0 0 0 3px white, 0 0 0 5px ${Y}` : void 0
730
739
  },
731
- children: d ? /* @__PURE__ */ n(je, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : N ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : E ? /* @__PURE__ */ n(gn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
740
+ children: d ? /* @__PURE__ */ n(je, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : N ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : E ? /* @__PURE__ */ n(xn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
732
741
  },
733
742
  N ? "cur" : d ? "done" : E ? "skip" : "todo"
734
743
  ),
@@ -837,9 +846,9 @@ function tr({
837
846
  ] }, u.id);
838
847
  }) }) }) });
839
848
  }
840
- function nr({ history: t }) {
849
+ function rr({ history: t }) {
841
850
  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) => {
842
- const r = Ue(e), a = r ? tt(e) : ot([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l = jn(e), c = e.comment && !r && !l ? e.comment : null, m = l ?? (r ? nt(e) : null);
851
+ const r = Ue(e), a = r ? tt(e) : ot([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l = In(e), c = e.comment && !r && !l ? e.comment : null, m = l ?? (r ? nt(e) : null);
843
852
  return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
844
853
  /* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
845
854
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
@@ -871,7 +880,7 @@ function nr({ history: t }) {
871
880
  ] }, e.id);
872
881
  }) });
873
882
  }
874
- function rr({ value: t, onChange: e }) {
883
+ function ar({ value: t, onChange: e }) {
875
884
  const r = xe(), [a, l] = j(!1), [c, m] = j(""), [b, h] = j(""), _ = ae(null), k = ae(null);
876
885
  he(() => {
877
886
  a ? setTimeout(() => {
@@ -893,7 +902,7 @@ function rr({ value: t, onChange: e }) {
893
902
  enabled: a,
894
903
  staleTime: 3e4
895
904
  }), { data: F } = le({
896
- ...$n(r, t),
905
+ ...Tn(r, t),
897
906
  enabled: !!t,
898
907
  staleTime: 5 * 6e4
899
908
  }), B = w ?? [], A = F ?? B.find((R) => R.id === t) ?? null, L = A ? [A.first_name, A.last_name].filter(Boolean).join(" ").trim() || A.email : t ? "Selected person" : null, I = (R) => [R.first_name, R.last_name].filter(Boolean).join(" ").trim();
@@ -924,7 +933,7 @@ function rr({ value: t, onChange: e }) {
924
933
  ] }),
925
934
  /* @__PURE__ */ i(lt, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
926
935
  /* @__PURE__ */ n("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ i("div", { className: "relative", children: [
927
- /* @__PURE__ */ n(yn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
936
+ /* @__PURE__ */ n(wn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
928
937
  /* @__PURE__ */ n(
929
938
  "input",
930
939
  {
@@ -979,7 +988,7 @@ function Tt({
979
988
  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",
980
989
  children: [
981
990
  /* @__PURE__ */ n(
982
- Fn,
991
+ An,
983
992
  {
984
993
  userId: t,
985
994
  alt: e,
@@ -995,7 +1004,7 @@ function Tt({
995
1004
  }
996
1005
  ) });
997
1006
  }
998
- function ar({
1007
+ function sr({
999
1008
  collection: t,
1000
1009
  item: e,
1001
1010
  states: r,
@@ -1003,7 +1012,7 @@ function ar({
1003
1012
  returned: l = !1
1004
1013
  }) {
1005
1014
  var me, ne, ke, Ne;
1006
- const c = xe(), m = Re(), { isAdmin: b } = vn(), [h, _] = j(!1), [k, w] = j(""), [q, F] = j(""), [B, A] = j(!1), L = ["pipeline-instance-owners", t, e], I = ["pipeline-owners-can-add", t, e], R = () => c.request(
1015
+ const c = xe(), m = Re(), { isAdmin: b } = kn(), [h, _] = j(!1), [k, w] = j(""), [q, F] = j(""), [B, A] = j(!1), L = ["pipeline-instance-owners", t, e], I = ["pipeline-owners-can-add", t, e], R = () => c.request(
1007
1016
  ce(`/pipelines/instance/${t}/${e}/owners`)
1008
1017
  ).then((s) => {
1009
1018
  var p;
@@ -1053,7 +1062,7 @@ function ar({
1053
1062
  // The server's reason (a 403 says why), not a bare status phrase.
1054
1063
  onError: (s) => X.error(Me(s, "Failed to add owner"))
1055
1064
  }), $ = qe({
1056
- mutationFn: (s) => c.request(kn(`/pipelines/instance-owners/${s.id}`)),
1065
+ mutationFn: (s) => c.request(Nn(`/pipelines/instance-owners/${s.id}`)),
1057
1066
  onSuccess: (s, p) => {
1058
1067
  z();
1059
1068
  const x = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email;
@@ -1090,7 +1099,7 @@ function ar({
1090
1099
  ] })
1091
1100
  ] }),
1092
1101
  /* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
1093
- a && /* @__PURE__ */ n(On, { collection: t, itemId: String(e) }),
1102
+ a && /* @__PURE__ */ n(Un, { collection: t, itemId: String(e) }),
1094
1103
  !h && g && /* @__PURE__ */ i(
1095
1104
  "button",
1096
1105
  {
@@ -1098,7 +1107,7 @@ function ar({
1098
1107
  onClick: () => _(!0),
1099
1108
  className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
1100
1109
  children: [
1101
- /* @__PURE__ */ n(xn, { className: "h-3 w-3" }),
1110
+ /* @__PURE__ */ n(yn, { className: "h-3 w-3" }),
1102
1111
  "Add"
1103
1112
  ]
1104
1113
  }
@@ -1192,7 +1201,7 @@ function ar({
1192
1201
  ] }),
1193
1202
  h && /* @__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: [
1194
1203
  /* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
1195
- /* @__PURE__ */ n(rr, { value: k, onChange: w }),
1204
+ /* @__PURE__ */ n(ar, { value: k, onChange: w }),
1196
1205
  b ? /* @__PURE__ */ i(st, { open: B, onOpenChange: A, children: [
1197
1206
  /* @__PURE__ */ n(it, { asChild: !0, children: /* @__PURE__ */ i(
1198
1207
  "button",
@@ -1258,12 +1267,12 @@ function dn(t, e, r, a) {
1258
1267
  if (!t || !(r != null && r.length)) return null;
1259
1268
  const c = new Map(r.map((h) => [String(h.id).toUpperCase(), h])).get(String(t.to_state).toUpperCase()), m = Number(e == null ? void 0 : e.sort);
1260
1269
  if (!c || !Number.isFinite(m) || !(Number(c.sort) > m)) return null;
1261
- const b = Bn(String(t.to_state), r, a);
1270
+ const b = Ln(String(t.to_state), r, a);
1262
1271
  return b && b.skipped.length > 0 ? b : null;
1263
1272
  }
1264
1273
  function cn({ landing: t }) {
1265
1274
  if (!t || t.skipped.length === 0) return null;
1266
- const e = Ln(t);
1275
+ const e = En(t);
1267
1276
  if (e.length === 1) {
1268
1277
  const r = e[0];
1269
1278
  return /* @__PURE__ */ i(
@@ -1310,7 +1319,7 @@ const Te = {
1310
1319
  suspended: "suspended",
1311
1320
  redacted: "redacted"
1312
1321
  };
1313
- function sr({
1322
+ function ir({
1314
1323
  collection: t,
1315
1324
  item: e,
1316
1325
  states: r,
@@ -1388,11 +1397,11 @@ function sr({
1388
1397
  )
1389
1398
  ] }) })
1390
1399
  ) : /* @__PURE__ */ i(be, { children: [
1391
- /* @__PURE__ */ n(Dn, { owners: w, max: 10, emptyLabel: "—" }),
1400
+ /* @__PURE__ */ n(Fn, { owners: w, max: 10, emptyLabel: "—" }),
1392
1401
  A.map((g) => /* @__PURE__ */ i(
1393
1402
  "span",
1394
1403
  {
1395
- "data-tip": `${g.name} is ${Te[g.reason] ?? g.reason}${g.delegate ? ` — ${g.delegate.name} covers${g.delegate.expires_at ? ` until ${qn(g.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1404
+ "data-tip": `${g.name} is ${Te[g.reason] ?? g.reason}${g.delegate ? ` — ${g.delegate.name} covers${g.delegate.expires_at ? ` until ${Rn(g.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
1396
1405
  className: ge(
1397
1406
  "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
1398
1407
  g.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"
@@ -1432,7 +1441,7 @@ function sr({
1432
1441
  ] })
1433
1442
  ] });
1434
1443
  }
1435
- function Br({
1444
+ function Lr({
1436
1445
  collection: t,
1437
1446
  item: e,
1438
1447
  defaultExpanded: r,
@@ -1446,7 +1455,7 @@ function Br({
1446
1455
  asRole: k
1447
1456
  }) {
1448
1457
  return e === "new" ? null : /* @__PURE__ */ n(
1449
- ir,
1458
+ lr,
1450
1459
  {
1451
1460
  collection: t,
1452
1461
  item: e,
@@ -1481,7 +1490,7 @@ function un({
1481
1490
  /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
1482
1491
  " ",
1483
1492
  "(",
1484
- Gn(l.days_in_state),
1493
+ Vn(l.days_in_state),
1485
1494
  "):",
1486
1495
  " ",
1487
1496
  l.changed_total === 0 && l.comments === 0 && l.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(be, { children: [
@@ -1510,14 +1519,14 @@ function un({
1510
1519
  ] }),
1511
1520
  l.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
1512
1521
  l.field_changes.slice(0, 5).map((h) => {
1513
- const _ = Vn(h.old, h.new);
1522
+ const _ = Xn(h.old, h.new);
1514
1523
  return /* @__PURE__ */ i(
1515
1524
  "p",
1516
1525
  {
1517
1526
  "data-brief-change": h.field,
1518
1527
  className: "text-[11px] text-slate-500 dark:text-muted-foreground",
1519
1528
  children: [
1520
- /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: h.label || Tn(h.field) }),
1529
+ /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: h.label || qn(h.field) }),
1521
1530
  h.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
1522
1531
  ":",
1523
1532
  " ",
@@ -1559,7 +1568,7 @@ function un({
1559
1568
  ))
1560
1569
  ] });
1561
1570
  }
1562
- function ir({
1571
+ function lr({
1563
1572
  collection: t,
1564
1573
  item: e,
1565
1574
  defaultExpanded: r,
@@ -1575,7 +1584,7 @@ function ir({
1575
1584
  var pt, ft, ht;
1576
1585
  const w = xe(), q = Re(), [F, B] = j(""), [A, L] = j(null), [I, R] = j(!1), [D, Q] = j(!1), [u, g] = j(null), [N, T] = j(null), [d, K] = j([]), te = Yt(t, String(e));
1577
1586
  Ot(t, e, "transition", !!A || !!u);
1578
- const y = _n(t, e, "transition"), S = ae(!1);
1587
+ const y = Sn(t, e, "transition"), S = ae(!1);
1579
1588
  he(() => {
1580
1589
  !S.current && r !== void 0 && (S.current = !0, Q(r));
1581
1590
  }, [r]);
@@ -1871,7 +1880,7 @@ function ir({
1871
1880
  onDismiss: () => T(null),
1872
1881
  onFixed: () => Y({ transition_id: N.transitionId, comment: N.comment })
1873
1882
  }
1874
- ) : null, ut = Jn(Z ?? [], v == null ? void 0 : v.current_state, O ?? []), mt = /* @__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: [
1883
+ ) : null, ut = Zn(Z ?? [], v == null ? void 0 : v.current_state, O ?? []), mt = /* @__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: [
1875
1884
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
1876
1885
  /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
1877
1886
  se && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: se.label }),
@@ -1971,7 +1980,7 @@ function ir({
1971
1980
  "data-pipeline-approving": !0,
1972
1981
  children: [
1973
1982
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
1974
- Sn(y, "approving")
1983
+ Cn(y, "approving")
1975
1984
  ]
1976
1985
  }
1977
1986
  )
@@ -1995,7 +2004,7 @@ function ir({
1995
2004
  }
1996
2005
  ),
1997
2006
  l && ((o == null ? void 0 : o.binding) || (o == null ? void 0 : o.instance)) && /* @__PURE__ */ n(
1998
- sr,
2007
+ ir,
1999
2008
  {
2000
2009
  collection: t,
2001
2010
  item: e,
@@ -2018,9 +2027,9 @@ function ir({
2018
2027
  ),
2019
2028
  !D && A && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: mt }),
2020
2029
  !D && Qe && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Qe }),
2021
- ut && !(v != null && v.completed_at) && /* @__PURE__ */ n(Zn, { entry: ut }),
2030
+ ut && !(v != null && v.completed_at) && /* @__PURE__ */ n(er, { entry: ut }),
2022
2031
  D && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
2023
- /* @__PURE__ */ n(Kn, { held: (o == null ? void 0 : o.auto_held) ?? [] }),
2032
+ /* @__PURE__ */ n(Qn, { held: (o == null ? void 0 : o.auto_held) ?? [] }),
2024
2033
  h && /* @__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: [
2025
2034
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
2026
2035
  /* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
@@ -2040,7 +2049,7 @@ function ir({
2040
2049
  /* @__PURE__ */ n(we, { className: "ml-2 h-3 w-24" })
2041
2050
  ] })
2042
2051
  ) : /* @__PURE__ */ n(
2043
- tr,
2052
+ nr,
2044
2053
  {
2045
2054
  states: O,
2046
2055
  allTransitions: (o == null ? void 0 : o.all_transitions) ?? [],
@@ -2051,9 +2060,9 @@ function ir({
2051
2060
  skippedStates: s
2052
2061
  }
2053
2062
  ),
2054
- (o == null ? void 0 : o.branches) && /* @__PURE__ */ n(Un, { data: o.branches }),
2063
+ (o == null ? void 0 : o.branches) && /* @__PURE__ */ n(Bn, { data: o.branches }),
2055
2064
  /* @__PURE__ */ n(
2056
- er,
2065
+ tr,
2057
2066
  {
2058
2067
  history: Z ?? [],
2059
2068
  completedAt: v.completed_at
@@ -2061,9 +2070,9 @@ function ir({
2061
2070
  )
2062
2071
  ] }),
2063
2072
  /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
2064
- !v.completed_at && /* @__PURE__ */ n(En, { collection: t, itemId: String(e) }),
2073
+ !v.completed_at && /* @__PURE__ */ n(jn, { collection: t, itemId: String(e) }),
2065
2074
  /* @__PURE__ */ n(
2066
- ar,
2075
+ sr,
2067
2076
  {
2068
2077
  collection: t,
2069
2078
  item: e,
@@ -2110,7 +2119,7 @@ function ir({
2110
2119
  ]
2111
2120
  }
2112
2121
  ),
2113
- I && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(nr, { history: Z ?? [] }) })
2122
+ I && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(rr, { history: Z ?? [] }) })
2114
2123
  ] })
2115
2124
  ] }) : /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
2116
2125
  /* @__PURE__ */ n("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
@@ -2156,14 +2165,14 @@ function ir({
2156
2165
  ) })
2157
2166
  ] });
2158
2167
  }
2159
- function Lr({
2168
+ function Er({
2160
2169
  collection: t,
2161
2170
  item: e,
2162
2171
  onBeforeTransition: r,
2163
2172
  wrap: a = !0
2164
2173
  }) {
2165
2174
  return e === "new" ? null : /* @__PURE__ */ n(
2166
- lr,
2175
+ or,
2167
2176
  {
2168
2177
  collection: t,
2169
2178
  item: e,
@@ -2172,7 +2181,7 @@ function Lr({
2172
2181
  }
2173
2182
  );
2174
2183
  }
2175
- function lr({
2184
+ function or({
2176
2185
  collection: t,
2177
2186
  item: e,
2178
2187
  onBeforeTransition: r,
@@ -2180,7 +2189,7 @@ function lr({
2180
2189
  }) {
2181
2190
  const l = xe(), c = Re(), [m, b] = j(""), [h, _] = j(null), [k, w] = j(null), [q, F] = j(null), [B, A] = j([]), L = Yt(t, String(e));
2182
2191
  Ot(t, e, "transition", !!h || !!k);
2183
- const I = ae(null), R = Pn(I, !a), D = ae(!1), Q = (s) => {
2192
+ const I = ae(null), R = Dn(I, !a), D = ae(!1), Q = (s) => {
2184
2193
  D.current || (D.current = !0, F(null), S.mutate(s, {
2185
2194
  onSettled: (p, x) => {
2186
2195
  if (x) {
@@ -2417,7 +2426,7 @@ function lr({
2417
2426
  ] })
2418
2427
  ] }, s) : /* @__PURE__ */ i(wt, { children: [
2419
2428
  x > 0 && /* @__PURE__ */ n(vt, {}),
2420
- /* @__PURE__ */ n(An, { className: "text-[11px] text-muted-foreground", children: s }),
2429
+ /* @__PURE__ */ n(On, { className: "text-[11px] text-muted-foreground", children: s }),
2421
2430
  ke(p).map((P) => {
2422
2431
  var v;
2423
2432
  return /* @__PURE__ */ i(Oe, { onSelect: () => u(P.id), children: [
@@ -2470,7 +2479,7 @@ function lr({
2470
2479
  return O.pushes && O.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
2471
2480
  fe,
2472
2481
  /* @__PURE__ */ n(
2473
- Mn,
2482
+ Pn,
2474
2483
  {
2475
2484
  collection: t,
2476
2485
  itemId: e,
@@ -2614,19 +2623,19 @@ function lr({
2614
2623
  export {
2615
2624
  $e as FRESH_BUTTON_MS,
2616
2625
  _t as FRESH_HOVER_MAX_MS,
2617
- zn as FreshButtonGuard,
2618
- Br as PipelinePanel,
2619
- Lr as PipelineTransitionButtons,
2620
- Qn as REFUSAL_FIX_ACTIONS,
2626
+ Hn as FreshButtonGuard,
2627
+ Lr as PipelinePanel,
2628
+ Er as PipelineTransitionButtons,
2629
+ Wn as REFUSAL_FIX_ACTIONS,
2621
2630
  en as RecordFlagChips,
2622
- Yn as SLOW_MOVE_MS,
2631
+ Jn as SLOW_MOVE_MS,
2623
2632
  Zt as asksFirst,
2624
- Gn as briefAgeText,
2625
- Vn as briefDiffPair,
2633
+ Vn as briefAgeText,
2634
+ Xn as briefDiffPair,
2626
2635
  St as briefLineKey,
2627
- Hn as briefWarnings,
2636
+ Gn as briefWarnings,
2628
2637
  It as isDuplicateTransition,
2629
- Jn as latestSendBack,
2638
+ Zn as latestSendBack,
2630
2639
  Wt as lockedMoveOffer,
2631
2640
  Qt as refusalCode,
2632
2641
  zt as refusalFixFor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.3.75",
3
+ "version": "0.3.77",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",