@nivaro/react 0.3.0 → 0.3.2

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 (33) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +341 -0
  4. package/dist/index.js +764 -723
  5. package/dist/shared/components/ClientChaosToolbar.js +410 -0
  6. package/dist/shared/components/LoadErrorNote.js +49 -0
  7. package/dist/shared/components/PretendDown.js +258 -0
  8. package/dist/shared/components/ProfileView.js +54 -49
  9. package/dist/shared/components/QueryErrorState.js +16 -0
  10. package/dist/shared/components/ReportView.js +1351 -1338
  11. package/dist/shared/components/WidgetSlot.js +438 -418
  12. package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
  13. package/dist/shared/components/chaos/DrillBanner.js +119 -0
  14. package/dist/shared/components/chaos/DrillTag.js +62 -0
  15. package/dist/shared/components/chaos/GameDayStrip.js +61 -0
  16. package/dist/shared/components/chat/huddle/HuddleAudioUi.js +95 -92
  17. package/dist/shared/components/chat/huddle/HuddleCallBar.js +69 -64
  18. package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +40 -39
  19. package/dist/shared/components/chat/huddle/HuddleStageTools.js +30 -27
  20. package/dist/shared/components/chat/huddle/huddle-dismiss.js +12 -0
  21. package/dist/shared/components/chat/huddle/huddle-store.js +25 -20
  22. package/dist/shared/components/client-chaos-gate.js +51 -0
  23. package/dist/shared/components/integrations/console/SignalCard.js +172 -167
  24. package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
  25. package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
  26. package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
  27. package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
  28. package/dist/shared/components/pipeline/TeamsView.js +184 -169
  29. package/dist/shared/lib/client-chaos.js +359 -0
  30. package/dist/shared/lib/load-error.js +26 -0
  31. package/dist/shared/lib/socket-realtime.js +31 -30
  32. package/dist/shared/lib/worker-socket.js +108 -89
  33. package/package.json +1 -1
@@ -1,37 +1,38 @@
1
1
  import { jsxs as t, jsx as e, Fragment as ke } from "react/jsx-runtime";
2
- import { useSensors as Tt, useSensor as Ue, PointerSensor as Dt, KeyboardSensor as At, DndContext as Be, closestCenter as We } from "@dnd-kit/core";
3
- import { sortableKeyboardCoordinates as jt, SortableContext as Qe, verticalListSortingStrategy as Ve, arrayMove as He, useSortable as it } from "@dnd-kit/sortable";
4
- import { CSS as ot } from "@dnd-kit/utilities";
5
- import { useMutation as z, useQueryClient as ve, useQuery as G } from "@tanstack/react-query";
6
- import { X as be, ArrowLeft as na, Check as ye, Pencil as Te, Download as la, Plus as fe, Trash2 as Ce, ArrowRight as Lt, Zap as ra, PlugZap as ia, Filter as ct, Link2 as Ct, LayoutGrid as oa, Link2Off as ca, ListChecks as Mt, Loader2 as Se, GripVertical as dt, Settings as da, GitFork as ma, ChevronDown as Ee, Search as mt, History as pa, ChevronRight as pt } from "lucide-react";
7
- import { useState as $, useEffect as ue, useContext as ua, useRef as Je, useMemo as ha, createContext as xa } from "react";
8
- import { createPortal as fa } from "react-dom";
2
+ import { useSensors as jt, useSensor as Ge, PointerSensor as Lt, KeyboardSensor as Mt, DndContext as Qe, closestCenter as We } from "@dnd-kit/core";
3
+ import { sortableKeyboardCoordinates as zt, SortableContext as Ve, verticalListSortingStrategy as He, arrayMove as Ue, useSortable as ot } from "@dnd-kit/sortable";
4
+ import { CSS as ct } from "@dnd-kit/utilities";
5
+ import { useMutation as z, useQueryClient as Ne, useQuery as G } from "@tanstack/react-query";
6
+ import { X as ye, ArrowLeft as ia, Check as ve, Pencil as Te, Download as oa, Plus as ge, Trash2 as Ce, ArrowRight as Kt, Zap as ca, PlugZap as da, Filter as dt, Link2 as $t, LayoutGrid as ma, Link2Off as pa, ListChecks as Bt, Loader2 as Se, GripVertical as mt, Settings as ua, GitFork as ha, ChevronDown as Ee, Search as pt, History as xa, ChevronRight as ut } from "lucide-react";
7
+ import { useState as $, useEffect as he, useContext as fa, useRef as Xe, useMemo as ga, createContext as ba } from "react";
8
+ import { createPortal as ya } from "react-dom";
9
9
  import { toast as T } from "sonner";
10
10
  import { useNivaroClient as Z } from "../../context.js";
11
11
  import { post as J, get as Y, patch as we, del as $e } from "../../lib/commands.js";
12
- import { cn as I, formatRelative as ga, titleCase as ba } from "../../lib/utils.js";
13
- import { ExplainCard as ya } from "../ai/ExplainButton.js";
14
- import { PipelineCumulativeFlowCard as va } from "../charts/CumulativeFlowChart.js";
12
+ import { cn as I, formatRelative as va, titleCase as Na } from "../../lib/utils.js";
13
+ import { ExplainCard as wa } from "../ai/ExplainButton.js";
14
+ import { PipelineCumulativeFlowCard as ka } from "../charts/CumulativeFlowChart.js";
15
+ import { QueryErrorState as _a } from "../QueryErrorState.js";
15
16
  import { Badge as _e } from "../ui/badge.js";
16
17
  import { Button as P } from "../ui/button.js";
17
18
  import { Input as V } from "../ui/input.js";
18
19
  import { Label as U } from "../ui/label.js";
19
20
  import { Popover as Ae, PopoverTrigger as je, PopoverContent as Le } from "../ui/popover.js";
20
- import { Select as Na, SelectTrigger as wa, SelectValue as ka, SelectContent as _a, SelectItem as Ca } from "../ui/select.js";
21
+ import { Select as Ca, SelectTrigger as Sa, SelectValue as qa, SelectContent as $a, SelectItem as Fa } from "../ui/select.js";
21
22
  import { Skeleton as De } from "../ui/skeleton.js";
22
23
  import { Switch as Pe } from "../ui/switch.js";
23
- import { Textarea as zt } from "../ui/textarea.js";
24
- import { FieldPicker as rt } from "./FieldPicker.js";
25
- import { OwnerMatrix as Sa } from "./OwnerMatrix.js";
26
- import { OwnerMatrixVersionsCard as qa } from "./OwnerMatrixVersionsCard.js";
27
- import { TemplateLintCard as $a, SkipReportCard as Fa } from "./PipelineHealthCards.js";
28
- import { PipelineSkipCriteria as Ea } from "./PipelineSkipCriteria.js";
29
- import { PipelineStateOwners as Oa } from "./PipelineStateOwners.js";
30
- import { findM2ORelation as Ra, extractTemplateFields as Pa, renderDisplayTemplate as nt } from "./relations.js";
31
- import { TeamsView as Ta } from "./TeamsView.js";
32
- import { useScopeDimensions as Da, rankTeamForFilters as Aa, tierOrder as St } from "./teamScopes.js";
33
- const Kt = "rgb(var(--nvr-cyan-rgb, 0 206 255))";
34
- function ge({
24
+ import { Textarea as Qt } from "../ui/textarea.js";
25
+ import { FieldPicker as it } from "./FieldPicker.js";
26
+ import { OwnerMatrix as Ea } from "./OwnerMatrix.js";
27
+ import { OwnerMatrixVersionsCard as Oa } from "./OwnerMatrixVersionsCard.js";
28
+ import { TemplateLintCard as Ra, SkipReportCard as Pa } from "./PipelineHealthCards.js";
29
+ import { PipelineSkipCriteria as Ta } from "./PipelineSkipCriteria.js";
30
+ import { PipelineStateOwners as Da } from "./PipelineStateOwners.js";
31
+ import { findM2ORelation as Aa, extractTemplateFields as ja, renderDisplayTemplate as lt } from "./relations.js";
32
+ import { TeamsView as La } from "./TeamsView.js";
33
+ import { useScopeDimensions as Ma, rankTeamForFilters as za, tierOrder as Ft } from "./teamScopes.js";
34
+ const Wt = "rgb(var(--nvr-cyan-rgb, 0 206 255))";
35
+ function be({
35
36
  value: a,
36
37
  onChange: l,
37
38
  options: d,
@@ -40,8 +41,8 @@ function ge({
40
41
  className: f
41
42
  }) {
42
43
  var n;
43
- const [c, r] = $(!1), [u, b] = $(""), h = Je(null);
44
- ue(() => {
44
+ const [c, r] = $(!1), [u, b] = $(""), h = Xe(null);
45
+ he(() => {
45
46
  c ? setTimeout(() => {
46
47
  var y;
47
48
  return (y = h.current) == null ? void 0 : y.focus();
@@ -69,13 +70,13 @@ function ge({
69
70
  y.stopPropagation(), l("");
70
71
  },
71
72
  className: "absolute right-6 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
72
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
73
+ children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
73
74
  }
74
75
  )
75
76
  ] }),
76
77
  /* @__PURE__ */ t(Le, { align: "start", className: "w-56 p-0", sideOffset: 4, children: [
77
78
  /* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "relative", children: [
78
- /* @__PURE__ */ e(mt, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
79
+ /* @__PURE__ */ e(pt, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
79
80
  /* @__PURE__ */ e(
80
81
  "input",
81
82
  {
@@ -97,7 +98,7 @@ function ge({
97
98
  },
98
99
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-[12px] hover:bg-slate-50 ${a ? "text-slate-500" : "font-medium text-slate-800"}`,
99
100
  children: [
100
- /* @__PURE__ */ e(ye, { className: `h-3.5 w-3.5 shrink-0 ${a ? "opacity-0" : "text-nvr-cyan"}` }),
101
+ /* @__PURE__ */ e(ve, { className: `h-3.5 w-3.5 shrink-0 ${a ? "opacity-0" : "text-nvr-cyan"}` }),
101
102
  o
102
103
  ]
103
104
  }
@@ -112,7 +113,7 @@ function ge({
112
113
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-[12px] hover:bg-slate-50 ${a === y.value ? "font-medium text-slate-800" : "text-slate-600"}`,
113
114
  children: [
114
115
  /* @__PURE__ */ e(
115
- ye,
116
+ ve,
116
117
  {
117
118
  className: `h-3.5 w-3.5 shrink-0 ${a === y.value ? "text-nvr-cyan" : "opacity-0"}`
118
119
  }
@@ -127,15 +128,15 @@ function ge({
127
128
  ] })
128
129
  ] });
129
130
  }
130
- function ja({
131
+ function Ka({
131
132
  values: a,
132
133
  onChange: l,
133
134
  options: d,
134
135
  placeholder: x = "Select states…"
135
136
  }) {
136
137
  var p;
137
- const [o, f] = $(!1), [c, r] = $(""), u = Je(null);
138
- ue(() => {
138
+ const [o, f] = $(!1), [c, r] = $(""), u = Xe(null);
139
+ he(() => {
139
140
  o ? setTimeout(() => {
140
141
  var n;
141
142
  return (n = u.current) == null ? void 0 : n.focus();
@@ -167,13 +168,13 @@ function ja({
167
168
  n.stopPropagation(), l([]);
168
169
  },
169
170
  className: "absolute right-6 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
170
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
171
+ children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
171
172
  }
172
173
  )
173
174
  ] }),
174
175
  /* @__PURE__ */ t(Le, { align: "start", className: "w-56 p-0", sideOffset: 4, children: [
175
176
  /* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "relative", children: [
176
- /* @__PURE__ */ e(mt, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
177
+ /* @__PURE__ */ e(pt, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
177
178
  /* @__PURE__ */ e(
178
179
  "input",
179
180
  {
@@ -196,7 +197,7 @@ function ja({
196
197
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-[12px] hover:bg-slate-50 ${y ? "font-medium text-slate-800" : "text-slate-600"}`,
197
198
  children: [
198
199
  /* @__PURE__ */ e(
199
- ye,
200
+ ve,
200
201
  {
201
202
  className: `h-3.5 w-3.5 shrink-0 ${y ? "text-nvr-cyan" : "opacity-0"}`
202
203
  }
@@ -212,7 +213,7 @@ function ja({
212
213
  ] })
213
214
  ] });
214
215
  }
215
- const La = [
216
+ const Ba = [
216
217
  "#6b7280",
217
218
  "#ef4444",
218
219
  "#f97316",
@@ -223,7 +224,7 @@ const La = [
223
224
  "#8b5cf6",
224
225
  "#ec4899"
225
226
  ];
226
- function Ge({
227
+ function Ye({
227
228
  value: a,
228
229
  onChange: l
229
230
  }) {
@@ -240,7 +241,7 @@ function Ge({
240
241
  title: "No color"
241
242
  }
242
243
  ),
243
- La.map((d) => /* @__PURE__ */ e(
244
+ Ba.map((d) => /* @__PURE__ */ e(
244
245
  "button",
245
246
  {
246
247
  type: "button",
@@ -256,7 +257,7 @@ function Ge({
256
257
  ))
257
258
  ] });
258
259
  }
259
- function qt({ state: a, small: l }) {
260
+ function Et({ state: a, small: l }) {
260
261
  return /* @__PURE__ */ t(
261
262
  "span",
262
263
  {
@@ -269,12 +270,12 @@ function qt({ state: a, small: l }) {
269
270
  children: [
270
271
  a.is_initial && /* @__PURE__ */ e("span", { className: "text-[10px]", children: "●" }),
271
272
  a.label,
272
- a.is_terminal && /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
273
+ a.is_terminal && /* @__PURE__ */ e(ve, { className: "h-3 w-3" })
273
274
  ]
274
275
  }
275
276
  );
276
277
  }
277
- function $t({
278
+ function Ot({
278
279
  initial: a,
279
280
  onSave: l,
280
281
  onCancel: d,
@@ -342,7 +343,7 @@ function $t({
342
343
  ] }),
343
344
  /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
344
345
  /* @__PURE__ */ e(U, { className: "text-[12px]", children: "Color" }),
345
- /* @__PURE__ */ e(Ge, { value: o.color, onChange: (r) => c("color", r) })
346
+ /* @__PURE__ */ e(Ye, { value: o.color, onChange: (r) => c("color", r) })
346
347
  ] }),
347
348
  /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
348
349
  /* @__PURE__ */ e(U, { className: "text-[12px]", children: "Help text" }),
@@ -462,19 +463,19 @@ function $t({
462
463
  ] })
463
464
  ] });
464
465
  }
465
- function Ft(a) {
466
+ function Rt(a) {
466
467
  return !a || a.length === 0 ? "" : [...a].sort(
467
468
  (l, d) => `${l.field}${l.op}${String(l.value)}`.localeCompare(`${d.field}${d.op}${String(d.value)}`)
468
469
  ).map((l) => `${l.field}:${l.op}:${String(l.value ?? "")}`).join("|");
469
470
  }
470
- function Et(a) {
471
+ function Pt(a) {
471
472
  const l = /* @__PURE__ */ new Map();
472
473
  for (const x of a) {
473
474
  l.has(x.label) || l.set(x.label, { label: x.label, color: x.color, routes: [], minSort: x.sort });
474
475
  const o = l.get(x.label);
475
476
  o.minSort = Math.min(o.minSort, x.sort);
476
- const f = Ft(x.condition_rules), c = o.routes.find(
477
- (r) => r.from_state === x.from_state && Ft(r.condition_rules) === f
477
+ const f = Rt(x.condition_rules), c = o.routes.find(
478
+ (r) => r.from_state === x.from_state && Rt(r.condition_rules) === f
478
479
  );
479
480
  c ? (c.ids.push(x.id), c.to_states.push(x.to_state), c.minSort = Math.min(c.minSort, x.sort)) : o.routes.push({
480
481
  ids: [x.id],
@@ -498,17 +499,17 @@ function Et(a) {
498
499
  for (const x of d) x.routes.sort((o, f) => o.minSort - f.minSort);
499
500
  return d;
500
501
  }
501
- const Bt = xa(null);
502
- function Ot({ id: a, children: l }) {
503
- const { attributes: d, listeners: x, setNodeRef: o, transform: f, transition: c, isDragging: r } = it({
502
+ const Vt = ba(null);
503
+ function Tt({ id: a, children: l }) {
504
+ const { attributes: d, listeners: x, setNodeRef: o, transform: f, transition: c, isDragging: r } = ot({
504
505
  id: a
505
506
  });
506
- return /* @__PURE__ */ e(Bt.Provider, { value: { listeners: x, attributes: d }, children: /* @__PURE__ */ e(
507
+ return /* @__PURE__ */ e(Vt.Provider, { value: { listeners: x, attributes: d }, children: /* @__PURE__ */ e(
507
508
  "div",
508
509
  {
509
510
  ref: o,
510
511
  style: {
511
- transform: ot.Transform.toString(f),
512
+ transform: ct.Transform.toString(f),
512
513
  transition: c,
513
514
  opacity: r ? 0.4 : 1
514
515
  },
@@ -516,8 +517,8 @@ function Ot({ id: a, children: l }) {
516
517
  }
517
518
  ) });
518
519
  }
519
- function Rt() {
520
- const a = ua(Bt);
520
+ function Dt() {
521
+ const a = fa(Vt);
521
522
  return /* @__PURE__ */ e(
522
523
  "button",
523
524
  {
@@ -526,20 +527,20 @@ function Rt() {
526
527
  ...a == null ? void 0 : a.attributes,
527
528
  className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 shrink-0",
528
529
  tabIndex: -1,
529
- children: /* @__PURE__ */ e(dt, { className: "h-3.5 w-3.5" })
530
+ children: /* @__PURE__ */ e(mt, { className: "h-3.5 w-3.5" })
530
531
  }
531
532
  );
532
533
  }
533
- function Ma(a) {
534
+ function Qa(a) {
534
535
  return a ? Array.isArray(a) ? a.map(String).filter(Boolean) : typeof a == "string" && a.trim() ? [a] : [] : [];
535
536
  }
536
- function za({
537
+ function Wa({
537
538
  relatedCollection: a,
538
539
  value: l,
539
540
  onChange: d
540
541
  }) {
541
- const x = Z(), [o, f] = $(!1), [c, r] = $(""), u = Je(null);
542
- ue(() => {
542
+ const x = Z(), [o, f] = $(!1), [c, r] = $(""), u = Xe(null);
543
+ he(() => {
543
544
  o ? setTimeout(() => {
544
545
  var O;
545
546
  return (O = u.current) == null ? void 0 : O.focus();
@@ -551,7 +552,7 @@ function za({
551
552
  staleTime: 6e4,
552
553
  enabled: !!a
553
554
  }), h = ((b == null ? void 0 : b.fields) ?? []).map((O) => O.field), m = (b == null ? void 0 : b.display_template) ?? null, p = ["name", "title", "label", "display_name", "subject", "email", "slug"], n = [
554
- .../* @__PURE__ */ new Set(["id", ...Pa(m), ...p])
555
+ .../* @__PURE__ */ new Set(["id", ...ja(m), ...p])
555
556
  ], y = h.length ? n.filter((O) => O === "id" || h.includes(O)).join(",") : "id", { data: q, isLoading: v, isError: _ } = G({
556
557
  queryKey: ["relation-picker-items", a, y],
557
558
  queryFn: () => x.request(
@@ -579,13 +580,13 @@ function za({
579
580
  const N = q ?? [];
580
581
  function C(O) {
581
582
  const g = N.find((i) => String(i.id) === O);
582
- return g ? nt(m, g) : O;
583
+ return g ? lt(m, g) : O;
583
584
  }
584
585
  function D(O) {
585
586
  d(l.includes(O) ? l.filter((g) => g !== O) : [...l, O]);
586
587
  }
587
588
  const j = c ? N.filter(
588
- (O) => nt(m, O).toLowerCase().includes(c.toLowerCase())
589
+ (O) => lt(m, O).toLowerCase().includes(c.toLowerCase())
589
590
  ) : N;
590
591
  return /* @__PURE__ */ t(Ae, { open: o, onOpenChange: f, children: [
591
592
  /* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ t(
@@ -628,7 +629,7 @@ function za({
628
629
  ) }) }),
629
630
  /* @__PURE__ */ t(Le, { align: "start", className: "w-64 p-0", sideOffset: 4, children: [
630
631
  /* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "relative", children: [
631
- /* @__PURE__ */ e(mt, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
632
+ /* @__PURE__ */ e(pt, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
632
633
  /* @__PURE__ */ e(
633
634
  "input",
634
635
  {
@@ -644,7 +645,7 @@ function za({
644
645
  /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5 animate-spin" }),
645
646
  "Loading…"
646
647
  ] }) : j.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : j.map((O) => {
647
- const g = nt(m, O), i = String(O.id), w = l.includes(i);
648
+ const g = lt(m, O), i = String(O.id), w = l.includes(i);
648
649
  return /* @__PURE__ */ t(
649
650
  "button",
650
651
  {
@@ -653,7 +654,7 @@ function za({
653
654
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-[12px] hover:bg-slate-50 ${w ? "font-medium text-slate-800" : "text-slate-600"}`,
654
655
  children: [
655
656
  /* @__PURE__ */ e(
656
- ye,
657
+ ve,
657
658
  {
658
659
  className: `h-3.5 w-3.5 shrink-0 ${w ? "text-nvr-cyan" : "opacity-0"}`
659
660
  }
@@ -667,7 +668,7 @@ function za({
667
668
  ] })
668
669
  ] });
669
670
  }
670
- const Ka = [
671
+ const Va = [
671
672
  { value: "eq", label: "equals" },
672
673
  { value: "neq", label: "not equals" },
673
674
  { value: "gt", label: "greater than" },
@@ -677,8 +678,8 @@ const Ka = [
677
678
  { value: "contains", label: "contains" },
678
679
  { value: "null", label: "is empty" },
679
680
  { value: "nnull", label: "is not empty" }
680
- ], Ba = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), Wa = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), Qa = /* @__PURE__ */ new Set(["boolean"]);
681
- function Va({
681
+ ], Ha = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), Ua = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), Ga = /* @__PURE__ */ new Set(["boolean"]);
682
+ function Ya({
682
683
  rules: a,
683
684
  onChange: l,
684
685
  collection: d
@@ -696,7 +697,7 @@ function Va({
696
697
  if (!v.includes(".")) {
697
698
  const _ = b.find((N) => N.field === v);
698
699
  if (_) {
699
- const N = Ra(h, d ?? "", v);
700
+ const N = Aa(h, d ?? "", v);
700
701
  return { type: _.type, relatedCollection: (N == null ? void 0 : N.one_collection) ?? void 0 };
701
702
  }
702
703
  }
@@ -704,7 +705,7 @@ function Va({
704
705
  }
705
706
  const p = (v, _) => l(a.map((N, C) => C === v ? { ...N, ..._ } : N)), n = (v) => l(a.filter((_, N) => N !== v));
706
707
  function y(v) {
707
- return v ? v.split(".").map(ba).join(" → ") : "";
708
+ return v ? v.split(".").map(Na).join(" → ") : "";
708
709
  }
709
710
  return /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-200 pt-3", children: [
710
711
  /* @__PURE__ */ t(
@@ -714,8 +715,8 @@ function Va({
714
715
  onClick: () => f((v) => !v),
715
716
  className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
716
717
  children: [
717
- o ? /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(pt, { className: "h-3.5 w-3.5" }),
718
- /* @__PURE__ */ e(ct, { className: "h-3 w-3" }),
718
+ o ? /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(ut, { className: "h-3.5 w-3.5" }),
719
+ /* @__PURE__ */ e(dt, { className: "h-3 w-3" }),
719
720
  "Conditions ",
720
721
  /* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
721
722
  a.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy", children: a.length })
@@ -725,14 +726,14 @@ function Va({
725
726
  o && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
726
727
  /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Transition is only offered when all conditions match the record — use two transitions with opposite conditions to branch." }),
727
728
  a.map((v, _) => {
728
- const N = v.op === "null" || v.op === "nnull", C = m(v.field), D = Ba.has(C.type), j = Wa.has(C.type), O = Qa.has(C.type), g = !!C.relatedCollection;
729
+ const N = v.op === "null" || v.op === "nnull", C = m(v.field), D = Ha.has(C.type), j = Ua.has(C.type), O = Ga.has(C.type), g = !!C.relatedCollection;
729
730
  return /* @__PURE__ */ t(
730
731
  "div",
731
732
  {
732
733
  className: "flex flex-wrap items-center gap-2 rounded-lg border border-slate-200 bg-white p-2",
733
734
  children: [
734
735
  /* @__PURE__ */ e("div", { className: "flex-1 min-w-[160px]", children: /* @__PURE__ */ e(
735
- rt,
736
+ it,
736
737
  {
737
738
  collection: d ?? "",
738
739
  fields: b,
@@ -754,23 +755,23 @@ function Va({
754
755
  }
755
756
  ) }),
756
757
  /* @__PURE__ */ e("div", { className: "w-36 shrink-0", children: /* @__PURE__ */ e(
757
- ge,
758
+ be,
758
759
  {
759
760
  value: v.op,
760
761
  onChange: (i) => p(_, { op: i || "eq" }),
761
- options: Ka.map((i) => ({ value: i.value, label: i.label })),
762
+ options: Va.map((i) => ({ value: i.value, label: i.label })),
762
763
  placeholder: "Operator…"
763
764
  }
764
765
  ) }),
765
766
  !N && /* @__PURE__ */ e("div", { className: "flex-1 min-w-[120px]", children: g ? /* @__PURE__ */ e(
766
- za,
767
+ Wa,
767
768
  {
768
769
  relatedCollection: C.relatedCollection,
769
- value: Ma(v.value),
770
+ value: Qa(v.value),
770
771
  onChange: (i) => p(_, { value: i.length === 1 ? i[0] : i })
771
772
  }
772
773
  ) : O ? /* @__PURE__ */ e(
773
- ge,
774
+ be,
774
775
  {
775
776
  value: String(v.value ?? ""),
776
777
  onChange: (i) => p(_, { value: i }),
@@ -821,7 +822,7 @@ function Va({
821
822
  className: "h-7 gap-1 text-[12px]",
822
823
  onClick: () => l([...a, { field: "", op: "eq", value: "" }]),
823
824
  children: [
824
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
825
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
825
826
  "Add Condition"
826
827
  ]
827
828
  }
@@ -829,7 +830,7 @@ function Va({
829
830
  ] })
830
831
  ] });
831
832
  }
832
- function Ha({
833
+ function Ja({
833
834
  requirement: a,
834
835
  childRelations: l,
835
836
  onChange: d,
@@ -860,7 +861,7 @@ function Ha({
860
861
  /* @__PURE__ */ t("div", { className: "flex-1 space-y-1.5", children: [
861
862
  /* @__PURE__ */ e(U, { className: "text-[11px]", children: "Child Relation" }),
862
863
  /* @__PURE__ */ e(
863
- ge,
864
+ be,
864
865
  {
865
866
  value: u,
866
867
  onChange: (n) => {
@@ -952,7 +953,7 @@ function Ha({
952
953
  ] })
953
954
  ] });
954
955
  }
955
- function Ua({
956
+ function Xa({
956
957
  requirements: a,
957
958
  onChange: l,
958
959
  collection: d
@@ -972,8 +973,8 @@ function Ua({
972
973
  onClick: () => f((m) => !m),
973
974
  className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
974
975
  children: [
975
- o ? /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(pt, { className: "h-3.5 w-3.5" }),
976
- /* @__PURE__ */ e(Mt, { className: "h-3 w-3" }),
976
+ o ? /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(ut, { className: "h-3.5 w-3.5" }),
977
+ /* @__PURE__ */ e(Bt, { className: "h-3 w-3" }),
977
978
  "Requirements ",
978
979
  /* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
979
980
  a.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy", children: a.length })
@@ -983,7 +984,7 @@ function Ua({
983
984
  o && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
984
985
  /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Block this transition until every row of a child relation has the listed fields filled in. Prompts the user with a fill-in dialog when rows are incomplete." }),
985
986
  a.map((m, p) => /* @__PURE__ */ e(
986
- Ha,
987
+ Ja,
987
988
  {
988
989
  requirement: m,
989
990
  childRelations: u,
@@ -1004,7 +1005,7 @@ function Ua({
1004
1005
  { type: "child_fields", collection: "", fk_field: "", fields: [] }
1005
1006
  ]),
1006
1007
  children: [
1007
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
1008
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
1008
1009
  "Add Requirement"
1009
1010
  ]
1010
1011
  }
@@ -1025,7 +1026,7 @@ function Fe({
1025
1026
  return /* @__PURE__ */ t("div", { className: "space-y-1", children: [
1026
1027
  /* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: a }),
1027
1028
  /* @__PURE__ */ e(
1028
- zt,
1029
+ Qt,
1029
1030
  {
1030
1031
  value: f,
1031
1032
  onChange: (b) => {
@@ -1052,7 +1053,7 @@ function Fe({
1052
1053
  r && /* @__PURE__ */ e("p", { className: "text-[10.5px] text-red-500", children: "Invalid JSON — not saved yet." })
1053
1054
  ] });
1054
1055
  }
1055
- function Ga({
1056
+ function Ia({
1056
1057
  actions: a,
1057
1058
  onChange: l
1058
1059
  }) {
@@ -1065,7 +1066,7 @@ function Ga({
1065
1066
  onClick: () => x((c) => !c),
1066
1067
  className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
1067
1068
  children: [
1068
- d ? /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(pt, { className: "h-3.5 w-3.5" }),
1069
+ d ? /* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(ut, { className: "h-3.5 w-3.5" }),
1069
1070
  "Actions",
1070
1071
  a.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] font-medium text-teal-700", children: a.length })
1071
1072
  ]
@@ -1092,7 +1093,7 @@ function Ga({
1092
1093
  children: [
1093
1094
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
1094
1095
  /* @__PURE__ */ e(
1095
- ge,
1096
+ be,
1096
1097
  {
1097
1098
  value: c.type,
1098
1099
  onChange: (u) => o(r, { type: u }),
@@ -1192,7 +1193,7 @@ function Ga({
1192
1193
  /* @__PURE__ */ t("div", { className: "space-y-1", children: [
1193
1194
  /* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: "Payload template (Liquid — must render to valid JSON)" }),
1194
1195
  /* @__PURE__ */ e(
1195
- zt,
1196
+ Qt,
1196
1197
  {
1197
1198
  value: c.payload_template ?? "",
1198
1199
  onChange: (u) => o(r, { payload_template: u.target.value }),
@@ -1274,7 +1275,7 @@ function Ga({
1274
1275
  className: "h-7 gap-1 text-[12px]",
1275
1276
  onClick: () => l([...a, { type: "erp_submit" }]),
1276
1277
  children: [
1277
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
1278
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
1278
1279
  "Add action"
1279
1280
  ]
1280
1281
  }
@@ -1282,7 +1283,7 @@ function Ga({
1282
1283
  ] })
1283
1284
  ] });
1284
1285
  }
1285
- function lt({
1286
+ function rt({
1286
1287
  initial: a,
1287
1288
  states: l,
1288
1289
  collection: d,
@@ -1327,7 +1328,7 @@ function lt({
1327
1328
  /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
1328
1329
  /* @__PURE__ */ e(U, { className: "text-[12px]", children: "From State" }),
1329
1330
  /* @__PURE__ */ e(
1330
- ge,
1331
+ be,
1331
1332
  {
1332
1333
  value: r.from_state ?? "",
1333
1334
  onChange: (n) => b("from_state", n || null),
@@ -1341,7 +1342,7 @@ function lt({
1341
1342
  /* @__PURE__ */ e(U, { className: "text-[12px]", children: r.to_previous ? "Fallback state" : `To State${r.to_states.length !== 1 ? "s" : ""}` }),
1342
1343
  r.to_previous && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "The real target is the record's previous state — this only applies when history can't answer (the record started in this state, or the prior state was removed)." }),
1343
1344
  /* @__PURE__ */ e(
1344
- ja,
1345
+ Ka,
1345
1346
  {
1346
1347
  values: r.to_states,
1347
1348
  onChange: (n) => b("to_states", n),
@@ -1367,7 +1368,7 @@ function lt({
1367
1368
  r.to_states.filter((q) => q !== n)
1368
1369
  ),
1369
1370
  className: "opacity-70 hover:opacity-100",
1370
- children: /* @__PURE__ */ e(be, { className: "h-2.5 w-2.5" })
1371
+ children: /* @__PURE__ */ e(ye, { className: "h-2.5 w-2.5" })
1371
1372
  }
1372
1373
  )
1373
1374
  ]
@@ -1379,10 +1380,10 @@ function lt({
1379
1380
  ] }),
1380
1381
  !x && /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
1381
1382
  /* @__PURE__ */ e(U, { className: "text-[12px]", children: "Color" }),
1382
- /* @__PURE__ */ e(Ge, { value: r.color, onChange: (n) => b("color", n) })
1383
+ /* @__PURE__ */ e(Ye, { value: r.color, onChange: (n) => b("color", n) })
1383
1384
  ] }),
1384
1385
  /* @__PURE__ */ e(
1385
- Va,
1386
+ Ya,
1386
1387
  {
1387
1388
  rules: r.condition_rules ?? [],
1388
1389
  onChange: (n) => b("condition_rules", n),
@@ -1390,7 +1391,7 @@ function lt({
1390
1391
  }
1391
1392
  ),
1392
1393
  /* @__PURE__ */ e(
1393
- Ua,
1394
+ Xa,
1394
1395
  {
1395
1396
  requirements: r.requirements ?? [],
1396
1397
  onChange: (n) => b("requirements", n.length > 0 ? n : null),
@@ -1398,7 +1399,7 @@ function lt({
1398
1399
  }
1399
1400
  ),
1400
1401
  /* @__PURE__ */ e(
1401
- Ga,
1402
+ Ia,
1402
1403
  {
1403
1404
  actions: r.actions ?? [],
1404
1405
  onChange: (n) => b("actions", n.length > 0 ? n : null)
@@ -1513,19 +1514,19 @@ function lt({
1513
1514
  ] })
1514
1515
  ] });
1515
1516
  }
1516
- function Ya(a) {
1517
+ function Za(a) {
1517
1518
  var x, o;
1518
1519
  const l = ((x = a.first_name) == null ? void 0 : x[0]) ?? "", d = ((o = a.last_name) == null ? void 0 : o[0]) ?? "";
1519
1520
  return (l + d).toUpperCase() || a.email[0].toUpperCase();
1520
1521
  }
1521
- function Ja(a) {
1522
+ function es(a) {
1522
1523
  const l = a.filter((o) => !o.filters || o.filters.length === 0), d = /* @__PURE__ */ new Set(), x = [];
1523
1524
  for (const o of l)
1524
1525
  for (const f of o.users)
1525
1526
  d.has(f.user) || (d.add(f.user), x.push(f));
1526
1527
  return x;
1527
1528
  }
1528
- function Xa({
1529
+ function ts({
1529
1530
  users: a,
1530
1531
  filteredCount: l
1531
1532
  }) {
@@ -1538,7 +1539,7 @@ function Xa({
1538
1539
  {
1539
1540
  title: `${o.first_name ?? ""} ${o.last_name ?? ""}`.trim() || o.email,
1540
1541
  className: "h-5 w-5 rounded-full bg-nvr-cyan/20 border border-white flex items-center justify-center text-[9px] font-semibold text-nvr-cyan",
1541
- children: Ya(o)
1542
+ children: Za(o)
1542
1543
  },
1543
1544
  o.user
1544
1545
  )),
@@ -1561,7 +1562,7 @@ function Xa({
1561
1562
  )
1562
1563
  ] });
1563
1564
  }
1564
- function Ia({
1565
+ function as({
1565
1566
  s: a,
1566
1567
  groups: l,
1567
1568
  expandedStateId: d,
@@ -1569,7 +1570,7 @@ function Ia({
1569
1570
  onEdit: o,
1570
1571
  onDelete: f
1571
1572
  }) {
1572
- const { attributes: c, listeners: r, setNodeRef: u, transform: b, transition: h, isDragging: m } = it({
1573
+ const { attributes: c, listeners: r, setNodeRef: u, transform: b, transition: h, isDragging: m } = ot({
1573
1574
  id: a.id
1574
1575
  });
1575
1576
  return /* @__PURE__ */ e(
@@ -1577,7 +1578,7 @@ function Ia({
1577
1578
  {
1578
1579
  ref: u,
1579
1580
  style: {
1580
- transform: ot.Transform.toString(b),
1581
+ transform: ct.Transform.toString(b),
1581
1582
  transition: h,
1582
1583
  opacity: m ? 0.4 : 1
1583
1584
  },
@@ -1590,7 +1591,7 @@ function Ia({
1590
1591
  ...r,
1591
1592
  className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 transition-colors shrink-0",
1592
1593
  tabIndex: -1,
1593
- children: /* @__PURE__ */ e(dt, { className: "h-3.5 w-3.5" })
1594
+ children: /* @__PURE__ */ e(mt, { className: "h-3.5 w-3.5" })
1594
1595
  }
1595
1596
  ),
1596
1597
  /* @__PURE__ */ e(
@@ -1608,9 +1609,9 @@ function Ia({
1608
1609
  a.lock_record && /* @__PURE__ */ e(_e, { variant: "outline", className: "text-[10px] h-4 px-1", children: "locked" })
1609
1610
  ] }) }),
1610
1611
  /* @__PURE__ */ e(
1611
- Xa,
1612
+ ts,
1612
1613
  {
1613
- users: Ja(l),
1614
+ users: es(l),
1614
1615
  filteredCount: l.filter((p) => p.filters && p.filters.length > 0).length
1615
1616
  }
1616
1617
  ),
@@ -1622,7 +1623,7 @@ function Ia({
1622
1623
  onClick: x,
1623
1624
  className: "rounded p-1 text-slate-400 hover:text-slate-700",
1624
1625
  title: "Configure owners & skip",
1625
- children: /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" })
1626
+ children: /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" })
1626
1627
  }
1627
1628
  ),
1628
1629
  /* @__PURE__ */ e(
@@ -1648,14 +1649,14 @@ function Ia({
1648
1649
  }
1649
1650
  );
1650
1651
  }
1651
- function Za({
1652
+ function ss({
1652
1653
  d: a,
1653
1654
  siblings: l,
1654
1655
  onSave: d,
1655
1656
  saving: x
1656
1657
  }) {
1657
1658
  const [o, f] = $(!1), [c, r] = $(a.cascade ?? []);
1658
- ue(() => {
1659
+ he(() => {
1659
1660
  o && r(a.cascade ?? []);
1660
1661
  }, [o, a.cascade]);
1661
1662
  const u = l.filter((b) => b.id !== a.id && !b.is_row_axis);
@@ -1669,7 +1670,7 @@ function Za({
1669
1670
  "rounded p-1 transition-colors",
1670
1671
  (a.cascade ?? []).length > 0 ? "text-nvr-cyan hover:text-nvr-cyan-dark" : "text-slate-400 hover:text-slate-700"
1671
1672
  ),
1672
- children: /* @__PURE__ */ e(ct, { className: "h-3.5 w-3.5" })
1673
+ children: /* @__PURE__ */ e(dt, { className: "h-3.5 w-3.5" })
1673
1674
  }
1674
1675
  ) }),
1675
1676
  /* @__PURE__ */ t(Le, { align: "end", className: "w-[380px] p-3", sideOffset: 4, children: [
@@ -1689,7 +1690,7 @@ function Za({
1689
1690
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
1690
1691
  /* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-[10.5px] font-medium uppercase tracking-wide text-slate-400", children: "Parent" }),
1691
1692
  /* @__PURE__ */ e(
1692
- ge,
1693
+ be,
1693
1694
  {
1694
1695
  value: b.parent_field,
1695
1696
  options: u.map((m) => ({ value: m.field, label: m.label })),
@@ -1704,7 +1705,7 @@ function Za({
1704
1705
  "aria-label": "Remove rule",
1705
1706
  className: "ml-auto text-slate-400 hover:text-red-500",
1706
1707
  onClick: () => r(c.filter((m, p) => p !== h)),
1707
- children: /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
1708
+ children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
1708
1709
  }
1709
1710
  )
1710
1711
  ] }),
@@ -1744,7 +1745,7 @@ function Za({
1744
1745
  onClick: () => r([...c, { parent_field: "", filter: "" }]),
1745
1746
  className: "flex w-full items-center justify-center gap-1 rounded border border-dashed border-slate-300 px-2 py-1.5 text-[12px] text-slate-500 hover:border-nvr-cyan/50 hover:text-nvr-cyan dark:border-border",
1746
1747
  children: [
1747
- /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
1748
+ /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
1748
1749
  " Add cascade rule"
1749
1750
  ]
1750
1751
  }
@@ -1777,7 +1778,7 @@ function Za({
1777
1778
  ] })
1778
1779
  ] });
1779
1780
  }
1780
- function es({
1781
+ function ns({
1781
1782
  d: a,
1782
1783
  siblings: l,
1783
1784
  onEdit: d,
@@ -1785,7 +1786,7 @@ function es({
1785
1786
  onSaveCascade: o,
1786
1787
  cascadeSaving: f
1787
1788
  }) {
1788
- const { attributes: c, listeners: r, setNodeRef: u, transform: b, transition: h, isDragging: m } = it({
1789
+ const { attributes: c, listeners: r, setNodeRef: u, transform: b, transition: h, isDragging: m } = ot({
1789
1790
  id: a.id
1790
1791
  });
1791
1792
  return /* @__PURE__ */ t(
@@ -1793,7 +1794,7 @@ function es({
1793
1794
  {
1794
1795
  ref: u,
1795
1796
  style: {
1796
- transform: ot.Transform.toString(b),
1797
+ transform: ct.Transform.toString(b),
1797
1798
  transition: h,
1798
1799
  opacity: m ? 0.4 : 1
1799
1800
  },
@@ -1807,7 +1808,7 @@ function es({
1807
1808
  ...r,
1808
1809
  className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 transition-colors",
1809
1810
  tabIndex: -1,
1810
- children: /* @__PURE__ */ e(dt, { className: "h-3.5 w-3.5" })
1811
+ children: /* @__PURE__ */ e(mt, { className: "h-3.5 w-3.5" })
1811
1812
  }
1812
1813
  ),
1813
1814
  /* @__PURE__ */ t("div", { className: "flex-1 min-w-0 flex items-center gap-3 flex-wrap", children: [
@@ -1830,7 +1831,7 @@ function es({
1830
1831
  ] }),
1831
1832
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0", children: [
1832
1833
  /* @__PURE__ */ e(
1833
- Za,
1834
+ ss,
1834
1835
  {
1835
1836
  d: a,
1836
1837
  siblings: l,
@@ -1861,18 +1862,18 @@ function es({
1861
1862
  }
1862
1863
  );
1863
1864
  }
1864
- function ts({
1865
+ function ls({
1865
1866
  binding: a,
1866
1867
  templateId: l
1867
1868
  }) {
1868
1869
  var g;
1869
- const d = Z(), x = ve(), o = a.dimensions ?? [], [f, c] = $(() => o.map((i) => i.id));
1870
- ue(() => {
1870
+ const d = Z(), x = Ne(), o = a.dimensions ?? [], [f, c] = $(() => o.map((i) => i.id));
1871
+ he(() => {
1871
1872
  c(o.map((i) => i.id));
1872
1873
  }, [o]);
1873
- const r = f.map((i) => o.find((w) => w.id === i)).filter(Boolean), u = Tt(
1874
- Ue(Dt),
1875
- Ue(At, { coordinateGetter: jt })
1874
+ const r = f.map((i) => o.find((w) => w.id === i)).filter(Boolean), u = jt(
1875
+ Ge(Lt),
1876
+ Ge(Mt, { coordinateGetter: zt })
1876
1877
  ), [b, h] = $(null), [m, p] = $({
1877
1878
  field: "",
1878
1879
  label: "",
@@ -1918,15 +1919,15 @@ function ts({
1918
1919
  }, O = (i) => {
1919
1920
  const { active: w, over: F } = i;
1920
1921
  if (!F || w.id === F.id) return;
1921
- const E = f.indexOf(w.id), B = f.indexOf(F.id), L = He(f, E, B);
1922
- c(L), L.forEach((M, Q) => {
1922
+ const E = f.indexOf(w.id), K = f.indexOf(F.id), L = Ue(f, E, K);
1923
+ c(L), L.forEach((M, W) => {
1923
1924
  var te;
1924
- ((te = o.find((ae) => ae.id === M)) == null ? void 0 : te.sort) !== Q && C.mutate({ dimId: M, body: { sort: Q } });
1925
+ ((te = o.find((ae) => ae.id === M)) == null ? void 0 : te.sort) !== W && C.mutate({ dimId: M, body: { sort: W } });
1925
1926
  });
1926
1927
  };
1927
1928
  return /* @__PURE__ */ t("div", { className: "border-t border-slate-100 bg-slate-50/50 px-4 pt-3 pb-4 space-y-3 rounded-b-lg", children: [
1928
1929
  o.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400 py-0.5", children: "No dimensions — add one below." }),
1929
- o.length > 0 && /* @__PURE__ */ e(Be, { sensors: u, collisionDetection: We, onDragEnd: O, children: /* @__PURE__ */ e(Qe, { items: f, strategy: Ve, children: /* @__PURE__ */ e("div", { className: "space-y-1.5", children: r.map(
1930
+ o.length > 0 && /* @__PURE__ */ e(Qe, { sensors: u, collisionDetection: We, onDragEnd: O, children: /* @__PURE__ */ e(Ve, { items: f, strategy: He, children: /* @__PURE__ */ e("div", { className: "space-y-1.5", children: r.map(
1930
1931
  (i) => b === i.id ? /* @__PURE__ */ t(
1931
1932
  "div",
1932
1933
  {
@@ -1936,7 +1937,7 @@ function ts({
1936
1937
  /* @__PURE__ */ t("div", { className: "space-y-1.5 flex-1 min-w-[160px]", children: [
1937
1938
  /* @__PURE__ */ e(U, { className: "text-[11px] text-slate-500", children: "Field" }),
1938
1939
  /* @__PURE__ */ e(
1939
- rt,
1940
+ it,
1940
1941
  {
1941
1942
  collection: a.collection,
1942
1943
  fields: v,
@@ -2019,7 +2020,7 @@ function ts({
2019
2020
  },
2020
2021
  i.id
2021
2022
  ) : /* @__PURE__ */ e(
2022
- es,
2023
+ ns,
2023
2024
  {
2024
2025
  d: i,
2025
2026
  siblings: r,
@@ -2040,7 +2041,7 @@ function ts({
2040
2041
  /* @__PURE__ */ t("div", { className: "space-y-1.5 flex-1 min-w-[160px]", children: [
2041
2042
  /* @__PURE__ */ e(U, { className: "text-[11px] text-slate-500", children: "Field" }),
2042
2043
  /* @__PURE__ */ e(
2043
- rt,
2044
+ it,
2044
2045
  {
2045
2046
  collection: a.collection,
2046
2047
  fields: v,
@@ -2104,7 +2105,7 @@ function ts({
2104
2105
  disabled: !n.field.trim() || !n.label.trim() || N.isPending,
2105
2106
  onClick: () => N.mutate({ ...n, sort: o.length }),
2106
2107
  children: [
2107
- N.isPending ? /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2108
+ N.isPending ? /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2108
2109
  "Add"
2109
2110
  ]
2110
2111
  }
@@ -2112,77 +2113,83 @@ function ts({
2112
2113
  ] })
2113
2114
  ] });
2114
2115
  }
2115
- function Ys({
2116
+ function en({
2116
2117
  templateId: a,
2117
2118
  onBack: l,
2118
2119
  onExport: d,
2119
2120
  hidden: x
2120
2121
  }) {
2121
- var kt;
2122
- const o = Z(), f = ve(), c = new Set(x ?? []), [r, u] = $(!1), [b, h] = $(""), [m, p] = $(!1), [n, y] = $(null), [q, v] = $(!1), [_, N] = $(null), [C, D] = $(null), [j, O] = $(
2122
+ var St;
2123
+ const o = Z(), f = Ne(), c = new Set(x ?? []), [r, u] = $(!1), [b, h] = $(""), [m, p] = $(!1), [n, y] = $(null), [q, v] = $(!1), [_, N] = $(null), [C, D] = $(null), [j, O] = $(
2123
2124
  null
2124
- ), [g, i] = $(""), [w, F] = $(""), [E, B] = $(null), [L, M] = $(!1), [Q, te] = $([]), ae = Tt(
2125
- Ue(Dt),
2126
- Ue(At, { coordinateGetter: jt })
2127
- ), { data: ce } = G({
2125
+ ), [g, i] = $(""), [w, F] = $(""), [E, K] = $(null), [L, M] = $(!1), [W, te] = $([]), ae = jt(
2126
+ Ge(Lt),
2127
+ Ge(Mt, { coordinateGetter: zt })
2128
+ ), { data: oe } = G({
2128
2129
  queryKey: ["collection-fields", g],
2129
2130
  queryFn: () => o.request(Y(`/collections/${g}`)).then((s) => {
2130
2131
  var k;
2131
2132
  return (((k = s.data) == null ? void 0 : k.fields) ?? []).filter((R) => !R.hidden);
2132
2133
  }),
2133
2134
  enabled: !!g
2134
- }), [de, Xe] = $(null), { data: W, isLoading: Me } = G({
2135
+ }), [ce, Ie] = $(null), {
2136
+ data: B,
2137
+ isLoading: Me,
2138
+ isError: Q,
2139
+ error: X,
2140
+ refetch: de
2141
+ } = G({
2135
2142
  queryKey: ["pipeline-template", a],
2136
2143
  queryFn: () => o.request(Y(`/pipelines/${a}`)).then((s) => s.data),
2137
2144
  enabled: !!a
2138
- }), [K, X] = $([]), [se, Ne] = $({});
2139
- ue(() => {
2140
- const s = (W == null ? void 0 : W.states) ?? [];
2145
+ }), [me, ht] = $([]), [ze, xt] = $({});
2146
+ he(() => {
2147
+ const s = (B == null ? void 0 : B.states) ?? [];
2141
2148
  te(s.map((k) => k.id));
2142
- }, [W == null ? void 0 : W.states]), ue(() => {
2143
- const s = Et((W == null ? void 0 : W.transitions) ?? []);
2144
- X(s.map((k) => k.label)), Ne(
2149
+ }, [B == null ? void 0 : B.states]), he(() => {
2150
+ const s = Pt((B == null ? void 0 : B.transitions) ?? []);
2151
+ ht(s.map((k) => k.label)), xt(
2145
2152
  Object.fromEntries(s.map((k) => [k.label, k.routes.map((R) => R.ids[0])]))
2146
2153
  );
2147
- }, [W == null ? void 0 : W.transitions]);
2148
- const { data: Ht } = G({
2154
+ }, [B == null ? void 0 : B.transitions]);
2155
+ const { data: Yt } = G({
2149
2156
  queryKey: ["collections", "tables_only"],
2150
2157
  queryFn: () => o.request(Y("/collections?tables_only=true")).then((s) => s.data)
2151
- }), { data: Ie } = G({
2158
+ }), { data: Ze } = G({
2152
2159
  queryKey: ["pipeline-all-owner-groups", a],
2153
2160
  queryFn: () => o.request(Y(`/pipelines/${a}/owner-groups`)).then((s) => s.data),
2154
2161
  enabled: !!a
2155
- }), re = () => {
2162
+ }), le = () => {
2156
2163
  f.invalidateQueries({ queryKey: ["pipeline-template", a] }), f.invalidateQueries({ queryKey: ["pipeline-templates"] }), f.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
2157
- }, Ze = z({
2164
+ }, et = z({
2158
2165
  mutationFn: (s) => o.request(we(`/pipelines/${a}`, s)),
2159
2166
  onSuccess: () => {
2160
- re(), u(!1);
2167
+ le(), u(!1);
2161
2168
  },
2162
2169
  onError: () => T.error("Failed to update pipeline")
2163
- }), ut = z({
2170
+ }), ft = z({
2164
2171
  mutationFn: (s) => o.request(J(`/pipelines/${a}/states`, s)),
2165
2172
  onSuccess: () => {
2166
- re(), p(!1);
2173
+ le(), p(!1);
2167
2174
  },
2168
2175
  onError: () => T.error("Failed to add state")
2169
- }), et = z({
2176
+ }), tt = z({
2170
2177
  mutationFn: ({ stateId: s, body: k }) => o.request(we(`/pipelines/states/${s}`, k)),
2171
2178
  onSuccess: () => {
2172
- re(), y(null);
2179
+ le(), y(null);
2173
2180
  },
2174
2181
  onError: () => T.error("Failed to update state")
2175
- }), Ut = z({
2182
+ }), Jt = z({
2176
2183
  mutationFn: (s) => o.request($e(`/pipelines/states/${s}`)),
2177
2184
  onSuccess: () => {
2178
- re(), T.success("State deleted");
2185
+ le(), T.success("State deleted");
2179
2186
  },
2180
2187
  onError: (s) => {
2181
2188
  var R;
2182
2189
  const k = ((R = s == null ? void 0 : s.response) == null ? void 0 : R.error) ?? (s == null ? void 0 : s.message);
2183
2190
  T.error(k || "Failed to delete state", { duration: 9e3 });
2184
2191
  }
2185
- }), ht = z({
2192
+ }), gt = z({
2186
2193
  mutationFn: async (s) => {
2187
2194
  const k = {
2188
2195
  from_state: s.from_state,
@@ -2205,10 +2212,10 @@ function Ys({
2205
2212
  await o.request(J(`/pipelines/${a}/transitions`, { ...k, to_state: R }));
2206
2213
  },
2207
2214
  onSuccess: () => {
2208
- re(), v(!1);
2215
+ le(), v(!1);
2209
2216
  },
2210
2217
  onError: () => T.error("Failed to add transition")
2211
- }), xt = z({
2218
+ }), bt = z({
2212
2219
  mutationFn: async ({
2213
2220
  labelGroup: s,
2214
2221
  data: k
@@ -2235,10 +2242,10 @@ function Ys({
2235
2242
  );
2236
2243
  },
2237
2244
  onSuccess: () => {
2238
- re(), N(null);
2245
+ le(), N(null);
2239
2246
  },
2240
2247
  onError: () => T.error("Failed to add route")
2241
- }), ft = z({
2248
+ }), yt = z({
2242
2249
  mutationFn: async ({ route: s, data: k }) => {
2243
2250
  const R = /* @__PURE__ */ new Map();
2244
2251
  s.to_states.forEach((S, A) => {
@@ -2274,35 +2281,35 @@ function Ys({
2274
2281
  H.has(S) || await o.request($e(`/pipelines/transitions/${A}`));
2275
2282
  },
2276
2283
  onSuccess: () => {
2277
- re(), O(null);
2284
+ le(), O(null);
2278
2285
  },
2279
2286
  onError: (s) => {
2280
2287
  const k = s == null ? void 0 : s.response;
2281
2288
  T.error((k == null ? void 0 : k.error) ?? (s == null ? void 0 : s.message) ?? "Failed to update route");
2282
2289
  }
2283
- }), gt = z({
2290
+ }), vt = z({
2284
2291
  mutationFn: async (s) => {
2285
2292
  for (const k of s) await o.request($e(`/pipelines/transitions/${k}`));
2286
2293
  },
2287
2294
  onSuccess: () => {
2288
- re(), T.success("Deleted");
2295
+ le(), T.success("Deleted");
2289
2296
  },
2290
2297
  onError: () => T.error("Failed to delete")
2291
- }), Gt = z({
2298
+ }), Xt = z({
2292
2299
  mutationFn: async (s) => {
2293
2300
  for (const { id: k, sort: R } of s)
2294
2301
  await o.request(we(`/pipelines/transitions/${k}`, { sort: R }));
2295
2302
  },
2296
- onSuccess: () => re(),
2303
+ onSuccess: () => le(),
2297
2304
  onError: () => T.error("Failed to reorder")
2298
- }), Yt = z({
2305
+ }), It = z({
2299
2306
  mutationFn: async ({ ids: s, color: k }) => {
2300
2307
  for (const R of s)
2301
2308
  await o.request(we(`/pipelines/transitions/${R}`, { color: k }));
2302
2309
  },
2303
- onSuccess: () => re(),
2310
+ onSuccess: () => le(),
2304
2311
  onError: () => T.error("Failed to update color")
2305
- }), [qe, ze] = $(null), Oe = z({
2312
+ }), [qe, Ke] = $(null), Oe = z({
2306
2313
  mutationFn: async ({
2307
2314
  from: s,
2308
2315
  label: k,
@@ -2310,8 +2317,8 @@ function Ys({
2310
2317
  }) => {
2311
2318
  var ee, S;
2312
2319
  if (!R) {
2313
- const ne = ((ee = (await o.request(J(`/pipelines/${a}/transitions/rename`, { from: s, to: k, dry_run: !0 }))).data) == null ? void 0 : ee.references) ?? [];
2314
- if (ne.length > 0) return { pending: { from: s, to: k, references: ne } };
2320
+ const se = ((ee = (await o.request(J(`/pipelines/${a}/transitions/rename`, { from: s, to: k, dry_run: !0 }))).data) == null ? void 0 : ee.references) ?? [];
2321
+ if (se.length > 0) return { pending: { from: s, to: k, references: se } };
2315
2322
  }
2316
2323
  return { done: ((S = (await o.request(
2317
2324
  J(`/pipelines/${a}/transitions/rename`, { from: s, to: k })
@@ -2319,11 +2326,11 @@ function Ys({
2319
2326
  },
2320
2327
  onSuccess: (s, { label: k }) => {
2321
2328
  if ("pending" in s && s.pending) {
2322
- ze(s.pending);
2329
+ Ke(s.pending);
2323
2330
  return;
2324
2331
  }
2325
2332
  const R = "done" in s ? s.done.filter((H) => H.rewritten).length : 0;
2326
- re(), D(null), ze(null), T.success(
2333
+ le(), D(null), Ke(null), T.success(
2327
2334
  R ? `Renamed to "${k}" · ${R} reference${R === 1 ? "" : "s"} updated` : `Renamed to "${k}"`
2328
2335
  );
2329
2336
  },
@@ -2331,72 +2338,81 @@ function Ys({
2331
2338
  const k = s == null ? void 0 : s.response;
2332
2339
  T.error((k == null ? void 0 : k.error) ?? (s == null ? void 0 : s.message) ?? "Failed to rename");
2333
2340
  }
2334
- }), bt = z({
2341
+ }), Nt = z({
2335
2342
  mutationFn: (s) => o.request(J(`/pipelines/${a}/bind`, s)),
2336
2343
  onSuccess: () => {
2337
- re(), i(""), F(""), T.success("Collection bound");
2344
+ le(), i(""), F(""), T.success("Collection bound");
2338
2345
  },
2339
2346
  onError: () => T.error("Failed to bind collection")
2340
- }), Jt = z({
2347
+ }), Zt = z({
2341
2348
  mutationFn: (s) => o.request($e(`/pipelines/bindings/${s}`)),
2342
2349
  onSuccess: () => {
2343
- re(), T.success("Collection unbound");
2350
+ le(), T.success("Collection unbound");
2344
2351
  },
2345
2352
  onError: () => T.error("Failed to unbind")
2346
- }), tt = z({
2353
+ }), at = z({
2347
2354
  mutationFn: ({
2348
2355
  bindingId: s,
2349
2356
  body: k
2350
2357
  }) => o.request(we(`/pipelines/bindings/${s}`, k)),
2351
- onSuccess: () => re(),
2358
+ onSuccess: () => le(),
2352
2359
  onError: () => T.error("Failed to update binding")
2353
2360
  });
2354
- if (Me || !W)
2361
+ if (Q && !B)
2362
+ return /* @__PURE__ */ e(
2363
+ _a,
2364
+ {
2365
+ error: X,
2366
+ what: "this pipeline",
2367
+ onRetry: () => void de()
2368
+ }
2369
+ );
2370
+ if (Me || !B)
2355
2371
  return /* @__PURE__ */ t("div", { className: "p-8 space-y-4", children: [
2356
2372
  /* @__PURE__ */ e(De, { className: "h-8 w-64" }),
2357
2373
  /* @__PURE__ */ e(De, { className: "h-48 rounded-xl" }),
2358
2374
  /* @__PURE__ */ e(De, { className: "h-48 rounded-xl" })
2359
2375
  ] });
2360
- const ie = W.states ?? [], yt = W.transitions ?? [], me = W.bindings ?? [], Xt = Ht ?? [], at = Q.length > 0 ? Q.map((s) => ie.find((k) => k.id === s)).filter(Boolean) : ie, vt = new Map(ie.map((s) => [s.id, s])), st = new Map(Et(yt).map((s) => [s.label, s])), Nt = K.map((s) => st.get(s)).filter((s) => !!s);
2361
- function wt(s, k, R) {
2376
+ const re = B.states ?? [], wt = B.transitions ?? [], pe = B.bindings ?? [], ea = Yt ?? [], st = W.length > 0 ? W.map((s) => re.find((k) => k.id === s)).filter(Boolean) : re, kt = new Map(re.map((s) => [s.id, s])), nt = new Map(Pt(wt).map((s) => [s.label, s])), _t = me.map((s) => nt.get(s)).filter((s) => !!s);
2377
+ function Ct(s, k, R) {
2362
2378
  const H = [];
2363
2379
  let ee = 0;
2364
2380
  for (const S of s) {
2365
2381
  const A = R.get(S);
2366
2382
  if (A)
2367
- for (const ne of k[S] ?? []) {
2368
- const he = A.routes.find((pe) => pe.ids[0] === ne);
2369
- if (he) {
2370
- for (const pe of he.ids) H.push({ id: pe, sort: ee });
2383
+ for (const se of k[S] ?? []) {
2384
+ const xe = A.routes.find((ue) => ue.ids[0] === se);
2385
+ if (xe) {
2386
+ for (const ue of xe.ids) H.push({ id: ue, sort: ee });
2371
2387
  ee++;
2372
2388
  }
2373
2389
  }
2374
2390
  }
2375
- Gt.mutate(H);
2391
+ Xt.mutate(H);
2376
2392
  }
2377
- function It(s) {
2393
+ function ta(s) {
2378
2394
  const { active: k, over: R } = s;
2379
2395
  if (!R || k.id === R.id) return;
2380
- const H = He(
2381
- K,
2382
- K.indexOf(k.id),
2383
- K.indexOf(R.id)
2396
+ const H = Ue(
2397
+ me,
2398
+ me.indexOf(k.id),
2399
+ me.indexOf(R.id)
2384
2400
  );
2385
- X(H), wt(H, se, st);
2401
+ ht(H), Ct(H, ze, nt);
2386
2402
  }
2387
- function Zt(s, k) {
2403
+ function aa(s, k) {
2388
2404
  const { active: R, over: H } = k;
2389
2405
  if (!H || R.id === H.id) return;
2390
- const ee = se[s] ?? [], S = He(ee, ee.indexOf(R.id), ee.indexOf(H.id)), A = { ...se, [s]: S };
2391
- Ne(A), wt(K, A, st);
2406
+ const ee = ze[s] ?? [], S = Ue(ee, ee.indexOf(R.id), ee.indexOf(H.id)), A = { ...ze, [s]: S };
2407
+ xt(A), Ct(me, A, nt);
2392
2408
  }
2393
- const ea = me.some((s) => (s.dimensions ?? []).length > 0), ta = new Set(me.map((s) => s.collection)), aa = Xt.filter((s) => !ta.has(s.collection)), sa = (s) => {
2409
+ const sa = pe.some((s) => (s.dimensions ?? []).length > 0), na = new Set(pe.map((s) => s.collection)), la = ea.filter((s) => !na.has(s.collection)), ra = (s) => {
2394
2410
  const { active: k, over: R } = s;
2395
2411
  if (!R || k.id === R.id) return;
2396
- const H = Q.indexOf(k.id), ee = Q.indexOf(R.id), S = He(Q, H, ee);
2397
- te(S), S.forEach((A, ne) => {
2398
- var he;
2399
- ((he = ie.find((pe) => pe.id === A)) == null ? void 0 : he.sort) !== ne && et.mutate({ stateId: A, body: { sort: ne } });
2412
+ const H = W.indexOf(k.id), ee = W.indexOf(R.id), S = Ue(W, H, ee);
2413
+ te(S), S.forEach((A, se) => {
2414
+ var xe;
2415
+ ((xe = re.find((ue) => ue.id === A)) == null ? void 0 : xe.sort) !== se && tt.mutate({ stateId: A, body: { sort: se } });
2400
2416
  });
2401
2417
  };
2402
2418
  return /* @__PURE__ */ t(ke, { children: [
@@ -2410,7 +2426,7 @@ function Ys({
2410
2426
  onClick: l,
2411
2427
  className: "flex items-center gap-1 text-slate-400 transition-colors hover:text-slate-700",
2412
2428
  children: [
2413
- /* @__PURE__ */ e(na, { className: "h-3.5 w-3.5" }),
2429
+ /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5" }),
2414
2430
  "Pipelines"
2415
2431
  ]
2416
2432
  }
@@ -2422,7 +2438,7 @@ function Ys({
2422
2438
  {
2423
2439
  className: "flex items-center gap-1.5",
2424
2440
  onSubmit: (s) => {
2425
- s.preventDefault(), b.trim() && Ze.mutate({ name: b.trim() });
2441
+ s.preventDefault(), b.trim() && et.mutate({ name: b.trim() });
2426
2442
  },
2427
2443
  children: [
2428
2444
  /* @__PURE__ */ e(
@@ -2434,7 +2450,7 @@ function Ys({
2434
2450
  className: "h-7 text-[13px] w-48"
2435
2451
  }
2436
2452
  ),
2437
- /* @__PURE__ */ e(P, { type: "submit", size: "sm", variant: "ghost", className: "h-7 px-1.5", children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" }) }),
2453
+ /* @__PURE__ */ e(P, { type: "submit", size: "sm", variant: "ghost", className: "h-7 px-1.5", children: /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }) }),
2438
2454
  /* @__PURE__ */ e(
2439
2455
  P,
2440
2456
  {
@@ -2443,7 +2459,7 @@ function Ys({
2443
2459
  variant: "ghost",
2444
2460
  className: "h-7 px-1.5",
2445
2461
  onClick: () => u(!1),
2446
- children: /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
2462
+ children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
2447
2463
  }
2448
2464
  )
2449
2465
  ]
@@ -2454,10 +2470,10 @@ function Ys({
2454
2470
  type: "button",
2455
2471
  className: "flex items-center gap-1.5 font-medium text-slate-800 hover:text-slate-600",
2456
2472
  onClick: () => {
2457
- h(W.name), u(!0);
2473
+ h(B.name), u(!0);
2458
2474
  },
2459
2475
  children: [
2460
- W.name,
2476
+ B.name,
2461
2477
  /* @__PURE__ */ e(Te, { className: "h-3 w-3 text-slate-400" })
2462
2478
  ]
2463
2479
  }
@@ -2476,7 +2492,7 @@ function Ys({
2476
2492
  }
2477
2493
  },
2478
2494
  children: [
2479
- /* @__PURE__ */ e(la, { className: "mr-1.5 h-3.5 w-3.5" }),
2495
+ /* @__PURE__ */ e(oa, { className: "mr-1.5 h-3.5 w-3.5" }),
2480
2496
  " Export"
2481
2497
  ]
2482
2498
  }
@@ -2489,12 +2505,12 @@ function Ys({
2489
2505
  /* @__PURE__ */ e(
2490
2506
  V,
2491
2507
  {
2492
- defaultValue: W.description ?? "",
2508
+ defaultValue: B.description ?? "",
2493
2509
  placeholder: "What does this pipeline govern?",
2494
2510
  className: "text-[13px]",
2495
2511
  onBlur: (s) => {
2496
2512
  const k = s.target.value.trim() || null;
2497
- k !== W.description && Ze.mutate({ description: k });
2513
+ k !== B.description && et.mutate({ description: k });
2498
2514
  }
2499
2515
  }
2500
2516
  )
@@ -2502,16 +2518,16 @@ function Ys({
2502
2518
  /* @__PURE__ */ t("div", { className: "shrink-0 space-y-1.5", children: [
2503
2519
  /* @__PURE__ */ e(U, { className: "text-[12px]", children: "Accent color" }),
2504
2520
  /* @__PURE__ */ e(
2505
- Ge,
2521
+ Ye,
2506
2522
  {
2507
- value: W.color,
2508
- onChange: (s) => Ze.mutate({ color: s })
2523
+ value: B.color,
2524
+ onChange: (s) => et.mutate({ color: s })
2509
2525
  }
2510
2526
  )
2511
2527
  ] })
2512
2528
  ] }),
2513
2529
  /* @__PURE__ */ e(
2514
- ya,
2530
+ wa,
2515
2531
  {
2516
2532
  kind: "config",
2517
2533
  params: { type: "pipeline", id: a },
@@ -2523,7 +2539,7 @@ function Ys({
2523
2539
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
2524
2540
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
2525
2541
  "States",
2526
- /* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children: ie.length }),
2542
+ /* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children: re.length }),
2527
2543
  /* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "The stages a record moves through, in order. Each can carry skip rules and stage-track visibility." })
2528
2544
  ] }),
2529
2545
  !m && /* @__PURE__ */ t(
@@ -2534,73 +2550,73 @@ function Ys({
2534
2550
  className: "gap-1.5 text-[12px] h-7",
2535
2551
  onClick: () => p(!0),
2536
2552
  children: [
2537
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2553
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2538
2554
  "Add State"
2539
2555
  ]
2540
2556
  }
2541
2557
  )
2542
2558
  ] }),
2543
- ie.length === 0 && !m && /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-400", children: "No states yet. States define the stages a record can be in." }),
2559
+ re.length === 0 && !m && /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-400", children: "No states yet. States define the stages a record can be in." }),
2544
2560
  /* @__PURE__ */ e(
2545
- Be,
2561
+ Qe,
2546
2562
  {
2547
2563
  sensors: ae,
2548
2564
  collisionDetection: We,
2549
- onDragEnd: sa,
2550
- children: /* @__PURE__ */ e(Qe, { items: Q, strategy: Ve, children: /* @__PURE__ */ t("div", { className: "space-y-2", children: [
2551
- at.map((s) => {
2565
+ onDragEnd: ra,
2566
+ children: /* @__PURE__ */ e(Ve, { items: W, strategy: He, children: /* @__PURE__ */ t("div", { className: "space-y-2", children: [
2567
+ st.map((s) => {
2552
2568
  var k, R;
2553
2569
  return /* @__PURE__ */ t("div", { children: [
2554
2570
  (n == null ? void 0 : n.id) === s.id ? /* @__PURE__ */ e(
2555
- $t,
2571
+ Ot,
2556
2572
  {
2557
2573
  initial: s,
2558
- saving: et.isPending,
2559
- onSave: (H) => et.mutate({ stateId: s.id, body: H }),
2574
+ saving: tt.isPending,
2575
+ onSave: (H) => tt.mutate({ stateId: s.id, body: H }),
2560
2576
  onCancel: () => y(null)
2561
2577
  }
2562
2578
  ) : /* @__PURE__ */ e(
2563
- Ia,
2579
+ as,
2564
2580
  {
2565
2581
  s,
2566
- groups: (Ie == null ? void 0 : Ie[s.id]) ?? [],
2582
+ groups: (Ze == null ? void 0 : Ze[s.id]) ?? [],
2567
2583
  expandedStateId: E,
2568
- onToggleExpand: () => B(E === s.id ? null : s.id),
2584
+ onToggleExpand: () => K(E === s.id ? null : s.id),
2569
2585
  onEdit: () => y(s),
2570
2586
  onDelete: () => {
2571
- confirm(`Delete state "${s.label}"?`) && Ut.mutate(s.id);
2587
+ confirm(`Delete state "${s.label}"?`) && Jt.mutate(s.id);
2572
2588
  }
2573
2589
  }
2574
2590
  ),
2575
2591
  E === s.id && (n == null ? void 0 : n.id) !== s.id && /* @__PURE__ */ t("div", { className: "ml-4 mb-2 mt-2 rounded-xl border border-slate-200 bg-slate-50 p-4 space-y-4", children: [
2576
2592
  /* @__PURE__ */ e(
2577
- Oa,
2593
+ Da,
2578
2594
  {
2579
2595
  stateId: s.id,
2580
2596
  stateName: s.label,
2581
2597
  templateId: a,
2582
- collection: (k = me[0]) == null ? void 0 : k.collection
2598
+ collection: (k = pe[0]) == null ? void 0 : k.collection
2583
2599
  }
2584
2600
  ),
2585
2601
  /* @__PURE__ */ e("div", { className: "border-t border-slate-200 pt-4", children: /* @__PURE__ */ e(
2586
- Ea,
2602
+ Ta,
2587
2603
  {
2588
2604
  stateId: s.id,
2589
2605
  stateName: s.label,
2590
2606
  templateId: a,
2591
2607
  initialCriteria: s.skip_criteria ?? null,
2592
- collection: (R = me[0]) == null ? void 0 : R.collection
2608
+ collection: (R = pe[0]) == null ? void 0 : R.collection
2593
2609
  }
2594
2610
  ) })
2595
2611
  ] })
2596
2612
  ] }, s.id);
2597
2613
  }),
2598
2614
  m && /* @__PURE__ */ e(
2599
- $t,
2615
+ Ot,
2600
2616
  {
2601
2617
  initial: {},
2602
- saving: ut.isPending,
2603
- onSave: (s) => ut.mutate({ ...s, sort: ie.length }),
2618
+ saving: ft.isPending,
2619
+ onSave: (s) => ft.mutate({ ...s, sort: re.length }),
2604
2620
  onCancel: () => p(!1)
2605
2621
  }
2606
2622
  )
@@ -2612,7 +2628,7 @@ function Ys({
2612
2628
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
2613
2629
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
2614
2630
  "Transitions",
2615
- /* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children: yt.length }),
2631
+ /* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children: wt.length }),
2616
2632
  /* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "The allowed moves between states — who may take them, the conditions that gate them, and the actions they fire." })
2617
2633
  ] }),
2618
2634
  !q && /* @__PURE__ */ t(
@@ -2622,28 +2638,28 @@ function Ys({
2622
2638
  variant: "outline",
2623
2639
  className: "gap-1.5 text-[12px] h-7",
2624
2640
  onClick: () => v(!0),
2625
- disabled: ie.length < 2,
2641
+ disabled: re.length < 2,
2626
2642
  children: [
2627
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2643
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2628
2644
  "Add Transition"
2629
2645
  ]
2630
2646
  }
2631
2647
  )
2632
2648
  ] }),
2633
- ie.length < 2 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Add at least 2 states before defining transitions." }),
2649
+ re.length < 2 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Add at least 2 states before defining transitions." }),
2634
2650
  /* @__PURE__ */ t("div", { className: "space-y-3", children: [
2635
2651
  /* @__PURE__ */ e(
2636
- Be,
2652
+ Qe,
2637
2653
  {
2638
2654
  sensors: ae,
2639
2655
  collisionDetection: We,
2640
- onDragEnd: It,
2641
- children: /* @__PURE__ */ e(Qe, { items: K, strategy: Ve, children: Nt.map((s) => {
2656
+ onDragEnd: ta,
2657
+ children: /* @__PURE__ */ e(Ve, { items: me, strategy: He, children: _t.map((s) => {
2642
2658
  var ee;
2643
- const k = new Map(s.routes.map((S) => [S.ids[0], S])), R = se[s.label] ?? s.routes.map((S) => S.ids[0]), H = R.map((S) => k.get(S)).filter((S) => !!S);
2644
- return /* @__PURE__ */ e(Ot, { id: s.label, children: /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white", children: [
2659
+ const k = new Map(s.routes.map((S) => [S.ids[0], S])), R = ze[s.label] ?? s.routes.map((S) => S.ids[0]), H = R.map((S) => k.get(S)).filter((S) => !!S);
2660
+ return /* @__PURE__ */ e(Tt, { id: s.label, children: /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white", children: [
2645
2661
  /* @__PURE__ */ t("div", { className: "group/hdr flex items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-3 py-2", children: [
2646
- /* @__PURE__ */ e(Rt, {}),
2662
+ /* @__PURE__ */ e(Dt, {}),
2647
2663
  /* @__PURE__ */ t(Ae, { children: [
2648
2664
  /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
2649
2665
  "button",
@@ -2663,12 +2679,12 @@ function Ys({
2663
2679
  children: [
2664
2680
  /* @__PURE__ */ e("p", { className: "mb-2 text-[11px] font-medium text-slate-500", children: "Group color" }),
2665
2681
  /* @__PURE__ */ e(
2666
- Ge,
2682
+ Ye,
2667
2683
  {
2668
2684
  value: s.color,
2669
2685
  onChange: (S) => {
2670
- const A = s.routes.flatMap((ne) => ne.ids);
2671
- Yt.mutate({ ids: A, color: S });
2686
+ const A = s.routes.flatMap((se) => se.ids);
2687
+ It.mutate({ ids: A, color: S });
2672
2688
  }
2673
2689
  }
2674
2690
  )
@@ -2677,9 +2693,9 @@ function Ys({
2677
2693
  )
2678
2694
  ] }),
2679
2695
  (C == null ? void 0 : C.from) === s.label ? (() => {
2680
- const S = C.value, A = S.trim(), ne = A !== s.label && Nt.some((oe) => oe.label === A), he = A.length > 0 && A !== s.label && !ne, pe = () => {
2681
- !he || Oe.isPending || (qe && qe.to !== A && ze(null), Oe.mutate({ from: s.label, label: A }));
2682
- }, le = (qe == null ? void 0 : qe.from) === s.label && qe.to === A ? qe.references : null;
2696
+ const S = C.value, A = S.trim(), se = A !== s.label && _t.some((ie) => ie.label === A), xe = A.length > 0 && A !== s.label && !se, ue = () => {
2697
+ !xe || Oe.isPending || (qe && qe.to !== A && Ke(null), Oe.mutate({ from: s.label, label: A }));
2698
+ }, ne = (qe == null ? void 0 : qe.from) === s.label && qe.to === A ? qe.references : null;
2683
2699
  return /* @__PURE__ */ t(
2684
2700
  "div",
2685
2701
  {
@@ -2691,27 +2707,27 @@ function Ys({
2691
2707
  {
2692
2708
  autoFocus: !0,
2693
2709
  value: S,
2694
- onChange: (oe) => D({
2710
+ onChange: (ie) => D({
2695
2711
  from: s.label,
2696
- value: oe.target.value
2712
+ value: ie.target.value
2697
2713
  }),
2698
- onKeyDown: (oe) => {
2699
- oe.key === "Enter" && (oe.preventDefault(), pe()), oe.key === "Escape" && D(null);
2714
+ onKeyDown: (ie) => {
2715
+ ie.key === "Enter" && (ie.preventDefault(), ue()), ie.key === "Escape" && D(null);
2700
2716
  },
2701
2717
  "aria-label": "Button label",
2702
2718
  className: "h-7 max-w-[260px] text-[13px] font-semibold"
2703
2719
  }
2704
2720
  ),
2705
- ne && /* @__PURE__ */ e("span", { className: "text-[11px] text-amber-700", children: "already a button — pick another name" }),
2721
+ se && /* @__PURE__ */ e("span", { className: "text-[11px] text-amber-700", children: "already a button — pick another name" }),
2706
2722
  /* @__PURE__ */ e(
2707
2723
  "button",
2708
2724
  {
2709
2725
  type: "button",
2710
- onClick: pe,
2711
- disabled: !he || Oe.isPending,
2726
+ onClick: ue,
2727
+ disabled: !xe || Oe.isPending,
2712
2728
  title: "Save (Enter)",
2713
2729
  className: "rounded p-1 text-emerald-600 hover:bg-emerald-50 disabled:opacity-40",
2714
- children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
2730
+ children: /* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" })
2715
2731
  }
2716
2732
  ),
2717
2733
  /* @__PURE__ */ e(
@@ -2719,24 +2735,24 @@ function Ys({
2719
2735
  {
2720
2736
  type: "button",
2721
2737
  onClick: () => {
2722
- D(null), ze(null);
2738
+ D(null), Ke(null);
2723
2739
  },
2724
2740
  title: "Cancel (Esc)",
2725
2741
  className: "rounded p-1 text-slate-400 hover:bg-slate-100",
2726
- children: /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
2742
+ children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
2727
2743
  }
2728
2744
  ),
2729
- le && /* @__PURE__ */ t(
2745
+ ne && /* @__PURE__ */ t(
2730
2746
  "div",
2731
2747
  {
2732
2748
  className: "basis-full rounded-md border border-amber-200 bg-amber-50 px-2.5 py-2 text-[11.5px] text-amber-900 dark:border-amber-700/50 dark:bg-amber-900/20 dark:text-amber-100",
2733
- "data-transition-rename-refs": le.length,
2749
+ "data-transition-rename-refs": ne.length,
2734
2750
  children: [
2735
2751
  /* @__PURE__ */ t("p", { className: "font-medium", children: [
2736
- le.length,
2752
+ ne.length,
2737
2753
  " other",
2738
2754
  " ",
2739
- le.length === 1 ? "thing names" : "things name",
2755
+ ne.length === 1 ? "thing names" : "things name",
2740
2756
  " ",
2741
2757
  "“",
2742
2758
  s.label,
@@ -2744,7 +2760,7 @@ function Ys({
2744
2760
  A,
2745
2761
  "”:"
2746
2762
  ] }),
2747
- /* @__PURE__ */ e("ul", { className: "mt-1 list-disc pl-4", children: le.map((oe) => /* @__PURE__ */ e("li", { children: oe.description }, `${oe.kind}:${oe.id}`)) }),
2763
+ /* @__PURE__ */ e("ul", { className: "mt-1 list-disc pl-4", children: ne.map((ie) => /* @__PURE__ */ e("li", { children: ie.description }, `${ie.kind}:${ie.id}`)) }),
2748
2764
  /* @__PURE__ */ t(
2749
2765
  "button",
2750
2766
  {
@@ -2759,7 +2775,7 @@ function Ys({
2759
2775
  className: "mt-1.5 rounded bg-amber-600 px-2 py-0.5 text-[11px] font-medium text-white hover:bg-amber-700 disabled:opacity-50",
2760
2776
  children: [
2761
2777
  "Rename and update ",
2762
- le.length
2778
+ ne.length
2763
2779
  ]
2764
2780
  }
2765
2781
  )
@@ -2796,7 +2812,7 @@ function Ys({
2796
2812
  onClick: () => N(s.label),
2797
2813
  className: "flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-nvr-cyan opacity-0 hover:bg-nvr-cyan/10 group-hover/hdr:opacity-100 transition-opacity",
2798
2814
  children: [
2799
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
2815
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
2800
2816
  "Add route"
2801
2817
  ]
2802
2818
  }
@@ -2807,7 +2823,7 @@ function Ys({
2807
2823
  type: "button",
2808
2824
  onClick: () => {
2809
2825
  const S = s.routes.flatMap((A) => A.ids);
2810
- confirm(`Delete all routes for "${s.label}"?`) && gt.mutate(S);
2826
+ confirm(`Delete all routes for "${s.label}"?`) && vt.mutate(S);
2811
2827
  },
2812
2828
  className: "rounded p-1 text-slate-300 opacity-0 hover:text-red-500 group-hover/hdr:opacity-100 transition-opacity",
2813
2829
  children: /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5" })
@@ -2815,25 +2831,25 @@ function Ys({
2815
2831
  )
2816
2832
  ] }),
2817
2833
  /* @__PURE__ */ e(
2818
- Be,
2834
+ Qe,
2819
2835
  {
2820
2836
  sensors: ae,
2821
2837
  collisionDetection: We,
2822
- onDragEnd: (S) => Zt(s.label, S),
2838
+ onDragEnd: (S) => aa(s.label, S),
2823
2839
  children: /* @__PURE__ */ e(
2824
- Qe,
2840
+ Ve,
2825
2841
  {
2826
2842
  items: R,
2827
- strategy: Ve,
2843
+ strategy: He,
2828
2844
  children: H.map((S) => {
2829
- var pe;
2830
- const A = `${s.label}|${S.from_state ?? "_any_"}|${S.ids[0]}`, ne = S.from_state ? vt.get(S.from_state) : null;
2845
+ var ue;
2846
+ const A = `${s.label}|${S.from_state ?? "_any_"}|${S.ids[0]}`, se = S.from_state ? kt.get(S.from_state) : null;
2831
2847
  return (j == null ? void 0 : j.label) === s.label && j.route.ids[0] === S.ids[0] ? /* @__PURE__ */ e(
2832
2848
  "div",
2833
2849
  {
2834
2850
  className: "border-b border-slate-100 last:border-0 p-3",
2835
2851
  children: /* @__PURE__ */ e(
2836
- lt,
2852
+ rt,
2837
2853
  {
2838
2854
  initial: {
2839
2855
  from_state: S.from_state,
@@ -2855,26 +2871,26 @@ function Ys({
2855
2871
  actions: S.actions
2856
2872
  },
2857
2873
  fixedLabel: s.label,
2858
- states: ie,
2859
- collection: (pe = me[0]) == null ? void 0 : pe.collection,
2860
- saving: ft.isPending,
2861
- onSave: (le) => ft.mutate({ route: S, data: le }),
2874
+ states: re,
2875
+ collection: (ue = pe[0]) == null ? void 0 : ue.collection,
2876
+ saving: yt.isPending,
2877
+ onSave: (ne) => yt.mutate({ route: S, data: ne }),
2862
2878
  onCancel: () => O(null)
2863
2879
  }
2864
2880
  )
2865
2881
  },
2866
2882
  A
2867
- ) : /* @__PURE__ */ e(Ot, { id: S.ids[0], children: /* @__PURE__ */ t("div", { className: "group/row flex items-center gap-2 border-b border-slate-100 px-3 py-2 last:border-0 hover:bg-slate-50", children: [
2868
- /* @__PURE__ */ e(Rt, {}),
2883
+ ) : /* @__PURE__ */ e(Tt, { id: S.ids[0], children: /* @__PURE__ */ t("div", { className: "group/row flex items-center gap-2 border-b border-slate-100 px-3 py-2 last:border-0 hover:bg-slate-50", children: [
2884
+ /* @__PURE__ */ e(Dt, {}),
2869
2885
  /* @__PURE__ */ t("div", { className: "flex flex-1 min-w-0 flex-wrap items-center gap-1.5 text-[12px]", children: [
2870
- ne ? /* @__PURE__ */ e(qt, { state: ne }) : /* @__PURE__ */ e("span", { className: "italic text-slate-400 text-[11px]", children: "any state" }),
2871
- /* @__PURE__ */ e(Lt, { className: "h-3 w-3 text-slate-300 shrink-0" }),
2872
- S.to_states.map((le, oe) => {
2873
- const _t = vt.get(le);
2874
- return _t ? /* @__PURE__ */ t("span", { className: "flex items-center gap-1", children: [
2875
- oe > 0 && /* @__PURE__ */ e("span", { className: "text-slate-300", children: "·" }),
2876
- /* @__PURE__ */ e(qt, { state: _t, small: !0 })
2877
- ] }, le) : null;
2886
+ se ? /* @__PURE__ */ e(Et, { state: se }) : /* @__PURE__ */ e("span", { className: "italic text-slate-400 text-[11px]", children: "any state" }),
2887
+ /* @__PURE__ */ e(Kt, { className: "h-3 w-3 text-slate-300 shrink-0" }),
2888
+ S.to_states.map((ne, ie) => {
2889
+ const qt = kt.get(ne);
2890
+ return qt ? /* @__PURE__ */ t("span", { className: "flex items-center gap-1", children: [
2891
+ ie > 0 && /* @__PURE__ */ e("span", { className: "text-slate-300", children: "·" }),
2892
+ /* @__PURE__ */ e(Et, { state: qt, small: !0 })
2893
+ ] }, ne) : null;
2878
2894
  }),
2879
2895
  S.auto_trigger && /* @__PURE__ */ t(
2880
2896
  "span",
@@ -2882,7 +2898,7 @@ function Ys({
2882
2898
  className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",
2883
2899
  title: "Automatic — fired by the engine when conditions match; hidden from users",
2884
2900
  children: [
2885
- /* @__PURE__ */ e(ra, { className: "h-2.5 w-2.5" }),
2901
+ /* @__PURE__ */ e(ca, { className: "h-2.5 w-2.5" }),
2886
2902
  "Auto"
2887
2903
  ]
2888
2904
  }
@@ -2919,7 +2935,7 @@ function Ys({
2919
2935
  className: "ml-1 inline-flex items-center gap-1 rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] font-semibold text-teal-700 dark:bg-teal-900/30 dark:text-teal-400",
2920
2936
  title: "Transition actions run after this transition lands",
2921
2937
  children: [
2922
- /* @__PURE__ */ e(ia, { className: "h-2.5 w-2.5" }),
2938
+ /* @__PURE__ */ e(da, { className: "h-2.5 w-2.5" }),
2923
2939
  (S.actions ?? []).length
2924
2940
  ]
2925
2941
  }
@@ -2929,10 +2945,10 @@ function Ys({
2929
2945
  {
2930
2946
  className: "ml-1 inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy",
2931
2947
  title: (S.condition_rules ?? []).map(
2932
- (le) => `${le.field} ${le.op} ${String(le.value ?? "")}`
2948
+ (ne) => `${ne.field} ${ne.op} ${String(ne.value ?? "")}`
2933
2949
  ).join(" AND "),
2934
2950
  children: [
2935
- /* @__PURE__ */ e(ct, { className: "h-2.5 w-2.5" }),
2951
+ /* @__PURE__ */ e(dt, { className: "h-2.5 w-2.5" }),
2936
2952
  (S.condition_rules ?? []).length
2937
2953
  ]
2938
2954
  }
@@ -2953,7 +2969,7 @@ function Ys({
2953
2969
  {
2954
2970
  type: "button",
2955
2971
  onClick: () => {
2956
- confirm("Delete this route?") && gt.mutate(S.ids);
2972
+ confirm("Delete this route?") && vt.mutate(S.ids);
2957
2973
  },
2958
2974
  className: "rounded p-1 text-slate-400 hover:text-red-500",
2959
2975
  children: /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5" })
@@ -2967,14 +2983,14 @@ function Ys({
2967
2983
  }
2968
2984
  ),
2969
2985
  _ === s.label && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 p-3", children: /* @__PURE__ */ e(
2970
- lt,
2986
+ rt,
2971
2987
  {
2972
2988
  initial: { color: s.color },
2973
2989
  fixedLabel: s.label,
2974
- states: ie,
2975
- collection: (ee = me[0]) == null ? void 0 : ee.collection,
2976
- saving: xt.isPending,
2977
- onSave: (S) => xt.mutate({ labelGroup: s, data: S }),
2990
+ states: re,
2991
+ collection: (ee = pe[0]) == null ? void 0 : ee.collection,
2992
+ saving: bt.isPending,
2993
+ onSave: (S) => bt.mutate({ labelGroup: s, data: S }),
2978
2994
  onCancel: () => N(null)
2979
2995
  }
2980
2996
  ) })
@@ -2983,30 +2999,30 @@ function Ys({
2983
2999
  }
2984
3000
  ),
2985
3001
  q && /* @__PURE__ */ e(
2986
- lt,
3002
+ rt,
2987
3003
  {
2988
3004
  initial: {},
2989
- states: ie,
2990
- collection: (kt = me[0]) == null ? void 0 : kt.collection,
2991
- saving: ht.isPending,
2992
- onSave: (s) => ht.mutate(s),
3005
+ states: re,
3006
+ collection: (St = pe[0]) == null ? void 0 : St.collection,
3007
+ saving: gt.isPending,
3008
+ onSave: (s) => gt.mutate(s),
2993
3009
  onCancel: () => v(!1)
2994
3010
  }
2995
3011
  )
2996
3012
  ] })
2997
3013
  ] })
2998
3014
  ] }),
2999
- !c.has("branches") && /* @__PURE__ */ e(is, { templateId: a, states: at }),
3015
+ !c.has("branches") && /* @__PURE__ */ e(ms, { templateId: a, states: st }),
3000
3016
  !c.has("bindings") && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3001
3017
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
3002
3018
  "Applied to Collections",
3003
3019
  /* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "Which collections run this pipeline, and the ownership dimensions (Region, Zone…) the Owner Matrix below resolves against." })
3004
3020
  ] }),
3005
- me.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2", children: me.map((s) => {
3021
+ pe.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2", children: pe.map((s) => {
3006
3022
  var k;
3007
3023
  return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white", children: [
3008
3024
  /* @__PURE__ */ t("div", { className: "flex items-center gap-3 px-4 py-3", children: [
3009
- /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-slate-100", children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5 text-slate-500" }) }),
3025
+ /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-slate-100", children: /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5 text-slate-500" }) }),
3010
3026
  /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
3011
3027
  /* @__PURE__ */ e("span", { className: "font-mono text-[13px] font-medium text-slate-800", children: s.collection }),
3012
3028
  s.state_field && /* @__PURE__ */ t("div", { className: "mt-0.5 text-[11px] text-slate-400", children: [
@@ -3021,7 +3037,7 @@ function Ys({
3021
3037
  {
3022
3038
  type: "checkbox",
3023
3039
  checked: !!s.auto_start,
3024
- onChange: (R) => tt.mutate({
3040
+ onChange: (R) => at.mutate({
3025
3041
  bindingId: s.id,
3026
3042
  body: {
3027
3043
  auto_start: R.target.checked,
@@ -3036,10 +3052,10 @@ function Ys({
3036
3052
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
3037
3053
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Owner fallback:" }),
3038
3054
  /* @__PURE__ */ e(
3039
- ls,
3055
+ cs,
3040
3056
  {
3041
3057
  value: s.owner_fallback_field ?? "",
3042
- onCommit: (R) => tt.mutate({
3058
+ onCommit: (R) => at.mutate({
3043
3059
  bindingId: s.id,
3044
3060
  body: { owner_fallback_field: R || null }
3045
3061
  })
@@ -3049,14 +3065,14 @@ function Ys({
3049
3065
  s.auto_start && /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
3050
3066
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Start in:" }),
3051
3067
  /* @__PURE__ */ e(
3052
- ge,
3068
+ be,
3053
3069
  {
3054
3070
  value: s.auto_start_state ?? "",
3055
- onChange: (R) => tt.mutate({
3071
+ onChange: (R) => at.mutate({
3056
3072
  bindingId: s.id,
3057
3073
  body: { auto_start: !0, auto_start_state: R || null }
3058
3074
  }),
3059
- options: ((W == null ? void 0 : W.states) ?? []).map((R) => ({
3075
+ options: ((B == null ? void 0 : B.states) ?? []).map((R) => ({
3060
3076
  value: R.id,
3061
3077
  label: R.label
3062
3078
  })),
@@ -3073,14 +3089,14 @@ function Ys({
3073
3089
  "button",
3074
3090
  {
3075
3091
  type: "button",
3076
- onClick: () => Xe(de === s.id ? null : s.id),
3092
+ onClick: () => Ie(ce === s.id ? null : s.id),
3077
3093
  className: I(
3078
3094
  "flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
3079
- de === s.id ? "bg-nvr-cyan/10 text-nvr-cyan" : "text-slate-500 hover:bg-slate-100 hover:text-slate-700"
3095
+ ce === s.id ? "bg-nvr-cyan/10 text-nvr-cyan" : "text-slate-500 hover:bg-slate-100 hover:text-slate-700"
3080
3096
  ),
3081
3097
  title: "Configure matrix dimensions",
3082
3098
  children: [
3083
- /* @__PURE__ */ e(oa, { className: "h-3.5 w-3.5" }),
3099
+ /* @__PURE__ */ e(ma, { className: "h-3.5 w-3.5" }),
3084
3100
  "Dimensions",
3085
3101
  (s.dimensions ?? []).length > 0 && /* @__PURE__ */ t("span", { className: "font-mono text-[10px] opacity-70", children: [
3086
3102
  "(",
@@ -3095,26 +3111,26 @@ function Ys({
3095
3111
  {
3096
3112
  type: "button",
3097
3113
  onClick: () => {
3098
- confirm(`Unbind "${s.collection}"?`) && Jt.mutate(s.id);
3114
+ confirm(`Unbind "${s.collection}"?`) && Zt.mutate(s.id);
3099
3115
  },
3100
3116
  className: "rounded p-1.5 text-slate-400 hover:text-red-500 transition-colors",
3101
3117
  title: "Unbind collection",
3102
- children: /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" })
3118
+ children: /* @__PURE__ */ e(pa, { className: "h-3.5 w-3.5" })
3103
3119
  }
3104
3120
  )
3105
3121
  ] })
3106
3122
  ] }),
3107
- de === s.id && /* @__PURE__ */ e(ts, { binding: s, templateId: a })
3123
+ ce === s.id && /* @__PURE__ */ e(ls, { binding: s, templateId: a })
3108
3124
  ] }, s.id);
3109
3125
  }) }),
3110
3126
  /* @__PURE__ */ t("div", { className: "space-y-2 pt-2", children: [
3111
3127
  /* @__PURE__ */ t("div", { className: "flex gap-2", children: [
3112
3128
  /* @__PURE__ */ e(
3113
- ge,
3129
+ be,
3114
3130
  {
3115
3131
  value: g,
3116
3132
  onChange: i,
3117
- options: aa.map((s) => ({
3133
+ options: la.map((s) => ({
3118
3134
  value: s.collection,
3119
3135
  label: s.display_name ?? s.collection
3120
3136
  })),
@@ -3123,11 +3139,11 @@ function Ys({
3123
3139
  }
3124
3140
  ),
3125
3141
  /* @__PURE__ */ e(
3126
- ge,
3142
+ be,
3127
3143
  {
3128
3144
  value: w,
3129
3145
  onChange: F,
3130
- options: (ce ?? []).map((s) => ({
3146
+ options: (oe ?? []).map((s) => ({
3131
3147
  value: s.field,
3132
3148
  label: s.field
3133
3149
  })),
@@ -3143,13 +3159,13 @@ function Ys({
3143
3159
  size: "sm",
3144
3160
  variant: "outline",
3145
3161
  className: "shrink-0 gap-1.5",
3146
- disabled: !g || bt.isPending,
3147
- onClick: () => bt.mutate({
3162
+ disabled: !g || Nt.isPending,
3163
+ onClick: () => Nt.mutate({
3148
3164
  collection: g,
3149
3165
  state_field: w.trim() || void 0
3150
3166
  }),
3151
3167
  children: [
3152
- /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
3168
+ /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
3153
3169
  "Bind"
3154
3170
  ]
3155
3171
  }
@@ -3161,7 +3177,7 @@ function Ys({
3161
3177
  ] })
3162
3178
  ] })
3163
3179
  ] }),
3164
- !c.has("matrix") && ea && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3180
+ !c.has("matrix") && sa && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
3165
3181
  /* @__PURE__ */ t("div", { className: "flex items-start justify-between gap-4", children: [
3166
3182
  /* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
3167
3183
  "Owner Matrix",
@@ -3175,31 +3191,31 @@ function Ys({
3175
3191
  className: "h-7 shrink-0 gap-1.5 text-[12px]",
3176
3192
  onClick: () => M(!0),
3177
3193
  children: [
3178
- /* @__PURE__ */ e(Mt, { className: "h-3.5 w-3.5" }),
3194
+ /* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
3179
3195
  " Manage teams"
3180
3196
  ]
3181
3197
  }
3182
3198
  )
3183
3199
  ] }),
3184
- /* @__PURE__ */ e(Sa, { templateId: a, states: at, bindings: me })
3200
+ /* @__PURE__ */ e(Ea, { templateId: a, states: st, bindings: pe })
3185
3201
  ] }),
3186
- L && /* @__PURE__ */ e(fs, { onClose: () => M(!1) }),
3187
- !c.has("simulator") && /* @__PURE__ */ e(os, { bindings: me }),
3188
- !c.has("canvas") && /* @__PURE__ */ e(us, { templateId: a }),
3189
- !c.has("flow-map") && /* @__PURE__ */ e(hs, { templateId: a }),
3190
- !c.has("cumulative-flow") && /* @__PURE__ */ e(va, { templateId: a }),
3191
- !c.has("replay") && /* @__PURE__ */ e(xs, { templateId: a }),
3192
- !c.has("migration") && /* @__PURE__ */ e(ps, { templateId: a }),
3193
- !c.has("lint") && /* @__PURE__ */ e($a, { templateId: a }),
3194
- !c.has("coverage") && /* @__PURE__ */ e(ms, { templateId: a, states: ie }),
3195
- !c.has("skip-report") && /* @__PURE__ */ e(Fa, { templateId: a }),
3196
- !c.has("ai-review") && /* @__PURE__ */ e(as, { templateId: a }),
3197
- !c.has("versions") && /* @__PURE__ */ e(ss, { templateId: a }),
3198
- !c.has("matrix-versions") && /* @__PURE__ */ e(qa, { templateId: a })
3202
+ L && /* @__PURE__ */ e(vs, { onClose: () => M(!1) }),
3203
+ !c.has("simulator") && /* @__PURE__ */ e(ps, { bindings: pe }),
3204
+ !c.has("canvas") && /* @__PURE__ */ e(gs, { templateId: a }),
3205
+ !c.has("flow-map") && /* @__PURE__ */ e(bs, { templateId: a }),
3206
+ !c.has("cumulative-flow") && /* @__PURE__ */ e(ka, { templateId: a }),
3207
+ !c.has("replay") && /* @__PURE__ */ e(ys, { templateId: a }),
3208
+ !c.has("migration") && /* @__PURE__ */ e(fs, { templateId: a }),
3209
+ !c.has("lint") && /* @__PURE__ */ e(Ra, { templateId: a }),
3210
+ !c.has("coverage") && /* @__PURE__ */ e(xs, { templateId: a, states: re }),
3211
+ !c.has("skip-report") && /* @__PURE__ */ e(Pa, { templateId: a }),
3212
+ !c.has("ai-review") && /* @__PURE__ */ e(rs, { templateId: a }),
3213
+ !c.has("versions") && /* @__PURE__ */ e(is, { templateId: a }),
3214
+ !c.has("matrix-versions") && /* @__PURE__ */ e(Oa, { templateId: a })
3199
3215
  ] })
3200
3216
  ] });
3201
3217
  }
3202
- function as({ templateId: a }) {
3218
+ function rs({ templateId: a }) {
3203
3219
  const l = Z(), [d, x] = $(
3204
3220
  null
3205
3221
  ), o = z({
@@ -3242,8 +3258,8 @@ function as({ templateId: a }) {
3242
3258
  ] })
3243
3259
  ] });
3244
3260
  }
3245
- function ss({ templateId: a }) {
3246
- const l = Z(), d = ve(), [x, o] = $(null), [f, c] = $(null), { data: r, isFetching: u } = G({
3261
+ function is({ templateId: a }) {
3262
+ const l = Z(), d = Ne(), [x, o] = $(null), [f, c] = $(null), { data: r, isFetching: u } = G({
3247
3263
  queryKey: ["pipeline-version-diff", a, f],
3248
3264
  queryFn: () => l.request(Y(`/pipelines/${a}/versions/${f}/diff`)).then((p) => p.data),
3249
3265
  enabled: f != null
@@ -3264,7 +3280,7 @@ function ss({ templateId: a }) {
3264
3280
  });
3265
3281
  return /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-3", children: [
3266
3282
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
3267
- /* @__PURE__ */ e(pa, { className: "h-4 w-4 text-slate-400" }),
3283
+ /* @__PURE__ */ e(xa, { className: "h-4 w-4 text-slate-400" }),
3268
3284
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-semibold text-slate-800", children: "Config versions" }),
3269
3285
  b && b.length > 0 && /* @__PURE__ */ e("span", { className: "ml-auto rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-semibold text-slate-500 dark:bg-muted dark:text-muted-foreground", children: b.length })
3270
3286
  ] }),
@@ -3282,7 +3298,7 @@ function ss({ templateId: a }) {
3282
3298
  p.note ?? "—",
3283
3299
  (n = p.created_by_name) != null && n.trim() ? ` · ${p.created_by_name}` : ""
3284
3300
  ] }),
3285
- /* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: ga(p.created_at) }),
3301
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: va(p.created_at) }),
3286
3302
  x === p.id ? /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center gap-1.5", children: [
3287
3303
  /* @__PURE__ */ e(
3288
3304
  P,
@@ -3327,16 +3343,16 @@ function ss({ templateId: a }) {
3327
3343
  ] })
3328
3344
  ] }, p.id);
3329
3345
  }) }),
3330
- f != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: u ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : r ? /* @__PURE__ */ e(ns, { fromVersion: r.from_version, to: r.to, diff: r.diff }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Could not load the diff." }) }),
3346
+ f != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: u ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : r ? /* @__PURE__ */ e(os, { fromVersion: r.from_version, to: r.to, diff: r.diff }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Could not load the diff." }) }),
3331
3347
  /* @__PURE__ */ e("p", { className: "text-[10.5px] text-slate-400", children: "Restore snapshots the current config first, then upserts states/transitions/bindings by id — states are never deleted, and transitions with execution history are kept." })
3332
3348
  ] });
3333
3349
  }
3334
- function Ke(a) {
3350
+ function Be(a) {
3335
3351
  if (a == null || a === "") return "(empty)";
3336
3352
  const l = typeof a == "string" ? a : JSON.stringify(a);
3337
3353
  return l.length > 80 ? `${l.slice(0, 80)}…` : l;
3338
3354
  }
3339
- function ns({
3355
+ function os({
3340
3356
  fromVersion: a,
3341
3357
  to: l,
3342
3358
  diff: d
@@ -3364,10 +3380,10 @@ function ns({
3364
3380
  /* @__PURE__ */ e("span", { className: "font-mono", children: f.field }),
3365
3381
  ":",
3366
3382
  " ",
3367
- /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ke(f.from) }),
3383
+ /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Be(f.from) }),
3368
3384
  " ",
3369
3385
  "→ ",
3370
- /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ke(f.to) })
3386
+ /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Be(f.to) })
3371
3387
  ]
3372
3388
  },
3373
3389
  f.field
@@ -3407,11 +3423,11 @@ function ns({
3407
3423
  /* @__PURE__ */ e("span", { className: "font-mono", children: u.field }),
3408
3424
  ":",
3409
3425
  " ",
3410
- /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ke(u.from) }),
3426
+ /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Be(u.from) }),
3411
3427
  " ",
3412
3428
  "→",
3413
3429
  " ",
3414
- /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ke(u.to) })
3430
+ /* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Be(u.to) })
3415
3431
  ]
3416
3432
  },
3417
3433
  u.field
@@ -3421,7 +3437,7 @@ function ns({
3421
3437
  )
3422
3438
  ] });
3423
3439
  }
3424
- function Ye({
3440
+ function Je({
3425
3441
  state: a,
3426
3442
  selected: l,
3427
3443
  onClick: d
@@ -3433,13 +3449,13 @@ function Ye({
3433
3449
  boxShadow: l ? `0 0 0 1px ${a.color ?? "#475569"}` : void 0
3434
3450
  };
3435
3451
  return d ? /* @__PURE__ */ t("button", { type: "button", className: `${x} transition-shadow`, style: o, onClick: d, children: [
3436
- l && /* @__PURE__ */ e(ye, { className: "h-3 w-3" }),
3452
+ l && /* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
3437
3453
  a.label
3438
3454
  ] }) : /* @__PURE__ */ e("span", { className: x, style: o, children: a.label });
3439
3455
  }
3440
- function ls({ value: a, onCommit: l }) {
3456
+ function cs({ value: a, onCommit: l }) {
3441
3457
  const [d, x] = $(a);
3442
- return ue(() => x(a), [a]), /* @__PURE__ */ e(
3458
+ return he(() => x(a), [a]), /* @__PURE__ */ e(
3443
3459
  "input",
3444
3460
  {
3445
3461
  value: d,
@@ -3456,7 +3472,7 @@ function ls({ value: a, onCommit: l }) {
3456
3472
  }
3457
3473
  );
3458
3474
  }
3459
- function rs({
3475
+ function ds({
3460
3476
  states: a,
3461
3477
  saving: l,
3462
3478
  onSave: d,
@@ -3484,7 +3500,7 @@ function rs({
3484
3500
  /* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(pick 2 or more — the record enters ALL of them at once)" })
3485
3501
  ] }),
3486
3502
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: a.map((p) => /* @__PURE__ */ e(
3487
- Ye,
3503
+ Je,
3488
3504
  {
3489
3505
  state: p,
3490
3506
  selected: c.includes(p.key),
@@ -3499,7 +3515,7 @@ function rs({
3499
3515
  /* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(auto-entered when every branch reaches a terminal state)" })
3500
3516
  ] }),
3501
3517
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: a.filter((p) => !c.includes(p.key)).map((p) => /* @__PURE__ */ e(
3502
- Ye,
3518
+ Je,
3503
3519
  {
3504
3520
  state: p,
3505
3521
  selected: u === p.key,
@@ -3524,11 +3540,11 @@ function rs({
3524
3540
  ] })
3525
3541
  ] });
3526
3542
  }
3527
- function is({
3543
+ function ms({
3528
3544
  templateId: a,
3529
3545
  states: l
3530
3546
  }) {
3531
- const d = Z(), x = ve(), [o, f] = $(!1), [c, r] = $(null), u = ["workflow-splits", a], { data: b } = G({
3547
+ const d = Z(), x = Ne(), [o, f] = $(!1), [c, r] = $(null), u = ["workflow-splits", a], { data: b } = G({
3532
3548
  queryKey: u,
3533
3549
  queryFn: () => d.request(Y(`/workflows/templates/${a}/splits`)).then((n) => n.data)
3534
3550
  }), h = () => x.invalidateQueries({ queryKey: u }), m = z({
@@ -3552,7 +3568,7 @@ function is({
3552
3568
  /* @__PURE__ */ t("div", { className: "flex items-start justify-between gap-4", children: [
3553
3569
  /* @__PURE__ */ t("h2", { className: "flex-1 text-[13px] font-semibold text-slate-800", children: [
3554
3570
  /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
3555
- /* @__PURE__ */ e(ma, { className: "h-4 w-4 text-slate-400" }),
3571
+ /* @__PURE__ */ e(ha, { className: "h-4 w-4 text-slate-400" }),
3556
3572
  "Parallel Branches",
3557
3573
  /* @__PURE__ */ e("span", { className: "font-mono text-[11px] font-normal text-slate-400", children: (b == null ? void 0 : b.length) ?? 0 })
3558
3574
  ] }),
@@ -3567,7 +3583,7 @@ function is({
3567
3583
  onClick: () => f(!0),
3568
3584
  disabled: l.length < 3,
3569
3585
  children: [
3570
- /* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
3586
+ /* @__PURE__ */ e(ge, { className: "h-3 w-3" }),
3571
3587
  "Add Split"
3572
3588
  ]
3573
3589
  }
@@ -3583,9 +3599,9 @@ function is({
3583
3599
  /* @__PURE__ */ t("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
3584
3600
  /* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-700", children: n.label }),
3585
3601
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
3586
- n.branch_state_objs.map((y) => /* @__PURE__ */ e(Ye, { state: y }, y.id)),
3587
- /* @__PURE__ */ e(Lt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
3588
- n.join_state_obj ? /* @__PURE__ */ e(Ye, { state: n.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
3602
+ n.branch_state_objs.map((y) => /* @__PURE__ */ e(Je, { state: y }, y.id)),
3603
+ /* @__PURE__ */ e(Kt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
3604
+ n.join_state_obj ? /* @__PURE__ */ e(Je, { state: n.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
3589
3605
  ] })
3590
3606
  ] }),
3591
3607
  c === n.id ? /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-2", children: [
@@ -3625,7 +3641,7 @@ function is({
3625
3641
  n.id
3626
3642
  )),
3627
3643
  o && /* @__PURE__ */ e(
3628
- rs,
3644
+ ds,
3629
3645
  {
3630
3646
  states: l,
3631
3647
  saving: m.isPending,
@@ -3635,7 +3651,7 @@ function is({
3635
3651
  )
3636
3652
  ] });
3637
3653
  }
3638
- function os({ bindings: a }) {
3654
+ function ps({ bindings: a }) {
3639
3655
  var b;
3640
3656
  const l = Z(), [d, x] = $(""), [o, f] = $(""), c = o || ((b = a[0]) == null ? void 0 : b.collection) || "", r = z({
3641
3657
  mutationFn: () => l.request(J("/pipelines/simulate", { collection: c, item_id: d.trim() })).then((h) => h.data),
@@ -3750,8 +3766,8 @@ function os({ bindings: a }) {
3750
3766
  ] })
3751
3767
  ] });
3752
3768
  }
3753
- const Re = 900, xe = 230;
3754
- function Wt({
3769
+ const Re = 900, fe = 230;
3770
+ function Ht({
3755
3771
  selected: a,
3756
3772
  onChange: l
3757
3773
  }) {
@@ -3778,7 +3794,7 @@ function Wt({
3778
3794
  "aria-label": `Remove ${m.name}`,
3779
3795
  className: "text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",
3780
3796
  onClick: () => l(a.filter((p) => p.id !== m.id)),
3781
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
3797
+ children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
3782
3798
  }
3783
3799
  )
3784
3800
  ]
@@ -3816,7 +3832,7 @@ function Wt({
3816
3832
  "flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border",
3817
3833
  p ? "border-nvr-cyan bg-nvr-cyan text-white" : "border-slate-300 dark:border-border"
3818
3834
  ),
3819
- children: p && /* @__PURE__ */ e(ye, { className: "h-2.5 w-2.5" })
3835
+ children: p && /* @__PURE__ */ e(ve, { className: "h-2.5 w-2.5" })
3820
3836
  }
3821
3837
  ),
3822
3838
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate whitespace-nowrap font-medium text-slate-700 dark:text-slate-200", children: u(m) }),
@@ -3830,21 +3846,21 @@ function Wt({
3830
3846
  ] })
3831
3847
  ] });
3832
3848
  }
3833
- function cs({
3849
+ function us({
3834
3850
  templateId: a,
3835
3851
  cluster: l,
3836
3852
  onDone: d
3837
3853
  }) {
3838
3854
  var _, N;
3839
- const x = Z(), o = ve(), f = !!((_ = l.suggestion) != null && _.group_id) && l.suggestion.mismatched_filters.length === 0, c = Object.values(l.dims).filter(Boolean).join(" · ") || "New group", [r, u] = $(c), [b, h] = $([]), [m, p] = $([]), n = Da(), { data: y } = G({
3855
+ const x = Z(), o = Ne(), f = !!((_ = l.suggestion) != null && _.group_id) && l.suggestion.mismatched_filters.length === 0, c = Object.values(l.dims).filter(Boolean).join(" · ") || "New group", [r, u] = $(c), [b, h] = $([]), [m, p] = $([]), n = Ma(), { data: y } = G({
3840
3856
  queryKey: ["user-groups-teams"],
3841
3857
  queryFn: () => x.request(Y("/user-groups")).then((C) => C.data),
3842
3858
  staleTime: 6e4
3843
3859
  }), q = (y ?? []).map((C) => ({
3844
3860
  ...C,
3845
- rank: Aa(C.scopes, l.filters, n, l.collection)
3861
+ rank: za(C.scopes, l.filters, n, l.collection)
3846
3862
  })).sort(
3847
- (C, D) => St(C.rank.tier) - St(D.rank.tier) || C.name.localeCompare(D.name, void 0, { sensitivity: "base" })
3863
+ (C, D) => Ft(C.rank.tier) - Ft(D.rank.tier) || C.name.localeCompare(D.name, void 0, { sensitivity: "base" })
3848
3864
  ), v = z({
3849
3865
  mutationFn: async () => {
3850
3866
  var D;
@@ -3922,7 +3938,7 @@ function cs({
3922
3938
  );
3923
3939
  })
3924
3940
  ] }),
3925
- /* @__PURE__ */ e(Wt, { selected: b, onChange: h }),
3941
+ /* @__PURE__ */ e(Ht, { selected: b, onChange: h }),
3926
3942
  /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-1.5", children: [
3927
3943
  /* @__PURE__ */ e(P, { size: "sm", variant: "ghost", className: "h-6 px-2 text-[11px]", onClick: d, children: "Cancel" }),
3928
3944
  /* @__PURE__ */ e(
@@ -3938,8 +3954,8 @@ function cs({
3938
3954
  ] })
3939
3955
  ] });
3940
3956
  }
3941
- function ds({ templateId: a, finding: l }) {
3942
- const d = Z(), x = ve(), [o, f] = $(
3957
+ function hs({ templateId: a, finding: l }) {
3958
+ const d = Z(), x = Ne(), [o, f] = $(
3943
3959
  "idle"
3944
3960
  ), [c, r] = $([]), u = (v) => {
3945
3961
  T.success(v), f("idle"), r([]), x.invalidateQueries({ queryKey: ["owner-lint", a] }), x.invalidateQueries({ queryKey: ["owner-gaps", a] }), x.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
@@ -4106,7 +4122,7 @@ function ds({ templateId: a, finding: l }) {
4106
4122
  )
4107
4123
  ] }),
4108
4124
  o === "add-member" && /* @__PURE__ */ t("div", { className: "mt-2 ml-2 space-y-2 rounded-md border border-slate-200 bg-slate-50/60 p-2.5 dark:border-border dark:bg-muted/20", children: [
4109
- /* @__PURE__ */ e(Wt, { selected: c, onChange: r }),
4125
+ /* @__PURE__ */ e(Ht, { selected: c, onChange: r }),
4110
4126
  /* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-1.5", children: [
4111
4127
  /* @__PURE__ */ e(
4112
4128
  P,
@@ -4134,11 +4150,11 @@ function ds({ templateId: a, finding: l }) {
4134
4150
  ] })
4135
4151
  ] });
4136
4152
  }
4137
- function ms({
4153
+ function xs({
4138
4154
  templateId: a,
4139
4155
  states: l
4140
4156
  }) {
4141
- const d = Z(), x = ve(), [o, f] = $(!1), [c, r] = $(!1), [u, b] = $(null), { data: h, isFetching: m, refetch: p } = G({
4157
+ const d = Z(), x = Ne(), [o, f] = $(!1), [c, r] = $(!1), [u, b] = $(null), { data: h, isFetching: m, refetch: p } = G({
4142
4158
  queryKey: ["owner-gaps", a],
4143
4159
  queryFn: () => d.request(Y(`/pipelines/${a}/owner-gaps`)).then((g) => g.data),
4144
4160
  enabled: o,
@@ -4173,7 +4189,7 @@ function ms({
4173
4189
  {
4174
4190
  className: "inline-flex items-baseline gap-1 rounded border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] dark:border-border dark:bg-muted/40",
4175
4191
  children: [
4176
- /* @__PURE__ */ e("span", { className: "text-slate-400", children: Vt(g) }),
4192
+ /* @__PURE__ */ e("span", { className: "text-slate-400", children: Gt(g) }),
4177
4193
  /* @__PURE__ */ e("span", { className: "font-medium text-slate-700 dark:text-foreground", children: i })
4178
4194
  ]
4179
4195
  },
@@ -4290,7 +4306,7 @@ function ms({
4290
4306
  className: "text-slate-400 transition-colors hover:text-red-600 dark:hover:text-red-400",
4291
4307
  disabled: y.isPending,
4292
4308
  onClick: () => y.mutate(g.id),
4293
- children: /* @__PURE__ */ e(be, { className: "h-3 w-3" })
4309
+ children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
4294
4310
  }
4295
4311
  )
4296
4312
  ]
@@ -4314,7 +4330,7 @@ function ms({
4314
4330
  ] })
4315
4331
  ] }),
4316
4332
  j.map(([g, i]) => {
4317
- const w = C.get(g), F = i.reduce((E, B) => E + B.count, 0);
4333
+ const w = C.get(g), F = i.reduce((E, K) => E + K.count, 0);
4318
4334
  return /* @__PURE__ */ t(
4319
4335
  "div",
4320
4336
  {
@@ -4328,7 +4344,7 @@ function ms({
4328
4344
  style: { backgroundColor: (w == null ? void 0 : w.color) ?? "#94a3b8" }
4329
4345
  }
4330
4346
  ),
4331
- /* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (w == null ? void 0 : w.label) ?? Qt(g) }),
4347
+ /* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (w == null ? void 0 : w.label) ?? Ut(g) }),
4332
4348
  /* @__PURE__ */ t("span", { className: "ml-auto text-[11px] tabular-nums text-slate-400", children: [
4333
4349
  F,
4334
4350
  " record",
@@ -4340,14 +4356,14 @@ function ms({
4340
4356
  i.length === 1 ? "" : "s"
4341
4357
  ] })
4342
4358
  ] }),
4343
- /* @__PURE__ */ e("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: i.map((E, B) => {
4359
+ /* @__PURE__ */ e("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: i.map((E, K) => {
4344
4360
  const L = `${E.state_id}|${JSON.stringify(E.dims)}`;
4345
4361
  return (
4346
4362
  // biome-ignore lint/suspicious/noArrayIndexKey: server-ordered clusters
4347
4363
  /* @__PURE__ */ t("div", { className: "px-3 py-2", children: [
4348
4364
  /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
4349
4365
  /* @__PURE__ */ e("span", { className: "w-8 shrink-0 text-[13px] font-semibold tabular-nums text-slate-800 dark:text-foreground", children: E.count }),
4350
- Object.entries(E.dims).filter(([, M]) => M).length > 0 ? Object.entries(E.dims).filter(([, M]) => M).map(([M, Q]) => O(M, Q)) : /* @__PURE__ */ e("span", { className: "text-[11px] italic text-slate-400", children: "no dimension values resolved" }),
4366
+ Object.entries(E.dims).filter(([, M]) => M).length > 0 ? Object.entries(E.dims).filter(([, M]) => M).map(([M, W]) => O(M, W)) : /* @__PURE__ */ e("span", { className: "text-[11px] italic text-slate-400", children: "no dimension values resolved" }),
4351
4367
  /* @__PURE__ */ t(
4352
4368
  "span",
4353
4369
  {
@@ -4383,13 +4399,13 @@ function ms({
4383
4399
  " ",
4384
4400
  "already matches",
4385
4401
  " ",
4386
- Pt(E.suggestion.matched_filters.join(", ")) || "nothing"
4402
+ At(E.suggestion.matched_filters.join(", ")) || "nothing"
4387
4403
  ] }),
4388
4404
  E.suggestion.mismatched_filters.length > 0 && /* @__PURE__ */ t("span", { className: "text-amber-700 dark:text-amber-400", children: [
4389
4405
  " ",
4390
4406
  "— it misses",
4391
4407
  " ",
4392
- Pt(E.suggestion.mismatched_filters.join(", ")),
4408
+ At(E.suggestion.mismatched_filters.join(", ")),
4393
4409
  ", so assigning creates a group for this combination"
4394
4410
  ] })
4395
4411
  ] }) : /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1 text-amber-700 dark:text-amber-400", children: [
@@ -4397,14 +4413,14 @@ function ms({
4397
4413
  "No group comes close — assigning creates one for this combination."
4398
4414
  ] }) }),
4399
4415
  u === L && /* @__PURE__ */ e(
4400
- cs,
4416
+ us,
4401
4417
  {
4402
4418
  templateId: a,
4403
4419
  cluster: E,
4404
4420
  onDone: () => b(null)
4405
4421
  }
4406
4422
  )
4407
- ] }, B)
4423
+ ] }, K)
4408
4424
  );
4409
4425
  }) })
4410
4426
  ]
@@ -4427,27 +4443,27 @@ function ms({
4427
4443
  ] }),
4428
4444
  /* @__PURE__ */ e("div", { className: "max-h-96 divide-y divide-slate-100 overflow-y-auto px-3 dark:divide-border/60", children: _.map((g, i) => (
4429
4445
  // biome-ignore lint/suspicious/noArrayIndexKey: findings are positional
4430
- /* @__PURE__ */ e(ds, { templateId: a, finding: g }, i)
4446
+ /* @__PURE__ */ e(hs, { templateId: a, finding: g }, i)
4431
4447
  )) })
4432
4448
  ] })
4433
4449
  ] })
4434
4450
  ] });
4435
4451
  }
4436
- function Qt(a) {
4452
+ function Ut(a) {
4437
4453
  return a.replace(/[_-]+/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
4438
4454
  }
4439
- function Vt(a) {
4455
+ function Gt(a) {
4440
4456
  const l = a.split(".");
4441
4457
  for (; l.length > 1 && /^((short_)?name|label|key|id|.*_id)$/i.test(l[l.length - 1]); )
4442
4458
  l.pop();
4443
4459
  const d = l[l.length - 1].replace(/s$/i, "");
4444
- return Qt(d);
4460
+ return Ut(d);
4445
4461
  }
4446
- function Pt(a) {
4447
- return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (l) => Vt(l));
4462
+ function At(a) {
4463
+ return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (l) => Gt(l));
4448
4464
  }
4449
- function ps({ templateId: a }) {
4450
- const l = Z(), d = ve(), [x, o] = $(""), [f, c] = $(""), [r, u] = $(!1), { data: b } = G({
4465
+ function fs({ templateId: a }) {
4466
+ const l = Z(), d = Ne(), [x, o] = $(""), [f, c] = $(""), [r, u] = $(!1), { data: b } = G({
4451
4467
  queryKey: ["instance-distribution", a],
4452
4468
  queryFn: () => l.request(Y(`/pipelines/${a}/instance-distribution`)),
4453
4469
  staleTime: 3e4
@@ -4530,9 +4546,9 @@ function ps({ templateId: a }) {
4530
4546
  n,
4531
4547
  " instance(s) to"
4532
4548
  ] }),
4533
- /* @__PURE__ */ t(Na, { value: f || void 0, onValueChange: c, children: [
4534
- /* @__PURE__ */ e(wa, { className: "h-8 w-[220px] text-[12.5px]", children: /* @__PURE__ */ e(ka, { placeholder: "Pick a state…" }) }),
4535
- /* @__PURE__ */ e(_a, { children: m.filter((N) => String(N.id) !== x).map((N) => /* @__PURE__ */ e(Ca, { value: N.id, children: N.label }, N.id)) })
4549
+ /* @__PURE__ */ t(Ca, { value: f || void 0, onValueChange: c, children: [
4550
+ /* @__PURE__ */ e(Sa, { className: "h-8 w-[220px] text-[12.5px]", children: /* @__PURE__ */ e(qa, { placeholder: "Pick a state…" }) }),
4551
+ /* @__PURE__ */ e($a, { children: m.filter((N) => String(N.id) !== x).map((N) => /* @__PURE__ */ e(Fa, { value: N.id, children: N.label }, N.id)) })
4536
4552
  ] }),
4537
4553
  f && !r && /* @__PURE__ */ e(P, { size: "sm", className: "h-8 text-[12.5px]", onClick: () => u(!0), children: "Migrate…" }),
4538
4554
  f && r && /* @__PURE__ */ t("span", { className: "flex items-center gap-2 rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1 dark:border-amber-500/40 dark:bg-amber-400/10", children: [
@@ -4563,7 +4579,7 @@ function ps({ templateId: a }) {
4563
4579
  ] })
4564
4580
  ] });
4565
4581
  }
4566
- function us({ templateId: a }) {
4582
+ function gs({ templateId: a }) {
4567
4583
  const l = Z(), [d, x] = $(
4568
4584
  null
4569
4585
  ), [o, f] = $(() => {
@@ -4572,47 +4588,47 @@ function us({ templateId: a }) {
4572
4588
  } catch {
4573
4589
  return {};
4574
4590
  }
4575
- }), c = Je(null), { data: r } = G({
4591
+ }), c = Xe(null), { data: r } = G({
4576
4592
  queryKey: ["pipeline-canvas", a],
4577
4593
  queryFn: () => l.request(Y(`/pipelines/${a}`)).then((i) => i.data),
4578
4594
  staleTime: 3e4
4579
- }), u = (r == null ? void 0 : r.states) ?? [], b = (r == null ? void 0 : r.transitions) ?? [], h = ha(() => {
4595
+ }), u = (r == null ? void 0 : r.states) ?? [], b = (r == null ? void 0 : r.transitions) ?? [], h = ga(() => {
4580
4596
  var Me;
4581
- const i = new Map(u.map((K) => [String(K.id).toUpperCase(), K])), w = /* @__PURE__ */ new Map(), F = u.filter((K) => K.is_initial).map((K) => ({ id: String(K.id).toUpperCase(), r: 0 })), E = /* @__PURE__ */ new Map();
4582
- for (const K of b) {
4583
- if (!K.from_state) continue;
4584
- const X = String(K.from_state).toUpperCase();
4585
- E.set(X, [...E.get(X) ?? [], String(K.to_state).toUpperCase()]);
4597
+ const i = new Map(u.map((Q) => [String(Q.id).toUpperCase(), Q])), w = /* @__PURE__ */ new Map(), F = u.filter((Q) => Q.is_initial).map((Q) => ({ id: String(Q.id).toUpperCase(), r: 0 })), E = /* @__PURE__ */ new Map();
4598
+ for (const Q of b) {
4599
+ if (!Q.from_state) continue;
4600
+ const X = String(Q.from_state).toUpperCase();
4601
+ E.set(X, [...E.get(X) ?? [], String(Q.to_state).toUpperCase()]);
4586
4602
  }
4587
4603
  for (; F.length > 0; ) {
4588
- const { id: K, r: X } = F.shift();
4589
- if (!(w.has(K) && w.get(K) <= X)) {
4590
- w.has(K) || w.set(K, X);
4591
- for (const se of E.get(K) ?? []) {
4592
- const Ne = i.get(se);
4593
- !w.has(se) && (((Me = i.get(K)) == null ? void 0 : Me.sort) ?? 0) <= ((Ne == null ? void 0 : Ne.sort) ?? 0) && F.push({ id: se, r: X + 1 });
4604
+ const { id: Q, r: X } = F.shift();
4605
+ if (!(w.has(Q) && w.get(Q) <= X)) {
4606
+ w.has(Q) || w.set(Q, X);
4607
+ for (const de of E.get(Q) ?? []) {
4608
+ const me = i.get(de);
4609
+ !w.has(de) && (((Me = i.get(Q)) == null ? void 0 : Me.sort) ?? 0) <= ((me == null ? void 0 : me.sort) ?? 0) && F.push({ id: de, r: X + 1 });
4594
4610
  }
4595
4611
  }
4596
4612
  }
4597
- let B = Math.max(0, ...w.values());
4598
- for (const K of u) {
4599
- const X = String(K.id).toUpperCase();
4600
- w.has(X) || w.set(X, ++B);
4613
+ let K = Math.max(0, ...w.values());
4614
+ for (const Q of u) {
4615
+ const X = String(Q.id).toUpperCase();
4616
+ w.has(X) || w.set(X, ++K);
4601
4617
  }
4602
4618
  const L = /* @__PURE__ */ new Map();
4603
- for (const K of [...u].sort((X, se) => X.sort - se.sort)) {
4604
- const X = String(K.id).toUpperCase(), se = w.get(X) ?? 0;
4605
- L.set(se, [...L.get(se) ?? [], X]);
4619
+ for (const Q of [...u].sort((X, de) => X.sort - de.sort)) {
4620
+ const X = String(Q.id).toUpperCase(), de = w.get(X) ?? 0;
4621
+ L.set(de, [...L.get(de) ?? [], X]);
4606
4622
  }
4607
- const M = 168, Q = 44, te = 70, ae = 18, ce = /* @__PURE__ */ new Map();
4608
- let de = 1;
4609
- for (const [K, X] of L)
4610
- de = Math.max(de, X.length), X.forEach((se, Ne) => {
4611
- ce.set(se, { x: 20 + K * (M + te), y: 20 + Ne * (Q + ae) });
4623
+ const M = 168, W = 44, te = 70, ae = 18, oe = /* @__PURE__ */ new Map();
4624
+ let ce = 1;
4625
+ for (const [Q, X] of L)
4626
+ ce = Math.max(ce, X.length), X.forEach((de, me) => {
4627
+ oe.set(de, { x: 20 + Q * (M + te), y: 20 + me * (W + ae) });
4612
4628
  });
4613
- const Xe = 60 + (Math.max(0, ...L.keys()) + 1) * (M + te), W = 60 + de * (Q + ae);
4614
- return { pos: ce, width: Xe, height: W, NODE_W: M, NODE_H: Q };
4615
- }, [u, b]), m = (i) => o[i] ?? h.pos.get(i) ?? { x: 20, y: 20 }, [p, n] = $(null), [y, q] = $(null), v = ve(), _ = z({
4629
+ const Ie = 60 + (Math.max(0, ...L.keys()) + 1) * (M + te), B = 60 + ce * (W + ae);
4630
+ return { pos: oe, width: Ie, height: B, NODE_W: M, NODE_H: W };
4631
+ }, [u, b]), m = (i) => o[i] ?? h.pos.get(i) ?? { x: 20, y: 20 }, [p, n] = $(null), [y, q] = $(null), v = Ne(), _ = z({
4616
4632
  mutationFn: (i) => l.request(
4617
4633
  J(`/pipelines/${a}/transitions`, {
4618
4634
  from_state: i.from,
@@ -4663,8 +4679,8 @@ function us({ templateId: a }) {
4663
4679
  c.current && (c.current = null, f((i) => (localStorage.setItem(`nvr_canvas_${a}`, JSON.stringify(i)), i)));
4664
4680
  }, j = (d == null ? void 0 : d.kind) === "state" ? u.find((i) => String(i.id) === d.id) : null, O = (d == null ? void 0 : d.kind) === "transition" ? b.find((i) => String(i.id) === d.id) : null, g = (i) => {
4665
4681
  const F = Array.from(document.querySelectorAll("h3, p, span, button")).find((E) => {
4666
- var B;
4667
- return ((B = E.textContent) == null ? void 0 : B.trim()) === i;
4682
+ var K;
4683
+ return ((K = E.textContent) == null ? void 0 : K.trim()) === i;
4668
4684
  });
4669
4685
  F == null || F.scrollIntoView({ behavior: "smooth", block: "center" });
4670
4686
  };
@@ -4695,7 +4711,7 @@ function us({ templateId: a }) {
4695
4711
  ) }),
4696
4712
  b.map((i) => {
4697
4713
  if (!i.from_state) return null;
4698
- const w = m(String(i.from_state).toUpperCase()), F = m(String(i.to_state).toUpperCase()), E = w.x + h.NODE_W, B = w.y + h.NODE_H / 2, L = F.x, M = F.y + h.NODE_H / 2, Q = L < E, te = Q ? Math.max(E, L + h.NODE_W) + 40 : (E + L) / 2, ae = Q ? `M ${E} ${B} C ${E + 60} ${B - 40}, ${L - 60} ${M - 40}, ${L} ${M}` : `M ${E} ${B} C ${te} ${B}, ${te} ${M}, ${L} ${M}`, ce = (d == null ? void 0 : d.kind) === "transition" && d.id === String(i.id), de = Array.isArray(i.condition_rules) ? i.condition_rules.length > 0 : !!i.condition_rules;
4714
+ const w = m(String(i.from_state).toUpperCase()), F = m(String(i.to_state).toUpperCase()), E = w.x + h.NODE_W, K = w.y + h.NODE_H / 2, L = F.x, M = F.y + h.NODE_H / 2, W = L < E, te = W ? Math.max(E, L + h.NODE_W) + 40 : (E + L) / 2, ae = W ? `M ${E} ${K} C ${E + 60} ${K - 40}, ${L - 60} ${M - 40}, ${L} ${M}` : `M ${E} ${K} C ${te} ${K}, ${te} ${M}, ${L} ${M}`, oe = (d == null ? void 0 : d.kind) === "transition" && d.id === String(i.id), ce = Array.isArray(i.condition_rules) ? i.condition_rules.length > 0 : !!i.condition_rules;
4699
4715
  return (
4700
4716
  // biome-ignore lint/a11y/useKeyWithClickEvents: canvas edge, inspect-only
4701
4717
  /* @__PURE__ */ t(
@@ -4710,22 +4726,22 @@ function us({ templateId: a }) {
4710
4726
  {
4711
4727
  d: ae,
4712
4728
  fill: "none",
4713
- strokeWidth: ce ? 2.5 : 1.5,
4729
+ strokeWidth: oe ? 2.5 : 1.5,
4714
4730
  markerEnd: "url(#cv-arrow)",
4715
- className: ce ? "stroke-nvr-cyan" : Q ? "stroke-amber-400" : "stroke-slate-300 dark:stroke-slate-600",
4731
+ className: oe ? "stroke-nvr-cyan" : W ? "stroke-amber-400" : "stroke-slate-300 dark:stroke-slate-600",
4716
4732
  strokeDasharray: i.auto_trigger ? "5 3" : void 0
4717
4733
  }
4718
4734
  ),
4719
- (i.auto_trigger || de) && /* @__PURE__ */ t(
4735
+ (i.auto_trigger || ce) && /* @__PURE__ */ t(
4720
4736
  "text",
4721
4737
  {
4722
4738
  x: (E + L) / 2,
4723
- y: (B + M) / 2 - 6,
4739
+ y: (K + M) / 2 - 6,
4724
4740
  textAnchor: "middle",
4725
4741
  className: "fill-slate-500 text-[11px]",
4726
4742
  children: [
4727
4743
  i.auto_trigger ? "⚡" : "",
4728
- de ? "◆" : ""
4744
+ ce ? "◆" : ""
4729
4745
  ]
4730
4746
  }
4731
4747
  )
@@ -4742,7 +4758,7 @@ function us({ templateId: a }) {
4742
4758
  y1: m(p).y + h.NODE_H / 2,
4743
4759
  x2: y.x,
4744
4760
  y2: y.y,
4745
- stroke: Kt,
4761
+ stroke: Wt,
4746
4762
  strokeWidth: 2,
4747
4763
  strokeDasharray: "5 4"
4748
4764
  }
@@ -4755,7 +4771,7 @@ function us({ templateId: a }) {
4755
4771
  "g",
4756
4772
  {
4757
4773
  transform: `translate(${F.x}, ${F.y})`,
4758
- onPointerDown: (B) => N(w, B),
4774
+ onPointerDown: (K) => N(w, K),
4759
4775
  onClick: () => x({ kind: "state", id: String(i.id) }),
4760
4776
  className: "cursor-grab",
4761
4777
  children: [
@@ -4860,7 +4876,7 @@ function us({ templateId: a }) {
4860
4876
  ] })
4861
4877
  ] });
4862
4878
  }
4863
- function hs({ templateId: a }) {
4879
+ function bs({ templateId: a }) {
4864
4880
  var j, O;
4865
4881
  const l = Z(), [d, x] = $(90), [o, f] = $(null), { data: c } = G({
4866
4882
  queryKey: ["flow-map", a, d],
@@ -4874,19 +4890,19 @@ function hs({ templateId: a }) {
4874
4890
  const p = Math.max(360, r.length * 46), n = (g) => {
4875
4891
  const i = r.filter((L) => (g.get(L.id) ?? 0) > 0), w = [...g.values()].reduce((L, M) => L + M, 0) || 1, F = (i.length + 1) * 8;
4876
4892
  let E = 20;
4877
- const B = /* @__PURE__ */ new Map();
4893
+ const K = /* @__PURE__ */ new Map();
4878
4894
  for (const L of i) {
4879
4895
  const M = Math.max(14, (g.get(L.id) ?? 0) / w * (p - F - 40));
4880
- B.set(L.id, { y: E, h: M }), E += M + 8;
4896
+ K.set(L.id, { y: E, h: M }), E += M + 8;
4881
4897
  }
4882
- return { pos: B, height: E + 20 };
4898
+ return { pos: K, height: E + 20 };
4883
4899
  }, y = n(h), q = n(m), v = Math.max(y.height, q.height, 380), _ = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), C = u.map((g) => {
4884
4900
  const i = y.pos.get(g.from), w = q.pos.get(g.to);
4885
4901
  if (!i || !w) return null;
4886
- const F = g.count / Math.max(1, h.get(g.from) ?? 1), E = g.count / Math.max(1, m.get(g.to) ?? 1), B = Math.max(1.5, i.h * F), L = Math.max(1.5, w.h * E), M = i.y + (_.get(g.from) ?? 0), Q = w.y + (N.get(g.to) ?? 0);
4887
- _.set(g.from, (_.get(g.from) ?? 0) + B), N.set(g.to, (N.get(g.to) ?? 0) + L);
4888
- const te = xe + 8, ae = Re - xe - 8, ce = (te + ae) / 2, de = `M ${te} ${M} C ${ce} ${M}, ${ce} ${Q}, ${ae} ${Q} L ${ae} ${Q + L} C ${ce} ${Q + L}, ${ce} ${M + B}, ${te} ${M + B} Z`;
4889
- return { f: g, path: de };
4902
+ const F = g.count / Math.max(1, h.get(g.from) ?? 1), E = g.count / Math.max(1, m.get(g.to) ?? 1), K = Math.max(1.5, i.h * F), L = Math.max(1.5, w.h * E), M = i.y + (_.get(g.from) ?? 0), W = w.y + (N.get(g.to) ?? 0);
4903
+ _.set(g.from, (_.get(g.from) ?? 0) + K), N.set(g.to, (N.get(g.to) ?? 0) + L);
4904
+ const te = fe + 8, ae = Re - fe - 8, oe = (te + ae) / 2, ce = `M ${te} ${M} C ${oe} ${M}, ${oe} ${W}, ${ae} ${W} L ${ae} ${W + L} C ${oe} ${W + L}, ${oe} ${M + K}, ${te} ${M + K} Z`;
4905
+ return { f: g, path: ce };
4890
4906
  }), D = new Map(r.map((g) => [g.id, g]));
4891
4907
  return r.length === 0 ? null : /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4 dark:border-border dark:bg-card", children: [
4892
4908
  /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
@@ -4923,7 +4939,7 @@ function hs({ templateId: a }) {
4923
4939
  "path",
4924
4940
  {
4925
4941
  d: g.path,
4926
- fill: g.f.back ? "#ef4444" : Kt,
4942
+ fill: g.f.back ? "#ef4444" : Wt,
4927
4943
  opacity: o === null ? g.f.back ? 0.45 : 0.3 : o === g.f ? 0.75 : 0.08,
4928
4944
  onMouseEnter: () => f(g.f),
4929
4945
  onMouseLeave: () => f(null)
@@ -4939,7 +4955,7 @@ function hs({ templateId: a }) {
4939
4955
  {
4940
4956
  x: 0,
4941
4957
  y: i.y,
4942
- width: xe,
4958
+ width: fe,
4943
4959
  height: i.h,
4944
4960
  rx: 4,
4945
4961
  fill: ((w = D.get(g)) == null ? void 0 : w.color) ?? "#94a3b8",
@@ -4949,7 +4965,7 @@ function hs({ templateId: a }) {
4949
4965
  /* @__PURE__ */ e(
4950
4966
  "rect",
4951
4967
  {
4952
- x: xe,
4968
+ x: fe,
4953
4969
  y: i.y,
4954
4970
  width: 6,
4955
4971
  height: i.h,
@@ -4960,7 +4976,7 @@ function hs({ templateId: a }) {
4960
4976
  /* @__PURE__ */ e(
4961
4977
  "text",
4962
4978
  {
4963
- x: xe - 8,
4979
+ x: fe - 8,
4964
4980
  y: i.y + i.h / 2 + 3,
4965
4981
  textAnchor: "end",
4966
4982
  className: "fill-slate-700 text-[10.5px] font-medium dark:fill-slate-200",
@@ -4975,9 +4991,9 @@ function hs({ templateId: a }) {
4975
4991
  /* @__PURE__ */ e(
4976
4992
  "rect",
4977
4993
  {
4978
- x: Re - xe,
4994
+ x: Re - fe,
4979
4995
  y: i.y,
4980
- width: xe,
4996
+ width: fe,
4981
4997
  height: i.h,
4982
4998
  rx: 4,
4983
4999
  fill: ((w = D.get(g)) == null ? void 0 : w.color) ?? "#94a3b8",
@@ -4987,7 +5003,7 @@ function hs({ templateId: a }) {
4987
5003
  /* @__PURE__ */ e(
4988
5004
  "rect",
4989
5005
  {
4990
- x: Re - xe - 6,
5006
+ x: Re - fe - 6,
4991
5007
  y: i.y,
4992
5008
  width: 6,
4993
5009
  height: i.h,
@@ -4998,7 +5014,7 @@ function hs({ templateId: a }) {
4998
5014
  /* @__PURE__ */ e(
4999
5015
  "text",
5000
5016
  {
5001
- x: Re - xe + 8,
5017
+ x: Re - fe + 8,
5002
5018
  y: i.y + i.h / 2 + 3,
5003
5019
  className: "fill-slate-700 text-[10.5px] font-medium dark:fill-slate-200",
5004
5020
  children: (((E = D.get(g)) == null ? void 0 : E.label) ?? "").slice(0, 32)
@@ -5021,15 +5037,15 @@ function hs({ templateId: a }) {
5021
5037
  ] })
5022
5038
  ] });
5023
5039
  }
5024
- function xs({ templateId: a }) {
5040
+ function ys({ templateId: a }) {
5025
5041
  const l = Z(), [d, x] = $(90), [o, f] = $(0), [c, r] = $(!1), [u, b] = $(!0), { data: h } = G({
5026
5042
  queryKey: ["pipeline-replay", a, d],
5027
5043
  queryFn: () => l.request(Y(`/pipelines/${a}/replay`, { days: d })).then((_) => _.data),
5028
5044
  staleTime: 5 * 6e4
5029
5045
  }), m = (h == null ? void 0 : h.days) ?? [], p = ((h == null ? void 0 : h.states) ?? []).filter((_) => !u || !_.is_terminal);
5030
- ue(() => {
5046
+ he(() => {
5031
5047
  f(0), r(!1);
5032
- }, []), ue(() => {
5048
+ }, []), he(() => {
5033
5049
  if (!c || m.length === 0) return;
5034
5050
  const _ = setInterval(() => {
5035
5051
  f((N) => N + 1 >= m.length ? (r(!1), N) : N + 1);
@@ -5151,13 +5167,13 @@ function xs({ templateId: a }) {
5151
5167
  ] })
5152
5168
  ] });
5153
5169
  }
5154
- function fs({ onClose: a }) {
5155
- return ue(() => {
5170
+ function vs({ onClose: a }) {
5171
+ return he(() => {
5156
5172
  const l = (d) => {
5157
5173
  d.key === "Escape" && a();
5158
5174
  };
5159
5175
  return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
5160
- }, [a]), fa(
5176
+ }, [a]), ya(
5161
5177
  /* @__PURE__ */ t("div", { className: "fixed inset-0 z-[120]", children: [
5162
5178
  /* @__PURE__ */ e(
5163
5179
  "button",
@@ -5179,19 +5195,19 @@ function fs({ onClose: a }) {
5179
5195
  "aria-label": "Close teams",
5180
5196
  onClick: a,
5181
5197
  className: "ml-auto rounded p-1 text-slate-400 hover:bg-muted hover:text-slate-700 dark:hover:text-slate-200",
5182
- children: /* @__PURE__ */ e(be, { className: "h-4 w-4" })
5198
+ children: /* @__PURE__ */ e(ye, { className: "h-4 w-4" })
5183
5199
  }
5184
5200
  )
5185
5201
  ] }),
5186
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(Ta, { compact: !0 }) })
5202
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(La, { compact: !0 }) })
5187
5203
  ] })
5188
5204
  ] }),
5189
5205
  document.body
5190
5206
  );
5191
5207
  }
5192
5208
  export {
5193
- as as AiReviewCard,
5194
- ms as OwnerGapsCard,
5195
- Ys as PipelineEditorView,
5196
- os as PipelineSimulatorCard
5209
+ rs as AiReviewCard,
5210
+ xs as OwnerGapsCard,
5211
+ en as PipelineEditorView,
5212
+ ps as PipelineSimulatorCard
5197
5213
  };